]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'j/pinctrl' of http://github.com/at91linux/linux-at91 into at91
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Oct 2012 08:17:15 +0000 (10:17 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Oct 2012 08:17:15 +0000 (10:17 +0200)
920 files changed:
.gitignore
Documentation/crypto/asymmetric-keys.txt [new file with mode: 0644]
Documentation/device-mapper/dm-raid.txt
Documentation/kernel-parameters.txt
Documentation/security/keys.txt
Makefile
arch/Kconfig
arch/alpha/Kconfig
arch/alpha/include/asm/module.h
arch/arm/Kconfig
arch/arm/common/Kconfig
arch/arm/include/asm/Kbuild
arch/arm/include/asm/hwcap.h
arch/arm/include/asm/module.h
arch/arm/include/asm/ptrace.h
arch/arm/include/asm/setup.h
arch/arm/include/asm/signal.h
arch/arm/include/asm/swab.h
arch/arm/include/asm/unistd.h
arch/arm/include/uapi/asm/Kbuild
arch/arm/include/uapi/asm/a.out.h [moved from arch/arm/include/asm/a.out.h with 100% similarity]
arch/arm/include/uapi/asm/byteorder.h [moved from arch/arm/include/asm/byteorder.h with 100% similarity]
arch/arm/include/uapi/asm/fcntl.h [moved from arch/arm/include/asm/fcntl.h with 100% similarity]
arch/arm/include/uapi/asm/hwcap.h [new file with mode: 0644]
arch/arm/include/uapi/asm/ioctls.h [moved from arch/arm/include/asm/ioctls.h with 100% similarity]
arch/arm/include/uapi/asm/kvm_para.h [moved from arch/arm/include/asm/kvm_para.h with 100% similarity]
arch/arm/include/uapi/asm/mman.h [moved from arch/arm/include/asm/mman.h with 100% similarity]
arch/arm/include/uapi/asm/posix_types.h [moved from arch/arm/include/asm/posix_types.h with 100% similarity]
arch/arm/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/arm/include/uapi/asm/setup.h [new file with mode: 0644]
arch/arm/include/uapi/asm/sigcontext.h [moved from arch/arm/include/asm/sigcontext.h with 100% similarity]
arch/arm/include/uapi/asm/signal.h [new file with mode: 0644]
arch/arm/include/uapi/asm/stat.h [moved from arch/arm/include/asm/stat.h with 100% similarity]
arch/arm/include/uapi/asm/statfs.h [moved from arch/arm/include/asm/statfs.h with 100% similarity]
arch/arm/include/uapi/asm/swab.h [new file with mode: 0644]
arch/arm/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/arm/mach-at91/Kconfig
arch/arm/mach-clps711x/Kconfig
arch/arm/mach-davinci/Kconfig
arch/arm/mach-exynos/Kconfig
arch/arm/mach-footbridge/Kconfig
arch/arm/mach-h720x/Kconfig
arch/arm/mach-imx/Kconfig
arch/arm/mach-ixp4xx/Kconfig
arch/arm/mach-mmp/Kconfig
arch/arm/mach-msm/Kconfig
arch/arm/mach-nomadik/Kconfig
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap2/Kconfig
arch/arm/mach-prima2/Kconfig
arch/arm/mach-pxa/Kconfig
arch/arm/mach-realview/Kconfig
arch/arm/mach-s3c2412/Kconfig
arch/arm/mach-s3c2440/Kconfig
arch/arm/mach-s3c24xx/Kconfig
arch/arm/mach-s3c64xx/Kconfig
arch/arm/mach-s5p64x0/Kconfig
arch/arm/mach-s5pc100/Kconfig
arch/arm/mach-s5pv210/Kconfig
arch/arm/mach-sa1100/Kconfig
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-tegra/Kconfig
arch/arm/mach-u300/Kconfig
arch/arm/mach-ux500/Kconfig
arch/arm/mach-versatile/Kconfig
arch/arm/mm/Kconfig
arch/arm/plat-mxc/Kconfig
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-nomadik/Kconfig
arch/arm/plat-omap/Kconfig
arch/arm/plat-s3c24xx/Kconfig
arch/arm/plat-samsung/Kconfig
arch/arm/plat-spear/Kconfig
arch/avr32/Kconfig
arch/avr32/include/asm/module.h
arch/blackfin/Kconfig
arch/blackfin/include/asm/module.h
arch/c6x/Kconfig
arch/c6x/include/asm/module.h
arch/cris/Kconfig
arch/cris/include/asm/Kbuild
arch/cris/include/asm/module.h [deleted file]
arch/frv/include/asm/module.h
arch/h8300/Kconfig
arch/h8300/include/asm/Kbuild
arch/h8300/include/asm/module.h [deleted file]
arch/hexagon/Kconfig
arch/ia64/Kconfig
arch/ia64/include/asm/module.h
arch/m32r/Kconfig
arch/m32r/include/asm/Kbuild
arch/m32r/include/asm/module.h [deleted file]
arch/m32r/kernel/module.c
arch/m68k/Kconfig
arch/m68k/include/asm/module.h
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/mips/alchemy/Kconfig
arch/mips/alchemy/Platform
arch/mips/alchemy/devboards/Makefile
arch/mips/alchemy/devboards/db1000.c
arch/mips/alchemy/devboards/db1200.c
arch/mips/alchemy/devboards/db1235.c [new file with mode: 0644]
arch/mips/alchemy/devboards/db1300.c
arch/mips/alchemy/devboards/db1550.c
arch/mips/alchemy/devboards/pb1100.c [deleted file]
arch/mips/alchemy/devboards/pb1500.c [deleted file]
arch/mips/alchemy/devboards/pb1550.c [deleted file]
arch/mips/alchemy/devboards/platform.c
arch/mips/boot/compressed/uart-alchemy.c
arch/mips/configs/db1200_defconfig [deleted file]
arch/mips/configs/db1235_defconfig [new file with mode: 0644]
arch/mips/configs/db1300_defconfig [deleted file]
arch/mips/configs/db1550_defconfig [deleted file]
arch/mips/configs/pb1100_defconfig [deleted file]
arch/mips/configs/pb1500_defconfig [deleted file]
arch/mips/configs/pb1550_defconfig [deleted file]
arch/mips/include/asm/Kbuild
arch/mips/include/asm/atomic.h
arch/mips/include/asm/cpu-features.h
arch/mips/include/asm/cpu.h
arch/mips/include/asm/errno.h
arch/mips/include/asm/kspd.h
arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
arch/mips/include/asm/mach-db1x00/bcsr.h
arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h
arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h
arch/mips/include/asm/mipsregs.h
arch/mips/include/asm/module.h
arch/mips/include/asm/pgtable-64.h
arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h
arch/mips/include/asm/ptrace.h
arch/mips/include/asm/setup.h
arch/mips/include/asm/sigcontext.h
arch/mips/include/asm/siginfo.h
arch/mips/include/asm/signal.h
arch/mips/include/asm/socket.h
arch/mips/include/asm/termios.h
arch/mips/include/asm/types.h
arch/mips/include/asm/unistd.h
arch/mips/include/uapi/asm/Kbuild
arch/mips/include/uapi/asm/auxvec.h [moved from arch/mips/include/asm/auxvec.h with 100% similarity]
arch/mips/include/uapi/asm/bitsperlong.h [moved from arch/mips/include/asm/bitsperlong.h with 100% similarity]
arch/mips/include/uapi/asm/byteorder.h [moved from arch/mips/include/asm/byteorder.h with 100% similarity]
arch/mips/include/uapi/asm/cachectl.h [moved from arch/mips/include/asm/cachectl.h with 100% similarity]
arch/mips/include/uapi/asm/errno.h [new file with mode: 0644]
arch/mips/include/uapi/asm/fcntl.h [moved from arch/mips/include/asm/fcntl.h with 100% similarity]
arch/mips/include/uapi/asm/ioctl.h [moved from arch/mips/include/asm/ioctl.h with 100% similarity]
arch/mips/include/uapi/asm/ioctls.h [moved from arch/mips/include/asm/ioctls.h with 100% similarity]
arch/mips/include/uapi/asm/ipcbuf.h [moved from arch/mips/include/asm/ipcbuf.h with 100% similarity]
arch/mips/include/uapi/asm/kvm_para.h [moved from arch/mips/include/asm/kvm_para.h with 100% similarity]
arch/mips/include/uapi/asm/mman.h [moved from arch/mips/include/asm/mman.h with 100% similarity]
arch/mips/include/uapi/asm/msgbuf.h [moved from arch/mips/include/asm/msgbuf.h with 100% similarity]
arch/mips/include/uapi/asm/param.h [moved from arch/mips/include/asm/param.h with 100% similarity]
arch/mips/include/uapi/asm/poll.h [moved from arch/mips/include/asm/poll.h with 100% similarity]
arch/mips/include/uapi/asm/posix_types.h [moved from arch/mips/include/asm/posix_types.h with 100% similarity]
arch/mips/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/mips/include/uapi/asm/resource.h [moved from arch/mips/include/asm/resource.h with 100% similarity]
arch/mips/include/uapi/asm/sembuf.h [moved from arch/mips/include/asm/sembuf.h with 100% similarity]
arch/mips/include/uapi/asm/setup.h [new file with mode: 0644]
arch/mips/include/uapi/asm/sgidefs.h [moved from arch/mips/include/asm/sgidefs.h with 100% similarity]
arch/mips/include/uapi/asm/shmbuf.h [moved from arch/mips/include/asm/shmbuf.h with 100% similarity]
arch/mips/include/uapi/asm/sigcontext.h [new file with mode: 0644]
arch/mips/include/uapi/asm/siginfo.h [new file with mode: 0644]
arch/mips/include/uapi/asm/signal.h [new file with mode: 0644]
arch/mips/include/uapi/asm/socket.h [new file with mode: 0644]
arch/mips/include/uapi/asm/sockios.h [moved from arch/mips/include/asm/sockios.h with 100% similarity]
arch/mips/include/uapi/asm/stat.h [moved from arch/mips/include/asm/stat.h with 100% similarity]
arch/mips/include/uapi/asm/statfs.h [moved from arch/mips/include/asm/statfs.h with 100% similarity]
arch/mips/include/uapi/asm/swab.h [moved from arch/mips/include/asm/swab.h with 100% similarity]
arch/mips/include/uapi/asm/sysmips.h [moved from arch/mips/include/asm/sysmips.h with 100% similarity]
arch/mips/include/uapi/asm/termbits.h [moved from arch/mips/include/asm/termbits.h with 100% similarity]
arch/mips/include/uapi/asm/termios.h [new file with mode: 0644]
arch/mips/include/uapi/asm/types.h [new file with mode: 0644]
arch/mips/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/mips/kernel/Makefile
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/kspd.c [deleted file]
arch/mips/kernel/module-rela.c [new file with mode: 0644]
arch/mips/kernel/module.c
arch/mips/kernel/perf_event_mipsxx.c
arch/mips/kernel/proc.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/kernel/vpe.c
arch/mips/mm/init.c
arch/mips/mm/pgtable-64.c
arch/mips/mm/tlbex.c
arch/mips/pci/fixup-malta.c
arch/mips/sni/a20r.c
arch/mn10300/Kconfig
arch/mn10300/include/asm/module.h
arch/openrisc/Kconfig
arch/openrisc/include/asm/Kbuild
arch/openrisc/include/asm/elf.h
arch/openrisc/include/asm/ptrace.h
arch/openrisc/include/uapi/asm/Kbuild
arch/openrisc/include/uapi/asm/byteorder.h [moved from arch/openrisc/include/asm/byteorder.h with 100% similarity]
arch/openrisc/include/uapi/asm/elf.h [new file with mode: 0644]
arch/openrisc/include/uapi/asm/kvm_para.h [moved from arch/openrisc/include/asm/kvm_para.h with 100% similarity]
arch/openrisc/include/uapi/asm/param.h [moved from arch/openrisc/include/asm/param.h with 100% similarity]
arch/openrisc/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/openrisc/include/uapi/asm/sigcontext.h [moved from arch/openrisc/include/asm/sigcontext.h with 100% similarity]
arch/openrisc/include/uapi/asm/unistd.h [moved from arch/openrisc/include/asm/unistd.h with 100% similarity]
arch/parisc/Kconfig
arch/parisc/include/asm/module.h
arch/powerpc/Kconfig
arch/powerpc/include/asm/module.h
arch/s390/Kconfig
arch/s390/include/asm/module.h
arch/score/Kconfig
arch/score/include/asm/module.h
arch/score/kernel/module.c
arch/sh/Kconfig
arch/sh/include/asm/module.h
arch/sparc/Kconfig
arch/sparc/include/asm/Kbuild
arch/sparc/include/asm/module.h [deleted file]
arch/tile/Kconfig
arch/unicore32/Kconfig
arch/x86/Kconfig
arch/x86/boot/Makefile
arch/x86/um/Kconfig
arch/xtensa/include/asm/module.h
crypto/Kconfig
crypto/Makefile
crypto/asymmetric_keys/.gitignore [new file with mode: 0644]
crypto/asymmetric_keys/Kconfig [new file with mode: 0644]
crypto/asymmetric_keys/Makefile [new file with mode: 0644]
crypto/asymmetric_keys/asymmetric_keys.h [new file with mode: 0644]
crypto/asymmetric_keys/asymmetric_type.c [new file with mode: 0644]
crypto/asymmetric_keys/public_key.c [new file with mode: 0644]
crypto/asymmetric_keys/public_key.h [new file with mode: 0644]
crypto/asymmetric_keys/rsa.c [new file with mode: 0644]
crypto/asymmetric_keys/signature.c [new file with mode: 0644]
crypto/asymmetric_keys/x509.asn1 [new file with mode: 0644]
crypto/asymmetric_keys/x509_cert_parser.c [new file with mode: 0644]
crypto/asymmetric_keys/x509_parser.h [new file with mode: 0644]
crypto/asymmetric_keys/x509_public_key.c [new file with mode: 0644]
crypto/asymmetric_keys/x509_rsakey.asn1 [new file with mode: 0644]
crypto/xor.c
drivers/md/bitmap.c
drivers/md/dm-raid.c
drivers/md/linear.c
drivers/md/md.c
drivers/md/md.h
drivers/md/multipath.c
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/md/raid5.h
fs/btrfs/tree-log.c
fs/cifs/cifs_spnego.c
fs/cifs/cifsacl.c
fs/xattr_acl.c
include/asm-generic/bitops/count_zeros.h [new file with mode: 0644]
include/asm-generic/module.h
include/asm-generic/vmlinux.lds.h
include/crypto/public_key.h [new file with mode: 0644]
include/keys/asymmetric-parser.h [new file with mode: 0644]
include/keys/asymmetric-subtype.h [new file with mode: 0644]
include/keys/asymmetric-type.h [new file with mode: 0644]
include/keys/user-type.h
include/linux/Kbuild
include/linux/a.out.h
include/linux/acct.h
include/linux/adb.h
include/linux/adfs_fs.h
include/linux/agpgart.h
include/linux/apm_bios.h
include/linux/asn1.h [new file with mode: 0644]
include/linux/asn1_ber_bytecode.h [new file with mode: 0644]
include/linux/asn1_decoder.h [new file with mode: 0644]
include/linux/atalk.h
include/linux/atm.h
include/linux/atm_tcp.h
include/linux/atmdev.h
include/linux/audit.h
include/linux/auto_fs.h
include/linux/auxvec.h
include/linux/binfmts.h
include/linux/blktrace_api.h
include/linux/bsg.h
include/linux/byteorder/Kbuild
include/linux/byteorder/big_endian.h
include/linux/byteorder/little_endian.h
include/linux/capability.h
include/linux/cciss_ioctl.h
include/linux/cdrom.h
include/linux/cm4000_cs.h
include/linux/cn_proc.h
include/linux/coda.h
include/linux/coda_psdev.h
include/linux/connector.h
include/linux/cramfs_fs.h
include/linux/cuda.h
include/linux/cyclades.h
include/linux/dccp.h
include/linux/dlm.h
include/linux/dlm_plock.h
include/linux/edd.h
include/linux/elf.h
include/linux/elfcore.h
include/linux/errno.h
include/linux/errqueue.h
include/linux/ethtool.h
include/linux/eventpoll.h
include/linux/falloc.h
include/linux/fanotify.h
include/linux/fb.h
include/linux/fcntl.h
include/linux/fd.h
include/linux/filter.h
include/linux/flat.h
include/linux/fs.h
include/linux/fsl_hypervisor.h
include/linux/futex.h
include/linux/gameport.h
include/linux/genetlink.h
include/linux/hdlc.h
include/linux/hdlcdrv.h
include/linux/hid.h
include/linux/hiddev.h
include/linux/hidraw.h
include/linux/hpet.h
include/linux/i2c-dev.h
include/linux/i2c.h
include/linux/icmp.h
include/linux/icmpv6.h
include/linux/if_arp.h
include/linux/if_bridge.h
include/linux/if_eql.h
include/linux/if_ether.h
include/linux/if_fddi.h
include/linux/if_frad.h
include/linux/if_link.h
include/linux/if_ltalk.h
include/linux/if_phonet.h
include/linux/if_pppol2tp.h
include/linux/if_pppox.h
include/linux/if_team.h
include/linux/if_tun.h
include/linux/if_tunnel.h
include/linux/if_vlan.h
include/linux/igmp.h
include/linux/in.h
include/linux/in6.h
include/linux/inet_diag.h
include/linux/inotify.h
include/linux/input.h
include/linux/ip.h
include/linux/ipc.h
include/linux/ipmi.h
include/linux/ipv6.h
include/linux/ipv6_route.h
include/linux/irqnr.h
include/linux/isdn.h
include/linux/isdn_divertif.h
include/linux/isdn_ppp.h
include/linux/isdnif.h
include/linux/joystick.h
include/linux/kd.h
include/linux/kdev_t.h
include/linux/kernel-page-flags.h
include/linux/kernel.h
include/linux/kernelcapi.h
include/linux/kexec.h
include/linux/key-type.h
include/linux/keyboard.h
include/linux/kvm_para.h
include/linux/l2tp.h
include/linux/llc.h
include/linux/loop.h
include/linux/lp.h
include/linux/mdio.h
include/linux/mempolicy.h
include/linux/mii.h
include/linux/mman.h
include/linux/module.h
include/linux/moduleloader.h
include/linux/mpi.h
include/linux/mroute.h
include/linux/mroute6.h
include/linux/msdos_fs.h
include/linux/msg.h
include/linux/n_r3964.h
include/linux/nbd.h
include/linux/net.h
include/linux/netdevice.h
include/linux/netfilter.h
include/linux/netfilter_bridge.h
include/linux/netfilter_ipv4.h
include/linux/netfilter_ipv6.h
include/linux/netlink.h
include/linux/nfs.h
include/linux/nfs3.h
include/linux/nfs4.h
include/linux/nfs_fs.h
include/linux/nfs_idmap.h
include/linux/nfsacl.h
include/linux/nubus.h
include/linux/nvram.h
include/linux/oid_registry.h [new file with mode: 0644]
include/linux/omapfb.h
include/linux/oom.h
include/linux/parport.h
include/linux/patchkey.h
include/linux/pci.h
include/linux/perf_event.h
include/linux/personality.h
include/linux/phonet.h
include/linux/pktcdvd.h
include/linux/pmu.h
include/linux/poll.h
include/linux/ppp-comp.h
include/linux/ppp_defs.h
include/linux/ptrace.h
include/linux/quota.h
include/linux/random.h
include/linux/reboot.h
include/linux/resource.h
include/linux/rfkill.h
include/linux/rtc.h
include/linux/rtnetlink.h
include/linux/scc.h
include/linux/sched.h
include/linux/screen_info.h
include/linux/sdla.h
include/linux/seccomp.h
include/linux/securebits.h
include/linux/sem.h
include/linux/serial.h
include/linux/serial_core.h
include/linux/serio.h
include/linux/shm.h
include/linux/signal.h
include/linux/signalfd.h
include/linux/sock_diag.h
include/linux/socket.h
include/linux/sonet.h
include/linux/sonypi.h
include/linux/sound.h
include/linux/soundcard.h
include/linux/spi/Kbuild
include/linux/stat.h
include/linux/stddef.h
include/linux/string.h
include/linux/swab.h
include/linux/synclink.h
include/linux/sysctl.h
include/linux/tcp.h
include/linux/time.h
include/linux/timex.h
include/linux/toshiba.h
include/linux/tty.h
include/linux/types.h
include/linux/udp.h
include/linux/uinput.h
include/linux/uio.h
include/linux/usbdevice_fs.h
include/linux/utsname.h
include/linux/uuid.h
include/linux/vfio.h
include/linux/videodev2.h
include/linux/virtio_config.h
include/linux/virtio_console.h
include/linux/virtio_ring.h
include/linux/vt.h
include/linux/wait.h
include/linux/wanrouter.h
include/linux/watchdog.h
include/linux/wireless.h
include/linux/xattr.h
include/uapi/linux/Kbuild
include/uapi/linux/a.out.h [new file with mode: 0644]
include/uapi/linux/acct.h [new file with mode: 0644]
include/uapi/linux/adb.h [new file with mode: 0644]
include/uapi/linux/adfs_fs.h [new file with mode: 0644]
include/uapi/linux/affs_hardblocks.h [moved from include/linux/affs_hardblocks.h with 100% similarity]
include/uapi/linux/agpgart.h [new file with mode: 0644]
include/uapi/linux/aio_abi.h [moved from include/linux/aio_abi.h with 100% similarity]
include/uapi/linux/apm_bios.h [new file with mode: 0644]
include/uapi/linux/arcfb.h [moved from include/linux/arcfb.h with 100% similarity]
include/uapi/linux/atalk.h [new file with mode: 0644]
include/uapi/linux/atm.h [new file with mode: 0644]
include/uapi/linux/atm_eni.h [moved from include/linux/atm_eni.h with 100% similarity]
include/uapi/linux/atm_he.h [moved from include/linux/atm_he.h with 100% similarity]
include/uapi/linux/atm_idt77105.h [moved from include/linux/atm_idt77105.h with 100% similarity]
include/uapi/linux/atm_nicstar.h [moved from include/linux/atm_nicstar.h with 100% similarity]
include/uapi/linux/atm_tcp.h [new file with mode: 0644]
include/uapi/linux/atm_zatm.h [moved from include/linux/atm_zatm.h with 100% similarity]
include/uapi/linux/atmapi.h [moved from include/linux/atmapi.h with 100% similarity]
include/uapi/linux/atmarp.h [moved from include/linux/atmarp.h with 100% similarity]
include/uapi/linux/atmbr2684.h [moved from include/linux/atmbr2684.h with 100% similarity]
include/uapi/linux/atmclip.h [moved from include/linux/atmclip.h with 100% similarity]
include/uapi/linux/atmdev.h [new file with mode: 0644]
include/uapi/linux/atmioc.h [moved from include/linux/atmioc.h with 100% similarity]
include/uapi/linux/atmlec.h [moved from include/linux/atmlec.h with 100% similarity]
include/uapi/linux/atmmpc.h [moved from include/linux/atmmpc.h with 100% similarity]
include/uapi/linux/atmppp.h [moved from include/linux/atmppp.h with 100% similarity]
include/uapi/linux/atmsap.h [moved from include/linux/atmsap.h with 100% similarity]
include/uapi/linux/atmsvc.h [moved from include/linux/atmsvc.h with 100% similarity]
include/uapi/linux/audit.h [new file with mode: 0644]
include/uapi/linux/auto_fs.h [new file with mode: 0644]
include/uapi/linux/auto_fs4.h [moved from include/linux/auto_fs4.h with 100% similarity]
include/uapi/linux/auxvec.h [new file with mode: 0644]
include/uapi/linux/ax25.h [moved from include/linux/ax25.h with 100% similarity]
include/uapi/linux/b1lli.h [moved from include/linux/b1lli.h with 100% similarity]
include/uapi/linux/baycom.h [moved from include/linux/baycom.h with 100% similarity]
include/uapi/linux/bfs_fs.h [moved from include/linux/bfs_fs.h with 100% similarity]
include/uapi/linux/binfmts.h [new file with mode: 0644]
include/uapi/linux/blkpg.h [moved from include/linux/blkpg.h with 100% similarity]
include/uapi/linux/blktrace_api.h [new file with mode: 0644]
include/uapi/linux/bpqether.h [moved from include/linux/bpqether.h with 100% similarity]
include/uapi/linux/bsg.h [new file with mode: 0644]
include/uapi/linux/byteorder/Kbuild
include/uapi/linux/byteorder/big_endian.h [new file with mode: 0644]
include/uapi/linux/byteorder/little_endian.h [new file with mode: 0644]
include/uapi/linux/can.h [moved from include/linux/can.h with 100% similarity]
include/uapi/linux/capability.h [new file with mode: 0644]
include/uapi/linux/capi.h [moved from include/linux/capi.h with 100% similarity]
include/uapi/linux/cciss_defs.h [moved from include/linux/cciss_defs.h with 100% similarity]
include/uapi/linux/cciss_ioctl.h [new file with mode: 0644]
include/uapi/linux/cdrom.h [new file with mode: 0644]
include/uapi/linux/cgroupstats.h [moved from include/linux/cgroupstats.h with 100% similarity]
include/uapi/linux/chio.h [moved from include/linux/chio.h with 100% similarity]
include/uapi/linux/cm4000_cs.h [new file with mode: 0644]
include/uapi/linux/cn_proc.h [new file with mode: 0644]
include/uapi/linux/coda.h [new file with mode: 0644]
include/uapi/linux/coda_psdev.h [new file with mode: 0644]
include/uapi/linux/coff.h [moved from include/linux/coff.h with 100% similarity]
include/uapi/linux/connector.h [new file with mode: 0644]
include/uapi/linux/const.h [moved from include/linux/const.h with 100% similarity]
include/uapi/linux/cramfs_fs.h [new file with mode: 0644]
include/uapi/linux/cuda.h [new file with mode: 0644]
include/uapi/linux/cyclades.h [new file with mode: 0644]
include/uapi/linux/cycx_cfm.h [moved from include/linux/cycx_cfm.h with 100% similarity]
include/uapi/linux/dcbnl.h [moved from include/linux/dcbnl.h with 100% similarity]
include/uapi/linux/dccp.h [new file with mode: 0644]
include/uapi/linux/dlm.h [new file with mode: 0644]
include/uapi/linux/dlm_device.h [moved from include/linux/dlm_device.h with 100% similarity]
include/uapi/linux/dlm_netlink.h [moved from include/linux/dlm_netlink.h with 100% similarity]
include/uapi/linux/dlm_plock.h [new file with mode: 0644]
include/uapi/linux/dlmconstants.h [moved from include/linux/dlmconstants.h with 100% similarity]
include/uapi/linux/dm-ioctl.h [moved from include/linux/dm-ioctl.h with 100% similarity]
include/uapi/linux/dm-log-userspace.h [moved from include/linux/dm-log-userspace.h with 100% similarity]
include/uapi/linux/dn.h [moved from include/linux/dn.h with 100% similarity]
include/uapi/linux/dqblk_xfs.h [moved from include/linux/dqblk_xfs.h with 100% similarity]
include/uapi/linux/edd.h [new file with mode: 0644]
include/uapi/linux/efs_fs_sb.h [moved from include/linux/efs_fs_sb.h with 100% similarity]
include/uapi/linux/elf-em.h [moved from include/linux/elf-em.h with 100% similarity]
include/uapi/linux/elf-fdpic.h [moved from include/linux/elf-fdpic.h with 99% similarity]
include/uapi/linux/elf.h [new file with mode: 0644]
include/uapi/linux/elfcore.h [new file with mode: 0644]
include/uapi/linux/errno.h [new file with mode: 0644]
include/uapi/linux/errqueue.h [new file with mode: 0644]
include/uapi/linux/ethtool.h [new file with mode: 0644]
include/uapi/linux/eventpoll.h [new file with mode: 0644]
include/uapi/linux/fadvise.h [moved from include/linux/fadvise.h with 100% similarity]
include/uapi/linux/falloc.h [new file with mode: 0644]
include/uapi/linux/fanotify.h [new file with mode: 0644]
include/uapi/linux/fb.h [new file with mode: 0644]
include/uapi/linux/fcntl.h [new file with mode: 0644]
include/uapi/linux/fd.h [new file with mode: 0644]
include/uapi/linux/fdreg.h [moved from include/linux/fdreg.h with 100% similarity]
include/uapi/linux/fib_rules.h [moved from include/linux/fib_rules.h with 100% similarity]
include/uapi/linux/fiemap.h [moved from include/linux/fiemap.h with 100% similarity]
include/uapi/linux/filter.h [new file with mode: 0644]
include/uapi/linux/firewire-cdev.h [moved from include/linux/firewire-cdev.h with 100% similarity]
include/uapi/linux/firewire-constants.h [moved from include/linux/firewire-constants.h with 100% similarity]
include/uapi/linux/flat.h [new file with mode: 0644]
include/uapi/linux/fs.h [new file with mode: 0644]
include/uapi/linux/fsl_hypervisor.h [new file with mode: 0644]
include/uapi/linux/fuse.h [moved from include/linux/fuse.h with 100% similarity]
include/uapi/linux/futex.h [new file with mode: 0644]
include/uapi/linux/gameport.h [new file with mode: 0644]
include/uapi/linux/gen_stats.h [moved from include/linux/gen_stats.h with 100% similarity]
include/uapi/linux/genetlink.h [new file with mode: 0644]
include/uapi/linux/gfs2_ondisk.h [moved from include/linux/gfs2_ondisk.h with 100% similarity]
include/uapi/linux/gigaset_dev.h [moved from include/linux/gigaset_dev.h with 100% similarity]
include/uapi/linux/hdlc.h [new file with mode: 0644]
include/uapi/linux/hdlcdrv.h [new file with mode: 0644]
include/uapi/linux/hdreg.h [moved from include/linux/hdreg.h with 100% similarity]
include/uapi/linux/hid.h [new file with mode: 0644]
include/uapi/linux/hiddev.h [new file with mode: 0644]
include/uapi/linux/hidraw.h [new file with mode: 0644]
include/uapi/linux/hpet.h [new file with mode: 0644]
include/uapi/linux/hysdn_if.h [moved from include/linux/hysdn_if.h with 100% similarity]
include/uapi/linux/i2c-dev.h [new file with mode: 0644]
include/uapi/linux/i2c.h [new file with mode: 0644]
include/uapi/linux/i2o-dev.h [moved from include/linux/i2o-dev.h with 100% similarity]
include/uapi/linux/i8k.h [moved from include/linux/i8k.h with 100% similarity]
include/uapi/linux/icmp.h [new file with mode: 0644]
include/uapi/linux/icmpv6.h [new file with mode: 0644]
include/uapi/linux/if.h [moved from include/linux/if.h with 100% similarity]
include/uapi/linux/if_addr.h [moved from include/linux/if_addr.h with 100% similarity]
include/uapi/linux/if_addrlabel.h [moved from include/linux/if_addrlabel.h with 100% similarity]
include/uapi/linux/if_alg.h [moved from include/linux/if_alg.h with 100% similarity]
include/uapi/linux/if_arcnet.h [moved from include/linux/if_arcnet.h with 100% similarity]
include/uapi/linux/if_arp.h [new file with mode: 0644]
include/uapi/linux/if_bonding.h [moved from include/linux/if_bonding.h with 100% similarity]
include/uapi/linux/if_bridge.h [new file with mode: 0644]
include/uapi/linux/if_cablemodem.h [moved from include/linux/if_cablemodem.h with 100% similarity]
include/uapi/linux/if_eql.h [new file with mode: 0644]
include/uapi/linux/if_ether.h [new file with mode: 0644]
include/uapi/linux/if_fc.h [moved from include/linux/if_fc.h with 100% similarity]
include/uapi/linux/if_fddi.h [new file with mode: 0644]
include/uapi/linux/if_frad.h [new file with mode: 0644]
include/uapi/linux/if_hippi.h [moved from include/linux/if_hippi.h with 100% similarity]
include/uapi/linux/if_infiniband.h [moved from include/linux/if_infiniband.h with 100% similarity]
include/uapi/linux/if_link.h [new file with mode: 0644]
include/uapi/linux/if_ltalk.h [new file with mode: 0644]
include/uapi/linux/if_packet.h [moved from include/linux/if_packet.h with 100% similarity]
include/uapi/linux/if_phonet.h [new file with mode: 0644]
include/uapi/linux/if_plip.h [moved from include/linux/if_plip.h with 100% similarity]
include/uapi/linux/if_ppp.h [moved from include/linux/if_ppp.h with 100% similarity]
include/uapi/linux/if_pppol2tp.h [new file with mode: 0644]
include/uapi/linux/if_pppox.h [new file with mode: 0644]
include/uapi/linux/if_slip.h [moved from include/linux/if_slip.h with 100% similarity]
include/uapi/linux/if_team.h [new file with mode: 0644]
include/uapi/linux/if_tun.h [new file with mode: 0644]
include/uapi/linux/if_tunnel.h [new file with mode: 0644]
include/uapi/linux/if_vlan.h [new file with mode: 0644]
include/uapi/linux/if_x25.h [moved from include/linux/if_x25.h with 100% similarity]
include/uapi/linux/igmp.h [new file with mode: 0644]
include/uapi/linux/in.h [new file with mode: 0644]
include/uapi/linux/in6.h [new file with mode: 0644]
include/uapi/linux/in_route.h [moved from include/linux/in_route.h with 100% similarity]
include/uapi/linux/inet_diag.h [new file with mode: 0644]
include/uapi/linux/inotify.h [new file with mode: 0644]
include/uapi/linux/input.h [new file with mode: 0644]
include/uapi/linux/ioctl.h [moved from include/linux/ioctl.h with 100% similarity]
include/uapi/linux/ip.h [new file with mode: 0644]
include/uapi/linux/ip6_tunnel.h [moved from include/linux/ip6_tunnel.h with 100% similarity]
include/uapi/linux/ip_vs.h [moved from include/linux/ip_vs.h with 100% similarity]
include/uapi/linux/ipc.h [new file with mode: 0644]
include/uapi/linux/ipmi.h [new file with mode: 0644]
include/uapi/linux/ipmi_msgdefs.h [moved from include/linux/ipmi_msgdefs.h with 100% similarity]
include/uapi/linux/ipsec.h [moved from include/linux/ipsec.h with 100% similarity]
include/uapi/linux/ipv6.h [new file with mode: 0644]
include/uapi/linux/ipv6_route.h [new file with mode: 0644]
include/uapi/linux/ipx.h [moved from include/linux/ipx.h with 100% similarity]
include/uapi/linux/irda.h [moved from include/linux/irda.h with 100% similarity]
include/uapi/linux/irqnr.h [new file with mode: 0644]
include/uapi/linux/isdn.h [new file with mode: 0644]
include/uapi/linux/isdn_divertif.h [new file with mode: 0644]
include/uapi/linux/isdn_ppp.h [new file with mode: 0644]
include/uapi/linux/isdnif.h [new file with mode: 0644]
include/uapi/linux/iso_fs.h [moved from include/linux/iso_fs.h with 100% similarity]
include/uapi/linux/ivtv.h [moved from include/linux/ivtv.h with 100% similarity]
include/uapi/linux/ivtvfb.h [moved from include/linux/ivtvfb.h with 100% similarity]
include/uapi/linux/ixjuser.h [moved from include/linux/ixjuser.h with 100% similarity]
include/uapi/linux/jffs2.h [moved from include/linux/jffs2.h with 100% similarity]
include/uapi/linux/joystick.h [new file with mode: 0644]
include/uapi/linux/kd.h [new file with mode: 0644]
include/uapi/linux/kdev_t.h [new file with mode: 0644]
include/uapi/linux/kernel-page-flags.h [new file with mode: 0644]
include/uapi/linux/kernel.h [new file with mode: 0644]
include/uapi/linux/kernelcapi.h [new file with mode: 0644]
include/uapi/linux/kexec.h [new file with mode: 0644]
include/uapi/linux/keyboard.h [new file with mode: 0644]
include/uapi/linux/keyctl.h [moved from include/linux/keyctl.h with 100% similarity]
include/uapi/linux/kvm.h [moved from include/linux/kvm.h with 100% similarity]
include/uapi/linux/kvm_para.h [new file with mode: 0644]
include/uapi/linux/l2tp.h [new file with mode: 0644]
include/uapi/linux/limits.h [moved from include/linux/limits.h with 100% similarity]
include/uapi/linux/llc.h [new file with mode: 0644]
include/uapi/linux/loop.h [new file with mode: 0644]
include/uapi/linux/lp.h [new file with mode: 0644]
include/uapi/linux/magic.h [moved from include/linux/magic.h with 100% similarity]
include/uapi/linux/major.h [moved from include/linux/major.h with 100% similarity]
include/uapi/linux/map_to_7segment.h [moved from include/linux/map_to_7segment.h with 100% similarity]
include/uapi/linux/matroxfb.h [moved from include/linux/matroxfb.h with 100% similarity]
include/uapi/linux/mdio.h [new file with mode: 0644]
include/uapi/linux/media.h [moved from include/linux/media.h with 100% similarity]
include/uapi/linux/mei.h [moved from include/linux/mei.h with 100% similarity]
include/uapi/linux/mempolicy.h [new file with mode: 0644]
include/uapi/linux/meye.h [moved from include/linux/meye.h with 100% similarity]
include/uapi/linux/mii.h [new file with mode: 0644]
include/uapi/linux/minix_fs.h [moved from include/linux/minix_fs.h with 100% similarity]
include/uapi/linux/mman.h [new file with mode: 0644]
include/uapi/linux/mmtimer.h [moved from include/linux/mmtimer.h with 100% similarity]
include/uapi/linux/mqueue.h [moved from include/linux/mqueue.h with 100% similarity]
include/uapi/linux/mroute.h [new file with mode: 0644]
include/uapi/linux/mroute6.h [new file with mode: 0644]
include/uapi/linux/msdos_fs.h [new file with mode: 0644]
include/uapi/linux/msg.h [new file with mode: 0644]
include/uapi/linux/mtio.h [moved from include/linux/mtio.h with 100% similarity]
include/uapi/linux/n_r3964.h [new file with mode: 0644]
include/uapi/linux/nbd.h [new file with mode: 0644]
include/uapi/linux/ncp.h [moved from include/linux/ncp.h with 100% similarity]
include/uapi/linux/ncp_fs.h [moved from include/linux/ncp_fs.h with 100% similarity]
include/uapi/linux/ncp_mount.h [moved from include/linux/ncp_mount.h with 100% similarity]
include/uapi/linux/ncp_no.h [moved from include/linux/ncp_no.h with 100% similarity]
include/uapi/linux/neighbour.h [moved from include/linux/neighbour.h with 100% similarity]
include/uapi/linux/net.h [new file with mode: 0644]
include/uapi/linux/net_dropmon.h [moved from include/linux/net_dropmon.h with 100% similarity]
include/uapi/linux/net_tstamp.h [moved from include/linux/net_tstamp.h with 100% similarity]
include/uapi/linux/netdevice.h [new file with mode: 0644]
include/uapi/linux/netfilter.h [new file with mode: 0644]
include/uapi/linux/netfilter_arp.h [moved from include/linux/netfilter_arp.h with 100% similarity]
include/uapi/linux/netfilter_bridge.h [new file with mode: 0644]
include/uapi/linux/netfilter_decnet.h [moved from include/linux/netfilter_decnet.h with 100% similarity]
include/uapi/linux/netfilter_ipv4.h [new file with mode: 0644]
include/uapi/linux/netfilter_ipv6.h [new file with mode: 0644]
include/uapi/linux/netlink.h [new file with mode: 0644]
include/uapi/linux/netrom.h [moved from include/linux/netrom.h with 100% similarity]
include/uapi/linux/nfc.h [moved from include/linux/nfc.h with 100% similarity]
include/uapi/linux/nfs.h [new file with mode: 0644]
include/uapi/linux/nfs2.h [moved from include/linux/nfs2.h with 100% similarity]
include/uapi/linux/nfs3.h [new file with mode: 0644]
include/uapi/linux/nfs4.h [new file with mode: 0644]
include/uapi/linux/nfs4_mount.h [moved from include/linux/nfs4_mount.h with 100% similarity]
include/uapi/linux/nfs_fs.h [new file with mode: 0644]
include/uapi/linux/nfs_idmap.h [new file with mode: 0644]
include/uapi/linux/nfs_mount.h [moved from include/linux/nfs_mount.h with 100% similarity]
include/uapi/linux/nfsacl.h [new file with mode: 0644]
include/uapi/linux/nl80211.h [moved from include/linux/nl80211.h with 100% similarity]
include/uapi/linux/nubus.h [new file with mode: 0644]
include/uapi/linux/nvram.h [new file with mode: 0644]
include/uapi/linux/omap3isp.h [moved from include/linux/omap3isp.h with 100% similarity]
include/uapi/linux/omapfb.h [new file with mode: 0644]
include/uapi/linux/oom.h [new file with mode: 0644]
include/uapi/linux/packet_diag.h [moved from include/linux/packet_diag.h with 100% similarity]
include/uapi/linux/param.h [moved from include/linux/param.h with 100% similarity]
include/uapi/linux/parport.h [new file with mode: 0644]
include/uapi/linux/patchkey.h [new file with mode: 0644]
include/uapi/linux/pci.h [new file with mode: 0644]
include/uapi/linux/pci_regs.h [moved from include/linux/pci_regs.h with 100% similarity]
include/uapi/linux/perf_event.h [new file with mode: 0644]
include/uapi/linux/personality.h [new file with mode: 0644]
include/uapi/linux/pfkeyv2.h [moved from include/linux/pfkeyv2.h with 100% similarity]
include/uapi/linux/pg.h [moved from include/linux/pg.h with 100% similarity]
include/uapi/linux/phantom.h [moved from include/linux/phantom.h with 100% similarity]
include/uapi/linux/phonet.h [new file with mode: 0644]
include/uapi/linux/pkt_cls.h [moved from include/linux/pkt_cls.h with 100% similarity]
include/uapi/linux/pkt_sched.h [moved from include/linux/pkt_sched.h with 100% similarity]
include/uapi/linux/pktcdvd.h [new file with mode: 0644]
include/uapi/linux/pmu.h [new file with mode: 0644]
include/uapi/linux/poll.h [new file with mode: 0644]
include/uapi/linux/posix_types.h [moved from include/linux/posix_types.h with 100% similarity]
include/uapi/linux/ppdev.h [moved from include/linux/ppdev.h with 100% similarity]
include/uapi/linux/ppp-comp.h [new file with mode: 0644]
include/uapi/linux/ppp-ioctl.h [moved from include/linux/ppp-ioctl.h with 100% similarity]
include/uapi/linux/ppp_defs.h [new file with mode: 0644]
include/uapi/linux/pps.h [moved from include/linux/pps.h with 100% similarity]
include/uapi/linux/prctl.h [moved from include/linux/prctl.h with 100% similarity]
include/uapi/linux/ptp_clock.h [moved from include/linux/ptp_clock.h with 100% similarity]
include/uapi/linux/ptrace.h [new file with mode: 0644]
include/uapi/linux/qnx4_fs.h [moved from include/linux/qnx4_fs.h with 100% similarity]
include/uapi/linux/qnxtypes.h [moved from include/linux/qnxtypes.h with 100% similarity]
include/uapi/linux/quota.h [new file with mode: 0644]
include/uapi/linux/radeonfb.h [moved from include/linux/radeonfb.h with 100% similarity]
include/uapi/linux/random.h [new file with mode: 0644]
include/uapi/linux/raw.h [moved from include/linux/raw.h with 100% similarity]
include/uapi/linux/rds.h [moved from include/linux/rds.h with 100% similarity]
include/uapi/linux/reboot.h [new file with mode: 0644]
include/uapi/linux/reiserfs_fs.h [moved from include/linux/reiserfs_fs.h with 100% similarity]
include/uapi/linux/reiserfs_xattr.h [moved from include/linux/reiserfs_xattr.h with 100% similarity]
include/uapi/linux/resource.h [new file with mode: 0644]
include/uapi/linux/rfkill.h [new file with mode: 0644]
include/uapi/linux/romfs_fs.h [moved from include/linux/romfs_fs.h with 100% similarity]
include/uapi/linux/rose.h [moved from include/linux/rose.h with 100% similarity]
include/uapi/linux/route.h [moved from include/linux/route.h with 100% similarity]
include/uapi/linux/rtc.h [new file with mode: 0644]
include/uapi/linux/rtnetlink.h [new file with mode: 0644]
include/uapi/linux/scc.h [new file with mode: 0644]
include/uapi/linux/sched.h [new file with mode: 0644]
include/uapi/linux/screen_info.h [new file with mode: 0644]
include/uapi/linux/sdla.h [new file with mode: 0644]
include/uapi/linux/seccomp.h [new file with mode: 0644]
include/uapi/linux/securebits.h [new file with mode: 0644]
include/uapi/linux/selinux_netlink.h [moved from include/linux/selinux_netlink.h with 100% similarity]
include/uapi/linux/sem.h [new file with mode: 0644]
include/uapi/linux/serial.h [new file with mode: 0644]
include/uapi/linux/serial_core.h [new file with mode: 0644]
include/uapi/linux/serial_reg.h [moved from include/linux/serial_reg.h with 100% similarity]
include/uapi/linux/serio.h [new file with mode: 0644]
include/uapi/linux/shm.h [new file with mode: 0644]
include/uapi/linux/signal.h [new file with mode: 0644]
include/uapi/linux/signalfd.h [new file with mode: 0644]
include/uapi/linux/snmp.h [moved from include/linux/snmp.h with 100% similarity]
include/uapi/linux/sock_diag.h [new file with mode: 0644]
include/uapi/linux/socket.h [new file with mode: 0644]
include/uapi/linux/sockios.h [moved from include/linux/sockios.h with 100% similarity]
include/uapi/linux/som.h [moved from include/linux/som.h with 100% similarity]
include/uapi/linux/sonet.h [new file with mode: 0644]
include/uapi/linux/sonypi.h [new file with mode: 0644]
include/uapi/linux/sound.h [new file with mode: 0644]
include/uapi/linux/soundcard.h [new file with mode: 0644]
include/uapi/linux/spi/Kbuild
include/uapi/linux/spi/spidev.h [moved from include/linux/spi/spidev.h with 100% similarity]
include/uapi/linux/stat.h [new file with mode: 0644]
include/uapi/linux/stddef.h [new file with mode: 0644]
include/uapi/linux/string.h [new file with mode: 0644]
include/uapi/linux/suspend_ioctls.h [moved from include/linux/suspend_ioctls.h with 100% similarity]
include/uapi/linux/swab.h [new file with mode: 0644]
include/uapi/linux/synclink.h [new file with mode: 0644]
include/uapi/linux/sysctl.h [new file with mode: 0644]
include/uapi/linux/sysinfo.h [moved from include/linux/sysinfo.h with 100% similarity]
include/uapi/linux/taskstats.h [moved from include/linux/taskstats.h with 100% similarity]
include/uapi/linux/tcp.h [new file with mode: 0644]
include/uapi/linux/tcp_metrics.h [moved from include/linux/tcp_metrics.h with 100% similarity]
include/uapi/linux/telephony.h [moved from include/linux/telephony.h with 100% similarity]
include/uapi/linux/termios.h [moved from include/linux/termios.h with 100% similarity]
include/uapi/linux/time.h [new file with mode: 0644]
include/uapi/linux/times.h [moved from include/linux/times.h with 100% similarity]
include/uapi/linux/timex.h [new file with mode: 0644]
include/uapi/linux/tiocl.h [moved from include/linux/tiocl.h with 100% similarity]
include/uapi/linux/tipc.h [moved from include/linux/tipc.h with 100% similarity]
include/uapi/linux/tipc_config.h [moved from include/linux/tipc_config.h with 100% similarity]
include/uapi/linux/toshiba.h [new file with mode: 0644]
include/uapi/linux/tty.h [new file with mode: 0644]
include/uapi/linux/tty_flags.h [moved from include/linux/tty_flags.h with 100% similarity]
include/uapi/linux/types.h [new file with mode: 0644]
include/uapi/linux/udf_fs_i.h [moved from include/linux/udf_fs_i.h with 100% similarity]
include/uapi/linux/udp.h [new file with mode: 0644]
include/uapi/linux/uhid.h [moved from include/linux/uhid.h with 100% similarity]
include/uapi/linux/uinput.h [new file with mode: 0644]
include/uapi/linux/uio.h [new file with mode: 0644]
include/uapi/linux/ultrasound.h [moved from include/linux/ultrasound.h with 100% similarity]
include/uapi/linux/un.h [moved from include/linux/un.h with 100% similarity]
include/uapi/linux/unistd.h [moved from include/linux/unistd.h with 100% similarity]
include/uapi/linux/unix_diag.h [moved from include/linux/unix_diag.h with 100% similarity]
include/uapi/linux/usbdevice_fs.h [new file with mode: 0644]
include/uapi/linux/utime.h [moved from include/linux/utime.h with 100% similarity]
include/uapi/linux/utsname.h [new file with mode: 0644]
include/uapi/linux/uuid.h [new file with mode: 0644]
include/uapi/linux/uvcvideo.h [moved from include/linux/uvcvideo.h with 100% similarity]
include/uapi/linux/v4l2-common.h [moved from include/linux/v4l2-common.h with 100% similarity]
include/uapi/linux/v4l2-controls.h [moved from include/linux/v4l2-controls.h with 100% similarity]
include/uapi/linux/v4l2-dv-timings.h [moved from include/linux/v4l2-dv-timings.h with 100% similarity]
include/uapi/linux/v4l2-mediabus.h [moved from include/linux/v4l2-mediabus.h with 100% similarity]
include/uapi/linux/v4l2-subdev.h [moved from include/linux/v4l2-subdev.h with 100% similarity]
include/uapi/linux/veth.h [moved from include/linux/veth.h with 100% similarity]
include/uapi/linux/vfio.h [new file with mode: 0644]
include/uapi/linux/vhost.h [moved from include/linux/vhost.h with 100% similarity]
include/uapi/linux/videodev2.h [new file with mode: 0644]
include/uapi/linux/virtio_9p.h [moved from include/linux/virtio_9p.h with 100% similarity]
include/uapi/linux/virtio_balloon.h [moved from include/linux/virtio_balloon.h with 100% similarity]
include/uapi/linux/virtio_blk.h [moved from include/linux/virtio_blk.h with 100% similarity]
include/uapi/linux/virtio_config.h [new file with mode: 0644]
include/uapi/linux/virtio_console.h [new file with mode: 0644]
include/uapi/linux/virtio_ids.h [moved from include/linux/virtio_ids.h with 100% similarity]
include/uapi/linux/virtio_net.h [moved from include/linux/virtio_net.h with 100% similarity]
include/uapi/linux/virtio_pci.h [moved from include/linux/virtio_pci.h with 100% similarity]
include/uapi/linux/virtio_ring.h [new file with mode: 0644]
include/uapi/linux/virtio_rng.h [moved from include/linux/virtio_rng.h with 100% similarity]
include/uapi/linux/vt.h [new file with mode: 0644]
include/uapi/linux/wait.h [new file with mode: 0644]
include/uapi/linux/wanrouter.h [new file with mode: 0644]
include/uapi/linux/watchdog.h [new file with mode: 0644]
include/uapi/linux/wimax.h [moved from include/linux/wimax.h with 100% similarity]
include/uapi/linux/wireless.h [new file with mode: 0644]
include/uapi/linux/x25.h [moved from include/linux/x25.h with 100% similarity]
include/uapi/linux/xattr.h [new file with mode: 0644]
include/uapi/linux/xfrm.h [moved from include/linux/xfrm.h with 100% similarity]
init/Kconfig
kernel/Makefile
kernel/modsign_pubkey.c [new file with mode: 0644]
kernel/module-internal.h [new file with mode: 0644]
kernel/module.c
kernel/module_signing.c [new file with mode: 0644]
lib/.gitignore
lib/Kconfig
lib/Makefile
lib/asn1_decoder.c [new file with mode: 0644]
lib/build_OID_registry [new file with mode: 0755]
lib/mpi/Makefile
lib/mpi/longlong.h
lib/mpi/mpi-bit.c
lib/mpi/mpi-cmp.c [new file with mode: 0644]
lib/mpi/mpi-pow.c
lib/mpi/mpicoder.c
lib/oid_registry.c [new file with mode: 0644]
net/bluetooth/af_bluetooth.c
net/ceph/crypto.c
net/dns_resolver/dns_key.c
net/rxrpc/ar-key.c
scripts/.gitignore
scripts/Makefile
scripts/Makefile.build
scripts/Makefile.modpost
scripts/asn1_compiler.c [new file with mode: 0644]
scripts/sign-file [new file with mode: 0644]
scripts/x509keyid [new file with mode: 0755]
security/keys/encrypted-keys/encrypted.c
security/keys/key.c
security/keys/keyctl.c
security/keys/keyring.c
security/keys/request_key_auth.c
security/keys/trusted.c
security/keys/user_defined.c
tools/perf/Makefile
tools/perf/perf.h
tools/perf/util/evsel.c
tools/perf/util/evsel.h
tools/perf/util/header.h
tools/perf/util/include/asm/byteorder.h
tools/perf/util/include/linux/const.h
tools/perf/util/parse-events.h
tools/perf/util/pmu.h
tools/perf/util/session.h
tools/vm/page-types.c

index 57af07cf7e682e77de69d96587b0ca315ea611a1..0f2f40f71915fcdbf1a10b1e975131d137cdf2fa 100644 (file)
 *.o.*
 *.a
 *.s
+*.ko.unsigned
+*.ko.stripped
+*.ko.stripped.dig
+*.ko.stripped.sig
 *.ko
 *.so
 *.so.dbg
@@ -84,3 +88,13 @@ GTAGS
 *.orig
 *~
 \#*#
+
+#
+# Leavings from module signing
+#
+extra_certificates
+signing_key.priv
+signing_key.x509
+signing_key.x509.keyid
+signing_key.x509.signer
+x509.genkey
diff --git a/Documentation/crypto/asymmetric-keys.txt b/Documentation/crypto/asymmetric-keys.txt
new file mode 100644 (file)
index 0000000..b767590
--- /dev/null
@@ -0,0 +1,312 @@
+               =============================================
+               ASYMMETRIC / PUBLIC-KEY CRYPTOGRAPHY KEY TYPE
+               =============================================
+
+Contents:
+
+  - Overview.
+  - Key identification.
+  - Accessing asymmetric keys.
+    - Signature verification.
+  - Asymmetric key subtypes.
+  - Instantiation data parsers.
+
+
+========
+OVERVIEW
+========
+
+The "asymmetric" key type is designed to be a container for the keys used in
+public-key cryptography, without imposing any particular restrictions on the
+form or mechanism of the cryptography or form of the key.
+
+The asymmetric key is given a subtype that defines what sort of data is
+associated with the key and provides operations to describe and destroy it.
+However, no requirement is made that the key data actually be stored in the
+key.
+
+A completely in-kernel key retention and operation subtype can be defined, but
+it would also be possible to provide access to cryptographic hardware (such as
+a TPM) that might be used to both retain the relevant key and perform
+operations using that key.  In such a case, the asymmetric key would then
+merely be an interface to the TPM driver.
+
+Also provided is the concept of a data parser.  Data parsers are responsible
+for extracting information from the blobs of data passed to the instantiation
+function.  The first data parser that recognises the blob gets to set the
+subtype of the key and define the operations that can be done on that key.
+
+A data parser may interpret the data blob as containing the bits representing a
+key, or it may interpret it as a reference to a key held somewhere else in the
+system (for example, a TPM).
+
+
+==================
+KEY IDENTIFICATION
+==================
+
+If a key is added with an empty name, the instantiation data parsers are given
+the opportunity to pre-parse a key and to determine the description the key
+should be given from the content of the key.
+
+This can then be used to refer to the key, either by complete match or by
+partial match.  The key type may also use other criteria to refer to a key.
+
+The asymmetric key type's match function can then perform a wider range of
+comparisons than just the straightforward comparison of the description with
+the criterion string:
+
+ (1) If the criterion string is of the form "id:<hexdigits>" then the match
+     function will examine a key's fingerprint to see if the hex digits given
+     after the "id:" match the tail.  For instance:
+
+       keyctl search @s asymmetric id:5acc2142
+
+     will match a key with fingerprint:
+
+       1A00 2040 7601 7889 DE11  882C 3823 04AD 5ACC 2142
+
+ (2) If the criterion string is of the form "<subtype>:<hexdigits>" then the
+     match will match the ID as in (1), but with the added restriction that
+     only keys of the specified subtype (e.g. tpm) will be matched.  For
+     instance:
+
+       keyctl search @s asymmetric tpm:5acc2142
+
+Looking in /proc/keys, the last 8 hex digits of the key fingerprint are
+displayed, along with the subtype:
+
+       1a39e171 I-----     1 perm 3f010000     0     0 asymmetri modsign.0: DSA 5acc2142 []
+
+
+=========================
+ACCESSING ASYMMETRIC KEYS
+=========================
+
+For general access to asymmetric keys from within the kernel, the following
+inclusion is required:
+
+       #include <crypto/public_key.h>
+
+This gives access to functions for dealing with asymmetric / public keys.
+Three enums are defined there for representing public-key cryptography
+algorithms:
+
+       enum pkey_algo
+
+digest algorithms used by those:
+
+       enum pkey_hash_algo
+
+and key identifier representations:
+
+       enum pkey_id_type
+
+Note that the key type representation types are required because key
+identifiers from different standards aren't necessarily compatible.  For
+instance, PGP generates key identifiers by hashing the key data plus some
+PGP-specific metadata, whereas X.509 has arbitrary certificate identifiers.
+
+The operations defined upon a key are:
+
+ (1) Signature verification.
+
+Other operations are possible (such as encryption) with the same key data
+required for verification, but not currently supported, and others
+(eg. decryption and signature generation) require extra key data.
+
+
+SIGNATURE VERIFICATION
+----------------------
+
+An operation is provided to perform cryptographic signature verification, using
+an asymmetric key to provide or to provide access to the public key.
+
+       int verify_signature(const struct key *key,
+                            const struct public_key_signature *sig);
+
+The caller must have already obtained the key from some source and can then use
+it to check the signature.  The caller must have parsed the signature and
+transferred the relevant bits to the structure pointed to by sig.
+
+       struct public_key_signature {
+               u8 *digest;
+               u8 digest_size;
+               enum pkey_hash_algo pkey_hash_algo : 8;
+               u8 nr_mpi;
+               union {
+                       MPI mpi[2];
+                       ...
+               };
+       };
+
+The algorithm used must be noted in sig->pkey_hash_algo, and all the MPIs that
+make up the actual signature must be stored in sig->mpi[] and the count of MPIs
+placed in sig->nr_mpi.
+
+In addition, the data must have been digested by the caller and the resulting
+hash must be pointed to by sig->digest and the size of the hash be placed in
+sig->digest_size.
+
+The function will return 0 upon success or -EKEYREJECTED if the signature
+doesn't match.
+
+The function may also return -ENOTSUPP if an unsupported public-key algorithm
+or public-key/hash algorithm combination is specified or the key doesn't
+support the operation; -EBADMSG or -ERANGE if some of the parameters have weird
+data; or -ENOMEM if an allocation can't be performed.  -EINVAL can be returned
+if the key argument is the wrong type or is incompletely set up.
+
+
+=======================
+ASYMMETRIC KEY SUBTYPES
+=======================
+
+Asymmetric keys have a subtype that defines the set of operations that can be
+performed on that key and that determines what data is attached as the key
+payload.  The payload format is entirely at the whim of the subtype.
+
+The subtype is selected by the key data parser and the parser must initialise
+the data required for it.  The asymmetric key retains a reference on the
+subtype module.
+
+The subtype definition structure can be found in:
+
+       #include <keys/asymmetric-subtype.h>
+
+and looks like the following:
+
+       struct asymmetric_key_subtype {
+               struct module           *owner;
+               const char              *name;
+
+               void (*describe)(const struct key *key, struct seq_file *m);
+               void (*destroy)(void *payload);
+               int (*verify_signature)(const struct key *key,
+                                       const struct public_key_signature *sig);
+       };
+
+Asymmetric keys point to this with their type_data[0] member.
+
+The owner and name fields should be set to the owning module and the name of
+the subtype.  Currently, the name is only used for print statements.
+
+There are a number of operations defined by the subtype:
+
+ (1) describe().
+
+     Mandatory.  This allows the subtype to display something in /proc/keys
+     against the key.  For instance the name of the public key algorithm type
+     could be displayed.  The key type will display the tail of the key
+     identity string after this.
+
+ (2) destroy().
+
+     Mandatory.  This should free the memory associated with the key.  The
+     asymmetric key will look after freeing the fingerprint and releasing the
+     reference on the subtype module.
+
+ (3) verify_signature().
+
+     Optional.  These are the entry points for the key usage operations.
+     Currently there is only the one defined.  If not set, the caller will be
+     given -ENOTSUPP.  The subtype may do anything it likes to implement an
+     operation, including offloading to hardware.
+
+
+==========================
+INSTANTIATION DATA PARSERS
+==========================
+
+The asymmetric key type doesn't generally want to store or to deal with a raw
+blob of data that holds the key data.  It would have to parse it and error
+check it each time it wanted to use it.  Further, the contents of the blob may
+have various checks that can be performed on it (eg. self-signatures, validity
+dates) and may contain useful data about the key (identifiers, capabilities).
+
+Also, the blob may represent a pointer to some hardware containing the key
+rather than the key itself.
+
+Examples of blob formats for which parsers could be implemented include:
+
+ - OpenPGP packet stream [RFC 4880].
+ - X.509 ASN.1 stream.
+ - Pointer to TPM key.
+ - Pointer to UEFI key.
+
+During key instantiation each parser in the list is tried until one doesn't
+return -EBADMSG.
+
+The parser definition structure can be found in:
+
+       #include <keys/asymmetric-parser.h>
+
+and looks like the following:
+
+       struct asymmetric_key_parser {
+               struct module   *owner;
+               const char      *name;
+
+               int (*parse)(struct key_preparsed_payload *prep);
+       };
+
+The owner and name fields should be set to the owning module and the name of
+the parser.
+
+There is currently only a single operation defined by the parser, and it is
+mandatory:
+
+ (1) parse().
+
+     This is called to preparse the key from the key creation and update paths.
+     In particular, it is called during the key creation _before_ a key is
+     allocated, and as such, is permitted to provide the key's description in
+     the case that the caller declines to do so.
+
+     The caller passes a pointer to the following struct with all of the fields
+     cleared, except for data, datalen and quotalen [see
+     Documentation/security/keys.txt].
+
+       struct key_preparsed_payload {
+               char            *description;
+               void            *type_data[2];
+               void            *payload;
+               const void      *data;
+               size_t          datalen;
+               size_t          quotalen;
+       };
+
+     The instantiation data is in a blob pointed to by data and is datalen in
+     size.  The parse() function is not permitted to change these two values at
+     all, and shouldn't change any of the other values _unless_ they are
+     recognise the blob format and will not return -EBADMSG to indicate it is
+     not theirs.
+
+     If the parser is happy with the blob, it should propose a description for
+     the key and attach it to ->description, ->type_data[0] should be set to
+     point to the subtype to be used, ->payload should be set to point to the
+     initialised data for that subtype, ->type_data[1] should point to a hex
+     fingerprint and quotalen should be updated to indicate how much quota this
+     key should account for.
+
+     When clearing up, the data attached to ->type_data[1] and ->description
+     will be kfree()'d and the data attached to ->payload will be passed to the
+     subtype's ->destroy() method to be disposed of.  A module reference for
+     the subtype pointed to by ->type_data[0] will be put.
+
+
+     If the data format is not recognised, -EBADMSG should be returned.  If it
+     is recognised, but the key cannot for some reason be set up, some other
+     negative error code should be returned.  On success, 0 should be returned.
+
+     The key's fingerprint string may be partially matched upon.  For a
+     public-key algorithm such as RSA and DSA this will likely be a printable
+     hex version of the key's fingerprint.
+
+Functions are provided to register and unregister parsers:
+
+       int register_asymmetric_key_parser(struct asymmetric_key_parser *parser);
+       void unregister_asymmetric_key_parser(struct asymmetric_key_parser *subtype);
+
+Parsers may not have the same name.  The names are otherwise only used for
+displaying in debugging messages.
index 1c184495716697610d4bb41e1dde3ab60dce9e51..728c38c242d631b88117958360c6f8441a72be4b 100644 (file)
@@ -132,3 +132,12 @@ Here we can see the RAID type is raid4, there are 5 devices - all of
 which are 'A'live, and the array is 2/490221568 complete with recovery.
 Faulty or missing devices are marked 'D'.  Devices that are out-of-sync
 are marked 'a'.
+
+
+Version History
+---------------
+1.0.0  Initial version.  Support for RAID 4/5/6
+1.1.0  Added support for RAID 1
+1.2.0  Handle creation of arrays that contain failed devices.
+1.3.0  Added support for RAID 10
+1.3.1  Allow device replacement/rebuild for RAID 10
index e2ed3360b708c68ef70807ea56429e9f6e1e0aea..9776f068306b7f7ec6425ec4c02b17f5dac4788a 100644 (file)
@@ -1593,6 +1593,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                        log everything. Information is printed at KERN_DEBUG
                        so loglevel=8 may also need to be specified.
 
+       module.sig_enforce
+                       [KNL] When CONFIG_MODULE_SIG is set, this means that
+                       modules without (valid) signatures will fail to load.
+                       Note that if CONFIG_MODULE_SIG_ENFORCE is set, that
+                       is always true, so this option does nothing.
+
        mousedev.tap_time=
                        [MOUSE] Maximum time between finger touching and
                        leaving touchpad surface for touch to be considered
index aa0dbd74b71bdb242009483ce18492796fefa6aa..7d9ca92022d8c97b2f9db88c66713211c9c8cc2a 100644 (file)
@@ -412,6 +412,10 @@ The main syscalls are:
      to the keyring. In this case, an error will be generated if the process
      does not have permission to write to the keyring.
 
+     If the key type supports it, if the description is NULL or an empty
+     string, the key type will try and generate a description from the content
+     of the payload.
+
      The payload is optional, and the pointer can be NULL if not required by
      the type. The payload is plen in size, and plen can be zero for an empty
      payload.
@@ -1114,12 +1118,53 @@ The structure has a number of fields, some of which are mandatory:
      it should return 0.
 
 
- (*) int (*instantiate)(struct key *key, const void *data, size_t datalen);
+ (*) int (*preparse)(struct key_preparsed_payload *prep);
+
+     This optional method permits the key type to attempt to parse payload
+     before a key is created (add key) or the key semaphore is taken (update or
+     instantiate key).  The structure pointed to by prep looks like:
+
+       struct key_preparsed_payload {
+               char            *description;
+               void            *type_data[2];
+               void            *payload;
+               const void      *data;
+               size_t          datalen;
+               size_t          quotalen;
+       };
+
+     Before calling the method, the caller will fill in data and datalen with
+     the payload blob parameters; quotalen will be filled in with the default
+     quota size from the key type and the rest will be cleared.
+
+     If a description can be proposed from the payload contents, that should be
+     attached as a string to the description field.  This will be used for the
+     key description if the caller of add_key() passes NULL or "".
+
+     The method can attach anything it likes to type_data[] and payload.  These
+     are merely passed along to the instantiate() or update() operations.
+
+     The method should return 0 if success ful or a negative error code
+     otherwise.
+
+     
+ (*) void (*free_preparse)(struct key_preparsed_payload *prep);
+
+     This method is only required if the preparse() method is provided,
+     otherwise it is unused.  It cleans up anything attached to the
+     description, type_data and payload fields of the key_preparsed_payload
+     struct as filled in by the preparse() method.
+
+
+ (*) int (*instantiate)(struct key *key, struct key_preparsed_payload *prep);
 
      This method is called to attach a payload to a key during construction.
      The payload attached need not bear any relation to the data passed to this
      function.
 
+     The prep->data and prep->datalen fields will define the original payload
+     blob.  If preparse() was supplied then other fields may be filled in also.
+
      If the amount of data attached to the key differs from the size in
      keytype->def_datalen, then key_payload_reserve() should be called.
 
@@ -1135,6 +1180,9 @@ The structure has a number of fields, some of which are mandatory:
      If this type of key can be updated, then this method should be provided.
      It is called to update a key's payload from the blob of data provided.
 
+     The prep->data and prep->datalen fields will define the original payload
+     blob.  If preparse() was supplied then other fields may be filled in also.
+
      key_payload_reserve() should be called if the data length might change
      before any changes are actually made. Note that if this succeeds, the type
      is committed to changing the key because it's already been altered, so all
index 5d8e7f2583881bcbc8b549dc9e2d3d246498865a..5be2ee8c90e4247b90ec1aed9421492226d5f7f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
-PATCHLEVEL = 6
+PATCHLEVEL = 7
 SUBLEVEL = 0
-EXTRAVERSION =
+EXTRAVERSION = -rc1
 NAME = Terrified Chipmunk
 
 # *DOCUMENTATION*
@@ -997,7 +997,10 @@ CLEAN_DIRS  += $(MODVERDIR)
 MRPROPER_DIRS  += include/config usr/include include/generated          \
                   arch/*/include/generated
 MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
-                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
+                 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
+                 signing_key.priv signing_key.x509 x509.genkey         \
+                 extra_certificates signing_key.x509.keyid             \
+                 signing_key.x509.signer
 
 # clean - Delete most, but leave enough to build external modules
 #
@@ -1241,6 +1244,7 @@ clean: $(clean-dirs)
        $(call cmd,rmfiles)
        @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
                \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
+               -o -name '*.ko.*' \
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
                -o -name '*.symtypes' -o -name 'modules.order' \
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
index a79a1ad8bb960a1d2aead851018fd2496c231d12..366ec06a5185f0a59a7e5069357dbdb3da5a08c8 100644 (file)
@@ -322,4 +322,23 @@ config HAVE_IRQ_TIME_ACCOUNTING
 config HAVE_ARCH_TRANSPARENT_HUGEPAGE
        bool
 
+config HAVE_MOD_ARCH_SPECIFIC
+       bool
+       help
+         The arch uses struct mod_arch_specific to store data.  Many arches
+         just need a simple module loader without arch specific data - those
+         should not enable this.
+
+config MODULES_USE_ELF_RELA
+       bool
+       help
+         Modules only use ELF RELA relocations.  Modules with ELF REL
+         relocations will give an error.
+
+config MODULES_USE_ELF_REL
+       bool
+       help
+         Modules only use ELF REL relocations.  Modules with ELF RELA
+         relocations will give an error.
+
 source "kernel/gcov/Kconfig"
index 7a08cfb80ee8319887ea4005e5eaa7da2f174c78..5dd7f5db24d45e6d98961ae53cc4478224068d8b 100644 (file)
@@ -22,6 +22,8 @@ config ALPHA
        select GENERIC_STRNLEN_USER
        select GENERIC_KERNEL_THREAD
        select GENERIC_KERNEL_EXECVE
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
index 7b63743c534a10c34a022c92c144558e425a38d9..9cd13b55155f2f4083f44a8fcec3a79b935570c9 100644 (file)
@@ -1,19 +1,13 @@
 #ifndef _ALPHA_MODULE_H
 #define _ALPHA_MODULE_H
 
+#include <asm-generic/module.h>
+
 struct mod_arch_specific
 {
        unsigned int gotsecindex;
 };
 
-#define Elf_Sym Elf64_Sym
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Phdr Elf64_Phdr
-#define Elf_Dyn Elf64_Dyn
-#define Elf_Rel Elf64_Rel
-#define Elf_Rela Elf64_Rela
-
 #define ARCH_SHF_SMALL SHF_ALPHA_GPREL
 
 #ifdef MODULE
index 3d7f11fe610d0fcdd7bdf946c3796c8c6cd82e2b..7c3b522a20f5ff571219bb185b34c08419c852d2 100644 (file)
@@ -1,59 +1,60 @@
 config ARM
        bool
        default y
+       select ARCH_BINFMT_ELF_RANDOMIZE_PIE
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_CUSTOM_GPIO_H
-       select HAVE_AOUT
-       select HAVE_DMA_API_DEBUG
-       select HAVE_IDE if PCI || ISA || PCMCIA
-       select HAVE_DMA_ATTRS
-       select HAVE_DMA_CONTIGUOUS if MMU
-       select HAVE_MEMBLOCK
-       select RTC_LIB
-       select SYS_SUPPORTS_APM_EMULATION
+       select ARCH_WANT_IPC_PARSE_VERSION
+       select CPU_PM if (SUSPEND || CPU_IDLE)
+       select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
-       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
-       select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
+       select GENERIC_CLOCKEVENTS_BROADCAST if SMP
+       select GENERIC_IRQ_PROBE
+       select GENERIC_IRQ_SHOW
+       select GENERIC_KERNEL_THREAD
+       select GENERIC_KERNEL_EXECVE
+       select GENERIC_PCI_IOMAP
+       select GENERIC_SMP_IDLE_THREAD
+       select GENERIC_STRNCPY_FROM_USER
+       select GENERIC_STRNLEN_USER
+       select HARDIRQS_SW_RESEND
+       select HAVE_AOUT
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_SYSCALL_TRACEPOINTS
-       select HAVE_KPROBES if !XIP_KERNEL
-       select HAVE_KRETPROBES if (HAVE_KPROBES)
-       select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
-       select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
+       select HAVE_BPF_JIT
+       select HAVE_C_RECORDMCOUNT
+       select HAVE_DEBUG_KMEMLEAK
+       select HAVE_DMA_API_DEBUG
+       select HAVE_DMA_ATTRS
+       select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
+       select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
-       select ARCH_BINFMT_ELF_RANDOMIZE_PIE
+       select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
        select HAVE_GENERIC_DMA_COHERENT
-       select HAVE_DEBUG_KMEMLEAK
+       select HAVE_GENERIC_HARDIRQS
+       select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
+       select HAVE_IDE if PCI || ISA || PCMCIA
+       select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
-       select HAVE_KERNEL_LZO
        select HAVE_KERNEL_LZMA
+       select HAVE_KERNEL_LZO
        select HAVE_KERNEL_XZ
-       select HAVE_IRQ_WORK
+       select HAVE_KPROBES if !XIP_KERNEL
+       select HAVE_KRETPROBES if (HAVE_KPROBES)
+       select HAVE_MEMBLOCK
+       select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_PERF_EVENTS
-       select PERF_USE_VMALLOC
        select HAVE_REGS_AND_STACK_ACCESS_API
-       select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
-       select HAVE_C_RECORDMCOUNT
-       select HAVE_GENERIC_HARDIRQS
-       select HARDIRQS_SW_RESEND
-       select GENERIC_IRQ_PROBE
-       select GENERIC_IRQ_SHOW
+       select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_UID16
-       select ARCH_WANT_IPC_PARSE_VERSION
-       select HARDIRQS_SW_RESEND
-       select CPU_PM if (SUSPEND || CPU_IDLE)
-       select GENERIC_PCI_IOMAP
-       select HAVE_BPF_JIT
-       select GENERIC_SMP_IDLE_THREAD
        select KTIME_SCALAR
-       select GENERIC_CLOCKEVENTS_BROADCAST if SMP
-       select GENERIC_STRNCPY_FROM_USER
-       select GENERIC_STRNLEN_USER
-       select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
-       select GENERIC_KERNEL_THREAD
-       select GENERIC_KERNEL_EXECVE
+       select PERF_USE_VMALLOC
+       select RTC_LIB
+       select SYS_SUPPORTS_APM_EMULATION
+       select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
+       select MODULES_USE_ELF_REL
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@ -69,9 +70,9 @@ config NEED_SG_DMA_LENGTH
        bool
 
 config ARM_DMA_USE_IOMMU
-       select NEED_SG_DMA_LENGTH
-       select ARM_HAS_SG_CHAIN
        bool
+       select ARM_HAS_SG_CHAIN
+       select NEED_SG_DMA_LENGTH
 
 config HAVE_PWM
        bool
@@ -263,69 +264,69 @@ choice
 
 config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
+       depends on MMU
        select ARM_PATCH_PHYS_VIRT
        select AUTO_ZRELADDR
        select COMMON_CLK
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
        select USE_OF
-       depends on MMU
 
 config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
-       select ARM_AMBA
        select ARCH_HAS_CPUFREQ
+       select ARM_AMBA
        select COMMON_CLK
        select COMMON_CLK_VERSATILE
+       select GENERIC_CLOCKEVENTS
        select HAVE_TCM
        select ICST
-       select GENERIC_CLOCKEVENTS
+       select MULTI_IRQ_HANDLER
+       select NEED_MACH_MEMORY_H
        select PLAT_VERSATILE
        select PLAT_VERSATILE_FPGA_IRQ
-       select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
-       select MULTI_IRQ_HANDLER
        help
          Support for ARM's Integrator platform.
 
 config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_AMBA
+       select ARM_TIMER_SP804
        select COMMON_CLK
        select COMMON_CLK_VERSATILE
-       select ICST
        select GENERIC_CLOCKEVENTS
-       select ARCH_WANT_OPTIONAL_GPIOLIB
-       select PLAT_VERSATILE
-       select PLAT_VERSATILE_CLCD
-       select ARM_TIMER_SP804
        select GPIO_PL061 if GPIOLIB
+       select ICST
        select NEED_MACH_MEMORY_H
+       select PLAT_VERSATILE
+       select PLAT_VERSATILE_CLCD
        help
          This enables support for ARM Ltd RealView boards.
 
 config ARCH_VERSATILE
        bool "ARM Ltd. Versatile family"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_AMBA
+       select ARM_TIMER_SP804
        select ARM_VIC
        select CLKDEV_LOOKUP
+       select GENERIC_CLOCKEVENTS
        select HAVE_MACH_CLKDEV
        select ICST
-       select GENERIC_CLOCKEVENTS
-       select ARCH_WANT_OPTIONAL_GPIOLIB
        select PLAT_VERSATILE
-       select PLAT_VERSATILE_CLOCK
        select PLAT_VERSATILE_CLCD
+       select PLAT_VERSATILE_CLOCK
        select PLAT_VERSATILE_FPGA_IRQ
-       select ARM_TIMER_SP804
        help
          This enables support for ARM Ltd Versatile board.
 
 config ARCH_AT91
        bool "Atmel AT91"
        select ARCH_REQUIRE_GPIOLIB
-       select HAVE_CLK
        select CLKDEV_LOOKUP
+       select HAVE_CLK
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
@@ -352,43 +353,43 @@ config ARCH_BCM2835
          This enables support for the Broadcom BCM2835 SoC. This SoC is
          use in the Raspberry Pi, and Roku 2 devices.
 
-config ARCH_CLPS711X
-       bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
-       select CPU_ARM720T
-       select ARCH_USES_GETTIMEOFFSET
-       select COMMON_CLK
-       select CLKDEV_LOOKUP
-       select NEED_MACH_MEMORY_H
-       help
-         Support for Cirrus Logic 711x/721x/731x based boards.
-
 config ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
+       select ARM_GIC
        select CPU_V6K
        select GENERIC_CLOCKEVENTS
-       select ARM_GIC
        select MIGHT_HAVE_CACHE_L2X0
        select MIGHT_HAVE_PCI
        select PCI_DOMAINS if PCI
        help
          Support for Cavium Networks CNS3XXX platform.
 
+config ARCH_CLPS711X
+       bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
+       select ARCH_USES_GETTIMEOFFSET
+       select CLKDEV_LOOKUP
+       select COMMON_CLK
+       select CPU_ARM720T
+       select NEED_MACH_MEMORY_H
+       help
+         Support for Cirrus Logic 711x/721x/731x based boards.
+
 config ARCH_GEMINI
        bool "Cortina Systems Gemini"
-       select CPU_FA526
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
+       select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
 
 config ARCH_SIRF
        bool "CSR SiRF"
-       select NO_IOPORT
        select ARCH_REQUIRE_GPIOLIB
-       select GENERIC_CLOCKEVENTS
        select COMMON_CLK
+       select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
        select MIGHT_HAVE_CACHE_L2X0
+       select NO_IOPORT
        select PINCTRL
        select PINCTRL_SIRF
        select USE_OF
@@ -397,12 +398,12 @@ config ARCH_SIRF
 
 config ARCH_EBSA110
        bool "EBSA-110"
+       select ARCH_USES_GETTIMEOFFSET
        select CPU_SA110
        select ISA
-       select NO_IOPORT
-       select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
+       select NO_IOPORT
        help
          This is an evaluation board for the StrongARM processor available
          from Digital. It has limited hardware on-board, including an
@@ -411,13 +412,13 @@ config ARCH_EBSA110
 
 config ARCH_EP93XX
        bool "EP93xx-based"
-       select CPU_ARM920T
+       select ARCH_HAS_HOLES_MEMORYMODEL
+       select ARCH_REQUIRE_GPIOLIB
+       select ARCH_USES_GETTIMEOFFSET
        select ARM_AMBA
        select ARM_VIC
        select CLKDEV_LOOKUP
-       select ARCH_REQUIRE_GPIOLIB
-       select ARCH_HAS_HOLES_MEMORYMODEL
-       select ARCH_USES_GETTIMEOFFSET
+       select CPU_ARM920T
        select NEED_MACH_MEMORY_H
        help
          This enables support for the Cirrus EP93xx series of CPUs.
@@ -436,10 +437,10 @@ config ARCH_FOOTBRIDGE
 
 config ARCH_MXC
        bool "Freescale MXC/iMX-based"
-       select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
@@ -449,11 +450,11 @@ config ARCH_MXC
 
 config ARCH_MXS
        bool "Freescale MXS-based"
-       select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select COMMON_CLK
+       select GENERIC_CLOCKEVENTS
        select HAVE_CLK_PREPARE
        select MULTI_IRQ_HANDLER
        select PINCTRL
@@ -464,43 +465,43 @@ config ARCH_MXS
 
 config ARCH_NETX
        bool "Hilscher NetX based"
+       select ARM_VIC
        select CLKSRC_MMIO
        select CPU_ARM926T
-       select ARM_VIC
        select GENERIC_CLOCKEVENTS
        help
          This enables support for systems based on the Hilscher NetX Soc
 
 config ARCH_H720X
        bool "Hynix HMS720x-based"
+       select ARCH_USES_GETTIMEOFFSET
        select CPU_ARM720T
        select ISA_DMA_API
-       select ARCH_USES_GETTIMEOFFSET
        help
          This enables support for systems based on the Hynix HMS720x
 
 config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
-       select CPU_XSC3
-       select PLAT_IOP
-       select PCI
        select ARCH_SUPPORTS_MSI
-       select VMSPLIT_1G
+       select CPU_XSC3
        select NEED_MACH_MEMORY_H
        select NEED_RET_TO_USER
+       select PCI
+       select PLAT_IOP
+       select VMSPLIT_1G
        help
          Support for Intel's IOP13XX (XScale) family of processors.
 
 config ARCH_IOP32X
        bool "IOP32x-based"
        depends on MMU
+       select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
        select NEED_MACH_GPIO_H
        select NEED_RET_TO_USER
-       select PLAT_IOP
        select PCI
-       select ARCH_REQUIRE_GPIOLIB
+       select PLAT_IOP
        help
          Support for Intel's 80219 and IOP32X (XScale) family of
          processors.
@@ -508,12 +509,12 @@ config ARCH_IOP32X
 config ARCH_IOP33X
        bool "IOP33x-based"
        depends on MMU
+       select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
        select NEED_MACH_GPIO_H
        select NEED_RET_TO_USER
-       select PLAT_IOP
        select PCI
-       select ARCH_REQUIRE_GPIOLIB
+       select PLAT_IOP
        help
          Support for Intel's IOP33X (XScale) family of processors.
 
@@ -521,20 +522,20 @@ config ARCH_IXP4XX
        bool "IXP4xx-based"
        depends on MMU
        select ARCH_HAS_DMA_SET_COHERENT_MASK
+       select ARCH_REQUIRE_GPIOLIB
        select CLKSRC_MMIO
        select CPU_XSCALE
-       select ARCH_REQUIRE_GPIOLIB
+       select DMABOUNCE if PCI
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
-       select DMABOUNCE if PCI
        help
          Support for Intel's IXP4XX (XScale) family of processors.
 
 config ARCH_DOVE
        bool "Marvell Dove"
-       select CPU_V7
        select ARCH_REQUIRE_GPIOLIB
+       select CPU_V7
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select PLAT_ORION_LEGACY
@@ -544,36 +545,21 @@ config ARCH_DOVE
 
 config ARCH_KIRKWOOD
        bool "Marvell Kirkwood"
-       select CPU_FEROCEON
-       select PCI
        select ARCH_REQUIRE_GPIOLIB
+       select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
+       select PCI
        select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Kirkwood series SoCs:
          88F6180, 88F6192 and 88F6281.
 
-config ARCH_LPC32XX
-       bool "NXP LPC32XX"
-       select CLKSRC_MMIO
-       select CPU_ARM926T
-       select ARCH_REQUIRE_GPIOLIB
-       select HAVE_IDE
-       select ARM_AMBA
-       select USB_ARCH_HAS_OHCI
-       select CLKDEV_LOOKUP
-       select GENERIC_CLOCKEVENTS
-       select USE_OF
-       select HAVE_PWM
-       help
-         Support for the NXP LPC32XX family of processors
-
 config ARCH_MV78XX0
        bool "Marvell MV78xx0"
-       select CPU_FEROCEON
-       select PCI
        select ARCH_REQUIRE_GPIOLIB
+       select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
+       select PCI
        select PLAT_ORION_LEGACY
        help
          Support for the following Marvell MV78xx0 series SoCs:
@@ -582,10 +568,10 @@ config ARCH_MV78XX0
 config ARCH_ORION5X
        bool "Marvell Orion"
        depends on MMU
-       select CPU_FEROCEON
-       select PCI
        select ARCH_REQUIRE_GPIOLIB
+       select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
+       select PCI
        select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Orion 5x series SoCs:
@@ -597,33 +583,33 @@ config ARCH_MMP
        depends on MMU
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
+       select GENERIC_ALLOCATOR
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
        select IRQ_DOMAIN
+       select NEED_MACH_GPIO_H
        select PLAT_PXA
        select SPARSE_IRQ
-       select GENERIC_ALLOCATOR
-       select NEED_MACH_GPIO_H
        help
          Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
 config ARCH_KS8695
        bool "Micrel/Kendin KS8695"
-       select CPU_ARM922T
        select ARCH_REQUIRE_GPIOLIB
-       select NEED_MACH_MEMORY_H
        select CLKSRC_MMIO
+       select CPU_ARM922T
        select GENERIC_CLOCKEVENTS
+       select NEED_MACH_MEMORY_H
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
          System-on-Chip devices.
 
 config ARCH_W90X900
        bool "Nuvoton W90X900 CPU"
-       select CPU_ARM926T
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        help
          Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -634,18 +620,33 @@ config ARCH_W90X900
          <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
                ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
 
+config ARCH_LPC32XX
+       bool "NXP LPC32XX"
+       select ARCH_REQUIRE_GPIOLIB
+       select ARM_AMBA
+       select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
+       select CPU_ARM926T
+       select GENERIC_CLOCKEVENTS
+       select HAVE_IDE
+       select HAVE_PWM
+       select USB_ARCH_HAS_OHCI
+       select USE_OF
+       help
+         Support for the NXP LPC32XX family of processors
+
 config ARCH_TEGRA
        bool "NVIDIA Tegra"
+       select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
-       select ARCH_HAS_CPUFREQ
        select USE_OF
-       select COMMON_CLK
        help
          This enables support for NVIDIA Tegra based systems (Tegra APX,
          Tegra 6xx and Tegra 2 series).
@@ -653,29 +654,29 @@ config ARCH_TEGRA
 config ARCH_PXA
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
-       select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
+       select ARCH_MTD_XIP
+       select ARCH_REQUIRE_GPIOLIB
+       select ARM_CPU_SUSPEND if PM
+       select AUTO_ZRELADDR
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
-       select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
-       select PLAT_PXA
-       select SPARSE_IRQ
-       select AUTO_ZRELADDR
-       select MULTI_IRQ_HANDLER
-       select ARM_CPU_SUSPEND if PM
        select HAVE_IDE
+       select MULTI_IRQ_HANDLER
        select NEED_MACH_GPIO_H
+       select PLAT_PXA
+       select SPARSE_IRQ
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
 config ARCH_MSM
        bool "Qualcomm MSM"
-       select HAVE_CLK
-       select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
+       select GENERIC_CLOCKEVENTS
+       select HAVE_CLK
        help
          Support for Qualcomm MSM/QSD based systems.  This runs on the
          apps processor of the MSM/QSD and depends on a shared memory
@@ -685,50 +686,50 @@ config ARCH_MSM
 
 config ARCH_SHMOBILE
        bool "Renesas SH-Mobile / R-Mobile"
-       select HAVE_CLK
        select CLKDEV_LOOKUP
+       select GENERIC_CLOCKEVENTS
+       select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
-       select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_CACHE_L2X0
-       select NO_IOPORT
-       select SPARSE_IRQ
        select MULTI_IRQ_HANDLER
-       select PM_GENERIC_DOMAINS if PM
        select NEED_MACH_MEMORY_H
+       select NO_IOPORT
+       select PM_GENERIC_DOMAINS if PM
+       select SPARSE_IRQ
        help
          Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
 
 config ARCH_RPC
        bool "RiscPC"
        select ARCH_ACORN
-       select FIQ
        select ARCH_MAY_HAVE_PC_FDC
-       select HAVE_PATA_PLATFORM
-       select ISA_DMA_API
-       select NO_IOPORT
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_USES_GETTIMEOFFSET
+       select FIQ
        select HAVE_IDE
+       select HAVE_PATA_PLATFORM
+       select ISA_DMA_API
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
+       select NO_IOPORT
        help
          On the Acorn Risc-PC, Linux can support the internal IDE disk and
          CD-ROM interface, serial and parallel port, and the floppy drive.
 
 config ARCH_SA1100
        bool "SA1100-based"
-       select CLKSRC_MMIO
-       select CPU_SA1100
-       select ISA
-       select ARCH_SPARSEMEM_ENABLE
-       select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
+       select ARCH_MTD_XIP
+       select ARCH_REQUIRE_GPIOLIB
+       select ARCH_SPARSEMEM_ENABLE
+       select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
        select CPU_FREQ
+       select CPU_SA1100
        select GENERIC_CLOCKEVENTS
-       select CLKDEV_LOOKUP
-       select ARCH_REQUIRE_GPIOLIB
        select HAVE_IDE
+       select ISA
        select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
@@ -737,14 +738,14 @@ config ARCH_SA1100
 
 config ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs"
-       select GENERIC_GPIO
        select ARCH_HAS_CPUFREQ
-       select HAVE_CLK
-       select CLKDEV_LOOKUP
        select ARCH_USES_GETTIMEOFFSET
+       select CLKDEV_LOOKUP
+       select GENERIC_GPIO
+       select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
-       select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select HAVE_S3C_RTC if RTC_CLASS
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H
        help
@@ -755,38 +756,38 @@ config ARCH_S3C24XX
 
 config ARCH_S3C64XX
        bool "Samsung S3C64XX"
-       select PLAT_SAMSUNG
-       select CPU_V6
+       select ARCH_HAS_CPUFREQ
+       select ARCH_REQUIRE_GPIOLIB
+       select ARCH_USES_GETTIMEOFFSET
        select ARM_VIC
+       select CLKDEV_LOOKUP
+       select CPU_V6
        select HAVE_CLK
+       select HAVE_S3C2410_I2C if I2C
+       select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_TCM
-       select CLKDEV_LOOKUP
+       select NEED_MACH_GPIO_H
        select NO_IOPORT
-       select ARCH_USES_GETTIMEOFFSET
-       select ARCH_HAS_CPUFREQ
-       select ARCH_REQUIRE_GPIOLIB
+       select PLAT_SAMSUNG
+       select S3C_DEV_NAND
+       select S3C_GPIO_TRACK
        select SAMSUNG_CLKSRC
+       select SAMSUNG_GPIOLIB_4BIT
        select SAMSUNG_IRQ_VIC_TIMER
-       select S3C_GPIO_TRACK
-       select S3C_DEV_NAND
        select USB_ARCH_HAS_OHCI
-       select SAMSUNG_GPIOLIB_4BIT
-       select HAVE_S3C2410_I2C if I2C
-       select HAVE_S3C2410_WATCHDOG if WATCHDOG
-       select NEED_MACH_GPIO_H
        help
          Samsung S3C64XX series based systems
 
 config ARCH_S5P64X0
        bool "Samsung S5P6440 S5P6450"
-       select CPU_V6
-       select GENERIC_GPIO
-       select HAVE_CLK
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
-       select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select CPU_V6
        select GENERIC_CLOCKEVENTS
+       select GENERIC_GPIO
+       select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
+       select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
        select NEED_MACH_GPIO_H
        help
@@ -795,50 +796,50 @@ config ARCH_S5P64X0
 
 config ARCH_S5PC100
        bool "Samsung S5PC100"
-       select GENERIC_GPIO
-       select HAVE_CLK
+       select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
-       select ARCH_USES_GETTIMEOFFSET
+       select GENERIC_GPIO
+       select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
-       select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select HAVE_S3C_RTC if RTC_CLASS
        select NEED_MACH_GPIO_H
        help
          Samsung S5PC100 series based systems
 
 config ARCH_S5PV210
        bool "Samsung S5PV210/S5PC110"
-       select CPU_V7
-       select ARCH_SPARSEMEM_ENABLE
+       select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
-       select GENERIC_GPIO
-       select HAVE_CLK
+       select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
-       select ARCH_HAS_CPUFREQ
+       select CPU_V7
        select GENERIC_CLOCKEVENTS
+       select GENERIC_GPIO
+       select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
-       select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select HAVE_S3C_RTC if RTC_CLASS
        select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        help
          Samsung S5PV210/S5PC110 series based systems
 
 config ARCH_EXYNOS
-       bool "SAMSUNG EXYNOS"
-       select CPU_V7
-       select ARCH_SPARSEMEM_ENABLE
+       bool "Samsung EXYNOS"
+       select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
-       select GENERIC_GPIO
-       select HAVE_CLK
+       select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
-       select ARCH_HAS_CPUFREQ
+       select CPU_V7
        select GENERIC_CLOCKEVENTS
-       select HAVE_S3C_RTC if RTC_CLASS
+       select GENERIC_GPIO
+       select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select HAVE_S3C_RTC if RTC_CLASS
        select NEED_MACH_GPIO_H
        select NEED_MACH_MEMORY_H
        help
@@ -846,13 +847,13 @@ config ARCH_EXYNOS
 
 config ARCH_SHARK
        bool "Shark"
+       select ARCH_USES_GETTIMEOFFSET
        select CPU_SA110
        select ISA
        select ISA_DMA
-       select ZONE_DMA
-       select PCI
-       select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_MEMORY_H
+       select PCI
+       select ZONE_DMA
        help
          Support for the StrongARM based Digital DNARD machine, also known
          as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -860,17 +861,17 @@ config ARCH_SHARK
 config ARCH_U300
        bool "ST-Ericsson U300 Series"
        depends on MMU
-       select CLKSRC_MMIO
-       select CPU_ARM926T
-       select HAVE_TCM
+       select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_PATCH_PHYS_VIRT
        select ARM_VIC
-       select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
        select COMMON_CLK
+       select CPU_ARM926T
+       select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
-       select ARCH_REQUIRE_GPIOLIB
+       select HAVE_TCM
        select SPARSE_IRQ
        help
          Support for ST-Ericsson U300 series mobile platforms.
@@ -878,12 +879,12 @@ config ARCH_U300
 config ARCH_U8500
        bool "ST-Ericsson U8500 Series"
        depends on MMU
-       select CPU_V7
+       select ARCH_HAS_CPUFREQ
+       select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
-       select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
-       select ARCH_REQUIRE_GPIOLIB
-       select ARCH_HAS_CPUFREQ
+       select CPU_V7
+       select GENERIC_CLOCKEVENTS
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
@@ -891,78 +892,78 @@ config ARCH_U8500
 
 config ARCH_NOMADIK
        bool "STMicroelectronics Nomadik"
+       select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_VIC
-       select CPU_ARM926T
        select COMMON_CLK
+       select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
+       select MIGHT_HAVE_CACHE_L2X0
        select PINCTRL
        select PINCTRL_STN8815
-       select MIGHT_HAVE_CACHE_L2X0
-       select ARCH_REQUIRE_GPIOLIB
        help
          Support for the Nomadik platform by ST-Ericsson
 
+config PLAT_SPEAR
+       bool "ST SPEAr"
+       select ARCH_REQUIRE_GPIOLIB
+       select ARM_AMBA
+       select CLKDEV_LOOKUP
+       select CLKSRC_MMIO
+       select COMMON_CLK
+       select GENERIC_CLOCKEVENTS
+       select HAVE_CLK
+       help
+         Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
+
 config ARCH_DAVINCI
        bool "TI DaVinci"
-       select GENERIC_CLOCKEVENTS
+       select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_REQUIRE_GPIOLIB
-       select ZONE_DMA
-       select HAVE_IDE
        select CLKDEV_LOOKUP
        select GENERIC_ALLOCATOR
+       select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
-       select ARCH_HAS_HOLES_MEMORYMODEL
+       select HAVE_IDE
        select NEED_MACH_GPIO_H
+       select ZONE_DMA
        help
          Support for TI's DaVinci platform.
 
 config ARCH_OMAP
        bool "TI OMAP"
        depends on MMU
-       select HAVE_CLK
-       select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_CPUFREQ
-       select CLKSRC_MMIO
-       select GENERIC_CLOCKEVENTS
        select ARCH_HAS_HOLES_MEMORYMODEL
-       select NEED_MACH_GPIO_H
-       help
-         Support for TI's OMAP platform (OMAP1/2/3/4).
-
-config PLAT_SPEAR
-       bool "ST SPEAr"
-       select ARM_AMBA
        select ARCH_REQUIRE_GPIOLIB
-       select CLKDEV_LOOKUP
-       select COMMON_CLK
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
+       select NEED_MACH_GPIO_H
        help
-         Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
+         Support for TI's OMAP platform (OMAP1/2/3/4).
 
 config ARCH_VT8500
        bool "VIA/WonderMedia 85xx"
-       select CPU_ARM926T
-       select GENERIC_GPIO
        select ARCH_HAS_CPUFREQ
-       select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
-       select USE_OF
+       select CLKDEV_LOOKUP
        select COMMON_CLK
+       select CPU_ARM926T
+       select GENERIC_CLOCKEVENTS
+       select GENERIC_GPIO
        select HAVE_CLK
-       select CLKDEV_LOOKUP
+       select USE_OF
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 
 config ARCH_ZYNQ
        bool "Xilinx Zynq ARM Cortex A9 Platform"
+       select ARM_AMBA
+       select ARM_GIC
+       select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
-       select CLKDEV_LOOKUP
-       select ARM_GIC
-       select ARM_AMBA
        select ICST
        select MIGHT_HAVE_CACHE_L2X0
        select USE_OF
@@ -977,33 +978,33 @@ comment "CPU Core family selection"
 
 config ARCH_MULTI_V4
        bool "ARMv4 based platforms (FA526, StrongARM)"
-       select ARCH_MULTI_V4_V5
        depends on !ARCH_MULTI_V6_V7
+       select ARCH_MULTI_V4_V5
 
 config ARCH_MULTI_V4T
        bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
-       select ARCH_MULTI_V4_V5
        depends on !ARCH_MULTI_V6_V7
+       select ARCH_MULTI_V4_V5
 
 config ARCH_MULTI_V5
        bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
-       select ARCH_MULTI_V4_V5
        depends on !ARCH_MULTI_V6_V7
+       select ARCH_MULTI_V4_V5
 
 config ARCH_MULTI_V4_V5
        bool
 
 config ARCH_MULTI_V6
        bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
-       select CPU_V6
        select ARCH_MULTI_V6_V7
+       select CPU_V6
 
 config ARCH_MULTI_V7
        bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
-       select CPU_V7
-       select ARCH_VEXPRESS
        default y
        select ARCH_MULTI_V6_V7
+       select ARCH_VEXPRESS
+       select CPU_V7
 
 config ARCH_MULTI_V6_V7
        bool
@@ -1140,9 +1141,9 @@ config PLAT_IOP
 config PLAT_ORION
        bool
        select CLKSRC_MMIO
+       select COMMON_CLK
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
-       select COMMON_CLK
 
 config PLAT_ORION_LEGACY
        bool
@@ -1500,8 +1501,8 @@ config SMP
        depends on GENERIC_CLOCKEVENTS
        depends on HAVE_SMP
        depends on MMU
-       select USE_GENERIC_SMP_HELPERS
        select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
+       select USE_GENERIC_SMP_HELPERS
        help
          This enables support for systems with more than one CPU. If you have
          a system with only one CPU, like most personal computers, say N. If
@@ -1860,9 +1861,9 @@ menu "Boot options"
 
 config USE_OF
        bool "Flattened Device Tree support"
+       select IRQ_DOMAIN
        select OF
        select OF_EARLY_FLATTREE
-       select IRQ_DOMAIN
        help
          Include support for flattened device tree machine descriptions.
 
@@ -2144,8 +2145,8 @@ config CPU_FREQ_PXA
        bool
        depends on CPU_FREQ && ARCH_PXA && PXA25x
        default y
-       select CPU_FREQ_TABLE
        select CPU_FREQ_DEFAULT_GOV_USERSPACE
+       select CPU_FREQ_TABLE
 
 config CPU_FREQ_S3C
        bool
index 283fa1d804f4d34208e544f5c3064a72457afc52..45ceeb0e93e05faaa40195a30d82045f7b6aabe0 100644 (file)
@@ -1,15 +1,15 @@
 config ARM_GIC
+       bool
        select IRQ_DOMAIN
        select MULTI_IRQ_HANDLER
-       bool
 
 config GIC_NON_BANKED
        bool
 
 config ARM_VIC
+       bool
        select IRQ_DOMAIN
        select MULTI_IRQ_HANDLER
-       bool
 
 config ARM_VIC_NR
        int
index 8a7196ca5106a46ea1c7c30825306f11cb355108..f70ae175a3d6414b2edb2ef9c717b07038d0d117 100644 (file)
@@ -1,6 +1,4 @@
-include include/asm-generic/Kbuild.asm
 
-header-y += hwcap.h
 
 generic-y += auxvec.h
 generic-y += bitsperlong.h
index 917626128a1da7d326f6816ae63c1495a0290bc3..6ff56eca3f1f98ac5215aa0b3274f310ffbf0f7b 100644 (file)
@@ -1,31 +1,8 @@
 #ifndef __ASMARM_HWCAP_H
 #define __ASMARM_HWCAP_H
 
-/*
- * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
- */
-#define HWCAP_SWP      (1 << 0)
-#define HWCAP_HALF     (1 << 1)
-#define HWCAP_THUMB    (1 << 2)
-#define HWCAP_26BIT    (1 << 3)        /* Play it safe */
-#define HWCAP_FAST_MULT        (1 << 4)
-#define HWCAP_FPA      (1 << 5)
-#define HWCAP_VFP      (1 << 6)
-#define HWCAP_EDSP     (1 << 7)
-#define HWCAP_JAVA     (1 << 8)
-#define HWCAP_IWMMXT   (1 << 9)
-#define HWCAP_CRUNCH   (1 << 10)
-#define HWCAP_THUMBEE  (1 << 11)
-#define HWCAP_NEON     (1 << 12)
-#define HWCAP_VFPv3    (1 << 13)
-#define HWCAP_VFPv3D16 (1 << 14)
-#define HWCAP_TLS      (1 << 15)
-#define HWCAP_VFPv4    (1 << 16)
-#define HWCAP_IDIVA    (1 << 17)
-#define HWCAP_IDIVT    (1 << 18)
-#define HWCAP_IDIV     (HWCAP_IDIVA | HWCAP_IDIVT)
+#include <uapi/asm/hwcap.h>
 
-#if defined(__KERNEL__)
 #if !defined(__ASSEMBLY__)
 /*
  * This yields a mask that user programs can use to figure out what
@@ -35,5 +12,3 @@
 extern unsigned int elf_hwcap;
 #endif
 #endif
-
-#endif
index 6c6809f982f12557a6fa23a711f095c9a122fdb0..0d3a28dbc8e5db05823e6b83f85ccc5d04b807ac 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef _ASM_ARM_MODULE_H
 #define _ASM_ARM_MODULE_H
 
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
+#include <asm-generic/module.h>
 
 struct unwind_table;
 
@@ -16,13 +14,11 @@ enum {
        ARM_SEC_DEVEXIT,
        ARM_SEC_MAX,
 };
-#endif
 
 struct mod_arch_specific {
-#ifdef CONFIG_ARM_UNWIND
        struct unwind_table *unwind[ARM_SEC_MAX];
-#endif
 };
+#endif
 
 /*
  * Add the ARM architecture version to the version magic string
index 142d6ae4123150453d99aa9566767555afaa76f4..3d52ee1bfb3113e113f231807dba71bc739ceac0 100644 (file)
 #ifndef __ASM_ARM_PTRACE_H
 #define __ASM_ARM_PTRACE_H
 
-#include <asm/hwcap.h>
-
-#define PTRACE_GETREGS         12
-#define PTRACE_SETREGS         13
-#define PTRACE_GETFPREGS       14
-#define PTRACE_SETFPREGS       15
-/* PTRACE_ATTACH is 16 */
-/* PTRACE_DETACH is 17 */
-#define PTRACE_GETWMMXREGS     18
-#define PTRACE_SETWMMXREGS     19
-/* 20 is unused */
-#define PTRACE_OLDSETOPTIONS   21
-#define PTRACE_GET_THREAD_AREA 22
-#define PTRACE_SET_SYSCALL     23
-/* PTRACE_SYSCALL is 24 */
-#define PTRACE_GETCRUNCHREGS   25
-#define PTRACE_SETCRUNCHREGS   26
-#define PTRACE_GETVFPREGS      27
-#define PTRACE_SETVFPREGS      28
-#define PTRACE_GETHBPREGS      29
-#define PTRACE_SETHBPREGS      30
-
-/*
- * PSR bits
- */
-#define USR26_MODE     0x00000000
-#define FIQ26_MODE     0x00000001
-#define IRQ26_MODE     0x00000002
-#define SVC26_MODE     0x00000003
-#define USR_MODE       0x00000010
-#define FIQ_MODE       0x00000011
-#define IRQ_MODE       0x00000012
-#define SVC_MODE       0x00000013
-#define ABT_MODE       0x00000017
-#define HYP_MODE       0x0000001a
-#define UND_MODE       0x0000001b
-#define SYSTEM_MODE    0x0000001f
-#define MODE32_BIT     0x00000010
-#define MODE_MASK      0x0000001f
-#define PSR_T_BIT      0x00000020
-#define PSR_F_BIT      0x00000040
-#define PSR_I_BIT      0x00000080
-#define PSR_A_BIT      0x00000100
-#define PSR_E_BIT      0x00000200
-#define PSR_J_BIT      0x01000000
-#define PSR_Q_BIT      0x08000000
-#define PSR_V_BIT      0x10000000
-#define PSR_C_BIT      0x20000000
-#define PSR_Z_BIT      0x40000000
-#define PSR_N_BIT      0x80000000
-
-/*
- * Groups of PSR bits
- */
-#define PSR_f          0xff000000      /* Flags                */
-#define PSR_s          0x00ff0000      /* Status               */
-#define PSR_x          0x0000ff00      /* Extension            */
-#define PSR_c          0x000000ff      /* Control              */
-
-/*
- * ARMv7 groups of PSR bits
- */
-#define APSR_MASK      0xf80f0000      /* N, Z, C, V, Q and GE flags */
-#define PSR_ISET_MASK  0x01000010      /* ISA state (J, T) mask */
-#define PSR_IT_MASK    0x0600fc00      /* If-Then execution state mask */
-#define PSR_ENDIAN_MASK        0x00000200      /* Endianness state mask */
-
-/*
- * Default endianness state
- */
-#ifdef CONFIG_CPU_ENDIAN_BE8
-#define PSR_ENDSTATE   PSR_E_BIT
-#else
-#define PSR_ENDSTATE   0
-#endif
-
-/* 
- * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
- * process is located in memory.
- */
-#define PT_TEXT_ADDR           0x10000
-#define PT_DATA_ADDR           0x10004
-#define PT_TEXT_END_ADDR       0x10008
+#include <uapi/asm/ptrace.h>
 
 #ifndef __ASSEMBLY__
-
-/*
- * This struct defines the way the registers are stored on the
- * stack during a system call.  Note that sizeof(struct pt_regs)
- * has to be a multiple of 8.
- */
-#ifndef __KERNEL__
-struct pt_regs {
-       long uregs[18];
-};
-#else /* __KERNEL__ */
 struct pt_regs {
        unsigned long uregs[18];
 };
-#endif /* __KERNEL__ */
-
-#define ARM_cpsr       uregs[16]
-#define ARM_pc         uregs[15]
-#define ARM_lr         uregs[14]
-#define ARM_sp         uregs[13]
-#define ARM_ip         uregs[12]
-#define ARM_fp         uregs[11]
-#define ARM_r10                uregs[10]
-#define ARM_r9         uregs[9]
-#define ARM_r8         uregs[8]
-#define ARM_r7         uregs[7]
-#define ARM_r6         uregs[6]
-#define ARM_r5         uregs[5]
-#define ARM_r4         uregs[4]
-#define ARM_r3         uregs[3]
-#define ARM_r2         uregs[2]
-#define ARM_r1         uregs[1]
-#define ARM_r0         uregs[0]
-#define ARM_ORIG_r0    uregs[17]
-
-/*
- * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
- * and core dumps.
- */
-#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
-
-#ifdef __KERNEL__
 
 #define user_mode(regs)        \
        (((regs)->ARM_cpsr & 0xf) == 0)
@@ -260,9 +139,5 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
        (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1;   \
 })
 
-#endif /* __KERNEL__ */
-
 #endif /* __ASSEMBLY__ */
-
 #endif
-
index 24d284a1bfc75faa0ed90fb7882a67f00128f336..c50f0560950110b9f60d21f9ea9647be4ee77688 100644 (file)
 #ifndef __ASMARM_SETUP_H
 #define __ASMARM_SETUP_H
 
-#include <linux/types.h>
+#include <uapi/asm/setup.h>
 
-#define COMMAND_LINE_SIZE 1024
-
-/* The list ends with an ATAG_NONE node. */
-#define ATAG_NONE      0x00000000
-
-struct tag_header {
-       __u32 size;
-       __u32 tag;
-};
-
-/* The list must start with an ATAG_CORE node */
-#define ATAG_CORE      0x54410001
-
-struct tag_core {
-       __u32 flags;            /* bit 0 = read-only */
-       __u32 pagesize;
-       __u32 rootdev;
-};
-
-/* it is allowed to have multiple ATAG_MEM nodes */
-#define ATAG_MEM       0x54410002
-
-struct tag_mem32 {
-       __u32   size;
-       __u32   start;  /* physical start address */
-};
-
-/* VGA text type displays */
-#define ATAG_VIDEOTEXT 0x54410003
-
-struct tag_videotext {
-       __u8            x;
-       __u8            y;
-       __u16           video_page;
-       __u8            video_mode;
-       __u8            video_cols;
-       __u16           video_ega_bx;
-       __u8            video_lines;
-       __u8            video_isvga;
-       __u16           video_points;
-};
-
-/* describes how the ramdisk will be used in kernel */
-#define ATAG_RAMDISK   0x54410004
-
-struct tag_ramdisk {
-       __u32 flags;    /* bit 0 = load, bit 1 = prompt */
-       __u32 size;     /* decompressed ramdisk size in _kilo_ bytes */
-       __u32 start;    /* starting block of floppy-based RAM disk image */
-};
-
-/* describes where the compressed ramdisk image lives (virtual address) */
-/*
- * this one accidentally used virtual addresses - as such,
- * it's deprecated.
- */
-#define ATAG_INITRD    0x54410005
-
-/* describes where the compressed ramdisk image lives (physical address) */
-#define ATAG_INITRD2   0x54420005
-
-struct tag_initrd {
-       __u32 start;    /* physical start address */
-       __u32 size;     /* size of compressed ramdisk image in bytes */
-};
-
-/* board serial number. "64 bits should be enough for everybody" */
-#define ATAG_SERIAL    0x54410006
-
-struct tag_serialnr {
-       __u32 low;
-       __u32 high;
-};
-
-/* board revision */
-#define ATAG_REVISION  0x54410007
-
-struct tag_revision {
-       __u32 rev;
-};
-
-/* initial values for vesafb-type framebuffers. see struct screen_info
- * in include/linux/tty.h
- */
-#define ATAG_VIDEOLFB  0x54410008
-
-struct tag_videolfb {
-       __u16           lfb_width;
-       __u16           lfb_height;
-       __u16           lfb_depth;
-       __u16           lfb_linelength;
-       __u32           lfb_base;
-       __u32           lfb_size;
-       __u8            red_size;
-       __u8            red_pos;
-       __u8            green_size;
-       __u8            green_pos;
-       __u8            blue_size;
-       __u8            blue_pos;
-       __u8            rsvd_size;
-       __u8            rsvd_pos;
-};
-
-/* command line: \0 terminated string */
-#define ATAG_CMDLINE   0x54410009
-
-struct tag_cmdline {
-       char    cmdline[1];     /* this is the minimum size */
-};
-
-/* acorn RiscPC specific information */
-#define ATAG_ACORN     0x41000101
-
-struct tag_acorn {
-       __u32 memc_control_reg;
-       __u32 vram_pages;
-       __u8 sounddefault;
-       __u8 adfsdrives;
-};
-
-/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
-#define ATAG_MEMCLK    0x41000402
-
-struct tag_memclk {
-       __u32 fmemclk;
-};
-
-struct tag {
-       struct tag_header hdr;
-       union {
-               struct tag_core         core;
-               struct tag_mem32        mem;
-               struct tag_videotext    videotext;
-               struct tag_ramdisk      ramdisk;
-               struct tag_initrd       initrd;
-               struct tag_serialnr     serialnr;
-               struct tag_revision     revision;
-               struct tag_videolfb     videolfb;
-               struct tag_cmdline      cmdline;
-
-               /*
-                * Acorn specific
-                */
-               struct tag_acorn        acorn;
-
-               /*
-                * DC21285 specific
-                */
-               struct tag_memclk       memclk;
-       } u;
-};
-
-struct tagtable {
-       __u32 tag;
-       int (*parse)(const struct tag *);
-};
-
-#define tag_member_present(tag,member)                         \
-       ((unsigned long)(&((struct tag *)0L)->member + 1)       \
-               <= (tag)->hdr.size * 4)
-
-#define tag_next(t)    ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
-#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
-
-#define for_each_tag(t,base)           \
-       for (t = base; t->hdr.size; t = tag_next(t))
-
-#ifdef __KERNEL__
 
 #define __tag __used __attribute__((__section__(".taglist.init")))
 #define __tagtable(tag, fn) \
@@ -221,6 +53,4 @@ extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
 extern void early_print(const char *str, ...);
 extern void dump_machine_table(void);
 
-#endif  /*  __KERNEL__  */
-
 #endif
index 43ba0fb1c8ad2b774e42041715c1276b226ba7bf..5a7963dbd3fbd50d7006d43ad378b7dd579647b7 100644 (file)
@@ -1,12 +1,8 @@
 #ifndef _ASMARM_SIGNAL_H
 #define _ASMARM_SIGNAL_H
 
-#include <linux/types.h>
+#include <uapi/asm/signal.h>
 
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-
-#ifdef __KERNEL__
 /* Most things should be clean enough to redefine this at will, if care
    is taken to make libc match.  */
 
@@ -20,100 +16,6 @@ typedef struct {
        unsigned long sig[_NSIG_WORDS];
 } sigset_t;
 
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-#define NSIG           32
-typedef unsigned long sigset_t;
-
-#endif /* __KERNEL__ */
-
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGBUS          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGUSR1                10
-#define SIGSEGV                11
-#define SIGUSR2                12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGSTKFLT      16
-#define SIGCHLD                17
-#define SIGCONT                18
-#define SIGSTOP                19
-#define SIGTSTP                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGURG         23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGIO          29
-#define SIGPOLL                SIGIO
-/*
-#define SIGLOST                29
-*/
-#define SIGPWR         30
-#define SIGSYS         31
-#define        SIGUNUSED       31
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       32
-#define SIGRTMAX       _NSIG
-
-#define SIGSWI         32
-
-/*
- * SA_FLAGS values:
- *
- * SA_NOCLDSTOP                flag to turn off SIGCHLD when children stop.
- * SA_NOCLDWAIT                flag on SIGCHLD to inhibit zombies.
- * SA_SIGINFO          deliver the signal with SIGINFO structs
- * SA_THIRTYTWO                delivers the signal in 32-bit mode, even if the task 
- *                     is running in 26-bit.
- * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
- * SA_RESTART          flag to get restarting signals (which were the default long ago)
- * SA_NODEFER          prevents the current signal from being masked in the handler.
- * SA_RESETHAND                clears the handler when the signal is delivered.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-#define SA_NOCLDSTOP   0x00000001
-#define SA_NOCLDWAIT   0x00000002
-#define SA_SIGINFO     0x00000004
-#define SA_THIRTYTWO   0x02000000
-#define SA_RESTORER    0x04000000
-#define SA_ONSTACK     0x08000000
-#define SA_RESTART     0x10000000
-#define SA_NODEFER     0x40000000
-#define SA_RESETHAND   0x80000000
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-
-/* 
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
-
-#include <asm-generic/signal-defs.h>
-
-#ifdef __KERNEL__
 struct old_sigaction {
        __sighandler_t sa_handler;
        old_sigset_t sa_mask;
@@ -132,33 +34,6 @@ struct k_sigaction {
        struct sigaction sa;
 };
 
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-struct sigaction {
-       union {
-         __sighandler_t _sa_handler;
-         void (*_sa_sigaction)(int, struct siginfo *, void *);
-       } _u;
-       sigset_t sa_mask;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-#define sa_handler     _u._sa_handler
-#define sa_sigaction   _u._sa_sigaction
-
-#endif /* __KERNEL__ */
-
-typedef struct sigaltstack {
-       void __user *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-#ifdef __KERNEL__
 #include <asm/sigcontext.h>
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
 #endif
-
-#endif
index b859d82e30cafb5489fdb0297319a570f8362df3..537fc9b91889931459350ac8997cfb65e50b512b 100644 (file)
 #ifndef __ASM_ARM_SWAB_H
 #define __ASM_ARM_SWAB_H
 
-#include <linux/compiler.h>
-#include <linux/types.h>
+#include <uapi/asm/swab.h>
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __SWAB_64_THRU_32__
-#endif
-
-#if defined(__KERNEL__)
 #if __LINUX_ARM_ARCH__ >= 6
 
 static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
@@ -42,32 +36,3 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 
 #endif
 #endif
-
-#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
-static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
-{
-       __u32 t;
-
-#ifndef __thumb__
-       if (!__builtin_constant_p(x)) {
-               /*
-                * The compiler needs a bit of a hint here to always do the
-                * right thing and not screw it up to different degrees
-                * depending on the gcc version.
-                */
-               asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
-       } else
-#endif
-               t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
-
-       x = (x << 24) | (x >> 8);               /* mov r0,r0,ror #8      */
-       t &= ~0x00FF0000;                       /* bic r1,r1,#0x00FF0000 */
-       x ^= (t >> 8);                          /* eor r0,r0,r1,lsr #8   */
-
-       return x;
-}
-#define __arch_swab32 __arch_swab32
-
-#endif
-
-#endif
index 91819ad544242dc61706053cdff4dcb296e0a4f1..8f60b6e6bd41c632ccfe4e90250fcc4cb3bff46a 100644 (file)
 #ifndef __ASM_ARM_UNISTD_H
 #define __ASM_ARM_UNISTD_H
 
-#define __NR_OABI_SYSCALL_BASE 0x900000
+#include <uapi/asm/unistd.h>
 
-#if defined(__thumb__) || defined(__ARM_EABI__)
-#define __NR_SYSCALL_BASE      0
-#else
-#define __NR_SYSCALL_BASE      __NR_OABI_SYSCALL_BASE
-#endif
-
-/*
- * This file contains the system call numbers.
- */
-
-#define __NR_restart_syscall           (__NR_SYSCALL_BASE+  0)
-#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
-#define __NR_fork                      (__NR_SYSCALL_BASE+  2)
-#define __NR_read                      (__NR_SYSCALL_BASE+  3)
-#define __NR_write                     (__NR_SYSCALL_BASE+  4)
-#define __NR_open                      (__NR_SYSCALL_BASE+  5)
-#define __NR_close                     (__NR_SYSCALL_BASE+  6)
-                                       /* 7 was sys_waitpid */
-#define __NR_creat                     (__NR_SYSCALL_BASE+  8)
-#define __NR_link                      (__NR_SYSCALL_BASE+  9)
-#define __NR_unlink                    (__NR_SYSCALL_BASE+ 10)
-#define __NR_execve                    (__NR_SYSCALL_BASE+ 11)
-#define __NR_chdir                     (__NR_SYSCALL_BASE+ 12)
-#define __NR_time                      (__NR_SYSCALL_BASE+ 13)
-#define __NR_mknod                     (__NR_SYSCALL_BASE+ 14)
-#define __NR_chmod                     (__NR_SYSCALL_BASE+ 15)
-#define __NR_lchown                    (__NR_SYSCALL_BASE+ 16)
-                                       /* 17 was sys_break */
-                                       /* 18 was sys_stat */
-#define __NR_lseek                     (__NR_SYSCALL_BASE+ 19)
-#define __NR_getpid                    (__NR_SYSCALL_BASE+ 20)
-#define __NR_mount                     (__NR_SYSCALL_BASE+ 21)
-#define __NR_umount                    (__NR_SYSCALL_BASE+ 22)
-#define __NR_setuid                    (__NR_SYSCALL_BASE+ 23)
-#define __NR_getuid                    (__NR_SYSCALL_BASE+ 24)
-#define __NR_stime                     (__NR_SYSCALL_BASE+ 25)
-#define __NR_ptrace                    (__NR_SYSCALL_BASE+ 26)
-#define __NR_alarm                     (__NR_SYSCALL_BASE+ 27)
-                                       /* 28 was sys_fstat */
-#define __NR_pause                     (__NR_SYSCALL_BASE+ 29)
-#define __NR_utime                     (__NR_SYSCALL_BASE+ 30)
-                                       /* 31 was sys_stty */
-                                       /* 32 was sys_gtty */
-#define __NR_access                    (__NR_SYSCALL_BASE+ 33)
-#define __NR_nice                      (__NR_SYSCALL_BASE+ 34)
-                                       /* 35 was sys_ftime */
-#define __NR_sync                      (__NR_SYSCALL_BASE+ 36)
-#define __NR_kill                      (__NR_SYSCALL_BASE+ 37)
-#define __NR_rename                    (__NR_SYSCALL_BASE+ 38)
-#define __NR_mkdir                     (__NR_SYSCALL_BASE+ 39)
-#define __NR_rmdir                     (__NR_SYSCALL_BASE+ 40)
-#define __NR_dup                       (__NR_SYSCALL_BASE+ 41)
-#define __NR_pipe                      (__NR_SYSCALL_BASE+ 42)
-#define __NR_times                     (__NR_SYSCALL_BASE+ 43)
-                                       /* 44 was sys_prof */
-#define __NR_brk                       (__NR_SYSCALL_BASE+ 45)
-#define __NR_setgid                    (__NR_SYSCALL_BASE+ 46)
-#define __NR_getgid                    (__NR_SYSCALL_BASE+ 47)
-                                       /* 48 was sys_signal */
-#define __NR_geteuid                   (__NR_SYSCALL_BASE+ 49)
-#define __NR_getegid                   (__NR_SYSCALL_BASE+ 50)
-#define __NR_acct                      (__NR_SYSCALL_BASE+ 51)
-#define __NR_umount2                   (__NR_SYSCALL_BASE+ 52)
-                                       /* 53 was sys_lock */
-#define __NR_ioctl                     (__NR_SYSCALL_BASE+ 54)
-#define __NR_fcntl                     (__NR_SYSCALL_BASE+ 55)
-                                       /* 56 was sys_mpx */
-#define __NR_setpgid                   (__NR_SYSCALL_BASE+ 57)
-                                       /* 58 was sys_ulimit */
-                                       /* 59 was sys_olduname */
-#define __NR_umask                     (__NR_SYSCALL_BASE+ 60)
-#define __NR_chroot                    (__NR_SYSCALL_BASE+ 61)
-#define __NR_ustat                     (__NR_SYSCALL_BASE+ 62)
-#define __NR_dup2                      (__NR_SYSCALL_BASE+ 63)
-#define __NR_getppid                   (__NR_SYSCALL_BASE+ 64)
-#define __NR_getpgrp                   (__NR_SYSCALL_BASE+ 65)
-#define __NR_setsid                    (__NR_SYSCALL_BASE+ 66)
-#define __NR_sigaction                 (__NR_SYSCALL_BASE+ 67)
-                                       /* 68 was sys_sgetmask */
-                                       /* 69 was sys_ssetmask */
-#define __NR_setreuid                  (__NR_SYSCALL_BASE+ 70)
-#define __NR_setregid                  (__NR_SYSCALL_BASE+ 71)
-#define __NR_sigsuspend                        (__NR_SYSCALL_BASE+ 72)
-#define __NR_sigpending                        (__NR_SYSCALL_BASE+ 73)
-#define __NR_sethostname               (__NR_SYSCALL_BASE+ 74)
-#define __NR_setrlimit                 (__NR_SYSCALL_BASE+ 75)
-#define __NR_getrlimit                 (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
-#define __NR_getrusage                 (__NR_SYSCALL_BASE+ 77)
-#define __NR_gettimeofday              (__NR_SYSCALL_BASE+ 78)
-#define __NR_settimeofday              (__NR_SYSCALL_BASE+ 79)
-#define __NR_getgroups                 (__NR_SYSCALL_BASE+ 80)
-#define __NR_setgroups                 (__NR_SYSCALL_BASE+ 81)
-#define __NR_select                    (__NR_SYSCALL_BASE+ 82)
-#define __NR_symlink                   (__NR_SYSCALL_BASE+ 83)
-                                       /* 84 was sys_lstat */
-#define __NR_readlink                  (__NR_SYSCALL_BASE+ 85)
-#define __NR_uselib                    (__NR_SYSCALL_BASE+ 86)
-#define __NR_swapon                    (__NR_SYSCALL_BASE+ 87)
-#define __NR_reboot                    (__NR_SYSCALL_BASE+ 88)
-#define __NR_readdir                   (__NR_SYSCALL_BASE+ 89)
-#define __NR_mmap                      (__NR_SYSCALL_BASE+ 90)
-#define __NR_munmap                    (__NR_SYSCALL_BASE+ 91)
-#define __NR_truncate                  (__NR_SYSCALL_BASE+ 92)
-#define __NR_ftruncate                 (__NR_SYSCALL_BASE+ 93)
-#define __NR_fchmod                    (__NR_SYSCALL_BASE+ 94)
-#define __NR_fchown                    (__NR_SYSCALL_BASE+ 95)
-#define __NR_getpriority               (__NR_SYSCALL_BASE+ 96)
-#define __NR_setpriority               (__NR_SYSCALL_BASE+ 97)
-                                       /* 98 was sys_profil */
-#define __NR_statfs                    (__NR_SYSCALL_BASE+ 99)
-#define __NR_fstatfs                   (__NR_SYSCALL_BASE+100)
-                                       /* 101 was sys_ioperm */
-#define __NR_socketcall                        (__NR_SYSCALL_BASE+102)
-#define __NR_syslog                    (__NR_SYSCALL_BASE+103)
-#define __NR_setitimer                 (__NR_SYSCALL_BASE+104)
-#define __NR_getitimer                 (__NR_SYSCALL_BASE+105)
-#define __NR_stat                      (__NR_SYSCALL_BASE+106)
-#define __NR_lstat                     (__NR_SYSCALL_BASE+107)
-#define __NR_fstat                     (__NR_SYSCALL_BASE+108)
-                                       /* 109 was sys_uname */
-                                       /* 110 was sys_iopl */
-#define __NR_vhangup                   (__NR_SYSCALL_BASE+111)
-                                       /* 112 was sys_idle */
-#define __NR_syscall                   (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
-#define __NR_wait4                     (__NR_SYSCALL_BASE+114)
-#define __NR_swapoff                   (__NR_SYSCALL_BASE+115)
-#define __NR_sysinfo                   (__NR_SYSCALL_BASE+116)
-#define __NR_ipc                       (__NR_SYSCALL_BASE+117)
-#define __NR_fsync                     (__NR_SYSCALL_BASE+118)
-#define __NR_sigreturn                 (__NR_SYSCALL_BASE+119)
-#define __NR_clone                     (__NR_SYSCALL_BASE+120)
-#define __NR_setdomainname             (__NR_SYSCALL_BASE+121)
-#define __NR_uname                     (__NR_SYSCALL_BASE+122)
-                                       /* 123 was sys_modify_ldt */
-#define __NR_adjtimex                  (__NR_SYSCALL_BASE+124)
-#define __NR_mprotect                  (__NR_SYSCALL_BASE+125)
-#define __NR_sigprocmask               (__NR_SYSCALL_BASE+126)
-                                       /* 127 was sys_create_module */
-#define __NR_init_module               (__NR_SYSCALL_BASE+128)
-#define __NR_delete_module             (__NR_SYSCALL_BASE+129)
-                                       /* 130 was sys_get_kernel_syms */
-#define __NR_quotactl                  (__NR_SYSCALL_BASE+131)
-#define __NR_getpgid                   (__NR_SYSCALL_BASE+132)
-#define __NR_fchdir                    (__NR_SYSCALL_BASE+133)
-#define __NR_bdflush                   (__NR_SYSCALL_BASE+134)
-#define __NR_sysfs                     (__NR_SYSCALL_BASE+135)
-#define __NR_personality               (__NR_SYSCALL_BASE+136)
-                                       /* 137 was sys_afs_syscall */
-#define __NR_setfsuid                  (__NR_SYSCALL_BASE+138)
-#define __NR_setfsgid                  (__NR_SYSCALL_BASE+139)
-#define __NR__llseek                   (__NR_SYSCALL_BASE+140)
-#define __NR_getdents                  (__NR_SYSCALL_BASE+141)
-#define __NR__newselect                        (__NR_SYSCALL_BASE+142)
-#define __NR_flock                     (__NR_SYSCALL_BASE+143)
-#define __NR_msync                     (__NR_SYSCALL_BASE+144)
-#define __NR_readv                     (__NR_SYSCALL_BASE+145)
-#define __NR_writev                    (__NR_SYSCALL_BASE+146)
-#define __NR_getsid                    (__NR_SYSCALL_BASE+147)
-#define __NR_fdatasync                 (__NR_SYSCALL_BASE+148)
-#define __NR__sysctl                   (__NR_SYSCALL_BASE+149)
-#define __NR_mlock                     (__NR_SYSCALL_BASE+150)
-#define __NR_munlock                   (__NR_SYSCALL_BASE+151)
-#define __NR_mlockall                  (__NR_SYSCALL_BASE+152)
-#define __NR_munlockall                        (__NR_SYSCALL_BASE+153)
-#define __NR_sched_setparam            (__NR_SYSCALL_BASE+154)
-#define __NR_sched_getparam            (__NR_SYSCALL_BASE+155)
-#define __NR_sched_setscheduler                (__NR_SYSCALL_BASE+156)
-#define __NR_sched_getscheduler                (__NR_SYSCALL_BASE+157)
-#define __NR_sched_yield               (__NR_SYSCALL_BASE+158)
-#define __NR_sched_get_priority_max    (__NR_SYSCALL_BASE+159)
-#define __NR_sched_get_priority_min    (__NR_SYSCALL_BASE+160)
-#define __NR_sched_rr_get_interval     (__NR_SYSCALL_BASE+161)
-#define __NR_nanosleep                 (__NR_SYSCALL_BASE+162)
-#define __NR_mremap                    (__NR_SYSCALL_BASE+163)
-#define __NR_setresuid                 (__NR_SYSCALL_BASE+164)
-#define __NR_getresuid                 (__NR_SYSCALL_BASE+165)
-                                       /* 166 was sys_vm86 */
-                                       /* 167 was sys_query_module */
-#define __NR_poll                      (__NR_SYSCALL_BASE+168)
-#define __NR_nfsservctl                        (__NR_SYSCALL_BASE+169)
-#define __NR_setresgid                 (__NR_SYSCALL_BASE+170)
-#define __NR_getresgid                 (__NR_SYSCALL_BASE+171)
-#define __NR_prctl                     (__NR_SYSCALL_BASE+172)
-#define __NR_rt_sigreturn              (__NR_SYSCALL_BASE+173)
-#define __NR_rt_sigaction              (__NR_SYSCALL_BASE+174)
-#define __NR_rt_sigprocmask            (__NR_SYSCALL_BASE+175)
-#define __NR_rt_sigpending             (__NR_SYSCALL_BASE+176)
-#define __NR_rt_sigtimedwait           (__NR_SYSCALL_BASE+177)
-#define __NR_rt_sigqueueinfo           (__NR_SYSCALL_BASE+178)
-#define __NR_rt_sigsuspend             (__NR_SYSCALL_BASE+179)
-#define __NR_pread64                   (__NR_SYSCALL_BASE+180)
-#define __NR_pwrite64                  (__NR_SYSCALL_BASE+181)
-#define __NR_chown                     (__NR_SYSCALL_BASE+182)
-#define __NR_getcwd                    (__NR_SYSCALL_BASE+183)
-#define __NR_capget                    (__NR_SYSCALL_BASE+184)
-#define __NR_capset                    (__NR_SYSCALL_BASE+185)
-#define __NR_sigaltstack               (__NR_SYSCALL_BASE+186)
-#define __NR_sendfile                  (__NR_SYSCALL_BASE+187)
-                                       /* 188 reserved */
-                                       /* 189 reserved */
-#define __NR_vfork                     (__NR_SYSCALL_BASE+190)
-#define __NR_ugetrlimit                        (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
-#define __NR_mmap2                     (__NR_SYSCALL_BASE+192)
-#define __NR_truncate64                        (__NR_SYSCALL_BASE+193)
-#define __NR_ftruncate64               (__NR_SYSCALL_BASE+194)
-#define __NR_stat64                    (__NR_SYSCALL_BASE+195)
-#define __NR_lstat64                   (__NR_SYSCALL_BASE+196)
-#define __NR_fstat64                   (__NR_SYSCALL_BASE+197)
-#define __NR_lchown32                  (__NR_SYSCALL_BASE+198)
-#define __NR_getuid32                  (__NR_SYSCALL_BASE+199)
-#define __NR_getgid32                  (__NR_SYSCALL_BASE+200)
-#define __NR_geteuid32                 (__NR_SYSCALL_BASE+201)
-#define __NR_getegid32                 (__NR_SYSCALL_BASE+202)
-#define __NR_setreuid32                        (__NR_SYSCALL_BASE+203)
-#define __NR_setregid32                        (__NR_SYSCALL_BASE+204)
-#define __NR_getgroups32               (__NR_SYSCALL_BASE+205)
-#define __NR_setgroups32               (__NR_SYSCALL_BASE+206)
-#define __NR_fchown32                  (__NR_SYSCALL_BASE+207)
-#define __NR_setresuid32               (__NR_SYSCALL_BASE+208)
-#define __NR_getresuid32               (__NR_SYSCALL_BASE+209)
-#define __NR_setresgid32               (__NR_SYSCALL_BASE+210)
-#define __NR_getresgid32               (__NR_SYSCALL_BASE+211)
-#define __NR_chown32                   (__NR_SYSCALL_BASE+212)
-#define __NR_setuid32                  (__NR_SYSCALL_BASE+213)
-#define __NR_setgid32                  (__NR_SYSCALL_BASE+214)
-#define __NR_setfsuid32                        (__NR_SYSCALL_BASE+215)
-#define __NR_setfsgid32                        (__NR_SYSCALL_BASE+216)
-#define __NR_getdents64                        (__NR_SYSCALL_BASE+217)
-#define __NR_pivot_root                        (__NR_SYSCALL_BASE+218)
-#define __NR_mincore                   (__NR_SYSCALL_BASE+219)
-#define __NR_madvise                   (__NR_SYSCALL_BASE+220)
-#define __NR_fcntl64                   (__NR_SYSCALL_BASE+221)
-                                       /* 222 for tux */
-                                       /* 223 is unused */
-#define __NR_gettid                    (__NR_SYSCALL_BASE+224)
-#define __NR_readahead                 (__NR_SYSCALL_BASE+225)
-#define __NR_setxattr                  (__NR_SYSCALL_BASE+226)
-#define __NR_lsetxattr                 (__NR_SYSCALL_BASE+227)
-#define __NR_fsetxattr                 (__NR_SYSCALL_BASE+228)
-#define __NR_getxattr                  (__NR_SYSCALL_BASE+229)
-#define __NR_lgetxattr                 (__NR_SYSCALL_BASE+230)
-#define __NR_fgetxattr                 (__NR_SYSCALL_BASE+231)
-#define __NR_listxattr                 (__NR_SYSCALL_BASE+232)
-#define __NR_llistxattr                        (__NR_SYSCALL_BASE+233)
-#define __NR_flistxattr                        (__NR_SYSCALL_BASE+234)
-#define __NR_removexattr               (__NR_SYSCALL_BASE+235)
-#define __NR_lremovexattr              (__NR_SYSCALL_BASE+236)
-#define __NR_fremovexattr              (__NR_SYSCALL_BASE+237)
-#define __NR_tkill                     (__NR_SYSCALL_BASE+238)
-#define __NR_sendfile64                        (__NR_SYSCALL_BASE+239)
-#define __NR_futex                     (__NR_SYSCALL_BASE+240)
-#define __NR_sched_setaffinity         (__NR_SYSCALL_BASE+241)
-#define __NR_sched_getaffinity         (__NR_SYSCALL_BASE+242)
-#define __NR_io_setup                  (__NR_SYSCALL_BASE+243)
-#define __NR_io_destroy                        (__NR_SYSCALL_BASE+244)
-#define __NR_io_getevents              (__NR_SYSCALL_BASE+245)
-#define __NR_io_submit                 (__NR_SYSCALL_BASE+246)
-#define __NR_io_cancel                 (__NR_SYSCALL_BASE+247)
-#define __NR_exit_group                        (__NR_SYSCALL_BASE+248)
-#define __NR_lookup_dcookie            (__NR_SYSCALL_BASE+249)
-#define __NR_epoll_create              (__NR_SYSCALL_BASE+250)
-#define __NR_epoll_ctl                 (__NR_SYSCALL_BASE+251)
-#define __NR_epoll_wait                        (__NR_SYSCALL_BASE+252)
-#define __NR_remap_file_pages          (__NR_SYSCALL_BASE+253)
-                                       /* 254 for set_thread_area */
-                                       /* 255 for get_thread_area */
-#define __NR_set_tid_address           (__NR_SYSCALL_BASE+256)
-#define __NR_timer_create              (__NR_SYSCALL_BASE+257)
-#define __NR_timer_settime             (__NR_SYSCALL_BASE+258)
-#define __NR_timer_gettime             (__NR_SYSCALL_BASE+259)
-#define __NR_timer_getoverrun          (__NR_SYSCALL_BASE+260)
-#define __NR_timer_delete              (__NR_SYSCALL_BASE+261)
-#define __NR_clock_settime             (__NR_SYSCALL_BASE+262)
-#define __NR_clock_gettime             (__NR_SYSCALL_BASE+263)
-#define __NR_clock_getres              (__NR_SYSCALL_BASE+264)
-#define __NR_clock_nanosleep           (__NR_SYSCALL_BASE+265)
-#define __NR_statfs64                  (__NR_SYSCALL_BASE+266)
-#define __NR_fstatfs64                 (__NR_SYSCALL_BASE+267)
-#define __NR_tgkill                    (__NR_SYSCALL_BASE+268)
-#define __NR_utimes                    (__NR_SYSCALL_BASE+269)
-#define __NR_arm_fadvise64_64          (__NR_SYSCALL_BASE+270)
-#define __NR_pciconfig_iobase          (__NR_SYSCALL_BASE+271)
-#define __NR_pciconfig_read            (__NR_SYSCALL_BASE+272)
-#define __NR_pciconfig_write           (__NR_SYSCALL_BASE+273)
-#define __NR_mq_open                   (__NR_SYSCALL_BASE+274)
-#define __NR_mq_unlink                 (__NR_SYSCALL_BASE+275)
-#define __NR_mq_timedsend              (__NR_SYSCALL_BASE+276)
-#define __NR_mq_timedreceive           (__NR_SYSCALL_BASE+277)
-#define __NR_mq_notify                 (__NR_SYSCALL_BASE+278)
-#define __NR_mq_getsetattr             (__NR_SYSCALL_BASE+279)
-#define __NR_waitid                    (__NR_SYSCALL_BASE+280)
-#define __NR_socket                    (__NR_SYSCALL_BASE+281)
-#define __NR_bind                      (__NR_SYSCALL_BASE+282)
-#define __NR_connect                   (__NR_SYSCALL_BASE+283)
-#define __NR_listen                    (__NR_SYSCALL_BASE+284)
-#define __NR_accept                    (__NR_SYSCALL_BASE+285)
-#define __NR_getsockname               (__NR_SYSCALL_BASE+286)
-#define __NR_getpeername               (__NR_SYSCALL_BASE+287)
-#define __NR_socketpair                        (__NR_SYSCALL_BASE+288)
-#define __NR_send                      (__NR_SYSCALL_BASE+289)
-#define __NR_sendto                    (__NR_SYSCALL_BASE+290)
-#define __NR_recv                      (__NR_SYSCALL_BASE+291)
-#define __NR_recvfrom                  (__NR_SYSCALL_BASE+292)
-#define __NR_shutdown                  (__NR_SYSCALL_BASE+293)
-#define __NR_setsockopt                        (__NR_SYSCALL_BASE+294)
-#define __NR_getsockopt                        (__NR_SYSCALL_BASE+295)
-#define __NR_sendmsg                   (__NR_SYSCALL_BASE+296)
-#define __NR_recvmsg                   (__NR_SYSCALL_BASE+297)
-#define __NR_semop                     (__NR_SYSCALL_BASE+298)
-#define __NR_semget                    (__NR_SYSCALL_BASE+299)
-#define __NR_semctl                    (__NR_SYSCALL_BASE+300)
-#define __NR_msgsnd                    (__NR_SYSCALL_BASE+301)
-#define __NR_msgrcv                    (__NR_SYSCALL_BASE+302)
-#define __NR_msgget                    (__NR_SYSCALL_BASE+303)
-#define __NR_msgctl                    (__NR_SYSCALL_BASE+304)
-#define __NR_shmat                     (__NR_SYSCALL_BASE+305)
-#define __NR_shmdt                     (__NR_SYSCALL_BASE+306)
-#define __NR_shmget                    (__NR_SYSCALL_BASE+307)
-#define __NR_shmctl                    (__NR_SYSCALL_BASE+308)
-#define __NR_add_key                   (__NR_SYSCALL_BASE+309)
-#define __NR_request_key               (__NR_SYSCALL_BASE+310)
-#define __NR_keyctl                    (__NR_SYSCALL_BASE+311)
-#define __NR_semtimedop                        (__NR_SYSCALL_BASE+312)
-#define __NR_vserver                   (__NR_SYSCALL_BASE+313)
-#define __NR_ioprio_set                        (__NR_SYSCALL_BASE+314)
-#define __NR_ioprio_get                        (__NR_SYSCALL_BASE+315)
-#define __NR_inotify_init              (__NR_SYSCALL_BASE+316)
-#define __NR_inotify_add_watch         (__NR_SYSCALL_BASE+317)
-#define __NR_inotify_rm_watch          (__NR_SYSCALL_BASE+318)
-#define __NR_mbind                     (__NR_SYSCALL_BASE+319)
-#define __NR_get_mempolicy             (__NR_SYSCALL_BASE+320)
-#define __NR_set_mempolicy             (__NR_SYSCALL_BASE+321)
-#define __NR_openat                    (__NR_SYSCALL_BASE+322)
-#define __NR_mkdirat                   (__NR_SYSCALL_BASE+323)
-#define __NR_mknodat                   (__NR_SYSCALL_BASE+324)
-#define __NR_fchownat                  (__NR_SYSCALL_BASE+325)
-#define __NR_futimesat                 (__NR_SYSCALL_BASE+326)
-#define __NR_fstatat64                 (__NR_SYSCALL_BASE+327)
-#define __NR_unlinkat                  (__NR_SYSCALL_BASE+328)
-#define __NR_renameat                  (__NR_SYSCALL_BASE+329)
-#define __NR_linkat                    (__NR_SYSCALL_BASE+330)
-#define __NR_symlinkat                 (__NR_SYSCALL_BASE+331)
-#define __NR_readlinkat                        (__NR_SYSCALL_BASE+332)
-#define __NR_fchmodat                  (__NR_SYSCALL_BASE+333)
-#define __NR_faccessat                 (__NR_SYSCALL_BASE+334)
-#define __NR_pselect6                  (__NR_SYSCALL_BASE+335)
-#define __NR_ppoll                     (__NR_SYSCALL_BASE+336)
-#define __NR_unshare                   (__NR_SYSCALL_BASE+337)
-#define __NR_set_robust_list           (__NR_SYSCALL_BASE+338)
-#define __NR_get_robust_list           (__NR_SYSCALL_BASE+339)
-#define __NR_splice                    (__NR_SYSCALL_BASE+340)
-#define __NR_arm_sync_file_range       (__NR_SYSCALL_BASE+341)
-#define __NR_sync_file_range2          __NR_arm_sync_file_range
-#define __NR_tee                       (__NR_SYSCALL_BASE+342)
-#define __NR_vmsplice                  (__NR_SYSCALL_BASE+343)
-#define __NR_move_pages                        (__NR_SYSCALL_BASE+344)
-#define __NR_getcpu                    (__NR_SYSCALL_BASE+345)
-#define __NR_epoll_pwait               (__NR_SYSCALL_BASE+346)
-#define __NR_kexec_load                        (__NR_SYSCALL_BASE+347)
-#define __NR_utimensat                 (__NR_SYSCALL_BASE+348)
-#define __NR_signalfd                  (__NR_SYSCALL_BASE+349)
-#define __NR_timerfd_create            (__NR_SYSCALL_BASE+350)
-#define __NR_eventfd                   (__NR_SYSCALL_BASE+351)
-#define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
-#define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
-#define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
-#define __NR_signalfd4                 (__NR_SYSCALL_BASE+355)
-#define __NR_eventfd2                  (__NR_SYSCALL_BASE+356)
-#define __NR_epoll_create1             (__NR_SYSCALL_BASE+357)
-#define __NR_dup3                      (__NR_SYSCALL_BASE+358)
-#define __NR_pipe2                     (__NR_SYSCALL_BASE+359)
-#define __NR_inotify_init1             (__NR_SYSCALL_BASE+360)
-#define __NR_preadv                    (__NR_SYSCALL_BASE+361)
-#define __NR_pwritev                   (__NR_SYSCALL_BASE+362)
-#define __NR_rt_tgsigqueueinfo         (__NR_SYSCALL_BASE+363)
-#define __NR_perf_event_open           (__NR_SYSCALL_BASE+364)
-#define __NR_recvmmsg                  (__NR_SYSCALL_BASE+365)
-#define __NR_accept4                   (__NR_SYSCALL_BASE+366)
-#define __NR_fanotify_init             (__NR_SYSCALL_BASE+367)
-#define __NR_fanotify_mark             (__NR_SYSCALL_BASE+368)
-#define __NR_prlimit64                 (__NR_SYSCALL_BASE+369)
-#define __NR_name_to_handle_at         (__NR_SYSCALL_BASE+370)
-#define __NR_open_by_handle_at         (__NR_SYSCALL_BASE+371)
-#define __NR_clock_adjtime             (__NR_SYSCALL_BASE+372)
-#define __NR_syncfs                    (__NR_SYSCALL_BASE+373)
-#define __NR_sendmmsg                  (__NR_SYSCALL_BASE+374)
-#define __NR_setns                     (__NR_SYSCALL_BASE+375)
-#define __NR_process_vm_readv          (__NR_SYSCALL_BASE+376)
-#define __NR_process_vm_writev         (__NR_SYSCALL_BASE+377)
-                                       /* 378 for kcmp */
-
-/*
- * This may need to be greater than __NR_last_syscall+1 in order to
- * account for the padding in the syscall table
- */
-#ifdef __KERNEL__
 #define __NR_syscalls  (380)
-#endif /* __KERNEL__ */
-
-/*
- * The following SWIs are ARM private.
- */
-#define __ARM_NR_BASE                  (__NR_SYSCALL_BASE+0x0f0000)
-#define __ARM_NR_breakpoint            (__ARM_NR_BASE+1)
-#define __ARM_NR_cacheflush            (__ARM_NR_BASE+2)
-#define __ARM_NR_usr26                 (__ARM_NR_BASE+3)
-#define __ARM_NR_usr32                 (__ARM_NR_BASE+4)
-#define __ARM_NR_set_tls               (__ARM_NR_BASE+5)
-
-/*
- * *NOTE*: This is a ghost syscall private to the kernel.  Only the
- * __kuser_cmpxchg code in entry-armv.S should be aware of its
- * existence.  Don't ever use this from user code.
- */
-#ifdef __KERNEL__
 #define __ARM_NR_cmpxchg               (__ARM_NR_BASE+0x00fff0)
-#endif
-
-/*
- * The following syscalls are obsolete and no longer available for EABI.
- */
-#if !defined(__KERNEL__)
-#if defined(__ARM_EABI__)
-#undef __NR_time
-#undef __NR_umount
-#undef __NR_stime
-#undef __NR_alarm
-#undef __NR_utime
-#undef __NR_getrlimit
-#undef __NR_select
-#undef __NR_readdir
-#undef __NR_mmap
-#undef __NR_socketcall
-#undef __NR_syscall
-#undef __NR_ipc
-#endif
-#endif
-
-#ifdef __KERNEL__
 
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
 #define __IGNORE_migrate_pages
 #define __IGNORE_kcmp
 
-#endif /* __KERNEL__ */
 #endif /* __ASM_ARM_UNISTD_H */
index baebb3da1d44160fc6f6f259886656e6f494b167..47bcb2d254af8e4fdb3bacee96131d88a0e4f37e 100644 (file)
@@ -1,3 +1,19 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += a.out.h
+header-y += byteorder.h
+header-y += fcntl.h
+header-y += hwcap.h
+header-y += ioctls.h
+header-y += kvm_para.h
+header-y += mman.h
+header-y += posix_types.h
+header-y += ptrace.h
+header-y += setup.h
+header-y += sigcontext.h
+header-y += signal.h
+header-y += stat.h
+header-y += statfs.h
+header-y += swab.h
+header-y += unistd.h
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
new file mode 100644 (file)
index 0000000..f254f65
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _UAPI__ASMARM_HWCAP_H
+#define _UAPI__ASMARM_HWCAP_H
+
+/*
+ * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
+ */
+#define HWCAP_SWP      (1 << 0)
+#define HWCAP_HALF     (1 << 1)
+#define HWCAP_THUMB    (1 << 2)
+#define HWCAP_26BIT    (1 << 3)        /* Play it safe */
+#define HWCAP_FAST_MULT        (1 << 4)
+#define HWCAP_FPA      (1 << 5)
+#define HWCAP_VFP      (1 << 6)
+#define HWCAP_EDSP     (1 << 7)
+#define HWCAP_JAVA     (1 << 8)
+#define HWCAP_IWMMXT   (1 << 9)
+#define HWCAP_CRUNCH   (1 << 10)
+#define HWCAP_THUMBEE  (1 << 11)
+#define HWCAP_NEON     (1 << 12)
+#define HWCAP_VFPv3    (1 << 13)
+#define HWCAP_VFPv3D16 (1 << 14)
+#define HWCAP_TLS      (1 << 15)
+#define HWCAP_VFPv4    (1 << 16)
+#define HWCAP_IDIVA    (1 << 17)
+#define HWCAP_IDIVT    (1 << 18)
+#define HWCAP_IDIV     (HWCAP_IDIVA | HWCAP_IDIVT)
+
+
+#endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..96ee092
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ *  arch/arm/include/asm/ptrace.h
+ *
+ *  Copyright (C) 1996-2003 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef _UAPI__ASM_ARM_PTRACE_H
+#define _UAPI__ASM_ARM_PTRACE_H
+
+#include <asm/hwcap.h>
+
+#define PTRACE_GETREGS         12
+#define PTRACE_SETREGS         13
+#define PTRACE_GETFPREGS       14
+#define PTRACE_SETFPREGS       15
+/* PTRACE_ATTACH is 16 */
+/* PTRACE_DETACH is 17 */
+#define PTRACE_GETWMMXREGS     18
+#define PTRACE_SETWMMXREGS     19
+/* 20 is unused */
+#define PTRACE_OLDSETOPTIONS   21
+#define PTRACE_GET_THREAD_AREA 22
+#define PTRACE_SET_SYSCALL     23
+/* PTRACE_SYSCALL is 24 */
+#define PTRACE_GETCRUNCHREGS   25
+#define PTRACE_SETCRUNCHREGS   26
+#define PTRACE_GETVFPREGS      27
+#define PTRACE_SETVFPREGS      28
+#define PTRACE_GETHBPREGS      29
+#define PTRACE_SETHBPREGS      30
+
+/*
+ * PSR bits
+ */
+#define USR26_MODE     0x00000000
+#define FIQ26_MODE     0x00000001
+#define IRQ26_MODE     0x00000002
+#define SVC26_MODE     0x00000003
+#define USR_MODE       0x00000010
+#define FIQ_MODE       0x00000011
+#define IRQ_MODE       0x00000012
+#define SVC_MODE       0x00000013
+#define ABT_MODE       0x00000017
+#define HYP_MODE       0x0000001a
+#define UND_MODE       0x0000001b
+#define SYSTEM_MODE    0x0000001f
+#define MODE32_BIT     0x00000010
+#define MODE_MASK      0x0000001f
+#define PSR_T_BIT      0x00000020
+#define PSR_F_BIT      0x00000040
+#define PSR_I_BIT      0x00000080
+#define PSR_A_BIT      0x00000100
+#define PSR_E_BIT      0x00000200
+#define PSR_J_BIT      0x01000000
+#define PSR_Q_BIT      0x08000000
+#define PSR_V_BIT      0x10000000
+#define PSR_C_BIT      0x20000000
+#define PSR_Z_BIT      0x40000000
+#define PSR_N_BIT      0x80000000
+
+/*
+ * Groups of PSR bits
+ */
+#define PSR_f          0xff000000      /* Flags                */
+#define PSR_s          0x00ff0000      /* Status               */
+#define PSR_x          0x0000ff00      /* Extension            */
+#define PSR_c          0x000000ff      /* Control              */
+
+/*
+ * ARMv7 groups of PSR bits
+ */
+#define APSR_MASK      0xf80f0000      /* N, Z, C, V, Q and GE flags */
+#define PSR_ISET_MASK  0x01000010      /* ISA state (J, T) mask */
+#define PSR_IT_MASK    0x0600fc00      /* If-Then execution state mask */
+#define PSR_ENDIAN_MASK        0x00000200      /* Endianness state mask */
+
+/*
+ * Default endianness state
+ */
+#ifdef CONFIG_CPU_ENDIAN_BE8
+#define PSR_ENDSTATE   PSR_E_BIT
+#else
+#define PSR_ENDSTATE   0
+#endif
+
+/* 
+ * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
+ * process is located in memory.
+ */
+#define PT_TEXT_ADDR           0x10000
+#define PT_DATA_ADDR           0x10004
+#define PT_TEXT_END_ADDR       0x10008
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This struct defines the way the registers are stored on the
+ * stack during a system call.  Note that sizeof(struct pt_regs)
+ * has to be a multiple of 8.
+ */
+#ifndef __KERNEL__
+struct pt_regs {
+       long uregs[18];
+};
+#endif /* __KERNEL__ */
+
+#define ARM_cpsr       uregs[16]
+#define ARM_pc         uregs[15]
+#define ARM_lr         uregs[14]
+#define ARM_sp         uregs[13]
+#define ARM_ip         uregs[12]
+#define ARM_fp         uregs[11]
+#define ARM_r10                uregs[10]
+#define ARM_r9         uregs[9]
+#define ARM_r8         uregs[8]
+#define ARM_r7         uregs[7]
+#define ARM_r6         uregs[6]
+#define ARM_r5         uregs[5]
+#define ARM_r4         uregs[4]
+#define ARM_r3         uregs[3]
+#define ARM_r2         uregs[2]
+#define ARM_r1         uregs[1]
+#define ARM_r0         uregs[0]
+#define ARM_ORIG_r0    uregs[17]
+
+/*
+ * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
+ * and core dumps.
+ */
+#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
+
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* _UAPI__ASM_ARM_PTRACE_H */
diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..979ff40
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ *  linux/include/asm/setup.h
+ *
+ *  Copyright (C) 1997-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Structure passed to kernel to tell it about the
+ *  hardware it's running on.  See Documentation/arm/Setup
+ *  for more info.
+ */
+#ifndef _UAPI__ASMARM_SETUP_H
+#define _UAPI__ASMARM_SETUP_H
+
+#include <linux/types.h>
+
+#define COMMAND_LINE_SIZE 1024
+
+/* The list ends with an ATAG_NONE node. */
+#define ATAG_NONE      0x00000000
+
+struct tag_header {
+       __u32 size;
+       __u32 tag;
+};
+
+/* The list must start with an ATAG_CORE node */
+#define ATAG_CORE      0x54410001
+
+struct tag_core {
+       __u32 flags;            /* bit 0 = read-only */
+       __u32 pagesize;
+       __u32 rootdev;
+};
+
+/* it is allowed to have multiple ATAG_MEM nodes */
+#define ATAG_MEM       0x54410002
+
+struct tag_mem32 {
+       __u32   size;
+       __u32   start;  /* physical start address */
+};
+
+/* VGA text type displays */
+#define ATAG_VIDEOTEXT 0x54410003
+
+struct tag_videotext {
+       __u8            x;
+       __u8            y;
+       __u16           video_page;
+       __u8            video_mode;
+       __u8            video_cols;
+       __u16           video_ega_bx;
+       __u8            video_lines;
+       __u8            video_isvga;
+       __u16           video_points;
+};
+
+/* describes how the ramdisk will be used in kernel */
+#define ATAG_RAMDISK   0x54410004
+
+struct tag_ramdisk {
+       __u32 flags;    /* bit 0 = load, bit 1 = prompt */
+       __u32 size;     /* decompressed ramdisk size in _kilo_ bytes */
+       __u32 start;    /* starting block of floppy-based RAM disk image */
+};
+
+/* describes where the compressed ramdisk image lives (virtual address) */
+/*
+ * this one accidentally used virtual addresses - as such,
+ * it's deprecated.
+ */
+#define ATAG_INITRD    0x54410005
+
+/* describes where the compressed ramdisk image lives (physical address) */
+#define ATAG_INITRD2   0x54420005
+
+struct tag_initrd {
+       __u32 start;    /* physical start address */
+       __u32 size;     /* size of compressed ramdisk image in bytes */
+};
+
+/* board serial number. "64 bits should be enough for everybody" */
+#define ATAG_SERIAL    0x54410006
+
+struct tag_serialnr {
+       __u32 low;
+       __u32 high;
+};
+
+/* board revision */
+#define ATAG_REVISION  0x54410007
+
+struct tag_revision {
+       __u32 rev;
+};
+
+/* initial values for vesafb-type framebuffers. see struct screen_info
+ * in include/linux/tty.h
+ */
+#define ATAG_VIDEOLFB  0x54410008
+
+struct tag_videolfb {
+       __u16           lfb_width;
+       __u16           lfb_height;
+       __u16           lfb_depth;
+       __u16           lfb_linelength;
+       __u32           lfb_base;
+       __u32           lfb_size;
+       __u8            red_size;
+       __u8            red_pos;
+       __u8            green_size;
+       __u8            green_pos;
+       __u8            blue_size;
+       __u8            blue_pos;
+       __u8            rsvd_size;
+       __u8            rsvd_pos;
+};
+
+/* command line: \0 terminated string */
+#define ATAG_CMDLINE   0x54410009
+
+struct tag_cmdline {
+       char    cmdline[1];     /* this is the minimum size */
+};
+
+/* acorn RiscPC specific information */
+#define ATAG_ACORN     0x41000101
+
+struct tag_acorn {
+       __u32 memc_control_reg;
+       __u32 vram_pages;
+       __u8 sounddefault;
+       __u8 adfsdrives;
+};
+
+/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
+#define ATAG_MEMCLK    0x41000402
+
+struct tag_memclk {
+       __u32 fmemclk;
+};
+
+struct tag {
+       struct tag_header hdr;
+       union {
+               struct tag_core         core;
+               struct tag_mem32        mem;
+               struct tag_videotext    videotext;
+               struct tag_ramdisk      ramdisk;
+               struct tag_initrd       initrd;
+               struct tag_serialnr     serialnr;
+               struct tag_revision     revision;
+               struct tag_videolfb     videolfb;
+               struct tag_cmdline      cmdline;
+
+               /*
+                * Acorn specific
+                */
+               struct tag_acorn        acorn;
+
+               /*
+                * DC21285 specific
+                */
+               struct tag_memclk       memclk;
+       } u;
+};
+
+struct tagtable {
+       __u32 tag;
+       int (*parse)(const struct tag *);
+};
+
+#define tag_member_present(tag,member)                         \
+       ((unsigned long)(&((struct tag *)0L)->member + 1)       \
+               <= (tag)->hdr.size * 4)
+
+#define tag_next(t)    ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
+#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
+
+#define for_each_tag(t,base)           \
+       for (t = base; t->hdr.size; t = tag_next(t))
+
+
+#endif /* _UAPI__ASMARM_SETUP_H */
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..921c57f
--- /dev/null
@@ -0,0 +1,127 @@
+#ifndef _UAPI_ASMARM_SIGNAL_H
+#define _UAPI_ASMARM_SIGNAL_H
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+
+#ifndef __KERNEL__
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+#define NSIG           32
+typedef unsigned long sigset_t;
+
+#endif /* __KERNEL__ */
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGBUS          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGUSR1                10
+#define SIGSEGV                11
+#define SIGUSR2                12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGSTKFLT      16
+#define SIGCHLD                17
+#define SIGCONT                18
+#define SIGSTOP                19
+#define SIGTSTP                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGURG         23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGIO          29
+#define SIGPOLL                SIGIO
+/*
+#define SIGLOST                29
+*/
+#define SIGPWR         30
+#define SIGSYS         31
+#define        SIGUNUSED       31
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       32
+#define SIGRTMAX       _NSIG
+
+#define SIGSWI         32
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_NOCLDSTOP                flag to turn off SIGCHLD when children stop.
+ * SA_NOCLDWAIT                flag on SIGCHLD to inhibit zombies.
+ * SA_SIGINFO          deliver the signal with SIGINFO structs
+ * SA_THIRTYTWO                delivers the signal in 32-bit mode, even if the task 
+ *                     is running in 26-bit.
+ * SA_ONSTACK          allows alternate signal stacks (see sigaltstack(2)).
+ * SA_RESTART          flag to get restarting signals (which were the default long ago)
+ * SA_NODEFER          prevents the current signal from being masked in the handler.
+ * SA_RESETHAND                clears the handler when the signal is delivered.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_NOCLDSTOP   0x00000001
+#define SA_NOCLDWAIT   0x00000002
+#define SA_SIGINFO     0x00000004
+#define SA_THIRTYTWO   0x02000000
+#define SA_RESTORER    0x04000000
+#define SA_ONSTACK     0x08000000
+#define SA_RESTART     0x10000000
+#define SA_NODEFER     0x40000000
+#define SA_RESETHAND   0x80000000
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+
+/* 
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+#include <asm-generic/signal-defs.h>
+
+#ifndef __KERNEL__
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+struct sigaction {
+       union {
+         __sighandler_t _sa_handler;
+         void (*_sa_sigaction)(int, struct siginfo *, void *);
+       } _u;
+       sigset_t sa_mask;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+#define sa_handler     _u._sa_handler
+#define sa_sigaction   _u._sa_sigaction
+
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+       void __user *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+
+#endif /* _UAPI_ASMARM_SIGNAL_H */
diff --git a/arch/arm/include/uapi/asm/swab.h b/arch/arm/include/uapi/asm/swab.h
new file mode 100644 (file)
index 0000000..6fcb32a
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *  arch/arm/include/asm/byteorder.h
+ *
+ * ARM Endian-ness.  In little endian mode, the data bus is connected such
+ * that byte accesses appear as:
+ *  0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ *
+ * When in big endian mode, byte accesses appear as:
+ *  0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ */
+#ifndef _UAPI__ASM_ARM_SWAB_H
+#define _UAPI__ASM_ARM_SWAB_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#  define __SWAB_64_THRU_32__
+#endif
+
+
+#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
+static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
+{
+       __u32 t;
+
+#ifndef __thumb__
+       if (!__builtin_constant_p(x)) {
+               /*
+                * The compiler needs a bit of a hint here to always do the
+                * right thing and not screw it up to different degrees
+                * depending on the gcc version.
+                */
+               asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
+       } else
+#endif
+               t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
+
+       x = (x << 24) | (x >> 8);               /* mov r0,r0,ror #8      */
+       t &= ~0x00FF0000;                       /* bic r1,r1,#0x00FF0000 */
+       x ^= (t >> 8);                          /* eor r0,r0,r1,lsr #8   */
+
+       return x;
+}
+#define __arch_swab32 __arch_swab32
+
+#endif
+
+#endif /* _UAPI__ASM_ARM_SWAB_H */
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..ac03bdb
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ *  arch/arm/include/asm/unistd.h
+ *
+ *  Copyright (C) 2001-2005 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
+ * no matter what the change is.  Thanks!
+ */
+#ifndef _UAPI__ASM_ARM_UNISTD_H
+#define _UAPI__ASM_ARM_UNISTD_H
+
+#define __NR_OABI_SYSCALL_BASE 0x900000
+
+#if defined(__thumb__) || defined(__ARM_EABI__)
+#define __NR_SYSCALL_BASE      0
+#else
+#define __NR_SYSCALL_BASE      __NR_OABI_SYSCALL_BASE
+#endif
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_restart_syscall           (__NR_SYSCALL_BASE+  0)
+#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
+#define __NR_fork                      (__NR_SYSCALL_BASE+  2)
+#define __NR_read                      (__NR_SYSCALL_BASE+  3)
+#define __NR_write                     (__NR_SYSCALL_BASE+  4)
+#define __NR_open                      (__NR_SYSCALL_BASE+  5)
+#define __NR_close                     (__NR_SYSCALL_BASE+  6)
+                                       /* 7 was sys_waitpid */
+#define __NR_creat                     (__NR_SYSCALL_BASE+  8)
+#define __NR_link                      (__NR_SYSCALL_BASE+  9)
+#define __NR_unlink                    (__NR_SYSCALL_BASE+ 10)
+#define __NR_execve                    (__NR_SYSCALL_BASE+ 11)
+#define __NR_chdir                     (__NR_SYSCALL_BASE+ 12)
+#define __NR_time                      (__NR_SYSCALL_BASE+ 13)
+#define __NR_mknod                     (__NR_SYSCALL_BASE+ 14)
+#define __NR_chmod                     (__NR_SYSCALL_BASE+ 15)
+#define __NR_lchown                    (__NR_SYSCALL_BASE+ 16)
+                                       /* 17 was sys_break */
+                                       /* 18 was sys_stat */
+#define __NR_lseek                     (__NR_SYSCALL_BASE+ 19)
+#define __NR_getpid                    (__NR_SYSCALL_BASE+ 20)
+#define __NR_mount                     (__NR_SYSCALL_BASE+ 21)
+#define __NR_umount                    (__NR_SYSCALL_BASE+ 22)
+#define __NR_setuid                    (__NR_SYSCALL_BASE+ 23)
+#define __NR_getuid                    (__NR_SYSCALL_BASE+ 24)
+#define __NR_stime                     (__NR_SYSCALL_BASE+ 25)
+#define __NR_ptrace                    (__NR_SYSCALL_BASE+ 26)
+#define __NR_alarm                     (__NR_SYSCALL_BASE+ 27)
+                                       /* 28 was sys_fstat */
+#define __NR_pause                     (__NR_SYSCALL_BASE+ 29)
+#define __NR_utime                     (__NR_SYSCALL_BASE+ 30)
+                                       /* 31 was sys_stty */
+                                       /* 32 was sys_gtty */
+#define __NR_access                    (__NR_SYSCALL_BASE+ 33)
+#define __NR_nice                      (__NR_SYSCALL_BASE+ 34)
+                                       /* 35 was sys_ftime */
+#define __NR_sync                      (__NR_SYSCALL_BASE+ 36)
+#define __NR_kill                      (__NR_SYSCALL_BASE+ 37)
+#define __NR_rename                    (__NR_SYSCALL_BASE+ 38)
+#define __NR_mkdir                     (__NR_SYSCALL_BASE+ 39)
+#define __NR_rmdir                     (__NR_SYSCALL_BASE+ 40)
+#define __NR_dup                       (__NR_SYSCALL_BASE+ 41)
+#define __NR_pipe                      (__NR_SYSCALL_BASE+ 42)
+#define __NR_times                     (__NR_SYSCALL_BASE+ 43)
+                                       /* 44 was sys_prof */
+#define __NR_brk                       (__NR_SYSCALL_BASE+ 45)
+#define __NR_setgid                    (__NR_SYSCALL_BASE+ 46)
+#define __NR_getgid                    (__NR_SYSCALL_BASE+ 47)
+                                       /* 48 was sys_signal */
+#define __NR_geteuid                   (__NR_SYSCALL_BASE+ 49)
+#define __NR_getegid                   (__NR_SYSCALL_BASE+ 50)
+#define __NR_acct                      (__NR_SYSCALL_BASE+ 51)
+#define __NR_umount2                   (__NR_SYSCALL_BASE+ 52)
+                                       /* 53 was sys_lock */
+#define __NR_ioctl                     (__NR_SYSCALL_BASE+ 54)
+#define __NR_fcntl                     (__NR_SYSCALL_BASE+ 55)
+                                       /* 56 was sys_mpx */
+#define __NR_setpgid                   (__NR_SYSCALL_BASE+ 57)
+                                       /* 58 was sys_ulimit */
+                                       /* 59 was sys_olduname */
+#define __NR_umask                     (__NR_SYSCALL_BASE+ 60)
+#define __NR_chroot                    (__NR_SYSCALL_BASE+ 61)
+#define __NR_ustat                     (__NR_SYSCALL_BASE+ 62)
+#define __NR_dup2                      (__NR_SYSCALL_BASE+ 63)
+#define __NR_getppid                   (__NR_SYSCALL_BASE+ 64)
+#define __NR_getpgrp                   (__NR_SYSCALL_BASE+ 65)
+#define __NR_setsid                    (__NR_SYSCALL_BASE+ 66)
+#define __NR_sigaction                 (__NR_SYSCALL_BASE+ 67)
+                                       /* 68 was sys_sgetmask */
+                                       /* 69 was sys_ssetmask */
+#define __NR_setreuid                  (__NR_SYSCALL_BASE+ 70)
+#define __NR_setregid                  (__NR_SYSCALL_BASE+ 71)
+#define __NR_sigsuspend                        (__NR_SYSCALL_BASE+ 72)
+#define __NR_sigpending                        (__NR_SYSCALL_BASE+ 73)
+#define __NR_sethostname               (__NR_SYSCALL_BASE+ 74)
+#define __NR_setrlimit                 (__NR_SYSCALL_BASE+ 75)
+#define __NR_getrlimit                 (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
+#define __NR_getrusage                 (__NR_SYSCALL_BASE+ 77)
+#define __NR_gettimeofday              (__NR_SYSCALL_BASE+ 78)
+#define __NR_settimeofday              (__NR_SYSCALL_BASE+ 79)
+#define __NR_getgroups                 (__NR_SYSCALL_BASE+ 80)
+#define __NR_setgroups                 (__NR_SYSCALL_BASE+ 81)
+#define __NR_select                    (__NR_SYSCALL_BASE+ 82)
+#define __NR_symlink                   (__NR_SYSCALL_BASE+ 83)
+                                       /* 84 was sys_lstat */
+#define __NR_readlink                  (__NR_SYSCALL_BASE+ 85)
+#define __NR_uselib                    (__NR_SYSCALL_BASE+ 86)
+#define __NR_swapon                    (__NR_SYSCALL_BASE+ 87)
+#define __NR_reboot                    (__NR_SYSCALL_BASE+ 88)
+#define __NR_readdir                   (__NR_SYSCALL_BASE+ 89)
+#define __NR_mmap                      (__NR_SYSCALL_BASE+ 90)
+#define __NR_munmap                    (__NR_SYSCALL_BASE+ 91)
+#define __NR_truncate                  (__NR_SYSCALL_BASE+ 92)
+#define __NR_ftruncate                 (__NR_SYSCALL_BASE+ 93)
+#define __NR_fchmod                    (__NR_SYSCALL_BASE+ 94)
+#define __NR_fchown                    (__NR_SYSCALL_BASE+ 95)
+#define __NR_getpriority               (__NR_SYSCALL_BASE+ 96)
+#define __NR_setpriority               (__NR_SYSCALL_BASE+ 97)
+                                       /* 98 was sys_profil */
+#define __NR_statfs                    (__NR_SYSCALL_BASE+ 99)
+#define __NR_fstatfs                   (__NR_SYSCALL_BASE+100)
+                                       /* 101 was sys_ioperm */
+#define __NR_socketcall                        (__NR_SYSCALL_BASE+102)
+#define __NR_syslog                    (__NR_SYSCALL_BASE+103)
+#define __NR_setitimer                 (__NR_SYSCALL_BASE+104)
+#define __NR_getitimer                 (__NR_SYSCALL_BASE+105)
+#define __NR_stat                      (__NR_SYSCALL_BASE+106)
+#define __NR_lstat                     (__NR_SYSCALL_BASE+107)
+#define __NR_fstat                     (__NR_SYSCALL_BASE+108)
+                                       /* 109 was sys_uname */
+                                       /* 110 was sys_iopl */
+#define __NR_vhangup                   (__NR_SYSCALL_BASE+111)
+                                       /* 112 was sys_idle */
+#define __NR_syscall                   (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
+#define __NR_wait4                     (__NR_SYSCALL_BASE+114)
+#define __NR_swapoff                   (__NR_SYSCALL_BASE+115)
+#define __NR_sysinfo                   (__NR_SYSCALL_BASE+116)
+#define __NR_ipc                       (__NR_SYSCALL_BASE+117)
+#define __NR_fsync                     (__NR_SYSCALL_BASE+118)
+#define __NR_sigreturn                 (__NR_SYSCALL_BASE+119)
+#define __NR_clone                     (__NR_SYSCALL_BASE+120)
+#define __NR_setdomainname             (__NR_SYSCALL_BASE+121)
+#define __NR_uname                     (__NR_SYSCALL_BASE+122)
+                                       /* 123 was sys_modify_ldt */
+#define __NR_adjtimex                  (__NR_SYSCALL_BASE+124)
+#define __NR_mprotect                  (__NR_SYSCALL_BASE+125)
+#define __NR_sigprocmask               (__NR_SYSCALL_BASE+126)
+                                       /* 127 was sys_create_module */
+#define __NR_init_module               (__NR_SYSCALL_BASE+128)
+#define __NR_delete_module             (__NR_SYSCALL_BASE+129)
+                                       /* 130 was sys_get_kernel_syms */
+#define __NR_quotactl                  (__NR_SYSCALL_BASE+131)
+#define __NR_getpgid                   (__NR_SYSCALL_BASE+132)
+#define __NR_fchdir                    (__NR_SYSCALL_BASE+133)
+#define __NR_bdflush                   (__NR_SYSCALL_BASE+134)
+#define __NR_sysfs                     (__NR_SYSCALL_BASE+135)
+#define __NR_personality               (__NR_SYSCALL_BASE+136)
+                                       /* 137 was sys_afs_syscall */
+#define __NR_setfsuid                  (__NR_SYSCALL_BASE+138)
+#define __NR_setfsgid                  (__NR_SYSCALL_BASE+139)
+#define __NR__llseek                   (__NR_SYSCALL_BASE+140)
+#define __NR_getdents                  (__NR_SYSCALL_BASE+141)
+#define __NR__newselect                        (__NR_SYSCALL_BASE+142)
+#define __NR_flock                     (__NR_SYSCALL_BASE+143)
+#define __NR_msync                     (__NR_SYSCALL_BASE+144)
+#define __NR_readv                     (__NR_SYSCALL_BASE+145)
+#define __NR_writev                    (__NR_SYSCALL_BASE+146)
+#define __NR_getsid                    (__NR_SYSCALL_BASE+147)
+#define __NR_fdatasync                 (__NR_SYSCALL_BASE+148)
+#define __NR__sysctl                   (__NR_SYSCALL_BASE+149)
+#define __NR_mlock                     (__NR_SYSCALL_BASE+150)
+#define __NR_munlock                   (__NR_SYSCALL_BASE+151)
+#define __NR_mlockall                  (__NR_SYSCALL_BASE+152)
+#define __NR_munlockall                        (__NR_SYSCALL_BASE+153)
+#define __NR_sched_setparam            (__NR_SYSCALL_BASE+154)
+#define __NR_sched_getparam            (__NR_SYSCALL_BASE+155)
+#define __NR_sched_setscheduler                (__NR_SYSCALL_BASE+156)
+#define __NR_sched_getscheduler                (__NR_SYSCALL_BASE+157)
+#define __NR_sched_yield               (__NR_SYSCALL_BASE+158)
+#define __NR_sched_get_priority_max    (__NR_SYSCALL_BASE+159)
+#define __NR_sched_get_priority_min    (__NR_SYSCALL_BASE+160)
+#define __NR_sched_rr_get_interval     (__NR_SYSCALL_BASE+161)
+#define __NR_nanosleep                 (__NR_SYSCALL_BASE+162)
+#define __NR_mremap                    (__NR_SYSCALL_BASE+163)
+#define __NR_setresuid                 (__NR_SYSCALL_BASE+164)
+#define __NR_getresuid                 (__NR_SYSCALL_BASE+165)
+                                       /* 166 was sys_vm86 */
+                                       /* 167 was sys_query_module */
+#define __NR_poll                      (__NR_SYSCALL_BASE+168)
+#define __NR_nfsservctl                        (__NR_SYSCALL_BASE+169)
+#define __NR_setresgid                 (__NR_SYSCALL_BASE+170)
+#define __NR_getresgid                 (__NR_SYSCALL_BASE+171)
+#define __NR_prctl                     (__NR_SYSCALL_BASE+172)
+#define __NR_rt_sigreturn              (__NR_SYSCALL_BASE+173)
+#define __NR_rt_sigaction              (__NR_SYSCALL_BASE+174)
+#define __NR_rt_sigprocmask            (__NR_SYSCALL_BASE+175)
+#define __NR_rt_sigpending             (__NR_SYSCALL_BASE+176)
+#define __NR_rt_sigtimedwait           (__NR_SYSCALL_BASE+177)
+#define __NR_rt_sigqueueinfo           (__NR_SYSCALL_BASE+178)
+#define __NR_rt_sigsuspend             (__NR_SYSCALL_BASE+179)
+#define __NR_pread64                   (__NR_SYSCALL_BASE+180)
+#define __NR_pwrite64                  (__NR_SYSCALL_BASE+181)
+#define __NR_chown                     (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd                    (__NR_SYSCALL_BASE+183)
+#define __NR_capget                    (__NR_SYSCALL_BASE+184)
+#define __NR_capset                    (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack               (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile                  (__NR_SYSCALL_BASE+187)
+                                       /* 188 reserved */
+                                       /* 189 reserved */
+#define __NR_vfork                     (__NR_SYSCALL_BASE+190)
+#define __NR_ugetrlimit                        (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
+#define __NR_mmap2                     (__NR_SYSCALL_BASE+192)
+#define __NR_truncate64                        (__NR_SYSCALL_BASE+193)
+#define __NR_ftruncate64               (__NR_SYSCALL_BASE+194)
+#define __NR_stat64                    (__NR_SYSCALL_BASE+195)
+#define __NR_lstat64                   (__NR_SYSCALL_BASE+196)
+#define __NR_fstat64                   (__NR_SYSCALL_BASE+197)
+#define __NR_lchown32                  (__NR_SYSCALL_BASE+198)
+#define __NR_getuid32                  (__NR_SYSCALL_BASE+199)
+#define __NR_getgid32                  (__NR_SYSCALL_BASE+200)
+#define __NR_geteuid32                 (__NR_SYSCALL_BASE+201)
+#define __NR_getegid32                 (__NR_SYSCALL_BASE+202)
+#define __NR_setreuid32                        (__NR_SYSCALL_BASE+203)
+#define __NR_setregid32                        (__NR_SYSCALL_BASE+204)
+#define __NR_getgroups32               (__NR_SYSCALL_BASE+205)
+#define __NR_setgroups32               (__NR_SYSCALL_BASE+206)
+#define __NR_fchown32                  (__NR_SYSCALL_BASE+207)
+#define __NR_setresuid32               (__NR_SYSCALL_BASE+208)
+#define __NR_getresuid32               (__NR_SYSCALL_BASE+209)
+#define __NR_setresgid32               (__NR_SYSCALL_BASE+210)
+#define __NR_getresgid32               (__NR_SYSCALL_BASE+211)
+#define __NR_chown32                   (__NR_SYSCALL_BASE+212)
+#define __NR_setuid32                  (__NR_SYSCALL_BASE+213)
+#define __NR_setgid32                  (__NR_SYSCALL_BASE+214)
+#define __NR_setfsuid32                        (__NR_SYSCALL_BASE+215)
+#define __NR_setfsgid32                        (__NR_SYSCALL_BASE+216)
+#define __NR_getdents64                        (__NR_SYSCALL_BASE+217)
+#define __NR_pivot_root                        (__NR_SYSCALL_BASE+218)
+#define __NR_mincore                   (__NR_SYSCALL_BASE+219)
+#define __NR_madvise                   (__NR_SYSCALL_BASE+220)
+#define __NR_fcntl64                   (__NR_SYSCALL_BASE+221)
+                                       /* 222 for tux */
+                                       /* 223 is unused */
+#define __NR_gettid                    (__NR_SYSCALL_BASE+224)
+#define __NR_readahead                 (__NR_SYSCALL_BASE+225)
+#define __NR_setxattr                  (__NR_SYSCALL_BASE+226)
+#define __NR_lsetxattr                 (__NR_SYSCALL_BASE+227)
+#define __NR_fsetxattr                 (__NR_SYSCALL_BASE+228)
+#define __NR_getxattr                  (__NR_SYSCALL_BASE+229)
+#define __NR_lgetxattr                 (__NR_SYSCALL_BASE+230)
+#define __NR_fgetxattr                 (__NR_SYSCALL_BASE+231)
+#define __NR_listxattr                 (__NR_SYSCALL_BASE+232)
+#define __NR_llistxattr                        (__NR_SYSCALL_BASE+233)
+#define __NR_flistxattr                        (__NR_SYSCALL_BASE+234)
+#define __NR_removexattr               (__NR_SYSCALL_BASE+235)
+#define __NR_lremovexattr              (__NR_SYSCALL_BASE+236)
+#define __NR_fremovexattr              (__NR_SYSCALL_BASE+237)
+#define __NR_tkill                     (__NR_SYSCALL_BASE+238)
+#define __NR_sendfile64                        (__NR_SYSCALL_BASE+239)
+#define __NR_futex                     (__NR_SYSCALL_BASE+240)
+#define __NR_sched_setaffinity         (__NR_SYSCALL_BASE+241)
+#define __NR_sched_getaffinity         (__NR_SYSCALL_BASE+242)
+#define __NR_io_setup                  (__NR_SYSCALL_BASE+243)
+#define __NR_io_destroy                        (__NR_SYSCALL_BASE+244)
+#define __NR_io_getevents              (__NR_SYSCALL_BASE+245)
+#define __NR_io_submit                 (__NR_SYSCALL_BASE+246)
+#define __NR_io_cancel                 (__NR_SYSCALL_BASE+247)
+#define __NR_exit_group                        (__NR_SYSCALL_BASE+248)
+#define __NR_lookup_dcookie            (__NR_SYSCALL_BASE+249)
+#define __NR_epoll_create              (__NR_SYSCALL_BASE+250)
+#define __NR_epoll_ctl                 (__NR_SYSCALL_BASE+251)
+#define __NR_epoll_wait                        (__NR_SYSCALL_BASE+252)
+#define __NR_remap_file_pages          (__NR_SYSCALL_BASE+253)
+                                       /* 254 for set_thread_area */
+                                       /* 255 for get_thread_area */
+#define __NR_set_tid_address           (__NR_SYSCALL_BASE+256)
+#define __NR_timer_create              (__NR_SYSCALL_BASE+257)
+#define __NR_timer_settime             (__NR_SYSCALL_BASE+258)
+#define __NR_timer_gettime             (__NR_SYSCALL_BASE+259)
+#define __NR_timer_getoverrun          (__NR_SYSCALL_BASE+260)
+#define __NR_timer_delete              (__NR_SYSCALL_BASE+261)
+#define __NR_clock_settime             (__NR_SYSCALL_BASE+262)
+#define __NR_clock_gettime             (__NR_SYSCALL_BASE+263)
+#define __NR_clock_getres              (__NR_SYSCALL_BASE+264)
+#define __NR_clock_nanosleep           (__NR_SYSCALL_BASE+265)
+#define __NR_statfs64                  (__NR_SYSCALL_BASE+266)
+#define __NR_fstatfs64                 (__NR_SYSCALL_BASE+267)
+#define __NR_tgkill                    (__NR_SYSCALL_BASE+268)
+#define __NR_utimes                    (__NR_SYSCALL_BASE+269)
+#define __NR_arm_fadvise64_64          (__NR_SYSCALL_BASE+270)
+#define __NR_pciconfig_iobase          (__NR_SYSCALL_BASE+271)
+#define __NR_pciconfig_read            (__NR_SYSCALL_BASE+272)
+#define __NR_pciconfig_write           (__NR_SYSCALL_BASE+273)
+#define __NR_mq_open                   (__NR_SYSCALL_BASE+274)
+#define __NR_mq_unlink                 (__NR_SYSCALL_BASE+275)
+#define __NR_mq_timedsend              (__NR_SYSCALL_BASE+276)
+#define __NR_mq_timedreceive           (__NR_SYSCALL_BASE+277)
+#define __NR_mq_notify                 (__NR_SYSCALL_BASE+278)
+#define __NR_mq_getsetattr             (__NR_SYSCALL_BASE+279)
+#define __NR_waitid                    (__NR_SYSCALL_BASE+280)
+#define __NR_socket                    (__NR_SYSCALL_BASE+281)
+#define __NR_bind                      (__NR_SYSCALL_BASE+282)
+#define __NR_connect                   (__NR_SYSCALL_BASE+283)
+#define __NR_listen                    (__NR_SYSCALL_BASE+284)
+#define __NR_accept                    (__NR_SYSCALL_BASE+285)
+#define __NR_getsockname               (__NR_SYSCALL_BASE+286)
+#define __NR_getpeername               (__NR_SYSCALL_BASE+287)
+#define __NR_socketpair                        (__NR_SYSCALL_BASE+288)
+#define __NR_send                      (__NR_SYSCALL_BASE+289)
+#define __NR_sendto                    (__NR_SYSCALL_BASE+290)
+#define __NR_recv                      (__NR_SYSCALL_BASE+291)
+#define __NR_recvfrom                  (__NR_SYSCALL_BASE+292)
+#define __NR_shutdown                  (__NR_SYSCALL_BASE+293)
+#define __NR_setsockopt                        (__NR_SYSCALL_BASE+294)
+#define __NR_getsockopt                        (__NR_SYSCALL_BASE+295)
+#define __NR_sendmsg                   (__NR_SYSCALL_BASE+296)
+#define __NR_recvmsg                   (__NR_SYSCALL_BASE+297)
+#define __NR_semop                     (__NR_SYSCALL_BASE+298)
+#define __NR_semget                    (__NR_SYSCALL_BASE+299)
+#define __NR_semctl                    (__NR_SYSCALL_BASE+300)
+#define __NR_msgsnd                    (__NR_SYSCALL_BASE+301)
+#define __NR_msgrcv                    (__NR_SYSCALL_BASE+302)
+#define __NR_msgget                    (__NR_SYSCALL_BASE+303)
+#define __NR_msgctl                    (__NR_SYSCALL_BASE+304)
+#define __NR_shmat                     (__NR_SYSCALL_BASE+305)
+#define __NR_shmdt                     (__NR_SYSCALL_BASE+306)
+#define __NR_shmget                    (__NR_SYSCALL_BASE+307)
+#define __NR_shmctl                    (__NR_SYSCALL_BASE+308)
+#define __NR_add_key                   (__NR_SYSCALL_BASE+309)
+#define __NR_request_key               (__NR_SYSCALL_BASE+310)
+#define __NR_keyctl                    (__NR_SYSCALL_BASE+311)
+#define __NR_semtimedop                        (__NR_SYSCALL_BASE+312)
+#define __NR_vserver                   (__NR_SYSCALL_BASE+313)
+#define __NR_ioprio_set                        (__NR_SYSCALL_BASE+314)
+#define __NR_ioprio_get                        (__NR_SYSCALL_BASE+315)
+#define __NR_inotify_init              (__NR_SYSCALL_BASE+316)
+#define __NR_inotify_add_watch         (__NR_SYSCALL_BASE+317)
+#define __NR_inotify_rm_watch          (__NR_SYSCALL_BASE+318)
+#define __NR_mbind                     (__NR_SYSCALL_BASE+319)
+#define __NR_get_mempolicy             (__NR_SYSCALL_BASE+320)
+#define __NR_set_mempolicy             (__NR_SYSCALL_BASE+321)
+#define __NR_openat                    (__NR_SYSCALL_BASE+322)
+#define __NR_mkdirat                   (__NR_SYSCALL_BASE+323)
+#define __NR_mknodat                   (__NR_SYSCALL_BASE+324)
+#define __NR_fchownat                  (__NR_SYSCALL_BASE+325)
+#define __NR_futimesat                 (__NR_SYSCALL_BASE+326)
+#define __NR_fstatat64                 (__NR_SYSCALL_BASE+327)
+#define __NR_unlinkat                  (__NR_SYSCALL_BASE+328)
+#define __NR_renameat                  (__NR_SYSCALL_BASE+329)
+#define __NR_linkat                    (__NR_SYSCALL_BASE+330)
+#define __NR_symlinkat                 (__NR_SYSCALL_BASE+331)
+#define __NR_readlinkat                        (__NR_SYSCALL_BASE+332)
+#define __NR_fchmodat                  (__NR_SYSCALL_BASE+333)
+#define __NR_faccessat                 (__NR_SYSCALL_BASE+334)
+#define __NR_pselect6                  (__NR_SYSCALL_BASE+335)
+#define __NR_ppoll                     (__NR_SYSCALL_BASE+336)
+#define __NR_unshare                   (__NR_SYSCALL_BASE+337)
+#define __NR_set_robust_list           (__NR_SYSCALL_BASE+338)
+#define __NR_get_robust_list           (__NR_SYSCALL_BASE+339)
+#define __NR_splice                    (__NR_SYSCALL_BASE+340)
+#define __NR_arm_sync_file_range       (__NR_SYSCALL_BASE+341)
+#define __NR_sync_file_range2          __NR_arm_sync_file_range
+#define __NR_tee                       (__NR_SYSCALL_BASE+342)
+#define __NR_vmsplice                  (__NR_SYSCALL_BASE+343)
+#define __NR_move_pages                        (__NR_SYSCALL_BASE+344)
+#define __NR_getcpu                    (__NR_SYSCALL_BASE+345)
+#define __NR_epoll_pwait               (__NR_SYSCALL_BASE+346)
+#define __NR_kexec_load                        (__NR_SYSCALL_BASE+347)
+#define __NR_utimensat                 (__NR_SYSCALL_BASE+348)
+#define __NR_signalfd                  (__NR_SYSCALL_BASE+349)
+#define __NR_timerfd_create            (__NR_SYSCALL_BASE+350)
+#define __NR_eventfd                   (__NR_SYSCALL_BASE+351)
+#define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
+#define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
+#define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
+#define __NR_signalfd4                 (__NR_SYSCALL_BASE+355)
+#define __NR_eventfd2                  (__NR_SYSCALL_BASE+356)
+#define __NR_epoll_create1             (__NR_SYSCALL_BASE+357)
+#define __NR_dup3                      (__NR_SYSCALL_BASE+358)
+#define __NR_pipe2                     (__NR_SYSCALL_BASE+359)
+#define __NR_inotify_init1             (__NR_SYSCALL_BASE+360)
+#define __NR_preadv                    (__NR_SYSCALL_BASE+361)
+#define __NR_pwritev                   (__NR_SYSCALL_BASE+362)
+#define __NR_rt_tgsigqueueinfo         (__NR_SYSCALL_BASE+363)
+#define __NR_perf_event_open           (__NR_SYSCALL_BASE+364)
+#define __NR_recvmmsg                  (__NR_SYSCALL_BASE+365)
+#define __NR_accept4                   (__NR_SYSCALL_BASE+366)
+#define __NR_fanotify_init             (__NR_SYSCALL_BASE+367)
+#define __NR_fanotify_mark             (__NR_SYSCALL_BASE+368)
+#define __NR_prlimit64                 (__NR_SYSCALL_BASE+369)
+#define __NR_name_to_handle_at         (__NR_SYSCALL_BASE+370)
+#define __NR_open_by_handle_at         (__NR_SYSCALL_BASE+371)
+#define __NR_clock_adjtime             (__NR_SYSCALL_BASE+372)
+#define __NR_syncfs                    (__NR_SYSCALL_BASE+373)
+#define __NR_sendmmsg                  (__NR_SYSCALL_BASE+374)
+#define __NR_setns                     (__NR_SYSCALL_BASE+375)
+#define __NR_process_vm_readv          (__NR_SYSCALL_BASE+376)
+#define __NR_process_vm_writev         (__NR_SYSCALL_BASE+377)
+                                       /* 378 for kcmp */
+
+/*
+ * This may need to be greater than __NR_last_syscall+1 in order to
+ * account for the padding in the syscall table
+ */
+
+/*
+ * The following SWIs are ARM private.
+ */
+#define __ARM_NR_BASE                  (__NR_SYSCALL_BASE+0x0f0000)
+#define __ARM_NR_breakpoint            (__ARM_NR_BASE+1)
+#define __ARM_NR_cacheflush            (__ARM_NR_BASE+2)
+#define __ARM_NR_usr26                 (__ARM_NR_BASE+3)
+#define __ARM_NR_usr32                 (__ARM_NR_BASE+4)
+#define __ARM_NR_set_tls               (__ARM_NR_BASE+5)
+
+/*
+ * *NOTE*: This is a ghost syscall private to the kernel.  Only the
+ * __kuser_cmpxchg code in entry-armv.S should be aware of its
+ * existence.  Don't ever use this from user code.
+ */
+
+/*
+ * The following syscalls are obsolete and no longer available for EABI.
+ */
+#if !defined(__KERNEL__)
+#if defined(__ARM_EABI__)
+#undef __NR_time
+#undef __NR_umount
+#undef __NR_stime
+#undef __NR_alarm
+#undef __NR_utime
+#undef __NR_getrlimit
+#undef __NR_select
+#undef __NR_readdir
+#undef __NR_mmap
+#undef __NR_socketcall
+#undef __NR_syscall
+#undef __NR_ipc
+#endif
+#endif
+
+#endif /* _UAPI__ASM_ARM_UNISTD_H */
index c8050b14e615ef0df3adbee08598b7aaf30a60ff..b14207101938adb03c852a708a2261e4a58d6f3d 100644 (file)
@@ -19,8 +19,8 @@ config AT91_SAM9G45_RESET
 
 config SOC_AT91SAM9
        bool
-       select GENERIC_CLOCKEVENTS
        select CPU_ARM926T
+       select GENERIC_CLOCKEVENTS
 
 menu "Atmel AT91 System-on-Chip"
 
@@ -28,66 +28,66 @@ comment "Atmel AT91 Processor"
 
 config SOC_AT91SAM9
        bool
+       select AT91_SAM9_SMC
+       select AT91_SAM9_TIME
        select CPU_ARM926T
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
-       select AT91_SAM9_TIME
-       select AT91_SAM9_SMC
 
 config SOC_AT91RM9200
        bool "AT91RM9200"
        select CPU_ARM920T
-       select MULTI_IRQ_HANDLER
-       select SPARSE_IRQ
        select GENERIC_CLOCKEVENTS
        select HAVE_AT91_DBGU0
+       select MULTI_IRQ_HANDLER
+       select SPARSE_IRQ
 
 config SOC_AT91SAM9260
        bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU0
        select HAVE_NET_MACB
+       select SOC_AT91SAM9
        help
          Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
          or AT91SAM9G20 SoC.
 
 config SOC_AT91SAM9261
        bool "AT91SAM9261 or AT91SAM9G10"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU0
        select HAVE_FB_ATMEL
+       select SOC_AT91SAM9
        help
          Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
 
 config SOC_AT91SAM9263
        bool "AT91SAM9263"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU1
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select SOC_AT91SAM9
 
 config SOC_AT91SAM9RL
        bool "AT91SAM9RL"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU0
        select HAVE_FB_ATMEL
+       select SOC_AT91SAM9
 
 config SOC_AT91SAM9G45
        bool "AT91SAM9G45 or AT91SAM9M10 families"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU1
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select SOC_AT91SAM9
        help
          Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
          This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
 
 config SOC_AT91SAM9X5
        bool "AT91SAM9x5 family"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU0
        select HAVE_FB_ATMEL
        select HAVE_NET_MACB
+       select SOC_AT91SAM9
        help
          Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
          This means that your SAM9 name finishes with a '5' (except if it is
@@ -97,9 +97,9 @@ config SOC_AT91SAM9X5
 
 config SOC_AT91SAM9N12
        bool "AT91SAM9N12 family"
-       select SOC_AT91SAM9
        select HAVE_AT91_DBGU0
        select HAVE_FB_ATMEL
+       select SOC_AT91SAM9
        help
          Select this if you are using Atmel's AT91SAM9N12 SoC.
 
@@ -144,9 +144,9 @@ config ARCH_AT91SAM9G45
 config ARCH_AT91X40
        bool "AT91x40"
        depends on !MMU
+       select ARCH_USES_GETTIMEOFFSET
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
-       select ARCH_USES_GETTIMEOFFSET
 
 endchoice
 
index e6135363765a014fb4566b403f4619b3adaf4dee..263242da2cb8462ca8504146211dc218d5166e7f 100644 (file)
@@ -23,9 +23,9 @@ config ARCH_CLEP7312
 
 config ARCH_EDB7211
        bool "EDB7211"
-       select ISA
-       select ARCH_SPARSEMEM_ENABLE
        select ARCH_SELECT_MEMORY_MODEL
+       select ARCH_SPARSEMEM_ENABLE
+       select ISA
        help
          Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
          evaluation board.
index 026b4b277ae5d54e4d911f69c91c7bfee21ea68d..f8eecb9594132b73375cc9fbe578159755005405 100644 (file)
@@ -4,12 +4,12 @@ config AINTC
        bool
 
 config CP_INTC
-       select IRQ_DOMAIN
        bool
+       select IRQ_DOMAIN
 
 config ARCH_DAVINCI_DMx
-       select CPU_ARM926T
        bool
+       select CPU_ARM926T
 
 menu "TI DaVinci Implementations"
 
@@ -32,19 +32,19 @@ config ARCH_DAVINCI_DM646x
 
 config ARCH_DAVINCI_DA830
        bool "DA830/OMAP-L137/AM17x based system"
-       select CP_INTC
        select ARCH_DAVINCI_DA8XX
        select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1
+       select CP_INTC
 
 config ARCH_DAVINCI_DA850
        bool "DA850/OMAP-L138/AM18x based system"
-       select CP_INTC
        select ARCH_DAVINCI_DA8XX
        select ARCH_HAS_CPUFREQ
+       select CP_INTC
 
 config ARCH_DAVINCI_DA8XX
-       select CPU_ARM926T
        bool
+       select CPU_ARM926T
 
 config ARCH_DAVINCI_DM365
        bool "DaVinci 365 based system"
@@ -52,9 +52,9 @@ config ARCH_DAVINCI_DM365
        select ARCH_DAVINCI_DMx
 
 config ARCH_DAVINCI_TNETV107X
+       bool "TNETV107X based system"
        select CPU_V6
        select CP_INTC
-       bool "TNETV107X based system"
 
 comment "DaVinci Board Type"
 
@@ -103,9 +103,9 @@ config MACH_DAVINCI_DM6467_EVM
        bool "TI DM6467 EVM"
        default ARCH_DAVINCI_DM646x
        depends on ARCH_DAVINCI_DM646x
-       select MACH_DAVINCI_DM6467TEVM
        select EEPROM_AT24
        select I2C
+       select MACH_DAVINCI_DM6467TEVM
        help
          Configure this option to specify the whether the board used
          for development is a DM6467 EVM
@@ -127,8 +127,8 @@ config MACH_DAVINCI_DA830_EVM
        bool "TI DA830/OMAP-L137/AM17x Reference Platform"
        default ARCH_DAVINCI_DA830
        depends on ARCH_DAVINCI_DA830
-       select GPIO_PCF857X
        select EEPROM_AT24
+       select GPIO_PCF857X
        select I2C
        help
          Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
index 4372075c551f922380dbd66467221584cd8c902c..da55107033ddad6490550722863ade8273695ffc 100644 (file)
@@ -31,11 +31,11 @@ config CPU_EXYNOS4210
        bool "SAMSUNG EXYNOS4210"
        default y
        depends on ARCH_EXYNOS4
-       select SAMSUNG_DMADEV
        select ARM_CPU_SUSPEND if PM
+       select PM_GENERIC_DOMAINS
        select S5P_PM if PM
        select S5P_SLEEP if PM
-       select PM_GENERIC_DOMAINS
+       select SAMSUNG_DMADEV
        help
          Enable EXYNOS4210 CPU support
 
@@ -43,9 +43,9 @@ config SOC_EXYNOS4212
        bool "SAMSUNG EXYNOS4212"
        default y
        depends on ARCH_EXYNOS4
-       select SAMSUNG_DMADEV
        select S5P_PM if PM
        select S5P_SLEEP if PM
+       select SAMSUNG_DMADEV
        help
          Enable EXYNOS4212 SoC support
 
@@ -61,9 +61,9 @@ config SOC_EXYNOS5250
        bool "SAMSUNG EXYNOS5250"
        default y
        depends on ARCH_EXYNOS5
-       select SAMSUNG_DMADEV
        select S5P_PM if PM
        select S5P_SLEEP if PM
+       select SAMSUNG_DMADEV
        help
          Enable EXYNOS5250 SoC support
 
@@ -189,71 +189,71 @@ config MACH_SMDKC210
 config MACH_SMDKV310
        bool "SMDKV310"
        select CPU_EXYNOS4210
-       select S5P_DEV_FIMD0
+       select EXYNOS4_DEV_AHCI
+       select EXYNOS4_DEV_USB_OHCI
+       select EXYNOS4_SETUP_FIMD0
+       select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_KEYPAD
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS4_SETUP_USB_PHY
+       select EXYNOS_DEV_DMA
+       select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
+       select S3C24XX_PWM
+       select S3C_DEV_HSMMC
+       select S3C_DEV_HSMMC1
+       select S3C_DEV_HSMMC2
+       select S3C_DEV_HSMMC3
+       select S3C_DEV_I2C1
        select S3C_DEV_RTC
+       select S3C_DEV_USB_HSOTG
        select S3C_DEV_WDT
-       select S3C_DEV_I2C1
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
+       select S5P_DEV_FIMD0
        select S5P_DEV_G2D
        select S5P_DEV_I2C_HDMIPHY
        select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select S5P_DEV_TV
        select S5P_DEV_USB_EHCI
-       select S3C_DEV_HSMMC
-       select S3C_DEV_HSMMC1
-       select S3C_DEV_HSMMC2
-       select S3C_DEV_HSMMC3
-       select S3C_DEV_USB_HSOTG
        select SAMSUNG_DEV_BACKLIGHT
-       select EXYNOS_DEV_DRM
-       select EXYNOS_DEV_SYSMMU
-       select EXYNOS4_DEV_AHCI
        select SAMSUNG_DEV_KEYPAD
-       select EXYNOS_DEV_DMA
        select SAMSUNG_DEV_PWM
-       select EXYNOS4_DEV_USB_OHCI
-       select EXYNOS4_SETUP_FIMD0
-       select EXYNOS4_SETUP_I2C1
-       select EXYNOS4_SETUP_KEYPAD
-       select EXYNOS4_SETUP_SDHCI
-       select EXYNOS4_SETUP_USB_PHY
-       select S3C24XX_PWM
        help
          Machine support for Samsung SMDKV310
 
 config MACH_ARMLEX4210
        bool "ARMLEX4210"
        select CPU_EXYNOS4210
-       select S3C_DEV_RTC
-       select S3C_DEV_WDT
+       select EXYNOS4_DEV_AHCI
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS_DEV_DMA
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
-       select EXYNOS4_DEV_AHCI
-       select EXYNOS_DEV_DMA
-       select EXYNOS4_SETUP_SDHCI
+       select S3C_DEV_RTC
+       select S3C_DEV_WDT
        help
          Machine support for Samsung ARMLEX4210 based on EXYNOS4210
 
 config MACH_UNIVERSAL_C210
        bool "Mobile UNIVERSAL_C210 Board"
-       select CPU_EXYNOS4210
-       select S5P_HRT
        select CLKSRC_MMIO
+       select CPU_EXYNOS4210
+       select EXYNOS4_SETUP_FIMC
+       select EXYNOS4_SETUP_FIMD0
+       select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_I2C3
+       select EXYNOS4_SETUP_I2C5
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS4_SETUP_USB_PHY
+       select EXYNOS_DEV_DMA
+       select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
        select HAVE_SCHED_CLOCK
-       select S5P_GPIO_INT
-       select S5P_DEV_FIMC0
-       select S5P_DEV_FIMC1
-       select S5P_DEV_FIMC2
-       select S5P_DEV_FIMC3
-       select S5P_DEV_G2D
-       select S5P_DEV_CSIS0
-       select S5P_DEV_JPEG
-       select S5P_DEV_FIMD0
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
@@ -261,21 +261,21 @@ config MACH_UNIVERSAL_C210
        select S3C_DEV_I2C3
        select S3C_DEV_I2C5
        select S3C_DEV_USB_HSOTG
+       select S5P_DEV_CSIS0
+       select S5P_DEV_FIMC0
+       select S5P_DEV_FIMC1
+       select S5P_DEV_FIMC2
+       select S5P_DEV_FIMC3
+       select S5P_DEV_FIMD0
+       select S5P_DEV_G2D
        select S5P_DEV_I2C_HDMIPHY
+       select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select S5P_DEV_ONENAND
        select S5P_DEV_TV
-       select EXYNOS_DEV_SYSMMU
-       select EXYNOS_DEV_DMA
-       select EXYNOS_DEV_DRM
-       select EXYNOS4_SETUP_FIMD0
-       select EXYNOS4_SETUP_I2C1
-       select EXYNOS4_SETUP_I2C3
-       select EXYNOS4_SETUP_I2C5
-       select EXYNOS4_SETUP_SDHCI
-       select EXYNOS4_SETUP_FIMC
+       select S5P_GPIO_INT
+       select S5P_HRT
        select S5P_SETUP_MIPIPHY
-       select EXYNOS4_SETUP_USB_PHY
        help
          Machine support for Samsung Mobile Universal S5PC210 Reference
          Board.
@@ -283,10 +283,16 @@ config MACH_UNIVERSAL_C210
 config MACH_NURI
        bool "Mobile NURI Board"
        select CPU_EXYNOS4210
-       select S5P_GPIO_INT
-       select S3C_DEV_WDT
-       select S3C_DEV_RTC
-       select S5P_DEV_FIMD0
+       select EXYNOS4_SETUP_FIMC
+       select EXYNOS4_SETUP_FIMD0
+       select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_I2C3
+       select EXYNOS4_SETUP_I2C5
+       select EXYNOS4_SETUP_I2C6
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS4_SETUP_USB_PHY
+       select EXYNOS_DEV_DMA
+       select EXYNOS_DEV_DRM
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
@@ -294,41 +300,42 @@ config MACH_NURI
        select S3C_DEV_I2C3
        select S3C_DEV_I2C5
        select S3C_DEV_I2C6
+       select S3C_DEV_RTC
        select S3C_DEV_USB_HSOTG
+       select S3C_DEV_WDT
        select S5P_DEV_CSIS0
-       select S5P_DEV_JPEG
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
+       select S5P_DEV_FIMD0
        select S5P_DEV_G2D
+       select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select S5P_DEV_USB_EHCI
+       select S5P_GPIO_INT
        select S5P_SETUP_MIPIPHY
-       select EXYNOS_DEV_DMA
-       select EXYNOS_DEV_DRM
-       select EXYNOS4_SETUP_FIMC
-       select EXYNOS4_SETUP_FIMD0
-       select EXYNOS4_SETUP_I2C1
-       select EXYNOS4_SETUP_I2C3
-       select EXYNOS4_SETUP_I2C5
-       select EXYNOS4_SETUP_I2C6
-       select EXYNOS4_SETUP_SDHCI
-       select EXYNOS4_SETUP_USB_PHY
-       select S5P_SETUP_MIPIPHY
-       select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_ADC
+       select SAMSUNG_DEV_PWM
        help
          Machine support for Samsung Mobile NURI Board.
 
 config MACH_ORIGEN
        bool "ORIGEN"
        select CPU_EXYNOS4210
-       select S3C_DEV_RTC
-       select S3C_DEV_WDT
+       select EXYNOS4_DEV_USB_OHCI
+       select EXYNOS4_SETUP_FIMD0
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS4_SETUP_USB_PHY
+       select EXYNOS_DEV_DMA
+       select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
+       select S3C24XX_PWM
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
+       select S3C_DEV_RTC
        select S3C_DEV_USB_HSOTG
+       select S3C_DEV_WDT
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
@@ -342,14 +349,6 @@ config MACH_ORIGEN
        select S5P_DEV_USB_EHCI
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
-       select EXYNOS_DEV_DRM
-       select EXYNOS_DEV_SYSMMU
-       select EXYNOS_DEV_DMA
-       select EXYNOS4_DEV_USB_OHCI
-       select EXYNOS4_SETUP_FIMD0
-       select EXYNOS4_SETUP_SDHCI
-       select EXYNOS4_SETUP_USB_PHY
-       select S3C24XX_PWM
        help
          Machine support for ORIGEN based on Samsung EXYNOS4210
 
@@ -357,7 +356,17 @@ comment "EXYNOS4212 Boards"
 
 config MACH_SMDK4212
        bool "SMDK4212"
-       select SOC_EXYNOS4212
+       select EXYNOS4_SETUP_FIMD0
+       select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_I2C3
+       select EXYNOS4_SETUP_I2C7
+       select EXYNOS4_SETUP_KEYPAD
+       select EXYNOS4_SETUP_SDHCI
+       select EXYNOS4_SETUP_USB_PHY
+       select EXYNOS_DEV_DMA
+       select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
+       select S3C24XX_PWM
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select S3C_DEV_I2C1
@@ -375,17 +384,7 @@ config MACH_SMDK4212
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_PWM
-       select EXYNOS_DEV_SYSMMU
-       select EXYNOS_DEV_DMA
-       select EXYNOS_DEV_DRM
-       select EXYNOS4_SETUP_FIMD0
-       select EXYNOS4_SETUP_I2C1
-       select EXYNOS4_SETUP_I2C3
-       select EXYNOS4_SETUP_I2C7
-       select EXYNOS4_SETUP_KEYPAD
-       select EXYNOS4_SETUP_SDHCI
-       select EXYNOS4_SETUP_USB_PHY
-       select S3C24XX_PWM
+       select SOC_EXYNOS4212
        help
          Machine support for Samsung SMDK4212
 
@@ -393,8 +392,8 @@ comment "EXYNOS4412 Boards"
 
 config MACH_SMDK4412
        bool "SMDK4412"
-       select SOC_EXYNOS4412
        select MACH_SMDK4212
+       select SOC_EXYNOS4412
        help
          Machine support for Samsung SMDK4412
 endif
@@ -404,12 +403,12 @@ comment "Flattened Device Tree based board for EXYNOS SoCs"
 config MACH_EXYNOS4_DT
        bool "Samsung Exynos4 Machine using device tree"
        depends on ARCH_EXYNOS4
-       select CPU_EXYNOS4210
-       select USE_OF
        select ARM_AMBA
+       select CPU_EXYNOS4210
        select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
        select PINCTRL
        select PINCTRL_EXYNOS4
+       select USE_OF
        help
          Machine support for Samsung Exynos4 machine with device tree enabled.
          Select this if a fdt blob is available for the Exynos4 SoC based board.
@@ -419,9 +418,9 @@ config MACH_EXYNOS4_DT
 config MACH_EXYNOS5_DT
        bool "SAMSUNG EXYNOS5 Machine using device tree"
        depends on ARCH_EXYNOS5
+       select ARM_AMBA
        select SOC_EXYNOS5250
        select USE_OF
-       select ARM_AMBA
        help
          Machine support for Samsung EXYNOS5 machine with device tree enabled.
          Select this if a fdt blob is available for the EXYNOS5 SoC based board.
index f643ef819da6f8ba0cd6e359b656438ba6de597b..abda5a18a664734a5d29a015cfabfbe7d0a5c26a 100644 (file)
@@ -91,7 +91,7 @@ config FOOTBRIDGE_ADDIN
 
 # EBSA285 board in either host or addin mode
 config ARCH_EBSA285
-       select ARCH_MAY_HAVE_PC_FDC
        bool
+       select ARCH_MAY_HAVE_PC_FDC
 
 endif
index abf356c02343fd144fc305f1c2c7f45af38b3a60..6bb755bcb6f5db1ff041d7d749345a93cfcc7a27 100644 (file)
@@ -12,9 +12,9 @@ config ARCH_H7201
 
 config ARCH_H7202
        bool "hms30c7202"
+       depends on ARCH_H720X
        select CPU_H7202
        select ZONE_DMA
-       depends on ARCH_H720X
        help
          Say Y here if you are using the Hynix HMS30C7202 Reference Board
 
index 32197c117afe0b3c80656325ddafbdfdfc4f3e68..8d276584650e810d349868ba4c154823cbe271aa 100644 (file)
@@ -41,68 +41,68 @@ config SOC_IMX1
 
 config SOC_IMX21
        bool
-       select MACH_MX21
-       select CPU_ARM926T
        select COMMON_CLK
+       select CPU_ARM926T
        select IMX_HAVE_IOMUX_V1
+       select MACH_MX21
        select MXC_AVIC
 
 config SOC_IMX25
        bool
        select ARCH_MX25
+       select ARCH_MXC_IOMUX_V3
        select COMMON_CLK
        select CPU_ARM926T
        select HAVE_CAN_FLEXCAN if CAN
-       select ARCH_MXC_IOMUX_V3
        select MXC_AVIC
 
 config SOC_IMX27
        bool
-       select MACH_MX27
-       select CPU_ARM926T
        select COMMON_CLK
+       select CPU_ARM926T
        select IMX_HAVE_IOMUX_V1
+       select MACH_MX27
        select MXC_AVIC
 
 config SOC_IMX31
        bool
+       select COMMON_CLK
        select CPU_V6
        select IMX_HAVE_PLATFORM_MXC_RNGA
        select MXC_AVIC
-       select COMMON_CLK
        select SMP_ON_UP if SMP
 
 config SOC_IMX35
        bool
-       select CPU_V6K
        select ARCH_MXC_IOMUX_V3
        select COMMON_CLK
+       select CPU_V6K
+       select HAVE_CAN_FLEXCAN if CAN
        select HAVE_EPIT
        select MXC_AVIC
        select SMP_ON_UP if SMP
-       select HAVE_CAN_FLEXCAN if CAN
 
 config SOC_IMX5
-       select CPU_V7
-       select MXC_TZIC
-       select COMMON_CLK
-       select ARCH_MXC_IOMUX_V3
+       bool
        select ARCH_HAS_CPUFREQ
        select ARCH_MX5
-       bool
+       select ARCH_MXC_IOMUX_V3
+       select COMMON_CLK
+       select CPU_V7
+       select MXC_TZIC
 
 config SOC_IMX50
        bool
-       select SOC_IMX5
        select ARCH_MX50
+       select SOC_IMX5
 
 config SOC_IMX51
        bool
-       select SOC_IMX5
        select ARCH_MX5
        select ARCH_MX51
        select PINCTRL
        select PINCTRL_IMX51
+       select SOC_IMX5
 
 if ARCH_IMX_V4_V5
 
@@ -112,10 +112,10 @@ config MACH_MXLADS
 
 config ARCH_MX1ADS
        bool "MX1ADS platform"
-       select MACH_MXLADS
-       select SOC_IMX1
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
+       select MACH_MXLADS
+       select SOC_IMX1
        help
          Say Y here if you are using Motorola MX1ADS/MXLADS boards
 
@@ -127,9 +127,9 @@ config MACH_SCB9328
 
 config MACH_APF9328
        bool "APF9328"
-       select SOC_IMX1
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX1
        help
          Say Yes here if you are using the Armadeus APF9328 development board
 
@@ -137,11 +137,11 @@ comment "MX21 platforms:"
 
 config MACH_MX21ADS
        bool "MX21ADS platform"
-       select SOC_IMX21
        select IMX_HAVE_PLATFORM_IMX_FB
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
+       select SOC_IMX21
        help
          Include support for MX21ADS platform. This includes specific
          configurations for the board and its peripherals.
@@ -150,22 +150,21 @@ comment "MX25 platforms:"
 
 config MACH_MX25_3DS
        bool "Support MX25PDK (3DS) Platform"
-       select SOC_IMX25
        select IMX_HAVE_PLATFORM_FLEXCAN
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMXDI_RTC
-       select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_FB
+       select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_KEYPAD
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select SOC_IMX25
 
 config MACH_EUKREA_CPUIMX25SD
        bool "Support Eukrea CPUIMX25 Platform"
-       select SOC_IMX25
        select IMX_HAVE_PLATFORM_FLEXCAN
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -177,6 +176,7 @@ config MACH_EUKREA_CPUIMX25SD
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX25
 
 choice
        prompt "Baseboard"
@@ -199,20 +199,19 @@ comment "MX27 platforms:"
 
 config MACH_MX27ADS
        bool "MX27ADS platform"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_IMX_FB
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_MXC_W1
+       select SOC_IMX27
        help
          Include support for MX27ADS platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_PCM038
        bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
@@ -221,6 +220,7 @@ config MACH_PCM038
        select IMX_HAVE_PLATFORM_MXC_W1
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX27
        help
          Include support for phyCORE-i.MX27 (aka pcm038) platform. This
          includes specific configurations for the module and its peripherals.
@@ -242,7 +242,6 @@ endchoice
 
 config MACH_CPUIMX27
        bool "Eukrea CPUIMX27 module"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
@@ -251,6 +250,7 @@ config MACH_CPUIMX27
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_MXC_W1
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX27
        help
          Include support for Eukrea CPUIMX27 platform. This includes
          specific configurations for the module and its peripherals.
@@ -292,7 +292,6 @@ endchoice
 
 config MACH_MX27_3DS
        bool "MX27PDK platform"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_FB
@@ -306,13 +305,13 @@ config MACH_MX27_3DS
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_DEBUG_BOARD
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX27
        help
          Include support for MX27PDK platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_IMX27_VISSTRIM_M10
        bool "Vista Silicon i.MX27 Visstrim_m10"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_GPIO_KEYS
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_SSI
@@ -321,6 +320,7 @@ config MACH_IMX27_VISSTRIM_M10
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_MMC
        select LEDS_GPIO_REGISTER
+       select SOC_IMX27
        help
          Include support for Visstrim_m10 platform and its different variants.
          This includes specific configurations for the board and its
@@ -328,16 +328,15 @@ config MACH_IMX27_VISSTRIM_M10
 
 config MACH_IMX27LITE
        bool "LogicPD MX27 LITEKIT platform"
-       select SOC_IMX27
-       select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IMX_SSI
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX27
        help
          Include support for MX27 LITEKIT platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_PCA100
        bool "Phytec phyCARD-s (pca100)"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_FB
@@ -350,27 +349,28 @@ config MACH_PCA100
        select IMX_HAVE_PLATFORM_MXC_W1
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX27
        help
          Include support for phyCARD-s (aka pca100) platform. This
          includes specific configurations for the module and its peripherals.
 
 config MACH_MXT_TD60
        bool "Maxtrack i-MXT TD60"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_IMX_FB
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
+       select SOC_IMX27
        help
          Include support for i-MXT (aka td60) platform. This
          includes specific configurations for the module and its peripherals.
 
 config MACH_IMX27IPCAM
        bool "IMX27 IPCAM platform"
-       select SOC_IMX27
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX27
        help
          Include support for IMX27 IPCAM platform. This includes specific
          configurations for the board and its peripherals.
@@ -390,11 +390,11 @@ comment "MX31 platforms:"
 
 config MACH_MX31ADS
        bool "Support MX31ADS platforms"
-       select SOC_IMX31
+       default y
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_SSI
        select IMX_HAVE_PLATFORM_IMX_UART
-       default y
+       select SOC_IMX31
        help
          Include support for MX31ADS platform. This includes specific
          configurations for the board and its peripherals.
@@ -412,21 +412,19 @@ config MACH_MX31ADS_WM1133_EV1
 
 config MACH_MX31LILLY
        bool "Support MX31 LILLY-1131 platforms (INCO startec)"
-       select SOC_IMX31
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IPU_CORE
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for mx31 based LILLY1131 modules. This includes
          specific configurations for the board and its peripherals.
 
 config MACH_MX31LITE
        bool "Support MX31 LITEKIT (LogicPD)"
-       select SOC_IMX31
-       select MXC_ULPI if USB_ULPI
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -435,13 +433,14 @@ config MACH_MX31LITE
        select IMX_HAVE_PLATFORM_MXC_RTC
        select IMX_HAVE_PLATFORM_SPI_IMX
        select LEDS_GPIO_REGISTER
+       select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for MX31 LITEKIT platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_PCM037
        bool "Support Phytec pcm037 (i.MX31) platforms"
-       select SOC_IMX31
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
@@ -452,6 +451,7 @@ config MACH_PCM037
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_MXC_W1
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for Phytec pcm037 platform. This includes
          specific configurations for the board and its peripherals.
@@ -468,8 +468,6 @@ config MACH_PCM037_EET
 
 config MACH_MX31_3DS
        bool "Support MX31PDK (3DS)"
-       select SOC_IMX31
-       select MXC_DEBUG_BOARD
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
@@ -481,7 +479,9 @@ config MACH_MX31_3DS
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select MXC_DEBUG_BOARD
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for MX31PDK (3DS) platform. This includes specific
          configurations for the board and its peripherals.
@@ -497,7 +497,6 @@ config MACH_MX31_3DS_MXC_NAND_USE_BBT
 
 config MACH_MX31MOBOARD
        bool "Support mx31moboard platforms (EPFL Mobots group)"
-       select SOC_IMX31
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
@@ -509,22 +508,22 @@ config MACH_MX31MOBOARD
        select IMX_HAVE_PLATFORM_SPI_IMX
        select LEDS_GPIO_REGISTER
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for mx31moboard platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_QONG
        bool "Support Dave/DENX QongEVB-LITE platform"
-       select SOC_IMX31
-       select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX31
        help
          Include support for Dave/DENX QongEVB-LITE platform. This includes
          specific configurations for the board and its peripherals.
 
 config MACH_ARMADILLO5X0
        bool "Support Atmark Armadillo-500 Development Base Board"
-       select SOC_IMX31
        select IMX_HAVE_PLATFORM_GPIO_KEYS
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
@@ -533,23 +532,24 @@ config MACH_ARMADILLO5X0
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX31
        help
          Include support for Atmark Armadillo-500 platform. This includes
          specific configurations for the board and its peripherals.
 
 config MACH_KZM_ARM11_01
        bool "Support KZM-ARM11-01(Kyoto Microcomputer)"
-       select SOC_IMX31
        select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX31
        help
          Include support for KZM-ARM11-01. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_BUG
        bool "Support Buglabs BUGBase platform"
-       select SOC_IMX31
-       select IMX_HAVE_PLATFORM_IMX_UART
        default y
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select SOC_IMX31
        help
          Include support for BUGBase 1.3 platform. This includes specific
          configurations for the board and its peripherals.
@@ -565,7 +565,6 @@ comment "MX35 platforms:"
 
 config MACH_PCM043
        bool "Support Phytec pcm043 (i.MX35) platforms"
-       select SOC_IMX35
        select IMX_HAVE_PLATFORM_FLEXCAN
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -577,14 +576,13 @@ config MACH_PCM043
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX35
        help
          Include support for Phytec pcm043 platform. This includes
          specific configurations for the board and its peripherals.
 
 config MACH_MX35_3DS
        bool "Support MX35PDK platform"
-       select SOC_IMX35
-       select MXC_DEBUG_BOARD
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_FB
@@ -595,13 +593,14 @@ config MACH_MX35_3DS
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_MXC_RTC
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select MXC_DEBUG_BOARD
+       select SOC_IMX35
        help
          Include support for MX35PDK platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_EUKREA_CPUIMX35SD
        bool "Support Eukrea CPUIMX35 Platform"
-       select SOC_IMX35
        select IMX_HAVE_PLATFORM_FLEXCAN
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -611,6 +610,7 @@ config MACH_EUKREA_CPUIMX35SD
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select MXC_ULPI if USB_ULPI
+       select SOC_IMX35
        help
          Include support for Eukrea CPUIMX35 platform. This includes
          specific configurations for the board and its peripherals.
@@ -635,16 +635,16 @@ endchoice
 
 config MACH_VPR200
        bool "Support VPR200 platform"
-       select SOC_IMX35
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_GPIO_KEYS
        select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IPU_CORE
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select SOC_IMX35
        help
          Include support for VPR200 platform. This includes specific
          configurations for the board and its peripherals.
@@ -654,11 +654,11 @@ comment "i.MX5 platforms:"
 config MACH_MX50_RDP
        bool "Support MX50 reference design platform"
        depends on BROKEN
-       select SOC_IMX50
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select SOC_IMX50
        help
          Include support for MX50 reference design platform (RDP) board. This
          includes specific configurations for the board and its peripherals.
@@ -667,15 +667,14 @@ comment "i.MX51 machines:"
 
 config MACH_IMX51_DT
        bool "Support i.MX51 platforms from device tree"
-       select SOC_IMX51
        select MACH_MX51_BABBAGE
+       select SOC_IMX51
        help
          Include support for Freescale i.MX51 based platforms
          using the device tree for discovery
 
 config MACH_MX51_BABBAGE
        bool "Support MX51 BABBAGE platforms"
-       select SOC_IMX51
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
@@ -683,6 +682,7 @@ config MACH_MX51_BABBAGE
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select SOC_IMX51
        help
          Include support for MX51 Babbage platform, also known as MX51EVK in
          u-boot. This includes specific configurations for the board and its
@@ -690,27 +690,27 @@ config MACH_MX51_BABBAGE
 
 config MACH_MX51_3DS
        bool "Support MX51PDK (3DS)"
-       select SOC_IMX51
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_KEYPAD
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_DEBUG_BOARD
+       select SOC_IMX51
        help
          Include support for MX51PDK (3DS) platform. This includes specific
          configurations for the board and its peripherals.
 
 config MACH_EUKREA_CPUIMX51SD
        bool "Support Eukrea CPUIMX51SD module"
-       select SOC_IMX51
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
+       select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select SOC_IMX51
        help
          Include support for Eukrea CPUIMX51SD platform. This includes
          specific configurations for the module and its peripherals.
@@ -736,12 +736,12 @@ comment "Device tree only"
 
 config SOC_IMX53
        bool "i.MX53 support"
-       select SOC_IMX5
        select ARCH_MX5
        select ARCH_MX53
        select HAVE_CAN_FLEXCAN if CAN
        select PINCTRL
        select PINCTRL_IMX53
+       select SOC_IMX5
 
        help
          This enables support for Freescale i.MX53 processor.
index fd5e7b6881bf8a5077660ae9233f1a1135112cb4..73a2d905af8ac1289be0711807a4392a954df479 100644 (file)
@@ -234,8 +234,8 @@ config IXP4XX_QMGR
 
 config IXP4XX_NPE
        tristate "IXP4xx Network Processor Engine support"
-       select HOTPLUG
        select FW_LOADER
+       select HOTPLUG
        help
          This driver supports IXP4xx built-in network coprocessors
          and is automatically selected by Ethernet and HSS drivers.
index d697d07a1bf080fe167c1f434efc96735daeda53..178d4daa5e1dbd67c3f0ecbed9415cf3f054157f 100644 (file)
@@ -107,22 +107,22 @@ endmenu
 
 config CPU_PXA168
        bool
-       select CPU_MOHAWK
        select COMMON_CLK
+       select CPU_MOHAWK
        help
          Select code specific to PXA168
 
 config CPU_PXA910
        bool
-       select CPU_MOHAWK
        select COMMON_CLK
+       select CPU_MOHAWK
        help
          Select code specific to PXA910
 
 config CPU_MMP2
        bool
-       select CPU_PJ4
        select COMMON_CLK
+       select CPU_PJ4
        help
          Select code specific to MMP2. MMP2 is ARMv7 compatible.
 
index 7902de151cc5bedf339b2f5d75e694f5ad70cd78..b61908594b47389c00a07df25401e318e354b34b 100644 (file)
@@ -10,35 +10,35 @@ choice
 
 config ARCH_MSM7X00A
        bool "MSM7x00A / MSM7x01A"
-       select MACH_TROUT if !MACH_HALIBUT
        select ARCH_MSM_ARM11
-       select MSM_SMD
-       select MSM_SMD_PKG3
        select CPU_V6
        select GPIO_MSM_V1
+       select MACH_TROUT if !MACH_HALIBUT
        select MSM_PROC_COMM
+       select MSM_SMD
+       select MSM_SMD_PKG3
 
 config ARCH_MSM7X30
        bool "MSM7x30"
-       select MACH_MSM7X30_SURF # if !
        select ARCH_MSM_SCORPION
-       select MSM_SMD
-       select MSM_VIC
        select CPU_V7
-       select MSM_GPIOMUX
        select GPIO_MSM_V1
+       select MACH_MSM7X30_SURF # if !
+       select MSM_GPIOMUX
        select MSM_PROC_COMM
+       select MSM_SMD
+       select MSM_VIC
 
 config ARCH_QSD8X50
        bool "QSD8X50"
-       select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
        select ARCH_MSM_SCORPION
-       select MSM_SMD
-       select MSM_VIC
        select CPU_V7
-       select MSM_GPIOMUX
        select GPIO_MSM_V1
+       select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
+       select MSM_GPIOMUX
        select MSM_PROC_COMM
+       select MSM_SMD
+       select MSM_VIC
 
 endchoice
 
@@ -47,10 +47,10 @@ config ARCH_MSM8X60
        select ARCH_MSM_SCORPIONMP
        select ARM_GIC
        select CPU_V7
-       select MSM_V2_TLMM
        select GPIO_MSM_V2
        select MSM_GPIOMUX
        select MSM_SCM if SMP
+       select MSM_V2_TLMM
        select USE_OF
 
 config ARCH_MSM8960
@@ -58,9 +58,9 @@ config ARCH_MSM8960
        select ARCH_MSM_SCORPIONMP
        select ARM_GIC
        select CPU_V7
-       select MSM_V2_TLMM
        select MSM_GPIOMUX
        select MSM_SCM if SMP
+       select MSM_V2_TLMM
        select USE_OF
 
 config MSM_HAS_DEBUG_UART_HS
@@ -110,8 +110,8 @@ config MACH_QSD8X50_SURF
 
 config MACH_QSD8X50A_ST1_5
        depends on ARCH_QSD8X50
-       select MSM_SOC_REV_A
        bool "QSD8x50A ST1.5"
+       select MSM_SOC_REV_A
        help
          Support for the Qualcomm ST1.5.
 
index 365879b47c0e3218a32f42b4acc8a46b6a532ae2..c744946ef0222e89623a038473497ad007f7b5ef 100644 (file)
@@ -4,8 +4,8 @@ menu "Nomadik boards"
 
 config MACH_NOMADIK_8815NHK
        bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
-       select NOMADIK_8815
        select HAS_MTU
+       select NOMADIK_8815
 
 endmenu
 
@@ -16,7 +16,7 @@ config I2C_BITBANG_8815NHK
        tristate "Driver for bit-bang busses found on the 8815 NHK"
        depends on I2C && MACH_NOMADIK_8815NHK
        depends on PINCTRL_NOMADIK
-       select I2C_ALGOBIT
        default y
+       select I2C_ALGOBIT
 
 endif
index cba3f7191cfc32df8818178b971aae206cbac68c..903da8eb886c8ebc6abe1a79dab58b0d79a98730 100644 (file)
@@ -8,15 +8,15 @@ comment "OMAP Core Type"
 config ARCH_OMAP730
        depends on ARCH_OMAP1
        bool "OMAP730 Based System"
+       select ARCH_OMAP_OTG
        select CPU_ARM926T
        select OMAP_MPU_TIMER
-       select ARCH_OMAP_OTG
 
 config ARCH_OMAP850
        depends on ARCH_OMAP1
        bool "OMAP850 Based System"
-       select CPU_ARM926T
        select ARCH_OMAP_OTG
+       select CPU_ARM926T
 
 config ARCH_OMAP15XX
        depends on ARCH_OMAP1
@@ -28,8 +28,8 @@ config ARCH_OMAP15XX
 config ARCH_OMAP16XX
        depends on ARCH_OMAP1
        bool "OMAP16xx Based System"
-       select CPU_ARM926T
        select ARCH_OMAP_OTG
+       select CPU_ARM926T
 
 comment "OMAP Board Type"
        depends on ARCH_OMAP1
@@ -132,8 +132,8 @@ config MACH_OMAP_PALMTT
 
 config MACH_SX1
        bool "Siemens SX1"
-       select I2C
        depends on ARCH_OMAP1 && ARCH_OMAP15XX
+       select I2C
        help
          Support for the Siemens SX1 phone. To boot the kernel,
          you'll need a SX1 compatible bootloader; check out
index a6219eaf1f68116dffb16a2f1b1645e4602d8007..2a1a898c7f90c661ec641aead23acd8d00a634cb 100644 (file)
@@ -6,19 +6,19 @@ config ARCH_OMAP2PLUS_TYPICAL
        bool "Typical OMAP configuration"
        default y
        select AEABI
-       select REGULATOR
-       select PM_RUNTIME
-       select VFP
-       select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
-       select SERIAL_OMAP
-       select SERIAL_OMAP_CONSOLE
+       select HIGHMEM
        select I2C
        select I2C_OMAP
        select MENELAUS if ARCH_OMAP2
+       select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
+       select PINCTRL
+       select PM_RUNTIME
+       select REGULATOR
+       select SERIAL_OMAP
+       select SERIAL_OMAP_CONSOLE
        select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
        select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
-       select HIGHMEM
-       select PINCTRL
+       select VFP
        help
          Compile a kernel suitable for booting most boards
 
@@ -40,44 +40,44 @@ config ARCH_OMAP3
        bool "TI OMAP3"
        depends on ARCH_OMAP2PLUS
        default y
-       select CPU_V7
-       select USB_ARCH_HAS_EHCI if USB_SUPPORT
        select ARCH_HAS_OPP
-       select PM_RUNTIME if CPU_IDLE
-       select PM_OPP if PM
        select ARM_CPU_SUSPEND if PM
+       select CPU_V7
        select MULTI_IRQ_HANDLER
-       select SOC_HAS_OMAP2_SDRC
        select OMAP_INTERCONNECT
+       select PM_OPP if PM
+       select PM_RUNTIME if CPU_IDLE
+       select SOC_HAS_OMAP2_SDRC
+       select USB_ARCH_HAS_EHCI if USB_SUPPORT
 
 config ARCH_OMAP4
        bool "TI OMAP4"
        default y
        depends on ARCH_OMAP2PLUS
+       select ARCH_HAS_OPP
+       select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
+       select ARM_CPU_SUSPEND if PM
+       select ARM_ERRATA_720789
+       select ARM_GIC
        select CACHE_L2X0
        select CPU_V7
-       select ARM_GIC
        select HAVE_SMP
        select LOCAL_TIMERS if SMP
+       select OMAP_INTERCONNECT
        select PL310_ERRATA_588369
        select PL310_ERRATA_727915
-       select ARM_ERRATA_720789
-       select ARCH_HAS_OPP
-       select PM_RUNTIME if CPU_IDLE
        select PM_OPP if PM
+       select PM_RUNTIME if CPU_IDLE
        select USB_ARCH_HAS_EHCI if USB_SUPPORT
-       select ARM_CPU_SUSPEND if PM
-       select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
-       select OMAP_INTERCONNECT
 
 config SOC_OMAP5
        bool "TI OMAP5"
-       select CPU_V7
+       select ARM_ARCH_TIMER
+       select ARM_CPU_SUSPEND if PM
        select ARM_GIC
+       select CPU_V7
        select HAVE_SMP
-       select ARM_CPU_SUSPEND if PM
        select SOC_HAS_REALTIME_COUNTER
-       select ARM_ARCH_TIMER
 
 comment "OMAP Core Type"
        depends on ARCH_OMAP2
@@ -109,8 +109,8 @@ config SOC_TI81XX
 config SOC_AM33XX
        bool "AM33XX support"
        default y
-       select CPU_V7
        select ARM_CPU_SUSPEND if PM
+       select CPU_V7
        select MULTI_IRQ_HANDLER
 
 config OMAP_PACKAGE_ZAF
@@ -157,8 +157,8 @@ config MACH_OMAP_H4
        bool "OMAP 2420 H4 board"
        depends on SOC_OMAP2420
        default y
-       select OMAP_PACKAGE_ZAF
        select OMAP_DEBUG_DEVICES
+       select OMAP_PACKAGE_ZAF
 
 config MACH_OMAP_APOLLON
        bool "OMAP 2420 Apollon board"
@@ -193,8 +193,8 @@ config MACH_OMAP_LDP
 config MACH_OMAP3530_LV_SOM
        bool "OMAP3 Logic 3530 LV SOM board"
        depends on ARCH_OMAP3
-       select OMAP_PACKAGE_CBB
        default y
+       select OMAP_PACKAGE_CBB
        help
         Support for the LogicPD OMAP3530 SOM Development kit
         for full description please see the products webpage at
@@ -203,8 +203,8 @@ config MACH_OMAP3530_LV_SOM
 config MACH_OMAP3_TORPEDO
        bool "OMAP3 Logic 35x Torpedo board"
        depends on ARCH_OMAP3
-       select OMAP_PACKAGE_CBB
        default y
+       select OMAP_PACKAGE_CBB
        help
         Support for the LogicPD OMAP35x Torpedo Development kit
         for full description please see the products webpage at
@@ -265,17 +265,17 @@ config MACH_NOKIA_N8X0
        bool "Nokia N800/N810"
        depends on SOC_OMAP2420
        default y
-       select OMAP_PACKAGE_ZAC
        select MACH_NOKIA_N800
        select MACH_NOKIA_N810
        select MACH_NOKIA_N810_WIMAX
+       select OMAP_PACKAGE_ZAC
 
 config MACH_NOKIA_RM680
        bool "Nokia RM-680/696 board"
        depends on ARCH_OMAP3
        default y
-       select OMAP_PACKAGE_CBB
        select MACH_NOKIA_RM696
+       select OMAP_PACKAGE_CBB
 
 config MACH_NOKIA_RX51
        bool "Nokia RX-51 board"
@@ -288,20 +288,20 @@ config MACH_OMAP_ZOOM2
        depends on ARCH_OMAP3
        default y
        select OMAP_PACKAGE_CBB
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select SERIAL_8250
-       select SERIAL_CORE_CONSOLE
        select SERIAL_8250_CONSOLE
-       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select SERIAL_CORE_CONSOLE
 
 config MACH_OMAP_ZOOM3
        bool "OMAP3630 Zoom3 board"
        depends on ARCH_OMAP3
        default y
        select OMAP_PACKAGE_CBP
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select SERIAL_8250
-       select SERIAL_CORE_CONSOLE
        select SERIAL_8250_CONSOLE
-       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select SERIAL_CORE_CONSOLE
 
 config MACH_CM_T35
        bool "CompuLab CM-T35/CM-T3730 modules"
@@ -329,8 +329,8 @@ config MACH_IGEP0030
        bool "IGEP OMAP3 module"
        depends on ARCH_OMAP3
        default y
-       select OMAP_PACKAGE_CBB
        select MACH_IGEP0020
+       select OMAP_PACKAGE_CBB
 
 config MACH_SBC3530
        bool "OMAP3 SBC STALKER board"
index 41fc85327673c7ddd88abfc1d4686331cc109a10..558ccfb8d45803b3c3f68cadea2cfdc7e5e69440 100644 (file)
@@ -6,8 +6,8 @@ config ARCH_PRIMA2
        bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
        default y
        select CPU_V7
-       select ZONE_DMA
        select SIRF_IRQ
+       select ZONE_DMA
        help
           Support for CSR SiRFSoC ARM Cortex A9 Platform
 
index 8e6288de69b9d64c6532d5a48d8fa78b8713a485..11aa7399dc090119f2183b1702f915f0e1d5ba00 100644 (file)
@@ -27,10 +27,10 @@ comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
 
 config MACH_PXA3XX_DT
        bool "Support PXA3xx platforms from device tree"
-       select PXA3xx
        select CPU_PXA300
-       select POWER_SUPPLY
        select HAVE_PWM
+       select POWER_SUPPLY
+       select PXA3xx
        select USE_OF
        help
          Include support for Marvell PXA3xx based platforms using
@@ -44,13 +44,13 @@ config ARCH_LUBBOCK
 
 config MACH_MAINSTONE
        bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
-       select PXA27x
        select HAVE_PWM
+       select PXA27x
 
 config MACH_ZYLONITE
        bool
-       select PXA3xx
        select HAVE_PWM
+       select PXA3xx
 
 config MACH_ZYLONITE300
        bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
@@ -65,19 +65,19 @@ config MACH_ZYLONITE320
 
 config MACH_LITTLETON
        bool "PXA3xx Form Factor Platform (aka Littleton)"
-       select PXA3xx
        select CPU_PXA300
        select CPU_PXA310
+       select PXA3xx
 
 config MACH_TAVOREVB
        bool "PXA930 Evaluation Board (aka TavorEVB)"
-       select PXA3xx
        select CPU_PXA930
+       select PXA3xx
 
 config MACH_SAAR
        bool "PXA930 Handheld Platform (aka SAAR)"
-       select PXA3xx
        select CPU_PXA930
+       select PXA3xx
 
 comment "Third Party Dev Platforms (sorted by vendor name)"
 
@@ -87,29 +87,29 @@ config ARCH_PXA_IDP
 
 config ARCH_VIPER
        bool "Arcom/Eurotech VIPER SBC"
-       select PXA25x
-       select ISA
-       select I2C_GPIO
+       select ARCOM_PCMCIA
        select HAVE_PWM
+       select I2C_GPIO
+       select ISA
+       select PXA25x
        select PXA_HAVE_ISA_IRQS
-       select ARCOM_PCMCIA
 
 config MACH_ARCOM_ZEUS
        bool "Arcom/Eurotech ZEUS SBC"
-       select PXA27x
+       select ARCOM_PCMCIA
        select ISA
+       select PXA27x
        select PXA_HAVE_ISA_IRQS
-       select ARCOM_PCMCIA
 
 config MACH_BALLOON3
        bool "Balloon 3 board"
-       select PXA27x
        select IWMMXT
+       select PXA27x
 
 config MACH_CSB726
        bool "Enable Cogent CSB726 System On a Module"
-       select PXA27x
        select IWMMXT
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on a Cogent
          CSB726 System On Module.
@@ -121,11 +121,11 @@ config CSB726_CSB701
 config MACH_ARMCORE
        bool "CompuLab CM-X255/CM-X270 modules"
        select ARCH_HAS_DMA_SET_COHERENT_MASK if PCI
-       select PXA27x
        select IWMMXT
-       select PXA25x
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H if PCI
+       select PXA25x
+       select PXA27x
 
 config MACH_EM_X270
        bool "CompuLab EM-x270 platform"
@@ -137,10 +137,10 @@ config MACH_EXEDA
 
 config MACH_CM_X300
        bool "CompuLab CM-X300 modules"
-       select PXA3xx
        select CPU_PXA300
        select CPU_PXA310
        select HAVE_PWM
+       select PXA3xx
 
 config MACH_CAPC7117
        bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
@@ -168,22 +168,22 @@ endchoice
 
 config MACH_INTELMOTE2
        bool "Intel Mote 2 Platform"
-       select PXA27x
        select IWMMXT
+       select PXA27x
 
 config MACH_STARGATE2
        bool "Intel Stargate 2 Platform"
-       select PXA27x
        select IWMMXT
+       select PXA27x
 
 config MACH_XCEP
        bool "Iskratel Electronics XCEP"
-       select PXA25x
        select MTD
-       select MTD_PHYSMAP
-       select MTD_CFI_INTELEXT
        select MTD_CFI
+       select MTD_CFI_INTELEXT
        select MTD_CHAR
+       select MTD_PHYSMAP
+       select PXA25x
        select SMC91X
        help
          PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
@@ -195,14 +195,14 @@ config TRIZEPS_PXA
 config MACH_TRIZEPS4
        bool "Keith und Koep Trizeps4 DIMM-Module"
        depends on TRIZEPS_PXA
-       select TRIZEPS_PCMCIA
        select PXA27x
+       select TRIZEPS_PCMCIA
 
 config MACH_TRIZEPS4WL
        bool "Keith und Koep Trizeps4-WL DIMM-Module"
        depends on TRIZEPS_PXA
-       select TRIZEPS_PCMCIA
        select PXA27x
+       select TRIZEPS_PCMCIA
 
 choice
        prompt "Select base board for Trizeps module"
@@ -231,18 +231,18 @@ config TRIZEPS_PCMCIA
 
 config MACH_LOGICPD_PXA270
        bool "LogicPD PXA270 Card Engine Development Platform"
-       select PXA27x
        select HAVE_PWM
+       select PXA27x
 
 config MACH_PCM027
        bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
-       select PXA27x
        select IWMMXT
+       select PXA27x
 
 config MACH_PCM990_BASEBOARD
        bool "PHYTEC PCM-990 development board"
-       select HAVE_PWM
        depends on MACH_PCM027
+       select HAVE_PWM
 
 choice
        prompt "display on pcm990"
@@ -266,19 +266,19 @@ config MACH_COLIBRI
 config MACH_COLIBRI_PXA270_INCOME
        bool "Income s.r.o. PXA270 SBC"
        depends on MACH_COLIBRI
-       select PXA27x
        select HAVE_PWM
+       select PXA27x
 
 config MACH_COLIBRI300
        bool "Toradex Colibri PXA300/310"
-       select PXA3xx
        select CPU_PXA300
        select CPU_PXA310
+       select PXA3xx
 
 config MACH_COLIBRI320
        bool "Toradex Colibri PXA320"
-       select PXA3xx
        select CPU_PXA320
+       select PXA3xx
 
 config MACH_COLIBRI_EVALBOARD
        bool "Toradex Colibri Evaluation Carrier Board support"
@@ -286,8 +286,8 @@ config MACH_COLIBRI_EVALBOARD
 
 config MACH_VPAC270
        bool "Voipac PXA270"
-       select PXA27x
        select HAVE_PATA_PLATFORM
+       select PXA27x
        help
          PXA270 based Single Board Computer.
 
@@ -295,9 +295,9 @@ comment "End-user Products (sorted by vendor name)"
 
 config MACH_H4700
        bool "HP iPAQ hx4700"
-       select PXA27x
-       select IWMMXT
        select HAVE_PWM
+       select IWMMXT
+       select PXA27x
 
 config MACH_H5000
        bool "HP iPAQ h5000"
@@ -309,16 +309,16 @@ config MACH_HIMALAYA
 
 config MACH_MAGICIAN
        bool "Enable HTC Magician Support"
-       select PXA27x
-       select IWMMXT
        select HAVE_PWM
+       select IWMMXT
+       select PXA27x
 
 config MACH_MIOA701
        bool "Mitac Mio A701 Support"
-       select PXA27x
-       select IWMMXT
-       select HAVE_PWM
        select GPIO_SYSFS
+       select HAVE_PWM
+       select IWMMXT
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on a
          MIO A701. Currently there is only basic support
@@ -326,9 +326,9 @@ config MACH_MIOA701
 
 config PXA_EZX
        bool "Motorola EZX Platform"
-       select PXA27x
-       select IWMMXT
        select HAVE_PWM
+       select IWMMXT
+       select PXA27x
 
 config MACH_EZX_A780
        bool "Motorola EZX A780"
@@ -393,9 +393,9 @@ config MACH_PALMT5
        bool "Palm Tungsten|T5"
        default y
        depends on ARCH_PXA_PALM
-       select PXA27x
        select IWMMXT
        select MACH_PALM27X
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on a Palm Tungsten|T5
          handheld computer.
@@ -404,9 +404,9 @@ config MACH_PALMTX
        bool "Palm T|X"
        default y
        depends on ARCH_PXA_PALM
-       select PXA27x
        select IWMMXT
        select MACH_PALM27X
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on a Palm T|X
          handheld computer.
@@ -415,9 +415,9 @@ config MACH_PALMZ72
        bool "Palm Zire 72"
        default y
        depends on ARCH_PXA_PALM
-       select PXA27x
        select IWMMXT
        select MACH_PALM27X
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on Palm Zire 72
          handheld computer.
@@ -426,9 +426,9 @@ config MACH_PALMLD
        bool "Palm LifeDrive"
        default y
        depends on ARCH_PXA_PALM
-       select PXA27x
        select IWMMXT
        select MACH_PALM27X
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on a Palm LifeDrive
          handheld computer.
@@ -441,10 +441,10 @@ config MACH_CENTRO
        bool "Palm Centro 685 (GSM)"
        default y
        depends on ARCH_PXA_PALM
-       select MACH_PALM27X
-       select PXA27x
        select IWMMXT
+       select MACH_PALM27X
        select PALM_TREO
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on Palm Centro 685 (GSM)
          smartphone.
@@ -453,37 +453,37 @@ config MACH_TREO680
        bool "Palm Treo 680"
        default y
        depends on ARCH_PXA_PALM
-       select MACH_PALM27X
-       select PXA27x
        select IWMMXT
+       select MACH_PALM27X
        select PALM_TREO
+       select PXA27x
        help
          Say Y here if you intend to run this kernel on Palm Treo 680
          smartphone.
 
 config MACH_RAUMFELD_RC
        bool "Raumfeld Controller"
-       select PXA3xx
        select CPU_PXA300
-       select POWER_SUPPLY
        select HAVE_PWM
+       select POWER_SUPPLY
+       select PXA3xx
 
 config MACH_RAUMFELD_CONNECTOR
        bool "Raumfeld Connector"
+       select CPU_PXA300
        select POWER_SUPPLY
        select PXA3xx
-       select CPU_PXA300
 
 config MACH_RAUMFELD_SPEAKER
        bool "Raumfeld Speaker"
+       select CPU_PXA300
        select POWER_SUPPLY
        select PXA3xx
-       select CPU_PXA300
 
 config PXA_SHARPSL
        bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
-       select SHARP_SCOOP
        select SHARP_PARAM
+       select SHARP_SCOOP
        help
          Say Y here if you intend to run this kernel on a
          Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
@@ -526,11 +526,11 @@ config MACH_HUSKY
 config MACH_AKITA
        bool "Enable Sharp SL-1000 (Akita) Support"
        depends on PXA_SHARPSL
-       select PXA27x
-       select PXA_SHARP_Cxx00
-       select MACH_SPITZ
        select I2C
        select I2C_PXA
+       select MACH_SPITZ
+       select PXA27x
+       select PXA_SHARP_Cxx00
 
 config MACH_SPITZ
        bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
@@ -575,8 +575,8 @@ config MACH_ICONTROL
 
 config ARCH_PXA_ESERIES
        bool "PXA based Toshiba e-series PDAs"
-       select PXA25x
        select FB_W100
+       select PXA25x
 
 config MACH_E330
        bool "Toshiba e330"
@@ -628,8 +628,8 @@ config MACH_E800
 
 config MACH_ZIPIT2
        bool "Zipit Z2 Handheld"
-       select PXA27x
        select HAVE_PWM
+       select PXA27x
 endif
 endmenu
 
@@ -720,9 +720,9 @@ config SHARPSL_PM
 config SHARPSL_PM_MAX1111
        bool
        select HWMON
+       select SENSORS_MAX1111
        select SPI
        select SPI_MASTER
-       select SENSORS_MAX1111
 
 config PXA_HAVE_ISA_IRQS
        bool
index c593be428b8ff059694f93d4534d19d2d45fe2ae..14c1d47e1abf256bb6dd258e830692dd47e9a679 100644 (file)
@@ -21,8 +21,8 @@ config REALVIEW_EB_A9MP
 config REALVIEW_EB_ARM11MP
        bool "Support ARM11MPCore Tile"
        depends on MACH_REALVIEW_EB
-       select CPU_V6K
        select ARCH_HAS_BARRIERS if SMP
+       select CPU_V6K
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
@@ -40,12 +40,12 @@ config REALVIEW_EB_ARM11MP_REVB
 
 config MACH_REALVIEW_PB11MP
        bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
-       select CPU_V6K
+       select ARCH_HAS_BARRIERS if SMP
        select ARM_GIC
+       select CPU_V6K
        select HAVE_PATA_PLATFORM
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
-       select ARCH_HAS_BARRIERS if SMP
        help
          Include support for the ARM(R) RealView(R) Platform Baseboard for
          the ARM11MPCore.  This platform has an on-board ARM11MPCore and has
@@ -54,8 +54,8 @@ config MACH_REALVIEW_PB11MP
 # ARMv6 CPU without K extensions, but does have the new exclusive ops
 config MACH_REALVIEW_PB1176
        bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S"
-       select CPU_V6
        select ARM_GIC
+       select CPU_V6
        select HAVE_TCM
        select MIGHT_HAVE_CACHE_L2X0
        help
@@ -73,8 +73,8 @@ config REALVIEW_PB1176_SECURE_FLASH
 
 config MACH_REALVIEW_PBA8
        bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform"
-       select CPU_V7
        select ARM_GIC
+       select CPU_V7
        select HAVE_PATA_PLATFORM
        help
          Include support for the ARM(R) RealView Platform Baseboard for
@@ -83,11 +83,11 @@ config MACH_REALVIEW_PBA8
 
 config MACH_REALVIEW_PBX
        bool "Support RealView(R) Platform Baseboard Explore"
+       select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
        select ARM_GIC
        select HAVE_PATA_PLATFORM
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
-       select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
        select ZONE_DMA if SPARSEMEM
        help
          Include support for the ARM(R) RealView(R) Platform Baseboard
index c5256f4e90bb26be110c214593f66373aa8b2640..495f6928cbaa40236d4117ac987a4e411d67e044 100644 (file)
@@ -7,7 +7,7 @@
 config S3C2412_CPUFREQ
        bool
        depends on CPU_FREQ_S3C24XX && CPU_S3C2412
-       select S3C2412_IOTIMING
        default y
+       select S3C2412_IOTIMING
        help
          CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
index ece7a10fe3c64b2b233b982d091000ff0224e190..a4d7fd27bec57be7ae172a76e65c55751cbef8b2 100644 (file)
@@ -5,8 +5,8 @@
 config S3C2440_CPUFREQ
        bool "S3C2440/S3C2442 CPU Frequency scaling support"
        depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
-       select S3C2410_CPUFREQ_UTILS
        default y
+       select S3C2410_CPUFREQ_UTILS
        help
          CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
 
index d56b0f7f2b202a0aaea0b36435328ff15b8c783f..2b6cb5f29c2d09f8ca405d820c450c7f4b903b5c 100644 (file)
@@ -17,10 +17,10 @@ config CPU_S3C2410
        bool "SAMSUNG S3C2410"
        default y
        select CPU_ARM920T
-       select S3C2410_CLOCK
        select CPU_LLSERIAL_S3C2410
-       select S3C2410_PM if PM
+       select S3C2410_CLOCK
        select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
+       select S3C2410_PM if PM
        help
          Support for S3C2410 and S3C2410A family from the S3C24XX line
          of Samsung Mobile CPUs.
@@ -30,8 +30,8 @@ config CPU_S3C2412
        depends on ARCH_S3C24XX
        select CPU_ARM926T
        select CPU_LLSERIAL_S3C2440
-       select S3C2412_PM if PM
        select S3C2412_DMA if S3C24XX_DMA
+       select S3C2412_PM if PM
        help
          Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
 
@@ -40,10 +40,10 @@ config CPU_S3C2416
        depends on ARCH_S3C24XX
        select CPU_ARM926T
        select CPU_LLSERIAL_S3C2440
-       select SAMSUNG_CLKSRC
+       select S3C2416_PM if PM
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
-       select S3C2416_PM if PM
+       select SAMSUNG_CLKSRC
        help
          Support for the S3C2416 SoC from the S3C24XX line
 
@@ -75,9 +75,9 @@ config CPU_S3C2443
        depends on ARCH_S3C24XX
        select CPU_ARM920T
        select CPU_LLSERIAL_S3C2440
-       select SAMSUNG_CLKSRC
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
+       select SAMSUNG_CLKSRC
        help
          Support for the S3C2443 SoC from the S3C24XX line
 
@@ -156,16 +156,16 @@ config MACH_AML_M5900
 
 config ARCH_BAST
        bool "Simtec Electronics BAST (EB2410ITX)"
+       select ISA
+       select MACH_BAST_IDE
        select S3C2410_IOTIMING if S3C2410_CPUFREQ
-       select S3C24XX_SIMTEC_PM if PM
+       select S3C24XX_DCLK
        select S3C24XX_SIMTEC_NOR
+       select S3C24XX_SIMTEC_PM if PM
        select S3C24XX_SIMTEC_USB
-       select MACH_BAST_IDE
-       select S3C24XX_DCLK
-       select ISA
        select S3C_DEV_HWMON
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Simtec Electronics EB2410ITX
          development board (also known as BAST)
@@ -181,9 +181,9 @@ config BAST_PC104_IRQ
 config ARCH_H1940
        bool "IPAQ H1940"
        select PM_H1940 if PM
-       select S3C_DEV_USB_HOST
-       select S3C_DEV_NAND
        select S3C24XX_SETUP_TS
+       select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the HP IPAQ H1940
 
@@ -203,23 +203,23 @@ config PM_H1940
 config MACH_N30
        bool "Acer N30 family"
        select MACH_N35
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you want suppt for the Acer N30, Acer N35,
          Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
 
 config MACH_OTOM
        bool "NexVision OTOM Board"
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Nex Vision OTOM board
 
 config MACH_QT2410
        bool "QT2410"
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Armzone QT2410
 
@@ -239,12 +239,12 @@ config MACH_TCT_HAMMER
 
 config MACH_VR1000
        bool "Thorcom VR1000"
-       select S3C24XX_SIMTEC_PM if PM
+       select MACH_BAST_IDE
        select S3C24XX_DCLK
        select S3C24XX_SIMTEC_NOR
-       select MACH_BAST_IDE
-       select S3C_DEV_USB_HOST
+       select S3C24XX_SIMTEC_PM if PM
        select S3C24XX_SIMTEC_USB
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Thorcom VR1000 board.
 
@@ -285,8 +285,8 @@ comment "S3C2412 Boards"
 
 config MACH_JIVE
        bool "Logitech Jive"
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Logitech Jive.
 
@@ -314,15 +314,15 @@ config MACH_SMDK2413
        bool "SMDK2413"
        select MACH_S3C2413
        select S3C24XX_SMDK
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using an SMDK2413
 
 config MACH_VSTMS
        bool "VMSTMS"
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using an VSTMS board
 
@@ -351,13 +351,13 @@ comment "S3C2416 Boards"
 
 config MACH_SMDK2416
        bool "SMDK2416"
+       select S3C2416_SETUP_SDHCI
        select S3C24XX_SMDK
        select S3C_DEV_FB
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_NAND
        select S3C_DEV_USB_HOST
-       select S3C2416_SETUP_SDHCI
        help
          Say Y here if you are using an SMDK2416
 
@@ -379,11 +379,11 @@ comment "S3C2440 Boards"
 
 config MACH_ANUBIS
        bool "Simtec Electronics ANUBIS"
-       select S3C24XX_DCLK
-       select S3C24XX_SIMTEC_PM if PM
        select HAVE_PATA_PLATFORM
-       select S3C24XX_GPIO_EXTRA64
        select S3C2440_XTAL_12000000
+       select S3C24XX_DCLK
+       select S3C24XX_GPIO_EXTRA64
+       select S3C24XX_SIMTEC_PM if PM
        select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Simtec Electronics ANUBIS
@@ -391,18 +391,18 @@ config MACH_ANUBIS
 
 config MACH_AT2440EVB
        bool "Avantech AT2440EVB development board"
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the AT2440EVB development board
 
 config MACH_MINI2440
        bool "MINI2440 development board"
        select EEPROM_AT24
-       select NEW_LEDS
        select LEDS_CLASS
        select LEDS_TRIGGER
        select LEDS_TRIGGER_BACKLIGHT
+       select NEW_LEDS
        select S3C_DEV_NAND
        select S3C_DEV_USB_HOST
        help
@@ -412,20 +412,20 @@ config MACH_MINI2440
 config MACH_NEXCODER_2440
        bool "NexVision NEXCODER 2440 Light Board"
        select S3C2440_XTAL_12000000
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
 
 config MACH_OSIRIS
        bool "Simtec IM2440D20 (OSIRIS) module"
+       select S3C2410_IOTIMING if S3C2440_CPUFREQ
+       select S3C2440_XTAL_12000000
        select S3C24XX_DCLK
-       select S3C24XX_SIMTEC_PM if PM
        select S3C24XX_GPIO_EXTRA128
-       select S3C2440_XTAL_12000000
-       select S3C2410_IOTIMING if S3C2440_CPUFREQ
-       select S3C_DEV_USB_HOST
+       select S3C24XX_SIMTEC_PM if PM
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the Simtec IM2440D20 module, also
          known as the Osiris.
@@ -445,8 +445,8 @@ config MACH_OSIRIS_DVS
 
 config MACH_RX3715
        bool "HP iPAQ rx3715"
-       select S3C2440_XTAL_16934400
        select PM_H1940 if PM
+       select S3C2440_XTAL_16934400
        select S3C_DEV_NAND
        help
          Say Y here if you are using the HP iPAQ rx3715.
@@ -455,8 +455,8 @@ config ARCH_S3C2440
        bool "SMDK2440"
        select S3C2440_XTAL_16934400
        select S3C24XX_SMDK
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the SMDK2440.
 
@@ -478,11 +478,11 @@ comment "S3C2442 Boards"
 
 config MACH_NEO1973_GTA02
        bool "Openmoko GTA02 / Freerunner phone"
+       select I2C
+       select MACH_NEO1973
        select MFD_PCF50633
        select PCF50633_GPIO
-       select I2C
        select POWER_SUPPLY
-       select MACH_NEO1973
        select S3C24XX_PWM
        select S3C_DEV_USB_HOST
        help
@@ -490,13 +490,13 @@ config MACH_NEO1973_GTA02
 
 config MACH_RX1950
        bool "HP iPAQ rx1950"
-       select S3C24XX_DCLK
-       select PM_H1940 if PM
        select I2C
-       select S3C24XX_PWM
-       select S3C_DEV_NAND
+       select PM_H1940 if PM
        select S3C2410_IOTIMING if S3C2440_CPUFREQ
        select S3C2440_XTAL_16934400
+       select S3C24XX_DCLK
+       select S3C24XX_PWM
+       select S3C_DEV_NAND
        help
           Say Y here if you're using HP iPAQ rx1950
 
index 06ca1cd4cae29a2f6db4485ec0316c47236676df..63e7ae3ee9e64267eb0f51c2ecf8e2bad46af999 100644 (file)
@@ -7,9 +7,9 @@
 config PLAT_S3C64XX
        bool
        depends on ARCH_S3C64XX
-       select SAMSUNG_WAKEMASK
-       select PM_GENERIC_DOMAINS
        default y
+       select PM_GENERIC_DOMAINS
+       select SAMSUNG_WAKEMASK
        help
          Base platform code for any Samsung S3C64XX device
 
@@ -31,8 +31,8 @@ config S3C64XX_DMA
        select S3C_DMA
 
 config S3C64XX_SETUP_SDHCI
-       select S3C64XX_SETUP_SDHCI_GPIO
        bool
+       select S3C64XX_SETUP_SDHCI_GPIO
        help
          Internal configuration for default SDHCI setup for S3C6400 and
          S3C6410 SoCs.
@@ -93,9 +93,9 @@ config S3C64XX_SETUP_USB_PHY
 config MACH_SMDK6400
        bool "SMDK6400"
        select CPU_S3C6400
+       select S3C64XX_SETUP_SDHCI
        select S3C_DEV_HSMMC
        select S3C_DEV_NAND
-       select S3C64XX_SETUP_SDHCI
        help
          Machine support for the Samsung SMDK6400
 
@@ -104,21 +104,21 @@ config MACH_SMDK6400
 config MACH_ANW6410
        bool "A&W6410"
        select CPU_S3C6410
-       select S3C_DEV_FB
        select S3C64XX_SETUP_FB_24BPP
+       select S3C_DEV_FB
        help
          Machine support for the A&W6410
 
 config MACH_MINI6410
        bool "MINI6410"
        select CPU_S3C6410
+       select S3C64XX_SETUP_FB_24BPP
+       select S3C64XX_SETUP_SDHCI
+       select S3C_DEV_FB
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
-       select S3C64XX_SETUP_SDHCI
-       select S3C_DEV_USB_HOST
        select S3C_DEV_NAND
-       select S3C_DEV_FB
-       select S3C64XX_SETUP_FB_24BPP
+       select S3C_DEV_USB_HOST
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_TS
        help
@@ -127,42 +127,42 @@ config MACH_MINI6410
 config MACH_REAL6410
        bool "REAL6410"
        select CPU_S3C6410
-       select S3C_DEV_HSMMC
-       select S3C_DEV_HSMMC1
+       select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_SDHCI
        select S3C_DEV_FB
-       select S3C64XX_SETUP_FB_24BPP
+       select S3C_DEV_HSMMC
+       select S3C_DEV_HSMMC1
        select S3C_DEV_NAND
+       select S3C_DEV_USB_HOST
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_TS
-       select S3C_DEV_USB_HOST
        help
          Machine support for the CoreWind REAL6410
 
 config MACH_SMDK6410
        bool "SMDK6410"
        select CPU_S3C6410
-       select SAMSUNG_DEV_ADC
+       select HAVE_S3C2410_WATCHDOG if WATCHDOG
+       select S3C64XX_SETUP_FB_24BPP
+       select S3C64XX_SETUP_I2C1
+       select S3C64XX_SETUP_IDE
+       select S3C64XX_SETUP_KEYPAD
+       select S3C64XX_SETUP_SDHCI
+       select S3C64XX_SETUP_USB_PHY
+       select S3C_DEV_FB
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_I2C1
-       select SAMSUNG_DEV_IDE
-       select S3C_DEV_FB
        select S3C_DEV_RTC
-       select SAMSUNG_DEV_TS
        select S3C_DEV_USB_HOST
        select S3C_DEV_USB_HSOTG
        select S3C_DEV_WDT
+       select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_BACKLIGHT
+       select SAMSUNG_DEV_IDE
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_PWM
-       select HAVE_S3C2410_WATCHDOG if WATCHDOG
-       select S3C64XX_SETUP_SDHCI
-       select S3C64XX_SETUP_I2C1
-       select S3C64XX_SETUP_IDE
-       select S3C64XX_SETUP_FB_24BPP
-       select S3C64XX_SETUP_KEYPAD
-       select S3C64XX_SETUP_USB_PHY
+       select SAMSUNG_DEV_TS
        help
          Machine support for the Samsung SMDK6410
 
@@ -198,13 +198,13 @@ endchoice
 config SMDK6410_WM1190_EV1
        bool "Support Wolfson Microelectronics 1190-EV1 PMIC card"
        depends on MACH_SMDK6410
-       select REGULATOR
-       select REGULATOR_WM8350
-       select SAMSUNG_GPIO_EXTRA64
-       select MFD_WM8350_I2C
        select MFD_WM8350_CONFIG_MODE_0
        select MFD_WM8350_CONFIG_MODE_3
+       select MFD_WM8350_I2C
        select MFD_WM8352_CONFIG_MODE_0
+       select REGULATOR
+       select REGULATOR_WM8350
+       select SAMSUNG_GPIO_EXTRA64
        help
          The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC
          and audio daughtercard for the Samsung SMDK6410 reference
@@ -216,11 +216,11 @@ config SMDK6410_WM1190_EV1
 config SMDK6410_WM1192_EV1
        bool "Support Wolfson Microelectronics 1192-EV1 PMIC card"
        depends on MACH_SMDK6410
+       select MFD_WM831X
+       select MFD_WM831X_I2C
        select REGULATOR
        select REGULATOR_WM831X
        select SAMSUNG_GPIO_EXTRA64
-       select MFD_WM831X
-       select MFD_WM831X_I2C
        help
          The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
          daughtercard for the Samsung SMDK6410 reference platform.
@@ -232,19 +232,19 @@ config SMDK6410_WM1192_EV1
 config MACH_NCP
        bool "NCP"
        select CPU_S3C6410
-       select S3C_DEV_I2C1
-       select S3C_DEV_HSMMC1
        select S3C64XX_SETUP_I2C1
+       select S3C_DEV_HSMMC1
+       select S3C_DEV_I2C1
        help
           Machine support for the Samsung NCP
 
 config MACH_HMT
        bool "Airgoo HMT"
        select CPU_S3C6410
+       select S3C64XX_SETUP_FB_24BPP
        select S3C_DEV_FB
        select S3C_DEV_NAND
        select S3C_DEV_USB_HOST
-       select S3C64XX_SETUP_FB_24BPP
        select SAMSUNG_DEV_PWM
        help
          Machine support for the Airgoo HMT
@@ -252,17 +252,17 @@ config MACH_HMT
 config MACH_SMARTQ
        bool
        select CPU_S3C6410
+       select S3C64XX_SETUP_FB_24BPP
+       select S3C64XX_SETUP_SDHCI
+       select S3C64XX_SETUP_USB_PHY
+       select S3C_DEV_FB
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
-       select S3C_DEV_FB
        select S3C_DEV_HWMON
        select S3C_DEV_RTC
-       select S3C_DEV_USB_HSOTG
        select S3C_DEV_USB_HOST
-       select S3C64XX_SETUP_SDHCI
-       select S3C64XX_SETUP_FB_24BPP
-       select S3C64XX_SETUP_USB_PHY
+       select S3C_DEV_USB_HSOTG
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
@@ -284,26 +284,26 @@ config MACH_SMARTQ7
 config MACH_WLF_CRAGG_6410
        bool "Wolfson Cragganmore 6410"
        select CPU_S3C6410
-       select S3C64XX_SETUP_SDHCI
+       select I2C
+       select LEDS_GPIO_REGISTER
+       select S3C64XX_DEV_SPI0
+       select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_I2C1
        select S3C64XX_SETUP_IDE
-       select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_KEYPAD
+       select S3C64XX_SETUP_SDHCI
        select S3C64XX_SETUP_SPI
        select S3C64XX_SETUP_USB_PHY
-       select SAMSUNG_DEV_ADC
-       select SAMSUNG_DEV_KEYPAD
-       select S3C_DEV_USB_HOST
-       select S3C_DEV_USB_HSOTG
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
        select S3C_DEV_I2C1
-       select S3C_DEV_WDT
        select S3C_DEV_RTC
-       select S3C64XX_DEV_SPI0
+       select S3C_DEV_USB_HOST
+       select S3C_DEV_USB_HSOTG
+       select S3C_DEV_WDT
+       select SAMSUNG_DEV_ADC
+       select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_GPIO_EXTRA128
-       select I2C
-       select LEDS_GPIO_REGISTER
        help
          Machine support for the Wolfson Cragganmore S3C6410 variant.
index c87f6108eeb1f6041fbf686979007dcdc7fce049..e8742cb7ddd955726d6c62637eae424c2a6924f5 100644 (file)
@@ -9,18 +9,18 @@ if ARCH_S5P64X0
 
 config CPU_S5P6440
        bool
-       select SAMSUNG_DMADEV
        select S5P_HRT
        select S5P_SLEEP if PM
+       select SAMSUNG_DMADEV
        select SAMSUNG_WAKEMASK if PM
        help
          Enable S5P6440 CPU support
 
 config CPU_S5P6450
        bool
-       select SAMSUNG_DMADEV
        select S5P_HRT
        select S5P_SLEEP if PM
+       select SAMSUNG_DMADEV
        select SAMSUNG_WAKEMASK if PM
        help
          Enable S5P6450 CPU support
@@ -52,19 +52,19 @@ config MACH_SMDK6440
        bool "SMDK6440"
        select CPU_S5P6440
        select S3C_DEV_FB
-       select S3C_DEV_I2C1
-       select S3C_DEV_RTC
-       select S3C_DEV_WDT
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
+       select S3C_DEV_I2C1
+       select S3C_DEV_RTC
+       select S3C_DEV_WDT
+       select S5P64X0_SETUP_FB_24BPP
+       select S5P64X0_SETUP_I2C1
+       select S5P64X0_SETUP_SDHCI_GPIO
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
-       select S5P64X0_SETUP_FB_24BPP
-       select S5P64X0_SETUP_I2C1
-       select S5P64X0_SETUP_SDHCI_GPIO
        help
          Machine support for the Samsung SMDK6440
 
@@ -72,19 +72,19 @@ config MACH_SMDK6450
        bool "SMDK6450"
        select CPU_S5P6450
        select S3C_DEV_FB
-       select S3C_DEV_I2C1
-       select S3C_DEV_RTC
-       select S3C_DEV_WDT
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
+       select S3C_DEV_I2C1
+       select S3C_DEV_RTC
+       select S3C_DEV_WDT
+       select S5P64X0_SETUP_FB_24BPP
+       select S5P64X0_SETUP_I2C1
+       select S5P64X0_SETUP_SDHCI_GPIO
        select SAMSUNG_DEV_ADC
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
-       select S5P64X0_SETUP_FB_24BPP
-       select S5P64X0_SETUP_I2C1
-       select S5P64X0_SETUP_SDHCI_GPIO
        help
          Machine support for the Samsung SMDK6450
 
index 75a26eaf26334d9e0abf65131fda20e5e0cb2204..15170be97a74c0ecc69dd481d087205912095837 100644 (file)
@@ -60,12 +60,6 @@ config MACH_SMDKC100
        select S3C_DEV_I2C1
        select S3C_DEV_RTC
        select S3C_DEV_WDT
-       select SAMSUNG_DEV_ADC
-       select SAMSUNG_DEV_BACKLIGHT
-       select SAMSUNG_DEV_IDE
-       select SAMSUNG_DEV_KEYPAD
-       select SAMSUNG_DEV_PWM
-       select SAMSUNG_DEV_TS
        select S5PC100_SETUP_FB_24BPP
        select S5PC100_SETUP_I2C1
        select S5PC100_SETUP_IDE
@@ -74,6 +68,12 @@ config MACH_SMDKC100
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
+       select SAMSUNG_DEV_ADC
+       select SAMSUNG_DEV_BACKLIGHT
+       select SAMSUNG_DEV_IDE
+       select SAMSUNG_DEV_KEYPAD
+       select SAMSUNG_DEV_PWM
+       select SAMSUNG_DEV_TS
        help
          Machine support for the Samsung SMDKC100
 
index 77185c38188bc313366d43847c0b1f7ad3164984..92ad72f0ef980ea836c2a38ca7ffde7262b358c8 100644 (file)
@@ -11,11 +11,11 @@ if ARCH_S5PV210
 
 config CPU_S5PV210
        bool
-       select SAMSUNG_DMADEV
        select S5P_EXT_INT
        select S5P_HRT
        select S5P_PM if PM
        select S5P_SLEEP if PM
+       select SAMSUNG_DMADEV
        help
          Enable S5PV210 CPU support
 
@@ -76,44 +76,44 @@ config MACH_AQUILA
        bool "Aquila"
        select CPU_S5PV210
        select S3C_DEV_FB
-       select S5P_DEV_FIMC0
-       select S5P_DEV_FIMC1
-       select S5P_DEV_FIMC2
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
-       select S5P_DEV_ONENAND
        select S5PV210_SETUP_FB_24BPP
        select S5PV210_SETUP_SDHCI
        select S5PV210_SETUP_USB_PHY
+       select S5P_DEV_FIMC0
+       select S5P_DEV_FIMC1
+       select S5P_DEV_FIMC2
+       select S5P_DEV_ONENAND
        help
          Machine support for the Samsung Aquila target based on S5PC110 SoC
 
 config MACH_GONI
        bool "GONI"
        select CPU_S5PV210
-       select S5P_GPIO_INT
        select S3C_DEV_FB
-       select S5P_DEV_FIMC0
-       select S5P_DEV_FIMC1
-       select S5P_DEV_FIMC2
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
        select S3C_DEV_I2C1
        select S3C_DEV_I2C2
-       select S5P_DEV_MFC
        select S3C_DEV_USB_HSOTG
-       select S5P_DEV_ONENAND
-       select SAMSUNG_DEV_KEYPAD
-       select S5P_DEV_TV
        select S5PV210_SETUP_FB_24BPP
+       select S5PV210_SETUP_FIMC
        select S5PV210_SETUP_I2C1
        select S5PV210_SETUP_I2C2
        select S5PV210_SETUP_KEYPAD
        select S5PV210_SETUP_SDHCI
-       select S5PV210_SETUP_FIMC
        select S5PV210_SETUP_USB_PHY
+       select S5P_DEV_FIMC0
+       select S5P_DEV_FIMC1
+       select S5P_DEV_FIMC2
+       select S5P_DEV_MFC
+       select S5P_DEV_ONENAND
+       select S5P_DEV_TV
+       select S5P_GPIO_INT
+       select SAMSUNG_DEV_KEYPAD
        help
          Machine support for Samsung GONI board
          S5PC110(MCP) is one of package option of S5PV210
@@ -125,14 +125,14 @@ config MACH_SMDKC110
        select S3C_DEV_I2C2
        select S3C_DEV_RTC
        select S3C_DEV_WDT
+       select S5PV210_SETUP_I2C1
+       select S5PV210_SETUP_I2C2
+       select S5PV210_SETUP_IDE
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_MFC
        select SAMSUNG_DEV_IDE
-       select S5PV210_SETUP_I2C1
-       select S5PV210_SETUP_I2C2
-       select S5PV210_SETUP_IDE
        help
          Machine support for Samsung SMDKC110
          S5PC110(MCP) is one of package option of S5PV210
@@ -154,6 +154,13 @@ config MACH_SMDKV210
        select S3C_DEV_RTC
        select S3C_DEV_USB_HSOTG
        select S3C_DEV_WDT
+       select S5PV210_SETUP_FB_24BPP
+       select S5PV210_SETUP_I2C1
+       select S5PV210_SETUP_I2C2
+       select S5PV210_SETUP_IDE
+       select S5PV210_SETUP_KEYPAD
+       select S5PV210_SETUP_SDHCI
+       select S5PV210_SETUP_USB_PHY
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
@@ -165,20 +172,13 @@ config MACH_SMDKV210
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
-       select S5PV210_SETUP_FB_24BPP
-       select S5PV210_SETUP_I2C1
-       select S5PV210_SETUP_I2C2
-       select S5PV210_SETUP_IDE
-       select S5PV210_SETUP_KEYPAD
-       select S5PV210_SETUP_SDHCI
-       select S5PV210_SETUP_USB_PHY
        help
          Machine support for Samsung SMDKV210
 
 config MACH_TORBRECK
        bool "Torbreck"
-       select CPU_S5PV210
        select ARCH_SPARSEMEM_ENABLE
+       select CPU_S5PV210
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC1
        select S3C_DEV_HSMMC2
index 42625e4d949a143f828ba96c155754f422aa0d65..ca14dbdcfb222df027713bc2eac93ae7ac6d3e2b 100644 (file)
@@ -49,15 +49,15 @@ config SA1100_COLLIE
        bool "Sharp Zaurus SL5500"
        # FIXME: select CPU_FREQ_SA11x0
        select SHARP_LOCOMO
-       select SHARP_SCOOP
        select SHARP_PARAM
+       select SHARP_SCOOP
        help
          Say Y here to support the Sharp Zaurus SL5500 PDAs.
 
 config SA1100_H3100
        bool "Compaq iPAQ H3100"
-       select HTC_EGPIO
        select CPU_FREQ_SA1110
+       select HTC_EGPIO
        help
          Say Y here if you intend to run this kernel on the Compaq iPAQ
          H3100 handheld computer.  Information about this machine and the
@@ -67,8 +67,8 @@ config SA1100_H3100
 
 config SA1100_H3600
        bool "Compaq iPAQ H3600/H3700"
-       select HTC_EGPIO
        select CPU_FREQ_SA1110
+       select HTC_EGPIO
        help
          Say Y here if you intend to run this kernel on the Compaq iPAQ
          H3600 handheld computer.  Information about this machine and the
@@ -78,16 +78,16 @@ config SA1100_H3600
 
 config SA1100_BADGE4
        bool "HP Labs BadgePAD 4"
-       select SA1111
        select CPU_FREQ_SA1100
+       select SA1111
        help
          Say Y here if you want to build a kernel for the HP Laboratories
          BadgePAD 4.
 
 config SA1100_JORNADA720
        bool "HP Jornada 720"
-       select SA1111
        # FIXME: select CPU_FREQ_SA11x0
+       select SA1111
        help
          Say Y here if you want to build a kernel for the HP Jornada 720
          handheld computer.  See 
@@ -95,8 +95,8 @@ config SA1100_JORNADA720
 
 config SA1100_JORNADA720_SSP
        bool "HP Jornada 720 Extended SSP driver"
-       select SA1100_SSP
        depends on SA1100_JORNADA720
+       select SA1100_SSP
        help
          Say Y here if you have a HP Jornada 7xx handheld computer and you
          want to access devices connected to the MCU. Those include the
index 4cacc2d22fbeb78b483d4510f4e0eb7a880ef757..8ae100cc655c12c3cc23d3beb676c0ab9e2c8cfa 100644 (file)
@@ -4,49 +4,49 @@ comment "SH-Mobile System Type"
 
 config ARCH_SH7367
        bool "SH-Mobile G3 (SH7367)"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select CPU_V6
        select SH_CLK_CPG
-       select ARCH_WANT_OPTIONAL_GPIOLIB
 
 config ARCH_SH7377
        bool "SH-Mobile G4 (SH7377)"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select CPU_V7
        select SH_CLK_CPG
-       select ARCH_WANT_OPTIONAL_GPIOLIB
 
 config ARCH_SH7372
        bool "SH-Mobile AP4 (SH7372)"
-       select CPU_V7
-       select SH_CLK_CPG
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_CPU_SUSPEND if PM || CPU_IDLE
+       select CPU_V7
+       select SH_CLK_CPG
 
 config ARCH_SH73A0
        bool "SH-Mobile AG5 (R8A73A00)"
-       select CPU_V7
-       select SH_CLK_CPG
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_GIC
+       select CPU_V7
        select I2C
+       select SH_CLK_CPG
 
 config ARCH_R8A7740
        bool "R-Mobile A1 (R8A77400)"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select CPU_V7
        select SH_CLK_CPG
-       select ARCH_WANT_OPTIONAL_GPIOLIB
 
 config ARCH_R8A7779
        bool "R-Car H1 (R8A77790)"
+       select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARM_GIC
        select CPU_V7
        select SH_CLK_CPG
-       select ARM_GIC
-       select ARCH_WANT_OPTIONAL_GPIOLIB
 
 config ARCH_EMEV2
        bool "Emma Mobile EV2"
-       select CPU_V7
-       select ARM_GIC
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARM_GIC
+       select CPU_V7
 
 comment "SH-Mobile Board Type"
 
@@ -65,9 +65,9 @@ config MACH_AP4EVB
        bool "AP4EVB board"
        depends on ARCH_SH7372
        select ARCH_REQUIRE_GPIOLIB
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select SH_LCD_MIPI_DSI
        select SND_SOC_AK4642 if SND_SIMPLE_CARD
-       select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
 choice
        prompt "AP4EVB LCD panel selection"
@@ -84,37 +84,37 @@ endchoice
 
 config MACH_AG5EVM
        bool "AG5EVM board"
+       depends on ARCH_SH73A0
        select ARCH_REQUIRE_GPIOLIB
-       select SH_LCD_MIPI_DSI
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       depends on ARCH_SH73A0
+       select SH_LCD_MIPI_DSI
 
 config MACH_MACKEREL
        bool "mackerel board"
        depends on ARCH_SH7372
        select ARCH_REQUIRE_GPIOLIB
-       select SND_SOC_AK4642 if SND_SIMPLE_CARD
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select SND_SOC_AK4642 if SND_SIMPLE_CARD
 
 config MACH_KOTA2
        bool "KOTA2 board"
+       depends on ARCH_SH73A0
        select ARCH_REQUIRE_GPIOLIB
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       depends on ARCH_SH73A0
 
 config MACH_BONITO
        bool "bonito board"
+       depends on ARCH_R8A7740
        select ARCH_REQUIRE_GPIOLIB
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       depends on ARCH_R8A7740
 
 config MACH_ARMADILLO800EVA
        bool "Armadillo-800 EVA board"
        depends on ARCH_R8A7740
        select ARCH_REQUIRE_GPIOLIB
-       select USE_OF
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select SND_SOC_WM8978 if SND_SIMPLE_CARD
+       select USE_OF
 
 config MACH_MARZEN
        bool "MARZEN board"
@@ -125,16 +125,16 @@ config MACH_MARZEN
 config MACH_KZM9D
        bool "KZM9D board"
        depends on ARCH_EMEV2
-       select USE_OF
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select USE_OF
 
 config MACH_KZM9G
        bool "KZM-A9-GT board"
        depends on ARCH_SH73A0
        select ARCH_REQUIRE_GPIOLIB
-       select USE_OF
-       select SND_SOC_AK4642 if SND_SIMPLE_CARD
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select SND_SOC_AK4642 if SND_SIMPLE_CARD
+       select USE_OF
 
 comment "SH-Mobile System Configuration"
 
index 11680c532b383f302e4229446856fdb018935510..9ff6f6ea3617a4ed29dd19b0349a21e5715c38d6 100644 (file)
@@ -4,42 +4,42 @@ comment "NVIDIA Tegra options"
 
 config ARCH_TEGRA_2x_SOC
        bool "Enable support for Tegra20 family"
-       select CPU_V7
-       select ARM_GIC
        select ARCH_REQUIRE_GPIOLIB
-       select PINCTRL
-       select PINCTRL_TEGRA20
-       select USB_ARCH_HAS_EHCI if USB_SUPPORT
-       select USB_ULPI if USB
-       select USB_ULPI_VIEWPORT if USB_SUPPORT
        select ARM_ERRATA_720789
        select ARM_ERRATA_742230
        select ARM_ERRATA_751472
        select ARM_ERRATA_754327
        select ARM_ERRATA_764369 if SMP
+       select ARM_GIC
+       select CPU_FREQ_TABLE if CPU_FREQ
+       select CPU_V7
+       select PINCTRL
+       select PINCTRL_TEGRA20
        select PL310_ERRATA_727915 if CACHE_L2X0
        select PL310_ERRATA_769419 if CACHE_L2X0
-       select CPU_FREQ_TABLE if CPU_FREQ
+       select USB_ARCH_HAS_EHCI if USB_SUPPORT
+       select USB_ULPI if USB
+       select USB_ULPI_VIEWPORT if USB_SUPPORT
        help
          Support for NVIDIA Tegra AP20 and T20 processors, based on the
          ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
 
 config ARCH_TEGRA_3x_SOC
        bool "Enable support for Tegra30 family"
-       select CPU_V7
-       select ARM_GIC
        select ARCH_REQUIRE_GPIOLIB
-       select PINCTRL
-       select PINCTRL_TEGRA30
-       select USB_ARCH_HAS_EHCI if USB_SUPPORT
-       select USB_ULPI if USB
-       select USB_ULPI_VIEWPORT if USB_SUPPORT
        select ARM_ERRATA_743622
        select ARM_ERRATA_751472
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
-       select PL310_ERRATA_769419 if CACHE_L2X0
+       select ARM_GIC
        select CPU_FREQ_TABLE if CPU_FREQ
+       select CPU_V7
+       select PINCTRL
+       select PINCTRL_TEGRA30
+       select PL310_ERRATA_769419 if CACHE_L2X0
+       select USB_ARCH_HAS_EHCI if USB_SUPPORT
+       select USB_ULPI if USB
+       select USB_ULPI_VIEWPORT if USB_SUPPORT
        help
          Support for NVIDIA Tegra T30 processor family, based on the
          ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
index f7e12ede008c11e564415cd4047045ec14a011ef..1f597647d431be82d88bb62f79d6b938ec8b18c1 100644 (file)
@@ -7,8 +7,8 @@ comment "ST-Ericsson Mobile Platform Products"
 config MACH_U300
        bool "U300"
        select PINCTRL
-       select PINCTRL_U300
        select PINCTRL_COH901
+       select PINCTRL_U300
 
 comment "ST-Ericsson U300/U335 Feature Selections"
 
index 5848206ee9b9d02c62d1f0a558f0b8ba8c70596a..e8c3f0d70ca66efa50d71bba32c462829148df4d 100644 (file)
@@ -3,33 +3,33 @@ if ARCH_U8500
 config UX500_SOC_COMMON
        bool
        default y
-       select ARM_GIC
-       select HAS_MTU
-       select PL310_ERRATA_753970 if CACHE_PL310
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
+       select ARM_GIC
        select CACHE_L2X0
+       select COMMON_CLK
+       select HAS_MTU
        select PINCTRL
        select PINCTRL_NOMADIK
-       select COMMON_CLK
+       select PL310_ERRATA_753970 if CACHE_PL310
 
 config UX500_SOC_DB8500
        bool
+       select CPU_FREQ_TABLE if CPU_FREQ
        select MFD_DB8500_PRCMU
+       select PINCTRL_DB8500
        select REGULATOR
        select REGULATOR_DB8500_PRCMU
-       select CPU_FREQ_TABLE if CPU_FREQ
-       select PINCTRL_DB8500
 
 menu "Ux500 target platform (boards)"
 
 config MACH_MOP500
        bool "U8500 Development platform, MOP500 versions"
-       select UX500_SOC_DB8500
        select I2C
        select I2C_NOMADIK
-       select SOC_BUS
        select REGULATOR_FIXED_VOLTAGE
+       select SOC_BUS
+       select UX500_SOC_DB8500
        help
          Include support for the MOP500 development platform.
 
index c1f38f6625b21a22dc4b620bae6838901b7eb97b..63d8e9f81b99aa73970c9985dd657ec4a42705a9 100644 (file)
@@ -3,9 +3,9 @@ menu "Versatile platform type"
 
 config ARCH_VERSATILE_PB
        bool "Support Versatile Platform Baseboard for ARM926EJ-S"
+       default y
        select CPU_ARM926T
        select MIGHT_HAVE_PCI
-       default y
        help
          Include support for the ARM(R) Versatile Platform Baseboard
          for the ARM926EJ-S.
@@ -19,8 +19,8 @@ config MACH_VERSATILE_AB
 
 config MACH_VERSATILE_DT
        bool "Support Versatile platform from device tree"
-       select USE_OF
        select CPU_ARM926T
+       select USE_OF
        help
          Include support for the ARM(R) Versatile/PB platform,
          using the device tree for discovery
index c9a4963b5c3d3363210a53d11cc55d63d77965fd..94186b6c685fbecf6f84514885b1e5acee68cf8e 100644 (file)
@@ -10,8 +10,8 @@ config CPU_ARM7TDMI
        depends on !MMU
        select CPU_32v4T
        select CPU_ABRT_LV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4
+       select CPU_PABRT_LEGACY
        help
          A 32-bit RISC microprocessor based on the ARM7 processor core
          which has no memory control unit and cache.
@@ -24,11 +24,11 @@ config CPU_ARM720T
        bool "Support ARM720T processor" if ARCH_INTEGRATOR
        select CPU_32v4T
        select CPU_ABRT_LV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WT if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WT if MMU
        help
          A 32-bit RISC processor with 8kByte Cache, Write Buffer and
@@ -43,9 +43,9 @@ config CPU_ARM740T
        depends on !MMU
        select CPU_32v4T
        select CPU_ABRT_LV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V3     # although the core is v4t
        select CPU_CP15_MPU
+       select CPU_PABRT_LEGACY
        help
          A 32-bit RISC processor with 8KB cache or 4KB variants,
          write buffer and MPU(Protection Unit) built around
@@ -60,8 +60,8 @@ config CPU_ARM9TDMI
        depends on !MMU
        select CPU_32v4T
        select CPU_ABRT_NOMMU
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4
+       select CPU_PABRT_LEGACY
        help
          A 32-bit RISC microprocessor based on the ARM9 processor core
          which has no memory control unit and cache.
@@ -74,11 +74,11 @@ config CPU_ARM920T
        bool "Support ARM920T processor" if ARCH_INTEGRATOR
        select CPU_32v4T
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM920T is licensed to be produced by numerous vendors,
@@ -92,11 +92,11 @@ config CPU_ARM922T
        bool "Support ARM922T processor" if ARCH_INTEGRATOR
        select CPU_32v4T
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM922T is a version of the ARM920T, but with smaller
@@ -111,11 +111,11 @@ config CPU_ARM925T
        bool "Support ARM925T processor" if ARCH_OMAP1
        select CPU_32v4T
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM925T is a mix between the ARM920T and ARM926T, but with
@@ -130,10 +130,10 @@ config CPU_ARM926T
        bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
        select CPU_32v5
        select CPU_ABRT_EV5TJ
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          This is a variant of the ARM920.  It has slightly different
@@ -148,11 +148,11 @@ config CPU_FA526
        bool
        select CPU_32v4
        select CPU_ABRT_EV4
-       select CPU_PABRT_LEGACY
-       select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_CACHE_FA
+       select CPU_CACHE_VIVT
        select CPU_COPY_FA if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_FA if MMU
        help
          The FA526 is a version of the ARMv4 compatible processor with
@@ -167,9 +167,9 @@ config CPU_ARM940T
        depends on !MMU
        select CPU_32v4T
        select CPU_ABRT_NOMMU
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
        select CPU_CP15_MPU
+       select CPU_PABRT_LEGACY
        help
          ARM940T is a member of the ARM9TDMI family of general-
          purpose microprocessors with MPU and separate 4KB
@@ -185,9 +185,9 @@ config CPU_ARM946E
        depends on !MMU
        select CPU_32v5
        select CPU_ABRT_NOMMU
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
        select CPU_CP15_MPU
+       select CPU_PABRT_LEGACY
        help
          ARM946E-S is a member of the ARM9E-S family of high-
          performance, 32-bit system-on-chip processor solutions.
@@ -201,11 +201,11 @@ config CPU_ARM1020
        bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM1020 is the 32K cached version of the ARM10 processor,
@@ -217,25 +217,25 @@ config CPU_ARM1020
 # ARM1020E - needs validating
 config CPU_ARM1020E
        bool "Support ARM1020E processor" if ARCH_INTEGRATOR
+       depends on n
        select CPU_32v5
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
-       depends on n
 
 # ARM1022E
 config CPU_ARM1022
        bool "Support ARM1022E processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU # can probably do better
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM1022E is an implementation of the ARMv5TE architecture
@@ -250,10 +250,10 @@ config CPU_ARM1026
        bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU # can probably do better
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        help
          The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture
@@ -268,11 +268,11 @@ config CPU_SA110
        select CPU_32v3 if ARCH_RPC
        select CPU_32v4 if !ARCH_RPC
        select CPU_ABRT_EV4
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WB
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WB if MMU
        help
          The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and
@@ -288,10 +288,10 @@ config CPU_SA1100
        bool
        select CPU_32v4
        select CPU_ABRT_EV4
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_V4WB
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WB if MMU
 
 # XScale
@@ -299,9 +299,9 @@ config CPU_XSCALE
        bool
        select CPU_32v5
        select CPU_ABRT_EV5T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
 
 # XScale Core Version 3
@@ -309,9 +309,9 @@ config CPU_XSC3
        bool
        select CPU_32v5
        select CPU_ABRT_EV5T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
        select IO_36
 
@@ -320,21 +320,21 @@ config CPU_MOHAWK
        bool
        select CPU_32v5
        select CPU_ABRT_EV5T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
+       select CPU_COPY_V4WB if MMU
        select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_V4WBI if MMU
-       select CPU_COPY_V4WB if MMU
 
 # Feroceon
 config CPU_FEROCEON
        bool
        select CPU_32v5
        select CPU_ABRT_EV5T
-       select CPU_PABRT_LEGACY
        select CPU_CACHE_VIVT
-       select CPU_CP15_MMU
        select CPU_COPY_FEROCEON if MMU
+       select CPU_CP15_MMU
+       select CPU_PABRT_LEGACY
        select CPU_TLB_FEROCEON if MMU
 
 config CPU_FEROCEON_OLD_ID
@@ -349,20 +349,20 @@ config CPU_FEROCEON_OLD_ID
 # Marvell PJ4
 config CPU_PJ4
        bool
-       select CPU_V7
        select ARM_THUMBEE
+       select CPU_V7
 
 # ARMv6
 config CPU_V6
        bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
        select CPU_32v6
        select CPU_ABRT_EV6
-       select CPU_PABRT_V6
        select CPU_CACHE_V6
        select CPU_CACHE_VIPT
+       select CPU_COPY_V6 if MMU
        select CPU_CP15_MMU
        select CPU_HAS_ASID if MMU
-       select CPU_COPY_V6 if MMU
+       select CPU_PABRT_V6
        select CPU_TLB_V6 if MMU
 
 # ARMv6k
@@ -371,12 +371,12 @@ config CPU_V6K
        select CPU_32v6
        select CPU_32v6K
        select CPU_ABRT_EV6
-       select CPU_PABRT_V6
        select CPU_CACHE_V6
        select CPU_CACHE_VIPT
+       select CPU_COPY_V6 if MMU
        select CPU_CP15_MMU
        select CPU_HAS_ASID if MMU
-       select CPU_COPY_V6 if MMU
+       select CPU_PABRT_V6
        select CPU_TLB_V6 if MMU
 
 # ARMv7
@@ -385,44 +385,44 @@ config CPU_V7
        select CPU_32v6K
        select CPU_32v7
        select CPU_ABRT_EV7
-       select CPU_PABRT_V7
        select CPU_CACHE_V7
        select CPU_CACHE_VIPT
+       select CPU_COPY_V6 if MMU
        select CPU_CP15_MMU
        select CPU_HAS_ASID if MMU
-       select CPU_COPY_V6 if MMU
+       select CPU_PABRT_V7
        select CPU_TLB_V7 if MMU
 
 # Figure out what processor architecture version we should be using.
 # This defines the compiler instruction set which depends on the machine type.
 config CPU_32v3
        bool
-       select TLS_REG_EMUL if SMP || !MMU
-       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
        select CPU_USE_DOMAINS if MMU
+       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
+       select TLS_REG_EMUL if SMP || !MMU
 
 config CPU_32v4
        bool
-       select TLS_REG_EMUL if SMP || !MMU
-       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
        select CPU_USE_DOMAINS if MMU
+       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
+       select TLS_REG_EMUL if SMP || !MMU
 
 config CPU_32v4T
        bool
-       select TLS_REG_EMUL if SMP || !MMU
-       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
        select CPU_USE_DOMAINS if MMU
+       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
+       select TLS_REG_EMUL if SMP || !MMU
 
 config CPU_32v5
        bool
-       select TLS_REG_EMUL if SMP || !MMU
-       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
        select CPU_USE_DOMAINS if MMU
+       select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
+       select TLS_REG_EMUL if SMP || !MMU
 
 config CPU_32v6
        bool
-       select TLS_REG_EMUL if !CPU_32v6K && !MMU
        select CPU_USE_DOMAINS if CPU_V6 && MMU
+       select TLS_REG_EMUL if !CPU_32v6K && !MMU
 
 config CPU_32v6K
        bool
@@ -644,8 +644,8 @@ config ARM_VIRT_EXT
 config SWP_EMULATE
        bool "Emulate SWP/SWPB instructions"
        depends on !CPU_USE_DOMAINS && CPU_V7
-       select HAVE_PROC_CPU if PROC_FS
        default y if SMP
+       select HAVE_PROC_CPU if PROC_FS
        help
          ARMv6 architecture deprecates use of the SWP/SWPB instructions.
          ARMv7 multiprocessing extensions introduce the ability to disable
index baf9064c0844bcafef399f943209a570dc34ceec..88e1e2e7a20d155edd48a1c12b12629fdfdbd86b 100644 (file)
@@ -10,16 +10,16 @@ choice
 
 config ARCH_IMX_V4_V5
        bool "i.MX1, i.MX21, i.MX25, i.MX27"
-       select AUTO_ZRELADDR if !ZBOOT_ROM
        select ARM_PATCH_PHYS_VIRT
+       select AUTO_ZRELADDR if !ZBOOT_ROM
        help
          This enables support for systems based on the Freescale i.MX ARMv4
          and ARMv5 SoCs
 
 config ARCH_IMX_V6_V7
        bool "i.MX3, i.MX5, i.MX6"
-       select AUTO_ZRELADDR if !ZBOOT_ROM
        select ARM_PATCH_PHYS_VIRT
+       select AUTO_ZRELADDR if !ZBOOT_ROM
        select MIGHT_HAVE_CACHE_L2X0
        help
          This enables support for systems based on the Freescale i.MX3, i.MX5
index 6b46cee2f9cd45ec5d6536ef9cfe5611a5962850..a35d9841f494ee4e5f5de92a52664e438b6ba7cd 100644 (file)
@@ -3,8 +3,8 @@ config IMX_HAVE_PLATFORM_FEC
        default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX50 || SOC_IMX51 || SOC_IMX53
 
 config IMX_HAVE_PLATFORM_FLEXCAN
-       select HAVE_CAN_FLEXCAN if CAN
        bool
+       select HAVE_CAN_FLEXCAN if CAN
 
 config IMX_HAVE_PLATFORM_FSL_USB2_UDC
        bool
index 4c48c8b60b54e4672a0ff10c85d4a6fe93c9d8d6..19f55cae5d73a4e696abb26c25d1f31ba2013c42 100644 (file)
@@ -5,8 +5,8 @@
 config PLAT_NOMADIK
        bool
        depends on ARCH_NOMADIK || ARCH_U8500
-       select CLKSRC_MMIO
        default y
+       select CLKSRC_MMIO
        help
          Common platform code for Nomadik and other ST-Ericsson
          platforms.
index c9d1c3603bbff9c5b42c2c0c304bba1cf35be766..7cd56ed5cd949b25c0ae4ad02729241006b42783 100644 (file)
@@ -14,10 +14,10 @@ config ARCH_OMAP1
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_IRQ_CHIP
-       select IRQ_DOMAIN
        select HAVE_IDE
-       select NEED_MACH_MEMORY_H
+       select IRQ_DOMAIN
        select NEED_MACH_IO_H if PCCARD
+       select NEED_MACH_MEMORY_H
        help
          "Systems based on omap7xx, omap15xx or omap16xx"
 
@@ -25,10 +25,10 @@ config ARCH_OMAP2PLUS
        bool "TI OMAP2/3/4"
        select CLKDEV_LOOKUP
        select GENERIC_IRQ_CHIP
-       select SPARSE_IRQ
        select OMAP_DM_TIMER
-       select USE_OF
        select PROC_DEVICETREE if PROC_FS
+       select SPARSE_IRQ
+       select USE_OF
        help
          "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5"
 
@@ -43,8 +43,8 @@ config OMAP_DEBUG_DEVICES
 
 config OMAP_DEBUG_LEDS
        def_bool y if NEW_LEDS
-       select LEDS_CLASS
        depends on OMAP_DEBUG_DEVICES
+       select LEDS_CLASS
 
 config POWER_AVS_OMAP
        bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2"
index 21bf6adb9198949422b50e831e08a5dcc084952b..eef3b6a2f8a82c2917d5e41ec465800cb1333858 100644 (file)
@@ -6,8 +6,8 @@ config PLAT_S3C24XX
        bool
        depends on ARCH_S3C24XX
        default y
-       select NO_IOPORT
        select ARCH_REQUIRE_GPIOLIB
+       select NO_IOPORT
        select S3C_DEV_NAND
        help
          Base platform code for any Samsung S3C24XX device
index 9c3b90c3538e3b71bb1e71c8c8bf817ca5057a89..59401e1cc530a5e6501905c29168b2ec20cb14fd 100644 (file)
@@ -7,9 +7,9 @@
 config PLAT_SAMSUNG
        bool
        depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P
-       select NO_IOPORT
-       select GENERIC_IRQ_CHIP
        default y
+       select GENERIC_IRQ_CHIP
+       select NO_IOPORT
        help
          Base platform code for all Samsung SoC based systems
 
@@ -17,16 +17,16 @@ config PLAT_S5P
        bool
        depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
        default y
-       select ARM_VIC if !ARCH_EXYNOS
+       select ARCH_REQUIRE_GPIOLIB
        select ARM_GIC if ARCH_EXYNOS
+       select ARM_VIC if !ARCH_EXYNOS
        select GIC_NON_BANKED if ARCH_EXYNOS4
        select NO_IOPORT
-       select ARCH_REQUIRE_GPIOLIB
+       select PLAT_SAMSUNG
        select S3C_GPIO_TRACK
        select S5P_GPIO_DRVSTR
-       select SAMSUNG_GPIOLIB_4BIT
-       select PLAT_SAMSUNG
        select SAMSUNG_CLKSRC
+       select SAMSUNG_GPIOLIB_4BIT
        select SAMSUNG_IRQ_VIC_TIMER
        help
          Base platform code for Samsung's S5P series SoC.
@@ -423,10 +423,10 @@ config S3C_DMA
 
 config SAMSUNG_DMADEV
        bool
+       select ARM_AMBA
        select DMADEVICES
        select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \
                                        CPU_S5P6450 || CPU_S5P6440)
-       select ARM_AMBA
        help
          Use DMA device engine for PL330 DMAC.
 
index 4404f82d59793d1227e2c6c0474941801b36807f..f8db7b2deb36ea7f4b11e399adf6131831a38b6e 100644 (file)
@@ -12,10 +12,10 @@ config ARCH_SPEAR13XX
        bool "ST SPEAr13xx with Device Tree"
        select ARM_GIC
        select CPU_V7
-       select USE_OF
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        select PINCTRL
+       select USE_OF
        help
          Supports for ARM's SPEAR13XX family
 
@@ -23,8 +23,8 @@ config ARCH_SPEAR3XX
        bool "ST SPEAr3xx with Device Tree"
        select ARM_VIC
        select CPU_ARM926T
-       select USE_OF
        select PINCTRL
+       select USE_OF
        help
          Supports for ARM's SPEAR3XX family
 
index 5ade51c8a87fbf5cd99d319ddbe55feef8fbe6c7..06e73bf665e92cba042590dbe68a50a463d50f76 100644 (file)
@@ -15,6 +15,8 @@ config AVR32
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_CLOCKEVENTS
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        help
          AVR32 is a high-performance 32-bit RISC microprocessor core,
          designed for cost-sensitive embedded applications, with particular
index 451444538a1b06d2121c40bcc81d6b08a8cc3427..3f083d385a64e43a6b16b6d2bff73df37a21e024 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_AVR32_MODULE_H
 #define __ASM_AVR32_MODULE_H
 
+#include <asm-generic/module.h>
+
 struct mod_arch_syminfo {
        unsigned long got_offset;
        int got_initialized;
@@ -17,10 +19,6 @@ struct mod_arch_specific {
        struct mod_arch_syminfo *syminfo;
 };
 
-#define Elf_Shdr               Elf32_Shdr
-#define Elf_Sym                        Elf32_Sym
-#define Elf_Ehdr               Elf32_Ehdr
-
 #define MODULE_PROC_FAMILY "AVR32v1"
 
 #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
index ccd9193932b28cd4eeb003f1eaaf1cdc68743717..b6f3ad5441c5f33f27c44850ca8d19c9898001b7 100644 (file)
@@ -43,6 +43,8 @@ config BLACKFIN
        select HAVE_NMI_WATCHDOG if NMI_WATCHDOG
        select GENERIC_SMP_IDLE_THREAD
        select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
 
 config GENERIC_CSUM
        def_bool y
index ed5689b82c9fefa7edc3303136a14a6edba2d13d..231a149b3f77df96eb59fb8dcc0eda22449d614d 100644 (file)
@@ -7,9 +7,7 @@
 #ifndef _ASM_BFIN_MODULE_H
 #define _ASM_BFIN_MODULE_H
 
-#define Elf_Shdr        Elf32_Shdr
-#define Elf_Sym         Elf32_Sym
-#define Elf_Ehdr        Elf32_Ehdr
+#include <asm-generic/module.h>
 
 struct mod_arch_specific {
        Elf_Shdr        *text_l1;
index 45268b50c0c88907e09a738a3d60f55c4ac2afe5..aee1b569ee6e56c5aa8fa1ee609e91dcff6632f9 100644 (file)
@@ -18,6 +18,7 @@ config C6X
        select OF_EARLY_FLATTREE
        select GENERIC_CLOCKEVENTS
        select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
 
 config MMU
        def_bool n
index a453f9744f42aa0269e1512589a798ee38815d6d..5c7269c7ef73f72f8939af4ee23d929d39a506cd 100644 (file)
 #ifndef _ASM_C6X_MODULE_H
 #define _ASM_C6X_MODULE_H
 
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
-#define Elf_Addr       Elf32_Addr
-#define Elf_Word       Elf32_Word
-
-/*
- * This file contains the C6x architecture specific module code.
- */
-struct mod_arch_specific {
-};
+#include <asm-generic/module.h>
 
 struct loaded_sections {
        unsigned int new_vaddr;
index a118163b04ee09051f6447d17017869d58cc6590..a67244473a39fb78948b97fa5b4c8f3ff2551d60 100644 (file)
@@ -48,6 +48,7 @@ config CRIS
        select GENERIC_IOMAP
        select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
        select GENERIC_CMOS_UPDATE
+       select MODULES_USE_ELF_RELA
 
 config HZ
        int
index ff1bf7fcae8e116d86f23a7c05d825fd4ebc60b5..6d43a951b5ec0b5b217ca8a51405cfa274be5ffb 100644 (file)
@@ -10,3 +10,4 @@ header-y += sync_serial.h
 
 generic-y += clkdev.h
 generic-y += exec.h
+generic-y += module.h
diff --git a/arch/cris/include/asm/module.h b/arch/cris/include/asm/module.h
deleted file mode 100644 (file)
index 7ee7231..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _ASM_CRIS_MODULE_H
-#define _ASM_CRIS_MODULE_H
-/* cris is simple */
-struct mod_arch_specific { };
-
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
-#endif /* _ASM_CRIS_MODULE_H */
index 3d5c6360289a8085bb782c5909263bc00a83c697..a8848f09a217d6ead10e61c859713e5677cee828 100644 (file)
 #ifndef _ASM_MODULE_H
 #define _ASM_MODULE_H
 
-struct mod_arch_specific
-{
-};
-
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
+#include <asm-generic/module.h>
 
 /*
  * Include the architecture version.
index 90462eb23d02af5683bcd2361d7af16686c4a994..98fabd10e95fbb6f9a6b2d44700e0ae68fda3b68 100644 (file)
@@ -7,6 +7,7 @@ config H8300
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_IRQ_SHOW
        select GENERIC_CPU_DEVICES
+       select MODULES_USE_ELF_RELA
 
 config SYMBOL_PREFIX
        string
index fccd81eddff1f6de89b07cc13c362809364c9507..50bbf387b2f880d70a6783e8d7268eac764a4992 100644 (file)
@@ -2,3 +2,4 @@ include include/asm-generic/Kbuild.asm
 
 generic-y += clkdev.h
 generic-y += exec.h
+generic-y += module.h
diff --git a/arch/h8300/include/asm/module.h b/arch/h8300/include/asm/module.h
deleted file mode 100644 (file)
index 8e46724..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_H8300_MODULE_H
-#define _ASM_H8300_MODULE_H
-/*
- * This file contains the H8/300 architecture specific module code.
- */
-struct mod_arch_specific { };
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
-
-#endif /* _ASM_H8/300_MODULE_H */
index b2fdfb700f505d2e7afeb4e8ddc92d88528f7fbb..0744f7d7b1fd096b5ccbc71cab7305ea997fb3c3 100644 (file)
@@ -30,6 +30,7 @@ config HEXAGON
        select KTIME_SCALAR
        select GENERIC_CLOCKEVENTS
        select GENERIC_CLOCKEVENTS_BROADCAST
+       select MODULES_USE_ELF_RELA
        ---help---
          Qualcomm Hexagon is a processor architecture designed for high
          performance and low power across a wide variety of applications.
index 4c10e607c908cb59a444c8f7f185eeab323bfa1d..3279646120e3be5bdbc970ca5297b5fce30011ee 100644 (file)
@@ -40,6 +40,8 @@ config IA64
        select ARCH_THREAD_INFO_ALLOCATOR
        select ARCH_CLOCKSOURCE_DATA
        select GENERIC_TIME_VSYSCALL_OLD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
index 908eaef42a08d1dfd9451b55cf9852f61faaab80..dfba22a872c31c5739c05b79019d229f13f7eab8 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_IA64_MODULE_H
 #define _ASM_IA64_MODULE_H
 
+#include <asm-generic/module.h>
+
 /*
  * IA-64-specific support for kernel module loader.
  *
@@ -29,10 +31,6 @@ struct mod_arch_specific {
        unsigned int next_got_entry;    /* index of next available got entry */
 };
 
-#define Elf_Shdr       Elf64_Shdr
-#define Elf_Sym                Elf64_Sym
-#define Elf_Ehdr       Elf64_Ehdr
-
 #define MODULE_PROC_FAMILY     "ia64"
 #define MODULE_ARCH_VERMAGIC   MODULE_PROC_FAMILY \
        "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
index e875fc3ce9cb041348372083801b497b9537e5d8..f807721e19a52ee1f5b619cd0a742328e4515f46 100644 (file)
@@ -14,6 +14,7 @@ config M32R
        select GENERIC_IRQ_SHOW
        select GENERIC_ATOMIC64
        select ARCH_USES_GETTIMEOFFSET
+       select MODULES_USE_ELF_RELA
 
 config SBUS
        bool
index fccd81eddff1f6de89b07cc13c362809364c9507..50bbf387b2f880d70a6783e8d7268eac764a4992 100644 (file)
@@ -2,3 +2,4 @@ include include/asm-generic/Kbuild.asm
 
 generic-y += clkdev.h
 generic-y += exec.h
+generic-y += module.h
diff --git a/arch/m32r/include/asm/module.h b/arch/m32r/include/asm/module.h
deleted file mode 100644 (file)
index eb73ee0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _ASM_M32R_MODULE_H
-#define _ASM_M32R_MODULE_H
-
-struct mod_arch_specific { };
-
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
-
-#endif /* _ASM_M32R_MODULE_H */
index 3071fe83ffc8aac10c1083bca7a7d940e9383400..38233b6596b6e837e7cdf67ccad02f93834fe1ef 100644 (file)
@@ -201,18 +201,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        }
        return 0;
 }
-
-int apply_relocate(Elf32_Shdr *sechdrs,
-                      const char *strtab,
-                      unsigned int symindex,
-                      unsigned int relsec,
-                      struct module *me)
-{
-#if 0
-       printk(KERN_ERR "module %s: REL RELOCATION unsupported\n",
-              me->name);
-       return -ENOEXEC;
-#endif
-       return 0;
-
-}
index 76fd6e2f71da1d4c7138f06dfca8a76633eb4336..e7c161433eae320adde6503722d35652f9c3956d 100644 (file)
@@ -16,6 +16,9 @@ config M68K
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
        select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA
 
 config RWSEM_GENERIC_SPINLOCK
        bool
index edffe66b7f4972aad851ccd5de39218f9c12a20d..8b58fce843ddc2bf06a4f6f030f241a2add7b312 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_M68K_MODULE_H
 #define _ASM_M68K_MODULE_H
 
+#include <asm-generic/module.h>
+
 enum m68k_fixup_type {
        m68k_fixup_memoffset,
        m68k_fixup_vnode_shift,
@@ -36,8 +38,4 @@ struct module;
 extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
                         struct m68k_fixup_info *end);
 
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
-
 #endif /* _ASM_M68K_MODULE_H */
index 53fd94ab60f0a6efb2530d000c603d76d4d9335b..4cba7439f9de897a9de9abb91ab2c3596e4fa8a1 100644 (file)
@@ -25,6 +25,7 @@ config MICROBLAZE
        select GENERIC_CPU_DEVICES
        select GENERIC_ATOMIC64
        select GENERIC_CLOCKEVENTS
+       select MODULES_USE_ELF_RELA
 
 config SWAP
        def_bool n
index 35453eaeffb50fe0ecb319e6277166dec27b05bb..dba9390d37cf2c0d1672ca6dfb2b1453fb4294cf 100644 (file)
@@ -37,6 +37,9 @@ config MIPS
        select BUILDTIME_EXTABLE_SORT
        select GENERIC_CLOCKEVENTS
        select GENERIC_CMOS_UPDATE
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
+       select MODULES_USE_ELF_RELA if 64BIT
 
 menu "Machine selection"
 
@@ -1928,6 +1931,7 @@ config MIPS_MT_SMP
        select SYS_SUPPORTS_SCHED_SMT if SMP
        select SYS_SUPPORTS_SMP
        select SMP_UP
+       select MIPS_PERF_SHARED_TC_COUNTERS
        help
          This is a kernel model which is known a VSMP but lately has been
          marketesed into SMVP.
@@ -2038,16 +2042,6 @@ config MIPS_VPE_APSP_API
        depends on MIPS_VPE_LOADER
        help
 
-config MIPS_APSP_KSPD
-       bool "Enable KSPD"
-       depends on MIPS_VPE_APSP_API
-       default y
-       help
-         KSPD is a kernel daemon that accepts syscall requests from the SP
-         side, actions them and returns the results. It also handles the
-         "exit" syscall notifying other kernel modules the SP program is
-         exiting.  You probably want to say yes here.
-
 config MIPS_CMP
        bool "MIPS CMP framework support"
        depends on SYS_SUPPORTS_MIPS_CMP
@@ -2277,6 +2271,9 @@ config NR_CPUS
          performance should round up your number of processors to the next
          power of two.
 
+config MIPS_PERF_SHARED_TC_COUNTERS
+       bool
+
 #
 # Timer Interrupt Frequency Configuration
 #
index 0faaab24376e5ca60e78d0405f2534a32b94735d..c8862bdc2ff281eeb270e615c95a685edbcddcde 100644 (file)
@@ -27,7 +27,7 @@ config MIPS_MTX1
        select SYS_HAS_EARLY_PRINTK
 
 config MIPS_DB1000
-       bool "Alchemy DB1000/DB1500/DB1100 boards"
+       bool "Alchemy DB1000/DB1500/DB1100 PB1500/1100 boards"
        select ALCHEMY_GPIOINT_AU1000
        select DMA_NONCOHERENT
        select HW_HAS_PCI
@@ -36,57 +36,15 @@ config MIPS_DB1000
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_HAS_EARLY_PRINTK
 
-config MIPS_DB1200
-       bool "Alchemy DB1200/PB1200 board"
-       select ALCHEMY_GPIOINT_AU1000
-       select DMA_COHERENT
-       select MIPS_DISABLE_OBSOLETE_IDE
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_HAS_EARLY_PRINTK
-
-config MIPS_DB1300
-       bool "NetLogic DB1300 board"
-       select ALCHEMY_GPIOINT_AU1300
-       select DMA_COHERENT
-       select MIPS_DISABLE_OBSOLETE_IDE
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_HAS_EARLY_PRINTK
-
-config MIPS_DB1550
-       bool "Alchemy DB1550 board"
-       select ALCHEMY_GPIOINT_AU1000
+config MIPS_DB1235
+       bool "Alchemy DB1200/PB1200/DB1300/DB1550/PB1550 boards"
+       select ARCH_REQUIRE_GPIOLIB
        select HW_HAS_PCI
        select DMA_COHERENT
        select MIPS_DISABLE_OBSOLETE_IDE
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_HAS_EARLY_PRINTK
 
-config MIPS_PB1100
-       bool "Alchemy PB1100 board"
-       select ALCHEMY_GPIOINT_AU1000
-       select DMA_NONCOHERENT
-       select HW_HAS_PCI
-       select SWAP_IO_SPACE
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_HAS_EARLY_PRINTK
-
-config MIPS_PB1500
-       bool "Alchemy PB1500 board"
-       select ALCHEMY_GPIOINT_AU1000
-       select DMA_NONCOHERENT
-       select HW_HAS_PCI
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_HAS_EARLY_PRINTK
-
-config MIPS_PB1550
-       bool "Alchemy PB1550 board"
-       select ALCHEMY_GPIOINT_AU1000
-       select DMA_NONCOHERENT
-       select HW_HAS_PCI
-       select MIPS_DISABLE_OBSOLETE_IDE
-       select SYS_SUPPORTS_LITTLE_ENDIAN
-       select SYS_HAS_EARLY_PRINTK
-
 config MIPS_XXS1500
        bool "MyCable XXS1500 board"
        select DMA_NONCOHERENT
index 7956274de15fc0df3ca3af6eb27bf698914bb45d..942c5800a684e6516c5b7068b2f89d29ee63bf7e 100644 (file)
@@ -30,25 +30,11 @@ cflags-$(CONFIG_MIPS_DB1000)        += -I$(srctree)/arch/mips/include/asm/mach-db1x00
 load-$(CONFIG_MIPS_DB1000)     += 0xffffffff80100000
 
 #
-# AMD Alchemy Db1550 eval board
+# AMD Alchemy Db1200/Pb1200/Db1550/Db1300 eval boards
 #
-platform-$(CONFIG_MIPS_DB1550) += alchemy/devboards/
-cflags-$(CONFIG_MIPS_DB1550)   += -I$(srctree)/arch/mips/include/asm/mach-db1x00
-load-$(CONFIG_MIPS_DB1550)     += 0xffffffff80100000
-
-#
-# AMD Alchemy Db1200/Pb1200 eval boards
-#
-platform-$(CONFIG_MIPS_DB1200) += alchemy/devboards/
-cflags-$(CONFIG_MIPS_DB1200)   += -I$(srctree)/arch/mips/include/asm/mach-db1x00
-load-$(CONFIG_MIPS_DB1200)     += 0xffffffff80100000
-
-#
-# NetLogic DBAu1300 development platform
-#
-platform-$(CONFIG_MIPS_DB1300) += alchemy/devboards/
-cflags-$(CONFIG_MIPS_DB1300)   += -I$(srctree)/arch/mips/include/asm/mach-db1x00
-load-$(CONFIG_MIPS_DB1300)     += 0xffffffff80100000
+platform-$(CONFIG_MIPS_DB1235) += alchemy/devboards/
+cflags-$(CONFIG_MIPS_DB1235)   += -I$(srctree)/arch/mips/include/asm/mach-db1x00
+load-$(CONFIG_MIPS_DB1235)     += 0xffffffff80100000
 
 #
 # 4G-Systems MTX-1 "MeshCube" wireless router
index c9e747dd9fc229d3ee1e29a4a8f232c576ed79bb..15bf7306648b3c269bcb97cdf5441147be089e3e 100644 (file)
@@ -4,10 +4,5 @@
 
 obj-y += bcsr.o platform.o
 obj-$(CONFIG_PM)               += pm.o
-obj-$(CONFIG_MIPS_PB1100)      += pb1100.o
-obj-$(CONFIG_MIPS_PB1500)      += pb1500.o
-obj-$(CONFIG_MIPS_PB1550)      += pb1550.o
 obj-$(CONFIG_MIPS_DB1000)      += db1000.o
-obj-$(CONFIG_MIPS_DB1200)      += db1200.o
-obj-$(CONFIG_MIPS_DB1300)      += db1300.o
-obj-$(CONFIG_MIPS_DB1550)      += db1550.o
+obj-$(CONFIG_MIPS_DB1235)      += db1235.o db1200.o db1300.o db1550.o
index 1b81dbf6b804f1881e9044840bc0b22992ee1a2e..8187845650f70473f7c021f600dbc827fb5a773c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * DBAu1000/1500/1100 board support
+ * DBAu1000/1500/1100 PBAu1100/1500 board support
  *
  * Copyright 2000, 2008 MontaVista Software Inc.
  * Author: MontaVista Software, Inc. <source@mvista.com>
@@ -52,6 +52,11 @@ static const char *board_type_str(void)
                return "DB1500";
        case BCSR_WHOAMI_DB1100:
                return "DB1100";
+       case BCSR_WHOAMI_PB1500:
+       case BCSR_WHOAMI_PB1500R2:
+               return "PB1500";
+       case BCSR_WHOAMI_PB1100:
+               return "PB1100";
        default:
                return "(unknown)";
        }
@@ -111,7 +116,9 @@ static struct platform_device db1500_pci_host_dev = {
 
 static int __init db1500_pci_init(void)
 {
-       if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1500)
+       int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
+       if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
+           (id == BCSR_WHOAMI_PB1500R2))
                return platform_device_register(&db1500_pci_host_dev);
        return 0;
 }
@@ -199,27 +206,37 @@ static irqreturn_t db1100_mmc_cd(int irq, void *ptr)
 
 static int db1100_mmc_cd_setup(void *mmc_host, int en)
 {
-       int ret = 0;
+       int ret = 0, irq;
+
+       if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
+               irq = AU1100_GPIO19_INT;
+       else
+               irq = AU1100_GPIO14_INT;        /* PB1100 SD0 CD# */
 
        if (en) {
-               irq_set_irq_type(AU1100_GPIO19_INT, IRQ_TYPE_EDGE_BOTH);
-               ret = request_irq(AU1100_GPIO19_INT, db1100_mmc_cd, 0,
+               irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
+               ret = request_irq(irq, db1100_mmc_cd, 0,
                                  "sd0_cd", mmc_host);
        } else
-               free_irq(AU1100_GPIO19_INT, mmc_host);
+               free_irq(irq, mmc_host);
        return ret;
 }
 
 static int db1100_mmc1_cd_setup(void *mmc_host, int en)
 {
-       int ret = 0;
+       int ret = 0, irq;
+
+       if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
+               irq = AU1100_GPIO20_INT;
+       else
+               irq = AU1100_GPIO15_INT;        /* PB1100 SD1 CD# */
 
        if (en) {
-               irq_set_irq_type(AU1100_GPIO20_INT, IRQ_TYPE_EDGE_BOTH);
-               ret = request_irq(AU1100_GPIO20_INT, db1100_mmc_cd, 0,
+               irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
+               ret = request_irq(irq, db1100_mmc_cd, 0,
                                  "sd1_cd", mmc_host);
        } else
-               free_irq(AU1100_GPIO20_INT, mmc_host);
+               free_irq(irq, mmc_host);
        return ret;
 }
 
@@ -236,11 +253,18 @@ static int db1100_mmc_card_inserted(void *mmc_host)
 
 static void db1100_mmc_set_power(void *mmc_host, int state)
 {
+       int bit;
+
+       if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
+               bit = BCSR_BOARD_SD0PWR;
+       else
+               bit = BCSR_BOARD_PB1100_SD0PWR;
+
        if (state) {
-               bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD0PWR);
+               bcsr_mod(BCSR_BOARD, 0, bit);
                msleep(400);    /* stabilization time */
        } else
-               bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD0PWR, 0);
+               bcsr_mod(BCSR_BOARD, bit, 0);
 }
 
 static void db1100_mmcled_set(struct led_classdev *led, enum led_brightness b)
@@ -267,11 +291,18 @@ static int db1100_mmc1_card_inserted(void *mmc_host)
 
 static void db1100_mmc1_set_power(void *mmc_host, int state)
 {
+       int bit;
+
+       if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
+               bit = BCSR_BOARD_SD1PWR;
+       else
+               bit = BCSR_BOARD_PB1100_SD1PWR;
+
        if (state) {
-               bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD1PWR);
+               bcsr_mod(BCSR_BOARD, 0, bit);
                msleep(400);    /* stabilization time */
        } else
-               bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD1PWR, 0);
+               bcsr_mod(BCSR_BOARD, bit, 0);
 }
 
 static void db1100_mmc1led_set(struct led_classdev *led, enum led_brightness b)
@@ -480,13 +511,12 @@ static struct platform_device *db1100_devs[] = {
        &db1100_mmc0_dev,
        &db1100_mmc1_dev,
        &db1000_irda_dev,
-       &db1100_spi_dev,
 };
 
 static int __init db1000_dev_init(void)
 {
        int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
-       int c0, c1, d0, d1, s0, s1;
+       int c0, c1, d0, d1, s0, s1, flashsize = 32,  twosocks = 1;
        unsigned long pfc;
 
        if (board == BCSR_WHOAMI_DB1500) {
@@ -522,6 +552,7 @@ static int __init db1000_dev_init(void)
                                        ARRAY_SIZE(db1100_spi_info));
 
                platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
+               platform_device_register(&db1100_spi_dev);
        } else if (board == BCSR_WHOAMI_DB1000) {
                c0 = AU1000_GPIO2_INT;
                c1 = AU1000_GPIO5_INT;
@@ -530,15 +561,42 @@ static int __init db1000_dev_init(void)
                s0 = AU1000_GPIO1_INT;
                s1 = AU1000_GPIO4_INT;
                platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs));
+       } else if ((board == BCSR_WHOAMI_PB1500) ||
+                  (board == BCSR_WHOAMI_PB1500R2)) {
+               c0 = AU1500_GPIO203_INT;
+               d0 = AU1500_GPIO201_INT;
+               s0 = AU1500_GPIO202_INT;
+               twosocks = 0;
+               flashsize = 64;
+               /* RTC and daughtercard irqs */
+               irq_set_irq_type(AU1500_GPIO204_INT, IRQ_TYPE_LEVEL_LOW);
+               irq_set_irq_type(AU1500_GPIO205_INT, IRQ_TYPE_LEVEL_LOW);
+               /* EPSON S1D13806 0x1b000000
+                * SRAM 1MB/2MB   0x1a000000
+                * DS1693 RTC     0x0c000000
+                */
+       } else if (board == BCSR_WHOAMI_PB1100) {
+               c0 = AU1100_GPIO11_INT;
+               d0 = AU1100_GPIO9_INT;
+               s0 = AU1100_GPIO10_INT;
+               twosocks = 0;
+               flashsize = 64;
+               /* pendown, rtc, daughtercard irqs */
+               irq_set_irq_type(AU1100_GPIO8_INT, IRQ_TYPE_LEVEL_LOW);
+               irq_set_irq_type(AU1100_GPIO12_INT, IRQ_TYPE_LEVEL_LOW);
+               irq_set_irq_type(AU1100_GPIO13_INT, IRQ_TYPE_LEVEL_LOW);
+               /* EPSON S1D13806 0x1b000000
+                * SRAM 1MB/2MB   0x1a000000
+                * DiskOnChip     0x0d000000
+                * DS1693 RTC     0x0c000000
+                */
+               platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
        } else
                return 0; /* unknown board, no further dev setup to do */
 
        irq_set_irq_type(d0, IRQ_TYPE_EDGE_BOTH);
-       irq_set_irq_type(d1, IRQ_TYPE_EDGE_BOTH);
        irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW);
-       irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
        irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW);
-       irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
 
        db1x_register_pcmcia_socket(
                AU1000_PCMCIA_ATTR_PHYS_ADDR,
@@ -549,17 +607,23 @@ static int __init db1000_dev_init(void)
                AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
                c0, d0, /*s0*/0, 0, 0);
 
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
-               c1, d1, /*s1*/0, 0, 1);
+       if (twosocks) {
+               irq_set_irq_type(d1, IRQ_TYPE_EDGE_BOTH);
+               irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
+               irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
+
+               db1x_register_pcmcia_socket(
+                       AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
+                       AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
+                       AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
+                       AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
+                       AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
+                       AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
+                       c1, d1, /*s1*/0, 0, 1);
+       }
 
        platform_add_devices(db1x00_devs, ARRAY_SIZE(db1x00_devs));
-       db1x_register_norflash(32 << 20, 4 /* 32bit */, F_SWAPPED);
+       db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
        return 0;
 }
 device_initcall(db1000_dev_init);
index bf2248474fa8da6c4516c0567803c781636cb385..299b7d202bea79970b0195b6a42c9ddeadd04ba7 100644 (file)
 
 #include "platform.h"
 
-static const char *board_type_str(void)
-{
-       switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
-       case BCSR_WHOAMI_PB1200_DDR1:
-       case BCSR_WHOAMI_PB1200_DDR2:
-               return "PB1200";
-       case BCSR_WHOAMI_DB1200:
-               return "DB1200";
-       default:
-               return "(unknown)";
-       }
-}
+const char *get_system_type(void);
 
-const char *get_system_type(void)
-{
-       return board_type_str();
-}
-
-static int __init detect_board(void)
+static int __init db1200_detect_board(void)
 {
        int bid;
 
@@ -96,19 +80,17 @@ static int __init detect_board(void)
        return 1;       /* it's neither */
 }
 
-void __init board_setup(void)
+int __init db1200_board_setup(void)
 {
        unsigned long freq0, clksrc, div, pfc;
        unsigned short whoami;
 
-       if (detect_board()) {
-               printk(KERN_ERR "NOT running on a DB1200/PB1200 board!\n");
-               return;
-       }
+       if (db1200_detect_board())
+               return -ENODEV;
 
        whoami = bcsr_read(BCSR_WHOAMI);
        printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
-               "  Board-ID %d  Daughtercard ID %d\n", board_type_str(),
+               "  Board-ID %d  Daughtercard ID %d\n", get_system_type(),
                (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
 
        /* SMBus/SPI on PSC0, Audio on PSC1 */
@@ -138,6 +120,8 @@ void __init board_setup(void)
        clksrc = SYS_CS_MUX_FQ0 << SYS_CS_ME0_BIT;
        __raw_writel(clksrc, (void __iomem *)SYS_CLKSRC);
        wmb();
+
+       return 0;
 }
 
 /******************************************************************************/
@@ -796,7 +780,7 @@ static int __init pb1200_res_fixup(void)
        return 0;
 }
 
-static int __init db1200_dev_init(void)
+int __init db1200_dev_setup(void)
 {
        unsigned long pfc;
        unsigned short sw;
@@ -846,7 +830,7 @@ static int __init db1200_dev_init(void)
        gpio_request(215, "otg-vbus");
        gpio_direction_output(215, 1);
 
-       printk(KERN_INFO "%s device configuration:\n", board_type_str());
+       printk(KERN_INFO "%s device configuration:\n", get_system_type());
 
        sw = bcsr_read(BCSR_SWITCHES);
        if (sw & BCSR_SWITCHES_DIP_8) {
@@ -922,4 +906,3 @@ static int __init db1200_dev_init(void)
 
        return 0;
 }
-device_initcall(db1200_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1235.c b/arch/mips/alchemy/devboards/db1235.c
new file mode 100644 (file)
index 0000000..c76a90f
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * DB1200/PB1200 / DB1550 / DB1300 board support.
+ *
+ * These 4 boards can reliably be supported in a single kernel image.
+ */
+
+#include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-db1x00/bcsr.h>
+
+int __init db1200_board_setup(void);
+int __init db1200_dev_setup(void);
+int __init db1300_board_setup(void);
+int __init db1300_dev_setup(void);
+int __init db1550_board_setup(void);
+int __init db1550_dev_setup(void);
+int __init db1550_pci_setup(int);
+
+static const char *board_type_str(void)
+{
+       switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
+       case BCSR_WHOAMI_PB1200_DDR1:
+       case BCSR_WHOAMI_PB1200_DDR2:
+               return "PB1200";
+       case BCSR_WHOAMI_DB1200:
+               return "DB1200";
+       case BCSR_WHOAMI_DB1300:
+               return "DB1300";
+       case BCSR_WHOAMI_DB1550:
+               return "DB1550";
+       case BCSR_WHOAMI_PB1550_SDR:
+       case BCSR_WHOAMI_PB1550_DDR:
+               return "PB1550";
+       default:
+               return "(unknown)";
+       }
+}
+
+const char *get_system_type(void)
+{
+       return board_type_str();
+}
+
+void __init board_setup(void)
+{
+       int ret;
+
+       switch (alchemy_get_cputype()) {
+       case ALCHEMY_CPU_AU1550:
+               ret = db1550_board_setup();
+               break;
+       case ALCHEMY_CPU_AU1200:
+               ret = db1200_board_setup();
+               break;
+       case ALCHEMY_CPU_AU1300:
+               ret = db1300_board_setup();
+               break;
+       default:
+               pr_err("unsupported CPU on board\n");
+               ret = -ENODEV;
+       }
+       if (ret)
+               panic("cannot initialize board support\n");
+}
+
+int __init db1235_arch_init(void)
+{
+       int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
+       if (id == BCSR_WHOAMI_DB1550)
+               return db1550_pci_setup(0);
+       else if ((id == BCSR_WHOAMI_PB1550_SDR) ||
+                (id == BCSR_WHOAMI_PB1550_DDR))
+               return db1550_pci_setup(1);
+
+       return 0;
+}
+arch_initcall(db1235_arch_init);
+
+int __init db1235_dev_init(void)
+{
+       switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
+       case BCSR_WHOAMI_PB1200_DDR1:
+       case BCSR_WHOAMI_PB1200_DDR2:
+       case BCSR_WHOAMI_DB1200:
+               return db1200_dev_setup();
+       case BCSR_WHOAMI_DB1300:
+               return db1300_dev_setup();
+       case BCSR_WHOAMI_DB1550:
+       case BCSR_WHOAMI_PB1550_SDR:
+       case BCSR_WHOAMI_PB1550_DDR:
+               return db1550_dev_setup();
+       }
+       return 0;
+}
+device_initcall(db1235_dev_init);
index c56e0246694ecdffbc4afda86374db50d8bc5cb8..cdf37cbd3d1f80c3a1017be06a487b7d50a7adbe 100644 (file)
@@ -110,11 +110,6 @@ static void __init db1300_gpio_config(void)
        au1300_set_dbdma_gpio(1, AU1300_PIN_FG3AUX);
 }
 
-char *get_system_type(void)
-{
-       return "DB1300";
-}
-
 /**********************************************************************/
 
 static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
@@ -701,7 +696,7 @@ static struct platform_device *db1300_dev[] __initdata = {
        &db1300_sndi2s_dev,
 };
 
-static int __init db1300_device_init(void)
+int __init db1300_dev_setup(void)
 {
        int swapped, cpldirq;
 
@@ -758,10 +753,9 @@ static int __init db1300_device_init(void)
 
        return platform_add_devices(db1300_dev, ARRAY_SIZE(db1300_dev));
 }
-device_initcall(db1300_device_init);
 
 
-void __init board_setup(void)
+int __init db1300_board_setup(void)
 {
        unsigned short whoami;
 
@@ -779,4 +773,6 @@ void __init board_setup(void)
        alchemy_uart_enable(AU1300_UART0_PHYS_ADDR);
        alchemy_uart_enable(AU1300_UART1_PHYS_ADDR);
        alchemy_uart_enable(AU1300_UART3_PHYS_ADDR);
+
+       return 0;
 }
index 9eb79062f46e449f08a799b5f7c2d91a8c7696bc..5a9ae609542879c7e6dcb219d0f3099bc4b939e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Alchemy Db1550 board support
+ * Alchemy Db1550/Pb1550 board support
  *
  * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com>
  */
 #include <linux/pm.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
+#include <asm/bootinfo.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_eth.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
 #include <asm/mach-au1x00/au1xxx_psc.h>
 #include <asm/mach-au1x00/au1550_spi.h>
+#include <asm/mach-au1x00/au1550nd.h>
 #include <asm/mach-db1x00/bcsr.h>
 #include <prom.h>
 #include "platform.h"
 
-
-const char *get_system_type(void)
-{
-       return "DB1550";
-}
-
 static void __init db1550_hw_setup(void)
 {
        void __iomem *base;
 
-       alchemy_gpio_direction_output(203, 0);  /* red led on */
-
        /* complete SPI setup: link psc0_intclk to a 48MHz source,
-        * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line)
+        * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line) as well as PSC1_SYNC
+        * for AC97 on PB1550.
         */
        base = (void __iomem *)SYS_CLKSRC;
        __raw_writel(__raw_readl(base) | 0x000001e0, base);
        base = (void __iomem *)SYS_PINFUNC;
-       __raw_writel(__raw_readl(base) | 1, base);
+       __raw_writel(__raw_readl(base) | 1 | SYS_PF_PSC1_S1, base);
        wmb();
 
        /* reset the AC97 codec now, the reset time in the psc-ac97 driver
@@ -57,23 +52,27 @@ static void __init db1550_hw_setup(void)
        wmb();
        __raw_writel(PSC_AC97RST_RST, base + PSC_AC97RST_OFFSET);
        wmb();
-
-       alchemy_gpio_direction_output(202, 0);  /* green led on */
 }
 
-void __init board_setup(void)
+int __init db1550_board_setup(void)
 {
        unsigned short whoami;
 
        bcsr_init(DB1550_BCSR_PHYS_ADDR,
                  DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
 
-       whoami = bcsr_read(BCSR_WHOAMI);
-       printk(KERN_INFO "Alchemy/AMD DB1550 Board, CPLD Rev %d"
-               "  Board-ID %d  Daughtercard ID %d\n",
+       whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */
+       if ((BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_SDR) ||
+           (BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_DDR))
+               bcsr_init(PB1550_BCSR_PHYS_ADDR,
+                         PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
+
+       pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d  "       \
+               "Daughtercard ID %d\n", get_system_type(),
                (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
 
        db1550_hw_setup();
+       return 0;
 }
 
 /*****************************************************************************/
@@ -194,6 +193,39 @@ static struct platform_device db1550_nand_dev = {
        }
 };
 
+static struct au1550nd_platdata pb1550_nand_pd = {
+       .parts          = db1550_nand_parts,
+       .num_parts      = ARRAY_SIZE(db1550_nand_parts),
+       .devwidth       = 0,    /* x8 NAND default, needs fixing up */
+};
+
+static struct platform_device pb1550_nand_dev = {
+       .name           = "au1550-nand",
+       .id             = -1,
+       .resource       = db1550_nand_res,
+       .num_resources  = ARRAY_SIZE(db1550_nand_res),
+       .dev            = {
+               .platform_data  = &pb1550_nand_pd,
+       },
+};
+
+static void __init pb1550_nand_setup(void)
+{
+       int boot_swapboot = (au_readl(MEM_STSTAT) & (0x7 << 1)) |
+                           ((bcsr_read(BCSR_STATUS) >> 6) & 0x1);
+
+       gpio_direction_input(206);      /* de-assert NAND CS# */
+       switch (boot_swapboot) {
+       case 0: case 2: case 8: case 0xC: case 0xD:
+               /* x16 NAND Flash */
+               pb1550_nand_pd.devwidth = 1;
+               /* fallthrough */
+       case 1: case 3: case 9: case 0xE: case 0xF:
+               /* x8 NAND, already set up */
+               platform_device_register(&pb1550_nand_dev);
+       }
+}
+
 /**********************************************************************/
 
 static struct resource au1550_psc0_res[] = {
@@ -394,6 +426,29 @@ static int db1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
        return -1;
 }
 
+static int pb1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
+{
+       if ((slot < 12) || (slot > 13) || pin == 0)
+               return -1;
+       if (slot == 12) {
+               switch (pin) {
+               case 1: return AU1500_PCI_INTB;
+               case 2: return AU1500_PCI_INTC;
+               case 3: return AU1500_PCI_INTD;
+               case 4: return AU1500_PCI_INTA;
+               }
+       }
+       if (slot == 13) {
+               switch (pin) {
+               case 1: return AU1500_PCI_INTA;
+               case 2: return AU1500_PCI_INTB;
+               case 3: return AU1500_PCI_INTC;
+               case 4: return AU1500_PCI_INTD;
+               }
+       }
+       return -1;
+}
+
 static struct resource alchemy_pci_host_res[] = {
        [0] = {
                .start  = AU1500_PCI_PHYS_ADDR,
@@ -417,7 +472,6 @@ static struct platform_device db1550_pci_host_dev = {
 /**********************************************************************/
 
 static struct platform_device *db1550_devs[] __initdata = {
-       &db1550_nand_dev,
        &db1550_i2c_dev,
        &db1550_ac97_dev,
        &db1550_spi_dev,
@@ -430,15 +484,16 @@ static struct platform_device *db1550_devs[] __initdata = {
 };
 
 /* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
-static int __init db1550_pci_init(void)
+int __init db1550_pci_setup(int id)
 {
+       if (id)
+               db1550_pci_pd.board_map_irq = pb1550_map_pci_irq;
        return platform_device_register(&db1550_pci_host_dev);
 }
-arch_initcall(db1550_pci_init);
 
-static int __init db1550_dev_init(void)
+static void __init db1550_devices(void)
 {
-       int swapped;
+       alchemy_gpio_direction_output(203, 0);  /* red led on */
 
        irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_EDGE_BOTH);  /* CD0# */
        irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_EDGE_BOTH);  /* CD1# */
@@ -447,6 +502,75 @@ static int __init db1550_dev_init(void)
        irq_set_irq_type(AU1550_GPIO21_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG0# */
        irq_set_irq_type(AU1550_GPIO22_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG1# */
 
+       db1x_register_pcmcia_socket(
+               AU1000_PCMCIA_ATTR_PHYS_ADDR,
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
+               AU1000_PCMCIA_MEM_PHYS_ADDR,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
+               AU1000_PCMCIA_IO_PHYS_ADDR,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
+               AU1550_GPIO3_INT, AU1550_GPIO0_INT,
+               /*AU1550_GPIO21_INT*/0, 0, 0);
+
+       db1x_register_pcmcia_socket(
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
+               AU1550_GPIO5_INT, AU1550_GPIO1_INT,
+               /*AU1550_GPIO22_INT*/0, 0, 1);
+
+       platform_device_register(&db1550_nand_dev);
+
+       alchemy_gpio_direction_output(202, 0);  /* green led on */
+}
+
+static void __init pb1550_devices(void)
+{
+       irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_LEVEL_LOW);
+       irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_LEVEL_LOW);
+       irq_set_irq_type(AU1550_GPIO201_205_INT, IRQ_TYPE_LEVEL_HIGH);
+
+       /* enable both PCMCIA card irqs in the shared line */
+       alchemy_gpio2_enable_int(201);  /* socket 0 card irq */
+       alchemy_gpio2_enable_int(202);  /* socket 1 card irq */
+
+       /* Pb1550, like all others, also has statuschange irqs; however they're
+       * wired up on one of the Au1550's shared GPIO201_205 line, which also
+       * services the PCMCIA card interrupts.  So we ignore statuschange and
+       * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
+       * drivers are used to shared irqs and b) statuschange isn't really use-
+       * ful anyway.
+       */
+       db1x_register_pcmcia_socket(
+               AU1000_PCMCIA_ATTR_PHYS_ADDR,
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
+               AU1000_PCMCIA_MEM_PHYS_ADDR,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
+               AU1000_PCMCIA_IO_PHYS_ADDR,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
+               AU1550_GPIO201_205_INT, AU1550_GPIO0_INT, 0, 0, 0);
+
+       db1x_register_pcmcia_socket(
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
+               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x008000000,
+               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x008400000 - 1,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x008000000,
+               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x008010000 - 1,
+               AU1550_GPIO201_205_INT, AU1550_GPIO1_INT, 0, 0, 1);
+
+       pb1550_nand_setup();
+}
+
+int __init db1550_dev_setup(void)
+{
+       int swapped, id;
+
+       id = (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) != BCSR_WHOAMI_DB1550);
+
        i2c_register_board_info(0, db1550_i2c_devs,
                                ARRAY_SIZE(db1550_i2c_devs));
        spi_register_board_info(db1550_spi_devs,
@@ -467,29 +591,11 @@ static int __init db1550_dev_init(void)
            (void __iomem *)KSEG1ADDR(AU1550_PSC2_PHYS_ADDR) + PSC_SEL_OFFSET);
        wmb();
 
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
-               AU1550_GPIO3_INT, AU1550_GPIO0_INT,
-               /*AU1550_GPIO21_INT*/0, 0, 0);
-
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
-               AU1550_GPIO5_INT, AU1550_GPIO1_INT,
-               /*AU1550_GPIO22_INT*/0, 0, 1);
+       id ? pb1550_devices() : db1550_devices();
 
-       swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
+       swapped = bcsr_read(BCSR_STATUS) &
+              (id ? BCSR_STATUS_PB1550_SWAPBOOT : BCSR_STATUS_DB1000_SWAPBOOT);
        db1x_register_norflash(128 << 20, 4, swapped);
 
        return platform_add_devices(db1550_devs, ARRAY_SIZE(db1550_devs));
 }
-device_initcall(db1550_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1100.c b/arch/mips/alchemy/devboards/pb1100.c
deleted file mode 100644 (file)
index 78c77a4..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Pb1100 board platform device registration
- *
- * Copyright (C) 2009 Manuel Lauss
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/dma-mapping.h>
-#include <linux/platform_device.h>
-#include <asm/mach-au1x00/au1000.h>
-#include <asm/mach-db1x00/bcsr.h>
-#include <prom.h>
-#include "platform.h"
-
-const char *get_system_type(void)
-{
-       return "PB1100";
-}
-
-void __init board_setup(void)
-{
-       volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
-
-       bcsr_init(DB1000_BCSR_PHYS_ADDR,
-                 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
-
-       /* Set AUX clock to 12 MHz * 8 = 96 MHz */
-       au_writel(8, SYS_AUXPLL);
-       alchemy_gpio1_input_enable();
-       udelay(100);
-
-#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
-       {
-               u32 pin_func, sys_freqctrl, sys_clksrc;
-
-               /* Configure pins GPIO[14:9] as GPIO */
-               pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
-
-               /* Zero and disable FREQ2 */
-               sys_freqctrl = au_readl(SYS_FREQCTRL0);
-               sys_freqctrl &= ~0xFFF00000;
-               au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-               /* Zero and disable USBH/USBD/IrDA clock */
-               sys_clksrc = au_readl(SYS_CLKSRC);
-               sys_clksrc &= ~(SYS_CS_CIR | SYS_CS_DIR | SYS_CS_MIR_MASK);
-               au_writel(sys_clksrc, SYS_CLKSRC);
-
-               sys_freqctrl = au_readl(SYS_FREQCTRL0);
-               sys_freqctrl &= ~0xFFF00000;
-
-               sys_clksrc = au_readl(SYS_CLKSRC);
-               sys_clksrc &= ~(SYS_CS_CIR | SYS_CS_DIR | SYS_CS_MIR_MASK);
-
-               /* FREQ2 = aux / 2 = 48 MHz */
-               sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) |
-                               SYS_FC_FE2 | SYS_FC_FS2;
-               au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-               /*
-                * Route 48 MHz FREQ2 into USBH/USBD/IrDA
-                */
-               sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MIR_BIT;
-               au_writel(sys_clksrc, SYS_CLKSRC);
-
-               /* Setup the static bus controller */
-               au_writel(0x00000002, MEM_STCFG3);  /* type = PCMCIA */
-               au_writel(0x280E3D07, MEM_STTIME3); /* 250ns cycle time */
-               au_writel(0x10000000, MEM_STADDR3); /* any PCMCIA select */
-
-               /*
-                * Get USB Functionality pin state (device vs host drive pins).
-                */
-               pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_USB;
-               /* 2nd USB port is USB host. */
-               pin_func |= SYS_PF_USB;
-               au_writel(pin_func, SYS_PINFUNC);
-       }
-#endif /* IS_ENABLED(CONFIG_USB_OHCI_HCD) */
-
-       /* Enable sys bus clock divider when IDLE state or no bus activity. */
-       au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
-
-       /* Enable the RTC if not already enabled. */
-       if (!(readb(base + 0x28) & 0x20)) {
-               writeb(readb(base + 0x28) | 0x20, base + 0x28);
-               au_sync();
-       }
-       /* Put the clock in BCD mode. */
-       if (readb(base + 0x2C) & 0x4) { /* reg B */
-               writeb(readb(base + 0x2c) & ~0x4, base + 0x2c);
-               au_sync();
-       }
-}
-
-/******************************************************************************/
-
-static struct resource au1100_lcd_resources[] = {
-       [0] = {
-               .start  = AU1100_LCD_PHYS_ADDR,
-               .end    = AU1100_LCD_PHYS_ADDR + 0x800 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AU1100_LCD_INT,
-               .end    = AU1100_LCD_INT,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static u64 au1100_lcd_dmamask = DMA_BIT_MASK(32);
-
-static struct platform_device au1100_lcd_device = {
-       .name           = "au1100-lcd",
-       .id             = 0,
-       .dev = {
-               .dma_mask               = &au1100_lcd_dmamask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .num_resources  = ARRAY_SIZE(au1100_lcd_resources),
-       .resource       = au1100_lcd_resources,
-};
-
-static int __init pb1100_dev_init(void)
-{
-       int swapped;
-
-       irq_set_irq_type(AU1100_GPIO9_INT, IRQF_TRIGGER_LOW); /* PCCD# */
-       irq_set_irq_type(AU1100_GPIO10_INT, IRQF_TRIGGER_LOW); /* PCSTSCHG# */
-       irq_set_irq_type(AU1100_GPIO11_INT, IRQF_TRIGGER_LOW); /* PCCard# */
-       irq_set_irq_type(AU1100_GPIO13_INT, IRQF_TRIGGER_LOW); /* DC_IRQ# */
-
-       /* PCMCIA. single socket, identical to Pb1500 */
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
-               AU1100_GPIO11_INT, AU1100_GPIO9_INT,     /* card / insert */
-               /*AU1100_GPIO10_INT*/0, 0, 0); /* stschg / eject / id */
-
-       swapped = bcsr_read(BCSR_STATUS) &  BCSR_STATUS_DB1000_SWAPBOOT;
-       db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
-       platform_device_register(&au1100_lcd_device);
-
-       return 0;
-}
-device_initcall(pb1100_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1500.c b/arch/mips/alchemy/devboards/pb1500.c
deleted file mode 100644 (file)
index 232fee9..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Pb1500 board support.
- *
- * Copyright (C) 2009 Manuel Lauss
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <linux/delay.h>
-#include <linux/dma-mapping.h>
-#include <linux/gpio.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <asm/mach-au1x00/au1000.h>
-#include <asm/mach-db1x00/bcsr.h>
-#include <prom.h>
-#include "platform.h"
-
-const char *get_system_type(void)
-{
-       return "PB1500";
-}
-
-void __init board_setup(void)
-{
-       u32 pin_func;
-       u32 sys_freqctrl, sys_clksrc;
-
-       bcsr_init(DB1000_BCSR_PHYS_ADDR,
-                 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
-
-       sys_clksrc = sys_freqctrl = pin_func = 0;
-       /* Set AUX clock to 12 MHz * 8 = 96 MHz */
-       au_writel(8, SYS_AUXPLL);
-       alchemy_gpio1_input_enable();
-       udelay(100);
-
-       /* GPIO201 is input for PCMCIA card detect */
-       /* GPIO203 is input for PCMCIA interrupt request */
-       alchemy_gpio_direction_input(201);
-       alchemy_gpio_direction_input(203);
-
-#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
-
-       /* Zero and disable FREQ2 */
-       sys_freqctrl = au_readl(SYS_FREQCTRL0);
-       sys_freqctrl &= ~0xFFF00000;
-       au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-       /* zero and disable USBH/USBD clocks */
-       sys_clksrc = au_readl(SYS_CLKSRC);
-       sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
-                       SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
-       au_writel(sys_clksrc, SYS_CLKSRC);
-
-       sys_freqctrl = au_readl(SYS_FREQCTRL0);
-       sys_freqctrl &= ~0xFFF00000;
-
-       sys_clksrc = au_readl(SYS_CLKSRC);
-       sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
-                       SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
-
-       /* FREQ2 = aux/2 = 48 MHz */
-       sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) | SYS_FC_FE2 | SYS_FC_FS2;
-       au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-       /*
-        * Route 48MHz FREQ2 into USB Host and/or Device
-        */
-       sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MUH_BIT;
-       au_writel(sys_clksrc, SYS_CLKSRC);
-
-       pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_USB;
-       /* 2nd USB port is USB host */
-       pin_func |= SYS_PF_USB;
-       au_writel(pin_func, SYS_PINFUNC);
-#endif /* IS_ENABLED(CONFIG_USB_OHCI_HCD) */
-
-#ifdef CONFIG_PCI
-       {
-               void __iomem *base =
-                               (void __iomem *)KSEG1ADDR(AU1500_PCI_PHYS_ADDR);
-               /* Setup PCI bus controller */
-               __raw_writel(0x00003fff, base + PCI_REG_CMEM);
-               __raw_writel(0xf0000000, base + PCI_REG_MWMASK_DEV);
-               __raw_writel(0, base + PCI_REG_MWBASE_REV_CCL);
-               __raw_writel(0x02a00356, base + PCI_REG_STATCMD);
-               __raw_writel(0x00003c04, base + PCI_REG_PARAM);
-               __raw_writel(0x00000008, base + PCI_REG_MBAR);
-               wmb();
-       }
-#endif
-
-       /* Enable sys bus clock divider when IDLE state or no bus activity. */
-       au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
-
-       /* Enable the RTC if not already enabled */
-       if (!(au_readl(0xac000028) & 0x20)) {
-               printk(KERN_INFO "enabling clock ...\n");
-               au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
-       }
-       /* Put the clock in BCD mode */
-       if (au_readl(0xac00002c) & 0x4) { /* reg B */
-               au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
-               au_sync();
-       }
-}
-
-/******************************************************************************/
-
-static int pb1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
-{
-       if ((slot < 12) || (slot > 13) || pin == 0)
-               return -1;
-       if (slot == 12)
-               return (pin == 1) ? AU1500_PCI_INTA : 0xff;
-       if (slot == 13) {
-               switch (pin) {
-               case 1: return AU1500_PCI_INTA;
-               case 2: return AU1500_PCI_INTB;
-               case 3: return AU1500_PCI_INTC;
-               case 4: return AU1500_PCI_INTD;
-               }
-       }
-       return -1;
-}
-
-static struct resource alchemy_pci_host_res[] = {
-       [0] = {
-               .start  = AU1500_PCI_PHYS_ADDR,
-               .end    = AU1500_PCI_PHYS_ADDR + 0xfff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct alchemy_pci_platdata pb1500_pci_pd = {
-       .board_map_irq  = pb1500_map_pci_irq,
-       .pci_cfg_set    = PCI_CONFIG_AEN | PCI_CONFIG_R2H | PCI_CONFIG_R1H |
-                         PCI_CONFIG_CH |
-#if defined(__MIPSEB__)
-                         PCI_CONFIG_SIC_HWA_DAT | PCI_CONFIG_SM,
-#else
-                         0,
-#endif
-};
-
-static struct platform_device pb1500_pci_host = {
-       .dev.platform_data = &pb1500_pci_pd,
-       .name           = "alchemy-pci",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(alchemy_pci_host_res),
-       .resource       = alchemy_pci_host_res,
-};
-
-static int __init pb1500_dev_init(void)
-{
-       int swapped;
-
-       irq_set_irq_type(AU1500_GPIO9_INT,   IRQF_TRIGGER_LOW);   /* CD0# */
-       irq_set_irq_type(AU1500_GPIO10_INT,  IRQF_TRIGGER_LOW);  /* CARD0 */
-       irq_set_irq_type(AU1500_GPIO11_INT,  IRQF_TRIGGER_LOW);  /* STSCHG0# */
-       irq_set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
-       irq_set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
-       irq_set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
-       irq_set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
-       irq_set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
-
-       /* PCMCIA. single socket, identical to Pb1100 */
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
-               AU1500_GPIO11_INT, AU1500_GPIO9_INT,     /* card / insert */
-               /*AU1500_GPIO10_INT*/0, 0, 0); /* stschg / eject / id */
-
-       swapped = bcsr_read(BCSR_STATUS) &  BCSR_STATUS_DB1000_SWAPBOOT;
-       db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
-       platform_device_register(&pb1500_pci_host);
-
-       return 0;
-}
-arch_initcall(pb1500_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1550.c b/arch/mips/alchemy/devboards/pb1550.c
deleted file mode 100644 (file)
index b37e7de..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Pb1550 board support.
- *
- * Copyright (C) 2009-2011 Manuel Lauss
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <linux/dma-mapping.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <asm/mach-au1x00/au1000.h>
-#include <asm/mach-au1x00/au1xxx_dbdma.h>
-#include <asm/mach-au1x00/au1550nd.h>
-#include <asm/mach-au1x00/gpio.h>
-#include <asm/mach-db1x00/bcsr.h>
-#include "platform.h"
-
-const char *get_system_type(void)
-{
-       return "PB1550";
-}
-
-void __init board_setup(void)
-{
-       u32 pin_func;
-
-       bcsr_init(PB1550_BCSR_PHYS_ADDR,
-                 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
-
-       alchemy_gpio2_enable();
-
-       /*
-        * Enable PSC1 SYNC for AC'97.  Normaly done in audio driver,
-        * but it is board specific code, so put it here.
-        */
-       pin_func = au_readl(SYS_PINFUNC);
-       au_sync();
-       pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
-       au_writel(pin_func, SYS_PINFUNC);
-
-       bcsr_write(BCSR_PCMCIA, 0);     /* turn off PCMCIA power */
-
-       printk(KERN_INFO "AMD Alchemy Pb1550 Board\n");
-}
-
-/******************************************************************************/
-
-static int pb1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
-{
-       if ((slot < 12) || (slot > 13) || pin == 0)
-               return -1;
-       if (slot == 12) {
-               switch (pin) {
-               case 1: return AU1500_PCI_INTB;
-               case 2: return AU1500_PCI_INTC;
-               case 3: return AU1500_PCI_INTD;
-               case 4: return AU1500_PCI_INTA;
-               }
-       }
-       if (slot == 13) {
-               switch (pin) {
-               case 1: return AU1500_PCI_INTA;
-               case 2: return AU1500_PCI_INTB;
-               case 3: return AU1500_PCI_INTC;
-               case 4: return AU1500_PCI_INTD;
-               }
-       }
-       return -1;
-}
-
-static struct resource alchemy_pci_host_res[] = {
-       [0] = {
-               .start  = AU1500_PCI_PHYS_ADDR,
-               .end    = AU1500_PCI_PHYS_ADDR + 0xfff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct alchemy_pci_platdata pb1550_pci_pd = {
-       .board_map_irq  = pb1550_map_pci_irq,
-};
-
-static struct platform_device pb1550_pci_host = {
-       .dev.platform_data = &pb1550_pci_pd,
-       .name           = "alchemy-pci",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(alchemy_pci_host_res),
-       .resource       = alchemy_pci_host_res,
-};
-
-static struct resource au1550_psc2_res[] = {
-       [0] = {
-               .start  = AU1550_PSC2_PHYS_ADDR,
-               .end    = AU1550_PSC2_PHYS_ADDR + 0xfff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = AU1550_PSC2_INT,
-               .end    = AU1550_PSC2_INT,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [2] = {
-               .start  = AU1550_DSCR_CMD0_PSC2_TX,
-               .end    = AU1550_DSCR_CMD0_PSC2_TX,
-               .flags  = IORESOURCE_DMA,
-       },
-       [3] = {
-               .start  = AU1550_DSCR_CMD0_PSC2_RX,
-               .end    = AU1550_DSCR_CMD0_PSC2_RX,
-               .flags  = IORESOURCE_DMA,
-       },
-};
-
-static struct platform_device pb1550_i2c_dev = {
-       .name           = "au1xpsc_smbus",
-       .id             = 0,    /* bus number */
-       .num_resources  = ARRAY_SIZE(au1550_psc2_res),
-       .resource       = au1550_psc2_res,
-};
-
-static struct mtd_partition pb1550_nand_parts[] = {
-       [0] = {
-               .name   = "NAND FS 0",
-               .offset = 0,
-               .size   = 8 * 1024 * 1024,
-       },
-       [1] = {
-               .name   = "NAND FS 1",
-               .offset = MTDPART_OFS_APPEND,
-               .size   = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct au1550nd_platdata pb1550_nand_pd = {
-       .parts          = pb1550_nand_parts,
-       .num_parts      = ARRAY_SIZE(pb1550_nand_parts),
-       .devwidth       = 0,    /* x8 NAND default, needs fixing up */
-};
-
-static struct resource pb1550_nand_res[] = {
-       [0] = {
-               .start  = 0x20000000,
-               .end    = 0x20000fff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device pb1550_nand_dev = {
-       .name           = "au1550-nand",
-       .id             = -1,
-       .resource       = pb1550_nand_res,
-       .num_resources  = ARRAY_SIZE(pb1550_nand_res),
-       .dev            = {
-               .platform_data  = &pb1550_nand_pd,
-       },
-};
-
-static void __init pb1550_nand_setup(void)
-{
-       int boot_swapboot = (au_readl(MEM_STSTAT) & (0x7 << 1)) |
-                           ((bcsr_read(BCSR_STATUS) >> 6) & 0x1);
-
-       switch (boot_swapboot) {
-       case 0:
-       case 2:
-       case 8:
-       case 0xC:
-       case 0xD:
-               /* x16 NAND Flash */
-               pb1550_nand_pd.devwidth = 1;
-               /* fallthrough */
-       case 1:
-       case 9:
-       case 3:
-       case 0xE:
-       case 0xF:
-               /* x8 NAND, already set up */
-               platform_device_register(&pb1550_nand_dev);
-       }
-}
-
-static int __init pb1550_dev_init(void)
-{
-       int swapped;
-
-       irq_set_irq_type(AU1550_GPIO0_INT, IRQF_TRIGGER_LOW);
-       irq_set_irq_type(AU1550_GPIO1_INT, IRQF_TRIGGER_LOW);
-       irq_set_irq_type(AU1550_GPIO201_205_INT, IRQF_TRIGGER_HIGH);
-
-       /* enable both PCMCIA card irqs in the shared line */
-       alchemy_gpio2_enable_int(201);
-       alchemy_gpio2_enable_int(202);
-
-       /* Pb1550, like all others, also has statuschange irqs; however they're
-       * wired up on one of the Au1550's shared GPIO201_205 line, which also
-       * services the PCMCIA card interrupts.  So we ignore statuschange and
-       * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
-       * drivers are used to shared irqs and b) statuschange isn't really use-
-       * ful anyway.
-       */
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
-               AU1550_GPIO201_205_INT, AU1550_GPIO0_INT, 0, 0, 0);
-
-       db1x_register_pcmcia_socket(
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
-               AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x008000000,
-               AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x008400000 - 1,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x008000000,
-               AU1000_PCMCIA_IO_PHYS_ADDR   + 0x008010000 - 1,
-               AU1550_GPIO201_205_INT, AU1550_GPIO1_INT, 0, 0, 1);
-
-       /* NAND setup */
-       gpio_direction_input(206);      /* GPIO206 high */
-       pb1550_nand_setup();
-
-       swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_PB1550_SWAPBOOT;
-       db1x_register_norflash(128 * 1024 * 1024, 4, swapped);
-       platform_device_register(&pb1550_pci_host);
-       platform_device_register(&pb1550_i2c_dev);
-
-       return 0;
-}
-arch_initcall(pb1550_dev_init);
index f39042e99d0d45626305a34135e4d8d0f9c01ac4..8df86eb94972e06c14971b21f565d241c43313d5 100644 (file)
@@ -36,11 +36,10 @@ void __init prom_init(void)
 
 void prom_putchar(unsigned char c)
 {
-#ifdef CONFIG_MIPS_DB1300
-       alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c);
-#else
-       alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
-#endif
+       if (alchemy_get_cputype() == ALCHEMY_CPU_AU1300)
+               alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c);
+       else
+               alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
 }
 
 
index 3112df8f90dbc9726166f13e93a82c441efc5a27..4bee55b93f6a2fc2416ff0aa7ec0424a44ca1572 100644 (file)
@@ -2,9 +2,5 @@
 
 void putc(char c)
 {
-#ifdef CONFIG_MIPS_DB1300
-       alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c);
-#else
        alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
-#endif
 }
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
deleted file mode 100644 (file)
index 1f69249..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_MIPS_DB1200=y
-CONFIG_KSM=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_HZ_100=y
-# CONFIG_SECCOMP is not set
-CONFIG_EXPERIMENTAL=y
-CONFIG_LOCALVERSION="-db1200"
-CONFIG_KERNEL_LZMA=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EXPERT=y
-# CONFIG_SYSCTL_SYSCALL is not set
-# CONFIG_KALLSYMS is not set
-# CONFIG_PCSPKR_PLATFORM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_LBDAF is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_BINFMT_MISC=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_WIRELESS is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_UB=y
-# CONFIG_MISC_DEVICES is not set
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECS=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_IDE_TASK_IOCTL=y
-# CONFIG_IDE_PROC_FS is not set
-CONFIG_BLK_DEV_IDE_AU1XXX=y
-CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_SMC91X=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_WLAN is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=2
-CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-# CONFIG_I2C_COMPAT is not set
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_AU1550=y
-CONFIG_SPI=y
-CONFIG_SPI_AU1550=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_SENSORS_ADM1025=y
-CONFIG_SENSORS_LM70=y
-CONFIG_FB=y
-CONFIG_FB_AU1200=y
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x16=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_DYNAMIC_MINORS=y
-# CONFIG_SND_SUPPORT_OLD_API is not set
-# CONFIG_SND_VERBOSE_PROCFS is not set
-# CONFIG_SND_DRIVERS is not set
-# CONFIG_SND_SPI is not set
-# CONFIG_SND_MIPS is not set
-# CONFIG_SND_USB is not set
-# CONFIG_SND_PCMCIA is not set
-CONFIG_SND_SOC=y
-CONFIG_SND_SOC_AU1XPSC=y
-CONFIG_SND_SOC_DB1200=y
-CONFIG_HIDRAW=y
-CONFIG_USB_HIDDEV=y
-CONFIG_USB=y
-CONFIG_USB_DEBUG=y
-CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-# CONFIG_USB_DEVICE_CLASS is not set
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_MMC=y
-# CONFIG_MMC_BLOCK_BOUNCE is not set
-CONFIG_MMC_AU1X=y
-CONFIG_NEW_LEDS=y
-CONFIG_LEDS_CLASS=y
-CONFIG_LEDS_TRIGGERS=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT2_FS=y
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_SQUASHFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_EFI_PARTITION=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_2=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_UTF8=y
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_FTRACE is not set
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,115200"
-CONFIG_DEBUG_ZBOOT=y
-CONFIG_KEYS=y
-CONFIG_KEYS_DEBUG_PROC_KEYS=y
-CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/db1235_defconfig b/arch/mips/configs/db1235_defconfig
new file mode 100644 (file)
index 0000000..c48998f
--- /dev/null
@@ -0,0 +1,434 @@
+CONFIG_MIPS_ALCHEMY=y
+CONFIG_MIPS_DB1235=y
+CONFIG_COMPACTION=y
+CONFIG_KSM=y
+CONFIG_HZ_100=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCALVERSION="-db1235"
+CONFIG_KERNEL_LZMA=y
+CONFIG_DEFAULT_HOSTNAME="db1235"
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_FHANDLE=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_AUDIT=y
+CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_NAMESPACES=y
+CONFIG_EMBEDDED=y
+CONFIG_SLAB=y
+CONFIG_JUMP_LABEL=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_LDM_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_PCI=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_UNIX_DIAG=y
+CONFIG_XFRM_USER=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=y
+CONFIG_NET_IPGRE_DEMUX=y
+CONFIG_NET_IPGRE=y
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_ARPD=y
+CONFIG_SYN_COOKIES=y
+CONFIG_NET_IPVTI=y
+CONFIG_INET_AH=y
+CONFIG_INET_ESP=y
+CONFIG_INET_IPCOMP=y
+CONFIG_INET_UDP_DIAG=y
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_HSTCP=y
+CONFIG_TCP_CONG_HYBLA=y
+CONFIG_TCP_CONG_SCALABLE=y
+CONFIG_TCP_CONG_LP=y
+CONFIG_TCP_CONG_VENO=y
+CONFIG_TCP_CONG_YEAH=y
+CONFIG_TCP_CONG_ILLINOIS=y
+CONFIG_DEFAULT_HYBLA=y
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTER_PREF=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_OPTIMISTIC_DAD=y
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+CONFIG_INET6_IPCOMP=y
+CONFIG_IPV6_MIP6=y
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
+CONFIG_IPV6_SIT_6RD=y
+CONFIG_IPV6_TUNNEL=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
+CONFIG_IPV6_PIMSM_V2=y
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CONNTRACK_TIMEOUT=y
+CONFIG_NF_CONNTRACK_TIMESTAMP=y
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_SCTP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
+CONFIG_NF_CONNTRACK_AMANDA=y
+CONFIG_NF_CONNTRACK_FTP=y
+CONFIG_NF_CONNTRACK_H323=y
+CONFIG_NF_CONNTRACK_IRC=y
+CONFIG_NF_CONNTRACK_NETBIOS_NS=y
+CONFIG_NF_CONNTRACK_SNMP=y
+CONFIG_NF_CONNTRACK_PPTP=y
+CONFIG_NF_CONNTRACK_SANE=y
+CONFIG_NF_CONNTRACK_SIP=y
+CONFIG_NF_CONNTRACK_TFTP=y
+CONFIG_NF_CT_NETLINK=y
+CONFIG_NF_CT_NETLINK_TIMEOUT=y
+CONFIG_NF_CT_NETLINK_HELPER=y
+CONFIG_NETFILTER_NETLINK_QUEUE_CT=y
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_HMARK=y
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
+CONFIG_NETFILTER_XT_TARGET_LED=y
+CONFIG_NETFILTER_XT_TARGET_LOG=y
+CONFIG_NETFILTER_XT_TARGET_MARK=y
+CONFIG_NETFILTER_XT_TARGET_NFLOG=y
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
+CONFIG_NETFILTER_XT_TARGET_TEE=y
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
+CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
+CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
+CONFIG_NETFILTER_XT_MATCH_COMMENT=y
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_CPU=y
+CONFIG_NETFILTER_XT_MATCH_DCCP=y
+CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
+CONFIG_NETFILTER_XT_MATCH_DSCP=y
+CONFIG_NETFILTER_XT_MATCH_ESP=y
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
+CONFIG_NETFILTER_XT_MATCH_HELPER=y
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
+CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+CONFIG_NETFILTER_XT_MATCH_LIMIT=y
+CONFIG_NETFILTER_XT_MATCH_MAC=y
+CONFIG_NETFILTER_XT_MATCH_MARK=y
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
+CONFIG_NETFILTER_XT_MATCH_NFACCT=y
+CONFIG_NETFILTER_XT_MATCH_OSF=y
+CONFIG_NETFILTER_XT_MATCH_OWNER=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA=y
+CONFIG_NETFILTER_XT_MATCH_RATEEST=y
+CONFIG_NETFILTER_XT_MATCH_REALM=y
+CONFIG_NETFILTER_XT_MATCH_RECENT=y
+CONFIG_NETFILTER_XT_MATCH_SCTP=y
+CONFIG_NETFILTER_XT_MATCH_STATE=y
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
+CONFIG_NETFILTER_XT_MATCH_STRING=y
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
+CONFIG_NETFILTER_XT_MATCH_TIME=y
+CONFIG_NETFILTER_XT_MATCH_U32=y
+CONFIG_NF_CONNTRACK_IPV4=y
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_AH=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_RPFILTER=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_ULOG=y
+CONFIG_NF_NAT=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_TARGET_CLUSTERIP=y
+CONFIG_IP_NF_TARGET_ECN=y
+CONFIG_IP_NF_TARGET_TTL=y
+CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_ARPTABLES=y
+CONFIG_IP_NF_ARPFILTER=y
+CONFIG_IP_NF_ARP_MANGLE=y
+CONFIG_NF_CONNTRACK_IPV6=y
+CONFIG_IP6_NF_IPTABLES=y
+CONFIG_IP6_NF_MATCH_AH=y
+CONFIG_IP6_NF_MATCH_EUI64=y
+CONFIG_IP6_NF_MATCH_FRAG=y
+CONFIG_IP6_NF_MATCH_OPTS=y
+CONFIG_IP6_NF_MATCH_HL=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_MATCH_MH=y
+CONFIG_IP6_NF_MATCH_RPFILTER=y
+CONFIG_IP6_NF_MATCH_RT=y
+CONFIG_IP6_NF_TARGET_HL=y
+CONFIG_IP6_NF_FILTER=y
+CONFIG_IP6_NF_TARGET_REJECT=y
+CONFIG_IP6_NF_MANGLE=y
+CONFIG_IP6_NF_RAW=y
+CONFIG_BRIDGE_NF_EBTABLES=y
+CONFIG_BRIDGE_EBT_BROUTE=y
+CONFIG_BRIDGE_EBT_T_FILTER=y
+CONFIG_BRIDGE_EBT_T_NAT=y
+CONFIG_BRIDGE_EBT_802_3=y
+CONFIG_BRIDGE_EBT_AMONG=y
+CONFIG_BRIDGE_EBT_ARP=y
+CONFIG_BRIDGE_EBT_IP=y
+CONFIG_BRIDGE_EBT_IP6=y
+CONFIG_BRIDGE_EBT_LIMIT=y
+CONFIG_BRIDGE_EBT_MARK=y
+CONFIG_BRIDGE_EBT_PKTTYPE=y
+CONFIG_BRIDGE_EBT_STP=y
+CONFIG_BRIDGE_EBT_VLAN=y
+CONFIG_BRIDGE_EBT_ARPREPLY=y
+CONFIG_BRIDGE_EBT_DNAT=y
+CONFIG_BRIDGE_EBT_MARK_T=y
+CONFIG_BRIDGE_EBT_REDIRECT=y
+CONFIG_BRIDGE_EBT_SNAT=y
+CONFIG_BRIDGE_EBT_LOG=y
+CONFIG_BRIDGE_EBT_NFLOG=y
+CONFIG_L2TP=y
+CONFIG_L2TP_V3=y
+CONFIG_L2TP_IP=y
+CONFIG_L2TP_ETH=y
+CONFIG_BRIDGE=y
+CONFIG_VLAN_8021Q=y
+CONFIG_VLAN_8021Q_GVRP=y
+CONFIG_LLC2=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=y
+CONFIG_NET_SCH_HTB=y
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
+CONFIG_NET_SCH_MULTIQ=y
+CONFIG_NET_SCH_RED=y
+CONFIG_NET_SCH_SFB=y
+CONFIG_NET_SCH_SFQ=y
+CONFIG_NET_SCH_TEQL=y
+CONFIG_NET_SCH_TBF=y
+CONFIG_NET_SCH_GRED=y
+CONFIG_NET_SCH_DSMARK=y
+CONFIG_NET_SCH_NETEM=y
+CONFIG_NET_SCH_DRR=y
+CONFIG_NET_SCH_MQPRIO=y
+CONFIG_NET_SCH_CHOKE=y
+CONFIG_NET_SCH_QFQ=y
+CONFIG_NET_SCH_CODEL=y
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_INGRESS=y
+CONFIG_NET_SCH_PLUG=y
+CONFIG_NET_CLS_BASIC=y
+CONFIG_NET_CLS_TCINDEX=y
+CONFIG_NET_CLS_ROUTE4=y
+CONFIG_NET_CLS_FW=y
+CONFIG_NET_CLS_U32=y
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=y
+CONFIG_NET_CLS_RSVP6=y
+CONFIG_NET_CLS_FLOW=y
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_CMP=y
+CONFIG_NET_EMATCH_NBYTE=y
+CONFIG_NET_EMATCH_U32=y
+CONFIG_NET_EMATCH_META=y
+CONFIG_NET_EMATCH_TEXT=y
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=y
+CONFIG_NET_ACT_GACT=y
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=y
+CONFIG_NET_ACT_NAT=y
+CONFIG_NET_ACT_PEDIT=y
+CONFIG_NET_ACT_SIMP=y
+CONFIG_NET_ACT_SKBEDIT=y
+CONFIG_NET_ACT_CSUM=y
+CONFIG_NET_CLS_IND=y
+CONFIG_BT=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+CONFIG_BT_HCIBTUSB=y
+CONFIG_CFG80211=y
+CONFIG_CFG80211_CERTIFICATION_ONUS=y
+CONFIG_CFG80211_WEXT=y
+CONFIG_MAC80211=y
+CONFIG_MAC80211_LEDS=y
+CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_PLATFORM=y
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=y
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE_AU1XXX=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_HPT37X=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_PATA_PLATFORM=y
+CONFIG_NETDEVICES=y
+CONFIG_MIPS_AU1X00_ENET=y
+CONFIG_SMC91X=y
+CONFIG_SMSC911X=y
+CONFIG_AMD_PHY=y
+CONFIG_SMSC_PHY=y
+CONFIG_RT2X00=y
+CONFIG_RT73USB=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_WM97XX=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_TTY_PRINTK=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_AU1550=y
+CONFIG_SPI=y
+CONFIG_SPI_AU1550=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_SENSORS_ADM1025=y
+CONFIG_SENSORS_LM70=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_HRTIMER=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_AU1XPSC=y
+CONFIG_SND_SOC_DB1200=y
+CONFIG_HIDRAW=y
+CONFIG_UHID=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB=y
+CONFIG_USB_DYNAMIC_MINORS=y
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_MMC=y
+CONFIG_MMC_CLKGATE=y
+CONFIG_MMC_AU1X=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_AU1XXX=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_XFS_FS=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_LZO=y
+CONFIG_SQUASHFS_XZ=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_CODEPAGE_852=y
+CONFIG_NLS_CODEPAGE_1250=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=y
+CONFIG_NLS_ISO8859_15=y
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_SECURITYFS=y
+CONFIG_CRYPTO_USER=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_CRYPTD=y
+CONFIG_CRYPTO_CCM=y
+CONFIG_CRYPTO_GCM=y
+CONFIG_CRYPTO_CTS=y
+CONFIG_CRYPTO_LRW=y
+CONFIG_CRYPTO_PCBC=y
+CONFIG_CRYPTO_XTS=y
+CONFIG_CRYPTO_XCBC=y
+CONFIG_CRYPTO_VMAC=y
+CONFIG_CRYPTO_MD4=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_RMD128=y
+CONFIG_CRYPTO_RMD160=y
+CONFIG_CRYPTO_RMD256=y
+CONFIG_CRYPTO_RMD320=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
+CONFIG_CRYPTO_TGR192=y
+CONFIG_CRYPTO_WP512=y
+CONFIG_CRYPTO_ANUBIS=y
+CONFIG_CRYPTO_BLOWFISH=y
+CONFIG_CRYPTO_CAMELLIA=y
+CONFIG_CRYPTO_CAST5=y
+CONFIG_CRYPTO_CAST6=y
+CONFIG_CRYPTO_FCRYPT=y
+CONFIG_CRYPTO_KHAZAD=y
+CONFIG_CRYPTO_SALSA20=y
+CONFIG_CRYPTO_SEED=y
+CONFIG_CRYPTO_SERPENT=y
+CONFIG_CRYPTO_TEA=y
+CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_ZLIB=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_USER_API_HASH=y
+CONFIG_CRYPTO_USER_API_SKCIPHER=y
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig
deleted file mode 100644 (file)
index 3590ab5..0000000
+++ /dev/null
@@ -1,391 +0,0 @@
-CONFIG_MIPS=y
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_ALCHEMY_GPIOINT_AU1300=y
-CONFIG_MIPS_DB1300=y
-CONFIG_SOC_AU1300=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_SCHED_OMIT_FRAME_POINTER=y
-CONFIG_CEVT_R4K_LIB=y
-CONFIG_CSRC_R4K_LIB=y
-CONFIG_DMA_COHERENT=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_IRQ_CPU=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-CONFIG_CPU_MIPS32_R1=y
-CONFIG_SYS_SUPPORTS_ZBOOT=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPSR1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_HARDWARE_WATCHPOINTS=y
-CONFIG_32BIT=y
-CONFIG_PAGE_SIZE_4KB=y
-CONFIG_FORCE_MAX_ZONEORDER=11
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_MIPS_MT_DISABLED=y
-CONFIG_64BIT_PHYS_ADDR=y
-CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
-CONFIG_COMPACTION=y
-CONFIG_MIGRATION=y
-CONFIG_PHYS_ADDR_T_64BIT=y
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_HZ_100=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_HZ=100
-CONFIG_PREEMPT_NONE=y
-CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-CONFIG_CONSTRUCTORS=y
-CONFIG_HAVE_IRQ_WORK=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_CROSS_COMPILE=""
-CONFIG_LOCALVERSION="-db1300"
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_KERNEL_LZMA=y
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-CONFIG_FHANDLE=y
-CONFIG_HAVE_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=19
-CONFIG_NAMESPACES=y
-CONFIG_UTS_NS=y
-CONFIG_IPC_NS=y
-CONFIG_USER_NS=y
-CONFIG_PID_NS=y
-CONFIG_NET_NS=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-CONFIG_EXPERT=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_EMBEDDED=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_SLAB=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_KPROBES=y
-CONFIG_HAVE_KRETPROBES=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_SLABINFO=y
-CONFIG_RT_MUTEXES=y
-CONFIG_BASE_SMALL=0
-CONFIG_BLOCK=y
-CONFIG_LBDAF=y
-CONFIG_BLK_DEV_BSG=y
-CONFIG_IOSCHED_NOOP=y
-CONFIG_DEFAULT_NOOP=y
-CONFIG_DEFAULT_IOSCHED="noop"
-# CONFIG_UNINLINE_SPIN_UNLOCK is not set
-CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
-CONFIG_INLINE_READ_UNLOCK=y
-CONFIG_INLINE_READ_UNLOCK_IRQ=y
-CONFIG_INLINE_WRITE_UNLOCK=y
-CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
-CONFIG_MMU=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA=y
-CONFIG_PCMCIA_LOAD_CIS=y
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_BINFMT_ELF=y
-CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_TRAD_SIGNALS=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-CONFIG_INET_TUNNEL=y
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-CONFIG_IPV6=y
-CONFIG_INET6_XFRM_MODE_TRANSPORT=y
-CONFIG_INET6_XFRM_MODE_TUNNEL=y
-CONFIG_INET6_XFRM_MODE_BEET=y
-CONFIG_IPV6_SIT=y
-CONFIG_IPV6_NDISC_NODETYPE=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_EXTRA_FIRMWARE=""
-CONFIG_MTD=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_IDS=y
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_BLK_DEV=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_UB=y
-CONFIG_HAVE_IDE=y
-CONFIG_IDE=y
-CONFIG_IDE_GD=y
-CONFIG_IDE_GD_ATA=y
-CONFIG_BLK_DEV_IDECS=y
-CONFIG_IDE_TASK_IOCTL=y
-CONFIG_IDE_PROC_FS=y
-CONFIG_BLK_DEV_PLATFORM=y
-CONFIG_SCSI_MOD=y
-CONFIG_NETDEVICES=y
-CONFIG_MII=y
-CONFIG_PHYLIB=y
-CONFIG_SMSC_PHY=y
-CONFIG_NET_ETHERNET=y
-CONFIG_SMSC911X=y
-CONFIG_INPUT=y
-CONFIG_INPUT_EVDEV=y
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_GPIO=y
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_WM97XX=y
-CONFIG_TOUCHSCREEN_WM9712=y
-CONFIG_TOUCHSCREEN_WM9713=y
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_SMBUS=y
-CONFIG_I2C_AU1550=y
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SPI_AU1550=y
-CONFIG_SPI_BITBANG=y
-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
-CONFIG_HWMON=y
-CONFIG_HWMON_VID=y
-CONFIG_SENSORS_ADM1025=y
-CONFIG_FB=y
-CONFIG_FB_AU1200=y
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_ACORN_8x8=y
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_CLUT224=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
-CONFIG_SND_JACK=y
-CONFIG_SND_HRTIMER=y
-CONFIG_SND_DYNAMIC_MINORS=y
-CONFIG_SND_VERBOSE_PROCFS=y
-CONFIG_SND_VERBOSE_PRINTK=y
-CONFIG_SND_VMASTER=y
-CONFIG_SND_AC97_CODEC=y
-CONFIG_SND_SOC=y
-CONFIG_SND_SOC_CACHE_LZO=y
-CONFIG_SND_SOC_AC97_BUS=y
-CONFIG_SND_SOC_AU1XPSC=y
-CONFIG_SND_SOC_AU1XPSC_I2S=y
-CONFIG_SND_SOC_AU1XPSC_AC97=y
-CONFIG_SND_SOC_DB1300=y
-CONFIG_SND_SOC_I2C_AND_SPI=y
-CONFIG_SND_SOC_WM8731=y
-CONFIG_SND_SOC_WM9712=y
-CONFIG_AC97_BUS=y
-CONFIG_HID_SUPPORT=y
-CONFIG_HID=y
-CONFIG_HIDRAW=y
-CONFIG_USB_HID=y
-CONFIG_USB_HIDDEV=y
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=y
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_EHCI_TT_NEWSCHED=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_LITTLE_ENDIAN=y
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_HCTOSYS=y
-CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-CONFIG_RTC_INTF_DEV_UIE_EMUL=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT2_FS=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_EXPORTFS=y
-CONFIG_FILE_LOCKING=y
-CONFIG_FSNOTIFY=y
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY_USER=y
-CONFIG_GENERIC_ACL=y
-CONFIG_FAT_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_TMPFS_XATTR=y
-CONFIG_MISC_FILESYSTEMS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_FS_XATTR=y
-CONFIG_JFFS2_FS_POSIX_ACL=y
-CONFIG_JFFS2_FS_SECURITY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_ZLIB=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RTIME=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_JFFS2_CMODE_PRIORITY=y
-CONFIG_SQUASHFS=y
-CONFIG_SQUASHFS_XZ=y
-CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_UTF8=y
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_PRINTK_TIME=y
-CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
-CONFIG_ENABLE_WARN_DEPRECATED=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_TRACING_SUPPORT=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="video=au1200fb:panel:bs console=tty console=ttyS2,115200"
-CONFIG_DEBUG_ZBOOT=y
-CONFIG_DEFAULT_SECURITY_DAC=y
-CONFIG_DEFAULT_SECURITY=""
-CONFIG_CRYPTO=y
-CONFIG_BITREVERSE=y
-CONFIG_CRC32=y
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_XZ_DEC=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-CONFIG_NLATTR=y
-CONFIG_GENERIC_ATOMIC64=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
deleted file mode 100644 (file)
index 36cda27..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-CONFIG_MIPS=y
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_MIPS_DB1550=y
-CONFIG_SCHED_OMIT_FRAME_POINTER=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_HZ_100=y
-CONFIG_HZ=100
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION="-db1550"
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_KERNEL_LZMA=y
-CONFIG_DEFAULT_HOSTNAME="db1550"
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-CONFIG_FHANDLE=y
-CONFIG_AUDIT=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=18
-CONFIG_NAMESPACES=y
-CONFIG_UTS_NS=y
-CONFIG_IPC_NS=y
-CONFIG_USER_NS=y
-CONFIG_PID_NS=y
-CONFIG_NET_NS=y
-CONFIG_EXPERT=y
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_EMBEDDED=y
-CONFIG_PCI_QUIRKS=y
-CONFIG_SLAB=y
-CONFIG_BLOCK=y
-CONFIG_LBDAF=y
-CONFIG_BLK_DEV_BSG=y
-CONFIG_BLK_DEV_BSGLIB=y
-CONFIG_IOSCHED_NOOP=y
-CONFIG_DEFAULT_NOOP=y
-CONFIG_DEFAULT_IOSCHED="noop"
-CONFIG_PCI=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA=y
-CONFIG_PCMCIA_LOAD_CIS=y
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_BINFMT_ELF=y
-CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_BINFMT_MISC=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-CONFIG_PM_SLEEP=y
-CONFIG_PM_RUNTIME=y
-CONFIG_PM=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-CONFIG_INET_TUNNEL=y
-CONFIG_INET_LRO=y
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-CONFIG_IPV6=y
-CONFIG_INET6_XFRM_MODE_TRANSPORT=y
-CONFIG_INET6_XFRM_MODE_TUNNEL=y
-CONFIG_INET6_XFRM_MODE_BEET=y
-CONFIG_IPV6_SIT=y
-CONFIG_IPV6_NDISC_NODETYPE=y
-CONFIG_DNS_RESOLVER=y
-CONFIG_UEVENT_HELPER_PATH=""
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_MTD=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_IDS=y
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_MISC_DEVICES=y
-CONFIG_EEPROM_AT24=y
-CONFIG_SCSI_MOD=y
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_SG=y
-CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_SCAN_ASYNC=y
-CONFIG_ATA=y
-CONFIG_ATA_SFF=y
-CONFIG_ATA_BMDMA=y
-CONFIG_PATA_HPT37X=y
-CONFIG_PATA_PCMCIA=y
-CONFIG_MD=y
-CONFIG_BLK_DEV_DM=y
-CONFIG_NETDEVICES=y
-CONFIG_MII=y
-CONFIG_PHYLIB=y
-CONFIG_NET_ETHERNET=y
-CONFIG_MIPS_AU1X00_ENET=y
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=y
-CONFIG_PCMCIA_PCNET=y
-CONFIG_INPUT=y
-CONFIG_INPUT_EVDEV=y
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
-CONFIG_DEVKMEM=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_DEVPORT=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_AU1550=y
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SPI_AU1550=y
-CONFIG_SPI_BITBANG=y
-CONFIG_HWMON=y
-CONFIG_SENSORS_ADM1025=y
-CONFIG_SENSORS_LM70=y
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
-CONFIG_SND_JACK=y
-CONFIG_SND_VMASTER=y
-CONFIG_SND_AC97_CODEC=y
-CONFIG_SND_SOC=y
-CONFIG_SND_SOC_AC97_BUS=y
-CONFIG_SND_SOC_AU1XPSC=y
-CONFIG_SND_SOC_AU1XPSC_I2S=y
-CONFIG_SND_SOC_AU1XPSC_AC97=y
-CONFIG_SND_SOC_DB1200=y
-CONFIG_SND_SOC_I2C_AND_SPI=y
-CONFIG_SND_SOC_AC97_CODEC=y
-CONFIG_SND_SOC_WM8731=y
-CONFIG_SND_SOC_WM9712=y
-CONFIG_AC97_BUS=y
-CONFIG_USB=y
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_EHCI_TT_NEWSCHED=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_LITTLE_ENDIAN=y
-CONFIG_USB_UHCI_HCD=y
-CONFIG_USB_STORAGE=y
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_HCTOSYS=y
-CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT4_FS=y
-CONFIG_EXT4_USE_FOR_EXT23=y
-CONFIG_EXT4_FS_XATTR=y
-CONFIG_EXT4_FS_POSIX_ACL=y
-CONFIG_EXT4_FS_SECURITY=y
-CONFIG_JBD2=y
-CONFIG_FS_MBCACHE=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_EXPORTFS=y
-CONFIG_FILE_LOCKING=y
-CONFIG_FSNOTIFY=y
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY_USER=y
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-CONFIG_CONFIGFS_FS=y
-CONFIG_MISC_FILESYSTEMS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_FS_XATTR=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_ZLIB=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RTIME=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_JFFS2_CMODE_PRIORITY=y
-CONFIG_SQUASHFS=y
-CONFIG_SQUASHFS_ZLIB=y
-CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NFS_V4_1=y
-CONFIG_PNFS_FILE_LAYOUT=y
-CONFIG_PNFS_BLOCK=y
-CONFIG_ROOT_NFS=y
-CONFIG_NFS_USE_KERNEL_DNS=y
-CONFIG_NFS_USE_NEW_IDMAPPER=y
-CONFIG_NFSD=y
-CONFIG_NFSD_V2_ACL=y
-CONFIG_NFSD_V3=y
-CONFIG_NFSD_V3_ACL=y
-CONFIG_NFSD_V4=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_ACL_SUPPORT=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
-CONFIG_SUNRPC_BACKCHANNEL=y
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_UTF8=y
-CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
-CONFIG_FRAME_WARN=1024
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="noirqdebug console=ttyS0,115200 root=/dev/sda1 rootfstype=ext4"
-CONFIG_KEYS=y
-CONFIG_SECURITYFS=y
-CONFIG_DEFAULT_SECURITY_DAC=y
-CONFIG_BITREVERSE=y
-CONFIG_CRC16=y
-CONFIG_CRC_ITU_T=y
-CONFIG_CRC32=y
-CONFIG_AUDIT_GENERIC=y
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_BCH=y
-CONFIG_NLATTR=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
deleted file mode 100644 (file)
index 75eb1b1..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_MIPS_PB1100=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_HZ_100=y
-# CONFIG_SECCOMP is not set
-CONFIG_EXPERIMENTAL=y
-CONFIG_LOCALVERSION="-pb1100"
-CONFIG_KERNEL_LZMA=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EXPERT=y
-# CONFIG_SYSCTL_SYSCALL is not set
-# CONFIG_KALLSYMS is not set
-# CONFIG_PCSPKR_PLATFORM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_LBDAF is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_PM=y
-CONFIG_PM_RUNTIME=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_WIRELESS is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_UB=y
-# CONFIG_MISC_DEVICES is not set
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECS=y
-CONFIG_IDE_TASK_IOCTL=y
-# CONFIG_IDE_PROC_FS is not set
-CONFIG_NETDEVICES=y
-CONFIG_MARVELL_PHY=y
-CONFIG_DAVICOM_PHY=y
-CONFIG_QSEMI_PHY=y
-CONFIG_LXT_PHY=y
-CONFIG_CICADA_PHY=y
-CONFIG_VITESSE_PHY=y
-CONFIG_SMSC_PHY=y
-CONFIG_BROADCOM_PHY=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_REALTEK_PHY=y
-CONFIG_NATIONAL_PHY=y
-CONFIG_STE10XP=y
-CONFIG_LSI_ET1011C_PHY=y
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_WLAN is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_HIDRAW=y
-CONFIG_USB_HIDDEV=y
-CONFIG_USB=y
-# CONFIG_USB_DEVICE_CLASS is not set
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_SUSPEND=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT2_FS=y
-# CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_FS_XATTR=y
-# CONFIG_JFFS2_FS_POSIX_ACL is not set
-# CONFIG_JFFS2_FS_SECURITY is not set
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_SQUASHFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_ZBOOT=y
-CONFIG_KEYS=y
-CONFIG_KEYS_DEBUG_PROC_KEYS=y
-CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
deleted file mode 100644 (file)
index fa00487..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_MIPS_PB1500=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_HZ_100=y
-# CONFIG_SECCOMP is not set
-CONFIG_EXPERIMENTAL=y
-CONFIG_LOCALVERSION="-pb1500"
-CONFIG_KERNEL_LZMA=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EXPERT=y
-# CONFIG_SYSCTL_SYSCALL is not set
-# CONFIG_KALLSYMS is not set
-# CONFIG_PCSPKR_PLATFORM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_PCI=y
-CONFIG_PCCARD=y
-# CONFIG_CARDBUS is not set
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_PM=y
-CONFIG_PM_RUNTIME=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_WIRELESS is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_UB=y
-# CONFIG_MISC_DEVICES is not set
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECS=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_IDE_TASK_IOCTL=y
-# CONFIG_IDEPCI_PCIBUS_ORDER is not set
-CONFIG_BLK_DEV_HPT366=y
-CONFIG_NETDEVICES=y
-CONFIG_MARVELL_PHY=y
-CONFIG_DAVICOM_PHY=y
-CONFIG_QSEMI_PHY=y
-CONFIG_LXT_PHY=y
-CONFIG_CICADA_PHY=y
-CONFIG_VITESSE_PHY=y
-CONFIG_SMSC_PHY=y
-CONFIG_BROADCOM_PHY=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_REALTEK_PHY=y
-CONFIG_NATIONAL_PHY=y
-CONFIG_STE10XP=y
-CONFIG_LSI_ET1011C_PHY=y
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_WLAN is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-# CONFIG_SERIAL_8250_PCI is not set
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-# CONFIG_VGA_ARB is not set
-CONFIG_FB=y
-CONFIG_FIRMWARE_EDID=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_S1D13XXX=y
-CONFIG_USB_HIDDEV=y
-CONFIG_USB=y
-# CONFIG_USB_DEVICE_CLASS is not set
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_OTG_WHITELIST=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT2_FS=y
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_SQUASHFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_UTF8=y
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_ZBOOT=y
-CONFIG_KEYS=y
-CONFIG_KEYS_DEBUG_PROC_KEYS=y
-CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
deleted file mode 100644 (file)
index e83d649..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-CONFIG_MIPS_ALCHEMY=y
-CONFIG_MIPS_PB1550=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_HZ_100=y
-# CONFIG_SECCOMP is not set
-CONFIG_EXPERIMENTAL=y
-CONFIG_LOCALVERSION="-pb1550"
-CONFIG_KERNEL_LZMA=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_TINY_RCU=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EXPERT=y
-# CONFIG_SYSCTL_SYSCALL is not set
-# CONFIG_KALLSYMS is not set
-# CONFIG_PCSPKR_PLATFORM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_PCI=y
-CONFIG_PCCARD=y
-# CONFIG_CARDBUS is not set
-CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
-CONFIG_PM=y
-CONFIG_PM_RUNTIME=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_AU1550=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_UB=y
-# CONFIG_MISC_DEVICES is not set
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECS=y
-CONFIG_BLK_DEV_IDECD=y
-# CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS is not set
-# CONFIG_IDEPCI_PCIBUS_ORDER is not set
-CONFIG_BLK_DEV_HPT366=y
-CONFIG_NETDEVICES=y
-CONFIG_MARVELL_PHY=y
-CONFIG_DAVICOM_PHY=y
-CONFIG_QSEMI_PHY=y
-CONFIG_LXT_PHY=y
-CONFIG_CICADA_PHY=y
-CONFIG_VITESSE_PHY=y
-CONFIG_SMSC_PHY=y
-CONFIG_BROADCOM_PHY=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_REALTEK_PHY=y
-CONFIG_NATIONAL_PHY=y
-CONFIG_STE10XP=y
-CONFIG_LSI_ET1011C_PHY=y
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_WLAN is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-# CONFIG_SERIAL_8250_PCI is not set
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-# CONFIG_I2C_COMPAT is not set
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_AU1550=y
-# CONFIG_HWMON is not set
-# CONFIG_VGA_ARB is not set
-CONFIG_HIDRAW=y
-CONFIG_USB_HIDDEV=y
-CONFIG_USB=y
-CONFIG_USB_DEVICEFS=y
-CONFIG_USB_DYNAMIC_MINORS=y
-CONFIG_USB_SUSPEND=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_ROOT_HUB_TT=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_AU1XXX=y
-CONFIG_EXT2_FS=y
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=y
-CONFIG_VFAT_FS=y
-# CONFIG_PROC_PAGE_MONITOR is not set
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_SQUASHFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_UTF8=y
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_ZBOOT=y
-CONFIG_KEYS=y
-CONFIG_KEYS_DEBUG_PROC_KEYS=y
-CONFIG_SECURITYFS=y
index f53f9ca73996de669ba0d500f7a8f78bfa13adcf..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,5 +0,0 @@
-include include/asm-generic/Kbuild.asm
-
-header-y += cachectl.h
-header-y += sgidefs.h
-header-y += sysmips.h
index 3f4c5cb6433e2ac4765330353207d608cb1c68ed..01cc6ba64831f6973d2fb673a66f385612ea809d 100644 (file)
@@ -59,8 +59,8 @@ static __inline__ void atomic_add(int i, atomic_t * v)
                "       sc      %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
-               : "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter));
+               : "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                int temp;
 
@@ -71,8 +71,8 @@ static __inline__ void atomic_add(int i, atomic_t * v)
                        "       addu    %0, %2                          \n"
                        "       sc      %0, %1                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter));
+                       : "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!temp));
        } else {
                unsigned long flags;
@@ -102,8 +102,8 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
                "       sc      %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
-               : "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter));
+               : "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                int temp;
 
@@ -114,8 +114,8 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
                        "       subu    %0, %2                          \n"
                        "       sc      %0, %1                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter));
+                       : "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!temp));
        } else {
                unsigned long flags;
@@ -146,9 +146,8 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
                "       beqzl   %0, 1b                                  \n"
                "       addu    %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter)
-               : "memory");
+               : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                int temp;
 
@@ -159,9 +158,8 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
                        "       addu    %0, %1, %3                      \n"
                        "       sc      %0, %2                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter)
-                       : "memory");
+                       : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!result));
 
                result = temp + i;
@@ -212,9 +210,8 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
                        "       subu    %0, %1, %3                      \n"
                        "       sc      %0, %2                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter)
-                       : "memory");
+                       : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!result));
 
                result = temp - i;
@@ -262,7 +259,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
                "       .set    reorder                                 \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+               : "=&r" (result), "=&r" (temp), "+m" (v->counter)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (kernel_uses_llsc) {
@@ -280,9 +277,8 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
                "       .set    reorder                                 \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter)
-               : "memory");
+               : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else {
                unsigned long flags;
 
@@ -430,8 +426,8 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
-               : "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter));
+               : "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                long temp;
 
@@ -442,8 +438,8 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                        "       daddu   %0, %2                          \n"
                        "       scd     %0, %1                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter));
+                       : "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!temp));
        } else {
                unsigned long flags;
@@ -473,8 +469,8 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
-               : "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter));
+               : "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                long temp;
 
@@ -485,8 +481,8 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                        "       dsubu   %0, %2                          \n"
                        "       scd     %0, %1                          \n"
                        "       .set    mips0                           \n"
-                       : "=&r" (temp), "=m" (v->counter)
-                       : "Ir" (i), "m" (v->counter));
+                       : "=&r" (temp), "+m" (v->counter)
+                       : "Ir" (i));
                } while (unlikely(!temp));
        } else {
                unsigned long flags;
@@ -517,9 +513,8 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                "       beqzl   %0, 1b                                  \n"
                "       daddu   %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter)
-               : "memory");
+               : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else if (kernel_uses_llsc) {
                long temp;
 
@@ -649,9 +644,8 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
                "       .set    reorder                                 \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
-               : "=&r" (result), "=&r" (temp), "=m" (v->counter)
-               : "Ir" (i), "m" (v->counter)
-               : "memory");
+               : "=&r" (result), "=&r" (temp), "+m" (v->counter)
+               : "Ir" (i));
        } else {
                unsigned long flags;
 
index 63002a240c738d7ad2d02b6677816cfb0f6afba8..c507b931b484c69913fc2aedc1a9a960b2b317d4 100644 (file)
 #define cpu_has_dsp            (cpu_data[0].ases & MIPS_ASE_DSP)
 #endif
 
+#ifndef cpu_has_dsp2
+#define cpu_has_dsp2           (cpu_data[0].ases & MIPS_ASE_DSP2P)
+#endif
+
 #ifndef cpu_has_mipsmt
 #define cpu_has_mipsmt         (cpu_data[0].ases & MIPS_ASE_MIPSMT)
 #endif
 #define cpu_hwrena_impl_bits           0
 #endif
 
+#ifndef cpu_has_perf_cntr_intr_bit
+#define cpu_has_perf_cntr_intr_bit     (cpu_data[0].options & MIPS_CPU_PCI)
+#endif
+
 #endif /* __ASM_CPU_FEATURES_H */
index 554e2d29965d3642be65a7218f026a9d658643d7..52c4e914f95aef97ce72af5fd186678cc7ce9081 100644 (file)
@@ -320,7 +320,8 @@ enum cpu_type_enum {
 #define MIPS_CPU_VINT          0x00080000 /* CPU supports MIPSR2 vectored interrupts */
 #define MIPS_CPU_VEIC          0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */
 #define MIPS_CPU_ULRI          0x00200000 /* CPU has ULRI feature */
-#define MIPS_CPU_RIXI          0x00400000 /* CPU has TLB Read/eXec Inhibit */
+#define MIPS_CPU_PCI           0x00400000 /* CPU has Perf Ctr Int indicator */
+#define MIPS_CPU_RIXI          0x00800000 /* CPU has TLB Read/eXec Inhibit */
 
 /*
  * CPU ASE encodings
@@ -331,6 +332,7 @@ enum cpu_type_enum {
 #define MIPS_ASE_SMARTMIPS     0x00000008 /* SmartMIPS */
 #define MIPS_ASE_DSP           0x00000010 /* Signal Processing ASE */
 #define MIPS_ASE_MIPSMT                0x00000020 /* CPU supports MIPS MT */
+#define MIPS_ASE_DSP2P         0x00000040 /* Signal Processing ASE Rev 2 */
 
 
 #endif /* _ASM_CPU_H */
index 6dcd3583ed042682f30520f27935a0a1c68bcc84..21d91cdfe3c91584ff5b2b56e1dbf78e508ffd80 100644 (file)
 #ifndef _ASM_ERRNO_H
 #define _ASM_ERRNO_H
 
-/*
- * These error numbers are intended to be MIPS ABI compatible
- */
-
-#include <asm-generic/errno-base.h>
-
-#define        ENOMSG          35      /* No message of desired type */
-#define        EIDRM           36      /* Identifier removed */
-#define        ECHRNG          37      /* Channel number out of range */
-#define        EL2NSYNC        38      /* Level 2 not synchronized */
-#define        EL3HLT          39      /* Level 3 halted */
-#define        EL3RST          40      /* Level 3 reset */
-#define        ELNRNG          41      /* Link number out of range */
-#define        EUNATCH         42      /* Protocol driver not attached */
-#define        ENOCSI          43      /* No CSI structure available */
-#define        EL2HLT          44      /* Level 2 halted */
-#define        EDEADLK         45      /* Resource deadlock would occur */
-#define        ENOLCK          46      /* No record locks available */
-#define        EBADE           50      /* Invalid exchange */
-#define        EBADR           51      /* Invalid request descriptor */
-#define        EXFULL          52      /* Exchange full */
-#define        ENOANO          53      /* No anode */
-#define        EBADRQC         54      /* Invalid request code */
-#define        EBADSLT         55      /* Invalid slot */
-#define        EDEADLOCK       56      /* File locking deadlock error */
-#define        EBFONT          59      /* Bad font file format */
-#define        ENOSTR          60      /* Device not a stream */
-#define        ENODATA         61      /* No data available */
-#define        ETIME           62      /* Timer expired */
-#define        ENOSR           63      /* Out of streams resources */
-#define        ENONET          64      /* Machine is not on the network */
-#define        ENOPKG          65      /* Package not installed */
-#define        EREMOTE         66      /* Object is remote */
-#define        ENOLINK         67      /* Link has been severed */
-#define        EADV            68      /* Advertise error */
-#define        ESRMNT          69      /* Srmount error */
-#define        ECOMM           70      /* Communication error on send */
-#define        EPROTO          71      /* Protocol error */
-#define        EDOTDOT         73      /* RFS specific error */
-#define        EMULTIHOP       74      /* Multihop attempted */
-#define        EBADMSG         77      /* Not a data message */
-#define        ENAMETOOLONG    78      /* File name too long */
-#define        EOVERFLOW       79      /* Value too large for defined data type */
-#define        ENOTUNIQ        80      /* Name not unique on network */
-#define        EBADFD          81      /* File descriptor in bad state */
-#define        EREMCHG         82      /* Remote address changed */
-#define        ELIBACC         83      /* Can not access a needed shared library */
-#define        ELIBBAD         84      /* Accessing a corrupted shared library */
-#define        ELIBSCN         85      /* .lib section in a.out corrupted */
-#define        ELIBMAX         86      /* Attempting to link in too many shared libraries */
-#define        ELIBEXEC        87      /* Cannot exec a shared library directly */
-#define        EILSEQ          88      /* Illegal byte sequence */
-#define        ENOSYS          89      /* Function not implemented */
-#define        ELOOP           90      /* Too many symbolic links encountered */
-#define        ERESTART        91      /* Interrupted system call should be restarted */
-#define        ESTRPIPE        92      /* Streams pipe error */
-#define        ENOTEMPTY       93      /* Directory not empty */
-#define        EUSERS          94      /* Too many users */
-#define        ENOTSOCK        95      /* Socket operation on non-socket */
-#define        EDESTADDRREQ    96      /* Destination address required */
-#define        EMSGSIZE        97      /* Message too long */
-#define        EPROTOTYPE      98      /* Protocol wrong type for socket */
-#define        ENOPROTOOPT     99      /* Protocol not available */
-#define        EPROTONOSUPPORT 120     /* Protocol not supported */
-#define        ESOCKTNOSUPPORT 121     /* Socket type not supported */
-#define        EOPNOTSUPP      122     /* Operation not supported on transport endpoint */
-#define        EPFNOSUPPORT    123     /* Protocol family not supported */
-#define        EAFNOSUPPORT    124     /* Address family not supported by protocol */
-#define        EADDRINUSE      125     /* Address already in use */
-#define        EADDRNOTAVAIL   126     /* Cannot assign requested address */
-#define        ENETDOWN        127     /* Network is down */
-#define        ENETUNREACH     128     /* Network is unreachable */
-#define        ENETRESET       129     /* Network dropped connection because of reset */
-#define        ECONNABORTED    130     /* Software caused connection abort */
-#define        ECONNRESET      131     /* Connection reset by peer */
-#define        ENOBUFS         132     /* No buffer space available */
-#define        EISCONN         133     /* Transport endpoint is already connected */
-#define        ENOTCONN        134     /* Transport endpoint is not connected */
-#define        EUCLEAN         135     /* Structure needs cleaning */
-#define        ENOTNAM         137     /* Not a XENIX named type file */
-#define        ENAVAIL         138     /* No XENIX semaphores available */
-#define        EISNAM          139     /* Is a named type file */
-#define        EREMOTEIO       140     /* Remote I/O error */
-#define EINIT          141     /* Reserved */
-#define EREMDEV                142     /* Error 142 */
-#define        ESHUTDOWN       143     /* Cannot send after transport endpoint shutdown */
-#define        ETOOMANYREFS    144     /* Too many references: cannot splice */
-#define        ETIMEDOUT       145     /* Connection timed out */
-#define        ECONNREFUSED    146     /* Connection refused */
-#define        EHOSTDOWN       147     /* Host is down */
-#define        EHOSTUNREACH    148     /* No route to host */
-#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
-#define        EALREADY        149     /* Operation already in progress */
-#define        EINPROGRESS     150     /* Operation now in progress */
-#define        ESTALE          151     /* Stale NFS file handle */
-#define ECANCELED      158     /* AIO operation canceled */
-
-/*
- * These error are Linux extensions.
- */
-#define ENOMEDIUM      159     /* No medium found */
-#define EMEDIUMTYPE    160     /* Wrong medium type */
-#define        ENOKEY          161     /* Required key not available */
-#define        EKEYEXPIRED     162     /* Key has expired */
-#define        EKEYREVOKED     163     /* Key has been revoked */
-#define        EKEYREJECTED    164     /* Key was rejected by service */
-
-/* for robust mutexes */
-#define        EOWNERDEAD      165     /* Owner died */
-#define        ENOTRECOVERABLE 166     /* State not recoverable */
-
-#define        ERFKILL         167     /* Operation not possible due to RF-kill */
+#include <uapi/asm/errno.h>
 
-#define EHWPOISON      168     /* Memory page has hardware error */
-
-#define EDQUOT         1133    /* Quota exceeded */
-
-#ifdef __KERNEL__
 
 /* The biggest error number defined here or in <linux/errno.h>. */
 #define EMAXERRNO      1133
 
-#endif /* __KERNEL__ */
-
 #endif /* _ASM_ERRNO_H */
index 4e9e724c8935870094e6c59b389f49d984f336d1..ec6832950aced941344157146774e375abe5183f 100644 (file)
@@ -25,12 +25,8 @@ struct kspd_notifications {
        struct list_head list;
 };
 
-#ifdef CONFIG_MIPS_APSP_KSPD
-extern void kspd_notify(struct kspd_notifications *notify);
-#else
 static inline void kspd_notify(struct kspd_notifications *notify)
 {
 }
-#endif
 
 #endif
index 6ddae926bf79717b95a709d71c40a99a888a310a..ea4b66dccf6e85206cd42c50e4a1c0a7669f45a5 100644 (file)
@@ -42,6 +42,8 @@
 #define cpu_has_mips64r1       0
 #define cpu_has_mips64r2       0
 
+#define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 
 #define cpu_has_64bits         0
index 3f741af37d47cf8153aabe49a8e435e7f7fa4257..09f45e6afade2d5c2d86ab2fed53c928ceed32d3 100644 (file)
@@ -37,6 +37,7 @@
 #define cpu_has_mips64r1               0
 #define cpu_has_mips64r2               0
 #define cpu_has_dsp                    0
+#define cpu_has_dsp2                   0
 #define cpu_has_mipsmt                 0
 #define cpu_has_userlocal              0
 #define cpu_has_nofpuex                        0
index f453c01d06723885b1875457c4a8991628a5549e..e9c408e8ff4c36035d3cc45a098c30648a00184b 100644 (file)
@@ -37,6 +37,7 @@
 #define cpu_has_mips64r2               0
 
 #define cpu_has_dsp                    0
+#define cpu_has_dsp2                   0
 #define cpu_has_mipsmt                 0
 #define cpu_has_userlocal              0
 
index 375ad0c815fe75b83b7b4c18dffe667a97563376..94ed063eec9241f391db426d74e22e2464b98ef5 100644 (file)
@@ -53,6 +53,7 @@
 #define cpu_has_mips64r2       1
 #define cpu_has_mips_r2_exec_hazard 0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_vint           0
 #define cpu_has_veic           0
index b3314cf53194d6472062436a3ade9eea447896bb..babc8374e3786d9aed1a7715cb7e8adc35c8e109 100644 (file)
@@ -45,6 +45,7 @@
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_icache_snoops_remote_store 0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
 
index bb9fc23d853a675e8aa978eb1a4bd26f4919782d..16f1cf5982b92af76948e721bdf9ac08c0c4f81d 100644 (file)
@@ -162,6 +162,8 @@ enum bcsr_whoami_boards {
 #define BCSR_BOARD_PCIEXTARB           0x0200
 #define BCSR_BOARD_GPIO200RST          0x0400
 #define BCSR_BOARD_PCICLKOUT           0x0800
+#define BCSR_BOARD_PB1100_SD0PWR       0x0400
+#define BCSR_BOARD_PB1100_SD1PWR       0x0800
 #define BCSR_BOARD_PCICFG              0x1000
 #define BCSR_BOARD_SPISEL              0x2000  /* PB/DB1550 */
 #define BCSR_BOARD_SD0WP               0x4000  /* DB1100 */
index 9c8735158da1b011875df9af9a02f9e5e9648b4d..f4caacd255528ef1a0bc86f0cf2a522a9243e470 100644 (file)
@@ -30,6 +30,7 @@
 #define cpu_has_ic_fills_f_dc  0
 
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
 
index 7d3112b148d905f999049f596c3caf6eeb84ab50..1d2b6ff60d339ccc8ebdd80b7e374f201a2b6e4f 100644 (file)
@@ -26,6 +26,7 @@
 #define cpu_has_dc_aliases     0
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_icache_snoops_remote_store 1
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
index 9a53b326f84816a0a416086a8930059b3a368690..50d344ca60a84ff460f2a1ca902a778884c2761c 100644 (file)
@@ -27,6 +27,7 @@
 #define cpu_has_dc_aliases     0 /* see probe_pcache() */
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_icache_snoops_remote_store  1
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
index 6782fccebe8da2f473f2e3176f46ec61497771d8..2e1ec6cfedd5d939cbe328da3fb14571773771f0 100644 (file)
@@ -37,6 +37,7 @@
 #define cpu_has_vtag_icache    0
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_4k_cache       1
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
index d12e5c6477b943fe46cd564539375094836079f1..a225baaa215d2adec3c96ff89a228ae9e2d5fba4 100644 (file)
@@ -38,6 +38,7 @@
 #define cpu_has_mips64r1       0
 #define cpu_has_mips64r2       0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
 #define cpu_has_nofpuex 0
index 675bd8641d5a1efc0df38c258d7343c5eddcdb1e..1a05d854e34c05abfa2ab52c0e4206ce912a7533 100644 (file)
@@ -32,6 +32,7 @@
 #define cpu_has_dc_aliases     (PAGE_SIZE < 0x4000)
 #define cpu_has_divec          0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_ejtag          0
 #define cpu_has_fpu            1
 #define cpu_has_ic_fills_f_dc  0
index 966db4be377ca700d94795f10d3b345f8d250621..091deb1700e5ed013ffcbbbc5af4c742537c4919 100644 (file)
@@ -26,6 +26,7 @@
 #define cpu_has_vtag_icache    0
 #define cpu_has_ic_fills_f_dc  1
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_icache_snoops_remote_store 1
 
index f751e3ec56fb4fe3bde1e433f3d67b825138207b..58c76ec32a1938fdd3a2850fdac4c772d223a19e 100644 (file)
@@ -45,6 +45,7 @@
 #define cpu_has_mips64r1               0
 #define cpu_has_mips64r2               0
 #define cpu_has_dsp                    0
+#define cpu_has_dsp2                   0
 #define cpu_has_mipsmt                 0
 #define cpu_has_userlocal              0
 #define cpu_has_nofpuex                        0
index c3e4d3a4c95da84229dad24ee91e67d43a3eb549..b15307597ee392c0cf57225e70655e33c97f1fdc 100644 (file)
@@ -60,6 +60,7 @@
 #define cpu_has_mips64r2               0
 
 #define cpu_has_dsp                    0
+#define cpu_has_dsp2                   0
 #define cpu_has_mipsmt                 0
 
 /* #define cpu_has_nofpuex             ? */
index ccf5433635376aa1197be4b769516c940736e083..f095c529c48c1f7150d523744c17fe2a2abf3a7a 100644 (file)
@@ -30,6 +30,7 @@
 #define cpu_has_dc_aliases     (PAGE_SIZE < 0x4000)
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_nofpuex                0
 #define cpu_has_64bits         1
 #define cpu_has_mipsmt         0
index 1c1f92415b9a28857754c5538c2efe6b41c9ac77..92927b62b5a0709a92394c0dc63028c343d235b8 100644 (file)
@@ -26,6 +26,7 @@
 #define cpu_has_dc_aliases     0
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
 #define cpu_icache_snoops_remote_store 0
index 275eaf92c748f2567111c758a2755835c918bc08..7f5144c6ce2da590a0ffc88ce50d5350077a8628 100644 (file)
@@ -12,6 +12,7 @@
 #define cpu_has_vtag_icache    0
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp    0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt 0
 #define cpu_has_userlocal      0
 
index 470e5e9e10d659b830ea934f52941bee527d63b2..56bdd3298600d878bd60b3d7fdf6b8110bd9c2fe 100644 (file)
@@ -26,6 +26,7 @@
 #define cpu_has_dc_aliases     0
 #define cpu_has_ic_fills_f_dc  0
 #define cpu_has_dsp            0
+#define cpu_has_dsp2           0
 #define cpu_has_mipsmt         0
 #define cpu_has_userlocal      0
 #define cpu_icache_snoops_remote_store 0
index 528fda1e957c8fc64ef23b064e0ad57962dac654..eb742895dcbe97a3e7c81813c76eeec2e41bac02 100644 (file)
 #define  CAUSEF_IP7            (_ULCAST_(1)   << 15)
 #define  CAUSEB_IV             23
 #define  CAUSEF_IV             (_ULCAST_(1)   << 23)
+#define  CAUSEB_PCI            26
+#define  CAUSEF_PCI            (_ULCAST_(1)   << 26)
 #define  CAUSEB_CE             28
 #define  CAUSEF_CE             (_ULCAST_(3)   << 28)
 #define  CAUSEB_TI             30
 #define MIPS_CONF3_VEIC                (_ULCAST_(1) <<  6)
 #define MIPS_CONF3_LPA         (_ULCAST_(1) <<  7)
 #define MIPS_CONF3_DSP         (_ULCAST_(1) << 10)
+#define MIPS_CONF3_DSP2P       (_ULCAST_(1) << 11)
 #define MIPS_CONF3_RXI         (_ULCAST_(1) << 12)
 #define MIPS_CONF3_ULRI                (_ULCAST_(1) << 13)
 
index dca8bce8c7abbe47473920ca6d9e28eb3c235dc9..26137da1c713cd95ca0de3bc422fcb8e5fa6f6e8 100644 (file)
@@ -35,11 +35,14 @@ typedef struct {
 } Elf64_Mips_Rela;
 
 #ifdef CONFIG_32BIT
-
 #define Elf_Shdr       Elf32_Shdr
 #define Elf_Sym                Elf32_Sym
 #define Elf_Ehdr       Elf32_Ehdr
 #define Elf_Addr       Elf32_Addr
+#define Elf_Rel                Elf32_Rel
+#define Elf_Rela       Elf32_Rela
+#define ELF_R_TYPE(X)  ELF32_R_TYPE(X)
+#define ELF_R_SYM(X)   ELF32_R_SYM(X)
 
 #define Elf_Mips_Rel   Elf32_Rel
 #define Elf_Mips_Rela  Elf32_Rela
@@ -50,11 +53,14 @@ typedef struct {
 #endif
 
 #ifdef CONFIG_64BIT
-
 #define Elf_Shdr       Elf64_Shdr
 #define Elf_Sym                Elf64_Sym
 #define Elf_Ehdr       Elf64_Ehdr
 #define Elf_Addr       Elf64_Addr
+#define Elf_Rel                Elf64_Rel
+#define Elf_Rela       Elf64_Rela
+#define ELF_R_TYPE(X)  ELF64_R_TYPE(X)
+#define ELF_R_SYM(X)   ELF64_R_SYM(X)
 
 #define Elf_Mips_Rel   Elf64_Mips_Rel
 #define Elf_Mips_Rela  Elf64_Mips_Rela
index 55908fd56b1fc66ed5fe99d61bc54b8a243a1159..c26e182500799b7ba6cf97b2ef540f6feb82b6c8 100644 (file)
@@ -162,7 +162,6 @@ typedef struct { unsigned long pmd; } pmd_t;
 
 
 extern pmd_t invalid_pmd_table[PTRS_PER_PMD];
-extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
 #endif
 
 /*
index a80801b094bd76aa735ef1f0fec126954b341f60..016fa9446ba96c6a8bac592812690ac1f66351ff 100644 (file)
@@ -10,6 +10,7 @@
 
 #define cpu_has_mips16         1
 #define cpu_has_dsp            1
+/* #define cpu_has_dsp2                ??? - do runtime detection */
 #define cpu_has_mipsmt         1
 #define cpu_has_fpu            0
 
index 4b7f5252d2fd31ba156723c23db11e57e983442b..4f5da948a777c91e9223d94991f76fbfad6f6f30 100644 (file)
 #ifndef _ASM_PTRACE_H
 #define _ASM_PTRACE_H
 
-/* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
-#define FPR_BASE       32
-#define PC             64
-#define CAUSE          65
-#define BADVADDR       66
-#define MMHI           67
-#define MMLO           68
-#define FPC_CSR                69
-#define FPC_EIR                70
-#define DSP_BASE       71              /* 3 more hi / lo register pairs */
-#define DSP_CONTROL    77
-#define ACX            78
-
-/*
- * This struct defines the way the registers are stored on the stack during a
- * system call/exception. As usual the registers k0/k1 aren't being saved.
- */
-struct pt_regs {
-#ifdef CONFIG_32BIT
-       /* Pad bytes for argument save space on the stack. */
-       unsigned long pad0[6];
-#endif
-
-       /* Saved main processor registers. */
-       unsigned long regs[32];
-
-       /* Saved special registers. */
-       unsigned long cp0_status;
-       unsigned long hi;
-       unsigned long lo;
-#ifdef CONFIG_CPU_HAS_SMARTMIPS
-       unsigned long acx;
-#endif
-       unsigned long cp0_badvaddr;
-       unsigned long cp0_cause;
-       unsigned long cp0_epc;
-#ifdef CONFIG_MIPS_MT_SMTC
-       unsigned long cp0_tcstatus;
-#endif /* CONFIG_MIPS_MT_SMTC */
-#ifdef CONFIG_CPU_CAVIUM_OCTEON
-       unsigned long long mpl[3];        /* MTM{0,1,2} */
-       unsigned long long mtp[3];        /* MTP{0,1,2} */
-#endif
-} __attribute__ ((aligned (8)));
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS         12
-#define PTRACE_SETREGS         13
-#define PTRACE_GETFPREGS               14
-#define PTRACE_SETFPREGS               15
-/* #define PTRACE_GETFPXREGS           18 */
-/* #define PTRACE_SETFPXREGS           19 */
-
-#define PTRACE_OLDSETOPTIONS   21
-
-#define PTRACE_GET_THREAD_AREA 25
-#define PTRACE_SET_THREAD_AREA 26
-
-/* Calls to trace a 64bit program from a 32bit program.  */
-#define PTRACE_PEEKTEXT_3264   0xc0
-#define PTRACE_PEEKDATA_3264   0xc1
-#define PTRACE_POKETEXT_3264   0xc2
-#define PTRACE_POKEDATA_3264   0xc3
-#define PTRACE_GET_THREAD_AREA_3264    0xc4
-
-/* Read and write watchpoint registers.  */
-enum pt_watch_style {
-       pt_watch_style_mips32,
-       pt_watch_style_mips64
-};
-struct mips32_watch_regs {
-       unsigned int watchlo[8];
-       /* Lower 16 bits of watchhi. */
-       unsigned short watchhi[8];
-       /* Valid mask and I R W bits.
-        * bit 0 -- 1 if W bit is usable.
-        * bit 1 -- 1 if R bit is usable.
-        * bit 2 -- 1 if I bit is usable.
-        * bits 3 - 11 -- Valid watchhi mask bits.
-        */
-       unsigned short watch_masks[8];
-       /* The number of valid watch register pairs.  */
-       unsigned int num_valid;
-} __attribute__((aligned(8)));
-
-struct mips64_watch_regs {
-       unsigned long long watchlo[8];
-       unsigned short watchhi[8];
-       unsigned short watch_masks[8];
-       unsigned int num_valid;
-} __attribute__((aligned(8)));
-
-struct pt_watch_regs {
-       enum pt_watch_style style;
-       union {
-               struct mips32_watch_regs mips32;
-               struct mips64_watch_regs mips64;
-       };
-};
-
-#define PTRACE_GET_WATCH_REGS  0xd0
-#define PTRACE_SET_WATCH_REGS  0xd1
-
-#ifdef __KERNEL__
 
 #include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <linux/types.h>
 #include <asm/isadep.h>
+#include <uapi/asm/ptrace.h>
 
 struct task_struct;
 
@@ -164,6 +61,4 @@ static inline void die_if_kernel(const char *str, struct pt_regs *regs)
                die(str, regs);
 }
 
-#endif
-
 #endif /* _ASM_PTRACE_H */
index 2560b6b6a7d8f9b47ddc6bc607f80b732110dad3..e26589ef36eee12a9d5a957edf0df6d59ae7217e 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _MIPS_SETUP_H
 #define _MIPS_SETUP_H
 
-#define COMMAND_LINE_SIZE      4096
+#include <uapi/asm/setup.h>
 
-#ifdef  __KERNEL__
 extern void setup_early_printk(void);
 
 extern void set_handler(unsigned long offset, void *addr, unsigned long len);
@@ -17,6 +16,4 @@ extern unsigned long ebase;
 extern void per_cpu_trap_init(bool);
 extern void cpu_cache_init(void);
 
-#endif /* __KERNEL__ */
-
 #endif /* __SETUP_H */
index 9e89cf99d4e432e29a0f18aef60c3fd7a1d0b764..eeeb0f48c76754c2c9111b2f81528361545bb04e 100644 (file)
@@ -9,71 +9,10 @@
 #ifndef _ASM_SIGCONTEXT_H
 #define _ASM_SIGCONTEXT_H
 
-#include <linux/types.h>
-#include <asm/sgidefs.h>
-
-#if _MIPS_SIM == _MIPS_SIM_ABI32
-
-/*
- * Keep this struct definition in sync with the sigcontext fragment
- * in arch/mips/tools/offset.c
- */
-struct sigcontext {
-       unsigned int            sc_regmask;     /* Unused */
-       unsigned int            sc_status;      /* Unused */
-       unsigned long long      sc_pc;
-       unsigned long long      sc_regs[32];
-       unsigned long long      sc_fpregs[32];
-       unsigned int            sc_acx;         /* Was sc_ownedfp */
-       unsigned int            sc_fpc_csr;
-       unsigned int            sc_fpc_eir;     /* Unused */
-       unsigned int            sc_used_math;
-       unsigned int            sc_dsp;         /* dsp status, was sc_ssflags */
-       unsigned long long      sc_mdhi;
-       unsigned long long      sc_mdlo;
-       unsigned long           sc_hi1;         /* Was sc_cause */
-       unsigned long           sc_lo1;         /* Was sc_badvaddr */
-       unsigned long           sc_hi2;         /* Was sc_sigset[4] */
-       unsigned long           sc_lo2;
-       unsigned long           sc_hi3;
-       unsigned long           sc_lo3;
-};
-
-#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+#include <uapi/asm/sigcontext.h>
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
 
-#include <linux/posix_types.h>
-/*
- * Keep this struct definition in sync with the sigcontext fragment
- * in arch/mips/tools/offset.c
- *
- * Warning: this structure illdefined with sc_badvaddr being just an unsigned
- * int so it was changed to unsigned long in 2.6.0-test1.  This may break
- * binary compatibility - no prisoners.
- * DSP ASE in 2.6.12-rc4.  Turn sc_mdhi and sc_mdlo into an array of four
- * entries, add sc_dsp and sc_reserved for padding.  No prisoners.
- */
-struct sigcontext {
-       __u64   sc_regs[32];
-       __u64   sc_fpregs[32];
-       __u64   sc_mdhi;
-       __u64   sc_hi1;
-       __u64   sc_hi2;
-       __u64   sc_hi3;
-       __u64   sc_mdlo;
-       __u64   sc_lo1;
-       __u64   sc_lo2;
-       __u64   sc_lo3;
-       __u64   sc_pc;
-       __u32   sc_fpc_csr;
-       __u32   sc_used_math;
-       __u32   sc_dsp;
-       __u32   sc_reserved;
-};
-
-#ifdef __KERNEL__
-
 struct sigcontext32 {
        __u32           sc_regmask;     /* Unused */
        __u32           sc_status;      /* Unused */
@@ -94,8 +33,5 @@ struct sigcontext32 {
        __u32           sc_hi3;
        __u32           sc_lo3;
 };
-#endif /* __KERNEL__ */
-
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
-
 #endif /* _ASM_SIGCONTEXT_H */
index 20ebeb875ee6250938f883598b0cbf73da4dc31b..dd9a762646fc02dee31c45fe30a9d41de35a76f2 100644 (file)
@@ -9,108 +9,8 @@
 #ifndef _ASM_SIGINFO_H
 #define _ASM_SIGINFO_H
 
+#include <uapi/asm/siginfo.h>
 
-#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
-#undef __ARCH_SI_TRAPNO        /* exception code needs to fill this ...  */
-
-#define HAVE_ARCH_SIGINFO_T
-
-/*
- * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
- * by design ...
- */
-#define HAVE_ARCH_COPY_SIGINFO
-struct siginfo;
-
-/*
- * Careful to keep union _sifields from shifting ...
- */
-#ifdef CONFIG_32BIT
-#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
-#endif
-#ifdef CONFIG_64BIT
-#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
-#endif
-
-#include <asm-generic/siginfo.h>
-
-typedef struct siginfo {
-       int si_signo;
-       int si_code;
-       int si_errno;
-       int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
-
-       union {
-               int _pad[SI_PAD_SIZE];
-
-               /* kill() */
-               struct {
-                       pid_t _pid;             /* sender's pid */
-                       __ARCH_SI_UID_T _uid;   /* sender's uid */
-               } _kill;
-
-               /* POSIX.1b timers */
-               struct {
-                       timer_t _tid;           /* timer id */
-                       int _overrun;           /* overrun count */
-                       char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
-                       sigval_t _sigval;       /* same as below */
-                       int _sys_private;       /* not to be passed to user */
-               } _timer;
-
-               /* POSIX.1b signals */
-               struct {
-                       pid_t _pid;             /* sender's pid */
-                       __ARCH_SI_UID_T _uid;   /* sender's uid */
-                       sigval_t _sigval;
-               } _rt;
-
-               /* SIGCHLD */
-               struct {
-                       pid_t _pid;             /* which child */
-                       __ARCH_SI_UID_T _uid;   /* sender's uid */
-                       int _status;            /* exit code */
-                       clock_t _utime;
-                       clock_t _stime;
-               } _sigchld;
-
-               /* IRIX SIGCHLD */
-               struct {
-                       pid_t _pid;             /* which child */
-                       clock_t _utime;
-                       int _status;            /* exit code */
-                       clock_t _stime;
-               } _irix_sigchld;
-
-               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-               struct {
-                       void __user *_addr; /* faulting insn/memory ref. */
-#ifdef __ARCH_SI_TRAPNO
-                       int _trapno;    /* TRAP # which caused the signal */
-#endif
-                       short _addr_lsb;
-               } _sigfault;
-
-               /* SIGPOLL, SIGXFSZ (To do ...)  */
-               struct {
-                       __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
-                       int _fd;
-               } _sigpoll;
-       } _sifields;
-} siginfo_t;
-
-/*
- * si_code values
- * Again these have been chosen to be IRIX compatible.
- */
-#undef SI_ASYNCIO
-#undef SI_TIMER
-#undef SI_MESGQ
-#define SI_ASYNCIO     -2      /* sent by AIO completion */
-#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
-#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
-
-#ifdef __KERNEL__
 
 /*
  * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
@@ -126,6 +26,4 @@ static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
                memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
 }
 
-#endif
-
 #endif /* _ASM_SIGINFO_H */
index c783f364938ccd82ec1c99bc28bac0dfcbce54ef..880240dff8b75aef0416990efef374c4afe3bd73 100644 (file)
@@ -9,93 +9,8 @@
 #ifndef _ASM_SIGNAL_H
 #define _ASM_SIGNAL_H
 
-#include <linux/types.h>
+#include <uapi/asm/signal.h>
 
-#define _NSIG          128
-#define _NSIG_BPW      (sizeof(unsigned long) * 8)
-#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
-
-typedef struct {
-       unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-typedef unsigned long old_sigset_t;            /* at least 32 bits */
-
-#define SIGHUP          1      /* Hangup (POSIX).  */
-#define SIGINT          2      /* Interrupt (ANSI).  */
-#define SIGQUIT                 3      /* Quit (POSIX).  */
-#define SIGILL          4      /* Illegal instruction (ANSI).  */
-#define SIGTRAP                 5      /* Trace trap (POSIX).  */
-#define SIGIOT          6      /* IOT trap (4.2 BSD).  */
-#define SIGABRT                 SIGIOT /* Abort (ANSI).  */
-#define SIGEMT          7
-#define SIGFPE          8      /* Floating-point exception (ANSI).  */
-#define SIGKILL                 9      /* Kill, unblockable (POSIX).  */
-#define SIGBUS         10      /* BUS error (4.2 BSD).  */
-#define SIGSEGV                11      /* Segmentation violation (ANSI).  */
-#define SIGSYS         12
-#define SIGPIPE                13      /* Broken pipe (POSIX).  */
-#define SIGALRM                14      /* Alarm clock (POSIX).  */
-#define SIGTERM                15      /* Termination (ANSI).  */
-#define SIGUSR1                16      /* User-defined signal 1 (POSIX).  */
-#define SIGUSR2                17      /* User-defined signal 2 (POSIX).  */
-#define SIGCHLD                18      /* Child status has changed (POSIX).  */
-#define SIGCLD         SIGCHLD /* Same as SIGCHLD (System V).  */
-#define SIGPWR         19      /* Power failure restart (System V).  */
-#define SIGWINCH       20      /* Window size change (4.3 BSD, Sun).  */
-#define SIGURG         21      /* Urgent condition on socket (4.2 BSD).  */
-#define SIGIO          22      /* I/O now possible (4.2 BSD).  */
-#define SIGPOLL                SIGIO   /* Pollable event occurred (System V).  */
-#define SIGSTOP                23      /* Stop, unblockable (POSIX).  */
-#define SIGTSTP                24      /* Keyboard stop (POSIX).  */
-#define SIGCONT                25      /* Continue (POSIX).  */
-#define SIGTTIN                26      /* Background read from tty (POSIX).  */
-#define SIGTTOU                27      /* Background write to tty (POSIX).  */
-#define SIGVTALRM      28      /* Virtual alarm clock (4.2 BSD).  */
-#define SIGPROF                29      /* Profiling alarm clock (4.2 BSD).  */
-#define SIGXCPU                30      /* CPU limit exceeded (4.2 BSD).  */
-#define SIGXFSZ                31      /* File size limit exceeded (4.2 BSD).  */
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       32
-#define SIGRTMAX       _NSIG
-
-/*
- * SA_FLAGS values:
- *
- * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_RESETHAND clears the handler when the signal is delivered.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_NODEFER prevents the current signal from being masked in the handler.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-#define SA_ONSTACK     0x08000000
-#define SA_RESETHAND   0x80000000
-#define SA_RESTART     0x10000000
-#define SA_SIGINFO     0x00000008
-#define SA_NODEFER     0x40000000
-#define SA_NOCLDWAIT   0x00010000
-#define SA_NOCLDSTOP   0x00000001
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-#define SA_RESTORER    0x04000000      /* Only for o32 */
-
-/*
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
-
-#ifdef __KERNEL__
 
 #ifdef CONFIG_TRAD_SIGNALS
 #define sig_uses_siginfo(ka)   ((ka)->sa.sa_flags & SA_SIGINFO)
@@ -103,37 +18,9 @@ typedef unsigned long old_sigset_t;         /* at least 32 bits */
 #define sig_uses_siginfo(ka)   (1)
 #endif
 
-#endif /* __KERNEL__ */
-
-#define SIG_BLOCK      1       /* for blocking signals */
-#define SIG_UNBLOCK    2       /* for unblocking signals */
-#define SIG_SETMASK    3       /* for setting the signal mask */
-
-#include <asm-generic/signal-defs.h>
-
-struct sigaction {
-       unsigned int    sa_flags;
-       __sighandler_t  sa_handler;
-       sigset_t        sa_mask;
-};
-
-struct k_sigaction {
-       struct sigaction sa;
-};
-
-/* IRIX compatible stack_t  */
-typedef struct sigaltstack {
-       void __user *ss_sp;
-       size_t ss_size;
-       int ss_flags;
-} stack_t;
-
-#ifdef __KERNEL__
 #include <asm/sigcontext.h>
 #include <asm/siginfo.h>
 
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
 
-#endif /* __KERNEL__ */
-
 #endif /* _ASM_SIGNAL_H */
index a2ed6fdad4e0ee70aac755fad96157f817af900c..4724a563c5bf5d8da873c4580a6766ca457fad5c 100644 (file)
@@ -9,87 +9,8 @@
 #ifndef _ASM_SOCKET_H
 #define _ASM_SOCKET_H
 
-#include <asm/sockios.h>
+#include <uapi/asm/socket.h>
 
-/*
- * For setsockopt(2)
- *
- * This defines are ABI conformant as far as Linux supports these ...
- */
-#define SOL_SOCKET     0xffff
-
-#define SO_DEBUG       0x0001  /* Record debugging information.  */
-#define SO_REUSEADDR   0x0004  /* Allow reuse of local addresses.  */
-#define SO_KEEPALIVE   0x0008  /* Keep connections alive and send
-                                  SIGPIPE when they die.  */
-#define SO_DONTROUTE   0x0010  /* Don't do local routing.  */
-#define SO_BROADCAST   0x0020  /* Allow transmission of
-                                  broadcast messages.  */
-#define SO_LINGER      0x0080  /* Block on close of a reliable
-                                  socket to transmit pending data.  */
-#define SO_OOBINLINE 0x0100    /* Receive out-of-band data in-band.  */
-#if 0
-To add: #define SO_REUSEPORT 0x0200    /* Allow local address and port reuse.  */
-#endif
-
-#define SO_TYPE                0x1008  /* Compatible name for SO_STYLE.  */
-#define SO_STYLE       SO_TYPE /* Synonym */
-#define SO_ERROR       0x1007  /* get error status and clear */
-#define SO_SNDBUF      0x1001  /* Send buffer size. */
-#define SO_RCVBUF      0x1002  /* Receive buffer. */
-#define SO_SNDLOWAT    0x1003  /* send low-water mark */
-#define SO_RCVLOWAT    0x1004  /* receive low-water mark */
-#define SO_SNDTIMEO    0x1005  /* send timeout */
-#define SO_RCVTIMEO    0x1006  /* receive timeout */
-#define SO_ACCEPTCONN  0x1009
-#define SO_PROTOCOL    0x1028  /* protocol type */
-#define SO_DOMAIN      0x1029  /* domain/socket family */
-
-/* linux-specific, might as well be the same as on i386 */
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_BSDCOMPAT   14
-
-#define SO_PASSCRED    17
-#define SO_PEERCRED    18
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
-#define SO_SECURITY_ENCRYPTION_NETWORK         24
-
-#define SO_BINDTODEVICE                25
-
-/* Socket filtering */
-#define SO_ATTACH_FILTER        26
-#define SO_DETACH_FILTER        27
-
-#define SO_PEERNAME             28
-#define SO_TIMESTAMP           29
-#define SCM_TIMESTAMP          SO_TIMESTAMP
-
-#define SO_PEERSEC             30
-#define SO_SNDBUFFORCE         31
-#define SO_RCVBUFFORCE         33
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-#define SO_MARK                        36
-
-#define SO_TIMESTAMPING                37
-#define SCM_TIMESTAMPING       SO_TIMESTAMPING
-
-#define SO_RXQ_OVFL             40
-
-#define SO_WIFI_STATUS         41
-#define SCM_WIFI_STATUS                SO_WIFI_STATUS
-#define SO_PEEK_OFF            42
-
-/* Instruct lower device to use last 4-bytes of skb data as FCS */
-#define SO_NOFCS               43
-
-#ifdef __KERNEL__
 
 /** sock_type - Socket types
  *
@@ -126,6 +47,4 @@ enum sock_type {
 
 #define ARCH_HAS_SOCKET_TYPES 1
 
-#endif /* __KERNEL__ */
-
 #endif /* _ASM_SOCKET_H */
index abdd87aaf609034742f0401e9846ea4ba2bd2ced..6245b68a69a84973a5cd9059dde666ae8ff77eec 100644 (file)
@@ -9,58 +9,8 @@
 #ifndef _ASM_TERMIOS_H
 #define _ASM_TERMIOS_H
 
-#include <linux/errno.h>
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
-
-struct sgttyb {
-       char    sg_ispeed;
-       char    sg_ospeed;
-       char    sg_erase;
-       char    sg_kill;
-       int     sg_flags;       /* SGI special - int, not short */
-};
-
-struct tchars {
-       char    t_intrc;
-       char    t_quitc;
-       char    t_startc;
-       char    t_stopc;
-       char    t_eofc;
-       char    t_brkc;
-};
-
-struct ltchars {
-        char    t_suspc;        /* stop process signal */
-        char    t_dsuspc;       /* delayed stop process signal */
-        char    t_rprntc;       /* reprint line */
-        char    t_flushc;       /* flush output (toggles) */
-        char    t_werasc;       /* word erase */
-        char    t_lnextc;       /* literal next character */
-};
-
-/* TIOCGSIZE, TIOCSSIZE not defined yet.  Only needed for SunOS source
-   compatibility anyway ... */
-
-struct winsize {
-       unsigned short ws_row;
-       unsigned short ws_col;
-       unsigned short ws_xpixel;
-       unsigned short ws_ypixel;
-};
-
-#define NCC    8
-struct termio {
-       unsigned short c_iflag;         /* input mode flags */
-       unsigned short c_oflag;         /* output mode flags */
-       unsigned short c_cflag;         /* control mode flags */
-       unsigned short c_lflag;         /* local mode flags */
-       char c_line;                    /* line discipline */
-       unsigned char c_cc[NCCS];       /* control characters */
-};
-
-#ifdef __KERNEL__
 #include <asm/uaccess.h>
+#include <uapi/asm/termios.h>
 
 /*
  *     intr=^C         quit=^\         erase=del       kill=^U
@@ -70,25 +20,6 @@ struct termio {
  *     eof=^D          eol=\0
  */
 #define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0"
-#endif
-
-/* modem lines */
-#define TIOCM_LE       0x001           /* line enable */
-#define TIOCM_DTR      0x002           /* data terminal ready */
-#define TIOCM_RTS      0x004           /* request to send */
-#define TIOCM_ST       0x010           /* secondary transmit */
-#define TIOCM_SR       0x020           /* secondary receive */
-#define TIOCM_CTS      0x040           /* clear to send */
-#define TIOCM_CAR      0x100           /* carrier detect */
-#define TIOCM_CD       TIOCM_CAR
-#define TIOCM_RNG      0x200           /* ring */
-#define TIOCM_RI       TIOCM_RNG
-#define TIOCM_DSR      0x400           /* data set ready */
-#define TIOCM_OUT1     0x2000
-#define TIOCM_OUT2     0x4000
-#define TIOCM_LOOP     0x8000
-
-#ifdef __KERNEL__
 
 #include <linux/string.h>
 
@@ -171,6 +102,4 @@ static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
        return copy_to_user(u, k, sizeof(struct termios)) ? -EFAULT : 0;
 }
 
-#endif /* defined(__KERNEL__) */
-
 #endif /* _ASM_TERMIOS_H */
index 1228b25b290a39a049bf4ae50a3c26b2ca37b531..a845aafedee451e1e851901c0f20e484f5f9ff93 100644 (file)
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
-/*
- * We don't use int-l64.h for the kernel anymore but still use it for
- * userspace to avoid code changes.
- */
-#ifdef __KERNEL__
 # include <asm-generic/int-ll64.h>
-#else
-# if _MIPS_SZLONG == 64
-#  include <asm-generic/int-l64.h>
-# else
-#  include <asm-generic/int-ll64.h>
-# endif
-#endif
+#include <uapi/asm/types.h>
 
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
 /*
@@ -42,6 +30,4 @@ typedef unsigned long phys_t;
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* __KERNEL__ */
-
 #endif /* _ASM_TYPES_H */
index 161fc4d976e44b2a00153a23ee99d3eed3fa89a7..9e47cc11aa263ba3991d680736bce6aeea41447e 100644 (file)
 #ifndef _ASM_UNISTD_H
 #define _ASM_UNISTD_H
 
-#include <asm/sgidefs.h>
+#include <uapi/asm/unistd.h>
 
-#if _MIPS_SIM == _MIPS_SIM_ABI32
-
-/*
- * Linux o32 style syscalls are in the range from 4000 to 4999.
- */
-#define __NR_Linux                     4000
-#define __NR_syscall                   (__NR_Linux +   0)
-#define __NR_exit                      (__NR_Linux +   1)
-#define __NR_fork                      (__NR_Linux +   2)
-#define __NR_read                      (__NR_Linux +   3)
-#define __NR_write                     (__NR_Linux +   4)
-#define __NR_open                      (__NR_Linux +   5)
-#define __NR_close                     (__NR_Linux +   6)
-#define __NR_waitpid                   (__NR_Linux +   7)
-#define __NR_creat                     (__NR_Linux +   8)
-#define __NR_link                      (__NR_Linux +   9)
-#define __NR_unlink                    (__NR_Linux +  10)
-#define __NR_execve                    (__NR_Linux +  11)
-#define __NR_chdir                     (__NR_Linux +  12)
-#define __NR_time                      (__NR_Linux +  13)
-#define __NR_mknod                     (__NR_Linux +  14)
-#define __NR_chmod                     (__NR_Linux +  15)
-#define __NR_lchown                    (__NR_Linux +  16)
-#define __NR_break                     (__NR_Linux +  17)
-#define __NR_unused18                  (__NR_Linux +  18)
-#define __NR_lseek                     (__NR_Linux +  19)
-#define __NR_getpid                    (__NR_Linux +  20)
-#define __NR_mount                     (__NR_Linux +  21)
-#define __NR_umount                    (__NR_Linux +  22)
-#define __NR_setuid                    (__NR_Linux +  23)
-#define __NR_getuid                    (__NR_Linux +  24)
-#define __NR_stime                     (__NR_Linux +  25)
-#define __NR_ptrace                    (__NR_Linux +  26)
-#define __NR_alarm                     (__NR_Linux +  27)
-#define __NR_unused28                  (__NR_Linux +  28)
-#define __NR_pause                     (__NR_Linux +  29)
-#define __NR_utime                     (__NR_Linux +  30)
-#define __NR_stty                      (__NR_Linux +  31)
-#define __NR_gtty                      (__NR_Linux +  32)
-#define __NR_access                    (__NR_Linux +  33)
-#define __NR_nice                      (__NR_Linux +  34)
-#define __NR_ftime                     (__NR_Linux +  35)
-#define __NR_sync                      (__NR_Linux +  36)
-#define __NR_kill                      (__NR_Linux +  37)
-#define __NR_rename                    (__NR_Linux +  38)
-#define __NR_mkdir                     (__NR_Linux +  39)
-#define __NR_rmdir                     (__NR_Linux +  40)
-#define __NR_dup                       (__NR_Linux +  41)
-#define __NR_pipe                      (__NR_Linux +  42)
-#define __NR_times                     (__NR_Linux +  43)
-#define __NR_prof                      (__NR_Linux +  44)
-#define __NR_brk                       (__NR_Linux +  45)
-#define __NR_setgid                    (__NR_Linux +  46)
-#define __NR_getgid                    (__NR_Linux +  47)
-#define __NR_signal                    (__NR_Linux +  48)
-#define __NR_geteuid                   (__NR_Linux +  49)
-#define __NR_getegid                   (__NR_Linux +  50)
-#define __NR_acct                      (__NR_Linux +  51)
-#define __NR_umount2                   (__NR_Linux +  52)
-#define __NR_lock                      (__NR_Linux +  53)
-#define __NR_ioctl                     (__NR_Linux +  54)
-#define __NR_fcntl                     (__NR_Linux +  55)
-#define __NR_mpx                       (__NR_Linux +  56)
-#define __NR_setpgid                   (__NR_Linux +  57)
-#define __NR_ulimit                    (__NR_Linux +  58)
-#define __NR_unused59                  (__NR_Linux +  59)
-#define __NR_umask                     (__NR_Linux +  60)
-#define __NR_chroot                    (__NR_Linux +  61)
-#define __NR_ustat                     (__NR_Linux +  62)
-#define __NR_dup2                      (__NR_Linux +  63)
-#define __NR_getppid                   (__NR_Linux +  64)
-#define __NR_getpgrp                   (__NR_Linux +  65)
-#define __NR_setsid                    (__NR_Linux +  66)
-#define __NR_sigaction                 (__NR_Linux +  67)
-#define __NR_sgetmask                  (__NR_Linux +  68)
-#define __NR_ssetmask                  (__NR_Linux +  69)
-#define __NR_setreuid                  (__NR_Linux +  70)
-#define __NR_setregid                  (__NR_Linux +  71)
-#define __NR_sigsuspend                        (__NR_Linux +  72)
-#define __NR_sigpending                        (__NR_Linux +  73)
-#define __NR_sethostname               (__NR_Linux +  74)
-#define __NR_setrlimit                 (__NR_Linux +  75)
-#define __NR_getrlimit                 (__NR_Linux +  76)
-#define __NR_getrusage                 (__NR_Linux +  77)
-#define __NR_gettimeofday              (__NR_Linux +  78)
-#define __NR_settimeofday              (__NR_Linux +  79)
-#define __NR_getgroups                 (__NR_Linux +  80)
-#define __NR_setgroups                 (__NR_Linux +  81)
-#define __NR_reserved82                        (__NR_Linux +  82)
-#define __NR_symlink                   (__NR_Linux +  83)
-#define __NR_unused84                  (__NR_Linux +  84)
-#define __NR_readlink                  (__NR_Linux +  85)
-#define __NR_uselib                    (__NR_Linux +  86)
-#define __NR_swapon                    (__NR_Linux +  87)
-#define __NR_reboot                    (__NR_Linux +  88)
-#define __NR_readdir                   (__NR_Linux +  89)
-#define __NR_mmap                      (__NR_Linux +  90)
-#define __NR_munmap                    (__NR_Linux +  91)
-#define __NR_truncate                  (__NR_Linux +  92)
-#define __NR_ftruncate                 (__NR_Linux +  93)
-#define __NR_fchmod                    (__NR_Linux +  94)
-#define __NR_fchown                    (__NR_Linux +  95)
-#define __NR_getpriority               (__NR_Linux +  96)
-#define __NR_setpriority               (__NR_Linux +  97)
-#define __NR_profil                    (__NR_Linux +  98)
-#define __NR_statfs                    (__NR_Linux +  99)
-#define __NR_fstatfs                   (__NR_Linux + 100)
-#define __NR_ioperm                    (__NR_Linux + 101)
-#define __NR_socketcall                        (__NR_Linux + 102)
-#define __NR_syslog                    (__NR_Linux + 103)
-#define __NR_setitimer                 (__NR_Linux + 104)
-#define __NR_getitimer                 (__NR_Linux + 105)
-#define __NR_stat                      (__NR_Linux + 106)
-#define __NR_lstat                     (__NR_Linux + 107)
-#define __NR_fstat                     (__NR_Linux + 108)
-#define __NR_unused109                 (__NR_Linux + 109)
-#define __NR_iopl                      (__NR_Linux + 110)
-#define __NR_vhangup                   (__NR_Linux + 111)
-#define __NR_idle                      (__NR_Linux + 112)
-#define __NR_vm86                      (__NR_Linux + 113)
-#define __NR_wait4                     (__NR_Linux + 114)
-#define __NR_swapoff                   (__NR_Linux + 115)
-#define __NR_sysinfo                   (__NR_Linux + 116)
-#define __NR_ipc                       (__NR_Linux + 117)
-#define __NR_fsync                     (__NR_Linux + 118)
-#define __NR_sigreturn                 (__NR_Linux + 119)
-#define __NR_clone                     (__NR_Linux + 120)
-#define __NR_setdomainname             (__NR_Linux + 121)
-#define __NR_uname                     (__NR_Linux + 122)
-#define __NR_modify_ldt                        (__NR_Linux + 123)
-#define __NR_adjtimex                  (__NR_Linux + 124)
-#define __NR_mprotect                  (__NR_Linux + 125)
-#define __NR_sigprocmask               (__NR_Linux + 126)
-#define __NR_create_module             (__NR_Linux + 127)
-#define __NR_init_module               (__NR_Linux + 128)
-#define __NR_delete_module             (__NR_Linux + 129)
-#define __NR_get_kernel_syms           (__NR_Linux + 130)
-#define __NR_quotactl                  (__NR_Linux + 131)
-#define __NR_getpgid                   (__NR_Linux + 132)
-#define __NR_fchdir                    (__NR_Linux + 133)
-#define __NR_bdflush                   (__NR_Linux + 134)
-#define __NR_sysfs                     (__NR_Linux + 135)
-#define __NR_personality               (__NR_Linux + 136)
-#define __NR_afs_syscall               (__NR_Linux + 137) /* Syscall for Andrew File System */
-#define __NR_setfsuid                  (__NR_Linux + 138)
-#define __NR_setfsgid                  (__NR_Linux + 139)
-#define __NR__llseek                   (__NR_Linux + 140)
-#define __NR_getdents                  (__NR_Linux + 141)
-#define __NR__newselect                        (__NR_Linux + 142)
-#define __NR_flock                     (__NR_Linux + 143)
-#define __NR_msync                     (__NR_Linux + 144)
-#define __NR_readv                     (__NR_Linux + 145)
-#define __NR_writev                    (__NR_Linux + 146)
-#define __NR_cacheflush                        (__NR_Linux + 147)
-#define __NR_cachectl                  (__NR_Linux + 148)
-#define __NR_sysmips                   (__NR_Linux + 149)
-#define __NR_unused150                 (__NR_Linux + 150)
-#define __NR_getsid                    (__NR_Linux + 151)
-#define __NR_fdatasync                 (__NR_Linux + 152)
-#define __NR__sysctl                   (__NR_Linux + 153)
-#define __NR_mlock                     (__NR_Linux + 154)
-#define __NR_munlock                   (__NR_Linux + 155)
-#define __NR_mlockall                  (__NR_Linux + 156)
-#define __NR_munlockall                        (__NR_Linux + 157)
-#define __NR_sched_setparam            (__NR_Linux + 158)
-#define __NR_sched_getparam            (__NR_Linux + 159)
-#define __NR_sched_setscheduler                (__NR_Linux + 160)
-#define __NR_sched_getscheduler                (__NR_Linux + 161)
-#define __NR_sched_yield               (__NR_Linux + 162)
-#define __NR_sched_get_priority_max    (__NR_Linux + 163)
-#define __NR_sched_get_priority_min    (__NR_Linux + 164)
-#define __NR_sched_rr_get_interval     (__NR_Linux + 165)
-#define __NR_nanosleep                 (__NR_Linux + 166)
-#define __NR_mremap                    (__NR_Linux + 167)
-#define __NR_accept                    (__NR_Linux + 168)
-#define __NR_bind                      (__NR_Linux + 169)
-#define __NR_connect                   (__NR_Linux + 170)
-#define __NR_getpeername               (__NR_Linux + 171)
-#define __NR_getsockname               (__NR_Linux + 172)
-#define __NR_getsockopt                        (__NR_Linux + 173)
-#define __NR_listen                    (__NR_Linux + 174)
-#define __NR_recv                      (__NR_Linux + 175)
-#define __NR_recvfrom                  (__NR_Linux + 176)
-#define __NR_recvmsg                   (__NR_Linux + 177)
-#define __NR_send                      (__NR_Linux + 178)
-#define __NR_sendmsg                   (__NR_Linux + 179)
-#define __NR_sendto                    (__NR_Linux + 180)
-#define __NR_setsockopt                        (__NR_Linux + 181)
-#define __NR_shutdown                  (__NR_Linux + 182)
-#define __NR_socket                    (__NR_Linux + 183)
-#define __NR_socketpair                        (__NR_Linux + 184)
-#define __NR_setresuid                 (__NR_Linux + 185)
-#define __NR_getresuid                 (__NR_Linux + 186)
-#define __NR_query_module              (__NR_Linux + 187)
-#define __NR_poll                      (__NR_Linux + 188)
-#define __NR_nfsservctl                        (__NR_Linux + 189)
-#define __NR_setresgid                 (__NR_Linux + 190)
-#define __NR_getresgid                 (__NR_Linux + 191)
-#define __NR_prctl                     (__NR_Linux + 192)
-#define __NR_rt_sigreturn              (__NR_Linux + 193)
-#define __NR_rt_sigaction              (__NR_Linux + 194)
-#define __NR_rt_sigprocmask            (__NR_Linux + 195)
-#define __NR_rt_sigpending             (__NR_Linux + 196)
-#define __NR_rt_sigtimedwait           (__NR_Linux + 197)
-#define __NR_rt_sigqueueinfo           (__NR_Linux + 198)
-#define __NR_rt_sigsuspend             (__NR_Linux + 199)
-#define __NR_pread64                   (__NR_Linux + 200)
-#define __NR_pwrite64                  (__NR_Linux + 201)
-#define __NR_chown                     (__NR_Linux + 202)
-#define __NR_getcwd                    (__NR_Linux + 203)
-#define __NR_capget                    (__NR_Linux + 204)
-#define __NR_capset                    (__NR_Linux + 205)
-#define __NR_sigaltstack               (__NR_Linux + 206)
-#define __NR_sendfile                  (__NR_Linux + 207)
-#define __NR_getpmsg                   (__NR_Linux + 208)
-#define __NR_putpmsg                   (__NR_Linux + 209)
-#define __NR_mmap2                     (__NR_Linux + 210)
-#define __NR_truncate64                        (__NR_Linux + 211)
-#define __NR_ftruncate64               (__NR_Linux + 212)
-#define __NR_stat64                    (__NR_Linux + 213)
-#define __NR_lstat64                   (__NR_Linux + 214)
-#define __NR_fstat64                   (__NR_Linux + 215)
-#define __NR_pivot_root                        (__NR_Linux + 216)
-#define __NR_mincore                   (__NR_Linux + 217)
-#define __NR_madvise                   (__NR_Linux + 218)
-#define __NR_getdents64                        (__NR_Linux + 219)
-#define __NR_fcntl64                   (__NR_Linux + 220)
-#define __NR_reserved221               (__NR_Linux + 221)
-#define __NR_gettid                    (__NR_Linux + 222)
-#define __NR_readahead                 (__NR_Linux + 223)
-#define __NR_setxattr                  (__NR_Linux + 224)
-#define __NR_lsetxattr                 (__NR_Linux + 225)
-#define __NR_fsetxattr                 (__NR_Linux + 226)
-#define __NR_getxattr                  (__NR_Linux + 227)
-#define __NR_lgetxattr                 (__NR_Linux + 228)
-#define __NR_fgetxattr                 (__NR_Linux + 229)
-#define __NR_listxattr                 (__NR_Linux + 230)
-#define __NR_llistxattr                        (__NR_Linux + 231)
-#define __NR_flistxattr                        (__NR_Linux + 232)
-#define __NR_removexattr               (__NR_Linux + 233)
-#define __NR_lremovexattr              (__NR_Linux + 234)
-#define __NR_fremovexattr              (__NR_Linux + 235)
-#define __NR_tkill                     (__NR_Linux + 236)
-#define __NR_sendfile64                        (__NR_Linux + 237)
-#define __NR_futex                     (__NR_Linux + 238)
-#define __NR_sched_setaffinity         (__NR_Linux + 239)
-#define __NR_sched_getaffinity         (__NR_Linux + 240)
-#define __NR_io_setup                  (__NR_Linux + 241)
-#define __NR_io_destroy                        (__NR_Linux + 242)
-#define __NR_io_getevents              (__NR_Linux + 243)
-#define __NR_io_submit                 (__NR_Linux + 244)
-#define __NR_io_cancel                 (__NR_Linux + 245)
-#define __NR_exit_group                        (__NR_Linux + 246)
-#define __NR_lookup_dcookie            (__NR_Linux + 247)
-#define __NR_epoll_create              (__NR_Linux + 248)
-#define __NR_epoll_ctl                 (__NR_Linux + 249)
-#define __NR_epoll_wait                        (__NR_Linux + 250)
-#define __NR_remap_file_pages          (__NR_Linux + 251)
-#define __NR_set_tid_address           (__NR_Linux + 252)
-#define __NR_restart_syscall           (__NR_Linux + 253)
-#define __NR_fadvise64                 (__NR_Linux + 254)
-#define __NR_statfs64                  (__NR_Linux + 255)
-#define __NR_fstatfs64                 (__NR_Linux + 256)
-#define __NR_timer_create              (__NR_Linux + 257)
-#define __NR_timer_settime             (__NR_Linux + 258)
-#define __NR_timer_gettime             (__NR_Linux + 259)
-#define __NR_timer_getoverrun          (__NR_Linux + 260)
-#define __NR_timer_delete              (__NR_Linux + 261)
-#define __NR_clock_settime             (__NR_Linux + 262)
-#define __NR_clock_gettime             (__NR_Linux + 263)
-#define __NR_clock_getres              (__NR_Linux + 264)
-#define __NR_clock_nanosleep           (__NR_Linux + 265)
-#define __NR_tgkill                    (__NR_Linux + 266)
-#define __NR_utimes                    (__NR_Linux + 267)
-#define __NR_mbind                     (__NR_Linux + 268)
-#define __NR_get_mempolicy             (__NR_Linux + 269)
-#define __NR_set_mempolicy             (__NR_Linux + 270)
-#define __NR_mq_open                   (__NR_Linux + 271)
-#define __NR_mq_unlink                 (__NR_Linux + 272)
-#define __NR_mq_timedsend              (__NR_Linux + 273)
-#define __NR_mq_timedreceive           (__NR_Linux + 274)
-#define __NR_mq_notify                 (__NR_Linux + 275)
-#define __NR_mq_getsetattr             (__NR_Linux + 276)
-#define __NR_vserver                   (__NR_Linux + 277)
-#define __NR_waitid                    (__NR_Linux + 278)
-/* #define __NR_sys_setaltroot         (__NR_Linux + 279) */
-#define __NR_add_key                   (__NR_Linux + 280)
-#define __NR_request_key               (__NR_Linux + 281)
-#define __NR_keyctl                    (__NR_Linux + 282)
-#define __NR_set_thread_area           (__NR_Linux + 283)
-#define __NR_inotify_init              (__NR_Linux + 284)
-#define __NR_inotify_add_watch         (__NR_Linux + 285)
-#define __NR_inotify_rm_watch          (__NR_Linux + 286)
-#define __NR_migrate_pages             (__NR_Linux + 287)
-#define __NR_openat                    (__NR_Linux + 288)
-#define __NR_mkdirat                   (__NR_Linux + 289)
-#define __NR_mknodat                   (__NR_Linux + 290)
-#define __NR_fchownat                  (__NR_Linux + 291)
-#define __NR_futimesat                 (__NR_Linux + 292)
-#define __NR_fstatat64                 (__NR_Linux + 293)
-#define __NR_unlinkat                  (__NR_Linux + 294)
-#define __NR_renameat                  (__NR_Linux + 295)
-#define __NR_linkat                    (__NR_Linux + 296)
-#define __NR_symlinkat                 (__NR_Linux + 297)
-#define __NR_readlinkat                        (__NR_Linux + 298)
-#define __NR_fchmodat                  (__NR_Linux + 299)
-#define __NR_faccessat                 (__NR_Linux + 300)
-#define __NR_pselect6                  (__NR_Linux + 301)
-#define __NR_ppoll                     (__NR_Linux + 302)
-#define __NR_unshare                   (__NR_Linux + 303)
-#define __NR_splice                    (__NR_Linux + 304)
-#define __NR_sync_file_range           (__NR_Linux + 305)
-#define __NR_tee                       (__NR_Linux + 306)
-#define __NR_vmsplice                  (__NR_Linux + 307)
-#define __NR_move_pages                        (__NR_Linux + 308)
-#define __NR_set_robust_list           (__NR_Linux + 309)
-#define __NR_get_robust_list           (__NR_Linux + 310)
-#define __NR_kexec_load                        (__NR_Linux + 311)
-#define __NR_getcpu                    (__NR_Linux + 312)
-#define __NR_epoll_pwait               (__NR_Linux + 313)
-#define __NR_ioprio_set                        (__NR_Linux + 314)
-#define __NR_ioprio_get                        (__NR_Linux + 315)
-#define __NR_utimensat                 (__NR_Linux + 316)
-#define __NR_signalfd                  (__NR_Linux + 317)
-#define __NR_timerfd                   (__NR_Linux + 318)
-#define __NR_eventfd                   (__NR_Linux + 319)
-#define __NR_fallocate                 (__NR_Linux + 320)
-#define __NR_timerfd_create            (__NR_Linux + 321)
-#define __NR_timerfd_gettime           (__NR_Linux + 322)
-#define __NR_timerfd_settime           (__NR_Linux + 323)
-#define __NR_signalfd4                 (__NR_Linux + 324)
-#define __NR_eventfd2                  (__NR_Linux + 325)
-#define __NR_epoll_create1             (__NR_Linux + 326)
-#define __NR_dup3                      (__NR_Linux + 327)
-#define __NR_pipe2                     (__NR_Linux + 328)
-#define __NR_inotify_init1             (__NR_Linux + 329)
-#define __NR_preadv                    (__NR_Linux + 330)
-#define __NR_pwritev                   (__NR_Linux + 331)
-#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 332)
-#define __NR_perf_event_open           (__NR_Linux + 333)
-#define __NR_accept4                   (__NR_Linux + 334)
-#define __NR_recvmmsg                  (__NR_Linux + 335)
-#define __NR_fanotify_init             (__NR_Linux + 336)
-#define __NR_fanotify_mark             (__NR_Linux + 337)
-#define __NR_prlimit64                 (__NR_Linux + 338)
-#define __NR_name_to_handle_at         (__NR_Linux + 339)
-#define __NR_open_by_handle_at         (__NR_Linux + 340)
-#define __NR_clock_adjtime             (__NR_Linux + 341)
-#define __NR_syncfs                    (__NR_Linux + 342)
-#define __NR_sendmmsg                  (__NR_Linux + 343)
-#define __NR_setns                     (__NR_Linux + 344)
-#define __NR_process_vm_readv          (__NR_Linux + 345)
-#define __NR_process_vm_writev         (__NR_Linux + 346)
-#define __NR_kcmp                      (__NR_Linux + 347)
-
-/*
- * Offset of the last Linux o32 flavoured syscall
- */
-#define __NR_Linux_syscalls            347
-
-#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
-
-#define __NR_O32_Linux                 4000
-#define __NR_O32_Linux_syscalls                347
-
-#if _MIPS_SIM == _MIPS_SIM_ABI64
-
-/*
- * Linux 64-bit syscalls are in the range from 5000 to 5999.
- */
-#define __NR_Linux                     5000
-#define __NR_read                      (__NR_Linux +   0)
-#define __NR_write                     (__NR_Linux +   1)
-#define __NR_open                      (__NR_Linux +   2)
-#define __NR_close                     (__NR_Linux +   3)
-#define __NR_stat                      (__NR_Linux +   4)
-#define __NR_fstat                     (__NR_Linux +   5)
-#define __NR_lstat                     (__NR_Linux +   6)
-#define __NR_poll                      (__NR_Linux +   7)
-#define __NR_lseek                     (__NR_Linux +   8)
-#define __NR_mmap                      (__NR_Linux +   9)
-#define __NR_mprotect                  (__NR_Linux +  10)
-#define __NR_munmap                    (__NR_Linux +  11)
-#define __NR_brk                       (__NR_Linux +  12)
-#define __NR_rt_sigaction              (__NR_Linux +  13)
-#define __NR_rt_sigprocmask            (__NR_Linux +  14)
-#define __NR_ioctl                     (__NR_Linux +  15)
-#define __NR_pread64                   (__NR_Linux +  16)
-#define __NR_pwrite64                  (__NR_Linux +  17)
-#define __NR_readv                     (__NR_Linux +  18)
-#define __NR_writev                    (__NR_Linux +  19)
-#define __NR_access                    (__NR_Linux +  20)
-#define __NR_pipe                      (__NR_Linux +  21)
-#define __NR__newselect                        (__NR_Linux +  22)
-#define __NR_sched_yield               (__NR_Linux +  23)
-#define __NR_mremap                    (__NR_Linux +  24)
-#define __NR_msync                     (__NR_Linux +  25)
-#define __NR_mincore                   (__NR_Linux +  26)
-#define __NR_madvise                   (__NR_Linux +  27)
-#define __NR_shmget                    (__NR_Linux +  28)
-#define __NR_shmat                     (__NR_Linux +  29)
-#define __NR_shmctl                    (__NR_Linux +  30)
-#define __NR_dup                       (__NR_Linux +  31)
-#define __NR_dup2                      (__NR_Linux +  32)
-#define __NR_pause                     (__NR_Linux +  33)
-#define __NR_nanosleep                 (__NR_Linux +  34)
-#define __NR_getitimer                 (__NR_Linux +  35)
-#define __NR_setitimer                 (__NR_Linux +  36)
-#define __NR_alarm                     (__NR_Linux +  37)
-#define __NR_getpid                    (__NR_Linux +  38)
-#define __NR_sendfile                  (__NR_Linux +  39)
-#define __NR_socket                    (__NR_Linux +  40)
-#define __NR_connect                   (__NR_Linux +  41)
-#define __NR_accept                    (__NR_Linux +  42)
-#define __NR_sendto                    (__NR_Linux +  43)
-#define __NR_recvfrom                  (__NR_Linux +  44)
-#define __NR_sendmsg                   (__NR_Linux +  45)
-#define __NR_recvmsg                   (__NR_Linux +  46)
-#define __NR_shutdown                  (__NR_Linux +  47)
-#define __NR_bind                      (__NR_Linux +  48)
-#define __NR_listen                    (__NR_Linux +  49)
-#define __NR_getsockname               (__NR_Linux +  50)
-#define __NR_getpeername               (__NR_Linux +  51)
-#define __NR_socketpair                        (__NR_Linux +  52)
-#define __NR_setsockopt                        (__NR_Linux +  53)
-#define __NR_getsockopt                        (__NR_Linux +  54)
-#define __NR_clone                     (__NR_Linux +  55)
-#define __NR_fork                      (__NR_Linux +  56)
-#define __NR_execve                    (__NR_Linux +  57)
-#define __NR_exit                      (__NR_Linux +  58)
-#define __NR_wait4                     (__NR_Linux +  59)
-#define __NR_kill                      (__NR_Linux +  60)
-#define __NR_uname                     (__NR_Linux +  61)
-#define __NR_semget                    (__NR_Linux +  62)
-#define __NR_semop                     (__NR_Linux +  63)
-#define __NR_semctl                    (__NR_Linux +  64)
-#define __NR_shmdt                     (__NR_Linux +  65)
-#define __NR_msgget                    (__NR_Linux +  66)
-#define __NR_msgsnd                    (__NR_Linux +  67)
-#define __NR_msgrcv                    (__NR_Linux +  68)
-#define __NR_msgctl                    (__NR_Linux +  69)
-#define __NR_fcntl                     (__NR_Linux +  70)
-#define __NR_flock                     (__NR_Linux +  71)
-#define __NR_fsync                     (__NR_Linux +  72)
-#define __NR_fdatasync                 (__NR_Linux +  73)
-#define __NR_truncate                  (__NR_Linux +  74)
-#define __NR_ftruncate                 (__NR_Linux +  75)
-#define __NR_getdents                  (__NR_Linux +  76)
-#define __NR_getcwd                    (__NR_Linux +  77)
-#define __NR_chdir                     (__NR_Linux +  78)
-#define __NR_fchdir                    (__NR_Linux +  79)
-#define __NR_rename                    (__NR_Linux +  80)
-#define __NR_mkdir                     (__NR_Linux +  81)
-#define __NR_rmdir                     (__NR_Linux +  82)
-#define __NR_creat                     (__NR_Linux +  83)
-#define __NR_link                      (__NR_Linux +  84)
-#define __NR_unlink                    (__NR_Linux +  85)
-#define __NR_symlink                   (__NR_Linux +  86)
-#define __NR_readlink                  (__NR_Linux +  87)
-#define __NR_chmod                     (__NR_Linux +  88)
-#define __NR_fchmod                    (__NR_Linux +  89)
-#define __NR_chown                     (__NR_Linux +  90)
-#define __NR_fchown                    (__NR_Linux +  91)
-#define __NR_lchown                    (__NR_Linux +  92)
-#define __NR_umask                     (__NR_Linux +  93)
-#define __NR_gettimeofday              (__NR_Linux +  94)
-#define __NR_getrlimit                 (__NR_Linux +  95)
-#define __NR_getrusage                 (__NR_Linux +  96)
-#define __NR_sysinfo                   (__NR_Linux +  97)
-#define __NR_times                     (__NR_Linux +  98)
-#define __NR_ptrace                    (__NR_Linux +  99)
-#define __NR_getuid                    (__NR_Linux + 100)
-#define __NR_syslog                    (__NR_Linux + 101)
-#define __NR_getgid                    (__NR_Linux + 102)
-#define __NR_setuid                    (__NR_Linux + 103)
-#define __NR_setgid                    (__NR_Linux + 104)
-#define __NR_geteuid                   (__NR_Linux + 105)
-#define __NR_getegid                   (__NR_Linux + 106)
-#define __NR_setpgid                   (__NR_Linux + 107)
-#define __NR_getppid                   (__NR_Linux + 108)
-#define __NR_getpgrp                   (__NR_Linux + 109)
-#define __NR_setsid                    (__NR_Linux + 110)
-#define __NR_setreuid                  (__NR_Linux + 111)
-#define __NR_setregid                  (__NR_Linux + 112)
-#define __NR_getgroups                 (__NR_Linux + 113)
-#define __NR_setgroups                 (__NR_Linux + 114)
-#define __NR_setresuid                 (__NR_Linux + 115)
-#define __NR_getresuid                 (__NR_Linux + 116)
-#define __NR_setresgid                 (__NR_Linux + 117)
-#define __NR_getresgid                 (__NR_Linux + 118)
-#define __NR_getpgid                   (__NR_Linux + 119)
-#define __NR_setfsuid                  (__NR_Linux + 120)
-#define __NR_setfsgid                  (__NR_Linux + 121)
-#define __NR_getsid                    (__NR_Linux + 122)
-#define __NR_capget                    (__NR_Linux + 123)
-#define __NR_capset                    (__NR_Linux + 124)
-#define __NR_rt_sigpending             (__NR_Linux + 125)
-#define __NR_rt_sigtimedwait           (__NR_Linux + 126)
-#define __NR_rt_sigqueueinfo           (__NR_Linux + 127)
-#define __NR_rt_sigsuspend             (__NR_Linux + 128)
-#define __NR_sigaltstack               (__NR_Linux + 129)
-#define __NR_utime                     (__NR_Linux + 130)
-#define __NR_mknod                     (__NR_Linux + 131)
-#define __NR_personality               (__NR_Linux + 132)
-#define __NR_ustat                     (__NR_Linux + 133)
-#define __NR_statfs                    (__NR_Linux + 134)
-#define __NR_fstatfs                   (__NR_Linux + 135)
-#define __NR_sysfs                     (__NR_Linux + 136)
-#define __NR_getpriority               (__NR_Linux + 137)
-#define __NR_setpriority               (__NR_Linux + 138)
-#define __NR_sched_setparam            (__NR_Linux + 139)
-#define __NR_sched_getparam            (__NR_Linux + 140)
-#define __NR_sched_setscheduler                (__NR_Linux + 141)
-#define __NR_sched_getscheduler                (__NR_Linux + 142)
-#define __NR_sched_get_priority_max    (__NR_Linux + 143)
-#define __NR_sched_get_priority_min    (__NR_Linux + 144)
-#define __NR_sched_rr_get_interval     (__NR_Linux + 145)
-#define __NR_mlock                     (__NR_Linux + 146)
-#define __NR_munlock                   (__NR_Linux + 147)
-#define __NR_mlockall                  (__NR_Linux + 148)
-#define __NR_munlockall                        (__NR_Linux + 149)
-#define __NR_vhangup                   (__NR_Linux + 150)
-#define __NR_pivot_root                        (__NR_Linux + 151)
-#define __NR__sysctl                   (__NR_Linux + 152)
-#define __NR_prctl                     (__NR_Linux + 153)
-#define __NR_adjtimex                  (__NR_Linux + 154)
-#define __NR_setrlimit                 (__NR_Linux + 155)
-#define __NR_chroot                    (__NR_Linux + 156)
-#define __NR_sync                      (__NR_Linux + 157)
-#define __NR_acct                      (__NR_Linux + 158)
-#define __NR_settimeofday              (__NR_Linux + 159)
-#define __NR_mount                     (__NR_Linux + 160)
-#define __NR_umount2                   (__NR_Linux + 161)
-#define __NR_swapon                    (__NR_Linux + 162)
-#define __NR_swapoff                   (__NR_Linux + 163)
-#define __NR_reboot                    (__NR_Linux + 164)
-#define __NR_sethostname               (__NR_Linux + 165)
-#define __NR_setdomainname             (__NR_Linux + 166)
-#define __NR_create_module             (__NR_Linux + 167)
-#define __NR_init_module               (__NR_Linux + 168)
-#define __NR_delete_module             (__NR_Linux + 169)
-#define __NR_get_kernel_syms           (__NR_Linux + 170)
-#define __NR_query_module              (__NR_Linux + 171)
-#define __NR_quotactl                  (__NR_Linux + 172)
-#define __NR_nfsservctl                        (__NR_Linux + 173)
-#define __NR_getpmsg                   (__NR_Linux + 174)
-#define __NR_putpmsg                   (__NR_Linux + 175)
-#define __NR_afs_syscall               (__NR_Linux + 176)
-#define __NR_reserved177               (__NR_Linux + 177)
-#define __NR_gettid                    (__NR_Linux + 178)
-#define __NR_readahead                 (__NR_Linux + 179)
-#define __NR_setxattr                  (__NR_Linux + 180)
-#define __NR_lsetxattr                 (__NR_Linux + 181)
-#define __NR_fsetxattr                 (__NR_Linux + 182)
-#define __NR_getxattr                  (__NR_Linux + 183)
-#define __NR_lgetxattr                 (__NR_Linux + 184)
-#define __NR_fgetxattr                 (__NR_Linux + 185)
-#define __NR_listxattr                 (__NR_Linux + 186)
-#define __NR_llistxattr                        (__NR_Linux + 187)
-#define __NR_flistxattr                        (__NR_Linux + 188)
-#define __NR_removexattr               (__NR_Linux + 189)
-#define __NR_lremovexattr              (__NR_Linux + 190)
-#define __NR_fremovexattr              (__NR_Linux + 191)
-#define __NR_tkill                     (__NR_Linux + 192)
-#define __NR_reserved193               (__NR_Linux + 193)
-#define __NR_futex                     (__NR_Linux + 194)
-#define __NR_sched_setaffinity         (__NR_Linux + 195)
-#define __NR_sched_getaffinity         (__NR_Linux + 196)
-#define __NR_cacheflush                        (__NR_Linux + 197)
-#define __NR_cachectl                  (__NR_Linux + 198)
-#define __NR_sysmips                   (__NR_Linux + 199)
-#define __NR_io_setup                  (__NR_Linux + 200)
-#define __NR_io_destroy                        (__NR_Linux + 201)
-#define __NR_io_getevents              (__NR_Linux + 202)
-#define __NR_io_submit                 (__NR_Linux + 203)
-#define __NR_io_cancel                 (__NR_Linux + 204)
-#define __NR_exit_group                        (__NR_Linux + 205)
-#define __NR_lookup_dcookie            (__NR_Linux + 206)
-#define __NR_epoll_create              (__NR_Linux + 207)
-#define __NR_epoll_ctl                 (__NR_Linux + 208)
-#define __NR_epoll_wait                        (__NR_Linux + 209)
-#define __NR_remap_file_pages          (__NR_Linux + 210)
-#define __NR_rt_sigreturn              (__NR_Linux + 211)
-#define __NR_set_tid_address           (__NR_Linux + 212)
-#define __NR_restart_syscall           (__NR_Linux + 213)
-#define __NR_semtimedop                        (__NR_Linux + 214)
-#define __NR_fadvise64                 (__NR_Linux + 215)
-#define __NR_timer_create              (__NR_Linux + 216)
-#define __NR_timer_settime             (__NR_Linux + 217)
-#define __NR_timer_gettime             (__NR_Linux + 218)
-#define __NR_timer_getoverrun          (__NR_Linux + 219)
-#define __NR_timer_delete              (__NR_Linux + 220)
-#define __NR_clock_settime             (__NR_Linux + 221)
-#define __NR_clock_gettime             (__NR_Linux + 222)
-#define __NR_clock_getres              (__NR_Linux + 223)
-#define __NR_clock_nanosleep           (__NR_Linux + 224)
-#define __NR_tgkill                    (__NR_Linux + 225)
-#define __NR_utimes                    (__NR_Linux + 226)
-#define __NR_mbind                     (__NR_Linux + 227)
-#define __NR_get_mempolicy             (__NR_Linux + 228)
-#define __NR_set_mempolicy             (__NR_Linux + 229)
-#define __NR_mq_open                   (__NR_Linux + 230)
-#define __NR_mq_unlink                 (__NR_Linux + 231)
-#define __NR_mq_timedsend              (__NR_Linux + 232)
-#define __NR_mq_timedreceive           (__NR_Linux + 233)
-#define __NR_mq_notify                 (__NR_Linux + 234)
-#define __NR_mq_getsetattr             (__NR_Linux + 235)
-#define __NR_vserver                   (__NR_Linux + 236)
-#define __NR_waitid                    (__NR_Linux + 237)
-/* #define __NR_sys_setaltroot         (__NR_Linux + 238) */
-#define __NR_add_key                   (__NR_Linux + 239)
-#define __NR_request_key               (__NR_Linux + 240)
-#define __NR_keyctl                    (__NR_Linux + 241)
-#define __NR_set_thread_area           (__NR_Linux + 242)
-#define __NR_inotify_init              (__NR_Linux + 243)
-#define __NR_inotify_add_watch         (__NR_Linux + 244)
-#define __NR_inotify_rm_watch          (__NR_Linux + 245)
-#define __NR_migrate_pages             (__NR_Linux + 246)
-#define __NR_openat                    (__NR_Linux + 247)
-#define __NR_mkdirat                   (__NR_Linux + 248)
-#define __NR_mknodat                   (__NR_Linux + 249)
-#define __NR_fchownat                  (__NR_Linux + 250)
-#define __NR_futimesat                 (__NR_Linux + 251)
-#define __NR_newfstatat                        (__NR_Linux + 252)
-#define __NR_unlinkat                  (__NR_Linux + 253)
-#define __NR_renameat                  (__NR_Linux + 254)
-#define __NR_linkat                    (__NR_Linux + 255)
-#define __NR_symlinkat                 (__NR_Linux + 256)
-#define __NR_readlinkat                        (__NR_Linux + 257)
-#define __NR_fchmodat                  (__NR_Linux + 258)
-#define __NR_faccessat                 (__NR_Linux + 259)
-#define __NR_pselect6                  (__NR_Linux + 260)
-#define __NR_ppoll                     (__NR_Linux + 261)
-#define __NR_unshare                   (__NR_Linux + 262)
-#define __NR_splice                    (__NR_Linux + 263)
-#define __NR_sync_file_range           (__NR_Linux + 264)
-#define __NR_tee                       (__NR_Linux + 265)
-#define __NR_vmsplice                  (__NR_Linux + 266)
-#define __NR_move_pages                        (__NR_Linux + 267)
-#define __NR_set_robust_list           (__NR_Linux + 268)
-#define __NR_get_robust_list           (__NR_Linux + 269)
-#define __NR_kexec_load                        (__NR_Linux + 270)
-#define __NR_getcpu                    (__NR_Linux + 271)
-#define __NR_epoll_pwait               (__NR_Linux + 272)
-#define __NR_ioprio_set                        (__NR_Linux + 273)
-#define __NR_ioprio_get                        (__NR_Linux + 274)
-#define __NR_utimensat                 (__NR_Linux + 275)
-#define __NR_signalfd                  (__NR_Linux + 276)
-#define __NR_timerfd                   (__NR_Linux + 277)
-#define __NR_eventfd                   (__NR_Linux + 278)
-#define __NR_fallocate                 (__NR_Linux + 279)
-#define __NR_timerfd_create            (__NR_Linux + 280)
-#define __NR_timerfd_gettime           (__NR_Linux + 281)
-#define __NR_timerfd_settime           (__NR_Linux + 282)
-#define __NR_signalfd4                 (__NR_Linux + 283)
-#define __NR_eventfd2                  (__NR_Linux + 284)
-#define __NR_epoll_create1             (__NR_Linux + 285)
-#define __NR_dup3                      (__NR_Linux + 286)
-#define __NR_pipe2                     (__NR_Linux + 287)
-#define __NR_inotify_init1             (__NR_Linux + 288)
-#define __NR_preadv                    (__NR_Linux + 289)
-#define __NR_pwritev                   (__NR_Linux + 290)
-#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 291)
-#define __NR_perf_event_open           (__NR_Linux + 292)
-#define __NR_accept4                   (__NR_Linux + 293)
-#define __NR_recvmmsg                  (__NR_Linux + 294)
-#define __NR_fanotify_init             (__NR_Linux + 295)
-#define __NR_fanotify_mark             (__NR_Linux + 296)
-#define __NR_prlimit64                 (__NR_Linux + 297)
-#define __NR_name_to_handle_at         (__NR_Linux + 298)
-#define __NR_open_by_handle_at         (__NR_Linux + 299)
-#define __NR_clock_adjtime             (__NR_Linux + 300)
-#define __NR_syncfs                    (__NR_Linux + 301)
-#define __NR_sendmmsg                  (__NR_Linux + 302)
-#define __NR_setns                     (__NR_Linux + 303)
-#define __NR_process_vm_readv          (__NR_Linux + 304)
-#define __NR_process_vm_writev         (__NR_Linux + 305)
-#define __NR_kcmp                      (__NR_Linux + 306)
-
-/*
- * Offset of the last Linux 64-bit flavoured syscall
- */
-#define __NR_Linux_syscalls            306
-
-#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
-
-#define __NR_64_Linux                  5000
-#define __NR_64_Linux_syscalls         306
-
-#if _MIPS_SIM == _MIPS_SIM_NABI32
-
-/*
- * Linux N32 syscalls are in the range from 6000 to 6999.
- */
-#define __NR_Linux                     6000
-#define __NR_read                      (__NR_Linux +   0)
-#define __NR_write                     (__NR_Linux +   1)
-#define __NR_open                      (__NR_Linux +   2)
-#define __NR_close                     (__NR_Linux +   3)
-#define __NR_stat                      (__NR_Linux +   4)
-#define __NR_fstat                     (__NR_Linux +   5)
-#define __NR_lstat                     (__NR_Linux +   6)
-#define __NR_poll                      (__NR_Linux +   7)
-#define __NR_lseek                     (__NR_Linux +   8)
-#define __NR_mmap                      (__NR_Linux +   9)
-#define __NR_mprotect                  (__NR_Linux +  10)
-#define __NR_munmap                    (__NR_Linux +  11)
-#define __NR_brk                       (__NR_Linux +  12)
-#define __NR_rt_sigaction              (__NR_Linux +  13)
-#define __NR_rt_sigprocmask            (__NR_Linux +  14)
-#define __NR_ioctl                     (__NR_Linux +  15)
-#define __NR_pread64                   (__NR_Linux +  16)
-#define __NR_pwrite64                  (__NR_Linux +  17)
-#define __NR_readv                     (__NR_Linux +  18)
-#define __NR_writev                    (__NR_Linux +  19)
-#define __NR_access                    (__NR_Linux +  20)
-#define __NR_pipe                      (__NR_Linux +  21)
-#define __NR__newselect                        (__NR_Linux +  22)
-#define __NR_sched_yield               (__NR_Linux +  23)
-#define __NR_mremap                    (__NR_Linux +  24)
-#define __NR_msync                     (__NR_Linux +  25)
-#define __NR_mincore                   (__NR_Linux +  26)
-#define __NR_madvise                   (__NR_Linux +  27)
-#define __NR_shmget                    (__NR_Linux +  28)
-#define __NR_shmat                     (__NR_Linux +  29)
-#define __NR_shmctl                    (__NR_Linux +  30)
-#define __NR_dup                       (__NR_Linux +  31)
-#define __NR_dup2                      (__NR_Linux +  32)
-#define __NR_pause                     (__NR_Linux +  33)
-#define __NR_nanosleep                 (__NR_Linux +  34)
-#define __NR_getitimer                 (__NR_Linux +  35)
-#define __NR_setitimer                 (__NR_Linux +  36)
-#define __NR_alarm                     (__NR_Linux +  37)
-#define __NR_getpid                    (__NR_Linux +  38)
-#define __NR_sendfile                  (__NR_Linux +  39)
-#define __NR_socket                    (__NR_Linux +  40)
-#define __NR_connect                   (__NR_Linux +  41)
-#define __NR_accept                    (__NR_Linux +  42)
-#define __NR_sendto                    (__NR_Linux +  43)
-#define __NR_recvfrom                  (__NR_Linux +  44)
-#define __NR_sendmsg                   (__NR_Linux +  45)
-#define __NR_recvmsg                   (__NR_Linux +  46)
-#define __NR_shutdown                  (__NR_Linux +  47)
-#define __NR_bind                      (__NR_Linux +  48)
-#define __NR_listen                    (__NR_Linux +  49)
-#define __NR_getsockname               (__NR_Linux +  50)
-#define __NR_getpeername               (__NR_Linux +  51)
-#define __NR_socketpair                        (__NR_Linux +  52)
-#define __NR_setsockopt                        (__NR_Linux +  53)
-#define __NR_getsockopt                        (__NR_Linux +  54)
-#define __NR_clone                     (__NR_Linux +  55)
-#define __NR_fork                      (__NR_Linux +  56)
-#define __NR_execve                    (__NR_Linux +  57)
-#define __NR_exit                      (__NR_Linux +  58)
-#define __NR_wait4                     (__NR_Linux +  59)
-#define __NR_kill                      (__NR_Linux +  60)
-#define __NR_uname                     (__NR_Linux +  61)
-#define __NR_semget                    (__NR_Linux +  62)
-#define __NR_semop                     (__NR_Linux +  63)
-#define __NR_semctl                    (__NR_Linux +  64)
-#define __NR_shmdt                     (__NR_Linux +  65)
-#define __NR_msgget                    (__NR_Linux +  66)
-#define __NR_msgsnd                    (__NR_Linux +  67)
-#define __NR_msgrcv                    (__NR_Linux +  68)
-#define __NR_msgctl                    (__NR_Linux +  69)
-#define __NR_fcntl                     (__NR_Linux +  70)
-#define __NR_flock                     (__NR_Linux +  71)
-#define __NR_fsync                     (__NR_Linux +  72)
-#define __NR_fdatasync                 (__NR_Linux +  73)
-#define __NR_truncate                  (__NR_Linux +  74)
-#define __NR_ftruncate                 (__NR_Linux +  75)
-#define __NR_getdents                  (__NR_Linux +  76)
-#define __NR_getcwd                    (__NR_Linux +  77)
-#define __NR_chdir                     (__NR_Linux +  78)
-#define __NR_fchdir                    (__NR_Linux +  79)
-#define __NR_rename                    (__NR_Linux +  80)
-#define __NR_mkdir                     (__NR_Linux +  81)
-#define __NR_rmdir                     (__NR_Linux +  82)
-#define __NR_creat                     (__NR_Linux +  83)
-#define __NR_link                      (__NR_Linux +  84)
-#define __NR_unlink                    (__NR_Linux +  85)
-#define __NR_symlink                   (__NR_Linux +  86)
-#define __NR_readlink                  (__NR_Linux +  87)
-#define __NR_chmod                     (__NR_Linux +  88)
-#define __NR_fchmod                    (__NR_Linux +  89)
-#define __NR_chown                     (__NR_Linux +  90)
-#define __NR_fchown                    (__NR_Linux +  91)
-#define __NR_lchown                    (__NR_Linux +  92)
-#define __NR_umask                     (__NR_Linux +  93)
-#define __NR_gettimeofday              (__NR_Linux +  94)
-#define __NR_getrlimit                 (__NR_Linux +  95)
-#define __NR_getrusage                 (__NR_Linux +  96)
-#define __NR_sysinfo                   (__NR_Linux +  97)
-#define __NR_times                     (__NR_Linux +  98)
-#define __NR_ptrace                    (__NR_Linux +  99)
-#define __NR_getuid                    (__NR_Linux + 100)
-#define __NR_syslog                    (__NR_Linux + 101)
-#define __NR_getgid                    (__NR_Linux + 102)
-#define __NR_setuid                    (__NR_Linux + 103)
-#define __NR_setgid                    (__NR_Linux + 104)
-#define __NR_geteuid                   (__NR_Linux + 105)
-#define __NR_getegid                   (__NR_Linux + 106)
-#define __NR_setpgid                   (__NR_Linux + 107)
-#define __NR_getppid                   (__NR_Linux + 108)
-#define __NR_getpgrp                   (__NR_Linux + 109)
-#define __NR_setsid                    (__NR_Linux + 110)
-#define __NR_setreuid                  (__NR_Linux + 111)
-#define __NR_setregid                  (__NR_Linux + 112)
-#define __NR_getgroups                 (__NR_Linux + 113)
-#define __NR_setgroups                 (__NR_Linux + 114)
-#define __NR_setresuid                 (__NR_Linux + 115)
-#define __NR_getresuid                 (__NR_Linux + 116)
-#define __NR_setresgid                 (__NR_Linux + 117)
-#define __NR_getresgid                 (__NR_Linux + 118)
-#define __NR_getpgid                   (__NR_Linux + 119)
-#define __NR_setfsuid                  (__NR_Linux + 120)
-#define __NR_setfsgid                  (__NR_Linux + 121)
-#define __NR_getsid                    (__NR_Linux + 122)
-#define __NR_capget                    (__NR_Linux + 123)
-#define __NR_capset                    (__NR_Linux + 124)
-#define __NR_rt_sigpending             (__NR_Linux + 125)
-#define __NR_rt_sigtimedwait           (__NR_Linux + 126)
-#define __NR_rt_sigqueueinfo           (__NR_Linux + 127)
-#define __NR_rt_sigsuspend             (__NR_Linux + 128)
-#define __NR_sigaltstack               (__NR_Linux + 129)
-#define __NR_utime                     (__NR_Linux + 130)
-#define __NR_mknod                     (__NR_Linux + 131)
-#define __NR_personality               (__NR_Linux + 132)
-#define __NR_ustat                     (__NR_Linux + 133)
-#define __NR_statfs                    (__NR_Linux + 134)
-#define __NR_fstatfs                   (__NR_Linux + 135)
-#define __NR_sysfs                     (__NR_Linux + 136)
-#define __NR_getpriority               (__NR_Linux + 137)
-#define __NR_setpriority               (__NR_Linux + 138)
-#define __NR_sched_setparam            (__NR_Linux + 139)
-#define __NR_sched_getparam            (__NR_Linux + 140)
-#define __NR_sched_setscheduler                (__NR_Linux + 141)
-#define __NR_sched_getscheduler                (__NR_Linux + 142)
-#define __NR_sched_get_priority_max    (__NR_Linux + 143)
-#define __NR_sched_get_priority_min    (__NR_Linux + 144)
-#define __NR_sched_rr_get_interval     (__NR_Linux + 145)
-#define __NR_mlock                     (__NR_Linux + 146)
-#define __NR_munlock                   (__NR_Linux + 147)
-#define __NR_mlockall                  (__NR_Linux + 148)
-#define __NR_munlockall                        (__NR_Linux + 149)
-#define __NR_vhangup                   (__NR_Linux + 150)
-#define __NR_pivot_root                        (__NR_Linux + 151)
-#define __NR__sysctl                   (__NR_Linux + 152)
-#define __NR_prctl                     (__NR_Linux + 153)
-#define __NR_adjtimex                  (__NR_Linux + 154)
-#define __NR_setrlimit                 (__NR_Linux + 155)
-#define __NR_chroot                    (__NR_Linux + 156)
-#define __NR_sync                      (__NR_Linux + 157)
-#define __NR_acct                      (__NR_Linux + 158)
-#define __NR_settimeofday              (__NR_Linux + 159)
-#define __NR_mount                     (__NR_Linux + 160)
-#define __NR_umount2                   (__NR_Linux + 161)
-#define __NR_swapon                    (__NR_Linux + 162)
-#define __NR_swapoff                   (__NR_Linux + 163)
-#define __NR_reboot                    (__NR_Linux + 164)
-#define __NR_sethostname               (__NR_Linux + 165)
-#define __NR_setdomainname             (__NR_Linux + 166)
-#define __NR_create_module             (__NR_Linux + 167)
-#define __NR_init_module               (__NR_Linux + 168)
-#define __NR_delete_module             (__NR_Linux + 169)
-#define __NR_get_kernel_syms           (__NR_Linux + 170)
-#define __NR_query_module              (__NR_Linux + 171)
-#define __NR_quotactl                  (__NR_Linux + 172)
-#define __NR_nfsservctl                        (__NR_Linux + 173)
-#define __NR_getpmsg                   (__NR_Linux + 174)
-#define __NR_putpmsg                   (__NR_Linux + 175)
-#define __NR_afs_syscall               (__NR_Linux + 176)
-#define __NR_reserved177               (__NR_Linux + 177)
-#define __NR_gettid                    (__NR_Linux + 178)
-#define __NR_readahead                 (__NR_Linux + 179)
-#define __NR_setxattr                  (__NR_Linux + 180)
-#define __NR_lsetxattr                 (__NR_Linux + 181)
-#define __NR_fsetxattr                 (__NR_Linux + 182)
-#define __NR_getxattr                  (__NR_Linux + 183)
-#define __NR_lgetxattr                 (__NR_Linux + 184)
-#define __NR_fgetxattr                 (__NR_Linux + 185)
-#define __NR_listxattr                 (__NR_Linux + 186)
-#define __NR_llistxattr                        (__NR_Linux + 187)
-#define __NR_flistxattr                        (__NR_Linux + 188)
-#define __NR_removexattr               (__NR_Linux + 189)
-#define __NR_lremovexattr              (__NR_Linux + 190)
-#define __NR_fremovexattr              (__NR_Linux + 191)
-#define __NR_tkill                     (__NR_Linux + 192)
-#define __NR_reserved193               (__NR_Linux + 193)
-#define __NR_futex                     (__NR_Linux + 194)
-#define __NR_sched_setaffinity         (__NR_Linux + 195)
-#define __NR_sched_getaffinity         (__NR_Linux + 196)
-#define __NR_cacheflush                        (__NR_Linux + 197)
-#define __NR_cachectl                  (__NR_Linux + 198)
-#define __NR_sysmips                   (__NR_Linux + 199)
-#define __NR_io_setup                  (__NR_Linux + 200)
-#define __NR_io_destroy                        (__NR_Linux + 201)
-#define __NR_io_getevents              (__NR_Linux + 202)
-#define __NR_io_submit                 (__NR_Linux + 203)
-#define __NR_io_cancel                 (__NR_Linux + 204)
-#define __NR_exit_group                        (__NR_Linux + 205)
-#define __NR_lookup_dcookie            (__NR_Linux + 206)
-#define __NR_epoll_create              (__NR_Linux + 207)
-#define __NR_epoll_ctl                 (__NR_Linux + 208)
-#define __NR_epoll_wait                        (__NR_Linux + 209)
-#define __NR_remap_file_pages          (__NR_Linux + 210)
-#define __NR_rt_sigreturn              (__NR_Linux + 211)
-#define __NR_fcntl64                   (__NR_Linux + 212)
-#define __NR_set_tid_address           (__NR_Linux + 213)
-#define __NR_restart_syscall           (__NR_Linux + 214)
-#define __NR_semtimedop                        (__NR_Linux + 215)
-#define __NR_fadvise64                 (__NR_Linux + 216)
-#define __NR_statfs64                  (__NR_Linux + 217)
-#define __NR_fstatfs64                 (__NR_Linux + 218)
-#define __NR_sendfile64                        (__NR_Linux + 219)
-#define __NR_timer_create              (__NR_Linux + 220)
-#define __NR_timer_settime             (__NR_Linux + 221)
-#define __NR_timer_gettime             (__NR_Linux + 222)
-#define __NR_timer_getoverrun          (__NR_Linux + 223)
-#define __NR_timer_delete              (__NR_Linux + 224)
-#define __NR_clock_settime             (__NR_Linux + 225)
-#define __NR_clock_gettime             (__NR_Linux + 226)
-#define __NR_clock_getres              (__NR_Linux + 227)
-#define __NR_clock_nanosleep           (__NR_Linux + 228)
-#define __NR_tgkill                    (__NR_Linux + 229)
-#define __NR_utimes                    (__NR_Linux + 230)
-#define __NR_mbind                     (__NR_Linux + 231)
-#define __NR_get_mempolicy             (__NR_Linux + 232)
-#define __NR_set_mempolicy             (__NR_Linux + 233)
-#define __NR_mq_open                   (__NR_Linux + 234)
-#define __NR_mq_unlink                 (__NR_Linux + 235)
-#define __NR_mq_timedsend              (__NR_Linux + 236)
-#define __NR_mq_timedreceive           (__NR_Linux + 237)
-#define __NR_mq_notify                 (__NR_Linux + 238)
-#define __NR_mq_getsetattr             (__NR_Linux + 239)
-#define __NR_vserver                   (__NR_Linux + 240)
-#define __NR_waitid                    (__NR_Linux + 241)
-/* #define __NR_sys_setaltroot         (__NR_Linux + 242) */
-#define __NR_add_key                   (__NR_Linux + 243)
-#define __NR_request_key               (__NR_Linux + 244)
-#define __NR_keyctl                    (__NR_Linux + 245)
-#define __NR_set_thread_area           (__NR_Linux + 246)
-#define __NR_inotify_init              (__NR_Linux + 247)
-#define __NR_inotify_add_watch         (__NR_Linux + 248)
-#define __NR_inotify_rm_watch          (__NR_Linux + 249)
-#define __NR_migrate_pages             (__NR_Linux + 250)
-#define __NR_openat                    (__NR_Linux + 251)
-#define __NR_mkdirat                   (__NR_Linux + 252)
-#define __NR_mknodat                   (__NR_Linux + 253)
-#define __NR_fchownat                  (__NR_Linux + 254)
-#define __NR_futimesat                 (__NR_Linux + 255)
-#define __NR_newfstatat                        (__NR_Linux + 256)
-#define __NR_unlinkat                  (__NR_Linux + 257)
-#define __NR_renameat                  (__NR_Linux + 258)
-#define __NR_linkat                    (__NR_Linux + 259)
-#define __NR_symlinkat                 (__NR_Linux + 260)
-#define __NR_readlinkat                        (__NR_Linux + 261)
-#define __NR_fchmodat                  (__NR_Linux + 262)
-#define __NR_faccessat                 (__NR_Linux + 263)
-#define __NR_pselect6                  (__NR_Linux + 264)
-#define __NR_ppoll                     (__NR_Linux + 265)
-#define __NR_unshare                   (__NR_Linux + 266)
-#define __NR_splice                    (__NR_Linux + 267)
-#define __NR_sync_file_range           (__NR_Linux + 268)
-#define __NR_tee                       (__NR_Linux + 269)
-#define __NR_vmsplice                  (__NR_Linux + 270)
-#define __NR_move_pages                        (__NR_Linux + 271)
-#define __NR_set_robust_list           (__NR_Linux + 272)
-#define __NR_get_robust_list           (__NR_Linux + 273)
-#define __NR_kexec_load                        (__NR_Linux + 274)
-#define __NR_getcpu                    (__NR_Linux + 275)
-#define __NR_epoll_pwait               (__NR_Linux + 276)
-#define __NR_ioprio_set                        (__NR_Linux + 277)
-#define __NR_ioprio_get                        (__NR_Linux + 278)
-#define __NR_utimensat                 (__NR_Linux + 279)
-#define __NR_signalfd                  (__NR_Linux + 280)
-#define __NR_timerfd                   (__NR_Linux + 281)
-#define __NR_eventfd                   (__NR_Linux + 282)
-#define __NR_fallocate                 (__NR_Linux + 283)
-#define __NR_timerfd_create            (__NR_Linux + 284)
-#define __NR_timerfd_gettime           (__NR_Linux + 285)
-#define __NR_timerfd_settime           (__NR_Linux + 286)
-#define __NR_signalfd4                 (__NR_Linux + 287)
-#define __NR_eventfd2                  (__NR_Linux + 288)
-#define __NR_epoll_create1             (__NR_Linux + 289)
-#define __NR_dup3                      (__NR_Linux + 290)
-#define __NR_pipe2                     (__NR_Linux + 291)
-#define __NR_inotify_init1             (__NR_Linux + 292)
-#define __NR_preadv                    (__NR_Linux + 293)
-#define __NR_pwritev                   (__NR_Linux + 294)
-#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 295)
-#define __NR_perf_event_open           (__NR_Linux + 296)
-#define __NR_accept4                   (__NR_Linux + 297)
-#define __NR_recvmmsg                  (__NR_Linux + 298)
-#define __NR_getdents64                        (__NR_Linux + 299)
-#define __NR_fanotify_init             (__NR_Linux + 300)
-#define __NR_fanotify_mark             (__NR_Linux + 301)
-#define __NR_prlimit64                 (__NR_Linux + 302)
-#define __NR_name_to_handle_at         (__NR_Linux + 303)
-#define __NR_open_by_handle_at         (__NR_Linux + 304)
-#define __NR_clock_adjtime             (__NR_Linux + 305)
-#define __NR_syncfs                    (__NR_Linux + 306)
-#define __NR_sendmmsg                  (__NR_Linux + 307)
-#define __NR_setns                     (__NR_Linux + 308)
-#define __NR_process_vm_readv          (__NR_Linux + 309)
-#define __NR_process_vm_writev         (__NR_Linux + 310)
-#define __NR_kcmp                      (__NR_Linux + 311)
-
-/*
- * Offset of the last N32 flavoured syscall
- */
-#define __NR_Linux_syscalls            311
-
-#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
-
-#define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                311
-
-#ifdef __KERNEL__
 
 #ifndef __ASSEMBLY__
 
  */
 #define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
 
-#endif /* __KERNEL__ */
 #endif /* _ASM_UNISTD_H */
index baebb3da1d44160fc6f6f259886656e6f494b167..a1a0452ac1853333b07dac4dc7495c9bdd2514a5 100644 (file)
@@ -1,3 +1,37 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += auxvec.h
+header-y += bitsperlong.h
+header-y += byteorder.h
+header-y += cachectl.h
+header-y += errno.h
+header-y += fcntl.h
+header-y += ioctl.h
+header-y += ioctls.h
+header-y += ipcbuf.h
+header-y += kvm_para.h
+header-y += mman.h
+header-y += msgbuf.h
+header-y += param.h
+header-y += poll.h
+header-y += posix_types.h
+header-y += ptrace.h
+header-y += resource.h
+header-y += sembuf.h
+header-y += setup.h
+header-y += sgidefs.h
+header-y += shmbuf.h
+header-y += sigcontext.h
+header-y += siginfo.h
+header-y += signal.h
+header-y += socket.h
+header-y += sockios.h
+header-y += stat.h
+header-y += statfs.h
+header-y += swab.h
+header-y += sysmips.h
+header-y += termbits.h
+header-y += termios.h
+header-y += types.h
+header-y += unistd.h
diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
new file mode 100644 (file)
index 0000000..bd67b15
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
+ */
+#ifndef _UAPI_ASM_ERRNO_H
+#define _UAPI_ASM_ERRNO_H
+
+/*
+ * These error numbers are intended to be MIPS ABI compatible
+ */
+
+#include <asm-generic/errno-base.h>
+
+#define        ENOMSG          35      /* No message of desired type */
+#define        EIDRM           36      /* Identifier removed */
+#define        ECHRNG          37      /* Channel number out of range */
+#define        EL2NSYNC        38      /* Level 2 not synchronized */
+#define        EL3HLT          39      /* Level 3 halted */
+#define        EL3RST          40      /* Level 3 reset */
+#define        ELNRNG          41      /* Link number out of range */
+#define        EUNATCH         42      /* Protocol driver not attached */
+#define        ENOCSI          43      /* No CSI structure available */
+#define        EL2HLT          44      /* Level 2 halted */
+#define        EDEADLK         45      /* Resource deadlock would occur */
+#define        ENOLCK          46      /* No record locks available */
+#define        EBADE           50      /* Invalid exchange */
+#define        EBADR           51      /* Invalid request descriptor */
+#define        EXFULL          52      /* Exchange full */
+#define        ENOANO          53      /* No anode */
+#define        EBADRQC         54      /* Invalid request code */
+#define        EBADSLT         55      /* Invalid slot */
+#define        EDEADLOCK       56      /* File locking deadlock error */
+#define        EBFONT          59      /* Bad font file format */
+#define        ENOSTR          60      /* Device not a stream */
+#define        ENODATA         61      /* No data available */
+#define        ETIME           62      /* Timer expired */
+#define        ENOSR           63      /* Out of streams resources */
+#define        ENONET          64      /* Machine is not on the network */
+#define        ENOPKG          65      /* Package not installed */
+#define        EREMOTE         66      /* Object is remote */
+#define        ENOLINK         67      /* Link has been severed */
+#define        EADV            68      /* Advertise error */
+#define        ESRMNT          69      /* Srmount error */
+#define        ECOMM           70      /* Communication error on send */
+#define        EPROTO          71      /* Protocol error */
+#define        EDOTDOT         73      /* RFS specific error */
+#define        EMULTIHOP       74      /* Multihop attempted */
+#define        EBADMSG         77      /* Not a data message */
+#define        ENAMETOOLONG    78      /* File name too long */
+#define        EOVERFLOW       79      /* Value too large for defined data type */
+#define        ENOTUNIQ        80      /* Name not unique on network */
+#define        EBADFD          81      /* File descriptor in bad state */
+#define        EREMCHG         82      /* Remote address changed */
+#define        ELIBACC         83      /* Can not access a needed shared library */
+#define        ELIBBAD         84      /* Accessing a corrupted shared library */
+#define        ELIBSCN         85      /* .lib section in a.out corrupted */
+#define        ELIBMAX         86      /* Attempting to link in too many shared libraries */
+#define        ELIBEXEC        87      /* Cannot exec a shared library directly */
+#define        EILSEQ          88      /* Illegal byte sequence */
+#define        ENOSYS          89      /* Function not implemented */
+#define        ELOOP           90      /* Too many symbolic links encountered */
+#define        ERESTART        91      /* Interrupted system call should be restarted */
+#define        ESTRPIPE        92      /* Streams pipe error */
+#define        ENOTEMPTY       93      /* Directory not empty */
+#define        EUSERS          94      /* Too many users */
+#define        ENOTSOCK        95      /* Socket operation on non-socket */
+#define        EDESTADDRREQ    96      /* Destination address required */
+#define        EMSGSIZE        97      /* Message too long */
+#define        EPROTOTYPE      98      /* Protocol wrong type for socket */
+#define        ENOPROTOOPT     99      /* Protocol not available */
+#define        EPROTONOSUPPORT 120     /* Protocol not supported */
+#define        ESOCKTNOSUPPORT 121     /* Socket type not supported */
+#define        EOPNOTSUPP      122     /* Operation not supported on transport endpoint */
+#define        EPFNOSUPPORT    123     /* Protocol family not supported */
+#define        EAFNOSUPPORT    124     /* Address family not supported by protocol */
+#define        EADDRINUSE      125     /* Address already in use */
+#define        EADDRNOTAVAIL   126     /* Cannot assign requested address */
+#define        ENETDOWN        127     /* Network is down */
+#define        ENETUNREACH     128     /* Network is unreachable */
+#define        ENETRESET       129     /* Network dropped connection because of reset */
+#define        ECONNABORTED    130     /* Software caused connection abort */
+#define        ECONNRESET      131     /* Connection reset by peer */
+#define        ENOBUFS         132     /* No buffer space available */
+#define        EISCONN         133     /* Transport endpoint is already connected */
+#define        ENOTCONN        134     /* Transport endpoint is not connected */
+#define        EUCLEAN         135     /* Structure needs cleaning */
+#define        ENOTNAM         137     /* Not a XENIX named type file */
+#define        ENAVAIL         138     /* No XENIX semaphores available */
+#define        EISNAM          139     /* Is a named type file */
+#define        EREMOTEIO       140     /* Remote I/O error */
+#define EINIT          141     /* Reserved */
+#define EREMDEV                142     /* Error 142 */
+#define        ESHUTDOWN       143     /* Cannot send after transport endpoint shutdown */
+#define        ETOOMANYREFS    144     /* Too many references: cannot splice */
+#define        ETIMEDOUT       145     /* Connection timed out */
+#define        ECONNREFUSED    146     /* Connection refused */
+#define        EHOSTDOWN       147     /* Host is down */
+#define        EHOSTUNREACH    148     /* No route to host */
+#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
+#define        EALREADY        149     /* Operation already in progress */
+#define        EINPROGRESS     150     /* Operation now in progress */
+#define        ESTALE          151     /* Stale NFS file handle */
+#define ECANCELED      158     /* AIO operation canceled */
+
+/*
+ * These error are Linux extensions.
+ */
+#define ENOMEDIUM      159     /* No medium found */
+#define EMEDIUMTYPE    160     /* Wrong medium type */
+#define        ENOKEY          161     /* Required key not available */
+#define        EKEYEXPIRED     162     /* Key has expired */
+#define        EKEYREVOKED     163     /* Key has been revoked */
+#define        EKEYREJECTED    164     /* Key was rejected by service */
+
+/* for robust mutexes */
+#define        EOWNERDEAD      165     /* Owner died */
+#define        ENOTRECOVERABLE 166     /* State not recoverable */
+
+#define        ERFKILL         167     /* Operation not possible due to RF-kill */
+
+#define EHWPOISON      168     /* Memory page has hardware error */
+
+#define EDQUOT         1133    /* Quota exceeded */
+
+
+#endif /* _UAPI_ASM_ERRNO_H */
diff --git a/arch/mips/include/uapi/asm/ptrace.h b/arch/mips/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..1bc1f52
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_PTRACE_H
+#define _UAPI_ASM_PTRACE_H
+
+/* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
+#define FPR_BASE       32
+#define PC             64
+#define CAUSE          65
+#define BADVADDR       66
+#define MMHI           67
+#define MMLO           68
+#define FPC_CSR                69
+#define FPC_EIR                70
+#define DSP_BASE       71              /* 3 more hi / lo register pairs */
+#define DSP_CONTROL    77
+#define ACX            78
+
+/*
+ * This struct defines the way the registers are stored on the stack during a
+ * system call/exception. As usual the registers k0/k1 aren't being saved.
+ */
+struct pt_regs {
+#ifdef CONFIG_32BIT
+       /* Pad bytes for argument save space on the stack. */
+       unsigned long pad0[6];
+#endif
+
+       /* Saved main processor registers. */
+       unsigned long regs[32];
+
+       /* Saved special registers. */
+       unsigned long cp0_status;
+       unsigned long hi;
+       unsigned long lo;
+#ifdef CONFIG_CPU_HAS_SMARTMIPS
+       unsigned long acx;
+#endif
+       unsigned long cp0_badvaddr;
+       unsigned long cp0_cause;
+       unsigned long cp0_epc;
+#ifdef CONFIG_MIPS_MT_SMTC
+       unsigned long cp0_tcstatus;
+#endif /* CONFIG_MIPS_MT_SMTC */
+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+       unsigned long long mpl[3];        /* MTM{0,1,2} */
+       unsigned long long mtp[3];        /* MTP{0,1,2} */
+#endif
+} __attribute__ ((aligned (8)));
+
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS         12
+#define PTRACE_SETREGS         13
+#define PTRACE_GETFPREGS               14
+#define PTRACE_SETFPREGS               15
+/* #define PTRACE_GETFPXREGS           18 */
+/* #define PTRACE_SETFPXREGS           19 */
+
+#define PTRACE_OLDSETOPTIONS   21
+
+#define PTRACE_GET_THREAD_AREA 25
+#define PTRACE_SET_THREAD_AREA 26
+
+/* Calls to trace a 64bit program from a 32bit program.  */
+#define PTRACE_PEEKTEXT_3264   0xc0
+#define PTRACE_PEEKDATA_3264   0xc1
+#define PTRACE_POKETEXT_3264   0xc2
+#define PTRACE_POKEDATA_3264   0xc3
+#define PTRACE_GET_THREAD_AREA_3264    0xc4
+
+/* Read and write watchpoint registers.  */
+enum pt_watch_style {
+       pt_watch_style_mips32,
+       pt_watch_style_mips64
+};
+struct mips32_watch_regs {
+       unsigned int watchlo[8];
+       /* Lower 16 bits of watchhi. */
+       unsigned short watchhi[8];
+       /* Valid mask and I R W bits.
+        * bit 0 -- 1 if W bit is usable.
+        * bit 1 -- 1 if R bit is usable.
+        * bit 2 -- 1 if I bit is usable.
+        * bits 3 - 11 -- Valid watchhi mask bits.
+        */
+       unsigned short watch_masks[8];
+       /* The number of valid watch register pairs.  */
+       unsigned int num_valid;
+} __attribute__((aligned(8)));
+
+struct mips64_watch_regs {
+       unsigned long long watchlo[8];
+       unsigned short watchhi[8];
+       unsigned short watch_masks[8];
+       unsigned int num_valid;
+} __attribute__((aligned(8)));
+
+struct pt_watch_regs {
+       enum pt_watch_style style;
+       union {
+               struct mips32_watch_regs mips32;
+               struct mips64_watch_regs mips64;
+       };
+};
+
+#define PTRACE_GET_WATCH_REGS  0xd0
+#define PTRACE_SET_WATCH_REGS  0xd1
+
+
+#endif /* _UAPI_ASM_PTRACE_H */
diff --git a/arch/mips/include/uapi/asm/setup.h b/arch/mips/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..93f237b
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _UAPI_MIPS_SETUP_H
+#define _UAPI_MIPS_SETUP_H
+
+#define COMMAND_LINE_SIZE      4096
+
+
+#endif /* _UAPI_MIPS_SETUP_H */
diff --git a/arch/mips/include/uapi/asm/sigcontext.h b/arch/mips/include/uapi/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..6c9906f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_SIGCONTEXT_H
+#define _UAPI_ASM_SIGCONTEXT_H
+
+#include <linux/types.h>
+#include <asm/sgidefs.h>
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+
+/*
+ * Keep this struct definition in sync with the sigcontext fragment
+ * in arch/mips/tools/offset.c
+ */
+struct sigcontext {
+       unsigned int            sc_regmask;     /* Unused */
+       unsigned int            sc_status;      /* Unused */
+       unsigned long long      sc_pc;
+       unsigned long long      sc_regs[32];
+       unsigned long long      sc_fpregs[32];
+       unsigned int            sc_acx;         /* Was sc_ownedfp */
+       unsigned int            sc_fpc_csr;
+       unsigned int            sc_fpc_eir;     /* Unused */
+       unsigned int            sc_used_math;
+       unsigned int            sc_dsp;         /* dsp status, was sc_ssflags */
+       unsigned long long      sc_mdhi;
+       unsigned long long      sc_mdlo;
+       unsigned long           sc_hi1;         /* Was sc_cause */
+       unsigned long           sc_lo1;         /* Was sc_badvaddr */
+       unsigned long           sc_hi2;         /* Was sc_sigset[4] */
+       unsigned long           sc_lo2;
+       unsigned long           sc_hi3;
+       unsigned long           sc_lo3;
+};
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+
+#include <linux/posix_types.h>
+/*
+ * Keep this struct definition in sync with the sigcontext fragment
+ * in arch/mips/tools/offset.c
+ *
+ * Warning: this structure illdefined with sc_badvaddr being just an unsigned
+ * int so it was changed to unsigned long in 2.6.0-test1.  This may break
+ * binary compatibility - no prisoners.
+ * DSP ASE in 2.6.12-rc4.  Turn sc_mdhi and sc_mdlo into an array of four
+ * entries, add sc_dsp and sc_reserved for padding.  No prisoners.
+ */
+struct sigcontext {
+       __u64   sc_regs[32];
+       __u64   sc_fpregs[32];
+       __u64   sc_mdhi;
+       __u64   sc_hi1;
+       __u64   sc_hi2;
+       __u64   sc_hi3;
+       __u64   sc_mdlo;
+       __u64   sc_lo1;
+       __u64   sc_lo2;
+       __u64   sc_lo3;
+       __u64   sc_pc;
+       __u32   sc_fpc_csr;
+       __u32   sc_used_math;
+       __u32   sc_dsp;
+       __u32   sc_reserved;
+};
+
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
+
+#endif /* _UAPI_ASM_SIGCONTEXT_H */
diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h
new file mode 100644 (file)
index 0000000..7344650
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_SIGINFO_H
+#define _UAPI_ASM_SIGINFO_H
+
+
+#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
+#undef __ARCH_SI_TRAPNO        /* exception code needs to fill this ...  */
+
+#define HAVE_ARCH_SIGINFO_T
+
+/*
+ * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
+ * by design ...
+ */
+#define HAVE_ARCH_COPY_SIGINFO
+struct siginfo;
+
+/*
+ * Careful to keep union _sifields from shifting ...
+ */
+#ifdef CONFIG_32BIT
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#endif
+#ifdef CONFIG_64BIT
+#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#include <asm-generic/siginfo.h>
+
+typedef struct siginfo {
+       int si_signo;
+       int si_code;
+       int si_errno;
+       int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
+
+       union {
+               int _pad[SI_PAD_SIZE];
+
+               /* kill() */
+               struct {
+                       pid_t _pid;             /* sender's pid */
+                       __ARCH_SI_UID_T _uid;   /* sender's uid */
+               } _kill;
+
+               /* POSIX.1b timers */
+               struct {
+                       timer_t _tid;           /* timer id */
+                       int _overrun;           /* overrun count */
+                       char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+                       sigval_t _sigval;       /* same as below */
+                       int _sys_private;       /* not to be passed to user */
+               } _timer;
+
+               /* POSIX.1b signals */
+               struct {
+                       pid_t _pid;             /* sender's pid */
+                       __ARCH_SI_UID_T _uid;   /* sender's uid */
+                       sigval_t _sigval;
+               } _rt;
+
+               /* SIGCHLD */
+               struct {
+                       pid_t _pid;             /* which child */
+                       __ARCH_SI_UID_T _uid;   /* sender's uid */
+                       int _status;            /* exit code */
+                       clock_t _utime;
+                       clock_t _stime;
+               } _sigchld;
+
+               /* IRIX SIGCHLD */
+               struct {
+                       pid_t _pid;             /* which child */
+                       clock_t _utime;
+                       int _status;            /* exit code */
+                       clock_t _stime;
+               } _irix_sigchld;
+
+               /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+               struct {
+                       void __user *_addr; /* faulting insn/memory ref. */
+#ifdef __ARCH_SI_TRAPNO
+                       int _trapno;    /* TRAP # which caused the signal */
+#endif
+                       short _addr_lsb;
+               } _sigfault;
+
+               /* SIGPOLL, SIGXFSZ (To do ...)  */
+               struct {
+                       __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+                       int _fd;
+               } _sigpoll;
+       } _sifields;
+} siginfo_t;
+
+/*
+ * si_code values
+ * Again these have been chosen to be IRIX compatible.
+ */
+#undef SI_ASYNCIO
+#undef SI_TIMER
+#undef SI_MESGQ
+#define SI_ASYNCIO     -2      /* sent by AIO completion */
+#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
+#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
+
+
+#endif /* _UAPI_ASM_SIGINFO_H */
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..3f1237c
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_SIGNAL_H
+#define _UAPI_ASM_SIGNAL_H
+
+#include <linux/types.h>
+
+#define _NSIG          128
+#define _NSIG_BPW      (sizeof(unsigned long) * 8)
+#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
+
+typedef struct {
+       unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+typedef unsigned long old_sigset_t;            /* at least 32 bits */
+
+#define SIGHUP          1      /* Hangup (POSIX).  */
+#define SIGINT          2      /* Interrupt (ANSI).  */
+#define SIGQUIT                 3      /* Quit (POSIX).  */
+#define SIGILL          4      /* Illegal instruction (ANSI).  */
+#define SIGTRAP                 5      /* Trace trap (POSIX).  */
+#define SIGIOT          6      /* IOT trap (4.2 BSD).  */
+#define SIGABRT                 SIGIOT /* Abort (ANSI).  */
+#define SIGEMT          7
+#define SIGFPE          8      /* Floating-point exception (ANSI).  */
+#define SIGKILL                 9      /* Kill, unblockable (POSIX).  */
+#define SIGBUS         10      /* BUS error (4.2 BSD).  */
+#define SIGSEGV                11      /* Segmentation violation (ANSI).  */
+#define SIGSYS         12
+#define SIGPIPE                13      /* Broken pipe (POSIX).  */
+#define SIGALRM                14      /* Alarm clock (POSIX).  */
+#define SIGTERM                15      /* Termination (ANSI).  */
+#define SIGUSR1                16      /* User-defined signal 1 (POSIX).  */
+#define SIGUSR2                17      /* User-defined signal 2 (POSIX).  */
+#define SIGCHLD                18      /* Child status has changed (POSIX).  */
+#define SIGCLD         SIGCHLD /* Same as SIGCHLD (System V).  */
+#define SIGPWR         19      /* Power failure restart (System V).  */
+#define SIGWINCH       20      /* Window size change (4.3 BSD, Sun).  */
+#define SIGURG         21      /* Urgent condition on socket (4.2 BSD).  */
+#define SIGIO          22      /* I/O now possible (4.2 BSD).  */
+#define SIGPOLL                SIGIO   /* Pollable event occurred (System V).  */
+#define SIGSTOP                23      /* Stop, unblockable (POSIX).  */
+#define SIGTSTP                24      /* Keyboard stop (POSIX).  */
+#define SIGCONT                25      /* Continue (POSIX).  */
+#define SIGTTIN                26      /* Background read from tty (POSIX).  */
+#define SIGTTOU                27      /* Background write to tty (POSIX).  */
+#define SIGVTALRM      28      /* Virtual alarm clock (4.2 BSD).  */
+#define SIGPROF                29      /* Profiling alarm clock (4.2 BSD).  */
+#define SIGXCPU                30      /* CPU limit exceeded (4.2 BSD).  */
+#define SIGXFSZ                31      /* File size limit exceeded (4.2 BSD).  */
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       32
+#define SIGRTMAX       _NSIG
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_ONSTACK     0x08000000
+#define SA_RESETHAND   0x80000000
+#define SA_RESTART     0x10000000
+#define SA_SIGINFO     0x00000008
+#define SA_NODEFER     0x40000000
+#define SA_NOCLDWAIT   0x00010000
+#define SA_NOCLDSTOP   0x00000001
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+#define SA_RESTORER    0x04000000      /* Only for o32 */
+
+/*
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+
+#define SIG_BLOCK      1       /* for blocking signals */
+#define SIG_UNBLOCK    2       /* for unblocking signals */
+#define SIG_SETMASK    3       /* for setting the signal mask */
+
+#include <asm-generic/signal-defs.h>
+
+struct sigaction {
+       unsigned int    sa_flags;
+       __sighandler_t  sa_handler;
+       sigset_t        sa_mask;
+};
+
+struct k_sigaction {
+       struct sigaction sa;
+};
+
+/* IRIX compatible stack_t  */
+typedef struct sigaltstack {
+       void __user *ss_sp;
+       size_t ss_size;
+       int ss_flags;
+} stack_t;
+
+
+#endif /* _UAPI_ASM_SIGNAL_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
new file mode 100644 (file)
index 0000000..c5ed595
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_SOCKET_H
+#define _UAPI_ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/*
+ * For setsockopt(2)
+ *
+ * This defines are ABI conformant as far as Linux supports these ...
+ */
+#define SOL_SOCKET     0xffff
+
+#define SO_DEBUG       0x0001  /* Record debugging information.  */
+#define SO_REUSEADDR   0x0004  /* Allow reuse of local addresses.  */
+#define SO_KEEPALIVE   0x0008  /* Keep connections alive and send
+                                  SIGPIPE when they die.  */
+#define SO_DONTROUTE   0x0010  /* Don't do local routing.  */
+#define SO_BROADCAST   0x0020  /* Allow transmission of
+                                  broadcast messages.  */
+#define SO_LINGER      0x0080  /* Block on close of a reliable
+                                  socket to transmit pending data.  */
+#define SO_OOBINLINE 0x0100    /* Receive out-of-band data in-band.  */
+#if 0
+To add: #define SO_REUSEPORT 0x0200    /* Allow local address and port reuse.  */
+#endif
+
+#define SO_TYPE                0x1008  /* Compatible name for SO_STYLE.  */
+#define SO_STYLE       SO_TYPE /* Synonym */
+#define SO_ERROR       0x1007  /* get error status and clear */
+#define SO_SNDBUF      0x1001  /* Send buffer size. */
+#define SO_RCVBUF      0x1002  /* Receive buffer. */
+#define SO_SNDLOWAT    0x1003  /* send low-water mark */
+#define SO_RCVLOWAT    0x1004  /* receive low-water mark */
+#define SO_SNDTIMEO    0x1005  /* send timeout */
+#define SO_RCVTIMEO    0x1006  /* receive timeout */
+#define SO_ACCEPTCONN  0x1009
+#define SO_PROTOCOL    0x1028  /* protocol type */
+#define SO_DOMAIN      0x1029  /* domain/socket family */
+
+/* linux-specific, might as well be the same as on i386 */
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_BSDCOMPAT   14
+
+#define SO_PASSCRED    17
+#define SO_PEERCRED    18
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
+#define SO_SECURITY_ENCRYPTION_NETWORK         24
+
+#define SO_BINDTODEVICE                25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER        26
+#define SO_DETACH_FILTER        27
+
+#define SO_PEERNAME             28
+#define SO_TIMESTAMP           29
+#define SCM_TIMESTAMP          SO_TIMESTAMP
+
+#define SO_PEERSEC             30
+#define SO_SNDBUFFORCE         31
+#define SO_RCVBUFFORCE         33
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+#define SO_MARK                        36
+
+#define SO_TIMESTAMPING                37
+#define SCM_TIMESTAMPING       SO_TIMESTAMPING
+
+#define SO_RXQ_OVFL             40
+
+#define SO_WIFI_STATUS         41
+#define SCM_WIFI_STATUS                SO_WIFI_STATUS
+#define SO_PEEK_OFF            42
+
+/* Instruct lower device to use last 4-bytes of skb data as FCS */
+#define SO_NOFCS               43
+
+
+#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/termios.h b/arch/mips/include/uapi/asm/termios.h
new file mode 100644 (file)
index 0000000..574fbdf
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
+ * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_TERMIOS_H
+#define _UAPI_ASM_TERMIOS_H
+
+#include <linux/errno.h>
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct sgttyb {
+       char    sg_ispeed;
+       char    sg_ospeed;
+       char    sg_erase;
+       char    sg_kill;
+       int     sg_flags;       /* SGI special - int, not short */
+};
+
+struct tchars {
+       char    t_intrc;
+       char    t_quitc;
+       char    t_startc;
+       char    t_stopc;
+       char    t_eofc;
+       char    t_brkc;
+};
+
+struct ltchars {
+        char    t_suspc;        /* stop process signal */
+        char    t_dsuspc;       /* delayed stop process signal */
+        char    t_rprntc;       /* reprint line */
+        char    t_flushc;       /* flush output (toggles) */
+        char    t_werasc;       /* word erase */
+        char    t_lnextc;       /* literal next character */
+};
+
+/* TIOCGSIZE, TIOCSSIZE not defined yet.  Only needed for SunOS source
+   compatibility anyway ... */
+
+struct winsize {
+       unsigned short ws_row;
+       unsigned short ws_col;
+       unsigned short ws_xpixel;
+       unsigned short ws_ypixel;
+};
+
+#define NCC    8
+struct termio {
+       unsigned short c_iflag;         /* input mode flags */
+       unsigned short c_oflag;         /* output mode flags */
+       unsigned short c_cflag;         /* control mode flags */
+       unsigned short c_lflag;         /* local mode flags */
+       char c_line;                    /* line discipline */
+       unsigned char c_cc[NCCS];       /* control characters */
+};
+
+
+/* modem lines */
+#define TIOCM_LE       0x001           /* line enable */
+#define TIOCM_DTR      0x002           /* data terminal ready */
+#define TIOCM_RTS      0x004           /* request to send */
+#define TIOCM_ST       0x010           /* secondary transmit */
+#define TIOCM_SR       0x020           /* secondary receive */
+#define TIOCM_CTS      0x040           /* clear to send */
+#define TIOCM_CAR      0x100           /* carrier detect */
+#define TIOCM_CD       TIOCM_CAR
+#define TIOCM_RNG      0x200           /* ring */
+#define TIOCM_RI       TIOCM_RNG
+#define TIOCM_DSR      0x400           /* data set ready */
+#define TIOCM_OUT1     0x2000
+#define TIOCM_OUT2     0x4000
+#define TIOCM_LOOP     0x8000
+
+
+#endif /* _UAPI_ASM_TERMIOS_H */
diff --git a/arch/mips/include/uapi/asm/types.h b/arch/mips/include/uapi/asm/types.h
new file mode 100644 (file)
index 0000000..7ac9d0b
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
+ * Copyright (C) 2008 Wind River Systems,
+ *   written by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _UAPI_ASM_TYPES_H
+#define _UAPI_ASM_TYPES_H
+
+/*
+ * We don't use int-l64.h for the kernel anymore but still use it for
+ * userspace to avoid code changes.
+ */
+#ifndef __KERNEL__
+# if _MIPS_SZLONG == 64
+#  include <asm-generic/int-l64.h>
+# else
+#  include <asm-generic/int-ll64.h>
+# endif
+#endif
+
+
+#endif /* _UAPI_ASM_TYPES_H */
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..cc98a9d
--- /dev/null
@@ -0,0 +1,1035 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ *
+ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
+ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
+ */
+#ifndef _UAPI_ASM_UNISTD_H
+#define _UAPI_ASM_UNISTD_H
+
+#include <asm/sgidefs.h>
+
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+
+/*
+ * Linux o32 style syscalls are in the range from 4000 to 4999.
+ */
+#define __NR_Linux                     4000
+#define __NR_syscall                   (__NR_Linux +   0)
+#define __NR_exit                      (__NR_Linux +   1)
+#define __NR_fork                      (__NR_Linux +   2)
+#define __NR_read                      (__NR_Linux +   3)
+#define __NR_write                     (__NR_Linux +   4)
+#define __NR_open                      (__NR_Linux +   5)
+#define __NR_close                     (__NR_Linux +   6)
+#define __NR_waitpid                   (__NR_Linux +   7)
+#define __NR_creat                     (__NR_Linux +   8)
+#define __NR_link                      (__NR_Linux +   9)
+#define __NR_unlink                    (__NR_Linux +  10)
+#define __NR_execve                    (__NR_Linux +  11)
+#define __NR_chdir                     (__NR_Linux +  12)
+#define __NR_time                      (__NR_Linux +  13)
+#define __NR_mknod                     (__NR_Linux +  14)
+#define __NR_chmod                     (__NR_Linux +  15)
+#define __NR_lchown                    (__NR_Linux +  16)
+#define __NR_break                     (__NR_Linux +  17)
+#define __NR_unused18                  (__NR_Linux +  18)
+#define __NR_lseek                     (__NR_Linux +  19)
+#define __NR_getpid                    (__NR_Linux +  20)
+#define __NR_mount                     (__NR_Linux +  21)
+#define __NR_umount                    (__NR_Linux +  22)
+#define __NR_setuid                    (__NR_Linux +  23)
+#define __NR_getuid                    (__NR_Linux +  24)
+#define __NR_stime                     (__NR_Linux +  25)
+#define __NR_ptrace                    (__NR_Linux +  26)
+#define __NR_alarm                     (__NR_Linux +  27)
+#define __NR_unused28                  (__NR_Linux +  28)
+#define __NR_pause                     (__NR_Linux +  29)
+#define __NR_utime                     (__NR_Linux +  30)
+#define __NR_stty                      (__NR_Linux +  31)
+#define __NR_gtty                      (__NR_Linux +  32)
+#define __NR_access                    (__NR_Linux +  33)
+#define __NR_nice                      (__NR_Linux +  34)
+#define __NR_ftime                     (__NR_Linux +  35)
+#define __NR_sync                      (__NR_Linux +  36)
+#define __NR_kill                      (__NR_Linux +  37)
+#define __NR_rename                    (__NR_Linux +  38)
+#define __NR_mkdir                     (__NR_Linux +  39)
+#define __NR_rmdir                     (__NR_Linux +  40)
+#define __NR_dup                       (__NR_Linux +  41)
+#define __NR_pipe                      (__NR_Linux +  42)
+#define __NR_times                     (__NR_Linux +  43)
+#define __NR_prof                      (__NR_Linux +  44)
+#define __NR_brk                       (__NR_Linux +  45)
+#define __NR_setgid                    (__NR_Linux +  46)
+#define __NR_getgid                    (__NR_Linux +  47)
+#define __NR_signal                    (__NR_Linux +  48)
+#define __NR_geteuid                   (__NR_Linux +  49)
+#define __NR_getegid                   (__NR_Linux +  50)
+#define __NR_acct                      (__NR_Linux +  51)
+#define __NR_umount2                   (__NR_Linux +  52)
+#define __NR_lock                      (__NR_Linux +  53)
+#define __NR_ioctl                     (__NR_Linux +  54)
+#define __NR_fcntl                     (__NR_Linux +  55)
+#define __NR_mpx                       (__NR_Linux +  56)
+#define __NR_setpgid                   (__NR_Linux +  57)
+#define __NR_ulimit                    (__NR_Linux +  58)
+#define __NR_unused59                  (__NR_Linux +  59)
+#define __NR_umask                     (__NR_Linux +  60)
+#define __NR_chroot                    (__NR_Linux +  61)
+#define __NR_ustat                     (__NR_Linux +  62)
+#define __NR_dup2                      (__NR_Linux +  63)
+#define __NR_getppid                   (__NR_Linux +  64)
+#define __NR_getpgrp                   (__NR_Linux +  65)
+#define __NR_setsid                    (__NR_Linux +  66)
+#define __NR_sigaction                 (__NR_Linux +  67)
+#define __NR_sgetmask                  (__NR_Linux +  68)
+#define __NR_ssetmask                  (__NR_Linux +  69)
+#define __NR_setreuid                  (__NR_Linux +  70)
+#define __NR_setregid                  (__NR_Linux +  71)
+#define __NR_sigsuspend                        (__NR_Linux +  72)
+#define __NR_sigpending                        (__NR_Linux +  73)
+#define __NR_sethostname               (__NR_Linux +  74)
+#define __NR_setrlimit                 (__NR_Linux +  75)
+#define __NR_getrlimit                 (__NR_Linux +  76)
+#define __NR_getrusage                 (__NR_Linux +  77)
+#define __NR_gettimeofday              (__NR_Linux +  78)
+#define __NR_settimeofday              (__NR_Linux +  79)
+#define __NR_getgroups                 (__NR_Linux +  80)
+#define __NR_setgroups                 (__NR_Linux +  81)
+#define __NR_reserved82                        (__NR_Linux +  82)
+#define __NR_symlink                   (__NR_Linux +  83)
+#define __NR_unused84                  (__NR_Linux +  84)
+#define __NR_readlink                  (__NR_Linux +  85)
+#define __NR_uselib                    (__NR_Linux +  86)
+#define __NR_swapon                    (__NR_Linux +  87)
+#define __NR_reboot                    (__NR_Linux +  88)
+#define __NR_readdir                   (__NR_Linux +  89)
+#define __NR_mmap                      (__NR_Linux +  90)
+#define __NR_munmap                    (__NR_Linux +  91)
+#define __NR_truncate                  (__NR_Linux +  92)
+#define __NR_ftruncate                 (__NR_Linux +  93)
+#define __NR_fchmod                    (__NR_Linux +  94)
+#define __NR_fchown                    (__NR_Linux +  95)
+#define __NR_getpriority               (__NR_Linux +  96)
+#define __NR_setpriority               (__NR_Linux +  97)
+#define __NR_profil                    (__NR_Linux +  98)
+#define __NR_statfs                    (__NR_Linux +  99)
+#define __NR_fstatfs                   (__NR_Linux + 100)
+#define __NR_ioperm                    (__NR_Linux + 101)
+#define __NR_socketcall                        (__NR_Linux + 102)
+#define __NR_syslog                    (__NR_Linux + 103)
+#define __NR_setitimer                 (__NR_Linux + 104)
+#define __NR_getitimer                 (__NR_Linux + 105)
+#define __NR_stat                      (__NR_Linux + 106)
+#define __NR_lstat                     (__NR_Linux + 107)
+#define __NR_fstat                     (__NR_Linux + 108)
+#define __NR_unused109                 (__NR_Linux + 109)
+#define __NR_iopl                      (__NR_Linux + 110)
+#define __NR_vhangup                   (__NR_Linux + 111)
+#define __NR_idle                      (__NR_Linux + 112)
+#define __NR_vm86                      (__NR_Linux + 113)
+#define __NR_wait4                     (__NR_Linux + 114)
+#define __NR_swapoff                   (__NR_Linux + 115)
+#define __NR_sysinfo                   (__NR_Linux + 116)
+#define __NR_ipc                       (__NR_Linux + 117)
+#define __NR_fsync                     (__NR_Linux + 118)
+#define __NR_sigreturn                 (__NR_Linux + 119)
+#define __NR_clone                     (__NR_Linux + 120)
+#define __NR_setdomainname             (__NR_Linux + 121)
+#define __NR_uname                     (__NR_Linux + 122)
+#define __NR_modify_ldt                        (__NR_Linux + 123)
+#define __NR_adjtimex                  (__NR_Linux + 124)
+#define __NR_mprotect                  (__NR_Linux + 125)
+#define __NR_sigprocmask               (__NR_Linux + 126)
+#define __NR_create_module             (__NR_Linux + 127)
+#define __NR_init_module               (__NR_Linux + 128)
+#define __NR_delete_module             (__NR_Linux + 129)
+#define __NR_get_kernel_syms           (__NR_Linux + 130)
+#define __NR_quotactl                  (__NR_Linux + 131)
+#define __NR_getpgid                   (__NR_Linux + 132)
+#define __NR_fchdir                    (__NR_Linux + 133)
+#define __NR_bdflush                   (__NR_Linux + 134)
+#define __NR_sysfs                     (__NR_Linux + 135)
+#define __NR_personality               (__NR_Linux + 136)
+#define __NR_afs_syscall               (__NR_Linux + 137) /* Syscall for Andrew File System */
+#define __NR_setfsuid                  (__NR_Linux + 138)
+#define __NR_setfsgid                  (__NR_Linux + 139)
+#define __NR__llseek                   (__NR_Linux + 140)
+#define __NR_getdents                  (__NR_Linux + 141)
+#define __NR__newselect                        (__NR_Linux + 142)
+#define __NR_flock                     (__NR_Linux + 143)
+#define __NR_msync                     (__NR_Linux + 144)
+#define __NR_readv                     (__NR_Linux + 145)
+#define __NR_writev                    (__NR_Linux + 146)
+#define __NR_cacheflush                        (__NR_Linux + 147)
+#define __NR_cachectl                  (__NR_Linux + 148)
+#define __NR_sysmips                   (__NR_Linux + 149)
+#define __NR_unused150                 (__NR_Linux + 150)
+#define __NR_getsid                    (__NR_Linux + 151)
+#define __NR_fdatasync                 (__NR_Linux + 152)
+#define __NR__sysctl                   (__NR_Linux + 153)
+#define __NR_mlock                     (__NR_Linux + 154)
+#define __NR_munlock                   (__NR_Linux + 155)
+#define __NR_mlockall                  (__NR_Linux + 156)
+#define __NR_munlockall                        (__NR_Linux + 157)
+#define __NR_sched_setparam            (__NR_Linux + 158)
+#define __NR_sched_getparam            (__NR_Linux + 159)
+#define __NR_sched_setscheduler                (__NR_Linux + 160)
+#define __NR_sched_getscheduler                (__NR_Linux + 161)
+#define __NR_sched_yield               (__NR_Linux + 162)
+#define __NR_sched_get_priority_max    (__NR_Linux + 163)
+#define __NR_sched_get_priority_min    (__NR_Linux + 164)
+#define __NR_sched_rr_get_interval     (__NR_Linux + 165)
+#define __NR_nanosleep                 (__NR_Linux + 166)
+#define __NR_mremap                    (__NR_Linux + 167)
+#define __NR_accept                    (__NR_Linux + 168)
+#define __NR_bind                      (__NR_Linux + 169)
+#define __NR_connect                   (__NR_Linux + 170)
+#define __NR_getpeername               (__NR_Linux + 171)
+#define __NR_getsockname               (__NR_Linux + 172)
+#define __NR_getsockopt                        (__NR_Linux + 173)
+#define __NR_listen                    (__NR_Linux + 174)
+#define __NR_recv                      (__NR_Linux + 175)
+#define __NR_recvfrom                  (__NR_Linux + 176)
+#define __NR_recvmsg                   (__NR_Linux + 177)
+#define __NR_send                      (__NR_Linux + 178)
+#define __NR_sendmsg                   (__NR_Linux + 179)
+#define __NR_sendto                    (__NR_Linux + 180)
+#define __NR_setsockopt                        (__NR_Linux + 181)
+#define __NR_shutdown                  (__NR_Linux + 182)
+#define __NR_socket                    (__NR_Linux + 183)
+#define __NR_socketpair                        (__NR_Linux + 184)
+#define __NR_setresuid                 (__NR_Linux + 185)
+#define __NR_getresuid                 (__NR_Linux + 186)
+#define __NR_query_module              (__NR_Linux + 187)
+#define __NR_poll                      (__NR_Linux + 188)
+#define __NR_nfsservctl                        (__NR_Linux + 189)
+#define __NR_setresgid                 (__NR_Linux + 190)
+#define __NR_getresgid                 (__NR_Linux + 191)
+#define __NR_prctl                     (__NR_Linux + 192)
+#define __NR_rt_sigreturn              (__NR_Linux + 193)
+#define __NR_rt_sigaction              (__NR_Linux + 194)
+#define __NR_rt_sigprocmask            (__NR_Linux + 195)
+#define __NR_rt_sigpending             (__NR_Linux + 196)
+#define __NR_rt_sigtimedwait           (__NR_Linux + 197)
+#define __NR_rt_sigqueueinfo           (__NR_Linux + 198)
+#define __NR_rt_sigsuspend             (__NR_Linux + 199)
+#define __NR_pread64                   (__NR_Linux + 200)
+#define __NR_pwrite64                  (__NR_Linux + 201)
+#define __NR_chown                     (__NR_Linux + 202)
+#define __NR_getcwd                    (__NR_Linux + 203)
+#define __NR_capget                    (__NR_Linux + 204)
+#define __NR_capset                    (__NR_Linux + 205)
+#define __NR_sigaltstack               (__NR_Linux + 206)
+#define __NR_sendfile                  (__NR_Linux + 207)
+#define __NR_getpmsg                   (__NR_Linux + 208)
+#define __NR_putpmsg                   (__NR_Linux + 209)
+#define __NR_mmap2                     (__NR_Linux + 210)
+#define __NR_truncate64                        (__NR_Linux + 211)
+#define __NR_ftruncate64               (__NR_Linux + 212)
+#define __NR_stat64                    (__NR_Linux + 213)
+#define __NR_lstat64                   (__NR_Linux + 214)
+#define __NR_fstat64                   (__NR_Linux + 215)
+#define __NR_pivot_root                        (__NR_Linux + 216)
+#define __NR_mincore                   (__NR_Linux + 217)
+#define __NR_madvise                   (__NR_Linux + 218)
+#define __NR_getdents64                        (__NR_Linux + 219)
+#define __NR_fcntl64                   (__NR_Linux + 220)
+#define __NR_reserved221               (__NR_Linux + 221)
+#define __NR_gettid                    (__NR_Linux + 222)
+#define __NR_readahead                 (__NR_Linux + 223)
+#define __NR_setxattr                  (__NR_Linux + 224)
+#define __NR_lsetxattr                 (__NR_Linux + 225)
+#define __NR_fsetxattr                 (__NR_Linux + 226)
+#define __NR_getxattr                  (__NR_Linux + 227)
+#define __NR_lgetxattr                 (__NR_Linux + 228)
+#define __NR_fgetxattr                 (__NR_Linux + 229)
+#define __NR_listxattr                 (__NR_Linux + 230)
+#define __NR_llistxattr                        (__NR_Linux + 231)
+#define __NR_flistxattr                        (__NR_Linux + 232)
+#define __NR_removexattr               (__NR_Linux + 233)
+#define __NR_lremovexattr              (__NR_Linux + 234)
+#define __NR_fremovexattr              (__NR_Linux + 235)
+#define __NR_tkill                     (__NR_Linux + 236)
+#define __NR_sendfile64                        (__NR_Linux + 237)
+#define __NR_futex                     (__NR_Linux + 238)
+#define __NR_sched_setaffinity         (__NR_Linux + 239)
+#define __NR_sched_getaffinity         (__NR_Linux + 240)
+#define __NR_io_setup                  (__NR_Linux + 241)
+#define __NR_io_destroy                        (__NR_Linux + 242)
+#define __NR_io_getevents              (__NR_Linux + 243)
+#define __NR_io_submit                 (__NR_Linux + 244)
+#define __NR_io_cancel                 (__NR_Linux + 245)
+#define __NR_exit_group                        (__NR_Linux + 246)
+#define __NR_lookup_dcookie            (__NR_Linux + 247)
+#define __NR_epoll_create              (__NR_Linux + 248)
+#define __NR_epoll_ctl                 (__NR_Linux + 249)
+#define __NR_epoll_wait                        (__NR_Linux + 250)
+#define __NR_remap_file_pages          (__NR_Linux + 251)
+#define __NR_set_tid_address           (__NR_Linux + 252)
+#define __NR_restart_syscall           (__NR_Linux + 253)
+#define __NR_fadvise64                 (__NR_Linux + 254)
+#define __NR_statfs64                  (__NR_Linux + 255)
+#define __NR_fstatfs64                 (__NR_Linux + 256)
+#define __NR_timer_create              (__NR_Linux + 257)
+#define __NR_timer_settime             (__NR_Linux + 258)
+#define __NR_timer_gettime             (__NR_Linux + 259)
+#define __NR_timer_getoverrun          (__NR_Linux + 260)
+#define __NR_timer_delete              (__NR_Linux + 261)
+#define __NR_clock_settime             (__NR_Linux + 262)
+#define __NR_clock_gettime             (__NR_Linux + 263)
+#define __NR_clock_getres              (__NR_Linux + 264)
+#define __NR_clock_nanosleep           (__NR_Linux + 265)
+#define __NR_tgkill                    (__NR_Linux + 266)
+#define __NR_utimes                    (__NR_Linux + 267)
+#define __NR_mbind                     (__NR_Linux + 268)
+#define __NR_get_mempolicy             (__NR_Linux + 269)
+#define __NR_set_mempolicy             (__NR_Linux + 270)
+#define __NR_mq_open                   (__NR_Linux + 271)
+#define __NR_mq_unlink                 (__NR_Linux + 272)
+#define __NR_mq_timedsend              (__NR_Linux + 273)
+#define __NR_mq_timedreceive           (__NR_Linux + 274)
+#define __NR_mq_notify                 (__NR_Linux + 275)
+#define __NR_mq_getsetattr             (__NR_Linux + 276)
+#define __NR_vserver                   (__NR_Linux + 277)
+#define __NR_waitid                    (__NR_Linux + 278)
+/* #define __NR_sys_setaltroot         (__NR_Linux + 279) */
+#define __NR_add_key                   (__NR_Linux + 280)
+#define __NR_request_key               (__NR_Linux + 281)
+#define __NR_keyctl                    (__NR_Linux + 282)
+#define __NR_set_thread_area           (__NR_Linux + 283)
+#define __NR_inotify_init              (__NR_Linux + 284)
+#define __NR_inotify_add_watch         (__NR_Linux + 285)
+#define __NR_inotify_rm_watch          (__NR_Linux + 286)
+#define __NR_migrate_pages             (__NR_Linux + 287)
+#define __NR_openat                    (__NR_Linux + 288)
+#define __NR_mkdirat                   (__NR_Linux + 289)
+#define __NR_mknodat                   (__NR_Linux + 290)
+#define __NR_fchownat                  (__NR_Linux + 291)
+#define __NR_futimesat                 (__NR_Linux + 292)
+#define __NR_fstatat64                 (__NR_Linux + 293)
+#define __NR_unlinkat                  (__NR_Linux + 294)
+#define __NR_renameat                  (__NR_Linux + 295)
+#define __NR_linkat                    (__NR_Linux + 296)
+#define __NR_symlinkat                 (__NR_Linux + 297)
+#define __NR_readlinkat                        (__NR_Linux + 298)
+#define __NR_fchmodat                  (__NR_Linux + 299)
+#define __NR_faccessat                 (__NR_Linux + 300)
+#define __NR_pselect6                  (__NR_Linux + 301)
+#define __NR_ppoll                     (__NR_Linux + 302)
+#define __NR_unshare                   (__NR_Linux + 303)
+#define __NR_splice                    (__NR_Linux + 304)
+#define __NR_sync_file_range           (__NR_Linux + 305)
+#define __NR_tee                       (__NR_Linux + 306)
+#define __NR_vmsplice                  (__NR_Linux + 307)
+#define __NR_move_pages                        (__NR_Linux + 308)
+#define __NR_set_robust_list           (__NR_Linux + 309)
+#define __NR_get_robust_list           (__NR_Linux + 310)
+#define __NR_kexec_load                        (__NR_Linux + 311)
+#define __NR_getcpu                    (__NR_Linux + 312)
+#define __NR_epoll_pwait               (__NR_Linux + 313)
+#define __NR_ioprio_set                        (__NR_Linux + 314)
+#define __NR_ioprio_get                        (__NR_Linux + 315)
+#define __NR_utimensat                 (__NR_Linux + 316)
+#define __NR_signalfd                  (__NR_Linux + 317)
+#define __NR_timerfd                   (__NR_Linux + 318)
+#define __NR_eventfd                   (__NR_Linux + 319)
+#define __NR_fallocate                 (__NR_Linux + 320)
+#define __NR_timerfd_create            (__NR_Linux + 321)
+#define __NR_timerfd_gettime           (__NR_Linux + 322)
+#define __NR_timerfd_settime           (__NR_Linux + 323)
+#define __NR_signalfd4                 (__NR_Linux + 324)
+#define __NR_eventfd2                  (__NR_Linux + 325)
+#define __NR_epoll_create1             (__NR_Linux + 326)
+#define __NR_dup3                      (__NR_Linux + 327)
+#define __NR_pipe2                     (__NR_Linux + 328)
+#define __NR_inotify_init1             (__NR_Linux + 329)
+#define __NR_preadv                    (__NR_Linux + 330)
+#define __NR_pwritev                   (__NR_Linux + 331)
+#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 332)
+#define __NR_perf_event_open           (__NR_Linux + 333)
+#define __NR_accept4                   (__NR_Linux + 334)
+#define __NR_recvmmsg                  (__NR_Linux + 335)
+#define __NR_fanotify_init             (__NR_Linux + 336)
+#define __NR_fanotify_mark             (__NR_Linux + 337)
+#define __NR_prlimit64                 (__NR_Linux + 338)
+#define __NR_name_to_handle_at         (__NR_Linux + 339)
+#define __NR_open_by_handle_at         (__NR_Linux + 340)
+#define __NR_clock_adjtime             (__NR_Linux + 341)
+#define __NR_syncfs                    (__NR_Linux + 342)
+#define __NR_sendmmsg                  (__NR_Linux + 343)
+#define __NR_setns                     (__NR_Linux + 344)
+#define __NR_process_vm_readv          (__NR_Linux + 345)
+#define __NR_process_vm_writev         (__NR_Linux + 346)
+#define __NR_kcmp                      (__NR_Linux + 347)
+
+/*
+ * Offset of the last Linux o32 flavoured syscall
+ */
+#define __NR_Linux_syscalls            347
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#define __NR_O32_Linux                 4000
+#define __NR_O32_Linux_syscalls                347
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64
+
+/*
+ * Linux 64-bit syscalls are in the range from 5000 to 5999.
+ */
+#define __NR_Linux                     5000
+#define __NR_read                      (__NR_Linux +   0)
+#define __NR_write                     (__NR_Linux +   1)
+#define __NR_open                      (__NR_Linux +   2)
+#define __NR_close                     (__NR_Linux +   3)
+#define __NR_stat                      (__NR_Linux +   4)
+#define __NR_fstat                     (__NR_Linux +   5)
+#define __NR_lstat                     (__NR_Linux +   6)
+#define __NR_poll                      (__NR_Linux +   7)
+#define __NR_lseek                     (__NR_Linux +   8)
+#define __NR_mmap                      (__NR_Linux +   9)
+#define __NR_mprotect                  (__NR_Linux +  10)
+#define __NR_munmap                    (__NR_Linux +  11)
+#define __NR_brk                       (__NR_Linux +  12)
+#define __NR_rt_sigaction              (__NR_Linux +  13)
+#define __NR_rt_sigprocmask            (__NR_Linux +  14)
+#define __NR_ioctl                     (__NR_Linux +  15)
+#define __NR_pread64                   (__NR_Linux +  16)
+#define __NR_pwrite64                  (__NR_Linux +  17)
+#define __NR_readv                     (__NR_Linux +  18)
+#define __NR_writev                    (__NR_Linux +  19)
+#define __NR_access                    (__NR_Linux +  20)
+#define __NR_pipe                      (__NR_Linux +  21)
+#define __NR__newselect                        (__NR_Linux +  22)
+#define __NR_sched_yield               (__NR_Linux +  23)
+#define __NR_mremap                    (__NR_Linux +  24)
+#define __NR_msync                     (__NR_Linux +  25)
+#define __NR_mincore                   (__NR_Linux +  26)
+#define __NR_madvise                   (__NR_Linux +  27)
+#define __NR_shmget                    (__NR_Linux +  28)
+#define __NR_shmat                     (__NR_Linux +  29)
+#define __NR_shmctl                    (__NR_Linux +  30)
+#define __NR_dup                       (__NR_Linux +  31)
+#define __NR_dup2                      (__NR_Linux +  32)
+#define __NR_pause                     (__NR_Linux +  33)
+#define __NR_nanosleep                 (__NR_Linux +  34)
+#define __NR_getitimer                 (__NR_Linux +  35)
+#define __NR_setitimer                 (__NR_Linux +  36)
+#define __NR_alarm                     (__NR_Linux +  37)
+#define __NR_getpid                    (__NR_Linux +  38)
+#define __NR_sendfile                  (__NR_Linux +  39)
+#define __NR_socket                    (__NR_Linux +  40)
+#define __NR_connect                   (__NR_Linux +  41)
+#define __NR_accept                    (__NR_Linux +  42)
+#define __NR_sendto                    (__NR_Linux +  43)
+#define __NR_recvfrom                  (__NR_Linux +  44)
+#define __NR_sendmsg                   (__NR_Linux +  45)
+#define __NR_recvmsg                   (__NR_Linux +  46)
+#define __NR_shutdown                  (__NR_Linux +  47)
+#define __NR_bind                      (__NR_Linux +  48)
+#define __NR_listen                    (__NR_Linux +  49)
+#define __NR_getsockname               (__NR_Linux +  50)
+#define __NR_getpeername               (__NR_Linux +  51)
+#define __NR_socketpair                        (__NR_Linux +  52)
+#define __NR_setsockopt                        (__NR_Linux +  53)
+#define __NR_getsockopt                        (__NR_Linux +  54)
+#define __NR_clone                     (__NR_Linux +  55)
+#define __NR_fork                      (__NR_Linux +  56)
+#define __NR_execve                    (__NR_Linux +  57)
+#define __NR_exit                      (__NR_Linux +  58)
+#define __NR_wait4                     (__NR_Linux +  59)
+#define __NR_kill                      (__NR_Linux +  60)
+#define __NR_uname                     (__NR_Linux +  61)
+#define __NR_semget                    (__NR_Linux +  62)
+#define __NR_semop                     (__NR_Linux +  63)
+#define __NR_semctl                    (__NR_Linux +  64)
+#define __NR_shmdt                     (__NR_Linux +  65)
+#define __NR_msgget                    (__NR_Linux +  66)
+#define __NR_msgsnd                    (__NR_Linux +  67)
+#define __NR_msgrcv                    (__NR_Linux +  68)
+#define __NR_msgctl                    (__NR_Linux +  69)
+#define __NR_fcntl                     (__NR_Linux +  70)
+#define __NR_flock                     (__NR_Linux +  71)
+#define __NR_fsync                     (__NR_Linux +  72)
+#define __NR_fdatasync                 (__NR_Linux +  73)
+#define __NR_truncate                  (__NR_Linux +  74)
+#define __NR_ftruncate                 (__NR_Linux +  75)
+#define __NR_getdents                  (__NR_Linux +  76)
+#define __NR_getcwd                    (__NR_Linux +  77)
+#define __NR_chdir                     (__NR_Linux +  78)
+#define __NR_fchdir                    (__NR_Linux +  79)
+#define __NR_rename                    (__NR_Linux +  80)
+#define __NR_mkdir                     (__NR_Linux +  81)
+#define __NR_rmdir                     (__NR_Linux +  82)
+#define __NR_creat                     (__NR_Linux +  83)
+#define __NR_link                      (__NR_Linux +  84)
+#define __NR_unlink                    (__NR_Linux +  85)
+#define __NR_symlink                   (__NR_Linux +  86)
+#define __NR_readlink                  (__NR_Linux +  87)
+#define __NR_chmod                     (__NR_Linux +  88)
+#define __NR_fchmod                    (__NR_Linux +  89)
+#define __NR_chown                     (__NR_Linux +  90)
+#define __NR_fchown                    (__NR_Linux +  91)
+#define __NR_lchown                    (__NR_Linux +  92)
+#define __NR_umask                     (__NR_Linux +  93)
+#define __NR_gettimeofday              (__NR_Linux +  94)
+#define __NR_getrlimit                 (__NR_Linux +  95)
+#define __NR_getrusage                 (__NR_Linux +  96)
+#define __NR_sysinfo                   (__NR_Linux +  97)
+#define __NR_times                     (__NR_Linux +  98)
+#define __NR_ptrace                    (__NR_Linux +  99)
+#define __NR_getuid                    (__NR_Linux + 100)
+#define __NR_syslog                    (__NR_Linux + 101)
+#define __NR_getgid                    (__NR_Linux + 102)
+#define __NR_setuid                    (__NR_Linux + 103)
+#define __NR_setgid                    (__NR_Linux + 104)
+#define __NR_geteuid                   (__NR_Linux + 105)
+#define __NR_getegid                   (__NR_Linux + 106)
+#define __NR_setpgid                   (__NR_Linux + 107)
+#define __NR_getppid                   (__NR_Linux + 108)
+#define __NR_getpgrp                   (__NR_Linux + 109)
+#define __NR_setsid                    (__NR_Linux + 110)
+#define __NR_setreuid                  (__NR_Linux + 111)
+#define __NR_setregid                  (__NR_Linux + 112)
+#define __NR_getgroups                 (__NR_Linux + 113)
+#define __NR_setgroups                 (__NR_Linux + 114)
+#define __NR_setresuid                 (__NR_Linux + 115)
+#define __NR_getresuid                 (__NR_Linux + 116)
+#define __NR_setresgid                 (__NR_Linux + 117)
+#define __NR_getresgid                 (__NR_Linux + 118)
+#define __NR_getpgid                   (__NR_Linux + 119)
+#define __NR_setfsuid                  (__NR_Linux + 120)
+#define __NR_setfsgid                  (__NR_Linux + 121)
+#define __NR_getsid                    (__NR_Linux + 122)
+#define __NR_capget                    (__NR_Linux + 123)
+#define __NR_capset                    (__NR_Linux + 124)
+#define __NR_rt_sigpending             (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait           (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo           (__NR_Linux + 127)
+#define __NR_rt_sigsuspend             (__NR_Linux + 128)
+#define __NR_sigaltstack               (__NR_Linux + 129)
+#define __NR_utime                     (__NR_Linux + 130)
+#define __NR_mknod                     (__NR_Linux + 131)
+#define __NR_personality               (__NR_Linux + 132)
+#define __NR_ustat                     (__NR_Linux + 133)
+#define __NR_statfs                    (__NR_Linux + 134)
+#define __NR_fstatfs                   (__NR_Linux + 135)
+#define __NR_sysfs                     (__NR_Linux + 136)
+#define __NR_getpriority               (__NR_Linux + 137)
+#define __NR_setpriority               (__NR_Linux + 138)
+#define __NR_sched_setparam            (__NR_Linux + 139)
+#define __NR_sched_getparam            (__NR_Linux + 140)
+#define __NR_sched_setscheduler                (__NR_Linux + 141)
+#define __NR_sched_getscheduler                (__NR_Linux + 142)
+#define __NR_sched_get_priority_max    (__NR_Linux + 143)
+#define __NR_sched_get_priority_min    (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval     (__NR_Linux + 145)
+#define __NR_mlock                     (__NR_Linux + 146)
+#define __NR_munlock                   (__NR_Linux + 147)
+#define __NR_mlockall                  (__NR_Linux + 148)
+#define __NR_munlockall                        (__NR_Linux + 149)
+#define __NR_vhangup                   (__NR_Linux + 150)
+#define __NR_pivot_root                        (__NR_Linux + 151)
+#define __NR__sysctl                   (__NR_Linux + 152)
+#define __NR_prctl                     (__NR_Linux + 153)
+#define __NR_adjtimex                  (__NR_Linux + 154)
+#define __NR_setrlimit                 (__NR_Linux + 155)
+#define __NR_chroot                    (__NR_Linux + 156)
+#define __NR_sync                      (__NR_Linux + 157)
+#define __NR_acct                      (__NR_Linux + 158)
+#define __NR_settimeofday              (__NR_Linux + 159)
+#define __NR_mount                     (__NR_Linux + 160)
+#define __NR_umount2                   (__NR_Linux + 161)
+#define __NR_swapon                    (__NR_Linux + 162)
+#define __NR_swapoff                   (__NR_Linux + 163)
+#define __NR_reboot                    (__NR_Linux + 164)
+#define __NR_sethostname               (__NR_Linux + 165)
+#define __NR_setdomainname             (__NR_Linux + 166)
+#define __NR_create_module             (__NR_Linux + 167)
+#define __NR_init_module               (__NR_Linux + 168)
+#define __NR_delete_module             (__NR_Linux + 169)
+#define __NR_get_kernel_syms           (__NR_Linux + 170)
+#define __NR_query_module              (__NR_Linux + 171)
+#define __NR_quotactl                  (__NR_Linux + 172)
+#define __NR_nfsservctl                        (__NR_Linux + 173)
+#define __NR_getpmsg                   (__NR_Linux + 174)
+#define __NR_putpmsg                   (__NR_Linux + 175)
+#define __NR_afs_syscall               (__NR_Linux + 176)
+#define __NR_reserved177               (__NR_Linux + 177)
+#define __NR_gettid                    (__NR_Linux + 178)
+#define __NR_readahead                 (__NR_Linux + 179)
+#define __NR_setxattr                  (__NR_Linux + 180)
+#define __NR_lsetxattr                 (__NR_Linux + 181)
+#define __NR_fsetxattr                 (__NR_Linux + 182)
+#define __NR_getxattr                  (__NR_Linux + 183)
+#define __NR_lgetxattr                 (__NR_Linux + 184)
+#define __NR_fgetxattr                 (__NR_Linux + 185)
+#define __NR_listxattr                 (__NR_Linux + 186)
+#define __NR_llistxattr                        (__NR_Linux + 187)
+#define __NR_flistxattr                        (__NR_Linux + 188)
+#define __NR_removexattr               (__NR_Linux + 189)
+#define __NR_lremovexattr              (__NR_Linux + 190)
+#define __NR_fremovexattr              (__NR_Linux + 191)
+#define __NR_tkill                     (__NR_Linux + 192)
+#define __NR_reserved193               (__NR_Linux + 193)
+#define __NR_futex                     (__NR_Linux + 194)
+#define __NR_sched_setaffinity         (__NR_Linux + 195)
+#define __NR_sched_getaffinity         (__NR_Linux + 196)
+#define __NR_cacheflush                        (__NR_Linux + 197)
+#define __NR_cachectl                  (__NR_Linux + 198)
+#define __NR_sysmips                   (__NR_Linux + 199)
+#define __NR_io_setup                  (__NR_Linux + 200)
+#define __NR_io_destroy                        (__NR_Linux + 201)
+#define __NR_io_getevents              (__NR_Linux + 202)
+#define __NR_io_submit                 (__NR_Linux + 203)
+#define __NR_io_cancel                 (__NR_Linux + 204)
+#define __NR_exit_group                        (__NR_Linux + 205)
+#define __NR_lookup_dcookie            (__NR_Linux + 206)
+#define __NR_epoll_create              (__NR_Linux + 207)
+#define __NR_epoll_ctl                 (__NR_Linux + 208)
+#define __NR_epoll_wait                        (__NR_Linux + 209)
+#define __NR_remap_file_pages          (__NR_Linux + 210)
+#define __NR_rt_sigreturn              (__NR_Linux + 211)
+#define __NR_set_tid_address           (__NR_Linux + 212)
+#define __NR_restart_syscall           (__NR_Linux + 213)
+#define __NR_semtimedop                        (__NR_Linux + 214)
+#define __NR_fadvise64                 (__NR_Linux + 215)
+#define __NR_timer_create              (__NR_Linux + 216)
+#define __NR_timer_settime             (__NR_Linux + 217)
+#define __NR_timer_gettime             (__NR_Linux + 218)
+#define __NR_timer_getoverrun          (__NR_Linux + 219)
+#define __NR_timer_delete              (__NR_Linux + 220)
+#define __NR_clock_settime             (__NR_Linux + 221)
+#define __NR_clock_gettime             (__NR_Linux + 222)
+#define __NR_clock_getres              (__NR_Linux + 223)
+#define __NR_clock_nanosleep           (__NR_Linux + 224)
+#define __NR_tgkill                    (__NR_Linux + 225)
+#define __NR_utimes                    (__NR_Linux + 226)
+#define __NR_mbind                     (__NR_Linux + 227)
+#define __NR_get_mempolicy             (__NR_Linux + 228)
+#define __NR_set_mempolicy             (__NR_Linux + 229)
+#define __NR_mq_open                   (__NR_Linux + 230)
+#define __NR_mq_unlink                 (__NR_Linux + 231)
+#define __NR_mq_timedsend              (__NR_Linux + 232)
+#define __NR_mq_timedreceive           (__NR_Linux + 233)
+#define __NR_mq_notify                 (__NR_Linux + 234)
+#define __NR_mq_getsetattr             (__NR_Linux + 235)
+#define __NR_vserver                   (__NR_Linux + 236)
+#define __NR_waitid                    (__NR_Linux + 237)
+/* #define __NR_sys_setaltroot         (__NR_Linux + 238) */
+#define __NR_add_key                   (__NR_Linux + 239)
+#define __NR_request_key               (__NR_Linux + 240)
+#define __NR_keyctl                    (__NR_Linux + 241)
+#define __NR_set_thread_area           (__NR_Linux + 242)
+#define __NR_inotify_init              (__NR_Linux + 243)
+#define __NR_inotify_add_watch         (__NR_Linux + 244)
+#define __NR_inotify_rm_watch          (__NR_Linux + 245)
+#define __NR_migrate_pages             (__NR_Linux + 246)
+#define __NR_openat                    (__NR_Linux + 247)
+#define __NR_mkdirat                   (__NR_Linux + 248)
+#define __NR_mknodat                   (__NR_Linux + 249)
+#define __NR_fchownat                  (__NR_Linux + 250)
+#define __NR_futimesat                 (__NR_Linux + 251)
+#define __NR_newfstatat                        (__NR_Linux + 252)
+#define __NR_unlinkat                  (__NR_Linux + 253)
+#define __NR_renameat                  (__NR_Linux + 254)
+#define __NR_linkat                    (__NR_Linux + 255)
+#define __NR_symlinkat                 (__NR_Linux + 256)
+#define __NR_readlinkat                        (__NR_Linux + 257)
+#define __NR_fchmodat                  (__NR_Linux + 258)
+#define __NR_faccessat                 (__NR_Linux + 259)
+#define __NR_pselect6                  (__NR_Linux + 260)
+#define __NR_ppoll                     (__NR_Linux + 261)
+#define __NR_unshare                   (__NR_Linux + 262)
+#define __NR_splice                    (__NR_Linux + 263)
+#define __NR_sync_file_range           (__NR_Linux + 264)
+#define __NR_tee                       (__NR_Linux + 265)
+#define __NR_vmsplice                  (__NR_Linux + 266)
+#define __NR_move_pages                        (__NR_Linux + 267)
+#define __NR_set_robust_list           (__NR_Linux + 268)
+#define __NR_get_robust_list           (__NR_Linux + 269)
+#define __NR_kexec_load                        (__NR_Linux + 270)
+#define __NR_getcpu                    (__NR_Linux + 271)
+#define __NR_epoll_pwait               (__NR_Linux + 272)
+#define __NR_ioprio_set                        (__NR_Linux + 273)
+#define __NR_ioprio_get                        (__NR_Linux + 274)
+#define __NR_utimensat                 (__NR_Linux + 275)
+#define __NR_signalfd                  (__NR_Linux + 276)
+#define __NR_timerfd                   (__NR_Linux + 277)
+#define __NR_eventfd                   (__NR_Linux + 278)
+#define __NR_fallocate                 (__NR_Linux + 279)
+#define __NR_timerfd_create            (__NR_Linux + 280)
+#define __NR_timerfd_gettime           (__NR_Linux + 281)
+#define __NR_timerfd_settime           (__NR_Linux + 282)
+#define __NR_signalfd4                 (__NR_Linux + 283)
+#define __NR_eventfd2                  (__NR_Linux + 284)
+#define __NR_epoll_create1             (__NR_Linux + 285)
+#define __NR_dup3                      (__NR_Linux + 286)
+#define __NR_pipe2                     (__NR_Linux + 287)
+#define __NR_inotify_init1             (__NR_Linux + 288)
+#define __NR_preadv                    (__NR_Linux + 289)
+#define __NR_pwritev                   (__NR_Linux + 290)
+#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 291)
+#define __NR_perf_event_open           (__NR_Linux + 292)
+#define __NR_accept4                   (__NR_Linux + 293)
+#define __NR_recvmmsg                  (__NR_Linux + 294)
+#define __NR_fanotify_init             (__NR_Linux + 295)
+#define __NR_fanotify_mark             (__NR_Linux + 296)
+#define __NR_prlimit64                 (__NR_Linux + 297)
+#define __NR_name_to_handle_at         (__NR_Linux + 298)
+#define __NR_open_by_handle_at         (__NR_Linux + 299)
+#define __NR_clock_adjtime             (__NR_Linux + 300)
+#define __NR_syncfs                    (__NR_Linux + 301)
+#define __NR_sendmmsg                  (__NR_Linux + 302)
+#define __NR_setns                     (__NR_Linux + 303)
+#define __NR_process_vm_readv          (__NR_Linux + 304)
+#define __NR_process_vm_writev         (__NR_Linux + 305)
+#define __NR_kcmp                      (__NR_Linux + 306)
+
+/*
+ * Offset of the last Linux 64-bit flavoured syscall
+ */
+#define __NR_Linux_syscalls            306
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
+
+#define __NR_64_Linux                  5000
+#define __NR_64_Linux_syscalls         306
+
+#if _MIPS_SIM == _MIPS_SIM_NABI32
+
+/*
+ * Linux N32 syscalls are in the range from 6000 to 6999.
+ */
+#define __NR_Linux                     6000
+#define __NR_read                      (__NR_Linux +   0)
+#define __NR_write                     (__NR_Linux +   1)
+#define __NR_open                      (__NR_Linux +   2)
+#define __NR_close                     (__NR_Linux +   3)
+#define __NR_stat                      (__NR_Linux +   4)
+#define __NR_fstat                     (__NR_Linux +   5)
+#define __NR_lstat                     (__NR_Linux +   6)
+#define __NR_poll                      (__NR_Linux +   7)
+#define __NR_lseek                     (__NR_Linux +   8)
+#define __NR_mmap                      (__NR_Linux +   9)
+#define __NR_mprotect                  (__NR_Linux +  10)
+#define __NR_munmap                    (__NR_Linux +  11)
+#define __NR_brk                       (__NR_Linux +  12)
+#define __NR_rt_sigaction              (__NR_Linux +  13)
+#define __NR_rt_sigprocmask            (__NR_Linux +  14)
+#define __NR_ioctl                     (__NR_Linux +  15)
+#define __NR_pread64                   (__NR_Linux +  16)
+#define __NR_pwrite64                  (__NR_Linux +  17)
+#define __NR_readv                     (__NR_Linux +  18)
+#define __NR_writev                    (__NR_Linux +  19)
+#define __NR_access                    (__NR_Linux +  20)
+#define __NR_pipe                      (__NR_Linux +  21)
+#define __NR__newselect                        (__NR_Linux +  22)
+#define __NR_sched_yield               (__NR_Linux +  23)
+#define __NR_mremap                    (__NR_Linux +  24)
+#define __NR_msync                     (__NR_Linux +  25)
+#define __NR_mincore                   (__NR_Linux +  26)
+#define __NR_madvise                   (__NR_Linux +  27)
+#define __NR_shmget                    (__NR_Linux +  28)
+#define __NR_shmat                     (__NR_Linux +  29)
+#define __NR_shmctl                    (__NR_Linux +  30)
+#define __NR_dup                       (__NR_Linux +  31)
+#define __NR_dup2                      (__NR_Linux +  32)
+#define __NR_pause                     (__NR_Linux +  33)
+#define __NR_nanosleep                 (__NR_Linux +  34)
+#define __NR_getitimer                 (__NR_Linux +  35)
+#define __NR_setitimer                 (__NR_Linux +  36)
+#define __NR_alarm                     (__NR_Linux +  37)
+#define __NR_getpid                    (__NR_Linux +  38)
+#define __NR_sendfile                  (__NR_Linux +  39)
+#define __NR_socket                    (__NR_Linux +  40)
+#define __NR_connect                   (__NR_Linux +  41)
+#define __NR_accept                    (__NR_Linux +  42)
+#define __NR_sendto                    (__NR_Linux +  43)
+#define __NR_recvfrom                  (__NR_Linux +  44)
+#define __NR_sendmsg                   (__NR_Linux +  45)
+#define __NR_recvmsg                   (__NR_Linux +  46)
+#define __NR_shutdown                  (__NR_Linux +  47)
+#define __NR_bind                      (__NR_Linux +  48)
+#define __NR_listen                    (__NR_Linux +  49)
+#define __NR_getsockname               (__NR_Linux +  50)
+#define __NR_getpeername               (__NR_Linux +  51)
+#define __NR_socketpair                        (__NR_Linux +  52)
+#define __NR_setsockopt                        (__NR_Linux +  53)
+#define __NR_getsockopt                        (__NR_Linux +  54)
+#define __NR_clone                     (__NR_Linux +  55)
+#define __NR_fork                      (__NR_Linux +  56)
+#define __NR_execve                    (__NR_Linux +  57)
+#define __NR_exit                      (__NR_Linux +  58)
+#define __NR_wait4                     (__NR_Linux +  59)
+#define __NR_kill                      (__NR_Linux +  60)
+#define __NR_uname                     (__NR_Linux +  61)
+#define __NR_semget                    (__NR_Linux +  62)
+#define __NR_semop                     (__NR_Linux +  63)
+#define __NR_semctl                    (__NR_Linux +  64)
+#define __NR_shmdt                     (__NR_Linux +  65)
+#define __NR_msgget                    (__NR_Linux +  66)
+#define __NR_msgsnd                    (__NR_Linux +  67)
+#define __NR_msgrcv                    (__NR_Linux +  68)
+#define __NR_msgctl                    (__NR_Linux +  69)
+#define __NR_fcntl                     (__NR_Linux +  70)
+#define __NR_flock                     (__NR_Linux +  71)
+#define __NR_fsync                     (__NR_Linux +  72)
+#define __NR_fdatasync                 (__NR_Linux +  73)
+#define __NR_truncate                  (__NR_Linux +  74)
+#define __NR_ftruncate                 (__NR_Linux +  75)
+#define __NR_getdents                  (__NR_Linux +  76)
+#define __NR_getcwd                    (__NR_Linux +  77)
+#define __NR_chdir                     (__NR_Linux +  78)
+#define __NR_fchdir                    (__NR_Linux +  79)
+#define __NR_rename                    (__NR_Linux +  80)
+#define __NR_mkdir                     (__NR_Linux +  81)
+#define __NR_rmdir                     (__NR_Linux +  82)
+#define __NR_creat                     (__NR_Linux +  83)
+#define __NR_link                      (__NR_Linux +  84)
+#define __NR_unlink                    (__NR_Linux +  85)
+#define __NR_symlink                   (__NR_Linux +  86)
+#define __NR_readlink                  (__NR_Linux +  87)
+#define __NR_chmod                     (__NR_Linux +  88)
+#define __NR_fchmod                    (__NR_Linux +  89)
+#define __NR_chown                     (__NR_Linux +  90)
+#define __NR_fchown                    (__NR_Linux +  91)
+#define __NR_lchown                    (__NR_Linux +  92)
+#define __NR_umask                     (__NR_Linux +  93)
+#define __NR_gettimeofday              (__NR_Linux +  94)
+#define __NR_getrlimit                 (__NR_Linux +  95)
+#define __NR_getrusage                 (__NR_Linux +  96)
+#define __NR_sysinfo                   (__NR_Linux +  97)
+#define __NR_times                     (__NR_Linux +  98)
+#define __NR_ptrace                    (__NR_Linux +  99)
+#define __NR_getuid                    (__NR_Linux + 100)
+#define __NR_syslog                    (__NR_Linux + 101)
+#define __NR_getgid                    (__NR_Linux + 102)
+#define __NR_setuid                    (__NR_Linux + 103)
+#define __NR_setgid                    (__NR_Linux + 104)
+#define __NR_geteuid                   (__NR_Linux + 105)
+#define __NR_getegid                   (__NR_Linux + 106)
+#define __NR_setpgid                   (__NR_Linux + 107)
+#define __NR_getppid                   (__NR_Linux + 108)
+#define __NR_getpgrp                   (__NR_Linux + 109)
+#define __NR_setsid                    (__NR_Linux + 110)
+#define __NR_setreuid                  (__NR_Linux + 111)
+#define __NR_setregid                  (__NR_Linux + 112)
+#define __NR_getgroups                 (__NR_Linux + 113)
+#define __NR_setgroups                 (__NR_Linux + 114)
+#define __NR_setresuid                 (__NR_Linux + 115)
+#define __NR_getresuid                 (__NR_Linux + 116)
+#define __NR_setresgid                 (__NR_Linux + 117)
+#define __NR_getresgid                 (__NR_Linux + 118)
+#define __NR_getpgid                   (__NR_Linux + 119)
+#define __NR_setfsuid                  (__NR_Linux + 120)
+#define __NR_setfsgid                  (__NR_Linux + 121)
+#define __NR_getsid                    (__NR_Linux + 122)
+#define __NR_capget                    (__NR_Linux + 123)
+#define __NR_capset                    (__NR_Linux + 124)
+#define __NR_rt_sigpending             (__NR_Linux + 125)
+#define __NR_rt_sigtimedwait           (__NR_Linux + 126)
+#define __NR_rt_sigqueueinfo           (__NR_Linux + 127)
+#define __NR_rt_sigsuspend             (__NR_Linux + 128)
+#define __NR_sigaltstack               (__NR_Linux + 129)
+#define __NR_utime                     (__NR_Linux + 130)
+#define __NR_mknod                     (__NR_Linux + 131)
+#define __NR_personality               (__NR_Linux + 132)
+#define __NR_ustat                     (__NR_Linux + 133)
+#define __NR_statfs                    (__NR_Linux + 134)
+#define __NR_fstatfs                   (__NR_Linux + 135)
+#define __NR_sysfs                     (__NR_Linux + 136)
+#define __NR_getpriority               (__NR_Linux + 137)
+#define __NR_setpriority               (__NR_Linux + 138)
+#define __NR_sched_setparam            (__NR_Linux + 139)
+#define __NR_sched_getparam            (__NR_Linux + 140)
+#define __NR_sched_setscheduler                (__NR_Linux + 141)
+#define __NR_sched_getscheduler                (__NR_Linux + 142)
+#define __NR_sched_get_priority_max    (__NR_Linux + 143)
+#define __NR_sched_get_priority_min    (__NR_Linux + 144)
+#define __NR_sched_rr_get_interval     (__NR_Linux + 145)
+#define __NR_mlock                     (__NR_Linux + 146)
+#define __NR_munlock                   (__NR_Linux + 147)
+#define __NR_mlockall                  (__NR_Linux + 148)
+#define __NR_munlockall                        (__NR_Linux + 149)
+#define __NR_vhangup                   (__NR_Linux + 150)
+#define __NR_pivot_root                        (__NR_Linux + 151)
+#define __NR__sysctl                   (__NR_Linux + 152)
+#define __NR_prctl                     (__NR_Linux + 153)
+#define __NR_adjtimex                  (__NR_Linux + 154)
+#define __NR_setrlimit                 (__NR_Linux + 155)
+#define __NR_chroot                    (__NR_Linux + 156)
+#define __NR_sync                      (__NR_Linux + 157)
+#define __NR_acct                      (__NR_Linux + 158)
+#define __NR_settimeofday              (__NR_Linux + 159)
+#define __NR_mount                     (__NR_Linux + 160)
+#define __NR_umount2                   (__NR_Linux + 161)
+#define __NR_swapon                    (__NR_Linux + 162)
+#define __NR_swapoff                   (__NR_Linux + 163)
+#define __NR_reboot                    (__NR_Linux + 164)
+#define __NR_sethostname               (__NR_Linux + 165)
+#define __NR_setdomainname             (__NR_Linux + 166)
+#define __NR_create_module             (__NR_Linux + 167)
+#define __NR_init_module               (__NR_Linux + 168)
+#define __NR_delete_module             (__NR_Linux + 169)
+#define __NR_get_kernel_syms           (__NR_Linux + 170)
+#define __NR_query_module              (__NR_Linux + 171)
+#define __NR_quotactl                  (__NR_Linux + 172)
+#define __NR_nfsservctl                        (__NR_Linux + 173)
+#define __NR_getpmsg                   (__NR_Linux + 174)
+#define __NR_putpmsg                   (__NR_Linux + 175)
+#define __NR_afs_syscall               (__NR_Linux + 176)
+#define __NR_reserved177               (__NR_Linux + 177)
+#define __NR_gettid                    (__NR_Linux + 178)
+#define __NR_readahead                 (__NR_Linux + 179)
+#define __NR_setxattr                  (__NR_Linux + 180)
+#define __NR_lsetxattr                 (__NR_Linux + 181)
+#define __NR_fsetxattr                 (__NR_Linux + 182)
+#define __NR_getxattr                  (__NR_Linux + 183)
+#define __NR_lgetxattr                 (__NR_Linux + 184)
+#define __NR_fgetxattr                 (__NR_Linux + 185)
+#define __NR_listxattr                 (__NR_Linux + 186)
+#define __NR_llistxattr                        (__NR_Linux + 187)
+#define __NR_flistxattr                        (__NR_Linux + 188)
+#define __NR_removexattr               (__NR_Linux + 189)
+#define __NR_lremovexattr              (__NR_Linux + 190)
+#define __NR_fremovexattr              (__NR_Linux + 191)
+#define __NR_tkill                     (__NR_Linux + 192)
+#define __NR_reserved193               (__NR_Linux + 193)
+#define __NR_futex                     (__NR_Linux + 194)
+#define __NR_sched_setaffinity         (__NR_Linux + 195)
+#define __NR_sched_getaffinity         (__NR_Linux + 196)
+#define __NR_cacheflush                        (__NR_Linux + 197)
+#define __NR_cachectl                  (__NR_Linux + 198)
+#define __NR_sysmips                   (__NR_Linux + 199)
+#define __NR_io_setup                  (__NR_Linux + 200)
+#define __NR_io_destroy                        (__NR_Linux + 201)
+#define __NR_io_getevents              (__NR_Linux + 202)
+#define __NR_io_submit                 (__NR_Linux + 203)
+#define __NR_io_cancel                 (__NR_Linux + 204)
+#define __NR_exit_group                        (__NR_Linux + 205)
+#define __NR_lookup_dcookie            (__NR_Linux + 206)
+#define __NR_epoll_create              (__NR_Linux + 207)
+#define __NR_epoll_ctl                 (__NR_Linux + 208)
+#define __NR_epoll_wait                        (__NR_Linux + 209)
+#define __NR_remap_file_pages          (__NR_Linux + 210)
+#define __NR_rt_sigreturn              (__NR_Linux + 211)
+#define __NR_fcntl64                   (__NR_Linux + 212)
+#define __NR_set_tid_address           (__NR_Linux + 213)
+#define __NR_restart_syscall           (__NR_Linux + 214)
+#define __NR_semtimedop                        (__NR_Linux + 215)
+#define __NR_fadvise64                 (__NR_Linux + 216)
+#define __NR_statfs64                  (__NR_Linux + 217)
+#define __NR_fstatfs64                 (__NR_Linux + 218)
+#define __NR_sendfile64                        (__NR_Linux + 219)
+#define __NR_timer_create              (__NR_Linux + 220)
+#define __NR_timer_settime             (__NR_Linux + 221)
+#define __NR_timer_gettime             (__NR_Linux + 222)
+#define __NR_timer_getoverrun          (__NR_Linux + 223)
+#define __NR_timer_delete              (__NR_Linux + 224)
+#define __NR_clock_settime             (__NR_Linux + 225)
+#define __NR_clock_gettime             (__NR_Linux + 226)
+#define __NR_clock_getres              (__NR_Linux + 227)
+#define __NR_clock_nanosleep           (__NR_Linux + 228)
+#define __NR_tgkill                    (__NR_Linux + 229)
+#define __NR_utimes                    (__NR_Linux + 230)
+#define __NR_mbind                     (__NR_Linux + 231)
+#define __NR_get_mempolicy             (__NR_Linux + 232)
+#define __NR_set_mempolicy             (__NR_Linux + 233)
+#define __NR_mq_open                   (__NR_Linux + 234)
+#define __NR_mq_unlink                 (__NR_Linux + 235)
+#define __NR_mq_timedsend              (__NR_Linux + 236)
+#define __NR_mq_timedreceive           (__NR_Linux + 237)
+#define __NR_mq_notify                 (__NR_Linux + 238)
+#define __NR_mq_getsetattr             (__NR_Linux + 239)
+#define __NR_vserver                   (__NR_Linux + 240)
+#define __NR_waitid                    (__NR_Linux + 241)
+/* #define __NR_sys_setaltroot         (__NR_Linux + 242) */
+#define __NR_add_key                   (__NR_Linux + 243)
+#define __NR_request_key               (__NR_Linux + 244)
+#define __NR_keyctl                    (__NR_Linux + 245)
+#define __NR_set_thread_area           (__NR_Linux + 246)
+#define __NR_inotify_init              (__NR_Linux + 247)
+#define __NR_inotify_add_watch         (__NR_Linux + 248)
+#define __NR_inotify_rm_watch          (__NR_Linux + 249)
+#define __NR_migrate_pages             (__NR_Linux + 250)
+#define __NR_openat                    (__NR_Linux + 251)
+#define __NR_mkdirat                   (__NR_Linux + 252)
+#define __NR_mknodat                   (__NR_Linux + 253)
+#define __NR_fchownat                  (__NR_Linux + 254)
+#define __NR_futimesat                 (__NR_Linux + 255)
+#define __NR_newfstatat                        (__NR_Linux + 256)
+#define __NR_unlinkat                  (__NR_Linux + 257)
+#define __NR_renameat                  (__NR_Linux + 258)
+#define __NR_linkat                    (__NR_Linux + 259)
+#define __NR_symlinkat                 (__NR_Linux + 260)
+#define __NR_readlinkat                        (__NR_Linux + 261)
+#define __NR_fchmodat                  (__NR_Linux + 262)
+#define __NR_faccessat                 (__NR_Linux + 263)
+#define __NR_pselect6                  (__NR_Linux + 264)
+#define __NR_ppoll                     (__NR_Linux + 265)
+#define __NR_unshare                   (__NR_Linux + 266)
+#define __NR_splice                    (__NR_Linux + 267)
+#define __NR_sync_file_range           (__NR_Linux + 268)
+#define __NR_tee                       (__NR_Linux + 269)
+#define __NR_vmsplice                  (__NR_Linux + 270)
+#define __NR_move_pages                        (__NR_Linux + 271)
+#define __NR_set_robust_list           (__NR_Linux + 272)
+#define __NR_get_robust_list           (__NR_Linux + 273)
+#define __NR_kexec_load                        (__NR_Linux + 274)
+#define __NR_getcpu                    (__NR_Linux + 275)
+#define __NR_epoll_pwait               (__NR_Linux + 276)
+#define __NR_ioprio_set                        (__NR_Linux + 277)
+#define __NR_ioprio_get                        (__NR_Linux + 278)
+#define __NR_utimensat                 (__NR_Linux + 279)
+#define __NR_signalfd                  (__NR_Linux + 280)
+#define __NR_timerfd                   (__NR_Linux + 281)
+#define __NR_eventfd                   (__NR_Linux + 282)
+#define __NR_fallocate                 (__NR_Linux + 283)
+#define __NR_timerfd_create            (__NR_Linux + 284)
+#define __NR_timerfd_gettime           (__NR_Linux + 285)
+#define __NR_timerfd_settime           (__NR_Linux + 286)
+#define __NR_signalfd4                 (__NR_Linux + 287)
+#define __NR_eventfd2                  (__NR_Linux + 288)
+#define __NR_epoll_create1             (__NR_Linux + 289)
+#define __NR_dup3                      (__NR_Linux + 290)
+#define __NR_pipe2                     (__NR_Linux + 291)
+#define __NR_inotify_init1             (__NR_Linux + 292)
+#define __NR_preadv                    (__NR_Linux + 293)
+#define __NR_pwritev                   (__NR_Linux + 294)
+#define __NR_rt_tgsigqueueinfo         (__NR_Linux + 295)
+#define __NR_perf_event_open           (__NR_Linux + 296)
+#define __NR_accept4                   (__NR_Linux + 297)
+#define __NR_recvmmsg                  (__NR_Linux + 298)
+#define __NR_getdents64                        (__NR_Linux + 299)
+#define __NR_fanotify_init             (__NR_Linux + 300)
+#define __NR_fanotify_mark             (__NR_Linux + 301)
+#define __NR_prlimit64                 (__NR_Linux + 302)
+#define __NR_name_to_handle_at         (__NR_Linux + 303)
+#define __NR_open_by_handle_at         (__NR_Linux + 304)
+#define __NR_clock_adjtime             (__NR_Linux + 305)
+#define __NR_syncfs                    (__NR_Linux + 306)
+#define __NR_sendmmsg                  (__NR_Linux + 307)
+#define __NR_setns                     (__NR_Linux + 308)
+#define __NR_process_vm_readv          (__NR_Linux + 309)
+#define __NR_process_vm_writev         (__NR_Linux + 310)
+#define __NR_kcmp                      (__NR_Linux + 311)
+
+/*
+ * Offset of the last N32 flavoured syscall
+ */
+#define __NR_Linux_syscalls            311
+
+#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
+
+#define __NR_N32_Linux                 6000
+#define __NR_N32_Linux_syscalls                311
+
+#endif /* _UAPI_ASM_UNISTD_H */
index d6c2a7476bac90c7293996759beb6c2b7d9fb343..8b28bc4e14ea81f409a03c0b33197f20e0924b09 100644 (file)
@@ -31,6 +31,7 @@ obj-$(CONFIG_SYNC_R4K)                += sync-r4k.o
 
 obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 obj-$(CONFIG_MODULES)          += mips_ksyms.o module.o
+obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
 
 obj-$(CONFIG_FUNCTION_TRACER)  += mcount.o ftrace.o
 
@@ -53,7 +54,6 @@ obj-$(CONFIG_CPU_MIPSR2)      += spram.o
 
 obj-$(CONFIG_MIPS_VPE_LOADER)  += vpe.o
 obj-$(CONFIG_MIPS_VPE_APSP_API)        += rtlx.o
-obj-$(CONFIG_MIPS_APSP_KSPD)   += kspd.o
 
 obj-$(CONFIG_I8259)            += i8259.o
 obj-$(CONFIG_IRQ_CPU)          += irq_cpu.o
index 6b30fb2caa67170b01f3d12d1fa67e7dd0696d6c..0c4bce4882a6621d18ff0450b3f464e3722059b6 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/interrupt.h>
 #include <linux/kbuild.h>
 #include <linux/suspend.h>
 #include <asm/ptrace.h>
@@ -292,15 +291,6 @@ void output_signal_defined(void)
        BLANK();
 }
 
-void output_irq_cpustat_t_defines(void)
-{
-       COMMENT("Linux irq_cpustat_t offsets.");
-       DEFINE(IC_SOFTIRQ_PENDING,
-                       offsetof(irq_cpustat_t, __softirq_pending));
-       DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t));
-       BLANK();
-}
-
 #ifdef CONFIG_CPU_CAVIUM_OCTEON
 void output_octeon_cop2_state_defines(void)
 {
index bc58bd10a607aa256340651fc48f330cecdd4af8..b1fb7af3c35058f2e739b4ec41fb28d62d00c2d2 100644 (file)
@@ -142,7 +142,7 @@ int __cpuinitdata mips_dsp_disabled;
 
 static int __init dsp_disable(char *s)
 {
-       cpu_data[0].ases &= ~MIPS_ASE_DSP;
+       cpu_data[0].ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P);
        mips_dsp_disabled = 1;
 
        return 1;
@@ -429,6 +429,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
                c->options |= MIPS_CPU_RIXI;
        if (config3 & MIPS_CONF3_DSP)
                c->ases |= MIPS_ASE_DSP;
+       if (config3 & MIPS_CONF3_DSP2P)
+               c->ases |= MIPS_ASE_DSP2P;
        if (config3 & MIPS_CONF3_VINT)
                c->options |= MIPS_CPU_VINT;
        if (config3 & MIPS_CONF3_VEIC)
@@ -1180,7 +1182,7 @@ __cpuinit void cpu_probe(void)
                c->options &= ~MIPS_CPU_FPU;
 
        if (mips_dsp_disabled)
-               c->ases &= ~MIPS_ASE_DSP;
+               c->ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P);
 
        if (c->options & MIPS_CPU_FPU) {
                c->fpu_id = cpu_get_fpu_id();
@@ -1194,8 +1196,11 @@ __cpuinit void cpu_probe(void)
                }
        }
 
-       if (cpu_has_mips_r2)
+       if (cpu_has_mips_r2) {
                c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
+               /* R2 has Performance Counter Interrupt indicator */
+               c->options |= MIPS_CPU_PCI;
+       }
        else
                c->srsets = 1;
 
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
deleted file mode 100644 (file)
index b77f56b..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (C) 2005 MIPS Technologies, Inc.  All rights reserved.
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/unistd.h>
-#include <linux/file.h>
-#include <linux/fdtable.h>
-#include <linux/fs.h>
-#include <linux/syscalls.h>
-#include <linux/workqueue.h>
-#include <linux/errno.h>
-#include <linux/list.h>
-
-#include <asm/vpe.h>
-#include <asm/rtlx.h>
-#include <asm/kspd.h>
-
-static struct workqueue_struct *workqueue;
-static struct work_struct work;
-
-extern unsigned long cpu_khz;
-
-struct mtsp_syscall {
-       int cmd;
-       unsigned char abi;
-       unsigned char size;
-};
-
-struct mtsp_syscall_ret {
-       int retval;
-       int errno;
-};
-
-struct mtsp_syscall_generic {
-       int arg0;
-       int arg1;
-       int arg2;
-       int arg3;
-       int arg4;
-       int arg5;
-       int arg6;
-};
-
-static struct list_head kspd_notifylist;
-static int sp_stopping;
-
-/* these should match with those in the SDE kit */
-#define MTSP_SYSCALL_BASE      0
-#define MTSP_SYSCALL_EXIT      (MTSP_SYSCALL_BASE + 0)
-#define MTSP_SYSCALL_OPEN      (MTSP_SYSCALL_BASE + 1)
-#define MTSP_SYSCALL_READ      (MTSP_SYSCALL_BASE + 2)
-#define MTSP_SYSCALL_WRITE     (MTSP_SYSCALL_BASE + 3)
-#define MTSP_SYSCALL_CLOSE     (MTSP_SYSCALL_BASE + 4)
-#define MTSP_SYSCALL_LSEEK32   (MTSP_SYSCALL_BASE + 5)
-#define MTSP_SYSCALL_ISATTY    (MTSP_SYSCALL_BASE + 6)
-#define MTSP_SYSCALL_GETTIME   (MTSP_SYSCALL_BASE + 7)
-#define MTSP_SYSCALL_PIPEFREQ  (MTSP_SYSCALL_BASE + 8)
-#define MTSP_SYSCALL_GETTOD    (MTSP_SYSCALL_BASE + 9)
-#define MTSP_SYSCALL_IOCTL     (MTSP_SYSCALL_BASE + 10)
-
-#define MTSP_O_RDONLY          0x0000
-#define MTSP_O_WRONLY          0x0001
-#define MTSP_O_RDWR            0x0002
-#define MTSP_O_NONBLOCK                0x0004
-#define MTSP_O_APPEND          0x0008
-#define MTSP_O_SHLOCK          0x0010
-#define MTSP_O_EXLOCK          0x0020
-#define MTSP_O_ASYNC           0x0040
-/* XXX: check which of these is actually O_SYNC vs O_DSYNC */
-#define MTSP_O_FSYNC           O_SYNC
-#define MTSP_O_NOFOLLOW                0x0100
-#define MTSP_O_SYNC            0x0080
-#define MTSP_O_CREAT           0x0200
-#define MTSP_O_TRUNC           0x0400
-#define MTSP_O_EXCL            0x0800
-#define MTSP_O_BINARY          0x8000
-
-extern int tclimit;
-
-struct apsp_table  {
-       int sp;
-       int ap;
-};
-
-/* we might want to do the mode flags too */
-struct apsp_table open_flags_table[] = {
-       { MTSP_O_RDWR, O_RDWR },
-       { MTSP_O_WRONLY, O_WRONLY },
-       { MTSP_O_CREAT, O_CREAT },
-       { MTSP_O_TRUNC, O_TRUNC },
-       { MTSP_O_NONBLOCK, O_NONBLOCK },
-       { MTSP_O_APPEND, O_APPEND },
-       { MTSP_O_NOFOLLOW, O_NOFOLLOW }
-};
-
-struct apsp_table syscall_command_table[] = {
-       { MTSP_SYSCALL_OPEN, __NR_open },
-       { MTSP_SYSCALL_CLOSE, __NR_close },
-       { MTSP_SYSCALL_READ, __NR_read },
-       { MTSP_SYSCALL_WRITE, __NR_write },
-       { MTSP_SYSCALL_LSEEK32, __NR_lseek },
-       { MTSP_SYSCALL_IOCTL, __NR_ioctl }
-};
-
-static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3)
-{
-       register long int _num  __asm__("$2") = num;
-       register long int _arg0  __asm__("$4") = arg0;
-       register long int _arg1  __asm__("$5") = arg1;
-       register long int _arg2  __asm__("$6") = arg2;
-       register long int _arg3  __asm__("$7") = arg3;
-
-       mm_segment_t old_fs;
-
-       old_fs = get_fs();
-       set_fs(KERNEL_DS);
-
-       __asm__ __volatile__ (
-       "       syscall                                 \n"
-       : "=r" (_num), "=r" (_arg3)
-       : "r" (_num), "r" (_arg0), "r" (_arg1), "r" (_arg2), "r" (_arg3));
-
-       set_fs(old_fs);
-
-       /* $a3 is error flag */
-       if (_arg3)
-               return -_num;
-
-       return _num;
-}
-
-static int translate_syscall_command(int cmd)
-{
-       int i;
-       int ret = -1;
-
-       for (i = 0; i < ARRAY_SIZE(syscall_command_table); i++) {
-               if ((cmd == syscall_command_table[i].sp))
-                       return syscall_command_table[i].ap;
-       }
-
-       return ret;
-}
-
-static unsigned int translate_open_flags(int flags)
-{
-       int i;
-       unsigned int ret = 0;
-
-       for (i = 0; i < ARRAY_SIZE(open_flags_table); i++) {
-               if( (flags & open_flags_table[i].sp) ) {
-                       ret |= open_flags_table[i].ap;
-               }
-       }
-
-       return ret;
-}
-
-
-static int sp_setfsuidgid(uid_t uid, gid_t gid)
-{
-       struct cred *new;
-
-       new = prepare_creds();
-       if (!new)
-               return -ENOMEM;
-
-       new->fsuid = uid;
-       new->fsgid = gid;
-
-       commit_creds(new);
-
-       return 0;
-}
-
-/*
- * Expects a request to be on the sysio channel. Reads it.  Decides whether
- * its a linux syscall and runs it, or whatever.  Puts the return code back
- * into the request and sends the whole thing back.
- */
-void sp_work_handle_request(void)
-{
-       struct mtsp_syscall sc;
-       struct mtsp_syscall_generic generic;
-       struct mtsp_syscall_ret ret;
-       struct kspd_notifications *n;
-       unsigned long written;
-       mm_segment_t old_fs;
-       struct timeval tv;
-       struct timezone tz;
-       int err, cmd;
-
-       char *vcwd;
-       int size;
-
-       ret.retval = -1;
-
-       old_fs = get_fs();
-       set_fs(KERNEL_DS);
-
-       if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) {
-               set_fs(old_fs);
-               printk(KERN_ERR "Expected request but nothing to read\n");
-               return;
-       }
-
-       size = sc.size;
-
-       if (size) {
-               if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) {
-                       set_fs(old_fs);
-                       printk(KERN_ERR "Expected request but nothing to read\n");
-                       return;
-               }
-       }
-
-       /* Run the syscall at the privilege of the user who loaded the
-          SP program */
-
-       if (vpe_getuid(tclimit)) {
-               err = sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit));
-               if (!err)
-                       pr_err("Change of creds failed\n");
-       }
-
-       switch (sc.cmd) {
-       /* needs the flags argument translating from SDE kit to
-          linux */
-       case MTSP_SYSCALL_PIPEFREQ:
-               ret.retval = cpu_khz * 1000;
-               ret.errno = 0;
-               break;
-
-       case MTSP_SYSCALL_GETTOD:
-               memset(&tz, 0, sizeof(tz));
-               if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
-                                            (int)&tz, 0, 0)) == 0)
-                       ret.retval = tv.tv_sec;
-               break;
-
-       case MTSP_SYSCALL_EXIT:
-               list_for_each_entry(n, &kspd_notifylist, list)
-                       n->kspd_sp_exit(tclimit);
-               sp_stopping = 1;
-
-               printk(KERN_DEBUG "KSPD got exit syscall from SP exitcode %d\n",
-                      generic.arg0);
-               break;
-
-       case MTSP_SYSCALL_OPEN:
-               generic.arg1 = translate_open_flags(generic.arg1);
-
-               vcwd = vpe_getcwd(tclimit);
-
-               /* change to cwd of the process that loaded the SP program */
-               old_fs = get_fs();
-               set_fs(KERNEL_DS);
-               sys_chdir(vcwd);
-               set_fs(old_fs);
-
-               sc.cmd = __NR_open;
-
-               /* fall through */
-
-       default:
-               if ((sc.cmd >= __NR_Linux) &&
-                   (sc.cmd <= (__NR_Linux +  __NR_Linux_syscalls)) )
-                       cmd = sc.cmd;
-               else
-                       cmd = translate_syscall_command(sc.cmd);
-
-               if (cmd >= 0) {
-                       ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1,
-                                               generic.arg2, generic.arg3);
-               } else
-                       printk(KERN_WARNING
-                              "KSPD: Unknown SP syscall number %d\n", sc.cmd);
-               break;
-       } /* switch */
-
-       if (vpe_getuid(tclimit)) {
-               err = sp_setfsuidgid(0, 0);
-               if (!err)
-                       pr_err("restoring old creds failed\n");
-       }
-
-       old_fs = get_fs();
-       set_fs(KERNEL_DS);
-       written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret));
-       set_fs(old_fs);
-       if (written < sizeof(ret))
-               printk("KSPD: sp_work_handle_request failed to send to SP\n");
-}
-
-static void sp_cleanup(void)
-{
-       struct files_struct *files = current->files;
-       int i, j;
-       struct fdtable *fdt;
-
-       j = 0;
-
-       /*
-        * It is safe to dereference the fd table without RCU or
-        * ->file_lock
-        */
-       fdt = files_fdtable(files);
-       for (;;) {
-               unsigned long set;
-               i = j * BITS_PER_LONG;
-               if (i >= fdt->max_fds)
-                       break;
-               set = fdt->open_fds[j++];
-               while (set) {
-                       if (set & 1) {
-                               struct file * file = xchg(&fdt->fd[i], NULL);
-                               if (file)
-                                       filp_close(file, files);
-                       }
-                       i++;
-                       set >>= 1;
-               }
-       }
-
-       /* Put daemon cwd back to root to avoid umount problems */
-       sys_chdir("/");
-}
-
-static int channel_open;
-
-/* the work handler */
-static void sp_work(struct work_struct *unused)
-{
-       if (!channel_open) {
-               if( rtlx_open(RTLX_CHANNEL_SYSIO, 1) != 0) {
-                       printk("KSPD: unable to open sp channel\n");
-                       sp_stopping = 1;
-               } else {
-                       channel_open++;
-                       printk(KERN_DEBUG "KSPD: SP channel opened\n");
-               }
-       } else {
-               /* wait for some data, allow it to sleep */
-               rtlx_read_poll(RTLX_CHANNEL_SYSIO, 1);
-
-               /* Check we haven't been woken because we are stopping */
-               if (!sp_stopping)
-                       sp_work_handle_request();
-       }
-
-       if (!sp_stopping)
-               queue_work(workqueue, &work);
-       else
-               sp_cleanup();
-}
-
-static void startwork(int vpe)
-{
-       sp_stopping = channel_open = 0;
-
-       if (workqueue == NULL) {
-               if ((workqueue = create_singlethread_workqueue("kspd")) == NULL) {
-                       printk(KERN_ERR "unable to start kspd\n");
-                       return;
-               }
-
-               INIT_WORK(&work, sp_work);
-       }
-
-       queue_work(workqueue, &work);
-}
-
-static void stopwork(int vpe)
-{
-       sp_stopping = 1;
-
-       printk(KERN_DEBUG "KSPD: SP stopping\n");
-}
-
-void kspd_notify(struct kspd_notifications *notify)
-{
-       list_add(&notify->list, &kspd_notifylist);
-}
-
-static struct vpe_notifications notify;
-static int kspd_module_init(void)
-{
-       INIT_LIST_HEAD(&kspd_notifylist);
-
-       notify.start = startwork;
-       notify.stop = stopwork;
-       vpe_notify(tclimit, &notify);
-
-       return 0;
-}
-
-static void kspd_module_exit(void)
-{
-
-}
-
-module_init(kspd_module_init);
-module_exit(kspd_module_exit);
-
-MODULE_DESCRIPTION("MIPS KSPD");
-MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
-MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/module-rela.c b/arch/mips/kernel/module-rela.c
new file mode 100644 (file)
index 0000000..61d6002
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  Copyright (C) 2001 Rusty Russell.
+ *  Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
+ *  Copyright (C) 2005 Thiemo Seufer
+ */
+
+#include <linux/elf.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/moduleloader.h>
+
+extern int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v);
+
+static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
+{
+       *location = v;
+
+       return 0;
+}
+
+static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
+{
+       if (v % 4) {
+               pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n",
+                      me->name);
+               return -ENOEXEC;
+       }
+
+       if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
+               printk(KERN_ERR
+                      "module %s: relocation overflow\n",
+                      me->name);
+               return -ENOEXEC;
+       }
+
+       *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
+
+       return 0;
+}
+
+static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
+{
+       *location = (*location & 0xffff0000) |
+                   ((((long long) v + 0x8000LL) >> 16) & 0xffff);
+
+       return 0;
+}
+
+static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
+{
+       *location = (*location & 0xffff0000) | (v & 0xffff);
+
+       return 0;
+}
+
+static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
+{
+       *(Elf_Addr *)location = v;
+
+       return 0;
+}
+
+static int apply_r_mips_higher_rela(struct module *me, u32 *location,
+                                   Elf_Addr v)
+{
+       *location = (*location & 0xffff0000) |
+                   ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
+
+       return 0;
+}
+
+static int apply_r_mips_highest_rela(struct module *me, u32 *location,
+                                    Elf_Addr v)
+{
+       *location = (*location & 0xffff0000) |
+                   ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
+
+       return 0;
+}
+
+static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
+                               Elf_Addr v) = {
+       [R_MIPS_NONE]           = apply_r_mips_none,
+       [R_MIPS_32]             = apply_r_mips_32_rela,
+       [R_MIPS_26]             = apply_r_mips_26_rela,
+       [R_MIPS_HI16]           = apply_r_mips_hi16_rela,
+       [R_MIPS_LO16]           = apply_r_mips_lo16_rela,
+       [R_MIPS_64]             = apply_r_mips_64_rela,
+       [R_MIPS_HIGHER]         = apply_r_mips_higher_rela,
+       [R_MIPS_HIGHEST]        = apply_r_mips_highest_rela
+};
+
+int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
+                      unsigned int symindex, unsigned int relsec,
+                      struct module *me)
+{
+       Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
+       Elf_Sym *sym;
+       u32 *location;
+       unsigned int i;
+       Elf_Addr v;
+       int res;
+
+       pr_debug("Applying relocate section %u to %u\n", relsec,
+              sechdrs[relsec].sh_info);
+
+       for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
+               /* This is where to make the change */
+               location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+                       + rel[i].r_offset;
+               /* This is the symbol it is referring to */
+               sym = (Elf_Sym *)sechdrs[symindex].sh_addr
+                       + ELF_MIPS_R_SYM(rel[i]);
+               if (IS_ERR_VALUE(sym->st_value)) {
+                       /* Ignore unresolved weak symbol */
+                       if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
+                               continue;
+                       printk(KERN_WARNING "%s: Unknown symbol %s\n",
+                              me->name, strtab + sym->st_name);
+                       return -ENOENT;
+               }
+
+               v = sym->st_value + rel[i].r_addend;
+
+               res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
+               if (res)
+                       return res;
+       }
+
+       return 0;
+}
index 4f8c3cba8c0c45180cdabe08ac05aa43e652395f..07ff5812ffaf7503826f74af41aa3a7e7dce4a6f 100644 (file)
@@ -51,7 +51,7 @@ void *module_alloc(unsigned long size)
 }
 #endif
 
-static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
+int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
 {
        return 0;
 }
@@ -63,13 +63,6 @@ static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v)
        return 0;
 }
 
-static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
-{
-       *location = v;
-
-       return 0;
-}
-
 static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
 {
        if (v % 4) {
@@ -91,26 +84,6 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
        return 0;
 }
 
-static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
-{
-       if (v % 4) {
-               pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n",
-                      me->name);
-               return -ENOEXEC;
-       }
-
-       if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
-               printk(KERN_ERR
-                      "module %s: relocation overflow\n",
-                      me->name);
-               return -ENOEXEC;
-       }
-
-       *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
-
-       return 0;
-}
-
 static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
 {
        struct mips_hi16 *n;
@@ -132,14 +105,6 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
        return 0;
 }
 
-static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
-{
-       *location = (*location & 0xffff0000) |
-                   ((((long long) v + 0x8000LL) >> 16) & 0xffff);
-
-       return 0;
-}
-
 static void free_relocation_chain(struct mips_hi16 *l)
 {
        struct mips_hi16 *next;
@@ -217,38 +182,6 @@ out_danger:
        return -ENOEXEC;
 }
 
-static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
-{
-       *location = (*location & 0xffff0000) | (v & 0xffff);
-
-       return 0;
-}
-
-static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
-{
-       *(Elf_Addr *)location = v;
-
-       return 0;
-}
-
-static int apply_r_mips_higher_rela(struct module *me, u32 *location,
-                                   Elf_Addr v)
-{
-       *location = (*location & 0xffff0000) |
-                   ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
-
-       return 0;
-}
-
-static int apply_r_mips_highest_rela(struct module *me, u32 *location,
-                                    Elf_Addr v)
-{
-       *location = (*location & 0xffff0000) |
-                   ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
-
-       return 0;
-}
-
 static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
                                Elf_Addr v) = {
        [R_MIPS_NONE]           = apply_r_mips_none,
@@ -258,18 +191,6 @@ static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
        [R_MIPS_LO16]           = apply_r_mips_lo16_rel
 };
 
-static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
-                               Elf_Addr v) = {
-       [R_MIPS_NONE]           = apply_r_mips_none,
-       [R_MIPS_32]             = apply_r_mips_32_rela,
-       [R_MIPS_26]             = apply_r_mips_26_rela,
-       [R_MIPS_HI16]           = apply_r_mips_hi16_rela,
-       [R_MIPS_LO16]           = apply_r_mips_lo16_rela,
-       [R_MIPS_64]             = apply_r_mips_64_rela,
-       [R_MIPS_HIGHER]         = apply_r_mips_higher_rela,
-       [R_MIPS_HIGHEST]        = apply_r_mips_highest_rela
-};
-
 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
                   unsigned int symindex, unsigned int relsec,
                   struct module *me)
@@ -324,46 +245,6 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
        return 0;
 }
 
-int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
-                      unsigned int symindex, unsigned int relsec,
-                      struct module *me)
-{
-       Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
-       Elf_Sym *sym;
-       u32 *location;
-       unsigned int i;
-       Elf_Addr v;
-       int res;
-
-       pr_debug("Applying relocate section %u to %u\n", relsec,
-              sechdrs[relsec].sh_info);
-
-       for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
-               /* This is where to make the change */
-               location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
-                       + rel[i].r_offset;
-               /* This is the symbol it is referring to */
-               sym = (Elf_Sym *)sechdrs[symindex].sh_addr
-                       + ELF_MIPS_R_SYM(rel[i]);
-               if (IS_ERR_VALUE(sym->st_value)) {
-                       /* Ignore unresolved weak symbol */
-                       if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
-                               continue;
-                       printk(KERN_WARNING "%s: Unknown symbol %s\n",
-                              me->name, strtab + sym->st_name);
-                       return -ENOENT;
-               }
-
-               v = sym->st_value + rel[i].r_addend;
-
-               res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
-               if (res)
-                       return res;
-       }
-
-       return 0;
-}
-
 /* Given an address, look for it in the module exception tables. */
 const struct exception_table_entry *search_module_dbetables(unsigned long addr)
 {
index 2f28d3b55687eac42469051c34cb9a6749b21473..a9b995dcf69165b39b7dec0ddeefc9ed06b9980f 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/time.h> /* For perf_irq */
 
 #define MIPS_MAX_HWEVENTS 4
+#define MIPS_TCS_PER_COUNTER 2
+#define MIPS_CPUID_TO_COUNTER_MASK (MIPS_TCS_PER_COUNTER - 1)
 
 struct cpu_hw_events {
        /* Array of events on this cpu. */
@@ -78,7 +80,6 @@ struct mips_perf_event {
 static struct mips_perf_event raw_event;
 static DEFINE_MUTEX(raw_event_mutex);
 
-#define UNSUPPORTED_PERF_EVENT_ID 0xffffffff
 #define C(x) PERF_COUNT_HW_CACHE_##x
 
 struct mips_pmu {
@@ -109,13 +110,20 @@ static struct mips_pmu mipspmu;
 #define M_PERFCTL_INTERRUPT_ENABLE     (1      <<  4)
 #define M_PERFCTL_EVENT(event)         (((event) & 0x3ff)  << 5)
 #define M_PERFCTL_VPEID(vpe)           ((vpe)    << 16)
+
+#ifdef CONFIG_CPU_BMIPS5000
+#define M_PERFCTL_MT_EN(filter)                0
+#else /* !CONFIG_CPU_BMIPS5000 */
 #define M_PERFCTL_MT_EN(filter)                ((filter) << 20)
+#endif /* CONFIG_CPU_BMIPS5000 */
+
 #define    M_TC_EN_ALL                 M_PERFCTL_MT_EN(0)
 #define    M_TC_EN_VPE                 M_PERFCTL_MT_EN(1)
 #define    M_TC_EN_TC                  M_PERFCTL_MT_EN(2)
 #define M_PERFCTL_TCID(tcid)           ((tcid)   << 22)
 #define M_PERFCTL_WIDE                 (1      << 30)
 #define M_PERFCTL_MORE                 (1      << 31)
+#define M_PERFCTL_TC                   (1      << 30)
 
 #define M_PERFCTL_COUNT_EVENT_WHENEVER (M_PERFCTL_EXL |                \
                                        M_PERFCTL_KERNEL |              \
@@ -131,21 +139,21 @@ static struct mips_pmu mipspmu;
 #define M_PERFCTL_EVENT_MASK           0xfe0
 
 
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
 static int cpu_has_mipsmt_pertccounters;
 
 static DEFINE_RWLOCK(pmuint_rwlock);
 
+#if defined(CONFIG_CPU_BMIPS5000)
+#define vpe_id()       (cpu_has_mipsmt_pertccounters ? \
+                        0 : (smp_processor_id() & MIPS_CPUID_TO_COUNTER_MASK))
+#else
 /*
  * FIXME: For VSMP, vpe_id() is redefined for Perf-events, because
  * cpu_data[cpuid].vpe_id reports 0 for _both_ CPUs.
  */
-#if defined(CONFIG_HW_PERF_EVENTS)
-#define vpe_id()       (cpu_has_mipsmt_pertccounters ? \
-                       0 : smp_processor_id())
-#else
 #define vpe_id()       (cpu_has_mipsmt_pertccounters ? \
-                       0 : cpu_data[smp_processor_id()].vpe_id)
+                        0 : smp_processor_id())
 #endif
 
 /* Copied from op_model_mipsxx.c */
@@ -162,10 +170,10 @@ static unsigned int counters_total_to_per_cpu(unsigned int counters)
        return counters >> vpe_shift();
 }
 
-#else /* !CONFIG_MIPS_MT_SMP */
+#else /* !CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */
 #define vpe_id()       0
 
-#endif /* CONFIG_MIPS_MT_SMP */
+#endif /* CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */
 
 static void resume_local_counters(void);
 static void pause_local_counters(void);
@@ -340,6 +348,11 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
                (evt->config_base & M_PERFCTL_CONFIG_MASK) |
                /* Make sure interrupt enabled. */
                M_PERFCTL_INTERRUPT_ENABLE;
+       if (IS_ENABLED(CONFIG_CPU_BMIPS5000))
+               /* enable the counter for the calling thread */
+               cpuc->saved_ctrl[idx] |=
+                       (1 << (12 + vpe_id())) | M_PERFCTL_TC;
+
        /*
         * We do not actually let the counter run. Leave it until start().
         */
@@ -509,7 +522,7 @@ static void mipspmu_read(struct perf_event *event)
 
 static void mipspmu_enable(struct pmu *pmu)
 {
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
        write_unlock(&pmuint_rwlock);
 #endif
        resume_local_counters();
@@ -529,7 +542,7 @@ static void mipspmu_enable(struct pmu *pmu)
 static void mipspmu_disable(struct pmu *pmu)
 {
        pause_local_counters();
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
        write_lock(&pmuint_rwlock);
 #endif
 }
@@ -664,13 +677,10 @@ static unsigned int mipspmu_perf_event_encode(const struct mips_perf_event *pev)
 
 static const struct mips_perf_event *mipspmu_map_general_event(int idx)
 {
-       const struct mips_perf_event *pev;
-
-       pev = ((*mipspmu.general_event_map)[idx].event_id ==
-               UNSUPPORTED_PERF_EVENT_ID ? ERR_PTR(-EOPNOTSUPP) :
-               &(*mipspmu.general_event_map)[idx]);
 
-       return pev;
+       if ((*mipspmu.general_event_map)[idx].cntr_mask == 0)
+               return ERR_PTR(-EOPNOTSUPP);
+       return &(*mipspmu.general_event_map)[idx];
 }
 
 static const struct mips_perf_event *mipspmu_map_cache_event(u64 config)
@@ -695,7 +705,7 @@ static const struct mips_perf_event *mipspmu_map_cache_event(u64 config)
                                        [cache_op]
                                        [cache_result]);
 
-       if (pev->event_id == UNSUPPORTED_PERF_EVENT_ID)
+       if (pev->cntr_mask == 0)
                return ERR_PTR(-EOPNOTSUPP);
 
        return pev;
@@ -800,11 +810,8 @@ static const struct mips_perf_event mipsxxcore_event_map
                                [PERF_COUNT_HW_MAX] = {
        [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
        [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
-       [PERF_COUNT_HW_CACHE_REFERENCES] = { UNSUPPORTED_PERF_EVENT_ID },
-       [PERF_COUNT_HW_CACHE_MISSES] = { UNSUPPORTED_PERF_EVENT_ID },
        [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x02, CNTR_EVEN, T },
        [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T },
-       [PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },
 };
 
 /* 74K core has different branch event code. */
@@ -812,11 +819,8 @@ static const struct mips_perf_event mipsxx74Kcore_event_map
                                [PERF_COUNT_HW_MAX] = {
        [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
        [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
-       [PERF_COUNT_HW_CACHE_REFERENCES] = { UNSUPPORTED_PERF_EVENT_ID },
-       [PERF_COUNT_HW_CACHE_MISSES] = { UNSUPPORTED_PERF_EVENT_ID },
        [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x27, CNTR_EVEN, T },
        [PERF_COUNT_HW_BRANCH_MISSES] = { 0x27, CNTR_ODD, T },
-       [PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },
 };
 
 static const struct mips_perf_event octeon_event_map[PERF_COUNT_HW_MAX] = {
@@ -829,6 +833,13 @@ static const struct mips_perf_event octeon_event_map[PERF_COUNT_HW_MAX] = {
        [PERF_COUNT_HW_BUS_CYCLES] = { 0x25, CNTR_ALL },
 };
 
+static const struct mips_perf_event bmips5000_event_map
+                               [PERF_COUNT_HW_MAX] = {
+       [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, T },
+       [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
+       [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T },
+};
+
 /* 24K/34K/1004K cores can share the same cache event map. */
 static const struct mips_perf_event mipsxxcore_cache_map
                                [PERF_COUNT_HW_CACHE_MAX]
@@ -849,10 +860,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x0a, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x0b, CNTR_EVEN | CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(L1I)] = {
        [C(OP_READ)] = {
@@ -869,7 +876,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                 * Note that MIPS has only "hit" events countable for
                 * the prefetch operation.
                 */
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
        },
 },
 [C(LL)] = {
@@ -881,10 +887,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x15, CNTR_ODD, P },
                [C(RESULT_MISS)]        = { 0x16, CNTR_EVEN, P },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(DTLB)] = {
        [C(OP_READ)] = {
@@ -895,10 +897,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x06, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x06, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(ITLB)] = {
        [C(OP_READ)] = {
@@ -909,10 +907,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x05, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x05, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(BPU)] = {
        /* Using the same code for *HW_BRANCH* */
@@ -924,24 +918,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x02, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x02, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-},
-[C(NODE)] = {
-       [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 };
 
@@ -965,10 +941,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x17, CNTR_ODD, T },
                [C(RESULT_MISS)]        = { 0x18, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(L1I)] = {
        [C(OP_READ)] = {
@@ -985,7 +957,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
                 * Note that MIPS has only "hit" events countable for
                 * the prefetch operation.
                 */
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
        },
 },
 [C(LL)] = {
@@ -997,25 +968,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x1c, CNTR_ODD, P },
                [C(RESULT_MISS)]        = { 0x1d, CNTR_EVEN | CNTR_ODD, P },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-},
-[C(DTLB)] = {
-       /* 74K core does not have specific DTLB events. */
-       [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(ITLB)] = {
        [C(OP_READ)] = {
@@ -1026,10 +978,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x04, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x04, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(BPU)] = {
        /* Using the same code for *HW_BRANCH* */
@@ -1041,23 +989,64 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
                [C(RESULT_ACCESS)]      = { 0x27, CNTR_EVEN, T },
                [C(RESULT_MISS)]        = { 0x27, CNTR_ODD, T },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
+},
+};
+
+/* BMIPS5000 */
+static const struct mips_perf_event bmips5000_cache_map
+                               [PERF_COUNT_HW_CACHE_MAX]
+                               [PERF_COUNT_HW_CACHE_OP_MAX]
+                               [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
+[C(L1D)] = {
+       /*
+        * Like some other architectures (e.g. ARM), the performance
+        * counters don't differentiate between read and write
+        * accesses/misses, so this isn't strictly correct, but it's the
+        * best we can do. Writes and reads get combined.
+        */
+       [C(OP_READ)] = {
+               [C(RESULT_ACCESS)]      = { 12, CNTR_EVEN, T },
+               [C(RESULT_MISS)]        = { 12, CNTR_ODD, T },
+       },
+       [C(OP_WRITE)] = {
+               [C(RESULT_ACCESS)]      = { 12, CNTR_EVEN, T },
+               [C(RESULT_MISS)]        = { 12, CNTR_ODD, T },
        },
 },
-[C(NODE)] = {
+[C(L1I)] = {
        [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
+               [C(RESULT_ACCESS)]      = { 10, CNTR_EVEN, T },
+               [C(RESULT_MISS)]        = { 10, CNTR_ODD, T },
        },
        [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
+               [C(RESULT_ACCESS)]      = { 10, CNTR_EVEN, T },
+               [C(RESULT_MISS)]        = { 10, CNTR_ODD, T },
        },
        [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
+               [C(RESULT_ACCESS)]      = { 23, CNTR_EVEN, T },
+               /*
+                * Note that MIPS has only "hit" events countable for
+                * the prefetch operation.
+                */
+       },
+},
+[C(LL)] = {
+       [C(OP_READ)] = {
+               [C(RESULT_ACCESS)]      = { 28, CNTR_EVEN, P },
+               [C(RESULT_MISS)]        = { 28, CNTR_ODD, P },
+       },
+       [C(OP_WRITE)] = {
+               [C(RESULT_ACCESS)]      = { 28, CNTR_EVEN, P },
+               [C(RESULT_MISS)]        = { 28, CNTR_ODD, P },
+       },
+},
+[C(BPU)] = {
+       /* Using the same code for *HW_BRANCH* */
+       [C(OP_READ)] = {
+               [C(RESULT_MISS)]        = { 0x02, CNTR_ODD, T },
+       },
+       [C(OP_WRITE)] = {
+               [C(RESULT_MISS)]        = { 0x02, CNTR_ODD, T },
        },
 },
 };
@@ -1074,39 +1063,14 @@ static const struct mips_perf_event octeon_cache_map
        },
        [C(OP_WRITE)] = {
                [C(RESULT_ACCESS)]      = { 0x30, CNTR_ALL },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
        },
 },
 [C(L1I)] = {
        [C(OP_READ)] = {
                [C(RESULT_ACCESS)]      = { 0x18, CNTR_ALL },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
        },
        [C(OP_PREFETCH)] = {
                [C(RESULT_ACCESS)]      = { 0x19, CNTR_ALL },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-},
-[C(LL)] = {
-       [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
        },
 },
 [C(DTLB)] = {
@@ -1115,46 +1079,16 @@ static const struct mips_perf_event octeon_cache_map
         * read and write.
         */
        [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
                [C(RESULT_MISS)]        = { 0x35, CNTR_ALL },
        },
        [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
                [C(RESULT_MISS)]        = { 0x35, CNTR_ALL },
        },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 [C(ITLB)] = {
        [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
                [C(RESULT_MISS)]        = { 0x37, CNTR_ALL },
        },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-},
-[C(BPU)] = {
-       /* Using the same code for *HW_BRANCH* */
-       [C(OP_READ)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_WRITE)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
-       [C(OP_PREFETCH)] = {
-               [C(RESULT_ACCESS)]      = { UNSUPPORTED_PERF_EVENT_ID },
-               [C(RESULT_MISS)]        = { UNSUPPORTED_PERF_EVENT_ID },
-       },
 },
 };
 
@@ -1304,7 +1238,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
        int handled = IRQ_NONE;
        struct pt_regs *regs;
 
-       if (cpu_has_mips_r2 && !(read_c0_cause() & (1 << 26)))
+       if (cpu_has_perf_cntr_intr_bit && !(read_c0_cause() & CAUSEF_PCI))
                return handled;
        /*
         * First we pause the local counters, so that when we are locked
@@ -1314,7 +1248,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
         * See also mipsxx_pmu_start().
         */
        pause_local_counters();
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
        read_lock(&pmuint_rwlock);
 #endif
 
@@ -1346,7 +1280,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
        if (handled == IRQ_HANDLED)
                irq_work_run();
 
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
        read_unlock(&pmuint_rwlock);
 #endif
        resume_local_counters();
@@ -1391,6 +1325,11 @@ static irqreturn_t mipsxx_pmu_handle_irq(int irq, void *dev)
 #define IS_RANGE_V_1004K_EVENT(r)      ((r) == 47)
 #endif
 
+/* BMIPS5000 */
+#define IS_BOTH_COUNTERS_BMIPS5000_EVENT(b)                            \
+       ((b) == 0 || (b) == 1)
+
+
 /*
  * User can use 0-255 raw events, where 0-127 for the events of even
  * counters, and 128-255 for odd counters. Note that bit 7 is used to
@@ -1461,6 +1400,12 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
                        raw_event.range = T;
 #endif
                break;
+       case CPU_BMIPS5000:
+               if (IS_BOTH_COUNTERS_BMIPS5000_EVENT(base_id))
+                       raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
+               else
+                       raw_event.cntr_mask =
+                               raw_id > 127 ? CNTR_ODD : CNTR_EVEN;
        }
 
        return &raw_event;
@@ -1513,7 +1458,7 @@ init_hw_perf_events(void)
                return -ENODEV;
        }
 
-#ifdef CONFIG_MIPS_MT_SMP
+#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
        cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19);
        if (!cpu_has_mipsmt_pertccounters)
                counters = counters_total_to_per_cpu(counters);
@@ -1572,6 +1517,11 @@ init_hw_perf_events(void)
                mipspmu.cache_event_map = &octeon_cache_map;
                mipspmu.map_raw_event = octeon_pmu_map_raw_event;
                break;
+       case CPU_BMIPS5000:
+               mipspmu.name = "BMIPS5000";
+               mipspmu.general_event_map = &bmips5000_event_map;
+               mipspmu.cache_event_map = &bmips5000_cache_map;
+               break;
        default:
                pr_cont("Either hardware does not support performance "
                        "counters, or not yet implemented.\n");
index 5542817c1b498869cef930f4bd09c7ce680fe130..07dff54f2ce8b238e4b955082ed12bf9e2f1fd43 100644 (file)
@@ -64,14 +64,17 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                                cpu_data[n].watch_reg_masks[i]);
                seq_printf(m, "]\n");
        }
-       seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
-                     cpu_has_mips16 ? " mips16" : "",
-                     cpu_has_mdmx ? " mdmx" : "",
-                     cpu_has_mips3d ? " mips3d" : "",
-                     cpu_has_smartmips ? " smartmips" : "",
-                     cpu_has_dsp ? " dsp" : "",
-                     cpu_has_mipsmt ? " mt" : ""
-               );
+
+       seq_printf(m, "ASEs implemented\t:");
+       if (cpu_has_mips16)     seq_printf(m, "%s", " mips16");
+       if (cpu_has_mdmx)       seq_printf(m, "%s", " mdmx");
+       if (cpu_has_mips3d)     seq_printf(m, "%s", " mips3d");
+       if (cpu_has_smartmips)  seq_printf(m, "%s", " smartmips");
+       if (cpu_has_dsp)        seq_printf(m, "%s", " dsp");
+       if (cpu_has_dsp2)       seq_printf(m, "%s", " dsp2");
+       if (cpu_has_mipsmt)     seq_printf(m, "%s", " mt");
+       seq_printf(m, "\n");
+
        seq_printf(m, "shadow register sets\t: %d\n",
                      cpu_data[n].srsets);
        seq_printf(m, "kscratch registers\t: %d\n",
index df243a64f4305305564ec1e1e5b7f68c4c6e55ad..007ccbe1e26474a6788ef61ee046e226c480d877 100644 (file)
@@ -1,6 +1,13 @@
 #include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/thread_info.h>
+
+/*
+ * Put .bss..swapper_pg_dir as the first thing in .bss. This will
+ * ensure that it has .bss alignment (64K).
+ */
+#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
+
 #include <asm-generic/vmlinux.lds.h>
 
 #undef mips
@@ -119,11 +126,21 @@ SECTIONS
        }
 
        PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
-       . = ALIGN(PAGE_SIZE);
+       /*
+        * Align to 64K in attempt to eliminate holes before the
+        * .bss..swapper_pg_dir section at the start of .bss.  This
+        * also satisfies PAGE_SIZE alignment as the largest page size
+        * allowed is 64K.
+        */
+       . = ALIGN(0x10000);
        __init_end = .;
        /* freed after init ends here */
 
-       BSS_SECTION(0, 0, 0)
+       /*
+        * Force .bss to 64K alignment so that .bss..swapper_pg_dir
+        * gets that alignment.  .sbss should be empty, so there will be
+        * no holes after __init_end. */
+       BSS_SECTION(0, 0x10000, 0)
 
        _end = . ;
 
index f6f91523cb1c40fdd6e6c988edffa8e8cfe42dc9..eec690af6581616957089993e2decfd91f13b4fd 100644 (file)
@@ -50,7 +50,6 @@
 #include <asm/mips_mt.h>
 #include <asm/processor.h>
 #include <asm/vpe.h>
-#include <asm/kspd.h>
 
 typedef void *vpe_handle;
 
@@ -69,11 +68,6 @@ static char module_name[] = "vpe";
 static int major;
 static const int minor = 1;    /* fixed for now  */
 
-#ifdef CONFIG_MIPS_APSP_KSPD
-static struct kspd_notifications kspd_events;
-static int kspd_events_reqd;
-#endif
-
 /* grab the likely amount of memory we will need. */
 #ifdef CONFIG_MIPS_VPE_LOADER_TOM
 #define P_SIZE (2 * 1024 * 1024)
@@ -1101,14 +1095,6 @@ static int vpe_open(struct inode *inode, struct file *filp)
        v->uid = filp->f_cred->fsuid;
        v->gid = filp->f_cred->fsgid;
 
-#ifdef CONFIG_MIPS_APSP_KSPD
-       /* get kspd to tell us when a syscall_exit happens */
-       if (!kspd_events_reqd) {
-               kspd_notify(&kspd_events);
-               kspd_events_reqd++;
-       }
-#endif
-
        v->cwd[0] = 0;
        ret = getcwd(v->cwd, VPE_PATH_MAX);
        if (ret < 0)
@@ -1341,13 +1327,6 @@ char *vpe_getcwd(int index)
 
 EXPORT_SYMBOL(vpe_getcwd);
 
-#ifdef CONFIG_MIPS_APSP_KSPD
-static void kspd_sp_exit( int sp_id)
-{
-       cleanup_tc(get_tc(sp_id));
-}
-#endif
-
 static ssize_t store_kill(struct device *dev, struct device_attribute *attr,
                          const char *buf, size_t len)
 {
@@ -1585,9 +1564,6 @@ out_reenable:
        emt(mtflags);
        local_irq_restore(flags);
 
-#ifdef CONFIG_MIPS_APSP_KSPD
-       kspd_events.kspd_sp_exit = kspd_sp_exit;
-#endif
        return 0;
 
 out_class:
index 1a85ba92eb5c274aaf7d96020bc34b6d7338ea27..be9acb2b959d4d125752dd564b1c3c0831b7e458 100644 (file)
@@ -469,19 +469,20 @@ void __init_refok free_initmem(void)
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
 unsigned long pgd_current[NR_CPUS];
 #endif
-/*
- * On 64-bit we've got three-level pagetables with a slightly
- * different layout ...
- */
-#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
 
 /*
  * gcc 3.3 and older have trouble determining that PTRS_PER_PGD and PGD_ORDER
  * are constants.  So we use the variants from asm-offset.h until that gcc
  * will officially be retired.
+ *
+ * Align swapper_pg_dir in to 64K, allows its address to be loaded
+ * with a single LUI instruction in the TLB handlers.  If we used
+ * __aligned(64K), its size would get rounded up to the alignment
+ * size, and waste space.  So we place it in its own section and align
+ * it in the linker script.
  */
-pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
+pgd_t swapper_pg_dir[_PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
 #ifndef __PAGETABLE_PMD_FOLDED
-pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
+pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned_bss;
 #endif
-pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
+pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
index cda4e300eb0a8c2edb6eb205debd06810e4fff9d..25407794edb4ff875bba1acb9ac5c4fa632ae78c 100644 (file)
@@ -26,17 +26,17 @@ void pgd_init(unsigned long page)
        p = (unsigned long *) page;
        end = p + PTRS_PER_PGD;
 
-       while (p < end) {
+       do {
                p[0] = entry;
                p[1] = entry;
                p[2] = entry;
                p[3] = entry;
                p[4] = entry;
-               p[5] = entry;
-               p[6] = entry;
-               p[7] = entry;
                p += 8;
-       }
+               p[-3] = entry;
+               p[-2] = entry;
+               p[-1] = entry;
+       } while (p != end);
 }
 
 #ifndef __PAGETABLE_PMD_FOLDED
@@ -47,17 +47,17 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
        p = (unsigned long *) addr;
        end = p + PTRS_PER_PMD;
 
-       while (p < end) {
+       do {
                p[0] = pagetable;
                p[1] = pagetable;
                p[2] = pagetable;
                p[3] = pagetable;
                p[4] = pagetable;
-               p[5] = pagetable;
-               p[6] = pagetable;
-               p[7] = pagetable;
                p += 8;
-       }
+               p[-3] = pagetable;
+               p[-2] = pagetable;
+               p[-1] = pagetable;
+       } while (p != end);
 }
 #endif
 
index e09d49256908968edf6d3b018edea0f2a857b84d..658a520364ce76979191defd64c56a1da88899fb 100644 (file)
@@ -599,8 +599,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
                                                                  unsigned int reg)
 {
        if (cpu_has_rixi) {
-               UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC));
-               UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
        } else {
 #ifdef CONFIG_64BIT_PHYS_ADDR
                uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL));
@@ -1019,11 +1018,9 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
                uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
                uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
                if (cpu_has_rixi) {
-                       UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
-                       UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
-                       UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+                       UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
                        UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
-                       UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+                       UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
                } else {
                        uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
                        UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
@@ -1046,13 +1043,11 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
        if (r45k_bvahwbug())
                build_tlb_probe_entry(p);
        if (cpu_has_rixi) {
-               UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
-               UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
-               UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
                if (r4k_250MHZhwbug())
                        UASM_i_MTC0(p, 0, C0_ENTRYLO0);
                UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
-               UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
        } else {
                UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
                if (r4k_250MHZhwbug())
@@ -1212,13 +1207,9 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
                UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
        }
        if (cpu_has_rixi) {
-               uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC));
-               uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
-               uasm_i_drotr(p, even, even,
-                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               uasm_i_drotr(p, even, even, ilog2(_PAGE_GLOBAL));
                UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
-               uasm_i_drotr(p, odd, odd,
-                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               uasm_i_drotr(p, odd, odd, ilog2(_PAGE_GLOBAL));
        } else {
                uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL));
                UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
index 819622f93e9cec97a620d24941dcb80549f000ca..9a1a2244522a10972ec20aca833f32cf1dc4dba0 100644 (file)
@@ -8,7 +8,8 @@
 #define PCID           4
 
 /* This table is filled in by interrogating the PIIX4 chip */
-static char pci_irq[5] __initdata;
+static char pci_irq[5] __devinitdata = {
+};
 
 static char irq_tab[][5] __initdata = {
        /*      INTA    INTB    INTC    INTD */
index b2d4f492d782fc1cfee3e1d9cf7a5c53a86ba9c5..9cb9d43a3a0e6341809f79825ce229423c7acf0d 100644 (file)
@@ -118,26 +118,6 @@ static struct resource sc26xx_rsrc[] = {
        }
 };
 
-static unsigned int sc26xx_data[2] = {
-       /* DTR   |   RTS    |   DSR    |   CTS     |   DCD     |   RI    */
-       (8 << 0) | (4 << 4) | (6 << 8) | (0 << 12) | (6 << 16) | (0 << 20),
-       (3 << 0) | (2 << 4) | (1 << 8) | (2 << 12) | (3 << 16) | (4 << 20)
-};
-
-static struct platform_device sc26xx_pdev = {
-       .name           = "SC26xx",
-       .num_resources  = ARRAY_SIZE(sc26xx_rsrc),
-       .resource       = sc26xx_rsrc,
-       .dev                    = {
-               .platform_data  = sc26xx_data,
-       }
-};
-
-#warning "Please try migrate to use new driver SCCNXP and report the status" \
-        "in the linux-serial mailing list."
-
-/* The code bellow is a replacement of SC26XX to SCCNXP */
-#if 0
 #include <linux/platform_data/sccnxp.h>
 
 static struct sccnxp_pdata sccnxp_data = {
@@ -155,15 +135,14 @@ static struct sccnxp_pdata sccnxp_data = {
                          MCTRL_SIG(RNG_IP, LINE_IP3),
 };
 
-static struct platform_device sc2681_pdev = {
+static struct platform_device sc26xx_pdev = {
        .name           = "sc2681",
-       .resource       = sc2xxx_rsrc,
-       .num_resources  = ARRAY_SIZE(sc2xxx_rsrc),
+       .resource       = sc26xx_rsrc,
+       .num_resources  = ARRAY_SIZE(sc26xx_rsrc),
        .dev    = {
                .platform_data  = &sccnxp_data,
        },
 };
-#endif
 
 static u32 a20r_ack_hwint(void)
 {
index ddbdc33471a830b152ec1f5cb3dcf9912d805fda..04669fac117b34b9e35bc73d10428efa45561d36 100644 (file)
@@ -9,6 +9,7 @@ config MN10300
        select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
        select GENERIC_CLOCKEVENTS
        select GENERIC_KERNEL_THREAD
+       select MODULES_USE_ELF_RELA
 
 config AM33_2
        def_bool n
index 5d7057d01494a69f2dc4a1bfdb69fd7754d1ea93..6571103b051811c1e7e25a6ab7319d82f5209c49 100644 (file)
 #ifndef _ASM_MODULE_H
 #define _ASM_MODULE_H
 
-struct mod_arch_specific {
-};
-
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
+#include <asm-generic/module.h>
 
 /*
  * Include the MN10300 architecture version.
index 49765b53f6374709943a1c1a5d17b46cad1846fb..05f2ba41ff1aadd52634a136b0f4450bba2970cc 100644 (file)
@@ -21,6 +21,7 @@ config OPENRISC
        select GENERIC_CLOCKEVENTS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select MODULES_USE_ELF_RELA
 
 config MMU
        def_bool y
index 7140b6b26441927fa669e1a2649ee3e99f1de750..78de6805268d1b6094986d02a7c790c35cb90f17 100644 (file)
@@ -1,6 +1,4 @@
-include include/asm-generic/Kbuild.asm
 
-header-y += elf.h
 header-y += ucontext.h
 
 generic-y += atomic.h
index 225a7ff320ad565329b7e399c8ce80c9f8cf963c..f4aa8a542a22ef70ac93fa6e50b48a78f7910e11 100644 (file)
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
-
 #ifndef __ASM_OPENRISC_ELF_H
 #define __ASM_OPENRISC_ELF_H
 
-/*
- * This files is partially exported to userspace.  This allows us to keep
- * the ELF bits in one place which should assist in keeping the kernel and
- * userspace in sync.
- */
-
-/*
- * ELF register definitions..
- */
-
-/* for struct user_regs_struct definition */
-#include <asm/ptrace.h>
-
-/* The OR1K relocation types... not all relevant for module loader */
-#define R_OR32_NONE    0
-#define R_OR32_32      1
-#define R_OR32_16      2
-#define R_OR32_8       3
-#define R_OR32_CONST   4
-#define R_OR32_CONSTH  5
-#define R_OR32_JUMPTARG        6
-#define R_OR32_VTINHERIT 7
-#define R_OR32_VTENTRY 8
-
-typedef unsigned long elf_greg_t;
-
-/*
- * Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
- * thus exposed to user-space.
- */
-#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-/* A placeholder; OR32 does not have fp support yes, so no fp regs for now.  */
-typedef unsigned long elf_fpregset_t;
-
-/* This should be moved to include/linux/elf.h */
-#define EM_OR32         0x8472
-#define EM_OPENRISC     92     /* OpenRISC 32-bit embedded processor */
-
-/*
- * These are used to set parameters in the core dumps.
- */
-#define ELF_ARCH       EM_OR32
-#define ELF_CLASS      ELFCLASS32
-#define ELF_DATA       ELFDATA2MSB
-
-#ifdef __KERNEL__
 
 #include <linux/types.h>
+#include <uapi/asm/elf.h>
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.
@@ -113,5 +65,4 @@ extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt);
 #define SET_PERSONALITY(ex) \
        set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 
-#endif /* __KERNEL__ */
 #endif
index 8555c0c3d4d749fb75138c7efefe84360fb49857..6ca17264c399b2bb6849a5ad7555ef46285aaffa 100644 (file)
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
-
 #ifndef __ASM_OPENRISC_PTRACE_H
 #define __ASM_OPENRISC_PTRACE_H
 
-#ifndef __ASSEMBLY__
-/*
- * This is the layout of the regset returned by the GETREGSET ptrace call
- */
-struct user_regs_struct {
-       /* GPR R0-R31... */
-       unsigned long gpr[32];
-       unsigned long pc;
-       unsigned long sr;
-};
-#endif
-
-#ifdef __KERNEL__
 
 #include <asm/spr_defs.h>
+#include <uapi/asm/ptrace.h>
 
 /*
  * Make kernel PTrace/register structures opaque to userspace... userspace can
@@ -134,6 +121,4 @@ static inline long regs_return_value(struct pt_regs *regs)
 #define PT_ORIG_GPR11 132
 #define PT_SYSCALLNO  136
 
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_OPENRISC_PTRACE_H */
index baebb3da1d44160fc6f6f259886656e6f494b167..80761eb82b5fd8d272f354eefc7299c7c3406a0a 100644 (file)
@@ -1,3 +1,10 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += byteorder.h
+header-y += elf.h
+header-y += kvm_para.h
+header-y += param.h
+header-y += ptrace.h
+header-y += sigcontext.h
+header-y += unistd.h
diff --git a/arch/openrisc/include/uapi/asm/elf.h b/arch/openrisc/include/uapi/asm/elf.h
new file mode 100644 (file)
index 0000000..f02ea58
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * OpenRISC Linux
+ *
+ * Linux architectural port borrowing liberally from similar works of
+ * others.  All original copyrights apply as per the original source
+ * declaration.
+ *
+ * OpenRISC implementation:
+ * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
+ * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
+ * et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _UAPI__ASM_OPENRISC_ELF_H
+#define _UAPI__ASM_OPENRISC_ELF_H
+
+/*
+ * This files is partially exported to userspace.  This allows us to keep
+ * the ELF bits in one place which should assist in keeping the kernel and
+ * userspace in sync.
+ */
+
+/*
+ * ELF register definitions..
+ */
+
+/* for struct user_regs_struct definition */
+#include <asm/ptrace.h>
+
+/* The OR1K relocation types... not all relevant for module loader */
+#define R_OR32_NONE    0
+#define R_OR32_32      1
+#define R_OR32_16      2
+#define R_OR32_8       3
+#define R_OR32_CONST   4
+#define R_OR32_CONSTH  5
+#define R_OR32_JUMPTARG        6
+#define R_OR32_VTINHERIT 7
+#define R_OR32_VTENTRY 8
+
+typedef unsigned long elf_greg_t;
+
+/*
+ * Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
+ * thus exposed to user-space.
+ */
+#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* A placeholder; OR32 does not have fp support yes, so no fp regs for now.  */
+typedef unsigned long elf_fpregset_t;
+
+/* This should be moved to include/linux/elf.h */
+#define EM_OR32         0x8472
+#define EM_OPENRISC     92     /* OpenRISC 32-bit embedded processor */
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_ARCH       EM_OR32
+#define ELF_CLASS      ELFCLASS32
+#define ELF_DATA       ELFDATA2MSB
+
+#endif /* _UAPI__ASM_OPENRISC_ELF_H */
diff --git a/arch/openrisc/include/uapi/asm/ptrace.h b/arch/openrisc/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..9760bd1
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * OpenRISC Linux
+ *
+ * Linux architectural port borrowing liberally from similar works of
+ * others.  All original copyrights apply as per the original source
+ * declaration.
+ *
+ * OpenRISC implementation:
+ * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
+ * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
+ * et al.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _UAPI__ASM_OPENRISC_PTRACE_H
+#define _UAPI__ASM_OPENRISC_PTRACE_H
+
+#ifndef __ASSEMBLY__
+/*
+ * This is the layout of the regset returned by the GETREGSET ptrace call
+ */
+struct user_regs_struct {
+       /* GPR R0-R31... */
+       unsigned long gpr[32];
+       unsigned long pc;
+       unsigned long sr;
+};
+#endif
+
+
+#endif /* _UAPI__ASM_OPENRISC_PTRACE_H */
index b87438bb338477e599a85f384b9959eeb3898871..11def45b98c5ee04f356890a8396b8d970624524 100644 (file)
@@ -20,6 +20,8 @@ config PARISC
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
 
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
index 1f4123427ea09c9c80c5b25c0cbb40fea5ca754a..bab37e99168a64324043f009481884338e7ea263 100644 (file)
@@ -1,21 +1,11 @@
 #ifndef _ASM_PARISC_MODULE_H
 #define _ASM_PARISC_MODULE_H
+
+#include <asm-generic/module.h>
+
 /*
  * This file contains the parisc architecture specific module code.
  */
-#ifdef CONFIG_64BIT
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Sym Elf64_Sym
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Addr Elf64_Addr
-#define Elf_Rela Elf64_Rela
-#else
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
-#define Elf_Addr Elf32_Addr
-#define Elf_Rela Elf32_Rela
-#endif
 
 struct unwind_table;
 
index 969f3d9ded91941cb4323052df4f465764259608..a902a5c1c76a337280fb8b6d42500e0e6f2caffb 100644 (file)
@@ -142,6 +142,8 @@ config PPC
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
 
 config EARLY_PRINTK
        bool
index 0192a4ee2bc2b65354778a6ec2392f6cab5cddba..c1df590ec4440a96f81b97f6048ad79a7f326179 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/list.h>
 #include <asm/bug.h>
+#include <asm-generic/module.h>
 
 
 #ifndef __powerpc64__
@@ -60,16 +61,10 @@ struct mod_arch_specific {
  */
 
 #ifdef __powerpc64__
-#    define Elf_Shdr   Elf64_Shdr
-#    define Elf_Sym    Elf64_Sym
-#    define Elf_Ehdr   Elf64_Ehdr
 #    ifdef MODULE
        asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
 #    endif
 #else
-#    define Elf_Shdr   Elf32_Shdr
-#    define Elf_Sym    Elf32_Sym
-#    define Elf_Ehdr   Elf32_Ehdr
 #    ifdef MODULE
        asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
        asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
index e5dac123618519051f776b78b74c869d2267d693..3f3d9ca7a5b68fefdb333818fe6189d8c6cbf3ae 100644 (file)
@@ -136,6 +136,8 @@ config S390
        select KTIME_SCALAR if 32BIT
        select HAVE_ARCH_SECCOMP_FILTER
        select GENERIC_KERNEL_THREAD
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_RELA
 
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
index f0b6b26b6e59de846b260deef64d3d0b07e0a188..df1f861a848a1ef85a2b902d7bf45a1ad6e81cef 100644 (file)
@@ -1,5 +1,8 @@
 #ifndef _ASM_S390_MODULE_H
 #define _ASM_S390_MODULE_H
+
+#include <asm-generic/module.h>
+
 /*
  * This file contains the s390 architecture specific module code.
  */
@@ -28,19 +31,4 @@ struct mod_arch_specific
        struct mod_arch_syminfo *syminfo;
 };
 
-#ifdef CONFIG_64BIT
-#define ElfW(x) Elf64_ ## x
-#define ELFW(x) ELF64_ ## x
-#else
-#define ElfW(x) Elf32_ ## x
-#define ELFW(x) ELF32_ ## x
-#endif
-
-#define Elf_Addr ElfW(Addr)
-#define Elf_Rela ElfW(Rela)
-#define Elf_Shdr ElfW(Shdr)
-#define Elf_Sym ElfW(Sym)
-#define Elf_Ehdr ElfW(Ehdr)
-#define ELF_R_SYM ELFW(R_SYM)
-#define ELF_R_TYPE ELFW(R_TYPE)
 #endif /* _ASM_S390_MODULE_H */
index 461c23747491a85372b9e34f26ed4c61971767a0..4f93a431a45a8142133ae655bff700de79f7e254 100644 (file)
@@ -11,6 +11,8 @@ config SCORE
        select ARCH_DISCARD_MEMBLOCK
        select GENERIC_CPU_DEVICES
        select GENERIC_CLOCKEVENTS
+       select HAVE_MOD_ARCH_SPECIFIC
+       select MODULES_USE_ELF_REL
 
 choice
        prompt "System type"
index f0b5dc0bd023d738ee80f7fb936f1a5e681c330d..abf395bbfabadc23524e36cb169511a088563007 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/list.h>
 #include <asm/uaccess.h>
+#include <asm-generic/module.h>
 
 struct mod_arch_specific {
        /* Data Bus Error exception tables */
@@ -13,11 +14,6 @@ struct mod_arch_specific {
 
 typedef uint8_t Elf64_Byte;            /* Type for a 8-bit quantity. */
 
-#define Elf_Shdr       Elf32_Shdr
-#define Elf_Sym                Elf32_Sym
-#define Elf_Ehdr       Elf32_Ehdr
-#define Elf_Addr       Elf32_Addr
-
 /* Given an address, look for it in the exception tables. */
 #ifdef CONFIG_MODULES
 const struct exception_table_entry *search_module_dbetables(unsigned long addr);
index 469e3b64e2f26aa760a307d68827eacc0768df21..1378d99baa3d5744464ab4aa1f50591769ddc9a4 100644 (file)
@@ -125,16 +125,6 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
        return 0;
 }
 
-int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
-               unsigned int symindex, unsigned int relsec,
-               struct module *me)
-{
-       /* Non-standard return value... most other arch's return -ENOEXEC
-        * for an unsupported relocation variant
-        */
-       return 0;
-}
-
 /* Given an address, look for it in the module exception tables. */
 const struct exception_table_entry *search_module_dbetables(unsigned long addr)
 {
index 3b3e27a3ff2c343e5e6552dc3e0f600edf879e68..babc2b826c5caf5f26f9a029452e5067451190c1 100644 (file)
@@ -38,6 +38,8 @@ config SUPERH
        select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
+       select MODULES_USE_ELF_RELA
        help
          The SuperH is a RISC processor targeted for use in embedded systems
          and consumer electronics; it was also used in the Sega Dreamcast
index b7927de86f9fcfb9d220abfd03872d06307cf149..81300d8b5448c35e85ed1f895e054a1b73492550 100644 (file)
@@ -1,21 +1,13 @@
 #ifndef _ASM_SH_MODULE_H
 #define _ASM_SH_MODULE_H
 
-struct mod_arch_specific {
+#include <asm-generic/module.h>
+
 #ifdef CONFIG_DWARF_UNWINDER
+struct mod_arch_specific {
        struct list_head fde_list;
        struct list_head cie_list;
-#endif
 };
-
-#ifdef CONFIG_64BIT
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Sym Elf64_Sym
-#define Elf_Ehdr Elf64_Ehdr
-#else
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
 #endif
 
 #ifdef CONFIG_CPU_LITTLE_ENDIAN
index 91c780c973ba3b2b6e863330574115302ff8b783..b6b442b0d793daeff8caea90418458618a7ce506 100644 (file)
@@ -39,6 +39,7 @@ config SPARC
        select GENERIC_CLOCKEVENTS
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
+       select MODULES_USE_ELF_RELA
 
 config SPARC32
        def_bool !64BIT
index 10d54e5e37f5c01d51b68218710fa0b062932b59..645a58da0e8601cf0765db0a2fc4091199da702b 100644 (file)
@@ -7,4 +7,5 @@ generic-y += exec.h
 generic-y += local64.h
 generic-y += irq_regs.h
 generic-y += local.h
+generic-y += module.h
 generic-y += word-at-a-time.h
diff --git a/arch/sparc/include/asm/module.h b/arch/sparc/include/asm/module.h
deleted file mode 100644 (file)
index ff8e02d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __SPARC_MODULE_H
-#define __SPARC_MODULE_H
-struct mod_arch_specific { };
-
-/*
- * Use some preprocessor magic to define the correct symbol
- * for sparc32 and sparc64.
- * Elf_Addr becomes Elf32_Addr for sparc32 and Elf64_Addr for sparc64
- */
-#define ___ELF(a, b, c) a##b##c
-#define __ELF(a, b, c)  ___ELF(a, b, c)
-#define  _Elf(t)        __ELF(Elf, CONFIG_BITS, t)
-#define  _ELF(t)        __ELF(ELF, CONFIG_BITS, t)
-
-#define Elf_Shdr     _Elf(_Shdr)
-#define Elf_Sym      _Elf(_Sym)
-#define Elf_Ehdr     _Elf(_Ehdr)
-#define Elf_Rela     _Elf(_Rela)
-#define Elf_Addr     _Elf(_Addr)
-
-#define ELF_R_SYM    _ELF(_R_SYM)
-#define ELF_R_TYPE   _ELF(_R_TYPE)
-
-#endif /* __SPARC_MODULE_H */
index dc46490adca043ce634aae948f8f0b1e6ca65628..875d008828b8ec619c295cf1b2d5c8923ea0389b 100644 (file)
@@ -20,6 +20,7 @@ config TILE
        select SYS_HYPERVISOR
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_CLOCKEVENTS
+       select MODULES_USE_ELF_RELA
 
 # FIXME: investigate whether we need/want these options.
 #      select HAVE_IOREMAP_PROT
index 35ee2bf66354e8f1d9bffcea75ba3e444d3e2266..e5c5473e69cea62bc28dcc281e4fb9d1cfcca704 100644 (file)
@@ -15,6 +15,7 @@ config UNICORE32
        select GENERIC_IRQ_SHOW
        select ARCH_WANT_FRAME_POINTERS
        select GENERIC_IOMAP
+       select MODULES_USE_ELF_REL
        help
          UniCore-32 is 32-bit Instruction Set Architecture,
          including a series of low-power-consumption RISC chip
index 70071b19eb989b7926ac0f08c8f6d2431356c919..46c3bff3ced20e31c379bdde1c9a50c95206ff8e 100644 (file)
@@ -110,6 +110,8 @@ config X86
        select HAVE_IRQ_TIME_ACCOUNTING
        select GENERIC_KERNEL_THREAD
        select GENERIC_KERNEL_EXECVE
+       select MODULES_USE_ELF_REL if X86_32
+       select MODULES_USE_ELF_RELA if X86_64
 
 config INSTRUCTION_DECODER
        def_bool y
index ce03476d8c8f6668162af05ae0712be32917b131..ccce0ed67dde703a80c78309252abbef17828291 100644 (file)
@@ -37,7 +37,8 @@ setup-y               += video-bios.o
 targets                += $(setup-y)
 hostprogs-y    := mkcpustr tools/build
 
-HOST_EXTRACFLAGS += -I$(srctree)/tools/include $(USERINCLUDE) \
+HOST_EXTRACFLAGS += -I$(srctree)/tools/include \
+                   -include include/generated/autoconf.h \
                    -D__EXPORTED_HEADERS__
 
 $(obj)/cpu.o: $(obj)/cpustr.h
index 9fa950df80e54ff6d6aa661e3c7e9c6bbe049d2b..07611759ce35b4cdcd298b402c22d39ada73e39a 100644 (file)
@@ -24,9 +24,11 @@ config X86_32
        def_bool !64BIT
        select HAVE_AOUT
        select ARCH_WANT_IPC_PARSE_VERSION
+       select MODULES_USE_ELF_REL
 
 config X86_64
        def_bool 64BIT
+       select MODULES_USE_ELF_RELA
 
 config RWSEM_XCHGADD_ALGORITHM
        def_bool X86_XADD && 64BIT
index d9b34bee4d4255955bb0fae7340eb135a43158c4..488b40c6f9b9aa89fcf0cce02d33e9bd6bfa6274 100644 (file)
 #ifndef _XTENSA_MODULE_H
 #define _XTENSA_MODULE_H
 
-struct mod_arch_specific
-{
-       /* No special elements, yet. */
-};
-
 #define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
 
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
+#include <asm-generic/module.h>
 
 #endif /* _XTENSA_MODULE_H */
index 50402dc0ea353d6b8b31f9042e757efcf404eb18..6563366bae809f8e5b052e003ad42c6c2f2adb33 100644 (file)
@@ -1216,5 +1216,6 @@ config CRYPTO_USER_API_SKCIPHER
          key cipher algorithms.
 
 source "drivers/crypto/Kconfig"
+source crypto/asymmetric_keys/Kconfig
 
 endif  # if CRYPTO
index a301ad2b258c0cdbee39dbfecb1684235a6e0a48..8cf61ffe35138af8c8d5e139c0a0798beb7a119b 100644 (file)
@@ -97,3 +97,4 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
 #
 obj-$(CONFIG_XOR_BLOCKS) += xor.o
 obj-$(CONFIG_ASYNC_CORE) += async_tx/
+obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
diff --git a/crypto/asymmetric_keys/.gitignore b/crypto/asymmetric_keys/.gitignore
new file mode 100644 (file)
index 0000000..ee32837
--- /dev/null
@@ -0,0 +1 @@
+*-asn1.[ch]
diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig
new file mode 100644 (file)
index 0000000..6d2c2ea
--- /dev/null
@@ -0,0 +1,38 @@
+menuconfig ASYMMETRIC_KEY_TYPE
+       tristate "Asymmetric (public-key cryptographic) key type"
+       depends on KEYS
+       help
+         This option provides support for a key type that holds the data for
+         the asymmetric keys used for public key cryptographic operations such
+         as encryption, decryption, signature generation and signature
+         verification.
+
+if ASYMMETRIC_KEY_TYPE
+
+config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       tristate "Asymmetric public-key crypto algorithm subtype"
+       select MPILIB
+       help
+         This option provides support for asymmetric public key type handling.
+         If signature generation and/or verification are to be used,
+         appropriate hash algorithms (such as SHA-1) must be available.
+         ENOPKG will be reported if the requisite algorithm is unavailable.
+
+config PUBLIC_KEY_ALGO_RSA
+       tristate "RSA public-key algorithm"
+       depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       select MPILIB_EXTRA
+       help
+         This option enables support for the RSA algorithm (PKCS#1, RFC3447).
+
+config X509_CERTIFICATE_PARSER
+       tristate "X.509 certificate parser"
+       depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       select ASN1
+       select OID_REGISTRY
+       help
+         This option procides support for parsing X.509 format blobs for key
+         data and provides the ability to instantiate a crypto key from a
+         public key packet found inside the certificate.
+
+endif # ASYMMETRIC_KEY_TYPE
diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile
new file mode 100644 (file)
index 0000000..0727204
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Makefile for asymmetric cryptographic keys
+#
+
+obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys.o
+
+asymmetric_keys-y := asymmetric_type.o signature.o
+
+obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o
+obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o
+
+#
+# X.509 Certificate handling
+#
+obj-$(CONFIG_X509_CERTIFICATE_PARSER) += x509_key_parser.o
+x509_key_parser-y := \
+       x509-asn1.o \
+       x509_rsakey-asn1.o \
+       x509_cert_parser.o \
+       x509_public_key.o
+
+$(obj)/x509_cert_parser.o: $(obj)/x509-asn1.h $(obj)/x509_rsakey-asn1.h
+$(obj)/x509-asn1.o: $(obj)/x509-asn1.c $(obj)/x509-asn1.h
+$(obj)/x509_rsakey-asn1.o: $(obj)/x509_rsakey-asn1.c $(obj)/x509_rsakey-asn1.h
+
+clean-files    += x509-asn1.c x509-asn1.h
+clean-files    += x509_rsakey-asn1.c x509_rsakey-asn1.h
diff --git a/crypto/asymmetric_keys/asymmetric_keys.h b/crypto/asymmetric_keys/asymmetric_keys.h
new file mode 100644 (file)
index 0000000..515b634
--- /dev/null
@@ -0,0 +1,15 @@
+/* Internal definitions for asymmetric key type
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+static inline const char *asymmetric_key_id(const struct key *key)
+{
+       return key->type_data.p[1];
+}
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
new file mode 100644 (file)
index 0000000..cf80765
--- /dev/null
@@ -0,0 +1,274 @@
+/* Asymmetric public-key cryptography key type
+ *
+ * See Documentation/security/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+#include <keys/asymmetric-subtype.h>
+#include <keys/asymmetric-parser.h>
+#include <linux/seq_file.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include "asymmetric_keys.h"
+
+MODULE_LICENSE("GPL");
+
+static LIST_HEAD(asymmetric_key_parsers);
+static DECLARE_RWSEM(asymmetric_key_parsers_sem);
+
+/*
+ * Match asymmetric keys on (part of) their name
+ * We have some shorthand methods for matching keys.  We allow:
+ *
+ *     "<desc>"        - request a key by description
+ *     "id:<id>"       - request a key matching the ID
+ *     "<subtype>:<id>" - request a key of a subtype
+ */
+static int asymmetric_key_match(const struct key *key, const void *description)
+{
+       const struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
+       const char *spec = description;
+       const char *id, *kid;
+       ptrdiff_t speclen;
+       size_t idlen, kidlen;
+
+       if (!subtype || !spec || !*spec)
+               return 0;
+
+       /* See if the full key description matches as is */
+       if (key->description && strcmp(key->description, description) == 0)
+               return 1;
+
+       /* All tests from here on break the criterion description into a
+        * specifier, a colon and then an identifier.
+        */
+       id = strchr(spec, ':');
+       if (!id)
+               return 0;
+
+       speclen = id - spec;
+       id++;
+
+       /* Anything after here requires a partial match on the ID string */
+       kid = asymmetric_key_id(key);
+       if (!kid)
+               return 0;
+
+       idlen = strlen(id);
+       kidlen = strlen(kid);
+       if (idlen > kidlen)
+               return 0;
+
+       kid += kidlen - idlen;
+       if (strcasecmp(id, kid) != 0)
+               return 0;
+
+       if (speclen == 2 &&
+           memcmp(spec, "id", 2) == 0)
+               return 1;
+
+       if (speclen == subtype->name_len &&
+           memcmp(spec, subtype->name, speclen) == 0)
+               return 1;
+
+       return 0;
+}
+
+/*
+ * Describe the asymmetric key
+ */
+static void asymmetric_key_describe(const struct key *key, struct seq_file *m)
+{
+       const struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
+       const char *kid = asymmetric_key_id(key);
+       size_t n;
+
+       seq_puts(m, key->description);
+
+       if (subtype) {
+               seq_puts(m, ": ");
+               subtype->describe(key, m);
+
+               if (kid) {
+                       seq_putc(m, ' ');
+                       n = strlen(kid);
+                       if (n <= 8)
+                               seq_puts(m, kid);
+                       else
+                               seq_puts(m, kid + n - 8);
+               }
+
+               seq_puts(m, " [");
+               /* put something here to indicate the key's capabilities */
+               seq_putc(m, ']');
+       }
+}
+
+/*
+ * Preparse a asymmetric payload to get format the contents appropriately for the
+ * internal payload to cut down on the number of scans of the data performed.
+ *
+ * We also generate a proposed description from the contents of the key that
+ * can be used to name the key if the user doesn't want to provide one.
+ */
+static int asymmetric_key_preparse(struct key_preparsed_payload *prep)
+{
+       struct asymmetric_key_parser *parser;
+       int ret;
+
+       pr_devel("==>%s()\n", __func__);
+
+       if (prep->datalen == 0)
+               return -EINVAL;
+
+       down_read(&asymmetric_key_parsers_sem);
+
+       ret = -EBADMSG;
+       list_for_each_entry(parser, &asymmetric_key_parsers, link) {
+               pr_debug("Trying parser '%s'\n", parser->name);
+
+               ret = parser->parse(prep);
+               if (ret != -EBADMSG) {
+                       pr_debug("Parser recognised the format (ret %d)\n",
+                                ret);
+                       break;
+               }
+       }
+
+       up_read(&asymmetric_key_parsers_sem);
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ret;
+}
+
+/*
+ * Clean up the preparse data
+ */
+static void asymmetric_key_free_preparse(struct key_preparsed_payload *prep)
+{
+       struct asymmetric_key_subtype *subtype = prep->type_data[0];
+
+       pr_devel("==>%s()\n", __func__);
+
+       if (subtype) {
+               subtype->destroy(prep->payload);
+               module_put(subtype->owner);
+       }
+       kfree(prep->type_data[1]);
+       kfree(prep->description);
+}
+
+/*
+ * Instantiate a asymmetric_key defined key.  The key was preparsed, so we just
+ * have to transfer the data here.
+ */
+static int asymmetric_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
+{
+       int ret;
+
+       pr_devel("==>%s()\n", __func__);
+
+       ret = key_payload_reserve(key, prep->quotalen);
+       if (ret == 0) {
+               key->type_data.p[0] = prep->type_data[0];
+               key->type_data.p[1] = prep->type_data[1];
+               key->payload.data = prep->payload;
+               prep->type_data[0] = NULL;
+               prep->type_data[1] = NULL;
+               prep->payload = NULL;
+       }
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ret;
+}
+
+/*
+ * dispose of the data dangling from the corpse of a asymmetric key
+ */
+static void asymmetric_key_destroy(struct key *key)
+{
+       struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
+       if (subtype) {
+               subtype->destroy(key->payload.data);
+               module_put(subtype->owner);
+               key->type_data.p[0] = NULL;
+       }
+       kfree(key->type_data.p[1]);
+       key->type_data.p[1] = NULL;
+}
+
+struct key_type key_type_asymmetric = {
+       .name           = "asymmetric",
+       .preparse       = asymmetric_key_preparse,
+       .free_preparse  = asymmetric_key_free_preparse,
+       .instantiate    = asymmetric_key_instantiate,
+       .match          = asymmetric_key_match,
+       .destroy        = asymmetric_key_destroy,
+       .describe       = asymmetric_key_describe,
+};
+EXPORT_SYMBOL_GPL(key_type_asymmetric);
+
+/**
+ * register_asymmetric_key_parser - Register a asymmetric key blob parser
+ * @parser: The parser to register
+ */
+int register_asymmetric_key_parser(struct asymmetric_key_parser *parser)
+{
+       struct asymmetric_key_parser *cursor;
+       int ret;
+
+       down_write(&asymmetric_key_parsers_sem);
+
+       list_for_each_entry(cursor, &asymmetric_key_parsers, link) {
+               if (strcmp(cursor->name, parser->name) == 0) {
+                       pr_err("Asymmetric key parser '%s' already registered\n",
+                              parser->name);
+                       ret = -EEXIST;
+                       goto out;
+               }
+       }
+
+       list_add_tail(&parser->link, &asymmetric_key_parsers);
+
+       pr_notice("Asymmetric key parser '%s' registered\n", parser->name);
+       ret = 0;
+
+out:
+       up_write(&asymmetric_key_parsers_sem);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(register_asymmetric_key_parser);
+
+/**
+ * unregister_asymmetric_key_parser - Unregister a asymmetric key blob parser
+ * @parser: The parser to unregister
+ */
+void unregister_asymmetric_key_parser(struct asymmetric_key_parser *parser)
+{
+       down_write(&asymmetric_key_parsers_sem);
+       list_del(&parser->link);
+       up_write(&asymmetric_key_parsers_sem);
+
+       pr_notice("Asymmetric key parser '%s' unregistered\n", parser->name);
+}
+EXPORT_SYMBOL_GPL(unregister_asymmetric_key_parser);
+
+/*
+ * Module stuff
+ */
+static int __init asymmetric_key_init(void)
+{
+       return register_key_type(&key_type_asymmetric);
+}
+
+static void __exit asymmetric_key_cleanup(void)
+{
+       unregister_key_type(&key_type_asymmetric);
+}
+
+module_init(asymmetric_key_init);
+module_exit(asymmetric_key_cleanup);
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
new file mode 100644 (file)
index 0000000..cb2e291
--- /dev/null
@@ -0,0 +1,108 @@
+/* In-software asymmetric public-key crypto subtype
+ *
+ * See Documentation/crypto/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#define pr_fmt(fmt) "PKEY: "fmt
+#include <linux/module.h>
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/seq_file.h>
+#include <keys/asymmetric-subtype.h>
+#include "public_key.h"
+
+MODULE_LICENSE("GPL");
+
+const char *const pkey_algo[PKEY_ALGO__LAST] = {
+       [PKEY_ALGO_DSA]         = "DSA",
+       [PKEY_ALGO_RSA]         = "RSA",
+};
+EXPORT_SYMBOL_GPL(pkey_algo);
+
+const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
+       [PKEY_HASH_MD4]         = "md4",
+       [PKEY_HASH_MD5]         = "md5",
+       [PKEY_HASH_SHA1]        = "sha1",
+       [PKEY_HASH_RIPE_MD_160] = "rmd160",
+       [PKEY_HASH_SHA256]      = "sha256",
+       [PKEY_HASH_SHA384]      = "sha384",
+       [PKEY_HASH_SHA512]      = "sha512",
+       [PKEY_HASH_SHA224]      = "sha224",
+};
+EXPORT_SYMBOL_GPL(pkey_hash_algo);
+
+const char *const pkey_id_type[PKEY_ID_TYPE__LAST] = {
+       [PKEY_ID_PGP]           = "PGP",
+       [PKEY_ID_X509]          = "X509",
+};
+EXPORT_SYMBOL_GPL(pkey_id_type);
+
+/*
+ * Provide a part of a description of the key for /proc/keys.
+ */
+static void public_key_describe(const struct key *asymmetric_key,
+                               struct seq_file *m)
+{
+       struct public_key *key = asymmetric_key->payload.data;
+
+       if (key)
+               seq_printf(m, "%s.%s",
+                          pkey_id_type[key->id_type], key->algo->name);
+}
+
+/*
+ * Destroy a public key algorithm key.
+ */
+void public_key_destroy(void *payload)
+{
+       struct public_key *key = payload;
+       int i;
+
+       if (key) {
+               for (i = 0; i < ARRAY_SIZE(key->mpi); i++)
+                       mpi_free(key->mpi[i]);
+               kfree(key);
+       }
+}
+EXPORT_SYMBOL_GPL(public_key_destroy);
+
+/*
+ * Verify a signature using a public key.
+ */
+static int public_key_verify_signature(const struct key *key,
+                                      const struct public_key_signature *sig)
+{
+       const struct public_key *pk = key->payload.data;
+
+       if (!pk->algo->verify_signature)
+               return -ENOTSUPP;
+
+       if (sig->nr_mpi != pk->algo->n_sig_mpi) {
+               pr_debug("Signature has %u MPI not %u\n",
+                        sig->nr_mpi, pk->algo->n_sig_mpi);
+               return -EINVAL;
+       }
+
+       return pk->algo->verify_signature(pk, sig);
+}
+
+/*
+ * Public key algorithm asymmetric key subtype
+ */
+struct asymmetric_key_subtype public_key_subtype = {
+       .owner                  = THIS_MODULE,
+       .name                   = "public_key",
+       .describe               = public_key_describe,
+       .destroy                = public_key_destroy,
+       .verify_signature       = public_key_verify_signature,
+};
+EXPORT_SYMBOL_GPL(public_key_subtype);
diff --git a/crypto/asymmetric_keys/public_key.h b/crypto/asymmetric_keys/public_key.h
new file mode 100644 (file)
index 0000000..5e5e356
--- /dev/null
@@ -0,0 +1,30 @@
+/* Public key algorithm internals
+ *
+ * See Documentation/crypto/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <crypto/public_key.h>
+
+extern struct asymmetric_key_subtype public_key_subtype;
+
+/*
+ * Public key algorithm definition.
+ */
+struct public_key_algorithm {
+       const char      *name;
+       u8              n_pub_mpi;      /* Number of MPIs in public key */
+       u8              n_sec_mpi;      /* Number of MPIs in secret key */
+       u8              n_sig_mpi;      /* Number of MPIs in a signature */
+       int (*verify_signature)(const struct public_key *key,
+                               const struct public_key_signature *sig);
+};
+
+extern const struct public_key_algorithm RSA_public_key_algorithm;
diff --git a/crypto/asymmetric_keys/rsa.c b/crypto/asymmetric_keys/rsa.c
new file mode 100644 (file)
index 0000000..4a6a069
--- /dev/null
@@ -0,0 +1,277 @@
+/* RSA asymmetric public-key algorithm [RFC3447]
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#define pr_fmt(fmt) "RSA: "fmt
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include "public_key.h"
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("RSA Public Key Algorithm");
+
+#define kenter(FMT, ...) \
+       pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
+#define kleave(FMT, ...) \
+       pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
+
+/*
+ * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2].
+ */
+static const u8 RSA_digest_info_MD5[] = {
+       0x30, 0x20, 0x30, 0x0C, 0x06, 0x08,
+       0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, /* OID */
+       0x05, 0x00, 0x04, 0x10
+};
+
+static const u8 RSA_digest_info_SHA1[] = {
+       0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
+       0x2B, 0x0E, 0x03, 0x02, 0x1A,
+       0x05, 0x00, 0x04, 0x14
+};
+
+static const u8 RSA_digest_info_RIPE_MD_160[] = {
+       0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
+       0x2B, 0x24, 0x03, 0x02, 0x01,
+       0x05, 0x00, 0x04, 0x14
+};
+
+static const u8 RSA_digest_info_SHA224[] = {
+       0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09,
+       0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04,
+       0x05, 0x00, 0x04, 0x1C
+};
+
+static const u8 RSA_digest_info_SHA256[] = {
+       0x30, 0x31, 0x30, 0x0d, 0x06, 0x09,
+       0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01,
+       0x05, 0x00, 0x04, 0x20
+};
+
+static const u8 RSA_digest_info_SHA384[] = {
+       0x30, 0x41, 0x30, 0x0d, 0x06, 0x09,
+       0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02,
+       0x05, 0x00, 0x04, 0x30
+};
+
+static const u8 RSA_digest_info_SHA512[] = {
+       0x30, 0x51, 0x30, 0x0d, 0x06, 0x09,
+       0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03,
+       0x05, 0x00, 0x04, 0x40
+};
+
+static const struct {
+       const u8 *data;
+       size_t size;
+} RSA_ASN1_templates[PKEY_HASH__LAST] = {
+#define _(X) { RSA_digest_info_##X, sizeof(RSA_digest_info_##X) }
+       [PKEY_HASH_MD5]         = _(MD5),
+       [PKEY_HASH_SHA1]        = _(SHA1),
+       [PKEY_HASH_RIPE_MD_160] = _(RIPE_MD_160),
+       [PKEY_HASH_SHA256]      = _(SHA256),
+       [PKEY_HASH_SHA384]      = _(SHA384),
+       [PKEY_HASH_SHA512]      = _(SHA512),
+       [PKEY_HASH_SHA224]      = _(SHA224),
+#undef _
+};
+
+/*
+ * RSAVP1() function [RFC3447 sec 5.2.2]
+ */
+static int RSAVP1(const struct public_key *key, MPI s, MPI *_m)
+{
+       MPI m;
+       int ret;
+
+       /* (1) Validate 0 <= s < n */
+       if (mpi_cmp_ui(s, 0) < 0) {
+               kleave(" = -EBADMSG [s < 0]");
+               return -EBADMSG;
+       }
+       if (mpi_cmp(s, key->rsa.n) >= 0) {
+               kleave(" = -EBADMSG [s >= n]");
+               return -EBADMSG;
+       }
+
+       m = mpi_alloc(0);
+       if (!m)
+               return -ENOMEM;
+
+       /* (2) m = s^e mod n */
+       ret = mpi_powm(m, s, key->rsa.e, key->rsa.n);
+       if (ret < 0) {
+               mpi_free(m);
+               return ret;
+       }
+
+       *_m = m;
+       return 0;
+}
+
+/*
+ * Integer to Octet String conversion [RFC3447 sec 4.1]
+ */
+static int RSA_I2OSP(MPI x, size_t xLen, u8 **_X)
+{
+       unsigned X_size, x_size;
+       int X_sign;
+       u8 *X;
+
+       /* Make sure the string is the right length.  The number should begin
+        * with { 0x00, 0x01, ... } so we have to account for 15 leading zero
+        * bits not being reported by MPI.
+        */
+       x_size = mpi_get_nbits(x);
+       pr_devel("size(x)=%u xLen*8=%zu\n", x_size, xLen * 8);
+       if (x_size != xLen * 8 - 15)
+               return -ERANGE;
+
+       X = mpi_get_buffer(x, &X_size, &X_sign);
+       if (!X)
+               return -ENOMEM;
+       if (X_sign < 0) {
+               kfree(X);
+               return -EBADMSG;
+       }
+       if (X_size != xLen - 1) {
+               kfree(X);
+               return -EBADMSG;
+       }
+
+       *_X = X;
+       return 0;
+}
+
+/*
+ * Perform the RSA signature verification.
+ * @H: Value of hash of data and metadata
+ * @EM: The computed signature value
+ * @k: The size of EM (EM[0] is an invalid location but should hold 0x00)
+ * @hash_size: The size of H
+ * @asn1_template: The DigestInfo ASN.1 template
+ * @asn1_size: Size of asm1_template[]
+ */
+static int RSA_verify(const u8 *H, const u8 *EM, size_t k, size_t hash_size,
+                     const u8 *asn1_template, size_t asn1_size)
+{
+       unsigned PS_end, T_offset, i;
+
+       kenter(",,%zu,%zu,%zu", k, hash_size, asn1_size);
+
+       if (k < 2 + 1 + asn1_size + hash_size)
+               return -EBADMSG;
+
+       /* Decode the EMSA-PKCS1-v1_5 */
+       if (EM[1] != 0x01) {
+               kleave(" = -EBADMSG [EM[1] == %02u]", EM[1]);
+               return -EBADMSG;
+       }
+
+       T_offset = k - (asn1_size + hash_size);
+       PS_end = T_offset - 1;
+       if (EM[PS_end] != 0x00) {
+               kleave(" = -EBADMSG [EM[T-1] == %02u]", EM[PS_end]);
+               return -EBADMSG;
+       }
+
+       for (i = 2; i < PS_end; i++) {
+               if (EM[i] != 0xff) {
+                       kleave(" = -EBADMSG [EM[PS%x] == %02u]", i - 2, EM[i]);
+                       return -EBADMSG;
+               }
+       }
+
+       if (memcmp(asn1_template, EM + T_offset, asn1_size) != 0) {
+               kleave(" = -EBADMSG [EM[T] ASN.1 mismatch]");
+               return -EBADMSG;
+       }
+
+       if (memcmp(H, EM + T_offset + asn1_size, hash_size) != 0) {
+               kleave(" = -EKEYREJECTED [EM[T] hash mismatch]");
+               return -EKEYREJECTED;
+       }
+
+       kleave(" = 0");
+       return 0;
+}
+
+/*
+ * Perform the verification step [RFC3447 sec 8.2.2].
+ */
+static int RSA_verify_signature(const struct public_key *key,
+                               const struct public_key_signature *sig)
+{
+       size_t tsize;
+       int ret;
+
+       /* Variables as per RFC3447 sec 8.2.2 */
+       const u8 *H = sig->digest;
+       u8 *EM = NULL;
+       MPI m = NULL;
+       size_t k;
+
+       kenter("");
+
+       if (!RSA_ASN1_templates[sig->pkey_hash_algo].data)
+               return -ENOTSUPP;
+
+       /* (1) Check the signature size against the public key modulus size */
+       k = mpi_get_nbits(key->rsa.n);
+       tsize = mpi_get_nbits(sig->rsa.s);
+
+       /* According to RFC 4880 sec 3.2, length of MPI is computed starting
+        * from most significant bit.  So the RFC 3447 sec 8.2.2 size check
+        * must be relaxed to conform with shorter signatures - so we fail here
+        * only if signature length is longer than modulus size.
+        */
+       pr_devel("step 1: k=%zu size(S)=%zu\n", k, tsize);
+       if (k < tsize) {
+               ret = -EBADMSG;
+               goto error;
+       }
+
+       /* Round up and convert to octets */
+       k = (k + 7) / 8;
+
+       /* (2b) Apply the RSAVP1 verification primitive to the public key */
+       ret = RSAVP1(key, sig->rsa.s, &m);
+       if (ret < 0)
+               goto error;
+
+       /* (2c) Convert the message representative (m) to an encoded message
+        *      (EM) of length k octets.
+        *
+        *      NOTE!  The leading zero byte is suppressed by MPI, so we pass a
+        *      pointer to the _preceding_ byte to RSA_verify()!
+        */
+       ret = RSA_I2OSP(m, k, &EM);
+       if (ret < 0)
+               goto error;
+
+       ret = RSA_verify(H, EM - 1, k, sig->digest_size,
+                        RSA_ASN1_templates[sig->pkey_hash_algo].data,
+                        RSA_ASN1_templates[sig->pkey_hash_algo].size);
+
+error:
+       kfree(EM);
+       mpi_free(m);
+       kleave(" = %d", ret);
+       return ret;
+}
+
+const struct public_key_algorithm RSA_public_key_algorithm = {
+       .name           = "RSA",
+       .n_pub_mpi      = 2,
+       .n_sec_mpi      = 3,
+       .n_sig_mpi      = 1,
+       .verify_signature = RSA_verify_signature,
+};
+EXPORT_SYMBOL_GPL(RSA_public_key_algorithm);
diff --git a/crypto/asymmetric_keys/signature.c b/crypto/asymmetric_keys/signature.c
new file mode 100644 (file)
index 0000000..50b3f88
--- /dev/null
@@ -0,0 +1,49 @@
+/* Signature verification with an asymmetric key
+ *
+ * See Documentation/security/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <keys/asymmetric-subtype.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <crypto/public_key.h>
+#include "asymmetric_keys.h"
+
+/**
+ * verify_signature - Initiate the use of an asymmetric key to verify a signature
+ * @key: The asymmetric key to verify against
+ * @sig: The signature to check
+ *
+ * Returns 0 if successful or else an error.
+ */
+int verify_signature(const struct key *key,
+                    const struct public_key_signature *sig)
+{
+       const struct asymmetric_key_subtype *subtype;
+       int ret;
+
+       pr_devel("==>%s()\n", __func__);
+
+       if (key->type != &key_type_asymmetric)
+               return -EINVAL;
+       subtype = asymmetric_key_subtype(key);
+       if (!subtype ||
+           !key->payload.data)
+               return -EINVAL;
+       if (!subtype->verify_signature)
+               return -ENOTSUPP;
+
+       ret = subtype->verify_signature(key, sig);
+
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(verify_signature);
diff --git a/crypto/asymmetric_keys/x509.asn1 b/crypto/asymmetric_keys/x509.asn1
new file mode 100644 (file)
index 0000000..bf32b3d
--- /dev/null
@@ -0,0 +1,60 @@
+Certificate ::= SEQUENCE {
+       tbsCertificate          TBSCertificate ({ x509_note_tbs_certificate }),
+       signatureAlgorithm      AlgorithmIdentifier,
+       signature               BIT STRING ({ x509_note_signature })
+       }
+
+TBSCertificate ::= SEQUENCE {
+       version           [ 0 ] Version DEFAULT,
+       serialNumber            CertificateSerialNumber,
+       signature               AlgorithmIdentifier ({ x509_note_pkey_algo }),
+       issuer                  Name ({ x509_note_issuer }),
+       validity                Validity,
+       subject                 Name ({ x509_note_subject }),
+       subjectPublicKeyInfo    SubjectPublicKeyInfo,
+       issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
+       subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
+       extensions        [ 3 ] Extensions OPTIONAL
+       }
+
+Version ::= INTEGER
+CertificateSerialNumber ::= INTEGER
+
+AlgorithmIdentifier ::= SEQUENCE {
+       algorithm               OBJECT IDENTIFIER ({ x509_note_OID }),
+       parameters              ANY OPTIONAL
+}
+
+Name ::= SEQUENCE OF RelativeDistinguishedName
+
+RelativeDistinguishedName ::= SET OF AttributeValueAssertion
+
+AttributeValueAssertion ::= SEQUENCE {
+       attributeType           OBJECT IDENTIFIER ({ x509_note_OID }),
+       attributeValue          ANY ({ x509_extract_name_segment })
+       }
+
+Validity ::= SEQUENCE {
+       notBefore               Time ({ x509_note_not_before }),
+       notAfter                Time ({ x509_note_not_after })
+       }
+
+Time ::= CHOICE {
+       utcTime                 UTCTime,
+       generalTime             GeneralizedTime
+       }
+
+SubjectPublicKeyInfo ::= SEQUENCE {
+       algorithm               AlgorithmIdentifier,
+       subjectPublicKey        BIT STRING ({ x509_extract_key_data })
+       }
+
+UniqueIdentifier ::= BIT STRING
+
+Extensions ::= SEQUENCE OF Extension
+
+Extension ::= SEQUENCE {
+       extnid                  OBJECT IDENTIFIER ({ x509_note_OID }),
+       critical                BOOLEAN DEFAULT,
+       extnValue               OCTET STRING ({ x509_process_extension })
+       }
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
new file mode 100644 (file)
index 0000000..7fabc4c
--- /dev/null
@@ -0,0 +1,496 @@
+/* X.509 certificate parser
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#define pr_fmt(fmt) "X.509: "fmt
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/oid_registry.h>
+#include "public_key.h"
+#include "x509_parser.h"
+#include "x509-asn1.h"
+#include "x509_rsakey-asn1.h"
+
+struct x509_parse_context {
+       struct x509_certificate *cert;          /* Certificate being constructed */
+       unsigned long   data;                   /* Start of data */
+       const void      *cert_start;            /* Start of cert content */
+       const void      *key;                   /* Key data */
+       size_t          key_size;               /* Size of key data */
+       enum OID        last_oid;               /* Last OID encountered */
+       enum OID        algo_oid;               /* Algorithm OID */
+       unsigned char   nr_mpi;                 /* Number of MPIs stored */
+       u8              o_size;                 /* Size of organizationName (O) */
+       u8              cn_size;                /* Size of commonName (CN) */
+       u8              email_size;             /* Size of emailAddress */
+       u16             o_offset;               /* Offset of organizationName (O) */
+       u16             cn_offset;              /* Offset of commonName (CN) */
+       u16             email_offset;           /* Offset of emailAddress */
+};
+
+/*
+ * Free an X.509 certificate
+ */
+void x509_free_certificate(struct x509_certificate *cert)
+{
+       if (cert) {
+               public_key_destroy(cert->pub);
+               kfree(cert->issuer);
+               kfree(cert->subject);
+               kfree(cert->fingerprint);
+               kfree(cert->authority);
+               kfree(cert);
+       }
+}
+
+/*
+ * Parse an X.509 certificate
+ */
+struct x509_certificate *x509_cert_parse(const void *data, size_t datalen)
+{
+       struct x509_certificate *cert;
+       struct x509_parse_context *ctx;
+       long ret;
+
+       ret = -ENOMEM;
+       cert = kzalloc(sizeof(struct x509_certificate), GFP_KERNEL);
+       if (!cert)
+               goto error_no_cert;
+       cert->pub = kzalloc(sizeof(struct public_key), GFP_KERNEL);
+       if (!cert->pub)
+               goto error_no_ctx;
+       ctx = kzalloc(sizeof(struct x509_parse_context), GFP_KERNEL);
+       if (!ctx)
+               goto error_no_ctx;
+
+       ctx->cert = cert;
+       ctx->data = (unsigned long)data;
+
+       /* Attempt to decode the certificate */
+       ret = asn1_ber_decoder(&x509_decoder, ctx, data, datalen);
+       if (ret < 0)
+               goto error_decode;
+
+       /* Decode the public key */
+       ret = asn1_ber_decoder(&x509_rsakey_decoder, ctx,
+                              ctx->key, ctx->key_size);
+       if (ret < 0)
+               goto error_decode;
+
+       kfree(ctx);
+       return cert;
+
+error_decode:
+       kfree(ctx);
+error_no_ctx:
+       x509_free_certificate(cert);
+error_no_cert:
+       return ERR_PTR(ret);
+}
+
+/*
+ * Note an OID when we find one for later processing when we know how
+ * to interpret it.
+ */
+int x509_note_OID(void *context, size_t hdrlen,
+            unsigned char tag,
+            const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       ctx->last_oid = look_up_OID(value, vlen);
+       if (ctx->last_oid == OID__NR) {
+               char buffer[50];
+               sprint_oid(value, vlen, buffer, sizeof(buffer));
+               pr_debug("Unknown OID: [%lu] %s\n",
+                        (unsigned long)value - ctx->data, buffer);
+       }
+       return 0;
+}
+
+/*
+ * Save the position of the TBS data so that we can check the signature over it
+ * later.
+ */
+int x509_note_tbs_certificate(void *context, size_t hdrlen,
+                             unsigned char tag,
+                             const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       pr_debug("x509_note_tbs_certificate(,%zu,%02x,%ld,%zu)!\n",
+                hdrlen, tag, (unsigned long)value - ctx->data, vlen);
+
+       ctx->cert->tbs = value - hdrlen;
+       ctx->cert->tbs_size = vlen + hdrlen;
+       return 0;
+}
+
+/*
+ * Record the public key algorithm
+ */
+int x509_note_pkey_algo(void *context, size_t hdrlen,
+                       unsigned char tag,
+                       const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       pr_debug("PubKey Algo: %u\n", ctx->last_oid);
+
+       switch (ctx->last_oid) {
+       case OID_md2WithRSAEncryption:
+       case OID_md3WithRSAEncryption:
+       default:
+               return -ENOPKG; /* Unsupported combination */
+
+       case OID_md4WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_MD5;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+
+       case OID_sha1WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_SHA1;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+
+       case OID_sha256WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_SHA256;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+
+       case OID_sha384WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_SHA384;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+
+       case OID_sha512WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_SHA512;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+
+       case OID_sha224WithRSAEncryption:
+               ctx->cert->sig_hash_algo = PKEY_HASH_SHA224;
+               ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
+               break;
+       }
+
+       ctx->algo_oid = ctx->last_oid;
+       return 0;
+}
+
+/*
+ * Note the whereabouts and type of the signature.
+ */
+int x509_note_signature(void *context, size_t hdrlen,
+                       unsigned char tag,
+                       const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       pr_debug("Signature type: %u size %zu\n", ctx->last_oid, vlen);
+
+       if (ctx->last_oid != ctx->algo_oid) {
+               pr_warn("Got cert with pkey (%u) and sig (%u) algorithm OIDs\n",
+                       ctx->algo_oid, ctx->last_oid);
+               return -EINVAL;
+       }
+
+       ctx->cert->sig = value;
+       ctx->cert->sig_size = vlen;
+       return 0;
+}
+
+/*
+ * Note some of the name segments from which we'll fabricate a name.
+ */
+int x509_extract_name_segment(void *context, size_t hdrlen,
+                             unsigned char tag,
+                             const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       switch (ctx->last_oid) {
+       case OID_commonName:
+               ctx->cn_size = vlen;
+               ctx->cn_offset = (unsigned long)value - ctx->data;
+               break;
+       case OID_organizationName:
+               ctx->o_size = vlen;
+               ctx->o_offset = (unsigned long)value - ctx->data;
+               break;
+       case OID_email_address:
+               ctx->email_size = vlen;
+               ctx->email_offset = (unsigned long)value - ctx->data;
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+/*
+ * Fabricate and save the issuer and subject names
+ */
+static int x509_fabricate_name(struct x509_parse_context *ctx, size_t hdrlen,
+                              unsigned char tag,
+                              char **_name, size_t vlen)
+{
+       const void *name, *data = (const void *)ctx->data;
+       size_t namesize;
+       char *buffer;
+
+       if (*_name)
+               return -EINVAL;
+
+       /* Empty name string if no material */
+       if (!ctx->cn_size && !ctx->o_size && !ctx->email_size) {
+               buffer = kmalloc(1, GFP_KERNEL);
+               if (!buffer)
+                       return -ENOMEM;
+               buffer[0] = 0;
+               goto done;
+       }
+
+       if (ctx->cn_size && ctx->o_size) {
+               /* Consider combining O and CN, but use only the CN if it is
+                * prefixed by the O, or a significant portion thereof.
+                */
+               namesize = ctx->cn_size;
+               name = data + ctx->cn_offset;
+               if (ctx->cn_size >= ctx->o_size &&
+                   memcmp(data + ctx->cn_offset, data + ctx->o_offset,
+                          ctx->o_size) == 0)
+                       goto single_component;
+               if (ctx->cn_size >= 7 &&
+                   ctx->o_size >= 7 &&
+                   memcmp(data + ctx->cn_offset, data + ctx->o_offset, 7) == 0)
+                       goto single_component;
+
+               buffer = kmalloc(ctx->o_size + 2 + ctx->cn_size + 1,
+                                GFP_KERNEL);
+               if (!buffer)
+                       return -ENOMEM;
+
+               memcpy(buffer,
+                      data + ctx->o_offset, ctx->o_size);
+               buffer[ctx->o_size + 0] = ':';
+               buffer[ctx->o_size + 1] = ' ';
+               memcpy(buffer + ctx->o_size + 2,
+                      data + ctx->cn_offset, ctx->cn_size);
+               buffer[ctx->o_size + 2 + ctx->cn_size] = 0;
+               goto done;
+
+       } else if (ctx->cn_size) {
+               namesize = ctx->cn_size;
+               name = data + ctx->cn_offset;
+       } else if (ctx->o_size) {
+               namesize = ctx->o_size;
+               name = data + ctx->o_offset;
+       } else {
+               namesize = ctx->email_size;
+               name = data + ctx->email_offset;
+       }
+
+single_component:
+       buffer = kmalloc(namesize + 1, GFP_KERNEL);
+       if (!buffer)
+               return -ENOMEM;
+       memcpy(buffer, name, namesize);
+       buffer[namesize] = 0;
+
+done:
+       *_name = buffer;
+       ctx->cn_size = 0;
+       ctx->o_size = 0;
+       ctx->email_size = 0;
+       return 0;
+}
+
+int x509_note_issuer(void *context, size_t hdrlen,
+                    unsigned char tag,
+                    const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       return x509_fabricate_name(ctx, hdrlen, tag, &ctx->cert->issuer, vlen);
+}
+
+int x509_note_subject(void *context, size_t hdrlen,
+                     unsigned char tag,
+                     const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       return x509_fabricate_name(ctx, hdrlen, tag, &ctx->cert->subject, vlen);
+}
+
+/*
+ * Extract the data for the public key algorithm
+ */
+int x509_extract_key_data(void *context, size_t hdrlen,
+                         unsigned char tag,
+                         const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+
+       if (ctx->last_oid != OID_rsaEncryption)
+               return -ENOPKG;
+
+       /* There seems to be an extraneous 0 byte on the front of the data */
+       ctx->cert->pkey_algo = PKEY_ALGO_RSA;
+       ctx->key = value + 1;
+       ctx->key_size = vlen - 1;
+       return 0;
+}
+
+/*
+ * Extract a RSA public key value
+ */
+int rsa_extract_mpi(void *context, size_t hdrlen,
+                   unsigned char tag,
+                   const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       MPI mpi;
+
+       if (ctx->nr_mpi >= ARRAY_SIZE(ctx->cert->pub->mpi)) {
+               pr_err("Too many public key MPIs in certificate\n");
+               return -EBADMSG;
+       }
+
+       mpi = mpi_read_raw_data(value, vlen);
+       if (!mpi)
+               return -ENOMEM;
+
+       ctx->cert->pub->mpi[ctx->nr_mpi++] = mpi;
+       return 0;
+}
+
+/*
+ * Process certificate extensions that are used to qualify the certificate.
+ */
+int x509_process_extension(void *context, size_t hdrlen,
+                          unsigned char tag,
+                          const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       const unsigned char *v = value;
+       char *f;
+       int i;
+
+       pr_debug("Extension: %u\n", ctx->last_oid);
+
+       if (ctx->last_oid == OID_subjectKeyIdentifier) {
+               /* Get hold of the key fingerprint */
+               if (vlen < 3)
+                       return -EBADMSG;
+               if (v[0] != ASN1_OTS || v[1] != vlen - 2)
+                       return -EBADMSG;
+               v += 2;
+               vlen -= 2;
+
+               f = kmalloc(vlen * 2 + 1, GFP_KERNEL);
+               if (!f)
+                       return -ENOMEM;
+               for (i = 0; i < vlen; i++)
+                       sprintf(f + i * 2, "%02x", v[i]);
+               pr_debug("fingerprint %s\n", f);
+               ctx->cert->fingerprint = f;
+               return 0;
+       }
+
+       if (ctx->last_oid == OID_authorityKeyIdentifier) {
+               /* Get hold of the CA key fingerprint */
+               if (vlen < 5)
+                       return -EBADMSG;
+               if (v[0] != (ASN1_SEQ | (ASN1_CONS << 5)) ||
+                   v[1] != vlen - 2 ||
+                   v[2] != (ASN1_CONT << 6) ||
+                   v[3] != vlen - 4)
+                       return -EBADMSG;
+               v += 4;
+               vlen -= 4;
+
+               f = kmalloc(vlen * 2 + 1, GFP_KERNEL);
+               if (!f)
+                       return -ENOMEM;
+               for (i = 0; i < vlen; i++)
+                       sprintf(f + i * 2, "%02x", v[i]);
+               pr_debug("authority   %s\n", f);
+               ctx->cert->authority = f;
+               return 0;
+       }
+
+       return 0;
+}
+
+/*
+ * Record a certificate time.
+ */
+static int x509_note_time(struct tm *tm,  size_t hdrlen,
+                         unsigned char tag,
+                         const unsigned char *value, size_t vlen)
+{
+       const unsigned char *p = value;
+
+#define dec2bin(X) ((X) - '0')
+#define DD2bin(P) ({ unsigned x = dec2bin(P[0]) * 10 + dec2bin(P[1]); P += 2; x; })
+
+       if (tag == ASN1_UNITIM) {
+               /* UTCTime: YYMMDDHHMMSSZ */
+               if (vlen != 13)
+                       goto unsupported_time;
+               tm->tm_year = DD2bin(p);
+               if (tm->tm_year >= 50)
+                       tm->tm_year += 1900;
+               else
+                       tm->tm_year += 2000;
+       } else if (tag == ASN1_GENTIM) {
+               /* GenTime: YYYYMMDDHHMMSSZ */
+               if (vlen != 15)
+                       goto unsupported_time;
+               tm->tm_year = DD2bin(p) * 100 + DD2bin(p);
+       } else {
+               goto unsupported_time;
+       }
+
+       tm->tm_year -= 1900;
+       tm->tm_mon  = DD2bin(p) - 1;
+       tm->tm_mday = DD2bin(p);
+       tm->tm_hour = DD2bin(p);
+       tm->tm_min  = DD2bin(p);
+       tm->tm_sec  = DD2bin(p);
+
+       if (*p != 'Z')
+               goto unsupported_time;
+
+       return 0;
+
+unsupported_time:
+       pr_debug("Got unsupported time [tag %02x]: '%*.*s'\n",
+                tag, (int)vlen, (int)vlen, value);
+       return -EBADMSG;
+}
+
+int x509_note_not_before(void *context, size_t hdrlen,
+                        unsigned char tag,
+                        const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       return x509_note_time(&ctx->cert->valid_from, hdrlen, tag, value, vlen);
+}
+
+int x509_note_not_after(void *context, size_t hdrlen,
+                       unsigned char tag,
+                       const void *value, size_t vlen)
+{
+       struct x509_parse_context *ctx = context;
+       return x509_note_time(&ctx->cert->valid_to, hdrlen, tag, value, vlen);
+}
diff --git a/crypto/asymmetric_keys/x509_parser.h b/crypto/asymmetric_keys/x509_parser.h
new file mode 100644 (file)
index 0000000..f86dc5f
--- /dev/null
@@ -0,0 +1,36 @@
+/* X.509 certificate parser internal definitions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <crypto/public_key.h>
+
+struct x509_certificate {
+       struct x509_certificate *next;
+       struct public_key *pub;                 /* Public key details */
+       char            *issuer;                /* Name of certificate issuer */
+       char            *subject;               /* Name of certificate subject */
+       char            *fingerprint;           /* Key fingerprint as hex */
+       char            *authority;             /* Authority key fingerprint as hex */
+       struct tm       valid_from;
+       struct tm       valid_to;
+       enum pkey_algo  pkey_algo : 8;          /* Public key algorithm */
+       enum pkey_algo  sig_pkey_algo : 8;      /* Signature public key algorithm */
+       enum pkey_hash_algo sig_hash_algo : 8;  /* Signature hash algorithm */
+       const void      *tbs;                   /* Signed data */
+       size_t          tbs_size;               /* Size of signed data */
+       const void      *sig;                   /* Signature data */
+       size_t          sig_size;               /* Size of sigature */
+};
+
+/*
+ * x509_cert_parser.c
+ */
+extern void x509_free_certificate(struct x509_certificate *cert);
+extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
new file mode 100644 (file)
index 0000000..06007f0
--- /dev/null
@@ -0,0 +1,239 @@
+/* Instantiate a public key crypto key from an X.509 Certificate
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#define pr_fmt(fmt) "X.509: "fmt
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/mpi.h>
+#include <linux/asn1_decoder.h>
+#include <keys/asymmetric-subtype.h>
+#include <keys/asymmetric-parser.h>
+#include <crypto/hash.h>
+#include "asymmetric_keys.h"
+#include "public_key.h"
+#include "x509_parser.h"
+
+static const
+struct public_key_algorithm *x509_public_key_algorithms[PKEY_ALGO__LAST] = {
+       [PKEY_ALGO_DSA]         = NULL,
+#if defined(CONFIG_PUBLIC_KEY_ALGO_RSA) || \
+       defined(CONFIG_PUBLIC_KEY_ALGO_RSA_MODULE)
+       [PKEY_ALGO_RSA]         = &RSA_public_key_algorithm,
+#endif
+};
+
+/*
+ * Check the signature on a certificate using the provided public key
+ */
+static int x509_check_signature(const struct public_key *pub,
+                               const struct x509_certificate *cert)
+{
+       struct public_key_signature *sig;
+       struct crypto_shash *tfm;
+       struct shash_desc *desc;
+       size_t digest_size, desc_size;
+       int ret;
+
+       pr_devel("==>%s()\n", __func__);
+       
+       /* Allocate the hashing algorithm we're going to need and find out how
+        * big the hash operational data will be.
+        */
+       tfm = crypto_alloc_shash(pkey_hash_algo[cert->sig_hash_algo], 0, 0);
+       if (IS_ERR(tfm))
+               return (PTR_ERR(tfm) == -ENOENT) ? -ENOPKG : PTR_ERR(tfm);
+
+       desc_size = crypto_shash_descsize(tfm) + sizeof(*desc);
+       digest_size = crypto_shash_digestsize(tfm);
+
+       /* We allocate the hash operational data storage on the end of our
+        * context data.
+        */
+       ret = -ENOMEM;
+       sig = kzalloc(sizeof(*sig) + desc_size + digest_size, GFP_KERNEL);
+       if (!sig)
+               goto error_no_sig;
+
+       sig->pkey_hash_algo     = cert->sig_hash_algo;
+       sig->digest             = (u8 *)sig + sizeof(*sig) + desc_size;
+       sig->digest_size        = digest_size;
+
+       desc = (void *)sig + sizeof(*sig);
+       desc->tfm       = tfm;
+       desc->flags     = CRYPTO_TFM_REQ_MAY_SLEEP;
+
+       ret = crypto_shash_init(desc);
+       if (ret < 0)
+               goto error;
+
+       ret = -ENOMEM;
+       sig->rsa.s = mpi_read_raw_data(cert->sig, cert->sig_size);
+       if (!sig->rsa.s)
+               goto error;
+
+       ret = crypto_shash_finup(desc, cert->tbs, cert->tbs_size, sig->digest);
+       if (ret < 0)
+               goto error_mpi;
+
+       ret = pub->algo->verify_signature(pub, sig);
+
+       pr_debug("Cert Verification: %d\n", ret);
+
+error_mpi:
+       mpi_free(sig->rsa.s);
+error:
+       kfree(sig);
+error_no_sig:
+       crypto_free_shash(tfm);
+
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ret;
+}
+
+/*
+ * Attempt to parse a data blob for a key as an X509 certificate.
+ */
+static int x509_key_preparse(struct key_preparsed_payload *prep)
+{
+       struct x509_certificate *cert;
+       struct tm now;
+       size_t srlen, sulen;
+       char *desc = NULL;
+       int ret;
+
+       cert = x509_cert_parse(prep->data, prep->datalen);
+       if (IS_ERR(cert))
+               return PTR_ERR(cert);
+
+       pr_devel("Cert Issuer: %s\n", cert->issuer);
+       pr_devel("Cert Subject: %s\n", cert->subject);
+       pr_devel("Cert Key Algo: %s\n", pkey_algo[cert->pkey_algo]);
+       pr_devel("Cert Valid From: %04ld-%02d-%02d %02d:%02d:%02d\n",
+                cert->valid_from.tm_year + 1900, cert->valid_from.tm_mon + 1,
+                cert->valid_from.tm_mday, cert->valid_from.tm_hour,
+                cert->valid_from.tm_min,  cert->valid_from.tm_sec);
+       pr_devel("Cert Valid To: %04ld-%02d-%02d %02d:%02d:%02d\n",
+                cert->valid_to.tm_year + 1900, cert->valid_to.tm_mon + 1,
+                cert->valid_to.tm_mday, cert->valid_to.tm_hour,
+                cert->valid_to.tm_min,  cert->valid_to.tm_sec);
+       pr_devel("Cert Signature: %s + %s\n",
+                pkey_algo[cert->sig_pkey_algo],
+                pkey_hash_algo[cert->sig_hash_algo]);
+
+       if (!cert->fingerprint || !cert->authority) {
+               pr_warn("Cert for '%s' must have SubjKeyId and AuthKeyId extensions\n",
+                       cert->subject);
+               ret = -EKEYREJECTED;
+               goto error_free_cert;
+       }
+
+       time_to_tm(CURRENT_TIME.tv_sec, 0, &now);
+       pr_devel("Now: %04ld-%02d-%02d %02d:%02d:%02d\n",
+                now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
+                now.tm_hour, now.tm_min,  now.tm_sec);
+       if (now.tm_year < cert->valid_from.tm_year ||
+           (now.tm_year == cert->valid_from.tm_year &&
+            (now.tm_mon < cert->valid_from.tm_mon ||
+             (now.tm_mon == cert->valid_from.tm_mon &&
+              (now.tm_mday < cert->valid_from.tm_mday ||
+               (now.tm_mday == cert->valid_from.tm_mday &&
+                (now.tm_hour < cert->valid_from.tm_hour ||
+                 (now.tm_hour == cert->valid_from.tm_hour &&
+                  (now.tm_min < cert->valid_from.tm_min ||
+                   (now.tm_min == cert->valid_from.tm_min &&
+                    (now.tm_sec < cert->valid_from.tm_sec
+                     ))))))))))) {
+               pr_warn("Cert %s is not yet valid\n", cert->fingerprint);
+               ret = -EKEYREJECTED;
+               goto error_free_cert;
+       }
+       if (now.tm_year > cert->valid_to.tm_year ||
+           (now.tm_year == cert->valid_to.tm_year &&
+            (now.tm_mon > cert->valid_to.tm_mon ||
+             (now.tm_mon == cert->valid_to.tm_mon &&
+              (now.tm_mday > cert->valid_to.tm_mday ||
+               (now.tm_mday == cert->valid_to.tm_mday &&
+                (now.tm_hour > cert->valid_to.tm_hour ||
+                 (now.tm_hour == cert->valid_to.tm_hour &&
+                  (now.tm_min > cert->valid_to.tm_min ||
+                   (now.tm_min == cert->valid_to.tm_min &&
+                    (now.tm_sec > cert->valid_to.tm_sec
+                     ))))))))))) {
+               pr_warn("Cert %s has expired\n", cert->fingerprint);
+               ret = -EKEYEXPIRED;
+               goto error_free_cert;
+       }
+
+       cert->pub->algo = x509_public_key_algorithms[cert->pkey_algo];
+       cert->pub->id_type = PKEY_ID_X509;
+
+       /* Check the signature on the key */
+       if (strcmp(cert->fingerprint, cert->authority) == 0) {
+               ret = x509_check_signature(cert->pub, cert);
+               if (ret < 0)
+                       goto error_free_cert;
+       }
+
+       /* Propose a description */
+       sulen = strlen(cert->subject);
+       srlen = strlen(cert->fingerprint);
+       ret = -ENOMEM;
+       desc = kmalloc(sulen + 2 + srlen + 1, GFP_KERNEL);
+       if (!desc)
+               goto error_free_cert;
+       memcpy(desc, cert->subject, sulen);
+       desc[sulen] = ':';
+       desc[sulen + 1] = ' ';
+       memcpy(desc + sulen + 2, cert->fingerprint, srlen);
+       desc[sulen + 2 + srlen] = 0;
+
+       /* We're pinning the module by being linked against it */
+       __module_get(public_key_subtype.owner);
+       prep->type_data[0] = &public_key_subtype;
+       prep->type_data[1] = cert->fingerprint;
+       prep->payload = cert->pub;
+       prep->description = desc;
+       prep->quotalen = 100;
+
+       /* We've finished with the certificate */
+       cert->pub = NULL;
+       cert->fingerprint = NULL;
+       desc = NULL;
+       ret = 0;
+
+error_free_cert:
+       x509_free_certificate(cert);
+       return ret;
+}
+
+static struct asymmetric_key_parser x509_key_parser = {
+       .owner  = THIS_MODULE,
+       .name   = "x509",
+       .parse  = x509_key_preparse,
+};
+
+/*
+ * Module stuff
+ */
+static int __init x509_key_init(void)
+{
+       return register_asymmetric_key_parser(&x509_key_parser);
+}
+
+static void __exit x509_key_exit(void)
+{
+       unregister_asymmetric_key_parser(&x509_key_parser);
+}
+
+module_init(x509_key_init);
+module_exit(x509_key_exit);
diff --git a/crypto/asymmetric_keys/x509_rsakey.asn1 b/crypto/asymmetric_keys/x509_rsakey.asn1
new file mode 100644 (file)
index 0000000..4ec7cc6
--- /dev/null
@@ -0,0 +1,4 @@
+RSAPublicKey ::= SEQUENCE {
+       modulus                 INTEGER ({ rsa_extract_mpi }),  -- n
+       publicExponent          INTEGER ({ rsa_extract_mpi })   -- e
+       }
index 65c7b416b4a3e4d9e2ad08c41a1fcec06e222f8e..35d6b3adf2308fbb4ab2bd7d3358b8328bff8936 100644 (file)
@@ -56,11 +56,11 @@ xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)
 EXPORT_SYMBOL(xor_blocks);
 
 /* Set of all registered templates.  */
-static struct xor_block_template *template_list;
+static struct xor_block_template *__initdata template_list;
 
 #define BENCH_SIZE (PAGE_SIZE)
 
-static void
+static void __init
 do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
 {
        int speed;
index 94e7f6ba2e11e1c4479d82b8e840f38cb89e0f0b..7155945f8eb8a101c435f45ca4b2d76ae51919e0 100644 (file)
@@ -163,20 +163,17 @@ static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mdde
         * As devices are only added or removed when raid_disk is < 0 and
         * nr_pending is 0 and In_sync is clear, the entries we return will
         * still be in the same position on the list when we re-enter
-        * list_for_each_continue_rcu.
+        * list_for_each_entry_continue_rcu.
         */
-       struct list_head *pos;
        rcu_read_lock();
        if (rdev == NULL)
                /* start at the beginning */
-               pos = &mddev->disks;
+               rdev = list_entry_rcu(&mddev->disks, struct md_rdev, same_set);
        else {
                /* release the previous rdev and start from there. */
                rdev_dec_pending(rdev, mddev);
-               pos = &rdev->same_set;
        }
-       list_for_each_continue_rcu(pos, &mddev->disks) {
-               rdev = list_entry(pos, struct md_rdev, same_set);
+       list_for_each_entry_continue_rcu(rdev, &mddev->disks, same_set) {
                if (rdev->raid_disk >= 0 &&
                    !test_bit(Faulty, &rdev->flags)) {
                        /* this is a usable devices */
@@ -473,14 +470,10 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
 {
        bitmap_super_t *sb;
        unsigned long chunksize, daemon_sleep, write_behind;
-       int err = -EINVAL;
 
        bitmap->storage.sb_page = alloc_page(GFP_KERNEL);
-       if (IS_ERR(bitmap->storage.sb_page)) {
-               err = PTR_ERR(bitmap->storage.sb_page);
-               bitmap->storage.sb_page = NULL;
-               return err;
-       }
+       if (bitmap->storage.sb_page == NULL)
+               return -ENOMEM;
        bitmap->storage.sb_page->index = 0;
 
        sb = kmap_atomic(bitmap->storage.sb_page);
index 982e3e390c458ceadeab3b5f9618cf4e1bb5891e..45d94a7e7f6db798ce291546f7916b246203f85b 100644 (file)
@@ -337,6 +337,84 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
        return 0;
 }
 
+/*
+ * validate_rebuild_devices
+ * @rs
+ *
+ * Determine if the devices specified for rebuild can result in a valid
+ * usable array that is capable of rebuilding the given devices.
+ *
+ * Returns: 0 on success, -EINVAL on failure.
+ */
+static int validate_rebuild_devices(struct raid_set *rs)
+{
+       unsigned i, rebuild_cnt = 0;
+       unsigned rebuilds_per_group, copies, d;
+
+       if (!(rs->print_flags & DMPF_REBUILD))
+               return 0;
+
+       for (i = 0; i < rs->md.raid_disks; i++)
+               if (!test_bit(In_sync, &rs->dev[i].rdev.flags))
+                       rebuild_cnt++;
+
+       switch (rs->raid_type->level) {
+       case 1:
+               if (rebuild_cnt >= rs->md.raid_disks)
+                       goto too_many;
+               break;
+       case 4:
+       case 5:
+       case 6:
+               if (rebuild_cnt > rs->raid_type->parity_devs)
+                       goto too_many;
+               break;
+       case 10:
+               copies = raid10_md_layout_to_copies(rs->md.layout);
+               if (rebuild_cnt < copies)
+                       break;
+
+               /*
+                * It is possible to have a higher rebuild count for RAID10,
+                * as long as the failed devices occur in different mirror
+                * groups (i.e. different stripes).
+                *
+                * Right now, we only allow for "near" copies.  When other
+                * formats are added, we will have to check those too.
+                *
+                * When checking "near" format, make sure no adjacent devices
+                * have failed beyond what can be handled.  In addition to the
+                * simple case where the number of devices is a multiple of the
+                * number of copies, we must also handle cases where the number
+                * of devices is not a multiple of the number of copies.
+                * E.g.    dev1 dev2 dev3 dev4 dev5
+                *          A    A    B    B    C
+                *          C    D    D    E    E
+                */
+               rebuilds_per_group = 0;
+               for (i = 0; i < rs->md.raid_disks * copies; i++) {
+                       d = i % rs->md.raid_disks;
+                       if (!test_bit(In_sync, &rs->dev[d].rdev.flags) &&
+                           (++rebuilds_per_group >= copies))
+                               goto too_many;
+                       if (!((i + 1) % copies))
+                               rebuilds_per_group = 0;
+               }
+               break;
+       default:
+               DMERR("The rebuild parameter is not supported for %s",
+                     rs->raid_type->name);
+               rs->ti->error = "Rebuild not supported for this RAID type";
+               return -EINVAL;
+       }
+
+       return 0;
+
+too_many:
+       rs->ti->error = "Too many rebuild devices specified";
+       return -EINVAL;
+}
+
 /*
  * Possible arguments are...
  *     <chunk_size> [optional_args]
@@ -365,7 +443,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
 {
        char *raid10_format = "near";
        unsigned raid10_copies = 2;
-       unsigned i, rebuild_cnt = 0;
+       unsigned i;
        unsigned long value, region_size = 0;
        sector_t sectors_per_dev = rs->ti->len;
        sector_t max_io_len;
@@ -461,31 +539,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
 
                /* Parameters that take a numeric value are checked here */
                if (!strcasecmp(key, "rebuild")) {
-                       rebuild_cnt++;
-
-                       switch (rs->raid_type->level) {
-                       case 1:
-                               if (rebuild_cnt >= rs->md.raid_disks) {
-                                       rs->ti->error = "Too many rebuild devices specified";
-                                       return -EINVAL;
-                               }
-                               break;
-                       case 4:
-                       case 5:
-                       case 6:
-                               if (rebuild_cnt > rs->raid_type->parity_devs) {
-                                       rs->ti->error = "Too many rebuild devices specified for given RAID type";
-                                       return -EINVAL;
-                               }
-                               break;
-                       case 10:
-                       default:
-                               DMERR("The rebuild parameter is not supported for %s", rs->raid_type->name);
-                               rs->ti->error = "Rebuild not supported for this RAID type";
-                               return -EINVAL;
-                       }
-
-                       if (value > rs->md.raid_disks) {
+                       if (value >= rs->md.raid_disks) {
                                rs->ti->error = "Invalid rebuild index given";
                                return -EINVAL;
                        }
@@ -608,6 +662,9 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
        }
        rs->md.dev_sectors = sectors_per_dev;
 
+       if (validate_rebuild_devices(rs))
+               return -EINVAL;
+
        /* Assume there are no metadata devices until the drives are parsed */
        rs->md.persistent = 0;
        rs->md.external = 1;
@@ -960,6 +1017,19 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
 
        freshest = NULL;
        rdev_for_each_safe(rdev, tmp, mddev) {
+               /*
+                * Skipping super_load due to DMPF_SYNC will cause
+                * the array to undergo initialization again as
+                * though it were new.  This is the intended effect
+                * of the "sync" directive.
+                *
+                * When reshaping capability is added, we must ensure
+                * that the "sync" directive is disallowed during the
+                * reshape.
+                */
+               if (rs->print_flags & DMPF_SYNC)
+                       continue;
+
                if (!rdev->meta_bdev)
                        continue;
 
@@ -1360,7 +1430,7 @@ static void raid_resume(struct dm_target *ti)
 
 static struct target_type raid_target = {
        .name = "raid",
-       .version = {1, 3, 0},
+       .version = {1, 3, 1},
        .module = THIS_MODULE,
        .ctr = raid_ctr,
        .dtr = raid_dtr,
index fa211d80fc0a1e4e37603b1455184cbee7da6e56..21014836bdbf2286eba4fd02effbc4efcd9db625 100644 (file)
@@ -138,6 +138,7 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks)
        struct linear_conf *conf;
        struct md_rdev *rdev;
        int i, cnt;
+       bool discard_supported = false;
 
        conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(struct dev_info),
                        GFP_KERNEL);
@@ -171,6 +172,8 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks)
                conf->array_sectors += rdev->sectors;
                cnt++;
 
+               if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
+                       discard_supported = true;
        }
        if (cnt != raid_disks) {
                printk(KERN_ERR "md/linear:%s: not enough drives present. Aborting!\n",
@@ -178,6 +181,11 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks)
                goto out;
        }
 
+       if (!discard_supported)
+               queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+       else
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+
        /*
         * Here we calculate the device offsets.
         */
@@ -244,7 +252,9 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
        if (!newconf)
                return -ENOMEM;
 
-       oldconf = rcu_dereference(mddev->private);
+       oldconf = rcu_dereference_protected(mddev->private,
+                                           lockdep_is_held(
+                                                   &mddev->reconfig_mutex));
        mddev->raid_disks++;
        rcu_assign_pointer(mddev->private, newconf);
        md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
@@ -256,7 +266,10 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
 
 static int linear_stop (struct mddev *mddev)
 {
-       struct linear_conf *conf = mddev->private;
+       struct linear_conf *conf =
+               rcu_dereference_protected(mddev->private,
+                                         lockdep_is_held(
+                                                 &mddev->reconfig_mutex));
 
        /*
         * We do not require rcu protection here since
@@ -326,6 +339,14 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio)
        bio->bi_sector = bio->bi_sector - start_sector
                + tmp_dev->rdev->data_offset;
        rcu_read_unlock();
+
+       if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+                    !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) {
+               /* Just ignore it */
+               bio_endio(bio, 0);
+               return;
+       }
+
        generic_make_request(bio);
 }
 
index 95c88012a3b9c71fb5581871d89f5e7de86ae396..9ab768acfb623f8bbb13870e5f65150a60ecad07 100644 (file)
@@ -674,7 +674,18 @@ static struct md_rdev * find_rdev_nr(struct mddev *mddev, int nr)
        return NULL;
 }
 
-static struct md_rdev * find_rdev(struct mddev * mddev, dev_t dev)
+static struct md_rdev *find_rdev_nr_rcu(struct mddev *mddev, int nr)
+{
+       struct md_rdev *rdev;
+
+       rdev_for_each_rcu(rdev, mddev)
+               if (rdev->desc_nr == nr)
+                       return rdev;
+
+       return NULL;
+}
+
+static struct md_rdev *find_rdev(struct mddev *mddev, dev_t dev)
 {
        struct md_rdev *rdev;
 
@@ -685,6 +696,17 @@ static struct md_rdev * find_rdev(struct mddev * mddev, dev_t dev)
        return NULL;
 }
 
+static struct md_rdev *find_rdev_rcu(struct mddev *mddev, dev_t dev)
+{
+       struct md_rdev *rdev;
+
+       rdev_for_each_rcu(rdev, mddev)
+               if (rdev->bdev->bd_dev == dev)
+                       return rdev;
+
+       return NULL;
+}
+
 static struct md_personality *find_pers(int level, char *clevel)
 {
        struct md_personality *pers;
@@ -2022,8 +2044,14 @@ EXPORT_SYMBOL(md_integrity_register);
 /* Disable data integrity if non-capable/non-matching disk is being added */
 void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev)
 {
-       struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev);
-       struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk);
+       struct blk_integrity *bi_rdev;
+       struct blk_integrity *bi_mddev;
+
+       if (!mddev->gendisk)
+               return;
+
+       bi_rdev = bdev_get_integrity(rdev->bdev);
+       bi_mddev = blk_get_integrity(mddev->gendisk);
 
        if (!bi_mddev) /* nothing to do */
                return;
@@ -3754,6 +3782,8 @@ resync_start_store(struct mddev *mddev, const char *buf, size_t len)
                return -EINVAL;
 
        mddev->recovery_cp = n;
+       if (mddev->pers)
+               set_bit(MD_CHANGE_CLEAN, &mddev->flags);
        return len;
 }
 static struct md_sysfs_entry md_resync_start =
@@ -4231,6 +4261,13 @@ action_store(struct mddev *mddev, const char *page, size_t len)
                set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
                set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
        }
+       if (mddev->ro == 2) {
+               /* A write to sync_action is enough to justify
+                * canceling read-auto mode
+                */
+               mddev->ro = 0;
+               md_wakeup_thread(mddev->sync_thread);
+       }
        set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
        md_wakeup_thread(mddev->thread);
        sysfs_notify_dirent_safe(mddev->sysfs_action);
@@ -4241,7 +4278,8 @@ static ssize_t
 mismatch_cnt_show(struct mddev *mddev, char *page)
 {
        return sprintf(page, "%llu\n",
-                      (unsigned long long) mddev->resync_mismatches);
+                      (unsigned long long)
+                      atomic64_read(&mddev->resync_mismatches));
 }
 
 static struct md_sysfs_entry md_scan_mode =
@@ -4362,6 +4400,10 @@ sync_completed_show(struct mddev *mddev, char *page)
        if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))
                return sprintf(page, "none\n");
 
+       if (mddev->curr_resync == 1 ||
+           mddev->curr_resync == 2)
+               return sprintf(page, "delayed\n");
+
        if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
            test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
                max_sectors = mddev->resync_max_sectors;
@@ -5207,7 +5249,7 @@ static void md_clean(struct mddev *mddev)
        mddev->new_layout = 0;
        mddev->new_chunk_sectors = 0;
        mddev->curr_resync = 0;
-       mddev->resync_mismatches = 0;
+       atomic64_set(&mddev->resync_mismatches, 0);
        mddev->suspend_lo = mddev->suspend_hi = 0;
        mddev->sync_speed_min = mddev->sync_speed_max = 0;
        mddev->recovery = 0;
@@ -5509,8 +5551,9 @@ static int get_array_info(struct mddev * mddev, void __user * arg)
        int nr,working,insync,failed,spare;
        struct md_rdev *rdev;
 
-       nr=working=insync=failed=spare=0;
-       rdev_for_each(rdev, mddev) {
+       nr = working = insync = failed = spare = 0;
+       rcu_read_lock();
+       rdev_for_each_rcu(rdev, mddev) {
                nr++;
                if (test_bit(Faulty, &rdev->flags))
                        failed++;
@@ -5522,6 +5565,7 @@ static int get_array_info(struct mddev * mddev, void __user * arg)
                                spare++;
                }
        }
+       rcu_read_unlock();
 
        info.major_version = mddev->major_version;
        info.minor_version = mddev->minor_version;
@@ -5605,7 +5649,8 @@ static int get_disk_info(struct mddev * mddev, void __user * arg)
        if (copy_from_user(&info, arg, sizeof(info)))
                return -EFAULT;
 
-       rdev = find_rdev_nr(mddev, info.number);
+       rcu_read_lock();
+       rdev = find_rdev_nr_rcu(mddev, info.number);
        if (rdev) {
                info.major = MAJOR(rdev->bdev->bd_dev);
                info.minor = MINOR(rdev->bdev->bd_dev);
@@ -5624,6 +5669,7 @@ static int get_disk_info(struct mddev * mddev, void __user * arg)
                info.raid_disk = -1;
                info.state = (1<<MD_DISK_REMOVED);
        }
+       rcu_read_unlock();
 
        if (copy_to_user(arg, &info, sizeof(info)))
                return -EFAULT;
@@ -6232,18 +6278,22 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
 static int set_disk_faulty(struct mddev *mddev, dev_t dev)
 {
        struct md_rdev *rdev;
+       int err = 0;
 
        if (mddev->pers == NULL)
                return -ENODEV;
 
-       rdev = find_rdev(mddev, dev);
+       rcu_read_lock();
+       rdev = find_rdev_rcu(mddev, dev);
        if (!rdev)
-               return -ENODEV;
-
-       md_error(mddev, rdev);
-       if (!test_bit(Faulty, &rdev->flags))
-               return -EBUSY;
-       return 0;
+               err =  -ENODEV;
+       else {
+               md_error(mddev, rdev);
+               if (!test_bit(Faulty, &rdev->flags))
+                       err = -EBUSY;
+       }
+       rcu_read_unlock();
+       return err;
 }
 
 /*
@@ -6315,6 +6365,27 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
                goto abort;
        }
 
+       /* Some actions do not requires the mutex */
+       switch (cmd) {
+       case GET_ARRAY_INFO:
+               if (!mddev->raid_disks && !mddev->external)
+                       err = -ENODEV;
+               else
+                       err = get_array_info(mddev, argp);
+               goto abort;
+
+       case GET_DISK_INFO:
+               if (!mddev->raid_disks && !mddev->external)
+                       err = -ENODEV;
+               else
+                       err = get_disk_info(mddev, argp);
+               goto abort;
+
+       case SET_DISK_FAULTY:
+               err = set_disk_faulty(mddev, new_decode_dev(arg));
+               goto abort;
+       }
+
        err = mddev_lock(mddev);
        if (err) {
                printk(KERN_INFO 
@@ -6387,18 +6458,10 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
         */
        switch (cmd)
        {
-               case GET_ARRAY_INFO:
-                       err = get_array_info(mddev, argp);
-                       goto done_unlock;
-
                case GET_BITMAP_FILE:
                        err = get_bitmap_file(mddev, argp);
                        goto done_unlock;
 
-               case GET_DISK_INFO:
-                       err = get_disk_info(mddev, argp);
-                       goto done_unlock;
-
                case RESTART_ARRAY_RW:
                        err = restart_array(mddev);
                        goto done_unlock;
@@ -6480,10 +6543,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
                        err = hot_add_disk(mddev, new_decode_dev(arg));
                        goto done_unlock;
 
-               case SET_DISK_FAULTY:
-                       err = set_disk_faulty(mddev, new_decode_dev(arg));
-                       goto done_unlock;
-
                case RUN_ARRAY:
                        err = do_md_run(mddev);
                        goto done_unlock;
@@ -6641,7 +6700,7 @@ static int md_thread(void * arg)
 
                clear_bit(THREAD_WAKEUP, &thread->flags);
                if (!kthread_should_stop())
-                       thread->run(thread->mddev);
+                       thread->run(thread);
        }
 
        return 0;
@@ -6656,8 +6715,8 @@ void md_wakeup_thread(struct md_thread *thread)
        }
 }
 
-struct md_thread *md_register_thread(void (*run) (struct mddev *), struct mddev *mddev,
-                                const char *name)
+struct md_thread *md_register_thread(void (*run) (struct md_thread *),
+               struct mddev *mddev, const char *name)
 {
        struct md_thread *thread;
 
@@ -6752,7 +6811,11 @@ static void status_resync(struct seq_file *seq, struct mddev * mddev)
        int scale;
        unsigned int per_milli;
 
-       resync = mddev->curr_resync - atomic_read(&mddev->recovery_active);
+       if (mddev->curr_resync <= 3)
+               resync = 0;
+       else
+               resync = mddev->curr_resync
+                       - atomic_read(&mddev->recovery_active);
 
        if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
            test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
@@ -6978,7 +7041,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
                                if (mddev->curr_resync > 2) {
                                        status_resync(seq, mddev);
                                        seq_printf(seq, "\n      ");
-                               } else if (mddev->curr_resync == 1 || mddev->curr_resync == 2)
+                               } else if (mddev->curr_resync >= 1)
                                        seq_printf(seq, "\tresync=DELAYED\n      ");
                                else if (mddev->recovery_cp < MaxSector)
                                        seq_printf(seq, "\tresync=PENDING\n      ");
@@ -7206,8 +7269,9 @@ EXPORT_SYMBOL_GPL(md_allow_write);
 
 #define SYNC_MARKS     10
 #define        SYNC_MARK_STEP  (3*HZ)
-void md_do_sync(struct mddev *mddev)
+void md_do_sync(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct mddev *mddev2;
        unsigned int currspeed = 0,
                 window;
@@ -7311,7 +7375,7 @@ void md_do_sync(struct mddev *mddev)
                 * which defaults to physical size, but can be virtual size
                 */
                max_sectors = mddev->resync_max_sectors;
-               mddev->resync_mismatches = 0;
+               atomic64_set(&mddev->resync_mismatches, 0);
                /* we don't use the checkpoint if there's a bitmap */
                if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
                        j = mddev->resync_min;
@@ -7367,8 +7431,11 @@ void md_do_sync(struct mddev *mddev)
                       "md: resuming %s of %s from checkpoint.\n",
                       desc, mdname(mddev));
                mddev->curr_resync = j;
-       }
+       } else
+               mddev->curr_resync = 3; /* no longer delayed */
        mddev->curr_resync_completed = j;
+       sysfs_notify(&mddev->kobj, NULL, "sync_completed");
+       md_new_event(mddev);
 
        blk_start_plug(&plug);
        while (j < max_sectors) {
@@ -7421,7 +7488,8 @@ void md_do_sync(struct mddev *mddev)
                        break;
 
                j += sectors;
-               if (j>1) mddev->curr_resync = j;
+               if (j > 2)
+                       mddev->curr_resync = j;
                mddev->curr_mark_cnt = io_sectors;
                if (last_check == 0)
                        /* this is the earliest that rebuild will be
@@ -7543,8 +7611,6 @@ static int remove_and_add_spares(struct mddev *mddev)
        int spares = 0;
        int removed = 0;
 
-       mddev->curr_resync_completed = 0;
-
        rdev_for_each(rdev, mddev)
                if (rdev->raid_disk >= 0 &&
                    !test_bit(Blocked, &rdev->flags) &&
@@ -7739,6 +7805,7 @@ void md_check_recovery(struct mddev *mddev)
                /* Set RUNNING before clearing NEEDED to avoid
                 * any transients in the value of "sync_action".
                 */
+               mddev->curr_resync_completed = 0;
                set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
                /* Clear some bits that don't mean anything, but
                 * might be left set
@@ -7752,7 +7819,7 @@ void md_check_recovery(struct mddev *mddev)
                /* no recovery is running.
                 * remove any failed drives, then
                 * add spares if possible.
-                * Spare are also removed and re-added, to allow
+                * Spares are also removed and re-added, to allow
                 * the personality to fail the re-add.
                 */
 
index f385b038589d32313014e07af203b8f742bec4a7..af443ab868db910f2db2d35d53ffacca701f1e60 100644 (file)
@@ -282,7 +282,7 @@ struct mddev {
 
        sector_t                        resync_max_sectors; /* may be set by personality */
 
-       sector_t                        resync_mismatches; /* count of sectors where
+       atomic64_t                      resync_mismatches; /* count of sectors where
                                                            * parity/replica mismatch found
                                                            */
 
@@ -540,12 +540,13 @@ static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
        list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
 
 struct md_thread {
-       void                    (*run) (struct mddev *mddev);
+       void                    (*run) (struct md_thread *thread);
        struct mddev            *mddev;
        wait_queue_head_t       wqueue;
        unsigned long           flags;
        struct task_struct      *tsk;
        unsigned long           timeout;
+       void                    *private;
 };
 
 #define THREAD_WAKEUP  0
@@ -584,7 +585,7 @@ static inline void safe_put_page(struct page *p)
 extern int register_md_personality(struct md_personality *p);
 extern int unregister_md_personality(struct md_personality *p);
 extern struct md_thread *md_register_thread(
-       void (*run)(struct mddev *mddev),
+       void (*run)(struct md_thread *thread),
        struct mddev *mddev,
        const char *name);
 extern void md_unregister_thread(struct md_thread **threadp);
@@ -603,7 +604,7 @@ extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
 extern void md_super_wait(struct mddev *mddev);
 extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, 
                        struct page *page, int rw, bool metadata_op);
-extern void md_do_sync(struct mddev *mddev);
+extern void md_do_sync(struct md_thread *thread);
 extern void md_new_event(struct mddev *mddev);
 extern int md_allow_write(struct mddev *mddev);
 extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
index 61a1833ebaf33ec40afaf752db9a849439c9bd13..1642eae75a3335d1282a4bf53751802e1aeb52db 100644 (file)
@@ -335,8 +335,9 @@ abort:
  *     3.      Performs writes following reads for array syncronising.
  */
 
-static void multipathd (struct mddev *mddev)
+static void multipathd(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct multipath_bh *mp_bh;
        struct bio *bio;
        unsigned long flags;
index a9e4fa95dfaa76ac1d38434ac8153a6ffe1132c6..24b359717a7e8917a4955e36651e6eb4009dc393 100644 (file)
@@ -88,6 +88,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
        char b[BDEVNAME_SIZE];
        char b2[BDEVNAME_SIZE];
        struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
+       bool discard_supported = false;
 
        if (!conf)
                return -ENOMEM;
@@ -195,6 +196,9 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
                if (!smallest || (rdev1->sectors < smallest->sectors))
                        smallest = rdev1;
                cnt++;
+
+               if (blk_queue_discard(bdev_get_queue(rdev1->bdev)))
+                       discard_supported = true;
        }
        if (cnt != mddev->raid_disks) {
                printk(KERN_ERR "md/raid0:%s: too few disks (%d of %d) - "
@@ -272,6 +276,11 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
        blk_queue_io_opt(mddev->queue,
                         (mddev->chunk_sectors << 9) * mddev->raid_disks);
 
+       if (!discard_supported)
+               queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+       else
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+
        pr_debug("md/raid0:%s: done.\n", mdname(mddev));
        *private_conf = conf;
 
@@ -423,6 +432,7 @@ static int raid0_run(struct mddev *mddev)
                return -EINVAL;
        blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
        blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
+       blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
 
        /* if private is not null, we are here after takeover */
        if (mddev->private == NULL) {
@@ -510,7 +520,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
                sector_t sector = bio->bi_sector;
                struct bio_pair *bp;
                /* Sanity check -- queue functions should prevent this happening */
-               if (bio->bi_vcnt != 1 ||
+               if ((bio->bi_vcnt != 1 && bio->bi_vcnt != 0) ||
                    bio->bi_idx != 0)
                        goto bad_map;
                /* This is a one page bio that upper layers
@@ -536,6 +546,13 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
        bio->bi_sector = sector_offset + zone->dev_start +
                tmp_dev->data_offset;
 
+       if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+                    !blk_queue_discard(bdev_get_queue(bio->bi_bdev)))) {
+               /* Just ignore it */
+               bio_endio(bio, 0);
+               return;
+       }
+
        generic_make_request(bio);
        return;
 
index 611b5f79761826f8843ede2384c47ccbd0a87be1..8034fbd6190ce647ec2feb6a281e4bb32b406f8e 100644 (file)
@@ -333,9 +333,10 @@ static void raid1_end_read_request(struct bio *bio, int error)
                spin_unlock_irqrestore(&conf->device_lock, flags);
        }
 
-       if (uptodate)
+       if (uptodate) {
                raid_end_bio_io(r1_bio);
-       else {
+               rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
+       } else {
                /*
                 * oops, read error:
                 */
@@ -349,9 +350,8 @@ static void raid1_end_read_request(struct bio *bio, int error)
                        (unsigned long long)r1_bio->sector);
                set_bit(R1BIO_ReadError, &r1_bio->state);
                reschedule_retry(r1_bio);
+               /* don't drop the reference on read_disk yet */
        }
-
-       rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
 }
 
 static void close_write(struct r1bio *r1_bio)
@@ -781,7 +781,12 @@ static void flush_pending_writes(struct r1conf *conf)
                while (bio) { /* submit pending writes */
                        struct bio *next = bio->bi_next;
                        bio->bi_next = NULL;
-                       generic_make_request(bio);
+                       if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+                           !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
+                               /* Just ignore it */
+                               bio_endio(bio, 0);
+                       else
+                               generic_make_request(bio);
                        bio = next;
                }
        } else
@@ -994,6 +999,8 @@ static void make_request(struct mddev *mddev, struct bio * bio)
        const int rw = bio_data_dir(bio);
        const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
        const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA));
+       const unsigned long do_discard = (bio->bi_rw
+                                         & (REQ_DISCARD | REQ_SECURE));
        struct md_rdev *blocked_rdev;
        struct blk_plug_cb *cb;
        struct raid1_plug_cb *plug = NULL;
@@ -1295,7 +1302,7 @@ read_again:
                                   conf->mirrors[i].rdev->data_offset);
                mbio->bi_bdev = conf->mirrors[i].rdev->bdev;
                mbio->bi_end_io = raid1_end_write_request;
-               mbio->bi_rw = WRITE | do_flush_fua | do_sync;
+               mbio->bi_rw = WRITE | do_flush_fua | do_sync | do_discard;
                mbio->bi_private = r1_bio;
 
                atomic_inc(&r1_bio->remaining);
@@ -1549,6 +1556,8 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
                clear_bit(Unmerged, &rdev->flags);
        }
        md_integrity_add_rdev(rdev, mddev);
+       if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
        print_conf(conf);
        return err;
 }
@@ -1867,7 +1876,7 @@ static int process_checks(struct r1bio *r1_bio)
                } else
                        j = 0;
                if (j >= 0)
-                       mddev->resync_mismatches += r1_bio->sectors;
+                       atomic64_add(r1_bio->sectors, &mddev->resync_mismatches);
                if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
                              && test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
                        /* No need to write to this device. */
@@ -2220,6 +2229,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
                unfreeze_array(conf);
        } else
                md_error(mddev, conf->mirrors[r1_bio->read_disk].rdev);
+       rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev);
 
        bio = r1_bio->bios[r1_bio->read_disk];
        bdevname(bio->bi_bdev, b);
@@ -2285,8 +2295,9 @@ read_more:
        }
 }
 
-static void raid1d(struct mddev *mddev)
+static void raid1d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r1bio *r1_bio;
        unsigned long flags;
        struct r1conf *conf = mddev->private;
@@ -2783,6 +2794,7 @@ static int run(struct mddev *mddev)
        int i;
        struct md_rdev *rdev;
        int ret;
+       bool discard_supported = false;
 
        if (mddev->level != 1) {
                printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n",
@@ -2812,6 +2824,8 @@ static int run(struct mddev *mddev)
                        continue;
                disk_stack_limits(mddev->gendisk, rdev->bdev,
                                  rdev->data_offset << 9);
+               if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
+                       discard_supported = true;
        }
 
        mddev->degraded = 0;
@@ -2846,6 +2860,13 @@ static int run(struct mddev *mddev)
                mddev->queue->backing_dev_info.congested_fn = raid1_congested;
                mddev->queue->backing_dev_info.congested_data = mddev;
                blk_queue_merge_bvec(mddev->queue, raid1_mergeable_bvec);
+
+               if (discard_supported)
+                       queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,
+                                               mddev->queue);
+               else
+                       queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD,
+                                                 mddev->queue);
        }
 
        ret =  md_integrity_register(mddev);
index 0138a727c1f3c220bc91a02c9bdf720599465eb9..906ccbd0f7dcdc6710869c5b990f9375d020d370 100644 (file)
@@ -911,7 +911,12 @@ static void flush_pending_writes(struct r10conf *conf)
                while (bio) { /* submit pending writes */
                        struct bio *next = bio->bi_next;
                        bio->bi_next = NULL;
-                       generic_make_request(bio);
+                       if (unlikely((bio->bi_rw & REQ_DISCARD) &&
+                           !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
+                               /* Just ignore it */
+                               bio_endio(bio, 0);
+                       else
+                               generic_make_request(bio);
                        bio = next;
                }
        } else
@@ -1050,6 +1055,44 @@ static sector_t choose_data_offset(struct r10bio *r10_bio,
                return rdev->new_data_offset;
 }
 
+struct raid10_plug_cb {
+       struct blk_plug_cb      cb;
+       struct bio_list         pending;
+       int                     pending_cnt;
+};
+
+static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule)
+{
+       struct raid10_plug_cb *plug = container_of(cb, struct raid10_plug_cb,
+                                                  cb);
+       struct mddev *mddev = plug->cb.data;
+       struct r10conf *conf = mddev->private;
+       struct bio *bio;
+
+       if (from_schedule) {
+               spin_lock_irq(&conf->device_lock);
+               bio_list_merge(&conf->pending_bio_list, &plug->pending);
+               conf->pending_count += plug->pending_cnt;
+               spin_unlock_irq(&conf->device_lock);
+               md_wakeup_thread(mddev->thread);
+               kfree(plug);
+               return;
+       }
+
+       /* we aren't scheduling, so we can do the write-out directly. */
+       bio = bio_list_get(&plug->pending);
+       bitmap_unplug(mddev->bitmap);
+       wake_up(&conf->wait_barrier);
+
+       while (bio) { /* submit pending writes */
+               struct bio *next = bio->bi_next;
+               bio->bi_next = NULL;
+               generic_make_request(bio);
+               bio = next;
+       }
+       kfree(plug);
+}
+
 static void make_request(struct mddev *mddev, struct bio * bio)
 {
        struct r10conf *conf = mddev->private;
@@ -1061,8 +1104,12 @@ static void make_request(struct mddev *mddev, struct bio * bio)
        const int rw = bio_data_dir(bio);
        const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
        const unsigned long do_fua = (bio->bi_rw & REQ_FUA);
+       const unsigned long do_discard = (bio->bi_rw
+                                         & (REQ_DISCARD | REQ_SECURE));
        unsigned long flags;
        struct md_rdev *blocked_rdev;
+       struct blk_plug_cb *cb;
+       struct raid10_plug_cb *plug = NULL;
        int sectors_handled;
        int max_sectors;
        int sectors;
@@ -1081,7 +1128,7 @@ static void make_request(struct mddev *mddev, struct bio * bio)
                         || conf->prev.near_copies < conf->prev.raid_disks))) {
                struct bio_pair *bp;
                /* Sanity check -- queue functions should prevent this happening */
-               if (bio->bi_vcnt != 1 ||
+               if ((bio->bi_vcnt != 1 && bio->bi_vcnt != 0) ||
                    bio->bi_idx != 0)
                        goto bad_map;
                /* This is a one page bio that upper layers
@@ -1410,15 +1457,26 @@ retry_write:
                                                      conf->mirrors[d].rdev));
                mbio->bi_bdev = conf->mirrors[d].rdev->bdev;
                mbio->bi_end_io = raid10_end_write_request;
-               mbio->bi_rw = WRITE | do_sync | do_fua;
+               mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
                mbio->bi_private = r10_bio;
 
                atomic_inc(&r10_bio->remaining);
+
+               cb = blk_check_plugged(raid10_unplug, mddev, sizeof(*plug));
+               if (cb)
+                       plug = container_of(cb, struct raid10_plug_cb, cb);
+               else
+                       plug = NULL;
                spin_lock_irqsave(&conf->device_lock, flags);
-               bio_list_add(&conf->pending_bio_list, mbio);
-               conf->pending_count++;
+               if (plug) {
+                       bio_list_add(&plug->pending, mbio);
+                       plug->pending_cnt++;
+               } else {
+                       bio_list_add(&conf->pending_bio_list, mbio);
+                       conf->pending_count++;
+               }
                spin_unlock_irqrestore(&conf->device_lock, flags);
-               if (!mddev_check_plugged(mddev))
+               if (!plug)
                        md_wakeup_thread(mddev->thread);
 
                if (!r10_bio->devs[i].repl_bio)
@@ -1439,7 +1497,7 @@ retry_write:
                                           conf->mirrors[d].replacement));
                mbio->bi_bdev = conf->mirrors[d].replacement->bdev;
                mbio->bi_end_io = raid10_end_write_request;
-               mbio->bi_rw = WRITE | do_sync | do_fua;
+               mbio->bi_rw = WRITE | do_sync | do_fua | do_discard;
                mbio->bi_private = r10_bio;
 
                atomic_inc(&r10_bio->remaining);
@@ -1638,7 +1696,7 @@ static int raid10_spare_active(struct mddev *mddev)
                           && !test_bit(Faulty, &tmp->rdev->flags)
                           && !test_and_set_bit(In_sync, &tmp->rdev->flags)) {
                        count++;
-                       sysfs_notify_dirent(tmp->rdev->sysfs_state);
+                       sysfs_notify_dirent_safe(tmp->rdev->sysfs_state);
                }
        }
        spin_lock_irqsave(&conf->device_lock, flags);
@@ -1725,6 +1783,9 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
                clear_bit(Unmerged, &rdev->flags);
        }
        md_integrity_add_rdev(rdev, mddev);
+       if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+
        print_conf(conf);
        return err;
 }
@@ -1952,7 +2013,7 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
                                        break;
                        if (j == vcnt)
                                continue;
-                       mddev->resync_mismatches += r10_bio->sectors;
+                       atomic64_add(r10_bio->sectors, &mddev->resync_mismatches);
                        if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
                                /* Don't fix anything. */
                                continue;
@@ -2673,8 +2734,9 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio)
        }
 }
 
-static void raid10d(struct mddev *mddev)
+static void raid10d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r10bio *r10_bio;
        unsigned long flags;
        struct r10conf *conf = mddev->private;
@@ -3158,7 +3220,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
                                else {
                                        bad_sectors -= (sector - first_bad);
                                        if (max_sync > bad_sectors)
-                                               max_sync = max_sync;
+                                               max_sync = bad_sectors;
                                        continue;
                                }
                        }
@@ -3482,6 +3544,7 @@ static int run(struct mddev *mddev)
        sector_t size;
        sector_t min_offset_diff = 0;
        int first = 1;
+       bool discard_supported = false;
 
        if (mddev->private == NULL) {
                conf = setup_conf(mddev);
@@ -3498,6 +3561,8 @@ static int run(struct mddev *mddev)
 
        chunk_size = mddev->chunk_sectors << 9;
        if (mddev->queue) {
+               blk_queue_max_discard_sectors(mddev->queue,
+                                             mddev->chunk_sectors);
                blk_queue_io_min(mddev->queue, chunk_size);
                if (conf->geo.raid_disks % conf->geo.near_copies)
                        blk_queue_io_opt(mddev->queue, chunk_size * conf->geo.raid_disks);
@@ -3543,8 +3608,16 @@ static int run(struct mddev *mddev)
                                          rdev->data_offset << 9);
 
                disk->head_position = 0;
+
+               if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
+                       discard_supported = true;
        }
 
+       if (discard_supported)
+               queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+       else
+               queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
+
        /* need to check that every block has at least one working mirror */
        if (!enough(conf, -1)) {
                printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n",
index 0689173fd9f568583708c53396631ac8e1838c55..c5439dce0295078ecf82094af5474a649284ce61 100644 (file)
@@ -551,6 +551,8 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
                                rw = WRITE_FUA;
                        else
                                rw = WRITE;
+                       if (test_bit(R5_Discard, &sh->dev[i].flags))
+                               rw |= REQ_DISCARD;
                } else if (test_and_clear_bit(R5_Wantread, &sh->dev[i].flags))
                        rw = READ;
                else if (test_and_clear_bit(R5_WantReplace,
@@ -1174,8 +1176,11 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx)
                                        set_bit(R5_WantFUA, &dev->flags);
                                if (wbi->bi_rw & REQ_SYNC)
                                        set_bit(R5_SyncIO, &dev->flags);
-                               tx = async_copy_data(1, wbi, dev->page,
-                                       dev->sector, tx);
+                               if (wbi->bi_rw & REQ_DISCARD)
+                                       set_bit(R5_Discard, &dev->flags);
+                               else
+                                       tx = async_copy_data(1, wbi, dev->page,
+                                               dev->sector, tx);
                                wbi = r5_next_bio(wbi, dev->sector);
                        }
                }
@@ -1191,7 +1196,7 @@ static void ops_complete_reconstruct(void *stripe_head_ref)
        int pd_idx = sh->pd_idx;
        int qd_idx = sh->qd_idx;
        int i;
-       bool fua = false, sync = false;
+       bool fua = false, sync = false, discard = false;
 
        pr_debug("%s: stripe %llu\n", __func__,
                (unsigned long long)sh->sector);
@@ -1199,13 +1204,15 @@ static void ops_complete_reconstruct(void *stripe_head_ref)
        for (i = disks; i--; ) {
                fua |= test_bit(R5_WantFUA, &sh->dev[i].flags);
                sync |= test_bit(R5_SyncIO, &sh->dev[i].flags);
+               discard |= test_bit(R5_Discard, &sh->dev[i].flags);
        }
 
        for (i = disks; i--; ) {
                struct r5dev *dev = &sh->dev[i];
 
                if (dev->written || i == pd_idx || i == qd_idx) {
-                       set_bit(R5_UPTODATE, &dev->flags);
+                       if (!discard)
+                               set_bit(R5_UPTODATE, &dev->flags);
                        if (fua)
                                set_bit(R5_WantFUA, &dev->flags);
                        if (sync)
@@ -1241,6 +1248,18 @@ ops_run_reconstruct5(struct stripe_head *sh, struct raid5_percpu *percpu,
        pr_debug("%s: stripe %llu\n", __func__,
                (unsigned long long)sh->sector);
 
+       for (i = 0; i < sh->disks; i++) {
+               if (pd_idx == i)
+                       continue;
+               if (!test_bit(R5_Discard, &sh->dev[i].flags))
+                       break;
+       }
+       if (i >= sh->disks) {
+               atomic_inc(&sh->count);
+               set_bit(R5_Discard, &sh->dev[pd_idx].flags);
+               ops_complete_reconstruct(sh);
+               return;
+       }
        /* check if prexor is active which means only process blocks
         * that are part of a read-modify-write (written)
         */
@@ -1285,10 +1304,24 @@ ops_run_reconstruct6(struct stripe_head *sh, struct raid5_percpu *percpu,
 {
        struct async_submit_ctl submit;
        struct page **blocks = percpu->scribble;
-       int count;
+       int count, i;
 
        pr_debug("%s: stripe %llu\n", __func__, (unsigned long long)sh->sector);
 
+       for (i = 0; i < sh->disks; i++) {
+               if (sh->pd_idx == i || sh->qd_idx == i)
+                       continue;
+               if (!test_bit(R5_Discard, &sh->dev[i].flags))
+                       break;
+       }
+       if (i >= sh->disks) {
+               atomic_inc(&sh->count);
+               set_bit(R5_Discard, &sh->dev[sh->pd_idx].flags);
+               set_bit(R5_Discard, &sh->dev[sh->qd_idx].flags);
+               ops_complete_reconstruct(sh);
+               return;
+       }
+
        count = set_syndrome_sources(blocks, sh);
 
        atomic_inc(&sh->count);
@@ -2408,11 +2441,11 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, in
                if (sector >= sh->dev[dd_idx].sector + STRIPE_SECTORS)
                        set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags);
        }
-       spin_unlock_irq(&sh->stripe_lock);
 
        pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
                (unsigned long long)(*bip)->bi_sector,
                (unsigned long long)sh->sector, dd_idx);
+       spin_unlock_irq(&sh->stripe_lock);
 
        if (conf->mddev->bitmap && firstwrite) {
                bitmap_startwrite(conf->mddev->bitmap, sh->sector,
@@ -2479,10 +2512,8 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh,
                bi = sh->dev[i].towrite;
                sh->dev[i].towrite = NULL;
                spin_unlock_irq(&sh->stripe_lock);
-               if (bi) {
-                       s->to_write--;
+               if (bi)
                        bitmap_end = 1;
-               }
 
                if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
                        wake_up(&conf->wait_for_overlap);
@@ -2524,11 +2555,12 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh,
                if (!test_bit(R5_Wantfill, &sh->dev[i].flags) &&
                    (!test_bit(R5_Insync, &sh->dev[i].flags) ||
                      test_bit(R5_ReadError, &sh->dev[i].flags))) {
+                       spin_lock_irq(&sh->stripe_lock);
                        bi = sh->dev[i].toread;
                        sh->dev[i].toread = NULL;
+                       spin_unlock_irq(&sh->stripe_lock);
                        if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
                                wake_up(&conf->wait_for_overlap);
-                       if (bi) s->to_read--;
                        while (bi && bi->bi_sector <
                               sh->dev[i].sector + STRIPE_SECTORS) {
                                struct bio *nextbi =
@@ -2741,7 +2773,8 @@ static void handle_stripe_clean_event(struct r5conf *conf,
                if (sh->dev[i].written) {
                        dev = &sh->dev[i];
                        if (!test_bit(R5_LOCKED, &dev->flags) &&
-                               test_bit(R5_UPTODATE, &dev->flags)) {
+                           (test_bit(R5_UPTODATE, &dev->flags) ||
+                            test_and_clear_bit(R5_Discard, &dev->flags))) {
                                /* We can return any write requests */
                                struct bio *wbi, *wbi2;
                                pr_debug("Return write for disc %d\n", i);
@@ -2775,12 +2808,25 @@ static void handle_stripe_dirtying(struct r5conf *conf,
                                   int disks)
 {
        int rmw = 0, rcw = 0, i;
-       if (conf->max_degraded == 2) {
-               /* RAID6 requires 'rcw' in current implementation
-                * Calculate the real rcw later - for now fake it
+       sector_t recovery_cp = conf->mddev->recovery_cp;
+
+       /* RAID6 requires 'rcw' in current implementation.
+        * Otherwise, check whether resync is now happening or should start.
+        * If yes, then the array is dirty (after unclean shutdown or
+        * initial creation), so parity in some stripes might be inconsistent.
+        * In this case, we need to always do reconstruct-write, to ensure
+        * that in case of drive failure or read-error correction, we
+        * generate correct data from the parity.
+        */
+       if (conf->max_degraded == 2 ||
+           (recovery_cp < MaxSector && sh->sector >= recovery_cp)) {
+               /* Calculate the real rcw later - for now make it
                 * look like rcw is cheaper
                 */
                rcw = 1; rmw = 2;
+               pr_debug("force RCW max_degraded=%u, recovery_cp=%llu sh->sector=%llu\n",
+                        conf->max_degraded, (unsigned long long)recovery_cp,
+                        (unsigned long long)sh->sector);
        } else for (i = disks; i--; ) {
                /* would I have to read this buffer for read_modify_write */
                struct r5dev *dev = &sh->dev[i];
@@ -2932,7 +2978,7 @@ static void handle_parity_checks5(struct r5conf *conf, struct stripe_head *sh,
                         */
                        set_bit(STRIPE_INSYNC, &sh->state);
                else {
-                       conf->mddev->resync_mismatches += STRIPE_SECTORS;
+                       atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
                        if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
                                /* don't try to repair!! */
                                set_bit(STRIPE_INSYNC, &sh->state);
@@ -3084,7 +3130,7 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,
                                 */
                        }
                } else {
-                       conf->mddev->resync_mismatches += STRIPE_SECTORS;
+                       atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
                        if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
                                /* don't try to repair!! */
                                set_bit(STRIPE_INSYNC, &sh->state);
@@ -3459,10 +3505,12 @@ static void handle_stripe(struct stripe_head *sh)
        if (s.written &&
            (s.p_failed || ((test_bit(R5_Insync, &pdev->flags)
                             && !test_bit(R5_LOCKED, &pdev->flags)
-                            && test_bit(R5_UPTODATE, &pdev->flags)))) &&
+                            && (test_bit(R5_UPTODATE, &pdev->flags) ||
+                                test_bit(R5_Discard, &pdev->flags))))) &&
            (s.q_failed || ((test_bit(R5_Insync, &qdev->flags)
                             && !test_bit(R5_LOCKED, &qdev->flags)
-                            && test_bit(R5_UPTODATE, &qdev->flags)))))
+                            && (test_bit(R5_UPTODATE, &qdev->flags) ||
+                                test_bit(R5_Discard, &qdev->flags))))))
                handle_stripe_clean_event(conf, sh, disks, &s.return_bi);
 
        /* Now we might consider reading some blocks, either to check/generate
@@ -3489,9 +3537,11 @@ static void handle_stripe(struct stripe_head *sh)
                /* All the 'written' buffers and the parity block are ready to
                 * be written back to disk
                 */
-               BUG_ON(!test_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags));
+               BUG_ON(!test_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags) &&
+                      !test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags));
                BUG_ON(sh->qd_idx >= 0 &&
-                      !test_bit(R5_UPTODATE, &sh->dev[sh->qd_idx].flags));
+                      !test_bit(R5_UPTODATE, &sh->dev[sh->qd_idx].flags) &&
+                      !test_bit(R5_Discard, &sh->dev[sh->qd_idx].flags));
                for (i = disks; i--; ) {
                        struct r5dev *dev = &sh->dev[i];
                        if (test_bit(R5_LOCKED, &dev->flags) &&
@@ -4072,6 +4122,88 @@ static void release_stripe_plug(struct mddev *mddev,
                release_stripe(sh);
 }
 
+static void make_discard_request(struct mddev *mddev, struct bio *bi)
+{
+       struct r5conf *conf = mddev->private;
+       sector_t logical_sector, last_sector;
+       struct stripe_head *sh;
+       int remaining;
+       int stripe_sectors;
+
+       if (mddev->reshape_position != MaxSector)
+               /* Skip discard while reshape is happening */
+               return;
+
+       logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1);
+       last_sector = bi->bi_sector + (bi->bi_size>>9);
+
+       bi->bi_next = NULL;
+       bi->bi_phys_segments = 1; /* over-loaded to count active stripes */
+
+       stripe_sectors = conf->chunk_sectors *
+               (conf->raid_disks - conf->max_degraded);
+       logical_sector = DIV_ROUND_UP_SECTOR_T(logical_sector,
+                                              stripe_sectors);
+       sector_div(last_sector, stripe_sectors);
+
+       logical_sector *= conf->chunk_sectors;
+       last_sector *= conf->chunk_sectors;
+
+       for (; logical_sector < last_sector;
+            logical_sector += STRIPE_SECTORS) {
+               DEFINE_WAIT(w);
+               int d;
+       again:
+               sh = get_active_stripe(conf, logical_sector, 0, 0, 0);
+               prepare_to_wait(&conf->wait_for_overlap, &w,
+                               TASK_UNINTERRUPTIBLE);
+               spin_lock_irq(&sh->stripe_lock);
+               for (d = 0; d < conf->raid_disks; d++) {
+                       if (d == sh->pd_idx || d == sh->qd_idx)
+                               continue;
+                       if (sh->dev[d].towrite || sh->dev[d].toread) {
+                               set_bit(R5_Overlap, &sh->dev[d].flags);
+                               spin_unlock_irq(&sh->stripe_lock);
+                               release_stripe(sh);
+                               schedule();
+                               goto again;
+                       }
+               }
+               finish_wait(&conf->wait_for_overlap, &w);
+               for (d = 0; d < conf->raid_disks; d++) {
+                       if (d == sh->pd_idx || d == sh->qd_idx)
+                               continue;
+                       sh->dev[d].towrite = bi;
+                       set_bit(R5_OVERWRITE, &sh->dev[d].flags);
+                       raid5_inc_bi_active_stripes(bi);
+               }
+               spin_unlock_irq(&sh->stripe_lock);
+               if (conf->mddev->bitmap) {
+                       for (d = 0;
+                            d < conf->raid_disks - conf->max_degraded;
+                            d++)
+                               bitmap_startwrite(mddev->bitmap,
+                                                 sh->sector,
+                                                 STRIPE_SECTORS,
+                                                 0);
+                       sh->bm_seq = conf->seq_flush + 1;
+                       set_bit(STRIPE_BIT_DELAY, &sh->state);
+               }
+
+               set_bit(STRIPE_HANDLE, &sh->state);
+               clear_bit(STRIPE_DELAYED, &sh->state);
+               if (!test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state))
+                       atomic_inc(&conf->preread_active_stripes);
+               release_stripe_plug(mddev, sh);
+       }
+
+       remaining = raid5_dec_bi_active_stripes(bi);
+       if (remaining == 0) {
+               md_write_end(mddev);
+               bio_endio(bi, 0);
+       }
+}
+
 static void make_request(struct mddev *mddev, struct bio * bi)
 {
        struct r5conf *conf = mddev->private;
@@ -4094,6 +4226,11 @@ static void make_request(struct mddev *mddev, struct bio * bi)
             chunk_aligned_read(mddev,bi))
                return;
 
+       if (unlikely(bi->bi_rw & REQ_DISCARD)) {
+               make_discard_request(mddev, bi);
+               return;
+       }
+
        logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1);
        last_sector = bi->bi_sector + (bi->bi_size>>9);
        bi->bi_next = NULL;
@@ -4630,8 +4767,9 @@ static int handle_active_stripes(struct r5conf *conf)
  * During the scan, completed stripes are saved for us by the interrupt
  * handler, so that they will not have to wait for our next wakeup.
  */
-static void raid5d(struct mddev *mddev)
+static void raid5d(struct md_thread *thread)
 {
+       struct mddev *mddev = thread->mddev;
        struct r5conf *conf = mddev->private;
        int handled;
        struct blk_plug plug;
@@ -5366,6 +5504,7 @@ static int run(struct mddev *mddev)
 
        if (mddev->queue) {
                int chunk_size;
+               bool discard_supported = true;
                /* read-ahead size must cover two whole stripes, which
                 * is 2 * (datadisks) * chunksize where 'n' is the
                 * number of raid devices
@@ -5385,13 +5524,48 @@ static int run(struct mddev *mddev)
                blk_queue_io_min(mddev->queue, chunk_size);
                blk_queue_io_opt(mddev->queue, chunk_size *
                                 (conf->raid_disks - conf->max_degraded));
+               /*
+                * We can only discard a whole stripe. It doesn't make sense to
+                * discard data disk but write parity disk
+                */
+               stripe = stripe * PAGE_SIZE;
+               mddev->queue->limits.discard_alignment = stripe;
+               mddev->queue->limits.discard_granularity = stripe;
+               /*
+                * unaligned part of discard request will be ignored, so can't
+                * guarantee discard_zerors_data
+                */
+               mddev->queue->limits.discard_zeroes_data = 0;
 
                rdev_for_each(rdev, mddev) {
                        disk_stack_limits(mddev->gendisk, rdev->bdev,
                                          rdev->data_offset << 9);
                        disk_stack_limits(mddev->gendisk, rdev->bdev,
                                          rdev->new_data_offset << 9);
+                       /*
+                        * discard_zeroes_data is required, otherwise data
+                        * could be lost. Consider a scenario: discard a stripe
+                        * (the stripe could be inconsistent if
+                        * discard_zeroes_data is 0); write one disk of the
+                        * stripe (the stripe could be inconsistent again
+                        * depending on which disks are used to calculate
+                        * parity); the disk is broken; The stripe data of this
+                        * disk is lost.
+                        */
+                       if (!blk_queue_discard(bdev_get_queue(rdev->bdev)) ||
+                           !bdev_get_queue(rdev->bdev)->
+                                               limits.discard_zeroes_data)
+                               discard_supported = false;
                }
+
+               if (discard_supported &&
+                  mddev->queue->limits.max_discard_sectors >= stripe &&
+                  mddev->queue->limits.discard_granularity >= stripe)
+                       queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,
+                                               mddev->queue);
+               else
+                       queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD,
+                                               mddev->queue);
        }
 
        return 0;
@@ -5702,7 +5876,8 @@ static int check_reshape(struct mddev *mddev)
        if (!check_stripe_cache(mddev))
                return -ENOSPC;
 
-       return resize_stripes(conf, conf->raid_disks + mddev->delta_disks);
+       return resize_stripes(conf, (conf->previous_raid_disks
+                                    + mddev->delta_disks));
 }
 
 static int raid5_start_reshape(struct mddev *mddev)
index a9fc24901edad817b599219e9fb4c596c4c9e29b..18b2c4a8a1fdf55af4af03ccd5ca71d2e84db1cb 100644 (file)
@@ -298,6 +298,7 @@ enum r5dev_flags {
        R5_WantReplace, /* We need to update the replacement, we have read
                         * data in, and now is a good time to write it out.
                         */
+       R5_Discard,     /* Discard the stripe */
 };
 
 /*
index e9ebb472b28ba6d5bb9e077e8b1a2f877797adb0..81e407d9677a73bc5329a9807492a5c580d17ec0 100644 (file)
@@ -2952,8 +2952,8 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
                            struct btrfs_inode_item *item,
                            struct inode *inode, int log_inode_only)
 {
-       btrfs_set_inode_uid(leaf, item, inode->i_uid);
-       btrfs_set_inode_gid(leaf, item, inode->i_gid);
+       btrfs_set_inode_uid(leaf, item, i_uid_read(inode));
+       btrfs_set_inode_gid(leaf, item, i_gid_read(inode));
        btrfs_set_inode_mode(leaf, item, inode->i_mode);
        btrfs_set_inode_nlink(leaf, item, inode->i_nlink);
 
index e622863b292f736fc8cc6e5d2ab8105986ad83bf..086f381d648954c4001542be40b3ba6beffbceb0 100644 (file)
 
 /* create a new cifs key */
 static int
-cifs_spnego_key_instantiate(struct key *key, const void *data, size_t datalen)
+cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        char *payload;
        int ret;
 
        ret = -ENOMEM;
-       payload = kmalloc(datalen, GFP_KERNEL);
+       payload = kmalloc(prep->datalen, GFP_KERNEL);
        if (!payload)
                goto error;
 
        /* attach the data */
-       memcpy(payload, data, datalen);
+       memcpy(payload, prep->data, prep->datalen);
        key->payload.data = payload;
        ret = 0;
 
index 2ee5c54797fa72633608eefd33dbe7fbfda27b58..fc783e264420a890751aa81e819fc8b53aaa1a81 100644 (file)
@@ -167,17 +167,17 @@ static struct shrinker cifs_shrinker = {
 };
 
 static int
-cifs_idmap_key_instantiate(struct key *key, const void *data, size_t datalen)
+cifs_idmap_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        char *payload;
 
-       payload = kmalloc(datalen, GFP_KERNEL);
+       payload = kmalloc(prep->datalen, GFP_KERNEL);
        if (!payload)
                return -ENOMEM;
 
-       memcpy(payload, data, datalen);
+       memcpy(payload, prep->data, prep->datalen);
        key->payload.data = payload;
-       key->datalen = datalen;
+       key->datalen = prep->datalen;
        return 0;
 }
 
index 11efd830b5f5e4c078279846f335d1560eb35487..9fbea87fdb6ef268209652101ff0fd3094424aa9 100644 (file)
@@ -45,7 +45,7 @@ static void posix_acl_fix_xattr_userns(
                        break;
                case ACL_GROUP:
                        gid = make_kgid(from, le32_to_cpu(entry->e_id));
-                       entry->e_id = cpu_to_le32(from_kuid(to, uid));
+                       entry->e_id = cpu_to_le32(from_kgid(to, gid));
                        break;
                default:
                        break;
diff --git a/include/asm-generic/bitops/count_zeros.h b/include/asm-generic/bitops/count_zeros.h
new file mode 100644 (file)
index 0000000..97520d2
--- /dev/null
@@ -0,0 +1,57 @@
+/* Count leading and trailing zeros functions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_
+#define _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_
+
+#include <asm/bitops.h>
+
+/**
+ * count_leading_zeros - Count the number of zeros from the MSB back
+ * @x: The value
+ *
+ * Count the number of leading zeros from the MSB going towards the LSB in @x.
+ *
+ * If the MSB of @x is set, the result is 0.
+ * If only the LSB of @x is set, then the result is BITS_PER_LONG-1.
+ * If @x is 0 then the result is COUNT_LEADING_ZEROS_0.
+ */
+static inline int count_leading_zeros(unsigned long x)
+{
+       if (sizeof(x) == 4)
+               return BITS_PER_LONG - fls(x);
+       else
+               return BITS_PER_LONG - fls64(x);
+}
+
+#define COUNT_LEADING_ZEROS_0 BITS_PER_LONG
+
+/**
+ * count_trailing_zeros - Count the number of zeros from the LSB forwards
+ * @x: The value
+ *
+ * Count the number of trailing zeros from the LSB going towards the MSB in @x.
+ *
+ * If the LSB of @x is set, the result is 0.
+ * If only the MSB of @x is set, then the result is BITS_PER_LONG-1.
+ * If @x is 0 then the result is COUNT_TRAILING_ZEROS_0.
+ */
+static inline int count_trailing_zeros(unsigned long x)
+{
+#define COUNT_TRAILING_ZEROS_0 (-1)
+
+       if (sizeof(x) == 4)
+               return ffs(x);
+       else
+               return (x != 0) ? __ffs(x) : COUNT_TRAILING_ZEROS_0;
+}
+
+#endif /* _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_ */
index ed5b44de4c915b27b61a2ef77dc58d0c69ecc569..14dc41d185a7a3163bc59f45a9df37588584fb65 100644 (file)
@@ -5,18 +5,44 @@
  * Many architectures just need a simple module
  * loader without arch specific data.
  */
+#ifndef CONFIG_HAVE_MOD_ARCH_SPECIFIC
 struct mod_arch_specific
 {
 };
+#endif
 
 #ifdef CONFIG_64BIT
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Sym Elf64_Sym
-#define Elf_Ehdr Elf64_Ehdr
-#else
-#define Elf_Shdr Elf32_Shdr
-#define Elf_Sym Elf32_Sym
-#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Shdr       Elf64_Shdr
+#define Elf_Phdr       Elf64_Phdr
+#define Elf_Sym                Elf64_Sym
+#define Elf_Dyn                Elf64_Dyn
+#define Elf_Ehdr       Elf64_Ehdr
+#define Elf_Addr       Elf64_Addr
+#ifdef CONFIG_MODULES_USE_ELF_REL
+#define Elf_Rel                Elf64_Rel
+#endif
+#ifdef CONFIG_MODULES_USE_ELF_RELA
+#define Elf_Rela       Elf64_Rela
+#endif
+#define ELF_R_TYPE(X)  ELF64_R_TYPE(X)
+#define ELF_R_SYM(X)   ELF64_R_SYM(X)
+
+#else /* CONFIG_64BIT */
+
+#define Elf_Shdr       Elf32_Shdr
+#define Elf_Phdr       Elf32_Phdr
+#define Elf_Sym                Elf32_Sym
+#define Elf_Dyn                Elf32_Dyn
+#define Elf_Ehdr       Elf32_Ehdr
+#define Elf_Addr       Elf32_Addr
+#ifdef CONFIG_MODULES_USE_ELF_REL
+#define Elf_Rel                Elf32_Rel
+#endif
+#ifdef CONFIG_MODULES_USE_ELF_RELA
+#define Elf_Rela       Elf32_Rela
+#endif
+#define ELF_R_TYPE(X)  ELF32_R_TYPE(X)
+#define ELF_R_SYM(X)   ELF32_R_SYM(X)
 #endif
 
 #endif /* __ASM_GENERIC_MODULE_H */
index 4e2e1cc505ab2f1ddbbf54e93353685d202efd79..d1ea7ce0b4cb95c9e61935aefbcb09c12f49bdbc 100644 (file)
                *(.scommon)                                             \
        }
 
+/*
+ * Allow archectures to redefine BSS_FIRST_SECTIONS to add extra
+ * sections to the front of bss.
+ */
+#ifndef BSS_FIRST_SECTIONS
+#define BSS_FIRST_SECTIONS
+#endif
+
 #define BSS(bss_align)                                                 \
        . = ALIGN(bss_align);                                           \
        .bss : AT(ADDR(.bss) - LOAD_OFFSET) {                           \
+               BSS_FIRST_SECTIONS                                      \
                *(.bss..page_aligned)                                   \
                *(.dynbss)                                              \
                *(.bss)                                                 \
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
new file mode 100644 (file)
index 0000000..f5b0224
--- /dev/null
@@ -0,0 +1,108 @@
+/* Asymmetric public-key algorithm definitions
+ *
+ * See Documentation/crypto/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_PUBLIC_KEY_H
+#define _LINUX_PUBLIC_KEY_H
+
+#include <linux/mpi.h>
+
+enum pkey_algo {
+       PKEY_ALGO_DSA,
+       PKEY_ALGO_RSA,
+       PKEY_ALGO__LAST
+};
+
+extern const char *const pkey_algo[PKEY_ALGO__LAST];
+
+enum pkey_hash_algo {
+       PKEY_HASH_MD4,
+       PKEY_HASH_MD5,
+       PKEY_HASH_SHA1,
+       PKEY_HASH_RIPE_MD_160,
+       PKEY_HASH_SHA256,
+       PKEY_HASH_SHA384,
+       PKEY_HASH_SHA512,
+       PKEY_HASH_SHA224,
+       PKEY_HASH__LAST
+};
+
+extern const char *const pkey_hash_algo[PKEY_HASH__LAST];
+
+enum pkey_id_type {
+       PKEY_ID_PGP,            /* OpenPGP generated key ID */
+       PKEY_ID_X509,           /* X.509 arbitrary subjectKeyIdentifier */
+       PKEY_ID_TYPE__LAST
+};
+
+extern const char *const pkey_id_type[PKEY_ID_TYPE__LAST];
+
+/*
+ * Cryptographic data for the public-key subtype of the asymmetric key type.
+ *
+ * Note that this may include private part of the key as well as the public
+ * part.
+ */
+struct public_key {
+       const struct public_key_algorithm *algo;
+       u8      capabilities;
+#define PKEY_CAN_ENCRYPT       0x01
+#define PKEY_CAN_DECRYPT       0x02
+#define PKEY_CAN_SIGN          0x04
+#define PKEY_CAN_VERIFY                0x08
+       enum pkey_id_type id_type : 8;
+       union {
+               MPI     mpi[5];
+               struct {
+                       MPI     p;      /* DSA prime */
+                       MPI     q;      /* DSA group order */
+                       MPI     g;      /* DSA group generator */
+                       MPI     y;      /* DSA public-key value = g^x mod p */
+                       MPI     x;      /* DSA secret exponent (if present) */
+               } dsa;
+               struct {
+                       MPI     n;      /* RSA public modulus */
+                       MPI     e;      /* RSA public encryption exponent */
+                       MPI     d;      /* RSA secret encryption exponent (if present) */
+                       MPI     p;      /* RSA secret prime (if present) */
+                       MPI     q;      /* RSA secret prime (if present) */
+               } rsa;
+       };
+};
+
+extern void public_key_destroy(void *payload);
+
+/*
+ * Public key cryptography signature data
+ */
+struct public_key_signature {
+       u8 *digest;
+       u8 digest_size;                 /* Number of bytes in digest */
+       u8 nr_mpi;                      /* Occupancy of mpi[] */
+       enum pkey_hash_algo pkey_hash_algo : 8;
+       union {
+               MPI mpi[2];
+               struct {
+                       MPI s;          /* m^d mod n */
+               } rsa;
+               struct {
+                       MPI r;
+                       MPI s;
+               } dsa;
+       };
+};
+
+struct key;
+extern int verify_signature(const struct key *key,
+                           const struct public_key_signature *sig);
+
+#endif /* _LINUX_PUBLIC_KEY_H */
diff --git a/include/keys/asymmetric-parser.h b/include/keys/asymmetric-parser.h
new file mode 100644 (file)
index 0000000..09b3b48
--- /dev/null
@@ -0,0 +1,37 @@
+/* Asymmetric public-key cryptography data parser
+ *
+ * See Documentation/crypto/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _KEYS_ASYMMETRIC_PARSER_H
+#define _KEYS_ASYMMETRIC_PARSER_H
+
+/*
+ * Key data parser.  Called during key instantiation.
+ */
+struct asymmetric_key_parser {
+       struct list_head        link;
+       struct module           *owner;
+       const char              *name;
+
+       /* Attempt to parse a key from the data blob passed to add_key() or
+        * keyctl_instantiate().  Should also generate a proposed description
+        * that the caller can optionally use for the key.
+        *
+        * Return EBADMSG if not recognised.
+        */
+       int (*parse)(struct key_preparsed_payload *prep);
+};
+
+extern int register_asymmetric_key_parser(struct asymmetric_key_parser *);
+extern void unregister_asymmetric_key_parser(struct asymmetric_key_parser *);
+
+#endif /* _KEYS_ASYMMETRIC_PARSER_H */
diff --git a/include/keys/asymmetric-subtype.h b/include/keys/asymmetric-subtype.h
new file mode 100644 (file)
index 0000000..4b840e8
--- /dev/null
@@ -0,0 +1,55 @@
+/* Asymmetric public-key cryptography key subtype
+ *
+ * See Documentation/security/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _KEYS_ASYMMETRIC_SUBTYPE_H
+#define _KEYS_ASYMMETRIC_SUBTYPE_H
+
+#include <linux/seq_file.h>
+#include <keys/asymmetric-type.h>
+
+struct public_key_signature;
+
+/*
+ * Keys of this type declare a subtype that indicates the handlers and
+ * capabilities.
+ */
+struct asymmetric_key_subtype {
+       struct module           *owner;
+       const char              *name;
+       unsigned short          name_len;       /* length of name */
+
+       /* Describe a key of this subtype for /proc/keys */
+       void (*describe)(const struct key *key, struct seq_file *m);
+
+       /* Destroy a key of this subtype */
+       void (*destroy)(void *payload);
+
+       /* Verify the signature on a key of this subtype (optional) */
+       int (*verify_signature)(const struct key *key,
+                               const struct public_key_signature *sig);
+};
+
+/**
+ * asymmetric_key_subtype - Get the subtype from an asymmetric key
+ * @key: The key of interest.
+ *
+ * Retrieves and returns the subtype pointer of the asymmetric key from the
+ * type-specific data attached to the key.
+ */
+static inline
+struct asymmetric_key_subtype *asymmetric_key_subtype(const struct key *key)
+{
+       return key->type_data.p[0];
+}
+
+#endif /* _KEYS_ASYMMETRIC_SUBTYPE_H */
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h
new file mode 100644 (file)
index 0000000..7dd4734
--- /dev/null
@@ -0,0 +1,25 @@
+/* Asymmetric Public-key cryptography key type interface
+ *
+ * See Documentation/security/asymmetric-keys.txt
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _KEYS_ASYMMETRIC_TYPE_H
+#define _KEYS_ASYMMETRIC_TYPE_H
+
+#include <linux/key-type.h>
+
+extern struct key_type key_type_asymmetric;
+
+/*
+ * The payload is at the discretion of the subtype.
+ */
+
+#endif /* _KEYS_ASYMMETRIC_TYPE_H */
index bc9ec1d7698cd730df2ef58c4a3ee58f1c067568..5e452c84f1e6741bc1b85405b2fce971c12051f0 100644 (file)
@@ -35,8 +35,10 @@ struct user_key_payload {
 extern struct key_type key_type_user;
 extern struct key_type key_type_logon;
 
-extern int user_instantiate(struct key *key, const void *data, size_t datalen);
-extern int user_update(struct key *key, const void *data, size_t datalen);
+struct key_preparsed_payload;
+
+extern int user_instantiate(struct key *key, struct key_preparsed_payload *prep);
+extern int user_update(struct key *key, struct key_preparsed_payload *prep);
 extern int user_match(const struct key *key, const void *criterion);
 extern void user_revoke(struct key *key);
 extern void user_destroy(struct key *key);
index d114db9477f43468b85a692e034f00d18ec2d596..5b57367e28db9b848de3e54c32830faa62793924 100644 (file)
@@ -22,390 +22,10 @@ header-y += wimax/
 
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
                  $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
-header-y += a.out.h
 endif
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
                  $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
-header-y += kvm.h
 endif
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
                  $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
-header-y += kvm_para.h
 endif
-
-header-y += acct.h
-header-y += adb.h
-header-y += adfs_fs.h
-header-y += affs_hardblocks.h
-header-y += agpgart.h
-header-y += aio_abi.h
-header-y += apm_bios.h
-header-y += arcfb.h
-header-y += atalk.h
-header-y += atm.h
-header-y += atm_eni.h
-header-y += atm_he.h
-header-y += atm_idt77105.h
-header-y += atm_nicstar.h
-header-y += atm_tcp.h
-header-y += atm_zatm.h
-header-y += atmapi.h
-header-y += atmarp.h
-header-y += atmbr2684.h
-header-y += atmclip.h
-header-y += atmdev.h
-header-y += atmioc.h
-header-y += atmlec.h
-header-y += atmmpc.h
-header-y += atmppp.h
-header-y += atmsap.h
-header-y += atmsvc.h
-header-y += audit.h
-header-y += auto_fs.h
-header-y += auto_fs4.h
-header-y += auxvec.h
-header-y += ax25.h
-header-y += b1lli.h
-header-y += baycom.h
-header-y += bfs_fs.h
-header-y += binfmts.h
-header-y += blk_types.h
-header-y += blkpg.h
-header-y += blktrace_api.h
-header-y += bpqether.h
-header-y += bsg.h
-header-y += can.h
-header-y += capability.h
-header-y += capi.h
-header-y += cciss_defs.h
-header-y += cciss_ioctl.h
-header-y += cdrom.h
-header-y += cgroupstats.h
-header-y += chio.h
-header-y += cm4000_cs.h
-header-y += cn_proc.h
-header-y += coda.h
-header-y += coda_psdev.h
-header-y += coff.h
-header-y += connector.h
-header-y += const.h
-header-y += cramfs_fs.h
-header-y += cuda.h
-header-y += cyclades.h
-header-y += cycx_cfm.h
-header-y += dcbnl.h
-header-y += dccp.h
-header-y += dlm.h
-header-y += dlm_device.h
-header-y += dlm_netlink.h
-header-y += dlm_plock.h
-header-y += dlmconstants.h
-header-y += dm-ioctl.h
-header-y += dm-log-userspace.h
-header-y += dn.h
-header-y += dqblk_xfs.h
-header-y += edd.h
-header-y += efs_fs_sb.h
-header-y += elf-em.h
-header-y += elf-fdpic.h
-header-y += elf.h
-header-y += elfcore.h
-header-y += errno.h
-header-y += errqueue.h
-header-y += ethtool.h
-header-y += eventpoll.h
-header-y += fadvise.h
-header-y += falloc.h
-header-y += fanotify.h
-header-y += fb.h
-header-y += fcntl.h
-header-y += fd.h
-header-y += fdreg.h
-header-y += fib_rules.h
-header-y += fiemap.h
-header-y += filter.h
-header-y += firewire-cdev.h
-header-y += firewire-constants.h
-header-y += flat.h
-header-y += fs.h
-header-y += fsl_hypervisor.h
-header-y += fuse.h
-header-y += futex.h
-header-y += gameport.h
-header-y += gen_stats.h
-header-y += genetlink.h
-header-y += gfs2_ondisk.h
-header-y += gigaset_dev.h
-header-y += hdlc.h
-header-y += hdlcdrv.h
-header-y += hdreg.h
-header-y += hid.h
-header-y += hiddev.h
-header-y += hidraw.h
-header-y += hpet.h
-header-y += hysdn_if.h
-header-y += i2c-dev.h
-header-y += i2c.h
-header-y += i2o-dev.h
-header-y += i8k.h
-header-y += icmp.h
-header-y += icmpv6.h
-header-y += if.h
-header-y += if_addr.h
-header-y += if_addrlabel.h
-header-y += if_alg.h
-header-y += if_arcnet.h
-header-y += if_arp.h
-header-y += if_bonding.h
-header-y += if_bridge.h
-header-y += if_cablemodem.h
-header-y += if_eql.h
-header-y += if_ether.h
-header-y += if_fc.h
-header-y += if_fddi.h
-header-y += if_frad.h
-header-y += if_hippi.h
-header-y += if_infiniband.h
-header-y += if_link.h
-header-y += if_ltalk.h
-header-y += if_packet.h
-header-y += if_phonet.h
-header-y += if_plip.h
-header-y += if_ppp.h
-header-y += if_pppol2tp.h
-header-y += if_pppox.h
-header-y += if_slip.h
-header-y += if_team.h
-header-y += if_tun.h
-header-y += if_tunnel.h
-header-y += if_vlan.h
-header-y += if_x25.h
-header-y += igmp.h
-header-y += in.h
-header-y += in6.h
-header-y += in_route.h
-header-y += sock_diag.h
-header-y += inet_diag.h
-header-y += unix_diag.h
-header-y += packet_diag.h
-header-y += inotify.h
-header-y += input.h
-header-y += ioctl.h
-header-y += ip.h
-header-y += ip6_tunnel.h
-header-y += ip_vs.h
-header-y += ipc.h
-header-y += ipmi.h
-header-y += ipmi_msgdefs.h
-header-y += ipsec.h
-header-y += ipv6.h
-header-y += ipv6_route.h
-header-y += ipx.h
-header-y += irda.h
-header-y += irqnr.h
-header-y += isdn.h
-header-y += isdn_divertif.h
-header-y += isdn_ppp.h
-header-y += isdnif.h
-header-y += iso_fs.h
-header-y += ivtv.h
-header-y += ivtvfb.h
-header-y += ixjuser.h
-header-y += jffs2.h
-header-y += joystick.h
-header-y += kd.h
-header-y += kdev_t.h
-header-y += kernel.h
-header-y += kernelcapi.h
-header-y += kernel-page-flags.h
-header-y += kexec.h
-header-y += keyboard.h
-header-y += keyctl.h
-header-y += l2tp.h
-header-y += limits.h
-header-y += llc.h
-header-y += loop.h
-header-y += lp.h
-header-y += magic.h
-header-y += major.h
-header-y += map_to_7segment.h
-header-y += matroxfb.h
-header-y += mdio.h
-header-y += media.h
-header-y += mei.h
-header-y += mempolicy.h
-header-y += meye.h
-header-y += mii.h
-header-y += minix_fs.h
-header-y += mman.h
-header-y += mmtimer.h
-header-y += mqueue.h
-header-y += mroute.h
-header-y += mroute6.h
-header-y += msdos_fs.h
-header-y += msg.h
-header-y += mtio.h
-header-y += n_r3964.h
-header-y += nbd.h
-header-y += ncp.h
-header-y += ncp_fs.h
-header-y += ncp_mount.h
-header-y += ncp_no.h
-header-y += neighbour.h
-header-y += net.h
-header-y += net_dropmon.h
-header-y += net_tstamp.h
-header-y += netdevice.h
-header-y += netfilter.h
-header-y += netfilter_arp.h
-header-y += netfilter_bridge.h
-header-y += netfilter_decnet.h
-header-y += netfilter_ipv4.h
-header-y += netfilter_ipv6.h
-header-y += netlink.h
-header-y += netrom.h
-header-y += nfc.h
-header-y += nfs.h
-header-y += nfs2.h
-header-y += nfs3.h
-header-y += nfs4.h
-header-y += nfs4_mount.h
-header-y += nfs_fs.h
-header-y += nfs_idmap.h
-header-y += nfs_mount.h
-header-y += nfsacl.h
-header-y += nl80211.h
-header-y += nubus.h
-header-y += nvram.h
-header-y += omap3isp.h
-header-y += omapfb.h
-header-y += oom.h
-header-y += param.h
-header-y += parport.h
-header-y += patchkey.h
-header-y += pci.h
-header-y += pci_regs.h
-header-y += perf_event.h
-header-y += personality.h
-header-y += pfkeyv2.h
-header-y += pg.h
-header-y += phantom.h
-header-y += phonet.h
-header-y += pkt_cls.h
-header-y += pkt_sched.h
-header-y += pktcdvd.h
-header-y += pmu.h
-header-y += poll.h
-header-y += posix_types.h
-header-y += ppdev.h
-header-y += ppp-comp.h
-header-y += ppp-ioctl.h
-header-y += ppp_defs.h
-header-y += pps.h
-header-y += prctl.h
-header-y += ptp_clock.h
-header-y += ptrace.h
-header-y += qnx4_fs.h
-header-y += qnxtypes.h
-header-y += quota.h
-header-y += radeonfb.h
-header-y += random.h
-header-y += raw.h
-header-y += rds.h
-header-y += reboot.h
-header-y += reiserfs_fs.h
-header-y += reiserfs_xattr.h
-header-y += resource.h
-header-y += rfkill.h
-header-y += romfs_fs.h
-header-y += rose.h
-header-y += route.h
-header-y += rtc.h
-header-y += rtnetlink.h
-header-y += scc.h
-header-y += sched.h
-header-y += screen_info.h
-header-y += sdla.h
-header-y += seccomp.h
-header-y += securebits.h
-header-y += selinux_netlink.h
-header-y += sem.h
-header-y += serial.h
-header-y += serial_core.h
-header-y += serial_reg.h
-header-y += serio.h
-header-y += shm.h
-header-y += signal.h
-header-y += signalfd.h
-header-y += snmp.h
-header-y += socket.h
-header-y += sockios.h
-header-y += som.h
-header-y += sonet.h
-header-y += sonypi.h
-header-y += sound.h
-header-y += soundcard.h
-header-y += stat.h
-header-y += stddef.h
-header-y += string.h
-header-y += suspend_ioctls.h
-header-y += swab.h
-header-y += synclink.h
-header-y += sysctl.h
-header-y += sysinfo.h
-header-y += taskstats.h
-header-y += tcp.h
-header-y += tcp_metrics.h
-header-y += telephony.h
-header-y += termios.h
-header-y += time.h
-header-y += times.h
-header-y += timex.h
-header-y += tiocl.h
-header-y += tipc.h
-header-y += tipc_config.h
-header-y += toshiba.h
-header-y += tty.h
-header-y += tty_flags.h
-header-y += types.h
-header-y += udf_fs_i.h
-header-y += udp.h
-header-y += uhid.h
-header-y += uinput.h
-header-y += uio.h
-header-y += ultrasound.h
-header-y += un.h
-header-y += unistd.h
-header-y += usbdevice_fs.h
-header-y += utime.h
-header-y += utsname.h
-header-y += uuid.h
-header-y += uvcvideo.h
-header-y += v4l2-common.h
-header-y += v4l2-controls.h
-header-y += v4l2-dv-timings.h
-header-y += v4l2-mediabus.h
-header-y += v4l2-subdev.h
-header-y += veth.h
-header-y += vfio.h
-header-y += vhost.h
-header-y += videodev2.h
-header-y += virtio_9p.h
-header-y += virtio_balloon.h
-header-y += virtio_blk.h
-header-y += virtio_config.h
-header-y += virtio_console.h
-header-y += virtio_ids.h
-header-y += virtio_net.h
-header-y += virtio_pci.h
-header-y += virtio_ring.h
-header-y += virtio_rng.h
-header-y += vt.h
-header-y += wait.h
-header-y += wanrouter.h
-header-y += watchdog.h
-header-y += wimax.h
-header-y += wireless.h
-header-y += x25.h
-header-y += xattr.h
-header-y += xfrm.h
index e86dfca44589f49e083e53a3f905868ba2e89955..220f1433889566f681c738b3c7a9bd3e23f62db5 100644 (file)
 #ifndef __A_OUT_GNU_H__
 #define __A_OUT_GNU_H__
 
-#define __GNU_EXEC_MACROS__
-
-#ifndef __STRUCT_EXEC_OVERRIDE__
-
-#include <asm/a.out.h>
-
-#endif /* __STRUCT_EXEC_OVERRIDE__ */
+#include <uapi/linux/a.out.h>
 
 #ifndef __ASSEMBLY__
-
-/* these go in the N_MACHTYPE field */
-enum machine_type {
 #if defined (M_OLDSUN2)
-  M__OLDSUN2 = M_OLDSUN2,
 #else
-  M_OLDSUN2 = 0,
 #endif
 #if defined (M_68010)
-  M__68010 = M_68010,
 #else
-  M_68010 = 1,
 #endif
 #if defined (M_68020)
-  M__68020 = M_68020,
 #else
-  M_68020 = 2,
 #endif
 #if defined (M_SPARC)
-  M__SPARC = M_SPARC,
 #else
-  M_SPARC = 3,
 #endif
-  /* skip a bunch so we don't run into any of sun's numbers */
-  M_386 = 100,
-  M_MIPS1 = 151,       /* MIPS R3000/R3000 binary */
-  M_MIPS2 = 152                /* MIPS R6000/R4000 binary */
-};
-
 #if !defined (N_MAGIC)
-#define N_MAGIC(exec) ((exec).a_info & 0xffff)
 #endif
-#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
-#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
-#define N_SET_INFO(exec, magic, type, flags) \
-       ((exec).a_info = ((magic) & 0xffff) \
-        | (((int)(type) & 0xff) << 16) \
-        | (((flags) & 0xff) << 24))
-#define N_SET_MAGIC(exec, magic) \
-       ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
-
-#define N_SET_MACHTYPE(exec, machtype) \
-       ((exec).a_info = \
-        ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
-
-#define N_SET_FLAGS(exec, flags) \
-       ((exec).a_info = \
-        ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
-
-/* Code indicating object file or impure executable.  */
-#define OMAGIC 0407
-/* Code indicating pure executable.  */
-#define NMAGIC 0410
-/* Code indicating demand-paged executable.  */
-#define ZMAGIC 0413
-/* This indicates a demand-paged executable with the header in the text. 
-   The first page is unmapped to help trap NULL pointer references */
-#define QMAGIC 0314
-
-/* Code indicating core file.  */
-#define CMAGIC 0421
-
 #if !defined (N_BADMAG)
-#define N_BADMAG(x)      (N_MAGIC(x) != OMAGIC         \
-                       && N_MAGIC(x) != NMAGIC         \
-                       && N_MAGIC(x) != ZMAGIC \
-                       && N_MAGIC(x) != QMAGIC)
 #endif
-
-#define _N_HDROFF(x) (1024 - sizeof (struct exec))
-
 #if !defined (N_TXTOFF)
-#define N_TXTOFF(x) \
- (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
-  (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
 #endif
-
 #if !defined (N_DATOFF)
-#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
 #endif
-
 #if !defined (N_TRELOFF)
-#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
 #endif
-
 #if !defined (N_DRELOFF)
-#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
 #endif
-
 #if !defined (N_SYMOFF)
-#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
 #endif
-
 #if !defined (N_STROFF)
-#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
 #endif
-
-/* Address of text segment in memory after it is loaded.  */
 #if !defined (N_TXTADDR)
-#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
 #endif
-
-/* Address of data segment in memory after it is loaded.
-   Note that it is up to you to define SEGMENT_SIZE
-   on machines not listed here.  */
 #if defined(vax) || defined(hp300) || defined(pyr)
-#define SEGMENT_SIZE page_size
 #endif
 #ifdef sony
-#define        SEGMENT_SIZE    0x2000
 #endif /* Sony.  */
 #ifdef is68k
-#define SEGMENT_SIZE 0x20000
 #endif
 #if defined(m68k) && defined(PORTAR)
-#define PAGE_SIZE 0x400
-#define SEGMENT_SIZE PAGE_SIZE
 #endif
-
 #ifdef linux
-#ifdef __KERNEL__
 #include <asm/page.h>
-#else
-#include <unistd.h>
-#endif
 #if defined(__i386__) || defined(__mc68000__)
-#define SEGMENT_SIZE   1024
 #else
 #ifndef SEGMENT_SIZE
-#ifdef __KERNEL__
 #define SEGMENT_SIZE   PAGE_SIZE
-#else
-#define SEGMENT_SIZE   getpagesize()
-#endif
 #endif
 #endif
 #endif
-
-#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
-
-#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
-
 #ifndef N_DATADDR
-#define N_DATADDR(x) \
-    (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
-     : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
 #endif
-
-/* Address of bss segment in memory after it is loaded.  */
 #if !defined (N_BSSADDR)
-#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
 #endif
-\f
 #if !defined (N_NLIST_DECLARED)
-struct nlist {
-  union {
-    char *n_name;
-    struct nlist *n_next;
-    long n_strx;
-  } n_un;
-  unsigned char n_type;
-  char n_other;
-  short n_desc;
-  unsigned long n_value;
-};
 #endif /* no N_NLIST_DECLARED.  */
-
 #if !defined (N_UNDF)
-#define N_UNDF 0
 #endif
 #if !defined (N_ABS)
-#define N_ABS 2
 #endif
 #if !defined (N_TEXT)
-#define N_TEXT 4
 #endif
 #if !defined (N_DATA)
-#define N_DATA 6
 #endif
 #if !defined (N_BSS)
-#define N_BSS 8
 #endif
 #if !defined (N_FN)
-#define N_FN 15
 #endif
-
 #if !defined (N_EXT)
-#define N_EXT 1
 #endif
 #if !defined (N_TYPE)
-#define N_TYPE 036
 #endif
 #if !defined (N_STAB)
-#define N_STAB 0340
 #endif
-
-/* The following type indicates the definition of a symbol as being
-   an indirect reference to another symbol.  The other symbol
-   appears as an undefined reference, immediately following this symbol.
-
-   Indirection is asymmetrical.  The other symbol's value will be used
-   to satisfy requests for the indirect symbol, but not vice versa.
-   If the other symbol does not have a definition, libraries will
-   be searched to find a definition.  */
-#define N_INDR 0xa
-
-/* The following symbols refer to set elements.
-   All the N_SET[ATDB] symbols with the same name form one set.
-   Space is allocated for the set in the text section, and each set
-   element's value is stored into one word of the space.
-   The first word of the space is the length of the set (number of elements).
-
-   The address of the set is made into an N_SETV symbol
-   whose name is the same as the name of the set.
-   This symbol acts like a N_DATA global symbol
-   in that it can satisfy undefined external references.  */
-
-/* These appear as input to LD, in a .o file.  */
-#define        N_SETA  0x14            /* Absolute set element symbol */
-#define        N_SETT  0x16            /* Text set element symbol */
-#define        N_SETD  0x18            /* Data set element symbol */
-#define        N_SETB  0x1A            /* Bss set element symbol */
-
-/* This is output from LD.  */
-#define N_SETV 0x1C            /* Pointer to set vector in data area.  */
-\f
 #if !defined (N_RELOCATION_INFO_DECLARED)
-/* This structure describes a single relocation to be performed.
-   The text-relocation section of the file is a vector of these structures,
-   all of which apply to the text section.
-   Likewise, the data-relocation section applies to the data section.  */
-
-struct relocation_info
-{
-  /* Address (within segment) to be relocated.  */
-  int r_address;
-  /* The meaning of r_symbolnum depends on r_extern.  */
-  unsigned int r_symbolnum:24;
-  /* Nonzero means value is a pc-relative offset
-     and it should be relocated for changes in its own address
-     as well as for changes in the symbol or section specified.  */
-  unsigned int r_pcrel:1;
-  /* Length (as exponent of 2) of the field to be relocated.
-     Thus, a value of 2 indicates 1<<2 bytes.  */
-  unsigned int r_length:2;
-  /* 1 => relocate with value of symbol.
-          r_symbolnum is the index of the symbol
-         in file's the symbol table.
-     0 => relocate with the address of a segment.
-          r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
-         (the N_EXT bit may be set also, but signifies nothing).  */
-  unsigned int r_extern:1;
-  /* Four bits that aren't used, but when writing an object file
-     it is desirable to clear them.  */
 #ifdef NS32K
-  unsigned r_bsr:1;
-  unsigned r_disp:1;
-  unsigned r_pad:2;
 #else
-  unsigned int r_pad:4;
 #endif
-};
 #endif /* no N_RELOCATION_INFO_DECLARED.  */
-
 #endif /*__ASSEMBLY__ */
 #endif /* __A_OUT_GNU_H__ */
index d537aa0ec414a2dc70b84580a0799096e601ee3c..4a5b7cb56079121152b780d7a75e54f43de4f344 100644 (file)
  *  Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
  *
  */
-
 #ifndef _LINUX_ACCT_H
 #define _LINUX_ACCT_H
 
-#include <linux/types.h>
-
-#include <asm/param.h>
-#include <asm/byteorder.h>
-
-/* 
- *  comp_t is a 16-bit "floating" point number with a 3-bit base 8
- *  exponent and a 13-bit fraction.
- *  comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
- *  (leading 1 not stored).
- *  See linux/kernel/acct.c for the specific encoding systems used.
- */
-
-typedef __u16  comp_t;
-typedef __u32  comp2_t;
-
-/*
- *   accounting file record
- *
- *   This structure contains all of the information written out to the
- *   process accounting file whenever a process exits.
- */
+#include <uapi/linux/acct.h>
 
-#define ACCT_COMM      16
-
-struct acct
-{
-       char            ac_flag;                /* Flags */
-       char            ac_version;             /* Always set to ACCT_VERSION */
-       /* for binary compatibility back until 2.0 */
-       __u16           ac_uid16;               /* LSB of Real User ID */
-       __u16           ac_gid16;               /* LSB of Real Group ID */
-       __u16           ac_tty;                 /* Control Terminal */
-       __u32           ac_btime;               /* Process Creation Time */
-       comp_t          ac_utime;               /* User Time */
-       comp_t          ac_stime;               /* System Time */
-       comp_t          ac_etime;               /* Elapsed Time */
-       comp_t          ac_mem;                 /* Average Memory Usage */
-       comp_t          ac_io;                  /* Chars Transferred */
-       comp_t          ac_rw;                  /* Blocks Read or Written */
-       comp_t          ac_minflt;              /* Minor Pagefaults */
-       comp_t          ac_majflt;              /* Major Pagefaults */
-       comp_t          ac_swaps;               /* Number of Swaps */
-/* m68k had no padding here. */
-#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
-       __u16           ac_ahz;                 /* AHZ */
-#endif
-       __u32           ac_exitcode;            /* Exitcode */
-       char            ac_comm[ACCT_COMM + 1]; /* Command Name */
-       __u8            ac_etime_hi;            /* Elapsed Time MSB */
-       __u16           ac_etime_lo;            /* Elapsed Time LSB */
-       __u32           ac_uid;                 /* Real User ID */
-       __u32           ac_gid;                 /* Real Group ID */
-};
-
-struct acct_v3
-{
-       char            ac_flag;                /* Flags */
-       char            ac_version;             /* Always set to ACCT_VERSION */
-       __u16           ac_tty;                 /* Control Terminal */
-       __u32           ac_exitcode;            /* Exitcode */
-       __u32           ac_uid;                 /* Real User ID */
-       __u32           ac_gid;                 /* Real Group ID */
-       __u32           ac_pid;                 /* Process ID */
-       __u32           ac_ppid;                /* Parent Process ID */
-       __u32           ac_btime;               /* Process Creation Time */
-#ifdef __KERNEL__
-       __u32           ac_etime;               /* Elapsed Time */
-#else
-       float           ac_etime;               /* Elapsed Time */
-#endif
-       comp_t          ac_utime;               /* User Time */
-       comp_t          ac_stime;               /* System Time */
-       comp_t          ac_mem;                 /* Average Memory Usage */
-       comp_t          ac_io;                  /* Chars Transferred */
-       comp_t          ac_rw;                  /* Blocks Read or Written */
-       comp_t          ac_minflt;              /* Minor Pagefaults */
-       comp_t          ac_majflt;              /* Major Pagefaults */
-       comp_t          ac_swaps;               /* Number of Swaps */
-       char            ac_comm[ACCT_COMM];     /* Command Name */
-};
-
-/*
- *  accounting flags
- */
-                               /* bit set when the process ... */
-#define AFORK          0x01    /* ... executed fork, but did not exec */
-#define ASU            0x02    /* ... used super-user privileges */
-#define ACOMPAT                0x04    /* ... used compatibility mode (VAX only not used) */
-#define ACORE          0x08    /* ... dumped core */
-#define AXSIG          0x10    /* ... was killed by a signal */
-
-#ifdef __BIG_ENDIAN
-#define ACCT_BYTEORDER 0x80    /* accounting file is big endian */
-#else
-#define ACCT_BYTEORDER 0x00    /* accounting file is little endian */
-#endif
-
-#ifdef __KERNEL__
 
 
 #ifdef CONFIG_BSD_PROCESS_ACCT
@@ -163,12 +65,6 @@ typedef struct acct_v3 acct_t;
 typedef struct acct acct_t;
 #endif
 
-#else
-#define ACCT_VERSION   2
-#define AHZ            (HZ)
-#endif /* __KERNEL */
-
-#ifdef __KERNEL__
 #include <linux/jiffies.h>
 /*
  * Yet another set of HZ to *HZ helper functions.
@@ -210,6 +106,4 @@ static inline u64 nsec_to_AHZ(u64 x)
        return x;
 }
 
-#endif  /* __KERNEL */
-
 #endif /* _LINUX_ACCT_H */
index 63bca502fa55edf8ffd9df6e7c44f2c4c2f83e3c..cde41300c7ad8679964e17447e82b143922d30de 100644 (file)
@@ -4,43 +4,8 @@
 #ifndef __ADB_H
 #define __ADB_H
 
-/* ADB commands */
-#define ADB_BUSRESET           0
-#define ADB_FLUSH(id)          (0x01 | ((id) << 4))
-#define ADB_WRITEREG(id, reg)  (0x08 | (reg) | ((id) << 4))
-#define ADB_READREG(id, reg)   (0x0C | (reg) | ((id) << 4))
+#include <uapi/linux/adb.h>
 
-/* ADB default device IDs (upper 4 bits of ADB command byte) */
-#define ADB_DONGLE     1       /* "software execution control" devices */
-#define ADB_KEYBOARD   2
-#define ADB_MOUSE      3
-#define ADB_TABLET     4
-#define ADB_MODEM      5
-#define ADB_MISC       7       /* maybe a monitor */
-
-#define ADB_RET_OK     0
-#define ADB_RET_TIMEOUT        3
-
-/* The kind of ADB request. The controller may emulate some
-   or all of those CUDA/PMU packet kinds */
-#define ADB_PACKET     0
-#define CUDA_PACKET    1
-#define ERROR_PACKET   2
-#define TIMER_PACKET   3
-#define POWER_PACKET   4
-#define MACIIC_PACKET  5
-#define PMU_PACKET     6
-#define ADB_QUERY      7
-
-/* ADB queries */
-
-/* ADB_QUERY_GETDEVINFO
- * Query ADB slot for device presence
- * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
- */
-#define ADB_QUERY_GETDEVINFO   1
-
-#ifdef __KERNEL__
 
 struct adb_request {
        unsigned char data[32];
@@ -98,6 +63,4 @@ int adb_reset_bus(void);
 int adb_try_handler_change(int address, int new_id);
 int adb_get_infos(int address, int *original_address, int *handler_id);
 
-#endif /* __KERNEL__ */
-
 #endif /* __ADB_H */
index b19801f73890b73f6661910fc64e223d33e76560..0d991071a9d4beb147c2f60e3102723ceac7ffd7 100644 (file)
@@ -1,46 +1,8 @@
 #ifndef _ADFS_FS_H
 #define _ADFS_FS_H
 
-#include <linux/types.h>
-#include <linux/magic.h>
+#include <uapi/linux/adfs_fs.h>
 
-/*
- * Disc Record at disc address 0xc00
- */
-struct adfs_discrecord {
-    __u8  log2secsize;
-    __u8  secspertrack;
-    __u8  heads;
-    __u8  density;
-    __u8  idlen;
-    __u8  log2bpmb;
-    __u8  skew;
-    __u8  bootoption;
-    __u8  lowsector;
-    __u8  nzones;
-    __le16 zone_spare;
-    __le32 root;
-    __le32 disc_size;
-    __le16 disc_id;
-    __u8  disc_name[10];
-    __le32 disc_type;
-    __le32 disc_size_high;
-    __u8  log2sharesize:4;
-    __u8  unused40:4;
-    __u8  big_flag:1;
-    __u8  unused41:1;
-    __u8  nzones_high;
-    __le32 format_version;
-    __le32 root_size;
-    __u8  unused52[60 - 52];
-};
-
-#define ADFS_DISCRECORD                (0xc00)
-#define ADFS_DR_OFFSET         (0x1c0)
-#define ADFS_DR_SIZE            60
-#define ADFS_DR_SIZE_BITS      (ADFS_DR_SIZE << 3)
-
-#ifdef __KERNEL__
 /*
  * Calculate the boot block checksum on an ADFS drive.  Note that this will
  * appear to be correct if the sector contains all zeros, so also check that
@@ -59,5 +21,3 @@ static inline int adfs_checkbblk(unsigned char *ptr)
        return (result & 0xff) != ptr[511];
 }
 #endif
-
-#endif
index f6778eceb8f4058bbc932d9ead806968e2a27b6e..c6b61ca97053e933affe7ddd76bc9da792fcbc59 100644 (file)
  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  */
-
 #ifndef _AGP_H
 #define _AGP_H 1
 
-#define AGPIOC_BASE       'A'
-#define AGPIOC_INFO       _IOR (AGPIOC_BASE, 0, struct agp_info*)
-#define AGPIOC_ACQUIRE    _IO  (AGPIOC_BASE, 1)
-#define AGPIOC_RELEASE    _IO  (AGPIOC_BASE, 2)
-#define AGPIOC_SETUP      _IOW (AGPIOC_BASE, 3, struct agp_setup*)
-#define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, struct agp_region*)
-#define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, struct agp_region*)
-#define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
-#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
-#define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, struct agp_bind*)
-#define AGPIOC_UNBIND     _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
-#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
-
-#define AGP_DEVICE      "/dev/agpgart"
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef __KERNEL__
-#include <linux/types.h>
-
-struct agp_version {
-       __u16 major;
-       __u16 minor;
-};
-
-typedef struct _agp_info {
-       struct agp_version version;     /* version of the driver        */
-       __u32 bridge_id;        /* bridge vendor/device         */
-       __u32 agp_mode;         /* mode info of bridge          */
-       unsigned long aper_base;/* base of aperture             */
-       size_t aper_size;       /* size of aperture             */
-       size_t pg_total;        /* max pages (swap + system)    */
-       size_t pg_system;       /* max pages (system)           */
-       size_t pg_used;         /* current pages used           */
-} agp_info;
-
-typedef struct _agp_setup {
-       __u32 agp_mode;         /* mode info of bridge          */
-} agp_setup;
-
-/*
- * The "prot" down below needs still a "sleep" flag somehow ...
- */
-typedef struct _agp_segment {
-       __kernel_off_t pg_start;        /* starting page to populate    */
-       __kernel_size_t pg_count;       /* number of pages              */
-       int prot;                       /* prot flags for mmap          */
-} agp_segment;
-
-typedef struct _agp_region {
-       __kernel_pid_t pid;             /* pid of process       */
-       __kernel_size_t seg_count;      /* number of segments   */
-       struct _agp_segment *seg_list;
-} agp_region;
-
-typedef struct _agp_allocate {
-       int key;                /* tag of allocation            */
-       __kernel_size_t pg_count;/* number of pages             */
-       __u32 type;             /* 0 == normal, other devspec   */
-       __u32 physical;         /* device specific (some devices  
-                                * need a phys address of the     
-                                * actual page behind the gatt    
-                                * table)                        */
-} agp_allocate;
-
-typedef struct _agp_bind {
-       int key;                /* tag of allocation            */
-       __kernel_off_t pg_start;/* starting page to populate    */
-} agp_bind;
-
-typedef struct _agp_unbind {
-       int key;                /* tag of allocation            */
-       __u32 priority;         /* priority for paging out      */
-} agp_unbind;
-
-#else                          /* __KERNEL__ */
 #include <linux/mutex.h>
 #include <linux/agp_backend.h>
+#include <uapi/linux/agpgart.h>
 
 #define AGPGART_MINOR 175
 
@@ -209,6 +127,4 @@ struct agp_front_data {
        bool backend_acquired;
 };
 
-#endif                         /* __KERNEL__ */
-
 #endif                         /* _AGP_H */
index 01a6244c9bc9b52f0583449d667a1a34f2a95dd7..9c3a87184f48686433bd6f600fac83c7ce5df550 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef _LINUX_APM_H
-#define _LINUX_APM_H
-
 /*
  * Include file for the interface to an APM BIOS
  * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  */
+#ifndef _LINUX_APM_H
+#define _LINUX_APM_H
 
-#include <linux/types.h>
-
-typedef unsigned short apm_event_t;
-typedef unsigned short apm_eventinfo_t;
-
-struct apm_bios_info {
-       __u16   version;
-       __u16   cseg;
-       __u32   offset;
-       __u16   cseg_16;
-       __u16   dseg;
-       __u16   flags;
-       __u16   cseg_len;
-       __u16   cseg_16_len;
-       __u16   dseg_len;
-};
+#include <uapi/linux/apm_bios.h>
 
-#ifdef __KERNEL__
 
 #define APM_CS         (GDT_ENTRY_APMBIOS_BASE * 8)
 #define APM_CS_16      (APM_CS + 8)
@@ -110,111 +93,9 @@ struct apm_info {
  */
 extern struct apm_info apm_info;
 
-#endif /* __KERNEL__ */
-
-/*
- * Power states
- */
-#define APM_STATE_READY                0x0000
-#define APM_STATE_STANDBY      0x0001
-#define APM_STATE_SUSPEND      0x0002
-#define APM_STATE_OFF          0x0003
-#define APM_STATE_BUSY         0x0004
-#define APM_STATE_REJECT       0x0005
-#define APM_STATE_OEM_SYS      0x0020
-#define APM_STATE_OEM_DEV      0x0040
-
-#define APM_STATE_DISABLE      0x0000
-#define APM_STATE_ENABLE       0x0001
-
-#define APM_STATE_DISENGAGE    0x0000
-#define APM_STATE_ENGAGE       0x0001
-
-/*
- * Events (results of Get PM Event)
- */
-#define APM_SYS_STANDBY                0x0001
-#define APM_SYS_SUSPEND                0x0002
-#define APM_NORMAL_RESUME      0x0003
-#define APM_CRITICAL_RESUME    0x0004
-#define APM_LOW_BATTERY                0x0005
-#define APM_POWER_STATUS_CHANGE        0x0006
-#define APM_UPDATE_TIME                0x0007
-#define APM_CRITICAL_SUSPEND   0x0008
-#define APM_USER_STANDBY       0x0009
-#define APM_USER_SUSPEND       0x000a
-#define APM_STANDBY_RESUME     0x000b
-#define APM_CAPABILITY_CHANGE  0x000c
-
-/*
- * Error codes
- */
-#define APM_SUCCESS            0x00
-#define APM_DISABLED           0x01
-#define APM_CONNECTED          0x02
-#define APM_NOT_CONNECTED      0x03
-#define APM_16_CONNECTED       0x05
-#define APM_16_UNSUPPORTED     0x06
-#define APM_32_CONNECTED       0x07
-#define APM_32_UNSUPPORTED     0x08
-#define APM_BAD_DEVICE         0x09
-#define APM_BAD_PARAM          0x0a
-#define APM_NOT_ENGAGED                0x0b
-#define APM_BAD_FUNCTION       0x0c
-#define APM_RESUME_DISABLED    0x0d
-#define APM_NO_ERROR           0x53
-#define APM_BAD_STATE          0x60
-#define APM_NO_EVENTS          0x80
-#define APM_NOT_PRESENT                0x86
-
-/*
- * APM Device IDs
- */
-#define APM_DEVICE_BIOS                0x0000
-#define APM_DEVICE_ALL         0x0001
-#define APM_DEVICE_DISPLAY     0x0100
-#define APM_DEVICE_STORAGE     0x0200
-#define APM_DEVICE_PARALLEL    0x0300
-#define APM_DEVICE_SERIAL      0x0400
-#define APM_DEVICE_NETWORK     0x0500
-#define APM_DEVICE_PCMCIA      0x0600
-#define APM_DEVICE_BATTERY     0x8000
-#define APM_DEVICE_OEM         0xe000
-#define APM_DEVICE_OLD_ALL     0xffff
-#define APM_DEVICE_CLASS       0x00ff
-#define APM_DEVICE_MASK                0xff00
-
-#ifdef __KERNEL__
 /*
  * This is the "All Devices" ID communicated to the BIOS
  */
 #define APM_DEVICE_BALL                ((apm_info.connection_version > 0x0100) ? \
                                 APM_DEVICE_ALL : APM_DEVICE_OLD_ALL)
-#endif
-
-/*
- * Battery status
- */
-#define APM_MAX_BATTERIES      2
-
-/*
- * APM defined capability bit flags
- */
-#define APM_CAP_GLOBAL_STANDBY         0x0001
-#define APM_CAP_GLOBAL_SUSPEND         0x0002
-#define APM_CAP_RESUME_STANDBY_TIMER   0x0004 /* Timer resume from standby */
-#define APM_CAP_RESUME_SUSPEND_TIMER   0x0008 /* Timer resume from suspend */
-#define APM_CAP_RESUME_STANDBY_RING    0x0010 /* Resume on Ring fr standby */
-#define APM_CAP_RESUME_SUSPEND_RING    0x0020 /* Resume on Ring fr suspend */
-#define APM_CAP_RESUME_STANDBY_PCMCIA  0x0040 /* Resume on PCMCIA Ring */
-#define APM_CAP_RESUME_SUSPEND_PCMCIA  0x0080 /* Resume on PCMCIA Ring */
-
-/*
- * ioctl operations
- */
-#include <linux/ioctl.h>
-
-#define APM_IOC_STANDBY                _IO('A', 1)
-#define APM_IOC_SUSPEND                _IO('A', 2)
-
 #endif /* LINUX_APM_H */
diff --git a/include/linux/asn1.h b/include/linux/asn1.h
new file mode 100644 (file)
index 0000000..5c3f4e4
--- /dev/null
@@ -0,0 +1,67 @@
+/* ASN.1 BER/DER/CER encoding definitions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ASN1_H
+#define _LINUX_ASN1_H
+
+/* Class */
+enum asn1_class {
+       ASN1_UNIV       = 0,    /* Universal */
+       ASN1_APPL       = 1,    /* Application */
+       ASN1_CONT       = 2,    /* Context */
+       ASN1_PRIV       = 3     /* Private */
+};
+#define ASN1_CLASS_BITS        0xc0
+
+
+enum asn1_method {
+       ASN1_PRIM       = 0,    /* Primitive */
+       ASN1_CONS       = 1     /* Constructed */
+};
+#define ASN1_CONS_BIT  0x20
+
+/* Tag */
+enum asn1_tag {
+       ASN1_EOC        = 0,    /* End Of Contents or N/A */
+       ASN1_BOOL       = 1,    /* Boolean */
+       ASN1_INT        = 2,    /* Integer */
+       ASN1_BTS        = 3,    /* Bit String */
+       ASN1_OTS        = 4,    /* Octet String */
+       ASN1_NULL       = 5,    /* Null */
+       ASN1_OID        = 6,    /* Object Identifier  */
+       ASN1_ODE        = 7,    /* Object Description */
+       ASN1_EXT        = 8,    /* External */
+       ASN1_REAL       = 9,    /* Real float */
+       ASN1_ENUM       = 10,   /* Enumerated */
+       ASN1_EPDV       = 11,   /* Embedded PDV */
+       ASN1_UTF8STR    = 12,   /* UTF8 String */
+       ASN1_RELOID     = 13,   /* Relative OID */
+       /* 14 - Reserved */
+       /* 15 - Reserved */
+       ASN1_SEQ        = 16,   /* Sequence and Sequence of */
+       ASN1_SET        = 17,   /* Set and Set of */
+       ASN1_NUMSTR     = 18,   /* Numerical String */
+       ASN1_PRNSTR     = 19,   /* Printable String */
+       ASN1_TEXSTR     = 20,   /* T61 String / Teletext String */
+       ASN1_VIDSTR     = 21,   /* Videotex String */
+       ASN1_IA5STR     = 22,   /* IA5 String */
+       ASN1_UNITIM     = 23,   /* Universal Time */
+       ASN1_GENTIM     = 24,   /* General Time */
+       ASN1_GRASTR     = 25,   /* Graphic String */
+       ASN1_VISSTR     = 26,   /* Visible String */
+       ASN1_GENSTR     = 27,   /* General String */
+       ASN1_UNISTR     = 28,   /* Universal String */
+       ASN1_CHRSTR     = 29,   /* Character String */
+       ASN1_BMPSTR     = 30,   /* BMP String */
+       ASN1_LONG_TAG   = 31    /* Long form tag */
+};
+
+#endif /* _LINUX_ASN1_H */
diff --git a/include/linux/asn1_ber_bytecode.h b/include/linux/asn1_ber_bytecode.h
new file mode 100644 (file)
index 0000000..945d44a
--- /dev/null
@@ -0,0 +1,87 @@
+/* ASN.1 BER/DER/CER parsing state machine internal definitions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ASN1_BER_BYTECODE_H
+#define _LINUX_ASN1_BER_BYTECODE_H
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#endif
+#include <linux/asn1.h>
+
+typedef int (*asn1_action_t)(void *context,
+                            size_t hdrlen, /* In case of ANY type */
+                            unsigned char tag, /* In case of ANY type */
+                            const void *value, size_t vlen);
+
+struct asn1_decoder {
+       const unsigned char *machine;
+       size_t machlen;
+       const asn1_action_t *actions;
+};
+
+enum asn1_opcode {
+       /* The tag-matching ops come first and the odd-numbered slots
+        * are for OR_SKIP ops.
+        */
+#define ASN1_OP_MATCH__SKIP              0x01
+#define ASN1_OP_MATCH__ACT               0x02
+#define ASN1_OP_MATCH__JUMP              0x04
+#define ASN1_OP_MATCH__ANY               0x08
+#define ASN1_OP_MATCH__COND              0x10
+
+       ASN1_OP_MATCH                   = 0x00,
+       ASN1_OP_MATCH_OR_SKIP           = 0x01,
+       ASN1_OP_MATCH_ACT               = 0x02,
+       ASN1_OP_MATCH_ACT_OR_SKIP       = 0x03,
+       ASN1_OP_MATCH_JUMP              = 0x04,
+       ASN1_OP_MATCH_JUMP_OR_SKIP      = 0x05,
+       ASN1_OP_MATCH_ANY               = 0x08,
+       ASN1_OP_MATCH_ANY_ACT           = 0x0a,
+       /* Everything before here matches unconditionally */
+
+       ASN1_OP_COND_MATCH_OR_SKIP      = 0x11,
+       ASN1_OP_COND_MATCH_ACT_OR_SKIP  = 0x13,
+       ASN1_OP_COND_MATCH_JUMP_OR_SKIP = 0x15,
+       ASN1_OP_COND_MATCH_ANY          = 0x18,
+       ASN1_OP_COND_MATCH_ANY_ACT      = 0x1a,
+
+       /* Everything before here will want a tag from the data */
+#define ASN1_OP__MATCHES_TAG ASN1_OP_COND_MATCH_ANY_ACT
+
+       /* These are here to help fill up space */
+       ASN1_OP_COND_FAIL               = 0x1b,
+       ASN1_OP_COMPLETE                = 0x1c,
+       ASN1_OP_ACT                     = 0x1d,
+       ASN1_OP_RETURN                  = 0x1e,
+
+       /* The following eight have bit 0 -> SET, 1 -> OF, 2 -> ACT */
+       ASN1_OP_END_SEQ                 = 0x20,
+       ASN1_OP_END_SET                 = 0x21,
+       ASN1_OP_END_SEQ_OF              = 0x22,
+       ASN1_OP_END_SET_OF              = 0x23,
+       ASN1_OP_END_SEQ_ACT             = 0x24,
+       ASN1_OP_END_SET_ACT             = 0x25,
+       ASN1_OP_END_SEQ_OF_ACT          = 0x26,
+       ASN1_OP_END_SET_OF_ACT          = 0x27,
+#define ASN1_OP_END__SET                 0x01
+#define ASN1_OP_END__OF                          0x02
+#define ASN1_OP_END__ACT                 0x04
+
+       ASN1_OP__NR
+};
+
+#define _tag(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | ASN1_##TAG)
+#define _tagn(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | TAG)
+#define _jump_target(N) (N)
+#define _action(N) (N)
+
+#endif /* _LINUX_ASN1_BER_BYTECODE_H */
diff --git a/include/linux/asn1_decoder.h b/include/linux/asn1_decoder.h
new file mode 100644 (file)
index 0000000..fa2ff5b
--- /dev/null
@@ -0,0 +1,24 @@
+/* ASN.1 decoder
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ASN1_DECODER_H
+#define _LINUX_ASN1_DECODER_H
+
+#include <linux/asn1.h>
+
+struct asn1_decoder;
+
+extern int asn1_ber_decoder(const struct asn1_decoder *decoder,
+                           void *context,
+                           const unsigned char *data,
+                           size_t datalen);
+
+#endif /* _LINUX_ASN1_DECODER_H */
index f57c36881c4898b24d07897fec211ce03b45dbfa..73fd8b7e9534434d663aa2a18ab5c2a58421b739 100644 (file)
@@ -1,49 +1,9 @@
 #ifndef __LINUX_ATALK_H__
 #define __LINUX_ATALK_H__
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-#include <linux/socket.h>
-
-/*
- * AppleTalk networking structures
- *
- * The following are directly referenced from the University Of Michigan
- * netatalk for compatibility reasons.
- */
-#define ATPORT_FIRST   1
-#define ATPORT_RESERVED        128
-#define ATPORT_LAST    254             /* 254 is only legal on localtalk */ 
-#define ATADDR_ANYNET  (__u16)0
-#define ATADDR_ANYNODE (__u8)0
-#define ATADDR_ANYPORT  (__u8)0
-#define ATADDR_BCAST   (__u8)255
-#define DDP_MAXSZ      587
-#define DDP_MAXHOPS     15             /* 4 bits of hop counter */
-
-#define SIOCATALKDIFADDR       (SIOCPROTOPRIVATE + 0)
-
-struct atalk_addr {
-       __be16  s_net;
-       __u8    s_node;
-};
-
-struct sockaddr_at {
-       __kernel_sa_family_t sat_family;
-       __u8              sat_port;
-       struct atalk_addr sat_addr;
-       char              sat_zero[8];
-};
-
-struct atalk_netrange {
-       __u8    nr_phase;
-       __be16  nr_firstnet;
-       __be16  nr_lastnet;
-};
-
-#ifdef __KERNEL__
 
 #include <net/sock.h>
+#include <uapi/linux/atalk.h>
 
 struct atalk_route {
        struct net_device  *dev;
@@ -205,5 +165,4 @@ extern void atalk_proc_exit(void);
 #define atalk_proc_exit()      do { } while(0)
 #endif /* CONFIG_PROC_FS */
 
-#endif /* __KERNEL__ */
 #endif /* __LINUX_ATALK_H__ */
index d3b292174aeb0821f8d63c3e6317a1f4d5e8b3d4..30006c4359516970be63aaa3ab788c260fe4eda1 100644 (file)
@@ -1,242 +1,9 @@
 /* atm.h - general ATM declarations */
-/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
-
-/*
- * WARNING: User-space programs should not #include <linux/atm.h> directly.
- *          Instead, #include <atm.h>
- */
-
 #ifndef _LINUX_ATM_H
 #define _LINUX_ATM_H
 
-/*
- * BEGIN_xx and END_xx markers are used for automatic generation of
- * documentation. Do not change them.
- */
-
-#include <linux/compiler.h>
-#include <linux/atmapi.h>
-#include <linux/atmsap.h>
-#include <linux/atmioc.h>
-#include <linux/types.h>
-
-
-/* general ATM constants */
-#define ATM_CELL_SIZE              53  /* ATM cell size incl. header */
-#define ATM_CELL_PAYLOAD           48  /* ATM payload size */
-#define ATM_AAL0_SDU               52  /* AAL0 SDU size */
-#define ATM_MAX_AAL34_PDU       65535  /* maximum AAL3/4 PDU payload */
-#define ATM_AAL5_TRAILER            8  /* AAL5 trailer size */
-#define ATM_MAX_AAL5_PDU        65535  /* maximum AAL5 PDU payload */
-#define ATM_MAX_CDV              9999  /* maximum (default) CDV */
-#define ATM_NOT_RSV_VCI                    32  /* first non-reserved VCI value */
-
-#define ATM_MAX_VPI               255  /* maximum VPI at the UNI */
-#define ATM_MAX_VPI_NNI                  4096  /* maximum VPI at the NNI */
-#define ATM_MAX_VCI             65535  /* maximum VCI */
-
-
-/* "protcol" values for the socket system call */
-#define ATM_NO_AAL     0               /* AAL not specified */
-#define ATM_AAL0       13              /* "raw" ATM cells */
-#define ATM_AAL1       1               /* AAL1 (CBR) */
-#define ATM_AAL2       2               /* AAL2 (VBR) */
-#define ATM_AAL34      3               /* AAL3/4 (data) */
-#define ATM_AAL5       5               /* AAL5 (data) */
-
-/*
- * socket option name coding functions
- *
- * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
- * << 22 only reserves 9 bits for the level.  On some architectures
- * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
- */
-
-#define __SO_ENCODE(l,n,t)     ((((l) & 0x1FF) << 22) | ((n) << 16) | \
-                               sizeof(t))
-#define __SO_LEVEL_MATCH(c,m)  (((c) >> 22) == ((m) & 0x1FF))
-#define __SO_NUMBER(c)         (((c) >> 16) & 0x3f)
-#define __SO_SIZE(c)           ((c) & 0x3fff)
-
-/*
- * ATM layer
- */
-
-#define SO_SETCLP      __SO_ENCODE(SOL_ATM,0,int)
-                           /* set CLP bit value - TODO */
-#define SO_CIRANGE     __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
-                           /* connection identifier range; socket must be
-                              bound or connected */
-#define SO_ATMQOS      __SO_ENCODE(SOL_ATM,2,struct atm_qos)
-                           /* Quality of Service setting */
-#define SO_ATMSAP      __SO_ENCODE(SOL_ATM,3,struct atm_sap)
-                           /* Service Access Point */
-#define SO_ATMPVC      __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
-                           /* "PVC" address (also for SVCs); get only */
-#define SO_MULTIPOINT  __SO_ENCODE(SOL_ATM, 5, int)
-                           /* make this vc a p2mp */
-
-
-/*
- * Note @@@: since the socket layers don't really distinguish the control and
- * the data plane but generally seems to be data plane-centric, any layer is
- * about equally wrong for the SAP. If you have a better idea about this,
- * please speak up ...
- */
-
-
-/* ATM cell header (for AAL0) */
-
-/* BEGIN_CH */
-#define ATM_HDR_GFC_MASK       0xf0000000
-#define ATM_HDR_GFC_SHIFT      28
-#define ATM_HDR_VPI_MASK       0x0ff00000
-#define ATM_HDR_VPI_SHIFT      20
-#define ATM_HDR_VCI_MASK       0x000ffff0
-#define ATM_HDR_VCI_SHIFT      4
-#define ATM_HDR_PTI_MASK       0x0000000e
-#define ATM_HDR_PTI_SHIFT      1
-#define ATM_HDR_CLP            0x00000001
-/* END_CH */
-
-
-/* PTI codings */
-
-/* BEGIN_PTI */
-#define ATM_PTI_US0    0  /* user data cell, congestion not exp, SDU-type 0 */
-#define ATM_PTI_US1    1  /* user data cell, congestion not exp, SDU-type 1 */
-#define ATM_PTI_UCES0  2  /* user data cell, cong. experienced, SDU-type 0 */
-#define ATM_PTI_UCES1  3  /* user data cell, cong. experienced, SDU-type 1 */
-#define ATM_PTI_SEGF5  4  /* segment OAM F5 flow related cell */
-#define ATM_PTI_E2EF5  5  /* end-to-end OAM F5 flow related cell */
-#define ATM_PTI_RSV_RM 6  /* reserved for traffic control/resource mgmt */
-#define ATM_PTI_RSV    7  /* reserved */
-/* END_PTI */
-
-
-/*
- * The following items should stay in linux/atm.h, which should be linked to
- * netatm/atm.h
- */
-
-/* Traffic description */
-
-#define ATM_NONE       0               /* no traffic */
-#define ATM_UBR                1
-#define ATM_CBR                2
-#define ATM_VBR                3
-#define ATM_ABR                4
-#define ATM_ANYCLASS   5               /* compatible with everything */
-
-#define ATM_MAX_PCR    -1              /* maximum available PCR */
-
-struct atm_trafprm {
-       unsigned char   traffic_class;  /* traffic class (ATM_UBR, ...) */
-       int             max_pcr;        /* maximum PCR in cells per second */
-       int             pcr;            /* desired PCR in cells per second */
-       int             min_pcr;        /* minimum PCR in cells per second */
-       int             max_cdv;        /* maximum CDV in microseconds */
-       int             max_sdu;        /* maximum SDU in bytes */
-        /* extra params for ABR */
-        unsigned int   icr;            /* Initial Cell Rate (24-bit) */
-        unsigned int   tbe;            /* Transient Buffer Exposure (24-bit) */ 
-        unsigned int   frtt : 24;      /* Fixed Round Trip Time (24-bit) */
-        unsigned int   rif  : 4;       /* Rate Increment Factor (4-bit) */
-        unsigned int   rdf  : 4;       /* Rate Decrease Factor (4-bit) */
-        unsigned int nrm_pres  :1;      /* nrm present bit */
-        unsigned int trm_pres  :1;             /* rm present bit */
-        unsigned int adtf_pres :1;             /* adtf present bit */
-        unsigned int cdf_pres  :1;     /* cdf present bit*/
-        unsigned int nrm       :3;             /* Max # of Cells for each forward RM cell (3-bit) */
-        unsigned int trm       :3;     /* Time between forward RM cells (3-bit) */    
-       unsigned int adtf      :10;     /* ACR Decrease Time Factor (10-bit) */
-       unsigned int cdf       :3;      /* Cutoff Decrease Factor (3-bit) */
-        unsigned int spare     :9;      /* spare bits */ 
-};
-
-struct atm_qos {
-       struct atm_trafprm txtp;        /* parameters in TX direction */
-       struct atm_trafprm rxtp __ATM_API_ALIGN;
-                                       /* parameters in RX direction */
-       unsigned char aal __ATM_API_ALIGN;
-};
-
-/* PVC addressing */
-
-#define ATM_ITF_ANY    -1              /* "magic" PVC address values */
-#define ATM_VPI_ANY    -1
-#define ATM_VCI_ANY    -1
-#define ATM_VPI_UNSPEC -2
-#define ATM_VCI_UNSPEC -2
-
-
-struct sockaddr_atmpvc {
-       unsigned short  sap_family;     /* address family, AF_ATMPVC  */
-       struct {                        /* PVC address */
-               short   itf;            /* ATM interface */
-               short   vpi;            /* VPI (only 8 bits at UNI) */
-               int     vci;            /* VCI (only 16 bits at UNI) */
-       } sap_addr __ATM_API_ALIGN;     /* PVC address */
-};
-
-/* SVC addressing */
-
-#define        ATM_ESA_LEN     20              /* ATM End System Address length */
-#define ATM_E164_LEN   12              /* maximum E.164 number length */
-
-#define ATM_AFI_DCC    0x39            /* DCC ATM Format */
-#define ATM_AFI_ICD    0x47            /* ICD ATM Format */
-#define ATM_AFI_E164   0x45            /* E.164 ATM Format */
-#define ATM_AFI_LOCAL  0x49            /* Local ATM Format */ 
-
-#define ATM_AFI_DCC_GROUP      0xBD    /* DCC ATM Group Format */
-#define ATM_AFI_ICD_GROUP      0xC5    /* ICD ATM Group Format */
-#define ATM_AFI_E164_GROUP     0xC3    /* E.164 ATM Group Format */
-#define ATM_AFI_LOCAL_GROUP    0xC7    /* Local ATM Group Format */
+#include <uapi/linux/atm.h>
 
-#define ATM_LIJ_NONE   0               /* no leaf-initiated join */
-#define ATM_LIJ                1               /* request joining */
-#define ATM_LIJ_RPJ    2               /* set to root-prompted join */
-#define ATM_LIJ_NJ     3               /* set to network join */
-
-
-struct sockaddr_atmsvc {
-    unsigned short     sas_family;     /* address family, AF_ATMSVC */
-    struct {                           /* SVC address */
-        unsigned char  prv[ATM_ESA_LEN];/* private ATM address */
-        char           pub[ATM_E164_LEN+1]; /* public address (E.164) */
-                                       /* unused addresses must be bzero'ed */
-       char            lij_type;       /* role in LIJ call; one of ATM_LIJ* */
-       __u32   lij_id;         /* LIJ call identifier */
-    } sas_addr __ATM_API_ALIGN;                /* SVC address */
-};
-
-
-static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
-{
-       return *addr.sas_addr.prv || *addr.sas_addr.pub;
-}
-
-
-static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
-{
-       return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
-}
-
-
-/*
- * Some stuff for linux/sockios.h
- */
-
-struct atmif_sioc {
-       int number;
-       int length;
-       void __user *arg;
-};
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 struct compat_atmif_sioc {
@@ -246,6 +13,3 @@ struct compat_atmif_sioc {
 };
 #endif
 #endif
-
-typedef unsigned short atm_backend_t;
-#endif
index 375638f8554b93c8338d0d8499688e329c4ffbfb..db6b65fc0aec7fa2bd5526015aedb29c6f5c7f00 100644 (file)
@@ -3,61 +3,11 @@
 
 /* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
 
-
 #ifndef LINUX_ATM_TCP_H
 #define LINUX_ATM_TCP_H
 
-#include <linux/atmapi.h>
-#include <linux/atm.h>
-#include <linux/atmioc.h>
-#include <linux/types.h>
-
-
-/*
- * All values in struct atmtcp_hdr are in network byte order
- */
-
-struct atmtcp_hdr {
-       __u16   vpi;
-       __u16   vci;
-       __u32   length;         /* ... of data part */
-};
-
-/*
- * All values in struct atmtcp_command are in host byte order
- */
-
-#define ATMTCP_HDR_MAGIC       (~0)    /* this length indicates a command */
-#define ATMTCP_CTRL_OPEN       1       /* request/reply */
-#define ATMTCP_CTRL_CLOSE      2       /* request/reply */
+#include <uapi/linux/atm_tcp.h>
 
-struct atmtcp_control {
-       struct atmtcp_hdr hdr;  /* must be first */
-       int type;               /* message type; both directions */
-       atm_kptr_t vcc;         /* both directions */
-       struct sockaddr_atmpvc addr; /* suggested value from kernel */
-       struct atm_qos  qos;    /* both directions */
-       int result;             /* to kernel only */
-} __ATM_API_ALIGN;
-
-/*
- * Field usage:
- * Messge type dir.    hdr.v?i type    addr    qos     vcc     result
- * -----------  ----   ------- ----    ----    ---     ---     ------
- * OPEN                K->D    Y       Y       Y       Y       Y       0
- * OPEN                D->K    -       Y       Y       Y       Y       Y
- * CLOSE       K->D    -       -       Y       -       Y       0
- * CLOSE       D->K    -       -       -       -       Y       Y
- */
-
-#define SIOCSIFATMTCP  _IO('a',ATMIOC_ITF)     /* set ATMTCP mode */
-#define ATMTCP_CREATE  _IO('a',ATMIOC_ITF+14)  /* create persistent ATMTCP
-                                                  interface */
-#define ATMTCP_REMOVE  _IO('a',ATMIOC_ITF+15)  /* destroy persistent ATMTCP
-                                                  interface */
-
-
-#ifdef __KERNEL__
 
 struct atm_tcp_ops {
        int (*attach)(struct atm_vcc *vcc,int itf);
@@ -69,5 +19,3 @@ struct atm_tcp_ops {
 extern struct atm_tcp_ops atm_tcp_ops;
 
 #endif
-
-#endif
index 06fd4bbc58f68c17c2e93b7b05385159e41dc6ea..22ef21c33d0c600f5adf48d34e5bdde4687d76c4 100644 (file)
@@ -1,218 +1,8 @@
 /* atmdev.h - ATM device driver declarations and various related items */
-/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
-
 #ifndef LINUX_ATMDEV_H
 #define LINUX_ATMDEV_H
 
 
-#include <linux/atmapi.h>
-#include <linux/atm.h>
-#include <linux/atmioc.h>
-
-
-#define ESI_LEN                6
-
-#define ATM_OC3_PCR    (155520000/270*260/8/53)
-                       /* OC3 link rate:  155520000 bps
-                          SONET overhead: /270*260 (9 section, 1 path)
-                          bits per cell:  /8/53
-                          max cell rate:  353207.547 cells/sec */
-#define ATM_25_PCR     ((25600000/8-8000)/54)
-                       /* 25 Mbps ATM cell rate (59111) */
-#define ATM_OC12_PCR   (622080000/1080*1040/8/53)
-                       /* OC12 link rate: 622080000 bps
-                          SONET overhead: /1080*1040
-                          bits per cell:  /8/53
-                          max cell rate:  1412830.188 cells/sec */
-#define ATM_DS3_PCR    (8000*12)
-                       /* DS3: 12 cells in a 125 usec time slot */
-
-
-#define __AAL_STAT_ITEMS \
-    __HANDLE_ITEM(tx);                 /* TX okay */ \
-    __HANDLE_ITEM(tx_err);             /* TX errors */ \
-    __HANDLE_ITEM(rx);                 /* RX okay */ \
-    __HANDLE_ITEM(rx_err);             /* RX errors */ \
-    __HANDLE_ITEM(rx_drop);            /* RX out of memory */
-
-struct atm_aal_stats {
-#define __HANDLE_ITEM(i) int i
-       __AAL_STAT_ITEMS
-#undef __HANDLE_ITEM
-};
-
-
-struct atm_dev_stats {
-       struct atm_aal_stats aal0;
-       struct atm_aal_stats aal34;
-       struct atm_aal_stats aal5;
-} __ATM_API_ALIGN;
-
-
-#define ATM_GETLINKRATE        _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
-                                       /* get link rate */
-#define ATM_GETNAMES   _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
-                                       /* get interface names (numbers) */
-#define ATM_GETTYPE    _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
-                                       /* get interface type name */
-#define ATM_GETESI     _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
-                                       /* get interface ESI */
-#define ATM_GETADDR    _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
-                                       /* get itf's local ATM addr. list */
-#define ATM_RSTADDR    _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
-                                       /* reset itf's ATM address list */
-#define ATM_ADDADDR    _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
-                                       /* add a local ATM address */
-#define ATM_DELADDR    _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
-                                       /* remove a local ATM address */
-#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
-                                       /* get connection identifier range */
-#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
-                                       /* set connection identifier range */
-#define ATM_SETESI     _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
-                                       /* set interface ESI */
-#define ATM_SETESIF    _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
-                                       /* force interface ESI */
-#define ATM_ADDLECSADDR        _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
-                                       /* register a LECS address */
-#define ATM_DELLECSADDR        _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
-                                       /* unregister a LECS address */
-#define ATM_GETLECSADDR        _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
-                                       /* retrieve LECS address(es) */
-
-#define ATM_GETSTAT    _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
-                                       /* get AAL layer statistics */
-#define ATM_GETSTATZ   _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
-                                       /* get AAL layer statistics and zero */
-#define ATM_GETLOOP    _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
-                                       /* get loopback mode */
-#define ATM_SETLOOP    _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
-                                       /* set loopback mode */
-#define ATM_QUERYLOOP  _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
-                                       /* query supported loopback modes */
-#define ATM_SETSC      _IOW('a',ATMIOC_SPECIAL+1,int)
-                                       /* enable or disable single-copy */
-#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
-                                       /* set backend handler */
-#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
-                                       /* use backend to make new if */
-#define ATM_ADDPARTY   _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
-                                       /* add party to p2mp call */
-#ifdef CONFIG_COMPAT
-/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
-#define COMPAT_ATM_ADDPARTY    _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
-#endif
-#define ATM_DROPPARTY  _IOW('a', ATMIOC_SPECIAL+5,int)
-                                       /* drop party from p2mp call */
-
-/*
- * These are backend handkers that can be set via the ATM_SETBACKEND call
- * above.  In the future we may support dynamic loading of these - for now,
- * they're just being used to share the ATMIOC_BACKEND ioctls
- */
-#define ATM_BACKEND_RAW                0       
-#define ATM_BACKEND_PPP                1       /* PPPoATM - RFC2364 */
-#define ATM_BACKEND_BR2684     2       /* Bridged RFC1483/2684 */
-
-/* for ATM_GETTYPE */
-#define ATM_ITFTYP_LEN 8       /* maximum length of interface type name */
-
-/*
- * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
- */
-
-/* Point of loopback                           CPU-->SAR-->PHY-->line--> ... */
-#define __ATM_LM_NONE  0       /* no loop back     ^     ^     ^      ^      */
-#define __ATM_LM_AAL   1       /* loop back PDUs --'     |     |      |      */
-#define __ATM_LM_ATM   2       /* loop back ATM cells ---'     |      |      */
-/* RESERVED            4       loop back on PHY side  ---'                   */
-#define __ATM_LM_PHY   8       /* loop back bits (digital) ----'      |      */
-#define __ATM_LM_ANALOG 16     /* loop back the analog signal --------'      */
-
-/* Direction of loopback */
-#define __ATM_LM_MKLOC(n)      ((n))       /* Local (i.e. loop TX to RX) */
-#define __ATM_LM_MKRMT(n)      ((n) << 8)  /* Remote (i.e. loop RX to TX) */
-
-#define __ATM_LM_XTLOC(n)      ((n) & 0xff)
-#define __ATM_LM_XTRMT(n)      (((n) >> 8) & 0xff)
-
-#define ATM_LM_NONE    0       /* no loopback */
-
-#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
-#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
-#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
-#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
-
-#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
-#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
-#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
-#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
-
-/*
- * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
- * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
- */
-
-
-struct atm_iobuf {
-       int length;
-       void __user *buffer;
-};
-
-/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
-
-#define ATM_CI_MAX      -1              /* use maximum range of VPI/VCI */
-struct atm_cirange {
-       signed char     vpi_bits;       /* 1..8, ATM_CI_MAX (-1) for maximum */
-       signed char     vci_bits;       /* 1..16, ATM_CI_MAX (-1) for maximum */
-};
-
-/* for ATM_SETSC; actually taken from the ATM_VF number space */
-
-#define ATM_SC_RX      1024            /* enable RX single-copy */
-#define ATM_SC_TX      2048            /* enable TX single-copy */
-
-#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
-                                 anyway */
-
-/* MF: change_qos (Modify) flags */
-
-#define ATM_MF_IMMED    1      /* Block until change is effective */
-#define ATM_MF_INC_RSV  2      /* Change reservation on increase */
-#define ATM_MF_INC_SHP  4      /* Change shaping on increase */
-#define ATM_MF_DEC_RSV  8      /* Change reservation on decrease */
-#define ATM_MF_DEC_SHP 16      /* Change shaping on decrease */
-#define ATM_MF_BWD     32      /* Set the backward direction parameters */
-
-#define ATM_MF_SET     (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
-                         ATM_MF_DEC_SHP | ATM_MF_BWD)
-
-/*
- * ATM_VS_* are used to express VC state in a human-friendly way.
- */
-
-#define ATM_VS_IDLE    0       /* VC is not used */
-#define ATM_VS_CONNECTED 1     /* VC is connected */
-#define ATM_VS_CLOSING 2       /* VC is closing */
-#define ATM_VS_LISTEN  3       /* VC is listening for incoming setups */
-#define ATM_VS_INUSE   4       /* VC is in use (registered with atmsigd) */
-#define ATM_VS_BOUND   5       /* VC is bound */
-
-#define ATM_VS2TXT_MAP \
-    "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
-
-#define ATM_VF2TXT_MAP \
-    "ADDR",    "READY",        "PARTIAL",      "REGIS", \
-    "RELEASED", "HASQOS",      "LISTEN",       "META", \
-    "256",     "512",          "1024",         "2048", \
-    "SESSION", "HASSAP",       "BOUND",        "CLOSE"
-
-
-#ifdef __KERNEL__
-
 #include <linux/wait.h> /* wait_queue_head_t */
 #include <linux/time.h> /* struct timeval */
 #include <linux/net.h>
@@ -221,6 +11,7 @@ struct atm_cirange {
 #include <linux/uio.h>
 #include <net/sock.h>
 #include <linux/atomic.h>
+#include <uapi/linux/atmdev.h>
 
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
@@ -521,6 +312,4 @@ void deregister_atm_ioctl(struct atm_ioctl *);
 int register_atmdevice_notifier(struct notifier_block *nb);
 void unregister_atmdevice_notifier(struct notifier_block *nb);
 
-#endif /* __KERNEL__ */
-
 #endif
index b889fa64b0e0933c73b41f09e0e1006fc0f86f7c..bce729afbcf9a5e184e70edc1bebf9f65a0176a3 100644 (file)
  * Written by Rickard E. (Rik) Faith <faith@redhat.com>
  *
  */
-
 #ifndef _LINUX_AUDIT_H_
 #define _LINUX_AUDIT_H_
 
-#include <linux/types.h>
-#include <linux/elf-em.h>
-#include <linux/ptrace.h>
-
-/* The netlink messages for the audit system is divided into blocks:
- * 1000 - 1099 are for commanding the audit system
- * 1100 - 1199 user space trusted application messages
- * 1200 - 1299 messages internal to the audit daemon
- * 1300 - 1399 audit event messages
- * 1400 - 1499 SE Linux use
- * 1500 - 1599 kernel LSPP events
- * 1600 - 1699 kernel crypto events
- * 1700 - 1799 kernel anomaly records
- * 1800 - 1899 kernel integrity events
- * 1900 - 1999 future kernel use
- * 2000 is for otherwise unclassified kernel audit messages (legacy)
- * 2001 - 2099 unused (kernel)
- * 2100 - 2199 user space anomaly records
- * 2200 - 2299 user space actions taken in response to anomalies
- * 2300 - 2399 user space generated LSPP events
- * 2400 - 2499 user space crypto events
- * 2500 - 2999 future user space (maybe integrity labels and related events)
- *
- * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
- * exclusively user space. 1300-2099 is kernel --> user space 
- * communication.
- */
-#define AUDIT_GET              1000    /* Get status */
-#define AUDIT_SET              1001    /* Set status (enable/disable/auditd) */
-#define AUDIT_LIST             1002    /* List syscall rules -- deprecated */
-#define AUDIT_ADD              1003    /* Add syscall rule -- deprecated */
-#define AUDIT_DEL              1004    /* Delete syscall rule -- deprecated */
-#define AUDIT_USER             1005    /* Message from userspace -- deprecated */
-#define AUDIT_LOGIN            1006    /* Define the login id and information */
-#define AUDIT_WATCH_INS                1007    /* Insert file/dir watch entry */
-#define AUDIT_WATCH_REM                1008    /* Remove file/dir watch entry */
-#define AUDIT_WATCH_LIST       1009    /* List all file/dir watches */
-#define AUDIT_SIGNAL_INFO      1010    /* Get info about sender of signal to auditd */
-#define AUDIT_ADD_RULE         1011    /* Add syscall filtering rule */
-#define AUDIT_DEL_RULE         1012    /* Delete syscall filtering rule */
-#define AUDIT_LIST_RULES       1013    /* List syscall filtering rules */
-#define AUDIT_TRIM             1014    /* Trim junk from watched tree */
-#define AUDIT_MAKE_EQUIV       1015    /* Append to watched tree */
-#define AUDIT_TTY_GET          1016    /* Get TTY auditing status */
-#define AUDIT_TTY_SET          1017    /* Set TTY auditing status */
-
-#define AUDIT_FIRST_USER_MSG   1100    /* Userspace messages mostly uninteresting to kernel */
-#define AUDIT_USER_AVC         1107    /* We filter this differently */
-#define AUDIT_USER_TTY         1124    /* Non-ICANON TTY input meaning */
-#define AUDIT_LAST_USER_MSG    1199
-#define AUDIT_FIRST_USER_MSG2  2100    /* More user space messages */
-#define AUDIT_LAST_USER_MSG2   2999
-#define AUDIT_DAEMON_START      1200    /* Daemon startup record */
-#define AUDIT_DAEMON_END        1201    /* Daemon normal stop record */
-#define AUDIT_DAEMON_ABORT      1202    /* Daemon error stop record */
-#define AUDIT_DAEMON_CONFIG     1203    /* Daemon config change */
-
-#define AUDIT_SYSCALL          1300    /* Syscall event */
-/* #define AUDIT_FS_WATCH      1301     * Deprecated */
-#define AUDIT_PATH             1302    /* Filename path information */
-#define AUDIT_IPC              1303    /* IPC record */
-#define AUDIT_SOCKETCALL       1304    /* sys_socketcall arguments */
-#define AUDIT_CONFIG_CHANGE    1305    /* Audit system configuration change */
-#define AUDIT_SOCKADDR         1306    /* sockaddr copied as syscall arg */
-#define AUDIT_CWD              1307    /* Current working directory */
-#define AUDIT_EXECVE           1309    /* execve arguments */
-#define AUDIT_IPC_SET_PERM     1311    /* IPC new permissions record type */
-#define AUDIT_MQ_OPEN          1312    /* POSIX MQ open record type */
-#define AUDIT_MQ_SENDRECV      1313    /* POSIX MQ send/receive record type */
-#define AUDIT_MQ_NOTIFY                1314    /* POSIX MQ notify record type */
-#define AUDIT_MQ_GETSETATTR    1315    /* POSIX MQ get/set attribute record type */
-#define AUDIT_KERNEL_OTHER     1316    /* For use by 3rd party modules */
-#define AUDIT_FD_PAIR          1317    /* audit record for pipe/socketpair */
-#define AUDIT_OBJ_PID          1318    /* ptrace target */
-#define AUDIT_TTY              1319    /* Input on an administrative TTY */
-#define AUDIT_EOE              1320    /* End of multi-record event */
-#define AUDIT_BPRM_FCAPS       1321    /* Information about fcaps increasing perms */
-#define AUDIT_CAPSET           1322    /* Record showing argument to sys_capset */
-#define AUDIT_MMAP             1323    /* Record showing descriptor and flags in mmap */
-#define AUDIT_NETFILTER_PKT    1324    /* Packets traversing netfilter chains */
-#define AUDIT_NETFILTER_CFG    1325    /* Netfilter chain modifications */
-
-#define AUDIT_AVC              1400    /* SE Linux avc denial or grant */
-#define AUDIT_SELINUX_ERR      1401    /* Internal SE Linux Errors */
-#define AUDIT_AVC_PATH         1402    /* dentry, vfsmount pair from avc */
-#define AUDIT_MAC_POLICY_LOAD  1403    /* Policy file load */
-#define AUDIT_MAC_STATUS       1404    /* Changed enforcing,permissive,off */
-#define AUDIT_MAC_CONFIG_CHANGE        1405    /* Changes to booleans */
-#define AUDIT_MAC_UNLBL_ALLOW  1406    /* NetLabel: allow unlabeled traffic */
-#define AUDIT_MAC_CIPSOV4_ADD  1407    /* NetLabel: add CIPSOv4 DOI entry */
-#define AUDIT_MAC_CIPSOV4_DEL  1408    /* NetLabel: del CIPSOv4 DOI entry */
-#define AUDIT_MAC_MAP_ADD      1409    /* NetLabel: add LSM domain mapping */
-#define AUDIT_MAC_MAP_DEL      1410    /* NetLabel: del LSM domain mapping */
-#define AUDIT_MAC_IPSEC_ADDSA  1411    /* Not used */
-#define AUDIT_MAC_IPSEC_DELSA  1412    /* Not used  */
-#define AUDIT_MAC_IPSEC_ADDSPD 1413    /* Not used */
-#define AUDIT_MAC_IPSEC_DELSPD 1414    /* Not used */
-#define AUDIT_MAC_IPSEC_EVENT  1415    /* Audit an IPSec event */
-#define AUDIT_MAC_UNLBL_STCADD 1416    /* NetLabel: add a static label */
-#define AUDIT_MAC_UNLBL_STCDEL 1417    /* NetLabel: del a static label */
-
-#define AUDIT_FIRST_KERN_ANOM_MSG   1700
-#define AUDIT_LAST_KERN_ANOM_MSG    1799
-#define AUDIT_ANOM_PROMISCUOUS      1700 /* Device changed promiscuous mode */
-#define AUDIT_ANOM_ABEND            1701 /* Process ended abnormally */
-#define AUDIT_ANOM_LINK                    1702 /* Suspicious use of file links */
-#define AUDIT_INTEGRITY_DATA       1800 /* Data integrity verification */
-#define AUDIT_INTEGRITY_METADATA    1801 /* Metadata integrity verification */
-#define AUDIT_INTEGRITY_STATUS     1802 /* Integrity enable status */
-#define AUDIT_INTEGRITY_HASH       1803 /* Integrity HASH type */
-#define AUDIT_INTEGRITY_PCR        1804 /* PCR invalidation msgs */
-#define AUDIT_INTEGRITY_RULE       1805 /* policy rule */
-
-#define AUDIT_KERNEL           2000    /* Asynchronous audit record. NOT A REQUEST. */
-
-/* Rule flags */
-#define AUDIT_FILTER_USER      0x00    /* Apply rule to user-generated messages */
-#define AUDIT_FILTER_TASK      0x01    /* Apply rule at task creation (not syscall) */
-#define AUDIT_FILTER_ENTRY     0x02    /* Apply rule at syscall entry */
-#define AUDIT_FILTER_WATCH     0x03    /* Apply rule to file system watches */
-#define AUDIT_FILTER_EXIT      0x04    /* Apply rule at syscall exit */
-#define AUDIT_FILTER_TYPE      0x05    /* Apply rule at audit_log_start */
-
-#define AUDIT_NR_FILTERS       6
-
-#define AUDIT_FILTER_PREPEND   0x10    /* Prepend to front of list */
-
-/* Rule actions */
-#define AUDIT_NEVER    0       /* Do not build context if rule matches */
-#define AUDIT_POSSIBLE 1       /* Build context if rule matches  */
-#define AUDIT_ALWAYS   2       /* Generate audit record if rule matches */
-
-/* Rule structure sizes -- if these change, different AUDIT_ADD and
- * AUDIT_LIST commands must be implemented. */
-#define AUDIT_MAX_FIELDS   64
-#define AUDIT_MAX_KEY_LEN  256
-#define AUDIT_BITMASK_SIZE 64
-#define AUDIT_WORD(nr) ((__u32)((nr)/32))
-#define AUDIT_BIT(nr)  (1 << ((nr) - AUDIT_WORD(nr)*32))
-
-#define AUDIT_SYSCALL_CLASSES 16
-#define AUDIT_CLASS_DIR_WRITE 0
-#define AUDIT_CLASS_DIR_WRITE_32 1
-#define AUDIT_CLASS_CHATTR 2
-#define AUDIT_CLASS_CHATTR_32 3
-#define AUDIT_CLASS_READ 4
-#define AUDIT_CLASS_READ_32 5
-#define AUDIT_CLASS_WRITE 6
-#define AUDIT_CLASS_WRITE_32 7
-#define AUDIT_CLASS_SIGNAL 8
-#define AUDIT_CLASS_SIGNAL_32 9
-
-/* This bitmask is used to validate user input.  It represents all bits that
- * are currently used in an audit field constant understood by the kernel.
- * If you are adding a new #define AUDIT_<whatever>, please ensure that
- * AUDIT_UNUSED_BITS is updated if need be. */
-#define AUDIT_UNUSED_BITS      0x07FFFC00
-
-/* AUDIT_FIELD_COMPARE rule list */
-#define AUDIT_COMPARE_UID_TO_OBJ_UID   1
-#define AUDIT_COMPARE_GID_TO_OBJ_GID   2
-#define AUDIT_COMPARE_EUID_TO_OBJ_UID  3
-#define AUDIT_COMPARE_EGID_TO_OBJ_GID  4
-#define AUDIT_COMPARE_AUID_TO_OBJ_UID  5
-#define AUDIT_COMPARE_SUID_TO_OBJ_UID  6
-#define AUDIT_COMPARE_SGID_TO_OBJ_GID  7
-#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
-#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
-
-#define AUDIT_COMPARE_UID_TO_AUID      10
-#define AUDIT_COMPARE_UID_TO_EUID      11
-#define AUDIT_COMPARE_UID_TO_FSUID     12
-#define AUDIT_COMPARE_UID_TO_SUID      13
-
-#define AUDIT_COMPARE_AUID_TO_FSUID    14
-#define AUDIT_COMPARE_AUID_TO_SUID     15
-#define AUDIT_COMPARE_AUID_TO_EUID     16
-
-#define AUDIT_COMPARE_EUID_TO_SUID     17
-#define AUDIT_COMPARE_EUID_TO_FSUID    18
-
-#define AUDIT_COMPARE_SUID_TO_FSUID    19
-
-#define AUDIT_COMPARE_GID_TO_EGID      20
-#define AUDIT_COMPARE_GID_TO_FSGID     21
-#define AUDIT_COMPARE_GID_TO_SGID      22
-
-#define AUDIT_COMPARE_EGID_TO_FSGID    23
-#define AUDIT_COMPARE_EGID_TO_SGID     24
-#define AUDIT_COMPARE_SGID_TO_FSGID    25
-
-#define AUDIT_MAX_FIELD_COMPARE                AUDIT_COMPARE_SGID_TO_FSGID
-
-/* Rule fields */
-                               /* These are useful when checking the
-                                * task structure at task creation time
-                                * (AUDIT_PER_TASK).  */
-#define AUDIT_PID      0
-#define AUDIT_UID      1
-#define AUDIT_EUID     2
-#define AUDIT_SUID     3
-#define AUDIT_FSUID    4
-#define AUDIT_GID      5
-#define AUDIT_EGID     6
-#define AUDIT_SGID     7
-#define AUDIT_FSGID    8
-#define AUDIT_LOGINUID 9
-#define AUDIT_PERS     10
-#define AUDIT_ARCH     11
-#define AUDIT_MSGTYPE  12
-#define AUDIT_SUBJ_USER        13      /* security label user */
-#define AUDIT_SUBJ_ROLE        14      /* security label role */
-#define AUDIT_SUBJ_TYPE        15      /* security label type */
-#define AUDIT_SUBJ_SEN 16      /* security label sensitivity label */
-#define AUDIT_SUBJ_CLR 17      /* security label clearance label */
-#define AUDIT_PPID     18
-#define AUDIT_OBJ_USER 19
-#define AUDIT_OBJ_ROLE 20
-#define AUDIT_OBJ_TYPE 21
-#define AUDIT_OBJ_LEV_LOW      22
-#define AUDIT_OBJ_LEV_HIGH     23
-
-                               /* These are ONLY useful when checking
-                                * at syscall exit time (AUDIT_AT_EXIT). */
-#define AUDIT_DEVMAJOR 100
-#define AUDIT_DEVMINOR 101
-#define AUDIT_INODE    102
-#define AUDIT_EXIT     103
-#define AUDIT_SUCCESS   104    /* exit >= 0; value ignored */
-#define AUDIT_WATCH    105
-#define AUDIT_PERM     106
-#define AUDIT_DIR      107
-#define AUDIT_FILETYPE 108
-#define AUDIT_OBJ_UID  109
-#define AUDIT_OBJ_GID  110
-#define AUDIT_FIELD_COMPARE    111
-
-#define AUDIT_ARG0      200
-#define AUDIT_ARG1      (AUDIT_ARG0+1)
-#define AUDIT_ARG2      (AUDIT_ARG0+2)
-#define AUDIT_ARG3      (AUDIT_ARG0+3)
-
-#define AUDIT_FILTERKEY        210
-
-#define AUDIT_NEGATE                   0x80000000
-
-/* These are the supported operators.
- *     4  2  1  8
- *     =  >  <  ?
- *     ----------
- *     0  0  0  0      00      nonsense
- *     0  0  0  1      08      &  bit mask
- *     0  0  1  0      10      <
- *     0  1  0  0      20      >
- *     0  1  1  0      30      !=
- *     1  0  0  0      40      =
- *     1  0  0  1      48      &=  bit test
- *     1  0  1  0      50      <=
- *     1  1  0  0      60      >=
- *     1  1  1  1      78      all operators
- */
-#define AUDIT_BIT_MASK                 0x08000000
-#define AUDIT_LESS_THAN                        0x10000000
-#define AUDIT_GREATER_THAN             0x20000000
-#define AUDIT_NOT_EQUAL                        0x30000000
-#define AUDIT_EQUAL                    0x40000000
-#define AUDIT_BIT_TEST                 (AUDIT_BIT_MASK|AUDIT_EQUAL)
-#define AUDIT_LESS_THAN_OR_EQUAL       (AUDIT_LESS_THAN|AUDIT_EQUAL)
-#define AUDIT_GREATER_THAN_OR_EQUAL    (AUDIT_GREATER_THAN|AUDIT_EQUAL)
-#define AUDIT_OPERATORS                        (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
-
-enum {
-       Audit_equal,
-       Audit_not_equal,
-       Audit_bitmask,
-       Audit_bittest,
-       Audit_lt,
-       Audit_gt,
-       Audit_le,
-       Audit_ge,
-       Audit_bad
-};
-
-/* Status symbols */
-                               /* Mask values */
-#define AUDIT_STATUS_ENABLED           0x0001
-#define AUDIT_STATUS_FAILURE           0x0002
-#define AUDIT_STATUS_PID               0x0004
-#define AUDIT_STATUS_RATE_LIMIT                0x0008
-#define AUDIT_STATUS_BACKLOG_LIMIT     0x0010
-                               /* Failure-to-log actions */
-#define AUDIT_FAIL_SILENT      0
-#define AUDIT_FAIL_PRINTK      1
-#define AUDIT_FAIL_PANIC       2
-
-/* distinguish syscall tables */
-#define __AUDIT_ARCH_64BIT 0x80000000
-#define __AUDIT_ARCH_LE           0x40000000
-#define AUDIT_ARCH_ALPHA       (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_ARM         (EM_ARM|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_ARMEB       (EM_ARM)
-#define AUDIT_ARCH_CRIS                (EM_CRIS|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_FRV         (EM_FRV)
-#define AUDIT_ARCH_H8300       (EM_H8_300)
-#define AUDIT_ARCH_I386                (EM_386|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_IA64                (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_M32R                (EM_M32R)
-#define AUDIT_ARCH_M68K                (EM_68K)
-#define AUDIT_ARCH_MIPS                (EM_MIPS)
-#define AUDIT_ARCH_MIPSEL      (EM_MIPS|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_MIPS64      (EM_MIPS|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_MIPSEL64    (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_OPENRISC    (EM_OPENRISC)
-#define AUDIT_ARCH_PARISC      (EM_PARISC)
-#define AUDIT_ARCH_PARISC64    (EM_PARISC|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_PPC         (EM_PPC)
-#define AUDIT_ARCH_PPC64       (EM_PPC64|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_S390                (EM_S390)
-#define AUDIT_ARCH_S390X       (EM_S390|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_SH          (EM_SH)
-#define AUDIT_ARCH_SHEL                (EM_SH|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_SH64                (EM_SH|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_SHEL64      (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#define AUDIT_ARCH_SPARC       (EM_SPARC)
-#define AUDIT_ARCH_SPARC64     (EM_SPARCV9|__AUDIT_ARCH_64BIT)
-#define AUDIT_ARCH_X86_64      (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-
-#define AUDIT_PERM_EXEC                1
-#define AUDIT_PERM_WRITE       2
-#define AUDIT_PERM_READ                4
-#define AUDIT_PERM_ATTR                8
-
-struct audit_status {
-       __u32           mask;           /* Bit mask for valid entries */
-       __u32           enabled;        /* 1 = enabled, 0 = disabled */
-       __u32           failure;        /* Failure-to-log action */
-       __u32           pid;            /* pid of auditd process */
-       __u32           rate_limit;     /* messages rate limit (per second) */
-       __u32           backlog_limit;  /* waiting messages limit */
-       __u32           lost;           /* messages lost */
-       __u32           backlog;        /* messages waiting in queue */
-};
-
-struct audit_tty_status {
-       __u32           enabled; /* 1 = enabled, 0 = disabled */
-};
-
-/* audit_rule_data supports filter rules with both integer and string
- * fields.  It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
- * AUDIT_LIST_RULES requests.
- */
-struct audit_rule_data {
-       __u32           flags;  /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
-       __u32           action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
-       __u32           field_count;
-       __u32           mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
-       __u32           fields[AUDIT_MAX_FIELDS];
-       __u32           values[AUDIT_MAX_FIELDS];
-       __u32           fieldflags[AUDIT_MAX_FIELDS];
-       __u32           buflen; /* total length of string fields */
-       char            buf[0]; /* string fields buffer */
-};
-
-/* audit_rule is supported to maintain backward compatibility with
- * userspace.  It supports integer fields only and corresponds to
- * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
- */
-struct audit_rule {            /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
-       __u32           flags;  /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
-       __u32           action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
-       __u32           field_count;
-       __u32           mask[AUDIT_BITMASK_SIZE];
-       __u32           fields[AUDIT_MAX_FIELDS];
-       __u32           values[AUDIT_MAX_FIELDS];
-};
-
-#ifdef __KERNEL__
 #include <linux/sched.h>
+#include <uapi/linux/audit.h>
 
 struct audit_sig_info {
        uid_t           uid;
@@ -860,4 +482,3 @@ static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
 }
 
 #endif
-#endif
index da64e15004b642b97d2d31da90231115fd2332ef..fcd704d354c4c345d0c91aa4ebcb2f811b3851fa 100644 (file)
  *
  * ----------------------------------------------------------------------- */
 
-
 #ifndef _LINUX_AUTO_FS_H
 #define _LINUX_AUTO_FS_H
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/fs.h>
 #include <linux/limits.h>
 #include <linux/ioctl.h>
-#else
-#include <sys/ioctl.h>
-#endif /* __KERNEL__ */
-
-/* This file describes autofs v3 */
-#define AUTOFS_PROTO_VERSION   3
-
-/* Range of protocol versions defined */
-#define AUTOFS_MAX_PROTO_VERSION       AUTOFS_PROTO_VERSION
-#define AUTOFS_MIN_PROTO_VERSION       AUTOFS_PROTO_VERSION
-
-/*
- * Architectures where both 32- and 64-bit binaries can be executed
- * on 64-bit kernels need this.  This keeps the structure format
- * uniform, and makes sure the wait_queue_token isn't too big to be
- * passed back down to the kernel.
- *
- * This assumes that on these architectures:
- * mode     32 bit    64 bit
- * -------------------------
- * int      32 bit    32 bit
- * long     32 bit    64 bit
- *
- * If so, 32-bit user-space code should be backwards compatible.
- */
-
-#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
- || defined(__powerpc__) || defined(__s390__)
-typedef unsigned int autofs_wqt_t;
-#else
-typedef unsigned long autofs_wqt_t;
-#endif
-
-/* Packet types */
-#define autofs_ptype_missing   0       /* Missing entry (mount request) */
-#define autofs_ptype_expire    1       /* Expire entry (umount request) */
-
-struct autofs_packet_hdr {
-       int proto_version;              /* Protocol version */
-       int type;                       /* Type of packet */
-};
-
-struct autofs_packet_missing {
-       struct autofs_packet_hdr hdr;
-        autofs_wqt_t wait_queue_token;
-       int len;
-       char name[NAME_MAX+1];
-};     
-
-/* v3 expire (via ioctl) */
-struct autofs_packet_expire {
-       struct autofs_packet_hdr hdr;
-       int len;
-       char name[NAME_MAX+1];
-};
-
-#define AUTOFS_IOC_READY      _IO(0x93,0x60)
-#define AUTOFS_IOC_FAIL       _IO(0x93,0x61)
-#define AUTOFS_IOC_CATATONIC  _IO(0x93,0x62)
-#define AUTOFS_IOC_PROTOVER   _IOR(0x93,0x63,int)
-#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
-#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
-#define AUTOFS_IOC_EXPIRE     _IOR(0x93,0x65,struct autofs_packet_expire)
-
+#include <uapi/linux/auto_fs.h>
 #endif /* _LINUX_AUTO_FS_H */
index f3b5d4e3a2ac43eb1b529802122cb38c7898827b..669fef5c745a3fe98145a87d21a588cb64835c15 100644 (file)
@@ -1,39 +1,8 @@
 #ifndef _LINUX_AUXVEC_H
 #define _LINUX_AUXVEC_H
 
-#include <asm/auxvec.h>
+#include <uapi/linux/auxvec.h>
 
-/* Symbolic values for the entries in the auxiliary table
-   put on the initial stack */
-#define AT_NULL   0    /* end of vector */
-#define AT_IGNORE 1    /* entry should be ignored */
-#define AT_EXECFD 2    /* file descriptor of program */
-#define AT_PHDR   3    /* program headers for program */
-#define AT_PHENT  4    /* size of program header entry */
-#define AT_PHNUM  5    /* number of program headers */
-#define AT_PAGESZ 6    /* system page size */
-#define AT_BASE   7    /* base address of interpreter */
-#define AT_FLAGS  8    /* flags */
-#define AT_ENTRY  9    /* entry point of program */
-#define AT_NOTELF 10   /* program is not ELF */
-#define AT_UID    11   /* real uid */
-#define AT_EUID   12   /* effective uid */
-#define AT_GID    13   /* real gid */
-#define AT_EGID   14   /* effective gid */
-#define AT_PLATFORM 15  /* string identifying CPU for optimizations */
-#define AT_HWCAP  16    /* arch dependent hints at CPU capabilities */
-#define AT_CLKTCK 17   /* frequency at which times() increments */
-/* AT_* values 18 through 22 are reserved */
-#define AT_SECURE 23   /* secure mode boolean */
-#define AT_BASE_PLATFORM 24    /* string identifying real platform, may
-                                * differ from AT_PLATFORM. */
-#define AT_RANDOM 25   /* address of 16 random bytes */
-
-#define AT_EXECFN  31  /* filename of program */
-
-#ifdef __KERNEL__
 #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */
   /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
-#endif
-
 #endif /* _LINUX_AUXVEC_H */
index 26531f32bbb2d29793979c1c240642f9463073e5..cfcc6bfcaec062f30d7c9eff3f4297a7fc042f33 100644 (file)
@@ -1,26 +1,10 @@
 #ifndef _LINUX_BINFMTS_H
 #define _LINUX_BINFMTS_H
 
-#include <linux/capability.h>
-
-struct pt_regs;
-
-/*
- * These are the maximum length and maximum number of strings passed to the
- * execve() system call.  MAX_ARG_STRLEN is essentially random but serves to
- * prevent the kernel from being unduly impacted by misaddressed pointers.
- * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
- */
-#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
-#define MAX_ARG_STRINGS 0x7FFFFFFF
-
-/* sizeof(linux_binprm->buf) */
-#define BINPRM_BUF_SIZE 128
-
-#ifdef __KERNEL__
 #include <linux/sched.h>
 #include <linux/unistd.h>
 #include <asm/exec.h>
+#include <uapi/linux/binfmts.h>
 
 #define CORENAME_MAX_SIZE 128
 
@@ -141,5 +125,4 @@ extern void free_bprm(struct linux_binprm *);
 extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
 #endif
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_BINFMTS_H */
index 4d1a0748eaf8721c0cd4a34c0baf29ce455fc2d2..7c2e030e72f10542612ba34ce79b18f6b1b8ad06 100644 (file)
 #ifndef BLKTRACE_H
 #define BLKTRACE_H
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/blkdev.h>
 #include <linux/relay.h>
 #include <linux/compat.h>
-#endif
-
-/*
- * Trace categories
- */
-enum blktrace_cat {
-       BLK_TC_READ     = 1 << 0,       /* reads */
-       BLK_TC_WRITE    = 1 << 1,       /* writes */
-       BLK_TC_FLUSH    = 1 << 2,       /* flush */
-       BLK_TC_SYNC     = 1 << 3,       /* sync IO */
-       BLK_TC_SYNCIO   = BLK_TC_SYNC,
-       BLK_TC_QUEUE    = 1 << 4,       /* queueing/merging */
-       BLK_TC_REQUEUE  = 1 << 5,       /* requeueing */
-       BLK_TC_ISSUE    = 1 << 6,       /* issue */
-       BLK_TC_COMPLETE = 1 << 7,       /* completions */
-       BLK_TC_FS       = 1 << 8,       /* fs requests */
-       BLK_TC_PC       = 1 << 9,       /* pc requests */
-       BLK_TC_NOTIFY   = 1 << 10,      /* special message */
-       BLK_TC_AHEAD    = 1 << 11,      /* readahead */
-       BLK_TC_META     = 1 << 12,      /* metadata */
-       BLK_TC_DISCARD  = 1 << 13,      /* discard requests */
-       BLK_TC_DRV_DATA = 1 << 14,      /* binary per-driver data */
-       BLK_TC_FUA      = 1 << 15,      /* fua requests */
-
-       BLK_TC_END      = 1 << 15,      /* we've run out of bits! */
-};
-
-#define BLK_TC_SHIFT           (16)
-#define BLK_TC_ACT(act)                ((act) << BLK_TC_SHIFT)
-
-/*
- * Basic trace actions
- */
-enum blktrace_act {
-       __BLK_TA_QUEUE = 1,             /* queued */
-       __BLK_TA_BACKMERGE,             /* back merged to existing rq */
-       __BLK_TA_FRONTMERGE,            /* front merge to existing rq */
-       __BLK_TA_GETRQ,                 /* allocated new request */
-       __BLK_TA_SLEEPRQ,               /* sleeping on rq allocation */
-       __BLK_TA_REQUEUE,               /* request requeued */
-       __BLK_TA_ISSUE,                 /* sent to driver */
-       __BLK_TA_COMPLETE,              /* completed by driver */
-       __BLK_TA_PLUG,                  /* queue was plugged */
-       __BLK_TA_UNPLUG_IO,             /* queue was unplugged by io */
-       __BLK_TA_UNPLUG_TIMER,          /* queue was unplugged by timer */
-       __BLK_TA_INSERT,                /* insert request */
-       __BLK_TA_SPLIT,                 /* bio was split */
-       __BLK_TA_BOUNCE,                /* bio was bounced */
-       __BLK_TA_REMAP,                 /* bio was remapped */
-       __BLK_TA_ABORT,                 /* request aborted */
-       __BLK_TA_DRV_DATA,              /* driver-specific binary data */
-};
-
-/*
- * Notify events.
- */
-enum blktrace_notify {
-       __BLK_TN_PROCESS = 0,           /* establish pid/name mapping */
-       __BLK_TN_TIMESTAMP,             /* include system clock */
-       __BLK_TN_MESSAGE,               /* Character string message */
-};
-
-
-/*
- * Trace actions in full. Additionally, read or write is masked
- */
-#define BLK_TA_QUEUE           (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_BACKMERGE       (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_FRONTMERGE      (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
-#define        BLK_TA_GETRQ            (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
-#define        BLK_TA_SLEEPRQ          (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
-#define        BLK_TA_REQUEUE          (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
-#define BLK_TA_ISSUE           (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
-#define BLK_TA_COMPLETE                (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
-#define BLK_TA_PLUG            (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_UNPLUG_IO       (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_UNPLUG_TIMER    (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_INSERT          (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_SPLIT           (__BLK_TA_SPLIT)
-#define BLK_TA_BOUNCE          (__BLK_TA_BOUNCE)
-#define BLK_TA_REMAP           (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_ABORT           (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
-#define BLK_TA_DRV_DATA        (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
-
-#define BLK_TN_PROCESS         (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
-#define BLK_TN_TIMESTAMP       (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
-#define BLK_TN_MESSAGE         (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
-
-#define BLK_IO_TRACE_MAGIC     0x65617400
-#define BLK_IO_TRACE_VERSION   0x07
-
-/*
- * The trace itself
- */
-struct blk_io_trace {
-       __u32 magic;            /* MAGIC << 8 | version */
-       __u32 sequence;         /* event number */
-       __u64 time;             /* in microseconds */
-       __u64 sector;           /* disk offset */
-       __u32 bytes;            /* transfer length */
-       __u32 action;           /* what happened */
-       __u32 pid;              /* who did it */
-       __u32 device;           /* device number */
-       __u32 cpu;              /* on what cpu did it happen */
-       __u16 error;            /* completion error */
-       __u16 pdu_len;          /* length of data after this trace */
-};
-
-/*
- * The remap event
- */
-struct blk_io_trace_remap {
-       __be32 device_from;
-       __be32 device_to;
-       __be64 sector_from;
-};
-
-enum {
-       Blktrace_setup = 1,
-       Blktrace_running,
-       Blktrace_stopped,
-};
-
-#define BLKTRACE_BDEV_SIZE     32
-
-/*
- * User setup structure passed with BLKTRACESTART
- */
-struct blk_user_trace_setup {
-       char name[BLKTRACE_BDEV_SIZE];  /* output */
-       __u16 act_mask;                 /* input */
-       __u32 buf_size;                 /* input */
-       __u32 buf_nr;                   /* input */
-       __u64 start_lba;
-       __u64 end_lba;
-       __u32 pid;
-};
+#include <uapi/linux/blktrace_api.h>
 
-#ifdef __KERNEL__
 #if defined(CONFIG_BLK_DEV_IO_TRACE)
 
 #include <linux/sysfs.h>
@@ -250,5 +111,4 @@ extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
 
 #endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
 
-#endif /* __KERNEL__ */
 #endif
index ecb4730d0868504d1ed9d0cb58a3522c38073695..7173f6e9d2dd55fbcba32070b15194f8538b9b1c 100644 (file)
@@ -1,67 +1,8 @@
 #ifndef BSG_H
 #define BSG_H
 
-#include <linux/types.h>
+#include <uapi/linux/bsg.h>
 
-#define BSG_PROTOCOL_SCSI              0
-
-#define BSG_SUB_PROTOCOL_SCSI_CMD      0
-#define BSG_SUB_PROTOCOL_SCSI_TMF      1
-#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT        2
-
-/*
- * For flags member below
- * sg.h sg_io_hdr also has bits defined for it's flags member. However
- * none of these bits are implemented/used by bsg. The bits below are
- * allocated to not conflict with sg.h ones anyway.
- */
-#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
-
-struct sg_io_v4 {
-       __s32 guard;            /* [i] 'Q' to differentiate from v3 */
-       __u32 protocol;         /* [i] 0 -> SCSI , .... */
-       __u32 subprotocol;      /* [i] 0 -> SCSI command, 1 -> SCSI task
-                                  management function, .... */
-
-       __u32 request_len;      /* [i] in bytes */
-       __u64 request;          /* [i], [*i] {SCSI: cdb} */
-       __u64 request_tag;      /* [i] {SCSI: task tag (only if flagged)} */
-       __u32 request_attr;     /* [i] {SCSI: task attribute} */
-       __u32 request_priority; /* [i] {SCSI: task priority} */
-       __u32 request_extra;    /* [i] {spare, for padding} */
-       __u32 max_response_len; /* [i] in bytes */
-       __u64 response;         /* [i], [*o] {SCSI: (auto)sense data} */
-
-        /* "dout_": data out (to device); "din_": data in (from device) */
-       __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
-                                  dout_xfer points to array of iovec */
-       __u32 dout_xfer_len;    /* [i] bytes to be transferred to device */
-       __u32 din_iovec_count;  /* [i] 0 -> "flat" din transfer */
-       __u32 din_xfer_len;     /* [i] bytes to be transferred from device */
-       __u64 dout_xferp;       /* [i], [*i] */
-       __u64 din_xferp;        /* [i], [*o] */
-
-       __u32 timeout;          /* [i] units: millisecond */
-       __u32 flags;            /* [i] bit mask */
-       __u64 usr_ptr;          /* [i->o] unused internally */
-       __u32 spare_in;         /* [i] */
-
-       __u32 driver_status;    /* [o] 0 -> ok */
-       __u32 transport_status; /* [o] 0 -> ok */
-       __u32 device_status;    /* [o] {SCSI: command completion status} */
-       __u32 retry_delay;      /* [o] {SCSI: status auxiliary information} */
-       __u32 info;             /* [o] additional information */
-       __u32 duration;         /* [o] time to complete, in milliseconds */
-       __u32 response_len;     /* [o] bytes of response actually written */
-       __s32 din_resid;        /* [o] din_xfer_len - actual_din_xfer_len */
-       __s32 dout_resid;       /* [o] dout_xfer_len - actual_dout_xfer_len */
-       __u64 generated_tag;    /* [o] {SCSI: transport generated task tag} */
-       __u32 spare_out;        /* [o] */
-
-       __u32 padding;
-};
-
-#ifdef __KERNEL__
 
 #if defined(CONFIG_BLK_DEV_BSG)
 struct bsg_class_device {
@@ -89,6 +30,4 @@ static inline void bsg_unregister_queue(struct request_queue *q)
 }
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif
index 5896e344ba6c91a1cf7c51a95b8ac57caf0cd9fa..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,2 +0,0 @@
-header-y += big_endian.h
-header-y += little_endian.h
index 3c80fd7e8b567c8f6d8cd768c120926a424ec577..392041475c720148c4332b38ea81cd3d1460f425 100644 (file)
@@ -1,108 +1,7 @@
 #ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
 #define _LINUX_BYTEORDER_BIG_ENDIAN_H
 
-#ifndef __BIG_ENDIAN
-#define __BIG_ENDIAN 4321
-#endif
-#ifndef __BIG_ENDIAN_BITFIELD
-#define __BIG_ENDIAN_BITFIELD
-#endif
+#include <uapi/linux/byteorder/big_endian.h>
 
-#include <linux/types.h>
-#include <linux/swab.h>
-
-#define __constant_htonl(x) ((__force __be32)(__u32)(x))
-#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
-#define __constant_htons(x) ((__force __be16)(__u16)(x))
-#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
-#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
-#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
-#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
-#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
-#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
-#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
-#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
-#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
-#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
-#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
-#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
-#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
-#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const __u64 *p)
-{
-       return (__force __le64)__swab64p(p);
-}
-static inline __u64 __le64_to_cpup(const __le64 *p)
-{
-       return __swab64p((__u64 *)p);
-}
-static inline __le32 __cpu_to_le32p(const __u32 *p)
-{
-       return (__force __le32)__swab32p(p);
-}
-static inline __u32 __le32_to_cpup(const __le32 *p)
-{
-       return __swab32p((__u32 *)p);
-}
-static inline __le16 __cpu_to_le16p(const __u16 *p)
-{
-       return (__force __le16)__swab16p(p);
-}
-static inline __u16 __le16_to_cpup(const __le16 *p)
-{
-       return __swab16p((__u16 *)p);
-}
-static inline __be64 __cpu_to_be64p(const __u64 *p)
-{
-       return (__force __be64)*p;
-}
-static inline __u64 __be64_to_cpup(const __be64 *p)
-{
-       return (__force __u64)*p;
-}
-static inline __be32 __cpu_to_be32p(const __u32 *p)
-{
-       return (__force __be32)*p;
-}
-static inline __u32 __be32_to_cpup(const __be32 *p)
-{
-       return (__force __u32)*p;
-}
-static inline __be16 __cpu_to_be16p(const __u16 *p)
-{
-       return (__force __be16)*p;
-}
-static inline __u16 __be16_to_cpup(const __be16 *p)
-{
-       return (__force __u16)*p;
-}
-#define __cpu_to_le64s(x) __swab64s((x))
-#define __le64_to_cpus(x) __swab64s((x))
-#define __cpu_to_le32s(x) __swab32s((x))
-#define __le32_to_cpus(x) __swab32s((x))
-#define __cpu_to_le16s(x) __swab16s((x))
-#define __le16_to_cpus(x) __swab16s((x))
-#define __cpu_to_be64s(x) do { (void)(x); } while (0)
-#define __be64_to_cpus(x) do { (void)(x); } while (0)
-#define __cpu_to_be32s(x) do { (void)(x); } while (0)
-#define __be32_to_cpus(x) do { (void)(x); } while (0)
-#define __cpu_to_be16s(x) do { (void)(x); } while (0)
-#define __be16_to_cpus(x) do { (void)(x); } while (0)
-
-#ifdef __KERNEL__
 #include <linux/byteorder/generic.h>
-#endif
-
 #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
index 83195fb82962838fa8d4c70ea77927ac0b7ac7e2..08057377aa23299d59c281ff09030c091392f844 100644 (file)
@@ -1,108 +1,7 @@
 #ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
 #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
 
-#ifndef __LITTLE_ENDIAN
-#define __LITTLE_ENDIAN 1234
-#endif
-#ifndef __LITTLE_ENDIAN_BITFIELD
-#define __LITTLE_ENDIAN_BITFIELD
-#endif
+#include <uapi/linux/byteorder/little_endian.h>
 
-#include <linux/types.h>
-#include <linux/swab.h>
-
-#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
-#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
-#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
-#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
-#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
-#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
-#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
-#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
-#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
-#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
-#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
-#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
-#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
-#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
-#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
-#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
-#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
-#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
-#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
-#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
-#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
-#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
-#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
-#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
-#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
-#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
-#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
-#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
-
-static inline __le64 __cpu_to_le64p(const __u64 *p)
-{
-       return (__force __le64)*p;
-}
-static inline __u64 __le64_to_cpup(const __le64 *p)
-{
-       return (__force __u64)*p;
-}
-static inline __le32 __cpu_to_le32p(const __u32 *p)
-{
-       return (__force __le32)*p;
-}
-static inline __u32 __le32_to_cpup(const __le32 *p)
-{
-       return (__force __u32)*p;
-}
-static inline __le16 __cpu_to_le16p(const __u16 *p)
-{
-       return (__force __le16)*p;
-}
-static inline __u16 __le16_to_cpup(const __le16 *p)
-{
-       return (__force __u16)*p;
-}
-static inline __be64 __cpu_to_be64p(const __u64 *p)
-{
-       return (__force __be64)__swab64p(p);
-}
-static inline __u64 __be64_to_cpup(const __be64 *p)
-{
-       return __swab64p((__u64 *)p);
-}
-static inline __be32 __cpu_to_be32p(const __u32 *p)
-{
-       return (__force __be32)__swab32p(p);
-}
-static inline __u32 __be32_to_cpup(const __be32 *p)
-{
-       return __swab32p((__u32 *)p);
-}
-static inline __be16 __cpu_to_be16p(const __u16 *p)
-{
-       return (__force __be16)__swab16p(p);
-}
-static inline __u16 __be16_to_cpup(const __be16 *p)
-{
-       return __swab16p((__u16 *)p);
-}
-#define __cpu_to_le64s(x) do { (void)(x); } while (0)
-#define __le64_to_cpus(x) do { (void)(x); } while (0)
-#define __cpu_to_le32s(x) do { (void)(x); } while (0)
-#define __le32_to_cpus(x) do { (void)(x); } while (0)
-#define __cpu_to_le16s(x) do { (void)(x); } while (0)
-#define __le16_to_cpus(x) do { (void)(x); } while (0)
-#define __cpu_to_be64s(x) __swab64s((x))
-#define __be64_to_cpus(x) __swab64s((x))
-#define __cpu_to_be32s(x) __swab32s((x))
-#define __be32_to_cpus(x) __swab32s((x))
-#define __cpu_to_be16s(x) __swab16s((x))
-#define __be16_to_cpus(x) __swab16s((x))
-
-#ifdef __KERNEL__
 #include <linux/byteorder/generic.h>
-#endif
-
 #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
index d10b7ed595b15c07c58f30e08ca841dafb2aa0a1..98503b7923698e3b527dc278aa32d5db1da1dfe1 100644 (file)
@@ -9,82 +9,11 @@
  *
  * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
  */
-
 #ifndef _LINUX_CAPABILITY_H
 #define _LINUX_CAPABILITY_H
 
-#include <linux/types.h>
-
-struct task_struct;
-
-/* User-level do most of the mapping between kernel and user
-   capabilities based on the version tag given by the kernel. The
-   kernel might be somewhat backwards compatible, but don't bet on
-   it. */
-
-/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
-   a set of three capability sets.  The transposition of 3*the
-   following structure to such a composite is better handled in a user
-   library since the draft standard requires the use of malloc/free
-   etc.. */
-
-#define _LINUX_CAPABILITY_VERSION_1  0x19980330
-#define _LINUX_CAPABILITY_U32S_1     1
-
-#define _LINUX_CAPABILITY_VERSION_2  0x20071026  /* deprecated - use v3 */
-#define _LINUX_CAPABILITY_U32S_2     2
-
-#define _LINUX_CAPABILITY_VERSION_3  0x20080522
-#define _LINUX_CAPABILITY_U32S_3     2
-
-typedef struct __user_cap_header_struct {
-       __u32 version;
-       int pid;
-} __user *cap_user_header_t;
-
-typedef struct __user_cap_data_struct {
-        __u32 effective;
-        __u32 permitted;
-        __u32 inheritable;
-} __user *cap_user_data_t;
-
-
-#define VFS_CAP_REVISION_MASK  0xFF000000
-#define VFS_CAP_REVISION_SHIFT 24
-#define VFS_CAP_FLAGS_MASK     ~VFS_CAP_REVISION_MASK
-#define VFS_CAP_FLAGS_EFFECTIVE        0x000001
-
-#define VFS_CAP_REVISION_1     0x01000000
-#define VFS_CAP_U32_1           1
-#define XATTR_CAPS_SZ_1         (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
-
-#define VFS_CAP_REVISION_2     0x02000000
-#define VFS_CAP_U32_2           2
-#define XATTR_CAPS_SZ_2         (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
+#include <uapi/linux/capability.h>
 
-#define XATTR_CAPS_SZ           XATTR_CAPS_SZ_2
-#define VFS_CAP_U32             VFS_CAP_U32_2
-#define VFS_CAP_REVISION       VFS_CAP_REVISION_2
-
-struct vfs_cap_data {
-       __le32 magic_etc;            /* Little endian */
-       struct {
-               __le32 permitted;    /* Little endian */
-               __le32 inheritable;  /* Little endian */
-       } data[VFS_CAP_U32];
-};
-
-#ifndef __KERNEL__
-
-/*
- * Backwardly compatible definition for source code - trapped in a
- * 32-bit world. If you find you need this, please consider using
- * libcap to untrap yourself...
- */
-#define _LINUX_CAPABILITY_VERSION  _LINUX_CAPABILITY_VERSION_1
-#define _LINUX_CAPABILITY_U32S     _LINUX_CAPABILITY_U32S_1
-
-#else
 
 #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
 #define _KERNEL_CAPABILITY_U32S    _LINUX_CAPABILITY_U32S_3
@@ -105,277 +34,6 @@ struct cpu_vfs_cap_data {
 #define _USER_CAP_HEADER_SIZE  (sizeof(struct __user_cap_header_struct))
 #define _KERNEL_CAP_T_SIZE     (sizeof(kernel_cap_t))
 
-#endif
-
-
-/**
- ** POSIX-draft defined capabilities.
- **/
-
-/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
-   overrides the restriction of changing file ownership and group
-   ownership. */
-
-#define CAP_CHOWN            0
-
-/* Override all DAC access, including ACL execute access if
-   [_POSIX_ACL] is defined. Excluding DAC access covered by
-   CAP_LINUX_IMMUTABLE. */
-
-#define CAP_DAC_OVERRIDE     1
-
-/* Overrides all DAC restrictions regarding read and search on files
-   and directories, including ACL restrictions if [_POSIX_ACL] is
-   defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
-
-#define CAP_DAC_READ_SEARCH  2
-
-/* Overrides all restrictions about allowed operations on files, where
-   file owner ID must be equal to the user ID, except where CAP_FSETID
-   is applicable. It doesn't override MAC and DAC restrictions. */
-
-#define CAP_FOWNER           3
-
-/* Overrides the following restrictions that the effective user ID
-   shall match the file owner ID when setting the S_ISUID and S_ISGID
-   bits on that file; that the effective group ID (or one of the
-   supplementary group IDs) shall match the file owner ID when setting
-   the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
-   cleared on successful return from chown(2) (not implemented). */
-
-#define CAP_FSETID           4
-
-/* Overrides the restriction that the real or effective user ID of a
-   process sending a signal must match the real or effective user ID
-   of the process receiving the signal. */
-
-#define CAP_KILL             5
-
-/* Allows setgid(2) manipulation */
-/* Allows setgroups(2) */
-/* Allows forged gids on socket credentials passing. */
-
-#define CAP_SETGID           6
-
-/* Allows set*uid(2) manipulation (including fsuid). */
-/* Allows forged pids on socket credentials passing. */
-
-#define CAP_SETUID           7
-
-
-/**
- ** Linux-specific capabilities
- **/
-
-/* Without VFS support for capabilities:
- *   Transfer any capability in your permitted set to any pid,
- *   remove any capability in your permitted set from any pid
- * With VFS support for capabilities (neither of above, but)
- *   Add any capability from current's capability bounding set
- *       to the current process' inheritable set
- *   Allow taking bits out of capability bounding set
- *   Allow modification of the securebits for a process
- */
-
-#define CAP_SETPCAP          8
-
-/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
-
-#define CAP_LINUX_IMMUTABLE  9
-
-/* Allows binding to TCP/UDP sockets below 1024 */
-/* Allows binding to ATM VCIs below 32 */
-
-#define CAP_NET_BIND_SERVICE 10
-
-/* Allow broadcasting, listen to multicast */
-
-#define CAP_NET_BROADCAST    11
-
-/* Allow interface configuration */
-/* Allow administration of IP firewall, masquerading and accounting */
-/* Allow setting debug option on sockets */
-/* Allow modification of routing tables */
-/* Allow setting arbitrary process / process group ownership on
-   sockets */
-/* Allow binding to any address for transparent proxying (also via NET_RAW) */
-/* Allow setting TOS (type of service) */
-/* Allow setting promiscuous mode */
-/* Allow clearing driver statistics */
-/* Allow multicasting */
-/* Allow read/write of device-specific registers */
-/* Allow activation of ATM control sockets */
-
-#define CAP_NET_ADMIN        12
-
-/* Allow use of RAW sockets */
-/* Allow use of PACKET sockets */
-/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
-
-#define CAP_NET_RAW          13
-
-/* Allow locking of shared memory segments */
-/* Allow mlock and mlockall (which doesn't really have anything to do
-   with IPC) */
-
-#define CAP_IPC_LOCK         14
-
-/* Override IPC ownership checks */
-
-#define CAP_IPC_OWNER        15
-
-/* Insert and remove kernel modules - modify kernel without limit */
-#define CAP_SYS_MODULE       16
-
-/* Allow ioperm/iopl access */
-/* Allow sending USB messages to any device via /proc/bus/usb */
-
-#define CAP_SYS_RAWIO        17
-
-/* Allow use of chroot() */
-
-#define CAP_SYS_CHROOT       18
-
-/* Allow ptrace() of any process */
-
-#define CAP_SYS_PTRACE       19
-
-/* Allow configuration of process accounting */
-
-#define CAP_SYS_PACCT        20
-
-/* Allow configuration of the secure attention key */
-/* Allow administration of the random device */
-/* Allow examination and configuration of disk quotas */
-/* Allow setting the domainname */
-/* Allow setting the hostname */
-/* Allow calling bdflush() */
-/* Allow mount() and umount(), setting up new smb connection */
-/* Allow some autofs root ioctls */
-/* Allow nfsservctl */
-/* Allow VM86_REQUEST_IRQ */
-/* Allow to read/write pci config on alpha */
-/* Allow irix_prctl on mips (setstacksize) */
-/* Allow flushing all cache on m68k (sys_cacheflush) */
-/* Allow removing semaphores */
-/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
-   and shared memory */
-/* Allow locking/unlocking of shared memory segment */
-/* Allow turning swap on/off */
-/* Allow forged pids on socket credentials passing */
-/* Allow setting readahead and flushing buffers on block devices */
-/* Allow setting geometry in floppy driver */
-/* Allow turning DMA on/off in xd driver */
-/* Allow administration of md devices (mostly the above, but some
-   extra ioctls) */
-/* Allow tuning the ide driver */
-/* Allow access to the nvram device */
-/* Allow administration of apm_bios, serial and bttv (TV) device */
-/* Allow manufacturer commands in isdn CAPI support driver */
-/* Allow reading non-standardized portions of pci configuration space */
-/* Allow DDI debug ioctl on sbpcd driver */
-/* Allow setting up serial ports */
-/* Allow sending raw qic-117 commands */
-/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
-   arbitrary SCSI commands */
-/* Allow setting encryption key on loopback filesystem */
-/* Allow setting zone reclaim policy */
-
-#define CAP_SYS_ADMIN        21
-
-/* Allow use of reboot() */
-
-#define CAP_SYS_BOOT         22
-
-/* Allow raising priority and setting priority on other (different
-   UID) processes */
-/* Allow use of FIFO and round-robin (realtime) scheduling on own
-   processes and setting the scheduling algorithm used by another
-   process. */
-/* Allow setting cpu affinity on other processes */
-
-#define CAP_SYS_NICE         23
-
-/* Override resource limits. Set resource limits. */
-/* Override quota limits. */
-/* Override reserved space on ext2 filesystem */
-/* Modify data journaling mode on ext3 filesystem (uses journaling
-   resources) */
-/* NOTE: ext2 honors fsuid when checking for resource overrides, so
-   you can override using fsuid too */
-/* Override size restrictions on IPC message queues */
-/* Allow more than 64hz interrupts from the real-time clock */
-/* Override max number of consoles on console allocation */
-/* Override max number of keymaps */
-
-#define CAP_SYS_RESOURCE     24
-
-/* Allow manipulation of system clock */
-/* Allow irix_stime on mips */
-/* Allow setting the real-time clock */
-
-#define CAP_SYS_TIME         25
-
-/* Allow configuration of tty devices */
-/* Allow vhangup() of tty */
-
-#define CAP_SYS_TTY_CONFIG   26
-
-/* Allow the privileged aspects of mknod() */
-
-#define CAP_MKNOD            27
-
-/* Allow taking of leases on files */
-
-#define CAP_LEASE            28
-
-#define CAP_AUDIT_WRITE      29
-
-#define CAP_AUDIT_CONTROL    30
-
-#define CAP_SETFCAP         31
-
-/* Override MAC access.
-   The base kernel enforces no MAC policy.
-   An LSM may enforce a MAC policy, and if it does and it chooses
-   to implement capability based overrides of that policy, this is
-   the capability it should use to do so. */
-
-#define CAP_MAC_OVERRIDE     32
-
-/* Allow MAC configuration or state changes.
-   The base kernel requires no MAC configuration.
-   An LSM may enforce a MAC policy, and if it does and it chooses
-   to implement capability based checks on modifications to that
-   policy or the data required to maintain it, this is the
-   capability it should use to do so. */
-
-#define CAP_MAC_ADMIN        33
-
-/* Allow configuring the kernel's syslog (printk behaviour) */
-
-#define CAP_SYSLOG           34
-
-/* Allow triggering something that will wake the system */
-
-#define CAP_WAKE_ALARM            35
-
-/* Allow preventing system suspends */
-
-#define CAP_BLOCK_SUSPEND    36
-
-#define CAP_LAST_CAP         CAP_BLOCK_SUSPEND
-
-#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
-
-/*
- * Bit location of each capability (used by user-space library and kernel)
- */
-
-#define CAP_TO_INDEX(x)     ((x) >> 5)        /* 1 << 5 == bits in __u32 */
-#define CAP_TO_MASK(x)      (1 << ((x) & 31)) /* mask for indexed __u32 */
-
-#ifdef __KERNEL__
 
 struct inode;
 struct dentry;
@@ -557,6 +215,4 @@ extern bool inode_capable(const struct inode *inode, int cap);
 /* audit system wants to get cap info from files as well */
 extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
 
-#endif /* __KERNEL__ */
-
 #endif /* !_LINUX_CAPABILITY_H */
index 986493f5b92ba2c31875c42f78954a5baf4148c4..84b6e2d0f44d491409f92c39e379d17e440e0074 100644 (file)
@@ -1,91 +1,8 @@
 #ifndef CCISS_IOCTLH
 #define CCISS_IOCTLH
 
-#include <linux/types.h>
-#include <linux/ioctl.h>
-#include <linux/cciss_defs.h>
+#include <uapi/linux/cciss_ioctl.h>
 
-#define CCISS_IOC_MAGIC 'B'
-
-
-typedef struct _cciss_pci_info_struct
-{
-       unsigned char   bus;
-       unsigned char   dev_fn;
-       unsigned short  domain;
-       __u32           board_id;
-} cciss_pci_info_struct; 
-
-typedef struct _cciss_coalint_struct
-{
-       __u32  delay;
-       __u32  count;
-} cciss_coalint_struct;
-
-typedef char NodeName_type[16];
-
-typedef __u32 Heartbeat_type;
-
-#define CISS_PARSCSIU2         0x0001
-#define CISS_PARCSCIU3         0x0002
-#define CISS_FIBRE1G   0x0100
-#define CISS_FIBRE2G   0x0200
-typedef __u32 BusTypes_type;
-
-typedef char FirmwareVer_type[4];
-typedef __u32 DriverVer_type;
-
-#define MAX_KMALLOC_SIZE 128000
-
-typedef struct _IOCTL_Command_struct {
-  LUNAddr_struct          LUN_info;
-  RequestBlock_struct      Request;
-  ErrorInfo_struct        error_info; 
-  WORD                    buf_size;  /* size in bytes of the buf */
-  BYTE                    __user *buf;
-} IOCTL_Command_struct;
-
-typedef struct _BIG_IOCTL_Command_struct {
-  LUNAddr_struct          LUN_info;
-  RequestBlock_struct      Request;
-  ErrorInfo_struct        error_info;
-  DWORD                           malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
-  DWORD                           buf_size;    /* size in bytes of the buf */
-                                       /* < malloc_size * MAXSGENTRIES */
-  BYTE                    __user *buf;
-} BIG_IOCTL_Command_struct;
-
-typedef struct _LogvolInfo_struct{
-       __u32   LunID;
-       int     num_opens;  /* number of opens on the logical volume */
-       int     num_parts;  /* number of partitions configured on logvol */
-} LogvolInfo_struct;
-
-#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
-
-#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
-#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
-
-#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
-#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
-
-#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
-#define CCISS_GETBUSTYPES  _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
-#define CCISS_GETFIRMVER   _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
-#define CCISS_GETDRIVVER   _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
-#define CCISS_REVALIDVOLS  _IO(CCISS_IOC_MAGIC, 10)
-#define CCISS_PASSTHRU    _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
-#define CCISS_DEREGDISK           _IO(CCISS_IOC_MAGIC, 12)
-
-/* no longer used... use REGNEWD instead */ 
-#define CCISS_REGNEWDISK  _IOW(CCISS_IOC_MAGIC, 13, int)
-
-#define CCISS_REGNEWD     _IO(CCISS_IOC_MAGIC, 14)
-#define CCISS_RESCANDISK   _IO(CCISS_IOC_MAGIC, 16)
-#define CCISS_GETLUNINFO   _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
-#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 
 /* 32 bit compatible ioctl structs */
@@ -111,5 +28,4 @@ typedef struct _BIG_IOCTL32_Command_struct {
 #define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct)
 
 #endif /* CONFIG_COMPAT */
-#endif /* __KERNEL__ */
 #endif  
index dfd7f187c351440d2ffa81050e46ed2602877f73..8609d577bb66df1a50c92fc6ef2873f30b6f3e30 100644 (file)
  *               1997, 1998   Erik Andersen, andersee@debian.org
  *               1998-2002    Jens Axboe, axboe@suse.de
  */
 #ifndef        _LINUX_CDROM_H
 #define        _LINUX_CDROM_H
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-/*******************************************************
- * As of Linux 2.1.x, all Linux CD-ROM application programs will use this 
- * (and only this) include file.  It is my hope to provide Linux with
- * a uniform interface between software accessing CD-ROMs and the various 
- * device drivers that actually talk to the drives.  There may still be
- * 23 different kinds of strange CD-ROM drives, but at least there will 
- * now be one, and only one, Linux CD-ROM interface.
- *
- * Additionally, as of Linux 2.1.x, all Linux application programs 
- * should use the O_NONBLOCK option when opening a CD-ROM device 
- * for subsequent ioctl commands.  This allows for neat system errors 
- * like "No medium found" or "Wrong medium type" upon attempting to 
- * mount or play an empty slot, mount an audio disc, or play a data disc.
- * Generally, changing an application program to support O_NONBLOCK
- * is as easy as the following:
- *       -    drive = open("/dev/cdrom", O_RDONLY);
- *       +    drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
- * It is worth the small change.
- *
- *  Patches for many common CD programs (provided by David A. van Leeuwen)
- *  can be found at:  ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
- * 
- *******************************************************/
-
-/* When a driver supports a certain function, but the cdrom drive we are 
- * using doesn't, we will return the error EDRIVE_CANT_DO_THIS.  We will 
- * borrow the "Operation not supported" error from the network folks to 
- * accomplish this.  Maybe someday we will get a more targeted error code, 
- * but this will do for now... */
-#define EDRIVE_CANT_DO_THIS  EOPNOTSUPP
-
-/*******************************************************
- * The CD-ROM IOCTL commands  -- these should be supported by 
- * all the various cdrom drivers.  For the CD-ROM ioctls, we 
- * will commandeer byte 0x53, or 'S'.
- *******************************************************/
-#define CDROMPAUSE             0x5301 /* Pause Audio Operation */ 
-#define CDROMRESUME            0x5302 /* Resume paused Audio Operation */
-#define CDROMPLAYMSF           0x5303 /* Play Audio MSF (struct cdrom_msf) */
-#define CDROMPLAYTRKIND                0x5304 /* Play Audio Track/index 
-                                           (struct cdrom_ti) */
-#define CDROMREADTOCHDR                0x5305 /* Read TOC header 
-                                           (struct cdrom_tochdr) */
-#define CDROMREADTOCENTRY      0x5306 /* Read TOC entry 
-                                           (struct cdrom_tocentry) */
-#define CDROMSTOP              0x5307 /* Stop the cdrom drive */
-#define CDROMSTART             0x5308 /* Start the cdrom drive */
-#define CDROMEJECT             0x5309 /* Ejects the cdrom media */
-#define CDROMVOLCTRL           0x530a /* Control output volume 
-                                           (struct cdrom_volctrl) */
-#define CDROMSUBCHNL           0x530b /* Read subchannel data 
-                                           (struct cdrom_subchnl) */
-#define CDROMREADMODE2         0x530c /* Read CDROM mode 2 data (2336 Bytes) 
-                                           (struct cdrom_read) */
-#define CDROMREADMODE1         0x530d /* Read CDROM mode 1 data (2048 Bytes)
-                                           (struct cdrom_read) */
-#define CDROMREADAUDIO         0x530e /* (struct cdrom_read_audio) */
-#define CDROMEJECT_SW          0x530f /* enable(1)/disable(0) auto-ejecting */
-#define CDROMMULTISESSION      0x5310 /* Obtain the start-of-last-session 
-                                           address of multi session disks 
-                                           (struct cdrom_multisession) */
-#define CDROM_GET_MCN          0x5311 /* Obtain the "Universal Product Code" 
-                                           if available (struct cdrom_mcn) */
-#define CDROM_GET_UPC          CDROM_GET_MCN  /* This one is deprecated, 
-                                          but here anyway for compatibility */
-#define CDROMRESET             0x5312 /* hard-reset the drive */
-#define CDROMVOLREAD           0x5313 /* Get the drive's volume setting 
-                                          (struct cdrom_volctrl) */
-#define CDROMREADRAW           0x5314  /* read data in raw mode (2352 Bytes)
-                                           (struct cdrom_read) */
-/* 
- * These ioctls are used only used in aztcd.c and optcd.c
- */
-#define CDROMREADCOOKED                0x5315  /* read data in cooked mode */
-#define CDROMSEEK              0x5316  /* seek msf address */
-  
-/*
- * This ioctl is only used by the scsi-cd driver.  
-   It is for playing audio in logical block addressing mode.
- */
-#define CDROMPLAYBLK           0x5317  /* (struct cdrom_blk) */
-
-/* 
- * These ioctls are only used in optcd.c
- */
-#define CDROMREADALL           0x5318  /* read all 2646 bytes */
-
-/* 
- * These ioctls are (now) only in ide-cd.c for controlling 
- * drive spindown time.  They should be implemented in the
- * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
- * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
- *  -Erik
- */
-#define CDROMGETSPINDOWN        0x531d
-#define CDROMSETSPINDOWN        0x531e
-
-/* 
- * These ioctls are implemented through the uniform CD-ROM driver
- * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
- * drivers are eventually ported to the uniform CD-ROM driver interface.
- */
-#define CDROMCLOSETRAY         0x5319  /* pendant of CDROMEJECT */
-#define CDROM_SET_OPTIONS      0x5320  /* Set behavior options */
-#define CDROM_CLEAR_OPTIONS    0x5321  /* Clear behavior options */
-#define CDROM_SELECT_SPEED     0x5322  /* Set the CD-ROM speed */
-#define CDROM_SELECT_DISC      0x5323  /* Select disc (for juke-boxes) */
-#define CDROM_MEDIA_CHANGED    0x5325  /* Check is media changed  */
-#define CDROM_DRIVE_STATUS     0x5326  /* Get tray position, etc. */
-#define CDROM_DISC_STATUS      0x5327  /* Get disc type, etc. */
-#define CDROM_CHANGER_NSLOTS    0x5328  /* Get number of slots */
-#define CDROM_LOCKDOOR         0x5329  /* lock or unlock door */
-#define CDROM_DEBUG            0x5330  /* Turn debug messages on/off */
-#define CDROM_GET_CAPABILITY   0x5331  /* get capabilities */
-
-/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
- * Future CDROM ioctls should be kept below 0x537F
- */
-
-/* This ioctl is only used by sbpcd at the moment */
-#define CDROMAUDIOBUFSIZ        0x5382 /* set the audio buffer size */
-                                       /* conflict with SCSI_IOCTL_GET_IDLUN */
-
-/* DVD-ROM Specific ioctls */
-#define DVD_READ_STRUCT                0x5390  /* Read structure */
-#define DVD_WRITE_STRUCT       0x5391  /* Write structure */
-#define DVD_AUTH               0x5392  /* Authentication */
-
-#define CDROM_SEND_PACKET      0x5393  /* send a packet to the drive */
-#define CDROM_NEXT_WRITABLE    0x5394  /* get next writable block */
-#define CDROM_LAST_WRITTEN     0x5395  /* get last block written on disc */
-
-/*******************************************************
- * CDROM IOCTL structures
- *******************************************************/
-
-/* Address in MSF format */
-struct cdrom_msf0              
-{
-       __u8    minute;
-       __u8    second;
-       __u8    frame;
-};
-
-/* Address in either MSF or logical format */
-union cdrom_addr               
-{
-       struct cdrom_msf0       msf;
-       int                     lba;
-};
-
-/* This struct is used by the CDROMPLAYMSF ioctl */ 
-struct cdrom_msf 
-{
-       __u8    cdmsf_min0;     /* start minute */
-       __u8    cdmsf_sec0;     /* start second */
-       __u8    cdmsf_frame0;   /* start frame */
-       __u8    cdmsf_min1;     /* end minute */
-       __u8    cdmsf_sec1;     /* end second */
-       __u8    cdmsf_frame1;   /* end frame */
-};
-
-/* This struct is used by the CDROMPLAYTRKIND ioctl */
-struct cdrom_ti 
-{
-       __u8    cdti_trk0;      /* start track */
-       __u8    cdti_ind0;      /* start index */
-       __u8    cdti_trk1;      /* end track */
-       __u8    cdti_ind1;      /* end index */
-};
-
-/* This struct is used by the CDROMREADTOCHDR ioctl */
-struct cdrom_tochdr    
-{
-       __u8    cdth_trk0;      /* start track */
-       __u8    cdth_trk1;      /* end track */
-};
-
-/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
-struct cdrom_volctrl
-{
-       __u8    channel0;
-       __u8    channel1;
-       __u8    channel2;
-       __u8    channel3;
-};
-
-/* This struct is used by the CDROMSUBCHNL ioctl */
-struct cdrom_subchnl 
-{
-       __u8    cdsc_format;
-       __u8    cdsc_audiostatus;
-       __u8    cdsc_adr:       4;
-       __u8    cdsc_ctrl:      4;
-       __u8    cdsc_trk;
-       __u8    cdsc_ind;
-       union cdrom_addr cdsc_absaddr;
-       union cdrom_addr cdsc_reladdr;
-};
-
-
-/* This struct is used by the CDROMREADTOCENTRY ioctl */
-struct cdrom_tocentry 
-{
-       __u8    cdte_track;
-       __u8    cdte_adr        :4;
-       __u8    cdte_ctrl       :4;
-       __u8    cdte_format;
-       union cdrom_addr cdte_addr;
-       __u8    cdte_datamode;
-};
-
-/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
-struct cdrom_read      
-{
-       int     cdread_lba;
-       char    *cdread_bufaddr;
-       int     cdread_buflen;
-};
-
-/* This struct is used by the CDROMREADAUDIO ioctl */
-struct cdrom_read_audio
-{
-       union cdrom_addr addr; /* frame address */
-       __u8 addr_format;      /* CDROM_LBA or CDROM_MSF */
-       int nframes;           /* number of 2352-byte-frames to read at once */
-       __u8 __user *buf;      /* frame buffer (size: nframes*2352 bytes) */
-};
-
-/* This struct is used with the CDROMMULTISESSION ioctl */
-struct cdrom_multisession
-{
-       union cdrom_addr addr; /* frame address: start-of-last-session 
-                                  (not the new "frame 16"!).  Only valid
-                                  if the "xa_flag" is true. */
-       __u8 xa_flag;        /* 1: "is XA disk" */
-       __u8 addr_format;    /* CDROM_LBA or CDROM_MSF */
-};
-
-/* This struct is used with the CDROM_GET_MCN ioctl.  
- * Very few audio discs actually have Universal Product Code information, 
- * which should just be the Medium Catalog Number on the box.  Also note 
- * that the way the codeis written on CD is _not_ uniform across all discs!
- */  
-struct cdrom_mcn 
-{
-  __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
-};
-
-/* This is used by the CDROMPLAYBLK ioctl */
-struct cdrom_blk 
-{
-       unsigned from;
-       unsigned short len;
-};
-
-#define CDROM_PACKET_SIZE      12
-
-#define CGC_DATA_UNKNOWN       0
-#define CGC_DATA_WRITE         1
-#define CGC_DATA_READ          2
-#define CGC_DATA_NONE          3
-
-/* for CDROM_PACKET_COMMAND ioctl */
-struct cdrom_generic_command
-{
-       unsigned char           cmd[CDROM_PACKET_SIZE];
-       unsigned char           __user *buffer;
-       unsigned int            buflen;
-       int                     stat;
-       struct request_sense    __user *sense;
-       unsigned char           data_direction;
-       int                     quiet;
-       int                     timeout;
-       void                    __user *reserved[1];    /* unused, actually */
-};
-
-/*
- * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 
- * 2340, or 2352 bytes long.  
-
-*         Sector types of the standard CD-ROM data formats:
- *
- * format   sector type               user data size (bytes)
- * -----------------------------------------------------------------------------
- *   1     (Red Book)    CD-DA          2352    (CD_FRAMESIZE_RAW)
- *   2     (Yellow Book) Mode1 Form1    2048    (CD_FRAMESIZE)
- *   3     (Yellow Book) Mode1 Form2    2336    (CD_FRAMESIZE_RAW0)
- *   4     (Green Book)  Mode2 Form1    2048    (CD_FRAMESIZE)
- *   5     (Green Book)  Mode2 Form2    2328    (2324+4 spare bytes)
- *
- *
- *       The layout of the standard CD-ROM data formats:
- * -----------------------------------------------------------------------------
- * - audio (red):                  | audio_sample_bytes |
- *                                 |        2352        |
- *
- * - data (yellow, mode1):         | sync - head - data - EDC - zero - ECC |
- *                                 |  12  -   4  - 2048 -  4  -   8  - 276 |
- *
- * - data (yellow, mode2):         | sync - head - data |
- *                                 |  12  -   4  - 2336 |
- *
- * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
- *                                 |  12  -   4  -  8  - 2048 -  4  - 276 |
- *
- * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
- *                                 |  12  -   4  -  8  - 2324 -  4    |
- *
- */
-
-/* Some generally useful CD-ROM information -- mostly based on the above */
-#define CD_MINS              74 /* max. minutes per CD, not really a limit */
-#define CD_SECS              60 /* seconds per minute */
-#define CD_FRAMES            75 /* frames per second */
-#define CD_SYNC_SIZE         12 /* 12 sync bytes per raw data frame */
-#define CD_MSF_OFFSET       150 /* MSF numbering offset of first frame */
-#define CD_CHUNK_SIZE        24 /* lowest-level "data bytes piece" */
-#define CD_NUM_OF_CHUNKS     98 /* chunks per frame */
-#define CD_FRAMESIZE_SUB     96 /* subchannel data "frame" size */
-#define CD_HEAD_SIZE          4 /* header (address) bytes per raw data frame */
-#define CD_SUBHEAD_SIZE       8 /* subheader bytes per raw XA data frame */
-#define CD_EDC_SIZE           4 /* bytes EDC per most raw data frame types */
-#define CD_ZERO_SIZE          8 /* bytes zero per yellow book mode 1 frame */
-#define CD_ECC_SIZE         276 /* bytes ECC per most raw data frame types */
-#define CD_FRAMESIZE       2048 /* bytes per frame, "cooked" mode */
-#define CD_FRAMESIZE_RAW   2352 /* bytes per frame, "raw" mode */
-#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */ 
-/* most drives don't deliver everything: */
-#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
-#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
-
-#define CD_XA_HEAD        (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
-#define CD_XA_TAIL        (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
-#define CD_XA_SYNC_HEAD   (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
-
-/* CD-ROM address types (cdrom_tocentry.cdte_format) */
-#define        CDROM_LBA 0x01 /* "logical block": first frame is #0 */
-#define        CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
-
-/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
-#define        CDROM_DATA_TRACK        0x04
-
-/* The leadout track is always 0xAA, regardless of # of tracks on disc */
-#define        CDROM_LEADOUT           0xAA
-
-/* audio states (from SCSI-2, but seen with other drives, too) */
-#define        CDROM_AUDIO_INVALID     0x00    /* audio status not supported */
-#define        CDROM_AUDIO_PLAY        0x11    /* audio play operation in progress */
-#define        CDROM_AUDIO_PAUSED      0x12    /* audio play operation paused */
-#define        CDROM_AUDIO_COMPLETED   0x13    /* audio play successfully completed */
-#define        CDROM_AUDIO_ERROR       0x14    /* audio play stopped due to error */
-#define        CDROM_AUDIO_NO_STATUS   0x15    /* no current audio status to return */
-
-/* capability flags used with the uniform CD-ROM driver */ 
-#define CDC_CLOSE_TRAY         0x1     /* caddy systems _can't_ close */
-#define CDC_OPEN_TRAY          0x2     /* but _can_ eject.  */
-#define CDC_LOCK               0x4     /* disable manual eject */
-#define CDC_SELECT_SPEED       0x8     /* programmable speed */
-#define CDC_SELECT_DISC                0x10    /* select disc from juke-box */
-#define CDC_MULTI_SESSION      0x20    /* read sessions>1 */
-#define CDC_MCN                        0x40    /* Medium Catalog Number */
-#define CDC_MEDIA_CHANGED      0x80    /* media changed */
-#define CDC_PLAY_AUDIO         0x100   /* audio functions */
-#define CDC_RESET               0x200   /* hard reset device */
-#define CDC_DRIVE_STATUS        0x800   /* driver implements drive status */
-#define CDC_GENERIC_PACKET     0x1000  /* driver implements generic packets */
-#define CDC_CD_R               0x2000  /* drive is a CD-R */
-#define CDC_CD_RW              0x4000  /* drive is a CD-RW */
-#define CDC_DVD                        0x8000  /* drive is a DVD */
-#define CDC_DVD_R              0x10000 /* drive can write DVD-R */
-#define CDC_DVD_RAM            0x20000 /* drive can write DVD-RAM */
-#define CDC_MO_DRIVE           0x40000 /* drive is an MO device */
-#define CDC_MRW                        0x80000 /* drive can read MRW */
-#define CDC_MRW_W              0x100000 /* drive can write MRW */
-#define CDC_RAM                        0x200000 /* ok to open for WRITE */
-
-/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
-#define CDS_NO_INFO            0       /* if not implemented */
-#define CDS_NO_DISC            1
-#define CDS_TRAY_OPEN          2
-#define CDS_DRIVE_NOT_READY    3
-#define CDS_DISC_OK            4
-
-/* return values for the CDROM_DISC_STATUS ioctl */
-/* can also return CDS_NO_[INFO|DISC], from above */
-#define CDS_AUDIO              100
-#define CDS_DATA_1             101
-#define CDS_DATA_2             102
-#define CDS_XA_2_1             103
-#define CDS_XA_2_2             104
-#define CDS_MIXED              105
-
-/* User-configurable behavior options for the uniform CD-ROM driver */
-#define CDO_AUTO_CLOSE         0x1     /* close tray on first open() */
-#define CDO_AUTO_EJECT         0x2     /* open tray on last release() */
-#define CDO_USE_FFLAGS         0x4     /* use O_NONBLOCK information on open */
-#define CDO_LOCK               0x8     /* lock tray on open files */
-#define CDO_CHECK_TYPE         0x10    /* check type on open for data */
-
-/* Special codes used when specifying changer slots. */
-#define CDSL_NONE              (INT_MAX-1)
-#define CDSL_CURRENT           INT_MAX
-
-/* For partition based multisession access. IDE can handle 64 partitions
- * per drive - SCSI CD-ROM's use minors to differentiate between the
- * various drives, so we can't do multisessions the same way there.
- * Use the -o session=x option to mount on them.
- */
-#define CD_PART_MAX            64
-#define CD_PART_MASK           (CD_PART_MAX - 1)
-
-/*********************************************************************
- * Generic Packet commands, MMC commands, and such
- *********************************************************************/
-
- /* The generic packet command opcodes for CD/DVD Logical Units,
- * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
-#define GPCMD_BLANK                        0xa1
-#define GPCMD_CLOSE_TRACK                  0x5b
-#define GPCMD_FLUSH_CACHE                  0x35
-#define GPCMD_FORMAT_UNIT                  0x04
-#define GPCMD_GET_CONFIGURATION                    0x46
-#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
-#define GPCMD_GET_PERFORMANCE              0xac
-#define GPCMD_INQUIRY                      0x12
-#define GPCMD_LOAD_UNLOAD                  0xa6
-#define GPCMD_MECHANISM_STATUS             0xbd
-#define GPCMD_MODE_SELECT_10               0x55
-#define GPCMD_MODE_SENSE_10                0x5a
-#define GPCMD_PAUSE_RESUME                 0x4b
-#define GPCMD_PLAY_AUDIO_10                0x45
-#define GPCMD_PLAY_AUDIO_MSF               0x47
-#define GPCMD_PLAY_AUDIO_TI                0x48
-#define GPCMD_PLAY_CD                      0xbc
-#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL  0x1e
-#define GPCMD_READ_10                      0x28
-#define GPCMD_READ_12                      0xa8
-#define GPCMD_READ_BUFFER                  0x3c
-#define GPCMD_READ_BUFFER_CAPACITY         0x5c
-#define GPCMD_READ_CDVD_CAPACITY           0x25
-#define GPCMD_READ_CD                      0xbe
-#define GPCMD_READ_CD_MSF                  0xb9
-#define GPCMD_READ_DISC_INFO               0x51
-#define GPCMD_READ_DVD_STRUCTURE           0xad
-#define GPCMD_READ_FORMAT_CAPACITIES       0x23
-#define GPCMD_READ_HEADER                  0x44
-#define GPCMD_READ_TRACK_RZONE_INFO        0x52
-#define GPCMD_READ_SUBCHANNEL              0x42
-#define GPCMD_READ_TOC_PMA_ATIP                    0x43
-#define GPCMD_REPAIR_RZONE_TRACK           0x58
-#define GPCMD_REPORT_KEY                   0xa4
-#define GPCMD_REQUEST_SENSE                0x03
-#define GPCMD_RESERVE_RZONE_TRACK          0x53
-#define GPCMD_SEND_CUE_SHEET               0x5d
-#define GPCMD_SCAN                         0xba
-#define GPCMD_SEEK                         0x2b
-#define GPCMD_SEND_DVD_STRUCTURE           0xbf
-#define GPCMD_SEND_EVENT                   0xa2
-#define GPCMD_SEND_KEY                     0xa3
-#define GPCMD_SEND_OPC                     0x54
-#define GPCMD_SET_READ_AHEAD               0xa7
-#define GPCMD_SET_STREAMING                0xb6
-#define GPCMD_START_STOP_UNIT              0x1b
-#define GPCMD_STOP_PLAY_SCAN               0x4e
-#define GPCMD_TEST_UNIT_READY              0x00
-#define GPCMD_VERIFY_10                            0x2f
-#define GPCMD_WRITE_10                     0x2a
-#define GPCMD_WRITE_12                     0xaa
-#define GPCMD_WRITE_AND_VERIFY_10          0x2e
-#define GPCMD_WRITE_BUFFER                 0x3b
-/* This is listed as optional in ATAPI 2.6, but is (curiously) 
- * missing from Mt. Fuji, Table 57.  It _is_ mentioned in Mt. Fuji
- * Table 377 as an MMC command for SCSi devices though...  Most ATAPI
- * drives support it. */
-#define GPCMD_SET_SPEED                            0xbb
-/* This seems to be a SCSI specific CD-ROM opcode 
- * to play data at track/index */
-#define GPCMD_PLAYAUDIO_TI                 0x48
-/*
- * From MS Media Status Notification Support Specification. For
- * older drives only.
- */
-#define GPCMD_GET_MEDIA_STATUS             0xda
-
-/* Mode page codes for mode sense/set */
-#define GPMODE_VENDOR_PAGE             0x00
-#define GPMODE_R_W_ERROR_PAGE          0x01
-#define GPMODE_WRITE_PARMS_PAGE                0x05
-#define GPMODE_WCACHING_PAGE           0x08
-#define GPMODE_AUDIO_CTL_PAGE          0x0e
-#define GPMODE_POWER_PAGE              0x1a
-#define GPMODE_FAULT_FAIL_PAGE         0x1c
-#define GPMODE_TO_PROTECT_PAGE         0x1d
-#define GPMODE_CAPABILITIES_PAGE       0x2a
-#define GPMODE_ALL_PAGES               0x3f
-/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
- * of MODE_SENSE_POWER_PAGE */
-#define GPMODE_CDROM_PAGE              0x0d
-
-
-
-/* DVD struct types */
-#define DVD_STRUCT_PHYSICAL    0x00
-#define DVD_STRUCT_COPYRIGHT   0x01
-#define DVD_STRUCT_DISCKEY     0x02
-#define DVD_STRUCT_BCA         0x03
-#define DVD_STRUCT_MANUFACT    0x04
-
-struct dvd_layer {
-       __u8 book_version       : 4;
-       __u8 book_type          : 4;
-       __u8 min_rate           : 4;
-       __u8 disc_size          : 4;
-       __u8 layer_type         : 4;
-       __u8 track_path         : 1;
-       __u8 nlayers            : 2;
-       __u8 track_density      : 4;
-       __u8 linear_density     : 4;
-       __u8 bca                : 1;
-       __u32 start_sector;
-       __u32 end_sector;
-       __u32 end_sector_l0;
-};
-
-#define DVD_LAYERS     4
-
-struct dvd_physical {
-       __u8 type;
-       __u8 layer_num;
-       struct dvd_layer layer[DVD_LAYERS];
-};
-
-struct dvd_copyright {
-       __u8 type;
-
-       __u8 layer_num;
-       __u8 cpst;
-       __u8 rmi;
-};
-
-struct dvd_disckey {
-       __u8 type;
-
-       unsigned agid           : 2;
-       __u8 value[2048];
-};
-
-struct dvd_bca {
-       __u8 type;
-
-       int len;
-       __u8 value[188];
-};
-
-struct dvd_manufact {
-       __u8 type;
-
-       __u8 layer_num;
-       int len;
-       __u8 value[2048];
-};
-
-typedef union {
-       __u8 type;
-
-       struct dvd_physical     physical;
-       struct dvd_copyright    copyright;
-       struct dvd_disckey      disckey;
-       struct dvd_bca          bca;
-       struct dvd_manufact     manufact;
-} dvd_struct;
-
-/*
- * DVD authentication ioctl
- */
-
-/* Authentication states */
-#define DVD_LU_SEND_AGID       0
-#define DVD_HOST_SEND_CHALLENGE        1
-#define DVD_LU_SEND_KEY1       2
-#define DVD_LU_SEND_CHALLENGE  3
-#define DVD_HOST_SEND_KEY2     4
-
-/* Termination states */
-#define DVD_AUTH_ESTABLISHED   5
-#define DVD_AUTH_FAILURE       6
-
-/* Other functions */
-#define DVD_LU_SEND_TITLE_KEY  7
-#define DVD_LU_SEND_ASF                8
-#define DVD_INVALIDATE_AGID    9
-#define DVD_LU_SEND_RPC_STATE  10
-#define DVD_HOST_SEND_RPC_STATE        11
-
-/* State data */
-typedef __u8 dvd_key[5];               /* 40-bit value, MSB is first elem. */
-typedef __u8 dvd_challenge[10];        /* 80-bit value, MSB is first elem. */
-
-struct dvd_lu_send_agid {
-       __u8 type;
-       unsigned agid           : 2;
-};
-
-struct dvd_host_send_challenge {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_challenge chal;
-};
-
-struct dvd_send_key {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_key key;
-};
-
-struct dvd_lu_send_challenge {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_challenge chal;
-};
-
-#define DVD_CPM_NO_COPYRIGHT   0
-#define DVD_CPM_COPYRIGHTED    1
-
-#define DVD_CP_SEC_NONE                0
-#define DVD_CP_SEC_EXIST       1
-
-#define DVD_CGMS_UNRESTRICTED  0
-#define DVD_CGMS_SINGLE                2
-#define DVD_CGMS_RESTRICTED    3
-
-struct dvd_lu_send_title_key {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_key title_key;
-       int lba;
-       unsigned cpm            : 1;
-       unsigned cp_sec         : 1;
-       unsigned cgms           : 2;
-};
-
-struct dvd_lu_send_asf {
-       __u8 type;
-       unsigned agid           : 2;
-
-       unsigned asf            : 1;
-};
-
-struct dvd_host_send_rpcstate {
-       __u8 type;
-       __u8 pdrc;
-};
-
-struct dvd_lu_send_rpcstate {
-       __u8 type               : 2;
-       __u8 vra                : 3;
-       __u8 ucca               : 3;
-       __u8 region_mask;
-       __u8 rpc_scheme;
-};
-
-typedef union {
-       __u8 type;
-
-       struct dvd_lu_send_agid         lsa;
-       struct dvd_host_send_challenge  hsc;
-       struct dvd_send_key             lsk;
-       struct dvd_lu_send_challenge    lsc;
-       struct dvd_send_key             hsk;
-       struct dvd_lu_send_title_key    lstk;
-       struct dvd_lu_send_asf          lsasf;
-       struct dvd_host_send_rpcstate   hrpcs;
-       struct dvd_lu_send_rpcstate     lrpcs;
-} dvd_authinfo;
-
-struct request_sense {
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 valid              : 1;
-       __u8 error_code         : 7;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 error_code         : 7;
-       __u8 valid              : 1;
-#endif
-       __u8 segment_number;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved1          : 2;
-       __u8 ili                : 1;
-       __u8 reserved2          : 1;
-       __u8 sense_key          : 4;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 sense_key          : 4;
-       __u8 reserved2          : 1;
-       __u8 ili                : 1;
-       __u8 reserved1          : 2;
-#endif
-       __u8 information[4];
-       __u8 add_sense_len;
-       __u8 command_info[4];
-       __u8 asc;
-       __u8 ascq;
-       __u8 fruc;
-       __u8 sks[3];
-       __u8 asb[46];
-};
-
-/*
- * feature profile
- */
-#define CDF_RWRT       0x0020  /* "Random Writable" */
-#define CDF_HWDM       0x0024  /* "Hardware Defect Management" */
-#define CDF_MRW        0x0028
-
-/*
- * media status bits
- */
-#define CDM_MRW_NOTMRW                 0
-#define CDM_MRW_BGFORMAT_INACTIVE      1
-#define CDM_MRW_BGFORMAT_ACTIVE                2
-#define CDM_MRW_BGFORMAT_COMPLETE      3
-
-/*
- * mrw address spaces
- */
-#define MRW_LBA_DMA                    0
-#define MRW_LBA_GAA                    1
-
-/*
- * mrw mode pages (first is deprecated) -- probed at init time and
- * cdi->mrw_mode_page is set
- */
-#define MRW_MODE_PC_PRE1               0x2c
-#define MRW_MODE_PC                    0x03
-
-struct mrw_feature_desc {
-       __be16 feature_code;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved1          : 2;
-       __u8 feature_version    : 4;
-       __u8 persistent         : 1;
-       __u8 curr               : 1;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 curr               : 1;
-       __u8 persistent         : 1;
-       __u8 feature_version    : 4;
-       __u8 reserved1          : 2;
-#endif
-       __u8 add_len;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved2          : 7;
-       __u8 write              : 1;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 write              : 1;
-       __u8 reserved2          : 7;
-#endif
-       __u8 reserved3;
-       __u8 reserved4;
-       __u8 reserved5;
-};
-
-/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
-struct rwrt_feature_desc {
-       __be16 feature_code;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved1          : 2;
-       __u8 feature_version    : 4;
-       __u8 persistent         : 1;
-       __u8 curr               : 1;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 curr               : 1;
-       __u8 persistent         : 1;
-       __u8 feature_version    : 4;
-       __u8 reserved1          : 2;
-#endif
-       __u8 add_len;
-       __u32 last_lba;
-       __u32 block_size;
-       __u16 blocking;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved2          : 7;
-       __u8 page_present       : 1;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 page_present       : 1;
-       __u8 reserved2          : 7;
-#endif
-       __u8 reserved3;
-};
-
-typedef struct {
-       __be16 disc_information_length;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved1                  : 3;
-        __u8 erasable                  : 1;
-        __u8 border_status             : 2;
-        __u8 disc_status               : 2;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-        __u8 disc_status               : 2;
-        __u8 border_status             : 2;
-        __u8 erasable                  : 1;
-       __u8 reserved1                  : 3;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       __u8 n_first_track;
-       __u8 n_sessions_lsb;
-       __u8 first_track_lsb;
-       __u8 last_track_lsb;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 did_v                      : 1;
-        __u8 dbc_v                     : 1;
-        __u8 uru                       : 1;
-        __u8 reserved2                 : 2;
-       __u8 dbit                       : 1;
-       __u8 mrw_status                 : 2;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 mrw_status                 : 2;
-       __u8 dbit                       : 1;
-        __u8 reserved2                 : 2;
-        __u8 uru                       : 1;
-        __u8 dbc_v                     : 1;
-       __u8 did_v                      : 1;
-#endif
-       __u8 disc_type;
-       __u8 n_sessions_msb;
-       __u8 first_track_msb;
-       __u8 last_track_msb;
-       __u32 disc_id;
-       __u32 lead_in;
-       __u32 lead_out;
-       __u8 disc_bar_code[8];
-       __u8 reserved3;
-       __u8 n_opc;
-} disc_information;
-
-typedef struct {
-       __be16 track_information_length;
-       __u8 track_lsb;
-       __u8 session_lsb;
-       __u8 reserved1;
-#if defined(__BIG_ENDIAN_BITFIELD)
-       __u8 reserved2                  : 2;
-        __u8 damage                    : 1;
-        __u8 copy                      : 1;
-        __u8 track_mode                        : 4;
-       __u8 rt                         : 1;
-       __u8 blank                      : 1;
-       __u8 packet                     : 1;
-       __u8 fp                         : 1;
-       __u8 data_mode                  : 4;
-       __u8 reserved3                  : 6;
-       __u8 lra_v                      : 1;
-       __u8 nwa_v                      : 1;
-#elif defined(__LITTLE_ENDIAN_BITFIELD)
-        __u8 track_mode                        : 4;
-        __u8 copy                      : 1;
-        __u8 damage                    : 1;
-       __u8 reserved2                  : 2;
-       __u8 data_mode                  : 4;
-       __u8 fp                         : 1;
-       __u8 packet                     : 1;
-       __u8 blank                      : 1;
-       __u8 rt                         : 1;
-       __u8 nwa_v                      : 1;
-       __u8 lra_v                      : 1;
-       __u8 reserved3                  : 6;
-#endif
-       __be32 track_start;
-       __be32 next_writable;
-       __be32 free_blocks;
-       __be32 fixed_packet_size;
-       __be32 track_size;
-       __be32 last_rec_address;
-} track_information;
-
-struct feature_header {
-       __u32 data_len;
-       __u8 reserved1;
-       __u8 reserved2;
-       __u16 curr_profile;
-};
-
-struct mode_page_header {
-       __be16 mode_data_length;
-       __u8 medium_type;
-       __u8 reserved1;
-       __u8 reserved2;
-       __u8 reserved3;
-       __be16 desc_length;
-};
-
-#ifdef __KERNEL__
 #include <linux/fs.h>          /* not really needed, later.. */
 #include <linux/list.h>
+#include <uapi/linux/cdrom.h>
 
 struct packet_command
 {
@@ -1209,6 +311,4 @@ static inline int msf_to_lba(u8 m, u8 s, u8 f)
 {
        return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
 }
-#endif  /* End of kernel only stuff */ 
-
 #endif  /* _LINUX_CDROM_H */
index 3c4aac406175d6d21438643be35dcc78a2a23e49..88bee3a3309045970ff2a561a519b256f6261141 100644 (file)
@@ -1,68 +1,10 @@
 #ifndef        _CM4000_H_
 #define        _CM4000_H_
 
-#include <linux/types.h>
+#include <uapi/linux/cm4000_cs.h>
 
-#define        MAX_ATR                 33
-
-#define        CM4000_MAX_DEV          4
-
-/* those two structures are passed via ioctl() from/to userspace.  They are
- * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
- * not to break compilation of userspace apps. -HW */
-
-typedef struct atreq {
-       __s32 atr_len;
-       unsigned char atr[64];
-       __s32 power_act;
-       unsigned char bIFSD;
-       unsigned char bIFSC;
-} atreq_t;
-
-
-/* what is particularly stupid in the original driver is the arch-dependent
- * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
- * will lay out the structure members differently than the 64bit kernel.
- *
- * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
- * On 32bit this will make no difference.  With 64bit kernels, it will make
- * 32bit apps work, too.
- */
-
-typedef struct ptsreq {
-       __u32 protocol; /*T=0: 2^0, T=1:  2^1*/
-       unsigned char flags;
-       unsigned char pts1;
-       unsigned char pts2;
-       unsigned char pts3;
-} ptsreq_t;
-
-#define        CM_IOC_MAGIC            'c'
-#define        CM_IOC_MAXNR            255
-
-#define        CM_IOCGSTATUS           _IOR (CM_IOC_MAGIC, 0, unsigned char *)
-#define        CM_IOCGATR              _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
-#define        CM_IOCSPTS              _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
-#define        CM_IOCSRDR              _IO  (CM_IOC_MAGIC, 3)
-#define CM_IOCARDOFF            _IO  (CM_IOC_MAGIC, 4)
-
-#define CM_IOSDBGLVL            _IOW(CM_IOC_MAGIC, 250, int*)
-
-/* card and device states */
-#define        CM_CARD_INSERTED                0x01
-#define        CM_CARD_POWERED                 0x02
-#define        CM_ATR_PRESENT                  0x04
-#define        CM_ATR_VALID                    0x08
-#define        CM_STATE_VALID                  0x0f
-/* extra info only from CM4000 */
-#define        CM_NO_READER                    0x10
-#define        CM_BAD_CARD                     0x20
-
-
-#ifdef __KERNEL__
 
 #define        DEVICE_NAME             "cmm"
 #define        MODULE_NAME             "cm4000_cs"
 
-#endif /* __KERNEL__ */
 #endif /* _CM4000_H_ */
index d03612b196e1500fcd9432ccff2a75cf9befb5a0..2c1bc1ea04ee05471bb536ccdd8ed6a8cf2fbc3c 100644 (file)
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  */
-
 #ifndef CN_PROC_H
 #define CN_PROC_H
 
-#include <linux/types.h>
-
-/*
- * Userspace sends this enum to register with the kernel that it is listening
- * for events on the connector.
- */
-enum proc_cn_mcast_op {
-       PROC_CN_MCAST_LISTEN = 1,
-       PROC_CN_MCAST_IGNORE = 2
-};
-
-/*
- * From the user's point of view, the process
- * ID is the thread group ID and thread ID is the internal
- * kernel "pid". So, fields are assigned as follow:
- *
- *  In user space     -  In  kernel space
- *
- * parent process ID  =  parent->tgid
- * parent thread  ID  =  parent->pid
- * child  process ID  =  child->tgid
- * child  thread  ID  =  child->pid
- */
-
-struct proc_event {
-       enum what {
-               /* Use successive bits so the enums can be used to record
-                * sets of events as well
-                */
-               PROC_EVENT_NONE = 0x00000000,
-               PROC_EVENT_FORK = 0x00000001,
-               PROC_EVENT_EXEC = 0x00000002,
-               PROC_EVENT_UID  = 0x00000004,
-               PROC_EVENT_GID  = 0x00000040,
-               PROC_EVENT_SID  = 0x00000080,
-               PROC_EVENT_PTRACE = 0x00000100,
-               PROC_EVENT_COMM = 0x00000200,
-               /* "next" should be 0x00000400 */
-               /* "last" is the last process event: exit */
-               PROC_EVENT_EXIT = 0x80000000
-       } what;
-       __u32 cpu;
-       __u64 __attribute__((aligned(8))) timestamp_ns;
-               /* Number of nano seconds since system boot */
-       union { /* must be last field of proc_event struct */
-               struct {
-                       __u32 err;
-               } ack;
-
-               struct fork_proc_event {
-                       __kernel_pid_t parent_pid;
-                       __kernel_pid_t parent_tgid;
-                       __kernel_pid_t child_pid;
-                       __kernel_pid_t child_tgid;
-               } fork;
-
-               struct exec_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-               } exec;
-
-               struct id_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-                       union {
-                               __u32 ruid; /* task uid */
-                               __u32 rgid; /* task gid */
-                       } r;
-                       union {
-                               __u32 euid;
-                               __u32 egid;
-                       } e;
-               } id;
-
-               struct sid_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-               } sid;
-
-               struct ptrace_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-                       __kernel_pid_t tracer_pid;
-                       __kernel_pid_t tracer_tgid;
-               } ptrace;
-
-               struct comm_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-                       char           comm[16];
-               } comm;
-
-               struct exit_proc_event {
-                       __kernel_pid_t process_pid;
-                       __kernel_pid_t process_tgid;
-                       __u32 exit_code, exit_signal;
-               } exit;
-       } event_data;
-};
+#include <uapi/linux/cn_proc.h>
 
-#ifdef __KERNEL__
 #ifdef CONFIG_PROC_EVENTS
 void proc_fork_connector(struct task_struct *task);
 void proc_exec_connector(struct task_struct *task);
@@ -151,5 +51,4 @@ static inline void proc_ptrace_connector(struct task_struct *task,
 static inline void proc_exit_connector(struct task_struct *task)
 {}
 #endif /* CONFIG_PROC_EVENTS */
-#endif /* __KERNEL__ */
 #endif /* CN_PROC_H */
index 96c87693800ba1b0eaf46065f670b46fb4e3cbfc..cff544f81105ecf83dac7cc0e75ea8ee26954592 100644 (file)
@@ -55,690 +55,12 @@ Mellon the rights to redistribute these changes without encumbrance.
  * Linux modifications by 
  * Peter Braam, Aug 1996
  */
-
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-
-/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
-#if defined(__NetBSD__) || \
-  ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
-#include <sys/types.h>
-#endif 
-
-#ifndef CODA_MAXSYMLINKS
-#define CODA_MAXSYMLINKS 10
-#endif
-
-#if defined(DJGPP) || defined(__CYGWIN32__)
-#ifdef KERNEL
-typedef unsigned long u_long;
-typedef unsigned int u_int;
-typedef unsigned short u_short;
-typedef u_long ino_t;
-typedef u_long dev_t;
-typedef void * caddr_t;
-#ifdef DOS
-typedef unsigned __int64 u_quad_t;
-#else 
-typedef unsigned long long u_quad_t;
-#endif
-
-#define inline
-
-struct timespec {
-        long       ts_sec;
-        long       ts_nsec;
-};
-#else  /* DJGPP but not KERNEL */
-#include <sys/time.h>
-typedef unsigned long long u_quad_t;
-#endif /* !KERNEL */
-#endif /* !DJGPP */
-
-
 #if defined(__linux__)
-#include <linux/time.h>
-#define cdev_t u_quad_t
-#ifndef __KERNEL__
-#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
-#define _UQUAD_T_ 1
 typedef unsigned long long u_quad_t;
-#endif
-#else /*__KERNEL__ */
-typedef unsigned long long u_quad_t;
-#endif /* __KERNEL__ */
 #else
-#define cdev_t dev_t
-#endif
-
-#ifdef __CYGWIN32__
-struct timespec {
-        time_t  tv_sec;         /* seconds */
-        long    tv_nsec;        /* nanoseconds */
-};
-#endif
-
-#ifndef __BIT_TYPES_DEFINED__
-#define __BIT_TYPES_DEFINED__
-typedef signed char          int8_t;
-typedef unsigned char      u_int8_t;
-typedef short               int16_t;
-typedef unsigned short    u_int16_t;
-typedef int                 int32_t;
-typedef unsigned int      u_int32_t;
-#endif
-
-
-/*
- * Cfs constants
- */
-#define CODA_MAXNAMLEN   255
-#define CODA_MAXPATHLEN  1024
-#define CODA_MAXSYMLINK  10
-
-/* these are Coda's version of O_RDONLY etc combinations
- * to deal with VFS open modes
- */
-#define        C_O_READ        0x001
-#define        C_O_WRITE       0x002
-#define C_O_TRUNC       0x010
-#define C_O_EXCL       0x100
-#define C_O_CREAT      0x200
-
-/* these are to find mode bits in Venus */ 
-#define C_M_READ  00400
-#define C_M_WRITE 00200
-
-/* for access Venus will use */
-#define C_A_C_OK    8               /* Test for writing upon create.  */
-#define C_A_R_OK    4               /* Test for read permission.  */
-#define C_A_W_OK    2               /* Test for write permission.  */
-#define C_A_X_OK    1               /* Test for execute permission.  */
-#define C_A_F_OK    0               /* Test for existence.  */
-
-
-
-#ifndef _VENUS_DIRENT_T_
-#define _VENUS_DIRENT_T_ 1
-struct venus_dirent {
-        u_int32_t d_fileno;            /* file number of entry */
-        u_int16_t d_reclen;            /* length of this record */
-        u_int8_t  d_type;                      /* file type, see below */
-        u_int8_t  d_namlen;            /* length of string in d_name */
-        char     d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
-};
-#undef DIRSIZ
-#define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
-                         (((dp)->d_namlen+1 + 3) &~ 3))
-
-/*
- * File types
- */
-#define        CDT_UNKNOWN      0
-#define        CDT_FIFO         1
-#define        CDT_CHR          2
-#define        CDT_DIR          4
-#define        CDT_BLK          6
-#define        CDT_REG          8
-#define        CDT_LNK         10
-#define        CDT_SOCK        12
-#define        CDT_WHT         14
-
-/*
- * Convert between stat structure types and directory types.
- */
-#define        IFTOCDT(mode)   (((mode) & 0170000) >> 12)
-#define        CDTTOIF(dirtype)        ((dirtype) << 12)
-
 #endif
-
-#ifndef _VUID_T_
-#define _VUID_T_
-typedef u_int32_t vuid_t;
-typedef u_int32_t vgid_t;
-#endif /*_VUID_T_ */
-
-struct CodaFid {
-       u_int32_t opaque[4];
-};
-
-#define coda_f2i(fid)\
-       (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
-
-#ifndef _VENUS_VATTR_T_
-#define _VENUS_VATTR_T_
-/*
- * Vnode types.  VNON means no type.
- */
-enum coda_vtype        { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
-
-struct coda_vattr {
-       long            va_type;        /* vnode type (for create) */
-       u_short         va_mode;        /* files access mode and type */
-       short           va_nlink;       /* number of references to file */
-       vuid_t          va_uid;         /* owner user id */
-       vgid_t          va_gid;         /* owner group id */
-       long            va_fileid;      /* file id */
-       u_quad_t        va_size;        /* file size in bytes */
-       long            va_blocksize;   /* blocksize preferred for i/o */
-       struct timespec va_atime;       /* time of last access */
-       struct timespec va_mtime;       /* time of last modification */
-       struct timespec va_ctime;       /* time file changed */
-       u_long          va_gen;         /* generation number of file */
-       u_long          va_flags;       /* flags defined for file */
-       cdev_t          va_rdev;        /* device special file represents */
-       u_quad_t        va_bytes;       /* bytes of disk space held by file */
-       u_quad_t        va_filerev;     /* file modification number */
-};
-
+#include <uapi/linux/coda.h>
 #endif 
-
-/* structure used by CODA_STATFS for getting cache information from venus */
-struct coda_statfs {
-    int32_t f_blocks;
-    int32_t f_bfree;
-    int32_t f_bavail;
-    int32_t f_files;
-    int32_t f_ffree;
-};
-
-/*
- * Kernel <--> Venus communications.
- */
-
-#define CODA_ROOT      2
-#define CODA_OPEN_BY_FD        3
-#define CODA_OPEN      4
-#define CODA_CLOSE     5
-#define CODA_IOCTL     6
-#define CODA_GETATTR   7
-#define CODA_SETATTR   8
-#define CODA_ACCESS    9
-#define CODA_LOOKUP    10
-#define CODA_CREATE    11
-#define CODA_REMOVE    12
-#define CODA_LINK      13
-#define CODA_RENAME    14
-#define CODA_MKDIR     15
-#define CODA_RMDIR     16
-#define CODA_SYMLINK   18
-#define CODA_READLINK  19
-#define CODA_FSYNC     20
-#define CODA_VGET      22
-#define CODA_SIGNAL    23
-#define CODA_REPLACE    24 /* DOWNCALL */
-#define CODA_FLUSH       25 /* DOWNCALL */
-#define CODA_PURGEUSER   26 /* DOWNCALL */
-#define CODA_ZAPFILE     27 /* DOWNCALL */
-#define CODA_ZAPDIR      28 /* DOWNCALL */
-#define CODA_PURGEFID    30 /* DOWNCALL */
-#define CODA_OPEN_BY_PATH 31
-#define CODA_RESOLVE     32
-#define CODA_REINTEGRATE 33
-#define CODA_STATFS     34
-#define CODA_STORE      35
-#define CODA_RELEASE    36
-#define CODA_NCALLS 37
-
-#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
-
-#define VC_MAXDATASIZE     8192
-#define VC_MAXMSGSIZE      sizeof(union inputArgs)+sizeof(union outputArgs) +\
-                            VC_MAXDATASIZE  
-
-#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
-
-#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
-
-/*
- *        Venus <-> Coda  RPC arguments
- */
-struct coda_in_hdr {
-    u_int32_t opcode;
-    u_int32_t unique;      /* Keep multiple outstanding msgs distinct */
-    pid_t pid;
-    pid_t pgid;
-    vuid_t uid;
-};
-
-/* Really important that opcode and unique are 1st two fields! */
-struct coda_out_hdr {
-    u_int32_t opcode;
-    u_int32_t unique;  
-    u_int32_t result;
-};
-
-/* coda_root: NO_IN */
-struct coda_root_out {
-    struct coda_out_hdr oh;
-    struct CodaFid VFid;
-};
-
-struct coda_root_in {
-    struct coda_in_hdr in;
-};
-
-/* coda_open: */
-struct coda_open_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_open_out {
-    struct coda_out_hdr oh;
-    cdev_t     dev;
-    ino_t      inode;
-};
-
-
-/* coda_store: */
-struct coda_store_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_store_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_release: */
-struct coda_release_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_release_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_close: */
-struct coda_close_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_close_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_ioctl: */
-struct coda_ioctl_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        cmd;
-    int        len;
-    int        rwflag;
-    char *data;                        /* Place holder for data. */
-};
-
-struct coda_ioctl_out {
-    struct coda_out_hdr oh;
-    int        len;
-    caddr_t    data;           /* Place holder for data. */
-};
-
-
-/* coda_getattr: */
-struct coda_getattr_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-};
-
-struct coda_getattr_out {
-    struct coda_out_hdr oh;
-    struct coda_vattr attr;
-};
-
-
-/* coda_setattr: NO_OUT */
-struct coda_setattr_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    struct coda_vattr attr;
-};
-
-struct coda_setattr_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_access: NO_OUT */
-struct coda_access_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_access_out {
-    struct coda_out_hdr out;
-};
-
-
-/* lookup flags */
-#define CLU_CASE_SENSITIVE     0x01
-#define CLU_CASE_INSENSITIVE   0x02
-
-/* coda_lookup: */
-struct  coda_lookup_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int         name;          /* Place holder for data. */
-    int         flags; 
-};
-
-struct coda_lookup_out {
-    struct coda_out_hdr oh;
-    struct CodaFid VFid;
-    int        vtype;
-};
-
-
-/* coda_create: */
-struct coda_create_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    struct coda_vattr attr;
-    int excl;
-    int mode;
-    int        name;           /* Place holder for data. */
-};
-
-struct coda_create_out {
-    struct coda_out_hdr oh;
-    struct CodaFid VFid;
-    struct coda_vattr attr;
-};
-
-
-/* coda_remove: NO_OUT */
-struct coda_remove_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int name;          /* Place holder for data. */
-};
-
-struct coda_remove_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_link: NO_OUT */
-struct coda_link_in {
-    struct coda_in_hdr ih;
-    struct CodaFid sourceFid;  /* cnode to link *to* */
-    struct CodaFid destFid;    /* Directory in which to place link */
-    int tname;         /* Place holder for data. */
-};
-
-struct coda_link_out {
-    struct coda_out_hdr out;
-};
-
-
-/* coda_rename: NO_OUT */
-struct coda_rename_in {
-    struct coda_in_hdr ih;
-    struct CodaFid sourceFid;
-    int        srcname;
-    struct CodaFid destFid;
-    int        destname;
-};
-
-struct coda_rename_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_mkdir: */
-struct coda_mkdir_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    struct coda_vattr attr;
-    int           name;                /* Place holder for data. */
-};
-
-struct coda_mkdir_out {
-    struct coda_out_hdr oh;
-    struct CodaFid VFid;
-    struct coda_vattr attr;
-};
-
-
-/* coda_rmdir: NO_OUT */
-struct coda_rmdir_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int name;          /* Place holder for data. */
-};
-
-struct coda_rmdir_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_symlink: NO_OUT */
-struct coda_symlink_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;       /* Directory to put symlink in */
-    int srcname;
-    struct coda_vattr attr;
-    int tname;
-};
-
-struct coda_symlink_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_readlink: */
-struct coda_readlink_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-};
-
-struct coda_readlink_out {
-    struct coda_out_hdr oh;
-    int        count;
-    caddr_t    data;           /* Place holder for data. */
-};
-
-
-/* coda_fsync: NO_OUT */
-struct coda_fsync_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-};
-
-struct coda_fsync_out {
-    struct coda_out_hdr out;
-};
-
-/* coda_vget: */
-struct coda_vget_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-};
-
-struct coda_vget_out {
-    struct coda_out_hdr oh;
-    struct CodaFid VFid;
-    int        vtype;
-};
-
-
-/* CODA_SIGNAL is out-of-band, doesn't need data. */
-/* CODA_INVALIDATE is a venus->kernel call */
-/* CODA_FLUSH is a venus->kernel call */
-
-/* coda_purgeuser: */
-/* CODA_PURGEUSER is a venus->kernel call */
-struct coda_purgeuser_out {
-    struct coda_out_hdr oh;
-    vuid_t uid;
-};
-
-/* coda_zapfile: */
-/* CODA_ZAPFILE is a venus->kernel call */
-struct coda_zapfile_out {  
-    struct coda_out_hdr oh;
-    struct CodaFid CodaFid;
-};
-
-/* coda_zapdir: */
-/* CODA_ZAPDIR is a venus->kernel call */      
-struct coda_zapdir_out {         
-    struct coda_out_hdr oh;
-    struct CodaFid CodaFid;
-};
-
-/* coda_purgefid: */
-/* CODA_PURGEFID is a venus->kernel call */    
-struct coda_purgefid_out { 
-    struct coda_out_hdr oh;
-    struct CodaFid CodaFid;
-};
-
-/* coda_replace: */
-/* CODA_REPLACE is a venus->kernel call */     
-struct coda_replace_out { /* coda_replace is a venus->kernel call */
-    struct coda_out_hdr oh;
-    struct CodaFid NewFid;
-    struct CodaFid OldFid;
-};
-
-/* coda_open_by_fd: */
-struct coda_open_by_fd_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_open_by_fd_out {
-    struct coda_out_hdr oh;
-    int fd;
-
-#ifdef __KERNEL__
-    struct file *fh; /* not passed from userspace but used in-kernel only */
-#endif
-};
-
-/* coda_open_by_path: */
-struct coda_open_by_path_in {
-    struct coda_in_hdr ih;
-    struct CodaFid VFid;
-    int        flags;
-};
-
-struct coda_open_by_path_out {
-    struct coda_out_hdr oh;
-       int path;
-};
-
-/* coda_statfs: NO_IN */
-struct coda_statfs_in {
-    struct coda_in_hdr in;
-};
-
-struct coda_statfs_out {
-    struct coda_out_hdr oh;
-    struct coda_statfs stat;
-};
-
-/* 
- * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 
- * For instance, if the fid is inconsistent. 
- * This case is handled by setting the top bit of the type result parameter.
- */
-#define CODA_NOCACHE          0x80000000
-
-union inputArgs {
-    struct coda_in_hdr ih;             /* NB: every struct below begins with an ih */
-    struct coda_open_in coda_open;
-    struct coda_store_in coda_store;
-    struct coda_release_in coda_release;
-    struct coda_close_in coda_close;
-    struct coda_ioctl_in coda_ioctl;
-    struct coda_getattr_in coda_getattr;
-    struct coda_setattr_in coda_setattr;
-    struct coda_access_in coda_access;
-    struct coda_lookup_in coda_lookup;
-    struct coda_create_in coda_create;
-    struct coda_remove_in coda_remove;
-    struct coda_link_in coda_link;
-    struct coda_rename_in coda_rename;
-    struct coda_mkdir_in coda_mkdir;
-    struct coda_rmdir_in coda_rmdir;
-    struct coda_symlink_in coda_symlink;
-    struct coda_readlink_in coda_readlink;
-    struct coda_fsync_in coda_fsync;
-    struct coda_vget_in coda_vget;
-    struct coda_open_by_fd_in coda_open_by_fd;
-    struct coda_open_by_path_in coda_open_by_path;
-    struct coda_statfs_in coda_statfs;
-};
-
-union outputArgs {
-    struct coda_out_hdr oh;            /* NB: every struct below begins with an oh */
-    struct coda_root_out coda_root;
-    struct coda_open_out coda_open;
-    struct coda_ioctl_out coda_ioctl;
-    struct coda_getattr_out coda_getattr;
-    struct coda_lookup_out coda_lookup;
-    struct coda_create_out coda_create;
-    struct coda_mkdir_out coda_mkdir;
-    struct coda_readlink_out coda_readlink;
-    struct coda_vget_out coda_vget;
-    struct coda_purgeuser_out coda_purgeuser;
-    struct coda_zapfile_out coda_zapfile;
-    struct coda_zapdir_out coda_zapdir;
-    struct coda_purgefid_out coda_purgefid;
-    struct coda_replace_out coda_replace;
-    struct coda_open_by_fd_out coda_open_by_fd;
-    struct coda_open_by_path_out coda_open_by_path;
-    struct coda_statfs_out coda_statfs;
-};    
-
-union coda_downcalls {
-    /* CODA_INVALIDATE is a venus->kernel call */
-    /* CODA_FLUSH is a venus->kernel call */
-    struct coda_purgeuser_out purgeuser;
-    struct coda_zapfile_out zapfile;
-    struct coda_zapdir_out zapdir;
-    struct coda_purgefid_out purgefid;
-    struct coda_replace_out replace;
-};
-
-
-/*
- * Used for identifying usage of "Control" and pioctls
- */
-
-#define PIOCPARM_MASK 0x0000ffff
-struct ViceIoctl {
-        void __user *in;        /* Data to be transferred in */
-        void __user *out;       /* Data to be transferred out */
-        u_short in_size;        /* Size of input buffer <= 2K */
-        u_short out_size;       /* Maximum size of output buffer, <= 2K */
-};
-
-struct PioctlData {
-        const char __user *path;
-        int follow;
-        struct ViceIoctl vi;
-};
-
-#define CODA_CONTROL           ".CONTROL"
-#define CODA_CONTROLLEN                8
-#define CTL_INO                        -1
-
-/* Data passed to mount */
-
-#define CODA_MOUNT_VERSION 1
-
-struct coda_mount_data {
-       int             version;
-       int             fd;       /* Opened device */
-};
-
-#endif 
-
index 72f2d2f0af91efec0793a3fa202483d2383e82ac..8031d6eef102b71cdf37f2a65202cb4f226f5658 100644 (file)
@@ -1,14 +1,9 @@
 #ifndef __CODA_PSDEV_H
 #define __CODA_PSDEV_H
 
-#include <linux/magic.h>
-
-#define CODA_PSDEV_MAJOR 67
-#define MAX_CODADEVS  5           /* how many do we allow */
-
-#ifdef __KERNEL__
 #include <linux/backing-dev.h>
 #include <linux/mutex.h>
+#include <uapi/linux/coda_psdev.h>
 
 struct kstatfs;
 
@@ -74,23 +69,4 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
  */
 
 extern struct venus_comm coda_comms[];
-#endif /* __KERNEL__ */
-
-/* messages between coda filesystem in kernel and Venus */
-struct upc_req {
-       struct list_head    uc_chain;
-       caddr_t             uc_data;
-       u_short             uc_flags;
-       u_short             uc_inSize;  /* Size is at most 5000 bytes */
-       u_short             uc_outSize;
-       u_short             uc_opcode;  /* copied from data to save lookup */
-       int                 uc_unique;
-       wait_queue_head_t   uc_sleep;   /* process' wait queue */
-};
-
-#define CODA_REQ_ASYNC  0x1
-#define CODA_REQ_READ   0x2
-#define CODA_REQ_WRITE  0x4
-#define CODA_REQ_ABORT  0x8
-
 #endif
index 76384074262d894e4732ed6db4e1883053f0b107..b2b5a41b6a2400342ff5aec1abb4f2834caaf869 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
 #ifndef __CONNECTOR_H
 #define __CONNECTOR_H
 
-#include <linux/types.h>
-
-/*
- * Process Events connector unique ids -- used for message routing
- */
-#define CN_IDX_PROC                    0x1
-#define CN_VAL_PROC                    0x1
-#define CN_IDX_CIFS                    0x2
-#define CN_VAL_CIFS                     0x1
-#define CN_W1_IDX                      0x3     /* w1 communication */
-#define CN_W1_VAL                      0x1
-#define CN_IDX_V86D                    0x4
-#define CN_VAL_V86D_UVESAFB            0x1
-#define CN_IDX_BB                      0x5     /* BlackBoard, from the TSP GPL sampling framework */
-#define CN_DST_IDX                     0x6
-#define CN_DST_VAL                     0x1
-#define CN_IDX_DM                      0x7     /* Device Mapper */
-#define CN_VAL_DM_USERSPACE_LOG                0x1
-#define CN_IDX_DRBD                    0x8
-#define CN_VAL_DRBD                    0x1
-#define CN_KVP_IDX                     0x9     /* HyperV KVP */
-#define CN_KVP_VAL                     0x1     /* queries from the kernel */
-
-#define CN_NETLINK_USERS               10      /* Highest index + 1 */
-
-/*
- * Maximum connector's message size.
- */
-#define CONNECTOR_MAX_MSG_SIZE         16384
-
-/*
- * idx and val are unique identifiers which 
- * are used for message routing and 
- * must be registered in connector.h for in-kernel usage.
- */
-
-struct cb_id {
-       __u32 idx;
-       __u32 val;
-};
-
-struct cn_msg {
-       struct cb_id id;
-
-       __u32 seq;
-       __u32 ack;
-
-       __u16 len;              /* Length of the following data */
-       __u16 flags;
-       __u8 data[0];
-};
-
-#ifdef __KERNEL__
 
 #include <linux/atomic.h>
 
@@ -82,6 +28,7 @@ struct cn_msg {
 #include <linux/workqueue.h>
 
 #include <net/sock.h>
+#include <uapi/linux/connector.h>
 
 #define CN_CBQ_NAMELEN         32
 
@@ -137,5 +84,4 @@ void cn_queue_free_dev(struct cn_queue_dev *dev);
 
 int cn_cb_equal(struct cb_id *, struct cb_id *);
 
-#endif                         /* __KERNEL__ */
 #endif                         /* __CONNECTOR_H */
index 0e7bf272ec2ffbb5a362930bbf669474634c372f..133789609f239e5f25edfade82be8fe7f6ddb381 100644 (file)
@@ -1,94 +1,10 @@
 #ifndef __CRAMFS_H
 #define __CRAMFS_H
 
-#include <linux/types.h>
-#include <linux/magic.h>
+#include <uapi/linux/cramfs_fs.h>
 
-#define CRAMFS_SIGNATURE       "Compressed ROMFS"
-
-/*
- * Width of various bitfields in struct cramfs_inode.
- * Primarily used to generate warnings in mkcramfs.
- */
-#define CRAMFS_MODE_WIDTH 16
-#define CRAMFS_UID_WIDTH 16
-#define CRAMFS_SIZE_WIDTH 24
-#define CRAMFS_GID_WIDTH 8
-#define CRAMFS_NAMELEN_WIDTH 6
-#define CRAMFS_OFFSET_WIDTH 26
-
-/*
- * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
- * path length is 63 << 2 = 252.
- */
-#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
-
-/*
- * Reasonably terse representation of the inode data.
- */
-struct cramfs_inode {
-       __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
-       /* SIZE for device files is i_rdev */
-       __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
-       /* NAMELEN is the length of the file name, divided by 4 and
-           rounded up.  (cramfs doesn't support hard links.) */
-       /* OFFSET: For symlinks and non-empty regular files, this
-          contains the offset (divided by 4) of the file data in
-          compressed form (starting with an array of block pointers;
-          see README).  For non-empty directories it is the offset
-          (divided by 4) of the inode of the first file in that
-          directory.  For anything else, offset is zero. */
-       __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
-};
-
-struct cramfs_info {
-       __u32 crc;
-       __u32 edition;
-       __u32 blocks;
-       __u32 files;
-};
-
-/*
- * Superblock information at the beginning of the FS.
- */
-struct cramfs_super {
-       __u32 magic;                    /* 0x28cd3d45 - random number */
-       __u32 size;                     /* length in bytes */
-       __u32 flags;                    /* feature flags */
-       __u32 future;                   /* reserved for future use */
-       __u8 signature[16];             /* "Compressed ROMFS" */
-       struct cramfs_info fsid;        /* unique filesystem info */
-       __u8 name[16];                  /* user-defined name */
-       struct cramfs_inode root;       /* root inode data */
-};
-
-/*
- * Feature flags
- *
- * 0x00000000 - 0x000000ff: features that work for all past kernels
- * 0x00000100 - 0xffffffff: features that don't work for past kernels
- */
-#define CRAMFS_FLAG_FSID_VERSION_2     0x00000001      /* fsid version #2 */
-#define CRAMFS_FLAG_SORTED_DIRS                0x00000002      /* sorted dirs */
-#define CRAMFS_FLAG_HOLES              0x00000100      /* support for holes */
-#define CRAMFS_FLAG_WRONG_SIGNATURE    0x00000200      /* reserved */
-#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET        0x00000400      /* shifted root fs */
-
-/*
- * Valid values in super.flags.  Currently we refuse to mount
- * if (flags & ~CRAMFS_SUPPORTED_FLAGS).  Maybe that should be
- * changed to test super.future instead.
- */
-#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
-                               | CRAMFS_FLAG_HOLES \
-                               | CRAMFS_FLAG_WRONG_SIGNATURE \
-                               | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
-
-#ifdef __KERNEL__
 /* Uncompression interfaces to the underlying zlib */
 int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
 int cramfs_uncompress_init(void);
 void cramfs_uncompress_exit(void);
-#endif /* __KERNEL__ */
-
 #endif
index 9f9865ff781e3d69915b1839394e302874bd6462..b723328238072cd62bf19dd30e635bc916cb23ce 100644 (file)
@@ -4,38 +4,15 @@
  *
  * Copyright (C) 1996 Paul Mackerras.
  */
-
 #ifndef _LINUX_CUDA_H
 #define _LINUX_CUDA_H
 
-/* CUDA commands (2nd byte) */
-#define CUDA_WARM_START                0
-#define CUDA_AUTOPOLL          1
-#define CUDA_GET_6805_ADDR     2
-#define CUDA_GET_TIME          3
-#define CUDA_GET_PRAM          7
-#define CUDA_SET_6805_ADDR     8
-#define CUDA_SET_TIME          9
-#define CUDA_POWERDOWN         0xa
-#define CUDA_POWERUP_TIME      0xb
-#define CUDA_SET_PRAM          0xc
-#define CUDA_MS_RESET          0xd
-#define CUDA_SEND_DFAC         0xe
-#define CUDA_RESET_SYSTEM      0x11
-#define CUDA_SET_IPL           0x12
-#define CUDA_SET_AUTO_RATE     0x14
-#define CUDA_GET_AUTO_RATE     0x16
-#define CUDA_SET_DEVICE_LIST   0x19
-#define CUDA_GET_DEVICE_LIST   0x1a
-#define CUDA_GET_SET_IIC       0x22
+#include <uapi/linux/cuda.h>
 
-#ifdef __KERNEL__
 
 extern int find_via_cuda(void);
 extern int cuda_request(struct adb_request *req,
                        void (*done)(struct adb_request *), int nbytes, ...);
 extern void cuda_poll(void);
 
-#endif /* __KERNEL */
-
 #endif /* _LINUX_CUDA_H */
index a5049eaf782d09ea7122857548b73444ca4cbadc..19ae518f54715ca3592043c70797e2176a84cb30 100644 (file)
  *
  *
  */
-
 #ifndef _LINUX_CYCLADES_H
 #define _LINUX_CYCLADES_H
 
-#include <linux/types.h>
-
-struct cyclades_monitor {
-        unsigned long           int_count;
-        unsigned long           char_count;
-        unsigned long           char_max;
-        unsigned long           char_last;
-};
-
-/*
- * These stats all reflect activity since the device was last initialized.
- * (i.e., since the port was opened with no other processes already having it
- * open)
- */
-struct cyclades_idle_stats {
-    __kernel_time_t in_use;    /* Time device has been in use (secs) */
-    __kernel_time_t recv_idle; /* Time since last char received (secs) */
-    __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
-    unsigned long  recv_bytes; /* Bytes received */
-    unsigned long  xmit_bytes; /* Bytes transmitted */
-    unsigned long  overruns;   /* Input overruns */
-    unsigned long  frame_errs; /* Input framing errors */
-    unsigned long  parity_errs;        /* Input parity errors */
-};
-
-#define CYCLADES_MAGIC  0x4359
-
-#define CYGETMON                0x435901
-#define CYGETTHRESH             0x435902
-#define CYSETTHRESH             0x435903
-#define CYGETDEFTHRESH          0x435904
-#define CYSETDEFTHRESH          0x435905
-#define CYGETTIMEOUT            0x435906
-#define CYSETTIMEOUT            0x435907
-#define CYGETDEFTIMEOUT         0x435908
-#define CYSETDEFTIMEOUT         0x435909
-#define CYSETRFLOW             0x43590a
-#define CYGETRFLOW             0x43590b
-#define CYSETRTSDTR_INV                0x43590c
-#define CYGETRTSDTR_INV                0x43590d
-#define CYZSETPOLLCYCLE                0x43590e
-#define CYZGETPOLLCYCLE                0x43590f
-#define CYGETCD1400VER         0x435910
-#define        CYSETWAIT               0x435912
-#define        CYGETWAIT               0x435913
-
-/*************** CYCLOM-Z ADDITIONS ***************/
-
-#define CZIOC           ('M' << 8)
-#define CZ_NBOARDS      (CZIOC|0xfa)
-#define CZ_BOOT_START   (CZIOC|0xfb)
-#define CZ_BOOT_DATA    (CZIOC|0xfc)
-#define CZ_BOOT_END     (CZIOC|0xfd)
-#define CZ_TEST         (CZIOC|0xfe)
-
-#define CZ_DEF_POLL    (HZ/25)
-
-#define MAX_BOARD       4       /* Max number of boards */
-#define MAX_DEV         256     /* Max number of ports total */
-#define        CYZ_MAX_SPEED   921600
-
-#define        CYZ_FIFO_SIZE   16
-
-#define CYZ_BOOT_NWORDS 0x100
-struct CYZ_BOOT_CTRL {
-        unsigned short  nboard;
-        int             status[MAX_BOARD];
-        int             nchannel[MAX_BOARD];
-        int             fw_rev[MAX_BOARD];
-        unsigned long   offset;
-        unsigned long   data[CYZ_BOOT_NWORDS];
-};
-
-
-#ifndef DP_WINDOW_SIZE
-/*
- *     Memory Window Sizes
- */
-
-#define        DP_WINDOW_SIZE          (0x00080000)    /* window size 512 Kb */
-#define        ZE_DP_WINDOW_SIZE       (0x00100000)    /* window size 1 Mb (Ze and
-                                                 8Zo V.2 */
-#define        CTRL_WINDOW_SIZE        (0x00000080)    /* runtime regs 128 bytes */
-
-/*
- *     CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
- *     normally will access only interested on the fpga_id, fpga_version,
- *     start_cpu and stop_cpu.
- */
-
-struct CUSTOM_REG {
-       __u32   fpga_id;                /* FPGA Identification Register */
-       __u32   fpga_version;           /* FPGA Version Number Register */
-       __u32   cpu_start;              /* CPU start Register (write) */
-       __u32   cpu_stop;               /* CPU stop Register (write) */
-       __u32   misc_reg;               /* Miscellaneous Register */
-       __u32   idt_mode;               /* IDT mode Register */
-       __u32   uart_irq_status;        /* UART IRQ status Register */
-       __u32   clear_timer0_irq;       /* Clear timer interrupt Register */
-       __u32   clear_timer1_irq;       /* Clear timer interrupt Register */
-       __u32   clear_timer2_irq;       /* Clear timer interrupt Register */
-       __u32   test_register;          /* Test Register */
-       __u32   test_count;             /* Test Count Register */
-       __u32   timer_select;           /* Timer select register */
-       __u32   pr_uart_irq_status;     /* Prioritized UART IRQ stat Reg */
-       __u32   ram_wait_state;         /* RAM wait-state Register */
-       __u32   uart_wait_state;        /* UART wait-state Register */
-       __u32   timer_wait_state;       /* timer wait-state Register */
-       __u32   ack_wait_state;         /* ACK wait State Register */
-};
-
-/*
- *     RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
- *     registers. This structure can be used to access the 9060 registers
- *     (memory mapped).
- */
-
-struct RUNTIME_9060 {
-       __u32   loc_addr_range; /* 00h - Local Address Range */
-       __u32   loc_addr_base;  /* 04h - Local Address Base */
-       __u32   loc_arbitr;     /* 08h - Local Arbitration */
-       __u32   endian_descr;   /* 0Ch - Big/Little Endian Descriptor */
-       __u32   loc_rom_range;  /* 10h - Local ROM Range */
-       __u32   loc_rom_base;   /* 14h - Local ROM Base */
-       __u32   loc_bus_descr;  /* 18h - Local Bus descriptor */
-       __u32   loc_range_mst;  /* 1Ch - Local Range for Master to PCI */
-       __u32   loc_base_mst;   /* 20h - Local Base for Master PCI */
-       __u32   loc_range_io;   /* 24h - Local Range for Master IO */
-       __u32   pci_base_mst;   /* 28h - PCI Base for Master PCI */
-       __u32   pci_conf_io;    /* 2Ch - PCI configuration for Master IO */
-       __u32   filler1;        /* 30h */
-       __u32   filler2;        /* 34h */
-       __u32   filler3;        /* 38h */
-       __u32   filler4;        /* 3Ch */
-       __u32   mail_box_0;     /* 40h - Mail Box 0 */
-       __u32   mail_box_1;     /* 44h - Mail Box 1 */
-       __u32   mail_box_2;     /* 48h - Mail Box 2 */
-       __u32   mail_box_3;     /* 4Ch - Mail Box 3 */
-       __u32   filler5;        /* 50h */
-       __u32   filler6;        /* 54h */
-       __u32   filler7;        /* 58h */
-       __u32   filler8;        /* 5Ch */
-       __u32   pci_doorbell;   /* 60h - PCI to Local Doorbell */
-       __u32   loc_doorbell;   /* 64h - Local to PCI Doorbell */
-       __u32   intr_ctrl_stat; /* 68h - Interrupt Control/Status */
-       __u32   init_ctrl;      /* 6Ch - EEPROM control, Init Control, etc */
-};
-
-/* Values for the Local Base Address re-map register */
-
-#define        WIN_RAM         0x00000001L     /* set the sliding window to RAM */
-#define        WIN_CREG        0x14000001L     /* set the window to custom Registers */
-
-/* Values timer select registers */
-
-#define        TIMER_BY_1M     0x00            /* clock divided by 1M */
-#define        TIMER_BY_256K   0x01            /* clock divided by 256k */
-#define        TIMER_BY_128K   0x02            /* clock divided by 128k */
-#define        TIMER_BY_32K    0x03            /* clock divided by 32k */
-
-/****************** ****************** *******************/
-#endif
-
-#ifndef ZFIRM_ID
-/* #include "zfwint.h" */
-/****************** ****************** *******************/
-/*
- *     This file contains the definitions for interfacing with the
- *     Cyclom-Z ZFIRM Firmware.
- */
-
-/* General Constant definitions */
-
-#define        MAX_CHAN        64              /* max number of channels per board */
-
-/* firmware id structure (set after boot) */
-
-#define ID_ADDRESS     0x00000180L     /* signature/pointer address */
-#define        ZFIRM_ID        0x5557465AL     /* ZFIRM/U signature */
-#define        ZFIRM_HLT       0x59505B5CL     /* ZFIRM needs external power supply */
-#define        ZFIRM_RST       0x56040674L     /* RST signal (due to FW reset) */
-
-#define        ZF_TINACT_DEF   1000            /* default inactivity timeout 
-                                          (1000 ms) */
-#define        ZF_TINACT       ZF_TINACT_DEF
-
-struct FIRM_ID {
-       __u32   signature;              /* ZFIRM/U signature */
-       __u32   zfwctrl_addr;           /* pointer to ZFW_CTRL structure */
-};
-
-/* Op. System id */
-
-#define        C_OS_LINUX      0x00000030      /* generic Linux system */
-
-/* channel op_mode */
-
-#define        C_CH_DISABLE    0x00000000      /* channel is disabled */
-#define        C_CH_TXENABLE   0x00000001      /* channel Tx enabled */
-#define        C_CH_RXENABLE   0x00000002      /* channel Rx enabled */
-#define        C_CH_ENABLE     0x00000003      /* channel Tx/Rx enabled */
-#define        C_CH_LOOPBACK   0x00000004      /* Loopback mode */
-
-/* comm_parity - parity */
-
-#define        C_PR_NONE       0x00000000      /* None */
-#define        C_PR_ODD        0x00000001      /* Odd */
-#define C_PR_EVEN      0x00000002      /* Even */
-#define C_PR_MARK      0x00000004      /* Mark */
-#define C_PR_SPACE     0x00000008      /* Space */
-#define C_PR_PARITY    0x000000ff
-
-#define        C_PR_DISCARD    0x00000100      /* discard char with frame/par error */
-#define C_PR_IGNORE    0x00000200      /* ignore frame/par error */
-
-/* comm_data_l - data length and stop bits */
-
-#define C_DL_CS5       0x00000001
-#define C_DL_CS6       0x00000002
-#define C_DL_CS7       0x00000004
-#define C_DL_CS8       0x00000008
-#define        C_DL_CS         0x0000000f
-#define C_DL_1STOP     0x00000010
-#define C_DL_15STOP    0x00000020
-#define C_DL_2STOP     0x00000040
-#define        C_DL_STOP       0x000000f0
-
-/* interrupt enabling/status */
-
-#define        C_IN_DISABLE    0x00000000      /* zero, disable interrupts */
-#define        C_IN_TXBEMPTY   0x00000001      /* tx buffer empty */
-#define        C_IN_TXLOWWM    0x00000002      /* tx buffer below LWM */
-#define        C_IN_RXHIWM     0x00000010      /* rx buffer above HWM */
-#define        C_IN_RXNNDT     0x00000020      /* rx no new data timeout */
-#define        C_IN_MDCD       0x00000100      /* modem DCD change */
-#define        C_IN_MDSR       0x00000200      /* modem DSR change */
-#define        C_IN_MRI        0x00000400      /* modem RI change */
-#define        C_IN_MCTS       0x00000800      /* modem CTS change */
-#define        C_IN_RXBRK      0x00001000      /* Break received */
-#define        C_IN_PR_ERROR   0x00002000      /* parity error */
-#define        C_IN_FR_ERROR   0x00004000      /* frame error */
-#define C_IN_OVR_ERROR  0x00008000      /* overrun error */
-#define C_IN_RXOFL     0x00010000      /* RX buffer overflow */
-#define C_IN_IOCTLW    0x00020000      /* I/O control w/ wait */
-#define C_IN_MRTS      0x00040000      /* modem RTS drop */
-#define C_IN_ICHAR     0x00080000
-/* flow control */
-
-#define        C_FL_OXX        0x00000001      /* output Xon/Xoff flow control */
-#define        C_FL_IXX        0x00000002      /* output Xon/Xoff flow control */
-#define C_FL_OIXANY    0x00000004      /* output Xon/Xoff (any xon) */
-#define        C_FL_SWFLOW     0x0000000f
-
-/* flow status */
-
-#define        C_FS_TXIDLE     0x00000000      /* no Tx data in the buffer or UART */
-#define        C_FS_SENDING    0x00000001      /* UART is sending data */
-#define        C_FS_SWFLOW     0x00000002      /* Tx is stopped by received Xoff */
-
-/* rs_control/rs_status RS-232 signals */
-
-#define C_RS_PARAM     0x80000000      /* Indicates presence of parameter in 
-                                          IOCTLM command */
-#define        C_RS_RTS        0x00000001      /* RTS */
-#define        C_RS_DTR        0x00000004      /* DTR */
-#define        C_RS_DCD        0x00000100      /* CD */
-#define        C_RS_DSR        0x00000200      /* DSR */
-#define        C_RS_RI         0x00000400      /* RI */
-#define        C_RS_CTS        0x00000800      /* CTS */
-
-/* commands Host <-> Board */
-
-#define        C_CM_RESET      0x01            /* reset/flush buffers */
-#define        C_CM_IOCTL      0x02            /* re-read CH_CTRL */
-#define        C_CM_IOCTLW     0x03            /* re-read CH_CTRL, intr when done */
-#define        C_CM_IOCTLM     0x04            /* RS-232 outputs change */
-#define        C_CM_SENDXOFF   0x10            /* send Xoff */
-#define        C_CM_SENDXON    0x11            /* send Xon */
-#define C_CM_CLFLOW    0x12            /* Clear flow control (resume) */
-#define        C_CM_SENDBRK    0x41            /* send break */
-#define        C_CM_INTBACK    0x42            /* Interrupt back */
-#define        C_CM_SET_BREAK  0x43            /* Tx break on */
-#define        C_CM_CLR_BREAK  0x44            /* Tx break off */
-#define        C_CM_CMD_DONE   0x45            /* Previous command done */
-#define C_CM_INTBACK2  0x46            /* Alternate Interrupt back */
-#define        C_CM_TINACT     0x51            /* set inactivity detection */
-#define        C_CM_IRQ_ENBL   0x52            /* enable generation of interrupts */
-#define        C_CM_IRQ_DSBL   0x53            /* disable generation of interrupts */
-#define        C_CM_ACK_ENBL   0x54            /* enable acknowledged interrupt mode */
-#define        C_CM_ACK_DSBL   0x55            /* disable acknowledged intr mode */
-#define        C_CM_FLUSH_RX   0x56            /* flushes Rx buffer */
-#define        C_CM_FLUSH_TX   0x57            /* flushes Tx buffer */
-#define C_CM_Q_ENABLE  0x58            /* enables queue access from the 
-                                          driver */
-#define C_CM_Q_DISABLE  0x59            /* disables queue access from the 
-                                          driver */
-
-#define        C_CM_TXBEMPTY   0x60            /* Tx buffer is empty */
-#define        C_CM_TXLOWWM    0x61            /* Tx buffer low water mark */
-#define        C_CM_RXHIWM     0x62            /* Rx buffer high water mark */
-#define        C_CM_RXNNDT     0x63            /* rx no new data timeout */
-#define        C_CM_TXFEMPTY   0x64
-#define        C_CM_ICHAR      0x65
-#define        C_CM_MDCD       0x70            /* modem DCD change */
-#define        C_CM_MDSR       0x71            /* modem DSR change */
-#define        C_CM_MRI        0x72            /* modem RI change */
-#define        C_CM_MCTS       0x73            /* modem CTS change */
-#define C_CM_MRTS      0x74            /* modem RTS drop */
-#define        C_CM_RXBRK      0x84            /* Break received */
-#define        C_CM_PR_ERROR   0x85            /* Parity error */
-#define        C_CM_FR_ERROR   0x86            /* Frame error */
-#define C_CM_OVR_ERROR  0x87            /* Overrun error */
-#define C_CM_RXOFL     0x88            /* RX buffer overflow */
-#define        C_CM_CMDERROR   0x90            /* command error */
-#define        C_CM_FATAL      0x91            /* fatal error */
-#define        C_CM_HW_RESET   0x92            /* reset board */
-
-/*
- *     CH_CTRL - This per port structure contains all parameters
- *     that control an specific port. It can be seen as the
- *     configuration registers of a "super-serial-controller".
- */
-
-struct CH_CTRL {
-       __u32   op_mode;        /* operation mode */
-       __u32   intr_enable;    /* interrupt masking */
-       __u32   sw_flow;        /* SW flow control */
-       __u32   flow_status;    /* output flow status */
-       __u32   comm_baud;      /* baud rate  - numerically specified */
-       __u32   comm_parity;    /* parity */
-       __u32   comm_data_l;    /* data length/stop */
-       __u32   comm_flags;     /* other flags */
-       __u32   hw_flow;        /* HW flow control */
-       __u32   rs_control;     /* RS-232 outputs */
-       __u32   rs_status;      /* RS-232 inputs */
-       __u32   flow_xon;       /* xon char */
-       __u32   flow_xoff;      /* xoff char */
-       __u32   hw_overflow;    /* hw overflow counter */
-       __u32   sw_overflow;    /* sw overflow counter */
-       __u32   comm_error;     /* frame/parity error counter */
-       __u32 ichar;
-       __u32 filler[7];
-};
-
-
-/*
- *     BUF_CTRL - This per channel structure contains
- *     all Tx and Rx buffer control for a given channel.
- */
-
-struct BUF_CTRL        {
-       __u32   flag_dma;       /* buffers are in Host memory */
-       __u32   tx_bufaddr;     /* address of the tx buffer */
-       __u32   tx_bufsize;     /* tx buffer size */
-       __u32   tx_threshold;   /* tx low water mark */
-       __u32   tx_get;         /* tail index tx buf */
-       __u32   tx_put;         /* head index tx buf */
-       __u32   rx_bufaddr;     /* address of the rx buffer */
-       __u32   rx_bufsize;     /* rx buffer size */
-       __u32   rx_threshold;   /* rx high water mark */
-       __u32   rx_get;         /* tail index rx buf */
-       __u32   rx_put;         /* head index rx buf */
-       __u32   filler[5];      /* filler to align structures */
-};
-
-/*
- *     BOARD_CTRL - This per board structure contains all global 
- *     control fields related to the board.
- */
-
-struct BOARD_CTRL {
-
-       /* static info provided by the on-board CPU */
-       __u32   n_channel;      /* number of channels */
-       __u32   fw_version;     /* firmware version */
-
-       /* static info provided by the driver */
-       __u32   op_system;      /* op_system id */
-       __u32   dr_version;     /* driver version */
-
-       /* board control area */
-       __u32   inactivity;     /* inactivity control */
-
-       /* host to FW commands */
-       __u32   hcmd_channel;   /* channel number */
-       __u32   hcmd_param;     /* pointer to parameters */
-
-       /* FW to Host commands */
-       __u32   fwcmd_channel;  /* channel number */
-       __u32   fwcmd_param;    /* pointer to parameters */
-       __u32   zf_int_queue_addr; /* offset for INT_QUEUE structure */
-
-       /* filler so the structures are aligned */
-       __u32   filler[6];
-};
-
-/* Host Interrupt Queue */
-
-#define QUEUE_SIZE     (10*MAX_CHAN)
-
-struct INT_QUEUE {
-       unsigned char   intr_code[QUEUE_SIZE];
-       unsigned long   channel[QUEUE_SIZE];
-       unsigned long   param[QUEUE_SIZE];
-       unsigned long   put;
-       unsigned long   get;
-};
-
-/*
- *     ZFW_CTRL - This is the data structure that includes all other
- *     data structures used by the Firmware.
- */
-struct ZFW_CTRL {
-       struct BOARD_CTRL       board_ctrl;
-       struct CH_CTRL          ch_ctrl[MAX_CHAN];
-       struct BUF_CTRL         buf_ctrl[MAX_CHAN];
-};
-
-/****************** ****************** *******************/
-#endif
+#include <uapi/linux/cyclades.h>
 
-#ifdef __KERNEL__
 
 /* Per card data structure */
 struct cyclades_card {
@@ -780,5 +357,4 @@ struct cyclades_port {
 
 /***************************************************************************/
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_CYCLADES_H */
index d16294e2a11818261607aee670be9d0dedc14dff..439ff698000aa4ef81f5cef53e69095ce9c9fc80 100644 (file)
@@ -1,239 +1,6 @@
 #ifndef _LINUX_DCCP_H
 #define _LINUX_DCCP_H
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-/**
- * struct dccp_hdr - generic part of DCCP packet header
- *
- * @dccph_sport - Relevant port on the endpoint that sent this packet
- * @dccph_dport - Relevant port on the other endpoint
- * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
- * @dccph_ccval - Used by the HC-Sender CCID
- * @dccph_cscov - Parts of the packet that are covered by the Checksum field
- * @dccph_checksum - Internet checksum, depends on dccph_cscov
- * @dccph_x - 0 = 24 bit sequence number, 1 = 48
- * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
- * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
- */
-struct dccp_hdr {
-       __be16  dccph_sport,
-               dccph_dport;
-       __u8    dccph_doff;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8    dccph_cscov:4,
-               dccph_ccval:4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u8    dccph_ccval:4,
-               dccph_cscov:4;
-#else
-#error  "Adjust your <asm/byteorder.h> defines"
-#endif
-       __sum16 dccph_checksum;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8    dccph_x:1,
-               dccph_type:4,
-               dccph_reserved:3;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u8    dccph_reserved:3,
-               dccph_type:4,
-               dccph_x:1;
-#else
-#error  "Adjust your <asm/byteorder.h> defines"
-#endif
-       __u8    dccph_seq2;
-       __be16  dccph_seq;
-};
-
-/**
- * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
- *
- * @dccph_seq_low - low 24 bits of a 48 bit seq packet
- */
-struct dccp_hdr_ext {
-       __be32  dccph_seq_low;
-};
-
-/**
- * struct dccp_hdr_request - Connection initiation request header
- *
- * @dccph_req_service - Service to which the client app wants to connect
- */
-struct dccp_hdr_request {
-       __be32  dccph_req_service;
-};
-/**
- * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
- *
- * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
- * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
- */
-struct dccp_hdr_ack_bits {
-       __be16  dccph_reserved1;
-       __be16  dccph_ack_nr_high;
-       __be32  dccph_ack_nr_low;
-};
-/**
- * struct dccp_hdr_response - Connection initiation response header
- *
- * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
- * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
- */
-struct dccp_hdr_response {
-       struct dccp_hdr_ack_bits        dccph_resp_ack;
-       __be32                          dccph_resp_service;
-};
-
-/**
- * struct dccp_hdr_reset - Unconditionally shut down a connection
- *
- * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
- * @dccph_reset_code - one of %dccp_reset_codes
- * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
- */
-struct dccp_hdr_reset {
-       struct dccp_hdr_ack_bits        dccph_reset_ack;
-       __u8                            dccph_reset_code,
-                                       dccph_reset_data[3];
-};
-
-enum dccp_pkt_type {
-       DCCP_PKT_REQUEST = 0,
-       DCCP_PKT_RESPONSE,
-       DCCP_PKT_DATA,
-       DCCP_PKT_ACK,
-       DCCP_PKT_DATAACK,
-       DCCP_PKT_CLOSEREQ,
-       DCCP_PKT_CLOSE,
-       DCCP_PKT_RESET,
-       DCCP_PKT_SYNC,
-       DCCP_PKT_SYNCACK,
-       DCCP_PKT_INVALID,
-};
-
-#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
-
-static inline unsigned int dccp_packet_hdr_len(const __u8 type)
-{
-       if (type == DCCP_PKT_DATA)
-               return 0;
-       if (type == DCCP_PKT_DATAACK    ||
-           type == DCCP_PKT_ACK        ||
-           type == DCCP_PKT_SYNC       ||
-           type == DCCP_PKT_SYNCACK    ||
-           type == DCCP_PKT_CLOSE      ||
-           type == DCCP_PKT_CLOSEREQ)
-               return sizeof(struct dccp_hdr_ack_bits);
-       if (type == DCCP_PKT_REQUEST)
-               return sizeof(struct dccp_hdr_request);
-       if (type == DCCP_PKT_RESPONSE)
-               return sizeof(struct dccp_hdr_response);
-       return sizeof(struct dccp_hdr_reset);
-}
-enum dccp_reset_codes {
-       DCCP_RESET_CODE_UNSPECIFIED = 0,
-       DCCP_RESET_CODE_CLOSED,
-       DCCP_RESET_CODE_ABORTED,
-       DCCP_RESET_CODE_NO_CONNECTION,
-       DCCP_RESET_CODE_PACKET_ERROR,
-       DCCP_RESET_CODE_OPTION_ERROR,
-       DCCP_RESET_CODE_MANDATORY_ERROR,
-       DCCP_RESET_CODE_CONNECTION_REFUSED,
-       DCCP_RESET_CODE_BAD_SERVICE_CODE,
-       DCCP_RESET_CODE_TOO_BUSY,
-       DCCP_RESET_CODE_BAD_INIT_COOKIE,
-       DCCP_RESET_CODE_AGGRESSION_PENALTY,
-
-       DCCP_MAX_RESET_CODES            /* Leave at the end!  */
-};
-
-/* DCCP options */
-enum {
-       DCCPO_PADDING = 0,
-       DCCPO_MANDATORY = 1,
-       DCCPO_MIN_RESERVED = 3,
-       DCCPO_MAX_RESERVED = 31,
-       DCCPO_CHANGE_L = 32,
-       DCCPO_CONFIRM_L = 33,
-       DCCPO_CHANGE_R = 34,
-       DCCPO_CONFIRM_R = 35,
-       DCCPO_NDP_COUNT = 37,
-       DCCPO_ACK_VECTOR_0 = 38,
-       DCCPO_ACK_VECTOR_1 = 39,
-       DCCPO_TIMESTAMP = 41,
-       DCCPO_TIMESTAMP_ECHO = 42,
-       DCCPO_ELAPSED_TIME = 43,
-       DCCPO_MAX = 45,
-       DCCPO_MIN_RX_CCID_SPECIFIC = 128,       /* from sender to receiver */
-       DCCPO_MAX_RX_CCID_SPECIFIC = 191,
-       DCCPO_MIN_TX_CCID_SPECIFIC = 192,       /* from receiver to sender */
-       DCCPO_MAX_TX_CCID_SPECIFIC = 255,
-};
-/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
-#define DCCP_SINGLE_OPT_MAXLEN 253
-
-/* DCCP CCIDS */
-enum {
-       DCCPC_CCID2 = 2,
-       DCCPC_CCID3 = 3,
-};
-
-/* DCCP features (RFC 4340 section 6.4) */
-enum dccp_feature_numbers {
-       DCCPF_RESERVED = 0,
-       DCCPF_CCID = 1,
-       DCCPF_SHORT_SEQNOS = 2,
-       DCCPF_SEQUENCE_WINDOW = 3,
-       DCCPF_ECN_INCAPABLE = 4,
-       DCCPF_ACK_RATIO = 5,
-       DCCPF_SEND_ACK_VECTOR = 6,
-       DCCPF_SEND_NDP_COUNT = 7,
-       DCCPF_MIN_CSUM_COVER = 8,
-       DCCPF_DATA_CHECKSUM = 9,
-       /* 10-127 reserved */
-       DCCPF_MIN_CCID_SPECIFIC = 128,
-       DCCPF_SEND_LEV_RATE = 192,      /* RFC 4342, sec. 8.4 */
-       DCCPF_MAX_CCID_SPECIFIC = 255,
-};
-
-/* DCCP socket control message types for cmsg */
-enum dccp_cmsg_type {
-       DCCP_SCM_PRIORITY = 1,
-       DCCP_SCM_QPOLICY_MAX = 0xFFFF,
-       /* ^-- Up to here reserved exclusively for qpolicy parameters */
-       DCCP_SCM_MAX
-};
-
-/* DCCP priorities for outgoing/queued packets */
-enum dccp_packet_dequeueing_policy {
-       DCCPQ_POLICY_SIMPLE,
-       DCCPQ_POLICY_PRIO,
-       DCCPQ_POLICY_MAX
-};
-
-/* DCCP socket options */
-#define DCCP_SOCKOPT_PACKET_SIZE       1 /* XXX deprecated, without effect */
-#define DCCP_SOCKOPT_SERVICE           2
-#define DCCP_SOCKOPT_CHANGE_L          3
-#define DCCP_SOCKOPT_CHANGE_R          4
-#define DCCP_SOCKOPT_GET_CUR_MPS       5
-#define DCCP_SOCKOPT_SERVER_TIMEWAIT   6
-#define DCCP_SOCKOPT_SEND_CSCOV                10
-#define DCCP_SOCKOPT_RECV_CSCOV                11
-#define DCCP_SOCKOPT_AVAILABLE_CCIDS   12
-#define DCCP_SOCKOPT_CCID              13
-#define DCCP_SOCKOPT_TX_CCID           14
-#define DCCP_SOCKOPT_RX_CCID           15
-#define DCCP_SOCKOPT_QPOLICY_ID                16
-#define DCCP_SOCKOPT_QPOLICY_TXQLEN    17
-#define DCCP_SOCKOPT_CCID_RX_INFO      128
-#define DCCP_SOCKOPT_CCID_TX_INFO      192
-
-/* maximum number of services provided on the same listening port */
-#define DCCP_SERVICE_LIST_MAX_LEN      32
-
-#ifdef __KERNEL__
 
 #include <linux/in.h>
 #include <linux/interrupt.h>
@@ -246,6 +13,7 @@ enum dccp_packet_dequeueing_policy {
 #include <net/inet_sock.h>
 #include <net/inet_timewait_sock.h>
 #include <net/tcp_states.h>
+#include <uapi/linux/dccp.h>
 
 enum dccp_state {
        DCCP_OPEN            = TCP_ESTABLISHED,
@@ -551,6 +319,4 @@ static inline const char *dccp_role(const struct sock *sk)
 
 extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_DCCP_H */
index 520152411cd111fc2c0b94dbbf04069465de206c..1d47dcce11e1011e8a39a96b1c5fa10d0eb7bbca 100644 (file)
 **
 *******************************************************************************
 ******************************************************************************/
-
 #ifndef __DLM_DOT_H__
 #define __DLM_DOT_H__
 
-/*
- * Interface to Distributed Lock Manager (DLM)
- * routines and structures to use DLM lockspaces
- */
-
-/* Lock levels and flags are here */
-#include <linux/dlmconstants.h>
-#include <linux/types.h>
-
-typedef void dlm_lockspace_t;
-
-/*
- * Lock status block
- *
- * Use this structure to specify the contents of the lock value block.  For a
- * conversion request, this structure is used to specify the lock ID of the
- * lock.  DLM writes the status of the lock request and the lock ID assigned
- * to the request in the lock status block.
- *
- * sb_lkid: the returned lock ID.  It is set on new (non-conversion) requests.
- * It is available when dlm_lock returns.
- *
- * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
- * shown for the DLM_LKF_VALBLK flag.
- *
- * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
- * it was first demoted to NL to avoid conversion deadlock.
- * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
- *
- * sb_status: the returned status of the lock request set prior to AST
- * execution.  Possible return values:
- *
- * 0 if lock request was successful
- * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
- * -DLM_EUNLOCK if unlock request was successful
- * -DLM_ECANCEL if a cancel completed successfully
- * -EDEADLK if a deadlock was detected
- * -ETIMEDOUT if the lock request was canceled due to a timeout
- */
-
-#define DLM_SBF_DEMOTED                0x01
-#define DLM_SBF_VALNOTVALID    0x02
-#define DLM_SBF_ALTMODE                0x04
+#include <uapi/linux/dlm.h>
 
-struct dlm_lksb {
-       int      sb_status;
-       __u32    sb_lkid;
-       char     sb_flags;
-       char *   sb_lvbptr;
-};
-
-/* dlm_new_lockspace() flags */
-
-#define DLM_LSFL_TIMEWARN      0x00000002
-#define DLM_LSFL_FS            0x00000004
-#define DLM_LSFL_NEWEXCL       0x00000008
-
-#ifdef __KERNEL__
 
 struct dlm_slot {
        int nodeid; /* 1 to MAX_INT */
@@ -226,7 +169,4 @@ int dlm_unlock(dlm_lockspace_t *lockspace,
               struct dlm_lksb *lksb,
               void *astarg);
 
-#endif                         /* __KERNEL__ */
-
 #endif                         /* __DLM_DOT_H__ */
-
index 3b1cc1be419f8b13aa31be413360293c7de052a9..95ad387a7769e1b8e9ac968b7ad28e2f7b3b00f9 100644 (file)
@@ -5,50 +5,15 @@
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License v.2.
  */
-
 #ifndef __DLM_PLOCK_DOT_H__
 #define __DLM_PLOCK_DOT_H__
 
-#include <linux/types.h>
-
-#define DLM_PLOCK_MISC_NAME            "dlm_plock"
-
-#define DLM_PLOCK_VERSION_MAJOR        1
-#define DLM_PLOCK_VERSION_MINOR        2
-#define DLM_PLOCK_VERSION_PATCH        0
-
-enum {
-       DLM_PLOCK_OP_LOCK = 1,
-       DLM_PLOCK_OP_UNLOCK,
-       DLM_PLOCK_OP_GET,
-};
+#include <uapi/linux/dlm_plock.h>
 
-#define DLM_PLOCK_FL_CLOSE 1
-
-struct dlm_plock_info {
-       __u32 version[3];
-       __u8 optype;
-       __u8 ex;
-       __u8 wait;
-       __u8 flags;
-       __u32 pid;
-       __s32 nodeid;
-       __s32 rv;
-       __u32 fsid;
-       __u64 number;
-       __u64 start;
-       __u64 end;
-       __u64 owner;
-};
-
-#ifdef __KERNEL__
 int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                int cmd, struct file_lock *fl);
 int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                struct file_lock *fl);
 int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
                struct file_lock *fl);
-#endif /* __KERNEL__ */
-
 #endif
-
index 4cbd0fe9df0898f09a4641270ebd89d0f7def56a..83d4371ec996c3f77a0470a4115fb01bb4fc4ce5 100644 (file)
 #ifndef _LINUX_EDD_H
 #define _LINUX_EDD_H
 
-#include <linux/types.h>
-
-#define EDDNR 0x1e9            /* addr of number of edd_info structs at EDDBUF
-                                  in boot_params - treat this as 1 byte  */
-#define EDDBUF 0xd00           /* addr of edd_info structs in boot_params */
-#define EDDMAXNR 6             /* number of edd_info structs starting at EDDBUF  */
-#define EDDEXTSIZE 8           /* change these if you muck with the structures */
-#define EDDPARMSIZE 74
-#define CHECKEXTENSIONSPRESENT 0x41
-#define GETDEVICEPARAMETERS 0x48
-#define LEGACYGETDEVICEPARAMETERS 0x08
-#define EDDMAGIC1 0x55AA
-#define EDDMAGIC2 0xAA55
-
-
-#define READ_SECTORS 0x02         /* int13 AH=0x02 is READ_SECTORS command */
-#define EDD_MBR_SIG_OFFSET 0x1B8  /* offset of signature in the MBR */
-#define EDD_MBR_SIG_BUF    0x290  /* addr in boot params */
-#define EDD_MBR_SIG_MAX 16        /* max number of signatures to store */
-#define EDD_MBR_SIG_NR_BUF 0x1ea  /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
-                                    in boot_params - treat this as 1 byte  */
+#include <uapi/linux/edd.h>
 
 #ifndef __ASSEMBLY__
-
-#define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
-#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
-#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
-#define EDD_EXT_64BIT_EXTENSIONS            (1 << 3)
-
-#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
-#define EDD_INFO_GEOMETRY_VALID                (1 << 1)
-#define EDD_INFO_REMOVABLE                     (1 << 2)
-#define EDD_INFO_WRITE_VERIFY                  (1 << 3)
-#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION     (1 << 4)
-#define EDD_INFO_LOCKABLE                      (1 << 5)
-#define EDD_INFO_NO_MEDIA_PRESENT              (1 << 6)
-#define EDD_INFO_USE_INT13_FN50                (1 << 7)
-
-struct edd_device_params {
-       __u16 length;
-       __u16 info_flags;
-       __u32 num_default_cylinders;
-       __u32 num_default_heads;
-       __u32 sectors_per_track;
-       __u64 number_of_sectors;
-       __u16 bytes_per_sector;
-       __u32 dpte_ptr;         /* 0xFFFFFFFF for our purposes */
-       __u16 key;              /* = 0xBEDD */
-       __u8 device_path_info_length;   /* = 44 */
-       __u8 reserved2;
-       __u16 reserved3;
-       __u8 host_bus_type[4];
-       __u8 interface_type[8];
-       union {
-               struct {
-                       __u16 base_address;
-                       __u16 reserved1;
-                       __u32 reserved2;
-               } __attribute__ ((packed)) isa;
-               struct {
-                       __u8 bus;
-                       __u8 slot;
-                       __u8 function;
-                       __u8 channel;
-                       __u32 reserved;
-               } __attribute__ ((packed)) pci;
-               /* pcix is same as pci */
-               struct {
-                       __u64 reserved;
-               } __attribute__ ((packed)) ibnd;
-               struct {
-                       __u64 reserved;
-               } __attribute__ ((packed)) xprs;
-               struct {
-                       __u64 reserved;
-               } __attribute__ ((packed)) htpt;
-               struct {
-                       __u64 reserved;
-               } __attribute__ ((packed)) unknown;
-       } interface_path;
-       union {
-               struct {
-                       __u8 device;
-                       __u8 reserved1;
-                       __u16 reserved2;
-                       __u32 reserved3;
-                       __u64 reserved4;
-               } __attribute__ ((packed)) ata;
-               struct {
-                       __u8 device;
-                       __u8 lun;
-                       __u8 reserved1;
-                       __u8 reserved2;
-                       __u32 reserved3;
-                       __u64 reserved4;
-               } __attribute__ ((packed)) atapi;
-               struct {
-                       __u16 id;
-                       __u64 lun;
-                       __u16 reserved1;
-                       __u32 reserved2;
-               } __attribute__ ((packed)) scsi;
-               struct {
-                       __u64 serial_number;
-                       __u64 reserved;
-               } __attribute__ ((packed)) usb;
-               struct {
-                       __u64 eui;
-                       __u64 reserved;
-               } __attribute__ ((packed)) i1394;
-               struct {
-                       __u64 wwid;
-                       __u64 lun;
-               } __attribute__ ((packed)) fibre;
-               struct {
-                       __u64 identity_tag;
-                       __u64 reserved;
-               } __attribute__ ((packed)) i2o;
-               struct {
-                       __u32 array_number;
-                       __u32 reserved1;
-                       __u64 reserved2;
-               } __attribute__ ((packed)) raid;
-               struct {
-                       __u8 device;
-                       __u8 reserved1;
-                       __u16 reserved2;
-                       __u32 reserved3;
-                       __u64 reserved4;
-               } __attribute__ ((packed)) sata;
-               struct {
-                       __u64 reserved1;
-                       __u64 reserved2;
-               } __attribute__ ((packed)) unknown;
-       } device_path;
-       __u8 reserved4;
-       __u8 checksum;
-} __attribute__ ((packed));
-
-struct edd_info {
-       __u8 device;
-       __u8 version;
-       __u16 interface_support;
-       __u16 legacy_max_cylinder;
-       __u8 legacy_max_head;
-       __u8 legacy_sectors_per_track;
-       struct edd_device_params params;
-} __attribute__ ((packed));
-
-struct edd {
-       unsigned int mbr_signature[EDD_MBR_SIG_MAX];
-       struct edd_info edd_info[EDDMAXNR];
-       unsigned char mbr_signature_nr;
-       unsigned char edd_info_nr;
-};
-
-#ifdef __KERNEL__
 extern struct edd edd;
-#endif /* __KERNEL__ */
 #endif                         /*!__ASSEMBLY__ */
-
 #endif                         /* _LINUX_EDD_H */
index 59ef40650e1ea19d107a62c76decec52c4d7797f..8c9048e3346357528f998eb39776073dda682b1b 100644 (file)
@@ -1,420 +1,9 @@
 #ifndef _LINUX_ELF_H
 #define _LINUX_ELF_H
 
-#include <linux/types.h>
-#include <linux/elf-em.h>
-#ifdef __KERNEL__
 #include <asm/elf.h>
-#endif
-
-/* 32-bit ELF base types. */
-typedef __u32  Elf32_Addr;
-typedef __u16  Elf32_Half;
-typedef __u32  Elf32_Off;
-typedef __s32  Elf32_Sword;
-typedef __u32  Elf32_Word;
-
-/* 64-bit ELF base types. */
-typedef __u64  Elf64_Addr;
-typedef __u16  Elf64_Half;
-typedef __s16  Elf64_SHalf;
-typedef __u64  Elf64_Off;
-typedef __s32  Elf64_Sword;
-typedef __u32  Elf64_Word;
-typedef __u64  Elf64_Xword;
-typedef __s64  Elf64_Sxword;
-
-/* These constants are for the segment types stored in the image headers */
-#define PT_NULL    0
-#define PT_LOAD    1
-#define PT_DYNAMIC 2
-#define PT_INTERP  3
-#define PT_NOTE    4
-#define PT_SHLIB   5
-#define PT_PHDR    6
-#define PT_TLS     7               /* Thread local storage segment */
-#define PT_LOOS    0x60000000      /* OS-specific */
-#define PT_HIOS    0x6fffffff      /* OS-specific */
-#define PT_LOPROC  0x70000000
-#define PT_HIPROC  0x7fffffff
-#define PT_GNU_EH_FRAME                0x6474e550
-
-#define PT_GNU_STACK   (PT_LOOS + 0x474e551)
-
-/*
- * Extended Numbering
- *
- * If the real number of program header table entries is larger than
- * or equal to PN_XNUM(0xffff), it is set to sh_info field of the
- * section header at index 0, and PN_XNUM is set to e_phnum
- * field. Otherwise, the section header at index 0 is zero
- * initialized, if it exists.
- *
- * Specifications are available in:
- *
- * - Sun microsystems: Linker and Libraries.
- *   Part No: 817-1984-17, September 2008.
- *   URL: http://docs.sun.com/app/docs/doc/817-1984
- *
- * - System V ABI AMD64 Architecture Processor Supplement
- *   Draft Version 0.99.,
- *   May 11, 2009.
- *   URL: http://www.x86-64.org/
- */
-#define PN_XNUM 0xffff
-
-/* These constants define the different elf file types */
-#define ET_NONE   0
-#define ET_REL    1
-#define ET_EXEC   2
-#define ET_DYN    3
-#define ET_CORE   4
-#define ET_LOPROC 0xff00
-#define ET_HIPROC 0xffff
-
-/* This is the info that is needed to parse the dynamic section of the file */
-#define DT_NULL                0
-#define DT_NEEDED      1
-#define DT_PLTRELSZ    2
-#define DT_PLTGOT      3
-#define DT_HASH                4
-#define DT_STRTAB      5
-#define DT_SYMTAB      6
-#define DT_RELA                7
-#define DT_RELASZ      8
-#define DT_RELAENT     9
-#define DT_STRSZ       10
-#define DT_SYMENT      11
-#define DT_INIT                12
-#define DT_FINI                13
-#define DT_SONAME      14
-#define DT_RPATH       15
-#define DT_SYMBOLIC    16
-#define DT_REL         17
-#define DT_RELSZ       18
-#define DT_RELENT      19
-#define DT_PLTREL      20
-#define DT_DEBUG       21
-#define DT_TEXTREL     22
-#define DT_JMPREL      23
-#define DT_ENCODING    32
-#define OLD_DT_LOOS    0x60000000
-#define DT_LOOS                0x6000000d
-#define DT_HIOS                0x6ffff000
-#define DT_VALRNGLO    0x6ffffd00
-#define DT_VALRNGHI    0x6ffffdff
-#define DT_ADDRRNGLO   0x6ffffe00
-#define DT_ADDRRNGHI   0x6ffffeff
-#define DT_VERSYM      0x6ffffff0
-#define DT_RELACOUNT   0x6ffffff9
-#define DT_RELCOUNT    0x6ffffffa
-#define DT_FLAGS_1     0x6ffffffb
-#define DT_VERDEF      0x6ffffffc
-#define        DT_VERDEFNUM    0x6ffffffd
-#define DT_VERNEED     0x6ffffffe
-#define        DT_VERNEEDNUM   0x6fffffff
-#define OLD_DT_HIOS     0x6fffffff
-#define DT_LOPROC      0x70000000
-#define DT_HIPROC      0x7fffffff
-
-/* This info is needed when parsing the symbol table */
-#define STB_LOCAL  0
-#define STB_GLOBAL 1
-#define STB_WEAK   2
-
-#define STT_NOTYPE  0
-#define STT_OBJECT  1
-#define STT_FUNC    2
-#define STT_SECTION 3
-#define STT_FILE    4
-#define STT_COMMON  5
-#define STT_TLS     6
-
-#define ELF_ST_BIND(x)         ((x) >> 4)
-#define ELF_ST_TYPE(x)         (((unsigned int) x) & 0xf)
-#define ELF32_ST_BIND(x)       ELF_ST_BIND(x)
-#define ELF32_ST_TYPE(x)       ELF_ST_TYPE(x)
-#define ELF64_ST_BIND(x)       ELF_ST_BIND(x)
-#define ELF64_ST_TYPE(x)       ELF_ST_TYPE(x)
-
-typedef struct dynamic{
-  Elf32_Sword d_tag;
-  union{
-    Elf32_Sword        d_val;
-    Elf32_Addr d_ptr;
-  } d_un;
-} Elf32_Dyn;
-
-typedef struct {
-  Elf64_Sxword d_tag;          /* entry tag value */
-  union {
-    Elf64_Xword d_val;
-    Elf64_Addr d_ptr;
-  } d_un;
-} Elf64_Dyn;
-
-/* The following are used with relocations */
-#define ELF32_R_SYM(x) ((x) >> 8)
-#define ELF32_R_TYPE(x) ((x) & 0xff)
-
-#define ELF64_R_SYM(i)                 ((i) >> 32)
-#define ELF64_R_TYPE(i)                        ((i) & 0xffffffff)
-
-typedef struct elf32_rel {
-  Elf32_Addr   r_offset;
-  Elf32_Word   r_info;
-} Elf32_Rel;
-
-typedef struct elf64_rel {
-  Elf64_Addr r_offset; /* Location at which to apply the action */
-  Elf64_Xword r_info;  /* index and type of relocation */
-} Elf64_Rel;
-
-typedef struct elf32_rela{
-  Elf32_Addr   r_offset;
-  Elf32_Word   r_info;
-  Elf32_Sword  r_addend;
-} Elf32_Rela;
-
-typedef struct elf64_rela {
-  Elf64_Addr r_offset; /* Location at which to apply the action */
-  Elf64_Xword r_info;  /* index and type of relocation */
-  Elf64_Sxword r_addend;       /* Constant addend used to compute value */
-} Elf64_Rela;
-
-typedef struct elf32_sym{
-  Elf32_Word   st_name;
-  Elf32_Addr   st_value;
-  Elf32_Word   st_size;
-  unsigned char        st_info;
-  unsigned char        st_other;
-  Elf32_Half   st_shndx;
-} Elf32_Sym;
-
-typedef struct elf64_sym {
-  Elf64_Word st_name;          /* Symbol name, index in string tbl */
-  unsigned char        st_info;        /* Type and binding attributes */
-  unsigned char        st_other;       /* No defined meaning, 0 */
-  Elf64_Half st_shndx;         /* Associated section index */
-  Elf64_Addr st_value;         /* Value of the symbol */
-  Elf64_Xword st_size;         /* Associated symbol size */
-} Elf64_Sym;
-
-
-#define EI_NIDENT      16
-
-typedef struct elf32_hdr{
-  unsigned char        e_ident[EI_NIDENT];
-  Elf32_Half   e_type;
-  Elf32_Half   e_machine;
-  Elf32_Word   e_version;
-  Elf32_Addr   e_entry;  /* Entry point */
-  Elf32_Off    e_phoff;
-  Elf32_Off    e_shoff;
-  Elf32_Word   e_flags;
-  Elf32_Half   e_ehsize;
-  Elf32_Half   e_phentsize;
-  Elf32_Half   e_phnum;
-  Elf32_Half   e_shentsize;
-  Elf32_Half   e_shnum;
-  Elf32_Half   e_shstrndx;
-} Elf32_Ehdr;
-
-typedef struct elf64_hdr {
-  unsigned char        e_ident[EI_NIDENT];     /* ELF "magic number" */
-  Elf64_Half e_type;
-  Elf64_Half e_machine;
-  Elf64_Word e_version;
-  Elf64_Addr e_entry;          /* Entry point virtual address */
-  Elf64_Off e_phoff;           /* Program header table file offset */
-  Elf64_Off e_shoff;           /* Section header table file offset */
-  Elf64_Word e_flags;
-  Elf64_Half e_ehsize;
-  Elf64_Half e_phentsize;
-  Elf64_Half e_phnum;
-  Elf64_Half e_shentsize;
-  Elf64_Half e_shnum;
-  Elf64_Half e_shstrndx;
-} Elf64_Ehdr;
-
-/* These constants define the permissions on sections in the program
-   header, p_flags. */
-#define PF_R           0x4
-#define PF_W           0x2
-#define PF_X           0x1
-
-typedef struct elf32_phdr{
-  Elf32_Word   p_type;
-  Elf32_Off    p_offset;
-  Elf32_Addr   p_vaddr;
-  Elf32_Addr   p_paddr;
-  Elf32_Word   p_filesz;
-  Elf32_Word   p_memsz;
-  Elf32_Word   p_flags;
-  Elf32_Word   p_align;
-} Elf32_Phdr;
-
-typedef struct elf64_phdr {
-  Elf64_Word p_type;
-  Elf64_Word p_flags;
-  Elf64_Off p_offset;          /* Segment file offset */
-  Elf64_Addr p_vaddr;          /* Segment virtual address */
-  Elf64_Addr p_paddr;          /* Segment physical address */
-  Elf64_Xword p_filesz;                /* Segment size in file */
-  Elf64_Xword p_memsz;         /* Segment size in memory */
-  Elf64_Xword p_align;         /* Segment alignment, file & memory */
-} Elf64_Phdr;
-
-/* sh_type */
-#define SHT_NULL       0
-#define SHT_PROGBITS   1
-#define SHT_SYMTAB     2
-#define SHT_STRTAB     3
-#define SHT_RELA       4
-#define SHT_HASH       5
-#define SHT_DYNAMIC    6
-#define SHT_NOTE       7
-#define SHT_NOBITS     8
-#define SHT_REL                9
-#define SHT_SHLIB      10
-#define SHT_DYNSYM     11
-#define SHT_NUM                12
-#define SHT_LOPROC     0x70000000
-#define SHT_HIPROC     0x7fffffff
-#define SHT_LOUSER     0x80000000
-#define SHT_HIUSER     0xffffffff
-
-/* sh_flags */
-#define SHF_WRITE      0x1
-#define SHF_ALLOC      0x2
-#define SHF_EXECINSTR  0x4
-#define SHF_MASKPROC   0xf0000000
-
-/* special section indexes */
-#define SHN_UNDEF      0
-#define SHN_LORESERVE  0xff00
-#define SHN_LOPROC     0xff00
-#define SHN_HIPROC     0xff1f
-#define SHN_ABS                0xfff1
-#define SHN_COMMON     0xfff2
-#define SHN_HIRESERVE  0xffff
-typedef struct elf32_shdr {
-  Elf32_Word   sh_name;
-  Elf32_Word   sh_type;
-  Elf32_Word   sh_flags;
-  Elf32_Addr   sh_addr;
-  Elf32_Off    sh_offset;
-  Elf32_Word   sh_size;
-  Elf32_Word   sh_link;
-  Elf32_Word   sh_info;
-  Elf32_Word   sh_addralign;
-  Elf32_Word   sh_entsize;
-} Elf32_Shdr;
-
-typedef struct elf64_shdr {
-  Elf64_Word sh_name;          /* Section name, index in string tbl */
-  Elf64_Word sh_type;          /* Type of section */
-  Elf64_Xword sh_flags;                /* Miscellaneous section attributes */
-  Elf64_Addr sh_addr;          /* Section virtual addr at execution */
-  Elf64_Off sh_offset;         /* Section file offset */
-  Elf64_Xword sh_size;         /* Size of section in bytes */
-  Elf64_Word sh_link;          /* Index of another section */
-  Elf64_Word sh_info;          /* Additional section information */
-  Elf64_Xword sh_addralign;    /* Section alignment */
-  Elf64_Xword sh_entsize;      /* Entry size if section holds table */
-} Elf64_Shdr;
-
-#define        EI_MAG0         0               /* e_ident[] indexes */
-#define        EI_MAG1         1
-#define        EI_MAG2         2
-#define        EI_MAG3         3
-#define        EI_CLASS        4
-#define        EI_DATA         5
-#define        EI_VERSION      6
-#define        EI_OSABI        7
-#define        EI_PAD          8
-
-#define        ELFMAG0         0x7f            /* EI_MAG */
-#define        ELFMAG1         'E'
-#define        ELFMAG2         'L'
-#define        ELFMAG3         'F'
-#define        ELFMAG          "\177ELF"
-#define        SELFMAG         4
-
-#define        ELFCLASSNONE    0               /* EI_CLASS */
-#define        ELFCLASS32      1
-#define        ELFCLASS64      2
-#define        ELFCLASSNUM     3
-
-#define ELFDATANONE    0               /* e_ident[EI_DATA] */
-#define ELFDATA2LSB    1
-#define ELFDATA2MSB    2
-
-#define EV_NONE                0               /* e_version, EI_VERSION */
-#define EV_CURRENT     1
-#define EV_NUM         2
-
-#define ELFOSABI_NONE  0
-#define ELFOSABI_LINUX 3
-
-#ifndef ELF_OSABI
-#define ELF_OSABI ELFOSABI_NONE
-#endif
-
-/*
- * Notes used in ET_CORE. Architectures export some of the arch register sets
- * using the corresponding note types via the PTRACE_GETREGSET and
- * PTRACE_SETREGSET requests.
- */
-#define NT_PRSTATUS    1
-#define NT_PRFPREG     2
-#define NT_PRPSINFO    3
-#define NT_TASKSTRUCT  4
-#define NT_AUXV                6
-/*
- * Note to userspace developers: size of NT_SIGINFO note may increase
- * in the future to accomodate more fields, don't assume it is fixed!
- */
-#define NT_SIGINFO      0x53494749
-#define NT_FILE         0x46494c45
-#define NT_PRXFPREG     0x46e62b7f      /* copied from gdb5.1/include/elf/common.h */
-#define NT_PPC_VMX     0x100           /* PowerPC Altivec/VMX registers */
-#define NT_PPC_SPE     0x101           /* PowerPC SPE/EVR registers */
-#define NT_PPC_VSX     0x102           /* PowerPC VSX registers */
-#define NT_386_TLS     0x200           /* i386 TLS slots (struct user_desc) */
-#define NT_386_IOPERM  0x201           /* x86 io permission bitmap (1=deny) */
-#define NT_X86_XSTATE  0x202           /* x86 extended state using xsave */
-#define NT_S390_HIGH_GPRS      0x300   /* s390 upper register halves */
-#define NT_S390_TIMER  0x301           /* s390 timer register */
-#define NT_S390_TODCMP 0x302           /* s390 TOD clock comparator register */
-#define NT_S390_TODPREG        0x303           /* s390 TOD programmable register */
-#define NT_S390_CTRS   0x304           /* s390 control registers */
-#define NT_S390_PREFIX 0x305           /* s390 prefix register */
-#define NT_S390_LAST_BREAK     0x306   /* s390 breaking event address */
-#define NT_S390_SYSTEM_CALL    0x307   /* s390 system call restart data */
-#define NT_S390_TDB    0x308           /* s390 transaction diagnostic block */
-#define NT_ARM_VFP     0x400           /* ARM VFP/NEON registers */
-#define NT_ARM_TLS     0x401           /* ARM TLS register */
-#define NT_ARM_HW_BREAK        0x402           /* ARM hardware breakpoint registers */
-#define NT_ARM_HW_WATCH        0x403           /* ARM hardware watchpoint registers */
-
-
-/* Note header in a PT_NOTE section */
-typedef struct elf32_note {
-  Elf32_Word   n_namesz;       /* Name size */
-  Elf32_Word   n_descsz;       /* Content size */
-  Elf32_Word   n_type;         /* Content type */
-} Elf32_Nhdr;
-
-/* Note header in a PT_NOTE section */
-typedef struct elf64_note {
-  Elf64_Word n_namesz; /* Name size */
-  Elf64_Word n_descsz; /* Content size */
-  Elf64_Word n_type;   /* Content type */
-} Elf64_Nhdr;
+#include <uapi/linux/elf.h>
 
-#ifdef __KERNEL__
 #ifndef elf_read_implies_exec
   /* Executables for which elf_read_implies_exec() returns TRUE will
      have the READ_IMPLIES_EXEC personality flag set automatically.
@@ -455,5 +44,4 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
 extern int elf_coredump_extra_notes_size(void);
 extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
 #endif
-#endif /* __KERNEL__ */
 #endif /* _LINUX_ELF_H */
index 0698c79fbcb2c19453d73e15ad4d903e8b610cc3..cdd3d13efce7c24da5e65fc3d651b1564c3a20e0 100644 (file)
 #ifndef _LINUX_ELFCORE_H
 #define _LINUX_ELFCORE_H
 
-#include <linux/types.h>
-#include <linux/signal.h>
-#include <linux/time.h>
-#ifdef __KERNEL__
 #include <linux/user.h>
 #include <linux/bug.h>
-#endif
-#include <linux/ptrace.h>
-#include <linux/elf.h>
-#include <linux/fs.h>
-
-struct elf_siginfo
-{
-       int     si_signo;                       /* signal number */
-       int     si_code;                        /* extra code */
-       int     si_errno;                       /* errno */
-};
-
-#ifdef __KERNEL__
 #include <asm/elf.h>
-#endif
+#include <uapi/linux/elfcore.h>
 
-#ifndef __KERNEL__
-typedef elf_greg_t greg_t;
-typedef elf_gregset_t gregset_t;
-typedef elf_fpregset_t fpregset_t;
-typedef elf_fpxregset_t fpxregset_t;
-#define NGREG ELF_NGREG
-#endif
-
-/*
- * Definitions to generate Intel SVR4-like core files.
- * These mostly have the same names as the SVR4 types with "elf_"
- * tacked on the front to prevent clashes with linux definitions,
- * and the typedef forms have been avoided.  This is mostly like
- * the SVR4 structure, but more Linuxy, with things that Linux does
- * not support and which gdb doesn't really use excluded.
- * Fields present but not used are marked with "XXX".
- */
-struct elf_prstatus
-{
-#if 0
-       long    pr_flags;       /* XXX Process flags */
-       short   pr_why;         /* XXX Reason for process halt */
-       short   pr_what;        /* XXX More detailed reason */
-#endif
-       struct elf_siginfo pr_info;     /* Info associated with signal */
-       short   pr_cursig;              /* Current signal */
-       unsigned long pr_sigpend;       /* Set of pending signals */
-       unsigned long pr_sighold;       /* Set of held signals */
-#if 0
-       struct sigaltstack pr_altstack; /* Alternate stack info */
-       struct sigaction pr_action;     /* Signal action for current sig */
-#endif
-       pid_t   pr_pid;
-       pid_t   pr_ppid;
-       pid_t   pr_pgrp;
-       pid_t   pr_sid;
-       struct timeval pr_utime;        /* User time */
-       struct timeval pr_stime;        /* System time */
-       struct timeval pr_cutime;       /* Cumulative user time */
-       struct timeval pr_cstime;       /* Cumulative system time */
-#if 0
-       long    pr_instr;               /* Current instruction */
-#endif
-       elf_gregset_t pr_reg;   /* GP registers */
-#ifdef CONFIG_BINFMT_ELF_FDPIC
-       /* When using FDPIC, the loadmap addresses need to be communicated
-        * to GDB in order for GDB to do the necessary relocations.  The
-        * fields (below) used to communicate this information are placed
-        * immediately after ``pr_reg'', so that the loadmap addresses may
-        * be viewed as part of the register set if so desired.
-        */
-       unsigned long pr_exec_fdpic_loadmap;
-       unsigned long pr_interp_fdpic_loadmap;
-#endif
-       int pr_fpvalid;         /* True if math co-processor being used.  */
-};
-
-#define ELF_PRARGSZ    (80)    /* Number of chars for args */
-
-struct elf_prpsinfo
-{
-       char    pr_state;       /* numeric process state */
-       char    pr_sname;       /* char for pr_state */
-       char    pr_zomb;        /* zombie */
-       char    pr_nice;        /* nice val */
-       unsigned long pr_flag;  /* flags */
-       __kernel_uid_t  pr_uid;
-       __kernel_gid_t  pr_gid;
-       pid_t   pr_pid, pr_ppid, pr_pgrp, pr_sid;
-       /* Lots missing */
-       char    pr_fname[16];   /* filename of executable */
-       char    pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
-};
-
-#ifndef __KERNEL__
-typedef struct elf_prstatus prstatus_t;
-typedef struct elf_prpsinfo prpsinfo_t;
-#define PRARGSZ ELF_PRARGSZ 
-#endif
-
-#ifdef __KERNEL__
 static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
 {
 #ifdef ELF_CORE_COPY_REGS
@@ -167,6 +69,4 @@ extern int
 elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
 extern size_t elf_core_extra_data_size(void);
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_ELFCORE_H */
index e0de516374da37de6a95c35e79ab7cabb899d177..f6bf082d4d4f3afdf4fedcd606c1d15d7120b84c 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _LINUX_ERRNO_H
 #define _LINUX_ERRNO_H
 
-#include <asm/errno.h>
+#include <uapi/linux/errno.h>
 
-#ifdef __KERNEL__
 
 /*
  * These should never be seen by user programs.  To return one of ERESTART*
@@ -32,5 +31,3 @@
 #define EIOCBRETRY     530     /* iocb queued, will trigger a retry */
 
 #endif
-
-#endif
index fd0628be45ce22ecc07ff1be9db1cdc18fdf2b80..9ca23fcfb5d73131b564ad81d887929abc0e954b 100644 (file)
@@ -1,33 +1,12 @@
 #ifndef _LINUX_ERRQUEUE_H
 #define _LINUX_ERRQUEUE_H 1
 
-#include <linux/types.h>
-
-struct sock_extended_err {
-       __u32   ee_errno;       
-       __u8    ee_origin;
-       __u8    ee_type;
-       __u8    ee_code;
-       __u8    ee_pad;
-       __u32   ee_info;
-       __u32   ee_data;
-};
-
-#define SO_EE_ORIGIN_NONE      0
-#define SO_EE_ORIGIN_LOCAL     1
-#define SO_EE_ORIGIN_ICMP      2
-#define SO_EE_ORIGIN_ICMP6     3
-#define SO_EE_ORIGIN_TXSTATUS  4
-#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
-
-#define SO_EE_OFFENDER(ee)     ((struct sockaddr*)((ee)+1))
-
-#ifdef __KERNEL__
 
 #include <net/ip.h>
 #if IS_ENABLED(CONFIG_IPV6)
 #include <linux/ipv6.h>
 #endif
+#include <uapi/linux/errqueue.h>
 
 #define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
 
@@ -44,5 +23,3 @@ struct sock_exterr_skb {
 };
 
 #endif
-
-#endif
index fcb4f8e60c1cbe8aa4b0f190cdd7815d25057f2c..c8e3e7e39c6bf26ffbfe534cdfa83f59ad561372 100644 (file)
  *                                scott.feldman@intel.com)
  * Portions Copyright (C) Sun Microsystems 2008
  */
-
 #ifndef _LINUX_ETHTOOL_H
 #define _LINUX_ETHTOOL_H
 
-#ifdef __KERNEL__
 #include <linux/compat.h>
-#endif
-#include <linux/types.h>
-#include <linux/if_ether.h>
-
-/* This should work for both 32 and 64 bit userland. */
-struct ethtool_cmd {
-       __u32   cmd;
-       __u32   supported;      /* Features this interface supports */
-       __u32   advertising;    /* Features this interface advertises */
-       __u16   speed;          /* The forced speed (lower bits) in
-                                * Mbps. Please use
-                                * ethtool_cmd_speed()/_set() to
-                                * access it */
-       __u8    duplex;         /* Duplex, half or full */
-       __u8    port;           /* Which connector port */
-       __u8    phy_address;    /* MDIO PHY address (PRTAD for clause 45).
-                                * May be read-only or read-write
-                                * depending on the driver.
-                                */
-       __u8    transceiver;    /* Which transceiver to use */
-       __u8    autoneg;        /* Enable or disable autonegotiation */
-       __u8    mdio_support;   /* MDIO protocols supported.  Read-only.
-                                * Not set by all drivers.
-                                */
-       __u32   maxtxpkt;       /* Tx pkts before generating tx int */
-       __u32   maxrxpkt;       /* Rx pkts before generating rx int */
-       __u16   speed_hi;       /* The forced speed (upper
-                                * bits) in Mbps. Please use
-                                * ethtool_cmd_speed()/_set() to
-                                * access it */
-       __u8    eth_tp_mdix;    /* twisted pair MDI-X status */
-       __u8    eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
-                                  * link should be renegotiated if necessary
-                                  */
-       __u32   lp_advertising; /* Features the link partner advertises */
-       __u32   reserved[2];
-};
-
-static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
-                                        __u32 speed)
-{
-
-       ep->speed = (__u16)speed;
-       ep->speed_hi = (__u16)(speed >> 16);
-}
-
-static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
-{
-       return (ep->speed_hi << 16) | ep->speed;
-}
-
-/* Device supports clause 22 register access to PHY or peripherals
- * using the interface defined in <linux/mii.h>.  This should not be
- * set if there are known to be no such peripherals present or if
- * the driver only emulates clause 22 registers for compatibility.
- */
-#define ETH_MDIO_SUPPORTS_C22  1
-
-/* Device supports clause 45 register access to PHY or peripherals
- * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
- * This should not be set if there are known to be no such peripherals
- * present.
- */
-#define ETH_MDIO_SUPPORTS_C45  2
-
-#define ETHTOOL_FWVERS_LEN     32
-#define ETHTOOL_BUSINFO_LEN    32
-/* these strings are set to whatever the driver author decides... */
-struct ethtool_drvinfo {
-       __u32   cmd;
-       char    driver[32];     /* driver short name, "tulip", "eepro100" */
-       char    version[32];    /* driver version string */
-       char    fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
-       char    bus_info[ETHTOOL_BUSINFO_LEN];  /* Bus info for this IF. */
-                               /* For PCI devices, use pci_name(pci_dev). */
-       char    reserved1[32];
-       char    reserved2[12];
-                               /*
-                                * Some struct members below are filled in
-                                * using ops->get_sset_count().  Obtaining
-                                * this info from ethtool_drvinfo is now
-                                * deprecated; Use ETHTOOL_GSSET_INFO
-                                * instead.
-                                */
-       __u32   n_priv_flags;   /* number of flags valid in ETHTOOL_GPFLAGS */
-       __u32   n_stats;        /* number of u64's from ETHTOOL_GSTATS */
-       __u32   testinfo_len;
-       __u32   eedump_len;     /* Size of data from ETHTOOL_GEEPROM (bytes) */
-       __u32   regdump_len;    /* Size of data from ETHTOOL_GREGS (bytes) */
-};
-
-#define SOPASS_MAX     6
-/* wake-on-lan settings */
-struct ethtool_wolinfo {
-       __u32   cmd;
-       __u32   supported;
-       __u32   wolopts;
-       __u8    sopass[SOPASS_MAX]; /* SecureOn(tm) password */
-};
-
-/* for passing single values */
-struct ethtool_value {
-       __u32   cmd;
-       __u32   data;
-};
-
-/* for passing big chunks of data */
-struct ethtool_regs {
-       __u32   cmd;
-       __u32   version; /* driver-specific, indicates different chips/revs */
-       __u32   len; /* bytes */
-       __u8    data[0];
-};
-
-/* for passing EEPROM chunks */
-struct ethtool_eeprom {
-       __u32   cmd;
-       __u32   magic;
-       __u32   offset; /* in bytes */
-       __u32   len; /* in bytes */
-       __u8    data[0];
-};
-
-/**
- * struct ethtool_eee - Energy Efficient Ethernet information
- * @cmd: ETHTOOL_{G,S}EEE
- * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
- *     for which there is EEE support.
- * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
- *     advertised as eee capable.
- * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
- *     combinations advertised by the link partner as eee capable.
- * @eee_active: Result of the eee auto negotiation.
- * @eee_enabled: EEE configured mode (enabled/disabled).
- * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
- *     that eee was negotiated.
- * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
- *     its tx lpi (after reaching 'idle' state). Effective only when eee
- *     was negotiated and tx_lpi_enabled was set.
- */
-struct ethtool_eee {
-       __u32   cmd;
-       __u32   supported;
-       __u32   advertised;
-       __u32   lp_advertised;
-       __u32   eee_active;
-       __u32   eee_enabled;
-       __u32   tx_lpi_enabled;
-       __u32   tx_lpi_timer;
-       __u32   reserved[2];
-};
-
-/**
- * struct ethtool_modinfo - plugin module eeprom information
- * @cmd: %ETHTOOL_GMODULEINFO
- * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
- * @eeprom_len: Length of the eeprom
- *
- * This structure is used to return the information to
- * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
- * The type code indicates the eeprom data format
- */
-struct ethtool_modinfo {
-       __u32   cmd;
-       __u32   type;
-       __u32   eeprom_len;
-       __u32   reserved[8];
-};
-
-/**
- * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
- * @cmd: ETHTOOL_{G,S}COALESCE
- * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
- *     a packet arrives.
- * @rx_max_coalesced_frames: Maximum number of packets to receive
- *     before an RX interrupt.
- * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
- *     this value applies while an IRQ is being serviced by the host.
- * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
- *     except that this value applies while an IRQ is being serviced
- *     by the host.
- * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
- *     a packet is sent.
- * @tx_max_coalesced_frames: Maximum number of packets to be sent
- *     before a TX interrupt.
- * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
- *     this value applies while an IRQ is being serviced by the host.
- * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
- *     except that this value applies while an IRQ is being serviced
- *     by the host.
- * @stats_block_coalesce_usecs: How many usecs to delay in-memory
- *     statistics block updates.  Some drivers do not have an
- *     in-memory statistic block, and in such cases this value is
- *     ignored.  This value must not be zero.
- * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
- * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
- * @pkt_rate_low: Threshold for low packet rate (packets per second).
- * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
- *     a packet arrives, when the packet rate is below @pkt_rate_low.
- * @rx_max_coalesced_frames_low: Maximum number of packets to be received
- *     before an RX interrupt, when the packet rate is below @pkt_rate_low.
- * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
- *     a packet is sent, when the packet rate is below @pkt_rate_low.
- * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
- *     a TX interrupt, when the packet rate is below @pkt_rate_low.
- * @pkt_rate_high: Threshold for high packet rate (packets per second).
- * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
- *     a packet arrives, when the packet rate is above @pkt_rate_high.
- * @rx_max_coalesced_frames_high: Maximum number of packets to be received
- *     before an RX interrupt, when the packet rate is above @pkt_rate_high.
- * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
- *     a packet is sent, when the packet rate is above @pkt_rate_high.
- * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
- *     a TX interrupt, when the packet rate is above @pkt_rate_high.
- * @rate_sample_interval: How often to do adaptive coalescing packet rate
- *     sampling, measured in seconds.  Must not be zero.
- *
- * Each pair of (usecs, max_frames) fields specifies this exit
- * condition for interrupt coalescing:
- *     (usecs > 0 && time_since_first_completion >= usecs) ||
- *     (max_frames > 0 && completed_frames >= max_frames)
- * It is illegal to set both usecs and max_frames to zero as this
- * would cause interrupts to never be generated.  To disable
- * coalescing, set usecs = 0 and max_frames = 1.
- *
- * Some implementations ignore the value of max_frames and use the
- * condition:
- *     time_since_first_completion >= usecs
- * This is deprecated.  Drivers for hardware that does not support
- * counting completions should validate that max_frames == !rx_usecs.
- *
- * Adaptive RX/TX coalescing is an algorithm implemented by some
- * drivers to improve latency under low packet rates and improve
- * throughput under high packet rates.  Some drivers only implement
- * one of RX or TX adaptive coalescing.  Anything not implemented by
- * the driver causes these values to be silently ignored.
- *
- * When the packet rate is below @pkt_rate_high but above
- * @pkt_rate_low (both measured in packets per second) the
- * normal {rx,tx}_* coalescing parameters are used.
- */
-struct ethtool_coalesce {
-       __u32   cmd;
-       __u32   rx_coalesce_usecs;
-       __u32   rx_max_coalesced_frames;
-       __u32   rx_coalesce_usecs_irq;
-       __u32   rx_max_coalesced_frames_irq;
-       __u32   tx_coalesce_usecs;
-       __u32   tx_max_coalesced_frames;
-       __u32   tx_coalesce_usecs_irq;
-       __u32   tx_max_coalesced_frames_irq;
-       __u32   stats_block_coalesce_usecs;
-       __u32   use_adaptive_rx_coalesce;
-       __u32   use_adaptive_tx_coalesce;
-       __u32   pkt_rate_low;
-       __u32   rx_coalesce_usecs_low;
-       __u32   rx_max_coalesced_frames_low;
-       __u32   tx_coalesce_usecs_low;
-       __u32   tx_max_coalesced_frames_low;
-       __u32   pkt_rate_high;
-       __u32   rx_coalesce_usecs_high;
-       __u32   rx_max_coalesced_frames_high;
-       __u32   tx_coalesce_usecs_high;
-       __u32   tx_max_coalesced_frames_high;
-       __u32   rate_sample_interval;
-};
-
-/* for configuring RX/TX ring parameters */
-struct ethtool_ringparam {
-       __u32   cmd;    /* ETHTOOL_{G,S}RINGPARAM */
-
-       /* Read only attributes.  These indicate the maximum number
-        * of pending RX/TX ring entries the driver will allow the
-        * user to set.
-        */
-       __u32   rx_max_pending;
-       __u32   rx_mini_max_pending;
-       __u32   rx_jumbo_max_pending;
-       __u32   tx_max_pending;
-
-       /* Values changeable by the user.  The valid values are
-        * in the range 1 to the "*_max_pending" counterpart above.
-        */
-       __u32   rx_pending;
-       __u32   rx_mini_pending;
-       __u32   rx_jumbo_pending;
-       __u32   tx_pending;
-};
-
-/**
- * struct ethtool_channels - configuring number of network channel
- * @cmd: ETHTOOL_{G,S}CHANNELS
- * @max_rx: Read only. Maximum number of receive channel the driver support.
- * @max_tx: Read only. Maximum number of transmit channel the driver support.
- * @max_other: Read only. Maximum number of other channel the driver support.
- * @max_combined: Read only. Maximum number of combined channel the driver
- *     support. Set of queues RX, TX or other.
- * @rx_count: Valid values are in the range 1 to the max_rx.
- * @tx_count: Valid values are in the range 1 to the max_tx.
- * @other_count: Valid values are in the range 1 to the max_other.
- * @combined_count: Valid values are in the range 1 to the max_combined.
- *
- * This can be used to configure RX, TX and other channels.
- */
-
-struct ethtool_channels {
-       __u32   cmd;
-       __u32   max_rx;
-       __u32   max_tx;
-       __u32   max_other;
-       __u32   max_combined;
-       __u32   rx_count;
-       __u32   tx_count;
-       __u32   other_count;
-       __u32   combined_count;
-};
-
-/* for configuring link flow control parameters */
-struct ethtool_pauseparam {
-       __u32   cmd;    /* ETHTOOL_{G,S}PAUSEPARAM */
-
-       /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
-        * being true) the user may set 'autoneg' here non-zero to have the
-        * pause parameters be auto-negotiated too.  In such a case, the
-        * {rx,tx}_pause values below determine what capabilities are
-        * advertised.
-        *
-        * If 'autoneg' is zero or the link is not being auto-negotiated,
-        * then {rx,tx}_pause force the driver to use/not-use pause
-        * flow control.
-        */
-       __u32   autoneg;
-       __u32   rx_pause;
-       __u32   tx_pause;
-};
-
-#define ETH_GSTRING_LEN                32
-enum ethtool_stringset {
-       ETH_SS_TEST             = 0,
-       ETH_SS_STATS,
-       ETH_SS_PRIV_FLAGS,
-       ETH_SS_NTUPLE_FILTERS,  /* Do not use, GRXNTUPLE is now deprecated */
-       ETH_SS_FEATURES,
-};
-
-/* for passing string sets for data tagging */
-struct ethtool_gstrings {
-       __u32   cmd;            /* ETHTOOL_GSTRINGS */
-       __u32   string_set;     /* string set id e.c. ETH_SS_TEST, etc*/
-       __u32   len;            /* number of strings in the string set */
-       __u8    data[0];
-};
-
-struct ethtool_sset_info {
-       __u32   cmd;            /* ETHTOOL_GSSET_INFO */
-       __u32   reserved;
-       __u64   sset_mask;      /* input: each bit selects an sset to query */
-                               /* output: each bit a returned sset */
-       __u32   data[0];        /* ETH_SS_xxx count, in order, based on bits
-                                  in sset_mask.  One bit implies one
-                                  __u32, two bits implies two
-                                  __u32's, etc. */
-};
-
-/**
- * enum ethtool_test_flags - flags definition of ethtool_test
- * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
- *     only online tests.
- * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
- * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
- *     test.
- * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
- */
-
-enum ethtool_test_flags {
-       ETH_TEST_FL_OFFLINE     = (1 << 0),
-       ETH_TEST_FL_FAILED      = (1 << 1),
-       ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
-       ETH_TEST_FL_EXTERNAL_LB_DONE    = (1 << 3),
-};
-
-/* for requesting NIC test and getting results*/
-struct ethtool_test {
-       __u32   cmd;            /* ETHTOOL_TEST */
-       __u32   flags;          /* ETH_TEST_FL_xxx */
-       __u32   reserved;
-       __u32   len;            /* result length, in number of u64 elements */
-       __u64   data[0];
-};
-
-/* for dumping NIC-specific statistics */
-struct ethtool_stats {
-       __u32   cmd;            /* ETHTOOL_GSTATS */
-       __u32   n_stats;        /* number of u64's being returned */
-       __u64   data[0];
-};
-
-struct ethtool_perm_addr {
-       __u32   cmd;            /* ETHTOOL_GPERMADDR */
-       __u32   size;
-       __u8    data[0];
-};
-
-/* boolean flags controlling per-interface behavior characteristics.
- * When reading, the flag indicates whether or not a certain behavior
- * is enabled/present.  When writing, the flag indicates whether
- * or not the driver should turn on (set) or off (clear) a behavior.
- *
- * Some behaviors may read-only (unconditionally absent or present).
- * If such is the case, return EINVAL in the set-flags operation if the
- * flag differs from the read-only value.
- */
-enum ethtool_flags {
-       ETH_FLAG_TXVLAN         = (1 << 7),     /* TX VLAN offload enabled */
-       ETH_FLAG_RXVLAN         = (1 << 8),     /* RX VLAN offload enabled */
-       ETH_FLAG_LRO            = (1 << 15),    /* LRO is enabled */
-       ETH_FLAG_NTUPLE         = (1 << 27),    /* N-tuple filters enabled */
-       ETH_FLAG_RXHASH         = (1 << 28),
-};
+#include <uapi/linux/ethtool.h>
 
-/* The following structures are for supporting RX network flow
- * classification and RX n-tuple configuration. Note, all multibyte
- * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
- * be in network byte order.
- */
-
-/**
- * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
- * @ip4src: Source host
- * @ip4dst: Destination host
- * @psrc: Source port
- * @pdst: Destination port
- * @tos: Type-of-service
- *
- * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
- */
-struct ethtool_tcpip4_spec {
-       __be32  ip4src;
-       __be32  ip4dst;
-       __be16  psrc;
-       __be16  pdst;
-       __u8    tos;
-};
-
-/**
- * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
- * @ip4src: Source host
- * @ip4dst: Destination host
- * @spi: Security parameters index
- * @tos: Type-of-service
- *
- * This can be used to specify an IPsec transport or tunnel over IPv4.
- */
-struct ethtool_ah_espip4_spec {
-       __be32  ip4src;
-       __be32  ip4dst;
-       __be32  spi;
-       __u8    tos;
-};
-
-#define        ETH_RX_NFC_IP4  1
-
-/**
- * struct ethtool_usrip4_spec - general flow specification for IPv4
- * @ip4src: Source host
- * @ip4dst: Destination host
- * @l4_4_bytes: First 4 bytes of transport (layer 4) header
- * @tos: Type-of-service
- * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
- * @proto: Transport protocol number; mask must be 0
- */
-struct ethtool_usrip4_spec {
-       __be32  ip4src;
-       __be32  ip4dst;
-       __be32  l4_4_bytes;
-       __u8    tos;
-       __u8    ip_ver;
-       __u8    proto;
-};
-
-union ethtool_flow_union {
-       struct ethtool_tcpip4_spec              tcp_ip4_spec;
-       struct ethtool_tcpip4_spec              udp_ip4_spec;
-       struct ethtool_tcpip4_spec              sctp_ip4_spec;
-       struct ethtool_ah_espip4_spec           ah_ip4_spec;
-       struct ethtool_ah_espip4_spec           esp_ip4_spec;
-       struct ethtool_usrip4_spec              usr_ip4_spec;
-       struct ethhdr                           ether_spec;
-       __u8                                    hdata[60];
-};
-
-struct ethtool_flow_ext {
-       __be16  vlan_etype;
-       __be16  vlan_tci;
-       __be32  data[2];
-};
-
-/**
- * struct ethtool_rx_flow_spec - classification rule for RX flows
- * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
- * @h_u: Flow fields to match (dependent on @flow_type)
- * @h_ext: Additional fields to match
- * @m_u: Masks for flow field bits to be matched
- * @m_ext: Masks for additional field bits to be matched
- *     Note, all additional fields must be ignored unless @flow_type
- *     includes the %FLOW_EXT flag.
- * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
- *     if packets should be discarded
- * @location: Location of rule in the table.  Locations must be
- *     numbered such that a flow matching multiple rules will be
- *     classified according to the first (lowest numbered) rule.
- */
-struct ethtool_rx_flow_spec {
-       __u32           flow_type;
-       union ethtool_flow_union h_u;
-       struct ethtool_flow_ext h_ext;
-       union ethtool_flow_union m_u;
-       struct ethtool_flow_ext m_ext;
-       __u64           ring_cookie;
-       __u32           location;
-};
-
-/**
- * struct ethtool_rxnfc - command to get or set RX flow classification rules
- * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
- *     %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
- *     %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
- * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
- * @data: Command-dependent value
- * @fs: Flow classification rule
- * @rule_cnt: Number of rules to be affected
- * @rule_locs: Array of used rule locations
- *
- * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
- * the fields included in the flow hash, e.g. %RXH_IP_SRC.  The following
- * structure fields must not be used.
- *
- * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
- * on return.
- *
- * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
- * rules on return.  If @data is non-zero on return then it is the
- * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
- * driver supports any special location values.  If that flag is not
- * set in @data then special location values should not be used.
- *
- * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
- * existing rule on entry and @fs contains the rule on return.
- *
- * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
- * user buffer for @rule_locs on entry.  On return, @data is the size
- * of the rule table, @rule_cnt is the number of defined rules, and
- * @rule_locs contains the locations of the defined rules.  Drivers
- * must use the second parameter to get_rxnfc() instead of @rule_locs.
- *
- * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
- * @fs.@location either specifies the location to use or is a special
- * location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
- * @fs.@location is the actual rule location.
- *
- * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
- * existing rule on entry.
- *
- * A driver supporting the special location values for
- * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
- * location, and may remove a rule at a later location (lower
- * priority) that matches exactly the same set of flows.  The special
- * values are: %RX_CLS_LOC_ANY, selecting any location;
- * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
- * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
- * location (minimum priority).  Additional special values may be
- * defined in future and drivers must return -%EINVAL for any
- * unrecognised value.
- */
-struct ethtool_rxnfc {
-       __u32                           cmd;
-       __u32                           flow_type;
-       __u64                           data;
-       struct ethtool_rx_flow_spec     fs;
-       __u32                           rule_cnt;
-       __u32                           rule_locs[0];
-};
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 
 struct compat_ethtool_rx_flow_spec {
@@ -621,223 +37,6 @@ struct compat_ethtool_rxnfc {
 };
 
 #endif /* CONFIG_COMPAT */
-#endif /* __KERNEL__ */
-
-/**
- * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
- * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
- * @size: On entry, the array size of the user buffer, which may be zero.
- *     On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
- *     indirection table.
- * @ring_index: RX ring/queue index for each hash value
- *
- * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
- * should be returned.  For %ETHTOOL_SRXFHINDIR, a @size of zero means
- * the table should be reset to default values.  This last feature
- * is not supported by the original implementations.
- */
-struct ethtool_rxfh_indir {
-       __u32   cmd;
-       __u32   size;
-       __u32   ring_index[0];
-};
-
-/**
- * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
- * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
- * @h_u: Flow field values to match (dependent on @flow_type)
- * @m_u: Masks for flow field value bits to be ignored
- * @vlan_tag: VLAN tag to match
- * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
- * @data: Driver-dependent data to match
- * @data_mask: Mask for driver-dependent data bits to be ignored
- * @action: RX ring/queue index to deliver to (non-negative) or other action
- *     (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
- *
- * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
- * a field value and mask are both zero this is treated as if all mask
- * bits are set i.e. the field is ignored.
- */
-struct ethtool_rx_ntuple_flow_spec {
-       __u32            flow_type;
-       union {
-               struct ethtool_tcpip4_spec              tcp_ip4_spec;
-               struct ethtool_tcpip4_spec              udp_ip4_spec;
-               struct ethtool_tcpip4_spec              sctp_ip4_spec;
-               struct ethtool_ah_espip4_spec           ah_ip4_spec;
-               struct ethtool_ah_espip4_spec           esp_ip4_spec;
-               struct ethtool_usrip4_spec              usr_ip4_spec;
-               struct ethhdr                           ether_spec;
-               __u8                                    hdata[72];
-       } h_u, m_u;
-
-       __u16           vlan_tag;
-       __u16           vlan_tag_mask;
-       __u64           data;
-       __u64           data_mask;
-
-       __s32           action;
-#define ETHTOOL_RXNTUPLE_ACTION_DROP   (-1)    /* drop packet */
-#define ETHTOOL_RXNTUPLE_ACTION_CLEAR  (-2)    /* clear filter */
-};
-
-/**
- * struct ethtool_rx_ntuple - command to set or clear RX flow filter
- * @cmd: Command number - %ETHTOOL_SRXNTUPLE
- * @fs: Flow filter specification
- */
-struct ethtool_rx_ntuple {
-       __u32                                   cmd;
-       struct ethtool_rx_ntuple_flow_spec      fs;
-};
-
-#define ETHTOOL_FLASH_MAX_FILENAME     128
-enum ethtool_flash_op_type {
-       ETHTOOL_FLASH_ALL_REGIONS       = 0,
-};
-
-/* for passing firmware flashing related parameters */
-struct ethtool_flash {
-       __u32   cmd;
-       __u32   region;
-       char    data[ETHTOOL_FLASH_MAX_FILENAME];
-};
-
-/**
- * struct ethtool_dump - used for retrieving, setting device dump
- * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
- *     %ETHTOOL_SET_DUMP
- * @version: FW version of the dump, filled in by driver
- * @flag: driver dependent flag for dump setting, filled in by driver during
- *        get and filled in by ethtool for set operation.
- *        flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
- *        firmware dump is disabled.
- * @len: length of dump data, used as the length of the user buffer on entry to
- *      %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
- *      for %ETHTOOL_GET_DUMP_FLAG command
- * @data: data collected for get dump data operation
- */
-
-#define ETH_FW_DUMP_DISABLE 0
-
-struct ethtool_dump {
-       __u32   cmd;
-       __u32   version;
-       __u32   flag;
-       __u32   len;
-       __u8    data[0];
-};
-
-/* for returning and changing feature sets */
-
-/**
- * struct ethtool_get_features_block - block with state of 32 features
- * @available: mask of changeable features
- * @requested: mask of features requested to be enabled if possible
- * @active: mask of currently enabled features
- * @never_changed: mask of features not changeable for any device
- */
-struct ethtool_get_features_block {
-       __u32   available;
-       __u32   requested;
-       __u32   active;
-       __u32   never_changed;
-};
-
-/**
- * struct ethtool_gfeatures - command to get state of device's features
- * @cmd: command number = %ETHTOOL_GFEATURES
- * @size: in: number of elements in the features[] array;
- *       out: number of elements in features[] needed to hold all features
- * @features: state of features
- */
-struct ethtool_gfeatures {
-       __u32   cmd;
-       __u32   size;
-       struct ethtool_get_features_block features[0];
-};
-
-/**
- * struct ethtool_set_features_block - block with request for 32 features
- * @valid: mask of features to be changed
- * @requested: values of features to be changed
- */
-struct ethtool_set_features_block {
-       __u32   valid;
-       __u32   requested;
-};
-
-/**
- * struct ethtool_sfeatures - command to request change in device's features
- * @cmd: command number = %ETHTOOL_SFEATURES
- * @size: array size of the features[] array
- * @features: feature change masks
- */
-struct ethtool_sfeatures {
-       __u32   cmd;
-       __u32   size;
-       struct ethtool_set_features_block features[0];
-};
-
-/**
- * struct ethtool_ts_info - holds a device's timestamping and PHC association
- * @cmd: command number = %ETHTOOL_GET_TS_INFO
- * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
- * @phc_index: device index of the associated PHC, or -1 if there is none
- * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
- * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
- *
- * The bits in the 'tx_types' and 'rx_filters' fields correspond to
- * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
- * respectively.  For example, if the device supports HWTSTAMP_TX_ON,
- * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
- */
-struct ethtool_ts_info {
-       __u32   cmd;
-       __u32   so_timestamping;
-       __s32   phc_index;
-       __u32   tx_types;
-       __u32   tx_reserved[3];
-       __u32   rx_filters;
-       __u32   rx_reserved[3];
-};
-
-/*
- * %ETHTOOL_SFEATURES changes features present in features[].valid to the
- * values of corresponding bits in features[].requested. Bits in .requested
- * not set in .valid or not changeable are ignored.
- *
- * Returns %EINVAL when .valid contains undefined or never-changeable bits
- * or size is not equal to required number of features words (32-bit blocks).
- * Returns >= 0 if request was completed; bits set in the value mean:
- *   %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
- *     changeable (not present in %ETHTOOL_GFEATURES' features[].available)
- *     those bits were ignored.
- *   %ETHTOOL_F_WISH - some or all changes requested were recorded but the
- *      resulting state of bits masked by .valid is not equal to .requested.
- *      Probably there are other device-specific constraints on some features
- *      in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
- *      here as though ignored bits were cleared.
- *   %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
- *      compatibility functions. Requested offload state cannot be properly
- *      managed by kernel.
- *
- * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
- * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
- * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
- * significant bit in features[0] fields. Empty strings mark undefined features.
- */
-enum ethtool_sfeatures_retval_bits {
-       ETHTOOL_F_UNSUPPORTED__BIT,
-       ETHTOOL_F_WISH__BIT,
-       ETHTOOL_F_COMPAT__BIT,
-};
-
-#define ETHTOOL_F_UNSUPPORTED   (1 << ETHTOOL_F_UNSUPPORTED__BIT)
-#define ETHTOOL_F_WISH          (1 << ETHTOOL_F_WISH__BIT)
-#define ETHTOOL_F_COMPAT        (1 << ETHTOOL_F_COMPAT__BIT)
-
-#ifdef __KERNEL__
 
 #include <linux/rculist.h>
 
@@ -1049,277 +248,4 @@ struct ethtool_ops {
 
 
 };
-#endif /* __KERNEL__ */
-
-/* CMDs currently supported */
-#define ETHTOOL_GSET           0x00000001 /* Get settings. */
-#define ETHTOOL_SSET           0x00000002 /* Set settings. */
-#define ETHTOOL_GDRVINFO       0x00000003 /* Get driver info. */
-#define ETHTOOL_GREGS          0x00000004 /* Get NIC registers. */
-#define ETHTOOL_GWOL           0x00000005 /* Get wake-on-lan options. */
-#define ETHTOOL_SWOL           0x00000006 /* Set wake-on-lan options. */
-#define ETHTOOL_GMSGLVL                0x00000007 /* Get driver message level */
-#define ETHTOOL_SMSGLVL                0x00000008 /* Set driver msg level. */
-#define ETHTOOL_NWAY_RST       0x00000009 /* Restart autonegotiation. */
-/* Get link status for host, i.e. whether the interface *and* the
- * physical port (if there is one) are up (ethtool_value). */
-#define ETHTOOL_GLINK          0x0000000a
-#define ETHTOOL_GEEPROM                0x0000000b /* Get EEPROM data */
-#define ETHTOOL_SEEPROM                0x0000000c /* Set EEPROM data. */
-#define ETHTOOL_GCOALESCE      0x0000000e /* Get coalesce config */
-#define ETHTOOL_SCOALESCE      0x0000000f /* Set coalesce config. */
-#define ETHTOOL_GRINGPARAM     0x00000010 /* Get ring parameters */
-#define ETHTOOL_SRINGPARAM     0x00000011 /* Set ring parameters. */
-#define ETHTOOL_GPAUSEPARAM    0x00000012 /* Get pause parameters */
-#define ETHTOOL_SPAUSEPARAM    0x00000013 /* Set pause parameters. */
-#define ETHTOOL_GRXCSUM                0x00000014 /* Get RX hw csum enable (ethtool_value) */
-#define ETHTOOL_SRXCSUM                0x00000015 /* Set RX hw csum enable (ethtool_value) */
-#define ETHTOOL_GTXCSUM                0x00000016 /* Get TX hw csum enable (ethtool_value) */
-#define ETHTOOL_STXCSUM                0x00000017 /* Set TX hw csum enable (ethtool_value) */
-#define ETHTOOL_GSG            0x00000018 /* Get scatter-gather enable
-                                           * (ethtool_value) */
-#define ETHTOOL_SSG            0x00000019 /* Set scatter-gather enable
-                                           * (ethtool_value). */
-#define ETHTOOL_TEST           0x0000001a /* execute NIC self-test. */
-#define ETHTOOL_GSTRINGS       0x0000001b /* get specified string set */
-#define ETHTOOL_PHYS_ID                0x0000001c /* identify the NIC */
-#define ETHTOOL_GSTATS         0x0000001d /* get NIC-specific statistics */
-#define ETHTOOL_GTSO           0x0000001e /* Get TSO enable (ethtool_value) */
-#define ETHTOOL_STSO           0x0000001f /* Set TSO enable (ethtool_value) */
-#define ETHTOOL_GPERMADDR      0x00000020 /* Get permanent hardware address */
-#define ETHTOOL_GUFO           0x00000021 /* Get UFO enable (ethtool_value) */
-#define ETHTOOL_SUFO           0x00000022 /* Set UFO enable (ethtool_value) */
-#define ETHTOOL_GGSO           0x00000023 /* Get GSO enable (ethtool_value) */
-#define ETHTOOL_SGSO           0x00000024 /* Set GSO enable (ethtool_value) */
-#define ETHTOOL_GFLAGS         0x00000025 /* Get flags bitmap(ethtool_value) */
-#define ETHTOOL_SFLAGS         0x00000026 /* Set flags bitmap(ethtool_value) */
-#define ETHTOOL_GPFLAGS                0x00000027 /* Get driver-private flags bitmap */
-#define ETHTOOL_SPFLAGS                0x00000028 /* Set driver-private flags bitmap */
-
-#define ETHTOOL_GRXFH          0x00000029 /* Get RX flow hash configuration */
-#define ETHTOOL_SRXFH          0x0000002a /* Set RX flow hash configuration */
-#define ETHTOOL_GGRO           0x0000002b /* Get GRO enable (ethtool_value) */
-#define ETHTOOL_SGRO           0x0000002c /* Set GRO enable (ethtool_value) */
-#define ETHTOOL_GRXRINGS       0x0000002d /* Get RX rings available for LB */
-#define ETHTOOL_GRXCLSRLCNT    0x0000002e /* Get RX class rule count */
-#define ETHTOOL_GRXCLSRULE     0x0000002f /* Get RX classification rule */
-#define ETHTOOL_GRXCLSRLALL    0x00000030 /* Get all RX classification rule */
-#define ETHTOOL_SRXCLSRLDEL    0x00000031 /* Delete RX classification rule */
-#define ETHTOOL_SRXCLSRLINS    0x00000032 /* Insert RX classification rule */
-#define ETHTOOL_FLASHDEV       0x00000033 /* Flash firmware to device */
-#define ETHTOOL_RESET          0x00000034 /* Reset hardware */
-#define ETHTOOL_SRXNTUPLE      0x00000035 /* Add an n-tuple filter to device */
-#define ETHTOOL_GRXNTUPLE      0x00000036 /* deprecated */
-#define ETHTOOL_GSSET_INFO     0x00000037 /* Get string set info */
-#define ETHTOOL_GRXFHINDIR     0x00000038 /* Get RX flow hash indir'n table */
-#define ETHTOOL_SRXFHINDIR     0x00000039 /* Set RX flow hash indir'n table */
-
-#define ETHTOOL_GFEATURES      0x0000003a /* Get device offload settings */
-#define ETHTOOL_SFEATURES      0x0000003b /* Change device offload settings */
-#define ETHTOOL_GCHANNELS      0x0000003c /* Get no of channels */
-#define ETHTOOL_SCHANNELS      0x0000003d /* Set no of channels */
-#define ETHTOOL_SET_DUMP       0x0000003e /* Set dump settings */
-#define ETHTOOL_GET_DUMP_FLAG  0x0000003f /* Get dump settings */
-#define ETHTOOL_GET_DUMP_DATA  0x00000040 /* Get dump data */
-#define ETHTOOL_GET_TS_INFO    0x00000041 /* Get time stamping and PHC info */
-#define ETHTOOL_GMODULEINFO    0x00000042 /* Get plug-in module information */
-#define ETHTOOL_GMODULEEEPROM  0x00000043 /* Get plug-in module eeprom */
-#define ETHTOOL_GEEE           0x00000044 /* Get EEE settings */
-#define ETHTOOL_SEEE           0x00000045 /* Set EEE settings */
-
-/* compatibility with older code */
-#define SPARC_ETH_GSET         ETHTOOL_GSET
-#define SPARC_ETH_SSET         ETHTOOL_SSET
-
-/* Indicates what features are supported by the interface. */
-#define SUPPORTED_10baseT_Half         (1 << 0)
-#define SUPPORTED_10baseT_Full         (1 << 1)
-#define SUPPORTED_100baseT_Half                (1 << 2)
-#define SUPPORTED_100baseT_Full                (1 << 3)
-#define SUPPORTED_1000baseT_Half       (1 << 4)
-#define SUPPORTED_1000baseT_Full       (1 << 5)
-#define SUPPORTED_Autoneg              (1 << 6)
-#define SUPPORTED_TP                   (1 << 7)
-#define SUPPORTED_AUI                  (1 << 8)
-#define SUPPORTED_MII                  (1 << 9)
-#define SUPPORTED_FIBRE                        (1 << 10)
-#define SUPPORTED_BNC                  (1 << 11)
-#define SUPPORTED_10000baseT_Full      (1 << 12)
-#define SUPPORTED_Pause                        (1 << 13)
-#define SUPPORTED_Asym_Pause           (1 << 14)
-#define SUPPORTED_2500baseX_Full       (1 << 15)
-#define SUPPORTED_Backplane            (1 << 16)
-#define SUPPORTED_1000baseKX_Full      (1 << 17)
-#define SUPPORTED_10000baseKX4_Full    (1 << 18)
-#define SUPPORTED_10000baseKR_Full     (1 << 19)
-#define SUPPORTED_10000baseR_FEC       (1 << 20)
-#define SUPPORTED_20000baseMLD2_Full   (1 << 21)
-#define SUPPORTED_20000baseKR2_Full    (1 << 22)
-#define SUPPORTED_40000baseKR4_Full    (1 << 23)
-#define SUPPORTED_40000baseCR4_Full    (1 << 24)
-#define SUPPORTED_40000baseSR4_Full    (1 << 25)
-#define SUPPORTED_40000baseLR4_Full    (1 << 26)
-
-/* Indicates what features are advertised by the interface. */
-#define ADVERTISED_10baseT_Half                (1 << 0)
-#define ADVERTISED_10baseT_Full                (1 << 1)
-#define ADVERTISED_100baseT_Half       (1 << 2)
-#define ADVERTISED_100baseT_Full       (1 << 3)
-#define ADVERTISED_1000baseT_Half      (1 << 4)
-#define ADVERTISED_1000baseT_Full      (1 << 5)
-#define ADVERTISED_Autoneg             (1 << 6)
-#define ADVERTISED_TP                  (1 << 7)
-#define ADVERTISED_AUI                 (1 << 8)
-#define ADVERTISED_MII                 (1 << 9)
-#define ADVERTISED_FIBRE               (1 << 10)
-#define ADVERTISED_BNC                 (1 << 11)
-#define ADVERTISED_10000baseT_Full     (1 << 12)
-#define ADVERTISED_Pause               (1 << 13)
-#define ADVERTISED_Asym_Pause          (1 << 14)
-#define ADVERTISED_2500baseX_Full      (1 << 15)
-#define ADVERTISED_Backplane           (1 << 16)
-#define ADVERTISED_1000baseKX_Full     (1 << 17)
-#define ADVERTISED_10000baseKX4_Full   (1 << 18)
-#define ADVERTISED_10000baseKR_Full    (1 << 19)
-#define ADVERTISED_10000baseR_FEC      (1 << 20)
-#define ADVERTISED_20000baseMLD2_Full  (1 << 21)
-#define ADVERTISED_20000baseKR2_Full   (1 << 22)
-#define ADVERTISED_40000baseKR4_Full   (1 << 23)
-#define ADVERTISED_40000baseCR4_Full   (1 << 24)
-#define ADVERTISED_40000baseSR4_Full   (1 << 25)
-#define ADVERTISED_40000baseLR4_Full   (1 << 26)
-
-/* The following are all involved in forcing a particular link
- * mode for the device for setting things.  When getting the
- * devices settings, these indicate the current mode and whether
- * it was forced up into this mode or autonegotiated.
- */
-
-/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
-#define SPEED_10               10
-#define SPEED_100              100
-#define SPEED_1000             1000
-#define SPEED_2500             2500
-#define SPEED_10000            10000
-#define SPEED_UNKNOWN          -1
-
-/* Duplex, half or full. */
-#define DUPLEX_HALF            0x00
-#define DUPLEX_FULL            0x01
-#define DUPLEX_UNKNOWN         0xff
-
-/* Which connector port. */
-#define PORT_TP                        0x00
-#define PORT_AUI               0x01
-#define PORT_MII               0x02
-#define PORT_FIBRE             0x03
-#define PORT_BNC               0x04
-#define PORT_DA                        0x05
-#define PORT_NONE              0xef
-#define PORT_OTHER             0xff
-
-/* Which transceiver to use. */
-#define XCVR_INTERNAL          0x00
-#define XCVR_EXTERNAL          0x01
-#define XCVR_DUMMY1            0x02
-#define XCVR_DUMMY2            0x03
-#define XCVR_DUMMY3            0x04
-
-/* Enable or disable autonegotiation.  If this is set to enable,
- * the forced link modes above are completely ignored.
- */
-#define AUTONEG_DISABLE                0x00
-#define AUTONEG_ENABLE         0x01
-
-/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
- * the driver is required to renegotiate link
- */
-#define ETH_TP_MDI_INVALID     0x00 /* status: unknown; control: unsupported */
-#define ETH_TP_MDI             0x01 /* status: MDI;     control: force MDI */
-#define ETH_TP_MDI_X           0x02 /* status: MDI-X;   control: force MDI-X */
-#define ETH_TP_MDI_AUTO                0x03 /*                  control: auto-select */
-
-/* Wake-On-Lan options. */
-#define WAKE_PHY               (1 << 0)
-#define WAKE_UCAST             (1 << 1)
-#define WAKE_MCAST             (1 << 2)
-#define WAKE_BCAST             (1 << 3)
-#define WAKE_ARP               (1 << 4)
-#define WAKE_MAGIC             (1 << 5)
-#define WAKE_MAGICSECURE       (1 << 6) /* only meaningful if WAKE_MAGIC */
-
-/* L2-L4 network traffic flow types */
-#define        TCP_V4_FLOW     0x01    /* hash or spec (tcp_ip4_spec) */
-#define        UDP_V4_FLOW     0x02    /* hash or spec (udp_ip4_spec) */
-#define        SCTP_V4_FLOW    0x03    /* hash or spec (sctp_ip4_spec) */
-#define        AH_ESP_V4_FLOW  0x04    /* hash only */
-#define        TCP_V6_FLOW     0x05    /* hash only */
-#define        UDP_V6_FLOW     0x06    /* hash only */
-#define        SCTP_V6_FLOW    0x07    /* hash only */
-#define        AH_ESP_V6_FLOW  0x08    /* hash only */
-#define        AH_V4_FLOW      0x09    /* hash or spec (ah_ip4_spec) */
-#define        ESP_V4_FLOW     0x0a    /* hash or spec (esp_ip4_spec) */
-#define        AH_V6_FLOW      0x0b    /* hash only */
-#define        ESP_V6_FLOW     0x0c    /* hash only */
-#define        IP_USER_FLOW    0x0d    /* spec only (usr_ip4_spec) */
-#define        IPV4_FLOW       0x10    /* hash only */
-#define        IPV6_FLOW       0x11    /* hash only */
-#define        ETHER_FLOW      0x12    /* spec only (ether_spec) */
-/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
-#define        FLOW_EXT        0x80000000
-
-/* L3-L4 network traffic flow hash options */
-#define        RXH_L2DA        (1 << 1)
-#define        RXH_VLAN        (1 << 2)
-#define        RXH_L3_PROTO    (1 << 3)
-#define        RXH_IP_SRC      (1 << 4)
-#define        RXH_IP_DST      (1 << 5)
-#define        RXH_L4_B_0_1    (1 << 6) /* src port in case of TCP/UDP/SCTP */
-#define        RXH_L4_B_2_3    (1 << 7) /* dst port in case of TCP/UDP/SCTP */
-#define        RXH_DISCARD     (1 << 31)
-
-#define        RX_CLS_FLOW_DISC        0xffffffffffffffffULL
-
-/* Special RX classification rule insert location values */
-#define RX_CLS_LOC_SPECIAL     0x80000000      /* flag */
-#define RX_CLS_LOC_ANY         0xffffffff
-#define RX_CLS_LOC_FIRST       0xfffffffe
-#define RX_CLS_LOC_LAST                0xfffffffd
-
-/* EEPROM Standards for plug in modules */
-#define ETH_MODULE_SFF_8079            0x1
-#define ETH_MODULE_SFF_8079_LEN                256
-#define ETH_MODULE_SFF_8472            0x2
-#define ETH_MODULE_SFF_8472_LEN                512
-
-/* Reset flags */
-/* The reset() operation must clear the flags for the components which
- * were actually reset.  On successful return, the flags indicate the
- * components which were not reset, either because they do not exist
- * in the hardware or because they cannot be reset independently.  The
- * driver must never reset any components that were not requested.
- */
-enum ethtool_reset_flags {
-       /* These flags represent components dedicated to the interface
-        * the command is addressed to.  Shift any flag left by
-        * ETH_RESET_SHARED_SHIFT to reset a shared component of the
-        * same type.
-        */
-       ETH_RESET_MGMT          = 1 << 0,       /* Management processor */
-       ETH_RESET_IRQ           = 1 << 1,       /* Interrupt requester */
-       ETH_RESET_DMA           = 1 << 2,       /* DMA engine */
-       ETH_RESET_FILTER        = 1 << 3,       /* Filtering/flow direction */
-       ETH_RESET_OFFLOAD       = 1 << 4,       /* Protocol offload */
-       ETH_RESET_MAC           = 1 << 5,       /* Media access controller */
-       ETH_RESET_PHY           = 1 << 6,       /* Transceiver/PHY */
-       ETH_RESET_RAM           = 1 << 7,       /* RAM shared between
-                                                * multiple components */
-
-       ETH_RESET_DEDICATED     = 0x0000ffff,   /* All components dedicated to
-                                                * this interface */
-       ETH_RESET_ALL           = 0xffffffff,   /* All components used by this
-                                                * interface, even if shared */
-};
-#define ETH_RESET_SHARED_SHIFT 16
-
 #endif /* _LINUX_ETHTOOL_H */
index 41085d0f3955b3ff247b426de9452b731d00c19b..6daf6d4971f65266c3c83e684af231dbafc452c0 100644 (file)
  *  Davide Libenzi <davidel@xmailserver.org>
  *
  */
-
 #ifndef _LINUX_EVENTPOLL_H
 #define _LINUX_EVENTPOLL_H
 
-/* For O_CLOEXEC */
-#include <linux/fcntl.h>
-#include <linux/types.h>
-
-/* Flags for epoll_create1.  */
-#define EPOLL_CLOEXEC O_CLOEXEC
-
-/* Valid opcodes to issue to sys_epoll_ctl() */
-#define EPOLL_CTL_ADD 1
-#define EPOLL_CTL_DEL 2
-#define EPOLL_CTL_MOD 3
-#define EPOLL_CTL_DISABLE 4
-
-/*
- * Request the handling of system wakeup events so as to prevent system suspends
- * from happening while those events are being processed.
- *
- * Assuming neither EPOLLET nor EPOLLONESHOT is set, system suspends will not be
- * re-allowed until epoll_wait is called again after consuming the wakeup
- * event(s).
- *
- * Requires CAP_BLOCK_SUSPEND
- */
-#define EPOLLWAKEUP (1 << 29)
-
-/* Set the One Shot behaviour for the target file descriptor */
-#define EPOLLONESHOT (1 << 30)
+#include <uapi/linux/eventpoll.h>
 
-/* Set the Edge Triggered behaviour for the target file descriptor */
-#define EPOLLET (1 << 31)
-
-/* 
- * On x86-64 make the 64bit structure have the same alignment as the
- * 32bit structure. This makes 32bit emulation easier.
- *
- * UML/x86_64 needs the same packing as x86_64
- */
-#ifdef __x86_64__
-#define EPOLL_PACKED __attribute__((packed))
-#else
-#define EPOLL_PACKED
-#endif
-
-struct epoll_event {
-       __u32 events;
-       __u64 data;
-} EPOLL_PACKED;
-
-#ifdef __KERNEL__
 
 /* Forward declarations to avoid compiler errors */
 struct file;
@@ -116,7 +68,4 @@ static inline void eventpoll_release(struct file *file) {}
 
 #endif
 
-#endif /* #ifdef __KERNEL__ */
-
 #endif /* #ifndef _LINUX_EVENTPOLL_H */
-
index d39b824a780c2b48016e38370e36e039d192e90f..31591686ac2dd8ab88cee881d7fc42a896522525 100644 (file)
@@ -1,11 +1,8 @@
 #ifndef _FALLOC_H_
 #define _FALLOC_H_
 
-#define FALLOC_FL_KEEP_SIZE    0x01 /* default is extend size */
-#define FALLOC_FL_PUNCH_HOLE   0x02 /* de-allocates range */
-#define FALLOC_FL_NO_HIDE_STALE        0x04 /* reserved codepoint */
+#include <uapi/linux/falloc.h>
 
-#ifdef __KERNEL__
 
 /*
  * Space reservation ioctls and argument structure
@@ -24,6 +21,4 @@ struct space_resv {
 #define FS_IOC_RESVSP          _IOW('X', 40, struct space_resv)
 #define FS_IOC_RESVSP64                _IOW('X', 42, struct space_resv)
 
-#endif /* __KERNEL__ */
-
 #endif /* _FALLOC_H_ */
index 6c6133f76e163c88041c4a13a4b091ef6ccf13ac..cef93ddcc5a0d16f4eccb53b454fb285c464d14b 100644 (file)
@@ -1,120 +1,8 @@
 #ifndef _LINUX_FANOTIFY_H
 #define _LINUX_FANOTIFY_H
 
-#include <linux/types.h>
+#include <uapi/linux/fanotify.h>
 
-/* the following events that user-space can register for */
-#define FAN_ACCESS             0x00000001      /* File was accessed */
-#define FAN_MODIFY             0x00000002      /* File was modified */
-#define FAN_CLOSE_WRITE                0x00000008      /* Writtable file closed */
-#define FAN_CLOSE_NOWRITE      0x00000010      /* Unwrittable file closed */
-#define FAN_OPEN               0x00000020      /* File was opened */
-
-#define FAN_Q_OVERFLOW         0x00004000      /* Event queued overflowed */
-
-#define FAN_OPEN_PERM          0x00010000      /* File open in perm check */
-#define FAN_ACCESS_PERM                0x00020000      /* File accessed in perm check */
-
-#define FAN_ONDIR              0x40000000      /* event occurred against dir */
-
-#define FAN_EVENT_ON_CHILD     0x08000000      /* interested in child events */
-
-/* helper events */
-#define FAN_CLOSE              (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
-
-/* flags used for fanotify_init() */
-#define FAN_CLOEXEC            0x00000001
-#define FAN_NONBLOCK           0x00000002
-
-/* These are NOT bitwise flags.  Both bits are used togther.  */
-#define FAN_CLASS_NOTIF                0x00000000
-#define FAN_CLASS_CONTENT      0x00000004
-#define FAN_CLASS_PRE_CONTENT  0x00000008
-#define FAN_ALL_CLASS_BITS     (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
-                                FAN_CLASS_PRE_CONTENT)
-
-#define FAN_UNLIMITED_QUEUE    0x00000010
-#define FAN_UNLIMITED_MARKS    0x00000020
-
-#define FAN_ALL_INIT_FLAGS     (FAN_CLOEXEC | FAN_NONBLOCK | \
-                                FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
-                                FAN_UNLIMITED_MARKS)
-
-/* flags used for fanotify_modify_mark() */
-#define FAN_MARK_ADD           0x00000001
-#define FAN_MARK_REMOVE                0x00000002
-#define FAN_MARK_DONT_FOLLOW   0x00000004
-#define FAN_MARK_ONLYDIR       0x00000008
-#define FAN_MARK_MOUNT         0x00000010
-#define FAN_MARK_IGNORED_MASK  0x00000020
-#define FAN_MARK_IGNORED_SURV_MODIFY   0x00000040
-#define FAN_MARK_FLUSH         0x00000080
-#ifdef __KERNEL__
 /* not valid from userspace, only kernel internal */
 #define FAN_MARK_ONDIR         0x00000100
-#endif
-
-#define FAN_ALL_MARK_FLAGS     (FAN_MARK_ADD |\
-                                FAN_MARK_REMOVE |\
-                                FAN_MARK_DONT_FOLLOW |\
-                                FAN_MARK_ONLYDIR |\
-                                FAN_MARK_MOUNT |\
-                                FAN_MARK_IGNORED_MASK |\
-                                FAN_MARK_IGNORED_SURV_MODIFY |\
-                                FAN_MARK_FLUSH)
-
-/*
- * All of the events - we build the list by hand so that we can add flags in
- * the future and not break backward compatibility.  Apps will get only the
- * events that they originally wanted.  Be sure to add new events here!
- */
-#define FAN_ALL_EVENTS (FAN_ACCESS |\
-                       FAN_MODIFY |\
-                       FAN_CLOSE |\
-                       FAN_OPEN)
-
-/*
- * All events which require a permission response from userspace
- */
-#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
-                            FAN_ACCESS_PERM)
-
-#define FAN_ALL_OUTGOING_EVENTS        (FAN_ALL_EVENTS |\
-                                FAN_ALL_PERM_EVENTS |\
-                                FAN_Q_OVERFLOW)
-
-#define FANOTIFY_METADATA_VERSION      3
-
-struct fanotify_event_metadata {
-       __u32 event_len;
-       __u8 vers;
-       __u8 reserved;
-       __u16 metadata_len;
-       __aligned_u64 mask;
-       __s32 fd;
-       __s32 pid;
-};
-
-struct fanotify_response {
-       __s32 fd;
-       __u32 response;
-};
-
-/* Legit userspace responses to a _PERM event */
-#define FAN_ALLOW      0x01
-#define FAN_DENY       0x02
-/* No fd set in event */
-#define FAN_NOFD       -1
-
-/* Helper functions to deal with fanotify_event_metadata buffers */
-#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
-
-#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
-                                  (struct fanotify_event_metadata*)(((char *)(meta)) + \
-                                  (meta)->event_len))
-
-#define FAN_EVENT_OK(meta, len)        ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
-                               (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
-                               (long)(meta)->event_len <= (long)(len))
-
 #endif /* _LINUX_FANOTIFY_H */
index ac3f1c605843201e8e3e4561bc84d2b910b9f5ba..c7a95714b1fe68e7f9b67e990a384cac0f490044 100644 (file)
 #ifndef _LINUX_FB_H
 #define _LINUX_FB_H
 
-#include <linux/types.h>
-#include <linux/i2c.h>
-#ifdef __KERNEL__
 #include <linux/kgdb.h>
-#endif /* __KERNEL__ */
+#include <uapi/linux/fb.h>
 
-/* Definitions of frame buffers                                                */
-
-#define FB_MAX                 32      /* sufficient for now */
-
-/* ioctls
-   0x46 is 'F'                                                         */
-#define FBIOGET_VSCREENINFO    0x4600
-#define FBIOPUT_VSCREENINFO    0x4601
-#define FBIOGET_FSCREENINFO    0x4602
-#define FBIOGETCMAP            0x4604
-#define FBIOPUTCMAP            0x4605
-#define FBIOPAN_DISPLAY                0x4606
-#ifdef __KERNEL__
 #define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor_user)
-#else
-#define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
-#endif
-/* 0x4607-0x460B are defined below */
-/* #define FBIOGET_MONITORSPEC 0x460C */
-/* #define FBIOPUT_MONITORSPEC 0x460D */
-/* #define FBIOSWITCH_MONIBIT  0x460E */
-#define FBIOGET_CON2FBMAP      0x460F
-#define FBIOPUT_CON2FBMAP      0x4610
-#define FBIOBLANK              0x4611          /* arg: 0 or vesa level + 1 */
-#define FBIOGET_VBLANK         _IOR('F', 0x12, struct fb_vblank)
-#define FBIO_ALLOC              0x4613
-#define FBIO_FREE               0x4614
-#define FBIOGET_GLYPH           0x4615
-#define FBIOGET_HWCINFO         0x4616
-#define FBIOPUT_MODEINFO        0x4617
-#define FBIOGET_DISPINFO        0x4618
-#define FBIO_WAITFORVSYNC      _IOW('F', 0x20, __u32)
-
-#define FB_TYPE_PACKED_PIXELS          0       /* Packed Pixels        */
-#define FB_TYPE_PLANES                 1       /* Non interleaved planes */
-#define FB_TYPE_INTERLEAVED_PLANES     2       /* Interleaved planes   */
-#define FB_TYPE_TEXT                   3       /* Text/attributes      */
-#define FB_TYPE_VGA_PLANES             4       /* EGA/VGA planes       */
-#define FB_TYPE_FOURCC                 5       /* Type identified by a V4L2 FOURCC */
-
-#define FB_AUX_TEXT_MDA                0       /* Monochrome text */
-#define FB_AUX_TEXT_CGA                1       /* CGA/EGA/VGA Color text */
-#define FB_AUX_TEXT_S3_MMIO    2       /* S3 MMIO fasttext */
-#define FB_AUX_TEXT_MGA_STEP16 3       /* MGA Millenium I: text, attr, 14 reserved bytes */
-#define FB_AUX_TEXT_MGA_STEP8  4       /* other MGAs:      text, attr,  6 reserved bytes */
-#define FB_AUX_TEXT_SVGA_GROUP 8       /* 8-15: SVGA tileblit compatible modes */
-#define FB_AUX_TEXT_SVGA_MASK  7       /* lower three bits says step */
-#define FB_AUX_TEXT_SVGA_STEP2 8       /* SVGA text mode:  text, attr */
-#define FB_AUX_TEXT_SVGA_STEP4 9       /* SVGA text mode:  text, attr,  2 reserved bytes */
-#define FB_AUX_TEXT_SVGA_STEP8 10      /* SVGA text mode:  text, attr,  6 reserved bytes */
-#define FB_AUX_TEXT_SVGA_STEP16        11      /* SVGA text mode:  text, attr, 14 reserved bytes */
-#define FB_AUX_TEXT_SVGA_LAST  15      /* reserved up to 15 */
-
-#define FB_AUX_VGA_PLANES_VGA4         0       /* 16 color planes (EGA/VGA) */
-#define FB_AUX_VGA_PLANES_CFB4         1       /* CFB4 in planes (VGA) */
-#define FB_AUX_VGA_PLANES_CFB8         2       /* CFB8 in planes (VGA) */
-
-#define FB_VISUAL_MONO01               0       /* Monochr. 1=Black 0=White */
-#define FB_VISUAL_MONO10               1       /* Monochr. 1=White 0=Black */
-#define FB_VISUAL_TRUECOLOR            2       /* True color   */
-#define FB_VISUAL_PSEUDOCOLOR          3       /* Pseudo color (like atari) */
-#define FB_VISUAL_DIRECTCOLOR          4       /* Direct color */
-#define FB_VISUAL_STATIC_PSEUDOCOLOR   5       /* Pseudo color readonly */
-#define FB_VISUAL_FOURCC               6       /* Visual identified by a V4L2 FOURCC */
-
-#define FB_ACCEL_NONE          0       /* no hardware accelerator      */
-#define FB_ACCEL_ATARIBLITT    1       /* Atari Blitter                */
-#define FB_ACCEL_AMIGABLITT    2       /* Amiga Blitter                */
-#define FB_ACCEL_S3_TRIO64     3       /* Cybervision64 (S3 Trio64)    */
-#define FB_ACCEL_NCR_77C32BLT  4       /* RetinaZ3 (NCR 77C32BLT)      */
-#define FB_ACCEL_S3_VIRGE      5       /* Cybervision64/3D (S3 ViRGE)  */
-#define FB_ACCEL_ATI_MACH64GX  6       /* ATI Mach 64GX family         */
-#define FB_ACCEL_DEC_TGA       7       /* DEC 21030 TGA                */
-#define FB_ACCEL_ATI_MACH64CT  8       /* ATI Mach 64CT family         */
-#define FB_ACCEL_ATI_MACH64VT  9       /* ATI Mach 64CT family VT class */
-#define FB_ACCEL_ATI_MACH64GT  10      /* ATI Mach 64CT family GT class */
-#define FB_ACCEL_SUN_CREATOR   11      /* Sun Creator/Creator3D        */
-#define FB_ACCEL_SUN_CGSIX     12      /* Sun cg6                      */
-#define FB_ACCEL_SUN_LEO       13      /* Sun leo/zx                   */
-#define FB_ACCEL_IMS_TWINTURBO 14      /* IMS Twin Turbo               */
-#define FB_ACCEL_3DLABS_PERMEDIA2 15   /* 3Dlabs Permedia 2            */
-#define FB_ACCEL_MATROX_MGA2064W 16    /* Matrox MGA2064W (Millenium)  */
-#define FB_ACCEL_MATROX_MGA1064SG 17   /* Matrox MGA1064SG (Mystique)  */
-#define FB_ACCEL_MATROX_MGA2164W 18    /* Matrox MGA2164W (Millenium II) */
-#define FB_ACCEL_MATROX_MGA2164W_AGP 19        /* Matrox MGA2164W (Millenium II) */
-#define FB_ACCEL_MATROX_MGAG100        20      /* Matrox G100 (Productiva G100) */
-#define FB_ACCEL_MATROX_MGAG200        21      /* Matrox G200 (Myst, Mill, ...) */
-#define FB_ACCEL_SUN_CG14      22      /* Sun cgfourteen                */
-#define FB_ACCEL_SUN_BWTWO     23      /* Sun bwtwo                    */
-#define FB_ACCEL_SUN_CGTHREE   24      /* Sun cgthree                  */
-#define FB_ACCEL_SUN_TCX       25      /* Sun tcx                      */
-#define FB_ACCEL_MATROX_MGAG400        26      /* Matrox G400                  */
-#define FB_ACCEL_NV3           27      /* nVidia RIVA 128              */
-#define FB_ACCEL_NV4           28      /* nVidia RIVA TNT              */
-#define FB_ACCEL_NV5           29      /* nVidia RIVA TNT2             */
-#define FB_ACCEL_CT_6555x      30      /* C&T 6555x                    */
-#define FB_ACCEL_3DFX_BANSHEE  31      /* 3Dfx Banshee                 */
-#define FB_ACCEL_ATI_RAGE128   32      /* ATI Rage128 family           */
-#define FB_ACCEL_IGS_CYBER2000 33      /* CyberPro 2000                */
-#define FB_ACCEL_IGS_CYBER2010 34      /* CyberPro 2010                */
-#define FB_ACCEL_IGS_CYBER5000 35      /* CyberPro 5000                */
-#define FB_ACCEL_SIS_GLAMOUR    36     /* SiS 300/630/540              */
-#define FB_ACCEL_3DLABS_PERMEDIA3 37   /* 3Dlabs Permedia 3            */
-#define FB_ACCEL_ATI_RADEON    38      /* ATI Radeon family            */
-#define FB_ACCEL_I810           39      /* Intel 810/815                */
-#define FB_ACCEL_SIS_GLAMOUR_2  40     /* SiS 315, 650, 740            */
-#define FB_ACCEL_SIS_XABRE      41     /* SiS 330 ("Xabre")            */
-#define FB_ACCEL_I830           42      /* Intel 830M/845G/85x/865G     */
-#define FB_ACCEL_NV_10          43      /* nVidia Arch 10               */
-#define FB_ACCEL_NV_20          44      /* nVidia Arch 20               */
-#define FB_ACCEL_NV_30          45      /* nVidia Arch 30               */
-#define FB_ACCEL_NV_40          46      /* nVidia Arch 40               */
-#define FB_ACCEL_XGI_VOLARI_V  47      /* XGI Volari V3XT, V5, V8      */
-#define FB_ACCEL_XGI_VOLARI_Z  48      /* XGI Volari Z7                */
-#define FB_ACCEL_OMAP1610      49      /* TI OMAP16xx                  */
-#define FB_ACCEL_TRIDENT_TGUI  50      /* Trident TGUI                 */
-#define FB_ACCEL_TRIDENT_3DIMAGE 51    /* Trident 3DImage              */
-#define FB_ACCEL_TRIDENT_BLADE3D 52    /* Trident Blade3D              */
-#define FB_ACCEL_TRIDENT_BLADEXP 53    /* Trident BladeXP              */
-#define FB_ACCEL_CIRRUS_ALPINE   53    /* Cirrus Logic 543x/544x/5480  */
-#define FB_ACCEL_NEOMAGIC_NM2070 90    /* NeoMagic NM2070              */
-#define FB_ACCEL_NEOMAGIC_NM2090 91    /* NeoMagic NM2090              */
-#define FB_ACCEL_NEOMAGIC_NM2093 92    /* NeoMagic NM2093              */
-#define FB_ACCEL_NEOMAGIC_NM2097 93    /* NeoMagic NM2097              */
-#define FB_ACCEL_NEOMAGIC_NM2160 94    /* NeoMagic NM2160              */
-#define FB_ACCEL_NEOMAGIC_NM2200 95    /* NeoMagic NM2200              */
-#define FB_ACCEL_NEOMAGIC_NM2230 96    /* NeoMagic NM2230              */
-#define FB_ACCEL_NEOMAGIC_NM2360 97    /* NeoMagic NM2360              */
-#define FB_ACCEL_NEOMAGIC_NM2380 98    /* NeoMagic NM2380              */
-#define FB_ACCEL_PXA3XX                 99     /* PXA3xx                       */
-
-#define FB_ACCEL_SAVAGE4        0x80   /* S3 Savage4                   */
-#define FB_ACCEL_SAVAGE3D       0x81   /* S3 Savage3D                  */
-#define FB_ACCEL_SAVAGE3D_MV    0x82   /* S3 Savage3D-MV               */
-#define FB_ACCEL_SAVAGE2000     0x83   /* S3 Savage2000                */
-#define FB_ACCEL_SAVAGE_MX_MV   0x84   /* S3 Savage/MX-MV              */
-#define FB_ACCEL_SAVAGE_MX      0x85   /* S3 Savage/MX                 */
-#define FB_ACCEL_SAVAGE_IX_MV   0x86   /* S3 Savage/IX-MV              */
-#define FB_ACCEL_SAVAGE_IX      0x87   /* S3 Savage/IX                 */
-#define FB_ACCEL_PROSAVAGE_PM   0x88   /* S3 ProSavage PM133           */
-#define FB_ACCEL_PROSAVAGE_KM   0x89   /* S3 ProSavage KM133           */
-#define FB_ACCEL_S3TWISTER_P    0x8a   /* S3 Twister                   */
-#define FB_ACCEL_S3TWISTER_K    0x8b   /* S3 TwisterK                  */
-#define FB_ACCEL_SUPERSAVAGE    0x8c    /* S3 Supersavage               */
-#define FB_ACCEL_PROSAVAGE_DDR  0x8d   /* S3 ProSavage DDR             */
-#define FB_ACCEL_PROSAVAGE_DDRK 0x8e   /* S3 ProSavage DDR-K           */
-
-#define FB_ACCEL_PUV3_UNIGFX   0xa0    /* PKUnity-v3 Unigfx            */
-
-#define FB_CAP_FOURCC          1       /* Device supports FOURCC-based formats */
-
-struct fb_fix_screeninfo {
-       char id[16];                    /* identification string eg "TT Builtin" */
-       unsigned long smem_start;       /* Start of frame buffer mem */
-                                       /* (physical address) */
-       __u32 smem_len;                 /* Length of frame buffer mem */
-       __u32 type;                     /* see FB_TYPE_*                */
-       __u32 type_aux;                 /* Interleave for interleaved Planes */
-       __u32 visual;                   /* see FB_VISUAL_*              */ 
-       __u16 xpanstep;                 /* zero if no hardware panning  */
-       __u16 ypanstep;                 /* zero if no hardware panning  */
-       __u16 ywrapstep;                /* zero if no hardware ywrap    */
-       __u32 line_length;              /* length of a line in bytes    */
-       unsigned long mmio_start;       /* Start of Memory Mapped I/O   */
-                                       /* (physical address) */
-       __u32 mmio_len;                 /* Length of Memory Mapped I/O  */
-       __u32 accel;                    /* Indicate to driver which     */
-                                       /*  specific chip/card we have  */
-       __u16 capabilities;             /* see FB_CAP_*                 */
-       __u16 reserved[2];              /* Reserved for future compatibility */
-};
-
-/* Interpretation of offset for color fields: All offsets are from the right,
- * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
- * can use the offset as right argument to <<). A pixel afterwards is a bit
- * stream and is written to video memory as that unmodified.
- *
- * For pseudocolor: offset and length should be the same for all color
- * components. Offset specifies the position of the least significant bit
- * of the pallette index in a pixel value. Length indicates the number
- * of available palette entries (i.e. # of entries = 1 << length).
- */
-struct fb_bitfield {
-       __u32 offset;                   /* beginning of bitfield        */
-       __u32 length;                   /* length of bitfield           */
-       __u32 msb_right;                /* != 0 : Most significant bit is */ 
-                                       /* right */ 
-};
-
-#define FB_NONSTD_HAM          1       /* Hold-And-Modify (HAM)        */
-#define FB_NONSTD_REV_PIX_IN_B 2       /* order of pixels in each byte is reversed */
-
-#define FB_ACTIVATE_NOW                0       /* set values immediately (or vbl)*/
-#define FB_ACTIVATE_NXTOPEN    1       /* activate on next open        */
-#define FB_ACTIVATE_TEST       2       /* don't set, round up impossible */
-#define FB_ACTIVATE_MASK       15
-                                       /* values                       */
-#define FB_ACTIVATE_VBL               16       /* activate values on next vbl  */
-#define FB_CHANGE_CMAP_VBL     32      /* change colormap on vbl       */
-#define FB_ACTIVATE_ALL               64       /* change all VCs on this fb    */
-#define FB_ACTIVATE_FORCE     128      /* force apply even when no change*/
-#define FB_ACTIVATE_INV_MODE  256       /* invalidate videomode */
-
-#define FB_ACCELF_TEXT         1       /* (OBSOLETE) see fb_info.flags and vc_mode */
-
-#define FB_SYNC_HOR_HIGH_ACT   1       /* horizontal sync high active  */
-#define FB_SYNC_VERT_HIGH_ACT  2       /* vertical sync high active    */
-#define FB_SYNC_EXT            4       /* external sync                */
-#define FB_SYNC_COMP_HIGH_ACT  8       /* composite sync high active   */
-#define FB_SYNC_BROADCAST      16      /* broadcast video timings      */
-                                       /* vtotal = 144d/288n/576i => PAL  */
-                                       /* vtotal = 121d/242n/484i => NTSC */
-#define FB_SYNC_ON_GREEN       32      /* sync on green */
-
-#define FB_VMODE_NONINTERLACED  0      /* non interlaced */
-#define FB_VMODE_INTERLACED    1       /* interlaced   */
-#define FB_VMODE_DOUBLE                2       /* double scan */
-#define FB_VMODE_ODD_FLD_FIRST 4       /* interlaced: top line first */
-#define FB_VMODE_MASK          255
-
-#define FB_VMODE_YWRAP         256     /* ywrap instead of panning     */
-#define FB_VMODE_SMOOTH_XPAN   512     /* smooth xpan possible (internally used) */
-#define FB_VMODE_CONUPDATE     512     /* don't update x/yoffset       */
-
-/*
- * Display rotation support
- */
-#define FB_ROTATE_UR      0
-#define FB_ROTATE_CW      1
-#define FB_ROTATE_UD      2
-#define FB_ROTATE_CCW     3
-
-#define PICOS2KHZ(a) (1000000000UL/(a))
-#define KHZ2PICOS(a) (1000000000UL/(a))
-
-struct fb_var_screeninfo {
-       __u32 xres;                     /* visible resolution           */
-       __u32 yres;
-       __u32 xres_virtual;             /* virtual resolution           */
-       __u32 yres_virtual;
-       __u32 xoffset;                  /* offset from virtual to visible */
-       __u32 yoffset;                  /* resolution                   */
-
-       __u32 bits_per_pixel;           /* guess what                   */
-       __u32 grayscale;                /* 0 = color, 1 = grayscale,    */
-                                       /* >1 = FOURCC                  */
-       struct fb_bitfield red;         /* bitfield in fb mem if true color, */
-       struct fb_bitfield green;       /* else only length is significant */
-       struct fb_bitfield blue;
-       struct fb_bitfield transp;      /* transparency                 */      
-
-       __u32 nonstd;                   /* != 0 Non standard pixel format */
-
-       __u32 activate;                 /* see FB_ACTIVATE_*            */
-
-       __u32 height;                   /* height of picture in mm    */
-       __u32 width;                    /* width of picture in mm     */
-
-       __u32 accel_flags;              /* (OBSOLETE) see fb_info.flags */
-
-       /* Timing: All values in pixclocks, except pixclock (of course) */
-       __u32 pixclock;                 /* pixel clock in ps (pico seconds) */
-       __u32 left_margin;              /* time from sync to picture    */
-       __u32 right_margin;             /* time from picture to sync    */
-       __u32 upper_margin;             /* time from sync to picture    */
-       __u32 lower_margin;
-       __u32 hsync_len;                /* length of horizontal sync    */
-       __u32 vsync_len;                /* length of vertical sync      */
-       __u32 sync;                     /* see FB_SYNC_*                */
-       __u32 vmode;                    /* see FB_VMODE_*               */
-       __u32 rotate;                   /* angle we rotate counter clockwise */
-       __u32 colorspace;               /* colorspace for FOURCC-based modes */
-       __u32 reserved[4];              /* Reserved for future compatibility */
-};
-
-struct fb_cmap {
-       __u32 start;                    /* First entry  */
-       __u32 len;                      /* Number of entries */
-       __u16 *red;                     /* Red values   */
-       __u16 *green;
-       __u16 *blue;
-       __u16 *transp;                  /* transparency, can be NULL */
-};
-
-struct fb_con2fbmap {
-       __u32 console;
-       __u32 framebuffer;
-};
-
-/* VESA Blanking Levels */
-#define VESA_NO_BLANKING        0
-#define VESA_VSYNC_SUSPEND      1
-#define VESA_HSYNC_SUSPEND      2
-#define VESA_POWERDOWN          3
-
-
-enum {
-       /* screen: unblanked, hsync: on,  vsync: on */
-       FB_BLANK_UNBLANK       = VESA_NO_BLANKING,
-
-       /* screen: blanked,   hsync: on,  vsync: on */
-       FB_BLANK_NORMAL        = VESA_NO_BLANKING + 1,
-
-       /* screen: blanked,   hsync: on,  vsync: off */
-       FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
-
-       /* screen: blanked,   hsync: off, vsync: on */
-       FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
-
-       /* screen: blanked,   hsync: off, vsync: off */
-       FB_BLANK_POWERDOWN     = VESA_POWERDOWN + 1
-};
-
-#define FB_VBLANK_VBLANKING    0x001   /* currently in a vertical blank */
-#define FB_VBLANK_HBLANKING    0x002   /* currently in a horizontal blank */
-#define FB_VBLANK_HAVE_VBLANK  0x004   /* vertical blanks can be detected */
-#define FB_VBLANK_HAVE_HBLANK  0x008   /* horizontal blanks can be detected */
-#define FB_VBLANK_HAVE_COUNT   0x010   /* global retrace counter is available */
-#define FB_VBLANK_HAVE_VCOUNT  0x020   /* the vcount field is valid */
-#define FB_VBLANK_HAVE_HCOUNT  0x040   /* the hcount field is valid */
-#define FB_VBLANK_VSYNCING     0x080   /* currently in a vsync */
-#define FB_VBLANK_HAVE_VSYNC   0x100   /* verical syncs can be detected */
-
-struct fb_vblank {
-       __u32 flags;                    /* FB_VBLANK flags */
-       __u32 count;                    /* counter of retraces since boot */
-       __u32 vcount;                   /* current scanline position */
-       __u32 hcount;                   /* current scandot position */
-       __u32 reserved[4];              /* reserved for future compatibility */
-};
-
-/* Internal HW accel */
-#define ROP_COPY 0
-#define ROP_XOR  1
-
-struct fb_copyarea {
-       __u32 dx;
-       __u32 dy;
-       __u32 width;
-       __u32 height;
-       __u32 sx;
-       __u32 sy;
-};
-
-struct fb_fillrect {
-       __u32 dx;       /* screen-relative */
-       __u32 dy;
-       __u32 width;
-       __u32 height;
-       __u32 color;
-       __u32 rop;
-};
-
-struct fb_image {
-       __u32 dx;               /* Where to place image */
-       __u32 dy;
-       __u32 width;            /* Size of image */
-       __u32 height;
-       __u32 fg_color;         /* Only used when a mono bitmap */
-       __u32 bg_color;
-       __u8  depth;            /* Depth of the image */
-       const char *data;       /* Pointer to image data */
-       struct fb_cmap cmap;    /* color map info */
-};
-
-/*
- * hardware cursor control
- */
-
-#define FB_CUR_SETIMAGE 0x01
-#define FB_CUR_SETPOS   0x02
-#define FB_CUR_SETHOT   0x04
-#define FB_CUR_SETCMAP  0x08
-#define FB_CUR_SETSHAPE 0x10
-#define FB_CUR_SETSIZE 0x20
-#define FB_CUR_SETALL   0xFF
-
-struct fbcurpos {
-       __u16 x, y;
-};
-
-struct fb_cursor {
-       __u16 set;              /* what to set */
-       __u16 enable;           /* cursor on/off */
-       __u16 rop;              /* bitop operation */
-       const char *mask;       /* cursor mask bits */
-       struct fbcurpos hot;    /* cursor hot spot */
-       struct fb_image image;  /* Cursor image */
-};
-
-#ifdef CONFIG_FB_BACKLIGHT
-/* Settings for the generic backlight code */
-#define FB_BACKLIGHT_LEVELS    128
-#define FB_BACKLIGHT_MAX       0xFF
-#endif
-
-#ifdef __KERNEL__
 
 #include <linux/fs.h>
 #include <linux/init.h>
@@ -1181,6 +782,4 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
                        const struct fb_videomode *default_mode,
                        unsigned int default_bpp);
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_FB_H */
index f550f894ba15edabd684bd7aa5bdcac3f4df257e..76ce329e656d1eaca5a6d6792f97d3c067fa37c6 100644 (file)
@@ -1,54 +1,8 @@
 #ifndef _LINUX_FCNTL_H
 #define _LINUX_FCNTL_H
 
-#include <asm/fcntl.h>
+#include <uapi/linux/fcntl.h>
 
-#define F_SETLEASE     (F_LINUX_SPECIFIC_BASE + 0)
-#define F_GETLEASE     (F_LINUX_SPECIFIC_BASE + 1)
-
-/*
- * Cancel a blocking posix lock; internal use only until we expose an
- * asynchronous lock api to userspace:
- */
-#define F_CANCELLK     (F_LINUX_SPECIFIC_BASE + 5)
-
-/* Create a file descriptor with FD_CLOEXEC set. */
-#define F_DUPFD_CLOEXEC        (F_LINUX_SPECIFIC_BASE + 6)
-
-/*
- * Request nofications on a directory.
- * See below for events that may be notified.
- */
-#define F_NOTIFY       (F_LINUX_SPECIFIC_BASE+2)
-
-/*
- * Set and get of pipe page size array
- */
-#define F_SETPIPE_SZ   (F_LINUX_SPECIFIC_BASE + 7)
-#define F_GETPIPE_SZ   (F_LINUX_SPECIFIC_BASE + 8)
-
-/*
- * Types of directory notifications that may be requested.
- */
-#define DN_ACCESS      0x00000001      /* File accessed */
-#define DN_MODIFY      0x00000002      /* File modified */
-#define DN_CREATE      0x00000004      /* File created */
-#define DN_DELETE      0x00000008      /* File removed */
-#define DN_RENAME      0x00000010      /* File renamed */
-#define DN_ATTRIB      0x00000020      /* File changed attibutes */
-#define DN_MULTISHOT   0x80000000      /* Don't remove notifier */
-
-#define AT_FDCWD               -100    /* Special value used to indicate
-                                           openat should use the current
-                                           working directory. */
-#define AT_SYMLINK_NOFOLLOW    0x100   /* Do not follow symbolic links.  */
-#define AT_REMOVEDIR           0x200   /* Remove directory instead of
-                                           unlinking file.  */
-#define AT_SYMLINK_FOLLOW      0x400   /* Follow symbolic links.  */
-#define AT_NO_AUTOMOUNT                0x800   /* Suppress terminal automount traversal */
-#define AT_EMPTY_PATH          0x1000  /* Allow empty relative pathname */
-
-#ifdef __KERNEL__
 
 #ifndef force_o_largefile
 #define force_o_largefile() (BITS_PER_LONG != 32)
@@ -74,6 +28,4 @@
 #define IS_SETLK(cmd)  (IS_SETLK32(cmd)  || IS_SETLK64(cmd))
 #define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd))
 
-#endif /* __KERNEL__ */
-
 #endif
index 72202b1b9a6a0e4fdd1184ee644e4d30f342b94a..69275bccc3e486d53ca3a36a922dba8ea8908a66 100644 (file)
@@ -1,384 +1,8 @@
 #ifndef _LINUX_FD_H
 #define _LINUX_FD_H
 
-#include <linux/ioctl.h>
-#include <linux/compiler.h>
+#include <uapi/linux/fd.h>
 
-/* New file layout: Now the ioctl definitions immediately follow the
- * definitions of the structures that they use */
-
-/*
- * Geometry
- */
-struct floppy_struct {
-       unsigned int    size,           /* nr of sectors total */
-                       sect,           /* sectors per track */
-                       head,           /* nr of heads */
-                       track,          /* nr of tracks */
-                       stretch;        /* bit 0 !=0 means double track steps */
-                                       /* bit 1 != 0 means swap sides */
-                                       /* bits 2..9 give the first sector */
-                                       /*  number (the LSB is flipped) */
-#define FD_STRETCH 1
-#define FD_SWAPSIDES 2
-#define FD_ZEROBASED 4
-#define FD_SECTBASEMASK 0x3FC
-#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
-#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
-
-       unsigned char   gap,            /* gap1 size */
-
-                       rate,           /* data rate. |= 0x40 for perpendicular */
-#define FD_2M 0x4
-#define FD_SIZECODEMASK 0x38
-#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
-#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
-                            512 : 128 << FD_SIZECODE(floppy) )
-#define FD_PERP 0x40
-
-                       spec1,          /* stepping rate, head unload time */
-                       fmt_gap;        /* gap2 size */
-       const char      * name; /* used only for predefined formats */
-};
-
-
-/* commands needing write access have 0x40 set */
-/* commands needing super user access have 0x80 set */
-
-#define FDCLRPRM _IO(2, 0x41)
-/* clear user-defined parameters */
-
-#define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 
-#define FDSETMEDIAPRM FDSETPRM
-/* set user-defined parameters for current media */
-
-#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 
-#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
-#define FDDEFMEDIAPRM FDDEFPRM
-#define FDGETMEDIAPRM FDGETPRM
-/* set/get disk parameters */
-
-
-#define        FDMSGON  _IO(2,0x45)
-#define        FDMSGOFF _IO(2,0x46)
-/* issue/don't issue kernel messages on media type change */
-
-
-/* 
- * Formatting (obsolete)
- */
-#define FD_FILL_BYTE 0xF6 /* format fill byte. */
-
-struct format_descr {
-       unsigned int device,head,track;
-};
-
-#define FDFMTBEG _IO(2,0x47)
-/* begin formatting a disk */
-#define        FDFMTTRK _IOW(2,0x48, struct format_descr)
-/* format the specified track */
-#define FDFMTEND _IO(2,0x49)
-/* end formatting a disk */
-
-
-/*
- * Error thresholds
- */
-struct floppy_max_errors {
-       unsigned int
-         abort,      /* number of errors to be reached before aborting */
-         read_track, /* maximal number of errors permitted to read an
-                      * entire track at once */
-         reset,      /* maximal number of errors before a reset is tried */
-         recal,      /* maximal number of errors before a recalibrate is
-                      * tried */
-
-         /*
-          * Threshold for reporting FDC errors to the console.
-          * Setting this to zero may flood your screen when using
-          * ultra cheap floppies ;-)
-          */
-         reporting;
-
-};
-
-#define FDSETEMSGTRESH _IO(2,0x4a)
-/* set fdc error reporting threshold */
-
-#define FDFLUSH  _IO(2,0x4b)
-/* flush buffers for media; either for verifying media, or for
- * handling a media change without closing the file descriptor */
-
-#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
-#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
-/* set/get abortion and read_track threshold. See also floppy_drive_params
- * structure */
-
-
-typedef char floppy_drive_name[16];
-#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
-/* get drive type: 5 1/4 or 3 1/2 */
-
-
-/*
- * Drive parameters (user modifiable)
- */
-struct floppy_drive_params {
-       signed char cmos;               /* CMOS type */
-       
-       /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms 
-        * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
-        */
-       unsigned long max_dtr;          /* Step rate, usec */
-       unsigned long hlt;              /* Head load/settle time, msec */
-       unsigned long hut;              /* Head unload time (remnant of 
-                                        * 8" drives) */
-       unsigned long srt;              /* Step rate, usec */
-
-       unsigned long spinup;           /* time needed for spinup (expressed
-                                        * in jiffies) */
-       unsigned long spindown;         /* timeout needed for spindown */
-       unsigned char spindown_offset;  /* decides in which position the disk
-                                        * will stop */
-       unsigned char select_delay;     /* delay to wait after select */
-       unsigned char rps;              /* rotations per second */
-       unsigned char tracks;           /* maximum number of tracks */
-       unsigned long timeout;          /* timeout for interrupt requests */
-       
-       unsigned char interleave_sect;  /* if there are more sectors, use 
-                                        * interleave */
-       
-       struct floppy_max_errors max_errors;
-       
-       char flags;                     /* various flags, including ftd_msg */
-/*
- * Announce successful media type detection and media information loss after
- * disk changes.
- * Also used to enable/disable printing of overrun warnings.
- */
-
-#define FTD_MSG 0x10
-#define FD_BROKEN_DCL 0x20
-#define FD_DEBUG 0x02
-#define FD_SILENT_DCL_CLEAR 0x4
-#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware 
-                               considerations */
-
-       char read_track;                /* use readtrack during probing? */
-
-/*
- * Auto-detection. Each drive type has eight formats which are
- * used in succession to try to read the disk. If the FDC cannot lock onto
- * the disk, the next format is tried. This uses the variable 'probing'.
- */
-       short autodetect[8];            /* autodetected formats */
-       
-       int checkfreq; /* how often should the drive be checked for disk 
-                       * changes */
-       int native_format; /* native format of this drive */
-};
-
-enum {
-       FD_NEED_TWADDLE_BIT,    /* more magic */
-       FD_VERIFY_BIT,          /* inquire for write protection */
-       FD_DISK_NEWCHANGE_BIT,  /* change detected, and no action undertaken yet
-                                * to clear media change status */
-       FD_UNUSED_BIT,
-       FD_DISK_CHANGED_BIT,    /* disk has been changed since last i/o */
-       FD_DISK_WRITABLE_BIT    /* disk is writable */
-};
-
-#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
-#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
-/* set/get drive parameters */
-
-
-/*
- * Current drive state (not directly modifiable by user, readonly)
- */
-struct floppy_drive_struct {
-       unsigned long flags;
-/* values for these flags */
-#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
-#define FD_VERIFY (1 << FD_VERIFY_BIT)
-#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
-#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
-#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
-
-       unsigned long spinup_date;
-       unsigned long select_date;
-       unsigned long first_read_date;
-       short probed_format;
-       short track; /* current track */
-       short maxblock; /* id of highest block read */
-       short maxtrack; /* id of highest half track read */
-       int generation; /* how many diskchanges? */
-
-/*
- * (User-provided) media information is _not_ discarded after a media change
- * if the corresponding keep_data flag is non-zero. Positive values are
- * decremented after each probe.
- */
-       int keep_data;
-       
-       /* Prevent "aliased" accesses. */
-       int fd_ref;
-       int fd_device;
-       unsigned long last_checked; /* when was the drive last checked for a disk 
-                          * change? */
-       
-       char *dmabuf;
-       int bufblocks;
-};
-
-#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
-#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
-/* get drive state: GET returns the cached state, POLL polls for new state */
-
-
-/*
- * reset FDC
- */
-enum reset_mode {
-       FD_RESET_IF_NEEDED,     /* reset only if the reset flags is set */
-       FD_RESET_IF_RAWCMD,     /* obsolete */
-       FD_RESET_ALWAYS         /* reset always */
-};
-#define FDRESET _IO(2, 0x54)
-
-
-/*
- * FDC state
- */
-struct floppy_fdc_state {      
-       int spec1;              /* spec1 value last used */
-       int spec2;              /* spec2 value last used */
-       int dtr;
-       unsigned char version;  /* FDC version code */
-       unsigned char dor;
-       unsigned long address;  /* io address */
-       unsigned int rawcmd:2;
-       unsigned int reset:1;
-       unsigned int need_configure:1;
-       unsigned int perp_mode:2;
-       unsigned int has_fifo:1;
-       unsigned int driver_version;    /* version code for floppy driver */
-#define FD_DRIVER_VERSION 0x100
-/* user programs using the floppy API should use floppy_fdc_state to
- * get the version number of the floppy driver that they are running
- * on. If this version number is bigger than the one compiled into the
- * user program (the FD_DRIVER_VERSION define), it should be prepared
- * to bigger structures
- */
-
-       unsigned char track[4];
-       /* Position of the heads of the 4 units attached to this FDC,
-        * as stored on the FDC. In the future, the position as stored
-        * on the FDC might not agree with the actual physical
-        * position of these drive heads. By allowing such
-        * disagreement, it will be possible to reset the FDC without
-        * incurring the expensive cost of repositioning all heads.
-        * Right now, these positions are hard wired to 0. */
-
-};
-
-#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
-
-
-/*
- * Asynchronous Write error tracking
- */
-struct floppy_write_errors {
-       /* Write error logging.
-        *
-        * These fields can be cleared with the FDWERRORCLR ioctl.
-        * Only writes that were attempted but failed due to a physical media
-        * error are logged.  write(2) calls that fail and return an error code
-        * to the user process are not counted.
-        */
-
-       unsigned int write_errors;  /* number of physical write errors 
-                                    * encountered */
-       
-       /* position of first and last write errors */
-       unsigned long first_error_sector;
-       int           first_error_generation;
-       unsigned long last_error_sector;
-       int           last_error_generation;
-       
-       unsigned int badness; /* highest retry count for a read or write 
-                              * operation */
-};
-
-#define FDWERRORCLR  _IO(2, 0x56)
-/* clear write error and badness information */
-#define FDWERRORGET  _IOR(2, 0x17, struct floppy_write_errors)
-/* get write error and badness information */
-
-
-/*
- * Raw commands
- */
-/* new interface flag: now we can do them in batches */
-#define FDHAVEBATCHEDRAWCMD
-
-struct floppy_raw_cmd {
-       unsigned int flags;
-#define FD_RAW_READ 1
-#define FD_RAW_WRITE 2
-#define FD_RAW_NO_MOTOR 4
-#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
-#define FD_RAW_INTR 8    /* wait for an interrupt */
-#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
-#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command 
-                                   * completion */
-#define FD_RAW_NEED_DISK 0x40  /* this command needs a disk to be present */
-#define FD_RAW_NEED_SEEK 0x80  /* this command uses an implied seek (soft) */
-
-/* more "in" flags */
-#define FD_RAW_MORE 0x100  /* more records follow */
-#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
-#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
-#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
-                                 * detection too */
-
-/* more "out" flags */
-#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
-#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
-
-       void __user *data;
-       char *kernel_data; /* location of data buffer in the kernel */
-       struct floppy_raw_cmd *next; /* used for chaining of raw cmd's 
-                                     * within the kernel */
-       long length; /* in: length of dma transfer. out: remaining bytes */
-       long phys_length; /* physical length, if different from dma length */
-       int buffer_length; /* length of allocated buffer */
-
-       unsigned char rate;
-       unsigned char cmd_count;
-       unsigned char cmd[16];
-       unsigned char reply_count;
-       unsigned char reply[16];
-       int track;
-       int resultcode;
-
-       int reserved1;
-       int reserved2;
-};
-
-#define FDRAWCMD _IO(2, 0x58)
-/* send a raw command to the fdc. Structure size not included, because of
- * batches */
-
-#define FDTWADDLE _IO(2, 0x59)
-/* flicker motor-on bit before reading a sector. Experimental */
-
-
-#define FDEJECT _IO(2, 0x5a)
-/* eject the disk */
-
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 
@@ -398,5 +22,3 @@ struct compat_floppy_struct {
 #define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct)
 #endif
 #endif
-
-#endif
index 2ded090e10f4e511461cacdbfcdc031dc1dd0b3e..24d251f3bab0711c26231d67352df1ca140e608a 100644 (file)
 /*
  * Linux Socket Filter Data Structures
  */
-
 #ifndef __LINUX_FILTER_H__
 #define __LINUX_FILTER_H__
 
-#include <linux/compiler.h>
-#include <linux/types.h>
-
-#ifdef __KERNEL__
 #include <linux/atomic.h>
 #include <linux/compat.h>
-#endif
-
-/*
- * Current version of the filter code architecture.
- */
-#define BPF_MAJOR_VERSION 1
-#define BPF_MINOR_VERSION 1
-
-/*
- *     Try and keep these values and structures similar to BSD, especially
- *     the BPF code definitions which need to match so you can share filters
- */
-struct sock_filter {   /* Filter block */
-       __u16   code;   /* Actual filter code */
-       __u8    jt;     /* Jump true */
-       __u8    jf;     /* Jump false */
-       __u32   k;      /* Generic multiuse field */
-};
-
-struct sock_fprog {    /* Required for SO_ATTACH_FILTER. */
-       unsigned short          len;    /* Number of filter blocks */
-       struct sock_filter __user *filter;
-};
-
-/*
- * Instruction classes
- */
-
-#define BPF_CLASS(code) ((code) & 0x07)
-#define         BPF_LD          0x00
-#define         BPF_LDX         0x01
-#define         BPF_ST          0x02
-#define         BPF_STX         0x03
-#define         BPF_ALU         0x04
-#define         BPF_JMP         0x05
-#define         BPF_RET         0x06
-#define         BPF_MISC        0x07
-
-/* ld/ldx fields */
-#define BPF_SIZE(code)  ((code) & 0x18)
-#define         BPF_W           0x00
-#define         BPF_H           0x08
-#define         BPF_B           0x10
-#define BPF_MODE(code)  ((code) & 0xe0)
-#define         BPF_IMM         0x00
-#define         BPF_ABS         0x20
-#define         BPF_IND         0x40
-#define         BPF_MEM         0x60
-#define         BPF_LEN         0x80
-#define         BPF_MSH         0xa0
-
-/* alu/jmp fields */
-#define BPF_OP(code)    ((code) & 0xf0)
-#define         BPF_ADD         0x00
-#define         BPF_SUB         0x10
-#define         BPF_MUL         0x20
-#define         BPF_DIV         0x30
-#define         BPF_OR          0x40
-#define         BPF_AND         0x50
-#define         BPF_LSH         0x60
-#define         BPF_RSH         0x70
-#define         BPF_NEG         0x80
-#define                BPF_MOD         0x90
-#define                BPF_XOR         0xa0
-
-#define         BPF_JA          0x00
-#define         BPF_JEQ         0x10
-#define         BPF_JGT         0x20
-#define         BPF_JGE         0x30
-#define         BPF_JSET        0x40
-#define BPF_SRC(code)   ((code) & 0x08)
-#define         BPF_K           0x00
-#define         BPF_X           0x08
-
-/* ret - BPF_K and BPF_X also apply */
-#define BPF_RVAL(code)  ((code) & 0x18)
-#define         BPF_A           0x10
-
-/* misc */
-#define BPF_MISCOP(code) ((code) & 0xf8)
-#define         BPF_TAX         0x00
-#define         BPF_TXA         0x80
-
-#ifndef BPF_MAXINSNS
-#define BPF_MAXINSNS 4096
-#endif
-
-/*
- * Macros for filter block array initializers.
- */
-#ifndef BPF_STMT
-#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
-#endif
-#ifndef BPF_JUMP
-#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
-#endif
-
-/*
- * Number of scratch memory words for: BPF_ST and BPF_STX
- */
-#define BPF_MEMWORDS 16
-
-/* RATIONALE. Negative offsets are invalid in BPF.
-   We use them to reference ancillary data.
-   Unlike introduction new instructions, it does not break
-   existing compilers/optimizers.
- */
-#define SKF_AD_OFF    (-0x1000)
-#define SKF_AD_PROTOCOL 0
-#define SKF_AD_PKTTYPE         4
-#define SKF_AD_IFINDEX         8
-#define SKF_AD_NLATTR  12
-#define SKF_AD_NLATTR_NEST     16
-#define SKF_AD_MARK    20
-#define SKF_AD_QUEUE   24
-#define SKF_AD_HATYPE  28
-#define SKF_AD_RXHASH  32
-#define SKF_AD_CPU     36
-#define SKF_AD_ALU_XOR_X       40
-#define SKF_AD_MAX     44
-#define SKF_NET_OFF   (-0x100000)
-#define SKF_LL_OFF    (-0x200000)
-
-#ifdef __KERNEL__
+#include <uapi/linux/filter.h>
 
 #ifdef CONFIG_COMPAT
 /*
@@ -254,6 +125,4 @@ enum {
        BPF_S_ANC_SECCOMP_LD_W,
 };
 
-#endif /* __KERNEL__ */
-
 #endif /* __LINUX_FILTER_H__ */
index ec56852e2659616c4df9c5956f1b144bd8c1e9e4..2c1eb15c4ba4da60337075b2c4a6a579f361254a 100644 (file)
@@ -6,58 +6,12 @@
  * This file provides the definitions and structures needed to
  * support uClinux flat-format executables.
  */
-
 #ifndef _LINUX_FLAT_H
 #define _LINUX_FLAT_H
 
-#ifdef __KERNEL__
 #include <asm/flat.h>
-#endif
-
-#define        FLAT_VERSION                    0x00000004L
-
-#ifdef CONFIG_BINFMT_SHARED_FLAT
-#define        MAX_SHARED_LIBS                 (4)
-#else
-#define        MAX_SHARED_LIBS                 (1)
-#endif
-
-/*
- * To make everything easier to port and manage cross platform
- * development,  all fields are in network byte order.
- */
+#include <uapi/linux/flat.h>
 
-struct flat_hdr {
-       char magic[4];
-       unsigned long rev;          /* version (as above) */
-       unsigned long entry;        /* Offset of first executable instruction
-                                      with text segment from beginning of file */
-       unsigned long data_start;   /* Offset of data segment from beginning of
-                                      file */
-       unsigned long data_end;     /* Offset of end of data segment
-                                      from beginning of file */
-       unsigned long bss_end;      /* Offset of end of bss segment from beginning
-                                      of file */
-
-       /* (It is assumed that data_end through bss_end forms the bss segment.) */
-
-       unsigned long stack_size;   /* Size of stack, in bytes */
-       unsigned long reloc_start;  /* Offset of relocation records from
-                                      beginning of file */
-       unsigned long reloc_count;  /* Number of relocation records */
-       unsigned long flags;       
-       unsigned long build_date;   /* When the program/library was built */
-       unsigned long filler[5];    /* Reservered, set to zero */
-};
-
-#define FLAT_FLAG_RAM    0x0001 /* load program entirely into RAM */
-#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
-#define FLAT_FLAG_GZIP   0x0004 /* all but the header is compressed */
-#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
-#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
-
-
-#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
 /*
  * While it would be nice to keep this header clean,  users of older
  * tools still need this support in the kernel.  So this section is
@@ -95,6 +49,4 @@ typedef union {
        } reloc;
 } flat_v2_reloc_t;
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_FLAT_H */
index 65fbf571023f6f8f2ffb48f686e7fc33fab023c7..001c7cff2d4826e4e54b6395596483030c86fc11 100644 (file)
 #ifndef _LINUX_FS_H
 #define _LINUX_FS_H
 
-/*
- * This file has definitions for some important file table
- * structures etc.
- */
 
-#include <linux/limits.h>
-#include <linux/ioctl.h>
+#include <linux/linkage.h>
+#include <linux/wait.h>
+#include <linux/kdev_t.h>
+#include <linux/dcache.h>
+#include <linux/path.h>
+#include <linux/stat.h>
+#include <linux/cache.h>
+#include <linux/list.h>
+#include <linux/radix-tree.h>
+#include <linux/rbtree.h>
+#include <linux/init.h>
+#include <linux/pid.h>
+#include <linux/bug.h>
+#include <linux/mutex.h>
+#include <linux/capability.h>
+#include <linux/semaphore.h>
+#include <linux/fiemap.h>
+#include <linux/rculist_bl.h>
+#include <linux/atomic.h>
+#include <linux/shrinker.h>
+#include <linux/migrate_mode.h>
+#include <linux/uidgid.h>
+#include <linux/lockdep.h>
+#include <linux/percpu-rwsem.h>
 #include <linux/blk_types.h>
-#include <linux/types.h>
-
-/*
- * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
- * the file limit at runtime and only root can increase the per-process
- * nr_file rlimit, so it's safe to set up a ridiculously high absolute
- * upper limit on files-per-process.
- *
- * Some programs (notably those using select()) may have to be 
- * recompiled to take full advantage of the new limits..  
- */
-
-/* Fixed constants first: */
-#undef NR_OPEN
-#define INR_OPEN_CUR 1024      /* Initial setting for nfile rlimits */
-#define INR_OPEN_MAX 4096      /* Hard limit for nfile rlimits */
-
-#define BLOCK_SIZE_BITS 10
-#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
-
-#define SEEK_SET       0       /* seek relative to beginning of file */
-#define SEEK_CUR       1       /* seek relative to current file position */
-#define SEEK_END       2       /* seek relative to end of file */
-#define SEEK_DATA      3       /* seek to the next data */
-#define SEEK_HOLE      4       /* seek to the next hole */
-#define SEEK_MAX       SEEK_HOLE
-
-struct fstrim_range {
-       __u64 start;
-       __u64 len;
-       __u64 minlen;
-};
-
-/* And dynamically-tunable limits and defaults: */
-struct files_stat_struct {
-       unsigned long nr_files;         /* read only */
-       unsigned long nr_free_files;    /* read only */
-       unsigned long max_files;                /* tunable */
-};
-
-struct inodes_stat_t {
-       int nr_inodes;
-       int nr_unused;
-       int dummy[5];           /* padding for sysctl ABI compatibility */
-};
-
-
-#define NR_FILE  8192  /* this can well be larger on a larger system */
-
-#define MAY_EXEC               0x00000001
-#define MAY_WRITE              0x00000002
-#define MAY_READ               0x00000004
-#define MAY_APPEND             0x00000008
-#define MAY_ACCESS             0x00000010
-#define MAY_OPEN               0x00000020
-#define MAY_CHDIR              0x00000040
-/* called from RCU mode, don't block */
-#define MAY_NOT_BLOCK          0x00000080
-
-/*
- * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond
- * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
- */
-
-/* file is open for reading */
-#define FMODE_READ             ((__force fmode_t)0x1)
-/* file is open for writing */
-#define FMODE_WRITE            ((__force fmode_t)0x2)
-/* file is seekable */
-#define FMODE_LSEEK            ((__force fmode_t)0x4)
-/* file can be accessed using pread */
-#define FMODE_PREAD            ((__force fmode_t)0x8)
-/* file can be accessed using pwrite */
-#define FMODE_PWRITE           ((__force fmode_t)0x10)
-/* File is opened for execution with sys_execve / sys_uselib */
-#define FMODE_EXEC             ((__force fmode_t)0x20)
-/* File is opened with O_NDELAY (only set for block devices) */
-#define FMODE_NDELAY           ((__force fmode_t)0x40)
-/* File is opened with O_EXCL (only set for block devices) */
-#define FMODE_EXCL             ((__force fmode_t)0x80)
-/* File is opened using open(.., 3, ..) and is writeable only for ioctls
-   (specialy hack for floppy.c) */
-#define FMODE_WRITE_IOCTL      ((__force fmode_t)0x100)
-/* 32bit hashes as llseek() offset (for directories) */
-#define FMODE_32BITHASH         ((__force fmode_t)0x200)
-/* 64bit hashes as llseek() offset (for directories) */
-#define FMODE_64BITHASH         ((__force fmode_t)0x400)
 
-/*
- * Don't update ctime and mtime.
- *
- * Currently a special hack for the XFS open_by_handle ioctl, but we'll
- * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
- */
-#define FMODE_NOCMTIME         ((__force fmode_t)0x800)
+#include <asm/byteorder.h>
+#include <uapi/linux/fs.h>
 
-/* Expect random access pattern */
-#define FMODE_RANDOM           ((__force fmode_t)0x1000)
+struct export_operations;
+struct hd_geometry;
+struct iovec;
+struct nameidata;
+struct kiocb;
+struct kobject;
+struct pipe_inode_info;
+struct poll_table_struct;
+struct kstatfs;
+struct vm_area_struct;
+struct vfsmount;
+struct cred;
+struct swap_info_struct;
 
-/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
-#define FMODE_UNSIGNED_OFFSET  ((__force fmode_t)0x2000)
+extern void __init inode_init(void);
+extern void __init inode_init_early(void);
+extern void __init files_init(unsigned long);
 
-/* File is opened with O_PATH; almost nothing can be done with it */
-#define FMODE_PATH             ((__force fmode_t)0x4000)
+extern struct files_stat_struct files_stat;
+extern unsigned long get_max_files(void);
+extern int sysctl_nr_open;
+extern struct inodes_stat_t inodes_stat;
+extern int leases_enable, lease_break_time;
+extern int sysctl_protected_symlinks;
+extern int sysctl_protected_hardlinks;
 
-/* File was opened by fanotify and shouldn't generate fanotify events */
-#define FMODE_NONOTIFY         ((__force fmode_t)0x1000000)
+struct buffer_head;
+typedef int (get_block_t)(struct inode *inode, sector_t iblock,
+                       struct buffer_head *bh_result, int create);
+typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
+                       ssize_t bytes, void *private, int ret,
+                       bool is_async);
 
 /*
  * The below are the various read and write types that we support. Some of
@@ -175,284 +122,6 @@ struct inodes_stat_t {
 #define WRITE_FUA              (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
 #define WRITE_FLUSH_FUA                (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
 
-
-/*
- * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
- * that indicates that they should check the contents of the iovec are
- * valid, but not check the memory that the iovec elements
- * points too.
- */
-#define CHECK_IOVEC_ONLY -1
-
-#define SEL_IN         1
-#define SEL_OUT                2
-#define SEL_EX         4
-
-/* public flags for file_system_type */
-#define FS_REQUIRES_DEV 1 
-#define FS_BINARY_MOUNTDATA 2
-#define FS_HAS_SUBTYPE 4
-#define FS_REVAL_DOT   16384   /* Check the paths ".", ".." for staleness */
-#define FS_RENAME_DOES_D_MOVE  32768   /* FS will handle d_move()
-                                        * during rename() internally.
-                                        */
-
-/*
- * These are the fs-independent mount-flags: up to 32 flags are supported
- */
-#define MS_RDONLY       1      /* Mount read-only */
-#define MS_NOSUID       2      /* Ignore suid and sgid bits */
-#define MS_NODEV        4      /* Disallow access to device special files */
-#define MS_NOEXEC       8      /* Disallow program execution */
-#define MS_SYNCHRONOUS 16      /* Writes are synced at once */
-#define MS_REMOUNT     32      /* Alter flags of a mounted FS */
-#define MS_MANDLOCK    64      /* Allow mandatory locks on an FS */
-#define MS_DIRSYNC     128     /* Directory modifications are synchronous */
-#define MS_NOATIME     1024    /* Do not update access times. */
-#define MS_NODIRATIME  2048    /* Do not update directory access times */
-#define MS_BIND                4096
-#define MS_MOVE                8192
-#define MS_REC         16384
-#define MS_VERBOSE     32768   /* War is peace. Verbosity is silence.
-                                  MS_VERBOSE is deprecated. */
-#define MS_SILENT      32768
-#define MS_POSIXACL    (1<<16) /* VFS does not apply the umask */
-#define MS_UNBINDABLE  (1<<17) /* change to unbindable */
-#define MS_PRIVATE     (1<<18) /* change to private */
-#define MS_SLAVE       (1<<19) /* change to slave */
-#define MS_SHARED      (1<<20) /* change to shared */
-#define MS_RELATIME    (1<<21) /* Update atime relative to mtime/ctime. */
-#define MS_KERNMOUNT   (1<<22) /* this is a kern_mount call */
-#define MS_I_VERSION   (1<<23) /* Update inode I_version field */
-#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
-#define MS_NOSEC       (1<<28)
-#define MS_BORN                (1<<29)
-#define MS_ACTIVE      (1<<30)
-#define MS_NOUSER      (1<<31)
-
-/*
- * Superblock flags that can be altered by MS_REMOUNT
- */
-#define MS_RMT_MASK    (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-/*
- * Old magic mount flag and mask
- */
-#define MS_MGC_VAL 0xC0ED0000
-#define MS_MGC_MSK 0xffff0000
-
-/* Inode flags - they have nothing to superblock flags now */
-
-#define S_SYNC         1       /* Writes are synced at once */
-#define S_NOATIME      2       /* Do not update access times */
-#define S_APPEND       4       /* Append-only file */
-#define S_IMMUTABLE    8       /* Immutable file */
-#define S_DEAD         16      /* removed, but still open directory */
-#define S_NOQUOTA      32      /* Inode is not counted to quota */
-#define S_DIRSYNC      64      /* Directory modifications are synchronous */
-#define S_NOCMTIME     128     /* Do not update file c/mtime */
-#define S_SWAPFILE     256     /* Do not truncate: swapon got its bmaps */
-#define S_PRIVATE      512     /* Inode is fs-internal */
-#define S_IMA          1024    /* Inode has an associated IMA struct */
-#define S_AUTOMOUNT    2048    /* Automount/referral quasi-directory */
-#define S_NOSEC                4096    /* no suid or xattr security attributes */
-
-/*
- * Note that nosuid etc flags are inode-specific: setting some file-system
- * flags just means all the inodes inherit those flags by default. It might be
- * possible to override it selectively if you really wanted to with some
- * ioctl() that is not currently implemented.
- *
- * Exception: MS_RDONLY is always applied to the entire file system.
- *
- * Unfortunately, it is possible to change a filesystems flags with it mounted
- * with files in use.  This means that all of the inodes will not have their
- * i_flags updated.  Hence, i_flags no longer inherit the superblock mount
- * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
- */
-#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
-
-#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
-#define IS_SYNC(inode)         (__IS_FLG(inode, MS_SYNCHRONOUS) || \
-                                       ((inode)->i_flags & S_SYNC))
-#define IS_DIRSYNC(inode)      (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
-                                       ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
-#define IS_MANDLOCK(inode)     __IS_FLG(inode, MS_MANDLOCK)
-#define IS_NOATIME(inode)   __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
-#define IS_I_VERSION(inode)   __IS_FLG(inode, MS_I_VERSION)
-
-#define IS_NOQUOTA(inode)      ((inode)->i_flags & S_NOQUOTA)
-#define IS_APPEND(inode)       ((inode)->i_flags & S_APPEND)
-#define IS_IMMUTABLE(inode)    ((inode)->i_flags & S_IMMUTABLE)
-#define IS_POSIXACL(inode)     __IS_FLG(inode, MS_POSIXACL)
-
-#define IS_DEADDIR(inode)      ((inode)->i_flags & S_DEAD)
-#define IS_NOCMTIME(inode)     ((inode)->i_flags & S_NOCMTIME)
-#define IS_SWAPFILE(inode)     ((inode)->i_flags & S_SWAPFILE)
-#define IS_PRIVATE(inode)      ((inode)->i_flags & S_PRIVATE)
-#define IS_IMA(inode)          ((inode)->i_flags & S_IMA)
-#define IS_AUTOMOUNT(inode)    ((inode)->i_flags & S_AUTOMOUNT)
-#define IS_NOSEC(inode)                ((inode)->i_flags & S_NOSEC)
-
-/* the read-only stuff doesn't really belong here, but any other place is
-   probably as bad and I don't want to create yet another include file. */
-
-#define BLKROSET   _IO(0x12,93)        /* set device read-only (0 = read-write) */
-#define BLKROGET   _IO(0x12,94)        /* get read-only status (0 = read_write) */
-#define BLKRRPART  _IO(0x12,95)        /* re-read partition table */
-#define BLKGETSIZE _IO(0x12,96)        /* return device size /512 (long *arg) */
-#define BLKFLSBUF  _IO(0x12,97)        /* flush buffer cache */
-#define BLKRASET   _IO(0x12,98)        /* set read ahead for block device */
-#define BLKRAGET   _IO(0x12,99)        /* get current read ahead setting */
-#define BLKFRASET  _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
-#define BLKFRAGET  _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
-#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
-#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
-#define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
-#if 0
-#define BLKPG      _IO(0x12,105)/* See blkpg.h */
-
-/* Some people are morons.  Do not use sizeof! */
-
-#define BLKELVGET  _IOR(0x12,106,size_t)/* elevator get */
-#define BLKELVSET  _IOW(0x12,107,size_t)/* elevator set */
-/* This was here just to show that the number is taken -
-   probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
-#endif
-/* A jump here: 108-111 have been used for various private purposes. */
-#define BLKBSZGET  _IOR(0x12,112,size_t)
-#define BLKBSZSET  _IOW(0x12,113,size_t)
-#define BLKGETSIZE64 _IOR(0x12,114,size_t)     /* return device size in bytes (u64 *arg) */
-#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
-#define BLKTRACESTART _IO(0x12,116)
-#define BLKTRACESTOP _IO(0x12,117)
-#define BLKTRACETEARDOWN _IO(0x12,118)
-#define BLKDISCARD _IO(0x12,119)
-#define BLKIOMIN _IO(0x12,120)
-#define BLKIOOPT _IO(0x12,121)
-#define BLKALIGNOFF _IO(0x12,122)
-#define BLKPBSZGET _IO(0x12,123)
-#define BLKDISCARDZEROES _IO(0x12,124)
-#define BLKSECDISCARD _IO(0x12,125)
-#define BLKROTATIONAL _IO(0x12,126)
-#define BLKZEROOUT _IO(0x12,127)
-
-#define BMAP_IOCTL 1           /* obsolete - kept for compatibility */
-#define FIBMAP    _IO(0x00,1)  /* bmap access */
-#define FIGETBSZ   _IO(0x00,2) /* get the block size used for bmap */
-#define FIFREEZE       _IOWR('X', 119, int)    /* Freeze */
-#define FITHAW         _IOWR('X', 120, int)    /* Thaw */
-#define FITRIM         _IOWR('X', 121, struct fstrim_range)    /* Trim */
-
-#define        FS_IOC_GETFLAGS                 _IOR('f', 1, long)
-#define        FS_IOC_SETFLAGS                 _IOW('f', 2, long)
-#define        FS_IOC_GETVERSION               _IOR('v', 1, long)
-#define        FS_IOC_SETVERSION               _IOW('v', 2, long)
-#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
-#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
-#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
-#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
-#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
-
-/*
- * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
- */
-#define        FS_SECRM_FL                     0x00000001 /* Secure deletion */
-#define        FS_UNRM_FL                      0x00000002 /* Undelete */
-#define        FS_COMPR_FL                     0x00000004 /* Compress file */
-#define FS_SYNC_FL                     0x00000008 /* Synchronous updates */
-#define FS_IMMUTABLE_FL                        0x00000010 /* Immutable file */
-#define FS_APPEND_FL                   0x00000020 /* writes to file may only append */
-#define FS_NODUMP_FL                   0x00000040 /* do not dump file */
-#define FS_NOATIME_FL                  0x00000080 /* do not update atime */
-/* Reserved for compression usage... */
-#define FS_DIRTY_FL                    0x00000100
-#define FS_COMPRBLK_FL                 0x00000200 /* One or more compressed clusters */
-#define FS_NOCOMP_FL                   0x00000400 /* Don't compress */
-#define FS_ECOMPR_FL                   0x00000800 /* Compression error */
-/* End compression flags --- maybe not all used */
-#define FS_BTREE_FL                    0x00001000 /* btree format dir */
-#define FS_INDEX_FL                    0x00001000 /* hash-indexed directory */
-#define FS_IMAGIC_FL                   0x00002000 /* AFS directory */
-#define FS_JOURNAL_DATA_FL             0x00004000 /* Reserved for ext3 */
-#define FS_NOTAIL_FL                   0x00008000 /* file tail should not be merged */
-#define FS_DIRSYNC_FL                  0x00010000 /* dirsync behaviour (directories only) */
-#define FS_TOPDIR_FL                   0x00020000 /* Top of directory hierarchies*/
-#define FS_EXTENT_FL                   0x00080000 /* Extents */
-#define FS_DIRECTIO_FL                 0x00100000 /* Use direct i/o */
-#define FS_NOCOW_FL                    0x00800000 /* Do not cow file */
-#define FS_RESERVED_FL                 0x80000000 /* reserved for ext2 lib */
-
-#define FS_FL_USER_VISIBLE             0x0003DFFF /* User visible flags */
-#define FS_FL_USER_MODIFIABLE          0x000380FF /* User modifiable flags */
-
-
-#define SYNC_FILE_RANGE_WAIT_BEFORE    1
-#define SYNC_FILE_RANGE_WRITE          2
-#define SYNC_FILE_RANGE_WAIT_AFTER     4
-
-#ifdef __KERNEL__
-
-#include <linux/linkage.h>
-#include <linux/wait.h>
-#include <linux/kdev_t.h>
-#include <linux/dcache.h>
-#include <linux/path.h>
-#include <linux/stat.h>
-#include <linux/cache.h>
-#include <linux/list.h>
-#include <linux/radix-tree.h>
-#include <linux/rbtree.h>
-#include <linux/init.h>
-#include <linux/pid.h>
-#include <linux/bug.h>
-#include <linux/mutex.h>
-#include <linux/capability.h>
-#include <linux/semaphore.h>
-#include <linux/fiemap.h>
-#include <linux/rculist_bl.h>
-#include <linux/atomic.h>
-#include <linux/shrinker.h>
-#include <linux/migrate_mode.h>
-#include <linux/uidgid.h>
-#include <linux/lockdep.h>
-#include <linux/percpu-rwsem.h>
-
-#include <asm/byteorder.h>
-
-struct export_operations;
-struct hd_geometry;
-struct iovec;
-struct nameidata;
-struct kiocb;
-struct kobject;
-struct pipe_inode_info;
-struct poll_table_struct;
-struct kstatfs;
-struct vm_area_struct;
-struct vfsmount;
-struct cred;
-struct swap_info_struct;
-
-extern void __init inode_init(void);
-extern void __init inode_init_early(void);
-extern void __init files_init(unsigned long);
-
-extern struct files_stat_struct files_stat;
-extern unsigned long get_max_files(void);
-extern int sysctl_nr_open;
-extern struct inodes_stat_t inodes_stat;
-extern int leases_enable, lease_break_time;
-extern int sysctl_protected_symlinks;
-extern int sysctl_protected_hardlinks;
-
-struct buffer_head;
-typedef int (get_block_t)(struct inode *inode, sector_t iblock,
-                       struct buffer_head *bh_result, int create);
-typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
-                       ssize_t bytes, void *private, int ret,
-                       bool is_async);
-
 /*
  * Attribute flags.  These should be or-ed together to figure out what
  * has been changed!
@@ -2877,5 +2546,4 @@ static inline void inode_has_no_xattr(struct inode *inode)
                inode->i_flags |= S_NOSEC;
 }
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */
index 1cebaeeeef57a1d416c94f87ec8dcadc491474a3..2a707d7fb32c675a51f35233048a5a850730ec6d 100644 (file)
  * also be included by applications that need to communicate with the driver
  * via the ioctl interface.
  */
-
 #ifndef FSL_HYPERVISOR_H
 #define FSL_HYPERVISOR_H
 
-#include <linux/types.h>
-
-/**
- * struct fsl_hv_ioctl_restart - restart a partition
- * @ret: return error code from the hypervisor
- * @partition: the ID of the partition to restart, or -1 for the
- *             calling partition
- *
- * Used by FSL_HV_IOCTL_PARTITION_RESTART
- */
-struct fsl_hv_ioctl_restart {
-       __u32 ret;
-       __u32 partition;
-};
+#include <uapi/linux/fsl_hypervisor.h>
 
-/**
- * struct fsl_hv_ioctl_status - get a partition's status
- * @ret: return error code from the hypervisor
- * @partition: the ID of the partition to query, or -1 for the
- *             calling partition
- * @status: The returned status of the partition
- *
- * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
- *
- * Values of 'status':
- *    0 = Stopped
- *    1 = Running
- *    2 = Starting
- *    3 = Stopping
- */
-struct fsl_hv_ioctl_status {
-       __u32 ret;
-       __u32 partition;
-       __u32 status;
-};
-
-/**
- * struct fsl_hv_ioctl_start - start a partition
- * @ret: return error code from the hypervisor
- * @partition: the ID of the partition to control
- * @entry_point: The offset within the guest IMA to start execution
- * @load: If non-zero, reload the partition's images before starting
- *
- * Used by FSL_HV_IOCTL_PARTITION_START
- */
-struct fsl_hv_ioctl_start {
-       __u32 ret;
-       __u32 partition;
-       __u32 entry_point;
-       __u32 load;
-};
-
-/**
- * struct fsl_hv_ioctl_stop - stop a partition
- * @ret: return error code from the hypervisor
- * @partition: the ID of the partition to stop, or -1 for the calling
- *             partition
- *
- * Used by FSL_HV_IOCTL_PARTITION_STOP
- */
-struct fsl_hv_ioctl_stop {
-       __u32 ret;
-       __u32 partition;
-};
-
-/**
- * struct fsl_hv_ioctl_memcpy - copy memory between partitions
- * @ret: return error code from the hypervisor
- * @source: the partition ID of the source partition, or -1 for this
- *          partition
- * @target: the partition ID of the target partition, or -1 for this
- *          partition
- * @reserved: reserved, must be set to 0
- * @local_addr: user-space virtual address of a buffer in the local
- *              partition
- * @remote_addr: guest physical address of a buffer in the
- *           remote partition
- * @count: the number of bytes to copy.  Both the local and remote
- *         buffers must be at least 'count' bytes long
- *
- * Used by FSL_HV_IOCTL_MEMCPY
- *
- * The 'local' partition is the partition that calls this ioctl.  The
- * 'remote' partition is a different partition.  The data is copied from
- * the 'source' paritition' to the 'target' partition.
- *
- * The buffer in the remote partition must be guest physically
- * contiguous.
- *
- * This ioctl does not support copying memory between two remote
- * partitions or within the same partition, so either 'source' or
- * 'target' (but not both) must be -1.  In other words, either
- *
- *      source == local and target == remote
- * or
- *      source == remote and target == local
- */
-struct fsl_hv_ioctl_memcpy {
-       __u32 ret;
-       __u32 source;
-       __u32 target;
-       __u32 reserved; /* padding to ensure local_vaddr is aligned */
-       __u64 local_vaddr;
-       __u64 remote_paddr;
-       __u64 count;
-};
-
-/**
- * struct fsl_hv_ioctl_doorbell - ring a doorbell
- * @ret: return error code from the hypervisor
- * @doorbell: the handle of the doorbell to ring doorbell
- *
- * Used by FSL_HV_IOCTL_DOORBELL
- */
-struct fsl_hv_ioctl_doorbell {
-       __u32 ret;
-       __u32 doorbell;
-};
-
-/**
- * struct fsl_hv_ioctl_prop - get/set a device tree property
- * @ret: return error code from the hypervisor
- * @handle: handle of partition whose tree to access
- * @path: virtual address of path name of node to access
- * @propname: virtual address of name of property to access
- * @propval: virtual address of property data buffer
- * @proplen: Size of property data buffer
- * @reserved: reserved, must be set to 0
- *
- * Used by FSL_HV_IOCTL_DOORBELL
- */
-struct fsl_hv_ioctl_prop {
-       __u32 ret;
-       __u32 handle;
-       __u64 path;
-       __u64 propname;
-       __u64 propval;
-       __u32 proplen;
-       __u32 reserved; /* padding to ensure structure is aligned */
-};
-
-/* The ioctl type, documented in ioctl-number.txt */
-#define FSL_HV_IOCTL_TYPE      0xAF
-
-/* Restart another partition */
-#define FSL_HV_IOCTL_PARTITION_RESTART \
-       _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
-
-/* Get a partition's status */
-#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
-       _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
-
-/* Boot another partition */
-#define FSL_HV_IOCTL_PARTITION_START \
-       _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
-
-/* Stop this or another partition */
-#define FSL_HV_IOCTL_PARTITION_STOP \
-       _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
-
-/* Copy data from one partition to another */
-#define FSL_HV_IOCTL_MEMCPY \
-       _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
-
-/* Ring a doorbell */
-#define FSL_HV_IOCTL_DOORBELL \
-       _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
-
-/* Get a property from another guest's device tree */
-#define FSL_HV_IOCTL_GETPROP \
-       _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
-
-/* Set a property in another guest's device tree */
-#define FSL_HV_IOCTL_SETPROP \
-       _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
-
-#ifdef __KERNEL__
 
 /**
  * fsl_hv_event_register() - register a callback for failover events
@@ -237,5 +61,3 @@ int fsl_hv_failover_register(struct notifier_block *nb);
 int fsl_hv_failover_unregister(struct notifier_block *nb);
 
 #endif
-
-#endif
index 1e5a26d7923216e2de6883fff7c4faf6f5507036..b0d95cac826e8f310aee6dfa999c69ee56727bfb 100644 (file)
@@ -1,129 +1,8 @@
 #ifndef _LINUX_FUTEX_H
 #define _LINUX_FUTEX_H
 
-#include <linux/compiler.h>
-#include <linux/types.h>
+#include <uapi/linux/futex.h>
 
-/* Second argument to futex syscall */
-
-
-#define FUTEX_WAIT             0
-#define FUTEX_WAKE             1
-#define FUTEX_FD               2
-#define FUTEX_REQUEUE          3
-#define FUTEX_CMP_REQUEUE      4
-#define FUTEX_WAKE_OP          5
-#define FUTEX_LOCK_PI          6
-#define FUTEX_UNLOCK_PI                7
-#define FUTEX_TRYLOCK_PI       8
-#define FUTEX_WAIT_BITSET      9
-#define FUTEX_WAKE_BITSET      10
-#define FUTEX_WAIT_REQUEUE_PI  11
-#define FUTEX_CMP_REQUEUE_PI   12
-
-#define FUTEX_PRIVATE_FLAG     128
-#define FUTEX_CLOCK_REALTIME   256
-#define FUTEX_CMD_MASK         ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
-
-#define FUTEX_WAIT_PRIVATE     (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
-#define FUTEX_WAKE_PRIVATE     (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
-#define FUTEX_REQUEUE_PRIVATE  (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
-#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
-#define FUTEX_WAKE_OP_PRIVATE  (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
-#define FUTEX_LOCK_PI_PRIVATE  (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
-#define FUTEX_UNLOCK_PI_PRIVATE        (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
-#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
-#define FUTEX_WAIT_BITSET_PRIVATE      (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
-#define FUTEX_WAKE_BITSET_PRIVATE      (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
-#define FUTEX_WAIT_REQUEUE_PI_PRIVATE  (FUTEX_WAIT_REQUEUE_PI | \
-                                        FUTEX_PRIVATE_FLAG)
-#define FUTEX_CMP_REQUEUE_PI_PRIVATE   (FUTEX_CMP_REQUEUE_PI | \
-                                        FUTEX_PRIVATE_FLAG)
-
-/*
- * Support for robust futexes: the kernel cleans up held futexes at
- * thread exit time.
- */
-
-/*
- * Per-lock list entry - embedded in user-space locks, somewhere close
- * to the futex field. (Note: user-space uses a double-linked list to
- * achieve O(1) list add and remove, but the kernel only needs to know
- * about the forward link)
- *
- * NOTE: this structure is part of the syscall ABI, and must not be
- * changed.
- */
-struct robust_list {
-       struct robust_list __user *next;
-};
-
-/*
- * Per-thread list head:
- *
- * NOTE: this structure is part of the syscall ABI, and must only be
- * changed if the change is first communicated with the glibc folks.
- * (When an incompatible change is done, we'll increase the structure
- *  size, which glibc will detect)
- */
-struct robust_list_head {
-       /*
-        * The head of the list. Points back to itself if empty:
-        */
-       struct robust_list list;
-
-       /*
-        * This relative offset is set by user-space, it gives the kernel
-        * the relative position of the futex field to examine. This way
-        * we keep userspace flexible, to freely shape its data-structure,
-        * without hardcoding any particular offset into the kernel:
-        */
-       long futex_offset;
-
-       /*
-        * The death of the thread may race with userspace setting
-        * up a lock's links. So to handle this race, userspace first
-        * sets this field to the address of the to-be-taken lock,
-        * then does the lock acquire, and then adds itself to the
-        * list, and then clears this field. Hence the kernel will
-        * always have full knowledge of all locks that the thread
-        * _might_ have taken. We check the owner TID in any case,
-        * so only truly owned locks will be handled.
-        */
-       struct robust_list __user *list_op_pending;
-};
-
-/*
- * Are there any waiters for this robust futex:
- */
-#define FUTEX_WAITERS          0x80000000
-
-/*
- * The kernel signals via this bit that a thread holding a futex
- * has exited without unlocking the futex. The kernel also does
- * a FUTEX_WAKE on such futexes, after setting the bit, to wake
- * up any possible waiters:
- */
-#define FUTEX_OWNER_DIED       0x40000000
-
-/*
- * The rest of the robust-futex field is for the TID:
- */
-#define FUTEX_TID_MASK         0x3fffffff
-
-/*
- * This limit protects against a deliberately circular list.
- * (Not worth introducing an rlimit for it)
- */
-#define ROBUST_LIST_LIMIT      2048
-
-/*
- * bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
- * match of any bit.
- */
-#define FUTEX_BITSET_MATCH_ANY 0xffffffff
-
-#ifdef __KERNEL__
 struct inode;
 struct mm_struct;
 struct task_struct;
@@ -185,31 +64,4 @@ static inline void exit_pi_state_list(struct task_struct *curr)
 {
 }
 #endif
-#endif /* __KERNEL__ */
-
-#define FUTEX_OP_SET           0       /* *(int *)UADDR2 = OPARG; */
-#define FUTEX_OP_ADD           1       /* *(int *)UADDR2 += OPARG; */
-#define FUTEX_OP_OR            2       /* *(int *)UADDR2 |= OPARG; */
-#define FUTEX_OP_ANDN          3       /* *(int *)UADDR2 &= ~OPARG; */
-#define FUTEX_OP_XOR           4       /* *(int *)UADDR2 ^= OPARG; */
-
-#define FUTEX_OP_OPARG_SHIFT   8       /* Use (1 << OPARG) instead of OPARG.  */
-
-#define FUTEX_OP_CMP_EQ                0       /* if (oldval == CMPARG) wake */
-#define FUTEX_OP_CMP_NE                1       /* if (oldval != CMPARG) wake */
-#define FUTEX_OP_CMP_LT                2       /* if (oldval < CMPARG) wake */
-#define FUTEX_OP_CMP_LE                3       /* if (oldval <= CMPARG) wake */
-#define FUTEX_OP_CMP_GT                4       /* if (oldval > CMPARG) wake */
-#define FUTEX_OP_CMP_GE                5       /* if (oldval >= CMPARG) wake */
-
-/* FUTEX_WAKE_OP will perform atomically
-   int oldval = *(int *)UADDR2;
-   *(int *)UADDR2 = oldval OP OPARG;
-   if (oldval CMP CMPARG)
-     wake UADDR2;  */
-
-#define FUTEX_OP(op, oparg, cmp, cmparg) \
-  (((op & 0xf) << 28) | ((cmp & 0xf) << 24)            \
-   | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
-
 #endif
index b986be513406f51fb8abc66d9a26fbe324e30470..bb7de09e8d57a37fcf9e3378dfd7498eb08af6cb 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef _GAMEPORT_H
-#define _GAMEPORT_H
-
 /*
  *  Copyright (c) 1999-2002 Vojtech Pavlik
  *
@@ -8,8 +5,9 @@
  * under the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation.
  */
+#ifndef _GAMEPORT_H
+#define _GAMEPORT_H
 
-#ifdef __KERNEL__
 #include <asm/io.h>
 #include <linux/types.h>
 #include <linux/list.h>
@@ -17,6 +15,7 @@
 #include <linux/device.h>
 #include <linux/timer.h>
 #include <linux/slab.h>
+#include <uapi/linux/gameport.h>
 
 struct gameport {
 
@@ -166,24 +165,6 @@ void gameport_unregister_driver(struct gameport_driver *drv);
        module_driver(__gameport_driver, gameport_register_driver, \
                       gameport_unregister_driver)
 
-#endif /* __KERNEL__ */
-
-#define GAMEPORT_MODE_DISABLED         0
-#define GAMEPORT_MODE_RAW              1
-#define GAMEPORT_MODE_COOKED           2
-
-#define GAMEPORT_ID_VENDOR_ANALOG      0x0001
-#define GAMEPORT_ID_VENDOR_MADCATZ     0x0002
-#define GAMEPORT_ID_VENDOR_LOGITECH    0x0003
-#define GAMEPORT_ID_VENDOR_CREATIVE    0x0004
-#define GAMEPORT_ID_VENDOR_GENIUS      0x0005
-#define GAMEPORT_ID_VENDOR_INTERACT    0x0006
-#define GAMEPORT_ID_VENDOR_MICROSOFT   0x0007
-#define GAMEPORT_ID_VENDOR_THRUSTMASTER        0x0008
-#define GAMEPORT_ID_VENDOR_GRAVIS      0x0009
-#define GAMEPORT_ID_VENDOR_GUILLEMOT   0x000a
-
-#ifdef __KERNEL__
 
 static inline void gameport_trigger(struct gameport *gameport)
 {
@@ -235,5 +216,4 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne
 void gameport_start_polling(struct gameport *gameport);
 void gameport_stop_polling(struct gameport *gameport);
 
-#endif /* __KERNEL__ */
 #endif
index 5ab61c1eb6bf2c5ab1234aaee230d61991eef535..55b685719d522da32a37ba59013d1f029ff6a37e 100644 (file)
@@ -1,86 +1,8 @@
 #ifndef __LINUX_GENERIC_NETLINK_H
 #define __LINUX_GENERIC_NETLINK_H
 
-#include <linux/types.h>
-#include <linux/netlink.h>
+#include <uapi/linux/genetlink.h>
 
-#define GENL_NAMSIZ    16      /* length of family name */
-
-#define GENL_MIN_ID    NLMSG_MIN_TYPE
-#define GENL_MAX_ID    1023
-
-struct genlmsghdr {
-       __u8    cmd;
-       __u8    version;
-       __u16   reserved;
-};
-
-#define GENL_HDRLEN    NLMSG_ALIGN(sizeof(struct genlmsghdr))
-
-#define GENL_ADMIN_PERM                0x01
-#define GENL_CMD_CAP_DO                0x02
-#define GENL_CMD_CAP_DUMP      0x04
-#define GENL_CMD_CAP_HASPOL    0x08
-
-/*
- * List of reserved static generic netlink identifiers:
- */
-#define GENL_ID_GENERATE       0
-#define GENL_ID_CTRL           NLMSG_MIN_TYPE
-
-/**************************************************************************
- * Controller
- **************************************************************************/
-
-enum {
-       CTRL_CMD_UNSPEC,
-       CTRL_CMD_NEWFAMILY,
-       CTRL_CMD_DELFAMILY,
-       CTRL_CMD_GETFAMILY,
-       CTRL_CMD_NEWOPS,
-       CTRL_CMD_DELOPS,
-       CTRL_CMD_GETOPS,
-       CTRL_CMD_NEWMCAST_GRP,
-       CTRL_CMD_DELMCAST_GRP,
-       CTRL_CMD_GETMCAST_GRP, /* unused */
-       __CTRL_CMD_MAX,
-};
-
-#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
-
-enum {
-       CTRL_ATTR_UNSPEC,
-       CTRL_ATTR_FAMILY_ID,
-       CTRL_ATTR_FAMILY_NAME,
-       CTRL_ATTR_VERSION,
-       CTRL_ATTR_HDRSIZE,
-       CTRL_ATTR_MAXATTR,
-       CTRL_ATTR_OPS,
-       CTRL_ATTR_MCAST_GROUPS,
-       __CTRL_ATTR_MAX,
-};
-
-#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
-
-enum {
-       CTRL_ATTR_OP_UNSPEC,
-       CTRL_ATTR_OP_ID,
-       CTRL_ATTR_OP_FLAGS,
-       __CTRL_ATTR_OP_MAX,
-};
-
-#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
-
-enum {
-       CTRL_ATTR_MCAST_GRP_UNSPEC,
-       CTRL_ATTR_MCAST_GRP_NAME,
-       CTRL_ATTR_MCAST_GRP_ID,
-       __CTRL_ATTR_MCAST_GRP_MAX,
-};
-
-#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
-
-#ifdef __KERNEL__
 
 /* All generic netlink requests are serialized by a global lock.  */
 extern void genl_lock(void);
@@ -113,6 +35,4 @@ extern int lockdep_genl_is_held(void);
 #define MODULE_ALIAS_GENL_FAMILY(family)\
  MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family)
 
-#endif /* __KERNEL__ */
-
 #endif /* __LINUX_GENERIC_NETLINK_H */
index ee275c8b3df116a6643db8aa68148cca0480137a..1acb1445e05fe5f03ce33f8cdc6a03c35ae59763 100644 (file)
@@ -7,24 +7,14 @@
  * under the terms of version 2 of the GNU General Public License
  * as published by the Free Software Foundation.
  */
-
 #ifndef __HDLC_H
 #define __HDLC_H
 
 
-#define HDLC_MAX_MTU 1500      /* Ethernet 1500 bytes */
-#if 0
-#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
-#else
-#define HDLC_MAX_MRU 1600 /* as required for FR network */
-#endif
-
-
-#ifdef __KERNEL__
-
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/hdlc/ioctl.h>
+#include <uapi/linux/hdlc.h>
 
 /* This structure is a private property of HDLC protocols.
    Hardware drivers have no interest here */
@@ -127,5 +117,4 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
                return htons(ETH_P_HDLC);
 }
 
-#endif /* __KERNEL */
 #endif /* __HDLC_H */
index c010b4a785b8f7d5c7142232fdfd85fc412d69d4..be3be25bb898f549376945e9ad5fd6a365e40ade 100644 (file)
  * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
  * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
  */
-
 #ifndef _HDLCDRV_H
 #define _HDLCDRV_H
 
-/* -------------------------------------------------------------------- */
-/*
- * structs for the IOCTL commands
- */
-
-struct hdlcdrv_params {
-       int iobase;
-       int irq;
-       int dma;
-       int dma2;
-       int seriobase;
-       int pariobase;
-       int midiiobase;
-};     
-
-struct hdlcdrv_channel_params {
-       int tx_delay;  /* the transmitter keyup delay in 10ms units */
-       int tx_tail;   /* the transmitter keyoff delay in 10ms units */
-       int slottime;  /* the slottime in 10ms; usually 10 = 100ms */
-       int ppersist;  /* the p-persistence 0..255 */
-       int fulldup;   /* some driver do not support full duplex, setting */
-                      /* this just makes them send even if DCD is on */
-};     
-
-struct hdlcdrv_old_channel_state {
-       int ptt;
-       int dcd;
-       int ptt_keyed;
-};
-
-struct hdlcdrv_channel_state {
-       int ptt;
-       int dcd;
-       int ptt_keyed;
-       unsigned long tx_packets;
-       unsigned long tx_errors;
-       unsigned long rx_packets;
-       unsigned long rx_errors;
-};
-
-struct hdlcdrv_ioctl {
-       int cmd;
-       union {
-               struct hdlcdrv_params mp;
-               struct hdlcdrv_channel_params cp;
-               struct hdlcdrv_channel_state cs;
-               struct hdlcdrv_old_channel_state ocs;
-               unsigned int calibrate;
-               unsigned char bits;
-               char modename[128];
-               char drivername[32];
-       } data;
-};
-
-/* -------------------------------------------------------------------- */
-
-/*
- * ioctl values
- */
-#define HDLCDRVCTL_GETMODEMPAR       0
-#define HDLCDRVCTL_SETMODEMPAR       1
-#define HDLCDRVCTL_MODEMPARMASK      2  /* not handled by hdlcdrv */
-#define HDLCDRVCTL_GETCHANNELPAR    10
-#define HDLCDRVCTL_SETCHANNELPAR    11
-#define HDLCDRVCTL_OLDGETSTAT       20
-#define HDLCDRVCTL_CALIBRATE        21
-#define HDLCDRVCTL_GETSTAT          22
-
-/*
- * these are mainly for debugging purposes
- */
-#define HDLCDRVCTL_GETSAMPLES       30
-#define HDLCDRVCTL_GETBITS          31
-
-/*
- * not handled by hdlcdrv, but by its depending drivers
- */
-#define HDLCDRVCTL_GETMODE          40
-#define HDLCDRVCTL_SETMODE          41
-#define HDLCDRVCTL_MODELIST         42
-#define HDLCDRVCTL_DRIVERNAME       43
-
-/*
- * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
- */
-#define HDLCDRV_PARMASK_IOBASE      (1<<0)
-#define HDLCDRV_PARMASK_IRQ         (1<<1)
-#define HDLCDRV_PARMASK_DMA         (1<<2)
-#define HDLCDRV_PARMASK_DMA2        (1<<3)
-#define HDLCDRV_PARMASK_SERIOBASE   (1<<4)
-#define HDLCDRV_PARMASK_PARIOBASE   (1<<5)
-#define HDLCDRV_PARMASK_MIDIIOBASE  (1<<6)
-
-/* -------------------------------------------------------------------- */
-
-#ifdef __KERNEL__
 
 #include <linux/netdevice.h>
 #include <linux/if.h>
 #include <linux/spinlock.h>
+#include <uapi/linux/hdlcdrv.h>
 
 #define HDLCDRV_MAGIC      0x5ac6e778
 #define HDLCDRV_HDLCBUFFER  32 /* should be a power of 2 for speed reasons */
@@ -368,10 +272,4 @@ void hdlcdrv_unregister(struct net_device *dev);
 
 
 
-#endif /* __KERNEL__ */
-
-/* -------------------------------------------------------------------- */
-
 #endif /* _HDLCDRV_H */
-
-/* -------------------------------------------------------------------- */
index 7e1f37db7582260231fa8bb6edf435335e4e128b..c076041a069e88ee700e12d1bf5d3ca4b6f0a2eb 100644 (file)
@@ -1,12 +1,8 @@
-#ifndef __HID_H
-#define __HID_H
-
 /*
  *  Copyright (c) 1999 Andreas Gal
  *  Copyright (c) 2000-2001 Vojtech Pavlik
  *  Copyright (c) 2006-2007 Jiri Kosina
  */
-
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  */
+#ifndef __HID_H
+#define __HID_H
 
-/*
- * USB HID (Human Interface Device) interface class code
- */
-
-#define USB_INTERFACE_CLASS_HID                3
-
-/*
- * USB HID interface subclass and protocol codes
- */
-
-#define USB_INTERFACE_SUBCLASS_BOOT    1
-#define USB_INTERFACE_PROTOCOL_KEYBOARD        1
-#define USB_INTERFACE_PROTOCOL_MOUSE   2
-
-/*
- * HID class requests
- */
-
-#define HID_REQ_GET_REPORT             0x01
-#define HID_REQ_GET_IDLE               0x02
-#define HID_REQ_GET_PROTOCOL           0x03
-#define HID_REQ_SET_REPORT             0x09
-#define HID_REQ_SET_IDLE               0x0A
-#define HID_REQ_SET_PROTOCOL           0x0B
-
-/*
- * HID class descriptor types
- */
-
-#define HID_DT_HID                     (USB_TYPE_CLASS | 0x01)
-#define HID_DT_REPORT                  (USB_TYPE_CLASS | 0x02)
-#define HID_DT_PHYSICAL                        (USB_TYPE_CLASS | 0x03)
-
-#define HID_MAX_DESCRIPTOR_SIZE                4096
-
-#ifdef __KERNEL__
 
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -73,6 +35,7 @@
 #include <linux/input.h>
 #include <linux/semaphore.h>
 #include <linux/power_supply.h>
+#include <uapi/linux/hid.h>
 
 /*
  * We parse each description item into this structure. Short items data
@@ -943,7 +906,4 @@ do {                                                                        \
 #define hid_dbg(hid, fmt, arg...)                      \
        dev_dbg(&(hid)->dev, fmt, ##arg)
 
-#endif /* __KERNEL__ */
-
 #endif
-
index a3f481a3063b5d1cb14ec91aca8ff386592ae506..a5dd8148660b7eb15482c99b1a602226007ec840 100644 (file)
@@ -1,12 +1,8 @@
-#ifndef _HIDDEV_H
-#define _HIDDEV_H
-
 /*
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
  *  Sponsored by SuSE
  */
-
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  */
+#ifndef _HIDDEV_H
+#define _HIDDEV_H
 
-#include <linux/types.h>
-
-/*
- * The event structure itself
- */
-
-struct hiddev_event {
-       unsigned hid;
-       signed int value;
-};
-
-struct hiddev_devinfo {
-       __u32 bustype;
-       __u32 busnum;
-       __u32 devnum;
-       __u32 ifnum;
-       __s16 vendor;
-       __s16 product;
-       __s16 version;
-       __u32 num_applications;
-};
-
-struct hiddev_collection_info {
-       __u32 index;
-       __u32 type;
-       __u32 usage;
-       __u32 level;
-};
-
-#define HID_STRING_SIZE 256
-struct hiddev_string_descriptor {
-       __s32 index;
-       char value[HID_STRING_SIZE];
-};
-
-struct hiddev_report_info {
-       __u32 report_type;
-       __u32 report_id;
-       __u32 num_fields;
-};
-
-/* To do a GUSAGE/SUSAGE, fill in at least usage_code,  report_type and 
- * report_id.  Set report_id to REPORT_ID_UNKNOWN if the rest of the fields 
- * are unknown.  Otherwise use a usage_ref struct filled in from a previous 
- * successful GUSAGE call to save time.  To actually send a value to the
- * device, perform a SUSAGE first, followed by a SREPORT.  An INITREPORT or a
- * GREPORT isn't necessary for a GUSAGE to return valid data.
- */
-#define HID_REPORT_ID_UNKNOWN 0xffffffff
-#define HID_REPORT_ID_FIRST   0x00000100
-#define HID_REPORT_ID_NEXT    0x00000200
-#define HID_REPORT_ID_MASK    0x000000ff
-#define HID_REPORT_ID_MAX     0x000000ff
-
-#define HID_REPORT_TYPE_INPUT  1
-#define HID_REPORT_TYPE_OUTPUT 2
-#define HID_REPORT_TYPE_FEATURE        3
-#define HID_REPORT_TYPE_MIN     1
-#define HID_REPORT_TYPE_MAX     3
-
-struct hiddev_field_info {
-       __u32 report_type;
-       __u32 report_id;
-       __u32 field_index;
-       __u32 maxusage;
-       __u32 flags;
-       __u32 physical;         /* physical usage for this field */
-       __u32 logical;          /* logical usage for this field */
-       __u32 application;              /* application usage for this field */
-       __s32 logical_minimum;
-       __s32 logical_maximum;
-       __s32 physical_minimum;
-       __s32 physical_maximum;
-       __u32 unit_exponent;
-       __u32 unit;
-};
-
-/* Fill in report_type, report_id and field_index to get the information on a
- * field.
- */
-#define HID_FIELD_CONSTANT             0x001
-#define HID_FIELD_VARIABLE             0x002
-#define HID_FIELD_RELATIVE             0x004
-#define HID_FIELD_WRAP                 0x008   
-#define HID_FIELD_NONLINEAR            0x010
-#define HID_FIELD_NO_PREFERRED         0x020
-#define HID_FIELD_NULL_STATE           0x040
-#define HID_FIELD_VOLATILE             0x080
-#define HID_FIELD_BUFFERED_BYTE                0x100
-
-struct hiddev_usage_ref {
-       __u32 report_type;
-       __u32 report_id;
-       __u32 field_index;
-       __u32 usage_index;
-       __u32 usage_code;
-       __s32 value;
-};
-
-/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
- * It really manifests itself as setting the value of consecutive usages */
-#define HID_MAX_MULTI_USAGES 1024
-struct hiddev_usage_ref_multi {
-       struct hiddev_usage_ref uref;
-       __u32 num_values;
-       __s32 values[HID_MAX_MULTI_USAGES];
-};
-
-/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
- * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
- * been sent by the device 
- */
-#define HID_FIELD_INDEX_NONE 0xffffffff
-
-/*
- * Protocol version.
- */
-
-#define HID_VERSION            0x010004
-
-/*
- * IOCTLs (0x00 - 0x7f)
- */
-
-#define HIDIOCGVERSION         _IOR('H', 0x01, int)
-#define HIDIOCAPPLICATION      _IO('H', 0x02)
-#define HIDIOCGDEVINFO         _IOR('H', 0x03, struct hiddev_devinfo)
-#define HIDIOCGSTRING          _IOR('H', 0x04, struct hiddev_string_descriptor)
-#define HIDIOCINITREPORT       _IO('H', 0x05)
-#define HIDIOCGNAME(len)       _IOC(_IOC_READ, 'H', 0x06, len)
-#define HIDIOCGREPORT          _IOW('H', 0x07, struct hiddev_report_info)
-#define HIDIOCSREPORT          _IOW('H', 0x08, struct hiddev_report_info)
-#define HIDIOCGREPORTINFO      _IOWR('H', 0x09, struct hiddev_report_info)
-#define HIDIOCGFIELDINFO       _IOWR('H', 0x0A, struct hiddev_field_info)
-#define HIDIOCGUSAGE           _IOWR('H', 0x0B, struct hiddev_usage_ref)
-#define HIDIOCSUSAGE           _IOW('H', 0x0C, struct hiddev_usage_ref)
-#define HIDIOCGUCODE           _IOWR('H', 0x0D, struct hiddev_usage_ref)
-#define HIDIOCGFLAG            _IOR('H', 0x0E, int)
-#define HIDIOCSFLAG            _IOW('H', 0x0F, int)
-#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
-#define HIDIOCGCOLLECTIONINFO  _IOWR('H', 0x11, struct hiddev_collection_info)
-#define HIDIOCGPHYS(len)       _IOC(_IOC_READ, 'H', 0x12, len)
-
-/* For writing/reading to multiple/consecutive usages */
-#define HIDIOCGUSAGES          _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
-#define HIDIOCSUSAGES          _IOW('H', 0x14, struct hiddev_usage_ref_multi)
-
-/* 
- * Flags to be used in HIDIOCSFLAG
- */
-#define HIDDEV_FLAG_UREF       0x1
-#define HIDDEV_FLAG_REPORT     0x2
-#define HIDDEV_FLAGS           0x3
-
-/* To traverse the input report descriptor info for a HID device, perform the 
- * following:
- *
- * rinfo.report_type = HID_REPORT_TYPE_INPUT;
- * rinfo.report_id = HID_REPORT_ID_FIRST;
- * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
- *
- * while (ret >= 0) {
- *     for (i = 0; i < rinfo.num_fields; i++) {
- *             finfo.report_type = rinfo.report_type;
- *             finfo.report_id = rinfo.report_id;
- *             finfo.field_index = i;
- *             ioctl(fd, HIDIOCGFIELDINFO, &finfo);
- *             for (j = 0; j < finfo.maxusage; j++) {
- *                     uref.report_type = rinfo.report_type;
- *                     uref.report_id = rinfo.report_id;
- *                     uref.field_index = i;
- *                     uref.usage_index = j;
- *                     ioctl(fd, HIDIOCGUCODE, &uref);
- *                     ioctl(fd, HIDIOCGUSAGE, &uref);
- *             }
- *     }
- *     rinfo.report_id |= HID_REPORT_ID_NEXT;
- *     ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
- * }
- */
-
+#include <uapi/linux/hiddev.h>
 
-#ifdef __KERNEL__
 
 /*
  * In-kernel definitions.
@@ -237,4 +54,3 @@ static inline void hiddev_report_event(struct hid_device *hid, struct hid_report
 #endif
 
 #endif
-#endif
index 45e9fcb8d8777884e0ecf0c428b3c8015d189f9f..2451662c728a7881e5d7d42fe02d17c15ce86914 100644 (file)
@@ -1,10 +1,6 @@
-#ifndef _HIDRAW_H
-#define _HIDRAW_H
-
 /*
  *  Copyright (c) 2007 Jiri Kosina
  */
-
 /*
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  */
+#ifndef _HIDRAW_H
+#define _HIDRAW_H
 
-#include <linux/hid.h>
-#include <linux/types.h>
-
-struct hidraw_report_descriptor {
-       __u32 size;
-       __u8 value[HID_MAX_DESCRIPTOR_SIZE];
-};
-
-struct hidraw_devinfo {
-       __u32 bustype;
-       __s16 vendor;
-       __s16 product;
-};
-
-/* ioctl interface */
-#define HIDIOCGRDESCSIZE       _IOR('H', 0x01, int)
-#define HIDIOCGRDESC           _IOR('H', 0x02, struct hidraw_report_descriptor)
-#define HIDIOCGRAWINFO         _IOR('H', 0x03, struct hidraw_devinfo)
-#define HIDIOCGRAWNAME(len)     _IOC(_IOC_READ, 'H', 0x04, len)
-#define HIDIOCGRAWPHYS(len)     _IOC(_IOC_READ, 'H', 0x05, len)
-/* The first byte of SFEATURE and GFEATURE is the report number */
-#define HIDIOCSFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
-#define HIDIOCGFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
-
-#define HIDRAW_FIRST_MINOR 0
-#define HIDRAW_MAX_DEVICES 64
-/* number of reports to buffer */
-#define HIDRAW_BUFFER_SIZE 64
-
+#include <uapi/linux/hidraw.h>
 
-/* kernel-only API declarations */
-#ifdef __KERNEL__
 
 struct hidraw {
        unsigned int minor;
@@ -88,5 +56,3 @@ static inline void hidraw_disconnect(struct hid_device *hid) { }
 #endif
 
 #endif
-
-#endif
index 219ca4f6bea66a0a755101ea2d9c615a67854283..9427ab4e01c3594c7354380abad13e0b6e31bad0 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef        __HPET__
 #define        __HPET__ 1
 
-#include <linux/compiler.h>
+#include <uapi/linux/hpet.h>
 
-#ifdef __KERNEL__
 
 /*
  * Offsets into HPET Registers
@@ -108,24 +107,4 @@ static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
 
 int hpet_alloc(struct hpet_data *);
 
-#endif /* __KERNEL__ */
-
-struct hpet_info {
-       unsigned long hi_ireqfreq;      /* Hz */
-       unsigned long hi_flags; /* information */
-       unsigned short hi_hpet;
-       unsigned short hi_timer;
-};
-
-#define HPET_INFO_PERIODIC     0x0010  /* periodic-capable comparator */
-
-#define        HPET_IE_ON      _IO('h', 0x01)  /* interrupt on */
-#define        HPET_IE_OFF     _IO('h', 0x02)  /* interrupt off */
-#define        HPET_INFO       _IOR('h', 0x03, struct hpet_info)
-#define        HPET_EPI        _IO('h', 0x04)  /* enable periodic */
-#define        HPET_DPI        _IO('h', 0x05)  /* disable periodic */
-#define        HPET_IRQFREQ    _IOW('h', 0x6, unsigned long)   /* IRQFREQ usec */
-
-#define MAX_HPET_TBS   8               /* maximum hpet timer blocks */
-
 #endif                         /* !__HPET__ */
index 8a7406b2114df7731fed5827e6f6696ef376d6f5..79727144c5cdaf14bd0b3eb0d692a2f93051f263 100644 (file)
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
     MA 02110-1301 USA.
 */
-
 #ifndef _LINUX_I2C_DEV_H
 #define _LINUX_I2C_DEV_H
 
-#include <linux/types.h>
-#include <linux/compiler.h>
-
-/* /dev/i2c-X ioctl commands.  The ioctl's parameter is always an
- * unsigned long, except for:
- *     - I2C_FUNCS, takes pointer to an unsigned long
- *     - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
- *     - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
- */
-#define I2C_RETRIES    0x0701  /* number of times a device address should
-                                  be polled when not acknowledging */
-#define I2C_TIMEOUT    0x0702  /* set timeout in units of 10 ms */
-
-/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
- * are NOT supported! (due to code brokenness)
- */
-#define I2C_SLAVE      0x0703  /* Use this slave address */
-#define I2C_SLAVE_FORCE        0x0706  /* Use this slave address, even if it
-                                  is already in use by a driver! */
-#define I2C_TENBIT     0x0704  /* 0 for 7 bit addrs, != 0 for 10 bit */
-
-#define I2C_FUNCS      0x0705  /* Get the adapter functionality mask */
-
-#define I2C_RDWR       0x0707  /* Combined R/W transfer (one STOP only) */
-
-#define I2C_PEC                0x0708  /* != 0 to use PEC with SMBus */
-#define I2C_SMBUS      0x0720  /* SMBus transfer */
+#include <uapi/linux/i2c-dev.h>
 
-
-/* This is the structure as used in the I2C_SMBUS ioctl call */
-struct i2c_smbus_ioctl_data {
-       __u8 read_write;
-       __u8 command;
-       __u32 size;
-       union i2c_smbus_data __user *data;
-};
-
-/* This is the structure as used in the I2C_RDWR ioctl call */
-struct i2c_rdwr_ioctl_data {
-       struct i2c_msg __user *msgs;    /* pointers to i2c_msgs */
-       __u32 nmsgs;                    /* number of i2c_msgs */
-};
-
-#define  I2C_RDRW_IOCTL_MAX_MSGS       42
-
-#ifdef __KERNEL__
 #define I2C_MAJOR      89              /* Device major number          */
-#endif
-
 #endif /* _LINUX_I2C_DEV_H */
index 94aed0c85bb02066787da65ea55ecee60e2161ca..800de224336bc7c6943008eabce6fa9448b4fdf0 100644 (file)
 
 /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
    Frodo Looijaard <frodol@dds.nl> */
-
 #ifndef _LINUX_I2C_H
 #define _LINUX_I2C_H
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/mod_devicetable.h>
 #include <linux/device.h>      /* for struct device */
 #include <linux/sched.h>       /* for completion */
 #include <linux/mutex.h>
 #include <linux/of.h>          /* for struct device_node */
 #include <linux/swab.h>                /* for swab16 */
+#include <uapi/linux/i2c.h>
 
 extern struct bus_type i2c_bus_type;
 extern struct device_type i2c_adapter_type;
@@ -503,125 +501,4 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
                        i2c_del_driver)
 
 #endif /* I2C */
-#endif /* __KERNEL__ */
-
-/**
- * struct i2c_msg - an I2C transaction segment beginning with START
- * @addr: Slave address, either seven or ten bits.  When this is a ten
- *     bit address, I2C_M_TEN must be set in @flags and the adapter
- *     must support I2C_FUNC_10BIT_ADDR.
- * @flags: I2C_M_RD is handled by all adapters.  No other flags may be
- *     provided unless the adapter exported the relevant I2C_FUNC_*
- *     flags through i2c_check_functionality().
- * @len: Number of data bytes in @buf being read from or written to the
- *     I2C slave address.  For read transactions where I2C_M_RECV_LEN
- *     is set, the caller guarantees that this buffer can hold up to
- *     32 bytes in addition to the initial length byte sent by the
- *     slave (plus, if used, the SMBus PEC); and this value will be
- *     incremented by the number of block data bytes received.
- * @buf: The buffer into which data is read, or from which it's written.
- *
- * An i2c_msg is the low level representation of one segment of an I2C
- * transaction.  It is visible to drivers in the @i2c_transfer() procedure,
- * to userspace from i2c-dev, and to I2C adapter drivers through the
- * @i2c_adapter.@master_xfer() method.
- *
- * Except when I2C "protocol mangling" is used, all I2C adapters implement
- * the standard rules for I2C transactions.  Each transaction begins with a
- * START.  That is followed by the slave address, and a bit encoding read
- * versus write.  Then follow all the data bytes, possibly including a byte
- * with SMBus PEC.  The transfer terminates with a NAK, or when all those
- * bytes have been transferred and ACKed.  If this is the last message in a
- * group, it is followed by a STOP.  Otherwise it is followed by the next
- * @i2c_msg transaction segment, beginning with a (repeated) START.
- *
- * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
- * passing certain @flags may have changed those standard protocol behaviors.
- * Those flags are only for use with broken/nonconforming slaves, and with
- * adapters which are known to support the specific mangling options they
- * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
- */
-struct i2c_msg {
-       __u16 addr;     /* slave address                        */
-       __u16 flags;
-#define I2C_M_TEN              0x0010  /* this is a ten bit chip address */
-#define I2C_M_RD               0x0001  /* read data, from slave to master */
-#define I2C_M_STOP             0x8000  /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_NOSTART          0x4000  /* if I2C_FUNC_NOSTART */
-#define I2C_M_REV_DIR_ADDR     0x2000  /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_IGNORE_NAK       0x1000  /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_NO_RD_ACK                0x0800  /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_RECV_LEN         0x0400  /* length will be first received byte */
-       __u16 len;              /* msg length                           */
-       __u8 *buf;              /* pointer to msg data                  */
-};
-
-/* To determine what functionality is present */
-
-#define I2C_FUNC_I2C                   0x00000001
-#define I2C_FUNC_10BIT_ADDR            0x00000002
-#define I2C_FUNC_PROTOCOL_MANGLING     0x00000004 /* I2C_M_IGNORE_NAK etc. */
-#define I2C_FUNC_SMBUS_PEC             0x00000008
-#define I2C_FUNC_NOSTART               0x00000010 /* I2C_M_NOSTART */
-#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
-#define I2C_FUNC_SMBUS_QUICK           0x00010000
-#define I2C_FUNC_SMBUS_READ_BYTE       0x00020000
-#define I2C_FUNC_SMBUS_WRITE_BYTE      0x00040000
-#define I2C_FUNC_SMBUS_READ_BYTE_DATA  0x00080000
-#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
-#define I2C_FUNC_SMBUS_READ_WORD_DATA  0x00200000
-#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
-#define I2C_FUNC_SMBUS_PROC_CALL       0x00800000
-#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
-#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
-#define I2C_FUNC_SMBUS_READ_I2C_BLOCK  0x04000000 /* I2C-like block xfer  */
-#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
-
-#define I2C_FUNC_SMBUS_BYTE            (I2C_FUNC_SMBUS_READ_BYTE | \
-                                        I2C_FUNC_SMBUS_WRITE_BYTE)
-#define I2C_FUNC_SMBUS_BYTE_DATA       (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
-                                        I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
-#define I2C_FUNC_SMBUS_WORD_DATA       (I2C_FUNC_SMBUS_READ_WORD_DATA | \
-                                        I2C_FUNC_SMBUS_WRITE_WORD_DATA)
-#define I2C_FUNC_SMBUS_BLOCK_DATA      (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
-                                        I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
-#define I2C_FUNC_SMBUS_I2C_BLOCK       (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
-                                        I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
-
-#define I2C_FUNC_SMBUS_EMUL            (I2C_FUNC_SMBUS_QUICK | \
-                                        I2C_FUNC_SMBUS_BYTE | \
-                                        I2C_FUNC_SMBUS_BYTE_DATA | \
-                                        I2C_FUNC_SMBUS_WORD_DATA | \
-                                        I2C_FUNC_SMBUS_PROC_CALL | \
-                                        I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
-                                        I2C_FUNC_SMBUS_I2C_BLOCK | \
-                                        I2C_FUNC_SMBUS_PEC)
-
-/*
- * Data for SMBus Messages
- */
-#define I2C_SMBUS_BLOCK_MAX    32      /* As specified in SMBus standard */
-union i2c_smbus_data {
-       __u8 byte;
-       __u16 word;
-       __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
-                              /* and one more for user-space compatibility */
-};
-
-/* i2c_smbus_xfer read or write markers */
-#define I2C_SMBUS_READ 1
-#define I2C_SMBUS_WRITE        0
-
-/* SMBus transaction types (size parameter in the above functions)
-   Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
-#define I2C_SMBUS_QUICK                    0
-#define I2C_SMBUS_BYTE             1
-#define I2C_SMBUS_BYTE_DATA        2
-#define I2C_SMBUS_WORD_DATA        3
-#define I2C_SMBUS_PROC_CALL        4
-#define I2C_SMBUS_BLOCK_DATA       5
-#define I2C_SMBUS_I2C_BLOCK_BROKEN  6
-#define I2C_SMBUS_BLOCK_PROC_CALL   7          /* SMBus 2.0 */
-#define I2C_SMBUS_I2C_BLOCK_DATA    8
-
 #endif /* _LINUX_I2C_H */
index 474f2a51cf0af66474be229b626403975a36683c..efc18490627a3eddb94866de6935b457d1e63454 100644 (file)
 #ifndef _LINUX_ICMP_H
 #define        _LINUX_ICMP_H
 
-#include <linux/types.h>
-
-#define ICMP_ECHOREPLY         0       /* Echo Reply                   */
-#define ICMP_DEST_UNREACH      3       /* Destination Unreachable      */
-#define ICMP_SOURCE_QUENCH     4       /* Source Quench                */
-#define ICMP_REDIRECT          5       /* Redirect (change route)      */
-#define ICMP_ECHO              8       /* Echo Request                 */
-#define ICMP_TIME_EXCEEDED     11      /* Time Exceeded                */
-#define ICMP_PARAMETERPROB     12      /* Parameter Problem            */
-#define ICMP_TIMESTAMP         13      /* Timestamp Request            */
-#define ICMP_TIMESTAMPREPLY    14      /* Timestamp Reply              */
-#define ICMP_INFO_REQUEST      15      /* Information Request          */
-#define ICMP_INFO_REPLY                16      /* Information Reply            */
-#define ICMP_ADDRESS           17      /* Address Mask Request         */
-#define ICMP_ADDRESSREPLY      18      /* Address Mask Reply           */
-#define NR_ICMP_TYPES          18
-
-
-/* Codes for UNREACH. */
-#define ICMP_NET_UNREACH       0       /* Network Unreachable          */
-#define ICMP_HOST_UNREACH      1       /* Host Unreachable             */
-#define ICMP_PROT_UNREACH      2       /* Protocol Unreachable         */
-#define ICMP_PORT_UNREACH      3       /* Port Unreachable             */
-#define ICMP_FRAG_NEEDED       4       /* Fragmentation Needed/DF set  */
-#define ICMP_SR_FAILED         5       /* Source Route failed          */
-#define ICMP_NET_UNKNOWN       6
-#define ICMP_HOST_UNKNOWN      7
-#define ICMP_HOST_ISOLATED     8
-#define ICMP_NET_ANO           9
-#define ICMP_HOST_ANO          10
-#define ICMP_NET_UNR_TOS       11
-#define ICMP_HOST_UNR_TOS      12
-#define ICMP_PKT_FILTERED      13      /* Packet filtered */
-#define ICMP_PREC_VIOLATION    14      /* Precedence violation */
-#define ICMP_PREC_CUTOFF       15      /* Precedence cut off */
-#define NR_ICMP_UNREACH                15      /* instead of hardcoding immediate value */
-
-/* Codes for REDIRECT. */
-#define ICMP_REDIR_NET         0       /* Redirect Net                 */
-#define ICMP_REDIR_HOST                1       /* Redirect Host                */
-#define ICMP_REDIR_NETTOS      2       /* Redirect Net for TOS         */
-#define ICMP_REDIR_HOSTTOS     3       /* Redirect Host for TOS        */
-
-/* Codes for TIME_EXCEEDED. */
-#define ICMP_EXC_TTL           0       /* TTL count exceeded           */
-#define ICMP_EXC_FRAGTIME      1       /* Fragment Reass time exceeded */
-
-
-struct icmphdr {
-  __u8         type;
-  __u8         code;
-  __sum16      checksum;
-  union {
-       struct {
-               __be16  id;
-               __be16  sequence;
-       } echo;
-       __be32  gateway;
-       struct {
-               __be16  __unused;
-               __be16  mtu;
-       } frag;
-  } un;
-};
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/icmp.h>
 
 static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
 {
        return (struct icmphdr *)skb_transport_header(skb);
 }
-#endif
-
-/*
- *     constants for (set|get)sockopt
- */
-
-#define ICMP_FILTER                    1
-
-struct icmp_filter {
-       __u32           data;
-};
-
-
 #endif /* _LINUX_ICMP_H */
index ba45e6bc0764c84e5d0c4409193c6c4e6aa2ee99..b4f6c29caced9604ec7cc26a127a0ce145a397d2 100644 (file)
 #ifndef _LINUX_ICMPV6_H
 #define _LINUX_ICMPV6_H
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-struct icmp6hdr {
-
-       __u8            icmp6_type;
-       __u8            icmp6_code;
-       __sum16         icmp6_cksum;
-
-
-       union {
-               __be32                  un_data32[1];
-               __be16                  un_data16[2];
-               __u8                    un_data8[4];
-
-               struct icmpv6_echo {
-                       __be16          identifier;
-                       __be16          sequence;
-               } u_echo;
-
-                struct icmpv6_nd_advt {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-                        __u32          reserved:5,
-                                       override:1,
-                                       solicited:1,
-                                       router:1,
-                                       reserved2:24;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-                        __u32          router:1,
-                                       solicited:1,
-                                       override:1,
-                                       reserved:29;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif                                         
-                } u_nd_advt;
-
-                struct icmpv6_nd_ra {
-                       __u8            hop_limit;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-                       __u8            reserved:3,
-                                       router_pref:2,
-                                       home_agent:1,
-                                       other:1,
-                                       managed:1;
-
-#elif defined(__BIG_ENDIAN_BITFIELD)
-                       __u8            managed:1,
-                                       other:1,
-                                       home_agent:1,
-                                       router_pref:2,
-                                       reserved:3;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-                       __be16          rt_lifetime;
-                } u_nd_ra;
-
-       } icmp6_dataun;
-
-#define icmp6_identifier       icmp6_dataun.u_echo.identifier
-#define icmp6_sequence         icmp6_dataun.u_echo.sequence
-#define icmp6_pointer          icmp6_dataun.un_data32[0]
-#define icmp6_mtu              icmp6_dataun.un_data32[0]
-#define icmp6_unused           icmp6_dataun.un_data32[0]
-#define icmp6_maxdelay         icmp6_dataun.un_data16[0]
-#define icmp6_router           icmp6_dataun.u_nd_advt.router
-#define icmp6_solicited                icmp6_dataun.u_nd_advt.solicited
-#define icmp6_override         icmp6_dataun.u_nd_advt.override
-#define icmp6_ndiscreserved    icmp6_dataun.u_nd_advt.reserved
-#define icmp6_hop_limit                icmp6_dataun.u_nd_ra.hop_limit
-#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
-#define icmp6_addrconf_other   icmp6_dataun.u_nd_ra.other
-#define icmp6_rt_lifetime      icmp6_dataun.u_nd_ra.rt_lifetime
-#define icmp6_router_pref      icmp6_dataun.u_nd_ra.router_pref
-};
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/icmpv6.h>
 
 static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
 {
        return (struct icmp6hdr *)skb_transport_header(skb);
 }
-#endif
-
-#define ICMPV6_ROUTER_PREF_LOW         0x3
-#define ICMPV6_ROUTER_PREF_MEDIUM      0x0
-#define ICMPV6_ROUTER_PREF_HIGH                0x1
-#define ICMPV6_ROUTER_PREF_INVALID     0x2
-
-#define ICMPV6_DEST_UNREACH            1
-#define ICMPV6_PKT_TOOBIG              2
-#define ICMPV6_TIME_EXCEED             3
-#define ICMPV6_PARAMPROB               4
-
-#define ICMPV6_INFOMSG_MASK            0x80
-
-#define ICMPV6_ECHO_REQUEST            128
-#define ICMPV6_ECHO_REPLY              129
-#define ICMPV6_MGM_QUERY               130
-#define ICMPV6_MGM_REPORT              131
-#define ICMPV6_MGM_REDUCTION           132
-
-#define ICMPV6_NI_QUERY                        139
-#define ICMPV6_NI_REPLY                        140
-
-#define ICMPV6_MLD2_REPORT             143
-
-#define ICMPV6_DHAAD_REQUEST           144
-#define ICMPV6_DHAAD_REPLY             145
-#define ICMPV6_MOBILE_PREFIX_SOL       146
-#define ICMPV6_MOBILE_PREFIX_ADV       147
-
-/*
- *     Codes for Destination Unreachable
- */
-#define ICMPV6_NOROUTE                 0
-#define ICMPV6_ADM_PROHIBITED          1
-#define ICMPV6_NOT_NEIGHBOUR           2
-#define ICMPV6_ADDR_UNREACH            3
-#define ICMPV6_PORT_UNREACH            4
-
-/*
- *     Codes for Time Exceeded
- */
-#define ICMPV6_EXC_HOPLIMIT            0
-#define ICMPV6_EXC_FRAGTIME            1
-
-/*
- *     Codes for Parameter Problem
- */
-#define ICMPV6_HDR_FIELD               0
-#define ICMPV6_UNK_NEXTHDR             1
-#define ICMPV6_UNK_OPTION              2
-
-/*
- *     constants for (set|get)sockopt
- */
-
-#define ICMPV6_FILTER                  1
-
-/*
- *     ICMPV6 filter
- */
-
-#define ICMPV6_FILTER_BLOCK            1
-#define ICMPV6_FILTER_PASS             2
-#define ICMPV6_FILTER_BLOCKOTHERS      3
-#define ICMPV6_FILTER_PASSONLY         4
-
-struct icmp6_filter {
-       __u32           data[8];
-};
-
-/*
- *     Definitions for MLDv2
- */
-#define MLD2_MODE_IS_INCLUDE   1
-#define MLD2_MODE_IS_EXCLUDE   2
-#define MLD2_CHANGE_TO_INCLUDE 3
-#define MLD2_CHANGE_TO_EXCLUDE 4
-#define MLD2_ALLOW_NEW_SOURCES 5
-#define MLD2_BLOCK_OLD_SOURCES 6
-
-#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
-
-#ifdef __KERNEL__
 
 #include <linux/netdevice.h>
 
@@ -192,5 +31,3 @@ extern void                          icmpv6_flow_init(struct sock *sk,
                                                         const struct in6_addr *daddr,
                                                         int oif);
 #endif
-
-#endif
index 9adcc29f084af485a8b674dd6c6b3b51532ce68b..89b4614a47220e498b604034090eda7f10963b2c 100644 (file)
 #ifndef _LINUX_IF_ARP_H
 #define _LINUX_IF_ARP_H
 
-#include <linux/netdevice.h>
-
-/* ARP protocol HARDWARE identifiers. */
-#define ARPHRD_NETROM  0               /* from KA9Q: NET/ROM pseudo    */
-#define ARPHRD_ETHER   1               /* Ethernet 10Mbps              */
-#define        ARPHRD_EETHER   2               /* Experimental Ethernet        */
-#define        ARPHRD_AX25     3               /* AX.25 Level 2                */
-#define        ARPHRD_PRONET   4               /* PROnet token ring            */
-#define        ARPHRD_CHAOS    5               /* Chaosnet                     */
-#define        ARPHRD_IEEE802  6               /* IEEE 802.2 Ethernet/TR/TB    */
-#define        ARPHRD_ARCNET   7               /* ARCnet                       */
-#define        ARPHRD_APPLETLK 8               /* APPLEtalk                    */
-#define ARPHRD_DLCI    15              /* Frame Relay DLCI             */
-#define ARPHRD_ATM     19              /* ATM                          */
-#define ARPHRD_METRICOM        23              /* Metricom STRIP (new IANA id) */
-#define        ARPHRD_IEEE1394 24              /* IEEE 1394 IPv4 - RFC 2734    */
-#define ARPHRD_EUI64   27              /* EUI-64                       */
-#define ARPHRD_INFINIBAND 32           /* InfiniBand                   */
-
-/* Dummy types for non ARP hardware */
-#define ARPHRD_SLIP    256
-#define ARPHRD_CSLIP   257
-#define ARPHRD_SLIP6   258
-#define ARPHRD_CSLIP6  259
-#define ARPHRD_RSRVD   260             /* Notional KISS type           */
-#define ARPHRD_ADAPT   264
-#define ARPHRD_ROSE    270
-#define ARPHRD_X25     271             /* CCITT X.25                   */
-#define ARPHRD_HWX25   272             /* Boards with X.25 in firmware */
-#define ARPHRD_CAN     280             /* Controller Area Network      */
-#define ARPHRD_PPP     512
-#define ARPHRD_CISCO   513             /* Cisco HDLC                   */
-#define ARPHRD_HDLC    ARPHRD_CISCO
-#define ARPHRD_LAPB    516             /* LAPB                         */
-#define ARPHRD_DDCMP    517            /* Digital's DDCMP protocol     */
-#define ARPHRD_RAWHDLC 518             /* Raw HDLC                     */
-
-#define ARPHRD_TUNNEL  768             /* IPIP tunnel                  */
-#define ARPHRD_TUNNEL6 769             /* IP6IP6 tunnel                */
-#define ARPHRD_FRAD    770             /* Frame Relay Access Device    */
-#define ARPHRD_SKIP    771             /* SKIP vif                     */
-#define ARPHRD_LOOPBACK        772             /* Loopback device              */
-#define ARPHRD_LOCALTLK 773            /* Localtalk device             */
-#define ARPHRD_FDDI    774             /* Fiber Distributed Data Interface */
-#define ARPHRD_BIF      775             /* AP1000 BIF                   */
-#define ARPHRD_SIT     776             /* sit0 device - IPv6-in-IPv4   */
-#define ARPHRD_IPDDP   777             /* IP over DDP tunneller        */
-#define ARPHRD_IPGRE   778             /* GRE over IP                  */
-#define ARPHRD_PIMREG  779             /* PIMSM register interface     */
-#define ARPHRD_HIPPI   780             /* High Performance Parallel Interface */
-#define ARPHRD_ASH     781             /* Nexus 64Mbps Ash             */
-#define ARPHRD_ECONET  782             /* Acorn Econet                 */
-#define ARPHRD_IRDA    783             /* Linux-IrDA                   */
-/* ARP works differently on different FC media .. so  */
-#define ARPHRD_FCPP    784             /* Point to point fibrechannel  */
-#define ARPHRD_FCAL    785             /* Fibrechannel arbitrated loop */
-#define ARPHRD_FCPL    786             /* Fibrechannel public loop     */
-#define ARPHRD_FCFABRIC        787             /* Fibrechannel fabric          */
-       /* 787->799 reserved for fibrechannel media types */
-#define ARPHRD_IEEE802_TR 800          /* Magic type ident for TR      */
-#define ARPHRD_IEEE80211 801           /* IEEE 802.11                  */
-#define ARPHRD_IEEE80211_PRISM 802     /* IEEE 802.11 + Prism2 header  */
-#define ARPHRD_IEEE80211_RADIOTAP 803  /* IEEE 802.11 + radiotap header */
-#define ARPHRD_IEEE802154        804
-#define ARPHRD_IEEE802154_MONITOR 805  /* IEEE 802.15.4 network monitor */
-
-#define ARPHRD_PHONET  820             /* PhoNet media type            */
-#define ARPHRD_PHONET_PIPE 821         /* PhoNet pipe header           */
-#define ARPHRD_CAIF    822             /* CAIF media type              */
-#define ARPHRD_IP6GRE  823             /* GRE over IPv6                */
-
-#define ARPHRD_VOID      0xFFFF        /* Void type, nothing is known */
-#define ARPHRD_NONE      0xFFFE        /* zero header length */
-
-/* ARP protocol opcodes. */
-#define        ARPOP_REQUEST   1               /* ARP request                  */
-#define        ARPOP_REPLY     2               /* ARP reply                    */
-#define        ARPOP_RREQUEST  3               /* RARP request                 */
-#define        ARPOP_RREPLY    4               /* RARP reply                   */
-#define        ARPOP_InREQUEST 8               /* InARP request                */
-#define        ARPOP_InREPLY   9               /* InARP reply                  */
-#define        ARPOP_NAK       10              /* (ATM)ARP NAK                 */
-
-
-/* ARP ioctl request. */
-struct arpreq {
-  struct sockaddr      arp_pa;         /* protocol address             */
-  struct sockaddr      arp_ha;         /* hardware address             */
-  int                  arp_flags;      /* flags                        */
-  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
-  char                 arp_dev[16];
-};
-
-struct arpreq_old {
-  struct sockaddr      arp_pa;         /* protocol address             */
-  struct sockaddr      arp_ha;         /* hardware address             */
-  int                  arp_flags;      /* flags                        */
-  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
-};
-
-/* ARP Flag values. */
-#define ATF_COM                0x02            /* completed entry (ha valid)   */
-#define        ATF_PERM        0x04            /* permanent entry              */
-#define        ATF_PUBL        0x08            /* publish entry                */
-#define        ATF_USETRAILERS 0x10            /* has requested trailers       */
-#define ATF_NETMASK     0x20            /* want to use a netmask (only
-                                          for proxy entries) */
-#define ATF_DONTPUB    0x40            /* don't answer this addresses  */
-
-/*
- *     This structure defines an ethernet arp header.
- */
-
-struct arphdr {
-       __be16          ar_hrd;         /* format of hardware address   */
-       __be16          ar_pro;         /* format of protocol address   */
-       unsigned char   ar_hln;         /* length of hardware address   */
-       unsigned char   ar_pln;         /* length of protocol address   */
-       __be16          ar_op;          /* ARP opcode (command)         */
-
-#if 0
-        /*
-         *      Ethernet looks like this : This bit is variable sized however...
-         */
-       unsigned char           ar_sha[ETH_ALEN];       /* sender hardware address      */
-       unsigned char           ar_sip[4];              /* sender IP address            */
-       unsigned char           ar_tha[ETH_ALEN];       /* target hardware address      */
-       unsigned char           ar_tip[4];              /* target IP address            */
-#endif
-
-};
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/if_arp.h>
 
 static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
 {
@@ -168,6 +36,4 @@ static inline int arp_hdr_len(struct net_device *dev)
        /* ARP header, plus 2 device addresses, plus 2 IP addresses. */
        return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
 }
-#endif
-
 #endif /* _LINUX_IF_ARP_H */
index dd3f201396407dc7f4cac0c15452278c850ba261..1085ffeef956589d77dea0a426feedf6450fd20f 100644 (file)
@@ -9,97 +9,12 @@
  *     as published by the Free Software Foundation; either version
  *     2 of the License, or (at your option) any later version.
  */
-
 #ifndef _LINUX_IF_BRIDGE_H
 #define _LINUX_IF_BRIDGE_H
 
-#include <linux/types.h>
-
-#define SYSFS_BRIDGE_ATTR      "bridge"
-#define SYSFS_BRIDGE_FDB       "brforward"
-#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
-#define SYSFS_BRIDGE_PORT_ATTR "brport"
-#define SYSFS_BRIDGE_PORT_LINK "bridge"
-
-#define BRCTL_VERSION 1
-
-#define BRCTL_GET_VERSION 0
-#define BRCTL_GET_BRIDGES 1
-#define BRCTL_ADD_BRIDGE 2
-#define BRCTL_DEL_BRIDGE 3
-#define BRCTL_ADD_IF 4
-#define BRCTL_DEL_IF 5
-#define BRCTL_GET_BRIDGE_INFO 6
-#define BRCTL_GET_PORT_LIST 7
-#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
-#define BRCTL_SET_BRIDGE_HELLO_TIME 9
-#define BRCTL_SET_BRIDGE_MAX_AGE 10
-#define BRCTL_SET_AGEING_TIME 11
-#define BRCTL_SET_GC_INTERVAL 12
-#define BRCTL_GET_PORT_INFO 13
-#define BRCTL_SET_BRIDGE_STP_STATE 14
-#define BRCTL_SET_BRIDGE_PRIORITY 15
-#define BRCTL_SET_PORT_PRIORITY 16
-#define BRCTL_SET_PATH_COST 17
-#define BRCTL_GET_FDB_ENTRIES 18
-
-#define BR_STATE_DISABLED 0
-#define BR_STATE_LISTENING 1
-#define BR_STATE_LEARNING 2
-#define BR_STATE_FORWARDING 3
-#define BR_STATE_BLOCKING 4
-
-struct __bridge_info {
-       __u64 designated_root;
-       __u64 bridge_id;
-       __u32 root_path_cost;
-       __u32 max_age;
-       __u32 hello_time;
-       __u32 forward_delay;
-       __u32 bridge_max_age;
-       __u32 bridge_hello_time;
-       __u32 bridge_forward_delay;
-       __u8 topology_change;
-       __u8 topology_change_detected;
-       __u8 root_port;
-       __u8 stp_enabled;
-       __u32 ageing_time;
-       __u32 gc_interval;
-       __u32 hello_timer_value;
-       __u32 tcn_timer_value;
-       __u32 topology_change_timer_value;
-       __u32 gc_timer_value;
-};
-
-struct __port_info {
-       __u64 designated_root;
-       __u64 designated_bridge;
-       __u16 port_id;
-       __u16 designated_port;
-       __u32 path_cost;
-       __u32 designated_cost;
-       __u8 state;
-       __u8 top_change_ack;
-       __u8 config_pending;
-       __u8 unused0;
-       __u32 message_age_timer_value;
-       __u32 forward_delay_timer_value;
-       __u32 hold_timer_value;
-};
-
-struct __fdb_entry {
-       __u8 mac_addr[6];
-       __u8 port_no;
-       __u8 is_local;
-       __u32 ageing_timer_value;
-       __u8 port_hi;
-       __u8 pad0;
-       __u16 unused;
-};
-
-#ifdef __KERNEL__
 
 #include <linux/netdevice.h>
+#include <uapi/linux/if_bridge.h>
 
 extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
 
@@ -107,5 +22,3 @@ typedef int br_should_route_hook_t(struct sk_buff *skb);
 extern br_should_route_hook_t __rcu *br_should_route_hook;
 
 #endif
-
-#endif
index 18a5d02a864410df6b6eba5f8f6a67650150cacc..d984694c384d7dde37b7b1f9ac0a90e6ef7bb87f 100644 (file)
  *    McLean VA 22101
  *    Phone: 1-703-847-0040 ext 103
  */
-
 #ifndef _LINUX_IF_EQL_H
 #define _LINUX_IF_EQL_H
 
-#define EQL_DEFAULT_SLAVE_PRIORITY 28800
-#define EQL_DEFAULT_MAX_SLAVES     4
-#define EQL_DEFAULT_MTU            576
-#define EQL_DEFAULT_RESCHED_IVAL   HZ
-
-#define EQL_ENSLAVE     (SIOCDEVPRIVATE)
-#define EQL_EMANCIPATE  (SIOCDEVPRIVATE + 1)
-
-#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
-#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
-
-#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
-#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
-
-#ifdef __KERNEL__
 
 #include <linux/timer.h>
 #include <linux/spinlock.h>
+#include <uapi/linux/if_eql.h>
 
 typedef struct slave {
        struct list_head        list;
@@ -61,23 +46,4 @@ typedef struct equalizer {
        struct timer_list       timer;
 } equalizer_t;  
 
-#endif /* __KERNEL__ */
-
-typedef struct master_config {
-       char    master_name[16];
-       int     max_slaves;
-       int     min_slaves;
-} master_config_t;
-
-typedef struct slave_config {
-       char    slave_name[16];
-       long    priority;
-} slave_config_t;
-
-typedef struct slaving_request {
-       char    slave_name[16];
-       long    priority;
-} slaving_request_t;
-
-
 #endif /* _LINUX_EQL_H */
index 167ce5b363d2731aa4e5b82600164fb9ef52b245..12b4d55a02af195674e5369c0b35d7b37258d9f5 100644 (file)
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
-
 #ifndef _LINUX_IF_ETHER_H
 #define _LINUX_IF_ETHER_H
 
-#include <linux/types.h>
-
-/*
- *     IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
- *     and FCS/CRC (frame check sequence).
- */
-
-#define ETH_ALEN       6               /* Octets in one ethernet addr   */
-#define ETH_HLEN       14              /* Total octets in header.       */
-#define ETH_ZLEN       60              /* Min. octets in frame sans FCS */
-#define ETH_DATA_LEN   1500            /* Max. octets in payload        */
-#define ETH_FRAME_LEN  1514            /* Max. octets in frame sans FCS */
-#define ETH_FCS_LEN    4               /* Octets in the FCS             */
-
-/*
- *     These are the defined Ethernet Protocol ID's.
- */
-
-#define ETH_P_LOOP     0x0060          /* Ethernet Loopback packet     */
-#define ETH_P_PUP      0x0200          /* Xerox PUP packet             */
-#define ETH_P_PUPAT    0x0201          /* Xerox PUP Addr Trans packet  */
-#define ETH_P_IP       0x0800          /* Internet Protocol packet     */
-#define ETH_P_X25      0x0805          /* CCITT X.25                   */
-#define ETH_P_ARP      0x0806          /* Address Resolution packet    */
-#define        ETH_P_BPQ       0x08FF          /* G8BPQ AX.25 Ethernet Packet  [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_IEEEPUP  0x0a00          /* Xerox IEEE802.3 PUP packet */
-#define ETH_P_IEEEPUPAT        0x0a01          /* Xerox IEEE802.3 PUP Addr Trans packet */
-#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
-#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
-#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
-#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */
-#define ETH_P_LAT       0x6004          /* DEC LAT                      */
-#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */
-#define ETH_P_CUST      0x6006          /* DEC Customer use             */
-#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */
-#define ETH_P_TEB      0x6558          /* Trans Ether Bridging         */
-#define ETH_P_RARP      0x8035         /* Reverse Addr Res packet      */
-#define ETH_P_ATALK    0x809B          /* Appletalk DDP                */
-#define ETH_P_AARP     0x80F3          /* Appletalk AARP               */
-#define ETH_P_8021Q    0x8100          /* 802.1Q VLAN Extended Header  */
-#define ETH_P_IPX      0x8137          /* IPX over DIX                 */
-#define ETH_P_IPV6     0x86DD          /* IPv6 over bluebook           */
-#define ETH_P_PAUSE    0x8808          /* IEEE Pause frames. See 802.3 31B */
-#define ETH_P_SLOW     0x8809          /* Slow Protocol. See 802.3ad 43B */
-#define ETH_P_WCCP     0x883E          /* Web-cache coordination protocol
-                                        * defined in draft-wilson-wrec-wccp-v2-00.txt */
-#define ETH_P_PPP_DISC 0x8863          /* PPPoE discovery messages     */
-#define ETH_P_PPP_SES  0x8864          /* PPPoE session messages       */
-#define ETH_P_MPLS_UC  0x8847          /* MPLS Unicast traffic         */
-#define ETH_P_MPLS_MC  0x8848          /* MPLS Multicast traffic       */
-#define ETH_P_ATMMPOA  0x884c          /* MultiProtocol Over ATM       */
-#define ETH_P_LINK_CTL 0x886c          /* HPNA, wlan link local tunnel */
-#define ETH_P_ATMFATE  0x8884          /* Frame-based ATM Transport
-                                        * over Ethernet
-                                        */
-#define ETH_P_PAE      0x888E          /* Port Access Entity (IEEE 802.1X) */
-#define ETH_P_AOE      0x88A2          /* ATA over Ethernet            */
-#define ETH_P_8021AD   0x88A8          /* 802.1ad Service VLAN         */
-#define ETH_P_802_EX1  0x88B5          /* 802.1 Local Experimental 1.  */
-#define ETH_P_TIPC     0x88CA          /* TIPC                         */
-#define ETH_P_8021AH   0x88E7          /* 802.1ah Backbone Service Tag */
-#define ETH_P_1588     0x88F7          /* IEEE 1588 Timesync */
-#define ETH_P_FCOE     0x8906          /* Fibre Channel over Ethernet  */
-#define ETH_P_TDLS     0x890D          /* TDLS */
-#define ETH_P_FIP      0x8914          /* FCoE Initialization Protocol */
-#define ETH_P_QINQ1    0x9100          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_QINQ2    0x9200          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_QINQ3    0x9300          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_EDSA     0xDADA          /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_AF_IUCV   0xFBFB         /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
-
-/*
- *     Non DIX types. Won't clash for 1500 types.
- */
-
-#define ETH_P_802_3    0x0001          /* Dummy type for 802.3 frames  */
-#define ETH_P_AX25     0x0002          /* Dummy protocol id for AX.25  */
-#define ETH_P_ALL      0x0003          /* Every packet (be careful!!!) */
-#define ETH_P_802_2    0x0004          /* 802.2 frames                 */
-#define ETH_P_SNAP     0x0005          /* Internal only                */
-#define ETH_P_DDCMP     0x0006          /* DEC DDCMP: Internal only     */
-#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
-#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
-#define ETH_P_LOCALTALK 0x0009         /* Localtalk pseudo type        */
-#define ETH_P_CAN      0x000C          /* CAN: Controller Area Network */
-#define ETH_P_CANFD    0x000D          /* CANFD: CAN flexible data rate*/
-#define ETH_P_PPPTALK  0x0010          /* Dummy type for Atalk over PPP*/
-#define ETH_P_TR_802_2 0x0011          /* 802.2 frames                 */
-#define ETH_P_MOBITEX  0x0015          /* Mobitex (kaz@cafe.net)       */
-#define ETH_P_CONTROL  0x0016          /* Card specific control frames */
-#define ETH_P_IRDA     0x0017          /* Linux-IrDA                   */
-#define ETH_P_ECONET   0x0018          /* Acorn Econet                 */
-#define ETH_P_HDLC     0x0019          /* HDLC frames                  */
-#define ETH_P_ARCNET   0x001A          /* 1A for ArcNet :-)            */
-#define ETH_P_DSA      0x001B          /* Distributed Switch Arch.     */
-#define ETH_P_TRAILER  0x001C          /* Trailer switch tagging       */
-#define ETH_P_PHONET   0x00F5          /* Nokia Phonet frames          */
-#define ETH_P_IEEE802154 0x00F6                /* IEEE802.15.4 frame           */
-#define ETH_P_CAIF     0x00F7          /* ST-Ericsson CAIF protocol    */
-
-/*
- *     This is an Ethernet frame header.
- */
-
-struct ethhdr {
-       unsigned char   h_dest[ETH_ALEN];       /* destination eth addr */
-       unsigned char   h_source[ETH_ALEN];     /* source ether addr    */
-       __be16          h_proto;                /* packet type ID field */
-} __attribute__((packed));
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/if_ether.h>
 
 static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
 {
@@ -144,6 +33,4 @@ int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
 int mac_pton(const char *s, u8 *mac);
 extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
 
-#endif
-
 #endif /* _LINUX_IF_ETHER_H */
index e6dc11e7f9a54613f3700af8fe9d6557d8bd6135..f5550b3eeeab4b8f39bae85b80fbc8d132db33da 100644 (file)
 #ifndef _LINUX_IF_FDDI_H
 #define _LINUX_IF_FDDI_H
 
-#include <linux/types.h>
-
-/*
- *  Define max and min legal sizes.  The frame sizes do not include
- *  4 byte FCS/CRC (frame check sequence).
- */
-#define FDDI_K_ALEN                    6               /* Octets in one FDDI address */
-#define FDDI_K_8022_HLEN       16              /* Total octets in 802.2 header */
-#define FDDI_K_SNAP_HLEN       21              /* Total octets in 802.2 SNAP header */
-#define FDDI_K_8022_ZLEN       16              /* Min octets in 802.2 frame sans FCS */
-#define FDDI_K_SNAP_ZLEN       21              /* Min octets in 802.2 SNAP frame sans FCS */
-#define FDDI_K_8022_DLEN       4475    /* Max octets in 802.2 payload */
-#define FDDI_K_SNAP_DLEN       4470    /* Max octets in 802.2 SNAP payload */
-#define FDDI_K_LLC_ZLEN                13              /* Min octets in LLC frame sans FCS */
-#define FDDI_K_LLC_LEN         4491    /* Max octets in LLC frame sans FCS */
-
-/* Define FDDI Frame Control (FC) Byte values */
-#define FDDI_FC_K_VOID                                 0x00    
-#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80    
-#define FDDI_FC_K_RESTRICTED_TOKEN             0xC0    
-#define FDDI_FC_K_SMT_MIN                              0x41
-#define FDDI_FC_K_SMT_MAX                              0x4F
-#define FDDI_FC_K_MAC_MIN                              0xC1
-#define FDDI_FC_K_MAC_MAX                              0xCF    
-#define FDDI_FC_K_ASYNC_LLC_MIN                        0x50
-#define FDDI_FC_K_ASYNC_LLC_DEF                        0x54
-#define FDDI_FC_K_ASYNC_LLC_MAX                        0x5F
-#define FDDI_FC_K_SYNC_LLC_MIN                 0xD0
-#define FDDI_FC_K_SYNC_LLC_MAX                 0xD7
-#define FDDI_FC_K_IMPLEMENTOR_MIN              0x60
-#define FDDI_FC_K_IMPLEMENTOR_MAX              0x6F
-#define FDDI_FC_K_RESERVED_MIN                 0x70
-#define FDDI_FC_K_RESERVED_MAX                 0x7F
-
-/* Define LLC and SNAP constants */
-#define FDDI_EXTENDED_SAP      0xAA
-#define FDDI_UI_CMD                    0x03
-
-/* Define 802.2 Type 1 header */
-struct fddi_8022_1_hdr {
-       __u8    dsap;                                   /* destination service access point */
-       __u8    ssap;                                   /* source service access point */
-       __u8    ctrl;                                   /* control byte #1 */
-} __attribute__((packed));
-
-/* Define 802.2 Type 2 header */
-struct fddi_8022_2_hdr {
-       __u8    dsap;                                   /* destination service access point */
-       __u8    ssap;                                   /* source service access point */
-       __u8    ctrl_1;                                 /* control byte #1 */
-       __u8    ctrl_2;                                 /* control byte #2 */
-} __attribute__((packed));
-
-/* Define 802.2 SNAP header */
-#define FDDI_K_OUI_LEN 3
-struct fddi_snap_hdr {
-       __u8    dsap;                                   /* always 0xAA */
-       __u8    ssap;                                   /* always 0xAA */
-       __u8    ctrl;                                   /* always 0x03 */
-       __u8    oui[FDDI_K_OUI_LEN];    /* organizational universal id */
-       __be16  ethertype;                              /* packet type ID field */
-} __attribute__((packed));
-
-/* Define FDDI LLC frame header */
-struct fddihdr {
-       __u8    fc;                                             /* frame control */
-       __u8    daddr[FDDI_K_ALEN];             /* destination address */
-       __u8    saddr[FDDI_K_ALEN];             /* source address */
-       union
-               {
-               struct fddi_8022_1_hdr          llc_8022_1;
-               struct fddi_8022_2_hdr          llc_8022_2;
-               struct fddi_snap_hdr            llc_snap;
-               } hdr;
-} __attribute__((packed));
-
-#ifdef __KERNEL__
 #include <linux/netdevice.h>
+#include <uapi/linux/if_fddi.h>
 
 /* Define FDDI statistics structure */
 struct fddi_statistics {
@@ -194,6 +118,4 @@ struct fddi_statistics {
        __u32   port_ler_flag[2];
        __u32   port_hardware_present[2];
 };
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_IF_FDDI_H */
index 191ee0869bc16d7f1df9c42e2b8e4b881c17cd28..4316aa173dde363f136a082ef453ced40d65ae4e 100644 (file)
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
-
 #ifndef _FRAD_H_
 #define _FRAD_H_
 
-#include <linux/if.h>
-
-/* Structures and constants associated with the DLCI device driver */
-
-struct dlci_add
-{
-   char  devname[IFNAMSIZ];
-   short dlci;
-};
-
-#define DLCI_GET_CONF  (SIOCDEVPRIVATE + 2)
-#define DLCI_SET_CONF  (SIOCDEVPRIVATE + 3)
-
-/* 
- * These are related to the Sangoma SDLA and should remain in order. 
- * Code within the SDLA module is based on the specifics of this 
- * structure.  Change at your own peril.
- */
-struct dlci_conf {
-   short flags;
-   short CIR_fwd;
-   short Bc_fwd;
-   short Be_fwd;
-   short CIR_bwd;
-   short Bc_bwd;
-   short Be_bwd; 
-
-/* these are part of the status read */
-   short Tc_fwd;
-   short Tc_bwd;
-   short Tf_max;
-   short Tb_max;
-
-/* add any new fields here above is a mirror of sdla_dlci_conf */
-};
-
-#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
-
-/* configuration flags for DLCI */
-#define DLCI_IGNORE_CIR_OUT    0x0001
-#define DLCI_ACCOUNT_CIR_IN    0x0002
-#define DLCI_BUFFER_IF         0x0008
-
-#define DLCI_VALID_FLAGS       0x000B
+#include <uapi/linux/if_frad.h>
 
-/* defines for the actual Frame Relay hardware */
-#define FRAD_GET_CONF  (SIOCDEVPRIVATE)
-#define FRAD_SET_CONF  (SIOCDEVPRIVATE + 1)
-
-#define FRAD_LAST_IOCTL        FRAD_SET_CONF
-
-/*
- * Based on the setup for the Sangoma SDLA.  If changes are 
- * necessary to this structure, a routine will need to be 
- * added to that module to copy fields.
- */
-struct frad_conf 
-{
-   short station;
-   short flags;
-   short kbaud;
-   short clocking;
-   short mtu;
-   short T391;
-   short T392;
-   short N391;
-   short N392;
-   short N393;
-   short CIR_fwd;
-   short Bc_fwd;
-   short Be_fwd;
-   short CIR_bwd;
-   short Bc_bwd;
-   short Be_bwd;
-
-/* Add new fields here, above is a mirror of the sdla_conf */
-
-};
-
-#define FRAD_STATION_CPE       0x0000
-#define FRAD_STATION_NODE      0x0001
-
-#define FRAD_TX_IGNORE_CIR     0x0001
-#define FRAD_RX_ACCOUNT_CIR    0x0002
-#define FRAD_DROP_ABORTED      0x0004
-#define FRAD_BUFFERIF          0x0008
-#define FRAD_STATS             0x0010
-#define FRAD_MCI               0x0100
-#define FRAD_AUTODLCI          0x8000
-#define FRAD_VALID_FLAGS       0x811F
-
-#define FRAD_CLOCK_INT         0x0001
-#define FRAD_CLOCK_EXT         0x0000
-
-#ifdef __KERNEL__
 
 #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
 
@@ -188,6 +94,4 @@ struct frad_local
 
 extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *));
 
-#endif /* __KERNEL__ */
-
 #endif
index 3265f332998a54c9722fd2d6825aa63f60f3aba2..c3f817c3eb451091e5b02fc6c8f22e7af5d1126a 100644 (file)
@@ -1,341 +1,8 @@
 #ifndef _LINUX_IF_LINK_H
 #define _LINUX_IF_LINK_H
 
-#include <linux/types.h>
-#include <linux/netlink.h>
+#include <uapi/linux/if_link.h>
 
-/* This struct should be in sync with struct rtnl_link_stats64 */
-struct rtnl_link_stats {
-       __u32   rx_packets;             /* total packets received       */
-       __u32   tx_packets;             /* total packets transmitted    */
-       __u32   rx_bytes;               /* total bytes received         */
-       __u32   tx_bytes;               /* total bytes transmitted      */
-       __u32   rx_errors;              /* bad packets received         */
-       __u32   tx_errors;              /* packet transmit problems     */
-       __u32   rx_dropped;             /* no space in linux buffers    */
-       __u32   tx_dropped;             /* no space available in linux  */
-       __u32   multicast;              /* multicast packets received   */
-       __u32   collisions;
-
-       /* detailed rx_errors: */
-       __u32   rx_length_errors;
-       __u32   rx_over_errors;         /* receiver ring buff overflow  */
-       __u32   rx_crc_errors;          /* recved pkt with crc error    */
-       __u32   rx_frame_errors;        /* recv'd frame alignment error */
-       __u32   rx_fifo_errors;         /* recv'r fifo overrun          */
-       __u32   rx_missed_errors;       /* receiver missed packet       */
-
-       /* detailed tx_errors */
-       __u32   tx_aborted_errors;
-       __u32   tx_carrier_errors;
-       __u32   tx_fifo_errors;
-       __u32   tx_heartbeat_errors;
-       __u32   tx_window_errors;
-
-       /* for cslip etc */
-       __u32   rx_compressed;
-       __u32   tx_compressed;
-};
-
-/* The main device statistics structure */
-struct rtnl_link_stats64 {
-       __u64   rx_packets;             /* total packets received       */
-       __u64   tx_packets;             /* total packets transmitted    */
-       __u64   rx_bytes;               /* total bytes received         */
-       __u64   tx_bytes;               /* total bytes transmitted      */
-       __u64   rx_errors;              /* bad packets received         */
-       __u64   tx_errors;              /* packet transmit problems     */
-       __u64   rx_dropped;             /* no space in linux buffers    */
-       __u64   tx_dropped;             /* no space available in linux  */
-       __u64   multicast;              /* multicast packets received   */
-       __u64   collisions;
-
-       /* detailed rx_errors: */
-       __u64   rx_length_errors;
-       __u64   rx_over_errors;         /* receiver ring buff overflow  */
-       __u64   rx_crc_errors;          /* recved pkt with crc error    */
-       __u64   rx_frame_errors;        /* recv'd frame alignment error */
-       __u64   rx_fifo_errors;         /* recv'r fifo overrun          */
-       __u64   rx_missed_errors;       /* receiver missed packet       */
-
-       /* detailed tx_errors */
-       __u64   tx_aborted_errors;
-       __u64   tx_carrier_errors;
-       __u64   tx_fifo_errors;
-       __u64   tx_heartbeat_errors;
-       __u64   tx_window_errors;
-
-       /* for cslip etc */
-       __u64   rx_compressed;
-       __u64   tx_compressed;
-};
-
-/* The struct should be in sync with struct ifmap */
-struct rtnl_link_ifmap {
-       __u64   mem_start;
-       __u64   mem_end;
-       __u64   base_addr;
-       __u16   irq;
-       __u8    dma;
-       __u8    port;
-};
-
-/*
- * IFLA_AF_SPEC
- *   Contains nested attributes for address family specific attributes.
- *   Each address family may create a attribute with the address family
- *   number as type and create its own attribute structure in it.
- *
- *   Example:
- *   [IFLA_AF_SPEC] = {
- *       [AF_INET] = {
- *           [IFLA_INET_CONF] = ...,
- *       },
- *       [AF_INET6] = {
- *           [IFLA_INET6_FLAGS] = ...,
- *           [IFLA_INET6_CONF] = ...,
- *       }
- *   }
- */
-
-enum {
-       IFLA_UNSPEC,
-       IFLA_ADDRESS,
-       IFLA_BROADCAST,
-       IFLA_IFNAME,
-       IFLA_MTU,
-       IFLA_LINK,
-       IFLA_QDISC,
-       IFLA_STATS,
-       IFLA_COST,
-#define IFLA_COST IFLA_COST
-       IFLA_PRIORITY,
-#define IFLA_PRIORITY IFLA_PRIORITY
-       IFLA_MASTER,
-#define IFLA_MASTER IFLA_MASTER
-       IFLA_WIRELESS,          /* Wireless Extension event - see wireless.h */
-#define IFLA_WIRELESS IFLA_WIRELESS
-       IFLA_PROTINFO,          /* Protocol specific information for a link */
-#define IFLA_PROTINFO IFLA_PROTINFO
-       IFLA_TXQLEN,
-#define IFLA_TXQLEN IFLA_TXQLEN
-       IFLA_MAP,
-#define IFLA_MAP IFLA_MAP
-       IFLA_WEIGHT,
-#define IFLA_WEIGHT IFLA_WEIGHT
-       IFLA_OPERSTATE,
-       IFLA_LINKMODE,
-       IFLA_LINKINFO,
-#define IFLA_LINKINFO IFLA_LINKINFO
-       IFLA_NET_NS_PID,
-       IFLA_IFALIAS,
-       IFLA_NUM_VF,            /* Number of VFs if device is SR-IOV PF */
-       IFLA_VFINFO_LIST,
-       IFLA_STATS64,
-       IFLA_VF_PORTS,
-       IFLA_PORT_SELF,
-       IFLA_AF_SPEC,
-       IFLA_GROUP,             /* Group the device belongs to */
-       IFLA_NET_NS_FD,
-       IFLA_EXT_MASK,          /* Extended info mask, VFs, etc */
-       IFLA_PROMISCUITY,       /* Promiscuity count: > 0 means acts PROMISC */
-#define IFLA_PROMISCUITY IFLA_PROMISCUITY
-       IFLA_NUM_TX_QUEUES,
-       IFLA_NUM_RX_QUEUES,
-       __IFLA_MAX
-};
-
-
-#define IFLA_MAX (__IFLA_MAX - 1)
-
-/* backwards compatibility for userspace */
-#ifndef __KERNEL__
-#define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
-#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
-#endif
-
-enum {
-       IFLA_INET_UNSPEC,
-       IFLA_INET_CONF,
-       __IFLA_INET_MAX,
-};
-
-#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
-
-/* ifi_flags.
-
-   IFF_* flags.
-
-   The only change is:
-   IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
-   more not changeable by user. They describe link media
-   characteristics and set by device driver.
-
-   Comments:
-   - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
-   - If neither of these three flags are set;
-     the interface is NBMA.
-
-   - IFF_MULTICAST does not mean anything special:
-   multicasts can be used on all not-NBMA links.
-   IFF_MULTICAST means that this media uses special encapsulation
-   for multicast frames. Apparently, all IFF_POINTOPOINT and
-   IFF_BROADCAST devices are able to use multicasts too.
- */
-
-/* IFLA_LINK.
-   For usual devices it is equal ifi_index.
-   If it is a "virtual interface" (f.e. tunnel), ifi_link
-   can point to real physical interface (f.e. for bandwidth calculations),
-   or maybe 0, what means, that real media is unknown (usual
-   for IPIP tunnels, when route to endpoint is allowed to change)
- */
-
-/* Subtype attributes for IFLA_PROTINFO */
-enum {
-       IFLA_INET6_UNSPEC,
-       IFLA_INET6_FLAGS,       /* link flags                   */
-       IFLA_INET6_CONF,        /* sysctl parameters            */
-       IFLA_INET6_STATS,       /* statistics                   */
-       IFLA_INET6_MCAST,       /* MC things. What of them?     */
-       IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
-       IFLA_INET6_ICMP6STATS,  /* statistics (icmpv6)          */
-       __IFLA_INET6_MAX
-};
-
-#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
-
-struct ifla_cacheinfo {
-       __u32   max_reasm_len;
-       __u32   tstamp;         /* ipv6InterfaceTable updated timestamp */
-       __u32   reachable_time;
-       __u32   retrans_time;
-};
-
-enum {
-       IFLA_INFO_UNSPEC,
-       IFLA_INFO_KIND,
-       IFLA_INFO_DATA,
-       IFLA_INFO_XSTATS,
-       __IFLA_INFO_MAX,
-};
-
-#define IFLA_INFO_MAX  (__IFLA_INFO_MAX - 1)
-
-/* VLAN section */
-
-enum {
-       IFLA_VLAN_UNSPEC,
-       IFLA_VLAN_ID,
-       IFLA_VLAN_FLAGS,
-       IFLA_VLAN_EGRESS_QOS,
-       IFLA_VLAN_INGRESS_QOS,
-       __IFLA_VLAN_MAX,
-};
-
-#define IFLA_VLAN_MAX  (__IFLA_VLAN_MAX - 1)
-
-struct ifla_vlan_flags {
-       __u32   flags;
-       __u32   mask;
-};
-
-enum {
-       IFLA_VLAN_QOS_UNSPEC,
-       IFLA_VLAN_QOS_MAPPING,
-       __IFLA_VLAN_QOS_MAX
-};
-
-#define IFLA_VLAN_QOS_MAX      (__IFLA_VLAN_QOS_MAX - 1)
-
-struct ifla_vlan_qos_mapping {
-       __u32 from;
-       __u32 to;
-};
-
-/* MACVLAN section */
-enum {
-       IFLA_MACVLAN_UNSPEC,
-       IFLA_MACVLAN_MODE,
-       IFLA_MACVLAN_FLAGS,
-       __IFLA_MACVLAN_MAX,
-};
-
-#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
-
-enum macvlan_mode {
-       MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
-       MACVLAN_MODE_VEPA    = 2, /* talk to other ports through ext bridge */
-       MACVLAN_MODE_BRIDGE  = 4, /* talk to bridge ports directly */
-       MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
-};
-
-#define MACVLAN_FLAG_NOPROMISC 1
-
-/* VXLAN section */
-enum {
-       IFLA_VXLAN_UNSPEC,
-       IFLA_VXLAN_ID,
-       IFLA_VXLAN_GROUP,
-       IFLA_VXLAN_LINK,
-       IFLA_VXLAN_LOCAL,
-       IFLA_VXLAN_TTL,
-       IFLA_VXLAN_TOS,
-       IFLA_VXLAN_LEARNING,
-       IFLA_VXLAN_AGEING,
-       IFLA_VXLAN_LIMIT,
-       IFLA_VXLAN_PORT_RANGE,
-       __IFLA_VXLAN_MAX
-};
-#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
-
-struct ifla_vxlan_port_range {
-       __be16  low;
-       __be16  high;
-};
-
-/* SR-IOV virtual function management section */
-
-enum {
-       IFLA_VF_INFO_UNSPEC,
-       IFLA_VF_INFO,
-       __IFLA_VF_INFO_MAX,
-};
-
-#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
-
-enum {
-       IFLA_VF_UNSPEC,
-       IFLA_VF_MAC,            /* Hardware queue specific attributes */
-       IFLA_VF_VLAN,
-       IFLA_VF_TX_RATE,        /* TX Bandwidth Allocation */
-       IFLA_VF_SPOOFCHK,       /* Spoof Checking on/off switch */
-       __IFLA_VF_MAX,
-};
-
-#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
-
-struct ifla_vf_mac {
-       __u32 vf;
-       __u8 mac[32]; /* MAX_ADDR_LEN */
-};
-
-struct ifla_vf_vlan {
-       __u32 vf;
-       __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
-       __u32 qos;
-};
-
-struct ifla_vf_tx_rate {
-       __u32 vf;
-       __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
-};
-
-struct ifla_vf_spoofchk {
-       __u32 vf;
-       __u32 setting;
-};
-#ifdef __KERNEL__
 
 /* We don't want this structure exposed to user space */
 struct ifla_vf_info {
@@ -346,96 +13,4 @@ struct ifla_vf_info {
        __u32 tx_rate;
        __u32 spoofchk;
 };
-#endif
-
-/* VF ports management section
- *
- *     Nested layout of set/get msg is:
- *
- *             [IFLA_NUM_VF]
- *             [IFLA_VF_PORTS]
- *                     [IFLA_VF_PORT]
- *                             [IFLA_PORT_*], ...
- *                     [IFLA_VF_PORT]
- *                             [IFLA_PORT_*], ...
- *                     ...
- *             [IFLA_PORT_SELF]
- *                     [IFLA_PORT_*], ...
- */
-
-enum {
-       IFLA_VF_PORT_UNSPEC,
-       IFLA_VF_PORT,                   /* nest */
-       __IFLA_VF_PORT_MAX,
-};
-
-#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
-
-enum {
-       IFLA_PORT_UNSPEC,
-       IFLA_PORT_VF,                   /* __u32 */
-       IFLA_PORT_PROFILE,              /* string */
-       IFLA_PORT_VSI_TYPE,             /* 802.1Qbg (pre-)standard VDP */
-       IFLA_PORT_INSTANCE_UUID,        /* binary UUID */
-       IFLA_PORT_HOST_UUID,            /* binary UUID */
-       IFLA_PORT_REQUEST,              /* __u8 */
-       IFLA_PORT_RESPONSE,             /* __u16, output only */
-       __IFLA_PORT_MAX,
-};
-
-#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
-
-#define PORT_PROFILE_MAX       40
-#define PORT_UUID_MAX          16
-#define PORT_SELF_VF           -1
-
-enum {
-       PORT_REQUEST_PREASSOCIATE = 0,
-       PORT_REQUEST_PREASSOCIATE_RR,
-       PORT_REQUEST_ASSOCIATE,
-       PORT_REQUEST_DISASSOCIATE,
-};
-
-enum {
-       PORT_VDP_RESPONSE_SUCCESS = 0,
-       PORT_VDP_RESPONSE_INVALID_FORMAT,
-       PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
-       PORT_VDP_RESPONSE_UNUSED_VTID,
-       PORT_VDP_RESPONSE_VTID_VIOLATION,
-       PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
-       PORT_VDP_RESPONSE_OUT_OF_SYNC,
-       /* 0x08-0xFF reserved for future VDP use */
-       PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
-       PORT_PROFILE_RESPONSE_INPROGRESS,
-       PORT_PROFILE_RESPONSE_INVALID,
-       PORT_PROFILE_RESPONSE_BADSTATE,
-       PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
-       PORT_PROFILE_RESPONSE_ERROR,
-};
-
-struct ifla_port_vsi {
-       __u8 vsi_mgr_id;
-       __u8 vsi_type_id[3];
-       __u8 vsi_type_version;
-       __u8 pad[3];
-};
-
-
-/* IPoIB section */
-
-enum {
-       IFLA_IPOIB_UNSPEC,
-       IFLA_IPOIB_PKEY,
-       IFLA_IPOIB_MODE,
-       IFLA_IPOIB_UMCAST,
-       __IFLA_IPOIB_MAX
-};
-
-enum {
-       IPOIB_MODE_DATAGRAM  = 0, /* using unreliable datagram QPs */
-       IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
-};
-
-#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
-
 #endif /* _LINUX_IF_LINK_H */
index 76525760ba48398550dc856ec90c9a2ca55a05a7..81e434c50790f302213e3ce23b8447e9cb30a8b2 100644 (file)
@@ -1,12 +1,7 @@
 #ifndef __LINUX_LTALK_H
 #define __LINUX_LTALK_H
 
-#define LTALK_HLEN             1
-#define LTALK_MTU              600
-#define LTALK_ALEN             1
+#include <uapi/linux/if_ltalk.h>
 
-#ifdef __KERNEL__
 extern struct net_device *alloc_ltalkdev(int sizeof_priv);
 #endif
-
-#endif
index d70034bcec059800d9d972a6d37096b38cb4809c..bbcdb0a767d87de802237b503a75716f99a3b0aa 100644 (file)
@@ -8,12 +8,7 @@
 #ifndef LINUX_IF_PHONET_H
 #define LINUX_IF_PHONET_H
 
-#define PHONET_MIN_MTU         6       /* pn_length = 0 */
-#define PHONET_MAX_MTU         65541   /* pn_length = 0xffff */
-#define PHONET_DEV_MTU         PHONET_MAX_MTU
+#include <uapi/linux/if_phonet.h>
 
-#ifdef __KERNEL__
 extern struct header_ops phonet_header_ops;
 #endif
-
-#endif
index b4775418d525cdf04f9ac4b7250c2f2b50755503..0fb71e532b2c680388a4dfbeb11171bad96fe4a3 100644 (file)
  *             2 of the License, or (at your option) any later version.
  *
  */
-
 #ifndef __LINUX_IF_PPPOL2TP_H
 #define __LINUX_IF_PPPOL2TP_H
 
-#include <linux/types.h>
-
-#ifdef __KERNEL__
 #include <linux/in.h>
 #include <linux/in6.h>
-#endif
-
-/* Structure used to connect() the socket to a particular tunnel UDP
- * socket over IPv4.
- */
-struct pppol2tp_addr {
-       __kernel_pid_t  pid;            /* pid that owns the fd.
-                                        * 0 => current */
-       int     fd;                     /* FD of UDP socket to use */
-
-       struct sockaddr_in addr;        /* IP address and port to send to */
-
-       __u16 s_tunnel, s_session;      /* For matching incoming packets */
-       __u16 d_tunnel, d_session;      /* For sending outgoing packets */
-};
-
-/* Structure used to connect() the socket to a particular tunnel UDP
- * socket over IPv6.
- */
-struct pppol2tpin6_addr {
-       __kernel_pid_t  pid;            /* pid that owns the fd.
-                                        * 0 => current */
-       int     fd;                     /* FD of UDP socket to use */
-
-       __u16 s_tunnel, s_session;      /* For matching incoming packets */
-       __u16 d_tunnel, d_session;      /* For sending outgoing packets */
-
-       struct sockaddr_in6 addr;       /* IP address and port to send to */
-};
-
-/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
- * bits. So we need a different sockaddr structure.
- */
-struct pppol2tpv3_addr {
-       __kernel_pid_t  pid;            /* pid that owns the fd.
-                                        * 0 => current */
-       int     fd;                     /* FD of UDP or IP socket to use */
-
-       struct sockaddr_in addr;        /* IP address and port to send to */
-
-       __u32 s_tunnel, s_session;      /* For matching incoming packets */
-       __u32 d_tunnel, d_session;      /* For sending outgoing packets */
-};
-
-struct pppol2tpv3in6_addr {
-       __kernel_pid_t  pid;            /* pid that owns the fd.
-                                        * 0 => current */
-       int     fd;                     /* FD of UDP or IP socket to use */
-
-       __u32 s_tunnel, s_session;      /* For matching incoming packets */
-       __u32 d_tunnel, d_session;      /* For sending outgoing packets */
-
-       struct sockaddr_in6 addr;       /* IP address and port to send to */
-};
-
-/* Socket options:
- * DEBUG       - bitmask of debug message categories
- * SENDSEQ     - 0 => don't send packets with sequence numbers
- *               1 => send packets with sequence numbers
- * RECVSEQ     - 0 => receive packet sequence numbers are optional
- *               1 => drop receive packets without sequence numbers
- * LNSMODE     - 0 => act as LAC.
- *               1 => act as LNS.
- * REORDERTO   - reorder timeout (in millisecs). If 0, don't try to reorder.
- */
-enum {
-       PPPOL2TP_SO_DEBUG       = 1,
-       PPPOL2TP_SO_RECVSEQ     = 2,
-       PPPOL2TP_SO_SENDSEQ     = 3,
-       PPPOL2TP_SO_LNSMODE     = 4,
-       PPPOL2TP_SO_REORDERTO   = 5,
-};
-
-/* Debug message categories for the DEBUG socket option */
-enum {
-       PPPOL2TP_MSG_DEBUG      = (1 << 0),     /* verbose debug (if
-                                                * compiled in) */
-       PPPOL2TP_MSG_CONTROL    = (1 << 1),     /* userspace - kernel
-                                                * interface */
-       PPPOL2TP_MSG_SEQ        = (1 << 2),     /* sequence numbers */
-       PPPOL2TP_MSG_DATA       = (1 << 3),     /* data packets */
-};
-
-
+#include <uapi/linux/if_pppol2tp.h>
 
 #endif
index 09c474c480cd2429330b0d08971f863e44b749fe..aff7ad8a4ea3cdea45daca2049a7b83dc8151cc3 100644 (file)
  *             2 of the License, or (at your option) any later version.
  *
  */
-
 #ifndef __LINUX_IF_PPPOX_H
 #define __LINUX_IF_PPPOX_H
 
-
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-#include <linux/socket.h>
-#include <linux/if_ether.h>
-#ifdef  __KERNEL__
 #include <linux/if.h>
 #include <linux/netdevice.h>
 #include <linux/ppp_channel.h>
-#endif /* __KERNEL__ */
-#include <linux/if_pppol2tp.h>
-
-/* For user-space programs to pick up these definitions
- * which they wouldn't get otherwise without defining __KERNEL__
- */
-#ifndef AF_PPPOX
-#define AF_PPPOX       24
-#define PF_PPPOX       AF_PPPOX
-#endif /* !(AF_PPPOX) */
-
-/************************************************************************ 
- * PPPoE addressing definition 
- */ 
-typedef __be16 sid_t;
-struct pppoe_addr {
-       sid_t         sid;                    /* Session identifier */
-       unsigned char remote[ETH_ALEN];       /* Remote address */
-       char          dev[IFNAMSIZ];          /* Local device to use */
-}; 
-/************************************************************************ 
- * PPTP addressing definition
- */
-struct pptp_addr {
-       __be16          call_id;
-       struct in_addr  sin_addr;
-};
-
-/************************************************************************
- * Protocols supported by AF_PPPOX
- */
-#define PX_PROTO_OE    0 /* Currently just PPPoE */
-#define PX_PROTO_OL2TP 1 /* Now L2TP also */
-#define PX_PROTO_PPTP  2
-#define PX_MAX_PROTO   3
-
-struct sockaddr_pppox {
-       __kernel_sa_family_t sa_family;       /* address family, AF_PPPOX */
-       unsigned int    sa_protocol;          /* protocol identifier */
-       union {
-               struct pppoe_addr  pppoe;
-               struct pptp_addr   pptp;
-       } sa_addr;
-} __packed;
-
-/* The use of the above union isn't viable because the size of this
- * struct must stay fixed over time -- applications use sizeof(struct
- * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
- * type instead.
- */
-struct sockaddr_pppol2tp {
-       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
-       unsigned int    sa_protocol;    /* protocol identifier */
-       struct pppol2tp_addr pppol2tp;
-} __packed;
-
-struct sockaddr_pppol2tpin6 {
-       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
-       unsigned int    sa_protocol;    /* protocol identifier */
-       struct pppol2tpin6_addr pppol2tp;
-} __packed;
-
-/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
- * bits. So we need a different sockaddr structure.
- */
-struct sockaddr_pppol2tpv3 {
-       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
-       unsigned int    sa_protocol;    /* protocol identifier */
-       struct pppol2tpv3_addr pppol2tp;
-} __packed;
-
-struct sockaddr_pppol2tpv3in6 {
-       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
-       unsigned int    sa_protocol;    /* protocol identifier */
-       struct pppol2tpv3in6_addr pppol2tp;
-} __packed;
-
-/*********************************************************************
- *
- * ioctl interface for defining forwarding of connections
- *
- ********************************************************************/
-
-#define PPPOEIOCSFWD   _IOW(0xB1 ,0, size_t)
-#define PPPOEIOCDFWD   _IO(0xB1 ,1)
-/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
-
-/* Codes to identify message types */
-#define PADI_CODE      0x09
-#define PADO_CODE      0x07
-#define PADR_CODE      0x19
-#define PADS_CODE      0x65
-#define PADT_CODE      0xa7
-struct pppoe_tag {
-       __be16 tag_type;
-       __be16 tag_len;
-       char tag_data[0];
-} __attribute__ ((packed));
-
-/* Tag identifiers */
-#define PTT_EOL                __cpu_to_be16(0x0000)
-#define PTT_SRV_NAME   __cpu_to_be16(0x0101)
-#define PTT_AC_NAME    __cpu_to_be16(0x0102)
-#define PTT_HOST_UNIQ  __cpu_to_be16(0x0103)
-#define PTT_AC_COOKIE  __cpu_to_be16(0x0104)
-#define PTT_VENDOR     __cpu_to_be16(0x0105)
-#define PTT_RELAY_SID  __cpu_to_be16(0x0110)
-#define PTT_SRV_ERR     __cpu_to_be16(0x0201)
-#define PTT_SYS_ERR    __cpu_to_be16(0x0202)
-#define PTT_GEN_ERR    __cpu_to_be16(0x0203)
-
-struct pppoe_hdr {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 ver : 4;
-       __u8 type : 4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u8 type : 4;
-       __u8 ver : 4;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       __u8 code;
-       __be16 sid;
-       __be16 length;
-       struct pppoe_tag tag[0];
-} __packed;
-
-/* Length of entire PPPoE + PPP header */
-#define PPPOE_SES_HLEN 8
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/if_pppox.h>
 
 static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
 {
@@ -232,6 +93,4 @@ enum {
     PPPOX_DEAD         = 16  /* dead, useless, please clean me up!*/
 };
 
-#endif /* __KERNEL__ */
-
 #endif /* !(__LINUX_IF_PPPOX_H) */
index 6d88a7f576808cbd743ca1c4ad42d2cb5b6ba8cd..0245def2aa9394a8c2fd2dcd70ada65d07e78de4 100644 (file)
@@ -7,14 +7,13 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
-
 #ifndef _LINUX_IF_TEAM_H_
 #define _LINUX_IF_TEAM_H_
 
-#ifdef __KERNEL__
 
 #include <linux/netpoll.h>
 #include <net/sch_generic.h>
+#include <uapi/linux/if_team.h>
 
 struct team_pcpu_stats {
        u64                     rx_packets;
@@ -251,98 +250,4 @@ extern void team_mode_unregister(const struct team_mode *mode);
 #define TEAM_DEFAULT_NUM_TX_QUEUES 16
 #define TEAM_DEFAULT_NUM_RX_QUEUES 16
 
-#endif /* __KERNEL__ */
-
-#define TEAM_STRING_MAX_LEN 32
-
-/**********************************
- * NETLINK_GENERIC netlink family.
- **********************************/
-
-enum {
-       TEAM_CMD_NOOP,
-       TEAM_CMD_OPTIONS_SET,
-       TEAM_CMD_OPTIONS_GET,
-       TEAM_CMD_PORT_LIST_GET,
-
-       __TEAM_CMD_MAX,
-       TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
-};
-
-enum {
-       TEAM_ATTR_UNSPEC,
-       TEAM_ATTR_TEAM_IFINDEX,         /* u32 */
-       TEAM_ATTR_LIST_OPTION,          /* nest */
-       TEAM_ATTR_LIST_PORT,            /* nest */
-
-       __TEAM_ATTR_MAX,
-       TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
-};
-
-/* Nested layout of get/set msg:
- *
- *     [TEAM_ATTR_LIST_OPTION]
- *             [TEAM_ATTR_ITEM_OPTION]
- *                     [TEAM_ATTR_OPTION_*], ...
- *             [TEAM_ATTR_ITEM_OPTION]
- *                     [TEAM_ATTR_OPTION_*], ...
- *             ...
- *     [TEAM_ATTR_LIST_PORT]
- *             [TEAM_ATTR_ITEM_PORT]
- *                     [TEAM_ATTR_PORT_*], ...
- *             [TEAM_ATTR_ITEM_PORT]
- *                     [TEAM_ATTR_PORT_*], ...
- *             ...
- */
-
-enum {
-       TEAM_ATTR_ITEM_OPTION_UNSPEC,
-       TEAM_ATTR_ITEM_OPTION,          /* nest */
-
-       __TEAM_ATTR_ITEM_OPTION_MAX,
-       TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
-};
-
-enum {
-       TEAM_ATTR_OPTION_UNSPEC,
-       TEAM_ATTR_OPTION_NAME,          /* string */
-       TEAM_ATTR_OPTION_CHANGED,       /* flag */
-       TEAM_ATTR_OPTION_TYPE,          /* u8 */
-       TEAM_ATTR_OPTION_DATA,          /* dynamic */
-       TEAM_ATTR_OPTION_REMOVED,       /* flag */
-       TEAM_ATTR_OPTION_PORT_IFINDEX,  /* u32 */ /* for per-port options */
-       TEAM_ATTR_OPTION_ARRAY_INDEX,   /* u32 */ /* for array options */
-
-       __TEAM_ATTR_OPTION_MAX,
-       TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
-};
-
-enum {
-       TEAM_ATTR_ITEM_PORT_UNSPEC,
-       TEAM_ATTR_ITEM_PORT,            /* nest */
-
-       __TEAM_ATTR_ITEM_PORT_MAX,
-       TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
-};
-
-enum {
-       TEAM_ATTR_PORT_UNSPEC,
-       TEAM_ATTR_PORT_IFINDEX,         /* u32 */
-       TEAM_ATTR_PORT_CHANGED,         /* flag */
-       TEAM_ATTR_PORT_LINKUP,          /* flag */
-       TEAM_ATTR_PORT_SPEED,           /* u32 */
-       TEAM_ATTR_PORT_DUPLEX,          /* u8 */
-       TEAM_ATTR_PORT_REMOVED,         /* flag */
-
-       __TEAM_ATTR_PORT_MAX,
-       TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
-};
-
-/*
- * NETLINK_GENERIC related info
- */
-#define TEAM_GENL_NAME "team"
-#define TEAM_GENL_VERSION 0x1
-#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
-
 #endif /* _LINUX_IF_TEAM_H_ */
index 06b1829731fd6f6c7f4864463c0ee2b73b4e15bf..ed6da2e6df9019d576292e43bd612c898961d9ce 100644 (file)
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  *  GNU General Public License for more details.
  */
-
 #ifndef __IF_TUN_H
 #define __IF_TUN_H
 
-#include <linux/types.h>
-#include <linux/if_ether.h>
-#include <linux/filter.h>
-
-/* Read queue size */
-#define TUN_READQ_SIZE 500
-
-/* TUN device flags */
-#define TUN_TUN_DEV    0x0001  
-#define TUN_TAP_DEV    0x0002
-#define TUN_TYPE_MASK   0x000f
-
-#define TUN_FASYNC     0x0010
-#define TUN_NOCHECKSUM 0x0020
-#define TUN_NO_PI      0x0040
-#define TUN_ONE_QUEUE  0x0080
-#define TUN_PERSIST    0x0100  
-#define TUN_VNET_HDR   0x0200
-
-/* Ioctl defines */
-#define TUNSETNOCSUM  _IOW('T', 200, int) 
-#define TUNSETDEBUG   _IOW('T', 201, int) 
-#define TUNSETIFF     _IOW('T', 202, int) 
-#define TUNSETPERSIST _IOW('T', 203, int) 
-#define TUNSETOWNER   _IOW('T', 204, int)
-#define TUNSETLINK    _IOW('T', 205, int)
-#define TUNSETGROUP   _IOW('T', 206, int)
-#define TUNGETFEATURES _IOR('T', 207, unsigned int)
-#define TUNSETOFFLOAD  _IOW('T', 208, unsigned int)
-#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
-#define TUNGETIFF      _IOR('T', 210, unsigned int)
-#define TUNGETSNDBUF   _IOR('T', 211, int)
-#define TUNSETSNDBUF   _IOW('T', 212, int)
-#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
-#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
-#define TUNGETVNETHDRSZ _IOR('T', 215, int)
-#define TUNSETVNETHDRSZ _IOW('T', 216, int)
-
-/* TUNSETIFF ifr flags */
-#define IFF_TUN                0x0001
-#define IFF_TAP                0x0002
-#define IFF_NO_PI      0x1000
-#define IFF_ONE_QUEUE  0x2000
-#define IFF_VNET_HDR   0x4000
-#define IFF_TUN_EXCL   0x8000
-
-/* Features for GSO (TUNSETOFFLOAD). */
-#define TUN_F_CSUM     0x01    /* You can hand me unchecksummed packets. */
-#define TUN_F_TSO4     0x02    /* I can handle TSO for IPv4 packets */
-#define TUN_F_TSO6     0x04    /* I can handle TSO for IPv6 packets */
-#define TUN_F_TSO_ECN  0x08    /* I can handle TSO with ECN bits. */
-#define TUN_F_UFO      0x10    /* I can handle UFO packets */
-
-/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
-#define TUN_PKT_STRIP  0x0001
-struct tun_pi {
-       __u16  flags;
-       __be16 proto;
-};
-
-/*
- * Filter spec (used for SETXXFILTER ioctls)
- * This stuff is applicable only to the TAP (Ethernet) devices.
- * If the count is zero the filter is disabled and the driver accepts
- * all packets (promisc mode).
- * If the filter is enabled in order to accept broadcast packets
- * broadcast addr must be explicitly included in the addr list.
- */
-#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
-struct tun_filter {
-       __u16  flags; /* TUN_FLT_ flags see above */
-       __u16  count; /* Number of addresses */
-       __u8   addr[0][ETH_ALEN];
-};
+#include <uapi/linux/if_tun.h>
 
-#ifdef __KERNEL__
 #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
 struct socket *tun_get_socket(struct file *);
 #else
@@ -104,5 +29,4 @@ static inline struct socket *tun_get_socket(struct file *f)
        return ERR_PTR(-EINVAL);
 }
 #endif /* CONFIG_TUN */
-#endif /* __KERNEL__ */
 #endif /* __IF_TUN_H */
index 8c5035ac31421aa1bee89a34c342de34ff63131a..1cc595a67cc900b18afe694ca712700fba7e5c2e 100644 (file)
@@ -1,100 +1,8 @@
 #ifndef _IF_TUNNEL_H_
 #define _IF_TUNNEL_H_
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-#ifdef __KERNEL__
 #include <linux/ip.h>
 #include <linux/in6.h>
-#endif
-
-#define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
-#define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
-#define SIOCDELTUNNEL   (SIOCDEVPRIVATE + 2)
-#define SIOCCHGTUNNEL   (SIOCDEVPRIVATE + 3)
-#define SIOCGETPRL      (SIOCDEVPRIVATE + 4)
-#define SIOCADDPRL      (SIOCDEVPRIVATE + 5)
-#define SIOCDELPRL      (SIOCDEVPRIVATE + 6)
-#define SIOCCHGPRL      (SIOCDEVPRIVATE + 7)
-#define SIOCGET6RD      (SIOCDEVPRIVATE + 8)
-#define SIOCADD6RD      (SIOCDEVPRIVATE + 9)
-#define SIOCDEL6RD      (SIOCDEVPRIVATE + 10)
-#define SIOCCHG6RD      (SIOCDEVPRIVATE + 11)
-
-#define GRE_CSUM       __cpu_to_be16(0x8000)
-#define GRE_ROUTING    __cpu_to_be16(0x4000)
-#define GRE_KEY                __cpu_to_be16(0x2000)
-#define GRE_SEQ                __cpu_to_be16(0x1000)
-#define GRE_STRICT     __cpu_to_be16(0x0800)
-#define GRE_REC                __cpu_to_be16(0x0700)
-#define GRE_FLAGS      __cpu_to_be16(0x00F8)
-#define GRE_VERSION    __cpu_to_be16(0x0007)
-
-struct ip_tunnel_parm {
-       char                    name[IFNAMSIZ];
-       int                     link;
-       __be16                  i_flags;
-       __be16                  o_flags;
-       __be32                  i_key;
-       __be32                  o_key;
-       struct iphdr            iph;
-};
-
-/* SIT-mode i_flags */
-#define        SIT_ISATAP      0x0001
-
-struct ip_tunnel_prl {
-       __be32                  addr;
-       __u16                   flags;
-       __u16                   __reserved;
-       __u32                   datalen;
-       __u32                   __reserved2;
-       /* data follows */
-};
-
-/* PRL flags */
-#define        PRL_DEFAULT             0x0001
-
-struct ip_tunnel_6rd {
-       struct in6_addr         prefix;
-       __be32                  relay_prefix;
-       __u16                   prefixlen;
-       __u16                   relay_prefixlen;
-};
-
-enum {
-       IFLA_GRE_UNSPEC,
-       IFLA_GRE_LINK,
-       IFLA_GRE_IFLAGS,
-       IFLA_GRE_OFLAGS,
-       IFLA_GRE_IKEY,
-       IFLA_GRE_OKEY,
-       IFLA_GRE_LOCAL,
-       IFLA_GRE_REMOTE,
-       IFLA_GRE_TTL,
-       IFLA_GRE_TOS,
-       IFLA_GRE_PMTUDISC,
-       IFLA_GRE_ENCAP_LIMIT,
-       IFLA_GRE_FLOWINFO,
-       IFLA_GRE_FLAGS,
-       __IFLA_GRE_MAX,
-};
-
-#define IFLA_GRE_MAX   (__IFLA_GRE_MAX - 1)
-
-/* VTI-mode i_flags */
-#define VTI_ISVTI 0x0001
-
-enum {
-       IFLA_VTI_UNSPEC,
-       IFLA_VTI_LINK,
-       IFLA_VTI_IKEY,
-       IFLA_VTI_OKEY,
-       IFLA_VTI_LOCAL,
-       IFLA_VTI_REMOTE,
-       __IFLA_VTI_MAX,
-};
+#include <uapi/linux/if_tunnel.h>
 
-#define IFLA_VTI_MAX   (__IFLA_VTI_MAX - 1)
 #endif /* _IF_TUNNEL_H_ */
index c0ff748d0aa546671293ba5b42c46d108b7a6e26..d06cc5c8f58cf3a58ed34101f362a0b9be0fc0a6 100644 (file)
@@ -9,15 +9,14 @@
  *             2 of the License, or (at your option) any later version.
  *
  */
-
 #ifndef _LINUX_IF_VLAN_H_
 #define _LINUX_IF_VLAN_H_
 
-#ifdef __KERNEL__
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/rtnetlink.h>
 #include <linux/bug.h>
+#include <uapi/linux/if_vlan.h>
 
 #define VLAN_HLEN      4               /* The additional bytes required by VLAN
                                         * (in addition to the Ethernet header)
@@ -361,52 +360,4 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
                 */
                skb->protocol = htons(ETH_P_802_2);
 }
-#endif /* __KERNEL__ */
-
-/* VLAN IOCTLs are found in sockios.h */
-
-/* Passed in vlan_ioctl_args structure to determine behaviour. */
-enum vlan_ioctl_cmds {
-       ADD_VLAN_CMD,
-       DEL_VLAN_CMD,
-       SET_VLAN_INGRESS_PRIORITY_CMD,
-       SET_VLAN_EGRESS_PRIORITY_CMD,
-       GET_VLAN_INGRESS_PRIORITY_CMD,
-       GET_VLAN_EGRESS_PRIORITY_CMD,
-       SET_VLAN_NAME_TYPE_CMD,
-       SET_VLAN_FLAG_CMD,
-       GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
-       GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
-};
-
-enum vlan_flags {
-       VLAN_FLAG_REORDER_HDR   = 0x1,
-       VLAN_FLAG_GVRP          = 0x2,
-       VLAN_FLAG_LOOSE_BINDING = 0x4,
-};
-
-enum vlan_name_types {
-       VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
-       VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
-       VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
-       VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
-       VLAN_NAME_TYPE_HIGHEST
-};
-
-struct vlan_ioctl_args {
-       int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
-       char device1[24];
-
-        union {
-               char device2[24];
-               int VID;
-               unsigned int skb_priority;
-               unsigned int name_type;
-               unsigned int bind_type;
-               unsigned int flag; /* Matches vlan_dev_priv flags */
-        } u;
-
-       short vlan_qos;   
-};
-
 #endif /* !(_LINUX_IF_VLAN_H_) */
index 82de336b81550af6a64fff632037acec7e145f2a..7f2bf15184802b12733489b36755fce4e9c2caf4 100644 (file)
  *     as published by the Free Software Foundation; either version
  *     2 of the License, or (at your option) any later version.
  */
-
 #ifndef _LINUX_IGMP_H
 #define _LINUX_IGMP_H
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-
-/*
- *     IGMP protocol structures
- */
-
-/*
- *     Header in on cable format
- */
-
-struct igmphdr {
-       __u8 type;
-       __u8 code;              /* For newer IGMP */
-       __sum16 csum;
-       __be32 group;
-};
-
-/* V3 group record types [grec_type] */
-#define IGMPV3_MODE_IS_INCLUDE         1
-#define IGMPV3_MODE_IS_EXCLUDE         2
-#define IGMPV3_CHANGE_TO_INCLUDE       3
-#define IGMPV3_CHANGE_TO_EXCLUDE       4
-#define IGMPV3_ALLOW_NEW_SOURCES       5
-#define IGMPV3_BLOCK_OLD_SOURCES       6
-
-struct igmpv3_grec {
-       __u8    grec_type;
-       __u8    grec_auxwords;
-       __be16  grec_nsrcs;
-       __be32  grec_mca;
-       __be32  grec_src[0];
-};
-
-struct igmpv3_report {
-       __u8 type;
-       __u8 resv1;
-       __be16 csum;
-       __be16 resv2;
-       __be16 ngrec;
-       struct igmpv3_grec grec[0];
-};
-
-struct igmpv3_query {
-       __u8 type;
-       __u8 code;
-       __be16 csum;
-       __be32 group;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8 qrv:3,
-            suppress:1,
-            resv:4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u8 resv:4,
-            suppress:1,
-            qrv:3;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       __u8 qqic;
-       __be16 nsrcs;
-       __be32 srcs[0];
-};
-
-#define IGMP_HOST_MEMBERSHIP_QUERY     0x11    /* From RFC1112 */
-#define IGMP_HOST_MEMBERSHIP_REPORT    0x12    /* Ditto */
-#define IGMP_DVMRP                     0x13    /* DVMRP routing */
-#define IGMP_PIM                       0x14    /* PIM routing */
-#define IGMP_TRACE                     0x15
-#define IGMPV2_HOST_MEMBERSHIP_REPORT  0x16    /* V2 version of 0x12 */
-#define IGMP_HOST_LEAVE_MESSAGE        0x17
-#define IGMPV3_HOST_MEMBERSHIP_REPORT  0x22    /* V3 version of 0x12 */
-
-#define IGMP_MTRACE_RESP               0x1e
-#define IGMP_MTRACE                    0x1f
-
-
-/*
- *     Use the BSD names for these for compatibility
- */
-
-#define IGMP_DELAYING_MEMBER           0x01
-#define IGMP_IDLE_MEMBER               0x02
-#define IGMP_LAZY_MEMBER               0x03
-#define IGMP_SLEEPING_MEMBER           0x04
-#define IGMP_AWAKENING_MEMBER          0x05
-
-#define IGMP_MINLEN                    8
-
-#define IGMP_MAX_HOST_REPORT_DELAY     10      /* max delay for response to */
-                                               /* query (in seconds)   */
-
-#define IGMP_TIMER_SCALE               10      /* denotes that the igmphdr->timer field */
-                                               /* specifies time in 10th of seconds     */
-
-#define IGMP_AGE_THRESHOLD             400     /* If this host don't hear any IGMP V1  */
-                                               /* message in this period of time,      */
-                                               /* revert to IGMP v2 router.            */
-
-#define IGMP_ALL_HOSTS         htonl(0xE0000001L)
-#define IGMP_ALL_ROUTER        htonl(0xE0000002L)
-#define IGMPV3_ALL_MCR         htonl(0xE0000016L)
-#define IGMP_LOCAL_GROUP       htonl(0xE0000000L)
-#define IGMP_LOCAL_GROUP_MASK  htonl(0xFFFFFF00L)
-
-/*
- * struct for keeping the multicast list in
- */
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
 #include <linux/timer.h>
 #include <linux/in.h>
+#include <uapi/linux/igmp.h>
 
 static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
 {
@@ -241,4 +131,3 @@ extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
 extern void ip_mc_rejoin_groups(struct in_device *in_dev);
 
 #endif
-#endif
index e0337f11d92eb54e0c78db71a9d1b6fcb3f42d80..31b493734763df02cb16d4480787adf4bc927ed3 100644 (file)
 #ifndef _LINUX_IN_H
 #define _LINUX_IN_H
 
-#include <linux/types.h>
-#include <linux/socket.h>
-
-/* Standard well-defined IP protocols.  */
-enum {
-  IPPROTO_IP = 0,              /* Dummy protocol for TCP               */
-  IPPROTO_ICMP = 1,            /* Internet Control Message Protocol    */
-  IPPROTO_IGMP = 2,            /* Internet Group Management Protocol   */
-  IPPROTO_IPIP = 4,            /* IPIP tunnels (older KA9Q tunnels use 94) */
-  IPPROTO_TCP = 6,             /* Transmission Control Protocol        */
-  IPPROTO_EGP = 8,             /* Exterior Gateway Protocol            */
-  IPPROTO_PUP = 12,            /* PUP protocol                         */
-  IPPROTO_UDP = 17,            /* User Datagram Protocol               */
-  IPPROTO_IDP = 22,            /* XNS IDP protocol                     */
-  IPPROTO_DCCP = 33,           /* Datagram Congestion Control Protocol */
-  IPPROTO_RSVP = 46,           /* RSVP protocol                        */
-  IPPROTO_GRE = 47,            /* Cisco GRE tunnels (rfc 1701,1702)    */
-
-  IPPROTO_IPV6  = 41,          /* IPv6-in-IPv4 tunnelling              */
-
-  IPPROTO_ESP = 50,            /* Encapsulation Security Payload protocol */
-  IPPROTO_AH = 51,             /* Authentication Header protocol       */
-  IPPROTO_BEETPH = 94,        /* IP option pseudo header for BEET */
-  IPPROTO_PIM    = 103,                /* Protocol Independent Multicast       */
-
-  IPPROTO_COMP   = 108,                /* Compression Header protocol */
-  IPPROTO_SCTP   = 132,                /* Stream Control Transport Protocol    */
-  IPPROTO_UDPLITE = 136,       /* UDP-Lite (RFC 3828)                  */
-
-  IPPROTO_RAW   = 255,         /* Raw IP packets                       */
-  IPPROTO_MAX
-};
-
-
-/* Internet address. */
-struct in_addr {
-       __be32  s_addr;
-};
-
-#define IP_TOS         1
-#define IP_TTL         2
-#define IP_HDRINCL     3
-#define IP_OPTIONS     4
-#define IP_ROUTER_ALERT        5
-#define IP_RECVOPTS    6
-#define IP_RETOPTS     7
-#define IP_PKTINFO     8
-#define IP_PKTOPTIONS  9
-#define IP_MTU_DISCOVER        10
-#define IP_RECVERR     11
-#define IP_RECVTTL     12
-#define        IP_RECVTOS      13
-#define IP_MTU         14
-#define IP_FREEBIND    15
-#define IP_IPSEC_POLICY        16
-#define IP_XFRM_POLICY 17
-#define IP_PASSSEC     18
-#define IP_TRANSPARENT 19
-
-/* BSD compatibility */
-#define IP_RECVRETOPTS IP_RETOPTS
-
-/* TProxy original addresses */
-#define IP_ORIGDSTADDR       20
-#define IP_RECVORIGDSTADDR   IP_ORIGDSTADDR
-
-#define IP_MINTTL       21
-#define IP_NODEFRAG     22
-
-/* IP_MTU_DISCOVER values */
-#define IP_PMTUDISC_DONT               0       /* Never send DF frames */
-#define IP_PMTUDISC_WANT               1       /* Use per route hints  */
-#define IP_PMTUDISC_DO                 2       /* Always DF            */
-#define IP_PMTUDISC_PROBE              3       /* Ignore dst pmtu      */
-
-#define IP_MULTICAST_IF                        32
-#define IP_MULTICAST_TTL               33
-#define IP_MULTICAST_LOOP              34
-#define IP_ADD_MEMBERSHIP              35
-#define IP_DROP_MEMBERSHIP             36
-#define IP_UNBLOCK_SOURCE              37
-#define IP_BLOCK_SOURCE                        38
-#define IP_ADD_SOURCE_MEMBERSHIP       39
-#define IP_DROP_SOURCE_MEMBERSHIP      40
-#define IP_MSFILTER                    41
-#define MCAST_JOIN_GROUP               42
-#define MCAST_BLOCK_SOURCE             43
-#define MCAST_UNBLOCK_SOURCE           44
-#define MCAST_LEAVE_GROUP              45
-#define MCAST_JOIN_SOURCE_GROUP                46
-#define MCAST_LEAVE_SOURCE_GROUP       47
-#define MCAST_MSFILTER                 48
-#define IP_MULTICAST_ALL               49
-#define IP_UNICAST_IF                  50
-
-#define MCAST_EXCLUDE  0
-#define MCAST_INCLUDE  1
-
-/* These need to appear somewhere around here */
-#define IP_DEFAULT_MULTICAST_TTL        1
-#define IP_DEFAULT_MULTICAST_LOOP       1
-
-/* Request struct for multicast socket ops */
-
-struct ip_mreq  {
-       struct in_addr imr_multiaddr;   /* IP multicast address of group */
-       struct in_addr imr_interface;   /* local IP address of interface */
-};
-
-struct ip_mreqn {
-       struct in_addr  imr_multiaddr;          /* IP multicast address of group */
-       struct in_addr  imr_address;            /* local IP address of interface */
-       int             imr_ifindex;            /* Interface index */
-};
-
-struct ip_mreq_source {
-       __be32          imr_multiaddr;
-       __be32          imr_interface;
-       __be32          imr_sourceaddr;
-};
-
-struct ip_msfilter {
-       __be32          imsf_multiaddr;
-       __be32          imsf_interface;
-       __u32           imsf_fmode;
-       __u32           imsf_numsrc;
-       __be32          imsf_slist[1];
-};
-
-#define IP_MSFILTER_SIZE(numsrc) \
-       (sizeof(struct ip_msfilter) - sizeof(__u32) \
-       + (numsrc) * sizeof(__u32))
-
-struct group_req {
-       __u32                            gr_interface;  /* interface index */
-       struct __kernel_sockaddr_storage gr_group;      /* group address */
-};
-
-struct group_source_req {
-       __u32                            gsr_interface; /* interface index */
-       struct __kernel_sockaddr_storage gsr_group;     /* group address */
-       struct __kernel_sockaddr_storage gsr_source;    /* source address */
-};
-
-struct group_filter {
-       __u32                            gf_interface;  /* interface index */
-       struct __kernel_sockaddr_storage gf_group;      /* multicast address */
-       __u32                            gf_fmode;      /* filter mode */
-       __u32                            gf_numsrc;     /* number of sources */
-       struct __kernel_sockaddr_storage gf_slist[1];   /* interface index */
-};
-
-#define GROUP_FILTER_SIZE(numsrc) \
-       (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
-       + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
-
-struct in_pktinfo {
-       int             ipi_ifindex;
-       struct in_addr  ipi_spec_dst;
-       struct in_addr  ipi_addr;
-};
-
-/* Structure describing an Internet (IP) socket address. */
-#define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
-struct sockaddr_in {
-  __kernel_sa_family_t sin_family;     /* Address family               */
-  __be16               sin_port;       /* Port number                  */
-  struct in_addr       sin_addr;       /* Internet address             */
-
-  /* Pad to size of `struct sockaddr'. */
-  unsigned char                __pad[__SOCK_SIZE__ - sizeof(short int) -
-                       sizeof(unsigned short int) - sizeof(struct in_addr)];
-};
-#define sin_zero       __pad           /* for BSD UNIX comp. -FvK      */
-
-
-/*
- * Definitions of the bits in an Internet address integer.
- * On subnets, host and network parts are found according
- * to the subnet mask, not these masks.
- */
-#define        IN_CLASSA(a)            ((((long int) (a)) & 0x80000000) == 0)
-#define        IN_CLASSA_NET           0xff000000
-#define        IN_CLASSA_NSHIFT        24
-#define        IN_CLASSA_HOST          (0xffffffff & ~IN_CLASSA_NET)
-#define        IN_CLASSA_MAX           128
-
-#define        IN_CLASSB(a)            ((((long int) (a)) & 0xc0000000) == 0x80000000)
-#define        IN_CLASSB_NET           0xffff0000
-#define        IN_CLASSB_NSHIFT        16
-#define        IN_CLASSB_HOST          (0xffffffff & ~IN_CLASSB_NET)
-#define        IN_CLASSB_MAX           65536
-
-#define        IN_CLASSC(a)            ((((long int) (a)) & 0xe0000000) == 0xc0000000)
-#define        IN_CLASSC_NET           0xffffff00
-#define        IN_CLASSC_NSHIFT        8
-#define        IN_CLASSC_HOST          (0xffffffff & ~IN_CLASSC_NET)
-
-#define        IN_CLASSD(a)            ((((long int) (a)) & 0xf0000000) == 0xe0000000)
-#define        IN_MULTICAST(a)         IN_CLASSD(a)
-#define IN_MULTICAST_NET       0xF0000000
-
-#define        IN_EXPERIMENTAL(a)      ((((long int) (a)) & 0xf0000000) == 0xf0000000)
-#define        IN_BADCLASS(a)          IN_EXPERIMENTAL((a))
-
-/* Address to accept any incoming messages. */
-#define        INADDR_ANY              ((unsigned long int) 0x00000000)
-
-/* Address to send to all hosts. */
-#define        INADDR_BROADCAST        ((unsigned long int) 0xffffffff)
-
-/* Address indicating an error return. */
-#define        INADDR_NONE             ((unsigned long int) 0xffffffff)
-
-/* Network number for local host loopback. */
-#define        IN_LOOPBACKNET          127
-
-/* Address to loopback in software to local host.  */
-#define        INADDR_LOOPBACK         0x7f000001      /* 127.0.0.1   */
-#define        IN_LOOPBACK(a)          ((((long int) (a)) & 0xff000000) == 0x7f000000)
-
-/* Defines for Multicast INADDR */
-#define INADDR_UNSPEC_GROUP    0xe0000000U     /* 224.0.0.0   */
-#define INADDR_ALLHOSTS_GROUP  0xe0000001U     /* 224.0.0.1   */
-#define INADDR_ALLRTRS_GROUP    0xe0000002U    /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP  0xe00000ffU    /* 224.0.0.255 */
-
-
-/* <asm/byteorder.h> contains the htonl type stuff.. */
-#include <asm/byteorder.h> 
-
-#ifdef __KERNEL__
 
 #include <linux/errno.h>
+#include <uapi/linux/in.h>
 
 static inline int proto_ports_offset(int proto)
 {
@@ -332,6 +101,4 @@ static inline bool ipv4_is_test_198(__be32 addr)
 {
        return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
 }
-#endif
-
 #endif /* _LINUX_IN_H */
index cba469ba11a42d9e59a200623739aa6409fb3e7e..9e2ae26fb5981703159c27cc60e7c73cf6d311f6 100644 (file)
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-
 #ifndef _LINUX_IN6_H
 #define _LINUX_IN6_H
 
-#include <linux/types.h>
-
-/*
- *     IPv6 address structure
- */
-
-struct in6_addr {
-       union {
-               __u8            u6_addr8[16];
-               __be16          u6_addr16[8];
-               __be32          u6_addr32[4];
-       } in6_u;
-#define s6_addr                        in6_u.u6_addr8
-#define s6_addr16              in6_u.u6_addr16
-#define s6_addr32              in6_u.u6_addr32
-};
+#include <uapi/linux/in6.h>
 
-/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
- * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
- * in network byte order, not in host byte order as are the IPv4 equivalents
- */
-#ifdef __KERNEL__
 extern const struct in6_addr in6addr_any;
 #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
 extern const struct in6_addr in6addr_loopback;
@@ -54,238 +33,3 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
 #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
                { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
 #endif
-
-struct sockaddr_in6 {
-       unsigned short int      sin6_family;    /* AF_INET6 */
-       __be16                  sin6_port;      /* Transport layer port # */
-       __be32                  sin6_flowinfo;  /* IPv6 flow information */
-       struct in6_addr         sin6_addr;      /* IPv6 address */
-       __u32                   sin6_scope_id;  /* scope id (new in RFC2553) */
-};
-
-struct ipv6_mreq {
-       /* IPv6 multicast address of group */
-       struct in6_addr ipv6mr_multiaddr;
-
-       /* local IPv6 address of interface */
-       int             ipv6mr_ifindex;
-};
-
-#define ipv6mr_acaddr  ipv6mr_multiaddr
-
-struct in6_flowlabel_req {
-       struct in6_addr flr_dst;
-       __be32  flr_label;
-       __u8    flr_action;
-       __u8    flr_share;
-       __u16   flr_flags;
-       __u16   flr_expires;
-       __u16   flr_linger;
-       __u32   __flr_pad;
-       /* Options in format of IPV6_PKTOPTIONS */
-};
-
-#define IPV6_FL_A_GET  0
-#define IPV6_FL_A_PUT  1
-#define IPV6_FL_A_RENEW        2
-
-#define IPV6_FL_F_CREATE       1
-#define IPV6_FL_F_EXCL         2
-
-#define IPV6_FL_S_NONE         0
-#define IPV6_FL_S_EXCL         1
-#define IPV6_FL_S_PROCESS      2
-#define IPV6_FL_S_USER         3
-#define IPV6_FL_S_ANY          255
-
-
-/*
- *     Bitmask constant declarations to help applications select out the 
- *     flow label and priority fields.
- *
- *     Note that this are in host byte order while the flowinfo field of
- *     sockaddr_in6 is in network byte order.
- */
-
-#define IPV6_FLOWINFO_FLOWLABEL                0x000fffff
-#define IPV6_FLOWINFO_PRIORITY         0x0ff00000
-
-/* These definitions are obsolete */
-#define IPV6_PRIORITY_UNCHARACTERIZED  0x0000
-#define IPV6_PRIORITY_FILLER           0x0100
-#define IPV6_PRIORITY_UNATTENDED       0x0200
-#define IPV6_PRIORITY_RESERVED1                0x0300
-#define IPV6_PRIORITY_BULK             0x0400
-#define IPV6_PRIORITY_RESERVED2                0x0500
-#define IPV6_PRIORITY_INTERACTIVE      0x0600
-#define IPV6_PRIORITY_CONTROL          0x0700
-#define IPV6_PRIORITY_8                        0x0800
-#define IPV6_PRIORITY_9                        0x0900
-#define IPV6_PRIORITY_10               0x0a00
-#define IPV6_PRIORITY_11               0x0b00
-#define IPV6_PRIORITY_12               0x0c00
-#define IPV6_PRIORITY_13               0x0d00
-#define IPV6_PRIORITY_14               0x0e00
-#define IPV6_PRIORITY_15               0x0f00
-
-/*
- *     IPV6 extension headers
- */
-#define IPPROTO_HOPOPTS                0       /* IPv6 hop-by-hop options      */
-#define IPPROTO_ROUTING                43      /* IPv6 routing header          */
-#define IPPROTO_FRAGMENT       44      /* IPv6 fragmentation header    */
-#define IPPROTO_ICMPV6         58      /* ICMPv6                       */
-#define IPPROTO_NONE           59      /* IPv6 no next header          */
-#define IPPROTO_DSTOPTS                60      /* IPv6 destination options     */
-#define IPPROTO_MH             135     /* IPv6 mobility header         */
-
-/*
- *     IPv6 TLV options.
- */
-#define IPV6_TLV_PAD1          0
-#define IPV6_TLV_PADN          1
-#define IPV6_TLV_ROUTERALERT   5
-#define IPV6_TLV_JUMBO         194
-#define IPV6_TLV_HAO           201     /* home address option */
-
-/*
- *     IPV6 socket options
- */
-
-#define IPV6_ADDRFORM          1
-#define IPV6_2292PKTINFO       2
-#define IPV6_2292HOPOPTS       3
-#define IPV6_2292DSTOPTS       4
-#define IPV6_2292RTHDR         5
-#define IPV6_2292PKTOPTIONS    6
-#define IPV6_CHECKSUM          7
-#define IPV6_2292HOPLIMIT      8
-#define IPV6_NEXTHOP           9
-#define IPV6_AUTHHDR           10      /* obsolete */
-#define IPV6_FLOWINFO          11
-
-#define IPV6_UNICAST_HOPS      16
-#define IPV6_MULTICAST_IF      17
-#define IPV6_MULTICAST_HOPS    18
-#define IPV6_MULTICAST_LOOP    19
-#define IPV6_ADD_MEMBERSHIP    20
-#define IPV6_DROP_MEMBERSHIP   21
-#define IPV6_ROUTER_ALERT      22
-#define IPV6_MTU_DISCOVER      23
-#define IPV6_MTU               24
-#define IPV6_RECVERR           25
-#define IPV6_V6ONLY            26
-#define IPV6_JOIN_ANYCAST      27
-#define IPV6_LEAVE_ANYCAST     28
-
-/* IPV6_MTU_DISCOVER values */
-#define IPV6_PMTUDISC_DONT             0
-#define IPV6_PMTUDISC_WANT             1
-#define IPV6_PMTUDISC_DO               2
-#define IPV6_PMTUDISC_PROBE            3
-
-/* Flowlabel */
-#define IPV6_FLOWLABEL_MGR     32
-#define IPV6_FLOWINFO_SEND     33
-
-#define IPV6_IPSEC_POLICY      34
-#define IPV6_XFRM_POLICY       35
-
-/*
- * Multicast:
- * Following socket options are shared between IPv4 and IPv6.
- *
- * MCAST_JOIN_GROUP            42
- * MCAST_BLOCK_SOURCE          43
- * MCAST_UNBLOCK_SOURCE                44
- * MCAST_LEAVE_GROUP           45
- * MCAST_JOIN_SOURCE_GROUP     46
- * MCAST_LEAVE_SOURCE_GROUP    47
- * MCAST_MSFILTER              48
- */
-
-/*
- * Advanced API (RFC3542) (1)
- *
- * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
- */
-
-#define IPV6_RECVPKTINFO       49
-#define IPV6_PKTINFO           50
-#define IPV6_RECVHOPLIMIT      51
-#define IPV6_HOPLIMIT          52
-#define IPV6_RECVHOPOPTS       53
-#define IPV6_HOPOPTS           54
-#define IPV6_RTHDRDSTOPTS      55
-#define IPV6_RECVRTHDR         56
-#define IPV6_RTHDR             57
-#define IPV6_RECVDSTOPTS       58
-#define IPV6_DSTOPTS           59
-#define IPV6_RECVPATHMTU       60
-#define IPV6_PATHMTU           61
-#define IPV6_DONTFRAG          62
-#if 0  /* not yet */
-#define IPV6_USE_MIN_MTU       63
-#endif
-
-/*
- * Netfilter (1)
- *
- * Following socket options are used in ip6_tables;
- * see include/linux/netfilter_ipv6/ip6_tables.h.
- *
- * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO              64
- * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES      65
- */
-
-/*
- * Advanced API (RFC3542) (2)
- */
-#define IPV6_RECVTCLASS                66
-#define IPV6_TCLASS            67
-
-/*
- * Netfilter (2)
- *
- * Following socket options are used in ip6_tables;
- * see include/linux/netfilter_ipv6/ip6_tables.h.
- *
- * IP6T_SO_GET_REVISION_MATCH  68
- * IP6T_SO_GET_REVISION_TARGET 69
- */
-
-/* RFC5014: Source address selection */
-#define IPV6_ADDR_PREFERENCES  72
-
-#define IPV6_PREFER_SRC_TMP            0x0001
-#define IPV6_PREFER_SRC_PUBLIC         0x0002
-#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
-#define IPV6_PREFER_SRC_COA            0x0004
-#define IPV6_PREFER_SRC_HOME           0x0400
-#define IPV6_PREFER_SRC_CGA            0x0008
-#define IPV6_PREFER_SRC_NONCGA         0x0800
-
-/* RFC5082: Generalized Ttl Security Mechanism */
-#define IPV6_MINHOPCOUNT               73
-
-#define IPV6_ORIGDSTADDR        74
-#define IPV6_RECVORIGDSTADDR    IPV6_ORIGDSTADDR
-#define IPV6_TRANSPARENT        75
-#define IPV6_UNICAST_IF         76
-
-/*
- * Multicast Routing:
- * see include/linux/mroute6.h.
- *
- * MRT6_INIT                   200
- * MRT6_DONE                   201
- * MRT6_ADD_MIF                        202
- * MRT6_DEL_MIF                        203
- * MRT6_ADD_MFC                        204
- * MRT6_DEL_MFC                        205
- * MRT6_VERSION                        206
- * MRT6_ASSERT                 207
- * MRT6_PIM                    208
- * (reserved)                  209
- */
-#endif
index e788c186ed3a85a933b0ce219d4f6b8b8bb84e88..46da02410a09691c5e624df266cfc0c105fce6d9 100644 (file)
@@ -1,138 +1,8 @@
 #ifndef _INET_DIAG_H_
 #define _INET_DIAG_H_ 1
 
-#include <linux/types.h>
+#include <uapi/linux/inet_diag.h>
 
-/* Just some random number */
-#define TCPDIAG_GETSOCK 18
-#define DCCPDIAG_GETSOCK 19
-
-#define INET_DIAG_GETSOCK_MAX 24
-
-/* Socket identity */
-struct inet_diag_sockid {
-       __be16  idiag_sport;
-       __be16  idiag_dport;
-       __be32  idiag_src[4];
-       __be32  idiag_dst[4];
-       __u32   idiag_if;
-       __u32   idiag_cookie[2];
-#define INET_DIAG_NOCOOKIE (~0U)
-};
-
-/* Request structure */
-
-struct inet_diag_req {
-       __u8    idiag_family;           /* Family of addresses. */
-       __u8    idiag_src_len;
-       __u8    idiag_dst_len;
-       __u8    idiag_ext;              /* Query extended information */
-
-       struct inet_diag_sockid id;
-
-       __u32   idiag_states;           /* States to dump */
-       __u32   idiag_dbs;              /* Tables to dump (NI) */
-};
-
-struct inet_diag_req_v2 {
-       __u8    sdiag_family;
-       __u8    sdiag_protocol;
-       __u8    idiag_ext;
-       __u8    pad;
-       __u32   idiag_states;
-       struct inet_diag_sockid id;
-};
-
-enum {
-       INET_DIAG_REQ_NONE,
-       INET_DIAG_REQ_BYTECODE,
-};
-
-#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
-
-/* Bytecode is sequence of 4 byte commands followed by variable arguments.
- * All the commands identified by "code" are conditional jumps forward:
- * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
- * length of the command and its arguments.
- */
-struct inet_diag_bc_op {
-       unsigned char   code;
-       unsigned char   yes;
-       unsigned short  no;
-};
-
-enum {
-       INET_DIAG_BC_NOP,
-       INET_DIAG_BC_JMP,
-       INET_DIAG_BC_S_GE,
-       INET_DIAG_BC_S_LE,
-       INET_DIAG_BC_D_GE,
-       INET_DIAG_BC_D_LE,
-       INET_DIAG_BC_AUTO,
-       INET_DIAG_BC_S_COND,
-       INET_DIAG_BC_D_COND,
-};
-
-struct inet_diag_hostcond {
-       __u8    family;
-       __u8    prefix_len;
-       int     port;
-       __be32  addr[0];
-};
-
-/* Base info structure. It contains socket identity (addrs/ports/cookie)
- * and, alas, the information shown by netstat. */
-struct inet_diag_msg {
-       __u8    idiag_family;
-       __u8    idiag_state;
-       __u8    idiag_timer;
-       __u8    idiag_retrans;
-
-       struct inet_diag_sockid id;
-
-       __u32   idiag_expires;
-       __u32   idiag_rqueue;
-       __u32   idiag_wqueue;
-       __u32   idiag_uid;
-       __u32   idiag_inode;
-};
-
-/* Extensions */
-
-enum {
-       INET_DIAG_NONE,
-       INET_DIAG_MEMINFO,
-       INET_DIAG_INFO,
-       INET_DIAG_VEGASINFO,
-       INET_DIAG_CONG,
-       INET_DIAG_TOS,
-       INET_DIAG_TCLASS,
-       INET_DIAG_SKMEMINFO,
-};
-
-#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
-
-
-/* INET_DIAG_MEM */
-
-struct inet_diag_meminfo {
-       __u32   idiag_rmem;
-       __u32   idiag_wmem;
-       __u32   idiag_fmem;
-       __u32   idiag_tmem;
-};
-
-/* INET_DIAG_VEGASINFO */
-
-struct tcpvegas_info {
-       __u32   tcpv_enabled;
-       __u32   tcpv_rttcnt;
-       __u32   tcpv_rtt;
-       __u32   tcpv_minrtt;
-};
-
-#ifdef __KERNEL__
 struct sock;
 struct inet_hashinfo;
 struct nlattr;
@@ -173,6 +43,4 @@ int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
 
 extern int  inet_diag_register(const struct inet_diag_handler *handler);
 extern void inet_diag_unregister(const struct inet_diag_handler *handler);
-#endif /* __KERNEL__ */
-
 #endif /* _INET_DIAG_H_ */
index d33041e2a42a6ee16bef9df6348eb4ec026cefd3..23aede0b5843b7481e2385be955a71ae45d91c0e 100644 (file)
@@ -3,75 +3,12 @@
  *
  * Copyright (C) 2005 John McCutchan
  */
-
 #ifndef _LINUX_INOTIFY_H
 #define _LINUX_INOTIFY_H
 
-/* For O_CLOEXEC and O_NONBLOCK */
-#include <linux/fcntl.h>
-#include <linux/types.h>
-
-/*
- * struct inotify_event - structure read from the inotify device for each event
- *
- * When you are watching a directory, you will receive the filename for events
- * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
- */
-struct inotify_event {
-       __s32           wd;             /* watch descriptor */
-       __u32           mask;           /* watch mask */
-       __u32           cookie;         /* cookie to synchronize two events */
-       __u32           len;            /* length (including nulls) of name */
-       char            name[0];        /* stub for possible name */
-};
-
-/* the following are legal, implemented events that user-space can watch for */
-#define IN_ACCESS              0x00000001      /* File was accessed */
-#define IN_MODIFY              0x00000002      /* File was modified */
-#define IN_ATTRIB              0x00000004      /* Metadata changed */
-#define IN_CLOSE_WRITE         0x00000008      /* Writtable file was closed */
-#define IN_CLOSE_NOWRITE       0x00000010      /* Unwrittable file closed */
-#define IN_OPEN                        0x00000020      /* File was opened */
-#define IN_MOVED_FROM          0x00000040      /* File was moved from X */
-#define IN_MOVED_TO            0x00000080      /* File was moved to Y */
-#define IN_CREATE              0x00000100      /* Subfile was created */
-#define IN_DELETE              0x00000200      /* Subfile was deleted */
-#define IN_DELETE_SELF         0x00000400      /* Self was deleted */
-#define IN_MOVE_SELF           0x00000800      /* Self was moved */
-
-/* the following are legal events.  they are sent as needed to any watch */
-#define IN_UNMOUNT             0x00002000      /* Backing fs was unmounted */
-#define IN_Q_OVERFLOW          0x00004000      /* Event queued overflowed */
-#define IN_IGNORED             0x00008000      /* File was ignored */
-
-/* helper events */
-#define IN_CLOSE               (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
-#define IN_MOVE                        (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
-
-/* special flags */
-#define IN_ONLYDIR             0x01000000      /* only watch the path if it is a directory */
-#define IN_DONT_FOLLOW         0x02000000      /* don't follow a sym link */
-#define IN_EXCL_UNLINK         0x04000000      /* exclude events on unlinked objects */
-#define IN_MASK_ADD            0x20000000      /* add to the mask of an already existing watch */
-#define IN_ISDIR               0x40000000      /* event occurred against dir */
-#define IN_ONESHOT             0x80000000      /* only send event once */
-
-/*
- * All of the events - we build the list by hand so that we can add flags in
- * the future and not break backward compatibility.  Apps will get only the
- * events that they originally wanted.  Be sure to add new events here!
- */
-#define IN_ALL_EVENTS  (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
-                        IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
-                        IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
-                        IN_MOVE_SELF)
-
-/* Flags for sys_inotify_init1.  */
-#define IN_CLOEXEC O_CLOEXEC
-#define IN_NONBLOCK O_NONBLOCK
-
-#ifdef __KERNEL__
 #include <linux/sysctl.h>
+#include <uapi/linux/inotify.h>
+
 extern struct ctl_table inotify_table[]; /* for sysctl */
 
 #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
@@ -82,6 +19,4 @@ extern struct ctl_table inotify_table[]; /* for sysctl */
                          IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \
                          IN_ISDIR | IN_ONESHOT)
 
-#endif
-
 #endif /* _LINUX_INOTIFY_H */
index 15464ba6bf53e9d19abcdcb8b9c5d28683c57957..cab994ba6d919f14563f71774a07c405eafa915b 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef _INPUT_H
-#define _INPUT_H
-
 /*
  * Copyright (c) 1999-2002 Vojtech Pavlik
  *
  * under the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation.
  */
+#ifndef _INPUT_H
+#define _INPUT_H
 
-#ifdef __KERNEL__
 #include <linux/time.h>
 #include <linux/list.h>
-#else
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <linux/types.h>
-#endif
-
-/*
- * The event structure itself
- */
-
-struct input_event {
-       struct timeval time;
-       __u16 type;
-       __u16 code;
-       __s32 value;
-};
-
-/*
- * Protocol version.
- */
-
-#define EV_VERSION             0x010001
-
-/*
- * IOCTLs (0x00 - 0x7f)
- */
-
-struct input_id {
-       __u16 bustype;
-       __u16 vendor;
-       __u16 product;
-       __u16 version;
-};
-
-/**
- * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls
- * @value: latest reported value for the axis.
- * @minimum: specifies minimum value for the axis.
- * @maximum: specifies maximum value for the axis.
- * @fuzz: specifies fuzz value that is used to filter noise from
- *     the event stream.
- * @flat: values that are within this value will be discarded by
- *     joydev interface and reported as 0 instead.
- * @resolution: specifies resolution for the values reported for
- *     the axis.
- *
- * Note that input core does not clamp reported values to the
- * [minimum, maximum] limits, such task is left to userspace.
- *
- * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in
- * units per millimeter (units/mm), resolution for rotational axes
- * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
- */
-struct input_absinfo {
-       __s32 value;
-       __s32 minimum;
-       __s32 maximum;
-       __s32 fuzz;
-       __s32 flat;
-       __s32 resolution;
-};
-
-/**
- * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
- * @scancode: scancode represented in machine-endian form.
- * @len: length of the scancode that resides in @scancode buffer.
- * @index: index in the keymap, may be used instead of scancode
- * @flags: allows to specify how kernel should handle the request. For
- *     example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
- *     should perform lookup in keymap by @index instead of @scancode
- * @keycode: key code assigned to this scancode
- *
- * The structure is used to retrieve and modify keymap data. Users have
- * option of performing lookup either by @scancode itself or by @index
- * in keymap entry. EVIOCGKEYCODE will also return scancode or index
- * (depending on which element was used to perform lookup).
- */
-struct input_keymap_entry {
-#define INPUT_KEYMAP_BY_INDEX  (1 << 0)
-       __u8  flags;
-       __u8  len;
-       __u16 index;
-       __u32 keycode;
-       __u8  scancode[32];
-};
-
-#define EVIOCGVERSION          _IOR('E', 0x01, int)                    /* get driver version */
-#define EVIOCGID               _IOR('E', 0x02, struct input_id)        /* get device ID */
-#define EVIOCGREP              _IOR('E', 0x03, unsigned int[2])        /* get repeat settings */
-#define EVIOCSREP              _IOW('E', 0x03, unsigned int[2])        /* set repeat settings */
-
-#define EVIOCGKEYCODE          _IOR('E', 0x04, unsigned int[2])        /* get keycode */
-#define EVIOCGKEYCODE_V2       _IOR('E', 0x04, struct input_keymap_entry)
-#define EVIOCSKEYCODE          _IOW('E', 0x04, unsigned int[2])        /* set keycode */
-#define EVIOCSKEYCODE_V2       _IOW('E', 0x04, struct input_keymap_entry)
-
-#define EVIOCGNAME(len)                _IOC(_IOC_READ, 'E', 0x06, len)         /* get device name */
-#define EVIOCGPHYS(len)                _IOC(_IOC_READ, 'E', 0x07, len)         /* get physical location */
-#define EVIOCGUNIQ(len)                _IOC(_IOC_READ, 'E', 0x08, len)         /* get unique identifier */
-#define EVIOCGPROP(len)                _IOC(_IOC_READ, 'E', 0x09, len)         /* get device properties */
-
-/**
- * EVIOCGMTSLOTS(len) - get MT slot values
- * @len: size of the data buffer in bytes
- *
- * The ioctl buffer argument should be binary equivalent to
- *
- * struct input_mt_request_layout {
- *     __u32 code;
- *     __s32 values[num_slots];
- * };
- *
- * where num_slots is the (arbitrary) number of MT slots to extract.
- *
- * The ioctl size argument (len) is the size of the buffer, which
- * should satisfy len = (num_slots + 1) * sizeof(__s32).  If len is
- * too small to fit all available slots, the first num_slots are
- * returned.
- *
- * Before the call, code is set to the wanted ABS_MT event type. On
- * return, values[] is filled with the slot values for the specified
- * ABS_MT code.
- *
- * If the request code is not an ABS_MT value, -EINVAL is returned.
- */
-#define EVIOCGMTSLOTS(len)     _IOC(_IOC_READ, 'E', 0x0a, len)
-
-#define EVIOCGKEY(len)         _IOC(_IOC_READ, 'E', 0x18, len)         /* get global key state */
-#define EVIOCGLED(len)         _IOC(_IOC_READ, 'E', 0x19, len)         /* get all LEDs */
-#define EVIOCGSND(len)         _IOC(_IOC_READ, 'E', 0x1a, len)         /* get all sounds status */
-#define EVIOCGSW(len)          _IOC(_IOC_READ, 'E', 0x1b, len)         /* get all switch states */
-
-#define EVIOCGBIT(ev,len)      _IOC(_IOC_READ, 'E', 0x20 + (ev), len)  /* get event bits */
-#define EVIOCGABS(abs)         _IOR('E', 0x40 + (abs), struct input_absinfo)   /* get abs value/limits */
-#define EVIOCSABS(abs)         _IOW('E', 0xc0 + (abs), struct input_absinfo)   /* set abs value/limits */
-
-#define EVIOCSFF               _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))   /* send a force effect to a force feedback device */
-#define EVIOCRMFF              _IOW('E', 0x81, int)                    /* Erase a force effect */
-#define EVIOCGEFFECTS          _IOR('E', 0x84, int)                    /* Report number of effects playable at the same time */
-
-#define EVIOCGRAB              _IOW('E', 0x90, int)                    /* Grab/Release device */
-
-#define EVIOCSCLOCKID          _IOW('E', 0xa0, int)                    /* Set clockid to be used for timestamps */
-
-/*
- * Device properties and quirks
- */
-
-#define INPUT_PROP_POINTER             0x00    /* needs a pointer */
-#define INPUT_PROP_DIRECT              0x01    /* direct input devices */
-#define INPUT_PROP_BUTTONPAD           0x02    /* has button(s) under pad */
-#define INPUT_PROP_SEMI_MT             0x03    /* touch rectangle only */
-
-#define INPUT_PROP_MAX                 0x1f
-#define INPUT_PROP_CNT                 (INPUT_PROP_MAX + 1)
-
-/*
- * Event types
- */
-
-#define EV_SYN                 0x00
-#define EV_KEY                 0x01
-#define EV_REL                 0x02
-#define EV_ABS                 0x03
-#define EV_MSC                 0x04
-#define EV_SW                  0x05
-#define EV_LED                 0x11
-#define EV_SND                 0x12
-#define EV_REP                 0x14
-#define EV_FF                  0x15
-#define EV_PWR                 0x16
-#define EV_FF_STATUS           0x17
-#define EV_MAX                 0x1f
-#define EV_CNT                 (EV_MAX+1)
-
-/*
- * Synchronization events.
- */
-
-#define SYN_REPORT             0
-#define SYN_CONFIG             1
-#define SYN_MT_REPORT          2
-#define SYN_DROPPED            3
-
-/*
- * Keys and buttons
- *
- * Most of the keys/buttons are modeled after USB HUT 1.12
- * (see http://www.usb.org/developers/hidpage).
- * Abbreviations in the comments:
- * AC - Application Control
- * AL - Application Launch Button
- * SC - System Control
- */
-
-#define KEY_RESERVED           0
-#define KEY_ESC                        1
-#define KEY_1                  2
-#define KEY_2                  3
-#define KEY_3                  4
-#define KEY_4                  5
-#define KEY_5                  6
-#define KEY_6                  7
-#define KEY_7                  8
-#define KEY_8                  9
-#define KEY_9                  10
-#define KEY_0                  11
-#define KEY_MINUS              12
-#define KEY_EQUAL              13
-#define KEY_BACKSPACE          14
-#define KEY_TAB                        15
-#define KEY_Q                  16
-#define KEY_W                  17
-#define KEY_E                  18
-#define KEY_R                  19
-#define KEY_T                  20
-#define KEY_Y                  21
-#define KEY_U                  22
-#define KEY_I                  23
-#define KEY_O                  24
-#define KEY_P                  25
-#define KEY_LEFTBRACE          26
-#define KEY_RIGHTBRACE         27
-#define KEY_ENTER              28
-#define KEY_LEFTCTRL           29
-#define KEY_A                  30
-#define KEY_S                  31
-#define KEY_D                  32
-#define KEY_F                  33
-#define KEY_G                  34
-#define KEY_H                  35
-#define KEY_J                  36
-#define KEY_K                  37
-#define KEY_L                  38
-#define KEY_SEMICOLON          39
-#define KEY_APOSTROPHE         40
-#define KEY_GRAVE              41
-#define KEY_LEFTSHIFT          42
-#define KEY_BACKSLASH          43
-#define KEY_Z                  44
-#define KEY_X                  45
-#define KEY_C                  46
-#define KEY_V                  47
-#define KEY_B                  48
-#define KEY_N                  49
-#define KEY_M                  50
-#define KEY_COMMA              51
-#define KEY_DOT                        52
-#define KEY_SLASH              53
-#define KEY_RIGHTSHIFT         54
-#define KEY_KPASTERISK         55
-#define KEY_LEFTALT            56
-#define KEY_SPACE              57
-#define KEY_CAPSLOCK           58
-#define KEY_F1                 59
-#define KEY_F2                 60
-#define KEY_F3                 61
-#define KEY_F4                 62
-#define KEY_F5                 63
-#define KEY_F6                 64
-#define KEY_F7                 65
-#define KEY_F8                 66
-#define KEY_F9                 67
-#define KEY_F10                        68
-#define KEY_NUMLOCK            69
-#define KEY_SCROLLLOCK         70
-#define KEY_KP7                        71
-#define KEY_KP8                        72
-#define KEY_KP9                        73
-#define KEY_KPMINUS            74
-#define KEY_KP4                        75
-#define KEY_KP5                        76
-#define KEY_KP6                        77
-#define KEY_KPPLUS             78
-#define KEY_KP1                        79
-#define KEY_KP2                        80
-#define KEY_KP3                        81
-#define KEY_KP0                        82
-#define KEY_KPDOT              83
-
-#define KEY_ZENKAKUHANKAKU     85
-#define KEY_102ND              86
-#define KEY_F11                        87
-#define KEY_F12                        88
-#define KEY_RO                 89
-#define KEY_KATAKANA           90
-#define KEY_HIRAGANA           91
-#define KEY_HENKAN             92
-#define KEY_KATAKANAHIRAGANA   93
-#define KEY_MUHENKAN           94
-#define KEY_KPJPCOMMA          95
-#define KEY_KPENTER            96
-#define KEY_RIGHTCTRL          97
-#define KEY_KPSLASH            98
-#define KEY_SYSRQ              99
-#define KEY_RIGHTALT           100
-#define KEY_LINEFEED           101
-#define KEY_HOME               102
-#define KEY_UP                 103
-#define KEY_PAGEUP             104
-#define KEY_LEFT               105
-#define KEY_RIGHT              106
-#define KEY_END                        107
-#define KEY_DOWN               108
-#define KEY_PAGEDOWN           109
-#define KEY_INSERT             110
-#define KEY_DELETE             111
-#define KEY_MACRO              112
-#define KEY_MUTE               113
-#define KEY_VOLUMEDOWN         114
-#define KEY_VOLUMEUP           115
-#define KEY_POWER              116     /* SC System Power Down */
-#define KEY_KPEQUAL            117
-#define KEY_KPPLUSMINUS                118
-#define KEY_PAUSE              119
-#define KEY_SCALE              120     /* AL Compiz Scale (Expose) */
-
-#define KEY_KPCOMMA            121
-#define KEY_HANGEUL            122
-#define KEY_HANGUEL            KEY_HANGEUL
-#define KEY_HANJA              123
-#define KEY_YEN                        124
-#define KEY_LEFTMETA           125
-#define KEY_RIGHTMETA          126
-#define KEY_COMPOSE            127
-
-#define KEY_STOP               128     /* AC Stop */
-#define KEY_AGAIN              129
-#define KEY_PROPS              130     /* AC Properties */
-#define KEY_UNDO               131     /* AC Undo */
-#define KEY_FRONT              132
-#define KEY_COPY               133     /* AC Copy */
-#define KEY_OPEN               134     /* AC Open */
-#define KEY_PASTE              135     /* AC Paste */
-#define KEY_FIND               136     /* AC Search */
-#define KEY_CUT                        137     /* AC Cut */
-#define KEY_HELP               138     /* AL Integrated Help Center */
-#define KEY_MENU               139     /* Menu (show menu) */
-#define KEY_CALC               140     /* AL Calculator */
-#define KEY_SETUP              141
-#define KEY_SLEEP              142     /* SC System Sleep */
-#define KEY_WAKEUP             143     /* System Wake Up */
-#define KEY_FILE               144     /* AL Local Machine Browser */
-#define KEY_SENDFILE           145
-#define KEY_DELETEFILE         146
-#define KEY_XFER               147
-#define KEY_PROG1              148
-#define KEY_PROG2              149
-#define KEY_WWW                        150     /* AL Internet Browser */
-#define KEY_MSDOS              151
-#define KEY_COFFEE             152     /* AL Terminal Lock/Screensaver */
-#define KEY_SCREENLOCK         KEY_COFFEE
-#define KEY_DIRECTION          153
-#define KEY_CYCLEWINDOWS       154
-#define KEY_MAIL               155
-#define KEY_BOOKMARKS          156     /* AC Bookmarks */
-#define KEY_COMPUTER           157
-#define KEY_BACK               158     /* AC Back */
-#define KEY_FORWARD            159     /* AC Forward */
-#define KEY_CLOSECD            160
-#define KEY_EJECTCD            161
-#define KEY_EJECTCLOSECD       162
-#define KEY_NEXTSONG           163
-#define KEY_PLAYPAUSE          164
-#define KEY_PREVIOUSSONG       165
-#define KEY_STOPCD             166
-#define KEY_RECORD             167
-#define KEY_REWIND             168
-#define KEY_PHONE              169     /* Media Select Telephone */
-#define KEY_ISO                        170
-#define KEY_CONFIG             171     /* AL Consumer Control Configuration */
-#define KEY_HOMEPAGE           172     /* AC Home */
-#define KEY_REFRESH            173     /* AC Refresh */
-#define KEY_EXIT               174     /* AC Exit */
-#define KEY_MOVE               175
-#define KEY_EDIT               176
-#define KEY_SCROLLUP           177
-#define KEY_SCROLLDOWN         178
-#define KEY_KPLEFTPAREN                179
-#define KEY_KPRIGHTPAREN       180
-#define KEY_NEW                        181     /* AC New */
-#define KEY_REDO               182     /* AC Redo/Repeat */
-
-#define KEY_F13                        183
-#define KEY_F14                        184
-#define KEY_F15                        185
-#define KEY_F16                        186
-#define KEY_F17                        187
-#define KEY_F18                        188
-#define KEY_F19                        189
-#define KEY_F20                        190
-#define KEY_F21                        191
-#define KEY_F22                        192
-#define KEY_F23                        193
-#define KEY_F24                        194
-
-#define KEY_PLAYCD             200
-#define KEY_PAUSECD            201
-#define KEY_PROG3              202
-#define KEY_PROG4              203
-#define KEY_DASHBOARD          204     /* AL Dashboard */
-#define KEY_SUSPEND            205
-#define KEY_CLOSE              206     /* AC Close */
-#define KEY_PLAY               207
-#define KEY_FASTFORWARD                208
-#define KEY_BASSBOOST          209
-#define KEY_PRINT              210     /* AC Print */
-#define KEY_HP                 211
-#define KEY_CAMERA             212
-#define KEY_SOUND              213
-#define KEY_QUESTION           214
-#define KEY_EMAIL              215
-#define KEY_CHAT               216
-#define KEY_SEARCH             217
-#define KEY_CONNECT            218
-#define KEY_FINANCE            219     /* AL Checkbook/Finance */
-#define KEY_SPORT              220
-#define KEY_SHOP               221
-#define KEY_ALTERASE           222
-#define KEY_CANCEL             223     /* AC Cancel */
-#define KEY_BRIGHTNESSDOWN     224
-#define KEY_BRIGHTNESSUP       225
-#define KEY_MEDIA              226
-
-#define KEY_SWITCHVIDEOMODE    227     /* Cycle between available video
-                                          outputs (Monitor/LCD/TV-out/etc) */
-#define KEY_KBDILLUMTOGGLE     228
-#define KEY_KBDILLUMDOWN       229
-#define KEY_KBDILLUMUP         230
-
-#define KEY_SEND               231     /* AC Send */
-#define KEY_REPLY              232     /* AC Reply */
-#define KEY_FORWARDMAIL                233     /* AC Forward Msg */
-#define KEY_SAVE               234     /* AC Save */
-#define KEY_DOCUMENTS          235
-
-#define KEY_BATTERY            236
-
-#define KEY_BLUETOOTH          237
-#define KEY_WLAN               238
-#define KEY_UWB                        239
-
-#define KEY_UNKNOWN            240
-
-#define KEY_VIDEO_NEXT         241     /* drive next video source */
-#define KEY_VIDEO_PREV         242     /* drive previous video source */
-#define KEY_BRIGHTNESS_CYCLE   243     /* brightness up, after max is min */
-#define KEY_BRIGHTNESS_ZERO    244     /* brightness off, use ambient */
-#define KEY_DISPLAY_OFF                245     /* display device to off state */
-
-#define KEY_WIMAX              246
-#define KEY_RFKILL             247     /* Key that controls all radios */
-
-#define KEY_MICMUTE            248     /* Mute / unmute the microphone */
-
-/* Code 255 is reserved for special needs of AT keyboard driver */
-
-#define BTN_MISC               0x100
-#define BTN_0                  0x100
-#define BTN_1                  0x101
-#define BTN_2                  0x102
-#define BTN_3                  0x103
-#define BTN_4                  0x104
-#define BTN_5                  0x105
-#define BTN_6                  0x106
-#define BTN_7                  0x107
-#define BTN_8                  0x108
-#define BTN_9                  0x109
-
-#define BTN_MOUSE              0x110
-#define BTN_LEFT               0x110
-#define BTN_RIGHT              0x111
-#define BTN_MIDDLE             0x112
-#define BTN_SIDE               0x113
-#define BTN_EXTRA              0x114
-#define BTN_FORWARD            0x115
-#define BTN_BACK               0x116
-#define BTN_TASK               0x117
-
-#define BTN_JOYSTICK           0x120
-#define BTN_TRIGGER            0x120
-#define BTN_THUMB              0x121
-#define BTN_THUMB2             0x122
-#define BTN_TOP                        0x123
-#define BTN_TOP2               0x124
-#define BTN_PINKIE             0x125
-#define BTN_BASE               0x126
-#define BTN_BASE2              0x127
-#define BTN_BASE3              0x128
-#define BTN_BASE4              0x129
-#define BTN_BASE5              0x12a
-#define BTN_BASE6              0x12b
-#define BTN_DEAD               0x12f
-
-#define BTN_GAMEPAD            0x130
-#define BTN_A                  0x130
-#define BTN_B                  0x131
-#define BTN_C                  0x132
-#define BTN_X                  0x133
-#define BTN_Y                  0x134
-#define BTN_Z                  0x135
-#define BTN_TL                 0x136
-#define BTN_TR                 0x137
-#define BTN_TL2                        0x138
-#define BTN_TR2                        0x139
-#define BTN_SELECT             0x13a
-#define BTN_START              0x13b
-#define BTN_MODE               0x13c
-#define BTN_THUMBL             0x13d
-#define BTN_THUMBR             0x13e
-
-#define BTN_DIGI               0x140
-#define BTN_TOOL_PEN           0x140
-#define BTN_TOOL_RUBBER                0x141
-#define BTN_TOOL_BRUSH         0x142
-#define BTN_TOOL_PENCIL                0x143
-#define BTN_TOOL_AIRBRUSH      0x144
-#define BTN_TOOL_FINGER                0x145
-#define BTN_TOOL_MOUSE         0x146
-#define BTN_TOOL_LENS          0x147
-#define BTN_TOOL_QUINTTAP      0x148   /* Five fingers on trackpad */
-#define BTN_TOUCH              0x14a
-#define BTN_STYLUS             0x14b
-#define BTN_STYLUS2            0x14c
-#define BTN_TOOL_DOUBLETAP     0x14d
-#define BTN_TOOL_TRIPLETAP     0x14e
-#define BTN_TOOL_QUADTAP       0x14f   /* Four fingers on trackpad */
-
-#define BTN_WHEEL              0x150
-#define BTN_GEAR_DOWN          0x150
-#define BTN_GEAR_UP            0x151
-
-#define KEY_OK                 0x160
-#define KEY_SELECT             0x161
-#define KEY_GOTO               0x162
-#define KEY_CLEAR              0x163
-#define KEY_POWER2             0x164
-#define KEY_OPTION             0x165
-#define KEY_INFO               0x166   /* AL OEM Features/Tips/Tutorial */
-#define KEY_TIME               0x167
-#define KEY_VENDOR             0x168
-#define KEY_ARCHIVE            0x169
-#define KEY_PROGRAM            0x16a   /* Media Select Program Guide */
-#define KEY_CHANNEL            0x16b
-#define KEY_FAVORITES          0x16c
-#define KEY_EPG                        0x16d
-#define KEY_PVR                        0x16e   /* Media Select Home */
-#define KEY_MHP                        0x16f
-#define KEY_LANGUAGE           0x170
-#define KEY_TITLE              0x171
-#define KEY_SUBTITLE           0x172
-#define KEY_ANGLE              0x173
-#define KEY_ZOOM               0x174
-#define KEY_MODE               0x175
-#define KEY_KEYBOARD           0x176
-#define KEY_SCREEN             0x177
-#define KEY_PC                 0x178   /* Media Select Computer */
-#define KEY_TV                 0x179   /* Media Select TV */
-#define KEY_TV2                        0x17a   /* Media Select Cable */
-#define KEY_VCR                        0x17b   /* Media Select VCR */
-#define KEY_VCR2               0x17c   /* VCR Plus */
-#define KEY_SAT                        0x17d   /* Media Select Satellite */
-#define KEY_SAT2               0x17e
-#define KEY_CD                 0x17f   /* Media Select CD */
-#define KEY_TAPE               0x180   /* Media Select Tape */
-#define KEY_RADIO              0x181
-#define KEY_TUNER              0x182   /* Media Select Tuner */
-#define KEY_PLAYER             0x183
-#define KEY_TEXT               0x184
-#define KEY_DVD                        0x185   /* Media Select DVD */
-#define KEY_AUX                        0x186
-#define KEY_MP3                        0x187
-#define KEY_AUDIO              0x188   /* AL Audio Browser */
-#define KEY_VIDEO              0x189   /* AL Movie Browser */
-#define KEY_DIRECTORY          0x18a
-#define KEY_LIST               0x18b
-#define KEY_MEMO               0x18c   /* Media Select Messages */
-#define KEY_CALENDAR           0x18d
-#define KEY_RED                        0x18e
-#define KEY_GREEN              0x18f
-#define KEY_YELLOW             0x190
-#define KEY_BLUE               0x191
-#define KEY_CHANNELUP          0x192   /* Channel Increment */
-#define KEY_CHANNELDOWN                0x193   /* Channel Decrement */
-#define KEY_FIRST              0x194
-#define KEY_LAST               0x195   /* Recall Last */
-#define KEY_AB                 0x196
-#define KEY_NEXT               0x197
-#define KEY_RESTART            0x198
-#define KEY_SLOW               0x199
-#define KEY_SHUFFLE            0x19a
-#define KEY_BREAK              0x19b
-#define KEY_PREVIOUS           0x19c
-#define KEY_DIGITS             0x19d
-#define KEY_TEEN               0x19e
-#define KEY_TWEN               0x19f
-#define KEY_VIDEOPHONE         0x1a0   /* Media Select Video Phone */
-#define KEY_GAMES              0x1a1   /* Media Select Games */
-#define KEY_ZOOMIN             0x1a2   /* AC Zoom In */
-#define KEY_ZOOMOUT            0x1a3   /* AC Zoom Out */
-#define KEY_ZOOMRESET          0x1a4   /* AC Zoom */
-#define KEY_WORDPROCESSOR      0x1a5   /* AL Word Processor */
-#define KEY_EDITOR             0x1a6   /* AL Text Editor */
-#define KEY_SPREADSHEET                0x1a7   /* AL Spreadsheet */
-#define KEY_GRAPHICSEDITOR     0x1a8   /* AL Graphics Editor */
-#define KEY_PRESENTATION       0x1a9   /* AL Presentation App */
-#define KEY_DATABASE           0x1aa   /* AL Database App */
-#define KEY_NEWS               0x1ab   /* AL Newsreader */
-#define KEY_VOICEMAIL          0x1ac   /* AL Voicemail */
-#define KEY_ADDRESSBOOK                0x1ad   /* AL Contacts/Address Book */
-#define KEY_MESSENGER          0x1ae   /* AL Instant Messaging */
-#define KEY_DISPLAYTOGGLE      0x1af   /* Turn display (LCD) on and off */
-#define KEY_SPELLCHECK         0x1b0   /* AL Spell Check */
-#define KEY_LOGOFF             0x1b1   /* AL Logoff */
-
-#define KEY_DOLLAR             0x1b2
-#define KEY_EURO               0x1b3
-
-#define KEY_FRAMEBACK          0x1b4   /* Consumer - transport controls */
-#define KEY_FRAMEFORWARD       0x1b5
-#define KEY_CONTEXT_MENU       0x1b6   /* GenDesc - system context menu */
-#define KEY_MEDIA_REPEAT       0x1b7   /* Consumer - transport control */
-#define KEY_10CHANNELSUP       0x1b8   /* 10 channels up (10+) */
-#define KEY_10CHANNELSDOWN     0x1b9   /* 10 channels down (10-) */
-#define KEY_IMAGES             0x1ba   /* AL Image Browser */
-
-#define KEY_DEL_EOL            0x1c0
-#define KEY_DEL_EOS            0x1c1
-#define KEY_INS_LINE           0x1c2
-#define KEY_DEL_LINE           0x1c3
-
-#define KEY_FN                 0x1d0
-#define KEY_FN_ESC             0x1d1
-#define KEY_FN_F1              0x1d2
-#define KEY_FN_F2              0x1d3
-#define KEY_FN_F3              0x1d4
-#define KEY_FN_F4              0x1d5
-#define KEY_FN_F5              0x1d6
-#define KEY_FN_F6              0x1d7
-#define KEY_FN_F7              0x1d8
-#define KEY_FN_F8              0x1d9
-#define KEY_FN_F9              0x1da
-#define KEY_FN_F10             0x1db
-#define KEY_FN_F11             0x1dc
-#define KEY_FN_F12             0x1dd
-#define KEY_FN_1               0x1de
-#define KEY_FN_2               0x1df
-#define KEY_FN_D               0x1e0
-#define KEY_FN_E               0x1e1
-#define KEY_FN_F               0x1e2
-#define KEY_FN_S               0x1e3
-#define KEY_FN_B               0x1e4
-
-#define KEY_BRL_DOT1           0x1f1
-#define KEY_BRL_DOT2           0x1f2
-#define KEY_BRL_DOT3           0x1f3
-#define KEY_BRL_DOT4           0x1f4
-#define KEY_BRL_DOT5           0x1f5
-#define KEY_BRL_DOT6           0x1f6
-#define KEY_BRL_DOT7           0x1f7
-#define KEY_BRL_DOT8           0x1f8
-#define KEY_BRL_DOT9           0x1f9
-#define KEY_BRL_DOT10          0x1fa
-
-#define KEY_NUMERIC_0          0x200   /* used by phones, remote controls, */
-#define KEY_NUMERIC_1          0x201   /* and other keypads */
-#define KEY_NUMERIC_2          0x202
-#define KEY_NUMERIC_3          0x203
-#define KEY_NUMERIC_4          0x204
-#define KEY_NUMERIC_5          0x205
-#define KEY_NUMERIC_6          0x206
-#define KEY_NUMERIC_7          0x207
-#define KEY_NUMERIC_8          0x208
-#define KEY_NUMERIC_9          0x209
-#define KEY_NUMERIC_STAR       0x20a
-#define KEY_NUMERIC_POUND      0x20b
-
-#define KEY_CAMERA_FOCUS       0x210
-#define KEY_WPS_BUTTON         0x211   /* WiFi Protected Setup key */
-
-#define KEY_TOUCHPAD_TOGGLE    0x212   /* Request switch touchpad on or off */
-#define KEY_TOUCHPAD_ON                0x213
-#define KEY_TOUCHPAD_OFF       0x214
-
-#define KEY_CAMERA_ZOOMIN      0x215
-#define KEY_CAMERA_ZOOMOUT     0x216
-#define KEY_CAMERA_UP          0x217
-#define KEY_CAMERA_DOWN                0x218
-#define KEY_CAMERA_LEFT                0x219
-#define KEY_CAMERA_RIGHT       0x21a
-
-#define BTN_TRIGGER_HAPPY              0x2c0
-#define BTN_TRIGGER_HAPPY1             0x2c0
-#define BTN_TRIGGER_HAPPY2             0x2c1
-#define BTN_TRIGGER_HAPPY3             0x2c2
-#define BTN_TRIGGER_HAPPY4             0x2c3
-#define BTN_TRIGGER_HAPPY5             0x2c4
-#define BTN_TRIGGER_HAPPY6             0x2c5
-#define BTN_TRIGGER_HAPPY7             0x2c6
-#define BTN_TRIGGER_HAPPY8             0x2c7
-#define BTN_TRIGGER_HAPPY9             0x2c8
-#define BTN_TRIGGER_HAPPY10            0x2c9
-#define BTN_TRIGGER_HAPPY11            0x2ca
-#define BTN_TRIGGER_HAPPY12            0x2cb
-#define BTN_TRIGGER_HAPPY13            0x2cc
-#define BTN_TRIGGER_HAPPY14            0x2cd
-#define BTN_TRIGGER_HAPPY15            0x2ce
-#define BTN_TRIGGER_HAPPY16            0x2cf
-#define BTN_TRIGGER_HAPPY17            0x2d0
-#define BTN_TRIGGER_HAPPY18            0x2d1
-#define BTN_TRIGGER_HAPPY19            0x2d2
-#define BTN_TRIGGER_HAPPY20            0x2d3
-#define BTN_TRIGGER_HAPPY21            0x2d4
-#define BTN_TRIGGER_HAPPY22            0x2d5
-#define BTN_TRIGGER_HAPPY23            0x2d6
-#define BTN_TRIGGER_HAPPY24            0x2d7
-#define BTN_TRIGGER_HAPPY25            0x2d8
-#define BTN_TRIGGER_HAPPY26            0x2d9
-#define BTN_TRIGGER_HAPPY27            0x2da
-#define BTN_TRIGGER_HAPPY28            0x2db
-#define BTN_TRIGGER_HAPPY29            0x2dc
-#define BTN_TRIGGER_HAPPY30            0x2dd
-#define BTN_TRIGGER_HAPPY31            0x2de
-#define BTN_TRIGGER_HAPPY32            0x2df
-#define BTN_TRIGGER_HAPPY33            0x2e0
-#define BTN_TRIGGER_HAPPY34            0x2e1
-#define BTN_TRIGGER_HAPPY35            0x2e2
-#define BTN_TRIGGER_HAPPY36            0x2e3
-#define BTN_TRIGGER_HAPPY37            0x2e4
-#define BTN_TRIGGER_HAPPY38            0x2e5
-#define BTN_TRIGGER_HAPPY39            0x2e6
-#define BTN_TRIGGER_HAPPY40            0x2e7
-
-/* We avoid low common keys in module aliases so they don't get huge. */
-#define KEY_MIN_INTERESTING    KEY_MUTE
-#define KEY_MAX                        0x2ff
-#define KEY_CNT                        (KEY_MAX+1)
-
-/*
- * Relative axes
- */
-
-#define REL_X                  0x00
-#define REL_Y                  0x01
-#define REL_Z                  0x02
-#define REL_RX                 0x03
-#define REL_RY                 0x04
-#define REL_RZ                 0x05
-#define REL_HWHEEL             0x06
-#define REL_DIAL               0x07
-#define REL_WHEEL              0x08
-#define REL_MISC               0x09
-#define REL_MAX                        0x0f
-#define REL_CNT                        (REL_MAX+1)
-
-/*
- * Absolute axes
- */
-
-#define ABS_X                  0x00
-#define ABS_Y                  0x01
-#define ABS_Z                  0x02
-#define ABS_RX                 0x03
-#define ABS_RY                 0x04
-#define ABS_RZ                 0x05
-#define ABS_THROTTLE           0x06
-#define ABS_RUDDER             0x07
-#define ABS_WHEEL              0x08
-#define ABS_GAS                        0x09
-#define ABS_BRAKE              0x0a
-#define ABS_HAT0X              0x10
-#define ABS_HAT0Y              0x11
-#define ABS_HAT1X              0x12
-#define ABS_HAT1Y              0x13
-#define ABS_HAT2X              0x14
-#define ABS_HAT2Y              0x15
-#define ABS_HAT3X              0x16
-#define ABS_HAT3Y              0x17
-#define ABS_PRESSURE           0x18
-#define ABS_DISTANCE           0x19
-#define ABS_TILT_X             0x1a
-#define ABS_TILT_Y             0x1b
-#define ABS_TOOL_WIDTH         0x1c
-
-#define ABS_VOLUME             0x20
-
-#define ABS_MISC               0x28
-
-#define ABS_MT_SLOT            0x2f    /* MT slot being modified */
-#define ABS_MT_TOUCH_MAJOR     0x30    /* Major axis of touching ellipse */
-#define ABS_MT_TOUCH_MINOR     0x31    /* Minor axis (omit if circular) */
-#define ABS_MT_WIDTH_MAJOR     0x32    /* Major axis of approaching ellipse */
-#define ABS_MT_WIDTH_MINOR     0x33    /* Minor axis (omit if circular) */
-#define ABS_MT_ORIENTATION     0x34    /* Ellipse orientation */
-#define ABS_MT_POSITION_X      0x35    /* Center X touch position */
-#define ABS_MT_POSITION_Y      0x36    /* Center Y touch position */
-#define ABS_MT_TOOL_TYPE       0x37    /* Type of touching device */
-#define ABS_MT_BLOB_ID         0x38    /* Group a set of packets as a blob */
-#define ABS_MT_TRACKING_ID     0x39    /* Unique ID of initiated contact */
-#define ABS_MT_PRESSURE                0x3a    /* Pressure on contact area */
-#define ABS_MT_DISTANCE                0x3b    /* Contact hover distance */
-#define ABS_MT_TOOL_X          0x3c    /* Center X tool position */
-#define ABS_MT_TOOL_Y          0x3d    /* Center Y tool position */
-
-#ifdef __KERNEL__
+#include <uapi/linux/input.h>
 /* Implementation details, userspace should not care about these */
 #define ABS_MT_FIRST           ABS_MT_TOUCH_MAJOR
 #define ABS_MT_LAST            ABS_MT_TOOL_Y
-#endif
-
-#define ABS_MAX                        0x3f
-#define ABS_CNT                        (ABS_MAX+1)
-
-/*
- * Switch events
- */
-
-#define SW_LID                 0x00  /* set = lid shut */
-#define SW_TABLET_MODE         0x01  /* set = tablet mode */
-#define SW_HEADPHONE_INSERT    0x02  /* set = inserted */
-#define SW_RFKILL_ALL          0x03  /* rfkill master switch, type "any"
-                                        set = radio enabled */
-#define SW_RADIO               SW_RFKILL_ALL   /* deprecated */
-#define SW_MICROPHONE_INSERT   0x04  /* set = inserted */
-#define SW_DOCK                        0x05  /* set = plugged into dock */
-#define SW_LINEOUT_INSERT      0x06  /* set = inserted */
-#define SW_JACK_PHYSICAL_INSERT 0x07  /* set = mechanical switch set */
-#define SW_VIDEOOUT_INSERT     0x08  /* set = inserted */
-#define SW_CAMERA_LENS_COVER   0x09  /* set = lens covered */
-#define SW_KEYPAD_SLIDE                0x0a  /* set = keypad slide out */
-#define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
-#define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
-#define SW_LINEIN_INSERT       0x0d  /* set = inserted */
-#define SW_MAX                 0x0f
-#define SW_CNT                 (SW_MAX+1)
-
-/*
- * Misc events
- */
-
-#define MSC_SERIAL             0x00
-#define MSC_PULSELED           0x01
-#define MSC_GESTURE            0x02
-#define MSC_RAW                        0x03
-#define MSC_SCAN               0x04
-#define MSC_MAX                        0x07
-#define MSC_CNT                        (MSC_MAX+1)
-
-/*
- * LEDs
- */
-
-#define LED_NUML               0x00
-#define LED_CAPSL              0x01
-#define LED_SCROLLL            0x02
-#define LED_COMPOSE            0x03
-#define LED_KANA               0x04
-#define LED_SLEEP              0x05
-#define LED_SUSPEND            0x06
-#define LED_MUTE               0x07
-#define LED_MISC               0x08
-#define LED_MAIL               0x09
-#define LED_CHARGING           0x0a
-#define LED_MAX                        0x0f
-#define LED_CNT                        (LED_MAX+1)
-
-/*
- * Autorepeat values
- */
-
-#define REP_DELAY              0x00
-#define REP_PERIOD             0x01
-#define REP_MAX                        0x01
-#define REP_CNT                        (REP_MAX+1)
-
-/*
- * Sounds
- */
-
-#define SND_CLICK              0x00
-#define SND_BELL               0x01
-#define SND_TONE               0x02
-#define SND_MAX                        0x07
-#define SND_CNT                        (SND_MAX+1)
-
-/*
- * IDs.
- */
-
-#define ID_BUS                 0
-#define ID_VENDOR              1
-#define ID_PRODUCT             2
-#define ID_VERSION             3
-
-#define BUS_PCI                        0x01
-#define BUS_ISAPNP             0x02
-#define BUS_USB                        0x03
-#define BUS_HIL                        0x04
-#define BUS_BLUETOOTH          0x05
-#define BUS_VIRTUAL            0x06
-
-#define BUS_ISA                        0x10
-#define BUS_I8042              0x11
-#define BUS_XTKBD              0x12
-#define BUS_RS232              0x13
-#define BUS_GAMEPORT           0x14
-#define BUS_PARPORT            0x15
-#define BUS_AMIGA              0x16
-#define BUS_ADB                        0x17
-#define BUS_I2C                        0x18
-#define BUS_HOST               0x19
-#define BUS_GSC                        0x1A
-#define BUS_ATARI              0x1B
-#define BUS_SPI                        0x1C
-
-/*
- * MT_TOOL types
- */
-#define MT_TOOL_FINGER         0
-#define MT_TOOL_PEN            1
-#define MT_TOOL_MAX            1
-
-/*
- * Values describing the status of a force-feedback effect
- */
-#define FF_STATUS_STOPPED      0x00
-#define FF_STATUS_PLAYING      0x01
-#define FF_STATUS_MAX          0x01
-
-/*
- * Structures used in ioctls to upload effects to a device
- * They are pieces of a bigger structure (called ff_effect)
- */
-
-/*
- * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
- * should not be used and have unspecified results.
- */
-
-/**
- * struct ff_replay - defines scheduling of the force-feedback effect
- * @length: duration of the effect
- * @delay: delay before effect should start playing
- */
-struct ff_replay {
-       __u16 length;
-       __u16 delay;
-};
-
-/**
- * struct ff_trigger - defines what triggers the force-feedback effect
- * @button: number of the button triggering the effect
- * @interval: controls how soon the effect can be re-triggered
- */
-struct ff_trigger {
-       __u16 button;
-       __u16 interval;
-};
-
-/**
- * struct ff_envelope - generic force-feedback effect envelope
- * @attack_length: duration of the attack (ms)
- * @attack_level: level at the beginning of the attack
- * @fade_length: duration of fade (ms)
- * @fade_level: level at the end of fade
- *
- * The @attack_level and @fade_level are absolute values; when applying
- * envelope force-feedback core will convert to positive/negative
- * value based on polarity of the default level of the effect.
- * Valid range for the attack and fade levels is 0x0000 - 0x7fff
- */
-struct ff_envelope {
-       __u16 attack_length;
-       __u16 attack_level;
-       __u16 fade_length;
-       __u16 fade_level;
-};
-
-/**
- * struct ff_constant_effect - defines parameters of a constant force-feedback effect
- * @level: strength of the effect; may be negative
- * @envelope: envelope data
- */
-struct ff_constant_effect {
-       __s16 level;
-       struct ff_envelope envelope;
-};
-
-/**
- * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
- * @start_level: beginning strength of the effect; may be negative
- * @end_level: final strength of the effect; may be negative
- * @envelope: envelope data
- */
-struct ff_ramp_effect {
-       __s16 start_level;
-       __s16 end_level;
-       struct ff_envelope envelope;
-};
-
-/**
- * struct ff_condition_effect - defines a spring or friction force-feedback effect
- * @right_saturation: maximum level when joystick moved all way to the right
- * @left_saturation: same for the left side
- * @right_coeff: controls how fast the force grows when the joystick moves
- *     to the right
- * @left_coeff: same for the left side
- * @deadband: size of the dead zone, where no force is produced
- * @center: position of the dead zone
- */
-struct ff_condition_effect {
-       __u16 right_saturation;
-       __u16 left_saturation;
-
-       __s16 right_coeff;
-       __s16 left_coeff;
-
-       __u16 deadband;
-       __s16 center;
-};
-
-/**
- * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
- * @waveform: kind of the effect (wave)
- * @period: period of the wave (ms)
- * @magnitude: peak value
- * @offset: mean value of the wave (roughly)
- * @phase: 'horizontal' shift
- * @envelope: envelope data
- * @custom_len: number of samples (FF_CUSTOM only)
- * @custom_data: buffer of samples (FF_CUSTOM only)
- *
- * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
- * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
- * for the time being as no driver supports it yet.
- *
- * Note: the data pointed by custom_data is copied by the driver.
- * You can therefore dispose of the memory after the upload/update.
- */
-struct ff_periodic_effect {
-       __u16 waveform;
-       __u16 period;
-       __s16 magnitude;
-       __s16 offset;
-       __u16 phase;
-
-       struct ff_envelope envelope;
-
-       __u32 custom_len;
-       __s16 __user *custom_data;
-};
-
-/**
- * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
- * @strong_magnitude: magnitude of the heavy motor
- * @weak_magnitude: magnitude of the light one
- *
- * Some rumble pads have two motors of different weight. Strong_magnitude
- * represents the magnitude of the vibration generated by the heavy one.
- */
-struct ff_rumble_effect {
-       __u16 strong_magnitude;
-       __u16 weak_magnitude;
-};
-
-/**
- * struct ff_effect - defines force feedback effect
- * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
- *     FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
- * @id: an unique id assigned to an effect
- * @direction: direction of the effect
- * @trigger: trigger conditions (struct ff_trigger)
- * @replay: scheduling of the effect (struct ff_replay)
- * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
- *     ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
- *     defining effect parameters
- *
- * This structure is sent through ioctl from the application to the driver.
- * To create a new effect application should set its @id to -1; the kernel
- * will return assigned @id which can later be used to update or delete
- * this effect.
- *
- * Direction of the effect is encoded as follows:
- *     0 deg -> 0x0000 (down)
- *     90 deg -> 0x4000 (left)
- *     180 deg -> 0x8000 (up)
- *     270 deg -> 0xC000 (right)
- */
-struct ff_effect {
-       __u16 type;
-       __s16 id;
-       __u16 direction;
-       struct ff_trigger trigger;
-       struct ff_replay replay;
-
-       union {
-               struct ff_constant_effect constant;
-               struct ff_ramp_effect ramp;
-               struct ff_periodic_effect periodic;
-               struct ff_condition_effect condition[2]; /* One for each axis */
-               struct ff_rumble_effect rumble;
-       } u;
-};
-
-/*
- * Force feedback effect types
- */
-
-#define FF_RUMBLE      0x50
-#define FF_PERIODIC    0x51
-#define FF_CONSTANT    0x52
-#define FF_SPRING      0x53
-#define FF_FRICTION    0x54
-#define FF_DAMPER      0x55
-#define FF_INERTIA     0x56
-#define FF_RAMP                0x57
-
-#define FF_EFFECT_MIN  FF_RUMBLE
-#define FF_EFFECT_MAX  FF_RAMP
-
-/*
- * Force feedback periodic effect types
- */
-
-#define FF_SQUARE      0x58
-#define FF_TRIANGLE    0x59
-#define FF_SINE                0x5a
-#define FF_SAW_UP      0x5b
-#define FF_SAW_DOWN    0x5c
-#define FF_CUSTOM      0x5d
-
-#define FF_WAVEFORM_MIN        FF_SQUARE
-#define FF_WAVEFORM_MAX        FF_CUSTOM
-
-/*
- * Set ff device properties
- */
-
-#define FF_GAIN                0x60
-#define FF_AUTOCENTER  0x61
-
-#define FF_MAX         0x7f
-#define FF_CNT         (FF_MAX+1)
-
-#ifdef __KERNEL__
 
 /*
  * In-kernel definitions.
@@ -1668,4 +524,3 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
                int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
 
 #endif
-#endif
index bd0a2a8631c60e6620578acc68c363540aea1755..58b82a22a52b90288566eaa36e9d2bf8095a363c 100644 (file)
  */
 #ifndef _LINUX_IP_H
 #define _LINUX_IP_H
-#include <linux/types.h>
-#include <asm/byteorder.h>
 
-#define IPTOS_TOS_MASK         0x1E
-#define IPTOS_TOS(tos)         ((tos)&IPTOS_TOS_MASK)
-#define        IPTOS_LOWDELAY          0x10
-#define        IPTOS_THROUGHPUT        0x08
-#define        IPTOS_RELIABILITY       0x04
-#define        IPTOS_MINCOST           0x02
-
-#define IPTOS_PREC_MASK                0xE0
-#define IPTOS_PREC(tos)                ((tos)&IPTOS_PREC_MASK)
-#define IPTOS_PREC_NETCONTROL           0xe0
-#define IPTOS_PREC_INTERNETCONTROL      0xc0
-#define IPTOS_PREC_CRITIC_ECP           0xa0
-#define IPTOS_PREC_FLASHOVERRIDE        0x80
-#define IPTOS_PREC_FLASH                0x60
-#define IPTOS_PREC_IMMEDIATE            0x40
-#define IPTOS_PREC_PRIORITY             0x20
-#define IPTOS_PREC_ROUTINE              0x00
-
-
-/* IP options */
-#define IPOPT_COPY             0x80
-#define IPOPT_CLASS_MASK       0x60
-#define IPOPT_NUMBER_MASK      0x1f
-
-#define        IPOPT_COPIED(o)         ((o)&IPOPT_COPY)
-#define        IPOPT_CLASS(o)          ((o)&IPOPT_CLASS_MASK)
-#define        IPOPT_NUMBER(o)         ((o)&IPOPT_NUMBER_MASK)
-
-#define        IPOPT_CONTROL           0x00
-#define        IPOPT_RESERVED1         0x20
-#define        IPOPT_MEASUREMENT       0x40
-#define        IPOPT_RESERVED2         0x60
-
-#define IPOPT_END      (0 |IPOPT_CONTROL)
-#define IPOPT_NOOP     (1 |IPOPT_CONTROL)
-#define IPOPT_SEC      (2 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_LSRR     (3 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_TIMESTAMP        (4 |IPOPT_MEASUREMENT)
-#define IPOPT_CIPSO    (6 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_RR       (7 |IPOPT_CONTROL)
-#define IPOPT_SID      (8 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_SSRR     (9 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_RA       (20|IPOPT_CONTROL|IPOPT_COPY)
-
-#define IPVERSION      4
-#define MAXTTL         255
-#define IPDEFTTL       64
-
-#define IPOPT_OPTVAL 0
-#define IPOPT_OLEN   1
-#define IPOPT_OFFSET 2
-#define IPOPT_MINOFF 4
-#define MAX_IPOPTLEN 40
-#define IPOPT_NOP IPOPT_NOOP
-#define IPOPT_EOL IPOPT_END
-#define IPOPT_TS  IPOPT_TIMESTAMP
-
-#define        IPOPT_TS_TSONLY         0               /* timestamps only */
-#define        IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
-#define        IPOPT_TS_PRESPEC        3               /* specified modules only */
-
-#define IPV4_BEET_PHMAXLEN 8
-
-struct iphdr {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8    ihl:4,
-               version:4;
-#elif defined (__BIG_ENDIAN_BITFIELD)
-       __u8    version:4,
-               ihl:4;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       __u8    tos;
-       __be16  tot_len;
-       __be16  id;
-       __be16  frag_off;
-       __u8    ttl;
-       __u8    protocol;
-       __sum16 check;
-       __be32  saddr;
-       __be32  daddr;
-       /*The options start here. */
-};
-
-#ifdef __KERNEL__
 #include <linux/skbuff.h>
+#include <uapi/linux/ip.h>
 
 static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
 {
@@ -116,34 +29,4 @@ static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
 {
        return (struct iphdr *)skb_transport_header(skb);
 }
-#endif
-
-struct ip_auth_hdr {
-       __u8  nexthdr;
-       __u8  hdrlen;           /* This one is measured in 32 bit units! */
-       __be16 reserved;
-       __be32 spi;
-       __be32 seq_no;          /* Sequence number */
-       __u8  auth_data[0];     /* Variable len but >=4. Mind the 64 bit alignment! */
-};
-
-struct ip_esp_hdr {
-       __be32 spi;
-       __be32 seq_no;          /* Sequence number */
-       __u8  enc_data[0];      /* Variable len but >=8. Mind the 64 bit alignment! */
-};
-
-struct ip_comp_hdr {
-       __u8 nexthdr;
-       __u8 flags;
-       __be16 cpi;
-};
-
-struct ip_beet_phdr {
-       __u8 nexthdr;
-       __u8 hdrlen;
-       __u8 padlen;
-       __u8 reserved;
-};
-
 #endif /* _LINUX_IP_H */
index ca833fdc3138595ed076af4ba41003e37935e5a8..8d861b2651f7b0586edfa0be89adac92d9592746 100644 (file)
@@ -1,85 +1,9 @@
 #ifndef _LINUX_IPC_H
 #define _LINUX_IPC_H
 
-#include <linux/types.h>
-
-#define IPC_PRIVATE ((__kernel_key_t) 0)  
-
-/* Obsolete, used only for backwards compatibility and libc5 compiles */
-struct ipc_perm
-{
-       __kernel_key_t  key;
-       __kernel_uid_t  uid;
-       __kernel_gid_t  gid;
-       __kernel_uid_t  cuid;
-       __kernel_gid_t  cgid;
-       __kernel_mode_t mode; 
-       unsigned short  seq;
-};
-
-/* Include the definition of ipc64_perm */
-#include <asm/ipcbuf.h>
-
-/* resource get request flags */
-#define IPC_CREAT  00001000   /* create if key is nonexistent */
-#define IPC_EXCL   00002000   /* fail if key exists */
-#define IPC_NOWAIT 00004000   /* return error on wait */
-
-/* these fields are used by the DIPC package so the kernel as standard
-   should avoid using them if possible */
-   
-#define IPC_DIPC 00010000  /* make it distributed */
-#define IPC_OWN  00020000  /* this machine is the DIPC owner */
-
-/* 
- * Control commands used with semctl, msgctl and shmctl 
- * see also specific commands in sem.h, msg.h and shm.h
- */
-#define IPC_RMID 0     /* remove resource */
-#define IPC_SET  1     /* set ipc_perm options */
-#define IPC_STAT 2     /* get ipc_perm options */
-#define IPC_INFO 3     /* see ipcs */
-
-/*
- * Version flags for semctl, msgctl, and shmctl commands
- * These are passed as bitflags or-ed with the actual command
- */
-#define IPC_OLD 0      /* Old version (no 32-bit UID support on many
-                          architectures) */
-#define IPC_64  0x0100  /* New version (support 32-bit UIDs, bigger
-                          message sizes, etc. */
-
-/*
- * These are used to wrap system calls.
- *
- * See architecture code for ugly details..
- */
-struct ipc_kludge {
-       struct msgbuf __user *msgp;
-       long msgtyp;
-};
-
-#define SEMOP           1
-#define SEMGET          2
-#define SEMCTL          3
-#define SEMTIMEDOP      4
-#define MSGSND         11
-#define MSGRCV         12
-#define MSGGET         13
-#define MSGCTL         14
-#define SHMAT          21
-#define SHMDT          22
-#define SHMGET         23
-#define SHMCTL         24
-
-/* Used by the DIPC package, try and avoid reusing it */
-#define DIPC            25
-
-#define IPCCALL(version,op)    ((version)<<16 | (op))
-
-#ifdef __KERNEL__
 #include <linux/spinlock.h>
 #include <linux/uidgid.h>
+#include <uapi/linux/ipc.h>
 
 #define IPCMNI 32768  /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
 
@@ -99,6 +23,4 @@ struct kern_ipc_perm
        void            *security;
 };
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_IPC_H */
index 48dcba9b2065d178d0dd0fa7d1d9d02f4bd191be..1487e7906bbdb3948f124bdfea8a0cf17075dd67 100644 (file)
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-
 #ifndef __LINUX_IPMI_H
 #define __LINUX_IPMI_H
 
-#include <linux/ipmi_msgdefs.h>
-#include <linux/compiler.h>
-
-/*
- * This file describes an interface to an IPMI driver.  You have to
- * have a fairly good understanding of IPMI to use this, so go read
- * the specs first before actually trying to do anything.
- *
- * With that said, this driver provides a multi-user interface to the
- * IPMI driver, and it allows multiple IPMI physical interfaces below
- * the driver.  The physical interfaces bind as a lower layer on the
- * driver.  They appear as interfaces to the application using this
- * interface.
- *
- * Multi-user means that multiple applications may use the driver,
- * send commands, receive responses, etc.  The driver keeps track of
- * commands the user sends and tracks the responses.  The responses
- * will go back to the application that send the command.  If the
- * response doesn't come back in time, the driver will return a
- * timeout error response to the application.  Asynchronous events
- * from the BMC event queue will go to all users bound to the driver.
- * The incoming event queue in the BMC will automatically be flushed
- * if it becomes full and it is queried once a second to see if
- * anything is in it.  Incoming commands to the driver will get
- * delivered as commands.
- *
- * This driver provides two main interfaces: one for in-kernel
- * applications and another for userland applications.  The
- * capabilities are basically the same for both interface, although
- * the interfaces are somewhat different.  The stuff in the
- * #ifdef __KERNEL__ below is the in-kernel interface.  The userland
- * interface is defined later in the file.  */
-
-
-
-/*
- * This is an overlay for all the address types, so it's easy to
- * determine the actual address type.  This is kind of like addresses
- * work for sockets.
- */
-#define IPMI_MAX_ADDR_SIZE 32
-struct ipmi_addr {
-        /* Try to take these from the "Channel Medium Type" table
-           in section 6.5 of the IPMI 1.5 manual. */
-       int   addr_type;
-       short channel;
-       char  data[IPMI_MAX_ADDR_SIZE];
-};
-
-/*
- * When the address is not used, the type will be set to this value.
- * The channel is the BMC's channel number for the channel (usually
- * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
- */
-#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE        0x0c
-struct ipmi_system_interface_addr {
-       int           addr_type;
-       short         channel;
-       unsigned char lun;
-};
-
-/* An IPMB Address. */
-#define IPMI_IPMB_ADDR_TYPE            0x01
-/* Used for broadcast get device id as described in section 17.9 of the
-   IPMI 1.5 manual. */
-#define IPMI_IPMB_BROADCAST_ADDR_TYPE  0x41
-struct ipmi_ipmb_addr {
-       int           addr_type;
-       short         channel;
-       unsigned char slave_addr;
-       unsigned char lun;
-};
-
-/*
- * A LAN Address.  This is an address to/from a LAN interface bridged
- * by the BMC, not an address actually out on the LAN.
- *
- * A conscious decision was made here to deviate slightly from the IPMI
- * spec.  We do not use rqSWID and rsSWID like it shows in the
- * message.  Instead, we use remote_SWID and local_SWID.  This means
- * that any message (a request or response) from another device will
- * always have exactly the same address.  If you didn't do this,
- * requests and responses from the same device would have different
- * addresses, and that's not too cool.
- *
- * In this address, the remote_SWID is always the SWID the remote
- * message came from, or the SWID we are sending the message to.
- * local_SWID is always our SWID.  Note that having our SWID in the
- * message is a little weird, but this is required.
- */
-#define IPMI_LAN_ADDR_TYPE             0x04
-struct ipmi_lan_addr {
-       int           addr_type;
-       short         channel;
-       unsigned char privilege;
-       unsigned char session_handle;
-       unsigned char remote_SWID;
-       unsigned char local_SWID;
-       unsigned char lun;
-};
-
-
-/*
- * Channel for talking directly with the BMC.  When using this
- * channel, This is for the system interface address type only.  FIXME
- * - is this right, or should we use -1?
- */
-#define IPMI_BMC_CHANNEL  0xf
-#define IPMI_NUM_CHANNELS 0x10
-
-/*
- * Used to signify an "all channel" bitmask.  This is more than the
- * actual number of channels because this is used in userland and
- * will cover us if the number of channels is extended.
- */
-#define IPMI_CHAN_ALL     (~0)
-
-
-/*
- * A raw IPMI message without any addressing.  This covers both
- * commands and responses.  The completion code is always the first
- * byte of data in the response (as the spec shows the messages laid
- * out).
- */
-struct ipmi_msg {
-       unsigned char  netfn;
-       unsigned char  cmd;
-       unsigned short data_len;
-       unsigned char  __user *data;
-};
-
-struct kernel_ipmi_msg {
-       unsigned char  netfn;
-       unsigned char  cmd;
-       unsigned short data_len;
-       unsigned char  *data;
-};
-
-/*
- * Various defines that are useful for IPMI applications.
- */
-#define IPMI_INVALID_CMD_COMPLETION_CODE       0xC1
-#define IPMI_TIMEOUT_COMPLETION_CODE           0xC3
-#define IPMI_UNKNOWN_ERR_COMPLETION_CODE       0xff
-
+#include <uapi/linux/ipmi.h>
 
-/*
- * Receive types for messages coming from the receive interface.  This
- * is used for the receive in-kernel interface and in the receive
- * IOCTL.
- *
- * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
- * it allows you to get the message results when you send a response
- * message.
- */
-#define IPMI_RESPONSE_RECV_TYPE                1 /* A response to a command */
-#define IPMI_ASYNC_EVENT_RECV_TYPE     2 /* Something from the event queue */
-#define IPMI_CMD_RECV_TYPE             3 /* A command from somewhere else */
-#define IPMI_RESPONSE_RESPONSE_TYPE    4 /* The response for
-                                             a sent response, giving any
-                                             error status for sending the
-                                             response.  When you send a
-                                             response message, this will
-                                             be returned. */
-#define IPMI_OEM_RECV_TYPE             5 /* The response for OEM Channels */
-
-/* Note that async events and received commands do not have a completion
-   code as the first byte of the incoming data, unlike a response. */
-
-
-/*
- * Modes for ipmi_set_maint_mode() and the userland IOCTL.  The AUTO
- * setting is the default and means it will be set on certain
- * commands.  Hard setting it on and off will override automatic
- * operation.
- */
-#define IPMI_MAINTENANCE_MODE_AUTO     0
-#define IPMI_MAINTENANCE_MODE_OFF      1
-#define IPMI_MAINTENANCE_MODE_ON       2
-
-#ifdef __KERNEL__
 
 /*
  * The in-kernel interface.
@@ -493,244 +313,4 @@ struct ipmi_smi_info {
 /* This is to get the private info of ipmi_smi_t */
 extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data);
 
-#endif /* __KERNEL__ */
-
-
-/*
- * The userland interface
- */
-
-/*
- * The userland interface for the IPMI driver is a standard character
- * device, with each instance of an interface registered as a minor
- * number under the major character device.
- *
- * The read and write calls do not work, to get messages in and out
- * requires ioctl calls because of the complexity of the data.  select
- * and poll do work, so you can wait for input using the file
- * descriptor, you just can use read to get it.
- *
- * In general, you send a command down to the interface and receive
- * responses back.  You can use the msgid value to correlate commands
- * and responses, the driver will take care of figuring out which
- * incoming messages are for which command and find the proper msgid
- * value to report.  You will only receive reponses for commands you
- * send.  Asynchronous events, however, go to all open users, so you
- * must be ready to handle these (or ignore them if you don't care).
- *
- * The address type depends upon the channel type.  When talking
- * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
- * (IPMI_UNUSED_ADDR_TYPE).  When talking to an IPMB channel, you must
- * supply a valid IPMB address with the addr_type set properly.
- *
- * When talking to normal channels, the driver takes care of the
- * details of formatting and sending messages on that channel.  You do
- * not, for instance, have to format a send command, you just send
- * whatever command you want to the channel, the driver will create
- * the send command, automatically issue receive command and get even
- * commands, and pass those up to the proper user.
- */
-
-
-/* The magic IOCTL value for this interface. */
-#define IPMI_IOC_MAGIC 'i'
-
-
-/* Messages sent to the interface are this format. */
-struct ipmi_req {
-       unsigned char __user *addr; /* Address to send the message to. */
-       unsigned int  addr_len;
-
-       long    msgid; /* The sequence number for the message.  This
-                         exact value will be reported back in the
-                         response to this request if it is a command.
-                         If it is a response, this will be used as
-                         the sequence value for the response.  */
-
-       struct ipmi_msg msg;
-};
-/*
- * Send a message to the interfaces.  error values are:
- *   - EFAULT - an address supplied was invalid.
- *   - EINVAL - The address supplied was not valid, or the command
- *              was not allowed.
- *   - EMSGSIZE - The message to was too large.
- *   - ENOMEM - Buffers could not be allocated for the command.
- */
-#define IPMICTL_SEND_COMMAND           _IOR(IPMI_IOC_MAGIC, 13,        \
-                                            struct ipmi_req)
-
-/* Messages sent to the interface with timing parameters are this
-   format. */
-struct ipmi_req_settime {
-       struct ipmi_req req;
-
-       /* See ipmi_request_settime() above for details on these
-          values. */
-       int          retries;
-       unsigned int retry_time_ms;
-};
-/*
- * Send a message to the interfaces with timing parameters.  error values
- * are:
- *   - EFAULT - an address supplied was invalid.
- *   - EINVAL - The address supplied was not valid, or the command
- *              was not allowed.
- *   - EMSGSIZE - The message to was too large.
- *   - ENOMEM - Buffers could not be allocated for the command.
- */
-#define IPMICTL_SEND_COMMAND_SETTIME   _IOR(IPMI_IOC_MAGIC, 21,        \
-                                            struct ipmi_req_settime)
-
-/* Messages received from the interface are this format. */
-struct ipmi_recv {
-       int     recv_type; /* Is this a command, response or an
-                             asyncronous event. */
-
-       unsigned char __user *addr;    /* Address the message was from is put
-                                  here.  The caller must supply the
-                                  memory. */
-       unsigned int  addr_len; /* The size of the address buffer.
-                                  The caller supplies the full buffer
-                                  length, this value is updated to
-                                  the actual message length when the
-                                  message is received. */
-
-       long    msgid; /* The sequence number specified in the request
-                         if this is a response.  If this is a command,
-                         this will be the sequence number from the
-                         command. */
-
-       struct ipmi_msg msg; /* The data field must point to a buffer.
-                               The data_size field must be set to the
-                               size of the message buffer.  The
-                               caller supplies the full buffer
-                               length, this value is updated to the
-                               actual message length when the message
-                               is received. */
-};
-
-/*
- * Receive a message.  error values:
- *  - EAGAIN - no messages in the queue.
- *  - EFAULT - an address supplied was invalid.
- *  - EINVAL - The address supplied was not valid.
- *  - EMSGSIZE - The message to was too large to fit into the message buffer,
- *               the message will be left in the buffer. */
-#define IPMICTL_RECEIVE_MSG            _IOWR(IPMI_IOC_MAGIC, 12,       \
-                                             struct ipmi_recv)
-
-/*
- * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
- * will truncate the contents instead of leaving the data in the
- * buffer.
- */
-#define IPMICTL_RECEIVE_MSG_TRUNC      _IOWR(IPMI_IOC_MAGIC, 11,       \
-                                             struct ipmi_recv)
-
-/* Register to get commands from other entities on this interface. */
-struct ipmi_cmdspec {
-       unsigned char netfn;
-       unsigned char cmd;
-};
-
-/*
- * Register to receive a specific command.  error values:
- *   - EFAULT - an address supplied was invalid.
- *   - EBUSY - The netfn/cmd supplied was already in use.
- *   - ENOMEM - could not allocate memory for the entry.
- */
-#define IPMICTL_REGISTER_FOR_CMD       _IOR(IPMI_IOC_MAGIC, 14,        \
-                                            struct ipmi_cmdspec)
-/*
- * Unregister a regsitered command.  error values:
- *  - EFAULT - an address supplied was invalid.
- *  - ENOENT - The netfn/cmd was not found registered for this user.
- */
-#define IPMICTL_UNREGISTER_FOR_CMD     _IOR(IPMI_IOC_MAGIC, 15,        \
-                                            struct ipmi_cmdspec)
-
-/*
- * Register to get commands from other entities on specific channels.
- * This way, you can only listen on specific channels, or have messages
- * from some channels go to one place and other channels to someplace
- * else.  The chans field is a bitmask, (1 << channel) for each channel.
- * It may be IPMI_CHAN_ALL for all channels.
- */
-struct ipmi_cmdspec_chans {
-       unsigned int netfn;
-       unsigned int cmd;
-       unsigned int chans;
-};
-
-/*
- * Register to receive a specific command on specific channels.  error values:
- *   - EFAULT - an address supplied was invalid.
- *   - EBUSY - One of the netfn/cmd/chans supplied was already in use.
- *   - ENOMEM - could not allocate memory for the entry.
- */
-#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28,        \
-                                            struct ipmi_cmdspec_chans)
-/*
- * Unregister some netfn/cmd/chans.  error values:
- *  - EFAULT - an address supplied was invalid.
- *  - ENOENT - None of the netfn/cmd/chans were found registered for this user.
- */
-#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29,      \
-                                            struct ipmi_cmdspec_chans)
-
-/*
- * Set whether this interface receives events.  Note that the first
- * user registered for events will get all pending events for the
- * interface.  error values:
- *  - EFAULT - an address supplied was invalid.
- */
-#define IPMICTL_SET_GETS_EVENTS_CMD    _IOR(IPMI_IOC_MAGIC, 16, int)
-
-/*
- * Set and get the slave address and LUN that we will use for our
- * source messages.  Note that this affects the interface, not just
- * this user, so it will affect all users of this interface.  This is
- * so some initialization code can come in and do the OEM-specific
- * things it takes to determine your address (if not the BMC) and set
- * it for everyone else.  You should probably leave the LUN alone.
- */
-struct ipmi_channel_lun_address_set {
-       unsigned short channel;
-       unsigned char  value;
-};
-#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
-       _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
-#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
-       _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
-#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
-       _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
-#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
-       _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
-/* Legacy interfaces, these only set IPMB 0. */
-#define IPMICTL_SET_MY_ADDRESS_CMD     _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
-#define IPMICTL_GET_MY_ADDRESS_CMD     _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
-#define IPMICTL_SET_MY_LUN_CMD         _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
-#define IPMICTL_GET_MY_LUN_CMD         _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
-
-/*
- * Get/set the default timing values for an interface.  You shouldn't
- * generally mess with these.
- */
-struct ipmi_timing_parms {
-       int          retries;
-       unsigned int retry_time_ms;
-};
-#define IPMICTL_SET_TIMING_PARMS_CMD   _IOR(IPMI_IOC_MAGIC, 22, \
-                                            struct ipmi_timing_parms)
-#define IPMICTL_GET_TIMING_PARMS_CMD   _IOR(IPMI_IOC_MAGIC, 23, \
-                                            struct ipmi_timing_parms)
-
-/*
- * Set the maintenance mode.  See ipmi_set_maintenance_mode() above
- * for a description of what this does.
- */
-#define IPMICTL_GET_MAINTENANCE_MODE_CMD       _IOR(IPMI_IOC_MAGIC, 30, int)
-#define IPMICTL_SET_MAINTENANCE_MODE_CMD       _IOW(IPMI_IOC_MAGIC, 31, int)
-
 #endif /* __LINUX_IPMI_H */
index 0b94e91ed68529ef74573b4c170eb96f5afc8175..bcba48a97868e9b38d6a92f38e5175b2474df330 100644 (file)
@@ -1,134 +1,9 @@
 #ifndef _IPV6_H
 #define _IPV6_H
 
-#include <linux/types.h>
-#include <linux/in6.h>
-#include <asm/byteorder.h>
+#include <uapi/linux/ipv6.h>
 
-/* The latest drafts declared increase in minimal mtu up to 1280. */
-
-#define IPV6_MIN_MTU   1280
-
-/*
- *     Advanced API
- *     source interface/address selection, source routing, etc...
- *     *under construction*
- */
-
-
-struct in6_pktinfo {
-       struct in6_addr ipi6_addr;
-       int             ipi6_ifindex;
-};
-
-struct ip6_mtuinfo {
-       struct sockaddr_in6     ip6m_addr;
-       __u32                   ip6m_mtu;
-};
-
-struct in6_ifreq {
-       struct in6_addr ifr6_addr;
-       __u32           ifr6_prefixlen;
-       int             ifr6_ifindex; 
-};
-
-#define IPV6_SRCRT_STRICT      0x01    /* Deprecated; will be removed */
-#define IPV6_SRCRT_TYPE_0      0       /* Deprecated; will be removed */
-#define IPV6_SRCRT_TYPE_2      2       /* IPv6 type 2 Routing Header   */
-
-/*
- *     routing header
- */
-struct ipv6_rt_hdr {
-       __u8            nexthdr;
-       __u8            hdrlen;
-       __u8            type;
-       __u8            segments_left;
-
-       /*
-        *      type specific data
-        *      variable length field
-        */
-};
-
-
-struct ipv6_opt_hdr {
-       __u8            nexthdr;
-       __u8            hdrlen;
-       /* 
-        * TLV encoded option data follows.
-        */
-} __attribute__((packed));     /* required for some archs */
-
-#define ipv6_destopt_hdr ipv6_opt_hdr
-#define ipv6_hopopt_hdr  ipv6_opt_hdr
-
-#ifdef __KERNEL__
 #define ipv6_optlen(p)  (((p)->hdrlen+1) << 3)
-#endif
-
-/*
- *     routing header type 0 (used in cmsghdr struct)
- */
-
-struct rt0_hdr {
-       struct ipv6_rt_hdr      rt_hdr;
-       __u32                   reserved;
-       struct in6_addr         addr[0];
-
-#define rt0_type               rt_hdr.type
-};
-
-/*
- *     routing header type 2
- */
-
-struct rt2_hdr {
-       struct ipv6_rt_hdr      rt_hdr;
-       __u32                   reserved;
-       struct in6_addr         addr;
-
-#define rt2_type               rt_hdr.type
-};
-
-/*
- *     home address option in destination options header
- */
-
-struct ipv6_destopt_hao {
-       __u8                    type;
-       __u8                    length;
-       struct in6_addr         addr;
-} __attribute__((packed));
-
-/*
- *     IPv6 fixed header
- *
- *     BEWARE, it is incorrect. The first 4 bits of flow_lbl
- *     are glued to priority now, forming "class".
- */
-
-struct ipv6hdr {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u8                    priority:4,
-                               version:4;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u8                    version:4,
-                               priority:4;
-#else
-#error "Please fix <asm/byteorder.h>"
-#endif
-       __u8                    flow_lbl[3];
-
-       __be16                  payload_len;
-       __u8                    nexthdr;
-       __u8                    hop_limit;
-
-       struct  in6_addr        saddr;
-       struct  in6_addr        daddr;
-};
-
-#ifdef __KERNEL__
 /*
  * This structure contains configuration options per IPv6 link.
  */
@@ -180,43 +55,6 @@ struct ipv6_params {
        __s32 autoconf;
 };
 extern struct ipv6_params ipv6_defaults;
-#endif
-
-/* index values for the variables in ipv6_devconf */
-enum {
-       DEVCONF_FORWARDING = 0,
-       DEVCONF_HOPLIMIT,
-       DEVCONF_MTU6,
-       DEVCONF_ACCEPT_RA,
-       DEVCONF_ACCEPT_REDIRECTS,
-       DEVCONF_AUTOCONF,
-       DEVCONF_DAD_TRANSMITS,
-       DEVCONF_RTR_SOLICITS,
-       DEVCONF_RTR_SOLICIT_INTERVAL,
-       DEVCONF_RTR_SOLICIT_DELAY,
-       DEVCONF_USE_TEMPADDR,
-       DEVCONF_TEMP_VALID_LFT,
-       DEVCONF_TEMP_PREFERED_LFT,
-       DEVCONF_REGEN_MAX_RETRY,
-       DEVCONF_MAX_DESYNC_FACTOR,
-       DEVCONF_MAX_ADDRESSES,
-       DEVCONF_FORCE_MLD_VERSION,
-       DEVCONF_ACCEPT_RA_DEFRTR,
-       DEVCONF_ACCEPT_RA_PINFO,
-       DEVCONF_ACCEPT_RA_RTR_PREF,
-       DEVCONF_RTR_PROBE_INTERVAL,
-       DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
-       DEVCONF_PROXY_NDP,
-       DEVCONF_OPTIMISTIC_DAD,
-       DEVCONF_ACCEPT_SOURCE_ROUTE,
-       DEVCONF_MC_FORWARDING,
-       DEVCONF_DISABLE_IPV6,
-       DEVCONF_ACCEPT_DAD,
-       DEVCONF_FORCE_TLLAO,
-       DEVCONF_MAX
-};
-
-#ifdef __KERNEL__
 #include <linux/icmpv6.h>
 #include <linux/tcp.h>
 #include <linux/udp.h>
@@ -541,6 +379,4 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
         (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \
         (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
 
-#endif /* __KERNEL__ */
-
 #endif /* _IPV6_H */
index 1e7d8af2defe78d27bbe9c2518065b3679e63903..25b5f1f5e7802a6d53f41783d9c0b5bad256a173 100644 (file)
@@ -9,54 +9,11 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  */
-
 #ifndef _LINUX_IPV6_ROUTE_H
 #define _LINUX_IPV6_ROUTE_H
 
-#include <linux/types.h>
-
-#define RTF_DEFAULT    0x00010000      /* default - learned via ND     */
-#define RTF_ALLONLINK  0x00020000      /* (deprecated and will be removed)
-                                          fallback, no routers on link */
-#define RTF_ADDRCONF   0x00040000      /* addrconf route - RA          */
-#define RTF_PREFIX_RT  0x00080000      /* A prefix only route - RA     */
-#define RTF_ANYCAST    0x00100000      /* Anycast                      */
-
-#define RTF_NONEXTHOP  0x00200000      /* route with no nexthop        */
-#define RTF_EXPIRES    0x00400000
-
-#define RTF_ROUTEINFO  0x00800000      /* route information - RA       */
-
-#define RTF_CACHE      0x01000000      /* cache entry                  */
-#define RTF_FLOW       0x02000000      /* flow significant route       */
-#define RTF_POLICY     0x04000000      /* policy route                 */
-
-#define RTF_PREF(pref) ((pref) << 27)
-#define RTF_PREF_MASK  0x18000000
+#include <uapi/linux/ipv6_route.h>
 
-#define RTF_LOCAL      0x80000000
-
-#ifdef __KERNEL__
 #define IPV6_EXTRACT_PREF(flag)        (((flag) & RTF_PREF_MASK) >> 27)
 #define IPV6_DECODE_PREF(pref) ((pref) ^ 2)    /* 1:low,2:med,3:high */
 #endif
-
-struct in6_rtmsg {
-       struct in6_addr         rtmsg_dst;
-       struct in6_addr         rtmsg_src;
-       struct in6_addr         rtmsg_gateway;
-       __u32                   rtmsg_type;
-       __u16                   rtmsg_dst_len;
-       __u16                   rtmsg_src_len;
-       __u32                   rtmsg_metric;
-       unsigned long           rtmsg_info;
-        __u32                  rtmsg_flags;
-       int                     rtmsg_ifindex;
-};
-
-#define RTMSG_NEWDEVICE                0x11
-#define RTMSG_DELDEVICE                0x12
-#define RTMSG_NEWROUTE         0x21
-#define RTMSG_DELROUTE         0x22
-
-#endif
index 3bc4dcab6e828a16b6113c1aa1f3de08bb062c46..0a2dc46cdaf6e7070dc602fcde64a23c72553361 100644 (file)
@@ -1,10 +1,8 @@
 #ifndef _LINUX_IRQNR_H
 #define _LINUX_IRQNR_H
 
-/*
- * Generic irq_desc iterators:
- */
-#ifdef __KERNEL__
+#include <uapi/linux/irqnr.h>
+
 
 #ifndef CONFIG_GENERIC_HARDIRQS
 #include <asm/irq.h>
@@ -57,6 +55,4 @@ unsigned int irq_get_next_irq(unsigned int offset);
 #define for_each_irq_nr(irq)                   \
        for (irq = 0; irq < nr_irqs; irq++)
 
-#endif /* __KERNEL__ */
-
 #endif
index 215c41602af80904a68ab1cfb9aedd2a2c74de93..1e9a0f2a86260b31619fbdcd7fe9aea66a1e1435 100644 (file)
  * of the GNU General Public License, incorporated herein by reference.
  *
  */
-
 #ifndef __ISDN_H__
 #define __ISDN_H__
 
-#include <linux/ioctl.h>
-#include <linux/tty.h>
-
-#define ISDN_MAX_DRIVERS    32
-#define ISDN_MAX_CHANNELS   64
-
-/* New ioctl-codes */
-#define IIOCNETAIF  _IO('I',1)
-#define IIOCNETDIF  _IO('I',2)
-#define IIOCNETSCF  _IO('I',3)
-#define IIOCNETGCF  _IO('I',4)
-#define IIOCNETANM  _IO('I',5)
-#define IIOCNETDNM  _IO('I',6)
-#define IIOCNETGNM  _IO('I',7)
-#define IIOCGETSET  _IO('I',8) /* no longer supported */
-#define IIOCSETSET  _IO('I',9) /* no longer supported */
-#define IIOCSETVER  _IO('I',10)
-#define IIOCNETHUP  _IO('I',11)
-#define IIOCSETGST  _IO('I',12)
-#define IIOCSETBRJ  _IO('I',13)
-#define IIOCSIGPRF  _IO('I',14)
-#define IIOCGETPRF  _IO('I',15)
-#define IIOCSETPRF  _IO('I',16)
-#define IIOCGETMAP  _IO('I',17)
-#define IIOCSETMAP  _IO('I',18)
-#define IIOCNETASL  _IO('I',19)
-#define IIOCNETDIL  _IO('I',20)
-#define IIOCGETCPS  _IO('I',21)
-#define IIOCGETDVR  _IO('I',22)
-#define IIOCNETLCR  _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
-#define IIOCNETDWRSET  _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
-
-#define IIOCNETALN  _IO('I',32)
-#define IIOCNETDLN  _IO('I',33)
-
-#define IIOCNETGPN  _IO('I',34)
-
-#define IIOCDBGVAR  _IO('I',127)
-
-#define IIOCDRVCTL  _IO('I',128)
-
-/* cisco hdlck device private ioctls */
-#define SIOCGKEEPPERIOD        (SIOCDEVPRIVATE + 0)
-#define SIOCSKEEPPERIOD        (SIOCDEVPRIVATE + 1)
-#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
-#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
-
-/* Packet encapsulations for net-interfaces */
-#define ISDN_NET_ENCAP_ETHER      0
-#define ISDN_NET_ENCAP_RAWIP      1
-#define ISDN_NET_ENCAP_IPTYP      2
-#define ISDN_NET_ENCAP_CISCOHDLC  3 /* Without SLARP and keepalive */
-#define ISDN_NET_ENCAP_SYNCPPP    4
-#define ISDN_NET_ENCAP_UIHDLC     5
-#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive    */
-#define ISDN_NET_ENCAP_X25IFACE   7 /* Documentation/networking/x25-iface.txt */
-#define ISDN_NET_ENCAP_MAX_ENCAP  ISDN_NET_ENCAP_X25IFACE
-
-/* Facility which currently uses an ISDN-channel */
-#define ISDN_USAGE_NONE       0
-#define ISDN_USAGE_RAW        1
-#define ISDN_USAGE_MODEM      2
-#define ISDN_USAGE_NET        3
-#define ISDN_USAGE_VOICE      4
-#define ISDN_USAGE_FAX        5
-#define ISDN_USAGE_MASK       7 /* Mask to get plain usage */
-#define ISDN_USAGE_DISABLED  32 /* This bit is set, if channel is disabled */
-#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
-#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing  */
-
-#define ISDN_MODEM_NUMREG    24        /* Number of Modem-Registers        */
-#define ISDN_LMSNLEN         255 /* Length of tty's Listen-MSN string */
-#define ISDN_CMSGLEN        50  /* Length of CONNECT-Message to add for Modem */
-
-#define ISDN_MSNLEN          32
-#define NET_DV 0x06  /* Data version for isdn_net_ioctl_cfg   */
-#define TTY_DV 0x06  /* Data version for iprofd etc.          */
-
-#define INF_DV 0x01  /* Data version for /dev/isdninfo        */
-
-typedef struct {
-  char drvid[25];
-  unsigned long arg;
-} isdn_ioctl_struct;
-
-typedef struct {
-  char name[10];
-  char phone[ISDN_MSNLEN];
-  int  outgoing;
-} isdn_net_ioctl_phone;
-
-typedef struct {
-  char name[10];     /* Name of interface                     */
-  char master[10];   /* Name of Master for Bundling           */
-  char slave[10];    /* Name of Slave for Bundling            */
-  char eaz[256];     /* EAZ/MSN                               */
-  char drvid[25];    /* DriverId for Bindings                 */
-  int  onhtime;      /* Hangup-Timeout                        */
-  int  charge;       /* Charge-Units                          */
-  int  l2_proto;     /* Layer-2 protocol                      */
-  int  l3_proto;     /* Layer-3 protocol                      */
-  int  p_encap;      /* Encapsulation                         */
-  int  exclusive;    /* Channel, if bound exclusive           */
-  int  dialmax;      /* Dial Retry-Counter                    */
-  int  slavedelay;   /* Delay until slave starts up           */
-  int  cbdelay;      /* Delay before Callback                 */
-  int  chargehup;    /* Flag: Charge-Hangup                   */
-  int  ihup;         /* Flag: Hangup-Timeout on incoming line */
-  int  secure;       /* Flag: Secure                          */
-  int  callback;     /* Flag: Callback                        */
-  int  cbhup;        /* Flag: Reject Call before Callback     */
-  int  pppbind;      /* ippp device for bindings              */
-  int  chargeint;    /* Use fixed charge interval length      */
-  int  triggercps;   /* BogoCPS needed for triggering slave   */
-  int  dialtimeout;  /* Dial-Timeout                          */
-  int  dialwait;     /* Time to wait after failed dial        */
-  int  dialmode;     /* Flag: off / on / auto                 */
-} isdn_net_ioctl_cfg;
-
-#define ISDN_NET_DIALMODE_MASK  0xC0    /* bits for status                */
-#define ISDN_NET_DM_OFF                0x00    /* this interface is stopped      */
-#define ISDN_NET_DM_MANUAL     0x40    /* this interface is on (manual)  */
-#define ISDN_NET_DM_AUTO       0x80    /* this interface is autodial     */
-#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
-
-#ifdef __KERNEL__
 
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -163,6 +36,7 @@ typedef struct {
 #include <linux/skbuff.h>
 #include <linux/tcp.h>
 #include <linux/mutex.h>
+#include <uapi/linux/isdn.h>
 
 #define ISDN_TTY_MAJOR    43
 #define ISDN_TTYAUX_MAJOR 44
@@ -595,6 +469,4 @@ typedef struct isdn_devt {
 extern isdn_dev *dev;
 
 
-#endif /* __KERNEL__ */
-
 #endif /* __ISDN_H__ */
index a5a50f52380784115f5a1def2e76ac103055408f..19ab361f9f07d06ded9a78c379c733eea68a537a 100644 (file)
@@ -9,26 +9,12 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  */
-
 #ifndef _LINUX_ISDN_DIVERTIF_H
 #define _LINUX_ISDN_DIVERTIF_H
 
-/***********************************************************/
-/* magic value is also used to control version information */
-/***********************************************************/
-#define DIVERT_IF_MAGIC 0x25873401
-#define DIVERT_CMD_REG  0x00  /* register command */
-#define DIVERT_CMD_REL  0x01  /* release command */
-#define DIVERT_NO_ERR   0x00  /* return value no error */
-#define DIVERT_CMD_ERR  0x01  /* invalid cmd */
-#define DIVERT_VER_ERR  0x02  /* magic/version invalid */
-#define DIVERT_REG_ERR  0x03  /* module already registered */
-#define DIVERT_REL_ERR  0x04  /* module not registered */
-#define DIVERT_REG_NAME isdn_register_divert
-
-#ifdef __KERNEL__
 #include <linux/isdnif.h>
 #include <linux/types.h>
+#include <uapi/linux/isdn_divertif.h>
 
 /***************************************************************/
 /* structure exchanging data between isdn hl and divert module */
@@ -46,6 +32,4 @@ typedef struct
 /* function register */
 /*********************/
 extern int DIVERT_REG_NAME(isdn_divert_if *);
-#endif
-
 #endif /* _LINUX_ISDN_DIVERTIF_H */
index 8687a7dc0632378c4828b2c58664ec638227919d..d5f62bc5f4beb8499983d3c3a682b9c468c74b9e 100644 (file)
@@ -9,68 +9,16 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  */
-
 #ifndef _LINUX_ISDN_PPP_H
 #define _LINUX_ISDN_PPP_H
 
-#define CALLTYPE_INCOMING 0x1
-#define CALLTYPE_OUTGOING 0x2
-#define CALLTYPE_CALLBACK 0x4
-
-#define IPPP_VERSION    "2.2.0"
-
-struct pppcallinfo
-{
-  int calltype;
-  unsigned char local_num[64];
-  unsigned char remote_num[64];
-  int charge_units;
-};
-
-#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
-#define PPPIOCBUNDLE   _IOW('t',129,int)
-#define PPPIOCGMPFLAGS _IOR('t',130,int)
-#define PPPIOCSMPFLAGS _IOW('t',131,int)
-#define PPPIOCSMPMTU   _IOW('t',132,int)
-#define PPPIOCSMPMRU   _IOW('t',133,int)
-#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
-#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
-#define PPPIOCGIFNAME      _IOR('t',136, char [IFNAMSIZ] )
-
-
-#define SC_MP_PROT       0x00000200
-#define SC_REJ_MP_PROT   0x00000400
-#define SC_OUT_SHORT_SEQ 0x00000800
-#define SC_IN_SHORT_SEQ  0x00004000
-
-#define SC_DECOMP_ON           0x01
-#define SC_COMP_ON             0x02
-#define SC_DECOMP_DISCARD      0x04
-#define SC_COMP_DISCARD                0x08
-#define SC_LINK_DECOMP_ON      0x10
-#define SC_LINK_COMP_ON                0x20
-#define SC_LINK_DECOMP_DISCARD 0x40
-#define SC_LINK_COMP_DISCARD   0x80
-
-#define ISDN_PPP_COMP_MAX_OPTIONS 16
-
-#define IPPP_COMP_FLAG_XMIT 0x1
-#define IPPP_COMP_FLAG_LINK 0x2
-
-struct isdn_ppp_comp_data {
-  int num;
-  unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
-  int optlen;
-  int flags;
-};
-
-#ifdef __KERNEL__
 
 
 
 #ifdef CONFIG_IPPP_FILTER
 #include <linux/filter.h>
 #endif
+#include <uapi/linux/isdn_ppp.h>
 
 #define DECOMP_ERR_NOMEM       (-10)
 
@@ -244,5 +192,4 @@ struct ippp_struct {
   unsigned long compflags;
 };
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_ISDN_PPP_H */
index b8c23f88dd549dac4d9ca981ea90a16188fc1c8b..0fc6ff276221025b4d625674023df67e72589b42 100644 (file)
  * of the GNU General Public License, incorporated herein by reference.
  *
  */
-
 #ifndef __ISDNIF_H__
 #define __ISDNIF_H__
 
 
-/*
- * Values for general protocol-selection
- */
-#define ISDN_PTYPE_UNKNOWN   0   /* Protocol undefined   */
-#define ISDN_PTYPE_1TR6      1   /* german 1TR6-protocol */
-#define ISDN_PTYPE_EURO      2   /* EDSS1-protocol       */
-#define ISDN_PTYPE_LEASED    3   /* for leased lines     */
-#define ISDN_PTYPE_NI1       4   /* US NI-1 protocol     */
-#define ISDN_PTYPE_MAX       7   /* Max. 8 Protocols     */
-
-/*
- * Values for Layer-2-protocol-selection
- */
-#define ISDN_PROTO_L2_X75I   0   /* X75/LAPB with I-Frames            */
-#define ISDN_PROTO_L2_X75UI  1   /* X75/LAPB with UI-Frames           */
-#define ISDN_PROTO_L2_X75BUI 2   /* X75/LAPB with UI-Frames           */
-#define ISDN_PROTO_L2_HDLC   3   /* HDLC                              */
-#define ISDN_PROTO_L2_TRANS  4   /* Transparent (Voice)               */
-#define ISDN_PROTO_L2_X25DTE 5   /* X25/LAPB DTE mode                 */
-#define ISDN_PROTO_L2_X25DCE 6   /* X25/LAPB DCE mode                 */
-#define ISDN_PROTO_L2_V11096 7   /* V.110 bitrate adaption 9600 Baud  */
-#define ISDN_PROTO_L2_V11019 8   /* V.110 bitrate adaption 19200 Baud */
-#define ISDN_PROTO_L2_V11038 9   /* V.110 bitrate adaption 38400 Baud */
-#define ISDN_PROTO_L2_MODEM  10  /* Analog Modem on Board */
-#define ISDN_PROTO_L2_FAX    11  /* Fax Group 2/3         */
-#define ISDN_PROTO_L2_HDLC_56K 12   /* HDLC 56k                          */
-#define ISDN_PROTO_L2_MAX    15  /* Max. 16 Protocols                 */
-
-/*
- * Values for Layer-3-protocol-selection
- */
-#define ISDN_PROTO_L3_TRANS    0       /* Transparent */
-#define ISDN_PROTO_L3_TRANSDSP 1       /* Transparent with DSP */
-#define ISDN_PROTO_L3_FCLASS2  2       /* Fax Group 2/3 CLASS 2 */
-#define ISDN_PROTO_L3_FCLASS1  3       /* Fax Group 2/3 CLASS 1 */
-#define ISDN_PROTO_L3_MAX      7       /* Max. 8 Protocols */
-
-#ifdef __KERNEL__
-
 #include <linux/skbuff.h>
+#include <uapi/linux/isdnif.h>
 
 /***************************************************************************/
 /* Extensions made by Werner Cornelius (werner@ikt.de)                     */
@@ -541,6 +502,4 @@ typedef struct {
 extern int register_isdn(isdn_if*);
 #include <asm/uaccess.h>
 
-#endif /* __KERNEL__ */
-
 #endif /* __ISDNIF_H__ */
index 47199b13e0eb9c1f102acd1e188a23be5c53b1cc..cbf2aa9e93b9f6ac27db06af2340615c3d894b77 100644 (file)
@@ -1,12 +1,8 @@
-#ifndef _LINUX_JOYSTICK_H
-#define _LINUX_JOYSTICK_H
-
 /*
  *  Copyright (C) 1996-2000 Vojtech Pavlik
  *
  *  Sponsored by SuSE
  */
-
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  */
+#ifndef _LINUX_JOYSTICK_H
+#define _LINUX_JOYSTICK_H
 
-#include <linux/types.h>
-#include <linux/input.h>
-
-/*
- * Version
- */
-
-#define JS_VERSION             0x020100
-
-/*
- * Types and constants for reading from /dev/js
- */
-
-#define JS_EVENT_BUTTON                0x01    /* button pressed/released */
-#define JS_EVENT_AXIS          0x02    /* joystick moved */
-#define JS_EVENT_INIT          0x80    /* initial state of device */
-
-struct js_event {
-       __u32 time;     /* event timestamp in milliseconds */
-       __s16 value;    /* value */
-       __u8 type;      /* event type */
-       __u8 number;    /* axis/button number */
-};
-
-/*
- * IOCTL commands for joystick driver
- */
-
-#define JSIOCGVERSION          _IOR('j', 0x01, __u32)                          /* get driver version */
-
-#define JSIOCGAXES             _IOR('j', 0x11, __u8)                           /* get number of axes */
-#define JSIOCGBUTTONS          _IOR('j', 0x12, __u8)                           /* get number of buttons */
-#define JSIOCGNAME(len)                _IOC(_IOC_READ, 'j', 0x13, len)                 /* get identifier string */
-
-#define JSIOCSCORR             _IOW('j', 0x21, struct js_corr)                 /* set correction values */
-#define JSIOCGCORR             _IOR('j', 0x22, struct js_corr)                 /* get correction values */
-
-#define JSIOCSAXMAP            _IOW('j', 0x31, __u8[ABS_CNT])                  /* set axis mapping */
-#define JSIOCGAXMAP            _IOR('j', 0x32, __u8[ABS_CNT])                  /* get axis mapping */
-#define JSIOCSBTNMAP           _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])  /* set button mapping */
-#define JSIOCGBTNMAP           _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])  /* get button mapping */
-
-/*
- * Types and constants for get/set correction
- */
-
-#define JS_CORR_NONE           0x00    /* returns raw values */
-#define JS_CORR_BROKEN         0x01    /* broken line */
-
-struct js_corr {
-       __s32 coef[8];
-       __s16 prec;
-       __u16 type;
-};
-
-/*
- * v0.x compatibility definitions
- */
-
-#define JS_RETURN              sizeof(struct JS_DATA_TYPE)
-#define JS_TRUE                        1
-#define JS_FALSE               0
-#define JS_X_0                 0x01
-#define JS_Y_0                 0x02
-#define JS_X_1                 0x04
-#define JS_Y_1                 0x08
-#define JS_MAX                 2
-
-#define JS_DEF_TIMEOUT         0x1300
-#define JS_DEF_CORR            0
-#define JS_DEF_TIMELIMIT       10L
-
-#define JS_SET_CAL             1
-#define JS_GET_CAL             2
-#define JS_SET_TIMEOUT         3
-#define JS_GET_TIMEOUT         4
-#define JS_SET_TIMELIMIT       5
-#define JS_GET_TIMELIMIT       6
-#define JS_GET_ALL             7
-#define JS_SET_ALL             8
-
-struct JS_DATA_TYPE {
-       __s32 buttons;
-       __s32 x;
-       __s32 y;
-};
-
-struct JS_DATA_SAVE_TYPE_32 {
-       __s32 JS_TIMEOUT;
-       __s32 BUSY;
-       __s32 JS_EXPIRETIME;
-       __s32 JS_TIMELIMIT;
-       struct JS_DATA_TYPE JS_SAVE;
-       struct JS_DATA_TYPE JS_CORR;
-};
-
-struct JS_DATA_SAVE_TYPE_64 {
-       __s32 JS_TIMEOUT;
-       __s32 BUSY;
-       __s64 JS_EXPIRETIME;
-       __s64 JS_TIMELIMIT;
-       struct JS_DATA_TYPE JS_SAVE;
-       struct JS_DATA_TYPE JS_CORR;
-};
+#include <uapi/linux/joystick.h>
 
-#ifdef __KERNEL__
 #if BITS_PER_LONG == 64
 #define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
 #elif BITS_PER_LONG == 32
@@ -140,6 +34,4 @@ struct JS_DATA_SAVE_TYPE_64 {
 #else
 #error Unexpected BITS_PER_LONG
 #endif
-#endif
-
 #endif /* _LINUX_JOYSTICK_H */
index c36d8476db555711a7bb921fd783f4e51c7f1359..25bd17fad239f44da6e2576413fc4a43e1342ede 100644 (file)
@@ -1,186 +1,7 @@
 #ifndef _LINUX_KD_H
 #define _LINUX_KD_H
-#include <linux/types.h>
-#include <linux/compiler.h>
 
-/* 0x4B is 'K', to avoid collision with termios and vt */
+#include <uapi/linux/kd.h>
 
-#define GIO_FONT       0x4B60  /* gets font in expanded form */
-#define PIO_FONT       0x4B61  /* use font in expanded form */
-
-#define GIO_FONTX      0x4B6B  /* get font using struct consolefontdesc */
-#define PIO_FONTX      0x4B6C  /* set font using struct consolefontdesc */
-struct consolefontdesc {
-       unsigned short charcount;       /* characters in font (256 or 512) */
-       unsigned short charheight;      /* scan lines per character (1-32) */
-       char __user *chardata;          /* font data in expanded form */
-};
-
-#define PIO_FONTRESET   0x4B6D /* reset to default font */
-
-#define GIO_CMAP       0x4B70  /* gets colour palette on VGA+ */
-#define PIO_CMAP       0x4B71  /* sets colour palette on VGA+ */
-
-#define KIOCSOUND      0x4B2F  /* start sound generation (0 for off) */
-#define KDMKTONE       0x4B30  /* generate tone */
-
-#define KDGETLED       0x4B31  /* return current led state */
-#define KDSETLED       0x4B32  /* set led state [lights, not flags] */
-#define        LED_SCR         0x01    /* scroll lock led */
-#define        LED_NUM         0x02    /* num lock led */
-#define        LED_CAP         0x04    /* caps lock led */
-
-#define KDGKBTYPE      0x4B33  /* get keyboard type */
-#define        KB_84           0x01
-#define        KB_101          0x02    /* this is what we always answer */
-#define        KB_OTHER        0x03
-
-#define KDADDIO                0x4B34  /* add i/o port as valid */
-#define KDDELIO                0x4B35  /* del i/o port as valid */
-#define KDENABIO       0x4B36  /* enable i/o to video board */
-#define KDDISABIO      0x4B37  /* disable i/o to video board */
-
-#define KDSETMODE      0x4B3A  /* set text/graphics mode */
-#define                KD_TEXT         0x00
-#define                KD_GRAPHICS     0x01
-#define                KD_TEXT0        0x02    /* obsolete */
-#define                KD_TEXT1        0x03    /* obsolete */
-#define KDGETMODE      0x4B3B  /* get current mode */
-
-#define KDMAPDISP      0x4B3C  /* map display into address space */
-#define KDUNMAPDISP    0x4B3D  /* unmap display from address space */
-
-typedef char scrnmap_t;
-#define                E_TABSZ         256
-#define GIO_SCRNMAP    0x4B40  /* get screen mapping from kernel */
-#define PIO_SCRNMAP    0x4B41  /* put screen mapping table in kernel */
-#define GIO_UNISCRNMAP  0x4B69 /* get full Unicode screen mapping */
-#define PIO_UNISCRNMAP  0x4B6A  /* set full Unicode screen mapping */
-
-#define GIO_UNIMAP     0x4B66  /* get unicode-to-font mapping from kernel */
-struct unipair {
-       unsigned short unicode;
-       unsigned short fontpos;
-};
-struct unimapdesc {
-       unsigned short entry_ct;
-       struct unipair __user *entries;
-};
-#define PIO_UNIMAP     0x4B67  /* put unicode-to-font mapping in kernel */
-#define PIO_UNIMAPCLR  0x4B68  /* clear table, possibly advise hash algorithm */
-struct unimapinit {
-       unsigned short advised_hashsize;  /* 0 if no opinion */
-       unsigned short advised_hashstep;  /* 0 if no opinion */
-       unsigned short advised_hashlevel; /* 0 if no opinion */
-};
-
-#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
-#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
-
-#define                K_RAW           0x00
-#define                K_XLATE         0x01
-#define                K_MEDIUMRAW     0x02
-#define                K_UNICODE       0x03
-#define                K_OFF           0x04
-#define KDGKBMODE      0x4B44  /* gets current keyboard mode */
-#define KDSKBMODE      0x4B45  /* sets current keyboard mode */
-
-#define                K_METABIT       0x03
-#define                K_ESCPREFIX     0x04
-#define KDGKBMETA      0x4B62  /* gets meta key handling mode */
-#define KDSKBMETA      0x4B63  /* sets meta key handling mode */
-
-#define                K_SCROLLLOCK    0x01
-#define                K_NUMLOCK       0x02
-#define                K_CAPSLOCK      0x04
-#define        KDGKBLED        0x4B64  /* get led flags (not lights) */
-#define        KDSKBLED        0x4B65  /* set led flags (not lights) */
-
-struct kbentry {
-       unsigned char kb_table;
-       unsigned char kb_index;
-       unsigned short kb_value;
-};
-#define                K_NORMTAB       0x00
-#define                K_SHIFTTAB      0x01
-#define                K_ALTTAB        0x02
-#define                K_ALTSHIFTTAB   0x03
-
-#define KDGKBENT       0x4B46  /* gets one entry in translation table */
-#define KDSKBENT       0x4B47  /* sets one entry in translation table */
-
-struct kbsentry {
-       unsigned char kb_func;
-       unsigned char kb_string[512];
-};
-#define KDGKBSENT      0x4B48  /* gets one function key string entry */
-#define KDSKBSENT      0x4B49  /* sets one function key string entry */
-
-struct kbdiacr {
-        unsigned char diacr, base, result;
-};
-struct kbdiacrs {
-        unsigned int kb_cnt;    /* number of entries in following array */
-       struct kbdiacr kbdiacr[256];    /* MAX_DIACR from keyboard.h */
-};
-#define KDGKBDIACR      0x4B4A  /* read kernel accent table */
-#define KDSKBDIACR      0x4B4B  /* write kernel accent table */
-
-struct kbdiacruc {
-       unsigned int diacr, base, result;
-};
-struct kbdiacrsuc {
-        unsigned int kb_cnt;    /* number of entries in following array */
-       struct kbdiacruc kbdiacruc[256];    /* MAX_DIACR from keyboard.h */
-};
-#define KDGKBDIACRUC    0x4BFA  /* read kernel accent table - UCS */
-#define KDSKBDIACRUC    0x4BFB  /* write kernel accent table - UCS */
-
-struct kbkeycode {
-       unsigned int scancode, keycode;
-};
-#define KDGETKEYCODE   0x4B4C  /* read kernel keycode table entry */
-#define KDSETKEYCODE   0x4B4D  /* write kernel keycode table entry */
-
-#define KDSIGACCEPT    0x4B4E  /* accept kbd generated signals */
-
-struct kbd_repeat {
-       int delay;      /* in msec; <= 0: don't change */
-       int period;     /* in msec; <= 0: don't change */
-                       /* earlier this field was misnamed "rate" */
-};
-
-#define KDKBDREP        0x4B52  /* set keyboard delay/repeat rate;
-                                * actually used values are returned */
-
-#define KDFONTOP       0x4B72  /* font operations */
-
-struct console_font_op {
-       unsigned int op;        /* operation code KD_FONT_OP_* */
-       unsigned int flags;     /* KD_FONT_FLAG_* */
-       unsigned int width, height;     /* font size */
-       unsigned int charcount;
-       unsigned char __user *data;     /* font data with height fixed to 32 */
-};
-
-struct console_font {
-       unsigned int width, height;     /* font size */
-       unsigned int charcount;
-       unsigned char *data;    /* font data with height fixed to 32 */
-};
-
-#define KD_FONT_OP_SET         0       /* Set font */
-#define KD_FONT_OP_GET         1       /* Get font */
-#define KD_FONT_OP_SET_DEFAULT 2       /* Set font to default, data points to name / NULL */
-#define KD_FONT_OP_COPY                3       /* Copy from another console */
-
-#define KD_FONT_FLAG_DONT_RECALC       1       /* Don't recalculate hw charcell size [compat] */
-#ifdef __KERNEL__
 #define KD_FONT_FLAG_OLD               0x80000000      /* Invoked via old interface [compat] */
-#endif
-
-/* note: 0x4B00-0x4B4E all have had a value at some time;
-   don't reuse for the time being */
-/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
-
 #endif /* _LINUX_KD_H */
index 2dacab8beccb9753aa8d3c6b0307636eece13758..c838abe3ee0a80dfccfb2bfbf1bc1e5067fa9dca 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_KDEV_T_H
 #define _LINUX_KDEV_T_H
-#ifdef __KERNEL__
+
+#include <uapi/linux/kdev_t.h>
+
 #define MINORBITS      20
 #define MINORMASK      ((1U << MINORBITS) - 1)
 
@@ -87,14 +89,4 @@ static inline unsigned sysv_minor(u32 dev)
        return dev & 0x3ffff;
 }
 
-#else /* __KERNEL__ */
-
-/*
-Some programs want their definitions of MAJOR and MINOR and MKDEV
-from the kernel sources. These must be the externally visible ones.
-*/
-#define MAJOR(dev)     ((dev)>>8)
-#define MINOR(dev)     ((dev) & 0xff)
-#define MKDEV(ma,mi)   ((ma)<<8 | (mi))
-#endif /* __KERNEL__ */
 #endif
index a1bdf6966357b6b914d101c7545ef306fa395bdb..546eb6a76934ba9fa515e81d43893deea0dddfe6 100644 (file)
@@ -1,38 +1,8 @@
 #ifndef LINUX_KERNEL_PAGE_FLAGS_H
 #define LINUX_KERNEL_PAGE_FLAGS_H
 
-/*
- * Stable page flag bits exported to user space
- */
-
-#define KPF_LOCKED             0
-#define KPF_ERROR              1
-#define KPF_REFERENCED         2
-#define KPF_UPTODATE           3
-#define KPF_DIRTY              4
-#define KPF_LRU                        5
-#define KPF_ACTIVE             6
-#define KPF_SLAB               7
-#define KPF_WRITEBACK          8
-#define KPF_RECLAIM            9
-#define KPF_BUDDY              10
-
-/* 11-20: new additions in 2.6.31 */
-#define KPF_MMAP               11
-#define KPF_ANON               12
-#define KPF_SWAPCACHE          13
-#define KPF_SWAPBACKED         14
-#define KPF_COMPOUND_HEAD      15
-#define KPF_COMPOUND_TAIL      16
-#define KPF_HUGE               17
-#define KPF_UNEVICTABLE                18
-#define KPF_HWPOISON           19
-#define KPF_NOPAGE             20
+#include <uapi/linux/kernel-page-flags.h>
 
-#define KPF_KSM                        21
-#define KPF_THP                        22
-
-#ifdef __KERNEL__
 
 /* kernel hacking assistances
  * WARNING: subject to change, never rely on them!
@@ -46,6 +16,4 @@
 #define KPF_ARCH               38
 #define KPF_UNCACHED           39
 
-#endif /* __KERNEL__ */
-
 #endif /* LINUX_KERNEL_PAGE_FLAGS_H */
index 2451f1f7a1d969f29bb2a3137c846566bfaf614a..a123b13b70fd80cb12def4c100ee198606b7c6b6 100644 (file)
@@ -1,15 +1,6 @@
 #ifndef _LINUX_KERNEL_H
 #define _LINUX_KERNEL_H
 
-#include <linux/sysinfo.h>
-
-/*
- * 'kernel.h' contains some often-used function prototypes etc
- */
-#define __ALIGN_KERNEL(x, a)           __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
-#define __ALIGN_KERNEL_MASK(x, mask)   (((x) + (mask)) & ~(mask))
-
-#ifdef __KERNEL__
 
 #include <stdarg.h>
 #include <linux/linkage.h>
@@ -22,6 +13,7 @@
 #include <linux/printk.h>
 #include <linux/dynamic_debug.h>
 #include <asm/byteorder.h>
+#include <uapi/linux/kernel.h>
 
 #define USHRT_MAX      ((u16)(~0U))
 #define SHRT_MAX       ((s16)(USHRT_MAX>>1))
@@ -716,6 +708,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
 
 extern int do_sysinfo(struct sysinfo *info);
 
-#endif /* __KERNEL__ */
-
 #endif
index 9c2683929fd3506778507af74e099073aaa3d9a9..9be37da93680a4d688c339a93135e1afa974f791 100644 (file)
@@ -6,49 +6,15 @@
  * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
  * 
  */
-
 #ifndef __KERNELCAPI_H__
 #define __KERNELCAPI_H__
 
-#define CAPI_MAXAPPL   240     /* maximum number of applications  */
-#define CAPI_MAXCONTR  32      /* maximum number of controller    */
-#define CAPI_MAXDATAWINDOW     8
-
-
-typedef struct kcapi_flagdef {
-       int contr;
-       int flag;
-} kcapi_flagdef;
-
-typedef struct kcapi_carddef {
-       char            driver[32];
-       unsigned int    port;
-       unsigned        irq;
-       unsigned int    membase;
-       int             cardnr;
-} kcapi_carddef;
-
-/* new ioctls >= 10 */
-#define KCAPI_CMD_TRACE                10
-#define KCAPI_CMD_ADDCARD      11      /* OBSOLETE */
-
-/* 
- * flag > 2 => trace also data
- * flag & 1 => show trace
- */
-#define KCAPI_TRACE_OFF                        0
-#define KCAPI_TRACE_SHORT_NO_DATA      1
-#define KCAPI_TRACE_FULL_NO_DATA       2
-#define KCAPI_TRACE_SHORT              3
-#define KCAPI_TRACE_FULL               4
-
-
-#ifdef __KERNEL__
 
 #include <linux/list.h>
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
 #include <linux/notifier.h>
+#include <uapi/linux/kernelcapi.h>
 
 struct capi20_appl {
        u16 applid;
@@ -150,6 +116,4 @@ typedef enum {
        CapiCallGivenToOtherApplication                 = 0x3304,
 } CAPI_REASON;
 
-#endif                         /* __KERNEL__ */
-
 #endif                         /* __KERNELCAPI_H__ */
index 37c5f7261142c24fa582121d2bdfd9479285f681..d0b8458a703a25503bcfe75f39ef804f36636aea 100644 (file)
@@ -1,57 +1,8 @@
 #ifndef LINUX_KEXEC_H
 #define LINUX_KEXEC_H
 
-/* kexec system call -  It loads the new kernel to boot into.
- * kexec does not sync, or unmount filesystems so if you need
- * that to happen you need to do that yourself.
- */
-
-#include <linux/types.h>
-
-/* kexec flags for different usage scenarios */
-#define KEXEC_ON_CRASH         0x00000001
-#define KEXEC_PRESERVE_CONTEXT 0x00000002
-#define KEXEC_ARCH_MASK                0xffff0000
-
-/* These values match the ELF architecture values.
- * Unless there is a good reason that should continue to be the case.
- */
-#define KEXEC_ARCH_DEFAULT ( 0 << 16)
-#define KEXEC_ARCH_386     ( 3 << 16)
-#define KEXEC_ARCH_X86_64  (62 << 16)
-#define KEXEC_ARCH_PPC     (20 << 16)
-#define KEXEC_ARCH_PPC64   (21 << 16)
-#define KEXEC_ARCH_IA_64   (50 << 16)
-#define KEXEC_ARCH_ARM     (40 << 16)
-#define KEXEC_ARCH_S390    (22 << 16)
-#define KEXEC_ARCH_SH      (42 << 16)
-#define KEXEC_ARCH_MIPS_LE (10 << 16)
-#define KEXEC_ARCH_MIPS    ( 8 << 16)
-
-/* The artificial cap on the number of segments passed to kexec_load. */
-#define KEXEC_SEGMENT_MAX 16
-
-#ifndef __KERNEL__
-/*
- * This structure is used to hold the arguments that are used when
- * loading  kernel binaries.
- */
-struct kexec_segment {
-       const void *buf;
-       size_t bufsz;
-       const void *mem;
-       size_t memsz;
-};
-
-/* Load a new kernel image as described by the kexec_segment array
- * consisting of passed number of segments at the entry-point address.
- * The flags allow different useage types.
- */
-extern int kexec_load(void *, size_t, struct kexec_segment *,
-               unsigned long int);
-#endif /* __KERNEL__ */
+#include <uapi/linux/kexec.h>
 
-#ifdef __KERNEL__
 #ifdef CONFIG_KEXEC
 #include <linux/list.h>
 #include <linux/linkage.h>
@@ -258,5 +209,4 @@ struct task_struct;
 static inline void crash_kexec(struct pt_regs *regs) { }
 static inline int kexec_should_crash(struct task_struct *p) { return 0; }
 #endif /* CONFIG_KEXEC */
-#endif /* __KERNEL__ */
 #endif /* LINUX_KEXEC_H */
index f0c651cda7b0b7a367b41160ed88ea487838a72b..518a53afb9ea24b301d87d4af6c824bca5fc5548 100644 (file)
@@ -26,6 +26,27 @@ struct key_construction {
        struct key      *authkey;/* authorisation for key being constructed */
 };
 
+/*
+ * Pre-parsed payload, used by key add, update and instantiate.
+ *
+ * This struct will be cleared and data and datalen will be set with the data
+ * and length parameters from the caller and quotalen will be set from
+ * def_datalen from the key type.  Then if the preparse() op is provided by the
+ * key type, that will be called.  Then the struct will be passed to the
+ * instantiate() or the update() op.
+ *
+ * If the preparse() op is given, the free_preparse() op will be called to
+ * clear the contents.
+ */
+struct key_preparsed_payload {
+       char            *description;   /* Proposed key description (or NULL) */
+       void            *type_data[2];  /* Private key-type data */
+       void            *payload;       /* Proposed payload */
+       const void      *data;          /* Raw data */
+       size_t          datalen;        /* Raw datalen */
+       size_t          quotalen;       /* Quota length for proposed payload */
+};
+
 typedef int (*request_key_actor_t)(struct key_construction *key,
                                   const char *op, void *aux);
 
@@ -45,18 +66,28 @@ struct key_type {
        /* vet a description */
        int (*vet_description)(const char *description);
 
+       /* Preparse the data blob from userspace that is to be the payload,
+        * generating a proposed description and payload that will be handed to
+        * the instantiate() and update() ops.
+        */
+       int (*preparse)(struct key_preparsed_payload *prep);
+
+       /* Free a preparse data structure.
+        */
+       void (*free_preparse)(struct key_preparsed_payload *prep);
+
        /* instantiate a key of this type
         * - this method should call key_payload_reserve() to determine if the
         *   user's quota will hold the payload
         */
-       int (*instantiate)(struct key *key, const void *data, size_t datalen);
+       int (*instantiate)(struct key *key, struct key_preparsed_payload *prep);
 
        /* update a key of this type (optional)
         * - this method should call key_payload_reserve() to recalculate the
         *   quota consumption
         * - the key must be locked against read when modifying
         */
-       int (*update)(struct key *key, const void *data, size_t datalen);
+       int (*update)(struct key *key, struct key_preparsed_payload *prep);
 
        /* match a key against a description */
        int (*match)(const struct key *key, const void *desc);
index 86e5214ae73508649099a2133e7fd654f2acc033..131ed5146521cd609488c2dc2d65620fdd96386f 100644 (file)
@@ -1,28 +1,8 @@
 #ifndef __LINUX_KEYBOARD_H
 #define __LINUX_KEYBOARD_H
 
-#include <linux/wait.h>
+#include <uapi/linux/keyboard.h>
 
-#define KG_SHIFT       0
-#define KG_CTRL                2
-#define KG_ALT         3
-#define KG_ALTGR       1
-#define KG_SHIFTL      4
-#define KG_KANASHIFT   4
-#define KG_SHIFTR      5
-#define KG_CTRLL       6
-#define KG_CTRLR       7
-#define KG_CAPSSHIFT   8
-
-#define NR_SHIFT       9
-
-#define NR_KEYS                256
-#define MAX_NR_KEYMAPS 256
-/* This means 128Kb if all keymaps are allocated. Only the superuser
-       may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
-#define MAX_NR_OF_USER_KEYMAPS 256     /* should be at least 7 */
-
-#ifdef __KERNEL__
 struct notifier_block;
 extern unsigned short *key_maps[MAX_NR_KEYMAPS];
 extern unsigned short plain_map[NR_KEYS];
@@ -38,422 +18,3 @@ struct keyboard_notifier_param {
 extern int register_keyboard_notifier(struct notifier_block *nb);
 extern int unregister_keyboard_notifier(struct notifier_block *nb);
 #endif
-
-#define MAX_NR_FUNC    256     /* max nr of strings assigned to keys */
-
-#define KT_LATIN       0       /* we depend on this being zero */
-#define KT_LETTER      11      /* symbol that can be acted upon by CapsLock */
-#define KT_FN          1
-#define KT_SPEC                2
-#define KT_PAD         3
-#define KT_DEAD                4
-#define KT_CONS                5
-#define KT_CUR         6
-#define KT_SHIFT       7
-#define KT_META                8
-#define KT_ASCII       9
-#define KT_LOCK                10
-#define KT_SLOCK       12
-#define KT_DEAD2       13
-#define KT_BRL         14
-
-#define K(t,v)         (((t)<<8)|(v))
-#define KTYP(x)                ((x) >> 8)
-#define KVAL(x)                ((x) & 0xff)
-
-#define K_F1           K(KT_FN,0)
-#define K_F2           K(KT_FN,1)
-#define K_F3           K(KT_FN,2)
-#define K_F4           K(KT_FN,3)
-#define K_F5           K(KT_FN,4)
-#define K_F6           K(KT_FN,5)
-#define K_F7           K(KT_FN,6)
-#define K_F8           K(KT_FN,7)
-#define K_F9           K(KT_FN,8)
-#define K_F10          K(KT_FN,9)
-#define K_F11          K(KT_FN,10)
-#define K_F12          K(KT_FN,11)
-#define K_F13          K(KT_FN,12)
-#define K_F14          K(KT_FN,13)
-#define K_F15          K(KT_FN,14)
-#define K_F16          K(KT_FN,15)
-#define K_F17          K(KT_FN,16)
-#define K_F18          K(KT_FN,17)
-#define K_F19          K(KT_FN,18)
-#define K_F20          K(KT_FN,19)
-#define K_FIND         K(KT_FN,20)
-#define K_INSERT       K(KT_FN,21)
-#define K_REMOVE       K(KT_FN,22)
-#define K_SELECT       K(KT_FN,23)
-#define K_PGUP         K(KT_FN,24) /* PGUP is a synonym for PRIOR */
-#define K_PGDN         K(KT_FN,25) /* PGDN is a synonym for NEXT */
-#define K_MACRO                K(KT_FN,26)
-#define K_HELP         K(KT_FN,27)
-#define K_DO           K(KT_FN,28)
-#define K_PAUSE                K(KT_FN,29)
-#define K_F21          K(KT_FN,30)
-#define K_F22          K(KT_FN,31)
-#define K_F23          K(KT_FN,32)
-#define K_F24          K(KT_FN,33)
-#define K_F25          K(KT_FN,34)
-#define K_F26          K(KT_FN,35)
-#define K_F27          K(KT_FN,36)
-#define K_F28          K(KT_FN,37)
-#define K_F29          K(KT_FN,38)
-#define K_F30          K(KT_FN,39)
-#define K_F31          K(KT_FN,40)
-#define K_F32          K(KT_FN,41)
-#define K_F33          K(KT_FN,42)
-#define K_F34          K(KT_FN,43)
-#define K_F35          K(KT_FN,44)
-#define K_F36          K(KT_FN,45)
-#define K_F37          K(KT_FN,46)
-#define K_F38          K(KT_FN,47)
-#define K_F39          K(KT_FN,48)
-#define K_F40          K(KT_FN,49)
-#define K_F41          K(KT_FN,50)
-#define K_F42          K(KT_FN,51)
-#define K_F43          K(KT_FN,52)
-#define K_F44          K(KT_FN,53)
-#define K_F45          K(KT_FN,54)
-#define K_F46          K(KT_FN,55)
-#define K_F47          K(KT_FN,56)
-#define K_F48          K(KT_FN,57)
-#define K_F49          K(KT_FN,58)
-#define K_F50          K(KT_FN,59)
-#define K_F51          K(KT_FN,60)
-#define K_F52          K(KT_FN,61)
-#define K_F53          K(KT_FN,62)
-#define K_F54          K(KT_FN,63)
-#define K_F55          K(KT_FN,64)
-#define K_F56          K(KT_FN,65)
-#define K_F57          K(KT_FN,66)
-#define K_F58          K(KT_FN,67)
-#define K_F59          K(KT_FN,68)
-#define K_F60          K(KT_FN,69)
-#define K_F61          K(KT_FN,70)
-#define K_F62          K(KT_FN,71)
-#define K_F63          K(KT_FN,72)
-#define K_F64          K(KT_FN,73)
-#define K_F65          K(KT_FN,74)
-#define K_F66          K(KT_FN,75)
-#define K_F67          K(KT_FN,76)
-#define K_F68          K(KT_FN,77)
-#define K_F69          K(KT_FN,78)
-#define K_F70          K(KT_FN,79)
-#define K_F71          K(KT_FN,80)
-#define K_F72          K(KT_FN,81)
-#define K_F73          K(KT_FN,82)
-#define K_F74          K(KT_FN,83)
-#define K_F75          K(KT_FN,84)
-#define K_F76          K(KT_FN,85)
-#define K_F77          K(KT_FN,86)
-#define K_F78          K(KT_FN,87)
-#define K_F79          K(KT_FN,88)
-#define K_F80          K(KT_FN,89)
-#define K_F81          K(KT_FN,90)
-#define K_F82          K(KT_FN,91)
-#define K_F83          K(KT_FN,92)
-#define K_F84          K(KT_FN,93)
-#define K_F85          K(KT_FN,94)
-#define K_F86          K(KT_FN,95)
-#define K_F87          K(KT_FN,96)
-#define K_F88          K(KT_FN,97)
-#define K_F89          K(KT_FN,98)
-#define K_F90          K(KT_FN,99)
-#define K_F91          K(KT_FN,100)
-#define K_F92          K(KT_FN,101)
-#define K_F93          K(KT_FN,102)
-#define K_F94          K(KT_FN,103)
-#define K_F95          K(KT_FN,104)
-#define K_F96          K(KT_FN,105)
-#define K_F97          K(KT_FN,106)
-#define K_F98          K(KT_FN,107)
-#define K_F99          K(KT_FN,108)
-#define K_F100         K(KT_FN,109)
-#define K_F101         K(KT_FN,110)
-#define K_F102         K(KT_FN,111)
-#define K_F103         K(KT_FN,112)
-#define K_F104         K(KT_FN,113)
-#define K_F105         K(KT_FN,114)
-#define K_F106         K(KT_FN,115)
-#define K_F107         K(KT_FN,116)
-#define K_F108         K(KT_FN,117)
-#define K_F109         K(KT_FN,118)
-#define K_F110         K(KT_FN,119)
-#define K_F111         K(KT_FN,120)
-#define K_F112         K(KT_FN,121)
-#define K_F113         K(KT_FN,122)
-#define K_F114         K(KT_FN,123)
-#define K_F115         K(KT_FN,124)
-#define K_F116         K(KT_FN,125)
-#define K_F117         K(KT_FN,126)
-#define K_F118         K(KT_FN,127)
-#define K_F119         K(KT_FN,128)
-#define K_F120         K(KT_FN,129)
-#define K_F121         K(KT_FN,130)
-#define K_F122         K(KT_FN,131)
-#define K_F123         K(KT_FN,132)
-#define K_F124         K(KT_FN,133)
-#define K_F125         K(KT_FN,134)
-#define K_F126         K(KT_FN,135)
-#define K_F127         K(KT_FN,136)
-#define K_F128         K(KT_FN,137)
-#define K_F129         K(KT_FN,138)
-#define K_F130         K(KT_FN,139)
-#define K_F131         K(KT_FN,140)
-#define K_F132         K(KT_FN,141)
-#define K_F133         K(KT_FN,142)
-#define K_F134         K(KT_FN,143)
-#define K_F135         K(KT_FN,144)
-#define K_F136         K(KT_FN,145)
-#define K_F137         K(KT_FN,146)
-#define K_F138         K(KT_FN,147)
-#define K_F139         K(KT_FN,148)
-#define K_F140         K(KT_FN,149)
-#define K_F141         K(KT_FN,150)
-#define K_F142         K(KT_FN,151)
-#define K_F143         K(KT_FN,152)
-#define K_F144         K(KT_FN,153)
-#define K_F145         K(KT_FN,154)
-#define K_F146         K(KT_FN,155)
-#define K_F147         K(KT_FN,156)
-#define K_F148         K(KT_FN,157)
-#define K_F149         K(KT_FN,158)
-#define K_F150         K(KT_FN,159)
-#define K_F151         K(KT_FN,160)
-#define K_F152         K(KT_FN,161)
-#define K_F153         K(KT_FN,162)
-#define K_F154         K(KT_FN,163)
-#define K_F155         K(KT_FN,164)
-#define K_F156         K(KT_FN,165)
-#define K_F157         K(KT_FN,166)
-#define K_F158         K(KT_FN,167)
-#define K_F159         K(KT_FN,168)
-#define K_F160         K(KT_FN,169)
-#define K_F161         K(KT_FN,170)
-#define K_F162         K(KT_FN,171)
-#define K_F163         K(KT_FN,172)
-#define K_F164         K(KT_FN,173)
-#define K_F165         K(KT_FN,174)
-#define K_F166         K(KT_FN,175)
-#define K_F167         K(KT_FN,176)
-#define K_F168         K(KT_FN,177)
-#define K_F169         K(KT_FN,178)
-#define K_F170         K(KT_FN,179)
-#define K_F171         K(KT_FN,180)
-#define K_F172         K(KT_FN,181)
-#define K_F173         K(KT_FN,182)
-#define K_F174         K(KT_FN,183)
-#define K_F175         K(KT_FN,184)
-#define K_F176         K(KT_FN,185)
-#define K_F177         K(KT_FN,186)
-#define K_F178         K(KT_FN,187)
-#define K_F179         K(KT_FN,188)
-#define K_F180         K(KT_FN,189)
-#define K_F181         K(KT_FN,190)
-#define K_F182         K(KT_FN,191)
-#define K_F183         K(KT_FN,192)
-#define K_F184         K(KT_FN,193)
-#define K_F185         K(KT_FN,194)
-#define K_F186         K(KT_FN,195)
-#define K_F187         K(KT_FN,196)
-#define K_F188         K(KT_FN,197)
-#define K_F189         K(KT_FN,198)
-#define K_F190         K(KT_FN,199)
-#define K_F191         K(KT_FN,200)
-#define K_F192         K(KT_FN,201)
-#define K_F193         K(KT_FN,202)
-#define K_F194         K(KT_FN,203)
-#define K_F195         K(KT_FN,204)
-#define K_F196         K(KT_FN,205)
-#define K_F197         K(KT_FN,206)
-#define K_F198         K(KT_FN,207)
-#define K_F199         K(KT_FN,208)
-#define K_F200         K(KT_FN,209)
-#define K_F201         K(KT_FN,210)
-#define K_F202         K(KT_FN,211)
-#define K_F203         K(KT_FN,212)
-#define K_F204         K(KT_FN,213)
-#define K_F205         K(KT_FN,214)
-#define K_F206         K(KT_FN,215)
-#define K_F207         K(KT_FN,216)
-#define K_F208         K(KT_FN,217)
-#define K_F209         K(KT_FN,218)
-#define K_F210         K(KT_FN,219)
-#define K_F211         K(KT_FN,220)
-#define K_F212         K(KT_FN,221)
-#define K_F213         K(KT_FN,222)
-#define K_F214         K(KT_FN,223)
-#define K_F215         K(KT_FN,224)
-#define K_F216         K(KT_FN,225)
-#define K_F217         K(KT_FN,226)
-#define K_F218         K(KT_FN,227)
-#define K_F219         K(KT_FN,228)
-#define K_F220         K(KT_FN,229)
-#define K_F221         K(KT_FN,230)
-#define K_F222         K(KT_FN,231)
-#define K_F223         K(KT_FN,232)
-#define K_F224         K(KT_FN,233)
-#define K_F225         K(KT_FN,234)
-#define K_F226         K(KT_FN,235)
-#define K_F227         K(KT_FN,236)
-#define K_F228         K(KT_FN,237)
-#define K_F229         K(KT_FN,238)
-#define K_F230         K(KT_FN,239)
-#define K_F231         K(KT_FN,240)
-#define K_F232         K(KT_FN,241)
-#define K_F233         K(KT_FN,242)
-#define K_F234         K(KT_FN,243)
-#define K_F235         K(KT_FN,244)
-#define K_F236         K(KT_FN,245)
-#define K_F237         K(KT_FN,246)
-#define K_F238         K(KT_FN,247)
-#define K_F239         K(KT_FN,248)
-#define K_F240         K(KT_FN,249)
-#define K_F241         K(KT_FN,250)
-#define K_F242         K(KT_FN,251)
-#define K_F243         K(KT_FN,252)
-#define K_F244         K(KT_FN,253)
-#define K_F245         K(KT_FN,254)
-#define K_UNDO         K(KT_FN,255)
-
-
-#define K_HOLE         K(KT_SPEC,0)
-#define K_ENTER                K(KT_SPEC,1)
-#define K_SH_REGS      K(KT_SPEC,2)
-#define K_SH_MEM       K(KT_SPEC,3)
-#define K_SH_STAT      K(KT_SPEC,4)
-#define K_BREAK                K(KT_SPEC,5)
-#define K_CONS         K(KT_SPEC,6)
-#define K_CAPS         K(KT_SPEC,7)
-#define K_NUM          K(KT_SPEC,8)
-#define K_HOLD         K(KT_SPEC,9)
-#define K_SCROLLFORW   K(KT_SPEC,10)
-#define K_SCROLLBACK   K(KT_SPEC,11)
-#define K_BOOT         K(KT_SPEC,12)
-#define K_CAPSON       K(KT_SPEC,13)
-#define K_COMPOSE      K(KT_SPEC,14)
-#define K_SAK          K(KT_SPEC,15)
-#define K_DECRCONSOLE  K(KT_SPEC,16)
-#define K_INCRCONSOLE  K(KT_SPEC,17)
-#define K_SPAWNCONSOLE K(KT_SPEC,18)
-#define K_BARENUMLOCK  K(KT_SPEC,19)
-
-#define K_ALLOCATED    K(KT_SPEC,126) /* dynamically allocated keymap */
-#define K_NOSUCHMAP    K(KT_SPEC,127) /* returned by KDGKBENT */
-
-#define K_P0           K(KT_PAD,0)
-#define K_P1           K(KT_PAD,1)
-#define K_P2           K(KT_PAD,2)
-#define K_P3           K(KT_PAD,3)
-#define K_P4           K(KT_PAD,4)
-#define K_P5           K(KT_PAD,5)
-#define K_P6           K(KT_PAD,6)
-#define K_P7           K(KT_PAD,7)
-#define K_P8           K(KT_PAD,8)
-#define K_P9           K(KT_PAD,9)
-#define K_PPLUS                K(KT_PAD,10)    /* key-pad plus */
-#define K_PMINUS       K(KT_PAD,11)    /* key-pad minus */
-#define K_PSTAR                K(KT_PAD,12)    /* key-pad asterisk (star) */
-#define K_PSLASH       K(KT_PAD,13)    /* key-pad slash */
-#define K_PENTER       K(KT_PAD,14)    /* key-pad enter */
-#define K_PCOMMA       K(KT_PAD,15)    /* key-pad comma: kludge... */
-#define K_PDOT         K(KT_PAD,16)    /* key-pad dot (period): kludge... */
-#define K_PPLUSMINUS   K(KT_PAD,17)    /* key-pad plus/minus */
-#define K_PPARENL      K(KT_PAD,18)    /* key-pad left parenthesis */
-#define K_PPARENR      K(KT_PAD,19)    /* key-pad right parenthesis */
-
-#define NR_PAD         20
-
-#define K_DGRAVE       K(KT_DEAD,0)
-#define K_DACUTE       K(KT_DEAD,1)
-#define K_DCIRCM       K(KT_DEAD,2)
-#define K_DTILDE       K(KT_DEAD,3)
-#define K_DDIERE       K(KT_DEAD,4)
-#define K_DCEDIL       K(KT_DEAD,5)
-
-#define NR_DEAD                6
-
-#define K_DOWN         K(KT_CUR,0)
-#define K_LEFT         K(KT_CUR,1)
-#define K_RIGHT                K(KT_CUR,2)
-#define K_UP           K(KT_CUR,3)
-
-#define K_SHIFT                K(KT_SHIFT,KG_SHIFT)
-#define K_CTRL         K(KT_SHIFT,KG_CTRL)
-#define K_ALT          K(KT_SHIFT,KG_ALT)
-#define K_ALTGR                K(KT_SHIFT,KG_ALTGR)
-#define K_SHIFTL       K(KT_SHIFT,KG_SHIFTL)
-#define K_SHIFTR       K(KT_SHIFT,KG_SHIFTR)
-#define K_CTRLL                K(KT_SHIFT,KG_CTRLL)
-#define K_CTRLR                K(KT_SHIFT,KG_CTRLR)
-#define K_CAPSSHIFT    K(KT_SHIFT,KG_CAPSSHIFT)
-
-#define K_ASC0         K(KT_ASCII,0)
-#define K_ASC1         K(KT_ASCII,1)
-#define K_ASC2         K(KT_ASCII,2)
-#define K_ASC3         K(KT_ASCII,3)
-#define K_ASC4         K(KT_ASCII,4)
-#define K_ASC5         K(KT_ASCII,5)
-#define K_ASC6         K(KT_ASCII,6)
-#define K_ASC7         K(KT_ASCII,7)
-#define K_ASC8         K(KT_ASCII,8)
-#define K_ASC9         K(KT_ASCII,9)
-#define K_HEX0         K(KT_ASCII,10)
-#define K_HEX1         K(KT_ASCII,11)
-#define K_HEX2         K(KT_ASCII,12)
-#define K_HEX3         K(KT_ASCII,13)
-#define K_HEX4         K(KT_ASCII,14)
-#define K_HEX5         K(KT_ASCII,15)
-#define K_HEX6         K(KT_ASCII,16)
-#define K_HEX7         K(KT_ASCII,17)
-#define K_HEX8         K(KT_ASCII,18)
-#define K_HEX9         K(KT_ASCII,19)
-#define K_HEXa         K(KT_ASCII,20)
-#define K_HEXb         K(KT_ASCII,21)
-#define K_HEXc         K(KT_ASCII,22)
-#define K_HEXd         K(KT_ASCII,23)
-#define K_HEXe         K(KT_ASCII,24)
-#define K_HEXf         K(KT_ASCII,25)
-
-#define NR_ASCII       26
-
-#define K_SHIFTLOCK    K(KT_LOCK,KG_SHIFT)
-#define K_CTRLLOCK     K(KT_LOCK,KG_CTRL)
-#define K_ALTLOCK      K(KT_LOCK,KG_ALT)
-#define K_ALTGRLOCK    K(KT_LOCK,KG_ALTGR)
-#define K_SHIFTLLOCK   K(KT_LOCK,KG_SHIFTL)
-#define K_SHIFTRLOCK   K(KT_LOCK,KG_SHIFTR)
-#define K_CTRLLLOCK    K(KT_LOCK,KG_CTRLL)
-#define K_CTRLRLOCK    K(KT_LOCK,KG_CTRLR)
-#define K_CAPSSHIFTLOCK        K(KT_LOCK,KG_CAPSSHIFT)
-
-#define K_SHIFT_SLOCK  K(KT_SLOCK,KG_SHIFT)
-#define K_CTRL_SLOCK   K(KT_SLOCK,KG_CTRL)
-#define K_ALT_SLOCK    K(KT_SLOCK,KG_ALT)
-#define K_ALTGR_SLOCK  K(KT_SLOCK,KG_ALTGR)
-#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
-#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
-#define K_CTRLL_SLOCK  K(KT_SLOCK,KG_CTRLL)
-#define K_CTRLR_SLOCK  K(KT_SLOCK,KG_CTRLR)
-#define K_CAPSSHIFT_SLOCK      K(KT_SLOCK,KG_CAPSSHIFT)
-
-#define NR_LOCK                9
-
-#define K_BRL_BLANK     K(KT_BRL, 0)
-#define K_BRL_DOT1      K(KT_BRL, 1)
-#define K_BRL_DOT2      K(KT_BRL, 2)
-#define K_BRL_DOT3      K(KT_BRL, 3)
-#define K_BRL_DOT4      K(KT_BRL, 4)
-#define K_BRL_DOT5      K(KT_BRL, 5)
-#define K_BRL_DOT6      K(KT_BRL, 6)
-#define K_BRL_DOT7      K(KT_BRL, 7)
-#define K_BRL_DOT8      K(KT_BRL, 8)
-#define K_BRL_DOT9      K(KT_BRL, 9)
-#define K_BRL_DOT10     K(KT_BRL, 10)
-
-#define NR_BRL         11
-
-#define MAX_DIACR      256
-#endif
index ff476ddaf3103cc02e5688bc00528e7d042af891..00a97bb905db03a007450351441c823b8fa19112 100644 (file)
@@ -1,31 +1,8 @@
 #ifndef __LINUX_KVM_PARA_H
 #define __LINUX_KVM_PARA_H
 
-/*
- * This header file provides a method for making a hypercall to the host
- * Architectures should define:
- * - kvm_hypercall0, kvm_hypercall1...
- * - kvm_arch_para_features
- * - kvm_para_available
- */
+#include <uapi/linux/kvm_para.h>
 
-/* Return values for hypercalls */
-#define KVM_ENOSYS             1000
-#define KVM_EFAULT             EFAULT
-#define KVM_E2BIG              E2BIG
-#define KVM_EPERM              EPERM
-
-#define KVM_HC_VAPIC_POLL_IRQ          1
-#define KVM_HC_MMU_OP                  2
-#define KVM_HC_FEATURES                        3
-#define KVM_HC_PPC_MAP_MAGIC_PAGE      4
-
-/*
- * hypercalls use architecture specific
- */
-#include <asm/kvm_para.h>
-
-#ifdef __KERNEL__
 
 static inline int kvm_para_has_feature(unsigned int feature)
 {
@@ -33,5 +10,4 @@ static inline int kvm_para_has_feature(unsigned int feature)
                return 1;
        return 0;
 }
-#endif /* __KERNEL__ */
 #endif /* __LINUX_KVM_PARA_H */
index 7eab668f60f32a0b4a18adc752fb053ec5af1086..bffdb962f1a6cba216e1c9ec9ba13acb878f4a3a 100644 (file)
  *
  * Author: James Chapman <jchapman@katalix.com>
  */
-
 #ifndef _LINUX_L2TP_H_
 #define _LINUX_L2TP_H_
 
-#include <linux/types.h>
-#include <linux/socket.h>
-#ifdef __KERNEL__
 #include <linux/in.h>
 #include <linux/in6.h>
-#else
-#include <netinet/in.h>
-#endif
-
-#define IPPROTO_L2TP           115
-
-/**
- * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
- * @l2tp_family:  address family number AF_L2TPIP.
- * @l2tp_addr:    protocol specific address information
- * @l2tp_conn_id: connection id of tunnel
- */
-#define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
-struct sockaddr_l2tpip {
-       /* The first fields must match struct sockaddr_in */
-       __kernel_sa_family_t l2tp_family; /* AF_INET */
-       __be16          l2tp_unused;    /* INET port number (unused) */
-       struct in_addr  l2tp_addr;      /* Internet address */
-
-       __u32           l2tp_conn_id;   /* Connection ID of tunnel */
-
-       /* Pad to size of `struct sockaddr'. */
-       unsigned char   __pad[sizeof(struct sockaddr) -
-                             sizeof(__kernel_sa_family_t) -
-                             sizeof(__be16) - sizeof(struct in_addr) -
-                             sizeof(__u32)];
-};
-
-/**
- * struct sockaddr_l2tpip6 - the sockaddr structure for L2TP-over-IPv6 sockets
- * @l2tp_family:  address family number AF_L2TPIP.
- * @l2tp_addr:    protocol specific address information
- * @l2tp_conn_id: connection id of tunnel
- */
-struct sockaddr_l2tpip6 {
-       /* The first fields must match struct sockaddr_in6 */
-       __kernel_sa_family_t l2tp_family; /* AF_INET6 */
-       __be16          l2tp_unused;    /* INET port number (unused) */
-       __be32          l2tp_flowinfo;  /* IPv6 flow information */
-       struct in6_addr l2tp_addr;      /* IPv6 address */
-       __u32           l2tp_scope_id;  /* scope id (new in RFC2553) */
-       __u32           l2tp_conn_id;   /* Connection ID of tunnel */
-};
-
-/*****************************************************************************
- *  NETLINK_GENERIC netlink family.
- *****************************************************************************/
-
-/*
- * Commands.
- * Valid TLVs of each command are:-
- * TUNNEL_CREATE       - CONN_ID, pw_type, netns, ifname, ipinfo, udpinfo, udpcsum, vlanid
- * TUNNEL_DELETE       - CONN_ID
- * TUNNEL_MODIFY       - CONN_ID, udpcsum
- * TUNNEL_GETSTATS     - CONN_ID, (stats)
- * TUNNEL_GET          - CONN_ID, (...)
- * SESSION_CREATE      - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec
- * SESSION_DELETE      - SESSION_ID
- * SESSION_MODIFY      - SESSION_ID, data_seq
- * SESSION_GET         - SESSION_ID, (...)
- * SESSION_GETSTATS    - SESSION_ID, (stats)
- *
- */
-enum {
-       L2TP_CMD_NOOP,
-       L2TP_CMD_TUNNEL_CREATE,
-       L2TP_CMD_TUNNEL_DELETE,
-       L2TP_CMD_TUNNEL_MODIFY,
-       L2TP_CMD_TUNNEL_GET,
-       L2TP_CMD_SESSION_CREATE,
-       L2TP_CMD_SESSION_DELETE,
-       L2TP_CMD_SESSION_MODIFY,
-       L2TP_CMD_SESSION_GET,
-       __L2TP_CMD_MAX,
-};
-
-#define L2TP_CMD_MAX                   (__L2TP_CMD_MAX - 1)
-
-/*
- * ATTR types defined for L2TP
- */
-enum {
-       L2TP_ATTR_NONE,                 /* no data */
-       L2TP_ATTR_PW_TYPE,              /* u16, enum l2tp_pwtype */
-       L2TP_ATTR_ENCAP_TYPE,           /* u16, enum l2tp_encap_type */
-       L2TP_ATTR_OFFSET,               /* u16 */
-       L2TP_ATTR_DATA_SEQ,             /* u16 */
-       L2TP_ATTR_L2SPEC_TYPE,          /* u8, enum l2tp_l2spec_type */
-       L2TP_ATTR_L2SPEC_LEN,           /* u8, enum l2tp_l2spec_type */
-       L2TP_ATTR_PROTO_VERSION,        /* u8 */
-       L2TP_ATTR_IFNAME,               /* string */
-       L2TP_ATTR_CONN_ID,              /* u32 */
-       L2TP_ATTR_PEER_CONN_ID,         /* u32 */
-       L2TP_ATTR_SESSION_ID,           /* u32 */
-       L2TP_ATTR_PEER_SESSION_ID,      /* u32 */
-       L2TP_ATTR_UDP_CSUM,             /* u8 */
-       L2TP_ATTR_VLAN_ID,              /* u16 */
-       L2TP_ATTR_COOKIE,               /* 0, 4 or 8 bytes */
-       L2TP_ATTR_PEER_COOKIE,          /* 0, 4 or 8 bytes */
-       L2TP_ATTR_DEBUG,                /* u32 */
-       L2TP_ATTR_RECV_SEQ,             /* u8 */
-       L2TP_ATTR_SEND_SEQ,             /* u8 */
-       L2TP_ATTR_LNS_MODE,             /* u8 */
-       L2TP_ATTR_USING_IPSEC,          /* u8 */
-       L2TP_ATTR_RECV_TIMEOUT,         /* msec */
-       L2TP_ATTR_FD,                   /* int */
-       L2TP_ATTR_IP_SADDR,             /* u32 */
-       L2TP_ATTR_IP_DADDR,             /* u32 */
-       L2TP_ATTR_UDP_SPORT,            /* u16 */
-       L2TP_ATTR_UDP_DPORT,            /* u16 */
-       L2TP_ATTR_MTU,                  /* u16 */
-       L2TP_ATTR_MRU,                  /* u16 */
-       L2TP_ATTR_STATS,                /* nested */
-       L2TP_ATTR_IP6_SADDR,            /* struct in6_addr */
-       L2TP_ATTR_IP6_DADDR,            /* struct in6_addr */
-       __L2TP_ATTR_MAX,
-};
-
-#define L2TP_ATTR_MAX                  (__L2TP_ATTR_MAX - 1)
-
-/* Nested in L2TP_ATTR_STATS */
-enum {
-       L2TP_ATTR_STATS_NONE,           /* no data */
-       L2TP_ATTR_TX_PACKETS,           /* u64 */
-       L2TP_ATTR_TX_BYTES,             /* u64 */
-       L2TP_ATTR_TX_ERRORS,            /* u64 */
-       L2TP_ATTR_RX_PACKETS,           /* u64 */
-       L2TP_ATTR_RX_BYTES,             /* u64 */
-       L2TP_ATTR_RX_SEQ_DISCARDS,      /* u64 */
-       L2TP_ATTR_RX_OOS_PACKETS,       /* u64 */
-       L2TP_ATTR_RX_ERRORS,            /* u64 */
-       __L2TP_ATTR_STATS_MAX,
-};
-
-#define L2TP_ATTR_STATS_MAX            (__L2TP_ATTR_STATS_MAX - 1)
-
-enum l2tp_pwtype {
-       L2TP_PWTYPE_NONE = 0x0000,
-       L2TP_PWTYPE_ETH_VLAN = 0x0004,
-       L2TP_PWTYPE_ETH = 0x0005,
-       L2TP_PWTYPE_PPP = 0x0007,
-       L2TP_PWTYPE_PPP_AC = 0x0008,
-       L2TP_PWTYPE_IP = 0x000b,
-       __L2TP_PWTYPE_MAX
-};
-
-enum l2tp_l2spec_type {
-       L2TP_L2SPECTYPE_NONE,
-       L2TP_L2SPECTYPE_DEFAULT,
-};
-
-enum l2tp_encap_type {
-       L2TP_ENCAPTYPE_UDP,
-       L2TP_ENCAPTYPE_IP,
-};
-
-enum l2tp_seqmode {
-       L2TP_SEQ_NONE = 0,
-       L2TP_SEQ_IP = 1,
-       L2TP_SEQ_ALL = 2,
-};
-
-/*
- * NETLINK_GENERIC related info
- */
-#define L2TP_GENL_NAME         "l2tp"
-#define L2TP_GENL_VERSION      0x1
+#include <uapi/linux/l2tp.h>
 
 #endif
index a2418ae13ee97234f96ba809053a1b33df320f59..b965314d017f546d09a5064fdf313b9893b52327 100644 (file)
@@ -1,5 +1,3 @@
-#ifndef __LINUX_LLC_H
-#define __LINUX_LLC_H
 /*
  * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
  *
  *
  * See the GNU General Public License for more details.
  */
+#ifndef __LINUX_LLC_H
+#define __LINUX_LLC_H
 
-#include <linux/socket.h>
-
-#define __LLC_SOCK_SIZE__ 16   /* sizeof(sockaddr_llc), word align. */
-struct sockaddr_llc {
-       __kernel_sa_family_t sllc_family; /* AF_LLC */
-       __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
-       unsigned char   sllc_test;
-       unsigned char   sllc_xid;
-       unsigned char   sllc_ua;        /* UA data, only for SOCK_STREAM. */
-       unsigned char   sllc_sap;
-       unsigned char   sllc_mac[IFHWADDRLEN];
-       unsigned char   __pad[__LLC_SOCK_SIZE__ -
-                             sizeof(__kernel_sa_family_t) * 2 -
-                             sizeof(unsigned char) * 4 - IFHWADDRLEN];
-};
-
-/* sockopt definitions. */
-enum llc_sockopts {
-       LLC_OPT_UNKNOWN = 0,
-       LLC_OPT_RETRY,          /* max retrans attempts. */
-       LLC_OPT_SIZE,           /* max PDU size (octets). */
-       LLC_OPT_ACK_TMR_EXP,    /* ack expire time (secs). */
-       LLC_OPT_P_TMR_EXP,      /* pf cycle expire time (secs). */
-       LLC_OPT_REJ_TMR_EXP,    /* rej sent expire time (secs). */
-       LLC_OPT_BUSY_TMR_EXP,   /* busy state expire time (secs). */
-       LLC_OPT_TX_WIN,         /* tx window size. */
-       LLC_OPT_RX_WIN,         /* rx window size. */
-       LLC_OPT_PKTINFO,        /* ancillary packet information. */
-       LLC_OPT_MAX
-};
-
-#define LLC_OPT_MAX_RETRY       100
-#define LLC_OPT_MAX_SIZE       4196
-#define LLC_OPT_MAX_WIN                 127
-#define LLC_OPT_MAX_ACK_TMR_EXP          60
-#define LLC_OPT_MAX_P_TMR_EXP    60
-#define LLC_OPT_MAX_REJ_TMR_EXP          60
-#define LLC_OPT_MAX_BUSY_TMR_EXP  60
-
-/* LLC SAP types. */
-#define LLC_SAP_NULL   0x00            /* NULL SAP.                    */
-#define LLC_SAP_LLC    0x02            /* LLC Sublayer Management.     */
-#define LLC_SAP_SNA    0x04            /* SNA Path Control.            */
-#define LLC_SAP_PNM    0x0E            /* Proway Network Management.   */      
-#define LLC_SAP_IP     0x06            /* TCP/IP.                      */
-#define LLC_SAP_BSPAN  0x42            /* Bridge Spanning Tree Proto   */
-#define LLC_SAP_MMS    0x4E            /* Manufacturing Message Srv.   */
-#define LLC_SAP_8208   0x7E            /* ISO 8208                     */
-#define LLC_SAP_3COM   0x80            /* 3COM.                        */
-#define LLC_SAP_PRO    0x8E            /* Proway Active Station List   */
-#define LLC_SAP_SNAP   0xAA            /* SNAP.                        */
-#define LLC_SAP_BANYAN 0xBC            /* Banyan.                      */
-#define LLC_SAP_IPX    0xE0            /* IPX/SPX.                     */
-#define LLC_SAP_NETBEUI        0xF0            /* NetBEUI.                     */
-#define LLC_SAP_LANMGR 0xF4            /* LanManager.                  */
-#define LLC_SAP_IMPL   0xF8            /* IMPL                         */
-#define LLC_SAP_DISC   0xFC            /* Discovery                    */
-#define LLC_SAP_OSI    0xFE            /* OSI Network Layers.          */
-#define LLC_SAP_LAR    0xDC            /* LAN Address Resolution       */
-#define LLC_SAP_RM     0xD4            /* Resource Management          */
-#define LLC_SAP_GLOBAL 0xFF            /* Global SAP.                  */
-
-struct llc_pktinfo {
-       int lpi_ifindex;
-       unsigned char lpi_sap;
-       unsigned char lpi_mac[IFHWADDRLEN];
-};
+#include <uapi/linux/llc.h>
 
-#ifdef __KERNEL__
 #define LLC_SAP_DYN_START      0xC0
 #define LLC_SAP_DYN_STOP       0xDE
 #define LLC_SAP_DYN_TRIES      4
 
 #define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
-#endif /* __KERNEL__ */
 #endif /* __LINUX_LLC_H */
index 9635116dd830e3634a6c6e2d06219eb36661578c..6492181bcb1dbc3617a3a3377ad5d0961fd4e536 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef _LINUX_LOOP_H
-#define _LINUX_LOOP_H
-
 /*
  * include/linux/loop.h
  *
@@ -9,15 +6,14 @@
  * Copyright 1993 by Theodore Ts'o.  Redistribution of this file is
  * permitted under the GNU General Public License.
  */
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
 
-#define LO_NAME_SIZE   64
-#define LO_KEY_SIZE    32
-
-#ifdef __KERNEL__
 #include <linux/bio.h>
 #include <linux/blkdev.h>
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
+#include <uapi/linux/loop.h>
 
 /* Possible states of device */
 enum {
@@ -66,69 +62,6 @@ struct loop_device {
        struct gendisk          *lo_disk;
 };
 
-#endif /* __KERNEL__ */
-
-/*
- * Loop flags
- */
-enum {
-       LO_FLAGS_READ_ONLY      = 1,
-       LO_FLAGS_AUTOCLEAR      = 4,
-       LO_FLAGS_PARTSCAN       = 8,
-};
-
-#include <asm/posix_types.h>   /* for __kernel_old_dev_t */
-#include <linux/types.h>       /* for __u64 */
-
-/* Backwards compatibility version */
-struct loop_info {
-       int                lo_number;           /* ioctl r/o */
-       __kernel_old_dev_t lo_device;           /* ioctl r/o */
-       unsigned long      lo_inode;            /* ioctl r/o */
-       __kernel_old_dev_t lo_rdevice;          /* ioctl r/o */
-       int                lo_offset;
-       int                lo_encrypt_type;
-       int                lo_encrypt_key_size;         /* ioctl w/o */
-       int                lo_flags;                    /* ioctl r/o */
-       char               lo_name[LO_NAME_SIZE];
-       unsigned char      lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
-       unsigned long      lo_init[2];
-       char               reserved[4];
-};
-
-struct loop_info64 {
-       __u64              lo_device;                   /* ioctl r/o */
-       __u64              lo_inode;                    /* ioctl r/o */
-       __u64              lo_rdevice;                  /* ioctl r/o */
-       __u64              lo_offset;
-       __u64              lo_sizelimit;/* bytes, 0 == max available */
-       __u32              lo_number;                   /* ioctl r/o */
-       __u32              lo_encrypt_type;
-       __u32              lo_encrypt_key_size;         /* ioctl w/o */
-       __u32              lo_flags;                    /* ioctl r/o */
-       __u8               lo_file_name[LO_NAME_SIZE];
-       __u8               lo_crypt_name[LO_NAME_SIZE];
-       __u8               lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
-       __u64              lo_init[2];
-};
-
-/*
- * Loop filter types
- */
-
-#define LO_CRYPT_NONE          0
-#define LO_CRYPT_XOR           1
-#define LO_CRYPT_DES           2
-#define LO_CRYPT_FISH2         3    /* Twofish encryption */
-#define LO_CRYPT_BLOW          4
-#define LO_CRYPT_CAST128       5
-#define LO_CRYPT_IDEA          6
-#define LO_CRYPT_DUMMY         9
-#define LO_CRYPT_SKIPJACK      10
-#define LO_CRYPT_CRYPTOAPI     18
-#define MAX_LO_CRYPT           20
-
-#ifdef __KERNEL__
 /* Support for loadable transfer modules */
 struct loop_func_table {
        int number;     /* filter type */ 
@@ -147,21 +80,3 @@ int loop_register_transfer(struct loop_func_table *funcs);
 int loop_unregister_transfer(int number); 
 
 #endif
-/*
- * IOCTL commands --- we will commandeer 0x4C ('L')
- */
-
-#define LOOP_SET_FD            0x4C00
-#define LOOP_CLR_FD            0x4C01
-#define LOOP_SET_STATUS                0x4C02
-#define LOOP_GET_STATUS                0x4C03
-#define LOOP_SET_STATUS64      0x4C04
-#define LOOP_GET_STATUS64      0x4C05
-#define LOOP_CHANGE_FD         0x4C06
-#define LOOP_SET_CAPACITY      0x4C07
-
-/* /dev/loop-control interface */
-#define LOOP_CTL_ADD           0x4C80
-#define LOOP_CTL_REMOVE                0x4C81
-#define LOOP_CTL_GET_FREE      0x4C82
-#endif
index 0df024bfd6f0c672a755b2f701711040691f95ae..0dd276af9e4ead29f039f67becde01b991c8769d 100644 (file)
-#ifndef _LINUX_LP_H
-#define _LINUX_LP_H
-
 /*
  * usr/include/linux/lp.h c.1991-1992 James Wiegand
  * many modifications copyright (C) 1992 Michael K. Johnson
  * Interrupt support added 1993 Nigel Gamble
  * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti 
  */
+#ifndef _LINUX_LP_H
+#define _LINUX_LP_H
 
-/*
- * Per POSIX guidelines, this module reserves the LP and lp prefixes
- * These are the lp_table[minor].flags flags...
- */
-#define LP_EXIST 0x0001
-#define LP_SELEC 0x0002
-#define LP_BUSY         0x0004
-#define LP_BUSY_BIT_POS 2
-#define LP_OFFL         0x0008
-#define LP_NOPA  0x0010
-#define LP_ERR   0x0020
-#define LP_ABORT 0x0040
-#define LP_CAREFUL 0x0080 /* obsoleted -arca */
-#define LP_ABORTOPEN 0x0100
-
-#define LP_TRUST_IRQ_  0x0200 /* obsolete */
-#define LP_NO_REVERSE  0x0400 /* No reverse mode available. */
-#define LP_DATA_AVAIL  0x0800 /* Data is available. */
-
-/* 
- * bit defines for 8255 status port
- * base + 1
- * accessed with LP_S(minor), which gets the byte...
- */
-#define LP_PBUSY       0x80  /* inverted input, active high */
-#define LP_PACK                0x40  /* unchanged input, active low */
-#define LP_POUTPA      0x20  /* unchanged input, active high */
-#define LP_PSELECD     0x10  /* unchanged input, active high */
-#define LP_PERRORP     0x08  /* unchanged input, active low */
-
-/* timeout for each character.  This is relative to bus cycles -- it
- * is the count in a busy loop.  THIS IS THE VALUE TO CHANGE if you
- * have extremely slow printing, or if the machine seems to slow down
- * a lot when you print.  If you have slow printing, increase this
- * number and recompile, and if your system gets bogged down, decrease
- * this number.  This can be changed with the tunelp(8) command as well.
- */
-
-#define LP_INIT_CHAR 1000
-
-/* The parallel port specs apparently say that there needs to be
- * a .5usec wait before and after the strobe.
- */
-
-#define LP_INIT_WAIT 1
-
-/* This is the amount of time that the driver waits for the printer to
- * catch up when the printer's buffer appears to be filled.  If you
- * want to tune this and have a fast printer (i.e. HPIIIP), decrease
- * this number, and if you have a slow printer, increase this number.
- * This is in hundredths of a second, the default 2 being .05 second.
- * Or use the tunelp(8) command, which is especially nice if you want
- * change back and forth between character and graphics printing, which
- * are wildly different...
- */
-
-#define LP_INIT_TIME 2
-
-/* IOCTL numbers */
-#define LPCHAR   0x0601  /* corresponds to LP_INIT_CHAR */
-#define LPTIME   0x0602  /* corresponds to LP_INIT_TIME */
-#define LPABORT  0x0604  /* call with TRUE arg to abort on error,
-                           FALSE to retry.  Default is retry.  */
-#define LPSETIRQ 0x0605  /* call with new IRQ number,
-                           or 0 for polling (no IRQ) */
-#define LPGETIRQ 0x0606  /* get the current IRQ number */
-#define LPWAIT   0x0608  /* corresponds to LP_INIT_WAIT */
-/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
-#define LPCAREFUL   0x0609  /* call with TRUE arg to require out-of-paper, off-
-                           line, and error indicators good on all writes,
-                           FALSE to ignore them.  Default is ignore. */
-#define LPABORTOPEN 0x060a  /* call with TRUE arg to abort open() on error,
-                           FALSE to ignore error.  Default is ignore.  */
-#define LPGETSTATUS 0x060b  /* return LP_S(minor) */
-#define LPRESET     0x060c  /* reset printer */
-#ifdef LP_STATS
-#define LPGETSTATS  0x060d  /* get statistics (struct lp_stats) */
-#endif
-#define LPGETFLAGS  0x060e  /* get status flags */
-#define LPSETTIMEOUT 0x060f /* set parport timeout */
-
-/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
-   This is also used for re-checking error conditions if LP_ABORT is
-   not set.  This is the default behavior. */
-
-#define LP_TIMEOUT_INTERRUPT   (60 * HZ)
-#define LP_TIMEOUT_POLLED      (10 * HZ)
-
-#ifdef __KERNEL__
 
 #include <linux/wait.h>
 #include <linux/mutex.h>
+#include <uapi/linux/lp.h>
 
 /* Magic numbers for defining port-device mappings */
 #define LP_PARPORT_UNSPEC -4
@@ -187,5 +98,3 @@ struct lp_struct {
 #define LP_DELAY       50
 
 #endif
-
-#endif
index 6c406845f7e29d166667ebc1587fe41eb5cb2448..3d15c838116c67bcdab17b141a6a9f7618fe1b71 100644 (file)
  * under the terms of the GNU General Public License version 2 as published
  * by the Free Software Foundation, incorporated herein by reference.
  */
-
 #ifndef __LINUX_MDIO_H__
 #define __LINUX_MDIO_H__
 
-#include <linux/types.h>
-#include <linux/mii.h>
-
-/* MDIO Manageable Devices (MMDs). */
-#define MDIO_MMD_PMAPMD                1       /* Physical Medium Attachment/
-                                        * Physical Medium Dependent */
-#define MDIO_MMD_WIS           2       /* WAN Interface Sublayer */
-#define MDIO_MMD_PCS           3       /* Physical Coding Sublayer */
-#define MDIO_MMD_PHYXS         4       /* PHY Extender Sublayer */
-#define MDIO_MMD_DTEXS         5       /* DTE Extender Sublayer */
-#define MDIO_MMD_TC            6       /* Transmission Convergence */
-#define MDIO_MMD_AN            7       /* Auto-Negotiation */
-#define MDIO_MMD_C22EXT                29      /* Clause 22 extension */
-#define MDIO_MMD_VEND1         30      /* Vendor specific 1 */
-#define MDIO_MMD_VEND2         31      /* Vendor specific 2 */
-
-/* Generic MDIO registers. */
-#define MDIO_CTRL1             MII_BMCR
-#define MDIO_STAT1             MII_BMSR
-#define MDIO_DEVID1            MII_PHYSID1
-#define MDIO_DEVID2            MII_PHYSID2
-#define MDIO_SPEED             4       /* Speed ability */
-#define MDIO_DEVS1             5       /* Devices in package */
-#define MDIO_DEVS2             6
-#define MDIO_CTRL2             7       /* 10G control 2 */
-#define MDIO_STAT2             8       /* 10G status 2 */
-#define MDIO_PMA_TXDIS         9       /* 10G PMA/PMD transmit disable */
-#define MDIO_PMA_RXDET         10      /* 10G PMA/PMD receive signal detect */
-#define MDIO_PMA_EXTABLE       11      /* 10G PMA/PMD extended ability */
-#define MDIO_PKGID1            14      /* Package identifier */
-#define MDIO_PKGID2            15
-#define MDIO_AN_ADVERTISE      16      /* AN advertising (base page) */
-#define MDIO_AN_LPA            19      /* AN LP abilities (base page) */
-#define MDIO_PCS_EEE_ABLE      20      /* EEE Capability register */
-#define MDIO_PCS_EEE_WK_ERR    22      /* EEE wake error counter */
-#define MDIO_PHYXS_LNSTAT      24      /* PHY XGXS lane state */
-#define MDIO_AN_EEE_ADV                60      /* EEE advertisement */
-#define MDIO_AN_EEE_LPABLE     61      /* EEE link partner ability */
-
-/* Media-dependent registers. */
-#define MDIO_PMA_10GBT_SWAPPOL 130     /* 10GBASE-T pair swap & polarity */
-#define MDIO_PMA_10GBT_TXPWR   131     /* 10GBASE-T TX power control */
-#define MDIO_PMA_10GBT_SNR     133     /* 10GBASE-T SNR margin, lane A.
-                                        * Lanes B-D are numbered 134-136. */
-#define MDIO_PMA_10GBR_FECABLE 170     /* 10GBASE-R FEC ability */
-#define MDIO_PCS_10GBX_STAT1   24      /* 10GBASE-X PCS status 1 */
-#define MDIO_PCS_10GBRT_STAT1  32      /* 10GBASE-R/-T PCS status 1 */
-#define MDIO_PCS_10GBRT_STAT2  33      /* 10GBASE-R/-T PCS status 2 */
-#define MDIO_AN_10GBT_CTRL     32      /* 10GBASE-T auto-negotiation control */
-#define MDIO_AN_10GBT_STAT     33      /* 10GBASE-T auto-negotiation status */
-
-/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
-#define MDIO_PMA_LASI_RXCTRL   0x9000  /* RX_ALARM control */
-#define MDIO_PMA_LASI_TXCTRL   0x9001  /* TX_ALARM control */
-#define MDIO_PMA_LASI_CTRL     0x9002  /* LASI control */
-#define MDIO_PMA_LASI_RXSTAT   0x9003  /* RX_ALARM status */
-#define MDIO_PMA_LASI_TXSTAT   0x9004  /* TX_ALARM status */
-#define MDIO_PMA_LASI_STAT     0x9005  /* LASI status */
-
-/* Control register 1. */
-/* Enable extended speed selection */
-#define MDIO_CTRL1_SPEEDSELEXT         (BMCR_SPEED1000 | BMCR_SPEED100)
-/* All speed selection bits */
-#define MDIO_CTRL1_SPEEDSEL            (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
-#define MDIO_CTRL1_FULLDPLX            BMCR_FULLDPLX
-#define MDIO_CTRL1_LPOWER              BMCR_PDOWN
-#define MDIO_CTRL1_RESET               BMCR_RESET
-#define MDIO_PMA_CTRL1_LOOPBACK                0x0001
-#define MDIO_PMA_CTRL1_SPEED1000       BMCR_SPEED1000
-#define MDIO_PMA_CTRL1_SPEED100                BMCR_SPEED100
-#define MDIO_PCS_CTRL1_LOOPBACK                BMCR_LOOPBACK
-#define MDIO_PHYXS_CTRL1_LOOPBACK      BMCR_LOOPBACK
-#define MDIO_AN_CTRL1_RESTART          BMCR_ANRESTART
-#define MDIO_AN_CTRL1_ENABLE           BMCR_ANENABLE
-#define MDIO_AN_CTRL1_XNP              0x2000  /* Enable extended next page */
-#define MDIO_PCS_CTRL1_CLKSTOP_EN      0x400   /* Stop the clock during LPI */
-
-/* 10 Gb/s */
-#define MDIO_CTRL1_SPEED10G            (MDIO_CTRL1_SPEEDSELEXT | 0x00)
-/* 10PASS-TS/2BASE-TL */
-#define MDIO_CTRL1_SPEED10P2B          (MDIO_CTRL1_SPEEDSELEXT | 0x04)
-
-/* Status register 1. */
-#define MDIO_STAT1_LPOWERABLE          0x0002  /* Low-power ability */
-#define MDIO_STAT1_LSTATUS             BMSR_LSTATUS
-#define MDIO_STAT1_FAULT               0x0080  /* Fault */
-#define MDIO_AN_STAT1_LPABLE           0x0001  /* Link partner AN ability */
-#define MDIO_AN_STAT1_ABLE             BMSR_ANEGCAPABLE
-#define MDIO_AN_STAT1_RFAULT           BMSR_RFAULT
-#define MDIO_AN_STAT1_COMPLETE         BMSR_ANEGCOMPLETE
-#define MDIO_AN_STAT1_PAGE             0x0040  /* Page received */
-#define MDIO_AN_STAT1_XNP              0x0080  /* Extended next page status */
-
-/* Speed register. */
-#define MDIO_SPEED_10G                 0x0001  /* 10G capable */
-#define MDIO_PMA_SPEED_2B              0x0002  /* 2BASE-TL capable */
-#define MDIO_PMA_SPEED_10P             0x0004  /* 10PASS-TS capable */
-#define MDIO_PMA_SPEED_1000            0x0010  /* 1000M capable */
-#define MDIO_PMA_SPEED_100             0x0020  /* 100M capable */
-#define MDIO_PMA_SPEED_10              0x0040  /* 10M capable */
-#define MDIO_PCS_SPEED_10P2B           0x0002  /* 10PASS-TS/2BASE-TL capable */
-
-/* Device present registers. */
-#define MDIO_DEVS_PRESENT(devad)       (1 << (devad))
-#define MDIO_DEVS_PMAPMD               MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
-#define MDIO_DEVS_WIS                  MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
-#define MDIO_DEVS_PCS                  MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
-#define MDIO_DEVS_PHYXS                        MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
-#define MDIO_DEVS_DTEXS                        MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
-#define MDIO_DEVS_TC                   MDIO_DEVS_PRESENT(MDIO_MMD_TC)
-#define MDIO_DEVS_AN                   MDIO_DEVS_PRESENT(MDIO_MMD_AN)
-#define MDIO_DEVS_C22EXT               MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
-
-/* Control register 2. */
-#define MDIO_PMA_CTRL2_TYPE            0x000f  /* PMA/PMD type selection */
-#define MDIO_PMA_CTRL2_10GBCX4         0x0000  /* 10GBASE-CX4 type */
-#define MDIO_PMA_CTRL2_10GBEW          0x0001  /* 10GBASE-EW type */
-#define MDIO_PMA_CTRL2_10GBLW          0x0002  /* 10GBASE-LW type */
-#define MDIO_PMA_CTRL2_10GBSW          0x0003  /* 10GBASE-SW type */
-#define MDIO_PMA_CTRL2_10GBLX4         0x0004  /* 10GBASE-LX4 type */
-#define MDIO_PMA_CTRL2_10GBER          0x0005  /* 10GBASE-ER type */
-#define MDIO_PMA_CTRL2_10GBLR          0x0006  /* 10GBASE-LR type */
-#define MDIO_PMA_CTRL2_10GBSR          0x0007  /* 10GBASE-SR type */
-#define MDIO_PMA_CTRL2_10GBLRM         0x0008  /* 10GBASE-LRM type */
-#define MDIO_PMA_CTRL2_10GBT           0x0009  /* 10GBASE-T type */
-#define MDIO_PMA_CTRL2_10GBKX4         0x000a  /* 10GBASE-KX4 type */
-#define MDIO_PMA_CTRL2_10GBKR          0x000b  /* 10GBASE-KR type */
-#define MDIO_PMA_CTRL2_1000BT          0x000c  /* 1000BASE-T type */
-#define MDIO_PMA_CTRL2_1000BKX         0x000d  /* 1000BASE-KX type */
-#define MDIO_PMA_CTRL2_100BTX          0x000e  /* 100BASE-TX type */
-#define MDIO_PMA_CTRL2_10BT            0x000f  /* 10BASE-T type */
-#define MDIO_PCS_CTRL2_TYPE            0x0003  /* PCS type selection */
-#define MDIO_PCS_CTRL2_10GBR           0x0000  /* 10GBASE-R type */
-#define MDIO_PCS_CTRL2_10GBX           0x0001  /* 10GBASE-X type */
-#define MDIO_PCS_CTRL2_10GBW           0x0002  /* 10GBASE-W type */
-#define MDIO_PCS_CTRL2_10GBT           0x0003  /* 10GBASE-T type */
-
-/* Status register 2. */
-#define MDIO_STAT2_RXFAULT             0x0400  /* Receive fault */
-#define MDIO_STAT2_TXFAULT             0x0800  /* Transmit fault */
-#define MDIO_STAT2_DEVPRST             0xc000  /* Device present */
-#define MDIO_STAT2_DEVPRST_VAL         0x8000  /* Device present value */
-#define MDIO_PMA_STAT2_LBABLE          0x0001  /* PMA loopback ability */
-#define MDIO_PMA_STAT2_10GBEW          0x0002  /* 10GBASE-EW ability */
-#define MDIO_PMA_STAT2_10GBLW          0x0004  /* 10GBASE-LW ability */
-#define MDIO_PMA_STAT2_10GBSW          0x0008  /* 10GBASE-SW ability */
-#define MDIO_PMA_STAT2_10GBLX4         0x0010  /* 10GBASE-LX4 ability */
-#define MDIO_PMA_STAT2_10GBER          0x0020  /* 10GBASE-ER ability */
-#define MDIO_PMA_STAT2_10GBLR          0x0040  /* 10GBASE-LR ability */
-#define MDIO_PMA_STAT2_10GBSR          0x0080  /* 10GBASE-SR ability */
-#define MDIO_PMD_STAT2_TXDISAB         0x0100  /* PMD TX disable ability */
-#define MDIO_PMA_STAT2_EXTABLE         0x0200  /* Extended abilities */
-#define MDIO_PMA_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
-#define MDIO_PMA_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
-#define MDIO_PCS_STAT2_10GBR           0x0001  /* 10GBASE-R capable */
-#define MDIO_PCS_STAT2_10GBX           0x0002  /* 10GBASE-X capable */
-#define MDIO_PCS_STAT2_10GBW           0x0004  /* 10GBASE-W capable */
-#define MDIO_PCS_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
-#define MDIO_PCS_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
-
-/* Transmit disable register. */
-#define MDIO_PMD_TXDIS_GLOBAL          0x0001  /* Global PMD TX disable */
-#define MDIO_PMD_TXDIS_0               0x0002  /* PMD TX disable 0 */
-#define MDIO_PMD_TXDIS_1               0x0004  /* PMD TX disable 1 */
-#define MDIO_PMD_TXDIS_2               0x0008  /* PMD TX disable 2 */
-#define MDIO_PMD_TXDIS_3               0x0010  /* PMD TX disable 3 */
-
-/* Receive signal detect register. */
-#define MDIO_PMD_RXDET_GLOBAL          0x0001  /* Global PMD RX signal detect */
-#define MDIO_PMD_RXDET_0               0x0002  /* PMD RX signal detect 0 */
-#define MDIO_PMD_RXDET_1               0x0004  /* PMD RX signal detect 1 */
-#define MDIO_PMD_RXDET_2               0x0008  /* PMD RX signal detect 2 */
-#define MDIO_PMD_RXDET_3               0x0010  /* PMD RX signal detect 3 */
-
-/* Extended abilities register. */
-#define MDIO_PMA_EXTABLE_10GCX4                0x0001  /* 10GBASE-CX4 ability */
-#define MDIO_PMA_EXTABLE_10GBLRM       0x0002  /* 10GBASE-LRM ability */
-#define MDIO_PMA_EXTABLE_10GBT         0x0004  /* 10GBASE-T ability */
-#define MDIO_PMA_EXTABLE_10GBKX4       0x0008  /* 10GBASE-KX4 ability */
-#define MDIO_PMA_EXTABLE_10GBKR                0x0010  /* 10GBASE-KR ability */
-#define MDIO_PMA_EXTABLE_1000BT                0x0020  /* 1000BASE-T ability */
-#define MDIO_PMA_EXTABLE_1000BKX       0x0040  /* 1000BASE-KX ability */
-#define MDIO_PMA_EXTABLE_100BTX                0x0080  /* 100BASE-TX ability */
-#define MDIO_PMA_EXTABLE_10BT          0x0100  /* 10BASE-T ability */
-
-/* PHY XGXS lane state register. */
-#define MDIO_PHYXS_LNSTAT_SYNC0                0x0001
-#define MDIO_PHYXS_LNSTAT_SYNC1                0x0002
-#define MDIO_PHYXS_LNSTAT_SYNC2                0x0004
-#define MDIO_PHYXS_LNSTAT_SYNC3                0x0008
-#define MDIO_PHYXS_LNSTAT_ALIGN                0x1000
-
-/* PMA 10GBASE-T pair swap & polarity */
-#define MDIO_PMA_10GBT_SWAPPOL_ABNX    0x0001  /* Pair A/B uncrossed */
-#define MDIO_PMA_10GBT_SWAPPOL_CDNX    0x0002  /* Pair C/D uncrossed */
-#define MDIO_PMA_10GBT_SWAPPOL_AREV    0x0100  /* Pair A polarity reversed */
-#define MDIO_PMA_10GBT_SWAPPOL_BREV    0x0200  /* Pair B polarity reversed */
-#define MDIO_PMA_10GBT_SWAPPOL_CREV    0x0400  /* Pair C polarity reversed */
-#define MDIO_PMA_10GBT_SWAPPOL_DREV    0x0800  /* Pair D polarity reversed */
-
-/* PMA 10GBASE-T TX power register. */
-#define MDIO_PMA_10GBT_TXPWR_SHORT     0x0001  /* Short-reach mode */
-
-/* PMA 10GBASE-T SNR registers. */
-/* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */
-#define MDIO_PMA_10GBT_SNR_BIAS                0x8000
-#define MDIO_PMA_10GBT_SNR_MAX         127
-
-/* PMA 10GBASE-R FEC ability register. */
-#define MDIO_PMA_10GBR_FECABLE_ABLE    0x0001  /* FEC ability */
-#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002  /* FEC error indic. ability */
-
-/* PCS 10GBASE-R/-T status register 1. */
-#define MDIO_PCS_10GBRT_STAT1_BLKLK    0x0001  /* Block lock attained */
-
-/* PCS 10GBASE-R/-T status register 2. */
-#define MDIO_PCS_10GBRT_STAT2_ERR      0x00ff
-#define MDIO_PCS_10GBRT_STAT2_BER      0x3f00
-
-/* AN 10GBASE-T control register. */
-#define MDIO_AN_10GBT_CTRL_ADV10G      0x1000  /* Advertise 10GBASE-T */
-
-/* AN 10GBASE-T status register. */
-#define MDIO_AN_10GBT_STAT_LPTRR       0x0200  /* LP training reset req. */
-#define MDIO_AN_10GBT_STAT_LPLTABLE    0x0400  /* LP loop timing ability */
-#define MDIO_AN_10GBT_STAT_LP10G       0x0800  /* LP is 10GBT capable */
-#define MDIO_AN_10GBT_STAT_REMOK       0x1000  /* Remote OK */
-#define MDIO_AN_10GBT_STAT_LOCOK       0x2000  /* Local OK */
-#define MDIO_AN_10GBT_STAT_MS          0x4000  /* Master/slave config */
-#define MDIO_AN_10GBT_STAT_MSFLT       0x8000  /* Master/slave config fault */
-
-/* EEE Supported/Advertisement/LP Advertisement registers.
- *
- * EEE capability Register (3.20), Advertisement (7.60) and
- * Link partner ability (7.61) registers have and can use the same identical
- * bit masks.
- */
-#define MDIO_AN_EEE_ADV_100TX  0x0002  /* Advertise 100TX EEE cap */
-#define MDIO_AN_EEE_ADV_1000T  0x0004  /* Advertise 1000T EEE cap */
-/* Note: the two defines above can be potentially used by the user-land
- * and cannot remove them now.
- * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
- * using the previous ones (that can be considered obsolete).
- */
-#define MDIO_EEE_100TX         MDIO_AN_EEE_ADV_100TX   /* 100TX EEE cap */
-#define MDIO_EEE_1000T         MDIO_AN_EEE_ADV_1000T   /* 1000T EEE cap */
-#define MDIO_EEE_10GT          0x0008  /* 10GT EEE cap */
-#define MDIO_EEE_1000KX                0x0010  /* 1000KX EEE cap */
-#define MDIO_EEE_10GKX4                0x0020  /* 10G KX4 EEE cap */
-#define MDIO_EEE_10GKR         0x0040  /* 10G KR EEE cap */
-
-/* LASI RX_ALARM control/status registers. */
-#define MDIO_PMA_LASI_RX_PHYXSLFLT     0x0001  /* PHY XS RX local fault */
-#define MDIO_PMA_LASI_RX_PCSLFLT       0x0008  /* PCS RX local fault */
-#define MDIO_PMA_LASI_RX_PMALFLT       0x0010  /* PMA/PMD RX local fault */
-#define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020  /* RX optical power fault */
-#define MDIO_PMA_LASI_RX_WISLFLT       0x0200  /* WIS local fault */
-
-/* LASI TX_ALARM control/status registers. */
-#define MDIO_PMA_LASI_TX_PHYXSLFLT     0x0001  /* PHY XS TX local fault */
-#define MDIO_PMA_LASI_TX_PCSLFLT       0x0008  /* PCS TX local fault */
-#define MDIO_PMA_LASI_TX_PMALFLT       0x0010  /* PMA/PMD TX local fault */
-#define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080  /* Laser output power fault */
-#define MDIO_PMA_LASI_TX_LASERTEMPFLT  0x0100  /* Laser temperature fault */
-#define MDIO_PMA_LASI_TX_LASERBICURRFLT        0x0200  /* Laser bias current fault */
-
-/* LASI control/status registers. */
-#define MDIO_PMA_LASI_LSALARM          0x0001  /* LS_ALARM enable/status */
-#define MDIO_PMA_LASI_TXALARM          0x0002  /* TX_ALARM enable/status */
-#define MDIO_PMA_LASI_RXALARM          0x0004  /* RX_ALARM enable/status */
-
-/* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */
-
-#define MDIO_PHY_ID_C45                        0x8000
-#define MDIO_PHY_ID_PRTAD              0x03e0
-#define MDIO_PHY_ID_DEVAD              0x001f
-#define MDIO_PHY_ID_C45_MASK                                           \
-       (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
-
-static inline __u16 mdio_phy_id_c45(int prtad, int devad)
-{
-       return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
-}
+#include <uapi/linux/mdio.h>
 
-#ifdef __KERNEL__
 
 static inline bool mdio_phy_id_is_c45(int phy_id)
 {
@@ -460,5 +176,4 @@ static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv)
        return reg;
 }
 
-#endif /* __KERNEL__ */
 #endif /* __LINUX_MDIO_H__ */
index cec56932560823ac6a34ce5c5c21bea24316a9ea..e5ccb9ddd90eeb634665e88afd13d56184fff241 100644 (file)
@@ -1,66 +1,10 @@
-#ifndef _LINUX_MEMPOLICY_H
-#define _LINUX_MEMPOLICY_H 1
-
-#include <linux/errno.h>
-
 /*
  * NUMA memory policies for Linux.
  * Copyright 2003,2004 Andi Kleen SuSE Labs
  */
+#ifndef _LINUX_MEMPOLICY_H
+#define _LINUX_MEMPOLICY_H 1
 
-/*
- * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
- * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
- * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
- */
-
-/* Policies */
-enum {
-       MPOL_DEFAULT,
-       MPOL_PREFERRED,
-       MPOL_BIND,
-       MPOL_INTERLEAVE,
-       MPOL_MAX,       /* always last member of enum */
-};
-
-enum mpol_rebind_step {
-       MPOL_REBIND_ONCE,       /* do rebind work at once(not by two step) */
-       MPOL_REBIND_STEP1,      /* first step(set all the newly nodes) */
-       MPOL_REBIND_STEP2,      /* second step(clean all the disallowed nodes)*/
-       MPOL_REBIND_NSTEP,
-};
-
-/* Flags for set_mempolicy */
-#define MPOL_F_STATIC_NODES    (1 << 15)
-#define MPOL_F_RELATIVE_NODES  (1 << 14)
-
-/*
- * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
- * either set_mempolicy() or mbind().
- */
-#define MPOL_MODE_FLAGS        (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
-
-/* Flags for get_mempolicy */
-#define MPOL_F_NODE    (1<<0)  /* return next IL mode instead of node mask */
-#define MPOL_F_ADDR    (1<<1)  /* look up vma using address */
-#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
-
-/* Flags for mbind */
-#define MPOL_MF_STRICT (1<<0)  /* Verify existing pages in the mapping */
-#define MPOL_MF_MOVE   (1<<1)  /* Move pages owned by this process to conform to mapping */
-#define MPOL_MF_MOVE_ALL (1<<2)        /* Move every page to conform to mapping */
-#define MPOL_MF_INTERNAL (1<<3)        /* Internal flags start here */
-
-/*
- * Internal flags that share the struct mempolicy flags word with
- * "mode flags".  These flags are allocated from bit 0 up, as they
- * are never OR'ed into the mode in mempolicy API arguments.
- */
-#define MPOL_F_SHARED  (1 << 0)        /* identify shared policies */
-#define MPOL_F_LOCAL   (1 << 1)        /* preferred local allocation */
-#define MPOL_F_REBINDING (1 << 2)      /* identify policies in rebinding */
-
-#ifdef __KERNEL__
 
 #include <linux/mmzone.h>
 #include <linux/slab.h>
@@ -68,6 +12,7 @@ enum mpol_rebind_step {
 #include <linux/spinlock.h>
 #include <linux/nodemask.h>
 #include <linux/pagemap.h>
+#include <uapi/linux/mempolicy.h>
 
 struct mm_struct;
 
@@ -379,6 +324,4 @@ static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
 }
 
 #endif /* CONFIG_NUMA */
-#endif /* __KERNEL__ */
-
 #endif
index 8ef3a7a115924593b2968c180d01a5763e931f72..47492c9631b3826fb8a52a53f6dbbdcbb7bbe2e3 100644 (file)
  *
  * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
  */
-
 #ifndef __LINUX_MII_H__
 #define __LINUX_MII_H__
 
-#include <linux/types.h>
-#include <linux/ethtool.h>
-
-/* Generic MII registers. */
-#define MII_BMCR               0x00    /* Basic mode control register */
-#define MII_BMSR               0x01    /* Basic mode status register  */
-#define MII_PHYSID1            0x02    /* PHYS ID 1                   */
-#define MII_PHYSID2            0x03    /* PHYS ID 2                   */
-#define MII_ADVERTISE          0x04    /* Advertisement control reg   */
-#define MII_LPA                        0x05    /* Link partner ability reg    */
-#define MII_EXPANSION          0x06    /* Expansion register          */
-#define MII_CTRL1000           0x09    /* 1000BASE-T control          */
-#define MII_STAT1000           0x0a    /* 1000BASE-T status           */
-#define        MII_MMD_CTRL            0x0d    /* MMD Access Control Register */
-#define        MII_MMD_DATA            0x0e    /* MMD Access Data Register */
-#define MII_ESTATUS            0x0f    /* Extended Status             */
-#define MII_DCOUNTER           0x12    /* Disconnect counter          */
-#define MII_FCSCOUNTER         0x13    /* False carrier counter       */
-#define MII_NWAYTEST           0x14    /* N-way auto-neg test reg     */
-#define MII_RERRCOUNTER                0x15    /* Receive error counter       */
-#define MII_SREVISION          0x16    /* Silicon revision            */
-#define MII_RESV1              0x17    /* Reserved...                 */
-#define MII_LBRERROR           0x18    /* Lpback, rx, bypass error    */
-#define MII_PHYADDR            0x19    /* PHY address                 */
-#define MII_RESV2              0x1a    /* Reserved...                 */
-#define MII_TPISTATUS          0x1b    /* TPI status for 10mbps       */
-#define MII_NCONFIG            0x1c    /* Network interface config    */
-
-/* Basic mode control register. */
-#define BMCR_RESV              0x003f  /* Unused...                   */
-#define BMCR_SPEED1000         0x0040  /* MSB of Speed (1000)         */
-#define BMCR_CTST              0x0080  /* Collision test              */
-#define BMCR_FULLDPLX          0x0100  /* Full duplex                 */
-#define BMCR_ANRESTART         0x0200  /* Auto negotiation restart    */
-#define BMCR_ISOLATE           0x0400  /* Isolate data paths from MII */
-#define BMCR_PDOWN             0x0800  /* Enable low power state      */
-#define BMCR_ANENABLE          0x1000  /* Enable auto negotiation     */
-#define BMCR_SPEED100          0x2000  /* Select 100Mbps              */
-#define BMCR_LOOPBACK          0x4000  /* TXD loopback bits           */
-#define BMCR_RESET             0x8000  /* Reset to default state      */
-
-/* Basic mode status register. */
-#define BMSR_ERCAP             0x0001  /* Ext-reg capability          */
-#define BMSR_JCD               0x0002  /* Jabber detected             */
-#define BMSR_LSTATUS           0x0004  /* Link status                 */
-#define BMSR_ANEGCAPABLE       0x0008  /* Able to do auto-negotiation */
-#define BMSR_RFAULT            0x0010  /* Remote fault detected       */
-#define BMSR_ANEGCOMPLETE      0x0020  /* Auto-negotiation complete   */
-#define BMSR_RESV              0x00c0  /* Unused...                   */
-#define BMSR_ESTATEN           0x0100  /* Extended Status in R15      */
-#define BMSR_100HALF2          0x0200  /* Can do 100BASE-T2 HDX       */
-#define BMSR_100FULL2          0x0400  /* Can do 100BASE-T2 FDX       */
-#define BMSR_10HALF            0x0800  /* Can do 10mbps, half-duplex  */
-#define BMSR_10FULL            0x1000  /* Can do 10mbps, full-duplex  */
-#define BMSR_100HALF           0x2000  /* Can do 100mbps, half-duplex */
-#define BMSR_100FULL           0x4000  /* Can do 100mbps, full-duplex */
-#define BMSR_100BASE4          0x8000  /* Can do 100mbps, 4k packets  */
-
-/* Advertisement control register. */
-#define ADVERTISE_SLCT         0x001f  /* Selector bits               */
-#define ADVERTISE_CSMA         0x0001  /* Only selector supported     */
-#define ADVERTISE_10HALF       0x0020  /* Try for 10mbps half-duplex  */
-#define ADVERTISE_1000XFULL    0x0020  /* Try for 1000BASE-X full-duplex */
-#define ADVERTISE_10FULL       0x0040  /* Try for 10mbps full-duplex  */
-#define ADVERTISE_1000XHALF    0x0040  /* Try for 1000BASE-X half-duplex */
-#define ADVERTISE_100HALF      0x0080  /* Try for 100mbps half-duplex */
-#define ADVERTISE_1000XPAUSE   0x0080  /* Try for 1000BASE-X pause    */
-#define ADVERTISE_100FULL      0x0100  /* Try for 100mbps full-duplex */
-#define ADVERTISE_1000XPSE_ASYM        0x0100  /* Try for 1000BASE-X asym pause */
-#define ADVERTISE_100BASE4     0x0200  /* Try for 100mbps 4k packets  */
-#define ADVERTISE_PAUSE_CAP    0x0400  /* Try for pause               */
-#define ADVERTISE_PAUSE_ASYM   0x0800  /* Try for asymetric pause     */
-#define ADVERTISE_RESV         0x1000  /* Unused...                   */
-#define ADVERTISE_RFAULT       0x2000  /* Say we can detect faults    */
-#define ADVERTISE_LPACK                0x4000  /* Ack link partners response  */
-#define ADVERTISE_NPAGE                0x8000  /* Next page bit               */
-
-#define ADVERTISE_FULL         (ADVERTISE_100FULL | ADVERTISE_10FULL | \
-                                 ADVERTISE_CSMA)
-#define ADVERTISE_ALL          (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-                                 ADVERTISE_100HALF | ADVERTISE_100FULL)
-
-/* Link partner ability register. */
-#define LPA_SLCT               0x001f  /* Same as advertise selector  */
-#define LPA_10HALF             0x0020  /* Can do 10mbps half-duplex   */
-#define LPA_1000XFULL          0x0020  /* Can do 1000BASE-X full-duplex */
-#define LPA_10FULL             0x0040  /* Can do 10mbps full-duplex   */
-#define LPA_1000XHALF          0x0040  /* Can do 1000BASE-X half-duplex */
-#define LPA_100HALF            0x0080  /* Can do 100mbps half-duplex  */
-#define LPA_1000XPAUSE         0x0080  /* Can do 1000BASE-X pause     */
-#define LPA_100FULL            0x0100  /* Can do 100mbps full-duplex  */
-#define LPA_1000XPAUSE_ASYM    0x0100  /* Can do 1000BASE-X pause asym*/
-#define LPA_100BASE4           0x0200  /* Can do 100mbps 4k packets   */
-#define LPA_PAUSE_CAP          0x0400  /* Can pause                   */
-#define LPA_PAUSE_ASYM         0x0800  /* Can pause asymetrically     */
-#define LPA_RESV               0x1000  /* Unused...                   */
-#define LPA_RFAULT             0x2000  /* Link partner faulted        */
-#define LPA_LPACK              0x4000  /* Link partner acked us       */
-#define LPA_NPAGE              0x8000  /* Next page bit               */
-
-#define LPA_DUPLEX             (LPA_10FULL | LPA_100FULL)
-#define LPA_100                        (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
-
-/* Expansion register for auto-negotiation. */
-#define EXPANSION_NWAY         0x0001  /* Can do N-way auto-nego      */
-#define EXPANSION_LCWP         0x0002  /* Got new RX page code word   */
-#define EXPANSION_ENABLENPAGE  0x0004  /* This enables npage words    */
-#define EXPANSION_NPCAPABLE    0x0008  /* Link partner supports npage */
-#define EXPANSION_MFAULTS      0x0010  /* Multiple faults detected    */
-#define EXPANSION_RESV         0xffe0  /* Unused...                   */
-
-#define ESTATUS_1000_TFULL     0x2000  /* Can do 1000BT Full          */
-#define ESTATUS_1000_THALF     0x1000  /* Can do 1000BT Half          */
-
-/* N-way test register. */
-#define NWAYTEST_RESV1         0x00ff  /* Unused...                   */
-#define NWAYTEST_LOOPBACK      0x0100  /* Enable loopback for N-way   */
-#define NWAYTEST_RESV2         0xfe00  /* Unused...                   */
-
-/* 1000BASE-T Control register */
-#define ADVERTISE_1000FULL     0x0200  /* Advertise 1000BASE-T full duplex */
-#define ADVERTISE_1000HALF     0x0100  /* Advertise 1000BASE-T half duplex */
-#define CTL1000_AS_MASTER      0x0800
-#define CTL1000_ENABLE_MASTER  0x1000
-
-/* 1000BASE-T Status register */
-#define LPA_1000LOCALRXOK      0x2000  /* Link partner local receiver status */
-#define LPA_1000REMRXOK                0x1000  /* Link partner remote receiver status */
-#define LPA_1000FULL           0x0800  /* Link partner 1000BASE-T full duplex */
-#define LPA_1000HALF           0x0400  /* Link partner 1000BASE-T half duplex */
-
-/* Flow control flags */
-#define FLOW_CTRL_TX           0x01
-#define FLOW_CTRL_RX           0x02
-
-/* MMD Access Control register fields */
-#define MII_MMD_CTRL_DEVAD_MASK        0x1f    /* Mask MMD DEVAD*/
-#define MII_MMD_CTRL_ADDR      0x0000  /* Address */
-#define MII_MMD_CTRL_NOINCR    0x4000  /* no post increment */
-#define MII_MMD_CTRL_INCR_RDWT 0x8000  /* post increment on reads & writes */
-#define MII_MMD_CTRL_INCR_ON_WT        0xC000  /* post increment on writes only */
-
-/* This structure is used in all SIOCxMIIxxx ioctl calls */
-struct mii_ioctl_data {
-       __u16           phy_id;
-       __u16           reg_num;
-       __u16           val_in;
-       __u16           val_out;
-};
-
-#ifdef __KERNEL__
 
 #include <linux/if.h>
+#include <uapi/linux/mii.h>
 
 struct ethtool_cmd;
 
@@ -487,5 +336,4 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
        return cap;
 }
 
-#endif /* __KERNEL__ */
 #endif /* __LINUX_MII_H__ */
index 77cec2f45cb77d54c19b049f086d51c2db3a980b..d09dde1e57fb43e2f5be170d31e8fceb8c41a389 100644 (file)
@@ -1,20 +1,11 @@
 #ifndef _LINUX_MMAN_H
 #define _LINUX_MMAN_H
 
-#include <asm/mman.h>
-
-#define MREMAP_MAYMOVE 1
-#define MREMAP_FIXED   2
-
-#define OVERCOMMIT_GUESS               0
-#define OVERCOMMIT_ALWAYS              1
-#define OVERCOMMIT_NEVER               2
-
-#ifdef __KERNEL__
 #include <linux/mm.h>
 #include <linux/percpu_counter.h>
 
 #include <linux/atomic.h>
+#include <uapi/linux/mman.h>
 
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
@@ -88,5 +79,4 @@ calc_vm_flag_bits(unsigned long flags)
               _calc_vm_trans(flags, MAP_DENYWRITE,  VM_DENYWRITE ) |
               _calc_vm_trans(flags, MAP_LOCKED,     VM_LOCKED    );
 }
-#endif /* __KERNEL__ */
 #endif /* _LINUX_MMAN_H */
index fbcafe2ee13ec5da6b8f7a7db9dcfe38be6ec556..7760c6d344a32cd6a59cbb163a56c9bcd4888683 100644 (file)
@@ -21,6 +21,9 @@
 #include <linux/percpu.h>
 #include <asm/module.h>
 
+/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
+#define MODULE_SIG_STRING "~Module signature appended~\n"
+
 /* Not Yet Implemented */
 #define MODULE_SUPPORTED_DEVICE(name)
 
@@ -260,6 +263,11 @@ struct module
        const unsigned long *unused_gpl_crcs;
 #endif
 
+#ifdef CONFIG_MODULE_SIG
+       /* Signature was verified. */
+       bool sig_ok;
+#endif
+
        /* symbols that will be GPL-only in the near future. */
        const struct kernel_symbol *gpl_future_syms;
        const unsigned long *gpl_future_crcs;
index b2be02ebf453df40cb07ab7fdfa261903fa44c11..560ca53a75fa629b1be138b07f865f95c07b2bb3 100644 (file)
@@ -28,21 +28,49 @@ void *module_alloc(unsigned long size);
 /* Free memory returned from module_alloc. */
 void module_free(struct module *mod, void *module_region);
 
-/* Apply the given relocation to the (simplified) ELF.  Return -error
-   or 0. */
+/*
+ * Apply the given relocation to the (simplified) ELF.  Return -error
+ * or 0.
+ */
+#ifdef CONFIG_MODULES_USE_ELF_REL
 int apply_relocate(Elf_Shdr *sechdrs,
                   const char *strtab,
                   unsigned int symindex,
                   unsigned int relsec,
                   struct module *mod);
+#else
+static inline int apply_relocate(Elf_Shdr *sechdrs,
+                                const char *strtab,
+                                unsigned int symindex,
+                                unsigned int relsec,
+                                struct module *me)
+{
+       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+       return -ENOEXEC;
+}
+#endif
 
-/* Apply the given add relocation to the (simplified) ELF.  Return
-   -error or 0 */
+/*
+ * Apply the given add relocation to the (simplified) ELF.  Return
+ * -error or 0
+ */
+#ifdef CONFIG_MODULES_USE_ELF_RELA
 int apply_relocate_add(Elf_Shdr *sechdrs,
                       const char *strtab,
                       unsigned int symindex,
                       unsigned int relsec,
                       struct module *mod);
+#else
+static inline int apply_relocate_add(Elf_Shdr *sechdrs,
+                                    const char *strtab,
+                                    unsigned int symindex,
+                                    unsigned int relsec,
+                                    struct module *me)
+{
+       printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+       return -ENOEXEC;
+}
+#endif
 
 /* Any final processing of module before access.  Return -error or 0. */
 int module_finalize(const Elf_Ehdr *hdr,
index d02cca6cc8ce0552bcf652a29b5562979f72f056..5af1b81def49f6f98ec5783c60fb4fabe0a62c46 100644 (file)
@@ -76,6 +76,7 @@ void mpi_swap(MPI a, MPI b);
 
 /*-- mpicoder.c --*/
 MPI do_encode_md(const void *sha_buffer, unsigned nbits);
+MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes);
 MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread);
 int mpi_fromstr(MPI val, const char *str);
 u32 mpi_get_keyid(MPI a, u32 *keyid);
index 46caaf44339d6e706bd822218f4d56616eb51671..ea00d9162ee57c858954e8ec8cd36d4ebf0f15e0 100644 (file)
 #ifndef __LINUX_MROUTE_H
 #define __LINUX_MROUTE_H
 
-#include <linux/sockios.h>
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/in.h>
-#endif
-
-/*
- *     Based on the MROUTING 3.5 defines primarily to keep
- *     source compatibility with BSD.
- *
- *     See the mrouted code for the original history.
- *
- *      Protocol Independent Multicast (PIM) data structures included
- *      Carlos Picoto (cap@di.fc.ul.pt)
- *
- */
-
-#define MRT_BASE       200
-#define MRT_INIT       (MRT_BASE)      /* Activate the kernel mroute code      */
-#define MRT_DONE       (MRT_BASE+1)    /* Shutdown the kernel mroute           */
-#define MRT_ADD_VIF    (MRT_BASE+2)    /* Add a virtual interface              */
-#define MRT_DEL_VIF    (MRT_BASE+3)    /* Delete a virtual interface           */
-#define MRT_ADD_MFC    (MRT_BASE+4)    /* Add a multicast forwarding entry     */
-#define MRT_DEL_MFC    (MRT_BASE+5)    /* Delete a multicast forwarding entry  */
-#define MRT_VERSION    (MRT_BASE+6)    /* Get the kernel multicast version     */
-#define MRT_ASSERT     (MRT_BASE+7)    /* Activate PIM assert mode             */
-#define MRT_PIM                (MRT_BASE+8)    /* enable PIM code                      */
-#define MRT_TABLE      (MRT_BASE+9)    /* Specify mroute table ID              */
-
-#define SIOCGETVIFCNT  SIOCPROTOPRIVATE        /* IP protocol privates */
-#define SIOCGETSGCNT   (SIOCPROTOPRIVATE+1)
-#define SIOCGETRPF     (SIOCPROTOPRIVATE+2)
-
-#define MAXVIFS                32      
-typedef unsigned long vifbitmap_t;     /* User mode code depends on this lot */
-typedef unsigned short vifi_t;
-#define ALL_VIFS       ((vifi_t)(-1))
-
-/*
- *     Same idea as select
- */
-#define VIFM_SET(n,m)  ((m)|=(1<<(n)))
-#define VIFM_CLR(n,m)  ((m)&=~(1<<(n)))
-#define VIFM_ISSET(n,m)        ((m)&(1<<(n)))
-#define VIFM_CLRALL(m) ((m)=0)
-#define VIFM_COPY(mfrom,mto)   ((mto)=(mfrom))
-#define VIFM_SAME(m1,m2)       ((m1)==(m2))
-
-/*
- *     Passed by mrouted for an MRT_ADD_VIF - again we use the
- *     mrouted 3.6 structures for compatibility
- */
-struct vifctl {
-       vifi_t  vifc_vifi;              /* Index of VIF */
-       unsigned char vifc_flags;       /* VIFF_ flags */
-       unsigned char vifc_threshold;   /* ttl limit */
-       unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
-       union {
-               struct in_addr vifc_lcl_addr;     /* Local interface address */
-               int            vifc_lcl_ifindex;  /* Local interface index   */
-       };
-       struct in_addr vifc_rmt_addr;   /* IPIP tunnel addr */
-};
-
-#define VIFF_TUNNEL            0x1     /* IPIP tunnel */
-#define VIFF_SRCRT             0x2     /* NI */
-#define VIFF_REGISTER          0x4     /* register vif */
-#define VIFF_USE_IFINDEX       0x8     /* use vifc_lcl_ifindex instead of
-                                          vifc_lcl_addr to find an interface */
-
-/*
- *     Cache manipulation structures for mrouted and PIMd
- */
-struct mfcctl {
-       struct in_addr mfcc_origin;             /* Origin of mcast      */
-       struct in_addr mfcc_mcastgrp;           /* Group in question    */
-       vifi_t  mfcc_parent;                    /* Where it arrived     */
-       unsigned char mfcc_ttls[MAXVIFS];       /* Where it is going    */
-       unsigned int mfcc_pkt_cnt;              /* pkt count for src-grp */
-       unsigned int mfcc_byte_cnt;
-       unsigned int mfcc_wrong_if;
-       int          mfcc_expire;
-};
-
-/* 
- *     Group count retrieval for mrouted
- */
-struct sioc_sg_req {
-       struct in_addr src;
-       struct in_addr grp;
-       unsigned long pktcnt;
-       unsigned long bytecnt;
-       unsigned long wrong_if;
-};
-
-/*
- *     To get vif packet counts
- */
-
-struct sioc_vif_req {
-       vifi_t  vifi;           /* Which iface */
-       unsigned long icount;   /* In packets */
-       unsigned long ocount;   /* Out packets */
-       unsigned long ibytes;   /* In bytes */
-       unsigned long obytes;   /* Out bytes */
-};
-
-/*
- *     This is the format the mroute daemon expects to see IGMP control
- *     data. Magically happens to be like an IP packet as per the original
- */
-struct igmpmsg {
-       __u32 unused1,unused2;
-       unsigned char im_msgtype;               /* What is this */
-       unsigned char im_mbz;                   /* Must be zero */
-       unsigned char im_vif;                   /* Interface (this ought to be a vifi_t!) */
-       unsigned char unused3;
-       struct in_addr im_src,im_dst;
-};
-
-/*
- *     That's all usermode folks
- */
-
-#ifdef __KERNEL__
 #include <linux/pim.h>
 #include <net/sock.h>
+#include <uapi/linux/mroute.h>
 
 #ifdef CONFIG_IP_MROUTE
 static inline int ip_mroute_opt(int opt)
@@ -228,24 +100,8 @@ struct mfc_cache {
 #define MFC_HASH(a,b)  ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
 #endif         
 
-#endif
-
-
-#define MFC_ASSERT_THRESH (3*HZ)               /* Maximal freq. of asserts */
-
-/*
- *     Pseudo messages used by mrouted
- */
-
-#define IGMPMSG_NOCACHE                1               /* Kern cache fill request to mrouted */
-#define IGMPMSG_WRONGVIF       2               /* For PIM assert processing (unused) */
-#define IGMPMSG_WHOLEPKT       3               /* For PIM Register processing */
-
-#ifdef __KERNEL__
 struct rtmsg;
 extern int ipmr_get_route(struct net *net, struct sk_buff *skb,
                          __be32 saddr, __be32 daddr,
                          struct rtmsg *rtm, int nowait);
 #endif
-
-#endif
index 6d8c7251eb8d4147968c6a146473868caa0eebbc..a223561ba12e397e89d23dcd2ed3fd3e4311645a 100644 (file)
 #ifndef __LINUX_MROUTE6_H
 #define __LINUX_MROUTE6_H
 
-#include <linux/types.h>
-#include <linux/sockios.h>
-
-/*
- *     Based on the MROUTING 3.5 defines primarily to keep
- *     source compatibility with BSD.
- *
- *     See the pim6sd code for the original history.
- *
- *      Protocol Independent Multicast (PIM) data structures included
- *      Carlos Picoto (cap@di.fc.ul.pt)
- *
- */
-
-#define MRT6_BASE      200
-#define MRT6_INIT      (MRT6_BASE)     /* Activate the kernel mroute code      */
-#define MRT6_DONE      (MRT6_BASE+1)   /* Shutdown the kernel mroute           */
-#define MRT6_ADD_MIF   (MRT6_BASE+2)   /* Add a virtual interface              */
-#define MRT6_DEL_MIF   (MRT6_BASE+3)   /* Delete a virtual interface           */
-#define MRT6_ADD_MFC   (MRT6_BASE+4)   /* Add a multicast forwarding entry     */
-#define MRT6_DEL_MFC   (MRT6_BASE+5)   /* Delete a multicast forwarding entry  */
-#define MRT6_VERSION   (MRT6_BASE+6)   /* Get the kernel multicast version     */
-#define MRT6_ASSERT    (MRT6_BASE+7)   /* Activate PIM assert mode             */
-#define MRT6_PIM       (MRT6_BASE+8)   /* enable PIM code                      */
-#define MRT6_TABLE     (MRT6_BASE+9)   /* Specify mroute table ID              */
-
-#define SIOCGETMIFCNT_IN6      SIOCPROTOPRIVATE        /* IP protocol privates */
-#define SIOCGETSGCNT_IN6       (SIOCPROTOPRIVATE+1)
-#define SIOCGETRPF     (SIOCPROTOPRIVATE+2)
-
-#define MAXMIFS                32
-typedef unsigned long mifbitmap_t;     /* User mode code depends on this lot */
-typedef unsigned short mifi_t;
-#define ALL_MIFS       ((mifi_t)(-1))
-
-#ifndef IF_SETSIZE
-#define IF_SETSIZE     256
-#endif
-
-typedef        __u32           if_mask;
-#define NIFBITS (sizeof(if_mask) * 8)        /* bits per mask */
-
-#if !defined(__KERNEL__)
-#if !defined(DIV_ROUND_UP)
-#define        DIV_ROUND_UP(x,y)       (((x) + ((y) - 1)) / (y))
-#endif
-#endif
-
-typedef struct if_set {
-       if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
-} if_set;
-
-#define IF_SET(n, p)    ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
-#define IF_CLR(n, p)    ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
-#define IF_ISSET(n, p)  ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
-#define IF_COPY(f, t)   bcopy(f, t, sizeof(*(f)))
-#define IF_ZERO(p)      bzero(p, sizeof(*(p)))
-
-/*
- *     Passed by mrouted for an MRT_ADD_MIF - again we use the
- *     mrouted 3.6 structures for compatibility
- */
-
-struct mif6ctl {
-       mifi_t  mif6c_mifi;             /* Index of MIF */
-       unsigned char mif6c_flags;      /* MIFF_ flags */
-       unsigned char vifc_threshold;   /* ttl limit */
-       __u16    mif6c_pifi;            /* the index of the physical IF */
-       unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
-};
-
-#define MIFF_REGISTER  0x1     /* register vif */
-
-/*
- *     Cache manipulation structures for mrouted and PIMd
- */
-
-struct mf6cctl {
-       struct sockaddr_in6 mf6cc_origin;               /* Origin of mcast      */
-       struct sockaddr_in6 mf6cc_mcastgrp;             /* Group in question    */
-       mifi_t  mf6cc_parent;                   /* Where it arrived     */
-       struct if_set mf6cc_ifset;              /* Where it is going */
-};
-
-/*
- *     Group count retrieval for pim6sd
- */
-
-struct sioc_sg_req6 {
-       struct sockaddr_in6 src;
-       struct sockaddr_in6 grp;
-       unsigned long pktcnt;
-       unsigned long bytecnt;
-       unsigned long wrong_if;
-};
-
-/*
- *     To get vif packet counts
- */
-
-struct sioc_mif_req6 {
-       mifi_t  mifi;           /* Which iface */
-       unsigned long icount;   /* In packets */
-       unsigned long ocount;   /* Out packets */
-       unsigned long ibytes;   /* In bytes */
-       unsigned long obytes;   /* Out bytes */
-};
-
-/*
- *     That's all usermode folks
- */
-
-#ifdef __KERNEL__
 
 #include <linux/pim.h>
 #include <linux/skbuff.h>      /* for struct sk_buff_head */
 #include <net/net_namespace.h>
+#include <uapi/linux/mroute6.h>
 
 #ifdef CONFIG_IPV6_MROUTE
 static inline int ip6_mroute_opt(int opt)
@@ -225,9 +113,6 @@ struct mfc6_cache {
 
 #define MFC_ASSERT_THRESH (3*HZ)               /* Maximal freq. of asserts */
 
-#endif
-
-#ifdef __KERNEL__
 struct rtmsg;
 extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
                           struct rtmsg *rtm, int nowait);
@@ -246,24 +131,3 @@ static inline int ip6mr_sk_done(struct sock *sk)
 }
 #endif
 #endif
-
-/*
- * Structure used to communicate from kernel to multicast router.
- * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
- * used for IPv4 implementation). This is because this structure will be passed via an
- * IPv6 raw socket, on which an application will only receiver the payload i.e the data after
- * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
- */
-
-struct mrt6msg {
-#define MRT6MSG_NOCACHE                1
-#define MRT6MSG_WRONGMIF       2
-#define MRT6MSG_WHOLEPKT       3               /* used for use level encap */
-       __u8            im6_mbz;                /* must be zero            */
-       __u8            im6_msgtype;            /* what type of message    */
-       __u16           im6_mif;                /* mif rec'd on            */
-       __u32           im6_pad;                /* padding for 64 bit arch */
-       struct in6_addr im6_src, im6_dst;
-};
-
-#endif
index 11cc2ac67e756af2b633a8badabcc49f4ffe8cb7..e1b163f912fbf0ad484c2435d08577f7929452b6 100644 (file)
 #ifndef _LINUX_MSDOS_FS_H
 #define _LINUX_MSDOS_FS_H
 
-#include <linux/types.h>
-#include <linux/magic.h>
-#include <asm/byteorder.h>
+#include <uapi/linux/msdos_fs.h>
 
-/*
- * The MS-DOS filesystem constants/structures
- */
-
-#define SECTOR_SIZE    512             /* sector size (bytes) */
-#define SECTOR_BITS    9               /* log2(SECTOR_SIZE) */
-#define MSDOS_DPB      (MSDOS_DPS)     /* dir entries per block */
-#define MSDOS_DPB_BITS 4               /* log2(MSDOS_DPB) */
-#define MSDOS_DPS      (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
-#define MSDOS_DPS_BITS 4               /* log2(MSDOS_DPS) */
-#define MSDOS_LONGNAME 256             /* maximum name length */
-#define CF_LE_W(v)     le16_to_cpu(v)
-#define CF_LE_L(v)     le32_to_cpu(v)
-#define CT_LE_W(v)     cpu_to_le16(v)
-#define CT_LE_L(v)     cpu_to_le32(v)
-
-#define MSDOS_ROOT_INO  1      /* The root inode number */
-#define MSDOS_FSINFO_INO 2     /* Used for managing the FSINFO block */
-
-#define MSDOS_DIR_BITS 5       /* log2(sizeof(struct msdos_dir_entry)) */
-
-/* directory limit */
-#define FAT_MAX_DIR_ENTRIES    (65536)
-#define FAT_MAX_DIR_SIZE       (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
-
-#define ATTR_NONE      0       /* no attribute bits */
-#define ATTR_RO                1       /* read-only */
-#define ATTR_HIDDEN    2       /* hidden */
-#define ATTR_SYS       4       /* system */
-#define ATTR_VOLUME    8       /* volume label */
-#define ATTR_DIR       16      /* directory */
-#define ATTR_ARCH      32      /* archived */
-
-/* attribute bits that are copied "as is" */
-#define ATTR_UNUSED    (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
-/* bits that are used by the Windows 95/Windows NT extended FAT */
-#define ATTR_EXT       (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
-
-#define CASE_LOWER_BASE        8       /* base is lower case */
-#define CASE_LOWER_EXT 16      /* extension is lower case */
-
-#define DELETED_FLAG   0xe5    /* marks file as deleted when in name[0] */
-#define IS_FREE(n)     (!*(n) || *(n) == DELETED_FLAG)
-
-#define FAT_LFN_LEN    255     /* maximum long name length */
-#define MSDOS_NAME     11      /* maximum name length */
-#define MSDOS_SLOTS    21      /* max # of slots for short and long names */
-#define MSDOS_DOT      ".          "   /* ".", padded to MSDOS_NAME chars */
-#define MSDOS_DOTDOT   "..         "   /* "..", padded to MSDOS_NAME chars */
-
-#define FAT_FIRST_ENT(s, x)    ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
-       MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
-
-/* start of data cluster's entry (number of reserved clusters) */
-#define FAT_START_ENT  2
-
-/* maximum number of clusters */
-#define MAX_FAT12      0xFF4
-#define MAX_FAT16      0xFFF4
-#define MAX_FAT32      0x0FFFFFF6
-#define MAX_FAT(s)     (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
-       MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
-
-/* bad cluster mark */
-#define BAD_FAT12      0xFF7
-#define BAD_FAT16      0xFFF7
-#define BAD_FAT32      0x0FFFFFF7
-
-/* standard EOF */
-#define EOF_FAT12      0xFFF
-#define EOF_FAT16      0xFFFF
-#define EOF_FAT32      0x0FFFFFFF
-
-#define FAT_ENT_FREE   (0)
-#define FAT_ENT_BAD    (BAD_FAT32)
-#define FAT_ENT_EOF    (EOF_FAT32)
-
-#define FAT_FSINFO_SIG1        0x41615252
-#define FAT_FSINFO_SIG2        0x61417272
-#define IS_FSINFO(x)   (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
-                        && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
-
-struct __fat_dirent {
-       long            d_ino;
-       __kernel_off_t  d_off;
-       unsigned short  d_reclen;
-       char            d_name[256]; /* We must not include limits.h! */
-};
-
-/*
- * ioctl commands
- */
-#define VFAT_IOCTL_READDIR_BOTH                _IOR('r', 1, struct __fat_dirent[2])
-#define VFAT_IOCTL_READDIR_SHORT       _IOR('r', 2, struct __fat_dirent[2])
-/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
-#define FAT_IOCTL_GET_ATTRIBUTES       _IOR('r', 0x10, __u32)
-#define FAT_IOCTL_SET_ATTRIBUTES       _IOW('r', 0x11, __u32)
-
-struct fat_boot_sector {
-       __u8    ignored[3];     /* Boot strap short or near jump */
-       __u8    system_id[8];   /* Name - can be used to special case
-                                  partition manager volumes */
-       __u8    sector_size[2]; /* bytes per logical sector */
-       __u8    sec_per_clus;   /* sectors/cluster */
-       __le16  reserved;       /* reserved sectors */
-       __u8    fats;           /* number of FATs */
-       __u8    dir_entries[2]; /* root directory entries */
-       __u8    sectors[2];     /* number of sectors */
-       __u8    media;          /* media code */
-       __le16  fat_length;     /* sectors/FAT */
-       __le16  secs_track;     /* sectors per track */
-       __le16  heads;          /* number of heads */
-       __le32  hidden;         /* hidden sectors (unused) */
-       __le32  total_sect;     /* number of sectors (if sectors == 0) */
-
-       /* The following fields are only used by FAT32 */
-       __le32  fat32_length;   /* sectors/FAT */
-       __le16  flags;          /* bit 8: fat mirroring, low 4: active fat */
-       __u8    version[2];     /* major, minor filesystem version */
-       __le32  root_cluster;   /* first cluster in root directory */
-       __le16  info_sector;    /* filesystem info sector */
-       __le16  backup_boot;    /* backup boot sector */
-       __le16  reserved2[6];   /* Unused */
-};
-
-struct fat_boot_fsinfo {
-       __le32   signature1;    /* 0x41615252L */
-       __le32   reserved1[120];        /* Nothing as far as I can tell */
-       __le32   signature2;    /* 0x61417272L */
-       __le32   free_clusters; /* Free cluster count.  -1 if unknown */
-       __le32   next_cluster;  /* Most recently allocated cluster */
-       __le32   reserved2[4];
-};
-
-struct msdos_dir_entry {
-       __u8    name[MSDOS_NAME];/* name and extension */
-       __u8    attr;           /* attribute bits */
-       __u8    lcase;          /* Case for base and extension */
-       __u8    ctime_cs;       /* Creation time, centiseconds (0-199) */
-       __le16  ctime;          /* Creation time */
-       __le16  cdate;          /* Creation date */
-       __le16  adate;          /* Last access date */
-       __le16  starthi;        /* High 16 bits of cluster in FAT32 */
-       __le16  time,date,start;/* time, date and first cluster */
-       __le32  size;           /* file size (in bytes) */
-};
-
-/* Up to 13 characters of the name */
-struct msdos_dir_slot {
-       __u8    id;             /* sequence number for slot */
-       __u8    name0_4[10];    /* first 5 characters in name */
-       __u8    attr;           /* attribute byte */
-       __u8    reserved;       /* always 0 */
-       __u8    alias_checksum; /* checksum for 8.3 alias */
-       __u8    name5_10[12];   /* 6 more characters in name */
-       __le16   start;         /* starting cluster number, 0 in long slots */
-       __u8    name11_12[4];   /* last 2 characters in name */
-};
-
-#ifdef __KERNEL__
 /* media of boot sector */
 static inline int fat_valid_media(u8 media)
 {
        return 0xf8 <= media || media == 0xf0;
 }
-#endif /* !__KERNEL__ */
 #endif /* !_LINUX_MSDOS_FS_H */
index 56abf1558fdddab58feab539eff542a5d6f21dcc..7a4b9e97d29a0782ef0dde63126f6a124eeb848b 100644 (file)
@@ -1,78 +1,8 @@
 #ifndef _LINUX_MSG_H
 #define _LINUX_MSG_H
 
-#include <linux/ipc.h>
-
-/* ipcs ctl commands */
-#define MSG_STAT 11
-#define MSG_INFO 12
-
-/* msgrcv options */
-#define MSG_NOERROR     010000  /* no error if message is too big */
-#define MSG_EXCEPT      020000  /* recv any msg except of specified type.*/
-
-/* Obsolete, used only for backwards compatibility and libc5 compiles */
-struct msqid_ds {
-       struct ipc_perm msg_perm;
-       struct msg *msg_first;          /* first message on queue,unused  */
-       struct msg *msg_last;           /* last message in queue,unused */
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned long  msg_lcbytes;     /* Reuse junk fields for 32 bit */
-       unsigned long  msg_lqbytes;     /* ditto */
-       unsigned short msg_cbytes;      /* current number of bytes on queue */
-       unsigned short msg_qnum;        /* number of messages in queue */
-       unsigned short msg_qbytes;      /* max number of bytes on queue */
-       __kernel_ipc_pid_t msg_lspid;   /* pid of last msgsnd */
-       __kernel_ipc_pid_t msg_lrpid;   /* last receive pid */
-};
-
-/* Include the definition of msqid64_ds */
-#include <asm/msgbuf.h>
-
-/* message buffer for msgsnd and msgrcv calls */
-struct msgbuf {
-       long mtype;         /* type of message */
-       char mtext[1];      /* message text */
-};
-
-/* buffer for msgctl calls IPC_INFO, MSG_INFO */
-struct msginfo {
-       int msgpool;
-       int msgmap; 
-       int msgmax; 
-       int msgmnb; 
-       int msgmni; 
-       int msgssz; 
-       int msgtql; 
-       unsigned short  msgseg; 
-};
-
-/*
- * Scaling factor to compute msgmni:
- * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
- * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
- * up to 8MB       : msgmni = 16 (MSGMNI)
- * 4 GB            : msgmni = 8K
- * more than 16 GB : msgmni = 32K (IPCMNI)
- */
-#define MSG_MEM_SCALE 32
-
-#define MSGMNI    16   /* <= IPCMNI */     /* max # of msg queue identifiers */
-#define MSGMAX  8192   /* <= INT_MAX */   /* max size of message (bytes) */
-#define MSGMNB 16384   /* <= INT_MAX */   /* default max size of a message queue */
-
-/* unused */
-#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
-#define MSGTQL  MSGMNB            /* number of system message headers */
-#define MSGMAP  MSGMNB            /* number of entries in message map */
-#define MSGSSZ  16                /* message segment size */
-#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
-#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
-
-#ifdef __KERNEL__
 #include <linux/list.h>
+#include <uapi/linux/msg.h>
 
 /* one msg_msg structure for each message */
 struct msg_msg {
@@ -107,6 +37,4 @@ extern long do_msgsnd(int msqid, long mtype, void __user *mtext,
 extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
                        size_t msgsz, long msgtyp, int msgflg);
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_MSG_H */
index 54b8e0d8d9161e310ea11df8f81f81c44c1cfa1d..5d0b2a1dee69c9814fe218407aa3bf381d577e23 100644 (file)
  *
  *
  */
-
 #ifndef __LINUX_N_R3964_H__
 #define __LINUX_N_R3964_H__
 
-/* line disciplines for r3964 protocol */
-
-#ifdef __KERNEL__
 
 #include <linux/param.h>
+#include <uapi/linux/n_r3964.h>
 
 /*
  * Common ascii handshake characters:
 #define R3964_TO_RX_PANIC ((4000)*HZ/1000)
 #define R3964_MAX_RETRIES 5
 
-#endif
-
-/*
- * Ioctl-commands
- */
-
-#define R3964_ENABLE_SIGNALS      0x5301
-#define R3964_SETPRIORITY         0x5302
-#define R3964_USE_BCC             0x5303
-#define R3964_READ_TELEGRAM       0x5304
-
-/* Options for R3964_SETPRIORITY */
-#define R3964_MASTER   0
-#define R3964_SLAVE    1
-
-/* Options for R3964_ENABLE_SIGNALS */
-#define R3964_SIG_ACK   0x0001
-#define R3964_SIG_DATA  0x0002
-#define R3964_SIG_ALL   0x000f
-#define R3964_SIG_NONE  0x0000
-#define R3964_USE_SIGIO 0x1000
-
-/*
- * r3964 operation states:
- */
-#ifdef __KERNEL__
 
 enum { R3964_IDLE, 
           R3964_TX_REQUEST, R3964_TRANSMITTING, 
@@ -127,29 +98,6 @@ struct r3964_client_info {
 };
 
 
-#endif
-
-/* types for msg_id: */
-enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
-
-#define R3964_MAX_MSG_COUNT 32
-
-/* error codes for client messages */
-#define R3964_OK 0        /* no error. */
-#define R3964_TX_FAIL -1  /* transmission error, block NOT sent */
-#define R3964_OVERFLOW -2 /* msg queue overflow */
-
-/* the client gets this struct when calling read(fd,...): */
-struct r3964_client_message {
-         int     msg_id;
-         int     arg;
-         int     error_code;
-};
-
-#define R3964_MTU      256
-
-
-#ifdef __KERNEL__
 
 struct r3964_block_header;
 
@@ -226,6 +174,4 @@ struct r3964_info {
        int nRetry;
 };
 
-#endif 
-
 #endif
index 5c86e2b33e2db55644ccdaa360c49e9ce394856a..4871170a04a0b24b33e2a5221577fb22565d363b 100644 (file)
  * 2004/02/19 Paul Clements
  *            Removed PARANOIA, plus various cleanup and comments
  */
-
 #ifndef LINUX_NBD_H
 #define LINUX_NBD_H
 
-#include <linux/types.h>
-
-#define NBD_SET_SOCK   _IO( 0xab, 0 )
-#define NBD_SET_BLKSIZE        _IO( 0xab, 1 )
-#define NBD_SET_SIZE   _IO( 0xab, 2 )
-#define NBD_DO_IT      _IO( 0xab, 3 )
-#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
-#define NBD_CLEAR_QUE  _IO( 0xab, 5 )
-#define NBD_PRINT_DEBUG        _IO( 0xab, 6 )
-#define NBD_SET_SIZE_BLOCKS    _IO( 0xab, 7 )
-#define NBD_DISCONNECT  _IO( 0xab, 8 )
-#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
-#define NBD_SET_FLAGS   _IO( 0xab, 10)
-
-enum {
-       NBD_CMD_READ = 0,
-       NBD_CMD_WRITE = 1,
-       NBD_CMD_DISC = 2,
-       /* there is a gap here to match userspace */
-       NBD_CMD_TRIM = 4
-};
-
-/* values for flags field */
-#define NBD_FLAG_HAS_FLAGS    (1 << 0) /* nbd-server supports flags */
-#define NBD_FLAG_READ_ONLY    (1 << 1) /* device is read-only */
-/* there is a gap here to match userspace */
-#define NBD_FLAG_SEND_TRIM    (1 << 5) /* send trim/discard */
-
-#define nbd_cmd(req) ((req)->cmd[0])
-
-/* userspace doesn't need the nbd_device structure */
-#ifdef __KERNEL__
 
 #include <linux/wait.h>
 #include <linux/mutex.h>
+#include <uapi/linux/nbd.h>
 
 struct request;
 
@@ -76,32 +44,3 @@ struct nbd_device {
 };
 
 #endif
-
-/* These are sent over the network in the request/reply magic fields */
-
-#define NBD_REQUEST_MAGIC 0x25609513
-#define NBD_REPLY_MAGIC 0x67446698
-/* Do *not* use magics: 0x12560953 0x96744668. */
-
-/*
- * This is the packet used for communication between client and
- * server. All data are in network byte order.
- */
-struct nbd_request {
-       __be32 magic;
-       __be32 type;    /* == READ || == WRITE  */
-       char handle[8];
-       __be64 from;
-       __be32 len;
-} __attribute__((packed));
-
-/*
- * This is the reply packet that nbd-server sends back to the client after
- * it has completed an I/O request (or an error occurs).
- */
-struct nbd_reply {
-       __be32 magic;
-       __be32 error;           /* 0 = ok, else error   */
-       char handle[8];         /* handle you got from request  */
-};
-#endif
index 6ab31cabef7c01f947a384092caa4c08564233f7..aa1673160a4533be1b464d0588e9b6af21c022e8 100644 (file)
 #ifndef _LINUX_NET_H
 #define _LINUX_NET_H
 
-#include <linux/socket.h>
-#include <asm/socket.h>
-
-#define NPROTO         AF_MAX
-
-#define SYS_SOCKET     1               /* sys_socket(2)                */
-#define SYS_BIND       2               /* sys_bind(2)                  */
-#define SYS_CONNECT    3               /* sys_connect(2)               */
-#define SYS_LISTEN     4               /* sys_listen(2)                */
-#define SYS_ACCEPT     5               /* sys_accept(2)                */
-#define SYS_GETSOCKNAME        6               /* sys_getsockname(2)           */
-#define SYS_GETPEERNAME        7               /* sys_getpeername(2)           */
-#define SYS_SOCKETPAIR 8               /* sys_socketpair(2)            */
-#define SYS_SEND       9               /* sys_send(2)                  */
-#define SYS_RECV       10              /* sys_recv(2)                  */
-#define SYS_SENDTO     11              /* sys_sendto(2)                */
-#define SYS_RECVFROM   12              /* sys_recvfrom(2)              */
-#define SYS_SHUTDOWN   13              /* sys_shutdown(2)              */
-#define SYS_SETSOCKOPT 14              /* sys_setsockopt(2)            */
-#define SYS_GETSOCKOPT 15              /* sys_getsockopt(2)            */
-#define SYS_SENDMSG    16              /* sys_sendmsg(2)               */
-#define SYS_RECVMSG    17              /* sys_recvmsg(2)               */
-#define SYS_ACCEPT4    18              /* sys_accept4(2)               */
-#define SYS_RECVMMSG   19              /* sys_recvmmsg(2)              */
-#define SYS_SENDMMSG   20              /* sys_sendmmsg(2)              */
-
-typedef enum {
-       SS_FREE = 0,                    /* not allocated                */
-       SS_UNCONNECTED,                 /* unconnected to any socket    */
-       SS_CONNECTING,                  /* in process of connecting     */
-       SS_CONNECTED,                   /* connected to socket          */
-       SS_DISCONNECTING                /* in process of disconnecting  */
-} socket_state;
-
-#define __SO_ACCEPTCON (1 << 16)       /* performed a listen           */
-
-#ifdef __KERNEL__
 #include <linux/stringify.h>
 #include <linux/random.h>
 #include <linux/wait.h>
 #include <linux/fcntl.h>       /* For O_CLOEXEC and O_NONBLOCK */
 #include <linux/kmemcheck.h>
 #include <linux/rcupdate.h>
+#include <uapi/linux/net.h>
 
 struct poll_table_struct;
 struct pipe_inode_info;
@@ -319,5 +283,4 @@ extern int kernel_sock_shutdown(struct socket *sock,
 #define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \
        MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
                     name)
-#endif /* __KERNEL__ */
 #endif /* _LINUX_NET_H */
index 561c8bc8976dce2b65245aba6aa051cdc590c69f..f8eda0276f03fadf3be56e8e70f928f792714406 100644 (file)
 #ifndef _LINUX_NETDEVICE_H
 #define _LINUX_NETDEVICE_H
 
-#include <linux/if.h>
-#include <linux/if_ether.h>
-#include <linux/if_packet.h>
-#include <linux/if_link.h>
-
-#ifdef __KERNEL__
 #include <linux/pm_qos.h>
 #include <linux/timer.h>
 #include <linux/bug.h>
@@ -55,6 +49,7 @@
 
 #include <linux/netdev_features.h>
 #include <linux/neighbour.h>
+#include <uapi/linux/netdevice.h>
 
 struct netpoll_info;
 struct device;
@@ -133,14 +128,6 @@ static inline bool dev_xmit_complete(int rc)
        return false;
 }
 
-#endif
-
-#define MAX_ADDR_LEN   32              /* Largest hardware address length */
-
-/* Initial net device group. All devices belong to group 0 by default. */
-#define INIT_NETDEV_GROUP      0
-
-#ifdef  __KERNEL__
 /*
  *     Compute the worst case header length according to the protocols
  *     used.
@@ -196,21 +183,6 @@ struct net_device_stats {
        unsigned long   tx_compressed;
 };
 
-#endif  /*  __KERNEL__  */
-
-
-/* Media selection options. */
-enum {
-        IF_PORT_UNKNOWN = 0,
-        IF_PORT_10BASE2,
-        IF_PORT_10BASET,
-        IF_PORT_AUI,
-        IF_PORT_100BASET,
-        IF_PORT_100BASETX,
-        IF_PORT_100BASEFX
-};
-
-#ifdef __KERNEL__
 
 #include <linux/cache.h>
 #include <linux/skbuff.h>
@@ -2844,6 +2816,4 @@ do {                                                              \
 })
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_NETDEVICE_H */
index 1dcf2a38e51f69770395db885ab2aebc39558abe..ee142846f56a80882243b2dfc4468e9fdfbc5d3f 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __LINUX_NETFILTER_H
 #define __LINUX_NETFILTER_H
 
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/skbuff.h>
 #include <linux/net.h>
@@ -10,75 +9,7 @@
 #include <linux/in6.h>
 #include <linux/wait.h>
 #include <linux/list.h>
-#endif
-#include <linux/types.h>
-#include <linux/compiler.h>
-#include <linux/sysctl.h>
-
-/* Responses from hook functions. */
-#define NF_DROP 0
-#define NF_ACCEPT 1
-#define NF_STOLEN 2
-#define NF_QUEUE 3
-#define NF_REPEAT 4
-#define NF_STOP 5
-#define NF_MAX_VERDICT NF_STOP
-
-/* we overload the higher bits for encoding auxiliary data such as the queue
- * number or errno values. Not nice, but better than additional function
- * arguments. */
-#define NF_VERDICT_MASK 0x000000ff
-
-/* extra verdict flags have mask 0x0000ff00 */
-#define NF_VERDICT_FLAG_QUEUE_BYPASS   0x00008000
-
-/* queue number (NF_QUEUE) or errno (NF_DROP) */
-#define NF_VERDICT_QMASK 0xffff0000
-#define NF_VERDICT_QBITS 16
-
-#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
-
-#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
-
-/* only for userspace compatibility */
-#ifndef __KERNEL__
-/* Generic cache responses from hook functions.
-   <= 0x2000 is used for protocol-flags. */
-#define NFC_UNKNOWN 0x4000
-#define NFC_ALTERED 0x8000
-
-/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
-#define NF_VERDICT_BITS 16
-#endif
-
-enum nf_inet_hooks {
-       NF_INET_PRE_ROUTING,
-       NF_INET_LOCAL_IN,
-       NF_INET_FORWARD,
-       NF_INET_LOCAL_OUT,
-       NF_INET_POST_ROUTING,
-       NF_INET_NUMHOOKS
-};
-
-enum {
-       NFPROTO_UNSPEC =  0,
-       NFPROTO_IPV4   =  2,
-       NFPROTO_ARP    =  3,
-       NFPROTO_BRIDGE =  7,
-       NFPROTO_IPV6   = 10,
-       NFPROTO_DECNET = 12,
-       NFPROTO_NUMPROTO,
-};
-
-union nf_inet_addr {
-       __u32           all[4];
-       __be32          ip;
-       __be32          ip6[4];
-       struct in_addr  in;
-       struct in6_addr in6;
-};
-
-#ifdef __KERNEL__
+#include <uapi/linux/netfilter.h>
 #ifdef CONFIG_NETFILTER
 static inline int NF_DROP_GETERR(int verdict)
 {
@@ -411,5 +342,4 @@ extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook;
 static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
 #endif
 
-#endif /*__KERNEL__*/
 #endif /*__LINUX_NETFILTER_H*/
index 31d2844e6572be34ed104e1a92fafd48abc0bf76..dfb4d9e52bcb3a1775eebd627d1d758aaaed6c4b 100644 (file)
@@ -1,30 +1,8 @@
 #ifndef __LINUX_BRIDGE_NETFILTER_H
 #define __LINUX_BRIDGE_NETFILTER_H
 
-/* bridge-specific defines for netfilter. 
- */
-
-#include <linux/netfilter.h>
-#include <linux/if_ether.h>
-#include <linux/if_vlan.h>
-#include <linux/if_pppox.h>
-
-/* Bridge Hooks */
-/* After promisc drops, checksum checks. */
-#define NF_BR_PRE_ROUTING      0
-/* If the packet is destined for this box. */
-#define NF_BR_LOCAL_IN         1
-/* If the packet is destined for another interface. */
-#define NF_BR_FORWARD          2
-/* Packets coming from a local process. */
-#define NF_BR_LOCAL_OUT                3
-/* Packets about to hit the wire. */
-#define NF_BR_POST_ROUTING     4
-/* Not really a hook, but used for the ebtables broute table */
-#define NF_BR_BROUTING         5
-#define NF_BR_NUMHOOKS         6
-
-#ifdef __KERNEL__
+#include <uapi/linux/netfilter_bridge.h>
+
 
 enum nf_br_hook_priorities {
        NF_BR_PRI_FIRST = INT_MIN,
@@ -118,5 +96,4 @@ static inline void br_drop_fake_rtable(struct sk_buff *skb)
 #define br_drop_fake_rtable(skb)               do { } while (0)
 #endif /* CONFIG_BRIDGE_NETFILTER */
 
-#endif /* __KERNEL__ */
 #endif
index b962dfc695ae0e5e5787627468bdff6911dd146d..dfaf116b3e8125a3f36511bfe35b64fc81d463e3 100644 (file)
@@ -1,86 +1,12 @@
-#ifndef __LINUX_IP_NETFILTER_H
-#define __LINUX_IP_NETFILTER_H
-
 /* IPv4-specific defines for netfilter. 
  * (C)1998 Rusty Russell -- This code is GPL.
  */
+#ifndef __LINUX_IP_NETFILTER_H
+#define __LINUX_IP_NETFILTER_H
 
-#include <linux/netfilter.h>
-
-/* only for userspace compatibility */
-#ifndef __KERNEL__
-
-#include <limits.h> /* for INT_MIN, INT_MAX */
-
-/* IP Cache bits. */
-/* Src IP address. */
-#define NFC_IP_SRC             0x0001
-/* Dest IP address. */
-#define NFC_IP_DST             0x0002
-/* Input device. */
-#define NFC_IP_IF_IN           0x0004
-/* Output device. */
-#define NFC_IP_IF_OUT          0x0008
-/* TOS. */
-#define NFC_IP_TOS             0x0010
-/* Protocol. */
-#define NFC_IP_PROTO           0x0020
-/* IP options. */
-#define NFC_IP_OPTIONS         0x0040
-/* Frag & flags. */
-#define NFC_IP_FRAG            0x0080
-
-/* Per-protocol information: only matters if proto match. */
-/* TCP flags. */
-#define NFC_IP_TCPFLAGS                0x0100
-/* Source port. */
-#define NFC_IP_SRC_PT          0x0200
-/* Dest port. */
-#define NFC_IP_DST_PT          0x0400
-/* Something else about the proto */
-#define NFC_IP_PROTO_UNKNOWN   0x2000
-
-/* IP Hooks */
-/* After promisc drops, checksum checks. */
-#define NF_IP_PRE_ROUTING      0
-/* If the packet is destined for this box. */
-#define NF_IP_LOCAL_IN         1
-/* If the packet is destined for another interface. */
-#define NF_IP_FORWARD          2
-/* Packets coming from a local process. */
-#define NF_IP_LOCAL_OUT                3
-/* Packets about to hit the wire. */
-#define NF_IP_POST_ROUTING     4
-#define NF_IP_NUMHOOKS         5
-#endif /* ! __KERNEL__ */
-
-enum nf_ip_hook_priorities {
-       NF_IP_PRI_FIRST = INT_MIN,
-       NF_IP_PRI_CONNTRACK_DEFRAG = -400,
-       NF_IP_PRI_RAW = -300,
-       NF_IP_PRI_SELINUX_FIRST = -225,
-       NF_IP_PRI_CONNTRACK = -200,
-       NF_IP_PRI_MANGLE = -150,
-       NF_IP_PRI_NAT_DST = -100,
-       NF_IP_PRI_FILTER = 0,
-       NF_IP_PRI_SECURITY = 50,
-       NF_IP_PRI_NAT_SRC = 100,
-       NF_IP_PRI_SELINUX_LAST = 225,
-       NF_IP_PRI_CONNTRACK_HELPER = 300,
-       NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
-       NF_IP_PRI_LAST = INT_MAX,
-};
-
-/* Arguments for setsockopt SOL_IP: */
-/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
-/* 2.2 firewalling (+ masq) went from 64 through 76 */
-/* 2.4 firewalling went 64 through 67. */
-#define SO_ORIGINAL_DST 80
+#include <uapi/linux/netfilter_ipv4.h>
 
-#ifdef __KERNEL__
 extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
 extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
                                   unsigned int dataoff, u_int8_t protocol);
-#endif /*__KERNEL__*/
-
 #endif /*__LINUX_IP_NETFILTER_H*/
index 7c8a513ce7a3ed03f0612e972537deb6569339e8..98ffb54988b6d79d16c7364212337e6312271393 100644 (file)
@@ -1,81 +1,14 @@
-#ifndef __LINUX_IP6_NETFILTER_H
-#define __LINUX_IP6_NETFILTER_H
-
 /* IPv6-specific defines for netfilter. 
  * (C)1998 Rusty Russell -- This code is GPL.
  * (C)1999 David Jeffery
  *   this header was blatantly ripped from netfilter_ipv4.h 
  *   it's amazing what adding a bunch of 6s can do =8^)
  */
+#ifndef __LINUX_IP6_NETFILTER_H
+#define __LINUX_IP6_NETFILTER_H
 
-#include <linux/netfilter.h>
-
-/* only for userspace compatibility */
-#ifndef __KERNEL__
-
-#include <limits.h> /* for INT_MIN, INT_MAX */
-
-/* IP Cache bits. */
-/* Src IP address. */
-#define NFC_IP6_SRC              0x0001
-/* Dest IP address. */
-#define NFC_IP6_DST              0x0002
-/* Input device. */
-#define NFC_IP6_IF_IN            0x0004
-/* Output device. */
-#define NFC_IP6_IF_OUT           0x0008
-/* TOS. */
-#define NFC_IP6_TOS              0x0010
-/* Protocol. */
-#define NFC_IP6_PROTO            0x0020
-/* IP options. */
-#define NFC_IP6_OPTIONS          0x0040
-/* Frag & flags. */
-#define NFC_IP6_FRAG             0x0080
-
-
-/* Per-protocol information: only matters if proto match. */
-/* TCP flags. */
-#define NFC_IP6_TCPFLAGS         0x0100
-/* Source port. */
-#define NFC_IP6_SRC_PT           0x0200
-/* Dest port. */
-#define NFC_IP6_DST_PT           0x0400
-/* Something else about the proto */
-#define NFC_IP6_PROTO_UNKNOWN    0x2000
-
-/* IP6 Hooks */
-/* After promisc drops, checksum checks. */
-#define NF_IP6_PRE_ROUTING     0
-/* If the packet is destined for this box. */
-#define NF_IP6_LOCAL_IN                1
-/* If the packet is destined for another interface. */
-#define NF_IP6_FORWARD         2
-/* Packets coming from a local process. */
-#define NF_IP6_LOCAL_OUT               3
-/* Packets about to hit the wire. */
-#define NF_IP6_POST_ROUTING    4
-#define NF_IP6_NUMHOOKS                5
-#endif /* ! __KERNEL__ */
-
-
-enum nf_ip6_hook_priorities {
-       NF_IP6_PRI_FIRST = INT_MIN,
-       NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
-       NF_IP6_PRI_RAW = -300,
-       NF_IP6_PRI_SELINUX_FIRST = -225,
-       NF_IP6_PRI_CONNTRACK = -200,
-       NF_IP6_PRI_MANGLE = -150,
-       NF_IP6_PRI_NAT_DST = -100,
-       NF_IP6_PRI_FILTER = 0,
-       NF_IP6_PRI_SECURITY = 50,
-       NF_IP6_PRI_NAT_SRC = 100,
-       NF_IP6_PRI_SELINUX_LAST = 225,
-       NF_IP6_PRI_CONNTRACK_HELPER = 300,
-       NF_IP6_PRI_LAST = INT_MAX,
-};
+#include <uapi/linux/netfilter_ipv6.h>
 
-#ifdef  __KERNEL__
 
 #ifdef CONFIG_NETFILTER
 extern int ip6_route_me_harder(struct sk_buff *skb);
@@ -89,6 +22,4 @@ static inline int ipv6_netfilter_init(void) { return 0; }
 static inline void ipv6_netfilter_fini(void) { return; }
 #endif /* CONFIG_NETFILTER */
 
-#endif /* __KERNEL__ */
-
 #endif /*__LINUX_IP6_NETFILTER_H*/
index 6d3af05c107cf50e1dfe962a610b16bd43d7b6ab..e0f746b7b95c5292b03ca073b02ee2aa905de21a 100644 (file)
 #ifndef __LINUX_NETLINK_H
 #define __LINUX_NETLINK_H
 
-#include <linux/socket.h> /* for __kernel_sa_family_t */
-#include <linux/types.h>
-
-#define NETLINK_ROUTE          0       /* Routing/device hook                          */
-#define NETLINK_UNUSED         1       /* Unused number                                */
-#define NETLINK_USERSOCK       2       /* Reserved for user mode socket protocols      */
-#define NETLINK_FIREWALL       3       /* Unused number, formerly ip_queue             */
-#define NETLINK_SOCK_DIAG      4       /* socket monitoring                            */
-#define NETLINK_NFLOG          5       /* netfilter/iptables ULOG */
-#define NETLINK_XFRM           6       /* ipsec */
-#define NETLINK_SELINUX                7       /* SELinux event notifications */
-#define NETLINK_ISCSI          8       /* Open-iSCSI */
-#define NETLINK_AUDIT          9       /* auditing */
-#define NETLINK_FIB_LOOKUP     10      
-#define NETLINK_CONNECTOR      11
-#define NETLINK_NETFILTER      12      /* netfilter subsystem */
-#define NETLINK_IP6_FW         13
-#define NETLINK_DNRTMSG                14      /* DECnet routing messages */
-#define NETLINK_KOBJECT_UEVENT 15      /* Kernel messages to userspace */
-#define NETLINK_GENERIC                16
-/* leave room for NETLINK_DM (DM Events) */
-#define NETLINK_SCSITRANSPORT  18      /* SCSI Transports */
-#define NETLINK_ECRYPTFS       19
-#define NETLINK_RDMA           20
-#define NETLINK_CRYPTO         21      /* Crypto layer */
-
-#define NETLINK_INET_DIAG      NETLINK_SOCK_DIAG
-
-#define MAX_LINKS 32           
-
-struct sockaddr_nl {
-       __kernel_sa_family_t    nl_family;      /* AF_NETLINK   */
-       unsigned short  nl_pad;         /* zero         */
-       __u32           nl_pid;         /* port ID      */
-               __u32           nl_groups;      /* multicast groups mask */
-};
-
-struct nlmsghdr {
-       __u32           nlmsg_len;      /* Length of message including header */
-       __u16           nlmsg_type;     /* Message content */
-       __u16           nlmsg_flags;    /* Additional flags */
-       __u32           nlmsg_seq;      /* Sequence number */
-       __u32           nlmsg_pid;      /* Sending process port ID */
-};
-
-/* Flags values */
-
-#define NLM_F_REQUEST          1       /* It is request message.       */
-#define NLM_F_MULTI            2       /* Multipart message, terminated by NLMSG_DONE */
-#define NLM_F_ACK              4       /* Reply with ack, with zero or error code */
-#define NLM_F_ECHO             8       /* Echo this request            */
-#define NLM_F_DUMP_INTR                16      /* Dump was inconsistent due to sequence change */
-
-/* Modifiers to GET request */
-#define NLM_F_ROOT     0x100   /* specify tree root    */
-#define NLM_F_MATCH    0x200   /* return all matching  */
-#define NLM_F_ATOMIC   0x400   /* atomic GET           */
-#define NLM_F_DUMP     (NLM_F_ROOT|NLM_F_MATCH)
-
-/* Modifiers to NEW request */
-#define NLM_F_REPLACE  0x100   /* Override existing            */
-#define NLM_F_EXCL     0x200   /* Do not touch, if it exists   */
-#define NLM_F_CREATE   0x400   /* Create, if it does not exist */
-#define NLM_F_APPEND   0x800   /* Add to end of list           */
-
-/*
-   4.4BSD ADD          NLM_F_CREATE|NLM_F_EXCL
-   4.4BSD CHANGE       NLM_F_REPLACE
-
-   True CHANGE         NLM_F_CREATE|NLM_F_REPLACE
-   Append              NLM_F_CREATE
-   Check               NLM_F_EXCL
- */
-
-#define NLMSG_ALIGNTO  4U
-#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
-#define NLMSG_HDRLEN    ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
-#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
-#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
-#define NLMSG_DATA(nlh)  ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
-#define NLMSG_NEXT(nlh,len)     ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
-                                 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
-#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
-                          (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
-                          (nlh)->nlmsg_len <= (len))
-#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
-
-#define NLMSG_NOOP             0x1     /* Nothing.             */
-#define NLMSG_ERROR            0x2     /* Error                */
-#define NLMSG_DONE             0x3     /* End of a dump        */
-#define NLMSG_OVERRUN          0x4     /* Data lost            */
-
-#define NLMSG_MIN_TYPE         0x10    /* < 0x10: reserved control messages */
-
-struct nlmsgerr {
-       int             error;
-       struct nlmsghdr msg;
-};
-
-#define NETLINK_ADD_MEMBERSHIP 1
-#define NETLINK_DROP_MEMBERSHIP        2
-#define NETLINK_PKTINFO                3
-#define NETLINK_BROADCAST_ERROR        4
-#define NETLINK_NO_ENOBUFS     5
-
-struct nl_pktinfo {
-       __u32   group;
-};
-
-#define NET_MAJOR 36           /* Major 36 is reserved for networking                                          */
-
-enum {
-       NETLINK_UNCONNECTED = 0,
-       NETLINK_CONNECTED,
-};
-
-/*
- *  <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
- * +---------------------+- - -+- - - - - - - - - -+- - -+
- * |        Header       | Pad |     Payload       | Pad |
- * |   (struct nlattr)   | ing |                   | ing |
- * +---------------------+- - -+- - - - - - - - - -+- - -+
- *  <-------------- nlattr->nla_len -------------->
- */
-
-struct nlattr {
-       __u16           nla_len;
-       __u16           nla_type;
-};
-
-/*
- * nla_type (16 bits)
- * +---+---+-------------------------------+
- * | N | O | Attribute Type                |
- * +---+---+-------------------------------+
- * N := Carries nested attributes
- * O := Payload stored in network byte order
- *
- * Note: The N and O flag are mutually exclusive.
- */
-#define NLA_F_NESTED           (1 << 15)
-#define NLA_F_NET_BYTEORDER    (1 << 14)
-#define NLA_TYPE_MASK          ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
-
-#define NLA_ALIGNTO            4
-#define NLA_ALIGN(len)         (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
-#define NLA_HDRLEN             ((int) NLA_ALIGN(sizeof(struct nlattr)))
-
-#ifdef __KERNEL__
 
 #include <linux/capability.h>
 #include <linux/skbuff.h>
 #include <linux/export.h>
 #include <net/scm.h>
+#include <uapi/linux/netlink.h>
 
 struct net;
 
@@ -283,6 +135,4 @@ static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
        return __netlink_dump_start(ssk, skb, nlh, control);
 }
 
-#endif /* __KERNEL__ */
-
 #endif /* __LINUX_NETLINK_H */
index 6d1fb63f59221690f72d62f1d8a5cae71070fcc5..3e794c12e90ae27bb1bf61a73bdb5e625c869c74 100644 (file)
@@ -7,130 +7,9 @@
 #ifndef _LINUX_NFS_H
 #define _LINUX_NFS_H
 
-#define NFS_PROGRAM    100003
-#define NFS_PORT       2049
-#define NFS_MAXDATA    8192
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN  255
-#define NFS_MAXGROUPS  16
-#define NFS_FHSIZE     32
-#define NFS_COOKIESIZE 4
-#define NFS_FIFO_DEV   (-1)
-#define NFSMODE_FMT    0170000
-#define NFSMODE_DIR    0040000
-#define NFSMODE_CHR    0020000
-#define NFSMODE_BLK    0060000
-#define NFSMODE_REG    0100000
-#define NFSMODE_LNK    0120000
-#define NFSMODE_SOCK   0140000
-#define NFSMODE_FIFO   0010000
-
-#define NFS_MNT_PROGRAM                100005
-#define NFS_MNT_VERSION                1
-#define NFS_MNT3_VERSION       3
-
-#define NFS_PIPE_DIRNAME "nfs"
-
-/*
- * NFS stats. The good thing with these values is that NFSv3 errors are
- * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
- * no-one uses anyway), so we can happily mix code as long as we make sure
- * no NFSv3 errors are returned to NFSv2 clients.
- * Error codes that have a `--' in the v2 column are not part of the
- * standard, but seem to be widely used nevertheless.
- */
- enum nfs_stat {
-       NFS_OK = 0,                     /* v2 v3 v4 */
-       NFSERR_PERM = 1,                /* v2 v3 v4 */
-       NFSERR_NOENT = 2,               /* v2 v3 v4 */
-       NFSERR_IO = 5,                  /* v2 v3 v4 */
-       NFSERR_NXIO = 6,                /* v2 v3 v4 */
-       NFSERR_EAGAIN = 11,             /* v2 v3 */
-       NFSERR_ACCES = 13,              /* v2 v3 v4 */
-       NFSERR_EXIST = 17,              /* v2 v3 v4 */
-       NFSERR_XDEV = 18,               /*    v3 v4 */
-       NFSERR_NODEV = 19,              /* v2 v3 v4 */
-       NFSERR_NOTDIR = 20,             /* v2 v3 v4 */
-       NFSERR_ISDIR = 21,              /* v2 v3 v4 */
-       NFSERR_INVAL = 22,              /* v2 v3 v4 */
-       NFSERR_FBIG = 27,               /* v2 v3 v4 */
-       NFSERR_NOSPC = 28,              /* v2 v3 v4 */
-       NFSERR_ROFS = 30,               /* v2 v3 v4 */
-       NFSERR_MLINK = 31,              /*    v3 v4 */
-       NFSERR_OPNOTSUPP = 45,          /* v2 v3 */
-       NFSERR_NAMETOOLONG = 63,        /* v2 v3 v4 */
-       NFSERR_NOTEMPTY = 66,           /* v2 v3 v4 */
-       NFSERR_DQUOT = 69,              /* v2 v3 v4 */
-       NFSERR_STALE = 70,              /* v2 v3 v4 */
-       NFSERR_REMOTE = 71,             /* v2 v3 */
-       NFSERR_WFLUSH = 99,             /* v2    */
-       NFSERR_BADHANDLE = 10001,       /*    v3 v4 */
-       NFSERR_NOT_SYNC = 10002,        /*    v3 */
-       NFSERR_BAD_COOKIE = 10003,      /*    v3 v4 */
-       NFSERR_NOTSUPP = 10004,         /*    v3 v4 */
-       NFSERR_TOOSMALL = 10005,        /*    v3 v4 */
-       NFSERR_SERVERFAULT = 10006,     /*    v3 v4 */
-       NFSERR_BADTYPE = 10007,         /*    v3 v4 */
-       NFSERR_JUKEBOX = 10008,         /*    v3 v4 */
-       NFSERR_SAME = 10009,            /*       v4 */
-       NFSERR_DENIED = 10010,          /*       v4 */
-       NFSERR_EXPIRED = 10011,         /*       v4 */
-       NFSERR_LOCKED = 10012,          /*       v4 */
-       NFSERR_GRACE = 10013,           /*       v4 */
-       NFSERR_FHEXPIRED = 10014,       /*       v4 */
-       NFSERR_SHARE_DENIED = 10015,    /*       v4 */
-       NFSERR_WRONGSEC = 10016,        /*       v4 */
-       NFSERR_CLID_INUSE = 10017,      /*       v4 */
-       NFSERR_RESOURCE = 10018,        /*       v4 */
-       NFSERR_MOVED = 10019,           /*       v4 */
-       NFSERR_NOFILEHANDLE = 10020,    /*       v4 */
-       NFSERR_MINOR_VERS_MISMATCH = 10021,   /* v4 */
-       NFSERR_STALE_CLIENTID = 10022,  /*       v4 */
-       NFSERR_STALE_STATEID = 10023,   /*       v4 */
-       NFSERR_OLD_STATEID = 10024,     /*       v4 */
-       NFSERR_BAD_STATEID = 10025,     /*       v4 */  
-       NFSERR_BAD_SEQID = 10026,       /*       v4 */
-       NFSERR_NOT_SAME = 10027,        /*       v4 */
-       NFSERR_LOCK_RANGE = 10028,      /*       v4 */
-       NFSERR_SYMLINK = 10029,         /*       v4 */
-       NFSERR_RESTOREFH = 10030,       /*       v4 */
-       NFSERR_LEASE_MOVED = 10031,     /*       v4 */
-       NFSERR_ATTRNOTSUPP = 10032,     /*       v4 */
-       NFSERR_NO_GRACE = 10033,        /*       v4 */
-       NFSERR_RECLAIM_BAD = 10034,     /*       v4 */
-       NFSERR_RECLAIM_CONFLICT = 10035,/*       v4 */
-       NFSERR_BAD_XDR = 10036,         /*       v4 */
-       NFSERR_LOCKS_HELD = 10037,      /*       v4 */
-       NFSERR_OPENMODE = 10038,       /*       v4 */
-       NFSERR_BADOWNER = 10039,       /*       v4 */
-       NFSERR_BADCHAR = 10040,        /*       v4 */
-       NFSERR_BADNAME = 10041,        /*       v4 */
-       NFSERR_BAD_RANGE = 10042,      /*       v4 */
-       NFSERR_LOCK_NOTSUPP = 10043,   /*       v4 */
-       NFSERR_OP_ILLEGAL = 10044,     /*       v4 */
-       NFSERR_DEADLOCK = 10045,       /*       v4 */
-       NFSERR_FILE_OPEN = 10046,      /*       v4 */
-       NFSERR_ADMIN_REVOKED = 10047,  /*       v4 */
-       NFSERR_CB_PATH_DOWN = 10048,   /*       v4 */
-};
-
-/* NFSv2 file types - beware, these are not the same in NFSv3 */
-
-enum nfs_ftype {
-       NFNON = 0,
-       NFREG = 1,
-       NFDIR = 2,
-       NFBLK = 3,
-       NFCHR = 4,
-       NFLNK = 5,
-       NFSOCK = 6,
-       NFBAD = 7,
-       NFFIFO = 8
-};
-
-#ifdef __KERNEL__
 #include <linux/sunrpc/msg_prot.h>
 #include <linux/string.h>
+#include <uapi/linux/nfs.h>
 
 /*
  * This is the kernel NFS client file handle representation
@@ -169,5 +48,4 @@ enum nfs3_stable_how {
        NFS_DATA_SYNC = 1,
        NFS_FILE_SYNC = 2
 };
-#endif /* __KERNEL__ */
 #endif /* _LINUX_NFS_H */
index 6ccfe3b641e18f0522114758c8634a5fe84c4c0d..a778ad8e3afd8080c4427d9aae4e08495caa5e80 100644 (file)
 #ifndef _LINUX_NFS3_H
 #define _LINUX_NFS3_H
 
-#define NFS3_PORT              2049
-#define NFS3_MAXDATA           32768
-#define NFS3_MAXPATHLEN                PATH_MAX
-#define NFS3_MAXNAMLEN         NAME_MAX
-#define NFS3_MAXGROUPS         16
-#define NFS3_FHSIZE            64
-#define NFS3_COOKIESIZE                4
-#define NFS3_CREATEVERFSIZE    8
-#define NFS3_COOKIEVERFSIZE    8
-#define NFS3_WRITEVERFSIZE     8
-#define NFS3_FIFO_DEV          (-1)
-#define NFS3MODE_FMT           0170000
-#define NFS3MODE_DIR           0040000
-#define NFS3MODE_CHR           0020000
-#define NFS3MODE_BLK           0060000
-#define NFS3MODE_REG           0100000
-#define NFS3MODE_LNK           0120000
-#define NFS3MODE_SOCK          0140000
-#define NFS3MODE_FIFO          0010000
+#include <uapi/linux/nfs3.h>
 
-/* Flags for access() call */
-#define NFS3_ACCESS_READ       0x0001
-#define NFS3_ACCESS_LOOKUP     0x0002
-#define NFS3_ACCESS_MODIFY     0x0004
-#define NFS3_ACCESS_EXTEND     0x0008
-#define NFS3_ACCESS_DELETE     0x0010
-#define NFS3_ACCESS_EXECUTE    0x0020
-#define NFS3_ACCESS_FULL       0x003f
-
-/* Flags for create mode */
-enum nfs3_createmode {
-       NFS3_CREATE_UNCHECKED = 0,
-       NFS3_CREATE_GUARDED = 1,
-       NFS3_CREATE_EXCLUSIVE = 2
-};
-
-/* NFSv3 file system properties */
-#define NFS3_FSF_LINK          0x0001
-#define NFS3_FSF_SYMLINK       0x0002
-#define NFS3_FSF_HOMOGENEOUS   0x0008
-#define NFS3_FSF_CANSETTIME    0x0010
-/* Some shorthands. See fs/nfsd/nfs3proc.c */
-#define NFS3_FSF_DEFAULT       0x001B
-#define NFS3_FSF_BILLYBOY      0x0018
-#define NFS3_FSF_READONLY      0x0008
-
-enum nfs3_ftype {
-       NF3NON  = 0,
-       NF3REG  = 1,
-       NF3DIR  = 2,
-       NF3BLK  = 3,
-       NF3CHR  = 4,
-       NF3LNK  = 5,
-       NF3SOCK = 6,
-       NF3FIFO = 7,    /* changed from NFSv2 (was 8) */
-       NF3BAD  = 8
-};
-
-struct nfs3_fh {
-       unsigned short size;
-       unsigned char  data[NFS3_FHSIZE];
-};
-
-#define NFS3_VERSION           3
-#define NFS3PROC_NULL          0
-#define NFS3PROC_GETATTR       1
-#define NFS3PROC_SETATTR       2
-#define NFS3PROC_LOOKUP                3
-#define NFS3PROC_ACCESS                4
-#define NFS3PROC_READLINK      5
-#define NFS3PROC_READ          6
-#define NFS3PROC_WRITE         7
-#define NFS3PROC_CREATE                8
-#define NFS3PROC_MKDIR         9
-#define NFS3PROC_SYMLINK       10
-#define NFS3PROC_MKNOD         11
-#define NFS3PROC_REMOVE                12
-#define NFS3PROC_RMDIR         13
-#define NFS3PROC_RENAME                14
-#define NFS3PROC_LINK          15
-#define NFS3PROC_READDIR       16
-#define NFS3PROC_READDIRPLUS   17
-#define NFS3PROC_FSSTAT                18
-#define NFS3PROC_FSINFO                19
-#define NFS3PROC_PATHCONF      20
-#define NFS3PROC_COMMIT                21
-
-#define NFS_MNT3_VERSION       3
-
-#if defined(__KERNEL__)
 
 /* Number of 32bit words in post_op_attr */
 #define NFS3_POST_OP_ATTR_WORDS                22
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_NFS3_H */
index af2d2fa30eee960a6b0f263f43e6b4a39ad5f245..e111fa419a4e3b5670dadc09a40ffa7b6072e09b 100644 (file)
  *  Kendrick Smith <kmsmith@umich.edu>
  *  Andy Adamson   <andros@umich.edu>
  */
-
 #ifndef _LINUX_NFS4_H
 #define _LINUX_NFS4_H
 
-#include <linux/types.h>
-
-#define NFS4_BITMAP_SIZE       2
-#define NFS4_VERIFIER_SIZE     8
-#define NFS4_STATEID_SEQID_SIZE 4
-#define NFS4_STATEID_OTHER_SIZE 12
-#define NFS4_STATEID_SIZE      (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
-#define NFS4_FHSIZE            128
-#define NFS4_MAXPATHLEN                PATH_MAX
-#define NFS4_MAXNAMLEN         NAME_MAX
-#define NFS4_OPAQUE_LIMIT      1024
-#define NFS4_MAX_SESSIONID_LEN 16
-
-#define NFS4_ACCESS_READ        0x0001
-#define NFS4_ACCESS_LOOKUP      0x0002
-#define NFS4_ACCESS_MODIFY      0x0004
-#define NFS4_ACCESS_EXTEND      0x0008
-#define NFS4_ACCESS_DELETE      0x0010
-#define NFS4_ACCESS_EXECUTE     0x0020
-
-#define NFS4_FH_PERSISTENT             0x0000
-#define NFS4_FH_NOEXPIRE_WITH_OPEN     0x0001
-#define NFS4_FH_VOLATILE_ANY           0x0002
-#define NFS4_FH_VOL_MIGRATION          0x0004
-#define NFS4_FH_VOL_RENAME             0x0008
-
-#define NFS4_OPEN_RESULT_CONFIRM 0x0002
-#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
-
-#define NFS4_SHARE_ACCESS_MASK 0x000F
-#define NFS4_SHARE_ACCESS_READ 0x0001
-#define NFS4_SHARE_ACCESS_WRITE        0x0002
-#define NFS4_SHARE_ACCESS_BOTH 0x0003
-#define NFS4_SHARE_DENY_READ   0x0001
-#define NFS4_SHARE_DENY_WRITE  0x0002
-#define NFS4_SHARE_DENY_BOTH   0x0003
-
-/* nfs41 */
-#define NFS4_SHARE_WANT_MASK           0xFF00
-#define NFS4_SHARE_WANT_NO_PREFERENCE  0x0000
-#define NFS4_SHARE_WANT_READ_DELEG     0x0100
-#define NFS4_SHARE_WANT_WRITE_DELEG    0x0200
-#define NFS4_SHARE_WANT_ANY_DELEG      0x0300
-#define NFS4_SHARE_WANT_NO_DELEG       0x0400
-#define NFS4_SHARE_WANT_CANCEL         0x0500
-
-#define NFS4_SHARE_WHEN_MASK           0xF0000
-#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL       0x10000
-#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED         0x20000
-
-#define NFS4_CDFC4_FORE        0x1
-#define NFS4_CDFC4_BACK 0x2
-#define NFS4_CDFC4_BOTH 0x3
-#define NFS4_CDFC4_FORE_OR_BOTH 0x3
-#define NFS4_CDFC4_BACK_OR_BOTH 0x7
-
-#define NFS4_CDFS4_FORE 0x1
-#define NFS4_CDFS4_BACK 0x2
-#define NFS4_CDFS4_BOTH 0x3
-
-#define NFS4_SET_TO_SERVER_TIME        0
-#define NFS4_SET_TO_CLIENT_TIME        1
-
-#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
-#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE  1
-#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE   2
-#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE   3
-
-#define ACL4_SUPPORT_ALLOW_ACL 0x01
-#define ACL4_SUPPORT_DENY_ACL  0x02
-#define ACL4_SUPPORT_AUDIT_ACL 0x04
-#define ACL4_SUPPORT_ALARM_ACL 0x08
-
-#define NFS4_ACE_FILE_INHERIT_ACE             0x00000001
-#define NFS4_ACE_DIRECTORY_INHERIT_ACE        0x00000002
-#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE     0x00000004
-#define NFS4_ACE_INHERIT_ONLY_ACE             0x00000008
-#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG   0x00000010
-#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG       0x00000020
-#define NFS4_ACE_IDENTIFIER_GROUP             0x00000040
-
-#define NFS4_ACE_READ_DATA                    0x00000001
-#define NFS4_ACE_LIST_DIRECTORY               0x00000001
-#define NFS4_ACE_WRITE_DATA                   0x00000002
-#define NFS4_ACE_ADD_FILE                     0x00000002
-#define NFS4_ACE_APPEND_DATA                  0x00000004
-#define NFS4_ACE_ADD_SUBDIRECTORY             0x00000004
-#define NFS4_ACE_READ_NAMED_ATTRS             0x00000008
-#define NFS4_ACE_WRITE_NAMED_ATTRS            0x00000010
-#define NFS4_ACE_EXECUTE                      0x00000020
-#define NFS4_ACE_DELETE_CHILD                 0x00000040
-#define NFS4_ACE_READ_ATTRIBUTES              0x00000080
-#define NFS4_ACE_WRITE_ATTRIBUTES             0x00000100
-#define NFS4_ACE_DELETE                       0x00010000
-#define NFS4_ACE_READ_ACL                     0x00020000
-#define NFS4_ACE_WRITE_ACL                    0x00040000
-#define NFS4_ACE_WRITE_OWNER                  0x00080000
-#define NFS4_ACE_SYNCHRONIZE                  0x00100000
-#define NFS4_ACE_GENERIC_READ                 0x00120081
-#define NFS4_ACE_GENERIC_WRITE                0x00160106
-#define NFS4_ACE_GENERIC_EXECUTE              0x001200A0
-#define NFS4_ACE_MASK_ALL                     0x001F01FF
-
-#define EXCHGID4_FLAG_SUPP_MOVED_REFER         0x00000001
-#define EXCHGID4_FLAG_SUPP_MOVED_MIGR          0x00000002
-#define EXCHGID4_FLAG_BIND_PRINC_STATEID       0x00000100
-
-#define EXCHGID4_FLAG_USE_NON_PNFS             0x00010000
-#define EXCHGID4_FLAG_USE_PNFS_MDS             0x00020000
-#define EXCHGID4_FLAG_USE_PNFS_DS              0x00040000
-#define EXCHGID4_FLAG_MASK_PNFS                        0x00070000
-
-#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A      0x40000000
-#define EXCHGID4_FLAG_CONFIRMED_R              0x80000000
-/*
- * Since the validity of these bits depends on whether
- * they're set in the argument or response, have separate
- * invalid flag masks for arg (_A) and resp (_R).
- */
-#define EXCHGID4_FLAG_MASK_A                   0x40070103
-#define EXCHGID4_FLAG_MASK_R                   0x80070103
-
-#define SEQ4_STATUS_CB_PATH_DOWN               0x00000001
-#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING   0x00000002
-#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED    0x00000004
-#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED  0x00000008
-#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
-#define SEQ4_STATUS_ADMIN_STATE_REVOKED                0x00000020
-#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED   0x00000040
-#define SEQ4_STATUS_LEASE_MOVED                        0x00000080
-#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED     0x00000100
-#define SEQ4_STATUS_CB_PATH_DOWN_SESSION       0x00000200
-#define SEQ4_STATUS_BACKCHANNEL_FAULT          0x00000400
-
-#define NFS4_SECINFO_STYLE4_CURRENT_FH 0
-#define NFS4_SECINFO_STYLE4_PARENT     1
-
-#define NFS4_MAX_UINT64        (~(u64)0)
-
-/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
- * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
- */
-#define NFS4_MAX_OPS   8
-
-/* Our NFS4 client back channel server only wants the cb_sequene and the
- * actual operation per compound
- */
-#define NFS4_MAX_BACK_CHANNEL_OPS 2
-
-enum nfs4_acl_whotype {
-       NFS4_ACL_WHO_NAMED = 0,
-       NFS4_ACL_WHO_OWNER,
-       NFS4_ACL_WHO_GROUP,
-       NFS4_ACL_WHO_EVERYONE,
-};
-
-#ifdef __KERNEL__
 #include <linux/list.h>
+#include <uapi/linux/nfs4.h>
 
 struct nfs4_ace {
        uint32_t        type;
@@ -673,10 +516,3 @@ struct nfs4_deviceid {
 };
 
 #endif
-#endif
-
-/*
- * Local variables:
- *  c-basic-offset: 8
- * End:
- */
index 334a2f5f6bf167857cb621f4d71b7ea62f3481a7..1cc25682b20bdba4e0cac8cc6925910445104481 100644 (file)
@@ -5,38 +5,11 @@
  *
  *  OS-specific nfs filesystem definitions and declarations
  */
-
 #ifndef _LINUX_NFS_FS_H
 #define _LINUX_NFS_FS_H
 
-#include <linux/magic.h>
-
-/* Default timeout values */
-#define NFS_DEF_UDP_TIMEO      (11)
-#define NFS_DEF_UDP_RETRANS    (3)
-#define NFS_DEF_TCP_TIMEO      (600)
-#define NFS_DEF_TCP_RETRANS    (2)
-
-#define NFS_MAX_UDP_TIMEOUT    (60*HZ)
-#define NFS_MAX_TCP_TIMEOUT    (600*HZ)
+#include <uapi/linux/nfs_fs.h>
 
-#define NFS_DEF_ACREGMIN       (3)
-#define NFS_DEF_ACREGMAX       (60)
-#define NFS_DEF_ACDIRMIN       (30)
-#define NFS_DEF_ACDIRMAX       (60)
-
-/*
- * When flushing a cluster of dirty pages, there can be different
- * strategies:
- */
-#define FLUSH_SYNC             1       /* file being synced, or contention */
-#define FLUSH_STABLE           4       /* commit to stable storage */
-#define FLUSH_LOWPRI           8       /* low priority background flush */
-#define FLUSH_HIGHPRI          16      /* high priority memory reclaim flush */
-#define FLUSH_COND_STABLE      32      /* conditional stable write - only stable
-                                        * if everything fits in one RPC */
-
-#ifdef __KERNEL__
 
 /*
  * Enable dprintk() debugging support for nfs client.
@@ -613,29 +586,6 @@ nfs_fileid_to_ino_t(u64 fileid)
 
 #define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
 
-#endif /* __KERNEL__ */
-
-/*
- * NFS debug flags
- */
-#define NFSDBG_VFS             0x0001
-#define NFSDBG_DIRCACHE                0x0002
-#define NFSDBG_LOOKUPCACHE     0x0004
-#define NFSDBG_PAGECACHE       0x0008
-#define NFSDBG_PROC            0x0010
-#define NFSDBG_XDR             0x0020
-#define NFSDBG_FILE            0x0040
-#define NFSDBG_ROOT            0x0080
-#define NFSDBG_CALLBACK                0x0100
-#define NFSDBG_CLIENT          0x0200
-#define NFSDBG_MOUNT           0x0400
-#define NFSDBG_FSCACHE         0x0800
-#define NFSDBG_PNFS            0x1000
-#define NFSDBG_PNFS_LD         0x2000
-#define NFSDBG_STATE           0x4000
-#define NFSDBG_ALL             0xFFFF
-
-#ifdef __KERNEL__
 
 # undef ifdebug
 # ifdef NFS_DEBUG
@@ -645,6 +595,4 @@ nfs_fileid_to_ino_t(u64 fileid)
 #  define ifdebug(fac)         if (0)
 #  define NFS_IFDEBUG(x)
 # endif
-#endif /* __KERNEL */
-
 #endif
index ece91c57ad79d109c2c95c30d64f390201db0822..2dcef3ab58b6f87e7429200d5256eb56541b07f4 100644 (file)
  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 #ifndef NFS_IDMAP_H
 #define NFS_IDMAP_H
 
-#include <linux/types.h>
-
-/* XXX from bits/utmp.h  */
-#define IDMAP_NAMESZ  128
-
-#define IDMAP_TYPE_USER  0
-#define IDMAP_TYPE_GROUP 1
-
-#define IDMAP_CONV_IDTONAME 0
-#define IDMAP_CONV_NAMETOID 1
+#include <uapi/linux/nfs_idmap.h>
 
-#define IDMAP_STATUS_INVALIDMSG 0x01
-#define IDMAP_STATUS_AGAIN      0x02
-#define IDMAP_STATUS_LOOKUPFAIL 0x04
-#define IDMAP_STATUS_SUCCESS    0x08
-
-struct idmap_msg {
-       __u8  im_type;
-       __u8  im_conv;
-       char  im_name[IDMAP_NAMESZ];
-       __u32 im_id;
-       __u8  im_status;
-};
-
-#ifdef __KERNEL__
 
 /* Forward declaration to make this header independent of others */
 struct nfs_client;
@@ -97,6 +73,4 @@ int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t);
 int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t);
 
 extern unsigned int nfs_idmap_cache_timeout;
-#endif /* __KERNEL__ */
-
 #endif /* NFS_IDMAP_H */
index fabcb1e5c460f240ff1f9c5e5b1d6d720505d7c5..5e69e67b31ab28bd5cb1bfc451687a36597f6b1f 100644 (file)
@@ -6,30 +6,10 @@
 #ifndef __LINUX_NFSACL_H
 #define __LINUX_NFSACL_H
 
-#define NFS_ACL_PROGRAM        100227
-
-#define ACLPROC2_GETACL                1
-#define ACLPROC2_SETACL                2
-#define ACLPROC2_GETATTR       3
-#define ACLPROC2_ACCESS                4
-
-#define ACLPROC3_GETACL                1
-#define ACLPROC3_SETACL                2
-
-
-/* Flags for the getacl/setacl mode */
-#define NFS_ACL                        0x0001
-#define NFS_ACLCNT             0x0002
-#define NFS_DFACL              0x0004
-#define NFS_DFACLCNT           0x0008
-
-/* Flag for Default ACL entries */
-#define NFS_ACL_DEFAULT                0x1000
-
-#ifdef __KERNEL__
 
 #include <linux/posix_acl.h>
 #include <linux/sunrpc/xdr.h>
+#include <uapi/linux/nfsacl.h>
 
 /* Maximum number of ACL entries over NFS */
 #define NFS_ACL_MAX_ENTRIES    1024
@@ -58,5 +38,4 @@ extern int
 nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt,
              struct posix_acl **pacl);
 
-#endif /* __KERNEL__ */
 #endif  /* __LINUX_NFSACL_H */
index e137b3c486a7799f9f39b470f827db2ab00dc819..a8696bbdfbc477b95c06693f815a49354ae16054 100644 (file)
   Some of the constants in here are from the corresponding
   NetBSD/OpenBSD header file, by Allen Briggs.  We figured out the
   rest of them on our own. */
-
 #ifndef LINUX_NUBUS_H
 #define LINUX_NUBUS_H
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <asm/nubus.h>
-#endif
-
-enum nubus_category {
-       NUBUS_CAT_BOARD          = 0x0001,
-       NUBUS_CAT_DISPLAY        = 0x0003,
-       NUBUS_CAT_NETWORK        = 0x0004,
-       NUBUS_CAT_COMMUNICATIONS = 0x0006,
-       NUBUS_CAT_FONT           = 0x0009,
-       NUBUS_CAT_CPU            = 0x000A,
-       /* For lack of a better name */
-       NUBUS_CAT_DUODOCK        = 0x0020
-};
-
-enum nubus_type_network {
-       NUBUS_TYPE_ETHERNET      = 0x0001,
-       NUBUS_TYPE_RS232         = 0x0002
-};
-
-enum nubus_type_display {
-       NUBUS_TYPE_VIDEO         = 0x0001
-};
-
-enum nubus_type_cpu {
-       NUBUS_TYPE_68020         = 0x0003,
-       NUBUS_TYPE_68030         = 0x0004,
-       NUBUS_TYPE_68040         = 0x0005
-};
-
-/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
- *  68030 motherboards: <10,4,0,24>
- *  68040 motherboards: <10,5,0,24>
- *  DuoDock Plus: <32,1,1,2>
- *
- *  Toby Frame Buffer card: <3,1,1,1>
- *  RBV built-in video (IIci): <3,1,1,24>
- *  Valkyrie built-in video (Q630): <3,1,1,46>
- *  Macintosh Display Card: <3,1,1,25>
- *  Sonora built-in video (P460): <3,1,1,34>
- *  Jet framebuffer (DuoDock Plus): <3,1,1,41>
- *
- *  SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
- *  SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
- *  Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
- *  Sonic Systems Ethernet A-Series Card: <4,1,268,256>
- *  Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
- *   ROM on the above card: <2,1,0,0>
- *  Cabletron ethernet card: <4,1,1,265>
- *  Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
- *  Kinetics EtherPort IIN: <4,1,259,262>
- *  API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
- *
- *  Add your devices to the list!  You can obtain the "Slots" utility
- *  from Apple's FTP site at:
- *  ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
- *
- *  Alternately, TattleTech can be found at any Info-Mac mirror site.  
- *  or from its distribution site: ftp://ftp.decismkr.com/dms
- */
-
-/* DrSW: Uniquely identifies the software interface to a board.  This
-   is usually the one you want to look at when writing a driver.  It's
-   not as useful as you think, though, because as we should know by
-   now (duh), "Apple Compatible" can mean a lot of things... */
-
-/* Add known DrSW values here */
-enum nubus_drsw {
-       /* NUBUS_CAT_DISPLAY */
-       NUBUS_DRSW_APPLE        = 0x0001,
-       NUBUS_DRSW_APPLE_HIRES  = 0x0013, /* MacII HiRes card driver */
-       
-       /* NUBUS_CAT_NETWORK */
-       NUBUS_DRSW_3COM         = 0x0000,
-       NUBUS_DRSW_CABLETRON    = 0x0001,
-       NUBUS_DRSW_SONIC_LC     = 0x0001,
-       NUBUS_DRSW_KINETICS     = 0x0103,
-       NUBUS_DRSW_ASANTE       = 0x0104,
-       NUBUS_DRSW_TECHWORKS    = 0x0109,
-       NUBUS_DRSW_DAYNA        = 0x010b,
-       NUBUS_DRSW_FARALLON     = 0x010c,
-       NUBUS_DRSW_APPLE_SN     = 0x010f,
-       NUBUS_DRSW_DAYNA2       = 0x0115,
-       NUBUS_DRSW_FOCUS        = 0x011a,
-       NUBUS_DRSW_ASANTE_CS    = 0x011d, /* use asante SMC9194 driver */
-       NUBUS_DRSW_DAYNA_LC     = 0x011e,
-
-       /* NUBUS_CAT_CPU */
-       NUBUS_DRSW_NONE         = 0x0000,
-};
-
-/* DrHW: Uniquely identifies the hardware interface to a board (or at
-   least, it should...  some video cards are known to incorrectly
-   identify themselves as Toby cards) */
-
-/* Add known DrHW values here */
-enum nubus_drhw {
-       /* NUBUS_CAT_DISPLAY */
-       NUBUS_DRHW_APPLE_TFB      = 0x0001, /* Toby frame buffer card */
-       NUBUS_DRHW_APPLE_WVC      = 0x0006, /* Apple Workstation Video Card */
-       NUBUS_DRHW_SIGMA_CLRMAX   = 0x0007, /* Sigma Design ColorMax */
-       NUBUS_DRHW_APPLE_SE30     = 0x0009, /* Apple SE/30 video */
-       NUBUS_DRHW_APPLE_HRVC     = 0x0013, /* Mac II High-Res Video Card */
-       NUBUS_DRHW_APPLE_PVC      = 0x0017, /* Mac II Portrait Video Card */
-       NUBUS_DRHW_APPLE_RBV1     = 0x0018, /* IIci RBV video */
-       NUBUS_DRHW_APPLE_MDC      = 0x0019, /* Macintosh Display Card */
-       NUBUS_DRHW_APPLE_SONORA   = 0x0022, /* Sonora built-in video */
-       NUBUS_DRHW_APPLE_24AC     = 0x002b, /* Mac 24AC Video Card */
-       NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
-       NUBUS_DRHW_APPLE_JET      = 0x0029, /* Jet framebuffer (DuoDock) */
-       NUBUS_DRHW_SMAC_GFX       = 0x0105, /* SuperMac GFX */
-       NUBUS_DRHW_RASTER_CB264   = 0x013B, /* RasterOps ColorBoard 264 */
-       NUBUS_DRHW_MICRON_XCEED   = 0x0146, /* Micron Exceed color */
-       NUBUS_DRHW_RDIUS_GSC      = 0x0153, /* Radius GS/C */
-       NUBUS_DRHW_SMAC_SPEC8     = 0x017B, /* SuperMac Spectrum/8 */
-       NUBUS_DRHW_SMAC_SPEC24    = 0x017C, /* SuperMac Spectrum/24 */
-       NUBUS_DRHW_RASTER_CB364   = 0x026F, /* RasterOps ColorBoard 364 */
-       NUBUS_DRHW_RDIUS_DCGX     = 0x027C, /* Radius DirectColor/GX */
-       NUBUS_DRHW_RDIUS_PC8      = 0x0291, /* Radius PrecisionColor 8 */
-       NUBUS_DRHW_LAPIS_PCS8     = 0x0292, /* Lapis ProColorServer 8 */
-       NUBUS_DRHW_RASTER_24XLI   = 0x02A0, /* RasterOps 8/24 XLi */
-       NUBUS_DRHW_RASTER_PBPGT   = 0x02A5, /* RasterOps PaintBoard Prism GT */
-       NUBUS_DRHW_EMACH_FSX      = 0x02AE, /* E-Machines Futura SX */
-       NUBUS_DRHW_RASTER_24XLTV  = 0x02B7, /* RasterOps 24XLTV */
-       NUBUS_DRHW_SMAC_THUND24   = 0x02CB, /* SuperMac Thunder/24 */
-       NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
-       NUBUS_DRHW_RDIUS_PC24XP   = 0x0406, /* Radius PrecisionColor 24Xp */
-       NUBUS_DRHW_RDIUS_PC24X    = 0x040A, /* Radius PrecisionColor 24X */
-       NUBUS_DRHW_RDIUS_PC8XJ    = 0x040B, /* Radius PrecisionColor 8XJ */
-       
-       /* NUBUS_CAT_NETWORK */
-       NUBUS_DRHW_INTERLAN       = 0x0100,
-       NUBUS_DRHW_SMC9194        = 0x0101,
-       NUBUS_DRHW_KINETICS       = 0x0106,
-       NUBUS_DRHW_CABLETRON      = 0x0109,
-       NUBUS_DRHW_ASANTE_LC      = 0x010f,
-       NUBUS_DRHW_SONIC          = 0x0110,
-       NUBUS_DRHW_TECHWORKS      = 0x0112,
-       NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
-       NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
-       NUBUS_DRHW_FOCUS          = 0x011c,
-       NUBUS_DRHW_SONNET         = 0x011d,
-};
+#include <uapi/linux/nubus.h>
 
-/* Resource IDs: These are the identifiers for the various weird and
-   wonderful tidbits of information that may or may not reside in the
-   NuBus ROM directory. */
-enum nubus_res_id {
-       NUBUS_RESID_TYPE         = 0x0001,
-       NUBUS_RESID_NAME         = 0x0002,
-       NUBUS_RESID_ICON         = 0x0003,
-       NUBUS_RESID_DRVRDIR      = 0x0004,
-       NUBUS_RESID_LOADREC      = 0x0005,
-       NUBUS_RESID_BOOTREC      = 0x0006,
-       NUBUS_RESID_FLAGS        = 0x0007,
-       NUBUS_RESID_HWDEVID      = 0x0008,
-       NUBUS_RESID_MINOR_BASEOS = 0x000a,
-       NUBUS_RESID_MINOR_LENGTH = 0x000b,
-       NUBUS_RESID_MAJOR_BASEOS = 0x000c,
-       NUBUS_RESID_MAJOR_LENGTH = 0x000d,
-       NUBUS_RESID_CICN         = 0x000f,
-       NUBUS_RESID_ICL8         = 0x0010,
-       NUBUS_RESID_ICL4         = 0x0011,
-};
-
-/* Category-specific resources. */
-enum nubus_board_res_id {
-       NUBUS_RESID_BOARDID      = 0x0020,
-       NUBUS_RESID_PRAMINITDATA = 0x0021,
-       NUBUS_RESID_PRIMARYINIT  = 0x0022,
-       NUBUS_RESID_TIMEOUTCONST = 0x0023,
-       NUBUS_RESID_VENDORINFO   = 0x0024,
-       NUBUS_RESID_BOARDFLAGS   = 0x0025,
-       NUBUS_RESID_SECONDINIT   = 0x0026,
-
-       /* Not sure why Apple put these next two in here */
-       NUBUS_RESID_VIDNAMES     = 0x0041,
-       NUBUS_RESID_VIDMODES     = 0x007e
-};
-
-/* Fields within the vendor info directory */
-enum nubus_vendor_res_id {
-       NUBUS_RESID_VEND_ID     = 0x0001,
-       NUBUS_RESID_VEND_SERIAL = 0x0002,
-       NUBUS_RESID_VEND_REV    = 0x0003,
-       NUBUS_RESID_VEND_PART   = 0x0004,
-       NUBUS_RESID_VEND_DATE   = 0x0005
-};
-
-enum nubus_net_res_id {
-       NUBUS_RESID_MAC_ADDRESS  = 0x0080
-};
-
-enum nubus_cpu_res_id {
-       NUBUS_RESID_MEMINFO      = 0x0081,
-       NUBUS_RESID_ROMINFO      = 0x0082
-};
-
-enum nubus_display_res_id {
-       NUBUS_RESID_GAMMADIR    = 0x0040,
-       NUBUS_RESID_FIRSTMODE   = 0x0080,
-       NUBUS_RESID_SECONDMODE  = 0x0081,
-       NUBUS_RESID_THIRDMODE   = 0x0082,
-       NUBUS_RESID_FOURTHMODE  = 0x0083,
-       NUBUS_RESID_FIFTHMODE   = 0x0084,
-       NUBUS_RESID_SIXTHMODE   = 0x0085
-};
-
-struct nubus_dir
-{
-       unsigned char *base;
-       unsigned char *ptr;
-       int done;
-       int mask;
-};
-
-struct nubus_dirent
-{
-       unsigned char *base;
-       unsigned char type;
-       __u32 data;     /* Actually 24bits used */
-       int mask;
-};
-
-#ifdef __KERNEL__
 struct nubus_board {
        struct nubus_board* next;
        struct nubus_dev* first_dev;
@@ -352,12 +128,4 @@ void nubus_get_rsrc_mem(void* dest,
 void nubus_get_rsrc_str(void* dest,
                        const struct nubus_dirent *dirent,
                        int maxlen);
-#endif /* __KERNEL__ */
-
-/* We'd like to get rid of this eventually.  Only daynaport.c uses it now. */
-static inline void *nubus_slot_addr(int slot)
-{
-       return (void *)(0xF0000000|(slot<<24));
-}
-
 #endif /* LINUX_NUBUS_H */
index 9189829c131c3051a0b3087b1d1596dcfa292954..cf0ff555a6ac486902d7dc27b977452fcd0458cf 100644 (file)
@@ -1,18 +1,8 @@
 #ifndef _LINUX_NVRAM_H
 #define _LINUX_NVRAM_H
 
-#include <linux/ioctl.h>
+#include <uapi/linux/nvram.h>
 
-/* /dev/nvram ioctls */
-#define NVRAM_INIT     _IO('p', 0x40) /* initialize NVRAM and set checksum */
-#define NVRAM_SETCKS   _IO('p', 0x41) /* recalculate checksum */
-
-/* for all current systems, this is where NVRAM starts */
-#define NVRAM_FIRST_BYTE    14
-/* all these functions expect an NVRAM offset, not an absolute */
-#define NVRAM_OFFSET(x)   ((x)-NVRAM_FIRST_BYTE)
-
-#ifdef __KERNEL__
 /* __foo is foo without grabbing the rtc_lock - get it yourself */
 extern unsigned char __nvram_read_byte(int i);
 extern unsigned char nvram_read_byte(int i);
@@ -20,6 +10,4 @@ extern void __nvram_write_byte(unsigned char c, int i);
 extern void nvram_write_byte(unsigned char c, int i);
 extern int __nvram_check_checksum(void);
 extern int nvram_check_checksum(void);
-#endif
-
 #endif  /* _LINUX_NVRAM_H */
diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h
new file mode 100644 (file)
index 0000000..6926db7
--- /dev/null
@@ -0,0 +1,92 @@
+/* ASN.1 Object identifier (OID) registry
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_OID_REGISTRY_H
+#define _LINUX_OID_REGISTRY_H
+
+#include <linux/types.h>
+
+/*
+ * OIDs are turned into these values if possible, or OID__NR if not held here.
+ *
+ * NOTE!  Do not mess with the format of each line as this is read by
+ *       build_OID_registry.pl to generate the data for look_up_OID().
+ */
+enum OID {
+       OID_id_dsa_with_sha1,           /* 1.2.840.10030.4.3 */
+       OID_id_dsa,                     /* 1.2.840.10040.4.1 */
+       OID_id_ecdsa_with_sha1,         /* 1.2.840.10045.4.1 */
+       OID_id_ecPublicKey,             /* 1.2.840.10045.2.1 */
+
+       /* PKCS#1 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)} */
+       OID_rsaEncryption,              /* 1.2.840.113549.1.1.1 */
+       OID_md2WithRSAEncryption,       /* 1.2.840.113549.1.1.2 */
+       OID_md3WithRSAEncryption,       /* 1.2.840.113549.1.1.3 */
+       OID_md4WithRSAEncryption,       /* 1.2.840.113549.1.1.4 */
+       OID_sha1WithRSAEncryption,      /* 1.2.840.113549.1.1.5 */
+       OID_sha256WithRSAEncryption,    /* 1.2.840.113549.1.1.11 */
+       OID_sha384WithRSAEncryption,    /* 1.2.840.113549.1.1.12 */
+       OID_sha512WithRSAEncryption,    /* 1.2.840.113549.1.1.13 */
+       OID_sha224WithRSAEncryption,    /* 1.2.840.113549.1.1.14 */
+       /* PKCS#7 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-7(7)} */
+       OID_data,                       /* 1.2.840.113549.1.7.1 */
+       OID_signed_data,                /* 1.2.840.113549.1.7.2 */
+       /* PKCS#9 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)} */
+       OID_email_address,              /* 1.2.840.113549.1.9.1 */
+       OID_content_type,               /* 1.2.840.113549.1.9.3 */
+       OID_messageDigest,              /* 1.2.840.113549.1.9.4 */
+       OID_signingTime,                /* 1.2.840.113549.1.9.5 */
+       OID_smimeCapabilites,           /* 1.2.840.113549.1.9.15 */
+       OID_smimeAuthenticatedAttrs,    /* 1.2.840.113549.1.9.16.2.11 */
+
+       /* {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2)} */
+       OID_md2,                        /* 1.2.840.113549.2.2 */
+       OID_md4,                        /* 1.2.840.113549.2.4 */
+       OID_md5,                        /* 1.2.840.113549.2.5 */
+
+       OID_certAuthInfoAccess,         /* 1.3.6.1.5.5.7.1.1 */
+       OID_msOutlookExpress,           /* 1.3.6.1.4.1.311.16.4 */
+       OID_sha1,                       /* 1.3.14.3.2.26 */
+
+       /* Distinguished Name attribute IDs [RFC 2256] */
+       OID_commonName,                 /* 2.5.4.3 */
+       OID_surname,                    /* 2.5.4.4 */
+       OID_countryName,                /* 2.5.4.6 */
+       OID_locality,                   /* 2.5.4.7 */
+       OID_stateOrProvinceName,        /* 2.5.4.8 */
+       OID_organizationName,           /* 2.5.4.10 */
+       OID_organizationUnitName,       /* 2.5.4.11 */
+       OID_title,                      /* 2.5.4.12 */
+       OID_description,                /* 2.5.4.13 */
+       OID_name,                       /* 2.5.4.41 */
+       OID_givenName,                  /* 2.5.4.42 */
+       OID_initials,                   /* 2.5.4.43 */
+       OID_generationalQualifier,      /* 2.5.4.44 */
+
+       /* Certificate extension IDs */
+       OID_subjectKeyIdentifier,       /* 2.5.29.14 */
+       OID_keyUsage,                   /* 2.5.29.15 */
+       OID_subjectAltName,             /* 2.5.29.17 */
+       OID_issuerAltName,              /* 2.5.29.18 */
+       OID_basicConstraints,           /* 2.5.29.19 */
+       OID_crlDistributionPoints,      /* 2.5.29.31 */
+       OID_certPolicies,               /* 2.5.29.32 */
+       OID_authorityKeyIdentifier,     /* 2.5.29.35 */
+       OID_extKeyUsage,                /* 2.5.29.37 */
+
+       OID__NR
+};
+
+extern enum OID look_up_OID(const void *data, size_t datasize);
+extern int sprint_oid(const void *, size_t, char *, size_t);
+extern int sprint_OID(enum OID, char *, size_t);
+
+#endif /* _LINUX_OID_REGISTRY_H */
index 85af8184691a39d4b6c9dd2d0fdd32decb213ad8..d1f4dccaeede3294e49076acc2637db4a52b77f5 100644 (file)
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
 #ifndef __LINUX_OMAPFB_H__
 #define __LINUX_OMAPFB_H__
 
-#include <linux/fb.h>
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-/* IOCTL commands. */
-
-#define OMAP_IOW(num, dtype)   _IOW('O', num, dtype)
-#define OMAP_IOR(num, dtype)   _IOR('O', num, dtype)
-#define OMAP_IOWR(num, dtype)  _IOWR('O', num, dtype)
-#define OMAP_IO(num)           _IO('O', num)
-
-#define OMAPFB_MIRROR          OMAP_IOW(31, int)
-#define OMAPFB_SYNC_GFX                OMAP_IO(37)
-#define OMAPFB_VSYNC           OMAP_IO(38)
-#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
-#define OMAPFB_GET_CAPS                OMAP_IOR(42, struct omapfb_caps)
-#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
-#define OMAPFB_LCD_TEST                OMAP_IOW(45, int)
-#define OMAPFB_CTRL_TEST       OMAP_IOW(46, int)
-#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
-#define OMAPFB_SET_COLOR_KEY   OMAP_IOW(50, struct omapfb_color_key)
-#define OMAPFB_GET_COLOR_KEY   OMAP_IOW(51, struct omapfb_color_key)
-#define OMAPFB_SETUP_PLANE     OMAP_IOW(52, struct omapfb_plane_info)
-#define OMAPFB_QUERY_PLANE     OMAP_IOW(53, struct omapfb_plane_info)
-#define OMAPFB_UPDATE_WINDOW   OMAP_IOW(54, struct omapfb_update_window)
-#define OMAPFB_SETUP_MEM       OMAP_IOW(55, struct omapfb_mem_info)
-#define OMAPFB_QUERY_MEM       OMAP_IOW(56, struct omapfb_mem_info)
-#define OMAPFB_WAITFORVSYNC    OMAP_IO(57)
-#define OMAPFB_MEMORY_READ     OMAP_IOR(58, struct omapfb_memory_read)
-#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
-#define OMAPFB_WAITFORGO       OMAP_IO(60)
-#define OMAPFB_GET_VRAM_INFO   OMAP_IOR(61, struct omapfb_vram_info)
-#define OMAPFB_SET_TEARSYNC    OMAP_IOW(62, struct omapfb_tearsync_info)
-#define OMAPFB_GET_DISPLAY_INFO        OMAP_IOR(63, struct omapfb_display_info)
-
-#define OMAPFB_CAPS_GENERIC_MASK       0x00000fff
-#define OMAPFB_CAPS_LCDC_MASK          0x00fff000
-#define OMAPFB_CAPS_PANEL_MASK         0xff000000
-
-#define OMAPFB_CAPS_MANUAL_UPDATE      0x00001000
-#define OMAPFB_CAPS_TEARSYNC           0x00002000
-#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
-#define OMAPFB_CAPS_PLANE_SCALE                0x00008000
-#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE        0x00010000
-#define OMAPFB_CAPS_WINDOW_SCALE       0x00020000
-#define OMAPFB_CAPS_WINDOW_OVERLAY     0x00040000
-#define OMAPFB_CAPS_WINDOW_ROTATE      0x00080000
-#define OMAPFB_CAPS_SET_BACKLIGHT      0x01000000
-
-/* Values from DSP must map to lower 16-bits */
-#define OMAPFB_FORMAT_MASK             0x00ff
-#define OMAPFB_FORMAT_FLAG_DOUBLE      0x0100
-#define OMAPFB_FORMAT_FLAG_TEARSYNC    0x0200
-#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
-#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY      0x0800
-#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY     0x1000
-
-#define OMAPFB_MEMTYPE_SDRAM           0
-#define OMAPFB_MEMTYPE_SRAM            1
-#define OMAPFB_MEMTYPE_MAX             1
-
-#define OMAPFB_MEM_IDX_ENABLED 0x80
-#define OMAPFB_MEM_IDX_MASK    0x7f
-
-enum omapfb_color_format {
-       OMAPFB_COLOR_RGB565 = 0,
-       OMAPFB_COLOR_YUV422,
-       OMAPFB_COLOR_YUV420,
-       OMAPFB_COLOR_CLUT_8BPP,
-       OMAPFB_COLOR_CLUT_4BPP,
-       OMAPFB_COLOR_CLUT_2BPP,
-       OMAPFB_COLOR_CLUT_1BPP,
-       OMAPFB_COLOR_RGB444,
-       OMAPFB_COLOR_YUY422,
-
-       OMAPFB_COLOR_ARGB16,
-       OMAPFB_COLOR_RGB24U,    /* RGB24, 32-bit container */
-       OMAPFB_COLOR_RGB24P,    /* RGB24, 24-bit container */
-       OMAPFB_COLOR_ARGB32,
-       OMAPFB_COLOR_RGBA32,
-       OMAPFB_COLOR_RGBX32,
-};
-
-struct omapfb_update_window {
-       __u32 x, y;
-       __u32 width, height;
-       __u32 format;
-       __u32 out_x, out_y;
-       __u32 out_width, out_height;
-       __u32 reserved[8];
-};
+#include <uapi/linux/omapfb.h>
 
-struct omapfb_update_window_old {
-       __u32 x, y;
-       __u32 width, height;
-       __u32 format;
-};
-
-enum omapfb_plane {
-       OMAPFB_PLANE_GFX = 0,
-       OMAPFB_PLANE_VID1,
-       OMAPFB_PLANE_VID2,
-};
-
-enum omapfb_channel_out {
-       OMAPFB_CHANNEL_OUT_LCD = 0,
-       OMAPFB_CHANNEL_OUT_DIGIT,
-};
-
-struct omapfb_plane_info {
-       __u32 pos_x;
-       __u32 pos_y;
-       __u8  enabled;
-       __u8  channel_out;
-       __u8  mirror;
-       __u8  mem_idx;
-       __u32 out_width;
-       __u32 out_height;
-       __u32 reserved2[12];
-};
-
-struct omapfb_mem_info {
-       __u32 size;
-       __u8  type;
-       __u8  reserved[3];
-};
-
-struct omapfb_caps {
-       __u32 ctrl;
-       __u32 plane_color;
-       __u32 wnd_color;
-};
-
-enum omapfb_color_key_type {
-       OMAPFB_COLOR_KEY_DISABLED = 0,
-       OMAPFB_COLOR_KEY_GFX_DST,
-       OMAPFB_COLOR_KEY_VID_SRC,
-};
-
-struct omapfb_color_key {
-       __u8  channel_out;
-       __u32 background;
-       __u32 trans_key;
-       __u8  key_type;
-};
-
-enum omapfb_update_mode {
-       OMAPFB_UPDATE_DISABLED = 0,
-       OMAPFB_AUTO_UPDATE,
-       OMAPFB_MANUAL_UPDATE
-};
-
-struct omapfb_memory_read {
-       __u16 x;
-       __u16 y;
-       __u16 w;
-       __u16 h;
-       size_t buffer_size;
-       void __user *buffer;
-};
-
-struct omapfb_ovl_colormode {
-       __u8 overlay_idx;
-       __u8 mode_idx;
-       __u32 bits_per_pixel;
-       __u32 nonstd;
-       struct fb_bitfield red;
-       struct fb_bitfield green;
-       struct fb_bitfield blue;
-       struct fb_bitfield transp;
-};
-
-struct omapfb_vram_info {
-       __u32 total;
-       __u32 free;
-       __u32 largest_free_block;
-       __u32 reserved[5];
-};
-
-struct omapfb_tearsync_info {
-       __u8 enabled;
-       __u8 reserved1[3];
-       __u16 line;
-       __u16 reserved2;
-};
-
-struct omapfb_display_info {
-       __u16 xres;
-       __u16 yres;
-       __u32 width;    /* phys width of the display in micrometers */
-       __u32 height;   /* phys height of the display in micrometers */
-       __u32 reserved[5];
-};
-
-#ifdef __KERNEL__
 
 struct omap_lcd_config {
        char panel_name[16];
@@ -233,6 +39,4 @@ struct omapfb_platform_data {
 
 void __init omapfb_set_lcd_config(const struct omap_lcd_config *config);
 
-#endif
-
 #endif /* __OMAPFB_H */
index d36a8221f58be3ac51ae37730469c380a433149e..fb9826847b89184d1e3c99b00c0dfcf0f096e1f9 100644 (file)
@@ -1,18 +1,11 @@
 #ifndef __INCLUDE_LINUX_OOM_H
 #define __INCLUDE_LINUX_OOM_H
 
-/*
- * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for
- * pid.
- */
-#define OOM_SCORE_ADJ_MIN      (-1000)
-#define OOM_SCORE_ADJ_MAX      1000
-
-#ifdef __KERNEL__
 
 #include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/nodemask.h>
+#include <uapi/linux/oom.h>
 
 struct zonelist;
 struct notifier_block;
@@ -82,5 +75,4 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p);
 extern int sysctl_oom_dump_tasks;
 extern int sysctl_oom_kill_allocating_task;
 extern int sysctl_panic_on_oom;
-#endif /* __KERNEL__*/
 #endif /* _INCLUDE_LINUX_OOM_H */
index 106c2ca9440be2f17a51d19cbd43969a5056454e..c22f12547324e2bcc090f2e4022a8fedea2b3b53 100644 (file)
@@ -3,96 +3,9 @@
  * the GNU Free Documentation License, Version 1.1 or any later version
  * published by the Free Software Foundation.
  */
-
 #ifndef _PARPORT_H_
 #define _PARPORT_H_
 
-/* Start off with user-visible constants */
-
-/* Maximum of 16 ports per machine */
-#define PARPORT_MAX  16
-
-/* Magic numbers */
-#define PARPORT_IRQ_NONE  -1
-#define PARPORT_DMA_NONE  -1
-#define PARPORT_IRQ_AUTO  -2
-#define PARPORT_DMA_AUTO  -2
-#define PARPORT_DMA_NOFIFO -3
-#define PARPORT_DISABLE   -2
-#define PARPORT_IRQ_PROBEONLY -3
-#define PARPORT_IOHI_AUTO -1
-
-#define PARPORT_CONTROL_STROBE    0x1
-#define PARPORT_CONTROL_AUTOFD    0x2
-#define PARPORT_CONTROL_INIT      0x4
-#define PARPORT_CONTROL_SELECT    0x8
-
-#define PARPORT_STATUS_ERROR      0x8
-#define PARPORT_STATUS_SELECT     0x10
-#define PARPORT_STATUS_PAPEROUT   0x20
-#define PARPORT_STATUS_ACK        0x40
-#define PARPORT_STATUS_BUSY       0x80
-
-/* Type classes for Plug-and-Play probe.  */
-typedef enum {
-       PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
-       PARPORT_CLASS_PRINTER,
-       PARPORT_CLASS_MODEM,
-       PARPORT_CLASS_NET,
-       PARPORT_CLASS_HDC,              /* Hard disk controller */
-       PARPORT_CLASS_PCMCIA,
-       PARPORT_CLASS_MEDIA,            /* Multimedia device */
-       PARPORT_CLASS_FDC,              /* Floppy disk controller */
-       PARPORT_CLASS_PORTS,
-       PARPORT_CLASS_SCANNER,
-       PARPORT_CLASS_DIGCAM,
-       PARPORT_CLASS_OTHER,            /* Anything else */
-       PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
-       PARPORT_CLASS_SCSIADAPTER
-} parport_device_class;
-
-/* The "modes" entry in parport is a bit field representing the
-   capabilities of the hardware. */
-#define PARPORT_MODE_PCSPP     (1<<0) /* IBM PC registers available. */
-#define PARPORT_MODE_TRISTATE  (1<<1) /* Can tristate. */
-#define PARPORT_MODE_EPP       (1<<2) /* Hardware EPP. */
-#define PARPORT_MODE_ECP       (1<<3) /* Hardware ECP. */
-#define PARPORT_MODE_COMPAT    (1<<4) /* Hardware 'printer protocol'. */
-#define PARPORT_MODE_DMA       (1<<5) /* Hardware can DMA. */
-#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
-
-/* IEEE1284 modes: 
-   Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
-   'extensibility request' values.  Others are special.
-   'Real' ECP modes must have the IEEE1284_MODE_ECP bit set.  */
-#define IEEE1284_MODE_NIBBLE             0
-#define IEEE1284_MODE_BYTE              (1<<0)
-#define IEEE1284_MODE_COMPAT            (1<<8)
-#define IEEE1284_MODE_BECP              (1<<9) /* Bounded ECP mode */
-#define IEEE1284_MODE_ECP               (1<<4)
-#define IEEE1284_MODE_ECPRLE            (IEEE1284_MODE_ECP | (1<<5))
-#define IEEE1284_MODE_ECPSWE            (1<<10) /* Software-emulated */
-#define IEEE1284_MODE_EPP               (1<<6)
-#define IEEE1284_MODE_EPPSL             (1<<11) /* EPP 1.7 */
-#define IEEE1284_MODE_EPPSWE            (1<<12) /* Software-emulated */
-#define IEEE1284_DEVICEID               (1<<2)  /* This is a flag */
-#define IEEE1284_EXT_LINK               (1<<14) /* This flag causes the
-                                                * extensibility link to
-                                                * be requested, using
-                                                * bits 0-6. */
-
-/* For the benefit of parport_read/write, you can use these with
- * parport_negotiate to use address operations.  They have no effect
- * other than to make parport_read/write use address transfers. */
-#define IEEE1284_ADDR                  (1<<13) /* This is a flag */
-#define IEEE1284_DATA                   0      /* So is this */
-
-/* Flags for block transfer operations. */
-#define PARPORT_EPP_FAST               (1<<0) /* Unreliable counts. */
-#define PARPORT_W91284PIC              (1<<1) /* have a Warp9 w91284pic in the device */
-
-/* The rest is for the kernel only */
-#ifdef __KERNEL__
 
 #include <linux/jiffies.h>
 #include <linux/proc_fs.h>
@@ -101,6 +14,7 @@ typedef enum {
 #include <linux/irqreturn.h>
 #include <linux/semaphore.h>
 #include <asm/ptrace.h>
+#include <uapi/linux/parport.h>
 
 /* Define this later. */
 struct parport;
@@ -564,5 +478,4 @@ extern int parport_device_proc_unregister(struct pardevice *device);
 extern unsigned long parport_default_timeslice;
 extern int parport_default_spintime;
 
-#endif /* __KERNEL__ */
 #endif /* _PARPORT_H_ */
index aefda0ec6e627d26d8ec7394f26d5aa01f0d37fd..97a919fc9927005bb976b654de32ba8a3909f999 100644 (file)
@@ -9,22 +9,12 @@
  * Do not include this file directly.  Please use <sys/soundcard.h> instead.
  * For kernel code, use <linux/soundcard.h>
  */
-
-#ifndef _LINUX_PATCHKEY_H_INDIRECT
-#error "patchkey.h included directly"
-#endif
-
 #ifndef _LINUX_PATCHKEY_H
 #define _LINUX_PATCHKEY_H
 
-/* Endian macros. */
-#ifdef __KERNEL__
 #  include <asm/byteorder.h>
-#else
-#  include <endian.h>
-#endif
+#include <uapi/linux/patchkey.h>
 
-#if defined(__KERNEL__)
 #  if defined(__BIG_ENDIAN)
 #    define _PATCHKEY(id) (0xfd00|id)
 #  elif defined(__LITTLE_ENDIAN)
 #  else
 #    error "could not determine byte order"
 #  endif
-#else
-#if defined(__BYTE_ORDER)
-#  if __BYTE_ORDER == __BIG_ENDIAN
-#    define _PATCHKEY(id) (0xfd00|id)
-#  elif __BYTE_ORDER == __LITTLE_ENDIAN
-#    define _PATCHKEY(id) ((id<<8)|0x00fd)
-#  else
-#    error "could not determine byte order"
-#  endif
-#endif
-#endif
-
 #endif /* _LINUX_PATCHKEY_H */
index be1de01de1c4accc7b97c9ba9f782dc9809a2592..ee2179546c63b98c2fb8441e03a1f9481ef592b2 100644 (file)
  *     PCI to PCI Bridge Specification
  *     PCI System Design Guide
  */
-
 #ifndef LINUX_PCI_H
 #define LINUX_PCI_H
 
-#include <linux/pci_regs.h>    /* The pci register defines */
-
-/*
- * The PCI interface treats multi-function devices as independent
- * devices.  The slot/function address of each device is encoded
- * in a single byte as follows:
- *
- *     7:3 = slot
- *     2:0 = function
- */
-#define PCI_DEVFN(slot, func)  ((((slot) & 0x1f) << 3) | ((func) & 0x07))
-#define PCI_SLOT(devfn)                (((devfn) >> 3) & 0x1f)
-#define PCI_FUNC(devfn)                ((devfn) & 0x07)
-
-/* Ioctls for /proc/bus/pci/X/Y nodes. */
-#define PCIIOC_BASE            ('P' << 24 | 'C' << 16 | 'I' << 8)
-#define PCIIOC_CONTROLLER      (PCIIOC_BASE | 0x00)    /* Get controller for PCI device. */
-#define PCIIOC_MMAP_IS_IO      (PCIIOC_BASE | 0x01)    /* Set mmap state to I/O space. */
-#define PCIIOC_MMAP_IS_MEM     (PCIIOC_BASE | 0x02)    /* Set mmap state to MEM space. */
-#define PCIIOC_WRITE_COMBINE   (PCIIOC_BASE | 0x03)    /* Enable/disable write-combining. */
-
-#ifdef __KERNEL__
 
 #include <linux/mod_devicetable.h>
 
@@ -53,6 +30,7 @@
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/irqreturn.h>
+#include <uapi/linux/pci.h>
 
 /* Include the ID list */
 #include <linux/pci_ids.h>
@@ -1831,5 +1809,4 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
  */
 struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
 
-#endif /* __KERNEL__ */
 #endif /* LINUX_PCI_H */
index b4166cdfa7a2cd991019a1fe764323b22ecefa2a..2e902359aee596f128dee568d06e0e0ab3149dfe 100644 (file)
 #ifndef _LINUX_PERF_EVENT_H
 #define _LINUX_PERF_EVENT_H
 
-#include <linux/types.h>
-#include <linux/ioctl.h>
-#include <asm/byteorder.h>
+#include <uapi/linux/perf_event.h>
 
-/*
- * User-space ABI bits:
- */
-
-/*
- * attr.type
- */
-enum perf_type_id {
-       PERF_TYPE_HARDWARE                      = 0,
-       PERF_TYPE_SOFTWARE                      = 1,
-       PERF_TYPE_TRACEPOINT                    = 2,
-       PERF_TYPE_HW_CACHE                      = 3,
-       PERF_TYPE_RAW                           = 4,
-       PERF_TYPE_BREAKPOINT                    = 5,
-
-       PERF_TYPE_MAX,                          /* non-ABI */
-};
-
-/*
- * Generalized performance event event_id types, used by the
- * attr.event_id parameter of the sys_perf_event_open()
- * syscall:
- */
-enum perf_hw_id {
-       /*
-        * Common hardware events, generalized by the kernel:
-        */
-       PERF_COUNT_HW_CPU_CYCLES                = 0,
-       PERF_COUNT_HW_INSTRUCTIONS              = 1,
-       PERF_COUNT_HW_CACHE_REFERENCES          = 2,
-       PERF_COUNT_HW_CACHE_MISSES              = 3,
-       PERF_COUNT_HW_BRANCH_INSTRUCTIONS       = 4,
-       PERF_COUNT_HW_BRANCH_MISSES             = 5,
-       PERF_COUNT_HW_BUS_CYCLES                = 6,
-       PERF_COUNT_HW_STALLED_CYCLES_FRONTEND   = 7,
-       PERF_COUNT_HW_STALLED_CYCLES_BACKEND    = 8,
-       PERF_COUNT_HW_REF_CPU_CYCLES            = 9,
-
-       PERF_COUNT_HW_MAX,                      /* non-ABI */
-};
-
-/*
- * Generalized hardware cache events:
- *
- *       { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
- *       { read, write, prefetch } x
- *       { accesses, misses }
- */
-enum perf_hw_cache_id {
-       PERF_COUNT_HW_CACHE_L1D                 = 0,
-       PERF_COUNT_HW_CACHE_L1I                 = 1,
-       PERF_COUNT_HW_CACHE_LL                  = 2,
-       PERF_COUNT_HW_CACHE_DTLB                = 3,
-       PERF_COUNT_HW_CACHE_ITLB                = 4,
-       PERF_COUNT_HW_CACHE_BPU                 = 5,
-       PERF_COUNT_HW_CACHE_NODE                = 6,
-
-       PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
-};
-
-enum perf_hw_cache_op_id {
-       PERF_COUNT_HW_CACHE_OP_READ             = 0,
-       PERF_COUNT_HW_CACHE_OP_WRITE            = 1,
-       PERF_COUNT_HW_CACHE_OP_PREFETCH         = 2,
-
-       PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
-};
-
-enum perf_hw_cache_op_result_id {
-       PERF_COUNT_HW_CACHE_RESULT_ACCESS       = 0,
-       PERF_COUNT_HW_CACHE_RESULT_MISS         = 1,
-
-       PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
-};
-
-/*
- * Special "software" events provided by the kernel, even if the hardware
- * does not support performance events. These events measure various
- * physical and sw events of the kernel (and allow the profiling of them as
- * well):
- */
-enum perf_sw_ids {
-       PERF_COUNT_SW_CPU_CLOCK                 = 0,
-       PERF_COUNT_SW_TASK_CLOCK                = 1,
-       PERF_COUNT_SW_PAGE_FAULTS               = 2,
-       PERF_COUNT_SW_CONTEXT_SWITCHES          = 3,
-       PERF_COUNT_SW_CPU_MIGRATIONS            = 4,
-       PERF_COUNT_SW_PAGE_FAULTS_MIN           = 5,
-       PERF_COUNT_SW_PAGE_FAULTS_MAJ           = 6,
-       PERF_COUNT_SW_ALIGNMENT_FAULTS          = 7,
-       PERF_COUNT_SW_EMULATION_FAULTS          = 8,
-
-       PERF_COUNT_SW_MAX,                      /* non-ABI */
-};
-
-/*
- * Bits that can be set in attr.sample_type to request information
- * in the overflow packets.
- */
-enum perf_event_sample_format {
-       PERF_SAMPLE_IP                          = 1U << 0,
-       PERF_SAMPLE_TID                         = 1U << 1,
-       PERF_SAMPLE_TIME                        = 1U << 2,
-       PERF_SAMPLE_ADDR                        = 1U << 3,
-       PERF_SAMPLE_READ                        = 1U << 4,
-       PERF_SAMPLE_CALLCHAIN                   = 1U << 5,
-       PERF_SAMPLE_ID                          = 1U << 6,
-       PERF_SAMPLE_CPU                         = 1U << 7,
-       PERF_SAMPLE_PERIOD                      = 1U << 8,
-       PERF_SAMPLE_STREAM_ID                   = 1U << 9,
-       PERF_SAMPLE_RAW                         = 1U << 10,
-       PERF_SAMPLE_BRANCH_STACK                = 1U << 11,
-       PERF_SAMPLE_REGS_USER                   = 1U << 12,
-       PERF_SAMPLE_STACK_USER                  = 1U << 13,
-
-       PERF_SAMPLE_MAX = 1U << 14,             /* non-ABI */
-};
-
-/*
- * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
- *
- * If the user does not pass priv level information via branch_sample_type,
- * the kernel uses the event's priv level. Branch and event priv levels do
- * not have to match. Branch priv level is checked for permissions.
- *
- * The branch types can be combined, however BRANCH_ANY covers all types
- * of branches and therefore it supersedes all the other types.
- */
-enum perf_branch_sample_type {
-       PERF_SAMPLE_BRANCH_USER         = 1U << 0, /* user branches */
-       PERF_SAMPLE_BRANCH_KERNEL       = 1U << 1, /* kernel branches */
-       PERF_SAMPLE_BRANCH_HV           = 1U << 2, /* hypervisor branches */
-
-       PERF_SAMPLE_BRANCH_ANY          = 1U << 3, /* any branch types */
-       PERF_SAMPLE_BRANCH_ANY_CALL     = 1U << 4, /* any call branch */
-       PERF_SAMPLE_BRANCH_ANY_RETURN   = 1U << 5, /* any return branch */
-       PERF_SAMPLE_BRANCH_IND_CALL     = 1U << 6, /* indirect calls */
-
-       PERF_SAMPLE_BRANCH_MAX          = 1U << 7, /* non-ABI */
-};
-
-#define PERF_SAMPLE_BRANCH_PLM_ALL \
-       (PERF_SAMPLE_BRANCH_USER|\
-        PERF_SAMPLE_BRANCH_KERNEL|\
-        PERF_SAMPLE_BRANCH_HV)
-
-/*
- * Values to determine ABI of the registers dump.
- */
-enum perf_sample_regs_abi {
-       PERF_SAMPLE_REGS_ABI_NONE       = 0,
-       PERF_SAMPLE_REGS_ABI_32         = 1,
-       PERF_SAMPLE_REGS_ABI_64         = 2,
-};
-
-/*
- * The format of the data returned by read() on a perf event fd,
- * as specified by attr.read_format:
- *
- * struct read_format {
- *     { u64           value;
- *       { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
- *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
- *       { u64         id;           } && PERF_FORMAT_ID
- *     } && !PERF_FORMAT_GROUP
- *
- *     { u64           nr;
- *       { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
- *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
- *       { u64         value;
- *         { u64       id;           } && PERF_FORMAT_ID
- *       }             cntr[nr];
- *     } && PERF_FORMAT_GROUP
- * };
- */
-enum perf_event_read_format {
-       PERF_FORMAT_TOTAL_TIME_ENABLED          = 1U << 0,
-       PERF_FORMAT_TOTAL_TIME_RUNNING          = 1U << 1,
-       PERF_FORMAT_ID                          = 1U << 2,
-       PERF_FORMAT_GROUP                       = 1U << 3,
-
-       PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
-};
-
-#define PERF_ATTR_SIZE_VER0    64      /* sizeof first published struct */
-#define PERF_ATTR_SIZE_VER1    72      /* add: config2 */
-#define PERF_ATTR_SIZE_VER2    80      /* add: branch_sample_type */
-#define PERF_ATTR_SIZE_VER3    96      /* add: sample_regs_user */
-                                       /* add: sample_stack_user */
-
-/*
- * Hardware event_id to monitor via a performance monitoring event:
- */
-struct perf_event_attr {
-
-       /*
-        * Major type: hardware/software/tracepoint/etc.
-        */
-       __u32                   type;
-
-       /*
-        * Size of the attr structure, for fwd/bwd compat.
-        */
-       __u32                   size;
-
-       /*
-        * Type specific configuration information.
-        */
-       __u64                   config;
-
-       union {
-               __u64           sample_period;
-               __u64           sample_freq;
-       };
-
-       __u64                   sample_type;
-       __u64                   read_format;
-
-       __u64                   disabled       :  1, /* off by default        */
-                               inherit        :  1, /* children inherit it   */
-                               pinned         :  1, /* must always be on PMU */
-                               exclusive      :  1, /* only group on PMU     */
-                               exclude_user   :  1, /* don't count user      */
-                               exclude_kernel :  1, /* ditto kernel          */
-                               exclude_hv     :  1, /* ditto hypervisor      */
-                               exclude_idle   :  1, /* don't count when idle */
-                               mmap           :  1, /* include mmap data     */
-                               comm           :  1, /* include comm data     */
-                               freq           :  1, /* use freq, not period  */
-                               inherit_stat   :  1, /* per task counts       */
-                               enable_on_exec :  1, /* next exec enables     */
-                               task           :  1, /* trace fork/exit       */
-                               watermark      :  1, /* wakeup_watermark      */
-                               /*
-                                * precise_ip:
-                                *
-                                *  0 - SAMPLE_IP can have arbitrary skid
-                                *  1 - SAMPLE_IP must have constant skid
-                                *  2 - SAMPLE_IP requested to have 0 skid
-                                *  3 - SAMPLE_IP must have 0 skid
-                                *
-                                *  See also PERF_RECORD_MISC_EXACT_IP
-                                */
-                               precise_ip     :  2, /* skid constraint       */
-                               mmap_data      :  1, /* non-exec mmap data    */
-                               sample_id_all  :  1, /* sample_type all events */
-
-                               exclude_host   :  1, /* don't count in host   */
-                               exclude_guest  :  1, /* don't count in guest  */
-
-                               exclude_callchain_kernel : 1, /* exclude kernel callchains */
-                               exclude_callchain_user   : 1, /* exclude user callchains */
-
-                               __reserved_1   : 41;
-
-       union {
-               __u32           wakeup_events;    /* wakeup every n events */
-               __u32           wakeup_watermark; /* bytes before wakeup   */
-       };
-
-       __u32                   bp_type;
-       union {
-               __u64           bp_addr;
-               __u64           config1; /* extension of config */
-       };
-       union {
-               __u64           bp_len;
-               __u64           config2; /* extension of config1 */
-       };
-       __u64   branch_sample_type; /* enum perf_branch_sample_type */
-
-       /*
-        * Defines set of user regs to dump on samples.
-        * See asm/perf_regs.h for details.
-        */
-       __u64   sample_regs_user;
-
-       /*
-        * Defines size of the user stack to dump on samples.
-        */
-       __u32   sample_stack_user;
-
-       /* Align to u64. */
-       __u32   __reserved_2;
-};
-
-#define perf_flags(attr)       (*(&(attr)->read_format + 1))
-
-/*
- * Ioctls that can be done on a perf event fd:
- */
-#define PERF_EVENT_IOC_ENABLE          _IO ('$', 0)
-#define PERF_EVENT_IOC_DISABLE         _IO ('$', 1)
-#define PERF_EVENT_IOC_REFRESH         _IO ('$', 2)
-#define PERF_EVENT_IOC_RESET           _IO ('$', 3)
-#define PERF_EVENT_IOC_PERIOD          _IOW('$', 4, __u64)
-#define PERF_EVENT_IOC_SET_OUTPUT      _IO ('$', 5)
-#define PERF_EVENT_IOC_SET_FILTER      _IOW('$', 6, char *)
-
-enum perf_event_ioc_flags {
-       PERF_IOC_FLAG_GROUP             = 1U << 0,
-};
-
-/*
- * Structure of the page that can be mapped via mmap
- */
-struct perf_event_mmap_page {
-       __u32   version;                /* version number of this structure */
-       __u32   compat_version;         /* lowest version this is compat with */
-
-       /*
-        * Bits needed to read the hw events in user-space.
-        *
-        *   u32 seq, time_mult, time_shift, idx, width;
-        *   u64 count, enabled, running;
-        *   u64 cyc, time_offset;
-        *   s64 pmc = 0;
-        *
-        *   do {
-        *     seq = pc->lock;
-        *     barrier()
-        *
-        *     enabled = pc->time_enabled;
-        *     running = pc->time_running;
-        *
-        *     if (pc->cap_usr_time && enabled != running) {
-        *       cyc = rdtsc();
-        *       time_offset = pc->time_offset;
-        *       time_mult   = pc->time_mult;
-        *       time_shift  = pc->time_shift;
-        *     }
-        *
-        *     idx = pc->index;
-        *     count = pc->offset;
-        *     if (pc->cap_usr_rdpmc && idx) {
-        *       width = pc->pmc_width;
-        *       pmc = rdpmc(idx - 1);
-        *     }
-        *
-        *     barrier();
-        *   } while (pc->lock != seq);
-        *
-        * NOTE: for obvious reason this only works on self-monitoring
-        *       processes.
-        */
-       __u32   lock;                   /* seqlock for synchronization */
-       __u32   index;                  /* hardware event identifier */
-       __s64   offset;                 /* add to hardware event value */
-       __u64   time_enabled;           /* time event active */
-       __u64   time_running;           /* time event on cpu */
-       union {
-               __u64   capabilities;
-               __u64   cap_usr_time  : 1,
-                       cap_usr_rdpmc : 1,
-                       cap_____res   : 62;
-       };
-
-       /*
-        * If cap_usr_rdpmc this field provides the bit-width of the value
-        * read using the rdpmc() or equivalent instruction. This can be used
-        * to sign extend the result like:
-        *
-        *   pmc <<= 64 - width;
-        *   pmc >>= 64 - width; // signed shift right
-        *   count += pmc;
-        */
-       __u16   pmc_width;
-
-       /*
-        * If cap_usr_time the below fields can be used to compute the time
-        * delta since time_enabled (in ns) using rdtsc or similar.
-        *
-        *   u64 quot, rem;
-        *   u64 delta;
-        *
-        *   quot = (cyc >> time_shift);
-        *   rem = cyc & ((1 << time_shift) - 1);
-        *   delta = time_offset + quot * time_mult +
-        *              ((rem * time_mult) >> time_shift);
-        *
-        * Where time_offset,time_mult,time_shift and cyc are read in the
-        * seqcount loop described above. This delta can then be added to
-        * enabled and possible running (if idx), improving the scaling:
-        *
-        *   enabled += delta;
-        *   if (idx)
-        *     running += delta;
-        *
-        *   quot = count / running;
-        *   rem  = count % running;
-        *   count = quot * enabled + (rem * enabled) / running;
-        */
-       __u16   time_shift;
-       __u32   time_mult;
-       __u64   time_offset;
-
-               /*
-                * Hole for extension of the self monitor capabilities
-                */
-
-       __u64   __reserved[120];        /* align to 1k */
-
-       /*
-        * Control data for the mmap() data buffer.
-        *
-        * User-space reading the @data_head value should issue an rmb(), on
-        * SMP capable platforms, after reading this value -- see
-        * perf_event_wakeup().
-        *
-        * When the mapping is PROT_WRITE the @data_tail value should be
-        * written by userspace to reflect the last read data. In this case
-        * the kernel will not over-write unread data.
-        */
-       __u64   data_head;              /* head in the data section */
-       __u64   data_tail;              /* user-space written tail */
-};
-
-#define PERF_RECORD_MISC_CPUMODE_MASK          (7 << 0)
-#define PERF_RECORD_MISC_CPUMODE_UNKNOWN       (0 << 0)
-#define PERF_RECORD_MISC_KERNEL                        (1 << 0)
-#define PERF_RECORD_MISC_USER                  (2 << 0)
-#define PERF_RECORD_MISC_HYPERVISOR            (3 << 0)
-#define PERF_RECORD_MISC_GUEST_KERNEL          (4 << 0)
-#define PERF_RECORD_MISC_GUEST_USER            (5 << 0)
-
-/*
- * Indicates that the content of PERF_SAMPLE_IP points to
- * the actual instruction that triggered the event. See also
- * perf_event_attr::precise_ip.
- */
-#define PERF_RECORD_MISC_EXACT_IP              (1 << 14)
-/*
- * Reserve the last bit to indicate some extended misc field
- */
-#define PERF_RECORD_MISC_EXT_RESERVED          (1 << 15)
-
-struct perf_event_header {
-       __u32   type;
-       __u16   misc;
-       __u16   size;
-};
-
-enum perf_event_type {
-
-       /*
-        * If perf_event_attr.sample_id_all is set then all event types will
-        * have the sample_type selected fields related to where/when
-        * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID)
-        * described in PERF_RECORD_SAMPLE below, it will be stashed just after
-        * the perf_event_header and the fields already present for the existing
-        * fields, i.e. at the end of the payload. That way a newer perf.data
-        * file will be supported by older perf tools, with these new optional
-        * fields being ignored.
-        *
-        * The MMAP events record the PROT_EXEC mappings so that we can
-        * correlate userspace IPs to code. They have the following structure:
-        *
-        * struct {
-        *      struct perf_event_header        header;
-        *
-        *      u32                             pid, tid;
-        *      u64                             addr;
-        *      u64                             len;
-        *      u64                             pgoff;
-        *      char                            filename[];
-        * };
-        */
-       PERF_RECORD_MMAP                        = 1,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *      u64                             id;
-        *      u64                             lost;
-        * };
-        */
-       PERF_RECORD_LOST                        = 2,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *
-        *      u32                             pid, tid;
-        *      char                            comm[];
-        * };
-        */
-       PERF_RECORD_COMM                        = 3,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *      u32                             pid, ppid;
-        *      u32                             tid, ptid;
-        *      u64                             time;
-        * };
-        */
-       PERF_RECORD_EXIT                        = 4,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *      u64                             time;
-        *      u64                             id;
-        *      u64                             stream_id;
-        * };
-        */
-       PERF_RECORD_THROTTLE                    = 5,
-       PERF_RECORD_UNTHROTTLE                  = 6,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *      u32                             pid, ppid;
-        *      u32                             tid, ptid;
-        *      u64                             time;
-        * };
-        */
-       PERF_RECORD_FORK                        = 7,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *      u32                             pid, tid;
-        *
-        *      struct read_format              values;
-        * };
-        */
-       PERF_RECORD_READ                        = 8,
-
-       /*
-        * struct {
-        *      struct perf_event_header        header;
-        *
-        *      { u64                   ip;       } && PERF_SAMPLE_IP
-        *      { u32                   pid, tid; } && PERF_SAMPLE_TID
-        *      { u64                   time;     } && PERF_SAMPLE_TIME
-        *      { u64                   addr;     } && PERF_SAMPLE_ADDR
-        *      { u64                   id;       } && PERF_SAMPLE_ID
-        *      { u64                   stream_id;} && PERF_SAMPLE_STREAM_ID
-        *      { u32                   cpu, res; } && PERF_SAMPLE_CPU
-        *      { u64                   period;   } && PERF_SAMPLE_PERIOD
-        *
-        *      { struct read_format    values;   } && PERF_SAMPLE_READ
-        *
-        *      { u64                   nr,
-        *        u64                   ips[nr];  } && PERF_SAMPLE_CALLCHAIN
-        *
-        *      #
-        *      # The RAW record below is opaque data wrt the ABI
-        *      #
-        *      # That is, the ABI doesn't make any promises wrt to
-        *      # the stability of its content, it may vary depending
-        *      # on event, hardware, kernel version and phase of
-        *      # the moon.
-        *      #
-        *      # In other words, PERF_SAMPLE_RAW contents are not an ABI.
-        *      #
-        *
-        *      { u32                   size;
-        *        char                  data[size];}&& PERF_SAMPLE_RAW
-        *
-        *      { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK
-        *
-        *      { u64                   abi; # enum perf_sample_regs_abi
-        *        u64                   regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
-        *
-        *      { u64                   size;
-        *        char                  data[size];
-        *        u64                   dyn_size; } && PERF_SAMPLE_STACK_USER
-        * };
-        */
-       PERF_RECORD_SAMPLE                      = 9,
-
-       PERF_RECORD_MAX,                        /* non-ABI */
-};
-
-#define PERF_MAX_STACK_DEPTH           127
-
-enum perf_callchain_context {
-       PERF_CONTEXT_HV                 = (__u64)-32,
-       PERF_CONTEXT_KERNEL             = (__u64)-128,
-       PERF_CONTEXT_USER               = (__u64)-512,
-
-       PERF_CONTEXT_GUEST              = (__u64)-2048,
-       PERF_CONTEXT_GUEST_KERNEL       = (__u64)-2176,
-       PERF_CONTEXT_GUEST_USER         = (__u64)-2560,
-
-       PERF_CONTEXT_MAX                = (__u64)-4095,
-};
-
-#define PERF_FLAG_FD_NO_GROUP          (1U << 0)
-#define PERF_FLAG_FD_OUTPUT            (1U << 1)
-#define PERF_FLAG_PID_CGROUP           (1U << 2) /* pid=cgroup id, per-cpu mode only */
-
-#ifdef __KERNEL__
 /*
  * Kernel-internal data types and definitions:
  */
@@ -1422,5 +825,4 @@ _name##_show(struct device *dev,                                   \
                                                                        \
 static struct device_attribute format_attr_##_name = __ATTR_RO(_name)
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_PERF_EVENT_H */
index 8fc7dd1a57ff29cb96722a01290f07de6dd1d23a..646c0a7d50faae5980038fba2e0a41fddfa6b4c1 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef _LINUX_PERSONALITY_H
 #define _LINUX_PERSONALITY_H
 
-#ifdef __KERNEL__
+#include <uapi/linux/personality.h>
+
 
 /*
  * Handling of different ABIs (personalities).
@@ -14,72 +15,6 @@ extern int           register_exec_domain(struct exec_domain *);
 extern int             unregister_exec_domain(struct exec_domain *);
 extern int             __set_personality(unsigned int);
 
-#endif /* __KERNEL__ */
-
-/*
- * Flags for bug emulation.
- *
- * These occupy the top three bytes.
- */
-enum {
-       UNAME26 =               0x0020000,
-       ADDR_NO_RANDOMIZE =     0x0040000,      /* disable randomization of VA space */
-       FDPIC_FUNCPTRS =        0x0080000,      /* userspace function ptrs point to descriptors
-                                                * (signal handling)
-                                                */
-       MMAP_PAGE_ZERO =        0x0100000,
-       ADDR_COMPAT_LAYOUT =    0x0200000,
-       READ_IMPLIES_EXEC =     0x0400000,
-       ADDR_LIMIT_32BIT =      0x0800000,
-       SHORT_INODE =           0x1000000,
-       WHOLE_SECONDS =         0x2000000,
-       STICKY_TIMEOUTS =       0x4000000,
-       ADDR_LIMIT_3GB =        0x8000000,
-};
-
-/*
- * Security-relevant compatibility flags that must be
- * cleared upon setuid or setgid exec:
- */
-#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC  | \
-                           ADDR_NO_RANDOMIZE  | \
-                           ADDR_COMPAT_LAYOUT | \
-                           MMAP_PAGE_ZERO)
-
-/*
- * Personality types.
- *
- * These go in the low byte.  Avoid using the top bit, it will
- * conflict with error returns.
- */
-enum {
-       PER_LINUX =             0x0000,
-       PER_LINUX_32BIT =       0x0000 | ADDR_LIMIT_32BIT,
-       PER_LINUX_FDPIC =       0x0000 | FDPIC_FUNCPTRS,
-       PER_SVR4 =              0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
-       PER_SVR3 =              0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
-       PER_SCOSVR3 =           0x0003 | STICKY_TIMEOUTS |
-                                        WHOLE_SECONDS | SHORT_INODE,
-       PER_OSR5 =              0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
-       PER_WYSEV386 =          0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
-       PER_ISCR4 =             0x0005 | STICKY_TIMEOUTS,
-       PER_BSD =               0x0006,
-       PER_SUNOS =             0x0006 | STICKY_TIMEOUTS,
-       PER_XENIX =             0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
-       PER_LINUX32 =           0x0008,
-       PER_LINUX32_3GB =       0x0008 | ADDR_LIMIT_3GB,
-       PER_IRIX32 =            0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
-       PER_IRIXN32 =           0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
-       PER_IRIX64 =            0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
-       PER_RISCOS =            0x000c,
-       PER_SOLARIS =           0x000d | STICKY_TIMEOUTS,
-       PER_UW7 =               0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
-       PER_OSF4 =              0x000f,                  /* OSF/1 v4 */
-       PER_HPUX =              0x0010,
-       PER_MASK =              0x00ff,
-};
-
-#ifdef __KERNEL__
 
 /*
  * Description of an execution domain.
@@ -116,6 +51,4 @@ struct exec_domain {
 #define set_personality(pers) \
        ((current->personality == (pers)) ? 0 : __set_personality(pers))
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_PERSONALITY_H */
index f48bfc80cb4bfc7736173f6687550867ed0fc882..f691b04fc5cebec9e4f4254a81e9e4a3a0c06494 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA
  */
-
 #ifndef LINUX_PHONET_H
 #define LINUX_PHONET_H
 
-#include <linux/types.h>
-#include <linux/socket.h>
-
-/* Automatic protocol selection */
-#define PN_PROTO_TRANSPORT     0
-/* Phonet datagram socket */
-#define PN_PROTO_PHONET                1
-/* Phonet pipe */
-#define PN_PROTO_PIPE          2
-#define PHONET_NPROTO          3
-
-/* Socket options for SOL_PNPIPE level */
-#define PNPIPE_ENCAP           1
-#define PNPIPE_IFINDEX         2
-#define PNPIPE_HANDLE          3
-#define PNPIPE_INITSTATE       4
-
-#define PNADDR_ANY             0
-#define PNADDR_BROADCAST       0xFC
-#define PNPORT_RESOURCE_ROUTING        0
-
-/* Values for PNPIPE_ENCAP option */
-#define PNPIPE_ENCAP_NONE      0
-#define PNPIPE_ENCAP_IP                1
-
-/* ioctls */
-#define SIOCPNGETOBJECT                (SIOCPROTOPRIVATE + 0)
-#define SIOCPNENABLEPIPE       (SIOCPROTOPRIVATE + 13)
-#define SIOCPNADDRESOURCE      (SIOCPROTOPRIVATE + 14)
-#define SIOCPNDELRESOURCE      (SIOCPROTOPRIVATE + 15)
-
-/* Phonet protocol header */
-struct phonethdr {
-       __u8    pn_rdev;
-       __u8    pn_sdev;
-       __u8    pn_res;
-       __be16  pn_length;
-       __u8    pn_robj;
-       __u8    pn_sobj;
-} __attribute__((packed));
-
-/* Common Phonet payload header */
-struct phonetmsg {
-       __u8    pn_trans_id;    /* transaction ID */
-       __u8    pn_msg_id;      /* message type */
-       union {
-               struct {
-                       __u8    pn_submsg_id;   /* message subtype */
-                       __u8    pn_data[5];
-               } base;
-               struct {
-                       __u16   pn_e_res_id;    /* extended resource ID */
-                       __u8    pn_e_submsg_id; /* message subtype */
-                       __u8    pn_e_data[3];
-               } ext;
-       } pn_msg_u;
-};
-#define PN_COMMON_MESSAGE      0xF0
-#define PN_COMMGR              0x10
-#define PN_PREFIX              0xE0 /* resource for extended messages */
-#define pn_submsg_id           pn_msg_u.base.pn_submsg_id
-#define pn_e_submsg_id         pn_msg_u.ext.pn_e_submsg_id
-#define pn_e_res_id            pn_msg_u.ext.pn_e_res_id
-#define pn_data                        pn_msg_u.base.pn_data
-#define pn_e_data              pn_msg_u.ext.pn_e_data
-
-/* data for unreachable errors */
-#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP    0x01
-#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP  0x14
-#define pn_orig_msg_id         pn_data[0]
-#define pn_status              pn_data[1]
-#define pn_e_orig_msg_id       pn_e_data[0]
-#define pn_e_status            pn_e_data[1]
-
-/* Phonet socket address structure */
-struct sockaddr_pn {
-       __kernel_sa_family_t spn_family;
-       __u8 spn_obj;
-       __u8 spn_dev;
-       __u8 spn_resource;
-       __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
-} __attribute__((packed));
-
-/* Well known address */
-#define PN_DEV_PC      0x10
-
-static inline __u16 pn_object(__u8 addr, __u16 port)
-{
-       return (addr << 8) | (port & 0x3ff);
-}
+#include <uapi/linux/phonet.h>
 
-static inline __u8 pn_obj(__u16 handle)
-{
-       return handle & 0xff;
-}
-
-static inline __u8 pn_dev(__u16 handle)
-{
-       return handle >> 8;
-}
-
-static inline __u16 pn_port(__u16 handle)
-{
-       return handle & 0x3ff;
-}
-
-static inline __u8 pn_addr(__u16 handle)
-{
-       return (handle >> 8) & 0xfc;
-}
-
-static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
-{
-       spn->spn_dev &= 0x03;
-       spn->spn_dev |= addr & 0xfc;
-}
-
-static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
-{
-       spn->spn_dev &= 0xfc;
-       spn->spn_dev |= (port >> 8) & 0x03;
-       spn->spn_obj = port & 0xff;
-}
-
-static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
-                                               __u16 handle)
-{
-       spn->spn_dev = pn_dev(handle);
-       spn->spn_obj = pn_obj(handle);
-}
-
-static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
-                                               __u8 resource)
-{
-       spn->spn_resource = resource;
-}
-
-static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
-{
-       return spn->spn_dev & 0xfc;
-}
-
-static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
-{
-       return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
-}
-
-static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
-{
-       return pn_object(spn->spn_dev, spn->spn_obj);
-}
-
-static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
-{
-       return spn->spn_resource;
-}
-
-/* Phonet device ioctl requests */
-#ifdef __KERNEL__
 #define SIOCPNGAUTOCONF                (SIOCDEVPRIVATE + 0)
 
 struct if_phonet_autoconf {
@@ -195,6 +37,4 @@ struct if_phonet_req {
        } ifr_ifru;
 };
 #define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf
-#endif /* __KERNEL__ */
-
 #endif
index 721301b0a9087c27a22a48e49e16b795fc975073..93d142ad152815c7aafefa00ddd6cf2e1ab77a31 100644 (file)
 #ifndef __PKTCDVD_H
 #define __PKTCDVD_H
 
-#include <linux/types.h>
-
-/*
- * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
- */
-#define PACKET_DEBUG           1
-
-#define        MAX_WRITERS             8
-
-#define PKT_RB_POOL_SIZE       512
-
-/*
- * How long we should hold a non-full packet before starting data gathering.
- */
-#define PACKET_WAIT_TIME       (HZ * 5 / 1000)
-
-/*
- * use drive write caching -- we need deferred error handling to be
- * able to successfully recover with this option (drive will return good
- * status as soon as the cdb is validated).
- */
-#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
-#define USE_WCACHING           1
-#else
-#define USE_WCACHING           0
-#endif
-
-/*
- * No user-servicable parts beyond this point ->
- */
-
-/*
- * device types
- */
-#define PACKET_CDR             1
-#define        PACKET_CDRW             2
-#define PACKET_DVDR            3
-#define PACKET_DVDRW           4
-
-/*
- * flags
- */
-#define PACKET_WRITABLE                1       /* pd is writable */
-#define PACKET_NWA_VALID       2       /* next writable address valid */
-#define PACKET_LRA_VALID       3       /* last recorded address valid */
-#define PACKET_MERGE_SEGS      4       /* perform segment merging to keep */
-                                       /* underlying cdrom device happy */
-
-/*
- * Disc status -- from READ_DISC_INFO
- */
-#define PACKET_DISC_EMPTY      0
-#define PACKET_DISC_INCOMPLETE 1
-#define PACKET_DISC_COMPLETE   2
-#define PACKET_DISC_OTHER      3
-
-/*
- * write type, and corresponding data block type
- */
-#define PACKET_MODE1           1
-#define PACKET_MODE2           2
-#define PACKET_BLOCK_MODE1     8
-#define PACKET_BLOCK_MODE2     10
-
-/*
- * Last session/border status
- */
-#define PACKET_SESSION_EMPTY           0
-#define PACKET_SESSION_INCOMPLETE      1
-#define PACKET_SESSION_RESERVED                2
-#define PACKET_SESSION_COMPLETE                3
-
-#define PACKET_MCN                     "4a656e734178626f65323030300000"
-
-#undef PACKET_USE_LS
-
-#define PKT_CTRL_CMD_SETUP     0
-#define PKT_CTRL_CMD_TEARDOWN  1
-#define PKT_CTRL_CMD_STATUS    2
-
-struct pkt_ctrl_command {
-       __u32 command;                          /* in: Setup, teardown, status */
-       __u32 dev_index;                        /* in/out: Device index */
-       __u32 dev;                              /* in/out: Device nr for cdrw device */
-       __u32 pkt_dev;                          /* in/out: Device nr for packet device */
-       __u32 num_devices;                      /* out: Largest device index + 1 */
-       __u32 padding;                          /* Not used */
-};
-
-/*
- * packet ioctls
- */
-#define PACKET_IOCTL_MAGIC     ('X')
-#define PACKET_CTRL_CMD                _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
-
-#ifdef __KERNEL__
 #include <linux/blkdev.h>
 #include <linux/completion.h>
 #include <linux/cdrom.h>
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
 #include <linux/mempool.h>
+#include <uapi/linux/pktcdvd.h>
 
 /* default bio write queue congestion marks */
 #define PKT_WRITE_CONGESTION_ON    10000
@@ -297,6 +202,4 @@ struct pktcdvd_device
        struct dentry           *dfs_f_info;    /* debugfs: info file */
 };
 
-#endif /* __KERNEL__ */
-
 #endif /* __PKTCDVD_H */
index 84e6a55a1202d2d9b4db2e3dbb1f448ef78aab54..99b400b8a2412b558e9c79b508bf62d384d458b2 100644 (file)
  *
  * Copyright (C) 1998 Paul Mackerras.
  */
-
 #ifndef _LINUX_PMU_H
 #define _LINUX_PMU_H
 
-#define PMU_DRIVER_VERSION     2
-
-/*
- * PMU commands
- */
-#define PMU_POWER_CTRL0                0x10    /* control power of some devices */
-#define PMU_POWER_CTRL         0x11    /* control power of some devices */
-#define PMU_ADB_CMD            0x20    /* send ADB packet */
-#define PMU_ADB_POLL_OFF       0x21    /* disable ADB auto-poll */
-#define PMU_WRITE_NVRAM                0x33    /* write non-volatile RAM */
-#define PMU_READ_NVRAM         0x3b    /* read non-volatile RAM */
-#define PMU_SET_RTC            0x30    /* set real-time clock */
-#define PMU_READ_RTC           0x38    /* read real-time clock */
-#define PMU_SET_VOLBUTTON      0x40    /* set volume up/down position */
-#define PMU_BACKLIGHT_BRIGHT   0x41    /* set backlight brightness */
-#define PMU_GET_VOLBUTTON      0x48    /* get volume up/down position */
-#define PMU_PCEJECT            0x4c    /* eject PC-card from slot */
-#define PMU_BATTERY_STATE      0x6b    /* report battery state etc. */
-#define PMU_SMART_BATTERY_STATE        0x6f    /* report battery state (new way) */
-#define PMU_SET_INTR_MASK      0x70    /* set PMU interrupt mask */
-#define PMU_INT_ACK            0x78    /* read interrupt bits */
-#define PMU_SHUTDOWN           0x7e    /* turn power off */
-#define PMU_CPU_SPEED          0x7d    /* control CPU speed on some models */
-#define PMU_SLEEP              0x7f    /* put CPU to sleep */
-#define PMU_POWER_EVENTS       0x8f    /* Send power-event commands to PMU */
-#define PMU_I2C_CMD            0x9a    /* I2C operations */
-#define PMU_RESET              0xd0    /* reset CPU */
-#define PMU_GET_BRIGHTBUTTON   0xd9    /* report brightness up/down pos */
-#define PMU_GET_COVER          0xdc    /* report cover open/closed */
-#define PMU_SYSTEM_READY       0xdf    /* tell PMU we are awake */
-#define PMU_GET_VERSION                0xea    /* read the PMU version */
-
-/* Bits to use with the PMU_POWER_CTRL0 command */
-#define PMU_POW0_ON            0x80    /* OR this to power ON the device */
-#define PMU_POW0_OFF           0x00    /* leave bit 7 to 0 to power it OFF */
-#define PMU_POW0_HARD_DRIVE    0x04    /* Hard drive power (on wallstreet/lombard ?) */
-
-/* Bits to use with the PMU_POWER_CTRL command */
-#define PMU_POW_ON             0x80    /* OR this to power ON the device */
-#define PMU_POW_OFF            0x00    /* leave bit 7 to 0 to power it OFF */
-#define PMU_POW_BACKLIGHT      0x01    /* backlight power */
-#define PMU_POW_CHARGER                0x02    /* battery charger power */
-#define PMU_POW_IRLED          0x04    /* IR led power (on wallstreet) */
-#define PMU_POW_MEDIABAY       0x08    /* media bay power (wallstreet/lombard ?) */
-
-/* Bits in PMU interrupt and interrupt mask bytes */
-#define PMU_INT_PCEJECT                0x04    /* PC-card eject buttons */
-#define PMU_INT_SNDBRT         0x08    /* sound/brightness up/down buttons */
-#define PMU_INT_ADB            0x10    /* ADB autopoll or reply data */
-#define PMU_INT_BATTERY                0x20    /* Battery state change */
-#define PMU_INT_ENVIRONMENT    0x40    /* Environment interrupts */
-#define PMU_INT_TICK           0x80    /* 1-second tick interrupt */
-
-/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
-#define PMU_INT_ADB_AUTO       0x04    /* ADB autopoll, when PMU_INT_ADB */
-#define PMU_INT_WAITING_CHARGER        0x01    /* ??? */
-#define PMU_INT_AUTO_SRQ_POLL  0x02    /* ??? */
-
-/* Bits in the environement message (either obtained via PMU_GET_COVER,
- * or via PMU_INT_ENVIRONMENT on core99 */
-#define PMU_ENV_LID_CLOSED     0x01    /* The lid is closed */
-
-/* I2C related definitions */
-#define PMU_I2C_MODE_SIMPLE    0
-#define PMU_I2C_MODE_STDSUB    1
-#define PMU_I2C_MODE_COMBINED  2
-
-#define PMU_I2C_BUS_STATUS     0
-#define PMU_I2C_BUS_SYSCLK     1
-#define PMU_I2C_BUS_POWER      2
-
-#define PMU_I2C_STATUS_OK      0
-#define PMU_I2C_STATUS_DATAREAD        1
-#define PMU_I2C_STATUS_BUSY    0xfe
-
-
-/* Kind of PMU (model) */
-enum {
-       PMU_UNKNOWN,
-       PMU_OHARE_BASED,        /* 2400, 3400, 3500 (old G3 powerbook) */
-       PMU_HEATHROW_BASED,     /* PowerBook G3 series */
-       PMU_PADDINGTON_BASED,   /* 1999 PowerBook G3 */
-       PMU_KEYLARGO_BASED,     /* Core99 motherboard (PMU99) */
-       PMU_68K_V1,             /* 68K PMU, version 1 */
-       PMU_68K_V2,             /* 68K PMU, version 2 */
-};
+#include <uapi/linux/pmu.h>
 
-/* PMU PMU_POWER_EVENTS commands */
-enum {
-       PMU_PWR_GET_POWERUP_EVENTS      = 0x00,
-       PMU_PWR_SET_POWERUP_EVENTS      = 0x01,
-       PMU_PWR_CLR_POWERUP_EVENTS      = 0x02,
-       PMU_PWR_GET_WAKEUP_EVENTS       = 0x03,
-       PMU_PWR_SET_WAKEUP_EVENTS       = 0x04,
-       PMU_PWR_CLR_WAKEUP_EVENTS       = 0x05,
-};
-
-/* Power events wakeup bits */
-enum {
-       PMU_PWR_WAKEUP_KEY              = 0x01, /* Wake on key press */
-       PMU_PWR_WAKEUP_AC_INSERT        = 0x02, /* Wake on AC adapter plug */
-       PMU_PWR_WAKEUP_AC_CHANGE        = 0x04,
-       PMU_PWR_WAKEUP_LID_OPEN         = 0x08,
-       PMU_PWR_WAKEUP_RING             = 0x10,
-};
-       
-/*
- * Ioctl commands for the /dev/pmu device
- */
-#include <linux/ioctl.h>
-
-/* no param */
-#define PMU_IOC_SLEEP          _IO('B', 0)
-/* out param: u32*     backlight value: 0 to 15 */
-#define PMU_IOC_GET_BACKLIGHT  _IOR('B', 1, size_t)
-/* in param: u32       backlight value: 0 to 15 */
-#define PMU_IOC_SET_BACKLIGHT  _IOW('B', 2, size_t)
-/* out param: u32*     PMU model */
-#define PMU_IOC_GET_MODEL      _IOR('B', 3, size_t)
-/* out param: u32*     has_adb: 0 or 1 */
-#define PMU_IOC_HAS_ADB                _IOR('B', 4, size_t) 
-/* out param: u32*     can_sleep: 0 or 1 */
-#define PMU_IOC_CAN_SLEEP      _IOR('B', 5, size_t) 
-/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
-#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t) 
-
-#ifdef __KERNEL__
 
 extern int find_via_pmu(void);
 
@@ -208,6 +82,4 @@ extern int pmu_sys_suspended;
 #define pmu_sys_suspended      0
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_PMU_H */
index 48fe8bc398d1a388c55ee7b99041ff5a84b25ea3..c08386fb3e0845933f074bda2117734c128075b3 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef _LINUX_POLL_H
 #define _LINUX_POLL_H
 
-#include <asm/poll.h>
-
-#ifdef __KERNEL__
 
 #include <linux/compiler.h>
 #include <linux/ktime.h>
@@ -12,6 +9,7 @@
 #include <linux/fs.h>
 #include <linux/sysctl.h>
 #include <asm/uaccess.h>
+#include <uapi/linux/poll.h>
 
 extern struct ctl_table epoll_table[]; /* for sysctl */
 /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
@@ -163,6 +161,4 @@ extern int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
 
 extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec);
 
-#endif /* KERNEL */
-
 #endif /* _LINUX_POLL_H */
index e53ff65935ddf9d5e9737005cea66a39c477d923..4ea1d377e1ad9d567ab22bd277652724742798d1 100644 (file)
@@ -10,6 +10,9 @@
 #ifndef _NET_PPP_COMP_H
 #define _NET_PPP_COMP_H
 
+#include <uapi/linux/ppp-comp.h>
+
+
 struct module;
 
 /*
@@ -98,87 +101,6 @@ struct compressor {
 #define DECOMP_ERROR           -1      /* error detected before decomp. */
 #define DECOMP_FATALERROR      -2      /* error detected after decomp. */
 
-/*
- * CCP codes.
- */
-
-#define CCP_CONFREQ    1
-#define CCP_CONFACK    2
-#define CCP_TERMREQ    5
-#define CCP_TERMACK    6
-#define CCP_RESETREQ   14
-#define CCP_RESETACK   15
-
-/*
- * Max # bytes for a CCP option
- */
-
-#define CCP_MAX_OPTION_LENGTH  32
-
-/*
- * Parts of a CCP packet.
- */
-
-#define CCP_CODE(dp)           ((dp)[0])
-#define CCP_ID(dp)             ((dp)[1])
-#define CCP_LENGTH(dp)         (((dp)[2] << 8) + (dp)[3])
-#define CCP_HDRLEN             4
-
-#define CCP_OPT_CODE(dp)       ((dp)[0])
-#define CCP_OPT_LENGTH(dp)     ((dp)[1])
-#define CCP_OPT_MINLEN         2
-
-/*
- * Definitions for BSD-Compress.
- */
-
-#define CI_BSD_COMPRESS                21      /* config. option for BSD-Compress */
-#define CILEN_BSD_COMPRESS     3       /* length of config. option */
-
-/* Macros for handling the 3rd byte of the BSD-Compress config option. */
-#define BSD_NBITS(x)           ((x) & 0x1F)    /* number of bits requested */
-#define BSD_VERSION(x)         ((x) >> 5)      /* version of option format */
-#define BSD_CURRENT_VERSION    1               /* current version number */
-#define BSD_MAKE_OPT(v, n)     (((v) << 5) | (n))
-
-#define BSD_MIN_BITS           9       /* smallest code size supported */
-#define BSD_MAX_BITS           15      /* largest code size supported */
-
-/*
- * Definitions for Deflate.
- */
-
-#define CI_DEFLATE             26      /* config option for Deflate */
-#define CI_DEFLATE_DRAFT       24      /* value used in original draft RFC */
-#define CILEN_DEFLATE          4       /* length of its config option */
-
-#define DEFLATE_MIN_SIZE       9
-#define DEFLATE_MAX_SIZE       15
-#define DEFLATE_METHOD_VAL     8
-#define DEFLATE_SIZE(x)                (((x) >> 4) + 8)
-#define DEFLATE_METHOD(x)      ((x) & 0x0F)
-#define DEFLATE_MAKE_OPT(w)    ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
-#define DEFLATE_CHK_SEQUENCE   0
-
-/*
- * Definitions for MPPE.
- */
-
-#define CI_MPPE                18      /* config option for MPPE */
-#define CILEN_MPPE              6      /* length of config option */
-
-/*
- * Definitions for other, as yet unsupported, compression methods.
- */
-
-#define CI_PREDICTOR_1         1       /* config option for Predictor-1 */
-#define CILEN_PREDICTOR_1      2       /* length of its config option */
-#define CI_PREDICTOR_2         2       /* config option for Predictor-2 */
-#define CILEN_PREDICTOR_2      2       /* length of its config option */
-
-#ifdef __KERNEL__
 extern int ppp_register_compressor(struct compressor *);
 extern void ppp_unregister_compressor(struct compressor *);
-#endif /* __KERNEL__ */
-
 #endif /* _NET_PPP_COMP_H */
index ba416f67eb621d3c74be22f426d49f3ddd8f173e..28aa0237c8c36ee669c52c5e0135c709aa24616e 100644 (file)
  *  modify it under the terms of the GNU General Public License
  *  version 2 as published by the Free Software Foundation.
  */
-#include <linux/types.h>
-
 #ifndef _PPP_DEFS_H_
 #define _PPP_DEFS_H_
 
-/*
- * The basic PPP frame.
- */
-#define PPP_HDRLEN     4       /* octets for standard ppp header */
-#define PPP_FCSLEN     2       /* octets for FCS */
-#define PPP_MRU                1500    /* default MRU = max length of info field */
-
-#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
-#define PPP_CONTROL(p) (((__u8 *)(p))[1])
-#define PPP_PROTOCOL(p)        ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
-
-/*
- * Significant octet values.
- */
-#define        PPP_ALLSTATIONS 0xff    /* All-Stations broadcast address */
-#define        PPP_UI          0x03    /* Unnumbered Information */
-#define        PPP_FLAG        0x7e    /* Flag Sequence */
-#define        PPP_ESCAPE      0x7d    /* Asynchronous Control Escape */
-#define        PPP_TRANS       0x20    /* Asynchronous transparency modifier */
-
-/*
- * Protocol field values.
- */
-#define PPP_IP         0x21    /* Internet Protocol */
-#define PPP_AT         0x29    /* AppleTalk Protocol */
-#define PPP_IPX                0x2b    /* IPX protocol */
-#define        PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
-#define        PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
-#define PPP_MP         0x3d    /* Multilink protocol */
-#define PPP_IPV6       0x57    /* Internet Protocol Version 6 */
-#define PPP_COMPFRAG   0xfb    /* fragment compressed below bundle */
-#define PPP_COMP       0xfd    /* compressed packet */
-#define PPP_MPLS_UC    0x0281  /* Multi Protocol Label Switching - Unicast */
-#define PPP_MPLS_MC    0x0283  /* Multi Protocol Label Switching - Multicast */
-#define PPP_IPCP       0x8021  /* IP Control Protocol */
-#define PPP_ATCP       0x8029  /* AppleTalk Control Protocol */
-#define PPP_IPXCP      0x802b  /* IPX Control Protocol */
-#define PPP_IPV6CP     0x8057  /* IPv6 Control Protocol */
-#define PPP_CCPFRAG    0x80fb  /* CCP at link level (below MP bundle) */
-#define PPP_CCP                0x80fd  /* Compression Control Protocol */
-#define PPP_MPLSCP     0x80fd  /* MPLS Control Protocol */
-#define PPP_LCP                0xc021  /* Link Control Protocol */
-#define PPP_PAP                0xc023  /* Password Authentication Protocol */
-#define PPP_LQR                0xc025  /* Link Quality Report protocol */
-#define PPP_CHAP       0xc223  /* Cryptographic Handshake Auth. Protocol */
-#define PPP_CBCP       0xc029  /* Callback Control Protocol */
-
-/*
- * Values for FCS calculations.
- */
-
-#define PPP_INITFCS    0xffff  /* Initial FCS value */
-#define PPP_GOODFCS    0xf0b8  /* Good final FCS value */
-
-#ifdef __KERNEL__
 #include <linux/crc-ccitt.h>
-#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
-#endif
-
-/*
- * Extended asyncmap - allows any character to be escaped.
- */
-
-typedef __u32          ext_accm[8];
-
-/*
- * What to do with network protocol (NP) packets.
- */
-enum NPmode {
-    NPMODE_PASS,               /* pass the packet through */
-    NPMODE_DROP,               /* silently drop the packet */
-    NPMODE_ERROR,              /* return an error */
-    NPMODE_QUEUE               /* save it up for later. */
-};
-
-/*
- * Statistics for LQRP and pppstats
- */
-struct pppstat {
-    __u32      ppp_discards;   /* # frames discarded */
-
-    __u32      ppp_ibytes;     /* bytes received */
-    __u32      ppp_ioctects;   /* bytes received not in error */
-    __u32      ppp_ipackets;   /* packets received */
-    __u32      ppp_ierrors;    /* receive errors */
-    __u32      ppp_ilqrs;      /* # LQR frames received */
-
-    __u32      ppp_obytes;     /* raw bytes sent */
-    __u32      ppp_ooctects;   /* frame bytes sent */
-    __u32      ppp_opackets;   /* packets sent */
-    __u32      ppp_oerrors;    /* transmit errors */ 
-    __u32      ppp_olqrs;      /* # LQR frames sent */
-};
-
-struct vjstat {
-    __u32      vjs_packets;    /* outbound packets */
-    __u32      vjs_compressed; /* outbound compressed packets */
-    __u32      vjs_searches;   /* searches for connection state */
-    __u32      vjs_misses;     /* times couldn't find conn. state */
-    __u32      vjs_uncompressedin; /* inbound uncompressed packets */
-    __u32      vjs_compressedin;   /* inbound compressed packets */
-    __u32      vjs_errorin;    /* inbound unknown type packets */
-    __u32      vjs_tossed;     /* inbound packets tossed because of error */
-};
-
-struct compstat {
-    __u32      unc_bytes;      /* total uncompressed bytes */
-    __u32      unc_packets;    /* total uncompressed packets */
-    __u32      comp_bytes;     /* compressed bytes */
-    __u32      comp_packets;   /* compressed packets */
-    __u32      inc_bytes;      /* incompressible bytes */
-    __u32      inc_packets;    /* incompressible packets */
-
-    /* the compression ratio is defined as in_count / bytes_out */
-    __u32       in_count;      /* Bytes received */
-    __u32       bytes_out;     /* Bytes transmitted */
-
-    double     ratio;          /* not computed in kernel. */
-};
-
-struct ppp_stats {
-    struct pppstat     p;      /* basic PPP statistics */
-    struct vjstat      vj;     /* VJ header compression statistics */
-};
-
-struct ppp_comp_stats {
-    struct compstat    c;      /* packet compression statistics */
-    struct compstat    d;      /* packet decompression statistics */
-};
-
-/*
- * The following structure records the time in seconds since
- * the last NP packet was sent or received.
- */
-struct ppp_idle {
-    __kernel_time_t xmit_idle; /* time since last NP packet sent */
-    __kernel_time_t recv_idle; /* time since last NP packet received */
-};
+#include <uapi/linux/ppp_defs.h>
 
+#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
 #endif /* _PPP_DEFS_H_ */
index 1d24ffad59c53c27a66bf7b4cced639f0a5f000a..e0ff4689d35a6bb6a72b17b3f6cc055066d3ca41 100644 (file)
@@ -1,82 +1,12 @@
 #ifndef _LINUX_PTRACE_H
 #define _LINUX_PTRACE_H
-/* ptrace.h */
-/* structs and defines to help the user use the ptrace system call. */
 
-/* has the defines to get at the registers. */
-
-#define PTRACE_TRACEME            0
-#define PTRACE_PEEKTEXT                   1
-#define PTRACE_PEEKDATA                   2
-#define PTRACE_PEEKUSR            3
-#define PTRACE_POKETEXT                   4
-#define PTRACE_POKEDATA                   5
-#define PTRACE_POKEUSR            6
-#define PTRACE_CONT               7
-#define PTRACE_KILL               8
-#define PTRACE_SINGLESTEP         9
-
-#define PTRACE_ATTACH            16
-#define PTRACE_DETACH            17
-
-#define PTRACE_SYSCALL           24
-
-/* 0x4200-0x4300 are reserved for architecture-independent additions.  */
-#define PTRACE_SETOPTIONS      0x4200
-#define PTRACE_GETEVENTMSG     0x4201
-#define PTRACE_GETSIGINFO      0x4202
-#define PTRACE_SETSIGINFO      0x4203
+#include <linux/compiler.h>            /* For unlikely.  */
+#include <linux/sched.h>               /* For struct task_struct.  */
+#include <linux/err.h>                 /* for IS_ERR_VALUE */
+#include <linux/bug.h>                 /* For BUG_ON.  */
+#include <uapi/linux/ptrace.h>
 
-/*
- * Generic ptrace interface that exports the architecture specific regsets
- * using the corresponding NT_* types (which are also used in the core dump).
- * Please note that the NT_PRSTATUS note type in a core dump contains a full
- * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
- * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
- * other user_regset flavors, the user_regset layout and the ELF core dump note
- * payload are exactly the same layout.
- *
- * This interface usage is as follows:
- *     struct iovec iov = { buf, len};
- *
- *     ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
- *
- * On the successful completion, iov.len will be updated by the kernel,
- * specifying how much the kernel has written/read to/from the user's iov.buf.
- */
-#define PTRACE_GETREGSET       0x4204
-#define PTRACE_SETREGSET       0x4205
-
-#define PTRACE_SEIZE           0x4206
-#define PTRACE_INTERRUPT       0x4207
-#define PTRACE_LISTEN          0x4208
-
-/* Wait extended result codes for the above trace options.  */
-#define PTRACE_EVENT_FORK      1
-#define PTRACE_EVENT_VFORK     2
-#define PTRACE_EVENT_CLONE     3
-#define PTRACE_EVENT_EXEC      4
-#define PTRACE_EVENT_VFORK_DONE        5
-#define PTRACE_EVENT_EXIT      6
-#define PTRACE_EVENT_SECCOMP   7
-/* Extended result codes which enabled by means other than options.  */
-#define PTRACE_EVENT_STOP      128
-
-/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
-#define PTRACE_O_TRACESYSGOOD  1
-#define PTRACE_O_TRACEFORK     (1 << PTRACE_EVENT_FORK)
-#define PTRACE_O_TRACEVFORK    (1 << PTRACE_EVENT_VFORK)
-#define PTRACE_O_TRACECLONE    (1 << PTRACE_EVENT_CLONE)
-#define PTRACE_O_TRACEEXEC     (1 << PTRACE_EVENT_EXEC)
-#define PTRACE_O_TRACEVFORKDONE        (1 << PTRACE_EVENT_VFORK_DONE)
-#define PTRACE_O_TRACEEXIT     (1 << PTRACE_EVENT_EXIT)
-#define PTRACE_O_TRACESECCOMP  (1 << PTRACE_EVENT_SECCOMP)
-
-#define PTRACE_O_MASK          0x000000ff
-
-#include <asm/ptrace.h>
-
-#ifdef __KERNEL__
 /*
  * Ptrace flags
  *
 #define PT_BLOCKSTEP_BIT       30
 #define PT_BLOCKSTEP           (1<<PT_BLOCKSTEP_BIT)
 
-#include <linux/compiler.h>            /* For unlikely.  */
-#include <linux/sched.h>               /* For struct task_struct.  */
-#include <linux/err.h>                 /* for IS_ERR_VALUE */
-#include <linux/bug.h>                 /* For BUG_ON.  */
-
-
 extern long arch_ptrace(struct task_struct *child, long request,
                        unsigned long addr, unsigned long data);
 extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
@@ -416,6 +340,4 @@ extern void ptrace_put_breakpoints(struct task_struct *tsk);
 static inline void ptrace_put_breakpoints(struct task_struct *tsk) { }
 #endif /* CONFIG_HAVE_HW_BREAKPOINT */
 
-#endif /* __KERNEL */
-
 #endif
index dcd5721e626dbdba0e6e7221979fa4033d482b19..58fdef1252521cff27e6a05bee70fcf3e6eb8923 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-
 #ifndef _LINUX_QUOTA_
 #define _LINUX_QUOTA_
 
-#include <linux/errno.h>
-#include <linux/types.h>
-
-#define __DQUOT_VERSION__      "dquot_6.5.2"
-
-#define MAXQUOTAS 2
-#define USRQUOTA  0            /* element used for user quotas */
-#define GRPQUOTA  1            /* element used for group quotas */
-
-/*
- * Definitions for the default names of the quotas files.
- */
-#define INITQFNAMES { \
-       "user",    /* USRQUOTA */ \
-       "group",   /* GRPQUOTA */ \
-       "undefined", \
-};
-
-/*
- * Command definitions for the 'quotactl' system call.
- * The commands are broken into a main command defined below
- * and a subcommand that is used to convey the type of
- * quota that is being manipulated (see above).
- */
-#define SUBCMDMASK  0x00ff
-#define SUBCMDSHIFT 8
-#define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
-
-#define Q_SYNC     0x800001    /* sync disk copy of a filesystems quotas */
-#define Q_QUOTAON  0x800002    /* turn quotas on */
-#define Q_QUOTAOFF 0x800003    /* turn quotas off */
-#define Q_GETFMT   0x800004    /* get quota format used on given filesystem */
-#define Q_GETINFO  0x800005    /* get information about quota files */
-#define Q_SETINFO  0x800006    /* set information about quota files */
-#define Q_GETQUOTA 0x800007    /* get user quota structure */
-#define Q_SETQUOTA 0x800008    /* set user quota structure */
-
-/* Quota format type IDs */
-#define        QFMT_VFS_OLD 1
-#define        QFMT_VFS_V0 2
-#define QFMT_OCFS2 3
-#define        QFMT_VFS_V1 4
-
-/* Size of block in which space limits are passed through the quota
- * interface */
-#define QIF_DQBLKSIZE_BITS 10
-#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS)
-
-/*
- * Quota structure used for communication with userspace via quotactl
- * Following flags are used to specify which fields are valid
- */
-enum {
-       QIF_BLIMITS_B = 0,
-       QIF_SPACE_B,
-       QIF_ILIMITS_B,
-       QIF_INODES_B,
-       QIF_BTIME_B,
-       QIF_ITIME_B,
-};
-
-#define QIF_BLIMITS    (1 << QIF_BLIMITS_B)
-#define QIF_SPACE      (1 << QIF_SPACE_B)
-#define QIF_ILIMITS    (1 << QIF_ILIMITS_B)
-#define QIF_INODES     (1 << QIF_INODES_B)
-#define QIF_BTIME      (1 << QIF_BTIME_B)
-#define QIF_ITIME      (1 << QIF_ITIME_B)
-#define QIF_LIMITS     (QIF_BLIMITS | QIF_ILIMITS)
-#define QIF_USAGE      (QIF_SPACE | QIF_INODES)
-#define QIF_TIMES      (QIF_BTIME | QIF_ITIME)
-#define QIF_ALL                (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
-
-struct if_dqblk {
-       __u64 dqb_bhardlimit;
-       __u64 dqb_bsoftlimit;
-       __u64 dqb_curspace;
-       __u64 dqb_ihardlimit;
-       __u64 dqb_isoftlimit;
-       __u64 dqb_curinodes;
-       __u64 dqb_btime;
-       __u64 dqb_itime;
-       __u32 dqb_valid;
-};
-
-/*
- * Structure used for setting quota information about file via quotactl
- * Following flags are used to specify which fields are valid
- */
-#define IIF_BGRACE     1
-#define IIF_IGRACE     2
-#define IIF_FLAGS      4
-#define IIF_ALL                (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
-
-struct if_dqinfo {
-       __u64 dqi_bgrace;
-       __u64 dqi_igrace;
-       __u32 dqi_flags;
-       __u32 dqi_valid;
-};
-
-/*
- * Definitions for quota netlink interface
- */
-#define QUOTA_NL_NOWARN 0
-#define QUOTA_NL_IHARDWARN 1           /* Inode hardlimit reached */
-#define QUOTA_NL_ISOFTLONGWARN 2       /* Inode grace time expired */
-#define QUOTA_NL_ISOFTWARN 3           /* Inode softlimit reached */
-#define QUOTA_NL_BHARDWARN 4           /* Block hardlimit reached */
-#define QUOTA_NL_BSOFTLONGWARN 5       /* Block grace time expired */
-#define QUOTA_NL_BSOFTWARN 6           /* Block softlimit reached */
-#define QUOTA_NL_IHARDBELOW 7          /* Usage got below inode hardlimit */
-#define QUOTA_NL_ISOFTBELOW 8          /* Usage got below inode softlimit */
-#define QUOTA_NL_BHARDBELOW 9          /* Usage got below block hardlimit */
-#define QUOTA_NL_BSOFTBELOW 10         /* Usage got below block softlimit */
-
-enum {
-       QUOTA_NL_C_UNSPEC,
-       QUOTA_NL_C_WARNING,
-       __QUOTA_NL_C_MAX,
-};
-#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
-
-enum {
-       QUOTA_NL_A_UNSPEC,
-       QUOTA_NL_A_QTYPE,
-       QUOTA_NL_A_EXCESS_ID,
-       QUOTA_NL_A_WARNING,
-       QUOTA_NL_A_DEV_MAJOR,
-       QUOTA_NL_A_DEV_MINOR,
-       QUOTA_NL_A_CAUSED_ID,
-       __QUOTA_NL_A_MAX,
-};
-#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
-
-
-#ifdef __KERNEL__
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/rwsem.h>
@@ -183,6 +46,7 @@ enum {
 #include <linux/atomic.h>
 #include <linux/uidgid.h>
 #include <linux/projid.h>
+#include <uapi/linux/quota.h>
 
 #undef USRQUOTA
 #undef GRPQUOTA
@@ -543,5 +407,4 @@ struct quota_module_name {
        {QFMT_VFS_V0, "quota_v2"},\
        {0, NULL}}
 
-#endif /* __KERNEL__ */
 #endif /* _QUOTA_ */
index ac621ce886ca13a600a879c0132ef2650113aa15..6330ed47b38b12ab230e4cb03949a75703cf1317 100644 (file)
@@ -3,50 +3,11 @@
  *
  * Include file for the random number generator.
  */
-
 #ifndef _LINUX_RANDOM_H
 #define _LINUX_RANDOM_H
 
-#include <linux/types.h>
-#include <linux/ioctl.h>
-#include <linux/irqnr.h>
-
-/* ioctl()'s for the random number generator */
-
-/* Get the entropy count. */
-#define RNDGETENTCNT   _IOR( 'R', 0x00, int )
-
-/* Add to (or subtract from) the entropy count.  (Superuser only.) */
-#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
-
-/* Get the contents of the entropy pool.  (Superuser only.) */
-#define RNDGETPOOL     _IOR( 'R', 0x02, int [2] )
-
-/* 
- * Write bytes into the entropy pool and add to the entropy count.
- * (Superuser only.)
- */
-#define RNDADDENTROPY  _IOW( 'R', 0x03, int [2] )
+#include <uapi/linux/random.h>
 
-/* Clear entropy count to 0.  (Superuser only.) */
-#define RNDZAPENTCNT   _IO( 'R', 0x04 )
-
-/* Clear the entropy pool and associated counters.  (Superuser only.) */
-#define RNDCLEARPOOL   _IO( 'R', 0x06 )
-
-struct rand_pool_info {
-       int     entropy_count;
-       int     buf_size;
-       __u32   buf[0];
-};
-
-struct rnd_state {
-       __u32 s1, s2, s3;
-};
-
-/* Exported functions */
-
-#ifdef __KERNEL__
 
 extern void add_device_randomness(const void *, unsigned int);
 extern void add_input_randomness(unsigned int type, unsigned int code,
@@ -104,6 +65,4 @@ static inline int arch_get_random_int(unsigned int *v)
 }
 #endif
 
-#endif /* __KERNEL___ */
-
 #endif /* _LINUX_RANDOM_H */
index e0879a70e830e29847cc9ba9b9f4d6851d8e3c4d..23b36304cd881bb77bfb0ca092b0e4346b88d87d 100644 (file)
@@ -1,43 +1,9 @@
 #ifndef _LINUX_REBOOT_H
 #define _LINUX_REBOOT_H
 
-/*
- * Magic values required to use _reboot() system call.
- */
-
-#define        LINUX_REBOOT_MAGIC1     0xfee1dead
-#define        LINUX_REBOOT_MAGIC2     672274793
-#define        LINUX_REBOOT_MAGIC2A    85072278
-#define        LINUX_REBOOT_MAGIC2B    369367448
-#define        LINUX_REBOOT_MAGIC2C    537993216
-
-
-/*
- * Commands accepted by the _reboot() system call.
- *
- * RESTART     Restart system using default command and mode.
- * HALT        Stop OS and give system control to ROM monitor, if any.
- * CAD_ON      Ctrl-Alt-Del sequence causes RESTART command.
- * CAD_OFF     Ctrl-Alt-Del sequence sends SIGINT to init task.
- * POWER_OFF   Stop OS and remove all power from system, if possible.
- * RESTART2    Restart system using given command string.
- * SW_SUSPEND  Suspend system using software suspend if compiled in.
- * KEXEC       Restart system using a previously loaded Linux kernel
- */
-
-#define        LINUX_REBOOT_CMD_RESTART        0x01234567
-#define        LINUX_REBOOT_CMD_HALT           0xCDEF0123
-#define        LINUX_REBOOT_CMD_CAD_ON         0x89ABCDEF
-#define        LINUX_REBOOT_CMD_CAD_OFF        0x00000000
-#define        LINUX_REBOOT_CMD_POWER_OFF      0x4321FEDC
-#define        LINUX_REBOOT_CMD_RESTART2       0xA1B2C3D4
-#define        LINUX_REBOOT_CMD_SW_SUSPEND     0xD000FCE2
-#define        LINUX_REBOOT_CMD_KEXEC          0x45584543
-
-
-#ifdef __KERNEL__
 
 #include <linux/notifier.h>
+#include <uapi/linux/reboot.h>
 
 #define SYS_DOWN       0x0001  /* Notify of system down */
 #define SYS_RESTART    SYS_DOWN
@@ -84,6 +50,4 @@ extern int orderly_poweroff(bool force);
 extern void emergency_restart(void);
 #include <asm/emergency-restart.h>
 
-#endif
-
 #endif /* _LINUX_REBOOT_H */
index d01c96c1966e2724460eeaaef3bdd6c522fc7bda..5bc3116e649c80139fd34b591eea010b264dd5cd 100644 (file)
@@ -1,82 +1,8 @@
 #ifndef _LINUX_RESOURCE_H
 #define _LINUX_RESOURCE_H
 
-#include <linux/time.h>
-#include <linux/types.h>
+#include <uapi/linux/resource.h>
 
-/*
- * Resource control/accounting header file for linux
- */
-
-/*
- * Definition of struct rusage taken from BSD 4.3 Reno
- * 
- * We don't support all of these yet, but we might as well have them....
- * Otherwise, each time we add new items, programs which depend on this
- * structure will lose.  This reduces the chances of that happening.
- */
-#define        RUSAGE_SELF     0
-#define        RUSAGE_CHILDREN (-1)
-#define RUSAGE_BOTH    (-2)            /* sys_wait4() uses this */
-#define        RUSAGE_THREAD   1               /* only the calling thread */
-
-struct rusage {
-       struct timeval ru_utime;        /* user time used */
-       struct timeval ru_stime;        /* system time used */
-       long    ru_maxrss;              /* maximum resident set size */
-       long    ru_ixrss;               /* integral shared memory size */
-       long    ru_idrss;               /* integral unshared data size */
-       long    ru_isrss;               /* integral unshared stack size */
-       long    ru_minflt;              /* page reclaims */
-       long    ru_majflt;              /* page faults */
-       long    ru_nswap;               /* swaps */
-       long    ru_inblock;             /* block input operations */
-       long    ru_oublock;             /* block output operations */
-       long    ru_msgsnd;              /* messages sent */
-       long    ru_msgrcv;              /* messages received */
-       long    ru_nsignals;            /* signals received */
-       long    ru_nvcsw;               /* voluntary context switches */
-       long    ru_nivcsw;              /* involuntary " */
-};
-
-struct rlimit {
-       unsigned long   rlim_cur;
-       unsigned long   rlim_max;
-};
-
-#define RLIM64_INFINITY                (~0ULL)
-
-struct rlimit64 {
-       __u64 rlim_cur;
-       __u64 rlim_max;
-};
-
-#define        PRIO_MIN        (-20)
-#define        PRIO_MAX        20
-
-#define        PRIO_PROCESS    0
-#define        PRIO_PGRP       1
-#define        PRIO_USER       2
-
-/*
- * Limit the stack by to some sane default: root can always
- * increase this limit if needed..  8MB seems reasonable.
- */
-#define _STK_LIM       (8*1024*1024)
-
-/*
- * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
- * and other sensitive information are never written to disk.
- */
-#define MLOCK_LIMIT    ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
-
-/*
- * Due to binary compatibility, the actual resource numbers
- * may be different for different linux versions..
- */
-#include <asm/resource.h>
-
-#ifdef __KERNEL__
 
 struct task_struct;
 
@@ -84,6 +10,4 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
 int do_prlimit(struct task_struct *tsk, unsigned int resource,
                struct rlimit *new_rlim, struct rlimit *old_rlim);
 
-#endif /* __KERNEL__ */
-
 #endif
index 0ec590bb361119ea10825c211f376d902ad294be..d9010789b4e8215cc74a2ffc12e83f3cfd9b73cd 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef __RFKILL_H
-#define __RFKILL_H
-
 /*
  * Copyright (C) 2006 - 2007 Ivo van Doorn
  * Copyright (C) 2007 Dmitry Torokhov
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#ifndef __RFKILL_H
+#define __RFKILL_H
 
-#include <linux/types.h>
-
-/* define userspace visible states */
-#define RFKILL_STATE_SOFT_BLOCKED      0
-#define RFKILL_STATE_UNBLOCKED         1
-#define RFKILL_STATE_HARD_BLOCKED      2
-
-/**
- * enum rfkill_type - type of rfkill switch.
- *
- * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
- * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
- * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
- * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
- * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
- * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
- * @RFKILL_TYPE_GPS: switch is on a GPS device.
- * @RFKILL_TYPE_FM: switch is on a FM radio device.
- * @NUM_RFKILL_TYPES: number of defined rfkill types
- */
-enum rfkill_type {
-       RFKILL_TYPE_ALL = 0,
-       RFKILL_TYPE_WLAN,
-       RFKILL_TYPE_BLUETOOTH,
-       RFKILL_TYPE_UWB,
-       RFKILL_TYPE_WIMAX,
-       RFKILL_TYPE_WWAN,
-       RFKILL_TYPE_GPS,
-       RFKILL_TYPE_FM,
-       NUM_RFKILL_TYPES,
-};
-
-/**
- * enum rfkill_operation - operation types
- * @RFKILL_OP_ADD: a device was added
- * @RFKILL_OP_DEL: a device was removed
- * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
- * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
- */
-enum rfkill_operation {
-       RFKILL_OP_ADD = 0,
-       RFKILL_OP_DEL,
-       RFKILL_OP_CHANGE,
-       RFKILL_OP_CHANGE_ALL,
-};
-
-/**
- * struct rfkill_event - events for userspace on /dev/rfkill
- * @idx: index of dev rfkill
- * @type: type of the rfkill struct
- * @op: operation code
- * @hard: hard state (0/1)
- * @soft: soft state (0/1)
- *
- * Structure used for userspace communication on /dev/rfkill,
- * used for events from the kernel and control to the kernel.
- */
-struct rfkill_event {
-       __u32 idx;
-       __u8  type;
-       __u8  op;
-       __u8  soft, hard;
-} __attribute__((packed));
-
-/*
- * We are planning to be backward and forward compatible with changes
- * to the event struct, by adding new, optional, members at the end.
- * When reading an event (whether the kernel from userspace or vice
- * versa) we need to accept anything that's at least as large as the
- * version 1 event size, but might be able to accept other sizes in
- * the future.
- *
- * One exception is the kernel -- we already have two event sizes in
- * that we've made the 'hard' member optional since our only option
- * is to ignore it anyway.
- */
-#define RFKILL_EVENT_SIZE_V1   8
-
-/* ioctl for turning off rfkill-input (if present) */
-#define RFKILL_IOC_MAGIC       'R'
-#define RFKILL_IOC_NOINPUT     1
-#define RFKILL_IOCTL_NOINPUT   _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
+#include <uapi/linux/rfkill.h>
 
-/* and that's all userspace gets */
-#ifdef __KERNEL__
 /* don't allow anyone to use these in the kernel */
 enum rfkill_user_states {
        RFKILL_USER_STATE_SOFT_BLOCKED  = RFKILL_STATE_SOFT_BLOCKED,
@@ -385,6 +301,4 @@ rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
 }
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* RFKILL_H */
index 20ec4d3bed733d3818f4bb7f899b0322b253372e..9531845c419f8329000b8927a341057bb2a64e6d 100644 (file)
 #ifndef _LINUX_RTC_H_
 #define _LINUX_RTC_H_
 
-/*
- * The struct used to pass data via the following ioctl. Similar to the
- * struct tm in <time.h>, but it needs to be here so that the kernel
- * source is self contained, allowing cross-compiles, etc. etc.
- */
-
-struct rtc_time {
-       int tm_sec;
-       int tm_min;
-       int tm_hour;
-       int tm_mday;
-       int tm_mon;
-       int tm_year;
-       int tm_wday;
-       int tm_yday;
-       int tm_isdst;
-};
-
-/*
- * This data structure is inspired by the EFI (v0.92) wakeup
- * alarm API.
- */
-struct rtc_wkalrm {
-       unsigned char enabled;  /* 0 = alarm disabled, 1 = alarm enabled */
-       unsigned char pending;  /* 0 = alarm not pending, 1 = alarm pending */
-       struct rtc_time time;   /* time the alarm is set to */
-};
-
-/*
- * Data structure to control PLL correction some better RTC feature
- * pll_value is used to get or set current value of correction,
- * the rest of the struct is used to query HW capabilities.
- * This is modeled after the RTC used in Q40/Q60 computers but
- * should be sufficiently flexible for other devices
- *
- * +ve pll_value means clock will run faster by
- *   pll_value*pll_posmult/pll_clock
- * -ve pll_value means clock will run slower by
- *   pll_value*pll_negmult/pll_clock
- */
-
-struct rtc_pll_info {
-       int pll_ctrl;       /* placeholder for fancier control */
-       int pll_value;      /* get/set correction value */
-       int pll_max;        /* max +ve (faster) adjustment value */
-       int pll_min;        /* max -ve (slower) adjustment value */
-       int pll_posmult;    /* factor for +ve correction */
-       int pll_negmult;    /* factor for -ve correction */
-       long pll_clock;     /* base PLL frequency */
-};
-
-/*
- * ioctl calls that are permitted to the /dev/rtc interface, if
- * any of the RTC drivers are enabled.
- */
-
-#define RTC_AIE_ON     _IO('p', 0x01)  /* Alarm int. enable on         */
-#define RTC_AIE_OFF    _IO('p', 0x02)  /* ... off                      */
-#define RTC_UIE_ON     _IO('p', 0x03)  /* Update int. enable on        */
-#define RTC_UIE_OFF    _IO('p', 0x04)  /* ... off                      */
-#define RTC_PIE_ON     _IO('p', 0x05)  /* Periodic int. enable on      */
-#define RTC_PIE_OFF    _IO('p', 0x06)  /* ... off                      */
-#define RTC_WIE_ON     _IO('p', 0x0f)  /* Watchdog int. enable on      */
-#define RTC_WIE_OFF    _IO('p', 0x10)  /* ... off                      */
-
-#define RTC_ALM_SET    _IOW('p', 0x07, struct rtc_time) /* Set alarm time  */
-#define RTC_ALM_READ   _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
-#define RTC_RD_TIME    _IOR('p', 0x09, struct rtc_time) /* Read RTC time   */
-#define RTC_SET_TIME   _IOW('p', 0x0a, struct rtc_time) /* Set RTC time    */
-#define RTC_IRQP_READ  _IOR('p', 0x0b, unsigned long)   /* Read IRQ rate   */
-#define RTC_IRQP_SET   _IOW('p', 0x0c, unsigned long)   /* Set IRQ rate    */
-#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long)   /* Read epoch      */
-#define RTC_EPOCH_SET  _IOW('p', 0x0e, unsigned long)   /* Set epoch       */
-
-#define RTC_WKALM_SET  _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
-#define RTC_WKALM_RD   _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
-
-#define RTC_PLL_GET    _IOR('p', 0x11, struct rtc_pll_info)  /* Get PLL correction */
-#define RTC_PLL_SET    _IOW('p', 0x12, struct rtc_pll_info)  /* Set PLL correction */
-
-#define RTC_VL_READ    _IOR('p', 0x13, int)    /* Voltage low detector */
-#define RTC_VL_CLR     _IO('p', 0x14)          /* Clear voltage low information */
-
-/* interrupt flags */
-#define RTC_IRQF 0x80  /* Any of the following is active */
-#define RTC_PF 0x40    /* Periodic interrupt */
-#define RTC_AF 0x20    /* Alarm interrupt */
-#define RTC_UF 0x10    /* Update interrupt for 1Hz RTC */
-
-
-#define RTC_MAX_FREQ   8192
-
-#ifdef __KERNEL__
 
 #include <linux/types.h>
 #include <linux/interrupt.h>
+#include <uapi/linux/rtc.h>
 
 extern int rtc_month_days(unsigned int month, unsigned int year);
 extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
@@ -282,6 +190,4 @@ extern int rtc_hctosys_ret;
 #define rtc_hctosys_ret -ENODEV
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_RTC_H_ */
index db71c4ad862436ac3bbb04677265bb92024dba7a..7002bbfd5d4a55e76041e146cd268a9d027ed6ed 100644 (file)
 #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
-#include <linux/types.h>
-#include <linux/netlink.h>
-#include <linux/if_link.h>
-#include <linux/if_addr.h>
-#include <linux/neighbour.h>
-
-/* rtnetlink families. Values up to 127 are reserved for real address
- * families, values above 128 may be used arbitrarily.
- */
-#define RTNL_FAMILY_IPMR               128
-#define RTNL_FAMILY_IP6MR              129
-#define RTNL_FAMILY_MAX                        129
-
-/****
- *             Routing/neighbour discovery messages.
- ****/
-
-/* Types of messages */
-
-enum {
-       RTM_BASE        = 16,
-#define RTM_BASE       RTM_BASE
-
-       RTM_NEWLINK     = 16,
-#define RTM_NEWLINK    RTM_NEWLINK
-       RTM_DELLINK,
-#define RTM_DELLINK    RTM_DELLINK
-       RTM_GETLINK,
-#define RTM_GETLINK    RTM_GETLINK
-       RTM_SETLINK,
-#define RTM_SETLINK    RTM_SETLINK
-
-       RTM_NEWADDR     = 20,
-#define RTM_NEWADDR    RTM_NEWADDR
-       RTM_DELADDR,
-#define RTM_DELADDR    RTM_DELADDR
-       RTM_GETADDR,
-#define RTM_GETADDR    RTM_GETADDR
-
-       RTM_NEWROUTE    = 24,
-#define RTM_NEWROUTE   RTM_NEWROUTE
-       RTM_DELROUTE,
-#define RTM_DELROUTE   RTM_DELROUTE
-       RTM_GETROUTE,
-#define RTM_GETROUTE   RTM_GETROUTE
-
-       RTM_NEWNEIGH    = 28,
-#define RTM_NEWNEIGH   RTM_NEWNEIGH
-       RTM_DELNEIGH,
-#define RTM_DELNEIGH   RTM_DELNEIGH
-       RTM_GETNEIGH,
-#define RTM_GETNEIGH   RTM_GETNEIGH
-
-       RTM_NEWRULE     = 32,
-#define RTM_NEWRULE    RTM_NEWRULE
-       RTM_DELRULE,
-#define RTM_DELRULE    RTM_DELRULE
-       RTM_GETRULE,
-#define RTM_GETRULE    RTM_GETRULE
-
-       RTM_NEWQDISC    = 36,
-#define RTM_NEWQDISC   RTM_NEWQDISC
-       RTM_DELQDISC,
-#define RTM_DELQDISC   RTM_DELQDISC
-       RTM_GETQDISC,
-#define RTM_GETQDISC   RTM_GETQDISC
-
-       RTM_NEWTCLASS   = 40,
-#define RTM_NEWTCLASS  RTM_NEWTCLASS
-       RTM_DELTCLASS,
-#define RTM_DELTCLASS  RTM_DELTCLASS
-       RTM_GETTCLASS,
-#define RTM_GETTCLASS  RTM_GETTCLASS
-
-       RTM_NEWTFILTER  = 44,
-#define RTM_NEWTFILTER RTM_NEWTFILTER
-       RTM_DELTFILTER,
-#define RTM_DELTFILTER RTM_DELTFILTER
-       RTM_GETTFILTER,
-#define RTM_GETTFILTER RTM_GETTFILTER
-
-       RTM_NEWACTION   = 48,
-#define RTM_NEWACTION   RTM_NEWACTION
-       RTM_DELACTION,
-#define RTM_DELACTION   RTM_DELACTION
-       RTM_GETACTION,
-#define RTM_GETACTION   RTM_GETACTION
-
-       RTM_NEWPREFIX   = 52,
-#define RTM_NEWPREFIX  RTM_NEWPREFIX
-
-       RTM_GETMULTICAST = 58,
-#define RTM_GETMULTICAST RTM_GETMULTICAST
-
-       RTM_GETANYCAST  = 62,
-#define RTM_GETANYCAST RTM_GETANYCAST
-
-       RTM_NEWNEIGHTBL = 64,
-#define RTM_NEWNEIGHTBL        RTM_NEWNEIGHTBL
-       RTM_GETNEIGHTBL = 66,
-#define RTM_GETNEIGHTBL        RTM_GETNEIGHTBL
-       RTM_SETNEIGHTBL,
-#define RTM_SETNEIGHTBL        RTM_SETNEIGHTBL
-
-       RTM_NEWNDUSEROPT = 68,
-#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
-
-       RTM_NEWADDRLABEL = 72,
-#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
-       RTM_DELADDRLABEL,
-#define RTM_DELADDRLABEL RTM_DELADDRLABEL
-       RTM_GETADDRLABEL,
-#define RTM_GETADDRLABEL RTM_GETADDRLABEL
-
-       RTM_GETDCB = 78,
-#define RTM_GETDCB RTM_GETDCB
-       RTM_SETDCB,
-#define RTM_SETDCB RTM_SETDCB
-
-       __RTM_MAX,
-#define RTM_MAX                (((__RTM_MAX + 3) & ~3) - 1)
-};
-
-#define RTM_NR_MSGTYPES        (RTM_MAX + 1 - RTM_BASE)
-#define RTM_NR_FAMILIES        (RTM_NR_MSGTYPES >> 2)
-#define RTM_FAM(cmd)   (((cmd) - RTM_BASE) >> 2)
-
-/* 
-   Generic structure for encapsulation of optional route information.
-   It is reminiscent of sockaddr, but with sa_family replaced
-   with attribute type.
- */
-
-struct rtattr {
-       unsigned short  rta_len;
-       unsigned short  rta_type;
-};
-
-/* Macros to handle rtattributes */
-
-#define RTA_ALIGNTO    4
-#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
-#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
-                        (rta)->rta_len >= sizeof(struct rtattr) && \
-                        (rta)->rta_len <= (len))
-#define RTA_NEXT(rta,attrlen)  ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
-                                (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
-#define RTA_LENGTH(len)        (RTA_ALIGN(sizeof(struct rtattr)) + (len))
-#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
-#define RTA_DATA(rta)   ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
-#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
-
-
-
-
-/******************************************************************************
- *             Definitions used in routing table administration.
- ****/
-
-struct rtmsg {
-       unsigned char           rtm_family;
-       unsigned char           rtm_dst_len;
-       unsigned char           rtm_src_len;
-       unsigned char           rtm_tos;
-
-       unsigned char           rtm_table;      /* Routing table id */
-       unsigned char           rtm_protocol;   /* Routing protocol; see below  */
-       unsigned char           rtm_scope;      /* See below */ 
-       unsigned char           rtm_type;       /* See below    */
-
-       unsigned                rtm_flags;
-};
-
-/* rtm_type */
-
-enum {
-       RTN_UNSPEC,
-       RTN_UNICAST,            /* Gateway or direct route      */
-       RTN_LOCAL,              /* Accept locally               */
-       RTN_BROADCAST,          /* Accept locally as broadcast,
-                                  send as broadcast */
-       RTN_ANYCAST,            /* Accept locally as broadcast,
-                                  but send as unicast */
-       RTN_MULTICAST,          /* Multicast route              */
-       RTN_BLACKHOLE,          /* Drop                         */
-       RTN_UNREACHABLE,        /* Destination is unreachable   */
-       RTN_PROHIBIT,           /* Administratively prohibited  */
-       RTN_THROW,              /* Not in this table            */
-       RTN_NAT,                /* Translate this address       */
-       RTN_XRESOLVE,           /* Use external resolver        */
-       __RTN_MAX
-};
-
-#define RTN_MAX (__RTN_MAX - 1)
-
-
-/* rtm_protocol */
-
-#define RTPROT_UNSPEC  0
-#define RTPROT_REDIRECT        1       /* Route installed by ICMP redirects;
-                                  not used by current IPv4 */
-#define RTPROT_KERNEL  2       /* Route installed by kernel            */
-#define RTPROT_BOOT    3       /* Route installed during boot          */
-#define RTPROT_STATIC  4       /* Route installed by administrator     */
-
-/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
-   they are just passed from user and back as is.
-   It will be used by hypothetical multiple routing daemons.
-   Note that protocol values should be standardized in order to
-   avoid conflicts.
- */
-
-#define RTPROT_GATED   8       /* Apparently, GateD */
-#define RTPROT_RA      9       /* RDISC/ND router advertisements */
-#define RTPROT_MRT     10      /* Merit MRT */
-#define RTPROT_ZEBRA   11      /* Zebra */
-#define RTPROT_BIRD    12      /* BIRD */
-#define RTPROT_DNROUTED        13      /* DECnet routing daemon */
-#define RTPROT_XORP    14      /* XORP */
-#define RTPROT_NTK     15      /* Netsukuku */
-#define RTPROT_DHCP    16      /* DHCP client */
-
-/* rtm_scope
-
-   Really it is not scope, but sort of distance to the destination.
-   NOWHERE are reserved for not existing destinations, HOST is our
-   local addresses, LINK are destinations, located on directly attached
-   link and UNIVERSE is everywhere in the Universe.
-
-   Intermediate values are also possible f.e. interior routes
-   could be assigned a value between UNIVERSE and LINK.
-*/
-
-enum rt_scope_t {
-       RT_SCOPE_UNIVERSE=0,
-/* User defined values  */
-       RT_SCOPE_SITE=200,
-       RT_SCOPE_LINK=253,
-       RT_SCOPE_HOST=254,
-       RT_SCOPE_NOWHERE=255
-};
-
-/* rtm_flags */
-
-#define RTM_F_NOTIFY           0x100   /* Notify user of route change  */
-#define RTM_F_CLONED           0x200   /* This route is cloned         */
-#define RTM_F_EQUALIZE         0x400   /* Multipath equalizer: NI      */
-#define RTM_F_PREFIX           0x800   /* Prefix addresses             */
-
-/* Reserved table identifiers */
-
-enum rt_class_t {
-       RT_TABLE_UNSPEC=0,
-/* User defined values */
-       RT_TABLE_COMPAT=252,
-       RT_TABLE_DEFAULT=253,
-       RT_TABLE_MAIN=254,
-       RT_TABLE_LOCAL=255,
-       RT_TABLE_MAX=0xFFFFFFFF
-};
-
-
-/* Routing message attributes */
-
-enum rtattr_type_t {
-       RTA_UNSPEC,
-       RTA_DST,
-       RTA_SRC,
-       RTA_IIF,
-       RTA_OIF,
-       RTA_GATEWAY,
-       RTA_PRIORITY,
-       RTA_PREFSRC,
-       RTA_METRICS,
-       RTA_MULTIPATH,
-       RTA_PROTOINFO, /* no longer used */
-       RTA_FLOW,
-       RTA_CACHEINFO,
-       RTA_SESSION, /* no longer used */
-       RTA_MP_ALGO, /* no longer used */
-       RTA_TABLE,
-       RTA_MARK,
-       __RTA_MAX
-};
-
-#define RTA_MAX (__RTA_MAX - 1)
-
-#define RTM_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
-#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
-
-/* RTM_MULTIPATH --- array of struct rtnexthop.
- *
- * "struct rtnexthop" describes all necessary nexthop information,
- * i.e. parameters of path to a destination via this nexthop.
- *
- * At the moment it is impossible to set different prefsrc, mtu, window
- * and rtt for different paths from multipath.
- */
-
-struct rtnexthop {
-       unsigned short          rtnh_len;
-       unsigned char           rtnh_flags;
-       unsigned char           rtnh_hops;
-       int                     rtnh_ifindex;
-};
-
-/* rtnh_flags */
-
-#define RTNH_F_DEAD            1       /* Nexthop is dead (used by multipath)  */
-#define RTNH_F_PERVASIVE       2       /* Do recursive gateway lookup  */
-#define RTNH_F_ONLINK          4       /* Gateway is forced on link    */
-
-/* Macros to handle hexthops */
-
-#define RTNH_ALIGNTO   4
-#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
-#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
-                          ((int)(rtnh)->rtnh_len) <= (len))
-#define RTNH_NEXT(rtnh)        ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
-#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
-#define RTNH_SPACE(len)        RTNH_ALIGN(RTNH_LENGTH(len))
-#define RTNH_DATA(rtnh)   ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
-
-/* RTM_CACHEINFO */
-
-struct rta_cacheinfo {
-       __u32   rta_clntref;
-       __u32   rta_lastuse;
-       __s32   rta_expires;
-       __u32   rta_error;
-       __u32   rta_used;
-
-#define RTNETLINK_HAVE_PEERINFO 1
-       __u32   rta_id;
-       __u32   rta_ts;
-       __u32   rta_tsage;
-};
-
-/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
-
-enum {
-       RTAX_UNSPEC,
-#define RTAX_UNSPEC RTAX_UNSPEC
-       RTAX_LOCK,
-#define RTAX_LOCK RTAX_LOCK
-       RTAX_MTU,
-#define RTAX_MTU RTAX_MTU
-       RTAX_WINDOW,
-#define RTAX_WINDOW RTAX_WINDOW
-       RTAX_RTT,
-#define RTAX_RTT RTAX_RTT
-       RTAX_RTTVAR,
-#define RTAX_RTTVAR RTAX_RTTVAR
-       RTAX_SSTHRESH,
-#define RTAX_SSTHRESH RTAX_SSTHRESH
-       RTAX_CWND,
-#define RTAX_CWND RTAX_CWND
-       RTAX_ADVMSS,
-#define RTAX_ADVMSS RTAX_ADVMSS
-       RTAX_REORDERING,
-#define RTAX_REORDERING RTAX_REORDERING
-       RTAX_HOPLIMIT,
-#define RTAX_HOPLIMIT RTAX_HOPLIMIT
-       RTAX_INITCWND,
-#define RTAX_INITCWND RTAX_INITCWND
-       RTAX_FEATURES,
-#define RTAX_FEATURES RTAX_FEATURES
-       RTAX_RTO_MIN,
-#define RTAX_RTO_MIN RTAX_RTO_MIN
-       RTAX_INITRWND,
-#define RTAX_INITRWND RTAX_INITRWND
-       __RTAX_MAX
-};
-
-#define RTAX_MAX (__RTAX_MAX - 1)
-
-#define RTAX_FEATURE_ECN       0x00000001
-#define RTAX_FEATURE_SACK      0x00000002
-#define RTAX_FEATURE_TIMESTAMP 0x00000004
-#define RTAX_FEATURE_ALLFRAG   0x00000008
-
-struct rta_session {
-       __u8    proto;
-       __u8    pad1;
-       __u16   pad2;
-
-       union {
-               struct {
-                       __u16   sport;
-                       __u16   dport;
-               } ports;
-
-               struct {
-                       __u8    type;
-                       __u8    code;
-                       __u16   ident;
-               } icmpt;
-
-               __u32           spi;
-       } u;
-};
-
-/****
- *             General form of address family dependent message.
- ****/
-
-struct rtgenmsg {
-       unsigned char           rtgen_family;
-};
-
-/*****************************************************************
- *             Link layer specific messages.
- ****/
-
-/* struct ifinfomsg
- * passes link level specific information, not dependent
- * on network protocol.
- */
-
-struct ifinfomsg {
-       unsigned char   ifi_family;
-       unsigned char   __ifi_pad;
-       unsigned short  ifi_type;               /* ARPHRD_* */
-       int             ifi_index;              /* Link index   */
-       unsigned        ifi_flags;              /* IFF_* flags  */
-       unsigned        ifi_change;             /* IFF_* change mask */
-};
-
-/********************************************************************
- *             prefix information 
- ****/
-
-struct prefixmsg {
-       unsigned char   prefix_family;
-       unsigned char   prefix_pad1;
-       unsigned short  prefix_pad2;
-       int             prefix_ifindex;
-       unsigned char   prefix_type;
-       unsigned char   prefix_len;
-       unsigned char   prefix_flags;
-       unsigned char   prefix_pad3;
-};
-
-enum 
-{
-       PREFIX_UNSPEC,
-       PREFIX_ADDRESS,
-       PREFIX_CACHEINFO,
-       __PREFIX_MAX
-};
-
-#define PREFIX_MAX     (__PREFIX_MAX - 1)
-
-struct prefix_cacheinfo {
-       __u32   preferred_time;
-       __u32   valid_time;
-};
-
-
-/*****************************************************************
- *             Traffic control messages.
- ****/
-
-struct tcmsg {
-       unsigned char   tcm_family;
-       unsigned char   tcm__pad1;
-       unsigned short  tcm__pad2;
-       int             tcm_ifindex;
-       __u32           tcm_handle;
-       __u32           tcm_parent;
-       __u32           tcm_info;
-};
-
-enum {
-       TCA_UNSPEC,
-       TCA_KIND,
-       TCA_OPTIONS,
-       TCA_STATS,
-       TCA_XSTATS,
-       TCA_RATE,
-       TCA_FCNT,
-       TCA_STATS2,
-       TCA_STAB,
-       __TCA_MAX
-};
-
-#define TCA_MAX (__TCA_MAX - 1)
-
-#define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
-#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
-
-/********************************************************************
- *             Neighbor Discovery userland options
- ****/
-
-struct nduseroptmsg {
-       unsigned char   nduseropt_family;
-       unsigned char   nduseropt_pad1;
-       unsigned short  nduseropt_opts_len;     /* Total length of options */
-       int             nduseropt_ifindex;
-       __u8            nduseropt_icmp_type;
-       __u8            nduseropt_icmp_code;
-       unsigned short  nduseropt_pad2;
-       unsigned int    nduseropt_pad3;
-       /* Followed by one or more ND options */
-};
-
-enum {
-       NDUSEROPT_UNSPEC,
-       NDUSEROPT_SRCADDR,
-       __NDUSEROPT_MAX
-};
-
-#define NDUSEROPT_MAX  (__NDUSEROPT_MAX - 1)
-
-#ifndef __KERNEL__
-/* RTnetlink multicast groups - backwards compatibility for userspace */
-#define RTMGRP_LINK            1
-#define RTMGRP_NOTIFY          2
-#define RTMGRP_NEIGH           4
-#define RTMGRP_TC              8
-
-#define RTMGRP_IPV4_IFADDR     0x10
-#define RTMGRP_IPV4_MROUTE     0x20
-#define RTMGRP_IPV4_ROUTE      0x40
-#define RTMGRP_IPV4_RULE       0x80
-
-#define RTMGRP_IPV6_IFADDR     0x100
-#define RTMGRP_IPV6_MROUTE     0x200
-#define RTMGRP_IPV6_ROUTE      0x400
-#define RTMGRP_IPV6_IFINFO     0x800
-
-#define RTMGRP_DECnet_IFADDR    0x1000
-#define RTMGRP_DECnet_ROUTE     0x4000
-
-#define RTMGRP_IPV6_PREFIX     0x20000
-#endif
-
-/* RTnetlink multicast groups */
-enum rtnetlink_groups {
-       RTNLGRP_NONE,
-#define RTNLGRP_NONE           RTNLGRP_NONE
-       RTNLGRP_LINK,
-#define RTNLGRP_LINK           RTNLGRP_LINK
-       RTNLGRP_NOTIFY,
-#define RTNLGRP_NOTIFY         RTNLGRP_NOTIFY
-       RTNLGRP_NEIGH,
-#define RTNLGRP_NEIGH          RTNLGRP_NEIGH
-       RTNLGRP_TC,
-#define RTNLGRP_TC             RTNLGRP_TC
-       RTNLGRP_IPV4_IFADDR,
-#define RTNLGRP_IPV4_IFADDR    RTNLGRP_IPV4_IFADDR
-       RTNLGRP_IPV4_MROUTE,
-#define        RTNLGRP_IPV4_MROUTE     RTNLGRP_IPV4_MROUTE
-       RTNLGRP_IPV4_ROUTE,
-#define RTNLGRP_IPV4_ROUTE     RTNLGRP_IPV4_ROUTE
-       RTNLGRP_IPV4_RULE,
-#define RTNLGRP_IPV4_RULE      RTNLGRP_IPV4_RULE
-       RTNLGRP_IPV6_IFADDR,
-#define RTNLGRP_IPV6_IFADDR    RTNLGRP_IPV6_IFADDR
-       RTNLGRP_IPV6_MROUTE,
-#define RTNLGRP_IPV6_MROUTE    RTNLGRP_IPV6_MROUTE
-       RTNLGRP_IPV6_ROUTE,
-#define RTNLGRP_IPV6_ROUTE     RTNLGRP_IPV6_ROUTE
-       RTNLGRP_IPV6_IFINFO,
-#define RTNLGRP_IPV6_IFINFO    RTNLGRP_IPV6_IFINFO
-       RTNLGRP_DECnet_IFADDR,
-#define RTNLGRP_DECnet_IFADDR  RTNLGRP_DECnet_IFADDR
-       RTNLGRP_NOP2,
-       RTNLGRP_DECnet_ROUTE,
-#define RTNLGRP_DECnet_ROUTE   RTNLGRP_DECnet_ROUTE
-       RTNLGRP_DECnet_RULE,
-#define RTNLGRP_DECnet_RULE    RTNLGRP_DECnet_RULE
-       RTNLGRP_NOP4,
-       RTNLGRP_IPV6_PREFIX,
-#define RTNLGRP_IPV6_PREFIX    RTNLGRP_IPV6_PREFIX
-       RTNLGRP_IPV6_RULE,
-#define RTNLGRP_IPV6_RULE      RTNLGRP_IPV6_RULE
-       RTNLGRP_ND_USEROPT,
-#define RTNLGRP_ND_USEROPT     RTNLGRP_ND_USEROPT
-       RTNLGRP_PHONET_IFADDR,
-#define RTNLGRP_PHONET_IFADDR  RTNLGRP_PHONET_IFADDR
-       RTNLGRP_PHONET_ROUTE,
-#define RTNLGRP_PHONET_ROUTE   RTNLGRP_PHONET_ROUTE
-       RTNLGRP_DCB,
-#define RTNLGRP_DCB            RTNLGRP_DCB
-       __RTNLGRP_MAX
-};
-#define RTNLGRP_MAX    (__RTNLGRP_MAX - 1)
-
-/* TC action piece */
-struct tcamsg {
-       unsigned char   tca_family;
-       unsigned char   tca__pad1;
-       unsigned short  tca__pad2;
-};
-#define TA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
-#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
-#define TCA_ACT_TAB 1 /* attr type must be >=1 */      
-#define TCAA_MAX 1
-
-/* New extended info filters for IFLA_EXT_MASK */
-#define RTEXT_FILTER_VF                (1 << 0)
-
-/* End of information exported to user level */
-
-#ifdef __KERNEL__
 
 #include <linux/mutex.h>
 #include <linux/netdevice.h>
+#include <uapi/linux/rtnetlink.h>
 
 extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
 extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
@@ -675,7 +69,4 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
                             struct netlink_callback *cb,
                             struct net_device *dev,
                             int idx);
-#endif /* __KERNEL__ */
-
-
 #endif /* __LINUX_RTNETLINK_H */
index 3495bd953cc6bfef1c64a7cebb88fa4e9cc2fe3a..c5a004962679b6025b177d3b56176406617d8781 100644 (file)
@@ -1,175 +1,9 @@
 /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
-
 #ifndef        _SCC_H
 #define        _SCC_H
 
+#include <uapi/linux/scc.h>
 
-/* selection of hardware types */
-
-#define PA0HZP         0x00    /* hardware type for PA0HZP SCC card and compatible */
-#define EAGLE          0x01    /* hardware type for EAGLE card */
-#define PC100          0x02    /* hardware type for PC100 card */
-#define PRIMUS         0x04    /* hardware type for PRIMUS-PC (DG9BL) card */
-#define DRSI           0x08    /* hardware type for DRSI PC*Packet card */
-#define BAYCOM         0x10    /* hardware type for BayCom (U)SCC */
-
-/* DEV ioctl() commands */
-
-enum SCC_ioctl_cmds {
-       SIOCSCCRESERVED = SIOCDEVPRIVATE,
-       SIOCSCCCFG,
-       SIOCSCCINI,
-       SIOCSCCCHANINI,
-       SIOCSCCSMEM,
-       SIOCSCCGKISS,
-       SIOCSCCSKISS,
-       SIOCSCCGSTAT,
-       SIOCSCCCAL
-};
-
-/* Device parameter control (from WAMPES) */
-
-enum L1_params {
-       PARAM_DATA,
-       PARAM_TXDELAY,
-       PARAM_PERSIST,
-       PARAM_SLOTTIME,
-       PARAM_TXTAIL,
-       PARAM_FULLDUP,
-       PARAM_SOFTDCD,          /* was: PARAM_HW */
-       PARAM_MUTE,             /* ??? */
-       PARAM_DTR,
-       PARAM_RTS,
-       PARAM_SPEED,
-       PARAM_ENDDELAY,         /* ??? */
-       PARAM_GROUP,
-       PARAM_IDLE,
-       PARAM_MIN,
-       PARAM_MAXKEY,
-       PARAM_WAIT,
-       PARAM_MAXDEFER,
-       PARAM_TX,
-       PARAM_HWEVENT = 31,
-       PARAM_RETURN = 255      /* reset kiss mode */
-};
-
-/* fulldup parameter */
-
-enum FULLDUP_modes {
-       KISS_DUPLEX_HALF,       /* normal CSMA operation */
-       KISS_DUPLEX_FULL,       /* fullduplex, key down trx after transmission */
-       KISS_DUPLEX_LINK,       /* fullduplex, key down trx after 'idletime' sec */
-       KISS_DUPLEX_OPTIMA      /* fullduplex, let the protocol layer control the hw */
-};
-
-/* misc. parameters */
-
-#define TIMER_OFF      65535U  /* to switch off timers */
-#define NO_SUCH_PARAM  65534U  /* param not implemented */
-
-/* HWEVENT parameter */
-
-enum HWEVENT_opts {
-       HWEV_DCD_ON,
-       HWEV_DCD_OFF,
-       HWEV_ALL_SENT
-};
-
-/* channel grouping */
-
-#define RXGROUP                0100    /* if set, only tx when all channels clear */
-#define TXGROUP                0200    /* if set, don't transmit simultaneously */
-
-/* Tx/Rx clock sources */
-
-enum CLOCK_sources {
-       CLK_DPLL,       /* normal halfduplex operation */
-       CLK_EXTERNAL,   /* external clocking (G3RUH/DF9IC modems) */
-       CLK_DIVIDER,    /* Rx = DPLL, Tx = divider (fullduplex with */
-                       /* modems without clock regeneration */
-       CLK_BRG         /* experimental fullduplex mode with DPLL/BRG for */
-                       /* MODEMs without clock recovery */
-};
-
-/* Tx state */
-
-enum TX_state {
-       TXS_IDLE,       /* Transmitter off, no data pending */
-       TXS_BUSY,       /* waiting for permission to send / tailtime */
-       TXS_ACTIVE,     /* Transmitter on, sending data */
-       TXS_NEWFRAME,   /* reset CRC and send (next) frame */
-       TXS_IDLE2,      /* Transmitter on, no data pending */
-       TXS_WAIT,       /* Waiting for Mintime to expire */
-       TXS_TIMEOUT     /* We had a transmission timeout */
-};
-
-typedef unsigned long io_port; /* type definition for an 'io port address' */
-
-/* SCC statistical information */
-
-struct scc_stat {
-        long rxints;            /* Receiver interrupts */
-        long txints;            /* Transmitter interrupts */
-        long exints;            /* External/status interrupts */
-        long spints;            /* Special receiver interrupts */
-
-        long txframes;          /* Packets sent */
-        long rxframes;          /* Number of Frames Actually Received */
-        long rxerrs;            /* CRC Errors */
-        long txerrs;           /* KISS errors */
-        
-       unsigned int nospace;   /* "Out of buffers" */
-       unsigned int rx_over;   /* Receiver Overruns */
-       unsigned int tx_under;  /* Transmitter Underruns */
-
-       unsigned int tx_state;  /* Transmitter state */
-       int tx_queued;          /* tx frames enqueued */
-
-       unsigned int maxqueue;  /* allocated tx_buffers */
-       unsigned int bufsize;   /* used buffersize */
-};
-
-struct scc_modem {
-       long speed;             /* Line speed, bps */
-       char clocksrc;          /* 0 = DPLL, 1 = external, 2 = divider */
-       char nrz;               /* NRZ instead of NRZI */       
-};
-
-struct scc_kiss_cmd {
-       int      command;       /* one of the KISS-Commands defined above */
-       unsigned param;         /* KISS-Param */
-};
-
-struct scc_hw_config {
-       io_port data_a;         /* data port channel A */
-       io_port ctrl_a;         /* control port channel A */
-       io_port data_b;         /* data port channel B */
-       io_port ctrl_b;         /* control port channel B */
-       io_port vector_latch;   /* INTACK-Latch (#) */
-       io_port special;        /* special function port */
-
-       int     irq;            /* irq */
-       long    clock;          /* clock */
-       char    option;         /* command for function port */
-
-       char brand;             /* hardware type */
-       char escc;              /* use ext. features of a 8580/85180/85280 */
-};
-
-/* (#) only one INTACK latch allowed. */
-
-
-struct scc_mem_config {
-       unsigned int dummy;
-       unsigned int bufsize;
-};
-
-struct scc_calibrate {
-       unsigned int time;
-       unsigned char pattern;
-};
-
-#ifdef __KERNEL__
 
 enum {TX_OFF, TX_ON};  /* command for scc_key_trx() */
 
@@ -248,5 +82,4 @@ struct scc_channel {
        spinlock_t      lock;           /* Channel guard lock */
 };
 
-#endif /* defined(__KERNEL__) */
 #endif /* defined(_SCC_H) */
index a83ca5816ecbc1e2f41a958c3f6830a50f8931b9..0dd42a02df2e851e0847df640dd559f3689c36ed 100644 (file)
@@ -1,48 +1,8 @@
 #ifndef _LINUX_SCHED_H
 #define _LINUX_SCHED_H
 
-/*
- * cloning flags:
- */
-#define CSIGNAL                0x000000ff      /* signal mask to be sent at exit */
-#define CLONE_VM       0x00000100      /* set if VM shared between processes */
-#define CLONE_FS       0x00000200      /* set if fs info shared between processes */
-#define CLONE_FILES    0x00000400      /* set if open files shared between processes */
-#define CLONE_SIGHAND  0x00000800      /* set if signal handlers and blocked signals shared */
-#define CLONE_PTRACE   0x00002000      /* set if we want to let tracing continue on the child too */
-#define CLONE_VFORK    0x00004000      /* set if the parent wants the child to wake it up on mm_release */
-#define CLONE_PARENT   0x00008000      /* set if we want to have the same parent as the cloner */
-#define CLONE_THREAD   0x00010000      /* Same thread group? */
-#define CLONE_NEWNS    0x00020000      /* New namespace group? */
-#define CLONE_SYSVSEM  0x00040000      /* share system V SEM_UNDO semantics */
-#define CLONE_SETTLS   0x00080000      /* create a new TLS for the child */
-#define CLONE_PARENT_SETTID    0x00100000      /* set the TID in the parent */
-#define CLONE_CHILD_CLEARTID   0x00200000      /* clear the TID in the child */
-#define CLONE_DETACHED         0x00400000      /* Unused, ignored */
-#define CLONE_UNTRACED         0x00800000      /* set if the tracing process can't force CLONE_PTRACE on this clone */
-#define CLONE_CHILD_SETTID     0x01000000      /* set the TID in the child */
-/* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state)
-   and is now available for re-use. */
-#define CLONE_NEWUTS           0x04000000      /* New utsname group? */
-#define CLONE_NEWIPC           0x08000000      /* New ipcs */
-#define CLONE_NEWUSER          0x10000000      /* New user namespace */
-#define CLONE_NEWPID           0x20000000      /* New pid namespace */
-#define CLONE_NEWNET           0x40000000      /* New network namespace */
-#define CLONE_IO               0x80000000      /* Clone io context */
-
-/*
- * Scheduling policies
- */
-#define SCHED_NORMAL           0
-#define SCHED_FIFO             1
-#define SCHED_RR               2
-#define SCHED_BATCH            3
-/* SCHED_ISO: reserved but not implemented yet */
-#define SCHED_IDLE             5
-/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
-#define SCHED_RESET_ON_FORK     0x40000000
+#include <uapi/linux/sched.h>
 
-#ifdef __KERNEL__
 
 struct sched_param {
        int sched_priority;
@@ -2828,6 +2788,4 @@ static inline unsigned long rlimit_max(unsigned int limit)
        return task_rlimit_max(current, limit);
 }
 
-#endif /* __KERNEL__ */
-
 #endif
index fb3c5a8fef3db5712fccfda96b9e44b9112da1d5..005bf3e38db555a879f9bd0c0f9b4a8ba0f4616d 100644 (file)
@@ -1,76 +1,8 @@
 #ifndef _SCREEN_INFO_H
 #define _SCREEN_INFO_H
 
-#include <linux/types.h>
+#include <uapi/linux/screen_info.h>
 
-/*
- * These are set up by the setup-routine at boot-time:
- */
-
-struct screen_info {
-       __u8  orig_x;           /* 0x00 */
-       __u8  orig_y;           /* 0x01 */
-       __u16 ext_mem_k;        /* 0x02 */
-       __u16 orig_video_page;  /* 0x04 */
-       __u8  orig_video_mode;  /* 0x06 */
-       __u8  orig_video_cols;  /* 0x07 */
-       __u8  flags;            /* 0x08 */
-       __u8  unused2;          /* 0x09 */
-       __u16 orig_video_ega_bx;/* 0x0a */
-       __u16 unused3;          /* 0x0c */
-       __u8  orig_video_lines; /* 0x0e */
-       __u8  orig_video_isVGA; /* 0x0f */
-       __u16 orig_video_points;/* 0x10 */
-
-       /* VESA graphic mode -- linear frame buffer */
-       __u16 lfb_width;        /* 0x12 */
-       __u16 lfb_height;       /* 0x14 */
-       __u16 lfb_depth;        /* 0x16 */
-       __u32 lfb_base;         /* 0x18 */
-       __u32 lfb_size;         /* 0x1c */
-       __u16 cl_magic, cl_offset; /* 0x20 */
-       __u16 lfb_linelength;   /* 0x24 */
-       __u8  red_size;         /* 0x26 */
-       __u8  red_pos;          /* 0x27 */
-       __u8  green_size;       /* 0x28 */
-       __u8  green_pos;        /* 0x29 */
-       __u8  blue_size;        /* 0x2a */
-       __u8  blue_pos;         /* 0x2b */
-       __u8  rsvd_size;        /* 0x2c */
-       __u8  rsvd_pos;         /* 0x2d */
-       __u16 vesapm_seg;       /* 0x2e */
-       __u16 vesapm_off;       /* 0x30 */
-       __u16 pages;            /* 0x32 */
-       __u16 vesa_attributes;  /* 0x34 */
-       __u32 capabilities;     /* 0x36 */
-       __u8  _reserved[6];     /* 0x3a */
-} __attribute__((packed));
-
-#define VIDEO_TYPE_MDA         0x10    /* Monochrome Text Display      */
-#define VIDEO_TYPE_CGA         0x11    /* CGA Display                  */
-#define VIDEO_TYPE_EGAM                0x20    /* EGA/VGA in Monochrome Mode   */
-#define VIDEO_TYPE_EGAC                0x21    /* EGA in Color Mode            */
-#define VIDEO_TYPE_VGAC                0x22    /* VGA+ in Color Mode           */
-#define VIDEO_TYPE_VLFB                0x23    /* VESA VGA in graphic mode     */
-
-#define VIDEO_TYPE_PICA_S3     0x30    /* ACER PICA-61 local S3 video  */
-#define VIDEO_TYPE_MIPS_G364   0x31    /* MIPS Magnum 4000 G364 video  */
-#define VIDEO_TYPE_SGI          0x33    /* Various SGI graphics hardware */
-
-#define VIDEO_TYPE_TGAC                0x40    /* DEC TGA */
-
-#define VIDEO_TYPE_SUN          0x50    /* Sun frame buffer. */
-#define VIDEO_TYPE_SUNPCI       0x51    /* Sun PCI based frame buffer. */
-
-#define VIDEO_TYPE_PMAC                0x60    /* PowerMacintosh frame buffer. */
-
-#define VIDEO_TYPE_EFI         0x70    /* EFI graphic mode             */
-
-#define VIDEO_FLAGS_NOCURSOR   (1 << 0) /* The video mode has no cursor set */
-
-#define VIDEO_CAPABILITY_SKIP_QUIRKS   (1 << 0)
-
-#ifdef __KERNEL__
 extern struct screen_info screen_info;
 
 #define ORIG_X                 (screen_info.orig_x)
@@ -81,6 +13,4 @@ extern struct screen_info screen_info;
 #define ORIG_VIDEO_LINES       (screen_info.orig_video_lines)
 #define ORIG_VIDEO_ISVGA       (screen_info.orig_video_isVGA)
 #define ORIG_VIDEO_POINTS       (screen_info.orig_video_points)
-#endif /* __KERNEL__ */
-
 #endif /* _SCREEN_INFO_H */
index 9995c7fc3f60ce08e2b7474fc6cd955ce736e7a5..fe7a967d7de42fae0610e57b4485bb5dba6d2034 100644 (file)
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
-
 #ifndef SDLA_H
 #define SDLA_H
 
-/* adapter type */
-#define SDLA_TYPES
-#define SDLA_S502A                     5020
-#define SDLA_S502E                     5021
-#define SDLA_S503                      5030
-#define SDLA_S507                      5070
-#define SDLA_S508                      5080
-#define SDLA_S509                      5090
-#define SDLA_UNKNOWN                   -1
-
-/* port selection flags for the S508 */
-#define SDLA_S508_PORT_V35             0x00
-#define SDLA_S508_PORT_RS232           0x02
-
-/* Z80 CPU speeds */
-#define SDLA_CPU_3M                    0x00
-#define SDLA_CPU_5M                    0x01
-#define SDLA_CPU_7M                    0x02
-#define SDLA_CPU_8M                    0x03
-#define SDLA_CPU_10M                   0x04
-#define SDLA_CPU_16M                   0x05
-#define SDLA_CPU_12M                   0x06
-
-/* some private IOCTLs */
-#define SDLA_IDENTIFY                  (FRAD_LAST_IOCTL + 1)
-#define SDLA_CPUSPEED                  (FRAD_LAST_IOCTL + 2)
-#define SDLA_PROTOCOL                  (FRAD_LAST_IOCTL + 3)
-
-#define SDLA_CLEARMEM                  (FRAD_LAST_IOCTL + 4)
-#define SDLA_WRITEMEM                  (FRAD_LAST_IOCTL + 5)
-#define SDLA_READMEM                   (FRAD_LAST_IOCTL + 6)
-
-struct sdla_mem {
-   int  addr;
-   int  len;
-   void __user *data;
-};
-
-#define SDLA_START                     (FRAD_LAST_IOCTL + 7)
-#define SDLA_STOP                      (FRAD_LAST_IOCTL + 8)
+#include <uapi/linux/sdla.h>
 
-/* some offsets in the Z80's memory space */
-#define SDLA_NMIADDR                   0x0000
-#define SDLA_CONF_ADDR                 0x0010
-#define SDLA_S502A_NMIADDR             0x0066
-#define SDLA_CODE_BASEADDR             0x0100
-#define SDLA_WINDOW_SIZE               0x2000
-#define SDLA_ADDR_MASK                 0x1FFF
-
-/* largest handleable block of data */
-#define SDLA_MAX_DATA                  4080
-#define SDLA_MAX_MTU                   4072    /* MAX_DATA - sizeof(fradhdr) */
-#define SDLA_MAX_DLCI                  24
-
-/* this should be the same as frad_conf */
-struct sdla_conf {
-   short station;
-   short config;
-   short kbaud;
-   short clocking;
-   short max_frm;
-   short T391;
-   short T392;
-   short N391;
-   short N392;
-   short N393;
-   short CIR_fwd;
-   short Bc_fwd;
-   short Be_fwd;
-   short CIR_bwd;
-   short Bc_bwd;
-   short Be_bwd;
-};
-
-/* this should be the same as dlci_conf */
-struct sdla_dlci_conf {
-   short config;
-   short CIR_fwd;
-   short Bc_fwd;
-   short Be_fwd;
-   short CIR_bwd;
-   short Bc_bwd;
-   short Be_bwd; 
-   short Tc_fwd;
-   short Tc_bwd;
-   short Tf_max;
-   short Tb_max;
-};
-
-#ifdef __KERNEL__
 
 /* important Z80 window addresses */
 #define SDLA_CONTROL_WND               0xE000
@@ -331,5 +242,3 @@ struct buf_entry {
 } __attribute__((packed));
 
 #endif
-
-#endif
index 84f6320da50f0a9fe03f30154b9137f9b42dfc74..6f19cfd1840e4adea37b84dea76175361d3187bc 100644 (file)
@@ -1,50 +1,8 @@
 #ifndef _LINUX_SECCOMP_H
 #define _LINUX_SECCOMP_H
 
-#include <linux/compiler.h>
-#include <linux/types.h>
+#include <uapi/linux/seccomp.h>
 
-
-/* Valid values for seccomp.mode and prctl(PR_SET_SECCOMP, <mode>) */
-#define SECCOMP_MODE_DISABLED  0 /* seccomp is not in use. */
-#define SECCOMP_MODE_STRICT    1 /* uses hard-coded filter. */
-#define SECCOMP_MODE_FILTER    2 /* uses user-supplied filter. */
-
-/*
- * All BPF programs must return a 32-bit value.
- * The bottom 16-bits are for optional return data.
- * The upper 16-bits are ordered from least permissive values to most.
- *
- * The ordering ensures that a min_t() over composed return values always
- * selects the least permissive choice.
- */
-#define SECCOMP_RET_KILL       0x00000000U /* kill the task immediately */
-#define SECCOMP_RET_TRAP       0x00030000U /* disallow and force a SIGSYS */
-#define SECCOMP_RET_ERRNO      0x00050000U /* returns an errno */
-#define SECCOMP_RET_TRACE      0x7ff00000U /* pass to a tracer or disallow */
-#define SECCOMP_RET_ALLOW      0x7fff0000U /* allow */
-
-/* Masks for the return value sections. */
-#define SECCOMP_RET_ACTION     0x7fff0000U
-#define SECCOMP_RET_DATA       0x0000ffffU
-
-/**
- * struct seccomp_data - the format the BPF program executes over.
- * @nr: the system call number
- * @arch: indicates system call convention as an AUDIT_ARCH_* value
- *        as defined in <linux/audit.h>.
- * @instruction_pointer: at the time of the system call.
- * @args: up to 6 system call arguments always stored as 64-bit values
- *        regardless of the architecture.
- */
-struct seccomp_data {
-       int nr;
-       __u32 arch;
-       __u64 instruction_pointer;
-       __u64 args[6];
-};
-
-#ifdef __KERNEL__
 #ifdef CONFIG_SECCOMP
 
 #include <linux/thread_info.h>
@@ -129,5 +87,4 @@ static inline void get_seccomp_filter(struct task_struct *tsk)
        return;
 }
 #endif /* CONFIG_SECCOMP_FILTER */
-#endif /* __KERNEL__ */
 #endif /* _LINUX_SECCOMP_H */
index 33406174cbe8429d8be9531c029993891059958b..da1b33b33af7f45f6642a3d21e40b9094265c1b3 100644 (file)
@@ -1,54 +1,7 @@
 #ifndef _LINUX_SECUREBITS_H
 #define _LINUX_SECUREBITS_H 1
 
-/* Each securesetting is implemented using two bits. One bit specifies
-   whether the setting is on or off. The other bit specify whether the
-   setting is locked or not. A setting which is locked cannot be
-   changed from user-level. */
-#define issecure_mask(X)       (1 << (X))
-#ifdef __KERNEL__
-#define issecure(X)            (issecure_mask(X) & current_cred_xxx(securebits))
-#endif
-
-#define SECUREBITS_DEFAULT 0x00000000
-
-/* When set UID 0 has no special privileges. When unset, we support
-   inheritance of root-permissions and suid-root executable under
-   compatibility mode. We raise the effective and inheritable bitmasks
-   *of the executable file* if the effective uid of the new process is
-   0. If the real uid is 0, we raise the effective (legacy) bit of the
-   executable file. */
-#define SECURE_NOROOT                  0
-#define SECURE_NOROOT_LOCKED           1  /* make bit-0 immutable */
-
-#define SECBIT_NOROOT          (issecure_mask(SECURE_NOROOT))
-#define SECBIT_NOROOT_LOCKED   (issecure_mask(SECURE_NOROOT_LOCKED))
-
-/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
-   When unset, to provide compatiblility with old programs relying on
-   set*uid to gain/lose privilege, transitions to/from uid 0 cause
-   capabilities to be gained/lost. */
-#define SECURE_NO_SETUID_FIXUP         2
-#define SECURE_NO_SETUID_FIXUP_LOCKED  3  /* make bit-2 immutable */
-
-#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
-#define SECBIT_NO_SETUID_FIXUP_LOCKED \
-                       (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
-
-/* When set, a process can retain its capabilities even after
-   transitioning to a non-root user (the set-uid fixup suppressed by
-   bit 2). Bit-4 is cleared when a process calls exec(); setting both
-   bit 4 and 5 will create a barrier through exec that no exec()'d
-   child can use this feature again. */
-#define SECURE_KEEP_CAPS               4
-#define SECURE_KEEP_CAPS_LOCKED                5  /* make bit-4 immutable */
-
-#define SECBIT_KEEP_CAPS       (issecure_mask(SECURE_KEEP_CAPS))
-#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
-
-#define SECURE_ALL_BITS                (issecure_mask(SECURE_NOROOT) | \
-                                issecure_mask(SECURE_NO_SETUID_FIXUP) | \
-                                issecure_mask(SECURE_KEEP_CAPS))
-#define SECURE_ALL_LOCKS       (SECURE_ALL_BITS << 1)
+#include <uapi/linux/securebits.h>
 
+#define issecure(X)            (issecure_mask(X) & current_cred_xxx(securebits))
 #endif /* !_LINUX_SECUREBITS_H */
index 10d6b226afc5aebdda9f3a65c72550e1af54d3c5..53d42650b1935f255feac8bc88401240057068c6 100644 (file)
@@ -1,85 +1,10 @@
 #ifndef _LINUX_SEM_H
 #define _LINUX_SEM_H
 
-#include <linux/ipc.h>
-
-/* semop flags */
-#define SEM_UNDO        0x1000  /* undo the operation on exit */
-
-/* semctl Command Definitions. */
-#define GETPID  11       /* get sempid */
-#define GETVAL  12       /* get semval */
-#define GETALL  13       /* get all semval's */
-#define GETNCNT 14       /* get semncnt */
-#define GETZCNT 15       /* get semzcnt */
-#define SETVAL  16       /* set semval */
-#define SETALL  17       /* set all semval's */
-
-/* ipcs ctl cmds */
-#define SEM_STAT 18
-#define SEM_INFO 19
-
-/* Obsolete, used only for backwards compatibility and libc5 compiles */
-struct semid_ds {
-       struct ipc_perm sem_perm;               /* permissions .. see ipc.h */
-       __kernel_time_t sem_otime;              /* last semop time */
-       __kernel_time_t sem_ctime;              /* last change time */
-       struct sem      *sem_base;              /* ptr to first semaphore in array */
-       struct sem_queue *sem_pending;          /* pending operations to be processed */
-       struct sem_queue **sem_pending_last;    /* last pending operation */
-       struct sem_undo *undo;                  /* undo requests on this array */
-       unsigned short  sem_nsems;              /* no. of semaphores in array */
-};
-
-/* Include the definition of semid64_ds */
-#include <asm/sembuf.h>
-
-/* semop system calls takes an array of these. */
-struct sembuf {
-       unsigned short  sem_num;        /* semaphore index in array */
-       short           sem_op;         /* semaphore operation */
-       short           sem_flg;        /* operation flags */
-};
-
-/* arg for semctl system calls. */
-union semun {
-       int val;                        /* value for SETVAL */
-       struct semid_ds __user *buf;    /* buffer for IPC_STAT & IPC_SET */
-       unsigned short __user *array;   /* array for GETALL & SETALL */
-       struct seminfo __user *__buf;   /* buffer for IPC_INFO */
-       void __user *__pad;
-};
-
-struct  seminfo {
-       int semmap;
-       int semmni;
-       int semmns;
-       int semmnu;
-       int semmsl;
-       int semopm;
-       int semume;
-       int semusz;
-       int semvmx;
-       int semaem;
-};
-
-#define SEMMNI  128             /* <= IPCMNI  max # of semaphore identifiers */
-#define SEMMSL  250             /* <= 8 000 max num of semaphores per id */
-#define SEMMNS  (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
-#define SEMOPM  32             /* <= 1 000 max num of ops per semop call */
-#define SEMVMX  32767           /* <= 32767 semaphore maximum value */
-#define SEMAEM  SEMVMX          /* adjust on exit max value */
-
-/* unused */
-#define SEMUME  SEMOPM          /* max num of undo entries per process */
-#define SEMMNU  SEMMNS          /* num of undo structures system wide */
-#define SEMMAP  SEMMNS          /* # of entries in semaphore map */
-#define SEMUSZ  20             /* sizeof struct sem_undo */
-
-#ifdef __KERNEL__
 #include <linux/atomic.h>
 #include <linux/rcupdate.h>
 #include <linux/cache.h>
+#include <uapi/linux/sem.h>
 
 struct task_struct;
 
@@ -122,6 +47,4 @@ static inline void exit_sem(struct task_struct *tsk)
 }
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SEM_H */
index 861e51de476bf8e55399f5796cfa68e89ba3718f..0916107c77f96fafb990cb09c00ad5151d62bed7 100644 (file)
@@ -6,16 +6,11 @@
  * Redistribution of this file is permitted under the terms of the GNU 
  * Public License (GPL)
  */
-
 #ifndef _LINUX_SERIAL_H
 #define _LINUX_SERIAL_H
 
-#include <linux/types.h>
-
-#include <linux/tty_flags.h>
-
-#ifdef __KERNEL__
 #include <asm/page.h>
+#include <uapi/linux/serial.h>
 
 
 /*
@@ -33,118 +28,6 @@ struct async_icount {
  */
 #define SERIAL_XMIT_SIZE PAGE_SIZE
 
-#endif
-
-struct serial_struct {
-       int     type;
-       int     line;
-       unsigned int    port;
-       int     irq;
-       int     flags;
-       int     xmit_fifo_size;
-       int     custom_divisor;
-       int     baud_base;
-       unsigned short  close_delay;
-       char    io_type;
-       char    reserved_char[1];
-       int     hub6;
-       unsigned short  closing_wait; /* time to wait before closing */
-       unsigned short  closing_wait2; /* no longer used... */
-       unsigned char   *iomem_base;
-       unsigned short  iomem_reg_shift;
-       unsigned int    port_high;
-       unsigned long   iomap_base;     /* cookie passed into ioremap */
-};
-
-/*
- * For the close wait times, 0 means wait forever for serial port to
- * flush its output.  65535 means don't wait at all.
- */
-#define ASYNC_CLOSING_WAIT_INF 0
-#define ASYNC_CLOSING_WAIT_NONE        65535
-
-/*
- * These are the supported serial types.
- */
-#define PORT_UNKNOWN   0
-#define PORT_8250      1
-#define PORT_16450     2
-#define PORT_16550     3
-#define PORT_16550A    4
-#define PORT_CIRRUS     5      /* usurped by cyclades.c */
-#define PORT_16650     6
-#define PORT_16650V2   7
-#define PORT_16750     8
-#define PORT_STARTECH  9       /* usurped by cyclades.c */
-#define PORT_16C950    10      /* Oxford Semiconductor */
-#define PORT_16654     11
-#define PORT_16850     12
-#define PORT_RSA       13      /* RSA-DV II/S card */
-#define PORT_MAX       13
-
-#define SERIAL_IO_PORT 0
-#define SERIAL_IO_HUB6 1
-#define SERIAL_IO_MEM  2
-
-#define UART_CLEAR_FIFO                0x01
-#define UART_USE_FIFO          0x02
-#define UART_STARTECH          0x04
-#define UART_NATSEMI           0x08
-
-
-/*
- * Multiport serial configuration structure --- external structure
- */
-struct serial_multiport_struct {
-       int             irq;
-       int             port1;
-       unsigned char   mask1, match1;
-       int             port2;
-       unsigned char   mask2, match2;
-       int             port3;
-       unsigned char   mask3, match3;
-       int             port4;
-       unsigned char   mask4, match4;
-       int             port_monitor;
-       int     reserved[32];
-};
-
-/*
- * Serial input interrupt line counters -- external structure
- * Four lines can interrupt: CTS, DSR, RI, DCD
- */
-struct serial_icounter_struct {
-       int cts, dsr, rng, dcd;
-       int rx, tx;
-       int frame, overrun, parity, brk;
-       int buf_overrun;
-       int reserved[9];
-};
-
-/*
- * Serial interface for controlling RS485 settings on chips with suitable
- * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
- * platform. The set function returns the new state, with any unsupported bits
- * reverted appropriately.
- */
-
-struct serial_rs485 {
-       __u32   flags;                  /* RS485 feature flags */
-#define SER_RS485_ENABLED              (1 << 0)        /* If enabled */
-#define SER_RS485_RTS_ON_SEND          (1 << 1)        /* Logical level for
-                                                          RTS pin when
-                                                          sending */
-#define SER_RS485_RTS_AFTER_SEND       (1 << 2)        /* Logical level for
-                                                          RTS pin after sent*/
-#define SER_RS485_RX_DURING_TX         (1 << 4)
-       __u32   delay_rts_before_send;  /* Delay before send (milliseconds) */
-       __u32   delay_rts_after_send;   /* Delay after send (milliseconds) */
-       __u32   padding[5];             /* Memory is cheap, new structs
-                                          are a royal PITA .. */
-};
-
-#ifdef __KERNEL__
 #include <linux/compiler.h>
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_SERIAL_H */
index f9b22ec7a9f383199d58431c6e6a1ec136ebe46c..3c430228d232a56023229e45ee1cf1d0020504c6 100644 (file)
 #ifndef LINUX_SERIAL_CORE_H
 #define LINUX_SERIAL_CORE_H
 
-#include <linux/serial.h>
-
-/*
- * The type definitions.  These are from Ted Ts'o's serial.h
- */
-#define PORT_UNKNOWN   0
-#define PORT_8250      1
-#define PORT_16450     2
-#define PORT_16550     3
-#define PORT_16550A    4
-#define PORT_CIRRUS    5
-#define PORT_16650     6
-#define PORT_16650V2   7
-#define PORT_16750     8
-#define PORT_STARTECH  9
-#define PORT_16C950    10
-#define PORT_16654     11
-#define PORT_16850     12
-#define PORT_RSA       13
-#define PORT_NS16550A  14
-#define PORT_XSCALE    15
-#define PORT_RM9000    16      /* PMC-Sierra RM9xxx internal UART */
-#define PORT_OCTEON    17      /* Cavium OCTEON internal UART */
-#define PORT_AR7       18      /* Texas Instruments AR7 internal UART */
-#define PORT_U6_16550A 19      /* ST-Ericsson U6xxx internal UART */
-#define PORT_TEGRA     20      /* NVIDIA Tegra internal UART */
-#define PORT_XR17D15X  21      /* Exar XR17D15x UART */
-#define PORT_LPC3220   22      /* NXP LPC32xx SoC "Standard" UART */
-#define PORT_8250_CIR  23      /* CIR infrared port, has its own driver */
-#define PORT_MAX_8250  23      /* max port ID */
-
-/*
- * ARM specific type numbers.  These are not currently guaranteed
- * to be implemented, and will change in the future.  These are
- * separate so any additions to the old serial.c that occur before
- * we are merged can be easily merged here.
- */
-#define PORT_PXA       31
-#define PORT_AMBA      32
-#define PORT_CLPS711X  33
-#define PORT_SA1100    34
-#define PORT_UART00    35
-#define PORT_21285     37
-
-/* Sparc type numbers.  */
-#define PORT_SUNZILOG  38
-#define PORT_SUNSAB    39
-
-/* DEC */
-#define PORT_DZ                46
-#define PORT_ZS                47
-
-/* Parisc type numbers. */
-#define PORT_MUX       48
-
-/* Atmel AT91 / AT32 SoC */
-#define PORT_ATMEL     49
-
-/* Macintosh Zilog type numbers */
-#define PORT_MAC_ZILOG 50      /* m68k : not yet implemented */
-#define PORT_PMAC_ZILOG        51
-
-/* SH-SCI */
-#define PORT_SCI       52
-#define PORT_SCIF      53
-#define PORT_IRDA      54
-
-/* Samsung S3C2410 SoC and derivatives thereof */
-#define PORT_S3C2410    55
-
-/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
-#define PORT_IP22ZILOG 56
-
-/* Sharp LH7a40x -- an ARM9 SoC series */
-#define PORT_LH7A40X   57
-
-/* PPC CPM type number */
-#define PORT_CPM        58
-
-/* MPC52xx (and MPC512x) type numbers */
-#define PORT_MPC52xx   59
-
-/* IBM icom */
-#define PORT_ICOM      60
-
-/* Samsung S3C2440 SoC */
-#define PORT_S3C2440   61
-
-/* Motorola i.MX SoC */
-#define PORT_IMX       62
-
-/* Marvell MPSC */
-#define PORT_MPSC      63
-
-/* TXX9 type number */
-#define PORT_TXX9      64
-
-/* NEC VR4100 series SIU/DSIU */
-#define PORT_VR41XX_SIU                65
-#define PORT_VR41XX_DSIU       66
-
-/* Samsung S3C2400 SoC */
-#define PORT_S3C2400   67
-
-/* M32R SIO */
-#define PORT_M32R_SIO  68
-
-/*Digi jsm */
-#define PORT_JSM        69
-
-#define PORT_PNX8XXX   70
-
-/* Hilscher netx */
-#define PORT_NETX      71
-
-/* SUN4V Hypervisor Console */
-#define PORT_SUNHV     72
-
-#define PORT_S3C2412   73
-
-/* Xilinx uartlite */
-#define PORT_UARTLITE  74
-
-/* Blackfin bf5xx */
-#define PORT_BFIN      75
-
-/* Micrel KS8695 */
-#define PORT_KS8695    76
-
-/* Broadcom SB1250, etc. SOC */
-#define PORT_SB1250_DUART      77
-
-/* Freescale ColdFire */
-#define PORT_MCF       78
-
-/* Blackfin SPORT */
-#define PORT_BFIN_SPORT                79
-
-/* MN10300 on-chip UART numbers */
-#define PORT_MN10300           80
-#define PORT_MN10300_CTS       81
-
-#define PORT_SC26XX    82
-
-/* SH-SCI */
-#define PORT_SCIFA     83
-
-#define PORT_S3C6400   84
-
-/* NWPSERIAL */
-#define PORT_NWPSERIAL 85
-
-/* MAX3100 */
-#define PORT_MAX3100    86
-
-/* Timberdale UART */
-#define PORT_TIMBUART  87
-
-/* Qualcomm MSM SoCs */
-#define PORT_MSM       88
-
-/* BCM63xx family SoCs */
-#define PORT_BCM63XX   89
-
-/* Aeroflex Gaisler GRLIB APBUART */
-#define PORT_APBUART    90
-
-/* Altera UARTs */
-#define PORT_ALTERA_JTAGUART   91
-#define PORT_ALTERA_UART       92
-
-/* SH-SCI */
-#define PORT_SCIFB     93
-
-/* MAX310X */
-#define PORT_MAX310X   94
-
-/* High Speed UART for Medfield */
-#define PORT_MFD       95
-
-/* TI OMAP-UART */
-#define PORT_OMAP      96
-
-/* VIA VT8500 SoC */
-#define PORT_VT8500    97
-
-/* Xilinx PSS UART */
-#define PORT_XUARTPS   98
-
-/* Atheros AR933X SoC */
-#define PORT_AR933X    99
-
-/* Energy Micro efm32 SoC */
-#define PORT_EFMUART   100
-
-#ifdef __KERNEL__
 
 #include <linux/compiler.h>
 #include <linux/interrupt.h>
 #include <linux/mutex.h>
 #include <linux/sysrq.h>
 #include <linux/pps_kernel.h>
+#include <uapi/linux/serial_core.h>
 
 struct uart_port;
 struct serial_struct;
@@ -562,6 +367,4 @@ static inline int uart_handle_break(struct uart_port *port)
                                         (cflag) & CRTSCTS || \
                                         !((cflag) & CLOCAL))
 
-#endif
-
 #endif /* LINUX_SERIAL_CORE_H */
index 6d6cfd3e94a348cb578f73c3b019b6121ee8aca1..36aac733840afc1b71deee284cfaf78b973aa673 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef _SERIO_H
-#define _SERIO_H
-
 /*
  * Copyright (C) 1999-2002 Vojtech Pavlik
 *
@@ -8,12 +5,9 @@
  * under the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation.
  */
+#ifndef _SERIO_H
+#define _SERIO_H
 
-#include <linux/ioctl.h>
-
-#define SPIOCSTYPE     _IOW('q', 0x01, unsigned long)
-
-#ifdef __KERNEL__
 
 #include <linux/types.h>
 #include <linux/interrupt.h>
@@ -22,6 +16,7 @@
 #include <linux/mutex.h>
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
+#include <uapi/linux/serio.h>
 
 struct serio {
        void *port_data;
@@ -152,68 +147,3 @@ static inline void serio_continue_rx(struct serio *serio)
 }
 
 #endif
-
-/*
- * bit masks for use in "interrupt" flags (3rd argument)
- */
-#define SERIO_TIMEOUT  1
-#define SERIO_PARITY   2
-#define SERIO_FRAME    4
-
-/*
- * Serio types
- */
-#define SERIO_XT       0x00
-#define SERIO_8042     0x01
-#define SERIO_RS232    0x02
-#define SERIO_HIL_MLC  0x03
-#define SERIO_PS_PSTHRU        0x05
-#define SERIO_8042_XL  0x06
-
-/*
- * Serio protocols
- */
-#define SERIO_UNKNOWN  0x00
-#define SERIO_MSC      0x01
-#define SERIO_SUN      0x02
-#define SERIO_MS       0x03
-#define SERIO_MP       0x04
-#define SERIO_MZ       0x05
-#define SERIO_MZP      0x06
-#define SERIO_MZPP     0x07
-#define SERIO_VSXXXAA  0x08
-#define SERIO_SUNKBD   0x10
-#define SERIO_WARRIOR  0x18
-#define SERIO_SPACEORB 0x19
-#define SERIO_MAGELLAN 0x1a
-#define SERIO_SPACEBALL        0x1b
-#define SERIO_GUNZE    0x1c
-#define SERIO_IFORCE   0x1d
-#define SERIO_STINGER  0x1e
-#define SERIO_NEWTON   0x1f
-#define SERIO_STOWAWAY 0x20
-#define SERIO_H3600    0x21
-#define SERIO_PS2SER   0x22
-#define SERIO_TWIDKBD  0x23
-#define SERIO_TWIDJOY  0x24
-#define SERIO_HIL      0x25
-#define SERIO_SNES232  0x26
-#define SERIO_SEMTECH  0x27
-#define SERIO_LKKBD    0x28
-#define SERIO_ELO      0x29
-#define SERIO_MICROTOUCH       0x30
-#define SERIO_PENMOUNT 0x31
-#define SERIO_TOUCHRIGHT       0x32
-#define SERIO_TOUCHWIN 0x33
-#define SERIO_TAOSEVM  0x34
-#define SERIO_FUJITSU  0x35
-#define SERIO_ZHENHUA  0x36
-#define SERIO_INEXIO   0x37
-#define SERIO_TOUCHIT213       0x38
-#define SERIO_W8001    0x39
-#define SERIO_DYNAPRO  0x3a
-#define SERIO_HAMPSHIRE        0x3b
-#define SERIO_PS2MULT  0x3c
-#define SERIO_TSC40    0x3d
-
-#endif
index edd086883ccbed5a84f2d44e0212d06b1af315a4..bcf8a6a3ec00d51b08e113248a0ca62d56f8b542 100644 (file)
@@ -1,88 +1,11 @@
 #ifndef _LINUX_SHM_H_
 #define _LINUX_SHM_H_
 
-#include <linux/ipc.h>
-#include <linux/errno.h>
-#ifdef __KERNEL__
 #include <asm/page.h>
-#else
-#include <unistd.h>
-#endif
-
-/*
- * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
- * be increased by sysctl
- */
+#include <uapi/linux/shm.h>
 
-#define SHMMAX 0x2000000                /* max shared seg size (bytes) */
-#define SHMMIN 1                        /* min shared seg size (bytes) */
-#define SHMMNI 4096                     /* max num of segs system wide */
-#ifdef __KERNEL__
 #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
-#else
-#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
-#endif
-#define SHMSEG SHMMNI                   /* max shared segs per process */
-
-#ifdef __KERNEL__
 #include <asm/shmparam.h>
-#endif
-
-/* Obsolete, used only for backwards compatibility and libc5 compiles */
-struct shmid_ds {
-       struct ipc_perm         shm_perm;       /* operation perms */
-       int                     shm_segsz;      /* size of segment (bytes) */
-       __kernel_time_t         shm_atime;      /* last attach time */
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       __kernel_time_t         shm_ctime;      /* last change time */
-       __kernel_ipc_pid_t      shm_cpid;       /* pid of creator */
-       __kernel_ipc_pid_t      shm_lpid;       /* pid of last operator */
-       unsigned short          shm_nattch;     /* no. of current attaches */
-       unsigned short          shm_unused;     /* compatibility */
-       void                    *shm_unused2;   /* ditto - used by DIPC */
-       void                    *shm_unused3;   /* unused */
-};
-
-/* Include the definition of shmid64_ds and shminfo64 */
-#include <asm/shmbuf.h>
-
-/* permission flag for shmget */
-#define SHM_R          0400    /* or S_IRUGO from <linux/stat.h> */
-#define SHM_W          0200    /* or S_IWUGO from <linux/stat.h> */
-
-/* mode for attach */
-#define        SHM_RDONLY      010000  /* read-only access */
-#define        SHM_RND         020000  /* round attach address to SHMLBA boundary */
-#define        SHM_REMAP       040000  /* take-over region on attach */
-#define        SHM_EXEC        0100000 /* execution access */
-
-/* super user shmctl commands */
-#define SHM_LOCK       11
-#define SHM_UNLOCK     12
-
-/* ipcs ctl commands */
-#define SHM_STAT       13
-#define SHM_INFO       14
-
-/* Obsolete, used only for backwards compatibility */
-struct shminfo {
-       int shmmax;
-       int shmmin;
-       int shmmni;
-       int shmseg;
-       int shmall;
-};
-
-struct shm_info {
-       int used_ids;
-       unsigned long shm_tot;  /* total allocated shm */
-       unsigned long shm_rss;  /* total resident shm */
-       unsigned long shm_swp;  /* total swapped shm */
-       unsigned long swap_attempts;
-       unsigned long swap_successes;
-};
-
-#ifdef __KERNEL__
 struct shmid_kernel /* private to the kernel */
 {      
        struct kern_ipc_perm    shm_perm;
@@ -127,6 +50,4 @@ static inline void exit_shm(struct task_struct *task)
 }
 #endif
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SHM_H_ */
index 26b424adc84299b6a53c9ad986e4d9350d16b68a..e19a011b43b7632163894ca70dde03ebaac64203 100644 (file)
@@ -1,11 +1,8 @@
 #ifndef _LINUX_SIGNAL_H
 #define _LINUX_SIGNAL_H
 
-#include <asm/signal.h>
-#include <asm/siginfo.h>
-
-#ifdef __KERNEL__
 #include <linux/list.h>
+#include <uapi/linux/signal.h>
 
 struct task_struct;
 
@@ -388,6 +385,4 @@ int unhandled_signal(struct task_struct *tsk, int sig);
 
 void signals_init(void);
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SIGNAL_H */
index 247399b2979a9a331c976e9f413e4dd122ef7711..eadbe227c25648824c1bbf851c48b99f6ee5f7da 100644 (file)
@@ -4,51 +4,11 @@
  *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
  *
  */
-
 #ifndef _LINUX_SIGNALFD_H
 #define _LINUX_SIGNALFD_H
 
-#include <linux/types.h>
-/* For O_CLOEXEC and O_NONBLOCK */
-#include <linux/fcntl.h>
-
-/* Flags for signalfd4.  */
-#define SFD_CLOEXEC O_CLOEXEC
-#define SFD_NONBLOCK O_NONBLOCK
-
-struct signalfd_siginfo {
-       __u32 ssi_signo;
-       __s32 ssi_errno;
-       __s32 ssi_code;
-       __u32 ssi_pid;
-       __u32 ssi_uid;
-       __s32 ssi_fd;
-       __u32 ssi_tid;
-       __u32 ssi_band;
-       __u32 ssi_overrun;
-       __u32 ssi_trapno;
-       __s32 ssi_status;
-       __s32 ssi_int;
-       __u64 ssi_ptr;
-       __u64 ssi_utime;
-       __u64 ssi_stime;
-       __u64 ssi_addr;
-       __u16 ssi_addr_lsb;
+#include <uapi/linux/signalfd.h>
 
-       /*
-        * Pad strcture to 128 bytes. Remember to update the
-        * pad size when you add new members. We use a fixed
-        * size structure to avoid compatibility problems with
-        * future versions, and we leave extra space for additional
-        * members. We use fixed size members because this strcture
-        * comes out of a read(2) and we really don't want to have
-        * a compat on read(2).
-        */
-       __u8 __pad[46];
-};
-
-
-#ifdef __KERNEL__
 
 #ifdef CONFIG_SIGNALFD
 
@@ -71,6 +31,4 @@ static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
 
 #endif /* CONFIG_SIGNALFD */
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SIGNALFD_H */
index e3e395acc2fda923a893cc3f0ad3def149b16354..e8d702e0fd89951baaf4f8f3b62f2dce559ac1ce 100644 (file)
@@ -1,29 +1,8 @@
 #ifndef __SOCK_DIAG_H__
 #define __SOCK_DIAG_H__
 
-#include <linux/types.h>
+#include <uapi/linux/sock_diag.h>
 
-#define SOCK_DIAG_BY_FAMILY 20
-
-struct sock_diag_req {
-       __u8    sdiag_family;
-       __u8    sdiag_protocol;
-};
-
-enum {
-       SK_MEMINFO_RMEM_ALLOC,
-       SK_MEMINFO_RCVBUF,
-       SK_MEMINFO_WMEM_ALLOC,
-       SK_MEMINFO_SNDBUF,
-       SK_MEMINFO_FWD_ALLOC,
-       SK_MEMINFO_WMEM_QUEUED,
-       SK_MEMINFO_OPTMEM,
-       SK_MEMINFO_BACKLOG,
-
-       SK_MEMINFO_VARS,
-};
-
-#ifdef __KERNEL__
 struct sk_buff;
 struct nlmsghdr;
 struct sock;
@@ -44,5 +23,4 @@ void sock_diag_save_cookie(void *sk, __u32 *cookie);
 
 int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
 
-#endif /* KERNEL */
 #endif
index ba7b2e817cfa9ac76a19c9e96554efd17f9f4888..9a546ff853dc927d94c4d0a0293785d3f461ace8 100644 (file)
@@ -1,30 +1,13 @@
 #ifndef _LINUX_SOCKET_H
 #define _LINUX_SOCKET_H
 
-/*
- * Desired design of maximum size and alignment (see RFC2553)
- */
-#define _K_SS_MAXSIZE  128     /* Implementation specific max size */
-#define _K_SS_ALIGNSIZE        (__alignof__ (struct sockaddr *))
-                               /* Implementation specific desired alignment */
-
-typedef unsigned short __kernel_sa_family_t;
-
-struct __kernel_sockaddr_storage {
-       __kernel_sa_family_t    ss_family;              /* address family */
-       /* Following field(s) are implementation specific */
-       char            __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
-                               /* space to achieve desired size, */
-                               /* _SS_MAXSIZE value minus size of ss_family */
-} __attribute__ ((aligned(_K_SS_ALIGNSIZE)));  /* force desired alignment */
-
-#ifdef __KERNEL__
 
 #include <asm/socket.h>                        /* arch-dependent defines       */
 #include <linux/sockios.h>             /* the SIOCxxx I/O controls     */
 #include <linux/uio.h>                 /* iovec support                */
 #include <linux/types.h>               /* pid_t                        */
 #include <linux/compiler.h>            /* __user                       */
+#include <uapi/linux/socket.h>
 
 struct pid;
 struct cred;
@@ -340,5 +323,4 @@ extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen
                          unsigned int flags, struct timespec *timeout);
 extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg,
                          unsigned int vlen, unsigned int flags);
-#endif /* not kernel and not glibc */
 #endif /* _LINUX_SOCKET_H */
index de8832dd272bd7dd86aa0fa126926401e0165ac0..680f9a31df25653043a41603c4134ff284469b0a 100644 (file)
@@ -1,64 +1,10 @@
 /* sonet.h - SONET/SHD physical layer control */
-/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
-
 #ifndef LINUX_SONET_H
 #define LINUX_SONET_H
 
-#define __SONET_ITEMS \
-    __HANDLE_ITEM(section_bip);        /* section parity errors (B1) */ \
-    __HANDLE_ITEM(line_bip);           /* line parity errors (B2) */ \
-    __HANDLE_ITEM(path_bip);           /* path parity errors (B3) */ \
-    __HANDLE_ITEM(line_febe);          /* line parity errors at remote */ \
-    __HANDLE_ITEM(path_febe);          /* path parity errors at remote */ \
-    __HANDLE_ITEM(corr_hcs);           /* correctable header errors */ \
-    __HANDLE_ITEM(uncorr_hcs);         /* uncorrectable header errors */ \
-    __HANDLE_ITEM(tx_cells);           /* cells sent */ \
-    __HANDLE_ITEM(rx_cells);           /* cells received */
-
-struct sonet_stats {
-#define __HANDLE_ITEM(i) int i
-       __SONET_ITEMS
-#undef __HANDLE_ITEM
-} __attribute__ ((packed));
-
-
-#define SONET_GETSTAT  _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
-                                       /* get statistics */
-#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
-                                       /* ... and zero counters */
-#define SONET_SETDIAG  _IOWR('a',ATMIOC_PHYTYP+2,int)
-                                       /* set error insertion */
-#define SONET_CLRDIAG  _IOWR('a',ATMIOC_PHYTYP+3,int)
-                                       /* clear error insertion */
-#define SONET_GETDIAG  _IOR('a',ATMIOC_PHYTYP+4,int)
-                                       /* query error insertion */
-#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
-                                       /* set framing mode (SONET/SDH) */
-#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
-                                       /* get framing mode */
-#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
-  unsigned char[SONET_FRSENSE_SIZE])   /* get framing sense information */
-
-#define SONET_INS_SBIP   1             /* section BIP */
-#define SONET_INS_LBIP   2             /* line BIP */
-#define SONET_INS_PBIP   4             /* path BIP */
-#define SONET_INS_FRAME          8             /* out of frame */
-#define SONET_INS_LOS   16             /* set line to zero */
-#define SONET_INS_LAIS  32             /* line alarm indication signal */
-#define SONET_INS_PAIS  64             /* path alarm indication signal */
-#define SONET_INS_HCS  128             /* insert HCS error */
-
-#define SONET_FRAME_SONET 0            /* SONET STS-3 framing */
-#define SONET_FRAME_SDH   1            /* SDH STM-1 framing */
-
-#define SONET_FRSENSE_SIZE 6           /* C1[3],H1[3] (0xff for unknown) */
-
-
-#ifdef __KERNEL__
 
 #include <linux/atomic.h>
+#include <uapi/linux/sonet.h>
 
 struct k_sonet_stats {
 #define __HANDLE_ITEM(i) atomic_t i
@@ -71,5 +17,3 @@ extern void sonet_subtract_stats(struct k_sonet_stats *from,
     struct sonet_stats *to);
 
 #endif
-
-#endif
index c0f87da78f8a44b788fd32ebcabf94d4b72e2962..0b7cc265cc0b65e71c1fc1a0d9b7d36bb0422529 100644 (file)
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-
 #ifndef _SONYPI_H_
 #define _SONYPI_H_
 
-#include <linux/types.h>
-
-/* events the user application reading /dev/sonypi can use */
-
-#define SONYPI_EVENT_IGNORE                     0
-#define SONYPI_EVENT_JOGDIAL_DOWN               1
-#define SONYPI_EVENT_JOGDIAL_UP                         2
-#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED       3
-#define SONYPI_EVENT_JOGDIAL_UP_PRESSED                 4
-#define SONYPI_EVENT_JOGDIAL_PRESSED            5
-#define SONYPI_EVENT_JOGDIAL_RELEASED           6      /* obsolete */
-#define SONYPI_EVENT_CAPTURE_PRESSED            7
-#define SONYPI_EVENT_CAPTURE_RELEASED           8      /* obsolete */
-#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED     9
-#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED   10
-#define SONYPI_EVENT_FNKEY_ESC                 11
-#define SONYPI_EVENT_FNKEY_F1                  12
-#define SONYPI_EVENT_FNKEY_F2                  13
-#define SONYPI_EVENT_FNKEY_F3                  14
-#define SONYPI_EVENT_FNKEY_F4                  15
-#define SONYPI_EVENT_FNKEY_F5                  16
-#define SONYPI_EVENT_FNKEY_F6                  17
-#define SONYPI_EVENT_FNKEY_F7                  18
-#define SONYPI_EVENT_FNKEY_F8                  19
-#define SONYPI_EVENT_FNKEY_F9                  20
-#define SONYPI_EVENT_FNKEY_F10                 21
-#define SONYPI_EVENT_FNKEY_F11                 22
-#define SONYPI_EVENT_FNKEY_F12                 23
-#define SONYPI_EVENT_FNKEY_1                   24
-#define SONYPI_EVENT_FNKEY_2                   25
-#define SONYPI_EVENT_FNKEY_D                   26
-#define SONYPI_EVENT_FNKEY_E                   27
-#define SONYPI_EVENT_FNKEY_F                   28
-#define SONYPI_EVENT_FNKEY_S                   29
-#define SONYPI_EVENT_FNKEY_B                   30
-#define SONYPI_EVENT_BLUETOOTH_PRESSED         31
-#define SONYPI_EVENT_PKEY_P1                   32
-#define SONYPI_EVENT_PKEY_P2                   33
-#define SONYPI_EVENT_PKEY_P3                   34
-#define SONYPI_EVENT_BACK_PRESSED              35
-#define SONYPI_EVENT_LID_CLOSED                        36
-#define SONYPI_EVENT_LID_OPENED                        37
-#define SONYPI_EVENT_BLUETOOTH_ON              38
-#define SONYPI_EVENT_BLUETOOTH_OFF             39
-#define SONYPI_EVENT_HELP_PRESSED              40
-#define SONYPI_EVENT_FNKEY_ONLY                        41
-#define SONYPI_EVENT_JOGDIAL_FAST_DOWN         42
-#define SONYPI_EVENT_JOGDIAL_FAST_UP           43
-#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
-#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED   45
-#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN                46
-#define SONYPI_EVENT_JOGDIAL_VFAST_UP          47
-#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED        48
-#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED  49
-#define SONYPI_EVENT_ZOOM_PRESSED              50
-#define SONYPI_EVENT_THUMBPHRASE_PRESSED       51
-#define SONYPI_EVENT_MEYE_FACE                 52
-#define SONYPI_EVENT_MEYE_OPPOSITE             53
-#define SONYPI_EVENT_MEMORYSTICK_INSERT                54
-#define SONYPI_EVENT_MEMORYSTICK_EJECT         55
-#define SONYPI_EVENT_ANYBUTTON_RELEASED                56
-#define SONYPI_EVENT_BATTERY_INSERT            57
-#define SONYPI_EVENT_BATTERY_REMOVE            58
-#define SONYPI_EVENT_FNKEY_RELEASED            59
-#define SONYPI_EVENT_WIRELESS_ON               60
-#define SONYPI_EVENT_WIRELESS_OFF              61
-#define SONYPI_EVENT_ZOOM_IN_PRESSED           62
-#define SONYPI_EVENT_ZOOM_OUT_PRESSED          63
-#define SONYPI_EVENT_CD_EJECT_PRESSED          64
-#define SONYPI_EVENT_MODEKEY_PRESSED           65
-#define SONYPI_EVENT_PKEY_P4                   66
-#define SONYPI_EVENT_PKEY_P5                   67
-#define SONYPI_EVENT_SETTINGKEY_PRESSED                68
-#define SONYPI_EVENT_VOLUME_INC_PRESSED                69
-#define SONYPI_EVENT_VOLUME_DEC_PRESSED                70
-#define SONYPI_EVENT_BRIGHTNESS_PRESSED                71
-#define SONYPI_EVENT_MEDIA_PRESSED             72
-#define SONYPI_EVENT_VENDOR_PRESSED            73
-
-/* get/set brightness */
-#define SONYPI_IOCGBRT         _IOR('v', 0, __u8)
-#define SONYPI_IOCSBRT         _IOW('v', 0, __u8)
-
-/* get battery full capacity/remaining capacity */
-#define SONYPI_IOCGBAT1CAP     _IOR('v', 2, __u16)
-#define SONYPI_IOCGBAT1REM     _IOR('v', 3, __u16)
-#define SONYPI_IOCGBAT2CAP     _IOR('v', 4, __u16)
-#define SONYPI_IOCGBAT2REM     _IOR('v', 5, __u16)
+#include <uapi/linux/sonypi.h>
 
-/* get battery flags: battery1/battery2/ac adapter present */
-#define SONYPI_BFLAGS_B1       0x01
-#define SONYPI_BFLAGS_B2       0x02
-#define SONYPI_BFLAGS_AC       0x04
-#define SONYPI_IOCGBATFLAGS    _IOR('v', 7, __u8)
-
-/* get/set bluetooth subsystem state on/off */
-#define SONYPI_IOCGBLUE                _IOR('v', 8, __u8)
-#define SONYPI_IOCSBLUE                _IOW('v', 9, __u8)
-
-/* get/set fan state on/off */
-#define SONYPI_IOCGFAN         _IOR('v', 10, __u8)
-#define SONYPI_IOCSFAN         _IOW('v', 11, __u8)
-
-/* get temperature (C) */
-#define SONYPI_IOCGTEMP                _IOR('v', 12, __u8)
-
-#ifdef __KERNEL__
 
 /* used only for communication between v4l and sonypi */
 
 #define SONYPI_COMMAND_GETCAMERAROMVERSION     18      /* obsolete */
 #define SONYPI_COMMAND_GETCAMERAREVISION       19      /* obsolete */
 
-#endif                         /* __KERNEL__ */
-
 #endif                         /* _SONYPI_H_ */
index fae20ba01fbf8e431359b1080be9afec1ab11d6a..73ded040f1d7c894a1bdd8e56ce69af74b76918b 100644 (file)
@@ -1,33 +1,8 @@
 #ifndef _LINUX_SOUND_H
 #define _LINUX_SOUND_H
 
-/*
- * Minor numbers for the sound driver.
- */
-
-#include <linux/fs.h>
+#include <uapi/linux/sound.h>
 
-#define SND_DEV_CTL            0       /* Control port /dev/mixer */
-#define SND_DEV_SEQ            1       /* Sequencer output /dev/sequencer (FM
-                                               synthesizer and MIDI output) */
-#define SND_DEV_MIDIN          2       /* Raw midi access */
-#define SND_DEV_DSP            3       /* Digitized voice /dev/dsp */
-#define SND_DEV_AUDIO          4       /* Sparc compatible /dev/audio */
-#define SND_DEV_DSP16          5       /* Like /dev/dsp but 16 bits/sample */
-/* #define SND_DEV_STATUS      6 */    /* /dev/sndstat (obsolete) */
-#define SND_DEV_UNUSED         6
-#define SND_DEV_AWFM           7       /* Reserved */
-#define SND_DEV_SEQ2           8       /* /dev/sequencer, level 2 interface */
-/* #define SND_DEV_SNDPROC     9 */    /* /dev/sndproc for programmable devices (not used) */
-/* #define SND_DEV_DMMIDI      9 */
-#define SND_DEV_SYNTH          9       /* Raw synth access /dev/synth (same as /dev/dmfm) */
-#define SND_DEV_DMFM           10      /* Raw synth access /dev/dmfm */
-#define SND_DEV_UNKNOWN11      11
-#define SND_DEV_ADSP           12      /* Like /dev/dsp (obsolete) */
-#define SND_DEV_AMIDI          13      /* Like /dev/midi (obsolete) */
-#define SND_DEV_ADMMIDI                14      /* Like /dev/dmmidi (onsolete) */
-
-#ifdef __KERNEL__
 /*
  *     Sound core interface functions
  */
@@ -43,6 +18,4 @@ extern void unregister_sound_special(int unit);
 extern void unregister_sound_mixer(int unit);
 extern void unregister_sound_midi(int unit);
 extern void unregister_sound_dsp(int unit);
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SOUND_H */
index dfcf86f013a9492624ba14874be39380199ed236..96c79cbd79ef93f98efc41f09d90d7934cd77937 100644 (file)
@@ -1,5 +1,3 @@
-#ifndef SOUNDCARD_H
-#define SOUNDCARD_H
 /*
  * Copyright by Hannu Savolainen 1993-1997
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+#ifndef SOUNDCARD_H
+#define SOUNDCARD_H
 
-
-/*
- * OSS interface version. With versions earlier than 3.6 this value is
- * an integer with value less than 361. In versions 3.6 and later
- * it's a six digit hexadecimal value. For example value
- * of 0x030600 represents OSS version 3.6.0.
- * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
- * the currently active driver.
- */
-#define SOUND_VERSION  0x030802
-#define OPEN_SOUND_SYSTEM
-
-/* In Linux we need to be prepared for cross compiling */
-#include <linux/ioctl.h>
-
-/* Endian macros. */
-#ifdef __KERNEL__
 #  include <asm/byteorder.h>
-#else
-#  include <endian.h>
-#endif
-
-/*
- *     Supported card ID numbers (Should be somewhere else?)
- */
-
-#define SNDCARD_ADLIB          1
-#define SNDCARD_SB             2
-#define SNDCARD_PAS            3
-#define SNDCARD_GUS            4
-#define SNDCARD_MPU401         5
-#define SNDCARD_SB16           6
-#define SNDCARD_SB16MIDI       7
-#define SNDCARD_UART6850       8
-#define SNDCARD_GUS16          9
-#define SNDCARD_MSS            10
-#define SNDCARD_PSS            11
-#define SNDCARD_SSCAPE         12
-#define SNDCARD_PSS_MPU        13
-#define SNDCARD_PSS_MSS        14
-#define SNDCARD_SSCAPE_MSS     15
-#define SNDCARD_TRXPRO         16
-#define SNDCARD_TRXPRO_SB      17
-#define SNDCARD_TRXPRO_MPU     18
-#define SNDCARD_MAD16          19
-#define SNDCARD_MAD16_MPU      20
-#define SNDCARD_CS4232         21
-#define SNDCARD_CS4232_MPU     22
-#define SNDCARD_MAUI           23
-#define SNDCARD_PSEUDO_MSS     24
-#define SNDCARD_GUSPNP         25
-#define SNDCARD_UART401                26
-/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
-
-/***********************************
- * IOCTL Commands for /dev/sequencer
- */
-
-#ifndef _SIOWR
-#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
-/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
-#define        SIOCPARM_MASK   IOCPARM_MASK
-#define        SIOC_VOID       IOC_VOID
-#define        SIOC_OUT        IOC_OUT
-#define        SIOC_IN         IOC_IN
-#define        SIOC_INOUT      IOC_INOUT
-#define _SIOC_SIZE     _IOC_SIZE
-#define _SIOC_DIR      _IOC_DIR
-#define _SIOC_NONE     _IOC_NONE
-#define _SIOC_READ     _IOC_READ
-#define _SIOC_WRITE    _IOC_WRITE
-#define        _SIO            _IO
-#define        _SIOR           _IOR
-#define        _SIOW           _IOW
-#define        _SIOWR          _IOWR
-#else
+#include <uapi/linux/soundcard.h>
 
-/* Ioctl's have the command encoded in the lower word,
- * and the size of any in or out parameters in the upper
- * word.  The high 2 bits of the upper word are used
- * to encode the in/out status of the parameter; for now
- * we restrict parameters to at most 8191 bytes.
- */
-/* #define     SIOCTYPE                (0xff<<8) */
-#define        SIOCPARM_MASK   0x1fff          /* parameters must be < 8192 bytes */
-#define        SIOC_VOID       0x00000000      /* no parameters */
-#define        SIOC_OUT        0x20000000      /* copy out parameters */
-#define        SIOC_IN         0x40000000      /* copy in parameters */
-#define        SIOC_INOUT      (SIOC_IN|SIOC_OUT)
-/* the 0x20000000 is so we can distinguish new ioctl's from old */
-#define        _SIO(x,y)       ((int)(SIOC_VOID|(x<<8)|y))
-#define        _SIOR(x,y,t)    ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define        _SIOW(x,y,t)    ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-/* this should be _SIORW, but stdio got there first */
-#define        _SIOWR(x,y,t)   ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define _SIOC_SIZE(x)  ((x>>16)&SIOCPARM_MASK) 
-#define _SIOC_DIR(x)   (x & 0xf0000000)
-#define _SIOC_NONE     SIOC_VOID
-#define _SIOC_READ     SIOC_OUT
-#define _SIOC_WRITE    SIOC_IN
-#  endif /* _IOWR */
-#endif  /* !_SIOWR */
-
-#define SNDCTL_SEQ_RESET               _SIO  ('Q', 0)
-#define SNDCTL_SEQ_SYNC                        _SIO  ('Q', 1)
-#define SNDCTL_SYNTH_INFO              _SIOWR('Q', 2, struct synth_info)
-#define SNDCTL_SEQ_CTRLRATE            _SIOWR('Q', 3, int)     /* Set/get timer resolution (HZ) */
-#define SNDCTL_SEQ_GETOUTCOUNT         _SIOR ('Q', 4, int)
-#define SNDCTL_SEQ_GETINCOUNT          _SIOR ('Q', 5, int)
-#define SNDCTL_SEQ_PERCMODE            _SIOW ('Q', 6, int)
-#define SNDCTL_FM_LOAD_INSTR           _SIOW ('Q', 7, struct sbi_instrument)   /* Obsolete. Don't use!!!!!! */
-#define SNDCTL_SEQ_TESTMIDI            _SIOW ('Q', 8, int)
-#define SNDCTL_SEQ_RESETSAMPLES                _SIOW ('Q', 9, int)
-#define SNDCTL_SEQ_NRSYNTHS            _SIOR ('Q',10, int)
-#define SNDCTL_SEQ_NRMIDIS             _SIOR ('Q',11, int)
-#define SNDCTL_MIDI_INFO               _SIOWR('Q',12, struct midi_info)
-#define SNDCTL_SEQ_THRESHOLD           _SIOW ('Q',13, int)
-#define SNDCTL_SYNTH_MEMAVL            _SIOWR('Q',14, int)     /* in=dev#, out=memsize */
-#define SNDCTL_FM_4OP_ENABLE           _SIOW ('Q',15, int)     /* in=dev# */
-#define SNDCTL_SEQ_PANIC               _SIO  ('Q',17)
-#define SNDCTL_SEQ_OUTOFBAND           _SIOW ('Q',18, struct seq_event_rec)
-#define SNDCTL_SEQ_GETTIME             _SIOR ('Q',19, int)
-#define SNDCTL_SYNTH_ID                        _SIOWR('Q',20, struct synth_info)
-#define SNDCTL_SYNTH_CONTROL           _SIOWR('Q',21, struct synth_control)
-#define SNDCTL_SYNTH_REMOVESAMPLE      _SIOWR('Q',22, struct remove_sample)
-
-typedef struct synth_control
-{
-       int devno;      /* Synthesizer # */
-       char data[4000]; /* Device spesific command/data record */
-}synth_control;
-
-typedef struct remove_sample
-{
-       int devno;      /* Synthesizer # */
-       int bankno;     /* MIDI bank # (0=General MIDI) */
-       int instrno;    /* MIDI instrument number */
-} remove_sample;
-
-typedef struct seq_event_rec {
-               unsigned char arr[8];
-} seq_event_rec;
-
-#define SNDCTL_TMR_TIMEBASE            _SIOWR('T', 1, int)
-#define SNDCTL_TMR_START               _SIO  ('T', 2)
-#define SNDCTL_TMR_STOP                        _SIO  ('T', 3)
-#define SNDCTL_TMR_CONTINUE            _SIO  ('T', 4)
-#define SNDCTL_TMR_TEMPO               _SIOWR('T', 5, int)
-#define SNDCTL_TMR_SOURCE              _SIOWR('T', 6, int)
-#      define TMR_INTERNAL             0x00000001
-#      define TMR_EXTERNAL             0x00000002
-#              define TMR_MODE_MIDI    0x00000010
-#              define TMR_MODE_FSK     0x00000020
-#              define TMR_MODE_CLS     0x00000040
-#              define TMR_MODE_SMPTE   0x00000080
-#define SNDCTL_TMR_METRONOME           _SIOW ('T', 7, int)
-#define SNDCTL_TMR_SELECT              _SIOW ('T', 8, int)
-
-/*
- * Some big endian/little endian handling macros
- */
-
-#define _LINUX_PATCHKEY_H_INDIRECT
-#include <linux/patchkey.h>
-#undef _LINUX_PATCHKEY_H_INDIRECT
-
-#if defined(__KERNEL__)
 #  if defined(__BIG_ENDIAN)
 #    define AFMT_S16_NE AFMT_S16_BE
 #  elif defined(__LITTLE_ENDIAN)
@@ -198,1095 +34,4 @@ typedef struct seq_event_rec {
 #  else
 #    error "could not determine byte order"
 #  endif
-#else
-# if defined(__BYTE_ORDER)
-#  if __BYTE_ORDER == __BIG_ENDIAN
-#    define AFMT_S16_NE AFMT_S16_BE
-#  elif __BYTE_ORDER == __LITTLE_ENDIAN
-#    define AFMT_S16_NE AFMT_S16_LE
-#  else
-#    error "could not determine byte order"
-#  endif
-# endif
-#endif
-
-/*
- *     Sample loading mechanism for internal synthesizers (/dev/sequencer)
- *     The following patch_info structure has been designed to support
- *     Gravis UltraSound. It tries to be universal format for uploading
- *     sample based patches but is probably too limited.
- *
- *      (PBD) As Hannu guessed, the GUS structure is too limited for 
- *      the WaveFront, but this is the right place for a constant definition.
- */
-
-struct patch_info {
-               unsigned short key;             /* Use WAVE_PATCH here */
-#define WAVE_PATCH        _PATCHKEY(0x04)
-#define GUS_PATCH         WAVE_PATCH
-#define WAVEFRONT_PATCH    _PATCHKEY(0x06)
-
-               short device_no;        /* Synthesizer number */
-               short instr_no;         /* Midi pgm# */
-
-               unsigned int mode;
-/*
- * The least significant byte has the same format than the GUS .PAT
- * files
- */
-#define WAVE_16_BITS   0x01    /* bit 0 = 8 or 16 bit wave data. */
-#define WAVE_UNSIGNED  0x02    /* bit 1 = Signed - Unsigned data. */
-#define WAVE_LOOPING   0x04    /* bit 2 = looping enabled-1. */
-#define WAVE_BIDIR_LOOP        0x08    /* bit 3 = Set is bidirectional looping. */
-#define WAVE_LOOP_BACK 0x10    /* bit 4 = Set is looping backward. */
-#define WAVE_SUSTAIN_ON        0x20    /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
-#define WAVE_ENVELOPES 0x40    /* bit 6 = Enable envelopes - 1 */
-#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
-                               /*      (use the env_rate/env_offs fields). */
-/* Linux specific bits */
-#define WAVE_VIBRATO   0x00010000      /* The vibrato info is valid */
-#define WAVE_TREMOLO   0x00020000      /* The tremolo info is valid */
-#define WAVE_SCALE     0x00040000      /* The scaling info is valid */
-#define WAVE_FRACTIONS 0x00080000      /* Fraction information is valid */
-/* Reserved bits */
-#define WAVE_ROM       0x40000000      /* For future use */
-#define WAVE_MULAW     0x20000000      /* For future use */
-/* Other bits must be zeroed */
-
-               int len;        /* Size of the wave data in bytes */
-               int loop_start, loop_end; /* Byte offsets from the beginning */
-
-/* 
- * The base_freq and base_note fields are used when computing the
- * playback speed for a note. The base_note defines the tone frequency
- * which is heard if the sample is played using the base_freq as the
- * playback speed.
- *
- * The low_note and high_note fields define the minimum and maximum note
- * frequencies for which this sample is valid. It is possible to define
- * more than one samples for an instrument number at the same time. The
- * low_note and high_note fields are used to select the most suitable one.
- *
- * The fields base_note, high_note and low_note should contain
- * the note frequency multiplied by 1000. For example value for the
- * middle A is 440*1000.
- */
-
-               unsigned int base_freq;
-               unsigned int base_note;
-               unsigned int high_note;
-               unsigned int low_note;
-               int panning;    /* -128=left, 127=right */
-               int detuning;
-
-/*     New fields introduced in version 1.99.5 */
-
-       /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
-               unsigned char   env_rate[ 6 ];   /* GUS HW ramping rate */
-               unsigned char   env_offset[ 6 ]; /* 255 == 100% */
-
-       /* 
-        * The tremolo, vibrato and scale info are not supported yet.
-        * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
-        * WAVE_SCALE
-        */
-
-               unsigned char   tremolo_sweep;
-               unsigned char   tremolo_rate;
-               unsigned char   tremolo_depth;
-       
-               unsigned char   vibrato_sweep;
-               unsigned char   vibrato_rate;
-               unsigned char   vibrato_depth;
-
-               int             scale_frequency;
-               unsigned int    scale_factor;           /* from 0 to 2048 or 0 to 2 */
-       
-               int             volume;
-               int             fractions;
-               int             reserved1;
-               int             spare[2];
-               char data[1];   /* The waveform data starts here */
-       };
-
-struct sysex_info {
-               short key;              /* Use SYSEX_PATCH or MAUI_PATCH here */
-#define SYSEX_PATCH    _PATCHKEY(0x05)
-#define MAUI_PATCH     _PATCHKEY(0x06)
-               short device_no;        /* Synthesizer number */
-               int len;        /* Size of the sysex data in bytes */
-               unsigned char data[1];  /* Sysex data starts here */
-       };
-
-/*
- * /dev/sequencer input events.
- *
- * The data written to the /dev/sequencer is a stream of events. Events
- * are records of 4 or 8 bytes. The first byte defines the size. 
- * Any number of events can be written with a write call. There
- * is a set of macros for sending these events. Use these macros if you
- * want to maximize portability of your program.
- *
- * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
- * (All input events are currently 4 bytes long. Be prepared to support
- * 8 byte events also. If you receive any event having first byte >= 128,
- * it's a 8 byte event.
- *
- * The events are documented at the end of this file.
- *
- * Normal events (4 bytes)
- * There is also a 8 byte version of most of the 4 byte events. The
- * 8 byte one is recommended.
- */
-#define SEQ_NOTEOFF            0
-#define SEQ_FMNOTEOFF          SEQ_NOTEOFF     /* Just old name */
-#define SEQ_NOTEON             1
-#define        SEQ_FMNOTEON            SEQ_NOTEON
-#define SEQ_WAIT               TMR_WAIT_ABS
-#define SEQ_PGMCHANGE          3
-#define SEQ_FMPGMCHANGE                SEQ_PGMCHANGE
-#define SEQ_SYNCTIMER          TMR_START
-#define SEQ_MIDIPUTC           5
-#define SEQ_DRUMON             6       /*** OBSOLETE ***/
-#define SEQ_DRUMOFF            7       /*** OBSOLETE ***/
-#define SEQ_ECHO               TMR_ECHO        /* For synching programs with output */
-#define SEQ_AFTERTOUCH         9
-#define SEQ_CONTROLLER         10
-
-/*******************************************
- *     Midi controller numbers
- *******************************************
- * Controllers 0 to 31 (0x00 to 0x1f) and
- * 32 to 63 (0x20 to 0x3f) are continuous
- * controllers.
- * In the MIDI 1.0 these controllers are sent using
- * two messages. Controller numbers 0 to 31 are used
- * to send the MSB and the controller numbers 32 to 63
- * are for the LSB. Note that just 7 bits are used in MIDI bytes.
- */
-
-#define           CTL_BANK_SELECT              0x00
-#define           CTL_MODWHEEL                 0x01
-#define    CTL_BREATH                  0x02
-/*             undefined               0x03 */
-#define    CTL_FOOT                    0x04
-#define    CTL_PORTAMENTO_TIME         0x05
-#define    CTL_DATA_ENTRY              0x06
-#define    CTL_MAIN_VOLUME             0x07
-#define    CTL_BALANCE                 0x08
-/*             undefined               0x09 */
-#define    CTL_PAN                     0x0a
-#define    CTL_EXPRESSION              0x0b
-/*             undefined               0x0c */
-/*             undefined               0x0d */
-/*             undefined               0x0e */
-/*             undefined               0x0f */
-#define    CTL_GENERAL_PURPOSE1        0x10
-#define    CTL_GENERAL_PURPOSE2        0x11
-#define    CTL_GENERAL_PURPOSE3        0x12
-#define    CTL_GENERAL_PURPOSE4        0x13
-/*             undefined               0x14 - 0x1f */
-
-/*             undefined               0x20 */
-/* The controller numbers 0x21 to 0x3f are reserved for the */
-/* least significant bytes of the controllers 0x00 to 0x1f. */
-/* These controllers are not recognised by the driver. */
-
-/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
-/* 0=OFF and 127=ON (intermediate values are possible) */
-#define    CTL_DAMPER_PEDAL            0x40
-#define    CTL_SUSTAIN                 0x40    /* Alias */
-#define    CTL_HOLD                    0x40    /* Alias */
-#define    CTL_PORTAMENTO              0x41
-#define    CTL_SOSTENUTO               0x42
-#define    CTL_SOFT_PEDAL              0x43
-/*             undefined               0x44 */
-#define    CTL_HOLD2                   0x45
-/*             undefined               0x46 - 0x4f */
-
-#define    CTL_GENERAL_PURPOSE5        0x50
-#define    CTL_GENERAL_PURPOSE6        0x51
-#define    CTL_GENERAL_PURPOSE7        0x52
-#define    CTL_GENERAL_PURPOSE8        0x53
-/*             undefined               0x54 - 0x5a */
-#define    CTL_EXT_EFF_DEPTH           0x5b
-#define    CTL_TREMOLO_DEPTH           0x5c
-#define    CTL_CHORUS_DEPTH            0x5d
-#define    CTL_DETUNE_DEPTH            0x5e
-#define    CTL_CELESTE_DEPTH           0x5e    /* Alias for the above one */
-#define    CTL_PHASER_DEPTH            0x5f
-#define    CTL_DATA_INCREMENT          0x60
-#define    CTL_DATA_DECREMENT          0x61
-#define    CTL_NONREG_PARM_NUM_LSB     0x62
-#define    CTL_NONREG_PARM_NUM_MSB     0x63
-#define    CTL_REGIST_PARM_NUM_LSB     0x64
-#define    CTL_REGIST_PARM_NUM_MSB     0x65
-/*             undefined               0x66 - 0x78 */
-/*             reserved                0x79 - 0x7f */
-
-/* Pseudo controllers (not midi compatible) */
-#define    CTRL_PITCH_BENDER           255
-#define    CTRL_PITCH_BENDER_RANGE     254
-#define    CTRL_EXPRESSION             253     /* Obsolete */
-#define    CTRL_MAIN_VOLUME            252     /* Obsolete */
-#define SEQ_BALANCE            11
-#define SEQ_VOLMODE             12
-
-/*
- * Volume mode decides how volumes are used
- */
-
-#define VOL_METHOD_ADAGIO      1
-#define VOL_METHOD_LINEAR      2
-
-/*
- * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
- *      input events.
- */
-
-/*
- * Event codes 0xf0 to 0xfc are reserved for future extensions.
- */
-
-#define SEQ_FULLSIZE           0xfd    /* Long events */
-/*
- *     SEQ_FULLSIZE events are used for loading patches/samples to the
- *     synthesizer devices. These events are passed directly to the driver
- *     of the associated synthesizer device. There is no limit to the size
- *     of the extended events. These events are not queued but executed
- *     immediately when the write() is called (execution can take several
- *     seconds of time). 
- *
- *     When a SEQ_FULLSIZE message is written to the device, it must
- *     be written using exactly one write() call. Other events cannot
- *     be mixed to the same write.
- *     
- *     For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the 
- *     /dev/sequencer. Don't write other data together with the instrument structure
- *     Set the key field of the structure to FM_PATCH. The device field is used to
- *     route the patch to the corresponding device.
- *
- *     For wave table use struct patch_info. Initialize the key field
- *      to WAVE_PATCH.
- */
-#define SEQ_PRIVATE            0xfe    /* Low level HW dependent events (8 bytes) */
-#define SEQ_EXTENDED           0xff    /* Extended events (8 bytes) OBSOLETE */
-
-/*
- * Record for FM patches
- */
-
-typedef unsigned char sbi_instr_data[32];
-
-struct sbi_instrument {
-               unsigned short  key;    /* FM_PATCH or OPL3_PATCH */
-#define FM_PATCH       _PATCHKEY(0x01)
-#define OPL3_PATCH     _PATCHKEY(0x03)
-               short           device;         /*      Synth# (0-4)    */
-               int             channel;        /*      Program# to be initialized      */
-               sbi_instr_data  operators;      /*      Register settings for operator cells (.SBI format)      */
-       };
-
-struct synth_info {    /* Read only */
-               char    name[30];
-               int     device;         /* 0-N. INITIALIZE BEFORE CALLING */
-               int     synth_type;
-#define SYNTH_TYPE_FM                  0
-#define SYNTH_TYPE_SAMPLE              1
-#define SYNTH_TYPE_MIDI                        2       /* Midi interface */
-
-               int     synth_subtype;
-#define FM_TYPE_ADLIB                  0x00
-#define FM_TYPE_OPL3                   0x01
-#define MIDI_TYPE_MPU401               0x401
-
-#define SAMPLE_TYPE_BASIC              0x10
-#define SAMPLE_TYPE_GUS                        SAMPLE_TYPE_BASIC
-#define SAMPLE_TYPE_WAVEFRONT           0x11
-
-               int     perc_mode;      /* No longer supported */
-               int     nr_voices;
-               int     nr_drums;       /* Obsolete field */
-               int     instr_bank_size;
-               unsigned int    capabilities;   
-#define SYNTH_CAP_PERCMODE             0x00000001 /* No longer used */
-#define SYNTH_CAP_OPL3                 0x00000002 /* Set if OPL3 supported */
-#define SYNTH_CAP_INPUT                        0x00000004 /* Input (MIDI) device */
-               int     dummies[19];    /* Reserve space */
-       };
-
-struct sound_timer_info {
-               char name[32];
-               int caps;
-       };
-
-#define MIDI_CAP_MPU401                1               /* MPU-401 intelligent mode */
-
-struct midi_info {
-               char            name[30];
-               int             device;         /* 0-N. INITIALIZE BEFORE CALLING */
-               unsigned int    capabilities;   /* To be defined later */
-               int             dev_type;
-               int             dummies[18];    /* Reserve space */
-       };
-
-/********************************************
- * ioctl commands for the /dev/midi##
- */
-typedef struct {
-               unsigned char cmd;
-               char nr_args, nr_returns;
-               unsigned char data[30];
-       } mpu_command_rec;
-
-#define SNDCTL_MIDI_PRETIME            _SIOWR('m', 0, int)
-#define SNDCTL_MIDI_MPUMODE            _SIOWR('m', 1, int)
-#define SNDCTL_MIDI_MPUCMD             _SIOWR('m', 2, mpu_command_rec)
-
-/********************************************
- * IOCTL commands for /dev/dsp and /dev/audio
- */
-
-#define SNDCTL_DSP_RESET               _SIO  ('P', 0)
-#define SNDCTL_DSP_SYNC                        _SIO  ('P', 1)
-#define SNDCTL_DSP_SPEED               _SIOWR('P', 2, int)
-#define SNDCTL_DSP_STEREO              _SIOWR('P', 3, int)
-#define SNDCTL_DSP_GETBLKSIZE          _SIOWR('P', 4, int)
-#define SNDCTL_DSP_SAMPLESIZE          SNDCTL_DSP_SETFMT
-#define SNDCTL_DSP_CHANNELS            _SIOWR('P', 6, int)
-#define SOUND_PCM_WRITE_CHANNELS       SNDCTL_DSP_CHANNELS
-#define SOUND_PCM_WRITE_FILTER         _SIOWR('P', 7, int)
-#define SNDCTL_DSP_POST                        _SIO  ('P', 8)
-#define SNDCTL_DSP_SUBDIVIDE           _SIOWR('P', 9, int)
-#define SNDCTL_DSP_SETFRAGMENT         _SIOWR('P',10, int)
-
-/*     Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
-#define SNDCTL_DSP_GETFMTS             _SIOR ('P',11, int) /* Returns a mask */
-#define SNDCTL_DSP_SETFMT              _SIOWR('P',5, int) /* Selects ONE fmt*/
-#      define AFMT_QUERY               0x00000000      /* Return current fmt */
-#      define AFMT_MU_LAW              0x00000001
-#      define AFMT_A_LAW               0x00000002
-#      define AFMT_IMA_ADPCM           0x00000004
-#      define AFMT_U8                  0x00000008
-#      define AFMT_S16_LE              0x00000010      /* Little endian signed 16*/
-#      define AFMT_S16_BE              0x00000020      /* Big endian signed 16 */
-#      define AFMT_S8                  0x00000040
-#      define AFMT_U16_LE              0x00000080      /* Little endian U16 */
-#      define AFMT_U16_BE              0x00000100      /* Big endian U16 */
-#      define AFMT_MPEG                0x00000200      /* MPEG (2) audio */
-#      define AFMT_AC3         0x00000400      /* Dolby Digital AC3 */
-
-/*
- * Buffer status queries.
- */
-typedef struct audio_buf_info {
-                       int fragments;  /* # of available fragments (partially usend ones not counted) */
-                       int fragstotal; /* Total # of fragments allocated */
-                       int fragsize;   /* Size of a fragment in bytes */
-
-                       int bytes;      /* Available space in bytes (includes partially used fragments) */
-                       /* Note! 'bytes' could be more than fragments*fragsize */
-               } audio_buf_info;
-
-#define SNDCTL_DSP_GETOSPACE           _SIOR ('P',12, audio_buf_info)
-#define SNDCTL_DSP_GETISPACE           _SIOR ('P',13, audio_buf_info)
-#define SNDCTL_DSP_NONBLOCK            _SIO  ('P',14)
-#define SNDCTL_DSP_GETCAPS             _SIOR ('P',15, int)
-#      define DSP_CAP_REVISION         0x000000ff      /* Bits for revision level (0 to 255) */
-#      define DSP_CAP_DUPLEX           0x00000100      /* Full duplex record/playback */
-#      define DSP_CAP_REALTIME         0x00000200      /* Real time capability */
-#      define DSP_CAP_BATCH            0x00000400      /* Device has some kind of */
-                                                       /* internal buffers which may */
-                                                       /* cause some delays and */
-                                                       /* decrease precision of timing */
-#      define DSP_CAP_COPROC           0x00000800      /* Has a coprocessor */
-                                                       /* Sometimes it's a DSP */
-                                                       /* but usually not */
-#      define DSP_CAP_TRIGGER          0x00001000      /* Supports SETTRIGGER */
-#      define DSP_CAP_MMAP             0x00002000      /* Supports mmap() */
-#      define DSP_CAP_MULTI            0x00004000      /* support multiple open */
-#      define DSP_CAP_BIND             0x00008000      /* channel binding to front/rear/cneter/lfe */
-
-
-#define SNDCTL_DSP_GETTRIGGER          _SIOR ('P',16, int)
-#define SNDCTL_DSP_SETTRIGGER          _SIOW ('P',16, int)
-#      define PCM_ENABLE_INPUT         0x00000001
-#      define PCM_ENABLE_OUTPUT                0x00000002
-
-typedef struct count_info {
-               int bytes;      /* Total # of bytes processed */
-               int blocks;     /* # of fragment transitions since last time */
-               int ptr;        /* Current DMA pointer value */
-       } count_info;
-
-#define SNDCTL_DSP_GETIPTR             _SIOR ('P',17, count_info)
-#define SNDCTL_DSP_GETOPTR             _SIOR ('P',18, count_info)
-
-typedef struct buffmem_desc {
-               unsigned *buffer;
-               int size;
-       } buffmem_desc;
-#define SNDCTL_DSP_MAPINBUF            _SIOR ('P', 19, buffmem_desc)
-#define SNDCTL_DSP_MAPOUTBUF           _SIOR ('P', 20, buffmem_desc)
-#define SNDCTL_DSP_SETSYNCRO           _SIO  ('P', 21)
-#define SNDCTL_DSP_SETDUPLEX           _SIO  ('P', 22)
-#define SNDCTL_DSP_GETODELAY           _SIOR ('P', 23, int)
-
-#define SNDCTL_DSP_GETCHANNELMASK              _SIOWR('P', 64, int)
-#define SNDCTL_DSP_BIND_CHANNEL                _SIOWR('P', 65, int)
-#      define DSP_BIND_QUERY           0x00000000
-#      define DSP_BIND_FRONT           0x00000001
-#      define DSP_BIND_SURR            0x00000002
-#      define DSP_BIND_CENTER_LFE      0x00000004
-#      define DSP_BIND_HANDSET         0x00000008
-#      define DSP_BIND_MIC             0x00000010
-#      define DSP_BIND_MODEM1          0x00000020
-#      define DSP_BIND_MODEM2          0x00000040
-#      define DSP_BIND_I2S             0x00000080
-#      define DSP_BIND_SPDIF           0x00000100
-
-#define SNDCTL_DSP_SETSPDIF            _SIOW ('P', 66, int)
-#define SNDCTL_DSP_GETSPDIF            _SIOR ('P', 67, int)
-#      define SPDIF_PRO        0x0001
-#      define SPDIF_N_AUD      0x0002
-#      define SPDIF_COPY       0x0004
-#      define SPDIF_PRE        0x0008
-#      define SPDIF_CC         0x07f0
-#      define SPDIF_L          0x0800
-#      define SPDIF_DRS        0x4000
-#      define SPDIF_V          0x8000
-
-/*
- * Application's profile defines the way how playback underrun situations should be handled.
- * 
- *     APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
- *     playback buffer whenever an underrun occurs. This consumes some time
- *     prevents looping the existing buffer.
- *     APF_CPUINTENS is intended to be set by CPU intensive applications which
- *     are likely to run out of time occasionally. In this mode the buffer cleanup is
- *     disabled which saves CPU time but also let's the previous buffer content to
- *     be played during the "pause" after the underrun.
- */
-#define SNDCTL_DSP_PROFILE             _SIOW ('P', 23, int)
-#define          APF_NORMAL    0       /* Normal applications */
-#define          APF_NETWORK   1       /* Underruns probably caused by an "external" delay */
-#define   APF_CPUINTENS 2      /* Underruns probably caused by "overheating" the CPU */
-
-#define SOUND_PCM_READ_RATE            _SIOR ('P', 2, int)
-#define SOUND_PCM_READ_CHANNELS                _SIOR ('P', 6, int)
-#define SOUND_PCM_READ_BITS            _SIOR ('P', 5, int)
-#define SOUND_PCM_READ_FILTER          _SIOR ('P', 7, int)
-
-/* Some alias names */
-#define SOUND_PCM_WRITE_BITS           SNDCTL_DSP_SETFMT
-#define SOUND_PCM_WRITE_RATE           SNDCTL_DSP_SPEED
-#define SOUND_PCM_POST                 SNDCTL_DSP_POST
-#define SOUND_PCM_RESET                        SNDCTL_DSP_RESET
-#define SOUND_PCM_SYNC                 SNDCTL_DSP_SYNC
-#define SOUND_PCM_SUBDIVIDE            SNDCTL_DSP_SUBDIVIDE
-#define SOUND_PCM_SETFRAGMENT          SNDCTL_DSP_SETFRAGMENT
-#define SOUND_PCM_GETFMTS              SNDCTL_DSP_GETFMTS
-#define SOUND_PCM_SETFMT               SNDCTL_DSP_SETFMT
-#define SOUND_PCM_GETOSPACE            SNDCTL_DSP_GETOSPACE
-#define SOUND_PCM_GETISPACE            SNDCTL_DSP_GETISPACE
-#define SOUND_PCM_NONBLOCK             SNDCTL_DSP_NONBLOCK
-#define SOUND_PCM_GETCAPS              SNDCTL_DSP_GETCAPS
-#define SOUND_PCM_GETTRIGGER           SNDCTL_DSP_GETTRIGGER
-#define SOUND_PCM_SETTRIGGER           SNDCTL_DSP_SETTRIGGER
-#define SOUND_PCM_SETSYNCRO            SNDCTL_DSP_SETSYNCRO
-#define SOUND_PCM_GETIPTR              SNDCTL_DSP_GETIPTR
-#define SOUND_PCM_GETOPTR              SNDCTL_DSP_GETOPTR
-#define SOUND_PCM_MAPINBUF             SNDCTL_DSP_MAPINBUF
-#define SOUND_PCM_MAPOUTBUF            SNDCTL_DSP_MAPOUTBUF
-
-/*
- * ioctl calls to be used in communication with coprocessors and
- * DSP chips.
- */
-
-typedef struct copr_buffer {
-               int command;    /* Set to 0 if not used */
-               int flags;
-#define CPF_NONE               0x0000
-#define CPF_FIRST              0x0001  /* First block */
-#define CPF_LAST               0x0002  /* Last block */
-               int len;
-               int offs;       /* If required by the device (0 if not used) */
-
-               unsigned char data[4000]; /* NOTE! 4000 is not 4k */
-       } copr_buffer;
-
-typedef struct copr_debug_buf {
-               int command;    /* Used internally. Set to 0 */
-               int parm1;
-               int parm2;
-               int flags;      
-               int len;        /* Length of data in bytes */
-       } copr_debug_buf;
-
-typedef struct copr_msg {
-               int len;
-               unsigned char data[4000];
-       } copr_msg;
-
-#define SNDCTL_COPR_RESET             _SIO  ('C',  0)
-#define SNDCTL_COPR_LOAD             _SIOWR('C',  1, copr_buffer)
-#define SNDCTL_COPR_RDATA            _SIOWR('C',  2, copr_debug_buf)
-#define SNDCTL_COPR_RCODE            _SIOWR('C',  3, copr_debug_buf)
-#define SNDCTL_COPR_WDATA            _SIOW ('C',  4, copr_debug_buf)
-#define SNDCTL_COPR_WCODE            _SIOW ('C',  5, copr_debug_buf)
-#define SNDCTL_COPR_RUN                      _SIOWR('C',  6, copr_debug_buf)
-#define SNDCTL_COPR_HALT             _SIOWR('C',  7, copr_debug_buf)
-#define SNDCTL_COPR_SENDMSG          _SIOWR('C',  8, copr_msg)
-#define SNDCTL_COPR_RCVMSG           _SIOR ('C',  9, copr_msg)
-
-/*********************************************
- * IOCTL commands for /dev/mixer
- */
-       
-/* 
- * Mixer devices
- *
- * There can be up to 20 different analog mixer channels. The
- * SOUND_MIXER_NRDEVICES gives the currently supported maximum. 
- * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
- * the devices supported by the particular mixer.
- */
-
-#define SOUND_MIXER_NRDEVICES  25
-#define SOUND_MIXER_VOLUME     0
-#define SOUND_MIXER_BASS       1
-#define SOUND_MIXER_TREBLE     2
-#define SOUND_MIXER_SYNTH      3
-#define SOUND_MIXER_PCM                4
-#define SOUND_MIXER_SPEAKER    5
-#define SOUND_MIXER_LINE       6
-#define SOUND_MIXER_MIC                7
-#define SOUND_MIXER_CD         8
-#define SOUND_MIXER_IMIX       9       /*  Recording monitor  */
-#define SOUND_MIXER_ALTPCM     10
-#define SOUND_MIXER_RECLEV     11      /* Recording level */
-#define SOUND_MIXER_IGAIN      12      /* Input gain */
-#define SOUND_MIXER_OGAIN      13      /* Output gain */
-/* 
- * The AD1848 codec and compatibles have three line level inputs
- * (line, aux1 and aux2). Since each card manufacturer have assigned
- * different meanings to these inputs, it's inpractical to assign
- * specific meanings (line, cd, synth etc.) to them.
- */
-#define SOUND_MIXER_LINE1      14      /* Input source 1  (aux1) */
-#define SOUND_MIXER_LINE2      15      /* Input source 2  (aux2) */
-#define SOUND_MIXER_LINE3      16      /* Input source 3  (line) */
-#define SOUND_MIXER_DIGITAL1   17      /* Digital (input) 1 */
-#define SOUND_MIXER_DIGITAL2   18      /* Digital (input) 2 */
-#define SOUND_MIXER_DIGITAL3   19      /* Digital (input) 3 */
-#define SOUND_MIXER_PHONEIN    20      /* Phone input */
-#define SOUND_MIXER_PHONEOUT   21      /* Phone output */
-#define SOUND_MIXER_VIDEO      22      /* Video/TV (audio) in */
-#define SOUND_MIXER_RADIO      23      /* Radio in */
-#define SOUND_MIXER_MONITOR    24      /* Monitor (usually mic) volume */
-
-/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
-/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
-#define SOUND_ONOFF_MIN                28
-#define SOUND_ONOFF_MAX                30
-
-/* Note!       Number 31 cannot be used since the sign bit is reserved */
-#define SOUND_MIXER_NONE       31
-
-/*
- * The following unsupported macros are no longer functional.
- * Use SOUND_MIXER_PRIVATE# macros in future.
- */
-#define SOUND_MIXER_ENHANCE    SOUND_MIXER_NONE
-#define SOUND_MIXER_MUTE       SOUND_MIXER_NONE
-#define SOUND_MIXER_LOUD       SOUND_MIXER_NONE
-
-
-#define SOUND_DEVICE_LABELS    {"Vol  ", "Bass ", "Trebl", "Synth", "Pcm  ", "Spkr ", "Line ", \
-                                "Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain", \
-                                "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
-                                "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
-
-#define SOUND_DEVICE_NAMES     {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
-                                "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
-                                "line1", "line2", "line3", "dig1", "dig2", "dig3", \
-                                "phin", "phout", "video", "radio", "monitor"}
-
-/*     Device bitmask identifiers      */
-
-#define SOUND_MIXER_RECSRC     0xff    /* Arg contains a bit for each recording source */
-#define SOUND_MIXER_DEVMASK    0xfe    /* Arg contains a bit for each supported device */
-#define SOUND_MIXER_RECMASK    0xfd    /* Arg contains a bit for each supported recording source */
-#define SOUND_MIXER_CAPS       0xfc
-#      define SOUND_CAP_EXCL_INPUT     0x00000001      /* Only one recording source at a time */
-#define SOUND_MIXER_STEREODEVS 0xfb    /* Mixer channels supporting stereo */
-#define SOUND_MIXER_OUTSRC     0xfa    /* Arg contains a bit for each input source to output */
-#define SOUND_MIXER_OUTMASK    0xf9    /* Arg contains a bit for each supported input source to output */
-
-/*     Device mask bits        */
-
-#define SOUND_MASK_VOLUME      (1 << SOUND_MIXER_VOLUME)
-#define SOUND_MASK_BASS                (1 << SOUND_MIXER_BASS)
-#define SOUND_MASK_TREBLE      (1 << SOUND_MIXER_TREBLE)
-#define SOUND_MASK_SYNTH       (1 << SOUND_MIXER_SYNTH)
-#define SOUND_MASK_PCM         (1 << SOUND_MIXER_PCM)
-#define SOUND_MASK_SPEAKER     (1 << SOUND_MIXER_SPEAKER)
-#define SOUND_MASK_LINE                (1 << SOUND_MIXER_LINE)
-#define SOUND_MASK_MIC         (1 << SOUND_MIXER_MIC)
-#define SOUND_MASK_CD          (1 << SOUND_MIXER_CD)
-#define SOUND_MASK_IMIX                (1 << SOUND_MIXER_IMIX)
-#define SOUND_MASK_ALTPCM      (1 << SOUND_MIXER_ALTPCM)
-#define SOUND_MASK_RECLEV      (1 << SOUND_MIXER_RECLEV)
-#define SOUND_MASK_IGAIN       (1 << SOUND_MIXER_IGAIN)
-#define SOUND_MASK_OGAIN       (1 << SOUND_MIXER_OGAIN)
-#define SOUND_MASK_LINE1       (1 << SOUND_MIXER_LINE1)
-#define SOUND_MASK_LINE2       (1 << SOUND_MIXER_LINE2)
-#define SOUND_MASK_LINE3       (1 << SOUND_MIXER_LINE3)
-#define SOUND_MASK_DIGITAL1    (1 << SOUND_MIXER_DIGITAL1)
-#define SOUND_MASK_DIGITAL2    (1 << SOUND_MIXER_DIGITAL2)
-#define SOUND_MASK_DIGITAL3    (1 << SOUND_MIXER_DIGITAL3)
-#define SOUND_MASK_PHONEIN     (1 << SOUND_MIXER_PHONEIN)
-#define SOUND_MASK_PHONEOUT    (1 << SOUND_MIXER_PHONEOUT)
-#define SOUND_MASK_RADIO       (1 << SOUND_MIXER_RADIO)
-#define SOUND_MASK_VIDEO       (1 << SOUND_MIXER_VIDEO)
-#define SOUND_MASK_MONITOR     (1 << SOUND_MIXER_MONITOR)
-
-/* Obsolete macros */
-#define SOUND_MASK_MUTE                (1 << SOUND_MIXER_MUTE)
-#define SOUND_MASK_ENHANCE     (1 << SOUND_MIXER_ENHANCE)
-#define SOUND_MASK_LOUD                (1 << SOUND_MIXER_LOUD)
-
-#define MIXER_READ(dev)                _SIOR('M', dev, int)
-#define SOUND_MIXER_READ_VOLUME                MIXER_READ(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_READ_BASS          MIXER_READ(SOUND_MIXER_BASS)
-#define SOUND_MIXER_READ_TREBLE                MIXER_READ(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_READ_SYNTH         MIXER_READ(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_READ_PCM           MIXER_READ(SOUND_MIXER_PCM)
-#define SOUND_MIXER_READ_SPEAKER       MIXER_READ(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_READ_LINE          MIXER_READ(SOUND_MIXER_LINE)
-#define SOUND_MIXER_READ_MIC           MIXER_READ(SOUND_MIXER_MIC)
-#define SOUND_MIXER_READ_CD            MIXER_READ(SOUND_MIXER_CD)
-#define SOUND_MIXER_READ_IMIX          MIXER_READ(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_READ_ALTPCM                MIXER_READ(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_READ_RECLEV                MIXER_READ(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_READ_IGAIN         MIXER_READ(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_READ_OGAIN         MIXER_READ(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_READ_LINE1         MIXER_READ(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_READ_LINE2         MIXER_READ(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_READ_LINE3         MIXER_READ(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_READ_MUTE          MIXER_READ(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_READ_ENHANCE       MIXER_READ(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_READ_LOUD          MIXER_READ(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_READ_RECSRC                MIXER_READ(SOUND_MIXER_RECSRC)
-#define SOUND_MIXER_READ_DEVMASK       MIXER_READ(SOUND_MIXER_DEVMASK)
-#define SOUND_MIXER_READ_RECMASK       MIXER_READ(SOUND_MIXER_RECMASK)
-#define SOUND_MIXER_READ_STEREODEVS    MIXER_READ(SOUND_MIXER_STEREODEVS)
-#define SOUND_MIXER_READ_CAPS          MIXER_READ(SOUND_MIXER_CAPS)
-
-#define MIXER_WRITE(dev)               _SIOWR('M', dev, int)
-#define SOUND_MIXER_WRITE_VOLUME       MIXER_WRITE(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_WRITE_BASS         MIXER_WRITE(SOUND_MIXER_BASS)
-#define SOUND_MIXER_WRITE_TREBLE       MIXER_WRITE(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_WRITE_SYNTH                MIXER_WRITE(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_WRITE_PCM          MIXER_WRITE(SOUND_MIXER_PCM)
-#define SOUND_MIXER_WRITE_SPEAKER      MIXER_WRITE(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_WRITE_LINE         MIXER_WRITE(SOUND_MIXER_LINE)
-#define SOUND_MIXER_WRITE_MIC          MIXER_WRITE(SOUND_MIXER_MIC)
-#define SOUND_MIXER_WRITE_CD           MIXER_WRITE(SOUND_MIXER_CD)
-#define SOUND_MIXER_WRITE_IMIX         MIXER_WRITE(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_WRITE_ALTPCM       MIXER_WRITE(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_WRITE_RECLEV       MIXER_WRITE(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_WRITE_IGAIN                MIXER_WRITE(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_WRITE_OGAIN                MIXER_WRITE(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_WRITE_LINE1                MIXER_WRITE(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_WRITE_LINE2                MIXER_WRITE(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_WRITE_LINE3                MIXER_WRITE(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_WRITE_MUTE         MIXER_WRITE(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_WRITE_ENHANCE      MIXER_WRITE(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_WRITE_LOUD         MIXER_WRITE(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_WRITE_RECSRC       MIXER_WRITE(SOUND_MIXER_RECSRC)
-
-typedef struct mixer_info
-{
-  char id[16];
-  char name[32];
-  int  modify_counter;
-  int fillers[10];
-} mixer_info;
-
-typedef struct _old_mixer_info /* Obsolete */
-{
-  char id[16];
-  char name[32];
-} _old_mixer_info;
-
-#define SOUND_MIXER_INFO               _SIOR ('M', 101, mixer_info)
-#define SOUND_OLD_MIXER_INFO           _SIOR ('M', 101, _old_mixer_info)
-
-/*
- * A mechanism for accessing "proprietary" mixer features. This method
- * permits passing 128 bytes of arbitrary data between a mixer application
- * and the mixer driver. Interpretation of the record is defined by
- * the particular mixer driver.
- */
-typedef unsigned char mixer_record[128];
-
-#define SOUND_MIXER_ACCESS             _SIOWR('M', 102, mixer_record)
-
-/*
- * Two ioctls for special souncard function
- */
-#define SOUND_MIXER_AGC  _SIOWR('M', 103, int)
-#define SOUND_MIXER_3DSE  _SIOWR('M', 104, int)
-
-/*
- * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
- * These features can be used when accessing device specific features.
- */
-#define SOUND_MIXER_PRIVATE1           _SIOWR('M', 111, int)
-#define SOUND_MIXER_PRIVATE2           _SIOWR('M', 112, int)
-#define SOUND_MIXER_PRIVATE3           _SIOWR('M', 113, int)
-#define SOUND_MIXER_PRIVATE4           _SIOWR('M', 114, int)
-#define SOUND_MIXER_PRIVATE5           _SIOWR('M', 115, int)
-
-/*
- * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
- * for querying current mixer settings from the driver and for loading
- * default volume settings _prior_ activating the mixer (loading
- * doesn't affect current state of the mixer hardware). These calls
- * are for internal use only.
- */
-
-typedef struct mixer_vol_table {
-  int num;     /* Index to volume table */
-  char name[32];
-  int levels[32];
-} mixer_vol_table;
-
-#define SOUND_MIXER_GETLEVELS          _SIOWR('M', 116, mixer_vol_table)
-#define SOUND_MIXER_SETLEVELS          _SIOWR('M', 117, mixer_vol_table)
-
-/* 
- * An ioctl for identifying the driver version. It will return value
- * of the SOUND_VERSION macro used when compiling the driver.
- * This call was introduced in OSS version 3.6 and it will not work
- * with earlier versions (returns EINVAL).
- */
-#define OSS_GETVERSION                 _SIOR ('M', 118, int)
-
-/*
- * Level 2 event types for /dev/sequencer
- */
-
-/*
- * The 4 most significant bits of byte 0 specify the class of
- * the event: 
- *
- *     0x8X = system level events,
- *     0x9X = device/port specific events, event[1] = device/port,
- *             The last 4 bits give the subtype:
- *                     0x02    = Channel event (event[3] = chn).
- *                     0x01    = note event (event[4] = note).
- *                     (0x01 is not used alone but always with bit 0x02).
- *            event[2] = MIDI message code (0x80=note off etc.)
- *
- */
-
-#define EV_SEQ_LOCAL           0x80
-#define EV_TIMING              0x81
-#define EV_CHN_COMMON          0x92
-#define EV_CHN_VOICE           0x93
-#define EV_SYSEX               0x94
-/*
- * Event types 200 to 220 are reserved for application use.
- * These numbers will not be used by the driver.
- */
-
-/*
- * Events for event type EV_CHN_VOICE
- */
-
-#define MIDI_NOTEOFF           0x80
-#define MIDI_NOTEON            0x90
-#define MIDI_KEY_PRESSURE      0xA0
-
-/*
- * Events for event type EV_CHN_COMMON
- */
-
-#define MIDI_CTL_CHANGE                0xB0
-#define MIDI_PGM_CHANGE                0xC0
-#define MIDI_CHN_PRESSURE      0xD0
-#define MIDI_PITCH_BEND                0xE0
-
-#define MIDI_SYSTEM_PREFIX     0xF0
-
-/*
- * Timer event types
- */
-#define TMR_WAIT_REL           1       /* Time relative to the prev time */
-#define TMR_WAIT_ABS           2       /* Absolute time since TMR_START */
-#define TMR_STOP               3
-#define TMR_START              4
-#define TMR_CONTINUE           5
-#define TMR_TEMPO              6
-#define TMR_ECHO               8
-#define TMR_CLOCK              9       /* MIDI clock */
-#define TMR_SPP                        10      /* Song position pointer */
-#define TMR_TIMESIG            11      /* Time signature */
-
-/*
- *     Local event types
- */
-#define LOCL_STARTAUDIO                1
-
-#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
-/*
- *     Some convenience macros to simplify programming of the
- *     /dev/sequencer interface
- *
- *     This is a legacy interface for applications written against
- *     the OSSlib-3.8 style interface. It is no longer possible
- *     to actually link against OSSlib with this header, but we
- *     still provide these macros for programs using them.
- *
- *     If you want to use OSSlib, it is recommended that you get
- *     the GPL version of OSS-4.x and build against that version
- *     of the header.
- *
- *     We redefine the extern keyword so that make headers_check
- *     does not complain about SEQ_USE_EXTBUF.
- */
-#define SEQ_DECLAREBUF()               SEQ_USE_EXTBUF()
-
-void seqbuf_dump(void);        /* This function must be provided by programs */
-
-#define SEQ_PM_DEFINES int __foo_bar___
-
-#define SEQ_LOAD_GMINSTR(dev, instr)
-#define SEQ_LOAD_GMDRUM(dev, drum)
-
-#define _SEQ_EXTERN extern
-#define SEQ_USE_EXTBUF() \
-               _SEQ_EXTERN unsigned char _seqbuf[]; \
-               _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
-
-#ifndef USE_SIMPLE_MACROS
-/* Sample seqbuf_dump() implementation:
- *
- *     SEQ_DEFINEBUF (2048);   -- Defines a buffer for 2048 bytes
- *
- *     int seqfd;              -- The file descriptor for /dev/sequencer.
- *
- *     void
- *     seqbuf_dump ()
- *     {
- *       if (_seqbufptr)
- *         if (write (seqfd, _seqbuf, _seqbufptr) == -1)
- *           {
- *             perror ("write /dev/sequencer");
- *             exit (-1);
- *           }
- *       _seqbufptr = 0;
- *     }
- */
-
-#define SEQ_DEFINEBUF(len)             unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
-#define _SEQ_NEEDBUF(len)              if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
-#define _SEQ_ADVBUF(len)               _seqbufptr += len
-#define SEQ_DUMPBUF                    seqbuf_dump
-#else
-/*
- * This variation of the sequencer macros is used just to format one event
- * using fixed buffer.
- * 
- * The program using the macro library must define the following macros before
- * using this library.
- *
- * #define _seqbuf              name of the buffer (unsigned char[]) 
- * #define _SEQ_ADVBUF(len)     If the applic needs to know the exact
- *                              size of the event, this macro can be used.
- *                              Otherwise this must be defined as empty.
- * #define _seqbufptr           Define the name of index variable or 0 if
- *                              not required. 
- */
-#define _SEQ_NEEDBUF(len)      /* empty */
-#endif
-
-#define SEQ_VOLUME_MODE(dev, mode)     {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
-                                       _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
-                                       _seqbuf[_seqbufptr+2] = (dev);\
-                                       _seqbuf[_seqbufptr+3] = (mode);\
-                                       _seqbuf[_seqbufptr+4] = 0;\
-                                       _seqbuf[_seqbufptr+5] = 0;\
-                                       _seqbuf[_seqbufptr+6] = 0;\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-
-/*
- * Midi voice messages
- */
-
-#define _CHN_VOICE(dev, event, chn, note, parm) \
-                                       {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       _seqbuf[_seqbufptr+2] = (event);\
-                                       _seqbuf[_seqbufptr+3] = (chn);\
-                                       _seqbuf[_seqbufptr+4] = (note);\
-                                       _seqbuf[_seqbufptr+5] = (parm);\
-                                       _seqbuf[_seqbufptr+6] = (0);\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_START_NOTE(dev, chn, note, vol) \
-               _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
-
-#define SEQ_STOP_NOTE(dev, chn, note, vol) \
-               _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
-
-#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
-               _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
-
-/*
- * Midi channel messages
- */
-
-#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
-                                       {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       _seqbuf[_seqbufptr+2] = (event);\
-                                       _seqbuf[_seqbufptr+3] = (chn);\
-                                       _seqbuf[_seqbufptr+4] = (p1);\
-                                       _seqbuf[_seqbufptr+5] = (p2);\
-                                       *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
-                                       _SEQ_ADVBUF(8);}
-/*
- * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
- * sending any MIDI bytes but it's absolutely not possible. Trying to do
- * so _will_ cause problems with MPU401 intelligent mode).
- *
- * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be 
- * sent by calling SEQ_SYSEX() several times (there must be no other events
- * between them). First sysex fragment must have 0xf0 in the first byte
- * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
- * between these sysex start and end markers cannot be larger than 0x7f. Also
- * lengths of each fragments (except the last one) must be 6.
- *
- * Breaking the above rules may work with some MIDI ports but is likely to
- * cause fatal problems with some other devices (such as MPU401).
- */
-#define SEQ_SYSEX(dev, buf, len) \
-                                       {int ii, ll=(len); \
-                                        unsigned char *bufp=buf;\
-                                        if (ll>6)ll=6;\
-                                       _SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = EV_SYSEX;\
-                                       _seqbuf[_seqbufptr+1] = (dev);\
-                                       for(ii=0;ii<ll;ii++)\
-                                          _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
-                                       for(ii=ll;ii<6;ii++)\
-                                          _seqbuf[_seqbufptr+ii+2] = 0xff;\
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
-               _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
-
-#define SEQ_SET_PATCH SEQ_PGM_CHANGE
-#define SEQ_PGM_CHANGE(dev, chn, patch) \
-               _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
-
-#define SEQ_CONTROL(dev, chn, controller, value) \
-               _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
-
-#define SEQ_BENDER(dev, chn, value) \
-               _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
-
-
-#define SEQ_V2_X_CONTROL(dev, voice, controller, value)        {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
-                                       _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
-                                       _seqbuf[_seqbufptr+2] = (dev);\
-                                       _seqbuf[_seqbufptr+3] = (voice);\
-                                       _seqbuf[_seqbufptr+4] = (controller);\
-                                       _seqbuf[_seqbufptr+5] = ((value)&0xff);\
-                                       _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
-                                       _seqbuf[_seqbufptr+7] = 0;\
-                                       _SEQ_ADVBUF(8);}
-/*
- * The following 5 macros are incorrectly implemented and obsolete.
- * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
- */
-#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
-#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
-#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
-#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
-#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
-
-/*
- * Timing and synchronization macros
- */
-
-#define _TIMER_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr+0] = EV_TIMING; \
-                                       _seqbuf[_seqbufptr+1] = (ev); \
-                                       _seqbuf[_seqbufptr+2] = 0;\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_START_TIMER()              _TIMER_EVENT(TMR_START, 0)
-#define SEQ_STOP_TIMER()               _TIMER_EVENT(TMR_STOP, 0)
-#define SEQ_CONTINUE_TIMER()           _TIMER_EVENT(TMR_CONTINUE, 0)
-#define SEQ_WAIT_TIME(ticks)           _TIMER_EVENT(TMR_WAIT_ABS, ticks)
-#define SEQ_DELTA_TIME(ticks)          _TIMER_EVENT(TMR_WAIT_REL, ticks)
-#define SEQ_ECHO_BACK(key)             _TIMER_EVENT(TMR_ECHO, key)
-#define SEQ_SET_TEMPO(value)           _TIMER_EVENT(TMR_TEMPO, value)
-#define SEQ_SONGPOS(pos)               _TIMER_EVENT(TMR_SPP, pos)
-#define SEQ_TIME_SIGNATURE(sig)                _TIMER_EVENT(TMR_TIMESIG, sig)
-
-/*
- * Local control events
- */
-
-#define _LOCAL_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
-                                       _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
-                                       _seqbuf[_seqbufptr+1] = (ev); \
-                                       _seqbuf[_seqbufptr+2] = 0;\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
-                                       _SEQ_ADVBUF(8);}
-
-#define SEQ_PLAYAUDIO(devmask)         _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
-/*
- * Events for the level 1 interface only 
- */
-
-#define SEQ_MIDIOUT(device, byte)      {_SEQ_NEEDBUF(4);\
-                                       _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
-                                       _seqbuf[_seqbufptr+1] = (byte);\
-                                       _seqbuf[_seqbufptr+2] = (device);\
-                                       _seqbuf[_seqbufptr+3] = 0;\
-                                       _SEQ_ADVBUF(4);}
-
-/*
- * Patch loading.
- */
-#define SEQ_WRPATCH(patchx, len) \
-               {if (_seqbufptr) SEQ_DUMPBUF();\
-                if (write(seqfd, (char*)(patchx), len)==-1) \
-                   perror("Write patch: /dev/sequencer");}
-#define SEQ_WRPATCH2(patchx, len) \
-               (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
-
-#endif
 #endif
index d375a082986ee2186e50d1717c36a1fd70225e1a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-header-y += spidev.h
index 46132409a3f73b3d57c2c150fec9b46039150b96..075cb0c7eb2ade30e936d8a5e961732ea1faf759 100644 (file)
@@ -1,52 +1,10 @@
 #ifndef _LINUX_STAT_H
 #define _LINUX_STAT_H
 
-#ifdef __KERNEL__
 
 #include <asm/stat.h>
+#include <uapi/linux/stat.h>
 
-#endif
-
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
-
-#define S_IFMT  00170000
-#define S_IFSOCK 0140000
-#define S_IFLNK         0120000
-#define S_IFREG  0100000
-#define S_IFBLK  0060000
-#define S_IFDIR  0040000
-#define S_IFCHR  0020000
-#define S_IFIFO  0010000
-#define S_ISUID  0004000
-#define S_ISGID  0002000
-#define S_ISVTX  0001000
-
-#define S_ISLNK(m)     (((m) & S_IFMT) == S_IFLNK)
-#define S_ISREG(m)     (((m) & S_IFMT) == S_IFREG)
-#define S_ISDIR(m)     (((m) & S_IFMT) == S_IFDIR)
-#define S_ISCHR(m)     (((m) & S_IFMT) == S_IFCHR)
-#define S_ISBLK(m)     (((m) & S_IFMT) == S_IFBLK)
-#define S_ISFIFO(m)    (((m) & S_IFMT) == S_IFIFO)
-#define S_ISSOCK(m)    (((m) & S_IFMT) == S_IFSOCK)
-
-#define S_IRWXU 00700
-#define S_IRUSR 00400
-#define S_IWUSR 00200
-#define S_IXUSR 00100
-
-#define S_IRWXG 00070
-#define S_IRGRP 00040
-#define S_IWGRP 00020
-#define S_IXGRP 00010
-
-#define S_IRWXO 00007
-#define S_IROTH 00004
-#define S_IWOTH 00002
-#define S_IXOTH 00001
-
-#endif
-
-#ifdef __KERNEL__
 #define S_IRWXUGO      (S_IRWXU|S_IRWXG|S_IRWXO)
 #define S_IALLUGO      (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
 #define S_IRUGO                (S_IRUSR|S_IRGRP|S_IROTH)
@@ -77,5 +35,3 @@ struct kstat {
 };
 
 #endif
-
-#endif
index 1747b6787b9e90375827a9af75148bf420caf386..f4aec0e75c3a268cebeecd2dcdc43fc68126a27a 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _LINUX_STDDEF_H
 #define _LINUX_STDDEF_H
 
-#include <linux/compiler.h>
+#include <uapi/linux/stddef.h>
 
-#ifdef __KERNEL__
 
 #undef NULL
 #define NULL ((void *)0)
@@ -19,6 +18,4 @@ enum {
 #else
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #endif
-#endif /* __KERNEL__ */
-
 #endif
index b9178812d9df5f703b2e2126f1a4df2669f083cc..630125818ca8177c5a90a8600e20cfc053e9fca6 100644 (file)
@@ -1,16 +1,12 @@
 #ifndef _LINUX_STRING_H_
 #define _LINUX_STRING_H_
 
-/* We don't want strings.h stuff being used by user stuff by accident */
-
-#ifndef __KERNEL__
-#include <string.h>
-#else
 
 #include <linux/compiler.h>    /* for inline */
 #include <linux/types.h>       /* for size_t */
 #include <linux/stddef.h>      /* for NULL */
 #include <stdarg.h>
+#include <uapi/linux/string.h>
 
 extern char *strndup_user(const char __user *, long);
 extern void *memdup_user(const void __user *, size_t);
@@ -147,5 +143,4 @@ static inline bool strstarts(const char *str, const char *prefix)
 
 extern size_t memweight(const void *ptr, size_t bytes);
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_STRING_H_ */
index ea0c02fd5163c2b865d2041cc0a2f5e43e7c7743..9ad3c60f6cae7f24e4ca4aa9a3e842fd22cbc4ae 100644 (file)
@@ -1,284 +1,8 @@
 #ifndef _LINUX_SWAB_H
 #define _LINUX_SWAB_H
 
-#include <linux/types.h>
-#include <linux/compiler.h>
-#include <asm/swab.h>
+#include <uapi/linux/swab.h>
 
-/*
- * casts are necessary for constants, because we never know how for sure
- * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
- */
-#define ___constant_swab16(x) ((__u16)(                                \
-       (((__u16)(x) & (__u16)0x00ffU) << 8) |                  \
-       (((__u16)(x) & (__u16)0xff00U) >> 8)))
-
-#define ___constant_swab32(x) ((__u32)(                                \
-       (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
-       (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
-       (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
-       (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
-
-#define ___constant_swab64(x) ((__u64)(                                \
-       (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) |   \
-       (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) |   \
-       (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) |   \
-       (((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) |   \
-       (((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) |   \
-       (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) |   \
-       (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) |   \
-       (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
-
-#define ___constant_swahw32(x) ((__u32)(                       \
-       (((__u32)(x) & (__u32)0x0000ffffUL) << 16) |            \
-       (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
-
-#define ___constant_swahb32(x) ((__u32)(                       \
-       (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) |             \
-       (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
-
-/*
- * Implement the following as inlines, but define the interface using
- * macros to allow constant folding when possible:
- * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
- */
-
-static inline __attribute_const__ __u16 __fswab16(__u16 val)
-{
-#ifdef __arch_swab16
-       return __arch_swab16(val);
-#else
-       return ___constant_swab16(val);
-#endif
-}
-
-static inline __attribute_const__ __u32 __fswab32(__u32 val)
-{
-#ifdef __arch_swab32
-       return __arch_swab32(val);
-#else
-       return ___constant_swab32(val);
-#endif
-}
-
-static inline __attribute_const__ __u64 __fswab64(__u64 val)
-{
-#ifdef __arch_swab64
-       return __arch_swab64(val);
-#elif defined(__SWAB_64_THRU_32__)
-       __u32 h = val >> 32;
-       __u32 l = val & ((1ULL << 32) - 1);
-       return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
-#else
-       return ___constant_swab64(val);
-#endif
-}
-
-static inline __attribute_const__ __u32 __fswahw32(__u32 val)
-{
-#ifdef __arch_swahw32
-       return __arch_swahw32(val);
-#else
-       return ___constant_swahw32(val);
-#endif
-}
-
-static inline __attribute_const__ __u32 __fswahb32(__u32 val)
-{
-#ifdef __arch_swahb32
-       return __arch_swahb32(val);
-#else
-       return ___constant_swahb32(val);
-#endif
-}
-
-/**
- * __swab16 - return a byteswapped 16-bit value
- * @x: value to byteswap
- */
-#define __swab16(x)                            \
-       (__builtin_constant_p((__u16)(x)) ?     \
-       ___constant_swab16(x) :                 \
-       __fswab16(x))
-
-/**
- * __swab32 - return a byteswapped 32-bit value
- * @x: value to byteswap
- */
-#define __swab32(x)                            \
-       (__builtin_constant_p((__u32)(x)) ?     \
-       ___constant_swab32(x) :                 \
-       __fswab32(x))
-
-/**
- * __swab64 - return a byteswapped 64-bit value
- * @x: value to byteswap
- */
-#define __swab64(x)                            \
-       (__builtin_constant_p((__u64)(x)) ?     \
-       ___constant_swab64(x) :                 \
-       __fswab64(x))
-
-/**
- * __swahw32 - return a word-swapped 32-bit value
- * @x: value to wordswap
- *
- * __swahw32(0x12340000) is 0x00001234
- */
-#define __swahw32(x)                           \
-       (__builtin_constant_p((__u32)(x)) ?     \
-       ___constant_swahw32(x) :                \
-       __fswahw32(x))
-
-/**
- * __swahb32 - return a high and low byte-swapped 32-bit value
- * @x: value to byteswap
- *
- * __swahb32(0x12345678) is 0x34127856
- */
-#define __swahb32(x)                           \
-       (__builtin_constant_p((__u32)(x)) ?     \
-       ___constant_swahb32(x) :                \
-       __fswahb32(x))
-
-/**
- * __swab16p - return a byteswapped 16-bit value from a pointer
- * @p: pointer to a naturally-aligned 16-bit value
- */
-static inline __u16 __swab16p(const __u16 *p)
-{
-#ifdef __arch_swab16p
-       return __arch_swab16p(p);
-#else
-       return __swab16(*p);
-#endif
-}
-
-/**
- * __swab32p - return a byteswapped 32-bit value from a pointer
- * @p: pointer to a naturally-aligned 32-bit value
- */
-static inline __u32 __swab32p(const __u32 *p)
-{
-#ifdef __arch_swab32p
-       return __arch_swab32p(p);
-#else
-       return __swab32(*p);
-#endif
-}
-
-/**
- * __swab64p - return a byteswapped 64-bit value from a pointer
- * @p: pointer to a naturally-aligned 64-bit value
- */
-static inline __u64 __swab64p(const __u64 *p)
-{
-#ifdef __arch_swab64p
-       return __arch_swab64p(p);
-#else
-       return __swab64(*p);
-#endif
-}
-
-/**
- * __swahw32p - return a wordswapped 32-bit value from a pointer
- * @p: pointer to a naturally-aligned 32-bit value
- *
- * See __swahw32() for details of wordswapping.
- */
-static inline __u32 __swahw32p(const __u32 *p)
-{
-#ifdef __arch_swahw32p
-       return __arch_swahw32p(p);
-#else
-       return __swahw32(*p);
-#endif
-}
-
-/**
- * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
- * @p: pointer to a naturally-aligned 32-bit value
- *
- * See __swahb32() for details of high/low byteswapping.
- */
-static inline __u32 __swahb32p(const __u32 *p)
-{
-#ifdef __arch_swahb32p
-       return __arch_swahb32p(p);
-#else
-       return __swahb32(*p);
-#endif
-}
-
-/**
- * __swab16s - byteswap a 16-bit value in-place
- * @p: pointer to a naturally-aligned 16-bit value
- */
-static inline void __swab16s(__u16 *p)
-{
-#ifdef __arch_swab16s
-       __arch_swab16s(p);
-#else
-       *p = __swab16p(p);
-#endif
-}
-/**
- * __swab32s - byteswap a 32-bit value in-place
- * @p: pointer to a naturally-aligned 32-bit value
- */
-static inline void __swab32s(__u32 *p)
-{
-#ifdef __arch_swab32s
-       __arch_swab32s(p);
-#else
-       *p = __swab32p(p);
-#endif
-}
-
-/**
- * __swab64s - byteswap a 64-bit value in-place
- * @p: pointer to a naturally-aligned 64-bit value
- */
-static inline void __swab64s(__u64 *p)
-{
-#ifdef __arch_swab64s
-       __arch_swab64s(p);
-#else
-       *p = __swab64p(p);
-#endif
-}
-
-/**
- * __swahw32s - wordswap a 32-bit value in-place
- * @p: pointer to a naturally-aligned 32-bit value
- *
- * See __swahw32() for details of wordswapping
- */
-static inline void __swahw32s(__u32 *p)
-{
-#ifdef __arch_swahw32s
-       __arch_swahw32s(p);
-#else
-       *p = __swahw32p(p);
-#endif
-}
-
-/**
- * __swahb32s - high and low byteswap a 32-bit value in-place
- * @p: pointer to a naturally-aligned 32-bit value
- *
- * See __swahb32() for details of high and low byte swapping
- */
-static inline void __swahb32s(__u32 *p)
-{
-#ifdef __arch_swahb32s
-       __arch_swahb32s(p);
-#else
-       *p = __swahb32p(p);
-#endif
-}
-
-#ifdef __KERNEL__
 # define swab16 __swab16
 # define swab32 __swab32
 # define swab64 __swab64
@@ -294,6 +18,4 @@ static inline void __swahb32s(__u32 *p)
 # define swab64s __swab64s
 # define swahw32s __swahw32s
 # define swahb32s __swahb32s
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SWAB_H */
index 2e7d81c4e5adcf54525d409b01a04644a7e2b35d..f1405b1c71ba15f77f745a3f7c786442b6761ae7 100644 (file)
  * Redistribution of this file is permitted under
  * the terms of the GNU Public License (GPL)
  */
-
 #ifndef _SYNCLINK_H_
 #define _SYNCLINK_H_
-#define SYNCLINK_H_VERSION 3.6
-
-#include <linux/types.h>
-
-#define BIT0   0x0001
-#define BIT1   0x0002
-#define BIT2   0x0004
-#define BIT3   0x0008
-#define BIT4   0x0010
-#define BIT5   0x0020
-#define BIT6   0x0040
-#define BIT7   0x0080
-#define BIT8   0x0100
-#define BIT9   0x0200
-#define BIT10  0x0400
-#define BIT11  0x0800
-#define BIT12  0x1000
-#define BIT13  0x2000
-#define BIT14  0x4000
-#define BIT15  0x8000
-#define BIT16  0x00010000
-#define BIT17  0x00020000
-#define BIT18  0x00040000
-#define BIT19  0x00080000
-#define BIT20  0x00100000
-#define BIT21  0x00200000
-#define BIT22  0x00400000
-#define BIT23  0x00800000
-#define BIT24  0x01000000
-#define BIT25  0x02000000
-#define BIT26  0x04000000
-#define BIT27  0x08000000
-#define BIT28  0x10000000
-#define BIT29  0x20000000
-#define BIT30  0x40000000
-#define BIT31  0x80000000
-
-
-#define HDLC_MAX_FRAME_SIZE    65535
-#define MAX_ASYNC_TRANSMIT     4096
-#define MAX_ASYNC_BUFFER_SIZE  4096
-
-#define ASYNC_PARITY_NONE              0
-#define ASYNC_PARITY_EVEN              1
-#define ASYNC_PARITY_ODD               2
-#define ASYNC_PARITY_SPACE             3
-
-#define HDLC_FLAG_UNDERRUN_ABORT7      0x0000
-#define HDLC_FLAG_UNDERRUN_ABORT15     0x0001
-#define HDLC_FLAG_UNDERRUN_FLAG                0x0002
-#define HDLC_FLAG_UNDERRUN_CRC         0x0004
-#define HDLC_FLAG_SHARE_ZERO           0x0010
-#define HDLC_FLAG_AUTO_CTS             0x0020
-#define HDLC_FLAG_AUTO_DCD             0x0040
-#define HDLC_FLAG_AUTO_RTS             0x0080
-#define HDLC_FLAG_RXC_DPLL             0x0100
-#define HDLC_FLAG_RXC_BRG              0x0200
-#define HDLC_FLAG_RXC_TXCPIN           0x8000
-#define HDLC_FLAG_RXC_RXCPIN           0x0000
-#define HDLC_FLAG_TXC_DPLL             0x0400
-#define HDLC_FLAG_TXC_BRG              0x0800
-#define HDLC_FLAG_TXC_TXCPIN           0x0000
-#define HDLC_FLAG_TXC_RXCPIN           0x0008
-#define HDLC_FLAG_DPLL_DIV8            0x1000
-#define HDLC_FLAG_DPLL_DIV16           0x2000
-#define HDLC_FLAG_DPLL_DIV32           0x0000
-#define HDLC_FLAG_HDLC_LOOPMODE                0x4000
-
-#define HDLC_CRC_NONE                  0
-#define HDLC_CRC_16_CCITT              1
-#define HDLC_CRC_32_CCITT              2
-#define HDLC_CRC_MASK                  0x00ff
-#define HDLC_CRC_RETURN_EX             0x8000
-
-#define RX_OK                          0
-#define RX_CRC_ERROR                   1
-
-#define HDLC_TXIDLE_FLAGS              0
-#define HDLC_TXIDLE_ALT_ZEROS_ONES     1
-#define HDLC_TXIDLE_ZEROS              2
-#define HDLC_TXIDLE_ONES               3
-#define HDLC_TXIDLE_ALT_MARK_SPACE     4
-#define HDLC_TXIDLE_SPACE              5
-#define HDLC_TXIDLE_MARK               6
-#define HDLC_TXIDLE_CUSTOM_8            0x10000000
-#define HDLC_TXIDLE_CUSTOM_16           0x20000000
-
-#define HDLC_ENCODING_NRZ                      0
-#define HDLC_ENCODING_NRZB                     1
-#define HDLC_ENCODING_NRZI_MARK                        2
-#define HDLC_ENCODING_NRZI_SPACE               3
-#define HDLC_ENCODING_NRZI                     HDLC_ENCODING_NRZI_SPACE
-#define HDLC_ENCODING_BIPHASE_MARK             4
-#define HDLC_ENCODING_BIPHASE_SPACE            5
-#define HDLC_ENCODING_BIPHASE_LEVEL            6
-#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL       7
-
-#define HDLC_PREAMBLE_LENGTH_8BITS     0
-#define HDLC_PREAMBLE_LENGTH_16BITS    1
-#define HDLC_PREAMBLE_LENGTH_32BITS    2
-#define HDLC_PREAMBLE_LENGTH_64BITS    3
-
-#define HDLC_PREAMBLE_PATTERN_NONE     0
-#define HDLC_PREAMBLE_PATTERN_ZEROS    1
-#define HDLC_PREAMBLE_PATTERN_FLAGS    2
-#define HDLC_PREAMBLE_PATTERN_10       3
-#define HDLC_PREAMBLE_PATTERN_01       4
-#define HDLC_PREAMBLE_PATTERN_ONES     5
-
-#define MGSL_MODE_ASYNC                1
-#define MGSL_MODE_HDLC         2
-#define MGSL_MODE_MONOSYNC     3
-#define MGSL_MODE_BISYNC       4
-#define MGSL_MODE_RAW          6
-#define MGSL_MODE_BASE_CLOCK    7
-#define MGSL_MODE_XSYNC         8
-
-#define MGSL_BUS_TYPE_ISA      1
-#define MGSL_BUS_TYPE_EISA     2
-#define MGSL_BUS_TYPE_PCI      5
-
-#define MGSL_INTERFACE_MASK     0xf
-#define MGSL_INTERFACE_DISABLE  0
-#define MGSL_INTERFACE_RS232    1
-#define MGSL_INTERFACE_V35      2
-#define MGSL_INTERFACE_RS422    3
-#define MGSL_INTERFACE_RTS_EN   0x10
-#define MGSL_INTERFACE_LL       0x20
-#define MGSL_INTERFACE_RL       0x40
-#define MGSL_INTERFACE_MSB_FIRST 0x80
-
-typedef struct _MGSL_PARAMS
-{
-       /* Common */
-
-       unsigned long   mode;           /* Asynchronous or HDLC */
-       unsigned char   loopback;       /* internal loopback mode */
-
-       /* HDLC Only */
-
-       unsigned short  flags;
-       unsigned char   encoding;       /* NRZ, NRZI, etc. */
-       unsigned long   clock_speed;    /* external clock speed in bits per second */
-       unsigned char   addr_filter;    /* receive HDLC address filter, 0xFF = disable */
-       unsigned short  crc_type;       /* None, CRC16-CCITT, or CRC32-CCITT */
-       unsigned char   preamble_length;
-       unsigned char   preamble;
 
-       /* Async Only */
+#include <uapi/linux/synclink.h>
 
-       unsigned long   data_rate;      /* bits per second */
-       unsigned char   data_bits;      /* 7 or 8 data bits */
-       unsigned char   stop_bits;      /* 1 or 2 stop bits */
-       unsigned char   parity;         /* none, even, or odd */
-
-} MGSL_PARAMS, *PMGSL_PARAMS;
-
-#define MICROGATE_VENDOR_ID 0x13c0
-#define SYNCLINK_DEVICE_ID 0x0010
-#define MGSCC_DEVICE_ID 0x0020
-#define SYNCLINK_SCA_DEVICE_ID 0x0030
-#define SYNCLINK_GT_DEVICE_ID 0x0070
-#define SYNCLINK_GT4_DEVICE_ID 0x0080
-#define SYNCLINK_AC_DEVICE_ID  0x0090
-#define SYNCLINK_GT2_DEVICE_ID 0x00A0
-#define MGSL_MAX_SERIAL_NUMBER 30
-
-/*
-** device diagnostics status
-*/
-
-#define DiagStatus_OK                          0
-#define DiagStatus_AddressFailure              1
-#define DiagStatus_AddressConflict             2
-#define DiagStatus_IrqFailure                  3
-#define DiagStatus_IrqConflict                 4
-#define DiagStatus_DmaFailure                  5
-#define DiagStatus_DmaConflict                 6
-#define DiagStatus_PciAdapterNotFound          7
-#define DiagStatus_CantAssignPciResources      8
-#define DiagStatus_CantAssignPciMemAddr                9
-#define DiagStatus_CantAssignPciIoAddr         10
-#define DiagStatus_CantAssignPciIrq            11
-#define DiagStatus_MemoryError                 12
-
-#define SerialSignal_DCD            0x01     /* Data Carrier Detect */
-#define SerialSignal_TXD            0x02     /* Transmit Data */
-#define SerialSignal_RI             0x04     /* Ring Indicator */
-#define SerialSignal_RXD            0x08     /* Receive Data */
-#define SerialSignal_CTS            0x10     /* Clear to Send */
-#define SerialSignal_RTS            0x20     /* Request to Send */
-#define SerialSignal_DSR            0x40     /* Data Set Ready */
-#define SerialSignal_DTR            0x80     /* Data Terminal Ready */
-
-
-/*
- * Counters of the input lines (CTS, DSR, RI, CD) interrupts
- */
-struct mgsl_icount {
-       __u32   cts, dsr, rng, dcd, tx, rx;
-       __u32   frame, parity, overrun, brk;
-       __u32   buf_overrun;
-       __u32   txok;
-       __u32   txunder;
-       __u32   txabort;
-       __u32   txtimeout;
-       __u32   rxshort;
-       __u32   rxlong;
-       __u32   rxabort;
-       __u32   rxover;
-       __u32   rxcrc;
-       __u32   rxok;
-       __u32   exithunt;
-       __u32   rxidle;
-};
-
-struct gpio_desc {
-       __u32 state;
-       __u32 smask;
-       __u32 dir;
-       __u32 dmask;
-};
-
-#define DEBUG_LEVEL_DATA       1
-#define DEBUG_LEVEL_ERROR      2
-#define DEBUG_LEVEL_INFO       3
-#define DEBUG_LEVEL_BH         4
-#define DEBUG_LEVEL_ISR                5
-
-/*
-** Event bit flags for use with MgslWaitEvent
-*/
-
-#define MgslEvent_DsrActive    0x0001
-#define MgslEvent_DsrInactive  0x0002
-#define MgslEvent_Dsr          0x0003
-#define MgslEvent_CtsActive    0x0004
-#define MgslEvent_CtsInactive  0x0008
-#define MgslEvent_Cts          0x000c
-#define MgslEvent_DcdActive    0x0010
-#define MgslEvent_DcdInactive  0x0020
-#define MgslEvent_Dcd          0x0030
-#define MgslEvent_RiActive     0x0040
-#define MgslEvent_RiInactive   0x0080
-#define MgslEvent_Ri           0x00c0
-#define MgslEvent_ExitHuntMode 0x0100
-#define MgslEvent_IdleReceived 0x0200
-
-/* Private IOCTL codes:
- *
- * MGSL_IOCSPARAMS     set MGSL_PARAMS structure values
- * MGSL_IOCGPARAMS     get current MGSL_PARAMS structure values
- * MGSL_IOCSTXIDLE     set current transmit idle mode
- * MGSL_IOCGTXIDLE     get current transmit idle mode
- * MGSL_IOCTXENABLE    enable or disable transmitter
- * MGSL_IOCRXENABLE    enable or disable receiver
- * MGSL_IOCTXABORT     abort transmitting frame (HDLC)
- * MGSL_IOCGSTATS      return current statistics
- * MGSL_IOCWAITEVENT   wait for specified event to occur
- * MGSL_LOOPTXDONE     transmit in HDLC LoopMode done
- * MGSL_IOCSIF          set the serial interface type
- * MGSL_IOCGIF          get the serial interface type
- */
-#define MGSL_MAGIC_IOC 'm'
-#define MGSL_IOCSPARAMS                _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
-#define MGSL_IOCGPARAMS                _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
-#define MGSL_IOCSTXIDLE                _IO(MGSL_MAGIC_IOC,2)
-#define MGSL_IOCGTXIDLE                _IO(MGSL_MAGIC_IOC,3)
-#define MGSL_IOCTXENABLE       _IO(MGSL_MAGIC_IOC,4)
-#define MGSL_IOCRXENABLE       _IO(MGSL_MAGIC_IOC,5)
-#define MGSL_IOCTXABORT                _IO(MGSL_MAGIC_IOC,6)
-#define MGSL_IOCGSTATS         _IO(MGSL_MAGIC_IOC,7)
-#define MGSL_IOCWAITEVENT      _IOWR(MGSL_MAGIC_IOC,8,int)
-#define MGSL_IOCCLRMODCOUNT    _IO(MGSL_MAGIC_IOC,15)
-#define MGSL_IOCLOOPTXDONE     _IO(MGSL_MAGIC_IOC,9)
-#define MGSL_IOCSIF            _IO(MGSL_MAGIC_IOC,10)
-#define MGSL_IOCGIF            _IO(MGSL_MAGIC_IOC,11)
-#define MGSL_IOCSGPIO          _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
-#define MGSL_IOCGGPIO          _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
-#define MGSL_IOCWAITGPIO       _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
-#define MGSL_IOCSXSYNC         _IO(MGSL_MAGIC_IOC, 19)
-#define MGSL_IOCGXSYNC         _IO(MGSL_MAGIC_IOC, 20)
-#define MGSL_IOCSXCTRL         _IO(MGSL_MAGIC_IOC, 21)
-#define MGSL_IOCGXCTRL         _IO(MGSL_MAGIC_IOC, 22)
-
-#ifdef __KERNEL__
 /* provide 32 bit ioctl compatibility on 64 bit systems */
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
@@ -318,6 +34,4 @@ struct MGSL_PARAMS32 {
 #define MGSL_IOCSPARAMS32 _IOW(MGSL_MAGIC_IOC,0,struct MGSL_PARAMS32)
 #define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct MGSL_PARAMS32)
 #endif
-#endif
-
 #endif /* _SYNCLINK_H_ */
index c34b4c82b0dcd6f60937cf6507da1b9988fd9d6f..cd844a6a8d5f9f766503f91d229694918cbe14fc 100644 (file)
  ****************************************************************
  ****************************************************************
  */
-
 #ifndef _LINUX_SYSCTL_H
 #define _LINUX_SYSCTL_H
 
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/compiler.h>
-
-struct completion;
-
-#define CTL_MAXNAME 10         /* how many path components do we allow in a
-                                  call to sysctl?   In other words, what is
-                                  the largest acceptable value for the nlen
-                                  member of a struct __sysctl_args to have? */
-
-struct __sysctl_args {
-       int __user *name;
-       int nlen;
-       void __user *oldval;
-       size_t __user *oldlenp;
-       void __user *newval;
-       size_t newlen;
-       unsigned long __unused[4];
-};
-
-/* Define sysctl names first */
-
-/* Top-level names: */
-
-enum
-{
-       CTL_KERN=1,             /* General kernel info and control */
-       CTL_VM=2,               /* VM management */
-       CTL_NET=3,              /* Networking */
-       CTL_PROC=4,             /* removal breaks strace(1) compilation */
-       CTL_FS=5,               /* Filesystems */
-       CTL_DEBUG=6,            /* Debugging */
-       CTL_DEV=7,              /* Devices */
-       CTL_BUS=8,              /* Busses */
-       CTL_ABI=9,              /* Binary emulation */
-       CTL_CPU=10,             /* CPU stuff (speed scaling, etc) */
-       CTL_ARLAN=254,          /* arlan wireless driver */
-       CTL_S390DBF=5677,       /* s390 debug */
-       CTL_SUNRPC=7249,        /* sunrpc debug */
-       CTL_PM=9899,            /* frv power management */
-       CTL_FRV=9898,           /* frv specific sysctls */
-};
-
-/* CTL_BUS names: */
-enum
-{
-       CTL_BUS_ISA=1           /* ISA */
-};
-
-/* /proc/sys/fs/inotify/ */
-enum
-{
-       INOTIFY_MAX_USER_INSTANCES=1,   /* max instances per user */
-       INOTIFY_MAX_USER_WATCHES=2,     /* max watches per user */
-       INOTIFY_MAX_QUEUED_EVENTS=3     /* max queued events per instance */
-};
-
-/* CTL_KERN names: */
-enum
-{
-       KERN_OSTYPE=1,          /* string: system version */
-       KERN_OSRELEASE=2,       /* string: system release */
-       KERN_OSREV=3,           /* int: system revision */
-       KERN_VERSION=4,         /* string: compile time info */
-       KERN_SECUREMASK=5,      /* struct: maximum rights mask */
-       KERN_PROF=6,            /* table: profiling information */
-       KERN_NODENAME=7,        /* string: hostname */
-       KERN_DOMAINNAME=8,      /* string: domainname */
-
-       KERN_PANIC=15,          /* int: panic timeout */
-       KERN_REALROOTDEV=16,    /* real root device to mount after initrd */
-
-       KERN_SPARC_REBOOT=21,   /* reboot command on Sparc */
-       KERN_CTLALTDEL=22,      /* int: allow ctl-alt-del to reboot */
-       KERN_PRINTK=23,         /* struct: control printk logging parameters */
-       KERN_NAMETRANS=24,      /* Name translation */
-       KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
-       KERN_PPC_ZEROPAGED=26,  /* turn idle page zeroing on/off on PPC */
-       KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
-       KERN_MODPROBE=28,       /* string: modprobe path */
-       KERN_SG_BIG_BUFF=29,    /* int: sg driver reserved buffer size */
-       KERN_ACCT=30,           /* BSD process accounting parameters */
-       KERN_PPC_L2CR=31,       /* l2cr register on PPC */
-
-       KERN_RTSIGNR=32,        /* Number of rt sigs queued */
-       KERN_RTSIGMAX=33,       /* Max queuable */
-       
-       KERN_SHMMAX=34,         /* long: Maximum shared memory segment */
-       KERN_MSGMAX=35,         /* int: Maximum size of a messege */
-       KERN_MSGMNB=36,         /* int: Maximum message queue size */
-       KERN_MSGPOOL=37,        /* int: Maximum system message pool size */
-       KERN_SYSRQ=38,          /* int: Sysreq enable */
-       KERN_MAX_THREADS=39,    /* int: Maximum nr of threads in the system */
-       KERN_RANDOM=40,         /* Random driver */
-       KERN_SHMALL=41,         /* int: Maximum size of shared memory */
-       KERN_MSGMNI=42,         /* int: msg queue identifiers */
-       KERN_SEM=43,            /* struct: sysv semaphore limits */
-       KERN_SPARC_STOP_A=44,   /* int: Sparc Stop-A enable */
-       KERN_SHMMNI=45,         /* int: shm array identifiers */
-       KERN_OVERFLOWUID=46,    /* int: overflow UID */
-       KERN_OVERFLOWGID=47,    /* int: overflow GID */
-       KERN_SHMPATH=48,        /* string: path to shm fs */
-       KERN_HOTPLUG=49,        /* string: path to uevent helper (deprecated) */
-       KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
-       KERN_S390_USER_DEBUG_LOGGING=51,  /* int: dumps of user faults */
-       KERN_CORE_USES_PID=52,          /* int: use core or core.%pid */
-       KERN_TAINTED=53,        /* int: various kernel tainted flags */
-       KERN_CADPID=54,         /* int: PID of the process to notify on CAD */
-       KERN_PIDMAX=55,         /* int: PID # limit */
-       KERN_CORE_PATTERN=56,   /* string: pattern for core-file names */
-       KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
-       KERN_HPPA_PWRSW=58,     /* int: hppa soft-power enable */
-       KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
-       KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
-       KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
-       KERN_PTY=62,            /* dir: pty driver */
-       KERN_NGROUPS_MAX=63,    /* int: NGROUPS_MAX */
-       KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
-       KERN_HZ_TIMER=65,       /* int: hz timer on or off */
-       KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
-       KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
-       KERN_RANDOMIZE=68, /* int: randomize virtual address space */
-       KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
-       KERN_SPIN_RETRY=70,     /* int: number of spinlock retries */
-       KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
-       KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
-       KERN_COMPAT_LOG=73,     /* int: print compat layer  messages */
-       KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
-       KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
-       KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
-};
-
-
-
-/* CTL_VM names: */
-enum
-{
-       VM_UNUSED1=1,           /* was: struct: Set vm swapping control */
-       VM_UNUSED2=2,           /* was; int: Linear or sqrt() swapout for hogs */
-       VM_UNUSED3=3,           /* was: struct: Set free page thresholds */
-       VM_UNUSED4=4,           /* Spare */
-       VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
-       VM_UNUSED5=6,           /* was: struct: Set buffer memory thresholds */
-       VM_UNUSED7=7,           /* was: struct: Set cache memory thresholds */
-       VM_UNUSED8=8,           /* was: struct: Control kswapd behaviour */
-       VM_UNUSED9=9,           /* was: struct: Set page table cache parameters */
-       VM_PAGE_CLUSTER=10,     /* int: set number of pages to swap together */
-       VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
-       VM_DIRTY_RATIO=12,      /* dirty_ratio */
-       VM_DIRTY_WB_CS=13,      /* dirty_writeback_centisecs */
-       VM_DIRTY_EXPIRE_CS=14,  /* dirty_expire_centisecs */
-       VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
-       VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
-       VM_PAGEBUF=17,          /* struct: Control pagebuf parameters */
-       VM_HUGETLB_PAGES=18,    /* int: Number of available Huge Pages */
-       VM_SWAPPINESS=19,       /* Tendency to steal mapped memory */
-       VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
-       VM_MIN_FREE_KBYTES=21,  /* Minimum free kilobytes to maintain */
-       VM_MAX_MAP_COUNT=22,    /* int: Maximum number of mmaps/address-space */
-       VM_LAPTOP_MODE=23,      /* vm laptop mode */
-       VM_BLOCK_DUMP=24,       /* block dump mode */
-       VM_HUGETLB_GROUP=25,    /* permitted hugetlb group */
-       VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
-       VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
-       VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
-       VM_DROP_PAGECACHE=29,   /* int: nuke lots of pagecache */
-       VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
-       VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
-       VM_MIN_UNMAPPED=32,     /* Set min percent of unmapped pages */
-       VM_PANIC_ON_OOM=33,     /* panic at out-of-memory */
-       VM_VDSO_ENABLED=34,     /* map VDSO into new processes? */
-       VM_MIN_SLAB=35,          /* Percent pages ignored by zone reclaim */
-};
-
-
-/* CTL_NET names: */
-enum
-{
-       NET_CORE=1,
-       NET_ETHER=2,
-       NET_802=3,
-       NET_UNIX=4,
-       NET_IPV4=5,
-       NET_IPX=6,
-       NET_ATALK=7,
-       NET_NETROM=8,
-       NET_AX25=9,
-       NET_BRIDGE=10,
-       NET_ROSE=11,
-       NET_IPV6=12,
-       NET_X25=13,
-       NET_TR=14,
-       NET_DECNET=15,
-       NET_ECONET=16,
-       NET_SCTP=17,
-       NET_LLC=18,
-       NET_NETFILTER=19,
-       NET_DCCP=20,
-       NET_IRDA=412,
-};
-
-/* /proc/sys/kernel/random */
-enum
-{
-       RANDOM_POOLSIZE=1,
-       RANDOM_ENTROPY_COUNT=2,
-       RANDOM_READ_THRESH=3,
-       RANDOM_WRITE_THRESH=4,
-       RANDOM_BOOT_ID=5,
-       RANDOM_UUID=6
-};
-
-/* /proc/sys/kernel/pty */
-enum
-{
-       PTY_MAX=1,
-       PTY_NR=2
-};
-
-/* /proc/sys/bus/isa */
-enum
-{
-       BUS_ISA_MEM_BASE=1,
-       BUS_ISA_PORT_BASE=2,
-       BUS_ISA_PORT_SHIFT=3
-};
-
-/* /proc/sys/net/core */
-enum
-{
-       NET_CORE_WMEM_MAX=1,
-       NET_CORE_RMEM_MAX=2,
-       NET_CORE_WMEM_DEFAULT=3,
-       NET_CORE_RMEM_DEFAULT=4,
-/* was NET_CORE_DESTROY_DELAY */
-       NET_CORE_MAX_BACKLOG=6,
-       NET_CORE_FASTROUTE=7,
-       NET_CORE_MSG_COST=8,
-       NET_CORE_MSG_BURST=9,
-       NET_CORE_OPTMEM_MAX=10,
-       NET_CORE_HOT_LIST_LENGTH=11,
-       NET_CORE_DIVERT_VERSION=12,
-       NET_CORE_NO_CONG_THRESH=13,
-       NET_CORE_NO_CONG=14,
-       NET_CORE_LO_CONG=15,
-       NET_CORE_MOD_CONG=16,
-       NET_CORE_DEV_WEIGHT=17,
-       NET_CORE_SOMAXCONN=18,
-       NET_CORE_BUDGET=19,
-       NET_CORE_AEVENT_ETIME=20,
-       NET_CORE_AEVENT_RSEQTH=21,
-       NET_CORE_WARNINGS=22,
-};
-
-/* /proc/sys/net/ethernet */
-
-/* /proc/sys/net/802 */
-
-/* /proc/sys/net/unix */
-
-enum
-{
-       NET_UNIX_DESTROY_DELAY=1,
-       NET_UNIX_DELETE_DELAY=2,
-       NET_UNIX_MAX_DGRAM_QLEN=3,
-};
-
-/* /proc/sys/net/netfilter */
-enum
-{
-       NET_NF_CONNTRACK_MAX=1,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
-       NET_NF_CONNTRACK_UDP_TIMEOUT=10,
-       NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
-       NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
-       NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
-       NET_NF_CONNTRACK_BUCKETS=14,
-       NET_NF_CONNTRACK_LOG_INVALID=15,
-       NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
-       NET_NF_CONNTRACK_TCP_LOOSE=17,
-       NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
-       NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
-       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
-       NET_NF_CONNTRACK_COUNT=27,
-       NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
-       NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
-       NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
-       NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
-       NET_NF_CONNTRACK_CHECKSUM=32,
-};
-
-/* /proc/sys/net/ipv4 */
-enum
-{
-       /* v2.0 compatibile variables */
-       NET_IPV4_FORWARD=8,
-       NET_IPV4_DYNADDR=9,
-
-       NET_IPV4_CONF=16,
-       NET_IPV4_NEIGH=17,
-       NET_IPV4_ROUTE=18,
-       NET_IPV4_FIB_HASH=19,
-       NET_IPV4_NETFILTER=20,
-
-       NET_IPV4_TCP_TIMESTAMPS=33,
-       NET_IPV4_TCP_WINDOW_SCALING=34,
-       NET_IPV4_TCP_SACK=35,
-       NET_IPV4_TCP_RETRANS_COLLAPSE=36,
-       NET_IPV4_DEFAULT_TTL=37,
-       NET_IPV4_AUTOCONFIG=38,
-       NET_IPV4_NO_PMTU_DISC=39,
-       NET_IPV4_TCP_SYN_RETRIES=40,
-       NET_IPV4_IPFRAG_HIGH_THRESH=41,
-       NET_IPV4_IPFRAG_LOW_THRESH=42,
-       NET_IPV4_IPFRAG_TIME=43,
-       NET_IPV4_TCP_MAX_KA_PROBES=44,
-       NET_IPV4_TCP_KEEPALIVE_TIME=45,
-       NET_IPV4_TCP_KEEPALIVE_PROBES=46,
-       NET_IPV4_TCP_RETRIES1=47,
-       NET_IPV4_TCP_RETRIES2=48,
-       NET_IPV4_TCP_FIN_TIMEOUT=49,
-       NET_IPV4_IP_MASQ_DEBUG=50,
-       NET_TCP_SYNCOOKIES=51,
-       NET_TCP_STDURG=52,
-       NET_TCP_RFC1337=53,
-       NET_TCP_SYN_TAILDROP=54,
-       NET_TCP_MAX_SYN_BACKLOG=55,
-       NET_IPV4_LOCAL_PORT_RANGE=56,
-       NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
-       NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
-       NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
-       NET_IPV4_ICMP_DESTUNREACH_RATE=60,
-       NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
-       NET_IPV4_ICMP_PARAMPROB_RATE=62,
-       NET_IPV4_ICMP_ECHOREPLY_RATE=63,
-       NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
-       NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
-       NET_TCP_TW_RECYCLE=66,
-       NET_IPV4_ALWAYS_DEFRAG=67,
-       NET_IPV4_TCP_KEEPALIVE_INTVL=68,
-       NET_IPV4_INET_PEER_THRESHOLD=69,
-       NET_IPV4_INET_PEER_MINTTL=70,
-       NET_IPV4_INET_PEER_MAXTTL=71,
-       NET_IPV4_INET_PEER_GC_MINTIME=72,
-       NET_IPV4_INET_PEER_GC_MAXTIME=73,
-       NET_TCP_ORPHAN_RETRIES=74,
-       NET_TCP_ABORT_ON_OVERFLOW=75,
-       NET_TCP_SYNACK_RETRIES=76,
-       NET_TCP_MAX_ORPHANS=77,
-       NET_TCP_MAX_TW_BUCKETS=78,
-       NET_TCP_FACK=79,
-       NET_TCP_REORDERING=80,
-       NET_TCP_ECN=81,
-       NET_TCP_DSACK=82,
-       NET_TCP_MEM=83,
-       NET_TCP_WMEM=84,
-       NET_TCP_RMEM=85,
-       NET_TCP_APP_WIN=86,
-       NET_TCP_ADV_WIN_SCALE=87,
-       NET_IPV4_NONLOCAL_BIND=88,
-       NET_IPV4_ICMP_RATELIMIT=89,
-       NET_IPV4_ICMP_RATEMASK=90,
-       NET_TCP_TW_REUSE=91,
-       NET_TCP_FRTO=92,
-       NET_TCP_LOW_LATENCY=93,
-       NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
-       NET_IPV4_IGMP_MAX_MSF=96,
-       NET_TCP_NO_METRICS_SAVE=97,
-       NET_TCP_DEFAULT_WIN_SCALE=105,
-       NET_TCP_MODERATE_RCVBUF=106,
-       NET_TCP_TSO_WIN_DIVISOR=107,
-       NET_TCP_BIC_BETA=108,
-       NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
-       NET_TCP_CONG_CONTROL=110,
-       NET_TCP_ABC=111,
-       NET_IPV4_IPFRAG_MAX_DIST=112,
-       NET_TCP_MTU_PROBING=113,
-       NET_TCP_BASE_MSS=114,
-       NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
-       NET_TCP_DMA_COPYBREAK=116,
-       NET_TCP_SLOW_START_AFTER_IDLE=117,
-       NET_CIPSOV4_CACHE_ENABLE=118,
-       NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
-       NET_CIPSOV4_RBM_OPTFMT=120,
-       NET_CIPSOV4_RBM_STRICTVALID=121,
-       NET_TCP_AVAIL_CONG_CONTROL=122,
-       NET_TCP_ALLOWED_CONG_CONTROL=123,
-       NET_TCP_MAX_SSTHRESH=124,
-       NET_TCP_FRTO_RESPONSE=125,
-};
-
-enum {
-       NET_IPV4_ROUTE_FLUSH=1,
-       NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
-       NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
-       NET_IPV4_ROUTE_GC_THRESH=4,
-       NET_IPV4_ROUTE_MAX_SIZE=5,
-       NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
-       NET_IPV4_ROUTE_GC_TIMEOUT=7,
-       NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
-       NET_IPV4_ROUTE_REDIRECT_LOAD=9,
-       NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
-       NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
-       NET_IPV4_ROUTE_ERROR_COST=12,
-       NET_IPV4_ROUTE_ERROR_BURST=13,
-       NET_IPV4_ROUTE_GC_ELASTICITY=14,
-       NET_IPV4_ROUTE_MTU_EXPIRES=15,
-       NET_IPV4_ROUTE_MIN_PMTU=16,
-       NET_IPV4_ROUTE_MIN_ADVMSS=17,
-       NET_IPV4_ROUTE_SECRET_INTERVAL=18,
-       NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
-};
-
-enum
-{
-       NET_PROTO_CONF_ALL=-2,
-       NET_PROTO_CONF_DEFAULT=-3
-
-       /* And device ifindices ... */
-};
-
-enum
-{
-       NET_IPV4_CONF_FORWARDING=1,
-       NET_IPV4_CONF_MC_FORWARDING=2,
-       NET_IPV4_CONF_PROXY_ARP=3,
-       NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
-       NET_IPV4_CONF_SECURE_REDIRECTS=5,
-       NET_IPV4_CONF_SEND_REDIRECTS=6,
-       NET_IPV4_CONF_SHARED_MEDIA=7,
-       NET_IPV4_CONF_RP_FILTER=8,
-       NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
-       NET_IPV4_CONF_BOOTP_RELAY=10,
-       NET_IPV4_CONF_LOG_MARTIANS=11,
-       NET_IPV4_CONF_TAG=12,
-       NET_IPV4_CONF_ARPFILTER=13,
-       NET_IPV4_CONF_MEDIUM_ID=14,
-       NET_IPV4_CONF_NOXFRM=15,
-       NET_IPV4_CONF_NOPOLICY=16,
-       NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
-       NET_IPV4_CONF_ARP_ANNOUNCE=18,
-       NET_IPV4_CONF_ARP_IGNORE=19,
-       NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
-       NET_IPV4_CONF_ARP_ACCEPT=21,
-       NET_IPV4_CONF_ARP_NOTIFY=22,
-};
-
-/* /proc/sys/net/ipv4/netfilter */
-enum
-{
-       NET_IPV4_NF_CONNTRACK_MAX=1,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
-       NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
-       NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
-       NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
-       NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
-       NET_IPV4_NF_CONNTRACK_BUCKETS=14,
-       NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
-       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
-       NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
-       NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
-       NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
-       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
-       NET_IPV4_NF_CONNTRACK_COUNT=27,
-       NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
-};
-/* /proc/sys/net/ipv6 */
-enum {
-       NET_IPV6_CONF=16,
-       NET_IPV6_NEIGH=17,
-       NET_IPV6_ROUTE=18,
-       NET_IPV6_ICMP=19,
-       NET_IPV6_BINDV6ONLY=20,
-       NET_IPV6_IP6FRAG_HIGH_THRESH=21,
-       NET_IPV6_IP6FRAG_LOW_THRESH=22,
-       NET_IPV6_IP6FRAG_TIME=23,
-       NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
-       NET_IPV6_MLD_MAX_MSF=25,
-};
-
-enum {
-       NET_IPV6_ROUTE_FLUSH=1,
-       NET_IPV6_ROUTE_GC_THRESH=2,
-       NET_IPV6_ROUTE_MAX_SIZE=3,
-       NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
-       NET_IPV6_ROUTE_GC_TIMEOUT=5,
-       NET_IPV6_ROUTE_GC_INTERVAL=6,
-       NET_IPV6_ROUTE_GC_ELASTICITY=7,
-       NET_IPV6_ROUTE_MTU_EXPIRES=8,
-       NET_IPV6_ROUTE_MIN_ADVMSS=9,
-       NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
-};
-
-enum {
-       NET_IPV6_FORWARDING=1,
-       NET_IPV6_HOP_LIMIT=2,
-       NET_IPV6_MTU=3,
-       NET_IPV6_ACCEPT_RA=4,
-       NET_IPV6_ACCEPT_REDIRECTS=5,
-       NET_IPV6_AUTOCONF=6,
-       NET_IPV6_DAD_TRANSMITS=7,
-       NET_IPV6_RTR_SOLICITS=8,
-       NET_IPV6_RTR_SOLICIT_INTERVAL=9,
-       NET_IPV6_RTR_SOLICIT_DELAY=10,
-       NET_IPV6_USE_TEMPADDR=11,
-       NET_IPV6_TEMP_VALID_LFT=12,
-       NET_IPV6_TEMP_PREFERED_LFT=13,
-       NET_IPV6_REGEN_MAX_RETRY=14,
-       NET_IPV6_MAX_DESYNC_FACTOR=15,
-       NET_IPV6_MAX_ADDRESSES=16,
-       NET_IPV6_FORCE_MLD_VERSION=17,
-       NET_IPV6_ACCEPT_RA_DEFRTR=18,
-       NET_IPV6_ACCEPT_RA_PINFO=19,
-       NET_IPV6_ACCEPT_RA_RTR_PREF=20,
-       NET_IPV6_RTR_PROBE_INTERVAL=21,
-       NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
-       NET_IPV6_PROXY_NDP=23,
-       NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
-       __NET_IPV6_MAX
-};
-
-/* /proc/sys/net/ipv6/icmp */
-enum {
-       NET_IPV6_ICMP_RATELIMIT=1
-};
-
-/* /proc/sys/net/<protocol>/neigh/<dev> */
-enum {
-       NET_NEIGH_MCAST_SOLICIT=1,
-       NET_NEIGH_UCAST_SOLICIT=2,
-       NET_NEIGH_APP_SOLICIT=3,
-       NET_NEIGH_RETRANS_TIME=4,
-       NET_NEIGH_REACHABLE_TIME=5,
-       NET_NEIGH_DELAY_PROBE_TIME=6,
-       NET_NEIGH_GC_STALE_TIME=7,
-       NET_NEIGH_UNRES_QLEN=8,
-       NET_NEIGH_PROXY_QLEN=9,
-       NET_NEIGH_ANYCAST_DELAY=10,
-       NET_NEIGH_PROXY_DELAY=11,
-       NET_NEIGH_LOCKTIME=12,
-       NET_NEIGH_GC_INTERVAL=13,
-       NET_NEIGH_GC_THRESH1=14,
-       NET_NEIGH_GC_THRESH2=15,
-       NET_NEIGH_GC_THRESH3=16,
-       NET_NEIGH_RETRANS_TIME_MS=17,
-       NET_NEIGH_REACHABLE_TIME_MS=18,
-};
-
-/* /proc/sys/net/dccp */
-enum {
-       NET_DCCP_DEFAULT=1,
-};
-
-/* /proc/sys/net/ipx */
-enum {
-       NET_IPX_PPROP_BROADCASTING=1,
-       NET_IPX_FORWARDING=2
-};
-
-/* /proc/sys/net/llc */
-enum {
-       NET_LLC2=1,
-       NET_LLC_STATION=2,
-};
-
-/* /proc/sys/net/llc/llc2 */
-enum {
-       NET_LLC2_TIMEOUT=1,
-};
-
-/* /proc/sys/net/llc/station */
-enum {
-       NET_LLC_STATION_ACK_TIMEOUT=1,
-};
-
-/* /proc/sys/net/llc/llc2/timeout */
-enum {
-       NET_LLC2_ACK_TIMEOUT=1,
-       NET_LLC2_P_TIMEOUT=2,
-       NET_LLC2_REJ_TIMEOUT=3,
-       NET_LLC2_BUSY_TIMEOUT=4,
-};
-
-/* /proc/sys/net/appletalk */
-enum {
-       NET_ATALK_AARP_EXPIRY_TIME=1,
-       NET_ATALK_AARP_TICK_TIME=2,
-       NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
-       NET_ATALK_AARP_RESOLVE_TIME=4
-};
-
-
-/* /proc/sys/net/netrom */
-enum {
-       NET_NETROM_DEFAULT_PATH_QUALITY=1,
-       NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
-       NET_NETROM_NETWORK_TTL_INITIALISER=3,
-       NET_NETROM_TRANSPORT_TIMEOUT=4,
-       NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
-       NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
-       NET_NETROM_TRANSPORT_BUSY_DELAY=7,
-       NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
-       NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
-       NET_NETROM_ROUTING_CONTROL=10,
-       NET_NETROM_LINK_FAILS_COUNT=11,
-       NET_NETROM_RESET=12
-};
-
-/* /proc/sys/net/ax25 */
-enum {
-       NET_AX25_IP_DEFAULT_MODE=1,
-       NET_AX25_DEFAULT_MODE=2,
-       NET_AX25_BACKOFF_TYPE=3,
-       NET_AX25_CONNECT_MODE=4,
-       NET_AX25_STANDARD_WINDOW=5,
-       NET_AX25_EXTENDED_WINDOW=6,
-       NET_AX25_T1_TIMEOUT=7,
-       NET_AX25_T2_TIMEOUT=8,
-       NET_AX25_T3_TIMEOUT=9,
-       NET_AX25_IDLE_TIMEOUT=10,
-       NET_AX25_N2=11,
-       NET_AX25_PACLEN=12,
-       NET_AX25_PROTOCOL=13,
-       NET_AX25_DAMA_SLAVE_TIMEOUT=14
-};
-
-/* /proc/sys/net/rose */
-enum {
-       NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
-       NET_ROSE_CALL_REQUEST_TIMEOUT=2,
-       NET_ROSE_RESET_REQUEST_TIMEOUT=3,
-       NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
-       NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
-       NET_ROSE_ROUTING_CONTROL=6,
-       NET_ROSE_LINK_FAIL_TIMEOUT=7,
-       NET_ROSE_MAX_VCS=8,
-       NET_ROSE_WINDOW_SIZE=9,
-       NET_ROSE_NO_ACTIVITY_TIMEOUT=10
-};
-
-/* /proc/sys/net/x25 */
-enum {
-       NET_X25_RESTART_REQUEST_TIMEOUT=1,
-       NET_X25_CALL_REQUEST_TIMEOUT=2,
-       NET_X25_RESET_REQUEST_TIMEOUT=3,
-       NET_X25_CLEAR_REQUEST_TIMEOUT=4,
-       NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
-       NET_X25_FORWARD=6
-};
-
-/* /proc/sys/net/token-ring */
-enum
-{
-       NET_TR_RIF_TIMEOUT=1
-};
-
-/* /proc/sys/net/decnet/ */
-enum {
-       NET_DECNET_NODE_TYPE = 1,
-       NET_DECNET_NODE_ADDRESS = 2,
-       NET_DECNET_NODE_NAME = 3,
-       NET_DECNET_DEFAULT_DEVICE = 4,
-       NET_DECNET_TIME_WAIT = 5,
-       NET_DECNET_DN_COUNT = 6,
-       NET_DECNET_DI_COUNT = 7,
-       NET_DECNET_DR_COUNT = 8,
-       NET_DECNET_DST_GC_INTERVAL = 9,
-       NET_DECNET_CONF = 10,
-       NET_DECNET_NO_FC_MAX_CWND = 11,
-       NET_DECNET_MEM = 12,
-       NET_DECNET_RMEM = 13,
-       NET_DECNET_WMEM = 14,
-       NET_DECNET_DEBUG_LEVEL = 255
-};
-
-/* /proc/sys/net/decnet/conf/<dev> */
-enum {
-       NET_DECNET_CONF_LOOPBACK = -2,
-       NET_DECNET_CONF_DDCMP = -3,
-       NET_DECNET_CONF_PPP = -4,
-       NET_DECNET_CONF_X25 = -5,
-       NET_DECNET_CONF_GRE = -6,
-       NET_DECNET_CONF_ETHER = -7
-
-       /* ... and ifindex of devices */
-};
-
-/* /proc/sys/net/decnet/conf/<dev>/ */
-enum {
-       NET_DECNET_CONF_DEV_PRIORITY = 1,
-       NET_DECNET_CONF_DEV_T1 = 2,
-       NET_DECNET_CONF_DEV_T2 = 3,
-       NET_DECNET_CONF_DEV_T3 = 4,
-       NET_DECNET_CONF_DEV_FORWARDING = 5,
-       NET_DECNET_CONF_DEV_BLKSIZE = 6,
-       NET_DECNET_CONF_DEV_STATE = 7
-};
-
-/* /proc/sys/net/sctp */
-enum {
-       NET_SCTP_RTO_INITIAL = 1,
-       NET_SCTP_RTO_MIN     = 2,
-       NET_SCTP_RTO_MAX     = 3,
-       NET_SCTP_RTO_ALPHA   = 4,
-       NET_SCTP_RTO_BETA    = 5,
-       NET_SCTP_VALID_COOKIE_LIFE       =  6,
-       NET_SCTP_ASSOCIATION_MAX_RETRANS =  7,
-       NET_SCTP_PATH_MAX_RETRANS        =  8,
-       NET_SCTP_MAX_INIT_RETRANSMITS    =  9,
-       NET_SCTP_HB_INTERVAL             = 10,
-       NET_SCTP_PRESERVE_ENABLE         = 11,
-       NET_SCTP_MAX_BURST               = 12,
-       NET_SCTP_ADDIP_ENABLE            = 13,
-       NET_SCTP_PRSCTP_ENABLE           = 14,
-       NET_SCTP_SNDBUF_POLICY           = 15,
-       NET_SCTP_SACK_TIMEOUT            = 16,
-       NET_SCTP_RCVBUF_POLICY           = 17,
-};
-
-/* /proc/sys/net/bridge */
-enum {
-       NET_BRIDGE_NF_CALL_ARPTABLES = 1,
-       NET_BRIDGE_NF_CALL_IPTABLES = 2,
-       NET_BRIDGE_NF_CALL_IP6TABLES = 3,
-       NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
-       NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
-};
-
-/* proc/sys/net/irda */
-enum {
-       NET_IRDA_DISCOVERY=1,
-       NET_IRDA_DEVNAME=2,
-       NET_IRDA_DEBUG=3,
-       NET_IRDA_FAST_POLL=4,
-       NET_IRDA_DISCOVERY_SLOTS=5,
-       NET_IRDA_DISCOVERY_TIMEOUT=6,
-       NET_IRDA_SLOT_TIMEOUT=7,
-       NET_IRDA_MAX_BAUD_RATE=8,
-       NET_IRDA_MIN_TX_TURN_TIME=9,
-       NET_IRDA_MAX_TX_DATA_SIZE=10,
-       NET_IRDA_MAX_TX_WINDOW=11,
-       NET_IRDA_MAX_NOREPLY_TIME=12,
-       NET_IRDA_WARN_NOREPLY_TIME=13,
-       NET_IRDA_LAP_KEEPALIVE_TIME=14,
-};
-
-
-/* CTL_FS names: */
-enum
-{
-       FS_NRINODE=1,   /* int:current number of allocated inodes */
-       FS_STATINODE=2,
-       FS_MAXINODE=3,  /* int:maximum number of inodes that can be allocated */
-       FS_NRDQUOT=4,   /* int:current number of allocated dquots */
-       FS_MAXDQUOT=5,  /* int:maximum number of dquots that can be allocated */
-       FS_NRFILE=6,    /* int:current number of allocated filedescriptors */
-       FS_MAXFILE=7,   /* int:maximum number of filedescriptors that can be allocated */
-       FS_DENTRY=8,
-       FS_NRSUPER=9,   /* int:current number of allocated super_blocks */
-       FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
-       FS_OVERFLOWUID=11,      /* int: overflow UID */
-       FS_OVERFLOWGID=12,      /* int: overflow GID */
-       FS_LEASES=13,   /* int: leases enabled */
-       FS_DIR_NOTIFY=14,       /* int: directory notification enabled */
-       FS_LEASE_TIME=15,       /* int: maximum time to wait for a lease break */
-       FS_DQSTATS=16,  /* disc quota usage statistics and control */
-       FS_XFS=17,      /* struct: control xfs parameters */
-       FS_AIO_NR=18,   /* current system-wide number of aio requests */
-       FS_AIO_MAX_NR=19,       /* system-wide maximum number of aio requests */
-       FS_INOTIFY=20,  /* inotify submenu */
-       FS_OCFS2=988,   /* ocfs2 */
-};
-
-/* /proc/sys/fs/quota/ */
-enum {
-       FS_DQ_LOOKUPS = 1,
-       FS_DQ_DROPS = 2,
-       FS_DQ_READS = 3,
-       FS_DQ_WRITES = 4,
-       FS_DQ_CACHE_HITS = 5,
-       FS_DQ_ALLOCATED = 6,
-       FS_DQ_FREE = 7,
-       FS_DQ_SYNCS = 8,
-       FS_DQ_WARNINGS = 9,
-};
-
-/* CTL_DEBUG names: */
-
-/* CTL_DEV names: */
-enum {
-       DEV_CDROM=1,
-       DEV_HWMON=2,
-       DEV_PARPORT=3,
-       DEV_RAID=4,
-       DEV_MAC_HID=5,
-       DEV_SCSI=6,
-       DEV_IPMI=7,
-};
-
-/* /proc/sys/dev/cdrom */
-enum {
-       DEV_CDROM_INFO=1,
-       DEV_CDROM_AUTOCLOSE=2,
-       DEV_CDROM_AUTOEJECT=3,
-       DEV_CDROM_DEBUG=4,
-       DEV_CDROM_LOCK=5,
-       DEV_CDROM_CHECK_MEDIA=6
-};
-
-/* /proc/sys/dev/parport */
-enum {
-       DEV_PARPORT_DEFAULT=-3
-};
-
-/* /proc/sys/dev/raid */
-enum {
-       DEV_RAID_SPEED_LIMIT_MIN=1,
-       DEV_RAID_SPEED_LIMIT_MAX=2
-};
-
-/* /proc/sys/dev/parport/default */
-enum {
-       DEV_PARPORT_DEFAULT_TIMESLICE=1,
-       DEV_PARPORT_DEFAULT_SPINTIME=2
-};
-
-/* /proc/sys/dev/parport/parport n */
-enum {
-       DEV_PARPORT_SPINTIME=1,
-       DEV_PARPORT_BASE_ADDR=2,
-       DEV_PARPORT_IRQ=3,
-       DEV_PARPORT_DMA=4,
-       DEV_PARPORT_MODES=5,
-       DEV_PARPORT_DEVICES=6,
-       DEV_PARPORT_AUTOPROBE=16
-};
-
-/* /proc/sys/dev/parport/parport n/devices/ */
-enum {
-       DEV_PARPORT_DEVICES_ACTIVE=-3,
-};
-
-/* /proc/sys/dev/parport/parport n/devices/device n */
-enum {
-       DEV_PARPORT_DEVICE_TIMESLICE=1,
-};
-
-/* /proc/sys/dev/mac_hid */
-enum {
-       DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
-       DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
-       DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
-       DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
-       DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
-       DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
-};
-
-/* /proc/sys/dev/scsi */
-enum {
-       DEV_SCSI_LOGGING_LEVEL=1,
-};
-
-/* /proc/sys/dev/ipmi */
-enum {
-       DEV_IPMI_POWEROFF_POWERCYCLE=1,
-};
-
-/* /proc/sys/abi */
-enum
-{
-       ABI_DEFHANDLER_COFF=1,  /* default handler for coff binaries */
-       ABI_DEFHANDLER_ELF=2,   /* default handler for ELF binaries */
-       ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
-       ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
-       ABI_TRACE=5,            /* tracing flags */
-       ABI_FAKE_UTSNAME=6,     /* fake target utsname information */
-};
-
-#ifdef __KERNEL__
 #include <linux/list.h>
 #include <linux/rcupdate.h>
 #include <linux/wait.h>
 #include <linux/rbtree.h>
+#include <uapi/linux/sysctl.h>
 
 /* For the /proc/sys support */
 struct ctl_table;
@@ -1122,6 +215,4 @@ static inline void setup_sysctl_set(struct ctl_table_set *p,
 
 #endif /* CONFIG_SYSCTL */
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_SYSCTL_H */
index 67c789ae719c7f6216870db74df3afc0223de66b..8a7fc4be2d75f11d0ff774e727940dd16a2c64aa 100644 (file)
 #ifndef _LINUX_TCP_H
 #define _LINUX_TCP_H
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
-#include <linux/socket.h>
-
-struct tcphdr {
-       __be16  source;
-       __be16  dest;
-       __be32  seq;
-       __be32  ack_seq;
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-       __u16   res1:4,
-               doff:4,
-               fin:1,
-               syn:1,
-               rst:1,
-               psh:1,
-               ack:1,
-               urg:1,
-               ece:1,
-               cwr:1;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-       __u16   doff:4,
-               res1:4,
-               cwr:1,
-               ece:1,
-               urg:1,
-               ack:1,
-               psh:1,
-               rst:1,
-               syn:1,
-               fin:1;
-#else
-#error "Adjust your <asm/byteorder.h> defines"
-#endif 
-       __be16  window;
-       __sum16 check;
-       __be16  urg_ptr;
-};
-
-/*
- *     The union cast uses a gcc extension to avoid aliasing problems
- *  (union is compatible to any of its members)
- *  This means this part of the code is -fstrict-aliasing safe now.
- */
-union tcp_word_hdr { 
-       struct tcphdr hdr;
-       __be32            words[5];
-}; 
-
-#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
-
-enum { 
-       TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
-       TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
-       TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
-       TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
-       TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
-       TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
-       TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
-       TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
-       TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
-       TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
-}; 
-
-/*
- * TCP general constants
- */
-#define TCP_MSS_DEFAULT                 536U   /* IPv4 (RFC1122, RFC2581) */
-#define TCP_MSS_DESIRED                1220U   /* IPv6 (tunneled), EDNS0 (RFC3226) */
-
-/* TCP socket options */
-#define TCP_NODELAY            1       /* Turn off Nagle's algorithm. */
-#define TCP_MAXSEG             2       /* Limit MSS */
-#define TCP_CORK               3       /* Never send partially complete segments */
-#define TCP_KEEPIDLE           4       /* Start keeplives after this period */
-#define TCP_KEEPINTVL          5       /* Interval between keepalives */
-#define TCP_KEEPCNT            6       /* Number of keepalives before death */
-#define TCP_SYNCNT             7       /* Number of SYN retransmits */
-#define TCP_LINGER2            8       /* Life time of orphaned FIN-WAIT-2 state */
-#define TCP_DEFER_ACCEPT       9       /* Wake up listener only when data arrive */
-#define TCP_WINDOW_CLAMP       10      /* Bound advertised window */
-#define TCP_INFO               11      /* Information about this connection. */
-#define TCP_QUICKACK           12      /* Block/reenable quick acks */
-#define TCP_CONGESTION         13      /* Congestion control algorithm */
-#define TCP_MD5SIG             14      /* TCP MD5 Signature (RFC2385) */
-#define TCP_COOKIE_TRANSACTIONS        15      /* TCP Cookie Transactions */
-#define TCP_THIN_LINEAR_TIMEOUTS 16      /* Use linear timeouts for thin streams*/
-#define TCP_THIN_DUPACK         17      /* Fast retrans. after 1 dupack */
-#define TCP_USER_TIMEOUT       18      /* How long for loss retry before timeout */
-#define TCP_REPAIR             19      /* TCP sock is under repair right now */
-#define TCP_REPAIR_QUEUE       20
-#define TCP_QUEUE_SEQ          21
-#define TCP_REPAIR_OPTIONS     22
-#define TCP_FASTOPEN           23      /* Enable FastOpen on listeners */
-
-struct tcp_repair_opt {
-       __u32   opt_code;
-       __u32   opt_val;
-};
-
-enum {
-       TCP_NO_QUEUE,
-       TCP_RECV_QUEUE,
-       TCP_SEND_QUEUE,
-       TCP_QUEUES_NR,
-};
-
-/* for TCP_INFO socket option */
-#define TCPI_OPT_TIMESTAMPS    1
-#define TCPI_OPT_SACK          2
-#define TCPI_OPT_WSCALE                4
-#define TCPI_OPT_ECN           8 /* ECN was negociated at TCP session init */
-#define TCPI_OPT_ECN_SEEN      16 /* we received at least one packet with ECT */
-
-enum tcp_ca_state {
-       TCP_CA_Open = 0,
-#define TCPF_CA_Open   (1<<TCP_CA_Open)
-       TCP_CA_Disorder = 1,
-#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
-       TCP_CA_CWR = 2,
-#define TCPF_CA_CWR    (1<<TCP_CA_CWR)
-       TCP_CA_Recovery = 3,
-#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
-       TCP_CA_Loss = 4
-#define TCPF_CA_Loss   (1<<TCP_CA_Loss)
-};
-
-struct tcp_info {
-       __u8    tcpi_state;
-       __u8    tcpi_ca_state;
-       __u8    tcpi_retransmits;
-       __u8    tcpi_probes;
-       __u8    tcpi_backoff;
-       __u8    tcpi_options;
-       __u8    tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
-
-       __u32   tcpi_rto;
-       __u32   tcpi_ato;
-       __u32   tcpi_snd_mss;
-       __u32   tcpi_rcv_mss;
-
-       __u32   tcpi_unacked;
-       __u32   tcpi_sacked;
-       __u32   tcpi_lost;
-       __u32   tcpi_retrans;
-       __u32   tcpi_fackets;
-
-       /* Times. */
-       __u32   tcpi_last_data_sent;
-       __u32   tcpi_last_ack_sent;     /* Not remembered, sorry. */
-       __u32   tcpi_last_data_recv;
-       __u32   tcpi_last_ack_recv;
-
-       /* Metrics. */
-       __u32   tcpi_pmtu;
-       __u32   tcpi_rcv_ssthresh;
-       __u32   tcpi_rtt;
-       __u32   tcpi_rttvar;
-       __u32   tcpi_snd_ssthresh;
-       __u32   tcpi_snd_cwnd;
-       __u32   tcpi_advmss;
-       __u32   tcpi_reordering;
-
-       __u32   tcpi_rcv_rtt;
-       __u32   tcpi_rcv_space;
-
-       __u32   tcpi_total_retrans;
-};
-
-/* for TCP_MD5SIG socket option */
-#define TCP_MD5SIG_MAXKEYLEN   80
-
-struct tcp_md5sig {
-       struct __kernel_sockaddr_storage tcpm_addr;     /* address associated */
-       __u16   __tcpm_pad1;                            /* zero */
-       __u16   tcpm_keylen;                            /* key length */
-       __u32   __tcpm_pad2;                            /* zero */
-       __u8    tcpm_key[TCP_MD5SIG_MAXKEYLEN];         /* key (binary) */
-};
-
-/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
-#define TCP_COOKIE_MIN          8              /*  64-bits */
-#define TCP_COOKIE_MAX         16              /* 128-bits */
-#define TCP_COOKIE_PAIR_SIZE   (2*TCP_COOKIE_MAX)
-
-/* Flags for both getsockopt and setsockopt */
-#define TCP_COOKIE_IN_ALWAYS   (1 << 0)        /* Discard SYN without cookie */
-#define TCP_COOKIE_OUT_NEVER   (1 << 1)        /* Prohibit outgoing cookies,
-                                                * supercedes everything. */
-
-/* Flags for getsockopt */
-#define TCP_S_DATA_IN          (1 << 2)        /* Was data received? */
-#define TCP_S_DATA_OUT         (1 << 3)        /* Was data sent? */
-
-/* TCP_COOKIE_TRANSACTIONS data */
-struct tcp_cookie_transactions {
-       __u16   tcpct_flags;                    /* see above */
-       __u8    __tcpct_pad1;                   /* zero */
-       __u8    tcpct_cookie_desired;           /* bytes */
-       __u16   tcpct_s_data_desired;           /* bytes of variable data */
-       __u16   tcpct_used;                     /* bytes in value */
-       __u8    tcpct_value[TCP_MSS_DEFAULT];
-};
-
-#ifdef __KERNEL__
 
 #include <linux/skbuff.h>
 #include <linux/dmaengine.h>
 #include <net/sock.h>
 #include <net/inet_connection_sock.h>
 #include <net/inet_timewait_sock.h>
+#include <uapi/linux/tcp.h>
 
 static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
 {
@@ -595,6 +391,4 @@ static inline int fastopen_init_queue(struct sock *sk, int backlog)
        return 0;
 }
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_TCP_H */
index b51e664c83e7237e17e02f0b5752ce586f87dbd4..4d358e9d10f100757176df607b502a451aafc6bb 100644 (file)
@@ -1,33 +1,10 @@
 #ifndef _LINUX_TIME_H
 #define _LINUX_TIME_H
 
-#include <linux/types.h>
-
-#ifdef __KERNEL__
 # include <linux/cache.h>
 # include <linux/seqlock.h>
 # include <linux/math64.h>
-#endif
-
-#ifndef _STRUCT_TIMESPEC
-#define _STRUCT_TIMESPEC
-struct timespec {
-       __kernel_time_t tv_sec;                 /* seconds */
-       long            tv_nsec;                /* nanoseconds */
-};
-#endif
-
-struct timeval {
-       __kernel_time_t         tv_sec;         /* seconds */
-       __kernel_suseconds_t    tv_usec;        /* microseconds */
-};
-
-struct timezone {
-       int     tz_minuteswest; /* minutes west of Greenwich */
-       int     tz_dsttime;     /* type of dst correction */
-};
-
-#ifdef __KERNEL__
+#include <uapi/linux/time.h>
 
 extern struct timezone sys_tz;
 
@@ -280,51 +257,4 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
        a->tv_nsec = ns;
 }
 
-#endif /* __KERNEL__ */
-
-/*
- * Names of the interval timers, and structure
- * defining a timer setting:
- */
-#define        ITIMER_REAL             0
-#define        ITIMER_VIRTUAL          1
-#define        ITIMER_PROF             2
-
-struct itimerspec {
-       struct timespec it_interval;    /* timer period */
-       struct timespec it_value;       /* timer expiration */
-};
-
-struct itimerval {
-       struct timeval it_interval;     /* timer interval */
-       struct timeval it_value;        /* current value */
-};
-
-/*
- * The IDs of the various system clocks (for POSIX.1b interval timers):
- */
-#define CLOCK_REALTIME                 0
-#define CLOCK_MONOTONIC                        1
-#define CLOCK_PROCESS_CPUTIME_ID       2
-#define CLOCK_THREAD_CPUTIME_ID                3
-#define CLOCK_MONOTONIC_RAW            4
-#define CLOCK_REALTIME_COARSE          5
-#define CLOCK_MONOTONIC_COARSE         6
-#define CLOCK_BOOTTIME                 7
-#define CLOCK_REALTIME_ALARM           8
-#define CLOCK_BOOTTIME_ALARM           9
-
-/*
- * The IDs of various hardware clocks:
- */
-#define CLOCK_SGI_CYCLE                        10
-#define MAX_CLOCKS                     16
-#define CLOCKS_MASK                    (CLOCK_REALTIME | CLOCK_MONOTONIC)
-#define CLOCKS_MONO                    CLOCK_MONOTONIC
-
-/*
- * The various flags for setting POSIX.1b interval timers:
- */
-#define TIMER_ABSTIME                  0x01
-
 #endif
index 7c5ceb20e03a8cf2195ae114e1f78905668158e5..5ec87c60b97c5029a5f58b4282a0428767be3746 100644 (file)
 #ifndef _LINUX_TIMEX_H
 #define _LINUX_TIMEX_H
 
-#include <linux/time.h>
+#include <uapi/linux/timex.h>
 
-#define NTP_API                4       /* NTP API version */
-
-/*
- * syscall interface - used (mainly by NTP daemon)
- * to discipline kernel clock oscillator
- */
-struct timex {
-       unsigned int modes;     /* mode selector */
-       long offset;            /* time offset (usec) */
-       long freq;              /* frequency offset (scaled ppm) */
-       long maxerror;          /* maximum error (usec) */
-       long esterror;          /* estimated error (usec) */
-       int status;             /* clock command/status */
-       long constant;          /* pll time constant */
-       long precision;         /* clock precision (usec) (read only) */
-       long tolerance;         /* clock frequency tolerance (ppm)
-                                * (read only)
-                                */
-       struct timeval time;    /* (read only, except for ADJ_SETOFFSET) */
-       long tick;              /* (modified) usecs between clock ticks */
-
-       long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
-       long jitter;            /* pps jitter (us) (ro) */
-       int shift;              /* interval duration (s) (shift) (ro) */
-       long stabil;            /* pps stability (scaled ppm) (ro) */
-       long jitcnt;            /* jitter limit exceeded (ro) */
-       long calcnt;            /* calibration intervals (ro) */
-       long errcnt;            /* calibration errors (ro) */
-       long stbcnt;            /* stability limit exceeded (ro) */
-
-       int tai;                /* TAI offset (ro) */
-
-       int  :32; int  :32; int  :32; int  :32;
-       int  :32; int  :32; int  :32; int  :32;
-       int  :32; int  :32; int  :32;
-};
-
-/*
- * Mode codes (timex.mode)
- */
-#define ADJ_OFFSET             0x0001  /* time offset */
-#define ADJ_FREQUENCY          0x0002  /* frequency offset */
-#define ADJ_MAXERROR           0x0004  /* maximum time error */
-#define ADJ_ESTERROR           0x0008  /* estimated time error */
-#define ADJ_STATUS             0x0010  /* clock status */
-#define ADJ_TIMECONST          0x0020  /* pll time constant */
-#define ADJ_TAI                        0x0080  /* set TAI offset */
-#define ADJ_SETOFFSET          0x0100  /* add 'time' to current time */
-#define ADJ_MICRO              0x1000  /* select microsecond resolution */
-#define ADJ_NANO               0x2000  /* select nanosecond resolution */
-#define ADJ_TICK               0x4000  /* tick value */
-
-#ifdef __KERNEL__
 #define ADJ_ADJTIME            0x8000  /* switch between adjtime/adjtimex modes */
 #define ADJ_OFFSET_SINGLESHOT  0x0001  /* old-fashioned adjtime */
 #define ADJ_OFFSET_READONLY    0x2000  /* read-only adjtime */
-#else
-#define ADJ_OFFSET_SINGLESHOT  0x8001  /* old-fashioned adjtime */
-#define ADJ_OFFSET_SS_READ     0xa001  /* read-only adjtime */
-#endif
-
-/* NTP userland likes the MOD_ prefix better */
-#define MOD_OFFSET     ADJ_OFFSET
-#define MOD_FREQUENCY  ADJ_FREQUENCY
-#define MOD_MAXERROR   ADJ_MAXERROR
-#define MOD_ESTERROR   ADJ_ESTERROR
-#define MOD_STATUS     ADJ_STATUS
-#define MOD_TIMECONST  ADJ_TIMECONST
-#define MOD_TAI        ADJ_TAI
-#define MOD_MICRO      ADJ_MICRO
-#define MOD_NANO       ADJ_NANO
-
-
-/*
- * Status codes (timex.status)
- */
-#define STA_PLL                0x0001  /* enable PLL updates (rw) */
-#define STA_PPSFREQ    0x0002  /* enable PPS freq discipline (rw) */
-#define STA_PPSTIME    0x0004  /* enable PPS time discipline (rw) */
-#define STA_FLL                0x0008  /* select frequency-lock mode (rw) */
-
-#define STA_INS                0x0010  /* insert leap (rw) */
-#define STA_DEL                0x0020  /* delete leap (rw) */
-#define STA_UNSYNC     0x0040  /* clock unsynchronized (rw) */
-#define STA_FREQHOLD   0x0080  /* hold frequency (rw) */
-
-#define STA_PPSSIGNAL  0x0100  /* PPS signal present (ro) */
-#define STA_PPSJITTER  0x0200  /* PPS signal jitter exceeded (ro) */
-#define STA_PPSWANDER  0x0400  /* PPS signal wander exceeded (ro) */
-#define STA_PPSERROR   0x0800  /* PPS signal calibration error (ro) */
-
-#define STA_CLOCKERR   0x1000  /* clock hardware fault (ro) */
-#define STA_NANO       0x2000  /* resolution (0 = us, 1 = ns) (ro) */
-#define STA_MODE       0x4000  /* mode (0 = PLL, 1 = FLL) (ro) */
-#define STA_CLK                0x8000  /* clock source (0 = A, 1 = B) (ro) */
-
-/* read-only bits */
-#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
-       STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
-
-/*
- * Clock states (time_state)
- */
-#define TIME_OK                0       /* clock synchronized, no leap second */
-#define TIME_INS       1       /* insert leap second */
-#define TIME_DEL       2       /* delete leap second */
-#define TIME_OOP       3       /* leap second in progress */
-#define TIME_WAIT      4       /* leap second has occurred */
-#define TIME_ERROR     5       /* clock not synchronized */
-#define TIME_BAD       TIME_ERROR /* bw compat */
-
-#ifdef __KERNEL__
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <linux/param.h>
@@ -261,6 +152,4 @@ int read_current_timer(unsigned long *timer_val);
 /* The clock frequency of the i8253/i8254 PIT */
 #define PIT_TICK_RATE 1193182ul
 
-#endif /* KERNEL */
-
 #endif /* LINUX_TIMEX_H */
index 772dedbc3a22e039328d2e148dee867b866d007b..915c3bb164ac5024e493e6d8e925ef7c1937f7a2 100644 (file)
  * General Public License for more details.
  *
  */
-
 #ifndef _LINUX_TOSHIBA_H
 #define _LINUX_TOSHIBA_H
 
-#define TOSH_PROC "/proc/toshiba"
-#define TOSH_DEVICE "/dev/toshiba"
-#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
-
-typedef struct {
-       unsigned int eax;
-       unsigned int ebx __attribute__ ((packed));
-       unsigned int ecx __attribute__ ((packed));
-       unsigned int edx __attribute__ ((packed));
-       unsigned int esi __attribute__ ((packed));
-       unsigned int edi __attribute__ ((packed));
-} SMMRegisters;
+#include <uapi/linux/toshiba.h>
 
-#ifdef __KERNEL__
 int tosh_smm(SMMRegisters *regs);
-#endif /* __KERNEL__ */
-
 #endif
index 4f6c59a5fb7941996e8062dd41efe99ec3623555..f0b4eb47297c8b10a356c96d929e272702a7dd7b 100644 (file)
@@ -1,41 +1,6 @@
 #ifndef _LINUX_TTY_H
 #define _LINUX_TTY_H
 
-/*
- * 'tty.h' defines some structures used by tty_io.c and some defines.
- */
-
-#define NR_LDISCS              30
-
-/* line disciplines */
-#define N_TTY          0
-#define N_SLIP         1
-#define N_MOUSE                2
-#define N_PPP          3
-#define N_STRIP                4
-#define N_AX25         5
-#define N_X25          6       /* X.25 async */
-#define N_6PACK                7
-#define N_MASC         8       /* Reserved for Mobitex module <kaz@cafe.net> */
-#define N_R3964                9       /* Reserved for Simatic R3964 module */
-#define N_PROFIBUS_FDL 10      /* Reserved for Profibus */
-#define N_IRDA         11      /* Linux IrDa - http://irda.sourceforge.net/ */
-#define N_SMSBLOCK     12      /* SMS block mode - for talking to GSM data */
-                               /* cards about SMS messages */
-#define N_HDLC         13      /* synchronous HDLC */
-#define N_SYNC_PPP     14      /* synchronous PPP */
-#define N_HCI          15      /* Bluetooth HCI UART */
-#define N_GIGASET_M101 16      /* Siemens Gigaset M101 serial DECT adapter */
-#define N_SLCAN                17      /* Serial / USB serial CAN Adaptors */
-#define N_PPS          18      /* Pulse per Second */
-#define N_V253         19      /* Codec control over voice modem */
-#define N_CAIF         20      /* CAIF protocol for talking to modems */
-#define N_GSM0710      21      /* GSM 0710 Mux */
-#define N_TI_WL                22      /* for TI's WL BT, FM, GPS combo chips */
-#define N_TRACESINK    23      /* Trace data routing for MIPI P1149.7 */
-#define N_TRACEROUTER  24      /* Trace data routing for MIPI P1149.7 */
-
-#ifdef __KERNEL__
 #include <linux/fs.h>
 #include <linux/major.h>
 #include <linux/termios.h>
@@ -44,6 +9,7 @@
 #include <linux/tty_ldisc.h>
 #include <linux/mutex.h>
 #include <linux/tty_flags.h>
+#include <uapi/linux/tty.h>
 
 
 
@@ -694,5 +660,4 @@ do {                                                                        \
 } while (0)
 
 
-#endif /* __KERNEL__ */
 #endif
index bf0dd7524b2a81cb660723c08ce76857991df54e..1cc0e4b9a048140420c45317980bd15f8e6524a8 100644 (file)
@@ -1,22 +1,13 @@
 #ifndef _LINUX_TYPES_H
 #define _LINUX_TYPES_H
 
-#include <asm/types.h>
+#define __EXPORTED_HEADERS__
+#include <uapi/linux/types.h>
 
 #ifndef __ASSEMBLY__
-#ifdef __KERNEL__
 
 #define DECLARE_BITMAP(name,bits) \
        unsigned long name[BITS_TO_LONGS(bits)]
-#else
-#ifndef __EXPORTED_HEADERS__
-#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
-#endif /* __EXPORTED_HEADERS__ */
-#endif
-
-#include <linux/posix_types.h>
-
-#ifdef __KERNEL__
 
 typedef __u32 __kernel_dev_t;
 
@@ -157,48 +148,12 @@ typedef u64 dma_addr_t;
 typedef u32 dma_addr_t;
 #endif /* dma_addr_t */
 
-#endif /* __KERNEL__ */
-
-/*
- * Below are truly Linux-specific types that should never collide with
- * any application/library that wants linux/types.h.
- */
-
 #ifdef __CHECKER__
-#define __bitwise__ __attribute__((bitwise))
 #else
-#define __bitwise__
 #endif
 #ifdef __CHECK_ENDIAN__
-#define __bitwise __bitwise__
 #else
-#define __bitwise
 #endif
-
-typedef __u16 __bitwise __le16;
-typedef __u16 __bitwise __be16;
-typedef __u32 __bitwise __le32;
-typedef __u32 __bitwise __be32;
-typedef __u64 __bitwise __le64;
-typedef __u64 __bitwise __be64;
-
-typedef __u16 __bitwise __sum16;
-typedef __u32 __bitwise __wsum;
-
-/*
- * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
- * common 32/64-bit compat problems.
- * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
- * architectures) and to 8-byte boundaries on 64-bit architectures.  The new
- * aligned_64 type enforces 8-byte alignment so that structs containing
- * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
- * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
- */
-#define __aligned_u64 __u64 __attribute__((aligned(8)))
-#define __aligned_be64 __be64 __attribute__((aligned(8)))
-#define __aligned_le64 __le64 __attribute__((aligned(8)))
-
-#ifdef __KERNEL__
 typedef unsigned __bitwise__ gfp_t;
 typedef unsigned __bitwise__ fmode_t;
 
@@ -256,6 +211,5 @@ struct callback_head {
 };
 #define rcu_head callback_head
 
-#endif /* __KERNEL__ */
 #endif /*  __ASSEMBLY__ */
 #endif /* _LINUX_TYPES_H */
index 03f72a2ba028f17dd1776e4e9a01537a539f6f90..0b67d77935204b2ae7dab682270cc30a1b1da6d6 100644 (file)
 #ifndef _LINUX_UDP_H
 #define _LINUX_UDP_H
 
-#include <linux/types.h>
-
-struct udphdr {
-       __be16  source;
-       __be16  dest;
-       __be16  len;
-       __sum16 check;
-};
-
-/* UDP socket options */
-#define UDP_CORK       1       /* Never send partially complete segments */
-#define UDP_ENCAP      100     /* Set the socket to accept encapsulated packets */
-
-/* UDP encapsulation types */
-#define UDP_ENCAP_ESPINUDP_NON_IKE     1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
-#define UDP_ENCAP_ESPINUDP     2 /* draft-ietf-ipsec-udp-encaps-06 */
-#define UDP_ENCAP_L2TPINUDP    3 /* rfc2661 */
-
-#ifdef __KERNEL__
 #include <net/inet_sock.h>
 #include <linux/skbuff.h>
 #include <net/netns/hash.h>
+#include <uapi/linux/udp.h>
 
 static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
 {
@@ -96,6 +78,4 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
 
 #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
 
-#endif
-
 #endif /* _LINUX_UDP_H */
index c454bbe39ee78688d6c5e797236649148c909900..0a4487d3fb1ee43d436c37712f76403006c86dc4 100644 (file)
@@ -1,5 +1,3 @@
-#ifndef __UINPUT_H_
-#define __UINPUT_H_
 /*
  *  User level driver support for input subsystem
  *
  *     0.1     20/06/2002
  *             - first public version
  */
+#ifndef __UINPUT_H_
+#define __UINPUT_H_
 
-#include <linux/types.h>
-#include <linux/input.h>
-
-#define UINPUT_VERSION         3
+#include <uapi/linux/uinput.h>
 
-#ifdef __KERNEL__
 #define UINPUT_NAME            "uinput"
 #define UINPUT_BUFFER_SIZE     16
 #define UINPUT_NUM_REQUESTS    16
@@ -75,103 +71,4 @@ struct uinput_device {
        wait_queue_head_t       requests_waitq;
        spinlock_t              requests_lock;
 };
-#endif /* __KERNEL__ */
-
-struct uinput_ff_upload {
-       __u32                   request_id;
-       __s32                   retval;
-       struct ff_effect        effect;
-       struct ff_effect        old;
-};
-
-struct uinput_ff_erase {
-       __u32                   request_id;
-       __s32                   retval;
-       __u32                   effect_id;
-};
-
-/* ioctl */
-#define UINPUT_IOCTL_BASE      'U'
-#define UI_DEV_CREATE          _IO(UINPUT_IOCTL_BASE, 1)
-#define UI_DEV_DESTROY         _IO(UINPUT_IOCTL_BASE, 2)
-
-#define UI_SET_EVBIT           _IOW(UINPUT_IOCTL_BASE, 100, int)
-#define UI_SET_KEYBIT          _IOW(UINPUT_IOCTL_BASE, 101, int)
-#define UI_SET_RELBIT          _IOW(UINPUT_IOCTL_BASE, 102, int)
-#define UI_SET_ABSBIT          _IOW(UINPUT_IOCTL_BASE, 103, int)
-#define UI_SET_MSCBIT          _IOW(UINPUT_IOCTL_BASE, 104, int)
-#define UI_SET_LEDBIT          _IOW(UINPUT_IOCTL_BASE, 105, int)
-#define UI_SET_SNDBIT          _IOW(UINPUT_IOCTL_BASE, 106, int)
-#define UI_SET_FFBIT           _IOW(UINPUT_IOCTL_BASE, 107, int)
-#define UI_SET_PHYS            _IOW(UINPUT_IOCTL_BASE, 108, char*)
-#define UI_SET_SWBIT           _IOW(UINPUT_IOCTL_BASE, 109, int)
-#define UI_SET_PROPBIT         _IOW(UINPUT_IOCTL_BASE, 110, int)
-
-#define UI_BEGIN_FF_UPLOAD     _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
-#define UI_END_FF_UPLOAD       _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
-#define UI_BEGIN_FF_ERASE      _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
-#define UI_END_FF_ERASE                _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
-
-/*
- * To write a force-feedback-capable driver, the upload_effect
- * and erase_effect callbacks in input_dev must be implemented.
- * The uinput driver will generate a fake input event when one of
- * these callbacks are invoked. The userspace code then uses
- * ioctls to retrieve additional parameters and send the return code.
- * The callback blocks until this return code is sent.
- *
- * The described callback mechanism is only used if ff_effects_max
- * is set.
- *
- * To implement upload_effect():
- *   1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
- *      A request ID will be given in 'value'.
- *   2. Allocate a uinput_ff_upload struct, fill in request_id with
- *      the 'value' from the EV_UINPUT event.
- *   3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
- *      uinput_ff_upload struct. It will be filled in with the
- *      ff_effects passed to upload_effect().
- *   4. Perform the effect upload, and place a return code back into
-        the uinput_ff_upload struct.
- *   5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
- *      uinput_ff_upload_effect struct. This will complete execution
- *      of our upload_effect() handler.
- *
- * To implement erase_effect():
- *   1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
- *      A request ID will be given in 'value'.
- *   2. Allocate a uinput_ff_erase struct, fill in request_id with
- *      the 'value' from the EV_UINPUT event.
- *   3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
- *      uinput_ff_erase struct. It will be filled in with the
- *      effect ID passed to erase_effect().
- *   4. Perform the effect erasure, and place a return code back
- *      into the uinput_ff_erase struct.
- *   5. Issue a UI_END_FF_ERASE ioctl, also giving it the
- *      uinput_ff_erase_effect struct. This will complete execution
- *      of our erase_effect() handler.
- */
-
-/*
- * This is the new event type, used only by uinput.
- * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
- * is the unique request ID. This number was picked
- * arbitrarily, above EV_MAX (since the input system
- * never sees it) but in the range of a 16-bit int.
- */
-#define EV_UINPUT              0x0101
-#define UI_FF_UPLOAD           1
-#define UI_FF_ERASE            2
-
-#define UINPUT_MAX_NAME_SIZE   80
-struct uinput_user_dev {
-       char name[UINPUT_MAX_NAME_SIZE];
-       struct input_id id;
-       __u32 ff_effects_max;
-       __s32 absmax[ABS_CNT];
-       __s32 absmin[ABS_CNT];
-       __s32 absfuzz[ABS_CNT];
-       __s32 absflat[ABS_CNT];
-};
 #endif /* __UINPUT_H_ */
-
index 98c114323a8be51299300bf440ec6ff167ac2fdb..629aaf51f30b8c1fdc6e27cd086c9caf19378896 100644 (file)
@@ -1,9 +1,3 @@
-#ifndef __LINUX_UIO_H
-#define __LINUX_UIO_H
-
-#include <linux/compiler.h>
-#include <linux/types.h>
-
 /*
  *     Berkeley style UIO structures   -       Alan Cox 1994.
  *
  *             as published by the Free Software Foundation; either version
  *             2 of the License, or (at your option) any later version.
  */
+#ifndef __LINUX_UIO_H
+#define __LINUX_UIO_H
 
-struct iovec
-{
-       void __user *iov_base;  /* BSD uses caddr_t (1003.1g requires void *) */
-       __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
-};
-
-/*
- *     UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
- */
-#define UIO_FASTIOV    8
-#define UIO_MAXIOV     1024
+#include <uapi/linux/uio.h>
 
-#ifdef __KERNEL__
 
 struct kvec {
        void *iov_base; /* and that should *never* hold a userland pointer */
@@ -52,5 +36,3 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
 
 unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
 #endif
-
-#endif
index 4abe28e41cbcd90ce9297ac65bafbcc9add4c861..04a26285416cf339dbbef58e5565b676bcf7c65a 100644 (file)
  */
 
 /*****************************************************************************/
-
 #ifndef _LINUX_USBDEVICE_FS_H
 #define _LINUX_USBDEVICE_FS_H
 
-#include <linux/types.h>
-#include <linux/magic.h>
-
-/* --------------------------------------------------------------------- */
-
-/* usbdevfs ioctl codes */
-
-struct usbdevfs_ctrltransfer {
-       __u8 bRequestType;
-       __u8 bRequest;
-       __u16 wValue;
-       __u16 wIndex;
-       __u16 wLength;
-       __u32 timeout;  /* in milliseconds */
-       void __user *data;
-};
-
-struct usbdevfs_bulktransfer {
-       unsigned int ep;
-       unsigned int len;
-       unsigned int timeout; /* in milliseconds */
-       void __user *data;
-};
-
-struct usbdevfs_setinterface {
-       unsigned int interface;
-       unsigned int altsetting;
-};
-
-struct usbdevfs_disconnectsignal {
-       unsigned int signr;
-       void __user *context;
-};
-
-#define USBDEVFS_MAXDRIVERNAME 255
-
-struct usbdevfs_getdriver {
-       unsigned int interface;
-       char driver[USBDEVFS_MAXDRIVERNAME + 1];
-};
-
-struct usbdevfs_connectinfo {
-       unsigned int devnum;
-       unsigned char slow;
-};
-
-#define USBDEVFS_URB_SHORT_NOT_OK      0x01
-#define USBDEVFS_URB_ISO_ASAP          0x02
-#define USBDEVFS_URB_BULK_CONTINUATION 0x04
-#define USBDEVFS_URB_NO_FSBR           0x20
-#define USBDEVFS_URB_ZERO_PACKET       0x40
-#define USBDEVFS_URB_NO_INTERRUPT      0x80
-
-#define USBDEVFS_URB_TYPE_ISO             0
-#define USBDEVFS_URB_TYPE_INTERRUPT       1
-#define USBDEVFS_URB_TYPE_CONTROL         2
-#define USBDEVFS_URB_TYPE_BULK            3
+#include <uapi/linux/usbdevice_fs.h>
 
-struct usbdevfs_iso_packet_desc {
-       unsigned int length;
-       unsigned int actual_length;
-       unsigned int status;
-};
-
-struct usbdevfs_urb {
-       unsigned char type;
-       unsigned char endpoint;
-       int status;
-       unsigned int flags;
-       void __user *buffer;
-       int buffer_length;
-       int actual_length;
-       int start_frame;
-       int number_of_packets;
-       int error_count;
-       unsigned int signr;     /* signal to be sent on completion,
-                                 or 0 if none should be sent. */
-       void __user *usercontext;
-       struct usbdevfs_iso_packet_desc iso_frame_desc[0];
-};
-
-/* ioctls for talking directly to drivers */
-struct usbdevfs_ioctl {
-       int     ifno;           /* interface 0..N ; negative numbers reserved */
-       int     ioctl_code;     /* MUST encode size + direction of data so the
-                                * macros in <asm/ioctl.h> give correct values */
-       void __user *data;      /* param buffer (in, or out) */
-};
-
-/* You can do most things with hubs just through control messages,
- * except find out what device connects to what port. */
-struct usbdevfs_hub_portinfo {
-       char nports;            /* number of downstream ports in this hub */
-       char port [127];        /* e.g. port 3 connects to device 27 */
-};
-
-/* Device capability flags */
-#define USBDEVFS_CAP_ZERO_PACKET               0x01
-#define USBDEVFS_CAP_BULK_CONTINUATION         0x02
-#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM                0x04
-#define USBDEVFS_CAP_BULK_SCATTER_GATHER       0x08
-
-/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
-
-/* disconnect-and-claim if the driver matches the driver field */
-#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER    0x01
-/* disconnect-and-claim except when the driver matches the driver field */
-#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER        0x02
-
-struct usbdevfs_disconnect_claim {
-       unsigned int interface;
-       unsigned int flags;
-       char driver[USBDEVFS_MAXDRIVERNAME + 1];
-};
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
 
@@ -192,38 +77,4 @@ struct usbdevfs_ioctl32 {
        compat_caddr_t data;
 };
 #endif
-#endif /* __KERNEL__ */
-
-#define USBDEVFS_CONTROL           _IOWR('U', 0, struct usbdevfs_ctrltransfer)
-#define USBDEVFS_CONTROL32           _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
-#define USBDEVFS_BULK              _IOWR('U', 2, struct usbdevfs_bulktransfer)
-#define USBDEVFS_BULK32              _IOWR('U', 2, struct usbdevfs_bulktransfer32)
-#define USBDEVFS_RESETEP           _IOR('U', 3, unsigned int)
-#define USBDEVFS_SETINTERFACE      _IOR('U', 4, struct usbdevfs_setinterface)
-#define USBDEVFS_SETCONFIGURATION  _IOR('U', 5, unsigned int)
-#define USBDEVFS_GETDRIVER         _IOW('U', 8, struct usbdevfs_getdriver)
-#define USBDEVFS_SUBMITURB         _IOR('U', 10, struct usbdevfs_urb)
-#define USBDEVFS_SUBMITURB32       _IOR('U', 10, struct usbdevfs_urb32)
-#define USBDEVFS_DISCARDURB        _IO('U', 11)
-#define USBDEVFS_REAPURB           _IOW('U', 12, void *)
-#define USBDEVFS_REAPURB32         _IOW('U', 12, __u32)
-#define USBDEVFS_REAPURBNDELAY     _IOW('U', 13, void *)
-#define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, __u32)
-#define USBDEVFS_DISCSIGNAL        _IOR('U', 14, struct usbdevfs_disconnectsignal)
-#define USBDEVFS_DISCSIGNAL32      _IOR('U', 14, struct usbdevfs_disconnectsignal32)
-#define USBDEVFS_CLAIMINTERFACE    _IOR('U', 15, unsigned int)
-#define USBDEVFS_RELEASEINTERFACE  _IOR('U', 16, unsigned int)
-#define USBDEVFS_CONNECTINFO       _IOW('U', 17, struct usbdevfs_connectinfo)
-#define USBDEVFS_IOCTL             _IOWR('U', 18, struct usbdevfs_ioctl)
-#define USBDEVFS_IOCTL32           _IOWR('U', 18, struct usbdevfs_ioctl32)
-#define USBDEVFS_HUB_PORTINFO      _IOR('U', 19, struct usbdevfs_hub_portinfo)
-#define USBDEVFS_RESET             _IO('U', 20)
-#define USBDEVFS_CLEAR_HALT        _IOR('U', 21, unsigned int)
-#define USBDEVFS_DISCONNECT        _IO('U', 22)
-#define USBDEVFS_CONNECT           _IO('U', 23)
-#define USBDEVFS_CLAIM_PORT        _IOR('U', 24, unsigned int)
-#define USBDEVFS_RELEASE_PORT      _IOR('U', 25, unsigned int)
-#define USBDEVFS_GET_CAPABILITIES  _IOR('U', 26, __u32)
-#define USBDEVFS_DISCONNECT_CLAIM  _IOR('U', 27, struct usbdevfs_disconnect_claim)
-
 #endif /* _LINUX_USBDEVICE_FS_H */
index c714ed75eae25c523e60c1cc6df1b249d3659134..2b345206722a2ff374bf690a84be4a20a2ffabfe 100644 (file)
@@ -1,41 +1,12 @@
 #ifndef _LINUX_UTSNAME_H
 #define _LINUX_UTSNAME_H
 
-#define __OLD_UTS_LEN 8
-
-struct oldold_utsname {
-       char sysname[9];
-       char nodename[9];
-       char release[9];
-       char version[9];
-       char machine[9];
-};
-
-#define __NEW_UTS_LEN 64
-
-struct old_utsname {
-       char sysname[65];
-       char nodename[65];
-       char release[65];
-       char version[65];
-       char machine[65];
-};
-
-struct new_utsname {
-       char sysname[__NEW_UTS_LEN + 1];
-       char nodename[__NEW_UTS_LEN + 1];
-       char release[__NEW_UTS_LEN + 1];
-       char version[__NEW_UTS_LEN + 1];
-       char machine[__NEW_UTS_LEN + 1];
-       char domainname[__NEW_UTS_LEN + 1];
-};
-
-#ifdef __KERNEL__
 
 #include <linux/sched.h>
 #include <linux/kref.h>
 #include <linux/nsproxy.h>
 #include <linux/err.h>
+#include <uapi/linux/utsname.h>
 
 enum uts_proc {
        UTS_PROC_OSTYPE,
@@ -108,6 +79,4 @@ static inline struct new_utsname *init_utsname(void)
 
 extern struct rw_semaphore uts_sem;
 
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_UTSNAME_H */
index f86c37bfd4a06cae5123a841a7f9cb3b5e37135e..6df2509033d72d1920582e6bfd274db90eb85d6b 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
 #ifndef _LINUX_UUID_H_
 #define _LINUX_UUID_H_
 
-#include <linux/types.h>
-#include <linux/string.h>
-
-typedef struct {
-       __u8 b[16];
-} uuid_le;
-
-typedef struct {
-       __u8 b[16];
-} uuid_be;
-
-#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)               \
-((uuid_le)                                                             \
-{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
-   (b) & 0xff, ((b) >> 8) & 0xff,                                      \
-   (c) & 0xff, ((c) >> 8) & 0xff,                                      \
-   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
+#include <uapi/linux/uuid.h>
 
-#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)               \
-((uuid_be)                                                             \
-{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
-   ((b) >> 8) & 0xff, (b) & 0xff,                                      \
-   ((c) >> 8) & 0xff, (c) & 0xff,                                      \
-   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
-
-#define NULL_UUID_LE                                                   \
-       UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,     \
-               0x00, 0x00, 0x00, 0x00)
-
-#define NULL_UUID_BE                                                   \
-       UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,     \
-               0x00, 0x00, 0x00, 0x00)
-
-#ifdef __KERNEL__
 
 static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
 {
@@ -69,6 +36,4 @@ static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
 extern void uuid_le_gen(uuid_le *u);
 extern void uuid_be_gen(uuid_be *u);
 
-#endif /* __KERNEL__ */
-
 #endif
index 0a4f180a11d856ae3832b02e8da04a46043a2efd..ab9e86224c5471f9a8c66554b243b0d9c7613d3b 100644 (file)
 #ifndef VFIO_H
 #define VFIO_H
 
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-#define VFIO_API_VERSION       0
-
-#ifdef __KERNEL__      /* Internal VFIO-core/bus driver API */
 
 #include <linux/iommu.h>
 #include <linux/mm.h>
+#include <uapi/linux/vfio.h>
 
 /**
  * struct vfio_device_ops - VFIO bus driver device callbacks
@@ -92,354 +87,4 @@ extern void vfio_unregister_iommu_driver(
        TYPE tmp;                                               \
        offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); })         \
 
-#endif /* __KERNEL__ */
-
-/* Kernel & User level defines for VFIO IOCTLs. */
-
-/* Extensions */
-
-#define VFIO_TYPE1_IOMMU               1
-
-/*
- * The IOCTL interface is designed for extensibility by embedding the
- * structure length (argsz) and flags into structures passed between
- * kernel and userspace.  We therefore use the _IO() macro for these
- * defines to avoid implicitly embedding a size into the ioctl request.
- * As structure fields are added, argsz will increase to match and flag
- * bits will be defined to indicate additional fields with valid data.
- * It's *always* the caller's responsibility to indicate the size of
- * the structure passed by setting argsz appropriately.
- */
-
-#define VFIO_TYPE      (';')
-#define VFIO_BASE      100
-
-/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
-
-/**
- * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
- *
- * Report the version of the VFIO API.  This allows us to bump the entire
- * API version should we later need to add or change features in incompatible
- * ways.
- * Return: VFIO_API_VERSION
- * Availability: Always
- */
-#define VFIO_GET_API_VERSION           _IO(VFIO_TYPE, VFIO_BASE + 0)
-
-/**
- * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
- *
- * Check whether an extension is supported.
- * Return: 0 if not supported, 1 (or some other positive integer) if supported.
- * Availability: Always
- */
-#define VFIO_CHECK_EXTENSION           _IO(VFIO_TYPE, VFIO_BASE + 1)
-
-/**
- * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
- *
- * Set the iommu to the given type.  The type must be supported by an
- * iommu driver as verified by calling CHECK_EXTENSION using the same
- * type.  A group must be set to this file descriptor before this
- * ioctl is available.  The IOMMU interfaces enabled by this call are
- * specific to the value set.
- * Return: 0 on success, -errno on failure
- * Availability: When VFIO group attached
- */
-#define VFIO_SET_IOMMU                 _IO(VFIO_TYPE, VFIO_BASE + 2)
-
-/* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */
-
-/**
- * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3,
- *                                             struct vfio_group_status)
- *
- * Retrieve information about the group.  Fills in provided
- * struct vfio_group_info.  Caller sets argsz.
- * Return: 0 on succes, -errno on failure.
- * Availability: Always
- */
-struct vfio_group_status {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_GROUP_FLAGS_VIABLE                (1 << 0)
-#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
-};
-#define VFIO_GROUP_GET_STATUS          _IO(VFIO_TYPE, VFIO_BASE + 3)
-
-/**
- * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
- *
- * Set the container for the VFIO group to the open VFIO file
- * descriptor provided.  Groups may only belong to a single
- * container.  Containers may, at their discretion, support multiple
- * groups.  Only when a container is set are all of the interfaces
- * of the VFIO file descriptor and the VFIO group file descriptor
- * available to the user.
- * Return: 0 on success, -errno on failure.
- * Availability: Always
- */
-#define VFIO_GROUP_SET_CONTAINER       _IO(VFIO_TYPE, VFIO_BASE + 4)
-
-/**
- * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
- *
- * Remove the group from the attached container.  This is the
- * opposite of the SET_CONTAINER call and returns the group to
- * an initial state.  All device file descriptors must be released
- * prior to calling this interface.  When removing the last group
- * from a container, the IOMMU will be disabled and all state lost,
- * effectively also returning the VFIO file descriptor to an initial
- * state.
- * Return: 0 on success, -errno on failure.
- * Availability: When attached to container
- */
-#define VFIO_GROUP_UNSET_CONTAINER     _IO(VFIO_TYPE, VFIO_BASE + 5)
-
-/**
- * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
- *
- * Return a new file descriptor for the device object described by
- * the provided string.  The string should match a device listed in
- * the devices subdirectory of the IOMMU group sysfs entry.  The
- * group containing the device must already be added to this context.
- * Return: new file descriptor on success, -errno on failure.
- * Availability: When attached to container
- */
-#define VFIO_GROUP_GET_DEVICE_FD       _IO(VFIO_TYPE, VFIO_BASE + 6)
-
-/* --------------- IOCTLs for DEVICE file descriptors --------------- */
-
-/**
- * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7,
- *                                             struct vfio_device_info)
- *
- * Retrieve information about the device.  Fills in provided
- * struct vfio_device_info.  Caller sets argsz.
- * Return: 0 on success, -errno on failure.
- */
-struct vfio_device_info {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_DEVICE_FLAGS_RESET        (1 << 0)        /* Device supports reset */
-#define VFIO_DEVICE_FLAGS_PCI  (1 << 1)        /* vfio-pci device */
-       __u32   num_regions;    /* Max region index + 1 */
-       __u32   num_irqs;       /* Max IRQ index + 1 */
-};
-#define VFIO_DEVICE_GET_INFO           _IO(VFIO_TYPE, VFIO_BASE + 7)
-
-/**
- * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
- *                                    struct vfio_region_info)
- *
- * Retrieve information about a device region.  Caller provides
- * struct vfio_region_info with index value set.  Caller sets argsz.
- * Implementation of region mapping is bus driver specific.  This is
- * intended to describe MMIO, I/O port, as well as bus specific
- * regions (ex. PCI config space).  Zero sized regions may be used
- * to describe unimplemented regions (ex. unimplemented PCI BARs).
- * Return: 0 on success, -errno on failure.
- */
-struct vfio_region_info {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_REGION_INFO_FLAG_READ     (1 << 0) /* Region supports read */
-#define VFIO_REGION_INFO_FLAG_WRITE    (1 << 1) /* Region supports write */
-#define VFIO_REGION_INFO_FLAG_MMAP     (1 << 2) /* Region supports mmap */
-       __u32   index;          /* Region index */
-       __u32   resv;           /* Reserved for alignment */
-       __u64   size;           /* Region size (bytes) */
-       __u64   offset;         /* Region offset from start of device fd */
-};
-#define VFIO_DEVICE_GET_REGION_INFO    _IO(VFIO_TYPE, VFIO_BASE + 8)
-
-/**
- * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
- *                                 struct vfio_irq_info)
- *
- * Retrieve information about a device IRQ.  Caller provides
- * struct vfio_irq_info with index value set.  Caller sets argsz.
- * Implementation of IRQ mapping is bus driver specific.  Indexes
- * using multiple IRQs are primarily intended to support MSI-like
- * interrupt blocks.  Zero count irq blocks may be used to describe
- * unimplemented interrupt types.
- *
- * The EVENTFD flag indicates the interrupt index supports eventfd based
- * signaling.
- *
- * The MASKABLE flags indicates the index supports MASK and UNMASK
- * actions described below.
- *
- * AUTOMASKED indicates that after signaling, the interrupt line is
- * automatically masked by VFIO and the user needs to unmask the line
- * to receive new interrupts.  This is primarily intended to distinguish
- * level triggered interrupts.
- *
- * The NORESIZE flag indicates that the interrupt lines within the index
- * are setup as a set and new subindexes cannot be enabled without first
- * disabling the entire index.  This is used for interrupts like PCI MSI
- * and MSI-X where the driver may only use a subset of the available
- * indexes, but VFIO needs to enable a specific number of vectors
- * upfront.  In the case of MSI-X, where the user can enable MSI-X and
- * then add and unmask vectors, it's up to userspace to make the decision
- * whether to allocate the maximum supported number of vectors or tear
- * down setup and incrementally increase the vectors as each is enabled.
- */
-struct vfio_irq_info {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_IRQ_INFO_EVENTFD          (1 << 0)
-#define VFIO_IRQ_INFO_MASKABLE         (1 << 1)
-#define VFIO_IRQ_INFO_AUTOMASKED       (1 << 2)
-#define VFIO_IRQ_INFO_NORESIZE         (1 << 3)
-       __u32   index;          /* IRQ index */
-       __u32   count;          /* Number of IRQs within this index */
-};
-#define VFIO_DEVICE_GET_IRQ_INFO       _IO(VFIO_TYPE, VFIO_BASE + 9)
-
-/**
- * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
- *
- * Set signaling, masking, and unmasking of interrupts.  Caller provides
- * struct vfio_irq_set with all fields set.  'start' and 'count' indicate
- * the range of subindexes being specified.
- *
- * The DATA flags specify the type of data provided.  If DATA_NONE, the
- * operation performs the specified action immediately on the specified
- * interrupt(s).  For example, to unmask AUTOMASKED interrupt [0,0]:
- * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
- *
- * DATA_BOOL allows sparse support for the same on arrays of interrupts.
- * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]):
- * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3,
- * data = {1,0,1}
- *
- * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
- * A value of -1 can be used to either de-assign interrupts if already
- * assigned or skip un-assigned interrupts.  For example, to set an eventfd
- * to be trigger for interrupts [0,0] and [0,2]:
- * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3,
- * data = {fd1, -1, fd2}
- * If index [0,1] is previously set, two count = 1 ioctls calls would be
- * required to set [0,0] and [0,2] without changing [0,1].
- *
- * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used
- * with ACTION_TRIGGER to perform kernel level interrupt loopback testing
- * from userspace (ie. simulate hardware triggering).
- *
- * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER
- * enables the interrupt index for the device.  Individual subindex interrupts
- * can be disabled using the -1 value for DATA_EVENTFD or the index can be
- * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
- *
- * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while
- * ACTION_TRIGGER specifies kernel->user signaling.
- */
-struct vfio_irq_set {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_IRQ_SET_DATA_NONE         (1 << 0) /* Data not present */
-#define VFIO_IRQ_SET_DATA_BOOL         (1 << 1) /* Data is bool (u8) */
-#define VFIO_IRQ_SET_DATA_EVENTFD      (1 << 2) /* Data is eventfd (s32) */
-#define VFIO_IRQ_SET_ACTION_MASK       (1 << 3) /* Mask interrupt */
-#define VFIO_IRQ_SET_ACTION_UNMASK     (1 << 4) /* Unmask interrupt */
-#define VFIO_IRQ_SET_ACTION_TRIGGER    (1 << 5) /* Trigger interrupt */
-       __u32   index;
-       __u32   start;
-       __u32   count;
-       __u8    data[];
-};
-#define VFIO_DEVICE_SET_IRQS           _IO(VFIO_TYPE, VFIO_BASE + 10)
-
-#define VFIO_IRQ_SET_DATA_TYPE_MASK    (VFIO_IRQ_SET_DATA_NONE | \
-                                        VFIO_IRQ_SET_DATA_BOOL | \
-                                        VFIO_IRQ_SET_DATA_EVENTFD)
-#define VFIO_IRQ_SET_ACTION_TYPE_MASK  (VFIO_IRQ_SET_ACTION_MASK | \
-                                        VFIO_IRQ_SET_ACTION_UNMASK | \
-                                        VFIO_IRQ_SET_ACTION_TRIGGER)
-/**
- * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
- *
- * Reset a device.
- */
-#define VFIO_DEVICE_RESET              _IO(VFIO_TYPE, VFIO_BASE + 11)
-
-/*
- * The VFIO-PCI bus driver makes use of the following fixed region and
- * IRQ index mapping.  Unimplemented regions return a size of zero.
- * Unimplemented IRQ types return a count of zero.
- */
-
-enum {
-       VFIO_PCI_BAR0_REGION_INDEX,
-       VFIO_PCI_BAR1_REGION_INDEX,
-       VFIO_PCI_BAR2_REGION_INDEX,
-       VFIO_PCI_BAR3_REGION_INDEX,
-       VFIO_PCI_BAR4_REGION_INDEX,
-       VFIO_PCI_BAR5_REGION_INDEX,
-       VFIO_PCI_ROM_REGION_INDEX,
-       VFIO_PCI_CONFIG_REGION_INDEX,
-       VFIO_PCI_NUM_REGIONS
-};
-
-enum {
-       VFIO_PCI_INTX_IRQ_INDEX,
-       VFIO_PCI_MSI_IRQ_INDEX,
-       VFIO_PCI_MSIX_IRQ_INDEX,
-       VFIO_PCI_NUM_IRQS
-};
-
-/* -------- API for Type1 VFIO IOMMU -------- */
-
-/**
- * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info)
- *
- * Retrieve information about the IOMMU object. Fills in provided
- * struct vfio_iommu_info. Caller sets argsz.
- *
- * XXX Should we do these by CHECK_EXTENSION too?
- */
-struct vfio_iommu_type1_info {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)       /* supported page sizes info */
-       __u64   iova_pgsizes;           /* Bitmap of supported page sizes */
-};
-
-#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
-
-/**
- * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map)
- *
- * Map process virtual addresses to IO virtual addresses using the
- * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
- */
-struct vfio_iommu_type1_dma_map {
-       __u32   argsz;
-       __u32   flags;
-#define VFIO_DMA_MAP_FLAG_READ (1 << 0)                /* readable from device */
-#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)       /* writable from device */
-       __u64   vaddr;                          /* Process virtual address */
-       __u64   iova;                           /* IO virtual address */
-       __u64   size;                           /* Size of mapping (bytes) */
-};
-
-#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
-
-/**
- * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap)
- *
- * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
- * Caller sets argsz.
- */
-struct vfio_iommu_type1_dma_unmap {
-       __u32   argsz;
-       __u32   flags;
-       __u64   iova;                           /* IO virtual address */
-       __u64   size;                           /* Size of mapping (bytes) */
-};
-
-#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
-
 #endif /* VFIO_H */
index 873adbe82988a8415cd25da1b4d7951873e22762..73ea2fb0473185cc752232d18e80e566a6f57e97 100644 (file)
 #ifndef __LINUX_VIDEODEV2_H
 #define __LINUX_VIDEODEV2_H
 
-#ifdef __KERNEL__
 #include <linux/time.h>     /* need struct timeval */
-#else
-#include <sys/time.h>
-#endif
-#include <linux/compiler.h>
-#include <linux/ioctl.h>
-#include <linux/types.h>
-#include <linux/v4l2-common.h>
-#include <linux/v4l2-controls.h>
-
-/*
- * Common stuff for both V4L1 and V4L2
- * Moved from videodev.h
- */
-#define VIDEO_MAX_FRAME               32
-#define VIDEO_MAX_PLANES               8
-
-#ifndef __KERNEL__
-
-/* These defines are V4L1 specific and should not be used with the V4L2 API!
-   They will be removed from this header in the future. */
-
-#define VID_TYPE_CAPTURE       1       /* Can capture */
-#define VID_TYPE_TUNER         2       /* Can tune */
-#define VID_TYPE_TELETEXT      4       /* Does teletext */
-#define VID_TYPE_OVERLAY       8       /* Overlay onto frame buffer */
-#define VID_TYPE_CHROMAKEY     16      /* Overlay by chromakey */
-#define VID_TYPE_CLIPPING      32      /* Can clip */
-#define VID_TYPE_FRAMERAM      64      /* Uses the frame buffer memory */
-#define VID_TYPE_SCALES                128     /* Scalable */
-#define VID_TYPE_MONOCHROME    256     /* Monochrome only */
-#define VID_TYPE_SUBCAPTURE    512     /* Can capture subareas of the image */
-#define VID_TYPE_MPEG_DECODER  1024    /* Can decode MPEG streams */
-#define VID_TYPE_MPEG_ENCODER  2048    /* Can encode MPEG streams */
-#define VID_TYPE_MJPEG_DECODER 4096    /* Can decode MJPEG streams */
-#define VID_TYPE_MJPEG_ENCODER 8192    /* Can encode MJPEG streams */
-#endif
-
-/*
- *     M I S C E L L A N E O U S
- */
-
-/*  Four-character-code (FOURCC) */
-#define v4l2_fourcc(a, b, c, d)\
-       ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
-
-/*
- *     E N U M S
- */
-enum v4l2_field {
-       V4L2_FIELD_ANY           = 0, /* driver can choose from none,
-                                        top, bottom, interlaced
-                                        depending on whatever it thinks
-                                        is approximate ... */
-       V4L2_FIELD_NONE          = 1, /* this device has no fields ... */
-       V4L2_FIELD_TOP           = 2, /* top field only */
-       V4L2_FIELD_BOTTOM        = 3, /* bottom field only */
-       V4L2_FIELD_INTERLACED    = 4, /* both fields interlaced */
-       V4L2_FIELD_SEQ_TB        = 5, /* both fields sequential into one
-                                        buffer, top-bottom order */
-       V4L2_FIELD_SEQ_BT        = 6, /* same as above + bottom-top order */
-       V4L2_FIELD_ALTERNATE     = 7, /* both fields alternating into
-                                        separate buffers */
-       V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
-                                        first and the top field is
-                                        transmitted first */
-       V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
-                                        first and the bottom field is
-                                        transmitted first */
-};
-#define V4L2_FIELD_HAS_TOP(field)      \
-       ((field) == V4L2_FIELD_TOP      ||\
-        (field) == V4L2_FIELD_INTERLACED ||\
-        (field) == V4L2_FIELD_INTERLACED_TB ||\
-        (field) == V4L2_FIELD_INTERLACED_BT ||\
-        (field) == V4L2_FIELD_SEQ_TB   ||\
-        (field) == V4L2_FIELD_SEQ_BT)
-#define V4L2_FIELD_HAS_BOTTOM(field)   \
-       ((field) == V4L2_FIELD_BOTTOM   ||\
-        (field) == V4L2_FIELD_INTERLACED ||\
-        (field) == V4L2_FIELD_INTERLACED_TB ||\
-        (field) == V4L2_FIELD_INTERLACED_BT ||\
-        (field) == V4L2_FIELD_SEQ_TB   ||\
-        (field) == V4L2_FIELD_SEQ_BT)
-#define V4L2_FIELD_HAS_BOTH(field)     \
-       ((field) == V4L2_FIELD_INTERLACED ||\
-        (field) == V4L2_FIELD_INTERLACED_TB ||\
-        (field) == V4L2_FIELD_INTERLACED_BT ||\
-        (field) == V4L2_FIELD_SEQ_TB ||\
-        (field) == V4L2_FIELD_SEQ_BT)
-
-enum v4l2_buf_type {
-       V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
-       V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
-       V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
-       V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
-       V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
-       V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
-       V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
-#if 1
-       /* Experimental */
-       V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
-#endif
-       V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
-       V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
-       /* Deprecated, do not use */
-       V4L2_BUF_TYPE_PRIVATE              = 0x80,
-};
-
-#define V4L2_TYPE_IS_MULTIPLANAR(type)                 \
-       ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE   \
-        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
-
-#define V4L2_TYPE_IS_OUTPUT(type)                              \
-       ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
-        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE         \
-        || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY               \
-        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY        \
-        || (type) == V4L2_BUF_TYPE_VBI_OUTPUT                  \
-        || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
-
-enum v4l2_tuner_type {
-       V4L2_TUNER_RADIO             = 1,
-       V4L2_TUNER_ANALOG_TV         = 2,
-       V4L2_TUNER_DIGITAL_TV        = 3,
-};
-
-enum v4l2_memory {
-       V4L2_MEMORY_MMAP             = 1,
-       V4L2_MEMORY_USERPTR          = 2,
-       V4L2_MEMORY_OVERLAY          = 3,
-};
-
-/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
-enum v4l2_colorspace {
-       /* ITU-R 601 -- broadcast NTSC/PAL */
-       V4L2_COLORSPACE_SMPTE170M     = 1,
-
-       /* 1125-Line (US) HDTV */
-       V4L2_COLORSPACE_SMPTE240M     = 2,
-
-       /* HD and modern captures. */
-       V4L2_COLORSPACE_REC709        = 3,
-
-       /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
-       V4L2_COLORSPACE_BT878         = 4,
-
-       /* These should be useful.  Assume 601 extents. */
-       V4L2_COLORSPACE_470_SYSTEM_M  = 5,
-       V4L2_COLORSPACE_470_SYSTEM_BG = 6,
-
-       /* I know there will be cameras that send this.  So, this is
-        * unspecified chromaticities and full 0-255 on each of the
-        * Y'CbCr components
-        */
-       V4L2_COLORSPACE_JPEG          = 7,
-
-       /* For RGB colourspaces, this is probably a good start. */
-       V4L2_COLORSPACE_SRGB          = 8,
-};
-
-enum v4l2_priority {
-       V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
-       V4L2_PRIORITY_BACKGROUND  = 1,
-       V4L2_PRIORITY_INTERACTIVE = 2,
-       V4L2_PRIORITY_RECORD      = 3,
-       V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
-};
-
-struct v4l2_rect {
-       __s32   left;
-       __s32   top;
-       __s32   width;
-       __s32   height;
-};
-
-struct v4l2_fract {
-       __u32   numerator;
-       __u32   denominator;
-};
-
-/**
-  * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
-  *
-  * @driver:      name of the driver module (e.g. "bttv")
-  * @card:        name of the card (e.g. "Hauppauge WinTV")
-  * @bus_info:    name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
-  * @version:     KERNEL_VERSION
-  * @capabilities: capabilities of the physical device as a whole
-  * @device_caps:  capabilities accessed via this particular device (node)
-  * @reserved:    reserved fields for future extensions
-  */
-struct v4l2_capability {
-       __u8    driver[16];
-       __u8    card[32];
-       __u8    bus_info[32];
-       __u32   version;
-       __u32   capabilities;
-       __u32   device_caps;
-       __u32   reserved[3];
-};
-
-/* Values for 'capabilities' field */
-#define V4L2_CAP_VIDEO_CAPTURE         0x00000001  /* Is a video capture device */
-#define V4L2_CAP_VIDEO_OUTPUT          0x00000002  /* Is a video output device */
-#define V4L2_CAP_VIDEO_OVERLAY         0x00000004  /* Can do video overlay */
-#define V4L2_CAP_VBI_CAPTURE           0x00000010  /* Is a raw VBI capture device */
-#define V4L2_CAP_VBI_OUTPUT            0x00000020  /* Is a raw VBI output device */
-#define V4L2_CAP_SLICED_VBI_CAPTURE    0x00000040  /* Is a sliced VBI capture device */
-#define V4L2_CAP_SLICED_VBI_OUTPUT     0x00000080  /* Is a sliced VBI output device */
-#define V4L2_CAP_RDS_CAPTURE           0x00000100  /* RDS data capture */
-#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY  0x00000200  /* Can do video output overlay */
-#define V4L2_CAP_HW_FREQ_SEEK          0x00000400  /* Can do hardware frequency seek  */
-#define V4L2_CAP_RDS_OUTPUT            0x00000800  /* Is an RDS encoder */
-
-/* Is a video capture device that supports multiplanar formats */
-#define V4L2_CAP_VIDEO_CAPTURE_MPLANE  0x00001000
-/* Is a video output device that supports multiplanar formats */
-#define V4L2_CAP_VIDEO_OUTPUT_MPLANE   0x00002000
-/* Is a video mem-to-mem device that supports multiplanar formats */
-#define V4L2_CAP_VIDEO_M2M_MPLANE      0x00004000
-/* Is a video mem-to-mem device */
-#define V4L2_CAP_VIDEO_M2M             0x00008000
-
-#define V4L2_CAP_TUNER                 0x00010000  /* has a tuner */
-#define V4L2_CAP_AUDIO                 0x00020000  /* has audio support */
-#define V4L2_CAP_RADIO                 0x00040000  /* is a radio device */
-#define V4L2_CAP_MODULATOR             0x00080000  /* has a modulator */
-
-#define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
-#define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
-#define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
-
-#define V4L2_CAP_DEVICE_CAPS            0x80000000  /* sets device capabilities field */
-
-/*
- *     V I D E O   I M A G E   F O R M A T
- */
-struct v4l2_pix_format {
-       __u32                   width;
-       __u32                   height;
-       __u32                   pixelformat;
-       __u32                   field;          /* enum v4l2_field */
-       __u32                   bytesperline;   /* for padding, zero if unused */
-       __u32                   sizeimage;
-       __u32                   colorspace;     /* enum v4l2_colorspace */
-       __u32                   priv;           /* private data, depends on pixelformat */
-};
-
-/*      Pixel format         FOURCC                          depth  Description  */
-
-/* RGB formats */
-#define V4L2_PIX_FMT_RGB332  v4l2_fourcc('R', 'G', 'B', '1') /*  8  RGB-3-3-2     */
-#define V4L2_PIX_FMT_RGB444  v4l2_fourcc('R', '4', '4', '4') /* 16  xxxxrrrr ggggbbbb */
-#define V4L2_PIX_FMT_RGB555  v4l2_fourcc('R', 'G', 'B', 'O') /* 16  RGB-5-5-5     */
-#define V4L2_PIX_FMT_RGB565  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5     */
-#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
-#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16  RGB-5-6-5 BE  */
-#define V4L2_PIX_FMT_BGR666  v4l2_fourcc('B', 'G', 'R', 'H') /* 18  BGR-6-6-6    */
-#define V4L2_PIX_FMT_BGR24   v4l2_fourcc('B', 'G', 'R', '3') /* 24  BGR-8-8-8     */
-#define V4L2_PIX_FMT_RGB24   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */
-#define V4L2_PIX_FMT_BGR32   v4l2_fourcc('B', 'G', 'R', '4') /* 32  BGR-8-8-8-8   */
-#define V4L2_PIX_FMT_RGB32   v4l2_fourcc('R', 'G', 'B', '4') /* 32  RGB-8-8-8-8   */
-
-/* Grey formats */
-#define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */
-#define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */
-#define V4L2_PIX_FMT_Y6      v4l2_fourcc('Y', '0', '6', ' ') /*  6  Greyscale     */
-#define V4L2_PIX_FMT_Y10     v4l2_fourcc('Y', '1', '0', ' ') /* 10  Greyscale     */
-#define V4L2_PIX_FMT_Y12     v4l2_fourcc('Y', '1', '2', ' ') /* 12  Greyscale     */
-#define V4L2_PIX_FMT_Y16     v4l2_fourcc('Y', '1', '6', ' ') /* 16  Greyscale     */
-
-/* Grey bit-packed formats */
-#define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
-
-/* Palette formats */
-#define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
-
-/* Luminance+Chrominance formats */
-#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
-#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
-#define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */
-#define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */
-#define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
-#define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */
-#define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */
-#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
-#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */
-#define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */
-#define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */
-#define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
-#define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
-#define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
-#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
-#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
-#define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
-#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */
-#define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
-
-/* two planes -- one Y, one Cr + Cb interleaved  */
-#define V4L2_PIX_FMT_NV12    v4l2_fourcc('N', 'V', '1', '2') /* 12  Y/CbCr 4:2:0  */
-#define V4L2_PIX_FMT_NV21    v4l2_fourcc('N', 'V', '2', '1') /* 12  Y/CrCb 4:2:0  */
-#define V4L2_PIX_FMT_NV16    v4l2_fourcc('N', 'V', '1', '6') /* 16  Y/CbCr 4:2:2  */
-#define V4L2_PIX_FMT_NV61    v4l2_fourcc('N', 'V', '6', '1') /* 16  Y/CrCb 4:2:2  */
-#define V4L2_PIX_FMT_NV24    v4l2_fourcc('N', 'V', '2', '4') /* 24  Y/CbCr 4:4:4  */
-#define V4L2_PIX_FMT_NV42    v4l2_fourcc('N', 'V', '4', '2') /* 24  Y/CrCb 4:4:4  */
-
-/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
-#define V4L2_PIX_FMT_NV12M   v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
-#define V4L2_PIX_FMT_NV21M   v4l2_fourcc('N', 'M', '2', '1') /* 21  Y/CrCb 4:2:0  */
-#define V4L2_PIX_FMT_NV12MT  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
-#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
-
-/* three non contiguous planes - Y, Cb, Cr */
-#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12  YUV420 planar */
-#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12  YVU420 planar */
-
-/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
-#define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
-#define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
-#define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
-#define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
-#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */
-#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
-#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
-#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. GBGB.. */
-#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
-#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
-#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
-#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
-       /* 10bit raw bayer DPCM compressed to 8 bits */
-#define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
-#define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
-#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
-#define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
-       /*
-        * 10bit raw bayer, expanded to 16 bits
-        * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
-        */
-#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
-
-/* compressed formats */
-#define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
-#define V4L2_PIX_FMT_JPEG     v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG     */
-#define V4L2_PIX_FMT_DV       v4l2_fourcc('d', 'v', 's', 'd') /* 1394          */
-#define V4L2_PIX_FMT_MPEG     v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
-#define V4L2_PIX_FMT_H264     v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
-#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
-#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
-#define V4L2_PIX_FMT_H263     v4l2_fourcc('H', '2', '6', '3') /* H263          */
-#define V4L2_PIX_FMT_MPEG1    v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES     */
-#define V4L2_PIX_FMT_MPEG2    v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES     */
-#define V4L2_PIX_FMT_MPEG4    v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES     */
-#define V4L2_PIX_FMT_XVID     v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid           */
-#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
-#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
-#define V4L2_PIX_FMT_VP8      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
-
-/*  Vendor-specific formats   */
-#define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
-#define V4L2_PIX_FMT_WNVA     v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
-#define V4L2_PIX_FMT_SN9C10X  v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
-#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
-#define V4L2_PIX_FMT_PWC1     v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
-#define V4L2_PIX_FMT_PWC2     v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
-#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
-#define V4L2_PIX_FMT_SPCA501  v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
-#define V4L2_PIX_FMT_SPCA505  v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
-#define V4L2_PIX_FMT_SPCA508  v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
-#define V4L2_PIX_FMT_SPCA561  v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
-#define V4L2_PIX_FMT_PAC207   v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
-#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
-#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
-#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
-#define V4L2_PIX_FMT_SQ905C   v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
-#define V4L2_PIX_FMT_PJPG     v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
-#define V4L2_PIX_FMT_OV511    v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
-#define V4L2_PIX_FMT_OV518    v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
-#define V4L2_PIX_FMT_STV0680  v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
-#define V4L2_PIX_FMT_TM6000   v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
-#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
-#define V4L2_PIX_FMT_KONICA420  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
-#define V4L2_PIX_FMT_JPGL      v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
-#define V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
-#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
-
-/*
- *     F O R M A T   E N U M E R A T I O N
- */
-struct v4l2_fmtdesc {
-       __u32               index;             /* Format number      */
-       __u32               type;              /* enum v4l2_buf_type */
-       __u32               flags;
-       __u8                description[32];   /* Description string */
-       __u32               pixelformat;       /* Format fourcc      */
-       __u32               reserved[4];
-};
-
-#define V4L2_FMT_FLAG_COMPRESSED 0x0001
-#define V4L2_FMT_FLAG_EMULATED   0x0002
-
-#if 1
-       /* Experimental Frame Size and frame rate enumeration */
-/*
- *     F R A M E   S I Z E   E N U M E R A T I O N
- */
-enum v4l2_frmsizetypes {
-       V4L2_FRMSIZE_TYPE_DISCRETE      = 1,
-       V4L2_FRMSIZE_TYPE_CONTINUOUS    = 2,
-       V4L2_FRMSIZE_TYPE_STEPWISE      = 3,
-};
-
-struct v4l2_frmsize_discrete {
-       __u32                   width;          /* Frame width [pixel] */
-       __u32                   height;         /* Frame height [pixel] */
-};
-
-struct v4l2_frmsize_stepwise {
-       __u32                   min_width;      /* Minimum frame width [pixel] */
-       __u32                   max_width;      /* Maximum frame width [pixel] */
-       __u32                   step_width;     /* Frame width step size [pixel] */
-       __u32                   min_height;     /* Minimum frame height [pixel] */
-       __u32                   max_height;     /* Maximum frame height [pixel] */
-       __u32                   step_height;    /* Frame height step size [pixel] */
-};
-
-struct v4l2_frmsizeenum {
-       __u32                   index;          /* Frame size number */
-       __u32                   pixel_format;   /* Pixel format */
-       __u32                   type;           /* Frame size type the device supports. */
-
-       union {                                 /* Frame size */
-               struct v4l2_frmsize_discrete    discrete;
-               struct v4l2_frmsize_stepwise    stepwise;
-       };
-
-       __u32   reserved[2];                    /* Reserved space for future use */
-};
-
-/*
- *     F R A M E   R A T E   E N U M E R A T I O N
- */
-enum v4l2_frmivaltypes {
-       V4L2_FRMIVAL_TYPE_DISCRETE      = 1,
-       V4L2_FRMIVAL_TYPE_CONTINUOUS    = 2,
-       V4L2_FRMIVAL_TYPE_STEPWISE      = 3,
-};
-
-struct v4l2_frmival_stepwise {
-       struct v4l2_fract       min;            /* Minimum frame interval [s] */
-       struct v4l2_fract       max;            /* Maximum frame interval [s] */
-       struct v4l2_fract       step;           /* Frame interval step size [s] */
-};
-
-struct v4l2_frmivalenum {
-       __u32                   index;          /* Frame format index */
-       __u32                   pixel_format;   /* Pixel format */
-       __u32                   width;          /* Frame width */
-       __u32                   height;         /* Frame height */
-       __u32                   type;           /* Frame interval type the device supports. */
-
-       union {                                 /* Frame interval */
-               struct v4l2_fract               discrete;
-               struct v4l2_frmival_stepwise    stepwise;
-       };
-
-       __u32   reserved[2];                    /* Reserved space for future use */
-};
-#endif
-
-/*
- *     T I M E C O D E
- */
-struct v4l2_timecode {
-       __u32   type;
-       __u32   flags;
-       __u8    frames;
-       __u8    seconds;
-       __u8    minutes;
-       __u8    hours;
-       __u8    userbits[4];
-};
-
-/*  Type  */
-#define V4L2_TC_TYPE_24FPS             1
-#define V4L2_TC_TYPE_25FPS             2
-#define V4L2_TC_TYPE_30FPS             3
-#define V4L2_TC_TYPE_50FPS             4
-#define V4L2_TC_TYPE_60FPS             5
-
-/*  Flags  */
-#define V4L2_TC_FLAG_DROPFRAME         0x0001 /* "drop-frame" mode */
-#define V4L2_TC_FLAG_COLORFRAME                0x0002
-#define V4L2_TC_USERBITS_field         0x000C
-#define V4L2_TC_USERBITS_USERDEFINED   0x0000
-#define V4L2_TC_USERBITS_8BITCHARS     0x0008
-/* The above is based on SMPTE timecodes */
-
-struct v4l2_jpegcompression {
-       int quality;
-
-       int  APPn;              /* Number of APP segment to be written,
-                                * must be 0..15 */
-       int  APP_len;           /* Length of data in JPEG APPn segment */
-       char APP_data[60];      /* Data in the JPEG APPn segment. */
-
-       int  COM_len;           /* Length of data in JPEG COM segment */
-       char COM_data[60];      /* Data in JPEG COM segment */
-
-       __u32 jpeg_markers;     /* Which markers should go into the JPEG
-                                * output. Unless you exactly know what
-                                * you do, leave them untouched.
-                                * Inluding less markers will make the
-                                * resulting code smaller, but there will
-                                * be fewer applications which can read it.
-                                * The presence of the APP and COM marker
-                                * is influenced by APP_len and COM_len
-                                * ONLY, not by this property! */
-
-#define V4L2_JPEG_MARKER_DHT (1<<3)    /* Define Huffman Tables */
-#define V4L2_JPEG_MARKER_DQT (1<<4)    /* Define Quantization Tables */
-#define V4L2_JPEG_MARKER_DRI (1<<5)    /* Define Restart Interval */
-#define V4L2_JPEG_MARKER_COM (1<<6)    /* Comment segment */
-#define V4L2_JPEG_MARKER_APP (1<<7)    /* App segment, driver will
-                                       * allways use APP0 */
-};
-
-/*
- *     M E M O R Y - M A P P I N G   B U F F E R S
- */
-struct v4l2_requestbuffers {
-       __u32                   count;
-       __u32                   type;           /* enum v4l2_buf_type */
-       __u32                   memory;         /* enum v4l2_memory */
-       __u32                   reserved[2];
-};
-
-/**
- * struct v4l2_plane - plane info for multi-planar buffers
- * @bytesused:         number of bytes occupied by data in the plane (payload)
- * @length:            size of this plane (NOT the payload) in bytes
- * @mem_offset:                when memory in the associated struct v4l2_buffer is
- *                     V4L2_MEMORY_MMAP, equals the offset from the start of
- *                     the device memory for this plane (or is a "cookie" that
- *                     should be passed to mmap() called on the video node)
- * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer
- *                     pointing to this plane
- * @data_offset:       offset in the plane to the start of data; usually 0,
- *                     unless there is a header in front of the data
- *
- * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
- * with two planes can have one plane for Y, and another for interleaved CbCr
- * components. Each plane can reside in a separate memory buffer, or even in
- * a completely separate memory node (e.g. in embedded devices).
- */
-struct v4l2_plane {
-       __u32                   bytesused;
-       __u32                   length;
-       union {
-               __u32           mem_offset;
-               unsigned long   userptr;
-       } m;
-       __u32                   data_offset;
-       __u32                   reserved[11];
-};
-
-/**
- * struct v4l2_buffer - video buffer info
- * @index:     id number of the buffer
- * @type:      enum v4l2_buf_type; buffer type (type == *_MPLANE for
- *             multiplanar buffers);
- * @bytesused: number of bytes occupied by data in the buffer (payload);
- *             unused (set to 0) for multiplanar buffers
- * @flags:     buffer informational flags
- * @field:     enum v4l2_field; field order of the image in the buffer
- * @timestamp: frame timestamp
- * @timecode:  frame timecode
- * @sequence:  sequence count of this frame
- * @memory:    enum v4l2_memory; the method, in which the actual video data is
- *             passed
- * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
- *             offset from the start of the device memory for this plane,
- *             (or a "cookie" that should be passed to mmap() as offset)
- * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
- *             a userspace pointer pointing to this buffer
- * @planes:    for multiplanar buffers; userspace pointer to the array of plane
- *             info structs for this buffer
- * @length:    size in bytes of the buffer (NOT its payload) for single-plane
- *             buffers (when type != *_MPLANE); number of elements in the
- *             planes array for multi-plane buffers
- * @input:     input number from which the video data has has been captured
- *
- * Contains data exchanged by application and driver using one of the Streaming
- * I/O methods.
- */
-struct v4l2_buffer {
-       __u32                   index;
-       __u32                   type;
-       __u32                   bytesused;
-       __u32                   flags;
-       __u32                   field;
-       struct timeval          timestamp;
-       struct v4l2_timecode    timecode;
-       __u32                   sequence;
-
-       /* memory location */
-       __u32                   memory;
-       union {
-               __u32           offset;
-               unsigned long   userptr;
-               struct v4l2_plane *planes;
-       } m;
-       __u32                   length;
-       __u32                   reserved2;
-       __u32                   reserved;
-};
-
-/*  Flags for 'flags' field */
-#define V4L2_BUF_FLAG_MAPPED   0x0001  /* Buffer is mapped (flag) */
-#define V4L2_BUF_FLAG_QUEUED   0x0002  /* Buffer is queued for processing */
-#define V4L2_BUF_FLAG_DONE     0x0004  /* Buffer is ready */
-#define V4L2_BUF_FLAG_KEYFRAME 0x0008  /* Image is a keyframe (I-frame) */
-#define V4L2_BUF_FLAG_PFRAME   0x0010  /* Image is a P-frame */
-#define V4L2_BUF_FLAG_BFRAME   0x0020  /* Image is a B-frame */
-/* Buffer is ready, but the data contained within is corrupted. */
-#define V4L2_BUF_FLAG_ERROR    0x0040
-#define V4L2_BUF_FLAG_TIMECODE 0x0100  /* timecode field is valid */
-#define V4L2_BUF_FLAG_PREPARED 0x0400  /* Buffer is prepared for queuing */
-/* Cache handling flags */
-#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE      0x0800
-#define V4L2_BUF_FLAG_NO_CACHE_CLEAN           0x1000
-
-/*
- *     O V E R L A Y   P R E V I E W
- */
-struct v4l2_framebuffer {
-       __u32                   capability;
-       __u32                   flags;
-/* FIXME: in theory we should pass something like PCI device + memory
- * region + offset instead of some physical address */
-       void                    *base;
-       struct v4l2_pix_format  fmt;
-};
-/*  Flags for the 'capability' field. Read only */
-#define V4L2_FBUF_CAP_EXTERNOVERLAY    0x0001
-#define V4L2_FBUF_CAP_CHROMAKEY                0x0002
-#define V4L2_FBUF_CAP_LIST_CLIPPING     0x0004
-#define V4L2_FBUF_CAP_BITMAP_CLIPPING  0x0008
-#define V4L2_FBUF_CAP_LOCAL_ALPHA      0x0010
-#define V4L2_FBUF_CAP_GLOBAL_ALPHA     0x0020
-#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA  0x0040
-#define V4L2_FBUF_CAP_SRC_CHROMAKEY    0x0080
-/*  Flags for the 'flags' field. */
-#define V4L2_FBUF_FLAG_PRIMARY         0x0001
-#define V4L2_FBUF_FLAG_OVERLAY         0x0002
-#define V4L2_FBUF_FLAG_CHROMAKEY       0x0004
-#define V4L2_FBUF_FLAG_LOCAL_ALPHA     0x0008
-#define V4L2_FBUF_FLAG_GLOBAL_ALPHA    0x0010
-#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
-#define V4L2_FBUF_FLAG_SRC_CHROMAKEY   0x0040
-
-struct v4l2_clip {
-       struct v4l2_rect        c;
-       struct v4l2_clip        __user *next;
-};
-
-struct v4l2_window {
-       struct v4l2_rect        w;
-       __u32                   field;   /* enum v4l2_field */
-       __u32                   chromakey;
-       struct v4l2_clip        __user *clips;
-       __u32                   clipcount;
-       void                    __user *bitmap;
-       __u8                    global_alpha;
-};
-
-/*
- *     C A P T U R E   P A R A M E T E R S
- */
-struct v4l2_captureparm {
-       __u32              capability;    /*  Supported modes */
-       __u32              capturemode;   /*  Current mode */
-       struct v4l2_fract  timeperframe;  /*  Time per frame in .1us units */
-       __u32              extendedmode;  /*  Driver-specific extensions */
-       __u32              readbuffers;   /*  # of buffers for read */
-       __u32              reserved[4];
-};
-
-/*  Flags for 'capability' and 'capturemode' fields */
-#define V4L2_MODE_HIGHQUALITY  0x0001  /*  High quality imaging mode */
-#define V4L2_CAP_TIMEPERFRAME  0x1000  /*  timeperframe field is supported */
-
-struct v4l2_outputparm {
-       __u32              capability;   /*  Supported modes */
-       __u32              outputmode;   /*  Current mode */
-       struct v4l2_fract  timeperframe; /*  Time per frame in seconds */
-       __u32              extendedmode; /*  Driver-specific extensions */
-       __u32              writebuffers; /*  # of buffers for write */
-       __u32              reserved[4];
-};
-
-/*
- *     I N P U T   I M A G E   C R O P P I N G
- */
-struct v4l2_cropcap {
-       __u32                   type;   /* enum v4l2_buf_type */
-       struct v4l2_rect        bounds;
-       struct v4l2_rect        defrect;
-       struct v4l2_fract       pixelaspect;
-};
-
-struct v4l2_crop {
-       __u32                   type;   /* enum v4l2_buf_type */
-       struct v4l2_rect        c;
-};
-
-/**
- * struct v4l2_selection - selection info
- * @type:      buffer type (do not use *_MPLANE types)
- * @target:    Selection target, used to choose one of possible rectangles;
- *             defined in v4l2-common.h; V4L2_SEL_TGT_* .
- * @flags:     constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
- * @r:         coordinates of selection window
- * @reserved:  for future use, rounds structure size to 64 bytes, set to zero
- *
- * Hardware may use multiple helper windows to process a video stream.
- * The structure is used to exchange this selection areas between
- * an application and a driver.
- */
-struct v4l2_selection {
-       __u32                   type;
-       __u32                   target;
-       __u32                   flags;
-       struct v4l2_rect        r;
-       __u32                   reserved[9];
-};
-
-
-/*
- *      A N A L O G   V I D E O   S T A N D A R D
- */
-
-typedef __u64 v4l2_std_id;
-
-/* one bit for each */
-#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
-#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
-#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
-#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
-#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
-#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
-#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
-#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
-
-#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
-#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
-#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
-#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
-
-#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)      /* BTSC */
-#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)      /* EIA-J */
-#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
-#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)      /* FM A2 */
-
-#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
-#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
-#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
-#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
-#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
-#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
-#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
-#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
-
-/* ATSC/HDTV */
-#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
-#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
-
-/* FIXME:
-   Although std_id is 64 bits, there is an issue on PPC32 architecture that
-   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
-   this value to 32 bits.
-   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
-   it should work fine. However, if needed to add more than two standards,
-   v4l2-common.c should be fixed.
- */
-
-/*
- * Some macros to merge video standards in order to make live easier for the
- * drivers and V4L2 applications
- */
-
-/*
- * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
- * Missing here.
- */
-#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M       |\
-                                V4L2_STD_NTSC_M_JP     |\
-                                V4L2_STD_NTSC_M_KR)
-/* Secam macros */
-#define V4L2_STD_SECAM_DK              (V4L2_STD_SECAM_D       |\
-                                V4L2_STD_SECAM_K       |\
-                                V4L2_STD_SECAM_K1)
-/* All Secam Standards */
-#define V4L2_STD_SECAM         (V4L2_STD_SECAM_B       |\
-                                V4L2_STD_SECAM_G       |\
-                                V4L2_STD_SECAM_H       |\
-                                V4L2_STD_SECAM_DK      |\
-                                V4L2_STD_SECAM_L       |\
-                                V4L2_STD_SECAM_LC)
-/* PAL macros */
-#define V4L2_STD_PAL_BG                (V4L2_STD_PAL_B         |\
-                                V4L2_STD_PAL_B1        |\
-                                V4L2_STD_PAL_G)
-#define V4L2_STD_PAL_DK                (V4L2_STD_PAL_D         |\
-                                V4L2_STD_PAL_D1        |\
-                                V4L2_STD_PAL_K)
-/*
- * "Common" PAL - This macro is there to be compatible with the old
- * V4L1 concept of "PAL": /BGDKHI.
- * Several PAL standards are mising here: /M, /N and /Nc
- */
-#define V4L2_STD_PAL           (V4L2_STD_PAL_BG        |\
-                                V4L2_STD_PAL_DK        |\
-                                V4L2_STD_PAL_H         |\
-                                V4L2_STD_PAL_I)
-/* Chroma "agnostic" standards */
-#define V4L2_STD_B             (V4L2_STD_PAL_B         |\
-                                V4L2_STD_PAL_B1        |\
-                                V4L2_STD_SECAM_B)
-#define V4L2_STD_G             (V4L2_STD_PAL_G         |\
-                                V4L2_STD_SECAM_G)
-#define V4L2_STD_H             (V4L2_STD_PAL_H         |\
-                                V4L2_STD_SECAM_H)
-#define V4L2_STD_L             (V4L2_STD_SECAM_L       |\
-                                V4L2_STD_SECAM_LC)
-#define V4L2_STD_GH            (V4L2_STD_G             |\
-                                V4L2_STD_H)
-#define V4L2_STD_DK            (V4L2_STD_PAL_DK        |\
-                                V4L2_STD_SECAM_DK)
-#define V4L2_STD_BG            (V4L2_STD_B             |\
-                                V4L2_STD_G)
-#define V4L2_STD_MN            (V4L2_STD_PAL_M         |\
-                                V4L2_STD_PAL_N         |\
-                                V4L2_STD_PAL_Nc        |\
-                                V4L2_STD_NTSC)
-
-/* Standards where MTS/BTSC stereo could be found */
-#define V4L2_STD_MTS           (V4L2_STD_NTSC_M        |\
-                                V4L2_STD_PAL_M         |\
-                                V4L2_STD_PAL_N         |\
-                                V4L2_STD_PAL_Nc)
-
-/* Standards for Countries with 60Hz Line frequency */
-#define V4L2_STD_525_60                (V4L2_STD_PAL_M         |\
-                                V4L2_STD_PAL_60        |\
-                                V4L2_STD_NTSC          |\
-                                V4L2_STD_NTSC_443)
-/* Standards for Countries with 50Hz Line frequency */
-#define V4L2_STD_625_50                (V4L2_STD_PAL           |\
-                                V4L2_STD_PAL_N         |\
-                                V4L2_STD_PAL_Nc        |\
-                                V4L2_STD_SECAM)
-
-#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
-                                V4L2_STD_ATSC_16_VSB)
-/* Macros with none and all analog standards */
-#define V4L2_STD_UNKNOWN        0
-#define V4L2_STD_ALL            (V4L2_STD_525_60       |\
-                                V4L2_STD_625_50)
-
-struct v4l2_standard {
-       __u32                index;
-       v4l2_std_id          id;
-       __u8                 name[24];
-       struct v4l2_fract    frameperiod; /* Frames, not fields */
-       __u32                framelines;
-       __u32                reserved[4];
-};
-
-/* The DV Preset API is deprecated in favor of the DV Timings API.
-   New drivers shouldn't use this anymore! */
-
-/*
- *     V I D E O       T I M I N G S   D V     P R E S E T
- */
-struct v4l2_dv_preset {
-       __u32   preset;
-       __u32   reserved[4];
-};
-
-/*
- *     D V     P R E S E T S   E N U M E R A T I O N
- */
-struct v4l2_dv_enum_preset {
-       __u32   index;
-       __u32   preset;
-       __u8    name[32]; /* Name of the preset timing */
-       __u32   width;
-       __u32   height;
-       __u32   reserved[4];
-};
-
-/*
- *     D V     P R E S E T     V A L U E S
- */
-#define                V4L2_DV_INVALID         0
-#define                V4L2_DV_480P59_94       1 /* BT.1362 */
-#define                V4L2_DV_576P50          2 /* BT.1362 */
-#define                V4L2_DV_720P24          3 /* SMPTE 296M */
-#define                V4L2_DV_720P25          4 /* SMPTE 296M */
-#define                V4L2_DV_720P30          5 /* SMPTE 296M */
-#define                V4L2_DV_720P50          6 /* SMPTE 296M */
-#define                V4L2_DV_720P59_94       7 /* SMPTE 274M */
-#define                V4L2_DV_720P60          8 /* SMPTE 274M/296M */
-#define                V4L2_DV_1080I29_97      9 /* BT.1120/ SMPTE 274M */
-#define                V4L2_DV_1080I30         10 /* BT.1120/ SMPTE 274M */
-#define                V4L2_DV_1080I25         11 /* BT.1120 */
-#define                V4L2_DV_1080I50         12 /* SMPTE 296M */
-#define                V4L2_DV_1080I60         13 /* SMPTE 296M */
-#define                V4L2_DV_1080P24         14 /* SMPTE 296M */
-#define                V4L2_DV_1080P25         15 /* SMPTE 296M */
-#define                V4L2_DV_1080P30         16 /* SMPTE 296M */
-#define                V4L2_DV_1080P50         17 /* BT.1120 */
-#define                V4L2_DV_1080P60         18 /* BT.1120 */
-
-/*
- *     D V     B T     T I M I N G S
- */
-
-/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
- * @width:     total width of the active video in pixels
- * @height:    total height of the active video in lines
- * @interlaced:        Interlaced or progressive
- * @polarities:        Positive or negative polarities
- * @pixelclock:        Pixel clock in HZ. Ex. 74.25MHz->74250000
- * @hfrontporch:Horizontal front porch in pixels
- * @hsync:     Horizontal Sync length in pixels
- * @hbackporch:        Horizontal back porch in pixels
- * @vfrontporch:Vertical front porch in lines
- * @vsync:     Vertical Sync length in lines
- * @vbackporch:        Vertical back porch in lines
- * @il_vfrontporch:Vertical front porch for the even field
- *             (aka field 2) of interlaced field formats
- * @il_vsync:  Vertical Sync length for the even field
- *             (aka field 2) of interlaced field formats
- * @il_vbackporch:Vertical back porch for the even field
- *             (aka field 2) of interlaced field formats
- * @standards: Standards the timing belongs to
- * @flags:     Flags
- * @reserved:  Reserved fields, must be zeroed.
- *
- * A note regarding vertical interlaced timings: height refers to the total
- * height of the active video frame (= two fields). The blanking timings refer
- * to the blanking of each field. So the height of the total frame is
- * calculated as follows:
- *
- * tot_height = height + vfrontporch + vsync + vbackporch +
- *                       il_vfrontporch + il_vsync + il_vbackporch
- *
- * The active height of each field is height / 2.
- */
-struct v4l2_bt_timings {
-       __u32   width;
-       __u32   height;
-       __u32   interlaced;
-       __u32   polarities;
-       __u64   pixelclock;
-       __u32   hfrontporch;
-       __u32   hsync;
-       __u32   hbackporch;
-       __u32   vfrontporch;
-       __u32   vsync;
-       __u32   vbackporch;
-       __u32   il_vfrontporch;
-       __u32   il_vsync;
-       __u32   il_vbackporch;
-       __u32   standards;
-       __u32   flags;
-       __u32   reserved[14];
-} __attribute__ ((packed));
-
-/* Interlaced or progressive format */
-#define        V4L2_DV_PROGRESSIVE     0
-#define        V4L2_DV_INTERLACED      1
-
-/* Polarities. If bit is not set, it is assumed to be negative polarity */
-#define V4L2_DV_VSYNC_POS_POL  0x00000001
-#define V4L2_DV_HSYNC_POS_POL  0x00000002
-
-/* Timings standards */
-#define V4L2_DV_BT_STD_CEA861  (1 << 0)  /* CEA-861 Digital TV Profile */
-#define V4L2_DV_BT_STD_DMT     (1 << 1)  /* VESA Discrete Monitor Timings */
-#define V4L2_DV_BT_STD_CVT     (1 << 2)  /* VESA Coordinated Video Timings */
-#define V4L2_DV_BT_STD_GTF     (1 << 3)  /* VESA Generalized Timings Formula */
-
-/* Flags */
-
-/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
-   GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
-   intervals are reduced, allowing a higher resolution over the same
-   bandwidth. This is a read-only flag. */
-#define V4L2_DV_FL_REDUCED_BLANKING            (1 << 0)
-/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
-   of six. These formats can be optionally played at 1 / 1.001 speed.
-   This is a read-only flag. */
-#define V4L2_DV_FL_CAN_REDUCE_FPS              (1 << 1)
-/* CEA-861 specific: only valid for video transmitters, the flag is cleared
-   by receivers.
-   If the framerate of the format is a multiple of six, then the pixelclock
-   used to set up the transmitter is divided by 1.001 to make it compatible
-   with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
-   29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
-   such frequencies, then the flag will also be cleared. */
-#define V4L2_DV_FL_REDUCED_FPS                 (1 << 2)
-/* Specific to interlaced formats: if set, then field 1 is really one half-line
-   longer and field 2 is really one half-line shorter, so each field has
-   exactly the same number of half-lines. Whether half-lines can be detected
-   or used depends on the hardware. */
-#define V4L2_DV_FL_HALF_LINE                   (1 << 0)
-
-
-/** struct v4l2_dv_timings - DV timings
- * @type:      the type of the timings
- * @bt:        BT656/1120 timings
- */
-struct v4l2_dv_timings {
-       __u32 type;
-       union {
-               struct v4l2_bt_timings  bt;
-               __u32   reserved[32];
-       };
-} __attribute__ ((packed));
-
-/* Values for the type field */
-#define V4L2_DV_BT_656_1120    0       /* BT.656/1120 timing type */
-
-
-/** struct v4l2_enum_dv_timings - DV timings enumeration
- * @index:     enumeration index
- * @reserved:  must be zeroed
- * @timings:   the timings for the given index
- */
-struct v4l2_enum_dv_timings {
-       __u32 index;
-       __u32 reserved[3];
-       struct v4l2_dv_timings timings;
-};
-
-/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
- * @min_width:         width in pixels
- * @max_width:         width in pixels
- * @min_height:                height in lines
- * @max_height:                height in lines
- * @min_pixelclock:    Pixel clock in HZ. Ex. 74.25MHz->74250000
- * @max_pixelclock:    Pixel clock in HZ. Ex. 74.25MHz->74250000
- * @standards:         Supported standards
- * @capabilities:      Supported capabilities
- * @reserved:          Must be zeroed
- */
-struct v4l2_bt_timings_cap {
-       __u32   min_width;
-       __u32   max_width;
-       __u32   min_height;
-       __u32   max_height;
-       __u64   min_pixelclock;
-       __u64   max_pixelclock;
-       __u32   standards;
-       __u32   capabilities;
-       __u32   reserved[16];
-} __attribute__ ((packed));
-
-/* Supports interlaced formats */
-#define V4L2_DV_BT_CAP_INTERLACED      (1 << 0)
-/* Supports progressive formats */
-#define V4L2_DV_BT_CAP_PROGRESSIVE     (1 << 1)
-/* Supports CVT/GTF reduced blanking */
-#define V4L2_DV_BT_CAP_REDUCED_BLANKING        (1 << 2)
-/* Supports custom formats */
-#define V4L2_DV_BT_CAP_CUSTOM          (1 << 3)
-
-/** struct v4l2_dv_timings_cap - DV timings capabilities
- * @type:      the type of the timings (same as in struct v4l2_dv_timings)
- * @bt:                the BT656/1120 timings capabilities
- */
-struct v4l2_dv_timings_cap {
-       __u32 type;
-       __u32 reserved[3];
-       union {
-               struct v4l2_bt_timings_cap bt;
-               __u32 raw_data[32];
-       };
-};
-
-
-/*
- *     V I D E O   I N P U T S
- */
-struct v4l2_input {
-       __u32        index;             /*  Which input */
-       __u8         name[32];          /*  Label */
-       __u32        type;              /*  Type of input */
-       __u32        audioset;          /*  Associated audios (bitfield) */
-       __u32        tuner;             /*  enum v4l2_tuner_type */
-       v4l2_std_id  std;
-       __u32        status;
-       __u32        capabilities;
-       __u32        reserved[3];
-};
-
-/*  Values for the 'type' field */
-#define V4L2_INPUT_TYPE_TUNER          1
-#define V4L2_INPUT_TYPE_CAMERA         2
-
-/* field 'status' - general */
-#define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
-#define V4L2_IN_ST_NO_SIGNAL   0x00000002
-#define V4L2_IN_ST_NO_COLOR    0x00000004
-
-/* field 'status' - sensor orientation */
-/* If sensor is mounted upside down set both bits */
-#define V4L2_IN_ST_HFLIP       0x00000010 /* Frames are flipped horizontally */
-#define V4L2_IN_ST_VFLIP       0x00000020 /* Frames are flipped vertically */
-
-/* field 'status' - analog */
-#define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
-#define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
-
-/* field 'status' - digital */
-#define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
-#define V4L2_IN_ST_NO_EQU      0x00020000  /* No equalizer lock */
-#define V4L2_IN_ST_NO_CARRIER  0x00040000  /* Carrier recovery failed */
-
-/* field 'status' - VCR and set-top box */
-#define V4L2_IN_ST_MACROVISION 0x01000000  /* Macrovision detected */
-#define V4L2_IN_ST_NO_ACCESS   0x02000000  /* Conditional access denied */
-#define V4L2_IN_ST_VTR         0x04000000  /* VTR time constant */
-
-/* capabilities flags */
-#define V4L2_IN_CAP_PRESETS            0x00000001 /* Supports S_DV_PRESET */
-#define V4L2_IN_CAP_DV_TIMINGS         0x00000002 /* Supports S_DV_TIMINGS */
-#define V4L2_IN_CAP_CUSTOM_TIMINGS     V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
-#define V4L2_IN_CAP_STD                        0x00000004 /* Supports S_STD */
-
-/*
- *     V I D E O   O U T P U T S
- */
-struct v4l2_output {
-       __u32        index;             /*  Which output */
-       __u8         name[32];          /*  Label */
-       __u32        type;              /*  Type of output */
-       __u32        audioset;          /*  Associated audios (bitfield) */
-       __u32        modulator;         /*  Associated modulator */
-       v4l2_std_id  std;
-       __u32        capabilities;
-       __u32        reserved[3];
-};
-/*  Values for the 'type' field */
-#define V4L2_OUTPUT_TYPE_MODULATOR             1
-#define V4L2_OUTPUT_TYPE_ANALOG                        2
-#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY      3
-
-/* capabilities flags */
-#define V4L2_OUT_CAP_PRESETS           0x00000001 /* Supports S_DV_PRESET */
-#define V4L2_OUT_CAP_DV_TIMINGS                0x00000002 /* Supports S_DV_TIMINGS */
-#define V4L2_OUT_CAP_CUSTOM_TIMINGS    V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
-#define V4L2_OUT_CAP_STD               0x00000004 /* Supports S_STD */
-
-/*
- *     C O N T R O L S
- */
-struct v4l2_control {
-       __u32                id;
-       __s32                value;
-};
-
-struct v4l2_ext_control {
-       __u32 id;
-       __u32 size;
-       __u32 reserved2[1];
-       union {
-               __s32 value;
-               __s64 value64;
-               char *string;
-       };
-} __attribute__ ((packed));
-
-struct v4l2_ext_controls {
-       __u32 ctrl_class;
-       __u32 count;
-       __u32 error_idx;
-       __u32 reserved[2];
-       struct v4l2_ext_control *controls;
-};
-
-#define V4L2_CTRL_ID_MASK                (0x0fffffff)
-#define V4L2_CTRL_ID2CLASS(id)    ((id) & 0x0fff0000UL)
-#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
-
-enum v4l2_ctrl_type {
-       V4L2_CTRL_TYPE_INTEGER       = 1,
-       V4L2_CTRL_TYPE_BOOLEAN       = 2,
-       V4L2_CTRL_TYPE_MENU          = 3,
-       V4L2_CTRL_TYPE_BUTTON        = 4,
-       V4L2_CTRL_TYPE_INTEGER64     = 5,
-       V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
-       V4L2_CTRL_TYPE_STRING        = 7,
-       V4L2_CTRL_TYPE_BITMASK       = 8,
-       V4L2_CTRL_TYPE_INTEGER_MENU = 9,
-};
-
-/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
-struct v4l2_queryctrl {
-       __u32                id;
-       __u32                type;      /* enum v4l2_ctrl_type */
-       __u8                 name[32];  /* Whatever */
-       __s32                minimum;   /* Note signedness */
-       __s32                maximum;
-       __s32                step;
-       __s32                default_value;
-       __u32                flags;
-       __u32                reserved[2];
-};
-
-/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
-struct v4l2_querymenu {
-       __u32           id;
-       __u32           index;
-       union {
-               __u8    name[32];       /* Whatever */
-               __s64   value;
-       };
-       __u32           reserved;
-} __attribute__ ((packed));
-
-/*  Control flags  */
-#define V4L2_CTRL_FLAG_DISABLED                0x0001
-#define V4L2_CTRL_FLAG_GRABBED         0x0002
-#define V4L2_CTRL_FLAG_READ_ONLY       0x0004
-#define V4L2_CTRL_FLAG_UPDATE          0x0008
-#define V4L2_CTRL_FLAG_INACTIVE        0x0010
-#define V4L2_CTRL_FLAG_SLIDER          0x0020
-#define V4L2_CTRL_FLAG_WRITE_ONLY      0x0040
-#define V4L2_CTRL_FLAG_VOLATILE                0x0080
-
-/*  Query flag, to be ORed with the control ID */
-#define V4L2_CTRL_FLAG_NEXT_CTRL       0x80000000
-
-/*  User-class control IDs defined by V4L2 */
-#define V4L2_CID_MAX_CTRLS             1024
-/*  IDs reserved for driver specific controls */
-#define V4L2_CID_PRIVATE_BASE          0x08000000
-
-
-/*  DV-class control IDs defined by V4L2 */
-#define V4L2_CID_DV_CLASS_BASE                 (V4L2_CTRL_CLASS_DV | 0x900)
-#define V4L2_CID_DV_CLASS                      (V4L2_CTRL_CLASS_DV | 1)
-
-#define        V4L2_CID_DV_TX_HOTPLUG                  (V4L2_CID_DV_CLASS_BASE + 1)
-#define        V4L2_CID_DV_TX_RXSENSE                  (V4L2_CID_DV_CLASS_BASE + 2)
-#define        V4L2_CID_DV_TX_EDID_PRESENT             (V4L2_CID_DV_CLASS_BASE + 3)
-#define        V4L2_CID_DV_TX_MODE                     (V4L2_CID_DV_CLASS_BASE + 4)
-enum v4l2_dv_tx_mode {
-       V4L2_DV_TX_MODE_DVI_D   = 0,
-       V4L2_DV_TX_MODE_HDMI    = 1,
-};
-#define V4L2_CID_DV_TX_RGB_RANGE               (V4L2_CID_DV_CLASS_BASE + 5)
-enum v4l2_dv_rgb_range {
-       V4L2_DV_RGB_RANGE_AUTO    = 0,
-       V4L2_DV_RGB_RANGE_LIMITED = 1,
-       V4L2_DV_RGB_RANGE_FULL    = 2,
-};
-
-#define        V4L2_CID_DV_RX_POWER_PRESENT            (V4L2_CID_DV_CLASS_BASE + 100)
-#define V4L2_CID_DV_RX_RGB_RANGE               (V4L2_CID_DV_CLASS_BASE + 101)
-
-/*
- *     T U N I N G
- */
-struct v4l2_tuner {
-       __u32                   index;
-       __u8                    name[32];
-       __u32                   type;   /* enum v4l2_tuner_type */
-       __u32                   capability;
-       __u32                   rangelow;
-       __u32                   rangehigh;
-       __u32                   rxsubchans;
-       __u32                   audmode;
-       __s32                   signal;
-       __s32                   afc;
-       __u32                   reserved[4];
-};
-
-struct v4l2_modulator {
-       __u32                   index;
-       __u8                    name[32];
-       __u32                   capability;
-       __u32                   rangelow;
-       __u32                   rangehigh;
-       __u32                   txsubchans;
-       __u32                   reserved[4];
-};
-
-/*  Flags for the 'capability' field */
-#define V4L2_TUNER_CAP_LOW             0x0001
-#define V4L2_TUNER_CAP_NORM            0x0002
-#define V4L2_TUNER_CAP_HWSEEK_BOUNDED  0x0004
-#define V4L2_TUNER_CAP_HWSEEK_WRAP     0x0008
-#define V4L2_TUNER_CAP_STEREO          0x0010
-#define V4L2_TUNER_CAP_LANG2           0x0020
-#define V4L2_TUNER_CAP_SAP             0x0020
-#define V4L2_TUNER_CAP_LANG1           0x0040
-#define V4L2_TUNER_CAP_RDS             0x0080
-#define V4L2_TUNER_CAP_RDS_BLOCK_IO    0x0100
-#define V4L2_TUNER_CAP_RDS_CONTROLS    0x0200
-#define V4L2_TUNER_CAP_FREQ_BANDS      0x0400
-#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
-
-/*  Flags for the 'rxsubchans' field */
-#define V4L2_TUNER_SUB_MONO            0x0001
-#define V4L2_TUNER_SUB_STEREO          0x0002
-#define V4L2_TUNER_SUB_LANG2           0x0004
-#define V4L2_TUNER_SUB_SAP             0x0004
-#define V4L2_TUNER_SUB_LANG1           0x0008
-#define V4L2_TUNER_SUB_RDS             0x0010
-
-/*  Values for the 'audmode' field */
-#define V4L2_TUNER_MODE_MONO           0x0000
-#define V4L2_TUNER_MODE_STEREO         0x0001
-#define V4L2_TUNER_MODE_LANG2          0x0002
-#define V4L2_TUNER_MODE_SAP            0x0002
-#define V4L2_TUNER_MODE_LANG1          0x0003
-#define V4L2_TUNER_MODE_LANG1_LANG2    0x0004
-
-struct v4l2_frequency {
-       __u32   tuner;
-       __u32   type;   /* enum v4l2_tuner_type */
-       __u32   frequency;
-       __u32   reserved[8];
-};
-
-#define V4L2_BAND_MODULATION_VSB       (1 << 1)
-#define V4L2_BAND_MODULATION_FM                (1 << 2)
-#define V4L2_BAND_MODULATION_AM                (1 << 3)
-
-struct v4l2_frequency_band {
-       __u32   tuner;
-       __u32   type;   /* enum v4l2_tuner_type */
-       __u32   index;
-       __u32   capability;
-       __u32   rangelow;
-       __u32   rangehigh;
-       __u32   modulation;
-       __u32   reserved[9];
-};
-
-struct v4l2_hw_freq_seek {
-       __u32   tuner;
-       __u32   type;   /* enum v4l2_tuner_type */
-       __u32   seek_upward;
-       __u32   wrap_around;
-       __u32   spacing;
-       __u32   rangelow;
-       __u32   rangehigh;
-       __u32   reserved[5];
-};
-
-/*
- *     R D S
- */
-
-struct v4l2_rds_data {
-       __u8    lsb;
-       __u8    msb;
-       __u8    block;
-} __attribute__ ((packed));
-
-#define V4L2_RDS_BLOCK_MSK      0x7
-#define V4L2_RDS_BLOCK_A        0
-#define V4L2_RDS_BLOCK_B        1
-#define V4L2_RDS_BLOCK_C        2
-#define V4L2_RDS_BLOCK_D        3
-#define V4L2_RDS_BLOCK_C_ALT    4
-#define V4L2_RDS_BLOCK_INVALID          7
-
-#define V4L2_RDS_BLOCK_CORRECTED 0x40
-#define V4L2_RDS_BLOCK_ERROR    0x80
-
-/*
- *     A U D I O
- */
-struct v4l2_audio {
-       __u32   index;
-       __u8    name[32];
-       __u32   capability;
-       __u32   mode;
-       __u32   reserved[2];
-};
-
-/*  Flags for the 'capability' field */
-#define V4L2_AUDCAP_STEREO             0x00001
-#define V4L2_AUDCAP_AVL                        0x00002
-
-/*  Flags for the 'mode' field */
-#define V4L2_AUDMODE_AVL               0x00001
-
-struct v4l2_audioout {
-       __u32   index;
-       __u8    name[32];
-       __u32   capability;
-       __u32   mode;
-       __u32   reserved[2];
-};
-
-/*
- *     M P E G   S E R V I C E S
- *
- *     NOTE: EXPERIMENTAL API
- */
-#if 1
-#define V4L2_ENC_IDX_FRAME_I    (0)
-#define V4L2_ENC_IDX_FRAME_P    (1)
-#define V4L2_ENC_IDX_FRAME_B    (2)
-#define V4L2_ENC_IDX_FRAME_MASK (0xf)
-
-struct v4l2_enc_idx_entry {
-       __u64 offset;
-       __u64 pts;
-       __u32 length;
-       __u32 flags;
-       __u32 reserved[2];
-};
-
-#define V4L2_ENC_IDX_ENTRIES (64)
-struct v4l2_enc_idx {
-       __u32 entries;
-       __u32 entries_cap;
-       __u32 reserved[4];
-       struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
-};
-
-
-#define V4L2_ENC_CMD_START      (0)
-#define V4L2_ENC_CMD_STOP       (1)
-#define V4L2_ENC_CMD_PAUSE      (2)
-#define V4L2_ENC_CMD_RESUME     (3)
-
-/* Flags for V4L2_ENC_CMD_STOP */
-#define V4L2_ENC_CMD_STOP_AT_GOP_END    (1 << 0)
-
-struct v4l2_encoder_cmd {
-       __u32 cmd;
-       __u32 flags;
-       union {
-               struct {
-                       __u32 data[8];
-               } raw;
-       };
-};
-
-/* Decoder commands */
-#define V4L2_DEC_CMD_START       (0)
-#define V4L2_DEC_CMD_STOP        (1)
-#define V4L2_DEC_CMD_PAUSE       (2)
-#define V4L2_DEC_CMD_RESUME      (3)
-
-/* Flags for V4L2_DEC_CMD_START */
-#define V4L2_DEC_CMD_START_MUTE_AUDIO  (1 << 0)
-
-/* Flags for V4L2_DEC_CMD_PAUSE */
-#define V4L2_DEC_CMD_PAUSE_TO_BLACK    (1 << 0)
-
-/* Flags for V4L2_DEC_CMD_STOP */
-#define V4L2_DEC_CMD_STOP_TO_BLACK     (1 << 0)
-#define V4L2_DEC_CMD_STOP_IMMEDIATELY  (1 << 1)
-
-/* Play format requirements (returned by the driver): */
-
-/* The decoder has no special format requirements */
-#define V4L2_DEC_START_FMT_NONE                (0)
-/* The decoder requires full GOPs */
-#define V4L2_DEC_START_FMT_GOP         (1)
-
-/* The structure must be zeroed before use by the application
-   This ensures it can be extended safely in the future. */
-struct v4l2_decoder_cmd {
-       __u32 cmd;
-       __u32 flags;
-       union {
-               struct {
-                       __u64 pts;
-               } stop;
-
-               struct {
-                       /* 0 or 1000 specifies normal speed,
-                          1 specifies forward single stepping,
-                          -1 specifies backward single stepping,
-                          >1: playback at speed/1000 of the normal speed,
-                          <-1: reverse playback at (-speed/1000) of the normal speed. */
-                       __s32 speed;
-                       __u32 format;
-               } start;
-
-               struct {
-                       __u32 data[16];
-               } raw;
-       };
-};
-#endif
-
-
-/*
- *     D A T A   S E R V I C E S   ( V B I )
- *
- *     Data services API by Michael Schimek
- */
-
-/* Raw VBI */
-struct v4l2_vbi_format {
-       __u32   sampling_rate;          /* in 1 Hz */
-       __u32   offset;
-       __u32   samples_per_line;
-       __u32   sample_format;          /* V4L2_PIX_FMT_* */
-       __s32   start[2];
-       __u32   count[2];
-       __u32   flags;                  /* V4L2_VBI_* */
-       __u32   reserved[2];            /* must be zero */
-};
-
-/*  VBI flags  */
-#define V4L2_VBI_UNSYNC                (1 << 0)
-#define V4L2_VBI_INTERLACED    (1 << 1)
-
-/* Sliced VBI
- *
- *    This implements is a proposal V4L2 API to allow SLICED VBI
- * required for some hardware encoders. It should change without
- * notice in the definitive implementation.
- */
-
-struct v4l2_sliced_vbi_format {
-       __u16   service_set;
-       /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
-          service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
-                                (equals frame lines 313-336 for 625 line video
-                                 standards, 263-286 for 525 line standards) */
-       __u16   service_lines[2][24];
-       __u32   io_size;
-       __u32   reserved[2];            /* must be zero */
-};
-
-/* Teletext World System Teletext
-   (WST), defined on ITU-R BT.653-2 */
-#define V4L2_SLICED_TELETEXT_B          (0x0001)
-/* Video Program System, defined on ETS 300 231*/
-#define V4L2_SLICED_VPS                 (0x0400)
-/* Closed Caption, defined on EIA-608 */
-#define V4L2_SLICED_CAPTION_525         (0x1000)
-/* Wide Screen System, defined on ITU-R BT1119.1 */
-#define V4L2_SLICED_WSS_625             (0x4000)
-
-#define V4L2_SLICED_VBI_525             (V4L2_SLICED_CAPTION_525)
-#define V4L2_SLICED_VBI_625             (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
-
-struct v4l2_sliced_vbi_cap {
-       __u16   service_set;
-       /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
-          service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
-                                (equals frame lines 313-336 for 625 line video
-                                 standards, 263-286 for 525 line standards) */
-       __u16   service_lines[2][24];
-       __u32   type;           /* enum v4l2_buf_type */
-       __u32   reserved[3];    /* must be 0 */
-};
-
-struct v4l2_sliced_vbi_data {
-       __u32   id;
-       __u32   field;          /* 0: first field, 1: second field */
-       __u32   line;           /* 1-23 */
-       __u32   reserved;       /* must be 0 */
-       __u8    data[48];
-};
-
-/*
- * Sliced VBI data inserted into MPEG Streams
- */
-
-/*
- * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
- *
- * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
- * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
- * data
- *
- * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
- * definitions are not included here.  See the MPEG-2 specifications for details
- * on these headers.
- */
-
-/* Line type IDs */
-#define V4L2_MPEG_VBI_IVTV_TELETEXT_B     (1)
-#define V4L2_MPEG_VBI_IVTV_CAPTION_525    (4)
-#define V4L2_MPEG_VBI_IVTV_WSS_625        (5)
-#define V4L2_MPEG_VBI_IVTV_VPS            (7)
-
-struct v4l2_mpeg_vbi_itv0_line {
-       __u8 id;        /* One of V4L2_MPEG_VBI_IVTV_* above */
-       __u8 data[42];  /* Sliced VBI data for the line */
-} __attribute__ ((packed));
-
-struct v4l2_mpeg_vbi_itv0 {
-       __le32 linemask[2]; /* Bitmasks of VBI service lines present */
-       struct v4l2_mpeg_vbi_itv0_line line[35];
-} __attribute__ ((packed));
-
-struct v4l2_mpeg_vbi_ITV0 {
-       struct v4l2_mpeg_vbi_itv0_line line[36];
-} __attribute__ ((packed));
-
-#define V4L2_MPEG_VBI_IVTV_MAGIC0      "itv0"
-#define V4L2_MPEG_VBI_IVTV_MAGIC1      "ITV0"
-
-struct v4l2_mpeg_vbi_fmt_ivtv {
-       __u8 magic[4];
-       union {
-               struct v4l2_mpeg_vbi_itv0 itv0;
-               struct v4l2_mpeg_vbi_ITV0 ITV0;
-       };
-} __attribute__ ((packed));
-
-/*
- *     A G G R E G A T E   S T R U C T U R E S
- */
-
-/**
- * struct v4l2_plane_pix_format - additional, per-plane format definition
- * @sizeimage:         maximum size in bytes required for data, for which
- *                     this plane will be used
- * @bytesperline:      distance in bytes between the leftmost pixels in two
- *                     adjacent lines
- */
-struct v4l2_plane_pix_format {
-       __u32           sizeimage;
-       __u16           bytesperline;
-       __u16           reserved[7];
-} __attribute__ ((packed));
-
-/**
- * struct v4l2_pix_format_mplane - multiplanar format definition
- * @width:             image width in pixels
- * @height:            image height in pixels
- * @pixelformat:       little endian four character code (fourcc)
- * @field:             enum v4l2_field; field order (for interlaced video)
- * @colorspace:                enum v4l2_colorspace; supplemental to pixelformat
- * @plane_fmt:         per-plane information
- * @num_planes:                number of planes for this format
- */
-struct v4l2_pix_format_mplane {
-       __u32                           width;
-       __u32                           height;
-       __u32                           pixelformat;
-       __u32                           field;
-       __u32                           colorspace;
-
-       struct v4l2_plane_pix_format    plane_fmt[VIDEO_MAX_PLANES];
-       __u8                            num_planes;
-       __u8                            reserved[11];
-} __attribute__ ((packed));
-
-/**
- * struct v4l2_format - stream data format
- * @type:      enum v4l2_buf_type; type of the data stream
- * @pix:       definition of an image format
- * @pix_mp:    definition of a multiplanar image format
- * @win:       definition of an overlaid image
- * @vbi:       raw VBI capture or output parameters
- * @sliced:    sliced VBI capture or output parameters
- * @raw_data:  placeholder for future extensions and custom formats
- */
-struct v4l2_format {
-       __u32    type;
-       union {
-               struct v4l2_pix_format          pix;     /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
-               struct v4l2_pix_format_mplane   pix_mp;  /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
-               struct v4l2_window              win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
-               struct v4l2_vbi_format          vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
-               struct v4l2_sliced_vbi_format   sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
-               __u8    raw_data[200];                   /* user-defined */
-       } fmt;
-};
-
-/*     Stream type-dependent parameters
- */
-struct v4l2_streamparm {
-       __u32    type;                  /* enum v4l2_buf_type */
-       union {
-               struct v4l2_captureparm capture;
-               struct v4l2_outputparm  output;
-               __u8    raw_data[200];  /* user-defined */
-       } parm;
-};
-
-/*
- *     E V E N T S
- */
-
-#define V4L2_EVENT_ALL                         0
-#define V4L2_EVENT_VSYNC                       1
-#define V4L2_EVENT_EOS                         2
-#define V4L2_EVENT_CTRL                                3
-#define V4L2_EVENT_FRAME_SYNC                  4
-#define V4L2_EVENT_PRIVATE_START               0x08000000
-
-/* Payload for V4L2_EVENT_VSYNC */
-struct v4l2_event_vsync {
-       /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
-       __u8 field;
-} __attribute__ ((packed));
-
-/* Payload for V4L2_EVENT_CTRL */
-#define V4L2_EVENT_CTRL_CH_VALUE               (1 << 0)
-#define V4L2_EVENT_CTRL_CH_FLAGS               (1 << 1)
-
-struct v4l2_event_ctrl {
-       __u32 changes;
-       __u32 type;
-       union {
-               __s32 value;
-               __s64 value64;
-       };
-       __u32 flags;
-       __s32 minimum;
-       __s32 maximum;
-       __s32 step;
-       __s32 default_value;
-};
-
-struct v4l2_event_frame_sync {
-       __u32 frame_sequence;
-};
-
-struct v4l2_event {
-       __u32                           type;
-       union {
-               struct v4l2_event_vsync         vsync;
-               struct v4l2_event_ctrl          ctrl;
-               struct v4l2_event_frame_sync    frame_sync;
-               __u8                            data[64];
-       } u;
-       __u32                           pending;
-       __u32                           sequence;
-       struct timespec                 timestamp;
-       __u32                           id;
-       __u32                           reserved[8];
-};
-
-#define V4L2_EVENT_SUB_FL_SEND_INITIAL         (1 << 0)
-#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK       (1 << 1)
-
-struct v4l2_event_subscription {
-       __u32                           type;
-       __u32                           id;
-       __u32                           flags;
-       __u32                           reserved[5];
-};
-
-/*
- *     A D V A N C E D   D E B U G G I N G
- *
- *     NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
- *     FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
- */
-
-/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
-
-#define V4L2_CHIP_MATCH_HOST       0  /* Match against chip ID on host (0 for the host) */
-#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver name */
-#define V4L2_CHIP_MATCH_I2C_ADDR   2  /* Match against I2C 7-bit address */
-#define V4L2_CHIP_MATCH_AC97       3  /* Match against anciliary AC97 chip */
-
-struct v4l2_dbg_match {
-       __u32 type; /* Match type */
-       union {     /* Match this chip, meaning determined by type */
-               __u32 addr;
-               char name[32];
-       };
-} __attribute__ ((packed));
-
-struct v4l2_dbg_register {
-       struct v4l2_dbg_match match;
-       __u32 size;     /* register size in bytes */
-       __u64 reg;
-       __u64 val;
-} __attribute__ ((packed));
-
-/* VIDIOC_DBG_G_CHIP_IDENT */
-struct v4l2_dbg_chip_ident {
-       struct v4l2_dbg_match match;
-       __u32 ident;       /* chip identifier as specified in <media/v4l2-chip-ident.h> */
-       __u32 revision;    /* chip revision, chip specific */
-} __attribute__ ((packed));
-
-/**
- * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
- * @index:     on return, index of the first created buffer
- * @count:     entry: number of requested buffers,
- *             return: number of created buffers
- * @memory:    enum v4l2_memory; buffer memory type
- * @format:    frame format, for which buffers are requested
- * @reserved:  future extensions
- */
-struct v4l2_create_buffers {
-       __u32                   index;
-       __u32                   count;
-       __u32                   memory;
-       struct v4l2_format      format;
-       __u32                   reserved[8];
-};
-
-/*
- *     I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
- *
- */
-#define VIDIOC_QUERYCAP                 _IOR('V',  0, struct v4l2_capability)
-#define VIDIOC_RESERVED                  _IO('V',  1)
-#define VIDIOC_ENUM_FMT         _IOWR('V',  2, struct v4l2_fmtdesc)
-#define VIDIOC_G_FMT           _IOWR('V',  4, struct v4l2_format)
-#define VIDIOC_S_FMT           _IOWR('V',  5, struct v4l2_format)
-#define VIDIOC_REQBUFS         _IOWR('V',  8, struct v4l2_requestbuffers)
-#define VIDIOC_QUERYBUF                _IOWR('V',  9, struct v4l2_buffer)
-#define VIDIOC_G_FBUF           _IOR('V', 10, struct v4l2_framebuffer)
-#define VIDIOC_S_FBUF           _IOW('V', 11, struct v4l2_framebuffer)
-#define VIDIOC_OVERLAY          _IOW('V', 14, int)
-#define VIDIOC_QBUF            _IOWR('V', 15, struct v4l2_buffer)
-#define VIDIOC_DQBUF           _IOWR('V', 17, struct v4l2_buffer)
-#define VIDIOC_STREAMON                 _IOW('V', 18, int)
-#define VIDIOC_STREAMOFF        _IOW('V', 19, int)
-#define VIDIOC_G_PARM          _IOWR('V', 21, struct v4l2_streamparm)
-#define VIDIOC_S_PARM          _IOWR('V', 22, struct v4l2_streamparm)
-#define VIDIOC_G_STD            _IOR('V', 23, v4l2_std_id)
-#define VIDIOC_S_STD            _IOW('V', 24, v4l2_std_id)
-#define VIDIOC_ENUMSTD         _IOWR('V', 25, struct v4l2_standard)
-#define VIDIOC_ENUMINPUT       _IOWR('V', 26, struct v4l2_input)
-#define VIDIOC_G_CTRL          _IOWR('V', 27, struct v4l2_control)
-#define VIDIOC_S_CTRL          _IOWR('V', 28, struct v4l2_control)
-#define VIDIOC_G_TUNER         _IOWR('V', 29, struct v4l2_tuner)
-#define VIDIOC_S_TUNER          _IOW('V', 30, struct v4l2_tuner)
-#define VIDIOC_G_AUDIO          _IOR('V', 33, struct v4l2_audio)
-#define VIDIOC_S_AUDIO          _IOW('V', 34, struct v4l2_audio)
-#define VIDIOC_QUERYCTRL       _IOWR('V', 36, struct v4l2_queryctrl)
-#define VIDIOC_QUERYMENU       _IOWR('V', 37, struct v4l2_querymenu)
-#define VIDIOC_G_INPUT          _IOR('V', 38, int)
-#define VIDIOC_S_INPUT         _IOWR('V', 39, int)
-#define VIDIOC_G_OUTPUT                 _IOR('V', 46, int)
-#define VIDIOC_S_OUTPUT                _IOWR('V', 47, int)
-#define VIDIOC_ENUMOUTPUT      _IOWR('V', 48, struct v4l2_output)
-#define VIDIOC_G_AUDOUT                 _IOR('V', 49, struct v4l2_audioout)
-#define VIDIOC_S_AUDOUT                 _IOW('V', 50, struct v4l2_audioout)
-#define VIDIOC_G_MODULATOR     _IOWR('V', 54, struct v4l2_modulator)
-#define VIDIOC_S_MODULATOR      _IOW('V', 55, struct v4l2_modulator)
-#define VIDIOC_G_FREQUENCY     _IOWR('V', 56, struct v4l2_frequency)
-#define VIDIOC_S_FREQUENCY      _IOW('V', 57, struct v4l2_frequency)
-#define VIDIOC_CROPCAP         _IOWR('V', 58, struct v4l2_cropcap)
-#define VIDIOC_G_CROP          _IOWR('V', 59, struct v4l2_crop)
-#define VIDIOC_S_CROP           _IOW('V', 60, struct v4l2_crop)
-#define VIDIOC_G_JPEGCOMP       _IOR('V', 61, struct v4l2_jpegcompression)
-#define VIDIOC_S_JPEGCOMP       _IOW('V', 62, struct v4l2_jpegcompression)
-#define VIDIOC_QUERYSTD         _IOR('V', 63, v4l2_std_id)
-#define VIDIOC_TRY_FMT         _IOWR('V', 64, struct v4l2_format)
-#define VIDIOC_ENUMAUDIO       _IOWR('V', 65, struct v4l2_audio)
-#define VIDIOC_ENUMAUDOUT      _IOWR('V', 66, struct v4l2_audioout)
-#define VIDIOC_G_PRIORITY       _IOR('V', 67, __u32) /* enum v4l2_priority */
-#define VIDIOC_S_PRIORITY       _IOW('V', 68, __u32) /* enum v4l2_priority */
-#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
-#define VIDIOC_LOG_STATUS         _IO('V', 70)
-#define VIDIOC_G_EXT_CTRLS     _IOWR('V', 71, struct v4l2_ext_controls)
-#define VIDIOC_S_EXT_CTRLS     _IOWR('V', 72, struct v4l2_ext_controls)
-#define VIDIOC_TRY_EXT_CTRLS   _IOWR('V', 73, struct v4l2_ext_controls)
-#if 1
-#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
-#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
-#define VIDIOC_G_ENC_INDEX       _IOR('V', 76, struct v4l2_enc_idx)
-#define VIDIOC_ENCODER_CMD      _IOWR('V', 77, struct v4l2_encoder_cmd)
-#define VIDIOC_TRY_ENCODER_CMD  _IOWR('V', 78, struct v4l2_encoder_cmd)
-#endif
-
-#if 1
-/* Experimental, meant for debugging, testing and internal use.
-   Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
-   You must be root to use these ioctls. Never use these in applications! */
-#define        VIDIOC_DBG_S_REGISTER    _IOW('V', 79, struct v4l2_dbg_register)
-#define        VIDIOC_DBG_G_REGISTER   _IOWR('V', 80, struct v4l2_dbg_register)
-
-/* Experimental, meant for debugging, testing and internal use.
-   Never use this ioctl in applications! */
-#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
-#endif
-
-#define VIDIOC_S_HW_FREQ_SEEK   _IOW('V', 82, struct v4l2_hw_freq_seek)
-
-/* These four DV Preset ioctls are deprecated in favor of the DV Timings
-   ioctls. */
-#define        VIDIOC_ENUM_DV_PRESETS  _IOWR('V', 83, struct v4l2_dv_enum_preset)
-#define        VIDIOC_S_DV_PRESET      _IOWR('V', 84, struct v4l2_dv_preset)
-#define        VIDIOC_G_DV_PRESET      _IOWR('V', 85, struct v4l2_dv_preset)
-#define        VIDIOC_QUERY_DV_PRESET  _IOR('V',  86, struct v4l2_dv_preset)
-#define        VIDIOC_S_DV_TIMINGS     _IOWR('V', 87, struct v4l2_dv_timings)
-#define        VIDIOC_G_DV_TIMINGS     _IOWR('V', 88, struct v4l2_dv_timings)
-#define        VIDIOC_DQEVENT           _IOR('V', 89, struct v4l2_event)
-#define        VIDIOC_SUBSCRIBE_EVENT   _IOW('V', 90, struct v4l2_event_subscription)
-#define        VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
-
-/* Experimental, the below two ioctls may change over the next couple of kernel
-   versions */
-#define VIDIOC_CREATE_BUFS     _IOWR('V', 92, struct v4l2_create_buffers)
-#define VIDIOC_PREPARE_BUF     _IOWR('V', 93, struct v4l2_buffer)
-
-/* Experimental selection API */
-#define VIDIOC_G_SELECTION     _IOWR('V', 94, struct v4l2_selection)
-#define VIDIOC_S_SELECTION     _IOWR('V', 95, struct v4l2_selection)
-
-/* Experimental, these two ioctls may change over the next couple of kernel
-   versions. */
-#define VIDIOC_DECODER_CMD     _IOWR('V', 96, struct v4l2_decoder_cmd)
-#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
-
-/* Experimental, these three ioctls may change over the next couple of kernel
-   versions. */
-#define VIDIOC_ENUM_DV_TIMINGS  _IOWR('V', 98, struct v4l2_enum_dv_timings)
-#define VIDIOC_QUERY_DV_TIMINGS  _IOR('V', 99, struct v4l2_dv_timings)
-#define VIDIOC_DV_TIMINGS_CAP   _IOWR('V', 100, struct v4l2_dv_timings_cap)
-
-/* Experimental, this ioctl may change over the next couple of kernel
-   versions. */
-#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
-
-/* Reminder: when adding new ioctls please add support for them to
-   drivers/media/video/v4l2-compat-ioctl32.c as well! */
-
-#define BASE_VIDIOC_PRIVATE    192             /* 192-255 are private */
+#include <uapi/linux/videodev2.h>
 
 #endif /* __LINUX_VIDEODEV2_H */
index e2850a7ea2762ef01351c05b38bc31c6db721ab4..29b9104232b40c038bf29969d9c63795e8575fce 100644 (file)
@@ -1,60 +1,10 @@
 #ifndef _LINUX_VIRTIO_CONFIG_H
 #define _LINUX_VIRTIO_CONFIG_H
-/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
- * anyone can use the definitions to implement compatible drivers/servers.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of IBM nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE. */
-
-/* Virtio devices use a standardized configuration space to define their
- * features and pass configuration information, but each implementation can
- * store and access that space differently. */
-#include <linux/types.h>
-
-/* Status byte for guest to report progress, and synchronize features. */
-/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
-#define VIRTIO_CONFIG_S_ACKNOWLEDGE    1
-/* We have found a driver for the device. */
-#define VIRTIO_CONFIG_S_DRIVER         2
-/* Driver has used its parts of the config, and is happy */
-#define VIRTIO_CONFIG_S_DRIVER_OK      4
-/* We've given up on this device. */
-#define VIRTIO_CONFIG_S_FAILED         0x80
-
-/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
- * transport being used (eg. virtio_ring), the rest are per-device feature
- * bits. */
-#define VIRTIO_TRANSPORT_F_START       28
-#define VIRTIO_TRANSPORT_F_END         32
-
-/* Do we get callbacks when the ring is completely used, even if we've
- * suppressed them? */
-#define VIRTIO_F_NOTIFY_ON_EMPTY       24
 
-#ifdef __KERNEL__
 #include <linux/err.h>
 #include <linux/bug.h>
 #include <linux/virtio.h>
+#include <uapi/linux/virtio_config.h>
 
 /**
  * virtio_config_ops - operations for configuring a virtio device
@@ -213,5 +163,4 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
 }
 
 
-#endif /* __KERNEL__ */
 #endif /* _LINUX_VIRTIO_CONFIG_H */
index bdf4b0034739e379b4eae94e17171aaca64f3bd0..d2e2785af60260b3466c127155195aa8222ef2f2 100644 (file)
@@ -1,8 +1,3 @@
-#ifndef _LINUX_VIRTIO_CONSOLE_H
-#define _LINUX_VIRTIO_CONSOLE_H
-#include <linux/types.h>
-#include <linux/virtio_ids.h>
-#include <linux/virtio_config.h>
 /*
  * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
  * anyone can use the definitions to implement compatible drivers/servers:
  * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
  * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
  */
+#ifndef _LINUX_VIRTIO_CONSOLE_H
+#define _LINUX_VIRTIO_CONSOLE_H
 
-/* Feature bits */
-#define VIRTIO_CONSOLE_F_SIZE  0       /* Does host provide console size? */
-#define VIRTIO_CONSOLE_F_MULTIPORT 1   /* Does host provide multiple ports? */
-
-#define VIRTIO_CONSOLE_BAD_ID          (~(u32)0)
-
-struct virtio_console_config {
-       /* colums of the screens */
-       __u16 cols;
-       /* rows of the screens */
-       __u16 rows;
-       /* max. number of ports this device can hold */
-       __u32 max_nr_ports;
-} __attribute__((packed));
-
-/*
- * A message that's passed between the Host and the Guest for a
- * particular port.
- */
-struct virtio_console_control {
-       __u32 id;               /* Port number */
-       __u16 event;            /* The kind of control event (see below) */
-       __u16 value;            /* Extra information for the key */
-};
-
-/* Some events for control messages */
-#define VIRTIO_CONSOLE_DEVICE_READY    0
-#define VIRTIO_CONSOLE_PORT_ADD                1
-#define VIRTIO_CONSOLE_PORT_REMOVE     2
-#define VIRTIO_CONSOLE_PORT_READY      3
-#define VIRTIO_CONSOLE_CONSOLE_PORT    4
-#define VIRTIO_CONSOLE_RESIZE          5
-#define VIRTIO_CONSOLE_PORT_OPEN       6
-#define VIRTIO_CONSOLE_PORT_NAME       7
+#include <uapi/linux/virtio_console.h>
 
-#ifdef __KERNEL__
 int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
-#endif /* __KERNEL__ */
-
 #endif /* _LINUX_VIRTIO_CONSOLE_H */
index c2d793a06ad701ddf2f74e38aff7abee5cdebec0..63c6ea199519305b907c34dc42d82290ec57bb07 100644 (file)
@@ -1,167 +1,9 @@
 #ifndef _LINUX_VIRTIO_RING_H
 #define _LINUX_VIRTIO_RING_H
-/* An interface for efficient virtio implementation, currently for use by KVM
- * and lguest, but hopefully others soon.  Do NOT change this since it will
- * break existing servers and clients.
- *
- * This header is BSD licensed so anyone can use the definitions to implement
- * compatible drivers/servers.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of IBM nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Copyright Rusty Russell IBM Corporation 2007. */
-#include <linux/types.h>
 
-/* This marks a buffer as continuing via the next field. */
-#define VRING_DESC_F_NEXT      1
-/* This marks a buffer as write-only (otherwise read-only). */
-#define VRING_DESC_F_WRITE     2
-/* This means the buffer contains a list of buffer descriptors. */
-#define VRING_DESC_F_INDIRECT  4
-
-/* The Host uses this in used->flags to advise the Guest: don't kick me when
- * you add a buffer.  It's unreliable, so it's simply an optimization.  Guest
- * will still kick if it's out of buffers. */
-#define VRING_USED_F_NO_NOTIFY 1
-/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
- * when you consume a buffer.  It's unreliable, so it's simply an
- * optimization.  */
-#define VRING_AVAIL_F_NO_INTERRUPT     1
-
-/* We support indirect buffer descriptors */
-#define VIRTIO_RING_F_INDIRECT_DESC    28
-
-/* The Guest publishes the used index for which it expects an interrupt
- * at the end of the avail ring. Host should ignore the avail->flags field. */
-/* The Host publishes the avail index for which it expects a kick
- * at the end of the used ring. Guest should ignore the used->flags field. */
-#define VIRTIO_RING_F_EVENT_IDX                29
-
-/* Virtio ring descriptors: 16 bytes.  These can chain together via "next". */
-struct vring_desc {
-       /* Address (guest-physical). */
-       __u64 addr;
-       /* Length. */
-       __u32 len;
-       /* The flags as indicated above. */
-       __u16 flags;
-       /* We chain unused descriptors via this, too */
-       __u16 next;
-};
-
-struct vring_avail {
-       __u16 flags;
-       __u16 idx;
-       __u16 ring[];
-};
-
-/* u32 is used here for ids for padding reasons. */
-struct vring_used_elem {
-       /* Index of start of used descriptor chain. */
-       __u32 id;
-       /* Total length of the descriptor chain which was used (written to) */
-       __u32 len;
-};
-
-struct vring_used {
-       __u16 flags;
-       __u16 idx;
-       struct vring_used_elem ring[];
-};
-
-struct vring {
-       unsigned int num;
-
-       struct vring_desc *desc;
-
-       struct vring_avail *avail;
-
-       struct vring_used *used;
-};
-
-/* The standard layout for the ring is a continuous chunk of memory which looks
- * like this.  We assume num is a power of 2.
- *
- * struct vring
- * {
- *     // The actual descriptors (16 bytes each)
- *     struct vring_desc desc[num];
- *
- *     // A ring of available descriptor heads with free-running index.
- *     __u16 avail_flags;
- *     __u16 avail_idx;
- *     __u16 available[num];
- *     __u16 used_event_idx;
- *
- *     // Padding to the next align boundary.
- *     char pad[];
- *
- *     // A ring of used descriptor heads with free-running index.
- *     __u16 used_flags;
- *     __u16 used_idx;
- *     struct vring_used_elem used[num];
- *     __u16 avail_event_idx;
- * };
- */
-/* We publish the used event index at the end of the available ring, and vice
- * versa. They are at the end for backwards compatibility. */
-#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
-#define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num])
-
-static inline void vring_init(struct vring *vr, unsigned int num, void *p,
-                             unsigned long align)
-{
-       vr->num = num;
-       vr->desc = p;
-       vr->avail = p + num*sizeof(struct vring_desc);
-       vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
-               + align-1) & ~(align - 1));
-}
-
-static inline unsigned vring_size(unsigned int num, unsigned long align)
-{
-       return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
-                + align - 1) & ~(align - 1))
-               + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
-}
-
-/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
-/* Assuming a given event_idx value from the other size, if
- * we have just incremented index from old to new_idx,
- * should we trigger an event? */
-static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
-{
-       /* Note: Xen has similar logic for notification hold-off
-        * in include/xen/interface/io/ring.h with req_event and req_prod
-        * corresponding to event_idx + 1 and new_idx respectively.
-        * Note also that req_event and req_prod in Xen start at 1,
-        * event indexes in virtio start at 0. */
-       return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
-}
-
-#ifdef __KERNEL__
 #include <linux/irqreturn.h>
+#include <uapi/linux/virtio_ring.h>
+
 struct virtio_device;
 struct virtqueue;
 
@@ -179,5 +21,4 @@ void vring_del_virtqueue(struct virtqueue *vq);
 void vring_transport_features(struct virtio_device *vdev);
 
 irqreturn_t vring_interrupt(int irq, void *_vq);
-#endif /* __KERNEL__ */
 #endif /* _LINUX_VIRTIO_RING_H */
index 30a8dd9c83ffe7285ed92054a280b685220d87e8..b186e043523969b016fe12508da9c25000ec0223 100644 (file)
@@ -1,90 +1,8 @@
 #ifndef _LINUX_VT_H
 #define _LINUX_VT_H
 
+#include <uapi/linux/vt.h>
 
-/*
- * These constants are also useful for user-level apps (e.g., VC
- * resizing).
- */
-#define MIN_NR_CONSOLES 1       /* must be at least 1 */
-#define MAX_NR_CONSOLES        63      /* serial lines start at 64 */
-#define MAX_NR_USER_CONSOLES 63        /* must be root to allocate above this */
-               /* Note: the ioctl VT_GETSTATE does not work for
-                  consoles 16 and higher (since it returns a short) */
-
-/* 0x56 is 'V', to avoid collision with termios and kd */
-
-#define VT_OPENQRY     0x5600  /* find available vt */
-
-struct vt_mode {
-       char mode;              /* vt mode */
-       char waitv;             /* if set, hang on writes if not active */
-       short relsig;           /* signal to raise on release req */
-       short acqsig;           /* signal to raise on acquisition */
-       short frsig;            /* unused (set to 0) */
-};
-#define VT_GETMODE     0x5601  /* get mode of active vt */
-#define VT_SETMODE     0x5602  /* set mode of active vt */
-#define                VT_AUTO         0x00    /* auto vt switching */
-#define                VT_PROCESS      0x01    /* process controls switching */
-#define                VT_ACKACQ       0x02    /* acknowledge switch */
-
-struct vt_stat {
-       unsigned short v_active;        /* active vt */
-       unsigned short v_signal;        /* signal to send */
-       unsigned short v_state;         /* vt bitmask */
-};
-#define VT_GETSTATE    0x5603  /* get global vt state info */
-#define VT_SENDSIG     0x5604  /* signal to send to bitmask of vts */
-
-#define VT_RELDISP     0x5605  /* release display */
-
-#define VT_ACTIVATE    0x5606  /* make vt active */
-#define VT_WAITACTIVE  0x5607  /* wait for vt active */
-#define VT_DISALLOCATE 0x5608  /* free memory associated to vt */
-
-struct vt_sizes {
-       unsigned short v_rows;          /* number of rows */
-       unsigned short v_cols;          /* number of columns */
-       unsigned short v_scrollsize;    /* number of lines of scrollback */
-};
-#define VT_RESIZE      0x5609  /* set kernel's idea of screensize */
-
-struct vt_consize {
-       unsigned short v_rows;  /* number of rows */
-       unsigned short v_cols;  /* number of columns */
-       unsigned short v_vlin;  /* number of pixel rows on screen */
-       unsigned short v_clin;  /* number of pixel rows per character */
-       unsigned short v_vcol;  /* number of pixel columns on screen */
-       unsigned short v_ccol;  /* number of pixel columns per character */
-};
-#define VT_RESIZEX      0x560A  /* set kernel's idea of screensize + more */
-#define VT_LOCKSWITCH   0x560B  /* disallow vt switching */
-#define VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
-#define VT_GETHIFONTMASK 0x560D  /* return hi font mask */
-
-struct vt_event {
-       unsigned int event;
-#define VT_EVENT_SWITCH                0x0001  /* Console switch */
-#define VT_EVENT_BLANK         0x0002  /* Screen blank */
-#define VT_EVENT_UNBLANK       0x0004  /* Screen unblank */
-#define VT_EVENT_RESIZE                0x0008  /* Resize display */
-#define VT_MAX_EVENT           0x000F
-       unsigned int oldev;             /* Old console */
-       unsigned int newev;             /* New console (if changing) */
-       unsigned int pad[4];            /* Padding for expansion */
-};
-
-#define VT_WAITEVENT   0x560E  /* Wait for an event */
-
-struct vt_setactivate {
-       unsigned int console;
-       struct vt_mode mode;
-};
-
-#define VT_SETACTIVATE 0x560F  /* Activate and set the mode of a console */
-
-#ifdef __KERNEL__
 
 /* Virtual Terminal events. */
 #define VT_ALLOCATE            0x0001 /* Console got allocated */
@@ -106,8 +24,4 @@ static inline int vt_kmsg_redirect(int new)
 
 #endif
 
-#endif /* __KERNEL__ */
-
-#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
-
 #endif /* _LINUX_VT_H */
index 1dee81c41ff14578c840dcfdf8f449983937267a..168dfe122dd3816c86785a32ce642d3427c79593 100644 (file)
@@ -1,28 +1,12 @@
 #ifndef _LINUX_WAIT_H
 #define _LINUX_WAIT_H
 
-#define WNOHANG                0x00000001
-#define WUNTRACED      0x00000002
-#define WSTOPPED       WUNTRACED
-#define WEXITED                0x00000004
-#define WCONTINUED     0x00000008
-#define WNOWAIT                0x01000000      /* Don't reap, just poll status.  */
-
-#define __WNOTHREAD    0x20000000      /* Don't wait on children of other threads in this group */
-#define __WALL         0x40000000      /* Wait on all children, regardless of type */
-#define __WCLONE       0x80000000      /* Wait only on non-SIGCHLD children */
-
-/* First argument to waitid: */
-#define P_ALL          0
-#define P_PID          1
-#define P_PGID         2
-
-#ifdef __KERNEL__
 
 #include <linux/list.h>
 #include <linux/stddef.h>
 #include <linux/spinlock.h>
 #include <asm/current.h>
+#include <uapi/linux/wait.h>
 
 typedef struct __wait_queue wait_queue_t;
 typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
@@ -663,6 +647,4 @@ static inline int wait_on_bit_lock(void *word, int bit,
        return out_of_line_wait_on_bit_lock(word, bit, action, mode);
 }
        
-#endif /* __KERNEL__ */
-
 #endif
index 3157cc1fada66f3a986c8a52f762ea54667b6157..cec4b4159767d87bfac6fcb73ba08ac9703eb1fd 100644 (file)
 * Jan 16, 1997 Gene Kozin      router_devlist made public
 * Jan 02, 1997 Gene Kozin      Initial version (based on wanpipe.h).
 *****************************************************************************/
-
 #ifndef        _ROUTER_H
 #define        _ROUTER_H
 
-#define        ROUTER_NAME     "wanrouter"     /* in case we ever change it */
-#define        ROUTER_VERSION  1               /* version number */
-#define        ROUTER_RELEASE  1               /* release (minor version) number */
-#define        ROUTER_IOCTL    'W'             /* for IOCTL calls */
-#define        ROUTER_MAGIC    0x524D4157L     /* signature: 'WANR' reversed */
-
-/* IOCTL codes for /proc/router/<device> entries (up to 255) */
-enum router_ioctls
-{
-       ROUTER_SETUP    = ROUTER_IOCTL<<8,      /* configure device */
-       ROUTER_DOWN,                            /* shut down device */
-       ROUTER_STAT,                            /* get device status */
-       ROUTER_IFNEW,                           /* add interface */
-       ROUTER_IFDEL,                           /* delete interface */
-       ROUTER_IFSTAT,                          /* get interface status */
-       ROUTER_USER     = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
-       ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
-};
-
-/* identifiers for displaying proc file data for dual port adapters */
-#define PROC_DATA_PORT_0 0x8000        /* the data is for port 0 */
-#define PROC_DATA_PORT_1 0x8001        /* the data is for port 1 */
-
-/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
-#define        NLPID_IP        0xCC    /* Internet Protocol Datagram */
-#define        NLPID_SNAP      0x80    /* IEEE Subnetwork Access Protocol */
-#define        NLPID_CLNP      0x81    /* ISO/IEC 8473 */
-#define        NLPID_ESIS      0x82    /* ISO/IEC 9542 */
-#define        NLPID_ISIS      0x83    /* ISO/IEC ISIS */
-#define        NLPID_Q933      0x08    /* CCITT Q.933 */
-
-/* Miscellaneous */
-#define        WAN_IFNAME_SZ   15      /* max length of the interface name */
-#define        WAN_DRVNAME_SZ  15      /* max length of the link driver name */
-#define        WAN_ADDRESS_SZ  31      /* max length of the WAN media address */
-#define USED_BY_FIELD  8       /* max length of the used by field */
-
-/* Defines for UDP PACKET TYPE */
-#define UDP_PTPIPE_TYPE        0x01
-#define UDP_FPIPE_TYPE         0x02
-#define UDP_CPIPE_TYPE         0x03
-#define UDP_DRVSTATS_TYPE      0x04
-#define UDP_INVALID_TYPE       0x05
-
-/* Command return code */
-#define CMD_OK         0               /* normal firmware return code */
-#define CMD_TIMEOUT    0xFF            /* firmware command timed out */
-
-/* UDP Packet Management */
-#define UDP_PKT_FRM_STACK      0x00
-#define UDP_PKT_FRM_NETWORK    0x01
-
-/* Maximum interrupt test counter */
-#define MAX_INTR_TEST_COUNTER  100
-
-/* Critical Values for RACE conditions*/
-#define CRITICAL_IN_ISR                0xA1
-#define CRITICAL_INTR_HANDLED  0xB1
-
-/****** Data Types **********************************************************/
-
-/*----------------------------------------------------------------------------
- * X.25-specific link-level configuration.
- */
-typedef struct wan_x25_conf
-{
-       unsigned lo_pvc;        /* lowest permanent circuit number */
-       unsigned hi_pvc;        /* highest permanent circuit number */
-       unsigned lo_svc;        /* lowest switched circuit number */
-       unsigned hi_svc;        /* highest switched circuit number */
-       unsigned hdlc_window;   /* HDLC window size (1..7) */
-       unsigned pkt_window;    /* X.25 packet window size (1..7) */
-       unsigned t1;            /* HDLC timer T1, sec (1..30) */
-       unsigned t2;            /* HDLC timer T2, sec (0..29) */
-       unsigned t4;            /* HDLC supervisory frame timer = T4 * T1 */
-       unsigned n2;            /* HDLC retransmission limit (1..30) */
-       unsigned t10_t20;       /* X.25 RESTART timeout, sec (1..255) */
-       unsigned t11_t21;       /* X.25 CALL timeout, sec (1..255) */
-       unsigned t12_t22;       /* X.25 RESET timeout, sec (1..255) */
-       unsigned t13_t23;       /* X.25 CLEAR timeout, sec (1..255) */
-       unsigned t16_t26;       /* X.25 INTERRUPT timeout, sec (1..255) */
-       unsigned t28;           /* X.25 REGISTRATION timeout, sec (1..255) */
-       unsigned r10_r20;       /* RESTART retransmission limit (0..250) */
-       unsigned r12_r22;       /* RESET retransmission limit (0..250) */
-       unsigned r13_r23;       /* CLEAR retransmission limit (0..250) */
-       unsigned ccitt_compat;  /* compatibility mode: 1988/1984/1980 */
-       unsigned x25_conf_opt;   /* User defined x25 config optoins */
-       unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
-       unsigned char logging;   /* Control connection logging */  
-       unsigned char oob_on_modem; /* Whether to send modem status to the user app */
-} wan_x25_conf_t;
-
-/*----------------------------------------------------------------------------
- * Frame relay specific link-level configuration.
- */
-typedef struct wan_fr_conf
-{
-       unsigned signalling;    /* local in-channel signalling type */
-       unsigned t391;          /* link integrity verification timer */
-       unsigned t392;          /* polling verification timer */
-       unsigned n391;          /* full status polling cycle counter */
-       unsigned n392;          /* error threshold counter */
-       unsigned n393;          /* monitored events counter */
-       unsigned dlci_num;      /* number of DLCs (access node) */
-       unsigned  dlci[100];    /* List of all DLCIs */
-} wan_fr_conf_t;
-
-/*----------------------------------------------------------------------------
- * PPP-specific link-level configuration.
- */
-typedef struct wan_ppp_conf
-{
-       unsigned restart_tmr;   /* restart timer */
-       unsigned auth_rsrt_tmr; /* authentication timer */
-       unsigned auth_wait_tmr; /* authentication timer */
-       unsigned mdm_fail_tmr;  /* modem failure timer */
-       unsigned dtr_drop_tmr;  /* DTR drop timer */
-       unsigned connect_tmout; /* connection timeout */
-       unsigned conf_retry;    /* max. retry */
-       unsigned term_retry;    /* max. retry */
-       unsigned fail_retry;    /* max. retry */
-       unsigned auth_retry;    /* max. retry */
-       unsigned auth_options;  /* authentication opt. */
-       unsigned ip_options;    /* IP options */
-       char    authenticator;  /* AUTHENTICATOR or not */
-       char    ip_mode;        /* Static/Host/Peer */
-} wan_ppp_conf_t;
-
-/*----------------------------------------------------------------------------
- * CHDLC-specific link-level configuration.
- */
-typedef struct wan_chdlc_conf
-{
-       unsigned char ignore_dcd;       /* Protocol options:            */
-       unsigned char ignore_cts;       /*  Ignore these to determine   */
-       unsigned char ignore_keepalive; /*  link status (Yes or No)     */
-       unsigned char hdlc_streaming;   /*  hdlc_streaming mode (Y/N) */
-       unsigned char receive_only;     /*  no transmit buffering (Y/N) */
-       unsigned keepalive_tx_tmr;      /* transmit keepalive timer */
-       unsigned keepalive_rx_tmr;      /* receive  keepalive timer */
-       unsigned keepalive_err_margin;  /* keepalive_error_tolerance */
-       unsigned slarp_timer;           /* SLARP request timer */
-} wan_chdlc_conf_t;
-
-
-/*----------------------------------------------------------------------------
- * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
- */
-typedef struct wandev_conf
-{
-       unsigned magic;         /* magic number (for verification) */
-       unsigned config_id;     /* configuration structure identifier */
-                               /****** hardware configuration ******/
-       unsigned ioport;        /* adapter I/O port base */
-       unsigned long maddr;    /* dual-port memory address */
-       unsigned msize;         /* dual-port memory size */
-       int irq;                /* interrupt request level */
-       int dma;                /* DMA request level */
-        char S514_CPU_no[1];   /* S514 PCI adapter CPU number ('A' or 'B') */
-        unsigned PCI_slot_no;  /* S514 PCI adapter slot number */
-       char auto_pci_cfg;      /* S515 PCI automatic slot detection */
-       char comm_port;         /* Communication Port (PRI=0, SEC=1) */ 
-       unsigned bps;           /* data transfer rate */
-       unsigned mtu;           /* maximum transmit unit size */
-        unsigned udp_port;      /* UDP port for management */
-       unsigned char ttl;      /* Time To Live for UDP security */
-       unsigned char ft1;      /* FT1 Configurator Option */
-        char interface;                /* RS-232/V.35, etc. */
-       char clocking;          /* external/internal */
-       char line_coding;       /* NRZ/NRZI/FM0/FM1, etc. */
-       char station;           /* DTE/DCE, primary/secondary, etc. */
-       char connection;        /* permanent/switched/on-demand */
-       char read_mode;         /* read mode: Polling or interrupt */
-       char receive_only;      /* disable tx buffers */
-       char tty;               /* Create a fake tty device */
-       unsigned tty_major;     /* Major number for wanpipe tty device */
-       unsigned tty_minor;     /* Minor number for wanpipe tty device */
-       unsigned tty_mode;      /* TTY operation mode SYNC or ASYNC */
-       char backup;            /* Backup Mode */
-       unsigned hw_opt[4];     /* other hardware options */
-       unsigned reserved[4];
-                               /****** arbitrary data ***************/
-       unsigned data_size;     /* data buffer size */
-       void* data;             /* data buffer, e.g. firmware */
-       union                   /****** protocol-specific ************/
-       {
-               wan_x25_conf_t x25;     /* X.25 configuration */
-               wan_ppp_conf_t ppp;     /* PPP configuration */
-               wan_fr_conf_t fr;       /* frame relay configuration */
-               wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
-       } u;
-} wandev_conf_t;
-
-/* 'config_id' definitions */
-#define        WANCONFIG_X25   101     /* X.25 link */
-#define        WANCONFIG_FR    102     /* frame relay link */
-#define        WANCONFIG_PPP   103     /* synchronous PPP link */
-#define WANCONFIG_CHDLC        104     /* Cisco HDLC Link */
-#define WANCONFIG_BSC  105     /* BiSync Streaming */
-#define WANCONFIG_HDLC 106     /* HDLC Support */
-#define WANCONFIG_MPPP  107    /* Multi Port PPP over RAW CHDLC */
-
-/*
- * Configuration options defines.
- */
-/* general options */
-#define        WANOPT_OFF      0
-#define        WANOPT_ON       1
-#define        WANOPT_NO       0
-#define        WANOPT_YES      1
-
-/* intercace options */
-#define        WANOPT_RS232    0
-#define        WANOPT_V35      1
-
-/* data encoding options */
-#define        WANOPT_NRZ      0
-#define        WANOPT_NRZI     1
-#define        WANOPT_FM0      2
-#define        WANOPT_FM1      3
-
-/* link type options */
-#define        WANOPT_POINTTOPOINT     0       /* RTS always active */
-#define        WANOPT_MULTIDROP        1       /* RTS is active when transmitting */
-
-/* clocking options */
-#define        WANOPT_EXTERNAL 0
-#define        WANOPT_INTERNAL 1
-
-/* station options */
-#define        WANOPT_DTE              0
-#define        WANOPT_DCE              1
-#define        WANOPT_CPE              0
-#define        WANOPT_NODE             1
-#define        WANOPT_SECONDARY        0
-#define        WANOPT_PRIMARY          1
-
-/* connection options */
-#define        WANOPT_PERMANENT        0       /* DTR always active */
-#define        WANOPT_SWITCHED         1       /* use DTR to setup link (dial-up) */
-#define        WANOPT_ONDEMAND         2       /* activate DTR only before sending */
-
-/* frame relay in-channel signalling */
-#define        WANOPT_FR_ANSI          1       /* ANSI T1.617 Annex D */
-#define        WANOPT_FR_Q933          2       /* ITU Q.933A */
-#define        WANOPT_FR_LMI           3       /* LMI */
-
-/* PPP IP Mode Options */
-#define        WANOPT_PPP_STATIC       0
-#define        WANOPT_PPP_HOST         1
-#define        WANOPT_PPP_PEER         2
-
-/* ASY Mode Options */
-#define WANOPT_ONE             1
-#define WANOPT_TWO             2
-#define WANOPT_ONE_AND_HALF    3
-
-#define WANOPT_NONE    0
-#define WANOPT_ODD      1
-#define WANOPT_EVEN    2
-
-/* CHDLC Protocol Options */
-/* DF Commented out for now.
-
-#define WANOPT_CHDLC_NO_DCD            IGNORE_DCD_FOR_LINK_STAT
-#define WANOPT_CHDLC_NO_CTS            IGNORE_CTS_FOR_LINK_STAT
-#define WANOPT_CHDLC_NO_KEEPALIVE      IGNORE_KPALV_FOR_LINK_STAT
-*/
-
-/* Port options */
-#define WANOPT_PRI 0
-#define WANOPT_SEC 1
-/* read mode */
-#define        WANOPT_INTR     0
-#define WANOPT_POLL    1
-
-
-#define WANOPT_TTY_SYNC  0
-#define WANOPT_TTY_ASYNC 1
-/*----------------------------------------------------------------------------
- * WAN Link Status Info (for ROUTER_STAT IOCTL).
- */
-typedef struct wandev_stat
-{
-       unsigned state;         /* link state */
-       unsigned ndev;          /* number of configured interfaces */
-
-       /* link/interface configuration */
-       unsigned connection;    /* permanent/switched/on-demand */
-       unsigned media_type;    /* Frame relay/PPP/X.25/SDLC, etc. */
-       unsigned mtu;           /* max. transmit unit for this device */
-
-       /* physical level statistics */
-       unsigned modem_status;  /* modem status */
-       unsigned rx_frames;     /* received frames count */
-       unsigned rx_overruns;   /* receiver overrun error count */
-       unsigned rx_crc_err;    /* receive CRC error count */
-       unsigned rx_aborts;     /* received aborted frames count */
-       unsigned rx_bad_length; /* unexpetedly long/short frames count */
-       unsigned rx_dropped;    /* frames discarded at device level */
-       unsigned tx_frames;     /* transmitted frames count */
-       unsigned tx_underruns;  /* aborted transmissions (underruns) count */
-       unsigned tx_timeouts;   /* transmission timeouts */
-       unsigned tx_rejects;    /* other transmit errors */
-
-       /* media level statistics */
-       unsigned rx_bad_format; /* frames with invalid format */
-       unsigned rx_bad_addr;   /* frames with invalid media address */
-       unsigned tx_retries;    /* frames re-transmitted */
-       unsigned reserved[16];  /* reserved for future use */
-} wandev_stat_t;
-
-/* 'state' defines */
-enum wan_states
-{
-       WAN_UNCONFIGURED,       /* link/channel is not configured */
-       WAN_DISCONNECTED,       /* link/channel is disconnected */
-       WAN_CONNECTING,         /* connection is in progress */
-       WAN_CONNECTED,          /* link/channel is operational */
-       WAN_LIMIT,              /* for verification only */
-       WAN_DUALPORT,           /* for Dual Port cards */
-       WAN_DISCONNECTING,
-       WAN_FT1_READY           /* FT1 Configurator Ready */
-};
-
-enum {
-       WAN_LOCAL_IP,
-       WAN_POINTOPOINT_IP,
-       WAN_NETMASK_IP,
-       WAN_BROADCAST_IP
-};
-
-/* 'modem_status' masks */
-#define        WAN_MODEM_CTS   0x0001  /* CTS line active */
-#define        WAN_MODEM_DCD   0x0002  /* DCD line active */
-#define        WAN_MODEM_DTR   0x0010  /* DTR line active */
-#define        WAN_MODEM_RTS   0x0020  /* RTS line active */
-
-/*----------------------------------------------------------------------------
- * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
- */
-typedef struct wanif_conf
-{
-       unsigned magic;                 /* magic number */
-       unsigned config_id;             /* configuration identifier */
-       char name[WAN_IFNAME_SZ+1];     /* interface name, ASCIIZ */
-       char addr[WAN_ADDRESS_SZ+1];    /* media address, ASCIIZ */
-       char usedby[USED_BY_FIELD];     /* used by API or WANPIPE */
-       unsigned idle_timeout;          /* sec, before disconnecting */
-       unsigned hold_timeout;          /* sec, before re-connecting */
-       unsigned cir;                   /* Committed Information Rate fwd,bwd*/
-       unsigned bc;                    /* Committed Burst Size fwd, bwd */
-       unsigned be;                    /* Excess Burst Size fwd, bwd */ 
-       unsigned char enable_IPX;       /* Enable or Disable IPX */
-       unsigned char inarp;            /* Send Inverse ARP requests Y/N */
-       unsigned inarp_interval;        /* sec, between InARP requests */
-       unsigned long network_number;   /* Network Number for IPX */
-       char mc;                        /* Multicast on or off */
-       char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
-       unsigned char port;             /* board port */
-       unsigned char protocol;         /* prococol used in this channel (TCPOX25 or X25) */
-       char pap;                       /* PAP enabled or disabled */
-       char chap;                      /* CHAP enabled or disabled */
-       unsigned char userid[511];      /* List of User Id */
-       unsigned char passwd[511];      /* List of passwords */
-       unsigned char sysname[31];      /* Name of the system */
-       unsigned char ignore_dcd;       /* Protocol options: */
-       unsigned char ignore_cts;       /*  Ignore these to determine */
-       unsigned char ignore_keepalive; /*  link status (Yes or No) */
-       unsigned char hdlc_streaming;   /*  Hdlc streaming mode (Y/N) */
-       unsigned keepalive_tx_tmr;      /* transmit keepalive timer */
-       unsigned keepalive_rx_tmr;      /* receive  keepalive timer */
-       unsigned keepalive_err_margin;  /* keepalive_error_tolerance */
-       unsigned slarp_timer;           /* SLARP request timer */
-       unsigned char ttl;              /* Time To Live for UDP security */
-       char interface;                 /* RS-232/V.35, etc. */
-       char clocking;                  /* external/internal */
-       unsigned bps;                   /* data transfer rate */
-       unsigned mtu;                   /* maximum transmit unit size */
-       unsigned char if_down;          /* brind down interface when disconnected */
-       unsigned char gateway;          /* Is this interface a gateway */
-       unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
-
-       unsigned char asy_data_trans;     /* async API options */
-        unsigned char rts_hs_for_receive; /* async Protocol options */
-        unsigned char xon_xoff_hs_for_receive;
-       unsigned char xon_xoff_hs_for_transmit;
-       unsigned char dcd_hs_for_transmit;
-       unsigned char cts_hs_for_transmit;
-       unsigned char async_mode;
-       unsigned tx_bits_per_char;
-       unsigned rx_bits_per_char;
-       unsigned stop_bits;  
-       unsigned char parity;
-       unsigned break_timer;
-        unsigned inter_char_timer;
-       unsigned rx_complete_length;
-       unsigned xon_char;
-       unsigned xoff_char;
-       unsigned char receive_only;     /*  no transmit buffering (Y/N) */
-} wanif_conf_t;
+#include <uapi/linux/wanrouter.h>
 
-#ifdef __KERNEL__
 /****** Kernel Interface ****************************************************/
 
 #include <linux/fs.h>          /* support for device drivers */
@@ -528,5 +126,4 @@ extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long a
 /* list of registered devices */
 extern struct wan_device *wanrouter_router_devlist;
 
-#endif /* __KERNEL__ */
 #endif /* _ROUTER_H */
index da70f0facd2b77215e79860e5af8104da30b03a2..b7f45d48b2de6b4a81dcad34dd13ecc6e68443db 100644 (file)
@@ -5,59 +5,14 @@
  * by Ken Hollis <khollis@bitgate.com>
  *
  */
-
 #ifndef _LINUX_WATCHDOG_H
 #define _LINUX_WATCHDOG_H
 
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-#define        WATCHDOG_IOCTL_BASE     'W'
-
-struct watchdog_info {
-       __u32 options;          /* Options the card/driver supports */
-       __u32 firmware_version; /* Firmware version of the card */
-       __u8  identity[32];     /* Identity of the board */
-};
-
-#define        WDIOC_GETSUPPORT        _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
-#define        WDIOC_GETSTATUS         _IOR(WATCHDOG_IOCTL_BASE, 1, int)
-#define        WDIOC_GETBOOTSTATUS     _IOR(WATCHDOG_IOCTL_BASE, 2, int)
-#define        WDIOC_GETTEMP           _IOR(WATCHDOG_IOCTL_BASE, 3, int)
-#define        WDIOC_SETOPTIONS        _IOR(WATCHDOG_IOCTL_BASE, 4, int)
-#define        WDIOC_KEEPALIVE         _IOR(WATCHDOG_IOCTL_BASE, 5, int)
-#define        WDIOC_SETTIMEOUT        _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
-#define        WDIOC_GETTIMEOUT        _IOR(WATCHDOG_IOCTL_BASE, 7, int)
-#define        WDIOC_SETPRETIMEOUT     _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
-#define        WDIOC_GETPRETIMEOUT     _IOR(WATCHDOG_IOCTL_BASE, 9, int)
-#define        WDIOC_GETTIMELEFT       _IOR(WATCHDOG_IOCTL_BASE, 10, int)
-
-#define        WDIOF_UNKNOWN           -1      /* Unknown flag error */
-#define        WDIOS_UNKNOWN           -1      /* Unknown status error */
-
-#define        WDIOF_OVERHEAT          0x0001  /* Reset due to CPU overheat */
-#define        WDIOF_FANFAULT          0x0002  /* Fan failed */
-#define        WDIOF_EXTERN1           0x0004  /* External relay 1 */
-#define        WDIOF_EXTERN2           0x0008  /* External relay 2 */
-#define        WDIOF_POWERUNDER        0x0010  /* Power bad/power fault */
-#define        WDIOF_CARDRESET         0x0020  /* Card previously reset the CPU */
-#define        WDIOF_POWEROVER         0x0040  /* Power over voltage */
-#define        WDIOF_SETTIMEOUT        0x0080  /* Set timeout (in seconds) */
-#define        WDIOF_MAGICCLOSE        0x0100  /* Supports magic close char */
-#define        WDIOF_PRETIMEOUT        0x0200  /* Pretimeout (in seconds), get/set */
-#define        WDIOF_ALARMONLY         0x0400  /* Watchdog triggers a management or
-                                          other external alarm not a reboot */
-#define        WDIOF_KEEPALIVEPING     0x8000  /* Keep alive ping reply */
-
-#define        WDIOS_DISABLECARD       0x0001  /* Turn off the watchdog timer */
-#define        WDIOS_ENABLECARD        0x0002  /* Turn on the watchdog timer */
-#define        WDIOS_TEMPPANIC         0x0004  /* Kernel panic on temperature trip */
-
-#ifdef __KERNEL__
 
 #include <linux/bitops.h>
 #include <linux/device.h>
 #include <linux/cdev.h>
+#include <uapi/linux/watchdog.h>
 
 struct watchdog_ops;
 struct watchdog_device;
@@ -178,6 +133,4 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
 extern int watchdog_register_device(struct watchdog_device *);
 extern void watchdog_unregister_device(struct watchdog_device *);
 
-#endif /* __KERNEL__ */
-
 #endif  /* ifndef _LINUX_WATCHDOG_H */
index 4395b28bb86c3bc2db796c284eec108fb4baab4c..4ea4c6e2383d92237537ea93784dbdc104f26094 100644 (file)
  * Authors :   Jean Tourrilhes - HPL - <jt@hpl.hp.com>
  * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
  */
-
 #ifndef _LINUX_WIRELESS_H
 #define _LINUX_WIRELESS_H
 
-/************************** DOCUMENTATION **************************/
-/*
- * Initial APIs (1996 -> onward) :
- * -----------------------------
- * Basically, the wireless extensions are for now a set of standard ioctl
- * call + /proc/net/wireless
- *
- * The entry /proc/net/wireless give statistics and information on the
- * driver.
- * This is better than having each driver having its entry because
- * its centralised and we may remove the driver module safely.
- *
- * Ioctl are used to configure the driver and issue commands.  This is
- * better than command line options of insmod because we may want to
- * change dynamically (while the driver is running) some parameters.
- *
- * The ioctl mechanimsm are copied from standard devices ioctl.
- * We have the list of command plus a structure descibing the
- * data exchanged...
- * Note that to add these ioctl, I was obliged to modify :
- *     # net/core/dev.c (two place + add include)
- *     # net/ipv4/af_inet.c (one place + add include)
- *
- * /proc/net/wireless is a copy of /proc/net/dev.
- * We have a structure for data passed from the driver to /proc/net/wireless
- * Too add this, I've modified :
- *     # net/core/dev.c (two other places)
- *     # include/linux/netdevice.h (one place)
- *     # include/linux/proc_fs.h (one place)
- *
- * New driver API (2002 -> onward) :
- * -------------------------------
- * This file is only concerned with the user space API and common definitions.
- * The new driver API is defined and documented in :
- *     # include/net/iw_handler.h
- *
- * Note as well that /proc/net/wireless implementation has now moved in :
- *     # net/core/wireless.c
- *
- * Wireless Events (2002 -> onward) :
- * --------------------------------
- * Events are defined at the end of this file, and implemented in :
- *     # net/core/wireless.c
- *
- * Other comments :
- * --------------
- * Do not add here things that are redundant with other mechanisms
- * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
- * wireless specific.
- *
- * These wireless extensions are not magic : each driver has to provide
- * support for them...
- *
- * IMPORTANT NOTE : As everything in the kernel, this is very much a
- * work in progress. Contact me if you have ideas of improvements...
- */
-
-/***************************** INCLUDES *****************************/
-
-#include <linux/types.h>               /* for __u* and __s* typedefs */
-#include <linux/socket.h>              /* for "struct sockaddr" et al  */
-#include <linux/if.h>                  /* for IFNAMSIZ and co... */
-
-/***************************** VERSION *****************************/
-/*
- * This constant is used to know the availability of the wireless
- * extensions and to know which version of wireless extensions it is
- * (there is some stuff that will be added in the future...)
- * I just plan to increment with each new version.
- */
-#define WIRELESS_EXT   22
-
-/*
- * Changes :
- *
- * V2 to V3
- * --------
- *     Alan Cox start some incompatibles changes. I've integrated a bit more.
- *     - Encryption renamed to Encode to avoid US regulation problems
- *     - Frequency changed from float to struct to avoid problems on old 386
- *
- * V3 to V4
- * --------
- *     - Add sensitivity
- *
- * V4 to V5
- * --------
- *     - Missing encoding definitions in range
- *     - Access points stuff
- *
- * V5 to V6
- * --------
- *     - 802.11 support (ESSID ioctls)
- *
- * V6 to V7
- * --------
- *     - define IW_ESSID_MAX_SIZE and IW_MAX_AP
- *
- * V7 to V8
- * --------
- *     - Changed my e-mail address
- *     - More 802.11 support (nickname, rate, rts, frag)
- *     - List index in frequencies
- *
- * V8 to V9
- * --------
- *     - Support for 'mode of operation' (ad-hoc, managed...)
- *     - Support for unicast and multicast power saving
- *     - Change encoding to support larger tokens (>64 bits)
- *     - Updated iw_params (disable, flags) and use it for NWID
- *     - Extracted iw_point from iwreq for clarity
- *
- * V9 to V10
- * ---------
- *     - Add PM capability to range structure
- *     - Add PM modifier : MAX/MIN/RELATIVE
- *     - Add encoding option : IW_ENCODE_NOKEY
- *     - Add TxPower ioctls (work like TxRate)
- *
- * V10 to V11
- * ----------
- *     - Add WE version in range (help backward/forward compatibility)
- *     - Add retry ioctls (work like PM)
- *
- * V11 to V12
- * ----------
- *     - Add SIOCSIWSTATS to get /proc/net/wireless programatically
- *     - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
- *     - Add new statistics (frag, retry, beacon)
- *     - Add average quality (for user space calibration)
- *
- * V12 to V13
- * ----------
- *     - Document creation of new driver API.
- *     - Extract union iwreq_data from struct iwreq (for new driver API).
- *     - Rename SIOCSIWNAME as SIOCSIWCOMMIT
- *
- * V13 to V14
- * ----------
- *     - Wireless Events support : define struct iw_event
- *     - Define additional specific event numbers
- *     - Add "addr" and "param" fields in union iwreq_data
- *     - AP scanning stuff (SIOCSIWSCAN and friends)
- *
- * V14 to V15
- * ----------
- *     - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
- *     - Make struct iw_freq signed (both m & e), add explicit padding
- *     - Add IWEVCUSTOM for driver specific event/scanning token
- *     - Add IW_MAX_GET_SPY for driver returning a lot of addresses
- *     - Add IW_TXPOW_RANGE for range of Tx Powers
- *     - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
- *     - Add IW_MODE_MONITOR for passive monitor
- *
- * V15 to V16
- * ----------
- *     - Increase the number of bitrates in iw_range to 32 (for 802.11g)
- *     - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
- *     - Reshuffle struct iw_range for increases, add filler
- *     - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
- *     - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
- *     - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
- *     - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
- *
- * V16 to V17
- * ----------
- *     - Add flags to frequency -> auto/fixed
- *     - Document (struct iw_quality *)->updated, add new flags (INVALID)
- *     - Wireless Event capability in struct iw_range
- *     - Add support for relative TxPower (yick !)
- *
- * V17 to V18 (From Jouni Malinen <j@w1.fi>)
- * ----------
- *     - Add support for WPA/WPA2
- *     - Add extended encoding configuration (SIOCSIWENCODEEXT and
- *       SIOCGIWENCODEEXT)
- *     - Add SIOCSIWGENIE/SIOCGIWGENIE
- *     - Add SIOCSIWMLME
- *     - Add SIOCSIWPMKSA
- *     - Add struct iw_range bit field for supported encoding capabilities
- *     - Add optional scan request parameters for SIOCSIWSCAN
- *     - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
- *       related parameters (extensible up to 4096 parameter values)
- *     - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
- *       IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
- *
- * V18 to V19
- * ----------
- *     - Remove (struct iw_point *)->pointer from events and streams
- *     - Remove header includes to help user space
- *     - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
- *     - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
- *     - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
- *     - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
- *
- * V19 to V20
- * ----------
- *     - RtNetlink requests support (SET/GET)
- *
- * V20 to V21
- * ----------
- *     - Remove (struct net_device *)->get_wireless_stats()
- *     - Change length in ESSID and NICK to strlen() instead of strlen()+1
- *     - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
- *     - Power/Retry relative values no longer * 100000
- *     - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
- *
- * V21 to V22
- * ----------
- *     - Prevent leaking of kernel space in stream on 64 bits.
- */
-
-/**************************** CONSTANTS ****************************/
-
-/* -------------------------- IOCTL LIST -------------------------- */
-
-/* Wireless Identification */
-#define SIOCSIWCOMMIT  0x8B00          /* Commit pending changes to driver */
-#define SIOCGIWNAME    0x8B01          /* get name == wireless protocol */
-/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
- * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
- * Don't put the name of your driver there, it's useless. */
-
-/* Basic operations */
-#define SIOCSIWNWID    0x8B02          /* set network id (pre-802.11) */
-#define SIOCGIWNWID    0x8B03          /* get network id (the cell) */
-#define SIOCSIWFREQ    0x8B04          /* set channel/frequency (Hz) */
-#define SIOCGIWFREQ    0x8B05          /* get channel/frequency (Hz) */
-#define SIOCSIWMODE    0x8B06          /* set operation mode */
-#define SIOCGIWMODE    0x8B07          /* get operation mode */
-#define SIOCSIWSENS    0x8B08          /* set sensitivity (dBm) */
-#define SIOCGIWSENS    0x8B09          /* get sensitivity (dBm) */
-
-/* Informative stuff */
-#define SIOCSIWRANGE   0x8B0A          /* Unused */
-#define SIOCGIWRANGE   0x8B0B          /* Get range of parameters */
-#define SIOCSIWPRIV    0x8B0C          /* Unused */
-#define SIOCGIWPRIV    0x8B0D          /* get private ioctl interface info */
-#define SIOCSIWSTATS   0x8B0E          /* Unused */
-#define SIOCGIWSTATS   0x8B0F          /* Get /proc/net/wireless stats */
-/* SIOCGIWSTATS is strictly used between user space and the kernel, and
- * is never passed to the driver (i.e. the driver will never see it). */
-
-/* Spy support (statistics per MAC address - used for Mobile IP support) */
-#define SIOCSIWSPY     0x8B10          /* set spy addresses */
-#define SIOCGIWSPY     0x8B11          /* get spy info (quality of link) */
-#define SIOCSIWTHRSPY  0x8B12          /* set spy threshold (spy event) */
-#define SIOCGIWTHRSPY  0x8B13          /* get spy threshold */
-
-/* Access Point manipulation */
-#define SIOCSIWAP      0x8B14          /* set access point MAC addresses */
-#define SIOCGIWAP      0x8B15          /* get access point MAC addresses */
-#define SIOCGIWAPLIST  0x8B17          /* Deprecated in favor of scanning */
-#define SIOCSIWSCAN    0x8B18          /* trigger scanning (list cells) */
-#define SIOCGIWSCAN    0x8B19          /* get scanning results */
-
-/* 802.11 specific support */
-#define SIOCSIWESSID   0x8B1A          /* set ESSID (network name) */
-#define SIOCGIWESSID   0x8B1B          /* get ESSID */
-#define SIOCSIWNICKN   0x8B1C          /* set node name/nickname */
-#define SIOCGIWNICKN   0x8B1D          /* get node name/nickname */
-/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
- * within the 'iwreq' structure, so we need to use the 'data' member to
- * point to a string in user space, like it is done for RANGE... */
-
-/* Other parameters useful in 802.11 and some other devices */
-#define SIOCSIWRATE    0x8B20          /* set default bit rate (bps) */
-#define SIOCGIWRATE    0x8B21          /* get default bit rate (bps) */
-#define SIOCSIWRTS     0x8B22          /* set RTS/CTS threshold (bytes) */
-#define SIOCGIWRTS     0x8B23          /* get RTS/CTS threshold (bytes) */
-#define SIOCSIWFRAG    0x8B24          /* set fragmentation thr (bytes) */
-#define SIOCGIWFRAG    0x8B25          /* get fragmentation thr (bytes) */
-#define SIOCSIWTXPOW   0x8B26          /* set transmit power (dBm) */
-#define SIOCGIWTXPOW   0x8B27          /* get transmit power (dBm) */
-#define SIOCSIWRETRY   0x8B28          /* set retry limits and lifetime */
-#define SIOCGIWRETRY   0x8B29          /* get retry limits and lifetime */
-
-/* Encoding stuff (scrambling, hardware security, WEP...) */
-#define SIOCSIWENCODE  0x8B2A          /* set encoding token & mode */
-#define SIOCGIWENCODE  0x8B2B          /* get encoding token & mode */
-/* Power saving stuff (power management, unicast and multicast) */
-#define SIOCSIWPOWER   0x8B2C          /* set Power Management settings */
-#define SIOCGIWPOWER   0x8B2D          /* get Power Management settings */
-
-/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
- * This ioctl uses struct iw_point and data buffer that includes IE id and len
- * fields. More than one IE may be included in the request. Setting the generic
- * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
- * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
- * are required to report the used IE as a wireless event, e.g., when
- * associating with an AP. */
-#define SIOCSIWGENIE   0x8B30          /* set generic IE */
-#define SIOCGIWGENIE   0x8B31          /* get generic IE */
-
-/* WPA : IEEE 802.11 MLME requests */
-#define SIOCSIWMLME    0x8B16          /* request MLME operation; uses
-                                        * struct iw_mlme */
-/* WPA : Authentication mode parameters */
-#define SIOCSIWAUTH    0x8B32          /* set authentication mode params */
-#define SIOCGIWAUTH    0x8B33          /* get authentication mode params */
-
-/* WPA : Extended version of encoding configuration */
-#define SIOCSIWENCODEEXT 0x8B34                /* set encoding token & mode */
-#define SIOCGIWENCODEEXT 0x8B35                /* get encoding token & mode */
-
-/* WPA2 : PMKSA cache management */
-#define SIOCSIWPMKSA   0x8B36          /* PMKSA cache operation */
-
-/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
-
-/* These 32 ioctl are wireless device private, for 16 commands.
- * Each driver is free to use them for whatever purpose it chooses,
- * however the driver *must* export the description of those ioctls
- * with SIOCGIWPRIV and *must* use arguments as defined below.
- * If you don't follow those rules, DaveM is going to hate you (reason :
- * it make mixed 32/64bit operation impossible).
- */
-#define SIOCIWFIRSTPRIV        0x8BE0
-#define SIOCIWLASTPRIV 0x8BFF
-/* Previously, we were using SIOCDEVPRIVATE, but we now have our
- * separate range because of collisions with other tools such as
- * 'mii-tool'.
- * We now have 32 commands, so a bit more space ;-).
- * Also, all 'even' commands are only usable by root and don't return the
- * content of ifr/iwr to user (but you are not obliged to use the set/get
- * convention, just use every other two command). More details in iwpriv.c.
- * And I repeat : you are not forced to use them with iwpriv, but you
- * must be compliant with it.
- */
-
-/* ------------------------- IOCTL STUFF ------------------------- */
-
-/* The first and the last (range) */
-#define SIOCIWFIRST    0x8B00
-#define SIOCIWLAST     SIOCIWLASTPRIV          /* 0x8BFF */
-#define IW_IOCTL_IDX(cmd)      ((cmd) - SIOCIWFIRST)
-#define IW_HANDLER(id, func)                   \
-       [IW_IOCTL_IDX(id)] = func
-
-/* Odd : get (world access), even : set (root access) */
-#define IW_IS_SET(cmd) (!((cmd) & 0x1))
-#define IW_IS_GET(cmd) ((cmd) & 0x1)
-
-/* ----------------------- WIRELESS EVENTS ----------------------- */
-/* Those are *NOT* ioctls, do not issue request on them !!! */
-/* Most events use the same identifier as ioctl requests */
-
-#define IWEVTXDROP     0x8C00          /* Packet dropped to excessive retry */
-#define IWEVQUAL       0x8C01          /* Quality part of statistics (scan) */
-#define IWEVCUSTOM     0x8C02          /* Driver specific ascii string */
-#define IWEVREGISTERED 0x8C03          /* Discovered a new node (AP mode) */
-#define IWEVEXPIRED    0x8C04          /* Expired a node (AP mode) */
-#define IWEVGENIE      0x8C05          /* Generic IE (WPA, RSN, WMM, ..)
-                                        * (scan results); This includes id and
-                                        * length fields. One IWEVGENIE may
-                                        * contain more than one IE. Scan
-                                        * results may contain one or more
-                                        * IWEVGENIE events. */
-#define IWEVMICHAELMICFAILURE 0x8C06   /* Michael MIC failure
-                                        * (struct iw_michaelmicfailure)
-                                        */
-#define IWEVASSOCREQIE 0x8C07          /* IEs used in (Re)Association Request.
-                                        * The data includes id and length
-                                        * fields and may contain more than one
-                                        * IE. This event is required in
-                                        * Managed mode if the driver
-                                        * generates its own WPA/RSN IE. This
-                                        * should be sent just before
-                                        * IWEVREGISTERED event for the
-                                        * association. */
-#define IWEVASSOCRESPIE        0x8C08          /* IEs used in (Re)Association
-                                        * Response. The data includes id and
-                                        * length fields and may contain more
-                                        * than one IE. This may be sent
-                                        * between IWEVASSOCREQIE and
-                                        * IWEVREGISTERED events for the
-                                        * association. */
-#define IWEVPMKIDCAND  0x8C09          /* PMKID candidate for RSN
-                                        * pre-authentication
-                                        * (struct iw_pmkid_cand) */
-
-#define IWEVFIRST      0x8C00
-#define IW_EVENT_IDX(cmd)      ((cmd) - IWEVFIRST)
-
-/* ------------------------- PRIVATE INFO ------------------------- */
-/*
- * The following is used with SIOCGIWPRIV. It allow a driver to define
- * the interface (name, type of data) for its private ioctl.
- * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
- */
-
-#define IW_PRIV_TYPE_MASK      0x7000  /* Type of arguments */
-#define IW_PRIV_TYPE_NONE      0x0000
-#define IW_PRIV_TYPE_BYTE      0x1000  /* Char as number */
-#define IW_PRIV_TYPE_CHAR      0x2000  /* Char as character */
-#define IW_PRIV_TYPE_INT       0x4000  /* 32 bits int */
-#define IW_PRIV_TYPE_FLOAT     0x5000  /* struct iw_freq */
-#define IW_PRIV_TYPE_ADDR      0x6000  /* struct sockaddr */
-
-#define IW_PRIV_SIZE_FIXED     0x0800  /* Variable or fixed number of args */
-
-#define IW_PRIV_SIZE_MASK      0x07FF  /* Max number of those args */
-
-/*
- * Note : if the number of args is fixed and the size < 16 octets,
- * instead of passing a pointer we will put args in the iwreq struct...
- */
-
-/* ----------------------- OTHER CONSTANTS ----------------------- */
-
-/* Maximum frequencies in the range struct */
-#define IW_MAX_FREQUENCIES     32
-/* Note : if you have something like 80 frequencies,
- * don't increase this constant and don't fill the frequency list.
- * The user will be able to set by channel anyway... */
-
-/* Maximum bit rates in the range struct */
-#define IW_MAX_BITRATES                32
-
-/* Maximum tx powers in the range struct */
-#define IW_MAX_TXPOWER         8
-/* Note : if you more than 8 TXPowers, just set the max and min or
- * a few of them in the struct iw_range. */
-
-/* Maximum of address that you may set with SPY */
-#define IW_MAX_SPY             8
-
-/* Maximum of address that you may get in the
-   list of access points in range */
-#define IW_MAX_AP              64
-
-/* Maximum size of the ESSID and NICKN strings */
-#define IW_ESSID_MAX_SIZE      32
-
-/* Modes of operation */
-#define IW_MODE_AUTO   0       /* Let the driver decides */
-#define IW_MODE_ADHOC  1       /* Single cell network */
-#define IW_MODE_INFRA  2       /* Multi cell network, roaming, ... */
-#define IW_MODE_MASTER 3       /* Synchronisation master or Access Point */
-#define IW_MODE_REPEAT 4       /* Wireless Repeater (forwarder) */
-#define IW_MODE_SECOND 5       /* Secondary master/repeater (backup) */
-#define IW_MODE_MONITOR        6       /* Passive monitor (listen only) */
-#define IW_MODE_MESH   7       /* Mesh (IEEE 802.11s) network */
-
-/* Statistics flags (bitmask in updated) */
-#define IW_QUAL_QUAL_UPDATED   0x01    /* Value was updated since last read */
-#define IW_QUAL_LEVEL_UPDATED  0x02
-#define IW_QUAL_NOISE_UPDATED  0x04
-#define IW_QUAL_ALL_UPDATED    0x07
-#define IW_QUAL_DBM            0x08    /* Level + Noise are dBm */
-#define IW_QUAL_QUAL_INVALID   0x10    /* Driver doesn't provide value */
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_RCPI           0x80    /* Level + Noise are 802.11k RCPI */
-#define IW_QUAL_ALL_INVALID    0x70
-
-/* Frequency flags */
-#define IW_FREQ_AUTO           0x00    /* Let the driver decides */
-#define IW_FREQ_FIXED          0x01    /* Force a specific value */
-
-/* Maximum number of size of encoding token available
- * they are listed in the range structure */
-#define IW_MAX_ENCODING_SIZES  8
-
-/* Maximum size of the encoding token in bytes */
-#define IW_ENCODING_TOKEN_MAX  64      /* 512 bits (for now) */
-
-/* Flags for encoding (along with the token) */
-#define IW_ENCODE_INDEX                0x00FF  /* Token index (if needed) */
-#define IW_ENCODE_FLAGS                0xFF00  /* Flags defined below */
-#define IW_ENCODE_MODE         0xF000  /* Modes defined below */
-#define IW_ENCODE_DISABLED     0x8000  /* Encoding disabled */
-#define IW_ENCODE_ENABLED      0x0000  /* Encoding enabled */
-#define IW_ENCODE_RESTRICTED   0x4000  /* Refuse non-encoded packets */
-#define IW_ENCODE_OPEN         0x2000  /* Accept non-encoded packets */
-#define IW_ENCODE_NOKEY                0x0800  /* Key is write only, so not present */
-#define IW_ENCODE_TEMP         0x0400  /* Temporary key */
-
-/* Power management flags available (along with the value, if any) */
-#define IW_POWER_ON            0x0000  /* No details... */
-#define IW_POWER_TYPE          0xF000  /* Type of parameter */
-#define IW_POWER_PERIOD                0x1000  /* Value is a period/duration of  */
-#define IW_POWER_TIMEOUT       0x2000  /* Value is a timeout (to go asleep) */
-#define IW_POWER_MODE          0x0F00  /* Power Management mode */
-#define IW_POWER_UNICAST_R     0x0100  /* Receive only unicast messages */
-#define IW_POWER_MULTICAST_R   0x0200  /* Receive only multicast messages */
-#define IW_POWER_ALL_R         0x0300  /* Receive all messages though PM */
-#define IW_POWER_FORCE_S       0x0400  /* Force PM procedure for sending unicast */
-#define IW_POWER_REPEATER      0x0800  /* Repeat broadcast messages in PM period */
-#define IW_POWER_MODIFIER      0x000F  /* Modify a parameter */
-#define IW_POWER_MIN           0x0001  /* Value is a minimum  */
-#define IW_POWER_MAX           0x0002  /* Value is a maximum */
-#define IW_POWER_RELATIVE      0x0004  /* Value is not in seconds/ms/us */
-
-/* Transmit Power flags available */
-#define IW_TXPOW_TYPE          0x00FF  /* Type of value */
-#define IW_TXPOW_DBM           0x0000  /* Value is in dBm */
-#define IW_TXPOW_MWATT         0x0001  /* Value is in mW */
-#define IW_TXPOW_RELATIVE      0x0002  /* Value is in arbitrary units */
-#define IW_TXPOW_RANGE         0x1000  /* Range of value between min/max */
-
-/* Retry limits and lifetime flags available */
-#define IW_RETRY_ON            0x0000  /* No details... */
-#define IW_RETRY_TYPE          0xF000  /* Type of parameter */
-#define IW_RETRY_LIMIT         0x1000  /* Maximum number of retries*/
-#define IW_RETRY_LIFETIME      0x2000  /* Maximum duration of retries in us */
-#define IW_RETRY_MODIFIER      0x00FF  /* Modify a parameter */
-#define IW_RETRY_MIN           0x0001  /* Value is a minimum  */
-#define IW_RETRY_MAX           0x0002  /* Value is a maximum */
-#define IW_RETRY_RELATIVE      0x0004  /* Value is not in seconds/ms/us */
-#define IW_RETRY_SHORT         0x0010  /* Value is for short packets  */
-#define IW_RETRY_LONG          0x0020  /* Value is for long packets */
-
-/* Scanning request flags */
-#define IW_SCAN_DEFAULT                0x0000  /* Default scan of the driver */
-#define IW_SCAN_ALL_ESSID      0x0001  /* Scan all ESSIDs */
-#define IW_SCAN_THIS_ESSID     0x0002  /* Scan only this ESSID */
-#define IW_SCAN_ALL_FREQ       0x0004  /* Scan all Frequencies */
-#define IW_SCAN_THIS_FREQ      0x0008  /* Scan only this Frequency */
-#define IW_SCAN_ALL_MODE       0x0010  /* Scan all Modes */
-#define IW_SCAN_THIS_MODE      0x0020  /* Scan only this Mode */
-#define IW_SCAN_ALL_RATE       0x0040  /* Scan all Bit-Rates */
-#define IW_SCAN_THIS_RATE      0x0080  /* Scan only this Bit-Rate */
-/* struct iw_scan_req scan_type */
-#define IW_SCAN_TYPE_ACTIVE 0
-#define IW_SCAN_TYPE_PASSIVE 1
-/* Maximum size of returned data */
-#define IW_SCAN_MAX_DATA       4096    /* In bytes */
-
-/* Scan capability flags - in (struct iw_range *)->scan_capa */
-#define IW_SCAN_CAPA_NONE              0x00
-#define IW_SCAN_CAPA_ESSID             0x01
-#define IW_SCAN_CAPA_BSSID             0x02
-#define IW_SCAN_CAPA_CHANNEL   0x04
-#define IW_SCAN_CAPA_MODE              0x08
-#define IW_SCAN_CAPA_RATE              0x10
-#define IW_SCAN_CAPA_TYPE              0x20
-#define IW_SCAN_CAPA_TIME              0x40
-
-/* Max number of char in custom event - use multiple of them if needed */
-#define IW_CUSTOM_MAX          256     /* In bytes */
-
-/* Generic information element */
-#define IW_GENERIC_IE_MAX      1024
-
-/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
-#define IW_MLME_DEAUTH         0
-#define IW_MLME_DISASSOC       1
-#define IW_MLME_AUTH           2
-#define IW_MLME_ASSOC          3
-
-/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
-#define IW_AUTH_INDEX          0x0FFF
-#define IW_AUTH_FLAGS          0xF000
-/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
- * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
- * parameter that is being set/get to; value will be read/written to
- * struct iw_param value field) */
-#define IW_AUTH_WPA_VERSION            0
-#define IW_AUTH_CIPHER_PAIRWISE                1
-#define IW_AUTH_CIPHER_GROUP           2
-#define IW_AUTH_KEY_MGMT               3
-#define IW_AUTH_TKIP_COUNTERMEASURES   4
-#define IW_AUTH_DROP_UNENCRYPTED       5
-#define IW_AUTH_80211_AUTH_ALG         6
-#define IW_AUTH_WPA_ENABLED            7
-#define IW_AUTH_RX_UNENCRYPTED_EAPOL   8
-#define IW_AUTH_ROAMING_CONTROL                9
-#define IW_AUTH_PRIVACY_INVOKED                10
-#define IW_AUTH_CIPHER_GROUP_MGMT      11
-#define IW_AUTH_MFP                    12
-
-/* IW_AUTH_WPA_VERSION values (bit field) */
-#define IW_AUTH_WPA_VERSION_DISABLED   0x00000001
-#define IW_AUTH_WPA_VERSION_WPA                0x00000002
-#define IW_AUTH_WPA_VERSION_WPA2       0x00000004
-
-/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
- * values (bit field) */
-#define IW_AUTH_CIPHER_NONE    0x00000001
-#define IW_AUTH_CIPHER_WEP40   0x00000002
-#define IW_AUTH_CIPHER_TKIP    0x00000004
-#define IW_AUTH_CIPHER_CCMP    0x00000008
-#define IW_AUTH_CIPHER_WEP104  0x00000010
-#define IW_AUTH_CIPHER_AES_CMAC        0x00000020
-
-/* IW_AUTH_KEY_MGMT values (bit field) */
-#define IW_AUTH_KEY_MGMT_802_1X        1
-#define IW_AUTH_KEY_MGMT_PSK   2
-
-/* IW_AUTH_80211_AUTH_ALG values (bit field) */
-#define IW_AUTH_ALG_OPEN_SYSTEM        0x00000001
-#define IW_AUTH_ALG_SHARED_KEY 0x00000002
-#define IW_AUTH_ALG_LEAP       0x00000004
-
-/* IW_AUTH_ROAMING_CONTROL values */
-#define IW_AUTH_ROAMING_ENABLE 0       /* driver/firmware based roaming */
-#define IW_AUTH_ROAMING_DISABLE        1       /* user space program used for roaming
-                                        * control */
-
-/* IW_AUTH_MFP (management frame protection) values */
-#define IW_AUTH_MFP_DISABLED   0       /* MFP disabled */
-#define IW_AUTH_MFP_OPTIONAL   1       /* MFP optional */
-#define IW_AUTH_MFP_REQUIRED   2       /* MFP required */
-
-/* SIOCSIWENCODEEXT definitions */
-#define IW_ENCODE_SEQ_MAX_SIZE 8
-/* struct iw_encode_ext ->alg */
-#define IW_ENCODE_ALG_NONE     0
-#define IW_ENCODE_ALG_WEP      1
-#define IW_ENCODE_ALG_TKIP     2
-#define IW_ENCODE_ALG_CCMP     3
-#define IW_ENCODE_ALG_PMK      4
-#define IW_ENCODE_ALG_AES_CMAC 5
-/* struct iw_encode_ext ->ext_flags */
-#define IW_ENCODE_EXT_TX_SEQ_VALID     0x00000001
-#define IW_ENCODE_EXT_RX_SEQ_VALID     0x00000002
-#define IW_ENCODE_EXT_GROUP_KEY                0x00000004
-#define IW_ENCODE_EXT_SET_TX_KEY       0x00000008
-
-/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
-#define IW_MICFAILURE_KEY_ID   0x00000003 /* Key ID 0..3 */
-#define IW_MICFAILURE_GROUP    0x00000004
-#define IW_MICFAILURE_PAIRWISE 0x00000008
-#define IW_MICFAILURE_STAKEY   0x00000010
-#define IW_MICFAILURE_COUNT    0x00000060 /* 1 or 2 (0 = count not supported)
-                                           */
-
-/* Bit field values for enc_capa in struct iw_range */
-#define IW_ENC_CAPA_WPA                0x00000001
-#define IW_ENC_CAPA_WPA2       0x00000002
-#define IW_ENC_CAPA_CIPHER_TKIP        0x00000004
-#define IW_ENC_CAPA_CIPHER_CCMP        0x00000008
-#define IW_ENC_CAPA_4WAY_HANDSHAKE     0x00000010
-
-/* Event capability macros - in (struct iw_range *)->event_capa
- * Because we have more than 32 possible events, we use an array of
- * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
-#define IW_EVENT_CAPA_BASE(cmd)                ((cmd >= SIOCIWFIRSTPRIV) ? \
-                                        (cmd - SIOCIWFIRSTPRIV + 0x60) : \
-                                        (cmd - SIOCIWFIRST))
-#define IW_EVENT_CAPA_INDEX(cmd)       (IW_EVENT_CAPA_BASE(cmd) >> 5)
-#define IW_EVENT_CAPA_MASK(cmd)                (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
-/* Event capability constants - event autogenerated by the kernel
- * This list is valid for most 802.11 devices, customise as needed... */
-#define IW_EVENT_CAPA_K_0      (IW_EVENT_CAPA_MASK(0x8B04) | \
-                                IW_EVENT_CAPA_MASK(0x8B06) | \
-                                IW_EVENT_CAPA_MASK(0x8B1A))
-#define IW_EVENT_CAPA_K_1      (IW_EVENT_CAPA_MASK(0x8B2A))
-/* "Easy" macro to set events in iw_range (less efficient) */
-#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
-#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
-
-
-/****************************** TYPES ******************************/
-
-/* --------------------------- SUBTYPES --------------------------- */
-/*
- *     Generic format for most parameters that fit in an int
- */
-struct iw_param
-{
-  __s32                value;          /* The value of the parameter itself */
-  __u8         fixed;          /* Hardware should not use auto select */
-  __u8         disabled;       /* Disable the feature */
-  __u16                flags;          /* Various specifc flags (if any) */
-};
-
-/*
- *     For all data larger than 16 octets, we need to use a
- *     pointer to memory allocated in user space.
- */
-struct iw_point
-{
-  void __user  *pointer;       /* Pointer to the data  (in user space) */
-  __u16                length;         /* number of fields or size in bytes */
-  __u16                flags;          /* Optional params */
-};
+#include <uapi/linux/wireless.h>
 
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 
 #include <linux/compat.h>
@@ -700,432 +21,6 @@ struct compat_iw_point {
        __u16 flags;
 };
 #endif
-#endif
-
-/*
- *     A frequency
- *     For numbers lower than 10^9, we encode the number in 'm' and
- *     set 'e' to 0
- *     For number greater than 10^9, we divide it by the lowest power
- *     of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
- *     The power of 10 is in 'e', the result of the division is in 'm'.
- */
-struct iw_freq
-{
-       __s32           m;              /* Mantissa */
-       __s16           e;              /* Exponent */
-       __u8            i;              /* List index (when in range struct) */
-       __u8            flags;          /* Flags (fixed/auto) */
-};
-
-/*
- *     Quality of the link
- */
-struct iw_quality
-{
-       __u8            qual;           /* link quality (%retries, SNR,
-                                          %missed beacons or better...) */
-       __u8            level;          /* signal level (dBm) */
-       __u8            noise;          /* noise level (dBm) */
-       __u8            updated;        /* Flags to know if updated */
-};
-
-/*
- *     Packet discarded in the wireless adapter due to
- *     "wireless" specific problems...
- *     Note : the list of counter and statistics in net_device_stats
- *     is already pretty exhaustive, and you should use that first.
- *     This is only additional stats...
- */
-struct iw_discarded
-{
-       __u32           nwid;           /* Rx : Wrong nwid/essid */
-       __u32           code;           /* Rx : Unable to code/decode (WEP) */
-       __u32           fragment;       /* Rx : Can't perform MAC reassembly */
-       __u32           retries;        /* Tx : Max MAC retries num reached */
-       __u32           misc;           /* Others cases */
-};
-
-/*
- *     Packet/Time period missed in the wireless adapter due to
- *     "wireless" specific problems...
- */
-struct iw_missed
-{
-       __u32           beacon;         /* Missed beacons/superframe */
-};
-
-/*
- *     Quality range (for spy threshold)
- */
-struct iw_thrspy
-{
-       struct sockaddr         addr;           /* Source address (hw/mac) */
-       struct iw_quality       qual;           /* Quality of the link */
-       struct iw_quality       low;            /* Low threshold */
-       struct iw_quality       high;           /* High threshold */
-};
-
-/*
- *     Optional data for scan request
- *
- *     Note: these optional parameters are controlling parameters for the
- *     scanning behavior, these do not apply to getting scan results
- *     (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
- *     provide a merged results with all BSSes even if the previous scan
- *     request limited scanning to a subset, e.g., by specifying an SSID.
- *     Especially, scan results are required to include an entry for the
- *     current BSS if the driver is in Managed mode and associated with an AP.
- */
-struct iw_scan_req
-{
-       __u8            scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
-       __u8            essid_len;
-       __u8            num_channels; /* num entries in channel_list;
-                                      * 0 = scan all allowed channels */
-       __u8            flags; /* reserved as padding; use zero, this may
-                               * be used in the future for adding flags
-                               * to request different scan behavior */
-       struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
-                               * individual address of a specific BSS */
-
-       /*
-        * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
-        * the current ESSID. This allows scan requests for specific ESSID
-        * without having to change the current ESSID and potentially breaking
-        * the current association.
-        */
-       __u8            essid[IW_ESSID_MAX_SIZE];
-
-       /*
-        * Optional parameters for changing the default scanning behavior.
-        * These are based on the MLME-SCAN.request from IEEE Std 802.11.
-        * TU is 1.024 ms. If these are set to 0, driver is expected to use
-        * reasonable default values. min_channel_time defines the time that
-        * will be used to wait for the first reply on each channel. If no
-        * replies are received, next channel will be scanned after this. If
-        * replies are received, total time waited on the channel is defined by
-        * max_channel_time.
-        */
-       __u32           min_channel_time; /* in TU */
-       __u32           max_channel_time; /* in TU */
-
-       struct iw_freq  channel_list[IW_MAX_FREQUENCIES];
-};
-
-/* ------------------------- WPA SUPPORT ------------------------- */
-
-/*
- *     Extended data structure for get/set encoding (this is used with
- *     SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
- *     flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
- *     only the data contents changes (key data -> this structure, including
- *     key data).
- *
- *     If the new key is the first group key, it will be set as the default
- *     TX key. Otherwise, default TX key index is only changed if
- *     IW_ENCODE_EXT_SET_TX_KEY flag is set.
- *
- *     Key will be changed with SIOCSIWENCODEEXT in all cases except for
- *     special "change TX key index" operation which is indicated by setting
- *     key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
- *
- *     tx_seq/rx_seq are only used when respective
- *     IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
- *     TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
- *     TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
- *     used only by an Authenticator (AP or an IBSS station) to get the
- *     current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
- *     RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
- *     debugging/testing.
- */
-struct iw_encode_ext
-{
-       __u32           ext_flags; /* IW_ENCODE_EXT_* */
-       __u8            tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
-       __u8            rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
-       struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
-                              * (group) keys or unicast address for
-                              * individual keys */
-       __u16           alg; /* IW_ENCODE_ALG_* */
-       __u16           key_len;
-       __u8            key[0];
-};
-
-/* SIOCSIWMLME data */
-struct iw_mlme
-{
-       __u16           cmd; /* IW_MLME_* */
-       __u16           reason_code;
-       struct sockaddr addr;
-};
-
-/* SIOCSIWPMKSA data */
-#define IW_PMKSA_ADD           1
-#define IW_PMKSA_REMOVE                2
-#define IW_PMKSA_FLUSH         3
-
-#define IW_PMKID_LEN   16
-
-struct iw_pmksa
-{
-       __u32           cmd; /* IW_PMKSA_* */
-       struct sockaddr bssid;
-       __u8            pmkid[IW_PMKID_LEN];
-};
-
-/* IWEVMICHAELMICFAILURE data */
-struct iw_michaelmicfailure
-{
-       __u32           flags;
-       struct sockaddr src_addr;
-       __u8            tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
-};
-
-/* IWEVPMKIDCAND data */
-#define IW_PMKID_CAND_PREAUTH  0x00000001 /* RNS pre-authentication enabled */
-struct iw_pmkid_cand
-{
-       __u32           flags; /* IW_PMKID_CAND_* */
-       __u32           index; /* the smaller the index, the higher the
-                               * priority */
-       struct sockaddr bssid;
-};
-
-/* ------------------------ WIRELESS STATS ------------------------ */
-/*
- * Wireless statistics (used for /proc/net/wireless)
- */
-struct iw_statistics
-{
-       __u16           status;         /* Status
-                                        * - device dependent for now */
-
-       struct iw_quality       qual;           /* Quality of the link
-                                                * (instant/mean/max) */
-       struct iw_discarded     discard;        /* Packet discarded counts */
-       struct iw_missed        miss;           /* Packet missed counts */
-};
-
-/* ------------------------ IOCTL REQUEST ------------------------ */
-/*
- * This structure defines the payload of an ioctl, and is used 
- * below.
- *
- * Note that this structure should fit on the memory footprint
- * of iwreq (which is the same as ifreq), which mean a max size of
- * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
- * You should check this when increasing the structures defined
- * above in this file...
- */
-union  iwreq_data
-{
-       /* Config - generic */
-       char            name[IFNAMSIZ];
-       /* Name : used to verify the presence of  wireless extensions.
-        * Name of the protocol/provider... */
-
-       struct iw_point essid;          /* Extended network name */
-       struct iw_param nwid;           /* network id (or domain - the cell) */
-       struct iw_freq  freq;           /* frequency or channel :
-                                        * 0-1000 = channel
-                                        * > 1000 = frequency in Hz */
-
-       struct iw_param sens;           /* signal level threshold */
-       struct iw_param bitrate;        /* default bit rate */
-       struct iw_param txpower;        /* default transmit power */
-       struct iw_param rts;            /* RTS threshold threshold */
-       struct iw_param frag;           /* Fragmentation threshold */
-       __u32           mode;           /* Operation mode */
-       struct iw_param retry;          /* Retry limits & lifetime */
-
-       struct iw_point encoding;       /* Encoding stuff : tokens */
-       struct iw_param power;          /* PM duration/timeout */
-       struct iw_quality qual;         /* Quality part of statistics */
-
-       struct sockaddr ap_addr;        /* Access point address */
-       struct sockaddr addr;           /* Destination address (hw/mac) */
-
-       struct iw_param param;          /* Other small parameters */
-       struct iw_point data;           /* Other large parameters */
-};
-
-/*
- * The structure to exchange data for ioctl.
- * This structure is the same as 'struct ifreq', but (re)defined for
- * convenience...
- * Do I need to remind you about structure size (32 octets) ?
- */
-struct iwreq 
-{
-       union
-       {
-               char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "eth0" */
-       } ifr_ifrn;
-
-       /* Data part (defined just above) */
-       union   iwreq_data      u;
-};
-
-/* -------------------------- IOCTL DATA -------------------------- */
-/*
- *     For those ioctl which want to exchange mode data that what could
- *     fit in the above structure...
- */
-
-/*
- *     Range of parameters
- */
-
-struct iw_range
-{
-       /* Informative stuff (to choose between different interface) */
-       __u32           throughput;     /* To give an idea... */
-       /* In theory this value should be the maximum benchmarked
-        * TCP/IP throughput, because with most of these devices the
-        * bit rate is meaningless (overhead an co) to estimate how
-        * fast the connection will go and pick the fastest one.
-        * I suggest people to play with Netperf or any benchmark...
-        */
-
-       /* NWID (or domain id) */
-       __u32           min_nwid;       /* Minimal NWID we are able to set */
-       __u32           max_nwid;       /* Maximal NWID we are able to set */
-
-       /* Old Frequency (backward compat - moved lower ) */
-       __u16           old_num_channels;
-       __u8            old_num_frequency;
-
-       /* Scan capabilities */
-       __u8            scan_capa;      /* IW_SCAN_CAPA_* bit field */
-
-       /* Wireless event capability bitmasks */
-       __u32           event_capa[6];
-
-       /* signal level threshold range */
-       __s32           sensitivity;
-
-       /* Quality of link & SNR stuff */
-       /* Quality range (link, level, noise)
-        * If the quality is absolute, it will be in the range [0 ; max_qual],
-        * if the quality is dBm, it will be in the range [max_qual ; 0].
-        * Don't forget that we use 8 bit arithmetics... */
-       struct iw_quality       max_qual;       /* Quality of the link */
-       /* This should contain the average/typical values of the quality
-        * indicator. This should be the threshold between a "good" and
-        * a "bad" link (example : monitor going from green to orange).
-        * Currently, user space apps like quality monitors don't have any
-        * way to calibrate the measurement. With this, they can split
-        * the range between 0 and max_qual in different quality level
-        * (using a geometric subdivision centered on the average).
-        * I expect that people doing the user space apps will feedback
-        * us on which value we need to put in each driver... */
-       struct iw_quality       avg_qual;       /* Quality of the link */
-
-       /* Rates */
-       __u8            num_bitrates;   /* Number of entries in the list */
-       __s32           bitrate[IW_MAX_BITRATES];       /* list, in bps */
-
-       /* RTS threshold */
-       __s32           min_rts;        /* Minimal RTS threshold */
-       __s32           max_rts;        /* Maximal RTS threshold */
-
-       /* Frag threshold */
-       __s32           min_frag;       /* Minimal frag threshold */
-       __s32           max_frag;       /* Maximal frag threshold */
-
-       /* Power Management duration & timeout */
-       __s32           min_pmp;        /* Minimal PM period */
-       __s32           max_pmp;        /* Maximal PM period */
-       __s32           min_pmt;        /* Minimal PM timeout */
-       __s32           max_pmt;        /* Maximal PM timeout */
-       __u16           pmp_flags;      /* How to decode max/min PM period */
-       __u16           pmt_flags;      /* How to decode max/min PM timeout */
-       __u16           pm_capa;        /* What PM options are supported */
-
-       /* Encoder stuff */
-       __u16   encoding_size[IW_MAX_ENCODING_SIZES];   /* Different token sizes */
-       __u8    num_encoding_sizes;     /* Number of entry in the list */
-       __u8    max_encoding_tokens;    /* Max number of tokens */
-       /* For drivers that need a "login/passwd" form */
-       __u8    encoding_login_index;   /* token index for login token */
-
-       /* Transmit power */
-       __u16           txpower_capa;   /* What options are supported */
-       __u8            num_txpower;    /* Number of entries in the list */
-       __s32           txpower[IW_MAX_TXPOWER];        /* list, in bps */
-
-       /* Wireless Extension version info */
-       __u8            we_version_compiled;    /* Must be WIRELESS_EXT */
-       __u8            we_version_source;      /* Last update of source */
-
-       /* Retry limits and lifetime */
-       __u16           retry_capa;     /* What retry options are supported */
-       __u16           retry_flags;    /* How to decode max/min retry limit */
-       __u16           r_time_flags;   /* How to decode max/min retry life */
-       __s32           min_retry;      /* Minimal number of retries */
-       __s32           max_retry;      /* Maximal number of retries */
-       __s32           min_r_time;     /* Minimal retry lifetime */
-       __s32           max_r_time;     /* Maximal retry lifetime */
-
-       /* Frequency */
-       __u16           num_channels;   /* Number of channels [0; num - 1] */
-       __u8            num_frequency;  /* Number of entry in the list */
-       struct iw_freq  freq[IW_MAX_FREQUENCIES];       /* list */
-       /* Note : this frequency list doesn't need to fit channel numbers,
-        * because each entry contain its channel index */
-
-       __u32           enc_capa;       /* IW_ENC_CAPA_* bit field */
-};
-
-/*
- * Private ioctl interface information
- */
-struct iw_priv_args
-{
-       __u32           cmd;            /* Number of the ioctl to issue */
-       __u16           set_args;       /* Type and number of args */
-       __u16           get_args;       /* Type and number of args */
-       char            name[IFNAMSIZ]; /* Name of the extension */
-};
-
-/* ----------------------- WIRELESS EVENTS ----------------------- */
-/*
- * Wireless events are carried through the rtnetlink socket to user
- * space. They are encapsulated in the IFLA_WIRELESS field of
- * a RTM_NEWLINK message.
- */
-
-/*
- * A Wireless Event. Contains basically the same data as the ioctl...
- */
-struct iw_event
-{
-       __u16           len;                    /* Real length of this stuff */
-       __u16           cmd;                    /* Wireless IOCTL */
-       union iwreq_data        u;              /* IOCTL fixed payload */
-};
-
-/* Size of the Event prefix (including padding and alignement junk) */
-#define IW_EV_LCP_LEN  (sizeof(struct iw_event) - sizeof(union iwreq_data))
-/* Size of the various events */
-#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
-#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
-#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
-#define IW_EV_PARAM_LEN        (IW_EV_LCP_LEN + sizeof(struct iw_param))
-#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
-#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
-
-/* iw_point events are special. First, the payload (extra data) come at
- * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
- * we omit the pointer, so start at an offset. */
-#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
-                         (char *) NULL)
-#define IW_EV_POINT_LEN        (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
-                        IW_EV_POINT_OFF)
-
-#ifdef __KERNEL__
 #ifdef CONFIG_COMPAT
 struct __compat_iw_event {
        __u16           len;                    /* Real length of this stuff */
@@ -1146,17 +41,4 @@ struct __compat_iw_event {
        (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
         IW_EV_COMPAT_POINT_OFF)
 #endif
-#endif
-
-/* Size of the Event prefix when packed in stream */
-#define IW_EV_LCP_PK_LEN       (4)
-/* Size of the various events when packed in stream */
-#define IW_EV_CHAR_PK_LEN      (IW_EV_LCP_PK_LEN + IFNAMSIZ)
-#define IW_EV_UINT_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(__u32))
-#define IW_EV_FREQ_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
-#define IW_EV_PARAM_PK_LEN     (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
-#define IW_EV_ADDR_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
-#define IW_EV_QUAL_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
-#define IW_EV_POINT_PK_LEN     (IW_EV_LCP_PK_LEN + 4)
-
 #endif /* _LINUX_WIRELESS_H */
index cc13e1115970455e4240ff09e69d34f610cf337d..fdbafc6841cfd609cfd0c810ddcf4c3df7a33ed2 100644 (file)
 #ifndef _LINUX_XATTR_H
 #define _LINUX_XATTR_H
 
-#define XATTR_CREATE   0x1     /* set value, fail if attr already exists */
-#define XATTR_REPLACE  0x2     /* set value, fail if attr does not exist */
-
-/* Namespaces */
-#define XATTR_OS2_PREFIX "os2."
-#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
-
-#define XATTR_SECURITY_PREFIX  "security."
-#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
-
-#define XATTR_SYSTEM_PREFIX "system."
-#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
-
-#define XATTR_TRUSTED_PREFIX "trusted."
-#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
-
-#define XATTR_USER_PREFIX "user."
-#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
-
-/* Security namespace */
-#define XATTR_EVM_SUFFIX "evm"
-#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
-
-#define XATTR_IMA_SUFFIX "ima"
-#define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
-
-#define XATTR_SELINUX_SUFFIX "selinux"
-#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
-
-#define XATTR_SMACK_SUFFIX "SMACK64"
-#define XATTR_SMACK_IPIN "SMACK64IPIN"
-#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
-#define XATTR_SMACK_EXEC "SMACK64EXEC"
-#define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
-#define XATTR_SMACK_MMAP "SMACK64MMAP"
-#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
-#define XATTR_NAME_SMACKIPIN   XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
-#define XATTR_NAME_SMACKIPOUT  XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
-#define XATTR_NAME_SMACKEXEC   XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
-#define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
-#define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
-
-#define XATTR_CAPS_SUFFIX "capability"
-#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
-
-#define XATTR_POSIX_ACL_ACCESS  "posix_acl_access"
-#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
-#define XATTR_POSIX_ACL_DEFAULT  "posix_acl_default"
-#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
-
-#ifdef  __KERNEL__
 
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/spinlock.h>
+#include <uapi/linux/xattr.h>
 
 struct inode;
 struct dentry;
@@ -147,6 +97,4 @@ ssize_t simple_xattr_list(struct simple_xattrs *xattrs, char *buffer,
 void simple_xattr_list_add(struct simple_xattrs *xattrs,
                           struct simple_xattr *new_xattr);
 
-#endif  /*  __KERNEL__  */
-
 #endif /* _LINUX_XATTR_H */
index b0fd4d03499d02c3d0b0a47f76b897a12672012c..e194387ef7845a77c53114f0e3dbada06e4c8189 100644 (file)
@@ -22,3 +22,396 @@ header-y += usb/
 header-y += wimax/
 
 genhdr-y += version.h
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h \
+                 $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),)
+header-y += a.out.h
+endif
+
+header-y += acct.h
+header-y += adb.h
+header-y += adfs_fs.h
+header-y += affs_hardblocks.h
+header-y += agpgart.h
+header-y += aio_abi.h
+header-y += apm_bios.h
+header-y += arcfb.h
+header-y += atalk.h
+header-y += atm.h
+header-y += atm_eni.h
+header-y += atm_he.h
+header-y += atm_idt77105.h
+header-y += atm_nicstar.h
+header-y += atm_tcp.h
+header-y += atm_zatm.h
+header-y += atmapi.h
+header-y += atmarp.h
+header-y += atmbr2684.h
+header-y += atmclip.h
+header-y += atmdev.h
+header-y += atmioc.h
+header-y += atmlec.h
+header-y += atmmpc.h
+header-y += atmppp.h
+header-y += atmsap.h
+header-y += atmsvc.h
+header-y += audit.h
+header-y += auto_fs.h
+header-y += auto_fs4.h
+header-y += auxvec.h
+header-y += ax25.h
+header-y += b1lli.h
+header-y += baycom.h
+header-y += bfs_fs.h
+header-y += binfmts.h
+header-y += blkpg.h
+header-y += blktrace_api.h
+header-y += bpqether.h
+header-y += bsg.h
+header-y += can.h
+header-y += capability.h
+header-y += capi.h
+header-y += cciss_defs.h
+header-y += cciss_ioctl.h
+header-y += cdrom.h
+header-y += cgroupstats.h
+header-y += chio.h
+header-y += cm4000_cs.h
+header-y += cn_proc.h
+header-y += coda.h
+header-y += coda_psdev.h
+header-y += coff.h
+header-y += connector.h
+header-y += const.h
+header-y += cramfs_fs.h
+header-y += cuda.h
+header-y += cyclades.h
+header-y += cycx_cfm.h
+header-y += dcbnl.h
+header-y += dccp.h
+header-y += dlm.h
+header-y += dlm_device.h
+header-y += dlm_netlink.h
+header-y += dlm_plock.h
+header-y += dlmconstants.h
+header-y += dm-ioctl.h
+header-y += dm-log-userspace.h
+header-y += dn.h
+header-y += dqblk_xfs.h
+header-y += edd.h
+header-y += efs_fs_sb.h
+header-y += elf-em.h
+header-y += elf-fdpic.h
+header-y += elf.h
+header-y += elfcore.h
+header-y += errno.h
+header-y += errqueue.h
+header-y += ethtool.h
+header-y += eventpoll.h
+header-y += fadvise.h
+header-y += falloc.h
+header-y += fanotify.h
+header-y += fb.h
+header-y += fcntl.h
+header-y += fd.h
+header-y += fdreg.h
+header-y += fib_rules.h
+header-y += fiemap.h
+header-y += filter.h
+header-y += firewire-cdev.h
+header-y += firewire-constants.h
+header-y += flat.h
+header-y += fs.h
+header-y += fsl_hypervisor.h
+header-y += fuse.h
+header-y += futex.h
+header-y += gameport.h
+header-y += gen_stats.h
+header-y += genetlink.h
+header-y += gfs2_ondisk.h
+header-y += gigaset_dev.h
+header-y += hdlc.h
+header-y += hdlcdrv.h
+header-y += hdreg.h
+header-y += hid.h
+header-y += hiddev.h
+header-y += hidraw.h
+header-y += hpet.h
+header-y += hysdn_if.h
+header-y += i2c-dev.h
+header-y += i2c.h
+header-y += i2o-dev.h
+header-y += i8k.h
+header-y += icmp.h
+header-y += icmpv6.h
+header-y += if.h
+header-y += if_addr.h
+header-y += if_addrlabel.h
+header-y += if_alg.h
+header-y += if_arcnet.h
+header-y += if_arp.h
+header-y += if_bonding.h
+header-y += if_bridge.h
+header-y += if_cablemodem.h
+header-y += if_eql.h
+header-y += if_ether.h
+header-y += if_fc.h
+header-y += if_fddi.h
+header-y += if_frad.h
+header-y += if_hippi.h
+header-y += if_infiniband.h
+header-y += if_link.h
+header-y += if_ltalk.h
+header-y += if_packet.h
+header-y += if_phonet.h
+header-y += if_plip.h
+header-y += if_ppp.h
+header-y += if_pppol2tp.h
+header-y += if_pppox.h
+header-y += if_slip.h
+header-y += if_team.h
+header-y += if_tun.h
+header-y += if_tunnel.h
+header-y += if_vlan.h
+header-y += if_x25.h
+header-y += igmp.h
+header-y += in.h
+header-y += in6.h
+header-y += in_route.h
+header-y += inet_diag.h
+header-y += inotify.h
+header-y += input.h
+header-y += ioctl.h
+header-y += ip.h
+header-y += ip6_tunnel.h
+header-y += ip_vs.h
+header-y += ipc.h
+header-y += ipmi.h
+header-y += ipmi_msgdefs.h
+header-y += ipsec.h
+header-y += ipv6.h
+header-y += ipv6_route.h
+header-y += ipx.h
+header-y += irda.h
+header-y += irqnr.h
+header-y += isdn.h
+header-y += isdn_divertif.h
+header-y += isdn_ppp.h
+header-y += isdnif.h
+header-y += iso_fs.h
+header-y += ivtv.h
+header-y += ivtvfb.h
+header-y += ixjuser.h
+header-y += jffs2.h
+header-y += joystick.h
+header-y += kd.h
+header-y += kdev_t.h
+header-y += kernel-page-flags.h
+header-y += kernel.h
+header-y += kernelcapi.h
+header-y += kexec.h
+header-y += keyboard.h
+header-y += keyctl.h
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h \
+                 $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),)
+header-y += kvm.h
+endif
+
+
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h \
+                 $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h),)
+header-y += kvm_para.h
+endif
+
+header-y += l2tp.h
+header-y += limits.h
+header-y += llc.h
+header-y += loop.h
+header-y += lp.h
+header-y += magic.h
+header-y += major.h
+header-y += map_to_7segment.h
+header-y += matroxfb.h
+header-y += mdio.h
+header-y += media.h
+header-y += mei.h
+header-y += mempolicy.h
+header-y += meye.h
+header-y += mii.h
+header-y += minix_fs.h
+header-y += mman.h
+header-y += mmtimer.h
+header-y += mqueue.h
+header-y += mroute.h
+header-y += mroute6.h
+header-y += msdos_fs.h
+header-y += msg.h
+header-y += mtio.h
+header-y += n_r3964.h
+header-y += nbd.h
+header-y += ncp.h
+header-y += ncp_fs.h
+header-y += ncp_mount.h
+header-y += ncp_no.h
+header-y += neighbour.h
+header-y += net.h
+header-y += net_dropmon.h
+header-y += net_tstamp.h
+header-y += netdevice.h
+header-y += netfilter.h
+header-y += netfilter_arp.h
+header-y += netfilter_bridge.h
+header-y += netfilter_decnet.h
+header-y += netfilter_ipv4.h
+header-y += netfilter_ipv6.h
+header-y += netlink.h
+header-y += netrom.h
+header-y += nfc.h
+header-y += nfs.h
+header-y += nfs2.h
+header-y += nfs3.h
+header-y += nfs4.h
+header-y += nfs4_mount.h
+header-y += nfs_fs.h
+header-y += nfs_idmap.h
+header-y += nfs_mount.h
+header-y += nfsacl.h
+header-y += nl80211.h
+header-y += nubus.h
+header-y += nvram.h
+header-y += omap3isp.h
+header-y += omapfb.h
+header-y += oom.h
+header-y += packet_diag.h
+header-y += param.h
+header-y += parport.h
+header-y += patchkey.h
+header-y += pci.h
+header-y += pci_regs.h
+header-y += perf_event.h
+header-y += personality.h
+header-y += pfkeyv2.h
+header-y += pg.h
+header-y += phantom.h
+header-y += phonet.h
+header-y += pkt_cls.h
+header-y += pkt_sched.h
+header-y += pktcdvd.h
+header-y += pmu.h
+header-y += poll.h
+header-y += posix_types.h
+header-y += ppdev.h
+header-y += ppp-comp.h
+header-y += ppp-ioctl.h
+header-y += ppp_defs.h
+header-y += pps.h
+header-y += prctl.h
+header-y += ptp_clock.h
+header-y += ptrace.h
+header-y += qnx4_fs.h
+header-y += qnxtypes.h
+header-y += quota.h
+header-y += radeonfb.h
+header-y += random.h
+header-y += raw.h
+header-y += rds.h
+header-y += reboot.h
+header-y += reiserfs_fs.h
+header-y += reiserfs_xattr.h
+header-y += resource.h
+header-y += rfkill.h
+header-y += romfs_fs.h
+header-y += rose.h
+header-y += route.h
+header-y += rtc.h
+header-y += rtnetlink.h
+header-y += scc.h
+header-y += sched.h
+header-y += screen_info.h
+header-y += sdla.h
+header-y += seccomp.h
+header-y += securebits.h
+header-y += selinux_netlink.h
+header-y += sem.h
+header-y += serial.h
+header-y += serial_core.h
+header-y += serial_reg.h
+header-y += serio.h
+header-y += shm.h
+header-y += signal.h
+header-y += signalfd.h
+header-y += snmp.h
+header-y += sock_diag.h
+header-y += socket.h
+header-y += sockios.h
+header-y += som.h
+header-y += sonet.h
+header-y += sonypi.h
+header-y += sound.h
+header-y += soundcard.h
+header-y += stat.h
+header-y += stddef.h
+header-y += string.h
+header-y += suspend_ioctls.h
+header-y += swab.h
+header-y += synclink.h
+header-y += sysctl.h
+header-y += sysinfo.h
+header-y += taskstats.h
+header-y += tcp.h
+header-y += tcp_metrics.h
+header-y += telephony.h
+header-y += termios.h
+header-y += time.h
+header-y += times.h
+header-y += timex.h
+header-y += tiocl.h
+header-y += tipc.h
+header-y += tipc_config.h
+header-y += toshiba.h
+header-y += tty.h
+header-y += tty_flags.h
+header-y += types.h
+header-y += udf_fs_i.h
+header-y += udp.h
+header-y += uhid.h
+header-y += uinput.h
+header-y += uio.h
+header-y += ultrasound.h
+header-y += un.h
+header-y += unistd.h
+header-y += unix_diag.h
+header-y += usbdevice_fs.h
+header-y += utime.h
+header-y += utsname.h
+header-y += uuid.h
+header-y += uvcvideo.h
+header-y += v4l2-common.h
+header-y += v4l2-controls.h
+header-y += v4l2-dv-timings.h
+header-y += v4l2-mediabus.h
+header-y += v4l2-subdev.h
+header-y += veth.h
+header-y += vfio.h
+header-y += vhost.h
+header-y += videodev2.h
+header-y += virtio_9p.h
+header-y += virtio_balloon.h
+header-y += virtio_blk.h
+header-y += virtio_config.h
+header-y += virtio_console.h
+header-y += virtio_ids.h
+header-y += virtio_net.h
+header-y += virtio_pci.h
+header-y += virtio_ring.h
+header-y += virtio_rng.h
+header-y += vt.h
+header-y += wait.h
+header-y += wanrouter.h
+header-y += watchdog.h
+header-y += wimax.h
+header-y += wireless.h
+header-y += x25.h
+header-y += xattr.h
+header-y += xfrm.h
diff --git a/include/uapi/linux/a.out.h b/include/uapi/linux/a.out.h
new file mode 100644 (file)
index 0000000..7caf44c
--- /dev/null
@@ -0,0 +1,274 @@
+#ifndef _UAPI__A_OUT_GNU_H__
+#define _UAPI__A_OUT_GNU_H__
+
+#define __GNU_EXEC_MACROS__
+
+#ifndef __STRUCT_EXEC_OVERRIDE__
+
+#include <asm/a.out.h>
+
+#endif /* __STRUCT_EXEC_OVERRIDE__ */
+
+#ifndef __ASSEMBLY__
+
+/* these go in the N_MACHTYPE field */
+enum machine_type {
+#if defined (M_OLDSUN2)
+  M__OLDSUN2 = M_OLDSUN2,
+#else
+  M_OLDSUN2 = 0,
+#endif
+#if defined (M_68010)
+  M__68010 = M_68010,
+#else
+  M_68010 = 1,
+#endif
+#if defined (M_68020)
+  M__68020 = M_68020,
+#else
+  M_68020 = 2,
+#endif
+#if defined (M_SPARC)
+  M__SPARC = M_SPARC,
+#else
+  M_SPARC = 3,
+#endif
+  /* skip a bunch so we don't run into any of sun's numbers */
+  M_386 = 100,
+  M_MIPS1 = 151,       /* MIPS R3000/R3000 binary */
+  M_MIPS2 = 152                /* MIPS R6000/R4000 binary */
+};
+
+#if !defined (N_MAGIC)
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#endif
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags) \
+       ((exec).a_info = ((magic) & 0xffff) \
+        | (((int)(type) & 0xff) << 16) \
+        | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic) \
+       ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+
+#define N_SET_MACHTYPE(exec, machtype) \
+       ((exec).a_info = \
+        ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+
+#define N_SET_FLAGS(exec, flags) \
+       ((exec).a_info = \
+        ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+/* Code indicating object file or impure executable.  */
+#define OMAGIC 0407
+/* Code indicating pure executable.  */
+#define NMAGIC 0410
+/* Code indicating demand-paged executable.  */
+#define ZMAGIC 0413
+/* This indicates a demand-paged executable with the header in the text. 
+   The first page is unmapped to help trap NULL pointer references */
+#define QMAGIC 0314
+
+/* Code indicating core file.  */
+#define CMAGIC 0421
+
+#if !defined (N_BADMAG)
+#define N_BADMAG(x)      (N_MAGIC(x) != OMAGIC         \
+                       && N_MAGIC(x) != NMAGIC         \
+                       && N_MAGIC(x) != ZMAGIC \
+                       && N_MAGIC(x) != QMAGIC)
+#endif
+
+#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+
+#if !defined (N_TXTOFF)
+#define N_TXTOFF(x) \
+ (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
+  (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#endif
+
+#if !defined (N_DATOFF)
+#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#endif
+
+#if !defined (N_TRELOFF)
+#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#endif
+
+#if !defined (N_DRELOFF)
+#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
+#endif
+
+#if !defined (N_SYMOFF)
+#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
+#endif
+
+#if !defined (N_STROFF)
+#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
+#endif
+
+/* Address of text segment in memory after it is loaded.  */
+#if !defined (N_TXTADDR)
+#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
+#endif
+
+/* Address of data segment in memory after it is loaded.
+   Note that it is up to you to define SEGMENT_SIZE
+   on machines not listed here.  */
+#if defined(vax) || defined(hp300) || defined(pyr)
+#define SEGMENT_SIZE page_size
+#endif
+#ifdef sony
+#define        SEGMENT_SIZE    0x2000
+#endif /* Sony.  */
+#ifdef is68k
+#define SEGMENT_SIZE 0x20000
+#endif
+#if defined(m68k) && defined(PORTAR)
+#define PAGE_SIZE 0x400
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+
+#ifdef linux
+#ifndef __KERNEL__
+#include <unistd.h>
+#endif
+#if defined(__i386__) || defined(__mc68000__)
+#define SEGMENT_SIZE   1024
+#else
+#ifndef SEGMENT_SIZE
+#ifndef __KERNEL__
+#define SEGMENT_SIZE   getpagesize()
+#endif
+#endif
+#endif
+#endif
+
+#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
+
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#ifndef N_DATADDR
+#define N_DATADDR(x) \
+    (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
+     : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#endif
+
+/* Address of bss segment in memory after it is loaded.  */
+#if !defined (N_BSSADDR)
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#endif
+\f
+#if !defined (N_NLIST_DECLARED)
+struct nlist {
+  union {
+    char *n_name;
+    struct nlist *n_next;
+    long n_strx;
+  } n_un;
+  unsigned char n_type;
+  char n_other;
+  short n_desc;
+  unsigned long n_value;
+};
+#endif /* no N_NLIST_DECLARED.  */
+
+#if !defined (N_UNDF)
+#define N_UNDF 0
+#endif
+#if !defined (N_ABS)
+#define N_ABS 2
+#endif
+#if !defined (N_TEXT)
+#define N_TEXT 4
+#endif
+#if !defined (N_DATA)
+#define N_DATA 6
+#endif
+#if !defined (N_BSS)
+#define N_BSS 8
+#endif
+#if !defined (N_FN)
+#define N_FN 15
+#endif
+
+#if !defined (N_EXT)
+#define N_EXT 1
+#endif
+#if !defined (N_TYPE)
+#define N_TYPE 036
+#endif
+#if !defined (N_STAB)
+#define N_STAB 0340
+#endif
+
+/* The following type indicates the definition of a symbol as being
+   an indirect reference to another symbol.  The other symbol
+   appears as an undefined reference, immediately following this symbol.
+
+   Indirection is asymmetrical.  The other symbol's value will be used
+   to satisfy requests for the indirect symbol, but not vice versa.
+   If the other symbol does not have a definition, libraries will
+   be searched to find a definition.  */
+#define N_INDR 0xa
+
+/* The following symbols refer to set elements.
+   All the N_SET[ATDB] symbols with the same name form one set.
+   Space is allocated for the set in the text section, and each set
+   element's value is stored into one word of the space.
+   The first word of the space is the length of the set (number of elements).
+
+   The address of the set is made into an N_SETV symbol
+   whose name is the same as the name of the set.
+   This symbol acts like a N_DATA global symbol
+   in that it can satisfy undefined external references.  */
+
+/* These appear as input to LD, in a .o file.  */
+#define        N_SETA  0x14            /* Absolute set element symbol */
+#define        N_SETT  0x16            /* Text set element symbol */
+#define        N_SETD  0x18            /* Data set element symbol */
+#define        N_SETB  0x1A            /* Bss set element symbol */
+
+/* This is output from LD.  */
+#define N_SETV 0x1C            /* Pointer to set vector in data area.  */
+\f
+#if !defined (N_RELOCATION_INFO_DECLARED)
+/* This structure describes a single relocation to be performed.
+   The text-relocation section of the file is a vector of these structures,
+   all of which apply to the text section.
+   Likewise, the data-relocation section applies to the data section.  */
+
+struct relocation_info
+{
+  /* Address (within segment) to be relocated.  */
+  int r_address;
+  /* The meaning of r_symbolnum depends on r_extern.  */
+  unsigned int r_symbolnum:24;
+  /* Nonzero means value is a pc-relative offset
+     and it should be relocated for changes in its own address
+     as well as for changes in the symbol or section specified.  */
+  unsigned int r_pcrel:1;
+  /* Length (as exponent of 2) of the field to be relocated.
+     Thus, a value of 2 indicates 1<<2 bytes.  */
+  unsigned int r_length:2;
+  /* 1 => relocate with value of symbol.
+          r_symbolnum is the index of the symbol
+         in file's the symbol table.
+     0 => relocate with the address of a segment.
+          r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
+         (the N_EXT bit may be set also, but signifies nothing).  */
+  unsigned int r_extern:1;
+  /* Four bits that aren't used, but when writing an object file
+     it is desirable to clear them.  */
+#ifdef NS32K
+  unsigned r_bsr:1;
+  unsigned r_disp:1;
+  unsigned r_pad:2;
+#else
+  unsigned int r_pad:4;
+#endif
+};
+#endif /* no N_RELOCATION_INFO_DECLARED.  */
+
+#endif /*__ASSEMBLY__ */
+#endif /* _UAPI__A_OUT_GNU_H__ */
diff --git a/include/uapi/linux/acct.h b/include/uapi/linux/acct.h
new file mode 100644 (file)
index 0000000..11b6ca3
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ *  BSD Process Accounting for Linux - Definitions
+ *
+ *  Author: Marco van Wieringen (mvw@planets.elm.net)
+ *
+ *  This header file contains the definitions needed to implement
+ *  BSD-style process accounting. The kernel accounting code and all
+ *  user-level programs that try to do something useful with the
+ *  process accounting log must include this file.
+ *
+ *  Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
+ *
+ */
+
+#ifndef _UAPI_LINUX_ACCT_H
+#define _UAPI_LINUX_ACCT_H
+
+#include <linux/types.h>
+
+#include <asm/param.h>
+#include <asm/byteorder.h>
+
+/* 
+ *  comp_t is a 16-bit "floating" point number with a 3-bit base 8
+ *  exponent and a 13-bit fraction.
+ *  comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
+ *  (leading 1 not stored).
+ *  See linux/kernel/acct.c for the specific encoding systems used.
+ */
+
+typedef __u16  comp_t;
+typedef __u32  comp2_t;
+
+/*
+ *   accounting file record
+ *
+ *   This structure contains all of the information written out to the
+ *   process accounting file whenever a process exits.
+ */
+
+#define ACCT_COMM      16
+
+struct acct
+{
+       char            ac_flag;                /* Flags */
+       char            ac_version;             /* Always set to ACCT_VERSION */
+       /* for binary compatibility back until 2.0 */
+       __u16           ac_uid16;               /* LSB of Real User ID */
+       __u16           ac_gid16;               /* LSB of Real Group ID */
+       __u16           ac_tty;                 /* Control Terminal */
+       __u32           ac_btime;               /* Process Creation Time */
+       comp_t          ac_utime;               /* User Time */
+       comp_t          ac_stime;               /* System Time */
+       comp_t          ac_etime;               /* Elapsed Time */
+       comp_t          ac_mem;                 /* Average Memory Usage */
+       comp_t          ac_io;                  /* Chars Transferred */
+       comp_t          ac_rw;                  /* Blocks Read or Written */
+       comp_t          ac_minflt;              /* Minor Pagefaults */
+       comp_t          ac_majflt;              /* Major Pagefaults */
+       comp_t          ac_swaps;               /* Number of Swaps */
+/* m68k had no padding here. */
+#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+       __u16           ac_ahz;                 /* AHZ */
+#endif
+       __u32           ac_exitcode;            /* Exitcode */
+       char            ac_comm[ACCT_COMM + 1]; /* Command Name */
+       __u8            ac_etime_hi;            /* Elapsed Time MSB */
+       __u16           ac_etime_lo;            /* Elapsed Time LSB */
+       __u32           ac_uid;                 /* Real User ID */
+       __u32           ac_gid;                 /* Real Group ID */
+};
+
+struct acct_v3
+{
+       char            ac_flag;                /* Flags */
+       char            ac_version;             /* Always set to ACCT_VERSION */
+       __u16           ac_tty;                 /* Control Terminal */
+       __u32           ac_exitcode;            /* Exitcode */
+       __u32           ac_uid;                 /* Real User ID */
+       __u32           ac_gid;                 /* Real Group ID */
+       __u32           ac_pid;                 /* Process ID */
+       __u32           ac_ppid;                /* Parent Process ID */
+       __u32           ac_btime;               /* Process Creation Time */
+#ifdef __KERNEL__
+       __u32           ac_etime;               /* Elapsed Time */
+#else
+       float           ac_etime;               /* Elapsed Time */
+#endif
+       comp_t          ac_utime;               /* User Time */
+       comp_t          ac_stime;               /* System Time */
+       comp_t          ac_mem;                 /* Average Memory Usage */
+       comp_t          ac_io;                  /* Chars Transferred */
+       comp_t          ac_rw;                  /* Blocks Read or Written */
+       comp_t          ac_minflt;              /* Minor Pagefaults */
+       comp_t          ac_majflt;              /* Major Pagefaults */
+       comp_t          ac_swaps;               /* Number of Swaps */
+       char            ac_comm[ACCT_COMM];     /* Command Name */
+};
+
+/*
+ *  accounting flags
+ */
+                               /* bit set when the process ... */
+#define AFORK          0x01    /* ... executed fork, but did not exec */
+#define ASU            0x02    /* ... used super-user privileges */
+#define ACOMPAT                0x04    /* ... used compatibility mode (VAX only not used) */
+#define ACORE          0x08    /* ... dumped core */
+#define AXSIG          0x10    /* ... was killed by a signal */
+
+#ifdef __BIG_ENDIAN
+#define ACCT_BYTEORDER 0x80    /* accounting file is big endian */
+#else
+#define ACCT_BYTEORDER 0x00    /* accounting file is little endian */
+#endif
+
+#ifndef __KERNEL__
+#define ACCT_VERSION   2
+#define AHZ            (HZ)
+#endif /* __KERNEL */
+
+
+#endif /* _UAPI_LINUX_ACCT_H */
diff --git a/include/uapi/linux/adb.h b/include/uapi/linux/adb.h
new file mode 100644 (file)
index 0000000..0ea1075
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Definitions for ADB (Apple Desktop Bus) support.
+ */
+#ifndef _UAPI__ADB_H
+#define _UAPI__ADB_H
+
+/* ADB commands */
+#define ADB_BUSRESET           0
+#define ADB_FLUSH(id)          (0x01 | ((id) << 4))
+#define ADB_WRITEREG(id, reg)  (0x08 | (reg) | ((id) << 4))
+#define ADB_READREG(id, reg)   (0x0C | (reg) | ((id) << 4))
+
+/* ADB default device IDs (upper 4 bits of ADB command byte) */
+#define ADB_DONGLE     1       /* "software execution control" devices */
+#define ADB_KEYBOARD   2
+#define ADB_MOUSE      3
+#define ADB_TABLET     4
+#define ADB_MODEM      5
+#define ADB_MISC       7       /* maybe a monitor */
+
+#define ADB_RET_OK     0
+#define ADB_RET_TIMEOUT        3
+
+/* The kind of ADB request. The controller may emulate some
+   or all of those CUDA/PMU packet kinds */
+#define ADB_PACKET     0
+#define CUDA_PACKET    1
+#define ERROR_PACKET   2
+#define TIMER_PACKET   3
+#define POWER_PACKET   4
+#define MACIIC_PACKET  5
+#define PMU_PACKET     6
+#define ADB_QUERY      7
+
+/* ADB queries */
+
+/* ADB_QUERY_GETDEVINFO
+ * Query ADB slot for device presence
+ * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
+ */
+#define ADB_QUERY_GETDEVINFO   1
+
+
+#endif /* _UAPI__ADB_H */
diff --git a/include/uapi/linux/adfs_fs.h b/include/uapi/linux/adfs_fs.h
new file mode 100644 (file)
index 0000000..a1bf437
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _UAPI_ADFS_FS_H
+#define _UAPI_ADFS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/*
+ * Disc Record at disc address 0xc00
+ */
+struct adfs_discrecord {
+    __u8  log2secsize;
+    __u8  secspertrack;
+    __u8  heads;
+    __u8  density;
+    __u8  idlen;
+    __u8  log2bpmb;
+    __u8  skew;
+    __u8  bootoption;
+    __u8  lowsector;
+    __u8  nzones;
+    __le16 zone_spare;
+    __le32 root;
+    __le32 disc_size;
+    __le16 disc_id;
+    __u8  disc_name[10];
+    __le32 disc_type;
+    __le32 disc_size_high;
+    __u8  log2sharesize:4;
+    __u8  unused40:4;
+    __u8  big_flag:1;
+    __u8  unused41:1;
+    __u8  nzones_high;
+    __le32 format_version;
+    __le32 root_size;
+    __u8  unused52[60 - 52];
+};
+
+#define ADFS_DISCRECORD                (0xc00)
+#define ADFS_DR_OFFSET         (0x1c0)
+#define ADFS_DR_SIZE            60
+#define ADFS_DR_SIZE_BITS      (ADFS_DR_SIZE << 3)
+
+
+#endif /* _UAPI_ADFS_FS_H */
diff --git a/include/uapi/linux/agpgart.h b/include/uapi/linux/agpgart.h
new file mode 100644 (file)
index 0000000..4e828cf
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * AGPGART module version 0.99
+ * Copyright (C) 1999 Jeff Hartmann
+ * Copyright (C) 1999 Precision Insight, Inc.
+ * Copyright (C) 1999 Xi Graphics, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _UAPI_AGP_H
+#define _UAPI_AGP_H
+
+#define AGPIOC_BASE       'A'
+#define AGPIOC_INFO       _IOR (AGPIOC_BASE, 0, struct agp_info*)
+#define AGPIOC_ACQUIRE    _IO  (AGPIOC_BASE, 1)
+#define AGPIOC_RELEASE    _IO  (AGPIOC_BASE, 2)
+#define AGPIOC_SETUP      _IOW (AGPIOC_BASE, 3, struct agp_setup*)
+#define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, struct agp_region*)
+#define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, struct agp_region*)
+#define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
+#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
+#define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, struct agp_bind*)
+#define AGPIOC_UNBIND     _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
+#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
+
+#define AGP_DEVICE      "/dev/agpgart"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef __KERNEL__
+#include <linux/types.h>
+
+struct agp_version {
+       __u16 major;
+       __u16 minor;
+};
+
+typedef struct _agp_info {
+       struct agp_version version;     /* version of the driver        */
+       __u32 bridge_id;        /* bridge vendor/device         */
+       __u32 agp_mode;         /* mode info of bridge          */
+       unsigned long aper_base;/* base of aperture             */
+       size_t aper_size;       /* size of aperture             */
+       size_t pg_total;        /* max pages (swap + system)    */
+       size_t pg_system;       /* max pages (system)           */
+       size_t pg_used;         /* current pages used           */
+} agp_info;
+
+typedef struct _agp_setup {
+       __u32 agp_mode;         /* mode info of bridge          */
+} agp_setup;
+
+/*
+ * The "prot" down below needs still a "sleep" flag somehow ...
+ */
+typedef struct _agp_segment {
+       __kernel_off_t pg_start;        /* starting page to populate    */
+       __kernel_size_t pg_count;       /* number of pages              */
+       int prot;                       /* prot flags for mmap          */
+} agp_segment;
+
+typedef struct _agp_region {
+       __kernel_pid_t pid;             /* pid of process       */
+       __kernel_size_t seg_count;      /* number of segments   */
+       struct _agp_segment *seg_list;
+} agp_region;
+
+typedef struct _agp_allocate {
+       int key;                /* tag of allocation            */
+       __kernel_size_t pg_count;/* number of pages             */
+       __u32 type;             /* 0 == normal, other devspec   */
+       __u32 physical;         /* device specific (some devices  
+                                * need a phys address of the     
+                                * actual page behind the gatt    
+                                * table)                        */
+} agp_allocate;
+
+typedef struct _agp_bind {
+       int key;                /* tag of allocation            */
+       __kernel_off_t pg_start;/* starting page to populate    */
+} agp_bind;
+
+typedef struct _agp_unbind {
+       int key;                /* tag of allocation            */
+       __u32 priority;         /* priority for paging out      */
+} agp_unbind;
+
+#endif                         /* __KERNEL__ */
+
+#endif /* _UAPI_AGP_H */
diff --git a/include/uapi/linux/apm_bios.h b/include/uapi/linux/apm_bios.h
new file mode 100644 (file)
index 0000000..724f409
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Include file for the interface to an APM BIOS
+ * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+#ifndef _UAPI_LINUX_APM_H
+#define _UAPI_LINUX_APM_H
+
+
+#include <linux/types.h>
+
+typedef unsigned short apm_event_t;
+typedef unsigned short apm_eventinfo_t;
+
+struct apm_bios_info {
+       __u16   version;
+       __u16   cseg;
+       __u32   offset;
+       __u16   cseg_16;
+       __u16   dseg;
+       __u16   flags;
+       __u16   cseg_len;
+       __u16   cseg_16_len;
+       __u16   dseg_len;
+};
+
+
+/*
+ * Power states
+ */
+#define APM_STATE_READY                0x0000
+#define APM_STATE_STANDBY      0x0001
+#define APM_STATE_SUSPEND      0x0002
+#define APM_STATE_OFF          0x0003
+#define APM_STATE_BUSY         0x0004
+#define APM_STATE_REJECT       0x0005
+#define APM_STATE_OEM_SYS      0x0020
+#define APM_STATE_OEM_DEV      0x0040
+
+#define APM_STATE_DISABLE      0x0000
+#define APM_STATE_ENABLE       0x0001
+
+#define APM_STATE_DISENGAGE    0x0000
+#define APM_STATE_ENGAGE       0x0001
+
+/*
+ * Events (results of Get PM Event)
+ */
+#define APM_SYS_STANDBY                0x0001
+#define APM_SYS_SUSPEND                0x0002
+#define APM_NORMAL_RESUME      0x0003
+#define APM_CRITICAL_RESUME    0x0004
+#define APM_LOW_BATTERY                0x0005
+#define APM_POWER_STATUS_CHANGE        0x0006
+#define APM_UPDATE_TIME                0x0007
+#define APM_CRITICAL_SUSPEND   0x0008
+#define APM_USER_STANDBY       0x0009
+#define APM_USER_SUSPEND       0x000a
+#define APM_STANDBY_RESUME     0x000b
+#define APM_CAPABILITY_CHANGE  0x000c
+
+/*
+ * Error codes
+ */
+#define APM_SUCCESS            0x00
+#define APM_DISABLED           0x01
+#define APM_CONNECTED          0x02
+#define APM_NOT_CONNECTED      0x03
+#define APM_16_CONNECTED       0x05
+#define APM_16_UNSUPPORTED     0x06
+#define APM_32_CONNECTED       0x07
+#define APM_32_UNSUPPORTED     0x08
+#define APM_BAD_DEVICE         0x09
+#define APM_BAD_PARAM          0x0a
+#define APM_NOT_ENGAGED                0x0b
+#define APM_BAD_FUNCTION       0x0c
+#define APM_RESUME_DISABLED    0x0d
+#define APM_NO_ERROR           0x53
+#define APM_BAD_STATE          0x60
+#define APM_NO_EVENTS          0x80
+#define APM_NOT_PRESENT                0x86
+
+/*
+ * APM Device IDs
+ */
+#define APM_DEVICE_BIOS                0x0000
+#define APM_DEVICE_ALL         0x0001
+#define APM_DEVICE_DISPLAY     0x0100
+#define APM_DEVICE_STORAGE     0x0200
+#define APM_DEVICE_PARALLEL    0x0300
+#define APM_DEVICE_SERIAL      0x0400
+#define APM_DEVICE_NETWORK     0x0500
+#define APM_DEVICE_PCMCIA      0x0600
+#define APM_DEVICE_BATTERY     0x8000
+#define APM_DEVICE_OEM         0xe000
+#define APM_DEVICE_OLD_ALL     0xffff
+#define APM_DEVICE_CLASS       0x00ff
+#define APM_DEVICE_MASK                0xff00
+
+
+/*
+ * Battery status
+ */
+#define APM_MAX_BATTERIES      2
+
+/*
+ * APM defined capability bit flags
+ */
+#define APM_CAP_GLOBAL_STANDBY         0x0001
+#define APM_CAP_GLOBAL_SUSPEND         0x0002
+#define APM_CAP_RESUME_STANDBY_TIMER   0x0004 /* Timer resume from standby */
+#define APM_CAP_RESUME_SUSPEND_TIMER   0x0008 /* Timer resume from suspend */
+#define APM_CAP_RESUME_STANDBY_RING    0x0010 /* Resume on Ring fr standby */
+#define APM_CAP_RESUME_SUSPEND_RING    0x0020 /* Resume on Ring fr suspend */
+#define APM_CAP_RESUME_STANDBY_PCMCIA  0x0040 /* Resume on PCMCIA Ring */
+#define APM_CAP_RESUME_SUSPEND_PCMCIA  0x0080 /* Resume on PCMCIA Ring */
+
+/*
+ * ioctl operations
+ */
+#include <linux/ioctl.h>
+
+#define APM_IOC_STANDBY                _IO('A', 1)
+#define APM_IOC_SUSPEND                _IO('A', 2)
+
+#endif /* _UAPI_LINUX_APM_H */
diff --git a/include/uapi/linux/atalk.h b/include/uapi/linux/atalk.h
new file mode 100644 (file)
index 0000000..4bcd596
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _UAPI__LINUX_ATALK_H__
+#define _UAPI__LINUX_ATALK_H__
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <linux/socket.h>
+
+/*
+ * AppleTalk networking structures
+ *
+ * The following are directly referenced from the University Of Michigan
+ * netatalk for compatibility reasons.
+ */
+#define ATPORT_FIRST   1
+#define ATPORT_RESERVED        128
+#define ATPORT_LAST    254             /* 254 is only legal on localtalk */ 
+#define ATADDR_ANYNET  (__u16)0
+#define ATADDR_ANYNODE (__u8)0
+#define ATADDR_ANYPORT  (__u8)0
+#define ATADDR_BCAST   (__u8)255
+#define DDP_MAXSZ      587
+#define DDP_MAXHOPS     15             /* 4 bits of hop counter */
+
+#define SIOCATALKDIFADDR       (SIOCPROTOPRIVATE + 0)
+
+struct atalk_addr {
+       __be16  s_net;
+       __u8    s_node;
+};
+
+struct sockaddr_at {
+       __kernel_sa_family_t sat_family;
+       __u8              sat_port;
+       struct atalk_addr sat_addr;
+       char              sat_zero[8];
+};
+
+struct atalk_netrange {
+       __u8    nr_phase;
+       __be16  nr_firstnet;
+       __be16  nr_lastnet;
+};
+
+#endif /* _UAPI__LINUX_ATALK_H__ */
diff --git a/include/uapi/linux/atm.h b/include/uapi/linux/atm.h
new file mode 100644 (file)
index 0000000..88399db
--- /dev/null
@@ -0,0 +1,241 @@
+/* atm.h - general ATM declarations */
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+/*
+ * WARNING: User-space programs should not #include <linux/atm.h> directly.
+ *          Instead, #include <atm.h>
+ */
+
+#ifndef _UAPI_LINUX_ATM_H
+#define _UAPI_LINUX_ATM_H
+
+/*
+ * BEGIN_xx and END_xx markers are used for automatic generation of
+ * documentation. Do not change them.
+ */
+
+#include <linux/compiler.h>
+#include <linux/atmapi.h>
+#include <linux/atmsap.h>
+#include <linux/atmioc.h>
+#include <linux/types.h>
+
+
+/* general ATM constants */
+#define ATM_CELL_SIZE              53  /* ATM cell size incl. header */
+#define ATM_CELL_PAYLOAD           48  /* ATM payload size */
+#define ATM_AAL0_SDU               52  /* AAL0 SDU size */
+#define ATM_MAX_AAL34_PDU       65535  /* maximum AAL3/4 PDU payload */
+#define ATM_AAL5_TRAILER            8  /* AAL5 trailer size */
+#define ATM_MAX_AAL5_PDU        65535  /* maximum AAL5 PDU payload */
+#define ATM_MAX_CDV              9999  /* maximum (default) CDV */
+#define ATM_NOT_RSV_VCI                    32  /* first non-reserved VCI value */
+
+#define ATM_MAX_VPI               255  /* maximum VPI at the UNI */
+#define ATM_MAX_VPI_NNI                  4096  /* maximum VPI at the NNI */
+#define ATM_MAX_VCI             65535  /* maximum VCI */
+
+
+/* "protcol" values for the socket system call */
+#define ATM_NO_AAL     0               /* AAL not specified */
+#define ATM_AAL0       13              /* "raw" ATM cells */
+#define ATM_AAL1       1               /* AAL1 (CBR) */
+#define ATM_AAL2       2               /* AAL2 (VBR) */
+#define ATM_AAL34      3               /* AAL3/4 (data) */
+#define ATM_AAL5       5               /* AAL5 (data) */
+
+/*
+ * socket option name coding functions
+ *
+ * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
+ * << 22 only reserves 9 bits for the level.  On some architectures
+ * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
+ */
+
+#define __SO_ENCODE(l,n,t)     ((((l) & 0x1FF) << 22) | ((n) << 16) | \
+                               sizeof(t))
+#define __SO_LEVEL_MATCH(c,m)  (((c) >> 22) == ((m) & 0x1FF))
+#define __SO_NUMBER(c)         (((c) >> 16) & 0x3f)
+#define __SO_SIZE(c)           ((c) & 0x3fff)
+
+/*
+ * ATM layer
+ */
+
+#define SO_SETCLP      __SO_ENCODE(SOL_ATM,0,int)
+                           /* set CLP bit value - TODO */
+#define SO_CIRANGE     __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
+                           /* connection identifier range; socket must be
+                              bound or connected */
+#define SO_ATMQOS      __SO_ENCODE(SOL_ATM,2,struct atm_qos)
+                           /* Quality of Service setting */
+#define SO_ATMSAP      __SO_ENCODE(SOL_ATM,3,struct atm_sap)
+                           /* Service Access Point */
+#define SO_ATMPVC      __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
+                           /* "PVC" address (also for SVCs); get only */
+#define SO_MULTIPOINT  __SO_ENCODE(SOL_ATM, 5, int)
+                           /* make this vc a p2mp */
+
+
+/*
+ * Note @@@: since the socket layers don't really distinguish the control and
+ * the data plane but generally seems to be data plane-centric, any layer is
+ * about equally wrong for the SAP. If you have a better idea about this,
+ * please speak up ...
+ */
+
+
+/* ATM cell header (for AAL0) */
+
+/* BEGIN_CH */
+#define ATM_HDR_GFC_MASK       0xf0000000
+#define ATM_HDR_GFC_SHIFT      28
+#define ATM_HDR_VPI_MASK       0x0ff00000
+#define ATM_HDR_VPI_SHIFT      20
+#define ATM_HDR_VCI_MASK       0x000ffff0
+#define ATM_HDR_VCI_SHIFT      4
+#define ATM_HDR_PTI_MASK       0x0000000e
+#define ATM_HDR_PTI_SHIFT      1
+#define ATM_HDR_CLP            0x00000001
+/* END_CH */
+
+
+/* PTI codings */
+
+/* BEGIN_PTI */
+#define ATM_PTI_US0    0  /* user data cell, congestion not exp, SDU-type 0 */
+#define ATM_PTI_US1    1  /* user data cell, congestion not exp, SDU-type 1 */
+#define ATM_PTI_UCES0  2  /* user data cell, cong. experienced, SDU-type 0 */
+#define ATM_PTI_UCES1  3  /* user data cell, cong. experienced, SDU-type 1 */
+#define ATM_PTI_SEGF5  4  /* segment OAM F5 flow related cell */
+#define ATM_PTI_E2EF5  5  /* end-to-end OAM F5 flow related cell */
+#define ATM_PTI_RSV_RM 6  /* reserved for traffic control/resource mgmt */
+#define ATM_PTI_RSV    7  /* reserved */
+/* END_PTI */
+
+
+/*
+ * The following items should stay in linux/atm.h, which should be linked to
+ * netatm/atm.h
+ */
+
+/* Traffic description */
+
+#define ATM_NONE       0               /* no traffic */
+#define ATM_UBR                1
+#define ATM_CBR                2
+#define ATM_VBR                3
+#define ATM_ABR                4
+#define ATM_ANYCLASS   5               /* compatible with everything */
+
+#define ATM_MAX_PCR    -1              /* maximum available PCR */
+
+struct atm_trafprm {
+       unsigned char   traffic_class;  /* traffic class (ATM_UBR, ...) */
+       int             max_pcr;        /* maximum PCR in cells per second */
+       int             pcr;            /* desired PCR in cells per second */
+       int             min_pcr;        /* minimum PCR in cells per second */
+       int             max_cdv;        /* maximum CDV in microseconds */
+       int             max_sdu;        /* maximum SDU in bytes */
+        /* extra params for ABR */
+        unsigned int   icr;            /* Initial Cell Rate (24-bit) */
+        unsigned int   tbe;            /* Transient Buffer Exposure (24-bit) */ 
+        unsigned int   frtt : 24;      /* Fixed Round Trip Time (24-bit) */
+        unsigned int   rif  : 4;       /* Rate Increment Factor (4-bit) */
+        unsigned int   rdf  : 4;       /* Rate Decrease Factor (4-bit) */
+        unsigned int nrm_pres  :1;      /* nrm present bit */
+        unsigned int trm_pres  :1;             /* rm present bit */
+        unsigned int adtf_pres :1;             /* adtf present bit */
+        unsigned int cdf_pres  :1;     /* cdf present bit*/
+        unsigned int nrm       :3;             /* Max # of Cells for each forward RM cell (3-bit) */
+        unsigned int trm       :3;     /* Time between forward RM cells (3-bit) */    
+       unsigned int adtf      :10;     /* ACR Decrease Time Factor (10-bit) */
+       unsigned int cdf       :3;      /* Cutoff Decrease Factor (3-bit) */
+        unsigned int spare     :9;      /* spare bits */ 
+};
+
+struct atm_qos {
+       struct atm_trafprm txtp;        /* parameters in TX direction */
+       struct atm_trafprm rxtp __ATM_API_ALIGN;
+                                       /* parameters in RX direction */
+       unsigned char aal __ATM_API_ALIGN;
+};
+
+/* PVC addressing */
+
+#define ATM_ITF_ANY    -1              /* "magic" PVC address values */
+#define ATM_VPI_ANY    -1
+#define ATM_VCI_ANY    -1
+#define ATM_VPI_UNSPEC -2
+#define ATM_VCI_UNSPEC -2
+
+
+struct sockaddr_atmpvc {
+       unsigned short  sap_family;     /* address family, AF_ATMPVC  */
+       struct {                        /* PVC address */
+               short   itf;            /* ATM interface */
+               short   vpi;            /* VPI (only 8 bits at UNI) */
+               int     vci;            /* VCI (only 16 bits at UNI) */
+       } sap_addr __ATM_API_ALIGN;     /* PVC address */
+};
+
+/* SVC addressing */
+
+#define        ATM_ESA_LEN     20              /* ATM End System Address length */
+#define ATM_E164_LEN   12              /* maximum E.164 number length */
+
+#define ATM_AFI_DCC    0x39            /* DCC ATM Format */
+#define ATM_AFI_ICD    0x47            /* ICD ATM Format */
+#define ATM_AFI_E164   0x45            /* E.164 ATM Format */
+#define ATM_AFI_LOCAL  0x49            /* Local ATM Format */ 
+
+#define ATM_AFI_DCC_GROUP      0xBD    /* DCC ATM Group Format */
+#define ATM_AFI_ICD_GROUP      0xC5    /* ICD ATM Group Format */
+#define ATM_AFI_E164_GROUP     0xC3    /* E.164 ATM Group Format */
+#define ATM_AFI_LOCAL_GROUP    0xC7    /* Local ATM Group Format */
+
+#define ATM_LIJ_NONE   0               /* no leaf-initiated join */
+#define ATM_LIJ                1               /* request joining */
+#define ATM_LIJ_RPJ    2               /* set to root-prompted join */
+#define ATM_LIJ_NJ     3               /* set to network join */
+
+
+struct sockaddr_atmsvc {
+    unsigned short     sas_family;     /* address family, AF_ATMSVC */
+    struct {                           /* SVC address */
+        unsigned char  prv[ATM_ESA_LEN];/* private ATM address */
+        char           pub[ATM_E164_LEN+1]; /* public address (E.164) */
+                                       /* unused addresses must be bzero'ed */
+       char            lij_type;       /* role in LIJ call; one of ATM_LIJ* */
+       __u32   lij_id;         /* LIJ call identifier */
+    } sas_addr __ATM_API_ALIGN;                /* SVC address */
+};
+
+
+static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
+{
+       return *addr.sas_addr.prv || *addr.sas_addr.pub;
+}
+
+
+static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
+{
+       return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
+}
+
+
+/*
+ * Some stuff for linux/sockios.h
+ */
+
+struct atmif_sioc {
+       int number;
+       int length;
+       void __user *arg;
+};
+
+
+typedef unsigned short atm_backend_t;
+#endif /* _UAPI_LINUX_ATM_H */
diff --git a/include/uapi/linux/atm_tcp.h b/include/uapi/linux/atm_tcp.h
new file mode 100644 (file)
index 0000000..914e821
--- /dev/null
@@ -0,0 +1,61 @@
+/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by
+              driver-specific utilities) */
+
+/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef _UAPILINUX_ATM_TCP_H
+#define _UAPILINUX_ATM_TCP_H
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+#include <linux/types.h>
+
+
+/*
+ * All values in struct atmtcp_hdr are in network byte order
+ */
+
+struct atmtcp_hdr {
+       __u16   vpi;
+       __u16   vci;
+       __u32   length;         /* ... of data part */
+};
+
+/*
+ * All values in struct atmtcp_command are in host byte order
+ */
+
+#define ATMTCP_HDR_MAGIC       (~0)    /* this length indicates a command */
+#define ATMTCP_CTRL_OPEN       1       /* request/reply */
+#define ATMTCP_CTRL_CLOSE      2       /* request/reply */
+
+struct atmtcp_control {
+       struct atmtcp_hdr hdr;  /* must be first */
+       int type;               /* message type; both directions */
+       atm_kptr_t vcc;         /* both directions */
+       struct sockaddr_atmpvc addr; /* suggested value from kernel */
+       struct atm_qos  qos;    /* both directions */
+       int result;             /* to kernel only */
+} __ATM_API_ALIGN;
+
+/*
+ * Field usage:
+ * Messge type dir.    hdr.v?i type    addr    qos     vcc     result
+ * -----------  ----   ------- ----    ----    ---     ---     ------
+ * OPEN                K->D    Y       Y       Y       Y       Y       0
+ * OPEN                D->K    -       Y       Y       Y       Y       Y
+ * CLOSE       K->D    -       -       Y       -       Y       0
+ * CLOSE       D->K    -       -       -       -       Y       Y
+ */
+
+#define SIOCSIFATMTCP  _IO('a',ATMIOC_ITF)     /* set ATMTCP mode */
+#define ATMTCP_CREATE  _IO('a',ATMIOC_ITF+14)  /* create persistent ATMTCP
+                                                  interface */
+#define ATMTCP_REMOVE  _IO('a',ATMIOC_ITF+15)  /* destroy persistent ATMTCP
+                                                  interface */
+
+
+
+#endif /* _UAPILINUX_ATM_TCP_H */
diff --git a/include/uapi/linux/atmdev.h b/include/uapi/linux/atmdev.h
new file mode 100644 (file)
index 0000000..93e0ec0
--- /dev/null
@@ -0,0 +1,215 @@
+/* atmdev.h - ATM device driver declarations and various related items */
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+#ifndef _UAPILINUX_ATMDEV_H
+#define _UAPILINUX_ATMDEV_H
+
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+
+#define ESI_LEN                6
+
+#define ATM_OC3_PCR    (155520000/270*260/8/53)
+                       /* OC3 link rate:  155520000 bps
+                          SONET overhead: /270*260 (9 section, 1 path)
+                          bits per cell:  /8/53
+                          max cell rate:  353207.547 cells/sec */
+#define ATM_25_PCR     ((25600000/8-8000)/54)
+                       /* 25 Mbps ATM cell rate (59111) */
+#define ATM_OC12_PCR   (622080000/1080*1040/8/53)
+                       /* OC12 link rate: 622080000 bps
+                          SONET overhead: /1080*1040
+                          bits per cell:  /8/53
+                          max cell rate:  1412830.188 cells/sec */
+#define ATM_DS3_PCR    (8000*12)
+                       /* DS3: 12 cells in a 125 usec time slot */
+
+
+#define __AAL_STAT_ITEMS \
+    __HANDLE_ITEM(tx);                 /* TX okay */ \
+    __HANDLE_ITEM(tx_err);             /* TX errors */ \
+    __HANDLE_ITEM(rx);                 /* RX okay */ \
+    __HANDLE_ITEM(rx_err);             /* RX errors */ \
+    __HANDLE_ITEM(rx_drop);            /* RX out of memory */
+
+struct atm_aal_stats {
+#define __HANDLE_ITEM(i) int i
+       __AAL_STAT_ITEMS
+#undef __HANDLE_ITEM
+};
+
+
+struct atm_dev_stats {
+       struct atm_aal_stats aal0;
+       struct atm_aal_stats aal34;
+       struct atm_aal_stats aal5;
+} __ATM_API_ALIGN;
+
+
+#define ATM_GETLINKRATE        _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
+                                       /* get link rate */
+#define ATM_GETNAMES   _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
+                                       /* get interface names (numbers) */
+#define ATM_GETTYPE    _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
+                                       /* get interface type name */
+#define ATM_GETESI     _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
+                                       /* get interface ESI */
+#define ATM_GETADDR    _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
+                                       /* get itf's local ATM addr. list */
+#define ATM_RSTADDR    _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
+                                       /* reset itf's ATM address list */
+#define ATM_ADDADDR    _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
+                                       /* add a local ATM address */
+#define ATM_DELADDR    _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
+                                       /* remove a local ATM address */
+#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
+                                       /* get connection identifier range */
+#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
+                                       /* set connection identifier range */
+#define ATM_SETESI     _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
+                                       /* set interface ESI */
+#define ATM_SETESIF    _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
+                                       /* force interface ESI */
+#define ATM_ADDLECSADDR        _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
+                                       /* register a LECS address */
+#define ATM_DELLECSADDR        _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
+                                       /* unregister a LECS address */
+#define ATM_GETLECSADDR        _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
+                                       /* retrieve LECS address(es) */
+
+#define ATM_GETSTAT    _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
+                                       /* get AAL layer statistics */
+#define ATM_GETSTATZ   _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
+                                       /* get AAL layer statistics and zero */
+#define ATM_GETLOOP    _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
+                                       /* get loopback mode */
+#define ATM_SETLOOP    _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
+                                       /* set loopback mode */
+#define ATM_QUERYLOOP  _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
+                                       /* query supported loopback modes */
+#define ATM_SETSC      _IOW('a',ATMIOC_SPECIAL+1,int)
+                                       /* enable or disable single-copy */
+#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+                                       /* set backend handler */
+#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
+                                       /* use backend to make new if */
+#define ATM_ADDPARTY   _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
+                                       /* add party to p2mp call */
+#ifdef CONFIG_COMPAT
+/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
+#define COMPAT_ATM_ADDPARTY    _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
+#endif
+#define ATM_DROPPARTY  _IOW('a', ATMIOC_SPECIAL+5,int)
+                                       /* drop party from p2mp call */
+
+/*
+ * These are backend handkers that can be set via the ATM_SETBACKEND call
+ * above.  In the future we may support dynamic loading of these - for now,
+ * they're just being used to share the ATMIOC_BACKEND ioctls
+ */
+#define ATM_BACKEND_RAW                0       
+#define ATM_BACKEND_PPP                1       /* PPPoATM - RFC2364 */
+#define ATM_BACKEND_BR2684     2       /* Bridged RFC1483/2684 */
+
+/* for ATM_GETTYPE */
+#define ATM_ITFTYP_LEN 8       /* maximum length of interface type name */
+
+/*
+ * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
+ */
+
+/* Point of loopback                           CPU-->SAR-->PHY-->line--> ... */
+#define __ATM_LM_NONE  0       /* no loop back     ^     ^     ^      ^      */
+#define __ATM_LM_AAL   1       /* loop back PDUs --'     |     |      |      */
+#define __ATM_LM_ATM   2       /* loop back ATM cells ---'     |      |      */
+/* RESERVED            4       loop back on PHY side  ---'                   */
+#define __ATM_LM_PHY   8       /* loop back bits (digital) ----'      |      */
+#define __ATM_LM_ANALOG 16     /* loop back the analog signal --------'      */
+
+/* Direction of loopback */
+#define __ATM_LM_MKLOC(n)      ((n))       /* Local (i.e. loop TX to RX) */
+#define __ATM_LM_MKRMT(n)      ((n) << 8)  /* Remote (i.e. loop RX to TX) */
+
+#define __ATM_LM_XTLOC(n)      ((n) & 0xff)
+#define __ATM_LM_XTRMT(n)      (((n) >> 8) & 0xff)
+
+#define ATM_LM_NONE    0       /* no loopback */
+
+#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
+#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
+#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
+#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
+
+#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
+#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
+#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
+#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
+
+/*
+ * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
+ * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
+ */
+
+
+struct atm_iobuf {
+       int length;
+       void __user *buffer;
+};
+
+/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
+
+#define ATM_CI_MAX      -1              /* use maximum range of VPI/VCI */
+struct atm_cirange {
+       signed char     vpi_bits;       /* 1..8, ATM_CI_MAX (-1) for maximum */
+       signed char     vci_bits;       /* 1..16, ATM_CI_MAX (-1) for maximum */
+};
+
+/* for ATM_SETSC; actually taken from the ATM_VF number space */
+
+#define ATM_SC_RX      1024            /* enable RX single-copy */
+#define ATM_SC_TX      2048            /* enable TX single-copy */
+
+#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
+                                 anyway */
+
+/* MF: change_qos (Modify) flags */
+
+#define ATM_MF_IMMED    1      /* Block until change is effective */
+#define ATM_MF_INC_RSV  2      /* Change reservation on increase */
+#define ATM_MF_INC_SHP  4      /* Change shaping on increase */
+#define ATM_MF_DEC_RSV  8      /* Change reservation on decrease */
+#define ATM_MF_DEC_SHP 16      /* Change shaping on decrease */
+#define ATM_MF_BWD     32      /* Set the backward direction parameters */
+
+#define ATM_MF_SET     (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
+                         ATM_MF_DEC_SHP | ATM_MF_BWD)
+
+/*
+ * ATM_VS_* are used to express VC state in a human-friendly way.
+ */
+
+#define ATM_VS_IDLE    0       /* VC is not used */
+#define ATM_VS_CONNECTED 1     /* VC is connected */
+#define ATM_VS_CLOSING 2       /* VC is closing */
+#define ATM_VS_LISTEN  3       /* VC is listening for incoming setups */
+#define ATM_VS_INUSE   4       /* VC is in use (registered with atmsigd) */
+#define ATM_VS_BOUND   5       /* VC is bound */
+
+#define ATM_VS2TXT_MAP \
+    "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
+
+#define ATM_VF2TXT_MAP \
+    "ADDR",    "READY",        "PARTIAL",      "REGIS", \
+    "RELEASED", "HASQOS",      "LISTEN",       "META", \
+    "256",     "512",          "1024",         "2048", \
+    "SESSION", "HASSAP",       "BOUND",        "CLOSE"
+
+
+
+#endif /* _UAPILINUX_ATMDEV_H */
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
new file mode 100644 (file)
index 0000000..76352ac
--- /dev/null
@@ -0,0 +1,404 @@
+/* audit.h -- Auditing support
+ *
+ * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Written by Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+#ifndef _UAPI_LINUX_AUDIT_H_
+#define _UAPI_LINUX_AUDIT_H_
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+#include <linux/ptrace.h>
+
+/* The netlink messages for the audit system is divided into blocks:
+ * 1000 - 1099 are for commanding the audit system
+ * 1100 - 1199 user space trusted application messages
+ * 1200 - 1299 messages internal to the audit daemon
+ * 1300 - 1399 audit event messages
+ * 1400 - 1499 SE Linux use
+ * 1500 - 1599 kernel LSPP events
+ * 1600 - 1699 kernel crypto events
+ * 1700 - 1799 kernel anomaly records
+ * 1800 - 1899 kernel integrity events
+ * 1900 - 1999 future kernel use
+ * 2000 is for otherwise unclassified kernel audit messages (legacy)
+ * 2001 - 2099 unused (kernel)
+ * 2100 - 2199 user space anomaly records
+ * 2200 - 2299 user space actions taken in response to anomalies
+ * 2300 - 2399 user space generated LSPP events
+ * 2400 - 2499 user space crypto events
+ * 2500 - 2999 future user space (maybe integrity labels and related events)
+ *
+ * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
+ * exclusively user space. 1300-2099 is kernel --> user space 
+ * communication.
+ */
+#define AUDIT_GET              1000    /* Get status */
+#define AUDIT_SET              1001    /* Set status (enable/disable/auditd) */
+#define AUDIT_LIST             1002    /* List syscall rules -- deprecated */
+#define AUDIT_ADD              1003    /* Add syscall rule -- deprecated */
+#define AUDIT_DEL              1004    /* Delete syscall rule -- deprecated */
+#define AUDIT_USER             1005    /* Message from userspace -- deprecated */
+#define AUDIT_LOGIN            1006    /* Define the login id and information */
+#define AUDIT_WATCH_INS                1007    /* Insert file/dir watch entry */
+#define AUDIT_WATCH_REM                1008    /* Remove file/dir watch entry */
+#define AUDIT_WATCH_LIST       1009    /* List all file/dir watches */
+#define AUDIT_SIGNAL_INFO      1010    /* Get info about sender of signal to auditd */
+#define AUDIT_ADD_RULE         1011    /* Add syscall filtering rule */
+#define AUDIT_DEL_RULE         1012    /* Delete syscall filtering rule */
+#define AUDIT_LIST_RULES       1013    /* List syscall filtering rules */
+#define AUDIT_TRIM             1014    /* Trim junk from watched tree */
+#define AUDIT_MAKE_EQUIV       1015    /* Append to watched tree */
+#define AUDIT_TTY_GET          1016    /* Get TTY auditing status */
+#define AUDIT_TTY_SET          1017    /* Set TTY auditing status */
+
+#define AUDIT_FIRST_USER_MSG   1100    /* Userspace messages mostly uninteresting to kernel */
+#define AUDIT_USER_AVC         1107    /* We filter this differently */
+#define AUDIT_USER_TTY         1124    /* Non-ICANON TTY input meaning */
+#define AUDIT_LAST_USER_MSG    1199
+#define AUDIT_FIRST_USER_MSG2  2100    /* More user space messages */
+#define AUDIT_LAST_USER_MSG2   2999
+#define AUDIT_DAEMON_START      1200    /* Daemon startup record */
+#define AUDIT_DAEMON_END        1201    /* Daemon normal stop record */
+#define AUDIT_DAEMON_ABORT      1202    /* Daemon error stop record */
+#define AUDIT_DAEMON_CONFIG     1203    /* Daemon config change */
+
+#define AUDIT_SYSCALL          1300    /* Syscall event */
+/* #define AUDIT_FS_WATCH      1301     * Deprecated */
+#define AUDIT_PATH             1302    /* Filename path information */
+#define AUDIT_IPC              1303    /* IPC record */
+#define AUDIT_SOCKETCALL       1304    /* sys_socketcall arguments */
+#define AUDIT_CONFIG_CHANGE    1305    /* Audit system configuration change */
+#define AUDIT_SOCKADDR         1306    /* sockaddr copied as syscall arg */
+#define AUDIT_CWD              1307    /* Current working directory */
+#define AUDIT_EXECVE           1309    /* execve arguments */
+#define AUDIT_IPC_SET_PERM     1311    /* IPC new permissions record type */
+#define AUDIT_MQ_OPEN          1312    /* POSIX MQ open record type */
+#define AUDIT_MQ_SENDRECV      1313    /* POSIX MQ send/receive record type */
+#define AUDIT_MQ_NOTIFY                1314    /* POSIX MQ notify record type */
+#define AUDIT_MQ_GETSETATTR    1315    /* POSIX MQ get/set attribute record type */
+#define AUDIT_KERNEL_OTHER     1316    /* For use by 3rd party modules */
+#define AUDIT_FD_PAIR          1317    /* audit record for pipe/socketpair */
+#define AUDIT_OBJ_PID          1318    /* ptrace target */
+#define AUDIT_TTY              1319    /* Input on an administrative TTY */
+#define AUDIT_EOE              1320    /* End of multi-record event */
+#define AUDIT_BPRM_FCAPS       1321    /* Information about fcaps increasing perms */
+#define AUDIT_CAPSET           1322    /* Record showing argument to sys_capset */
+#define AUDIT_MMAP             1323    /* Record showing descriptor and flags in mmap */
+#define AUDIT_NETFILTER_PKT    1324    /* Packets traversing netfilter chains */
+#define AUDIT_NETFILTER_CFG    1325    /* Netfilter chain modifications */
+
+#define AUDIT_AVC              1400    /* SE Linux avc denial or grant */
+#define AUDIT_SELINUX_ERR      1401    /* Internal SE Linux Errors */
+#define AUDIT_AVC_PATH         1402    /* dentry, vfsmount pair from avc */
+#define AUDIT_MAC_POLICY_LOAD  1403    /* Policy file load */
+#define AUDIT_MAC_STATUS       1404    /* Changed enforcing,permissive,off */
+#define AUDIT_MAC_CONFIG_CHANGE        1405    /* Changes to booleans */
+#define AUDIT_MAC_UNLBL_ALLOW  1406    /* NetLabel: allow unlabeled traffic */
+#define AUDIT_MAC_CIPSOV4_ADD  1407    /* NetLabel: add CIPSOv4 DOI entry */
+#define AUDIT_MAC_CIPSOV4_DEL  1408    /* NetLabel: del CIPSOv4 DOI entry */
+#define AUDIT_MAC_MAP_ADD      1409    /* NetLabel: add LSM domain mapping */
+#define AUDIT_MAC_MAP_DEL      1410    /* NetLabel: del LSM domain mapping */
+#define AUDIT_MAC_IPSEC_ADDSA  1411    /* Not used */
+#define AUDIT_MAC_IPSEC_DELSA  1412    /* Not used  */
+#define AUDIT_MAC_IPSEC_ADDSPD 1413    /* Not used */
+#define AUDIT_MAC_IPSEC_DELSPD 1414    /* Not used */
+#define AUDIT_MAC_IPSEC_EVENT  1415    /* Audit an IPSec event */
+#define AUDIT_MAC_UNLBL_STCADD 1416    /* NetLabel: add a static label */
+#define AUDIT_MAC_UNLBL_STCDEL 1417    /* NetLabel: del a static label */
+
+#define AUDIT_FIRST_KERN_ANOM_MSG   1700
+#define AUDIT_LAST_KERN_ANOM_MSG    1799
+#define AUDIT_ANOM_PROMISCUOUS      1700 /* Device changed promiscuous mode */
+#define AUDIT_ANOM_ABEND            1701 /* Process ended abnormally */
+#define AUDIT_ANOM_LINK                    1702 /* Suspicious use of file links */
+#define AUDIT_INTEGRITY_DATA       1800 /* Data integrity verification */
+#define AUDIT_INTEGRITY_METADATA    1801 /* Metadata integrity verification */
+#define AUDIT_INTEGRITY_STATUS     1802 /* Integrity enable status */
+#define AUDIT_INTEGRITY_HASH       1803 /* Integrity HASH type */
+#define AUDIT_INTEGRITY_PCR        1804 /* PCR invalidation msgs */
+#define AUDIT_INTEGRITY_RULE       1805 /* policy rule */
+
+#define AUDIT_KERNEL           2000    /* Asynchronous audit record. NOT A REQUEST. */
+
+/* Rule flags */
+#define AUDIT_FILTER_USER      0x00    /* Apply rule to user-generated messages */
+#define AUDIT_FILTER_TASK      0x01    /* Apply rule at task creation (not syscall) */
+#define AUDIT_FILTER_ENTRY     0x02    /* Apply rule at syscall entry */
+#define AUDIT_FILTER_WATCH     0x03    /* Apply rule to file system watches */
+#define AUDIT_FILTER_EXIT      0x04    /* Apply rule at syscall exit */
+#define AUDIT_FILTER_TYPE      0x05    /* Apply rule at audit_log_start */
+
+#define AUDIT_NR_FILTERS       6
+
+#define AUDIT_FILTER_PREPEND   0x10    /* Prepend to front of list */
+
+/* Rule actions */
+#define AUDIT_NEVER    0       /* Do not build context if rule matches */
+#define AUDIT_POSSIBLE 1       /* Build context if rule matches  */
+#define AUDIT_ALWAYS   2       /* Generate audit record if rule matches */
+
+/* Rule structure sizes -- if these change, different AUDIT_ADD and
+ * AUDIT_LIST commands must be implemented. */
+#define AUDIT_MAX_FIELDS   64
+#define AUDIT_MAX_KEY_LEN  256
+#define AUDIT_BITMASK_SIZE 64
+#define AUDIT_WORD(nr) ((__u32)((nr)/32))
+#define AUDIT_BIT(nr)  (1 << ((nr) - AUDIT_WORD(nr)*32))
+
+#define AUDIT_SYSCALL_CLASSES 16
+#define AUDIT_CLASS_DIR_WRITE 0
+#define AUDIT_CLASS_DIR_WRITE_32 1
+#define AUDIT_CLASS_CHATTR 2
+#define AUDIT_CLASS_CHATTR_32 3
+#define AUDIT_CLASS_READ 4
+#define AUDIT_CLASS_READ_32 5
+#define AUDIT_CLASS_WRITE 6
+#define AUDIT_CLASS_WRITE_32 7
+#define AUDIT_CLASS_SIGNAL 8
+#define AUDIT_CLASS_SIGNAL_32 9
+
+/* This bitmask is used to validate user input.  It represents all bits that
+ * are currently used in an audit field constant understood by the kernel.
+ * If you are adding a new #define AUDIT_<whatever>, please ensure that
+ * AUDIT_UNUSED_BITS is updated if need be. */
+#define AUDIT_UNUSED_BITS      0x07FFFC00
+
+/* AUDIT_FIELD_COMPARE rule list */
+#define AUDIT_COMPARE_UID_TO_OBJ_UID   1
+#define AUDIT_COMPARE_GID_TO_OBJ_GID   2
+#define AUDIT_COMPARE_EUID_TO_OBJ_UID  3
+#define AUDIT_COMPARE_EGID_TO_OBJ_GID  4
+#define AUDIT_COMPARE_AUID_TO_OBJ_UID  5
+#define AUDIT_COMPARE_SUID_TO_OBJ_UID  6
+#define AUDIT_COMPARE_SGID_TO_OBJ_GID  7
+#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
+#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
+
+#define AUDIT_COMPARE_UID_TO_AUID      10
+#define AUDIT_COMPARE_UID_TO_EUID      11
+#define AUDIT_COMPARE_UID_TO_FSUID     12
+#define AUDIT_COMPARE_UID_TO_SUID      13
+
+#define AUDIT_COMPARE_AUID_TO_FSUID    14
+#define AUDIT_COMPARE_AUID_TO_SUID     15
+#define AUDIT_COMPARE_AUID_TO_EUID     16
+
+#define AUDIT_COMPARE_EUID_TO_SUID     17
+#define AUDIT_COMPARE_EUID_TO_FSUID    18
+
+#define AUDIT_COMPARE_SUID_TO_FSUID    19
+
+#define AUDIT_COMPARE_GID_TO_EGID      20
+#define AUDIT_COMPARE_GID_TO_FSGID     21
+#define AUDIT_COMPARE_GID_TO_SGID      22
+
+#define AUDIT_COMPARE_EGID_TO_FSGID    23
+#define AUDIT_COMPARE_EGID_TO_SGID     24
+#define AUDIT_COMPARE_SGID_TO_FSGID    25
+
+#define AUDIT_MAX_FIELD_COMPARE                AUDIT_COMPARE_SGID_TO_FSGID
+
+/* Rule fields */
+                               /* These are useful when checking the
+                                * task structure at task creation time
+                                * (AUDIT_PER_TASK).  */
+#define AUDIT_PID      0
+#define AUDIT_UID      1
+#define AUDIT_EUID     2
+#define AUDIT_SUID     3
+#define AUDIT_FSUID    4
+#define AUDIT_GID      5
+#define AUDIT_EGID     6
+#define AUDIT_SGID     7
+#define AUDIT_FSGID    8
+#define AUDIT_LOGINUID 9
+#define AUDIT_PERS     10
+#define AUDIT_ARCH     11
+#define AUDIT_MSGTYPE  12
+#define AUDIT_SUBJ_USER        13      /* security label user */
+#define AUDIT_SUBJ_ROLE        14      /* security label role */
+#define AUDIT_SUBJ_TYPE        15      /* security label type */
+#define AUDIT_SUBJ_SEN 16      /* security label sensitivity label */
+#define AUDIT_SUBJ_CLR 17      /* security label clearance label */
+#define AUDIT_PPID     18
+#define AUDIT_OBJ_USER 19
+#define AUDIT_OBJ_ROLE 20
+#define AUDIT_OBJ_TYPE 21
+#define AUDIT_OBJ_LEV_LOW      22
+#define AUDIT_OBJ_LEV_HIGH     23
+
+                               /* These are ONLY useful when checking
+                                * at syscall exit time (AUDIT_AT_EXIT). */
+#define AUDIT_DEVMAJOR 100
+#define AUDIT_DEVMINOR 101
+#define AUDIT_INODE    102
+#define AUDIT_EXIT     103
+#define AUDIT_SUCCESS   104    /* exit >= 0; value ignored */
+#define AUDIT_WATCH    105
+#define AUDIT_PERM     106
+#define AUDIT_DIR      107
+#define AUDIT_FILETYPE 108
+#define AUDIT_OBJ_UID  109
+#define AUDIT_OBJ_GID  110
+#define AUDIT_FIELD_COMPARE    111
+
+#define AUDIT_ARG0      200
+#define AUDIT_ARG1      (AUDIT_ARG0+1)
+#define AUDIT_ARG2      (AUDIT_ARG0+2)
+#define AUDIT_ARG3      (AUDIT_ARG0+3)
+
+#define AUDIT_FILTERKEY        210
+
+#define AUDIT_NEGATE                   0x80000000
+
+/* These are the supported operators.
+ *     4  2  1  8
+ *     =  >  <  ?
+ *     ----------
+ *     0  0  0  0      00      nonsense
+ *     0  0  0  1      08      &  bit mask
+ *     0  0  1  0      10      <
+ *     0  1  0  0      20      >
+ *     0  1  1  0      30      !=
+ *     1  0  0  0      40      =
+ *     1  0  0  1      48      &=  bit test
+ *     1  0  1  0      50      <=
+ *     1  1  0  0      60      >=
+ *     1  1  1  1      78      all operators
+ */
+#define AUDIT_BIT_MASK                 0x08000000
+#define AUDIT_LESS_THAN                        0x10000000
+#define AUDIT_GREATER_THAN             0x20000000
+#define AUDIT_NOT_EQUAL                        0x30000000
+#define AUDIT_EQUAL                    0x40000000
+#define AUDIT_BIT_TEST                 (AUDIT_BIT_MASK|AUDIT_EQUAL)
+#define AUDIT_LESS_THAN_OR_EQUAL       (AUDIT_LESS_THAN|AUDIT_EQUAL)
+#define AUDIT_GREATER_THAN_OR_EQUAL    (AUDIT_GREATER_THAN|AUDIT_EQUAL)
+#define AUDIT_OPERATORS                        (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
+
+enum {
+       Audit_equal,
+       Audit_not_equal,
+       Audit_bitmask,
+       Audit_bittest,
+       Audit_lt,
+       Audit_gt,
+       Audit_le,
+       Audit_ge,
+       Audit_bad
+};
+
+/* Status symbols */
+                               /* Mask values */
+#define AUDIT_STATUS_ENABLED           0x0001
+#define AUDIT_STATUS_FAILURE           0x0002
+#define AUDIT_STATUS_PID               0x0004
+#define AUDIT_STATUS_RATE_LIMIT                0x0008
+#define AUDIT_STATUS_BACKLOG_LIMIT     0x0010
+                               /* Failure-to-log actions */
+#define AUDIT_FAIL_SILENT      0
+#define AUDIT_FAIL_PRINTK      1
+#define AUDIT_FAIL_PANIC       2
+
+/* distinguish syscall tables */
+#define __AUDIT_ARCH_64BIT 0x80000000
+#define __AUDIT_ARCH_LE           0x40000000
+#define AUDIT_ARCH_ALPHA       (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARM         (EM_ARM|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARMEB       (EM_ARM)
+#define AUDIT_ARCH_CRIS                (EM_CRIS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_FRV         (EM_FRV)
+#define AUDIT_ARCH_H8300       (EM_H8_300)
+#define AUDIT_ARCH_I386                (EM_386|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_IA64                (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_M32R                (EM_M32R)
+#define AUDIT_ARCH_M68K                (EM_68K)
+#define AUDIT_ARCH_MIPS                (EM_MIPS)
+#define AUDIT_ARCH_MIPSEL      (EM_MIPS|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_MIPS64      (EM_MIPS|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_MIPSEL64    (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_OPENRISC    (EM_OPENRISC)
+#define AUDIT_ARCH_PARISC      (EM_PARISC)
+#define AUDIT_ARCH_PARISC64    (EM_PARISC|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_PPC         (EM_PPC)
+#define AUDIT_ARCH_PPC64       (EM_PPC64|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_S390                (EM_S390)
+#define AUDIT_ARCH_S390X       (EM_S390|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SH          (EM_SH)
+#define AUDIT_ARCH_SHEL                (EM_SH|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SH64                (EM_SH|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_SHEL64      (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_SPARC       (EM_SPARC)
+#define AUDIT_ARCH_SPARC64     (EM_SPARCV9|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_X86_64      (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+
+#define AUDIT_PERM_EXEC                1
+#define AUDIT_PERM_WRITE       2
+#define AUDIT_PERM_READ                4
+#define AUDIT_PERM_ATTR                8
+
+struct audit_status {
+       __u32           mask;           /* Bit mask for valid entries */
+       __u32           enabled;        /* 1 = enabled, 0 = disabled */
+       __u32           failure;        /* Failure-to-log action */
+       __u32           pid;            /* pid of auditd process */
+       __u32           rate_limit;     /* messages rate limit (per second) */
+       __u32           backlog_limit;  /* waiting messages limit */
+       __u32           lost;           /* messages lost */
+       __u32           backlog;        /* messages waiting in queue */
+};
+
+struct audit_tty_status {
+       __u32           enabled; /* 1 = enabled, 0 = disabled */
+};
+
+/* audit_rule_data supports filter rules with both integer and string
+ * fields.  It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
+ * AUDIT_LIST_RULES requests.
+ */
+struct audit_rule_data {
+       __u32           flags;  /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+       __u32           action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+       __u32           field_count;
+       __u32           mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
+       __u32           fields[AUDIT_MAX_FIELDS];
+       __u32           values[AUDIT_MAX_FIELDS];
+       __u32           fieldflags[AUDIT_MAX_FIELDS];
+       __u32           buflen; /* total length of string fields */
+       char            buf[0]; /* string fields buffer */
+};
+
+/* audit_rule is supported to maintain backward compatibility with
+ * userspace.  It supports integer fields only and corresponds to
+ * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
+ */
+struct audit_rule {            /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
+       __u32           flags;  /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
+       __u32           action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
+       __u32           field_count;
+       __u32           mask[AUDIT_BITMASK_SIZE];
+       __u32           fields[AUDIT_MAX_FIELDS];
+       __u32           values[AUDIT_MAX_FIELDS];
+};
+
+#endif /* _UAPI_LINUX_AUDIT_H_ */
diff --git a/include/uapi/linux/auto_fs.h b/include/uapi/linux/auto_fs.h
new file mode 100644 (file)
index 0000000..77cdba9
--- /dev/null
@@ -0,0 +1,83 @@
+/* -*- linux-c -*- ------------------------------------------------------- *
+ *   
+ * linux/include/linux/auto_fs.h
+ *
+ *   Copyright 1997 Transmeta Corporation - All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+
+#ifndef _UAPI_LINUX_AUTO_FS_H
+#define _UAPI_LINUX_AUTO_FS_H
+
+#include <linux/types.h>
+#ifndef __KERNEL__
+#include <sys/ioctl.h>
+#endif /* __KERNEL__ */
+
+
+/* This file describes autofs v3 */
+#define AUTOFS_PROTO_VERSION   3
+
+/* Range of protocol versions defined */
+#define AUTOFS_MAX_PROTO_VERSION       AUTOFS_PROTO_VERSION
+#define AUTOFS_MIN_PROTO_VERSION       AUTOFS_PROTO_VERSION
+
+/*
+ * Architectures where both 32- and 64-bit binaries can be executed
+ * on 64-bit kernels need this.  This keeps the structure format
+ * uniform, and makes sure the wait_queue_token isn't too big to be
+ * passed back down to the kernel.
+ *
+ * This assumes that on these architectures:
+ * mode     32 bit    64 bit
+ * -------------------------
+ * int      32 bit    32 bit
+ * long     32 bit    64 bit
+ *
+ * If so, 32-bit user-space code should be backwards compatible.
+ */
+
+#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
+ || defined(__powerpc__) || defined(__s390__)
+typedef unsigned int autofs_wqt_t;
+#else
+typedef unsigned long autofs_wqt_t;
+#endif
+
+/* Packet types */
+#define autofs_ptype_missing   0       /* Missing entry (mount request) */
+#define autofs_ptype_expire    1       /* Expire entry (umount request) */
+
+struct autofs_packet_hdr {
+       int proto_version;              /* Protocol version */
+       int type;                       /* Type of packet */
+};
+
+struct autofs_packet_missing {
+       struct autofs_packet_hdr hdr;
+        autofs_wqt_t wait_queue_token;
+       int len;
+       char name[NAME_MAX+1];
+};     
+
+/* v3 expire (via ioctl) */
+struct autofs_packet_expire {
+       struct autofs_packet_hdr hdr;
+       int len;
+       char name[NAME_MAX+1];
+};
+
+#define AUTOFS_IOC_READY      _IO(0x93,0x60)
+#define AUTOFS_IOC_FAIL       _IO(0x93,0x61)
+#define AUTOFS_IOC_CATATONIC  _IO(0x93,0x62)
+#define AUTOFS_IOC_PROTOVER   _IOR(0x93,0x63,int)
+#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
+#define AUTOFS_IOC_EXPIRE     _IOR(0x93,0x65,struct autofs_packet_expire)
+
+#endif /* _UAPI_LINUX_AUTO_FS_H */
diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h
new file mode 100644 (file)
index 0000000..61594d5
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef _UAPI_LINUX_AUXVEC_H
+#define _UAPI_LINUX_AUXVEC_H
+
+#include <asm/auxvec.h>
+
+/* Symbolic values for the entries in the auxiliary table
+   put on the initial stack */
+#define AT_NULL   0    /* end of vector */
+#define AT_IGNORE 1    /* entry should be ignored */
+#define AT_EXECFD 2    /* file descriptor of program */
+#define AT_PHDR   3    /* program headers for program */
+#define AT_PHENT  4    /* size of program header entry */
+#define AT_PHNUM  5    /* number of program headers */
+#define AT_PAGESZ 6    /* system page size */
+#define AT_BASE   7    /* base address of interpreter */
+#define AT_FLAGS  8    /* flags */
+#define AT_ENTRY  9    /* entry point of program */
+#define AT_NOTELF 10   /* program is not ELF */
+#define AT_UID    11   /* real uid */
+#define AT_EUID   12   /* effective uid */
+#define AT_GID    13   /* real gid */
+#define AT_EGID   14   /* effective gid */
+#define AT_PLATFORM 15  /* string identifying CPU for optimizations */
+#define AT_HWCAP  16    /* arch dependent hints at CPU capabilities */
+#define AT_CLKTCK 17   /* frequency at which times() increments */
+/* AT_* values 18 through 22 are reserved */
+#define AT_SECURE 23   /* secure mode boolean */
+#define AT_BASE_PLATFORM 24    /* string identifying real platform, may
+                                * differ from AT_PLATFORM. */
+#define AT_RANDOM 25   /* address of 16 random bytes */
+
+#define AT_EXECFN  31  /* filename of program */
+
+
+#endif /* _UAPI_LINUX_AUXVEC_H */
diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
new file mode 100644 (file)
index 0000000..4eb5972
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _UAPI_LINUX_BINFMTS_H
+#define _UAPI_LINUX_BINFMTS_H
+
+#include <linux/capability.h>
+
+struct pt_regs;
+
+/*
+ * These are the maximum length and maximum number of strings passed to the
+ * execve() system call.  MAX_ARG_STRLEN is essentially random but serves to
+ * prevent the kernel from being unduly impacted by misaddressed pointers.
+ * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
+ */
+#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
+#define MAX_ARG_STRINGS 0x7FFFFFFF
+
+/* sizeof(linux_binprm->buf) */
+#define BINPRM_BUF_SIZE 128
+
+#endif /* _UAPI_LINUX_BINFMTS_H */
diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
new file mode 100644 (file)
index 0000000..c590ca6
--- /dev/null
@@ -0,0 +1,142 @@
+#ifndef _UAPIBLKTRACE_H
+#define _UAPIBLKTRACE_H
+
+#include <linux/types.h>
+
+/*
+ * Trace categories
+ */
+enum blktrace_cat {
+       BLK_TC_READ     = 1 << 0,       /* reads */
+       BLK_TC_WRITE    = 1 << 1,       /* writes */
+       BLK_TC_FLUSH    = 1 << 2,       /* flush */
+       BLK_TC_SYNC     = 1 << 3,       /* sync IO */
+       BLK_TC_SYNCIO   = BLK_TC_SYNC,
+       BLK_TC_QUEUE    = 1 << 4,       /* queueing/merging */
+       BLK_TC_REQUEUE  = 1 << 5,       /* requeueing */
+       BLK_TC_ISSUE    = 1 << 6,       /* issue */
+       BLK_TC_COMPLETE = 1 << 7,       /* completions */
+       BLK_TC_FS       = 1 << 8,       /* fs requests */
+       BLK_TC_PC       = 1 << 9,       /* pc requests */
+       BLK_TC_NOTIFY   = 1 << 10,      /* special message */
+       BLK_TC_AHEAD    = 1 << 11,      /* readahead */
+       BLK_TC_META     = 1 << 12,      /* metadata */
+       BLK_TC_DISCARD  = 1 << 13,      /* discard requests */
+       BLK_TC_DRV_DATA = 1 << 14,      /* binary per-driver data */
+       BLK_TC_FUA      = 1 << 15,      /* fua requests */
+
+       BLK_TC_END      = 1 << 15,      /* we've run out of bits! */
+};
+
+#define BLK_TC_SHIFT           (16)
+#define BLK_TC_ACT(act)                ((act) << BLK_TC_SHIFT)
+
+/*
+ * Basic trace actions
+ */
+enum blktrace_act {
+       __BLK_TA_QUEUE = 1,             /* queued */
+       __BLK_TA_BACKMERGE,             /* back merged to existing rq */
+       __BLK_TA_FRONTMERGE,            /* front merge to existing rq */
+       __BLK_TA_GETRQ,                 /* allocated new request */
+       __BLK_TA_SLEEPRQ,               /* sleeping on rq allocation */
+       __BLK_TA_REQUEUE,               /* request requeued */
+       __BLK_TA_ISSUE,                 /* sent to driver */
+       __BLK_TA_COMPLETE,              /* completed by driver */
+       __BLK_TA_PLUG,                  /* queue was plugged */
+       __BLK_TA_UNPLUG_IO,             /* queue was unplugged by io */
+       __BLK_TA_UNPLUG_TIMER,          /* queue was unplugged by timer */
+       __BLK_TA_INSERT,                /* insert request */
+       __BLK_TA_SPLIT,                 /* bio was split */
+       __BLK_TA_BOUNCE,                /* bio was bounced */
+       __BLK_TA_REMAP,                 /* bio was remapped */
+       __BLK_TA_ABORT,                 /* request aborted */
+       __BLK_TA_DRV_DATA,              /* driver-specific binary data */
+};
+
+/*
+ * Notify events.
+ */
+enum blktrace_notify {
+       __BLK_TN_PROCESS = 0,           /* establish pid/name mapping */
+       __BLK_TN_TIMESTAMP,             /* include system clock */
+       __BLK_TN_MESSAGE,               /* Character string message */
+};
+
+
+/*
+ * Trace actions in full. Additionally, read or write is masked
+ */
+#define BLK_TA_QUEUE           (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_BACKMERGE       (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_FRONTMERGE      (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
+#define        BLK_TA_GETRQ            (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
+#define        BLK_TA_SLEEPRQ          (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
+#define        BLK_TA_REQUEUE          (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
+#define BLK_TA_ISSUE           (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
+#define BLK_TA_COMPLETE                (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
+#define BLK_TA_PLUG            (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_UNPLUG_IO       (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_UNPLUG_TIMER    (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_INSERT          (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_SPLIT           (__BLK_TA_SPLIT)
+#define BLK_TA_BOUNCE          (__BLK_TA_BOUNCE)
+#define BLK_TA_REMAP           (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_ABORT           (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_DRV_DATA        (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
+
+#define BLK_TN_PROCESS         (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
+#define BLK_TN_TIMESTAMP       (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
+#define BLK_TN_MESSAGE         (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
+
+#define BLK_IO_TRACE_MAGIC     0x65617400
+#define BLK_IO_TRACE_VERSION   0x07
+
+/*
+ * The trace itself
+ */
+struct blk_io_trace {
+       __u32 magic;            /* MAGIC << 8 | version */
+       __u32 sequence;         /* event number */
+       __u64 time;             /* in microseconds */
+       __u64 sector;           /* disk offset */
+       __u32 bytes;            /* transfer length */
+       __u32 action;           /* what happened */
+       __u32 pid;              /* who did it */
+       __u32 device;           /* device number */
+       __u32 cpu;              /* on what cpu did it happen */
+       __u16 error;            /* completion error */
+       __u16 pdu_len;          /* length of data after this trace */
+};
+
+/*
+ * The remap event
+ */
+struct blk_io_trace_remap {
+       __be32 device_from;
+       __be32 device_to;
+       __be64 sector_from;
+};
+
+enum {
+       Blktrace_setup = 1,
+       Blktrace_running,
+       Blktrace_stopped,
+};
+
+#define BLKTRACE_BDEV_SIZE     32
+
+/*
+ * User setup structure passed with BLKTRACESTART
+ */
+struct blk_user_trace_setup {
+       char name[BLKTRACE_BDEV_SIZE];  /* output */
+       __u16 act_mask;                 /* input */
+       __u32 buf_size;                 /* input */
+       __u32 buf_nr;                   /* input */
+       __u64 start_lba;
+       __u64 end_lba;
+       __u32 pid;
+};
+
+#endif /* _UAPIBLKTRACE_H */
diff --git a/include/uapi/linux/bsg.h b/include/uapi/linux/bsg.h
new file mode 100644 (file)
index 0000000..7a12e1c
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef _UAPIBSG_H
+#define _UAPIBSG_H
+
+#include <linux/types.h>
+
+#define BSG_PROTOCOL_SCSI              0
+
+#define BSG_SUB_PROTOCOL_SCSI_CMD      0
+#define BSG_SUB_PROTOCOL_SCSI_TMF      1
+#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT        2
+
+/*
+ * For flags member below
+ * sg.h sg_io_hdr also has bits defined for it's flags member. However
+ * none of these bits are implemented/used by bsg. The bits below are
+ * allocated to not conflict with sg.h ones anyway.
+ */
+#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
+
+struct sg_io_v4 {
+       __s32 guard;            /* [i] 'Q' to differentiate from v3 */
+       __u32 protocol;         /* [i] 0 -> SCSI , .... */
+       __u32 subprotocol;      /* [i] 0 -> SCSI command, 1 -> SCSI task
+                                  management function, .... */
+
+       __u32 request_len;      /* [i] in bytes */
+       __u64 request;          /* [i], [*i] {SCSI: cdb} */
+       __u64 request_tag;      /* [i] {SCSI: task tag (only if flagged)} */
+       __u32 request_attr;     /* [i] {SCSI: task attribute} */
+       __u32 request_priority; /* [i] {SCSI: task priority} */
+       __u32 request_extra;    /* [i] {spare, for padding} */
+       __u32 max_response_len; /* [i] in bytes */
+       __u64 response;         /* [i], [*o] {SCSI: (auto)sense data} */
+
+        /* "dout_": data out (to device); "din_": data in (from device) */
+       __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
+                                  dout_xfer points to array of iovec */
+       __u32 dout_xfer_len;    /* [i] bytes to be transferred to device */
+       __u32 din_iovec_count;  /* [i] 0 -> "flat" din transfer */
+       __u32 din_xfer_len;     /* [i] bytes to be transferred from device */
+       __u64 dout_xferp;       /* [i], [*i] */
+       __u64 din_xferp;        /* [i], [*o] */
+
+       __u32 timeout;          /* [i] units: millisecond */
+       __u32 flags;            /* [i] bit mask */
+       __u64 usr_ptr;          /* [i->o] unused internally */
+       __u32 spare_in;         /* [i] */
+
+       __u32 driver_status;    /* [o] 0 -> ok */
+       __u32 transport_status; /* [o] 0 -> ok */
+       __u32 device_status;    /* [o] {SCSI: command completion status} */
+       __u32 retry_delay;      /* [o] {SCSI: status auxiliary information} */
+       __u32 info;             /* [o] additional information */
+       __u32 duration;         /* [o] time to complete, in milliseconds */
+       __u32 response_len;     /* [o] bytes of response actually written */
+       __s32 din_resid;        /* [o] din_xfer_len - actual_din_xfer_len */
+       __s32 dout_resid;       /* [o] dout_xfer_len - actual_dout_xfer_len */
+       __u64 generated_tag;    /* [o] {SCSI: transport generated task tag} */
+       __u32 spare_out;        /* [o] */
+
+       __u32 padding;
+};
+
+
+#endif /* _UAPIBSG_H */
index aafaa5aa54d46bb9a93a8137a22344408298223f..619225b9ff2ef8d610f5ac6160d51e93561e1ef2 100644 (file)
@@ -1 +1,3 @@
 # UAPI Header export list
+header-y += big_endian.h
+header-y += little_endian.h
diff --git a/include/uapi/linux/byteorder/big_endian.h b/include/uapi/linux/byteorder/big_endian.h
new file mode 100644 (file)
index 0000000..6723744
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H
+#define _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H
+
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BIG_ENDIAN_BITFIELD
+#define __BIG_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/swab.h>
+
+#define __constant_htonl(x) ((__force __be32)(__u32)(x))
+#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
+#define __constant_htons(x) ((__force __be16)(__u16)(x))
+#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
+#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
+#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
+#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
+#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
+#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
+#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
+#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
+#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
+#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
+#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
+#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
+#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
+#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
+
+static inline __le64 __cpu_to_le64p(const __u64 *p)
+{
+       return (__force __le64)__swab64p(p);
+}
+static inline __u64 __le64_to_cpup(const __le64 *p)
+{
+       return __swab64p((__u64 *)p);
+}
+static inline __le32 __cpu_to_le32p(const __u32 *p)
+{
+       return (__force __le32)__swab32p(p);
+}
+static inline __u32 __le32_to_cpup(const __le32 *p)
+{
+       return __swab32p((__u32 *)p);
+}
+static inline __le16 __cpu_to_le16p(const __u16 *p)
+{
+       return (__force __le16)__swab16p(p);
+}
+static inline __u16 __le16_to_cpup(const __le16 *p)
+{
+       return __swab16p((__u16 *)p);
+}
+static inline __be64 __cpu_to_be64p(const __u64 *p)
+{
+       return (__force __be64)*p;
+}
+static inline __u64 __be64_to_cpup(const __be64 *p)
+{
+       return (__force __u64)*p;
+}
+static inline __be32 __cpu_to_be32p(const __u32 *p)
+{
+       return (__force __be32)*p;
+}
+static inline __u32 __be32_to_cpup(const __be32 *p)
+{
+       return (__force __u32)*p;
+}
+static inline __be16 __cpu_to_be16p(const __u16 *p)
+{
+       return (__force __be16)*p;
+}
+static inline __u16 __be16_to_cpup(const __be16 *p)
+{
+       return (__force __u16)*p;
+}
+#define __cpu_to_le64s(x) __swab64s((x))
+#define __le64_to_cpus(x) __swab64s((x))
+#define __cpu_to_le32s(x) __swab32s((x))
+#define __le32_to_cpus(x) __swab32s((x))
+#define __cpu_to_le16s(x) __swab16s((x))
+#define __le16_to_cpus(x) __swab16s((x))
+#define __cpu_to_be64s(x) do { (void)(x); } while (0)
+#define __be64_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be32s(x) do { (void)(x); } while (0)
+#define __be32_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be16s(x) do { (void)(x); } while (0)
+#define __be16_to_cpus(x) do { (void)(x); } while (0)
+
+
+#endif /* _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H */
diff --git a/include/uapi/linux/byteorder/little_endian.h b/include/uapi/linux/byteorder/little_endian.h
new file mode 100644 (file)
index 0000000..d876736
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H
+#define _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H
+
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __LITTLE_ENDIAN_BITFIELD
+#define __LITTLE_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/swab.h>
+
+#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
+#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
+#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
+#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
+#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
+#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
+#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
+#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
+#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
+#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
+#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
+#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
+#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
+#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
+#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
+#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
+#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
+
+static inline __le64 __cpu_to_le64p(const __u64 *p)
+{
+       return (__force __le64)*p;
+}
+static inline __u64 __le64_to_cpup(const __le64 *p)
+{
+       return (__force __u64)*p;
+}
+static inline __le32 __cpu_to_le32p(const __u32 *p)
+{
+       return (__force __le32)*p;
+}
+static inline __u32 __le32_to_cpup(const __le32 *p)
+{
+       return (__force __u32)*p;
+}
+static inline __le16 __cpu_to_le16p(const __u16 *p)
+{
+       return (__force __le16)*p;
+}
+static inline __u16 __le16_to_cpup(const __le16 *p)
+{
+       return (__force __u16)*p;
+}
+static inline __be64 __cpu_to_be64p(const __u64 *p)
+{
+       return (__force __be64)__swab64p(p);
+}
+static inline __u64 __be64_to_cpup(const __be64 *p)
+{
+       return __swab64p((__u64 *)p);
+}
+static inline __be32 __cpu_to_be32p(const __u32 *p)
+{
+       return (__force __be32)__swab32p(p);
+}
+static inline __u32 __be32_to_cpup(const __be32 *p)
+{
+       return __swab32p((__u32 *)p);
+}
+static inline __be16 __cpu_to_be16p(const __u16 *p)
+{
+       return (__force __be16)__swab16p(p);
+}
+static inline __u16 __be16_to_cpup(const __be16 *p)
+{
+       return __swab16p((__u16 *)p);
+}
+#define __cpu_to_le64s(x) do { (void)(x); } while (0)
+#define __le64_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_le32s(x) do { (void)(x); } while (0)
+#define __le32_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_le16s(x) do { (void)(x); } while (0)
+#define __le16_to_cpus(x) do { (void)(x); } while (0)
+#define __cpu_to_be64s(x) __swab64s((x))
+#define __be64_to_cpus(x) __swab64s((x))
+#define __cpu_to_be32s(x) __swab32s((x))
+#define __be32_to_cpus(x) __swab32s((x))
+#define __cpu_to_be16s(x) __swab16s((x))
+#define __be16_to_cpus(x) __swab16s((x))
+
+
+#endif /* _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H */
similarity index 100%
rename from include/linux/can.h
rename to include/uapi/linux/can.h
diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
new file mode 100644 (file)
index 0000000..ba478fa
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+ * This is <linux/capability.h>
+ *
+ * Andrew G. Morgan <morgan@kernel.org>
+ * Alexander Kjeldaas <astor@guardian.no>
+ * with help from Aleph1, Roland Buresund and Andrew Main.
+ *
+ * See here for the libcap library ("POSIX draft" compliance):
+ *
+ * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
+ */
+
+#ifndef _UAPI_LINUX_CAPABILITY_H
+#define _UAPI_LINUX_CAPABILITY_H
+
+#include <linux/types.h>
+
+struct task_struct;
+
+/* User-level do most of the mapping between kernel and user
+   capabilities based on the version tag given by the kernel. The
+   kernel might be somewhat backwards compatible, but don't bet on
+   it. */
+
+/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
+   a set of three capability sets.  The transposition of 3*the
+   following structure to such a composite is better handled in a user
+   library since the draft standard requires the use of malloc/free
+   etc.. */
+
+#define _LINUX_CAPABILITY_VERSION_1  0x19980330
+#define _LINUX_CAPABILITY_U32S_1     1
+
+#define _LINUX_CAPABILITY_VERSION_2  0x20071026  /* deprecated - use v3 */
+#define _LINUX_CAPABILITY_U32S_2     2
+
+#define _LINUX_CAPABILITY_VERSION_3  0x20080522
+#define _LINUX_CAPABILITY_U32S_3     2
+
+typedef struct __user_cap_header_struct {
+       __u32 version;
+       int pid;
+} __user *cap_user_header_t;
+
+typedef struct __user_cap_data_struct {
+        __u32 effective;
+        __u32 permitted;
+        __u32 inheritable;
+} __user *cap_user_data_t;
+
+
+#define VFS_CAP_REVISION_MASK  0xFF000000
+#define VFS_CAP_REVISION_SHIFT 24
+#define VFS_CAP_FLAGS_MASK     ~VFS_CAP_REVISION_MASK
+#define VFS_CAP_FLAGS_EFFECTIVE        0x000001
+
+#define VFS_CAP_REVISION_1     0x01000000
+#define VFS_CAP_U32_1           1
+#define XATTR_CAPS_SZ_1         (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
+
+#define VFS_CAP_REVISION_2     0x02000000
+#define VFS_CAP_U32_2           2
+#define XATTR_CAPS_SZ_2         (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
+
+#define XATTR_CAPS_SZ           XATTR_CAPS_SZ_2
+#define VFS_CAP_U32             VFS_CAP_U32_2
+#define VFS_CAP_REVISION       VFS_CAP_REVISION_2
+
+struct vfs_cap_data {
+       __le32 magic_etc;            /* Little endian */
+       struct {
+               __le32 permitted;    /* Little endian */
+               __le32 inheritable;  /* Little endian */
+       } data[VFS_CAP_U32];
+};
+
+#ifndef __KERNEL__
+
+/*
+ * Backwardly compatible definition for source code - trapped in a
+ * 32-bit world. If you find you need this, please consider using
+ * libcap to untrap yourself...
+ */
+#define _LINUX_CAPABILITY_VERSION  _LINUX_CAPABILITY_VERSION_1
+#define _LINUX_CAPABILITY_U32S     _LINUX_CAPABILITY_U32S_1
+
+#endif
+
+
+/**
+ ** POSIX-draft defined capabilities.
+ **/
+
+/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
+   overrides the restriction of changing file ownership and group
+   ownership. */
+
+#define CAP_CHOWN            0
+
+/* Override all DAC access, including ACL execute access if
+   [_POSIX_ACL] is defined. Excluding DAC access covered by
+   CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_OVERRIDE     1
+
+/* Overrides all DAC restrictions regarding read and search on files
+   and directories, including ACL restrictions if [_POSIX_ACL] is
+   defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_READ_SEARCH  2
+
+/* Overrides all restrictions about allowed operations on files, where
+   file owner ID must be equal to the user ID, except where CAP_FSETID
+   is applicable. It doesn't override MAC and DAC restrictions. */
+
+#define CAP_FOWNER           3
+
+/* Overrides the following restrictions that the effective user ID
+   shall match the file owner ID when setting the S_ISUID and S_ISGID
+   bits on that file; that the effective group ID (or one of the
+   supplementary group IDs) shall match the file owner ID when setting
+   the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
+   cleared on successful return from chown(2) (not implemented). */
+
+#define CAP_FSETID           4
+
+/* Overrides the restriction that the real or effective user ID of a
+   process sending a signal must match the real or effective user ID
+   of the process receiving the signal. */
+
+#define CAP_KILL             5
+
+/* Allows setgid(2) manipulation */
+/* Allows setgroups(2) */
+/* Allows forged gids on socket credentials passing. */
+
+#define CAP_SETGID           6
+
+/* Allows set*uid(2) manipulation (including fsuid). */
+/* Allows forged pids on socket credentials passing. */
+
+#define CAP_SETUID           7
+
+
+/**
+ ** Linux-specific capabilities
+ **/
+
+/* Without VFS support for capabilities:
+ *   Transfer any capability in your permitted set to any pid,
+ *   remove any capability in your permitted set from any pid
+ * With VFS support for capabilities (neither of above, but)
+ *   Add any capability from current's capability bounding set
+ *       to the current process' inheritable set
+ *   Allow taking bits out of capability bounding set
+ *   Allow modification of the securebits for a process
+ */
+
+#define CAP_SETPCAP          8
+
+/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
+
+#define CAP_LINUX_IMMUTABLE  9
+
+/* Allows binding to TCP/UDP sockets below 1024 */
+/* Allows binding to ATM VCIs below 32 */
+
+#define CAP_NET_BIND_SERVICE 10
+
+/* Allow broadcasting, listen to multicast */
+
+#define CAP_NET_BROADCAST    11
+
+/* Allow interface configuration */
+/* Allow administration of IP firewall, masquerading and accounting */
+/* Allow setting debug option on sockets */
+/* Allow modification of routing tables */
+/* Allow setting arbitrary process / process group ownership on
+   sockets */
+/* Allow binding to any address for transparent proxying (also via NET_RAW) */
+/* Allow setting TOS (type of service) */
+/* Allow setting promiscuous mode */
+/* Allow clearing driver statistics */
+/* Allow multicasting */
+/* Allow read/write of device-specific registers */
+/* Allow activation of ATM control sockets */
+
+#define CAP_NET_ADMIN        12
+
+/* Allow use of RAW sockets */
+/* Allow use of PACKET sockets */
+/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
+
+#define CAP_NET_RAW          13
+
+/* Allow locking of shared memory segments */
+/* Allow mlock and mlockall (which doesn't really have anything to do
+   with IPC) */
+
+#define CAP_IPC_LOCK         14
+
+/* Override IPC ownership checks */
+
+#define CAP_IPC_OWNER        15
+
+/* Insert and remove kernel modules - modify kernel without limit */
+#define CAP_SYS_MODULE       16
+
+/* Allow ioperm/iopl access */
+/* Allow sending USB messages to any device via /proc/bus/usb */
+
+#define CAP_SYS_RAWIO        17
+
+/* Allow use of chroot() */
+
+#define CAP_SYS_CHROOT       18
+
+/* Allow ptrace() of any process */
+
+#define CAP_SYS_PTRACE       19
+
+/* Allow configuration of process accounting */
+
+#define CAP_SYS_PACCT        20
+
+/* Allow configuration of the secure attention key */
+/* Allow administration of the random device */
+/* Allow examination and configuration of disk quotas */
+/* Allow setting the domainname */
+/* Allow setting the hostname */
+/* Allow calling bdflush() */
+/* Allow mount() and umount(), setting up new smb connection */
+/* Allow some autofs root ioctls */
+/* Allow nfsservctl */
+/* Allow VM86_REQUEST_IRQ */
+/* Allow to read/write pci config on alpha */
+/* Allow irix_prctl on mips (setstacksize) */
+/* Allow flushing all cache on m68k (sys_cacheflush) */
+/* Allow removing semaphores */
+/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
+   and shared memory */
+/* Allow locking/unlocking of shared memory segment */
+/* Allow turning swap on/off */
+/* Allow forged pids on socket credentials passing */
+/* Allow setting readahead and flushing buffers on block devices */
+/* Allow setting geometry in floppy driver */
+/* Allow turning DMA on/off in xd driver */
+/* Allow administration of md devices (mostly the above, but some
+   extra ioctls) */
+/* Allow tuning the ide driver */
+/* Allow access to the nvram device */
+/* Allow administration of apm_bios, serial and bttv (TV) device */
+/* Allow manufacturer commands in isdn CAPI support driver */
+/* Allow reading non-standardized portions of pci configuration space */
+/* Allow DDI debug ioctl on sbpcd driver */
+/* Allow setting up serial ports */
+/* Allow sending raw qic-117 commands */
+/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
+   arbitrary SCSI commands */
+/* Allow setting encryption key on loopback filesystem */
+/* Allow setting zone reclaim policy */
+
+#define CAP_SYS_ADMIN        21
+
+/* Allow use of reboot() */
+
+#define CAP_SYS_BOOT         22
+
+/* Allow raising priority and setting priority on other (different
+   UID) processes */
+/* Allow use of FIFO and round-robin (realtime) scheduling on own
+   processes and setting the scheduling algorithm used by another
+   process. */
+/* Allow setting cpu affinity on other processes */
+
+#define CAP_SYS_NICE         23
+
+/* Override resource limits. Set resource limits. */
+/* Override quota limits. */
+/* Override reserved space on ext2 filesystem */
+/* Modify data journaling mode on ext3 filesystem (uses journaling
+   resources) */
+/* NOTE: ext2 honors fsuid when checking for resource overrides, so
+   you can override using fsuid too */
+/* Override size restrictions on IPC message queues */
+/* Allow more than 64hz interrupts from the real-time clock */
+/* Override max number of consoles on console allocation */
+/* Override max number of keymaps */
+
+#define CAP_SYS_RESOURCE     24
+
+/* Allow manipulation of system clock */
+/* Allow irix_stime on mips */
+/* Allow setting the real-time clock */
+
+#define CAP_SYS_TIME         25
+
+/* Allow configuration of tty devices */
+/* Allow vhangup() of tty */
+
+#define CAP_SYS_TTY_CONFIG   26
+
+/* Allow the privileged aspects of mknod() */
+
+#define CAP_MKNOD            27
+
+/* Allow taking of leases on files */
+
+#define CAP_LEASE            28
+
+#define CAP_AUDIT_WRITE      29
+
+#define CAP_AUDIT_CONTROL    30
+
+#define CAP_SETFCAP         31
+
+/* Override MAC access.
+   The base kernel enforces no MAC policy.
+   An LSM may enforce a MAC policy, and if it does and it chooses
+   to implement capability based overrides of that policy, this is
+   the capability it should use to do so. */
+
+#define CAP_MAC_OVERRIDE     32
+
+/* Allow MAC configuration or state changes.
+   The base kernel requires no MAC configuration.
+   An LSM may enforce a MAC policy, and if it does and it chooses
+   to implement capability based checks on modifications to that
+   policy or the data required to maintain it, this is the
+   capability it should use to do so. */
+
+#define CAP_MAC_ADMIN        33
+
+/* Allow configuring the kernel's syslog (printk behaviour) */
+
+#define CAP_SYSLOG           34
+
+/* Allow triggering something that will wake the system */
+
+#define CAP_WAKE_ALARM            35
+
+/* Allow preventing system suspends */
+
+#define CAP_BLOCK_SUSPEND    36
+
+#define CAP_LAST_CAP         CAP_BLOCK_SUSPEND
+
+#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
+
+/*
+ * Bit location of each capability (used by user-space library and kernel)
+ */
+
+#define CAP_TO_INDEX(x)     ((x) >> 5)        /* 1 << 5 == bits in __u32 */
+#define CAP_TO_MASK(x)      (1 << ((x) & 31)) /* mask for indexed __u32 */
+
+
+#endif /* _UAPI_LINUX_CAPABILITY_H */
diff --git a/include/uapi/linux/cciss_ioctl.h b/include/uapi/linux/cciss_ioctl.h
new file mode 100644 (file)
index 0000000..bb0b9dd
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef _UAPICCISS_IOCTLH
+#define _UAPICCISS_IOCTLH
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/cciss_defs.h>
+
+#define CCISS_IOC_MAGIC 'B'
+
+
+typedef struct _cciss_pci_info_struct
+{
+       unsigned char   bus;
+       unsigned char   dev_fn;
+       unsigned short  domain;
+       __u32           board_id;
+} cciss_pci_info_struct; 
+
+typedef struct _cciss_coalint_struct
+{
+       __u32  delay;
+       __u32  count;
+} cciss_coalint_struct;
+
+typedef char NodeName_type[16];
+
+typedef __u32 Heartbeat_type;
+
+#define CISS_PARSCSIU2         0x0001
+#define CISS_PARCSCIU3         0x0002
+#define CISS_FIBRE1G   0x0100
+#define CISS_FIBRE2G   0x0200
+typedef __u32 BusTypes_type;
+
+typedef char FirmwareVer_type[4];
+typedef __u32 DriverVer_type;
+
+#define MAX_KMALLOC_SIZE 128000
+
+typedef struct _IOCTL_Command_struct {
+  LUNAddr_struct          LUN_info;
+  RequestBlock_struct      Request;
+  ErrorInfo_struct        error_info; 
+  WORD                    buf_size;  /* size in bytes of the buf */
+  BYTE                    __user *buf;
+} IOCTL_Command_struct;
+
+typedef struct _BIG_IOCTL_Command_struct {
+  LUNAddr_struct          LUN_info;
+  RequestBlock_struct      Request;
+  ErrorInfo_struct        error_info;
+  DWORD                           malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
+  DWORD                           buf_size;    /* size in bytes of the buf */
+                                       /* < malloc_size * MAXSGENTRIES */
+  BYTE                    __user *buf;
+} BIG_IOCTL_Command_struct;
+
+typedef struct _LogvolInfo_struct{
+       __u32   LunID;
+       int     num_opens;  /* number of opens on the logical volume */
+       int     num_parts;  /* number of partitions configured on logvol */
+} LogvolInfo_struct;
+
+#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
+
+#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
+#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
+
+#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
+#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
+
+#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
+#define CCISS_GETBUSTYPES  _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
+#define CCISS_GETFIRMVER   _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
+#define CCISS_GETDRIVVER   _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
+#define CCISS_REVALIDVOLS  _IO(CCISS_IOC_MAGIC, 10)
+#define CCISS_PASSTHRU    _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
+#define CCISS_DEREGDISK           _IO(CCISS_IOC_MAGIC, 12)
+
+/* no longer used... use REGNEWD instead */ 
+#define CCISS_REGNEWDISK  _IOW(CCISS_IOC_MAGIC, 13, int)
+
+#define CCISS_REGNEWD     _IO(CCISS_IOC_MAGIC, 14)
+#define CCISS_RESCANDISK   _IO(CCISS_IOC_MAGIC, 16)
+#define CCISS_GETLUNINFO   _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
+#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
+
+#endif /* _UAPICCISS_IOCTLH */
diff --git a/include/uapi/linux/cdrom.h b/include/uapi/linux/cdrom.h
new file mode 100644 (file)
index 0000000..898b866
--- /dev/null
@@ -0,0 +1,912 @@
+/*
+ * -- <linux/cdrom.h>
+ * General header file for linux CD-ROM drivers 
+ * Copyright (C) 1992         David Giller, rafetmad@oxy.edu
+ *               1994, 1995   Eberhard Mönkeberg, emoenke@gwdg.de
+ *               1996         David van Leeuwen, david@tm.tno.nl
+ *               1997, 1998   Erik Andersen, andersee@debian.org
+ *               1998-2002    Jens Axboe, axboe@suse.de
+ */
+#ifndef _UAPI_LINUX_CDROM_H
+#define _UAPI_LINUX_CDROM_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*******************************************************
+ * As of Linux 2.1.x, all Linux CD-ROM application programs will use this 
+ * (and only this) include file.  It is my hope to provide Linux with
+ * a uniform interface between software accessing CD-ROMs and the various 
+ * device drivers that actually talk to the drives.  There may still be
+ * 23 different kinds of strange CD-ROM drives, but at least there will 
+ * now be one, and only one, Linux CD-ROM interface.
+ *
+ * Additionally, as of Linux 2.1.x, all Linux application programs 
+ * should use the O_NONBLOCK option when opening a CD-ROM device 
+ * for subsequent ioctl commands.  This allows for neat system errors 
+ * like "No medium found" or "Wrong medium type" upon attempting to 
+ * mount or play an empty slot, mount an audio disc, or play a data disc.
+ * Generally, changing an application program to support O_NONBLOCK
+ * is as easy as the following:
+ *       -    drive = open("/dev/cdrom", O_RDONLY);
+ *       +    drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
+ * It is worth the small change.
+ *
+ *  Patches for many common CD programs (provided by David A. van Leeuwen)
+ *  can be found at:  ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
+ * 
+ *******************************************************/
+
+/* When a driver supports a certain function, but the cdrom drive we are 
+ * using doesn't, we will return the error EDRIVE_CANT_DO_THIS.  We will 
+ * borrow the "Operation not supported" error from the network folks to 
+ * accomplish this.  Maybe someday we will get a more targeted error code, 
+ * but this will do for now... */
+#define EDRIVE_CANT_DO_THIS  EOPNOTSUPP
+
+/*******************************************************
+ * The CD-ROM IOCTL commands  -- these should be supported by 
+ * all the various cdrom drivers.  For the CD-ROM ioctls, we 
+ * will commandeer byte 0x53, or 'S'.
+ *******************************************************/
+#define CDROMPAUSE             0x5301 /* Pause Audio Operation */ 
+#define CDROMRESUME            0x5302 /* Resume paused Audio Operation */
+#define CDROMPLAYMSF           0x5303 /* Play Audio MSF (struct cdrom_msf) */
+#define CDROMPLAYTRKIND                0x5304 /* Play Audio Track/index 
+                                           (struct cdrom_ti) */
+#define CDROMREADTOCHDR                0x5305 /* Read TOC header 
+                                           (struct cdrom_tochdr) */
+#define CDROMREADTOCENTRY      0x5306 /* Read TOC entry 
+                                           (struct cdrom_tocentry) */
+#define CDROMSTOP              0x5307 /* Stop the cdrom drive */
+#define CDROMSTART             0x5308 /* Start the cdrom drive */
+#define CDROMEJECT             0x5309 /* Ejects the cdrom media */
+#define CDROMVOLCTRL           0x530a /* Control output volume 
+                                           (struct cdrom_volctrl) */
+#define CDROMSUBCHNL           0x530b /* Read subchannel data 
+                                           (struct cdrom_subchnl) */
+#define CDROMREADMODE2         0x530c /* Read CDROM mode 2 data (2336 Bytes) 
+                                           (struct cdrom_read) */
+#define CDROMREADMODE1         0x530d /* Read CDROM mode 1 data (2048 Bytes)
+                                           (struct cdrom_read) */
+#define CDROMREADAUDIO         0x530e /* (struct cdrom_read_audio) */
+#define CDROMEJECT_SW          0x530f /* enable(1)/disable(0) auto-ejecting */
+#define CDROMMULTISESSION      0x5310 /* Obtain the start-of-last-session 
+                                           address of multi session disks 
+                                           (struct cdrom_multisession) */
+#define CDROM_GET_MCN          0x5311 /* Obtain the "Universal Product Code" 
+                                           if available (struct cdrom_mcn) */
+#define CDROM_GET_UPC          CDROM_GET_MCN  /* This one is deprecated, 
+                                          but here anyway for compatibility */
+#define CDROMRESET             0x5312 /* hard-reset the drive */
+#define CDROMVOLREAD           0x5313 /* Get the drive's volume setting 
+                                          (struct cdrom_volctrl) */
+#define CDROMREADRAW           0x5314  /* read data in raw mode (2352 Bytes)
+                                           (struct cdrom_read) */
+/* 
+ * These ioctls are used only used in aztcd.c and optcd.c
+ */
+#define CDROMREADCOOKED                0x5315  /* read data in cooked mode */
+#define CDROMSEEK              0x5316  /* seek msf address */
+  
+/*
+ * This ioctl is only used by the scsi-cd driver.  
+   It is for playing audio in logical block addressing mode.
+ */
+#define CDROMPLAYBLK           0x5317  /* (struct cdrom_blk) */
+
+/* 
+ * These ioctls are only used in optcd.c
+ */
+#define CDROMREADALL           0x5318  /* read all 2646 bytes */
+
+/* 
+ * These ioctls are (now) only in ide-cd.c for controlling 
+ * drive spindown time.  They should be implemented in the
+ * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
+ * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
+ *  -Erik
+ */
+#define CDROMGETSPINDOWN        0x531d
+#define CDROMSETSPINDOWN        0x531e
+
+/* 
+ * These ioctls are implemented through the uniform CD-ROM driver
+ * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
+ * drivers are eventually ported to the uniform CD-ROM driver interface.
+ */
+#define CDROMCLOSETRAY         0x5319  /* pendant of CDROMEJECT */
+#define CDROM_SET_OPTIONS      0x5320  /* Set behavior options */
+#define CDROM_CLEAR_OPTIONS    0x5321  /* Clear behavior options */
+#define CDROM_SELECT_SPEED     0x5322  /* Set the CD-ROM speed */
+#define CDROM_SELECT_DISC      0x5323  /* Select disc (for juke-boxes) */
+#define CDROM_MEDIA_CHANGED    0x5325  /* Check is media changed  */
+#define CDROM_DRIVE_STATUS     0x5326  /* Get tray position, etc. */
+#define CDROM_DISC_STATUS      0x5327  /* Get disc type, etc. */
+#define CDROM_CHANGER_NSLOTS    0x5328  /* Get number of slots */
+#define CDROM_LOCKDOOR         0x5329  /* lock or unlock door */
+#define CDROM_DEBUG            0x5330  /* Turn debug messages on/off */
+#define CDROM_GET_CAPABILITY   0x5331  /* get capabilities */
+
+/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
+ * Future CDROM ioctls should be kept below 0x537F
+ */
+
+/* This ioctl is only used by sbpcd at the moment */
+#define CDROMAUDIOBUFSIZ        0x5382 /* set the audio buffer size */
+                                       /* conflict with SCSI_IOCTL_GET_IDLUN */
+
+/* DVD-ROM Specific ioctls */
+#define DVD_READ_STRUCT                0x5390  /* Read structure */
+#define DVD_WRITE_STRUCT       0x5391  /* Write structure */
+#define DVD_AUTH               0x5392  /* Authentication */
+
+#define CDROM_SEND_PACKET      0x5393  /* send a packet to the drive */
+#define CDROM_NEXT_WRITABLE    0x5394  /* get next writable block */
+#define CDROM_LAST_WRITTEN     0x5395  /* get last block written on disc */
+
+/*******************************************************
+ * CDROM IOCTL structures
+ *******************************************************/
+
+/* Address in MSF format */
+struct cdrom_msf0              
+{
+       __u8    minute;
+       __u8    second;
+       __u8    frame;
+};
+
+/* Address in either MSF or logical format */
+union cdrom_addr               
+{
+       struct cdrom_msf0       msf;
+       int                     lba;
+};
+
+/* This struct is used by the CDROMPLAYMSF ioctl */ 
+struct cdrom_msf 
+{
+       __u8    cdmsf_min0;     /* start minute */
+       __u8    cdmsf_sec0;     /* start second */
+       __u8    cdmsf_frame0;   /* start frame */
+       __u8    cdmsf_min1;     /* end minute */
+       __u8    cdmsf_sec1;     /* end second */
+       __u8    cdmsf_frame1;   /* end frame */
+};
+
+/* This struct is used by the CDROMPLAYTRKIND ioctl */
+struct cdrom_ti 
+{
+       __u8    cdti_trk0;      /* start track */
+       __u8    cdti_ind0;      /* start index */
+       __u8    cdti_trk1;      /* end track */
+       __u8    cdti_ind1;      /* end index */
+};
+
+/* This struct is used by the CDROMREADTOCHDR ioctl */
+struct cdrom_tochdr    
+{
+       __u8    cdth_trk0;      /* start track */
+       __u8    cdth_trk1;      /* end track */
+};
+
+/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
+struct cdrom_volctrl
+{
+       __u8    channel0;
+       __u8    channel1;
+       __u8    channel2;
+       __u8    channel3;
+};
+
+/* This struct is used by the CDROMSUBCHNL ioctl */
+struct cdrom_subchnl 
+{
+       __u8    cdsc_format;
+       __u8    cdsc_audiostatus;
+       __u8    cdsc_adr:       4;
+       __u8    cdsc_ctrl:      4;
+       __u8    cdsc_trk;
+       __u8    cdsc_ind;
+       union cdrom_addr cdsc_absaddr;
+       union cdrom_addr cdsc_reladdr;
+};
+
+
+/* This struct is used by the CDROMREADTOCENTRY ioctl */
+struct cdrom_tocentry 
+{
+       __u8    cdte_track;
+       __u8    cdte_adr        :4;
+       __u8    cdte_ctrl       :4;
+       __u8    cdte_format;
+       union cdrom_addr cdte_addr;
+       __u8    cdte_datamode;
+};
+
+/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
+struct cdrom_read      
+{
+       int     cdread_lba;
+       char    *cdread_bufaddr;
+       int     cdread_buflen;
+};
+
+/* This struct is used by the CDROMREADAUDIO ioctl */
+struct cdrom_read_audio
+{
+       union cdrom_addr addr; /* frame address */
+       __u8 addr_format;      /* CDROM_LBA or CDROM_MSF */
+       int nframes;           /* number of 2352-byte-frames to read at once */
+       __u8 __user *buf;      /* frame buffer (size: nframes*2352 bytes) */
+};
+
+/* This struct is used with the CDROMMULTISESSION ioctl */
+struct cdrom_multisession
+{
+       union cdrom_addr addr; /* frame address: start-of-last-session 
+                                  (not the new "frame 16"!).  Only valid
+                                  if the "xa_flag" is true. */
+       __u8 xa_flag;        /* 1: "is XA disk" */
+       __u8 addr_format;    /* CDROM_LBA or CDROM_MSF */
+};
+
+/* This struct is used with the CDROM_GET_MCN ioctl.  
+ * Very few audio discs actually have Universal Product Code information, 
+ * which should just be the Medium Catalog Number on the box.  Also note 
+ * that the way the codeis written on CD is _not_ uniform across all discs!
+ */  
+struct cdrom_mcn 
+{
+  __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
+};
+
+/* This is used by the CDROMPLAYBLK ioctl */
+struct cdrom_blk 
+{
+       unsigned from;
+       unsigned short len;
+};
+
+#define CDROM_PACKET_SIZE      12
+
+#define CGC_DATA_UNKNOWN       0
+#define CGC_DATA_WRITE         1
+#define CGC_DATA_READ          2
+#define CGC_DATA_NONE          3
+
+/* for CDROM_PACKET_COMMAND ioctl */
+struct cdrom_generic_command
+{
+       unsigned char           cmd[CDROM_PACKET_SIZE];
+       unsigned char           __user *buffer;
+       unsigned int            buflen;
+       int                     stat;
+       struct request_sense    __user *sense;
+       unsigned char           data_direction;
+       int                     quiet;
+       int                     timeout;
+       void                    __user *reserved[1];    /* unused, actually */
+};
+
+/*
+ * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 
+ * 2340, or 2352 bytes long.  
+
+*         Sector types of the standard CD-ROM data formats:
+ *
+ * format   sector type               user data size (bytes)
+ * -----------------------------------------------------------------------------
+ *   1     (Red Book)    CD-DA          2352    (CD_FRAMESIZE_RAW)
+ *   2     (Yellow Book) Mode1 Form1    2048    (CD_FRAMESIZE)
+ *   3     (Yellow Book) Mode1 Form2    2336    (CD_FRAMESIZE_RAW0)
+ *   4     (Green Book)  Mode2 Form1    2048    (CD_FRAMESIZE)
+ *   5     (Green Book)  Mode2 Form2    2328    (2324+4 spare bytes)
+ *
+ *
+ *       The layout of the standard CD-ROM data formats:
+ * -----------------------------------------------------------------------------
+ * - audio (red):                  | audio_sample_bytes |
+ *                                 |        2352        |
+ *
+ * - data (yellow, mode1):         | sync - head - data - EDC - zero - ECC |
+ *                                 |  12  -   4  - 2048 -  4  -   8  - 276 |
+ *
+ * - data (yellow, mode2):         | sync - head - data |
+ *                                 |  12  -   4  - 2336 |
+ *
+ * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
+ *                                 |  12  -   4  -  8  - 2048 -  4  - 276 |
+ *
+ * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
+ *                                 |  12  -   4  -  8  - 2324 -  4    |
+ *
+ */
+
+/* Some generally useful CD-ROM information -- mostly based on the above */
+#define CD_MINS              74 /* max. minutes per CD, not really a limit */
+#define CD_SECS              60 /* seconds per minute */
+#define CD_FRAMES            75 /* frames per second */
+#define CD_SYNC_SIZE         12 /* 12 sync bytes per raw data frame */
+#define CD_MSF_OFFSET       150 /* MSF numbering offset of first frame */
+#define CD_CHUNK_SIZE        24 /* lowest-level "data bytes piece" */
+#define CD_NUM_OF_CHUNKS     98 /* chunks per frame */
+#define CD_FRAMESIZE_SUB     96 /* subchannel data "frame" size */
+#define CD_HEAD_SIZE          4 /* header (address) bytes per raw data frame */
+#define CD_SUBHEAD_SIZE       8 /* subheader bytes per raw XA data frame */
+#define CD_EDC_SIZE           4 /* bytes EDC per most raw data frame types */
+#define CD_ZERO_SIZE          8 /* bytes zero per yellow book mode 1 frame */
+#define CD_ECC_SIZE         276 /* bytes ECC per most raw data frame types */
+#define CD_FRAMESIZE       2048 /* bytes per frame, "cooked" mode */
+#define CD_FRAMESIZE_RAW   2352 /* bytes per frame, "raw" mode */
+#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */ 
+/* most drives don't deliver everything: */
+#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
+#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
+
+#define CD_XA_HEAD        (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
+#define CD_XA_TAIL        (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
+#define CD_XA_SYNC_HEAD   (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
+
+/* CD-ROM address types (cdrom_tocentry.cdte_format) */
+#define        CDROM_LBA 0x01 /* "logical block": first frame is #0 */
+#define        CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
+
+/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
+#define        CDROM_DATA_TRACK        0x04
+
+/* The leadout track is always 0xAA, regardless of # of tracks on disc */
+#define        CDROM_LEADOUT           0xAA
+
+/* audio states (from SCSI-2, but seen with other drives, too) */
+#define        CDROM_AUDIO_INVALID     0x00    /* audio status not supported */
+#define        CDROM_AUDIO_PLAY        0x11    /* audio play operation in progress */
+#define        CDROM_AUDIO_PAUSED      0x12    /* audio play operation paused */
+#define        CDROM_AUDIO_COMPLETED   0x13    /* audio play successfully completed */
+#define        CDROM_AUDIO_ERROR       0x14    /* audio play stopped due to error */
+#define        CDROM_AUDIO_NO_STATUS   0x15    /* no current audio status to return */
+
+/* capability flags used with the uniform CD-ROM driver */ 
+#define CDC_CLOSE_TRAY         0x1     /* caddy systems _can't_ close */
+#define CDC_OPEN_TRAY          0x2     /* but _can_ eject.  */
+#define CDC_LOCK               0x4     /* disable manual eject */
+#define CDC_SELECT_SPEED       0x8     /* programmable speed */
+#define CDC_SELECT_DISC                0x10    /* select disc from juke-box */
+#define CDC_MULTI_SESSION      0x20    /* read sessions>1 */
+#define CDC_MCN                        0x40    /* Medium Catalog Number */
+#define CDC_MEDIA_CHANGED      0x80    /* media changed */
+#define CDC_PLAY_AUDIO         0x100   /* audio functions */
+#define CDC_RESET               0x200   /* hard reset device */
+#define CDC_DRIVE_STATUS        0x800   /* driver implements drive status */
+#define CDC_GENERIC_PACKET     0x1000  /* driver implements generic packets */
+#define CDC_CD_R               0x2000  /* drive is a CD-R */
+#define CDC_CD_RW              0x4000  /* drive is a CD-RW */
+#define CDC_DVD                        0x8000  /* drive is a DVD */
+#define CDC_DVD_R              0x10000 /* drive can write DVD-R */
+#define CDC_DVD_RAM            0x20000 /* drive can write DVD-RAM */
+#define CDC_MO_DRIVE           0x40000 /* drive is an MO device */
+#define CDC_MRW                        0x80000 /* drive can read MRW */
+#define CDC_MRW_W              0x100000 /* drive can write MRW */
+#define CDC_RAM                        0x200000 /* ok to open for WRITE */
+
+/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
+#define CDS_NO_INFO            0       /* if not implemented */
+#define CDS_NO_DISC            1
+#define CDS_TRAY_OPEN          2
+#define CDS_DRIVE_NOT_READY    3
+#define CDS_DISC_OK            4
+
+/* return values for the CDROM_DISC_STATUS ioctl */
+/* can also return CDS_NO_[INFO|DISC], from above */
+#define CDS_AUDIO              100
+#define CDS_DATA_1             101
+#define CDS_DATA_2             102
+#define CDS_XA_2_1             103
+#define CDS_XA_2_2             104
+#define CDS_MIXED              105
+
+/* User-configurable behavior options for the uniform CD-ROM driver */
+#define CDO_AUTO_CLOSE         0x1     /* close tray on first open() */
+#define CDO_AUTO_EJECT         0x2     /* open tray on last release() */
+#define CDO_USE_FFLAGS         0x4     /* use O_NONBLOCK information on open */
+#define CDO_LOCK               0x8     /* lock tray on open files */
+#define CDO_CHECK_TYPE         0x10    /* check type on open for data */
+
+/* Special codes used when specifying changer slots. */
+#define CDSL_NONE              (INT_MAX-1)
+#define CDSL_CURRENT           INT_MAX
+
+/* For partition based multisession access. IDE can handle 64 partitions
+ * per drive - SCSI CD-ROM's use minors to differentiate between the
+ * various drives, so we can't do multisessions the same way there.
+ * Use the -o session=x option to mount on them.
+ */
+#define CD_PART_MAX            64
+#define CD_PART_MASK           (CD_PART_MAX - 1)
+
+/*********************************************************************
+ * Generic Packet commands, MMC commands, and such
+ *********************************************************************/
+
+ /* The generic packet command opcodes for CD/DVD Logical Units,
+ * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
+#define GPCMD_BLANK                        0xa1
+#define GPCMD_CLOSE_TRACK                  0x5b
+#define GPCMD_FLUSH_CACHE                  0x35
+#define GPCMD_FORMAT_UNIT                  0x04
+#define GPCMD_GET_CONFIGURATION                    0x46
+#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
+#define GPCMD_GET_PERFORMANCE              0xac
+#define GPCMD_INQUIRY                      0x12
+#define GPCMD_LOAD_UNLOAD                  0xa6
+#define GPCMD_MECHANISM_STATUS             0xbd
+#define GPCMD_MODE_SELECT_10               0x55
+#define GPCMD_MODE_SENSE_10                0x5a
+#define GPCMD_PAUSE_RESUME                 0x4b
+#define GPCMD_PLAY_AUDIO_10                0x45
+#define GPCMD_PLAY_AUDIO_MSF               0x47
+#define GPCMD_PLAY_AUDIO_TI                0x48
+#define GPCMD_PLAY_CD                      0xbc
+#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL  0x1e
+#define GPCMD_READ_10                      0x28
+#define GPCMD_READ_12                      0xa8
+#define GPCMD_READ_BUFFER                  0x3c
+#define GPCMD_READ_BUFFER_CAPACITY         0x5c
+#define GPCMD_READ_CDVD_CAPACITY           0x25
+#define GPCMD_READ_CD                      0xbe
+#define GPCMD_READ_CD_MSF                  0xb9
+#define GPCMD_READ_DISC_INFO               0x51
+#define GPCMD_READ_DVD_STRUCTURE           0xad
+#define GPCMD_READ_FORMAT_CAPACITIES       0x23
+#define GPCMD_READ_HEADER                  0x44
+#define GPCMD_READ_TRACK_RZONE_INFO        0x52
+#define GPCMD_READ_SUBCHANNEL              0x42
+#define GPCMD_READ_TOC_PMA_ATIP                    0x43
+#define GPCMD_REPAIR_RZONE_TRACK           0x58
+#define GPCMD_REPORT_KEY                   0xa4
+#define GPCMD_REQUEST_SENSE                0x03
+#define GPCMD_RESERVE_RZONE_TRACK          0x53
+#define GPCMD_SEND_CUE_SHEET               0x5d
+#define GPCMD_SCAN                         0xba
+#define GPCMD_SEEK                         0x2b
+#define GPCMD_SEND_DVD_STRUCTURE           0xbf
+#define GPCMD_SEND_EVENT                   0xa2
+#define GPCMD_SEND_KEY                     0xa3
+#define GPCMD_SEND_OPC                     0x54
+#define GPCMD_SET_READ_AHEAD               0xa7
+#define GPCMD_SET_STREAMING                0xb6
+#define GPCMD_START_STOP_UNIT              0x1b
+#define GPCMD_STOP_PLAY_SCAN               0x4e
+#define GPCMD_TEST_UNIT_READY              0x00
+#define GPCMD_VERIFY_10                            0x2f
+#define GPCMD_WRITE_10                     0x2a
+#define GPCMD_WRITE_12                     0xaa
+#define GPCMD_WRITE_AND_VERIFY_10          0x2e
+#define GPCMD_WRITE_BUFFER                 0x3b
+/* This is listed as optional in ATAPI 2.6, but is (curiously) 
+ * missing from Mt. Fuji, Table 57.  It _is_ mentioned in Mt. Fuji
+ * Table 377 as an MMC command for SCSi devices though...  Most ATAPI
+ * drives support it. */
+#define GPCMD_SET_SPEED                            0xbb
+/* This seems to be a SCSI specific CD-ROM opcode 
+ * to play data at track/index */
+#define GPCMD_PLAYAUDIO_TI                 0x48
+/*
+ * From MS Media Status Notification Support Specification. For
+ * older drives only.
+ */
+#define GPCMD_GET_MEDIA_STATUS             0xda
+
+/* Mode page codes for mode sense/set */
+#define GPMODE_VENDOR_PAGE             0x00
+#define GPMODE_R_W_ERROR_PAGE          0x01
+#define GPMODE_WRITE_PARMS_PAGE                0x05
+#define GPMODE_WCACHING_PAGE           0x08
+#define GPMODE_AUDIO_CTL_PAGE          0x0e
+#define GPMODE_POWER_PAGE              0x1a
+#define GPMODE_FAULT_FAIL_PAGE         0x1c
+#define GPMODE_TO_PROTECT_PAGE         0x1d
+#define GPMODE_CAPABILITIES_PAGE       0x2a
+#define GPMODE_ALL_PAGES               0x3f
+/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
+ * of MODE_SENSE_POWER_PAGE */
+#define GPMODE_CDROM_PAGE              0x0d
+
+
+
+/* DVD struct types */
+#define DVD_STRUCT_PHYSICAL    0x00
+#define DVD_STRUCT_COPYRIGHT   0x01
+#define DVD_STRUCT_DISCKEY     0x02
+#define DVD_STRUCT_BCA         0x03
+#define DVD_STRUCT_MANUFACT    0x04
+
+struct dvd_layer {
+       __u8 book_version       : 4;
+       __u8 book_type          : 4;
+       __u8 min_rate           : 4;
+       __u8 disc_size          : 4;
+       __u8 layer_type         : 4;
+       __u8 track_path         : 1;
+       __u8 nlayers            : 2;
+       __u8 track_density      : 4;
+       __u8 linear_density     : 4;
+       __u8 bca                : 1;
+       __u32 start_sector;
+       __u32 end_sector;
+       __u32 end_sector_l0;
+};
+
+#define DVD_LAYERS     4
+
+struct dvd_physical {
+       __u8 type;
+       __u8 layer_num;
+       struct dvd_layer layer[DVD_LAYERS];
+};
+
+struct dvd_copyright {
+       __u8 type;
+
+       __u8 layer_num;
+       __u8 cpst;
+       __u8 rmi;
+};
+
+struct dvd_disckey {
+       __u8 type;
+
+       unsigned agid           : 2;
+       __u8 value[2048];
+};
+
+struct dvd_bca {
+       __u8 type;
+
+       int len;
+       __u8 value[188];
+};
+
+struct dvd_manufact {
+       __u8 type;
+
+       __u8 layer_num;
+       int len;
+       __u8 value[2048];
+};
+
+typedef union {
+       __u8 type;
+
+       struct dvd_physical     physical;
+       struct dvd_copyright    copyright;
+       struct dvd_disckey      disckey;
+       struct dvd_bca          bca;
+       struct dvd_manufact     manufact;
+} dvd_struct;
+
+/*
+ * DVD authentication ioctl
+ */
+
+/* Authentication states */
+#define DVD_LU_SEND_AGID       0
+#define DVD_HOST_SEND_CHALLENGE        1
+#define DVD_LU_SEND_KEY1       2
+#define DVD_LU_SEND_CHALLENGE  3
+#define DVD_HOST_SEND_KEY2     4
+
+/* Termination states */
+#define DVD_AUTH_ESTABLISHED   5
+#define DVD_AUTH_FAILURE       6
+
+/* Other functions */
+#define DVD_LU_SEND_TITLE_KEY  7
+#define DVD_LU_SEND_ASF                8
+#define DVD_INVALIDATE_AGID    9
+#define DVD_LU_SEND_RPC_STATE  10
+#define DVD_HOST_SEND_RPC_STATE        11
+
+/* State data */
+typedef __u8 dvd_key[5];               /* 40-bit value, MSB is first elem. */
+typedef __u8 dvd_challenge[10];        /* 80-bit value, MSB is first elem. */
+
+struct dvd_lu_send_agid {
+       __u8 type;
+       unsigned agid           : 2;
+};
+
+struct dvd_host_send_challenge {
+       __u8 type;
+       unsigned agid           : 2;
+
+       dvd_challenge chal;
+};
+
+struct dvd_send_key {
+       __u8 type;
+       unsigned agid           : 2;
+
+       dvd_key key;
+};
+
+struct dvd_lu_send_challenge {
+       __u8 type;
+       unsigned agid           : 2;
+
+       dvd_challenge chal;
+};
+
+#define DVD_CPM_NO_COPYRIGHT   0
+#define DVD_CPM_COPYRIGHTED    1
+
+#define DVD_CP_SEC_NONE                0
+#define DVD_CP_SEC_EXIST       1
+
+#define DVD_CGMS_UNRESTRICTED  0
+#define DVD_CGMS_SINGLE                2
+#define DVD_CGMS_RESTRICTED    3
+
+struct dvd_lu_send_title_key {
+       __u8 type;
+       unsigned agid           : 2;
+
+       dvd_key title_key;
+       int lba;
+       unsigned cpm            : 1;
+       unsigned cp_sec         : 1;
+       unsigned cgms           : 2;
+};
+
+struct dvd_lu_send_asf {
+       __u8 type;
+       unsigned agid           : 2;
+
+       unsigned asf            : 1;
+};
+
+struct dvd_host_send_rpcstate {
+       __u8 type;
+       __u8 pdrc;
+};
+
+struct dvd_lu_send_rpcstate {
+       __u8 type               : 2;
+       __u8 vra                : 3;
+       __u8 ucca               : 3;
+       __u8 region_mask;
+       __u8 rpc_scheme;
+};
+
+typedef union {
+       __u8 type;
+
+       struct dvd_lu_send_agid         lsa;
+       struct dvd_host_send_challenge  hsc;
+       struct dvd_send_key             lsk;
+       struct dvd_lu_send_challenge    lsc;
+       struct dvd_send_key             hsk;
+       struct dvd_lu_send_title_key    lstk;
+       struct dvd_lu_send_asf          lsasf;
+       struct dvd_host_send_rpcstate   hrpcs;
+       struct dvd_lu_send_rpcstate     lrpcs;
+} dvd_authinfo;
+
+struct request_sense {
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 valid              : 1;
+       __u8 error_code         : 7;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 error_code         : 7;
+       __u8 valid              : 1;
+#endif
+       __u8 segment_number;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved1          : 2;
+       __u8 ili                : 1;
+       __u8 reserved2          : 1;
+       __u8 sense_key          : 4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 sense_key          : 4;
+       __u8 reserved2          : 1;
+       __u8 ili                : 1;
+       __u8 reserved1          : 2;
+#endif
+       __u8 information[4];
+       __u8 add_sense_len;
+       __u8 command_info[4];
+       __u8 asc;
+       __u8 ascq;
+       __u8 fruc;
+       __u8 sks[3];
+       __u8 asb[46];
+};
+
+/*
+ * feature profile
+ */
+#define CDF_RWRT       0x0020  /* "Random Writable" */
+#define CDF_HWDM       0x0024  /* "Hardware Defect Management" */
+#define CDF_MRW        0x0028
+
+/*
+ * media status bits
+ */
+#define CDM_MRW_NOTMRW                 0
+#define CDM_MRW_BGFORMAT_INACTIVE      1
+#define CDM_MRW_BGFORMAT_ACTIVE                2
+#define CDM_MRW_BGFORMAT_COMPLETE      3
+
+/*
+ * mrw address spaces
+ */
+#define MRW_LBA_DMA                    0
+#define MRW_LBA_GAA                    1
+
+/*
+ * mrw mode pages (first is deprecated) -- probed at init time and
+ * cdi->mrw_mode_page is set
+ */
+#define MRW_MODE_PC_PRE1               0x2c
+#define MRW_MODE_PC                    0x03
+
+struct mrw_feature_desc {
+       __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved1          : 2;
+       __u8 feature_version    : 4;
+       __u8 persistent         : 1;
+       __u8 curr               : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 curr               : 1;
+       __u8 persistent         : 1;
+       __u8 feature_version    : 4;
+       __u8 reserved1          : 2;
+#endif
+       __u8 add_len;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved2          : 7;
+       __u8 write              : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 write              : 1;
+       __u8 reserved2          : 7;
+#endif
+       __u8 reserved3;
+       __u8 reserved4;
+       __u8 reserved5;
+};
+
+/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
+struct rwrt_feature_desc {
+       __be16 feature_code;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved1          : 2;
+       __u8 feature_version    : 4;
+       __u8 persistent         : 1;
+       __u8 curr               : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 curr               : 1;
+       __u8 persistent         : 1;
+       __u8 feature_version    : 4;
+       __u8 reserved1          : 2;
+#endif
+       __u8 add_len;
+       __u32 last_lba;
+       __u32 block_size;
+       __u16 blocking;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved2          : 7;
+       __u8 page_present       : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 page_present       : 1;
+       __u8 reserved2          : 7;
+#endif
+       __u8 reserved3;
+};
+
+typedef struct {
+       __be16 disc_information_length;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved1                  : 3;
+        __u8 erasable                  : 1;
+        __u8 border_status             : 2;
+        __u8 disc_status               : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+        __u8 disc_status               : 2;
+        __u8 border_status             : 2;
+        __u8 erasable                  : 1;
+       __u8 reserved1                  : 3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+       __u8 n_first_track;
+       __u8 n_sessions_lsb;
+       __u8 first_track_lsb;
+       __u8 last_track_lsb;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 did_v                      : 1;
+        __u8 dbc_v                     : 1;
+        __u8 uru                       : 1;
+        __u8 reserved2                 : 2;
+       __u8 dbit                       : 1;
+       __u8 mrw_status                 : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 mrw_status                 : 2;
+       __u8 dbit                       : 1;
+        __u8 reserved2                 : 2;
+        __u8 uru                       : 1;
+        __u8 dbc_v                     : 1;
+       __u8 did_v                      : 1;
+#endif
+       __u8 disc_type;
+       __u8 n_sessions_msb;
+       __u8 first_track_msb;
+       __u8 last_track_msb;
+       __u32 disc_id;
+       __u32 lead_in;
+       __u32 lead_out;
+       __u8 disc_bar_code[8];
+       __u8 reserved3;
+       __u8 n_opc;
+} disc_information;
+
+typedef struct {
+       __be16 track_information_length;
+       __u8 track_lsb;
+       __u8 session_lsb;
+       __u8 reserved1;
+#if defined(__BIG_ENDIAN_BITFIELD)
+       __u8 reserved2                  : 2;
+        __u8 damage                    : 1;
+        __u8 copy                      : 1;
+        __u8 track_mode                        : 4;
+       __u8 rt                         : 1;
+       __u8 blank                      : 1;
+       __u8 packet                     : 1;
+       __u8 fp                         : 1;
+       __u8 data_mode                  : 4;
+       __u8 reserved3                  : 6;
+       __u8 lra_v                      : 1;
+       __u8 nwa_v                      : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+        __u8 track_mode                        : 4;
+        __u8 copy                      : 1;
+        __u8 damage                    : 1;
+       __u8 reserved2                  : 2;
+       __u8 data_mode                  : 4;
+       __u8 fp                         : 1;
+       __u8 packet                     : 1;
+       __u8 blank                      : 1;
+       __u8 rt                         : 1;
+       __u8 nwa_v                      : 1;
+       __u8 lra_v                      : 1;
+       __u8 reserved3                  : 6;
+#endif
+       __be32 track_start;
+       __be32 next_writable;
+       __be32 free_blocks;
+       __be32 fixed_packet_size;
+       __be32 track_size;
+       __be32 last_rec_address;
+} track_information;
+
+struct feature_header {
+       __u32 data_len;
+       __u8 reserved1;
+       __u8 reserved2;
+       __u16 curr_profile;
+};
+
+struct mode_page_header {
+       __be16 mode_data_length;
+       __u8 medium_type;
+       __u8 reserved1;
+       __u8 reserved2;
+       __u8 reserved3;
+       __be16 desc_length;
+};
+
+
+#endif /* _UAPI_LINUX_CDROM_H */
diff --git a/include/uapi/linux/cm4000_cs.h b/include/uapi/linux/cm4000_cs.h
new file mode 100644 (file)
index 0000000..bc51f77
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _UAPI_CM4000_H_
+#define _UAPI_CM4000_H_
+
+#include <linux/types.h>
+
+#define        MAX_ATR                 33
+
+#define        CM4000_MAX_DEV          4
+
+/* those two structures are passed via ioctl() from/to userspace.  They are
+ * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
+ * not to break compilation of userspace apps. -HW */
+
+typedef struct atreq {
+       __s32 atr_len;
+       unsigned char atr[64];
+       __s32 power_act;
+       unsigned char bIFSD;
+       unsigned char bIFSC;
+} atreq_t;
+
+
+/* what is particularly stupid in the original driver is the arch-dependent
+ * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
+ * will lay out the structure members differently than the 64bit kernel.
+ *
+ * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
+ * On 32bit this will make no difference.  With 64bit kernels, it will make
+ * 32bit apps work, too.
+ */
+
+typedef struct ptsreq {
+       __u32 protocol; /*T=0: 2^0, T=1:  2^1*/
+       unsigned char flags;
+       unsigned char pts1;
+       unsigned char pts2;
+       unsigned char pts3;
+} ptsreq_t;
+
+#define        CM_IOC_MAGIC            'c'
+#define        CM_IOC_MAXNR            255
+
+#define        CM_IOCGSTATUS           _IOR (CM_IOC_MAGIC, 0, unsigned char *)
+#define        CM_IOCGATR              _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
+#define        CM_IOCSPTS              _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
+#define        CM_IOCSRDR              _IO  (CM_IOC_MAGIC, 3)
+#define CM_IOCARDOFF            _IO  (CM_IOC_MAGIC, 4)
+
+#define CM_IOSDBGLVL            _IOW(CM_IOC_MAGIC, 250, int*)
+
+/* card and device states */
+#define        CM_CARD_INSERTED                0x01
+#define        CM_CARD_POWERED                 0x02
+#define        CM_ATR_PRESENT                  0x04
+#define        CM_ATR_VALID                    0x08
+#define        CM_STATE_VALID                  0x0f
+/* extra info only from CM4000 */
+#define        CM_NO_READER                    0x10
+#define        CM_BAD_CARD                     0x20
+
+
+#endif /* _UAPI_CM4000_H_ */
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
new file mode 100644 (file)
index 0000000..0d7b499
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * cn_proc.h - process events connector
+ *
+ * Copyright (C) Matt Helsley, IBM Corp. 2005
+ * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
+ * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
+ * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef _UAPICN_PROC_H
+#define _UAPICN_PROC_H
+
+#include <linux/types.h>
+
+/*
+ * Userspace sends this enum to register with the kernel that it is listening
+ * for events on the connector.
+ */
+enum proc_cn_mcast_op {
+       PROC_CN_MCAST_LISTEN = 1,
+       PROC_CN_MCAST_IGNORE = 2
+};
+
+/*
+ * From the user's point of view, the process
+ * ID is the thread group ID and thread ID is the internal
+ * kernel "pid". So, fields are assigned as follow:
+ *
+ *  In user space     -  In  kernel space
+ *
+ * parent process ID  =  parent->tgid
+ * parent thread  ID  =  parent->pid
+ * child  process ID  =  child->tgid
+ * child  thread  ID  =  child->pid
+ */
+
+struct proc_event {
+       enum what {
+               /* Use successive bits so the enums can be used to record
+                * sets of events as well
+                */
+               PROC_EVENT_NONE = 0x00000000,
+               PROC_EVENT_FORK = 0x00000001,
+               PROC_EVENT_EXEC = 0x00000002,
+               PROC_EVENT_UID  = 0x00000004,
+               PROC_EVENT_GID  = 0x00000040,
+               PROC_EVENT_SID  = 0x00000080,
+               PROC_EVENT_PTRACE = 0x00000100,
+               PROC_EVENT_COMM = 0x00000200,
+               /* "next" should be 0x00000400 */
+               /* "last" is the last process event: exit */
+               PROC_EVENT_EXIT = 0x80000000
+       } what;
+       __u32 cpu;
+       __u64 __attribute__((aligned(8))) timestamp_ns;
+               /* Number of nano seconds since system boot */
+       union { /* must be last field of proc_event struct */
+               struct {
+                       __u32 err;
+               } ack;
+
+               struct fork_proc_event {
+                       __kernel_pid_t parent_pid;
+                       __kernel_pid_t parent_tgid;
+                       __kernel_pid_t child_pid;
+                       __kernel_pid_t child_tgid;
+               } fork;
+
+               struct exec_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+               } exec;
+
+               struct id_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+                       union {
+                               __u32 ruid; /* task uid */
+                               __u32 rgid; /* task gid */
+                       } r;
+                       union {
+                               __u32 euid;
+                               __u32 egid;
+                       } e;
+               } id;
+
+               struct sid_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+               } sid;
+
+               struct ptrace_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+                       __kernel_pid_t tracer_pid;
+                       __kernel_pid_t tracer_tgid;
+               } ptrace;
+
+               struct comm_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+                       char           comm[16];
+               } comm;
+
+               struct exit_proc_event {
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
+                       __u32 exit_code, exit_signal;
+               } exit;
+       } event_data;
+};
+
+#endif /* _UAPICN_PROC_H */
diff --git a/include/uapi/linux/coda.h b/include/uapi/linux/coda.h
new file mode 100644 (file)
index 0000000..695fade
--- /dev/null
@@ -0,0 +1,741 @@
+/* 
+   You may distribute this file under either of the two licenses that
+   follow at your discretion.
+*/
+
+/* BLURB lgpl
+
+                           Coda File System
+                              Release 5
+
+          Copyright (c) 1987-1999 Carnegie Mellon University
+                  Additional copyrights listed below
+
+This code is distributed "AS IS" without warranty of any kind under
+the terms of the GNU Library General Public Licence Version 2, as
+shown in the file LICENSE, or under the license shown below. The
+technical and financial contributors to Coda are listed in the file
+CREDITS.
+
+                        Additional copyrights 
+*/
+
+/*
+
+            Coda: an Experimental Distributed File System
+                             Release 4.0
+
+          Copyright (c) 1987-1999 Carnegie Mellon University
+                         All Rights Reserved
+
+Permission  to  use, copy, modify and distribute this software and its
+documentation is hereby granted,  provided  that  both  the  copyright
+notice  and  this  permission  notice  appear  in  all  copies  of the
+software, derivative works or  modified  versions,  and  any  portions
+thereof, and that both notices appear in supporting documentation, and
+that credit is given to Carnegie Mellon University  in  all  documents
+and publicity pertaining to direct or indirect use of this code or its
+derivatives.
+
+CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS  KNOWN  TO  HAVE  BUGS,
+SOME  OF  WHICH MAY HAVE SERIOUS CONSEQUENCES.  CARNEGIE MELLON ALLOWS
+FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.   CARNEGIE  MELLON
+DISCLAIMS  ANY  LIABILITY  OF  ANY  KIND  FOR  ANY  DAMAGES WHATSOEVER
+RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE  OR  OF
+ANY DERIVATIVE WORK.
+
+Carnegie  Mellon  encourages  users  of  this  software  to return any
+improvements or extensions that  they  make,  and  to  grant  Carnegie
+Mellon the rights to redistribute these changes without encumbrance.
+*/
+
+/*
+ *
+ * Based on cfs.h from Mach, but revamped for increased simplicity.
+ * Linux modifications by 
+ * Peter Braam, Aug 1996
+ */
+
+#ifndef _UAPI_CODA_HEADER_
+#define _UAPI_CODA_HEADER_
+
+
+/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
+#if defined(__NetBSD__) || \
+  ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
+#include <sys/types.h>
+#endif 
+
+#ifndef CODA_MAXSYMLINKS
+#define CODA_MAXSYMLINKS 10
+#endif
+
+#if defined(DJGPP) || defined(__CYGWIN32__)
+#ifdef KERNEL
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef u_long ino_t;
+typedef u_long dev_t;
+typedef void * caddr_t;
+#ifdef DOS
+typedef unsigned __int64 u_quad_t;
+#else 
+typedef unsigned long long u_quad_t;
+#endif
+
+#define inline
+
+struct timespec {
+        long       ts_sec;
+        long       ts_nsec;
+};
+#else  /* DJGPP but not KERNEL */
+#include <sys/time.h>
+typedef unsigned long long u_quad_t;
+#endif /* !KERNEL */
+#endif /* !DJGPP */
+
+
+#if defined(__linux__)
+#include <linux/time.h>
+#define cdev_t u_quad_t
+#ifndef __KERNEL__
+#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
+#define _UQUAD_T_ 1
+typedef unsigned long long u_quad_t;
+#endif
+#endif /* __KERNEL__ */
+#else
+#define cdev_t dev_t
+#endif
+
+#ifdef __CYGWIN32__
+struct timespec {
+        time_t  tv_sec;         /* seconds */
+        long    tv_nsec;        /* nanoseconds */
+};
+#endif
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+typedef signed char          int8_t;
+typedef unsigned char      u_int8_t;
+typedef short               int16_t;
+typedef unsigned short    u_int16_t;
+typedef int                 int32_t;
+typedef unsigned int      u_int32_t;
+#endif
+
+
+/*
+ * Cfs constants
+ */
+#define CODA_MAXNAMLEN   255
+#define CODA_MAXPATHLEN  1024
+#define CODA_MAXSYMLINK  10
+
+/* these are Coda's version of O_RDONLY etc combinations
+ * to deal with VFS open modes
+ */
+#define        C_O_READ        0x001
+#define        C_O_WRITE       0x002
+#define C_O_TRUNC       0x010
+#define C_O_EXCL       0x100
+#define C_O_CREAT      0x200
+
+/* these are to find mode bits in Venus */ 
+#define C_M_READ  00400
+#define C_M_WRITE 00200
+
+/* for access Venus will use */
+#define C_A_C_OK    8               /* Test for writing upon create.  */
+#define C_A_R_OK    4               /* Test for read permission.  */
+#define C_A_W_OK    2               /* Test for write permission.  */
+#define C_A_X_OK    1               /* Test for execute permission.  */
+#define C_A_F_OK    0               /* Test for existence.  */
+
+
+
+#ifndef _VENUS_DIRENT_T_
+#define _VENUS_DIRENT_T_ 1
+struct venus_dirent {
+        u_int32_t d_fileno;            /* file number of entry */
+        u_int16_t d_reclen;            /* length of this record */
+        u_int8_t  d_type;                      /* file type, see below */
+        u_int8_t  d_namlen;            /* length of string in d_name */
+        char     d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
+};
+#undef DIRSIZ
+#define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
+                         (((dp)->d_namlen+1 + 3) &~ 3))
+
+/*
+ * File types
+ */
+#define        CDT_UNKNOWN      0
+#define        CDT_FIFO         1
+#define        CDT_CHR          2
+#define        CDT_DIR          4
+#define        CDT_BLK          6
+#define        CDT_REG          8
+#define        CDT_LNK         10
+#define        CDT_SOCK        12
+#define        CDT_WHT         14
+
+/*
+ * Convert between stat structure types and directory types.
+ */
+#define        IFTOCDT(mode)   (((mode) & 0170000) >> 12)
+#define        CDTTOIF(dirtype)        ((dirtype) << 12)
+
+#endif
+
+#ifndef _VUID_T_
+#define _VUID_T_
+typedef u_int32_t vuid_t;
+typedef u_int32_t vgid_t;
+#endif /*_VUID_T_ */
+
+struct CodaFid {
+       u_int32_t opaque[4];
+};
+
+#define coda_f2i(fid)\
+       (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
+
+#ifndef _VENUS_VATTR_T_
+#define _VENUS_VATTR_T_
+/*
+ * Vnode types.  VNON means no type.
+ */
+enum coda_vtype        { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
+
+struct coda_vattr {
+       long            va_type;        /* vnode type (for create) */
+       u_short         va_mode;        /* files access mode and type */
+       short           va_nlink;       /* number of references to file */
+       vuid_t          va_uid;         /* owner user id */
+       vgid_t          va_gid;         /* owner group id */
+       long            va_fileid;      /* file id */
+       u_quad_t        va_size;        /* file size in bytes */
+       long            va_blocksize;   /* blocksize preferred for i/o */
+       struct timespec va_atime;       /* time of last access */
+       struct timespec va_mtime;       /* time of last modification */
+       struct timespec va_ctime;       /* time file changed */
+       u_long          va_gen;         /* generation number of file */
+       u_long          va_flags;       /* flags defined for file */
+       cdev_t          va_rdev;        /* device special file represents */
+       u_quad_t        va_bytes;       /* bytes of disk space held by file */
+       u_quad_t        va_filerev;     /* file modification number */
+};
+
+#endif 
+
+/* structure used by CODA_STATFS for getting cache information from venus */
+struct coda_statfs {
+    int32_t f_blocks;
+    int32_t f_bfree;
+    int32_t f_bavail;
+    int32_t f_files;
+    int32_t f_ffree;
+};
+
+/*
+ * Kernel <--> Venus communications.
+ */
+
+#define CODA_ROOT      2
+#define CODA_OPEN_BY_FD        3
+#define CODA_OPEN      4
+#define CODA_CLOSE     5
+#define CODA_IOCTL     6
+#define CODA_GETATTR   7
+#define CODA_SETATTR   8
+#define CODA_ACCESS    9
+#define CODA_LOOKUP    10
+#define CODA_CREATE    11
+#define CODA_REMOVE    12
+#define CODA_LINK      13
+#define CODA_RENAME    14
+#define CODA_MKDIR     15
+#define CODA_RMDIR     16
+#define CODA_SYMLINK   18
+#define CODA_READLINK  19
+#define CODA_FSYNC     20
+#define CODA_VGET      22
+#define CODA_SIGNAL    23
+#define CODA_REPLACE    24 /* DOWNCALL */
+#define CODA_FLUSH       25 /* DOWNCALL */
+#define CODA_PURGEUSER   26 /* DOWNCALL */
+#define CODA_ZAPFILE     27 /* DOWNCALL */
+#define CODA_ZAPDIR      28 /* DOWNCALL */
+#define CODA_PURGEFID    30 /* DOWNCALL */
+#define CODA_OPEN_BY_PATH 31
+#define CODA_RESOLVE     32
+#define CODA_REINTEGRATE 33
+#define CODA_STATFS     34
+#define CODA_STORE      35
+#define CODA_RELEASE    36
+#define CODA_NCALLS 37
+
+#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
+
+#define VC_MAXDATASIZE     8192
+#define VC_MAXMSGSIZE      sizeof(union inputArgs)+sizeof(union outputArgs) +\
+                            VC_MAXDATASIZE  
+
+#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
+
+#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+
+/*
+ *        Venus <-> Coda  RPC arguments
+ */
+struct coda_in_hdr {
+    u_int32_t opcode;
+    u_int32_t unique;      /* Keep multiple outstanding msgs distinct */
+    pid_t pid;
+    pid_t pgid;
+    vuid_t uid;
+};
+
+/* Really important that opcode and unique are 1st two fields! */
+struct coda_out_hdr {
+    u_int32_t opcode;
+    u_int32_t unique;  
+    u_int32_t result;
+};
+
+/* coda_root: NO_IN */
+struct coda_root_out {
+    struct coda_out_hdr oh;
+    struct CodaFid VFid;
+};
+
+struct coda_root_in {
+    struct coda_in_hdr in;
+};
+
+/* coda_open: */
+struct coda_open_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_open_out {
+    struct coda_out_hdr oh;
+    cdev_t     dev;
+    ino_t      inode;
+};
+
+
+/* coda_store: */
+struct coda_store_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_store_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_release: */
+struct coda_release_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_release_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_close: */
+struct coda_close_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_close_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_ioctl: */
+struct coda_ioctl_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        cmd;
+    int        len;
+    int        rwflag;
+    char *data;                        /* Place holder for data. */
+};
+
+struct coda_ioctl_out {
+    struct coda_out_hdr oh;
+    int        len;
+    caddr_t    data;           /* Place holder for data. */
+};
+
+
+/* coda_getattr: */
+struct coda_getattr_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+};
+
+struct coda_getattr_out {
+    struct coda_out_hdr oh;
+    struct coda_vattr attr;
+};
+
+
+/* coda_setattr: NO_OUT */
+struct coda_setattr_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    struct coda_vattr attr;
+};
+
+struct coda_setattr_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_access: NO_OUT */
+struct coda_access_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_access_out {
+    struct coda_out_hdr out;
+};
+
+
+/* lookup flags */
+#define CLU_CASE_SENSITIVE     0x01
+#define CLU_CASE_INSENSITIVE   0x02
+
+/* coda_lookup: */
+struct  coda_lookup_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int         name;          /* Place holder for data. */
+    int         flags; 
+};
+
+struct coda_lookup_out {
+    struct coda_out_hdr oh;
+    struct CodaFid VFid;
+    int        vtype;
+};
+
+
+/* coda_create: */
+struct coda_create_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    struct coda_vattr attr;
+    int excl;
+    int mode;
+    int        name;           /* Place holder for data. */
+};
+
+struct coda_create_out {
+    struct coda_out_hdr oh;
+    struct CodaFid VFid;
+    struct coda_vattr attr;
+};
+
+
+/* coda_remove: NO_OUT */
+struct coda_remove_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int name;          /* Place holder for data. */
+};
+
+struct coda_remove_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_link: NO_OUT */
+struct coda_link_in {
+    struct coda_in_hdr ih;
+    struct CodaFid sourceFid;  /* cnode to link *to* */
+    struct CodaFid destFid;    /* Directory in which to place link */
+    int tname;         /* Place holder for data. */
+};
+
+struct coda_link_out {
+    struct coda_out_hdr out;
+};
+
+
+/* coda_rename: NO_OUT */
+struct coda_rename_in {
+    struct coda_in_hdr ih;
+    struct CodaFid sourceFid;
+    int        srcname;
+    struct CodaFid destFid;
+    int        destname;
+};
+
+struct coda_rename_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_mkdir: */
+struct coda_mkdir_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    struct coda_vattr attr;
+    int           name;                /* Place holder for data. */
+};
+
+struct coda_mkdir_out {
+    struct coda_out_hdr oh;
+    struct CodaFid VFid;
+    struct coda_vattr attr;
+};
+
+
+/* coda_rmdir: NO_OUT */
+struct coda_rmdir_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int name;          /* Place holder for data. */
+};
+
+struct coda_rmdir_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_symlink: NO_OUT */
+struct coda_symlink_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;       /* Directory to put symlink in */
+    int srcname;
+    struct coda_vattr attr;
+    int tname;
+};
+
+struct coda_symlink_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_readlink: */
+struct coda_readlink_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+};
+
+struct coda_readlink_out {
+    struct coda_out_hdr oh;
+    int        count;
+    caddr_t    data;           /* Place holder for data. */
+};
+
+
+/* coda_fsync: NO_OUT */
+struct coda_fsync_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+};
+
+struct coda_fsync_out {
+    struct coda_out_hdr out;
+};
+
+/* coda_vget: */
+struct coda_vget_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+};
+
+struct coda_vget_out {
+    struct coda_out_hdr oh;
+    struct CodaFid VFid;
+    int        vtype;
+};
+
+
+/* CODA_SIGNAL is out-of-band, doesn't need data. */
+/* CODA_INVALIDATE is a venus->kernel call */
+/* CODA_FLUSH is a venus->kernel call */
+
+/* coda_purgeuser: */
+/* CODA_PURGEUSER is a venus->kernel call */
+struct coda_purgeuser_out {
+    struct coda_out_hdr oh;
+    vuid_t uid;
+};
+
+/* coda_zapfile: */
+/* CODA_ZAPFILE is a venus->kernel call */
+struct coda_zapfile_out {  
+    struct coda_out_hdr oh;
+    struct CodaFid CodaFid;
+};
+
+/* coda_zapdir: */
+/* CODA_ZAPDIR is a venus->kernel call */      
+struct coda_zapdir_out {         
+    struct coda_out_hdr oh;
+    struct CodaFid CodaFid;
+};
+
+/* coda_purgefid: */
+/* CODA_PURGEFID is a venus->kernel call */    
+struct coda_purgefid_out { 
+    struct coda_out_hdr oh;
+    struct CodaFid CodaFid;
+};
+
+/* coda_replace: */
+/* CODA_REPLACE is a venus->kernel call */     
+struct coda_replace_out { /* coda_replace is a venus->kernel call */
+    struct coda_out_hdr oh;
+    struct CodaFid NewFid;
+    struct CodaFid OldFid;
+};
+
+/* coda_open_by_fd: */
+struct coda_open_by_fd_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_open_by_fd_out {
+    struct coda_out_hdr oh;
+    int fd;
+
+#ifdef __KERNEL__
+    struct file *fh; /* not passed from userspace but used in-kernel only */
+#endif
+};
+
+/* coda_open_by_path: */
+struct coda_open_by_path_in {
+    struct coda_in_hdr ih;
+    struct CodaFid VFid;
+    int        flags;
+};
+
+struct coda_open_by_path_out {
+    struct coda_out_hdr oh;
+       int path;
+};
+
+/* coda_statfs: NO_IN */
+struct coda_statfs_in {
+    struct coda_in_hdr in;
+};
+
+struct coda_statfs_out {
+    struct coda_out_hdr oh;
+    struct coda_statfs stat;
+};
+
+/* 
+ * Occasionally, we don't cache the fid returned by CODA_LOOKUP. 
+ * For instance, if the fid is inconsistent. 
+ * This case is handled by setting the top bit of the type result parameter.
+ */
+#define CODA_NOCACHE          0x80000000
+
+union inputArgs {
+    struct coda_in_hdr ih;             /* NB: every struct below begins with an ih */
+    struct coda_open_in coda_open;
+    struct coda_store_in coda_store;
+    struct coda_release_in coda_release;
+    struct coda_close_in coda_close;
+    struct coda_ioctl_in coda_ioctl;
+    struct coda_getattr_in coda_getattr;
+    struct coda_setattr_in coda_setattr;
+    struct coda_access_in coda_access;
+    struct coda_lookup_in coda_lookup;
+    struct coda_create_in coda_create;
+    struct coda_remove_in coda_remove;
+    struct coda_link_in coda_link;
+    struct coda_rename_in coda_rename;
+    struct coda_mkdir_in coda_mkdir;
+    struct coda_rmdir_in coda_rmdir;
+    struct coda_symlink_in coda_symlink;
+    struct coda_readlink_in coda_readlink;
+    struct coda_fsync_in coda_fsync;
+    struct coda_vget_in coda_vget;
+    struct coda_open_by_fd_in coda_open_by_fd;
+    struct coda_open_by_path_in coda_open_by_path;
+    struct coda_statfs_in coda_statfs;
+};
+
+union outputArgs {
+    struct coda_out_hdr oh;            /* NB: every struct below begins with an oh */
+    struct coda_root_out coda_root;
+    struct coda_open_out coda_open;
+    struct coda_ioctl_out coda_ioctl;
+    struct coda_getattr_out coda_getattr;
+    struct coda_lookup_out coda_lookup;
+    struct coda_create_out coda_create;
+    struct coda_mkdir_out coda_mkdir;
+    struct coda_readlink_out coda_readlink;
+    struct coda_vget_out coda_vget;
+    struct coda_purgeuser_out coda_purgeuser;
+    struct coda_zapfile_out coda_zapfile;
+    struct coda_zapdir_out coda_zapdir;
+    struct coda_purgefid_out coda_purgefid;
+    struct coda_replace_out coda_replace;
+    struct coda_open_by_fd_out coda_open_by_fd;
+    struct coda_open_by_path_out coda_open_by_path;
+    struct coda_statfs_out coda_statfs;
+};    
+
+union coda_downcalls {
+    /* CODA_INVALIDATE is a venus->kernel call */
+    /* CODA_FLUSH is a venus->kernel call */
+    struct coda_purgeuser_out purgeuser;
+    struct coda_zapfile_out zapfile;
+    struct coda_zapdir_out zapdir;
+    struct coda_purgefid_out purgefid;
+    struct coda_replace_out replace;
+};
+
+
+/*
+ * Used for identifying usage of "Control" and pioctls
+ */
+
+#define PIOCPARM_MASK 0x0000ffff
+struct ViceIoctl {
+        void __user *in;        /* Data to be transferred in */
+        void __user *out;       /* Data to be transferred out */
+        u_short in_size;        /* Size of input buffer <= 2K */
+        u_short out_size;       /* Maximum size of output buffer, <= 2K */
+};
+
+struct PioctlData {
+        const char __user *path;
+        int follow;
+        struct ViceIoctl vi;
+};
+
+#define CODA_CONTROL           ".CONTROL"
+#define CODA_CONTROLLEN                8
+#define CTL_INO                        -1
+
+/* Data passed to mount */
+
+#define CODA_MOUNT_VERSION 1
+
+struct coda_mount_data {
+       int             version;
+       int             fd;       /* Opened device */
+};
+
+#endif /* _UAPI_CODA_HEADER_ */
diff --git a/include/uapi/linux/coda_psdev.h b/include/uapi/linux/coda_psdev.h
new file mode 100644 (file)
index 0000000..79d0598
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _UAPI__CODA_PSDEV_H
+#define _UAPI__CODA_PSDEV_H
+
+#include <linux/magic.h>
+
+#define CODA_PSDEV_MAJOR 67
+#define MAX_CODADEVS  5           /* how many do we allow */
+
+
+/* messages between coda filesystem in kernel and Venus */
+struct upc_req {
+       struct list_head    uc_chain;
+       caddr_t             uc_data;
+       u_short             uc_flags;
+       u_short             uc_inSize;  /* Size is at most 5000 bytes */
+       u_short             uc_outSize;
+       u_short             uc_opcode;  /* copied from data to save lookup */
+       int                 uc_unique;
+       wait_queue_head_t   uc_sleep;   /* process' wait queue */
+};
+
+#define CODA_REQ_ASYNC  0x1
+#define CODA_REQ_READ   0x2
+#define CODA_REQ_WRITE  0x4
+#define CODA_REQ_ABORT  0x8
+
+#endif /* _UAPI__CODA_PSDEV_H */
diff --git a/include/uapi/linux/connector.h b/include/uapi/linux/connector.h
new file mode 100644 (file)
index 0000000..8761a03
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *     connector.h
+ * 
+ * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _UAPI__CONNECTOR_H
+#define _UAPI__CONNECTOR_H
+
+#include <linux/types.h>
+
+/*
+ * Process Events connector unique ids -- used for message routing
+ */
+#define CN_IDX_PROC                    0x1
+#define CN_VAL_PROC                    0x1
+#define CN_IDX_CIFS                    0x2
+#define CN_VAL_CIFS                     0x1
+#define CN_W1_IDX                      0x3     /* w1 communication */
+#define CN_W1_VAL                      0x1
+#define CN_IDX_V86D                    0x4
+#define CN_VAL_V86D_UVESAFB            0x1
+#define CN_IDX_BB                      0x5     /* BlackBoard, from the TSP GPL sampling framework */
+#define CN_DST_IDX                     0x6
+#define CN_DST_VAL                     0x1
+#define CN_IDX_DM                      0x7     /* Device Mapper */
+#define CN_VAL_DM_USERSPACE_LOG                0x1
+#define CN_IDX_DRBD                    0x8
+#define CN_VAL_DRBD                    0x1
+#define CN_KVP_IDX                     0x9     /* HyperV KVP */
+#define CN_KVP_VAL                     0x1     /* queries from the kernel */
+
+#define CN_NETLINK_USERS               10      /* Highest index + 1 */
+
+/*
+ * Maximum connector's message size.
+ */
+#define CONNECTOR_MAX_MSG_SIZE         16384
+
+/*
+ * idx and val are unique identifiers which 
+ * are used for message routing and 
+ * must be registered in connector.h for in-kernel usage.
+ */
+
+struct cb_id {
+       __u32 idx;
+       __u32 val;
+};
+
+struct cn_msg {
+       struct cb_id id;
+
+       __u32 seq;
+       __u32 ack;
+
+       __u16 len;              /* Length of the following data */
+       __u16 flags;
+       __u8 data[0];
+};
+
+#endif /* _UAPI__CONNECTOR_H */
diff --git a/include/uapi/linux/cramfs_fs.h b/include/uapi/linux/cramfs_fs.h
new file mode 100644 (file)
index 0000000..e4611a9
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef _UAPI__CRAMFS_H
+#define _UAPI__CRAMFS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+#define CRAMFS_SIGNATURE       "Compressed ROMFS"
+
+/*
+ * Width of various bitfields in struct cramfs_inode.
+ * Primarily used to generate warnings in mkcramfs.
+ */
+#define CRAMFS_MODE_WIDTH 16
+#define CRAMFS_UID_WIDTH 16
+#define CRAMFS_SIZE_WIDTH 24
+#define CRAMFS_GID_WIDTH 8
+#define CRAMFS_NAMELEN_WIDTH 6
+#define CRAMFS_OFFSET_WIDTH 26
+
+/*
+ * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
+ * path length is 63 << 2 = 252.
+ */
+#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
+
+/*
+ * Reasonably terse representation of the inode data.
+ */
+struct cramfs_inode {
+       __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
+       /* SIZE for device files is i_rdev */
+       __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
+       /* NAMELEN is the length of the file name, divided by 4 and
+           rounded up.  (cramfs doesn't support hard links.) */
+       /* OFFSET: For symlinks and non-empty regular files, this
+          contains the offset (divided by 4) of the file data in
+          compressed form (starting with an array of block pointers;
+          see README).  For non-empty directories it is the offset
+          (divided by 4) of the inode of the first file in that
+          directory.  For anything else, offset is zero. */
+       __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
+};
+
+struct cramfs_info {
+       __u32 crc;
+       __u32 edition;
+       __u32 blocks;
+       __u32 files;
+};
+
+/*
+ * Superblock information at the beginning of the FS.
+ */
+struct cramfs_super {
+       __u32 magic;                    /* 0x28cd3d45 - random number */
+       __u32 size;                     /* length in bytes */
+       __u32 flags;                    /* feature flags */
+       __u32 future;                   /* reserved for future use */
+       __u8 signature[16];             /* "Compressed ROMFS" */
+       struct cramfs_info fsid;        /* unique filesystem info */
+       __u8 name[16];                  /* user-defined name */
+       struct cramfs_inode root;       /* root inode data */
+};
+
+/*
+ * Feature flags
+ *
+ * 0x00000000 - 0x000000ff: features that work for all past kernels
+ * 0x00000100 - 0xffffffff: features that don't work for past kernels
+ */
+#define CRAMFS_FLAG_FSID_VERSION_2     0x00000001      /* fsid version #2 */
+#define CRAMFS_FLAG_SORTED_DIRS                0x00000002      /* sorted dirs */
+#define CRAMFS_FLAG_HOLES              0x00000100      /* support for holes */
+#define CRAMFS_FLAG_WRONG_SIGNATURE    0x00000200      /* reserved */
+#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET        0x00000400      /* shifted root fs */
+
+/*
+ * Valid values in super.flags.  Currently we refuse to mount
+ * if (flags & ~CRAMFS_SUPPORTED_FLAGS).  Maybe that should be
+ * changed to test super.future instead.
+ */
+#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
+                               | CRAMFS_FLAG_HOLES \
+                               | CRAMFS_FLAG_WRONG_SIGNATURE \
+                               | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
+
+
+#endif /* _UAPI__CRAMFS_H */
diff --git a/include/uapi/linux/cuda.h b/include/uapi/linux/cuda.h
new file mode 100644 (file)
index 0000000..286f9f1
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Definitions for talking to the CUDA.  The CUDA is a microcontroller
+ * which controls the ADB, system power, RTC, and various other things.
+ *
+ * Copyright (C) 1996 Paul Mackerras.
+ */
+
+#ifndef _UAPI_LINUX_CUDA_H
+#define _UAPI_LINUX_CUDA_H
+
+/* CUDA commands (2nd byte) */
+#define CUDA_WARM_START                0
+#define CUDA_AUTOPOLL          1
+#define CUDA_GET_6805_ADDR     2
+#define CUDA_GET_TIME          3
+#define CUDA_GET_PRAM          7
+#define CUDA_SET_6805_ADDR     8
+#define CUDA_SET_TIME          9
+#define CUDA_POWERDOWN         0xa
+#define CUDA_POWERUP_TIME      0xb
+#define CUDA_SET_PRAM          0xc
+#define CUDA_MS_RESET          0xd
+#define CUDA_SEND_DFAC         0xe
+#define CUDA_RESET_SYSTEM      0x11
+#define CUDA_SET_IPL           0x12
+#define CUDA_SET_AUTO_RATE     0x14
+#define CUDA_GET_AUTO_RATE     0x16
+#define CUDA_SET_DEVICE_LIST   0x19
+#define CUDA_GET_DEVICE_LIST   0x1a
+#define CUDA_GET_SET_IIC       0x22
+
+
+#endif /* _UAPI_LINUX_CUDA_H */
diff --git a/include/uapi/linux/cyclades.h b/include/uapi/linux/cyclades.h
new file mode 100644 (file)
index 0000000..12b587a
--- /dev/null
@@ -0,0 +1,493 @@
+/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
+ * linux/include/linux/cyclades.h
+ *
+ * This file was initially written by
+ * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
+ * Ivan Passos <ivan@cyclades.com>.
+ *
+ * This file contains the general definitions for the cyclades.c driver
+ *$Log: cyclades.h,v $
+ *Revision 3.1  2002/01/29 11:36:16  henrique
+ *added throttle field on struct cyclades_port to indicate whether the
+ *port is throttled or not
+ *
+ *Revision 3.1  2000/04/19 18:52:52  ivan
+ *converted address fields to unsigned long and added fields for physical
+ *addresses on cyclades_card structure;
+ *
+ *Revision 3.0  1998/11/02 14:20:59  ivan
+ *added nports field on cyclades_card structure;
+ *
+ *Revision 2.5  1998/08/03 16:57:01  ivan
+ *added cyclades_idle_stats structure;
+ * 
+ *Revision 2.4  1998/06/01 12:09:53  ivan
+ *removed closing_wait2 from cyclades_port structure;
+ *
+ *Revision 2.3  1998/03/16 18:01:12  ivan
+ *changes in the cyclades_port structure to get it closer to the 
+ *standard serial port structure;
+ *added constants for new ioctls;
+ *
+ *Revision 2.2  1998/02/17 16:50:00  ivan
+ *changes in the cyclades_port structure (addition of shutdown_wait and 
+ *chip_rev variables);
+ *added constants for new ioctls and for CD1400 rev. numbers.
+ *
+ *Revision 2.1 1997/10/24 16:03:00  ivan
+ *added rflow (which allows enabling the CD1400 special flow control 
+ *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to 
+ *cyclades_port structure;
+ *added Alpha support
+ *
+ *Revision 2.0  1997/06/30 10:30:00  ivan
+ *added some new doorbell command constants related to IOCTLW and
+ *UART error signaling
+ *
+ *Revision 1.8  1997/06/03 15:30:00  ivan
+ *added constant ZFIRM_HLT
+ *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
+ *
+ *Revision 1.7  1997/03/26 10:30:00  daniel
+ *new entries at the end of cyclades_port struct to reallocate
+ *variables illegally allocated within card memory.
+ *
+ *Revision 1.6  1996/09/09 18:35:30  bentson
+ *fold in changes for Cyclom-Z -- including structures for
+ *communicating with board as well modest changes to original
+ *structures to support new features.
+ *
+ *Revision 1.5  1995/11/13 21:13:31  bentson
+ *changes suggested by Michael Chastain <mec@duracef.shout.net>
+ *to support use of this file in non-kernel applications
+ *
+ *
+ */
+
+#ifndef _UAPI_LINUX_CYCLADES_H
+#define _UAPI_LINUX_CYCLADES_H
+
+#include <linux/types.h>
+
+struct cyclades_monitor {
+        unsigned long           int_count;
+        unsigned long           char_count;
+        unsigned long           char_max;
+        unsigned long           char_last;
+};
+
+/*
+ * These stats all reflect activity since the device was last initialized.
+ * (i.e., since the port was opened with no other processes already having it
+ * open)
+ */
+struct cyclades_idle_stats {
+    __kernel_time_t in_use;    /* Time device has been in use (secs) */
+    __kernel_time_t recv_idle; /* Time since last char received (secs) */
+    __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
+    unsigned long  recv_bytes; /* Bytes received */
+    unsigned long  xmit_bytes; /* Bytes transmitted */
+    unsigned long  overruns;   /* Input overruns */
+    unsigned long  frame_errs; /* Input framing errors */
+    unsigned long  parity_errs;        /* Input parity errors */
+};
+
+#define CYCLADES_MAGIC  0x4359
+
+#define CYGETMON                0x435901
+#define CYGETTHRESH             0x435902
+#define CYSETTHRESH             0x435903
+#define CYGETDEFTHRESH          0x435904
+#define CYSETDEFTHRESH          0x435905
+#define CYGETTIMEOUT            0x435906
+#define CYSETTIMEOUT            0x435907
+#define CYGETDEFTIMEOUT         0x435908
+#define CYSETDEFTIMEOUT         0x435909
+#define CYSETRFLOW             0x43590a
+#define CYGETRFLOW             0x43590b
+#define CYSETRTSDTR_INV                0x43590c
+#define CYGETRTSDTR_INV                0x43590d
+#define CYZSETPOLLCYCLE                0x43590e
+#define CYZGETPOLLCYCLE                0x43590f
+#define CYGETCD1400VER         0x435910
+#define        CYSETWAIT               0x435912
+#define        CYGETWAIT               0x435913
+
+/*************** CYCLOM-Z ADDITIONS ***************/
+
+#define CZIOC           ('M' << 8)
+#define CZ_NBOARDS      (CZIOC|0xfa)
+#define CZ_BOOT_START   (CZIOC|0xfb)
+#define CZ_BOOT_DATA    (CZIOC|0xfc)
+#define CZ_BOOT_END     (CZIOC|0xfd)
+#define CZ_TEST         (CZIOC|0xfe)
+
+#define CZ_DEF_POLL    (HZ/25)
+
+#define MAX_BOARD       4       /* Max number of boards */
+#define MAX_DEV         256     /* Max number of ports total */
+#define        CYZ_MAX_SPEED   921600
+
+#define        CYZ_FIFO_SIZE   16
+
+#define CYZ_BOOT_NWORDS 0x100
+struct CYZ_BOOT_CTRL {
+        unsigned short  nboard;
+        int             status[MAX_BOARD];
+        int             nchannel[MAX_BOARD];
+        int             fw_rev[MAX_BOARD];
+        unsigned long   offset;
+        unsigned long   data[CYZ_BOOT_NWORDS];
+};
+
+
+#ifndef DP_WINDOW_SIZE
+/*
+ *     Memory Window Sizes
+ */
+
+#define        DP_WINDOW_SIZE          (0x00080000)    /* window size 512 Kb */
+#define        ZE_DP_WINDOW_SIZE       (0x00100000)    /* window size 1 Mb (Ze and
+                                                 8Zo V.2 */
+#define        CTRL_WINDOW_SIZE        (0x00000080)    /* runtime regs 128 bytes */
+
+/*
+ *     CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
+ *     normally will access only interested on the fpga_id, fpga_version,
+ *     start_cpu and stop_cpu.
+ */
+
+struct CUSTOM_REG {
+       __u32   fpga_id;                /* FPGA Identification Register */
+       __u32   fpga_version;           /* FPGA Version Number Register */
+       __u32   cpu_start;              /* CPU start Register (write) */
+       __u32   cpu_stop;               /* CPU stop Register (write) */
+       __u32   misc_reg;               /* Miscellaneous Register */
+       __u32   idt_mode;               /* IDT mode Register */
+       __u32   uart_irq_status;        /* UART IRQ status Register */
+       __u32   clear_timer0_irq;       /* Clear timer interrupt Register */
+       __u32   clear_timer1_irq;       /* Clear timer interrupt Register */
+       __u32   clear_timer2_irq;       /* Clear timer interrupt Register */
+       __u32   test_register;          /* Test Register */
+       __u32   test_count;             /* Test Count Register */
+       __u32   timer_select;           /* Timer select register */
+       __u32   pr_uart_irq_status;     /* Prioritized UART IRQ stat Reg */
+       __u32   ram_wait_state;         /* RAM wait-state Register */
+       __u32   uart_wait_state;        /* UART wait-state Register */
+       __u32   timer_wait_state;       /* timer wait-state Register */
+       __u32   ack_wait_state;         /* ACK wait State Register */
+};
+
+/*
+ *     RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
+ *     registers. This structure can be used to access the 9060 registers
+ *     (memory mapped).
+ */
+
+struct RUNTIME_9060 {
+       __u32   loc_addr_range; /* 00h - Local Address Range */
+       __u32   loc_addr_base;  /* 04h - Local Address Base */
+       __u32   loc_arbitr;     /* 08h - Local Arbitration */
+       __u32   endian_descr;   /* 0Ch - Big/Little Endian Descriptor */
+       __u32   loc_rom_range;  /* 10h - Local ROM Range */
+       __u32   loc_rom_base;   /* 14h - Local ROM Base */
+       __u32   loc_bus_descr;  /* 18h - Local Bus descriptor */
+       __u32   loc_range_mst;  /* 1Ch - Local Range for Master to PCI */
+       __u32   loc_base_mst;   /* 20h - Local Base for Master PCI */
+       __u32   loc_range_io;   /* 24h - Local Range for Master IO */
+       __u32   pci_base_mst;   /* 28h - PCI Base for Master PCI */
+       __u32   pci_conf_io;    /* 2Ch - PCI configuration for Master IO */
+       __u32   filler1;        /* 30h */
+       __u32   filler2;        /* 34h */
+       __u32   filler3;        /* 38h */
+       __u32   filler4;        /* 3Ch */
+       __u32   mail_box_0;     /* 40h - Mail Box 0 */
+       __u32   mail_box_1;     /* 44h - Mail Box 1 */
+       __u32   mail_box_2;     /* 48h - Mail Box 2 */
+       __u32   mail_box_3;     /* 4Ch - Mail Box 3 */
+       __u32   filler5;        /* 50h */
+       __u32   filler6;        /* 54h */
+       __u32   filler7;        /* 58h */
+       __u32   filler8;        /* 5Ch */
+       __u32   pci_doorbell;   /* 60h - PCI to Local Doorbell */
+       __u32   loc_doorbell;   /* 64h - Local to PCI Doorbell */
+       __u32   intr_ctrl_stat; /* 68h - Interrupt Control/Status */
+       __u32   init_ctrl;      /* 6Ch - EEPROM control, Init Control, etc */
+};
+
+/* Values for the Local Base Address re-map register */
+
+#define        WIN_RAM         0x00000001L     /* set the sliding window to RAM */
+#define        WIN_CREG        0x14000001L     /* set the window to custom Registers */
+
+/* Values timer select registers */
+
+#define        TIMER_BY_1M     0x00            /* clock divided by 1M */
+#define        TIMER_BY_256K   0x01            /* clock divided by 256k */
+#define        TIMER_BY_128K   0x02            /* clock divided by 128k */
+#define        TIMER_BY_32K    0x03            /* clock divided by 32k */
+
+/****************** ****************** *******************/
+#endif
+
+#ifndef ZFIRM_ID
+/* #include "zfwint.h" */
+/****************** ****************** *******************/
+/*
+ *     This file contains the definitions for interfacing with the
+ *     Cyclom-Z ZFIRM Firmware.
+ */
+
+/* General Constant definitions */
+
+#define        MAX_CHAN        64              /* max number of channels per board */
+
+/* firmware id structure (set after boot) */
+
+#define ID_ADDRESS     0x00000180L     /* signature/pointer address */
+#define        ZFIRM_ID        0x5557465AL     /* ZFIRM/U signature */
+#define        ZFIRM_HLT       0x59505B5CL     /* ZFIRM needs external power supply */
+#define        ZFIRM_RST       0x56040674L     /* RST signal (due to FW reset) */
+
+#define        ZF_TINACT_DEF   1000            /* default inactivity timeout 
+                                          (1000 ms) */
+#define        ZF_TINACT       ZF_TINACT_DEF
+
+struct FIRM_ID {
+       __u32   signature;              /* ZFIRM/U signature */
+       __u32   zfwctrl_addr;           /* pointer to ZFW_CTRL structure */
+};
+
+/* Op. System id */
+
+#define        C_OS_LINUX      0x00000030      /* generic Linux system */
+
+/* channel op_mode */
+
+#define        C_CH_DISABLE    0x00000000      /* channel is disabled */
+#define        C_CH_TXENABLE   0x00000001      /* channel Tx enabled */
+#define        C_CH_RXENABLE   0x00000002      /* channel Rx enabled */
+#define        C_CH_ENABLE     0x00000003      /* channel Tx/Rx enabled */
+#define        C_CH_LOOPBACK   0x00000004      /* Loopback mode */
+
+/* comm_parity - parity */
+
+#define        C_PR_NONE       0x00000000      /* None */
+#define        C_PR_ODD        0x00000001      /* Odd */
+#define C_PR_EVEN      0x00000002      /* Even */
+#define C_PR_MARK      0x00000004      /* Mark */
+#define C_PR_SPACE     0x00000008      /* Space */
+#define C_PR_PARITY    0x000000ff
+
+#define        C_PR_DISCARD    0x00000100      /* discard char with frame/par error */
+#define C_PR_IGNORE    0x00000200      /* ignore frame/par error */
+
+/* comm_data_l - data length and stop bits */
+
+#define C_DL_CS5       0x00000001
+#define C_DL_CS6       0x00000002
+#define C_DL_CS7       0x00000004
+#define C_DL_CS8       0x00000008
+#define        C_DL_CS         0x0000000f
+#define C_DL_1STOP     0x00000010
+#define C_DL_15STOP    0x00000020
+#define C_DL_2STOP     0x00000040
+#define        C_DL_STOP       0x000000f0
+
+/* interrupt enabling/status */
+
+#define        C_IN_DISABLE    0x00000000      /* zero, disable interrupts */
+#define        C_IN_TXBEMPTY   0x00000001      /* tx buffer empty */
+#define        C_IN_TXLOWWM    0x00000002      /* tx buffer below LWM */
+#define        C_IN_RXHIWM     0x00000010      /* rx buffer above HWM */
+#define        C_IN_RXNNDT     0x00000020      /* rx no new data timeout */
+#define        C_IN_MDCD       0x00000100      /* modem DCD change */
+#define        C_IN_MDSR       0x00000200      /* modem DSR change */
+#define        C_IN_MRI        0x00000400      /* modem RI change */
+#define        C_IN_MCTS       0x00000800      /* modem CTS change */
+#define        C_IN_RXBRK      0x00001000      /* Break received */
+#define        C_IN_PR_ERROR   0x00002000      /* parity error */
+#define        C_IN_FR_ERROR   0x00004000      /* frame error */
+#define C_IN_OVR_ERROR  0x00008000      /* overrun error */
+#define C_IN_RXOFL     0x00010000      /* RX buffer overflow */
+#define C_IN_IOCTLW    0x00020000      /* I/O control w/ wait */
+#define C_IN_MRTS      0x00040000      /* modem RTS drop */
+#define C_IN_ICHAR     0x00080000
+/* flow control */
+
+#define        C_FL_OXX        0x00000001      /* output Xon/Xoff flow control */
+#define        C_FL_IXX        0x00000002      /* output Xon/Xoff flow control */
+#define C_FL_OIXANY    0x00000004      /* output Xon/Xoff (any xon) */
+#define        C_FL_SWFLOW     0x0000000f
+
+/* flow status */
+
+#define        C_FS_TXIDLE     0x00000000      /* no Tx data in the buffer or UART */
+#define        C_FS_SENDING    0x00000001      /* UART is sending data */
+#define        C_FS_SWFLOW     0x00000002      /* Tx is stopped by received Xoff */
+
+/* rs_control/rs_status RS-232 signals */
+
+#define C_RS_PARAM     0x80000000      /* Indicates presence of parameter in 
+                                          IOCTLM command */
+#define        C_RS_RTS        0x00000001      /* RTS */
+#define        C_RS_DTR        0x00000004      /* DTR */
+#define        C_RS_DCD        0x00000100      /* CD */
+#define        C_RS_DSR        0x00000200      /* DSR */
+#define        C_RS_RI         0x00000400      /* RI */
+#define        C_RS_CTS        0x00000800      /* CTS */
+
+/* commands Host <-> Board */
+
+#define        C_CM_RESET      0x01            /* reset/flush buffers */
+#define        C_CM_IOCTL      0x02            /* re-read CH_CTRL */
+#define        C_CM_IOCTLW     0x03            /* re-read CH_CTRL, intr when done */
+#define        C_CM_IOCTLM     0x04            /* RS-232 outputs change */
+#define        C_CM_SENDXOFF   0x10            /* send Xoff */
+#define        C_CM_SENDXON    0x11            /* send Xon */
+#define C_CM_CLFLOW    0x12            /* Clear flow control (resume) */
+#define        C_CM_SENDBRK    0x41            /* send break */
+#define        C_CM_INTBACK    0x42            /* Interrupt back */
+#define        C_CM_SET_BREAK  0x43            /* Tx break on */
+#define        C_CM_CLR_BREAK  0x44            /* Tx break off */
+#define        C_CM_CMD_DONE   0x45            /* Previous command done */
+#define C_CM_INTBACK2  0x46            /* Alternate Interrupt back */
+#define        C_CM_TINACT     0x51            /* set inactivity detection */
+#define        C_CM_IRQ_ENBL   0x52            /* enable generation of interrupts */
+#define        C_CM_IRQ_DSBL   0x53            /* disable generation of interrupts */
+#define        C_CM_ACK_ENBL   0x54            /* enable acknowledged interrupt mode */
+#define        C_CM_ACK_DSBL   0x55            /* disable acknowledged intr mode */
+#define        C_CM_FLUSH_RX   0x56            /* flushes Rx buffer */
+#define        C_CM_FLUSH_TX   0x57            /* flushes Tx buffer */
+#define C_CM_Q_ENABLE  0x58            /* enables queue access from the 
+                                          driver */
+#define C_CM_Q_DISABLE  0x59            /* disables queue access from the 
+                                          driver */
+
+#define        C_CM_TXBEMPTY   0x60            /* Tx buffer is empty */
+#define        C_CM_TXLOWWM    0x61            /* Tx buffer low water mark */
+#define        C_CM_RXHIWM     0x62            /* Rx buffer high water mark */
+#define        C_CM_RXNNDT     0x63            /* rx no new data timeout */
+#define        C_CM_TXFEMPTY   0x64
+#define        C_CM_ICHAR      0x65
+#define        C_CM_MDCD       0x70            /* modem DCD change */
+#define        C_CM_MDSR       0x71            /* modem DSR change */
+#define        C_CM_MRI        0x72            /* modem RI change */
+#define        C_CM_MCTS       0x73            /* modem CTS change */
+#define C_CM_MRTS      0x74            /* modem RTS drop */
+#define        C_CM_RXBRK      0x84            /* Break received */
+#define        C_CM_PR_ERROR   0x85            /* Parity error */
+#define        C_CM_FR_ERROR   0x86            /* Frame error */
+#define C_CM_OVR_ERROR  0x87            /* Overrun error */
+#define C_CM_RXOFL     0x88            /* RX buffer overflow */
+#define        C_CM_CMDERROR   0x90            /* command error */
+#define        C_CM_FATAL      0x91            /* fatal error */
+#define        C_CM_HW_RESET   0x92            /* reset board */
+
+/*
+ *     CH_CTRL - This per port structure contains all parameters
+ *     that control an specific port. It can be seen as the
+ *     configuration registers of a "super-serial-controller".
+ */
+
+struct CH_CTRL {
+       __u32   op_mode;        /* operation mode */
+       __u32   intr_enable;    /* interrupt masking */
+       __u32   sw_flow;        /* SW flow control */
+       __u32   flow_status;    /* output flow status */
+       __u32   comm_baud;      /* baud rate  - numerically specified */
+       __u32   comm_parity;    /* parity */
+       __u32   comm_data_l;    /* data length/stop */
+       __u32   comm_flags;     /* other flags */
+       __u32   hw_flow;        /* HW flow control */
+       __u32   rs_control;     /* RS-232 outputs */
+       __u32   rs_status;      /* RS-232 inputs */
+       __u32   flow_xon;       /* xon char */
+       __u32   flow_xoff;      /* xoff char */
+       __u32   hw_overflow;    /* hw overflow counter */
+       __u32   sw_overflow;    /* sw overflow counter */
+       __u32   comm_error;     /* frame/parity error counter */
+       __u32 ichar;
+       __u32 filler[7];
+};
+
+
+/*
+ *     BUF_CTRL - This per channel structure contains
+ *     all Tx and Rx buffer control for a given channel.
+ */
+
+struct BUF_CTRL        {
+       __u32   flag_dma;       /* buffers are in Host memory */
+       __u32   tx_bufaddr;     /* address of the tx buffer */
+       __u32   tx_bufsize;     /* tx buffer size */
+       __u32   tx_threshold;   /* tx low water mark */
+       __u32   tx_get;         /* tail index tx buf */
+       __u32   tx_put;         /* head index tx buf */
+       __u32   rx_bufaddr;     /* address of the rx buffer */
+       __u32   rx_bufsize;     /* rx buffer size */
+       __u32   rx_threshold;   /* rx high water mark */
+       __u32   rx_get;         /* tail index rx buf */
+       __u32   rx_put;         /* head index rx buf */
+       __u32   filler[5];      /* filler to align structures */
+};
+
+/*
+ *     BOARD_CTRL - This per board structure contains all global 
+ *     control fields related to the board.
+ */
+
+struct BOARD_CTRL {
+
+       /* static info provided by the on-board CPU */
+       __u32   n_channel;      /* number of channels */
+       __u32   fw_version;     /* firmware version */
+
+       /* static info provided by the driver */
+       __u32   op_system;      /* op_system id */
+       __u32   dr_version;     /* driver version */
+
+       /* board control area */
+       __u32   inactivity;     /* inactivity control */
+
+       /* host to FW commands */
+       __u32   hcmd_channel;   /* channel number */
+       __u32   hcmd_param;     /* pointer to parameters */
+
+       /* FW to Host commands */
+       __u32   fwcmd_channel;  /* channel number */
+       __u32   fwcmd_param;    /* pointer to parameters */
+       __u32   zf_int_queue_addr; /* offset for INT_QUEUE structure */
+
+       /* filler so the structures are aligned */
+       __u32   filler[6];
+};
+
+/* Host Interrupt Queue */
+
+#define QUEUE_SIZE     (10*MAX_CHAN)
+
+struct INT_QUEUE {
+       unsigned char   intr_code[QUEUE_SIZE];
+       unsigned long   channel[QUEUE_SIZE];
+       unsigned long   param[QUEUE_SIZE];
+       unsigned long   put;
+       unsigned long   get;
+};
+
+/*
+ *     ZFW_CTRL - This is the data structure that includes all other
+ *     data structures used by the Firmware.
+ */
+struct ZFW_CTRL {
+       struct BOARD_CTRL       board_ctrl;
+       struct CH_CTRL          ch_ctrl[MAX_CHAN];
+       struct BUF_CTRL         buf_ctrl[MAX_CHAN];
+};
+
+/****************** ****************** *******************/
+#endif
+
+#endif /* _UAPI_LINUX_CYCLADES_H */
diff --git a/include/uapi/linux/dccp.h b/include/uapi/linux/dccp.h
new file mode 100644 (file)
index 0000000..52a9cd7
--- /dev/null
@@ -0,0 +1,237 @@
+#ifndef _UAPI_LINUX_DCCP_H
+#define _UAPI_LINUX_DCCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/**
+ * struct dccp_hdr - generic part of DCCP packet header
+ *
+ * @dccph_sport - Relevant port on the endpoint that sent this packet
+ * @dccph_dport - Relevant port on the other endpoint
+ * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
+ * @dccph_ccval - Used by the HC-Sender CCID
+ * @dccph_cscov - Parts of the packet that are covered by the Checksum field
+ * @dccph_checksum - Internet checksum, depends on dccph_cscov
+ * @dccph_x - 0 = 24 bit sequence number, 1 = 48
+ * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
+ * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
+ */
+struct dccp_hdr {
+       __be16  dccph_sport,
+               dccph_dport;
+       __u8    dccph_doff;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8    dccph_cscov:4,
+               dccph_ccval:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u8    dccph_ccval:4,
+               dccph_cscov:4;
+#else
+#error  "Adjust your <asm/byteorder.h> defines"
+#endif
+       __sum16 dccph_checksum;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8    dccph_x:1,
+               dccph_type:4,
+               dccph_reserved:3;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u8    dccph_reserved:3,
+               dccph_type:4,
+               dccph_x:1;
+#else
+#error  "Adjust your <asm/byteorder.h> defines"
+#endif
+       __u8    dccph_seq2;
+       __be16  dccph_seq;
+};
+
+/**
+ * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
+ *
+ * @dccph_seq_low - low 24 bits of a 48 bit seq packet
+ */
+struct dccp_hdr_ext {
+       __be32  dccph_seq_low;
+};
+
+/**
+ * struct dccp_hdr_request - Connection initiation request header
+ *
+ * @dccph_req_service - Service to which the client app wants to connect
+ */
+struct dccp_hdr_request {
+       __be32  dccph_req_service;
+};
+/**
+ * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
+ *
+ * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
+ * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
+ */
+struct dccp_hdr_ack_bits {
+       __be16  dccph_reserved1;
+       __be16  dccph_ack_nr_high;
+       __be32  dccph_ack_nr_low;
+};
+/**
+ * struct dccp_hdr_response - Connection initiation response header
+ *
+ * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
+ * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
+ */
+struct dccp_hdr_response {
+       struct dccp_hdr_ack_bits        dccph_resp_ack;
+       __be32                          dccph_resp_service;
+};
+
+/**
+ * struct dccp_hdr_reset - Unconditionally shut down a connection
+ *
+ * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
+ * @dccph_reset_code - one of %dccp_reset_codes
+ * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
+ */
+struct dccp_hdr_reset {
+       struct dccp_hdr_ack_bits        dccph_reset_ack;
+       __u8                            dccph_reset_code,
+                                       dccph_reset_data[3];
+};
+
+enum dccp_pkt_type {
+       DCCP_PKT_REQUEST = 0,
+       DCCP_PKT_RESPONSE,
+       DCCP_PKT_DATA,
+       DCCP_PKT_ACK,
+       DCCP_PKT_DATAACK,
+       DCCP_PKT_CLOSEREQ,
+       DCCP_PKT_CLOSE,
+       DCCP_PKT_RESET,
+       DCCP_PKT_SYNC,
+       DCCP_PKT_SYNCACK,
+       DCCP_PKT_INVALID,
+};
+
+#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
+
+static inline unsigned int dccp_packet_hdr_len(const __u8 type)
+{
+       if (type == DCCP_PKT_DATA)
+               return 0;
+       if (type == DCCP_PKT_DATAACK    ||
+           type == DCCP_PKT_ACK        ||
+           type == DCCP_PKT_SYNC       ||
+           type == DCCP_PKT_SYNCACK    ||
+           type == DCCP_PKT_CLOSE      ||
+           type == DCCP_PKT_CLOSEREQ)
+               return sizeof(struct dccp_hdr_ack_bits);
+       if (type == DCCP_PKT_REQUEST)
+               return sizeof(struct dccp_hdr_request);
+       if (type == DCCP_PKT_RESPONSE)
+               return sizeof(struct dccp_hdr_response);
+       return sizeof(struct dccp_hdr_reset);
+}
+enum dccp_reset_codes {
+       DCCP_RESET_CODE_UNSPECIFIED = 0,
+       DCCP_RESET_CODE_CLOSED,
+       DCCP_RESET_CODE_ABORTED,
+       DCCP_RESET_CODE_NO_CONNECTION,
+       DCCP_RESET_CODE_PACKET_ERROR,
+       DCCP_RESET_CODE_OPTION_ERROR,
+       DCCP_RESET_CODE_MANDATORY_ERROR,
+       DCCP_RESET_CODE_CONNECTION_REFUSED,
+       DCCP_RESET_CODE_BAD_SERVICE_CODE,
+       DCCP_RESET_CODE_TOO_BUSY,
+       DCCP_RESET_CODE_BAD_INIT_COOKIE,
+       DCCP_RESET_CODE_AGGRESSION_PENALTY,
+
+       DCCP_MAX_RESET_CODES            /* Leave at the end!  */
+};
+
+/* DCCP options */
+enum {
+       DCCPO_PADDING = 0,
+       DCCPO_MANDATORY = 1,
+       DCCPO_MIN_RESERVED = 3,
+       DCCPO_MAX_RESERVED = 31,
+       DCCPO_CHANGE_L = 32,
+       DCCPO_CONFIRM_L = 33,
+       DCCPO_CHANGE_R = 34,
+       DCCPO_CONFIRM_R = 35,
+       DCCPO_NDP_COUNT = 37,
+       DCCPO_ACK_VECTOR_0 = 38,
+       DCCPO_ACK_VECTOR_1 = 39,
+       DCCPO_TIMESTAMP = 41,
+       DCCPO_TIMESTAMP_ECHO = 42,
+       DCCPO_ELAPSED_TIME = 43,
+       DCCPO_MAX = 45,
+       DCCPO_MIN_RX_CCID_SPECIFIC = 128,       /* from sender to receiver */
+       DCCPO_MAX_RX_CCID_SPECIFIC = 191,
+       DCCPO_MIN_TX_CCID_SPECIFIC = 192,       /* from receiver to sender */
+       DCCPO_MAX_TX_CCID_SPECIFIC = 255,
+};
+/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
+#define DCCP_SINGLE_OPT_MAXLEN 253
+
+/* DCCP CCIDS */
+enum {
+       DCCPC_CCID2 = 2,
+       DCCPC_CCID3 = 3,
+};
+
+/* DCCP features (RFC 4340 section 6.4) */
+enum dccp_feature_numbers {
+       DCCPF_RESERVED = 0,
+       DCCPF_CCID = 1,
+       DCCPF_SHORT_SEQNOS = 2,
+       DCCPF_SEQUENCE_WINDOW = 3,
+       DCCPF_ECN_INCAPABLE = 4,
+       DCCPF_ACK_RATIO = 5,
+       DCCPF_SEND_ACK_VECTOR = 6,
+       DCCPF_SEND_NDP_COUNT = 7,
+       DCCPF_MIN_CSUM_COVER = 8,
+       DCCPF_DATA_CHECKSUM = 9,
+       /* 10-127 reserved */
+       DCCPF_MIN_CCID_SPECIFIC = 128,
+       DCCPF_SEND_LEV_RATE = 192,      /* RFC 4342, sec. 8.4 */
+       DCCPF_MAX_CCID_SPECIFIC = 255,
+};
+
+/* DCCP socket control message types for cmsg */
+enum dccp_cmsg_type {
+       DCCP_SCM_PRIORITY = 1,
+       DCCP_SCM_QPOLICY_MAX = 0xFFFF,
+       /* ^-- Up to here reserved exclusively for qpolicy parameters */
+       DCCP_SCM_MAX
+};
+
+/* DCCP priorities for outgoing/queued packets */
+enum dccp_packet_dequeueing_policy {
+       DCCPQ_POLICY_SIMPLE,
+       DCCPQ_POLICY_PRIO,
+       DCCPQ_POLICY_MAX
+};
+
+/* DCCP socket options */
+#define DCCP_SOCKOPT_PACKET_SIZE       1 /* XXX deprecated, without effect */
+#define DCCP_SOCKOPT_SERVICE           2
+#define DCCP_SOCKOPT_CHANGE_L          3
+#define DCCP_SOCKOPT_CHANGE_R          4
+#define DCCP_SOCKOPT_GET_CUR_MPS       5
+#define DCCP_SOCKOPT_SERVER_TIMEWAIT   6
+#define DCCP_SOCKOPT_SEND_CSCOV                10
+#define DCCP_SOCKOPT_RECV_CSCOV                11
+#define DCCP_SOCKOPT_AVAILABLE_CCIDS   12
+#define DCCP_SOCKOPT_CCID              13
+#define DCCP_SOCKOPT_TX_CCID           14
+#define DCCP_SOCKOPT_RX_CCID           15
+#define DCCP_SOCKOPT_QPOLICY_ID                16
+#define DCCP_SOCKOPT_QPOLICY_TXQLEN    17
+#define DCCP_SOCKOPT_CCID_RX_INFO      128
+#define DCCP_SOCKOPT_CCID_TX_INFO      192
+
+/* maximum number of services provided on the same listening port */
+#define DCCP_SERVICE_LIST_MAX_LEN      32
+
+
+#endif /* _UAPI_LINUX_DCCP_H */
diff --git a/include/uapi/linux/dlm.h b/include/uapi/linux/dlm.h
new file mode 100644 (file)
index 0000000..1f73cc0
--- /dev/null
@@ -0,0 +1,75 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
+**  Copyright (C) 2004-2011 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef _UAPI__DLM_DOT_H__
+#define _UAPI__DLM_DOT_H__
+
+/*
+ * Interface to Distributed Lock Manager (DLM)
+ * routines and structures to use DLM lockspaces
+ */
+
+/* Lock levels and flags are here */
+#include <linux/dlmconstants.h>
+#include <linux/types.h>
+
+typedef void dlm_lockspace_t;
+
+/*
+ * Lock status block
+ *
+ * Use this structure to specify the contents of the lock value block.  For a
+ * conversion request, this structure is used to specify the lock ID of the
+ * lock.  DLM writes the status of the lock request and the lock ID assigned
+ * to the request in the lock status block.
+ *
+ * sb_lkid: the returned lock ID.  It is set on new (non-conversion) requests.
+ * It is available when dlm_lock returns.
+ *
+ * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
+ * shown for the DLM_LKF_VALBLK flag.
+ *
+ * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
+ * it was first demoted to NL to avoid conversion deadlock.
+ * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
+ *
+ * sb_status: the returned status of the lock request set prior to AST
+ * execution.  Possible return values:
+ *
+ * 0 if lock request was successful
+ * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
+ * -DLM_EUNLOCK if unlock request was successful
+ * -DLM_ECANCEL if a cancel completed successfully
+ * -EDEADLK if a deadlock was detected
+ * -ETIMEDOUT if the lock request was canceled due to a timeout
+ */
+
+#define DLM_SBF_DEMOTED                0x01
+#define DLM_SBF_VALNOTVALID    0x02
+#define DLM_SBF_ALTMODE                0x04
+
+struct dlm_lksb {
+       int      sb_status;
+       __u32    sb_lkid;
+       char     sb_flags;
+       char *   sb_lvbptr;
+};
+
+/* dlm_new_lockspace() flags */
+
+#define DLM_LSFL_TIMEWARN      0x00000002
+#define DLM_LSFL_FS            0x00000004
+#define DLM_LSFL_NEWEXCL       0x00000008
+
+
+#endif /* _UAPI__DLM_DOT_H__ */
diff --git a/include/uapi/linux/dlm_plock.h b/include/uapi/linux/dlm_plock.h
new file mode 100644 (file)
index 0000000..6ae692c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2005-2008 Red Hat, Inc.  All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ */
+
+#ifndef _UAPI__DLM_PLOCK_DOT_H__
+#define _UAPI__DLM_PLOCK_DOT_H__
+
+#include <linux/types.h>
+
+#define DLM_PLOCK_MISC_NAME            "dlm_plock"
+
+#define DLM_PLOCK_VERSION_MAJOR        1
+#define DLM_PLOCK_VERSION_MINOR        2
+#define DLM_PLOCK_VERSION_PATCH        0
+
+enum {
+       DLM_PLOCK_OP_LOCK = 1,
+       DLM_PLOCK_OP_UNLOCK,
+       DLM_PLOCK_OP_GET,
+};
+
+#define DLM_PLOCK_FL_CLOSE 1
+
+struct dlm_plock_info {
+       __u32 version[3];
+       __u8 optype;
+       __u8 ex;
+       __u8 wait;
+       __u8 flags;
+       __u32 pid;
+       __s32 nodeid;
+       __s32 rv;
+       __u32 fsid;
+       __u64 number;
+       __u64 start;
+       __u64 end;
+       __u64 owner;
+};
+
+
+#endif /* _UAPI__DLM_PLOCK_DOT_H__ */
similarity index 100%
rename from include/linux/dn.h
rename to include/uapi/linux/dn.h
diff --git a/include/uapi/linux/edd.h b/include/uapi/linux/edd.h
new file mode 100644 (file)
index 0000000..89240a0
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * linux/include/linux/edd.h
+ *  Copyright (C) 2002, 2003, 2004 Dell Inc.
+ *  by Matt Domsch <Matt_Domsch@dell.com>
+ *
+ * structures and definitions for the int 13h, ax={41,48}h
+ * BIOS Enhanced Disk Drive Services
+ * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
+ * available at http://www.t13.org/docs2002/d1572r0.pdf.  It is
+ * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
+ *
+ * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch
+ * table in the boot_params that contains a list of BIOS-enumerated
+ * boot devices.
+ * In arch/{i386,x86_64}/kernel/setup.c, this information is
+ * transferred into the edd structure, and in drivers/firmware/edd.c, that
+ * information is used to identify BIOS boot disk.  The code in setup.S
+ * is very sensitive to the size of these structures.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef _UAPI_LINUX_EDD_H
+#define _UAPI_LINUX_EDD_H
+
+#include <linux/types.h>
+
+#define EDDNR 0x1e9            /* addr of number of edd_info structs at EDDBUF
+                                  in boot_params - treat this as 1 byte  */
+#define EDDBUF 0xd00           /* addr of edd_info structs in boot_params */
+#define EDDMAXNR 6             /* number of edd_info structs starting at EDDBUF  */
+#define EDDEXTSIZE 8           /* change these if you muck with the structures */
+#define EDDPARMSIZE 74
+#define CHECKEXTENSIONSPRESENT 0x41
+#define GETDEVICEPARAMETERS 0x48
+#define LEGACYGETDEVICEPARAMETERS 0x08
+#define EDDMAGIC1 0x55AA
+#define EDDMAGIC2 0xAA55
+
+
+#define READ_SECTORS 0x02         /* int13 AH=0x02 is READ_SECTORS command */
+#define EDD_MBR_SIG_OFFSET 0x1B8  /* offset of signature in the MBR */
+#define EDD_MBR_SIG_BUF    0x290  /* addr in boot params */
+#define EDD_MBR_SIG_MAX 16        /* max number of signatures to store */
+#define EDD_MBR_SIG_NR_BUF 0x1ea  /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
+                                    in boot_params - treat this as 1 byte  */
+
+#ifndef __ASSEMBLY__
+
+#define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
+#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
+#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
+#define EDD_EXT_64BIT_EXTENSIONS            (1 << 3)
+
+#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
+#define EDD_INFO_GEOMETRY_VALID                (1 << 1)
+#define EDD_INFO_REMOVABLE                     (1 << 2)
+#define EDD_INFO_WRITE_VERIFY                  (1 << 3)
+#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION     (1 << 4)
+#define EDD_INFO_LOCKABLE                      (1 << 5)
+#define EDD_INFO_NO_MEDIA_PRESENT              (1 << 6)
+#define EDD_INFO_USE_INT13_FN50                (1 << 7)
+
+struct edd_device_params {
+       __u16 length;
+       __u16 info_flags;
+       __u32 num_default_cylinders;
+       __u32 num_default_heads;
+       __u32 sectors_per_track;
+       __u64 number_of_sectors;
+       __u16 bytes_per_sector;
+       __u32 dpte_ptr;         /* 0xFFFFFFFF for our purposes */
+       __u16 key;              /* = 0xBEDD */
+       __u8 device_path_info_length;   /* = 44 */
+       __u8 reserved2;
+       __u16 reserved3;
+       __u8 host_bus_type[4];
+       __u8 interface_type[8];
+       union {
+               struct {
+                       __u16 base_address;
+                       __u16 reserved1;
+                       __u32 reserved2;
+               } __attribute__ ((packed)) isa;
+               struct {
+                       __u8 bus;
+                       __u8 slot;
+                       __u8 function;
+                       __u8 channel;
+                       __u32 reserved;
+               } __attribute__ ((packed)) pci;
+               /* pcix is same as pci */
+               struct {
+                       __u64 reserved;
+               } __attribute__ ((packed)) ibnd;
+               struct {
+                       __u64 reserved;
+               } __attribute__ ((packed)) xprs;
+               struct {
+                       __u64 reserved;
+               } __attribute__ ((packed)) htpt;
+               struct {
+                       __u64 reserved;
+               } __attribute__ ((packed)) unknown;
+       } interface_path;
+       union {
+               struct {
+                       __u8 device;
+                       __u8 reserved1;
+                       __u16 reserved2;
+                       __u32 reserved3;
+                       __u64 reserved4;
+               } __attribute__ ((packed)) ata;
+               struct {
+                       __u8 device;
+                       __u8 lun;
+                       __u8 reserved1;
+                       __u8 reserved2;
+                       __u32 reserved3;
+                       __u64 reserved4;
+               } __attribute__ ((packed)) atapi;
+               struct {
+                       __u16 id;
+                       __u64 lun;
+                       __u16 reserved1;
+                       __u32 reserved2;
+               } __attribute__ ((packed)) scsi;
+               struct {
+                       __u64 serial_number;
+                       __u64 reserved;
+               } __attribute__ ((packed)) usb;
+               struct {
+                       __u64 eui;
+                       __u64 reserved;
+               } __attribute__ ((packed)) i1394;
+               struct {
+                       __u64 wwid;
+                       __u64 lun;
+               } __attribute__ ((packed)) fibre;
+               struct {
+                       __u64 identity_tag;
+                       __u64 reserved;
+               } __attribute__ ((packed)) i2o;
+               struct {
+                       __u32 array_number;
+                       __u32 reserved1;
+                       __u64 reserved2;
+               } __attribute__ ((packed)) raid;
+               struct {
+                       __u8 device;
+                       __u8 reserved1;
+                       __u16 reserved2;
+                       __u32 reserved3;
+                       __u64 reserved4;
+               } __attribute__ ((packed)) sata;
+               struct {
+                       __u64 reserved1;
+                       __u64 reserved2;
+               } __attribute__ ((packed)) unknown;
+       } device_path;
+       __u8 reserved4;
+       __u8 checksum;
+} __attribute__ ((packed));
+
+struct edd_info {
+       __u8 device;
+       __u8 version;
+       __u16 interface_support;
+       __u16 legacy_max_cylinder;
+       __u8 legacy_max_head;
+       __u8 legacy_sectors_per_track;
+       struct edd_device_params params;
+} __attribute__ ((packed));
+
+struct edd {
+       unsigned int mbr_signature[EDD_MBR_SIG_MAX];
+       struct edd_info edd_info[EDDMAXNR];
+       unsigned char mbr_signature_nr;
+       unsigned char edd_info_nr;
+};
+
+#endif                         /*!__ASSEMBLY__ */
+
+#endif /* _UAPI_LINUX_EDD_H */
similarity index 99%
rename from include/linux/elf-fdpic.h
rename to include/uapi/linux/elf-fdpic.h
index 7cd2e80cebc8d4ae3f68ac339a8cb58c6a2eb1a2..1065078938f9f144e7c206301da7f87c24458b11 100644 (file)
@@ -31,6 +31,7 @@ struct elf32_fdpic_loadmap {
 
 #define ELF32_FDPIC_LOADMAP_VERSION    0x0000
 
+#ifndef __KERNEL__
 /*
  * binfmt binary parameters structure
  */
@@ -58,7 +59,6 @@ struct elf_fdpic_params {
 #define ELF_FDPIC_FLAG_PRESENT         0x80000000      /* T if this object is present */
 };
 
-#ifdef __KERNEL__
 #ifdef CONFIG_MMU
 extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
                                      struct elf_fdpic_params *interp_params,
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
new file mode 100644 (file)
index 0000000..126a817
--- /dev/null
@@ -0,0 +1,414 @@
+#ifndef _UAPI_LINUX_ELF_H
+#define _UAPI_LINUX_ELF_H
+
+#include <linux/types.h>
+#include <linux/elf-em.h>
+
+/* 32-bit ELF base types. */
+typedef __u32  Elf32_Addr;
+typedef __u16  Elf32_Half;
+typedef __u32  Elf32_Off;
+typedef __s32  Elf32_Sword;
+typedef __u32  Elf32_Word;
+
+/* 64-bit ELF base types. */
+typedef __u64  Elf64_Addr;
+typedef __u16  Elf64_Half;
+typedef __s16  Elf64_SHalf;
+typedef __u64  Elf64_Off;
+typedef __s32  Elf64_Sword;
+typedef __u32  Elf64_Word;
+typedef __u64  Elf64_Xword;
+typedef __s64  Elf64_Sxword;
+
+/* These constants are for the segment types stored in the image headers */
+#define PT_NULL    0
+#define PT_LOAD    1
+#define PT_DYNAMIC 2
+#define PT_INTERP  3
+#define PT_NOTE    4
+#define PT_SHLIB   5
+#define PT_PHDR    6
+#define PT_TLS     7               /* Thread local storage segment */
+#define PT_LOOS    0x60000000      /* OS-specific */
+#define PT_HIOS    0x6fffffff      /* OS-specific */
+#define PT_LOPROC  0x70000000
+#define PT_HIPROC  0x7fffffff
+#define PT_GNU_EH_FRAME                0x6474e550
+
+#define PT_GNU_STACK   (PT_LOOS + 0x474e551)
+
+/*
+ * Extended Numbering
+ *
+ * If the real number of program header table entries is larger than
+ * or equal to PN_XNUM(0xffff), it is set to sh_info field of the
+ * section header at index 0, and PN_XNUM is set to e_phnum
+ * field. Otherwise, the section header at index 0 is zero
+ * initialized, if it exists.
+ *
+ * Specifications are available in:
+ *
+ * - Sun microsystems: Linker and Libraries.
+ *   Part No: 817-1984-17, September 2008.
+ *   URL: http://docs.sun.com/app/docs/doc/817-1984
+ *
+ * - System V ABI AMD64 Architecture Processor Supplement
+ *   Draft Version 0.99.,
+ *   May 11, 2009.
+ *   URL: http://www.x86-64.org/
+ */
+#define PN_XNUM 0xffff
+
+/* These constants define the different elf file types */
+#define ET_NONE   0
+#define ET_REL    1
+#define ET_EXEC   2
+#define ET_DYN    3
+#define ET_CORE   4
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+/* This is the info that is needed to parse the dynamic section of the file */
+#define DT_NULL                0
+#define DT_NEEDED      1
+#define DT_PLTRELSZ    2
+#define DT_PLTGOT      3
+#define DT_HASH                4
+#define DT_STRTAB      5
+#define DT_SYMTAB      6
+#define DT_RELA                7
+#define DT_RELASZ      8
+#define DT_RELAENT     9
+#define DT_STRSZ       10
+#define DT_SYMENT      11
+#define DT_INIT                12
+#define DT_FINI                13
+#define DT_SONAME      14
+#define DT_RPATH       15
+#define DT_SYMBOLIC    16
+#define DT_REL         17
+#define DT_RELSZ       18
+#define DT_RELENT      19
+#define DT_PLTREL      20
+#define DT_DEBUG       21
+#define DT_TEXTREL     22
+#define DT_JMPREL      23
+#define DT_ENCODING    32
+#define OLD_DT_LOOS    0x60000000
+#define DT_LOOS                0x6000000d
+#define DT_HIOS                0x6ffff000
+#define DT_VALRNGLO    0x6ffffd00
+#define DT_VALRNGHI    0x6ffffdff
+#define DT_ADDRRNGLO   0x6ffffe00
+#define DT_ADDRRNGHI   0x6ffffeff
+#define DT_VERSYM      0x6ffffff0
+#define DT_RELACOUNT   0x6ffffff9
+#define DT_RELCOUNT    0x6ffffffa
+#define DT_FLAGS_1     0x6ffffffb
+#define DT_VERDEF      0x6ffffffc
+#define        DT_VERDEFNUM    0x6ffffffd
+#define DT_VERNEED     0x6ffffffe
+#define        DT_VERNEEDNUM   0x6fffffff
+#define OLD_DT_HIOS     0x6fffffff
+#define DT_LOPROC      0x70000000
+#define DT_HIPROC      0x7fffffff
+
+/* This info is needed when parsing the symbol table */
+#define STB_LOCAL  0
+#define STB_GLOBAL 1
+#define STB_WEAK   2
+
+#define STT_NOTYPE  0
+#define STT_OBJECT  1
+#define STT_FUNC    2
+#define STT_SECTION 3
+#define STT_FILE    4
+#define STT_COMMON  5
+#define STT_TLS     6
+
+#define ELF_ST_BIND(x)         ((x) >> 4)
+#define ELF_ST_TYPE(x)         (((unsigned int) x) & 0xf)
+#define ELF32_ST_BIND(x)       ELF_ST_BIND(x)
+#define ELF32_ST_TYPE(x)       ELF_ST_TYPE(x)
+#define ELF64_ST_BIND(x)       ELF_ST_BIND(x)
+#define ELF64_ST_TYPE(x)       ELF_ST_TYPE(x)
+
+typedef struct dynamic{
+  Elf32_Sword d_tag;
+  union{
+    Elf32_Sword        d_val;
+    Elf32_Addr d_ptr;
+  } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+  Elf64_Sxword d_tag;          /* entry tag value */
+  union {
+    Elf64_Xword d_val;
+    Elf64_Addr d_ptr;
+  } d_un;
+} Elf64_Dyn;
+
+/* The following are used with relocations */
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+#define ELF64_R_SYM(i)                 ((i) >> 32)
+#define ELF64_R_TYPE(i)                        ((i) & 0xffffffff)
+
+typedef struct elf32_rel {
+  Elf32_Addr   r_offset;
+  Elf32_Word   r_info;
+} Elf32_Rel;
+
+typedef struct elf64_rel {
+  Elf64_Addr r_offset; /* Location at which to apply the action */
+  Elf64_Xword r_info;  /* index and type of relocation */
+} Elf64_Rel;
+
+typedef struct elf32_rela{
+  Elf32_Addr   r_offset;
+  Elf32_Word   r_info;
+  Elf32_Sword  r_addend;
+} Elf32_Rela;
+
+typedef struct elf64_rela {
+  Elf64_Addr r_offset; /* Location at which to apply the action */
+  Elf64_Xword r_info;  /* index and type of relocation */
+  Elf64_Sxword r_addend;       /* Constant addend used to compute value */
+} Elf64_Rela;
+
+typedef struct elf32_sym{
+  Elf32_Word   st_name;
+  Elf32_Addr   st_value;
+  Elf32_Word   st_size;
+  unsigned char        st_info;
+  unsigned char        st_other;
+  Elf32_Half   st_shndx;
+} Elf32_Sym;
+
+typedef struct elf64_sym {
+  Elf64_Word st_name;          /* Symbol name, index in string tbl */
+  unsigned char        st_info;        /* Type and binding attributes */
+  unsigned char        st_other;       /* No defined meaning, 0 */
+  Elf64_Half st_shndx;         /* Associated section index */
+  Elf64_Addr st_value;         /* Value of the symbol */
+  Elf64_Xword st_size;         /* Associated symbol size */
+} Elf64_Sym;
+
+
+#define EI_NIDENT      16
+
+typedef struct elf32_hdr{
+  unsigned char        e_ident[EI_NIDENT];
+  Elf32_Half   e_type;
+  Elf32_Half   e_machine;
+  Elf32_Word   e_version;
+  Elf32_Addr   e_entry;  /* Entry point */
+  Elf32_Off    e_phoff;
+  Elf32_Off    e_shoff;
+  Elf32_Word   e_flags;
+  Elf32_Half   e_ehsize;
+  Elf32_Half   e_phentsize;
+  Elf32_Half   e_phnum;
+  Elf32_Half   e_shentsize;
+  Elf32_Half   e_shnum;
+  Elf32_Half   e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct elf64_hdr {
+  unsigned char        e_ident[EI_NIDENT];     /* ELF "magic number" */
+  Elf64_Half e_type;
+  Elf64_Half e_machine;
+  Elf64_Word e_version;
+  Elf64_Addr e_entry;          /* Entry point virtual address */
+  Elf64_Off e_phoff;           /* Program header table file offset */
+  Elf64_Off e_shoff;           /* Section header table file offset */
+  Elf64_Word e_flags;
+  Elf64_Half e_ehsize;
+  Elf64_Half e_phentsize;
+  Elf64_Half e_phnum;
+  Elf64_Half e_shentsize;
+  Elf64_Half e_shnum;
+  Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+/* These constants define the permissions on sections in the program
+   header, p_flags. */
+#define PF_R           0x4
+#define PF_W           0x2
+#define PF_X           0x1
+
+typedef struct elf32_phdr{
+  Elf32_Word   p_type;
+  Elf32_Off    p_offset;
+  Elf32_Addr   p_vaddr;
+  Elf32_Addr   p_paddr;
+  Elf32_Word   p_filesz;
+  Elf32_Word   p_memsz;
+  Elf32_Word   p_flags;
+  Elf32_Word   p_align;
+} Elf32_Phdr;
+
+typedef struct elf64_phdr {
+  Elf64_Word p_type;
+  Elf64_Word p_flags;
+  Elf64_Off p_offset;          /* Segment file offset */
+  Elf64_Addr p_vaddr;          /* Segment virtual address */
+  Elf64_Addr p_paddr;          /* Segment physical address */
+  Elf64_Xword p_filesz;                /* Segment size in file */
+  Elf64_Xword p_memsz;         /* Segment size in memory */
+  Elf64_Xword p_align;         /* Segment alignment, file & memory */
+} Elf64_Phdr;
+
+/* sh_type */
+#define SHT_NULL       0
+#define SHT_PROGBITS   1
+#define SHT_SYMTAB     2
+#define SHT_STRTAB     3
+#define SHT_RELA       4
+#define SHT_HASH       5
+#define SHT_DYNAMIC    6
+#define SHT_NOTE       7
+#define SHT_NOBITS     8
+#define SHT_REL                9
+#define SHT_SHLIB      10
+#define SHT_DYNSYM     11
+#define SHT_NUM                12
+#define SHT_LOPROC     0x70000000
+#define SHT_HIPROC     0x7fffffff
+#define SHT_LOUSER     0x80000000
+#define SHT_HIUSER     0xffffffff
+
+/* sh_flags */
+#define SHF_WRITE      0x1
+#define SHF_ALLOC      0x2
+#define SHF_EXECINSTR  0x4
+#define SHF_MASKPROC   0xf0000000
+
+/* special section indexes */
+#define SHN_UNDEF      0
+#define SHN_LORESERVE  0xff00
+#define SHN_LOPROC     0xff00
+#define SHN_HIPROC     0xff1f
+#define SHN_ABS                0xfff1
+#define SHN_COMMON     0xfff2
+#define SHN_HIRESERVE  0xffff
+typedef struct elf32_shdr {
+  Elf32_Word   sh_name;
+  Elf32_Word   sh_type;
+  Elf32_Word   sh_flags;
+  Elf32_Addr   sh_addr;
+  Elf32_Off    sh_offset;
+  Elf32_Word   sh_size;
+  Elf32_Word   sh_link;
+  Elf32_Word   sh_info;
+  Elf32_Word   sh_addralign;
+  Elf32_Word   sh_entsize;
+} Elf32_Shdr;
+
+typedef struct elf64_shdr {
+  Elf64_Word sh_name;          /* Section name, index in string tbl */
+  Elf64_Word sh_type;          /* Type of section */
+  Elf64_Xword sh_flags;                /* Miscellaneous section attributes */
+  Elf64_Addr sh_addr;          /* Section virtual addr at execution */
+  Elf64_Off sh_offset;         /* Section file offset */
+  Elf64_Xword sh_size;         /* Size of section in bytes */
+  Elf64_Word sh_link;          /* Index of another section */
+  Elf64_Word sh_info;          /* Additional section information */
+  Elf64_Xword sh_addralign;    /* Section alignment */
+  Elf64_Xword sh_entsize;      /* Entry size if section holds table */
+} Elf64_Shdr;
+
+#define        EI_MAG0         0               /* e_ident[] indexes */
+#define        EI_MAG1         1
+#define        EI_MAG2         2
+#define        EI_MAG3         3
+#define        EI_CLASS        4
+#define        EI_DATA         5
+#define        EI_VERSION      6
+#define        EI_OSABI        7
+#define        EI_PAD          8
+
+#define        ELFMAG0         0x7f            /* EI_MAG */
+#define        ELFMAG1         'E'
+#define        ELFMAG2         'L'
+#define        ELFMAG3         'F'
+#define        ELFMAG          "\177ELF"
+#define        SELFMAG         4
+
+#define        ELFCLASSNONE    0               /* EI_CLASS */
+#define        ELFCLASS32      1
+#define        ELFCLASS64      2
+#define        ELFCLASSNUM     3
+
+#define ELFDATANONE    0               /* e_ident[EI_DATA] */
+#define ELFDATA2LSB    1
+#define ELFDATA2MSB    2
+
+#define EV_NONE                0               /* e_version, EI_VERSION */
+#define EV_CURRENT     1
+#define EV_NUM         2
+
+#define ELFOSABI_NONE  0
+#define ELFOSABI_LINUX 3
+
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+
+/*
+ * Notes used in ET_CORE. Architectures export some of the arch register sets
+ * using the corresponding note types via the PTRACE_GETREGSET and
+ * PTRACE_SETREGSET requests.
+ */
+#define NT_PRSTATUS    1
+#define NT_PRFPREG     2
+#define NT_PRPSINFO    3
+#define NT_TASKSTRUCT  4
+#define NT_AUXV                6
+/*
+ * Note to userspace developers: size of NT_SIGINFO note may increase
+ * in the future to accomodate more fields, don't assume it is fixed!
+ */
+#define NT_SIGINFO      0x53494749
+#define NT_FILE         0x46494c45
+#define NT_PRXFPREG     0x46e62b7f      /* copied from gdb5.1/include/elf/common.h */
+#define NT_PPC_VMX     0x100           /* PowerPC Altivec/VMX registers */
+#define NT_PPC_SPE     0x101           /* PowerPC SPE/EVR registers */
+#define NT_PPC_VSX     0x102           /* PowerPC VSX registers */
+#define NT_386_TLS     0x200           /* i386 TLS slots (struct user_desc) */
+#define NT_386_IOPERM  0x201           /* x86 io permission bitmap (1=deny) */
+#define NT_X86_XSTATE  0x202           /* x86 extended state using xsave */
+#define NT_S390_HIGH_GPRS      0x300   /* s390 upper register halves */
+#define NT_S390_TIMER  0x301           /* s390 timer register */
+#define NT_S390_TODCMP 0x302           /* s390 TOD clock comparator register */
+#define NT_S390_TODPREG        0x303           /* s390 TOD programmable register */
+#define NT_S390_CTRS   0x304           /* s390 control registers */
+#define NT_S390_PREFIX 0x305           /* s390 prefix register */
+#define NT_S390_LAST_BREAK     0x306   /* s390 breaking event address */
+#define NT_S390_SYSTEM_CALL    0x307   /* s390 system call restart data */
+#define NT_S390_TDB    0x308           /* s390 transaction diagnostic block */
+#define NT_ARM_VFP     0x400           /* ARM VFP/NEON registers */
+#define NT_ARM_TLS     0x401           /* ARM TLS register */
+#define NT_ARM_HW_BREAK        0x402           /* ARM hardware breakpoint registers */
+#define NT_ARM_HW_WATCH        0x403           /* ARM hardware watchpoint registers */
+
+
+/* Note header in a PT_NOTE section */
+typedef struct elf32_note {
+  Elf32_Word   n_namesz;       /* Name size */
+  Elf32_Word   n_descsz;       /* Content size */
+  Elf32_Word   n_type;         /* Content type */
+} Elf32_Nhdr;
+
+/* Note header in a PT_NOTE section */
+typedef struct elf64_note {
+  Elf64_Word n_namesz; /* Name size */
+  Elf64_Word n_descsz; /* Content size */
+  Elf64_Word n_type;   /* Content type */
+} Elf64_Nhdr;
+
+#endif /* _UAPI_LINUX_ELF_H */
diff --git a/include/uapi/linux/elfcore.h b/include/uapi/linux/elfcore.h
new file mode 100644 (file)
index 0000000..569737c
--- /dev/null
@@ -0,0 +1,100 @@
+#ifndef _UAPI_LINUX_ELFCORE_H
+#define _UAPI_LINUX_ELFCORE_H
+
+#include <linux/types.h>
+#include <linux/signal.h>
+#include <linux/time.h>
+#include <linux/ptrace.h>
+#include <linux/elf.h>
+#include <linux/fs.h>
+
+struct elf_siginfo
+{
+       int     si_signo;                       /* signal number */
+       int     si_code;                        /* extra code */
+       int     si_errno;                       /* errno */
+};
+
+
+#ifndef __KERNEL__
+typedef elf_greg_t greg_t;
+typedef elf_gregset_t gregset_t;
+typedef elf_fpregset_t fpregset_t;
+typedef elf_fpxregset_t fpxregset_t;
+#define NGREG ELF_NGREG
+#endif
+
+/*
+ * Definitions to generate Intel SVR4-like core files.
+ * These mostly have the same names as the SVR4 types with "elf_"
+ * tacked on the front to prevent clashes with linux definitions,
+ * and the typedef forms have been avoided.  This is mostly like
+ * the SVR4 structure, but more Linuxy, with things that Linux does
+ * not support and which gdb doesn't really use excluded.
+ * Fields present but not used are marked with "XXX".
+ */
+struct elf_prstatus
+{
+#if 0
+       long    pr_flags;       /* XXX Process flags */
+       short   pr_why;         /* XXX Reason for process halt */
+       short   pr_what;        /* XXX More detailed reason */
+#endif
+       struct elf_siginfo pr_info;     /* Info associated with signal */
+       short   pr_cursig;              /* Current signal */
+       unsigned long pr_sigpend;       /* Set of pending signals */
+       unsigned long pr_sighold;       /* Set of held signals */
+#if 0
+       struct sigaltstack pr_altstack; /* Alternate stack info */
+       struct sigaction pr_action;     /* Signal action for current sig */
+#endif
+       pid_t   pr_pid;
+       pid_t   pr_ppid;
+       pid_t   pr_pgrp;
+       pid_t   pr_sid;
+       struct timeval pr_utime;        /* User time */
+       struct timeval pr_stime;        /* System time */
+       struct timeval pr_cutime;       /* Cumulative user time */
+       struct timeval pr_cstime;       /* Cumulative system time */
+#if 0
+       long    pr_instr;               /* Current instruction */
+#endif
+       elf_gregset_t pr_reg;   /* GP registers */
+#ifdef CONFIG_BINFMT_ELF_FDPIC
+       /* When using FDPIC, the loadmap addresses need to be communicated
+        * to GDB in order for GDB to do the necessary relocations.  The
+        * fields (below) used to communicate this information are placed
+        * immediately after ``pr_reg'', so that the loadmap addresses may
+        * be viewed as part of the register set if so desired.
+        */
+       unsigned long pr_exec_fdpic_loadmap;
+       unsigned long pr_interp_fdpic_loadmap;
+#endif
+       int pr_fpvalid;         /* True if math co-processor being used.  */
+};
+
+#define ELF_PRARGSZ    (80)    /* Number of chars for args */
+
+struct elf_prpsinfo
+{
+       char    pr_state;       /* numeric process state */
+       char    pr_sname;       /* char for pr_state */
+       char    pr_zomb;        /* zombie */
+       char    pr_nice;        /* nice val */
+       unsigned long pr_flag;  /* flags */
+       __kernel_uid_t  pr_uid;
+       __kernel_gid_t  pr_gid;
+       pid_t   pr_pid, pr_ppid, pr_pgrp, pr_sid;
+       /* Lots missing */
+       char    pr_fname[16];   /* filename of executable */
+       char    pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
+};
+
+#ifndef __KERNEL__
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+#define PRARGSZ ELF_PRARGSZ 
+#endif
+
+
+#endif /* _UAPI_LINUX_ELFCORE_H */
diff --git a/include/uapi/linux/errno.h b/include/uapi/linux/errno.h
new file mode 100644 (file)
index 0000000..70f2bd3
--- /dev/null
@@ -0,0 +1 @@
+#include <asm/errno.h>
diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h
new file mode 100644 (file)
index 0000000..aacd4fb
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _UAPI_LINUX_ERRQUEUE_H
+#define _UAPI_LINUX_ERRQUEUE_H
+
+#include <linux/types.h>
+
+struct sock_extended_err {
+       __u32   ee_errno;       
+       __u8    ee_origin;
+       __u8    ee_type;
+       __u8    ee_code;
+       __u8    ee_pad;
+       __u32   ee_info;
+       __u32   ee_data;
+};
+
+#define SO_EE_ORIGIN_NONE      0
+#define SO_EE_ORIGIN_LOCAL     1
+#define SO_EE_ORIGIN_ICMP      2
+#define SO_EE_ORIGIN_ICMP6     3
+#define SO_EE_ORIGIN_TXSTATUS  4
+#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
+
+#define SO_EE_OFFENDER(ee)     ((struct sockaddr*)((ee)+1))
+
+
+#endif /* _UAPI_LINUX_ERRQUEUE_H */
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
new file mode 100644 (file)
index 0000000..d3eaaaf
--- /dev/null
@@ -0,0 +1,1085 @@
+/*
+ * ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
+ * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
+ *                                christopher.leech@intel.com,
+ *                                scott.feldman@intel.com)
+ * Portions Copyright (C) Sun Microsystems 2008
+ */
+
+#ifndef _UAPI_LINUX_ETHTOOL_H
+#define _UAPI_LINUX_ETHTOOL_H
+
+#include <linux/types.h>
+#include <linux/if_ether.h>
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd {
+       __u32   cmd;
+       __u32   supported;      /* Features this interface supports */
+       __u32   advertising;    /* Features this interface advertises */
+       __u16   speed;          /* The forced speed (lower bits) in
+                                * Mbps. Please use
+                                * ethtool_cmd_speed()/_set() to
+                                * access it */
+       __u8    duplex;         /* Duplex, half or full */
+       __u8    port;           /* Which connector port */
+       __u8    phy_address;    /* MDIO PHY address (PRTAD for clause 45).
+                                * May be read-only or read-write
+                                * depending on the driver.
+                                */
+       __u8    transceiver;    /* Which transceiver to use */
+       __u8    autoneg;        /* Enable or disable autonegotiation */
+       __u8    mdio_support;   /* MDIO protocols supported.  Read-only.
+                                * Not set by all drivers.
+                                */
+       __u32   maxtxpkt;       /* Tx pkts before generating tx int */
+       __u32   maxrxpkt;       /* Rx pkts before generating rx int */
+       __u16   speed_hi;       /* The forced speed (upper
+                                * bits) in Mbps. Please use
+                                * ethtool_cmd_speed()/_set() to
+                                * access it */
+       __u8    eth_tp_mdix;    /* twisted pair MDI-X status */
+       __u8    eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
+                                  * link should be renegotiated if necessary
+                                  */
+       __u32   lp_advertising; /* Features the link partner advertises */
+       __u32   reserved[2];
+};
+
+static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
+                                        __u32 speed)
+{
+
+       ep->speed = (__u16)speed;
+       ep->speed_hi = (__u16)(speed >> 16);
+}
+
+static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
+{
+       return (ep->speed_hi << 16) | ep->speed;
+}
+
+/* Device supports clause 22 register access to PHY or peripherals
+ * using the interface defined in <linux/mii.h>.  This should not be
+ * set if there are known to be no such peripherals present or if
+ * the driver only emulates clause 22 registers for compatibility.
+ */
+#define ETH_MDIO_SUPPORTS_C22  1
+
+/* Device supports clause 45 register access to PHY or peripherals
+ * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
+ * This should not be set if there are known to be no such peripherals
+ * present.
+ */
+#define ETH_MDIO_SUPPORTS_C45  2
+
+#define ETHTOOL_FWVERS_LEN     32
+#define ETHTOOL_BUSINFO_LEN    32
+/* these strings are set to whatever the driver author decides... */
+struct ethtool_drvinfo {
+       __u32   cmd;
+       char    driver[32];     /* driver short name, "tulip", "eepro100" */
+       char    version[32];    /* driver version string */
+       char    fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
+       char    bus_info[ETHTOOL_BUSINFO_LEN];  /* Bus info for this IF. */
+                               /* For PCI devices, use pci_name(pci_dev). */
+       char    reserved1[32];
+       char    reserved2[12];
+                               /*
+                                * Some struct members below are filled in
+                                * using ops->get_sset_count().  Obtaining
+                                * this info from ethtool_drvinfo is now
+                                * deprecated; Use ETHTOOL_GSSET_INFO
+                                * instead.
+                                */
+       __u32   n_priv_flags;   /* number of flags valid in ETHTOOL_GPFLAGS */
+       __u32   n_stats;        /* number of u64's from ETHTOOL_GSTATS */
+       __u32   testinfo_len;
+       __u32   eedump_len;     /* Size of data from ETHTOOL_GEEPROM (bytes) */
+       __u32   regdump_len;    /* Size of data from ETHTOOL_GREGS (bytes) */
+};
+
+#define SOPASS_MAX     6
+/* wake-on-lan settings */
+struct ethtool_wolinfo {
+       __u32   cmd;
+       __u32   supported;
+       __u32   wolopts;
+       __u8    sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+};
+
+/* for passing single values */
+struct ethtool_value {
+       __u32   cmd;
+       __u32   data;
+};
+
+/* for passing big chunks of data */
+struct ethtool_regs {
+       __u32   cmd;
+       __u32   version; /* driver-specific, indicates different chips/revs */
+       __u32   len; /* bytes */
+       __u8    data[0];
+};
+
+/* for passing EEPROM chunks */
+struct ethtool_eeprom {
+       __u32   cmd;
+       __u32   magic;
+       __u32   offset; /* in bytes */
+       __u32   len; /* in bytes */
+       __u8    data[0];
+};
+
+/**
+ * struct ethtool_eee - Energy Efficient Ethernet information
+ * @cmd: ETHTOOL_{G,S}EEE
+ * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
+ *     for which there is EEE support.
+ * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
+ *     advertised as eee capable.
+ * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
+ *     combinations advertised by the link partner as eee capable.
+ * @eee_active: Result of the eee auto negotiation.
+ * @eee_enabled: EEE configured mode (enabled/disabled).
+ * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
+ *     that eee was negotiated.
+ * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
+ *     its tx lpi (after reaching 'idle' state). Effective only when eee
+ *     was negotiated and tx_lpi_enabled was set.
+ */
+struct ethtool_eee {
+       __u32   cmd;
+       __u32   supported;
+       __u32   advertised;
+       __u32   lp_advertised;
+       __u32   eee_active;
+       __u32   eee_enabled;
+       __u32   tx_lpi_enabled;
+       __u32   tx_lpi_timer;
+       __u32   reserved[2];
+};
+
+/**
+ * struct ethtool_modinfo - plugin module eeprom information
+ * @cmd: %ETHTOOL_GMODULEINFO
+ * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
+ * @eeprom_len: Length of the eeprom
+ *
+ * This structure is used to return the information to
+ * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
+ * The type code indicates the eeprom data format
+ */
+struct ethtool_modinfo {
+       __u32   cmd;
+       __u32   type;
+       __u32   eeprom_len;
+       __u32   reserved[8];
+};
+
+/**
+ * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
+ * @cmd: ETHTOOL_{G,S}COALESCE
+ * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
+ *     a packet arrives.
+ * @rx_max_coalesced_frames: Maximum number of packets to receive
+ *     before an RX interrupt.
+ * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
+ *     this value applies while an IRQ is being serviced by the host.
+ * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
+ *     except that this value applies while an IRQ is being serviced
+ *     by the host.
+ * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
+ *     a packet is sent.
+ * @tx_max_coalesced_frames: Maximum number of packets to be sent
+ *     before a TX interrupt.
+ * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
+ *     this value applies while an IRQ is being serviced by the host.
+ * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
+ *     except that this value applies while an IRQ is being serviced
+ *     by the host.
+ * @stats_block_coalesce_usecs: How many usecs to delay in-memory
+ *     statistics block updates.  Some drivers do not have an
+ *     in-memory statistic block, and in such cases this value is
+ *     ignored.  This value must not be zero.
+ * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
+ * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
+ * @pkt_rate_low: Threshold for low packet rate (packets per second).
+ * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
+ *     a packet arrives, when the packet rate is below @pkt_rate_low.
+ * @rx_max_coalesced_frames_low: Maximum number of packets to be received
+ *     before an RX interrupt, when the packet rate is below @pkt_rate_low.
+ * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
+ *     a packet is sent, when the packet rate is below @pkt_rate_low.
+ * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
+ *     a TX interrupt, when the packet rate is below @pkt_rate_low.
+ * @pkt_rate_high: Threshold for high packet rate (packets per second).
+ * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
+ *     a packet arrives, when the packet rate is above @pkt_rate_high.
+ * @rx_max_coalesced_frames_high: Maximum number of packets to be received
+ *     before an RX interrupt, when the packet rate is above @pkt_rate_high.
+ * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
+ *     a packet is sent, when the packet rate is above @pkt_rate_high.
+ * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
+ *     a TX interrupt, when the packet rate is above @pkt_rate_high.
+ * @rate_sample_interval: How often to do adaptive coalescing packet rate
+ *     sampling, measured in seconds.  Must not be zero.
+ *
+ * Each pair of (usecs, max_frames) fields specifies this exit
+ * condition for interrupt coalescing:
+ *     (usecs > 0 && time_since_first_completion >= usecs) ||
+ *     (max_frames > 0 && completed_frames >= max_frames)
+ * It is illegal to set both usecs and max_frames to zero as this
+ * would cause interrupts to never be generated.  To disable
+ * coalescing, set usecs = 0 and max_frames = 1.
+ *
+ * Some implementations ignore the value of max_frames and use the
+ * condition:
+ *     time_since_first_completion >= usecs
+ * This is deprecated.  Drivers for hardware that does not support
+ * counting completions should validate that max_frames == !rx_usecs.
+ *
+ * Adaptive RX/TX coalescing is an algorithm implemented by some
+ * drivers to improve latency under low packet rates and improve
+ * throughput under high packet rates.  Some drivers only implement
+ * one of RX or TX adaptive coalescing.  Anything not implemented by
+ * the driver causes these values to be silently ignored.
+ *
+ * When the packet rate is below @pkt_rate_high but above
+ * @pkt_rate_low (both measured in packets per second) the
+ * normal {rx,tx}_* coalescing parameters are used.
+ */
+struct ethtool_coalesce {
+       __u32   cmd;
+       __u32   rx_coalesce_usecs;
+       __u32   rx_max_coalesced_frames;
+       __u32   rx_coalesce_usecs_irq;
+       __u32   rx_max_coalesced_frames_irq;
+       __u32   tx_coalesce_usecs;
+       __u32   tx_max_coalesced_frames;
+       __u32   tx_coalesce_usecs_irq;
+       __u32   tx_max_coalesced_frames_irq;
+       __u32   stats_block_coalesce_usecs;
+       __u32   use_adaptive_rx_coalesce;
+       __u32   use_adaptive_tx_coalesce;
+       __u32   pkt_rate_low;
+       __u32   rx_coalesce_usecs_low;
+       __u32   rx_max_coalesced_frames_low;
+       __u32   tx_coalesce_usecs_low;
+       __u32   tx_max_coalesced_frames_low;
+       __u32   pkt_rate_high;
+       __u32   rx_coalesce_usecs_high;
+       __u32   rx_max_coalesced_frames_high;
+       __u32   tx_coalesce_usecs_high;
+       __u32   tx_max_coalesced_frames_high;
+       __u32   rate_sample_interval;
+};
+
+/* for configuring RX/TX ring parameters */
+struct ethtool_ringparam {
+       __u32   cmd;    /* ETHTOOL_{G,S}RINGPARAM */
+
+       /* Read only attributes.  These indicate the maximum number
+        * of pending RX/TX ring entries the driver will allow the
+        * user to set.
+        */
+       __u32   rx_max_pending;
+       __u32   rx_mini_max_pending;
+       __u32   rx_jumbo_max_pending;
+       __u32   tx_max_pending;
+
+       /* Values changeable by the user.  The valid values are
+        * in the range 1 to the "*_max_pending" counterpart above.
+        */
+       __u32   rx_pending;
+       __u32   rx_mini_pending;
+       __u32   rx_jumbo_pending;
+       __u32   tx_pending;
+};
+
+/**
+ * struct ethtool_channels - configuring number of network channel
+ * @cmd: ETHTOOL_{G,S}CHANNELS
+ * @max_rx: Read only. Maximum number of receive channel the driver support.
+ * @max_tx: Read only. Maximum number of transmit channel the driver support.
+ * @max_other: Read only. Maximum number of other channel the driver support.
+ * @max_combined: Read only. Maximum number of combined channel the driver
+ *     support. Set of queues RX, TX or other.
+ * @rx_count: Valid values are in the range 1 to the max_rx.
+ * @tx_count: Valid values are in the range 1 to the max_tx.
+ * @other_count: Valid values are in the range 1 to the max_other.
+ * @combined_count: Valid values are in the range 1 to the max_combined.
+ *
+ * This can be used to configure RX, TX and other channels.
+ */
+
+struct ethtool_channels {
+       __u32   cmd;
+       __u32   max_rx;
+       __u32   max_tx;
+       __u32   max_other;
+       __u32   max_combined;
+       __u32   rx_count;
+       __u32   tx_count;
+       __u32   other_count;
+       __u32   combined_count;
+};
+
+/* for configuring link flow control parameters */
+struct ethtool_pauseparam {
+       __u32   cmd;    /* ETHTOOL_{G,S}PAUSEPARAM */
+
+       /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
+        * being true) the user may set 'autoneg' here non-zero to have the
+        * pause parameters be auto-negotiated too.  In such a case, the
+        * {rx,tx}_pause values below determine what capabilities are
+        * advertised.
+        *
+        * If 'autoneg' is zero or the link is not being auto-negotiated,
+        * then {rx,tx}_pause force the driver to use/not-use pause
+        * flow control.
+        */
+       __u32   autoneg;
+       __u32   rx_pause;
+       __u32   tx_pause;
+};
+
+#define ETH_GSTRING_LEN                32
+enum ethtool_stringset {
+       ETH_SS_TEST             = 0,
+       ETH_SS_STATS,
+       ETH_SS_PRIV_FLAGS,
+       ETH_SS_NTUPLE_FILTERS,  /* Do not use, GRXNTUPLE is now deprecated */
+       ETH_SS_FEATURES,
+};
+
+/* for passing string sets for data tagging */
+struct ethtool_gstrings {
+       __u32   cmd;            /* ETHTOOL_GSTRINGS */
+       __u32   string_set;     /* string set id e.c. ETH_SS_TEST, etc*/
+       __u32   len;            /* number of strings in the string set */
+       __u8    data[0];
+};
+
+struct ethtool_sset_info {
+       __u32   cmd;            /* ETHTOOL_GSSET_INFO */
+       __u32   reserved;
+       __u64   sset_mask;      /* input: each bit selects an sset to query */
+                               /* output: each bit a returned sset */
+       __u32   data[0];        /* ETH_SS_xxx count, in order, based on bits
+                                  in sset_mask.  One bit implies one
+                                  __u32, two bits implies two
+                                  __u32's, etc. */
+};
+
+/**
+ * enum ethtool_test_flags - flags definition of ethtool_test
+ * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
+ *     only online tests.
+ * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
+ * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
+ *     test.
+ * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
+ */
+
+enum ethtool_test_flags {
+       ETH_TEST_FL_OFFLINE     = (1 << 0),
+       ETH_TEST_FL_FAILED      = (1 << 1),
+       ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
+       ETH_TEST_FL_EXTERNAL_LB_DONE    = (1 << 3),
+};
+
+/* for requesting NIC test and getting results*/
+struct ethtool_test {
+       __u32   cmd;            /* ETHTOOL_TEST */
+       __u32   flags;          /* ETH_TEST_FL_xxx */
+       __u32   reserved;
+       __u32   len;            /* result length, in number of u64 elements */
+       __u64   data[0];
+};
+
+/* for dumping NIC-specific statistics */
+struct ethtool_stats {
+       __u32   cmd;            /* ETHTOOL_GSTATS */
+       __u32   n_stats;        /* number of u64's being returned */
+       __u64   data[0];
+};
+
+struct ethtool_perm_addr {
+       __u32   cmd;            /* ETHTOOL_GPERMADDR */
+       __u32   size;
+       __u8    data[0];
+};
+
+/* boolean flags controlling per-interface behavior characteristics.
+ * When reading, the flag indicates whether or not a certain behavior
+ * is enabled/present.  When writing, the flag indicates whether
+ * or not the driver should turn on (set) or off (clear) a behavior.
+ *
+ * Some behaviors may read-only (unconditionally absent or present).
+ * If such is the case, return EINVAL in the set-flags operation if the
+ * flag differs from the read-only value.
+ */
+enum ethtool_flags {
+       ETH_FLAG_TXVLAN         = (1 << 7),     /* TX VLAN offload enabled */
+       ETH_FLAG_RXVLAN         = (1 << 8),     /* RX VLAN offload enabled */
+       ETH_FLAG_LRO            = (1 << 15),    /* LRO is enabled */
+       ETH_FLAG_NTUPLE         = (1 << 27),    /* N-tuple filters enabled */
+       ETH_FLAG_RXHASH         = (1 << 28),
+};
+
+/* The following structures are for supporting RX network flow
+ * classification and RX n-tuple configuration. Note, all multibyte
+ * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
+ * be in network byte order.
+ */
+
+/**
+ * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @psrc: Source port
+ * @pdst: Destination port
+ * @tos: Type-of-service
+ *
+ * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
+ */
+struct ethtool_tcpip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be16  psrc;
+       __be16  pdst;
+       __u8    tos;
+};
+
+/**
+ * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @spi: Security parameters index
+ * @tos: Type-of-service
+ *
+ * This can be used to specify an IPsec transport or tunnel over IPv4.
+ */
+struct ethtool_ah_espip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be32  spi;
+       __u8    tos;
+};
+
+#define        ETH_RX_NFC_IP4  1
+
+/**
+ * struct ethtool_usrip4_spec - general flow specification for IPv4
+ * @ip4src: Source host
+ * @ip4dst: Destination host
+ * @l4_4_bytes: First 4 bytes of transport (layer 4) header
+ * @tos: Type-of-service
+ * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
+ * @proto: Transport protocol number; mask must be 0
+ */
+struct ethtool_usrip4_spec {
+       __be32  ip4src;
+       __be32  ip4dst;
+       __be32  l4_4_bytes;
+       __u8    tos;
+       __u8    ip_ver;
+       __u8    proto;
+};
+
+union ethtool_flow_union {
+       struct ethtool_tcpip4_spec              tcp_ip4_spec;
+       struct ethtool_tcpip4_spec              udp_ip4_spec;
+       struct ethtool_tcpip4_spec              sctp_ip4_spec;
+       struct ethtool_ah_espip4_spec           ah_ip4_spec;
+       struct ethtool_ah_espip4_spec           esp_ip4_spec;
+       struct ethtool_usrip4_spec              usr_ip4_spec;
+       struct ethhdr                           ether_spec;
+       __u8                                    hdata[60];
+};
+
+struct ethtool_flow_ext {
+       __be16  vlan_etype;
+       __be16  vlan_tci;
+       __be32  data[2];
+};
+
+/**
+ * struct ethtool_rx_flow_spec - classification rule for RX flows
+ * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
+ * @h_u: Flow fields to match (dependent on @flow_type)
+ * @h_ext: Additional fields to match
+ * @m_u: Masks for flow field bits to be matched
+ * @m_ext: Masks for additional field bits to be matched
+ *     Note, all additional fields must be ignored unless @flow_type
+ *     includes the %FLOW_EXT flag.
+ * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
+ *     if packets should be discarded
+ * @location: Location of rule in the table.  Locations must be
+ *     numbered such that a flow matching multiple rules will be
+ *     classified according to the first (lowest numbered) rule.
+ */
+struct ethtool_rx_flow_spec {
+       __u32           flow_type;
+       union ethtool_flow_union h_u;
+       struct ethtool_flow_ext h_ext;
+       union ethtool_flow_union m_u;
+       struct ethtool_flow_ext m_ext;
+       __u64           ring_cookie;
+       __u32           location;
+};
+
+/**
+ * struct ethtool_rxnfc - command to get or set RX flow classification rules
+ * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
+ *     %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
+ *     %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
+ * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
+ * @data: Command-dependent value
+ * @fs: Flow classification rule
+ * @rule_cnt: Number of rules to be affected
+ * @rule_locs: Array of used rule locations
+ *
+ * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
+ * the fields included in the flow hash, e.g. %RXH_IP_SRC.  The following
+ * structure fields must not be used.
+ *
+ * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
+ * on return.
+ *
+ * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
+ * rules on return.  If @data is non-zero on return then it is the
+ * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
+ * driver supports any special location values.  If that flag is not
+ * set in @data then special location values should not be used.
+ *
+ * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
+ * existing rule on entry and @fs contains the rule on return.
+ *
+ * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
+ * user buffer for @rule_locs on entry.  On return, @data is the size
+ * of the rule table, @rule_cnt is the number of defined rules, and
+ * @rule_locs contains the locations of the defined rules.  Drivers
+ * must use the second parameter to get_rxnfc() instead of @rule_locs.
+ *
+ * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
+ * @fs.@location either specifies the location to use or is a special
+ * location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
+ * @fs.@location is the actual rule location.
+ *
+ * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
+ * existing rule on entry.
+ *
+ * A driver supporting the special location values for
+ * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
+ * location, and may remove a rule at a later location (lower
+ * priority) that matches exactly the same set of flows.  The special
+ * values are: %RX_CLS_LOC_ANY, selecting any location;
+ * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
+ * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
+ * location (minimum priority).  Additional special values may be
+ * defined in future and drivers must return -%EINVAL for any
+ * unrecognised value.
+ */
+struct ethtool_rxnfc {
+       __u32                           cmd;
+       __u32                           flow_type;
+       __u64                           data;
+       struct ethtool_rx_flow_spec     fs;
+       __u32                           rule_cnt;
+       __u32                           rule_locs[0];
+};
+
+
+/**
+ * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
+ * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
+ * @size: On entry, the array size of the user buffer, which may be zero.
+ *     On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
+ *     indirection table.
+ * @ring_index: RX ring/queue index for each hash value
+ *
+ * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
+ * should be returned.  For %ETHTOOL_SRXFHINDIR, a @size of zero means
+ * the table should be reset to default values.  This last feature
+ * is not supported by the original implementations.
+ */
+struct ethtool_rxfh_indir {
+       __u32   cmd;
+       __u32   size;
+       __u32   ring_index[0];
+};
+
+/**
+ * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
+ * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
+ * @h_u: Flow field values to match (dependent on @flow_type)
+ * @m_u: Masks for flow field value bits to be ignored
+ * @vlan_tag: VLAN tag to match
+ * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
+ * @data: Driver-dependent data to match
+ * @data_mask: Mask for driver-dependent data bits to be ignored
+ * @action: RX ring/queue index to deliver to (non-negative) or other action
+ *     (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
+ *
+ * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
+ * a field value and mask are both zero this is treated as if all mask
+ * bits are set i.e. the field is ignored.
+ */
+struct ethtool_rx_ntuple_flow_spec {
+       __u32            flow_type;
+       union {
+               struct ethtool_tcpip4_spec              tcp_ip4_spec;
+               struct ethtool_tcpip4_spec              udp_ip4_spec;
+               struct ethtool_tcpip4_spec              sctp_ip4_spec;
+               struct ethtool_ah_espip4_spec           ah_ip4_spec;
+               struct ethtool_ah_espip4_spec           esp_ip4_spec;
+               struct ethtool_usrip4_spec              usr_ip4_spec;
+               struct ethhdr                           ether_spec;
+               __u8                                    hdata[72];
+       } h_u, m_u;
+
+       __u16           vlan_tag;
+       __u16           vlan_tag_mask;
+       __u64           data;
+       __u64           data_mask;
+
+       __s32           action;
+#define ETHTOOL_RXNTUPLE_ACTION_DROP   (-1)    /* drop packet */
+#define ETHTOOL_RXNTUPLE_ACTION_CLEAR  (-2)    /* clear filter */
+};
+
+/**
+ * struct ethtool_rx_ntuple - command to set or clear RX flow filter
+ * @cmd: Command number - %ETHTOOL_SRXNTUPLE
+ * @fs: Flow filter specification
+ */
+struct ethtool_rx_ntuple {
+       __u32                                   cmd;
+       struct ethtool_rx_ntuple_flow_spec      fs;
+};
+
+#define ETHTOOL_FLASH_MAX_FILENAME     128
+enum ethtool_flash_op_type {
+       ETHTOOL_FLASH_ALL_REGIONS       = 0,
+};
+
+/* for passing firmware flashing related parameters */
+struct ethtool_flash {
+       __u32   cmd;
+       __u32   region;
+       char    data[ETHTOOL_FLASH_MAX_FILENAME];
+};
+
+/**
+ * struct ethtool_dump - used for retrieving, setting device dump
+ * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
+ *     %ETHTOOL_SET_DUMP
+ * @version: FW version of the dump, filled in by driver
+ * @flag: driver dependent flag for dump setting, filled in by driver during
+ *        get and filled in by ethtool for set operation.
+ *        flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
+ *        firmware dump is disabled.
+ * @len: length of dump data, used as the length of the user buffer on entry to
+ *      %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
+ *      for %ETHTOOL_GET_DUMP_FLAG command
+ * @data: data collected for get dump data operation
+ */
+
+#define ETH_FW_DUMP_DISABLE 0
+
+struct ethtool_dump {
+       __u32   cmd;
+       __u32   version;
+       __u32   flag;
+       __u32   len;
+       __u8    data[0];
+};
+
+/* for returning and changing feature sets */
+
+/**
+ * struct ethtool_get_features_block - block with state of 32 features
+ * @available: mask of changeable features
+ * @requested: mask of features requested to be enabled if possible
+ * @active: mask of currently enabled features
+ * @never_changed: mask of features not changeable for any device
+ */
+struct ethtool_get_features_block {
+       __u32   available;
+       __u32   requested;
+       __u32   active;
+       __u32   never_changed;
+};
+
+/**
+ * struct ethtool_gfeatures - command to get state of device's features
+ * @cmd: command number = %ETHTOOL_GFEATURES
+ * @size: in: number of elements in the features[] array;
+ *       out: number of elements in features[] needed to hold all features
+ * @features: state of features
+ */
+struct ethtool_gfeatures {
+       __u32   cmd;
+       __u32   size;
+       struct ethtool_get_features_block features[0];
+};
+
+/**
+ * struct ethtool_set_features_block - block with request for 32 features
+ * @valid: mask of features to be changed
+ * @requested: values of features to be changed
+ */
+struct ethtool_set_features_block {
+       __u32   valid;
+       __u32   requested;
+};
+
+/**
+ * struct ethtool_sfeatures - command to request change in device's features
+ * @cmd: command number = %ETHTOOL_SFEATURES
+ * @size: array size of the features[] array
+ * @features: feature change masks
+ */
+struct ethtool_sfeatures {
+       __u32   cmd;
+       __u32   size;
+       struct ethtool_set_features_block features[0];
+};
+
+/**
+ * struct ethtool_ts_info - holds a device's timestamping and PHC association
+ * @cmd: command number = %ETHTOOL_GET_TS_INFO
+ * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
+ * @phc_index: device index of the associated PHC, or -1 if there is none
+ * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
+ * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
+ *
+ * The bits in the 'tx_types' and 'rx_filters' fields correspond to
+ * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
+ * respectively.  For example, if the device supports HWTSTAMP_TX_ON,
+ * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
+ */
+struct ethtool_ts_info {
+       __u32   cmd;
+       __u32   so_timestamping;
+       __s32   phc_index;
+       __u32   tx_types;
+       __u32   tx_reserved[3];
+       __u32   rx_filters;
+       __u32   rx_reserved[3];
+};
+
+/*
+ * %ETHTOOL_SFEATURES changes features present in features[].valid to the
+ * values of corresponding bits in features[].requested. Bits in .requested
+ * not set in .valid or not changeable are ignored.
+ *
+ * Returns %EINVAL when .valid contains undefined or never-changeable bits
+ * or size is not equal to required number of features words (32-bit blocks).
+ * Returns >= 0 if request was completed; bits set in the value mean:
+ *   %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
+ *     changeable (not present in %ETHTOOL_GFEATURES' features[].available)
+ *     those bits were ignored.
+ *   %ETHTOOL_F_WISH - some or all changes requested were recorded but the
+ *      resulting state of bits masked by .valid is not equal to .requested.
+ *      Probably there are other device-specific constraints on some features
+ *      in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
+ *      here as though ignored bits were cleared.
+ *   %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
+ *      compatibility functions. Requested offload state cannot be properly
+ *      managed by kernel.
+ *
+ * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
+ * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
+ * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
+ * significant bit in features[0] fields. Empty strings mark undefined features.
+ */
+enum ethtool_sfeatures_retval_bits {
+       ETHTOOL_F_UNSUPPORTED__BIT,
+       ETHTOOL_F_WISH__BIT,
+       ETHTOOL_F_COMPAT__BIT,
+};
+
+#define ETHTOOL_F_UNSUPPORTED   (1 << ETHTOOL_F_UNSUPPORTED__BIT)
+#define ETHTOOL_F_WISH          (1 << ETHTOOL_F_WISH__BIT)
+#define ETHTOOL_F_COMPAT        (1 << ETHTOOL_F_COMPAT__BIT)
+
+
+/* CMDs currently supported */
+#define ETHTOOL_GSET           0x00000001 /* Get settings. */
+#define ETHTOOL_SSET           0x00000002 /* Set settings. */
+#define ETHTOOL_GDRVINFO       0x00000003 /* Get driver info. */
+#define ETHTOOL_GREGS          0x00000004 /* Get NIC registers. */
+#define ETHTOOL_GWOL           0x00000005 /* Get wake-on-lan options. */
+#define ETHTOOL_SWOL           0x00000006 /* Set wake-on-lan options. */
+#define ETHTOOL_GMSGLVL                0x00000007 /* Get driver message level */
+#define ETHTOOL_SMSGLVL                0x00000008 /* Set driver msg level. */
+#define ETHTOOL_NWAY_RST       0x00000009 /* Restart autonegotiation. */
+/* Get link status for host, i.e. whether the interface *and* the
+ * physical port (if there is one) are up (ethtool_value). */
+#define ETHTOOL_GLINK          0x0000000a
+#define ETHTOOL_GEEPROM                0x0000000b /* Get EEPROM data */
+#define ETHTOOL_SEEPROM                0x0000000c /* Set EEPROM data. */
+#define ETHTOOL_GCOALESCE      0x0000000e /* Get coalesce config */
+#define ETHTOOL_SCOALESCE      0x0000000f /* Set coalesce config. */
+#define ETHTOOL_GRINGPARAM     0x00000010 /* Get ring parameters */
+#define ETHTOOL_SRINGPARAM     0x00000011 /* Set ring parameters. */
+#define ETHTOOL_GPAUSEPARAM    0x00000012 /* Get pause parameters */
+#define ETHTOOL_SPAUSEPARAM    0x00000013 /* Set pause parameters. */
+#define ETHTOOL_GRXCSUM                0x00000014 /* Get RX hw csum enable (ethtool_value) */
+#define ETHTOOL_SRXCSUM                0x00000015 /* Set RX hw csum enable (ethtool_value) */
+#define ETHTOOL_GTXCSUM                0x00000016 /* Get TX hw csum enable (ethtool_value) */
+#define ETHTOOL_STXCSUM                0x00000017 /* Set TX hw csum enable (ethtool_value) */
+#define ETHTOOL_GSG            0x00000018 /* Get scatter-gather enable
+                                           * (ethtool_value) */
+#define ETHTOOL_SSG            0x00000019 /* Set scatter-gather enable
+                                           * (ethtool_value). */
+#define ETHTOOL_TEST           0x0000001a /* execute NIC self-test. */
+#define ETHTOOL_GSTRINGS       0x0000001b /* get specified string set */
+#define ETHTOOL_PHYS_ID                0x0000001c /* identify the NIC */
+#define ETHTOOL_GSTATS         0x0000001d /* get NIC-specific statistics */
+#define ETHTOOL_GTSO           0x0000001e /* Get TSO enable (ethtool_value) */
+#define ETHTOOL_STSO           0x0000001f /* Set TSO enable (ethtool_value) */
+#define ETHTOOL_GPERMADDR      0x00000020 /* Get permanent hardware address */
+#define ETHTOOL_GUFO           0x00000021 /* Get UFO enable (ethtool_value) */
+#define ETHTOOL_SUFO           0x00000022 /* Set UFO enable (ethtool_value) */
+#define ETHTOOL_GGSO           0x00000023 /* Get GSO enable (ethtool_value) */
+#define ETHTOOL_SGSO           0x00000024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GFLAGS         0x00000025 /* Get flags bitmap(ethtool_value) */
+#define ETHTOOL_SFLAGS         0x00000026 /* Set flags bitmap(ethtool_value) */
+#define ETHTOOL_GPFLAGS                0x00000027 /* Get driver-private flags bitmap */
+#define ETHTOOL_SPFLAGS                0x00000028 /* Set driver-private flags bitmap */
+
+#define ETHTOOL_GRXFH          0x00000029 /* Get RX flow hash configuration */
+#define ETHTOOL_SRXFH          0x0000002a /* Set RX flow hash configuration */
+#define ETHTOOL_GGRO           0x0000002b /* Get GRO enable (ethtool_value) */
+#define ETHTOOL_SGRO           0x0000002c /* Set GRO enable (ethtool_value) */
+#define ETHTOOL_GRXRINGS       0x0000002d /* Get RX rings available for LB */
+#define ETHTOOL_GRXCLSRLCNT    0x0000002e /* Get RX class rule count */
+#define ETHTOOL_GRXCLSRULE     0x0000002f /* Get RX classification rule */
+#define ETHTOOL_GRXCLSRLALL    0x00000030 /* Get all RX classification rule */
+#define ETHTOOL_SRXCLSRLDEL    0x00000031 /* Delete RX classification rule */
+#define ETHTOOL_SRXCLSRLINS    0x00000032 /* Insert RX classification rule */
+#define ETHTOOL_FLASHDEV       0x00000033 /* Flash firmware to device */
+#define ETHTOOL_RESET          0x00000034 /* Reset hardware */
+#define ETHTOOL_SRXNTUPLE      0x00000035 /* Add an n-tuple filter to device */
+#define ETHTOOL_GRXNTUPLE      0x00000036 /* deprecated */
+#define ETHTOOL_GSSET_INFO     0x00000037 /* Get string set info */
+#define ETHTOOL_GRXFHINDIR     0x00000038 /* Get RX flow hash indir'n table */
+#define ETHTOOL_SRXFHINDIR     0x00000039 /* Set RX flow hash indir'n table */
+
+#define ETHTOOL_GFEATURES      0x0000003a /* Get device offload settings */
+#define ETHTOOL_SFEATURES      0x0000003b /* Change device offload settings */
+#define ETHTOOL_GCHANNELS      0x0000003c /* Get no of channels */
+#define ETHTOOL_SCHANNELS      0x0000003d /* Set no of channels */
+#define ETHTOOL_SET_DUMP       0x0000003e /* Set dump settings */
+#define ETHTOOL_GET_DUMP_FLAG  0x0000003f /* Get dump settings */
+#define ETHTOOL_GET_DUMP_DATA  0x00000040 /* Get dump data */
+#define ETHTOOL_GET_TS_INFO    0x00000041 /* Get time stamping and PHC info */
+#define ETHTOOL_GMODULEINFO    0x00000042 /* Get plug-in module information */
+#define ETHTOOL_GMODULEEEPROM  0x00000043 /* Get plug-in module eeprom */
+#define ETHTOOL_GEEE           0x00000044 /* Get EEE settings */
+#define ETHTOOL_SEEE           0x00000045 /* Set EEE settings */
+
+/* compatibility with older code */
+#define SPARC_ETH_GSET         ETHTOOL_GSET
+#define SPARC_ETH_SSET         ETHTOOL_SSET
+
+/* Indicates what features are supported by the interface. */
+#define SUPPORTED_10baseT_Half         (1 << 0)
+#define SUPPORTED_10baseT_Full         (1 << 1)
+#define SUPPORTED_100baseT_Half                (1 << 2)
+#define SUPPORTED_100baseT_Full                (1 << 3)
+#define SUPPORTED_1000baseT_Half       (1 << 4)
+#define SUPPORTED_1000baseT_Full       (1 << 5)
+#define SUPPORTED_Autoneg              (1 << 6)
+#define SUPPORTED_TP                   (1 << 7)
+#define SUPPORTED_AUI                  (1 << 8)
+#define SUPPORTED_MII                  (1 << 9)
+#define SUPPORTED_FIBRE                        (1 << 10)
+#define SUPPORTED_BNC                  (1 << 11)
+#define SUPPORTED_10000baseT_Full      (1 << 12)
+#define SUPPORTED_Pause                        (1 << 13)
+#define SUPPORTED_Asym_Pause           (1 << 14)
+#define SUPPORTED_2500baseX_Full       (1 << 15)
+#define SUPPORTED_Backplane            (1 << 16)
+#define SUPPORTED_1000baseKX_Full      (1 << 17)
+#define SUPPORTED_10000baseKX4_Full    (1 << 18)
+#define SUPPORTED_10000baseKR_Full     (1 << 19)
+#define SUPPORTED_10000baseR_FEC       (1 << 20)
+#define SUPPORTED_20000baseMLD2_Full   (1 << 21)
+#define SUPPORTED_20000baseKR2_Full    (1 << 22)
+#define SUPPORTED_40000baseKR4_Full    (1 << 23)
+#define SUPPORTED_40000baseCR4_Full    (1 << 24)
+#define SUPPORTED_40000baseSR4_Full    (1 << 25)
+#define SUPPORTED_40000baseLR4_Full    (1 << 26)
+
+/* Indicates what features are advertised by the interface. */
+#define ADVERTISED_10baseT_Half                (1 << 0)
+#define ADVERTISED_10baseT_Full                (1 << 1)
+#define ADVERTISED_100baseT_Half       (1 << 2)
+#define ADVERTISED_100baseT_Full       (1 << 3)
+#define ADVERTISED_1000baseT_Half      (1 << 4)
+#define ADVERTISED_1000baseT_Full      (1 << 5)
+#define ADVERTISED_Autoneg             (1 << 6)
+#define ADVERTISED_TP                  (1 << 7)
+#define ADVERTISED_AUI                 (1 << 8)
+#define ADVERTISED_MII                 (1 << 9)
+#define ADVERTISED_FIBRE               (1 << 10)
+#define ADVERTISED_BNC                 (1 << 11)
+#define ADVERTISED_10000baseT_Full     (1 << 12)
+#define ADVERTISED_Pause               (1 << 13)
+#define ADVERTISED_Asym_Pause          (1 << 14)
+#define ADVERTISED_2500baseX_Full      (1 << 15)
+#define ADVERTISED_Backplane           (1 << 16)
+#define ADVERTISED_1000baseKX_Full     (1 << 17)
+#define ADVERTISED_10000baseKX4_Full   (1 << 18)
+#define ADVERTISED_10000baseKR_Full    (1 << 19)
+#define ADVERTISED_10000baseR_FEC      (1 << 20)
+#define ADVERTISED_20000baseMLD2_Full  (1 << 21)
+#define ADVERTISED_20000baseKR2_Full   (1 << 22)
+#define ADVERTISED_40000baseKR4_Full   (1 << 23)
+#define ADVERTISED_40000baseCR4_Full   (1 << 24)
+#define ADVERTISED_40000baseSR4_Full   (1 << 25)
+#define ADVERTISED_40000baseLR4_Full   (1 << 26)
+
+/* The following are all involved in forcing a particular link
+ * mode for the device for setting things.  When getting the
+ * devices settings, these indicate the current mode and whether
+ * it was forced up into this mode or autonegotiated.
+ */
+
+/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
+#define SPEED_10               10
+#define SPEED_100              100
+#define SPEED_1000             1000
+#define SPEED_2500             2500
+#define SPEED_10000            10000
+#define SPEED_UNKNOWN          -1
+
+/* Duplex, half or full. */
+#define DUPLEX_HALF            0x00
+#define DUPLEX_FULL            0x01
+#define DUPLEX_UNKNOWN         0xff
+
+/* Which connector port. */
+#define PORT_TP                        0x00
+#define PORT_AUI               0x01
+#define PORT_MII               0x02
+#define PORT_FIBRE             0x03
+#define PORT_BNC               0x04
+#define PORT_DA                        0x05
+#define PORT_NONE              0xef
+#define PORT_OTHER             0xff
+
+/* Which transceiver to use. */
+#define XCVR_INTERNAL          0x00
+#define XCVR_EXTERNAL          0x01
+#define XCVR_DUMMY1            0x02
+#define XCVR_DUMMY2            0x03
+#define XCVR_DUMMY3            0x04
+
+/* Enable or disable autonegotiation.  If this is set to enable,
+ * the forced link modes above are completely ignored.
+ */
+#define AUTONEG_DISABLE                0x00
+#define AUTONEG_ENABLE         0x01
+
+/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
+ * the driver is required to renegotiate link
+ */
+#define ETH_TP_MDI_INVALID     0x00 /* status: unknown; control: unsupported */
+#define ETH_TP_MDI             0x01 /* status: MDI;     control: force MDI */
+#define ETH_TP_MDI_X           0x02 /* status: MDI-X;   control: force MDI-X */
+#define ETH_TP_MDI_AUTO                0x03 /*                  control: auto-select */
+
+/* Wake-On-Lan options. */
+#define WAKE_PHY               (1 << 0)
+#define WAKE_UCAST             (1 << 1)
+#define WAKE_MCAST             (1 << 2)
+#define WAKE_BCAST             (1 << 3)
+#define WAKE_ARP               (1 << 4)
+#define WAKE_MAGIC             (1 << 5)
+#define WAKE_MAGICSECURE       (1 << 6) /* only meaningful if WAKE_MAGIC */
+
+/* L2-L4 network traffic flow types */
+#define        TCP_V4_FLOW     0x01    /* hash or spec (tcp_ip4_spec) */
+#define        UDP_V4_FLOW     0x02    /* hash or spec (udp_ip4_spec) */
+#define        SCTP_V4_FLOW    0x03    /* hash or spec (sctp_ip4_spec) */
+#define        AH_ESP_V4_FLOW  0x04    /* hash only */
+#define        TCP_V6_FLOW     0x05    /* hash only */
+#define        UDP_V6_FLOW     0x06    /* hash only */
+#define        SCTP_V6_FLOW    0x07    /* hash only */
+#define        AH_ESP_V6_FLOW  0x08    /* hash only */
+#define        AH_V4_FLOW      0x09    /* hash or spec (ah_ip4_spec) */
+#define        ESP_V4_FLOW     0x0a    /* hash or spec (esp_ip4_spec) */
+#define        AH_V6_FLOW      0x0b    /* hash only */
+#define        ESP_V6_FLOW     0x0c    /* hash only */
+#define        IP_USER_FLOW    0x0d    /* spec only (usr_ip4_spec) */
+#define        IPV4_FLOW       0x10    /* hash only */
+#define        IPV6_FLOW       0x11    /* hash only */
+#define        ETHER_FLOW      0x12    /* spec only (ether_spec) */
+/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
+#define        FLOW_EXT        0x80000000
+
+/* L3-L4 network traffic flow hash options */
+#define        RXH_L2DA        (1 << 1)
+#define        RXH_VLAN        (1 << 2)
+#define        RXH_L3_PROTO    (1 << 3)
+#define        RXH_IP_SRC      (1 << 4)
+#define        RXH_IP_DST      (1 << 5)
+#define        RXH_L4_B_0_1    (1 << 6) /* src port in case of TCP/UDP/SCTP */
+#define        RXH_L4_B_2_3    (1 << 7) /* dst port in case of TCP/UDP/SCTP */
+#define        RXH_DISCARD     (1 << 31)
+
+#define        RX_CLS_FLOW_DISC        0xffffffffffffffffULL
+
+/* Special RX classification rule insert location values */
+#define RX_CLS_LOC_SPECIAL     0x80000000      /* flag */
+#define RX_CLS_LOC_ANY         0xffffffff
+#define RX_CLS_LOC_FIRST       0xfffffffe
+#define RX_CLS_LOC_LAST                0xfffffffd
+
+/* EEPROM Standards for plug in modules */
+#define ETH_MODULE_SFF_8079            0x1
+#define ETH_MODULE_SFF_8079_LEN                256
+#define ETH_MODULE_SFF_8472            0x2
+#define ETH_MODULE_SFF_8472_LEN                512
+
+/* Reset flags */
+/* The reset() operation must clear the flags for the components which
+ * were actually reset.  On successful return, the flags indicate the
+ * components which were not reset, either because they do not exist
+ * in the hardware or because they cannot be reset independently.  The
+ * driver must never reset any components that were not requested.
+ */
+enum ethtool_reset_flags {
+       /* These flags represent components dedicated to the interface
+        * the command is addressed to.  Shift any flag left by
+        * ETH_RESET_SHARED_SHIFT to reset a shared component of the
+        * same type.
+        */
+       ETH_RESET_MGMT          = 1 << 0,       /* Management processor */
+       ETH_RESET_IRQ           = 1 << 1,       /* Interrupt requester */
+       ETH_RESET_DMA           = 1 << 2,       /* DMA engine */
+       ETH_RESET_FILTER        = 1 << 3,       /* Filtering/flow direction */
+       ETH_RESET_OFFLOAD       = 1 << 4,       /* Protocol offload */
+       ETH_RESET_MAC           = 1 << 5,       /* Media access controller */
+       ETH_RESET_PHY           = 1 << 6,       /* Transceiver/PHY */
+       ETH_RESET_RAM           = 1 << 7,       /* RAM shared between
+                                                * multiple components */
+
+       ETH_RESET_DEDICATED     = 0x0000ffff,   /* All components dedicated to
+                                                * this interface */
+       ETH_RESET_ALL           = 0xffffffff,   /* All components used by this
+                                                * interface, even if shared */
+};
+#define ETH_RESET_SHARED_SHIFT 16
+
+#endif /* _UAPI_LINUX_ETHTOOL_H */
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h
new file mode 100644 (file)
index 0000000..8c99ce7
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ *  include/linux/eventpoll.h ( Efficient event polling implementation )
+ *  Copyright (C) 2001,...,2006         Davide Libenzi
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _UAPI_LINUX_EVENTPOLL_H
+#define _UAPI_LINUX_EVENTPOLL_H
+
+/* For O_CLOEXEC */
+#include <linux/fcntl.h>
+#include <linux/types.h>
+
+/* Flags for epoll_create1.  */
+#define EPOLL_CLOEXEC O_CLOEXEC
+
+/* Valid opcodes to issue to sys_epoll_ctl() */
+#define EPOLL_CTL_ADD 1
+#define EPOLL_CTL_DEL 2
+#define EPOLL_CTL_MOD 3
+#define EPOLL_CTL_DISABLE 4
+
+/*
+ * Request the handling of system wakeup events so as to prevent system suspends
+ * from happening while those events are being processed.
+ *
+ * Assuming neither EPOLLET nor EPOLLONESHOT is set, system suspends will not be
+ * re-allowed until epoll_wait is called again after consuming the wakeup
+ * event(s).
+ *
+ * Requires CAP_BLOCK_SUSPEND
+ */
+#define EPOLLWAKEUP (1 << 29)
+
+/* Set the One Shot behaviour for the target file descriptor */
+#define EPOLLONESHOT (1 << 30)
+
+/* Set the Edge Triggered behaviour for the target file descriptor */
+#define EPOLLET (1 << 31)
+
+/* 
+ * On x86-64 make the 64bit structure have the same alignment as the
+ * 32bit structure. This makes 32bit emulation easier.
+ *
+ * UML/x86_64 needs the same packing as x86_64
+ */
+#ifdef __x86_64__
+#define EPOLL_PACKED __attribute__((packed))
+#else
+#define EPOLL_PACKED
+#endif
+
+struct epoll_event {
+       __u32 events;
+       __u64 data;
+} EPOLL_PACKED;
+
+
+#endif /* _UAPI_LINUX_EVENTPOLL_H */
diff --git a/include/uapi/linux/falloc.h b/include/uapi/linux/falloc.h
new file mode 100644 (file)
index 0000000..990c4cc
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _UAPI_FALLOC_H_
+#define _UAPI_FALLOC_H_
+
+#define FALLOC_FL_KEEP_SIZE    0x01 /* default is extend size */
+#define FALLOC_FL_PUNCH_HOLE   0x02 /* de-allocates range */
+#define FALLOC_FL_NO_HIDE_STALE        0x04 /* reserved codepoint */
+
+
+#endif /* _UAPI_FALLOC_H_ */
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
new file mode 100644 (file)
index 0000000..030508d
--- /dev/null
@@ -0,0 +1,116 @@
+#ifndef _UAPI_LINUX_FANOTIFY_H
+#define _UAPI_LINUX_FANOTIFY_H
+
+#include <linux/types.h>
+
+/* the following events that user-space can register for */
+#define FAN_ACCESS             0x00000001      /* File was accessed */
+#define FAN_MODIFY             0x00000002      /* File was modified */
+#define FAN_CLOSE_WRITE                0x00000008      /* Writtable file closed */
+#define FAN_CLOSE_NOWRITE      0x00000010      /* Unwrittable file closed */
+#define FAN_OPEN               0x00000020      /* File was opened */
+
+#define FAN_Q_OVERFLOW         0x00004000      /* Event queued overflowed */
+
+#define FAN_OPEN_PERM          0x00010000      /* File open in perm check */
+#define FAN_ACCESS_PERM                0x00020000      /* File accessed in perm check */
+
+#define FAN_ONDIR              0x40000000      /* event occurred against dir */
+
+#define FAN_EVENT_ON_CHILD     0x08000000      /* interested in child events */
+
+/* helper events */
+#define FAN_CLOSE              (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
+
+/* flags used for fanotify_init() */
+#define FAN_CLOEXEC            0x00000001
+#define FAN_NONBLOCK           0x00000002
+
+/* These are NOT bitwise flags.  Both bits are used togther.  */
+#define FAN_CLASS_NOTIF                0x00000000
+#define FAN_CLASS_CONTENT      0x00000004
+#define FAN_CLASS_PRE_CONTENT  0x00000008
+#define FAN_ALL_CLASS_BITS     (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
+                                FAN_CLASS_PRE_CONTENT)
+
+#define FAN_UNLIMITED_QUEUE    0x00000010
+#define FAN_UNLIMITED_MARKS    0x00000020
+
+#define FAN_ALL_INIT_FLAGS     (FAN_CLOEXEC | FAN_NONBLOCK | \
+                                FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
+                                FAN_UNLIMITED_MARKS)
+
+/* flags used for fanotify_modify_mark() */
+#define FAN_MARK_ADD           0x00000001
+#define FAN_MARK_REMOVE                0x00000002
+#define FAN_MARK_DONT_FOLLOW   0x00000004
+#define FAN_MARK_ONLYDIR       0x00000008
+#define FAN_MARK_MOUNT         0x00000010
+#define FAN_MARK_IGNORED_MASK  0x00000020
+#define FAN_MARK_IGNORED_SURV_MODIFY   0x00000040
+#define FAN_MARK_FLUSH         0x00000080
+
+#define FAN_ALL_MARK_FLAGS     (FAN_MARK_ADD |\
+                                FAN_MARK_REMOVE |\
+                                FAN_MARK_DONT_FOLLOW |\
+                                FAN_MARK_ONLYDIR |\
+                                FAN_MARK_MOUNT |\
+                                FAN_MARK_IGNORED_MASK |\
+                                FAN_MARK_IGNORED_SURV_MODIFY |\
+                                FAN_MARK_FLUSH)
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility.  Apps will get only the
+ * events that they originally wanted.  Be sure to add new events here!
+ */
+#define FAN_ALL_EVENTS (FAN_ACCESS |\
+                       FAN_MODIFY |\
+                       FAN_CLOSE |\
+                       FAN_OPEN)
+
+/*
+ * All events which require a permission response from userspace
+ */
+#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
+                            FAN_ACCESS_PERM)
+
+#define FAN_ALL_OUTGOING_EVENTS        (FAN_ALL_EVENTS |\
+                                FAN_ALL_PERM_EVENTS |\
+                                FAN_Q_OVERFLOW)
+
+#define FANOTIFY_METADATA_VERSION      3
+
+struct fanotify_event_metadata {
+       __u32 event_len;
+       __u8 vers;
+       __u8 reserved;
+       __u16 metadata_len;
+       __aligned_u64 mask;
+       __s32 fd;
+       __s32 pid;
+};
+
+struct fanotify_response {
+       __s32 fd;
+       __u32 response;
+};
+
+/* Legit userspace responses to a _PERM event */
+#define FAN_ALLOW      0x01
+#define FAN_DENY       0x02
+/* No fd set in event */
+#define FAN_NOFD       -1
+
+/* Helper functions to deal with fanotify_event_metadata buffers */
+#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
+
+#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
+                                  (struct fanotify_event_metadata*)(((char *)(meta)) + \
+                                  (meta)->event_len))
+
+#define FAN_EVENT_OK(meta, len)        ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
+                               (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
+                               (long)(meta)->event_len <= (long)(len))
+
+#endif /* _UAPI_LINUX_FANOTIFY_H */
diff --git a/include/uapi/linux/fb.h b/include/uapi/linux/fb.h
new file mode 100644 (file)
index 0000000..fb795c3
--- /dev/null
@@ -0,0 +1,402 @@
+#ifndef _UAPI_LINUX_FB_H
+#define _UAPI_LINUX_FB_H
+
+#include <linux/types.h>
+#include <linux/i2c.h>
+
+/* Definitions of frame buffers                                                */
+
+#define FB_MAX                 32      /* sufficient for now */
+
+/* ioctls
+   0x46 is 'F'                                                         */
+#define FBIOGET_VSCREENINFO    0x4600
+#define FBIOPUT_VSCREENINFO    0x4601
+#define FBIOGET_FSCREENINFO    0x4602
+#define FBIOGETCMAP            0x4604
+#define FBIOPUTCMAP            0x4605
+#define FBIOPAN_DISPLAY                0x4606
+#ifndef __KERNEL__
+#define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
+#endif
+/* 0x4607-0x460B are defined below */
+/* #define FBIOGET_MONITORSPEC 0x460C */
+/* #define FBIOPUT_MONITORSPEC 0x460D */
+/* #define FBIOSWITCH_MONIBIT  0x460E */
+#define FBIOGET_CON2FBMAP      0x460F
+#define FBIOPUT_CON2FBMAP      0x4610
+#define FBIOBLANK              0x4611          /* arg: 0 or vesa level + 1 */
+#define FBIOGET_VBLANK         _IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC              0x4613
+#define FBIO_FREE               0x4614
+#define FBIOGET_GLYPH           0x4615
+#define FBIOGET_HWCINFO         0x4616
+#define FBIOPUT_MODEINFO        0x4617
+#define FBIOGET_DISPINFO        0x4618
+#define FBIO_WAITFORVSYNC      _IOW('F', 0x20, __u32)
+
+#define FB_TYPE_PACKED_PIXELS          0       /* Packed Pixels        */
+#define FB_TYPE_PLANES                 1       /* Non interleaved planes */
+#define FB_TYPE_INTERLEAVED_PLANES     2       /* Interleaved planes   */
+#define FB_TYPE_TEXT                   3       /* Text/attributes      */
+#define FB_TYPE_VGA_PLANES             4       /* EGA/VGA planes       */
+#define FB_TYPE_FOURCC                 5       /* Type identified by a V4L2 FOURCC */
+
+#define FB_AUX_TEXT_MDA                0       /* Monochrome text */
+#define FB_AUX_TEXT_CGA                1       /* CGA/EGA/VGA Color text */
+#define FB_AUX_TEXT_S3_MMIO    2       /* S3 MMIO fasttext */
+#define FB_AUX_TEXT_MGA_STEP16 3       /* MGA Millenium I: text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_MGA_STEP8  4       /* other MGAs:      text, attr,  6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_GROUP 8       /* 8-15: SVGA tileblit compatible modes */
+#define FB_AUX_TEXT_SVGA_MASK  7       /* lower three bits says step */
+#define FB_AUX_TEXT_SVGA_STEP2 8       /* SVGA text mode:  text, attr */
+#define FB_AUX_TEXT_SVGA_STEP4 9       /* SVGA text mode:  text, attr,  2 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP8 10      /* SVGA text mode:  text, attr,  6 reserved bytes */
+#define FB_AUX_TEXT_SVGA_STEP16        11      /* SVGA text mode:  text, attr, 14 reserved bytes */
+#define FB_AUX_TEXT_SVGA_LAST  15      /* reserved up to 15 */
+
+#define FB_AUX_VGA_PLANES_VGA4         0       /* 16 color planes (EGA/VGA) */
+#define FB_AUX_VGA_PLANES_CFB4         1       /* CFB4 in planes (VGA) */
+#define FB_AUX_VGA_PLANES_CFB8         2       /* CFB8 in planes (VGA) */
+
+#define FB_VISUAL_MONO01               0       /* Monochr. 1=Black 0=White */
+#define FB_VISUAL_MONO10               1       /* Monochr. 1=White 0=Black */
+#define FB_VISUAL_TRUECOLOR            2       /* True color   */
+#define FB_VISUAL_PSEUDOCOLOR          3       /* Pseudo color (like atari) */
+#define FB_VISUAL_DIRECTCOLOR          4       /* Direct color */
+#define FB_VISUAL_STATIC_PSEUDOCOLOR   5       /* Pseudo color readonly */
+#define FB_VISUAL_FOURCC               6       /* Visual identified by a V4L2 FOURCC */
+
+#define FB_ACCEL_NONE          0       /* no hardware accelerator      */
+#define FB_ACCEL_ATARIBLITT    1       /* Atari Blitter                */
+#define FB_ACCEL_AMIGABLITT    2       /* Amiga Blitter                */
+#define FB_ACCEL_S3_TRIO64     3       /* Cybervision64 (S3 Trio64)    */
+#define FB_ACCEL_NCR_77C32BLT  4       /* RetinaZ3 (NCR 77C32BLT)      */
+#define FB_ACCEL_S3_VIRGE      5       /* Cybervision64/3D (S3 ViRGE)  */
+#define FB_ACCEL_ATI_MACH64GX  6       /* ATI Mach 64GX family         */
+#define FB_ACCEL_DEC_TGA       7       /* DEC 21030 TGA                */
+#define FB_ACCEL_ATI_MACH64CT  8       /* ATI Mach 64CT family         */
+#define FB_ACCEL_ATI_MACH64VT  9       /* ATI Mach 64CT family VT class */
+#define FB_ACCEL_ATI_MACH64GT  10      /* ATI Mach 64CT family GT class */
+#define FB_ACCEL_SUN_CREATOR   11      /* Sun Creator/Creator3D        */
+#define FB_ACCEL_SUN_CGSIX     12      /* Sun cg6                      */
+#define FB_ACCEL_SUN_LEO       13      /* Sun leo/zx                   */
+#define FB_ACCEL_IMS_TWINTURBO 14      /* IMS Twin Turbo               */
+#define FB_ACCEL_3DLABS_PERMEDIA2 15   /* 3Dlabs Permedia 2            */
+#define FB_ACCEL_MATROX_MGA2064W 16    /* Matrox MGA2064W (Millenium)  */
+#define FB_ACCEL_MATROX_MGA1064SG 17   /* Matrox MGA1064SG (Mystique)  */
+#define FB_ACCEL_MATROX_MGA2164W 18    /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19        /* Matrox MGA2164W (Millenium II) */
+#define FB_ACCEL_MATROX_MGAG100        20      /* Matrox G100 (Productiva G100) */
+#define FB_ACCEL_MATROX_MGAG200        21      /* Matrox G200 (Myst, Mill, ...) */
+#define FB_ACCEL_SUN_CG14      22      /* Sun cgfourteen                */
+#define FB_ACCEL_SUN_BWTWO     23      /* Sun bwtwo                    */
+#define FB_ACCEL_SUN_CGTHREE   24      /* Sun cgthree                  */
+#define FB_ACCEL_SUN_TCX       25      /* Sun tcx                      */
+#define FB_ACCEL_MATROX_MGAG400        26      /* Matrox G400                  */
+#define FB_ACCEL_NV3           27      /* nVidia RIVA 128              */
+#define FB_ACCEL_NV4           28      /* nVidia RIVA TNT              */
+#define FB_ACCEL_NV5           29      /* nVidia RIVA TNT2             */
+#define FB_ACCEL_CT_6555x      30      /* C&T 6555x                    */
+#define FB_ACCEL_3DFX_BANSHEE  31      /* 3Dfx Banshee                 */
+#define FB_ACCEL_ATI_RAGE128   32      /* ATI Rage128 family           */
+#define FB_ACCEL_IGS_CYBER2000 33      /* CyberPro 2000                */
+#define FB_ACCEL_IGS_CYBER2010 34      /* CyberPro 2010                */
+#define FB_ACCEL_IGS_CYBER5000 35      /* CyberPro 5000                */
+#define FB_ACCEL_SIS_GLAMOUR    36     /* SiS 300/630/540              */
+#define FB_ACCEL_3DLABS_PERMEDIA3 37   /* 3Dlabs Permedia 3            */
+#define FB_ACCEL_ATI_RADEON    38      /* ATI Radeon family            */
+#define FB_ACCEL_I810           39      /* Intel 810/815                */
+#define FB_ACCEL_SIS_GLAMOUR_2  40     /* SiS 315, 650, 740            */
+#define FB_ACCEL_SIS_XABRE      41     /* SiS 330 ("Xabre")            */
+#define FB_ACCEL_I830           42      /* Intel 830M/845G/85x/865G     */
+#define FB_ACCEL_NV_10          43      /* nVidia Arch 10               */
+#define FB_ACCEL_NV_20          44      /* nVidia Arch 20               */
+#define FB_ACCEL_NV_30          45      /* nVidia Arch 30               */
+#define FB_ACCEL_NV_40          46      /* nVidia Arch 40               */
+#define FB_ACCEL_XGI_VOLARI_V  47      /* XGI Volari V3XT, V5, V8      */
+#define FB_ACCEL_XGI_VOLARI_Z  48      /* XGI Volari Z7                */
+#define FB_ACCEL_OMAP1610      49      /* TI OMAP16xx                  */
+#define FB_ACCEL_TRIDENT_TGUI  50      /* Trident TGUI                 */
+#define FB_ACCEL_TRIDENT_3DIMAGE 51    /* Trident 3DImage              */
+#define FB_ACCEL_TRIDENT_BLADE3D 52    /* Trident Blade3D              */
+#define FB_ACCEL_TRIDENT_BLADEXP 53    /* Trident BladeXP              */
+#define FB_ACCEL_CIRRUS_ALPINE   53    /* Cirrus Logic 543x/544x/5480  */
+#define FB_ACCEL_NEOMAGIC_NM2070 90    /* NeoMagic NM2070              */
+#define FB_ACCEL_NEOMAGIC_NM2090 91    /* NeoMagic NM2090              */
+#define FB_ACCEL_NEOMAGIC_NM2093 92    /* NeoMagic NM2093              */
+#define FB_ACCEL_NEOMAGIC_NM2097 93    /* NeoMagic NM2097              */
+#define FB_ACCEL_NEOMAGIC_NM2160 94    /* NeoMagic NM2160              */
+#define FB_ACCEL_NEOMAGIC_NM2200 95    /* NeoMagic NM2200              */
+#define FB_ACCEL_NEOMAGIC_NM2230 96    /* NeoMagic NM2230              */
+#define FB_ACCEL_NEOMAGIC_NM2360 97    /* NeoMagic NM2360              */
+#define FB_ACCEL_NEOMAGIC_NM2380 98    /* NeoMagic NM2380              */
+#define FB_ACCEL_PXA3XX                 99     /* PXA3xx                       */
+
+#define FB_ACCEL_SAVAGE4        0x80   /* S3 Savage4                   */
+#define FB_ACCEL_SAVAGE3D       0x81   /* S3 Savage3D                  */
+#define FB_ACCEL_SAVAGE3D_MV    0x82   /* S3 Savage3D-MV               */
+#define FB_ACCEL_SAVAGE2000     0x83   /* S3 Savage2000                */
+#define FB_ACCEL_SAVAGE_MX_MV   0x84   /* S3 Savage/MX-MV              */
+#define FB_ACCEL_SAVAGE_MX      0x85   /* S3 Savage/MX                 */
+#define FB_ACCEL_SAVAGE_IX_MV   0x86   /* S3 Savage/IX-MV              */
+#define FB_ACCEL_SAVAGE_IX      0x87   /* S3 Savage/IX                 */
+#define FB_ACCEL_PROSAVAGE_PM   0x88   /* S3 ProSavage PM133           */
+#define FB_ACCEL_PROSAVAGE_KM   0x89   /* S3 ProSavage KM133           */
+#define FB_ACCEL_S3TWISTER_P    0x8a   /* S3 Twister                   */
+#define FB_ACCEL_S3TWISTER_K    0x8b   /* S3 TwisterK                  */
+#define FB_ACCEL_SUPERSAVAGE    0x8c    /* S3 Supersavage               */
+#define FB_ACCEL_PROSAVAGE_DDR  0x8d   /* S3 ProSavage DDR             */
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e   /* S3 ProSavage DDR-K           */
+
+#define FB_ACCEL_PUV3_UNIGFX   0xa0    /* PKUnity-v3 Unigfx            */
+
+#define FB_CAP_FOURCC          1       /* Device supports FOURCC-based formats */
+
+struct fb_fix_screeninfo {
+       char id[16];                    /* identification string eg "TT Builtin" */
+       unsigned long smem_start;       /* Start of frame buffer mem */
+                                       /* (physical address) */
+       __u32 smem_len;                 /* Length of frame buffer mem */
+       __u32 type;                     /* see FB_TYPE_*                */
+       __u32 type_aux;                 /* Interleave for interleaved Planes */
+       __u32 visual;                   /* see FB_VISUAL_*              */ 
+       __u16 xpanstep;                 /* zero if no hardware panning  */
+       __u16 ypanstep;                 /* zero if no hardware panning  */
+       __u16 ywrapstep;                /* zero if no hardware ywrap    */
+       __u32 line_length;              /* length of a line in bytes    */
+       unsigned long mmio_start;       /* Start of Memory Mapped I/O   */
+                                       /* (physical address) */
+       __u32 mmio_len;                 /* Length of Memory Mapped I/O  */
+       __u32 accel;                    /* Indicate to driver which     */
+                                       /*  specific chip/card we have  */
+       __u16 capabilities;             /* see FB_CAP_*                 */
+       __u16 reserved[2];              /* Reserved for future compatibility */
+};
+
+/* Interpretation of offset for color fields: All offsets are from the right,
+ * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
+ * can use the offset as right argument to <<). A pixel afterwards is a bit
+ * stream and is written to video memory as that unmodified.
+ *
+ * For pseudocolor: offset and length should be the same for all color
+ * components. Offset specifies the position of the least significant bit
+ * of the pallette index in a pixel value. Length indicates the number
+ * of available palette entries (i.e. # of entries = 1 << length).
+ */
+struct fb_bitfield {
+       __u32 offset;                   /* beginning of bitfield        */
+       __u32 length;                   /* length of bitfield           */
+       __u32 msb_right;                /* != 0 : Most significant bit is */ 
+                                       /* right */ 
+};
+
+#define FB_NONSTD_HAM          1       /* Hold-And-Modify (HAM)        */
+#define FB_NONSTD_REV_PIX_IN_B 2       /* order of pixels in each byte is reversed */
+
+#define FB_ACTIVATE_NOW                0       /* set values immediately (or vbl)*/
+#define FB_ACTIVATE_NXTOPEN    1       /* activate on next open        */
+#define FB_ACTIVATE_TEST       2       /* don't set, round up impossible */
+#define FB_ACTIVATE_MASK       15
+                                       /* values                       */
+#define FB_ACTIVATE_VBL               16       /* activate values on next vbl  */
+#define FB_CHANGE_CMAP_VBL     32      /* change colormap on vbl       */
+#define FB_ACTIVATE_ALL               64       /* change all VCs on this fb    */
+#define FB_ACTIVATE_FORCE     128      /* force apply even when no change*/
+#define FB_ACTIVATE_INV_MODE  256       /* invalidate videomode */
+
+#define FB_ACCELF_TEXT         1       /* (OBSOLETE) see fb_info.flags and vc_mode */
+
+#define FB_SYNC_HOR_HIGH_ACT   1       /* horizontal sync high active  */
+#define FB_SYNC_VERT_HIGH_ACT  2       /* vertical sync high active    */
+#define FB_SYNC_EXT            4       /* external sync                */
+#define FB_SYNC_COMP_HIGH_ACT  8       /* composite sync high active   */
+#define FB_SYNC_BROADCAST      16      /* broadcast video timings      */
+                                       /* vtotal = 144d/288n/576i => PAL  */
+                                       /* vtotal = 121d/242n/484i => NTSC */
+#define FB_SYNC_ON_GREEN       32      /* sync on green */
+
+#define FB_VMODE_NONINTERLACED  0      /* non interlaced */
+#define FB_VMODE_INTERLACED    1       /* interlaced   */
+#define FB_VMODE_DOUBLE                2       /* double scan */
+#define FB_VMODE_ODD_FLD_FIRST 4       /* interlaced: top line first */
+#define FB_VMODE_MASK          255
+
+#define FB_VMODE_YWRAP         256     /* ywrap instead of panning     */
+#define FB_VMODE_SMOOTH_XPAN   512     /* smooth xpan possible (internally used) */
+#define FB_VMODE_CONUPDATE     512     /* don't update x/yoffset       */
+
+/*
+ * Display rotation support
+ */
+#define FB_ROTATE_UR      0
+#define FB_ROTATE_CW      1
+#define FB_ROTATE_UD      2
+#define FB_ROTATE_CCW     3
+
+#define PICOS2KHZ(a) (1000000000UL/(a))
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+struct fb_var_screeninfo {
+       __u32 xres;                     /* visible resolution           */
+       __u32 yres;
+       __u32 xres_virtual;             /* virtual resolution           */
+       __u32 yres_virtual;
+       __u32 xoffset;                  /* offset from virtual to visible */
+       __u32 yoffset;                  /* resolution                   */
+
+       __u32 bits_per_pixel;           /* guess what                   */
+       __u32 grayscale;                /* 0 = color, 1 = grayscale,    */
+                                       /* >1 = FOURCC                  */
+       struct fb_bitfield red;         /* bitfield in fb mem if true color, */
+       struct fb_bitfield green;       /* else only length is significant */
+       struct fb_bitfield blue;
+       struct fb_bitfield transp;      /* transparency                 */      
+
+       __u32 nonstd;                   /* != 0 Non standard pixel format */
+
+       __u32 activate;                 /* see FB_ACTIVATE_*            */
+
+       __u32 height;                   /* height of picture in mm    */
+       __u32 width;                    /* width of picture in mm     */
+
+       __u32 accel_flags;              /* (OBSOLETE) see fb_info.flags */
+
+       /* Timing: All values in pixclocks, except pixclock (of course) */
+       __u32 pixclock;                 /* pixel clock in ps (pico seconds) */
+       __u32 left_margin;              /* time from sync to picture    */
+       __u32 right_margin;             /* time from picture to sync    */
+       __u32 upper_margin;             /* time from sync to picture    */
+       __u32 lower_margin;
+       __u32 hsync_len;                /* length of horizontal sync    */
+       __u32 vsync_len;                /* length of vertical sync      */
+       __u32 sync;                     /* see FB_SYNC_*                */
+       __u32 vmode;                    /* see FB_VMODE_*               */
+       __u32 rotate;                   /* angle we rotate counter clockwise */
+       __u32 colorspace;               /* colorspace for FOURCC-based modes */
+       __u32 reserved[4];              /* Reserved for future compatibility */
+};
+
+struct fb_cmap {
+       __u32 start;                    /* First entry  */
+       __u32 len;                      /* Number of entries */
+       __u16 *red;                     /* Red values   */
+       __u16 *green;
+       __u16 *blue;
+       __u16 *transp;                  /* transparency, can be NULL */
+};
+
+struct fb_con2fbmap {
+       __u32 console;
+       __u32 framebuffer;
+};
+
+/* VESA Blanking Levels */
+#define VESA_NO_BLANKING        0
+#define VESA_VSYNC_SUSPEND      1
+#define VESA_HSYNC_SUSPEND      2
+#define VESA_POWERDOWN          3
+
+
+enum {
+       /* screen: unblanked, hsync: on,  vsync: on */
+       FB_BLANK_UNBLANK       = VESA_NO_BLANKING,
+
+       /* screen: blanked,   hsync: on,  vsync: on */
+       FB_BLANK_NORMAL        = VESA_NO_BLANKING + 1,
+
+       /* screen: blanked,   hsync: on,  vsync: off */
+       FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+
+       /* screen: blanked,   hsync: off, vsync: on */
+       FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+
+       /* screen: blanked,   hsync: off, vsync: off */
+       FB_BLANK_POWERDOWN     = VESA_POWERDOWN + 1
+};
+
+#define FB_VBLANK_VBLANKING    0x001   /* currently in a vertical blank */
+#define FB_VBLANK_HBLANKING    0x002   /* currently in a horizontal blank */
+#define FB_VBLANK_HAVE_VBLANK  0x004   /* vertical blanks can be detected */
+#define FB_VBLANK_HAVE_HBLANK  0x008   /* horizontal blanks can be detected */
+#define FB_VBLANK_HAVE_COUNT   0x010   /* global retrace counter is available */
+#define FB_VBLANK_HAVE_VCOUNT  0x020   /* the vcount field is valid */
+#define FB_VBLANK_HAVE_HCOUNT  0x040   /* the hcount field is valid */
+#define FB_VBLANK_VSYNCING     0x080   /* currently in a vsync */
+#define FB_VBLANK_HAVE_VSYNC   0x100   /* verical syncs can be detected */
+
+struct fb_vblank {
+       __u32 flags;                    /* FB_VBLANK flags */
+       __u32 count;                    /* counter of retraces since boot */
+       __u32 vcount;                   /* current scanline position */
+       __u32 hcount;                   /* current scandot position */
+       __u32 reserved[4];              /* reserved for future compatibility */
+};
+
+/* Internal HW accel */
+#define ROP_COPY 0
+#define ROP_XOR  1
+
+struct fb_copyarea {
+       __u32 dx;
+       __u32 dy;
+       __u32 width;
+       __u32 height;
+       __u32 sx;
+       __u32 sy;
+};
+
+struct fb_fillrect {
+       __u32 dx;       /* screen-relative */
+       __u32 dy;
+       __u32 width;
+       __u32 height;
+       __u32 color;
+       __u32 rop;
+};
+
+struct fb_image {
+       __u32 dx;               /* Where to place image */
+       __u32 dy;
+       __u32 width;            /* Size of image */
+       __u32 height;
+       __u32 fg_color;         /* Only used when a mono bitmap */
+       __u32 bg_color;
+       __u8  depth;            /* Depth of the image */
+       const char *data;       /* Pointer to image data */
+       struct fb_cmap cmap;    /* color map info */
+};
+
+/*
+ * hardware cursor control
+ */
+
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS   0x02
+#define FB_CUR_SETHOT   0x04
+#define FB_CUR_SETCMAP  0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE 0x20
+#define FB_CUR_SETALL   0xFF
+
+struct fbcurpos {
+       __u16 x, y;
+};
+
+struct fb_cursor {
+       __u16 set;              /* what to set */
+       __u16 enable;           /* cursor on/off */
+       __u16 rop;              /* bitop operation */
+       const char *mask;       /* cursor mask bits */
+       struct fbcurpos hot;    /* cursor hot spot */
+       struct fb_image image;  /* Cursor image */
+};
+
+#ifdef CONFIG_FB_BACKLIGHT
+/* Settings for the generic backlight code */
+#define FB_BACKLIGHT_LEVELS    128
+#define FB_BACKLIGHT_MAX       0xFF
+#endif
+
+
+#endif /* _UAPI_LINUX_FB_H */
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
new file mode 100644 (file)
index 0000000..074b886
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef _UAPI_LINUX_FCNTL_H
+#define _UAPI_LINUX_FCNTL_H
+
+#include <asm/fcntl.h>
+
+#define F_SETLEASE     (F_LINUX_SPECIFIC_BASE + 0)
+#define F_GETLEASE     (F_LINUX_SPECIFIC_BASE + 1)
+
+/*
+ * Cancel a blocking posix lock; internal use only until we expose an
+ * asynchronous lock api to userspace:
+ */
+#define F_CANCELLK     (F_LINUX_SPECIFIC_BASE + 5)
+
+/* Create a file descriptor with FD_CLOEXEC set. */
+#define F_DUPFD_CLOEXEC        (F_LINUX_SPECIFIC_BASE + 6)
+
+/*
+ * Request nofications on a directory.
+ * See below for events that may be notified.
+ */
+#define F_NOTIFY       (F_LINUX_SPECIFIC_BASE+2)
+
+/*
+ * Set and get of pipe page size array
+ */
+#define F_SETPIPE_SZ   (F_LINUX_SPECIFIC_BASE + 7)
+#define F_GETPIPE_SZ   (F_LINUX_SPECIFIC_BASE + 8)
+
+/*
+ * Types of directory notifications that may be requested.
+ */
+#define DN_ACCESS      0x00000001      /* File accessed */
+#define DN_MODIFY      0x00000002      /* File modified */
+#define DN_CREATE      0x00000004      /* File created */
+#define DN_DELETE      0x00000008      /* File removed */
+#define DN_RENAME      0x00000010      /* File renamed */
+#define DN_ATTRIB      0x00000020      /* File changed attibutes */
+#define DN_MULTISHOT   0x80000000      /* Don't remove notifier */
+
+#define AT_FDCWD               -100    /* Special value used to indicate
+                                           openat should use the current
+                                           working directory. */
+#define AT_SYMLINK_NOFOLLOW    0x100   /* Do not follow symbolic links.  */
+#define AT_REMOVEDIR           0x200   /* Remove directory instead of
+                                           unlinking file.  */
+#define AT_SYMLINK_FOLLOW      0x400   /* Follow symbolic links.  */
+#define AT_NO_AUTOMOUNT                0x800   /* Suppress terminal automount traversal */
+#define AT_EMPTY_PATH          0x1000  /* Allow empty relative pathname */
+
+
+#endif /* _UAPI_LINUX_FCNTL_H */
diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h
new file mode 100644 (file)
index 0000000..f1f3dd5
--- /dev/null
@@ -0,0 +1,382 @@
+#ifndef _UAPI_LINUX_FD_H
+#define _UAPI_LINUX_FD_H
+
+#include <linux/ioctl.h>
+#include <linux/compiler.h>
+
+/* New file layout: Now the ioctl definitions immediately follow the
+ * definitions of the structures that they use */
+
+/*
+ * Geometry
+ */
+struct floppy_struct {
+       unsigned int    size,           /* nr of sectors total */
+                       sect,           /* sectors per track */
+                       head,           /* nr of heads */
+                       track,          /* nr of tracks */
+                       stretch;        /* bit 0 !=0 means double track steps */
+                                       /* bit 1 != 0 means swap sides */
+                                       /* bits 2..9 give the first sector */
+                                       /*  number (the LSB is flipped) */
+#define FD_STRETCH 1
+#define FD_SWAPSIDES 2
+#define FD_ZEROBASED 4
+#define FD_SECTBASEMASK 0x3FC
+#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
+#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
+
+       unsigned char   gap,            /* gap1 size */
+
+                       rate,           /* data rate. |= 0x40 for perpendicular */
+#define FD_2M 0x4
+#define FD_SIZECODEMASK 0x38
+#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
+#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
+                            512 : 128 << FD_SIZECODE(floppy) )
+#define FD_PERP 0x40
+
+                       spec1,          /* stepping rate, head unload time */
+                       fmt_gap;        /* gap2 size */
+       const char      * name; /* used only for predefined formats */
+};
+
+
+/* commands needing write access have 0x40 set */
+/* commands needing super user access have 0x80 set */
+
+#define FDCLRPRM _IO(2, 0x41)
+/* clear user-defined parameters */
+
+#define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 
+#define FDSETMEDIAPRM FDSETPRM
+/* set user-defined parameters for current media */
+
+#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 
+#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
+#define FDDEFMEDIAPRM FDDEFPRM
+#define FDGETMEDIAPRM FDGETPRM
+/* set/get disk parameters */
+
+
+#define        FDMSGON  _IO(2,0x45)
+#define        FDMSGOFF _IO(2,0x46)
+/* issue/don't issue kernel messages on media type change */
+
+
+/* 
+ * Formatting (obsolete)
+ */
+#define FD_FILL_BYTE 0xF6 /* format fill byte. */
+
+struct format_descr {
+       unsigned int device,head,track;
+};
+
+#define FDFMTBEG _IO(2,0x47)
+/* begin formatting a disk */
+#define        FDFMTTRK _IOW(2,0x48, struct format_descr)
+/* format the specified track */
+#define FDFMTEND _IO(2,0x49)
+/* end formatting a disk */
+
+
+/*
+ * Error thresholds
+ */
+struct floppy_max_errors {
+       unsigned int
+         abort,      /* number of errors to be reached before aborting */
+         read_track, /* maximal number of errors permitted to read an
+                      * entire track at once */
+         reset,      /* maximal number of errors before a reset is tried */
+         recal,      /* maximal number of errors before a recalibrate is
+                      * tried */
+
+         /*
+          * Threshold for reporting FDC errors to the console.
+          * Setting this to zero may flood your screen when using
+          * ultra cheap floppies ;-)
+          */
+         reporting;
+
+};
+
+#define FDSETEMSGTRESH _IO(2,0x4a)
+/* set fdc error reporting threshold */
+
+#define FDFLUSH  _IO(2,0x4b)
+/* flush buffers for media; either for verifying media, or for
+ * handling a media change without closing the file descriptor */
+
+#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
+#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
+/* set/get abortion and read_track threshold. See also floppy_drive_params
+ * structure */
+
+
+typedef char floppy_drive_name[16];
+#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
+/* get drive type: 5 1/4 or 3 1/2 */
+
+
+/*
+ * Drive parameters (user modifiable)
+ */
+struct floppy_drive_params {
+       signed char cmos;               /* CMOS type */
+       
+       /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms 
+        * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
+        */
+       unsigned long max_dtr;          /* Step rate, usec */
+       unsigned long hlt;              /* Head load/settle time, msec */
+       unsigned long hut;              /* Head unload time (remnant of 
+                                        * 8" drives) */
+       unsigned long srt;              /* Step rate, usec */
+
+       unsigned long spinup;           /* time needed for spinup (expressed
+                                        * in jiffies) */
+       unsigned long spindown;         /* timeout needed for spindown */
+       unsigned char spindown_offset;  /* decides in which position the disk
+                                        * will stop */
+       unsigned char select_delay;     /* delay to wait after select */
+       unsigned char rps;              /* rotations per second */
+       unsigned char tracks;           /* maximum number of tracks */
+       unsigned long timeout;          /* timeout for interrupt requests */
+       
+       unsigned char interleave_sect;  /* if there are more sectors, use 
+                                        * interleave */
+       
+       struct floppy_max_errors max_errors;
+       
+       char flags;                     /* various flags, including ftd_msg */
+/*
+ * Announce successful media type detection and media information loss after
+ * disk changes.
+ * Also used to enable/disable printing of overrun warnings.
+ */
+
+#define FTD_MSG 0x10
+#define FD_BROKEN_DCL 0x20
+#define FD_DEBUG 0x02
+#define FD_SILENT_DCL_CLEAR 0x4
+#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware 
+                               considerations */
+
+       char read_track;                /* use readtrack during probing? */
+
+/*
+ * Auto-detection. Each drive type has eight formats which are
+ * used in succession to try to read the disk. If the FDC cannot lock onto
+ * the disk, the next format is tried. This uses the variable 'probing'.
+ */
+       short autodetect[8];            /* autodetected formats */
+       
+       int checkfreq; /* how often should the drive be checked for disk 
+                       * changes */
+       int native_format; /* native format of this drive */
+};
+
+enum {
+       FD_NEED_TWADDLE_BIT,    /* more magic */
+       FD_VERIFY_BIT,          /* inquire for write protection */
+       FD_DISK_NEWCHANGE_BIT,  /* change detected, and no action undertaken yet
+                                * to clear media change status */
+       FD_UNUSED_BIT,
+       FD_DISK_CHANGED_BIT,    /* disk has been changed since last i/o */
+       FD_DISK_WRITABLE_BIT    /* disk is writable */
+};
+
+#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
+#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
+/* set/get drive parameters */
+
+
+/*
+ * Current drive state (not directly modifiable by user, readonly)
+ */
+struct floppy_drive_struct {
+       unsigned long flags;
+/* values for these flags */
+#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
+#define FD_VERIFY (1 << FD_VERIFY_BIT)
+#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
+#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
+#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
+
+       unsigned long spinup_date;
+       unsigned long select_date;
+       unsigned long first_read_date;
+       short probed_format;
+       short track; /* current track */
+       short maxblock; /* id of highest block read */
+       short maxtrack; /* id of highest half track read */
+       int generation; /* how many diskchanges? */
+
+/*
+ * (User-provided) media information is _not_ discarded after a media change
+ * if the corresponding keep_data flag is non-zero. Positive values are
+ * decremented after each probe.
+ */
+       int keep_data;
+       
+       /* Prevent "aliased" accesses. */
+       int fd_ref;
+       int fd_device;
+       unsigned long last_checked; /* when was the drive last checked for a disk 
+                          * change? */
+       
+       char *dmabuf;
+       int bufblocks;
+};
+
+#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
+#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
+/* get drive state: GET returns the cached state, POLL polls for new state */
+
+
+/*
+ * reset FDC
+ */
+enum reset_mode {
+       FD_RESET_IF_NEEDED,     /* reset only if the reset flags is set */
+       FD_RESET_IF_RAWCMD,     /* obsolete */
+       FD_RESET_ALWAYS         /* reset always */
+};
+#define FDRESET _IO(2, 0x54)
+
+
+/*
+ * FDC state
+ */
+struct floppy_fdc_state {      
+       int spec1;              /* spec1 value last used */
+       int spec2;              /* spec2 value last used */
+       int dtr;
+       unsigned char version;  /* FDC version code */
+       unsigned char dor;
+       unsigned long address;  /* io address */
+       unsigned int rawcmd:2;
+       unsigned int reset:1;
+       unsigned int need_configure:1;
+       unsigned int perp_mode:2;
+       unsigned int has_fifo:1;
+       unsigned int driver_version;    /* version code for floppy driver */
+#define FD_DRIVER_VERSION 0x100
+/* user programs using the floppy API should use floppy_fdc_state to
+ * get the version number of the floppy driver that they are running
+ * on. If this version number is bigger than the one compiled into the
+ * user program (the FD_DRIVER_VERSION define), it should be prepared
+ * to bigger structures
+ */
+
+       unsigned char track[4];
+       /* Position of the heads of the 4 units attached to this FDC,
+        * as stored on the FDC. In the future, the position as stored
+        * on the FDC might not agree with the actual physical
+        * position of these drive heads. By allowing such
+        * disagreement, it will be possible to reset the FDC without
+        * incurring the expensive cost of repositioning all heads.
+        * Right now, these positions are hard wired to 0. */
+
+};
+
+#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
+
+
+/*
+ * Asynchronous Write error tracking
+ */
+struct floppy_write_errors {
+       /* Write error logging.
+        *
+        * These fields can be cleared with the FDWERRORCLR ioctl.
+        * Only writes that were attempted but failed due to a physical media
+        * error are logged.  write(2) calls that fail and return an error code
+        * to the user process are not counted.
+        */
+
+       unsigned int write_errors;  /* number of physical write errors 
+                                    * encountered */
+       
+       /* position of first and last write errors */
+       unsigned long first_error_sector;
+       int           first_error_generation;
+       unsigned long last_error_sector;
+       int           last_error_generation;
+       
+       unsigned int badness; /* highest retry count for a read or write 
+                              * operation */
+};
+
+#define FDWERRORCLR  _IO(2, 0x56)
+/* clear write error and badness information */
+#define FDWERRORGET  _IOR(2, 0x17, struct floppy_write_errors)
+/* get write error and badness information */
+
+
+/*
+ * Raw commands
+ */
+/* new interface flag: now we can do them in batches */
+#define FDHAVEBATCHEDRAWCMD
+
+struct floppy_raw_cmd {
+       unsigned int flags;
+#define FD_RAW_READ 1
+#define FD_RAW_WRITE 2
+#define FD_RAW_NO_MOTOR 4
+#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
+#define FD_RAW_INTR 8    /* wait for an interrupt */
+#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
+#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command 
+                                   * completion */
+#define FD_RAW_NEED_DISK 0x40  /* this command needs a disk to be present */
+#define FD_RAW_NEED_SEEK 0x80  /* this command uses an implied seek (soft) */
+
+/* more "in" flags */
+#define FD_RAW_MORE 0x100  /* more records follow */
+#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
+#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
+#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
+                                 * detection too */
+
+/* more "out" flags */
+#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
+#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
+
+       void __user *data;
+       char *kernel_data; /* location of data buffer in the kernel */
+       struct floppy_raw_cmd *next; /* used for chaining of raw cmd's 
+                                     * within the kernel */
+       long length; /* in: length of dma transfer. out: remaining bytes */
+       long phys_length; /* physical length, if different from dma length */
+       int buffer_length; /* length of allocated buffer */
+
+       unsigned char rate;
+       unsigned char cmd_count;
+       unsigned char cmd[16];
+       unsigned char reply_count;
+       unsigned char reply[16];
+       int track;
+       int resultcode;
+
+       int reserved1;
+       int reserved2;
+};
+
+#define FDRAWCMD _IO(2, 0x58)
+/* send a raw command to the fdc. Structure size not included, because of
+ * batches */
+
+#define FDTWADDLE _IO(2, 0x59)
+/* flicker motor-on bit before reading a sector. Experimental */
+
+
+#define FDEJECT _IO(2, 0x5a)
+/* eject the disk */
+
+
+
+#endif /* _UAPI_LINUX_FD_H */
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
new file mode 100644 (file)
index 0000000..3d79224
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Linux Socket Filter Data Structures
+ */
+
+#ifndef _UAPI__LINUX_FILTER_H__
+#define _UAPI__LINUX_FILTER_H__
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+
+/*
+ * Current version of the filter code architecture.
+ */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ *     Try and keep these values and structures similar to BSD, especially
+ *     the BPF code definitions which need to match so you can share filters
+ */
+struct sock_filter {   /* Filter block */
+       __u16   code;   /* Actual filter code */
+       __u8    jt;     /* Jump true */
+       __u8    jf;     /* Jump false */
+       __u32   k;      /* Generic multiuse field */
+};
+
+struct sock_fprog {    /* Required for SO_ATTACH_FILTER. */
+       unsigned short          len;    /* Number of filter blocks */
+       struct sock_filter __user *filter;
+};
+
+/*
+ * Instruction classes
+ */
+
+#define BPF_CLASS(code) ((code) & 0x07)
+#define         BPF_LD          0x00
+#define         BPF_LDX         0x01
+#define         BPF_ST          0x02
+#define         BPF_STX         0x03
+#define         BPF_ALU         0x04
+#define         BPF_JMP         0x05
+#define         BPF_RET         0x06
+#define         BPF_MISC        0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code)  ((code) & 0x18)
+#define         BPF_W           0x00
+#define         BPF_H           0x08
+#define         BPF_B           0x10
+#define BPF_MODE(code)  ((code) & 0xe0)
+#define         BPF_IMM         0x00
+#define         BPF_ABS         0x20
+#define         BPF_IND         0x40
+#define         BPF_MEM         0x60
+#define         BPF_LEN         0x80
+#define         BPF_MSH         0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code)    ((code) & 0xf0)
+#define         BPF_ADD         0x00
+#define         BPF_SUB         0x10
+#define         BPF_MUL         0x20
+#define         BPF_DIV         0x30
+#define         BPF_OR          0x40
+#define         BPF_AND         0x50
+#define         BPF_LSH         0x60
+#define         BPF_RSH         0x70
+#define         BPF_NEG         0x80
+#define                BPF_MOD         0x90
+#define                BPF_XOR         0xa0
+
+#define         BPF_JA          0x00
+#define         BPF_JEQ         0x10
+#define         BPF_JGT         0x20
+#define         BPF_JGE         0x30
+#define         BPF_JSET        0x40
+#define BPF_SRC(code)   ((code) & 0x08)
+#define         BPF_K           0x00
+#define         BPF_X           0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code)  ((code) & 0x18)
+#define         BPF_A           0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define         BPF_TAX         0x00
+#define         BPF_TXA         0x80
+
+#ifndef BPF_MAXINSNS
+#define BPF_MAXINSNS 4096
+#endif
+
+/*
+ * Macros for filter block array initializers.
+ */
+#ifndef BPF_STMT
+#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
+#endif
+#ifndef BPF_JUMP
+#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
+#endif
+
+/*
+ * Number of scratch memory words for: BPF_ST and BPF_STX
+ */
+#define BPF_MEMWORDS 16
+
+/* RATIONALE. Negative offsets are invalid in BPF.
+   We use them to reference ancillary data.
+   Unlike introduction new instructions, it does not break
+   existing compilers/optimizers.
+ */
+#define SKF_AD_OFF    (-0x1000)
+#define SKF_AD_PROTOCOL 0
+#define SKF_AD_PKTTYPE         4
+#define SKF_AD_IFINDEX         8
+#define SKF_AD_NLATTR  12
+#define SKF_AD_NLATTR_NEST     16
+#define SKF_AD_MARK    20
+#define SKF_AD_QUEUE   24
+#define SKF_AD_HATYPE  28
+#define SKF_AD_RXHASH  32
+#define SKF_AD_CPU     36
+#define SKF_AD_ALU_XOR_X       40
+#define SKF_AD_MAX     44
+#define SKF_NET_OFF   (-0x100000)
+#define SKF_LL_OFF    (-0x200000)
+
+
+#endif /* _UAPI__LINUX_FILTER_H__ */
diff --git a/include/uapi/linux/flat.h b/include/uapi/linux/flat.h
new file mode 100644 (file)
index 0000000..88cd6ba
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2002-2003  David McCullough <davidm@snapgear.com>
+ * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
+ *                          The Silver Hammer Group, Ltd.
+ *
+ * This file provides the definitions and structures needed to
+ * support uClinux flat-format executables.
+ */
+
+#ifndef _UAPI_LINUX_FLAT_H
+#define _UAPI_LINUX_FLAT_H
+
+
+#define        FLAT_VERSION                    0x00000004L
+
+#ifdef CONFIG_BINFMT_SHARED_FLAT
+#define        MAX_SHARED_LIBS                 (4)
+#else
+#define        MAX_SHARED_LIBS                 (1)
+#endif
+
+/*
+ * To make everything easier to port and manage cross platform
+ * development,  all fields are in network byte order.
+ */
+
+struct flat_hdr {
+       char magic[4];
+       unsigned long rev;          /* version (as above) */
+       unsigned long entry;        /* Offset of first executable instruction
+                                      with text segment from beginning of file */
+       unsigned long data_start;   /* Offset of data segment from beginning of
+                                      file */
+       unsigned long data_end;     /* Offset of end of data segment
+                                      from beginning of file */
+       unsigned long bss_end;      /* Offset of end of bss segment from beginning
+                                      of file */
+
+       /* (It is assumed that data_end through bss_end forms the bss segment.) */
+
+       unsigned long stack_size;   /* Size of stack, in bytes */
+       unsigned long reloc_start;  /* Offset of relocation records from
+                                      beginning of file */
+       unsigned long reloc_count;  /* Number of relocation records */
+       unsigned long flags;       
+       unsigned long build_date;   /* When the program/library was built */
+       unsigned long filler[5];    /* Reservered, set to zero */
+};
+
+#define FLAT_FLAG_RAM    0x0001 /* load program entirely into RAM */
+#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
+#define FLAT_FLAG_GZIP   0x0004 /* all but the header is compressed */
+#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
+#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
+
+
+
+#endif /* _UAPI_LINUX_FLAT_H */
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
new file mode 100644 (file)
index 0000000..9fcc880
--- /dev/null
@@ -0,0 +1,334 @@
+#ifndef _UAPI_LINUX_FS_H
+#define _UAPI_LINUX_FS_H
+
+/*
+ * This file has definitions for some important file table
+ * structures etc.
+ */
+
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
+ * the file limit at runtime and only root can increase the per-process
+ * nr_file rlimit, so it's safe to set up a ridiculously high absolute
+ * upper limit on files-per-process.
+ *
+ * Some programs (notably those using select()) may have to be 
+ * recompiled to take full advantage of the new limits..  
+ */
+
+/* Fixed constants first: */
+#undef NR_OPEN
+#define INR_OPEN_CUR 1024      /* Initial setting for nfile rlimits */
+#define INR_OPEN_MAX 4096      /* Hard limit for nfile rlimits */
+
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+
+#define SEEK_SET       0       /* seek relative to beginning of file */
+#define SEEK_CUR       1       /* seek relative to current file position */
+#define SEEK_END       2       /* seek relative to end of file */
+#define SEEK_DATA      3       /* seek to the next data */
+#define SEEK_HOLE      4       /* seek to the next hole */
+#define SEEK_MAX       SEEK_HOLE
+
+struct fstrim_range {
+       __u64 start;
+       __u64 len;
+       __u64 minlen;
+};
+
+/* And dynamically-tunable limits and defaults: */
+struct files_stat_struct {
+       unsigned long nr_files;         /* read only */
+       unsigned long nr_free_files;    /* read only */
+       unsigned long max_files;                /* tunable */
+};
+
+struct inodes_stat_t {
+       int nr_inodes;
+       int nr_unused;
+       int dummy[5];           /* padding for sysctl ABI compatibility */
+};
+
+
+#define NR_FILE  8192  /* this can well be larger on a larger system */
+
+#define MAY_EXEC               0x00000001
+#define MAY_WRITE              0x00000002
+#define MAY_READ               0x00000004
+#define MAY_APPEND             0x00000008
+#define MAY_ACCESS             0x00000010
+#define MAY_OPEN               0x00000020
+#define MAY_CHDIR              0x00000040
+/* called from RCU mode, don't block */
+#define MAY_NOT_BLOCK          0x00000080
+
+/*
+ * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond
+ * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
+ */
+
+/* file is open for reading */
+#define FMODE_READ             ((__force fmode_t)0x1)
+/* file is open for writing */
+#define FMODE_WRITE            ((__force fmode_t)0x2)
+/* file is seekable */
+#define FMODE_LSEEK            ((__force fmode_t)0x4)
+/* file can be accessed using pread */
+#define FMODE_PREAD            ((__force fmode_t)0x8)
+/* file can be accessed using pwrite */
+#define FMODE_PWRITE           ((__force fmode_t)0x10)
+/* File is opened for execution with sys_execve / sys_uselib */
+#define FMODE_EXEC             ((__force fmode_t)0x20)
+/* File is opened with O_NDELAY (only set for block devices) */
+#define FMODE_NDELAY           ((__force fmode_t)0x40)
+/* File is opened with O_EXCL (only set for block devices) */
+#define FMODE_EXCL             ((__force fmode_t)0x80)
+/* File is opened using open(.., 3, ..) and is writeable only for ioctls
+   (specialy hack for floppy.c) */
+#define FMODE_WRITE_IOCTL      ((__force fmode_t)0x100)
+/* 32bit hashes as llseek() offset (for directories) */
+#define FMODE_32BITHASH         ((__force fmode_t)0x200)
+/* 64bit hashes as llseek() offset (for directories) */
+#define FMODE_64BITHASH         ((__force fmode_t)0x400)
+
+/*
+ * Don't update ctime and mtime.
+ *
+ * Currently a special hack for the XFS open_by_handle ioctl, but we'll
+ * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
+ */
+#define FMODE_NOCMTIME         ((__force fmode_t)0x800)
+
+/* Expect random access pattern */
+#define FMODE_RANDOM           ((__force fmode_t)0x1000)
+
+/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
+#define FMODE_UNSIGNED_OFFSET  ((__force fmode_t)0x2000)
+
+/* File is opened with O_PATH; almost nothing can be done with it */
+#define FMODE_PATH             ((__force fmode_t)0x4000)
+
+/* File was opened by fanotify and shouldn't generate fanotify events */
+#define FMODE_NONOTIFY         ((__force fmode_t)0x1000000)
+
+/*
+ * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
+ * that indicates that they should check the contents of the iovec are
+ * valid, but not check the memory that the iovec elements
+ * points too.
+ */
+#define CHECK_IOVEC_ONLY -1
+
+#define SEL_IN         1
+#define SEL_OUT                2
+#define SEL_EX         4
+
+/* public flags for file_system_type */
+#define FS_REQUIRES_DEV 1 
+#define FS_BINARY_MOUNTDATA 2
+#define FS_HAS_SUBTYPE 4
+#define FS_REVAL_DOT   16384   /* Check the paths ".", ".." for staleness */
+#define FS_RENAME_DOES_D_MOVE  32768   /* FS will handle d_move()
+                                        * during rename() internally.
+                                        */
+
+/*
+ * These are the fs-independent mount-flags: up to 32 flags are supported
+ */
+#define MS_RDONLY       1      /* Mount read-only */
+#define MS_NOSUID       2      /* Ignore suid and sgid bits */
+#define MS_NODEV        4      /* Disallow access to device special files */
+#define MS_NOEXEC       8      /* Disallow program execution */
+#define MS_SYNCHRONOUS 16      /* Writes are synced at once */
+#define MS_REMOUNT     32      /* Alter flags of a mounted FS */
+#define MS_MANDLOCK    64      /* Allow mandatory locks on an FS */
+#define MS_DIRSYNC     128     /* Directory modifications are synchronous */
+#define MS_NOATIME     1024    /* Do not update access times. */
+#define MS_NODIRATIME  2048    /* Do not update directory access times */
+#define MS_BIND                4096
+#define MS_MOVE                8192
+#define MS_REC         16384
+#define MS_VERBOSE     32768   /* War is peace. Verbosity is silence.
+                                  MS_VERBOSE is deprecated. */
+#define MS_SILENT      32768
+#define MS_POSIXACL    (1<<16) /* VFS does not apply the umask */
+#define MS_UNBINDABLE  (1<<17) /* change to unbindable */
+#define MS_PRIVATE     (1<<18) /* change to private */
+#define MS_SLAVE       (1<<19) /* change to slave */
+#define MS_SHARED      (1<<20) /* change to shared */
+#define MS_RELATIME    (1<<21) /* Update atime relative to mtime/ctime. */
+#define MS_KERNMOUNT   (1<<22) /* this is a kern_mount call */
+#define MS_I_VERSION   (1<<23) /* Update inode I_version field */
+#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
+#define MS_NOSEC       (1<<28)
+#define MS_BORN                (1<<29)
+#define MS_ACTIVE      (1<<30)
+#define MS_NOUSER      (1<<31)
+
+/*
+ * Superblock flags that can be altered by MS_REMOUNT
+ */
+#define MS_RMT_MASK    (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+/*
+ * Old magic mount flag and mask
+ */
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+/* Inode flags - they have nothing to superblock flags now */
+
+#define S_SYNC         1       /* Writes are synced at once */
+#define S_NOATIME      2       /* Do not update access times */
+#define S_APPEND       4       /* Append-only file */
+#define S_IMMUTABLE    8       /* Immutable file */
+#define S_DEAD         16      /* removed, but still open directory */
+#define S_NOQUOTA      32      /* Inode is not counted to quota */
+#define S_DIRSYNC      64      /* Directory modifications are synchronous */
+#define S_NOCMTIME     128     /* Do not update file c/mtime */
+#define S_SWAPFILE     256     /* Do not truncate: swapon got its bmaps */
+#define S_PRIVATE      512     /* Inode is fs-internal */
+#define S_IMA          1024    /* Inode has an associated IMA struct */
+#define S_AUTOMOUNT    2048    /* Automount/referral quasi-directory */
+#define S_NOSEC                4096    /* no suid or xattr security attributes */
+
+/*
+ * Note that nosuid etc flags are inode-specific: setting some file-system
+ * flags just means all the inodes inherit those flags by default. It might be
+ * possible to override it selectively if you really wanted to with some
+ * ioctl() that is not currently implemented.
+ *
+ * Exception: MS_RDONLY is always applied to the entire file system.
+ *
+ * Unfortunately, it is possible to change a filesystems flags with it mounted
+ * with files in use.  This means that all of the inodes will not have their
+ * i_flags updated.  Hence, i_flags no longer inherit the superblock mount
+ * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
+ */
+#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
+
+#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
+#define IS_SYNC(inode)         (__IS_FLG(inode, MS_SYNCHRONOUS) || \
+                                       ((inode)->i_flags & S_SYNC))
+#define IS_DIRSYNC(inode)      (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
+                                       ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+#define IS_MANDLOCK(inode)     __IS_FLG(inode, MS_MANDLOCK)
+#define IS_NOATIME(inode)   __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
+#define IS_I_VERSION(inode)   __IS_FLG(inode, MS_I_VERSION)
+
+#define IS_NOQUOTA(inode)      ((inode)->i_flags & S_NOQUOTA)
+#define IS_APPEND(inode)       ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode)    ((inode)->i_flags & S_IMMUTABLE)
+#define IS_POSIXACL(inode)     __IS_FLG(inode, MS_POSIXACL)
+
+#define IS_DEADDIR(inode)      ((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode)     ((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode)     ((inode)->i_flags & S_SWAPFILE)
+#define IS_PRIVATE(inode)      ((inode)->i_flags & S_PRIVATE)
+#define IS_IMA(inode)          ((inode)->i_flags & S_IMA)
+#define IS_AUTOMOUNT(inode)    ((inode)->i_flags & S_AUTOMOUNT)
+#define IS_NOSEC(inode)                ((inode)->i_flags & S_NOSEC)
+
+/* the read-only stuff doesn't really belong here, but any other place is
+   probably as bad and I don't want to create yet another include file. */
+
+#define BLKROSET   _IO(0x12,93)        /* set device read-only (0 = read-write) */
+#define BLKROGET   _IO(0x12,94)        /* get read-only status (0 = read_write) */
+#define BLKRRPART  _IO(0x12,95)        /* re-read partition table */
+#define BLKGETSIZE _IO(0x12,96)        /* return device size /512 (long *arg) */
+#define BLKFLSBUF  _IO(0x12,97)        /* flush buffer cache */
+#define BLKRASET   _IO(0x12,98)        /* set read ahead for block device */
+#define BLKRAGET   _IO(0x12,99)        /* get current read ahead setting */
+#define BLKFRASET  _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
+#define BLKFRAGET  _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
+#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
+#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
+#define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
+#if 0
+#define BLKPG      _IO(0x12,105)/* See blkpg.h */
+
+/* Some people are morons.  Do not use sizeof! */
+
+#define BLKELVGET  _IOR(0x12,106,size_t)/* elevator get */
+#define BLKELVSET  _IOW(0x12,107,size_t)/* elevator set */
+/* This was here just to show that the number is taken -
+   probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
+#endif
+/* A jump here: 108-111 have been used for various private purposes. */
+#define BLKBSZGET  _IOR(0x12,112,size_t)
+#define BLKBSZSET  _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t)     /* return device size in bytes (u64 *arg) */
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
+#define BLKDISCARD _IO(0x12,119)
+#define BLKIOMIN _IO(0x12,120)
+#define BLKIOOPT _IO(0x12,121)
+#define BLKALIGNOFF _IO(0x12,122)
+#define BLKPBSZGET _IO(0x12,123)
+#define BLKDISCARDZEROES _IO(0x12,124)
+#define BLKSECDISCARD _IO(0x12,125)
+#define BLKROTATIONAL _IO(0x12,126)
+#define BLKZEROOUT _IO(0x12,127)
+
+#define BMAP_IOCTL 1           /* obsolete - kept for compatibility */
+#define FIBMAP    _IO(0x00,1)  /* bmap access */
+#define FIGETBSZ   _IO(0x00,2) /* get the block size used for bmap */
+#define FIFREEZE       _IOWR('X', 119, int)    /* Freeze */
+#define FITHAW         _IOWR('X', 120, int)    /* Thaw */
+#define FITRIM         _IOWR('X', 121, struct fstrim_range)    /* Trim */
+
+#define        FS_IOC_GETFLAGS                 _IOR('f', 1, long)
+#define        FS_IOC_SETFLAGS                 _IOW('f', 2, long)
+#define        FS_IOC_GETVERSION               _IOR('v', 1, long)
+#define        FS_IOC_SETVERSION               _IOW('v', 2, long)
+#define FS_IOC_FIEMAP                  _IOWR('f', 11, struct fiemap)
+#define FS_IOC32_GETFLAGS              _IOR('f', 1, int)
+#define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
+#define FS_IOC32_GETVERSION            _IOR('v', 1, int)
+#define FS_IOC32_SETVERSION            _IOW('v', 2, int)
+
+/*
+ * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
+ */
+#define        FS_SECRM_FL                     0x00000001 /* Secure deletion */
+#define        FS_UNRM_FL                      0x00000002 /* Undelete */
+#define        FS_COMPR_FL                     0x00000004 /* Compress file */
+#define FS_SYNC_FL                     0x00000008 /* Synchronous updates */
+#define FS_IMMUTABLE_FL                        0x00000010 /* Immutable file */
+#define FS_APPEND_FL                   0x00000020 /* writes to file may only append */
+#define FS_NODUMP_FL                   0x00000040 /* do not dump file */
+#define FS_NOATIME_FL                  0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define FS_DIRTY_FL                    0x00000100
+#define FS_COMPRBLK_FL                 0x00000200 /* One or more compressed clusters */
+#define FS_NOCOMP_FL                   0x00000400 /* Don't compress */
+#define FS_ECOMPR_FL                   0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */
+#define FS_BTREE_FL                    0x00001000 /* btree format dir */
+#define FS_INDEX_FL                    0x00001000 /* hash-indexed directory */
+#define FS_IMAGIC_FL                   0x00002000 /* AFS directory */
+#define FS_JOURNAL_DATA_FL             0x00004000 /* Reserved for ext3 */
+#define FS_NOTAIL_FL                   0x00008000 /* file tail should not be merged */
+#define FS_DIRSYNC_FL                  0x00010000 /* dirsync behaviour (directories only) */
+#define FS_TOPDIR_FL                   0x00020000 /* Top of directory hierarchies*/
+#define FS_EXTENT_FL                   0x00080000 /* Extents */
+#define FS_DIRECTIO_FL                 0x00100000 /* Use direct i/o */
+#define FS_NOCOW_FL                    0x00800000 /* Do not cow file */
+#define FS_RESERVED_FL                 0x80000000 /* reserved for ext2 lib */
+
+#define FS_FL_USER_VISIBLE             0x0003DFFF /* User visible flags */
+#define FS_FL_USER_MODIFIABLE          0x000380FF /* User modifiable flags */
+
+
+#define SYNC_FILE_RANGE_WAIT_BEFORE    1
+#define SYNC_FILE_RANGE_WRITE          2
+#define SYNC_FILE_RANGE_WAIT_AFTER     4
+
+#endif /* _UAPI_LINUX_FS_H */
diff --git a/include/uapi/linux/fsl_hypervisor.h b/include/uapi/linux/fsl_hypervisor.h
new file mode 100644 (file)
index 0000000..1bf0496
--- /dev/null
@@ -0,0 +1,220 @@
+/*
+ * Freescale hypervisor ioctl and kernel interface
+ *
+ * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ * Author: Timur Tabi <timur@freescale.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * This software is provided by Freescale Semiconductor "as is" and any
+ * express or implied warranties, including, but not limited to, the implied
+ * warranties of merchantability and fitness for a particular purpose are
+ * disclaimed. In no event shall Freescale Semiconductor be liable for any
+ * direct, indirect, incidental, special, exemplary, or consequential damages
+ * (including, but not limited to, procurement of substitute goods or services;
+ * loss of use, data, or profits; or business interruption) however caused and
+ * on any theory of liability, whether in contract, strict liability, or tort
+ * (including negligence or otherwise) arising in any way out of the use of this
+ * software, even if advised of the possibility of such damage.
+ *
+ * This file is used by the Freescale hypervisor management driver.  It can
+ * also be included by applications that need to communicate with the driver
+ * via the ioctl interface.
+ */
+
+#ifndef _UAPIFSL_HYPERVISOR_H
+#define _UAPIFSL_HYPERVISOR_H
+
+#include <linux/types.h>
+
+/**
+ * struct fsl_hv_ioctl_restart - restart a partition
+ * @ret: return error code from the hypervisor
+ * @partition: the ID of the partition to restart, or -1 for the
+ *             calling partition
+ *
+ * Used by FSL_HV_IOCTL_PARTITION_RESTART
+ */
+struct fsl_hv_ioctl_restart {
+       __u32 ret;
+       __u32 partition;
+};
+
+/**
+ * struct fsl_hv_ioctl_status - get a partition's status
+ * @ret: return error code from the hypervisor
+ * @partition: the ID of the partition to query, or -1 for the
+ *             calling partition
+ * @status: The returned status of the partition
+ *
+ * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
+ *
+ * Values of 'status':
+ *    0 = Stopped
+ *    1 = Running
+ *    2 = Starting
+ *    3 = Stopping
+ */
+struct fsl_hv_ioctl_status {
+       __u32 ret;
+       __u32 partition;
+       __u32 status;
+};
+
+/**
+ * struct fsl_hv_ioctl_start - start a partition
+ * @ret: return error code from the hypervisor
+ * @partition: the ID of the partition to control
+ * @entry_point: The offset within the guest IMA to start execution
+ * @load: If non-zero, reload the partition's images before starting
+ *
+ * Used by FSL_HV_IOCTL_PARTITION_START
+ */
+struct fsl_hv_ioctl_start {
+       __u32 ret;
+       __u32 partition;
+       __u32 entry_point;
+       __u32 load;
+};
+
+/**
+ * struct fsl_hv_ioctl_stop - stop a partition
+ * @ret: return error code from the hypervisor
+ * @partition: the ID of the partition to stop, or -1 for the calling
+ *             partition
+ *
+ * Used by FSL_HV_IOCTL_PARTITION_STOP
+ */
+struct fsl_hv_ioctl_stop {
+       __u32 ret;
+       __u32 partition;
+};
+
+/**
+ * struct fsl_hv_ioctl_memcpy - copy memory between partitions
+ * @ret: return error code from the hypervisor
+ * @source: the partition ID of the source partition, or -1 for this
+ *          partition
+ * @target: the partition ID of the target partition, or -1 for this
+ *          partition
+ * @reserved: reserved, must be set to 0
+ * @local_addr: user-space virtual address of a buffer in the local
+ *              partition
+ * @remote_addr: guest physical address of a buffer in the
+ *           remote partition
+ * @count: the number of bytes to copy.  Both the local and remote
+ *         buffers must be at least 'count' bytes long
+ *
+ * Used by FSL_HV_IOCTL_MEMCPY
+ *
+ * The 'local' partition is the partition that calls this ioctl.  The
+ * 'remote' partition is a different partition.  The data is copied from
+ * the 'source' paritition' to the 'target' partition.
+ *
+ * The buffer in the remote partition must be guest physically
+ * contiguous.
+ *
+ * This ioctl does not support copying memory between two remote
+ * partitions or within the same partition, so either 'source' or
+ * 'target' (but not both) must be -1.  In other words, either
+ *
+ *      source == local and target == remote
+ * or
+ *      source == remote and target == local
+ */
+struct fsl_hv_ioctl_memcpy {
+       __u32 ret;
+       __u32 source;
+       __u32 target;
+       __u32 reserved; /* padding to ensure local_vaddr is aligned */
+       __u64 local_vaddr;
+       __u64 remote_paddr;
+       __u64 count;
+};
+
+/**
+ * struct fsl_hv_ioctl_doorbell - ring a doorbell
+ * @ret: return error code from the hypervisor
+ * @doorbell: the handle of the doorbell to ring doorbell
+ *
+ * Used by FSL_HV_IOCTL_DOORBELL
+ */
+struct fsl_hv_ioctl_doorbell {
+       __u32 ret;
+       __u32 doorbell;
+};
+
+/**
+ * struct fsl_hv_ioctl_prop - get/set a device tree property
+ * @ret: return error code from the hypervisor
+ * @handle: handle of partition whose tree to access
+ * @path: virtual address of path name of node to access
+ * @propname: virtual address of name of property to access
+ * @propval: virtual address of property data buffer
+ * @proplen: Size of property data buffer
+ * @reserved: reserved, must be set to 0
+ *
+ * Used by FSL_HV_IOCTL_DOORBELL
+ */
+struct fsl_hv_ioctl_prop {
+       __u32 ret;
+       __u32 handle;
+       __u64 path;
+       __u64 propname;
+       __u64 propval;
+       __u32 proplen;
+       __u32 reserved; /* padding to ensure structure is aligned */
+};
+
+/* The ioctl type, documented in ioctl-number.txt */
+#define FSL_HV_IOCTL_TYPE      0xAF
+
+/* Restart another partition */
+#define FSL_HV_IOCTL_PARTITION_RESTART \
+       _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
+
+/* Get a partition's status */
+#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
+       _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
+
+/* Boot another partition */
+#define FSL_HV_IOCTL_PARTITION_START \
+       _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
+
+/* Stop this or another partition */
+#define FSL_HV_IOCTL_PARTITION_STOP \
+       _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
+
+/* Copy data from one partition to another */
+#define FSL_HV_IOCTL_MEMCPY \
+       _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
+
+/* Ring a doorbell */
+#define FSL_HV_IOCTL_DOORBELL \
+       _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
+
+/* Get a property from another guest's device tree */
+#define FSL_HV_IOCTL_GETPROP \
+       _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
+
+/* Set a property in another guest's device tree */
+#define FSL_HV_IOCTL_SETPROP \
+       _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
+
+
+#endif /* _UAPIFSL_HYPERVISOR_H */
diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h
new file mode 100644 (file)
index 0000000..0b1f716
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef _UAPI_LINUX_FUTEX_H
+#define _UAPI_LINUX_FUTEX_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+/* Second argument to futex syscall */
+
+
+#define FUTEX_WAIT             0
+#define FUTEX_WAKE             1
+#define FUTEX_FD               2
+#define FUTEX_REQUEUE          3
+#define FUTEX_CMP_REQUEUE      4
+#define FUTEX_WAKE_OP          5
+#define FUTEX_LOCK_PI          6
+#define FUTEX_UNLOCK_PI                7
+#define FUTEX_TRYLOCK_PI       8
+#define FUTEX_WAIT_BITSET      9
+#define FUTEX_WAKE_BITSET      10
+#define FUTEX_WAIT_REQUEUE_PI  11
+#define FUTEX_CMP_REQUEUE_PI   12
+
+#define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+#define FUTEX_CMD_MASK         ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
+
+#define FUTEX_WAIT_PRIVATE     (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_PRIVATE     (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_REQUEUE_PRIVATE  (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_OP_PRIVATE  (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
+#define FUTEX_LOCK_PI_PRIVATE  (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_UNLOCK_PI_PRIVATE        (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAIT_BITSET_PRIVATE      (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAKE_BITSET_PRIVATE      (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
+#define FUTEX_WAIT_REQUEUE_PI_PRIVATE  (FUTEX_WAIT_REQUEUE_PI | \
+                                        FUTEX_PRIVATE_FLAG)
+#define FUTEX_CMP_REQUEUE_PI_PRIVATE   (FUTEX_CMP_REQUEUE_PI | \
+                                        FUTEX_PRIVATE_FLAG)
+
+/*
+ * Support for robust futexes: the kernel cleans up held futexes at
+ * thread exit time.
+ */
+
+/*
+ * Per-lock list entry - embedded in user-space locks, somewhere close
+ * to the futex field. (Note: user-space uses a double-linked list to
+ * achieve O(1) list add and remove, but the kernel only needs to know
+ * about the forward link)
+ *
+ * NOTE: this structure is part of the syscall ABI, and must not be
+ * changed.
+ */
+struct robust_list {
+       struct robust_list __user *next;
+};
+
+/*
+ * Per-thread list head:
+ *
+ * NOTE: this structure is part of the syscall ABI, and must only be
+ * changed if the change is first communicated with the glibc folks.
+ * (When an incompatible change is done, we'll increase the structure
+ *  size, which glibc will detect)
+ */
+struct robust_list_head {
+       /*
+        * The head of the list. Points back to itself if empty:
+        */
+       struct robust_list list;
+
+       /*
+        * This relative offset is set by user-space, it gives the kernel
+        * the relative position of the futex field to examine. This way
+        * we keep userspace flexible, to freely shape its data-structure,
+        * without hardcoding any particular offset into the kernel:
+        */
+       long futex_offset;
+
+       /*
+        * The death of the thread may race with userspace setting
+        * up a lock's links. So to handle this race, userspace first
+        * sets this field to the address of the to-be-taken lock,
+        * then does the lock acquire, and then adds itself to the
+        * list, and then clears this field. Hence the kernel will
+        * always have full knowledge of all locks that the thread
+        * _might_ have taken. We check the owner TID in any case,
+        * so only truly owned locks will be handled.
+        */
+       struct robust_list __user *list_op_pending;
+};
+
+/*
+ * Are there any waiters for this robust futex:
+ */
+#define FUTEX_WAITERS          0x80000000
+
+/*
+ * The kernel signals via this bit that a thread holding a futex
+ * has exited without unlocking the futex. The kernel also does
+ * a FUTEX_WAKE on such futexes, after setting the bit, to wake
+ * up any possible waiters:
+ */
+#define FUTEX_OWNER_DIED       0x40000000
+
+/*
+ * The rest of the robust-futex field is for the TID:
+ */
+#define FUTEX_TID_MASK         0x3fffffff
+
+/*
+ * This limit protects against a deliberately circular list.
+ * (Not worth introducing an rlimit for it)
+ */
+#define ROBUST_LIST_LIMIT      2048
+
+/*
+ * bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
+ * match of any bit.
+ */
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
+
+
+#define FUTEX_OP_SET           0       /* *(int *)UADDR2 = OPARG; */
+#define FUTEX_OP_ADD           1       /* *(int *)UADDR2 += OPARG; */
+#define FUTEX_OP_OR            2       /* *(int *)UADDR2 |= OPARG; */
+#define FUTEX_OP_ANDN          3       /* *(int *)UADDR2 &= ~OPARG; */
+#define FUTEX_OP_XOR           4       /* *(int *)UADDR2 ^= OPARG; */
+
+#define FUTEX_OP_OPARG_SHIFT   8       /* Use (1 << OPARG) instead of OPARG.  */
+
+#define FUTEX_OP_CMP_EQ                0       /* if (oldval == CMPARG) wake */
+#define FUTEX_OP_CMP_NE                1       /* if (oldval != CMPARG) wake */
+#define FUTEX_OP_CMP_LT                2       /* if (oldval < CMPARG) wake */
+#define FUTEX_OP_CMP_LE                3       /* if (oldval <= CMPARG) wake */
+#define FUTEX_OP_CMP_GT                4       /* if (oldval > CMPARG) wake */
+#define FUTEX_OP_CMP_GE                5       /* if (oldval >= CMPARG) wake */
+
+/* FUTEX_WAKE_OP will perform atomically
+   int oldval = *(int *)UADDR2;
+   *(int *)UADDR2 = oldval OP OPARG;
+   if (oldval CMP CMPARG)
+     wake UADDR2;  */
+
+#define FUTEX_OP(op, oparg, cmp, cmparg) \
+  (((op & 0xf) << 28) | ((cmp & 0xf) << 24)            \
+   | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
+
+#endif /* _UAPI_LINUX_FUTEX_H */
diff --git a/include/uapi/linux/gameport.h b/include/uapi/linux/gameport.h
new file mode 100644 (file)
index 0000000..49b29b0
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ *  Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef _UAPI_GAMEPORT_H
+#define _UAPI_GAMEPORT_H
+
+
+
+#define GAMEPORT_MODE_DISABLED         0
+#define GAMEPORT_MODE_RAW              1
+#define GAMEPORT_MODE_COOKED           2
+
+#define GAMEPORT_ID_VENDOR_ANALOG      0x0001
+#define GAMEPORT_ID_VENDOR_MADCATZ     0x0002
+#define GAMEPORT_ID_VENDOR_LOGITECH    0x0003
+#define GAMEPORT_ID_VENDOR_CREATIVE    0x0004
+#define GAMEPORT_ID_VENDOR_GENIUS      0x0005
+#define GAMEPORT_ID_VENDOR_INTERACT    0x0006
+#define GAMEPORT_ID_VENDOR_MICROSOFT   0x0007
+#define GAMEPORT_ID_VENDOR_THRUSTMASTER        0x0008
+#define GAMEPORT_ID_VENDOR_GRAVIS      0x0009
+#define GAMEPORT_ID_VENDOR_GUILLEMOT   0x000a
+
+#endif /* _UAPI_GAMEPORT_H */
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h
new file mode 100644 (file)
index 0000000..c880a41
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _UAPI__LINUX_GENERIC_NETLINK_H
+#define _UAPI__LINUX_GENERIC_NETLINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+#define GENL_NAMSIZ    16      /* length of family name */
+
+#define GENL_MIN_ID    NLMSG_MIN_TYPE
+#define GENL_MAX_ID    1023
+
+struct genlmsghdr {
+       __u8    cmd;
+       __u8    version;
+       __u16   reserved;
+};
+
+#define GENL_HDRLEN    NLMSG_ALIGN(sizeof(struct genlmsghdr))
+
+#define GENL_ADMIN_PERM                0x01
+#define GENL_CMD_CAP_DO                0x02
+#define GENL_CMD_CAP_DUMP      0x04
+#define GENL_CMD_CAP_HASPOL    0x08
+
+/*
+ * List of reserved static generic netlink identifiers:
+ */
+#define GENL_ID_GENERATE       0
+#define GENL_ID_CTRL           NLMSG_MIN_TYPE
+
+/**************************************************************************
+ * Controller
+ **************************************************************************/
+
+enum {
+       CTRL_CMD_UNSPEC,
+       CTRL_CMD_NEWFAMILY,
+       CTRL_CMD_DELFAMILY,
+       CTRL_CMD_GETFAMILY,
+       CTRL_CMD_NEWOPS,
+       CTRL_CMD_DELOPS,
+       CTRL_CMD_GETOPS,
+       CTRL_CMD_NEWMCAST_GRP,
+       CTRL_CMD_DELMCAST_GRP,
+       CTRL_CMD_GETMCAST_GRP, /* unused */
+       __CTRL_CMD_MAX,
+};
+
+#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
+
+enum {
+       CTRL_ATTR_UNSPEC,
+       CTRL_ATTR_FAMILY_ID,
+       CTRL_ATTR_FAMILY_NAME,
+       CTRL_ATTR_VERSION,
+       CTRL_ATTR_HDRSIZE,
+       CTRL_ATTR_MAXATTR,
+       CTRL_ATTR_OPS,
+       CTRL_ATTR_MCAST_GROUPS,
+       __CTRL_ATTR_MAX,
+};
+
+#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
+
+enum {
+       CTRL_ATTR_OP_UNSPEC,
+       CTRL_ATTR_OP_ID,
+       CTRL_ATTR_OP_FLAGS,
+       __CTRL_ATTR_OP_MAX,
+};
+
+#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
+
+enum {
+       CTRL_ATTR_MCAST_GRP_UNSPEC,
+       CTRL_ATTR_MCAST_GRP_NAME,
+       CTRL_ATTR_MCAST_GRP_ID,
+       __CTRL_ATTR_MCAST_GRP_MAX,
+};
+
+#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
+
+
+#endif /* _UAPI__LINUX_GENERIC_NETLINK_H */
diff --git a/include/uapi/linux/hdlc.h b/include/uapi/linux/hdlc.h
new file mode 100644 (file)
index 0000000..2c5f0af
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Generic HDLC support routines for Linux
+ *
+ * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ */
+
+#ifndef _UAPI__HDLC_H
+#define _UAPI__HDLC_H
+
+
+#define HDLC_MAX_MTU 1500      /* Ethernet 1500 bytes */
+#if 0
+#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
+#else
+#define HDLC_MAX_MRU 1600 /* as required for FR network */
+#endif
+
+
+#endif /* _UAPI__HDLC_H */
diff --git a/include/uapi/linux/hdlcdrv.h b/include/uapi/linux/hdlcdrv.h
new file mode 100644 (file)
index 0000000..ffc79c0
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * hdlcdrv.h  -- HDLC packet radio network driver.
+ * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
+ * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
+ */
+
+#ifndef _UAPI_HDLCDRV_H
+#define _UAPI_HDLCDRV_H
+
+/* -------------------------------------------------------------------- */
+/*
+ * structs for the IOCTL commands
+ */
+
+struct hdlcdrv_params {
+       int iobase;
+       int irq;
+       int dma;
+       int dma2;
+       int seriobase;
+       int pariobase;
+       int midiiobase;
+};     
+
+struct hdlcdrv_channel_params {
+       int tx_delay;  /* the transmitter keyup delay in 10ms units */
+       int tx_tail;   /* the transmitter keyoff delay in 10ms units */
+       int slottime;  /* the slottime in 10ms; usually 10 = 100ms */
+       int ppersist;  /* the p-persistence 0..255 */
+       int fulldup;   /* some driver do not support full duplex, setting */
+                      /* this just makes them send even if DCD is on */
+};     
+
+struct hdlcdrv_old_channel_state {
+       int ptt;
+       int dcd;
+       int ptt_keyed;
+};
+
+struct hdlcdrv_channel_state {
+       int ptt;
+       int dcd;
+       int ptt_keyed;
+       unsigned long tx_packets;
+       unsigned long tx_errors;
+       unsigned long rx_packets;
+       unsigned long rx_errors;
+};
+
+struct hdlcdrv_ioctl {
+       int cmd;
+       union {
+               struct hdlcdrv_params mp;
+               struct hdlcdrv_channel_params cp;
+               struct hdlcdrv_channel_state cs;
+               struct hdlcdrv_old_channel_state ocs;
+               unsigned int calibrate;
+               unsigned char bits;
+               char modename[128];
+               char drivername[32];
+       } data;
+};
+
+/* -------------------------------------------------------------------- */
+
+/*
+ * ioctl values
+ */
+#define HDLCDRVCTL_GETMODEMPAR       0
+#define HDLCDRVCTL_SETMODEMPAR       1
+#define HDLCDRVCTL_MODEMPARMASK      2  /* not handled by hdlcdrv */
+#define HDLCDRVCTL_GETCHANNELPAR    10
+#define HDLCDRVCTL_SETCHANNELPAR    11
+#define HDLCDRVCTL_OLDGETSTAT       20
+#define HDLCDRVCTL_CALIBRATE        21
+#define HDLCDRVCTL_GETSTAT          22
+
+/*
+ * these are mainly for debugging purposes
+ */
+#define HDLCDRVCTL_GETSAMPLES       30
+#define HDLCDRVCTL_GETBITS          31
+
+/*
+ * not handled by hdlcdrv, but by its depending drivers
+ */
+#define HDLCDRVCTL_GETMODE          40
+#define HDLCDRVCTL_SETMODE          41
+#define HDLCDRVCTL_MODELIST         42
+#define HDLCDRVCTL_DRIVERNAME       43
+
+/*
+ * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
+ */
+#define HDLCDRV_PARMASK_IOBASE      (1<<0)
+#define HDLCDRV_PARMASK_IRQ         (1<<1)
+#define HDLCDRV_PARMASK_DMA         (1<<2)
+#define HDLCDRV_PARMASK_DMA2        (1<<3)
+#define HDLCDRV_PARMASK_SERIOBASE   (1<<4)
+#define HDLCDRV_PARMASK_PARIOBASE   (1<<5)
+#define HDLCDRV_PARMASK_MIDIIOBASE  (1<<6)
+
+/* -------------------------------------------------------------------- */
+
+
+/* -------------------------------------------------------------------- */
+
+#endif /* _UAPI_HDLCDRV_H */
+
+/* -------------------------------------------------------------------- */
diff --git a/include/uapi/linux/hid.h b/include/uapi/linux/hid.h
new file mode 100644 (file)
index 0000000..b60f484
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ *  Copyright (c) 1999 Andreas Gal
+ *  Copyright (c) 2000-2001 Vojtech Pavlik
+ *  Copyright (c) 2006-2007 Jiri Kosina
+ */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
+ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ */
+#ifndef _UAPI__HID_H
+#define _UAPI__HID_H
+
+
+
+/*
+ * USB HID (Human Interface Device) interface class code
+ */
+
+#define USB_INTERFACE_CLASS_HID                3
+
+/*
+ * USB HID interface subclass and protocol codes
+ */
+
+#define USB_INTERFACE_SUBCLASS_BOOT    1
+#define USB_INTERFACE_PROTOCOL_KEYBOARD        1
+#define USB_INTERFACE_PROTOCOL_MOUSE   2
+
+/*
+ * HID class requests
+ */
+
+#define HID_REQ_GET_REPORT             0x01
+#define HID_REQ_GET_IDLE               0x02
+#define HID_REQ_GET_PROTOCOL           0x03
+#define HID_REQ_SET_REPORT             0x09
+#define HID_REQ_SET_IDLE               0x0A
+#define HID_REQ_SET_PROTOCOL           0x0B
+
+/*
+ * HID class descriptor types
+ */
+
+#define HID_DT_HID                     (USB_TYPE_CLASS | 0x01)
+#define HID_DT_REPORT                  (USB_TYPE_CLASS | 0x02)
+#define HID_DT_PHYSICAL                        (USB_TYPE_CLASS | 0x03)
+
+#define HID_MAX_DESCRIPTOR_SIZE                4096
+
+
+#endif /* _UAPI__HID_H */
diff --git a/include/uapi/linux/hiddev.h b/include/uapi/linux/hiddev.h
new file mode 100644 (file)
index 0000000..7df7884
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ *  Copyright (c) 1999-2000 Vojtech Pavlik
+ *
+ *  Sponsored by SuSE
+ */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or 
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+#ifndef _UAPI_HIDDEV_H
+#define _UAPI_HIDDEV_H
+
+
+
+#include <linux/types.h>
+
+/*
+ * The event structure itself
+ */
+
+struct hiddev_event {
+       unsigned hid;
+       signed int value;
+};
+
+struct hiddev_devinfo {
+       __u32 bustype;
+       __u32 busnum;
+       __u32 devnum;
+       __u32 ifnum;
+       __s16 vendor;
+       __s16 product;
+       __s16 version;
+       __u32 num_applications;
+};
+
+struct hiddev_collection_info {
+       __u32 index;
+       __u32 type;
+       __u32 usage;
+       __u32 level;
+};
+
+#define HID_STRING_SIZE 256
+struct hiddev_string_descriptor {
+       __s32 index;
+       char value[HID_STRING_SIZE];
+};
+
+struct hiddev_report_info {
+       __u32 report_type;
+       __u32 report_id;
+       __u32 num_fields;
+};
+
+/* To do a GUSAGE/SUSAGE, fill in at least usage_code,  report_type and 
+ * report_id.  Set report_id to REPORT_ID_UNKNOWN if the rest of the fields 
+ * are unknown.  Otherwise use a usage_ref struct filled in from a previous 
+ * successful GUSAGE call to save time.  To actually send a value to the
+ * device, perform a SUSAGE first, followed by a SREPORT.  An INITREPORT or a
+ * GREPORT isn't necessary for a GUSAGE to return valid data.
+ */
+#define HID_REPORT_ID_UNKNOWN 0xffffffff
+#define HID_REPORT_ID_FIRST   0x00000100
+#define HID_REPORT_ID_NEXT    0x00000200
+#define HID_REPORT_ID_MASK    0x000000ff
+#define HID_REPORT_ID_MAX     0x000000ff
+
+#define HID_REPORT_TYPE_INPUT  1
+#define HID_REPORT_TYPE_OUTPUT 2
+#define HID_REPORT_TYPE_FEATURE        3
+#define HID_REPORT_TYPE_MIN     1
+#define HID_REPORT_TYPE_MAX     3
+
+struct hiddev_field_info {
+       __u32 report_type;
+       __u32 report_id;
+       __u32 field_index;
+       __u32 maxusage;
+       __u32 flags;
+       __u32 physical;         /* physical usage for this field */
+       __u32 logical;          /* logical usage for this field */
+       __u32 application;              /* application usage for this field */
+       __s32 logical_minimum;
+       __s32 logical_maximum;
+       __s32 physical_minimum;
+       __s32 physical_maximum;
+       __u32 unit_exponent;
+       __u32 unit;
+};
+
+/* Fill in report_type, report_id and field_index to get the information on a
+ * field.
+ */
+#define HID_FIELD_CONSTANT             0x001
+#define HID_FIELD_VARIABLE             0x002
+#define HID_FIELD_RELATIVE             0x004
+#define HID_FIELD_WRAP                 0x008   
+#define HID_FIELD_NONLINEAR            0x010
+#define HID_FIELD_NO_PREFERRED         0x020
+#define HID_FIELD_NULL_STATE           0x040
+#define HID_FIELD_VOLATILE             0x080
+#define HID_FIELD_BUFFERED_BYTE                0x100
+
+struct hiddev_usage_ref {
+       __u32 report_type;
+       __u32 report_id;
+       __u32 field_index;
+       __u32 usage_index;
+       __u32 usage_code;
+       __s32 value;
+};
+
+/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
+ * It really manifests itself as setting the value of consecutive usages */
+#define HID_MAX_MULTI_USAGES 1024
+struct hiddev_usage_ref_multi {
+       struct hiddev_usage_ref uref;
+       __u32 num_values;
+       __s32 values[HID_MAX_MULTI_USAGES];
+};
+
+/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
+ * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
+ * been sent by the device 
+ */
+#define HID_FIELD_INDEX_NONE 0xffffffff
+
+/*
+ * Protocol version.
+ */
+
+#define HID_VERSION            0x010004
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+#define HIDIOCGVERSION         _IOR('H', 0x01, int)
+#define HIDIOCAPPLICATION      _IO('H', 0x02)
+#define HIDIOCGDEVINFO         _IOR('H', 0x03, struct hiddev_devinfo)
+#define HIDIOCGSTRING          _IOR('H', 0x04, struct hiddev_string_descriptor)
+#define HIDIOCINITREPORT       _IO('H', 0x05)
+#define HIDIOCGNAME(len)       _IOC(_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGREPORT          _IOW('H', 0x07, struct hiddev_report_info)
+#define HIDIOCSREPORT          _IOW('H', 0x08, struct hiddev_report_info)
+#define HIDIOCGREPORTINFO      _IOWR('H', 0x09, struct hiddev_report_info)
+#define HIDIOCGFIELDINFO       _IOWR('H', 0x0A, struct hiddev_field_info)
+#define HIDIOCGUSAGE           _IOWR('H', 0x0B, struct hiddev_usage_ref)
+#define HIDIOCSUSAGE           _IOW('H', 0x0C, struct hiddev_usage_ref)
+#define HIDIOCGUCODE           _IOWR('H', 0x0D, struct hiddev_usage_ref)
+#define HIDIOCGFLAG            _IOR('H', 0x0E, int)
+#define HIDIOCSFLAG            _IOW('H', 0x0F, int)
+#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
+#define HIDIOCGCOLLECTIONINFO  _IOWR('H', 0x11, struct hiddev_collection_info)
+#define HIDIOCGPHYS(len)       _IOC(_IOC_READ, 'H', 0x12, len)
+
+/* For writing/reading to multiple/consecutive usages */
+#define HIDIOCGUSAGES          _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
+#define HIDIOCSUSAGES          _IOW('H', 0x14, struct hiddev_usage_ref_multi)
+
+/* 
+ * Flags to be used in HIDIOCSFLAG
+ */
+#define HIDDEV_FLAG_UREF       0x1
+#define HIDDEV_FLAG_REPORT     0x2
+#define HIDDEV_FLAGS           0x3
+
+/* To traverse the input report descriptor info for a HID device, perform the 
+ * following:
+ *
+ * rinfo.report_type = HID_REPORT_TYPE_INPUT;
+ * rinfo.report_id = HID_REPORT_ID_FIRST;
+ * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ *
+ * while (ret >= 0) {
+ *     for (i = 0; i < rinfo.num_fields; i++) {
+ *             finfo.report_type = rinfo.report_type;
+ *             finfo.report_id = rinfo.report_id;
+ *             finfo.field_index = i;
+ *             ioctl(fd, HIDIOCGFIELDINFO, &finfo);
+ *             for (j = 0; j < finfo.maxusage; j++) {
+ *                     uref.report_type = rinfo.report_type;
+ *                     uref.report_id = rinfo.report_id;
+ *                     uref.field_index = i;
+ *                     uref.usage_index = j;
+ *                     ioctl(fd, HIDIOCGUCODE, &uref);
+ *                     ioctl(fd, HIDIOCGUSAGE, &uref);
+ *             }
+ *     }
+ *     rinfo.report_id |= HID_REPORT_ID_NEXT;
+ *     ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
+ * }
+ */
+
+
+#endif /* _UAPI_HIDDEV_H */
diff --git a/include/uapi/linux/hidraw.h b/include/uapi/linux/hidraw.h
new file mode 100644 (file)
index 0000000..f5b7329
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  Copyright (c) 2007 Jiri Kosina
+ */
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef _UAPI_HIDRAW_H
+#define _UAPI_HIDRAW_H
+
+
+
+#include <linux/hid.h>
+#include <linux/types.h>
+
+struct hidraw_report_descriptor {
+       __u32 size;
+       __u8 value[HID_MAX_DESCRIPTOR_SIZE];
+};
+
+struct hidraw_devinfo {
+       __u32 bustype;
+       __s16 vendor;
+       __s16 product;
+};
+
+/* ioctl interface */
+#define HIDIOCGRDESCSIZE       _IOR('H', 0x01, int)
+#define HIDIOCGRDESC           _IOR('H', 0x02, struct hidraw_report_descriptor)
+#define HIDIOCGRAWINFO         _IOR('H', 0x03, struct hidraw_devinfo)
+#define HIDIOCGRAWNAME(len)     _IOC(_IOC_READ, 'H', 0x04, len)
+#define HIDIOCGRAWPHYS(len)     _IOC(_IOC_READ, 'H', 0x05, len)
+/* The first byte of SFEATURE and GFEATURE is the report number */
+#define HIDIOCSFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
+
+#define HIDRAW_FIRST_MINOR 0
+#define HIDRAW_MAX_DEVICES 64
+/* number of reports to buffer */
+#define HIDRAW_BUFFER_SIZE 64
+
+
+/* kernel-only API declarations */
+
+#endif /* _UAPI_HIDRAW_H */
diff --git a/include/uapi/linux/hpet.h b/include/uapi/linux/hpet.h
new file mode 100644 (file)
index 0000000..8af3c70
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _UAPI__HPET__
+#define _UAPI__HPET__
+
+#include <linux/compiler.h>
+
+
+struct hpet_info {
+       unsigned long hi_ireqfreq;      /* Hz */
+       unsigned long hi_flags; /* information */
+       unsigned short hi_hpet;
+       unsigned short hi_timer;
+};
+
+#define HPET_INFO_PERIODIC     0x0010  /* periodic-capable comparator */
+
+#define        HPET_IE_ON      _IO('h', 0x01)  /* interrupt on */
+#define        HPET_IE_OFF     _IO('h', 0x02)  /* interrupt off */
+#define        HPET_INFO       _IOR('h', 0x03, struct hpet_info)
+#define        HPET_EPI        _IO('h', 0x04)  /* enable periodic */
+#define        HPET_DPI        _IO('h', 0x05)  /* disable periodic */
+#define        HPET_IRQFREQ    _IOW('h', 0x6, unsigned long)   /* IRQFREQ usec */
+
+#define MAX_HPET_TBS   8               /* maximum hpet timer blocks */
+
+#endif /* _UAPI__HPET__ */
diff --git a/include/uapi/linux/i2c-dev.h b/include/uapi/linux/i2c-dev.h
new file mode 100644 (file)
index 0000000..3f31155
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+    i2c-dev.h - i2c-bus driver, char device interface
+
+    Copyright (C) 1995-97 Simon G. Vogl
+    Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301 USA.
+*/
+
+#ifndef _UAPI_LINUX_I2C_DEV_H
+#define _UAPI_LINUX_I2C_DEV_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+/* /dev/i2c-X ioctl commands.  The ioctl's parameter is always an
+ * unsigned long, except for:
+ *     - I2C_FUNCS, takes pointer to an unsigned long
+ *     - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
+ *     - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
+ */
+#define I2C_RETRIES    0x0701  /* number of times a device address should
+                                  be polled when not acknowledging */
+#define I2C_TIMEOUT    0x0702  /* set timeout in units of 10 ms */
+
+/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
+ * are NOT supported! (due to code brokenness)
+ */
+#define I2C_SLAVE      0x0703  /* Use this slave address */
+#define I2C_SLAVE_FORCE        0x0706  /* Use this slave address, even if it
+                                  is already in use by a driver! */
+#define I2C_TENBIT     0x0704  /* 0 for 7 bit addrs, != 0 for 10 bit */
+
+#define I2C_FUNCS      0x0705  /* Get the adapter functionality mask */
+
+#define I2C_RDWR       0x0707  /* Combined R/W transfer (one STOP only) */
+
+#define I2C_PEC                0x0708  /* != 0 to use PEC with SMBus */
+#define I2C_SMBUS      0x0720  /* SMBus transfer */
+
+
+/* This is the structure as used in the I2C_SMBUS ioctl call */
+struct i2c_smbus_ioctl_data {
+       __u8 read_write;
+       __u8 command;
+       __u32 size;
+       union i2c_smbus_data __user *data;
+};
+
+/* This is the structure as used in the I2C_RDWR ioctl call */
+struct i2c_rdwr_ioctl_data {
+       struct i2c_msg __user *msgs;    /* pointers to i2c_msgs */
+       __u32 nmsgs;                    /* number of i2c_msgs */
+};
+
+#define  I2C_RDRW_IOCTL_MAX_MSGS       42
+
+
+#endif /* _UAPI_LINUX_I2C_DEV_H */
diff --git a/include/uapi/linux/i2c.h b/include/uapi/linux/i2c.h
new file mode 100644 (file)
index 0000000..0e949cb
--- /dev/null
@@ -0,0 +1,151 @@
+/* ------------------------------------------------------------------------- */
+/*                                                                          */
+/* i2c.h - definitions for the i2c-bus interface                            */
+/*                                                                          */
+/* ------------------------------------------------------------------------- */
+/*   Copyright (C) 1995-2000 Simon G. Vogl
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA 02110-1301 USA.                                                      */
+/* ------------------------------------------------------------------------- */
+
+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
+   Frodo Looijaard <frodol@dds.nl> */
+
+#ifndef _UAPI_LINUX_I2C_H
+#define _UAPI_LINUX_I2C_H
+
+#include <linux/types.h>
+
+/**
+ * struct i2c_msg - an I2C transaction segment beginning with START
+ * @addr: Slave address, either seven or ten bits.  When this is a ten
+ *     bit address, I2C_M_TEN must be set in @flags and the adapter
+ *     must support I2C_FUNC_10BIT_ADDR.
+ * @flags: I2C_M_RD is handled by all adapters.  No other flags may be
+ *     provided unless the adapter exported the relevant I2C_FUNC_*
+ *     flags through i2c_check_functionality().
+ * @len: Number of data bytes in @buf being read from or written to the
+ *     I2C slave address.  For read transactions where I2C_M_RECV_LEN
+ *     is set, the caller guarantees that this buffer can hold up to
+ *     32 bytes in addition to the initial length byte sent by the
+ *     slave (plus, if used, the SMBus PEC); and this value will be
+ *     incremented by the number of block data bytes received.
+ * @buf: The buffer into which data is read, or from which it's written.
+ *
+ * An i2c_msg is the low level representation of one segment of an I2C
+ * transaction.  It is visible to drivers in the @i2c_transfer() procedure,
+ * to userspace from i2c-dev, and to I2C adapter drivers through the
+ * @i2c_adapter.@master_xfer() method.
+ *
+ * Except when I2C "protocol mangling" is used, all I2C adapters implement
+ * the standard rules for I2C transactions.  Each transaction begins with a
+ * START.  That is followed by the slave address, and a bit encoding read
+ * versus write.  Then follow all the data bytes, possibly including a byte
+ * with SMBus PEC.  The transfer terminates with a NAK, or when all those
+ * bytes have been transferred and ACKed.  If this is the last message in a
+ * group, it is followed by a STOP.  Otherwise it is followed by the next
+ * @i2c_msg transaction segment, beginning with a (repeated) START.
+ *
+ * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
+ * passing certain @flags may have changed those standard protocol behaviors.
+ * Those flags are only for use with broken/nonconforming slaves, and with
+ * adapters which are known to support the specific mangling options they
+ * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
+ */
+struct i2c_msg {
+       __u16 addr;     /* slave address                        */
+       __u16 flags;
+#define I2C_M_TEN              0x0010  /* this is a ten bit chip address */
+#define I2C_M_RD               0x0001  /* read data, from slave to master */
+#define I2C_M_STOP             0x8000  /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_NOSTART          0x4000  /* if I2C_FUNC_NOSTART */
+#define I2C_M_REV_DIR_ADDR     0x2000  /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_IGNORE_NAK       0x1000  /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_NO_RD_ACK                0x0800  /* if I2C_FUNC_PROTOCOL_MANGLING */
+#define I2C_M_RECV_LEN         0x0400  /* length will be first received byte */
+       __u16 len;              /* msg length                           */
+       __u8 *buf;              /* pointer to msg data                  */
+};
+
+/* To determine what functionality is present */
+
+#define I2C_FUNC_I2C                   0x00000001
+#define I2C_FUNC_10BIT_ADDR            0x00000002
+#define I2C_FUNC_PROTOCOL_MANGLING     0x00000004 /* I2C_M_IGNORE_NAK etc. */
+#define I2C_FUNC_SMBUS_PEC             0x00000008
+#define I2C_FUNC_NOSTART               0x00000010 /* I2C_M_NOSTART */
+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
+#define I2C_FUNC_SMBUS_QUICK           0x00010000
+#define I2C_FUNC_SMBUS_READ_BYTE       0x00020000
+#define I2C_FUNC_SMBUS_WRITE_BYTE      0x00040000
+#define I2C_FUNC_SMBUS_READ_BYTE_DATA  0x00080000
+#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
+#define I2C_FUNC_SMBUS_READ_WORD_DATA  0x00200000
+#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
+#define I2C_FUNC_SMBUS_PROC_CALL       0x00800000
+#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
+#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK  0x04000000 /* I2C-like block xfer  */
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
+
+#define I2C_FUNC_SMBUS_BYTE            (I2C_FUNC_SMBUS_READ_BYTE | \
+                                        I2C_FUNC_SMBUS_WRITE_BYTE)
+#define I2C_FUNC_SMBUS_BYTE_DATA       (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
+                                        I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
+#define I2C_FUNC_SMBUS_WORD_DATA       (I2C_FUNC_SMBUS_READ_WORD_DATA | \
+                                        I2C_FUNC_SMBUS_WRITE_WORD_DATA)
+#define I2C_FUNC_SMBUS_BLOCK_DATA      (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
+                                        I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
+#define I2C_FUNC_SMBUS_I2C_BLOCK       (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
+                                        I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
+
+#define I2C_FUNC_SMBUS_EMUL            (I2C_FUNC_SMBUS_QUICK | \
+                                        I2C_FUNC_SMBUS_BYTE | \
+                                        I2C_FUNC_SMBUS_BYTE_DATA | \
+                                        I2C_FUNC_SMBUS_WORD_DATA | \
+                                        I2C_FUNC_SMBUS_PROC_CALL | \
+                                        I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
+                                        I2C_FUNC_SMBUS_I2C_BLOCK | \
+                                        I2C_FUNC_SMBUS_PEC)
+
+/*
+ * Data for SMBus Messages
+ */
+#define I2C_SMBUS_BLOCK_MAX    32      /* As specified in SMBus standard */
+union i2c_smbus_data {
+       __u8 byte;
+       __u16 word;
+       __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
+                              /* and one more for user-space compatibility */
+};
+
+/* i2c_smbus_xfer read or write markers */
+#define I2C_SMBUS_READ 1
+#define I2C_SMBUS_WRITE        0
+
+/* SMBus transaction types (size parameter in the above functions)
+   Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
+#define I2C_SMBUS_QUICK                    0
+#define I2C_SMBUS_BYTE             1
+#define I2C_SMBUS_BYTE_DATA        2
+#define I2C_SMBUS_WORD_DATA        3
+#define I2C_SMBUS_PROC_CALL        4
+#define I2C_SMBUS_BLOCK_DATA       5
+#define I2C_SMBUS_I2C_BLOCK_BROKEN  6
+#define I2C_SMBUS_BLOCK_PROC_CALL   7          /* SMBus 2.0 */
+#define I2C_SMBUS_I2C_BLOCK_DATA    8
+
+#endif /* _UAPI_LINUX_I2C_H */
similarity index 100%
rename from include/linux/i8k.h
rename to include/uapi/linux/i8k.h
diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h
new file mode 100644 (file)
index 0000000..16fff05
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions for the ICMP protocol.
+ *
+ * Version:    @(#)icmp.h      1.0.3   04/28/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_ICMP_H
+#define _UAPI_LINUX_ICMP_H
+
+#include <linux/types.h>
+
+#define ICMP_ECHOREPLY         0       /* Echo Reply                   */
+#define ICMP_DEST_UNREACH      3       /* Destination Unreachable      */
+#define ICMP_SOURCE_QUENCH     4       /* Source Quench                */
+#define ICMP_REDIRECT          5       /* Redirect (change route)      */
+#define ICMP_ECHO              8       /* Echo Request                 */
+#define ICMP_TIME_EXCEEDED     11      /* Time Exceeded                */
+#define ICMP_PARAMETERPROB     12      /* Parameter Problem            */
+#define ICMP_TIMESTAMP         13      /* Timestamp Request            */
+#define ICMP_TIMESTAMPREPLY    14      /* Timestamp Reply              */
+#define ICMP_INFO_REQUEST      15      /* Information Request          */
+#define ICMP_INFO_REPLY                16      /* Information Reply            */
+#define ICMP_ADDRESS           17      /* Address Mask Request         */
+#define ICMP_ADDRESSREPLY      18      /* Address Mask Reply           */
+#define NR_ICMP_TYPES          18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH       0       /* Network Unreachable          */
+#define ICMP_HOST_UNREACH      1       /* Host Unreachable             */
+#define ICMP_PROT_UNREACH      2       /* Protocol Unreachable         */
+#define ICMP_PORT_UNREACH      3       /* Port Unreachable             */
+#define ICMP_FRAG_NEEDED       4       /* Fragmentation Needed/DF set  */
+#define ICMP_SR_FAILED         5       /* Source Route failed          */
+#define ICMP_NET_UNKNOWN       6
+#define ICMP_HOST_UNKNOWN      7
+#define ICMP_HOST_ISOLATED     8
+#define ICMP_NET_ANO           9
+#define ICMP_HOST_ANO          10
+#define ICMP_NET_UNR_TOS       11
+#define ICMP_HOST_UNR_TOS      12
+#define ICMP_PKT_FILTERED      13      /* Packet filtered */
+#define ICMP_PREC_VIOLATION    14      /* Precedence violation */
+#define ICMP_PREC_CUTOFF       15      /* Precedence cut off */
+#define NR_ICMP_UNREACH                15      /* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET         0       /* Redirect Net                 */
+#define ICMP_REDIR_HOST                1       /* Redirect Host                */
+#define ICMP_REDIR_NETTOS      2       /* Redirect Net for TOS         */
+#define ICMP_REDIR_HOSTTOS     3       /* Redirect Host for TOS        */
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL           0       /* TTL count exceeded           */
+#define ICMP_EXC_FRAGTIME      1       /* Fragment Reass time exceeded */
+
+
+struct icmphdr {
+  __u8         type;
+  __u8         code;
+  __sum16      checksum;
+  union {
+       struct {
+               __be16  id;
+               __be16  sequence;
+       } echo;
+       __be32  gateway;
+       struct {
+               __be16  __unused;
+               __be16  mtu;
+       } frag;
+  } un;
+};
+
+
+/*
+ *     constants for (set|get)sockopt
+ */
+
+#define ICMP_FILTER                    1
+
+struct icmp_filter {
+       __u32           data;
+};
+
+
+#endif /* _UAPI_LINUX_ICMP_H */
diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
new file mode 100644 (file)
index 0000000..e0133c7
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef _UAPI_LINUX_ICMPV6_H
+#define _UAPI_LINUX_ICMPV6_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+struct icmp6hdr {
+
+       __u8            icmp6_type;
+       __u8            icmp6_code;
+       __sum16         icmp6_cksum;
+
+
+       union {
+               __be32                  un_data32[1];
+               __be16                  un_data16[2];
+               __u8                    un_data8[4];
+
+               struct icmpv6_echo {
+                       __be16          identifier;
+                       __be16          sequence;
+               } u_echo;
+
+                struct icmpv6_nd_advt {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+                        __u32          reserved:5,
+                                       override:1,
+                                       solicited:1,
+                                       router:1,
+                                       reserved2:24;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+                        __u32          router:1,
+                                       solicited:1,
+                                       override:1,
+                                       reserved:29;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif                                         
+                } u_nd_advt;
+
+                struct icmpv6_nd_ra {
+                       __u8            hop_limit;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+                       __u8            reserved:3,
+                                       router_pref:2,
+                                       home_agent:1,
+                                       other:1,
+                                       managed:1;
+
+#elif defined(__BIG_ENDIAN_BITFIELD)
+                       __u8            managed:1,
+                                       other:1,
+                                       home_agent:1,
+                                       router_pref:2,
+                                       reserved:3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+                       __be16          rt_lifetime;
+                } u_nd_ra;
+
+       } icmp6_dataun;
+
+#define icmp6_identifier       icmp6_dataun.u_echo.identifier
+#define icmp6_sequence         icmp6_dataun.u_echo.sequence
+#define icmp6_pointer          icmp6_dataun.un_data32[0]
+#define icmp6_mtu              icmp6_dataun.un_data32[0]
+#define icmp6_unused           icmp6_dataun.un_data32[0]
+#define icmp6_maxdelay         icmp6_dataun.un_data16[0]
+#define icmp6_router           icmp6_dataun.u_nd_advt.router
+#define icmp6_solicited                icmp6_dataun.u_nd_advt.solicited
+#define icmp6_override         icmp6_dataun.u_nd_advt.override
+#define icmp6_ndiscreserved    icmp6_dataun.u_nd_advt.reserved
+#define icmp6_hop_limit                icmp6_dataun.u_nd_ra.hop_limit
+#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
+#define icmp6_addrconf_other   icmp6_dataun.u_nd_ra.other
+#define icmp6_rt_lifetime      icmp6_dataun.u_nd_ra.rt_lifetime
+#define icmp6_router_pref      icmp6_dataun.u_nd_ra.router_pref
+};
+
+
+#define ICMPV6_ROUTER_PREF_LOW         0x3
+#define ICMPV6_ROUTER_PREF_MEDIUM      0x0
+#define ICMPV6_ROUTER_PREF_HIGH                0x1
+#define ICMPV6_ROUTER_PREF_INVALID     0x2
+
+#define ICMPV6_DEST_UNREACH            1
+#define ICMPV6_PKT_TOOBIG              2
+#define ICMPV6_TIME_EXCEED             3
+#define ICMPV6_PARAMPROB               4
+
+#define ICMPV6_INFOMSG_MASK            0x80
+
+#define ICMPV6_ECHO_REQUEST            128
+#define ICMPV6_ECHO_REPLY              129
+#define ICMPV6_MGM_QUERY               130
+#define ICMPV6_MGM_REPORT              131
+#define ICMPV6_MGM_REDUCTION           132
+
+#define ICMPV6_NI_QUERY                        139
+#define ICMPV6_NI_REPLY                        140
+
+#define ICMPV6_MLD2_REPORT             143
+
+#define ICMPV6_DHAAD_REQUEST           144
+#define ICMPV6_DHAAD_REPLY             145
+#define ICMPV6_MOBILE_PREFIX_SOL       146
+#define ICMPV6_MOBILE_PREFIX_ADV       147
+
+/*
+ *     Codes for Destination Unreachable
+ */
+#define ICMPV6_NOROUTE                 0
+#define ICMPV6_ADM_PROHIBITED          1
+#define ICMPV6_NOT_NEIGHBOUR           2
+#define ICMPV6_ADDR_UNREACH            3
+#define ICMPV6_PORT_UNREACH            4
+
+/*
+ *     Codes for Time Exceeded
+ */
+#define ICMPV6_EXC_HOPLIMIT            0
+#define ICMPV6_EXC_FRAGTIME            1
+
+/*
+ *     Codes for Parameter Problem
+ */
+#define ICMPV6_HDR_FIELD               0
+#define ICMPV6_UNK_NEXTHDR             1
+#define ICMPV6_UNK_OPTION              2
+
+/*
+ *     constants for (set|get)sockopt
+ */
+
+#define ICMPV6_FILTER                  1
+
+/*
+ *     ICMPV6 filter
+ */
+
+#define ICMPV6_FILTER_BLOCK            1
+#define ICMPV6_FILTER_PASS             2
+#define ICMPV6_FILTER_BLOCKOTHERS      3
+#define ICMPV6_FILTER_PASSONLY         4
+
+struct icmp6_filter {
+       __u32           data[8];
+};
+
+/*
+ *     Definitions for MLDv2
+ */
+#define MLD2_MODE_IS_INCLUDE   1
+#define MLD2_MODE_IS_EXCLUDE   2
+#define MLD2_CHANGE_TO_INCLUDE 3
+#define MLD2_CHANGE_TO_EXCLUDE 4
+#define MLD2_ALLOW_NEW_SOURCES 5
+#define MLD2_BLOCK_OLD_SOURCES 6
+
+#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
+
+
+#endif /* _UAPI_LINUX_ICMPV6_H */
similarity index 100%
rename from include/linux/if.h
rename to include/uapi/linux/if.h
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
new file mode 100644 (file)
index 0000000..82c7d1b
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Global definitions for the ARP (RFC 826) protocol.
+ *
+ * Version:    @(#)if_arp.h    1.0.1   04/16/93
+ *
+ * Authors:    Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
+ *             Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
+ *             Ross Biro
+ *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *             Florian La Roche,
+ *             Jonathan Layes <layes@loran.com>
+ *             Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_IF_ARP_H
+#define _UAPI_LINUX_IF_ARP_H
+
+#include <linux/netdevice.h>
+
+/* ARP protocol HARDWARE identifiers. */
+#define ARPHRD_NETROM  0               /* from KA9Q: NET/ROM pseudo    */
+#define ARPHRD_ETHER   1               /* Ethernet 10Mbps              */
+#define        ARPHRD_EETHER   2               /* Experimental Ethernet        */
+#define        ARPHRD_AX25     3               /* AX.25 Level 2                */
+#define        ARPHRD_PRONET   4               /* PROnet token ring            */
+#define        ARPHRD_CHAOS    5               /* Chaosnet                     */
+#define        ARPHRD_IEEE802  6               /* IEEE 802.2 Ethernet/TR/TB    */
+#define        ARPHRD_ARCNET   7               /* ARCnet                       */
+#define        ARPHRD_APPLETLK 8               /* APPLEtalk                    */
+#define ARPHRD_DLCI    15              /* Frame Relay DLCI             */
+#define ARPHRD_ATM     19              /* ATM                          */
+#define ARPHRD_METRICOM        23              /* Metricom STRIP (new IANA id) */
+#define        ARPHRD_IEEE1394 24              /* IEEE 1394 IPv4 - RFC 2734    */
+#define ARPHRD_EUI64   27              /* EUI-64                       */
+#define ARPHRD_INFINIBAND 32           /* InfiniBand                   */
+
+/* Dummy types for non ARP hardware */
+#define ARPHRD_SLIP    256
+#define ARPHRD_CSLIP   257
+#define ARPHRD_SLIP6   258
+#define ARPHRD_CSLIP6  259
+#define ARPHRD_RSRVD   260             /* Notional KISS type           */
+#define ARPHRD_ADAPT   264
+#define ARPHRD_ROSE    270
+#define ARPHRD_X25     271             /* CCITT X.25                   */
+#define ARPHRD_HWX25   272             /* Boards with X.25 in firmware */
+#define ARPHRD_CAN     280             /* Controller Area Network      */
+#define ARPHRD_PPP     512
+#define ARPHRD_CISCO   513             /* Cisco HDLC                   */
+#define ARPHRD_HDLC    ARPHRD_CISCO
+#define ARPHRD_LAPB    516             /* LAPB                         */
+#define ARPHRD_DDCMP    517            /* Digital's DDCMP protocol     */
+#define ARPHRD_RAWHDLC 518             /* Raw HDLC                     */
+
+#define ARPHRD_TUNNEL  768             /* IPIP tunnel                  */
+#define ARPHRD_TUNNEL6 769             /* IP6IP6 tunnel                */
+#define ARPHRD_FRAD    770             /* Frame Relay Access Device    */
+#define ARPHRD_SKIP    771             /* SKIP vif                     */
+#define ARPHRD_LOOPBACK        772             /* Loopback device              */
+#define ARPHRD_LOCALTLK 773            /* Localtalk device             */
+#define ARPHRD_FDDI    774             /* Fiber Distributed Data Interface */
+#define ARPHRD_BIF      775             /* AP1000 BIF                   */
+#define ARPHRD_SIT     776             /* sit0 device - IPv6-in-IPv4   */
+#define ARPHRD_IPDDP   777             /* IP over DDP tunneller        */
+#define ARPHRD_IPGRE   778             /* GRE over IP                  */
+#define ARPHRD_PIMREG  779             /* PIMSM register interface     */
+#define ARPHRD_HIPPI   780             /* High Performance Parallel Interface */
+#define ARPHRD_ASH     781             /* Nexus 64Mbps Ash             */
+#define ARPHRD_ECONET  782             /* Acorn Econet                 */
+#define ARPHRD_IRDA    783             /* Linux-IrDA                   */
+/* ARP works differently on different FC media .. so  */
+#define ARPHRD_FCPP    784             /* Point to point fibrechannel  */
+#define ARPHRD_FCAL    785             /* Fibrechannel arbitrated loop */
+#define ARPHRD_FCPL    786             /* Fibrechannel public loop     */
+#define ARPHRD_FCFABRIC        787             /* Fibrechannel fabric          */
+       /* 787->799 reserved for fibrechannel media types */
+#define ARPHRD_IEEE802_TR 800          /* Magic type ident for TR      */
+#define ARPHRD_IEEE80211 801           /* IEEE 802.11                  */
+#define ARPHRD_IEEE80211_PRISM 802     /* IEEE 802.11 + Prism2 header  */
+#define ARPHRD_IEEE80211_RADIOTAP 803  /* IEEE 802.11 + radiotap header */
+#define ARPHRD_IEEE802154        804
+#define ARPHRD_IEEE802154_MONITOR 805  /* IEEE 802.15.4 network monitor */
+
+#define ARPHRD_PHONET  820             /* PhoNet media type            */
+#define ARPHRD_PHONET_PIPE 821         /* PhoNet pipe header           */
+#define ARPHRD_CAIF    822             /* CAIF media type              */
+#define ARPHRD_IP6GRE  823             /* GRE over IPv6                */
+
+#define ARPHRD_VOID      0xFFFF        /* Void type, nothing is known */
+#define ARPHRD_NONE      0xFFFE        /* zero header length */
+
+/* ARP protocol opcodes. */
+#define        ARPOP_REQUEST   1               /* ARP request                  */
+#define        ARPOP_REPLY     2               /* ARP reply                    */
+#define        ARPOP_RREQUEST  3               /* RARP request                 */
+#define        ARPOP_RREPLY    4               /* RARP reply                   */
+#define        ARPOP_InREQUEST 8               /* InARP request                */
+#define        ARPOP_InREPLY   9               /* InARP reply                  */
+#define        ARPOP_NAK       10              /* (ATM)ARP NAK                 */
+
+
+/* ARP ioctl request. */
+struct arpreq {
+  struct sockaddr      arp_pa;         /* protocol address             */
+  struct sockaddr      arp_ha;         /* hardware address             */
+  int                  arp_flags;      /* flags                        */
+  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
+  char                 arp_dev[16];
+};
+
+struct arpreq_old {
+  struct sockaddr      arp_pa;         /* protocol address             */
+  struct sockaddr      arp_ha;         /* hardware address             */
+  int                  arp_flags;      /* flags                        */
+  struct sockaddr       arp_netmask;    /* netmask (only for proxy arps) */
+};
+
+/* ARP Flag values. */
+#define ATF_COM                0x02            /* completed entry (ha valid)   */
+#define        ATF_PERM        0x04            /* permanent entry              */
+#define        ATF_PUBL        0x08            /* publish entry                */
+#define        ATF_USETRAILERS 0x10            /* has requested trailers       */
+#define ATF_NETMASK     0x20            /* want to use a netmask (only
+                                          for proxy entries) */
+#define ATF_DONTPUB    0x40            /* don't answer this addresses  */
+
+/*
+ *     This structure defines an ethernet arp header.
+ */
+
+struct arphdr {
+       __be16          ar_hrd;         /* format of hardware address   */
+       __be16          ar_pro;         /* format of protocol address   */
+       unsigned char   ar_hln;         /* length of hardware address   */
+       unsigned char   ar_pln;         /* length of protocol address   */
+       __be16          ar_op;          /* ARP opcode (command)         */
+
+#if 0
+        /*
+         *      Ethernet looks like this : This bit is variable sized however...
+         */
+       unsigned char           ar_sha[ETH_ALEN];       /* sender hardware address      */
+       unsigned char           ar_sip[4];              /* sender IP address            */
+       unsigned char           ar_tha[ETH_ALEN];       /* target hardware address      */
+       unsigned char           ar_tip[4];              /* target IP address            */
+#endif
+
+};
+
+
+#endif /* _UAPI_LINUX_IF_ARP_H */
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
new file mode 100644 (file)
index 0000000..a8fe954
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ *     Linux ethernet bridge
+ *
+ *     Authors:
+ *     Lennert Buytenhek               <buytenh@gnu.org>
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     as published by the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IF_BRIDGE_H
+#define _UAPI_LINUX_IF_BRIDGE_H
+
+#include <linux/types.h>
+
+#define SYSFS_BRIDGE_ATTR      "bridge"
+#define SYSFS_BRIDGE_FDB       "brforward"
+#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
+#define SYSFS_BRIDGE_PORT_ATTR "brport"
+#define SYSFS_BRIDGE_PORT_LINK "bridge"
+
+#define BRCTL_VERSION 1
+
+#define BRCTL_GET_VERSION 0
+#define BRCTL_GET_BRIDGES 1
+#define BRCTL_ADD_BRIDGE 2
+#define BRCTL_DEL_BRIDGE 3
+#define BRCTL_ADD_IF 4
+#define BRCTL_DEL_IF 5
+#define BRCTL_GET_BRIDGE_INFO 6
+#define BRCTL_GET_PORT_LIST 7
+#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
+#define BRCTL_SET_BRIDGE_HELLO_TIME 9
+#define BRCTL_SET_BRIDGE_MAX_AGE 10
+#define BRCTL_SET_AGEING_TIME 11
+#define BRCTL_SET_GC_INTERVAL 12
+#define BRCTL_GET_PORT_INFO 13
+#define BRCTL_SET_BRIDGE_STP_STATE 14
+#define BRCTL_SET_BRIDGE_PRIORITY 15
+#define BRCTL_SET_PORT_PRIORITY 16
+#define BRCTL_SET_PATH_COST 17
+#define BRCTL_GET_FDB_ENTRIES 18
+
+#define BR_STATE_DISABLED 0
+#define BR_STATE_LISTENING 1
+#define BR_STATE_LEARNING 2
+#define BR_STATE_FORWARDING 3
+#define BR_STATE_BLOCKING 4
+
+struct __bridge_info {
+       __u64 designated_root;
+       __u64 bridge_id;
+       __u32 root_path_cost;
+       __u32 max_age;
+       __u32 hello_time;
+       __u32 forward_delay;
+       __u32 bridge_max_age;
+       __u32 bridge_hello_time;
+       __u32 bridge_forward_delay;
+       __u8 topology_change;
+       __u8 topology_change_detected;
+       __u8 root_port;
+       __u8 stp_enabled;
+       __u32 ageing_time;
+       __u32 gc_interval;
+       __u32 hello_timer_value;
+       __u32 tcn_timer_value;
+       __u32 topology_change_timer_value;
+       __u32 gc_timer_value;
+};
+
+struct __port_info {
+       __u64 designated_root;
+       __u64 designated_bridge;
+       __u16 port_id;
+       __u16 designated_port;
+       __u32 path_cost;
+       __u32 designated_cost;
+       __u8 state;
+       __u8 top_change_ack;
+       __u8 config_pending;
+       __u8 unused0;
+       __u32 message_age_timer_value;
+       __u32 forward_delay_timer_value;
+       __u32 hold_timer_value;
+};
+
+struct __fdb_entry {
+       __u8 mac_addr[6];
+       __u8 port_no;
+       __u8 is_local;
+       __u32 ageing_timer_value;
+       __u8 port_hi;
+       __u8 pad0;
+       __u16 unused;
+};
+
+
+#endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/uapi/linux/if_eql.h b/include/uapi/linux/if_eql.h
new file mode 100644 (file)
index 0000000..06e818c
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Equalizer Load-balancer for serial network interfaces.
+ *
+ * (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
+ * NCM: Network and Communications Management, Inc.
+ *
+ *
+ *     This software may be used and distributed according to the terms
+ *     of the GNU General Public License, incorporated herein by reference.
+ * 
+ * The author may be reached as simon@ncm.com, or C/O
+ *    NCM
+ *    Attn: Simon Janes
+ *    6803 Whittier Ave
+ *    McLean VA 22101
+ *    Phone: 1-703-847-0040 ext 103
+ */
+
+#ifndef _UAPI_LINUX_IF_EQL_H
+#define _UAPI_LINUX_IF_EQL_H
+
+#define EQL_DEFAULT_SLAVE_PRIORITY 28800
+#define EQL_DEFAULT_MAX_SLAVES     4
+#define EQL_DEFAULT_MTU            576
+#define EQL_DEFAULT_RESCHED_IVAL   HZ
+
+#define EQL_ENSLAVE     (SIOCDEVPRIVATE)
+#define EQL_EMANCIPATE  (SIOCDEVPRIVATE + 1)
+
+#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
+#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
+
+#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
+#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
+
+
+typedef struct master_config {
+       char    master_name[16];
+       int     max_slaves;
+       int     min_slaves;
+} master_config_t;
+
+typedef struct slave_config {
+       char    slave_name[16];
+       long    priority;
+} slave_config_t;
+
+typedef struct slaving_request {
+       char    slave_name[16];
+       long    priority;
+} slaving_request_t;
+
+
+#endif /* _UAPI_LINUX_IF_EQL_H */
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
new file mode 100644 (file)
index 0000000..0343e1f
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Global definitions for the Ethernet IEEE 802.3 interface.
+ *
+ * Version:    @(#)if_ether.h  1.0.1a  02/08/94
+ *
+ * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *             Donald Becker, <becker@super.org>
+ *             Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ *             Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IF_ETHER_H
+#define _UAPI_LINUX_IF_ETHER_H
+
+#include <linux/types.h>
+
+/*
+ *     IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
+ *     and FCS/CRC (frame check sequence).
+ */
+
+#define ETH_ALEN       6               /* Octets in one ethernet addr   */
+#define ETH_HLEN       14              /* Total octets in header.       */
+#define ETH_ZLEN       60              /* Min. octets in frame sans FCS */
+#define ETH_DATA_LEN   1500            /* Max. octets in payload        */
+#define ETH_FRAME_LEN  1514            /* Max. octets in frame sans FCS */
+#define ETH_FCS_LEN    4               /* Octets in the FCS             */
+
+/*
+ *     These are the defined Ethernet Protocol ID's.
+ */
+
+#define ETH_P_LOOP     0x0060          /* Ethernet Loopback packet     */
+#define ETH_P_PUP      0x0200          /* Xerox PUP packet             */
+#define ETH_P_PUPAT    0x0201          /* Xerox PUP Addr Trans packet  */
+#define ETH_P_IP       0x0800          /* Internet Protocol packet     */
+#define ETH_P_X25      0x0805          /* CCITT X.25                   */
+#define ETH_P_ARP      0x0806          /* Address Resolution packet    */
+#define        ETH_P_BPQ       0x08FF          /* G8BPQ AX.25 Ethernet Packet  [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IEEEPUP  0x0a00          /* Xerox IEEE802.3 PUP packet */
+#define ETH_P_IEEEPUPAT        0x0a01          /* Xerox IEEE802.3 PUP Addr Trans packet */
+#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
+#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
+#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
+#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */
+#define ETH_P_LAT       0x6004          /* DEC LAT                      */
+#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */
+#define ETH_P_CUST      0x6006          /* DEC Customer use             */
+#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */
+#define ETH_P_TEB      0x6558          /* Trans Ether Bridging         */
+#define ETH_P_RARP      0x8035         /* Reverse Addr Res packet      */
+#define ETH_P_ATALK    0x809B          /* Appletalk DDP                */
+#define ETH_P_AARP     0x80F3          /* Appletalk AARP               */
+#define ETH_P_8021Q    0x8100          /* 802.1Q VLAN Extended Header  */
+#define ETH_P_IPX      0x8137          /* IPX over DIX                 */
+#define ETH_P_IPV6     0x86DD          /* IPv6 over bluebook           */
+#define ETH_P_PAUSE    0x8808          /* IEEE Pause frames. See 802.3 31B */
+#define ETH_P_SLOW     0x8809          /* Slow Protocol. See 802.3ad 43B */
+#define ETH_P_WCCP     0x883E          /* Web-cache coordination protocol
+                                        * defined in draft-wilson-wrec-wccp-v2-00.txt */
+#define ETH_P_PPP_DISC 0x8863          /* PPPoE discovery messages     */
+#define ETH_P_PPP_SES  0x8864          /* PPPoE session messages       */
+#define ETH_P_MPLS_UC  0x8847          /* MPLS Unicast traffic         */
+#define ETH_P_MPLS_MC  0x8848          /* MPLS Multicast traffic       */
+#define ETH_P_ATMMPOA  0x884c          /* MultiProtocol Over ATM       */
+#define ETH_P_LINK_CTL 0x886c          /* HPNA, wlan link local tunnel */
+#define ETH_P_ATMFATE  0x8884          /* Frame-based ATM Transport
+                                        * over Ethernet
+                                        */
+#define ETH_P_PAE      0x888E          /* Port Access Entity (IEEE 802.1X) */
+#define ETH_P_AOE      0x88A2          /* ATA over Ethernet            */
+#define ETH_P_8021AD   0x88A8          /* 802.1ad Service VLAN         */
+#define ETH_P_802_EX1  0x88B5          /* 802.1 Local Experimental 1.  */
+#define ETH_P_TIPC     0x88CA          /* TIPC                         */
+#define ETH_P_8021AH   0x88E7          /* 802.1ah Backbone Service Tag */
+#define ETH_P_1588     0x88F7          /* IEEE 1588 Timesync */
+#define ETH_P_FCOE     0x8906          /* Fibre Channel over Ethernet  */
+#define ETH_P_TDLS     0x890D          /* TDLS */
+#define ETH_P_FIP      0x8914          /* FCoE Initialization Protocol */
+#define ETH_P_QINQ1    0x9100          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_QINQ2    0x9200          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_QINQ3    0x9300          /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_EDSA     0xDADA          /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_AF_IUCV   0xFBFB         /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
+
+/*
+ *     Non DIX types. Won't clash for 1500 types.
+ */
+
+#define ETH_P_802_3    0x0001          /* Dummy type for 802.3 frames  */
+#define ETH_P_AX25     0x0002          /* Dummy protocol id for AX.25  */
+#define ETH_P_ALL      0x0003          /* Every packet (be careful!!!) */
+#define ETH_P_802_2    0x0004          /* 802.2 frames                 */
+#define ETH_P_SNAP     0x0005          /* Internal only                */
+#define ETH_P_DDCMP     0x0006          /* DEC DDCMP: Internal only     */
+#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
+#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
+#define ETH_P_LOCALTALK 0x0009         /* Localtalk pseudo type        */
+#define ETH_P_CAN      0x000C          /* CAN: Controller Area Network */
+#define ETH_P_CANFD    0x000D          /* CANFD: CAN flexible data rate*/
+#define ETH_P_PPPTALK  0x0010          /* Dummy type for Atalk over PPP*/
+#define ETH_P_TR_802_2 0x0011          /* 802.2 frames                 */
+#define ETH_P_MOBITEX  0x0015          /* Mobitex (kaz@cafe.net)       */
+#define ETH_P_CONTROL  0x0016          /* Card specific control frames */
+#define ETH_P_IRDA     0x0017          /* Linux-IrDA                   */
+#define ETH_P_ECONET   0x0018          /* Acorn Econet                 */
+#define ETH_P_HDLC     0x0019          /* HDLC frames                  */
+#define ETH_P_ARCNET   0x001A          /* 1A for ArcNet :-)            */
+#define ETH_P_DSA      0x001B          /* Distributed Switch Arch.     */
+#define ETH_P_TRAILER  0x001C          /* Trailer switch tagging       */
+#define ETH_P_PHONET   0x00F5          /* Nokia Phonet frames          */
+#define ETH_P_IEEE802154 0x00F6                /* IEEE802.15.4 frame           */
+#define ETH_P_CAIF     0x00F7          /* ST-Ericsson CAIF protocol    */
+
+/*
+ *     This is an Ethernet frame header.
+ */
+
+struct ethhdr {
+       unsigned char   h_dest[ETH_ALEN];       /* destination eth addr */
+       unsigned char   h_source[ETH_ALEN];     /* source ether addr    */
+       __be16          h_proto;                /* packet type ID field */
+} __attribute__((packed));
+
+
+#endif /* _UAPI_LINUX_IF_ETHER_H */
diff --git a/include/uapi/linux/if_fddi.h b/include/uapi/linux/if_fddi.h
new file mode 100644 (file)
index 0000000..0d36909
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Global definitions for the ANSI FDDI interface.
+ *
+ * Version:    @(#)if_fddi.h   1.0.2   Sep 29 2004
+ *
+ * Author:     Lawrence V. Stefani, <stefani@lkg.dec.com>
+ *
+ *             if_fddi.h is based on previous if_ether.h and if_tr.h work by
+ *                     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *                     Donald Becker, <becker@super.org>
+ *                     Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ *                     Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+ *                     Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_IF_FDDI_H
+#define _UAPI_LINUX_IF_FDDI_H
+
+#include <linux/types.h>
+
+/*
+ *  Define max and min legal sizes.  The frame sizes do not include
+ *  4 byte FCS/CRC (frame check sequence).
+ */
+#define FDDI_K_ALEN                    6               /* Octets in one FDDI address */
+#define FDDI_K_8022_HLEN       16              /* Total octets in 802.2 header */
+#define FDDI_K_SNAP_HLEN       21              /* Total octets in 802.2 SNAP header */
+#define FDDI_K_8022_ZLEN       16              /* Min octets in 802.2 frame sans FCS */
+#define FDDI_K_SNAP_ZLEN       21              /* Min octets in 802.2 SNAP frame sans FCS */
+#define FDDI_K_8022_DLEN       4475    /* Max octets in 802.2 payload */
+#define FDDI_K_SNAP_DLEN       4470    /* Max octets in 802.2 SNAP payload */
+#define FDDI_K_LLC_ZLEN                13              /* Min octets in LLC frame sans FCS */
+#define FDDI_K_LLC_LEN         4491    /* Max octets in LLC frame sans FCS */
+
+/* Define FDDI Frame Control (FC) Byte values */
+#define FDDI_FC_K_VOID                                 0x00    
+#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80    
+#define FDDI_FC_K_RESTRICTED_TOKEN             0xC0    
+#define FDDI_FC_K_SMT_MIN                              0x41
+#define FDDI_FC_K_SMT_MAX                              0x4F
+#define FDDI_FC_K_MAC_MIN                              0xC1
+#define FDDI_FC_K_MAC_MAX                              0xCF    
+#define FDDI_FC_K_ASYNC_LLC_MIN                        0x50
+#define FDDI_FC_K_ASYNC_LLC_DEF                        0x54
+#define FDDI_FC_K_ASYNC_LLC_MAX                        0x5F
+#define FDDI_FC_K_SYNC_LLC_MIN                 0xD0
+#define FDDI_FC_K_SYNC_LLC_MAX                 0xD7
+#define FDDI_FC_K_IMPLEMENTOR_MIN              0x60
+#define FDDI_FC_K_IMPLEMENTOR_MAX              0x6F
+#define FDDI_FC_K_RESERVED_MIN                 0x70
+#define FDDI_FC_K_RESERVED_MAX                 0x7F
+
+/* Define LLC and SNAP constants */
+#define FDDI_EXTENDED_SAP      0xAA
+#define FDDI_UI_CMD                    0x03
+
+/* Define 802.2 Type 1 header */
+struct fddi_8022_1_hdr {
+       __u8    dsap;                                   /* destination service access point */
+       __u8    ssap;                                   /* source service access point */
+       __u8    ctrl;                                   /* control byte #1 */
+} __attribute__((packed));
+
+/* Define 802.2 Type 2 header */
+struct fddi_8022_2_hdr {
+       __u8    dsap;                                   /* destination service access point */
+       __u8    ssap;                                   /* source service access point */
+       __u8    ctrl_1;                                 /* control byte #1 */
+       __u8    ctrl_2;                                 /* control byte #2 */
+} __attribute__((packed));
+
+/* Define 802.2 SNAP header */
+#define FDDI_K_OUI_LEN 3
+struct fddi_snap_hdr {
+       __u8    dsap;                                   /* always 0xAA */
+       __u8    ssap;                                   /* always 0xAA */
+       __u8    ctrl;                                   /* always 0x03 */
+       __u8    oui[FDDI_K_OUI_LEN];    /* organizational universal id */
+       __be16  ethertype;                              /* packet type ID field */
+} __attribute__((packed));
+
+/* Define FDDI LLC frame header */
+struct fddihdr {
+       __u8    fc;                                             /* frame control */
+       __u8    daddr[FDDI_K_ALEN];             /* destination address */
+       __u8    saddr[FDDI_K_ALEN];             /* source address */
+       union
+               {
+               struct fddi_8022_1_hdr          llc_8022_1;
+               struct fddi_8022_2_hdr          llc_8022_2;
+               struct fddi_snap_hdr            llc_snap;
+               } hdr;
+} __attribute__((packed));
+
+
+#endif /* _UAPI_LINUX_IF_FDDI_H */
diff --git a/include/uapi/linux/if_frad.h b/include/uapi/linux/if_frad.h
new file mode 100644 (file)
index 0000000..f25b08d
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * DLCI/FRAD   Definitions for Frame Relay Access Devices.  DLCI devices are
+ *             created for each DLCI associated with a FRAD.  The FRAD driver
+ *             is not truly a network device, but the lower level device
+ *             handler.  This allows other FRAD manufacturers to use the DLCI
+ *             code, including its RFC1490 encapsulation alongside the current
+ *             implementation for the Sangoma cards.
+ *
+ * Version:    @(#)if_ifrad.h  0.15    31 Mar 96
+ *
+ * Author:     Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ *             0.15    Mike McLagan    changed structure defs (packed)
+ *                                     re-arranged flags
+ *                                     added DLCI_RET vars
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_FRAD_H_
+#define _UAPI_FRAD_H_
+
+#include <linux/if.h>
+
+/* Structures and constants associated with the DLCI device driver */
+
+struct dlci_add
+{
+   char  devname[IFNAMSIZ];
+   short dlci;
+};
+
+#define DLCI_GET_CONF  (SIOCDEVPRIVATE + 2)
+#define DLCI_SET_CONF  (SIOCDEVPRIVATE + 3)
+
+/* 
+ * These are related to the Sangoma SDLA and should remain in order. 
+ * Code within the SDLA module is based on the specifics of this 
+ * structure.  Change at your own peril.
+ */
+struct dlci_conf {
+   short flags;
+   short CIR_fwd;
+   short Bc_fwd;
+   short Be_fwd;
+   short CIR_bwd;
+   short Bc_bwd;
+   short Be_bwd; 
+
+/* these are part of the status read */
+   short Tc_fwd;
+   short Tc_bwd;
+   short Tf_max;
+   short Tb_max;
+
+/* add any new fields here above is a mirror of sdla_dlci_conf */
+};
+
+#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
+
+/* configuration flags for DLCI */
+#define DLCI_IGNORE_CIR_OUT    0x0001
+#define DLCI_ACCOUNT_CIR_IN    0x0002
+#define DLCI_BUFFER_IF         0x0008
+
+#define DLCI_VALID_FLAGS       0x000B
+
+/* defines for the actual Frame Relay hardware */
+#define FRAD_GET_CONF  (SIOCDEVPRIVATE)
+#define FRAD_SET_CONF  (SIOCDEVPRIVATE + 1)
+
+#define FRAD_LAST_IOCTL        FRAD_SET_CONF
+
+/*
+ * Based on the setup for the Sangoma SDLA.  If changes are 
+ * necessary to this structure, a routine will need to be 
+ * added to that module to copy fields.
+ */
+struct frad_conf 
+{
+   short station;
+   short flags;
+   short kbaud;
+   short clocking;
+   short mtu;
+   short T391;
+   short T392;
+   short N391;
+   short N392;
+   short N393;
+   short CIR_fwd;
+   short Bc_fwd;
+   short Be_fwd;
+   short CIR_bwd;
+   short Bc_bwd;
+   short Be_bwd;
+
+/* Add new fields here, above is a mirror of the sdla_conf */
+
+};
+
+#define FRAD_STATION_CPE       0x0000
+#define FRAD_STATION_NODE      0x0001
+
+#define FRAD_TX_IGNORE_CIR     0x0001
+#define FRAD_RX_ACCOUNT_CIR    0x0002
+#define FRAD_DROP_ABORTED      0x0004
+#define FRAD_BUFFERIF          0x0008
+#define FRAD_STATS             0x0010
+#define FRAD_MCI               0x0100
+#define FRAD_AUTODLCI          0x8000
+#define FRAD_VALID_FLAGS       0x811F
+
+#define FRAD_CLOCK_INT         0x0001
+#define FRAD_CLOCK_EXT         0x0000
+
+
+#endif /* _UAPI_FRAD_H_ */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
new file mode 100644 (file)
index 0000000..5c80cb1
--- /dev/null
@@ -0,0 +1,429 @@
+#ifndef _UAPI_LINUX_IF_LINK_H
+#define _UAPI_LINUX_IF_LINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+
+/* This struct should be in sync with struct rtnl_link_stats64 */
+struct rtnl_link_stats {
+       __u32   rx_packets;             /* total packets received       */
+       __u32   tx_packets;             /* total packets transmitted    */
+       __u32   rx_bytes;               /* total bytes received         */
+       __u32   tx_bytes;               /* total bytes transmitted      */
+       __u32   rx_errors;              /* bad packets received         */
+       __u32   tx_errors;              /* packet transmit problems     */
+       __u32   rx_dropped;             /* no space in linux buffers    */
+       __u32   tx_dropped;             /* no space available in linux  */
+       __u32   multicast;              /* multicast packets received   */
+       __u32   collisions;
+
+       /* detailed rx_errors: */
+       __u32   rx_length_errors;
+       __u32   rx_over_errors;         /* receiver ring buff overflow  */
+       __u32   rx_crc_errors;          /* recved pkt with crc error    */
+       __u32   rx_frame_errors;        /* recv'd frame alignment error */
+       __u32   rx_fifo_errors;         /* recv'r fifo overrun          */
+       __u32   rx_missed_errors;       /* receiver missed packet       */
+
+       /* detailed tx_errors */
+       __u32   tx_aborted_errors;
+       __u32   tx_carrier_errors;
+       __u32   tx_fifo_errors;
+       __u32   tx_heartbeat_errors;
+       __u32   tx_window_errors;
+
+       /* for cslip etc */
+       __u32   rx_compressed;
+       __u32   tx_compressed;
+};
+
+/* The main device statistics structure */
+struct rtnl_link_stats64 {
+       __u64   rx_packets;             /* total packets received       */
+       __u64   tx_packets;             /* total packets transmitted    */
+       __u64   rx_bytes;               /* total bytes received         */
+       __u64   tx_bytes;               /* total bytes transmitted      */
+       __u64   rx_errors;              /* bad packets received         */
+       __u64   tx_errors;              /* packet transmit problems     */
+       __u64   rx_dropped;             /* no space in linux buffers    */
+       __u64   tx_dropped;             /* no space available in linux  */
+       __u64   multicast;              /* multicast packets received   */
+       __u64   collisions;
+
+       /* detailed rx_errors: */
+       __u64   rx_length_errors;
+       __u64   rx_over_errors;         /* receiver ring buff overflow  */
+       __u64   rx_crc_errors;          /* recved pkt with crc error    */
+       __u64   rx_frame_errors;        /* recv'd frame alignment error */
+       __u64   rx_fifo_errors;         /* recv'r fifo overrun          */
+       __u64   rx_missed_errors;       /* receiver missed packet       */
+
+       /* detailed tx_errors */
+       __u64   tx_aborted_errors;
+       __u64   tx_carrier_errors;
+       __u64   tx_fifo_errors;
+       __u64   tx_heartbeat_errors;
+       __u64   tx_window_errors;
+
+       /* for cslip etc */
+       __u64   rx_compressed;
+       __u64   tx_compressed;
+};
+
+/* The struct should be in sync with struct ifmap */
+struct rtnl_link_ifmap {
+       __u64   mem_start;
+       __u64   mem_end;
+       __u64   base_addr;
+       __u16   irq;
+       __u8    dma;
+       __u8    port;
+};
+
+/*
+ * IFLA_AF_SPEC
+ *   Contains nested attributes for address family specific attributes.
+ *   Each address family may create a attribute with the address family
+ *   number as type and create its own attribute structure in it.
+ *
+ *   Example:
+ *   [IFLA_AF_SPEC] = {
+ *       [AF_INET] = {
+ *           [IFLA_INET_CONF] = ...,
+ *       },
+ *       [AF_INET6] = {
+ *           [IFLA_INET6_FLAGS] = ...,
+ *           [IFLA_INET6_CONF] = ...,
+ *       }
+ *   }
+ */
+
+enum {
+       IFLA_UNSPEC,
+       IFLA_ADDRESS,
+       IFLA_BROADCAST,
+       IFLA_IFNAME,
+       IFLA_MTU,
+       IFLA_LINK,
+       IFLA_QDISC,
+       IFLA_STATS,
+       IFLA_COST,
+#define IFLA_COST IFLA_COST
+       IFLA_PRIORITY,
+#define IFLA_PRIORITY IFLA_PRIORITY
+       IFLA_MASTER,
+#define IFLA_MASTER IFLA_MASTER
+       IFLA_WIRELESS,          /* Wireless Extension event - see wireless.h */
+#define IFLA_WIRELESS IFLA_WIRELESS
+       IFLA_PROTINFO,          /* Protocol specific information for a link */
+#define IFLA_PROTINFO IFLA_PROTINFO
+       IFLA_TXQLEN,
+#define IFLA_TXQLEN IFLA_TXQLEN
+       IFLA_MAP,
+#define IFLA_MAP IFLA_MAP
+       IFLA_WEIGHT,
+#define IFLA_WEIGHT IFLA_WEIGHT
+       IFLA_OPERSTATE,
+       IFLA_LINKMODE,
+       IFLA_LINKINFO,
+#define IFLA_LINKINFO IFLA_LINKINFO
+       IFLA_NET_NS_PID,
+       IFLA_IFALIAS,
+       IFLA_NUM_VF,            /* Number of VFs if device is SR-IOV PF */
+       IFLA_VFINFO_LIST,
+       IFLA_STATS64,
+       IFLA_VF_PORTS,
+       IFLA_PORT_SELF,
+       IFLA_AF_SPEC,
+       IFLA_GROUP,             /* Group the device belongs to */
+       IFLA_NET_NS_FD,
+       IFLA_EXT_MASK,          /* Extended info mask, VFs, etc */
+       IFLA_PROMISCUITY,       /* Promiscuity count: > 0 means acts PROMISC */
+#define IFLA_PROMISCUITY IFLA_PROMISCUITY
+       IFLA_NUM_TX_QUEUES,
+       IFLA_NUM_RX_QUEUES,
+       __IFLA_MAX
+};
+
+
+#define IFLA_MAX (__IFLA_MAX - 1)
+
+/* backwards compatibility for userspace */
+#ifndef __KERNEL__
+#define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#endif
+
+enum {
+       IFLA_INET_UNSPEC,
+       IFLA_INET_CONF,
+       __IFLA_INET_MAX,
+};
+
+#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
+
+/* ifi_flags.
+
+   IFF_* flags.
+
+   The only change is:
+   IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
+   more not changeable by user. They describe link media
+   characteristics and set by device driver.
+
+   Comments:
+   - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
+   - If neither of these three flags are set;
+     the interface is NBMA.
+
+   - IFF_MULTICAST does not mean anything special:
+   multicasts can be used on all not-NBMA links.
+   IFF_MULTICAST means that this media uses special encapsulation
+   for multicast frames. Apparently, all IFF_POINTOPOINT and
+   IFF_BROADCAST devices are able to use multicasts too.
+ */
+
+/* IFLA_LINK.
+   For usual devices it is equal ifi_index.
+   If it is a "virtual interface" (f.e. tunnel), ifi_link
+   can point to real physical interface (f.e. for bandwidth calculations),
+   or maybe 0, what means, that real media is unknown (usual
+   for IPIP tunnels, when route to endpoint is allowed to change)
+ */
+
+/* Subtype attributes for IFLA_PROTINFO */
+enum {
+       IFLA_INET6_UNSPEC,
+       IFLA_INET6_FLAGS,       /* link flags                   */
+       IFLA_INET6_CONF,        /* sysctl parameters            */
+       IFLA_INET6_STATS,       /* statistics                   */
+       IFLA_INET6_MCAST,       /* MC things. What of them?     */
+       IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
+       IFLA_INET6_ICMP6STATS,  /* statistics (icmpv6)          */
+       __IFLA_INET6_MAX
+};
+
+#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
+
+struct ifla_cacheinfo {
+       __u32   max_reasm_len;
+       __u32   tstamp;         /* ipv6InterfaceTable updated timestamp */
+       __u32   reachable_time;
+       __u32   retrans_time;
+};
+
+enum {
+       IFLA_INFO_UNSPEC,
+       IFLA_INFO_KIND,
+       IFLA_INFO_DATA,
+       IFLA_INFO_XSTATS,
+       __IFLA_INFO_MAX,
+};
+
+#define IFLA_INFO_MAX  (__IFLA_INFO_MAX - 1)
+
+/* VLAN section */
+
+enum {
+       IFLA_VLAN_UNSPEC,
+       IFLA_VLAN_ID,
+       IFLA_VLAN_FLAGS,
+       IFLA_VLAN_EGRESS_QOS,
+       IFLA_VLAN_INGRESS_QOS,
+       __IFLA_VLAN_MAX,
+};
+
+#define IFLA_VLAN_MAX  (__IFLA_VLAN_MAX - 1)
+
+struct ifla_vlan_flags {
+       __u32   flags;
+       __u32   mask;
+};
+
+enum {
+       IFLA_VLAN_QOS_UNSPEC,
+       IFLA_VLAN_QOS_MAPPING,
+       __IFLA_VLAN_QOS_MAX
+};
+
+#define IFLA_VLAN_QOS_MAX      (__IFLA_VLAN_QOS_MAX - 1)
+
+struct ifla_vlan_qos_mapping {
+       __u32 from;
+       __u32 to;
+};
+
+/* MACVLAN section */
+enum {
+       IFLA_MACVLAN_UNSPEC,
+       IFLA_MACVLAN_MODE,
+       IFLA_MACVLAN_FLAGS,
+       __IFLA_MACVLAN_MAX,
+};
+
+#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
+
+enum macvlan_mode {
+       MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
+       MACVLAN_MODE_VEPA    = 2, /* talk to other ports through ext bridge */
+       MACVLAN_MODE_BRIDGE  = 4, /* talk to bridge ports directly */
+       MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
+};
+
+#define MACVLAN_FLAG_NOPROMISC 1
+
+/* VXLAN section */
+enum {
+       IFLA_VXLAN_UNSPEC,
+       IFLA_VXLAN_ID,
+       IFLA_VXLAN_GROUP,
+       IFLA_VXLAN_LINK,
+       IFLA_VXLAN_LOCAL,
+       IFLA_VXLAN_TTL,
+       IFLA_VXLAN_TOS,
+       IFLA_VXLAN_LEARNING,
+       IFLA_VXLAN_AGEING,
+       IFLA_VXLAN_LIMIT,
+       IFLA_VXLAN_PORT_RANGE,
+       __IFLA_VXLAN_MAX
+};
+#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
+
+struct ifla_vxlan_port_range {
+       __be16  low;
+       __be16  high;
+};
+
+/* SR-IOV virtual function management section */
+
+enum {
+       IFLA_VF_INFO_UNSPEC,
+       IFLA_VF_INFO,
+       __IFLA_VF_INFO_MAX,
+};
+
+#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
+
+enum {
+       IFLA_VF_UNSPEC,
+       IFLA_VF_MAC,            /* Hardware queue specific attributes */
+       IFLA_VF_VLAN,
+       IFLA_VF_TX_RATE,        /* TX Bandwidth Allocation */
+       IFLA_VF_SPOOFCHK,       /* Spoof Checking on/off switch */
+       __IFLA_VF_MAX,
+};
+
+#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
+
+struct ifla_vf_mac {
+       __u32 vf;
+       __u8 mac[32]; /* MAX_ADDR_LEN */
+};
+
+struct ifla_vf_vlan {
+       __u32 vf;
+       __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
+       __u32 qos;
+};
+
+struct ifla_vf_tx_rate {
+       __u32 vf;
+       __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
+};
+
+struct ifla_vf_spoofchk {
+       __u32 vf;
+       __u32 setting;
+};
+
+/* VF ports management section
+ *
+ *     Nested layout of set/get msg is:
+ *
+ *             [IFLA_NUM_VF]
+ *             [IFLA_VF_PORTS]
+ *                     [IFLA_VF_PORT]
+ *                             [IFLA_PORT_*], ...
+ *                     [IFLA_VF_PORT]
+ *                             [IFLA_PORT_*], ...
+ *                     ...
+ *             [IFLA_PORT_SELF]
+ *                     [IFLA_PORT_*], ...
+ */
+
+enum {
+       IFLA_VF_PORT_UNSPEC,
+       IFLA_VF_PORT,                   /* nest */
+       __IFLA_VF_PORT_MAX,
+};
+
+#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
+
+enum {
+       IFLA_PORT_UNSPEC,
+       IFLA_PORT_VF,                   /* __u32 */
+       IFLA_PORT_PROFILE,              /* string */
+       IFLA_PORT_VSI_TYPE,             /* 802.1Qbg (pre-)standard VDP */
+       IFLA_PORT_INSTANCE_UUID,        /* binary UUID */
+       IFLA_PORT_HOST_UUID,            /* binary UUID */
+       IFLA_PORT_REQUEST,              /* __u8 */
+       IFLA_PORT_RESPONSE,             /* __u16, output only */
+       __IFLA_PORT_MAX,
+};
+
+#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
+
+#define PORT_PROFILE_MAX       40
+#define PORT_UUID_MAX          16
+#define PORT_SELF_VF           -1
+
+enum {
+       PORT_REQUEST_PREASSOCIATE = 0,
+       PORT_REQUEST_PREASSOCIATE_RR,
+       PORT_REQUEST_ASSOCIATE,
+       PORT_REQUEST_DISASSOCIATE,
+};
+
+enum {
+       PORT_VDP_RESPONSE_SUCCESS = 0,
+       PORT_VDP_RESPONSE_INVALID_FORMAT,
+       PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
+       PORT_VDP_RESPONSE_UNUSED_VTID,
+       PORT_VDP_RESPONSE_VTID_VIOLATION,
+       PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
+       PORT_VDP_RESPONSE_OUT_OF_SYNC,
+       /* 0x08-0xFF reserved for future VDP use */
+       PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
+       PORT_PROFILE_RESPONSE_INPROGRESS,
+       PORT_PROFILE_RESPONSE_INVALID,
+       PORT_PROFILE_RESPONSE_BADSTATE,
+       PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
+       PORT_PROFILE_RESPONSE_ERROR,
+};
+
+struct ifla_port_vsi {
+       __u8 vsi_mgr_id;
+       __u8 vsi_type_id[3];
+       __u8 vsi_type_version;
+       __u8 pad[3];
+};
+
+
+/* IPoIB section */
+
+enum {
+       IFLA_IPOIB_UNSPEC,
+       IFLA_IPOIB_PKEY,
+       IFLA_IPOIB_MODE,
+       IFLA_IPOIB_UMCAST,
+       __IFLA_IPOIB_MAX
+};
+
+enum {
+       IPOIB_MODE_DATAGRAM  = 0, /* using unreliable datagram QPs */
+       IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
+};
+
+#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
+
+#endif /* _UAPI_LINUX_IF_LINK_H */
diff --git a/include/uapi/linux/if_ltalk.h b/include/uapi/linux/if_ltalk.h
new file mode 100644 (file)
index 0000000..b92c1fb
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _UAPI__LINUX_LTALK_H
+#define _UAPI__LINUX_LTALK_H
+
+#define LTALK_HLEN             1
+#define LTALK_MTU              600
+#define LTALK_ALEN             1
+
+
+#endif /* _UAPI__LINUX_LTALK_H */
diff --git a/include/uapi/linux/if_phonet.h b/include/uapi/linux/if_phonet.h
new file mode 100644 (file)
index 0000000..f7ad9e2
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * File: if_phonet.h
+ *
+ * Phonet interface kernel definitions
+ *
+ * Copyright (C) 2008 Nokia Corporation. All rights reserved.
+ */
+#ifndef _UAPILINUX_IF_PHONET_H
+#define _UAPILINUX_IF_PHONET_H
+
+#define PHONET_MIN_MTU         6       /* pn_length = 0 */
+#define PHONET_MAX_MTU         65541   /* pn_length = 0xffff */
+#define PHONET_DEV_MTU         PHONET_MAX_MTU
+
+
+#endif /* _UAPILINUX_IF_PHONET_H */
diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
new file mode 100644 (file)
index 0000000..163e8ad
--- /dev/null
@@ -0,0 +1,104 @@
+/***************************************************************************
+ * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
+ *
+ * This file supplies definitions required by the PPP over L2TP driver
+ * (l2tp_ppp.c).  All version information wrt this file is located in l2tp_ppp.c
+ *
+ * License:
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _UAPI__LINUX_IF_PPPOL2TP_H
+#define _UAPI__LINUX_IF_PPPOL2TP_H
+
+#include <linux/types.h>
+
+
+/* Structure used to connect() the socket to a particular tunnel UDP
+ * socket over IPv4.
+ */
+struct pppol2tp_addr {
+       __kernel_pid_t  pid;            /* pid that owns the fd.
+                                        * 0 => current */
+       int     fd;                     /* FD of UDP socket to use */
+
+       struct sockaddr_in addr;        /* IP address and port to send to */
+
+       __u16 s_tunnel, s_session;      /* For matching incoming packets */
+       __u16 d_tunnel, d_session;      /* For sending outgoing packets */
+};
+
+/* Structure used to connect() the socket to a particular tunnel UDP
+ * socket over IPv6.
+ */
+struct pppol2tpin6_addr {
+       __kernel_pid_t  pid;            /* pid that owns the fd.
+                                        * 0 => current */
+       int     fd;                     /* FD of UDP socket to use */
+
+       __u16 s_tunnel, s_session;      /* For matching incoming packets */
+       __u16 d_tunnel, d_session;      /* For sending outgoing packets */
+
+       struct sockaddr_in6 addr;       /* IP address and port to send to */
+};
+
+/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
+ * bits. So we need a different sockaddr structure.
+ */
+struct pppol2tpv3_addr {
+       __kernel_pid_t  pid;            /* pid that owns the fd.
+                                        * 0 => current */
+       int     fd;                     /* FD of UDP or IP socket to use */
+
+       struct sockaddr_in addr;        /* IP address and port to send to */
+
+       __u32 s_tunnel, s_session;      /* For matching incoming packets */
+       __u32 d_tunnel, d_session;      /* For sending outgoing packets */
+};
+
+struct pppol2tpv3in6_addr {
+       __kernel_pid_t  pid;            /* pid that owns the fd.
+                                        * 0 => current */
+       int     fd;                     /* FD of UDP or IP socket to use */
+
+       __u32 s_tunnel, s_session;      /* For matching incoming packets */
+       __u32 d_tunnel, d_session;      /* For sending outgoing packets */
+
+       struct sockaddr_in6 addr;       /* IP address and port to send to */
+};
+
+/* Socket options:
+ * DEBUG       - bitmask of debug message categories
+ * SENDSEQ     - 0 => don't send packets with sequence numbers
+ *               1 => send packets with sequence numbers
+ * RECVSEQ     - 0 => receive packet sequence numbers are optional
+ *               1 => drop receive packets without sequence numbers
+ * LNSMODE     - 0 => act as LAC.
+ *               1 => act as LNS.
+ * REORDERTO   - reorder timeout (in millisecs). If 0, don't try to reorder.
+ */
+enum {
+       PPPOL2TP_SO_DEBUG       = 1,
+       PPPOL2TP_SO_RECVSEQ     = 2,
+       PPPOL2TP_SO_SENDSEQ     = 3,
+       PPPOL2TP_SO_LNSMODE     = 4,
+       PPPOL2TP_SO_REORDERTO   = 5,
+};
+
+/* Debug message categories for the DEBUG socket option */
+enum {
+       PPPOL2TP_MSG_DEBUG      = (1 << 0),     /* verbose debug (if
+                                                * compiled in) */
+       PPPOL2TP_MSG_CONTROL    = (1 << 1),     /* userspace - kernel
+                                                * interface */
+       PPPOL2TP_MSG_SEQ        = (1 << 2),     /* sequence numbers */
+       PPPOL2TP_MSG_DATA       = (1 << 3),     /* data packets */
+};
+
+
+
+#endif /* _UAPI__LINUX_IF_PPPOL2TP_H */
diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
new file mode 100644 (file)
index 0000000..0b46fd5
--- /dev/null
@@ -0,0 +1,156 @@
+/***************************************************************************
+ * Linux PPP over X - Generic PPP transport layer sockets
+ * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) 
+ *
+ * This file supplies definitions required by the PPP over Ethernet driver
+ * (pppox.c).  All version information wrt this file is located in pppox.c
+ *
+ * License:
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _UAPI__LINUX_IF_PPPOX_H
+#define _UAPI__LINUX_IF_PPPOX_H
+
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#include <linux/socket.h>
+#include <linux/if_ether.h>
+#include <linux/if_pppol2tp.h>
+
+/* For user-space programs to pick up these definitions
+ * which they wouldn't get otherwise without defining __KERNEL__
+ */
+#ifndef AF_PPPOX
+#define AF_PPPOX       24
+#define PF_PPPOX       AF_PPPOX
+#endif /* !(AF_PPPOX) */
+
+/************************************************************************ 
+ * PPPoE addressing definition 
+ */ 
+typedef __be16 sid_t;
+struct pppoe_addr {
+       sid_t         sid;                    /* Session identifier */
+       unsigned char remote[ETH_ALEN];       /* Remote address */
+       char          dev[IFNAMSIZ];          /* Local device to use */
+}; 
+/************************************************************************ 
+ * PPTP addressing definition
+ */
+struct pptp_addr {
+       __be16          call_id;
+       struct in_addr  sin_addr;
+};
+
+/************************************************************************
+ * Protocols supported by AF_PPPOX
+ */
+#define PX_PROTO_OE    0 /* Currently just PPPoE */
+#define PX_PROTO_OL2TP 1 /* Now L2TP also */
+#define PX_PROTO_PPTP  2
+#define PX_MAX_PROTO   3
+
+struct sockaddr_pppox {
+       __kernel_sa_family_t sa_family;       /* address family, AF_PPPOX */
+       unsigned int    sa_protocol;          /* protocol identifier */
+       union {
+               struct pppoe_addr  pppoe;
+               struct pptp_addr   pptp;
+       } sa_addr;
+} __packed;
+
+/* The use of the above union isn't viable because the size of this
+ * struct must stay fixed over time -- applications use sizeof(struct
+ * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
+ * type instead.
+ */
+struct sockaddr_pppol2tp {
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+       unsigned int    sa_protocol;    /* protocol identifier */
+       struct pppol2tp_addr pppol2tp;
+} __packed;
+
+struct sockaddr_pppol2tpin6 {
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+       unsigned int    sa_protocol;    /* protocol identifier */
+       struct pppol2tpin6_addr pppol2tp;
+} __packed;
+
+/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
+ * bits. So we need a different sockaddr structure.
+ */
+struct sockaddr_pppol2tpv3 {
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+       unsigned int    sa_protocol;    /* protocol identifier */
+       struct pppol2tpv3_addr pppol2tp;
+} __packed;
+
+struct sockaddr_pppol2tpv3in6 {
+       __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
+       unsigned int    sa_protocol;    /* protocol identifier */
+       struct pppol2tpv3in6_addr pppol2tp;
+} __packed;
+
+/*********************************************************************
+ *
+ * ioctl interface for defining forwarding of connections
+ *
+ ********************************************************************/
+
+#define PPPOEIOCSFWD   _IOW(0xB1 ,0, size_t)
+#define PPPOEIOCDFWD   _IO(0xB1 ,1)
+/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
+
+/* Codes to identify message types */
+#define PADI_CODE      0x09
+#define PADO_CODE      0x07
+#define PADR_CODE      0x19
+#define PADS_CODE      0x65
+#define PADT_CODE      0xa7
+struct pppoe_tag {
+       __be16 tag_type;
+       __be16 tag_len;
+       char tag_data[0];
+} __attribute__ ((packed));
+
+/* Tag identifiers */
+#define PTT_EOL                __cpu_to_be16(0x0000)
+#define PTT_SRV_NAME   __cpu_to_be16(0x0101)
+#define PTT_AC_NAME    __cpu_to_be16(0x0102)
+#define PTT_HOST_UNIQ  __cpu_to_be16(0x0103)
+#define PTT_AC_COOKIE  __cpu_to_be16(0x0104)
+#define PTT_VENDOR     __cpu_to_be16(0x0105)
+#define PTT_RELAY_SID  __cpu_to_be16(0x0110)
+#define PTT_SRV_ERR     __cpu_to_be16(0x0201)
+#define PTT_SYS_ERR    __cpu_to_be16(0x0202)
+#define PTT_GEN_ERR    __cpu_to_be16(0x0203)
+
+struct pppoe_hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 ver : 4;
+       __u8 type : 4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u8 type : 4;
+       __u8 ver : 4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+       __u8 code;
+       __be16 sid;
+       __be16 length;
+       struct pppoe_tag tag[0];
+} __packed;
+
+/* Length of entire PPPoE + PPP header */
+#define PPPOE_SES_HLEN 8
+
+
+#endif /* _UAPI__LINUX_IF_PPPOX_H */
diff --git a/include/uapi/linux/if_team.h b/include/uapi/linux/if_team.h
new file mode 100644 (file)
index 0000000..7b8fa33
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * include/linux/if_team.h - Network team device driver header
+ * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IF_TEAM_H_
+#define _UAPI_LINUX_IF_TEAM_H_
+
+
+#define TEAM_STRING_MAX_LEN 32
+
+/**********************************
+ * NETLINK_GENERIC netlink family.
+ **********************************/
+
+enum {
+       TEAM_CMD_NOOP,
+       TEAM_CMD_OPTIONS_SET,
+       TEAM_CMD_OPTIONS_GET,
+       TEAM_CMD_PORT_LIST_GET,
+
+       __TEAM_CMD_MAX,
+       TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
+};
+
+enum {
+       TEAM_ATTR_UNSPEC,
+       TEAM_ATTR_TEAM_IFINDEX,         /* u32 */
+       TEAM_ATTR_LIST_OPTION,          /* nest */
+       TEAM_ATTR_LIST_PORT,            /* nest */
+
+       __TEAM_ATTR_MAX,
+       TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
+};
+
+/* Nested layout of get/set msg:
+ *
+ *     [TEAM_ATTR_LIST_OPTION]
+ *             [TEAM_ATTR_ITEM_OPTION]
+ *                     [TEAM_ATTR_OPTION_*], ...
+ *             [TEAM_ATTR_ITEM_OPTION]
+ *                     [TEAM_ATTR_OPTION_*], ...
+ *             ...
+ *     [TEAM_ATTR_LIST_PORT]
+ *             [TEAM_ATTR_ITEM_PORT]
+ *                     [TEAM_ATTR_PORT_*], ...
+ *             [TEAM_ATTR_ITEM_PORT]
+ *                     [TEAM_ATTR_PORT_*], ...
+ *             ...
+ */
+
+enum {
+       TEAM_ATTR_ITEM_OPTION_UNSPEC,
+       TEAM_ATTR_ITEM_OPTION,          /* nest */
+
+       __TEAM_ATTR_ITEM_OPTION_MAX,
+       TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
+};
+
+enum {
+       TEAM_ATTR_OPTION_UNSPEC,
+       TEAM_ATTR_OPTION_NAME,          /* string */
+       TEAM_ATTR_OPTION_CHANGED,       /* flag */
+       TEAM_ATTR_OPTION_TYPE,          /* u8 */
+       TEAM_ATTR_OPTION_DATA,          /* dynamic */
+       TEAM_ATTR_OPTION_REMOVED,       /* flag */
+       TEAM_ATTR_OPTION_PORT_IFINDEX,  /* u32 */ /* for per-port options */
+       TEAM_ATTR_OPTION_ARRAY_INDEX,   /* u32 */ /* for array options */
+
+       __TEAM_ATTR_OPTION_MAX,
+       TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
+};
+
+enum {
+       TEAM_ATTR_ITEM_PORT_UNSPEC,
+       TEAM_ATTR_ITEM_PORT,            /* nest */
+
+       __TEAM_ATTR_ITEM_PORT_MAX,
+       TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
+};
+
+enum {
+       TEAM_ATTR_PORT_UNSPEC,
+       TEAM_ATTR_PORT_IFINDEX,         /* u32 */
+       TEAM_ATTR_PORT_CHANGED,         /* flag */
+       TEAM_ATTR_PORT_LINKUP,          /* flag */
+       TEAM_ATTR_PORT_SPEED,           /* u32 */
+       TEAM_ATTR_PORT_DUPLEX,          /* u8 */
+       TEAM_ATTR_PORT_REMOVED,         /* flag */
+
+       __TEAM_ATTR_PORT_MAX,
+       TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
+};
+
+/*
+ * NETLINK_GENERIC related info
+ */
+#define TEAM_GENL_NAME "team"
+#define TEAM_GENL_VERSION 0x1
+#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
+
+#endif /* _UAPI_LINUX_IF_TEAM_H_ */
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
new file mode 100644 (file)
index 0000000..25a585c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ *  Universal TUN/TAP device driver.
+ *  Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ */
+
+#ifndef _UAPI__IF_TUN_H
+#define _UAPI__IF_TUN_H
+
+#include <linux/types.h>
+#include <linux/if_ether.h>
+#include <linux/filter.h>
+
+/* Read queue size */
+#define TUN_READQ_SIZE 500
+
+/* TUN device flags */
+#define TUN_TUN_DEV    0x0001  
+#define TUN_TAP_DEV    0x0002
+#define TUN_TYPE_MASK   0x000f
+
+#define TUN_FASYNC     0x0010
+#define TUN_NOCHECKSUM 0x0020
+#define TUN_NO_PI      0x0040
+#define TUN_ONE_QUEUE  0x0080
+#define TUN_PERSIST    0x0100  
+#define TUN_VNET_HDR   0x0200
+
+/* Ioctl defines */
+#define TUNSETNOCSUM  _IOW('T', 200, int) 
+#define TUNSETDEBUG   _IOW('T', 201, int) 
+#define TUNSETIFF     _IOW('T', 202, int) 
+#define TUNSETPERSIST _IOW('T', 203, int) 
+#define TUNSETOWNER   _IOW('T', 204, int)
+#define TUNSETLINK    _IOW('T', 205, int)
+#define TUNSETGROUP   _IOW('T', 206, int)
+#define TUNGETFEATURES _IOR('T', 207, unsigned int)
+#define TUNSETOFFLOAD  _IOW('T', 208, unsigned int)
+#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
+#define TUNGETIFF      _IOR('T', 210, unsigned int)
+#define TUNGETSNDBUF   _IOR('T', 211, int)
+#define TUNSETSNDBUF   _IOW('T', 212, int)
+#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
+#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
+#define TUNGETVNETHDRSZ _IOR('T', 215, int)
+#define TUNSETVNETHDRSZ _IOW('T', 216, int)
+
+/* TUNSETIFF ifr flags */
+#define IFF_TUN                0x0001
+#define IFF_TAP                0x0002
+#define IFF_NO_PI      0x1000
+#define IFF_ONE_QUEUE  0x2000
+#define IFF_VNET_HDR   0x4000
+#define IFF_TUN_EXCL   0x8000
+
+/* Features for GSO (TUNSETOFFLOAD). */
+#define TUN_F_CSUM     0x01    /* You can hand me unchecksummed packets. */
+#define TUN_F_TSO4     0x02    /* I can handle TSO for IPv4 packets */
+#define TUN_F_TSO6     0x04    /* I can handle TSO for IPv6 packets */
+#define TUN_F_TSO_ECN  0x08    /* I can handle TSO with ECN bits. */
+#define TUN_F_UFO      0x10    /* I can handle UFO packets */
+
+/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
+#define TUN_PKT_STRIP  0x0001
+struct tun_pi {
+       __u16  flags;
+       __be16 proto;
+};
+
+/*
+ * Filter spec (used for SETXXFILTER ioctls)
+ * This stuff is applicable only to the TAP (Ethernet) devices.
+ * If the count is zero the filter is disabled and the driver accepts
+ * all packets (promisc mode).
+ * If the filter is enabled in order to accept broadcast packets
+ * broadcast addr must be explicitly included in the addr list.
+ */
+#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
+struct tun_filter {
+       __u16  flags; /* TUN_FLT_ flags see above */
+       __u16  count; /* Number of addresses */
+       __u8   addr[0][ETH_ALEN];
+};
+
+#endif /* _UAPI__IF_TUN_H */
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
new file mode 100644 (file)
index 0000000..5db5942
--- /dev/null
@@ -0,0 +1,96 @@
+#ifndef _UAPI_IF_TUNNEL_H_
+#define _UAPI_IF_TUNNEL_H_
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+
+#define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
+#define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
+#define SIOCDELTUNNEL   (SIOCDEVPRIVATE + 2)
+#define SIOCCHGTUNNEL   (SIOCDEVPRIVATE + 3)
+#define SIOCGETPRL      (SIOCDEVPRIVATE + 4)
+#define SIOCADDPRL      (SIOCDEVPRIVATE + 5)
+#define SIOCDELPRL      (SIOCDEVPRIVATE + 6)
+#define SIOCCHGPRL      (SIOCDEVPRIVATE + 7)
+#define SIOCGET6RD      (SIOCDEVPRIVATE + 8)
+#define SIOCADD6RD      (SIOCDEVPRIVATE + 9)
+#define SIOCDEL6RD      (SIOCDEVPRIVATE + 10)
+#define SIOCCHG6RD      (SIOCDEVPRIVATE + 11)
+
+#define GRE_CSUM       __cpu_to_be16(0x8000)
+#define GRE_ROUTING    __cpu_to_be16(0x4000)
+#define GRE_KEY                __cpu_to_be16(0x2000)
+#define GRE_SEQ                __cpu_to_be16(0x1000)
+#define GRE_STRICT     __cpu_to_be16(0x0800)
+#define GRE_REC                __cpu_to_be16(0x0700)
+#define GRE_FLAGS      __cpu_to_be16(0x00F8)
+#define GRE_VERSION    __cpu_to_be16(0x0007)
+
+struct ip_tunnel_parm {
+       char                    name[IFNAMSIZ];
+       int                     link;
+       __be16                  i_flags;
+       __be16                  o_flags;
+       __be32                  i_key;
+       __be32                  o_key;
+       struct iphdr            iph;
+};
+
+/* SIT-mode i_flags */
+#define        SIT_ISATAP      0x0001
+
+struct ip_tunnel_prl {
+       __be32                  addr;
+       __u16                   flags;
+       __u16                   __reserved;
+       __u32                   datalen;
+       __u32                   __reserved2;
+       /* data follows */
+};
+
+/* PRL flags */
+#define        PRL_DEFAULT             0x0001
+
+struct ip_tunnel_6rd {
+       struct in6_addr         prefix;
+       __be32                  relay_prefix;
+       __u16                   prefixlen;
+       __u16                   relay_prefixlen;
+};
+
+enum {
+       IFLA_GRE_UNSPEC,
+       IFLA_GRE_LINK,
+       IFLA_GRE_IFLAGS,
+       IFLA_GRE_OFLAGS,
+       IFLA_GRE_IKEY,
+       IFLA_GRE_OKEY,
+       IFLA_GRE_LOCAL,
+       IFLA_GRE_REMOTE,
+       IFLA_GRE_TTL,
+       IFLA_GRE_TOS,
+       IFLA_GRE_PMTUDISC,
+       IFLA_GRE_ENCAP_LIMIT,
+       IFLA_GRE_FLOWINFO,
+       IFLA_GRE_FLAGS,
+       __IFLA_GRE_MAX,
+};
+
+#define IFLA_GRE_MAX   (__IFLA_GRE_MAX - 1)
+
+/* VTI-mode i_flags */
+#define VTI_ISVTI 0x0001
+
+enum {
+       IFLA_VTI_UNSPEC,
+       IFLA_VTI_LINK,
+       IFLA_VTI_IKEY,
+       IFLA_VTI_OKEY,
+       IFLA_VTI_LOCAL,
+       IFLA_VTI_REMOTE,
+       __IFLA_VTI_MAX,
+};
+
+#define IFLA_VTI_MAX   (__IFLA_VTI_MAX - 1)
+#endif /* _UAPI_IF_TUNNEL_H_ */
diff --git a/include/uapi/linux/if_vlan.h b/include/uapi/linux/if_vlan.h
new file mode 100644 (file)
index 0000000..0744f8e
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * VLAN                An implementation of 802.1Q VLAN tagging.
+ *
+ * Authors:    Ben Greear <greearb@candelatech.com>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _UAPI_LINUX_IF_VLAN_H_
+#define _UAPI_LINUX_IF_VLAN_H_
+
+
+/* VLAN IOCTLs are found in sockios.h */
+
+/* Passed in vlan_ioctl_args structure to determine behaviour. */
+enum vlan_ioctl_cmds {
+       ADD_VLAN_CMD,
+       DEL_VLAN_CMD,
+       SET_VLAN_INGRESS_PRIORITY_CMD,
+       SET_VLAN_EGRESS_PRIORITY_CMD,
+       GET_VLAN_INGRESS_PRIORITY_CMD,
+       GET_VLAN_EGRESS_PRIORITY_CMD,
+       SET_VLAN_NAME_TYPE_CMD,
+       SET_VLAN_FLAG_CMD,
+       GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
+       GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
+};
+
+enum vlan_flags {
+       VLAN_FLAG_REORDER_HDR   = 0x1,
+       VLAN_FLAG_GVRP          = 0x2,
+       VLAN_FLAG_LOOSE_BINDING = 0x4,
+};
+
+enum vlan_name_types {
+       VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
+       VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
+       VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
+       VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
+       VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+       int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
+       char device1[24];
+
+        union {
+               char device2[24];
+               int VID;
+               unsigned int skb_priority;
+               unsigned int name_type;
+               unsigned int bind_type;
+               unsigned int flag; /* Matches vlan_dev_priv flags */
+        } u;
+
+       short vlan_qos;   
+};
+
+#endif /* _UAPI_LINUX_IF_VLAN_H_ */
diff --git a/include/uapi/linux/igmp.h b/include/uapi/linux/igmp.h
new file mode 100644 (file)
index 0000000..ccbb32a
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ *     Linux NET3:     Internet Group Management Protocol  [IGMP]
+ *
+ *     Authors:
+ *             Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ *     Extended to talk the BSD extended IGMP protocol of mrouted 3.6
+ *
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     as published by the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IGMP_H
+#define _UAPI_LINUX_IGMP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/*
+ *     IGMP protocol structures
+ */
+
+/*
+ *     Header in on cable format
+ */
+
+struct igmphdr {
+       __u8 type;
+       __u8 code;              /* For newer IGMP */
+       __sum16 csum;
+       __be32 group;
+};
+
+/* V3 group record types [grec_type] */
+#define IGMPV3_MODE_IS_INCLUDE         1
+#define IGMPV3_MODE_IS_EXCLUDE         2
+#define IGMPV3_CHANGE_TO_INCLUDE       3
+#define IGMPV3_CHANGE_TO_EXCLUDE       4
+#define IGMPV3_ALLOW_NEW_SOURCES       5
+#define IGMPV3_BLOCK_OLD_SOURCES       6
+
+struct igmpv3_grec {
+       __u8    grec_type;
+       __u8    grec_auxwords;
+       __be16  grec_nsrcs;
+       __be32  grec_mca;
+       __be32  grec_src[0];
+};
+
+struct igmpv3_report {
+       __u8 type;
+       __u8 resv1;
+       __be16 csum;
+       __be16 resv2;
+       __be16 ngrec;
+       struct igmpv3_grec grec[0];
+};
+
+struct igmpv3_query {
+       __u8 type;
+       __u8 code;
+       __be16 csum;
+       __be32 group;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8 qrv:3,
+            suppress:1,
+            resv:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u8 resv:4,
+            suppress:1,
+            qrv:3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+       __u8 qqic;
+       __be16 nsrcs;
+       __be32 srcs[0];
+};
+
+#define IGMP_HOST_MEMBERSHIP_QUERY     0x11    /* From RFC1112 */
+#define IGMP_HOST_MEMBERSHIP_REPORT    0x12    /* Ditto */
+#define IGMP_DVMRP                     0x13    /* DVMRP routing */
+#define IGMP_PIM                       0x14    /* PIM routing */
+#define IGMP_TRACE                     0x15
+#define IGMPV2_HOST_MEMBERSHIP_REPORT  0x16    /* V2 version of 0x12 */
+#define IGMP_HOST_LEAVE_MESSAGE        0x17
+#define IGMPV3_HOST_MEMBERSHIP_REPORT  0x22    /* V3 version of 0x12 */
+
+#define IGMP_MTRACE_RESP               0x1e
+#define IGMP_MTRACE                    0x1f
+
+
+/*
+ *     Use the BSD names for these for compatibility
+ */
+
+#define IGMP_DELAYING_MEMBER           0x01
+#define IGMP_IDLE_MEMBER               0x02
+#define IGMP_LAZY_MEMBER               0x03
+#define IGMP_SLEEPING_MEMBER           0x04
+#define IGMP_AWAKENING_MEMBER          0x05
+
+#define IGMP_MINLEN                    8
+
+#define IGMP_MAX_HOST_REPORT_DELAY     10      /* max delay for response to */
+                                               /* query (in seconds)   */
+
+#define IGMP_TIMER_SCALE               10      /* denotes that the igmphdr->timer field */
+                                               /* specifies time in 10th of seconds     */
+
+#define IGMP_AGE_THRESHOLD             400     /* If this host don't hear any IGMP V1  */
+                                               /* message in this period of time,      */
+                                               /* revert to IGMP v2 router.            */
+
+#define IGMP_ALL_HOSTS         htonl(0xE0000001L)
+#define IGMP_ALL_ROUTER        htonl(0xE0000002L)
+#define IGMPV3_ALL_MCR         htonl(0xE0000016L)
+#define IGMP_LOCAL_GROUP       htonl(0xE0000000L)
+#define IGMP_LOCAL_GROUP_MASK  htonl(0xFFFFFF00L)
+
+/*
+ * struct for keeping the multicast list in
+ */
+
+#endif /* _UAPI_LINUX_IGMP_H */
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
new file mode 100644 (file)
index 0000000..9edb441
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions of the Internet Protocol.
+ *
+ * Version:    @(#)in.h        1.0.1   04/21/93
+ *
+ * Authors:    Original taken from the GNU Project <netinet/in.h> file.
+ *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_IN_H
+#define _UAPI_LINUX_IN_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* Standard well-defined IP protocols.  */
+enum {
+  IPPROTO_IP = 0,              /* Dummy protocol for TCP               */
+  IPPROTO_ICMP = 1,            /* Internet Control Message Protocol    */
+  IPPROTO_IGMP = 2,            /* Internet Group Management Protocol   */
+  IPPROTO_IPIP = 4,            /* IPIP tunnels (older KA9Q tunnels use 94) */
+  IPPROTO_TCP = 6,             /* Transmission Control Protocol        */
+  IPPROTO_EGP = 8,             /* Exterior Gateway Protocol            */
+  IPPROTO_PUP = 12,            /* PUP protocol                         */
+  IPPROTO_UDP = 17,            /* User Datagram Protocol               */
+  IPPROTO_IDP = 22,            /* XNS IDP protocol                     */
+  IPPROTO_DCCP = 33,           /* Datagram Congestion Control Protocol */
+  IPPROTO_RSVP = 46,           /* RSVP protocol                        */
+  IPPROTO_GRE = 47,            /* Cisco GRE tunnels (rfc 1701,1702)    */
+
+  IPPROTO_IPV6  = 41,          /* IPv6-in-IPv4 tunnelling              */
+
+  IPPROTO_ESP = 50,            /* Encapsulation Security Payload protocol */
+  IPPROTO_AH = 51,             /* Authentication Header protocol       */
+  IPPROTO_BEETPH = 94,        /* IP option pseudo header for BEET */
+  IPPROTO_PIM    = 103,                /* Protocol Independent Multicast       */
+
+  IPPROTO_COMP   = 108,                /* Compression Header protocol */
+  IPPROTO_SCTP   = 132,                /* Stream Control Transport Protocol    */
+  IPPROTO_UDPLITE = 136,       /* UDP-Lite (RFC 3828)                  */
+
+  IPPROTO_RAW   = 255,         /* Raw IP packets                       */
+  IPPROTO_MAX
+};
+
+
+/* Internet address. */
+struct in_addr {
+       __be32  s_addr;
+};
+
+#define IP_TOS         1
+#define IP_TTL         2
+#define IP_HDRINCL     3
+#define IP_OPTIONS     4
+#define IP_ROUTER_ALERT        5
+#define IP_RECVOPTS    6
+#define IP_RETOPTS     7
+#define IP_PKTINFO     8
+#define IP_PKTOPTIONS  9
+#define IP_MTU_DISCOVER        10
+#define IP_RECVERR     11
+#define IP_RECVTTL     12
+#define        IP_RECVTOS      13
+#define IP_MTU         14
+#define IP_FREEBIND    15
+#define IP_IPSEC_POLICY        16
+#define IP_XFRM_POLICY 17
+#define IP_PASSSEC     18
+#define IP_TRANSPARENT 19
+
+/* BSD compatibility */
+#define IP_RECVRETOPTS IP_RETOPTS
+
+/* TProxy original addresses */
+#define IP_ORIGDSTADDR       20
+#define IP_RECVORIGDSTADDR   IP_ORIGDSTADDR
+
+#define IP_MINTTL       21
+#define IP_NODEFRAG     22
+
+/* IP_MTU_DISCOVER values */
+#define IP_PMTUDISC_DONT               0       /* Never send DF frames */
+#define IP_PMTUDISC_WANT               1       /* Use per route hints  */
+#define IP_PMTUDISC_DO                 2       /* Always DF            */
+#define IP_PMTUDISC_PROBE              3       /* Ignore dst pmtu      */
+
+#define IP_MULTICAST_IF                        32
+#define IP_MULTICAST_TTL               33
+#define IP_MULTICAST_LOOP              34
+#define IP_ADD_MEMBERSHIP              35
+#define IP_DROP_MEMBERSHIP             36
+#define IP_UNBLOCK_SOURCE              37
+#define IP_BLOCK_SOURCE                        38
+#define IP_ADD_SOURCE_MEMBERSHIP       39
+#define IP_DROP_SOURCE_MEMBERSHIP      40
+#define IP_MSFILTER                    41
+#define MCAST_JOIN_GROUP               42
+#define MCAST_BLOCK_SOURCE             43
+#define MCAST_UNBLOCK_SOURCE           44
+#define MCAST_LEAVE_GROUP              45
+#define MCAST_JOIN_SOURCE_GROUP                46
+#define MCAST_LEAVE_SOURCE_GROUP       47
+#define MCAST_MSFILTER                 48
+#define IP_MULTICAST_ALL               49
+#define IP_UNICAST_IF                  50
+
+#define MCAST_EXCLUDE  0
+#define MCAST_INCLUDE  1
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL        1
+#define IP_DEFAULT_MULTICAST_LOOP       1
+
+/* Request struct for multicast socket ops */
+
+struct ip_mreq  {
+       struct in_addr imr_multiaddr;   /* IP multicast address of group */
+       struct in_addr imr_interface;   /* local IP address of interface */
+};
+
+struct ip_mreqn {
+       struct in_addr  imr_multiaddr;          /* IP multicast address of group */
+       struct in_addr  imr_address;            /* local IP address of interface */
+       int             imr_ifindex;            /* Interface index */
+};
+
+struct ip_mreq_source {
+       __be32          imr_multiaddr;
+       __be32          imr_interface;
+       __be32          imr_sourceaddr;
+};
+
+struct ip_msfilter {
+       __be32          imsf_multiaddr;
+       __be32          imsf_interface;
+       __u32           imsf_fmode;
+       __u32           imsf_numsrc;
+       __be32          imsf_slist[1];
+};
+
+#define IP_MSFILTER_SIZE(numsrc) \
+       (sizeof(struct ip_msfilter) - sizeof(__u32) \
+       + (numsrc) * sizeof(__u32))
+
+struct group_req {
+       __u32                            gr_interface;  /* interface index */
+       struct __kernel_sockaddr_storage gr_group;      /* group address */
+};
+
+struct group_source_req {
+       __u32                            gsr_interface; /* interface index */
+       struct __kernel_sockaddr_storage gsr_group;     /* group address */
+       struct __kernel_sockaddr_storage gsr_source;    /* source address */
+};
+
+struct group_filter {
+       __u32                            gf_interface;  /* interface index */
+       struct __kernel_sockaddr_storage gf_group;      /* multicast address */
+       __u32                            gf_fmode;      /* filter mode */
+       __u32                            gf_numsrc;     /* number of sources */
+       struct __kernel_sockaddr_storage gf_slist[1];   /* interface index */
+};
+
+#define GROUP_FILTER_SIZE(numsrc) \
+       (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
+       + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
+
+struct in_pktinfo {
+       int             ipi_ifindex;
+       struct in_addr  ipi_spec_dst;
+       struct in_addr  ipi_addr;
+};
+
+/* Structure describing an Internet (IP) socket address. */
+#define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
+struct sockaddr_in {
+  __kernel_sa_family_t sin_family;     /* Address family               */
+  __be16               sin_port;       /* Port number                  */
+  struct in_addr       sin_addr;       /* Internet address             */
+
+  /* Pad to size of `struct sockaddr'. */
+  unsigned char                __pad[__SOCK_SIZE__ - sizeof(short int) -
+                       sizeof(unsigned short int) - sizeof(struct in_addr)];
+};
+#define sin_zero       __pad           /* for BSD UNIX comp. -FvK      */
+
+
+/*
+ * Definitions of the bits in an Internet address integer.
+ * On subnets, host and network parts are found according
+ * to the subnet mask, not these masks.
+ */
+#define        IN_CLASSA(a)            ((((long int) (a)) & 0x80000000) == 0)
+#define        IN_CLASSA_NET           0xff000000
+#define        IN_CLASSA_NSHIFT        24
+#define        IN_CLASSA_HOST          (0xffffffff & ~IN_CLASSA_NET)
+#define        IN_CLASSA_MAX           128
+
+#define        IN_CLASSB(a)            ((((long int) (a)) & 0xc0000000) == 0x80000000)
+#define        IN_CLASSB_NET           0xffff0000
+#define        IN_CLASSB_NSHIFT        16
+#define        IN_CLASSB_HOST          (0xffffffff & ~IN_CLASSB_NET)
+#define        IN_CLASSB_MAX           65536
+
+#define        IN_CLASSC(a)            ((((long int) (a)) & 0xe0000000) == 0xc0000000)
+#define        IN_CLASSC_NET           0xffffff00
+#define        IN_CLASSC_NSHIFT        8
+#define        IN_CLASSC_HOST          (0xffffffff & ~IN_CLASSC_NET)
+
+#define        IN_CLASSD(a)            ((((long int) (a)) & 0xf0000000) == 0xe0000000)
+#define        IN_MULTICAST(a)         IN_CLASSD(a)
+#define IN_MULTICAST_NET       0xF0000000
+
+#define        IN_EXPERIMENTAL(a)      ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define        IN_BADCLASS(a)          IN_EXPERIMENTAL((a))
+
+/* Address to accept any incoming messages. */
+#define        INADDR_ANY              ((unsigned long int) 0x00000000)
+
+/* Address to send to all hosts. */
+#define        INADDR_BROADCAST        ((unsigned long int) 0xffffffff)
+
+/* Address indicating an error return. */
+#define        INADDR_NONE             ((unsigned long int) 0xffffffff)
+
+/* Network number for local host loopback. */
+#define        IN_LOOPBACKNET          127
+
+/* Address to loopback in software to local host.  */
+#define        INADDR_LOOPBACK         0x7f000001      /* 127.0.0.1   */
+#define        IN_LOOPBACK(a)          ((((long int) (a)) & 0xff000000) == 0x7f000000)
+
+/* Defines for Multicast INADDR */
+#define INADDR_UNSPEC_GROUP    0xe0000000U     /* 224.0.0.0   */
+#define INADDR_ALLHOSTS_GROUP  0xe0000001U     /* 224.0.0.1   */
+#define INADDR_ALLRTRS_GROUP    0xe0000002U    /* 224.0.0.2 */
+#define INADDR_MAX_LOCAL_GROUP  0xe00000ffU    /* 224.0.0.255 */
+
+
+/* <asm/byteorder.h> contains the htonl type stuff.. */
+#include <asm/byteorder.h> 
+
+
+#endif /* _UAPI_LINUX_IN_H */
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
new file mode 100644 (file)
index 0000000..1e31599
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ *     Types and definitions for AF_INET6 
+ *     Linux INET6 implementation 
+ *
+ *     Authors:
+ *     Pedro Roque             <roque@di.fc.ul.pt>     
+ *
+ *     Sources:
+ *     IPv6 Program Interfaces for BSD Systems
+ *      <draft-ietf-ipngwg-bsd-api-05.txt>
+ *
+ *     Advanced Sockets API for IPv6
+ *     <draft-stevens-advanced-api-00.txt>
+ *
+ *     This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IN6_H
+#define _UAPI_LINUX_IN6_H
+
+#include <linux/types.h>
+
+/*
+ *     IPv6 address structure
+ */
+
+struct in6_addr {
+       union {
+               __u8            u6_addr8[16];
+               __be16          u6_addr16[8];
+               __be32          u6_addr32[4];
+       } in6_u;
+#define s6_addr                        in6_u.u6_addr8
+#define s6_addr16              in6_u.u6_addr16
+#define s6_addr32              in6_u.u6_addr32
+};
+
+/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
+ * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
+ * in network byte order, not in host byte order as are the IPv4 equivalents
+ */
+
+struct sockaddr_in6 {
+       unsigned short int      sin6_family;    /* AF_INET6 */
+       __be16                  sin6_port;      /* Transport layer port # */
+       __be32                  sin6_flowinfo;  /* IPv6 flow information */
+       struct in6_addr         sin6_addr;      /* IPv6 address */
+       __u32                   sin6_scope_id;  /* scope id (new in RFC2553) */
+};
+
+struct ipv6_mreq {
+       /* IPv6 multicast address of group */
+       struct in6_addr ipv6mr_multiaddr;
+
+       /* local IPv6 address of interface */
+       int             ipv6mr_ifindex;
+};
+
+#define ipv6mr_acaddr  ipv6mr_multiaddr
+
+struct in6_flowlabel_req {
+       struct in6_addr flr_dst;
+       __be32  flr_label;
+       __u8    flr_action;
+       __u8    flr_share;
+       __u16   flr_flags;
+       __u16   flr_expires;
+       __u16   flr_linger;
+       __u32   __flr_pad;
+       /* Options in format of IPV6_PKTOPTIONS */
+};
+
+#define IPV6_FL_A_GET  0
+#define IPV6_FL_A_PUT  1
+#define IPV6_FL_A_RENEW        2
+
+#define IPV6_FL_F_CREATE       1
+#define IPV6_FL_F_EXCL         2
+
+#define IPV6_FL_S_NONE         0
+#define IPV6_FL_S_EXCL         1
+#define IPV6_FL_S_PROCESS      2
+#define IPV6_FL_S_USER         3
+#define IPV6_FL_S_ANY          255
+
+
+/*
+ *     Bitmask constant declarations to help applications select out the 
+ *     flow label and priority fields.
+ *
+ *     Note that this are in host byte order while the flowinfo field of
+ *     sockaddr_in6 is in network byte order.
+ */
+
+#define IPV6_FLOWINFO_FLOWLABEL                0x000fffff
+#define IPV6_FLOWINFO_PRIORITY         0x0ff00000
+
+/* These definitions are obsolete */
+#define IPV6_PRIORITY_UNCHARACTERIZED  0x0000
+#define IPV6_PRIORITY_FILLER           0x0100
+#define IPV6_PRIORITY_UNATTENDED       0x0200
+#define IPV6_PRIORITY_RESERVED1                0x0300
+#define IPV6_PRIORITY_BULK             0x0400
+#define IPV6_PRIORITY_RESERVED2                0x0500
+#define IPV6_PRIORITY_INTERACTIVE      0x0600
+#define IPV6_PRIORITY_CONTROL          0x0700
+#define IPV6_PRIORITY_8                        0x0800
+#define IPV6_PRIORITY_9                        0x0900
+#define IPV6_PRIORITY_10               0x0a00
+#define IPV6_PRIORITY_11               0x0b00
+#define IPV6_PRIORITY_12               0x0c00
+#define IPV6_PRIORITY_13               0x0d00
+#define IPV6_PRIORITY_14               0x0e00
+#define IPV6_PRIORITY_15               0x0f00
+
+/*
+ *     IPV6 extension headers
+ */
+#define IPPROTO_HOPOPTS                0       /* IPv6 hop-by-hop options      */
+#define IPPROTO_ROUTING                43      /* IPv6 routing header          */
+#define IPPROTO_FRAGMENT       44      /* IPv6 fragmentation header    */
+#define IPPROTO_ICMPV6         58      /* ICMPv6                       */
+#define IPPROTO_NONE           59      /* IPv6 no next header          */
+#define IPPROTO_DSTOPTS                60      /* IPv6 destination options     */
+#define IPPROTO_MH             135     /* IPv6 mobility header         */
+
+/*
+ *     IPv6 TLV options.
+ */
+#define IPV6_TLV_PAD1          0
+#define IPV6_TLV_PADN          1
+#define IPV6_TLV_ROUTERALERT   5
+#define IPV6_TLV_JUMBO         194
+#define IPV6_TLV_HAO           201     /* home address option */
+
+/*
+ *     IPV6 socket options
+ */
+
+#define IPV6_ADDRFORM          1
+#define IPV6_2292PKTINFO       2
+#define IPV6_2292HOPOPTS       3
+#define IPV6_2292DSTOPTS       4
+#define IPV6_2292RTHDR         5
+#define IPV6_2292PKTOPTIONS    6
+#define IPV6_CHECKSUM          7
+#define IPV6_2292HOPLIMIT      8
+#define IPV6_NEXTHOP           9
+#define IPV6_AUTHHDR           10      /* obsolete */
+#define IPV6_FLOWINFO          11
+
+#define IPV6_UNICAST_HOPS      16
+#define IPV6_MULTICAST_IF      17
+#define IPV6_MULTICAST_HOPS    18
+#define IPV6_MULTICAST_LOOP    19
+#define IPV6_ADD_MEMBERSHIP    20
+#define IPV6_DROP_MEMBERSHIP   21
+#define IPV6_ROUTER_ALERT      22
+#define IPV6_MTU_DISCOVER      23
+#define IPV6_MTU               24
+#define IPV6_RECVERR           25
+#define IPV6_V6ONLY            26
+#define IPV6_JOIN_ANYCAST      27
+#define IPV6_LEAVE_ANYCAST     28
+
+/* IPV6_MTU_DISCOVER values */
+#define IPV6_PMTUDISC_DONT             0
+#define IPV6_PMTUDISC_WANT             1
+#define IPV6_PMTUDISC_DO               2
+#define IPV6_PMTUDISC_PROBE            3
+
+/* Flowlabel */
+#define IPV6_FLOWLABEL_MGR     32
+#define IPV6_FLOWINFO_SEND     33
+
+#define IPV6_IPSEC_POLICY      34
+#define IPV6_XFRM_POLICY       35
+
+/*
+ * Multicast:
+ * Following socket options are shared between IPv4 and IPv6.
+ *
+ * MCAST_JOIN_GROUP            42
+ * MCAST_BLOCK_SOURCE          43
+ * MCAST_UNBLOCK_SOURCE                44
+ * MCAST_LEAVE_GROUP           45
+ * MCAST_JOIN_SOURCE_GROUP     46
+ * MCAST_LEAVE_SOURCE_GROUP    47
+ * MCAST_MSFILTER              48
+ */
+
+/*
+ * Advanced API (RFC3542) (1)
+ *
+ * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
+ */
+
+#define IPV6_RECVPKTINFO       49
+#define IPV6_PKTINFO           50
+#define IPV6_RECVHOPLIMIT      51
+#define IPV6_HOPLIMIT          52
+#define IPV6_RECVHOPOPTS       53
+#define IPV6_HOPOPTS           54
+#define IPV6_RTHDRDSTOPTS      55
+#define IPV6_RECVRTHDR         56
+#define IPV6_RTHDR             57
+#define IPV6_RECVDSTOPTS       58
+#define IPV6_DSTOPTS           59
+#define IPV6_RECVPATHMTU       60
+#define IPV6_PATHMTU           61
+#define IPV6_DONTFRAG          62
+#if 0  /* not yet */
+#define IPV6_USE_MIN_MTU       63
+#endif
+
+/*
+ * Netfilter (1)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO              64
+ * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES      65
+ */
+
+/*
+ * Advanced API (RFC3542) (2)
+ */
+#define IPV6_RECVTCLASS                66
+#define IPV6_TCLASS            67
+
+/*
+ * Netfilter (2)
+ *
+ * Following socket options are used in ip6_tables;
+ * see include/linux/netfilter_ipv6/ip6_tables.h.
+ *
+ * IP6T_SO_GET_REVISION_MATCH  68
+ * IP6T_SO_GET_REVISION_TARGET 69
+ */
+
+/* RFC5014: Source address selection */
+#define IPV6_ADDR_PREFERENCES  72
+
+#define IPV6_PREFER_SRC_TMP            0x0001
+#define IPV6_PREFER_SRC_PUBLIC         0x0002
+#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
+#define IPV6_PREFER_SRC_COA            0x0004
+#define IPV6_PREFER_SRC_HOME           0x0400
+#define IPV6_PREFER_SRC_CGA            0x0008
+#define IPV6_PREFER_SRC_NONCGA         0x0800
+
+/* RFC5082: Generalized Ttl Security Mechanism */
+#define IPV6_MINHOPCOUNT               73
+
+#define IPV6_ORIGDSTADDR        74
+#define IPV6_RECVORIGDSTADDR    IPV6_ORIGDSTADDR
+#define IPV6_TRANSPARENT        75
+#define IPV6_UNICAST_IF         76
+
+/*
+ * Multicast Routing:
+ * see include/linux/mroute6.h.
+ *
+ * MRT6_INIT                   200
+ * MRT6_DONE                   201
+ * MRT6_ADD_MIF                        202
+ * MRT6_DEL_MIF                        203
+ * MRT6_ADD_MFC                        204
+ * MRT6_DEL_MFC                        205
+ * MRT6_VERSION                        206
+ * MRT6_ASSERT                 207
+ * MRT6_PIM                    208
+ * (reserved)                  209
+ */
+#endif /* _UAPI_LINUX_IN6_H */
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
new file mode 100644 (file)
index 0000000..8c469af
--- /dev/null
@@ -0,0 +1,136 @@
+#ifndef _UAPI_INET_DIAG_H_
+#define _UAPI_INET_DIAG_H_
+
+#include <linux/types.h>
+
+/* Just some random number */
+#define TCPDIAG_GETSOCK 18
+#define DCCPDIAG_GETSOCK 19
+
+#define INET_DIAG_GETSOCK_MAX 24
+
+/* Socket identity */
+struct inet_diag_sockid {
+       __be16  idiag_sport;
+       __be16  idiag_dport;
+       __be32  idiag_src[4];
+       __be32  idiag_dst[4];
+       __u32   idiag_if;
+       __u32   idiag_cookie[2];
+#define INET_DIAG_NOCOOKIE (~0U)
+};
+
+/* Request structure */
+
+struct inet_diag_req {
+       __u8    idiag_family;           /* Family of addresses. */
+       __u8    idiag_src_len;
+       __u8    idiag_dst_len;
+       __u8    idiag_ext;              /* Query extended information */
+
+       struct inet_diag_sockid id;
+
+       __u32   idiag_states;           /* States to dump */
+       __u32   idiag_dbs;              /* Tables to dump (NI) */
+};
+
+struct inet_diag_req_v2 {
+       __u8    sdiag_family;
+       __u8    sdiag_protocol;
+       __u8    idiag_ext;
+       __u8    pad;
+       __u32   idiag_states;
+       struct inet_diag_sockid id;
+};
+
+enum {
+       INET_DIAG_REQ_NONE,
+       INET_DIAG_REQ_BYTECODE,
+};
+
+#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
+
+/* Bytecode is sequence of 4 byte commands followed by variable arguments.
+ * All the commands identified by "code" are conditional jumps forward:
+ * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
+ * length of the command and its arguments.
+ */
+struct inet_diag_bc_op {
+       unsigned char   code;
+       unsigned char   yes;
+       unsigned short  no;
+};
+
+enum {
+       INET_DIAG_BC_NOP,
+       INET_DIAG_BC_JMP,
+       INET_DIAG_BC_S_GE,
+       INET_DIAG_BC_S_LE,
+       INET_DIAG_BC_D_GE,
+       INET_DIAG_BC_D_LE,
+       INET_DIAG_BC_AUTO,
+       INET_DIAG_BC_S_COND,
+       INET_DIAG_BC_D_COND,
+};
+
+struct inet_diag_hostcond {
+       __u8    family;
+       __u8    prefix_len;
+       int     port;
+       __be32  addr[0];
+};
+
+/* Base info structure. It contains socket identity (addrs/ports/cookie)
+ * and, alas, the information shown by netstat. */
+struct inet_diag_msg {
+       __u8    idiag_family;
+       __u8    idiag_state;
+       __u8    idiag_timer;
+       __u8    idiag_retrans;
+
+       struct inet_diag_sockid id;
+
+       __u32   idiag_expires;
+       __u32   idiag_rqueue;
+       __u32   idiag_wqueue;
+       __u32   idiag_uid;
+       __u32   idiag_inode;
+};
+
+/* Extensions */
+
+enum {
+       INET_DIAG_NONE,
+       INET_DIAG_MEMINFO,
+       INET_DIAG_INFO,
+       INET_DIAG_VEGASINFO,
+       INET_DIAG_CONG,
+       INET_DIAG_TOS,
+       INET_DIAG_TCLASS,
+       INET_DIAG_SKMEMINFO,
+};
+
+#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
+
+
+/* INET_DIAG_MEM */
+
+struct inet_diag_meminfo {
+       __u32   idiag_rmem;
+       __u32   idiag_wmem;
+       __u32   idiag_fmem;
+       __u32   idiag_tmem;
+};
+
+/* INET_DIAG_VEGASINFO */
+
+struct tcpvegas_info {
+       __u32   tcpv_enabled;
+       __u32   tcpv_rttcnt;
+       __u32   tcpv_rtt;
+       __u32   tcpv_minrtt;
+};
+
+
+#endif /* _UAPI_INET_DIAG_H_ */
diff --git a/include/uapi/linux/inotify.h b/include/uapi/linux/inotify.h
new file mode 100644 (file)
index 0000000..e6bf35b
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2005 John McCutchan
+ */
+
+#ifndef _UAPI_LINUX_INOTIFY_H
+#define _UAPI_LINUX_INOTIFY_H
+
+/* For O_CLOEXEC and O_NONBLOCK */
+#include <linux/fcntl.h>
+#include <linux/types.h>
+
+/*
+ * struct inotify_event - structure read from the inotify device for each event
+ *
+ * When you are watching a directory, you will receive the filename for events
+ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
+ */
+struct inotify_event {
+       __s32           wd;             /* watch descriptor */
+       __u32           mask;           /* watch mask */
+       __u32           cookie;         /* cookie to synchronize two events */
+       __u32           len;            /* length (including nulls) of name */
+       char            name[0];        /* stub for possible name */
+};
+
+/* the following are legal, implemented events that user-space can watch for */
+#define IN_ACCESS              0x00000001      /* File was accessed */
+#define IN_MODIFY              0x00000002      /* File was modified */
+#define IN_ATTRIB              0x00000004      /* Metadata changed */
+#define IN_CLOSE_WRITE         0x00000008      /* Writtable file was closed */
+#define IN_CLOSE_NOWRITE       0x00000010      /* Unwrittable file closed */
+#define IN_OPEN                        0x00000020      /* File was opened */
+#define IN_MOVED_FROM          0x00000040      /* File was moved from X */
+#define IN_MOVED_TO            0x00000080      /* File was moved to Y */
+#define IN_CREATE              0x00000100      /* Subfile was created */
+#define IN_DELETE              0x00000200      /* Subfile was deleted */
+#define IN_DELETE_SELF         0x00000400      /* Self was deleted */
+#define IN_MOVE_SELF           0x00000800      /* Self was moved */
+
+/* the following are legal events.  they are sent as needed to any watch */
+#define IN_UNMOUNT             0x00002000      /* Backing fs was unmounted */
+#define IN_Q_OVERFLOW          0x00004000      /* Event queued overflowed */
+#define IN_IGNORED             0x00008000      /* File was ignored */
+
+/* helper events */
+#define IN_CLOSE               (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
+#define IN_MOVE                        (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
+
+/* special flags */
+#define IN_ONLYDIR             0x01000000      /* only watch the path if it is a directory */
+#define IN_DONT_FOLLOW         0x02000000      /* don't follow a sym link */
+#define IN_EXCL_UNLINK         0x04000000      /* exclude events on unlinked objects */
+#define IN_MASK_ADD            0x20000000      /* add to the mask of an already existing watch */
+#define IN_ISDIR               0x40000000      /* event occurred against dir */
+#define IN_ONESHOT             0x80000000      /* only send event once */
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility.  Apps will get only the
+ * events that they originally wanted.  Be sure to add new events here!
+ */
+#define IN_ALL_EVENTS  (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
+                        IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
+                        IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
+                        IN_MOVE_SELF)
+
+/* Flags for sys_inotify_init1.  */
+#define IN_CLOEXEC O_CLOEXEC
+#define IN_NONBLOCK O_NONBLOCK
+
+
+#endif /* _UAPI_LINUX_INOTIFY_H */
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
new file mode 100644 (file)
index 0000000..5588285
--- /dev/null
@@ -0,0 +1,1153 @@
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef _UAPI_INPUT_H
+#define _UAPI_INPUT_H
+
+
+#ifndef __KERNEL__
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <linux/types.h>
+#endif
+
+
+/*
+ * The event structure itself
+ */
+
+struct input_event {
+       struct timeval time;
+       __u16 type;
+       __u16 code;
+       __s32 value;
+};
+
+/*
+ * Protocol version.
+ */
+
+#define EV_VERSION             0x010001
+
+/*
+ * IOCTLs (0x00 - 0x7f)
+ */
+
+struct input_id {
+       __u16 bustype;
+       __u16 vendor;
+       __u16 product;
+       __u16 version;
+};
+
+/**
+ * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls
+ * @value: latest reported value for the axis.
+ * @minimum: specifies minimum value for the axis.
+ * @maximum: specifies maximum value for the axis.
+ * @fuzz: specifies fuzz value that is used to filter noise from
+ *     the event stream.
+ * @flat: values that are within this value will be discarded by
+ *     joydev interface and reported as 0 instead.
+ * @resolution: specifies resolution for the values reported for
+ *     the axis.
+ *
+ * Note that input core does not clamp reported values to the
+ * [minimum, maximum] limits, such task is left to userspace.
+ *
+ * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in
+ * units per millimeter (units/mm), resolution for rotational axes
+ * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
+ */
+struct input_absinfo {
+       __s32 value;
+       __s32 minimum;
+       __s32 maximum;
+       __s32 fuzz;
+       __s32 flat;
+       __s32 resolution;
+};
+
+/**
+ * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
+ * @scancode: scancode represented in machine-endian form.
+ * @len: length of the scancode that resides in @scancode buffer.
+ * @index: index in the keymap, may be used instead of scancode
+ * @flags: allows to specify how kernel should handle the request. For
+ *     example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
+ *     should perform lookup in keymap by @index instead of @scancode
+ * @keycode: key code assigned to this scancode
+ *
+ * The structure is used to retrieve and modify keymap data. Users have
+ * option of performing lookup either by @scancode itself or by @index
+ * in keymap entry. EVIOCGKEYCODE will also return scancode or index
+ * (depending on which element was used to perform lookup).
+ */
+struct input_keymap_entry {
+#define INPUT_KEYMAP_BY_INDEX  (1 << 0)
+       __u8  flags;
+       __u8  len;
+       __u16 index;
+       __u32 keycode;
+       __u8  scancode[32];
+};
+
+#define EVIOCGVERSION          _IOR('E', 0x01, int)                    /* get driver version */
+#define EVIOCGID               _IOR('E', 0x02, struct input_id)        /* get device ID */
+#define EVIOCGREP              _IOR('E', 0x03, unsigned int[2])        /* get repeat settings */
+#define EVIOCSREP              _IOW('E', 0x03, unsigned int[2])        /* set repeat settings */
+
+#define EVIOCGKEYCODE          _IOR('E', 0x04, unsigned int[2])        /* get keycode */
+#define EVIOCGKEYCODE_V2       _IOR('E', 0x04, struct input_keymap_entry)
+#define EVIOCSKEYCODE          _IOW('E', 0x04, unsigned int[2])        /* set keycode */
+#define EVIOCSKEYCODE_V2       _IOW('E', 0x04, struct input_keymap_entry)
+
+#define EVIOCGNAME(len)                _IOC(_IOC_READ, 'E', 0x06, len)         /* get device name */
+#define EVIOCGPHYS(len)                _IOC(_IOC_READ, 'E', 0x07, len)         /* get physical location */
+#define EVIOCGUNIQ(len)                _IOC(_IOC_READ, 'E', 0x08, len)         /* get unique identifier */
+#define EVIOCGPROP(len)                _IOC(_IOC_READ, 'E', 0x09, len)         /* get device properties */
+
+/**
+ * EVIOCGMTSLOTS(len) - get MT slot values
+ * @len: size of the data buffer in bytes
+ *
+ * The ioctl buffer argument should be binary equivalent to
+ *
+ * struct input_mt_request_layout {
+ *     __u32 code;
+ *     __s32 values[num_slots];
+ * };
+ *
+ * where num_slots is the (arbitrary) number of MT slots to extract.
+ *
+ * The ioctl size argument (len) is the size of the buffer, which
+ * should satisfy len = (num_slots + 1) * sizeof(__s32).  If len is
+ * too small to fit all available slots, the first num_slots are
+ * returned.
+ *
+ * Before the call, code is set to the wanted ABS_MT event type. On
+ * return, values[] is filled with the slot values for the specified
+ * ABS_MT code.
+ *
+ * If the request code is not an ABS_MT value, -EINVAL is returned.
+ */
+#define EVIOCGMTSLOTS(len)     _IOC(_IOC_READ, 'E', 0x0a, len)
+
+#define EVIOCGKEY(len)         _IOC(_IOC_READ, 'E', 0x18, len)         /* get global key state */
+#define EVIOCGLED(len)         _IOC(_IOC_READ, 'E', 0x19, len)         /* get all LEDs */
+#define EVIOCGSND(len)         _IOC(_IOC_READ, 'E', 0x1a, len)         /* get all sounds status */
+#define EVIOCGSW(len)          _IOC(_IOC_READ, 'E', 0x1b, len)         /* get all switch states */
+
+#define EVIOCGBIT(ev,len)      _IOC(_IOC_READ, 'E', 0x20 + (ev), len)  /* get event bits */
+#define EVIOCGABS(abs)         _IOR('E', 0x40 + (abs), struct input_absinfo)   /* get abs value/limits */
+#define EVIOCSABS(abs)         _IOW('E', 0xc0 + (abs), struct input_absinfo)   /* set abs value/limits */
+
+#define EVIOCSFF               _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))   /* send a force effect to a force feedback device */
+#define EVIOCRMFF              _IOW('E', 0x81, int)                    /* Erase a force effect */
+#define EVIOCGEFFECTS          _IOR('E', 0x84, int)                    /* Report number of effects playable at the same time */
+
+#define EVIOCGRAB              _IOW('E', 0x90, int)                    /* Grab/Release device */
+
+#define EVIOCSCLOCKID          _IOW('E', 0xa0, int)                    /* Set clockid to be used for timestamps */
+
+/*
+ * Device properties and quirks
+ */
+
+#define INPUT_PROP_POINTER             0x00    /* needs a pointer */
+#define INPUT_PROP_DIRECT              0x01    /* direct input devices */
+#define INPUT_PROP_BUTTONPAD           0x02    /* has button(s) under pad */
+#define INPUT_PROP_SEMI_MT             0x03    /* touch rectangle only */
+
+#define INPUT_PROP_MAX                 0x1f
+#define INPUT_PROP_CNT                 (INPUT_PROP_MAX + 1)
+
+/*
+ * Event types
+ */
+
+#define EV_SYN                 0x00
+#define EV_KEY                 0x01
+#define EV_REL                 0x02
+#define EV_ABS                 0x03
+#define EV_MSC                 0x04
+#define EV_SW                  0x05
+#define EV_LED                 0x11
+#define EV_SND                 0x12
+#define EV_REP                 0x14
+#define EV_FF                  0x15
+#define EV_PWR                 0x16
+#define EV_FF_STATUS           0x17
+#define EV_MAX                 0x1f
+#define EV_CNT                 (EV_MAX+1)
+
+/*
+ * Synchronization events.
+ */
+
+#define SYN_REPORT             0
+#define SYN_CONFIG             1
+#define SYN_MT_REPORT          2
+#define SYN_DROPPED            3
+
+/*
+ * Keys and buttons
+ *
+ * Most of the keys/buttons are modeled after USB HUT 1.12
+ * (see http://www.usb.org/developers/hidpage).
+ * Abbreviations in the comments:
+ * AC - Application Control
+ * AL - Application Launch Button
+ * SC - System Control
+ */
+
+#define KEY_RESERVED           0
+#define KEY_ESC                        1
+#define KEY_1                  2
+#define KEY_2                  3
+#define KEY_3                  4
+#define KEY_4                  5
+#define KEY_5                  6
+#define KEY_6                  7
+#define KEY_7                  8
+#define KEY_8                  9
+#define KEY_9                  10
+#define KEY_0                  11
+#define KEY_MINUS              12
+#define KEY_EQUAL              13
+#define KEY_BACKSPACE          14
+#define KEY_TAB                        15
+#define KEY_Q                  16
+#define KEY_W                  17
+#define KEY_E                  18
+#define KEY_R                  19
+#define KEY_T                  20
+#define KEY_Y                  21
+#define KEY_U                  22
+#define KEY_I                  23
+#define KEY_O                  24
+#define KEY_P                  25
+#define KEY_LEFTBRACE          26
+#define KEY_RIGHTBRACE         27
+#define KEY_ENTER              28
+#define KEY_LEFTCTRL           29
+#define KEY_A                  30
+#define KEY_S                  31
+#define KEY_D                  32
+#define KEY_F                  33
+#define KEY_G                  34
+#define KEY_H                  35
+#define KEY_J                  36
+#define KEY_K                  37
+#define KEY_L                  38
+#define KEY_SEMICOLON          39
+#define KEY_APOSTROPHE         40
+#define KEY_GRAVE              41
+#define KEY_LEFTSHIFT          42
+#define KEY_BACKSLASH          43
+#define KEY_Z                  44
+#define KEY_X                  45
+#define KEY_C                  46
+#define KEY_V                  47
+#define KEY_B                  48
+#define KEY_N                  49
+#define KEY_M                  50
+#define KEY_COMMA              51
+#define KEY_DOT                        52
+#define KEY_SLASH              53
+#define KEY_RIGHTSHIFT         54
+#define KEY_KPASTERISK         55
+#define KEY_LEFTALT            56
+#define KEY_SPACE              57
+#define KEY_CAPSLOCK           58
+#define KEY_F1                 59
+#define KEY_F2                 60
+#define KEY_F3                 61
+#define KEY_F4                 62
+#define KEY_F5                 63
+#define KEY_F6                 64
+#define KEY_F7                 65
+#define KEY_F8                 66
+#define KEY_F9                 67
+#define KEY_F10                        68
+#define KEY_NUMLOCK            69
+#define KEY_SCROLLLOCK         70
+#define KEY_KP7                        71
+#define KEY_KP8                        72
+#define KEY_KP9                        73
+#define KEY_KPMINUS            74
+#define KEY_KP4                        75
+#define KEY_KP5                        76
+#define KEY_KP6                        77
+#define KEY_KPPLUS             78
+#define KEY_KP1                        79
+#define KEY_KP2                        80
+#define KEY_KP3                        81
+#define KEY_KP0                        82
+#define KEY_KPDOT              83
+
+#define KEY_ZENKAKUHANKAKU     85
+#define KEY_102ND              86
+#define KEY_F11                        87
+#define KEY_F12                        88
+#define KEY_RO                 89
+#define KEY_KATAKANA           90
+#define KEY_HIRAGANA           91
+#define KEY_HENKAN             92
+#define KEY_KATAKANAHIRAGANA   93
+#define KEY_MUHENKAN           94
+#define KEY_KPJPCOMMA          95
+#define KEY_KPENTER            96
+#define KEY_RIGHTCTRL          97
+#define KEY_KPSLASH            98
+#define KEY_SYSRQ              99
+#define KEY_RIGHTALT           100
+#define KEY_LINEFEED           101
+#define KEY_HOME               102
+#define KEY_UP                 103
+#define KEY_PAGEUP             104
+#define KEY_LEFT               105
+#define KEY_RIGHT              106
+#define KEY_END                        107
+#define KEY_DOWN               108
+#define KEY_PAGEDOWN           109
+#define KEY_INSERT             110
+#define KEY_DELETE             111
+#define KEY_MACRO              112
+#define KEY_MUTE               113
+#define KEY_VOLUMEDOWN         114
+#define KEY_VOLUMEUP           115
+#define KEY_POWER              116     /* SC System Power Down */
+#define KEY_KPEQUAL            117
+#define KEY_KPPLUSMINUS                118
+#define KEY_PAUSE              119
+#define KEY_SCALE              120     /* AL Compiz Scale (Expose) */
+
+#define KEY_KPCOMMA            121
+#define KEY_HANGEUL            122
+#define KEY_HANGUEL            KEY_HANGEUL
+#define KEY_HANJA              123
+#define KEY_YEN                        124
+#define KEY_LEFTMETA           125
+#define KEY_RIGHTMETA          126
+#define KEY_COMPOSE            127
+
+#define KEY_STOP               128     /* AC Stop */
+#define KEY_AGAIN              129
+#define KEY_PROPS              130     /* AC Properties */
+#define KEY_UNDO               131     /* AC Undo */
+#define KEY_FRONT              132
+#define KEY_COPY               133     /* AC Copy */
+#define KEY_OPEN               134     /* AC Open */
+#define KEY_PASTE              135     /* AC Paste */
+#define KEY_FIND               136     /* AC Search */
+#define KEY_CUT                        137     /* AC Cut */
+#define KEY_HELP               138     /* AL Integrated Help Center */
+#define KEY_MENU               139     /* Menu (show menu) */
+#define KEY_CALC               140     /* AL Calculator */
+#define KEY_SETUP              141
+#define KEY_SLEEP              142     /* SC System Sleep */
+#define KEY_WAKEUP             143     /* System Wake Up */
+#define KEY_FILE               144     /* AL Local Machine Browser */
+#define KEY_SENDFILE           145
+#define KEY_DELETEFILE         146
+#define KEY_XFER               147
+#define KEY_PROG1              148
+#define KEY_PROG2              149
+#define KEY_WWW                        150     /* AL Internet Browser */
+#define KEY_MSDOS              151
+#define KEY_COFFEE             152     /* AL Terminal Lock/Screensaver */
+#define KEY_SCREENLOCK         KEY_COFFEE
+#define KEY_DIRECTION          153
+#define KEY_CYCLEWINDOWS       154
+#define KEY_MAIL               155
+#define KEY_BOOKMARKS          156     /* AC Bookmarks */
+#define KEY_COMPUTER           157
+#define KEY_BACK               158     /* AC Back */
+#define KEY_FORWARD            159     /* AC Forward */
+#define KEY_CLOSECD            160
+#define KEY_EJECTCD            161
+#define KEY_EJECTCLOSECD       162
+#define KEY_NEXTSONG           163
+#define KEY_PLAYPAUSE          164
+#define KEY_PREVIOUSSONG       165
+#define KEY_STOPCD             166
+#define KEY_RECORD             167
+#define KEY_REWIND             168
+#define KEY_PHONE              169     /* Media Select Telephone */
+#define KEY_ISO                        170
+#define KEY_CONFIG             171     /* AL Consumer Control Configuration */
+#define KEY_HOMEPAGE           172     /* AC Home */
+#define KEY_REFRESH            173     /* AC Refresh */
+#define KEY_EXIT               174     /* AC Exit */
+#define KEY_MOVE               175
+#define KEY_EDIT               176
+#define KEY_SCROLLUP           177
+#define KEY_SCROLLDOWN         178
+#define KEY_KPLEFTPAREN                179
+#define KEY_KPRIGHTPAREN       180
+#define KEY_NEW                        181     /* AC New */
+#define KEY_REDO               182     /* AC Redo/Repeat */
+
+#define KEY_F13                        183
+#define KEY_F14                        184
+#define KEY_F15                        185
+#define KEY_F16                        186
+#define KEY_F17                        187
+#define KEY_F18                        188
+#define KEY_F19                        189
+#define KEY_F20                        190
+#define KEY_F21                        191
+#define KEY_F22                        192
+#define KEY_F23                        193
+#define KEY_F24                        194
+
+#define KEY_PLAYCD             200
+#define KEY_PAUSECD            201
+#define KEY_PROG3              202
+#define KEY_PROG4              203
+#define KEY_DASHBOARD          204     /* AL Dashboard */
+#define KEY_SUSPEND            205
+#define KEY_CLOSE              206     /* AC Close */
+#define KEY_PLAY               207
+#define KEY_FASTFORWARD                208
+#define KEY_BASSBOOST          209
+#define KEY_PRINT              210     /* AC Print */
+#define KEY_HP                 211
+#define KEY_CAMERA             212
+#define KEY_SOUND              213
+#define KEY_QUESTION           214
+#define KEY_EMAIL              215
+#define KEY_CHAT               216
+#define KEY_SEARCH             217
+#define KEY_CONNECT            218
+#define KEY_FINANCE            219     /* AL Checkbook/Finance */
+#define KEY_SPORT              220
+#define KEY_SHOP               221
+#define KEY_ALTERASE           222
+#define KEY_CANCEL             223     /* AC Cancel */
+#define KEY_BRIGHTNESSDOWN     224
+#define KEY_BRIGHTNESSUP       225
+#define KEY_MEDIA              226
+
+#define KEY_SWITCHVIDEOMODE    227     /* Cycle between available video
+                                          outputs (Monitor/LCD/TV-out/etc) */
+#define KEY_KBDILLUMTOGGLE     228
+#define KEY_KBDILLUMDOWN       229
+#define KEY_KBDILLUMUP         230
+
+#define KEY_SEND               231     /* AC Send */
+#define KEY_REPLY              232     /* AC Reply */
+#define KEY_FORWARDMAIL                233     /* AC Forward Msg */
+#define KEY_SAVE               234     /* AC Save */
+#define KEY_DOCUMENTS          235
+
+#define KEY_BATTERY            236
+
+#define KEY_BLUETOOTH          237
+#define KEY_WLAN               238
+#define KEY_UWB                        239
+
+#define KEY_UNKNOWN            240
+
+#define KEY_VIDEO_NEXT         241     /* drive next video source */
+#define KEY_VIDEO_PREV         242     /* drive previous video source */
+#define KEY_BRIGHTNESS_CYCLE   243     /* brightness up, after max is min */
+#define KEY_BRIGHTNESS_ZERO    244     /* brightness off, use ambient */
+#define KEY_DISPLAY_OFF                245     /* display device to off state */
+
+#define KEY_WIMAX              246
+#define KEY_RFKILL             247     /* Key that controls all radios */
+
+#define KEY_MICMUTE            248     /* Mute / unmute the microphone */
+
+/* Code 255 is reserved for special needs of AT keyboard driver */
+
+#define BTN_MISC               0x100
+#define BTN_0                  0x100
+#define BTN_1                  0x101
+#define BTN_2                  0x102
+#define BTN_3                  0x103
+#define BTN_4                  0x104
+#define BTN_5                  0x105
+#define BTN_6                  0x106
+#define BTN_7                  0x107
+#define BTN_8                  0x108
+#define BTN_9                  0x109
+
+#define BTN_MOUSE              0x110
+#define BTN_LEFT               0x110
+#define BTN_RIGHT              0x111
+#define BTN_MIDDLE             0x112
+#define BTN_SIDE               0x113
+#define BTN_EXTRA              0x114
+#define BTN_FORWARD            0x115
+#define BTN_BACK               0x116
+#define BTN_TASK               0x117
+
+#define BTN_JOYSTICK           0x120
+#define BTN_TRIGGER            0x120
+#define BTN_THUMB              0x121
+#define BTN_THUMB2             0x122
+#define BTN_TOP                        0x123
+#define BTN_TOP2               0x124
+#define BTN_PINKIE             0x125
+#define BTN_BASE               0x126
+#define BTN_BASE2              0x127
+#define BTN_BASE3              0x128
+#define BTN_BASE4              0x129
+#define BTN_BASE5              0x12a
+#define BTN_BASE6              0x12b
+#define BTN_DEAD               0x12f
+
+#define BTN_GAMEPAD            0x130
+#define BTN_A                  0x130
+#define BTN_B                  0x131
+#define BTN_C                  0x132
+#define BTN_X                  0x133
+#define BTN_Y                  0x134
+#define BTN_Z                  0x135
+#define BTN_TL                 0x136
+#define BTN_TR                 0x137
+#define BTN_TL2                        0x138
+#define BTN_TR2                        0x139
+#define BTN_SELECT             0x13a
+#define BTN_START              0x13b
+#define BTN_MODE               0x13c
+#define BTN_THUMBL             0x13d
+#define BTN_THUMBR             0x13e
+
+#define BTN_DIGI               0x140
+#define BTN_TOOL_PEN           0x140
+#define BTN_TOOL_RUBBER                0x141
+#define BTN_TOOL_BRUSH         0x142
+#define BTN_TOOL_PENCIL                0x143
+#define BTN_TOOL_AIRBRUSH      0x144
+#define BTN_TOOL_FINGER                0x145
+#define BTN_TOOL_MOUSE         0x146
+#define BTN_TOOL_LENS          0x147
+#define BTN_TOOL_QUINTTAP      0x148   /* Five fingers on trackpad */
+#define BTN_TOUCH              0x14a
+#define BTN_STYLUS             0x14b
+#define BTN_STYLUS2            0x14c
+#define BTN_TOOL_DOUBLETAP     0x14d
+#define BTN_TOOL_TRIPLETAP     0x14e
+#define BTN_TOOL_QUADTAP       0x14f   /* Four fingers on trackpad */
+
+#define BTN_WHEEL              0x150
+#define BTN_GEAR_DOWN          0x150
+#define BTN_GEAR_UP            0x151
+
+#define KEY_OK                 0x160
+#define KEY_SELECT             0x161
+#define KEY_GOTO               0x162
+#define KEY_CLEAR              0x163
+#define KEY_POWER2             0x164
+#define KEY_OPTION             0x165
+#define KEY_INFO               0x166   /* AL OEM Features/Tips/Tutorial */
+#define KEY_TIME               0x167
+#define KEY_VENDOR             0x168
+#define KEY_ARCHIVE            0x169
+#define KEY_PROGRAM            0x16a   /* Media Select Program Guide */
+#define KEY_CHANNEL            0x16b
+#define KEY_FAVORITES          0x16c
+#define KEY_EPG                        0x16d
+#define KEY_PVR                        0x16e   /* Media Select Home */
+#define KEY_MHP                        0x16f
+#define KEY_LANGUAGE           0x170
+#define KEY_TITLE              0x171
+#define KEY_SUBTITLE           0x172
+#define KEY_ANGLE              0x173
+#define KEY_ZOOM               0x174
+#define KEY_MODE               0x175
+#define KEY_KEYBOARD           0x176
+#define KEY_SCREEN             0x177
+#define KEY_PC                 0x178   /* Media Select Computer */
+#define KEY_TV                 0x179   /* Media Select TV */
+#define KEY_TV2                        0x17a   /* Media Select Cable */
+#define KEY_VCR                        0x17b   /* Media Select VCR */
+#define KEY_VCR2               0x17c   /* VCR Plus */
+#define KEY_SAT                        0x17d   /* Media Select Satellite */
+#define KEY_SAT2               0x17e
+#define KEY_CD                 0x17f   /* Media Select CD */
+#define KEY_TAPE               0x180   /* Media Select Tape */
+#define KEY_RADIO              0x181
+#define KEY_TUNER              0x182   /* Media Select Tuner */
+#define KEY_PLAYER             0x183
+#define KEY_TEXT               0x184
+#define KEY_DVD                        0x185   /* Media Select DVD */
+#define KEY_AUX                        0x186
+#define KEY_MP3                        0x187
+#define KEY_AUDIO              0x188   /* AL Audio Browser */
+#define KEY_VIDEO              0x189   /* AL Movie Browser */
+#define KEY_DIRECTORY          0x18a
+#define KEY_LIST               0x18b
+#define KEY_MEMO               0x18c   /* Media Select Messages */
+#define KEY_CALENDAR           0x18d
+#define KEY_RED                        0x18e
+#define KEY_GREEN              0x18f
+#define KEY_YELLOW             0x190
+#define KEY_BLUE               0x191
+#define KEY_CHANNELUP          0x192   /* Channel Increment */
+#define KEY_CHANNELDOWN                0x193   /* Channel Decrement */
+#define KEY_FIRST              0x194
+#define KEY_LAST               0x195   /* Recall Last */
+#define KEY_AB                 0x196
+#define KEY_NEXT               0x197
+#define KEY_RESTART            0x198
+#define KEY_SLOW               0x199
+#define KEY_SHUFFLE            0x19a
+#define KEY_BREAK              0x19b
+#define KEY_PREVIOUS           0x19c
+#define KEY_DIGITS             0x19d
+#define KEY_TEEN               0x19e
+#define KEY_TWEN               0x19f
+#define KEY_VIDEOPHONE         0x1a0   /* Media Select Video Phone */
+#define KEY_GAMES              0x1a1   /* Media Select Games */
+#define KEY_ZOOMIN             0x1a2   /* AC Zoom In */
+#define KEY_ZOOMOUT            0x1a3   /* AC Zoom Out */
+#define KEY_ZOOMRESET          0x1a4   /* AC Zoom */
+#define KEY_WORDPROCESSOR      0x1a5   /* AL Word Processor */
+#define KEY_EDITOR             0x1a6   /* AL Text Editor */
+#define KEY_SPREADSHEET                0x1a7   /* AL Spreadsheet */
+#define KEY_GRAPHICSEDITOR     0x1a8   /* AL Graphics Editor */
+#define KEY_PRESENTATION       0x1a9   /* AL Presentation App */
+#define KEY_DATABASE           0x1aa   /* AL Database App */
+#define KEY_NEWS               0x1ab   /* AL Newsreader */
+#define KEY_VOICEMAIL          0x1ac   /* AL Voicemail */
+#define KEY_ADDRESSBOOK                0x1ad   /* AL Contacts/Address Book */
+#define KEY_MESSENGER          0x1ae   /* AL Instant Messaging */
+#define KEY_DISPLAYTOGGLE      0x1af   /* Turn display (LCD) on and off */
+#define KEY_SPELLCHECK         0x1b0   /* AL Spell Check */
+#define KEY_LOGOFF             0x1b1   /* AL Logoff */
+
+#define KEY_DOLLAR             0x1b2
+#define KEY_EURO               0x1b3
+
+#define KEY_FRAMEBACK          0x1b4   /* Consumer - transport controls */
+#define KEY_FRAMEFORWARD       0x1b5
+#define KEY_CONTEXT_MENU       0x1b6   /* GenDesc - system context menu */
+#define KEY_MEDIA_REPEAT       0x1b7   /* Consumer - transport control */
+#define KEY_10CHANNELSUP       0x1b8   /* 10 channels up (10+) */
+#define KEY_10CHANNELSDOWN     0x1b9   /* 10 channels down (10-) */
+#define KEY_IMAGES             0x1ba   /* AL Image Browser */
+
+#define KEY_DEL_EOL            0x1c0
+#define KEY_DEL_EOS            0x1c1
+#define KEY_INS_LINE           0x1c2
+#define KEY_DEL_LINE           0x1c3
+
+#define KEY_FN                 0x1d0
+#define KEY_FN_ESC             0x1d1
+#define KEY_FN_F1              0x1d2
+#define KEY_FN_F2              0x1d3
+#define KEY_FN_F3              0x1d4
+#define KEY_FN_F4              0x1d5
+#define KEY_FN_F5              0x1d6
+#define KEY_FN_F6              0x1d7
+#define KEY_FN_F7              0x1d8
+#define KEY_FN_F8              0x1d9
+#define KEY_FN_F9              0x1da
+#define KEY_FN_F10             0x1db
+#define KEY_FN_F11             0x1dc
+#define KEY_FN_F12             0x1dd
+#define KEY_FN_1               0x1de
+#define KEY_FN_2               0x1df
+#define KEY_FN_D               0x1e0
+#define KEY_FN_E               0x1e1
+#define KEY_FN_F               0x1e2
+#define KEY_FN_S               0x1e3
+#define KEY_FN_B               0x1e4
+
+#define KEY_BRL_DOT1           0x1f1
+#define KEY_BRL_DOT2           0x1f2
+#define KEY_BRL_DOT3           0x1f3
+#define KEY_BRL_DOT4           0x1f4
+#define KEY_BRL_DOT5           0x1f5
+#define KEY_BRL_DOT6           0x1f6
+#define KEY_BRL_DOT7           0x1f7
+#define KEY_BRL_DOT8           0x1f8
+#define KEY_BRL_DOT9           0x1f9
+#define KEY_BRL_DOT10          0x1fa
+
+#define KEY_NUMERIC_0          0x200   /* used by phones, remote controls, */
+#define KEY_NUMERIC_1          0x201   /* and other keypads */
+#define KEY_NUMERIC_2          0x202
+#define KEY_NUMERIC_3          0x203
+#define KEY_NUMERIC_4          0x204
+#define KEY_NUMERIC_5          0x205
+#define KEY_NUMERIC_6          0x206
+#define KEY_NUMERIC_7          0x207
+#define KEY_NUMERIC_8          0x208
+#define KEY_NUMERIC_9          0x209
+#define KEY_NUMERIC_STAR       0x20a
+#define KEY_NUMERIC_POUND      0x20b
+
+#define KEY_CAMERA_FOCUS       0x210
+#define KEY_WPS_BUTTON         0x211   /* WiFi Protected Setup key */
+
+#define KEY_TOUCHPAD_TOGGLE    0x212   /* Request switch touchpad on or off */
+#define KEY_TOUCHPAD_ON                0x213
+#define KEY_TOUCHPAD_OFF       0x214
+
+#define KEY_CAMERA_ZOOMIN      0x215
+#define KEY_CAMERA_ZOOMOUT     0x216
+#define KEY_CAMERA_UP          0x217
+#define KEY_CAMERA_DOWN                0x218
+#define KEY_CAMERA_LEFT                0x219
+#define KEY_CAMERA_RIGHT       0x21a
+
+#define BTN_TRIGGER_HAPPY              0x2c0
+#define BTN_TRIGGER_HAPPY1             0x2c0
+#define BTN_TRIGGER_HAPPY2             0x2c1
+#define BTN_TRIGGER_HAPPY3             0x2c2
+#define BTN_TRIGGER_HAPPY4             0x2c3
+#define BTN_TRIGGER_HAPPY5             0x2c4
+#define BTN_TRIGGER_HAPPY6             0x2c5
+#define BTN_TRIGGER_HAPPY7             0x2c6
+#define BTN_TRIGGER_HAPPY8             0x2c7
+#define BTN_TRIGGER_HAPPY9             0x2c8
+#define BTN_TRIGGER_HAPPY10            0x2c9
+#define BTN_TRIGGER_HAPPY11            0x2ca
+#define BTN_TRIGGER_HAPPY12            0x2cb
+#define BTN_TRIGGER_HAPPY13            0x2cc
+#define BTN_TRIGGER_HAPPY14            0x2cd
+#define BTN_TRIGGER_HAPPY15            0x2ce
+#define BTN_TRIGGER_HAPPY16            0x2cf
+#define BTN_TRIGGER_HAPPY17            0x2d0
+#define BTN_TRIGGER_HAPPY18            0x2d1
+#define BTN_TRIGGER_HAPPY19            0x2d2
+#define BTN_TRIGGER_HAPPY20            0x2d3
+#define BTN_TRIGGER_HAPPY21            0x2d4
+#define BTN_TRIGGER_HAPPY22            0x2d5
+#define BTN_TRIGGER_HAPPY23            0x2d6
+#define BTN_TRIGGER_HAPPY24            0x2d7
+#define BTN_TRIGGER_HAPPY25            0x2d8
+#define BTN_TRIGGER_HAPPY26            0x2d9
+#define BTN_TRIGGER_HAPPY27            0x2da
+#define BTN_TRIGGER_HAPPY28            0x2db
+#define BTN_TRIGGER_HAPPY29            0x2dc
+#define BTN_TRIGGER_HAPPY30            0x2dd
+#define BTN_TRIGGER_HAPPY31            0x2de
+#define BTN_TRIGGER_HAPPY32            0x2df
+#define BTN_TRIGGER_HAPPY33            0x2e0
+#define BTN_TRIGGER_HAPPY34            0x2e1
+#define BTN_TRIGGER_HAPPY35            0x2e2
+#define BTN_TRIGGER_HAPPY36            0x2e3
+#define BTN_TRIGGER_HAPPY37            0x2e4
+#define BTN_TRIGGER_HAPPY38            0x2e5
+#define BTN_TRIGGER_HAPPY39            0x2e6
+#define BTN_TRIGGER_HAPPY40            0x2e7
+
+/* We avoid low common keys in module aliases so they don't get huge. */
+#define KEY_MIN_INTERESTING    KEY_MUTE
+#define KEY_MAX                        0x2ff
+#define KEY_CNT                        (KEY_MAX+1)
+
+/*
+ * Relative axes
+ */
+
+#define REL_X                  0x00
+#define REL_Y                  0x01
+#define REL_Z                  0x02
+#define REL_RX                 0x03
+#define REL_RY                 0x04
+#define REL_RZ                 0x05
+#define REL_HWHEEL             0x06
+#define REL_DIAL               0x07
+#define REL_WHEEL              0x08
+#define REL_MISC               0x09
+#define REL_MAX                        0x0f
+#define REL_CNT                        (REL_MAX+1)
+
+/*
+ * Absolute axes
+ */
+
+#define ABS_X                  0x00
+#define ABS_Y                  0x01
+#define ABS_Z                  0x02
+#define ABS_RX                 0x03
+#define ABS_RY                 0x04
+#define ABS_RZ                 0x05
+#define ABS_THROTTLE           0x06
+#define ABS_RUDDER             0x07
+#define ABS_WHEEL              0x08
+#define ABS_GAS                        0x09
+#define ABS_BRAKE              0x0a
+#define ABS_HAT0X              0x10
+#define ABS_HAT0Y              0x11
+#define ABS_HAT1X              0x12
+#define ABS_HAT1Y              0x13
+#define ABS_HAT2X              0x14
+#define ABS_HAT2Y              0x15
+#define ABS_HAT3X              0x16
+#define ABS_HAT3Y              0x17
+#define ABS_PRESSURE           0x18
+#define ABS_DISTANCE           0x19
+#define ABS_TILT_X             0x1a
+#define ABS_TILT_Y             0x1b
+#define ABS_TOOL_WIDTH         0x1c
+
+#define ABS_VOLUME             0x20
+
+#define ABS_MISC               0x28
+
+#define ABS_MT_SLOT            0x2f    /* MT slot being modified */
+#define ABS_MT_TOUCH_MAJOR     0x30    /* Major axis of touching ellipse */
+#define ABS_MT_TOUCH_MINOR     0x31    /* Minor axis (omit if circular) */
+#define ABS_MT_WIDTH_MAJOR     0x32    /* Major axis of approaching ellipse */
+#define ABS_MT_WIDTH_MINOR     0x33    /* Minor axis (omit if circular) */
+#define ABS_MT_ORIENTATION     0x34    /* Ellipse orientation */
+#define ABS_MT_POSITION_X      0x35    /* Center X touch position */
+#define ABS_MT_POSITION_Y      0x36    /* Center Y touch position */
+#define ABS_MT_TOOL_TYPE       0x37    /* Type of touching device */
+#define ABS_MT_BLOB_ID         0x38    /* Group a set of packets as a blob */
+#define ABS_MT_TRACKING_ID     0x39    /* Unique ID of initiated contact */
+#define ABS_MT_PRESSURE                0x3a    /* Pressure on contact area */
+#define ABS_MT_DISTANCE                0x3b    /* Contact hover distance */
+#define ABS_MT_TOOL_X          0x3c    /* Center X tool position */
+#define ABS_MT_TOOL_Y          0x3d    /* Center Y tool position */
+
+
+#define ABS_MAX                        0x3f
+#define ABS_CNT                        (ABS_MAX+1)
+
+/*
+ * Switch events
+ */
+
+#define SW_LID                 0x00  /* set = lid shut */
+#define SW_TABLET_MODE         0x01  /* set = tablet mode */
+#define SW_HEADPHONE_INSERT    0x02  /* set = inserted */
+#define SW_RFKILL_ALL          0x03  /* rfkill master switch, type "any"
+                                        set = radio enabled */
+#define SW_RADIO               SW_RFKILL_ALL   /* deprecated */
+#define SW_MICROPHONE_INSERT   0x04  /* set = inserted */
+#define SW_DOCK                        0x05  /* set = plugged into dock */
+#define SW_LINEOUT_INSERT      0x06  /* set = inserted */
+#define SW_JACK_PHYSICAL_INSERT 0x07  /* set = mechanical switch set */
+#define SW_VIDEOOUT_INSERT     0x08  /* set = inserted */
+#define SW_CAMERA_LENS_COVER   0x09  /* set = lens covered */
+#define SW_KEYPAD_SLIDE                0x0a  /* set = keypad slide out */
+#define SW_FRONT_PROXIMITY     0x0b  /* set = front proximity sensor active */
+#define SW_ROTATE_LOCK         0x0c  /* set = rotate locked/disabled */
+#define SW_LINEIN_INSERT       0x0d  /* set = inserted */
+#define SW_MAX                 0x0f
+#define SW_CNT                 (SW_MAX+1)
+
+/*
+ * Misc events
+ */
+
+#define MSC_SERIAL             0x00
+#define MSC_PULSELED           0x01
+#define MSC_GESTURE            0x02
+#define MSC_RAW                        0x03
+#define MSC_SCAN               0x04
+#define MSC_MAX                        0x07
+#define MSC_CNT                        (MSC_MAX+1)
+
+/*
+ * LEDs
+ */
+
+#define LED_NUML               0x00
+#define LED_CAPSL              0x01
+#define LED_SCROLLL            0x02
+#define LED_COMPOSE            0x03
+#define LED_KANA               0x04
+#define LED_SLEEP              0x05
+#define LED_SUSPEND            0x06
+#define LED_MUTE               0x07
+#define LED_MISC               0x08
+#define LED_MAIL               0x09
+#define LED_CHARGING           0x0a
+#define LED_MAX                        0x0f
+#define LED_CNT                        (LED_MAX+1)
+
+/*
+ * Autorepeat values
+ */
+
+#define REP_DELAY              0x00
+#define REP_PERIOD             0x01
+#define REP_MAX                        0x01
+#define REP_CNT                        (REP_MAX+1)
+
+/*
+ * Sounds
+ */
+
+#define SND_CLICK              0x00
+#define SND_BELL               0x01
+#define SND_TONE               0x02
+#define SND_MAX                        0x07
+#define SND_CNT                        (SND_MAX+1)
+
+/*
+ * IDs.
+ */
+
+#define ID_BUS                 0
+#define ID_VENDOR              1
+#define ID_PRODUCT             2
+#define ID_VERSION             3
+
+#define BUS_PCI                        0x01
+#define BUS_ISAPNP             0x02
+#define BUS_USB                        0x03
+#define BUS_HIL                        0x04
+#define BUS_BLUETOOTH          0x05
+#define BUS_VIRTUAL            0x06
+
+#define BUS_ISA                        0x10
+#define BUS_I8042              0x11
+#define BUS_XTKBD              0x12
+#define BUS_RS232              0x13
+#define BUS_GAMEPORT           0x14
+#define BUS_PARPORT            0x15
+#define BUS_AMIGA              0x16
+#define BUS_ADB                        0x17
+#define BUS_I2C                        0x18
+#define BUS_HOST               0x19
+#define BUS_GSC                        0x1A
+#define BUS_ATARI              0x1B
+#define BUS_SPI                        0x1C
+
+/*
+ * MT_TOOL types
+ */
+#define MT_TOOL_FINGER         0
+#define MT_TOOL_PEN            1
+#define MT_TOOL_MAX            1
+
+/*
+ * Values describing the status of a force-feedback effect
+ */
+#define FF_STATUS_STOPPED      0x00
+#define FF_STATUS_PLAYING      0x01
+#define FF_STATUS_MAX          0x01
+
+/*
+ * Structures used in ioctls to upload effects to a device
+ * They are pieces of a bigger structure (called ff_effect)
+ */
+
+/*
+ * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
+ * should not be used and have unspecified results.
+ */
+
+/**
+ * struct ff_replay - defines scheduling of the force-feedback effect
+ * @length: duration of the effect
+ * @delay: delay before effect should start playing
+ */
+struct ff_replay {
+       __u16 length;
+       __u16 delay;
+};
+
+/**
+ * struct ff_trigger - defines what triggers the force-feedback effect
+ * @button: number of the button triggering the effect
+ * @interval: controls how soon the effect can be re-triggered
+ */
+struct ff_trigger {
+       __u16 button;
+       __u16 interval;
+};
+
+/**
+ * struct ff_envelope - generic force-feedback effect envelope
+ * @attack_length: duration of the attack (ms)
+ * @attack_level: level at the beginning of the attack
+ * @fade_length: duration of fade (ms)
+ * @fade_level: level at the end of fade
+ *
+ * The @attack_level and @fade_level are absolute values; when applying
+ * envelope force-feedback core will convert to positive/negative
+ * value based on polarity of the default level of the effect.
+ * Valid range for the attack and fade levels is 0x0000 - 0x7fff
+ */
+struct ff_envelope {
+       __u16 attack_length;
+       __u16 attack_level;
+       __u16 fade_length;
+       __u16 fade_level;
+};
+
+/**
+ * struct ff_constant_effect - defines parameters of a constant force-feedback effect
+ * @level: strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_constant_effect {
+       __s16 level;
+       struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
+ * @start_level: beginning strength of the effect; may be negative
+ * @end_level: final strength of the effect; may be negative
+ * @envelope: envelope data
+ */
+struct ff_ramp_effect {
+       __s16 start_level;
+       __s16 end_level;
+       struct ff_envelope envelope;
+};
+
+/**
+ * struct ff_condition_effect - defines a spring or friction force-feedback effect
+ * @right_saturation: maximum level when joystick moved all way to the right
+ * @left_saturation: same for the left side
+ * @right_coeff: controls how fast the force grows when the joystick moves
+ *     to the right
+ * @left_coeff: same for the left side
+ * @deadband: size of the dead zone, where no force is produced
+ * @center: position of the dead zone
+ */
+struct ff_condition_effect {
+       __u16 right_saturation;
+       __u16 left_saturation;
+
+       __s16 right_coeff;
+       __s16 left_coeff;
+
+       __u16 deadband;
+       __s16 center;
+};
+
+/**
+ * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
+ * @waveform: kind of the effect (wave)
+ * @period: period of the wave (ms)
+ * @magnitude: peak value
+ * @offset: mean value of the wave (roughly)
+ * @phase: 'horizontal' shift
+ * @envelope: envelope data
+ * @custom_len: number of samples (FF_CUSTOM only)
+ * @custom_data: buffer of samples (FF_CUSTOM only)
+ *
+ * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
+ * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
+ * for the time being as no driver supports it yet.
+ *
+ * Note: the data pointed by custom_data is copied by the driver.
+ * You can therefore dispose of the memory after the upload/update.
+ */
+struct ff_periodic_effect {
+       __u16 waveform;
+       __u16 period;
+       __s16 magnitude;
+       __s16 offset;
+       __u16 phase;
+
+       struct ff_envelope envelope;
+
+       __u32 custom_len;
+       __s16 __user *custom_data;
+};
+
+/**
+ * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
+ * @strong_magnitude: magnitude of the heavy motor
+ * @weak_magnitude: magnitude of the light one
+ *
+ * Some rumble pads have two motors of different weight. Strong_magnitude
+ * represents the magnitude of the vibration generated by the heavy one.
+ */
+struct ff_rumble_effect {
+       __u16 strong_magnitude;
+       __u16 weak_magnitude;
+};
+
+/**
+ * struct ff_effect - defines force feedback effect
+ * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
+ *     FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
+ * @id: an unique id assigned to an effect
+ * @direction: direction of the effect
+ * @trigger: trigger conditions (struct ff_trigger)
+ * @replay: scheduling of the effect (struct ff_replay)
+ * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
+ *     ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
+ *     defining effect parameters
+ *
+ * This structure is sent through ioctl from the application to the driver.
+ * To create a new effect application should set its @id to -1; the kernel
+ * will return assigned @id which can later be used to update or delete
+ * this effect.
+ *
+ * Direction of the effect is encoded as follows:
+ *     0 deg -> 0x0000 (down)
+ *     90 deg -> 0x4000 (left)
+ *     180 deg -> 0x8000 (up)
+ *     270 deg -> 0xC000 (right)
+ */
+struct ff_effect {
+       __u16 type;
+       __s16 id;
+       __u16 direction;
+       struct ff_trigger trigger;
+       struct ff_replay replay;
+
+       union {
+               struct ff_constant_effect constant;
+               struct ff_ramp_effect ramp;
+               struct ff_periodic_effect periodic;
+               struct ff_condition_effect condition[2]; /* One for each axis */
+               struct ff_rumble_effect rumble;
+       } u;
+};
+
+/*
+ * Force feedback effect types
+ */
+
+#define FF_RUMBLE      0x50
+#define FF_PERIODIC    0x51
+#define FF_CONSTANT    0x52
+#define FF_SPRING      0x53
+#define FF_FRICTION    0x54
+#define FF_DAMPER      0x55
+#define FF_INERTIA     0x56
+#define FF_RAMP                0x57
+
+#define FF_EFFECT_MIN  FF_RUMBLE
+#define FF_EFFECT_MAX  FF_RAMP
+
+/*
+ * Force feedback periodic effect types
+ */
+
+#define FF_SQUARE      0x58
+#define FF_TRIANGLE    0x59
+#define FF_SINE                0x5a
+#define FF_SAW_UP      0x5b
+#define FF_SAW_DOWN    0x5c
+#define FF_CUSTOM      0x5d
+
+#define FF_WAVEFORM_MIN        FF_SQUARE
+#define FF_WAVEFORM_MAX        FF_CUSTOM
+
+/*
+ * Set ff device properties
+ */
+
+#define FF_GAIN                0x60
+#define FF_AUTOCENTER  0x61
+
+#define FF_MAX         0x7f
+#define FF_CNT         (FF_MAX+1)
+
+#endif /* _UAPI_INPUT_H */
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
new file mode 100644 (file)
index 0000000..6cf06bf
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions for the IP protocol.
+ *
+ * Version:    @(#)ip.h        1.0.2   04/28/93
+ *
+ * Authors:    Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_IP_H
+#define _UAPI_LINUX_IP_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#define IPTOS_TOS_MASK         0x1E
+#define IPTOS_TOS(tos)         ((tos)&IPTOS_TOS_MASK)
+#define        IPTOS_LOWDELAY          0x10
+#define        IPTOS_THROUGHPUT        0x08
+#define        IPTOS_RELIABILITY       0x04
+#define        IPTOS_MINCOST           0x02
+
+#define IPTOS_PREC_MASK                0xE0
+#define IPTOS_PREC(tos)                ((tos)&IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL           0xe0
+#define IPTOS_PREC_INTERNETCONTROL      0xc0
+#define IPTOS_PREC_CRITIC_ECP           0xa0
+#define IPTOS_PREC_FLASHOVERRIDE        0x80
+#define IPTOS_PREC_FLASH                0x60
+#define IPTOS_PREC_IMMEDIATE            0x40
+#define IPTOS_PREC_PRIORITY             0x20
+#define IPTOS_PREC_ROUTINE              0x00
+
+
+/* IP options */
+#define IPOPT_COPY             0x80
+#define IPOPT_CLASS_MASK       0x60
+#define IPOPT_NUMBER_MASK      0x1f
+
+#define        IPOPT_COPIED(o)         ((o)&IPOPT_COPY)
+#define        IPOPT_CLASS(o)          ((o)&IPOPT_CLASS_MASK)
+#define        IPOPT_NUMBER(o)         ((o)&IPOPT_NUMBER_MASK)
+
+#define        IPOPT_CONTROL           0x00
+#define        IPOPT_RESERVED1         0x20
+#define        IPOPT_MEASUREMENT       0x40
+#define        IPOPT_RESERVED2         0x60
+
+#define IPOPT_END      (0 |IPOPT_CONTROL)
+#define IPOPT_NOOP     (1 |IPOPT_CONTROL)
+#define IPOPT_SEC      (2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_LSRR     (3 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP        (4 |IPOPT_MEASUREMENT)
+#define IPOPT_CIPSO    (6 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RR       (7 |IPOPT_CONTROL)
+#define IPOPT_SID      (8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_SSRR     (9 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA       (20|IPOPT_CONTROL|IPOPT_COPY)
+
+#define IPVERSION      4
+#define MAXTTL         255
+#define IPDEFTTL       64
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN   1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS  IPOPT_TIMESTAMP
+
+#define        IPOPT_TS_TSONLY         0               /* timestamps only */
+#define        IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
+#define        IPOPT_TS_PRESPEC        3               /* specified modules only */
+
+#define IPV4_BEET_PHMAXLEN 8
+
+struct iphdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8    ihl:4,
+               version:4;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+       __u8    version:4,
+               ihl:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+       __u8    tos;
+       __be16  tot_len;
+       __be16  id;
+       __be16  frag_off;
+       __u8    ttl;
+       __u8    protocol;
+       __sum16 check;
+       __be32  saddr;
+       __be32  daddr;
+       /*The options start here. */
+};
+
+
+struct ip_auth_hdr {
+       __u8  nexthdr;
+       __u8  hdrlen;           /* This one is measured in 32 bit units! */
+       __be16 reserved;
+       __be32 spi;
+       __be32 seq_no;          /* Sequence number */
+       __u8  auth_data[0];     /* Variable len but >=4. Mind the 64 bit alignment! */
+};
+
+struct ip_esp_hdr {
+       __be32 spi;
+       __be32 seq_no;          /* Sequence number */
+       __u8  enc_data[0];      /* Variable len but >=8. Mind the 64 bit alignment! */
+};
+
+struct ip_comp_hdr {
+       __u8 nexthdr;
+       __u8 flags;
+       __be16 cpi;
+};
+
+struct ip_beet_phdr {
+       __u8 nexthdr;
+       __u8 hdrlen;
+       __u8 padlen;
+       __u8 reserved;
+};
+
+#endif /* _UAPI_LINUX_IP_H */
diff --git a/include/uapi/linux/ipc.h b/include/uapi/linux/ipc.h
new file mode 100644 (file)
index 0000000..de08dd4
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef _UAPI_LINUX_IPC_H
+#define _UAPI_LINUX_IPC_H
+
+#include <linux/types.h>
+
+#define IPC_PRIVATE ((__kernel_key_t) 0)  
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct ipc_perm
+{
+       __kernel_key_t  key;
+       __kernel_uid_t  uid;
+       __kernel_gid_t  gid;
+       __kernel_uid_t  cuid;
+       __kernel_gid_t  cgid;
+       __kernel_mode_t mode; 
+       unsigned short  seq;
+};
+
+/* Include the definition of ipc64_perm */
+#include <asm/ipcbuf.h>
+
+/* resource get request flags */
+#define IPC_CREAT  00001000   /* create if key is nonexistent */
+#define IPC_EXCL   00002000   /* fail if key exists */
+#define IPC_NOWAIT 00004000   /* return error on wait */
+
+/* these fields are used by the DIPC package so the kernel as standard
+   should avoid using them if possible */
+   
+#define IPC_DIPC 00010000  /* make it distributed */
+#define IPC_OWN  00020000  /* this machine is the DIPC owner */
+
+/* 
+ * Control commands used with semctl, msgctl and shmctl 
+ * see also specific commands in sem.h, msg.h and shm.h
+ */
+#define IPC_RMID 0     /* remove resource */
+#define IPC_SET  1     /* set ipc_perm options */
+#define IPC_STAT 2     /* get ipc_perm options */
+#define IPC_INFO 3     /* see ipcs */
+
+/*
+ * Version flags for semctl, msgctl, and shmctl commands
+ * These are passed as bitflags or-ed with the actual command
+ */
+#define IPC_OLD 0      /* Old version (no 32-bit UID support on many
+                          architectures) */
+#define IPC_64  0x0100  /* New version (support 32-bit UIDs, bigger
+                          message sizes, etc. */
+
+/*
+ * These are used to wrap system calls.
+ *
+ * See architecture code for ugly details..
+ */
+struct ipc_kludge {
+       struct msgbuf __user *msgp;
+       long msgtyp;
+};
+
+#define SEMOP           1
+#define SEMGET          2
+#define SEMCTL          3
+#define SEMTIMEDOP      4
+#define MSGSND         11
+#define MSGRCV         12
+#define MSGGET         13
+#define MSGCTL         14
+#define SHMAT          21
+#define SHMDT          22
+#define SHMGET         23
+#define SHMCTL         24
+
+/* Used by the DIPC package, try and avoid reusing it */
+#define DIPC            25
+
+#define IPCCALL(version,op)    ((version)<<16 | (op))
+
+
+#endif /* _UAPI_LINUX_IPC_H */
diff --git a/include/uapi/linux/ipmi.h b/include/uapi/linux/ipmi.h
new file mode 100644 (file)
index 0000000..33fbc99
--- /dev/null
@@ -0,0 +1,456 @@
+/*
+ * ipmi.h
+ *
+ * MontaVista IPMI interface
+ *
+ * Author: MontaVista Software, Inc.
+ *         Corey Minyard <minyard@mvista.com>
+ *         source@mvista.com
+ *
+ * Copyright 2002 MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License as published by the
+ *  Free Software Foundation; either version 2 of the License, or (at your
+ *  option) any later version.
+ *
+ *
+ *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _UAPI__LINUX_IPMI_H
+#define _UAPI__LINUX_IPMI_H
+
+#include <linux/ipmi_msgdefs.h>
+#include <linux/compiler.h>
+
+/*
+ * This file describes an interface to an IPMI driver.  You have to
+ * have a fairly good understanding of IPMI to use this, so go read
+ * the specs first before actually trying to do anything.
+ *
+ * With that said, this driver provides a multi-user interface to the
+ * IPMI driver, and it allows multiple IPMI physical interfaces below
+ * the driver.  The physical interfaces bind as a lower layer on the
+ * driver.  They appear as interfaces to the application using this
+ * interface.
+ *
+ * Multi-user means that multiple applications may use the driver,
+ * send commands, receive responses, etc.  The driver keeps track of
+ * commands the user sends and tracks the responses.  The responses
+ * will go back to the application that send the command.  If the
+ * response doesn't come back in time, the driver will return a
+ * timeout error response to the application.  Asynchronous events
+ * from the BMC event queue will go to all users bound to the driver.
+ * The incoming event queue in the BMC will automatically be flushed
+ * if it becomes full and it is queried once a second to see if
+ * anything is in it.  Incoming commands to the driver will get
+ * delivered as commands.
+ *
+ * This driver provides two main interfaces: one for in-kernel
+ * applications and another for userland applications.  The
+ * capabilities are basically the same for both interface, although
+ * the interfaces are somewhat different.  The stuff in the
+ * #ifdef __KERNEL__ below is the in-kernel interface.  The userland
+ * interface is defined later in the file.  */
+
+
+
+/*
+ * This is an overlay for all the address types, so it's easy to
+ * determine the actual address type.  This is kind of like addresses
+ * work for sockets.
+ */
+#define IPMI_MAX_ADDR_SIZE 32
+struct ipmi_addr {
+        /* Try to take these from the "Channel Medium Type" table
+           in section 6.5 of the IPMI 1.5 manual. */
+       int   addr_type;
+       short channel;
+       char  data[IPMI_MAX_ADDR_SIZE];
+};
+
+/*
+ * When the address is not used, the type will be set to this value.
+ * The channel is the BMC's channel number for the channel (usually
+ * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
+ */
+#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE        0x0c
+struct ipmi_system_interface_addr {
+       int           addr_type;
+       short         channel;
+       unsigned char lun;
+};
+
+/* An IPMB Address. */
+#define IPMI_IPMB_ADDR_TYPE            0x01
+/* Used for broadcast get device id as described in section 17.9 of the
+   IPMI 1.5 manual. */
+#define IPMI_IPMB_BROADCAST_ADDR_TYPE  0x41
+struct ipmi_ipmb_addr {
+       int           addr_type;
+       short         channel;
+       unsigned char slave_addr;
+       unsigned char lun;
+};
+
+/*
+ * A LAN Address.  This is an address to/from a LAN interface bridged
+ * by the BMC, not an address actually out on the LAN.
+ *
+ * A conscious decision was made here to deviate slightly from the IPMI
+ * spec.  We do not use rqSWID and rsSWID like it shows in the
+ * message.  Instead, we use remote_SWID and local_SWID.  This means
+ * that any message (a request or response) from another device will
+ * always have exactly the same address.  If you didn't do this,
+ * requests and responses from the same device would have different
+ * addresses, and that's not too cool.
+ *
+ * In this address, the remote_SWID is always the SWID the remote
+ * message came from, or the SWID we are sending the message to.
+ * local_SWID is always our SWID.  Note that having our SWID in the
+ * message is a little weird, but this is required.
+ */
+#define IPMI_LAN_ADDR_TYPE             0x04
+struct ipmi_lan_addr {
+       int           addr_type;
+       short         channel;
+       unsigned char privilege;
+       unsigned char session_handle;
+       unsigned char remote_SWID;
+       unsigned char local_SWID;
+       unsigned char lun;
+};
+
+
+/*
+ * Channel for talking directly with the BMC.  When using this
+ * channel, This is for the system interface address type only.  FIXME
+ * - is this right, or should we use -1?
+ */
+#define IPMI_BMC_CHANNEL  0xf
+#define IPMI_NUM_CHANNELS 0x10
+
+/*
+ * Used to signify an "all channel" bitmask.  This is more than the
+ * actual number of channels because this is used in userland and
+ * will cover us if the number of channels is extended.
+ */
+#define IPMI_CHAN_ALL     (~0)
+
+
+/*
+ * A raw IPMI message without any addressing.  This covers both
+ * commands and responses.  The completion code is always the first
+ * byte of data in the response (as the spec shows the messages laid
+ * out).
+ */
+struct ipmi_msg {
+       unsigned char  netfn;
+       unsigned char  cmd;
+       unsigned short data_len;
+       unsigned char  __user *data;
+};
+
+struct kernel_ipmi_msg {
+       unsigned char  netfn;
+       unsigned char  cmd;
+       unsigned short data_len;
+       unsigned char  *data;
+};
+
+/*
+ * Various defines that are useful for IPMI applications.
+ */
+#define IPMI_INVALID_CMD_COMPLETION_CODE       0xC1
+#define IPMI_TIMEOUT_COMPLETION_CODE           0xC3
+#define IPMI_UNKNOWN_ERR_COMPLETION_CODE       0xff
+
+
+/*
+ * Receive types for messages coming from the receive interface.  This
+ * is used for the receive in-kernel interface and in the receive
+ * IOCTL.
+ *
+ * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
+ * it allows you to get the message results when you send a response
+ * message.
+ */
+#define IPMI_RESPONSE_RECV_TYPE                1 /* A response to a command */
+#define IPMI_ASYNC_EVENT_RECV_TYPE     2 /* Something from the event queue */
+#define IPMI_CMD_RECV_TYPE             3 /* A command from somewhere else */
+#define IPMI_RESPONSE_RESPONSE_TYPE    4 /* The response for
+                                             a sent response, giving any
+                                             error status for sending the
+                                             response.  When you send a
+                                             response message, this will
+                                             be returned. */
+#define IPMI_OEM_RECV_TYPE             5 /* The response for OEM Channels */
+
+/* Note that async events and received commands do not have a completion
+   code as the first byte of the incoming data, unlike a response. */
+
+
+/*
+ * Modes for ipmi_set_maint_mode() and the userland IOCTL.  The AUTO
+ * setting is the default and means it will be set on certain
+ * commands.  Hard setting it on and off will override automatic
+ * operation.
+ */
+#define IPMI_MAINTENANCE_MODE_AUTO     0
+#define IPMI_MAINTENANCE_MODE_OFF      1
+#define IPMI_MAINTENANCE_MODE_ON       2
+
+
+
+/*
+ * The userland interface
+ */
+
+/*
+ * The userland interface for the IPMI driver is a standard character
+ * device, with each instance of an interface registered as a minor
+ * number under the major character device.
+ *
+ * The read and write calls do not work, to get messages in and out
+ * requires ioctl calls because of the complexity of the data.  select
+ * and poll do work, so you can wait for input using the file
+ * descriptor, you just can use read to get it.
+ *
+ * In general, you send a command down to the interface and receive
+ * responses back.  You can use the msgid value to correlate commands
+ * and responses, the driver will take care of figuring out which
+ * incoming messages are for which command and find the proper msgid
+ * value to report.  You will only receive reponses for commands you
+ * send.  Asynchronous events, however, go to all open users, so you
+ * must be ready to handle these (or ignore them if you don't care).
+ *
+ * The address type depends upon the channel type.  When talking
+ * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
+ * (IPMI_UNUSED_ADDR_TYPE).  When talking to an IPMB channel, you must
+ * supply a valid IPMB address with the addr_type set properly.
+ *
+ * When talking to normal channels, the driver takes care of the
+ * details of formatting and sending messages on that channel.  You do
+ * not, for instance, have to format a send command, you just send
+ * whatever command you want to the channel, the driver will create
+ * the send command, automatically issue receive command and get even
+ * commands, and pass those up to the proper user.
+ */
+
+
+/* The magic IOCTL value for this interface. */
+#define IPMI_IOC_MAGIC 'i'
+
+
+/* Messages sent to the interface are this format. */
+struct ipmi_req {
+       unsigned char __user *addr; /* Address to send the message to. */
+       unsigned int  addr_len;
+
+       long    msgid; /* The sequence number for the message.  This
+                         exact value will be reported back in the
+                         response to this request if it is a command.
+                         If it is a response, this will be used as
+                         the sequence value for the response.  */
+
+       struct ipmi_msg msg;
+};
+/*
+ * Send a message to the interfaces.  error values are:
+ *   - EFAULT - an address supplied was invalid.
+ *   - EINVAL - The address supplied was not valid, or the command
+ *              was not allowed.
+ *   - EMSGSIZE - The message to was too large.
+ *   - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND           _IOR(IPMI_IOC_MAGIC, 13,        \
+                                            struct ipmi_req)
+
+/* Messages sent to the interface with timing parameters are this
+   format. */
+struct ipmi_req_settime {
+       struct ipmi_req req;
+
+       /* See ipmi_request_settime() above for details on these
+          values. */
+       int          retries;
+       unsigned int retry_time_ms;
+};
+/*
+ * Send a message to the interfaces with timing parameters.  error values
+ * are:
+ *   - EFAULT - an address supplied was invalid.
+ *   - EINVAL - The address supplied was not valid, or the command
+ *              was not allowed.
+ *   - EMSGSIZE - The message to was too large.
+ *   - ENOMEM - Buffers could not be allocated for the command.
+ */
+#define IPMICTL_SEND_COMMAND_SETTIME   _IOR(IPMI_IOC_MAGIC, 21,        \
+                                            struct ipmi_req_settime)
+
+/* Messages received from the interface are this format. */
+struct ipmi_recv {
+       int     recv_type; /* Is this a command, response or an
+                             asyncronous event. */
+
+       unsigned char __user *addr;    /* Address the message was from is put
+                                  here.  The caller must supply the
+                                  memory. */
+       unsigned int  addr_len; /* The size of the address buffer.
+                                  The caller supplies the full buffer
+                                  length, this value is updated to
+                                  the actual message length when the
+                                  message is received. */
+
+       long    msgid; /* The sequence number specified in the request
+                         if this is a response.  If this is a command,
+                         this will be the sequence number from the
+                         command. */
+
+       struct ipmi_msg msg; /* The data field must point to a buffer.
+                               The data_size field must be set to the
+                               size of the message buffer.  The
+                               caller supplies the full buffer
+                               length, this value is updated to the
+                               actual message length when the message
+                               is received. */
+};
+
+/*
+ * Receive a message.  error values:
+ *  - EAGAIN - no messages in the queue.
+ *  - EFAULT - an address supplied was invalid.
+ *  - EINVAL - The address supplied was not valid.
+ *  - EMSGSIZE - The message to was too large to fit into the message buffer,
+ *               the message will be left in the buffer. */
+#define IPMICTL_RECEIVE_MSG            _IOWR(IPMI_IOC_MAGIC, 12,       \
+                                             struct ipmi_recv)
+
+/*
+ * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
+ * will truncate the contents instead of leaving the data in the
+ * buffer.
+ */
+#define IPMICTL_RECEIVE_MSG_TRUNC      _IOWR(IPMI_IOC_MAGIC, 11,       \
+                                             struct ipmi_recv)
+
+/* Register to get commands from other entities on this interface. */
+struct ipmi_cmdspec {
+       unsigned char netfn;
+       unsigned char cmd;
+};
+
+/*
+ * Register to receive a specific command.  error values:
+ *   - EFAULT - an address supplied was invalid.
+ *   - EBUSY - The netfn/cmd supplied was already in use.
+ *   - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD       _IOR(IPMI_IOC_MAGIC, 14,        \
+                                            struct ipmi_cmdspec)
+/*
+ * Unregister a regsitered command.  error values:
+ *  - EFAULT - an address supplied was invalid.
+ *  - ENOENT - The netfn/cmd was not found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD     _IOR(IPMI_IOC_MAGIC, 15,        \
+                                            struct ipmi_cmdspec)
+
+/*
+ * Register to get commands from other entities on specific channels.
+ * This way, you can only listen on specific channels, or have messages
+ * from some channels go to one place and other channels to someplace
+ * else.  The chans field is a bitmask, (1 << channel) for each channel.
+ * It may be IPMI_CHAN_ALL for all channels.
+ */
+struct ipmi_cmdspec_chans {
+       unsigned int netfn;
+       unsigned int cmd;
+       unsigned int chans;
+};
+
+/*
+ * Register to receive a specific command on specific channels.  error values:
+ *   - EFAULT - an address supplied was invalid.
+ *   - EBUSY - One of the netfn/cmd/chans supplied was already in use.
+ *   - ENOMEM - could not allocate memory for the entry.
+ */
+#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28,        \
+                                            struct ipmi_cmdspec_chans)
+/*
+ * Unregister some netfn/cmd/chans.  error values:
+ *  - EFAULT - an address supplied was invalid.
+ *  - ENOENT - None of the netfn/cmd/chans were found registered for this user.
+ */
+#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29,      \
+                                            struct ipmi_cmdspec_chans)
+
+/*
+ * Set whether this interface receives events.  Note that the first
+ * user registered for events will get all pending events for the
+ * interface.  error values:
+ *  - EFAULT - an address supplied was invalid.
+ */
+#define IPMICTL_SET_GETS_EVENTS_CMD    _IOR(IPMI_IOC_MAGIC, 16, int)
+
+/*
+ * Set and get the slave address and LUN that we will use for our
+ * source messages.  Note that this affects the interface, not just
+ * this user, so it will affect all users of this interface.  This is
+ * so some initialization code can come in and do the OEM-specific
+ * things it takes to determine your address (if not the BMC) and set
+ * it for everyone else.  You should probably leave the LUN alone.
+ */
+struct ipmi_channel_lun_address_set {
+       unsigned short channel;
+       unsigned char  value;
+};
+#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
+       _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
+       _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
+#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
+       _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
+#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
+       _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
+/* Legacy interfaces, these only set IPMB 0. */
+#define IPMICTL_SET_MY_ADDRESS_CMD     _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
+#define IPMICTL_GET_MY_ADDRESS_CMD     _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
+#define IPMICTL_SET_MY_LUN_CMD         _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
+#define IPMICTL_GET_MY_LUN_CMD         _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
+
+/*
+ * Get/set the default timing values for an interface.  You shouldn't
+ * generally mess with these.
+ */
+struct ipmi_timing_parms {
+       int          retries;
+       unsigned int retry_time_ms;
+};
+#define IPMICTL_SET_TIMING_PARMS_CMD   _IOR(IPMI_IOC_MAGIC, 22, \
+                                            struct ipmi_timing_parms)
+#define IPMICTL_GET_TIMING_PARMS_CMD   _IOR(IPMI_IOC_MAGIC, 23, \
+                                            struct ipmi_timing_parms)
+
+/*
+ * Set the maintenance mode.  See ipmi_set_maintenance_mode() above
+ * for a description of what this does.
+ */
+#define IPMICTL_GET_MAINTENANCE_MODE_CMD       _IOR(IPMI_IOC_MAGIC, 30, int)
+#define IPMICTL_SET_MAINTENANCE_MODE_CMD       _IOW(IPMI_IOC_MAGIC, 31, int)
+
+#endif /* _UAPI__LINUX_IPMI_H */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
new file mode 100644 (file)
index 0000000..a6d7d1c
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef _UAPI_IPV6_H
+#define _UAPI_IPV6_H
+
+#include <linux/types.h>
+#include <linux/in6.h>
+#include <asm/byteorder.h>
+
+/* The latest drafts declared increase in minimal mtu up to 1280. */
+
+#define IPV6_MIN_MTU   1280
+
+/*
+ *     Advanced API
+ *     source interface/address selection, source routing, etc...
+ *     *under construction*
+ */
+
+
+struct in6_pktinfo {
+       struct in6_addr ipi6_addr;
+       int             ipi6_ifindex;
+};
+
+struct ip6_mtuinfo {
+       struct sockaddr_in6     ip6m_addr;
+       __u32                   ip6m_mtu;
+};
+
+struct in6_ifreq {
+       struct in6_addr ifr6_addr;
+       __u32           ifr6_prefixlen;
+       int             ifr6_ifindex; 
+};
+
+#define IPV6_SRCRT_STRICT      0x01    /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_0      0       /* Deprecated; will be removed */
+#define IPV6_SRCRT_TYPE_2      2       /* IPv6 type 2 Routing Header   */
+
+/*
+ *     routing header
+ */
+struct ipv6_rt_hdr {
+       __u8            nexthdr;
+       __u8            hdrlen;
+       __u8            type;
+       __u8            segments_left;
+
+       /*
+        *      type specific data
+        *      variable length field
+        */
+};
+
+
+struct ipv6_opt_hdr {
+       __u8            nexthdr;
+       __u8            hdrlen;
+       /* 
+        * TLV encoded option data follows.
+        */
+} __attribute__((packed));     /* required for some archs */
+
+#define ipv6_destopt_hdr ipv6_opt_hdr
+#define ipv6_hopopt_hdr  ipv6_opt_hdr
+
+
+/*
+ *     routing header type 0 (used in cmsghdr struct)
+ */
+
+struct rt0_hdr {
+       struct ipv6_rt_hdr      rt_hdr;
+       __u32                   reserved;
+       struct in6_addr         addr[0];
+
+#define rt0_type               rt_hdr.type
+};
+
+/*
+ *     routing header type 2
+ */
+
+struct rt2_hdr {
+       struct ipv6_rt_hdr      rt_hdr;
+       __u32                   reserved;
+       struct in6_addr         addr;
+
+#define rt2_type               rt_hdr.type
+};
+
+/*
+ *     home address option in destination options header
+ */
+
+struct ipv6_destopt_hao {
+       __u8                    type;
+       __u8                    length;
+       struct in6_addr         addr;
+} __attribute__((packed));
+
+/*
+ *     IPv6 fixed header
+ *
+ *     BEWARE, it is incorrect. The first 4 bits of flow_lbl
+ *     are glued to priority now, forming "class".
+ */
+
+struct ipv6hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u8                    priority:4,
+                               version:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u8                    version:4,
+                               priority:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+       __u8                    flow_lbl[3];
+
+       __be16                  payload_len;
+       __u8                    nexthdr;
+       __u8                    hop_limit;
+
+       struct  in6_addr        saddr;
+       struct  in6_addr        daddr;
+};
+
+
+/* index values for the variables in ipv6_devconf */
+enum {
+       DEVCONF_FORWARDING = 0,
+       DEVCONF_HOPLIMIT,
+       DEVCONF_MTU6,
+       DEVCONF_ACCEPT_RA,
+       DEVCONF_ACCEPT_REDIRECTS,
+       DEVCONF_AUTOCONF,
+       DEVCONF_DAD_TRANSMITS,
+       DEVCONF_RTR_SOLICITS,
+       DEVCONF_RTR_SOLICIT_INTERVAL,
+       DEVCONF_RTR_SOLICIT_DELAY,
+       DEVCONF_USE_TEMPADDR,
+       DEVCONF_TEMP_VALID_LFT,
+       DEVCONF_TEMP_PREFERED_LFT,
+       DEVCONF_REGEN_MAX_RETRY,
+       DEVCONF_MAX_DESYNC_FACTOR,
+       DEVCONF_MAX_ADDRESSES,
+       DEVCONF_FORCE_MLD_VERSION,
+       DEVCONF_ACCEPT_RA_DEFRTR,
+       DEVCONF_ACCEPT_RA_PINFO,
+       DEVCONF_ACCEPT_RA_RTR_PREF,
+       DEVCONF_RTR_PROBE_INTERVAL,
+       DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
+       DEVCONF_PROXY_NDP,
+       DEVCONF_OPTIMISTIC_DAD,
+       DEVCONF_ACCEPT_SOURCE_ROUTE,
+       DEVCONF_MC_FORWARDING,
+       DEVCONF_DISABLE_IPV6,
+       DEVCONF_ACCEPT_DAD,
+       DEVCONF_FORCE_TLLAO,
+       DEVCONF_MAX
+};
+
+
+#endif /* _UAPI_IPV6_H */
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h
new file mode 100644 (file)
index 0000000..0459664
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *     Linux INET6 implementation 
+ *
+ *     Authors:
+ *     Pedro Roque             <roque@di.fc.ul.pt>     
+ *
+ *     This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPI_LINUX_IPV6_ROUTE_H
+#define _UAPI_LINUX_IPV6_ROUTE_H
+
+#include <linux/types.h>
+
+#define RTF_DEFAULT    0x00010000      /* default - learned via ND     */
+#define RTF_ALLONLINK  0x00020000      /* (deprecated and will be removed)
+                                          fallback, no routers on link */
+#define RTF_ADDRCONF   0x00040000      /* addrconf route - RA          */
+#define RTF_PREFIX_RT  0x00080000      /* A prefix only route - RA     */
+#define RTF_ANYCAST    0x00100000      /* Anycast                      */
+
+#define RTF_NONEXTHOP  0x00200000      /* route with no nexthop        */
+#define RTF_EXPIRES    0x00400000
+
+#define RTF_ROUTEINFO  0x00800000      /* route information - RA       */
+
+#define RTF_CACHE      0x01000000      /* cache entry                  */
+#define RTF_FLOW       0x02000000      /* flow significant route       */
+#define RTF_POLICY     0x04000000      /* policy route                 */
+
+#define RTF_PREF(pref) ((pref) << 27)
+#define RTF_PREF_MASK  0x18000000
+
+#define RTF_LOCAL      0x80000000
+
+
+struct in6_rtmsg {
+       struct in6_addr         rtmsg_dst;
+       struct in6_addr         rtmsg_src;
+       struct in6_addr         rtmsg_gateway;
+       __u32                   rtmsg_type;
+       __u16                   rtmsg_dst_len;
+       __u16                   rtmsg_src_len;
+       __u32                   rtmsg_metric;
+       unsigned long           rtmsg_info;
+        __u32                  rtmsg_flags;
+       int                     rtmsg_ifindex;
+};
+
+#define RTMSG_NEWDEVICE                0x11
+#define RTMSG_DELDEVICE                0x12
+#define RTMSG_NEWROUTE         0x21
+#define RTMSG_DELROUTE         0x22
+
+#endif /* _UAPI_LINUX_IPV6_ROUTE_H */
similarity index 100%
rename from include/linux/ipx.h
rename to include/uapi/linux/ipx.h
diff --git a/include/uapi/linux/irqnr.h b/include/uapi/linux/irqnr.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/include/uapi/linux/isdn.h b/include/uapi/linux/isdn.h
new file mode 100644 (file)
index 0000000..eb1995f
--- /dev/null
@@ -0,0 +1,143 @@
+/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
+ *
+ * Main header for the Linux ISDN subsystem (linklevel).
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96    by Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96    by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ * 
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _UAPI__ISDN_H__
+#define _UAPI__ISDN_H__
+
+#include <linux/ioctl.h>
+#include <linux/tty.h>
+
+#define ISDN_MAX_DRIVERS    32
+#define ISDN_MAX_CHANNELS   64
+
+/* New ioctl-codes */
+#define IIOCNETAIF  _IO('I',1)
+#define IIOCNETDIF  _IO('I',2)
+#define IIOCNETSCF  _IO('I',3)
+#define IIOCNETGCF  _IO('I',4)
+#define IIOCNETANM  _IO('I',5)
+#define IIOCNETDNM  _IO('I',6)
+#define IIOCNETGNM  _IO('I',7)
+#define IIOCGETSET  _IO('I',8) /* no longer supported */
+#define IIOCSETSET  _IO('I',9) /* no longer supported */
+#define IIOCSETVER  _IO('I',10)
+#define IIOCNETHUP  _IO('I',11)
+#define IIOCSETGST  _IO('I',12)
+#define IIOCSETBRJ  _IO('I',13)
+#define IIOCSIGPRF  _IO('I',14)
+#define IIOCGETPRF  _IO('I',15)
+#define IIOCSETPRF  _IO('I',16)
+#define IIOCGETMAP  _IO('I',17)
+#define IIOCSETMAP  _IO('I',18)
+#define IIOCNETASL  _IO('I',19)
+#define IIOCNETDIL  _IO('I',20)
+#define IIOCGETCPS  _IO('I',21)
+#define IIOCGETDVR  _IO('I',22)
+#define IIOCNETLCR  _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
+#define IIOCNETDWRSET  _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
+
+#define IIOCNETALN  _IO('I',32)
+#define IIOCNETDLN  _IO('I',33)
+
+#define IIOCNETGPN  _IO('I',34)
+
+#define IIOCDBGVAR  _IO('I',127)
+
+#define IIOCDRVCTL  _IO('I',128)
+
+/* cisco hdlck device private ioctls */
+#define SIOCGKEEPPERIOD        (SIOCDEVPRIVATE + 0)
+#define SIOCSKEEPPERIOD        (SIOCDEVPRIVATE + 1)
+#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
+#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
+
+/* Packet encapsulations for net-interfaces */
+#define ISDN_NET_ENCAP_ETHER      0
+#define ISDN_NET_ENCAP_RAWIP      1
+#define ISDN_NET_ENCAP_IPTYP      2
+#define ISDN_NET_ENCAP_CISCOHDLC  3 /* Without SLARP and keepalive */
+#define ISDN_NET_ENCAP_SYNCPPP    4
+#define ISDN_NET_ENCAP_UIHDLC     5
+#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive    */
+#define ISDN_NET_ENCAP_X25IFACE   7 /* Documentation/networking/x25-iface.txt */
+#define ISDN_NET_ENCAP_MAX_ENCAP  ISDN_NET_ENCAP_X25IFACE
+
+/* Facility which currently uses an ISDN-channel */
+#define ISDN_USAGE_NONE       0
+#define ISDN_USAGE_RAW        1
+#define ISDN_USAGE_MODEM      2
+#define ISDN_USAGE_NET        3
+#define ISDN_USAGE_VOICE      4
+#define ISDN_USAGE_FAX        5
+#define ISDN_USAGE_MASK       7 /* Mask to get plain usage */
+#define ISDN_USAGE_DISABLED  32 /* This bit is set, if channel is disabled */
+#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
+#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing  */
+
+#define ISDN_MODEM_NUMREG    24        /* Number of Modem-Registers        */
+#define ISDN_LMSNLEN         255 /* Length of tty's Listen-MSN string */
+#define ISDN_CMSGLEN        50  /* Length of CONNECT-Message to add for Modem */
+
+#define ISDN_MSNLEN          32
+#define NET_DV 0x06  /* Data version for isdn_net_ioctl_cfg   */
+#define TTY_DV 0x06  /* Data version for iprofd etc.          */
+
+#define INF_DV 0x01  /* Data version for /dev/isdninfo        */
+
+typedef struct {
+  char drvid[25];
+  unsigned long arg;
+} isdn_ioctl_struct;
+
+typedef struct {
+  char name[10];
+  char phone[ISDN_MSNLEN];
+  int  outgoing;
+} isdn_net_ioctl_phone;
+
+typedef struct {
+  char name[10];     /* Name of interface                     */
+  char master[10];   /* Name of Master for Bundling           */
+  char slave[10];    /* Name of Slave for Bundling            */
+  char eaz[256];     /* EAZ/MSN                               */
+  char drvid[25];    /* DriverId for Bindings                 */
+  int  onhtime;      /* Hangup-Timeout                        */
+  int  charge;       /* Charge-Units                          */
+  int  l2_proto;     /* Layer-2 protocol                      */
+  int  l3_proto;     /* Layer-3 protocol                      */
+  int  p_encap;      /* Encapsulation                         */
+  int  exclusive;    /* Channel, if bound exclusive           */
+  int  dialmax;      /* Dial Retry-Counter                    */
+  int  slavedelay;   /* Delay until slave starts up           */
+  int  cbdelay;      /* Delay before Callback                 */
+  int  chargehup;    /* Flag: Charge-Hangup                   */
+  int  ihup;         /* Flag: Hangup-Timeout on incoming line */
+  int  secure;       /* Flag: Secure                          */
+  int  callback;     /* Flag: Callback                        */
+  int  cbhup;        /* Flag: Reject Call before Callback     */
+  int  pppbind;      /* ippp device for bindings              */
+  int  chargeint;    /* Use fixed charge interval length      */
+  int  triggercps;   /* BogoCPS needed for triggering slave   */
+  int  dialtimeout;  /* Dial-Timeout                          */
+  int  dialwait;     /* Time to wait after failed dial        */
+  int  dialmode;     /* Flag: off / on / auto                 */
+} isdn_net_ioctl_cfg;
+
+#define ISDN_NET_DIALMODE_MASK  0xC0    /* bits for status                */
+#define ISDN_NET_DM_OFF                0x00    /* this interface is stopped      */
+#define ISDN_NET_DM_MANUAL     0x40    /* this interface is on (manual)  */
+#define ISDN_NET_DM_AUTO       0x80    /* this interface is autodial     */
+#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
+
+
+#endif /* _UAPI__ISDN_H__ */
diff --git a/include/uapi/linux/isdn_divertif.h b/include/uapi/linux/isdn_divertif.h
new file mode 100644 (file)
index 0000000..3e3c2d8
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
+ *
+ * Header for the diversion supplementary interface for i4l.
+ *
+ * Author    Werner Cornelius (werner@titro.de)
+ * Copyright by Werner Cornelius (werner@titro.de)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _UAPI_LINUX_ISDN_DIVERTIF_H
+#define _UAPI_LINUX_ISDN_DIVERTIF_H
+
+/***********************************************************/
+/* magic value is also used to control version information */
+/***********************************************************/
+#define DIVERT_IF_MAGIC 0x25873401
+#define DIVERT_CMD_REG  0x00  /* register command */
+#define DIVERT_CMD_REL  0x01  /* release command */
+#define DIVERT_NO_ERR   0x00  /* return value no error */
+#define DIVERT_CMD_ERR  0x01  /* invalid cmd */
+#define DIVERT_VER_ERR  0x02  /* magic/version invalid */
+#define DIVERT_REG_ERR  0x03  /* module already registered */
+#define DIVERT_REL_ERR  0x04  /* module not registered */
+#define DIVERT_REG_NAME isdn_register_divert
+
+
+#endif /* _UAPI_LINUX_ISDN_DIVERTIF_H */
diff --git a/include/uapi/linux/isdn_ppp.h b/include/uapi/linux/isdn_ppp.h
new file mode 100644 (file)
index 0000000..e7d7bd2
--- /dev/null
@@ -0,0 +1,67 @@
+/* Linux ISDN subsystem, sync PPP, interface to ipppd
+ *
+ * Copyright 1994-1999  by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96    Thinking Objects Software GmbH Wuerzburg
+ * Copyright 1995,96    by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
+ * Copyright 2000-2002  by Kai Germaschewski (kai@germaschewski.name)
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _UAPI_LINUX_ISDN_PPP_H
+#define _UAPI_LINUX_ISDN_PPP_H
+
+#define CALLTYPE_INCOMING 0x1
+#define CALLTYPE_OUTGOING 0x2
+#define CALLTYPE_CALLBACK 0x4
+
+#define IPPP_VERSION    "2.2.0"
+
+struct pppcallinfo
+{
+  int calltype;
+  unsigned char local_num[64];
+  unsigned char remote_num[64];
+  int charge_units;
+};
+
+#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
+#define PPPIOCBUNDLE   _IOW('t',129,int)
+#define PPPIOCGMPFLAGS _IOR('t',130,int)
+#define PPPIOCSMPFLAGS _IOW('t',131,int)
+#define PPPIOCSMPMTU   _IOW('t',132,int)
+#define PPPIOCSMPMRU   _IOW('t',133,int)
+#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
+#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
+#define PPPIOCGIFNAME      _IOR('t',136, char [IFNAMSIZ] )
+
+
+#define SC_MP_PROT       0x00000200
+#define SC_REJ_MP_PROT   0x00000400
+#define SC_OUT_SHORT_SEQ 0x00000800
+#define SC_IN_SHORT_SEQ  0x00004000
+
+#define SC_DECOMP_ON           0x01
+#define SC_COMP_ON             0x02
+#define SC_DECOMP_DISCARD      0x04
+#define SC_COMP_DISCARD                0x08
+#define SC_LINK_DECOMP_ON      0x10
+#define SC_LINK_COMP_ON                0x20
+#define SC_LINK_DECOMP_DISCARD 0x40
+#define SC_LINK_COMP_DISCARD   0x80
+
+#define ISDN_PPP_COMP_MAX_OPTIONS 16
+
+#define IPPP_COMP_FLAG_XMIT 0x1
+#define IPPP_COMP_FLAG_LINK 0x2
+
+struct isdn_ppp_comp_data {
+  int num;
+  unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
+  int optlen;
+  int flags;
+};
+
+#endif /* _UAPI_LINUX_ISDN_PPP_H */
diff --git a/include/uapi/linux/isdnif.h b/include/uapi/linux/isdnif.h
new file mode 100644 (file)
index 0000000..246138c
--- /dev/null
@@ -0,0 +1,56 @@
+/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
+ *
+ * Linux ISDN subsystem
+ * Definition of the interface between the subsystem and its low-level drivers.
+ *
+ * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
+ * Copyright 1995,96    Thinking Objects Software GmbH Wuerzburg
+ * 
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ */
+
+#ifndef _UAPI__ISDNIF_H__
+#define _UAPI__ISDNIF_H__
+
+
+/*
+ * Values for general protocol-selection
+ */
+#define ISDN_PTYPE_UNKNOWN   0   /* Protocol undefined   */
+#define ISDN_PTYPE_1TR6      1   /* german 1TR6-protocol */
+#define ISDN_PTYPE_EURO      2   /* EDSS1-protocol       */
+#define ISDN_PTYPE_LEASED    3   /* for leased lines     */
+#define ISDN_PTYPE_NI1       4   /* US NI-1 protocol     */
+#define ISDN_PTYPE_MAX       7   /* Max. 8 Protocols     */
+
+/*
+ * Values for Layer-2-protocol-selection
+ */
+#define ISDN_PROTO_L2_X75I   0   /* X75/LAPB with I-Frames            */
+#define ISDN_PROTO_L2_X75UI  1   /* X75/LAPB with UI-Frames           */
+#define ISDN_PROTO_L2_X75BUI 2   /* X75/LAPB with UI-Frames           */
+#define ISDN_PROTO_L2_HDLC   3   /* HDLC                              */
+#define ISDN_PROTO_L2_TRANS  4   /* Transparent (Voice)               */
+#define ISDN_PROTO_L2_X25DTE 5   /* X25/LAPB DTE mode                 */
+#define ISDN_PROTO_L2_X25DCE 6   /* X25/LAPB DCE mode                 */
+#define ISDN_PROTO_L2_V11096 7   /* V.110 bitrate adaption 9600 Baud  */
+#define ISDN_PROTO_L2_V11019 8   /* V.110 bitrate adaption 19200 Baud */
+#define ISDN_PROTO_L2_V11038 9   /* V.110 bitrate adaption 38400 Baud */
+#define ISDN_PROTO_L2_MODEM  10  /* Analog Modem on Board */
+#define ISDN_PROTO_L2_FAX    11  /* Fax Group 2/3         */
+#define ISDN_PROTO_L2_HDLC_56K 12   /* HDLC 56k                          */
+#define ISDN_PROTO_L2_MAX    15  /* Max. 16 Protocols                 */
+
+/*
+ * Values for Layer-3-protocol-selection
+ */
+#define ISDN_PROTO_L3_TRANS    0       /* Transparent */
+#define ISDN_PROTO_L3_TRANSDSP 1       /* Transparent with DSP */
+#define ISDN_PROTO_L3_FCLASS2  2       /* Fax Group 2/3 CLASS 2 */
+#define ISDN_PROTO_L3_FCLASS1  3       /* Fax Group 2/3 CLASS 1 */
+#define ISDN_PROTO_L3_MAX      7       /* Max. 8 Protocols */
+
+
+#endif /* _UAPI__ISDNIF_H__ */
diff --git a/include/uapi/linux/joystick.h b/include/uapi/linux/joystick.h
new file mode 100644 (file)
index 0000000..b856fd1
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ *  Copyright (C) 1996-2000 Vojtech Pavlik
+ *
+ *  Sponsored by SuSE
+ */
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or 
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * Should you need to contact me, the author, you can do so either by
+ * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+#ifndef _UAPI_LINUX_JOYSTICK_H
+#define _UAPI_LINUX_JOYSTICK_H
+
+
+
+#include <linux/types.h>
+#include <linux/input.h>
+
+/*
+ * Version
+ */
+
+#define JS_VERSION             0x020100
+
+/*
+ * Types and constants for reading from /dev/js
+ */
+
+#define JS_EVENT_BUTTON                0x01    /* button pressed/released */
+#define JS_EVENT_AXIS          0x02    /* joystick moved */
+#define JS_EVENT_INIT          0x80    /* initial state of device */
+
+struct js_event {
+       __u32 time;     /* event timestamp in milliseconds */
+       __s16 value;    /* value */
+       __u8 type;      /* event type */
+       __u8 number;    /* axis/button number */
+};
+
+/*
+ * IOCTL commands for joystick driver
+ */
+
+#define JSIOCGVERSION          _IOR('j', 0x01, __u32)                          /* get driver version */
+
+#define JSIOCGAXES             _IOR('j', 0x11, __u8)                           /* get number of axes */
+#define JSIOCGBUTTONS          _IOR('j', 0x12, __u8)                           /* get number of buttons */
+#define JSIOCGNAME(len)                _IOC(_IOC_READ, 'j', 0x13, len)                 /* get identifier string */
+
+#define JSIOCSCORR             _IOW('j', 0x21, struct js_corr)                 /* set correction values */
+#define JSIOCGCORR             _IOR('j', 0x22, struct js_corr)                 /* get correction values */
+
+#define JSIOCSAXMAP            _IOW('j', 0x31, __u8[ABS_CNT])                  /* set axis mapping */
+#define JSIOCGAXMAP            _IOR('j', 0x32, __u8[ABS_CNT])                  /* get axis mapping */
+#define JSIOCSBTNMAP           _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])  /* set button mapping */
+#define JSIOCGBTNMAP           _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])  /* get button mapping */
+
+/*
+ * Types and constants for get/set correction
+ */
+
+#define JS_CORR_NONE           0x00    /* returns raw values */
+#define JS_CORR_BROKEN         0x01    /* broken line */
+
+struct js_corr {
+       __s32 coef[8];
+       __s16 prec;
+       __u16 type;
+};
+
+/*
+ * v0.x compatibility definitions
+ */
+
+#define JS_RETURN              sizeof(struct JS_DATA_TYPE)
+#define JS_TRUE                        1
+#define JS_FALSE               0
+#define JS_X_0                 0x01
+#define JS_Y_0                 0x02
+#define JS_X_1                 0x04
+#define JS_Y_1                 0x08
+#define JS_MAX                 2
+
+#define JS_DEF_TIMEOUT         0x1300
+#define JS_DEF_CORR            0
+#define JS_DEF_TIMELIMIT       10L
+
+#define JS_SET_CAL             1
+#define JS_GET_CAL             2
+#define JS_SET_TIMEOUT         3
+#define JS_GET_TIMEOUT         4
+#define JS_SET_TIMELIMIT       5
+#define JS_GET_TIMELIMIT       6
+#define JS_GET_ALL             7
+#define JS_SET_ALL             8
+
+struct JS_DATA_TYPE {
+       __s32 buttons;
+       __s32 x;
+       __s32 y;
+};
+
+struct JS_DATA_SAVE_TYPE_32 {
+       __s32 JS_TIMEOUT;
+       __s32 BUSY;
+       __s32 JS_EXPIRETIME;
+       __s32 JS_TIMELIMIT;
+       struct JS_DATA_TYPE JS_SAVE;
+       struct JS_DATA_TYPE JS_CORR;
+};
+
+struct JS_DATA_SAVE_TYPE_64 {
+       __s32 JS_TIMEOUT;
+       __s32 BUSY;
+       __s64 JS_EXPIRETIME;
+       __s64 JS_TIMELIMIT;
+       struct JS_DATA_TYPE JS_SAVE;
+       struct JS_DATA_TYPE JS_CORR;
+};
+
+
+#endif /* _UAPI_LINUX_JOYSTICK_H */
diff --git a/include/uapi/linux/kd.h b/include/uapi/linux/kd.h
new file mode 100644 (file)
index 0000000..87b7cc4
--- /dev/null
@@ -0,0 +1,183 @@
+#ifndef _UAPI_LINUX_KD_H
+#define _UAPI_LINUX_KD_H
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+/* 0x4B is 'K', to avoid collision with termios and vt */
+
+#define GIO_FONT       0x4B60  /* gets font in expanded form */
+#define PIO_FONT       0x4B61  /* use font in expanded form */
+
+#define GIO_FONTX      0x4B6B  /* get font using struct consolefontdesc */
+#define PIO_FONTX      0x4B6C  /* set font using struct consolefontdesc */
+struct consolefontdesc {
+       unsigned short charcount;       /* characters in font (256 or 512) */
+       unsigned short charheight;      /* scan lines per character (1-32) */
+       char __user *chardata;          /* font data in expanded form */
+};
+
+#define PIO_FONTRESET   0x4B6D /* reset to default font */
+
+#define GIO_CMAP       0x4B70  /* gets colour palette on VGA+ */
+#define PIO_CMAP       0x4B71  /* sets colour palette on VGA+ */
+
+#define KIOCSOUND      0x4B2F  /* start sound generation (0 for off) */
+#define KDMKTONE       0x4B30  /* generate tone */
+
+#define KDGETLED       0x4B31  /* return current led state */
+#define KDSETLED       0x4B32  /* set led state [lights, not flags] */
+#define        LED_SCR         0x01    /* scroll lock led */
+#define        LED_NUM         0x02    /* num lock led */
+#define        LED_CAP         0x04    /* caps lock led */
+
+#define KDGKBTYPE      0x4B33  /* get keyboard type */
+#define        KB_84           0x01
+#define        KB_101          0x02    /* this is what we always answer */
+#define        KB_OTHER        0x03
+
+#define KDADDIO                0x4B34  /* add i/o port as valid */
+#define KDDELIO                0x4B35  /* del i/o port as valid */
+#define KDENABIO       0x4B36  /* enable i/o to video board */
+#define KDDISABIO      0x4B37  /* disable i/o to video board */
+
+#define KDSETMODE      0x4B3A  /* set text/graphics mode */
+#define                KD_TEXT         0x00
+#define                KD_GRAPHICS     0x01
+#define                KD_TEXT0        0x02    /* obsolete */
+#define                KD_TEXT1        0x03    /* obsolete */
+#define KDGETMODE      0x4B3B  /* get current mode */
+
+#define KDMAPDISP      0x4B3C  /* map display into address space */
+#define KDUNMAPDISP    0x4B3D  /* unmap display from address space */
+
+typedef char scrnmap_t;
+#define                E_TABSZ         256
+#define GIO_SCRNMAP    0x4B40  /* get screen mapping from kernel */
+#define PIO_SCRNMAP    0x4B41  /* put screen mapping table in kernel */
+#define GIO_UNISCRNMAP  0x4B69 /* get full Unicode screen mapping */
+#define PIO_UNISCRNMAP  0x4B6A  /* set full Unicode screen mapping */
+
+#define GIO_UNIMAP     0x4B66  /* get unicode-to-font mapping from kernel */
+struct unipair {
+       unsigned short unicode;
+       unsigned short fontpos;
+};
+struct unimapdesc {
+       unsigned short entry_ct;
+       struct unipair __user *entries;
+};
+#define PIO_UNIMAP     0x4B67  /* put unicode-to-font mapping in kernel */
+#define PIO_UNIMAPCLR  0x4B68  /* clear table, possibly advise hash algorithm */
+struct unimapinit {
+       unsigned short advised_hashsize;  /* 0 if no opinion */
+       unsigned short advised_hashstep;  /* 0 if no opinion */
+       unsigned short advised_hashlevel; /* 0 if no opinion */
+};
+
+#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
+#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
+
+#define                K_RAW           0x00
+#define                K_XLATE         0x01
+#define                K_MEDIUMRAW     0x02
+#define                K_UNICODE       0x03
+#define                K_OFF           0x04
+#define KDGKBMODE      0x4B44  /* gets current keyboard mode */
+#define KDSKBMODE      0x4B45  /* sets current keyboard mode */
+
+#define                K_METABIT       0x03
+#define                K_ESCPREFIX     0x04
+#define KDGKBMETA      0x4B62  /* gets meta key handling mode */
+#define KDSKBMETA      0x4B63  /* sets meta key handling mode */
+
+#define                K_SCROLLLOCK    0x01
+#define                K_NUMLOCK       0x02
+#define                K_CAPSLOCK      0x04
+#define        KDGKBLED        0x4B64  /* get led flags (not lights) */
+#define        KDSKBLED        0x4B65  /* set led flags (not lights) */
+
+struct kbentry {
+       unsigned char kb_table;
+       unsigned char kb_index;
+       unsigned short kb_value;
+};
+#define                K_NORMTAB       0x00
+#define                K_SHIFTTAB      0x01
+#define                K_ALTTAB        0x02
+#define                K_ALTSHIFTTAB   0x03
+
+#define KDGKBENT       0x4B46  /* gets one entry in translation table */
+#define KDSKBENT       0x4B47  /* sets one entry in translation table */
+
+struct kbsentry {
+       unsigned char kb_func;
+       unsigned char kb_string[512];
+};
+#define KDGKBSENT      0x4B48  /* gets one function key string entry */
+#define KDSKBSENT      0x4B49  /* sets one function key string entry */
+
+struct kbdiacr {
+        unsigned char diacr, base, result;
+};
+struct kbdiacrs {
+        unsigned int kb_cnt;    /* number of entries in following array */
+       struct kbdiacr kbdiacr[256];    /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACR      0x4B4A  /* read kernel accent table */
+#define KDSKBDIACR      0x4B4B  /* write kernel accent table */
+
+struct kbdiacruc {
+       unsigned int diacr, base, result;
+};
+struct kbdiacrsuc {
+        unsigned int kb_cnt;    /* number of entries in following array */
+       struct kbdiacruc kbdiacruc[256];    /* MAX_DIACR from keyboard.h */
+};
+#define KDGKBDIACRUC    0x4BFA  /* read kernel accent table - UCS */
+#define KDSKBDIACRUC    0x4BFB  /* write kernel accent table - UCS */
+
+struct kbkeycode {
+       unsigned int scancode, keycode;
+};
+#define KDGETKEYCODE   0x4B4C  /* read kernel keycode table entry */
+#define KDSETKEYCODE   0x4B4D  /* write kernel keycode table entry */
+
+#define KDSIGACCEPT    0x4B4E  /* accept kbd generated signals */
+
+struct kbd_repeat {
+       int delay;      /* in msec; <= 0: don't change */
+       int period;     /* in msec; <= 0: don't change */
+                       /* earlier this field was misnamed "rate" */
+};
+
+#define KDKBDREP        0x4B52  /* set keyboard delay/repeat rate;
+                                * actually used values are returned */
+
+#define KDFONTOP       0x4B72  /* font operations */
+
+struct console_font_op {
+       unsigned int op;        /* operation code KD_FONT_OP_* */
+       unsigned int flags;     /* KD_FONT_FLAG_* */
+       unsigned int width, height;     /* font size */
+       unsigned int charcount;
+       unsigned char __user *data;     /* font data with height fixed to 32 */
+};
+
+struct console_font {
+       unsigned int width, height;     /* font size */
+       unsigned int charcount;
+       unsigned char *data;    /* font data with height fixed to 32 */
+};
+
+#define KD_FONT_OP_SET         0       /* Set font */
+#define KD_FONT_OP_GET         1       /* Get font */
+#define KD_FONT_OP_SET_DEFAULT 2       /* Set font to default, data points to name / NULL */
+#define KD_FONT_OP_COPY                3       /* Copy from another console */
+
+#define KD_FONT_FLAG_DONT_RECALC       1       /* Don't recalculate hw charcell size [compat] */
+
+/* note: 0x4B00-0x4B4E all have had a value at some time;
+   don't reuse for the time being */
+/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
+
+#endif /* _UAPI_LINUX_KD_H */
diff --git a/include/uapi/linux/kdev_t.h b/include/uapi/linux/kdev_t.h
new file mode 100644 (file)
index 0000000..0d881fa
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _UAPI_LINUX_KDEV_T_H
+#define _UAPI_LINUX_KDEV_T_H
+#ifndef __KERNEL__
+
+/*
+Some programs want their definitions of MAJOR and MINOR and MKDEV
+from the kernel sources. These must be the externally visible ones.
+*/
+#define MAJOR(dev)     ((dev)>>8)
+#define MINOR(dev)     ((dev) & 0xff)
+#define MKDEV(ma,mi)   ((ma)<<8 | (mi))
+#endif /* __KERNEL__ */
+#endif /* _UAPI_LINUX_KDEV_T_H */
diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h
new file mode 100644 (file)
index 0000000..5116a0e
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _UAPILINUX_KERNEL_PAGE_FLAGS_H
+#define _UAPILINUX_KERNEL_PAGE_FLAGS_H
+
+/*
+ * Stable page flag bits exported to user space
+ */
+
+#define KPF_LOCKED             0
+#define KPF_ERROR              1
+#define KPF_REFERENCED         2
+#define KPF_UPTODATE           3
+#define KPF_DIRTY              4
+#define KPF_LRU                        5
+#define KPF_ACTIVE             6
+#define KPF_SLAB               7
+#define KPF_WRITEBACK          8
+#define KPF_RECLAIM            9
+#define KPF_BUDDY              10
+
+/* 11-20: new additions in 2.6.31 */
+#define KPF_MMAP               11
+#define KPF_ANON               12
+#define KPF_SWAPCACHE          13
+#define KPF_SWAPBACKED         14
+#define KPF_COMPOUND_HEAD      15
+#define KPF_COMPOUND_TAIL      16
+#define KPF_HUGE               17
+#define KPF_UNEVICTABLE                18
+#define KPF_HWPOISON           19
+#define KPF_NOPAGE             20
+
+#define KPF_KSM                        21
+#define KPF_THP                        22
+
+
+#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
new file mode 100644 (file)
index 0000000..321e399
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _UAPI_LINUX_KERNEL_H
+#define _UAPI_LINUX_KERNEL_H
+
+#include <linux/sysinfo.h>
+
+/*
+ * 'kernel.h' contains some often-used function prototypes etc
+ */
+#define __ALIGN_KERNEL(x, a)           __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
+#define __ALIGN_KERNEL_MASK(x, mask)   (((x) + (mask)) & ~(mask))
+
+
+#endif /* _UAPI_LINUX_KERNEL_H */
diff --git a/include/uapi/linux/kernelcapi.h b/include/uapi/linux/kernelcapi.h
new file mode 100644 (file)
index 0000000..89bf40d
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
+ * 
+ * Kernel CAPI 2.0 Interface for Linux
+ * 
+ * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
+ * 
+ */
+
+#ifndef _UAPI__KERNELCAPI_H__
+#define _UAPI__KERNELCAPI_H__
+
+#define CAPI_MAXAPPL   240     /* maximum number of applications  */
+#define CAPI_MAXCONTR  32      /* maximum number of controller    */
+#define CAPI_MAXDATAWINDOW     8
+
+
+typedef struct kcapi_flagdef {
+       int contr;
+       int flag;
+} kcapi_flagdef;
+
+typedef struct kcapi_carddef {
+       char            driver[32];
+       unsigned int    port;
+       unsigned        irq;
+       unsigned int    membase;
+       int             cardnr;
+} kcapi_carddef;
+
+/* new ioctls >= 10 */
+#define KCAPI_CMD_TRACE                10
+#define KCAPI_CMD_ADDCARD      11      /* OBSOLETE */
+
+/* 
+ * flag > 2 => trace also data
+ * flag & 1 => show trace
+ */
+#define KCAPI_TRACE_OFF                        0
+#define KCAPI_TRACE_SHORT_NO_DATA      1
+#define KCAPI_TRACE_FULL_NO_DATA       2
+#define KCAPI_TRACE_SHORT              3
+#define KCAPI_TRACE_FULL               4
+
+
+
+#endif /* _UAPI__KERNELCAPI_H__ */
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
new file mode 100644 (file)
index 0000000..104838f
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef _UAPILINUX_KEXEC_H
+#define _UAPILINUX_KEXEC_H
+
+/* kexec system call -  It loads the new kernel to boot into.
+ * kexec does not sync, or unmount filesystems so if you need
+ * that to happen you need to do that yourself.
+ */
+
+#include <linux/types.h>
+
+/* kexec flags for different usage scenarios */
+#define KEXEC_ON_CRASH         0x00000001
+#define KEXEC_PRESERVE_CONTEXT 0x00000002
+#define KEXEC_ARCH_MASK                0xffff0000
+
+/* These values match the ELF architecture values.
+ * Unless there is a good reason that should continue to be the case.
+ */
+#define KEXEC_ARCH_DEFAULT ( 0 << 16)
+#define KEXEC_ARCH_386     ( 3 << 16)
+#define KEXEC_ARCH_X86_64  (62 << 16)
+#define KEXEC_ARCH_PPC     (20 << 16)
+#define KEXEC_ARCH_PPC64   (21 << 16)
+#define KEXEC_ARCH_IA_64   (50 << 16)
+#define KEXEC_ARCH_ARM     (40 << 16)
+#define KEXEC_ARCH_S390    (22 << 16)
+#define KEXEC_ARCH_SH      (42 << 16)
+#define KEXEC_ARCH_MIPS_LE (10 << 16)
+#define KEXEC_ARCH_MIPS    ( 8 << 16)
+
+/* The artificial cap on the number of segments passed to kexec_load. */
+#define KEXEC_SEGMENT_MAX 16
+
+#ifndef __KERNEL__
+/*
+ * This structure is used to hold the arguments that are used when
+ * loading  kernel binaries.
+ */
+struct kexec_segment {
+       const void *buf;
+       size_t bufsz;
+       const void *mem;
+       size_t memsz;
+};
+
+/* Load a new kernel image as described by the kexec_segment array
+ * consisting of passed number of segments at the entry-point address.
+ * The flags allow different useage types.
+ */
+extern int kexec_load(void *, size_t, struct kexec_segment *,
+               unsigned long int);
+#endif /* __KERNEL__ */
+
+#endif /* _UAPILINUX_KEXEC_H */
diff --git a/include/uapi/linux/keyboard.h b/include/uapi/linux/keyboard.h
new file mode 100644 (file)
index 0000000..5a68497
--- /dev/null
@@ -0,0 +1,443 @@
+#ifndef _UAPI__LINUX_KEYBOARD_H
+#define _UAPI__LINUX_KEYBOARD_H
+
+#include <linux/wait.h>
+
+#define KG_SHIFT       0
+#define KG_CTRL                2
+#define KG_ALT         3
+#define KG_ALTGR       1
+#define KG_SHIFTL      4
+#define KG_KANASHIFT   4
+#define KG_SHIFTR      5
+#define KG_CTRLL       6
+#define KG_CTRLR       7
+#define KG_CAPSSHIFT   8
+
+#define NR_SHIFT       9
+
+#define NR_KEYS                256
+#define MAX_NR_KEYMAPS 256
+/* This means 128Kb if all keymaps are allocated. Only the superuser
+       may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
+#define MAX_NR_OF_USER_KEYMAPS 256     /* should be at least 7 */
+
+
+#define MAX_NR_FUNC    256     /* max nr of strings assigned to keys */
+
+#define KT_LATIN       0       /* we depend on this being zero */
+#define KT_LETTER      11      /* symbol that can be acted upon by CapsLock */
+#define KT_FN          1
+#define KT_SPEC                2
+#define KT_PAD         3
+#define KT_DEAD                4
+#define KT_CONS                5
+#define KT_CUR         6
+#define KT_SHIFT       7
+#define KT_META                8
+#define KT_ASCII       9
+#define KT_LOCK                10
+#define KT_SLOCK       12
+#define KT_DEAD2       13
+#define KT_BRL         14
+
+#define K(t,v)         (((t)<<8)|(v))
+#define KTYP(x)                ((x) >> 8)
+#define KVAL(x)                ((x) & 0xff)
+
+#define K_F1           K(KT_FN,0)
+#define K_F2           K(KT_FN,1)
+#define K_F3           K(KT_FN,2)
+#define K_F4           K(KT_FN,3)
+#define K_F5           K(KT_FN,4)
+#define K_F6           K(KT_FN,5)
+#define K_F7           K(KT_FN,6)
+#define K_F8           K(KT_FN,7)
+#define K_F9           K(KT_FN,8)
+#define K_F10          K(KT_FN,9)
+#define K_F11          K(KT_FN,10)
+#define K_F12          K(KT_FN,11)
+#define K_F13          K(KT_FN,12)
+#define K_F14          K(KT_FN,13)
+#define K_F15          K(KT_FN,14)
+#define K_F16          K(KT_FN,15)
+#define K_F17          K(KT_FN,16)
+#define K_F18          K(KT_FN,17)
+#define K_F19          K(KT_FN,18)
+#define K_F20          K(KT_FN,19)
+#define K_FIND         K(KT_FN,20)
+#define K_INSERT       K(KT_FN,21)
+#define K_REMOVE       K(KT_FN,22)
+#define K_SELECT       K(KT_FN,23)
+#define K_PGUP         K(KT_FN,24) /* PGUP is a synonym for PRIOR */
+#define K_PGDN         K(KT_FN,25) /* PGDN is a synonym for NEXT */
+#define K_MACRO                K(KT_FN,26)
+#define K_HELP         K(KT_FN,27)
+#define K_DO           K(KT_FN,28)
+#define K_PAUSE                K(KT_FN,29)
+#define K_F21          K(KT_FN,30)
+#define K_F22          K(KT_FN,31)
+#define K_F23          K(KT_FN,32)
+#define K_F24          K(KT_FN,33)
+#define K_F25          K(KT_FN,34)
+#define K_F26          K(KT_FN,35)
+#define K_F27          K(KT_FN,36)
+#define K_F28          K(KT_FN,37)
+#define K_F29          K(KT_FN,38)
+#define K_F30          K(KT_FN,39)
+#define K_F31          K(KT_FN,40)
+#define K_F32          K(KT_FN,41)
+#define K_F33          K(KT_FN,42)
+#define K_F34          K(KT_FN,43)
+#define K_F35          K(KT_FN,44)
+#define K_F36          K(KT_FN,45)
+#define K_F37          K(KT_FN,46)
+#define K_F38          K(KT_FN,47)
+#define K_F39          K(KT_FN,48)
+#define K_F40          K(KT_FN,49)
+#define K_F41          K(KT_FN,50)
+#define K_F42          K(KT_FN,51)
+#define K_F43          K(KT_FN,52)
+#define K_F44          K(KT_FN,53)
+#define K_F45          K(KT_FN,54)
+#define K_F46          K(KT_FN,55)
+#define K_F47          K(KT_FN,56)
+#define K_F48          K(KT_FN,57)
+#define K_F49          K(KT_FN,58)
+#define K_F50          K(KT_FN,59)
+#define K_F51          K(KT_FN,60)
+#define K_F52          K(KT_FN,61)
+#define K_F53          K(KT_FN,62)
+#define K_F54          K(KT_FN,63)
+#define K_F55          K(KT_FN,64)
+#define K_F56          K(KT_FN,65)
+#define K_F57          K(KT_FN,66)
+#define K_F58          K(KT_FN,67)
+#define K_F59          K(KT_FN,68)
+#define K_F60          K(KT_FN,69)
+#define K_F61          K(KT_FN,70)
+#define K_F62          K(KT_FN,71)
+#define K_F63          K(KT_FN,72)
+#define K_F64          K(KT_FN,73)
+#define K_F65          K(KT_FN,74)
+#define K_F66          K(KT_FN,75)
+#define K_F67          K(KT_FN,76)
+#define K_F68          K(KT_FN,77)
+#define K_F69          K(KT_FN,78)
+#define K_F70          K(KT_FN,79)
+#define K_F71          K(KT_FN,80)
+#define K_F72          K(KT_FN,81)
+#define K_F73          K(KT_FN,82)
+#define K_F74          K(KT_FN,83)
+#define K_F75          K(KT_FN,84)
+#define K_F76          K(KT_FN,85)
+#define K_F77          K(KT_FN,86)
+#define K_F78          K(KT_FN,87)
+#define K_F79          K(KT_FN,88)
+#define K_F80          K(KT_FN,89)
+#define K_F81          K(KT_FN,90)
+#define K_F82          K(KT_FN,91)
+#define K_F83          K(KT_FN,92)
+#define K_F84          K(KT_FN,93)
+#define K_F85          K(KT_FN,94)
+#define K_F86          K(KT_FN,95)
+#define K_F87          K(KT_FN,96)
+#define K_F88          K(KT_FN,97)
+#define K_F89          K(KT_FN,98)
+#define K_F90          K(KT_FN,99)
+#define K_F91          K(KT_FN,100)
+#define K_F92          K(KT_FN,101)
+#define K_F93          K(KT_FN,102)
+#define K_F94          K(KT_FN,103)
+#define K_F95          K(KT_FN,104)
+#define K_F96          K(KT_FN,105)
+#define K_F97          K(KT_FN,106)
+#define K_F98          K(KT_FN,107)
+#define K_F99          K(KT_FN,108)
+#define K_F100         K(KT_FN,109)
+#define K_F101         K(KT_FN,110)
+#define K_F102         K(KT_FN,111)
+#define K_F103         K(KT_FN,112)
+#define K_F104         K(KT_FN,113)
+#define K_F105         K(KT_FN,114)
+#define K_F106         K(KT_FN,115)
+#define K_F107         K(KT_FN,116)
+#define K_F108         K(KT_FN,117)
+#define K_F109         K(KT_FN,118)
+#define K_F110         K(KT_FN,119)
+#define K_F111         K(KT_FN,120)
+#define K_F112         K(KT_FN,121)
+#define K_F113         K(KT_FN,122)
+#define K_F114         K(KT_FN,123)
+#define K_F115         K(KT_FN,124)
+#define K_F116         K(KT_FN,125)
+#define K_F117         K(KT_FN,126)
+#define K_F118         K(KT_FN,127)
+#define K_F119         K(KT_FN,128)
+#define K_F120         K(KT_FN,129)
+#define K_F121         K(KT_FN,130)
+#define K_F122         K(KT_FN,131)
+#define K_F123         K(KT_FN,132)
+#define K_F124         K(KT_FN,133)
+#define K_F125         K(KT_FN,134)
+#define K_F126         K(KT_FN,135)
+#define K_F127         K(KT_FN,136)
+#define K_F128         K(KT_FN,137)
+#define K_F129         K(KT_FN,138)
+#define K_F130         K(KT_FN,139)
+#define K_F131         K(KT_FN,140)
+#define K_F132         K(KT_FN,141)
+#define K_F133         K(KT_FN,142)
+#define K_F134         K(KT_FN,143)
+#define K_F135         K(KT_FN,144)
+#define K_F136         K(KT_FN,145)
+#define K_F137         K(KT_FN,146)
+#define K_F138         K(KT_FN,147)
+#define K_F139         K(KT_FN,148)
+#define K_F140         K(KT_FN,149)
+#define K_F141         K(KT_FN,150)
+#define K_F142         K(KT_FN,151)
+#define K_F143         K(KT_FN,152)
+#define K_F144         K(KT_FN,153)
+#define K_F145         K(KT_FN,154)
+#define K_F146         K(KT_FN,155)
+#define K_F147         K(KT_FN,156)
+#define K_F148         K(KT_FN,157)
+#define K_F149         K(KT_FN,158)
+#define K_F150         K(KT_FN,159)
+#define K_F151         K(KT_FN,160)
+#define K_F152         K(KT_FN,161)
+#define K_F153         K(KT_FN,162)
+#define K_F154         K(KT_FN,163)
+#define K_F155         K(KT_FN,164)
+#define K_F156         K(KT_FN,165)
+#define K_F157         K(KT_FN,166)
+#define K_F158         K(KT_FN,167)
+#define K_F159         K(KT_FN,168)
+#define K_F160         K(KT_FN,169)
+#define K_F161         K(KT_FN,170)
+#define K_F162         K(KT_FN,171)
+#define K_F163         K(KT_FN,172)
+#define K_F164         K(KT_FN,173)
+#define K_F165         K(KT_FN,174)
+#define K_F166         K(KT_FN,175)
+#define K_F167         K(KT_FN,176)
+#define K_F168         K(KT_FN,177)
+#define K_F169         K(KT_FN,178)
+#define K_F170         K(KT_FN,179)
+#define K_F171         K(KT_FN,180)
+#define K_F172         K(KT_FN,181)
+#define K_F173         K(KT_FN,182)
+#define K_F174         K(KT_FN,183)
+#define K_F175         K(KT_FN,184)
+#define K_F176         K(KT_FN,185)
+#define K_F177         K(KT_FN,186)
+#define K_F178         K(KT_FN,187)
+#define K_F179         K(KT_FN,188)
+#define K_F180         K(KT_FN,189)
+#define K_F181         K(KT_FN,190)
+#define K_F182         K(KT_FN,191)
+#define K_F183         K(KT_FN,192)
+#define K_F184         K(KT_FN,193)
+#define K_F185         K(KT_FN,194)
+#define K_F186         K(KT_FN,195)
+#define K_F187         K(KT_FN,196)
+#define K_F188         K(KT_FN,197)
+#define K_F189         K(KT_FN,198)
+#define K_F190         K(KT_FN,199)
+#define K_F191         K(KT_FN,200)
+#define K_F192         K(KT_FN,201)
+#define K_F193         K(KT_FN,202)
+#define K_F194         K(KT_FN,203)
+#define K_F195         K(KT_FN,204)
+#define K_F196         K(KT_FN,205)
+#define K_F197         K(KT_FN,206)
+#define K_F198         K(KT_FN,207)
+#define K_F199         K(KT_FN,208)
+#define K_F200         K(KT_FN,209)
+#define K_F201         K(KT_FN,210)
+#define K_F202         K(KT_FN,211)
+#define K_F203         K(KT_FN,212)
+#define K_F204         K(KT_FN,213)
+#define K_F205         K(KT_FN,214)
+#define K_F206         K(KT_FN,215)
+#define K_F207         K(KT_FN,216)
+#define K_F208         K(KT_FN,217)
+#define K_F209         K(KT_FN,218)
+#define K_F210         K(KT_FN,219)
+#define K_F211         K(KT_FN,220)
+#define K_F212         K(KT_FN,221)
+#define K_F213         K(KT_FN,222)
+#define K_F214         K(KT_FN,223)
+#define K_F215         K(KT_FN,224)
+#define K_F216         K(KT_FN,225)
+#define K_F217         K(KT_FN,226)
+#define K_F218         K(KT_FN,227)
+#define K_F219         K(KT_FN,228)
+#define K_F220         K(KT_FN,229)
+#define K_F221         K(KT_FN,230)
+#define K_F222         K(KT_FN,231)
+#define K_F223         K(KT_FN,232)
+#define K_F224         K(KT_FN,233)
+#define K_F225         K(KT_FN,234)
+#define K_F226         K(KT_FN,235)
+#define K_F227         K(KT_FN,236)
+#define K_F228         K(KT_FN,237)
+#define K_F229         K(KT_FN,238)
+#define K_F230         K(KT_FN,239)
+#define K_F231         K(KT_FN,240)
+#define K_F232         K(KT_FN,241)
+#define K_F233         K(KT_FN,242)
+#define K_F234         K(KT_FN,243)
+#define K_F235         K(KT_FN,244)
+#define K_F236         K(KT_FN,245)
+#define K_F237         K(KT_FN,246)
+#define K_F238         K(KT_FN,247)
+#define K_F239         K(KT_FN,248)
+#define K_F240         K(KT_FN,249)
+#define K_F241         K(KT_FN,250)
+#define K_F242         K(KT_FN,251)
+#define K_F243         K(KT_FN,252)
+#define K_F244         K(KT_FN,253)
+#define K_F245         K(KT_FN,254)
+#define K_UNDO         K(KT_FN,255)
+
+
+#define K_HOLE         K(KT_SPEC,0)
+#define K_ENTER                K(KT_SPEC,1)
+#define K_SH_REGS      K(KT_SPEC,2)
+#define K_SH_MEM       K(KT_SPEC,3)
+#define K_SH_STAT      K(KT_SPEC,4)
+#define K_BREAK                K(KT_SPEC,5)
+#define K_CONS         K(KT_SPEC,6)
+#define K_CAPS         K(KT_SPEC,7)
+#define K_NUM          K(KT_SPEC,8)
+#define K_HOLD         K(KT_SPEC,9)
+#define K_SCROLLFORW   K(KT_SPEC,10)
+#define K_SCROLLBACK   K(KT_SPEC,11)
+#define K_BOOT         K(KT_SPEC,12)
+#define K_CAPSON       K(KT_SPEC,13)
+#define K_COMPOSE      K(KT_SPEC,14)
+#define K_SAK          K(KT_SPEC,15)
+#define K_DECRCONSOLE  K(KT_SPEC,16)
+#define K_INCRCONSOLE  K(KT_SPEC,17)
+#define K_SPAWNCONSOLE K(KT_SPEC,18)
+#define K_BARENUMLOCK  K(KT_SPEC,19)
+
+#define K_ALLOCATED    K(KT_SPEC,126) /* dynamically allocated keymap */
+#define K_NOSUCHMAP    K(KT_SPEC,127) /* returned by KDGKBENT */
+
+#define K_P0           K(KT_PAD,0)
+#define K_P1           K(KT_PAD,1)
+#define K_P2           K(KT_PAD,2)
+#define K_P3           K(KT_PAD,3)
+#define K_P4           K(KT_PAD,4)
+#define K_P5           K(KT_PAD,5)
+#define K_P6           K(KT_PAD,6)
+#define K_P7           K(KT_PAD,7)
+#define K_P8           K(KT_PAD,8)
+#define K_P9           K(KT_PAD,9)
+#define K_PPLUS                K(KT_PAD,10)    /* key-pad plus */
+#define K_PMINUS       K(KT_PAD,11)    /* key-pad minus */
+#define K_PSTAR                K(KT_PAD,12)    /* key-pad asterisk (star) */
+#define K_PSLASH       K(KT_PAD,13)    /* key-pad slash */
+#define K_PENTER       K(KT_PAD,14)    /* key-pad enter */
+#define K_PCOMMA       K(KT_PAD,15)    /* key-pad comma: kludge... */
+#define K_PDOT         K(KT_PAD,16)    /* key-pad dot (period): kludge... */
+#define K_PPLUSMINUS   K(KT_PAD,17)    /* key-pad plus/minus */
+#define K_PPARENL      K(KT_PAD,18)    /* key-pad left parenthesis */
+#define K_PPARENR      K(KT_PAD,19)    /* key-pad right parenthesis */
+
+#define NR_PAD         20
+
+#define K_DGRAVE       K(KT_DEAD,0)
+#define K_DACUTE       K(KT_DEAD,1)
+#define K_DCIRCM       K(KT_DEAD,2)
+#define K_DTILDE       K(KT_DEAD,3)
+#define K_DDIERE       K(KT_DEAD,4)
+#define K_DCEDIL       K(KT_DEAD,5)
+
+#define NR_DEAD                6
+
+#define K_DOWN         K(KT_CUR,0)
+#define K_LEFT         K(KT_CUR,1)
+#define K_RIGHT                K(KT_CUR,2)
+#define K_UP           K(KT_CUR,3)
+
+#define K_SHIFT                K(KT_SHIFT,KG_SHIFT)
+#define K_CTRL         K(KT_SHIFT,KG_CTRL)
+#define K_ALT          K(KT_SHIFT,KG_ALT)
+#define K_ALTGR                K(KT_SHIFT,KG_ALTGR)
+#define K_SHIFTL       K(KT_SHIFT,KG_SHIFTL)
+#define K_SHIFTR       K(KT_SHIFT,KG_SHIFTR)
+#define K_CTRLL                K(KT_SHIFT,KG_CTRLL)
+#define K_CTRLR                K(KT_SHIFT,KG_CTRLR)
+#define K_CAPSSHIFT    K(KT_SHIFT,KG_CAPSSHIFT)
+
+#define K_ASC0         K(KT_ASCII,0)
+#define K_ASC1         K(KT_ASCII,1)
+#define K_ASC2         K(KT_ASCII,2)
+#define K_ASC3         K(KT_ASCII,3)
+#define K_ASC4         K(KT_ASCII,4)
+#define K_ASC5         K(KT_ASCII,5)
+#define K_ASC6         K(KT_ASCII,6)
+#define K_ASC7         K(KT_ASCII,7)
+#define K_ASC8         K(KT_ASCII,8)
+#define K_ASC9         K(KT_ASCII,9)
+#define K_HEX0         K(KT_ASCII,10)
+#define K_HEX1         K(KT_ASCII,11)
+#define K_HEX2         K(KT_ASCII,12)
+#define K_HEX3         K(KT_ASCII,13)
+#define K_HEX4         K(KT_ASCII,14)
+#define K_HEX5         K(KT_ASCII,15)
+#define K_HEX6         K(KT_ASCII,16)
+#define K_HEX7         K(KT_ASCII,17)
+#define K_HEX8         K(KT_ASCII,18)
+#define K_HEX9         K(KT_ASCII,19)
+#define K_HEXa         K(KT_ASCII,20)
+#define K_HEXb         K(KT_ASCII,21)
+#define K_HEXc         K(KT_ASCII,22)
+#define K_HEXd         K(KT_ASCII,23)
+#define K_HEXe         K(KT_ASCII,24)
+#define K_HEXf         K(KT_ASCII,25)
+
+#define NR_ASCII       26
+
+#define K_SHIFTLOCK    K(KT_LOCK,KG_SHIFT)
+#define K_CTRLLOCK     K(KT_LOCK,KG_CTRL)
+#define K_ALTLOCK      K(KT_LOCK,KG_ALT)
+#define K_ALTGRLOCK    K(KT_LOCK,KG_ALTGR)
+#define K_SHIFTLLOCK   K(KT_LOCK,KG_SHIFTL)
+#define K_SHIFTRLOCK   K(KT_LOCK,KG_SHIFTR)
+#define K_CTRLLLOCK    K(KT_LOCK,KG_CTRLL)
+#define K_CTRLRLOCK    K(KT_LOCK,KG_CTRLR)
+#define K_CAPSSHIFTLOCK        K(KT_LOCK,KG_CAPSSHIFT)
+
+#define K_SHIFT_SLOCK  K(KT_SLOCK,KG_SHIFT)
+#define K_CTRL_SLOCK   K(KT_SLOCK,KG_CTRL)
+#define K_ALT_SLOCK    K(KT_SLOCK,KG_ALT)
+#define K_ALTGR_SLOCK  K(KT_SLOCK,KG_ALTGR)
+#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
+#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
+#define K_CTRLL_SLOCK  K(KT_SLOCK,KG_CTRLL)
+#define K_CTRLR_SLOCK  K(KT_SLOCK,KG_CTRLR)
+#define K_CAPSSHIFT_SLOCK      K(KT_SLOCK,KG_CAPSSHIFT)
+
+#define NR_LOCK                9
+
+#define K_BRL_BLANK     K(KT_BRL, 0)
+#define K_BRL_DOT1      K(KT_BRL, 1)
+#define K_BRL_DOT2      K(KT_BRL, 2)
+#define K_BRL_DOT3      K(KT_BRL, 3)
+#define K_BRL_DOT4      K(KT_BRL, 4)
+#define K_BRL_DOT5      K(KT_BRL, 5)
+#define K_BRL_DOT6      K(KT_BRL, 6)
+#define K_BRL_DOT7      K(KT_BRL, 7)
+#define K_BRL_DOT8      K(KT_BRL, 8)
+#define K_BRL_DOT9      K(KT_BRL, 9)
+#define K_BRL_DOT10     K(KT_BRL, 10)
+
+#define NR_BRL         11
+
+#define MAX_DIACR      256
+#endif /* _UAPI__LINUX_KEYBOARD_H */
similarity index 100%
rename from include/linux/kvm.h
rename to include/uapi/linux/kvm.h
diff --git a/include/uapi/linux/kvm_para.h b/include/uapi/linux/kvm_para.h
new file mode 100644 (file)
index 0000000..cea2c5c
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _UAPI__LINUX_KVM_PARA_H
+#define _UAPI__LINUX_KVM_PARA_H
+
+/*
+ * This header file provides a method for making a hypercall to the host
+ * Architectures should define:
+ * - kvm_hypercall0, kvm_hypercall1...
+ * - kvm_arch_para_features
+ * - kvm_para_available
+ */
+
+/* Return values for hypercalls */
+#define KVM_ENOSYS             1000
+#define KVM_EFAULT             EFAULT
+#define KVM_E2BIG              E2BIG
+#define KVM_EPERM              EPERM
+
+#define KVM_HC_VAPIC_POLL_IRQ          1
+#define KVM_HC_MMU_OP                  2
+#define KVM_HC_FEATURES                        3
+#define KVM_HC_PPC_MAP_MAGIC_PAGE      4
+
+/*
+ * hypercalls use architecture specific
+ */
+#include <asm/kvm_para.h>
+
+#endif /* _UAPI__LINUX_KVM_PARA_H */
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
new file mode 100644 (file)
index 0000000..8adb681
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * L2TP-over-IP socket for L2TPv3.
+ *
+ * Author: James Chapman <jchapman@katalix.com>
+ */
+
+#ifndef _UAPI_LINUX_L2TP_H_
+#define _UAPI_LINUX_L2TP_H_
+
+#include <linux/types.h>
+#include <linux/socket.h>
+#ifndef __KERNEL__
+#include <netinet/in.h>
+#endif
+
+#define IPPROTO_L2TP           115
+
+/**
+ * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
+ * @l2tp_family:  address family number AF_L2TPIP.
+ * @l2tp_addr:    protocol specific address information
+ * @l2tp_conn_id: connection id of tunnel
+ */
+#define __SOCK_SIZE__  16              /* sizeof(struct sockaddr)      */
+struct sockaddr_l2tpip {
+       /* The first fields must match struct sockaddr_in */
+       __kernel_sa_family_t l2tp_family; /* AF_INET */
+       __be16          l2tp_unused;    /* INET port number (unused) */
+       struct in_addr  l2tp_addr;      /* Internet address */
+
+       __u32           l2tp_conn_id;   /* Connection ID of tunnel */
+
+       /* Pad to size of `struct sockaddr'. */
+       unsigned char   __pad[sizeof(struct sockaddr) -
+                             sizeof(__kernel_sa_family_t) -
+                             sizeof(__be16) - sizeof(struct in_addr) -
+                             sizeof(__u32)];
+};
+
+/**
+ * struct sockaddr_l2tpip6 - the sockaddr structure for L2TP-over-IPv6 sockets
+ * @l2tp_family:  address family number AF_L2TPIP.
+ * @l2tp_addr:    protocol specific address information
+ * @l2tp_conn_id: connection id of tunnel
+ */
+struct sockaddr_l2tpip6 {
+       /* The first fields must match struct sockaddr_in6 */
+       __kernel_sa_family_t l2tp_family; /* AF_INET6 */
+       __be16          l2tp_unused;    /* INET port number (unused) */
+       __be32          l2tp_flowinfo;  /* IPv6 flow information */
+       struct in6_addr l2tp_addr;      /* IPv6 address */
+       __u32           l2tp_scope_id;  /* scope id (new in RFC2553) */
+       __u32           l2tp_conn_id;   /* Connection ID of tunnel */
+};
+
+/*****************************************************************************
+ *  NETLINK_GENERIC netlink family.
+ *****************************************************************************/
+
+/*
+ * Commands.
+ * Valid TLVs of each command are:-
+ * TUNNEL_CREATE       - CONN_ID, pw_type, netns, ifname, ipinfo, udpinfo, udpcsum, vlanid
+ * TUNNEL_DELETE       - CONN_ID
+ * TUNNEL_MODIFY       - CONN_ID, udpcsum
+ * TUNNEL_GETSTATS     - CONN_ID, (stats)
+ * TUNNEL_GET          - CONN_ID, (...)
+ * SESSION_CREATE      - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec
+ * SESSION_DELETE      - SESSION_ID
+ * SESSION_MODIFY      - SESSION_ID, data_seq
+ * SESSION_GET         - SESSION_ID, (...)
+ * SESSION_GETSTATS    - SESSION_ID, (stats)
+ *
+ */
+enum {
+       L2TP_CMD_NOOP,
+       L2TP_CMD_TUNNEL_CREATE,
+       L2TP_CMD_TUNNEL_DELETE,
+       L2TP_CMD_TUNNEL_MODIFY,
+       L2TP_CMD_TUNNEL_GET,
+       L2TP_CMD_SESSION_CREATE,
+       L2TP_CMD_SESSION_DELETE,
+       L2TP_CMD_SESSION_MODIFY,
+       L2TP_CMD_SESSION_GET,
+       __L2TP_CMD_MAX,
+};
+
+#define L2TP_CMD_MAX                   (__L2TP_CMD_MAX - 1)
+
+/*
+ * ATTR types defined for L2TP
+ */
+enum {
+       L2TP_ATTR_NONE,                 /* no data */
+       L2TP_ATTR_PW_TYPE,              /* u16, enum l2tp_pwtype */
+       L2TP_ATTR_ENCAP_TYPE,           /* u16, enum l2tp_encap_type */
+       L2TP_ATTR_OFFSET,               /* u16 */
+       L2TP_ATTR_DATA_SEQ,             /* u16 */
+       L2TP_ATTR_L2SPEC_TYPE,          /* u8, enum l2tp_l2spec_type */
+       L2TP_ATTR_L2SPEC_LEN,           /* u8, enum l2tp_l2spec_type */
+       L2TP_ATTR_PROTO_VERSION,        /* u8 */
+       L2TP_ATTR_IFNAME,               /* string */
+       L2TP_ATTR_CONN_ID,              /* u32 */
+       L2TP_ATTR_PEER_CONN_ID,         /* u32 */
+       L2TP_ATTR_SESSION_ID,           /* u32 */
+       L2TP_ATTR_PEER_SESSION_ID,      /* u32 */
+       L2TP_ATTR_UDP_CSUM,             /* u8 */
+       L2TP_ATTR_VLAN_ID,              /* u16 */
+       L2TP_ATTR_COOKIE,               /* 0, 4 or 8 bytes */
+       L2TP_ATTR_PEER_COOKIE,          /* 0, 4 or 8 bytes */
+       L2TP_ATTR_DEBUG,                /* u32 */
+       L2TP_ATTR_RECV_SEQ,             /* u8 */
+       L2TP_ATTR_SEND_SEQ,             /* u8 */
+       L2TP_ATTR_LNS_MODE,             /* u8 */
+       L2TP_ATTR_USING_IPSEC,          /* u8 */
+       L2TP_ATTR_RECV_TIMEOUT,         /* msec */
+       L2TP_ATTR_FD,                   /* int */
+       L2TP_ATTR_IP_SADDR,             /* u32 */
+       L2TP_ATTR_IP_DADDR,             /* u32 */
+       L2TP_ATTR_UDP_SPORT,            /* u16 */
+       L2TP_ATTR_UDP_DPORT,            /* u16 */
+       L2TP_ATTR_MTU,                  /* u16 */
+       L2TP_ATTR_MRU,                  /* u16 */
+       L2TP_ATTR_STATS,                /* nested */
+       L2TP_ATTR_IP6_SADDR,            /* struct in6_addr */
+       L2TP_ATTR_IP6_DADDR,            /* struct in6_addr */
+       __L2TP_ATTR_MAX,
+};
+
+#define L2TP_ATTR_MAX                  (__L2TP_ATTR_MAX - 1)
+
+/* Nested in L2TP_ATTR_STATS */
+enum {
+       L2TP_ATTR_STATS_NONE,           /* no data */
+       L2TP_ATTR_TX_PACKETS,           /* u64 */
+       L2TP_ATTR_TX_BYTES,             /* u64 */
+       L2TP_ATTR_TX_ERRORS,            /* u64 */
+       L2TP_ATTR_RX_PACKETS,           /* u64 */
+       L2TP_ATTR_RX_BYTES,             /* u64 */
+       L2TP_ATTR_RX_SEQ_DISCARDS,      /* u64 */
+       L2TP_ATTR_RX_OOS_PACKETS,       /* u64 */
+       L2TP_ATTR_RX_ERRORS,            /* u64 */
+       __L2TP_ATTR_STATS_MAX,
+};
+
+#define L2TP_ATTR_STATS_MAX            (__L2TP_ATTR_STATS_MAX - 1)
+
+enum l2tp_pwtype {
+       L2TP_PWTYPE_NONE = 0x0000,
+       L2TP_PWTYPE_ETH_VLAN = 0x0004,
+       L2TP_PWTYPE_ETH = 0x0005,
+       L2TP_PWTYPE_PPP = 0x0007,
+       L2TP_PWTYPE_PPP_AC = 0x0008,
+       L2TP_PWTYPE_IP = 0x000b,
+       __L2TP_PWTYPE_MAX
+};
+
+enum l2tp_l2spec_type {
+       L2TP_L2SPECTYPE_NONE,
+       L2TP_L2SPECTYPE_DEFAULT,
+};
+
+enum l2tp_encap_type {
+       L2TP_ENCAPTYPE_UDP,
+       L2TP_ENCAPTYPE_IP,
+};
+
+enum l2tp_seqmode {
+       L2TP_SEQ_NONE = 0,
+       L2TP_SEQ_IP = 1,
+       L2TP_SEQ_ALL = 2,
+};
+
+/*
+ * NETLINK_GENERIC related info
+ */
+#define L2TP_GENL_NAME         "l2tp"
+#define L2TP_GENL_VERSION      0x1
+
+#endif /* _UAPI_LINUX_L2TP_H_ */
diff --git a/include/uapi/linux/llc.h b/include/uapi/linux/llc.h
new file mode 100644 (file)
index 0000000..9c987a4
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
+ *
+ * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#ifndef _UAPI__LINUX_LLC_H
+#define _UAPI__LINUX_LLC_H
+
+#include <linux/socket.h>
+
+#define __LLC_SOCK_SIZE__ 16   /* sizeof(sockaddr_llc), word align. */
+struct sockaddr_llc {
+       __kernel_sa_family_t sllc_family; /* AF_LLC */
+       __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
+       unsigned char   sllc_test;
+       unsigned char   sllc_xid;
+       unsigned char   sllc_ua;        /* UA data, only for SOCK_STREAM. */
+       unsigned char   sllc_sap;
+       unsigned char   sllc_mac[IFHWADDRLEN];
+       unsigned char   __pad[__LLC_SOCK_SIZE__ -
+                             sizeof(__kernel_sa_family_t) * 2 -
+                             sizeof(unsigned char) * 4 - IFHWADDRLEN];
+};
+
+/* sockopt definitions. */
+enum llc_sockopts {
+       LLC_OPT_UNKNOWN = 0,
+       LLC_OPT_RETRY,          /* max retrans attempts. */
+       LLC_OPT_SIZE,           /* max PDU size (octets). */
+       LLC_OPT_ACK_TMR_EXP,    /* ack expire time (secs). */
+       LLC_OPT_P_TMR_EXP,      /* pf cycle expire time (secs). */
+       LLC_OPT_REJ_TMR_EXP,    /* rej sent expire time (secs). */
+       LLC_OPT_BUSY_TMR_EXP,   /* busy state expire time (secs). */
+       LLC_OPT_TX_WIN,         /* tx window size. */
+       LLC_OPT_RX_WIN,         /* rx window size. */
+       LLC_OPT_PKTINFO,        /* ancillary packet information. */
+       LLC_OPT_MAX
+};
+
+#define LLC_OPT_MAX_RETRY       100
+#define LLC_OPT_MAX_SIZE       4196
+#define LLC_OPT_MAX_WIN                 127
+#define LLC_OPT_MAX_ACK_TMR_EXP          60
+#define LLC_OPT_MAX_P_TMR_EXP    60
+#define LLC_OPT_MAX_REJ_TMR_EXP          60
+#define LLC_OPT_MAX_BUSY_TMR_EXP  60
+
+/* LLC SAP types. */
+#define LLC_SAP_NULL   0x00            /* NULL SAP.                    */
+#define LLC_SAP_LLC    0x02            /* LLC Sublayer Management.     */
+#define LLC_SAP_SNA    0x04            /* SNA Path Control.            */
+#define LLC_SAP_PNM    0x0E            /* Proway Network Management.   */      
+#define LLC_SAP_IP     0x06            /* TCP/IP.                      */
+#define LLC_SAP_BSPAN  0x42            /* Bridge Spanning Tree Proto   */
+#define LLC_SAP_MMS    0x4E            /* Manufacturing Message Srv.   */
+#define LLC_SAP_8208   0x7E            /* ISO 8208                     */
+#define LLC_SAP_3COM   0x80            /* 3COM.                        */
+#define LLC_SAP_PRO    0x8E            /* Proway Active Station List   */
+#define LLC_SAP_SNAP   0xAA            /* SNAP.                        */
+#define LLC_SAP_BANYAN 0xBC            /* Banyan.                      */
+#define LLC_SAP_IPX    0xE0            /* IPX/SPX.                     */
+#define LLC_SAP_NETBEUI        0xF0            /* NetBEUI.                     */
+#define LLC_SAP_LANMGR 0xF4            /* LanManager.                  */
+#define LLC_SAP_IMPL   0xF8            /* IMPL                         */
+#define LLC_SAP_DISC   0xFC            /* Discovery                    */
+#define LLC_SAP_OSI    0xFE            /* OSI Network Layers.          */
+#define LLC_SAP_LAR    0xDC            /* LAN Address Resolution       */
+#define LLC_SAP_RM     0xD4            /* Resource Management          */
+#define LLC_SAP_GLOBAL 0xFF            /* Global SAP.                  */
+
+struct llc_pktinfo {
+       int lpi_ifindex;
+       unsigned char lpi_sap;
+       unsigned char lpi_mac[IFHWADDRLEN];
+};
+
+#endif /* _UAPI__LINUX_LLC_H */
diff --git a/include/uapi/linux/loop.h b/include/uapi/linux/loop.h
new file mode 100644 (file)
index 0000000..e0cecd2
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * include/linux/loop.h
+ *
+ * Written by Theodore Ts'o, 3/29/93.
+ *
+ * Copyright 1993 by Theodore Ts'o.  Redistribution of this file is
+ * permitted under the GNU General Public License.
+ */
+#ifndef _UAPI_LINUX_LOOP_H
+#define _UAPI_LINUX_LOOP_H
+
+
+#define LO_NAME_SIZE   64
+#define LO_KEY_SIZE    32
+
+
+/*
+ * Loop flags
+ */
+enum {
+       LO_FLAGS_READ_ONLY      = 1,
+       LO_FLAGS_AUTOCLEAR      = 4,
+       LO_FLAGS_PARTSCAN       = 8,
+};
+
+#include <asm/posix_types.h>   /* for __kernel_old_dev_t */
+#include <linux/types.h>       /* for __u64 */
+
+/* Backwards compatibility version */
+struct loop_info {
+       int                lo_number;           /* ioctl r/o */
+       __kernel_old_dev_t lo_device;           /* ioctl r/o */
+       unsigned long      lo_inode;            /* ioctl r/o */
+       __kernel_old_dev_t lo_rdevice;          /* ioctl r/o */
+       int                lo_offset;
+       int                lo_encrypt_type;
+       int                lo_encrypt_key_size;         /* ioctl w/o */
+       int                lo_flags;                    /* ioctl r/o */
+       char               lo_name[LO_NAME_SIZE];
+       unsigned char      lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+       unsigned long      lo_init[2];
+       char               reserved[4];
+};
+
+struct loop_info64 {
+       __u64              lo_device;                   /* ioctl r/o */
+       __u64              lo_inode;                    /* ioctl r/o */
+       __u64              lo_rdevice;                  /* ioctl r/o */
+       __u64              lo_offset;
+       __u64              lo_sizelimit;/* bytes, 0 == max available */
+       __u32              lo_number;                   /* ioctl r/o */
+       __u32              lo_encrypt_type;
+       __u32              lo_encrypt_key_size;         /* ioctl w/o */
+       __u32              lo_flags;                    /* ioctl r/o */
+       __u8               lo_file_name[LO_NAME_SIZE];
+       __u8               lo_crypt_name[LO_NAME_SIZE];
+       __u8               lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+       __u64              lo_init[2];
+};
+
+/*
+ * Loop filter types
+ */
+
+#define LO_CRYPT_NONE          0
+#define LO_CRYPT_XOR           1
+#define LO_CRYPT_DES           2
+#define LO_CRYPT_FISH2         3    /* Twofish encryption */
+#define LO_CRYPT_BLOW          4
+#define LO_CRYPT_CAST128       5
+#define LO_CRYPT_IDEA          6
+#define LO_CRYPT_DUMMY         9
+#define LO_CRYPT_SKIPJACK      10
+#define LO_CRYPT_CRYPTOAPI     18
+#define MAX_LO_CRYPT           20
+
+/*
+ * IOCTL commands --- we will commandeer 0x4C ('L')
+ */
+
+#define LOOP_SET_FD            0x4C00
+#define LOOP_CLR_FD            0x4C01
+#define LOOP_SET_STATUS                0x4C02
+#define LOOP_GET_STATUS                0x4C03
+#define LOOP_SET_STATUS64      0x4C04
+#define LOOP_GET_STATUS64      0x4C05
+#define LOOP_CHANGE_FD         0x4C06
+#define LOOP_SET_CAPACITY      0x4C07
+
+/* /dev/loop-control interface */
+#define LOOP_CTL_ADD           0x4C80
+#define LOOP_CTL_REMOVE                0x4C81
+#define LOOP_CTL_GET_FREE      0x4C82
+#endif /* _UAPI_LINUX_LOOP_H */
diff --git a/include/uapi/linux/lp.h b/include/uapi/linux/lp.h
new file mode 100644 (file)
index 0000000..a3406a5
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * usr/include/linux/lp.h c.1991-1992 James Wiegand
+ * many modifications copyright (C) 1992 Michael K. Johnson
+ * Interrupt support added 1993 Nigel Gamble
+ * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti 
+ */
+#ifndef _UAPI_LINUX_LP_H
+#define _UAPI_LINUX_LP_H
+
+
+/*
+ * Per POSIX guidelines, this module reserves the LP and lp prefixes
+ * These are the lp_table[minor].flags flags...
+ */
+#define LP_EXIST 0x0001
+#define LP_SELEC 0x0002
+#define LP_BUSY         0x0004
+#define LP_BUSY_BIT_POS 2
+#define LP_OFFL         0x0008
+#define LP_NOPA  0x0010
+#define LP_ERR   0x0020
+#define LP_ABORT 0x0040
+#define LP_CAREFUL 0x0080 /* obsoleted -arca */
+#define LP_ABORTOPEN 0x0100
+
+#define LP_TRUST_IRQ_  0x0200 /* obsolete */
+#define LP_NO_REVERSE  0x0400 /* No reverse mode available. */
+#define LP_DATA_AVAIL  0x0800 /* Data is available. */
+
+/* 
+ * bit defines for 8255 status port
+ * base + 1
+ * accessed with LP_S(minor), which gets the byte...
+ */
+#define LP_PBUSY       0x80  /* inverted input, active high */
+#define LP_PACK                0x40  /* unchanged input, active low */
+#define LP_POUTPA      0x20  /* unchanged input, active high */
+#define LP_PSELECD     0x10  /* unchanged input, active high */
+#define LP_PERRORP     0x08  /* unchanged input, active low */
+
+/* timeout for each character.  This is relative to bus cycles -- it
+ * is the count in a busy loop.  THIS IS THE VALUE TO CHANGE if you
+ * have extremely slow printing, or if the machine seems to slow down
+ * a lot when you print.  If you have slow printing, increase this
+ * number and recompile, and if your system gets bogged down, decrease
+ * this number.  This can be changed with the tunelp(8) command as well.
+ */
+
+#define LP_INIT_CHAR 1000
+
+/* The parallel port specs apparently say that there needs to be
+ * a .5usec wait before and after the strobe.
+ */
+
+#define LP_INIT_WAIT 1
+
+/* This is the amount of time that the driver waits for the printer to
+ * catch up when the printer's buffer appears to be filled.  If you
+ * want to tune this and have a fast printer (i.e. HPIIIP), decrease
+ * this number, and if you have a slow printer, increase this number.
+ * This is in hundredths of a second, the default 2 being .05 second.
+ * Or use the tunelp(8) command, which is especially nice if you want
+ * change back and forth between character and graphics printing, which
+ * are wildly different...
+ */
+
+#define LP_INIT_TIME 2
+
+/* IOCTL numbers */
+#define LPCHAR   0x0601  /* corresponds to LP_INIT_CHAR */
+#define LPTIME   0x0602  /* corresponds to LP_INIT_TIME */
+#define LPABORT  0x0604  /* call with TRUE arg to abort on error,
+                           FALSE to retry.  Default is retry.  */
+#define LPSETIRQ 0x0605  /* call with new IRQ number,
+                           or 0 for polling (no IRQ) */
+#define LPGETIRQ 0x0606  /* get the current IRQ number */
+#define LPWAIT   0x0608  /* corresponds to LP_INIT_WAIT */
+/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
+#define LPCAREFUL   0x0609  /* call with TRUE arg to require out-of-paper, off-
+                           line, and error indicators good on all writes,
+                           FALSE to ignore them.  Default is ignore. */
+#define LPABORTOPEN 0x060a  /* call with TRUE arg to abort open() on error,
+                           FALSE to ignore error.  Default is ignore.  */
+#define LPGETSTATUS 0x060b  /* return LP_S(minor) */
+#define LPRESET     0x060c  /* reset printer */
+#ifdef LP_STATS
+#define LPGETSTATS  0x060d  /* get statistics (struct lp_stats) */
+#endif
+#define LPGETFLAGS  0x060e  /* get status flags */
+#define LPSETTIMEOUT 0x060f /* set parport timeout */
+
+/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
+   This is also used for re-checking error conditions if LP_ABORT is
+   not set.  This is the default behavior. */
+
+#define LP_TIMEOUT_INTERRUPT   (60 * HZ)
+#define LP_TIMEOUT_POLLED      (10 * HZ)
+
+
+#endif /* _UAPI_LINUX_LP_H */
diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
new file mode 100644 (file)
index 0000000..c94a510
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * linux/mdio.h: definitions for MDIO (clause 45) transceivers
+ * Copyright 2006-2009 Solarflare Communications Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation, incorporated herein by reference.
+ */
+
+#ifndef _UAPI__LINUX_MDIO_H__
+#define _UAPI__LINUX_MDIO_H__
+
+#include <linux/types.h>
+#include <linux/mii.h>
+
+/* MDIO Manageable Devices (MMDs). */
+#define MDIO_MMD_PMAPMD                1       /* Physical Medium Attachment/
+                                        * Physical Medium Dependent */
+#define MDIO_MMD_WIS           2       /* WAN Interface Sublayer */
+#define MDIO_MMD_PCS           3       /* Physical Coding Sublayer */
+#define MDIO_MMD_PHYXS         4       /* PHY Extender Sublayer */
+#define MDIO_MMD_DTEXS         5       /* DTE Extender Sublayer */
+#define MDIO_MMD_TC            6       /* Transmission Convergence */
+#define MDIO_MMD_AN            7       /* Auto-Negotiation */
+#define MDIO_MMD_C22EXT                29      /* Clause 22 extension */
+#define MDIO_MMD_VEND1         30      /* Vendor specific 1 */
+#define MDIO_MMD_VEND2         31      /* Vendor specific 2 */
+
+/* Generic MDIO registers. */
+#define MDIO_CTRL1             MII_BMCR
+#define MDIO_STAT1             MII_BMSR
+#define MDIO_DEVID1            MII_PHYSID1
+#define MDIO_DEVID2            MII_PHYSID2
+#define MDIO_SPEED             4       /* Speed ability */
+#define MDIO_DEVS1             5       /* Devices in package */
+#define MDIO_DEVS2             6
+#define MDIO_CTRL2             7       /* 10G control 2 */
+#define MDIO_STAT2             8       /* 10G status 2 */
+#define MDIO_PMA_TXDIS         9       /* 10G PMA/PMD transmit disable */
+#define MDIO_PMA_RXDET         10      /* 10G PMA/PMD receive signal detect */
+#define MDIO_PMA_EXTABLE       11      /* 10G PMA/PMD extended ability */
+#define MDIO_PKGID1            14      /* Package identifier */
+#define MDIO_PKGID2            15
+#define MDIO_AN_ADVERTISE      16      /* AN advertising (base page) */
+#define MDIO_AN_LPA            19      /* AN LP abilities (base page) */
+#define MDIO_PCS_EEE_ABLE      20      /* EEE Capability register */
+#define MDIO_PCS_EEE_WK_ERR    22      /* EEE wake error counter */
+#define MDIO_PHYXS_LNSTAT      24      /* PHY XGXS lane state */
+#define MDIO_AN_EEE_ADV                60      /* EEE advertisement */
+#define MDIO_AN_EEE_LPABLE     61      /* EEE link partner ability */
+
+/* Media-dependent registers. */
+#define MDIO_PMA_10GBT_SWAPPOL 130     /* 10GBASE-T pair swap & polarity */
+#define MDIO_PMA_10GBT_TXPWR   131     /* 10GBASE-T TX power control */
+#define MDIO_PMA_10GBT_SNR     133     /* 10GBASE-T SNR margin, lane A.
+                                        * Lanes B-D are numbered 134-136. */
+#define MDIO_PMA_10GBR_FECABLE 170     /* 10GBASE-R FEC ability */
+#define MDIO_PCS_10GBX_STAT1   24      /* 10GBASE-X PCS status 1 */
+#define MDIO_PCS_10GBRT_STAT1  32      /* 10GBASE-R/-T PCS status 1 */
+#define MDIO_PCS_10GBRT_STAT2  33      /* 10GBASE-R/-T PCS status 2 */
+#define MDIO_AN_10GBT_CTRL     32      /* 10GBASE-T auto-negotiation control */
+#define MDIO_AN_10GBT_STAT     33      /* 10GBASE-T auto-negotiation status */
+
+/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
+#define MDIO_PMA_LASI_RXCTRL   0x9000  /* RX_ALARM control */
+#define MDIO_PMA_LASI_TXCTRL   0x9001  /* TX_ALARM control */
+#define MDIO_PMA_LASI_CTRL     0x9002  /* LASI control */
+#define MDIO_PMA_LASI_RXSTAT   0x9003  /* RX_ALARM status */
+#define MDIO_PMA_LASI_TXSTAT   0x9004  /* TX_ALARM status */
+#define MDIO_PMA_LASI_STAT     0x9005  /* LASI status */
+
+/* Control register 1. */
+/* Enable extended speed selection */
+#define MDIO_CTRL1_SPEEDSELEXT         (BMCR_SPEED1000 | BMCR_SPEED100)
+/* All speed selection bits */
+#define MDIO_CTRL1_SPEEDSEL            (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
+#define MDIO_CTRL1_FULLDPLX            BMCR_FULLDPLX
+#define MDIO_CTRL1_LPOWER              BMCR_PDOWN
+#define MDIO_CTRL1_RESET               BMCR_RESET
+#define MDIO_PMA_CTRL1_LOOPBACK                0x0001
+#define MDIO_PMA_CTRL1_SPEED1000       BMCR_SPEED1000
+#define MDIO_PMA_CTRL1_SPEED100                BMCR_SPEED100
+#define MDIO_PCS_CTRL1_LOOPBACK                BMCR_LOOPBACK
+#define MDIO_PHYXS_CTRL1_LOOPBACK      BMCR_LOOPBACK
+#define MDIO_AN_CTRL1_RESTART          BMCR_ANRESTART
+#define MDIO_AN_CTRL1_ENABLE           BMCR_ANENABLE
+#define MDIO_AN_CTRL1_XNP              0x2000  /* Enable extended next page */
+#define MDIO_PCS_CTRL1_CLKSTOP_EN      0x400   /* Stop the clock during LPI */
+
+/* 10 Gb/s */
+#define MDIO_CTRL1_SPEED10G            (MDIO_CTRL1_SPEEDSELEXT | 0x00)
+/* 10PASS-TS/2BASE-TL */
+#define MDIO_CTRL1_SPEED10P2B          (MDIO_CTRL1_SPEEDSELEXT | 0x04)
+
+/* Status register 1. */
+#define MDIO_STAT1_LPOWERABLE          0x0002  /* Low-power ability */
+#define MDIO_STAT1_LSTATUS             BMSR_LSTATUS
+#define MDIO_STAT1_FAULT               0x0080  /* Fault */
+#define MDIO_AN_STAT1_LPABLE           0x0001  /* Link partner AN ability */
+#define MDIO_AN_STAT1_ABLE             BMSR_ANEGCAPABLE
+#define MDIO_AN_STAT1_RFAULT           BMSR_RFAULT
+#define MDIO_AN_STAT1_COMPLETE         BMSR_ANEGCOMPLETE
+#define MDIO_AN_STAT1_PAGE             0x0040  /* Page received */
+#define MDIO_AN_STAT1_XNP              0x0080  /* Extended next page status */
+
+/* Speed register. */
+#define MDIO_SPEED_10G                 0x0001  /* 10G capable */
+#define MDIO_PMA_SPEED_2B              0x0002  /* 2BASE-TL capable */
+#define MDIO_PMA_SPEED_10P             0x0004  /* 10PASS-TS capable */
+#define MDIO_PMA_SPEED_1000            0x0010  /* 1000M capable */
+#define MDIO_PMA_SPEED_100             0x0020  /* 100M capable */
+#define MDIO_PMA_SPEED_10              0x0040  /* 10M capable */
+#define MDIO_PCS_SPEED_10P2B           0x0002  /* 10PASS-TS/2BASE-TL capable */
+
+/* Device present registers. */
+#define MDIO_DEVS_PRESENT(devad)       (1 << (devad))
+#define MDIO_DEVS_PMAPMD               MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
+#define MDIO_DEVS_WIS                  MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
+#define MDIO_DEVS_PCS                  MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
+#define MDIO_DEVS_PHYXS                        MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
+#define MDIO_DEVS_DTEXS                        MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
+#define MDIO_DEVS_TC                   MDIO_DEVS_PRESENT(MDIO_MMD_TC)
+#define MDIO_DEVS_AN                   MDIO_DEVS_PRESENT(MDIO_MMD_AN)
+#define MDIO_DEVS_C22EXT               MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
+
+/* Control register 2. */
+#define MDIO_PMA_CTRL2_TYPE            0x000f  /* PMA/PMD type selection */
+#define MDIO_PMA_CTRL2_10GBCX4         0x0000  /* 10GBASE-CX4 type */
+#define MDIO_PMA_CTRL2_10GBEW          0x0001  /* 10GBASE-EW type */
+#define MDIO_PMA_CTRL2_10GBLW          0x0002  /* 10GBASE-LW type */
+#define MDIO_PMA_CTRL2_10GBSW          0x0003  /* 10GBASE-SW type */
+#define MDIO_PMA_CTRL2_10GBLX4         0x0004  /* 10GBASE-LX4 type */
+#define MDIO_PMA_CTRL2_10GBER          0x0005  /* 10GBASE-ER type */
+#define MDIO_PMA_CTRL2_10GBLR          0x0006  /* 10GBASE-LR type */
+#define MDIO_PMA_CTRL2_10GBSR          0x0007  /* 10GBASE-SR type */
+#define MDIO_PMA_CTRL2_10GBLRM         0x0008  /* 10GBASE-LRM type */
+#define MDIO_PMA_CTRL2_10GBT           0x0009  /* 10GBASE-T type */
+#define MDIO_PMA_CTRL2_10GBKX4         0x000a  /* 10GBASE-KX4 type */
+#define MDIO_PMA_CTRL2_10GBKR          0x000b  /* 10GBASE-KR type */
+#define MDIO_PMA_CTRL2_1000BT          0x000c  /* 1000BASE-T type */
+#define MDIO_PMA_CTRL2_1000BKX         0x000d  /* 1000BASE-KX type */
+#define MDIO_PMA_CTRL2_100BTX          0x000e  /* 100BASE-TX type */
+#define MDIO_PMA_CTRL2_10BT            0x000f  /* 10BASE-T type */
+#define MDIO_PCS_CTRL2_TYPE            0x0003  /* PCS type selection */
+#define MDIO_PCS_CTRL2_10GBR           0x0000  /* 10GBASE-R type */
+#define MDIO_PCS_CTRL2_10GBX           0x0001  /* 10GBASE-X type */
+#define MDIO_PCS_CTRL2_10GBW           0x0002  /* 10GBASE-W type */
+#define MDIO_PCS_CTRL2_10GBT           0x0003  /* 10GBASE-T type */
+
+/* Status register 2. */
+#define MDIO_STAT2_RXFAULT             0x0400  /* Receive fault */
+#define MDIO_STAT2_TXFAULT             0x0800  /* Transmit fault */
+#define MDIO_STAT2_DEVPRST             0xc000  /* Device present */
+#define MDIO_STAT2_DEVPRST_VAL         0x8000  /* Device present value */
+#define MDIO_PMA_STAT2_LBABLE          0x0001  /* PMA loopback ability */
+#define MDIO_PMA_STAT2_10GBEW          0x0002  /* 10GBASE-EW ability */
+#define MDIO_PMA_STAT2_10GBLW          0x0004  /* 10GBASE-LW ability */
+#define MDIO_PMA_STAT2_10GBSW          0x0008  /* 10GBASE-SW ability */
+#define MDIO_PMA_STAT2_10GBLX4         0x0010  /* 10GBASE-LX4 ability */
+#define MDIO_PMA_STAT2_10GBER          0x0020  /* 10GBASE-ER ability */
+#define MDIO_PMA_STAT2_10GBLR          0x0040  /* 10GBASE-LR ability */
+#define MDIO_PMA_STAT2_10GBSR          0x0080  /* 10GBASE-SR ability */
+#define MDIO_PMD_STAT2_TXDISAB         0x0100  /* PMD TX disable ability */
+#define MDIO_PMA_STAT2_EXTABLE         0x0200  /* Extended abilities */
+#define MDIO_PMA_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
+#define MDIO_PMA_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
+#define MDIO_PCS_STAT2_10GBR           0x0001  /* 10GBASE-R capable */
+#define MDIO_PCS_STAT2_10GBX           0x0002  /* 10GBASE-X capable */
+#define MDIO_PCS_STAT2_10GBW           0x0004  /* 10GBASE-W capable */
+#define MDIO_PCS_STAT2_RXFLTABLE       0x1000  /* Receive fault ability */
+#define MDIO_PCS_STAT2_TXFLTABLE       0x2000  /* Transmit fault ability */
+
+/* Transmit disable register. */
+#define MDIO_PMD_TXDIS_GLOBAL          0x0001  /* Global PMD TX disable */
+#define MDIO_PMD_TXDIS_0               0x0002  /* PMD TX disable 0 */
+#define MDIO_PMD_TXDIS_1               0x0004  /* PMD TX disable 1 */
+#define MDIO_PMD_TXDIS_2               0x0008  /* PMD TX disable 2 */
+#define MDIO_PMD_TXDIS_3               0x0010  /* PMD TX disable 3 */
+
+/* Receive signal detect register. */
+#define MDIO_PMD_RXDET_GLOBAL          0x0001  /* Global PMD RX signal detect */
+#define MDIO_PMD_RXDET_0               0x0002  /* PMD RX signal detect 0 */
+#define MDIO_PMD_RXDET_1               0x0004  /* PMD RX signal detect 1 */
+#define MDIO_PMD_RXDET_2               0x0008  /* PMD RX signal detect 2 */
+#define MDIO_PMD_RXDET_3               0x0010  /* PMD RX signal detect 3 */
+
+/* Extended abilities register. */
+#define MDIO_PMA_EXTABLE_10GCX4                0x0001  /* 10GBASE-CX4 ability */
+#define MDIO_PMA_EXTABLE_10GBLRM       0x0002  /* 10GBASE-LRM ability */
+#define MDIO_PMA_EXTABLE_10GBT         0x0004  /* 10GBASE-T ability */
+#define MDIO_PMA_EXTABLE_10GBKX4       0x0008  /* 10GBASE-KX4 ability */
+#define MDIO_PMA_EXTABLE_10GBKR                0x0010  /* 10GBASE-KR ability */
+#define MDIO_PMA_EXTABLE_1000BT                0x0020  /* 1000BASE-T ability */
+#define MDIO_PMA_EXTABLE_1000BKX       0x0040  /* 1000BASE-KX ability */
+#define MDIO_PMA_EXTABLE_100BTX                0x0080  /* 100BASE-TX ability */
+#define MDIO_PMA_EXTABLE_10BT          0x0100  /* 10BASE-T ability */
+
+/* PHY XGXS lane state register. */
+#define MDIO_PHYXS_LNSTAT_SYNC0                0x0001
+#define MDIO_PHYXS_LNSTAT_SYNC1                0x0002
+#define MDIO_PHYXS_LNSTAT_SYNC2                0x0004
+#define MDIO_PHYXS_LNSTAT_SYNC3                0x0008
+#define MDIO_PHYXS_LNSTAT_ALIGN                0x1000
+
+/* PMA 10GBASE-T pair swap & polarity */
+#define MDIO_PMA_10GBT_SWAPPOL_ABNX    0x0001  /* Pair A/B uncrossed */
+#define MDIO_PMA_10GBT_SWAPPOL_CDNX    0x0002  /* Pair C/D uncrossed */
+#define MDIO_PMA_10GBT_SWAPPOL_AREV    0x0100  /* Pair A polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_BREV    0x0200  /* Pair B polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_CREV    0x0400  /* Pair C polarity reversed */
+#define MDIO_PMA_10GBT_SWAPPOL_DREV    0x0800  /* Pair D polarity reversed */
+
+/* PMA 10GBASE-T TX power register. */
+#define MDIO_PMA_10GBT_TXPWR_SHORT     0x0001  /* Short-reach mode */
+
+/* PMA 10GBASE-T SNR registers. */
+/* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */
+#define MDIO_PMA_10GBT_SNR_BIAS                0x8000
+#define MDIO_PMA_10GBT_SNR_MAX         127
+
+/* PMA 10GBASE-R FEC ability register. */
+#define MDIO_PMA_10GBR_FECABLE_ABLE    0x0001  /* FEC ability */
+#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002  /* FEC error indic. ability */
+
+/* PCS 10GBASE-R/-T status register 1. */
+#define MDIO_PCS_10GBRT_STAT1_BLKLK    0x0001  /* Block lock attained */
+
+/* PCS 10GBASE-R/-T status register 2. */
+#define MDIO_PCS_10GBRT_STAT2_ERR      0x00ff
+#define MDIO_PCS_10GBRT_STAT2_BER      0x3f00
+
+/* AN 10GBASE-T control register. */
+#define MDIO_AN_10GBT_CTRL_ADV10G      0x1000  /* Advertise 10GBASE-T */
+
+/* AN 10GBASE-T status register. */
+#define MDIO_AN_10GBT_STAT_LPTRR       0x0200  /* LP training reset req. */
+#define MDIO_AN_10GBT_STAT_LPLTABLE    0x0400  /* LP loop timing ability */
+#define MDIO_AN_10GBT_STAT_LP10G       0x0800  /* LP is 10GBT capable */
+#define MDIO_AN_10GBT_STAT_REMOK       0x1000  /* Remote OK */
+#define MDIO_AN_10GBT_STAT_LOCOK       0x2000  /* Local OK */
+#define MDIO_AN_10GBT_STAT_MS          0x4000  /* Master/slave config */
+#define MDIO_AN_10GBT_STAT_MSFLT       0x8000  /* Master/slave config fault */
+
+/* EEE Supported/Advertisement/LP Advertisement registers.
+ *
+ * EEE capability Register (3.20), Advertisement (7.60) and
+ * Link partner ability (7.61) registers have and can use the same identical
+ * bit masks.
+ */
+#define MDIO_AN_EEE_ADV_100TX  0x0002  /* Advertise 100TX EEE cap */
+#define MDIO_AN_EEE_ADV_1000T  0x0004  /* Advertise 1000T EEE cap */
+/* Note: the two defines above can be potentially used by the user-land
+ * and cannot remove them now.
+ * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
+ * using the previous ones (that can be considered obsolete).
+ */
+#define MDIO_EEE_100TX         MDIO_AN_EEE_ADV_100TX   /* 100TX EEE cap */
+#define MDIO_EEE_1000T         MDIO_AN_EEE_ADV_1000T   /* 1000T EEE cap */
+#define MDIO_EEE_10GT          0x0008  /* 10GT EEE cap */
+#define MDIO_EEE_1000KX                0x0010  /* 1000KX EEE cap */
+#define MDIO_EEE_10GKX4                0x0020  /* 10G KX4 EEE cap */
+#define MDIO_EEE_10GKR         0x0040  /* 10G KR EEE cap */
+
+/* LASI RX_ALARM control/status registers. */
+#define MDIO_PMA_LASI_RX_PHYXSLFLT     0x0001  /* PHY XS RX local fault */
+#define MDIO_PMA_LASI_RX_PCSLFLT       0x0008  /* PCS RX local fault */
+#define MDIO_PMA_LASI_RX_PMALFLT       0x0010  /* PMA/PMD RX local fault */
+#define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020  /* RX optical power fault */
+#define MDIO_PMA_LASI_RX_WISLFLT       0x0200  /* WIS local fault */
+
+/* LASI TX_ALARM control/status registers. */
+#define MDIO_PMA_LASI_TX_PHYXSLFLT     0x0001  /* PHY XS TX local fault */
+#define MDIO_PMA_LASI_TX_PCSLFLT       0x0008  /* PCS TX local fault */
+#define MDIO_PMA_LASI_TX_PMALFLT       0x0010  /* PMA/PMD TX local fault */
+#define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080  /* Laser output power fault */
+#define MDIO_PMA_LASI_TX_LASERTEMPFLT  0x0100  /* Laser temperature fault */
+#define MDIO_PMA_LASI_TX_LASERBICURRFLT        0x0200  /* Laser bias current fault */
+
+/* LASI control/status registers. */
+#define MDIO_PMA_LASI_LSALARM          0x0001  /* LS_ALARM enable/status */
+#define MDIO_PMA_LASI_TXALARM          0x0002  /* TX_ALARM enable/status */
+#define MDIO_PMA_LASI_RXALARM          0x0004  /* RX_ALARM enable/status */
+
+/* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */
+
+#define MDIO_PHY_ID_C45                        0x8000
+#define MDIO_PHY_ID_PRTAD              0x03e0
+#define MDIO_PHY_ID_DEVAD              0x001f
+#define MDIO_PHY_ID_C45_MASK                                           \
+       (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
+
+static inline __u16 mdio_phy_id_c45(int prtad, int devad)
+{
+       return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
+}
+
+#endif /* _UAPI__LINUX_MDIO_H__ */
similarity index 100%
rename from include/linux/mei.h
rename to include/uapi/linux/mei.h
diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h
new file mode 100644 (file)
index 0000000..23e62e0
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * NUMA memory policies for Linux.
+ * Copyright 2003,2004 Andi Kleen SuSE Labs
+ */
+#ifndef _UAPI_LINUX_MEMPOLICY_H
+#define _UAPI_LINUX_MEMPOLICY_H
+
+#include <linux/errno.h>
+
+
+/*
+ * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
+ * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
+ * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
+ */
+
+/* Policies */
+enum {
+       MPOL_DEFAULT,
+       MPOL_PREFERRED,
+       MPOL_BIND,
+       MPOL_INTERLEAVE,
+       MPOL_MAX,       /* always last member of enum */
+};
+
+enum mpol_rebind_step {
+       MPOL_REBIND_ONCE,       /* do rebind work at once(not by two step) */
+       MPOL_REBIND_STEP1,      /* first step(set all the newly nodes) */
+       MPOL_REBIND_STEP2,      /* second step(clean all the disallowed nodes)*/
+       MPOL_REBIND_NSTEP,
+};
+
+/* Flags for set_mempolicy */
+#define MPOL_F_STATIC_NODES    (1 << 15)
+#define MPOL_F_RELATIVE_NODES  (1 << 14)
+
+/*
+ * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
+ * either set_mempolicy() or mbind().
+ */
+#define MPOL_MODE_FLAGS        (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
+
+/* Flags for get_mempolicy */
+#define MPOL_F_NODE    (1<<0)  /* return next IL mode instead of node mask */
+#define MPOL_F_ADDR    (1<<1)  /* look up vma using address */
+#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
+
+/* Flags for mbind */
+#define MPOL_MF_STRICT (1<<0)  /* Verify existing pages in the mapping */
+#define MPOL_MF_MOVE   (1<<1)  /* Move pages owned by this process to conform to mapping */
+#define MPOL_MF_MOVE_ALL (1<<2)        /* Move every page to conform to mapping */
+#define MPOL_MF_INTERNAL (1<<3)        /* Internal flags start here */
+
+/*
+ * Internal flags that share the struct mempolicy flags word with
+ * "mode flags".  These flags are allocated from bit 0 up, as they
+ * are never OR'ed into the mode in mempolicy API arguments.
+ */
+#define MPOL_F_SHARED  (1 << 0)        /* identify shared policies */
+#define MPOL_F_LOCAL   (1 << 1)        /* preferred local allocation */
+#define MPOL_F_REBINDING (1 << 2)      /* identify policies in rebinding */
+
+
+#endif /* _UAPI_LINUX_MEMPOLICY_H */
diff --git a/include/uapi/linux/mii.h b/include/uapi/linux/mii.h
new file mode 100644 (file)
index 0000000..237fac4
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * linux/mii.h: definitions for MII-compatible transceivers
+ * Originally drivers/net/sunhme.h.
+ *
+ * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef _UAPI__LINUX_MII_H__
+#define _UAPI__LINUX_MII_H__
+
+#include <linux/types.h>
+#include <linux/ethtool.h>
+
+/* Generic MII registers. */
+#define MII_BMCR               0x00    /* Basic mode control register */
+#define MII_BMSR               0x01    /* Basic mode status register  */
+#define MII_PHYSID1            0x02    /* PHYS ID 1                   */
+#define MII_PHYSID2            0x03    /* PHYS ID 2                   */
+#define MII_ADVERTISE          0x04    /* Advertisement control reg   */
+#define MII_LPA                        0x05    /* Link partner ability reg    */
+#define MII_EXPANSION          0x06    /* Expansion register          */
+#define MII_CTRL1000           0x09    /* 1000BASE-T control          */
+#define MII_STAT1000           0x0a    /* 1000BASE-T status           */
+#define        MII_MMD_CTRL            0x0d    /* MMD Access Control Register */
+#define        MII_MMD_DATA            0x0e    /* MMD Access Data Register */
+#define MII_ESTATUS            0x0f    /* Extended Status             */
+#define MII_DCOUNTER           0x12    /* Disconnect counter          */
+#define MII_FCSCOUNTER         0x13    /* False carrier counter       */
+#define MII_NWAYTEST           0x14    /* N-way auto-neg test reg     */
+#define MII_RERRCOUNTER                0x15    /* Receive error counter       */
+#define MII_SREVISION          0x16    /* Silicon revision            */
+#define MII_RESV1              0x17    /* Reserved...                 */
+#define MII_LBRERROR           0x18    /* Lpback, rx, bypass error    */
+#define MII_PHYADDR            0x19    /* PHY address                 */
+#define MII_RESV2              0x1a    /* Reserved...                 */
+#define MII_TPISTATUS          0x1b    /* TPI status for 10mbps       */
+#define MII_NCONFIG            0x1c    /* Network interface config    */
+
+/* Basic mode control register. */
+#define BMCR_RESV              0x003f  /* Unused...                   */
+#define BMCR_SPEED1000         0x0040  /* MSB of Speed (1000)         */
+#define BMCR_CTST              0x0080  /* Collision test              */
+#define BMCR_FULLDPLX          0x0100  /* Full duplex                 */
+#define BMCR_ANRESTART         0x0200  /* Auto negotiation restart    */
+#define BMCR_ISOLATE           0x0400  /* Isolate data paths from MII */
+#define BMCR_PDOWN             0x0800  /* Enable low power state      */
+#define BMCR_ANENABLE          0x1000  /* Enable auto negotiation     */
+#define BMCR_SPEED100          0x2000  /* Select 100Mbps              */
+#define BMCR_LOOPBACK          0x4000  /* TXD loopback bits           */
+#define BMCR_RESET             0x8000  /* Reset to default state      */
+
+/* Basic mode status register. */
+#define BMSR_ERCAP             0x0001  /* Ext-reg capability          */
+#define BMSR_JCD               0x0002  /* Jabber detected             */
+#define BMSR_LSTATUS           0x0004  /* Link status                 */
+#define BMSR_ANEGCAPABLE       0x0008  /* Able to do auto-negotiation */
+#define BMSR_RFAULT            0x0010  /* Remote fault detected       */
+#define BMSR_ANEGCOMPLETE      0x0020  /* Auto-negotiation complete   */
+#define BMSR_RESV              0x00c0  /* Unused...                   */
+#define BMSR_ESTATEN           0x0100  /* Extended Status in R15      */
+#define BMSR_100HALF2          0x0200  /* Can do 100BASE-T2 HDX       */
+#define BMSR_100FULL2          0x0400  /* Can do 100BASE-T2 FDX       */
+#define BMSR_10HALF            0x0800  /* Can do 10mbps, half-duplex  */
+#define BMSR_10FULL            0x1000  /* Can do 10mbps, full-duplex  */
+#define BMSR_100HALF           0x2000  /* Can do 100mbps, half-duplex */
+#define BMSR_100FULL           0x4000  /* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4          0x8000  /* Can do 100mbps, 4k packets  */
+
+/* Advertisement control register. */
+#define ADVERTISE_SLCT         0x001f  /* Selector bits               */
+#define ADVERTISE_CSMA         0x0001  /* Only selector supported     */
+#define ADVERTISE_10HALF       0x0020  /* Try for 10mbps half-duplex  */
+#define ADVERTISE_1000XFULL    0x0020  /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL       0x0040  /* Try for 10mbps full-duplex  */
+#define ADVERTISE_1000XHALF    0x0040  /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF      0x0080  /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE   0x0080  /* Try for 1000BASE-X pause    */
+#define ADVERTISE_100FULL      0x0100  /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM        0x0100  /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4     0x0200  /* Try for 100mbps 4k packets  */
+#define ADVERTISE_PAUSE_CAP    0x0400  /* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM   0x0800  /* Try for asymetric pause     */
+#define ADVERTISE_RESV         0x1000  /* Unused...                   */
+#define ADVERTISE_RFAULT       0x2000  /* Say we can detect faults    */
+#define ADVERTISE_LPACK                0x4000  /* Ack link partners response  */
+#define ADVERTISE_NPAGE                0x8000  /* Next page bit               */
+
+#define ADVERTISE_FULL         (ADVERTISE_100FULL | ADVERTISE_10FULL | \
+                                 ADVERTISE_CSMA)
+#define ADVERTISE_ALL          (ADVERTISE_10HALF | ADVERTISE_10FULL | \
+                                 ADVERTISE_100HALF | ADVERTISE_100FULL)
+
+/* Link partner ability register. */
+#define LPA_SLCT               0x001f  /* Same as advertise selector  */
+#define LPA_10HALF             0x0020  /* Can do 10mbps half-duplex   */
+#define LPA_1000XFULL          0x0020  /* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL             0x0040  /* Can do 10mbps full-duplex   */
+#define LPA_1000XHALF          0x0040  /* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF            0x0080  /* Can do 100mbps half-duplex  */
+#define LPA_1000XPAUSE         0x0080  /* Can do 1000BASE-X pause     */
+#define LPA_100FULL            0x0100  /* Can do 100mbps full-duplex  */
+#define LPA_1000XPAUSE_ASYM    0x0100  /* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4           0x0200  /* Can do 100mbps 4k packets   */
+#define LPA_PAUSE_CAP          0x0400  /* Can pause                   */
+#define LPA_PAUSE_ASYM         0x0800  /* Can pause asymetrically     */
+#define LPA_RESV               0x1000  /* Unused...                   */
+#define LPA_RFAULT             0x2000  /* Link partner faulted        */
+#define LPA_LPACK              0x4000  /* Link partner acked us       */
+#define LPA_NPAGE              0x8000  /* Next page bit               */
+
+#define LPA_DUPLEX             (LPA_10FULL | LPA_100FULL)
+#define LPA_100                        (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
+
+/* Expansion register for auto-negotiation. */
+#define EXPANSION_NWAY         0x0001  /* Can do N-way auto-nego      */
+#define EXPANSION_LCWP         0x0002  /* Got new RX page code word   */
+#define EXPANSION_ENABLENPAGE  0x0004  /* This enables npage words    */
+#define EXPANSION_NPCAPABLE    0x0008  /* Link partner supports npage */
+#define EXPANSION_MFAULTS      0x0010  /* Multiple faults detected    */
+#define EXPANSION_RESV         0xffe0  /* Unused...                   */
+
+#define ESTATUS_1000_TFULL     0x2000  /* Can do 1000BT Full          */
+#define ESTATUS_1000_THALF     0x1000  /* Can do 1000BT Half          */
+
+/* N-way test register. */
+#define NWAYTEST_RESV1         0x00ff  /* Unused...                   */
+#define NWAYTEST_LOOPBACK      0x0100  /* Enable loopback for N-way   */
+#define NWAYTEST_RESV2         0xfe00  /* Unused...                   */
+
+/* 1000BASE-T Control register */
+#define ADVERTISE_1000FULL     0x0200  /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF     0x0100  /* Advertise 1000BASE-T half duplex */
+#define CTL1000_AS_MASTER      0x0800
+#define CTL1000_ENABLE_MASTER  0x1000
+
+/* 1000BASE-T Status register */
+#define LPA_1000LOCALRXOK      0x2000  /* Link partner local receiver status */
+#define LPA_1000REMRXOK                0x1000  /* Link partner remote receiver status */
+#define LPA_1000FULL           0x0800  /* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF           0x0400  /* Link partner 1000BASE-T half duplex */
+
+/* Flow control flags */
+#define FLOW_CTRL_TX           0x01
+#define FLOW_CTRL_RX           0x02
+
+/* MMD Access Control register fields */
+#define MII_MMD_CTRL_DEVAD_MASK        0x1f    /* Mask MMD DEVAD*/
+#define MII_MMD_CTRL_ADDR      0x0000  /* Address */
+#define MII_MMD_CTRL_NOINCR    0x4000  /* no post increment */
+#define MII_MMD_CTRL_INCR_RDWT 0x8000  /* post increment on reads & writes */
+#define MII_MMD_CTRL_INCR_ON_WT        0xC000  /* post increment on writes only */
+
+/* This structure is used in all SIOCxMIIxxx ioctl calls */
+struct mii_ioctl_data {
+       __u16           phy_id;
+       __u16           reg_num;
+       __u16           val_in;
+       __u16           val_out;
+};
+
+#endif /* _UAPI__LINUX_MII_H__ */
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
new file mode 100644 (file)
index 0000000..ade4acd
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _UAPI_LINUX_MMAN_H
+#define _UAPI_LINUX_MMAN_H
+
+#include <asm/mman.h>
+
+#define MREMAP_MAYMOVE 1
+#define MREMAP_FIXED   2
+
+#define OVERCOMMIT_GUESS               0
+#define OVERCOMMIT_ALWAYS              1
+#define OVERCOMMIT_NEVER               2
+
+#endif /* _UAPI_LINUX_MMAN_H */
diff --git a/include/uapi/linux/mroute.h b/include/uapi/linux/mroute.h
new file mode 100644 (file)
index 0000000..1692999
--- /dev/null
@@ -0,0 +1,143 @@
+#ifndef _UAPI__LINUX_MROUTE_H
+#define _UAPI__LINUX_MROUTE_H
+
+#include <linux/sockios.h>
+#include <linux/types.h>
+
+/*
+ *     Based on the MROUTING 3.5 defines primarily to keep
+ *     source compatibility with BSD.
+ *
+ *     See the mrouted code for the original history.
+ *
+ *      Protocol Independent Multicast (PIM) data structures included
+ *      Carlos Picoto (cap@di.fc.ul.pt)
+ *
+ */
+
+#define MRT_BASE       200
+#define MRT_INIT       (MRT_BASE)      /* Activate the kernel mroute code      */
+#define MRT_DONE       (MRT_BASE+1)    /* Shutdown the kernel mroute           */
+#define MRT_ADD_VIF    (MRT_BASE+2)    /* Add a virtual interface              */
+#define MRT_DEL_VIF    (MRT_BASE+3)    /* Delete a virtual interface           */
+#define MRT_ADD_MFC    (MRT_BASE+4)    /* Add a multicast forwarding entry     */
+#define MRT_DEL_MFC    (MRT_BASE+5)    /* Delete a multicast forwarding entry  */
+#define MRT_VERSION    (MRT_BASE+6)    /* Get the kernel multicast version     */
+#define MRT_ASSERT     (MRT_BASE+7)    /* Activate PIM assert mode             */
+#define MRT_PIM                (MRT_BASE+8)    /* enable PIM code                      */
+#define MRT_TABLE      (MRT_BASE+9)    /* Specify mroute table ID              */
+
+#define SIOCGETVIFCNT  SIOCPROTOPRIVATE        /* IP protocol privates */
+#define SIOCGETSGCNT   (SIOCPROTOPRIVATE+1)
+#define SIOCGETRPF     (SIOCPROTOPRIVATE+2)
+
+#define MAXVIFS                32      
+typedef unsigned long vifbitmap_t;     /* User mode code depends on this lot */
+typedef unsigned short vifi_t;
+#define ALL_VIFS       ((vifi_t)(-1))
+
+/*
+ *     Same idea as select
+ */
+#define VIFM_SET(n,m)  ((m)|=(1<<(n)))
+#define VIFM_CLR(n,m)  ((m)&=~(1<<(n)))
+#define VIFM_ISSET(n,m)        ((m)&(1<<(n)))
+#define VIFM_CLRALL(m) ((m)=0)
+#define VIFM_COPY(mfrom,mto)   ((mto)=(mfrom))
+#define VIFM_SAME(m1,m2)       ((m1)==(m2))
+
+/*
+ *     Passed by mrouted for an MRT_ADD_VIF - again we use the
+ *     mrouted 3.6 structures for compatibility
+ */
+struct vifctl {
+       vifi_t  vifc_vifi;              /* Index of VIF */
+       unsigned char vifc_flags;       /* VIFF_ flags */
+       unsigned char vifc_threshold;   /* ttl limit */
+       unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
+       union {
+               struct in_addr vifc_lcl_addr;     /* Local interface address */
+               int            vifc_lcl_ifindex;  /* Local interface index   */
+       };
+       struct in_addr vifc_rmt_addr;   /* IPIP tunnel addr */
+};
+
+#define VIFF_TUNNEL            0x1     /* IPIP tunnel */
+#define VIFF_SRCRT             0x2     /* NI */
+#define VIFF_REGISTER          0x4     /* register vif */
+#define VIFF_USE_IFINDEX       0x8     /* use vifc_lcl_ifindex instead of
+                                          vifc_lcl_addr to find an interface */
+
+/*
+ *     Cache manipulation structures for mrouted and PIMd
+ */
+struct mfcctl {
+       struct in_addr mfcc_origin;             /* Origin of mcast      */
+       struct in_addr mfcc_mcastgrp;           /* Group in question    */
+       vifi_t  mfcc_parent;                    /* Where it arrived     */
+       unsigned char mfcc_ttls[MAXVIFS];       /* Where it is going    */
+       unsigned int mfcc_pkt_cnt;              /* pkt count for src-grp */
+       unsigned int mfcc_byte_cnt;
+       unsigned int mfcc_wrong_if;
+       int          mfcc_expire;
+};
+
+/* 
+ *     Group count retrieval for mrouted
+ */
+struct sioc_sg_req {
+       struct in_addr src;
+       struct in_addr grp;
+       unsigned long pktcnt;
+       unsigned long bytecnt;
+       unsigned long wrong_if;
+};
+
+/*
+ *     To get vif packet counts
+ */
+
+struct sioc_vif_req {
+       vifi_t  vifi;           /* Which iface */
+       unsigned long icount;   /* In packets */
+       unsigned long ocount;   /* Out packets */
+       unsigned long ibytes;   /* In bytes */
+       unsigned long obytes;   /* Out bytes */
+};
+
+/*
+ *     This is the format the mroute daemon expects to see IGMP control
+ *     data. Magically happens to be like an IP packet as per the original
+ */
+struct igmpmsg {
+       __u32 unused1,unused2;
+       unsigned char im_msgtype;               /* What is this */
+       unsigned char im_mbz;                   /* Must be zero */
+       unsigned char im_vif;                   /* Interface (this ought to be a vifi_t!) */
+       unsigned char unused3;
+       struct in_addr im_src,im_dst;
+};
+
+/*
+ *     That's all usermode folks
+ */
+
+
+
+#define MFC_ASSERT_THRESH (3*HZ)               /* Maximal freq. of asserts */
+
+/*
+ *     Pseudo messages used by mrouted
+ */
+
+#define IGMPMSG_NOCACHE                1               /* Kern cache fill request to mrouted */
+#define IGMPMSG_WRONGVIF       2               /* For PIM assert processing (unused) */
+#define IGMPMSG_WHOLEPKT       3               /* For PIM Register processing */
+
+
+#endif /* _UAPI__LINUX_MROUTE_H */
diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h
new file mode 100644 (file)
index 0000000..3e89b5e
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef _UAPI__LINUX_MROUTE6_H
+#define _UAPI__LINUX_MROUTE6_H
+
+#include <linux/types.h>
+#include <linux/sockios.h>
+
+/*
+ *     Based on the MROUTING 3.5 defines primarily to keep
+ *     source compatibility with BSD.
+ *
+ *     See the pim6sd code for the original history.
+ *
+ *      Protocol Independent Multicast (PIM) data structures included
+ *      Carlos Picoto (cap@di.fc.ul.pt)
+ *
+ */
+
+#define MRT6_BASE      200
+#define MRT6_INIT      (MRT6_BASE)     /* Activate the kernel mroute code      */
+#define MRT6_DONE      (MRT6_BASE+1)   /* Shutdown the kernel mroute           */
+#define MRT6_ADD_MIF   (MRT6_BASE+2)   /* Add a virtual interface              */
+#define MRT6_DEL_MIF   (MRT6_BASE+3)   /* Delete a virtual interface           */
+#define MRT6_ADD_MFC   (MRT6_BASE+4)   /* Add a multicast forwarding entry     */
+#define MRT6_DEL_MFC   (MRT6_BASE+5)   /* Delete a multicast forwarding entry  */
+#define MRT6_VERSION   (MRT6_BASE+6)   /* Get the kernel multicast version     */
+#define MRT6_ASSERT    (MRT6_BASE+7)   /* Activate PIM assert mode             */
+#define MRT6_PIM       (MRT6_BASE+8)   /* enable PIM code                      */
+#define MRT6_TABLE     (MRT6_BASE+9)   /* Specify mroute table ID              */
+
+#define SIOCGETMIFCNT_IN6      SIOCPROTOPRIVATE        /* IP protocol privates */
+#define SIOCGETSGCNT_IN6       (SIOCPROTOPRIVATE+1)
+#define SIOCGETRPF     (SIOCPROTOPRIVATE+2)
+
+#define MAXMIFS                32
+typedef unsigned long mifbitmap_t;     /* User mode code depends on this lot */
+typedef unsigned short mifi_t;
+#define ALL_MIFS       ((mifi_t)(-1))
+
+#ifndef IF_SETSIZE
+#define IF_SETSIZE     256
+#endif
+
+typedef        __u32           if_mask;
+#define NIFBITS (sizeof(if_mask) * 8)        /* bits per mask */
+
+#if !defined(__KERNEL__)
+#if !defined(DIV_ROUND_UP)
+#define        DIV_ROUND_UP(x,y)       (((x) + ((y) - 1)) / (y))
+#endif
+#endif
+
+typedef struct if_set {
+       if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
+} if_set;
+
+#define IF_SET(n, p)    ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
+#define IF_CLR(n, p)    ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
+#define IF_ISSET(n, p)  ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
+#define IF_COPY(f, t)   bcopy(f, t, sizeof(*(f)))
+#define IF_ZERO(p)      bzero(p, sizeof(*(p)))
+
+/*
+ *     Passed by mrouted for an MRT_ADD_MIF - again we use the
+ *     mrouted 3.6 structures for compatibility
+ */
+
+struct mif6ctl {
+       mifi_t  mif6c_mifi;             /* Index of MIF */
+       unsigned char mif6c_flags;      /* MIFF_ flags */
+       unsigned char vifc_threshold;   /* ttl limit */
+       __u16    mif6c_pifi;            /* the index of the physical IF */
+       unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
+};
+
+#define MIFF_REGISTER  0x1     /* register vif */
+
+/*
+ *     Cache manipulation structures for mrouted and PIMd
+ */
+
+struct mf6cctl {
+       struct sockaddr_in6 mf6cc_origin;               /* Origin of mcast      */
+       struct sockaddr_in6 mf6cc_mcastgrp;             /* Group in question    */
+       mifi_t  mf6cc_parent;                   /* Where it arrived     */
+       struct if_set mf6cc_ifset;              /* Where it is going */
+};
+
+/*
+ *     Group count retrieval for pim6sd
+ */
+
+struct sioc_sg_req6 {
+       struct sockaddr_in6 src;
+       struct sockaddr_in6 grp;
+       unsigned long pktcnt;
+       unsigned long bytecnt;
+       unsigned long wrong_if;
+};
+
+/*
+ *     To get vif packet counts
+ */
+
+struct sioc_mif_req6 {
+       mifi_t  mifi;           /* Which iface */
+       unsigned long icount;   /* In packets */
+       unsigned long ocount;   /* Out packets */
+       unsigned long ibytes;   /* In bytes */
+       unsigned long obytes;   /* Out bytes */
+};
+
+/*
+ *     That's all usermode folks
+ */
+
+
+
+/*
+ * Structure used to communicate from kernel to multicast router.
+ * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
+ * used for IPv4 implementation). This is because this structure will be passed via an
+ * IPv6 raw socket, on which an application will only receiver the payload i.e the data after
+ * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
+ */
+
+struct mrt6msg {
+#define MRT6MSG_NOCACHE                1
+#define MRT6MSG_WRONGMIF       2
+#define MRT6MSG_WHOLEPKT       3               /* used for use level encap */
+       __u8            im6_mbz;                /* must be zero            */
+       __u8            im6_msgtype;            /* what type of message    */
+       __u16           im6_mif;                /* mif rec'd on            */
+       __u32           im6_pad;                /* padding for 64 bit arch */
+       struct in6_addr im6_src, im6_dst;
+};
+
+#endif /* _UAPI__LINUX_MROUTE6_H */
diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
new file mode 100644 (file)
index 0000000..996719f
--- /dev/null
@@ -0,0 +1,167 @@
+#ifndef _UAPI_LINUX_MSDOS_FS_H
+#define _UAPI_LINUX_MSDOS_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+#include <asm/byteorder.h>
+
+/*
+ * The MS-DOS filesystem constants/structures
+ */
+
+#define SECTOR_SIZE    512             /* sector size (bytes) */
+#define SECTOR_BITS    9               /* log2(SECTOR_SIZE) */
+#define MSDOS_DPB      (MSDOS_DPS)     /* dir entries per block */
+#define MSDOS_DPB_BITS 4               /* log2(MSDOS_DPB) */
+#define MSDOS_DPS      (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
+#define MSDOS_DPS_BITS 4               /* log2(MSDOS_DPS) */
+#define MSDOS_LONGNAME 256             /* maximum name length */
+#define CF_LE_W(v)     le16_to_cpu(v)
+#define CF_LE_L(v)     le32_to_cpu(v)
+#define CT_LE_W(v)     cpu_to_le16(v)
+#define CT_LE_L(v)     cpu_to_le32(v)
+
+#define MSDOS_ROOT_INO  1      /* The root inode number */
+#define MSDOS_FSINFO_INO 2     /* Used for managing the FSINFO block */
+
+#define MSDOS_DIR_BITS 5       /* log2(sizeof(struct msdos_dir_entry)) */
+
+/* directory limit */
+#define FAT_MAX_DIR_ENTRIES    (65536)
+#define FAT_MAX_DIR_SIZE       (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
+
+#define ATTR_NONE      0       /* no attribute bits */
+#define ATTR_RO                1       /* read-only */
+#define ATTR_HIDDEN    2       /* hidden */
+#define ATTR_SYS       4       /* system */
+#define ATTR_VOLUME    8       /* volume label */
+#define ATTR_DIR       16      /* directory */
+#define ATTR_ARCH      32      /* archived */
+
+/* attribute bits that are copied "as is" */
+#define ATTR_UNUSED    (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+/* bits that are used by the Windows 95/Windows NT extended FAT */
+#define ATTR_EXT       (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+
+#define CASE_LOWER_BASE        8       /* base is lower case */
+#define CASE_LOWER_EXT 16      /* extension is lower case */
+
+#define DELETED_FLAG   0xe5    /* marks file as deleted when in name[0] */
+#define IS_FREE(n)     (!*(n) || *(n) == DELETED_FLAG)
+
+#define FAT_LFN_LEN    255     /* maximum long name length */
+#define MSDOS_NAME     11      /* maximum name length */
+#define MSDOS_SLOTS    21      /* max # of slots for short and long names */
+#define MSDOS_DOT      ".          "   /* ".", padded to MSDOS_NAME chars */
+#define MSDOS_DOTDOT   "..         "   /* "..", padded to MSDOS_NAME chars */
+
+#define FAT_FIRST_ENT(s, x)    ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
+       MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
+
+/* start of data cluster's entry (number of reserved clusters) */
+#define FAT_START_ENT  2
+
+/* maximum number of clusters */
+#define MAX_FAT12      0xFF4
+#define MAX_FAT16      0xFFF4
+#define MAX_FAT32      0x0FFFFFF6
+#define MAX_FAT(s)     (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
+       MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
+
+/* bad cluster mark */
+#define BAD_FAT12      0xFF7
+#define BAD_FAT16      0xFFF7
+#define BAD_FAT32      0x0FFFFFF7
+
+/* standard EOF */
+#define EOF_FAT12      0xFFF
+#define EOF_FAT16      0xFFFF
+#define EOF_FAT32      0x0FFFFFFF
+
+#define FAT_ENT_FREE   (0)
+#define FAT_ENT_BAD    (BAD_FAT32)
+#define FAT_ENT_EOF    (EOF_FAT32)
+
+#define FAT_FSINFO_SIG1        0x41615252
+#define FAT_FSINFO_SIG2        0x61417272
+#define IS_FSINFO(x)   (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
+                        && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
+
+struct __fat_dirent {
+       long            d_ino;
+       __kernel_off_t  d_off;
+       unsigned short  d_reclen;
+       char            d_name[256]; /* We must not include limits.h! */
+};
+
+/*
+ * ioctl commands
+ */
+#define VFAT_IOCTL_READDIR_BOTH                _IOR('r', 1, struct __fat_dirent[2])
+#define VFAT_IOCTL_READDIR_SHORT       _IOR('r', 2, struct __fat_dirent[2])
+/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
+#define FAT_IOCTL_GET_ATTRIBUTES       _IOR('r', 0x10, __u32)
+#define FAT_IOCTL_SET_ATTRIBUTES       _IOW('r', 0x11, __u32)
+
+struct fat_boot_sector {
+       __u8    ignored[3];     /* Boot strap short or near jump */
+       __u8    system_id[8];   /* Name - can be used to special case
+                                  partition manager volumes */
+       __u8    sector_size[2]; /* bytes per logical sector */
+       __u8    sec_per_clus;   /* sectors/cluster */
+       __le16  reserved;       /* reserved sectors */
+       __u8    fats;           /* number of FATs */
+       __u8    dir_entries[2]; /* root directory entries */
+       __u8    sectors[2];     /* number of sectors */
+       __u8    media;          /* media code */
+       __le16  fat_length;     /* sectors/FAT */
+       __le16  secs_track;     /* sectors per track */
+       __le16  heads;          /* number of heads */
+       __le32  hidden;         /* hidden sectors (unused) */
+       __le32  total_sect;     /* number of sectors (if sectors == 0) */
+
+       /* The following fields are only used by FAT32 */
+       __le32  fat32_length;   /* sectors/FAT */
+       __le16  flags;          /* bit 8: fat mirroring, low 4: active fat */
+       __u8    version[2];     /* major, minor filesystem version */
+       __le32  root_cluster;   /* first cluster in root directory */
+       __le16  info_sector;    /* filesystem info sector */
+       __le16  backup_boot;    /* backup boot sector */
+       __le16  reserved2[6];   /* Unused */
+};
+
+struct fat_boot_fsinfo {
+       __le32   signature1;    /* 0x41615252L */
+       __le32   reserved1[120];        /* Nothing as far as I can tell */
+       __le32   signature2;    /* 0x61417272L */
+       __le32   free_clusters; /* Free cluster count.  -1 if unknown */
+       __le32   next_cluster;  /* Most recently allocated cluster */
+       __le32   reserved2[4];
+};
+
+struct msdos_dir_entry {
+       __u8    name[MSDOS_NAME];/* name and extension */
+       __u8    attr;           /* attribute bits */
+       __u8    lcase;          /* Case for base and extension */
+       __u8    ctime_cs;       /* Creation time, centiseconds (0-199) */
+       __le16  ctime;          /* Creation time */
+       __le16  cdate;          /* Creation date */
+       __le16  adate;          /* Last access date */
+       __le16  starthi;        /* High 16 bits of cluster in FAT32 */
+       __le16  time,date,start;/* time, date and first cluster */
+       __le32  size;           /* file size (in bytes) */
+};
+
+/* Up to 13 characters of the name */
+struct msdos_dir_slot {
+       __u8    id;             /* sequence number for slot */
+       __u8    name0_4[10];    /* first 5 characters in name */
+       __u8    attr;           /* attribute byte */
+       __u8    reserved;       /* always 0 */
+       __u8    alias_checksum; /* checksum for 8.3 alias */
+       __u8    name5_10[12];   /* 6 more characters in name */
+       __le16   start;         /* starting cluster number, 0 in long slots */
+       __u8    name11_12[4];   /* last 2 characters in name */
+};
+
+#endif /* _UAPI_LINUX_MSDOS_FS_H */
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h
new file mode 100644 (file)
index 0000000..78dbd2f
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef _UAPI_LINUX_MSG_H
+#define _UAPI_LINUX_MSG_H
+
+#include <linux/ipc.h>
+
+/* ipcs ctl commands */
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+/* msgrcv options */
+#define MSG_NOERROR     010000  /* no error if message is too big */
+#define MSG_EXCEPT      020000  /* recv any msg except of specified type.*/
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct msqid_ds {
+       struct ipc_perm msg_perm;
+       struct msg *msg_first;          /* first message on queue,unused  */
+       struct msg *msg_last;           /* last message in queue,unused */
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned long  msg_lcbytes;     /* Reuse junk fields for 32 bit */
+       unsigned long  msg_lqbytes;     /* ditto */
+       unsigned short msg_cbytes;      /* current number of bytes on queue */
+       unsigned short msg_qnum;        /* number of messages in queue */
+       unsigned short msg_qbytes;      /* max number of bytes on queue */
+       __kernel_ipc_pid_t msg_lspid;   /* pid of last msgsnd */
+       __kernel_ipc_pid_t msg_lrpid;   /* last receive pid */
+};
+
+/* Include the definition of msqid64_ds */
+#include <asm/msgbuf.h>
+
+/* message buffer for msgsnd and msgrcv calls */
+struct msgbuf {
+       long mtype;         /* type of message */
+       char mtext[1];      /* message text */
+};
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo {
+       int msgpool;
+       int msgmap; 
+       int msgmax; 
+       int msgmnb; 
+       int msgmni; 
+       int msgssz; 
+       int msgtql; 
+       unsigned short  msgseg; 
+};
+
+/*
+ * Scaling factor to compute msgmni:
+ * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
+ * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
+ * up to 8MB       : msgmni = 16 (MSGMNI)
+ * 4 GB            : msgmni = 8K
+ * more than 16 GB : msgmni = 32K (IPCMNI)
+ */
+#define MSG_MEM_SCALE 32
+
+#define MSGMNI    16   /* <= IPCMNI */     /* max # of msg queue identifiers */
+#define MSGMAX  8192   /* <= INT_MAX */   /* max size of message (bytes) */
+#define MSGMNB 16384   /* <= INT_MAX */   /* default max size of a message queue */
+
+/* unused */
+#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
+#define MSGTQL  MSGMNB            /* number of system message headers */
+#define MSGMAP  MSGMNB            /* number of entries in message map */
+#define MSGSSZ  16                /* message segment size */
+#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
+#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
+
+
+#endif /* _UAPI_LINUX_MSG_H */
diff --git a/include/uapi/linux/n_r3964.h b/include/uapi/linux/n_r3964.h
new file mode 100644 (file)
index 0000000..81337cb
--- /dev/null
@@ -0,0 +1,98 @@
+/* r3964 linediscipline for linux
+ *
+ * -----------------------------------------------------------
+ * Copyright by
+ * Philips Automation Projects
+ * Kassel (Germany)
+ * -----------------------------------------------------------
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License, incorporated herein by reference.
+ *
+ * Author:
+ * L. Haag
+ *
+ * $Log: r3964.h,v $
+ * Revision 1.4  2005/12/21 19:54:24  Kurt Huwig <kurt huwig de>
+ * Fixed HZ usage on 2.6 kernels
+ * Removed unnecessary include
+ *
+ * Revision 1.3  2001/03/18 13:02:24  dwmw2
+ * Fix timer usage, use spinlocks properly.
+ *
+ * Revision 1.2  2001/03/18 12:53:15  dwmw2
+ * Merge changes in 2.4.2
+ *
+ * Revision 1.1.1.1  1998/10/13 16:43:14  dwmw2
+ * This'll screw the version control
+ *
+ * Revision 1.6  1998/09/30 00:40:38  dwmw2
+ * Updated to use kernel's N_R3964 if available
+ *
+ * Revision 1.4  1998/04/02 20:29:44  lhaag
+ * select, blocking, ...
+ *
+ * Revision 1.3  1998/02/12 18:58:43  root
+ * fixed some memory leaks
+ * calculation of checksum characters
+ *
+ * Revision 1.2  1998/02/07 13:03:17  root
+ * ioctl read_telegram
+ *
+ * Revision 1.1  1998/02/06 19:19:43  root
+ * Initial revision
+ *
+ *
+ */
+
+#ifndef _UAPI__LINUX_N_R3964_H__
+#define _UAPI__LINUX_N_R3964_H__
+
+/* line disciplines for r3964 protocol */
+
+
+/*
+ * Ioctl-commands
+ */
+
+#define R3964_ENABLE_SIGNALS      0x5301
+#define R3964_SETPRIORITY         0x5302
+#define R3964_USE_BCC             0x5303
+#define R3964_READ_TELEGRAM       0x5304
+
+/* Options for R3964_SETPRIORITY */
+#define R3964_MASTER   0
+#define R3964_SLAVE    1
+
+/* Options for R3964_ENABLE_SIGNALS */
+#define R3964_SIG_ACK   0x0001
+#define R3964_SIG_DATA  0x0002
+#define R3964_SIG_ALL   0x000f
+#define R3964_SIG_NONE  0x0000
+#define R3964_USE_SIGIO 0x1000
+
+/*
+ * r3964 operation states:
+ */
+
+/* types for msg_id: */
+enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
+
+#define R3964_MAX_MSG_COUNT 32
+
+/* error codes for client messages */
+#define R3964_OK 0        /* no error. */
+#define R3964_TX_FAIL -1  /* transmission error, block NOT sent */
+#define R3964_OVERFLOW -2 /* msg queue overflow */
+
+/* the client gets this struct when calling read(fd,...): */
+struct r3964_client_message {
+         int     msg_id;
+         int     arg;
+         int     error_code;
+};
+
+#define R3964_MTU      256
+
+
+
+#endif /* _UAPI__LINUX_N_R3964_H__ */
diff --git a/include/uapi/linux/nbd.h b/include/uapi/linux/nbd.h
new file mode 100644 (file)
index 0000000..dfb5144
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
+ * 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
+ *            Made nbd_end_request() use the io_request_lock
+ * 2001 Copyright (C) Steven Whitehouse
+ *            New nbd_end_request() for compatibility with new linux block
+ *            layer code.
+ * 2003/06/24 Louis D. Langholtz <ldl@aros.net>
+ *            Removed unneeded blksize_bits field from nbd_device struct.
+ *            Cleanup PARANOIA usage & code.
+ * 2004/02/19 Paul Clements
+ *            Removed PARANOIA, plus various cleanup and comments
+ */
+
+#ifndef _UAPILINUX_NBD_H
+#define _UAPILINUX_NBD_H
+
+#include <linux/types.h>
+
+#define NBD_SET_SOCK   _IO( 0xab, 0 )
+#define NBD_SET_BLKSIZE        _IO( 0xab, 1 )
+#define NBD_SET_SIZE   _IO( 0xab, 2 )
+#define NBD_DO_IT      _IO( 0xab, 3 )
+#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
+#define NBD_CLEAR_QUE  _IO( 0xab, 5 )
+#define NBD_PRINT_DEBUG        _IO( 0xab, 6 )
+#define NBD_SET_SIZE_BLOCKS    _IO( 0xab, 7 )
+#define NBD_DISCONNECT  _IO( 0xab, 8 )
+#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
+#define NBD_SET_FLAGS   _IO( 0xab, 10)
+
+enum {
+       NBD_CMD_READ = 0,
+       NBD_CMD_WRITE = 1,
+       NBD_CMD_DISC = 2,
+       /* there is a gap here to match userspace */
+       NBD_CMD_TRIM = 4
+};
+
+/* values for flags field */
+#define NBD_FLAG_HAS_FLAGS    (1 << 0) /* nbd-server supports flags */
+#define NBD_FLAG_READ_ONLY    (1 << 1) /* device is read-only */
+/* there is a gap here to match userspace */
+#define NBD_FLAG_SEND_TRIM    (1 << 5) /* send trim/discard */
+
+#define nbd_cmd(req) ((req)->cmd[0])
+
+/* userspace doesn't need the nbd_device structure */
+
+/* These are sent over the network in the request/reply magic fields */
+
+#define NBD_REQUEST_MAGIC 0x25609513
+#define NBD_REPLY_MAGIC 0x67446698
+/* Do *not* use magics: 0x12560953 0x96744668. */
+
+/*
+ * This is the packet used for communication between client and
+ * server. All data are in network byte order.
+ */
+struct nbd_request {
+       __be32 magic;
+       __be32 type;    /* == READ || == WRITE  */
+       char handle[8];
+       __be64 from;
+       __be32 len;
+} __attribute__((packed));
+
+/*
+ * This is the reply packet that nbd-server sends back to the client after
+ * it has completed an I/O request (or an error occurs).
+ */
+struct nbd_reply {
+       __be32 magic;
+       __be32 error;           /* 0 = ok, else error   */
+       char handle[8];         /* handle you got from request  */
+};
+#endif /* _UAPILINUX_NBD_H */
similarity index 100%
rename from include/linux/ncp.h
rename to include/uapi/linux/ncp.h
diff --git a/include/uapi/linux/net.h b/include/uapi/linux/net.h
new file mode 100644 (file)
index 0000000..9457239
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * NET         An implementation of the SOCKET network access protocol.
+ *             This is the master header file for the Linux NET layer,
+ *             or, in plain English: the networking handling part of the
+ *             kernel.
+ *
+ * Version:    @(#)net.h       1.0.3   05/25/93
+ *
+ * Authors:    Orest Zborowski, <obz@Kodak.COM>
+ *             Ross Biro
+ *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_NET_H
+#define _UAPI_LINUX_NET_H
+
+#include <linux/socket.h>
+#include <asm/socket.h>
+
+#define NPROTO         AF_MAX
+
+#define SYS_SOCKET     1               /* sys_socket(2)                */
+#define SYS_BIND       2               /* sys_bind(2)                  */
+#define SYS_CONNECT    3               /* sys_connect(2)               */
+#define SYS_LISTEN     4               /* sys_listen(2)                */
+#define SYS_ACCEPT     5               /* sys_accept(2)                */
+#define SYS_GETSOCKNAME        6               /* sys_getsockname(2)           */
+#define SYS_GETPEERNAME        7               /* sys_getpeername(2)           */
+#define SYS_SOCKETPAIR 8               /* sys_socketpair(2)            */
+#define SYS_SEND       9               /* sys_send(2)                  */
+#define SYS_RECV       10              /* sys_recv(2)                  */
+#define SYS_SENDTO     11              /* sys_sendto(2)                */
+#define SYS_RECVFROM   12              /* sys_recvfrom(2)              */
+#define SYS_SHUTDOWN   13              /* sys_shutdown(2)              */
+#define SYS_SETSOCKOPT 14              /* sys_setsockopt(2)            */
+#define SYS_GETSOCKOPT 15              /* sys_getsockopt(2)            */
+#define SYS_SENDMSG    16              /* sys_sendmsg(2)               */
+#define SYS_RECVMSG    17              /* sys_recvmsg(2)               */
+#define SYS_ACCEPT4    18              /* sys_accept4(2)               */
+#define SYS_RECVMMSG   19              /* sys_recvmmsg(2)              */
+#define SYS_SENDMMSG   20              /* sys_sendmmsg(2)              */
+
+typedef enum {
+       SS_FREE = 0,                    /* not allocated                */
+       SS_UNCONNECTED,                 /* unconnected to any socket    */
+       SS_CONNECTING,                  /* in process of connecting     */
+       SS_CONNECTED,                   /* connected to socket          */
+       SS_DISCONNECTING                /* in process of disconnecting  */
+} socket_state;
+
+#define __SO_ACCEPTCON (1 << 16)       /* performed a listen           */
+
+#endif /* _UAPI_LINUX_NET_H */
diff --git a/include/uapi/linux/netdevice.h b/include/uapi/linux/netdevice.h
new file mode 100644 (file)
index 0000000..6b9500b
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions for the Interfaces handler.
+ *
+ * Version:    @(#)dev.h       1.0.10  08/12/93
+ *
+ * Authors:    Ross Biro
+ *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *             Corey Minyard <wf-rch!minyard@relay.EU.net>
+ *             Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
+ *             Alan Cox, <alan@lxorguk.ukuu.org.uk>
+ *             Bjorn Ekwall. <bj0rn@blox.se>
+ *              Pekka Riikonen <priikone@poseidon.pspt.fi>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ *
+ *             Moved to /usr/include/linux for NET3
+ */
+#ifndef _UAPI_LINUX_NETDEVICE_H
+#define _UAPI_LINUX_NETDEVICE_H
+
+#include <linux/if.h>
+#include <linux/if_ether.h>
+#include <linux/if_packet.h>
+#include <linux/if_link.h>
+
+
+#define MAX_ADDR_LEN   32              /* Largest hardware address length */
+
+/* Initial net device group. All devices belong to group 0 by default. */
+#define INIT_NETDEV_GROUP      0
+
+
+
+/* Media selection options. */
+enum {
+        IF_PORT_UNKNOWN = 0,
+        IF_PORT_10BASE2,
+        IF_PORT_10BASET,
+        IF_PORT_AUI,
+        IF_PORT_100BASET,
+        IF_PORT_100BASETX,
+        IF_PORT_100BASEFX
+};
+
+
+#endif /* _UAPI_LINUX_NETDEVICE_H */
diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
new file mode 100644 (file)
index 0000000..f7dc0eb
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef _UAPI__LINUX_NETFILTER_H
+#define _UAPI__LINUX_NETFILTER_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <linux/sysctl.h>
+
+
+/* Responses from hook functions. */
+#define NF_DROP 0
+#define NF_ACCEPT 1
+#define NF_STOLEN 2
+#define NF_QUEUE 3
+#define NF_REPEAT 4
+#define NF_STOP 5
+#define NF_MAX_VERDICT NF_STOP
+
+/* we overload the higher bits for encoding auxiliary data such as the queue
+ * number or errno values. Not nice, but better than additional function
+ * arguments. */
+#define NF_VERDICT_MASK 0x000000ff
+
+/* extra verdict flags have mask 0x0000ff00 */
+#define NF_VERDICT_FLAG_QUEUE_BYPASS   0x00008000
+
+/* queue number (NF_QUEUE) or errno (NF_DROP) */
+#define NF_VERDICT_QMASK 0xffff0000
+#define NF_VERDICT_QBITS 16
+
+#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
+
+#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
+
+/* only for userspace compatibility */
+#ifndef __KERNEL__
+/* Generic cache responses from hook functions.
+   <= 0x2000 is used for protocol-flags. */
+#define NFC_UNKNOWN 0x4000
+#define NFC_ALTERED 0x8000
+
+/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
+#define NF_VERDICT_BITS 16
+#endif
+
+enum nf_inet_hooks {
+       NF_INET_PRE_ROUTING,
+       NF_INET_LOCAL_IN,
+       NF_INET_FORWARD,
+       NF_INET_LOCAL_OUT,
+       NF_INET_POST_ROUTING,
+       NF_INET_NUMHOOKS
+};
+
+enum {
+       NFPROTO_UNSPEC =  0,
+       NFPROTO_IPV4   =  2,
+       NFPROTO_ARP    =  3,
+       NFPROTO_BRIDGE =  7,
+       NFPROTO_IPV6   = 10,
+       NFPROTO_DECNET = 12,
+       NFPROTO_NUMPROTO,
+};
+
+union nf_inet_addr {
+       __u32           all[4];
+       __be32          ip;
+       __be32          ip6[4];
+       struct in_addr  in;
+       struct in6_addr in6;
+};
+
+#endif /* _UAPI__LINUX_NETFILTER_H */
diff --git a/include/uapi/linux/netfilter_bridge.h b/include/uapi/linux/netfilter_bridge.h
new file mode 100644 (file)
index 0000000..a5eda6d
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _UAPI__LINUX_BRIDGE_NETFILTER_H
+#define _UAPI__LINUX_BRIDGE_NETFILTER_H
+
+/* bridge-specific defines for netfilter. 
+ */
+
+#include <linux/netfilter.h>
+#include <linux/if_ether.h>
+#include <linux/if_vlan.h>
+#include <linux/if_pppox.h>
+
+/* Bridge Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_BR_PRE_ROUTING      0
+/* If the packet is destined for this box. */
+#define NF_BR_LOCAL_IN         1
+/* If the packet is destined for another interface. */
+#define NF_BR_FORWARD          2
+/* Packets coming from a local process. */
+#define NF_BR_LOCAL_OUT                3
+/* Packets about to hit the wire. */
+#define NF_BR_POST_ROUTING     4
+/* Not really a hook, but used for the ebtables broute table */
+#define NF_BR_BROUTING         5
+#define NF_BR_NUMHOOKS         6
+
+#endif /* _UAPI__LINUX_BRIDGE_NETFILTER_H */
diff --git a/include/uapi/linux/netfilter_ipv4.h b/include/uapi/linux/netfilter_ipv4.h
new file mode 100644 (file)
index 0000000..91ddd1f
--- /dev/null
@@ -0,0 +1,81 @@
+/* IPv4-specific defines for netfilter. 
+ * (C)1998 Rusty Russell -- This code is GPL.
+ */
+#ifndef _UAPI__LINUX_IP_NETFILTER_H
+#define _UAPI__LINUX_IP_NETFILTER_H
+
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+#ifndef __KERNEL__
+
+#include <limits.h> /* for INT_MIN, INT_MAX */
+
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP_SRC             0x0001
+/* Dest IP address. */
+#define NFC_IP_DST             0x0002
+/* Input device. */
+#define NFC_IP_IF_IN           0x0004
+/* Output device. */
+#define NFC_IP_IF_OUT          0x0008
+/* TOS. */
+#define NFC_IP_TOS             0x0010
+/* Protocol. */
+#define NFC_IP_PROTO           0x0020
+/* IP options. */
+#define NFC_IP_OPTIONS         0x0040
+/* Frag & flags. */
+#define NFC_IP_FRAG            0x0080
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP_TCPFLAGS                0x0100
+/* Source port. */
+#define NFC_IP_SRC_PT          0x0200
+/* Dest port. */
+#define NFC_IP_DST_PT          0x0400
+/* Something else about the proto */
+#define NFC_IP_PROTO_UNKNOWN   0x2000
+
+/* IP Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP_PRE_ROUTING      0
+/* If the packet is destined for this box. */
+#define NF_IP_LOCAL_IN         1
+/* If the packet is destined for another interface. */
+#define NF_IP_FORWARD          2
+/* Packets coming from a local process. */
+#define NF_IP_LOCAL_OUT                3
+/* Packets about to hit the wire. */
+#define NF_IP_POST_ROUTING     4
+#define NF_IP_NUMHOOKS         5
+#endif /* ! __KERNEL__ */
+
+enum nf_ip_hook_priorities {
+       NF_IP_PRI_FIRST = INT_MIN,
+       NF_IP_PRI_CONNTRACK_DEFRAG = -400,
+       NF_IP_PRI_RAW = -300,
+       NF_IP_PRI_SELINUX_FIRST = -225,
+       NF_IP_PRI_CONNTRACK = -200,
+       NF_IP_PRI_MANGLE = -150,
+       NF_IP_PRI_NAT_DST = -100,
+       NF_IP_PRI_FILTER = 0,
+       NF_IP_PRI_SECURITY = 50,
+       NF_IP_PRI_NAT_SRC = 100,
+       NF_IP_PRI_SELINUX_LAST = 225,
+       NF_IP_PRI_CONNTRACK_HELPER = 300,
+       NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
+       NF_IP_PRI_LAST = INT_MAX,
+};
+
+/* Arguments for setsockopt SOL_IP: */
+/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
+/* 2.2 firewalling (+ masq) went from 64 through 76 */
+/* 2.4 firewalling went 64 through 67. */
+#define SO_ORIGINAL_DST 80
+
+
+#endif /* _UAPI__LINUX_IP_NETFILTER_H */
diff --git a/include/uapi/linux/netfilter_ipv6.h b/include/uapi/linux/netfilter_ipv6.h
new file mode 100644 (file)
index 0000000..12497c6
--- /dev/null
@@ -0,0 +1,79 @@
+/* IPv6-specific defines for netfilter. 
+ * (C)1998 Rusty Russell -- This code is GPL.
+ * (C)1999 David Jeffery
+ *   this header was blatantly ripped from netfilter_ipv4.h 
+ *   it's amazing what adding a bunch of 6s can do =8^)
+ */
+#ifndef _UAPI__LINUX_IP6_NETFILTER_H
+#define _UAPI__LINUX_IP6_NETFILTER_H
+
+
+#include <linux/netfilter.h>
+
+/* only for userspace compatibility */
+#ifndef __KERNEL__
+
+#include <limits.h> /* for INT_MIN, INT_MAX */
+
+/* IP Cache bits. */
+/* Src IP address. */
+#define NFC_IP6_SRC              0x0001
+/* Dest IP address. */
+#define NFC_IP6_DST              0x0002
+/* Input device. */
+#define NFC_IP6_IF_IN            0x0004
+/* Output device. */
+#define NFC_IP6_IF_OUT           0x0008
+/* TOS. */
+#define NFC_IP6_TOS              0x0010
+/* Protocol. */
+#define NFC_IP6_PROTO            0x0020
+/* IP options. */
+#define NFC_IP6_OPTIONS          0x0040
+/* Frag & flags. */
+#define NFC_IP6_FRAG             0x0080
+
+
+/* Per-protocol information: only matters if proto match. */
+/* TCP flags. */
+#define NFC_IP6_TCPFLAGS         0x0100
+/* Source port. */
+#define NFC_IP6_SRC_PT           0x0200
+/* Dest port. */
+#define NFC_IP6_DST_PT           0x0400
+/* Something else about the proto */
+#define NFC_IP6_PROTO_UNKNOWN    0x2000
+
+/* IP6 Hooks */
+/* After promisc drops, checksum checks. */
+#define NF_IP6_PRE_ROUTING     0
+/* If the packet is destined for this box. */
+#define NF_IP6_LOCAL_IN                1
+/* If the packet is destined for another interface. */
+#define NF_IP6_FORWARD         2
+/* Packets coming from a local process. */
+#define NF_IP6_LOCAL_OUT               3
+/* Packets about to hit the wire. */
+#define NF_IP6_POST_ROUTING    4
+#define NF_IP6_NUMHOOKS                5
+#endif /* ! __KERNEL__ */
+
+
+enum nf_ip6_hook_priorities {
+       NF_IP6_PRI_FIRST = INT_MIN,
+       NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
+       NF_IP6_PRI_RAW = -300,
+       NF_IP6_PRI_SELINUX_FIRST = -225,
+       NF_IP6_PRI_CONNTRACK = -200,
+       NF_IP6_PRI_MANGLE = -150,
+       NF_IP6_PRI_NAT_DST = -100,
+       NF_IP6_PRI_FILTER = 0,
+       NF_IP6_PRI_SECURITY = 50,
+       NF_IP6_PRI_NAT_SRC = 100,
+       NF_IP6_PRI_SELINUX_LAST = 225,
+       NF_IP6_PRI_CONNTRACK_HELPER = 300,
+       NF_IP6_PRI_LAST = INT_MAX,
+};
+
+
+#endif /* _UAPI__LINUX_IP6_NETFILTER_H */
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
new file mode 100644 (file)
index 0000000..78d5b8a
--- /dev/null
@@ -0,0 +1,153 @@
+#ifndef _UAPI__LINUX_NETLINK_H
+#define _UAPI__LINUX_NETLINK_H
+
+#include <linux/socket.h> /* for __kernel_sa_family_t */
+#include <linux/types.h>
+
+#define NETLINK_ROUTE          0       /* Routing/device hook                          */
+#define NETLINK_UNUSED         1       /* Unused number                                */
+#define NETLINK_USERSOCK       2       /* Reserved for user mode socket protocols      */
+#define NETLINK_FIREWALL       3       /* Unused number, formerly ip_queue             */
+#define NETLINK_SOCK_DIAG      4       /* socket monitoring                            */
+#define NETLINK_NFLOG          5       /* netfilter/iptables ULOG */
+#define NETLINK_XFRM           6       /* ipsec */
+#define NETLINK_SELINUX                7       /* SELinux event notifications */
+#define NETLINK_ISCSI          8       /* Open-iSCSI */
+#define NETLINK_AUDIT          9       /* auditing */
+#define NETLINK_FIB_LOOKUP     10      
+#define NETLINK_CONNECTOR      11
+#define NETLINK_NETFILTER      12      /* netfilter subsystem */
+#define NETLINK_IP6_FW         13
+#define NETLINK_DNRTMSG                14      /* DECnet routing messages */
+#define NETLINK_KOBJECT_UEVENT 15      /* Kernel messages to userspace */
+#define NETLINK_GENERIC                16
+/* leave room for NETLINK_DM (DM Events) */
+#define NETLINK_SCSITRANSPORT  18      /* SCSI Transports */
+#define NETLINK_ECRYPTFS       19
+#define NETLINK_RDMA           20
+#define NETLINK_CRYPTO         21      /* Crypto layer */
+
+#define NETLINK_INET_DIAG      NETLINK_SOCK_DIAG
+
+#define MAX_LINKS 32           
+
+struct sockaddr_nl {
+       __kernel_sa_family_t    nl_family;      /* AF_NETLINK   */
+       unsigned short  nl_pad;         /* zero         */
+       __u32           nl_pid;         /* port ID      */
+               __u32           nl_groups;      /* multicast groups mask */
+};
+
+struct nlmsghdr {
+       __u32           nlmsg_len;      /* Length of message including header */
+       __u16           nlmsg_type;     /* Message content */
+       __u16           nlmsg_flags;    /* Additional flags */
+       __u32           nlmsg_seq;      /* Sequence number */
+       __u32           nlmsg_pid;      /* Sending process port ID */
+};
+
+/* Flags values */
+
+#define NLM_F_REQUEST          1       /* It is request message.       */
+#define NLM_F_MULTI            2       /* Multipart message, terminated by NLMSG_DONE */
+#define NLM_F_ACK              4       /* Reply with ack, with zero or error code */
+#define NLM_F_ECHO             8       /* Echo this request            */
+#define NLM_F_DUMP_INTR                16      /* Dump was inconsistent due to sequence change */
+
+/* Modifiers to GET request */
+#define NLM_F_ROOT     0x100   /* specify tree root    */
+#define NLM_F_MATCH    0x200   /* return all matching  */
+#define NLM_F_ATOMIC   0x400   /* atomic GET           */
+#define NLM_F_DUMP     (NLM_F_ROOT|NLM_F_MATCH)
+
+/* Modifiers to NEW request */
+#define NLM_F_REPLACE  0x100   /* Override existing            */
+#define NLM_F_EXCL     0x200   /* Do not touch, if it exists   */
+#define NLM_F_CREATE   0x400   /* Create, if it does not exist */
+#define NLM_F_APPEND   0x800   /* Add to end of list           */
+
+/*
+   4.4BSD ADD          NLM_F_CREATE|NLM_F_EXCL
+   4.4BSD CHANGE       NLM_F_REPLACE
+
+   True CHANGE         NLM_F_CREATE|NLM_F_REPLACE
+   Append              NLM_F_CREATE
+   Check               NLM_F_EXCL
+ */
+
+#define NLMSG_ALIGNTO  4U
+#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
+#define NLMSG_HDRLEN    ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
+#define NLMSG_DATA(nlh)  ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
+#define NLMSG_NEXT(nlh,len)     ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
+                                 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
+                          (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
+                          (nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
+
+#define NLMSG_NOOP             0x1     /* Nothing.             */
+#define NLMSG_ERROR            0x2     /* Error                */
+#define NLMSG_DONE             0x3     /* End of a dump        */
+#define NLMSG_OVERRUN          0x4     /* Data lost            */
+
+#define NLMSG_MIN_TYPE         0x10    /* < 0x10: reserved control messages */
+
+struct nlmsgerr {
+       int             error;
+       struct nlmsghdr msg;
+};
+
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP        2
+#define NETLINK_PKTINFO                3
+#define NETLINK_BROADCAST_ERROR        4
+#define NETLINK_NO_ENOBUFS     5
+
+struct nl_pktinfo {
+       __u32   group;
+};
+
+#define NET_MAJOR 36           /* Major 36 is reserved for networking                                          */
+
+enum {
+       NETLINK_UNCONNECTED = 0,
+       NETLINK_CONNECTED,
+};
+
+/*
+ *  <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ * |        Header       | Pad |     Payload       | Pad |
+ * |   (struct nlattr)   | ing |                   | ing |
+ * +---------------------+- - -+- - - - - - - - - -+- - -+
+ *  <-------------- nlattr->nla_len -------------->
+ */
+
+struct nlattr {
+       __u16           nla_len;
+       __u16           nla_type;
+};
+
+/*
+ * nla_type (16 bits)
+ * +---+---+-------------------------------+
+ * | N | O | Attribute Type                |
+ * +---+---+-------------------------------+
+ * N := Carries nested attributes
+ * O := Payload stored in network byte order
+ *
+ * Note: The N and O flag are mutually exclusive.
+ */
+#define NLA_F_NESTED           (1 << 15)
+#define NLA_F_NET_BYTEORDER    (1 << 14)
+#define NLA_TYPE_MASK          ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+
+#define NLA_ALIGNTO            4
+#define NLA_ALIGN(len)         (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
+#define NLA_HDRLEN             ((int) NLA_ALIGN(sizeof(struct nlattr)))
+
+
+#endif /* _UAPI__LINUX_NETLINK_H */
similarity index 100%
rename from include/linux/nfc.h
rename to include/uapi/linux/nfc.h
diff --git a/include/uapi/linux/nfs.h b/include/uapi/linux/nfs.h
new file mode 100644 (file)
index 0000000..5199a36
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants mostly for Version 2 of the protocol,
+ * but also has a couple of NFSv3 bits in (notably the error codes).
+ */
+#ifndef _UAPI_LINUX_NFS_H
+#define _UAPI_LINUX_NFS_H
+
+#define NFS_PROGRAM    100003
+#define NFS_PORT       2049
+#define NFS_MAXDATA    8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN  255
+#define NFS_MAXGROUPS  16
+#define NFS_FHSIZE     32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV   (-1)
+#define NFSMODE_FMT    0170000
+#define NFSMODE_DIR    0040000
+#define NFSMODE_CHR    0020000
+#define NFSMODE_BLK    0060000
+#define NFSMODE_REG    0100000
+#define NFSMODE_LNK    0120000
+#define NFSMODE_SOCK   0140000
+#define NFSMODE_FIFO   0010000
+
+#define NFS_MNT_PROGRAM                100005
+#define NFS_MNT_VERSION                1
+#define NFS_MNT3_VERSION       3
+
+#define NFS_PIPE_DIRNAME "nfs"
+
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+ enum nfs_stat {
+       NFS_OK = 0,                     /* v2 v3 v4 */
+       NFSERR_PERM = 1,                /* v2 v3 v4 */
+       NFSERR_NOENT = 2,               /* v2 v3 v4 */
+       NFSERR_IO = 5,                  /* v2 v3 v4 */
+       NFSERR_NXIO = 6,                /* v2 v3 v4 */
+       NFSERR_EAGAIN = 11,             /* v2 v3 */
+       NFSERR_ACCES = 13,              /* v2 v3 v4 */
+       NFSERR_EXIST = 17,              /* v2 v3 v4 */
+       NFSERR_XDEV = 18,               /*    v3 v4 */
+       NFSERR_NODEV = 19,              /* v2 v3 v4 */
+       NFSERR_NOTDIR = 20,             /* v2 v3 v4 */
+       NFSERR_ISDIR = 21,              /* v2 v3 v4 */
+       NFSERR_INVAL = 22,              /* v2 v3 v4 */
+       NFSERR_FBIG = 27,               /* v2 v3 v4 */
+       NFSERR_NOSPC = 28,              /* v2 v3 v4 */
+       NFSERR_ROFS = 30,               /* v2 v3 v4 */
+       NFSERR_MLINK = 31,              /*    v3 v4 */
+       NFSERR_OPNOTSUPP = 45,          /* v2 v3 */
+       NFSERR_NAMETOOLONG = 63,        /* v2 v3 v4 */
+       NFSERR_NOTEMPTY = 66,           /* v2 v3 v4 */
+       NFSERR_DQUOT = 69,              /* v2 v3 v4 */
+       NFSERR_STALE = 70,              /* v2 v3 v4 */
+       NFSERR_REMOTE = 71,             /* v2 v3 */
+       NFSERR_WFLUSH = 99,             /* v2    */
+       NFSERR_BADHANDLE = 10001,       /*    v3 v4 */
+       NFSERR_NOT_SYNC = 10002,        /*    v3 */
+       NFSERR_BAD_COOKIE = 10003,      /*    v3 v4 */
+       NFSERR_NOTSUPP = 10004,         /*    v3 v4 */
+       NFSERR_TOOSMALL = 10005,        /*    v3 v4 */
+       NFSERR_SERVERFAULT = 10006,     /*    v3 v4 */
+       NFSERR_BADTYPE = 10007,         /*    v3 v4 */
+       NFSERR_JUKEBOX = 10008,         /*    v3 v4 */
+       NFSERR_SAME = 10009,            /*       v4 */
+       NFSERR_DENIED = 10010,          /*       v4 */
+       NFSERR_EXPIRED = 10011,         /*       v4 */
+       NFSERR_LOCKED = 10012,          /*       v4 */
+       NFSERR_GRACE = 10013,           /*       v4 */
+       NFSERR_FHEXPIRED = 10014,       /*       v4 */
+       NFSERR_SHARE_DENIED = 10015,    /*       v4 */
+       NFSERR_WRONGSEC = 10016,        /*       v4 */
+       NFSERR_CLID_INUSE = 10017,      /*       v4 */
+       NFSERR_RESOURCE = 10018,        /*       v4 */
+       NFSERR_MOVED = 10019,           /*       v4 */
+       NFSERR_NOFILEHANDLE = 10020,    /*       v4 */
+       NFSERR_MINOR_VERS_MISMATCH = 10021,   /* v4 */
+       NFSERR_STALE_CLIENTID = 10022,  /*       v4 */
+       NFSERR_STALE_STATEID = 10023,   /*       v4 */
+       NFSERR_OLD_STATEID = 10024,     /*       v4 */
+       NFSERR_BAD_STATEID = 10025,     /*       v4 */  
+       NFSERR_BAD_SEQID = 10026,       /*       v4 */
+       NFSERR_NOT_SAME = 10027,        /*       v4 */
+       NFSERR_LOCK_RANGE = 10028,      /*       v4 */
+       NFSERR_SYMLINK = 10029,         /*       v4 */
+       NFSERR_RESTOREFH = 10030,       /*       v4 */
+       NFSERR_LEASE_MOVED = 10031,     /*       v4 */
+       NFSERR_ATTRNOTSUPP = 10032,     /*       v4 */
+       NFSERR_NO_GRACE = 10033,        /*       v4 */
+       NFSERR_RECLAIM_BAD = 10034,     /*       v4 */
+       NFSERR_RECLAIM_CONFLICT = 10035,/*       v4 */
+       NFSERR_BAD_XDR = 10036,         /*       v4 */
+       NFSERR_LOCKS_HELD = 10037,      /*       v4 */
+       NFSERR_OPENMODE = 10038,       /*       v4 */
+       NFSERR_BADOWNER = 10039,       /*       v4 */
+       NFSERR_BADCHAR = 10040,        /*       v4 */
+       NFSERR_BADNAME = 10041,        /*       v4 */
+       NFSERR_BAD_RANGE = 10042,      /*       v4 */
+       NFSERR_LOCK_NOTSUPP = 10043,   /*       v4 */
+       NFSERR_OP_ILLEGAL = 10044,     /*       v4 */
+       NFSERR_DEADLOCK = 10045,       /*       v4 */
+       NFSERR_FILE_OPEN = 10046,      /*       v4 */
+       NFSERR_ADMIN_REVOKED = 10047,  /*       v4 */
+       NFSERR_CB_PATH_DOWN = 10048,   /*       v4 */
+};
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+
+enum nfs_ftype {
+       NFNON = 0,
+       NFREG = 1,
+       NFDIR = 2,
+       NFBLK = 3,
+       NFCHR = 4,
+       NFLNK = 5,
+       NFSOCK = 6,
+       NFBAD = 7,
+       NFFIFO = 8
+};
+
+#endif /* _UAPI_LINUX_NFS_H */
diff --git a/include/uapi/linux/nfs3.h b/include/uapi/linux/nfs3.h
new file mode 100644 (file)
index 0000000..231ef4e
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * NFSv3 protocol definitions
+ */
+#ifndef _UAPI_LINUX_NFS3_H
+#define _UAPI_LINUX_NFS3_H
+
+#define NFS3_PORT              2049
+#define NFS3_MAXDATA           32768
+#define NFS3_MAXPATHLEN                PATH_MAX
+#define NFS3_MAXNAMLEN         NAME_MAX
+#define NFS3_MAXGROUPS         16
+#define NFS3_FHSIZE            64
+#define NFS3_COOKIESIZE                4
+#define NFS3_CREATEVERFSIZE    8
+#define NFS3_COOKIEVERFSIZE    8
+#define NFS3_WRITEVERFSIZE     8
+#define NFS3_FIFO_DEV          (-1)
+#define NFS3MODE_FMT           0170000
+#define NFS3MODE_DIR           0040000
+#define NFS3MODE_CHR           0020000
+#define NFS3MODE_BLK           0060000
+#define NFS3MODE_REG           0100000
+#define NFS3MODE_LNK           0120000
+#define NFS3MODE_SOCK          0140000
+#define NFS3MODE_FIFO          0010000
+
+/* Flags for access() call */
+#define NFS3_ACCESS_READ       0x0001
+#define NFS3_ACCESS_LOOKUP     0x0002
+#define NFS3_ACCESS_MODIFY     0x0004
+#define NFS3_ACCESS_EXTEND     0x0008
+#define NFS3_ACCESS_DELETE     0x0010
+#define NFS3_ACCESS_EXECUTE    0x0020
+#define NFS3_ACCESS_FULL       0x003f
+
+/* Flags for create mode */
+enum nfs3_createmode {
+       NFS3_CREATE_UNCHECKED = 0,
+       NFS3_CREATE_GUARDED = 1,
+       NFS3_CREATE_EXCLUSIVE = 2
+};
+
+/* NFSv3 file system properties */
+#define NFS3_FSF_LINK          0x0001
+#define NFS3_FSF_SYMLINK       0x0002
+#define NFS3_FSF_HOMOGENEOUS   0x0008
+#define NFS3_FSF_CANSETTIME    0x0010
+/* Some shorthands. See fs/nfsd/nfs3proc.c */
+#define NFS3_FSF_DEFAULT       0x001B
+#define NFS3_FSF_BILLYBOY      0x0018
+#define NFS3_FSF_READONLY      0x0008
+
+enum nfs3_ftype {
+       NF3NON  = 0,
+       NF3REG  = 1,
+       NF3DIR  = 2,
+       NF3BLK  = 3,
+       NF3CHR  = 4,
+       NF3LNK  = 5,
+       NF3SOCK = 6,
+       NF3FIFO = 7,    /* changed from NFSv2 (was 8) */
+       NF3BAD  = 8
+};
+
+struct nfs3_fh {
+       unsigned short size;
+       unsigned char  data[NFS3_FHSIZE];
+};
+
+#define NFS3_VERSION           3
+#define NFS3PROC_NULL          0
+#define NFS3PROC_GETATTR       1
+#define NFS3PROC_SETATTR       2
+#define NFS3PROC_LOOKUP                3
+#define NFS3PROC_ACCESS                4
+#define NFS3PROC_READLINK      5
+#define NFS3PROC_READ          6
+#define NFS3PROC_WRITE         7
+#define NFS3PROC_CREATE                8
+#define NFS3PROC_MKDIR         9
+#define NFS3PROC_SYMLINK       10
+#define NFS3PROC_MKNOD         11
+#define NFS3PROC_REMOVE                12
+#define NFS3PROC_RMDIR         13
+#define NFS3PROC_RENAME                14
+#define NFS3PROC_LINK          15
+#define NFS3PROC_READDIR       16
+#define NFS3PROC_READDIRPLUS   17
+#define NFS3PROC_FSSTAT                18
+#define NFS3PROC_FSINFO                19
+#define NFS3PROC_PATHCONF      20
+#define NFS3PROC_COMMIT                21
+
+#define NFS_MNT3_VERSION       3
+
+#endif /* _UAPI_LINUX_NFS3_H */
diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h
new file mode 100644 (file)
index 0000000..788128e
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ *  include/linux/nfs4.h
+ *
+ *  NFSv4 protocol definitions.
+ *
+ *  Copyright (c) 2002 The Regents of the University of Michigan.
+ *  All rights reserved.
+ *
+ *  Kendrick Smith <kmsmith@umich.edu>
+ *  Andy Adamson   <andros@umich.edu>
+ */
+
+#ifndef _UAPI_LINUX_NFS4_H
+#define _UAPI_LINUX_NFS4_H
+
+#include <linux/types.h>
+
+#define NFS4_BITMAP_SIZE       2
+#define NFS4_VERIFIER_SIZE     8
+#define NFS4_STATEID_SEQID_SIZE 4
+#define NFS4_STATEID_OTHER_SIZE 12
+#define NFS4_STATEID_SIZE      (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
+#define NFS4_FHSIZE            128
+#define NFS4_MAXPATHLEN                PATH_MAX
+#define NFS4_MAXNAMLEN         NAME_MAX
+#define NFS4_OPAQUE_LIMIT      1024
+#define NFS4_MAX_SESSIONID_LEN 16
+
+#define NFS4_ACCESS_READ        0x0001
+#define NFS4_ACCESS_LOOKUP      0x0002
+#define NFS4_ACCESS_MODIFY      0x0004
+#define NFS4_ACCESS_EXTEND      0x0008
+#define NFS4_ACCESS_DELETE      0x0010
+#define NFS4_ACCESS_EXECUTE     0x0020
+
+#define NFS4_FH_PERSISTENT             0x0000
+#define NFS4_FH_NOEXPIRE_WITH_OPEN     0x0001
+#define NFS4_FH_VOLATILE_ANY           0x0002
+#define NFS4_FH_VOL_MIGRATION          0x0004
+#define NFS4_FH_VOL_RENAME             0x0008
+
+#define NFS4_OPEN_RESULT_CONFIRM 0x0002
+#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
+
+#define NFS4_SHARE_ACCESS_MASK 0x000F
+#define NFS4_SHARE_ACCESS_READ 0x0001
+#define NFS4_SHARE_ACCESS_WRITE        0x0002
+#define NFS4_SHARE_ACCESS_BOTH 0x0003
+#define NFS4_SHARE_DENY_READ   0x0001
+#define NFS4_SHARE_DENY_WRITE  0x0002
+#define NFS4_SHARE_DENY_BOTH   0x0003
+
+/* nfs41 */
+#define NFS4_SHARE_WANT_MASK           0xFF00
+#define NFS4_SHARE_WANT_NO_PREFERENCE  0x0000
+#define NFS4_SHARE_WANT_READ_DELEG     0x0100
+#define NFS4_SHARE_WANT_WRITE_DELEG    0x0200
+#define NFS4_SHARE_WANT_ANY_DELEG      0x0300
+#define NFS4_SHARE_WANT_NO_DELEG       0x0400
+#define NFS4_SHARE_WANT_CANCEL         0x0500
+
+#define NFS4_SHARE_WHEN_MASK           0xF0000
+#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL       0x10000
+#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED         0x20000
+
+#define NFS4_CDFC4_FORE        0x1
+#define NFS4_CDFC4_BACK 0x2
+#define NFS4_CDFC4_BOTH 0x3
+#define NFS4_CDFC4_FORE_OR_BOTH 0x3
+#define NFS4_CDFC4_BACK_OR_BOTH 0x7
+
+#define NFS4_CDFS4_FORE 0x1
+#define NFS4_CDFS4_BACK 0x2
+#define NFS4_CDFS4_BOTH 0x3
+
+#define NFS4_SET_TO_SERVER_TIME        0
+#define NFS4_SET_TO_CLIENT_TIME        1
+
+#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE  1
+#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE   2
+#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE   3
+
+#define ACL4_SUPPORT_ALLOW_ACL 0x01
+#define ACL4_SUPPORT_DENY_ACL  0x02
+#define ACL4_SUPPORT_AUDIT_ACL 0x04
+#define ACL4_SUPPORT_ALARM_ACL 0x08
+
+#define NFS4_ACE_FILE_INHERIT_ACE             0x00000001
+#define NFS4_ACE_DIRECTORY_INHERIT_ACE        0x00000002
+#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE     0x00000004
+#define NFS4_ACE_INHERIT_ONLY_ACE             0x00000008
+#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG   0x00000010
+#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG       0x00000020
+#define NFS4_ACE_IDENTIFIER_GROUP             0x00000040
+
+#define NFS4_ACE_READ_DATA                    0x00000001
+#define NFS4_ACE_LIST_DIRECTORY               0x00000001
+#define NFS4_ACE_WRITE_DATA                   0x00000002
+#define NFS4_ACE_ADD_FILE                     0x00000002
+#define NFS4_ACE_APPEND_DATA                  0x00000004
+#define NFS4_ACE_ADD_SUBDIRECTORY             0x00000004
+#define NFS4_ACE_READ_NAMED_ATTRS             0x00000008
+#define NFS4_ACE_WRITE_NAMED_ATTRS            0x00000010
+#define NFS4_ACE_EXECUTE                      0x00000020
+#define NFS4_ACE_DELETE_CHILD                 0x00000040
+#define NFS4_ACE_READ_ATTRIBUTES              0x00000080
+#define NFS4_ACE_WRITE_ATTRIBUTES             0x00000100
+#define NFS4_ACE_DELETE                       0x00010000
+#define NFS4_ACE_READ_ACL                     0x00020000
+#define NFS4_ACE_WRITE_ACL                    0x00040000
+#define NFS4_ACE_WRITE_OWNER                  0x00080000
+#define NFS4_ACE_SYNCHRONIZE                  0x00100000
+#define NFS4_ACE_GENERIC_READ                 0x00120081
+#define NFS4_ACE_GENERIC_WRITE                0x00160106
+#define NFS4_ACE_GENERIC_EXECUTE              0x001200A0
+#define NFS4_ACE_MASK_ALL                     0x001F01FF
+
+#define EXCHGID4_FLAG_SUPP_MOVED_REFER         0x00000001
+#define EXCHGID4_FLAG_SUPP_MOVED_MIGR          0x00000002
+#define EXCHGID4_FLAG_BIND_PRINC_STATEID       0x00000100
+
+#define EXCHGID4_FLAG_USE_NON_PNFS             0x00010000
+#define EXCHGID4_FLAG_USE_PNFS_MDS             0x00020000
+#define EXCHGID4_FLAG_USE_PNFS_DS              0x00040000
+#define EXCHGID4_FLAG_MASK_PNFS                        0x00070000
+
+#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A      0x40000000
+#define EXCHGID4_FLAG_CONFIRMED_R              0x80000000
+/*
+ * Since the validity of these bits depends on whether
+ * they're set in the argument or response, have separate
+ * invalid flag masks for arg (_A) and resp (_R).
+ */
+#define EXCHGID4_FLAG_MASK_A                   0x40070103
+#define EXCHGID4_FLAG_MASK_R                   0x80070103
+
+#define SEQ4_STATUS_CB_PATH_DOWN               0x00000001
+#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING   0x00000002
+#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED    0x00000004
+#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED  0x00000008
+#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
+#define SEQ4_STATUS_ADMIN_STATE_REVOKED                0x00000020
+#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED   0x00000040
+#define SEQ4_STATUS_LEASE_MOVED                        0x00000080
+#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED     0x00000100
+#define SEQ4_STATUS_CB_PATH_DOWN_SESSION       0x00000200
+#define SEQ4_STATUS_BACKCHANNEL_FAULT          0x00000400
+
+#define NFS4_SECINFO_STYLE4_CURRENT_FH 0
+#define NFS4_SECINFO_STYLE4_PARENT     1
+
+#define NFS4_MAX_UINT64        (~(u64)0)
+
+/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
+ * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
+ */
+#define NFS4_MAX_OPS   8
+
+/* Our NFS4 client back channel server only wants the cb_sequene and the
+ * actual operation per compound
+ */
+#define NFS4_MAX_BACK_CHANNEL_OPS 2
+
+enum nfs4_acl_whotype {
+       NFS4_ACL_WHO_NAMED = 0,
+       NFS4_ACL_WHO_OWNER,
+       NFS4_ACL_WHO_GROUP,
+       NFS4_ACL_WHO_EVERYONE,
+};
+
+#endif /* _UAPI_LINUX_NFS4_H */
+
+/*
+ * Local variables:
+ *  c-basic-offset: 8
+ * End:
+ */
diff --git a/include/uapi/linux/nfs_fs.h b/include/uapi/linux/nfs_fs.h
new file mode 100644 (file)
index 0000000..4914228
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *  linux/include/linux/nfs_fs.h
+ *
+ *  Copyright (C) 1992  Rick Sladkey
+ *
+ *  OS-specific nfs filesystem definitions and declarations
+ */
+
+#ifndef _UAPI_LINUX_NFS_FS_H
+#define _UAPI_LINUX_NFS_FS_H
+
+#include <linux/magic.h>
+
+/* Default timeout values */
+#define NFS_DEF_UDP_TIMEO      (11)
+#define NFS_DEF_UDP_RETRANS    (3)
+#define NFS_DEF_TCP_TIMEO      (600)
+#define NFS_DEF_TCP_RETRANS    (2)
+
+#define NFS_MAX_UDP_TIMEOUT    (60*HZ)
+#define NFS_MAX_TCP_TIMEOUT    (600*HZ)
+
+#define NFS_DEF_ACREGMIN       (3)
+#define NFS_DEF_ACREGMAX       (60)
+#define NFS_DEF_ACDIRMIN       (30)
+#define NFS_DEF_ACDIRMAX       (60)
+
+/*
+ * When flushing a cluster of dirty pages, there can be different
+ * strategies:
+ */
+#define FLUSH_SYNC             1       /* file being synced, or contention */
+#define FLUSH_STABLE           4       /* commit to stable storage */
+#define FLUSH_LOWPRI           8       /* low priority background flush */
+#define FLUSH_HIGHPRI          16      /* high priority memory reclaim flush */
+#define FLUSH_COND_STABLE      32      /* conditional stable write - only stable
+                                        * if everything fits in one RPC */
+
+
+/*
+ * NFS debug flags
+ */
+#define NFSDBG_VFS             0x0001
+#define NFSDBG_DIRCACHE                0x0002
+#define NFSDBG_LOOKUPCACHE     0x0004
+#define NFSDBG_PAGECACHE       0x0008
+#define NFSDBG_PROC            0x0010
+#define NFSDBG_XDR             0x0020
+#define NFSDBG_FILE            0x0040
+#define NFSDBG_ROOT            0x0080
+#define NFSDBG_CALLBACK                0x0100
+#define NFSDBG_CLIENT          0x0200
+#define NFSDBG_MOUNT           0x0400
+#define NFSDBG_FSCACHE         0x0800
+#define NFSDBG_PNFS            0x1000
+#define NFSDBG_PNFS_LD         0x2000
+#define NFSDBG_STATE           0x4000
+#define NFSDBG_ALL             0xFFFF
+
+
+#endif /* _UAPI_LINUX_NFS_FS_H */
diff --git a/include/uapi/linux/nfs_idmap.h b/include/uapi/linux/nfs_idmap.h
new file mode 100644 (file)
index 0000000..8d4b1c7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * include/linux/nfs_idmap.h
+ *
+ *  UID and GID to name mapping for clients.
+ *
+ *  Copyright (c) 2002 The Regents of the University of Michigan.
+ *  All rights reserved.
+ *
+ *  Marius Aamodt Eriksen <marius@umich.edu>
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. Neither the name of the University nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _UAPINFS_IDMAP_H
+#define _UAPINFS_IDMAP_H
+
+#include <linux/types.h>
+
+/* XXX from bits/utmp.h  */
+#define IDMAP_NAMESZ  128
+
+#define IDMAP_TYPE_USER  0
+#define IDMAP_TYPE_GROUP 1
+
+#define IDMAP_CONV_IDTONAME 0
+#define IDMAP_CONV_NAMETOID 1
+
+#define IDMAP_STATUS_INVALIDMSG 0x01
+#define IDMAP_STATUS_AGAIN      0x02
+#define IDMAP_STATUS_LOOKUPFAIL 0x04
+#define IDMAP_STATUS_SUCCESS    0x08
+
+struct idmap_msg {
+       __u8  im_type;
+       __u8  im_conv;
+       char  im_name[IDMAP_NAMESZ];
+       __u32 im_id;
+       __u8  im_status;
+};
+
+
+#endif /* _UAPINFS_IDMAP_H */
diff --git a/include/uapi/linux/nfsacl.h b/include/uapi/linux/nfsacl.h
new file mode 100644 (file)
index 0000000..9bb9771
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * File: linux/nfsacl.h
+ *
+ * (C) 2003 Andreas Gruenbacher <agruen@suse.de>
+ */
+#ifndef _UAPI__LINUX_NFSACL_H
+#define _UAPI__LINUX_NFSACL_H
+
+#define NFS_ACL_PROGRAM        100227
+
+#define ACLPROC2_GETACL                1
+#define ACLPROC2_SETACL                2
+#define ACLPROC2_GETATTR       3
+#define ACLPROC2_ACCESS                4
+
+#define ACLPROC3_GETACL                1
+#define ACLPROC3_SETACL                2
+
+
+/* Flags for the getacl/setacl mode */
+#define NFS_ACL                        0x0001
+#define NFS_ACLCNT             0x0002
+#define NFS_DFACL              0x0004
+#define NFS_DFACLCNT           0x0008
+
+/* Flag for Default ACL entries */
+#define NFS_ACL_DEFAULT                0x1000
+
+#endif /* _UAPI__LINUX_NFSACL_H */
diff --git a/include/uapi/linux/nubus.h b/include/uapi/linux/nubus.h
new file mode 100644 (file)
index 0000000..77513d2
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+  nubus.h: various definitions and prototypes for NuBus drivers to use.
+
+  Originally written by Alan Cox.
+
+  Hacked to death by C. Scott Ananian and David Huggins-Daines.
+  
+  Some of the constants in here are from the corresponding
+  NetBSD/OpenBSD header file, by Allen Briggs.  We figured out the
+  rest of them on our own. */
+
+#ifndef _UAPILINUX_NUBUS_H
+#define _UAPILINUX_NUBUS_H
+
+#include <linux/types.h>
+
+enum nubus_category {
+       NUBUS_CAT_BOARD          = 0x0001,
+       NUBUS_CAT_DISPLAY        = 0x0003,
+       NUBUS_CAT_NETWORK        = 0x0004,
+       NUBUS_CAT_COMMUNICATIONS = 0x0006,
+       NUBUS_CAT_FONT           = 0x0009,
+       NUBUS_CAT_CPU            = 0x000A,
+       /* For lack of a better name */
+       NUBUS_CAT_DUODOCK        = 0x0020
+};
+
+enum nubus_type_network {
+       NUBUS_TYPE_ETHERNET      = 0x0001,
+       NUBUS_TYPE_RS232         = 0x0002
+};
+
+enum nubus_type_display {
+       NUBUS_TYPE_VIDEO         = 0x0001
+};
+
+enum nubus_type_cpu {
+       NUBUS_TYPE_68020         = 0x0003,
+       NUBUS_TYPE_68030         = 0x0004,
+       NUBUS_TYPE_68040         = 0x0005
+};
+
+/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
+ *  68030 motherboards: <10,4,0,24>
+ *  68040 motherboards: <10,5,0,24>
+ *  DuoDock Plus: <32,1,1,2>
+ *
+ *  Toby Frame Buffer card: <3,1,1,1>
+ *  RBV built-in video (IIci): <3,1,1,24>
+ *  Valkyrie built-in video (Q630): <3,1,1,46>
+ *  Macintosh Display Card: <3,1,1,25>
+ *  Sonora built-in video (P460): <3,1,1,34>
+ *  Jet framebuffer (DuoDock Plus): <3,1,1,41>
+ *
+ *  SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
+ *  SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
+ *  Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
+ *  Sonic Systems Ethernet A-Series Card: <4,1,268,256>
+ *  Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
+ *   ROM on the above card: <2,1,0,0>
+ *  Cabletron ethernet card: <4,1,1,265>
+ *  Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
+ *  Kinetics EtherPort IIN: <4,1,259,262>
+ *  API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
+ *
+ *  Add your devices to the list!  You can obtain the "Slots" utility
+ *  from Apple's FTP site at:
+ *  ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
+ *
+ *  Alternately, TattleTech can be found at any Info-Mac mirror site.  
+ *  or from its distribution site: ftp://ftp.decismkr.com/dms
+ */
+
+/* DrSW: Uniquely identifies the software interface to a board.  This
+   is usually the one you want to look at when writing a driver.  It's
+   not as useful as you think, though, because as we should know by
+   now (duh), "Apple Compatible" can mean a lot of things... */
+
+/* Add known DrSW values here */
+enum nubus_drsw {
+       /* NUBUS_CAT_DISPLAY */
+       NUBUS_DRSW_APPLE        = 0x0001,
+       NUBUS_DRSW_APPLE_HIRES  = 0x0013, /* MacII HiRes card driver */
+       
+       /* NUBUS_CAT_NETWORK */
+       NUBUS_DRSW_3COM         = 0x0000,
+       NUBUS_DRSW_CABLETRON    = 0x0001,
+       NUBUS_DRSW_SONIC_LC     = 0x0001,
+       NUBUS_DRSW_KINETICS     = 0x0103,
+       NUBUS_DRSW_ASANTE       = 0x0104,
+       NUBUS_DRSW_TECHWORKS    = 0x0109,
+       NUBUS_DRSW_DAYNA        = 0x010b,
+       NUBUS_DRSW_FARALLON     = 0x010c,
+       NUBUS_DRSW_APPLE_SN     = 0x010f,
+       NUBUS_DRSW_DAYNA2       = 0x0115,
+       NUBUS_DRSW_FOCUS        = 0x011a,
+       NUBUS_DRSW_ASANTE_CS    = 0x011d, /* use asante SMC9194 driver */
+       NUBUS_DRSW_DAYNA_LC     = 0x011e,
+
+       /* NUBUS_CAT_CPU */
+       NUBUS_DRSW_NONE         = 0x0000,
+};
+
+/* DrHW: Uniquely identifies the hardware interface to a board (or at
+   least, it should...  some video cards are known to incorrectly
+   identify themselves as Toby cards) */
+
+/* Add known DrHW values here */
+enum nubus_drhw {
+       /* NUBUS_CAT_DISPLAY */
+       NUBUS_DRHW_APPLE_TFB      = 0x0001, /* Toby frame buffer card */
+       NUBUS_DRHW_APPLE_WVC      = 0x0006, /* Apple Workstation Video Card */
+       NUBUS_DRHW_SIGMA_CLRMAX   = 0x0007, /* Sigma Design ColorMax */
+       NUBUS_DRHW_APPLE_SE30     = 0x0009, /* Apple SE/30 video */
+       NUBUS_DRHW_APPLE_HRVC     = 0x0013, /* Mac II High-Res Video Card */
+       NUBUS_DRHW_APPLE_PVC      = 0x0017, /* Mac II Portrait Video Card */
+       NUBUS_DRHW_APPLE_RBV1     = 0x0018, /* IIci RBV video */
+       NUBUS_DRHW_APPLE_MDC      = 0x0019, /* Macintosh Display Card */
+       NUBUS_DRHW_APPLE_SONORA   = 0x0022, /* Sonora built-in video */
+       NUBUS_DRHW_APPLE_24AC     = 0x002b, /* Mac 24AC Video Card */
+       NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
+       NUBUS_DRHW_APPLE_JET      = 0x0029, /* Jet framebuffer (DuoDock) */
+       NUBUS_DRHW_SMAC_GFX       = 0x0105, /* SuperMac GFX */
+       NUBUS_DRHW_RASTER_CB264   = 0x013B, /* RasterOps ColorBoard 264 */
+       NUBUS_DRHW_MICRON_XCEED   = 0x0146, /* Micron Exceed color */
+       NUBUS_DRHW_RDIUS_GSC      = 0x0153, /* Radius GS/C */
+       NUBUS_DRHW_SMAC_SPEC8     = 0x017B, /* SuperMac Spectrum/8 */
+       NUBUS_DRHW_SMAC_SPEC24    = 0x017C, /* SuperMac Spectrum/24 */
+       NUBUS_DRHW_RASTER_CB364   = 0x026F, /* RasterOps ColorBoard 364 */
+       NUBUS_DRHW_RDIUS_DCGX     = 0x027C, /* Radius DirectColor/GX */
+       NUBUS_DRHW_RDIUS_PC8      = 0x0291, /* Radius PrecisionColor 8 */
+       NUBUS_DRHW_LAPIS_PCS8     = 0x0292, /* Lapis ProColorServer 8 */
+       NUBUS_DRHW_RASTER_24XLI   = 0x02A0, /* RasterOps 8/24 XLi */
+       NUBUS_DRHW_RASTER_PBPGT   = 0x02A5, /* RasterOps PaintBoard Prism GT */
+       NUBUS_DRHW_EMACH_FSX      = 0x02AE, /* E-Machines Futura SX */
+       NUBUS_DRHW_RASTER_24XLTV  = 0x02B7, /* RasterOps 24XLTV */
+       NUBUS_DRHW_SMAC_THUND24   = 0x02CB, /* SuperMac Thunder/24 */
+       NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
+       NUBUS_DRHW_RDIUS_PC24XP   = 0x0406, /* Radius PrecisionColor 24Xp */
+       NUBUS_DRHW_RDIUS_PC24X    = 0x040A, /* Radius PrecisionColor 24X */
+       NUBUS_DRHW_RDIUS_PC8XJ    = 0x040B, /* Radius PrecisionColor 8XJ */
+       
+       /* NUBUS_CAT_NETWORK */
+       NUBUS_DRHW_INTERLAN       = 0x0100,
+       NUBUS_DRHW_SMC9194        = 0x0101,
+       NUBUS_DRHW_KINETICS       = 0x0106,
+       NUBUS_DRHW_CABLETRON      = 0x0109,
+       NUBUS_DRHW_ASANTE_LC      = 0x010f,
+       NUBUS_DRHW_SONIC          = 0x0110,
+       NUBUS_DRHW_TECHWORKS      = 0x0112,
+       NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
+       NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
+       NUBUS_DRHW_FOCUS          = 0x011c,
+       NUBUS_DRHW_SONNET         = 0x011d,
+};
+
+/* Resource IDs: These are the identifiers for the various weird and
+   wonderful tidbits of information that may or may not reside in the
+   NuBus ROM directory. */
+enum nubus_res_id {
+       NUBUS_RESID_TYPE         = 0x0001,
+       NUBUS_RESID_NAME         = 0x0002,
+       NUBUS_RESID_ICON         = 0x0003,
+       NUBUS_RESID_DRVRDIR      = 0x0004,
+       NUBUS_RESID_LOADREC      = 0x0005,
+       NUBUS_RESID_BOOTREC      = 0x0006,
+       NUBUS_RESID_FLAGS        = 0x0007,
+       NUBUS_RESID_HWDEVID      = 0x0008,
+       NUBUS_RESID_MINOR_BASEOS = 0x000a,
+       NUBUS_RESID_MINOR_LENGTH = 0x000b,
+       NUBUS_RESID_MAJOR_BASEOS = 0x000c,
+       NUBUS_RESID_MAJOR_LENGTH = 0x000d,
+       NUBUS_RESID_CICN         = 0x000f,
+       NUBUS_RESID_ICL8         = 0x0010,
+       NUBUS_RESID_ICL4         = 0x0011,
+};
+
+/* Category-specific resources. */
+enum nubus_board_res_id {
+       NUBUS_RESID_BOARDID      = 0x0020,
+       NUBUS_RESID_PRAMINITDATA = 0x0021,
+       NUBUS_RESID_PRIMARYINIT  = 0x0022,
+       NUBUS_RESID_TIMEOUTCONST = 0x0023,
+       NUBUS_RESID_VENDORINFO   = 0x0024,
+       NUBUS_RESID_BOARDFLAGS   = 0x0025,
+       NUBUS_RESID_SECONDINIT   = 0x0026,
+
+       /* Not sure why Apple put these next two in here */
+       NUBUS_RESID_VIDNAMES     = 0x0041,
+       NUBUS_RESID_VIDMODES     = 0x007e
+};
+
+/* Fields within the vendor info directory */
+enum nubus_vendor_res_id {
+       NUBUS_RESID_VEND_ID     = 0x0001,
+       NUBUS_RESID_VEND_SERIAL = 0x0002,
+       NUBUS_RESID_VEND_REV    = 0x0003,
+       NUBUS_RESID_VEND_PART   = 0x0004,
+       NUBUS_RESID_VEND_DATE   = 0x0005
+};
+
+enum nubus_net_res_id {
+       NUBUS_RESID_MAC_ADDRESS  = 0x0080
+};
+
+enum nubus_cpu_res_id {
+       NUBUS_RESID_MEMINFO      = 0x0081,
+       NUBUS_RESID_ROMINFO      = 0x0082
+};
+
+enum nubus_display_res_id {
+       NUBUS_RESID_GAMMADIR    = 0x0040,
+       NUBUS_RESID_FIRSTMODE   = 0x0080,
+       NUBUS_RESID_SECONDMODE  = 0x0081,
+       NUBUS_RESID_THIRDMODE   = 0x0082,
+       NUBUS_RESID_FOURTHMODE  = 0x0083,
+       NUBUS_RESID_FIFTHMODE   = 0x0084,
+       NUBUS_RESID_SIXTHMODE   = 0x0085
+};
+
+struct nubus_dir
+{
+       unsigned char *base;
+       unsigned char *ptr;
+       int done;
+       int mask;
+};
+
+struct nubus_dirent
+{
+       unsigned char *base;
+       unsigned char type;
+       __u32 data;     /* Actually 24bits used */
+       int mask;
+};
+
+
+/* We'd like to get rid of this eventually.  Only daynaport.c uses it now. */
+static inline void *nubus_slot_addr(int slot)
+{
+       return (void *)(0xF0000000|(slot<<24));
+}
+
+#endif /* _UAPILINUX_NUBUS_H */
diff --git a/include/uapi/linux/nvram.h b/include/uapi/linux/nvram.h
new file mode 100644 (file)
index 0000000..0986c43
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _UAPI_LINUX_NVRAM_H
+#define _UAPI_LINUX_NVRAM_H
+
+#include <linux/ioctl.h>
+
+/* /dev/nvram ioctls */
+#define NVRAM_INIT     _IO('p', 0x40) /* initialize NVRAM and set checksum */
+#define NVRAM_SETCKS   _IO('p', 0x41) /* recalculate checksum */
+
+/* for all current systems, this is where NVRAM starts */
+#define NVRAM_FIRST_BYTE    14
+/* all these functions expect an NVRAM offset, not an absolute */
+#define NVRAM_OFFSET(x)   ((x)-NVRAM_FIRST_BYTE)
+
+
+#endif /* _UAPI_LINUX_NVRAM_H */
diff --git a/include/uapi/linux/omapfb.h b/include/uapi/linux/omapfb.h
new file mode 100644 (file)
index 0000000..7c97bc0
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * File: include/linux/omapfb.h
+ *
+ * Framebuffer driver for TI OMAP boards
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <imre.deak@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef _UAPI__LINUX_OMAPFB_H__
+#define _UAPI__LINUX_OMAPFB_H__
+
+#include <linux/fb.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/* IOCTL commands. */
+
+#define OMAP_IOW(num, dtype)   _IOW('O', num, dtype)
+#define OMAP_IOR(num, dtype)   _IOR('O', num, dtype)
+#define OMAP_IOWR(num, dtype)  _IOWR('O', num, dtype)
+#define OMAP_IO(num)           _IO('O', num)
+
+#define OMAPFB_MIRROR          OMAP_IOW(31, int)
+#define OMAPFB_SYNC_GFX                OMAP_IO(37)
+#define OMAPFB_VSYNC           OMAP_IO(38)
+#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
+#define OMAPFB_GET_CAPS                OMAP_IOR(42, struct omapfb_caps)
+#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
+#define OMAPFB_LCD_TEST                OMAP_IOW(45, int)
+#define OMAPFB_CTRL_TEST       OMAP_IOW(46, int)
+#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
+#define OMAPFB_SET_COLOR_KEY   OMAP_IOW(50, struct omapfb_color_key)
+#define OMAPFB_GET_COLOR_KEY   OMAP_IOW(51, struct omapfb_color_key)
+#define OMAPFB_SETUP_PLANE     OMAP_IOW(52, struct omapfb_plane_info)
+#define OMAPFB_QUERY_PLANE     OMAP_IOW(53, struct omapfb_plane_info)
+#define OMAPFB_UPDATE_WINDOW   OMAP_IOW(54, struct omapfb_update_window)
+#define OMAPFB_SETUP_MEM       OMAP_IOW(55, struct omapfb_mem_info)
+#define OMAPFB_QUERY_MEM       OMAP_IOW(56, struct omapfb_mem_info)
+#define OMAPFB_WAITFORVSYNC    OMAP_IO(57)
+#define OMAPFB_MEMORY_READ     OMAP_IOR(58, struct omapfb_memory_read)
+#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
+#define OMAPFB_WAITFORGO       OMAP_IO(60)
+#define OMAPFB_GET_VRAM_INFO   OMAP_IOR(61, struct omapfb_vram_info)
+#define OMAPFB_SET_TEARSYNC    OMAP_IOW(62, struct omapfb_tearsync_info)
+#define OMAPFB_GET_DISPLAY_INFO        OMAP_IOR(63, struct omapfb_display_info)
+
+#define OMAPFB_CAPS_GENERIC_MASK       0x00000fff
+#define OMAPFB_CAPS_LCDC_MASK          0x00fff000
+#define OMAPFB_CAPS_PANEL_MASK         0xff000000
+
+#define OMAPFB_CAPS_MANUAL_UPDATE      0x00001000
+#define OMAPFB_CAPS_TEARSYNC           0x00002000
+#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
+#define OMAPFB_CAPS_PLANE_SCALE                0x00008000
+#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE        0x00010000
+#define OMAPFB_CAPS_WINDOW_SCALE       0x00020000
+#define OMAPFB_CAPS_WINDOW_OVERLAY     0x00040000
+#define OMAPFB_CAPS_WINDOW_ROTATE      0x00080000
+#define OMAPFB_CAPS_SET_BACKLIGHT      0x01000000
+
+/* Values from DSP must map to lower 16-bits */
+#define OMAPFB_FORMAT_MASK             0x00ff
+#define OMAPFB_FORMAT_FLAG_DOUBLE      0x0100
+#define OMAPFB_FORMAT_FLAG_TEARSYNC    0x0200
+#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
+#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY      0x0800
+#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY     0x1000
+
+#define OMAPFB_MEMTYPE_SDRAM           0
+#define OMAPFB_MEMTYPE_SRAM            1
+#define OMAPFB_MEMTYPE_MAX             1
+
+#define OMAPFB_MEM_IDX_ENABLED 0x80
+#define OMAPFB_MEM_IDX_MASK    0x7f
+
+enum omapfb_color_format {
+       OMAPFB_COLOR_RGB565 = 0,
+       OMAPFB_COLOR_YUV422,
+       OMAPFB_COLOR_YUV420,
+       OMAPFB_COLOR_CLUT_8BPP,
+       OMAPFB_COLOR_CLUT_4BPP,
+       OMAPFB_COLOR_CLUT_2BPP,
+       OMAPFB_COLOR_CLUT_1BPP,
+       OMAPFB_COLOR_RGB444,
+       OMAPFB_COLOR_YUY422,
+
+       OMAPFB_COLOR_ARGB16,
+       OMAPFB_COLOR_RGB24U,    /* RGB24, 32-bit container */
+       OMAPFB_COLOR_RGB24P,    /* RGB24, 24-bit container */
+       OMAPFB_COLOR_ARGB32,
+       OMAPFB_COLOR_RGBA32,
+       OMAPFB_COLOR_RGBX32,
+};
+
+struct omapfb_update_window {
+       __u32 x, y;
+       __u32 width, height;
+       __u32 format;
+       __u32 out_x, out_y;
+       __u32 out_width, out_height;
+       __u32 reserved[8];
+};
+
+struct omapfb_update_window_old {
+       __u32 x, y;
+       __u32 width, height;
+       __u32 format;
+};
+
+enum omapfb_plane {
+       OMAPFB_PLANE_GFX = 0,
+       OMAPFB_PLANE_VID1,
+       OMAPFB_PLANE_VID2,
+};
+
+enum omapfb_channel_out {
+       OMAPFB_CHANNEL_OUT_LCD = 0,
+       OMAPFB_CHANNEL_OUT_DIGIT,
+};
+
+struct omapfb_plane_info {
+       __u32 pos_x;
+       __u32 pos_y;
+       __u8  enabled;
+       __u8  channel_out;
+       __u8  mirror;
+       __u8  mem_idx;
+       __u32 out_width;
+       __u32 out_height;
+       __u32 reserved2[12];
+};
+
+struct omapfb_mem_info {
+       __u32 size;
+       __u8  type;
+       __u8  reserved[3];
+};
+
+struct omapfb_caps {
+       __u32 ctrl;
+       __u32 plane_color;
+       __u32 wnd_color;
+};
+
+enum omapfb_color_key_type {
+       OMAPFB_COLOR_KEY_DISABLED = 0,
+       OMAPFB_COLOR_KEY_GFX_DST,
+       OMAPFB_COLOR_KEY_VID_SRC,
+};
+
+struct omapfb_color_key {
+       __u8  channel_out;
+       __u32 background;
+       __u32 trans_key;
+       __u8  key_type;
+};
+
+enum omapfb_update_mode {
+       OMAPFB_UPDATE_DISABLED = 0,
+       OMAPFB_AUTO_UPDATE,
+       OMAPFB_MANUAL_UPDATE
+};
+
+struct omapfb_memory_read {
+       __u16 x;
+       __u16 y;
+       __u16 w;
+       __u16 h;
+       size_t buffer_size;
+       void __user *buffer;
+};
+
+struct omapfb_ovl_colormode {
+       __u8 overlay_idx;
+       __u8 mode_idx;
+       __u32 bits_per_pixel;
+       __u32 nonstd;
+       struct fb_bitfield red;
+       struct fb_bitfield green;
+       struct fb_bitfield blue;
+       struct fb_bitfield transp;
+};
+
+struct omapfb_vram_info {
+       __u32 total;
+       __u32 free;
+       __u32 largest_free_block;
+       __u32 reserved[5];
+};
+
+struct omapfb_tearsync_info {
+       __u8 enabled;
+       __u8 reserved1[3];
+       __u16 line;
+       __u16 reserved2;
+};
+
+struct omapfb_display_info {
+       __u16 xres;
+       __u16 yres;
+       __u32 width;    /* phys width of the display in micrometers */
+       __u32 height;   /* phys height of the display in micrometers */
+       __u32 reserved[5];
+};
+
+
+#endif /* _UAPI__LINUX_OMAPFB_H__ */
diff --git a/include/uapi/linux/oom.h b/include/uapi/linux/oom.h
new file mode 100644 (file)
index 0000000..a49c4af
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _UAPI__INCLUDE_LINUX_OOM_H
+#define _UAPI__INCLUDE_LINUX_OOM_H
+
+/*
+ * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for
+ * pid.
+ */
+#define OOM_SCORE_ADJ_MIN      (-1000)
+#define OOM_SCORE_ADJ_MAX      1000
+
+#endif /* _UAPI__INCLUDE_LINUX_OOM_H */
diff --git a/include/uapi/linux/parport.h b/include/uapi/linux/parport.h
new file mode 100644 (file)
index 0000000..f41388f
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _UAPI_PARPORT_H_
+#define _UAPI_PARPORT_H_
+
+/* Start off with user-visible constants */
+
+/* Maximum of 16 ports per machine */
+#define PARPORT_MAX  16
+
+/* Magic numbers */
+#define PARPORT_IRQ_NONE  -1
+#define PARPORT_DMA_NONE  -1
+#define PARPORT_IRQ_AUTO  -2
+#define PARPORT_DMA_AUTO  -2
+#define PARPORT_DMA_NOFIFO -3
+#define PARPORT_DISABLE   -2
+#define PARPORT_IRQ_PROBEONLY -3
+#define PARPORT_IOHI_AUTO -1
+
+#define PARPORT_CONTROL_STROBE    0x1
+#define PARPORT_CONTROL_AUTOFD    0x2
+#define PARPORT_CONTROL_INIT      0x4
+#define PARPORT_CONTROL_SELECT    0x8
+
+#define PARPORT_STATUS_ERROR      0x8
+#define PARPORT_STATUS_SELECT     0x10
+#define PARPORT_STATUS_PAPEROUT   0x20
+#define PARPORT_STATUS_ACK        0x40
+#define PARPORT_STATUS_BUSY       0x80
+
+/* Type classes for Plug-and-Play probe.  */
+typedef enum {
+       PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
+       PARPORT_CLASS_PRINTER,
+       PARPORT_CLASS_MODEM,
+       PARPORT_CLASS_NET,
+       PARPORT_CLASS_HDC,              /* Hard disk controller */
+       PARPORT_CLASS_PCMCIA,
+       PARPORT_CLASS_MEDIA,            /* Multimedia device */
+       PARPORT_CLASS_FDC,              /* Floppy disk controller */
+       PARPORT_CLASS_PORTS,
+       PARPORT_CLASS_SCANNER,
+       PARPORT_CLASS_DIGCAM,
+       PARPORT_CLASS_OTHER,            /* Anything else */
+       PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
+       PARPORT_CLASS_SCSIADAPTER
+} parport_device_class;
+
+/* The "modes" entry in parport is a bit field representing the
+   capabilities of the hardware. */
+#define PARPORT_MODE_PCSPP     (1<<0) /* IBM PC registers available. */
+#define PARPORT_MODE_TRISTATE  (1<<1) /* Can tristate. */
+#define PARPORT_MODE_EPP       (1<<2) /* Hardware EPP. */
+#define PARPORT_MODE_ECP       (1<<3) /* Hardware ECP. */
+#define PARPORT_MODE_COMPAT    (1<<4) /* Hardware 'printer protocol'. */
+#define PARPORT_MODE_DMA       (1<<5) /* Hardware can DMA. */
+#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
+
+/* IEEE1284 modes: 
+   Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
+   'extensibility request' values.  Others are special.
+   'Real' ECP modes must have the IEEE1284_MODE_ECP bit set.  */
+#define IEEE1284_MODE_NIBBLE             0
+#define IEEE1284_MODE_BYTE              (1<<0)
+#define IEEE1284_MODE_COMPAT            (1<<8)
+#define IEEE1284_MODE_BECP              (1<<9) /* Bounded ECP mode */
+#define IEEE1284_MODE_ECP               (1<<4)
+#define IEEE1284_MODE_ECPRLE            (IEEE1284_MODE_ECP | (1<<5))
+#define IEEE1284_MODE_ECPSWE            (1<<10) /* Software-emulated */
+#define IEEE1284_MODE_EPP               (1<<6)
+#define IEEE1284_MODE_EPPSL             (1<<11) /* EPP 1.7 */
+#define IEEE1284_MODE_EPPSWE            (1<<12) /* Software-emulated */
+#define IEEE1284_DEVICEID               (1<<2)  /* This is a flag */
+#define IEEE1284_EXT_LINK               (1<<14) /* This flag causes the
+                                                * extensibility link to
+                                                * be requested, using
+                                                * bits 0-6. */
+
+/* For the benefit of parport_read/write, you can use these with
+ * parport_negotiate to use address operations.  They have no effect
+ * other than to make parport_read/write use address transfers. */
+#define IEEE1284_ADDR                  (1<<13) /* This is a flag */
+#define IEEE1284_DATA                   0      /* So is this */
+
+/* Flags for block transfer operations. */
+#define PARPORT_EPP_FAST               (1<<0) /* Unreliable counts. */
+#define PARPORT_W91284PIC              (1<<1) /* have a Warp9 w91284pic in the device */
+
+/* The rest is for the kernel only */
+#endif /* _UAPI_PARPORT_H_ */
diff --git a/include/uapi/linux/patchkey.h b/include/uapi/linux/patchkey.h
new file mode 100644 (file)
index 0000000..1bda0e5
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * <linux/patchkey.h> -- definition of _PATCHKEY macro
+ *
+ * Copyright (C) 2005 Stuart Brady
+ *
+ * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
+ * clear whether removing this would break anything in userspace.
+ *
+ * Do not include this file directly.  Please use <sys/soundcard.h> instead.
+ * For kernel code, use <linux/soundcard.h>
+ */
+
+#ifndef _LINUX_PATCHKEY_H_INDIRECT
+#error "patchkey.h included directly"
+#endif
+
+#ifndef _UAPI_LINUX_PATCHKEY_H
+#define _UAPI_LINUX_PATCHKEY_H
+
+/* Endian macros. */
+#ifndef __KERNEL__
+#  include <endian.h>
+#endif
+
+#if !defined(__KERNEL__)
+#if defined(__BYTE_ORDER)
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define _PATCHKEY(id) (0xfd00|id)
+#  elif __BYTE_ORDER == __LITTLE_ENDIAN
+#    define _PATCHKEY(id) ((id<<8)|0x00fd)
+#  else
+#    error "could not determine byte order"
+#  endif
+#endif
+#endif
+
+#endif /* _UAPI_LINUX_PATCHKEY_H */
diff --git a/include/uapi/linux/pci.h b/include/uapi/linux/pci.h
new file mode 100644 (file)
index 0000000..3c292bc
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ *     pci.h
+ *
+ *     PCI defines and function prototypes
+ *     Copyright 1994, Drew Eckhardt
+ *     Copyright 1997--1999 Martin Mares <mj@ucw.cz>
+ *
+ *     For more information, please consult the following manuals (look at
+ *     http://www.pcisig.com/ for how to get them):
+ *
+ *     PCI BIOS Specification
+ *     PCI Local Bus Specification
+ *     PCI to PCI Bridge Specification
+ *     PCI System Design Guide
+ */
+
+#ifndef _UAPILINUX_PCI_H
+#define _UAPILINUX_PCI_H
+
+#include <linux/pci_regs.h>    /* The pci register defines */
+
+/*
+ * The PCI interface treats multi-function devices as independent
+ * devices.  The slot/function address of each device is encoded
+ * in a single byte as follows:
+ *
+ *     7:3 = slot
+ *     2:0 = function
+ */
+#define PCI_DEVFN(slot, func)  ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+#define PCI_SLOT(devfn)                (((devfn) >> 3) & 0x1f)
+#define PCI_FUNC(devfn)                ((devfn) & 0x07)
+
+/* Ioctls for /proc/bus/pci/X/Y nodes. */
+#define PCIIOC_BASE            ('P' << 24 | 'C' << 16 | 'I' << 8)
+#define PCIIOC_CONTROLLER      (PCIIOC_BASE | 0x00)    /* Get controller for PCI device. */
+#define PCIIOC_MMAP_IS_IO      (PCIIOC_BASE | 0x01)    /* Set mmap state to I/O space. */
+#define PCIIOC_MMAP_IS_MEM     (PCIIOC_BASE | 0x02)    /* Set mmap state to MEM space. */
+#define PCIIOC_WRITE_COMBINE   (PCIIOC_BASE | 0x03)    /* Enable/disable write-combining. */
+
+#endif /* _UAPILINUX_PCI_H */
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
new file mode 100644 (file)
index 0000000..4f63c05
--- /dev/null
@@ -0,0 +1,615 @@
+/*
+ * Performance events:
+ *
+ *    Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de>
+ *    Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar
+ *    Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra
+ *
+ * Data type definitions, declarations, prototypes.
+ *
+ *    Started by: Thomas Gleixner and Ingo Molnar
+ *
+ * For licencing details see kernel-base/COPYING
+ */
+#ifndef _UAPI_LINUX_PERF_EVENT_H
+#define _UAPI_LINUX_PERF_EVENT_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <asm/byteorder.h>
+
+/*
+ * User-space ABI bits:
+ */
+
+/*
+ * attr.type
+ */
+enum perf_type_id {
+       PERF_TYPE_HARDWARE                      = 0,
+       PERF_TYPE_SOFTWARE                      = 1,
+       PERF_TYPE_TRACEPOINT                    = 2,
+       PERF_TYPE_HW_CACHE                      = 3,
+       PERF_TYPE_RAW                           = 4,
+       PERF_TYPE_BREAKPOINT                    = 5,
+
+       PERF_TYPE_MAX,                          /* non-ABI */
+};
+
+/*
+ * Generalized performance event event_id types, used by the
+ * attr.event_id parameter of the sys_perf_event_open()
+ * syscall:
+ */
+enum perf_hw_id {
+       /*
+        * Common hardware events, generalized by the kernel:
+        */
+       PERF_COUNT_HW_CPU_CYCLES                = 0,
+       PERF_COUNT_HW_INSTRUCTIONS              = 1,
+       PERF_COUNT_HW_CACHE_REFERENCES          = 2,
+       PERF_COUNT_HW_CACHE_MISSES              = 3,
+       PERF_COUNT_HW_BRANCH_INSTRUCTIONS       = 4,
+       PERF_COUNT_HW_BRANCH_MISSES             = 5,
+       PERF_COUNT_HW_BUS_CYCLES                = 6,
+       PERF_COUNT_HW_STALLED_CYCLES_FRONTEND   = 7,
+       PERF_COUNT_HW_STALLED_CYCLES_BACKEND    = 8,
+       PERF_COUNT_HW_REF_CPU_CYCLES            = 9,
+
+       PERF_COUNT_HW_MAX,                      /* non-ABI */
+};
+
+/*
+ * Generalized hardware cache events:
+ *
+ *       { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
+ *       { read, write, prefetch } x
+ *       { accesses, misses }
+ */
+enum perf_hw_cache_id {
+       PERF_COUNT_HW_CACHE_L1D                 = 0,
+       PERF_COUNT_HW_CACHE_L1I                 = 1,
+       PERF_COUNT_HW_CACHE_LL                  = 2,
+       PERF_COUNT_HW_CACHE_DTLB                = 3,
+       PERF_COUNT_HW_CACHE_ITLB                = 4,
+       PERF_COUNT_HW_CACHE_BPU                 = 5,
+       PERF_COUNT_HW_CACHE_NODE                = 6,
+
+       PERF_COUNT_HW_CACHE_MAX,                /* non-ABI */
+};
+
+enum perf_hw_cache_op_id {
+       PERF_COUNT_HW_CACHE_OP_READ             = 0,
+       PERF_COUNT_HW_CACHE_OP_WRITE            = 1,
+       PERF_COUNT_HW_CACHE_OP_PREFETCH         = 2,
+
+       PERF_COUNT_HW_CACHE_OP_MAX,             /* non-ABI */
+};
+
+enum perf_hw_cache_op_result_id {
+       PERF_COUNT_HW_CACHE_RESULT_ACCESS       = 0,
+       PERF_COUNT_HW_CACHE_RESULT_MISS         = 1,
+
+       PERF_COUNT_HW_CACHE_RESULT_MAX,         /* non-ABI */
+};
+
+/*
+ * Special "software" events provided by the kernel, even if the hardware
+ * does not support performance events. These events measure various
+ * physical and sw events of the kernel (and allow the profiling of them as
+ * well):
+ */
+enum perf_sw_ids {
+       PERF_COUNT_SW_CPU_CLOCK                 = 0,
+       PERF_COUNT_SW_TASK_CLOCK                = 1,
+       PERF_COUNT_SW_PAGE_FAULTS               = 2,
+       PERF_COUNT_SW_CONTEXT_SWITCHES          = 3,
+       PERF_COUNT_SW_CPU_MIGRATIONS            = 4,
+       PERF_COUNT_SW_PAGE_FAULTS_MIN           = 5,
+       PERF_COUNT_SW_PAGE_FAULTS_MAJ           = 6,
+       PERF_COUNT_SW_ALIGNMENT_FAULTS          = 7,
+       PERF_COUNT_SW_EMULATION_FAULTS          = 8,
+
+       PERF_COUNT_SW_MAX,                      /* non-ABI */
+};
+
+/*
+ * Bits that can be set in attr.sample_type to request information
+ * in the overflow packets.
+ */
+enum perf_event_sample_format {
+       PERF_SAMPLE_IP                          = 1U << 0,
+       PERF_SAMPLE_TID                         = 1U << 1,
+       PERF_SAMPLE_TIME                        = 1U << 2,
+       PERF_SAMPLE_ADDR                        = 1U << 3,
+       PERF_SAMPLE_READ                        = 1U << 4,
+       PERF_SAMPLE_CALLCHAIN                   = 1U << 5,
+       PERF_SAMPLE_ID                          = 1U << 6,
+       PERF_SAMPLE_CPU                         = 1U << 7,
+       PERF_SAMPLE_PERIOD                      = 1U << 8,
+       PERF_SAMPLE_STREAM_ID                   = 1U << 9,
+       PERF_SAMPLE_RAW                         = 1U << 10,
+       PERF_SAMPLE_BRANCH_STACK                = 1U << 11,
+       PERF_SAMPLE_REGS_USER                   = 1U << 12,
+       PERF_SAMPLE_STACK_USER                  = 1U << 13,
+
+       PERF_SAMPLE_MAX = 1U << 14,             /* non-ABI */
+};
+
+/*
+ * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
+ *
+ * If the user does not pass priv level information via branch_sample_type,
+ * the kernel uses the event's priv level. Branch and event priv levels do
+ * not have to match. Branch priv level is checked for permissions.
+ *
+ * The branch types can be combined, however BRANCH_ANY covers all types
+ * of branches and therefore it supersedes all the other types.
+ */
+enum perf_branch_sample_type {
+       PERF_SAMPLE_BRANCH_USER         = 1U << 0, /* user branches */
+       PERF_SAMPLE_BRANCH_KERNEL       = 1U << 1, /* kernel branches */
+       PERF_SAMPLE_BRANCH_HV           = 1U << 2, /* hypervisor branches */
+
+       PERF_SAMPLE_BRANCH_ANY          = 1U << 3, /* any branch types */
+       PERF_SAMPLE_BRANCH_ANY_CALL     = 1U << 4, /* any call branch */
+       PERF_SAMPLE_BRANCH_ANY_RETURN   = 1U << 5, /* any return branch */
+       PERF_SAMPLE_BRANCH_IND_CALL     = 1U << 6, /* indirect calls */
+
+       PERF_SAMPLE_BRANCH_MAX          = 1U << 7, /* non-ABI */
+};
+
+#define PERF_SAMPLE_BRANCH_PLM_ALL \
+       (PERF_SAMPLE_BRANCH_USER|\
+        PERF_SAMPLE_BRANCH_KERNEL|\
+        PERF_SAMPLE_BRANCH_HV)
+
+/*
+ * Values to determine ABI of the registers dump.
+ */
+enum perf_sample_regs_abi {
+       PERF_SAMPLE_REGS_ABI_NONE       = 0,
+       PERF_SAMPLE_REGS_ABI_32         = 1,
+       PERF_SAMPLE_REGS_ABI_64         = 2,
+};
+
+/*
+ * The format of the data returned by read() on a perf event fd,
+ * as specified by attr.read_format:
+ *
+ * struct read_format {
+ *     { u64           value;
+ *       { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
+ *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
+ *       { u64         id;           } && PERF_FORMAT_ID
+ *     } && !PERF_FORMAT_GROUP
+ *
+ *     { u64           nr;
+ *       { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
+ *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
+ *       { u64         value;
+ *         { u64       id;           } && PERF_FORMAT_ID
+ *       }             cntr[nr];
+ *     } && PERF_FORMAT_GROUP
+ * };
+ */
+enum perf_event_read_format {
+       PERF_FORMAT_TOTAL_TIME_ENABLED          = 1U << 0,
+       PERF_FORMAT_TOTAL_TIME_RUNNING          = 1U << 1,
+       PERF_FORMAT_ID                          = 1U << 2,
+       PERF_FORMAT_GROUP                       = 1U << 3,
+
+       PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
+};
+
+#define PERF_ATTR_SIZE_VER0    64      /* sizeof first published struct */
+#define PERF_ATTR_SIZE_VER1    72      /* add: config2 */
+#define PERF_ATTR_SIZE_VER2    80      /* add: branch_sample_type */
+#define PERF_ATTR_SIZE_VER3    96      /* add: sample_regs_user */
+                                       /* add: sample_stack_user */
+
+/*
+ * Hardware event_id to monitor via a performance monitoring event:
+ */
+struct perf_event_attr {
+
+       /*
+        * Major type: hardware/software/tracepoint/etc.
+        */
+       __u32                   type;
+
+       /*
+        * Size of the attr structure, for fwd/bwd compat.
+        */
+       __u32                   size;
+
+       /*
+        * Type specific configuration information.
+        */
+       __u64                   config;
+
+       union {
+               __u64           sample_period;
+               __u64           sample_freq;
+       };
+
+       __u64                   sample_type;
+       __u64                   read_format;
+
+       __u64                   disabled       :  1, /* off by default        */
+                               inherit        :  1, /* children inherit it   */
+                               pinned         :  1, /* must always be on PMU */
+                               exclusive      :  1, /* only group on PMU     */
+                               exclude_user   :  1, /* don't count user      */
+                               exclude_kernel :  1, /* ditto kernel          */
+                               exclude_hv     :  1, /* ditto hypervisor      */
+                               exclude_idle   :  1, /* don't count when idle */
+                               mmap           :  1, /* include mmap data     */
+                               comm           :  1, /* include comm data     */
+                               freq           :  1, /* use freq, not period  */
+                               inherit_stat   :  1, /* per task counts       */
+                               enable_on_exec :  1, /* next exec enables     */
+                               task           :  1, /* trace fork/exit       */
+                               watermark      :  1, /* wakeup_watermark      */
+                               /*
+                                * precise_ip:
+                                *
+                                *  0 - SAMPLE_IP can have arbitrary skid
+                                *  1 - SAMPLE_IP must have constant skid
+                                *  2 - SAMPLE_IP requested to have 0 skid
+                                *  3 - SAMPLE_IP must have 0 skid
+                                *
+                                *  See also PERF_RECORD_MISC_EXACT_IP
+                                */
+                               precise_ip     :  2, /* skid constraint       */
+                               mmap_data      :  1, /* non-exec mmap data    */
+                               sample_id_all  :  1, /* sample_type all events */
+
+                               exclude_host   :  1, /* don't count in host   */
+                               exclude_guest  :  1, /* don't count in guest  */
+
+                               exclude_callchain_kernel : 1, /* exclude kernel callchains */
+                               exclude_callchain_user   : 1, /* exclude user callchains */
+
+                               __reserved_1   : 41;
+
+       union {
+               __u32           wakeup_events;    /* wakeup every n events */
+               __u32           wakeup_watermark; /* bytes before wakeup   */
+       };
+
+       __u32                   bp_type;
+       union {
+               __u64           bp_addr;
+               __u64           config1; /* extension of config */
+       };
+       union {
+               __u64           bp_len;
+               __u64           config2; /* extension of config1 */
+       };
+       __u64   branch_sample_type; /* enum perf_branch_sample_type */
+
+       /*
+        * Defines set of user regs to dump on samples.
+        * See asm/perf_regs.h for details.
+        */
+       __u64   sample_regs_user;
+
+       /*
+        * Defines size of the user stack to dump on samples.
+        */
+       __u32   sample_stack_user;
+
+       /* Align to u64. */
+       __u32   __reserved_2;
+};
+
+#define perf_flags(attr)       (*(&(attr)->read_format + 1))
+
+/*
+ * Ioctls that can be done on a perf event fd:
+ */
+#define PERF_EVENT_IOC_ENABLE          _IO ('$', 0)
+#define PERF_EVENT_IOC_DISABLE         _IO ('$', 1)
+#define PERF_EVENT_IOC_REFRESH         _IO ('$', 2)
+#define PERF_EVENT_IOC_RESET           _IO ('$', 3)
+#define PERF_EVENT_IOC_PERIOD          _IOW('$', 4, __u64)
+#define PERF_EVENT_IOC_SET_OUTPUT      _IO ('$', 5)
+#define PERF_EVENT_IOC_SET_FILTER      _IOW('$', 6, char *)
+
+enum perf_event_ioc_flags {
+       PERF_IOC_FLAG_GROUP             = 1U << 0,
+};
+
+/*
+ * Structure of the page that can be mapped via mmap
+ */
+struct perf_event_mmap_page {
+       __u32   version;                /* version number of this structure */
+       __u32   compat_version;         /* lowest version this is compat with */
+
+       /*
+        * Bits needed to read the hw events in user-space.
+        *
+        *   u32 seq, time_mult, time_shift, idx, width;
+        *   u64 count, enabled, running;
+        *   u64 cyc, time_offset;
+        *   s64 pmc = 0;
+        *
+        *   do {
+        *     seq = pc->lock;
+        *     barrier()
+        *
+        *     enabled = pc->time_enabled;
+        *     running = pc->time_running;
+        *
+        *     if (pc->cap_usr_time && enabled != running) {
+        *       cyc = rdtsc();
+        *       time_offset = pc->time_offset;
+        *       time_mult   = pc->time_mult;
+        *       time_shift  = pc->time_shift;
+        *     }
+        *
+        *     idx = pc->index;
+        *     count = pc->offset;
+        *     if (pc->cap_usr_rdpmc && idx) {
+        *       width = pc->pmc_width;
+        *       pmc = rdpmc(idx - 1);
+        *     }
+        *
+        *     barrier();
+        *   } while (pc->lock != seq);
+        *
+        * NOTE: for obvious reason this only works on self-monitoring
+        *       processes.
+        */
+       __u32   lock;                   /* seqlock for synchronization */
+       __u32   index;                  /* hardware event identifier */
+       __s64   offset;                 /* add to hardware event value */
+       __u64   time_enabled;           /* time event active */
+       __u64   time_running;           /* time event on cpu */
+       union {
+               __u64   capabilities;
+               __u64   cap_usr_time  : 1,
+                       cap_usr_rdpmc : 1,
+                       cap_____res   : 62;
+       };
+
+       /*
+        * If cap_usr_rdpmc this field provides the bit-width of the value
+        * read using the rdpmc() or equivalent instruction. This can be used
+        * to sign extend the result like:
+        *
+        *   pmc <<= 64 - width;
+        *   pmc >>= 64 - width; // signed shift right
+        *   count += pmc;
+        */
+       __u16   pmc_width;
+
+       /*
+        * If cap_usr_time the below fields can be used to compute the time
+        * delta since time_enabled (in ns) using rdtsc or similar.
+        *
+        *   u64 quot, rem;
+        *   u64 delta;
+        *
+        *   quot = (cyc >> time_shift);
+        *   rem = cyc & ((1 << time_shift) - 1);
+        *   delta = time_offset + quot * time_mult +
+        *              ((rem * time_mult) >> time_shift);
+        *
+        * Where time_offset,time_mult,time_shift and cyc are read in the
+        * seqcount loop described above. This delta can then be added to
+        * enabled and possible running (if idx), improving the scaling:
+        *
+        *   enabled += delta;
+        *   if (idx)
+        *     running += delta;
+        *
+        *   quot = count / running;
+        *   rem  = count % running;
+        *   count = quot * enabled + (rem * enabled) / running;
+        */
+       __u16   time_shift;
+       __u32   time_mult;
+       __u64   time_offset;
+
+               /*
+                * Hole for extension of the self monitor capabilities
+                */
+
+       __u64   __reserved[120];        /* align to 1k */
+
+       /*
+        * Control data for the mmap() data buffer.
+        *
+        * User-space reading the @data_head value should issue an rmb(), on
+        * SMP capable platforms, after reading this value -- see
+        * perf_event_wakeup().
+        *
+        * When the mapping is PROT_WRITE the @data_tail value should be
+        * written by userspace to reflect the last read data. In this case
+        * the kernel will not over-write unread data.
+        */
+       __u64   data_head;              /* head in the data section */
+       __u64   data_tail;              /* user-space written tail */
+};
+
+#define PERF_RECORD_MISC_CPUMODE_MASK          (7 << 0)
+#define PERF_RECORD_MISC_CPUMODE_UNKNOWN       (0 << 0)
+#define PERF_RECORD_MISC_KERNEL                        (1 << 0)
+#define PERF_RECORD_MISC_USER                  (2 << 0)
+#define PERF_RECORD_MISC_HYPERVISOR            (3 << 0)
+#define PERF_RECORD_MISC_GUEST_KERNEL          (4 << 0)
+#define PERF_RECORD_MISC_GUEST_USER            (5 << 0)
+
+/*
+ * Indicates that the content of PERF_SAMPLE_IP points to
+ * the actual instruction that triggered the event. See also
+ * perf_event_attr::precise_ip.
+ */
+#define PERF_RECORD_MISC_EXACT_IP              (1 << 14)
+/*
+ * Reserve the last bit to indicate some extended misc field
+ */
+#define PERF_RECORD_MISC_EXT_RESERVED          (1 << 15)
+
+struct perf_event_header {
+       __u32   type;
+       __u16   misc;
+       __u16   size;
+};
+
+enum perf_event_type {
+
+       /*
+        * If perf_event_attr.sample_id_all is set then all event types will
+        * have the sample_type selected fields related to where/when
+        * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID)
+        * described in PERF_RECORD_SAMPLE below, it will be stashed just after
+        * the perf_event_header and the fields already present for the existing
+        * fields, i.e. at the end of the payload. That way a newer perf.data
+        * file will be supported by older perf tools, with these new optional
+        * fields being ignored.
+        *
+        * The MMAP events record the PROT_EXEC mappings so that we can
+        * correlate userspace IPs to code. They have the following structure:
+        *
+        * struct {
+        *      struct perf_event_header        header;
+        *
+        *      u32                             pid, tid;
+        *      u64                             addr;
+        *      u64                             len;
+        *      u64                             pgoff;
+        *      char                            filename[];
+        * };
+        */
+       PERF_RECORD_MMAP                        = 1,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u64                             id;
+        *      u64                             lost;
+        * };
+        */
+       PERF_RECORD_LOST                        = 2,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *
+        *      u32                             pid, tid;
+        *      char                            comm[];
+        * };
+        */
+       PERF_RECORD_COMM                        = 3,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u32                             pid, ppid;
+        *      u32                             tid, ptid;
+        *      u64                             time;
+        * };
+        */
+       PERF_RECORD_EXIT                        = 4,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u64                             time;
+        *      u64                             id;
+        *      u64                             stream_id;
+        * };
+        */
+       PERF_RECORD_THROTTLE                    = 5,
+       PERF_RECORD_UNTHROTTLE                  = 6,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u32                             pid, ppid;
+        *      u32                             tid, ptid;
+        *      u64                             time;
+        * };
+        */
+       PERF_RECORD_FORK                        = 7,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u32                             pid, tid;
+        *
+        *      struct read_format              values;
+        * };
+        */
+       PERF_RECORD_READ                        = 8,
+
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *
+        *      { u64                   ip;       } && PERF_SAMPLE_IP
+        *      { u32                   pid, tid; } && PERF_SAMPLE_TID
+        *      { u64                   time;     } && PERF_SAMPLE_TIME
+        *      { u64                   addr;     } && PERF_SAMPLE_ADDR
+        *      { u64                   id;       } && PERF_SAMPLE_ID
+        *      { u64                   stream_id;} && PERF_SAMPLE_STREAM_ID
+        *      { u32                   cpu, res; } && PERF_SAMPLE_CPU
+        *      { u64                   period;   } && PERF_SAMPLE_PERIOD
+        *
+        *      { struct read_format    values;   } && PERF_SAMPLE_READ
+        *
+        *      { u64                   nr,
+        *        u64                   ips[nr];  } && PERF_SAMPLE_CALLCHAIN
+        *
+        *      #
+        *      # The RAW record below is opaque data wrt the ABI
+        *      #
+        *      # That is, the ABI doesn't make any promises wrt to
+        *      # the stability of its content, it may vary depending
+        *      # on event, hardware, kernel version and phase of
+        *      # the moon.
+        *      #
+        *      # In other words, PERF_SAMPLE_RAW contents are not an ABI.
+        *      #
+        *
+        *      { u32                   size;
+        *        char                  data[size];}&& PERF_SAMPLE_RAW
+        *
+        *      { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK
+        *
+        *      { u64                   abi; # enum perf_sample_regs_abi
+        *        u64                   regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
+        *
+        *      { u64                   size;
+        *        char                  data[size];
+        *        u64                   dyn_size; } && PERF_SAMPLE_STACK_USER
+        * };
+        */
+       PERF_RECORD_SAMPLE                      = 9,
+
+       PERF_RECORD_MAX,                        /* non-ABI */
+};
+
+#define PERF_MAX_STACK_DEPTH           127
+
+enum perf_callchain_context {
+       PERF_CONTEXT_HV                 = (__u64)-32,
+       PERF_CONTEXT_KERNEL             = (__u64)-128,
+       PERF_CONTEXT_USER               = (__u64)-512,
+
+       PERF_CONTEXT_GUEST              = (__u64)-2048,
+       PERF_CONTEXT_GUEST_KERNEL       = (__u64)-2176,
+       PERF_CONTEXT_GUEST_USER         = (__u64)-2560,
+
+       PERF_CONTEXT_MAX                = (__u64)-4095,
+};
+
+#define PERF_FLAG_FD_NO_GROUP          (1U << 0)
+#define PERF_FLAG_FD_OUTPUT            (1U << 1)
+#define PERF_FLAG_PID_CGROUP           (1U << 2) /* pid=cgroup id, per-cpu mode only */
+
+#endif /* _UAPI_LINUX_PERF_EVENT_H */
diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h
new file mode 100644 (file)
index 0000000..aa169c4
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef _UAPI_LINUX_PERSONALITY_H
+#define _UAPI_LINUX_PERSONALITY_H
+
+
+/*
+ * Flags for bug emulation.
+ *
+ * These occupy the top three bytes.
+ */
+enum {
+       UNAME26 =               0x0020000,
+       ADDR_NO_RANDOMIZE =     0x0040000,      /* disable randomization of VA space */
+       FDPIC_FUNCPTRS =        0x0080000,      /* userspace function ptrs point to descriptors
+                                                * (signal handling)
+                                                */
+       MMAP_PAGE_ZERO =        0x0100000,
+       ADDR_COMPAT_LAYOUT =    0x0200000,
+       READ_IMPLIES_EXEC =     0x0400000,
+       ADDR_LIMIT_32BIT =      0x0800000,
+       SHORT_INODE =           0x1000000,
+       WHOLE_SECONDS =         0x2000000,
+       STICKY_TIMEOUTS =       0x4000000,
+       ADDR_LIMIT_3GB =        0x8000000,
+};
+
+/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC  | \
+                           ADDR_NO_RANDOMIZE  | \
+                           ADDR_COMPAT_LAYOUT | \
+                           MMAP_PAGE_ZERO)
+
+/*
+ * Personality types.
+ *
+ * These go in the low byte.  Avoid using the top bit, it will
+ * conflict with error returns.
+ */
+enum {
+       PER_LINUX =             0x0000,
+       PER_LINUX_32BIT =       0x0000 | ADDR_LIMIT_32BIT,
+       PER_LINUX_FDPIC =       0x0000 | FDPIC_FUNCPTRS,
+       PER_SVR4 =              0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+       PER_SVR3 =              0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+       PER_SCOSVR3 =           0x0003 | STICKY_TIMEOUTS |
+                                        WHOLE_SECONDS | SHORT_INODE,
+       PER_OSR5 =              0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+       PER_WYSEV386 =          0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+       PER_ISCR4 =             0x0005 | STICKY_TIMEOUTS,
+       PER_BSD =               0x0006,
+       PER_SUNOS =             0x0006 | STICKY_TIMEOUTS,
+       PER_XENIX =             0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+       PER_LINUX32 =           0x0008,
+       PER_LINUX32_3GB =       0x0008 | ADDR_LIMIT_3GB,
+       PER_IRIX32 =            0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
+       PER_IRIXN32 =           0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
+       PER_IRIX64 =            0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
+       PER_RISCOS =            0x000c,
+       PER_SOLARIS =           0x000d | STICKY_TIMEOUTS,
+       PER_UW7 =               0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+       PER_OSF4 =              0x000f,                  /* OSF/1 v4 */
+       PER_HPUX =              0x0010,
+       PER_MASK =              0x00ff,
+};
+
+
+#endif /* _UAPI_LINUX_PERSONALITY_H */
similarity index 100%
rename from include/linux/pg.h
rename to include/uapi/linux/pg.h
diff --git a/include/uapi/linux/phonet.h b/include/uapi/linux/phonet.h
new file mode 100644 (file)
index 0000000..a3e1d65
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * file phonet.h
+ *
+ * Phonet sockets kernel interface
+ *
+ * Copyright (C) 2008 Nokia Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _UAPILINUX_PHONET_H
+#define _UAPILINUX_PHONET_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* Automatic protocol selection */
+#define PN_PROTO_TRANSPORT     0
+/* Phonet datagram socket */
+#define PN_PROTO_PHONET                1
+/* Phonet pipe */
+#define PN_PROTO_PIPE          2
+#define PHONET_NPROTO          3
+
+/* Socket options for SOL_PNPIPE level */
+#define PNPIPE_ENCAP           1
+#define PNPIPE_IFINDEX         2
+#define PNPIPE_HANDLE          3
+#define PNPIPE_INITSTATE       4
+
+#define PNADDR_ANY             0
+#define PNADDR_BROADCAST       0xFC
+#define PNPORT_RESOURCE_ROUTING        0
+
+/* Values for PNPIPE_ENCAP option */
+#define PNPIPE_ENCAP_NONE      0
+#define PNPIPE_ENCAP_IP                1
+
+/* ioctls */
+#define SIOCPNGETOBJECT                (SIOCPROTOPRIVATE + 0)
+#define SIOCPNENABLEPIPE       (SIOCPROTOPRIVATE + 13)
+#define SIOCPNADDRESOURCE      (SIOCPROTOPRIVATE + 14)
+#define SIOCPNDELRESOURCE      (SIOCPROTOPRIVATE + 15)
+
+/* Phonet protocol header */
+struct phonethdr {
+       __u8    pn_rdev;
+       __u8    pn_sdev;
+       __u8    pn_res;
+       __be16  pn_length;
+       __u8    pn_robj;
+       __u8    pn_sobj;
+} __attribute__((packed));
+
+/* Common Phonet payload header */
+struct phonetmsg {
+       __u8    pn_trans_id;    /* transaction ID */
+       __u8    pn_msg_id;      /* message type */
+       union {
+               struct {
+                       __u8    pn_submsg_id;   /* message subtype */
+                       __u8    pn_data[5];
+               } base;
+               struct {
+                       __u16   pn_e_res_id;    /* extended resource ID */
+                       __u8    pn_e_submsg_id; /* message subtype */
+                       __u8    pn_e_data[3];
+               } ext;
+       } pn_msg_u;
+};
+#define PN_COMMON_MESSAGE      0xF0
+#define PN_COMMGR              0x10
+#define PN_PREFIX              0xE0 /* resource for extended messages */
+#define pn_submsg_id           pn_msg_u.base.pn_submsg_id
+#define pn_e_submsg_id         pn_msg_u.ext.pn_e_submsg_id
+#define pn_e_res_id            pn_msg_u.ext.pn_e_res_id
+#define pn_data                        pn_msg_u.base.pn_data
+#define pn_e_data              pn_msg_u.ext.pn_e_data
+
+/* data for unreachable errors */
+#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP    0x01
+#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP  0x14
+#define pn_orig_msg_id         pn_data[0]
+#define pn_status              pn_data[1]
+#define pn_e_orig_msg_id       pn_e_data[0]
+#define pn_e_status            pn_e_data[1]
+
+/* Phonet socket address structure */
+struct sockaddr_pn {
+       __kernel_sa_family_t spn_family;
+       __u8 spn_obj;
+       __u8 spn_dev;
+       __u8 spn_resource;
+       __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
+} __attribute__((packed));
+
+/* Well known address */
+#define PN_DEV_PC      0x10
+
+static inline __u16 pn_object(__u8 addr, __u16 port)
+{
+       return (addr << 8) | (port & 0x3ff);
+}
+
+static inline __u8 pn_obj(__u16 handle)
+{
+       return handle & 0xff;
+}
+
+static inline __u8 pn_dev(__u16 handle)
+{
+       return handle >> 8;
+}
+
+static inline __u16 pn_port(__u16 handle)
+{
+       return handle & 0x3ff;
+}
+
+static inline __u8 pn_addr(__u16 handle)
+{
+       return (handle >> 8) & 0xfc;
+}
+
+static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
+{
+       spn->spn_dev &= 0x03;
+       spn->spn_dev |= addr & 0xfc;
+}
+
+static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
+{
+       spn->spn_dev &= 0xfc;
+       spn->spn_dev |= (port >> 8) & 0x03;
+       spn->spn_obj = port & 0xff;
+}
+
+static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
+                                               __u16 handle)
+{
+       spn->spn_dev = pn_dev(handle);
+       spn->spn_obj = pn_obj(handle);
+}
+
+static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
+                                               __u8 resource)
+{
+       spn->spn_resource = resource;
+}
+
+static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
+{
+       return spn->spn_dev & 0xfc;
+}
+
+static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
+{
+       return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
+}
+
+static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
+{
+       return pn_object(spn->spn_dev, spn->spn_obj);
+}
+
+static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
+{
+       return spn->spn_resource;
+}
+
+/* Phonet device ioctl requests */
+
+#endif /* _UAPILINUX_PHONET_H */
diff --git a/include/uapi/linux/pktcdvd.h b/include/uapi/linux/pktcdvd.h
new file mode 100644 (file)
index 0000000..2640b9d
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
+ * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
+ *
+ * May be copied or modified under the terms of the GNU General Public
+ * License.  See linux/COPYING for more information.
+ *
+ * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
+ * DVD-RW devices.
+ *
+ */
+#ifndef _UAPI__PKTCDVD_H
+#define _UAPI__PKTCDVD_H
+
+#include <linux/types.h>
+
+/*
+ * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
+ */
+#define PACKET_DEBUG           1
+
+#define        MAX_WRITERS             8
+
+#define PKT_RB_POOL_SIZE       512
+
+/*
+ * How long we should hold a non-full packet before starting data gathering.
+ */
+#define PACKET_WAIT_TIME       (HZ * 5 / 1000)
+
+/*
+ * use drive write caching -- we need deferred error handling to be
+ * able to successfully recover with this option (drive will return good
+ * status as soon as the cdb is validated).
+ */
+#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
+#define USE_WCACHING           1
+#else
+#define USE_WCACHING           0
+#endif
+
+/*
+ * No user-servicable parts beyond this point ->
+ */
+
+/*
+ * device types
+ */
+#define PACKET_CDR             1
+#define        PACKET_CDRW             2
+#define PACKET_DVDR            3
+#define PACKET_DVDRW           4
+
+/*
+ * flags
+ */
+#define PACKET_WRITABLE                1       /* pd is writable */
+#define PACKET_NWA_VALID       2       /* next writable address valid */
+#define PACKET_LRA_VALID       3       /* last recorded address valid */
+#define PACKET_MERGE_SEGS      4       /* perform segment merging to keep */
+                                       /* underlying cdrom device happy */
+
+/*
+ * Disc status -- from READ_DISC_INFO
+ */
+#define PACKET_DISC_EMPTY      0
+#define PACKET_DISC_INCOMPLETE 1
+#define PACKET_DISC_COMPLETE   2
+#define PACKET_DISC_OTHER      3
+
+/*
+ * write type, and corresponding data block type
+ */
+#define PACKET_MODE1           1
+#define PACKET_MODE2           2
+#define PACKET_BLOCK_MODE1     8
+#define PACKET_BLOCK_MODE2     10
+
+/*
+ * Last session/border status
+ */
+#define PACKET_SESSION_EMPTY           0
+#define PACKET_SESSION_INCOMPLETE      1
+#define PACKET_SESSION_RESERVED                2
+#define PACKET_SESSION_COMPLETE                3
+
+#define PACKET_MCN                     "4a656e734178626f65323030300000"
+
+#undef PACKET_USE_LS
+
+#define PKT_CTRL_CMD_SETUP     0
+#define PKT_CTRL_CMD_TEARDOWN  1
+#define PKT_CTRL_CMD_STATUS    2
+
+struct pkt_ctrl_command {
+       __u32 command;                          /* in: Setup, teardown, status */
+       __u32 dev_index;                        /* in/out: Device index */
+       __u32 dev;                              /* in/out: Device nr for cdrw device */
+       __u32 pkt_dev;                          /* in/out: Device nr for packet device */
+       __u32 num_devices;                      /* out: Largest device index + 1 */
+       __u32 padding;                          /* Not used */
+};
+
+/*
+ * packet ioctls
+ */
+#define PACKET_IOCTL_MAGIC     ('X')
+#define PACKET_CTRL_CMD                _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
+
+
+#endif /* _UAPI__PKTCDVD_H */
diff --git a/include/uapi/linux/pmu.h b/include/uapi/linux/pmu.h
new file mode 100644 (file)
index 0000000..caead36
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Definitions for talking to the PMU.  The PMU is a microcontroller
+ * which controls battery charging and system power on PowerBook 3400
+ * and 2400 models as well as the RTC and various other things.
+ *
+ * Copyright (C) 1998 Paul Mackerras.
+ */
+
+#ifndef _UAPI_LINUX_PMU_H
+#define _UAPI_LINUX_PMU_H
+
+#define PMU_DRIVER_VERSION     2
+
+/*
+ * PMU commands
+ */
+#define PMU_POWER_CTRL0                0x10    /* control power of some devices */
+#define PMU_POWER_CTRL         0x11    /* control power of some devices */
+#define PMU_ADB_CMD            0x20    /* send ADB packet */
+#define PMU_ADB_POLL_OFF       0x21    /* disable ADB auto-poll */
+#define PMU_WRITE_NVRAM                0x33    /* write non-volatile RAM */
+#define PMU_READ_NVRAM         0x3b    /* read non-volatile RAM */
+#define PMU_SET_RTC            0x30    /* set real-time clock */
+#define PMU_READ_RTC           0x38    /* read real-time clock */
+#define PMU_SET_VOLBUTTON      0x40    /* set volume up/down position */
+#define PMU_BACKLIGHT_BRIGHT   0x41    /* set backlight brightness */
+#define PMU_GET_VOLBUTTON      0x48    /* get volume up/down position */
+#define PMU_PCEJECT            0x4c    /* eject PC-card from slot */
+#define PMU_BATTERY_STATE      0x6b    /* report battery state etc. */
+#define PMU_SMART_BATTERY_STATE        0x6f    /* report battery state (new way) */
+#define PMU_SET_INTR_MASK      0x70    /* set PMU interrupt mask */
+#define PMU_INT_ACK            0x78    /* read interrupt bits */
+#define PMU_SHUTDOWN           0x7e    /* turn power off */
+#define PMU_CPU_SPEED          0x7d    /* control CPU speed on some models */
+#define PMU_SLEEP              0x7f    /* put CPU to sleep */
+#define PMU_POWER_EVENTS       0x8f    /* Send power-event commands to PMU */
+#define PMU_I2C_CMD            0x9a    /* I2C operations */
+#define PMU_RESET              0xd0    /* reset CPU */
+#define PMU_GET_BRIGHTBUTTON   0xd9    /* report brightness up/down pos */
+#define PMU_GET_COVER          0xdc    /* report cover open/closed */
+#define PMU_SYSTEM_READY       0xdf    /* tell PMU we are awake */
+#define PMU_GET_VERSION                0xea    /* read the PMU version */
+
+/* Bits to use with the PMU_POWER_CTRL0 command */
+#define PMU_POW0_ON            0x80    /* OR this to power ON the device */
+#define PMU_POW0_OFF           0x00    /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW0_HARD_DRIVE    0x04    /* Hard drive power (on wallstreet/lombard ?) */
+
+/* Bits to use with the PMU_POWER_CTRL command */
+#define PMU_POW_ON             0x80    /* OR this to power ON the device */
+#define PMU_POW_OFF            0x00    /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW_BACKLIGHT      0x01    /* backlight power */
+#define PMU_POW_CHARGER                0x02    /* battery charger power */
+#define PMU_POW_IRLED          0x04    /* IR led power (on wallstreet) */
+#define PMU_POW_MEDIABAY       0x08    /* media bay power (wallstreet/lombard ?) */
+
+/* Bits in PMU interrupt and interrupt mask bytes */
+#define PMU_INT_PCEJECT                0x04    /* PC-card eject buttons */
+#define PMU_INT_SNDBRT         0x08    /* sound/brightness up/down buttons */
+#define PMU_INT_ADB            0x10    /* ADB autopoll or reply data */
+#define PMU_INT_BATTERY                0x20    /* Battery state change */
+#define PMU_INT_ENVIRONMENT    0x40    /* Environment interrupts */
+#define PMU_INT_TICK           0x80    /* 1-second tick interrupt */
+
+/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
+#define PMU_INT_ADB_AUTO       0x04    /* ADB autopoll, when PMU_INT_ADB */
+#define PMU_INT_WAITING_CHARGER        0x01    /* ??? */
+#define PMU_INT_AUTO_SRQ_POLL  0x02    /* ??? */
+
+/* Bits in the environement message (either obtained via PMU_GET_COVER,
+ * or via PMU_INT_ENVIRONMENT on core99 */
+#define PMU_ENV_LID_CLOSED     0x01    /* The lid is closed */
+
+/* I2C related definitions */
+#define PMU_I2C_MODE_SIMPLE    0
+#define PMU_I2C_MODE_STDSUB    1
+#define PMU_I2C_MODE_COMBINED  2
+
+#define PMU_I2C_BUS_STATUS     0
+#define PMU_I2C_BUS_SYSCLK     1
+#define PMU_I2C_BUS_POWER      2
+
+#define PMU_I2C_STATUS_OK      0
+#define PMU_I2C_STATUS_DATAREAD        1
+#define PMU_I2C_STATUS_BUSY    0xfe
+
+
+/* Kind of PMU (model) */
+enum {
+       PMU_UNKNOWN,
+       PMU_OHARE_BASED,        /* 2400, 3400, 3500 (old G3 powerbook) */
+       PMU_HEATHROW_BASED,     /* PowerBook G3 series */
+       PMU_PADDINGTON_BASED,   /* 1999 PowerBook G3 */
+       PMU_KEYLARGO_BASED,     /* Core99 motherboard (PMU99) */
+       PMU_68K_V1,             /* 68K PMU, version 1 */
+       PMU_68K_V2,             /* 68K PMU, version 2 */
+};
+
+/* PMU PMU_POWER_EVENTS commands */
+enum {
+       PMU_PWR_GET_POWERUP_EVENTS      = 0x00,
+       PMU_PWR_SET_POWERUP_EVENTS      = 0x01,
+       PMU_PWR_CLR_POWERUP_EVENTS      = 0x02,
+       PMU_PWR_GET_WAKEUP_EVENTS       = 0x03,
+       PMU_PWR_SET_WAKEUP_EVENTS       = 0x04,
+       PMU_PWR_CLR_WAKEUP_EVENTS       = 0x05,
+};
+
+/* Power events wakeup bits */
+enum {
+       PMU_PWR_WAKEUP_KEY              = 0x01, /* Wake on key press */
+       PMU_PWR_WAKEUP_AC_INSERT        = 0x02, /* Wake on AC adapter plug */
+       PMU_PWR_WAKEUP_AC_CHANGE        = 0x04,
+       PMU_PWR_WAKEUP_LID_OPEN         = 0x08,
+       PMU_PWR_WAKEUP_RING             = 0x10,
+};
+       
+/*
+ * Ioctl commands for the /dev/pmu device
+ */
+#include <linux/ioctl.h>
+
+/* no param */
+#define PMU_IOC_SLEEP          _IO('B', 0)
+/* out param: u32*     backlight value: 0 to 15 */
+#define PMU_IOC_GET_BACKLIGHT  _IOR('B', 1, size_t)
+/* in param: u32       backlight value: 0 to 15 */
+#define PMU_IOC_SET_BACKLIGHT  _IOW('B', 2, size_t)
+/* out param: u32*     PMU model */
+#define PMU_IOC_GET_MODEL      _IOR('B', 3, size_t)
+/* out param: u32*     has_adb: 0 or 1 */
+#define PMU_IOC_HAS_ADB                _IOR('B', 4, size_t) 
+/* out param: u32*     can_sleep: 0 or 1 */
+#define PMU_IOC_CAN_SLEEP      _IOR('B', 5, size_t) 
+/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
+#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t) 
+
+
+#endif /* _UAPI_LINUX_PMU_H */
diff --git a/include/uapi/linux/poll.h b/include/uapi/linux/poll.h
new file mode 100644 (file)
index 0000000..2001fed
--- /dev/null
@@ -0,0 +1 @@
+#include <asm/poll.h>
diff --git a/include/uapi/linux/ppp-comp.h b/include/uapi/linux/ppp-comp.h
new file mode 100644 (file)
index 0000000..0a15bbb
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * ppp-comp.h - Definitions for doing PPP packet compression.
+ *
+ * Copyright 1994-1998 Paul Mackerras.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  version 2 as published by the Free Software Foundation.
+ */
+#ifndef _UAPI_NET_PPP_COMP_H
+#define _UAPI_NET_PPP_COMP_H
+
+
+/*
+ * CCP codes.
+ */
+
+#define CCP_CONFREQ    1
+#define CCP_CONFACK    2
+#define CCP_TERMREQ    5
+#define CCP_TERMACK    6
+#define CCP_RESETREQ   14
+#define CCP_RESETACK   15
+
+/*
+ * Max # bytes for a CCP option
+ */
+
+#define CCP_MAX_OPTION_LENGTH  32
+
+/*
+ * Parts of a CCP packet.
+ */
+
+#define CCP_CODE(dp)           ((dp)[0])
+#define CCP_ID(dp)             ((dp)[1])
+#define CCP_LENGTH(dp)         (((dp)[2] << 8) + (dp)[3])
+#define CCP_HDRLEN             4
+
+#define CCP_OPT_CODE(dp)       ((dp)[0])
+#define CCP_OPT_LENGTH(dp)     ((dp)[1])
+#define CCP_OPT_MINLEN         2
+
+/*
+ * Definitions for BSD-Compress.
+ */
+
+#define CI_BSD_COMPRESS                21      /* config. option for BSD-Compress */
+#define CILEN_BSD_COMPRESS     3       /* length of config. option */
+
+/* Macros for handling the 3rd byte of the BSD-Compress config option. */
+#define BSD_NBITS(x)           ((x) & 0x1F)    /* number of bits requested */
+#define BSD_VERSION(x)         ((x) >> 5)      /* version of option format */
+#define BSD_CURRENT_VERSION    1               /* current version number */
+#define BSD_MAKE_OPT(v, n)     (((v) << 5) | (n))
+
+#define BSD_MIN_BITS           9       /* smallest code size supported */
+#define BSD_MAX_BITS           15      /* largest code size supported */
+
+/*
+ * Definitions for Deflate.
+ */
+
+#define CI_DEFLATE             26      /* config option for Deflate */
+#define CI_DEFLATE_DRAFT       24      /* value used in original draft RFC */
+#define CILEN_DEFLATE          4       /* length of its config option */
+
+#define DEFLATE_MIN_SIZE       9
+#define DEFLATE_MAX_SIZE       15
+#define DEFLATE_METHOD_VAL     8
+#define DEFLATE_SIZE(x)                (((x) >> 4) + 8)
+#define DEFLATE_METHOD(x)      ((x) & 0x0F)
+#define DEFLATE_MAKE_OPT(w)    ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
+#define DEFLATE_CHK_SEQUENCE   0
+
+/*
+ * Definitions for MPPE.
+ */
+
+#define CI_MPPE                18      /* config option for MPPE */
+#define CILEN_MPPE              6      /* length of config option */
+
+/*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+
+#define CI_PREDICTOR_1         1       /* config option for Predictor-1 */
+#define CILEN_PREDICTOR_1      2       /* length of its config option */
+#define CI_PREDICTOR_2         2       /* config option for Predictor-2 */
+#define CILEN_PREDICTOR_2      2       /* length of its config option */
+
+
+#endif /* _UAPI_NET_PPP_COMP_H */
diff --git a/include/uapi/linux/ppp_defs.h b/include/uapi/linux/ppp_defs.h
new file mode 100644 (file)
index 0000000..283fc05
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * ppp_defs.h - PPP definitions.
+ *
+ * Copyright 1994-2000 Paul Mackerras.
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  version 2 as published by the Free Software Foundation.
+ */
+#include <linux/types.h>
+
+#ifndef _UAPI_PPP_DEFS_H_
+#define _UAPI_PPP_DEFS_H_
+
+/*
+ * The basic PPP frame.
+ */
+#define PPP_HDRLEN     4       /* octets for standard ppp header */
+#define PPP_FCSLEN     2       /* octets for FCS */
+#define PPP_MRU                1500    /* default MRU = max length of info field */
+
+#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
+#define PPP_CONTROL(p) (((__u8 *)(p))[1])
+#define PPP_PROTOCOL(p)        ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
+
+/*
+ * Significant octet values.
+ */
+#define        PPP_ALLSTATIONS 0xff    /* All-Stations broadcast address */
+#define        PPP_UI          0x03    /* Unnumbered Information */
+#define        PPP_FLAG        0x7e    /* Flag Sequence */
+#define        PPP_ESCAPE      0x7d    /* Asynchronous Control Escape */
+#define        PPP_TRANS       0x20    /* Asynchronous transparency modifier */
+
+/*
+ * Protocol field values.
+ */
+#define PPP_IP         0x21    /* Internet Protocol */
+#define PPP_AT         0x29    /* AppleTalk Protocol */
+#define PPP_IPX                0x2b    /* IPX protocol */
+#define        PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
+#define        PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
+#define PPP_MP         0x3d    /* Multilink protocol */
+#define PPP_IPV6       0x57    /* Internet Protocol Version 6 */
+#define PPP_COMPFRAG   0xfb    /* fragment compressed below bundle */
+#define PPP_COMP       0xfd    /* compressed packet */
+#define PPP_MPLS_UC    0x0281  /* Multi Protocol Label Switching - Unicast */
+#define PPP_MPLS_MC    0x0283  /* Multi Protocol Label Switching - Multicast */
+#define PPP_IPCP       0x8021  /* IP Control Protocol */
+#define PPP_ATCP       0x8029  /* AppleTalk Control Protocol */
+#define PPP_IPXCP      0x802b  /* IPX Control Protocol */
+#define PPP_IPV6CP     0x8057  /* IPv6 Control Protocol */
+#define PPP_CCPFRAG    0x80fb  /* CCP at link level (below MP bundle) */
+#define PPP_CCP                0x80fd  /* Compression Control Protocol */
+#define PPP_MPLSCP     0x80fd  /* MPLS Control Protocol */
+#define PPP_LCP                0xc021  /* Link Control Protocol */
+#define PPP_PAP                0xc023  /* Password Authentication Protocol */
+#define PPP_LQR                0xc025  /* Link Quality Report protocol */
+#define PPP_CHAP       0xc223  /* Cryptographic Handshake Auth. Protocol */
+#define PPP_CBCP       0xc029  /* Callback Control Protocol */
+
+/*
+ * Values for FCS calculations.
+ */
+
+#define PPP_INITFCS    0xffff  /* Initial FCS value */
+#define PPP_GOODFCS    0xf0b8  /* Good final FCS value */
+
+
+/*
+ * Extended asyncmap - allows any character to be escaped.
+ */
+
+typedef __u32          ext_accm[8];
+
+/*
+ * What to do with network protocol (NP) packets.
+ */
+enum NPmode {
+    NPMODE_PASS,               /* pass the packet through */
+    NPMODE_DROP,               /* silently drop the packet */
+    NPMODE_ERROR,              /* return an error */
+    NPMODE_QUEUE               /* save it up for later. */
+};
+
+/*
+ * Statistics for LQRP and pppstats
+ */
+struct pppstat {
+    __u32      ppp_discards;   /* # frames discarded */
+
+    __u32      ppp_ibytes;     /* bytes received */
+    __u32      ppp_ioctects;   /* bytes received not in error */
+    __u32      ppp_ipackets;   /* packets received */
+    __u32      ppp_ierrors;    /* receive errors */
+    __u32      ppp_ilqrs;      /* # LQR frames received */
+
+    __u32      ppp_obytes;     /* raw bytes sent */
+    __u32      ppp_ooctects;   /* frame bytes sent */
+    __u32      ppp_opackets;   /* packets sent */
+    __u32      ppp_oerrors;    /* transmit errors */ 
+    __u32      ppp_olqrs;      /* # LQR frames sent */
+};
+
+struct vjstat {
+    __u32      vjs_packets;    /* outbound packets */
+    __u32      vjs_compressed; /* outbound compressed packets */
+    __u32      vjs_searches;   /* searches for connection state */
+    __u32      vjs_misses;     /* times couldn't find conn. state */
+    __u32      vjs_uncompressedin; /* inbound uncompressed packets */
+    __u32      vjs_compressedin;   /* inbound compressed packets */
+    __u32      vjs_errorin;    /* inbound unknown type packets */
+    __u32      vjs_tossed;     /* inbound packets tossed because of error */
+};
+
+struct compstat {
+    __u32      unc_bytes;      /* total uncompressed bytes */
+    __u32      unc_packets;    /* total uncompressed packets */
+    __u32      comp_bytes;     /* compressed bytes */
+    __u32      comp_packets;   /* compressed packets */
+    __u32      inc_bytes;      /* incompressible bytes */
+    __u32      inc_packets;    /* incompressible packets */
+
+    /* the compression ratio is defined as in_count / bytes_out */
+    __u32       in_count;      /* Bytes received */
+    __u32       bytes_out;     /* Bytes transmitted */
+
+    double     ratio;          /* not computed in kernel. */
+};
+
+struct ppp_stats {
+    struct pppstat     p;      /* basic PPP statistics */
+    struct vjstat      vj;     /* VJ header compression statistics */
+};
+
+struct ppp_comp_stats {
+    struct compstat    c;      /* packet compression statistics */
+    struct compstat    d;      /* packet decompression statistics */
+};
+
+/*
+ * The following structure records the time in seconds since
+ * the last NP packet was sent or received.
+ */
+struct ppp_idle {
+    __kernel_time_t xmit_idle; /* time since last NP packet sent */
+    __kernel_time_t recv_idle; /* time since last NP packet received */
+};
+
+#endif /* _UAPI_PPP_DEFS_H_ */
similarity index 100%
rename from include/linux/pps.h
rename to include/uapi/linux/pps.h
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
new file mode 100644 (file)
index 0000000..1ef6c05
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef _UAPI_LINUX_PTRACE_H
+#define _UAPI_LINUX_PTRACE_H
+/* ptrace.h */
+/* structs and defines to help the user use the ptrace system call. */
+
+/* has the defines to get at the registers. */
+
+
+#define PTRACE_TRACEME            0
+#define PTRACE_PEEKTEXT                   1
+#define PTRACE_PEEKDATA                   2
+#define PTRACE_PEEKUSR            3
+#define PTRACE_POKETEXT                   4
+#define PTRACE_POKEDATA                   5
+#define PTRACE_POKEUSR            6
+#define PTRACE_CONT               7
+#define PTRACE_KILL               8
+#define PTRACE_SINGLESTEP         9
+
+#define PTRACE_ATTACH            16
+#define PTRACE_DETACH            17
+
+#define PTRACE_SYSCALL           24
+
+/* 0x4200-0x4300 are reserved for architecture-independent additions.  */
+#define PTRACE_SETOPTIONS      0x4200
+#define PTRACE_GETEVENTMSG     0x4201
+#define PTRACE_GETSIGINFO      0x4202
+#define PTRACE_SETSIGINFO      0x4203
+
+/*
+ * Generic ptrace interface that exports the architecture specific regsets
+ * using the corresponding NT_* types (which are also used in the core dump).
+ * Please note that the NT_PRSTATUS note type in a core dump contains a full
+ * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
+ * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
+ * other user_regset flavors, the user_regset layout and the ELF core dump note
+ * payload are exactly the same layout.
+ *
+ * This interface usage is as follows:
+ *     struct iovec iov = { buf, len};
+ *
+ *     ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
+ *
+ * On the successful completion, iov.len will be updated by the kernel,
+ * specifying how much the kernel has written/read to/from the user's iov.buf.
+ */
+#define PTRACE_GETREGSET       0x4204
+#define PTRACE_SETREGSET       0x4205
+
+#define PTRACE_SEIZE           0x4206
+#define PTRACE_INTERRUPT       0x4207
+#define PTRACE_LISTEN          0x4208
+
+/* Wait extended result codes for the above trace options.  */
+#define PTRACE_EVENT_FORK      1
+#define PTRACE_EVENT_VFORK     2
+#define PTRACE_EVENT_CLONE     3
+#define PTRACE_EVENT_EXEC      4
+#define PTRACE_EVENT_VFORK_DONE        5
+#define PTRACE_EVENT_EXIT      6
+#define PTRACE_EVENT_SECCOMP   7
+/* Extended result codes which enabled by means other than options.  */
+#define PTRACE_EVENT_STOP      128
+
+/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
+#define PTRACE_O_TRACESYSGOOD  1
+#define PTRACE_O_TRACEFORK     (1 << PTRACE_EVENT_FORK)
+#define PTRACE_O_TRACEVFORK    (1 << PTRACE_EVENT_VFORK)
+#define PTRACE_O_TRACECLONE    (1 << PTRACE_EVENT_CLONE)
+#define PTRACE_O_TRACEEXEC     (1 << PTRACE_EVENT_EXEC)
+#define PTRACE_O_TRACEVFORKDONE        (1 << PTRACE_EVENT_VFORK_DONE)
+#define PTRACE_O_TRACEEXIT     (1 << PTRACE_EVENT_EXIT)
+#define PTRACE_O_TRACESECCOMP  (1 << PTRACE_EVENT_SECCOMP)
+
+#define PTRACE_O_MASK          0x000000ff
+
+#include <asm/ptrace.h>
+
+
+#endif /* _UAPI_LINUX_PTRACE_H */
diff --git a/include/uapi/linux/quota.h b/include/uapi/linux/quota.h
new file mode 100644 (file)
index 0000000..3b6cfbe
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _UAPI_LINUX_QUOTA_
+#define _UAPI_LINUX_QUOTA_
+
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#define __DQUOT_VERSION__      "dquot_6.5.2"
+
+#define MAXQUOTAS 2
+#define USRQUOTA  0            /* element used for user quotas */
+#define GRPQUOTA  1            /* element used for group quotas */
+
+/*
+ * Definitions for the default names of the quotas files.
+ */
+#define INITQFNAMES { \
+       "user",    /* USRQUOTA */ \
+       "group",   /* GRPQUOTA */ \
+       "undefined", \
+};
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK  0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_SYNC     0x800001    /* sync disk copy of a filesystems quotas */
+#define Q_QUOTAON  0x800002    /* turn quotas on */
+#define Q_QUOTAOFF 0x800003    /* turn quotas off */
+#define Q_GETFMT   0x800004    /* get quota format used on given filesystem */
+#define Q_GETINFO  0x800005    /* get information about quota files */
+#define Q_SETINFO  0x800006    /* set information about quota files */
+#define Q_GETQUOTA 0x800007    /* get user quota structure */
+#define Q_SETQUOTA 0x800008    /* set user quota structure */
+
+/* Quota format type IDs */
+#define        QFMT_VFS_OLD 1
+#define        QFMT_VFS_V0 2
+#define QFMT_OCFS2 3
+#define        QFMT_VFS_V1 4
+
+/* Size of block in which space limits are passed through the quota
+ * interface */
+#define QIF_DQBLKSIZE_BITS 10
+#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS)
+
+/*
+ * Quota structure used for communication with userspace via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+enum {
+       QIF_BLIMITS_B = 0,
+       QIF_SPACE_B,
+       QIF_ILIMITS_B,
+       QIF_INODES_B,
+       QIF_BTIME_B,
+       QIF_ITIME_B,
+};
+
+#define QIF_BLIMITS    (1 << QIF_BLIMITS_B)
+#define QIF_SPACE      (1 << QIF_SPACE_B)
+#define QIF_ILIMITS    (1 << QIF_ILIMITS_B)
+#define QIF_INODES     (1 << QIF_INODES_B)
+#define QIF_BTIME      (1 << QIF_BTIME_B)
+#define QIF_ITIME      (1 << QIF_ITIME_B)
+#define QIF_LIMITS     (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE      (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES      (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL                (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct if_dqblk {
+       __u64 dqb_bhardlimit;
+       __u64 dqb_bsoftlimit;
+       __u64 dqb_curspace;
+       __u64 dqb_ihardlimit;
+       __u64 dqb_isoftlimit;
+       __u64 dqb_curinodes;
+       __u64 dqb_btime;
+       __u64 dqb_itime;
+       __u32 dqb_valid;
+};
+
+/*
+ * Structure used for setting quota information about file via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define IIF_BGRACE     1
+#define IIF_IGRACE     2
+#define IIF_FLAGS      4
+#define IIF_ALL                (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct if_dqinfo {
+       __u64 dqi_bgrace;
+       __u64 dqi_igrace;
+       __u32 dqi_flags;
+       __u32 dqi_valid;
+};
+
+/*
+ * Definitions for quota netlink interface
+ */
+#define QUOTA_NL_NOWARN 0
+#define QUOTA_NL_IHARDWARN 1           /* Inode hardlimit reached */
+#define QUOTA_NL_ISOFTLONGWARN 2       /* Inode grace time expired */
+#define QUOTA_NL_ISOFTWARN 3           /* Inode softlimit reached */
+#define QUOTA_NL_BHARDWARN 4           /* Block hardlimit reached */
+#define QUOTA_NL_BSOFTLONGWARN 5       /* Block grace time expired */
+#define QUOTA_NL_BSOFTWARN 6           /* Block softlimit reached */
+#define QUOTA_NL_IHARDBELOW 7          /* Usage got below inode hardlimit */
+#define QUOTA_NL_ISOFTBELOW 8          /* Usage got below inode softlimit */
+#define QUOTA_NL_BHARDBELOW 9          /* Usage got below block hardlimit */
+#define QUOTA_NL_BSOFTBELOW 10         /* Usage got below block softlimit */
+
+enum {
+       QUOTA_NL_C_UNSPEC,
+       QUOTA_NL_C_WARNING,
+       __QUOTA_NL_C_MAX,
+};
+#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
+
+enum {
+       QUOTA_NL_A_UNSPEC,
+       QUOTA_NL_A_QTYPE,
+       QUOTA_NL_A_EXCESS_ID,
+       QUOTA_NL_A_WARNING,
+       QUOTA_NL_A_DEV_MAJOR,
+       QUOTA_NL_A_DEV_MINOR,
+       QUOTA_NL_A_CAUSED_ID,
+       __QUOTA_NL_A_MAX,
+};
+#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
+
+
+#endif /* _UAPI_LINUX_QUOTA_ */
diff --git a/include/uapi/linux/random.h b/include/uapi/linux/random.h
new file mode 100644 (file)
index 0000000..7471b5b
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * include/linux/random.h
+ *
+ * Include file for the random number generator.
+ */
+
+#ifndef _UAPI_LINUX_RANDOM_H
+#define _UAPI_LINUX_RANDOM_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/irqnr.h>
+
+/* ioctl()'s for the random number generator */
+
+/* Get the entropy count. */
+#define RNDGETENTCNT   _IOR( 'R', 0x00, int )
+
+/* Add to (or subtract from) the entropy count.  (Superuser only.) */
+#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
+
+/* Get the contents of the entropy pool.  (Superuser only.) */
+#define RNDGETPOOL     _IOR( 'R', 0x02, int [2] )
+
+/* 
+ * Write bytes into the entropy pool and add to the entropy count.
+ * (Superuser only.)
+ */
+#define RNDADDENTROPY  _IOW( 'R', 0x03, int [2] )
+
+/* Clear entropy count to 0.  (Superuser only.) */
+#define RNDZAPENTCNT   _IO( 'R', 0x04 )
+
+/* Clear the entropy pool and associated counters.  (Superuser only.) */
+#define RNDCLEARPOOL   _IO( 'R', 0x06 )
+
+struct rand_pool_info {
+       int     entropy_count;
+       int     buf_size;
+       __u32   buf[0];
+};
+
+struct rnd_state {
+       __u32 s1, s2, s3;
+};
+
+/* Exported functions */
+
+
+#endif /* _UAPI_LINUX_RANDOM_H */
similarity index 100%
rename from include/linux/raw.h
rename to include/uapi/linux/raw.h
similarity index 100%
rename from include/linux/rds.h
rename to include/uapi/linux/rds.h
diff --git a/include/uapi/linux/reboot.h b/include/uapi/linux/reboot.h
new file mode 100644 (file)
index 0000000..09d056d
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef _UAPI_LINUX_REBOOT_H
+#define _UAPI_LINUX_REBOOT_H
+
+/*
+ * Magic values required to use _reboot() system call.
+ */
+
+#define        LINUX_REBOOT_MAGIC1     0xfee1dead
+#define        LINUX_REBOOT_MAGIC2     672274793
+#define        LINUX_REBOOT_MAGIC2A    85072278
+#define        LINUX_REBOOT_MAGIC2B    369367448
+#define        LINUX_REBOOT_MAGIC2C    537993216
+
+
+/*
+ * Commands accepted by the _reboot() system call.
+ *
+ * RESTART     Restart system using default command and mode.
+ * HALT        Stop OS and give system control to ROM monitor, if any.
+ * CAD_ON      Ctrl-Alt-Del sequence causes RESTART command.
+ * CAD_OFF     Ctrl-Alt-Del sequence sends SIGINT to init task.
+ * POWER_OFF   Stop OS and remove all power from system, if possible.
+ * RESTART2    Restart system using given command string.
+ * SW_SUSPEND  Suspend system using software suspend if compiled in.
+ * KEXEC       Restart system using a previously loaded Linux kernel
+ */
+
+#define        LINUX_REBOOT_CMD_RESTART        0x01234567
+#define        LINUX_REBOOT_CMD_HALT           0xCDEF0123
+#define        LINUX_REBOOT_CMD_CAD_ON         0x89ABCDEF
+#define        LINUX_REBOOT_CMD_CAD_OFF        0x00000000
+#define        LINUX_REBOOT_CMD_POWER_OFF      0x4321FEDC
+#define        LINUX_REBOOT_CMD_RESTART2       0xA1B2C3D4
+#define        LINUX_REBOOT_CMD_SW_SUSPEND     0xD000FCE2
+#define        LINUX_REBOOT_CMD_KEXEC          0x45584543
+
+
+
+#endif /* _UAPI_LINUX_REBOOT_H */
diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
new file mode 100644 (file)
index 0000000..e0ed284
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef _UAPI_LINUX_RESOURCE_H
+#define _UAPI_LINUX_RESOURCE_H
+
+#include <linux/time.h>
+#include <linux/types.h>
+
+/*
+ * Resource control/accounting header file for linux
+ */
+
+/*
+ * Definition of struct rusage taken from BSD 4.3 Reno
+ * 
+ * We don't support all of these yet, but we might as well have them....
+ * Otherwise, each time we add new items, programs which depend on this
+ * structure will lose.  This reduces the chances of that happening.
+ */
+#define        RUSAGE_SELF     0
+#define        RUSAGE_CHILDREN (-1)
+#define RUSAGE_BOTH    (-2)            /* sys_wait4() uses this */
+#define        RUSAGE_THREAD   1               /* only the calling thread */
+
+struct rusage {
+       struct timeval ru_utime;        /* user time used */
+       struct timeval ru_stime;        /* system time used */
+       long    ru_maxrss;              /* maximum resident set size */
+       long    ru_ixrss;               /* integral shared memory size */
+       long    ru_idrss;               /* integral unshared data size */
+       long    ru_isrss;               /* integral unshared stack size */
+       long    ru_minflt;              /* page reclaims */
+       long    ru_majflt;              /* page faults */
+       long    ru_nswap;               /* swaps */
+       long    ru_inblock;             /* block input operations */
+       long    ru_oublock;             /* block output operations */
+       long    ru_msgsnd;              /* messages sent */
+       long    ru_msgrcv;              /* messages received */
+       long    ru_nsignals;            /* signals received */
+       long    ru_nvcsw;               /* voluntary context switches */
+       long    ru_nivcsw;              /* involuntary " */
+};
+
+struct rlimit {
+       unsigned long   rlim_cur;
+       unsigned long   rlim_max;
+};
+
+#define RLIM64_INFINITY                (~0ULL)
+
+struct rlimit64 {
+       __u64 rlim_cur;
+       __u64 rlim_max;
+};
+
+#define        PRIO_MIN        (-20)
+#define        PRIO_MAX        20
+
+#define        PRIO_PROCESS    0
+#define        PRIO_PGRP       1
+#define        PRIO_USER       2
+
+/*
+ * Limit the stack by to some sane default: root can always
+ * increase this limit if needed..  8MB seems reasonable.
+ */
+#define _STK_LIM       (8*1024*1024)
+
+/*
+ * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
+ * and other sensitive information are never written to disk.
+ */
+#define MLOCK_LIMIT    ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
+
+/*
+ * Due to binary compatibility, the actual resource numbers
+ * may be different for different linux versions..
+ */
+#include <asm/resource.h>
+
+
+#endif /* _UAPI_LINUX_RESOURCE_H */
diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h
new file mode 100644 (file)
index 0000000..2753c6c
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2006 - 2007 Ivo van Doorn
+ * Copyright (C) 2007 Dmitry Torokhov
+ * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef _UAPI__RFKILL_H
+#define _UAPI__RFKILL_H
+
+
+#include <linux/types.h>
+
+/* define userspace visible states */
+#define RFKILL_STATE_SOFT_BLOCKED      0
+#define RFKILL_STATE_UNBLOCKED         1
+#define RFKILL_STATE_HARD_BLOCKED      2
+
+/**
+ * enum rfkill_type - type of rfkill switch.
+ *
+ * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
+ * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
+ * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
+ * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
+ * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
+ * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
+ * @RFKILL_TYPE_GPS: switch is on a GPS device.
+ * @RFKILL_TYPE_FM: switch is on a FM radio device.
+ * @NUM_RFKILL_TYPES: number of defined rfkill types
+ */
+enum rfkill_type {
+       RFKILL_TYPE_ALL = 0,
+       RFKILL_TYPE_WLAN,
+       RFKILL_TYPE_BLUETOOTH,
+       RFKILL_TYPE_UWB,
+       RFKILL_TYPE_WIMAX,
+       RFKILL_TYPE_WWAN,
+       RFKILL_TYPE_GPS,
+       RFKILL_TYPE_FM,
+       NUM_RFKILL_TYPES,
+};
+
+/**
+ * enum rfkill_operation - operation types
+ * @RFKILL_OP_ADD: a device was added
+ * @RFKILL_OP_DEL: a device was removed
+ * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
+ * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
+ */
+enum rfkill_operation {
+       RFKILL_OP_ADD = 0,
+       RFKILL_OP_DEL,
+       RFKILL_OP_CHANGE,
+       RFKILL_OP_CHANGE_ALL,
+};
+
+/**
+ * struct rfkill_event - events for userspace on /dev/rfkill
+ * @idx: index of dev rfkill
+ * @type: type of the rfkill struct
+ * @op: operation code
+ * @hard: hard state (0/1)
+ * @soft: soft state (0/1)
+ *
+ * Structure used for userspace communication on /dev/rfkill,
+ * used for events from the kernel and control to the kernel.
+ */
+struct rfkill_event {
+       __u32 idx;
+       __u8  type;
+       __u8  op;
+       __u8  soft, hard;
+} __attribute__((packed));
+
+/*
+ * We are planning to be backward and forward compatible with changes
+ * to the event struct, by adding new, optional, members at the end.
+ * When reading an event (whether the kernel from userspace or vice
+ * versa) we need to accept anything that's at least as large as the
+ * version 1 event size, but might be able to accept other sizes in
+ * the future.
+ *
+ * One exception is the kernel -- we already have two event sizes in
+ * that we've made the 'hard' member optional since our only option
+ * is to ignore it anyway.
+ */
+#define RFKILL_EVENT_SIZE_V1   8
+
+/* ioctl for turning off rfkill-input (if present) */
+#define RFKILL_IOC_MAGIC       'R'
+#define RFKILL_IOC_NOINPUT     1
+#define RFKILL_IOCTL_NOINPUT   _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
+
+/* and that's all userspace gets */
+
+#endif /* _UAPI__RFKILL_H */
diff --git a/include/uapi/linux/rtc.h b/include/uapi/linux/rtc.h
new file mode 100644 (file)
index 0000000..f8c82e6
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Generic RTC interface.
+ * This version contains the part of the user interface to the Real Time Clock
+ * service. It is used with both the legacy mc146818 and also  EFI
+ * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
+ * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
+ *
+ * Copyright (C) 1999 Hewlett-Packard Co.
+ * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
+ */
+#ifndef _UAPI_LINUX_RTC_H_
+#define _UAPI_LINUX_RTC_H_
+
+/*
+ * The struct used to pass data via the following ioctl. Similar to the
+ * struct tm in <time.h>, but it needs to be here so that the kernel
+ * source is self contained, allowing cross-compiles, etc. etc.
+ */
+
+struct rtc_time {
+       int tm_sec;
+       int tm_min;
+       int tm_hour;
+       int tm_mday;
+       int tm_mon;
+       int tm_year;
+       int tm_wday;
+       int tm_yday;
+       int tm_isdst;
+};
+
+/*
+ * This data structure is inspired by the EFI (v0.92) wakeup
+ * alarm API.
+ */
+struct rtc_wkalrm {
+       unsigned char enabled;  /* 0 = alarm disabled, 1 = alarm enabled */
+       unsigned char pending;  /* 0 = alarm not pending, 1 = alarm pending */
+       struct rtc_time time;   /* time the alarm is set to */
+};
+
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ *   pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ *   pll_value*pll_negmult/pll_clock
+ */
+
+struct rtc_pll_info {
+       int pll_ctrl;       /* placeholder for fancier control */
+       int pll_value;      /* get/set correction value */
+       int pll_max;        /* max +ve (faster) adjustment value */
+       int pll_min;        /* max -ve (slower) adjustment value */
+       int pll_posmult;    /* factor for +ve correction */
+       int pll_negmult;    /* factor for -ve correction */
+       long pll_clock;     /* base PLL frequency */
+};
+
+/*
+ * ioctl calls that are permitted to the /dev/rtc interface, if
+ * any of the RTC drivers are enabled.
+ */
+
+#define RTC_AIE_ON     _IO('p', 0x01)  /* Alarm int. enable on         */
+#define RTC_AIE_OFF    _IO('p', 0x02)  /* ... off                      */
+#define RTC_UIE_ON     _IO('p', 0x03)  /* Update int. enable on        */
+#define RTC_UIE_OFF    _IO('p', 0x04)  /* ... off                      */
+#define RTC_PIE_ON     _IO('p', 0x05)  /* Periodic int. enable on      */
+#define RTC_PIE_OFF    _IO('p', 0x06)  /* ... off                      */
+#define RTC_WIE_ON     _IO('p', 0x0f)  /* Watchdog int. enable on      */
+#define RTC_WIE_OFF    _IO('p', 0x10)  /* ... off                      */
+
+#define RTC_ALM_SET    _IOW('p', 0x07, struct rtc_time) /* Set alarm time  */
+#define RTC_ALM_READ   _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
+#define RTC_RD_TIME    _IOR('p', 0x09, struct rtc_time) /* Read RTC time   */
+#define RTC_SET_TIME   _IOW('p', 0x0a, struct rtc_time) /* Set RTC time    */
+#define RTC_IRQP_READ  _IOR('p', 0x0b, unsigned long)   /* Read IRQ rate   */
+#define RTC_IRQP_SET   _IOW('p', 0x0c, unsigned long)   /* Set IRQ rate    */
+#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long)   /* Read epoch      */
+#define RTC_EPOCH_SET  _IOW('p', 0x0e, unsigned long)   /* Set epoch       */
+
+#define RTC_WKALM_SET  _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
+#define RTC_WKALM_RD   _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
+
+#define RTC_PLL_GET    _IOR('p', 0x11, struct rtc_pll_info)  /* Get PLL correction */
+#define RTC_PLL_SET    _IOW('p', 0x12, struct rtc_pll_info)  /* Set PLL correction */
+
+#define RTC_VL_READ    _IOR('p', 0x13, int)    /* Voltage low detector */
+#define RTC_VL_CLR     _IO('p', 0x14)          /* Clear voltage low information */
+
+/* interrupt flags */
+#define RTC_IRQF 0x80  /* Any of the following is active */
+#define RTC_PF 0x40    /* Periodic interrupt */
+#define RTC_AF 0x20    /* Alarm interrupt */
+#define RTC_UF 0x10    /* Update interrupt for 1Hz RTC */
+
+
+#define RTC_MAX_FREQ   8192
+
+
+#endif /* _UAPI_LINUX_RTC_H_ */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
new file mode 100644 (file)
index 0000000..fcd768b
--- /dev/null
@@ -0,0 +1,612 @@
+#ifndef _UAPI__LINUX_RTNETLINK_H
+#define _UAPI__LINUX_RTNETLINK_H
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+#include <linux/if_link.h>
+#include <linux/if_addr.h>
+#include <linux/neighbour.h>
+
+/* rtnetlink families. Values up to 127 are reserved for real address
+ * families, values above 128 may be used arbitrarily.
+ */
+#define RTNL_FAMILY_IPMR               128
+#define RTNL_FAMILY_IP6MR              129
+#define RTNL_FAMILY_MAX                        129
+
+/****
+ *             Routing/neighbour discovery messages.
+ ****/
+
+/* Types of messages */
+
+enum {
+       RTM_BASE        = 16,
+#define RTM_BASE       RTM_BASE
+
+       RTM_NEWLINK     = 16,
+#define RTM_NEWLINK    RTM_NEWLINK
+       RTM_DELLINK,
+#define RTM_DELLINK    RTM_DELLINK
+       RTM_GETLINK,
+#define RTM_GETLINK    RTM_GETLINK
+       RTM_SETLINK,
+#define RTM_SETLINK    RTM_SETLINK
+
+       RTM_NEWADDR     = 20,
+#define RTM_NEWADDR    RTM_NEWADDR
+       RTM_DELADDR,
+#define RTM_DELADDR    RTM_DELADDR
+       RTM_GETADDR,
+#define RTM_GETADDR    RTM_GETADDR
+
+       RTM_NEWROUTE    = 24,
+#define RTM_NEWROUTE   RTM_NEWROUTE
+       RTM_DELROUTE,
+#define RTM_DELROUTE   RTM_DELROUTE
+       RTM_GETROUTE,
+#define RTM_GETROUTE   RTM_GETROUTE
+
+       RTM_NEWNEIGH    = 28,
+#define RTM_NEWNEIGH   RTM_NEWNEIGH
+       RTM_DELNEIGH,
+#define RTM_DELNEIGH   RTM_DELNEIGH
+       RTM_GETNEIGH,
+#define RTM_GETNEIGH   RTM_GETNEIGH
+
+       RTM_NEWRULE     = 32,
+#define RTM_NEWRULE    RTM_NEWRULE
+       RTM_DELRULE,
+#define RTM_DELRULE    RTM_DELRULE
+       RTM_GETRULE,
+#define RTM_GETRULE    RTM_GETRULE
+
+       RTM_NEWQDISC    = 36,
+#define RTM_NEWQDISC   RTM_NEWQDISC
+       RTM_DELQDISC,
+#define RTM_DELQDISC   RTM_DELQDISC
+       RTM_GETQDISC,
+#define RTM_GETQDISC   RTM_GETQDISC
+
+       RTM_NEWTCLASS   = 40,
+#define RTM_NEWTCLASS  RTM_NEWTCLASS
+       RTM_DELTCLASS,
+#define RTM_DELTCLASS  RTM_DELTCLASS
+       RTM_GETTCLASS,
+#define RTM_GETTCLASS  RTM_GETTCLASS
+
+       RTM_NEWTFILTER  = 44,
+#define RTM_NEWTFILTER RTM_NEWTFILTER
+       RTM_DELTFILTER,
+#define RTM_DELTFILTER RTM_DELTFILTER
+       RTM_GETTFILTER,
+#define RTM_GETTFILTER RTM_GETTFILTER
+
+       RTM_NEWACTION   = 48,
+#define RTM_NEWACTION   RTM_NEWACTION
+       RTM_DELACTION,
+#define RTM_DELACTION   RTM_DELACTION
+       RTM_GETACTION,
+#define RTM_GETACTION   RTM_GETACTION
+
+       RTM_NEWPREFIX   = 52,
+#define RTM_NEWPREFIX  RTM_NEWPREFIX
+
+       RTM_GETMULTICAST = 58,
+#define RTM_GETMULTICAST RTM_GETMULTICAST
+
+       RTM_GETANYCAST  = 62,
+#define RTM_GETANYCAST RTM_GETANYCAST
+
+       RTM_NEWNEIGHTBL = 64,
+#define RTM_NEWNEIGHTBL        RTM_NEWNEIGHTBL
+       RTM_GETNEIGHTBL = 66,
+#define RTM_GETNEIGHTBL        RTM_GETNEIGHTBL
+       RTM_SETNEIGHTBL,
+#define RTM_SETNEIGHTBL        RTM_SETNEIGHTBL
+
+       RTM_NEWNDUSEROPT = 68,
+#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
+
+       RTM_NEWADDRLABEL = 72,
+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
+       RTM_DELADDRLABEL,
+#define RTM_DELADDRLABEL RTM_DELADDRLABEL
+       RTM_GETADDRLABEL,
+#define RTM_GETADDRLABEL RTM_GETADDRLABEL
+
+       RTM_GETDCB = 78,
+#define RTM_GETDCB RTM_GETDCB
+       RTM_SETDCB,
+#define RTM_SETDCB RTM_SETDCB
+
+       __RTM_MAX,
+#define RTM_MAX                (((__RTM_MAX + 3) & ~3) - 1)
+};
+
+#define RTM_NR_MSGTYPES        (RTM_MAX + 1 - RTM_BASE)
+#define RTM_NR_FAMILIES        (RTM_NR_MSGTYPES >> 2)
+#define RTM_FAM(cmd)   (((cmd) - RTM_BASE) >> 2)
+
+/* 
+   Generic structure for encapsulation of optional route information.
+   It is reminiscent of sockaddr, but with sa_family replaced
+   with attribute type.
+ */
+
+struct rtattr {
+       unsigned short  rta_len;
+       unsigned short  rta_type;
+};
+
+/* Macros to handle rtattributes */
+
+#define RTA_ALIGNTO    4
+#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
+                        (rta)->rta_len >= sizeof(struct rtattr) && \
+                        (rta)->rta_len <= (len))
+#define RTA_NEXT(rta,attrlen)  ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
+                                (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
+#define RTA_LENGTH(len)        (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
+#define RTA_DATA(rta)   ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
+
+
+
+
+/******************************************************************************
+ *             Definitions used in routing table administration.
+ ****/
+
+struct rtmsg {
+       unsigned char           rtm_family;
+       unsigned char           rtm_dst_len;
+       unsigned char           rtm_src_len;
+       unsigned char           rtm_tos;
+
+       unsigned char           rtm_table;      /* Routing table id */
+       unsigned char           rtm_protocol;   /* Routing protocol; see below  */
+       unsigned char           rtm_scope;      /* See below */ 
+       unsigned char           rtm_type;       /* See below    */
+
+       unsigned                rtm_flags;
+};
+
+/* rtm_type */
+
+enum {
+       RTN_UNSPEC,
+       RTN_UNICAST,            /* Gateway or direct route      */
+       RTN_LOCAL,              /* Accept locally               */
+       RTN_BROADCAST,          /* Accept locally as broadcast,
+                                  send as broadcast */
+       RTN_ANYCAST,            /* Accept locally as broadcast,
+                                  but send as unicast */
+       RTN_MULTICAST,          /* Multicast route              */
+       RTN_BLACKHOLE,          /* Drop                         */
+       RTN_UNREACHABLE,        /* Destination is unreachable   */
+       RTN_PROHIBIT,           /* Administratively prohibited  */
+       RTN_THROW,              /* Not in this table            */
+       RTN_NAT,                /* Translate this address       */
+       RTN_XRESOLVE,           /* Use external resolver        */
+       __RTN_MAX
+};
+
+#define RTN_MAX (__RTN_MAX - 1)
+
+
+/* rtm_protocol */
+
+#define RTPROT_UNSPEC  0
+#define RTPROT_REDIRECT        1       /* Route installed by ICMP redirects;
+                                  not used by current IPv4 */
+#define RTPROT_KERNEL  2       /* Route installed by kernel            */
+#define RTPROT_BOOT    3       /* Route installed during boot          */
+#define RTPROT_STATIC  4       /* Route installed by administrator     */
+
+/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
+   they are just passed from user and back as is.
+   It will be used by hypothetical multiple routing daemons.
+   Note that protocol values should be standardized in order to
+   avoid conflicts.
+ */
+
+#define RTPROT_GATED   8       /* Apparently, GateD */
+#define RTPROT_RA      9       /* RDISC/ND router advertisements */
+#define RTPROT_MRT     10      /* Merit MRT */
+#define RTPROT_ZEBRA   11      /* Zebra */
+#define RTPROT_BIRD    12      /* BIRD */
+#define RTPROT_DNROUTED        13      /* DECnet routing daemon */
+#define RTPROT_XORP    14      /* XORP */
+#define RTPROT_NTK     15      /* Netsukuku */
+#define RTPROT_DHCP    16      /* DHCP client */
+
+/* rtm_scope
+
+   Really it is not scope, but sort of distance to the destination.
+   NOWHERE are reserved for not existing destinations, HOST is our
+   local addresses, LINK are destinations, located on directly attached
+   link and UNIVERSE is everywhere in the Universe.
+
+   Intermediate values are also possible f.e. interior routes
+   could be assigned a value between UNIVERSE and LINK.
+*/
+
+enum rt_scope_t {
+       RT_SCOPE_UNIVERSE=0,
+/* User defined values  */
+       RT_SCOPE_SITE=200,
+       RT_SCOPE_LINK=253,
+       RT_SCOPE_HOST=254,
+       RT_SCOPE_NOWHERE=255
+};
+
+/* rtm_flags */
+
+#define RTM_F_NOTIFY           0x100   /* Notify user of route change  */
+#define RTM_F_CLONED           0x200   /* This route is cloned         */
+#define RTM_F_EQUALIZE         0x400   /* Multipath equalizer: NI      */
+#define RTM_F_PREFIX           0x800   /* Prefix addresses             */
+
+/* Reserved table identifiers */
+
+enum rt_class_t {
+       RT_TABLE_UNSPEC=0,
+/* User defined values */
+       RT_TABLE_COMPAT=252,
+       RT_TABLE_DEFAULT=253,
+       RT_TABLE_MAIN=254,
+       RT_TABLE_LOCAL=255,
+       RT_TABLE_MAX=0xFFFFFFFF
+};
+
+
+/* Routing message attributes */
+
+enum rtattr_type_t {
+       RTA_UNSPEC,
+       RTA_DST,
+       RTA_SRC,
+       RTA_IIF,
+       RTA_OIF,
+       RTA_GATEWAY,
+       RTA_PRIORITY,
+       RTA_PREFSRC,
+       RTA_METRICS,
+       RTA_MULTIPATH,
+       RTA_PROTOINFO, /* no longer used */
+       RTA_FLOW,
+       RTA_CACHEINFO,
+       RTA_SESSION, /* no longer used */
+       RTA_MP_ALGO, /* no longer used */
+       RTA_TABLE,
+       RTA_MARK,
+       __RTA_MAX
+};
+
+#define RTA_MAX (__RTA_MAX - 1)
+
+#define RTM_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
+#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
+
+/* RTM_MULTIPATH --- array of struct rtnexthop.
+ *
+ * "struct rtnexthop" describes all necessary nexthop information,
+ * i.e. parameters of path to a destination via this nexthop.
+ *
+ * At the moment it is impossible to set different prefsrc, mtu, window
+ * and rtt for different paths from multipath.
+ */
+
+struct rtnexthop {
+       unsigned short          rtnh_len;
+       unsigned char           rtnh_flags;
+       unsigned char           rtnh_hops;
+       int                     rtnh_ifindex;
+};
+
+/* rtnh_flags */
+
+#define RTNH_F_DEAD            1       /* Nexthop is dead (used by multipath)  */
+#define RTNH_F_PERVASIVE       2       /* Do recursive gateway lookup  */
+#define RTNH_F_ONLINK          4       /* Gateway is forced on link    */
+
+/* Macros to handle hexthops */
+
+#define RTNH_ALIGNTO   4
+#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
+#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
+                          ((int)(rtnh)->rtnh_len) <= (len))
+#define RTNH_NEXT(rtnh)        ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
+#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
+#define RTNH_SPACE(len)        RTNH_ALIGN(RTNH_LENGTH(len))
+#define RTNH_DATA(rtnh)   ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+
+/* RTM_CACHEINFO */
+
+struct rta_cacheinfo {
+       __u32   rta_clntref;
+       __u32   rta_lastuse;
+       __s32   rta_expires;
+       __u32   rta_error;
+       __u32   rta_used;
+
+#define RTNETLINK_HAVE_PEERINFO 1
+       __u32   rta_id;
+       __u32   rta_ts;
+       __u32   rta_tsage;
+};
+
+/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
+
+enum {
+       RTAX_UNSPEC,
+#define RTAX_UNSPEC RTAX_UNSPEC
+       RTAX_LOCK,
+#define RTAX_LOCK RTAX_LOCK
+       RTAX_MTU,
+#define RTAX_MTU RTAX_MTU
+       RTAX_WINDOW,
+#define RTAX_WINDOW RTAX_WINDOW
+       RTAX_RTT,
+#define RTAX_RTT RTAX_RTT
+       RTAX_RTTVAR,
+#define RTAX_RTTVAR RTAX_RTTVAR
+       RTAX_SSTHRESH,
+#define RTAX_SSTHRESH RTAX_SSTHRESH
+       RTAX_CWND,
+#define RTAX_CWND RTAX_CWND
+       RTAX_ADVMSS,
+#define RTAX_ADVMSS RTAX_ADVMSS
+       RTAX_REORDERING,
+#define RTAX_REORDERING RTAX_REORDERING
+       RTAX_HOPLIMIT,
+#define RTAX_HOPLIMIT RTAX_HOPLIMIT
+       RTAX_INITCWND,
+#define RTAX_INITCWND RTAX_INITCWND
+       RTAX_FEATURES,
+#define RTAX_FEATURES RTAX_FEATURES
+       RTAX_RTO_MIN,
+#define RTAX_RTO_MIN RTAX_RTO_MIN
+       RTAX_INITRWND,
+#define RTAX_INITRWND RTAX_INITRWND
+       __RTAX_MAX
+};
+
+#define RTAX_MAX (__RTAX_MAX - 1)
+
+#define RTAX_FEATURE_ECN       0x00000001
+#define RTAX_FEATURE_SACK      0x00000002
+#define RTAX_FEATURE_TIMESTAMP 0x00000004
+#define RTAX_FEATURE_ALLFRAG   0x00000008
+
+struct rta_session {
+       __u8    proto;
+       __u8    pad1;
+       __u16   pad2;
+
+       union {
+               struct {
+                       __u16   sport;
+                       __u16   dport;
+               } ports;
+
+               struct {
+                       __u8    type;
+                       __u8    code;
+                       __u16   ident;
+               } icmpt;
+
+               __u32           spi;
+       } u;
+};
+
+/****
+ *             General form of address family dependent message.
+ ****/
+
+struct rtgenmsg {
+       unsigned char           rtgen_family;
+};
+
+/*****************************************************************
+ *             Link layer specific messages.
+ ****/
+
+/* struct ifinfomsg
+ * passes link level specific information, not dependent
+ * on network protocol.
+ */
+
+struct ifinfomsg {
+       unsigned char   ifi_family;
+       unsigned char   __ifi_pad;
+       unsigned short  ifi_type;               /* ARPHRD_* */
+       int             ifi_index;              /* Link index   */
+       unsigned        ifi_flags;              /* IFF_* flags  */
+       unsigned        ifi_change;             /* IFF_* change mask */
+};
+
+/********************************************************************
+ *             prefix information 
+ ****/
+
+struct prefixmsg {
+       unsigned char   prefix_family;
+       unsigned char   prefix_pad1;
+       unsigned short  prefix_pad2;
+       int             prefix_ifindex;
+       unsigned char   prefix_type;
+       unsigned char   prefix_len;
+       unsigned char   prefix_flags;
+       unsigned char   prefix_pad3;
+};
+
+enum 
+{
+       PREFIX_UNSPEC,
+       PREFIX_ADDRESS,
+       PREFIX_CACHEINFO,
+       __PREFIX_MAX
+};
+
+#define PREFIX_MAX     (__PREFIX_MAX - 1)
+
+struct prefix_cacheinfo {
+       __u32   preferred_time;
+       __u32   valid_time;
+};
+
+
+/*****************************************************************
+ *             Traffic control messages.
+ ****/
+
+struct tcmsg {
+       unsigned char   tcm_family;
+       unsigned char   tcm__pad1;
+       unsigned short  tcm__pad2;
+       int             tcm_ifindex;
+       __u32           tcm_handle;
+       __u32           tcm_parent;
+       __u32           tcm_info;
+};
+
+enum {
+       TCA_UNSPEC,
+       TCA_KIND,
+       TCA_OPTIONS,
+       TCA_STATS,
+       TCA_XSTATS,
+       TCA_RATE,
+       TCA_FCNT,
+       TCA_STATS2,
+       TCA_STAB,
+       __TCA_MAX
+};
+
+#define TCA_MAX (__TCA_MAX - 1)
+
+#define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
+#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+
+/********************************************************************
+ *             Neighbor Discovery userland options
+ ****/
+
+struct nduseroptmsg {
+       unsigned char   nduseropt_family;
+       unsigned char   nduseropt_pad1;
+       unsigned short  nduseropt_opts_len;     /* Total length of options */
+       int             nduseropt_ifindex;
+       __u8            nduseropt_icmp_type;
+       __u8            nduseropt_icmp_code;
+       unsigned short  nduseropt_pad2;
+       unsigned int    nduseropt_pad3;
+       /* Followed by one or more ND options */
+};
+
+enum {
+       NDUSEROPT_UNSPEC,
+       NDUSEROPT_SRCADDR,
+       __NDUSEROPT_MAX
+};
+
+#define NDUSEROPT_MAX  (__NDUSEROPT_MAX - 1)
+
+#ifndef __KERNEL__
+/* RTnetlink multicast groups - backwards compatibility for userspace */
+#define RTMGRP_LINK            1
+#define RTMGRP_NOTIFY          2
+#define RTMGRP_NEIGH           4
+#define RTMGRP_TC              8
+
+#define RTMGRP_IPV4_IFADDR     0x10
+#define RTMGRP_IPV4_MROUTE     0x20
+#define RTMGRP_IPV4_ROUTE      0x40
+#define RTMGRP_IPV4_RULE       0x80
+
+#define RTMGRP_IPV6_IFADDR     0x100
+#define RTMGRP_IPV6_MROUTE     0x200
+#define RTMGRP_IPV6_ROUTE      0x400
+#define RTMGRP_IPV6_IFINFO     0x800
+
+#define RTMGRP_DECnet_IFADDR    0x1000
+#define RTMGRP_DECnet_ROUTE     0x4000
+
+#define RTMGRP_IPV6_PREFIX     0x20000
+#endif
+
+/* RTnetlink multicast groups */
+enum rtnetlink_groups {
+       RTNLGRP_NONE,
+#define RTNLGRP_NONE           RTNLGRP_NONE
+       RTNLGRP_LINK,
+#define RTNLGRP_LINK           RTNLGRP_LINK
+       RTNLGRP_NOTIFY,
+#define RTNLGRP_NOTIFY         RTNLGRP_NOTIFY
+       RTNLGRP_NEIGH,
+#define RTNLGRP_NEIGH          RTNLGRP_NEIGH
+       RTNLGRP_TC,
+#define RTNLGRP_TC             RTNLGRP_TC
+       RTNLGRP_IPV4_IFADDR,
+#define RTNLGRP_IPV4_IFADDR    RTNLGRP_IPV4_IFADDR
+       RTNLGRP_IPV4_MROUTE,
+#define        RTNLGRP_IPV4_MROUTE     RTNLGRP_IPV4_MROUTE
+       RTNLGRP_IPV4_ROUTE,
+#define RTNLGRP_IPV4_ROUTE     RTNLGRP_IPV4_ROUTE
+       RTNLGRP_IPV4_RULE,
+#define RTNLGRP_IPV4_RULE      RTNLGRP_IPV4_RULE
+       RTNLGRP_IPV6_IFADDR,
+#define RTNLGRP_IPV6_IFADDR    RTNLGRP_IPV6_IFADDR
+       RTNLGRP_IPV6_MROUTE,
+#define RTNLGRP_IPV6_MROUTE    RTNLGRP_IPV6_MROUTE
+       RTNLGRP_IPV6_ROUTE,
+#define RTNLGRP_IPV6_ROUTE     RTNLGRP_IPV6_ROUTE
+       RTNLGRP_IPV6_IFINFO,
+#define RTNLGRP_IPV6_IFINFO    RTNLGRP_IPV6_IFINFO
+       RTNLGRP_DECnet_IFADDR,
+#define RTNLGRP_DECnet_IFADDR  RTNLGRP_DECnet_IFADDR
+       RTNLGRP_NOP2,
+       RTNLGRP_DECnet_ROUTE,
+#define RTNLGRP_DECnet_ROUTE   RTNLGRP_DECnet_ROUTE
+       RTNLGRP_DECnet_RULE,
+#define RTNLGRP_DECnet_RULE    RTNLGRP_DECnet_RULE
+       RTNLGRP_NOP4,
+       RTNLGRP_IPV6_PREFIX,
+#define RTNLGRP_IPV6_PREFIX    RTNLGRP_IPV6_PREFIX
+       RTNLGRP_IPV6_RULE,
+#define RTNLGRP_IPV6_RULE      RTNLGRP_IPV6_RULE
+       RTNLGRP_ND_USEROPT,
+#define RTNLGRP_ND_USEROPT     RTNLGRP_ND_USEROPT
+       RTNLGRP_PHONET_IFADDR,
+#define RTNLGRP_PHONET_IFADDR  RTNLGRP_PHONET_IFADDR
+       RTNLGRP_PHONET_ROUTE,
+#define RTNLGRP_PHONET_ROUTE   RTNLGRP_PHONET_ROUTE
+       RTNLGRP_DCB,
+#define RTNLGRP_DCB            RTNLGRP_DCB
+       __RTNLGRP_MAX
+};
+#define RTNLGRP_MAX    (__RTNLGRP_MAX - 1)
+
+/* TC action piece */
+struct tcamsg {
+       unsigned char   tca_family;
+       unsigned char   tca__pad1;
+       unsigned short  tca__pad2;
+};
+#define TA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1 /* attr type must be >=1 */      
+#define TCAA_MAX 1
+
+/* New extended info filters for IFLA_EXT_MASK */
+#define RTEXT_FILTER_VF                (1 << 0)
+
+/* End of information exported to user level */
+
+
+
+#endif /* _UAPI__LINUX_RTNETLINK_H */
diff --git a/include/uapi/linux/scc.h b/include/uapi/linux/scc.h
new file mode 100644 (file)
index 0000000..72b6b81
--- /dev/null
@@ -0,0 +1,172 @@
+/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
+
+#ifndef _UAPI_SCC_H
+#define _UAPI_SCC_H
+
+
+/* selection of hardware types */
+
+#define PA0HZP         0x00    /* hardware type for PA0HZP SCC card and compatible */
+#define EAGLE          0x01    /* hardware type for EAGLE card */
+#define PC100          0x02    /* hardware type for PC100 card */
+#define PRIMUS         0x04    /* hardware type for PRIMUS-PC (DG9BL) card */
+#define DRSI           0x08    /* hardware type for DRSI PC*Packet card */
+#define BAYCOM         0x10    /* hardware type for BayCom (U)SCC */
+
+/* DEV ioctl() commands */
+
+enum SCC_ioctl_cmds {
+       SIOCSCCRESERVED = SIOCDEVPRIVATE,
+       SIOCSCCCFG,
+       SIOCSCCINI,
+       SIOCSCCCHANINI,
+       SIOCSCCSMEM,
+       SIOCSCCGKISS,
+       SIOCSCCSKISS,
+       SIOCSCCGSTAT,
+       SIOCSCCCAL
+};
+
+/* Device parameter control (from WAMPES) */
+
+enum L1_params {
+       PARAM_DATA,
+       PARAM_TXDELAY,
+       PARAM_PERSIST,
+       PARAM_SLOTTIME,
+       PARAM_TXTAIL,
+       PARAM_FULLDUP,
+       PARAM_SOFTDCD,          /* was: PARAM_HW */
+       PARAM_MUTE,             /* ??? */
+       PARAM_DTR,
+       PARAM_RTS,
+       PARAM_SPEED,
+       PARAM_ENDDELAY,         /* ??? */
+       PARAM_GROUP,
+       PARAM_IDLE,
+       PARAM_MIN,
+       PARAM_MAXKEY,
+       PARAM_WAIT,
+       PARAM_MAXDEFER,
+       PARAM_TX,
+       PARAM_HWEVENT = 31,
+       PARAM_RETURN = 255      /* reset kiss mode */
+};
+
+/* fulldup parameter */
+
+enum FULLDUP_modes {
+       KISS_DUPLEX_HALF,       /* normal CSMA operation */
+       KISS_DUPLEX_FULL,       /* fullduplex, key down trx after transmission */
+       KISS_DUPLEX_LINK,       /* fullduplex, key down trx after 'idletime' sec */
+       KISS_DUPLEX_OPTIMA      /* fullduplex, let the protocol layer control the hw */
+};
+
+/* misc. parameters */
+
+#define TIMER_OFF      65535U  /* to switch off timers */
+#define NO_SUCH_PARAM  65534U  /* param not implemented */
+
+/* HWEVENT parameter */
+
+enum HWEVENT_opts {
+       HWEV_DCD_ON,
+       HWEV_DCD_OFF,
+       HWEV_ALL_SENT
+};
+
+/* channel grouping */
+
+#define RXGROUP                0100    /* if set, only tx when all channels clear */
+#define TXGROUP                0200    /* if set, don't transmit simultaneously */
+
+/* Tx/Rx clock sources */
+
+enum CLOCK_sources {
+       CLK_DPLL,       /* normal halfduplex operation */
+       CLK_EXTERNAL,   /* external clocking (G3RUH/DF9IC modems) */
+       CLK_DIVIDER,    /* Rx = DPLL, Tx = divider (fullduplex with */
+                       /* modems without clock regeneration */
+       CLK_BRG         /* experimental fullduplex mode with DPLL/BRG for */
+                       /* MODEMs without clock recovery */
+};
+
+/* Tx state */
+
+enum TX_state {
+       TXS_IDLE,       /* Transmitter off, no data pending */
+       TXS_BUSY,       /* waiting for permission to send / tailtime */
+       TXS_ACTIVE,     /* Transmitter on, sending data */
+       TXS_NEWFRAME,   /* reset CRC and send (next) frame */
+       TXS_IDLE2,      /* Transmitter on, no data pending */
+       TXS_WAIT,       /* Waiting for Mintime to expire */
+       TXS_TIMEOUT     /* We had a transmission timeout */
+};
+
+typedef unsigned long io_port; /* type definition for an 'io port address' */
+
+/* SCC statistical information */
+
+struct scc_stat {
+        long rxints;            /* Receiver interrupts */
+        long txints;            /* Transmitter interrupts */
+        long exints;            /* External/status interrupts */
+        long spints;            /* Special receiver interrupts */
+
+        long txframes;          /* Packets sent */
+        long rxframes;          /* Number of Frames Actually Received */
+        long rxerrs;            /* CRC Errors */
+        long txerrs;           /* KISS errors */
+        
+       unsigned int nospace;   /* "Out of buffers" */
+       unsigned int rx_over;   /* Receiver Overruns */
+       unsigned int tx_under;  /* Transmitter Underruns */
+
+       unsigned int tx_state;  /* Transmitter state */
+       int tx_queued;          /* tx frames enqueued */
+
+       unsigned int maxqueue;  /* allocated tx_buffers */
+       unsigned int bufsize;   /* used buffersize */
+};
+
+struct scc_modem {
+       long speed;             /* Line speed, bps */
+       char clocksrc;          /* 0 = DPLL, 1 = external, 2 = divider */
+       char nrz;               /* NRZ instead of NRZI */       
+};
+
+struct scc_kiss_cmd {
+       int      command;       /* one of the KISS-Commands defined above */
+       unsigned param;         /* KISS-Param */
+};
+
+struct scc_hw_config {
+       io_port data_a;         /* data port channel A */
+       io_port ctrl_a;         /* control port channel A */
+       io_port data_b;         /* data port channel B */
+       io_port ctrl_b;         /* control port channel B */
+       io_port vector_latch;   /* INTACK-Latch (#) */
+       io_port special;        /* special function port */
+
+       int     irq;            /* irq */
+       long    clock;          /* clock */
+       char    option;         /* command for function port */
+
+       char brand;             /* hardware type */
+       char escc;              /* use ext. features of a 8580/85180/85280 */
+};
+
+/* (#) only one INTACK latch allowed. */
+
+
+struct scc_mem_config {
+       unsigned int dummy;
+       unsigned int bufsize;
+};
+
+struct scc_calibrate {
+       unsigned int time;
+       unsigned char pattern;
+};
+
+#endif /* _UAPI_SCC_H */
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
new file mode 100644 (file)
index 0000000..5a0f945
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _UAPI_LINUX_SCHED_H
+#define _UAPI_LINUX_SCHED_H
+
+/*
+ * cloning flags:
+ */
+#define CSIGNAL                0x000000ff      /* signal mask to be sent at exit */
+#define CLONE_VM       0x00000100      /* set if VM shared between processes */
+#define CLONE_FS       0x00000200      /* set if fs info shared between processes */
+#define CLONE_FILES    0x00000400      /* set if open files shared between processes */
+#define CLONE_SIGHAND  0x00000800      /* set if signal handlers and blocked signals shared */
+#define CLONE_PTRACE   0x00002000      /* set if we want to let tracing continue on the child too */
+#define CLONE_VFORK    0x00004000      /* set if the parent wants the child to wake it up on mm_release */
+#define CLONE_PARENT   0x00008000      /* set if we want to have the same parent as the cloner */
+#define CLONE_THREAD   0x00010000      /* Same thread group? */
+#define CLONE_NEWNS    0x00020000      /* New namespace group? */
+#define CLONE_SYSVSEM  0x00040000      /* share system V SEM_UNDO semantics */
+#define CLONE_SETTLS   0x00080000      /* create a new TLS for the child */
+#define CLONE_PARENT_SETTID    0x00100000      /* set the TID in the parent */
+#define CLONE_CHILD_CLEARTID   0x00200000      /* clear the TID in the child */
+#define CLONE_DETACHED         0x00400000      /* Unused, ignored */
+#define CLONE_UNTRACED         0x00800000      /* set if the tracing process can't force CLONE_PTRACE on this clone */
+#define CLONE_CHILD_SETTID     0x01000000      /* set the TID in the child */
+/* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state)
+   and is now available for re-use. */
+#define CLONE_NEWUTS           0x04000000      /* New utsname group? */
+#define CLONE_NEWIPC           0x08000000      /* New ipcs */
+#define CLONE_NEWUSER          0x10000000      /* New user namespace */
+#define CLONE_NEWPID           0x20000000      /* New pid namespace */
+#define CLONE_NEWNET           0x40000000      /* New network namespace */
+#define CLONE_IO               0x80000000      /* Clone io context */
+
+/*
+ * Scheduling policies
+ */
+#define SCHED_NORMAL           0
+#define SCHED_FIFO             1
+#define SCHED_RR               2
+#define SCHED_BATCH            3
+/* SCHED_ISO: reserved but not implemented yet */
+#define SCHED_IDLE             5
+/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
+#define SCHED_RESET_ON_FORK     0x40000000
+
+
+#endif /* _UAPI_LINUX_SCHED_H */
diff --git a/include/uapi/linux/screen_info.h b/include/uapi/linux/screen_info.h
new file mode 100644 (file)
index 0000000..7530e74
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef _UAPI_SCREEN_INFO_H
+#define _UAPI_SCREEN_INFO_H
+
+#include <linux/types.h>
+
+/*
+ * These are set up by the setup-routine at boot-time:
+ */
+
+struct screen_info {
+       __u8  orig_x;           /* 0x00 */
+       __u8  orig_y;           /* 0x01 */
+       __u16 ext_mem_k;        /* 0x02 */
+       __u16 orig_video_page;  /* 0x04 */
+       __u8  orig_video_mode;  /* 0x06 */
+       __u8  orig_video_cols;  /* 0x07 */
+       __u8  flags;            /* 0x08 */
+       __u8  unused2;          /* 0x09 */
+       __u16 orig_video_ega_bx;/* 0x0a */
+       __u16 unused3;          /* 0x0c */
+       __u8  orig_video_lines; /* 0x0e */
+       __u8  orig_video_isVGA; /* 0x0f */
+       __u16 orig_video_points;/* 0x10 */
+
+       /* VESA graphic mode -- linear frame buffer */
+       __u16 lfb_width;        /* 0x12 */
+       __u16 lfb_height;       /* 0x14 */
+       __u16 lfb_depth;        /* 0x16 */
+       __u32 lfb_base;         /* 0x18 */
+       __u32 lfb_size;         /* 0x1c */
+       __u16 cl_magic, cl_offset; /* 0x20 */
+       __u16 lfb_linelength;   /* 0x24 */
+       __u8  red_size;         /* 0x26 */
+       __u8  red_pos;          /* 0x27 */
+       __u8  green_size;       /* 0x28 */
+       __u8  green_pos;        /* 0x29 */
+       __u8  blue_size;        /* 0x2a */
+       __u8  blue_pos;         /* 0x2b */
+       __u8  rsvd_size;        /* 0x2c */
+       __u8  rsvd_pos;         /* 0x2d */
+       __u16 vesapm_seg;       /* 0x2e */
+       __u16 vesapm_off;       /* 0x30 */
+       __u16 pages;            /* 0x32 */
+       __u16 vesa_attributes;  /* 0x34 */
+       __u32 capabilities;     /* 0x36 */
+       __u8  _reserved[6];     /* 0x3a */
+} __attribute__((packed));
+
+#define VIDEO_TYPE_MDA         0x10    /* Monochrome Text Display      */
+#define VIDEO_TYPE_CGA         0x11    /* CGA Display                  */
+#define VIDEO_TYPE_EGAM                0x20    /* EGA/VGA in Monochrome Mode   */
+#define VIDEO_TYPE_EGAC                0x21    /* EGA in Color Mode            */
+#define VIDEO_TYPE_VGAC                0x22    /* VGA+ in Color Mode           */
+#define VIDEO_TYPE_VLFB                0x23    /* VESA VGA in graphic mode     */
+
+#define VIDEO_TYPE_PICA_S3     0x30    /* ACER PICA-61 local S3 video  */
+#define VIDEO_TYPE_MIPS_G364   0x31    /* MIPS Magnum 4000 G364 video  */
+#define VIDEO_TYPE_SGI          0x33    /* Various SGI graphics hardware */
+
+#define VIDEO_TYPE_TGAC                0x40    /* DEC TGA */
+
+#define VIDEO_TYPE_SUN          0x50    /* Sun frame buffer. */
+#define VIDEO_TYPE_SUNPCI       0x51    /* Sun PCI based frame buffer. */
+
+#define VIDEO_TYPE_PMAC                0x60    /* PowerMacintosh frame buffer. */
+
+#define VIDEO_TYPE_EFI         0x70    /* EFI graphic mode             */
+
+#define VIDEO_FLAGS_NOCURSOR   (1 << 0) /* The video mode has no cursor set */
+
+#define VIDEO_CAPABILITY_SKIP_QUIRKS   (1 << 0)
+
+
+#endif /* _UAPI_SCREEN_INFO_H */
diff --git a/include/uapi/linux/sdla.h b/include/uapi/linux/sdla.h
new file mode 100644 (file)
index 0000000..95eaff9
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Global definitions for the Frame relay interface.
+ *
+ * Version:    @(#)if_ifrad.h  0.20    13 Apr 96
+ *
+ * Author:     Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ *             0.15    Mike McLagan    Structure packing
+ *
+ *             0.20    Mike McLagan    New flags for S508 buffer handling
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _UAPISDLA_H
+#define _UAPISDLA_H
+
+/* adapter type */
+#define SDLA_TYPES
+#define SDLA_S502A                     5020
+#define SDLA_S502E                     5021
+#define SDLA_S503                      5030
+#define SDLA_S507                      5070
+#define SDLA_S508                      5080
+#define SDLA_S509                      5090
+#define SDLA_UNKNOWN                   -1
+
+/* port selection flags for the S508 */
+#define SDLA_S508_PORT_V35             0x00
+#define SDLA_S508_PORT_RS232           0x02
+
+/* Z80 CPU speeds */
+#define SDLA_CPU_3M                    0x00
+#define SDLA_CPU_5M                    0x01
+#define SDLA_CPU_7M                    0x02
+#define SDLA_CPU_8M                    0x03
+#define SDLA_CPU_10M                   0x04
+#define SDLA_CPU_16M                   0x05
+#define SDLA_CPU_12M                   0x06
+
+/* some private IOCTLs */
+#define SDLA_IDENTIFY                  (FRAD_LAST_IOCTL + 1)
+#define SDLA_CPUSPEED                  (FRAD_LAST_IOCTL + 2)
+#define SDLA_PROTOCOL                  (FRAD_LAST_IOCTL + 3)
+
+#define SDLA_CLEARMEM                  (FRAD_LAST_IOCTL + 4)
+#define SDLA_WRITEMEM                  (FRAD_LAST_IOCTL + 5)
+#define SDLA_READMEM                   (FRAD_LAST_IOCTL + 6)
+
+struct sdla_mem {
+   int  addr;
+   int  len;
+   void __user *data;
+};
+
+#define SDLA_START                     (FRAD_LAST_IOCTL + 7)
+#define SDLA_STOP                      (FRAD_LAST_IOCTL + 8)
+
+/* some offsets in the Z80's memory space */
+#define SDLA_NMIADDR                   0x0000
+#define SDLA_CONF_ADDR                 0x0010
+#define SDLA_S502A_NMIADDR             0x0066
+#define SDLA_CODE_BASEADDR             0x0100
+#define SDLA_WINDOW_SIZE               0x2000
+#define SDLA_ADDR_MASK                 0x1FFF
+
+/* largest handleable block of data */
+#define SDLA_MAX_DATA                  4080
+#define SDLA_MAX_MTU                   4072    /* MAX_DATA - sizeof(fradhdr) */
+#define SDLA_MAX_DLCI                  24
+
+/* this should be the same as frad_conf */
+struct sdla_conf {
+   short station;
+   short config;
+   short kbaud;
+   short clocking;
+   short max_frm;
+   short T391;
+   short T392;
+   short N391;
+   short N392;
+   short N393;
+   short CIR_fwd;
+   short Bc_fwd;
+   short Be_fwd;
+   short CIR_bwd;
+   short Bc_bwd;
+   short Be_bwd;
+};
+
+/* this should be the same as dlci_conf */
+struct sdla_dlci_conf {
+   short config;
+   short CIR_fwd;
+   short Bc_fwd;
+   short Be_fwd;
+   short CIR_bwd;
+   short Bc_bwd;
+   short Be_bwd; 
+   short Tc_fwd;
+   short Tc_bwd;
+   short Tf_max;
+   short Tb_max;
+};
+
+
+#endif /* _UAPISDLA_H */
diff --git a/include/uapi/linux/seccomp.h b/include/uapi/linux/seccomp.h
new file mode 100644 (file)
index 0000000..ac2dc9f
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _UAPI_LINUX_SECCOMP_H
+#define _UAPI_LINUX_SECCOMP_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+
+/* Valid values for seccomp.mode and prctl(PR_SET_SECCOMP, <mode>) */
+#define SECCOMP_MODE_DISABLED  0 /* seccomp is not in use. */
+#define SECCOMP_MODE_STRICT    1 /* uses hard-coded filter. */
+#define SECCOMP_MODE_FILTER    2 /* uses user-supplied filter. */
+
+/*
+ * All BPF programs must return a 32-bit value.
+ * The bottom 16-bits are for optional return data.
+ * The upper 16-bits are ordered from least permissive values to most.
+ *
+ * The ordering ensures that a min_t() over composed return values always
+ * selects the least permissive choice.
+ */
+#define SECCOMP_RET_KILL       0x00000000U /* kill the task immediately */
+#define SECCOMP_RET_TRAP       0x00030000U /* disallow and force a SIGSYS */
+#define SECCOMP_RET_ERRNO      0x00050000U /* returns an errno */
+#define SECCOMP_RET_TRACE      0x7ff00000U /* pass to a tracer or disallow */
+#define SECCOMP_RET_ALLOW      0x7fff0000U /* allow */
+
+/* Masks for the return value sections. */
+#define SECCOMP_RET_ACTION     0x7fff0000U
+#define SECCOMP_RET_DATA       0x0000ffffU
+
+/**
+ * struct seccomp_data - the format the BPF program executes over.
+ * @nr: the system call number
+ * @arch: indicates system call convention as an AUDIT_ARCH_* value
+ *        as defined in <linux/audit.h>.
+ * @instruction_pointer: at the time of the system call.
+ * @args: up to 6 system call arguments always stored as 64-bit values
+ *        regardless of the architecture.
+ */
+struct seccomp_data {
+       int nr;
+       __u32 arch;
+       __u64 instruction_pointer;
+       __u64 args[6];
+};
+
+#endif /* _UAPI_LINUX_SECCOMP_H */
diff --git a/include/uapi/linux/securebits.h b/include/uapi/linux/securebits.h
new file mode 100644 (file)
index 0000000..985aac9
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef _UAPI_LINUX_SECUREBITS_H
+#define _UAPI_LINUX_SECUREBITS_H
+
+/* Each securesetting is implemented using two bits. One bit specifies
+   whether the setting is on or off. The other bit specify whether the
+   setting is locked or not. A setting which is locked cannot be
+   changed from user-level. */
+#define issecure_mask(X)       (1 << (X))
+
+#define SECUREBITS_DEFAULT 0x00000000
+
+/* When set UID 0 has no special privileges. When unset, we support
+   inheritance of root-permissions and suid-root executable under
+   compatibility mode. We raise the effective and inheritable bitmasks
+   *of the executable file* if the effective uid of the new process is
+   0. If the real uid is 0, we raise the effective (legacy) bit of the
+   executable file. */
+#define SECURE_NOROOT                  0
+#define SECURE_NOROOT_LOCKED           1  /* make bit-0 immutable */
+
+#define SECBIT_NOROOT          (issecure_mask(SECURE_NOROOT))
+#define SECBIT_NOROOT_LOCKED   (issecure_mask(SECURE_NOROOT_LOCKED))
+
+/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
+   When unset, to provide compatiblility with old programs relying on
+   set*uid to gain/lose privilege, transitions to/from uid 0 cause
+   capabilities to be gained/lost. */
+#define SECURE_NO_SETUID_FIXUP         2
+#define SECURE_NO_SETUID_FIXUP_LOCKED  3  /* make bit-2 immutable */
+
+#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
+#define SECBIT_NO_SETUID_FIXUP_LOCKED \
+                       (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
+
+/* When set, a process can retain its capabilities even after
+   transitioning to a non-root user (the set-uid fixup suppressed by
+   bit 2). Bit-4 is cleared when a process calls exec(); setting both
+   bit 4 and 5 will create a barrier through exec that no exec()'d
+   child can use this feature again. */
+#define SECURE_KEEP_CAPS               4
+#define SECURE_KEEP_CAPS_LOCKED                5  /* make bit-4 immutable */
+
+#define SECBIT_KEEP_CAPS       (issecure_mask(SECURE_KEEP_CAPS))
+#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
+
+#define SECURE_ALL_BITS                (issecure_mask(SECURE_NOROOT) | \
+                                issecure_mask(SECURE_NO_SETUID_FIXUP) | \
+                                issecure_mask(SECURE_KEEP_CAPS))
+#define SECURE_ALL_LOCKS       (SECURE_ALL_BITS << 1)
+
+#endif /* _UAPI_LINUX_SECUREBITS_H */
diff --git a/include/uapi/linux/sem.h b/include/uapi/linux/sem.h
new file mode 100644 (file)
index 0000000..541fce0
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef _UAPI_LINUX_SEM_H
+#define _UAPI_LINUX_SEM_H
+
+#include <linux/ipc.h>
+
+/* semop flags */
+#define SEM_UNDO        0x1000  /* undo the operation on exit */
+
+/* semctl Command Definitions. */
+#define GETPID  11       /* get sempid */
+#define GETVAL  12       /* get semval */
+#define GETALL  13       /* get all semval's */
+#define GETNCNT 14       /* get semncnt */
+#define GETZCNT 15       /* get semzcnt */
+#define SETVAL  16       /* set semval */
+#define SETALL  17       /* set all semval's */
+
+/* ipcs ctl cmds */
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct semid_ds {
+       struct ipc_perm sem_perm;               /* permissions .. see ipc.h */
+       __kernel_time_t sem_otime;              /* last semop time */
+       __kernel_time_t sem_ctime;              /* last change time */
+       struct sem      *sem_base;              /* ptr to first semaphore in array */
+       struct sem_queue *sem_pending;          /* pending operations to be processed */
+       struct sem_queue **sem_pending_last;    /* last pending operation */
+       struct sem_undo *undo;                  /* undo requests on this array */
+       unsigned short  sem_nsems;              /* no. of semaphores in array */
+};
+
+/* Include the definition of semid64_ds */
+#include <asm/sembuf.h>
+
+/* semop system calls takes an array of these. */
+struct sembuf {
+       unsigned short  sem_num;        /* semaphore index in array */
+       short           sem_op;         /* semaphore operation */
+       short           sem_flg;        /* operation flags */
+};
+
+/* arg for semctl system calls. */
+union semun {
+       int val;                        /* value for SETVAL */
+       struct semid_ds __user *buf;    /* buffer for IPC_STAT & IPC_SET */
+       unsigned short __user *array;   /* array for GETALL & SETALL */
+       struct seminfo __user *__buf;   /* buffer for IPC_INFO */
+       void __user *__pad;
+};
+
+struct  seminfo {
+       int semmap;
+       int semmni;
+       int semmns;
+       int semmnu;
+       int semmsl;
+       int semopm;
+       int semume;
+       int semusz;
+       int semvmx;
+       int semaem;
+};
+
+#define SEMMNI  128             /* <= IPCMNI  max # of semaphore identifiers */
+#define SEMMSL  250             /* <= 8 000 max num of semaphores per id */
+#define SEMMNS  (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
+#define SEMOPM  32             /* <= 1 000 max num of ops per semop call */
+#define SEMVMX  32767           /* <= 32767 semaphore maximum value */
+#define SEMAEM  SEMVMX          /* adjust on exit max value */
+
+/* unused */
+#define SEMUME  SEMOPM          /* max num of undo entries per process */
+#define SEMMNU  SEMMNS          /* num of undo structures system wide */
+#define SEMMAP  SEMMNS          /* # of entries in semaphore map */
+#define SEMUSZ  20             /* sizeof struct sem_undo */
+
+
+#endif /* _UAPI_LINUX_SEM_H */
diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h
new file mode 100644 (file)
index 0000000..5e0d0ed
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * include/linux/serial.h
+ *
+ * Copyright (C) 1992 by Theodore Ts'o.
+ * 
+ * Redistribution of this file is permitted under the terms of the GNU 
+ * Public License (GPL)
+ */
+
+#ifndef _UAPI_LINUX_SERIAL_H
+#define _UAPI_LINUX_SERIAL_H
+
+#include <linux/types.h>
+
+#include <linux/tty_flags.h>
+
+
+struct serial_struct {
+       int     type;
+       int     line;
+       unsigned int    port;
+       int     irq;
+       int     flags;
+       int     xmit_fifo_size;
+       int     custom_divisor;
+       int     baud_base;
+       unsigned short  close_delay;
+       char    io_type;
+       char    reserved_char[1];
+       int     hub6;
+       unsigned short  closing_wait; /* time to wait before closing */
+       unsigned short  closing_wait2; /* no longer used... */
+       unsigned char   *iomem_base;
+       unsigned short  iomem_reg_shift;
+       unsigned int    port_high;
+       unsigned long   iomap_base;     /* cookie passed into ioremap */
+};
+
+/*
+ * For the close wait times, 0 means wait forever for serial port to
+ * flush its output.  65535 means don't wait at all.
+ */
+#define ASYNC_CLOSING_WAIT_INF 0
+#define ASYNC_CLOSING_WAIT_NONE        65535
+
+/*
+ * These are the supported serial types.
+ */
+#define PORT_UNKNOWN   0
+#define PORT_8250      1
+#define PORT_16450     2
+#define PORT_16550     3
+#define PORT_16550A    4
+#define PORT_CIRRUS     5      /* usurped by cyclades.c */
+#define PORT_16650     6
+#define PORT_16650V2   7
+#define PORT_16750     8
+#define PORT_STARTECH  9       /* usurped by cyclades.c */
+#define PORT_16C950    10      /* Oxford Semiconductor */
+#define PORT_16654     11
+#define PORT_16850     12
+#define PORT_RSA       13      /* RSA-DV II/S card */
+#define PORT_MAX       13
+
+#define SERIAL_IO_PORT 0
+#define SERIAL_IO_HUB6 1
+#define SERIAL_IO_MEM  2
+
+#define UART_CLEAR_FIFO                0x01
+#define UART_USE_FIFO          0x02
+#define UART_STARTECH          0x04
+#define UART_NATSEMI           0x08
+
+
+/*
+ * Multiport serial configuration structure --- external structure
+ */
+struct serial_multiport_struct {
+       int             irq;
+       int             port1;
+       unsigned char   mask1, match1;
+       int             port2;
+       unsigned char   mask2, match2;
+       int             port3;
+       unsigned char   mask3, match3;
+       int             port4;
+       unsigned char   mask4, match4;
+       int             port_monitor;
+       int     reserved[32];
+};
+
+/*
+ * Serial input interrupt line counters -- external structure
+ * Four lines can interrupt: CTS, DSR, RI, DCD
+ */
+struct serial_icounter_struct {
+       int cts, dsr, rng, dcd;
+       int rx, tx;
+       int frame, overrun, parity, brk;
+       int buf_overrun;
+       int reserved[9];
+};
+
+/*
+ * Serial interface for controlling RS485 settings on chips with suitable
+ * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
+ * platform. The set function returns the new state, with any unsupported bits
+ * reverted appropriately.
+ */
+
+struct serial_rs485 {
+       __u32   flags;                  /* RS485 feature flags */
+#define SER_RS485_ENABLED              (1 << 0)        /* If enabled */
+#define SER_RS485_RTS_ON_SEND          (1 << 1)        /* Logical level for
+                                                          RTS pin when
+                                                          sending */
+#define SER_RS485_RTS_AFTER_SEND       (1 << 2)        /* Logical level for
+                                                          RTS pin after sent*/
+#define SER_RS485_RX_DURING_TX         (1 << 4)
+       __u32   delay_rts_before_send;  /* Delay before send (milliseconds) */
+       __u32   delay_rts_after_send;   /* Delay after send (milliseconds) */
+       __u32   padding[5];             /* Memory is cheap, new structs
+                                          are a royal PITA .. */
+};
+
+#endif /* _UAPI_LINUX_SERIAL_H */
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
new file mode 100644 (file)
index 0000000..7e1ab20
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ *  linux/drivers/char/serial_core.h
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef _UAPILINUX_SERIAL_CORE_H
+#define _UAPILINUX_SERIAL_CORE_H
+
+#include <linux/serial.h>
+
+/*
+ * The type definitions.  These are from Ted Ts'o's serial.h
+ */
+#define PORT_UNKNOWN   0
+#define PORT_8250      1
+#define PORT_16450     2
+#define PORT_16550     3
+#define PORT_16550A    4
+#define PORT_CIRRUS    5
+#define PORT_16650     6
+#define PORT_16650V2   7
+#define PORT_16750     8
+#define PORT_STARTECH  9
+#define PORT_16C950    10
+#define PORT_16654     11
+#define PORT_16850     12
+#define PORT_RSA       13
+#define PORT_NS16550A  14
+#define PORT_XSCALE    15
+#define PORT_RM9000    16      /* PMC-Sierra RM9xxx internal UART */
+#define PORT_OCTEON    17      /* Cavium OCTEON internal UART */
+#define PORT_AR7       18      /* Texas Instruments AR7 internal UART */
+#define PORT_U6_16550A 19      /* ST-Ericsson U6xxx internal UART */
+#define PORT_TEGRA     20      /* NVIDIA Tegra internal UART */
+#define PORT_XR17D15X  21      /* Exar XR17D15x UART */
+#define PORT_LPC3220   22      /* NXP LPC32xx SoC "Standard" UART */
+#define PORT_8250_CIR  23      /* CIR infrared port, has its own driver */
+#define PORT_MAX_8250  23      /* max port ID */
+
+/*
+ * ARM specific type numbers.  These are not currently guaranteed
+ * to be implemented, and will change in the future.  These are
+ * separate so any additions to the old serial.c that occur before
+ * we are merged can be easily merged here.
+ */
+#define PORT_PXA       31
+#define PORT_AMBA      32
+#define PORT_CLPS711X  33
+#define PORT_SA1100    34
+#define PORT_UART00    35
+#define PORT_21285     37
+
+/* Sparc type numbers.  */
+#define PORT_SUNZILOG  38
+#define PORT_SUNSAB    39
+
+/* DEC */
+#define PORT_DZ                46
+#define PORT_ZS                47
+
+/* Parisc type numbers. */
+#define PORT_MUX       48
+
+/* Atmel AT91 / AT32 SoC */
+#define PORT_ATMEL     49
+
+/* Macintosh Zilog type numbers */
+#define PORT_MAC_ZILOG 50      /* m68k : not yet implemented */
+#define PORT_PMAC_ZILOG        51
+
+/* SH-SCI */
+#define PORT_SCI       52
+#define PORT_SCIF      53
+#define PORT_IRDA      54
+
+/* Samsung S3C2410 SoC and derivatives thereof */
+#define PORT_S3C2410    55
+
+/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
+#define PORT_IP22ZILOG 56
+
+/* Sharp LH7a40x -- an ARM9 SoC series */
+#define PORT_LH7A40X   57
+
+/* PPC CPM type number */
+#define PORT_CPM        58
+
+/* MPC52xx (and MPC512x) type numbers */
+#define PORT_MPC52xx   59
+
+/* IBM icom */
+#define PORT_ICOM      60
+
+/* Samsung S3C2440 SoC */
+#define PORT_S3C2440   61
+
+/* Motorola i.MX SoC */
+#define PORT_IMX       62
+
+/* Marvell MPSC */
+#define PORT_MPSC      63
+
+/* TXX9 type number */
+#define PORT_TXX9      64
+
+/* NEC VR4100 series SIU/DSIU */
+#define PORT_VR41XX_SIU                65
+#define PORT_VR41XX_DSIU       66
+
+/* Samsung S3C2400 SoC */
+#define PORT_S3C2400   67
+
+/* M32R SIO */
+#define PORT_M32R_SIO  68
+
+/*Digi jsm */
+#define PORT_JSM        69
+
+#define PORT_PNX8XXX   70
+
+/* Hilscher netx */
+#define PORT_NETX      71
+
+/* SUN4V Hypervisor Console */
+#define PORT_SUNHV     72
+
+#define PORT_S3C2412   73
+
+/* Xilinx uartlite */
+#define PORT_UARTLITE  74
+
+/* Blackfin bf5xx */
+#define PORT_BFIN      75
+
+/* Micrel KS8695 */
+#define PORT_KS8695    76
+
+/* Broadcom SB1250, etc. SOC */
+#define PORT_SB1250_DUART      77
+
+/* Freescale ColdFire */
+#define PORT_MCF       78
+
+/* Blackfin SPORT */
+#define PORT_BFIN_SPORT                79
+
+/* MN10300 on-chip UART numbers */
+#define PORT_MN10300           80
+#define PORT_MN10300_CTS       81
+
+#define PORT_SC26XX    82
+
+/* SH-SCI */
+#define PORT_SCIFA     83
+
+#define PORT_S3C6400   84
+
+/* NWPSERIAL */
+#define PORT_NWPSERIAL 85
+
+/* MAX3100 */
+#define PORT_MAX3100    86
+
+/* Timberdale UART */
+#define PORT_TIMBUART  87
+
+/* Qualcomm MSM SoCs */
+#define PORT_MSM       88
+
+/* BCM63xx family SoCs */
+#define PORT_BCM63XX   89
+
+/* Aeroflex Gaisler GRLIB APBUART */
+#define PORT_APBUART    90
+
+/* Altera UARTs */
+#define PORT_ALTERA_JTAGUART   91
+#define PORT_ALTERA_UART       92
+
+/* SH-SCI */
+#define PORT_SCIFB     93
+
+/* MAX310X */
+#define PORT_MAX310X   94
+
+/* High Speed UART for Medfield */
+#define PORT_MFD       95
+
+/* TI OMAP-UART */
+#define PORT_OMAP      96
+
+/* VIA VT8500 SoC */
+#define PORT_VT8500    97
+
+/* Xilinx PSS UART */
+#define PORT_XUARTPS   98
+
+/* Atheros AR933X SoC */
+#define PORT_AR933X    99
+
+/* Energy Micro efm32 SoC */
+#define PORT_EFMUART   100
+
+
+#endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/include/uapi/linux/serio.h b/include/uapi/linux/serio.h
new file mode 100644 (file)
index 0000000..9f53fa7
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 1999-2002 Vojtech Pavlik
+*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef _UAPI_SERIO_H
+#define _UAPI_SERIO_H
+
+
+#include <linux/ioctl.h>
+
+#define SPIOCSTYPE     _IOW('q', 0x01, unsigned long)
+
+
+/*
+ * bit masks for use in "interrupt" flags (3rd argument)
+ */
+#define SERIO_TIMEOUT  1
+#define SERIO_PARITY   2
+#define SERIO_FRAME    4
+
+/*
+ * Serio types
+ */
+#define SERIO_XT       0x00
+#define SERIO_8042     0x01
+#define SERIO_RS232    0x02
+#define SERIO_HIL_MLC  0x03
+#define SERIO_PS_PSTHRU        0x05
+#define SERIO_8042_XL  0x06
+
+/*
+ * Serio protocols
+ */
+#define SERIO_UNKNOWN  0x00
+#define SERIO_MSC      0x01
+#define SERIO_SUN      0x02
+#define SERIO_MS       0x03
+#define SERIO_MP       0x04
+#define SERIO_MZ       0x05
+#define SERIO_MZP      0x06
+#define SERIO_MZPP     0x07
+#define SERIO_VSXXXAA  0x08
+#define SERIO_SUNKBD   0x10
+#define SERIO_WARRIOR  0x18
+#define SERIO_SPACEORB 0x19
+#define SERIO_MAGELLAN 0x1a
+#define SERIO_SPACEBALL        0x1b
+#define SERIO_GUNZE    0x1c
+#define SERIO_IFORCE   0x1d
+#define SERIO_STINGER  0x1e
+#define SERIO_NEWTON   0x1f
+#define SERIO_STOWAWAY 0x20
+#define SERIO_H3600    0x21
+#define SERIO_PS2SER   0x22
+#define SERIO_TWIDKBD  0x23
+#define SERIO_TWIDJOY  0x24
+#define SERIO_HIL      0x25
+#define SERIO_SNES232  0x26
+#define SERIO_SEMTECH  0x27
+#define SERIO_LKKBD    0x28
+#define SERIO_ELO      0x29
+#define SERIO_MICROTOUCH       0x30
+#define SERIO_PENMOUNT 0x31
+#define SERIO_TOUCHRIGHT       0x32
+#define SERIO_TOUCHWIN 0x33
+#define SERIO_TAOSEVM  0x34
+#define SERIO_FUJITSU  0x35
+#define SERIO_ZHENHUA  0x36
+#define SERIO_INEXIO   0x37
+#define SERIO_TOUCHIT213       0x38
+#define SERIO_W8001    0x39
+#define SERIO_DYNAPRO  0x3a
+#define SERIO_HAMPSHIRE        0x3b
+#define SERIO_PS2MULT  0x3c
+#define SERIO_TSC40    0x3d
+
+#endif /* _UAPI_SERIO_H */
diff --git a/include/uapi/linux/shm.h b/include/uapi/linux/shm.h
new file mode 100644 (file)
index 0000000..ec36fa1
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef _UAPI_LINUX_SHM_H_
+#define _UAPI_LINUX_SHM_H_
+
+#include <linux/ipc.h>
+#include <linux/errno.h>
+#ifndef __KERNEL__
+#include <unistd.h>
+#endif
+
+/*
+ * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
+ * be increased by sysctl
+ */
+
+#define SHMMAX 0x2000000                /* max shared seg size (bytes) */
+#define SHMMIN 1                        /* min shared seg size (bytes) */
+#define SHMMNI 4096                     /* max num of segs system wide */
+#ifndef __KERNEL__
+#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
+#endif
+#define SHMSEG SHMMNI                   /* max shared segs per process */
+
+
+/* Obsolete, used only for backwards compatibility and libc5 compiles */
+struct shmid_ds {
+       struct ipc_perm         shm_perm;       /* operation perms */
+       int                     shm_segsz;      /* size of segment (bytes) */
+       __kernel_time_t         shm_atime;      /* last attach time */
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       __kernel_time_t         shm_ctime;      /* last change time */
+       __kernel_ipc_pid_t      shm_cpid;       /* pid of creator */
+       __kernel_ipc_pid_t      shm_lpid;       /* pid of last operator */
+       unsigned short          shm_nattch;     /* no. of current attaches */
+       unsigned short          shm_unused;     /* compatibility */
+       void                    *shm_unused2;   /* ditto - used by DIPC */
+       void                    *shm_unused3;   /* unused */
+};
+
+/* Include the definition of shmid64_ds and shminfo64 */
+#include <asm/shmbuf.h>
+
+/* permission flag for shmget */
+#define SHM_R          0400    /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W          0200    /* or S_IWUGO from <linux/stat.h> */
+
+/* mode for attach */
+#define        SHM_RDONLY      010000  /* read-only access */
+#define        SHM_RND         020000  /* round attach address to SHMLBA boundary */
+#define        SHM_REMAP       040000  /* take-over region on attach */
+#define        SHM_EXEC        0100000 /* execution access */
+
+/* super user shmctl commands */
+#define SHM_LOCK       11
+#define SHM_UNLOCK     12
+
+/* ipcs ctl commands */
+#define SHM_STAT       13
+#define SHM_INFO       14
+
+/* Obsolete, used only for backwards compatibility */
+struct shminfo {
+       int shmmax;
+       int shmmin;
+       int shmmni;
+       int shmseg;
+       int shmall;
+};
+
+struct shm_info {
+       int used_ids;
+       unsigned long shm_tot;  /* total allocated shm */
+       unsigned long shm_rss;  /* total resident shm */
+       unsigned long shm_swp;  /* total swapped shm */
+       unsigned long swap_attempts;
+       unsigned long swap_successes;
+};
+
+
+#endif /* _UAPI_LINUX_SHM_H_ */
diff --git a/include/uapi/linux/signal.h b/include/uapi/linux/signal.h
new file mode 100644 (file)
index 0000000..dff452e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _UAPI_LINUX_SIGNAL_H
+#define _UAPI_LINUX_SIGNAL_H
+
+#include <asm/signal.h>
+#include <asm/siginfo.h>
+
+
+#endif /* _UAPI_LINUX_SIGNAL_H */
diff --git a/include/uapi/linux/signalfd.h b/include/uapi/linux/signalfd.h
new file mode 100644 (file)
index 0000000..492c6de
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  include/linux/signalfd.h
+ *
+ *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _UAPI_LINUX_SIGNALFD_H
+#define _UAPI_LINUX_SIGNALFD_H
+
+#include <linux/types.h>
+/* For O_CLOEXEC and O_NONBLOCK */
+#include <linux/fcntl.h>
+
+/* Flags for signalfd4.  */
+#define SFD_CLOEXEC O_CLOEXEC
+#define SFD_NONBLOCK O_NONBLOCK
+
+struct signalfd_siginfo {
+       __u32 ssi_signo;
+       __s32 ssi_errno;
+       __s32 ssi_code;
+       __u32 ssi_pid;
+       __u32 ssi_uid;
+       __s32 ssi_fd;
+       __u32 ssi_tid;
+       __u32 ssi_band;
+       __u32 ssi_overrun;
+       __u32 ssi_trapno;
+       __s32 ssi_status;
+       __s32 ssi_int;
+       __u64 ssi_ptr;
+       __u64 ssi_utime;
+       __u64 ssi_stime;
+       __u64 ssi_addr;
+       __u16 ssi_addr_lsb;
+
+       /*
+        * Pad strcture to 128 bytes. Remember to update the
+        * pad size when you add new members. We use a fixed
+        * size structure to avoid compatibility problems with
+        * future versions, and we leave extra space for additional
+        * members. We use fixed size members because this strcture
+        * comes out of a read(2) and we really don't want to have
+        * a compat on read(2).
+        */
+       __u8 __pad[46];
+};
+
+
+
+#endif /* _UAPI_LINUX_SIGNALFD_H */
diff --git a/include/uapi/linux/sock_diag.h b/include/uapi/linux/sock_diag.h
new file mode 100644 (file)
index 0000000..b00e29e
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _UAPI__SOCK_DIAG_H__
+#define _UAPI__SOCK_DIAG_H__
+
+#include <linux/types.h>
+
+#define SOCK_DIAG_BY_FAMILY 20
+
+struct sock_diag_req {
+       __u8    sdiag_family;
+       __u8    sdiag_protocol;
+};
+
+enum {
+       SK_MEMINFO_RMEM_ALLOC,
+       SK_MEMINFO_RCVBUF,
+       SK_MEMINFO_WMEM_ALLOC,
+       SK_MEMINFO_SNDBUF,
+       SK_MEMINFO_FWD_ALLOC,
+       SK_MEMINFO_WMEM_QUEUED,
+       SK_MEMINFO_OPTMEM,
+       SK_MEMINFO_BACKLOG,
+
+       SK_MEMINFO_VARS,
+};
+
+#endif /* _UAPI__SOCK_DIAG_H__ */
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
new file mode 100644 (file)
index 0000000..76ab0c6
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _UAPI_LINUX_SOCKET_H
+#define _UAPI_LINUX_SOCKET_H
+
+/*
+ * Desired design of maximum size and alignment (see RFC2553)
+ */
+#define _K_SS_MAXSIZE  128     /* Implementation specific max size */
+#define _K_SS_ALIGNSIZE        (__alignof__ (struct sockaddr *))
+                               /* Implementation specific desired alignment */
+
+typedef unsigned short __kernel_sa_family_t;
+
+struct __kernel_sockaddr_storage {
+       __kernel_sa_family_t    ss_family;              /* address family */
+       /* Following field(s) are implementation specific */
+       char            __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
+                               /* space to achieve desired size, */
+                               /* _SS_MAXSIZE value minus size of ss_family */
+} __attribute__ ((aligned(_K_SS_ALIGNSIZE)));  /* force desired alignment */
+
+#endif /* _UAPI_LINUX_SOCKET_H */
similarity index 100%
rename from include/linux/som.h
rename to include/uapi/linux/som.h
diff --git a/include/uapi/linux/sonet.h b/include/uapi/linux/sonet.h
new file mode 100644 (file)
index 0000000..cc54ace
--- /dev/null
@@ -0,0 +1,60 @@
+/* sonet.h - SONET/SHD physical layer control */
+/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+
+#ifndef _UAPILINUX_SONET_H
+#define _UAPILINUX_SONET_H
+
+#define __SONET_ITEMS \
+    __HANDLE_ITEM(section_bip);        /* section parity errors (B1) */ \
+    __HANDLE_ITEM(line_bip);           /* line parity errors (B2) */ \
+    __HANDLE_ITEM(path_bip);           /* path parity errors (B3) */ \
+    __HANDLE_ITEM(line_febe);          /* line parity errors at remote */ \
+    __HANDLE_ITEM(path_febe);          /* path parity errors at remote */ \
+    __HANDLE_ITEM(corr_hcs);           /* correctable header errors */ \
+    __HANDLE_ITEM(uncorr_hcs);         /* uncorrectable header errors */ \
+    __HANDLE_ITEM(tx_cells);           /* cells sent */ \
+    __HANDLE_ITEM(rx_cells);           /* cells received */
+
+struct sonet_stats {
+#define __HANDLE_ITEM(i) int i
+       __SONET_ITEMS
+#undef __HANDLE_ITEM
+} __attribute__ ((packed));
+
+
+#define SONET_GETSTAT  _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
+                                       /* get statistics */
+#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
+                                       /* ... and zero counters */
+#define SONET_SETDIAG  _IOWR('a',ATMIOC_PHYTYP+2,int)
+                                       /* set error insertion */
+#define SONET_CLRDIAG  _IOWR('a',ATMIOC_PHYTYP+3,int)
+                                       /* clear error insertion */
+#define SONET_GETDIAG  _IOR('a',ATMIOC_PHYTYP+4,int)
+                                       /* query error insertion */
+#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
+                                       /* set framing mode (SONET/SDH) */
+#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
+                                       /* get framing mode */
+#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
+  unsigned char[SONET_FRSENSE_SIZE])   /* get framing sense information */
+
+#define SONET_INS_SBIP   1             /* section BIP */
+#define SONET_INS_LBIP   2             /* line BIP */
+#define SONET_INS_PBIP   4             /* path BIP */
+#define SONET_INS_FRAME          8             /* out of frame */
+#define SONET_INS_LOS   16             /* set line to zero */
+#define SONET_INS_LAIS  32             /* line alarm indication signal */
+#define SONET_INS_PAIS  64             /* path alarm indication signal */
+#define SONET_INS_HCS  128             /* insert HCS error */
+
+#define SONET_FRAME_SONET 0            /* SONET STS-3 framing */
+#define SONET_FRAME_SDH   1            /* SDH STM-1 framing */
+
+#define SONET_FRSENSE_SIZE 6           /* C1[3],H1[3] (0xff for unknown) */
+
+
+
+#endif /* _UAPILINUX_SONET_H */
diff --git a/include/uapi/linux/sonypi.h b/include/uapi/linux/sonypi.h
new file mode 100644 (file)
index 0000000..85078a2
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Sony Programmable I/O Control Device driver for VAIO
+ *
+ * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
+ *
+ * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
+
+ * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
+ *
+ * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
+ *
+ * Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
+ *
+ * Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
+ *
+ * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
+ *
+ * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _UAPI_SONYPI_H_
+#define _UAPI_SONYPI_H_
+
+#include <linux/types.h>
+
+/* events the user application reading /dev/sonypi can use */
+
+#define SONYPI_EVENT_IGNORE                     0
+#define SONYPI_EVENT_JOGDIAL_DOWN               1
+#define SONYPI_EVENT_JOGDIAL_UP                         2
+#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED       3
+#define SONYPI_EVENT_JOGDIAL_UP_PRESSED                 4
+#define SONYPI_EVENT_JOGDIAL_PRESSED            5
+#define SONYPI_EVENT_JOGDIAL_RELEASED           6      /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PRESSED            7
+#define SONYPI_EVENT_CAPTURE_RELEASED           8      /* obsolete */
+#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED     9
+#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED   10
+#define SONYPI_EVENT_FNKEY_ESC                 11
+#define SONYPI_EVENT_FNKEY_F1                  12
+#define SONYPI_EVENT_FNKEY_F2                  13
+#define SONYPI_EVENT_FNKEY_F3                  14
+#define SONYPI_EVENT_FNKEY_F4                  15
+#define SONYPI_EVENT_FNKEY_F5                  16
+#define SONYPI_EVENT_FNKEY_F6                  17
+#define SONYPI_EVENT_FNKEY_F7                  18
+#define SONYPI_EVENT_FNKEY_F8                  19
+#define SONYPI_EVENT_FNKEY_F9                  20
+#define SONYPI_EVENT_FNKEY_F10                 21
+#define SONYPI_EVENT_FNKEY_F11                 22
+#define SONYPI_EVENT_FNKEY_F12                 23
+#define SONYPI_EVENT_FNKEY_1                   24
+#define SONYPI_EVENT_FNKEY_2                   25
+#define SONYPI_EVENT_FNKEY_D                   26
+#define SONYPI_EVENT_FNKEY_E                   27
+#define SONYPI_EVENT_FNKEY_F                   28
+#define SONYPI_EVENT_FNKEY_S                   29
+#define SONYPI_EVENT_FNKEY_B                   30
+#define SONYPI_EVENT_BLUETOOTH_PRESSED         31
+#define SONYPI_EVENT_PKEY_P1                   32
+#define SONYPI_EVENT_PKEY_P2                   33
+#define SONYPI_EVENT_PKEY_P3                   34
+#define SONYPI_EVENT_BACK_PRESSED              35
+#define SONYPI_EVENT_LID_CLOSED                        36
+#define SONYPI_EVENT_LID_OPENED                        37
+#define SONYPI_EVENT_BLUETOOTH_ON              38
+#define SONYPI_EVENT_BLUETOOTH_OFF             39
+#define SONYPI_EVENT_HELP_PRESSED              40
+#define SONYPI_EVENT_FNKEY_ONLY                        41
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN         42
+#define SONYPI_EVENT_JOGDIAL_FAST_UP           43
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
+#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED   45
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN                46
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP          47
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED        48
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED  49
+#define SONYPI_EVENT_ZOOM_PRESSED              50
+#define SONYPI_EVENT_THUMBPHRASE_PRESSED       51
+#define SONYPI_EVENT_MEYE_FACE                 52
+#define SONYPI_EVENT_MEYE_OPPOSITE             53
+#define SONYPI_EVENT_MEMORYSTICK_INSERT                54
+#define SONYPI_EVENT_MEMORYSTICK_EJECT         55
+#define SONYPI_EVENT_ANYBUTTON_RELEASED                56
+#define SONYPI_EVENT_BATTERY_INSERT            57
+#define SONYPI_EVENT_BATTERY_REMOVE            58
+#define SONYPI_EVENT_FNKEY_RELEASED            59
+#define SONYPI_EVENT_WIRELESS_ON               60
+#define SONYPI_EVENT_WIRELESS_OFF              61
+#define SONYPI_EVENT_ZOOM_IN_PRESSED           62
+#define SONYPI_EVENT_ZOOM_OUT_PRESSED          63
+#define SONYPI_EVENT_CD_EJECT_PRESSED          64
+#define SONYPI_EVENT_MODEKEY_PRESSED           65
+#define SONYPI_EVENT_PKEY_P4                   66
+#define SONYPI_EVENT_PKEY_P5                   67
+#define SONYPI_EVENT_SETTINGKEY_PRESSED                68
+#define SONYPI_EVENT_VOLUME_INC_PRESSED                69
+#define SONYPI_EVENT_VOLUME_DEC_PRESSED                70
+#define SONYPI_EVENT_BRIGHTNESS_PRESSED                71
+#define SONYPI_EVENT_MEDIA_PRESSED             72
+#define SONYPI_EVENT_VENDOR_PRESSED            73
+
+/* get/set brightness */
+#define SONYPI_IOCGBRT         _IOR('v', 0, __u8)
+#define SONYPI_IOCSBRT         _IOW('v', 0, __u8)
+
+/* get battery full capacity/remaining capacity */
+#define SONYPI_IOCGBAT1CAP     _IOR('v', 2, __u16)
+#define SONYPI_IOCGBAT1REM     _IOR('v', 3, __u16)
+#define SONYPI_IOCGBAT2CAP     _IOR('v', 4, __u16)
+#define SONYPI_IOCGBAT2REM     _IOR('v', 5, __u16)
+
+/* get battery flags: battery1/battery2/ac adapter present */
+#define SONYPI_BFLAGS_B1       0x01
+#define SONYPI_BFLAGS_B2       0x02
+#define SONYPI_BFLAGS_AC       0x04
+#define SONYPI_IOCGBATFLAGS    _IOR('v', 7, __u8)
+
+/* get/set bluetooth subsystem state on/off */
+#define SONYPI_IOCGBLUE                _IOR('v', 8, __u8)
+#define SONYPI_IOCSBLUE                _IOW('v', 9, __u8)
+
+/* get/set fan state on/off */
+#define SONYPI_IOCGFAN         _IOR('v', 10, __u8)
+#define SONYPI_IOCSFAN         _IOW('v', 11, __u8)
+
+/* get temperature (C) */
+#define SONYPI_IOCGTEMP                _IOR('v', 12, __u8)
+
+
+#endif /* _UAPI_SONYPI_H_ */
diff --git a/include/uapi/linux/sound.h b/include/uapi/linux/sound.h
new file mode 100644 (file)
index 0000000..014c911
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _UAPI_LINUX_SOUND_H
+#define _UAPI_LINUX_SOUND_H
+
+/*
+ * Minor numbers for the sound driver.
+ */
+
+#include <linux/fs.h>
+
+#define SND_DEV_CTL            0       /* Control port /dev/mixer */
+#define SND_DEV_SEQ            1       /* Sequencer output /dev/sequencer (FM
+                                               synthesizer and MIDI output) */
+#define SND_DEV_MIDIN          2       /* Raw midi access */
+#define SND_DEV_DSP            3       /* Digitized voice /dev/dsp */
+#define SND_DEV_AUDIO          4       /* Sparc compatible /dev/audio */
+#define SND_DEV_DSP16          5       /* Like /dev/dsp but 16 bits/sample */
+/* #define SND_DEV_STATUS      6 */    /* /dev/sndstat (obsolete) */
+#define SND_DEV_UNUSED         6
+#define SND_DEV_AWFM           7       /* Reserved */
+#define SND_DEV_SEQ2           8       /* /dev/sequencer, level 2 interface */
+/* #define SND_DEV_SNDPROC     9 */    /* /dev/sndproc for programmable devices (not used) */
+/* #define SND_DEV_DMMIDI      9 */
+#define SND_DEV_SYNTH          9       /* Raw synth access /dev/synth (same as /dev/dmfm) */
+#define SND_DEV_DMFM           10      /* Raw synth access /dev/dmfm */
+#define SND_DEV_UNKNOWN11      11
+#define SND_DEV_ADSP           12      /* Like /dev/dsp (obsolete) */
+#define SND_DEV_AMIDI          13      /* Like /dev/midi (obsolete) */
+#define SND_DEV_ADMMIDI                14      /* Like /dev/dmmidi (onsolete) */
+
+
+#endif /* _UAPI_LINUX_SOUND_H */
diff --git a/include/uapi/linux/soundcard.h b/include/uapi/linux/soundcard.h
new file mode 100644 (file)
index 0000000..f3b21f9
--- /dev/null
@@ -0,0 +1,1282 @@
+/*
+ * Copyright by Hannu Savolainen 1993-1997
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. 2.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifndef _UAPISOUNDCARD_H
+#define _UAPISOUNDCARD_H
+
+
+/*
+ * OSS interface version. With versions earlier than 3.6 this value is
+ * an integer with value less than 361. In versions 3.6 and later
+ * it's a six digit hexadecimal value. For example value
+ * of 0x030600 represents OSS version 3.6.0.
+ * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
+ * the currently active driver.
+ */
+#define SOUND_VERSION  0x030802
+#define OPEN_SOUND_SYSTEM
+
+/* In Linux we need to be prepared for cross compiling */
+#include <linux/ioctl.h>
+
+/* Endian macros. */
+#ifndef __KERNEL__
+#  include <endian.h>
+#endif
+
+/*
+ *     Supported card ID numbers (Should be somewhere else?)
+ */
+
+#define SNDCARD_ADLIB          1
+#define SNDCARD_SB             2
+#define SNDCARD_PAS            3
+#define SNDCARD_GUS            4
+#define SNDCARD_MPU401         5
+#define SNDCARD_SB16           6
+#define SNDCARD_SB16MIDI       7
+#define SNDCARD_UART6850       8
+#define SNDCARD_GUS16          9
+#define SNDCARD_MSS            10
+#define SNDCARD_PSS            11
+#define SNDCARD_SSCAPE         12
+#define SNDCARD_PSS_MPU        13
+#define SNDCARD_PSS_MSS        14
+#define SNDCARD_SSCAPE_MSS     15
+#define SNDCARD_TRXPRO         16
+#define SNDCARD_TRXPRO_SB      17
+#define SNDCARD_TRXPRO_MPU     18
+#define SNDCARD_MAD16          19
+#define SNDCARD_MAD16_MPU      20
+#define SNDCARD_CS4232         21
+#define SNDCARD_CS4232_MPU     22
+#define SNDCARD_MAUI           23
+#define SNDCARD_PSEUDO_MSS     24
+#define SNDCARD_GUSPNP         25
+#define SNDCARD_UART401                26
+/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
+
+/***********************************
+ * IOCTL Commands for /dev/sequencer
+ */
+
+#ifndef _SIOWR
+#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
+/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
+#define        SIOCPARM_MASK   IOCPARM_MASK
+#define        SIOC_VOID       IOC_VOID
+#define        SIOC_OUT        IOC_OUT
+#define        SIOC_IN         IOC_IN
+#define        SIOC_INOUT      IOC_INOUT
+#define _SIOC_SIZE     _IOC_SIZE
+#define _SIOC_DIR      _IOC_DIR
+#define _SIOC_NONE     _IOC_NONE
+#define _SIOC_READ     _IOC_READ
+#define _SIOC_WRITE    _IOC_WRITE
+#define        _SIO            _IO
+#define        _SIOR           _IOR
+#define        _SIOW           _IOW
+#define        _SIOWR          _IOWR
+#else
+
+/* Ioctl's have the command encoded in the lower word,
+ * and the size of any in or out parameters in the upper
+ * word.  The high 2 bits of the upper word are used
+ * to encode the in/out status of the parameter; for now
+ * we restrict parameters to at most 8191 bytes.
+ */
+/* #define     SIOCTYPE                (0xff<<8) */
+#define        SIOCPARM_MASK   0x1fff          /* parameters must be < 8192 bytes */
+#define        SIOC_VOID       0x00000000      /* no parameters */
+#define        SIOC_OUT        0x20000000      /* copy out parameters */
+#define        SIOC_IN         0x40000000      /* copy in parameters */
+#define        SIOC_INOUT      (SIOC_IN|SIOC_OUT)
+/* the 0x20000000 is so we can distinguish new ioctl's from old */
+#define        _SIO(x,y)       ((int)(SIOC_VOID|(x<<8)|y))
+#define        _SIOR(x,y,t)    ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define        _SIOW(x,y,t)    ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+/* this should be _SIORW, but stdio got there first */
+#define        _SIOWR(x,y,t)   ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOC_SIZE(x)  ((x>>16)&SIOCPARM_MASK) 
+#define _SIOC_DIR(x)   (x & 0xf0000000)
+#define _SIOC_NONE     SIOC_VOID
+#define _SIOC_READ     SIOC_OUT
+#define _SIOC_WRITE    SIOC_IN
+#  endif /* _IOWR */
+#endif  /* !_SIOWR */
+
+#define SNDCTL_SEQ_RESET               _SIO  ('Q', 0)
+#define SNDCTL_SEQ_SYNC                        _SIO  ('Q', 1)
+#define SNDCTL_SYNTH_INFO              _SIOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE            _SIOWR('Q', 3, int)     /* Set/get timer resolution (HZ) */
+#define SNDCTL_SEQ_GETOUTCOUNT         _SIOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT          _SIOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE            _SIOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR           _SIOW ('Q', 7, struct sbi_instrument)   /* Obsolete. Don't use!!!!!! */
+#define SNDCTL_SEQ_TESTMIDI            _SIOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES                _SIOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS            _SIOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS             _SIOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO               _SIOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD           _SIOW ('Q',13, int)
+#define SNDCTL_SYNTH_MEMAVL            _SIOWR('Q',14, int)     /* in=dev#, out=memsize */
+#define SNDCTL_FM_4OP_ENABLE           _SIOW ('Q',15, int)     /* in=dev# */
+#define SNDCTL_SEQ_PANIC               _SIO  ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND           _SIOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME             _SIOR ('Q',19, int)
+#define SNDCTL_SYNTH_ID                        _SIOWR('Q',20, struct synth_info)
+#define SNDCTL_SYNTH_CONTROL           _SIOWR('Q',21, struct synth_control)
+#define SNDCTL_SYNTH_REMOVESAMPLE      _SIOWR('Q',22, struct remove_sample)
+
+typedef struct synth_control
+{
+       int devno;      /* Synthesizer # */
+       char data[4000]; /* Device spesific command/data record */
+}synth_control;
+
+typedef struct remove_sample
+{
+       int devno;      /* Synthesizer # */
+       int bankno;     /* MIDI bank # (0=General MIDI) */
+       int instrno;    /* MIDI instrument number */
+} remove_sample;
+
+typedef struct seq_event_rec {
+               unsigned char arr[8];
+} seq_event_rec;
+
+#define SNDCTL_TMR_TIMEBASE            _SIOWR('T', 1, int)
+#define SNDCTL_TMR_START               _SIO  ('T', 2)
+#define SNDCTL_TMR_STOP                        _SIO  ('T', 3)
+#define SNDCTL_TMR_CONTINUE            _SIO  ('T', 4)
+#define SNDCTL_TMR_TEMPO               _SIOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE              _SIOWR('T', 6, int)
+#      define TMR_INTERNAL             0x00000001
+#      define TMR_EXTERNAL             0x00000002
+#              define TMR_MODE_MIDI    0x00000010
+#              define TMR_MODE_FSK     0x00000020
+#              define TMR_MODE_CLS     0x00000040
+#              define TMR_MODE_SMPTE   0x00000080
+#define SNDCTL_TMR_METRONOME           _SIOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT              _SIOW ('T', 8, int)
+
+/*
+ * Some big endian/little endian handling macros
+ */
+
+#define _LINUX_PATCHKEY_H_INDIRECT
+#include <linux/patchkey.h>
+#undef _LINUX_PATCHKEY_H_INDIRECT
+
+#if !defined(__KERNEL__)
+# if defined(__BYTE_ORDER)
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define AFMT_S16_NE AFMT_S16_BE
+#  elif __BYTE_ORDER == __LITTLE_ENDIAN
+#    define AFMT_S16_NE AFMT_S16_LE
+#  else
+#    error "could not determine byte order"
+#  endif
+# endif
+#endif
+
+/*
+ *     Sample loading mechanism for internal synthesizers (/dev/sequencer)
+ *     The following patch_info structure has been designed to support
+ *     Gravis UltraSound. It tries to be universal format for uploading
+ *     sample based patches but is probably too limited.
+ *
+ *      (PBD) As Hannu guessed, the GUS structure is too limited for 
+ *      the WaveFront, but this is the right place for a constant definition.
+ */
+
+struct patch_info {
+               unsigned short key;             /* Use WAVE_PATCH here */
+#define WAVE_PATCH        _PATCHKEY(0x04)
+#define GUS_PATCH         WAVE_PATCH
+#define WAVEFRONT_PATCH    _PATCHKEY(0x06)
+
+               short device_no;        /* Synthesizer number */
+               short instr_no;         /* Midi pgm# */
+
+               unsigned int mode;
+/*
+ * The least significant byte has the same format than the GUS .PAT
+ * files
+ */
+#define WAVE_16_BITS   0x01    /* bit 0 = 8 or 16 bit wave data. */
+#define WAVE_UNSIGNED  0x02    /* bit 1 = Signed - Unsigned data. */
+#define WAVE_LOOPING   0x04    /* bit 2 = looping enabled-1. */
+#define WAVE_BIDIR_LOOP        0x08    /* bit 3 = Set is bidirectional looping. */
+#define WAVE_LOOP_BACK 0x10    /* bit 4 = Set is looping backward. */
+#define WAVE_SUSTAIN_ON        0x20    /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
+#define WAVE_ENVELOPES 0x40    /* bit 6 = Enable envelopes - 1 */
+#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
+                               /*      (use the env_rate/env_offs fields). */
+/* Linux specific bits */
+#define WAVE_VIBRATO   0x00010000      /* The vibrato info is valid */
+#define WAVE_TREMOLO   0x00020000      /* The tremolo info is valid */
+#define WAVE_SCALE     0x00040000      /* The scaling info is valid */
+#define WAVE_FRACTIONS 0x00080000      /* Fraction information is valid */
+/* Reserved bits */
+#define WAVE_ROM       0x40000000      /* For future use */
+#define WAVE_MULAW     0x20000000      /* For future use */
+/* Other bits must be zeroed */
+
+               int len;        /* Size of the wave data in bytes */
+               int loop_start, loop_end; /* Byte offsets from the beginning */
+
+/* 
+ * The base_freq and base_note fields are used when computing the
+ * playback speed for a note. The base_note defines the tone frequency
+ * which is heard if the sample is played using the base_freq as the
+ * playback speed.
+ *
+ * The low_note and high_note fields define the minimum and maximum note
+ * frequencies for which this sample is valid. It is possible to define
+ * more than one samples for an instrument number at the same time. The
+ * low_note and high_note fields are used to select the most suitable one.
+ *
+ * The fields base_note, high_note and low_note should contain
+ * the note frequency multiplied by 1000. For example value for the
+ * middle A is 440*1000.
+ */
+
+               unsigned int base_freq;
+               unsigned int base_note;
+               unsigned int high_note;
+               unsigned int low_note;
+               int panning;    /* -128=left, 127=right */
+               int detuning;
+
+/*     New fields introduced in version 1.99.5 */
+
+       /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
+               unsigned char   env_rate[ 6 ];   /* GUS HW ramping rate */
+               unsigned char   env_offset[ 6 ]; /* 255 == 100% */
+
+       /* 
+        * The tremolo, vibrato and scale info are not supported yet.
+        * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
+        * WAVE_SCALE
+        */
+
+               unsigned char   tremolo_sweep;
+               unsigned char   tremolo_rate;
+               unsigned char   tremolo_depth;
+       
+               unsigned char   vibrato_sweep;
+               unsigned char   vibrato_rate;
+               unsigned char   vibrato_depth;
+
+               int             scale_frequency;
+               unsigned int    scale_factor;           /* from 0 to 2048 or 0 to 2 */
+       
+               int             volume;
+               int             fractions;
+               int             reserved1;
+               int             spare[2];
+               char data[1];   /* The waveform data starts here */
+       };
+
+struct sysex_info {
+               short key;              /* Use SYSEX_PATCH or MAUI_PATCH here */
+#define SYSEX_PATCH    _PATCHKEY(0x05)
+#define MAUI_PATCH     _PATCHKEY(0x06)
+               short device_no;        /* Synthesizer number */
+               int len;        /* Size of the sysex data in bytes */
+               unsigned char data[1];  /* Sysex data starts here */
+       };
+
+/*
+ * /dev/sequencer input events.
+ *
+ * The data written to the /dev/sequencer is a stream of events. Events
+ * are records of 4 or 8 bytes. The first byte defines the size. 
+ * Any number of events can be written with a write call. There
+ * is a set of macros for sending these events. Use these macros if you
+ * want to maximize portability of your program.
+ *
+ * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
+ * (All input events are currently 4 bytes long. Be prepared to support
+ * 8 byte events also. If you receive any event having first byte >= 128,
+ * it's a 8 byte event.
+ *
+ * The events are documented at the end of this file.
+ *
+ * Normal events (4 bytes)
+ * There is also a 8 byte version of most of the 4 byte events. The
+ * 8 byte one is recommended.
+ */
+#define SEQ_NOTEOFF            0
+#define SEQ_FMNOTEOFF          SEQ_NOTEOFF     /* Just old name */
+#define SEQ_NOTEON             1
+#define        SEQ_FMNOTEON            SEQ_NOTEON
+#define SEQ_WAIT               TMR_WAIT_ABS
+#define SEQ_PGMCHANGE          3
+#define SEQ_FMPGMCHANGE                SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER          TMR_START
+#define SEQ_MIDIPUTC           5
+#define SEQ_DRUMON             6       /*** OBSOLETE ***/
+#define SEQ_DRUMOFF            7       /*** OBSOLETE ***/
+#define SEQ_ECHO               TMR_ECHO        /* For synching programs with output */
+#define SEQ_AFTERTOUCH         9
+#define SEQ_CONTROLLER         10
+
+/*******************************************
+ *     Midi controller numbers
+ *******************************************
+ * Controllers 0 to 31 (0x00 to 0x1f) and
+ * 32 to 63 (0x20 to 0x3f) are continuous
+ * controllers.
+ * In the MIDI 1.0 these controllers are sent using
+ * two messages. Controller numbers 0 to 31 are used
+ * to send the MSB and the controller numbers 32 to 63
+ * are for the LSB. Note that just 7 bits are used in MIDI bytes.
+ */
+
+#define           CTL_BANK_SELECT              0x00
+#define           CTL_MODWHEEL                 0x01
+#define    CTL_BREATH                  0x02
+/*             undefined               0x03 */
+#define    CTL_FOOT                    0x04
+#define    CTL_PORTAMENTO_TIME         0x05
+#define    CTL_DATA_ENTRY              0x06
+#define    CTL_MAIN_VOLUME             0x07
+#define    CTL_BALANCE                 0x08
+/*             undefined               0x09 */
+#define    CTL_PAN                     0x0a
+#define    CTL_EXPRESSION              0x0b
+/*             undefined               0x0c */
+/*             undefined               0x0d */
+/*             undefined               0x0e */
+/*             undefined               0x0f */
+#define    CTL_GENERAL_PURPOSE1        0x10
+#define    CTL_GENERAL_PURPOSE2        0x11
+#define    CTL_GENERAL_PURPOSE3        0x12
+#define    CTL_GENERAL_PURPOSE4        0x13
+/*             undefined               0x14 - 0x1f */
+
+/*             undefined               0x20 */
+/* The controller numbers 0x21 to 0x3f are reserved for the */
+/* least significant bytes of the controllers 0x00 to 0x1f. */
+/* These controllers are not recognised by the driver. */
+
+/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
+/* 0=OFF and 127=ON (intermediate values are possible) */
+#define    CTL_DAMPER_PEDAL            0x40
+#define    CTL_SUSTAIN                 0x40    /* Alias */
+#define    CTL_HOLD                    0x40    /* Alias */
+#define    CTL_PORTAMENTO              0x41
+#define    CTL_SOSTENUTO               0x42
+#define    CTL_SOFT_PEDAL              0x43
+/*             undefined               0x44 */
+#define    CTL_HOLD2                   0x45
+/*             undefined               0x46 - 0x4f */
+
+#define    CTL_GENERAL_PURPOSE5        0x50
+#define    CTL_GENERAL_PURPOSE6        0x51
+#define    CTL_GENERAL_PURPOSE7        0x52
+#define    CTL_GENERAL_PURPOSE8        0x53
+/*             undefined               0x54 - 0x5a */
+#define    CTL_EXT_EFF_DEPTH           0x5b
+#define    CTL_TREMOLO_DEPTH           0x5c
+#define    CTL_CHORUS_DEPTH            0x5d
+#define    CTL_DETUNE_DEPTH            0x5e
+#define    CTL_CELESTE_DEPTH           0x5e    /* Alias for the above one */
+#define    CTL_PHASER_DEPTH            0x5f
+#define    CTL_DATA_INCREMENT          0x60
+#define    CTL_DATA_DECREMENT          0x61
+#define    CTL_NONREG_PARM_NUM_LSB     0x62
+#define    CTL_NONREG_PARM_NUM_MSB     0x63
+#define    CTL_REGIST_PARM_NUM_LSB     0x64
+#define    CTL_REGIST_PARM_NUM_MSB     0x65
+/*             undefined               0x66 - 0x78 */
+/*             reserved                0x79 - 0x7f */
+
+/* Pseudo controllers (not midi compatible) */
+#define    CTRL_PITCH_BENDER           255
+#define    CTRL_PITCH_BENDER_RANGE     254
+#define    CTRL_EXPRESSION             253     /* Obsolete */
+#define    CTRL_MAIN_VOLUME            252     /* Obsolete */
+#define SEQ_BALANCE            11
+#define SEQ_VOLMODE             12
+
+/*
+ * Volume mode decides how volumes are used
+ */
+
+#define VOL_METHOD_ADAGIO      1
+#define VOL_METHOD_LINEAR      2
+
+/*
+ * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
+ *      input events.
+ */
+
+/*
+ * Event codes 0xf0 to 0xfc are reserved for future extensions.
+ */
+
+#define SEQ_FULLSIZE           0xfd    /* Long events */
+/*
+ *     SEQ_FULLSIZE events are used for loading patches/samples to the
+ *     synthesizer devices. These events are passed directly to the driver
+ *     of the associated synthesizer device. There is no limit to the size
+ *     of the extended events. These events are not queued but executed
+ *     immediately when the write() is called (execution can take several
+ *     seconds of time). 
+ *
+ *     When a SEQ_FULLSIZE message is written to the device, it must
+ *     be written using exactly one write() call. Other events cannot
+ *     be mixed to the same write.
+ *     
+ *     For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the 
+ *     /dev/sequencer. Don't write other data together with the instrument structure
+ *     Set the key field of the structure to FM_PATCH. The device field is used to
+ *     route the patch to the corresponding device.
+ *
+ *     For wave table use struct patch_info. Initialize the key field
+ *      to WAVE_PATCH.
+ */
+#define SEQ_PRIVATE            0xfe    /* Low level HW dependent events (8 bytes) */
+#define SEQ_EXTENDED           0xff    /* Extended events (8 bytes) OBSOLETE */
+
+/*
+ * Record for FM patches
+ */
+
+typedef unsigned char sbi_instr_data[32];
+
+struct sbi_instrument {
+               unsigned short  key;    /* FM_PATCH or OPL3_PATCH */
+#define FM_PATCH       _PATCHKEY(0x01)
+#define OPL3_PATCH     _PATCHKEY(0x03)
+               short           device;         /*      Synth# (0-4)    */
+               int             channel;        /*      Program# to be initialized      */
+               sbi_instr_data  operators;      /*      Register settings for operator cells (.SBI format)      */
+       };
+
+struct synth_info {    /* Read only */
+               char    name[30];
+               int     device;         /* 0-N. INITIALIZE BEFORE CALLING */
+               int     synth_type;
+#define SYNTH_TYPE_FM                  0
+#define SYNTH_TYPE_SAMPLE              1
+#define SYNTH_TYPE_MIDI                        2       /* Midi interface */
+
+               int     synth_subtype;
+#define FM_TYPE_ADLIB                  0x00
+#define FM_TYPE_OPL3                   0x01
+#define MIDI_TYPE_MPU401               0x401
+
+#define SAMPLE_TYPE_BASIC              0x10
+#define SAMPLE_TYPE_GUS                        SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_WAVEFRONT           0x11
+
+               int     perc_mode;      /* No longer supported */
+               int     nr_voices;
+               int     nr_drums;       /* Obsolete field */
+               int     instr_bank_size;
+               unsigned int    capabilities;   
+#define SYNTH_CAP_PERCMODE             0x00000001 /* No longer used */
+#define SYNTH_CAP_OPL3                 0x00000002 /* Set if OPL3 supported */
+#define SYNTH_CAP_INPUT                        0x00000004 /* Input (MIDI) device */
+               int     dummies[19];    /* Reserve space */
+       };
+
+struct sound_timer_info {
+               char name[32];
+               int caps;
+       };
+
+#define MIDI_CAP_MPU401                1               /* MPU-401 intelligent mode */
+
+struct midi_info {
+               char            name[30];
+               int             device;         /* 0-N. INITIALIZE BEFORE CALLING */
+               unsigned int    capabilities;   /* To be defined later */
+               int             dev_type;
+               int             dummies[18];    /* Reserve space */
+       };
+
+/********************************************
+ * ioctl commands for the /dev/midi##
+ */
+typedef struct {
+               unsigned char cmd;
+               char nr_args, nr_returns;
+               unsigned char data[30];
+       } mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME            _SIOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE            _SIOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD             _SIOWR('m', 2, mpu_command_rec)
+
+/********************************************
+ * IOCTL commands for /dev/dsp and /dev/audio
+ */
+
+#define SNDCTL_DSP_RESET               _SIO  ('P', 0)
+#define SNDCTL_DSP_SYNC                        _SIO  ('P', 1)
+#define SNDCTL_DSP_SPEED               _SIOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO              _SIOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE          _SIOWR('P', 4, int)
+#define SNDCTL_DSP_SAMPLESIZE          SNDCTL_DSP_SETFMT
+#define SNDCTL_DSP_CHANNELS            _SIOWR('P', 6, int)
+#define SOUND_PCM_WRITE_CHANNELS       SNDCTL_DSP_CHANNELS
+#define SOUND_PCM_WRITE_FILTER         _SIOWR('P', 7, int)
+#define SNDCTL_DSP_POST                        _SIO  ('P', 8)
+#define SNDCTL_DSP_SUBDIVIDE           _SIOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT         _SIOWR('P',10, int)
+
+/*     Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
+#define SNDCTL_DSP_GETFMTS             _SIOR ('P',11, int) /* Returns a mask */
+#define SNDCTL_DSP_SETFMT              _SIOWR('P',5, int) /* Selects ONE fmt*/
+#      define AFMT_QUERY               0x00000000      /* Return current fmt */
+#      define AFMT_MU_LAW              0x00000001
+#      define AFMT_A_LAW               0x00000002
+#      define AFMT_IMA_ADPCM           0x00000004
+#      define AFMT_U8                  0x00000008
+#      define AFMT_S16_LE              0x00000010      /* Little endian signed 16*/
+#      define AFMT_S16_BE              0x00000020      /* Big endian signed 16 */
+#      define AFMT_S8                  0x00000040
+#      define AFMT_U16_LE              0x00000080      /* Little endian U16 */
+#      define AFMT_U16_BE              0x00000100      /* Big endian U16 */
+#      define AFMT_MPEG                0x00000200      /* MPEG (2) audio */
+#      define AFMT_AC3         0x00000400      /* Dolby Digital AC3 */
+
+/*
+ * Buffer status queries.
+ */
+typedef struct audio_buf_info {
+                       int fragments;  /* # of available fragments (partially usend ones not counted) */
+                       int fragstotal; /* Total # of fragments allocated */
+                       int fragsize;   /* Size of a fragment in bytes */
+
+                       int bytes;      /* Available space in bytes (includes partially used fragments) */
+                       /* Note! 'bytes' could be more than fragments*fragsize */
+               } audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE           _SIOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE           _SIOR ('P',13, audio_buf_info)
+#define SNDCTL_DSP_NONBLOCK            _SIO  ('P',14)
+#define SNDCTL_DSP_GETCAPS             _SIOR ('P',15, int)
+#      define DSP_CAP_REVISION         0x000000ff      /* Bits for revision level (0 to 255) */
+#      define DSP_CAP_DUPLEX           0x00000100      /* Full duplex record/playback */
+#      define DSP_CAP_REALTIME         0x00000200      /* Real time capability */
+#      define DSP_CAP_BATCH            0x00000400      /* Device has some kind of */
+                                                       /* internal buffers which may */
+                                                       /* cause some delays and */
+                                                       /* decrease precision of timing */
+#      define DSP_CAP_COPROC           0x00000800      /* Has a coprocessor */
+                                                       /* Sometimes it's a DSP */
+                                                       /* but usually not */
+#      define DSP_CAP_TRIGGER          0x00001000      /* Supports SETTRIGGER */
+#      define DSP_CAP_MMAP             0x00002000      /* Supports mmap() */
+#      define DSP_CAP_MULTI            0x00004000      /* support multiple open */
+#      define DSP_CAP_BIND             0x00008000      /* channel binding to front/rear/cneter/lfe */
+
+
+#define SNDCTL_DSP_GETTRIGGER          _SIOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER          _SIOW ('P',16, int)
+#      define PCM_ENABLE_INPUT         0x00000001
+#      define PCM_ENABLE_OUTPUT                0x00000002
+
+typedef struct count_info {
+               int bytes;      /* Total # of bytes processed */
+               int blocks;     /* # of fragment transitions since last time */
+               int ptr;        /* Current DMA pointer value */
+       } count_info;
+
+#define SNDCTL_DSP_GETIPTR             _SIOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR             _SIOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+               unsigned *buffer;
+               int size;
+       } buffmem_desc;
+#define SNDCTL_DSP_MAPINBUF            _SIOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF           _SIOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO           _SIO  ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX           _SIO  ('P', 22)
+#define SNDCTL_DSP_GETODELAY           _SIOR ('P', 23, int)
+
+#define SNDCTL_DSP_GETCHANNELMASK              _SIOWR('P', 64, int)
+#define SNDCTL_DSP_BIND_CHANNEL                _SIOWR('P', 65, int)
+#      define DSP_BIND_QUERY           0x00000000
+#      define DSP_BIND_FRONT           0x00000001
+#      define DSP_BIND_SURR            0x00000002
+#      define DSP_BIND_CENTER_LFE      0x00000004
+#      define DSP_BIND_HANDSET         0x00000008
+#      define DSP_BIND_MIC             0x00000010
+#      define DSP_BIND_MODEM1          0x00000020
+#      define DSP_BIND_MODEM2          0x00000040
+#      define DSP_BIND_I2S             0x00000080
+#      define DSP_BIND_SPDIF           0x00000100
+
+#define SNDCTL_DSP_SETSPDIF            _SIOW ('P', 66, int)
+#define SNDCTL_DSP_GETSPDIF            _SIOR ('P', 67, int)
+#      define SPDIF_PRO        0x0001
+#      define SPDIF_N_AUD      0x0002
+#      define SPDIF_COPY       0x0004
+#      define SPDIF_PRE        0x0008
+#      define SPDIF_CC         0x07f0
+#      define SPDIF_L          0x0800
+#      define SPDIF_DRS        0x4000
+#      define SPDIF_V          0x8000
+
+/*
+ * Application's profile defines the way how playback underrun situations should be handled.
+ * 
+ *     APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
+ *     playback buffer whenever an underrun occurs. This consumes some time
+ *     prevents looping the existing buffer.
+ *     APF_CPUINTENS is intended to be set by CPU intensive applications which
+ *     are likely to run out of time occasionally. In this mode the buffer cleanup is
+ *     disabled which saves CPU time but also let's the previous buffer content to
+ *     be played during the "pause" after the underrun.
+ */
+#define SNDCTL_DSP_PROFILE             _SIOW ('P', 23, int)
+#define          APF_NORMAL    0       /* Normal applications */
+#define          APF_NETWORK   1       /* Underruns probably caused by an "external" delay */
+#define   APF_CPUINTENS 2      /* Underruns probably caused by "overheating" the CPU */
+
+#define SOUND_PCM_READ_RATE            _SIOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS                _SIOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS            _SIOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER          _SIOR ('P', 7, int)
+
+/* Some alias names */
+#define SOUND_PCM_WRITE_BITS           SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_RATE           SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST                 SNDCTL_DSP_POST
+#define SOUND_PCM_RESET                        SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC                 SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE            SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT          SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS              SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_SETFMT               SNDCTL_DSP_SETFMT
+#define SOUND_PCM_GETOSPACE            SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE            SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK             SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS              SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER           SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER           SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO            SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR              SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR              SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF             SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF            SNDCTL_DSP_MAPOUTBUF
+
+/*
+ * ioctl calls to be used in communication with coprocessors and
+ * DSP chips.
+ */
+
+typedef struct copr_buffer {
+               int command;    /* Set to 0 if not used */
+               int flags;
+#define CPF_NONE               0x0000
+#define CPF_FIRST              0x0001  /* First block */
+#define CPF_LAST               0x0002  /* Last block */
+               int len;
+               int offs;       /* If required by the device (0 if not used) */
+
+               unsigned char data[4000]; /* NOTE! 4000 is not 4k */
+       } copr_buffer;
+
+typedef struct copr_debug_buf {
+               int command;    /* Used internally. Set to 0 */
+               int parm1;
+               int parm2;
+               int flags;      
+               int len;        /* Length of data in bytes */
+       } copr_debug_buf;
+
+typedef struct copr_msg {
+               int len;
+               unsigned char data[4000];
+       } copr_msg;
+
+#define SNDCTL_COPR_RESET             _SIO  ('C',  0)
+#define SNDCTL_COPR_LOAD             _SIOWR('C',  1, copr_buffer)
+#define SNDCTL_COPR_RDATA            _SIOWR('C',  2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE            _SIOWR('C',  3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA            _SIOW ('C',  4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE            _SIOW ('C',  5, copr_debug_buf)
+#define SNDCTL_COPR_RUN                      _SIOWR('C',  6, copr_debug_buf)
+#define SNDCTL_COPR_HALT             _SIOWR('C',  7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG          _SIOWR('C',  8, copr_msg)
+#define SNDCTL_COPR_RCVMSG           _SIOR ('C',  9, copr_msg)
+
+/*********************************************
+ * IOCTL commands for /dev/mixer
+ */
+       
+/* 
+ * Mixer devices
+ *
+ * There can be up to 20 different analog mixer channels. The
+ * SOUND_MIXER_NRDEVICES gives the currently supported maximum. 
+ * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
+ * the devices supported by the particular mixer.
+ */
+
+#define SOUND_MIXER_NRDEVICES  25
+#define SOUND_MIXER_VOLUME     0
+#define SOUND_MIXER_BASS       1
+#define SOUND_MIXER_TREBLE     2
+#define SOUND_MIXER_SYNTH      3
+#define SOUND_MIXER_PCM                4
+#define SOUND_MIXER_SPEAKER    5
+#define SOUND_MIXER_LINE       6
+#define SOUND_MIXER_MIC                7
+#define SOUND_MIXER_CD         8
+#define SOUND_MIXER_IMIX       9       /*  Recording monitor  */
+#define SOUND_MIXER_ALTPCM     10
+#define SOUND_MIXER_RECLEV     11      /* Recording level */
+#define SOUND_MIXER_IGAIN      12      /* Input gain */
+#define SOUND_MIXER_OGAIN      13      /* Output gain */
+/* 
+ * The AD1848 codec and compatibles have three line level inputs
+ * (line, aux1 and aux2). Since each card manufacturer have assigned
+ * different meanings to these inputs, it's inpractical to assign
+ * specific meanings (line, cd, synth etc.) to them.
+ */
+#define SOUND_MIXER_LINE1      14      /* Input source 1  (aux1) */
+#define SOUND_MIXER_LINE2      15      /* Input source 2  (aux2) */
+#define SOUND_MIXER_LINE3      16      /* Input source 3  (line) */
+#define SOUND_MIXER_DIGITAL1   17      /* Digital (input) 1 */
+#define SOUND_MIXER_DIGITAL2   18      /* Digital (input) 2 */
+#define SOUND_MIXER_DIGITAL3   19      /* Digital (input) 3 */
+#define SOUND_MIXER_PHONEIN    20      /* Phone input */
+#define SOUND_MIXER_PHONEOUT   21      /* Phone output */
+#define SOUND_MIXER_VIDEO      22      /* Video/TV (audio) in */
+#define SOUND_MIXER_RADIO      23      /* Radio in */
+#define SOUND_MIXER_MONITOR    24      /* Monitor (usually mic) volume */
+
+/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
+/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
+#define SOUND_ONOFF_MIN                28
+#define SOUND_ONOFF_MAX                30
+
+/* Note!       Number 31 cannot be used since the sign bit is reserved */
+#define SOUND_MIXER_NONE       31
+
+/*
+ * The following unsupported macros are no longer functional.
+ * Use SOUND_MIXER_PRIVATE# macros in future.
+ */
+#define SOUND_MIXER_ENHANCE    SOUND_MIXER_NONE
+#define SOUND_MIXER_MUTE       SOUND_MIXER_NONE
+#define SOUND_MIXER_LOUD       SOUND_MIXER_NONE
+
+
+#define SOUND_DEVICE_LABELS    {"Vol  ", "Bass ", "Trebl", "Synth", "Pcm  ", "Spkr ", "Line ", \
+                                "Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain", \
+                                "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
+                                "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES     {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
+                                "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
+                                "line1", "line2", "line3", "dig1", "dig2", "dig3", \
+                                "phin", "phout", "video", "radio", "monitor"}
+
+/*     Device bitmask identifiers      */
+
+#define SOUND_MIXER_RECSRC     0xff    /* Arg contains a bit for each recording source */
+#define SOUND_MIXER_DEVMASK    0xfe    /* Arg contains a bit for each supported device */
+#define SOUND_MIXER_RECMASK    0xfd    /* Arg contains a bit for each supported recording source */
+#define SOUND_MIXER_CAPS       0xfc
+#      define SOUND_CAP_EXCL_INPUT     0x00000001      /* Only one recording source at a time */
+#define SOUND_MIXER_STEREODEVS 0xfb    /* Mixer channels supporting stereo */
+#define SOUND_MIXER_OUTSRC     0xfa    /* Arg contains a bit for each input source to output */
+#define SOUND_MIXER_OUTMASK    0xf9    /* Arg contains a bit for each supported input source to output */
+
+/*     Device mask bits        */
+
+#define SOUND_MASK_VOLUME      (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS                (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE      (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH       (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM         (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER     (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE                (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC         (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD          (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX                (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM      (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV      (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN       (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN       (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1       (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2       (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3       (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1    (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2    (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3    (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN     (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT    (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO       (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO       (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR     (1 << SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MASK_MUTE                (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE     (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD                (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev)                _SIOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME                MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS          MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE                MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH         MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM           MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER       MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE          MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC           MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD            MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX          MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM                MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV                MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN         MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN         MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1         MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2         MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3         MIXER_READ(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_READ_MUTE          MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE       MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD          MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC                MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK       MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK       MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS    MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS          MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev)               _SIOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME       MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS         MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE       MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH                MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM          MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER      MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE         MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC          MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD           MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX         MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM       MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV       MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN                MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN                MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1                MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2                MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3                MIXER_WRITE(SOUND_MIXER_LINE3)
+
+/* Obsolete macros */
+#define SOUND_MIXER_WRITE_MUTE         MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE      MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD         MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC       MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info
+{
+  char id[16];
+  char name[32];
+  int  modify_counter;
+  int fillers[10];
+} mixer_info;
+
+typedef struct _old_mixer_info /* Obsolete */
+{
+  char id[16];
+  char name[32];
+} _old_mixer_info;
+
+#define SOUND_MIXER_INFO               _SIOR ('M', 101, mixer_info)
+#define SOUND_OLD_MIXER_INFO           _SIOR ('M', 101, _old_mixer_info)
+
+/*
+ * A mechanism for accessing "proprietary" mixer features. This method
+ * permits passing 128 bytes of arbitrary data between a mixer application
+ * and the mixer driver. Interpretation of the record is defined by
+ * the particular mixer driver.
+ */
+typedef unsigned char mixer_record[128];
+
+#define SOUND_MIXER_ACCESS             _SIOWR('M', 102, mixer_record)
+
+/*
+ * Two ioctls for special souncard function
+ */
+#define SOUND_MIXER_AGC  _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE  _SIOWR('M', 104, int)
+
+/*
+ * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
+ * These features can be used when accessing device specific features.
+ */
+#define SOUND_MIXER_PRIVATE1           _SIOWR('M', 111, int)
+#define SOUND_MIXER_PRIVATE2           _SIOWR('M', 112, int)
+#define SOUND_MIXER_PRIVATE3           _SIOWR('M', 113, int)
+#define SOUND_MIXER_PRIVATE4           _SIOWR('M', 114, int)
+#define SOUND_MIXER_PRIVATE5           _SIOWR('M', 115, int)
+
+/*
+ * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
+ * for querying current mixer settings from the driver and for loading
+ * default volume settings _prior_ activating the mixer (loading
+ * doesn't affect current state of the mixer hardware). These calls
+ * are for internal use only.
+ */
+
+typedef struct mixer_vol_table {
+  int num;     /* Index to volume table */
+  char name[32];
+  int levels[32];
+} mixer_vol_table;
+
+#define SOUND_MIXER_GETLEVELS          _SIOWR('M', 116, mixer_vol_table)
+#define SOUND_MIXER_SETLEVELS          _SIOWR('M', 117, mixer_vol_table)
+
+/* 
+ * An ioctl for identifying the driver version. It will return value
+ * of the SOUND_VERSION macro used when compiling the driver.
+ * This call was introduced in OSS version 3.6 and it will not work
+ * with earlier versions (returns EINVAL).
+ */
+#define OSS_GETVERSION                 _SIOR ('M', 118, int)
+
+/*
+ * Level 2 event types for /dev/sequencer
+ */
+
+/*
+ * The 4 most significant bits of byte 0 specify the class of
+ * the event: 
+ *
+ *     0x8X = system level events,
+ *     0x9X = device/port specific events, event[1] = device/port,
+ *             The last 4 bits give the subtype:
+ *                     0x02    = Channel event (event[3] = chn).
+ *                     0x01    = note event (event[4] = note).
+ *                     (0x01 is not used alone but always with bit 0x02).
+ *            event[2] = MIDI message code (0x80=note off etc.)
+ *
+ */
+
+#define EV_SEQ_LOCAL           0x80
+#define EV_TIMING              0x81
+#define EV_CHN_COMMON          0x92
+#define EV_CHN_VOICE           0x93
+#define EV_SYSEX               0x94
+/*
+ * Event types 200 to 220 are reserved for application use.
+ * These numbers will not be used by the driver.
+ */
+
+/*
+ * Events for event type EV_CHN_VOICE
+ */
+
+#define MIDI_NOTEOFF           0x80
+#define MIDI_NOTEON            0x90
+#define MIDI_KEY_PRESSURE      0xA0
+
+/*
+ * Events for event type EV_CHN_COMMON
+ */
+
+#define MIDI_CTL_CHANGE                0xB0
+#define MIDI_PGM_CHANGE                0xC0
+#define MIDI_CHN_PRESSURE      0xD0
+#define MIDI_PITCH_BEND                0xE0
+
+#define MIDI_SYSTEM_PREFIX     0xF0
+
+/*
+ * Timer event types
+ */
+#define TMR_WAIT_REL           1       /* Time relative to the prev time */
+#define TMR_WAIT_ABS           2       /* Absolute time since TMR_START */
+#define TMR_STOP               3
+#define TMR_START              4
+#define TMR_CONTINUE           5
+#define TMR_TEMPO              6
+#define TMR_ECHO               8
+#define TMR_CLOCK              9       /* MIDI clock */
+#define TMR_SPP                        10      /* Song position pointer */
+#define TMR_TIMESIG            11      /* Time signature */
+
+/*
+ *     Local event types
+ */
+#define LOCL_STARTAUDIO                1
+
+#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
+/*
+ *     Some convenience macros to simplify programming of the
+ *     /dev/sequencer interface
+ *
+ *     This is a legacy interface for applications written against
+ *     the OSSlib-3.8 style interface. It is no longer possible
+ *     to actually link against OSSlib with this header, but we
+ *     still provide these macros for programs using them.
+ *
+ *     If you want to use OSSlib, it is recommended that you get
+ *     the GPL version of OSS-4.x and build against that version
+ *     of the header.
+ *
+ *     We redefine the extern keyword so that make headers_check
+ *     does not complain about SEQ_USE_EXTBUF.
+ */
+#define SEQ_DECLAREBUF()               SEQ_USE_EXTBUF()
+
+void seqbuf_dump(void);        /* This function must be provided by programs */
+
+#define SEQ_PM_DEFINES int __foo_bar___
+
+#define SEQ_LOAD_GMINSTR(dev, instr)
+#define SEQ_LOAD_GMDRUM(dev, drum)
+
+#define _SEQ_EXTERN extern
+#define SEQ_USE_EXTBUF() \
+               _SEQ_EXTERN unsigned char _seqbuf[]; \
+               _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
+
+#ifndef USE_SIMPLE_MACROS
+/* Sample seqbuf_dump() implementation:
+ *
+ *     SEQ_DEFINEBUF (2048);   -- Defines a buffer for 2048 bytes
+ *
+ *     int seqfd;              -- The file descriptor for /dev/sequencer.
+ *
+ *     void
+ *     seqbuf_dump ()
+ *     {
+ *       if (_seqbufptr)
+ *         if (write (seqfd, _seqbuf, _seqbufptr) == -1)
+ *           {
+ *             perror ("write /dev/sequencer");
+ *             exit (-1);
+ *           }
+ *       _seqbufptr = 0;
+ *     }
+ */
+
+#define SEQ_DEFINEBUF(len)             unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define _SEQ_NEEDBUF(len)              if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
+#define _SEQ_ADVBUF(len)               _seqbufptr += len
+#define SEQ_DUMPBUF                    seqbuf_dump
+#else
+/*
+ * This variation of the sequencer macros is used just to format one event
+ * using fixed buffer.
+ * 
+ * The program using the macro library must define the following macros before
+ * using this library.
+ *
+ * #define _seqbuf              name of the buffer (unsigned char[]) 
+ * #define _SEQ_ADVBUF(len)     If the applic needs to know the exact
+ *                              size of the event, this macro can be used.
+ *                              Otherwise this must be defined as empty.
+ * #define _seqbufptr           Define the name of index variable or 0 if
+ *                              not required. 
+ */
+#define _SEQ_NEEDBUF(len)      /* empty */
+#endif
+
+#define SEQ_VOLUME_MODE(dev, mode)     {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+                                       _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
+                                       _seqbuf[_seqbufptr+2] = (dev);\
+                                       _seqbuf[_seqbufptr+3] = (mode);\
+                                       _seqbuf[_seqbufptr+4] = 0;\
+                                       _seqbuf[_seqbufptr+5] = 0;\
+                                       _seqbuf[_seqbufptr+6] = 0;\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+
+/*
+ * Midi voice messages
+ */
+
+#define _CHN_VOICE(dev, event, chn, note, parm) \
+                                       {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       _seqbuf[_seqbufptr+2] = (event);\
+                                       _seqbuf[_seqbufptr+3] = (chn);\
+                                       _seqbuf[_seqbufptr+4] = (note);\
+                                       _seqbuf[_seqbufptr+5] = (parm);\
+                                       _seqbuf[_seqbufptr+6] = (0);\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol) \
+               _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol) \
+               _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
+               _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+/*
+ * Midi channel messages
+ */
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
+                                       {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       _seqbuf[_seqbufptr+2] = (event);\
+                                       _seqbuf[_seqbufptr+3] = (chn);\
+                                       _seqbuf[_seqbufptr+4] = (p1);\
+                                       _seqbuf[_seqbufptr+5] = (p2);\
+                                       *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
+                                       _SEQ_ADVBUF(8);}
+/*
+ * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
+ * sending any MIDI bytes but it's absolutely not possible. Trying to do
+ * so _will_ cause problems with MPU401 intelligent mode).
+ *
+ * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be 
+ * sent by calling SEQ_SYSEX() several times (there must be no other events
+ * between them). First sysex fragment must have 0xf0 in the first byte
+ * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
+ * between these sysex start and end markers cannot be larger than 0x7f. Also
+ * lengths of each fragments (except the last one) must be 6.
+ *
+ * Breaking the above rules may work with some MIDI ports but is likely to
+ * cause fatal problems with some other devices (such as MPU401).
+ */
+#define SEQ_SYSEX(dev, buf, len) \
+                                       {int ii, ll=(len); \
+                                        unsigned char *bufp=buf;\
+                                        if (ll>6)ll=6;\
+                                       _SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = EV_SYSEX;\
+                                       _seqbuf[_seqbufptr+1] = (dev);\
+                                       for(ii=0;ii<ll;ii++)\
+                                          _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
+                                       for(ii=ll;ii<6;ii++)\
+                                          _seqbuf[_seqbufptr+ii+2] = 0xff;\
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
+               _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH SEQ_PGM_CHANGE
+#define SEQ_PGM_CHANGE(dev, chn, patch) \
+               _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+
+#define SEQ_CONTROL(dev, chn, controller, value) \
+               _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value) \
+               _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value)        {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+                                       _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
+                                       _seqbuf[_seqbufptr+2] = (dev);\
+                                       _seqbuf[_seqbufptr+3] = (voice);\
+                                       _seqbuf[_seqbufptr+4] = (controller);\
+                                       _seqbuf[_seqbufptr+5] = ((value)&0xff);\
+                                       _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
+                                       _seqbuf[_seqbufptr+7] = 0;\
+                                       _SEQ_ADVBUF(8);}
+/*
+ * The following 5 macros are incorrectly implemented and obsolete.
+ * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
+ */
+#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+/*
+ * Timing and synchronization macros
+ */
+
+#define _TIMER_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr+0] = EV_TIMING; \
+                                       _seqbuf[_seqbufptr+1] = (ev); \
+                                       _seqbuf[_seqbufptr+2] = 0;\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_START_TIMER()              _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER()               _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER()           _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks)           _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks)          _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key)             _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value)           _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos)               _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig)                _TIMER_EVENT(TMR_TIMESIG, sig)
+
+/*
+ * Local control events
+ */
+
+#define _LOCAL_EVENT(ev, parm)         {_SEQ_NEEDBUF(8);\
+                                       _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
+                                       _seqbuf[_seqbufptr+1] = (ev); \
+                                       _seqbuf[_seqbufptr+2] = 0;\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
+                                       _SEQ_ADVBUF(8);}
+
+#define SEQ_PLAYAUDIO(devmask)         _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+/*
+ * Events for the level 1 interface only 
+ */
+
+#define SEQ_MIDIOUT(device, byte)      {_SEQ_NEEDBUF(4);\
+                                       _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
+                                       _seqbuf[_seqbufptr+1] = (byte);\
+                                       _seqbuf[_seqbufptr+2] = (device);\
+                                       _seqbuf[_seqbufptr+3] = 0;\
+                                       _SEQ_ADVBUF(4);}
+
+/*
+ * Patch loading.
+ */
+#define SEQ_WRPATCH(patchx, len) \
+               {if (_seqbufptr) SEQ_DUMPBUF();\
+                if (write(seqfd, (char*)(patchx), len)==-1) \
+                   perror("Write patch: /dev/sequencer");}
+#define SEQ_WRPATCH2(patchx, len) \
+               (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
+
+#endif
+#endif /* _UAPISOUNDCARD_H */
index aafaa5aa54d46bb9a93a8137a22344408298223f..0cc747eff165543ce28d45b23f676ca754bc9984 100644 (file)
@@ -1 +1,2 @@
 # UAPI Header export list
+header-y += spidev.h
diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
new file mode 100644 (file)
index 0000000..7fec7e3
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef _UAPI_LINUX_STAT_H
+#define _UAPI_LINUX_STAT_H
+
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#define S_IFMT  00170000
+#define S_IFSOCK 0140000
+#define S_IFLNK         0120000
+#define S_IFREG  0100000
+#define S_IFBLK  0060000
+#define S_IFDIR  0040000
+#define S_IFCHR  0020000
+#define S_IFIFO  0010000
+#define S_ISUID  0004000
+#define S_ISGID  0002000
+#define S_ISVTX  0001000
+
+#define S_ISLNK(m)     (((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m)     (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m)     (((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m)     (((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m)     (((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m)    (((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m)    (((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#endif
+
+
+#endif /* _UAPI_LINUX_STAT_H */
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
new file mode 100644 (file)
index 0000000..aa9f104
--- /dev/null
@@ -0,0 +1 @@
+#include <linux/compiler.h>
diff --git a/include/uapi/linux/string.h b/include/uapi/linux/string.h
new file mode 100644 (file)
index 0000000..e32e545
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _UAPI_LINUX_STRING_H_
+#define _UAPI_LINUX_STRING_H_
+
+/* We don't want strings.h stuff being used by user stuff by accident */
+
+#ifndef __KERNEL__
+#include <string.h>
+#endif /* __KERNEL__ */
+#endif /* _UAPI_LINUX_STRING_H_ */
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
new file mode 100644 (file)
index 0000000..e811474
--- /dev/null
@@ -0,0 +1,282 @@
+#ifndef _UAPI_LINUX_SWAB_H
+#define _UAPI_LINUX_SWAB_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <asm/swab.h>
+
+/*
+ * casts are necessary for constants, because we never know how for sure
+ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ */
+#define ___constant_swab16(x) ((__u16)(                                \
+       (((__u16)(x) & (__u16)0x00ffU) << 8) |                  \
+       (((__u16)(x) & (__u16)0xff00U) >> 8)))
+
+#define ___constant_swab32(x) ((__u32)(                                \
+       (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
+       (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
+       (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
+       (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
+
+#define ___constant_swab64(x) ((__u64)(                                \
+       (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) |   \
+       (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) |   \
+       (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) |   \
+       (((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) |   \
+       (((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) |   \
+       (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) |   \
+       (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) |   \
+       (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
+
+#define ___constant_swahw32(x) ((__u32)(                       \
+       (((__u32)(x) & (__u32)0x0000ffffUL) << 16) |            \
+       (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
+
+#define ___constant_swahb32(x) ((__u32)(                       \
+       (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) |             \
+       (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
+
+/*
+ * Implement the following as inlines, but define the interface using
+ * macros to allow constant folding when possible:
+ * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
+ */
+
+static inline __attribute_const__ __u16 __fswab16(__u16 val)
+{
+#ifdef __arch_swab16
+       return __arch_swab16(val);
+#else
+       return ___constant_swab16(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 __fswab32(__u32 val)
+{
+#ifdef __arch_swab32
+       return __arch_swab32(val);
+#else
+       return ___constant_swab32(val);
+#endif
+}
+
+static inline __attribute_const__ __u64 __fswab64(__u64 val)
+{
+#ifdef __arch_swab64
+       return __arch_swab64(val);
+#elif defined(__SWAB_64_THRU_32__)
+       __u32 h = val >> 32;
+       __u32 l = val & ((1ULL << 32) - 1);
+       return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
+#else
+       return ___constant_swab64(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 __fswahw32(__u32 val)
+{
+#ifdef __arch_swahw32
+       return __arch_swahw32(val);
+#else
+       return ___constant_swahw32(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 __fswahb32(__u32 val)
+{
+#ifdef __arch_swahb32
+       return __arch_swahb32(val);
+#else
+       return ___constant_swahb32(val);
+#endif
+}
+
+/**
+ * __swab16 - return a byteswapped 16-bit value
+ * @x: value to byteswap
+ */
+#define __swab16(x)                            \
+       (__builtin_constant_p((__u16)(x)) ?     \
+       ___constant_swab16(x) :                 \
+       __fswab16(x))
+
+/**
+ * __swab32 - return a byteswapped 32-bit value
+ * @x: value to byteswap
+ */
+#define __swab32(x)                            \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       ___constant_swab32(x) :                 \
+       __fswab32(x))
+
+/**
+ * __swab64 - return a byteswapped 64-bit value
+ * @x: value to byteswap
+ */
+#define __swab64(x)                            \
+       (__builtin_constant_p((__u64)(x)) ?     \
+       ___constant_swab64(x) :                 \
+       __fswab64(x))
+
+/**
+ * __swahw32 - return a word-swapped 32-bit value
+ * @x: value to wordswap
+ *
+ * __swahw32(0x12340000) is 0x00001234
+ */
+#define __swahw32(x)                           \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       ___constant_swahw32(x) :                \
+       __fswahw32(x))
+
+/**
+ * __swahb32 - return a high and low byte-swapped 32-bit value
+ * @x: value to byteswap
+ *
+ * __swahb32(0x12345678) is 0x34127856
+ */
+#define __swahb32(x)                           \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       ___constant_swahb32(x) :                \
+       __fswahb32(x))
+
+/**
+ * __swab16p - return a byteswapped 16-bit value from a pointer
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static inline __u16 __swab16p(const __u16 *p)
+{
+#ifdef __arch_swab16p
+       return __arch_swab16p(p);
+#else
+       return __swab16(*p);
+#endif
+}
+
+/**
+ * __swab32p - return a byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static inline __u32 __swab32p(const __u32 *p)
+{
+#ifdef __arch_swab32p
+       return __arch_swab32p(p);
+#else
+       return __swab32(*p);
+#endif
+}
+
+/**
+ * __swab64p - return a byteswapped 64-bit value from a pointer
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static inline __u64 __swab64p(const __u64 *p)
+{
+#ifdef __arch_swab64p
+       return __arch_swab64p(p);
+#else
+       return __swab64(*p);
+#endif
+}
+
+/**
+ * __swahw32p - return a wordswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping.
+ */
+static inline __u32 __swahw32p(const __u32 *p)
+{
+#ifdef __arch_swahw32p
+       return __arch_swahw32p(p);
+#else
+       return __swahw32(*p);
+#endif
+}
+
+/**
+ * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high/low byteswapping.
+ */
+static inline __u32 __swahb32p(const __u32 *p)
+{
+#ifdef __arch_swahb32p
+       return __arch_swahb32p(p);
+#else
+       return __swahb32(*p);
+#endif
+}
+
+/**
+ * __swab16s - byteswap a 16-bit value in-place
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static inline void __swab16s(__u16 *p)
+{
+#ifdef __arch_swab16s
+       __arch_swab16s(p);
+#else
+       *p = __swab16p(p);
+#endif
+}
+/**
+ * __swab32s - byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static inline void __swab32s(__u32 *p)
+{
+#ifdef __arch_swab32s
+       __arch_swab32s(p);
+#else
+       *p = __swab32p(p);
+#endif
+}
+
+/**
+ * __swab64s - byteswap a 64-bit value in-place
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static inline void __swab64s(__u64 *p)
+{
+#ifdef __arch_swab64s
+       __arch_swab64s(p);
+#else
+       *p = __swab64p(p);
+#endif
+}
+
+/**
+ * __swahw32s - wordswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping
+ */
+static inline void __swahw32s(__u32 *p)
+{
+#ifdef __arch_swahw32s
+       __arch_swahw32s(p);
+#else
+       *p = __swahw32p(p);
+#endif
+}
+
+/**
+ * __swahb32s - high and low byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high and low byte swapping
+ */
+static inline void __swahb32s(__u32 *p)
+{
+#ifdef __arch_swahb32s
+       __arch_swahb32s(p);
+#else
+       *p = __swahb32p(p);
+#endif
+}
+
+
+#endif /* _UAPI_LINUX_SWAB_H */
diff --git a/include/uapi/linux/synclink.h b/include/uapi/linux/synclink.h
new file mode 100644 (file)
index 0000000..7dcb065
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * SyncLink Multiprotocol Serial Adapter Driver
+ *
+ * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
+ *
+ * Copyright (C) 1998-2000 by Microgate Corporation
+ *
+ * Redistribution of this file is permitted under
+ * the terms of the GNU Public License (GPL)
+ */
+
+#ifndef _UAPI_SYNCLINK_H_
+#define _UAPI_SYNCLINK_H_
+#define SYNCLINK_H_VERSION 3.6
+
+#include <linux/types.h>
+
+#define BIT0   0x0001
+#define BIT1   0x0002
+#define BIT2   0x0004
+#define BIT3   0x0008
+#define BIT4   0x0010
+#define BIT5   0x0020
+#define BIT6   0x0040
+#define BIT7   0x0080
+#define BIT8   0x0100
+#define BIT9   0x0200
+#define BIT10  0x0400
+#define BIT11  0x0800
+#define BIT12  0x1000
+#define BIT13  0x2000
+#define BIT14  0x4000
+#define BIT15  0x8000
+#define BIT16  0x00010000
+#define BIT17  0x00020000
+#define BIT18  0x00040000
+#define BIT19  0x00080000
+#define BIT20  0x00100000
+#define BIT21  0x00200000
+#define BIT22  0x00400000
+#define BIT23  0x00800000
+#define BIT24  0x01000000
+#define BIT25  0x02000000
+#define BIT26  0x04000000
+#define BIT27  0x08000000
+#define BIT28  0x10000000
+#define BIT29  0x20000000
+#define BIT30  0x40000000
+#define BIT31  0x80000000
+
+
+#define HDLC_MAX_FRAME_SIZE    65535
+#define MAX_ASYNC_TRANSMIT     4096
+#define MAX_ASYNC_BUFFER_SIZE  4096
+
+#define ASYNC_PARITY_NONE              0
+#define ASYNC_PARITY_EVEN              1
+#define ASYNC_PARITY_ODD               2
+#define ASYNC_PARITY_SPACE             3
+
+#define HDLC_FLAG_UNDERRUN_ABORT7      0x0000
+#define HDLC_FLAG_UNDERRUN_ABORT15     0x0001
+#define HDLC_FLAG_UNDERRUN_FLAG                0x0002
+#define HDLC_FLAG_UNDERRUN_CRC         0x0004
+#define HDLC_FLAG_SHARE_ZERO           0x0010
+#define HDLC_FLAG_AUTO_CTS             0x0020
+#define HDLC_FLAG_AUTO_DCD             0x0040
+#define HDLC_FLAG_AUTO_RTS             0x0080
+#define HDLC_FLAG_RXC_DPLL             0x0100
+#define HDLC_FLAG_RXC_BRG              0x0200
+#define HDLC_FLAG_RXC_TXCPIN           0x8000
+#define HDLC_FLAG_RXC_RXCPIN           0x0000
+#define HDLC_FLAG_TXC_DPLL             0x0400
+#define HDLC_FLAG_TXC_BRG              0x0800
+#define HDLC_FLAG_TXC_TXCPIN           0x0000
+#define HDLC_FLAG_TXC_RXCPIN           0x0008
+#define HDLC_FLAG_DPLL_DIV8            0x1000
+#define HDLC_FLAG_DPLL_DIV16           0x2000
+#define HDLC_FLAG_DPLL_DIV32           0x0000
+#define HDLC_FLAG_HDLC_LOOPMODE                0x4000
+
+#define HDLC_CRC_NONE                  0
+#define HDLC_CRC_16_CCITT              1
+#define HDLC_CRC_32_CCITT              2
+#define HDLC_CRC_MASK                  0x00ff
+#define HDLC_CRC_RETURN_EX             0x8000
+
+#define RX_OK                          0
+#define RX_CRC_ERROR                   1
+
+#define HDLC_TXIDLE_FLAGS              0
+#define HDLC_TXIDLE_ALT_ZEROS_ONES     1
+#define HDLC_TXIDLE_ZEROS              2
+#define HDLC_TXIDLE_ONES               3
+#define HDLC_TXIDLE_ALT_MARK_SPACE     4
+#define HDLC_TXIDLE_SPACE              5
+#define HDLC_TXIDLE_MARK               6
+#define HDLC_TXIDLE_CUSTOM_8            0x10000000
+#define HDLC_TXIDLE_CUSTOM_16           0x20000000
+
+#define HDLC_ENCODING_NRZ                      0
+#define HDLC_ENCODING_NRZB                     1
+#define HDLC_ENCODING_NRZI_MARK                        2
+#define HDLC_ENCODING_NRZI_SPACE               3
+#define HDLC_ENCODING_NRZI                     HDLC_ENCODING_NRZI_SPACE
+#define HDLC_ENCODING_BIPHASE_MARK             4
+#define HDLC_ENCODING_BIPHASE_SPACE            5
+#define HDLC_ENCODING_BIPHASE_LEVEL            6
+#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL       7
+
+#define HDLC_PREAMBLE_LENGTH_8BITS     0
+#define HDLC_PREAMBLE_LENGTH_16BITS    1
+#define HDLC_PREAMBLE_LENGTH_32BITS    2
+#define HDLC_PREAMBLE_LENGTH_64BITS    3
+
+#define HDLC_PREAMBLE_PATTERN_NONE     0
+#define HDLC_PREAMBLE_PATTERN_ZEROS    1
+#define HDLC_PREAMBLE_PATTERN_FLAGS    2
+#define HDLC_PREAMBLE_PATTERN_10       3
+#define HDLC_PREAMBLE_PATTERN_01       4
+#define HDLC_PREAMBLE_PATTERN_ONES     5
+
+#define MGSL_MODE_ASYNC                1
+#define MGSL_MODE_HDLC         2
+#define MGSL_MODE_MONOSYNC     3
+#define MGSL_MODE_BISYNC       4
+#define MGSL_MODE_RAW          6
+#define MGSL_MODE_BASE_CLOCK    7
+#define MGSL_MODE_XSYNC         8
+
+#define MGSL_BUS_TYPE_ISA      1
+#define MGSL_BUS_TYPE_EISA     2
+#define MGSL_BUS_TYPE_PCI      5
+
+#define MGSL_INTERFACE_MASK     0xf
+#define MGSL_INTERFACE_DISABLE  0
+#define MGSL_INTERFACE_RS232    1
+#define MGSL_INTERFACE_V35      2
+#define MGSL_INTERFACE_RS422    3
+#define MGSL_INTERFACE_RTS_EN   0x10
+#define MGSL_INTERFACE_LL       0x20
+#define MGSL_INTERFACE_RL       0x40
+#define MGSL_INTERFACE_MSB_FIRST 0x80
+
+typedef struct _MGSL_PARAMS
+{
+       /* Common */
+
+       unsigned long   mode;           /* Asynchronous or HDLC */
+       unsigned char   loopback;       /* internal loopback mode */
+
+       /* HDLC Only */
+
+       unsigned short  flags;
+       unsigned char   encoding;       /* NRZ, NRZI, etc. */
+       unsigned long   clock_speed;    /* external clock speed in bits per second */
+       unsigned char   addr_filter;    /* receive HDLC address filter, 0xFF = disable */
+       unsigned short  crc_type;       /* None, CRC16-CCITT, or CRC32-CCITT */
+       unsigned char   preamble_length;
+       unsigned char   preamble;
+
+       /* Async Only */
+
+       unsigned long   data_rate;      /* bits per second */
+       unsigned char   data_bits;      /* 7 or 8 data bits */
+       unsigned char   stop_bits;      /* 1 or 2 stop bits */
+       unsigned char   parity;         /* none, even, or odd */
+
+} MGSL_PARAMS, *PMGSL_PARAMS;
+
+#define MICROGATE_VENDOR_ID 0x13c0
+#define SYNCLINK_DEVICE_ID 0x0010
+#define MGSCC_DEVICE_ID 0x0020
+#define SYNCLINK_SCA_DEVICE_ID 0x0030
+#define SYNCLINK_GT_DEVICE_ID 0x0070
+#define SYNCLINK_GT4_DEVICE_ID 0x0080
+#define SYNCLINK_AC_DEVICE_ID  0x0090
+#define SYNCLINK_GT2_DEVICE_ID 0x00A0
+#define MGSL_MAX_SERIAL_NUMBER 30
+
+/*
+** device diagnostics status
+*/
+
+#define DiagStatus_OK                          0
+#define DiagStatus_AddressFailure              1
+#define DiagStatus_AddressConflict             2
+#define DiagStatus_IrqFailure                  3
+#define DiagStatus_IrqConflict                 4
+#define DiagStatus_DmaFailure                  5
+#define DiagStatus_DmaConflict                 6
+#define DiagStatus_PciAdapterNotFound          7
+#define DiagStatus_CantAssignPciResources      8
+#define DiagStatus_CantAssignPciMemAddr                9
+#define DiagStatus_CantAssignPciIoAddr         10
+#define DiagStatus_CantAssignPciIrq            11
+#define DiagStatus_MemoryError                 12
+
+#define SerialSignal_DCD            0x01     /* Data Carrier Detect */
+#define SerialSignal_TXD            0x02     /* Transmit Data */
+#define SerialSignal_RI             0x04     /* Ring Indicator */
+#define SerialSignal_RXD            0x08     /* Receive Data */
+#define SerialSignal_CTS            0x10     /* Clear to Send */
+#define SerialSignal_RTS            0x20     /* Request to Send */
+#define SerialSignal_DSR            0x40     /* Data Set Ready */
+#define SerialSignal_DTR            0x80     /* Data Terminal Ready */
+
+
+/*
+ * Counters of the input lines (CTS, DSR, RI, CD) interrupts
+ */
+struct mgsl_icount {
+       __u32   cts, dsr, rng, dcd, tx, rx;
+       __u32   frame, parity, overrun, brk;
+       __u32   buf_overrun;
+       __u32   txok;
+       __u32   txunder;
+       __u32   txabort;
+       __u32   txtimeout;
+       __u32   rxshort;
+       __u32   rxlong;
+       __u32   rxabort;
+       __u32   rxover;
+       __u32   rxcrc;
+       __u32   rxok;
+       __u32   exithunt;
+       __u32   rxidle;
+};
+
+struct gpio_desc {
+       __u32 state;
+       __u32 smask;
+       __u32 dir;
+       __u32 dmask;
+};
+
+#define DEBUG_LEVEL_DATA       1
+#define DEBUG_LEVEL_ERROR      2
+#define DEBUG_LEVEL_INFO       3
+#define DEBUG_LEVEL_BH         4
+#define DEBUG_LEVEL_ISR                5
+
+/*
+** Event bit flags for use with MgslWaitEvent
+*/
+
+#define MgslEvent_DsrActive    0x0001
+#define MgslEvent_DsrInactive  0x0002
+#define MgslEvent_Dsr          0x0003
+#define MgslEvent_CtsActive    0x0004
+#define MgslEvent_CtsInactive  0x0008
+#define MgslEvent_Cts          0x000c
+#define MgslEvent_DcdActive    0x0010
+#define MgslEvent_DcdInactive  0x0020
+#define MgslEvent_Dcd          0x0030
+#define MgslEvent_RiActive     0x0040
+#define MgslEvent_RiInactive   0x0080
+#define MgslEvent_Ri           0x00c0
+#define MgslEvent_ExitHuntMode 0x0100
+#define MgslEvent_IdleReceived 0x0200
+
+/* Private IOCTL codes:
+ *
+ * MGSL_IOCSPARAMS     set MGSL_PARAMS structure values
+ * MGSL_IOCGPARAMS     get current MGSL_PARAMS structure values
+ * MGSL_IOCSTXIDLE     set current transmit idle mode
+ * MGSL_IOCGTXIDLE     get current transmit idle mode
+ * MGSL_IOCTXENABLE    enable or disable transmitter
+ * MGSL_IOCRXENABLE    enable or disable receiver
+ * MGSL_IOCTXABORT     abort transmitting frame (HDLC)
+ * MGSL_IOCGSTATS      return current statistics
+ * MGSL_IOCWAITEVENT   wait for specified event to occur
+ * MGSL_LOOPTXDONE     transmit in HDLC LoopMode done
+ * MGSL_IOCSIF          set the serial interface type
+ * MGSL_IOCGIF          get the serial interface type
+ */
+#define MGSL_MAGIC_IOC 'm'
+#define MGSL_IOCSPARAMS                _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
+#define MGSL_IOCGPARAMS                _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
+#define MGSL_IOCSTXIDLE                _IO(MGSL_MAGIC_IOC,2)
+#define MGSL_IOCGTXIDLE                _IO(MGSL_MAGIC_IOC,3)
+#define MGSL_IOCTXENABLE       _IO(MGSL_MAGIC_IOC,4)
+#define MGSL_IOCRXENABLE       _IO(MGSL_MAGIC_IOC,5)
+#define MGSL_IOCTXABORT                _IO(MGSL_MAGIC_IOC,6)
+#define MGSL_IOCGSTATS         _IO(MGSL_MAGIC_IOC,7)
+#define MGSL_IOCWAITEVENT      _IOWR(MGSL_MAGIC_IOC,8,int)
+#define MGSL_IOCCLRMODCOUNT    _IO(MGSL_MAGIC_IOC,15)
+#define MGSL_IOCLOOPTXDONE     _IO(MGSL_MAGIC_IOC,9)
+#define MGSL_IOCSIF            _IO(MGSL_MAGIC_IOC,10)
+#define MGSL_IOCGIF            _IO(MGSL_MAGIC_IOC,11)
+#define MGSL_IOCSGPIO          _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
+#define MGSL_IOCGGPIO          _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
+#define MGSL_IOCWAITGPIO       _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
+#define MGSL_IOCSXSYNC         _IO(MGSL_MAGIC_IOC, 19)
+#define MGSL_IOCGXSYNC         _IO(MGSL_MAGIC_IOC, 20)
+#define MGSL_IOCSXCTRL         _IO(MGSL_MAGIC_IOC, 21)
+#define MGSL_IOCGXCTRL         _IO(MGSL_MAGIC_IOC, 22)
+
+
+#endif /* _UAPI_SYNCLINK_H_ */
diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
new file mode 100644 (file)
index 0000000..6d67213
--- /dev/null
@@ -0,0 +1,932 @@
+/*
+ * sysctl.h: General linux system control interface
+ *
+ * Begun 24 March 1995, Stephen Tweedie
+ *
+ ****************************************************************
+ ****************************************************************
+ **
+ **  WARNING:
+ **  The values in this file are exported to user space via 
+ **  the sysctl() binary interface.  Do *NOT* change the
+ **  numbering of any existing values here, and do not change
+ **  any numbers within any one set of values.  If you have to
+ **  redefine an existing interface, use a new number for it.
+ **  The kernel will then return -ENOTDIR to any application using
+ **  the old binary interface.
+ **
+ ****************************************************************
+ ****************************************************************
+ */
+
+#ifndef _UAPI_LINUX_SYSCTL_H
+#define _UAPI_LINUX_SYSCTL_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+struct completion;
+
+#define CTL_MAXNAME 10         /* how many path components do we allow in a
+                                  call to sysctl?   In other words, what is
+                                  the largest acceptable value for the nlen
+                                  member of a struct __sysctl_args to have? */
+
+struct __sysctl_args {
+       int __user *name;
+       int nlen;
+       void __user *oldval;
+       size_t __user *oldlenp;
+       void __user *newval;
+       size_t newlen;
+       unsigned long __unused[4];
+};
+
+/* Define sysctl names first */
+
+/* Top-level names: */
+
+enum
+{
+       CTL_KERN=1,             /* General kernel info and control */
+       CTL_VM=2,               /* VM management */
+       CTL_NET=3,              /* Networking */
+       CTL_PROC=4,             /* removal breaks strace(1) compilation */
+       CTL_FS=5,               /* Filesystems */
+       CTL_DEBUG=6,            /* Debugging */
+       CTL_DEV=7,              /* Devices */
+       CTL_BUS=8,              /* Busses */
+       CTL_ABI=9,              /* Binary emulation */
+       CTL_CPU=10,             /* CPU stuff (speed scaling, etc) */
+       CTL_ARLAN=254,          /* arlan wireless driver */
+       CTL_S390DBF=5677,       /* s390 debug */
+       CTL_SUNRPC=7249,        /* sunrpc debug */
+       CTL_PM=9899,            /* frv power management */
+       CTL_FRV=9898,           /* frv specific sysctls */
+};
+
+/* CTL_BUS names: */
+enum
+{
+       CTL_BUS_ISA=1           /* ISA */
+};
+
+/* /proc/sys/fs/inotify/ */
+enum
+{
+       INOTIFY_MAX_USER_INSTANCES=1,   /* max instances per user */
+       INOTIFY_MAX_USER_WATCHES=2,     /* max watches per user */
+       INOTIFY_MAX_QUEUED_EVENTS=3     /* max queued events per instance */
+};
+
+/* CTL_KERN names: */
+enum
+{
+       KERN_OSTYPE=1,          /* string: system version */
+       KERN_OSRELEASE=2,       /* string: system release */
+       KERN_OSREV=3,           /* int: system revision */
+       KERN_VERSION=4,         /* string: compile time info */
+       KERN_SECUREMASK=5,      /* struct: maximum rights mask */
+       KERN_PROF=6,            /* table: profiling information */
+       KERN_NODENAME=7,        /* string: hostname */
+       KERN_DOMAINNAME=8,      /* string: domainname */
+
+       KERN_PANIC=15,          /* int: panic timeout */
+       KERN_REALROOTDEV=16,    /* real root device to mount after initrd */
+
+       KERN_SPARC_REBOOT=21,   /* reboot command on Sparc */
+       KERN_CTLALTDEL=22,      /* int: allow ctl-alt-del to reboot */
+       KERN_PRINTK=23,         /* struct: control printk logging parameters */
+       KERN_NAMETRANS=24,      /* Name translation */
+       KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
+       KERN_PPC_ZEROPAGED=26,  /* turn idle page zeroing on/off on PPC */
+       KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
+       KERN_MODPROBE=28,       /* string: modprobe path */
+       KERN_SG_BIG_BUFF=29,    /* int: sg driver reserved buffer size */
+       KERN_ACCT=30,           /* BSD process accounting parameters */
+       KERN_PPC_L2CR=31,       /* l2cr register on PPC */
+
+       KERN_RTSIGNR=32,        /* Number of rt sigs queued */
+       KERN_RTSIGMAX=33,       /* Max queuable */
+       
+       KERN_SHMMAX=34,         /* long: Maximum shared memory segment */
+       KERN_MSGMAX=35,         /* int: Maximum size of a messege */
+       KERN_MSGMNB=36,         /* int: Maximum message queue size */
+       KERN_MSGPOOL=37,        /* int: Maximum system message pool size */
+       KERN_SYSRQ=38,          /* int: Sysreq enable */
+       KERN_MAX_THREADS=39,    /* int: Maximum nr of threads in the system */
+       KERN_RANDOM=40,         /* Random driver */
+       KERN_SHMALL=41,         /* int: Maximum size of shared memory */
+       KERN_MSGMNI=42,         /* int: msg queue identifiers */
+       KERN_SEM=43,            /* struct: sysv semaphore limits */
+       KERN_SPARC_STOP_A=44,   /* int: Sparc Stop-A enable */
+       KERN_SHMMNI=45,         /* int: shm array identifiers */
+       KERN_OVERFLOWUID=46,    /* int: overflow UID */
+       KERN_OVERFLOWGID=47,    /* int: overflow GID */
+       KERN_SHMPATH=48,        /* string: path to shm fs */
+       KERN_HOTPLUG=49,        /* string: path to uevent helper (deprecated) */
+       KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
+       KERN_S390_USER_DEBUG_LOGGING=51,  /* int: dumps of user faults */
+       KERN_CORE_USES_PID=52,          /* int: use core or core.%pid */
+       KERN_TAINTED=53,        /* int: various kernel tainted flags */
+       KERN_CADPID=54,         /* int: PID of the process to notify on CAD */
+       KERN_PIDMAX=55,         /* int: PID # limit */
+       KERN_CORE_PATTERN=56,   /* string: pattern for core-file names */
+       KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
+       KERN_HPPA_PWRSW=58,     /* int: hppa soft-power enable */
+       KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
+       KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
+       KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
+       KERN_PTY=62,            /* dir: pty driver */
+       KERN_NGROUPS_MAX=63,    /* int: NGROUPS_MAX */
+       KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
+       KERN_HZ_TIMER=65,       /* int: hz timer on or off */
+       KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
+       KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
+       KERN_RANDOMIZE=68, /* int: randomize virtual address space */
+       KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
+       KERN_SPIN_RETRY=70,     /* int: number of spinlock retries */
+       KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
+       KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
+       KERN_COMPAT_LOG=73,     /* int: print compat layer  messages */
+       KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
+       KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
+       KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
+};
+
+
+
+/* CTL_VM names: */
+enum
+{
+       VM_UNUSED1=1,           /* was: struct: Set vm swapping control */
+       VM_UNUSED2=2,           /* was; int: Linear or sqrt() swapout for hogs */
+       VM_UNUSED3=3,           /* was: struct: Set free page thresholds */
+       VM_UNUSED4=4,           /* Spare */
+       VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
+       VM_UNUSED5=6,           /* was: struct: Set buffer memory thresholds */
+       VM_UNUSED7=7,           /* was: struct: Set cache memory thresholds */
+       VM_UNUSED8=8,           /* was: struct: Control kswapd behaviour */
+       VM_UNUSED9=9,           /* was: struct: Set page table cache parameters */
+       VM_PAGE_CLUSTER=10,     /* int: set number of pages to swap together */
+       VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
+       VM_DIRTY_RATIO=12,      /* dirty_ratio */
+       VM_DIRTY_WB_CS=13,      /* dirty_writeback_centisecs */
+       VM_DIRTY_EXPIRE_CS=14,  /* dirty_expire_centisecs */
+       VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
+       VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
+       VM_PAGEBUF=17,          /* struct: Control pagebuf parameters */
+       VM_HUGETLB_PAGES=18,    /* int: Number of available Huge Pages */
+       VM_SWAPPINESS=19,       /* Tendency to steal mapped memory */
+       VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
+       VM_MIN_FREE_KBYTES=21,  /* Minimum free kilobytes to maintain */
+       VM_MAX_MAP_COUNT=22,    /* int: Maximum number of mmaps/address-space */
+       VM_LAPTOP_MODE=23,      /* vm laptop mode */
+       VM_BLOCK_DUMP=24,       /* block dump mode */
+       VM_HUGETLB_GROUP=25,    /* permitted hugetlb group */
+       VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
+       VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
+       VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
+       VM_DROP_PAGECACHE=29,   /* int: nuke lots of pagecache */
+       VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
+       VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
+       VM_MIN_UNMAPPED=32,     /* Set min percent of unmapped pages */
+       VM_PANIC_ON_OOM=33,     /* panic at out-of-memory */
+       VM_VDSO_ENABLED=34,     /* map VDSO into new processes? */
+       VM_MIN_SLAB=35,          /* Percent pages ignored by zone reclaim */
+};
+
+
+/* CTL_NET names: */
+enum
+{
+       NET_CORE=1,
+       NET_ETHER=2,
+       NET_802=3,
+       NET_UNIX=4,
+       NET_IPV4=5,
+       NET_IPX=6,
+       NET_ATALK=7,
+       NET_NETROM=8,
+       NET_AX25=9,
+       NET_BRIDGE=10,
+       NET_ROSE=11,
+       NET_IPV6=12,
+       NET_X25=13,
+       NET_TR=14,
+       NET_DECNET=15,
+       NET_ECONET=16,
+       NET_SCTP=17,
+       NET_LLC=18,
+       NET_NETFILTER=19,
+       NET_DCCP=20,
+       NET_IRDA=412,
+};
+
+/* /proc/sys/kernel/random */
+enum
+{
+       RANDOM_POOLSIZE=1,
+       RANDOM_ENTROPY_COUNT=2,
+       RANDOM_READ_THRESH=3,
+       RANDOM_WRITE_THRESH=4,
+       RANDOM_BOOT_ID=5,
+       RANDOM_UUID=6
+};
+
+/* /proc/sys/kernel/pty */
+enum
+{
+       PTY_MAX=1,
+       PTY_NR=2
+};
+
+/* /proc/sys/bus/isa */
+enum
+{
+       BUS_ISA_MEM_BASE=1,
+       BUS_ISA_PORT_BASE=2,
+       BUS_ISA_PORT_SHIFT=3
+};
+
+/* /proc/sys/net/core */
+enum
+{
+       NET_CORE_WMEM_MAX=1,
+       NET_CORE_RMEM_MAX=2,
+       NET_CORE_WMEM_DEFAULT=3,
+       NET_CORE_RMEM_DEFAULT=4,
+/* was NET_CORE_DESTROY_DELAY */
+       NET_CORE_MAX_BACKLOG=6,
+       NET_CORE_FASTROUTE=7,
+       NET_CORE_MSG_COST=8,
+       NET_CORE_MSG_BURST=9,
+       NET_CORE_OPTMEM_MAX=10,
+       NET_CORE_HOT_LIST_LENGTH=11,
+       NET_CORE_DIVERT_VERSION=12,
+       NET_CORE_NO_CONG_THRESH=13,
+       NET_CORE_NO_CONG=14,
+       NET_CORE_LO_CONG=15,
+       NET_CORE_MOD_CONG=16,
+       NET_CORE_DEV_WEIGHT=17,
+       NET_CORE_SOMAXCONN=18,
+       NET_CORE_BUDGET=19,
+       NET_CORE_AEVENT_ETIME=20,
+       NET_CORE_AEVENT_RSEQTH=21,
+       NET_CORE_WARNINGS=22,
+};
+
+/* /proc/sys/net/ethernet */
+
+/* /proc/sys/net/802 */
+
+/* /proc/sys/net/unix */
+
+enum
+{
+       NET_UNIX_DESTROY_DELAY=1,
+       NET_UNIX_DELETE_DELAY=2,
+       NET_UNIX_MAX_DGRAM_QLEN=3,
+};
+
+/* /proc/sys/net/netfilter */
+enum
+{
+       NET_NF_CONNTRACK_MAX=1,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+       NET_NF_CONNTRACK_UDP_TIMEOUT=10,
+       NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+       NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
+       NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+       NET_NF_CONNTRACK_BUCKETS=14,
+       NET_NF_CONNTRACK_LOG_INVALID=15,
+       NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+       NET_NF_CONNTRACK_TCP_LOOSE=17,
+       NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+       NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+       NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+       NET_NF_CONNTRACK_COUNT=27,
+       NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
+       NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
+       NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
+       NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
+       NET_NF_CONNTRACK_CHECKSUM=32,
+};
+
+/* /proc/sys/net/ipv4 */
+enum
+{
+       /* v2.0 compatibile variables */
+       NET_IPV4_FORWARD=8,
+       NET_IPV4_DYNADDR=9,
+
+       NET_IPV4_CONF=16,
+       NET_IPV4_NEIGH=17,
+       NET_IPV4_ROUTE=18,
+       NET_IPV4_FIB_HASH=19,
+       NET_IPV4_NETFILTER=20,
+
+       NET_IPV4_TCP_TIMESTAMPS=33,
+       NET_IPV4_TCP_WINDOW_SCALING=34,
+       NET_IPV4_TCP_SACK=35,
+       NET_IPV4_TCP_RETRANS_COLLAPSE=36,
+       NET_IPV4_DEFAULT_TTL=37,
+       NET_IPV4_AUTOCONFIG=38,
+       NET_IPV4_NO_PMTU_DISC=39,
+       NET_IPV4_TCP_SYN_RETRIES=40,
+       NET_IPV4_IPFRAG_HIGH_THRESH=41,
+       NET_IPV4_IPFRAG_LOW_THRESH=42,
+       NET_IPV4_IPFRAG_TIME=43,
+       NET_IPV4_TCP_MAX_KA_PROBES=44,
+       NET_IPV4_TCP_KEEPALIVE_TIME=45,
+       NET_IPV4_TCP_KEEPALIVE_PROBES=46,
+       NET_IPV4_TCP_RETRIES1=47,
+       NET_IPV4_TCP_RETRIES2=48,
+       NET_IPV4_TCP_FIN_TIMEOUT=49,
+       NET_IPV4_IP_MASQ_DEBUG=50,
+       NET_TCP_SYNCOOKIES=51,
+       NET_TCP_STDURG=52,
+       NET_TCP_RFC1337=53,
+       NET_TCP_SYN_TAILDROP=54,
+       NET_TCP_MAX_SYN_BACKLOG=55,
+       NET_IPV4_LOCAL_PORT_RANGE=56,
+       NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
+       NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
+       NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
+       NET_IPV4_ICMP_DESTUNREACH_RATE=60,
+       NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
+       NET_IPV4_ICMP_PARAMPROB_RATE=62,
+       NET_IPV4_ICMP_ECHOREPLY_RATE=63,
+       NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
+       NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
+       NET_TCP_TW_RECYCLE=66,
+       NET_IPV4_ALWAYS_DEFRAG=67,
+       NET_IPV4_TCP_KEEPALIVE_INTVL=68,
+       NET_IPV4_INET_PEER_THRESHOLD=69,
+       NET_IPV4_INET_PEER_MINTTL=70,
+       NET_IPV4_INET_PEER_MAXTTL=71,
+       NET_IPV4_INET_PEER_GC_MINTIME=72,
+       NET_IPV4_INET_PEER_GC_MAXTIME=73,
+       NET_TCP_ORPHAN_RETRIES=74,
+       NET_TCP_ABORT_ON_OVERFLOW=75,
+       NET_TCP_SYNACK_RETRIES=76,
+       NET_TCP_MAX_ORPHANS=77,
+       NET_TCP_MAX_TW_BUCKETS=78,
+       NET_TCP_FACK=79,
+       NET_TCP_REORDERING=80,
+       NET_TCP_ECN=81,
+       NET_TCP_DSACK=82,
+       NET_TCP_MEM=83,
+       NET_TCP_WMEM=84,
+       NET_TCP_RMEM=85,
+       NET_TCP_APP_WIN=86,
+       NET_TCP_ADV_WIN_SCALE=87,
+       NET_IPV4_NONLOCAL_BIND=88,
+       NET_IPV4_ICMP_RATELIMIT=89,
+       NET_IPV4_ICMP_RATEMASK=90,
+       NET_TCP_TW_REUSE=91,
+       NET_TCP_FRTO=92,
+       NET_TCP_LOW_LATENCY=93,
+       NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
+       NET_IPV4_IGMP_MAX_MSF=96,
+       NET_TCP_NO_METRICS_SAVE=97,
+       NET_TCP_DEFAULT_WIN_SCALE=105,
+       NET_TCP_MODERATE_RCVBUF=106,
+       NET_TCP_TSO_WIN_DIVISOR=107,
+       NET_TCP_BIC_BETA=108,
+       NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
+       NET_TCP_CONG_CONTROL=110,
+       NET_TCP_ABC=111,
+       NET_IPV4_IPFRAG_MAX_DIST=112,
+       NET_TCP_MTU_PROBING=113,
+       NET_TCP_BASE_MSS=114,
+       NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
+       NET_TCP_DMA_COPYBREAK=116,
+       NET_TCP_SLOW_START_AFTER_IDLE=117,
+       NET_CIPSOV4_CACHE_ENABLE=118,
+       NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
+       NET_CIPSOV4_RBM_OPTFMT=120,
+       NET_CIPSOV4_RBM_STRICTVALID=121,
+       NET_TCP_AVAIL_CONG_CONTROL=122,
+       NET_TCP_ALLOWED_CONG_CONTROL=123,
+       NET_TCP_MAX_SSTHRESH=124,
+       NET_TCP_FRTO_RESPONSE=125,
+};
+
+enum {
+       NET_IPV4_ROUTE_FLUSH=1,
+       NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
+       NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
+       NET_IPV4_ROUTE_GC_THRESH=4,
+       NET_IPV4_ROUTE_MAX_SIZE=5,
+       NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
+       NET_IPV4_ROUTE_GC_TIMEOUT=7,
+       NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
+       NET_IPV4_ROUTE_REDIRECT_LOAD=9,
+       NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
+       NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
+       NET_IPV4_ROUTE_ERROR_COST=12,
+       NET_IPV4_ROUTE_ERROR_BURST=13,
+       NET_IPV4_ROUTE_GC_ELASTICITY=14,
+       NET_IPV4_ROUTE_MTU_EXPIRES=15,
+       NET_IPV4_ROUTE_MIN_PMTU=16,
+       NET_IPV4_ROUTE_MIN_ADVMSS=17,
+       NET_IPV4_ROUTE_SECRET_INTERVAL=18,
+       NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
+};
+
+enum
+{
+       NET_PROTO_CONF_ALL=-2,
+       NET_PROTO_CONF_DEFAULT=-3
+
+       /* And device ifindices ... */
+};
+
+enum
+{
+       NET_IPV4_CONF_FORWARDING=1,
+       NET_IPV4_CONF_MC_FORWARDING=2,
+       NET_IPV4_CONF_PROXY_ARP=3,
+       NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
+       NET_IPV4_CONF_SECURE_REDIRECTS=5,
+       NET_IPV4_CONF_SEND_REDIRECTS=6,
+       NET_IPV4_CONF_SHARED_MEDIA=7,
+       NET_IPV4_CONF_RP_FILTER=8,
+       NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
+       NET_IPV4_CONF_BOOTP_RELAY=10,
+       NET_IPV4_CONF_LOG_MARTIANS=11,
+       NET_IPV4_CONF_TAG=12,
+       NET_IPV4_CONF_ARPFILTER=13,
+       NET_IPV4_CONF_MEDIUM_ID=14,
+       NET_IPV4_CONF_NOXFRM=15,
+       NET_IPV4_CONF_NOPOLICY=16,
+       NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
+       NET_IPV4_CONF_ARP_ANNOUNCE=18,
+       NET_IPV4_CONF_ARP_IGNORE=19,
+       NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
+       NET_IPV4_CONF_ARP_ACCEPT=21,
+       NET_IPV4_CONF_ARP_NOTIFY=22,
+};
+
+/* /proc/sys/net/ipv4/netfilter */
+enum
+{
+       NET_IPV4_NF_CONNTRACK_MAX=1,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+       NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
+       NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+       NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
+       NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+       NET_IPV4_NF_CONNTRACK_BUCKETS=14,
+       NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
+       NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+       NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
+       NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+       NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+       NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+       NET_IPV4_NF_CONNTRACK_COUNT=27,
+       NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
+};
+/* /proc/sys/net/ipv6 */
+enum {
+       NET_IPV6_CONF=16,
+       NET_IPV6_NEIGH=17,
+       NET_IPV6_ROUTE=18,
+       NET_IPV6_ICMP=19,
+       NET_IPV6_BINDV6ONLY=20,
+       NET_IPV6_IP6FRAG_HIGH_THRESH=21,
+       NET_IPV6_IP6FRAG_LOW_THRESH=22,
+       NET_IPV6_IP6FRAG_TIME=23,
+       NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
+       NET_IPV6_MLD_MAX_MSF=25,
+};
+
+enum {
+       NET_IPV6_ROUTE_FLUSH=1,
+       NET_IPV6_ROUTE_GC_THRESH=2,
+       NET_IPV6_ROUTE_MAX_SIZE=3,
+       NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
+       NET_IPV6_ROUTE_GC_TIMEOUT=5,
+       NET_IPV6_ROUTE_GC_INTERVAL=6,
+       NET_IPV6_ROUTE_GC_ELASTICITY=7,
+       NET_IPV6_ROUTE_MTU_EXPIRES=8,
+       NET_IPV6_ROUTE_MIN_ADVMSS=9,
+       NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
+};
+
+enum {
+       NET_IPV6_FORWARDING=1,
+       NET_IPV6_HOP_LIMIT=2,
+       NET_IPV6_MTU=3,
+       NET_IPV6_ACCEPT_RA=4,
+       NET_IPV6_ACCEPT_REDIRECTS=5,
+       NET_IPV6_AUTOCONF=6,
+       NET_IPV6_DAD_TRANSMITS=7,
+       NET_IPV6_RTR_SOLICITS=8,
+       NET_IPV6_RTR_SOLICIT_INTERVAL=9,
+       NET_IPV6_RTR_SOLICIT_DELAY=10,
+       NET_IPV6_USE_TEMPADDR=11,
+       NET_IPV6_TEMP_VALID_LFT=12,
+       NET_IPV6_TEMP_PREFERED_LFT=13,
+       NET_IPV6_REGEN_MAX_RETRY=14,
+       NET_IPV6_MAX_DESYNC_FACTOR=15,
+       NET_IPV6_MAX_ADDRESSES=16,
+       NET_IPV6_FORCE_MLD_VERSION=17,
+       NET_IPV6_ACCEPT_RA_DEFRTR=18,
+       NET_IPV6_ACCEPT_RA_PINFO=19,
+       NET_IPV6_ACCEPT_RA_RTR_PREF=20,
+       NET_IPV6_RTR_PROBE_INTERVAL=21,
+       NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
+       NET_IPV6_PROXY_NDP=23,
+       NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
+       __NET_IPV6_MAX
+};
+
+/* /proc/sys/net/ipv6/icmp */
+enum {
+       NET_IPV6_ICMP_RATELIMIT=1
+};
+
+/* /proc/sys/net/<protocol>/neigh/<dev> */
+enum {
+       NET_NEIGH_MCAST_SOLICIT=1,
+       NET_NEIGH_UCAST_SOLICIT=2,
+       NET_NEIGH_APP_SOLICIT=3,
+       NET_NEIGH_RETRANS_TIME=4,
+       NET_NEIGH_REACHABLE_TIME=5,
+       NET_NEIGH_DELAY_PROBE_TIME=6,
+       NET_NEIGH_GC_STALE_TIME=7,
+       NET_NEIGH_UNRES_QLEN=8,
+       NET_NEIGH_PROXY_QLEN=9,
+       NET_NEIGH_ANYCAST_DELAY=10,
+       NET_NEIGH_PROXY_DELAY=11,
+       NET_NEIGH_LOCKTIME=12,
+       NET_NEIGH_GC_INTERVAL=13,
+       NET_NEIGH_GC_THRESH1=14,
+       NET_NEIGH_GC_THRESH2=15,
+       NET_NEIGH_GC_THRESH3=16,
+       NET_NEIGH_RETRANS_TIME_MS=17,
+       NET_NEIGH_REACHABLE_TIME_MS=18,
+};
+
+/* /proc/sys/net/dccp */
+enum {
+       NET_DCCP_DEFAULT=1,
+};
+
+/* /proc/sys/net/ipx */
+enum {
+       NET_IPX_PPROP_BROADCASTING=1,
+       NET_IPX_FORWARDING=2
+};
+
+/* /proc/sys/net/llc */
+enum {
+       NET_LLC2=1,
+       NET_LLC_STATION=2,
+};
+
+/* /proc/sys/net/llc/llc2 */
+enum {
+       NET_LLC2_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/station */
+enum {
+       NET_LLC_STATION_ACK_TIMEOUT=1,
+};
+
+/* /proc/sys/net/llc/llc2/timeout */
+enum {
+       NET_LLC2_ACK_TIMEOUT=1,
+       NET_LLC2_P_TIMEOUT=2,
+       NET_LLC2_REJ_TIMEOUT=3,
+       NET_LLC2_BUSY_TIMEOUT=4,
+};
+
+/* /proc/sys/net/appletalk */
+enum {
+       NET_ATALK_AARP_EXPIRY_TIME=1,
+       NET_ATALK_AARP_TICK_TIME=2,
+       NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
+       NET_ATALK_AARP_RESOLVE_TIME=4
+};
+
+
+/* /proc/sys/net/netrom */
+enum {
+       NET_NETROM_DEFAULT_PATH_QUALITY=1,
+       NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
+       NET_NETROM_NETWORK_TTL_INITIALISER=3,
+       NET_NETROM_TRANSPORT_TIMEOUT=4,
+       NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
+       NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
+       NET_NETROM_TRANSPORT_BUSY_DELAY=7,
+       NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
+       NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
+       NET_NETROM_ROUTING_CONTROL=10,
+       NET_NETROM_LINK_FAILS_COUNT=11,
+       NET_NETROM_RESET=12
+};
+
+/* /proc/sys/net/ax25 */
+enum {
+       NET_AX25_IP_DEFAULT_MODE=1,
+       NET_AX25_DEFAULT_MODE=2,
+       NET_AX25_BACKOFF_TYPE=3,
+       NET_AX25_CONNECT_MODE=4,
+       NET_AX25_STANDARD_WINDOW=5,
+       NET_AX25_EXTENDED_WINDOW=6,
+       NET_AX25_T1_TIMEOUT=7,
+       NET_AX25_T2_TIMEOUT=8,
+       NET_AX25_T3_TIMEOUT=9,
+       NET_AX25_IDLE_TIMEOUT=10,
+       NET_AX25_N2=11,
+       NET_AX25_PACLEN=12,
+       NET_AX25_PROTOCOL=13,
+       NET_AX25_DAMA_SLAVE_TIMEOUT=14
+};
+
+/* /proc/sys/net/rose */
+enum {
+       NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
+       NET_ROSE_CALL_REQUEST_TIMEOUT=2,
+       NET_ROSE_RESET_REQUEST_TIMEOUT=3,
+       NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
+       NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
+       NET_ROSE_ROUTING_CONTROL=6,
+       NET_ROSE_LINK_FAIL_TIMEOUT=7,
+       NET_ROSE_MAX_VCS=8,
+       NET_ROSE_WINDOW_SIZE=9,
+       NET_ROSE_NO_ACTIVITY_TIMEOUT=10
+};
+
+/* /proc/sys/net/x25 */
+enum {
+       NET_X25_RESTART_REQUEST_TIMEOUT=1,
+       NET_X25_CALL_REQUEST_TIMEOUT=2,
+       NET_X25_RESET_REQUEST_TIMEOUT=3,
+       NET_X25_CLEAR_REQUEST_TIMEOUT=4,
+       NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
+       NET_X25_FORWARD=6
+};
+
+/* /proc/sys/net/token-ring */
+enum
+{
+       NET_TR_RIF_TIMEOUT=1
+};
+
+/* /proc/sys/net/decnet/ */
+enum {
+       NET_DECNET_NODE_TYPE = 1,
+       NET_DECNET_NODE_ADDRESS = 2,
+       NET_DECNET_NODE_NAME = 3,
+       NET_DECNET_DEFAULT_DEVICE = 4,
+       NET_DECNET_TIME_WAIT = 5,
+       NET_DECNET_DN_COUNT = 6,
+       NET_DECNET_DI_COUNT = 7,
+       NET_DECNET_DR_COUNT = 8,
+       NET_DECNET_DST_GC_INTERVAL = 9,
+       NET_DECNET_CONF = 10,
+       NET_DECNET_NO_FC_MAX_CWND = 11,
+       NET_DECNET_MEM = 12,
+       NET_DECNET_RMEM = 13,
+       NET_DECNET_WMEM = 14,
+       NET_DECNET_DEBUG_LEVEL = 255
+};
+
+/* /proc/sys/net/decnet/conf/<dev> */
+enum {
+       NET_DECNET_CONF_LOOPBACK = -2,
+       NET_DECNET_CONF_DDCMP = -3,
+       NET_DECNET_CONF_PPP = -4,
+       NET_DECNET_CONF_X25 = -5,
+       NET_DECNET_CONF_GRE = -6,
+       NET_DECNET_CONF_ETHER = -7
+
+       /* ... and ifindex of devices */
+};
+
+/* /proc/sys/net/decnet/conf/<dev>/ */
+enum {
+       NET_DECNET_CONF_DEV_PRIORITY = 1,
+       NET_DECNET_CONF_DEV_T1 = 2,
+       NET_DECNET_CONF_DEV_T2 = 3,
+       NET_DECNET_CONF_DEV_T3 = 4,
+       NET_DECNET_CONF_DEV_FORWARDING = 5,
+       NET_DECNET_CONF_DEV_BLKSIZE = 6,
+       NET_DECNET_CONF_DEV_STATE = 7
+};
+
+/* /proc/sys/net/sctp */
+enum {
+       NET_SCTP_RTO_INITIAL = 1,
+       NET_SCTP_RTO_MIN     = 2,
+       NET_SCTP_RTO_MAX     = 3,
+       NET_SCTP_RTO_ALPHA   = 4,
+       NET_SCTP_RTO_BETA    = 5,
+       NET_SCTP_VALID_COOKIE_LIFE       =  6,
+       NET_SCTP_ASSOCIATION_MAX_RETRANS =  7,
+       NET_SCTP_PATH_MAX_RETRANS        =  8,
+       NET_SCTP_MAX_INIT_RETRANSMITS    =  9,
+       NET_SCTP_HB_INTERVAL             = 10,
+       NET_SCTP_PRESERVE_ENABLE         = 11,
+       NET_SCTP_MAX_BURST               = 12,
+       NET_SCTP_ADDIP_ENABLE            = 13,
+       NET_SCTP_PRSCTP_ENABLE           = 14,
+       NET_SCTP_SNDBUF_POLICY           = 15,
+       NET_SCTP_SACK_TIMEOUT            = 16,
+       NET_SCTP_RCVBUF_POLICY           = 17,
+};
+
+/* /proc/sys/net/bridge */
+enum {
+       NET_BRIDGE_NF_CALL_ARPTABLES = 1,
+       NET_BRIDGE_NF_CALL_IPTABLES = 2,
+       NET_BRIDGE_NF_CALL_IP6TABLES = 3,
+       NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
+       NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
+};
+
+/* proc/sys/net/irda */
+enum {
+       NET_IRDA_DISCOVERY=1,
+       NET_IRDA_DEVNAME=2,
+       NET_IRDA_DEBUG=3,
+       NET_IRDA_FAST_POLL=4,
+       NET_IRDA_DISCOVERY_SLOTS=5,
+       NET_IRDA_DISCOVERY_TIMEOUT=6,
+       NET_IRDA_SLOT_TIMEOUT=7,
+       NET_IRDA_MAX_BAUD_RATE=8,
+       NET_IRDA_MIN_TX_TURN_TIME=9,
+       NET_IRDA_MAX_TX_DATA_SIZE=10,
+       NET_IRDA_MAX_TX_WINDOW=11,
+       NET_IRDA_MAX_NOREPLY_TIME=12,
+       NET_IRDA_WARN_NOREPLY_TIME=13,
+       NET_IRDA_LAP_KEEPALIVE_TIME=14,
+};
+
+
+/* CTL_FS names: */
+enum
+{
+       FS_NRINODE=1,   /* int:current number of allocated inodes */
+       FS_STATINODE=2,
+       FS_MAXINODE=3,  /* int:maximum number of inodes that can be allocated */
+       FS_NRDQUOT=4,   /* int:current number of allocated dquots */
+       FS_MAXDQUOT=5,  /* int:maximum number of dquots that can be allocated */
+       FS_NRFILE=6,    /* int:current number of allocated filedescriptors */
+       FS_MAXFILE=7,   /* int:maximum number of filedescriptors that can be allocated */
+       FS_DENTRY=8,
+       FS_NRSUPER=9,   /* int:current number of allocated super_blocks */
+       FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
+       FS_OVERFLOWUID=11,      /* int: overflow UID */
+       FS_OVERFLOWGID=12,      /* int: overflow GID */
+       FS_LEASES=13,   /* int: leases enabled */
+       FS_DIR_NOTIFY=14,       /* int: directory notification enabled */
+       FS_LEASE_TIME=15,       /* int: maximum time to wait for a lease break */
+       FS_DQSTATS=16,  /* disc quota usage statistics and control */
+       FS_XFS=17,      /* struct: control xfs parameters */
+       FS_AIO_NR=18,   /* current system-wide number of aio requests */
+       FS_AIO_MAX_NR=19,       /* system-wide maximum number of aio requests */
+       FS_INOTIFY=20,  /* inotify submenu */
+       FS_OCFS2=988,   /* ocfs2 */
+};
+
+/* /proc/sys/fs/quota/ */
+enum {
+       FS_DQ_LOOKUPS = 1,
+       FS_DQ_DROPS = 2,
+       FS_DQ_READS = 3,
+       FS_DQ_WRITES = 4,
+       FS_DQ_CACHE_HITS = 5,
+       FS_DQ_ALLOCATED = 6,
+       FS_DQ_FREE = 7,
+       FS_DQ_SYNCS = 8,
+       FS_DQ_WARNINGS = 9,
+};
+
+/* CTL_DEBUG names: */
+
+/* CTL_DEV names: */
+enum {
+       DEV_CDROM=1,
+       DEV_HWMON=2,
+       DEV_PARPORT=3,
+       DEV_RAID=4,
+       DEV_MAC_HID=5,
+       DEV_SCSI=6,
+       DEV_IPMI=7,
+};
+
+/* /proc/sys/dev/cdrom */
+enum {
+       DEV_CDROM_INFO=1,
+       DEV_CDROM_AUTOCLOSE=2,
+       DEV_CDROM_AUTOEJECT=3,
+       DEV_CDROM_DEBUG=4,
+       DEV_CDROM_LOCK=5,
+       DEV_CDROM_CHECK_MEDIA=6
+};
+
+/* /proc/sys/dev/parport */
+enum {
+       DEV_PARPORT_DEFAULT=-3
+};
+
+/* /proc/sys/dev/raid */
+enum {
+       DEV_RAID_SPEED_LIMIT_MIN=1,
+       DEV_RAID_SPEED_LIMIT_MAX=2
+};
+
+/* /proc/sys/dev/parport/default */
+enum {
+       DEV_PARPORT_DEFAULT_TIMESLICE=1,
+       DEV_PARPORT_DEFAULT_SPINTIME=2
+};
+
+/* /proc/sys/dev/parport/parport n */
+enum {
+       DEV_PARPORT_SPINTIME=1,
+       DEV_PARPORT_BASE_ADDR=2,
+       DEV_PARPORT_IRQ=3,
+       DEV_PARPORT_DMA=4,
+       DEV_PARPORT_MODES=5,
+       DEV_PARPORT_DEVICES=6,
+       DEV_PARPORT_AUTOPROBE=16
+};
+
+/* /proc/sys/dev/parport/parport n/devices/ */
+enum {
+       DEV_PARPORT_DEVICES_ACTIVE=-3,
+};
+
+/* /proc/sys/dev/parport/parport n/devices/device n */
+enum {
+       DEV_PARPORT_DEVICE_TIMESLICE=1,
+};
+
+/* /proc/sys/dev/mac_hid */
+enum {
+       DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
+       DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
+       DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
+       DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
+       DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
+       DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
+};
+
+/* /proc/sys/dev/scsi */
+enum {
+       DEV_SCSI_LOGGING_LEVEL=1,
+};
+
+/* /proc/sys/dev/ipmi */
+enum {
+       DEV_IPMI_POWEROFF_POWERCYCLE=1,
+};
+
+/* /proc/sys/abi */
+enum
+{
+       ABI_DEFHANDLER_COFF=1,  /* default handler for coff binaries */
+       ABI_DEFHANDLER_ELF=2,   /* default handler for ELF binaries */
+       ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
+       ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
+       ABI_TRACE=5,            /* tracing flags */
+       ABI_FAKE_UTSNAME=6,     /* fake target utsname information */
+};
+
+
+#endif /* _UAPI_LINUX_SYSCTL_H */
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
new file mode 100644 (file)
index 0000000..c4b89a5
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions for the TCP protocol.
+ *
+ * Version:    @(#)tcp.h       1.0.2   04/28/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_TCP_H
+#define _UAPI_LINUX_TCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <linux/socket.h>
+
+struct tcphdr {
+       __be16  source;
+       __be16  dest;
+       __be32  seq;
+       __be32  ack_seq;
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+       __u16   res1:4,
+               doff:4,
+               fin:1,
+               syn:1,
+               rst:1,
+               psh:1,
+               ack:1,
+               urg:1,
+               ece:1,
+               cwr:1;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+       __u16   doff:4,
+               res1:4,
+               cwr:1,
+               ece:1,
+               urg:1,
+               ack:1,
+               psh:1,
+               rst:1,
+               syn:1,
+               fin:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif 
+       __be16  window;
+       __sum16 check;
+       __be16  urg_ptr;
+};
+
+/*
+ *     The union cast uses a gcc extension to avoid aliasing problems
+ *  (union is compatible to any of its members)
+ *  This means this part of the code is -fstrict-aliasing safe now.
+ */
+union tcp_word_hdr { 
+       struct tcphdr hdr;
+       __be32            words[5];
+}; 
+
+#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
+
+enum { 
+       TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
+       TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
+       TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
+       TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
+       TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
+       TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
+       TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
+       TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
+       TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
+       TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
+}; 
+
+/*
+ * TCP general constants
+ */
+#define TCP_MSS_DEFAULT                 536U   /* IPv4 (RFC1122, RFC2581) */
+#define TCP_MSS_DESIRED                1220U   /* IPv6 (tunneled), EDNS0 (RFC3226) */
+
+/* TCP socket options */
+#define TCP_NODELAY            1       /* Turn off Nagle's algorithm. */
+#define TCP_MAXSEG             2       /* Limit MSS */
+#define TCP_CORK               3       /* Never send partially complete segments */
+#define TCP_KEEPIDLE           4       /* Start keeplives after this period */
+#define TCP_KEEPINTVL          5       /* Interval between keepalives */
+#define TCP_KEEPCNT            6       /* Number of keepalives before death */
+#define TCP_SYNCNT             7       /* Number of SYN retransmits */
+#define TCP_LINGER2            8       /* Life time of orphaned FIN-WAIT-2 state */
+#define TCP_DEFER_ACCEPT       9       /* Wake up listener only when data arrive */
+#define TCP_WINDOW_CLAMP       10      /* Bound advertised window */
+#define TCP_INFO               11      /* Information about this connection. */
+#define TCP_QUICKACK           12      /* Block/reenable quick acks */
+#define TCP_CONGESTION         13      /* Congestion control algorithm */
+#define TCP_MD5SIG             14      /* TCP MD5 Signature (RFC2385) */
+#define TCP_COOKIE_TRANSACTIONS        15      /* TCP Cookie Transactions */
+#define TCP_THIN_LINEAR_TIMEOUTS 16      /* Use linear timeouts for thin streams*/
+#define TCP_THIN_DUPACK         17      /* Fast retrans. after 1 dupack */
+#define TCP_USER_TIMEOUT       18      /* How long for loss retry before timeout */
+#define TCP_REPAIR             19      /* TCP sock is under repair right now */
+#define TCP_REPAIR_QUEUE       20
+#define TCP_QUEUE_SEQ          21
+#define TCP_REPAIR_OPTIONS     22
+#define TCP_FASTOPEN           23      /* Enable FastOpen on listeners */
+
+struct tcp_repair_opt {
+       __u32   opt_code;
+       __u32   opt_val;
+};
+
+enum {
+       TCP_NO_QUEUE,
+       TCP_RECV_QUEUE,
+       TCP_SEND_QUEUE,
+       TCP_QUEUES_NR,
+};
+
+/* for TCP_INFO socket option */
+#define TCPI_OPT_TIMESTAMPS    1
+#define TCPI_OPT_SACK          2
+#define TCPI_OPT_WSCALE                4
+#define TCPI_OPT_ECN           8 /* ECN was negociated at TCP session init */
+#define TCPI_OPT_ECN_SEEN      16 /* we received at least one packet with ECT */
+
+enum tcp_ca_state {
+       TCP_CA_Open = 0,
+#define TCPF_CA_Open   (1<<TCP_CA_Open)
+       TCP_CA_Disorder = 1,
+#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
+       TCP_CA_CWR = 2,
+#define TCPF_CA_CWR    (1<<TCP_CA_CWR)
+       TCP_CA_Recovery = 3,
+#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
+       TCP_CA_Loss = 4
+#define TCPF_CA_Loss   (1<<TCP_CA_Loss)
+};
+
+struct tcp_info {
+       __u8    tcpi_state;
+       __u8    tcpi_ca_state;
+       __u8    tcpi_retransmits;
+       __u8    tcpi_probes;
+       __u8    tcpi_backoff;
+       __u8    tcpi_options;
+       __u8    tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+       __u32   tcpi_rto;
+       __u32   tcpi_ato;
+       __u32   tcpi_snd_mss;
+       __u32   tcpi_rcv_mss;
+
+       __u32   tcpi_unacked;
+       __u32   tcpi_sacked;
+       __u32   tcpi_lost;
+       __u32   tcpi_retrans;
+       __u32   tcpi_fackets;
+
+       /* Times. */
+       __u32   tcpi_last_data_sent;
+       __u32   tcpi_last_ack_sent;     /* Not remembered, sorry. */
+       __u32   tcpi_last_data_recv;
+       __u32   tcpi_last_ack_recv;
+
+       /* Metrics. */
+       __u32   tcpi_pmtu;
+       __u32   tcpi_rcv_ssthresh;
+       __u32   tcpi_rtt;
+       __u32   tcpi_rttvar;
+       __u32   tcpi_snd_ssthresh;
+       __u32   tcpi_snd_cwnd;
+       __u32   tcpi_advmss;
+       __u32   tcpi_reordering;
+
+       __u32   tcpi_rcv_rtt;
+       __u32   tcpi_rcv_space;
+
+       __u32   tcpi_total_retrans;
+};
+
+/* for TCP_MD5SIG socket option */
+#define TCP_MD5SIG_MAXKEYLEN   80
+
+struct tcp_md5sig {
+       struct __kernel_sockaddr_storage tcpm_addr;     /* address associated */
+       __u16   __tcpm_pad1;                            /* zero */
+       __u16   tcpm_keylen;                            /* key length */
+       __u32   __tcpm_pad2;                            /* zero */
+       __u8    tcpm_key[TCP_MD5SIG_MAXKEYLEN];         /* key (binary) */
+};
+
+/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
+#define TCP_COOKIE_MIN          8              /*  64-bits */
+#define TCP_COOKIE_MAX         16              /* 128-bits */
+#define TCP_COOKIE_PAIR_SIZE   (2*TCP_COOKIE_MAX)
+
+/* Flags for both getsockopt and setsockopt */
+#define TCP_COOKIE_IN_ALWAYS   (1 << 0)        /* Discard SYN without cookie */
+#define TCP_COOKIE_OUT_NEVER   (1 << 1)        /* Prohibit outgoing cookies,
+                                                * supercedes everything. */
+
+/* Flags for getsockopt */
+#define TCP_S_DATA_IN          (1 << 2)        /* Was data received? */
+#define TCP_S_DATA_OUT         (1 << 3)        /* Was data sent? */
+
+/* TCP_COOKIE_TRANSACTIONS data */
+struct tcp_cookie_transactions {
+       __u16   tcpct_flags;                    /* see above */
+       __u8    __tcpct_pad1;                   /* zero */
+       __u8    tcpct_cookie_desired;           /* bytes */
+       __u16   tcpct_s_data_desired;           /* bytes of variable data */
+       __u16   tcpct_used;                     /* bytes in value */
+       __u8    tcpct_value[TCP_MSS_DEFAULT];
+};
+
+
+#endif /* _UAPI_LINUX_TCP_H */
diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h
new file mode 100644 (file)
index 0000000..0d3c0ed
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef _UAPI_LINUX_TIME_H
+#define _UAPI_LINUX_TIME_H
+
+#include <linux/types.h>
+
+
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC
+struct timespec {
+       __kernel_time_t tv_sec;                 /* seconds */
+       long            tv_nsec;                /* nanoseconds */
+};
+#endif
+
+struct timeval {
+       __kernel_time_t         tv_sec;         /* seconds */
+       __kernel_suseconds_t    tv_usec;        /* microseconds */
+};
+
+struct timezone {
+       int     tz_minuteswest; /* minutes west of Greenwich */
+       int     tz_dsttime;     /* type of dst correction */
+};
+
+
+/*
+ * Names of the interval timers, and structure
+ * defining a timer setting:
+ */
+#define        ITIMER_REAL             0
+#define        ITIMER_VIRTUAL          1
+#define        ITIMER_PROF             2
+
+struct itimerspec {
+       struct timespec it_interval;    /* timer period */
+       struct timespec it_value;       /* timer expiration */
+};
+
+struct itimerval {
+       struct timeval it_interval;     /* timer interval */
+       struct timeval it_value;        /* current value */
+};
+
+/*
+ * The IDs of the various system clocks (for POSIX.1b interval timers):
+ */
+#define CLOCK_REALTIME                 0
+#define CLOCK_MONOTONIC                        1
+#define CLOCK_PROCESS_CPUTIME_ID       2
+#define CLOCK_THREAD_CPUTIME_ID                3
+#define CLOCK_MONOTONIC_RAW            4
+#define CLOCK_REALTIME_COARSE          5
+#define CLOCK_MONOTONIC_COARSE         6
+#define CLOCK_BOOTTIME                 7
+#define CLOCK_REALTIME_ALARM           8
+#define CLOCK_BOOTTIME_ALARM           9
+
+/*
+ * The IDs of various hardware clocks:
+ */
+#define CLOCK_SGI_CYCLE                        10
+#define MAX_CLOCKS                     16
+#define CLOCKS_MASK                    (CLOCK_REALTIME | CLOCK_MONOTONIC)
+#define CLOCKS_MONO                    CLOCK_MONOTONIC
+
+/*
+ * The various flags for setting POSIX.1b interval timers:
+ */
+#define TIMER_ABSTIME                  0x01
+
+#endif /* _UAPI_LINUX_TIME_H */
diff --git a/include/uapi/linux/timex.h b/include/uapi/linux/timex.h
new file mode 100644 (file)
index 0000000..a7ea81f
--- /dev/null
@@ -0,0 +1,166 @@
+/*****************************************************************************
+ *                                                                           *
+ * Copyright (c) David L. Mills 1993                                         *
+ *                                                                           *
+ * Permission to use, copy, modify, and distribute this software and its     *
+ * documentation for any purpose and without fee is hereby granted, provided *
+ * that the above copyright notice appears in all copies and that both the   *
+ * copyright notice and this permission notice appear in supporting          *
+ * documentation, and that the name University of Delaware not be used in    *
+ * advertising or publicity pertaining to distribution of the software       *
+ * without specific, written prior permission.  The University of Delaware   *
+ * makes no representations about the suitability this software for any      *
+ * purpose.  It is provided "as is" without express or implied warranty.     *
+ *                                                                           *
+ *****************************************************************************/
+
+/*
+ * Modification history timex.h
+ *
+ * 29 Dec 97   Russell King
+ *     Moved CLOCK_TICK_RATE, CLOCK_TICK_FACTOR and FINETUNE to asm/timex.h
+ *     for ARM machines
+ *
+ *  9 Jan 97    Adrian Sun
+ *      Shifted LATCH define to allow access to alpha machines.
+ *
+ * 26 Sep 94   David L. Mills
+ *     Added defines for hybrid phase/frequency-lock loop.
+ *
+ * 19 Mar 94   David L. Mills
+ *     Moved defines from kernel routines to header file and added new
+ *     defines for PPS phase-lock loop.
+ *
+ * 20 Feb 94   David L. Mills
+ *     Revised status codes and structures for external clock and PPS
+ *     signal discipline.
+ *
+ * 28 Nov 93   David L. Mills
+ *     Adjusted parameters to improve stability and increase poll
+ *     interval.
+ *
+ * 17 Sep 93    David L. Mills
+ *      Created file $NTP/include/sys/timex.h
+ * 07 Oct 93    Torsten Duwe
+ *      Derived linux/timex.h
+ * 1995-08-13    Torsten Duwe
+ *      kernel PLL updated to 1994-12-13 specs (rfc-1589)
+ * 1997-08-30    Ulrich Windl
+ *      Added new constant NTP_PHASE_LIMIT
+ * 2004-08-12    Christoph Lameter
+ *      Reworked time interpolation logic
+ */
+#ifndef _UAPI_LINUX_TIMEX_H
+#define _UAPI_LINUX_TIMEX_H
+
+#include <linux/time.h>
+
+#define NTP_API                4       /* NTP API version */
+
+/*
+ * syscall interface - used (mainly by NTP daemon)
+ * to discipline kernel clock oscillator
+ */
+struct timex {
+       unsigned int modes;     /* mode selector */
+       long offset;            /* time offset (usec) */
+       long freq;              /* frequency offset (scaled ppm) */
+       long maxerror;          /* maximum error (usec) */
+       long esterror;          /* estimated error (usec) */
+       int status;             /* clock command/status */
+       long constant;          /* pll time constant */
+       long precision;         /* clock precision (usec) (read only) */
+       long tolerance;         /* clock frequency tolerance (ppm)
+                                * (read only)
+                                */
+       struct timeval time;    /* (read only, except for ADJ_SETOFFSET) */
+       long tick;              /* (modified) usecs between clock ticks */
+
+       long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
+       long jitter;            /* pps jitter (us) (ro) */
+       int shift;              /* interval duration (s) (shift) (ro) */
+       long stabil;            /* pps stability (scaled ppm) (ro) */
+       long jitcnt;            /* jitter limit exceeded (ro) */
+       long calcnt;            /* calibration intervals (ro) */
+       long errcnt;            /* calibration errors (ro) */
+       long stbcnt;            /* stability limit exceeded (ro) */
+
+       int tai;                /* TAI offset (ro) */
+
+       int  :32; int  :32; int  :32; int  :32;
+       int  :32; int  :32; int  :32; int  :32;
+       int  :32; int  :32; int  :32;
+};
+
+/*
+ * Mode codes (timex.mode)
+ */
+#define ADJ_OFFSET             0x0001  /* time offset */
+#define ADJ_FREQUENCY          0x0002  /* frequency offset */
+#define ADJ_MAXERROR           0x0004  /* maximum time error */
+#define ADJ_ESTERROR           0x0008  /* estimated time error */
+#define ADJ_STATUS             0x0010  /* clock status */
+#define ADJ_TIMECONST          0x0020  /* pll time constant */
+#define ADJ_TAI                        0x0080  /* set TAI offset */
+#define ADJ_SETOFFSET          0x0100  /* add 'time' to current time */
+#define ADJ_MICRO              0x1000  /* select microsecond resolution */
+#define ADJ_NANO               0x2000  /* select nanosecond resolution */
+#define ADJ_TICK               0x4000  /* tick value */
+
+#ifndef __KERNEL__
+#define ADJ_OFFSET_SINGLESHOT  0x8001  /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ     0xa001  /* read-only adjtime */
+#endif
+
+/* NTP userland likes the MOD_ prefix better */
+#define MOD_OFFSET     ADJ_OFFSET
+#define MOD_FREQUENCY  ADJ_FREQUENCY
+#define MOD_MAXERROR   ADJ_MAXERROR
+#define MOD_ESTERROR   ADJ_ESTERROR
+#define MOD_STATUS     ADJ_STATUS
+#define MOD_TIMECONST  ADJ_TIMECONST
+#define MOD_TAI        ADJ_TAI
+#define MOD_MICRO      ADJ_MICRO
+#define MOD_NANO       ADJ_NANO
+
+
+/*
+ * Status codes (timex.status)
+ */
+#define STA_PLL                0x0001  /* enable PLL updates (rw) */
+#define STA_PPSFREQ    0x0002  /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME    0x0004  /* enable PPS time discipline (rw) */
+#define STA_FLL                0x0008  /* select frequency-lock mode (rw) */
+
+#define STA_INS                0x0010  /* insert leap (rw) */
+#define STA_DEL                0x0020  /* delete leap (rw) */
+#define STA_UNSYNC     0x0040  /* clock unsynchronized (rw) */
+#define STA_FREQHOLD   0x0080  /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL  0x0100  /* PPS signal present (ro) */
+#define STA_PPSJITTER  0x0200  /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER  0x0400  /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR   0x0800  /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR   0x1000  /* clock hardware fault (ro) */
+#define STA_NANO       0x2000  /* resolution (0 = us, 1 = ns) (ro) */
+#define STA_MODE       0x4000  /* mode (0 = PLL, 1 = FLL) (ro) */
+#define STA_CLK                0x8000  /* clock source (0 = A, 1 = B) (ro) */
+
+/* read-only bits */
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+       STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
+
+/*
+ * Clock states (time_state)
+ */
+#define TIME_OK                0       /* clock synchronized, no leap second */
+#define TIME_INS       1       /* insert leap second */
+#define TIME_DEL       2       /* delete leap second */
+#define TIME_OOP       3       /* leap second in progress */
+#define TIME_WAIT      4       /* leap second has occurred */
+#define TIME_ERROR     5       /* clock not synchronized */
+#define TIME_BAD       TIME_ERROR /* bw compat */
+
+
+#endif /* _UAPI_LINUX_TIMEX_H */
diff --git a/include/uapi/linux/toshiba.h b/include/uapi/linux/toshiba.h
new file mode 100644 (file)
index 0000000..e9bef5b
--- /dev/null
@@ -0,0 +1,37 @@
+/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops 
+ *
+ * Copyright (c) 1996-2000  Jonathan A. Buzzard (jonathan@buzzard.org.uk)
+ *
+ * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
+ * on making sure the structure is aligned and packed.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef _UAPI_LINUX_TOSHIBA_H
+#define _UAPI_LINUX_TOSHIBA_H
+
+#define TOSH_PROC "/proc/toshiba"
+#define TOSH_DEVICE "/dev/toshiba"
+#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
+
+typedef struct {
+       unsigned int eax;
+       unsigned int ebx __attribute__ ((packed));
+       unsigned int ecx __attribute__ ((packed));
+       unsigned int edx __attribute__ ((packed));
+       unsigned int esi __attribute__ ((packed));
+       unsigned int edi __attribute__ ((packed));
+} SMMRegisters;
+
+
+#endif /* _UAPI_LINUX_TOSHIBA_H */
diff --git a/include/uapi/linux/tty.h b/include/uapi/linux/tty.h
new file mode 100644 (file)
index 0000000..dac199a
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef _UAPI_LINUX_TTY_H
+#define _UAPI_LINUX_TTY_H
+
+/*
+ * 'tty.h' defines some structures used by tty_io.c and some defines.
+ */
+
+#define NR_LDISCS              30
+
+/* line disciplines */
+#define N_TTY          0
+#define N_SLIP         1
+#define N_MOUSE                2
+#define N_PPP          3
+#define N_STRIP                4
+#define N_AX25         5
+#define N_X25          6       /* X.25 async */
+#define N_6PACK                7
+#define N_MASC         8       /* Reserved for Mobitex module <kaz@cafe.net> */
+#define N_R3964                9       /* Reserved for Simatic R3964 module */
+#define N_PROFIBUS_FDL 10      /* Reserved for Profibus */
+#define N_IRDA         11      /* Linux IrDa - http://irda.sourceforge.net/ */
+#define N_SMSBLOCK     12      /* SMS block mode - for talking to GSM data */
+                               /* cards about SMS messages */
+#define N_HDLC         13      /* synchronous HDLC */
+#define N_SYNC_PPP     14      /* synchronous PPP */
+#define N_HCI          15      /* Bluetooth HCI UART */
+#define N_GIGASET_M101 16      /* Siemens Gigaset M101 serial DECT adapter */
+#define N_SLCAN                17      /* Serial / USB serial CAN Adaptors */
+#define N_PPS          18      /* Pulse per Second */
+#define N_V253         19      /* Codec control over voice modem */
+#define N_CAIF         20      /* CAIF protocol for talking to modems */
+#define N_GSM0710      21      /* GSM 0710 Mux */
+#define N_TI_WL                22      /* for TI's WL BT, FM, GPS combo chips */
+#define N_TRACESINK    23      /* Trace data routing for MIPI P1149.7 */
+#define N_TRACEROUTER  24      /* Trace data routing for MIPI P1149.7 */
+
+#endif /* _UAPI_LINUX_TTY_H */
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
new file mode 100644 (file)
index 0000000..acf0979
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _UAPI_LINUX_TYPES_H
+#define _UAPI_LINUX_TYPES_H
+
+#include <asm/types.h>
+
+#ifndef __ASSEMBLY__
+#ifndef        __KERNEL__
+#ifndef __EXPORTED_HEADERS__
+#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
+#endif /* __EXPORTED_HEADERS__ */
+#endif
+
+#include <linux/posix_types.h>
+
+
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
+#ifdef __CHECKER__
+#define __bitwise__ __attribute__((bitwise))
+#else
+#define __bitwise__
+#endif
+#ifdef __CHECK_ENDIAN__
+#define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+
+typedef __u16 __bitwise __sum16;
+typedef __u32 __bitwise __wsum;
+
+/*
+ * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
+ * common 32/64-bit compat problems.
+ * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
+ * architectures) and to 8-byte boundaries on 64-bit architectures.  The new
+ * aligned_64 type enforces 8-byte alignment so that structs containing
+ * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
+ * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
+ */
+#define __aligned_u64 __u64 __attribute__((aligned(8)))
+#define __aligned_be64 __be64 __attribute__((aligned(8)))
+#define __aligned_le64 __le64 __attribute__((aligned(8)))
+
+#endif /*  __ASSEMBLY__ */
+#endif /* _UAPI_LINUX_TYPES_H */
diff --git a/include/uapi/linux/udp.h b/include/uapi/linux/udp.h
new file mode 100644 (file)
index 0000000..e2bcfd7
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * INET                An implementation of the TCP/IP protocol suite for the LINUX
+ *             operating system.  INET is implemented using the  BSD Socket
+ *             interface as the means of communication with the user level.
+ *
+ *             Definitions for the UDP protocol.
+ *
+ * Version:    @(#)udp.h       1.0.2   04/28/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI_LINUX_UDP_H
+#define _UAPI_LINUX_UDP_H
+
+#include <linux/types.h>
+
+struct udphdr {
+       __be16  source;
+       __be16  dest;
+       __be16  len;
+       __sum16 check;
+};
+
+/* UDP socket options */
+#define UDP_CORK       1       /* Never send partially complete segments */
+#define UDP_ENCAP      100     /* Set the socket to accept encapsulated packets */
+
+/* UDP encapsulation types */
+#define UDP_ENCAP_ESPINUDP_NON_IKE     1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP     2 /* draft-ietf-ipsec-udp-encaps-06 */
+#define UDP_ENCAP_L2TPINUDP    3 /* rfc2661 */
+
+
+#endif /* _UAPI_LINUX_UDP_H */
diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h
new file mode 100644 (file)
index 0000000..fe46431
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ *  User level driver support for input subsystem
+ *
+ * Heavily based on evdev.c by Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
+ *
+ * Changes/Revisions:
+ *     0.3     24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
+ *             - update ff support for the changes in kernel interface
+ *             - add UINPUT_VERSION
+ *     0.2     16/10/2004 (Micah Dowty <micah@navi.cx>)
+ *             - added force feedback support
+ *             - added UI_SET_PHYS
+ *     0.1     20/06/2002
+ *             - first public version
+ */
+#ifndef _UAPI__UINPUT_H_
+#define _UAPI__UINPUT_H_
+
+#include <linux/types.h>
+#include <linux/input.h>
+
+#define UINPUT_VERSION         3
+
+
+struct uinput_ff_upload {
+       __u32                   request_id;
+       __s32                   retval;
+       struct ff_effect        effect;
+       struct ff_effect        old;
+};
+
+struct uinput_ff_erase {
+       __u32                   request_id;
+       __s32                   retval;
+       __u32                   effect_id;
+};
+
+/* ioctl */
+#define UINPUT_IOCTL_BASE      'U'
+#define UI_DEV_CREATE          _IO(UINPUT_IOCTL_BASE, 1)
+#define UI_DEV_DESTROY         _IO(UINPUT_IOCTL_BASE, 2)
+
+#define UI_SET_EVBIT           _IOW(UINPUT_IOCTL_BASE, 100, int)
+#define UI_SET_KEYBIT          _IOW(UINPUT_IOCTL_BASE, 101, int)
+#define UI_SET_RELBIT          _IOW(UINPUT_IOCTL_BASE, 102, int)
+#define UI_SET_ABSBIT          _IOW(UINPUT_IOCTL_BASE, 103, int)
+#define UI_SET_MSCBIT          _IOW(UINPUT_IOCTL_BASE, 104, int)
+#define UI_SET_LEDBIT          _IOW(UINPUT_IOCTL_BASE, 105, int)
+#define UI_SET_SNDBIT          _IOW(UINPUT_IOCTL_BASE, 106, int)
+#define UI_SET_FFBIT           _IOW(UINPUT_IOCTL_BASE, 107, int)
+#define UI_SET_PHYS            _IOW(UINPUT_IOCTL_BASE, 108, char*)
+#define UI_SET_SWBIT           _IOW(UINPUT_IOCTL_BASE, 109, int)
+#define UI_SET_PROPBIT         _IOW(UINPUT_IOCTL_BASE, 110, int)
+
+#define UI_BEGIN_FF_UPLOAD     _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
+#define UI_END_FF_UPLOAD       _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
+#define UI_BEGIN_FF_ERASE      _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
+#define UI_END_FF_ERASE                _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
+
+/*
+ * To write a force-feedback-capable driver, the upload_effect
+ * and erase_effect callbacks in input_dev must be implemented.
+ * The uinput driver will generate a fake input event when one of
+ * these callbacks are invoked. The userspace code then uses
+ * ioctls to retrieve additional parameters and send the return code.
+ * The callback blocks until this return code is sent.
+ *
+ * The described callback mechanism is only used if ff_effects_max
+ * is set.
+ *
+ * To implement upload_effect():
+ *   1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
+ *      A request ID will be given in 'value'.
+ *   2. Allocate a uinput_ff_upload struct, fill in request_id with
+ *      the 'value' from the EV_UINPUT event.
+ *   3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
+ *      uinput_ff_upload struct. It will be filled in with the
+ *      ff_effects passed to upload_effect().
+ *   4. Perform the effect upload, and place a return code back into
+        the uinput_ff_upload struct.
+ *   5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
+ *      uinput_ff_upload_effect struct. This will complete execution
+ *      of our upload_effect() handler.
+ *
+ * To implement erase_effect():
+ *   1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
+ *      A request ID will be given in 'value'.
+ *   2. Allocate a uinput_ff_erase struct, fill in request_id with
+ *      the 'value' from the EV_UINPUT event.
+ *   3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
+ *      uinput_ff_erase struct. It will be filled in with the
+ *      effect ID passed to erase_effect().
+ *   4. Perform the effect erasure, and place a return code back
+ *      into the uinput_ff_erase struct.
+ *   5. Issue a UI_END_FF_ERASE ioctl, also giving it the
+ *      uinput_ff_erase_effect struct. This will complete execution
+ *      of our erase_effect() handler.
+ */
+
+/*
+ * This is the new event type, used only by uinput.
+ * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
+ * is the unique request ID. This number was picked
+ * arbitrarily, above EV_MAX (since the input system
+ * never sees it) but in the range of a 16-bit int.
+ */
+#define EV_UINPUT              0x0101
+#define UI_FF_UPLOAD           1
+#define UI_FF_ERASE            2
+
+#define UINPUT_MAX_NAME_SIZE   80
+struct uinput_user_dev {
+       char name[UINPUT_MAX_NAME_SIZE];
+       struct input_id id;
+       __u32 ff_effects_max;
+       __s32 absmax[ABS_CNT];
+       __s32 absmin[ABS_CNT];
+       __s32 absfuzz[ABS_CNT];
+       __s32 absflat[ABS_CNT];
+};
+#endif /* _UAPI__UINPUT_H_ */
diff --git a/include/uapi/linux/uio.h b/include/uapi/linux/uio.h
new file mode 100644 (file)
index 0000000..2731d56
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *     Berkeley style UIO structures   -       Alan Cox 1994.
+ *
+ *             This program is free software; you can redistribute it and/or
+ *             modify it under the terms of the GNU General Public License
+ *             as published by the Free Software Foundation; either version
+ *             2 of the License, or (at your option) any later version.
+ */
+#ifndef _UAPI__LINUX_UIO_H
+#define _UAPI__LINUX_UIO_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+
+struct iovec
+{
+       void __user *iov_base;  /* BSD uses caddr_t (1003.1g requires void *) */
+       __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
+};
+
+/*
+ *     UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
+ */
+#define UIO_FASTIOV    8
+#define UIO_MAXIOV     1024
+
+
+#endif /* _UAPI__LINUX_UIO_H */
similarity index 100%
rename from include/linux/un.h
rename to include/uapi/linux/un.h
diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h
new file mode 100644 (file)
index 0000000..0c65e4b
--- /dev/null
@@ -0,0 +1,180 @@
+/*****************************************************************************/
+
+/*
+ *     usbdevice_fs.h  --  USB device file system.
+ *
+ *     Copyright (C) 2000
+ *          Thomas Sailer (sailer@ife.ee.ethz.ch)
+ *
+ *     This program is free software; you can redistribute it and/or modify
+ *     it under the terms of the GNU General Public License as published by
+ *     the Free Software Foundation; either version 2 of the License, or
+ *     (at your option) any later version.
+ *
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  History:
+ *   0.1  04.01.2000  Created
+ */
+
+/*****************************************************************************/
+
+#ifndef _UAPI_LINUX_USBDEVICE_FS_H
+#define _UAPI_LINUX_USBDEVICE_FS_H
+
+#include <linux/types.h>
+#include <linux/magic.h>
+
+/* --------------------------------------------------------------------- */
+
+/* usbdevfs ioctl codes */
+
+struct usbdevfs_ctrltransfer {
+       __u8 bRequestType;
+       __u8 bRequest;
+       __u16 wValue;
+       __u16 wIndex;
+       __u16 wLength;
+       __u32 timeout;  /* in milliseconds */
+       void __user *data;
+};
+
+struct usbdevfs_bulktransfer {
+       unsigned int ep;
+       unsigned int len;
+       unsigned int timeout; /* in milliseconds */
+       void __user *data;
+};
+
+struct usbdevfs_setinterface {
+       unsigned int interface;
+       unsigned int altsetting;
+};
+
+struct usbdevfs_disconnectsignal {
+       unsigned int signr;
+       void __user *context;
+};
+
+#define USBDEVFS_MAXDRIVERNAME 255
+
+struct usbdevfs_getdriver {
+       unsigned int interface;
+       char driver[USBDEVFS_MAXDRIVERNAME + 1];
+};
+
+struct usbdevfs_connectinfo {
+       unsigned int devnum;
+       unsigned char slow;
+};
+
+#define USBDEVFS_URB_SHORT_NOT_OK      0x01
+#define USBDEVFS_URB_ISO_ASAP          0x02
+#define USBDEVFS_URB_BULK_CONTINUATION 0x04
+#define USBDEVFS_URB_NO_FSBR           0x20
+#define USBDEVFS_URB_ZERO_PACKET       0x40
+#define USBDEVFS_URB_NO_INTERRUPT      0x80
+
+#define USBDEVFS_URB_TYPE_ISO             0
+#define USBDEVFS_URB_TYPE_INTERRUPT       1
+#define USBDEVFS_URB_TYPE_CONTROL         2
+#define USBDEVFS_URB_TYPE_BULK            3
+
+struct usbdevfs_iso_packet_desc {
+       unsigned int length;
+       unsigned int actual_length;
+       unsigned int status;
+};
+
+struct usbdevfs_urb {
+       unsigned char type;
+       unsigned char endpoint;
+       int status;
+       unsigned int flags;
+       void __user *buffer;
+       int buffer_length;
+       int actual_length;
+       int start_frame;
+       int number_of_packets;
+       int error_count;
+       unsigned int signr;     /* signal to be sent on completion,
+                                 or 0 if none should be sent. */
+       void __user *usercontext;
+       struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+/* ioctls for talking directly to drivers */
+struct usbdevfs_ioctl {
+       int     ifno;           /* interface 0..N ; negative numbers reserved */
+       int     ioctl_code;     /* MUST encode size + direction of data so the
+                                * macros in <asm/ioctl.h> give correct values */
+       void __user *data;      /* param buffer (in, or out) */
+};
+
+/* You can do most things with hubs just through control messages,
+ * except find out what device connects to what port. */
+struct usbdevfs_hub_portinfo {
+       char nports;            /* number of downstream ports in this hub */
+       char port [127];        /* e.g. port 3 connects to device 27 */
+};
+
+/* Device capability flags */
+#define USBDEVFS_CAP_ZERO_PACKET               0x01
+#define USBDEVFS_CAP_BULK_CONTINUATION         0x02
+#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM                0x04
+#define USBDEVFS_CAP_BULK_SCATTER_GATHER       0x08
+
+/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
+
+/* disconnect-and-claim if the driver matches the driver field */
+#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER    0x01
+/* disconnect-and-claim except when the driver matches the driver field */
+#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER        0x02
+
+struct usbdevfs_disconnect_claim {
+       unsigned int interface;
+       unsigned int flags;
+       char driver[USBDEVFS_MAXDRIVERNAME + 1];
+};
+
+
+#define USBDEVFS_CONTROL           _IOWR('U', 0, struct usbdevfs_ctrltransfer)
+#define USBDEVFS_CONTROL32           _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
+#define USBDEVFS_BULK              _IOWR('U', 2, struct usbdevfs_bulktransfer)
+#define USBDEVFS_BULK32              _IOWR('U', 2, struct usbdevfs_bulktransfer32)
+#define USBDEVFS_RESETEP           _IOR('U', 3, unsigned int)
+#define USBDEVFS_SETINTERFACE      _IOR('U', 4, struct usbdevfs_setinterface)
+#define USBDEVFS_SETCONFIGURATION  _IOR('U', 5, unsigned int)
+#define USBDEVFS_GETDRIVER         _IOW('U', 8, struct usbdevfs_getdriver)
+#define USBDEVFS_SUBMITURB         _IOR('U', 10, struct usbdevfs_urb)
+#define USBDEVFS_SUBMITURB32       _IOR('U', 10, struct usbdevfs_urb32)
+#define USBDEVFS_DISCARDURB        _IO('U', 11)
+#define USBDEVFS_REAPURB           _IOW('U', 12, void *)
+#define USBDEVFS_REAPURB32         _IOW('U', 12, __u32)
+#define USBDEVFS_REAPURBNDELAY     _IOW('U', 13, void *)
+#define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, __u32)
+#define USBDEVFS_DISCSIGNAL        _IOR('U', 14, struct usbdevfs_disconnectsignal)
+#define USBDEVFS_DISCSIGNAL32      _IOR('U', 14, struct usbdevfs_disconnectsignal32)
+#define USBDEVFS_CLAIMINTERFACE    _IOR('U', 15, unsigned int)
+#define USBDEVFS_RELEASEINTERFACE  _IOR('U', 16, unsigned int)
+#define USBDEVFS_CONNECTINFO       _IOW('U', 17, struct usbdevfs_connectinfo)
+#define USBDEVFS_IOCTL             _IOWR('U', 18, struct usbdevfs_ioctl)
+#define USBDEVFS_IOCTL32           _IOWR('U', 18, struct usbdevfs_ioctl32)
+#define USBDEVFS_HUB_PORTINFO      _IOR('U', 19, struct usbdevfs_hub_portinfo)
+#define USBDEVFS_RESET             _IO('U', 20)
+#define USBDEVFS_CLEAR_HALT        _IOR('U', 21, unsigned int)
+#define USBDEVFS_DISCONNECT        _IO('U', 22)
+#define USBDEVFS_CONNECT           _IO('U', 23)
+#define USBDEVFS_CLAIM_PORT        _IOR('U', 24, unsigned int)
+#define USBDEVFS_RELEASE_PORT      _IOR('U', 25, unsigned int)
+#define USBDEVFS_GET_CAPABILITIES  _IOR('U', 26, __u32)
+#define USBDEVFS_DISCONNECT_CLAIM  _IOR('U', 27, struct usbdevfs_disconnect_claim)
+
+#endif /* _UAPI_LINUX_USBDEVICE_FS_H */
diff --git a/include/uapi/linux/utsname.h b/include/uapi/linux/utsname.h
new file mode 100644 (file)
index 0000000..872c2df
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _UAPI_LINUX_UTSNAME_H
+#define _UAPI_LINUX_UTSNAME_H
+
+#define __OLD_UTS_LEN 8
+
+struct oldold_utsname {
+       char sysname[9];
+       char nodename[9];
+       char release[9];
+       char version[9];
+       char machine[9];
+};
+
+#define __NEW_UTS_LEN 64
+
+struct old_utsname {
+       char sysname[65];
+       char nodename[65];
+       char release[65];
+       char version[65];
+       char machine[65];
+};
+
+struct new_utsname {
+       char sysname[__NEW_UTS_LEN + 1];
+       char nodename[__NEW_UTS_LEN + 1];
+       char release[__NEW_UTS_LEN + 1];
+       char version[__NEW_UTS_LEN + 1];
+       char machine[__NEW_UTS_LEN + 1];
+       char domainname[__NEW_UTS_LEN + 1];
+};
+
+
+#endif /* _UAPI_LINUX_UTSNAME_H */
diff --git a/include/uapi/linux/uuid.h b/include/uapi/linux/uuid.h
new file mode 100644 (file)
index 0000000..786f077
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * UUID/GUID definition
+ *
+ * Copyright (C) 2010, Intel Corp.
+ *     Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _UAPI_LINUX_UUID_H_
+#define _UAPI_LINUX_UUID_H_
+
+#include <linux/types.h>
+#include <linux/string.h>
+
+typedef struct {
+       __u8 b[16];
+} uuid_le;
+
+typedef struct {
+       __u8 b[16];
+} uuid_be;
+
+#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)               \
+((uuid_le)                                                             \
+{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
+   (b) & 0xff, ((b) >> 8) & 0xff,                                      \
+   (c) & 0xff, ((c) >> 8) & 0xff,                                      \
+   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
+
+#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)               \
+((uuid_be)                                                             \
+{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
+   ((b) >> 8) & 0xff, (b) & 0xff,                                      \
+   ((c) >> 8) & 0xff, (c) & 0xff,                                      \
+   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
+
+#define NULL_UUID_LE                                                   \
+       UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,     \
+               0x00, 0x00, 0x00, 0x00)
+
+#define NULL_UUID_BE                                                   \
+       UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,     \
+               0x00, 0x00, 0x00, 0x00)
+
+
+#endif /* _UAPI_LINUX_UUID_H_ */
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
new file mode 100644 (file)
index 0000000..4758d1b
--- /dev/null
@@ -0,0 +1,368 @@
+/*
+ * VFIO API definition
+ *
+ * Copyright (C) 2012 Red Hat, Inc.  All rights reserved.
+ *     Author: Alex Williamson <alex.williamson@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef _UAPIVFIO_H
+#define _UAPIVFIO_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define VFIO_API_VERSION       0
+
+
+/* Kernel & User level defines for VFIO IOCTLs. */
+
+/* Extensions */
+
+#define VFIO_TYPE1_IOMMU               1
+
+/*
+ * The IOCTL interface is designed for extensibility by embedding the
+ * structure length (argsz) and flags into structures passed between
+ * kernel and userspace.  We therefore use the _IO() macro for these
+ * defines to avoid implicitly embedding a size into the ioctl request.
+ * As structure fields are added, argsz will increase to match and flag
+ * bits will be defined to indicate additional fields with valid data.
+ * It's *always* the caller's responsibility to indicate the size of
+ * the structure passed by setting argsz appropriately.
+ */
+
+#define VFIO_TYPE      (';')
+#define VFIO_BASE      100
+
+/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
+
+/**
+ * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
+ *
+ * Report the version of the VFIO API.  This allows us to bump the entire
+ * API version should we later need to add or change features in incompatible
+ * ways.
+ * Return: VFIO_API_VERSION
+ * Availability: Always
+ */
+#define VFIO_GET_API_VERSION           _IO(VFIO_TYPE, VFIO_BASE + 0)
+
+/**
+ * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
+ *
+ * Check whether an extension is supported.
+ * Return: 0 if not supported, 1 (or some other positive integer) if supported.
+ * Availability: Always
+ */
+#define VFIO_CHECK_EXTENSION           _IO(VFIO_TYPE, VFIO_BASE + 1)
+
+/**
+ * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
+ *
+ * Set the iommu to the given type.  The type must be supported by an
+ * iommu driver as verified by calling CHECK_EXTENSION using the same
+ * type.  A group must be set to this file descriptor before this
+ * ioctl is available.  The IOMMU interfaces enabled by this call are
+ * specific to the value set.
+ * Return: 0 on success, -errno on failure
+ * Availability: When VFIO group attached
+ */
+#define VFIO_SET_IOMMU                 _IO(VFIO_TYPE, VFIO_BASE + 2)
+
+/* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */
+
+/**
+ * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3,
+ *                                             struct vfio_group_status)
+ *
+ * Retrieve information about the group.  Fills in provided
+ * struct vfio_group_info.  Caller sets argsz.
+ * Return: 0 on succes, -errno on failure.
+ * Availability: Always
+ */
+struct vfio_group_status {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_GROUP_FLAGS_VIABLE                (1 << 0)
+#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
+};
+#define VFIO_GROUP_GET_STATUS          _IO(VFIO_TYPE, VFIO_BASE + 3)
+
+/**
+ * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
+ *
+ * Set the container for the VFIO group to the open VFIO file
+ * descriptor provided.  Groups may only belong to a single
+ * container.  Containers may, at their discretion, support multiple
+ * groups.  Only when a container is set are all of the interfaces
+ * of the VFIO file descriptor and the VFIO group file descriptor
+ * available to the user.
+ * Return: 0 on success, -errno on failure.
+ * Availability: Always
+ */
+#define VFIO_GROUP_SET_CONTAINER       _IO(VFIO_TYPE, VFIO_BASE + 4)
+
+/**
+ * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
+ *
+ * Remove the group from the attached container.  This is the
+ * opposite of the SET_CONTAINER call and returns the group to
+ * an initial state.  All device file descriptors must be released
+ * prior to calling this interface.  When removing the last group
+ * from a container, the IOMMU will be disabled and all state lost,
+ * effectively also returning the VFIO file descriptor to an initial
+ * state.
+ * Return: 0 on success, -errno on failure.
+ * Availability: When attached to container
+ */
+#define VFIO_GROUP_UNSET_CONTAINER     _IO(VFIO_TYPE, VFIO_BASE + 5)
+
+/**
+ * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
+ *
+ * Return a new file descriptor for the device object described by
+ * the provided string.  The string should match a device listed in
+ * the devices subdirectory of the IOMMU group sysfs entry.  The
+ * group containing the device must already be added to this context.
+ * Return: new file descriptor on success, -errno on failure.
+ * Availability: When attached to container
+ */
+#define VFIO_GROUP_GET_DEVICE_FD       _IO(VFIO_TYPE, VFIO_BASE + 6)
+
+/* --------------- IOCTLs for DEVICE file descriptors --------------- */
+
+/**
+ * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7,
+ *                                             struct vfio_device_info)
+ *
+ * Retrieve information about the device.  Fills in provided
+ * struct vfio_device_info.  Caller sets argsz.
+ * Return: 0 on success, -errno on failure.
+ */
+struct vfio_device_info {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_DEVICE_FLAGS_RESET        (1 << 0)        /* Device supports reset */
+#define VFIO_DEVICE_FLAGS_PCI  (1 << 1)        /* vfio-pci device */
+       __u32   num_regions;    /* Max region index + 1 */
+       __u32   num_irqs;       /* Max IRQ index + 1 */
+};
+#define VFIO_DEVICE_GET_INFO           _IO(VFIO_TYPE, VFIO_BASE + 7)
+
+/**
+ * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
+ *                                    struct vfio_region_info)
+ *
+ * Retrieve information about a device region.  Caller provides
+ * struct vfio_region_info with index value set.  Caller sets argsz.
+ * Implementation of region mapping is bus driver specific.  This is
+ * intended to describe MMIO, I/O port, as well as bus specific
+ * regions (ex. PCI config space).  Zero sized regions may be used
+ * to describe unimplemented regions (ex. unimplemented PCI BARs).
+ * Return: 0 on success, -errno on failure.
+ */
+struct vfio_region_info {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_REGION_INFO_FLAG_READ     (1 << 0) /* Region supports read */
+#define VFIO_REGION_INFO_FLAG_WRITE    (1 << 1) /* Region supports write */
+#define VFIO_REGION_INFO_FLAG_MMAP     (1 << 2) /* Region supports mmap */
+       __u32   index;          /* Region index */
+       __u32   resv;           /* Reserved for alignment */
+       __u64   size;           /* Region size (bytes) */
+       __u64   offset;         /* Region offset from start of device fd */
+};
+#define VFIO_DEVICE_GET_REGION_INFO    _IO(VFIO_TYPE, VFIO_BASE + 8)
+
+/**
+ * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
+ *                                 struct vfio_irq_info)
+ *
+ * Retrieve information about a device IRQ.  Caller provides
+ * struct vfio_irq_info with index value set.  Caller sets argsz.
+ * Implementation of IRQ mapping is bus driver specific.  Indexes
+ * using multiple IRQs are primarily intended to support MSI-like
+ * interrupt blocks.  Zero count irq blocks may be used to describe
+ * unimplemented interrupt types.
+ *
+ * The EVENTFD flag indicates the interrupt index supports eventfd based
+ * signaling.
+ *
+ * The MASKABLE flags indicates the index supports MASK and UNMASK
+ * actions described below.
+ *
+ * AUTOMASKED indicates that after signaling, the interrupt line is
+ * automatically masked by VFIO and the user needs to unmask the line
+ * to receive new interrupts.  This is primarily intended to distinguish
+ * level triggered interrupts.
+ *
+ * The NORESIZE flag indicates that the interrupt lines within the index
+ * are setup as a set and new subindexes cannot be enabled without first
+ * disabling the entire index.  This is used for interrupts like PCI MSI
+ * and MSI-X where the driver may only use a subset of the available
+ * indexes, but VFIO needs to enable a specific number of vectors
+ * upfront.  In the case of MSI-X, where the user can enable MSI-X and
+ * then add and unmask vectors, it's up to userspace to make the decision
+ * whether to allocate the maximum supported number of vectors or tear
+ * down setup and incrementally increase the vectors as each is enabled.
+ */
+struct vfio_irq_info {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_IRQ_INFO_EVENTFD          (1 << 0)
+#define VFIO_IRQ_INFO_MASKABLE         (1 << 1)
+#define VFIO_IRQ_INFO_AUTOMASKED       (1 << 2)
+#define VFIO_IRQ_INFO_NORESIZE         (1 << 3)
+       __u32   index;          /* IRQ index */
+       __u32   count;          /* Number of IRQs within this index */
+};
+#define VFIO_DEVICE_GET_IRQ_INFO       _IO(VFIO_TYPE, VFIO_BASE + 9)
+
+/**
+ * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
+ *
+ * Set signaling, masking, and unmasking of interrupts.  Caller provides
+ * struct vfio_irq_set with all fields set.  'start' and 'count' indicate
+ * the range of subindexes being specified.
+ *
+ * The DATA flags specify the type of data provided.  If DATA_NONE, the
+ * operation performs the specified action immediately on the specified
+ * interrupt(s).  For example, to unmask AUTOMASKED interrupt [0,0]:
+ * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
+ *
+ * DATA_BOOL allows sparse support for the same on arrays of interrupts.
+ * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]):
+ * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3,
+ * data = {1,0,1}
+ *
+ * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
+ * A value of -1 can be used to either de-assign interrupts if already
+ * assigned or skip un-assigned interrupts.  For example, to set an eventfd
+ * to be trigger for interrupts [0,0] and [0,2]:
+ * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3,
+ * data = {fd1, -1, fd2}
+ * If index [0,1] is previously set, two count = 1 ioctls calls would be
+ * required to set [0,0] and [0,2] without changing [0,1].
+ *
+ * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used
+ * with ACTION_TRIGGER to perform kernel level interrupt loopback testing
+ * from userspace (ie. simulate hardware triggering).
+ *
+ * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER
+ * enables the interrupt index for the device.  Individual subindex interrupts
+ * can be disabled using the -1 value for DATA_EVENTFD or the index can be
+ * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
+ *
+ * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while
+ * ACTION_TRIGGER specifies kernel->user signaling.
+ */
+struct vfio_irq_set {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_IRQ_SET_DATA_NONE         (1 << 0) /* Data not present */
+#define VFIO_IRQ_SET_DATA_BOOL         (1 << 1) /* Data is bool (u8) */
+#define VFIO_IRQ_SET_DATA_EVENTFD      (1 << 2) /* Data is eventfd (s32) */
+#define VFIO_IRQ_SET_ACTION_MASK       (1 << 3) /* Mask interrupt */
+#define VFIO_IRQ_SET_ACTION_UNMASK     (1 << 4) /* Unmask interrupt */
+#define VFIO_IRQ_SET_ACTION_TRIGGER    (1 << 5) /* Trigger interrupt */
+       __u32   index;
+       __u32   start;
+       __u32   count;
+       __u8    data[];
+};
+#define VFIO_DEVICE_SET_IRQS           _IO(VFIO_TYPE, VFIO_BASE + 10)
+
+#define VFIO_IRQ_SET_DATA_TYPE_MASK    (VFIO_IRQ_SET_DATA_NONE | \
+                                        VFIO_IRQ_SET_DATA_BOOL | \
+                                        VFIO_IRQ_SET_DATA_EVENTFD)
+#define VFIO_IRQ_SET_ACTION_TYPE_MASK  (VFIO_IRQ_SET_ACTION_MASK | \
+                                        VFIO_IRQ_SET_ACTION_UNMASK | \
+                                        VFIO_IRQ_SET_ACTION_TRIGGER)
+/**
+ * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
+ *
+ * Reset a device.
+ */
+#define VFIO_DEVICE_RESET              _IO(VFIO_TYPE, VFIO_BASE + 11)
+
+/*
+ * The VFIO-PCI bus driver makes use of the following fixed region and
+ * IRQ index mapping.  Unimplemented regions return a size of zero.
+ * Unimplemented IRQ types return a count of zero.
+ */
+
+enum {
+       VFIO_PCI_BAR0_REGION_INDEX,
+       VFIO_PCI_BAR1_REGION_INDEX,
+       VFIO_PCI_BAR2_REGION_INDEX,
+       VFIO_PCI_BAR3_REGION_INDEX,
+       VFIO_PCI_BAR4_REGION_INDEX,
+       VFIO_PCI_BAR5_REGION_INDEX,
+       VFIO_PCI_ROM_REGION_INDEX,
+       VFIO_PCI_CONFIG_REGION_INDEX,
+       VFIO_PCI_NUM_REGIONS
+};
+
+enum {
+       VFIO_PCI_INTX_IRQ_INDEX,
+       VFIO_PCI_MSI_IRQ_INDEX,
+       VFIO_PCI_MSIX_IRQ_INDEX,
+       VFIO_PCI_NUM_IRQS
+};
+
+/* -------- API for Type1 VFIO IOMMU -------- */
+
+/**
+ * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info)
+ *
+ * Retrieve information about the IOMMU object. Fills in provided
+ * struct vfio_iommu_info. Caller sets argsz.
+ *
+ * XXX Should we do these by CHECK_EXTENSION too?
+ */
+struct vfio_iommu_type1_info {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_IOMMU_INFO_PGSIZES (1 << 0)       /* supported page sizes info */
+       __u64   iova_pgsizes;           /* Bitmap of supported page sizes */
+};
+
+#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
+
+/**
+ * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map)
+ *
+ * Map process virtual addresses to IO virtual addresses using the
+ * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
+ */
+struct vfio_iommu_type1_dma_map {
+       __u32   argsz;
+       __u32   flags;
+#define VFIO_DMA_MAP_FLAG_READ (1 << 0)                /* readable from device */
+#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1)       /* writable from device */
+       __u64   vaddr;                          /* Process virtual address */
+       __u64   iova;                           /* IO virtual address */
+       __u64   size;                           /* Size of mapping (bytes) */
+};
+
+#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
+
+/**
+ * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap)
+ *
+ * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
+ * Caller sets argsz.
+ */
+struct vfio_iommu_type1_dma_unmap {
+       __u32   argsz;
+       __u32   flags;
+       __u64   iova;                           /* IO virtual address */
+       __u64   size;                           /* Size of mapping (bytes) */
+};
+
+#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
+
+#endif /* _UAPIVFIO_H */
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
new file mode 100644 (file)
index 0000000..57bfa59
--- /dev/null
@@ -0,0 +1,1998 @@
+/*
+ *  Video for Linux Two header file
+ *
+ *  Copyright (C) 1999-2012 the contributors
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  Alternatively you can redistribute this file under the terms of the
+ *  BSD license as stated below:
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *  3. The names of its contributors may not be used to endorse or promote
+ *     products derived from this software without specific prior written
+ *     permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *     Header file for v4l or V4L2 drivers and applications
+ * with public API.
+ * All kernel-specific stuff were moved to media/v4l2-dev.h, so
+ * no #if __KERNEL tests are allowed here
+ *
+ *     See http://linuxtv.org for more info
+ *
+ *     Author: Bill Dirks <bill@thedirks.org>
+ *             Justin Schoeman
+ *              Hans Verkuil <hverkuil@xs4all.nl>
+ *             et al.
+ */
+#ifndef _UAPI__LINUX_VIDEODEV2_H
+#define _UAPI__LINUX_VIDEODEV2_H
+
+#ifndef __KERNEL__
+#include <sys/time.h>
+#endif
+#include <linux/compiler.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/v4l2-common.h>
+#include <linux/v4l2-controls.h>
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+#define VIDEO_MAX_FRAME               32
+#define VIDEO_MAX_PLANES               8
+
+#ifndef __KERNEL__
+
+/* These defines are V4L1 specific and should not be used with the V4L2 API!
+   They will be removed from this header in the future. */
+
+#define VID_TYPE_CAPTURE       1       /* Can capture */
+#define VID_TYPE_TUNER         2       /* Can tune */
+#define VID_TYPE_TELETEXT      4       /* Does teletext */
+#define VID_TYPE_OVERLAY       8       /* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY     16      /* Overlay by chromakey */
+#define VID_TYPE_CLIPPING      32      /* Can clip */
+#define VID_TYPE_FRAMERAM      64      /* Uses the frame buffer memory */
+#define VID_TYPE_SCALES                128     /* Scalable */
+#define VID_TYPE_MONOCHROME    256     /* Monochrome only */
+#define VID_TYPE_SUBCAPTURE    512     /* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER  1024    /* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER  2048    /* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER 4096    /* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER 8192    /* Can encode MJPEG streams */
+#endif
+
+/*
+ *     M I S C E L L A N E O U S
+ */
+
+/*  Four-character-code (FOURCC) */
+#define v4l2_fourcc(a, b, c, d)\
+       ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
+
+/*
+ *     E N U M S
+ */
+enum v4l2_field {
+       V4L2_FIELD_ANY           = 0, /* driver can choose from none,
+                                        top, bottom, interlaced
+                                        depending on whatever it thinks
+                                        is approximate ... */
+       V4L2_FIELD_NONE          = 1, /* this device has no fields ... */
+       V4L2_FIELD_TOP           = 2, /* top field only */
+       V4L2_FIELD_BOTTOM        = 3, /* bottom field only */
+       V4L2_FIELD_INTERLACED    = 4, /* both fields interlaced */
+       V4L2_FIELD_SEQ_TB        = 5, /* both fields sequential into one
+                                        buffer, top-bottom order */
+       V4L2_FIELD_SEQ_BT        = 6, /* same as above + bottom-top order */
+       V4L2_FIELD_ALTERNATE     = 7, /* both fields alternating into
+                                        separate buffers */
+       V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+                                        first and the top field is
+                                        transmitted first */
+       V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+                                        first and the bottom field is
+                                        transmitted first */
+};
+#define V4L2_FIELD_HAS_TOP(field)      \
+       ((field) == V4L2_FIELD_TOP      ||\
+        (field) == V4L2_FIELD_INTERLACED ||\
+        (field) == V4L2_FIELD_INTERLACED_TB ||\
+        (field) == V4L2_FIELD_INTERLACED_BT ||\
+        (field) == V4L2_FIELD_SEQ_TB   ||\
+        (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field)   \
+       ((field) == V4L2_FIELD_BOTTOM   ||\
+        (field) == V4L2_FIELD_INTERLACED ||\
+        (field) == V4L2_FIELD_INTERLACED_TB ||\
+        (field) == V4L2_FIELD_INTERLACED_BT ||\
+        (field) == V4L2_FIELD_SEQ_TB   ||\
+        (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field)     \
+       ((field) == V4L2_FIELD_INTERLACED ||\
+        (field) == V4L2_FIELD_INTERLACED_TB ||\
+        (field) == V4L2_FIELD_INTERLACED_BT ||\
+        (field) == V4L2_FIELD_SEQ_TB ||\
+        (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+       V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
+       V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
+       V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
+       V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
+       V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
+       V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
+       V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
+#if 1
+       /* Experimental */
+       V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+       V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
+       V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
+       /* Deprecated, do not use */
+       V4L2_BUF_TYPE_PRIVATE              = 0x80,
+};
+
+#define V4L2_TYPE_IS_MULTIPLANAR(type)                 \
+       ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE   \
+        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
+
+#define V4L2_TYPE_IS_OUTPUT(type)                              \
+       ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT                   \
+        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE         \
+        || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY               \
+        || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY        \
+        || (type) == V4L2_BUF_TYPE_VBI_OUTPUT                  \
+        || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
+
+enum v4l2_tuner_type {
+       V4L2_TUNER_RADIO             = 1,
+       V4L2_TUNER_ANALOG_TV         = 2,
+       V4L2_TUNER_DIGITAL_TV        = 3,
+};
+
+enum v4l2_memory {
+       V4L2_MEMORY_MMAP             = 1,
+       V4L2_MEMORY_USERPTR          = 2,
+       V4L2_MEMORY_OVERLAY          = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+       /* ITU-R 601 -- broadcast NTSC/PAL */
+       V4L2_COLORSPACE_SMPTE170M     = 1,
+
+       /* 1125-Line (US) HDTV */
+       V4L2_COLORSPACE_SMPTE240M     = 2,
+
+       /* HD and modern captures. */
+       V4L2_COLORSPACE_REC709        = 3,
+
+       /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+       V4L2_COLORSPACE_BT878         = 4,
+
+       /* These should be useful.  Assume 601 extents. */
+       V4L2_COLORSPACE_470_SYSTEM_M  = 5,
+       V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+       /* I know there will be cameras that send this.  So, this is
+        * unspecified chromaticities and full 0-255 on each of the
+        * Y'CbCr components
+        */
+       V4L2_COLORSPACE_JPEG          = 7,
+
+       /* For RGB colourspaces, this is probably a good start. */
+       V4L2_COLORSPACE_SRGB          = 8,
+};
+
+enum v4l2_priority {
+       V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
+       V4L2_PRIORITY_BACKGROUND  = 1,
+       V4L2_PRIORITY_INTERACTIVE = 2,
+       V4L2_PRIORITY_RECORD      = 3,
+       V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct v4l2_rect {
+       __s32   left;
+       __s32   top;
+       __s32   width;
+       __s32   height;
+};
+
+struct v4l2_fract {
+       __u32   numerator;
+       __u32   denominator;
+};
+
+/**
+  * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
+  *
+  * @driver:      name of the driver module (e.g. "bttv")
+  * @card:        name of the card (e.g. "Hauppauge WinTV")
+  * @bus_info:    name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
+  * @version:     KERNEL_VERSION
+  * @capabilities: capabilities of the physical device as a whole
+  * @device_caps:  capabilities accessed via this particular device (node)
+  * @reserved:    reserved fields for future extensions
+  */
+struct v4l2_capability {
+       __u8    driver[16];
+       __u8    card[32];
+       __u8    bus_info[32];
+       __u32   version;
+       __u32   capabilities;
+       __u32   device_caps;
+       __u32   reserved[3];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE         0x00000001  /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT          0x00000002  /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY         0x00000004  /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE           0x00000010  /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT            0x00000020  /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE    0x00000040  /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT     0x00000080  /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE           0x00000100  /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY  0x00000200  /* Can do video output overlay */
+#define V4L2_CAP_HW_FREQ_SEEK          0x00000400  /* Can do hardware frequency seek  */
+#define V4L2_CAP_RDS_OUTPUT            0x00000800  /* Is an RDS encoder */
+
+/* Is a video capture device that supports multiplanar formats */
+#define V4L2_CAP_VIDEO_CAPTURE_MPLANE  0x00001000
+/* Is a video output device that supports multiplanar formats */
+#define V4L2_CAP_VIDEO_OUTPUT_MPLANE   0x00002000
+/* Is a video mem-to-mem device that supports multiplanar formats */
+#define V4L2_CAP_VIDEO_M2M_MPLANE      0x00004000
+/* Is a video mem-to-mem device */
+#define V4L2_CAP_VIDEO_M2M             0x00008000
+
+#define V4L2_CAP_TUNER                 0x00010000  /* has a tuner */
+#define V4L2_CAP_AUDIO                 0x00020000  /* has audio support */
+#define V4L2_CAP_RADIO                 0x00040000  /* is a radio device */
+#define V4L2_CAP_MODULATOR             0x00080000  /* has a modulator */
+
+#define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
+#define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
+
+#define V4L2_CAP_DEVICE_CAPS            0x80000000  /* sets device capabilities field */
+
+/*
+ *     V I D E O   I M A G E   F O R M A T
+ */
+struct v4l2_pix_format {
+       __u32                   width;
+       __u32                   height;
+       __u32                   pixelformat;
+       __u32                   field;          /* enum v4l2_field */
+       __u32                   bytesperline;   /* for padding, zero if unused */
+       __u32                   sizeimage;
+       __u32                   colorspace;     /* enum v4l2_colorspace */
+       __u32                   priv;           /* private data, depends on pixelformat */
+};
+
+/*      Pixel format         FOURCC                          depth  Description  */
+
+/* RGB formats */
+#define V4L2_PIX_FMT_RGB332  v4l2_fourcc('R', 'G', 'B', '1') /*  8  RGB-3-3-2     */
+#define V4L2_PIX_FMT_RGB444  v4l2_fourcc('R', '4', '4', '4') /* 16  xxxxrrrr ggggbbbb */
+#define V4L2_PIX_FMT_RGB555  v4l2_fourcc('R', 'G', 'B', 'O') /* 16  RGB-5-5-5     */
+#define V4L2_PIX_FMT_RGB565  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5     */
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16  RGB-5-6-5 BE  */
+#define V4L2_PIX_FMT_BGR666  v4l2_fourcc('B', 'G', 'R', 'H') /* 18  BGR-6-6-6    */
+#define V4L2_PIX_FMT_BGR24   v4l2_fourcc('B', 'G', 'R', '3') /* 24  BGR-8-8-8     */
+#define V4L2_PIX_FMT_RGB24   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */
+#define V4L2_PIX_FMT_BGR32   v4l2_fourcc('B', 'G', 'R', '4') /* 32  BGR-8-8-8-8   */
+#define V4L2_PIX_FMT_RGB32   v4l2_fourcc('R', 'G', 'B', '4') /* 32  RGB-8-8-8-8   */
+
+/* Grey formats */
+#define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */
+#define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */
+#define V4L2_PIX_FMT_Y6      v4l2_fourcc('Y', '0', '6', ' ') /*  6  Greyscale     */
+#define V4L2_PIX_FMT_Y10     v4l2_fourcc('Y', '1', '0', ' ') /* 10  Greyscale     */
+#define V4L2_PIX_FMT_Y12     v4l2_fourcc('Y', '1', '2', ' ') /* 12  Greyscale     */
+#define V4L2_PIX_FMT_Y16     v4l2_fourcc('Y', '1', '6', ' ') /* 16  Greyscale     */
+
+/* Grey bit-packed formats */
+#define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
+
+/* Palette formats */
+#define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
+
+/* Luminance+Chrominance formats */
+#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
+#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
+#define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
+#define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */
+#define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */
+#define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
+#define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
+#define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
+#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
+#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
+#define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
+#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */
+#define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
+
+/* two planes -- one Y, one Cr + Cb interleaved  */
+#define V4L2_PIX_FMT_NV12    v4l2_fourcc('N', 'V', '1', '2') /* 12  Y/CbCr 4:2:0  */
+#define V4L2_PIX_FMT_NV21    v4l2_fourcc('N', 'V', '2', '1') /* 12  Y/CrCb 4:2:0  */
+#define V4L2_PIX_FMT_NV16    v4l2_fourcc('N', 'V', '1', '6') /* 16  Y/CbCr 4:2:2  */
+#define V4L2_PIX_FMT_NV61    v4l2_fourcc('N', 'V', '6', '1') /* 16  Y/CrCb 4:2:2  */
+#define V4L2_PIX_FMT_NV24    v4l2_fourcc('N', 'V', '2', '4') /* 24  Y/CbCr 4:4:4  */
+#define V4L2_PIX_FMT_NV42    v4l2_fourcc('N', 'V', '4', '2') /* 24  Y/CrCb 4:4:4  */
+
+/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
+#define V4L2_PIX_FMT_NV12M   v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
+#define V4L2_PIX_FMT_NV21M   v4l2_fourcc('N', 'M', '2', '1') /* 21  Y/CrCb 4:2:0  */
+#define V4L2_PIX_FMT_NV12MT  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
+#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
+
+/* three non contiguous planes - Y, Cb, Cr */
+#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12  YUV420 planar */
+#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12  YVU420 planar */
+
+/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
+#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. GBGB.. */
+#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
+       /* 10bit raw bayer DPCM compressed to 8 bits */
+#define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
+#define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
+#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
+#define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
+       /*
+        * 10bit raw bayer, expanded to 16 bits
+        * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
+        */
+#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
+
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
+#define V4L2_PIX_FMT_JPEG     v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG     */
+#define V4L2_PIX_FMT_DV       v4l2_fourcc('d', 'v', 's', 'd') /* 1394          */
+#define V4L2_PIX_FMT_MPEG     v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
+#define V4L2_PIX_FMT_H264     v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
+#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
+#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
+#define V4L2_PIX_FMT_H263     v4l2_fourcc('H', '2', '6', '3') /* H263          */
+#define V4L2_PIX_FMT_MPEG1    v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES     */
+#define V4L2_PIX_FMT_MPEG2    v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES     */
+#define V4L2_PIX_FMT_MPEG4    v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES     */
+#define V4L2_PIX_FMT_XVID     v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid           */
+#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
+#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
+#define V4L2_PIX_FMT_VP8      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
+
+/*  Vendor-specific formats   */
+#define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
+#define V4L2_PIX_FMT_WNVA     v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
+#define V4L2_PIX_FMT_SN9C10X  v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
+#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
+#define V4L2_PIX_FMT_PWC1     v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
+#define V4L2_PIX_FMT_PWC2     v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
+#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
+#define V4L2_PIX_FMT_SPCA501  v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
+#define V4L2_PIX_FMT_SPCA505  v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
+#define V4L2_PIX_FMT_SPCA508  v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
+#define V4L2_PIX_FMT_SPCA561  v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
+#define V4L2_PIX_FMT_PAC207   v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
+#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
+#define V4L2_PIX_FMT_SQ905C   v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
+#define V4L2_PIX_FMT_PJPG     v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
+#define V4L2_PIX_FMT_OV511    v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
+#define V4L2_PIX_FMT_OV518    v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
+#define V4L2_PIX_FMT_STV0680  v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
+#define V4L2_PIX_FMT_TM6000   v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
+#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
+#define V4L2_PIX_FMT_KONICA420  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
+#define V4L2_PIX_FMT_JPGL      v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
+#define V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
+#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
+
+/*
+ *     F O R M A T   E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc {
+       __u32               index;             /* Format number      */
+       __u32               type;              /* enum v4l2_buf_type */
+       __u32               flags;
+       __u8                description[32];   /* Description string */
+       __u32               pixelformat;       /* Format fourcc      */
+       __u32               reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+#define V4L2_FMT_FLAG_EMULATED   0x0002
+
+#if 1
+       /* Experimental Frame Size and frame rate enumeration */
+/*
+ *     F R A M E   S I Z E   E N U M E R A T I O N
+ */
+enum v4l2_frmsizetypes {
+       V4L2_FRMSIZE_TYPE_DISCRETE      = 1,
+       V4L2_FRMSIZE_TYPE_CONTINUOUS    = 2,
+       V4L2_FRMSIZE_TYPE_STEPWISE      = 3,
+};
+
+struct v4l2_frmsize_discrete {
+       __u32                   width;          /* Frame width [pixel] */
+       __u32                   height;         /* Frame height [pixel] */
+};
+
+struct v4l2_frmsize_stepwise {
+       __u32                   min_width;      /* Minimum frame width [pixel] */
+       __u32                   max_width;      /* Maximum frame width [pixel] */
+       __u32                   step_width;     /* Frame width step size [pixel] */
+       __u32                   min_height;     /* Minimum frame height [pixel] */
+       __u32                   max_height;     /* Maximum frame height [pixel] */
+       __u32                   step_height;    /* Frame height step size [pixel] */
+};
+
+struct v4l2_frmsizeenum {
+       __u32                   index;          /* Frame size number */
+       __u32                   pixel_format;   /* Pixel format */
+       __u32                   type;           /* Frame size type the device supports. */
+
+       union {                                 /* Frame size */
+               struct v4l2_frmsize_discrete    discrete;
+               struct v4l2_frmsize_stepwise    stepwise;
+       };
+
+       __u32   reserved[2];                    /* Reserved space for future use */
+};
+
+/*
+ *     F R A M E   R A T E   E N U M E R A T I O N
+ */
+enum v4l2_frmivaltypes {
+       V4L2_FRMIVAL_TYPE_DISCRETE      = 1,
+       V4L2_FRMIVAL_TYPE_CONTINUOUS    = 2,
+       V4L2_FRMIVAL_TYPE_STEPWISE      = 3,
+};
+
+struct v4l2_frmival_stepwise {
+       struct v4l2_fract       min;            /* Minimum frame interval [s] */
+       struct v4l2_fract       max;            /* Maximum frame interval [s] */
+       struct v4l2_fract       step;           /* Frame interval step size [s] */
+};
+
+struct v4l2_frmivalenum {
+       __u32                   index;          /* Frame format index */
+       __u32                   pixel_format;   /* Pixel format */
+       __u32                   width;          /* Frame width */
+       __u32                   height;         /* Frame height */
+       __u32                   type;           /* Frame interval type the device supports. */
+
+       union {                                 /* Frame interval */
+               struct v4l2_fract               discrete;
+               struct v4l2_frmival_stepwise    stepwise;
+       };
+
+       __u32   reserved[2];                    /* Reserved space for future use */
+};
+#endif
+
+/*
+ *     T I M E C O D E
+ */
+struct v4l2_timecode {
+       __u32   type;
+       __u32   flags;
+       __u8    frames;
+       __u8    seconds;
+       __u8    minutes;
+       __u8    hours;
+       __u8    userbits[4];
+};
+
+/*  Type  */
+#define V4L2_TC_TYPE_24FPS             1
+#define V4L2_TC_TYPE_25FPS             2
+#define V4L2_TC_TYPE_30FPS             3
+#define V4L2_TC_TYPE_50FPS             4
+#define V4L2_TC_TYPE_60FPS             5
+
+/*  Flags  */
+#define V4L2_TC_FLAG_DROPFRAME         0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME                0x0002
+#define V4L2_TC_USERBITS_field         0x000C
+#define V4L2_TC_USERBITS_USERDEFINED   0x0000
+#define V4L2_TC_USERBITS_8BITCHARS     0x0008
+/* The above is based on SMPTE timecodes */
+
+struct v4l2_jpegcompression {
+       int quality;
+
+       int  APPn;              /* Number of APP segment to be written,
+                                * must be 0..15 */
+       int  APP_len;           /* Length of data in JPEG APPn segment */
+       char APP_data[60];      /* Data in the JPEG APPn segment. */
+
+       int  COM_len;           /* Length of data in JPEG COM segment */
+       char COM_data[60];      /* Data in JPEG COM segment */
+
+       __u32 jpeg_markers;     /* Which markers should go into the JPEG
+                                * output. Unless you exactly know what
+                                * you do, leave them untouched.
+                                * Inluding less markers will make the
+                                * resulting code smaller, but there will
+                                * be fewer applications which can read it.
+                                * The presence of the APP and COM marker
+                                * is influenced by APP_len and COM_len
+                                * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3)    /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4)    /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5)    /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6)    /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7)    /* App segment, driver will
+                                       * allways use APP0 */
+};
+
+/*
+ *     M E M O R Y - M A P P I N G   B U F F E R S
+ */
+struct v4l2_requestbuffers {
+       __u32                   count;
+       __u32                   type;           /* enum v4l2_buf_type */
+       __u32                   memory;         /* enum v4l2_memory */
+       __u32                   reserved[2];
+};
+
+/**
+ * struct v4l2_plane - plane info for multi-planar buffers
+ * @bytesused:         number of bytes occupied by data in the plane (payload)
+ * @length:            size of this plane (NOT the payload) in bytes
+ * @mem_offset:                when memory in the associated struct v4l2_buffer is
+ *                     V4L2_MEMORY_MMAP, equals the offset from the start of
+ *                     the device memory for this plane (or is a "cookie" that
+ *                     should be passed to mmap() called on the video node)
+ * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer
+ *                     pointing to this plane
+ * @data_offset:       offset in the plane to the start of data; usually 0,
+ *                     unless there is a header in front of the data
+ *
+ * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
+ * with two planes can have one plane for Y, and another for interleaved CbCr
+ * components. Each plane can reside in a separate memory buffer, or even in
+ * a completely separate memory node (e.g. in embedded devices).
+ */
+struct v4l2_plane {
+       __u32                   bytesused;
+       __u32                   length;
+       union {
+               __u32           mem_offset;
+               unsigned long   userptr;
+       } m;
+       __u32                   data_offset;
+       __u32                   reserved[11];
+};
+
+/**
+ * struct v4l2_buffer - video buffer info
+ * @index:     id number of the buffer
+ * @type:      enum v4l2_buf_type; buffer type (type == *_MPLANE for
+ *             multiplanar buffers);
+ * @bytesused: number of bytes occupied by data in the buffer (payload);
+ *             unused (set to 0) for multiplanar buffers
+ * @flags:     buffer informational flags
+ * @field:     enum v4l2_field; field order of the image in the buffer
+ * @timestamp: frame timestamp
+ * @timecode:  frame timecode
+ * @sequence:  sequence count of this frame
+ * @memory:    enum v4l2_memory; the method, in which the actual video data is
+ *             passed
+ * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
+ *             offset from the start of the device memory for this plane,
+ *             (or a "cookie" that should be passed to mmap() as offset)
+ * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
+ *             a userspace pointer pointing to this buffer
+ * @planes:    for multiplanar buffers; userspace pointer to the array of plane
+ *             info structs for this buffer
+ * @length:    size in bytes of the buffer (NOT its payload) for single-plane
+ *             buffers (when type != *_MPLANE); number of elements in the
+ *             planes array for multi-plane buffers
+ * @input:     input number from which the video data has has been captured
+ *
+ * Contains data exchanged by application and driver using one of the Streaming
+ * I/O methods.
+ */
+struct v4l2_buffer {
+       __u32                   index;
+       __u32                   type;
+       __u32                   bytesused;
+       __u32                   flags;
+       __u32                   field;
+       struct timeval          timestamp;
+       struct v4l2_timecode    timecode;
+       __u32                   sequence;
+
+       /* memory location */
+       __u32                   memory;
+       union {
+               __u32           offset;
+               unsigned long   userptr;
+               struct v4l2_plane *planes;
+       } m;
+       __u32                   length;
+       __u32                   reserved2;
+       __u32                   reserved;
+};
+
+/*  Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED   0x0001  /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED   0x0002  /* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE     0x0004  /* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008  /* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME   0x0010  /* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME   0x0020  /* Image is a B-frame */
+/* Buffer is ready, but the data contained within is corrupted. */
+#define V4L2_BUF_FLAG_ERROR    0x0040
+#define V4L2_BUF_FLAG_TIMECODE 0x0100  /* timecode field is valid */
+#define V4L2_BUF_FLAG_PREPARED 0x0400  /* Buffer is prepared for queuing */
+/* Cache handling flags */
+#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE      0x0800
+#define V4L2_BUF_FLAG_NO_CACHE_CLEAN           0x1000
+
+/*
+ *     O V E R L A Y   P R E V I E W
+ */
+struct v4l2_framebuffer {
+       __u32                   capability;
+       __u32                   flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+       void                    *base;
+       struct v4l2_pix_format  fmt;
+};
+/*  Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY    0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY                0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING     0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING  0x0008
+#define V4L2_FBUF_CAP_LOCAL_ALPHA      0x0010
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA     0x0020
+#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA  0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY    0x0080
+/*  Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY         0x0001
+#define V4L2_FBUF_FLAG_OVERLAY         0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY       0x0004
+#define V4L2_FBUF_FLAG_LOCAL_ALPHA     0x0008
+#define V4L2_FBUF_FLAG_GLOBAL_ALPHA    0x0010
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY   0x0040
+
+struct v4l2_clip {
+       struct v4l2_rect        c;
+       struct v4l2_clip        __user *next;
+};
+
+struct v4l2_window {
+       struct v4l2_rect        w;
+       __u32                   field;   /* enum v4l2_field */
+       __u32                   chromakey;
+       struct v4l2_clip        __user *clips;
+       __u32                   clipcount;
+       void                    __user *bitmap;
+       __u8                    global_alpha;
+};
+
+/*
+ *     C A P T U R E   P A R A M E T E R S
+ */
+struct v4l2_captureparm {
+       __u32              capability;    /*  Supported modes */
+       __u32              capturemode;   /*  Current mode */
+       struct v4l2_fract  timeperframe;  /*  Time per frame in .1us units */
+       __u32              extendedmode;  /*  Driver-specific extensions */
+       __u32              readbuffers;   /*  # of buffers for read */
+       __u32              reserved[4];
+};
+
+/*  Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY  0x0001  /*  High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME  0x1000  /*  timeperframe field is supported */
+
+struct v4l2_outputparm {
+       __u32              capability;   /*  Supported modes */
+       __u32              outputmode;   /*  Current mode */
+       struct v4l2_fract  timeperframe; /*  Time per frame in seconds */
+       __u32              extendedmode; /*  Driver-specific extensions */
+       __u32              writebuffers; /*  # of buffers for write */
+       __u32              reserved[4];
+};
+
+/*
+ *     I N P U T   I M A G E   C R O P P I N G
+ */
+struct v4l2_cropcap {
+       __u32                   type;   /* enum v4l2_buf_type */
+       struct v4l2_rect        bounds;
+       struct v4l2_rect        defrect;
+       struct v4l2_fract       pixelaspect;
+};
+
+struct v4l2_crop {
+       __u32                   type;   /* enum v4l2_buf_type */
+       struct v4l2_rect        c;
+};
+
+/**
+ * struct v4l2_selection - selection info
+ * @type:      buffer type (do not use *_MPLANE types)
+ * @target:    Selection target, used to choose one of possible rectangles;
+ *             defined in v4l2-common.h; V4L2_SEL_TGT_* .
+ * @flags:     constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
+ * @r:         coordinates of selection window
+ * @reserved:  for future use, rounds structure size to 64 bytes, set to zero
+ *
+ * Hardware may use multiple helper windows to process a video stream.
+ * The structure is used to exchange this selection areas between
+ * an application and a driver.
+ */
+struct v4l2_selection {
+       __u32                   type;
+       __u32                   target;
+       __u32                   flags;
+       struct v4l2_rect        r;
+       __u32                   reserved[9];
+};
+
+
+/*
+ *      A N A L O G   V I D E O   S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)      /* BTSC */
+#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)      /* EIA-J */
+#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)      /* FM A2 */
+
+#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
+
+/* FIXME:
+   Although std_id is 64 bits, there is an issue on PPC32 architecture that
+   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+   this value to 32 bits.
+   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+   it should work fine. However, if needed to add more than two standards,
+   v4l2-common.c should be fixed.
+ */
+
+/*
+ * Some macros to merge video standards in order to make live easier for the
+ * drivers and V4L2 applications
+ */
+
+/*
+ * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
+ * Missing here.
+ */
+#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M       |\
+                                V4L2_STD_NTSC_M_JP     |\
+                                V4L2_STD_NTSC_M_KR)
+/* Secam macros */
+#define V4L2_STD_SECAM_DK              (V4L2_STD_SECAM_D       |\
+                                V4L2_STD_SECAM_K       |\
+                                V4L2_STD_SECAM_K1)
+/* All Secam Standards */
+#define V4L2_STD_SECAM         (V4L2_STD_SECAM_B       |\
+                                V4L2_STD_SECAM_G       |\
+                                V4L2_STD_SECAM_H       |\
+                                V4L2_STD_SECAM_DK      |\
+                                V4L2_STD_SECAM_L       |\
+                                V4L2_STD_SECAM_LC)
+/* PAL macros */
+#define V4L2_STD_PAL_BG                (V4L2_STD_PAL_B         |\
+                                V4L2_STD_PAL_B1        |\
+                                V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK                (V4L2_STD_PAL_D         |\
+                                V4L2_STD_PAL_D1        |\
+                                V4L2_STD_PAL_K)
+/*
+ * "Common" PAL - This macro is there to be compatible with the old
+ * V4L1 concept of "PAL": /BGDKHI.
+ * Several PAL standards are mising here: /M, /N and /Nc
+ */
+#define V4L2_STD_PAL           (V4L2_STD_PAL_BG        |\
+                                V4L2_STD_PAL_DK        |\
+                                V4L2_STD_PAL_H         |\
+                                V4L2_STD_PAL_I)
+/* Chroma "agnostic" standards */
+#define V4L2_STD_B             (V4L2_STD_PAL_B         |\
+                                V4L2_STD_PAL_B1        |\
+                                V4L2_STD_SECAM_B)
+#define V4L2_STD_G             (V4L2_STD_PAL_G         |\
+                                V4L2_STD_SECAM_G)
+#define V4L2_STD_H             (V4L2_STD_PAL_H         |\
+                                V4L2_STD_SECAM_H)
+#define V4L2_STD_L             (V4L2_STD_SECAM_L       |\
+                                V4L2_STD_SECAM_LC)
+#define V4L2_STD_GH            (V4L2_STD_G             |\
+                                V4L2_STD_H)
+#define V4L2_STD_DK            (V4L2_STD_PAL_DK        |\
+                                V4L2_STD_SECAM_DK)
+#define V4L2_STD_BG            (V4L2_STD_B             |\
+                                V4L2_STD_G)
+#define V4L2_STD_MN            (V4L2_STD_PAL_M         |\
+                                V4L2_STD_PAL_N         |\
+                                V4L2_STD_PAL_Nc        |\
+                                V4L2_STD_NTSC)
+
+/* Standards where MTS/BTSC stereo could be found */
+#define V4L2_STD_MTS           (V4L2_STD_NTSC_M        |\
+                                V4L2_STD_PAL_M         |\
+                                V4L2_STD_PAL_N         |\
+                                V4L2_STD_PAL_Nc)
+
+/* Standards for Countries with 60Hz Line frequency */
+#define V4L2_STD_525_60                (V4L2_STD_PAL_M         |\
+                                V4L2_STD_PAL_60        |\
+                                V4L2_STD_NTSC          |\
+                                V4L2_STD_NTSC_443)
+/* Standards for Countries with 50Hz Line frequency */
+#define V4L2_STD_625_50                (V4L2_STD_PAL           |\
+                                V4L2_STD_PAL_N         |\
+                                V4L2_STD_PAL_Nc        |\
+                                V4L2_STD_SECAM)
+
+#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
+                                V4L2_STD_ATSC_16_VSB)
+/* Macros with none and all analog standards */
+#define V4L2_STD_UNKNOWN        0
+#define V4L2_STD_ALL            (V4L2_STD_525_60       |\
+                                V4L2_STD_625_50)
+
+struct v4l2_standard {
+       __u32                index;
+       v4l2_std_id          id;
+       __u8                 name[24];
+       struct v4l2_fract    frameperiod; /* Frames, not fields */
+       __u32                framelines;
+       __u32                reserved[4];
+};
+
+/* The DV Preset API is deprecated in favor of the DV Timings API.
+   New drivers shouldn't use this anymore! */
+
+/*
+ *     V I D E O       T I M I N G S   D V     P R E S E T
+ */
+struct v4l2_dv_preset {
+       __u32   preset;
+       __u32   reserved[4];
+};
+
+/*
+ *     D V     P R E S E T S   E N U M E R A T I O N
+ */
+struct v4l2_dv_enum_preset {
+       __u32   index;
+       __u32   preset;
+       __u8    name[32]; /* Name of the preset timing */
+       __u32   width;
+       __u32   height;
+       __u32   reserved[4];
+};
+
+/*
+ *     D V     P R E S E T     V A L U E S
+ */
+#define                V4L2_DV_INVALID         0
+#define                V4L2_DV_480P59_94       1 /* BT.1362 */
+#define                V4L2_DV_576P50          2 /* BT.1362 */
+#define                V4L2_DV_720P24          3 /* SMPTE 296M */
+#define                V4L2_DV_720P25          4 /* SMPTE 296M */
+#define                V4L2_DV_720P30          5 /* SMPTE 296M */
+#define                V4L2_DV_720P50          6 /* SMPTE 296M */
+#define                V4L2_DV_720P59_94       7 /* SMPTE 274M */
+#define                V4L2_DV_720P60          8 /* SMPTE 274M/296M */
+#define                V4L2_DV_1080I29_97      9 /* BT.1120/ SMPTE 274M */
+#define                V4L2_DV_1080I30         10 /* BT.1120/ SMPTE 274M */
+#define                V4L2_DV_1080I25         11 /* BT.1120 */
+#define                V4L2_DV_1080I50         12 /* SMPTE 296M */
+#define                V4L2_DV_1080I60         13 /* SMPTE 296M */
+#define                V4L2_DV_1080P24         14 /* SMPTE 296M */
+#define                V4L2_DV_1080P25         15 /* SMPTE 296M */
+#define                V4L2_DV_1080P30         16 /* SMPTE 296M */
+#define                V4L2_DV_1080P50         17 /* BT.1120 */
+#define                V4L2_DV_1080P60         18 /* BT.1120 */
+
+/*
+ *     D V     B T     T I M I N G S
+ */
+
+/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
+ * @width:     total width of the active video in pixels
+ * @height:    total height of the active video in lines
+ * @interlaced:        Interlaced or progressive
+ * @polarities:        Positive or negative polarities
+ * @pixelclock:        Pixel clock in HZ. Ex. 74.25MHz->74250000
+ * @hfrontporch:Horizontal front porch in pixels
+ * @hsync:     Horizontal Sync length in pixels
+ * @hbackporch:        Horizontal back porch in pixels
+ * @vfrontporch:Vertical front porch in lines
+ * @vsync:     Vertical Sync length in lines
+ * @vbackporch:        Vertical back porch in lines
+ * @il_vfrontporch:Vertical front porch for the even field
+ *             (aka field 2) of interlaced field formats
+ * @il_vsync:  Vertical Sync length for the even field
+ *             (aka field 2) of interlaced field formats
+ * @il_vbackporch:Vertical back porch for the even field
+ *             (aka field 2) of interlaced field formats
+ * @standards: Standards the timing belongs to
+ * @flags:     Flags
+ * @reserved:  Reserved fields, must be zeroed.
+ *
+ * A note regarding vertical interlaced timings: height refers to the total
+ * height of the active video frame (= two fields). The blanking timings refer
+ * to the blanking of each field. So the height of the total frame is
+ * calculated as follows:
+ *
+ * tot_height = height + vfrontporch + vsync + vbackporch +
+ *                       il_vfrontporch + il_vsync + il_vbackporch
+ *
+ * The active height of each field is height / 2.
+ */
+struct v4l2_bt_timings {
+       __u32   width;
+       __u32   height;
+       __u32   interlaced;
+       __u32   polarities;
+       __u64   pixelclock;
+       __u32   hfrontporch;
+       __u32   hsync;
+       __u32   hbackporch;
+       __u32   vfrontporch;
+       __u32   vsync;
+       __u32   vbackporch;
+       __u32   il_vfrontporch;
+       __u32   il_vsync;
+       __u32   il_vbackporch;
+       __u32   standards;
+       __u32   flags;
+       __u32   reserved[14];
+} __attribute__ ((packed));
+
+/* Interlaced or progressive format */
+#define        V4L2_DV_PROGRESSIVE     0
+#define        V4L2_DV_INTERLACED      1
+
+/* Polarities. If bit is not set, it is assumed to be negative polarity */
+#define V4L2_DV_VSYNC_POS_POL  0x00000001
+#define V4L2_DV_HSYNC_POS_POL  0x00000002
+
+/* Timings standards */
+#define V4L2_DV_BT_STD_CEA861  (1 << 0)  /* CEA-861 Digital TV Profile */
+#define V4L2_DV_BT_STD_DMT     (1 << 1)  /* VESA Discrete Monitor Timings */
+#define V4L2_DV_BT_STD_CVT     (1 << 2)  /* VESA Coordinated Video Timings */
+#define V4L2_DV_BT_STD_GTF     (1 << 3)  /* VESA Generalized Timings Formula */
+
+/* Flags */
+
+/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
+   GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
+   intervals are reduced, allowing a higher resolution over the same
+   bandwidth. This is a read-only flag. */
+#define V4L2_DV_FL_REDUCED_BLANKING            (1 << 0)
+/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
+   of six. These formats can be optionally played at 1 / 1.001 speed.
+   This is a read-only flag. */
+#define V4L2_DV_FL_CAN_REDUCE_FPS              (1 << 1)
+/* CEA-861 specific: only valid for video transmitters, the flag is cleared
+   by receivers.
+   If the framerate of the format is a multiple of six, then the pixelclock
+   used to set up the transmitter is divided by 1.001 to make it compatible
+   with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
+   29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
+   such frequencies, then the flag will also be cleared. */
+#define V4L2_DV_FL_REDUCED_FPS                 (1 << 2)
+/* Specific to interlaced formats: if set, then field 1 is really one half-line
+   longer and field 2 is really one half-line shorter, so each field has
+   exactly the same number of half-lines. Whether half-lines can be detected
+   or used depends on the hardware. */
+#define V4L2_DV_FL_HALF_LINE                   (1 << 0)
+
+
+/** struct v4l2_dv_timings - DV timings
+ * @type:      the type of the timings
+ * @bt:        BT656/1120 timings
+ */
+struct v4l2_dv_timings {
+       __u32 type;
+       union {
+               struct v4l2_bt_timings  bt;
+               __u32   reserved[32];
+       };
+} __attribute__ ((packed));
+
+/* Values for the type field */
+#define V4L2_DV_BT_656_1120    0       /* BT.656/1120 timing type */
+
+
+/** struct v4l2_enum_dv_timings - DV timings enumeration
+ * @index:     enumeration index
+ * @reserved:  must be zeroed
+ * @timings:   the timings for the given index
+ */
+struct v4l2_enum_dv_timings {
+       __u32 index;
+       __u32 reserved[3];
+       struct v4l2_dv_timings timings;
+};
+
+/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
+ * @min_width:         width in pixels
+ * @max_width:         width in pixels
+ * @min_height:                height in lines
+ * @max_height:                height in lines
+ * @min_pixelclock:    Pixel clock in HZ. Ex. 74.25MHz->74250000
+ * @max_pixelclock:    Pixel clock in HZ. Ex. 74.25MHz->74250000
+ * @standards:         Supported standards
+ * @capabilities:      Supported capabilities
+ * @reserved:          Must be zeroed
+ */
+struct v4l2_bt_timings_cap {
+       __u32   min_width;
+       __u32   max_width;
+       __u32   min_height;
+       __u32   max_height;
+       __u64   min_pixelclock;
+       __u64   max_pixelclock;
+       __u32   standards;
+       __u32   capabilities;
+       __u32   reserved[16];
+} __attribute__ ((packed));
+
+/* Supports interlaced formats */
+#define V4L2_DV_BT_CAP_INTERLACED      (1 << 0)
+/* Supports progressive formats */
+#define V4L2_DV_BT_CAP_PROGRESSIVE     (1 << 1)
+/* Supports CVT/GTF reduced blanking */
+#define V4L2_DV_BT_CAP_REDUCED_BLANKING        (1 << 2)
+/* Supports custom formats */
+#define V4L2_DV_BT_CAP_CUSTOM          (1 << 3)
+
+/** struct v4l2_dv_timings_cap - DV timings capabilities
+ * @type:      the type of the timings (same as in struct v4l2_dv_timings)
+ * @bt:                the BT656/1120 timings capabilities
+ */
+struct v4l2_dv_timings_cap {
+       __u32 type;
+       __u32 reserved[3];
+       union {
+               struct v4l2_bt_timings_cap bt;
+               __u32 raw_data[32];
+       };
+};
+
+
+/*
+ *     V I D E O   I N P U T S
+ */
+struct v4l2_input {
+       __u32        index;             /*  Which input */
+       __u8         name[32];          /*  Label */
+       __u32        type;              /*  Type of input */
+       __u32        audioset;          /*  Associated audios (bitfield) */
+       __u32        tuner;             /*  enum v4l2_tuner_type */
+       v4l2_std_id  std;
+       __u32        status;
+       __u32        capabilities;
+       __u32        reserved[3];
+};
+
+/*  Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER          1
+#define V4L2_INPUT_TYPE_CAMERA         2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL   0x00000002
+#define V4L2_IN_ST_NO_COLOR    0x00000004
+
+/* field 'status' - sensor orientation */
+/* If sensor is mounted upside down set both bits */
+#define V4L2_IN_ST_HFLIP       0x00000010 /* Frames are flipped horizontally */
+#define V4L2_IN_ST_VFLIP       0x00000020 /* Frames are flipped vertically */
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU      0x00020000  /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER  0x00040000  /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000  /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS   0x02000000  /* Conditional access denied */
+#define V4L2_IN_ST_VTR         0x04000000  /* VTR time constant */
+
+/* capabilities flags */
+#define V4L2_IN_CAP_PRESETS            0x00000001 /* Supports S_DV_PRESET */
+#define V4L2_IN_CAP_DV_TIMINGS         0x00000002 /* Supports S_DV_TIMINGS */
+#define V4L2_IN_CAP_CUSTOM_TIMINGS     V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
+#define V4L2_IN_CAP_STD                        0x00000004 /* Supports S_STD */
+
+/*
+ *     V I D E O   O U T P U T S
+ */
+struct v4l2_output {
+       __u32        index;             /*  Which output */
+       __u8         name[32];          /*  Label */
+       __u32        type;              /*  Type of output */
+       __u32        audioset;          /*  Associated audios (bitfield) */
+       __u32        modulator;         /*  Associated modulator */
+       v4l2_std_id  std;
+       __u32        capabilities;
+       __u32        reserved[3];
+};
+/*  Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR             1
+#define V4L2_OUTPUT_TYPE_ANALOG                        2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY      3
+
+/* capabilities flags */
+#define V4L2_OUT_CAP_PRESETS           0x00000001 /* Supports S_DV_PRESET */
+#define V4L2_OUT_CAP_DV_TIMINGS                0x00000002 /* Supports S_DV_TIMINGS */
+#define V4L2_OUT_CAP_CUSTOM_TIMINGS    V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
+#define V4L2_OUT_CAP_STD               0x00000004 /* Supports S_STD */
+
+/*
+ *     C O N T R O L S
+ */
+struct v4l2_control {
+       __u32                id;
+       __s32                value;
+};
+
+struct v4l2_ext_control {
+       __u32 id;
+       __u32 size;
+       __u32 reserved2[1];
+       union {
+               __s32 value;
+               __s64 value64;
+               char *string;
+       };
+} __attribute__ ((packed));
+
+struct v4l2_ext_controls {
+       __u32 ctrl_class;
+       __u32 count;
+       __u32 error_idx;
+       __u32 reserved[2];
+       struct v4l2_ext_control *controls;
+};
+
+#define V4L2_CTRL_ID_MASK                (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id)    ((id) & 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
+
+enum v4l2_ctrl_type {
+       V4L2_CTRL_TYPE_INTEGER       = 1,
+       V4L2_CTRL_TYPE_BOOLEAN       = 2,
+       V4L2_CTRL_TYPE_MENU          = 3,
+       V4L2_CTRL_TYPE_BUTTON        = 4,
+       V4L2_CTRL_TYPE_INTEGER64     = 5,
+       V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
+       V4L2_CTRL_TYPE_STRING        = 7,
+       V4L2_CTRL_TYPE_BITMASK       = 8,
+       V4L2_CTRL_TYPE_INTEGER_MENU = 9,
+};
+
+/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl {
+       __u32                id;
+       __u32                type;      /* enum v4l2_ctrl_type */
+       __u8                 name[32];  /* Whatever */
+       __s32                minimum;   /* Note signedness */
+       __s32                maximum;
+       __s32                step;
+       __s32                default_value;
+       __u32                flags;
+       __u32                reserved[2];
+};
+
+/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu {
+       __u32           id;
+       __u32           index;
+       union {
+               __u8    name[32];       /* Whatever */
+               __s64   value;
+       };
+       __u32           reserved;
+} __attribute__ ((packed));
+
+/*  Control flags  */
+#define V4L2_CTRL_FLAG_DISABLED                0x0001
+#define V4L2_CTRL_FLAG_GRABBED         0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY       0x0004
+#define V4L2_CTRL_FLAG_UPDATE          0x0008
+#define V4L2_CTRL_FLAG_INACTIVE        0x0010
+#define V4L2_CTRL_FLAG_SLIDER          0x0020
+#define V4L2_CTRL_FLAG_WRITE_ONLY      0x0040
+#define V4L2_CTRL_FLAG_VOLATILE                0x0080
+
+/*  Query flag, to be ORed with the control ID */
+#define V4L2_CTRL_FLAG_NEXT_CTRL       0x80000000
+
+/*  User-class control IDs defined by V4L2 */
+#define V4L2_CID_MAX_CTRLS             1024
+/*  IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE          0x08000000
+
+
+/*  DV-class control IDs defined by V4L2 */
+#define V4L2_CID_DV_CLASS_BASE                 (V4L2_CTRL_CLASS_DV | 0x900)
+#define V4L2_CID_DV_CLASS                      (V4L2_CTRL_CLASS_DV | 1)
+
+#define        V4L2_CID_DV_TX_HOTPLUG                  (V4L2_CID_DV_CLASS_BASE + 1)
+#define        V4L2_CID_DV_TX_RXSENSE                  (V4L2_CID_DV_CLASS_BASE + 2)
+#define        V4L2_CID_DV_TX_EDID_PRESENT             (V4L2_CID_DV_CLASS_BASE + 3)
+#define        V4L2_CID_DV_TX_MODE                     (V4L2_CID_DV_CLASS_BASE + 4)
+enum v4l2_dv_tx_mode {
+       V4L2_DV_TX_MODE_DVI_D   = 0,
+       V4L2_DV_TX_MODE_HDMI    = 1,
+};
+#define V4L2_CID_DV_TX_RGB_RANGE               (V4L2_CID_DV_CLASS_BASE + 5)
+enum v4l2_dv_rgb_range {
+       V4L2_DV_RGB_RANGE_AUTO    = 0,
+       V4L2_DV_RGB_RANGE_LIMITED = 1,
+       V4L2_DV_RGB_RANGE_FULL    = 2,
+};
+
+#define        V4L2_CID_DV_RX_POWER_PRESENT            (V4L2_CID_DV_CLASS_BASE + 100)
+#define V4L2_CID_DV_RX_RGB_RANGE               (V4L2_CID_DV_CLASS_BASE + 101)
+
+/*
+ *     T U N I N G
+ */
+struct v4l2_tuner {
+       __u32                   index;
+       __u8                    name[32];
+       __u32                   type;   /* enum v4l2_tuner_type */
+       __u32                   capability;
+       __u32                   rangelow;
+       __u32                   rangehigh;
+       __u32                   rxsubchans;
+       __u32                   audmode;
+       __s32                   signal;
+       __s32                   afc;
+       __u32                   reserved[4];
+};
+
+struct v4l2_modulator {
+       __u32                   index;
+       __u8                    name[32];
+       __u32                   capability;
+       __u32                   rangelow;
+       __u32                   rangehigh;
+       __u32                   txsubchans;
+       __u32                   reserved[4];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW             0x0001
+#define V4L2_TUNER_CAP_NORM            0x0002
+#define V4L2_TUNER_CAP_HWSEEK_BOUNDED  0x0004
+#define V4L2_TUNER_CAP_HWSEEK_WRAP     0x0008
+#define V4L2_TUNER_CAP_STEREO          0x0010
+#define V4L2_TUNER_CAP_LANG2           0x0020
+#define V4L2_TUNER_CAP_SAP             0x0020
+#define V4L2_TUNER_CAP_LANG1           0x0040
+#define V4L2_TUNER_CAP_RDS             0x0080
+#define V4L2_TUNER_CAP_RDS_BLOCK_IO    0x0100
+#define V4L2_TUNER_CAP_RDS_CONTROLS    0x0200
+#define V4L2_TUNER_CAP_FREQ_BANDS      0x0400
+#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
+
+/*  Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO            0x0001
+#define V4L2_TUNER_SUB_STEREO          0x0002
+#define V4L2_TUNER_SUB_LANG2           0x0004
+#define V4L2_TUNER_SUB_SAP             0x0004
+#define V4L2_TUNER_SUB_LANG1           0x0008
+#define V4L2_TUNER_SUB_RDS             0x0010
+
+/*  Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO           0x0000
+#define V4L2_TUNER_MODE_STEREO         0x0001
+#define V4L2_TUNER_MODE_LANG2          0x0002
+#define V4L2_TUNER_MODE_SAP            0x0002
+#define V4L2_TUNER_MODE_LANG1          0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2    0x0004
+
+struct v4l2_frequency {
+       __u32   tuner;
+       __u32   type;   /* enum v4l2_tuner_type */
+       __u32   frequency;
+       __u32   reserved[8];
+};
+
+#define V4L2_BAND_MODULATION_VSB       (1 << 1)
+#define V4L2_BAND_MODULATION_FM                (1 << 2)
+#define V4L2_BAND_MODULATION_AM                (1 << 3)
+
+struct v4l2_frequency_band {
+       __u32   tuner;
+       __u32   type;   /* enum v4l2_tuner_type */
+       __u32   index;
+       __u32   capability;
+       __u32   rangelow;
+       __u32   rangehigh;
+       __u32   modulation;
+       __u32   reserved[9];
+};
+
+struct v4l2_hw_freq_seek {
+       __u32   tuner;
+       __u32   type;   /* enum v4l2_tuner_type */
+       __u32   seek_upward;
+       __u32   wrap_around;
+       __u32   spacing;
+       __u32   rangelow;
+       __u32   rangehigh;
+       __u32   reserved[5];
+};
+
+/*
+ *     R D S
+ */
+
+struct v4l2_rds_data {
+       __u8    lsb;
+       __u8    msb;
+       __u8    block;
+} __attribute__ ((packed));
+
+#define V4L2_RDS_BLOCK_MSK      0x7
+#define V4L2_RDS_BLOCK_A        0
+#define V4L2_RDS_BLOCK_B        1
+#define V4L2_RDS_BLOCK_C        2
+#define V4L2_RDS_BLOCK_D        3
+#define V4L2_RDS_BLOCK_C_ALT    4
+#define V4L2_RDS_BLOCK_INVALID          7
+
+#define V4L2_RDS_BLOCK_CORRECTED 0x40
+#define V4L2_RDS_BLOCK_ERROR    0x80
+
+/*
+ *     A U D I O
+ */
+struct v4l2_audio {
+       __u32   index;
+       __u8    name[32];
+       __u32   capability;
+       __u32   mode;
+       __u32   reserved[2];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_AUDCAP_STEREO             0x00001
+#define V4L2_AUDCAP_AVL                        0x00002
+
+/*  Flags for the 'mode' field */
+#define V4L2_AUDMODE_AVL               0x00001
+
+struct v4l2_audioout {
+       __u32   index;
+       __u8    name[32];
+       __u32   capability;
+       __u32   mode;
+       __u32   reserved[2];
+};
+
+/*
+ *     M P E G   S E R V I C E S
+ *
+ *     NOTE: EXPERIMENTAL API
+ */
+#if 1
+#define V4L2_ENC_IDX_FRAME_I    (0)
+#define V4L2_ENC_IDX_FRAME_P    (1)
+#define V4L2_ENC_IDX_FRAME_B    (2)
+#define V4L2_ENC_IDX_FRAME_MASK (0xf)
+
+struct v4l2_enc_idx_entry {
+       __u64 offset;
+       __u64 pts;
+       __u32 length;
+       __u32 flags;
+       __u32 reserved[2];
+};
+
+#define V4L2_ENC_IDX_ENTRIES (64)
+struct v4l2_enc_idx {
+       __u32 entries;
+       __u32 entries_cap;
+       __u32 reserved[4];
+       struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
+};
+
+
+#define V4L2_ENC_CMD_START      (0)
+#define V4L2_ENC_CMD_STOP       (1)
+#define V4L2_ENC_CMD_PAUSE      (2)
+#define V4L2_ENC_CMD_RESUME     (3)
+
+/* Flags for V4L2_ENC_CMD_STOP */
+#define V4L2_ENC_CMD_STOP_AT_GOP_END    (1 << 0)
+
+struct v4l2_encoder_cmd {
+       __u32 cmd;
+       __u32 flags;
+       union {
+               struct {
+                       __u32 data[8];
+               } raw;
+       };
+};
+
+/* Decoder commands */
+#define V4L2_DEC_CMD_START       (0)
+#define V4L2_DEC_CMD_STOP        (1)
+#define V4L2_DEC_CMD_PAUSE       (2)
+#define V4L2_DEC_CMD_RESUME      (3)
+
+/* Flags for V4L2_DEC_CMD_START */
+#define V4L2_DEC_CMD_START_MUTE_AUDIO  (1 << 0)
+
+/* Flags for V4L2_DEC_CMD_PAUSE */
+#define V4L2_DEC_CMD_PAUSE_TO_BLACK    (1 << 0)
+
+/* Flags for V4L2_DEC_CMD_STOP */
+#define V4L2_DEC_CMD_STOP_TO_BLACK     (1 << 0)
+#define V4L2_DEC_CMD_STOP_IMMEDIATELY  (1 << 1)
+
+/* Play format requirements (returned by the driver): */
+
+/* The decoder has no special format requirements */
+#define V4L2_DEC_START_FMT_NONE                (0)
+/* The decoder requires full GOPs */
+#define V4L2_DEC_START_FMT_GOP         (1)
+
+/* The structure must be zeroed before use by the application
+   This ensures it can be extended safely in the future. */
+struct v4l2_decoder_cmd {
+       __u32 cmd;
+       __u32 flags;
+       union {
+               struct {
+                       __u64 pts;
+               } stop;
+
+               struct {
+                       /* 0 or 1000 specifies normal speed,
+                          1 specifies forward single stepping,
+                          -1 specifies backward single stepping,
+                          >1: playback at speed/1000 of the normal speed,
+                          <-1: reverse playback at (-speed/1000) of the normal speed. */
+                       __s32 speed;
+                       __u32 format;
+               } start;
+
+               struct {
+                       __u32 data[16];
+               } raw;
+       };
+};
+#endif
+
+
+/*
+ *     D A T A   S E R V I C E S   ( V B I )
+ *
+ *     Data services API by Michael Schimek
+ */
+
+/* Raw VBI */
+struct v4l2_vbi_format {
+       __u32   sampling_rate;          /* in 1 Hz */
+       __u32   offset;
+       __u32   samples_per_line;
+       __u32   sample_format;          /* V4L2_PIX_FMT_* */
+       __s32   start[2];
+       __u32   count[2];
+       __u32   flags;                  /* V4L2_VBI_* */
+       __u32   reserved[2];            /* must be zero */
+};
+
+/*  VBI flags  */
+#define V4L2_VBI_UNSYNC                (1 << 0)
+#define V4L2_VBI_INTERLACED    (1 << 1)
+
+/* Sliced VBI
+ *
+ *    This implements is a proposal V4L2 API to allow SLICED VBI
+ * required for some hardware encoders. It should change without
+ * notice in the definitive implementation.
+ */
+
+struct v4l2_sliced_vbi_format {
+       __u16   service_set;
+       /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+          service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+                                (equals frame lines 313-336 for 625 line video
+                                 standards, 263-286 for 525 line standards) */
+       __u16   service_lines[2][24];
+       __u32   io_size;
+       __u32   reserved[2];            /* must be zero */
+};
+
+/* Teletext World System Teletext
+   (WST), defined on ITU-R BT.653-2 */
+#define V4L2_SLICED_TELETEXT_B          (0x0001)
+/* Video Program System, defined on ETS 300 231*/
+#define V4L2_SLICED_VPS                 (0x0400)
+/* Closed Caption, defined on EIA-608 */
+#define V4L2_SLICED_CAPTION_525         (0x1000)
+/* Wide Screen System, defined on ITU-R BT1119.1 */
+#define V4L2_SLICED_WSS_625             (0x4000)
+
+#define V4L2_SLICED_VBI_525             (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625             (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct v4l2_sliced_vbi_cap {
+       __u16   service_set;
+       /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+          service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+                                (equals frame lines 313-336 for 625 line video
+                                 standards, 263-286 for 525 line standards) */
+       __u16   service_lines[2][24];
+       __u32   type;           /* enum v4l2_buf_type */
+       __u32   reserved[3];    /* must be 0 */
+};
+
+struct v4l2_sliced_vbi_data {
+       __u32   id;
+       __u32   field;          /* 0: first field, 1: second field */
+       __u32   line;           /* 1-23 */
+       __u32   reserved;       /* must be 0 */
+       __u8    data[48];
+};
+
+/*
+ * Sliced VBI data inserted into MPEG Streams
+ */
+
+/*
+ * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
+ *
+ * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
+ * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
+ * data
+ *
+ * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
+ * definitions are not included here.  See the MPEG-2 specifications for details
+ * on these headers.
+ */
+
+/* Line type IDs */
+#define V4L2_MPEG_VBI_IVTV_TELETEXT_B     (1)
+#define V4L2_MPEG_VBI_IVTV_CAPTION_525    (4)
+#define V4L2_MPEG_VBI_IVTV_WSS_625        (5)
+#define V4L2_MPEG_VBI_IVTV_VPS            (7)
+
+struct v4l2_mpeg_vbi_itv0_line {
+       __u8 id;        /* One of V4L2_MPEG_VBI_IVTV_* above */
+       __u8 data[42];  /* Sliced VBI data for the line */
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_itv0 {
+       __le32 linemask[2]; /* Bitmasks of VBI service lines present */
+       struct v4l2_mpeg_vbi_itv0_line line[35];
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_ITV0 {
+       struct v4l2_mpeg_vbi_itv0_line line[36];
+} __attribute__ ((packed));
+
+#define V4L2_MPEG_VBI_IVTV_MAGIC0      "itv0"
+#define V4L2_MPEG_VBI_IVTV_MAGIC1      "ITV0"
+
+struct v4l2_mpeg_vbi_fmt_ivtv {
+       __u8 magic[4];
+       union {
+               struct v4l2_mpeg_vbi_itv0 itv0;
+               struct v4l2_mpeg_vbi_ITV0 ITV0;
+       };
+} __attribute__ ((packed));
+
+/*
+ *     A G G R E G A T E   S T R U C T U R E S
+ */
+
+/**
+ * struct v4l2_plane_pix_format - additional, per-plane format definition
+ * @sizeimage:         maximum size in bytes required for data, for which
+ *                     this plane will be used
+ * @bytesperline:      distance in bytes between the leftmost pixels in two
+ *                     adjacent lines
+ */
+struct v4l2_plane_pix_format {
+       __u32           sizeimage;
+       __u16           bytesperline;
+       __u16           reserved[7];
+} __attribute__ ((packed));
+
+/**
+ * struct v4l2_pix_format_mplane - multiplanar format definition
+ * @width:             image width in pixels
+ * @height:            image height in pixels
+ * @pixelformat:       little endian four character code (fourcc)
+ * @field:             enum v4l2_field; field order (for interlaced video)
+ * @colorspace:                enum v4l2_colorspace; supplemental to pixelformat
+ * @plane_fmt:         per-plane information
+ * @num_planes:                number of planes for this format
+ */
+struct v4l2_pix_format_mplane {
+       __u32                           width;
+       __u32                           height;
+       __u32                           pixelformat;
+       __u32                           field;
+       __u32                           colorspace;
+
+       struct v4l2_plane_pix_format    plane_fmt[VIDEO_MAX_PLANES];
+       __u8                            num_planes;
+       __u8                            reserved[11];
+} __attribute__ ((packed));
+
+/**
+ * struct v4l2_format - stream data format
+ * @type:      enum v4l2_buf_type; type of the data stream
+ * @pix:       definition of an image format
+ * @pix_mp:    definition of a multiplanar image format
+ * @win:       definition of an overlaid image
+ * @vbi:       raw VBI capture or output parameters
+ * @sliced:    sliced VBI capture or output parameters
+ * @raw_data:  placeholder for future extensions and custom formats
+ */
+struct v4l2_format {
+       __u32    type;
+       union {
+               struct v4l2_pix_format          pix;     /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
+               struct v4l2_pix_format_mplane   pix_mp;  /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
+               struct v4l2_window              win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
+               struct v4l2_vbi_format          vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
+               struct v4l2_sliced_vbi_format   sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
+               __u8    raw_data[200];                   /* user-defined */
+       } fmt;
+};
+
+/*     Stream type-dependent parameters
+ */
+struct v4l2_streamparm {
+       __u32    type;                  /* enum v4l2_buf_type */
+       union {
+               struct v4l2_captureparm capture;
+               struct v4l2_outputparm  output;
+               __u8    raw_data[200];  /* user-defined */
+       } parm;
+};
+
+/*
+ *     E V E N T S
+ */
+
+#define V4L2_EVENT_ALL                         0
+#define V4L2_EVENT_VSYNC                       1
+#define V4L2_EVENT_EOS                         2
+#define V4L2_EVENT_CTRL                                3
+#define V4L2_EVENT_FRAME_SYNC                  4
+#define V4L2_EVENT_PRIVATE_START               0x08000000
+
+/* Payload for V4L2_EVENT_VSYNC */
+struct v4l2_event_vsync {
+       /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
+       __u8 field;
+} __attribute__ ((packed));
+
+/* Payload for V4L2_EVENT_CTRL */
+#define V4L2_EVENT_CTRL_CH_VALUE               (1 << 0)
+#define V4L2_EVENT_CTRL_CH_FLAGS               (1 << 1)
+
+struct v4l2_event_ctrl {
+       __u32 changes;
+       __u32 type;
+       union {
+               __s32 value;
+               __s64 value64;
+       };
+       __u32 flags;
+       __s32 minimum;
+       __s32 maximum;
+       __s32 step;
+       __s32 default_value;
+};
+
+struct v4l2_event_frame_sync {
+       __u32 frame_sequence;
+};
+
+struct v4l2_event {
+       __u32                           type;
+       union {
+               struct v4l2_event_vsync         vsync;
+               struct v4l2_event_ctrl          ctrl;
+               struct v4l2_event_frame_sync    frame_sync;
+               __u8                            data[64];
+       } u;
+       __u32                           pending;
+       __u32                           sequence;
+       struct timespec                 timestamp;
+       __u32                           id;
+       __u32                           reserved[8];
+};
+
+#define V4L2_EVENT_SUB_FL_SEND_INITIAL         (1 << 0)
+#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK       (1 << 1)
+
+struct v4l2_event_subscription {
+       __u32                           type;
+       __u32                           id;
+       __u32                           flags;
+       __u32                           reserved[5];
+};
+
+/*
+ *     A D V A N C E D   D E B U G G I N G
+ *
+ *     NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
+ *     FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
+ */
+
+/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
+
+#define V4L2_CHIP_MATCH_HOST       0  /* Match against chip ID on host (0 for the host) */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver name */
+#define V4L2_CHIP_MATCH_I2C_ADDR   2  /* Match against I2C 7-bit address */
+#define V4L2_CHIP_MATCH_AC97       3  /* Match against anciliary AC97 chip */
+
+struct v4l2_dbg_match {
+       __u32 type; /* Match type */
+       union {     /* Match this chip, meaning determined by type */
+               __u32 addr;
+               char name[32];
+       };
+} __attribute__ ((packed));
+
+struct v4l2_dbg_register {
+       struct v4l2_dbg_match match;
+       __u32 size;     /* register size in bytes */
+       __u64 reg;
+       __u64 val;
+} __attribute__ ((packed));
+
+/* VIDIOC_DBG_G_CHIP_IDENT */
+struct v4l2_dbg_chip_ident {
+       struct v4l2_dbg_match match;
+       __u32 ident;       /* chip identifier as specified in <media/v4l2-chip-ident.h> */
+       __u32 revision;    /* chip revision, chip specific */
+} __attribute__ ((packed));
+
+/**
+ * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
+ * @index:     on return, index of the first created buffer
+ * @count:     entry: number of requested buffers,
+ *             return: number of created buffers
+ * @memory:    enum v4l2_memory; buffer memory type
+ * @format:    frame format, for which buffers are requested
+ * @reserved:  future extensions
+ */
+struct v4l2_create_buffers {
+       __u32                   index;
+       __u32                   count;
+       __u32                   memory;
+       struct v4l2_format      format;
+       __u32                   reserved[8];
+};
+
+/*
+ *     I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP                 _IOR('V',  0, struct v4l2_capability)
+#define VIDIOC_RESERVED                  _IO('V',  1)
+#define VIDIOC_ENUM_FMT         _IOWR('V',  2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT           _IOWR('V',  4, struct v4l2_format)
+#define VIDIOC_S_FMT           _IOWR('V',  5, struct v4l2_format)
+#define VIDIOC_REQBUFS         _IOWR('V',  8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF                _IOWR('V',  9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF           _IOR('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF           _IOW('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY          _IOW('V', 14, int)
+#define VIDIOC_QBUF            _IOWR('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF           _IOWR('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON                 _IOW('V', 18, int)
+#define VIDIOC_STREAMOFF        _IOW('V', 19, int)
+#define VIDIOC_G_PARM          _IOWR('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM          _IOWR('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD            _IOR('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD            _IOW('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD         _IOWR('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT       _IOWR('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL          _IOWR('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL          _IOWR('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER         _IOWR('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER          _IOW('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO          _IOR('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO          _IOW('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL       _IOWR('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU       _IOWR('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT          _IOR('V', 38, int)
+#define VIDIOC_S_INPUT         _IOWR('V', 39, int)
+#define VIDIOC_G_OUTPUT                 _IOR('V', 46, int)
+#define VIDIOC_S_OUTPUT                _IOWR('V', 47, int)
+#define VIDIOC_ENUMOUTPUT      _IOWR('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT                 _IOR('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT                 _IOW('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR     _IOWR('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR      _IOW('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY     _IOWR('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY      _IOW('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP         _IOWR('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP          _IOWR('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP           _IOW('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP       _IOR('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP       _IOW('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD         _IOR('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT         _IOWR('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO       _IOWR('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT      _IOWR('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY       _IOR('V', 67, __u32) /* enum v4l2_priority */
+#define VIDIOC_S_PRIORITY       _IOW('V', 68, __u32) /* enum v4l2_priority */
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_LOG_STATUS         _IO('V', 70)
+#define VIDIOC_G_EXT_CTRLS     _IOWR('V', 71, struct v4l2_ext_controls)
+#define VIDIOC_S_EXT_CTRLS     _IOWR('V', 72, struct v4l2_ext_controls)
+#define VIDIOC_TRY_EXT_CTRLS   _IOWR('V', 73, struct v4l2_ext_controls)
+#if 1
+#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
+#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
+#define VIDIOC_G_ENC_INDEX       _IOR('V', 76, struct v4l2_enc_idx)
+#define VIDIOC_ENCODER_CMD      _IOWR('V', 77, struct v4l2_encoder_cmd)
+#define VIDIOC_TRY_ENCODER_CMD  _IOWR('V', 78, struct v4l2_encoder_cmd)
+#endif
+
+#if 1
+/* Experimental, meant for debugging, testing and internal use.
+   Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
+   You must be root to use these ioctls. Never use these in applications! */
+#define        VIDIOC_DBG_S_REGISTER    _IOW('V', 79, struct v4l2_dbg_register)
+#define        VIDIOC_DBG_G_REGISTER   _IOWR('V', 80, struct v4l2_dbg_register)
+
+/* Experimental, meant for debugging, testing and internal use.
+   Never use this ioctl in applications! */
+#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
+#endif
+
+#define VIDIOC_S_HW_FREQ_SEEK   _IOW('V', 82, struct v4l2_hw_freq_seek)
+
+/* These four DV Preset ioctls are deprecated in favor of the DV Timings
+   ioctls. */
+#define        VIDIOC_ENUM_DV_PRESETS  _IOWR('V', 83, struct v4l2_dv_enum_preset)
+#define        VIDIOC_S_DV_PRESET      _IOWR('V', 84, struct v4l2_dv_preset)
+#define        VIDIOC_G_DV_PRESET      _IOWR('V', 85, struct v4l2_dv_preset)
+#define        VIDIOC_QUERY_DV_PRESET  _IOR('V',  86, struct v4l2_dv_preset)
+#define        VIDIOC_S_DV_TIMINGS     _IOWR('V', 87, struct v4l2_dv_timings)
+#define        VIDIOC_G_DV_TIMINGS     _IOWR('V', 88, struct v4l2_dv_timings)
+#define        VIDIOC_DQEVENT           _IOR('V', 89, struct v4l2_event)
+#define        VIDIOC_SUBSCRIBE_EVENT   _IOW('V', 90, struct v4l2_event_subscription)
+#define        VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
+
+/* Experimental, the below two ioctls may change over the next couple of kernel
+   versions */
+#define VIDIOC_CREATE_BUFS     _IOWR('V', 92, struct v4l2_create_buffers)
+#define VIDIOC_PREPARE_BUF     _IOWR('V', 93, struct v4l2_buffer)
+
+/* Experimental selection API */
+#define VIDIOC_G_SELECTION     _IOWR('V', 94, struct v4l2_selection)
+#define VIDIOC_S_SELECTION     _IOWR('V', 95, struct v4l2_selection)
+
+/* Experimental, these two ioctls may change over the next couple of kernel
+   versions. */
+#define VIDIOC_DECODER_CMD     _IOWR('V', 96, struct v4l2_decoder_cmd)
+#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
+
+/* Experimental, these three ioctls may change over the next couple of kernel
+   versions. */
+#define VIDIOC_ENUM_DV_TIMINGS  _IOWR('V', 98, struct v4l2_enum_dv_timings)
+#define VIDIOC_QUERY_DV_TIMINGS  _IOR('V', 99, struct v4l2_dv_timings)
+#define VIDIOC_DV_TIMINGS_CAP   _IOWR('V', 100, struct v4l2_dv_timings_cap)
+
+/* Experimental, this ioctl may change over the next couple of kernel
+   versions. */
+#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
+
+/* Reminder: when adding new ioctls please add support for them to
+   drivers/media/video/v4l2-compat-ioctl32.c as well! */
+
+#define BASE_VIDIOC_PRIVATE    192             /* 192-255 are private */
+
+#endif /* _UAPI__LINUX_VIDEODEV2_H */
diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
new file mode 100644 (file)
index 0000000..b7cda39
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef _UAPI_LINUX_VIRTIO_CONFIG_H
+#define _UAPI_LINUX_VIRTIO_CONFIG_H
+/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
+ * anyone can use the definitions to implement compatible drivers/servers.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE. */
+
+/* Virtio devices use a standardized configuration space to define their
+ * features and pass configuration information, but each implementation can
+ * store and access that space differently. */
+#include <linux/types.h>
+
+/* Status byte for guest to report progress, and synchronize features. */
+/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
+#define VIRTIO_CONFIG_S_ACKNOWLEDGE    1
+/* We have found a driver for the device. */
+#define VIRTIO_CONFIG_S_DRIVER         2
+/* Driver has used its parts of the config, and is happy */
+#define VIRTIO_CONFIG_S_DRIVER_OK      4
+/* We've given up on this device. */
+#define VIRTIO_CONFIG_S_FAILED         0x80
+
+/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
+ * transport being used (eg. virtio_ring), the rest are per-device feature
+ * bits. */
+#define VIRTIO_TRANSPORT_F_START       28
+#define VIRTIO_TRANSPORT_F_END         32
+
+/* Do we get callbacks when the ring is completely used, even if we've
+ * suppressed them? */
+#define VIRTIO_F_NOTIFY_ON_EMPTY       24
+
+#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */
diff --git a/include/uapi/linux/virtio_console.h b/include/uapi/linux/virtio_console.h
new file mode 100644 (file)
index 0000000..ee13ab6
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
+ * anyone can use the definitions to implement compatible drivers/servers:
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
+ * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
+ */
+#ifndef _UAPI_LINUX_VIRTIO_CONSOLE_H
+#define _UAPI_LINUX_VIRTIO_CONSOLE_H
+#include <linux/types.h>
+#include <linux/virtio_ids.h>
+#include <linux/virtio_config.h>
+
+/* Feature bits */
+#define VIRTIO_CONSOLE_F_SIZE  0       /* Does host provide console size? */
+#define VIRTIO_CONSOLE_F_MULTIPORT 1   /* Does host provide multiple ports? */
+
+#define VIRTIO_CONSOLE_BAD_ID          (~(u32)0)
+
+struct virtio_console_config {
+       /* colums of the screens */
+       __u16 cols;
+       /* rows of the screens */
+       __u16 rows;
+       /* max. number of ports this device can hold */
+       __u32 max_nr_ports;
+} __attribute__((packed));
+
+/*
+ * A message that's passed between the Host and the Guest for a
+ * particular port.
+ */
+struct virtio_console_control {
+       __u32 id;               /* Port number */
+       __u16 event;            /* The kind of control event (see below) */
+       __u16 value;            /* Extra information for the key */
+};
+
+/* Some events for control messages */
+#define VIRTIO_CONSOLE_DEVICE_READY    0
+#define VIRTIO_CONSOLE_PORT_ADD                1
+#define VIRTIO_CONSOLE_PORT_REMOVE     2
+#define VIRTIO_CONSOLE_PORT_READY      3
+#define VIRTIO_CONSOLE_CONSOLE_PORT    4
+#define VIRTIO_CONSOLE_RESIZE          5
+#define VIRTIO_CONSOLE_PORT_OPEN       6
+#define VIRTIO_CONSOLE_PORT_NAME       7
+
+
+#endif /* _UAPI_LINUX_VIRTIO_CONSOLE_H */
diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h
new file mode 100644 (file)
index 0000000..a99f9b7
--- /dev/null
@@ -0,0 +1,163 @@
+#ifndef _UAPI_LINUX_VIRTIO_RING_H
+#define _UAPI_LINUX_VIRTIO_RING_H
+/* An interface for efficient virtio implementation, currently for use by KVM
+ * and lguest, but hopefully others soon.  Do NOT change this since it will
+ * break existing servers and clients.
+ *
+ * This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Copyright Rusty Russell IBM Corporation 2007. */
+#include <linux/types.h>
+
+/* This marks a buffer as continuing via the next field. */
+#define VRING_DESC_F_NEXT      1
+/* This marks a buffer as write-only (otherwise read-only). */
+#define VRING_DESC_F_WRITE     2
+/* This means the buffer contains a list of buffer descriptors. */
+#define VRING_DESC_F_INDIRECT  4
+
+/* The Host uses this in used->flags to advise the Guest: don't kick me when
+ * you add a buffer.  It's unreliable, so it's simply an optimization.  Guest
+ * will still kick if it's out of buffers. */
+#define VRING_USED_F_NO_NOTIFY 1
+/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
+ * when you consume a buffer.  It's unreliable, so it's simply an
+ * optimization.  */
+#define VRING_AVAIL_F_NO_INTERRUPT     1
+
+/* We support indirect buffer descriptors */
+#define VIRTIO_RING_F_INDIRECT_DESC    28
+
+/* The Guest publishes the used index for which it expects an interrupt
+ * at the end of the avail ring. Host should ignore the avail->flags field. */
+/* The Host publishes the avail index for which it expects a kick
+ * at the end of the used ring. Guest should ignore the used->flags field. */
+#define VIRTIO_RING_F_EVENT_IDX                29
+
+/* Virtio ring descriptors: 16 bytes.  These can chain together via "next". */
+struct vring_desc {
+       /* Address (guest-physical). */
+       __u64 addr;
+       /* Length. */
+       __u32 len;
+       /* The flags as indicated above. */
+       __u16 flags;
+       /* We chain unused descriptors via this, too */
+       __u16 next;
+};
+
+struct vring_avail {
+       __u16 flags;
+       __u16 idx;
+       __u16 ring[];
+};
+
+/* u32 is used here for ids for padding reasons. */
+struct vring_used_elem {
+       /* Index of start of used descriptor chain. */
+       __u32 id;
+       /* Total length of the descriptor chain which was used (written to) */
+       __u32 len;
+};
+
+struct vring_used {
+       __u16 flags;
+       __u16 idx;
+       struct vring_used_elem ring[];
+};
+
+struct vring {
+       unsigned int num;
+
+       struct vring_desc *desc;
+
+       struct vring_avail *avail;
+
+       struct vring_used *used;
+};
+
+/* The standard layout for the ring is a continuous chunk of memory which looks
+ * like this.  We assume num is a power of 2.
+ *
+ * struct vring
+ * {
+ *     // The actual descriptors (16 bytes each)
+ *     struct vring_desc desc[num];
+ *
+ *     // A ring of available descriptor heads with free-running index.
+ *     __u16 avail_flags;
+ *     __u16 avail_idx;
+ *     __u16 available[num];
+ *     __u16 used_event_idx;
+ *
+ *     // Padding to the next align boundary.
+ *     char pad[];
+ *
+ *     // A ring of used descriptor heads with free-running index.
+ *     __u16 used_flags;
+ *     __u16 used_idx;
+ *     struct vring_used_elem used[num];
+ *     __u16 avail_event_idx;
+ * };
+ */
+/* We publish the used event index at the end of the available ring, and vice
+ * versa. They are at the end for backwards compatibility. */
+#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
+#define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num])
+
+static inline void vring_init(struct vring *vr, unsigned int num, void *p,
+                             unsigned long align)
+{
+       vr->num = num;
+       vr->desc = p;
+       vr->avail = p + num*sizeof(struct vring_desc);
+       vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
+               + align-1) & ~(align - 1));
+}
+
+static inline unsigned vring_size(unsigned int num, unsigned long align)
+{
+       return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
+                + align - 1) & ~(align - 1))
+               + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
+}
+
+/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
+/* Assuming a given event_idx value from the other size, if
+ * we have just incremented index from old to new_idx,
+ * should we trigger an event? */
+static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
+{
+       /* Note: Xen has similar logic for notification hold-off
+        * in include/xen/interface/io/ring.h with req_event and req_prod
+        * corresponding to event_idx + 1 and new_idx respectively.
+        * Note also that req_event and req_prod in Xen start at 1,
+        * event indexes in virtio start at 0. */
+       return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
+}
+
+#endif /* _UAPI_LINUX_VIRTIO_RING_H */
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
new file mode 100644 (file)
index 0000000..4b59a26
--- /dev/null
@@ -0,0 +1,90 @@
+#ifndef _UAPI_LINUX_VT_H
+#define _UAPI_LINUX_VT_H
+
+
+/*
+ * These constants are also useful for user-level apps (e.g., VC
+ * resizing).
+ */
+#define MIN_NR_CONSOLES 1       /* must be at least 1 */
+#define MAX_NR_CONSOLES        63      /* serial lines start at 64 */
+#define MAX_NR_USER_CONSOLES 63        /* must be root to allocate above this */
+               /* Note: the ioctl VT_GETSTATE does not work for
+                  consoles 16 and higher (since it returns a short) */
+
+/* 0x56 is 'V', to avoid collision with termios and kd */
+
+#define VT_OPENQRY     0x5600  /* find available vt */
+
+struct vt_mode {
+       char mode;              /* vt mode */
+       char waitv;             /* if set, hang on writes if not active */
+       short relsig;           /* signal to raise on release req */
+       short acqsig;           /* signal to raise on acquisition */
+       short frsig;            /* unused (set to 0) */
+};
+#define VT_GETMODE     0x5601  /* get mode of active vt */
+#define VT_SETMODE     0x5602  /* set mode of active vt */
+#define                VT_AUTO         0x00    /* auto vt switching */
+#define                VT_PROCESS      0x01    /* process controls switching */
+#define                VT_ACKACQ       0x02    /* acknowledge switch */
+
+struct vt_stat {
+       unsigned short v_active;        /* active vt */
+       unsigned short v_signal;        /* signal to send */
+       unsigned short v_state;         /* vt bitmask */
+};
+#define VT_GETSTATE    0x5603  /* get global vt state info */
+#define VT_SENDSIG     0x5604  /* signal to send to bitmask of vts */
+
+#define VT_RELDISP     0x5605  /* release display */
+
+#define VT_ACTIVATE    0x5606  /* make vt active */
+#define VT_WAITACTIVE  0x5607  /* wait for vt active */
+#define VT_DISALLOCATE 0x5608  /* free memory associated to vt */
+
+struct vt_sizes {
+       unsigned short v_rows;          /* number of rows */
+       unsigned short v_cols;          /* number of columns */
+       unsigned short v_scrollsize;    /* number of lines of scrollback */
+};
+#define VT_RESIZE      0x5609  /* set kernel's idea of screensize */
+
+struct vt_consize {
+       unsigned short v_rows;  /* number of rows */
+       unsigned short v_cols;  /* number of columns */
+       unsigned short v_vlin;  /* number of pixel rows on screen */
+       unsigned short v_clin;  /* number of pixel rows per character */
+       unsigned short v_vcol;  /* number of pixel columns on screen */
+       unsigned short v_ccol;  /* number of pixel columns per character */
+};
+#define VT_RESIZEX      0x560A  /* set kernel's idea of screensize + more */
+#define VT_LOCKSWITCH   0x560B  /* disallow vt switching */
+#define VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
+#define VT_GETHIFONTMASK 0x560D  /* return hi font mask */
+
+struct vt_event {
+       unsigned int event;
+#define VT_EVENT_SWITCH                0x0001  /* Console switch */
+#define VT_EVENT_BLANK         0x0002  /* Screen blank */
+#define VT_EVENT_UNBLANK       0x0004  /* Screen unblank */
+#define VT_EVENT_RESIZE                0x0008  /* Resize display */
+#define VT_MAX_EVENT           0x000F
+       unsigned int oldev;             /* Old console */
+       unsigned int newev;             /* New console (if changing) */
+       unsigned int pad[4];            /* Padding for expansion */
+};
+
+#define VT_WAITEVENT   0x560E  /* Wait for an event */
+
+struct vt_setactivate {
+       unsigned int console;
+       struct vt_mode mode;
+};
+
+#define VT_SETACTIVATE 0x560F  /* Activate and set the mode of a console */
+
+
+#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
+
+#endif /* _UAPI_LINUX_VT_H */
diff --git a/include/uapi/linux/wait.h b/include/uapi/linux/wait.h
new file mode 100644 (file)
index 0000000..9393eea
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _UAPI_LINUX_WAIT_H
+#define _UAPI_LINUX_WAIT_H
+
+#define WNOHANG                0x00000001
+#define WUNTRACED      0x00000002
+#define WSTOPPED       WUNTRACED
+#define WEXITED                0x00000004
+#define WCONTINUED     0x00000008
+#define WNOWAIT                0x01000000      /* Don't reap, just poll status.  */
+
+#define __WNOTHREAD    0x20000000      /* Don't wait on children of other threads in this group */
+#define __WALL         0x40000000      /* Wait on all children, regardless of type */
+#define __WCLONE       0x80000000      /* Wait only on non-SIGCHLD children */
+
+/* First argument to waitid: */
+#define P_ALL          0
+#define P_PID          1
+#define P_PGID         2
+
+
+#endif /* _UAPI_LINUX_WAIT_H */
diff --git a/include/uapi/linux/wanrouter.h b/include/uapi/linux/wanrouter.h
new file mode 100644 (file)
index 0000000..7617df2
--- /dev/null
@@ -0,0 +1,452 @@
+/*****************************************************************************
+* wanrouter.h  Definitions for the WAN Multiprotocol Router Module.
+*              This module provides API and common services for WAN Link
+*              Drivers and is completely hardware-independent.
+*
+* Author:      Nenad Corbic <ncorbic@sangoma.com>
+*              Gideon Hack     
+* Additions:   Arnaldo Melo
+*
+* Copyright:   (c) 1995-2000 Sangoma Technologies Inc.
+*
+*              This program is free software; you can redistribute it and/or
+*              modify it under the terms of the GNU General Public License
+*              as published by the Free Software Foundation; either version
+*              2 of the License, or (at your option) any later version.
+* ============================================================================
+* Jul 21, 2000  Nenad Corbic   Added WAN_FT1_READY State
+* Feb 24, 2000  Nenad Corbic    Added support for socket based x25api
+* Jan 28, 2000  Nenad Corbic    Added support for the ASYNC protocol.
+* Oct 04, 1999  Nenad Corbic   Updated for 2.1.0 release
+* Jun 02, 1999  Gideon Hack    Added support for the S514 adapter.
+* May 23, 1999 Arnaldo Melo    Added local_addr to wanif_conf_t
+*                              WAN_DISCONNECTING state added
+* Jul 20, 1998 David Fong      Added Inverse ARP options to 'wanif_conf_t'
+* Jun 12, 1998 David Fong      Added Cisco HDLC support.
+* Dec 16, 1997 Jaspreet Singh  Moved 'enable_IPX' and 'network_number' to
+*                              'wanif_conf_t'
+* Dec 05, 1997 Jaspreet Singh  Added 'pap', 'chap' to 'wanif_conf_t'
+*                              Added 'authenticator' to 'wan_ppp_conf_t'
+* Nov 06, 1997 Jaspreet Singh  Changed Router Driver version to 1.1 from 1.0
+* Oct 20, 1997 Jaspreet Singh  Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
+*                              Added 'enable_IPX' and 'network_number' to 
+*                              'wan_device_t'.  Also added defines for
+*                              UDP PACKET TYPE, Interrupt test, critical values
+*                              for RACE conditions.
+* Oct 05, 1997 Jaspreet Singh  Added 'dlci_num' and 'dlci[100]' to 
+*                              'wan_fr_conf_t' to configure a list of dlci(s)
+*                              for a NODE 
+* Jul 07, 1997 Jaspreet Singh  Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
+* May 29, 1997         Jaspreet Singh  Added 'tx_int_enabled' to 'wan_device_t'
+* May 21, 1997 Jaspreet Singh  Added 'udp_port' to 'wan_device_t'
+* Apr 25, 1997  Farhan Thawar   Added 'udp_port' to 'wandev_conf_t'
+* Jan 16, 1997 Gene Kozin      router_devlist made public
+* Jan 02, 1997 Gene Kozin      Initial version (based on wanpipe.h).
+*****************************************************************************/
+
+#ifndef _UAPI_ROUTER_H
+#define _UAPI_ROUTER_H
+
+#define        ROUTER_NAME     "wanrouter"     /* in case we ever change it */
+#define        ROUTER_VERSION  1               /* version number */
+#define        ROUTER_RELEASE  1               /* release (minor version) number */
+#define        ROUTER_IOCTL    'W'             /* for IOCTL calls */
+#define        ROUTER_MAGIC    0x524D4157L     /* signature: 'WANR' reversed */
+
+/* IOCTL codes for /proc/router/<device> entries (up to 255) */
+enum router_ioctls
+{
+       ROUTER_SETUP    = ROUTER_IOCTL<<8,      /* configure device */
+       ROUTER_DOWN,                            /* shut down device */
+       ROUTER_STAT,                            /* get device status */
+       ROUTER_IFNEW,                           /* add interface */
+       ROUTER_IFDEL,                           /* delete interface */
+       ROUTER_IFSTAT,                          /* get interface status */
+       ROUTER_USER     = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
+       ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
+};
+
+/* identifiers for displaying proc file data for dual port adapters */
+#define PROC_DATA_PORT_0 0x8000        /* the data is for port 0 */
+#define PROC_DATA_PORT_1 0x8001        /* the data is for port 1 */
+
+/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
+#define        NLPID_IP        0xCC    /* Internet Protocol Datagram */
+#define        NLPID_SNAP      0x80    /* IEEE Subnetwork Access Protocol */
+#define        NLPID_CLNP      0x81    /* ISO/IEC 8473 */
+#define        NLPID_ESIS      0x82    /* ISO/IEC 9542 */
+#define        NLPID_ISIS      0x83    /* ISO/IEC ISIS */
+#define        NLPID_Q933      0x08    /* CCITT Q.933 */
+
+/* Miscellaneous */
+#define        WAN_IFNAME_SZ   15      /* max length of the interface name */
+#define        WAN_DRVNAME_SZ  15      /* max length of the link driver name */
+#define        WAN_ADDRESS_SZ  31      /* max length of the WAN media address */
+#define USED_BY_FIELD  8       /* max length of the used by field */
+
+/* Defines for UDP PACKET TYPE */
+#define UDP_PTPIPE_TYPE        0x01
+#define UDP_FPIPE_TYPE         0x02
+#define UDP_CPIPE_TYPE         0x03
+#define UDP_DRVSTATS_TYPE      0x04
+#define UDP_INVALID_TYPE       0x05
+
+/* Command return code */
+#define CMD_OK         0               /* normal firmware return code */
+#define CMD_TIMEOUT    0xFF            /* firmware command timed out */
+
+/* UDP Packet Management */
+#define UDP_PKT_FRM_STACK      0x00
+#define UDP_PKT_FRM_NETWORK    0x01
+
+/* Maximum interrupt test counter */
+#define MAX_INTR_TEST_COUNTER  100
+
+/* Critical Values for RACE conditions*/
+#define CRITICAL_IN_ISR                0xA1
+#define CRITICAL_INTR_HANDLED  0xB1
+
+/****** Data Types **********************************************************/
+
+/*----------------------------------------------------------------------------
+ * X.25-specific link-level configuration.
+ */
+typedef struct wan_x25_conf
+{
+       unsigned lo_pvc;        /* lowest permanent circuit number */
+       unsigned hi_pvc;        /* highest permanent circuit number */
+       unsigned lo_svc;        /* lowest switched circuit number */
+       unsigned hi_svc;        /* highest switched circuit number */
+       unsigned hdlc_window;   /* HDLC window size (1..7) */
+       unsigned pkt_window;    /* X.25 packet window size (1..7) */
+       unsigned t1;            /* HDLC timer T1, sec (1..30) */
+       unsigned t2;            /* HDLC timer T2, sec (0..29) */
+       unsigned t4;            /* HDLC supervisory frame timer = T4 * T1 */
+       unsigned n2;            /* HDLC retransmission limit (1..30) */
+       unsigned t10_t20;       /* X.25 RESTART timeout, sec (1..255) */
+       unsigned t11_t21;       /* X.25 CALL timeout, sec (1..255) */
+       unsigned t12_t22;       /* X.25 RESET timeout, sec (1..255) */
+       unsigned t13_t23;       /* X.25 CLEAR timeout, sec (1..255) */
+       unsigned t16_t26;       /* X.25 INTERRUPT timeout, sec (1..255) */
+       unsigned t28;           /* X.25 REGISTRATION timeout, sec (1..255) */
+       unsigned r10_r20;       /* RESTART retransmission limit (0..250) */
+       unsigned r12_r22;       /* RESET retransmission limit (0..250) */
+       unsigned r13_r23;       /* CLEAR retransmission limit (0..250) */
+       unsigned ccitt_compat;  /* compatibility mode: 1988/1984/1980 */
+       unsigned x25_conf_opt;   /* User defined x25 config optoins */
+       unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
+       unsigned char logging;   /* Control connection logging */  
+       unsigned char oob_on_modem; /* Whether to send modem status to the user app */
+} wan_x25_conf_t;
+
+/*----------------------------------------------------------------------------
+ * Frame relay specific link-level configuration.
+ */
+typedef struct wan_fr_conf
+{
+       unsigned signalling;    /* local in-channel signalling type */
+       unsigned t391;          /* link integrity verification timer */
+       unsigned t392;          /* polling verification timer */
+       unsigned n391;          /* full status polling cycle counter */
+       unsigned n392;          /* error threshold counter */
+       unsigned n393;          /* monitored events counter */
+       unsigned dlci_num;      /* number of DLCs (access node) */
+       unsigned  dlci[100];    /* List of all DLCIs */
+} wan_fr_conf_t;
+
+/*----------------------------------------------------------------------------
+ * PPP-specific link-level configuration.
+ */
+typedef struct wan_ppp_conf
+{
+       unsigned restart_tmr;   /* restart timer */
+       unsigned auth_rsrt_tmr; /* authentication timer */
+       unsigned auth_wait_tmr; /* authentication timer */
+       unsigned mdm_fail_tmr;  /* modem failure timer */
+       unsigned dtr_drop_tmr;  /* DTR drop timer */
+       unsigned connect_tmout; /* connection timeout */
+       unsigned conf_retry;    /* max. retry */
+       unsigned term_retry;    /* max. retry */
+       unsigned fail_retry;    /* max. retry */
+       unsigned auth_retry;    /* max. retry */
+       unsigned auth_options;  /* authentication opt. */
+       unsigned ip_options;    /* IP options */
+       char    authenticator;  /* AUTHENTICATOR or not */
+       char    ip_mode;        /* Static/Host/Peer */
+} wan_ppp_conf_t;
+
+/*----------------------------------------------------------------------------
+ * CHDLC-specific link-level configuration.
+ */
+typedef struct wan_chdlc_conf
+{
+       unsigned char ignore_dcd;       /* Protocol options:            */
+       unsigned char ignore_cts;       /*  Ignore these to determine   */
+       unsigned char ignore_keepalive; /*  link status (Yes or No)     */
+       unsigned char hdlc_streaming;   /*  hdlc_streaming mode (Y/N) */
+       unsigned char receive_only;     /*  no transmit buffering (Y/N) */
+       unsigned keepalive_tx_tmr;      /* transmit keepalive timer */
+       unsigned keepalive_rx_tmr;      /* receive  keepalive timer */
+       unsigned keepalive_err_margin;  /* keepalive_error_tolerance */
+       unsigned slarp_timer;           /* SLARP request timer */
+} wan_chdlc_conf_t;
+
+
+/*----------------------------------------------------------------------------
+ * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
+ */
+typedef struct wandev_conf
+{
+       unsigned magic;         /* magic number (for verification) */
+       unsigned config_id;     /* configuration structure identifier */
+                               /****** hardware configuration ******/
+       unsigned ioport;        /* adapter I/O port base */
+       unsigned long maddr;    /* dual-port memory address */
+       unsigned msize;         /* dual-port memory size */
+       int irq;                /* interrupt request level */
+       int dma;                /* DMA request level */
+        char S514_CPU_no[1];   /* S514 PCI adapter CPU number ('A' or 'B') */
+        unsigned PCI_slot_no;  /* S514 PCI adapter slot number */
+       char auto_pci_cfg;      /* S515 PCI automatic slot detection */
+       char comm_port;         /* Communication Port (PRI=0, SEC=1) */ 
+       unsigned bps;           /* data transfer rate */
+       unsigned mtu;           /* maximum transmit unit size */
+        unsigned udp_port;      /* UDP port for management */
+       unsigned char ttl;      /* Time To Live for UDP security */
+       unsigned char ft1;      /* FT1 Configurator Option */
+        char interface;                /* RS-232/V.35, etc. */
+       char clocking;          /* external/internal */
+       char line_coding;       /* NRZ/NRZI/FM0/FM1, etc. */
+       char station;           /* DTE/DCE, primary/secondary, etc. */
+       char connection;        /* permanent/switched/on-demand */
+       char read_mode;         /* read mode: Polling or interrupt */
+       char receive_only;      /* disable tx buffers */
+       char tty;               /* Create a fake tty device */
+       unsigned tty_major;     /* Major number for wanpipe tty device */
+       unsigned tty_minor;     /* Minor number for wanpipe tty device */
+       unsigned tty_mode;      /* TTY operation mode SYNC or ASYNC */
+       char backup;            /* Backup Mode */
+       unsigned hw_opt[4];     /* other hardware options */
+       unsigned reserved[4];
+                               /****** arbitrary data ***************/
+       unsigned data_size;     /* data buffer size */
+       void* data;             /* data buffer, e.g. firmware */
+       union                   /****** protocol-specific ************/
+       {
+               wan_x25_conf_t x25;     /* X.25 configuration */
+               wan_ppp_conf_t ppp;     /* PPP configuration */
+               wan_fr_conf_t fr;       /* frame relay configuration */
+               wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
+       } u;
+} wandev_conf_t;
+
+/* 'config_id' definitions */
+#define        WANCONFIG_X25   101     /* X.25 link */
+#define        WANCONFIG_FR    102     /* frame relay link */
+#define        WANCONFIG_PPP   103     /* synchronous PPP link */
+#define WANCONFIG_CHDLC        104     /* Cisco HDLC Link */
+#define WANCONFIG_BSC  105     /* BiSync Streaming */
+#define WANCONFIG_HDLC 106     /* HDLC Support */
+#define WANCONFIG_MPPP  107    /* Multi Port PPP over RAW CHDLC */
+
+/*
+ * Configuration options defines.
+ */
+/* general options */
+#define        WANOPT_OFF      0
+#define        WANOPT_ON       1
+#define        WANOPT_NO       0
+#define        WANOPT_YES      1
+
+/* intercace options */
+#define        WANOPT_RS232    0
+#define        WANOPT_V35      1
+
+/* data encoding options */
+#define        WANOPT_NRZ      0
+#define        WANOPT_NRZI     1
+#define        WANOPT_FM0      2
+#define        WANOPT_FM1      3
+
+/* link type options */
+#define        WANOPT_POINTTOPOINT     0       /* RTS always active */
+#define        WANOPT_MULTIDROP        1       /* RTS is active when transmitting */
+
+/* clocking options */
+#define        WANOPT_EXTERNAL 0
+#define        WANOPT_INTERNAL 1
+
+/* station options */
+#define        WANOPT_DTE              0
+#define        WANOPT_DCE              1
+#define        WANOPT_CPE              0
+#define        WANOPT_NODE             1
+#define        WANOPT_SECONDARY        0
+#define        WANOPT_PRIMARY          1
+
+/* connection options */
+#define        WANOPT_PERMANENT        0       /* DTR always active */
+#define        WANOPT_SWITCHED         1       /* use DTR to setup link (dial-up) */
+#define        WANOPT_ONDEMAND         2       /* activate DTR only before sending */
+
+/* frame relay in-channel signalling */
+#define        WANOPT_FR_ANSI          1       /* ANSI T1.617 Annex D */
+#define        WANOPT_FR_Q933          2       /* ITU Q.933A */
+#define        WANOPT_FR_LMI           3       /* LMI */
+
+/* PPP IP Mode Options */
+#define        WANOPT_PPP_STATIC       0
+#define        WANOPT_PPP_HOST         1
+#define        WANOPT_PPP_PEER         2
+
+/* ASY Mode Options */
+#define WANOPT_ONE             1
+#define WANOPT_TWO             2
+#define WANOPT_ONE_AND_HALF    3
+
+#define WANOPT_NONE    0
+#define WANOPT_ODD      1
+#define WANOPT_EVEN    2
+
+/* CHDLC Protocol Options */
+/* DF Commented out for now.
+
+#define WANOPT_CHDLC_NO_DCD            IGNORE_DCD_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_CTS            IGNORE_CTS_FOR_LINK_STAT
+#define WANOPT_CHDLC_NO_KEEPALIVE      IGNORE_KPALV_FOR_LINK_STAT
+*/
+
+/* Port options */
+#define WANOPT_PRI 0
+#define WANOPT_SEC 1
+/* read mode */
+#define        WANOPT_INTR     0
+#define WANOPT_POLL    1
+
+
+#define WANOPT_TTY_SYNC  0
+#define WANOPT_TTY_ASYNC 1
+/*----------------------------------------------------------------------------
+ * WAN Link Status Info (for ROUTER_STAT IOCTL).
+ */
+typedef struct wandev_stat
+{
+       unsigned state;         /* link state */
+       unsigned ndev;          /* number of configured interfaces */
+
+       /* link/interface configuration */
+       unsigned connection;    /* permanent/switched/on-demand */
+       unsigned media_type;    /* Frame relay/PPP/X.25/SDLC, etc. */
+       unsigned mtu;           /* max. transmit unit for this device */
+
+       /* physical level statistics */
+       unsigned modem_status;  /* modem status */
+       unsigned rx_frames;     /* received frames count */
+       unsigned rx_overruns;   /* receiver overrun error count */
+       unsigned rx_crc_err;    /* receive CRC error count */
+       unsigned rx_aborts;     /* received aborted frames count */
+       unsigned rx_bad_length; /* unexpetedly long/short frames count */
+       unsigned rx_dropped;    /* frames discarded at device level */
+       unsigned tx_frames;     /* transmitted frames count */
+       unsigned tx_underruns;  /* aborted transmissions (underruns) count */
+       unsigned tx_timeouts;   /* transmission timeouts */
+       unsigned tx_rejects;    /* other transmit errors */
+
+       /* media level statistics */
+       unsigned rx_bad_format; /* frames with invalid format */
+       unsigned rx_bad_addr;   /* frames with invalid media address */
+       unsigned tx_retries;    /* frames re-transmitted */
+       unsigned reserved[16];  /* reserved for future use */
+} wandev_stat_t;
+
+/* 'state' defines */
+enum wan_states
+{
+       WAN_UNCONFIGURED,       /* link/channel is not configured */
+       WAN_DISCONNECTED,       /* link/channel is disconnected */
+       WAN_CONNECTING,         /* connection is in progress */
+       WAN_CONNECTED,          /* link/channel is operational */
+       WAN_LIMIT,              /* for verification only */
+       WAN_DUALPORT,           /* for Dual Port cards */
+       WAN_DISCONNECTING,
+       WAN_FT1_READY           /* FT1 Configurator Ready */
+};
+
+enum {
+       WAN_LOCAL_IP,
+       WAN_POINTOPOINT_IP,
+       WAN_NETMASK_IP,
+       WAN_BROADCAST_IP
+};
+
+/* 'modem_status' masks */
+#define        WAN_MODEM_CTS   0x0001  /* CTS line active */
+#define        WAN_MODEM_DCD   0x0002  /* DCD line active */
+#define        WAN_MODEM_DTR   0x0010  /* DTR line active */
+#define        WAN_MODEM_RTS   0x0020  /* RTS line active */
+
+/*----------------------------------------------------------------------------
+ * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
+ */
+typedef struct wanif_conf
+{
+       unsigned magic;                 /* magic number */
+       unsigned config_id;             /* configuration identifier */
+       char name[WAN_IFNAME_SZ+1];     /* interface name, ASCIIZ */
+       char addr[WAN_ADDRESS_SZ+1];    /* media address, ASCIIZ */
+       char usedby[USED_BY_FIELD];     /* used by API or WANPIPE */
+       unsigned idle_timeout;          /* sec, before disconnecting */
+       unsigned hold_timeout;          /* sec, before re-connecting */
+       unsigned cir;                   /* Committed Information Rate fwd,bwd*/
+       unsigned bc;                    /* Committed Burst Size fwd, bwd */
+       unsigned be;                    /* Excess Burst Size fwd, bwd */ 
+       unsigned char enable_IPX;       /* Enable or Disable IPX */
+       unsigned char inarp;            /* Send Inverse ARP requests Y/N */
+       unsigned inarp_interval;        /* sec, between InARP requests */
+       unsigned long network_number;   /* Network Number for IPX */
+       char mc;                        /* Multicast on or off */
+       char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
+       unsigned char port;             /* board port */
+       unsigned char protocol;         /* prococol used in this channel (TCPOX25 or X25) */
+       char pap;                       /* PAP enabled or disabled */
+       char chap;                      /* CHAP enabled or disabled */
+       unsigned char userid[511];      /* List of User Id */
+       unsigned char passwd[511];      /* List of passwords */
+       unsigned char sysname[31];      /* Name of the system */
+       unsigned char ignore_dcd;       /* Protocol options: */
+       unsigned char ignore_cts;       /*  Ignore these to determine */
+       unsigned char ignore_keepalive; /*  link status (Yes or No) */
+       unsigned char hdlc_streaming;   /*  Hdlc streaming mode (Y/N) */
+       unsigned keepalive_tx_tmr;      /* transmit keepalive timer */
+       unsigned keepalive_rx_tmr;      /* receive  keepalive timer */
+       unsigned keepalive_err_margin;  /* keepalive_error_tolerance */
+       unsigned slarp_timer;           /* SLARP request timer */
+       unsigned char ttl;              /* Time To Live for UDP security */
+       char interface;                 /* RS-232/V.35, etc. */
+       char clocking;                  /* external/internal */
+       unsigned bps;                   /* data transfer rate */
+       unsigned mtu;                   /* maximum transmit unit size */
+       unsigned char if_down;          /* brind down interface when disconnected */
+       unsigned char gateway;          /* Is this interface a gateway */
+       unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
+
+       unsigned char asy_data_trans;     /* async API options */
+        unsigned char rts_hs_for_receive; /* async Protocol options */
+        unsigned char xon_xoff_hs_for_receive;
+       unsigned char xon_xoff_hs_for_transmit;
+       unsigned char dcd_hs_for_transmit;
+       unsigned char cts_hs_for_transmit;
+       unsigned char async_mode;
+       unsigned tx_bits_per_char;
+       unsigned rx_bits_per_char;
+       unsigned stop_bits;  
+       unsigned char parity;
+       unsigned break_timer;
+        unsigned inter_char_timer;
+       unsigned rx_complete_length;
+       unsigned xon_char;
+       unsigned xoff_char;
+       unsigned char receive_only;     /*  no transmit buffering (Y/N) */
+} wanif_conf_t;
+
+#endif /* _UAPI_ROUTER_H */
diff --git a/include/uapi/linux/watchdog.h b/include/uapi/linux/watchdog.h
new file mode 100644 (file)
index 0000000..2babe72
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *     Generic watchdog defines. Derived from..
+ *
+ * Berkshire PC Watchdog Defines
+ * by Ken Hollis <khollis@bitgate.com>
+ *
+ */
+
+#ifndef _UAPI_LINUX_WATCHDOG_H
+#define _UAPI_LINUX_WATCHDOG_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+#define        WATCHDOG_IOCTL_BASE     'W'
+
+struct watchdog_info {
+       __u32 options;          /* Options the card/driver supports */
+       __u32 firmware_version; /* Firmware version of the card */
+       __u8  identity[32];     /* Identity of the board */
+};
+
+#define        WDIOC_GETSUPPORT        _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
+#define        WDIOC_GETSTATUS         _IOR(WATCHDOG_IOCTL_BASE, 1, int)
+#define        WDIOC_GETBOOTSTATUS     _IOR(WATCHDOG_IOCTL_BASE, 2, int)
+#define        WDIOC_GETTEMP           _IOR(WATCHDOG_IOCTL_BASE, 3, int)
+#define        WDIOC_SETOPTIONS        _IOR(WATCHDOG_IOCTL_BASE, 4, int)
+#define        WDIOC_KEEPALIVE         _IOR(WATCHDOG_IOCTL_BASE, 5, int)
+#define        WDIOC_SETTIMEOUT        _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
+#define        WDIOC_GETTIMEOUT        _IOR(WATCHDOG_IOCTL_BASE, 7, int)
+#define        WDIOC_SETPRETIMEOUT     _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
+#define        WDIOC_GETPRETIMEOUT     _IOR(WATCHDOG_IOCTL_BASE, 9, int)
+#define        WDIOC_GETTIMELEFT       _IOR(WATCHDOG_IOCTL_BASE, 10, int)
+
+#define        WDIOF_UNKNOWN           -1      /* Unknown flag error */
+#define        WDIOS_UNKNOWN           -1      /* Unknown status error */
+
+#define        WDIOF_OVERHEAT          0x0001  /* Reset due to CPU overheat */
+#define        WDIOF_FANFAULT          0x0002  /* Fan failed */
+#define        WDIOF_EXTERN1           0x0004  /* External relay 1 */
+#define        WDIOF_EXTERN2           0x0008  /* External relay 2 */
+#define        WDIOF_POWERUNDER        0x0010  /* Power bad/power fault */
+#define        WDIOF_CARDRESET         0x0020  /* Card previously reset the CPU */
+#define        WDIOF_POWEROVER         0x0040  /* Power over voltage */
+#define        WDIOF_SETTIMEOUT        0x0080  /* Set timeout (in seconds) */
+#define        WDIOF_MAGICCLOSE        0x0100  /* Supports magic close char */
+#define        WDIOF_PRETIMEOUT        0x0200  /* Pretimeout (in seconds), get/set */
+#define        WDIOF_ALARMONLY         0x0400  /* Watchdog triggers a management or
+                                          other external alarm not a reboot */
+#define        WDIOF_KEEPALIVEPING     0x8000  /* Keep alive ping reply */
+
+#define        WDIOS_DISABLECARD       0x0001  /* Turn off the watchdog timer */
+#define        WDIOS_ENABLECARD        0x0002  /* Turn on the watchdog timer */
+#define        WDIOS_TEMPPANIC         0x0004  /* Kernel panic on temperature trip */
+
+
+#endif /* _UAPI_LINUX_WATCHDOG_H */
diff --git a/include/uapi/linux/wireless.h b/include/uapi/linux/wireless.h
new file mode 100644 (file)
index 0000000..c1592e3
--- /dev/null
@@ -0,0 +1,1128 @@
+/*
+ * This file define a set of standard wireless extensions
+ *
+ * Version :   22      16.3.07
+ *
+ * Authors :   Jean Tourrilhes - HPL - <jt@hpl.hp.com>
+ * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
+ */
+
+#ifndef _UAPI_LINUX_WIRELESS_H
+#define _UAPI_LINUX_WIRELESS_H
+
+/************************** DOCUMENTATION **************************/
+/*
+ * Initial APIs (1996 -> onward) :
+ * -----------------------------
+ * Basically, the wireless extensions are for now a set of standard ioctl
+ * call + /proc/net/wireless
+ *
+ * The entry /proc/net/wireless give statistics and information on the
+ * driver.
+ * This is better than having each driver having its entry because
+ * its centralised and we may remove the driver module safely.
+ *
+ * Ioctl are used to configure the driver and issue commands.  This is
+ * better than command line options of insmod because we may want to
+ * change dynamically (while the driver is running) some parameters.
+ *
+ * The ioctl mechanimsm are copied from standard devices ioctl.
+ * We have the list of command plus a structure descibing the
+ * data exchanged...
+ * Note that to add these ioctl, I was obliged to modify :
+ *     # net/core/dev.c (two place + add include)
+ *     # net/ipv4/af_inet.c (one place + add include)
+ *
+ * /proc/net/wireless is a copy of /proc/net/dev.
+ * We have a structure for data passed from the driver to /proc/net/wireless
+ * Too add this, I've modified :
+ *     # net/core/dev.c (two other places)
+ *     # include/linux/netdevice.h (one place)
+ *     # include/linux/proc_fs.h (one place)
+ *
+ * New driver API (2002 -> onward) :
+ * -------------------------------
+ * This file is only concerned with the user space API and common definitions.
+ * The new driver API is defined and documented in :
+ *     # include/net/iw_handler.h
+ *
+ * Note as well that /proc/net/wireless implementation has now moved in :
+ *     # net/core/wireless.c
+ *
+ * Wireless Events (2002 -> onward) :
+ * --------------------------------
+ * Events are defined at the end of this file, and implemented in :
+ *     # net/core/wireless.c
+ *
+ * Other comments :
+ * --------------
+ * Do not add here things that are redundant with other mechanisms
+ * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
+ * wireless specific.
+ *
+ * These wireless extensions are not magic : each driver has to provide
+ * support for them...
+ *
+ * IMPORTANT NOTE : As everything in the kernel, this is very much a
+ * work in progress. Contact me if you have ideas of improvements...
+ */
+
+/***************************** INCLUDES *****************************/
+
+#include <linux/types.h>               /* for __u* and __s* typedefs */
+#include <linux/socket.h>              /* for "struct sockaddr" et al  */
+#include <linux/if.h>                  /* for IFNAMSIZ and co... */
+
+/***************************** VERSION *****************************/
+/*
+ * This constant is used to know the availability of the wireless
+ * extensions and to know which version of wireless extensions it is
+ * (there is some stuff that will be added in the future...)
+ * I just plan to increment with each new version.
+ */
+#define WIRELESS_EXT   22
+
+/*
+ * Changes :
+ *
+ * V2 to V3
+ * --------
+ *     Alan Cox start some incompatibles changes. I've integrated a bit more.
+ *     - Encryption renamed to Encode to avoid US regulation problems
+ *     - Frequency changed from float to struct to avoid problems on old 386
+ *
+ * V3 to V4
+ * --------
+ *     - Add sensitivity
+ *
+ * V4 to V5
+ * --------
+ *     - Missing encoding definitions in range
+ *     - Access points stuff
+ *
+ * V5 to V6
+ * --------
+ *     - 802.11 support (ESSID ioctls)
+ *
+ * V6 to V7
+ * --------
+ *     - define IW_ESSID_MAX_SIZE and IW_MAX_AP
+ *
+ * V7 to V8
+ * --------
+ *     - Changed my e-mail address
+ *     - More 802.11 support (nickname, rate, rts, frag)
+ *     - List index in frequencies
+ *
+ * V8 to V9
+ * --------
+ *     - Support for 'mode of operation' (ad-hoc, managed...)
+ *     - Support for unicast and multicast power saving
+ *     - Change encoding to support larger tokens (>64 bits)
+ *     - Updated iw_params (disable, flags) and use it for NWID
+ *     - Extracted iw_point from iwreq for clarity
+ *
+ * V9 to V10
+ * ---------
+ *     - Add PM capability to range structure
+ *     - Add PM modifier : MAX/MIN/RELATIVE
+ *     - Add encoding option : IW_ENCODE_NOKEY
+ *     - Add TxPower ioctls (work like TxRate)
+ *
+ * V10 to V11
+ * ----------
+ *     - Add WE version in range (help backward/forward compatibility)
+ *     - Add retry ioctls (work like PM)
+ *
+ * V11 to V12
+ * ----------
+ *     - Add SIOCSIWSTATS to get /proc/net/wireless programatically
+ *     - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
+ *     - Add new statistics (frag, retry, beacon)
+ *     - Add average quality (for user space calibration)
+ *
+ * V12 to V13
+ * ----------
+ *     - Document creation of new driver API.
+ *     - Extract union iwreq_data from struct iwreq (for new driver API).
+ *     - Rename SIOCSIWNAME as SIOCSIWCOMMIT
+ *
+ * V13 to V14
+ * ----------
+ *     - Wireless Events support : define struct iw_event
+ *     - Define additional specific event numbers
+ *     - Add "addr" and "param" fields in union iwreq_data
+ *     - AP scanning stuff (SIOCSIWSCAN and friends)
+ *
+ * V14 to V15
+ * ----------
+ *     - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
+ *     - Make struct iw_freq signed (both m & e), add explicit padding
+ *     - Add IWEVCUSTOM for driver specific event/scanning token
+ *     - Add IW_MAX_GET_SPY for driver returning a lot of addresses
+ *     - Add IW_TXPOW_RANGE for range of Tx Powers
+ *     - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
+ *     - Add IW_MODE_MONITOR for passive monitor
+ *
+ * V15 to V16
+ * ----------
+ *     - Increase the number of bitrates in iw_range to 32 (for 802.11g)
+ *     - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
+ *     - Reshuffle struct iw_range for increases, add filler
+ *     - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
+ *     - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
+ *     - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
+ *     - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
+ *
+ * V16 to V17
+ * ----------
+ *     - Add flags to frequency -> auto/fixed
+ *     - Document (struct iw_quality *)->updated, add new flags (INVALID)
+ *     - Wireless Event capability in struct iw_range
+ *     - Add support for relative TxPower (yick !)
+ *
+ * V17 to V18 (From Jouni Malinen <j@w1.fi>)
+ * ----------
+ *     - Add support for WPA/WPA2
+ *     - Add extended encoding configuration (SIOCSIWENCODEEXT and
+ *       SIOCGIWENCODEEXT)
+ *     - Add SIOCSIWGENIE/SIOCGIWGENIE
+ *     - Add SIOCSIWMLME
+ *     - Add SIOCSIWPMKSA
+ *     - Add struct iw_range bit field for supported encoding capabilities
+ *     - Add optional scan request parameters for SIOCSIWSCAN
+ *     - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
+ *       related parameters (extensible up to 4096 parameter values)
+ *     - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
+ *       IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
+ *
+ * V18 to V19
+ * ----------
+ *     - Remove (struct iw_point *)->pointer from events and streams
+ *     - Remove header includes to help user space
+ *     - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
+ *     - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
+ *     - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
+ *     - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
+ *
+ * V19 to V20
+ * ----------
+ *     - RtNetlink requests support (SET/GET)
+ *
+ * V20 to V21
+ * ----------
+ *     - Remove (struct net_device *)->get_wireless_stats()
+ *     - Change length in ESSID and NICK to strlen() instead of strlen()+1
+ *     - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
+ *     - Power/Retry relative values no longer * 100000
+ *     - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
+ *
+ * V21 to V22
+ * ----------
+ *     - Prevent leaking of kernel space in stream on 64 bits.
+ */
+
+/**************************** CONSTANTS ****************************/
+
+/* -------------------------- IOCTL LIST -------------------------- */
+
+/* Wireless Identification */
+#define SIOCSIWCOMMIT  0x8B00          /* Commit pending changes to driver */
+#define SIOCGIWNAME    0x8B01          /* get name == wireless protocol */
+/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
+ * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
+ * Don't put the name of your driver there, it's useless. */
+
+/* Basic operations */
+#define SIOCSIWNWID    0x8B02          /* set network id (pre-802.11) */
+#define SIOCGIWNWID    0x8B03          /* get network id (the cell) */
+#define SIOCSIWFREQ    0x8B04          /* set channel/frequency (Hz) */
+#define SIOCGIWFREQ    0x8B05          /* get channel/frequency (Hz) */
+#define SIOCSIWMODE    0x8B06          /* set operation mode */
+#define SIOCGIWMODE    0x8B07          /* get operation mode */
+#define SIOCSIWSENS    0x8B08          /* set sensitivity (dBm) */
+#define SIOCGIWSENS    0x8B09          /* get sensitivity (dBm) */
+
+/* Informative stuff */
+#define SIOCSIWRANGE   0x8B0A          /* Unused */
+#define SIOCGIWRANGE   0x8B0B          /* Get range of parameters */
+#define SIOCSIWPRIV    0x8B0C          /* Unused */
+#define SIOCGIWPRIV    0x8B0D          /* get private ioctl interface info */
+#define SIOCSIWSTATS   0x8B0E          /* Unused */
+#define SIOCGIWSTATS   0x8B0F          /* Get /proc/net/wireless stats */
+/* SIOCGIWSTATS is strictly used between user space and the kernel, and
+ * is never passed to the driver (i.e. the driver will never see it). */
+
+/* Spy support (statistics per MAC address - used for Mobile IP support) */
+#define SIOCSIWSPY     0x8B10          /* set spy addresses */
+#define SIOCGIWSPY     0x8B11          /* get spy info (quality of link) */
+#define SIOCSIWTHRSPY  0x8B12          /* set spy threshold (spy event) */
+#define SIOCGIWTHRSPY  0x8B13          /* get spy threshold */
+
+/* Access Point manipulation */
+#define SIOCSIWAP      0x8B14          /* set access point MAC addresses */
+#define SIOCGIWAP      0x8B15          /* get access point MAC addresses */
+#define SIOCGIWAPLIST  0x8B17          /* Deprecated in favor of scanning */
+#define SIOCSIWSCAN    0x8B18          /* trigger scanning (list cells) */
+#define SIOCGIWSCAN    0x8B19          /* get scanning results */
+
+/* 802.11 specific support */
+#define SIOCSIWESSID   0x8B1A          /* set ESSID (network name) */
+#define SIOCGIWESSID   0x8B1B          /* get ESSID */
+#define SIOCSIWNICKN   0x8B1C          /* set node name/nickname */
+#define SIOCGIWNICKN   0x8B1D          /* get node name/nickname */
+/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
+ * within the 'iwreq' structure, so we need to use the 'data' member to
+ * point to a string in user space, like it is done for RANGE... */
+
+/* Other parameters useful in 802.11 and some other devices */
+#define SIOCSIWRATE    0x8B20          /* set default bit rate (bps) */
+#define SIOCGIWRATE    0x8B21          /* get default bit rate (bps) */
+#define SIOCSIWRTS     0x8B22          /* set RTS/CTS threshold (bytes) */
+#define SIOCGIWRTS     0x8B23          /* get RTS/CTS threshold (bytes) */
+#define SIOCSIWFRAG    0x8B24          /* set fragmentation thr (bytes) */
+#define SIOCGIWFRAG    0x8B25          /* get fragmentation thr (bytes) */
+#define SIOCSIWTXPOW   0x8B26          /* set transmit power (dBm) */
+#define SIOCGIWTXPOW   0x8B27          /* get transmit power (dBm) */
+#define SIOCSIWRETRY   0x8B28          /* set retry limits and lifetime */
+#define SIOCGIWRETRY   0x8B29          /* get retry limits and lifetime */
+
+/* Encoding stuff (scrambling, hardware security, WEP...) */
+#define SIOCSIWENCODE  0x8B2A          /* set encoding token & mode */
+#define SIOCGIWENCODE  0x8B2B          /* get encoding token & mode */
+/* Power saving stuff (power management, unicast and multicast) */
+#define SIOCSIWPOWER   0x8B2C          /* set Power Management settings */
+#define SIOCGIWPOWER   0x8B2D          /* get Power Management settings */
+
+/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
+ * This ioctl uses struct iw_point and data buffer that includes IE id and len
+ * fields. More than one IE may be included in the request. Setting the generic
+ * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
+ * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
+ * are required to report the used IE as a wireless event, e.g., when
+ * associating with an AP. */
+#define SIOCSIWGENIE   0x8B30          /* set generic IE */
+#define SIOCGIWGENIE   0x8B31          /* get generic IE */
+
+/* WPA : IEEE 802.11 MLME requests */
+#define SIOCSIWMLME    0x8B16          /* request MLME operation; uses
+                                        * struct iw_mlme */
+/* WPA : Authentication mode parameters */
+#define SIOCSIWAUTH    0x8B32          /* set authentication mode params */
+#define SIOCGIWAUTH    0x8B33          /* get authentication mode params */
+
+/* WPA : Extended version of encoding configuration */
+#define SIOCSIWENCODEEXT 0x8B34                /* set encoding token & mode */
+#define SIOCGIWENCODEEXT 0x8B35                /* get encoding token & mode */
+
+/* WPA2 : PMKSA cache management */
+#define SIOCSIWPMKSA   0x8B36          /* PMKSA cache operation */
+
+/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
+
+/* These 32 ioctl are wireless device private, for 16 commands.
+ * Each driver is free to use them for whatever purpose it chooses,
+ * however the driver *must* export the description of those ioctls
+ * with SIOCGIWPRIV and *must* use arguments as defined below.
+ * If you don't follow those rules, DaveM is going to hate you (reason :
+ * it make mixed 32/64bit operation impossible).
+ */
+#define SIOCIWFIRSTPRIV        0x8BE0
+#define SIOCIWLASTPRIV 0x8BFF
+/* Previously, we were using SIOCDEVPRIVATE, but we now have our
+ * separate range because of collisions with other tools such as
+ * 'mii-tool'.
+ * We now have 32 commands, so a bit more space ;-).
+ * Also, all 'even' commands are only usable by root and don't return the
+ * content of ifr/iwr to user (but you are not obliged to use the set/get
+ * convention, just use every other two command). More details in iwpriv.c.
+ * And I repeat : you are not forced to use them with iwpriv, but you
+ * must be compliant with it.
+ */
+
+/* ------------------------- IOCTL STUFF ------------------------- */
+
+/* The first and the last (range) */
+#define SIOCIWFIRST    0x8B00
+#define SIOCIWLAST     SIOCIWLASTPRIV          /* 0x8BFF */
+#define IW_IOCTL_IDX(cmd)      ((cmd) - SIOCIWFIRST)
+#define IW_HANDLER(id, func)                   \
+       [IW_IOCTL_IDX(id)] = func
+
+/* Odd : get (world access), even : set (root access) */
+#define IW_IS_SET(cmd) (!((cmd) & 0x1))
+#define IW_IS_GET(cmd) ((cmd) & 0x1)
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/* Those are *NOT* ioctls, do not issue request on them !!! */
+/* Most events use the same identifier as ioctl requests */
+
+#define IWEVTXDROP     0x8C00          /* Packet dropped to excessive retry */
+#define IWEVQUAL       0x8C01          /* Quality part of statistics (scan) */
+#define IWEVCUSTOM     0x8C02          /* Driver specific ascii string */
+#define IWEVREGISTERED 0x8C03          /* Discovered a new node (AP mode) */
+#define IWEVEXPIRED    0x8C04          /* Expired a node (AP mode) */
+#define IWEVGENIE      0x8C05          /* Generic IE (WPA, RSN, WMM, ..)
+                                        * (scan results); This includes id and
+                                        * length fields. One IWEVGENIE may
+                                        * contain more than one IE. Scan
+                                        * results may contain one or more
+                                        * IWEVGENIE events. */
+#define IWEVMICHAELMICFAILURE 0x8C06   /* Michael MIC failure
+                                        * (struct iw_michaelmicfailure)
+                                        */
+#define IWEVASSOCREQIE 0x8C07          /* IEs used in (Re)Association Request.
+                                        * The data includes id and length
+                                        * fields and may contain more than one
+                                        * IE. This event is required in
+                                        * Managed mode if the driver
+                                        * generates its own WPA/RSN IE. This
+                                        * should be sent just before
+                                        * IWEVREGISTERED event for the
+                                        * association. */
+#define IWEVASSOCRESPIE        0x8C08          /* IEs used in (Re)Association
+                                        * Response. The data includes id and
+                                        * length fields and may contain more
+                                        * than one IE. This may be sent
+                                        * between IWEVASSOCREQIE and
+                                        * IWEVREGISTERED events for the
+                                        * association. */
+#define IWEVPMKIDCAND  0x8C09          /* PMKID candidate for RSN
+                                        * pre-authentication
+                                        * (struct iw_pmkid_cand) */
+
+#define IWEVFIRST      0x8C00
+#define IW_EVENT_IDX(cmd)      ((cmd) - IWEVFIRST)
+
+/* ------------------------- PRIVATE INFO ------------------------- */
+/*
+ * The following is used with SIOCGIWPRIV. It allow a driver to define
+ * the interface (name, type of data) for its private ioctl.
+ * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
+ */
+
+#define IW_PRIV_TYPE_MASK      0x7000  /* Type of arguments */
+#define IW_PRIV_TYPE_NONE      0x0000
+#define IW_PRIV_TYPE_BYTE      0x1000  /* Char as number */
+#define IW_PRIV_TYPE_CHAR      0x2000  /* Char as character */
+#define IW_PRIV_TYPE_INT       0x4000  /* 32 bits int */
+#define IW_PRIV_TYPE_FLOAT     0x5000  /* struct iw_freq */
+#define IW_PRIV_TYPE_ADDR      0x6000  /* struct sockaddr */
+
+#define IW_PRIV_SIZE_FIXED     0x0800  /* Variable or fixed number of args */
+
+#define IW_PRIV_SIZE_MASK      0x07FF  /* Max number of those args */
+
+/*
+ * Note : if the number of args is fixed and the size < 16 octets,
+ * instead of passing a pointer we will put args in the iwreq struct...
+ */
+
+/* ----------------------- OTHER CONSTANTS ----------------------- */
+
+/* Maximum frequencies in the range struct */
+#define IW_MAX_FREQUENCIES     32
+/* Note : if you have something like 80 frequencies,
+ * don't increase this constant and don't fill the frequency list.
+ * The user will be able to set by channel anyway... */
+
+/* Maximum bit rates in the range struct */
+#define IW_MAX_BITRATES                32
+
+/* Maximum tx powers in the range struct */
+#define IW_MAX_TXPOWER         8
+/* Note : if you more than 8 TXPowers, just set the max and min or
+ * a few of them in the struct iw_range. */
+
+/* Maximum of address that you may set with SPY */
+#define IW_MAX_SPY             8
+
+/* Maximum of address that you may get in the
+   list of access points in range */
+#define IW_MAX_AP              64
+
+/* Maximum size of the ESSID and NICKN strings */
+#define IW_ESSID_MAX_SIZE      32
+
+/* Modes of operation */
+#define IW_MODE_AUTO   0       /* Let the driver decides */
+#define IW_MODE_ADHOC  1       /* Single cell network */
+#define IW_MODE_INFRA  2       /* Multi cell network, roaming, ... */
+#define IW_MODE_MASTER 3       /* Synchronisation master or Access Point */
+#define IW_MODE_REPEAT 4       /* Wireless Repeater (forwarder) */
+#define IW_MODE_SECOND 5       /* Secondary master/repeater (backup) */
+#define IW_MODE_MONITOR        6       /* Passive monitor (listen only) */
+#define IW_MODE_MESH   7       /* Mesh (IEEE 802.11s) network */
+
+/* Statistics flags (bitmask in updated) */
+#define IW_QUAL_QUAL_UPDATED   0x01    /* Value was updated since last read */
+#define IW_QUAL_LEVEL_UPDATED  0x02
+#define IW_QUAL_NOISE_UPDATED  0x04
+#define IW_QUAL_ALL_UPDATED    0x07
+#define IW_QUAL_DBM            0x08    /* Level + Noise are dBm */
+#define IW_QUAL_QUAL_INVALID   0x10    /* Driver doesn't provide value */
+#define IW_QUAL_LEVEL_INVALID  0x20
+#define IW_QUAL_NOISE_INVALID  0x40
+#define IW_QUAL_RCPI           0x80    /* Level + Noise are 802.11k RCPI */
+#define IW_QUAL_ALL_INVALID    0x70
+
+/* Frequency flags */
+#define IW_FREQ_AUTO           0x00    /* Let the driver decides */
+#define IW_FREQ_FIXED          0x01    /* Force a specific value */
+
+/* Maximum number of size of encoding token available
+ * they are listed in the range structure */
+#define IW_MAX_ENCODING_SIZES  8
+
+/* Maximum size of the encoding token in bytes */
+#define IW_ENCODING_TOKEN_MAX  64      /* 512 bits (for now) */
+
+/* Flags for encoding (along with the token) */
+#define IW_ENCODE_INDEX                0x00FF  /* Token index (if needed) */
+#define IW_ENCODE_FLAGS                0xFF00  /* Flags defined below */
+#define IW_ENCODE_MODE         0xF000  /* Modes defined below */
+#define IW_ENCODE_DISABLED     0x8000  /* Encoding disabled */
+#define IW_ENCODE_ENABLED      0x0000  /* Encoding enabled */
+#define IW_ENCODE_RESTRICTED   0x4000  /* Refuse non-encoded packets */
+#define IW_ENCODE_OPEN         0x2000  /* Accept non-encoded packets */
+#define IW_ENCODE_NOKEY                0x0800  /* Key is write only, so not present */
+#define IW_ENCODE_TEMP         0x0400  /* Temporary key */
+
+/* Power management flags available (along with the value, if any) */
+#define IW_POWER_ON            0x0000  /* No details... */
+#define IW_POWER_TYPE          0xF000  /* Type of parameter */
+#define IW_POWER_PERIOD                0x1000  /* Value is a period/duration of  */
+#define IW_POWER_TIMEOUT       0x2000  /* Value is a timeout (to go asleep) */
+#define IW_POWER_MODE          0x0F00  /* Power Management mode */
+#define IW_POWER_UNICAST_R     0x0100  /* Receive only unicast messages */
+#define IW_POWER_MULTICAST_R   0x0200  /* Receive only multicast messages */
+#define IW_POWER_ALL_R         0x0300  /* Receive all messages though PM */
+#define IW_POWER_FORCE_S       0x0400  /* Force PM procedure for sending unicast */
+#define IW_POWER_REPEATER      0x0800  /* Repeat broadcast messages in PM period */
+#define IW_POWER_MODIFIER      0x000F  /* Modify a parameter */
+#define IW_POWER_MIN           0x0001  /* Value is a minimum  */
+#define IW_POWER_MAX           0x0002  /* Value is a maximum */
+#define IW_POWER_RELATIVE      0x0004  /* Value is not in seconds/ms/us */
+
+/* Transmit Power flags available */
+#define IW_TXPOW_TYPE          0x00FF  /* Type of value */
+#define IW_TXPOW_DBM           0x0000  /* Value is in dBm */
+#define IW_TXPOW_MWATT         0x0001  /* Value is in mW */
+#define IW_TXPOW_RELATIVE      0x0002  /* Value is in arbitrary units */
+#define IW_TXPOW_RANGE         0x1000  /* Range of value between min/max */
+
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON            0x0000  /* No details... */
+#define IW_RETRY_TYPE          0xF000  /* Type of parameter */
+#define IW_RETRY_LIMIT         0x1000  /* Maximum number of retries*/
+#define IW_RETRY_LIFETIME      0x2000  /* Maximum duration of retries in us */
+#define IW_RETRY_MODIFIER      0x00FF  /* Modify a parameter */
+#define IW_RETRY_MIN           0x0001  /* Value is a minimum  */
+#define IW_RETRY_MAX           0x0002  /* Value is a maximum */
+#define IW_RETRY_RELATIVE      0x0004  /* Value is not in seconds/ms/us */
+#define IW_RETRY_SHORT         0x0010  /* Value is for short packets  */
+#define IW_RETRY_LONG          0x0020  /* Value is for long packets */
+
+/* Scanning request flags */
+#define IW_SCAN_DEFAULT                0x0000  /* Default scan of the driver */
+#define IW_SCAN_ALL_ESSID      0x0001  /* Scan all ESSIDs */
+#define IW_SCAN_THIS_ESSID     0x0002  /* Scan only this ESSID */
+#define IW_SCAN_ALL_FREQ       0x0004  /* Scan all Frequencies */
+#define IW_SCAN_THIS_FREQ      0x0008  /* Scan only this Frequency */
+#define IW_SCAN_ALL_MODE       0x0010  /* Scan all Modes */
+#define IW_SCAN_THIS_MODE      0x0020  /* Scan only this Mode */
+#define IW_SCAN_ALL_RATE       0x0040  /* Scan all Bit-Rates */
+#define IW_SCAN_THIS_RATE      0x0080  /* Scan only this Bit-Rate */
+/* struct iw_scan_req scan_type */
+#define IW_SCAN_TYPE_ACTIVE 0
+#define IW_SCAN_TYPE_PASSIVE 1
+/* Maximum size of returned data */
+#define IW_SCAN_MAX_DATA       4096    /* In bytes */
+
+/* Scan capability flags - in (struct iw_range *)->scan_capa */
+#define IW_SCAN_CAPA_NONE              0x00
+#define IW_SCAN_CAPA_ESSID             0x01
+#define IW_SCAN_CAPA_BSSID             0x02
+#define IW_SCAN_CAPA_CHANNEL   0x04
+#define IW_SCAN_CAPA_MODE              0x08
+#define IW_SCAN_CAPA_RATE              0x10
+#define IW_SCAN_CAPA_TYPE              0x20
+#define IW_SCAN_CAPA_TIME              0x40
+
+/* Max number of char in custom event - use multiple of them if needed */
+#define IW_CUSTOM_MAX          256     /* In bytes */
+
+/* Generic information element */
+#define IW_GENERIC_IE_MAX      1024
+
+/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
+#define IW_MLME_DEAUTH         0
+#define IW_MLME_DISASSOC       1
+#define IW_MLME_AUTH           2
+#define IW_MLME_ASSOC          3
+
+/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
+#define IW_AUTH_INDEX          0x0FFF
+#define IW_AUTH_FLAGS          0xF000
+/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
+ * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
+ * parameter that is being set/get to; value will be read/written to
+ * struct iw_param value field) */
+#define IW_AUTH_WPA_VERSION            0
+#define IW_AUTH_CIPHER_PAIRWISE                1
+#define IW_AUTH_CIPHER_GROUP           2
+#define IW_AUTH_KEY_MGMT               3
+#define IW_AUTH_TKIP_COUNTERMEASURES   4
+#define IW_AUTH_DROP_UNENCRYPTED       5
+#define IW_AUTH_80211_AUTH_ALG         6
+#define IW_AUTH_WPA_ENABLED            7
+#define IW_AUTH_RX_UNENCRYPTED_EAPOL   8
+#define IW_AUTH_ROAMING_CONTROL                9
+#define IW_AUTH_PRIVACY_INVOKED                10
+#define IW_AUTH_CIPHER_GROUP_MGMT      11
+#define IW_AUTH_MFP                    12
+
+/* IW_AUTH_WPA_VERSION values (bit field) */
+#define IW_AUTH_WPA_VERSION_DISABLED   0x00000001
+#define IW_AUTH_WPA_VERSION_WPA                0x00000002
+#define IW_AUTH_WPA_VERSION_WPA2       0x00000004
+
+/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
+ * values (bit field) */
+#define IW_AUTH_CIPHER_NONE    0x00000001
+#define IW_AUTH_CIPHER_WEP40   0x00000002
+#define IW_AUTH_CIPHER_TKIP    0x00000004
+#define IW_AUTH_CIPHER_CCMP    0x00000008
+#define IW_AUTH_CIPHER_WEP104  0x00000010
+#define IW_AUTH_CIPHER_AES_CMAC        0x00000020
+
+/* IW_AUTH_KEY_MGMT values (bit field) */
+#define IW_AUTH_KEY_MGMT_802_1X        1
+#define IW_AUTH_KEY_MGMT_PSK   2
+
+/* IW_AUTH_80211_AUTH_ALG values (bit field) */
+#define IW_AUTH_ALG_OPEN_SYSTEM        0x00000001
+#define IW_AUTH_ALG_SHARED_KEY 0x00000002
+#define IW_AUTH_ALG_LEAP       0x00000004
+
+/* IW_AUTH_ROAMING_CONTROL values */
+#define IW_AUTH_ROAMING_ENABLE 0       /* driver/firmware based roaming */
+#define IW_AUTH_ROAMING_DISABLE        1       /* user space program used for roaming
+                                        * control */
+
+/* IW_AUTH_MFP (management frame protection) values */
+#define IW_AUTH_MFP_DISABLED   0       /* MFP disabled */
+#define IW_AUTH_MFP_OPTIONAL   1       /* MFP optional */
+#define IW_AUTH_MFP_REQUIRED   2       /* MFP required */
+
+/* SIOCSIWENCODEEXT definitions */
+#define IW_ENCODE_SEQ_MAX_SIZE 8
+/* struct iw_encode_ext ->alg */
+#define IW_ENCODE_ALG_NONE     0
+#define IW_ENCODE_ALG_WEP      1
+#define IW_ENCODE_ALG_TKIP     2
+#define IW_ENCODE_ALG_CCMP     3
+#define IW_ENCODE_ALG_PMK      4
+#define IW_ENCODE_ALG_AES_CMAC 5
+/* struct iw_encode_ext ->ext_flags */
+#define IW_ENCODE_EXT_TX_SEQ_VALID     0x00000001
+#define IW_ENCODE_EXT_RX_SEQ_VALID     0x00000002
+#define IW_ENCODE_EXT_GROUP_KEY                0x00000004
+#define IW_ENCODE_EXT_SET_TX_KEY       0x00000008
+
+/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
+#define IW_MICFAILURE_KEY_ID   0x00000003 /* Key ID 0..3 */
+#define IW_MICFAILURE_GROUP    0x00000004
+#define IW_MICFAILURE_PAIRWISE 0x00000008
+#define IW_MICFAILURE_STAKEY   0x00000010
+#define IW_MICFAILURE_COUNT    0x00000060 /* 1 or 2 (0 = count not supported)
+                                           */
+
+/* Bit field values for enc_capa in struct iw_range */
+#define IW_ENC_CAPA_WPA                0x00000001
+#define IW_ENC_CAPA_WPA2       0x00000002
+#define IW_ENC_CAPA_CIPHER_TKIP        0x00000004
+#define IW_ENC_CAPA_CIPHER_CCMP        0x00000008
+#define IW_ENC_CAPA_4WAY_HANDSHAKE     0x00000010
+
+/* Event capability macros - in (struct iw_range *)->event_capa
+ * Because we have more than 32 possible events, we use an array of
+ * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
+#define IW_EVENT_CAPA_BASE(cmd)                ((cmd >= SIOCIWFIRSTPRIV) ? \
+                                        (cmd - SIOCIWFIRSTPRIV + 0x60) : \
+                                        (cmd - SIOCIWFIRST))
+#define IW_EVENT_CAPA_INDEX(cmd)       (IW_EVENT_CAPA_BASE(cmd) >> 5)
+#define IW_EVENT_CAPA_MASK(cmd)                (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
+/* Event capability constants - event autogenerated by the kernel
+ * This list is valid for most 802.11 devices, customise as needed... */
+#define IW_EVENT_CAPA_K_0      (IW_EVENT_CAPA_MASK(0x8B04) | \
+                                IW_EVENT_CAPA_MASK(0x8B06) | \
+                                IW_EVENT_CAPA_MASK(0x8B1A))
+#define IW_EVENT_CAPA_K_1      (IW_EVENT_CAPA_MASK(0x8B2A))
+/* "Easy" macro to set events in iw_range (less efficient) */
+#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
+#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
+
+
+/****************************** TYPES ******************************/
+
+/* --------------------------- SUBTYPES --------------------------- */
+/*
+ *     Generic format for most parameters that fit in an int
+ */
+struct iw_param
+{
+  __s32                value;          /* The value of the parameter itself */
+  __u8         fixed;          /* Hardware should not use auto select */
+  __u8         disabled;       /* Disable the feature */
+  __u16                flags;          /* Various specifc flags (if any) */
+};
+
+/*
+ *     For all data larger than 16 octets, we need to use a
+ *     pointer to memory allocated in user space.
+ */
+struct iw_point
+{
+  void __user  *pointer;       /* Pointer to the data  (in user space) */
+  __u16                length;         /* number of fields or size in bytes */
+  __u16                flags;          /* Optional params */
+};
+
+
+/*
+ *     A frequency
+ *     For numbers lower than 10^9, we encode the number in 'm' and
+ *     set 'e' to 0
+ *     For number greater than 10^9, we divide it by the lowest power
+ *     of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
+ *     The power of 10 is in 'e', the result of the division is in 'm'.
+ */
+struct iw_freq
+{
+       __s32           m;              /* Mantissa */
+       __s16           e;              /* Exponent */
+       __u8            i;              /* List index (when in range struct) */
+       __u8            flags;          /* Flags (fixed/auto) */
+};
+
+/*
+ *     Quality of the link
+ */
+struct iw_quality
+{
+       __u8            qual;           /* link quality (%retries, SNR,
+                                          %missed beacons or better...) */
+       __u8            level;          /* signal level (dBm) */
+       __u8            noise;          /* noise level (dBm) */
+       __u8            updated;        /* Flags to know if updated */
+};
+
+/*
+ *     Packet discarded in the wireless adapter due to
+ *     "wireless" specific problems...
+ *     Note : the list of counter and statistics in net_device_stats
+ *     is already pretty exhaustive, and you should use that first.
+ *     This is only additional stats...
+ */
+struct iw_discarded
+{
+       __u32           nwid;           /* Rx : Wrong nwid/essid */
+       __u32           code;           /* Rx : Unable to code/decode (WEP) */
+       __u32           fragment;       /* Rx : Can't perform MAC reassembly */
+       __u32           retries;        /* Tx : Max MAC retries num reached */
+       __u32           misc;           /* Others cases */
+};
+
+/*
+ *     Packet/Time period missed in the wireless adapter due to
+ *     "wireless" specific problems...
+ */
+struct iw_missed
+{
+       __u32           beacon;         /* Missed beacons/superframe */
+};
+
+/*
+ *     Quality range (for spy threshold)
+ */
+struct iw_thrspy
+{
+       struct sockaddr         addr;           /* Source address (hw/mac) */
+       struct iw_quality       qual;           /* Quality of the link */
+       struct iw_quality       low;            /* Low threshold */
+       struct iw_quality       high;           /* High threshold */
+};
+
+/*
+ *     Optional data for scan request
+ *
+ *     Note: these optional parameters are controlling parameters for the
+ *     scanning behavior, these do not apply to getting scan results
+ *     (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
+ *     provide a merged results with all BSSes even if the previous scan
+ *     request limited scanning to a subset, e.g., by specifying an SSID.
+ *     Especially, scan results are required to include an entry for the
+ *     current BSS if the driver is in Managed mode and associated with an AP.
+ */
+struct iw_scan_req
+{
+       __u8            scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
+       __u8            essid_len;
+       __u8            num_channels; /* num entries in channel_list;
+                                      * 0 = scan all allowed channels */
+       __u8            flags; /* reserved as padding; use zero, this may
+                               * be used in the future for adding flags
+                               * to request different scan behavior */
+       struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
+                               * individual address of a specific BSS */
+
+       /*
+        * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
+        * the current ESSID. This allows scan requests for specific ESSID
+        * without having to change the current ESSID and potentially breaking
+        * the current association.
+        */
+       __u8            essid[IW_ESSID_MAX_SIZE];
+
+       /*
+        * Optional parameters for changing the default scanning behavior.
+        * These are based on the MLME-SCAN.request from IEEE Std 802.11.
+        * TU is 1.024 ms. If these are set to 0, driver is expected to use
+        * reasonable default values. min_channel_time defines the time that
+        * will be used to wait for the first reply on each channel. If no
+        * replies are received, next channel will be scanned after this. If
+        * replies are received, total time waited on the channel is defined by
+        * max_channel_time.
+        */
+       __u32           min_channel_time; /* in TU */
+       __u32           max_channel_time; /* in TU */
+
+       struct iw_freq  channel_list[IW_MAX_FREQUENCIES];
+};
+
+/* ------------------------- WPA SUPPORT ------------------------- */
+
+/*
+ *     Extended data structure for get/set encoding (this is used with
+ *     SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
+ *     flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
+ *     only the data contents changes (key data -> this structure, including
+ *     key data).
+ *
+ *     If the new key is the first group key, it will be set as the default
+ *     TX key. Otherwise, default TX key index is only changed if
+ *     IW_ENCODE_EXT_SET_TX_KEY flag is set.
+ *
+ *     Key will be changed with SIOCSIWENCODEEXT in all cases except for
+ *     special "change TX key index" operation which is indicated by setting
+ *     key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
+ *
+ *     tx_seq/rx_seq are only used when respective
+ *     IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
+ *     TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
+ *     TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
+ *     used only by an Authenticator (AP or an IBSS station) to get the
+ *     current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
+ *     RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
+ *     debugging/testing.
+ */
+struct iw_encode_ext
+{
+       __u32           ext_flags; /* IW_ENCODE_EXT_* */
+       __u8            tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+       __u8            rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+       struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
+                              * (group) keys or unicast address for
+                              * individual keys */
+       __u16           alg; /* IW_ENCODE_ALG_* */
+       __u16           key_len;
+       __u8            key[0];
+};
+
+/* SIOCSIWMLME data */
+struct iw_mlme
+{
+       __u16           cmd; /* IW_MLME_* */
+       __u16           reason_code;
+       struct sockaddr addr;
+};
+
+/* SIOCSIWPMKSA data */
+#define IW_PMKSA_ADD           1
+#define IW_PMKSA_REMOVE                2
+#define IW_PMKSA_FLUSH         3
+
+#define IW_PMKID_LEN   16
+
+struct iw_pmksa
+{
+       __u32           cmd; /* IW_PMKSA_* */
+       struct sockaddr bssid;
+       __u8            pmkid[IW_PMKID_LEN];
+};
+
+/* IWEVMICHAELMICFAILURE data */
+struct iw_michaelmicfailure
+{
+       __u32           flags;
+       struct sockaddr src_addr;
+       __u8            tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
+};
+
+/* IWEVPMKIDCAND data */
+#define IW_PMKID_CAND_PREAUTH  0x00000001 /* RNS pre-authentication enabled */
+struct iw_pmkid_cand
+{
+       __u32           flags; /* IW_PMKID_CAND_* */
+       __u32           index; /* the smaller the index, the higher the
+                               * priority */
+       struct sockaddr bssid;
+};
+
+/* ------------------------ WIRELESS STATS ------------------------ */
+/*
+ * Wireless statistics (used for /proc/net/wireless)
+ */
+struct iw_statistics
+{
+       __u16           status;         /* Status
+                                        * - device dependent for now */
+
+       struct iw_quality       qual;           /* Quality of the link
+                                                * (instant/mean/max) */
+       struct iw_discarded     discard;        /* Packet discarded counts */
+       struct iw_missed        miss;           /* Packet missed counts */
+};
+
+/* ------------------------ IOCTL REQUEST ------------------------ */
+/*
+ * This structure defines the payload of an ioctl, and is used 
+ * below.
+ *
+ * Note that this structure should fit on the memory footprint
+ * of iwreq (which is the same as ifreq), which mean a max size of
+ * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
+ * You should check this when increasing the structures defined
+ * above in this file...
+ */
+union  iwreq_data
+{
+       /* Config - generic */
+       char            name[IFNAMSIZ];
+       /* Name : used to verify the presence of  wireless extensions.
+        * Name of the protocol/provider... */
+
+       struct iw_point essid;          /* Extended network name */
+       struct iw_param nwid;           /* network id (or domain - the cell) */
+       struct iw_freq  freq;           /* frequency or channel :
+                                        * 0-1000 = channel
+                                        * > 1000 = frequency in Hz */
+
+       struct iw_param sens;           /* signal level threshold */
+       struct iw_param bitrate;        /* default bit rate */
+       struct iw_param txpower;        /* default transmit power */
+       struct iw_param rts;            /* RTS threshold threshold */
+       struct iw_param frag;           /* Fragmentation threshold */
+       __u32           mode;           /* Operation mode */
+       struct iw_param retry;          /* Retry limits & lifetime */
+
+       struct iw_point encoding;       /* Encoding stuff : tokens */
+       struct iw_param power;          /* PM duration/timeout */
+       struct iw_quality qual;         /* Quality part of statistics */
+
+       struct sockaddr ap_addr;        /* Access point address */
+       struct sockaddr addr;           /* Destination address (hw/mac) */
+
+       struct iw_param param;          /* Other small parameters */
+       struct iw_point data;           /* Other large parameters */
+};
+
+/*
+ * The structure to exchange data for ioctl.
+ * This structure is the same as 'struct ifreq', but (re)defined for
+ * convenience...
+ * Do I need to remind you about structure size (32 octets) ?
+ */
+struct iwreq 
+{
+       union
+       {
+               char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "eth0" */
+       } ifr_ifrn;
+
+       /* Data part (defined just above) */
+       union   iwreq_data      u;
+};
+
+/* -------------------------- IOCTL DATA -------------------------- */
+/*
+ *     For those ioctl which want to exchange mode data that what could
+ *     fit in the above structure...
+ */
+
+/*
+ *     Range of parameters
+ */
+
+struct iw_range
+{
+       /* Informative stuff (to choose between different interface) */
+       __u32           throughput;     /* To give an idea... */
+       /* In theory this value should be the maximum benchmarked
+        * TCP/IP throughput, because with most of these devices the
+        * bit rate is meaningless (overhead an co) to estimate how
+        * fast the connection will go and pick the fastest one.
+        * I suggest people to play with Netperf or any benchmark...
+        */
+
+       /* NWID (or domain id) */
+       __u32           min_nwid;       /* Minimal NWID we are able to set */
+       __u32           max_nwid;       /* Maximal NWID we are able to set */
+
+       /* Old Frequency (backward compat - moved lower ) */
+       __u16           old_num_channels;
+       __u8            old_num_frequency;
+
+       /* Scan capabilities */
+       __u8            scan_capa;      /* IW_SCAN_CAPA_* bit field */
+
+       /* Wireless event capability bitmasks */
+       __u32           event_capa[6];
+
+       /* signal level threshold range */
+       __s32           sensitivity;
+
+       /* Quality of link & SNR stuff */
+       /* Quality range (link, level, noise)
+        * If the quality is absolute, it will be in the range [0 ; max_qual],
+        * if the quality is dBm, it will be in the range [max_qual ; 0].
+        * Don't forget that we use 8 bit arithmetics... */
+       struct iw_quality       max_qual;       /* Quality of the link */
+       /* This should contain the average/typical values of the quality
+        * indicator. This should be the threshold between a "good" and
+        * a "bad" link (example : monitor going from green to orange).
+        * Currently, user space apps like quality monitors don't have any
+        * way to calibrate the measurement. With this, they can split
+        * the range between 0 and max_qual in different quality level
+        * (using a geometric subdivision centered on the average).
+        * I expect that people doing the user space apps will feedback
+        * us on which value we need to put in each driver... */
+       struct iw_quality       avg_qual;       /* Quality of the link */
+
+       /* Rates */
+       __u8            num_bitrates;   /* Number of entries in the list */
+       __s32           bitrate[IW_MAX_BITRATES];       /* list, in bps */
+
+       /* RTS threshold */
+       __s32           min_rts;        /* Minimal RTS threshold */
+       __s32           max_rts;        /* Maximal RTS threshold */
+
+       /* Frag threshold */
+       __s32           min_frag;       /* Minimal frag threshold */
+       __s32           max_frag;       /* Maximal frag threshold */
+
+       /* Power Management duration & timeout */
+       __s32           min_pmp;        /* Minimal PM period */
+       __s32           max_pmp;        /* Maximal PM period */
+       __s32           min_pmt;        /* Minimal PM timeout */
+       __s32           max_pmt;        /* Maximal PM timeout */
+       __u16           pmp_flags;      /* How to decode max/min PM period */
+       __u16           pmt_flags;      /* How to decode max/min PM timeout */
+       __u16           pm_capa;        /* What PM options are supported */
+
+       /* Encoder stuff */
+       __u16   encoding_size[IW_MAX_ENCODING_SIZES];   /* Different token sizes */
+       __u8    num_encoding_sizes;     /* Number of entry in the list */
+       __u8    max_encoding_tokens;    /* Max number of tokens */
+       /* For drivers that need a "login/passwd" form */
+       __u8    encoding_login_index;   /* token index for login token */
+
+       /* Transmit power */
+       __u16           txpower_capa;   /* What options are supported */
+       __u8            num_txpower;    /* Number of entries in the list */
+       __s32           txpower[IW_MAX_TXPOWER];        /* list, in bps */
+
+       /* Wireless Extension version info */
+       __u8            we_version_compiled;    /* Must be WIRELESS_EXT */
+       __u8            we_version_source;      /* Last update of source */
+
+       /* Retry limits and lifetime */
+       __u16           retry_capa;     /* What retry options are supported */
+       __u16           retry_flags;    /* How to decode max/min retry limit */
+       __u16           r_time_flags;   /* How to decode max/min retry life */
+       __s32           min_retry;      /* Minimal number of retries */
+       __s32           max_retry;      /* Maximal number of retries */
+       __s32           min_r_time;     /* Minimal retry lifetime */
+       __s32           max_r_time;     /* Maximal retry lifetime */
+
+       /* Frequency */
+       __u16           num_channels;   /* Number of channels [0; num - 1] */
+       __u8            num_frequency;  /* Number of entry in the list */
+       struct iw_freq  freq[IW_MAX_FREQUENCIES];       /* list */
+       /* Note : this frequency list doesn't need to fit channel numbers,
+        * because each entry contain its channel index */
+
+       __u32           enc_capa;       /* IW_ENC_CAPA_* bit field */
+};
+
+/*
+ * Private ioctl interface information
+ */
+struct iw_priv_args
+{
+       __u32           cmd;            /* Number of the ioctl to issue */
+       __u16           set_args;       /* Type and number of args */
+       __u16           get_args;       /* Type and number of args */
+       char            name[IFNAMSIZ]; /* Name of the extension */
+};
+
+/* ----------------------- WIRELESS EVENTS ----------------------- */
+/*
+ * Wireless events are carried through the rtnetlink socket to user
+ * space. They are encapsulated in the IFLA_WIRELESS field of
+ * a RTM_NEWLINK message.
+ */
+
+/*
+ * A Wireless Event. Contains basically the same data as the ioctl...
+ */
+struct iw_event
+{
+       __u16           len;                    /* Real length of this stuff */
+       __u16           cmd;                    /* Wireless IOCTL */
+       union iwreq_data        u;              /* IOCTL fixed payload */
+};
+
+/* Size of the Event prefix (including padding and alignement junk) */
+#define IW_EV_LCP_LEN  (sizeof(struct iw_event) - sizeof(union iwreq_data))
+/* Size of the various events */
+#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
+#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
+#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_LEN        (IW_EV_LCP_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
+
+/* iw_point events are special. First, the payload (extra data) come at
+ * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
+ * we omit the pointer, so start at an offset. */
+#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
+                         (char *) NULL)
+#define IW_EV_POINT_LEN        (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
+                        IW_EV_POINT_OFF)
+
+
+/* Size of the Event prefix when packed in stream */
+#define IW_EV_LCP_PK_LEN       (4)
+/* Size of the various events when packed in stream */
+#define IW_EV_CHAR_PK_LEN      (IW_EV_LCP_PK_LEN + IFNAMSIZ)
+#define IW_EV_UINT_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(__u32))
+#define IW_EV_FREQ_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_PK_LEN     (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_PK_LEN      (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
+#define IW_EV_POINT_PK_LEN     (IW_EV_LCP_PK_LEN + 4)
+
+#endif /* _UAPI_LINUX_WIRELESS_H */
similarity index 100%
rename from include/linux/x25.h
rename to include/uapi/linux/x25.h
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h
new file mode 100644 (file)
index 0000000..26607bd
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+  File: linux/xattr.h
+
+  Extended attributes handling.
+
+  Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
+  Copyright (c) 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
+  Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+*/
+#ifndef _UAPI_LINUX_XATTR_H
+#define _UAPI_LINUX_XATTR_H
+
+#define XATTR_CREATE   0x1     /* set value, fail if attr already exists */
+#define XATTR_REPLACE  0x2     /* set value, fail if attr does not exist */
+
+/* Namespaces */
+#define XATTR_OS2_PREFIX "os2."
+#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
+
+#define XATTR_SECURITY_PREFIX  "security."
+#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
+
+#define XATTR_SYSTEM_PREFIX "system."
+#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
+
+#define XATTR_TRUSTED_PREFIX "trusted."
+#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
+
+#define XATTR_USER_PREFIX "user."
+#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
+
+/* Security namespace */
+#define XATTR_EVM_SUFFIX "evm"
+#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
+
+#define XATTR_IMA_SUFFIX "ima"
+#define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
+
+#define XATTR_SELINUX_SUFFIX "selinux"
+#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
+
+#define XATTR_SMACK_SUFFIX "SMACK64"
+#define XATTR_SMACK_IPIN "SMACK64IPIN"
+#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
+#define XATTR_SMACK_EXEC "SMACK64EXEC"
+#define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
+#define XATTR_SMACK_MMAP "SMACK64MMAP"
+#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
+#define XATTR_NAME_SMACKIPIN   XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
+#define XATTR_NAME_SMACKIPOUT  XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
+#define XATTR_NAME_SMACKEXEC   XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
+#define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
+#define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
+
+#define XATTR_CAPS_SUFFIX "capability"
+#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
+
+#define XATTR_POSIX_ACL_ACCESS  "posix_acl_access"
+#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
+#define XATTR_POSIX_ACL_DEFAULT  "posix_acl_default"
+#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
+
+
+#endif /* _UAPI_LINUX_XATTR_H */
index 89e4cf672dfe90e0d1fb75fb667d551dc7094f93..6fdd6e339326a079a2b6b5a3a1d2940b2bd81bd8 100644 (file)
@@ -1574,6 +1574,66 @@ config MODULE_SRCVERSION_ALL
          the version).  With this option, such a "srcversion" field
          will be created for all modules.  If unsure, say N.
 
+config MODULE_SIG
+       bool "Module signature verification"
+       depends on MODULES
+       select KEYS
+       select CRYPTO
+       select ASYMMETRIC_KEY_TYPE
+       select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+       select PUBLIC_KEY_ALGO_RSA
+       select ASN1
+       select OID_REGISTRY
+       select X509_CERTIFICATE_PARSER
+       help
+         Check modules for valid signatures upon load: the signature
+         is simply appended to the module. For more information see
+         Documentation/module-signing.txt.
+
+         !!!WARNING!!!  If you enable this option, you MUST make sure that the
+         module DOES NOT get stripped after being signed.  This includes the
+         debuginfo strip done by some packagers (such as rpmbuild) and
+         inclusion into an initramfs that wants the module size reduced.
+
+config MODULE_SIG_FORCE
+       bool "Require modules to be validly signed"
+       depends on MODULE_SIG
+       help
+         Reject unsigned modules or signed modules for which we don't have a
+         key.  Without this, such modules will simply taint the kernel.
+
+choice
+       prompt "Which hash algorithm should modules be signed with?"
+       depends on MODULE_SIG
+       help
+         This determines which sort of hashing algorithm will be used during
+         signature generation.  This algorithm _must_ be built into the kernel
+         directly so that signature verification can take place.  It is not
+         possible to load a signed module containing the algorithm to check
+         the signature on that module.
+
+config MODULE_SIG_SHA1
+       bool "Sign modules with SHA-1"
+       select CRYPTO_SHA1
+
+config MODULE_SIG_SHA224
+       bool "Sign modules with SHA-224"
+       select CRYPTO_SHA256
+
+config MODULE_SIG_SHA256
+       bool "Sign modules with SHA-256"
+       select CRYPTO_SHA256
+
+config MODULE_SIG_SHA384
+       bool "Sign modules with SHA-384"
+       select CRYPTO_SHA512
+
+config MODULE_SIG_SHA512
+       bool "Sign modules with SHA-512"
+       select CRYPTO_SHA512
+
+endchoice
+
 endif # MODULES
 
 config INIT_ALL_POSSIBLE
@@ -1607,4 +1667,12 @@ config PADATA
 config BROKEN_RODATA
        bool
 
+config ASN1
+       tristate
+       help
+         Build a simple ASN.1 grammar compiler that produces a bytecode output
+         that can be interpreted by the ASN.1 stream decoder and used to
+         inform it as to what tags are to be expected in a stream and what
+         functions to call on what tags.
+
 source "kernel/Kconfig.locks"
index 5404911eaee92724e673757c5ba334c54ef6b8ad..0dfeca4324ee06dbb6566db568b9874758344232 100644 (file)
@@ -54,6 +54,7 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
 obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
 obj-$(CONFIG_UID16) += uid16.o
 obj-$(CONFIG_MODULES) += module.o
+obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_KEXEC) += kexec.o
@@ -130,3 +131,79 @@ quiet_cmd_timeconst  = TIMEC   $@
 targets += timeconst.h
 $(obj)/timeconst.h: $(src)/timeconst.pl FORCE
        $(call if_changed,timeconst)
+
+ifeq ($(CONFIG_MODULE_SIG),y)
+#
+# Pull the signing certificate and any extra certificates into the kernel
+#
+extra_certificates:
+       touch $@
+
+kernel/modsign_pubkey.o: signing_key.x509 extra_certificates
+
+###############################################################################
+#
+# If module signing is requested, say by allyesconfig, but a key has not been
+# supplied, then one will need to be generated to make sure the build does not
+# fail and that the kernel may be used afterwards.
+#
+###############################################################################
+sign_key_with_hash :=
+ifeq ($(CONFIG_MODULE_SIG_SHA1),y)
+sign_key_with_hash := -sha1
+endif
+ifeq ($(CONFIG_MODULE_SIG_SHA224),y)
+sign_key_with_hash := -sha224
+endif
+ifeq ($(CONFIG_MODULE_SIG_SHA256),y)
+sign_key_with_hash := -sha256
+endif
+ifeq ($(CONFIG_MODULE_SIG_SHA384),y)
+sign_key_with_hash := -sha384
+endif
+ifeq ($(CONFIG_MODULE_SIG_SHA512),y)
+sign_key_with_hash := -sha512
+endif
+ifeq ($(sign_key_with_hash),)
+$(error Could not determine digest type to use from kernel config)
+endif
+
+signing_key.priv signing_key.x509: x509.genkey
+       @echo "###"
+       @echo "### Now generating an X.509 key pair to be used for signing modules."
+       @echo "###"
+       @echo "### If this takes a long time, you might wish to run rngd in the"
+       @echo "### background to keep the supply of entropy topped up.  It"
+       @echo "### needs to be run as root, and should use a hardware random"
+       @echo "### number generator if one is available, eg:"
+       @echo "###"
+       @echo "###     rngd -r /dev/hwrandom"
+       @echo "###"
+       openssl req -new -nodes -utf8 $(sign_key_with_hash) -days 36500 -batch \
+               -x509 -config x509.genkey \
+               -outform DER -out signing_key.x509 \
+               -keyout signing_key.priv
+       @echo "###"
+       @echo "### Key pair generated."
+       @echo "###"
+
+x509.genkey:
+       @echo Generating X.509 key generation config
+       @echo  >x509.genkey "[ req ]"
+       @echo >>x509.genkey "default_bits = 4096"
+       @echo >>x509.genkey "distinguished_name = req_distinguished_name"
+       @echo >>x509.genkey "prompt = no"
+       @echo >>x509.genkey "string_mask = utf8only"
+       @echo >>x509.genkey "x509_extensions = myexts"
+       @echo >>x509.genkey
+       @echo >>x509.genkey "[ req_distinguished_name ]"
+       @echo >>x509.genkey "O = Magrathea"
+       @echo >>x509.genkey "CN = Glacier signing key"
+       @echo >>x509.genkey "emailAddress = slartibartfast@magrathea.h2g2"
+       @echo >>x509.genkey
+       @echo >>x509.genkey "[ myexts ]"
+       @echo >>x509.genkey "basicConstraints=critical,CA:FALSE"
+       @echo >>x509.genkey "keyUsage=digitalSignature"
+       @echo >>x509.genkey "subjectKeyIdentifier=hash"
+       @echo >>x509.genkey "authorityKeyIdentifier=keyid"
+endif
diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c
new file mode 100644 (file)
index 0000000..4646eb2
--- /dev/null
@@ -0,0 +1,113 @@
+/* Public keys for module signature verification
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/cred.h>
+#include <linux/err.h>
+#include <keys/asymmetric-type.h>
+#include "module-internal.h"
+
+struct key *modsign_keyring;
+
+extern __initdata const u8 modsign_certificate_list[];
+extern __initdata const u8 modsign_certificate_list_end[];
+asm(".section .init.data,\"aw\"\n"
+    "modsign_certificate_list:\n"
+    ".incbin \"signing_key.x509\"\n"
+    ".incbin \"extra_certificates\"\n"
+    "modsign_certificate_list_end:"
+    );
+
+/*
+ * We need to make sure ccache doesn't cache the .o file as it doesn't notice
+ * if modsign.pub changes.
+ */
+static __initdata const char annoy_ccache[] = __TIME__ "foo";
+
+/*
+ * Load the compiled-in keys
+ */
+static __init int module_verify_init(void)
+{
+       pr_notice("Initialise module verification\n");
+
+       modsign_keyring = key_alloc(&key_type_keyring, ".module_sign",
+                                   KUIDT_INIT(0), KGIDT_INIT(0),
+                                   current_cred(),
+                                   (KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                                   KEY_USR_VIEW | KEY_USR_READ,
+                                   KEY_ALLOC_NOT_IN_QUOTA);
+       if (IS_ERR(modsign_keyring))
+               panic("Can't allocate module signing keyring\n");
+
+       if (key_instantiate_and_link(modsign_keyring, NULL, 0, NULL, NULL) < 0)
+               panic("Can't instantiate module signing keyring\n");
+
+       return 0;
+}
+
+/*
+ * Must be initialised before we try and load the keys into the keyring.
+ */
+device_initcall(module_verify_init);
+
+/*
+ * Load the compiled-in keys
+ */
+static __init int load_module_signing_keys(void)
+{
+       key_ref_t key;
+       const u8 *p, *end;
+       size_t plen;
+
+       pr_notice("Loading module verification certificates\n");
+
+       end = modsign_certificate_list_end;
+       p = modsign_certificate_list;
+       while (p < end) {
+               /* Each cert begins with an ASN.1 SEQUENCE tag and must be more
+                * than 256 bytes in size.
+                */
+               if (end - p < 4)
+                       goto dodgy_cert;
+               if (p[0] != 0x30 &&
+                   p[1] != 0x82)
+                       goto dodgy_cert;
+               plen = (p[2] << 8) | p[3];
+               plen += 4;
+               if (plen > end - p)
+                       goto dodgy_cert;
+
+               key = key_create_or_update(make_key_ref(modsign_keyring, 1),
+                                          "asymmetric",
+                                          NULL,
+                                          p,
+                                          plen,
+                                          (KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                                          KEY_USR_VIEW,
+                                          KEY_ALLOC_NOT_IN_QUOTA);
+               if (IS_ERR(key))
+                       pr_err("MODSIGN: Problem loading in-kernel X.509 certificate (%ld)\n",
+                              PTR_ERR(key));
+               else
+                       pr_notice("MODSIGN: Loaded cert '%s'\n",
+                                 key_ref_to_ptr(key)->description);
+               p += plen;
+       }
+
+       return 0;
+
+dodgy_cert:
+       pr_err("MODSIGN: Problem parsing in-kernel X.509 certificate list\n");
+       return 0;
+}
+late_initcall(load_module_signing_keys);
diff --git a/kernel/module-internal.h b/kernel/module-internal.h
new file mode 100644 (file)
index 0000000..6114a13
--- /dev/null
@@ -0,0 +1,15 @@
+/* Module internals
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+extern struct key *modsign_keyring;
+
+extern int mod_verify_sig(const void *mod, unsigned long modlen,
+                         const void *sig, unsigned long siglen);
index 4edbd9c11aca35a71e56bc237ef638d596a7db23..0e2da8695f8ed2d80b4b498eed883e49936fc59f 100644 (file)
@@ -58,6 +58,8 @@
 #include <linux/jump_label.h>
 #include <linux/pfn.h>
 #include <linux/bsearch.h>
+#include <linux/fips.h>
+#include "module-internal.h"
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/module.h>
@@ -102,6 +104,43 @@ static LIST_HEAD(modules);
 struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
 #endif /* CONFIG_KGDB_KDB */
 
+#ifdef CONFIG_MODULE_SIG
+#ifdef CONFIG_MODULE_SIG_FORCE
+static bool sig_enforce = true;
+#else
+static bool sig_enforce = false;
+
+static int param_set_bool_enable_only(const char *val,
+                                     const struct kernel_param *kp)
+{
+       int err;
+       bool test;
+       struct kernel_param dummy_kp = *kp;
+
+       dummy_kp.arg = &test;
+
+       err = param_set_bool(val, &dummy_kp);
+       if (err)
+               return err;
+
+       /* Don't let them unset it once it's set! */
+       if (!test && sig_enforce)
+               return -EROFS;
+
+       if (test)
+               sig_enforce = true;
+       return 0;
+}
+
+static const struct kernel_param_ops param_ops_bool_enable_only = {
+       .set = param_set_bool_enable_only,
+       .get = param_get_bool,
+};
+#define param_check_bool_enable_only param_check_bool
+
+module_param(sig_enforce, bool_enable_only, 0644);
+#endif /* !CONFIG_MODULE_SIG_FORCE */
+#endif /* CONFIG_MODULE_SIG */
 
 /* Block module loading/unloading? */
 int modules_disabled = 0;
@@ -136,6 +175,7 @@ struct load_info {
        unsigned long symoffs, stroffs;
        struct _ddebug *debug;
        unsigned int num_debug;
+       bool sig_ok;
        struct {
                unsigned int sym, str, mod, vers, info, pcpu;
        } index;
@@ -1949,26 +1989,6 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
        return ret;
 }
 
-int __weak apply_relocate(Elf_Shdr *sechdrs,
-                         const char *strtab,
-                         unsigned int symindex,
-                         unsigned int relsec,
-                         struct module *me)
-{
-       pr_err("module %s: REL relocation unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
-int __weak apply_relocate_add(Elf_Shdr *sechdrs,
-                             const char *strtab,
-                             unsigned int symindex,
-                             unsigned int relsec,
-                             struct module *me)
-{
-       pr_err("module %s: RELA relocation unsupported\n", me->name);
-       return -ENOEXEC;
-}
-
 static int apply_relocations(struct module *mod, const struct load_info *info)
 {
        unsigned int i;
@@ -2399,7 +2419,52 @@ static inline void kmemleak_load_module(const struct module *mod,
 }
 #endif
 
-/* Sets info->hdr and info->len. */
+#ifdef CONFIG_MODULE_SIG
+static int module_sig_check(struct load_info *info,
+                           const void *mod, unsigned long *len)
+{
+       int err = -ENOKEY;
+       const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
+       const void *p = mod, *end = mod + *len;
+
+       /* Poor man's memmem. */
+       while ((p = memchr(p, MODULE_SIG_STRING[0], end - p))) {
+               if (p + markerlen > end)
+                       break;
+
+               if (memcmp(p, MODULE_SIG_STRING, markerlen) == 0) {
+                       const void *sig = p + markerlen;
+                       /* Truncate module up to signature. */
+                       *len = p - mod;
+                       err = mod_verify_sig(mod, *len, sig, end - sig);
+                       break;
+               }
+               p++;
+       }
+
+       if (!err) {
+               info->sig_ok = true;
+               return 0;
+       }
+
+       /* Not having a signature is only an error if we're strict. */
+       if (err < 0 && fips_enabled)
+               panic("Module verification failed with error %d in FIPS mode\n",
+                     err);
+       if (err == -ENOKEY && !sig_enforce)
+               err = 0;
+
+       return err;
+}
+#else /* !CONFIG_MODULE_SIG */
+static int module_sig_check(struct load_info *info,
+                           void *mod, unsigned long *len)
+{
+       return 0;
+}
+#endif /* !CONFIG_MODULE_SIG */
+
+/* Sets info->hdr, info->len and info->sig_ok. */
 static int copy_and_check(struct load_info *info,
                          const void __user *umod, unsigned long len,
                          const char __user *uargs)
@@ -2419,6 +2484,10 @@ static int copy_and_check(struct load_info *info,
                goto free_hdr;
        }
 
+       err = module_sig_check(info, hdr, &len);
+       if (err)
+               goto free_hdr;
+
        /* Sanity checks against insmoding binaries or wrong arch,
           weird elf version */
        if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0
@@ -2730,6 +2799,10 @@ static int check_module_license_and_versions(struct module *mod)
        if (strcmp(mod->name, "driverloader") == 0)
                add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 
+       /* lve claims to be GPL but upstream won't provide source */
+       if (strcmp(mod->name, "lve") == 0)
+               add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODVERSIONS
        if ((mod->num_syms && !mod->crcs)
            || (mod->num_gpl_syms && !mod->gpl_crcs)
@@ -2861,6 +2934,20 @@ static int post_relocation(struct module *mod, const struct load_info *info)
        return module_finalize(info->hdr, info->sechdrs, mod);
 }
 
+/* Is this module of this name done loading?  No locks held. */
+static bool finished_loading(const char *name)
+{
+       struct module *mod;
+       bool ret;
+
+       mutex_lock(&module_mutex);
+       mod = find_module(name);
+       ret = !mod || mod->state != MODULE_STATE_COMING;
+       mutex_unlock(&module_mutex);
+
+       return ret;
+}
+
 /* Allocate and load the module: note that size of section 0 is always
    zero, and we rely on this for optional sections. */
 static struct module *load_module(void __user *umod,
@@ -2868,7 +2955,7 @@ static struct module *load_module(void __user *umod,
                                  const char __user *uargs)
 {
        struct load_info info = { NULL, };
-       struct module *mod;
+       struct module *mod, *old;
        long err;
 
        pr_debug("load_module: umod=%p, len=%lu, uargs=%p\n",
@@ -2886,6 +2973,12 @@ static struct module *load_module(void __user *umod,
                goto free_copy;
        }
 
+#ifdef CONFIG_MODULE_SIG
+       mod->sig_ok = info.sig_ok;
+       if (!mod->sig_ok)
+               add_taint_module(mod, TAINT_FORCED_MODULE);
+#endif
+
        /* Now module is in final location, initialize linked lists, etc. */
        err = module_unload_init(mod);
        if (err)
@@ -2934,8 +3027,18 @@ static struct module *load_module(void __user *umod,
         * function to insert in a way safe to concurrent readers.
         * The mutex protects against concurrent writers.
         */
+again:
        mutex_lock(&module_mutex);
-       if (find_module(mod->name)) {
+       if ((old = find_module(mod->name)) != NULL) {
+               if (old->state == MODULE_STATE_COMING) {
+                       /* Wait in case it fails to load. */
+                       mutex_unlock(&module_mutex);
+                       err = wait_event_interruptible(module_wq,
+                                              finished_loading(mod->name));
+                       if (err)
+                               goto free_arch_cleanup;
+                       goto again;
+               }
                err = -EEXIST;
                goto unlock;
        }
@@ -2975,7 +3078,7 @@ static struct module *load_module(void __user *umod,
        /* Unlink carefully: kallsyms could be walking list. */
        list_del_rcu(&mod->list);
        module_bug_cleanup(mod);
-
+       wake_up_all(&module_wq);
  ddebug:
        dynamic_debug_remove(info.debug);
  unlock:
@@ -3050,7 +3153,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
                blocking_notifier_call_chain(&module_notify_list,
                                             MODULE_STATE_GOING, mod);
                free_module(mod);
-               wake_up(&module_wq);
+               wake_up_all(&module_wq);
                return ret;
        }
        if (ret > 0) {
@@ -3062,9 +3165,8 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
                dump_stack();
        }
 
-       /* Now it's a first class citizen!  Wake up anyone waiting for it. */
+       /* Now it's a first class citizen! */
        mod->state = MODULE_STATE_LIVE;
-       wake_up(&module_wq);
        blocking_notifier_call_chain(&module_notify_list,
                                     MODULE_STATE_LIVE, mod);
 
@@ -3087,6 +3189,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
        mod->init_ro_size = 0;
        mod->init_text_size = 0;
        mutex_unlock(&module_mutex);
+       wake_up_all(&module_wq);
 
        return 0;
 }
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
new file mode 100644 (file)
index 0000000..6b09f69
--- /dev/null
@@ -0,0 +1,243 @@
+/* Module signature checker
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/err.h>
+#include <crypto/public_key.h>
+#include <crypto/hash.h>
+#include <keys/asymmetric-type.h>
+#include "module-internal.h"
+
+/*
+ * Module signature information block.
+ *
+ * The constituents of the signature section are, in order:
+ *
+ *     - Signer's name
+ *     - Key identifier
+ *     - Signature data
+ *     - Information block
+ */
+struct module_signature {
+       enum pkey_algo          algo : 8;       /* Public-key crypto algorithm */
+       enum pkey_hash_algo     hash : 8;       /* Digest algorithm */
+       enum pkey_id_type       id_type : 8;    /* Key identifier type */
+       u8                      signer_len;     /* Length of signer's name */
+       u8                      key_id_len;     /* Length of key identifier */
+       u8                      __pad[3];
+       __be32                  sig_len;        /* Length of signature data */
+};
+
+/*
+ * Digest the module contents.
+ */
+static struct public_key_signature *mod_make_digest(enum pkey_hash_algo hash,
+                                                   const void *mod,
+                                                   unsigned long modlen)
+{
+       struct public_key_signature *pks;
+       struct crypto_shash *tfm;
+       struct shash_desc *desc;
+       size_t digest_size, desc_size;
+       int ret;
+
+       pr_devel("==>%s()\n", __func__);
+       
+       /* Allocate the hashing algorithm we're going to need and find out how
+        * big the hash operational data will be.
+        */
+       tfm = crypto_alloc_shash(pkey_hash_algo[hash], 0, 0);
+       if (IS_ERR(tfm))
+               return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm);
+
+       desc_size = crypto_shash_descsize(tfm) + sizeof(*desc);
+       digest_size = crypto_shash_digestsize(tfm);
+
+       /* We allocate the hash operational data storage on the end of our
+        * context data and the digest output buffer on the end of that.
+        */
+       ret = -ENOMEM;
+       pks = kzalloc(digest_size + sizeof(*pks) + desc_size, GFP_KERNEL);
+       if (!pks)
+               goto error_no_pks;
+
+       pks->pkey_hash_algo     = hash;
+       pks->digest             = (u8 *)pks + sizeof(*pks) + desc_size;
+       pks->digest_size        = digest_size;
+
+       desc = (void *)pks + sizeof(*pks);
+       desc->tfm   = tfm;
+       desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
+
+       ret = crypto_shash_init(desc);
+       if (ret < 0)
+               goto error;
+
+       ret = crypto_shash_finup(desc, mod, modlen, pks->digest);
+       if (ret < 0)
+               goto error;
+
+       crypto_free_shash(tfm);
+       pr_devel("<==%s() = ok\n", __func__);
+       return pks;
+
+error:
+       kfree(pks);
+error_no_pks:
+       crypto_free_shash(tfm);
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ERR_PTR(ret);
+}
+
+/*
+ * Extract an MPI array from the signature data.  This represents the actual
+ * signature.  Each raw MPI is prefaced by a BE 2-byte value indicating the
+ * size of the MPI in bytes.
+ *
+ * RSA signatures only have one MPI, so currently we only read one.
+ */
+static int mod_extract_mpi_array(struct public_key_signature *pks,
+                                const void *data, size_t len)
+{
+       size_t nbytes;
+       MPI mpi;
+
+       if (len < 3)
+               return -EBADMSG;
+       nbytes = ((const u8 *)data)[0] << 8 | ((const u8 *)data)[1];
+       data += 2;
+       len -= 2;
+       if (len != nbytes)
+               return -EBADMSG;
+
+       mpi = mpi_read_raw_data(data, nbytes);
+       if (!mpi)
+               return -ENOMEM;
+       pks->mpi[0] = mpi;
+       pks->nr_mpi = 1;
+       return 0;
+}
+
+/*
+ * Request an asymmetric key.
+ */
+static struct key *request_asymmetric_key(const char *signer, size_t signer_len,
+                                         const u8 *key_id, size_t key_id_len)
+{
+       key_ref_t key;
+       size_t i;
+       char *id, *q;
+
+       pr_devel("==>%s(,%zu,,%zu)\n", __func__, signer_len, key_id_len);
+
+       /* Construct an identifier. */
+       id = kmalloc(signer_len + 2 + key_id_len * 2 + 1, GFP_KERNEL);
+       if (!id)
+               return ERR_PTR(-ENOKEY);
+
+       memcpy(id, signer, signer_len);
+
+       q = id + signer_len;
+       *q++ = ':';
+       *q++ = ' ';
+       for (i = 0; i < key_id_len; i++) {
+               *q++ = hex_asc[*key_id >> 4];
+               *q++ = hex_asc[*key_id++ & 0x0f];
+       }
+
+       *q = 0;
+
+       pr_debug("Look up: \"%s\"\n", id);
+
+       key = keyring_search(make_key_ref(modsign_keyring, 1),
+                            &key_type_asymmetric, id);
+       if (IS_ERR(key))
+               pr_warn("Request for unknown module key '%s' err %ld\n",
+                       id, PTR_ERR(key));
+       kfree(id);
+
+       if (IS_ERR(key)) {
+               switch (PTR_ERR(key)) {
+                       /* Hide some search errors */
+               case -EACCES:
+               case -ENOTDIR:
+               case -EAGAIN:
+                       return ERR_PTR(-ENOKEY);
+               default:
+                       return ERR_CAST(key);
+               }
+       }
+
+       pr_devel("<==%s() = 0 [%x]\n", __func__, key_serial(key_ref_to_ptr(key)));
+       return key_ref_to_ptr(key);
+}
+
+/*
+ * Verify the signature on a module.
+ */
+int mod_verify_sig(const void *mod, unsigned long modlen,
+                  const void *sig, unsigned long siglen)
+{
+       struct public_key_signature *pks;
+       struct module_signature ms;
+       struct key *key;
+       size_t sig_len;
+       int ret;
+
+       pr_devel("==>%s(,%lu,,%lu,)\n", __func__, modlen, siglen);
+
+       if (siglen <= sizeof(ms))
+               return -EBADMSG;
+
+       memcpy(&ms, sig + (siglen - sizeof(ms)), sizeof(ms));
+       siglen -= sizeof(ms);
+
+       sig_len = be32_to_cpu(ms.sig_len);
+       if (sig_len >= siglen ||
+           siglen - sig_len != (size_t)ms.signer_len + ms.key_id_len)
+               return -EBADMSG;
+
+       /* For the moment, only support RSA and X.509 identifiers */
+       if (ms.algo != PKEY_ALGO_RSA ||
+           ms.id_type != PKEY_ID_X509)
+               return -ENOPKG;
+
+       if (ms.hash >= PKEY_HASH__LAST ||
+           !pkey_hash_algo[ms.hash])
+               return -ENOPKG;
+
+       key = request_asymmetric_key(sig, ms.signer_len,
+                                    sig + ms.signer_len, ms.key_id_len);
+       if (IS_ERR(key))
+               return PTR_ERR(key);
+
+       pks = mod_make_digest(ms.hash, mod, modlen);
+       if (IS_ERR(pks)) {
+               ret = PTR_ERR(pks);
+               goto error_put_key;
+       }
+
+       ret = mod_extract_mpi_array(pks, sig + ms.signer_len + ms.key_id_len,
+                                   sig_len);
+       if (ret < 0)
+               goto error_free_pks;
+
+       ret = verify_signature(key, pks);
+       pr_devel("verify_signature() = %d\n", ret);
+
+error_free_pks:
+       mpi_free(pks->rsa.s);
+       kfree(pks);
+error_put_key:
+       key_put(key);
+       pr_devel("<==%s() = %d\n", __func__, ret);
+       return ret;     
+}
index 3bef1ea94c99593d30139fdd48f38a4ddefdddf3..09aae85418ab92218f330f3bad18e8e96cb31055 100644 (file)
@@ -3,4 +3,4 @@
 #
 gen_crc32table
 crc32table.h
-
+oid_registry_data.c
index bb94c1ba616a4213bc11521adef4310387032353..4b31a46fb307bcd33bbc58d8141abfd9ad9ad220 100644 (file)
@@ -396,4 +396,9 @@ config SIGNATURE
 config LIBFDT
        bool
 
+config OID_REGISTRY
+       tristate
+       help
+         Enable fast lookup object identifier registry.
+
 endmenu
index 3128e357e28649b58ddc05bf4d0802455a10f8fc..821a16229111eba69f189ae9be683f02eeb70862 100644 (file)
@@ -145,6 +145,8 @@ obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
 
 interval_tree_test-objs := interval_tree_test_main.o interval_tree.o
 
+obj-$(CONFIG_ASN1) += asn1_decoder.o
+
 hostprogs-y    := gen_crc32table
 clean-files    := crc32table.h
 
@@ -155,3 +157,19 @@ quiet_cmd_crc32 = GEN     $@
 
 $(obj)/crc32table.h: $(obj)/gen_crc32table
        $(call cmd,crc32)
+
+#
+# Build a fast OID lookip registry from include/linux/oid_registry.h
+#
+obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
+
+$(obj)/oid_registry.c: $(obj)/oid_registry_data.c
+
+$(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
+                           $(src)/build_OID_registry
+       $(call cmd,build_OID_registry)
+
+quiet_cmd_build_OID_registry = GEN     $@
+      cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
+
+clean-files    += oid_registry_data.c
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
new file mode 100644 (file)
index 0000000..de2c8b5
--- /dev/null
@@ -0,0 +1,487 @@
+/* Decoder for ASN.1 BER/DER/CER encoded bytestream
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/asn1_decoder.h>
+#include <linux/asn1_ber_bytecode.h>
+
+static const unsigned char asn1_op_lengths[ASN1_OP__NR] = {
+       /*                                      OPC TAG JMP ACT */
+       [ASN1_OP_MATCH]                         = 1 + 1,
+       [ASN1_OP_MATCH_OR_SKIP]                 = 1 + 1,
+       [ASN1_OP_MATCH_ACT]                     = 1 + 1     + 1,
+       [ASN1_OP_MATCH_ACT_OR_SKIP]             = 1 + 1     + 1,
+       [ASN1_OP_MATCH_JUMP]                    = 1 + 1 + 1,
+       [ASN1_OP_MATCH_JUMP_OR_SKIP]            = 1 + 1 + 1,
+       [ASN1_OP_MATCH_ANY]                     = 1,
+       [ASN1_OP_MATCH_ANY_ACT]                 = 1         + 1,
+       [ASN1_OP_COND_MATCH_OR_SKIP]            = 1 + 1,
+       [ASN1_OP_COND_MATCH_ACT_OR_SKIP]        = 1 + 1     + 1,
+       [ASN1_OP_COND_MATCH_JUMP_OR_SKIP]       = 1 + 1 + 1,
+       [ASN1_OP_COND_MATCH_ANY]                = 1,
+       [ASN1_OP_COND_MATCH_ANY_ACT]            = 1         + 1,
+       [ASN1_OP_COND_FAIL]                     = 1,
+       [ASN1_OP_COMPLETE]                      = 1,
+       [ASN1_OP_ACT]                           = 1         + 1,
+       [ASN1_OP_RETURN]                        = 1,
+       [ASN1_OP_END_SEQ]                       = 1,
+       [ASN1_OP_END_SEQ_OF]                    = 1     + 1,
+       [ASN1_OP_END_SET]                       = 1,
+       [ASN1_OP_END_SET_OF]                    = 1     + 1,
+       [ASN1_OP_END_SEQ_ACT]                   = 1         + 1,
+       [ASN1_OP_END_SEQ_OF_ACT]                = 1     + 1 + 1,
+       [ASN1_OP_END_SET_ACT]                   = 1         + 1,
+       [ASN1_OP_END_SET_OF_ACT]                = 1     + 1 + 1,
+};
+
+/*
+ * Find the length of an indefinite length object
+ * @data: The data buffer
+ * @datalen: The end of the innermost containing element in the buffer
+ * @_dp: The data parse cursor (updated before returning)
+ * @_len: Where to return the size of the element.
+ * @_errmsg: Where to return a pointer to an error message on error
+ */
+static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen,
+                                      size_t *_dp, size_t *_len,
+                                      const char **_errmsg)
+{
+       unsigned char tag, tmp;
+       size_t dp = *_dp, len, n;
+       int indef_level = 1;
+
+next_tag:
+       if (unlikely(datalen - dp < 2)) {
+               if (datalen == dp)
+                       goto missing_eoc;
+               goto data_overrun_error;
+       }
+
+       /* Extract a tag from the data */
+       tag = data[dp++];
+       if (tag == 0) {
+               /* It appears to be an EOC. */
+               if (data[dp++] != 0)
+                       goto invalid_eoc;
+               if (--indef_level <= 0) {
+                       *_len = dp - *_dp;
+                       *_dp = dp;
+                       return 0;
+               }
+               goto next_tag;
+       }
+
+       if (unlikely((tag & 0x1f) == 0x1f)) {
+               do {
+                       if (unlikely(datalen - dp < 2))
+                               goto data_overrun_error;
+                       tmp = data[dp++];
+               } while (tmp & 0x80);
+       }
+
+       /* Extract the length */
+       len = data[dp++];
+       if (len < 0x7f) {
+               dp += len;
+               goto next_tag;
+       }
+
+       if (unlikely(len == 0x80)) {
+               /* Indefinite length */
+               if (unlikely((tag & ASN1_CONS_BIT) == ASN1_PRIM << 5))
+                       goto indefinite_len_primitive;
+               indef_level++;
+               goto next_tag;
+       }
+
+       n = len - 0x80;
+       if (unlikely(n > sizeof(size_t) - 1))
+               goto length_too_long;
+       if (unlikely(n > datalen - dp))
+               goto data_overrun_error;
+       for (len = 0; n > 0; n--) {
+               len <<= 8;
+               len |= data[dp++];
+       }
+       dp += len;
+       goto next_tag;
+
+length_too_long:
+       *_errmsg = "Unsupported length";
+       goto error;
+indefinite_len_primitive:
+       *_errmsg = "Indefinite len primitive not permitted";
+       goto error;
+invalid_eoc:
+       *_errmsg = "Invalid length EOC";
+       goto error;
+data_overrun_error:
+       *_errmsg = "Data overrun error";
+       goto error;
+missing_eoc:
+       *_errmsg = "Missing EOC in indefinite len cons";
+error:
+       *_dp = dp;
+       return -1;
+}
+
+/**
+ * asn1_ber_decoder - Decoder BER/DER/CER ASN.1 according to pattern
+ * @decoder: The decoder definition (produced by asn1_compiler)
+ * @context: The caller's context (to be passed to the action functions)
+ * @data: The encoded data
+ * @datasize: The size of the encoded data
+ *
+ * Decode BER/DER/CER encoded ASN.1 data according to a bytecode pattern
+ * produced by asn1_compiler.  Action functions are called on marked tags to
+ * allow the caller to retrieve significant data.
+ *
+ * LIMITATIONS:
+ *
+ * To keep down the amount of stack used by this function, the following limits
+ * have been imposed:
+ *
+ *  (1) This won't handle datalen > 65535 without increasing the size of the
+ *     cons stack elements and length_too_long checking.
+ *
+ *  (2) The stack of constructed types is 10 deep.  If the depth of non-leaf
+ *     constructed types exceeds this, the decode will fail.
+ *
+ *  (3) The SET type (not the SET OF type) isn't really supported as tracking
+ *     what members of the set have been seen is a pain.
+ */
+int asn1_ber_decoder(const struct asn1_decoder *decoder,
+                    void *context,
+                    const unsigned char *data,
+                    size_t datalen)
+{
+       const unsigned char *machine = decoder->machine;
+       const asn1_action_t *actions = decoder->actions;
+       size_t machlen = decoder->machlen;
+       enum asn1_opcode op;
+       unsigned char tag = 0, csp = 0, jsp = 0, optag = 0, hdr = 0;
+       const char *errmsg;
+       size_t pc = 0, dp = 0, tdp = 0, len = 0;
+       int ret;
+
+       unsigned char flags = 0;
+#define FLAG_INDEFINITE_LENGTH 0x01
+#define FLAG_MATCHED           0x02
+#define FLAG_CONS              0x20 /* Corresponds to CONS bit in the opcode tag
+                                     * - ie. whether or not we are going to parse
+                                     *   a compound type.
+                                     */
+
+#define NR_CONS_STACK 10
+       unsigned short cons_dp_stack[NR_CONS_STACK];
+       unsigned short cons_datalen_stack[NR_CONS_STACK];
+       unsigned char cons_hdrlen_stack[NR_CONS_STACK];
+#define NR_JUMP_STACK 10
+       unsigned char jump_stack[NR_JUMP_STACK];
+
+       if (datalen > 65535)
+               return -EMSGSIZE;
+
+next_op:
+       pr_debug("next_op: pc=\e[32m%zu\e[m/%zu dp=\e[33m%zu\e[m/%zu C=%d J=%d\n",
+                pc, machlen, dp, datalen, csp, jsp);
+       if (unlikely(pc >= machlen))
+               goto machine_overrun_error;
+       op = machine[pc];
+       if (unlikely(pc + asn1_op_lengths[op] > machlen))
+               goto machine_overrun_error;
+
+       /* If this command is meant to match a tag, then do that before
+        * evaluating the command.
+        */
+       if (op <= ASN1_OP__MATCHES_TAG) {
+               unsigned char tmp;
+
+               /* Skip conditional matches if possible */
+               if ((op & ASN1_OP_MATCH__COND &&
+                    flags & FLAG_MATCHED) ||
+                   dp == datalen) {
+                       pc += asn1_op_lengths[op];
+                       goto next_op;
+               }
+
+               flags = 0;
+               hdr = 2;
+
+               /* Extract a tag from the data */
+               if (unlikely(dp >= datalen - 1))
+                       goto data_overrun_error;
+               tag = data[dp++];
+               if (unlikely((tag & 0x1f) == 0x1f))
+                       goto long_tag_not_supported;
+
+               if (op & ASN1_OP_MATCH__ANY) {
+                       pr_debug("- any %02x\n", tag);
+               } else {
+                       /* Extract the tag from the machine
+                        * - Either CONS or PRIM are permitted in the data if
+                        *   CONS is not set in the op stream, otherwise CONS
+                        *   is mandatory.
+                        */
+                       optag = machine[pc + 1];
+                       flags |= optag & FLAG_CONS;
+
+                       /* Determine whether the tag matched */
+                       tmp = optag ^ tag;
+                       tmp &= ~(optag & ASN1_CONS_BIT);
+                       pr_debug("- match? %02x %02x %02x\n", tag, optag, tmp);
+                       if (tmp != 0) {
+                               /* All odd-numbered tags are MATCH_OR_SKIP. */
+                               if (op & ASN1_OP_MATCH__SKIP) {
+                                       pc += asn1_op_lengths[op];
+                                       dp--;
+                                       goto next_op;
+                               }
+                               goto tag_mismatch;
+                       }
+               }
+               flags |= FLAG_MATCHED;
+
+               len = data[dp++];
+               if (len > 0x7f) {
+                       if (unlikely(len == 0x80)) {
+                               /* Indefinite length */
+                               if (unlikely(!(tag & ASN1_CONS_BIT)))
+                                       goto indefinite_len_primitive;
+                               flags |= FLAG_INDEFINITE_LENGTH;
+                               if (unlikely(2 > datalen - dp))
+                                       goto data_overrun_error;
+                       } else {
+                               int n = len - 0x80;
+                               if (unlikely(n > 2))
+                                       goto length_too_long;
+                               if (unlikely(dp >= datalen - n))
+                                       goto data_overrun_error;
+                               hdr += n;
+                               for (len = 0; n > 0; n--) {
+                                       len <<= 8;
+                                       len |= data[dp++];
+                               }
+                               if (unlikely(len > datalen - dp))
+                                       goto data_overrun_error;
+                       }
+               }
+
+               if (flags & FLAG_CONS) {
+                       /* For expected compound forms, we stack the positions
+                        * of the start and end of the data.
+                        */
+                       if (unlikely(csp >= NR_CONS_STACK))
+                               goto cons_stack_overflow;
+                       cons_dp_stack[csp] = dp;
+                       cons_hdrlen_stack[csp] = hdr;
+                       if (!(flags & FLAG_INDEFINITE_LENGTH)) {
+                               cons_datalen_stack[csp] = datalen;
+                               datalen = dp + len;
+                       } else {
+                               cons_datalen_stack[csp] = 0;
+                       }
+                       csp++;
+               }
+
+               pr_debug("- TAG: %02x %zu%s\n",
+                        tag, len, flags & FLAG_CONS ? " CONS" : "");
+               tdp = dp;
+       }
+
+       /* Decide how to handle the operation */
+       switch (op) {
+       case ASN1_OP_MATCH_ANY_ACT:
+       case ASN1_OP_COND_MATCH_ANY_ACT:
+               ret = actions[machine[pc + 1]](context, hdr, tag, data + dp, len);
+               if (ret < 0)
+                       return ret;
+               goto skip_data;
+
+       case ASN1_OP_MATCH_ACT:
+       case ASN1_OP_MATCH_ACT_OR_SKIP:
+       case ASN1_OP_COND_MATCH_ACT_OR_SKIP:
+               ret = actions[machine[pc + 2]](context, hdr, tag, data + dp, len);
+               if (ret < 0)
+                       return ret;
+               goto skip_data;
+
+       case ASN1_OP_MATCH:
+       case ASN1_OP_MATCH_OR_SKIP:
+       case ASN1_OP_MATCH_ANY:
+       case ASN1_OP_COND_MATCH_OR_SKIP:
+       case ASN1_OP_COND_MATCH_ANY:
+       skip_data:
+               if (!(flags & FLAG_CONS)) {
+                       if (flags & FLAG_INDEFINITE_LENGTH) {
+                               ret = asn1_find_indefinite_length(
+                                       data, datalen, &dp, &len, &errmsg);
+                               if (ret < 0)
+                                       goto error;
+                       } else {
+                               dp += len;
+                       }
+                       pr_debug("- LEAF: %zu\n", len);
+               }
+               pc += asn1_op_lengths[op];
+               goto next_op;
+
+       case ASN1_OP_MATCH_JUMP:
+       case ASN1_OP_MATCH_JUMP_OR_SKIP:
+       case ASN1_OP_COND_MATCH_JUMP_OR_SKIP:
+               pr_debug("- MATCH_JUMP\n");
+               if (unlikely(jsp == NR_JUMP_STACK))
+                       goto jump_stack_overflow;
+               jump_stack[jsp++] = pc + asn1_op_lengths[op];
+               pc = machine[pc + 2];
+               goto next_op;
+
+       case ASN1_OP_COND_FAIL:
+               if (unlikely(!(flags & FLAG_MATCHED)))
+                       goto tag_mismatch;
+               pc += asn1_op_lengths[op];
+               goto next_op;
+
+       case ASN1_OP_COMPLETE:
+               if (unlikely(jsp != 0 || csp != 0)) {
+                       pr_err("ASN.1 decoder error: Stacks not empty at completion (%u, %u)\n",
+                              jsp, csp);
+                       return -EBADMSG;
+               }
+               return 0;
+
+       case ASN1_OP_END_SET:
+       case ASN1_OP_END_SET_ACT:
+               if (unlikely(!(flags & FLAG_MATCHED)))
+                       goto tag_mismatch;
+       case ASN1_OP_END_SEQ:
+       case ASN1_OP_END_SET_OF:
+       case ASN1_OP_END_SEQ_OF:
+       case ASN1_OP_END_SEQ_ACT:
+       case ASN1_OP_END_SET_OF_ACT:
+       case ASN1_OP_END_SEQ_OF_ACT:
+               if (unlikely(csp <= 0))
+                       goto cons_stack_underflow;
+               csp--;
+               tdp = cons_dp_stack[csp];
+               hdr = cons_hdrlen_stack[csp];
+               len = datalen;
+               datalen = cons_datalen_stack[csp];
+               pr_debug("- end cons t=%zu dp=%zu l=%zu/%zu\n",
+                        tdp, dp, len, datalen);
+               if (datalen == 0) {
+                       /* Indefinite length - check for the EOC. */
+                       datalen = len;
+                       if (unlikely(datalen - dp < 2))
+                               goto data_overrun_error;
+                       if (data[dp++] != 0) {
+                               if (op & ASN1_OP_END__OF) {
+                                       dp--;
+                                       csp++;
+                                       pc = machine[pc + 1];
+                                       pr_debug("- continue\n");
+                                       goto next_op;
+                               }
+                               goto missing_eoc;
+                       }
+                       if (data[dp++] != 0)
+                               goto invalid_eoc;
+                       len = dp - tdp - 2;
+               } else {
+                       if (dp < len && (op & ASN1_OP_END__OF)) {
+                               datalen = len;
+                               csp++;
+                               pc = machine[pc + 1];
+                               pr_debug("- continue\n");
+                               goto next_op;
+                       }
+                       if (dp != len)
+                               goto cons_length_error;
+                       len -= tdp;
+                       pr_debug("- cons len l=%zu d=%zu\n", len, dp - tdp);
+               }
+
+               if (op & ASN1_OP_END__ACT) {
+                       unsigned char act;
+                       if (op & ASN1_OP_END__OF)
+                               act = machine[pc + 2];
+                       else
+                               act = machine[pc + 1];
+                       ret = actions[act](context, hdr, 0, data + tdp, len);
+               }
+               pc += asn1_op_lengths[op];
+               goto next_op;
+
+       case ASN1_OP_ACT:
+               ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len);
+               pc += asn1_op_lengths[op];
+               goto next_op;
+
+       case ASN1_OP_RETURN:
+               if (unlikely(jsp <= 0))
+                       goto jump_stack_underflow;
+               pc = jump_stack[--jsp];
+               goto next_op;
+
+       default:
+               break;
+       }
+
+       /* Shouldn't reach here */
+       pr_err("ASN.1 decoder error: Found reserved opcode (%u)\n", op);
+       return -EBADMSG;
+
+data_overrun_error:
+       errmsg = "Data overrun error";
+       goto error;
+machine_overrun_error:
+       errmsg = "Machine overrun error";
+       goto error;
+jump_stack_underflow:
+       errmsg = "Jump stack underflow";
+       goto error;
+jump_stack_overflow:
+       errmsg = "Jump stack overflow";
+       goto error;
+cons_stack_underflow:
+       errmsg = "Cons stack underflow";
+       goto error;
+cons_stack_overflow:
+       errmsg = "Cons stack overflow";
+       goto error;
+cons_length_error:
+       errmsg = "Cons length error";
+       goto error;
+missing_eoc:
+       errmsg = "Missing EOC in indefinite len cons";
+       goto error;
+invalid_eoc:
+       errmsg = "Invalid length EOC";
+       goto error;
+length_too_long:
+       errmsg = "Unsupported length";
+       goto error;
+indefinite_len_primitive:
+       errmsg = "Indefinite len primitive not permitted";
+       goto error;
+tag_mismatch:
+       errmsg = "Unexpected tag";
+       goto error;
+long_tag_not_supported:
+       errmsg = "Long tag not supported";
+error:
+       pr_debug("\nASN1: %s [m=%zu d=%zu ot=%02x t=%02x l=%zu]\n",
+                errmsg, pc, dp, optag, tag, len);
+       return -EBADMSG;
+}
+EXPORT_SYMBOL_GPL(asn1_ber_decoder);
diff --git a/lib/build_OID_registry b/lib/build_OID_registry
new file mode 100755 (executable)
index 0000000..dfbdaab
--- /dev/null
@@ -0,0 +1,209 @@
+#!/usr/bin/perl -w
+#
+# Build a static ASN.1 Object Identified (OID) registry
+#
+# Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+# Written by David Howells (dhowells@redhat.com)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public Licence
+# as published by the Free Software Foundation; either version
+# 2 of the Licence, or (at your option) any later version.
+#
+
+use strict;
+
+my @names = ();
+my @oids = ();
+
+if ($#ARGV != 1) {
+    print STDERR "Format: ", $0, " <in-h-file> <out-c-file>\n";
+    exit(2);
+}
+
+#
+# Open the file to read from
+#
+open IN_FILE, "<$ARGV[0]" || die;
+while (<IN_FILE>) {
+    chomp;
+    if (m!\s+OID_([a-zA-z][a-zA-Z0-9_]+),\s+/[*]\s+([012][.0-9]*)\s+[*]/!) {
+       push @names, $1;
+       push @oids, $2;
+    }
+}
+close IN_FILE || die;
+
+#
+# Open the files to write into
+#
+open C_FILE, ">$ARGV[1]" or die;
+print C_FILE "/*\n";
+print C_FILE " * Automatically generated by ", $0, ".  Do not edit\n";
+print C_FILE " */\n";
+
+#
+# Split the data up into separate lists and also determine the lengths of the
+# encoded data arrays.
+#
+my @indices = ();
+my @lengths = ();
+my $total_length = 0;
+
+print "Compiling ", $#names + 1, " OIDs\n";
+
+for (my $i = 0; $i <= $#names; $i++) {
+    my $name = $names[$i];
+    my $oid = $oids[$i];
+
+    my @components = split(/[.]/, $oid);
+
+    # Determine the encoded length of this OID
+    my $size = $#components;
+    for (my $loop = 2; $loop <= $#components; $loop++) {
+       my $c = $components[$loop];
+
+       # We will base128 encode the number
+       my $tmp = ($c == 0) ? 0 : int(log($c)/log(2));
+       $tmp = int($tmp / 7);
+       $size += $tmp;
+    }
+    push @lengths, $size;
+    push @indices, $total_length;
+    $total_length += $size;
+}
+
+#
+# Emit the look-up-by-OID index table
+#
+print C_FILE "\n";
+if ($total_length <= 255) {
+    print C_FILE "static const unsigned char oid_index[OID__NR + 1] = {\n";
+} else {
+    print C_FILE "static const unsigned short oid_index[OID__NR + 1] = {\n";
+}
+for (my $i = 0; $i <= $#names; $i++) {
+    print C_FILE "\t[OID_", $names[$i], "] = ", $indices[$i], ",\n"
+}
+print C_FILE "\t[OID__NR] = ", $total_length, "\n";
+print C_FILE "};\n";
+
+#
+# Encode the OIDs
+#
+my @encoded_oids = ();
+
+for (my $i = 0; $i <= $#names; $i++) {
+    my @octets = ();
+
+    my @components = split(/[.]/, $oids[$i]);
+
+    push @octets, $components[0] * 40 + $components[1];
+
+    for (my $loop = 2; $loop <= $#components; $loop++) {
+       my $c = $components[$loop];
+
+       # Base128 encode the number
+       my $tmp = ($c == 0) ? 0 : int(log($c)/log(2));
+       $tmp = int($tmp / 7);
+
+       for (; $tmp > 0; $tmp--) {
+           push @octets, (($c >> $tmp * 7) & 0x7f) | 0x80;
+       }
+       push @octets, $c & 0x7f;
+    }
+
+    push @encoded_oids, \@octets;
+}
+
+#
+# Create a hash value for each OID
+#
+my @hash_values = ();
+for (my $i = 0; $i <= $#names; $i++) {
+    my @octets = @{$encoded_oids[$i]};
+
+    my $hash = $#octets;
+    foreach (@octets) {
+       $hash += $_ * 33;
+    }
+
+    $hash = ($hash >> 24) ^ ($hash >> 16) ^ ($hash >> 8) ^ ($hash);
+
+    push @hash_values, $hash & 0xff;
+}
+
+#
+# Emit the OID data
+#
+print C_FILE "\n";
+print C_FILE "static const unsigned char oid_data[", $total_length, "] = {\n";
+for (my $i = 0; $i <= $#names; $i++) {
+    my @octets = @{$encoded_oids[$i]};
+    print C_FILE "\t";
+    print C_FILE $_, ", " foreach (@octets);
+    print C_FILE "\t// ", $names[$i];
+    print C_FILE "\n";
+}
+print C_FILE "};\n";
+
+#
+# Build the search index table (ordered by length then hash then content)
+#
+my @index_table = ( 0 .. $#names );
+
+@index_table = sort {
+    my @octets_a = @{$encoded_oids[$a]};
+    my @octets_b = @{$encoded_oids[$b]};
+
+    return $hash_values[$a] <=> $hash_values[$b]
+       if ($hash_values[$a] != $hash_values[$b]);
+    return $#octets_a <=> $#octets_b
+       if ($#octets_a != $#octets_b);
+    for (my $i = $#octets_a; $i >= 0; $i--) {
+       return $octets_a[$i] <=> $octets_b[$i]
+           if ($octets_a[$i] != $octets_b[$i]);
+    }
+    return 0;
+
+} @index_table;
+
+#
+# Emit the search index and hash value table
+#
+print C_FILE "\n";
+print C_FILE "static const struct {\n";
+print C_FILE "\tunsigned char hash;\n";
+if ($#names <= 255) {
+    print C_FILE "\tenum OID oid : 8;\n";
+} else {
+    print C_FILE "\tenum OID oid : 16;\n";
+}
+print C_FILE "} oid_search_table[OID__NR] = {\n";
+for (my $i = 0; $i <= $#names; $i++) {
+    my @octets = @{$encoded_oids[$index_table[$i]]};
+    printf(C_FILE "\t[%3u] = { %3u, OID_%-35s }, // ",
+          $i,
+          $hash_values[$index_table[$i]],
+          $names[$index_table[$i]]);
+    printf C_FILE "%02x", $_ foreach (@octets);
+    print C_FILE "\n";
+}
+print C_FILE "};\n";
+
+#
+# Emit the OID debugging name table
+#
+#print C_FILE "\n";
+#print C_FILE "const char *const oid_name_table[OID__NR + 1] = {\n";
+#
+#for (my $i = 0; $i <= $#names; $i++) {
+#    print C_FILE "\t\"", $names[$i], "\",\n"
+#}
+#print C_FILE "\t\"Unknown-OID\"\n";
+#print C_FILE "};\n";
+
+#
+# Polish off
+#
+close C_FILE or die;
index 45ca90a8639c5284bbe56d76c19ab743abf8c1fa..019a68c9014427e9e7e3394062dcbe76003fa760 100644 (file)
@@ -14,6 +14,7 @@ mpi-y = \
        generic_mpih-add1.o             \
        mpicoder.o                      \
        mpi-bit.o                       \
+       mpi-cmp.o                       \
        mpih-cmp.o                      \
        mpih-div.o                      \
        mpih-mul.o                      \
index 29f98624ef93a706b4fa302972669c83f70bd49d..678ce4f1e124b4be4c255f297cef1e29477e7ce0 100644 (file)
@@ -19,6 +19,8 @@
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  * MA 02111-1307, USA. */
 
+#include <asm-generic/bitops/count_zeros.h>
+
 /* You have to define the following before including this file:
  *
  * UWtype -- An unsigned type, default type for operations (typically a "word")
@@ -146,12 +148,6 @@ do { \
        : "1" ((USItype)(n1)), \
                "r" ((USItype)(n0)), \
                "r" ((USItype)(d)))
-
-#define count_leading_zeros(count, x) \
-       __asm__ ("clz %0,%1" \
-       : "=r" ((USItype)(count)) \
-       : "r" ((USItype)(x)))
-#define COUNT_LEADING_ZEROS_0 32
 #endif /* __a29k__ */
 
 #if defined(__alpha) && W_TYPE_SIZE == 64
@@ -298,11 +294,6 @@ extern UDItype __udiv_qrnnd();
        : "1" ((USItype)(nh)), \
                "0" ((USItype)(nl)), \
                "g" ((USItype)(d)))
-#define count_leading_zeros(count, x) \
-       __asm__ ("bsch/1 %1,%0" \
-       : "=g" (count) \
-       : "g" ((USItype)(x)), \
-            "0" ((USItype)0))
 #endif
 
 /***************************************
@@ -354,27 +345,6 @@ do { USItype __r; \
 } while (0)
 extern USItype __udiv_qrnnd();
 #endif /* LONGLONG_STANDALONE */
-#define count_leading_zeros(count, x) \
-do { \
-       USItype __tmp; \
-       __asm__ ( \
-       "ldi             1,%0\n" \
-       "extru,=        %1,15,16,%%r0  ; Bits 31..16 zero?\n" \
-       "extru,tr       %1,15,16,%1    ; No.  Shift down, skip add.\n" \
-       "ldo            16(%0),%0      ; Yes.   Perform add.\n" \
-       "extru,=        %1,23,8,%%r0   ; Bits 15..8 zero?\n" \
-       "extru,tr       %1,23,8,%1     ; No.  Shift down, skip add.\n" \
-       "ldo            8(%0),%0       ; Yes.   Perform add.\n" \
-       "extru,=        %1,27,4,%%r0   ; Bits 7..4 zero?\n" \
-       "extru,tr       %1,27,4,%1     ; No.  Shift down, skip add.\n" \
-       "ldo            4(%0),%0       ; Yes.   Perform add.\n" \
-       "extru,=        %1,29,2,%%r0   ; Bits 3..2 zero?\n" \
-       "extru,tr       %1,29,2,%1     ; No.  Shift down, skip add.\n" \
-       "ldo            2(%0),%0       ; Yes.   Perform add.\n" \
-       "extru          %1,30,1,%1     ; Extract bit 1.\n" \
-       "sub            %0,%1,%0       ; Subtract it.              " \
-       : "=r" (count), "=r" (__tmp) : "1" (x)); \
-} while (0)
 #endif /* hppa */
 
 /***************************************
@@ -457,15 +427,6 @@ do { \
        : "0" ((USItype)(n0)), \
             "1" ((USItype)(n1)), \
             "rm" ((USItype)(d)))
-#define count_leading_zeros(count, x) \
-do { \
-       USItype __cbtmp; \
-       __asm__ ("bsrl %1,%0" \
-       : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
-       (count) = __cbtmp ^ 31; \
-} while (0)
-#define count_trailing_zeros(count, x) \
-       __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
 #ifndef UMUL_TIME
 #define UMUL_TIME 40
 #endif
@@ -536,15 +497,6 @@ do { \
             "dI" ((USItype)(d))); \
        (r) = __rq.__i.__l; (q) = __rq.__i.__h; \
 } while (0)
-#define count_leading_zeros(count, x) \
-do { \
-       USItype __cbtmp; \
-       __asm__ ("scanbit %1,%0" \
-       : "=r" (__cbtmp) \
-       : "r" ((USItype)(x))); \
-       (count) = __cbtmp ^ 31; \
-} while (0)
-#define COUNT_LEADING_ZEROS_0 (-32)    /* sic */
 #if defined(__i960mx)          /* what is the proper symbol to test??? */
 #define rshift_rhlc(r, h, l, c) \
 do { \
@@ -603,11 +555,6 @@ do { \
        : "0" ((USItype)(n0)), \
             "1" ((USItype)(n1)), \
             "dmi" ((USItype)(d)))
-#define count_leading_zeros(count, x) \
-       __asm__ ("bfffo %1{%b2:%b2},%0" \
-       : "=d" ((USItype)(count)) \
-       : "od" ((USItype)(x)), "n" (0))
-#define COUNT_LEADING_ZEROS_0 32
 #else /* not mc68020 */
 #define umul_ppmm(xh, xl, a, b) \
 do { USItype __umul_tmp1, __umul_tmp2; \
@@ -664,15 +611,6 @@ do { USItype __umul_tmp1, __umul_tmp2; \
             "rJ" ((USItype)(bh)), \
             "rJ" ((USItype)(al)), \
             "rJ" ((USItype)(bl)))
-#define count_leading_zeros(count, x) \
-do { \
-       USItype __cbtmp; \
-       __asm__ ("ff1 %0,%1" \
-       : "=r" (__cbtmp) \
-       : "r" ((USItype)(x))); \
-       (count) = __cbtmp ^ 31; \
-} while (0)
-#define COUNT_LEADING_ZEROS_0 63       /* sic */
 #if defined(__m88110__)
 #define umul_ppmm(wh, wl, u, v) \
 do { \
@@ -779,12 +717,6 @@ do { \
        : "0" (__xx.__ll), \
             "g" ((USItype)(d))); \
        (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
-#define count_trailing_zeros(count, x) \
-do { \
-       __asm__("ffsd      %2,%0" \
-       : "=r"((USItype) (count)) \
-       : "0"((USItype) 0), "r"((USItype) (x))); \
-       } while (0)
 #endif /* __ns32000__ */
 
 /***************************************
@@ -855,11 +787,6 @@ do { \
                "rI" ((USItype)(al)), \
                "r" ((USItype)(bl))); \
 } while (0)
-#define count_leading_zeros(count, x) \
-       __asm__ ("{cntlz|cntlzw} %0,%1" \
-       : "=r" ((USItype)(count)) \
-       : "r" ((USItype)(x)))
-#define COUNT_LEADING_ZEROS_0 32
 #if defined(_ARCH_PPC)
 #define umul_ppmm(ph, pl, m0, m1) \
 do { \
@@ -1001,19 +928,6 @@ do { \
 } while (0)
 #define UMUL_TIME 20
 #define UDIV_TIME 200
-#define count_leading_zeros(count, x) \
-do { \
-       if ((x) >= 0x10000) \
-               __asm__ ("clz     %0,%1" \
-               : "=r" ((USItype)(count)) \
-               : "r" ((USItype)(x) >> 16)); \
-       else { \
-               __asm__ ("clz   %0,%1" \
-               : "=r" ((USItype)(count)) \
-               : "r" ((USItype)(x))); \
-               (count) += 16; \
-       } \
-} while (0)
 #endif /* RT/ROMP */
 
 /***************************************
@@ -1142,13 +1056,6 @@ do { \
        "rI" ((USItype)(d)) \
        : "%g1" __AND_CLOBBER_CC)
 #define UDIV_TIME 37
-#define count_leading_zeros(count, x) \
-       __asm__ ("scan %1,0,%0" \
-       : "=r" ((USItype)(x)) \
-       : "r" ((USItype)(count)))
-/* Early sparclites return 63 for an argument of 0, but they warn that future
-       implementations might change this.  Therefore, leave COUNT_LEADING_ZEROS_0
-       undefined.  */
 #endif /* __sparclite__ */
 #endif /* __sparc_v8__ */
        /* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd.  */
@@ -1454,47 +1361,6 @@ do { \
 #define udiv_qrnnd __udiv_qrnnd_c
 #endif
 
-#undef count_leading_zeros
-#if !defined(count_leading_zeros)
-       extern
-#ifdef __STDC__
-                       const
-#endif
-                       unsigned char __clz_tab[];
-#define count_leading_zeros(count, x) \
-do { \
-       UWtype __xr = (x); \
-       UWtype __a; \
-       \
-       if (W_TYPE_SIZE <= 32) { \
-               __a = __xr < ((UWtype) 1 << 2*__BITS4) \
-               ? (__xr < ((UWtype) 1 << __BITS4) ? 0 : __BITS4) \
-               : (__xr < ((UWtype) 1 << 3*__BITS4) ?  2*__BITS4 : 3*__BITS4); \
-       } \
-       else { \
-               for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
-                       if (((__xr >> __a) & 0xff) != 0) \
-                               break; \
-       } \
-       \
-       (count) = W_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
-} while (0)
-       /* This version gives a well-defined value for zero. */
-#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
-#endif
-
-#if !defined(count_trailing_zeros)
-/* Define count_trailing_zeros using count_leading_zeros.  The latter might be
-       defined in asm, but if it is not, the C version above is good enough.  */
-#define count_trailing_zeros(count, x) \
-do { \
-       UWtype __ctz_x = (x); \
-       UWtype __ctz_c; \
-       count_leading_zeros(__ctz_c, __ctz_x & -__ctz_x); \
-       (count) = W_TYPE_SIZE - 1 - __ctz_c; \
-} while (0)
-#endif
-
 #ifndef UDIV_NEEDS_NORMALIZATION
 #define UDIV_NEEDS_NORMALIZATION 0
 #endif
index 568724804f291a8581444baa7f18b4e71447bca4..503537e084369ca54ca56b27a8b939597c0cbf05 100644 (file)
@@ -45,7 +45,7 @@ unsigned mpi_get_nbits(MPI a)
        if (a->nlimbs) {
                mpi_limb_t alimb = a->d[a->nlimbs - 1];
                if (alimb)
-                       count_leading_zeros(n, alimb);
+                       n = count_leading_zeros(alimb);
                else
                        n = BITS_PER_MPI_LIMB;
                n = BITS_PER_MPI_LIMB - n + (a->nlimbs - 1) * BITS_PER_MPI_LIMB;
diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c
new file mode 100644 (file)
index 0000000..1871e7b
--- /dev/null
@@ -0,0 +1,70 @@
+/* mpi-cmp.c  -  MPI functions
+ * Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include "mpi-internal.h"
+
+int mpi_cmp_ui(MPI u, unsigned long v)
+{
+       mpi_limb_t limb = v;
+
+       mpi_normalize(u);
+       if (!u->nlimbs && !limb)
+               return 0;
+       if (u->sign)
+               return -1;
+       if (u->nlimbs > 1)
+               return 1;
+
+       if (u->d[0] == limb)
+               return 0;
+       else if (u->d[0] > limb)
+               return 1;
+       else
+               return -1;
+}
+EXPORT_SYMBOL_GPL(mpi_cmp_ui);
+
+int mpi_cmp(MPI u, MPI v)
+{
+       mpi_size_t usize, vsize;
+       int cmp;
+
+       mpi_normalize(u);
+       mpi_normalize(v);
+       usize = u->nlimbs;
+       vsize = v->nlimbs;
+       if (!u->sign && v->sign)
+               return 1;
+       if (u->sign && !v->sign)
+               return -1;
+       if (usize != vsize && !u->sign && !v->sign)
+               return usize - vsize;
+       if (usize != vsize && u->sign && v->sign)
+               return vsize + usize;
+       if (!usize)
+               return 0;
+       cmp = mpihelp_cmp(u->d, v->d, usize);
+       if (!cmp)
+               return 0;
+       if ((cmp < 0 ? 1 : 0) == (u->sign ? 1 : 0))
+               return 1;
+       return -1;
+}
+EXPORT_SYMBOL_GPL(mpi_cmp);
index 67f3e79af9140e0160a4264b506b41344304e916..5464c8744ea95647beeef44efc3722161f5b224b 100644 (file)
@@ -77,7 +77,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
        mp = mp_marker = mpi_alloc_limb_space(msize);
        if (!mp)
                goto enomem;
-       count_leading_zeros(mod_shift_cnt, mod->d[msize - 1]);
+       mod_shift_cnt = count_leading_zeros(mod->d[msize - 1]);
        if (mod_shift_cnt)
                mpihelp_lshift(mp, mod->d, msize, mod_shift_cnt);
        else
@@ -169,7 +169,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
 
                i = esize - 1;
                e = ep[i];
-               count_leading_zeros(c, e);
+               c = count_leading_zeros(e);
                e = (e << c) << 1;      /* shift the exp bits to the left, lose msb */
                c = BITS_PER_MPI_LIMB - 1 - c;
 
index f0fa659958002ca824d47144e6ecba3fdcdc7e38..3962b7f7fe3f08ec4b639e328ddc6dcf4baa05fd 100644 (file)
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#include <linux/bitops.h>
+#include <asm-generic/bitops/count_zeros.h>
 #include "mpi-internal.h"
 
 #define MAX_EXTERN_MPI_BITS 16384
 
+/**
+ * mpi_read_raw_data - Read a raw byte stream as a positive integer
+ * @xbuffer: The data to read
+ * @nbytes: The amount of data to read
+ */
+MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
+{
+       const uint8_t *buffer = xbuffer;
+       int i, j;
+       unsigned nbits, nlimbs;
+       mpi_limb_t a;
+       MPI val = NULL;
+
+       while (nbytes >= 0 && buffer[0] == 0) {
+               buffer++;
+               nbytes--;
+       }
+
+       nbits = nbytes * 8;
+       if (nbits > MAX_EXTERN_MPI_BITS) {
+               pr_info("MPI: mpi too large (%u bits)\n", nbits);
+               return NULL;
+       }
+       if (nbytes > 0)
+               nbits -= count_leading_zeros(buffer[0]);
+       else
+               nbits = 0;
+
+       nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
+       val = mpi_alloc(nlimbs);
+       if (!val)
+               return NULL;
+       val->nbits = nbits;
+       val->sign = 0;
+       val->nlimbs = nlimbs;
+
+       if (nbytes > 0) {
+               i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
+               i %= BYTES_PER_MPI_LIMB;
+               for (j = nlimbs; j > 0; j--) {
+                       a = 0;
+                       for (; i < BYTES_PER_MPI_LIMB; i++) {
+                               a <<= 8;
+                               a |= *buffer++;
+                       }
+                       i = 0;
+                       val->d[j - 1] = a;
+               }
+       }
+       return val;
+}
+EXPORT_SYMBOL_GPL(mpi_read_raw_data);
+
 MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
 {
        const uint8_t *buffer = xbuffer;
diff --git a/lib/oid_registry.c b/lib/oid_registry.c
new file mode 100644 (file)
index 0000000..d8de11f
--- /dev/null
@@ -0,0 +1,170 @@
+/* ASN.1 Object identifier (OID) registry
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <linux/export.h>
+#include <linux/oid_registry.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/bug.h>
+#include "oid_registry_data.c"
+
+/**
+ * look_up_OID - Find an OID registration for the specified data
+ * @data: Binary representation of the OID
+ * @datasize: Size of the binary representation
+ */
+enum OID look_up_OID(const void *data, size_t datasize)
+{
+       const unsigned char *octets = data;
+       enum OID oid;
+       unsigned char xhash;
+       unsigned i, j, k, hash;
+       size_t len;
+
+       /* Hash the OID data */
+       hash = datasize - 1;
+
+       for (i = 0; i < datasize; i++)
+               hash += octets[i] * 33;
+       hash = (hash >> 24) ^ (hash >> 16) ^ (hash >> 8) ^ hash;
+       hash &= 0xff;
+
+       /* Binary search the OID registry.  OIDs are stored in ascending order
+        * of hash value then ascending order of size and then in ascending
+        * order of reverse value.
+        */
+       i = 0;
+       k = OID__NR;
+       while (i < k) {
+               j = (i + k) / 2;
+
+               xhash = oid_search_table[j].hash;
+               if (xhash > hash) {
+                       k = j;
+                       continue;
+               }
+               if (xhash < hash) {
+                       i = j + 1;
+                       continue;
+               }
+
+               oid = oid_search_table[j].oid;
+               len = oid_index[oid + 1] - oid_index[oid];
+               if (len > datasize) {
+                       k = j;
+                       continue;
+               }
+               if (len < datasize) {
+                       i = j + 1;
+                       continue;
+               }
+
+               /* Variation is most likely to be at the tail end of the
+                * OID, so do the comparison in reverse.
+                */
+               while (len > 0) {
+                       unsigned char a = oid_data[oid_index[oid] + --len];
+                       unsigned char b = octets[len];
+                       if (a > b) {
+                               k = j;
+                               goto next;
+                       }
+                       if (a < b) {
+                               i = j + 1;
+                               goto next;
+                       }
+               }
+               return oid;
+       next:
+               ;
+       }
+
+       return OID__NR;
+}
+EXPORT_SYMBOL_GPL(look_up_OID);
+
+/*
+ * sprint_OID - Print an Object Identifier into a buffer
+ * @data: The encoded OID to print
+ * @datasize: The size of the encoded OID
+ * @buffer: The buffer to render into
+ * @bufsize: The size of the buffer
+ *
+ * The OID is rendered into the buffer in "a.b.c.d" format and the number of
+ * bytes is returned.  -EBADMSG is returned if the data could not be intepreted
+ * and -ENOBUFS if the buffer was too small.
+ */
+int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
+{
+       const unsigned char *v = data, *end = v + datasize;
+       unsigned long num;
+       unsigned char n;
+       size_t ret;
+       int count;
+
+       if (v >= end)
+               return -EBADMSG;
+
+       n = *v++;
+       ret = count = snprintf(buffer, bufsize, "%u.%u", n / 40, n % 40);
+       buffer += count;
+       bufsize -= count;
+       if (bufsize == 0)
+               return -ENOBUFS;
+
+       while (v < end) {
+               num = 0;
+               n = *v++;
+               if (!(n & 0x80)) {
+                       num = n;
+               } else {
+                       num = n & 0x7f;
+                       do {
+                               if (v >= end)
+                                       return -EBADMSG;
+                               n = *v++;
+                               num <<= 7;
+                               num |= n & 0x7f;
+                       } while (n & 0x80);
+               }
+               ret += count = snprintf(buffer, bufsize, ".%lu", num);
+               buffer += count;
+               bufsize -= count;
+               if (bufsize == 0)
+                       return -ENOBUFS;
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(sprint_oid);
+
+/**
+ * sprint_OID - Print an Object Identifier into a buffer
+ * @oid: The OID to print
+ * @buffer: The buffer to render into
+ * @bufsize: The size of the buffer
+ *
+ * The OID is rendered into the buffer in "a.b.c.d" format and the number of
+ * bytes is returned.
+ */
+int sprint_OID(enum OID oid, char *buffer, size_t bufsize)
+{
+       int ret;
+
+       BUG_ON(oid >= OID__NR);
+
+       ret = sprint_oid(oid_data + oid_index[oid],
+                        oid_index[oid + 1] - oid_index[oid],
+                        buffer, bufsize);
+       BUG_ON(ret == -EBADMSG);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(sprint_OID);
index 9d49ee6d72190c8f9b727ed98ee1ba9f0c256f48..ba033f09196ee45d7d6fbd170386a0d62af1d4ac 100644 (file)
@@ -591,7 +591,7 @@ static int bt_seq_show(struct seq_file *seq, void *v)
                           atomic_read(&sk->sk_refcnt),
                           sk_rmem_alloc_get(sk),
                           sk_wmem_alloc_get(sk),
-                          sock_i_uid(sk),
+                          from_kuid(seq_user_ns(seq), sock_i_uid(sk)),
                           sock_i_ino(sk),
                           &src_baswapped,
                           &dst_baswapped,
index 9da7fdd3cd8ae85b23050f2bf35abf5db1054b37..af14cb425164d068d8a6272e1d9da1491ccd5f74 100644 (file)
@@ -423,14 +423,15 @@ int ceph_encrypt2(struct ceph_crypto_key *secret, void *dst, size_t *dst_len,
        }
 }
 
-int ceph_key_instantiate(struct key *key, const void *data, size_t datalen)
+int ceph_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        struct ceph_crypto_key *ckey;
+       size_t datalen = prep->datalen;
        int ret;
        void *p;
 
        ret = -EINVAL;
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                goto err;
 
        ret = key_payload_reserve(key, datalen);
@@ -443,8 +444,8 @@ int ceph_key_instantiate(struct key *key, const void *data, size_t datalen)
                goto err;
 
        /* TODO ceph_crypto_key_decode should really take const input */
-       p = (void *)data;
-       ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen);
+       p = (void *)prep->data;
+       ret = ceph_crypto_key_decode(ckey, &p, (char*)prep->data+datalen);
        if (ret < 0)
                goto err_ckey;
 
index 9807945a56d90e0e0feb5c32f5ebaedca6de208f..8aa4b1115384e3018b461ca153bd932a511c3fef 100644 (file)
@@ -59,13 +59,13 @@ const struct cred *dns_resolver_cache;
  *        "ip1,ip2,...#foo=bar"
  */
 static int
-dns_resolver_instantiate(struct key *key, const void *_data, size_t datalen)
+dns_resolver_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        struct user_key_payload *upayload;
        unsigned long derrno;
        int ret;
-       size_t result_len = 0;
-       const char *data = _data, *end, *opt;
+       size_t datalen = prep->datalen, result_len = 0;
+       const char *data = prep->data, *end, *opt;
 
        kenter("%%%d,%s,'%*.*s',%zu",
               key->serial, key->description,
index 011d2384b115ebdbc3bc1f8fdf79a1ef54e8bd3e..7633a752c65e99189c3e7603e2ebdd6e7438b356 100644 (file)
@@ -26,8 +26,8 @@
 #include "ar-internal.h"
 
 static int rxrpc_vet_description_s(const char *);
-static int rxrpc_instantiate(struct key *, const void *, size_t);
-static int rxrpc_instantiate_s(struct key *, const void *, size_t);
+static int rxrpc_instantiate(struct key *, struct key_preparsed_payload *);
+static int rxrpc_instantiate_s(struct key *, struct key_preparsed_payload *);
 static void rxrpc_destroy(struct key *);
 static void rxrpc_destroy_s(struct key *);
 static void rxrpc_describe(const struct key *, struct seq_file *);
@@ -678,7 +678,7 @@ error:
  *
  * if no data is provided, then a no-security key is made
  */
-static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
+static int rxrpc_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        const struct rxrpc_key_data_v1 *v1;
        struct rxrpc_key_token *token, **pp;
@@ -686,26 +686,26 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
        u32 kver;
        int ret;
 
-       _enter("{%x},,%zu", key_serial(key), datalen);
+       _enter("{%x},,%zu", key_serial(key), prep->datalen);
 
        /* handle a no-security key */
-       if (!data && datalen == 0)
+       if (!prep->data && prep->datalen == 0)
                return 0;
 
        /* determine if the XDR payload format is being used */
-       if (datalen > 7 * 4) {
-               ret = rxrpc_instantiate_xdr(key, data, datalen);
+       if (prep->datalen > 7 * 4) {
+               ret = rxrpc_instantiate_xdr(key, prep->data, prep->datalen);
                if (ret != -EPROTO)
                        return ret;
        }
 
        /* get the key interface version number */
        ret = -EINVAL;
-       if (datalen <= 4 || !data)
+       if (prep->datalen <= 4 || !prep->data)
                goto error;
-       memcpy(&kver, data, sizeof(kver));
-       data += sizeof(kver);
-       datalen -= sizeof(kver);
+       memcpy(&kver, prep->data, sizeof(kver));
+       prep->data += sizeof(kver);
+       prep->datalen -= sizeof(kver);
 
        _debug("KEY I/F VERSION: %u", kver);
 
@@ -715,11 +715,11 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
 
        /* deal with a version 1 key */
        ret = -EINVAL;
-       if (datalen < sizeof(*v1))
+       if (prep->datalen < sizeof(*v1))
                goto error;
 
-       v1 = data;
-       if (datalen != sizeof(*v1) + v1->ticket_length)
+       v1 = prep->data;
+       if (prep->datalen != sizeof(*v1) + v1->ticket_length)
                goto error;
 
        _debug("SCIX: %u", v1->security_index);
@@ -784,17 +784,17 @@ error:
  * instantiate a server secret key
  * data should be a pointer to the 8-byte secret key
  */
-static int rxrpc_instantiate_s(struct key *key, const void *data,
-                              size_t datalen)
+static int rxrpc_instantiate_s(struct key *key,
+                              struct key_preparsed_payload *prep)
 {
        struct crypto_blkcipher *ci;
 
-       _enter("{%x},,%zu", key_serial(key), datalen);
+       _enter("{%x},,%zu", key_serial(key), prep->datalen);
 
-       if (datalen != 8)
+       if (prep->datalen != 8)
                return -EINVAL;
 
-       memcpy(&key->type_data, data, 8);
+       memcpy(&key->type_data, prep->data, 8);
 
        ci = crypto_alloc_blkcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(ci)) {
@@ -802,7 +802,7 @@ static int rxrpc_instantiate_s(struct key *key, const void *data,
                return PTR_ERR(ci);
        }
 
-       if (crypto_blkcipher_setkey(ci, data, 8) < 0)
+       if (crypto_blkcipher_setkey(ci, prep->data, 8) < 0)
                BUG();
 
        key->payload.data = ci;
index 65f362d931b59c0882f842fd824273e01049dd89..fb070fa1038feb51e47db9c4ec807ee328fe6364 100644 (file)
@@ -10,3 +10,4 @@ ihex2fw
 recordmcount
 docproc
 sortextable
+asn1_compiler
index a55b0067758a0fb5b35115dbc5f1affa35e69719..01e7adb838d93287d391ec4fee925936115877c1 100644 (file)
@@ -16,8 +16,10 @@ hostprogs-$(CONFIG_VT)           += conmakehash
 hostprogs-$(CONFIG_IKCONFIG)     += bin2c
 hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
 hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable
+hostprogs-$(CONFIG_ASN1)        += asn1_compiler
 
 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
+HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
 
 always         := $(hostprogs-y) $(hostprogs-m)
 
index ff1720d28d0c80be0df2e1d0ae8f5697794e36e9..0e801c3cdaf8f4173ce5abbf9cee0554374bfbc7 100644 (file)
@@ -354,6 +354,17 @@ quiet_cmd_cpp_lds_S = LDS     $@
 $(obj)/%.lds: $(src)/%.lds.S FORCE
        $(call if_changed_dep,cpp_lds_S)
 
+# ASN.1 grammar
+# ---------------------------------------------------------------------------
+quiet_cmd_asn1_compiler = ASN.1   $@
+      cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \
+                               $(subst .h,.c,$@) $(subst .c,.h,$@)
+
+.PRECIOUS: $(objtree)/$(obj)/%-asn1.c $(objtree)/$(obj)/%-asn1.h
+
+$(obj)/%-asn1.c $(obj)/%-asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
+       $(call cmd,asn1_compiler)
+
 # Build the compiled-in targets
 # ---------------------------------------------------------------------------
 
index a1cb0222ebe642b6fd91093f2a01bd301b026e6e..002089141df448fa569688a3e5e57b130d68e88b 100644 (file)
@@ -14,7 +14,8 @@
 # 3)  create one <module>.mod.c file pr. module
 # 4)  create one Module.symvers file with CRC for all exported symbols
 # 5) compile all <module>.mod.c files
-# 6) final link of the module to a <module.ko> file
+# 6) final link of the module to a <module.ko> (or <module.unsigned>) file
+# 7) signs the modules to a <module.ko> file
 
 # Step 3 is used to place certain information in the module's ELF
 # section, including information such as:
@@ -32,6 +33,8 @@
 # Step 4 is solely used to allow module versioning in external modules,
 # where the CRC of each module is retrieved from the Module.symvers file.
 
+# Step 7 is dependent on CONFIG_MODULE_SIG being enabled.
+
 # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
 # symbols in the final module linking stage
 # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
@@ -116,6 +119,7 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
 targets += $(modules:.ko=.mod.o)
 
 # Step 6), final link of the modules
+ifneq ($(CONFIG_MODULE_SIG),y)
 quiet_cmd_ld_ko_o = LD [M]  $@
       cmd_ld_ko_o = $(LD) -r $(LDFLAGS)                                 \
                              $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
@@ -125,7 +129,78 @@ $(modules): %.ko :%.o %.mod.o FORCE
        $(call if_changed,ld_ko_o)
 
 targets += $(modules)
+else
+quiet_cmd_ld_ko_unsigned_o = LD [M]  $@
+      cmd_ld_ko_unsigned_o =                                           \
+               $(LD) -r $(LDFLAGS)                                     \
+                        $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)     \
+                        -o $@ $(filter-out FORCE,$^)                   \
+               $(if $(AFTER_LINK),; $(AFTER_LINK))
+
+$(modules:.ko=.ko.unsigned): %.ko.unsigned :%.o %.mod.o FORCE
+       $(call if_changed,ld_ko_unsigned_o)
+
+targets += $(modules:.ko=.ko.unsigned)
+
+# Step 7), sign the modules
+MODSECKEY = ./signing_key.priv
+MODPUBKEY = ./signing_key.x509
+
+ifeq ($(wildcard $(MODSECKEY))+$(wildcard $(MODPUBKEY)),$(MODSECKEY)+$(MODPUBKEY))
+ifeq ($(KBUILD_SRC),)
+       # no O= is being used
+       SCRIPTS_DIR := scripts
+else
+       SCRIPTS_DIR := $(KBUILD_SRC)/scripts
+endif
+SIGN_MODULES := 1
+else
+SIGN_MODULES := 0
+endif
+
+# only sign if it's an in-tree module
+ifneq ($(KBUILD_EXTMOD),)
+SIGN_MODULES := 0
+endif
 
+# We strip the module as best we can - note that using both strip and eu-strip
+# results in a smaller module than using either alone.
+EU_STRIP = $(shell which eu-strip || echo true)
+
+quiet_cmd_sign_ko_stripped_ko_unsigned = STRIP [M] $@
+      cmd_sign_ko_stripped_ko_unsigned = \
+               cp $< $@ && \
+               strip -x -g $@ && \
+               $(EU_STRIP) $@
+
+ifeq ($(SIGN_MODULES),1)
+
+quiet_cmd_genkeyid = GENKEYID $@
+      cmd_genkeyid = \
+               perl $(SCRIPTS_DIR)/x509keyid $< $<.signer $<.keyid
+
+%.signer %.keyid: %
+       $(call if_changed,genkeyid)
+
+KEYRING_DEP := $(MODSECKEY) $(MODPUBKEY) $(MODPUBKEY).signer $(MODPUBKEY).keyid
+quiet_cmd_sign_ko_ko_stripped = SIGN [M] $@
+      cmd_sign_ko_ko_stripped = \
+               sh $(SCRIPTS_DIR)/sign-file $(MODSECKEY) $(MODPUBKEY) $< $@
+else
+KEYRING_DEP :=
+quiet_cmd_sign_ko_ko_unsigned = NO SIGN [M] $@
+      cmd_sign_ko_ko_unsigned = \
+               cp $< $@
+endif
+
+$(modules): %.ko :%.ko.stripped $(KEYRING_DEP) FORCE
+       $(call if_changed,sign_ko_ko_stripped)
+
+$(patsubst %.ko,%.ko.stripped,$(modules)): %.ko.stripped :%.ko.unsigned FORCE
+       $(call if_changed,sign_ko_stripped_ko_unsigned)
+
+targets += $(modules)
+endif
 
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # ---------------------------------------------------------------------------
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
new file mode 100644 (file)
index 0000000..db0e5cd
--- /dev/null
@@ -0,0 +1,1545 @@
+/* Simplified ASN.1 notation parser
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <linux/asn1_ber_bytecode.h>
+
+enum token_type {
+       DIRECTIVE_ABSENT,
+       DIRECTIVE_ALL,
+       DIRECTIVE_ANY,
+       DIRECTIVE_APPLICATION,
+       DIRECTIVE_AUTOMATIC,
+       DIRECTIVE_BEGIN,
+       DIRECTIVE_BIT,
+       DIRECTIVE_BMPString,
+       DIRECTIVE_BOOLEAN,
+       DIRECTIVE_BY,
+       DIRECTIVE_CHARACTER,
+       DIRECTIVE_CHOICE,
+       DIRECTIVE_CLASS,
+       DIRECTIVE_COMPONENT,
+       DIRECTIVE_COMPONENTS,
+       DIRECTIVE_CONSTRAINED,
+       DIRECTIVE_CONTAINING,
+       DIRECTIVE_DEFAULT,
+       DIRECTIVE_DEFINED,
+       DIRECTIVE_DEFINITIONS,
+       DIRECTIVE_EMBEDDED,
+       DIRECTIVE_ENCODED,
+       DIRECTIVE_ENCODING_CONTROL,
+       DIRECTIVE_END,
+       DIRECTIVE_ENUMERATED,
+       DIRECTIVE_EXCEPT,
+       DIRECTIVE_EXPLICIT,
+       DIRECTIVE_EXPORTS,
+       DIRECTIVE_EXTENSIBILITY,
+       DIRECTIVE_EXTERNAL,
+       DIRECTIVE_FALSE,
+       DIRECTIVE_FROM,
+       DIRECTIVE_GeneralString,
+       DIRECTIVE_GeneralizedTime,
+       DIRECTIVE_GraphicString,
+       DIRECTIVE_IA5String,
+       DIRECTIVE_IDENTIFIER,
+       DIRECTIVE_IMPLICIT,
+       DIRECTIVE_IMPLIED,
+       DIRECTIVE_IMPORTS,
+       DIRECTIVE_INCLUDES,
+       DIRECTIVE_INSTANCE,
+       DIRECTIVE_INSTRUCTIONS,
+       DIRECTIVE_INTEGER,
+       DIRECTIVE_INTERSECTION,
+       DIRECTIVE_ISO646String,
+       DIRECTIVE_MAX,
+       DIRECTIVE_MIN,
+       DIRECTIVE_MINUS_INFINITY,
+       DIRECTIVE_NULL,
+       DIRECTIVE_NumericString,
+       DIRECTIVE_OBJECT,
+       DIRECTIVE_OCTET,
+       DIRECTIVE_OF,
+       DIRECTIVE_OPTIONAL,
+       DIRECTIVE_ObjectDescriptor,
+       DIRECTIVE_PATTERN,
+       DIRECTIVE_PDV,
+       DIRECTIVE_PLUS_INFINITY,
+       DIRECTIVE_PRESENT,
+       DIRECTIVE_PRIVATE,
+       DIRECTIVE_PrintableString,
+       DIRECTIVE_REAL,
+       DIRECTIVE_RELATIVE_OID,
+       DIRECTIVE_SEQUENCE,
+       DIRECTIVE_SET,
+       DIRECTIVE_SIZE,
+       DIRECTIVE_STRING,
+       DIRECTIVE_SYNTAX,
+       DIRECTIVE_T61String,
+       DIRECTIVE_TAGS,
+       DIRECTIVE_TRUE,
+       DIRECTIVE_TeletexString,
+       DIRECTIVE_UNION,
+       DIRECTIVE_UNIQUE,
+       DIRECTIVE_UNIVERSAL,
+       DIRECTIVE_UTCTime,
+       DIRECTIVE_UTF8String,
+       DIRECTIVE_UniversalString,
+       DIRECTIVE_VideotexString,
+       DIRECTIVE_VisibleString,
+       DIRECTIVE_WITH,
+       NR__DIRECTIVES,
+       TOKEN_ASSIGNMENT = NR__DIRECTIVES,
+       TOKEN_OPEN_CURLY,
+       TOKEN_CLOSE_CURLY,
+       TOKEN_OPEN_SQUARE,
+       TOKEN_CLOSE_SQUARE,
+       TOKEN_OPEN_ACTION,
+       TOKEN_CLOSE_ACTION,
+       TOKEN_COMMA,
+       TOKEN_NUMBER,
+       TOKEN_TYPE_NAME,
+       TOKEN_ELEMENT_NAME,
+       NR__TOKENS
+};
+
+static const unsigned char token_to_tag[NR__TOKENS] = {
+       /* EOC goes first */
+       [DIRECTIVE_BOOLEAN]             = ASN1_BOOL,
+       [DIRECTIVE_INTEGER]             = ASN1_INT,
+       [DIRECTIVE_BIT]                 = ASN1_BTS,
+       [DIRECTIVE_OCTET]               = ASN1_OTS,
+       [DIRECTIVE_NULL]                = ASN1_NULL,
+       [DIRECTIVE_OBJECT]              = ASN1_OID,
+       [DIRECTIVE_ObjectDescriptor]    = ASN1_ODE,
+       [DIRECTIVE_EXTERNAL]            = ASN1_EXT,
+       [DIRECTIVE_REAL]                = ASN1_REAL,
+       [DIRECTIVE_ENUMERATED]          = ASN1_ENUM,
+       [DIRECTIVE_EMBEDDED]            = 0,
+       [DIRECTIVE_UTF8String]          = ASN1_UTF8STR,
+       [DIRECTIVE_RELATIVE_OID]        = ASN1_RELOID,
+       /* 14 */
+       /* 15 */
+       [DIRECTIVE_SEQUENCE]            = ASN1_SEQ,
+       [DIRECTIVE_SET]                 = ASN1_SET,
+       [DIRECTIVE_NumericString]       = ASN1_NUMSTR,
+       [DIRECTIVE_PrintableString]     = ASN1_PRNSTR,
+       [DIRECTIVE_T61String]           = ASN1_TEXSTR,
+       [DIRECTIVE_TeletexString]       = ASN1_TEXSTR,
+       [DIRECTIVE_VideotexString]      = ASN1_VIDSTR,
+       [DIRECTIVE_IA5String]           = ASN1_IA5STR,
+       [DIRECTIVE_UTCTime]             = ASN1_UNITIM,
+       [DIRECTIVE_GeneralizedTime]     = ASN1_GENTIM,
+       [DIRECTIVE_GraphicString]       = ASN1_GRASTR,
+       [DIRECTIVE_VisibleString]       = ASN1_VISSTR,
+       [DIRECTIVE_GeneralString]       = ASN1_GENSTR,
+       [DIRECTIVE_UniversalString]     = ASN1_UNITIM,
+       [DIRECTIVE_CHARACTER]           = ASN1_CHRSTR,
+       [DIRECTIVE_BMPString]           = ASN1_BMPSTR,
+};
+
+static const char asn1_classes[4][5] = {
+       [ASN1_UNIV]     = "UNIV",
+       [ASN1_APPL]     = "APPL",
+       [ASN1_CONT]     = "CONT",
+       [ASN1_PRIV]     = "PRIV"
+};
+
+static const char asn1_methods[2][5] = {
+       [ASN1_UNIV]     = "PRIM",
+       [ASN1_APPL]     = "CONS"
+};
+
+static const char *const asn1_universal_tags[32] = {
+       "EOC",
+       "BOOL",
+       "INT",
+       "BTS",
+       "OTS",
+       "NULL",
+       "OID",
+       "ODE",
+       "EXT",
+       "REAL",
+       "ENUM",
+       "EPDV",
+       "UTF8STR",
+       "RELOID",
+       NULL,           /* 14 */
+       NULL,           /* 15 */
+       "SEQ",
+       "SET",
+       "NUMSTR",
+       "PRNSTR",
+       "TEXSTR",
+       "VIDSTR",
+       "IA5STR",
+       "UNITIM",
+       "GENTIM",
+       "GRASTR",
+       "VISSTR",
+       "GENSTR",
+       "UNISTR",
+       "CHRSTR",
+       "BMPSTR",
+       NULL            /* 31 */
+};
+
+static const char *filename;
+static const char *grammar_name;
+static const char *outputname;
+static const char *headername;
+
+static const char *const directives[NR__DIRECTIVES] = {
+#define _(X) [DIRECTIVE_##X] = #X
+       _(ABSENT),
+       _(ALL),
+       _(ANY),
+       _(APPLICATION),
+       _(AUTOMATIC),
+       _(BEGIN),
+       _(BIT),
+       _(BMPString),
+       _(BOOLEAN),
+       _(BY),
+       _(CHARACTER),
+       _(CHOICE),
+       _(CLASS),
+       _(COMPONENT),
+       _(COMPONENTS),
+       _(CONSTRAINED),
+       _(CONTAINING),
+       _(DEFAULT),
+       _(DEFINED),
+       _(DEFINITIONS),
+       _(EMBEDDED),
+       _(ENCODED),
+       [DIRECTIVE_ENCODING_CONTROL] = "ENCODING-CONTROL",
+       _(END),
+       _(ENUMERATED),
+       _(EXCEPT),
+       _(EXPLICIT),
+       _(EXPORTS),
+       _(EXTENSIBILITY),
+       _(EXTERNAL),
+       _(FALSE),
+       _(FROM),
+       _(GeneralString),
+       _(GeneralizedTime),
+       _(GraphicString),
+       _(IA5String),
+       _(IDENTIFIER),
+       _(IMPLICIT),
+       _(IMPLIED),
+       _(IMPORTS),
+       _(INCLUDES),
+       _(INSTANCE),
+       _(INSTRUCTIONS),
+       _(INTEGER),
+       _(INTERSECTION),
+       _(ISO646String),
+       _(MAX),
+       _(MIN),
+       [DIRECTIVE_MINUS_INFINITY] = "MINUS-INFINITY",
+       [DIRECTIVE_NULL] = "NULL",
+       _(NumericString),
+       _(OBJECT),
+       _(OCTET),
+       _(OF),
+       _(OPTIONAL),
+       _(ObjectDescriptor),
+       _(PATTERN),
+       _(PDV),
+       [DIRECTIVE_PLUS_INFINITY] = "PLUS-INFINITY",
+       _(PRESENT),
+       _(PRIVATE),
+       _(PrintableString),
+       _(REAL),
+       [DIRECTIVE_RELATIVE_OID] = "RELATIVE-OID",
+       _(SEQUENCE),
+       _(SET),
+       _(SIZE),
+       _(STRING),
+       _(SYNTAX),
+       _(T61String),
+       _(TAGS),
+       _(TRUE),
+       _(TeletexString),
+       _(UNION),
+       _(UNIQUE),
+       _(UNIVERSAL),
+       _(UTCTime),
+       _(UTF8String),
+       _(UniversalString),
+       _(VideotexString),
+       _(VisibleString),
+       _(WITH)
+};
+
+struct action {
+       struct action   *next;
+       unsigned char   index;
+       char            name[];
+};
+
+static struct action *action_list;
+static unsigned nr_actions;
+
+struct token {
+       unsigned short  line;
+       enum token_type token_type : 8;
+       unsigned char   size;
+       struct action   *action;
+       const char      *value;
+       struct type     *type;
+};
+
+static struct token *token_list;
+static unsigned nr_tokens;
+
+static int directive_compare(const void *_key, const void *_pdir)
+{
+       const struct token *token = _key;
+       const char *const *pdir = _pdir, *dir = *pdir;
+       size_t dlen, clen;
+       int val;
+
+       dlen = strlen(dir);
+       clen = (dlen < token->size) ? dlen : token->size;
+
+       //printf("cmp(%*.*s,%s) = ",
+       //       (int)token->size, (int)token->size, token->value,
+       //       dir);
+
+       val = memcmp(token->value, dir, clen);
+       if (val != 0) {
+               //printf("%d [cmp]\n", val);
+               return val;
+       }
+
+       if (dlen == token->size) {
+               //printf("0\n");
+               return 0;
+       }
+       //printf("%d\n", (int)dlen - (int)token->size);
+       return dlen - token->size; /* shorter -> negative */
+}
+
+/*
+ * Tokenise an ASN.1 grammar
+ */
+static void tokenise(char *buffer, char *end)
+{
+       struct token *tokens;
+       char *line, *nl, *p, *q;
+       unsigned tix, lineno;
+
+       /* Assume we're going to have half as many tokens as we have
+        * characters
+        */
+       token_list = tokens = calloc((end - buffer) / 2, sizeof(struct token));
+       if (!tokens) {
+               perror(NULL);
+               exit(1);
+       }
+       tix = 0;
+
+       lineno = 0;
+       while (buffer < end) {
+               /* First of all, break out a line */
+               lineno++;
+               line = buffer;
+               nl = memchr(line, '\n', end - buffer);
+               if (!nl) {
+                       buffer = nl = end;
+               } else {
+                       buffer = nl + 1;
+                       *nl = '\0';
+               }
+
+               /* Remove "--" comments */
+               p = line;
+       next_comment:
+               while ((p = memchr(p, '-', nl - p))) {
+                       if (p[1] == '-') {
+                               /* Found a comment; see if there's a terminator */
+                               q = p + 2;
+                               while ((q = memchr(q, '-', nl - q))) {
+                                       if (q[1] == '-') {
+                                               /* There is - excise the comment */
+                                               q += 2;
+                                               memmove(p, q, nl - q);
+                                               goto next_comment;
+                                       }
+                                       q++;
+                               }
+                               *p = '\0';
+                               nl = p;
+                               break;
+                       } else {
+                               p++;
+                       }
+               }
+
+               p = line;
+               while (p < nl) {
+                       /* Skip white space */
+                       while (p < nl && isspace(*p))
+                               *(p++) = 0;
+                       if (p >= nl)
+                               break;
+
+                       tokens[tix].line = lineno;
+                       tokens[tix].value = p;
+
+                       /* Handle string tokens */
+                       if (isalpha(*p)) {
+                               const char **dir;
+
+                               /* Can be a directive, type name or element
+                                * name.  Find the end of the name.
+                                */
+                               q = p + 1;
+                               while (q < nl && (isalnum(*q) || *q == '-' || *q == '_'))
+                                       q++;
+                               tokens[tix].size = q - p;
+                               p = q;
+
+                               /* If it begins with a lowercase letter then
+                                * it's an element name
+                                */
+                               if (islower(tokens[tix].value[0])) {
+                                       tokens[tix++].token_type = TOKEN_ELEMENT_NAME;
+                                       continue;
+                               }
+
+                               /* Otherwise we need to search the directive
+                                * table
+                                */
+                               dir = bsearch(&tokens[tix], directives,
+                                             sizeof(directives) / sizeof(directives[1]),
+                                             sizeof(directives[1]),
+                                             directive_compare);
+                               if (dir) {
+                                       tokens[tix++].token_type = dir - directives;
+                                       continue;
+                               }
+
+                               tokens[tix++].token_type = TOKEN_TYPE_NAME;
+                               continue;
+                       }
+
+                       /* Handle numbers */
+                       if (isdigit(*p)) {
+                               /* Find the end of the number */
+                               q = p + 1;
+                               while (q < nl && (isdigit(*q)))
+                                       q++;
+                               tokens[tix].size = q - p;
+                               p = q;
+                               tokens[tix++].token_type = TOKEN_NUMBER;
+                               continue;
+                       }
+
+                       if (nl - p >= 3) {
+                               if (memcmp(p, "::=", 3) == 0) {
+                                       p += 3;
+                                       tokens[tix].size = 3;
+                                       tokens[tix++].token_type = TOKEN_ASSIGNMENT;
+                                       continue;
+                               }
+                       }
+
+                       if (nl - p >= 2) {
+                               if (memcmp(p, "({", 2) == 0) {
+                                       p += 2;
+                                       tokens[tix].size = 2;
+                                       tokens[tix++].token_type = TOKEN_OPEN_ACTION;
+                                       continue;
+                               }
+                               if (memcmp(p, "})", 2) == 0) {
+                                       p += 2;
+                                       tokens[tix].size = 2;
+                                       tokens[tix++].token_type = TOKEN_CLOSE_ACTION;
+                                       continue;
+                               }
+                       }
+
+                       if (nl - p >= 1) {
+                               tokens[tix].size = 1;
+                               switch (*p) {
+                               case '{':
+                                       p += 1;
+                                       tokens[tix++].token_type = TOKEN_OPEN_CURLY;
+                                       continue;
+                               case '}':
+                                       p += 1;
+                                       tokens[tix++].token_type = TOKEN_CLOSE_CURLY;
+                                       continue;
+                               case '[':
+                                       p += 1;
+                                       tokens[tix++].token_type = TOKEN_OPEN_SQUARE;
+                                       continue;
+                               case ']':
+                                       p += 1;
+                                       tokens[tix++].token_type = TOKEN_CLOSE_SQUARE;
+                                       continue;
+                               case ',':
+                                       p += 1;
+                                       tokens[tix++].token_type = TOKEN_COMMA;
+                                       continue;
+                               default:
+                                       break;
+                               }
+                       }
+
+                       fprintf(stderr, "%s:%u: Unknown character in grammar: '%c'\n",
+                               filename, lineno, *p);
+                       exit(1);
+               }
+       }
+
+       nr_tokens = tix;
+       printf("Extracted %u tokens\n", nr_tokens);
+
+#if 0
+       {
+               int n;
+               for (n = 0; n < nr_tokens; n++)
+                       printf("Token %3u: '%*.*s'\n",
+                              n,
+                              (int)token_list[n].size, (int)token_list[n].size,
+                              token_list[n].value);
+       }
+#endif
+}
+
+static void build_type_list(void);
+static void parse(void);
+static void render(FILE *out, FILE *hdr);
+
+/*
+ *
+ */
+int main(int argc, char **argv)
+{
+       struct stat st;
+       ssize_t readlen;
+       FILE *out, *hdr;
+       char *buffer, *p;
+       int fd;
+
+       if (argc != 4) {
+               fprintf(stderr, "Format: %s <grammar-file> <c-file> <hdr-file>\n",
+                       argv[0]);
+               exit(2);
+       }
+
+       filename = argv[1];
+       outputname = argv[2];
+       headername = argv[3];
+
+       fd = open(filename, O_RDONLY);
+       if (fd < 0) {
+               perror(filename);
+               exit(1);
+       }
+
+       if (fstat(fd, &st) < 0) {
+               perror(filename);
+               exit(1);
+       }
+
+       if (!(buffer = malloc(st.st_size + 1))) {
+               perror(NULL);
+               exit(1);
+       }
+
+       if ((readlen = read(fd, buffer, st.st_size)) < 0) {
+               perror(filename);
+               exit(1);
+       }
+
+       if (close(fd) < 0) {
+               perror(filename);
+               exit(1);
+       }
+
+       if (readlen != st.st_size) {
+               fprintf(stderr, "%s: Short read\n", filename);
+               exit(1);
+       }
+
+       p = strrchr(argv[1], '/');
+       p = p ? p + 1 : argv[1];
+       grammar_name = strdup(p);
+       if (!p) {
+               perror(NULL);
+               exit(1);
+       }
+       p = strchr(grammar_name, '.');
+       if (p)
+               *p = '\0';
+
+       buffer[readlen] = 0;
+       tokenise(buffer, buffer + readlen);
+       build_type_list();
+       parse();
+
+       out = fopen(outputname, "w");
+       if (!out) {
+               perror(outputname);
+               exit(1);
+       }
+
+       hdr = fopen(headername, "w");
+       if (!out) {
+               perror(headername);
+               exit(1);
+       }
+
+       render(out, hdr);
+
+       if (fclose(out) < 0) {
+               perror(outputname);
+               exit(1);
+       }
+
+       if (fclose(hdr) < 0) {
+               perror(headername);
+               exit(1);
+       }
+
+       return 0;
+}
+
+enum compound {
+       NOT_COMPOUND,
+       SET,
+       SET_OF,
+       SEQUENCE,
+       SEQUENCE_OF,
+       CHOICE,
+       ANY,
+       TYPE_REF,
+       TAG_OVERRIDE
+};
+
+struct element {
+       struct type     *type_def;
+       struct token    *name;
+       struct token    *type;
+       struct action   *action;
+       struct element  *children;
+       struct element  *next;
+       struct element  *render_next;
+       struct element  *list_next;
+       uint8_t         n_elements;
+       enum compound   compound : 8;
+       enum asn1_class class : 8;
+       enum asn1_method method : 8;
+       uint8_t         tag;
+       unsigned        entry_index;
+       unsigned        flags;
+#define ELEMENT_IMPLICIT       0x0001
+#define ELEMENT_EXPLICIT       0x0002
+#define ELEMENT_MARKED         0x0004
+#define ELEMENT_RENDERED       0x0008
+#define ELEMENT_SKIPPABLE      0x0010
+#define ELEMENT_CONDITIONAL    0x0020
+};
+
+struct type {
+       struct token    *name;
+       struct token    *def;
+       struct element  *element;
+       unsigned        ref_count;
+       unsigned        flags;
+#define TYPE_STOP_MARKER       0x0001
+#define TYPE_BEGIN             0x0002
+};
+
+static struct type *type_list;
+static struct type **type_index;
+static unsigned nr_types;
+
+static int type_index_compare(const void *_a, const void *_b)
+{
+       const struct type *const *a = _a, *const *b = _b;
+
+       if ((*a)->name->size != (*b)->name->size)
+               return (*a)->name->size - (*b)->name->size;
+       else
+               return memcmp((*a)->name->value, (*b)->name->value,
+                             (*a)->name->size);
+}
+
+static int type_finder(const void *_key, const void *_ti)
+{
+       const struct token *token = _key;
+       const struct type *const *ti = _ti;
+       const struct type *type = *ti;
+
+       if (token->size != type->name->size)
+               return token->size - type->name->size;
+       else
+               return memcmp(token->value, type->name->value,
+                             token->size);
+}
+
+/*
+ * Build up a list of types and a sorted index to that list.
+ */
+static void build_type_list(void)
+{
+       struct type *types;
+       unsigned nr, t, n;
+
+       nr = 0;
+       for (n = 0; n < nr_tokens - 1; n++)
+               if (token_list[n + 0].token_type == TOKEN_TYPE_NAME &&
+                   token_list[n + 1].token_type == TOKEN_ASSIGNMENT)
+                       nr++;
+
+       if (nr == 0) {
+               fprintf(stderr, "%s: No defined types\n", filename);
+               exit(1);
+       }
+
+       nr_types = nr;
+       types = type_list = calloc(nr + 1, sizeof(type_list[0]));
+       if (!type_list) {
+               perror(NULL);
+               exit(1);
+       }
+       type_index = calloc(nr, sizeof(type_index[0]));
+       if (!type_index) {
+               perror(NULL);
+               exit(1);
+       }
+
+       t = 0;
+       types[t].flags |= TYPE_BEGIN;
+       for (n = 0; n < nr_tokens - 1; n++) {
+               if (token_list[n + 0].token_type == TOKEN_TYPE_NAME &&
+                   token_list[n + 1].token_type == TOKEN_ASSIGNMENT) {
+                       types[t].name = &token_list[n];
+                       type_index[t] = &types[t];
+                       t++;
+               }
+       }
+       types[t].name = &token_list[n + 1];
+       types[t].flags |= TYPE_STOP_MARKER;
+
+       qsort(type_index, nr, sizeof(type_index[0]), type_index_compare);
+
+       printf("Extracted %u types\n", nr_types);
+#if 0
+       for (n = 0; n < nr_types; n++) {
+               struct type *type = type_index[n];
+               printf("- %*.*s\n",
+                      (int)type->name->size,
+                      (int)type->name->size,
+                      type->name->value);
+       }
+#endif
+}
+
+static struct element *parse_type(struct token **_cursor, struct token *stop,
+                                 struct token *name);
+
+/*
+ * Parse the token stream
+ */
+static void parse(void)
+{
+       struct token *cursor;
+       struct type *type;
+
+       /* Parse one type definition statement at a time */
+       type = type_list;
+       do {
+               cursor = type->name;
+
+               if (cursor[0].token_type != TOKEN_TYPE_NAME ||
+                   cursor[1].token_type != TOKEN_ASSIGNMENT)
+                       abort();
+               cursor += 2;
+
+               type->element = parse_type(&cursor, type[1].name, NULL);
+               type->element->type_def = type;
+
+               if (cursor != type[1].name) {
+                       fprintf(stderr, "%s:%d: Parse error at token '%*.*s'\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+
+       } while (type++, !(type->flags & TYPE_STOP_MARKER));
+
+       printf("Extracted %u actions\n", nr_actions);
+}
+
+static struct element *element_list;
+
+static struct element *alloc_elem(struct token *type)
+{
+       struct element *e = calloc(1, sizeof(*e));
+       if (!e) {
+               perror(NULL);
+               exit(1);
+       }
+       e->list_next = element_list;
+       element_list = e;
+       return e;
+}
+
+static struct element *parse_compound(struct token **_cursor, struct token *end,
+                                     int alternates);
+
+/*
+ * Parse one type definition statement
+ */
+static struct element *parse_type(struct token **_cursor, struct token *end,
+                                 struct token *name)
+{
+       struct element *top, *element;
+       struct action *action, **ppaction;
+       struct token *cursor = *_cursor;
+       struct type **ref;
+       char *p;
+       int labelled = 0, implicit = 0;
+
+       top = element = alloc_elem(cursor);
+       element->class = ASN1_UNIV;
+       element->method = ASN1_PRIM;
+       element->tag = token_to_tag[cursor->token_type];
+       element->name = name;
+
+       /* Extract the tag value if one given */
+       if (cursor->token_type == TOKEN_OPEN_SQUARE) {
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               switch (cursor->token_type) {
+               case DIRECTIVE_UNIVERSAL:
+                       element->class = ASN1_UNIV;
+                       cursor++;
+                       break;
+               case DIRECTIVE_APPLICATION:
+                       element->class = ASN1_APPL;
+                       cursor++;
+                       break;
+               case TOKEN_NUMBER:
+                       element->class = ASN1_CONT;
+                       break;
+               case DIRECTIVE_PRIVATE:
+                       element->class = ASN1_PRIV;
+                       cursor++;
+                       break;
+               default:
+                       fprintf(stderr, "%s:%d: Unrecognised tag class token '%*.*s'\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != TOKEN_NUMBER) {
+                       fprintf(stderr, "%s:%d: Missing tag number '%*.*s'\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+
+               element->tag &= ~0x1f;
+               element->tag |= strtoul(cursor->value, &p, 10);
+               if (p - cursor->value != cursor->size)
+                       abort();
+               cursor++;
+
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != TOKEN_CLOSE_SQUARE) {
+                       fprintf(stderr, "%s:%d: Missing closing square bracket '%*.*s'\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               labelled = 1;
+       }
+
+       /* Handle implicit and explicit markers */
+       if (cursor->token_type == DIRECTIVE_IMPLICIT) {
+               element->flags |= ELEMENT_IMPLICIT;
+               implicit = 1;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+       } else if (cursor->token_type == DIRECTIVE_EXPLICIT) {
+               element->flags |= ELEMENT_EXPLICIT;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+       }
+
+       if (labelled) {
+               if (!implicit)
+                       element->method |= ASN1_CONS;
+               element->compound = implicit ? TAG_OVERRIDE : SEQUENCE;
+               element->children = alloc_elem(cursor);
+               element = element->children;
+               element->class = ASN1_UNIV;
+               element->method = ASN1_PRIM;
+               element->tag = token_to_tag[cursor->token_type];
+               element->name = name;
+       }
+
+       /* Extract the type we're expecting here */
+       element->type = cursor;
+       switch (cursor->token_type) {
+       case DIRECTIVE_ANY:
+               element->compound = ANY;
+               cursor++;
+               break;
+
+       case DIRECTIVE_NULL:
+       case DIRECTIVE_BOOLEAN:
+       case DIRECTIVE_ENUMERATED:
+       case DIRECTIVE_INTEGER:
+               element->compound = NOT_COMPOUND;
+               cursor++;
+               break;
+
+       case DIRECTIVE_EXTERNAL:
+               element->method = ASN1_CONS;
+
+       case DIRECTIVE_BMPString:
+       case DIRECTIVE_GeneralString:
+       case DIRECTIVE_GraphicString:
+       case DIRECTIVE_IA5String:
+       case DIRECTIVE_ISO646String:
+       case DIRECTIVE_NumericString:
+       case DIRECTIVE_PrintableString:
+       case DIRECTIVE_T61String:
+       case DIRECTIVE_TeletexString:
+       case DIRECTIVE_UniversalString:
+       case DIRECTIVE_UTF8String:
+       case DIRECTIVE_VideotexString:
+       case DIRECTIVE_VisibleString:
+       case DIRECTIVE_ObjectDescriptor:
+       case DIRECTIVE_GeneralizedTime:
+       case DIRECTIVE_UTCTime:
+               element->compound = NOT_COMPOUND;
+               cursor++;
+               break;
+
+       case DIRECTIVE_BIT:
+       case DIRECTIVE_OCTET:
+               element->compound = NOT_COMPOUND;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != DIRECTIVE_STRING)
+                       goto parse_error;
+               cursor++;
+               break;
+
+       case DIRECTIVE_OBJECT:
+               element->compound = NOT_COMPOUND;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != DIRECTIVE_IDENTIFIER)
+                       goto parse_error;
+               cursor++;
+               break;
+
+       case TOKEN_TYPE_NAME:
+               element->compound = TYPE_REF;
+               ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]),
+                             type_finder);
+               if (!ref) {
+                       fprintf(stderr, "%s:%d: Type '%*.*s' undefined\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+               cursor->type = *ref;
+               (*ref)->ref_count++;
+               cursor++;
+               break;
+
+       case DIRECTIVE_CHOICE:
+               element->compound = CHOICE;
+               cursor++;
+               element->children = parse_compound(&cursor, end, 1);
+               break;
+
+       case DIRECTIVE_SEQUENCE:
+               element->compound = SEQUENCE;
+               element->method = ASN1_CONS;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type == DIRECTIVE_OF) {
+                       element->compound = SEQUENCE_OF;
+                       cursor++;
+                       if (cursor >= end)
+                               goto overrun_error;
+                       element->children = parse_type(&cursor, end, NULL);
+               } else {
+                       element->children = parse_compound(&cursor, end, 0);
+               }
+               break;
+
+       case DIRECTIVE_SET:
+               element->compound = SET;
+               element->method = ASN1_CONS;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type == DIRECTIVE_OF) {
+                       element->compound = SET_OF;
+                       cursor++;
+                       if (cursor >= end)
+                               goto parse_error;
+                       element->children = parse_type(&cursor, end, NULL);
+               } else {
+                       element->children = parse_compound(&cursor, end, 1);
+               }
+               break;
+
+       default:
+               fprintf(stderr, "%s:%d: Token '%*.*s' does not introduce a type\n",
+                       filename, cursor->line,
+                       (int)cursor->size, (int)cursor->size, cursor->value);
+               exit(1);
+       }
+
+       /* Handle elements that are optional */
+       if (cursor < end && (cursor->token_type == DIRECTIVE_OPTIONAL ||
+                            cursor->token_type == DIRECTIVE_DEFAULT)
+           ) {
+               cursor++;
+               top->flags |= ELEMENT_SKIPPABLE;
+       }
+
+       if (cursor < end && cursor->token_type == TOKEN_OPEN_ACTION) {
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != TOKEN_ELEMENT_NAME) {
+                       fprintf(stderr, "%s:%d: Token '%*.*s' is not an action function name\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+
+               action = malloc(sizeof(struct action) + cursor->size + 1);
+               if (!action) {
+                       perror(NULL);
+                       exit(1);
+               }
+               action->index = 0;
+               memcpy(action->name, cursor->value, cursor->size);
+               action->name[cursor->size] = 0;
+
+               for (ppaction = &action_list;
+                    *ppaction;
+                    ppaction = &(*ppaction)->next
+                    ) {
+                       int cmp = strcmp(action->name, (*ppaction)->name);
+                       if (cmp == 0) {
+                               free(action);
+                               action = *ppaction;
+                               goto found;
+                       }
+                       if (cmp < 0) {
+                               action->next = *ppaction;
+                               *ppaction = action;
+                               nr_actions++;
+                               goto found;
+                       }
+               }
+               action->next = NULL;
+               *ppaction = action;
+               nr_actions++;
+       found:
+
+               element->action = action;
+               cursor->action = action;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != TOKEN_CLOSE_ACTION) {
+                       fprintf(stderr, "%s:%d: Missing close action, got '%*.*s'\n",
+                               filename, cursor->line,
+                               (int)cursor->size, (int)cursor->size, cursor->value);
+                       exit(1);
+               }
+               cursor++;
+       }
+
+       *_cursor = cursor;
+       return top;
+
+parse_error:
+       fprintf(stderr, "%s:%d: Unexpected token '%*.*s'\n",
+               filename, cursor->line,
+               (int)cursor->size, (int)cursor->size, cursor->value);
+       exit(1);
+
+overrun_error:
+       fprintf(stderr, "%s: Unexpectedly hit EOF\n", filename);
+       exit(1);
+}
+
+/*
+ * Parse a compound type list
+ */
+static struct element *parse_compound(struct token **_cursor, struct token *end,
+                                     int alternates)
+{
+       struct element *children, **child_p = &children, *element;
+       struct token *cursor = *_cursor, *name;
+
+       if (cursor->token_type != TOKEN_OPEN_CURLY) {
+               fprintf(stderr, "%s:%d: Expected compound to start with brace not '%*.*s'\n",
+                       filename, cursor->line,
+                       (int)cursor->size, (int)cursor->size, cursor->value);
+               exit(1);
+       }
+       cursor++;
+       if (cursor >= end)
+               goto overrun_error;
+
+       if (cursor->token_type == TOKEN_OPEN_CURLY) {
+               fprintf(stderr, "%s:%d: Empty compound\n",
+                       filename, cursor->line);
+               exit(1);
+       }
+
+       for (;;) {
+               name = NULL;
+               if (cursor->token_type == TOKEN_ELEMENT_NAME) {
+                       name = cursor;
+                       cursor++;
+                       if (cursor >= end)
+                               goto overrun_error;
+               }
+
+               element = parse_type(&cursor, end, name);
+               if (alternates)
+                       element->flags |= ELEMENT_SKIPPABLE | ELEMENT_CONDITIONAL;
+
+               *child_p = element;
+               child_p = &element->next;
+
+               if (cursor >= end)
+                       goto overrun_error;
+               if (cursor->token_type != TOKEN_COMMA)
+                       break;
+               cursor++;
+               if (cursor >= end)
+                       goto overrun_error;
+       }
+
+       children->flags &= ~ELEMENT_CONDITIONAL;
+
+       if (cursor->token_type != TOKEN_CLOSE_CURLY) {
+               fprintf(stderr, "%s:%d: Expected compound closure, got '%*.*s'\n",
+                       filename, cursor->line,
+                       (int)cursor->size, (int)cursor->size, cursor->value);
+               exit(1);
+       }
+       cursor++;
+
+       *_cursor = cursor;
+       return children;
+
+overrun_error:
+       fprintf(stderr, "%s: Unexpectedly hit EOF\n", filename);
+       exit(1);
+}
+
+static void render_element(FILE *out, struct element *e, struct element *tag);
+static void render_out_of_line_list(FILE *out);
+
+static int nr_entries;
+static int render_depth = 1;
+static struct element *render_list, **render_list_p = &render_list;
+
+__attribute__((format(printf, 2, 3)))
+static void render_opcode(FILE *out, const char *fmt, ...)
+{
+       va_list va;
+
+       if (out) {
+               fprintf(out, "\t[%4d] =%*s", nr_entries, render_depth, "");
+               va_start(va, fmt);
+               vfprintf(out, fmt, va);
+               va_end(va);
+       }
+       nr_entries++;
+}
+
+__attribute__((format(printf, 2, 3)))
+static void render_more(FILE *out, const char *fmt, ...)
+{
+       va_list va;
+
+       if (out) {
+               va_start(va, fmt);
+               vfprintf(out, fmt, va);
+               va_end(va);
+       }
+}
+
+/*
+ * Render the grammar into a state machine definition.
+ */
+static void render(FILE *out, FILE *hdr)
+{
+       struct element *e;
+       struct action *action;
+       struct type *root;
+       int index;
+
+       fprintf(hdr, "/*\n");
+       fprintf(hdr, " * Automatically generated by asn1_compiler.  Do not edit\n");
+       fprintf(hdr, " *\n");
+       fprintf(hdr, " * ASN.1 parser for %s\n", grammar_name);
+       fprintf(hdr, " */\n");
+       fprintf(hdr, "#include <linux/asn1_decoder.h>\n");
+       fprintf(hdr, "\n");
+       fprintf(hdr, "extern const struct asn1_decoder %s_decoder;\n", grammar_name);
+       if (ferror(hdr)) {
+               perror(headername);
+               exit(1);
+       }
+
+       fprintf(out, "/*\n");
+       fprintf(out, " * Automatically generated by asn1_compiler.  Do not edit\n");
+       fprintf(out, " *\n");
+       fprintf(out, " * ASN.1 parser for %s\n", grammar_name);
+       fprintf(out, " */\n");
+       fprintf(out, "#include <linux/asn1_ber_bytecode.h>\n");
+       fprintf(out, "#include \"%s-asn1.h\"\n", grammar_name);
+       fprintf(out, "\n");
+       if (ferror(out)) {
+               perror(outputname);
+               exit(1);
+       }
+
+       /* Tabulate the action functions we might have to call */
+       fprintf(hdr, "\n");
+       index = 0;
+       for (action = action_list; action; action = action->next) {
+               action->index = index++;
+               fprintf(hdr,
+                       "extern int %s(void *, size_t, unsigned char,"
+                       " const void *, size_t);\n",
+                       action->name);
+       }
+       fprintf(hdr, "\n");
+
+       fprintf(out, "enum %s_actions {\n", grammar_name);
+       for (action = action_list; action; action = action->next)
+               fprintf(out, "\tACT_%s = %u,\n",
+                       action->name, action->index);
+       fprintf(out, "\tNR__%s_actions = %u\n", grammar_name, nr_actions);
+       fprintf(out, "};\n");
+
+       fprintf(out, "\n");
+       fprintf(out, "static const asn1_action_t %s_action_table[NR__%s_actions] = {\n",
+               grammar_name, grammar_name);
+       for (action = action_list; action; action = action->next)
+               fprintf(out, "\t[%4u] = %s,\n", action->index, action->name);
+       fprintf(out, "};\n");
+
+       if (ferror(out)) {
+               perror(outputname);
+               exit(1);
+       }
+
+       /* We do two passes - the first one calculates all the offsets */
+       printf("Pass 1\n");
+       nr_entries = 0;
+       root = &type_list[0];
+       render_element(NULL, root->element, NULL);
+       render_opcode(NULL, "ASN1_OP_COMPLETE,\n");
+       render_out_of_line_list(NULL);
+
+       for (e = element_list; e; e = e->list_next)
+               e->flags &= ~ELEMENT_RENDERED;
+
+       /* And then we actually render */
+       printf("Pass 2\n");
+       fprintf(out, "\n");
+       fprintf(out, "static const unsigned char %s_machine[] = {\n",
+               grammar_name);
+
+       nr_entries = 0;
+       root = &type_list[0];
+       render_element(out, root->element, NULL);
+       render_opcode(out, "ASN1_OP_COMPLETE,\n");
+       render_out_of_line_list(out);
+
+       fprintf(out, "};\n");
+
+       fprintf(out, "\n");
+       fprintf(out, "const struct asn1_decoder %s_decoder = {\n", grammar_name);
+       fprintf(out, "\t.machine = %s_machine,\n", grammar_name);
+       fprintf(out, "\t.machlen = sizeof(%s_machine),\n", grammar_name);
+       fprintf(out, "\t.actions = %s_action_table,\n", grammar_name);
+       fprintf(out, "};\n");
+}
+
+/*
+ * Render the out-of-line elements
+ */
+static void render_out_of_line_list(FILE *out)
+{
+       struct element *e, *ce;
+       const char *act;
+       int entry;
+
+       while ((e = render_list)) {
+               render_list = e->render_next;
+               if (!render_list)
+                       render_list_p = &render_list;
+
+               render_more(out, "\n");
+               e->entry_index = entry = nr_entries;
+               render_depth++;
+               for (ce = e->children; ce; ce = ce->next)
+                       render_element(out, ce, NULL);
+               render_depth--;
+
+               act = e->action ? "_ACT" : "";
+               switch (e->compound) {
+               case SEQUENCE:
+                       render_opcode(out, "ASN1_OP_END_SEQ%s,\n", act);
+                       break;
+               case SEQUENCE_OF:
+                       render_opcode(out, "ASN1_OP_END_SEQ_OF%s,\n", act);
+                       render_opcode(out, "_jump_target(%u),\n", entry);
+                       break;
+               case SET:
+                       render_opcode(out, "ASN1_OP_END_SET%s,\n", act);
+                       break;
+               case SET_OF:
+                       render_opcode(out, "ASN1_OP_END_SET_OF%s,\n", act);
+                       render_opcode(out, "_jump_target(%u),\n", entry);
+                       break;
+               }
+               if (e->action)
+                       render_opcode(out, "_action(ACT_%s),\n",
+                                     e->action->name);
+               render_opcode(out, "ASN1_OP_RETURN,\n");
+       }
+}
+
+/*
+ * Render an element.
+ */
+static void render_element(FILE *out, struct element *e, struct element *tag)
+{
+       struct element *ec;
+       const char *cond, *act;
+       int entry, skippable = 0, outofline = 0;
+
+       if (e->flags & ELEMENT_SKIPPABLE ||
+           (tag && tag->flags & ELEMENT_SKIPPABLE))
+               skippable = 1;
+
+       if ((e->type_def && e->type_def->ref_count > 1) ||
+           skippable)
+               outofline = 1;
+
+       if (e->type_def && out) {
+               render_more(out, "\t// %*.*s\n",
+                           (int)e->type_def->name->size, (int)e->type_def->name->size,
+                           e->type_def->name->value);
+       }
+
+       /* Render the operation */
+       cond = (e->flags & ELEMENT_CONDITIONAL ||
+               (tag && tag->flags & ELEMENT_CONDITIONAL)) ? "COND_" : "";
+       act = e->action ? "_ACT" : "";
+       switch (e->compound) {
+       case ANY:
+               render_opcode(out, "ASN1_OP_%sMATCH_ANY%s,", cond, act);
+               if (e->name)
+                       render_more(out, "\t\t// %*.*s",
+                                   (int)e->name->size, (int)e->name->size,
+                                   e->name->value);
+               render_more(out, "\n");
+               goto dont_render_tag;
+
+       case TAG_OVERRIDE:
+               render_element(out, e->children, e);
+               return;
+
+       case SEQUENCE:
+       case SEQUENCE_OF:
+       case SET:
+       case SET_OF:
+               render_opcode(out, "ASN1_OP_%sMATCH%s%s,",
+                             cond,
+                             outofline ? "_JUMP" : "",
+                             skippable ? "_OR_SKIP" : "");
+               break;
+
+       case CHOICE:
+               goto dont_render_tag;
+
+       case TYPE_REF:
+               if (e->class == ASN1_UNIV && e->method == ASN1_PRIM && e->tag == 0)
+                       goto dont_render_tag;
+       default:
+               render_opcode(out, "ASN1_OP_%sMATCH%s%s,",
+                             cond, act,
+                             skippable ? "_OR_SKIP" : "");
+               break;
+       }
+
+       if (e->name)
+               render_more(out, "\t\t// %*.*s",
+                           (int)e->name->size, (int)e->name->size,
+                           e->name->value);
+       render_more(out, "\n");
+
+       /* Render the tag */
+       if (!tag)
+               tag = e;
+       if (tag->class == ASN1_UNIV &&
+           tag->tag != 14 &&
+           tag->tag != 15 &&
+           tag->tag != 31)
+               render_opcode(out, "_tag(%s, %s, %s),\n",
+                             asn1_classes[tag->class],
+                             asn1_methods[tag->method | e->method],
+                             asn1_universal_tags[tag->tag]);
+       else
+               render_opcode(out, "_tagn(%s, %s, %2u),\n",
+                             asn1_classes[tag->class],
+                             asn1_methods[tag->method | e->method],
+                             tag->tag);
+       tag = NULL;
+dont_render_tag:
+
+       /* Deal with compound types */
+       switch (e->compound) {
+       case TYPE_REF:
+               render_element(out, e->type->type->element, tag);
+               if (e->action)
+                       render_opcode(out, "ASN1_OP_ACT,\n");
+               break;
+
+       case SEQUENCE:
+               if (outofline) {
+                       /* Render out-of-line for multiple use or
+                        * skipability */
+                       render_opcode(out, "_jump_target(%u),", e->entry_index);
+                       if (e->type_def && e->type_def->name)
+                               render_more(out, "\t\t// --> %*.*s",
+                                           (int)e->type_def->name->size,
+                                           (int)e->type_def->name->size,
+                                           e->type_def->name->value);
+                       render_more(out, "\n");
+                       if (!(e->flags & ELEMENT_RENDERED)) {
+                               e->flags |= ELEMENT_RENDERED;
+                               *render_list_p = e;
+                               render_list_p = &e->render_next;
+                       }
+                       return;
+               } else {
+                       /* Render inline for single use */
+                       render_depth++;
+                       for (ec = e->children; ec; ec = ec->next)
+                               render_element(out, ec, NULL);
+                       render_depth--;
+                       render_opcode(out, "ASN1_OP_END_SEQ%s,\n", act);
+               }
+               break;
+
+       case SEQUENCE_OF:
+       case SET_OF:
+               if (outofline) {
+                       /* Render out-of-line for multiple use or
+                        * skipability */
+                       render_opcode(out, "_jump_target(%u),", e->entry_index);
+                       if (e->type_def && e->type_def->name)
+                               render_more(out, "\t\t// --> %*.*s",
+                                           (int)e->type_def->name->size,
+                                           (int)e->type_def->name->size,
+                                           e->type_def->name->value);
+                       render_more(out, "\n");
+                       if (!(e->flags & ELEMENT_RENDERED)) {
+                               e->flags |= ELEMENT_RENDERED;
+                               *render_list_p = e;
+                               render_list_p = &e->render_next;
+                       }
+                       return;
+               } else {
+                       /* Render inline for single use */
+                       entry = nr_entries;
+                       render_depth++;
+                       render_element(out, e->children, NULL);
+                       render_depth--;
+                       if (e->compound == SEQUENCE_OF)
+                               render_opcode(out, "ASN1_OP_END_SEQ_OF%s,\n", act);
+                       else
+                               render_opcode(out, "ASN1_OP_END_SET_OF%s,\n", act);
+                       render_opcode(out, "_jump_target(%u),\n", entry);
+               }
+               break;
+
+       case SET:
+               /* I can't think of a nice way to do SET support without having
+                * a stack of bitmasks to make sure no element is repeated.
+                * The bitmask has also to be checked that no non-optional
+                * elements are left out whilst not preventing optional
+                * elements from being left out.
+                */
+               fprintf(stderr, "The ASN.1 SET type is not currently supported.\n");
+               exit(1);
+
+       case CHOICE:
+               for (ec = e->children; ec; ec = ec->next)
+                       render_element(out, ec, NULL);
+               if (!skippable)
+                       render_opcode(out, "ASN1_OP_COND_FAIL,\n");
+               if (e->action)
+                       render_opcode(out, "ASN1_OP_ACT,\n");
+               break;
+
+       default:
+               break;
+       }
+
+       if (e->action)
+               render_opcode(out, "_action(ACT_%s),\n", e->action->name);
+}
diff --git a/scripts/sign-file b/scripts/sign-file
new file mode 100644 (file)
index 0000000..e58e34e
--- /dev/null
@@ -0,0 +1,115 @@
+#!/bin/sh
+#
+# Sign a module file using the given key.
+#
+# Format: sign-file <key> <x509> <src-file> <dst-file>
+#
+
+scripts=`dirname $0`
+
+CONFIG_MODULE_SIG_SHA512=y
+if [ -r .config ]
+then
+    . ./.config
+fi
+
+key="$1"
+x509="$2"
+src="$3"
+dst="$4"
+
+if [ ! -r "$key" ]
+then
+    echo "Can't read private key" >&2
+    exit 2
+fi
+
+if [ ! -r "$x509" ]
+then
+    echo "Can't read X.509 certificate" >&2
+    exit 2
+fi
+if [ ! -r "$x509.signer" ]
+then
+    echo "Can't read Signer name" >&2
+    exit 2;
+fi
+if [ ! -r "$x509.keyid" ]
+then
+    echo "Can't read Key identifier" >&2
+    exit 2;
+fi
+
+#
+# Signature parameters
+#
+algo=1         # Public-key crypto algorithm: RSA
+hash=          # Digest algorithm
+id_type=1      # Identifier type: X.509
+
+#
+# Digest the data
+#
+dgst=
+if [ "$CONFIG_MODULE_SIG_SHA1" = "y" ]
+then
+    prologue="0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14"
+    dgst=-sha1
+    hash=2
+elif [ "$CONFIG_MODULE_SIG_SHA224" = "y" ]
+then
+    prologue="0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C"
+    dgst=-sha224
+    hash=7
+elif [ "$CONFIG_MODULE_SIG_SHA256" = "y" ]
+then
+    prologue="0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20"
+    dgst=-sha256
+    hash=4
+elif [ "$CONFIG_MODULE_SIG_SHA384" = "y" ]
+then
+    prologue="0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30"
+    dgst=-sha384
+    hash=5
+elif [ "$CONFIG_MODULE_SIG_SHA512" = "y" ]
+then
+    prologue="0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40"
+    dgst=-sha512
+    hash=6
+else
+    echo "$0: Can't determine hash algorithm" >&2
+    exit 2
+fi
+
+(
+perl -e "binmode STDOUT; print pack(\"C*\", $prologue)" || exit $?
+openssl dgst $dgst -binary $src || exit $?
+) >$src.dig || exit $?
+
+#
+# Generate the binary signature, which will be just the integer that comprises
+# the signature with no metadata attached.
+#
+openssl rsautl -sign -inkey $key -keyform PEM -in $src.dig -out $src.sig || exit $?
+signerlen=`stat -c %s $x509.signer`
+keyidlen=`stat -c %s $x509.keyid`
+siglen=`stat -c %s $src.sig`
+
+#
+# Build the signed binary
+#
+(
+    cat $src || exit $?
+    echo '~Module signature appended~' || exit $?
+    cat $x509.signer $x509.keyid || exit $?
+
+    # Preface each signature integer with a 2-byte BE length
+    perl -e "binmode STDOUT; print pack(\"n\", $siglen)" || exit $?
+    cat $src.sig || exit $?
+
+    # Generate the information block
+    perl -e "binmode STDOUT; print pack(\"CCCCCxxxN\", $algo, $hash, $id_type, $signerlen, $keyidlen, $siglen + 2)" || exit $?
+) >$dst~ || exit $?
+
+# Permit in-place signing
+mv $dst~ $dst || exit $?
diff --git a/scripts/x509keyid b/scripts/x509keyid
new file mode 100755 (executable)
index 0000000..c8e91a4
--- /dev/null
@@ -0,0 +1,268 @@
+#!/usr/bin/perl -w
+#
+# Generate an identifier from an X.509 certificate that can be placed in a
+# module signature to indentify the key to use.
+#
+# Format:
+#
+#      ./scripts/x509keyid <x509-cert> <signer's-name> <key-id>
+#
+# We read the DER-encoded X509 certificate and parse it to extract the Subject
+# name and Subject Key Identifier.  The provide the data we need to build the
+# certificate identifier.
+#
+# The signer's name part of the identifier is fabricated from the commonName,
+# the organizationName or the emailAddress components of the X.509 subject
+# name and written to the second named file.
+#
+# The subject key ID to select which of that signer's certificates we're
+# intending to use to sign the module is written to the third named file.
+#
+use strict;
+
+my $raw_data;
+
+die "Need three filenames\n" if ($#ARGV != 2);
+
+my $src = $ARGV[0];
+
+open(FD, "<$src") || die $src;
+binmode FD;
+my @st = stat(FD);
+die $src if (!@st);
+read(FD, $raw_data, $st[7]) || die $src;
+close(FD);
+
+my $UNIV = 0 << 6;
+my $APPL = 1 << 6;
+my $CONT = 2 << 6;
+my $PRIV = 3 << 6;
+
+my $CONS = 0x20;
+
+my $BOOLEAN    = 0x01;
+my $INTEGER    = 0x02;
+my $BIT_STRING = 0x03;
+my $OCTET_STRING = 0x04;
+my $NULL       = 0x05;
+my $OBJ_ID     = 0x06;
+my $UTF8String = 0x0c;
+my $SEQUENCE   = 0x10;
+my $SET                = 0x11;
+my $UTCTime    = 0x17;
+my $GeneralizedTime = 0x18;
+
+my %OIDs = (
+    pack("CCC", 85, 4, 3)      => "commonName",
+    pack("CCC", 85, 4, 6)      => "countryName",
+    pack("CCC", 85, 4, 10)     => "organizationName",
+    pack("CCC", 85, 4, 11)     => "organizationUnitName",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 1) => "rsaEncryption",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 5) => "sha1WithRSAEncryption",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 9, 1) => "emailAddress",
+    pack("CCC", 85, 29, 35)    => "authorityKeyIdentifier",
+    pack("CCC", 85, 29, 14)    => "subjectKeyIdentifier",
+    pack("CCC", 85, 29, 19)    => "basicConstraints"
+);
+
+###############################################################################
+#
+# Extract an ASN.1 element from a string and return information about it.
+#
+###############################################################################
+sub asn1_extract($$@)
+{
+    my ($cursor, $expected_tag, $optional) = @_;
+
+    return [ -1 ]
+       if ($cursor->[1] == 0 && $optional);
+
+    die $src, ": ", $cursor->[0], ": ASN.1 data underrun (elem ", $cursor->[1], ")\n"
+       if ($cursor->[1] < 2);
+
+    my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2));
+
+    if ($expected_tag != -1 && $tag != $expected_tag) {
+       return [ -1 ]
+           if ($optional);
+       die $src, ": ", $cursor->[0], ": ASN.1 unexpected tag (", $tag,
+       " not ", $expected_tag, ")\n";
+    }
+
+    $cursor->[0] += 2;
+    $cursor->[1] -= 2;
+
+    die $src, ": ", $cursor->[0], ": ASN.1 long tag\n"
+       if (($tag & 0x1f) == 0x1f);
+    die $src, ": ", $cursor->[0], ": ASN.1 indefinite length\n"
+       if ($len == 0x80);
+
+    if ($len > 0x80) {
+       my $l = $len - 0x80;
+       die $src, ": ", $cursor->[0], ": ASN.1 data underrun (len len $l)\n"
+           if ($cursor->[1] < $l);
+
+       if ($l == 0x1) {
+           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1));
+       } elsif ($l = 0x2) {
+           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2));
+       } elsif ($l = 0x3) {
+           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16;
+           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2));
+       } elsif ($l = 0x4) {
+           $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4));
+       } else {
+           die $src, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n";
+       }
+
+       $cursor->[0] += $l;
+       $cursor->[1] -= $l;
+    }
+
+    die $src, ": ", $cursor->[0], ": ASN.1 data underrun (", $len, ")\n"
+       if ($cursor->[1] < $len);
+
+    my $ret = [ $tag, [ $cursor->[0], $len, $cursor->[2] ] ];
+    $cursor->[0] += $len;
+    $cursor->[1] -= $len;
+
+    return $ret;
+}
+
+###############################################################################
+#
+# Retrieve the data referred to by a cursor
+#
+###############################################################################
+sub asn1_retrieve($)
+{
+    my ($cursor) = @_;
+    my ($offset, $len, $data) = @$cursor;
+    return substr($$data, $offset, $len);
+}
+
+###############################################################################
+#
+# Roughly parse the X.509 certificate
+#
+###############################################################################
+my $cursor = [ 0, length($raw_data), \$raw_data ];
+
+my $cert = asn1_extract($cursor, $UNIV | $CONS | $SEQUENCE);
+my $tbs = asn1_extract($cert->[1], $UNIV | $CONS | $SEQUENCE);
+my $version = asn1_extract($tbs->[1], $CONT | $CONS | 0, 1);
+my $serial_number = asn1_extract($tbs->[1], $UNIV | $INTEGER);
+my $sig_type = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $issuer = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $validity = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $subject = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $key = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $issuer_uid = asn1_extract($tbs->[1], $CONT | $CONS | 1, 1);
+my $subject_uid = asn1_extract($tbs->[1], $CONT | $CONS | 2, 1);
+my $extension_list = asn1_extract($tbs->[1], $CONT | $CONS | 3, 1);
+
+my $subject_key_id = ();
+my $authority_key_id = ();
+
+#
+# Parse the extension list
+#
+if ($extension_list->[0] != -1) {
+    my $extensions = asn1_extract($extension_list->[1], $UNIV | $CONS | $SEQUENCE);
+
+    while ($extensions->[1]->[1] > 0) {
+       my $ext = asn1_extract($extensions->[1], $UNIV | $CONS | $SEQUENCE);
+       my $x_oid = asn1_extract($ext->[1], $UNIV | $OBJ_ID);
+       my $x_crit = asn1_extract($ext->[1], $UNIV | $BOOLEAN, 1);
+       my $x_val = asn1_extract($ext->[1], $UNIV | $OCTET_STRING);
+
+       my $raw_oid = asn1_retrieve($x_oid->[1]);
+       next if (!exists($OIDs{$raw_oid}));
+       my $x_type = $OIDs{$raw_oid};
+
+       my $raw_value = asn1_retrieve($x_val->[1]);
+
+       if ($x_type eq "subjectKeyIdentifier") {
+           my $vcursor = [ 0, length($raw_value), \$raw_value ];
+
+           $subject_key_id = asn1_extract($vcursor, $UNIV | $OCTET_STRING);
+       }
+    }
+}
+
+###############################################################################
+#
+# Determine what we're going to use as the signer's name.  In order of
+# preference, take one of: commonName, organizationName or emailAddress.
+#
+###############################################################################
+my $org = "";
+my $cn = "";
+my $email = "";
+
+while ($subject->[1]->[1] > 0) {
+    my $rdn = asn1_extract($subject->[1], $UNIV | $CONS | $SET);
+    my $attr = asn1_extract($rdn->[1], $UNIV | $CONS | $SEQUENCE);
+    my $n_oid = asn1_extract($attr->[1], $UNIV | $OBJ_ID);
+    my $n_val = asn1_extract($attr->[1], -1);
+
+    my $raw_oid = asn1_retrieve($n_oid->[1]);
+    next if (!exists($OIDs{$raw_oid}));
+    my $n_type = $OIDs{$raw_oid};
+
+    my $raw_value = asn1_retrieve($n_val->[1]);
+
+    if ($n_type eq "organizationName") {
+       $org = $raw_value;
+    } elsif ($n_type eq "commonName") {
+       $cn = $raw_value;
+    } elsif ($n_type eq "emailAddress") {
+       $email = $raw_value;
+    }
+}
+
+my $id_name = $email;
+
+if ($org && $cn) {
+    # Don't use the organizationName if the commonName repeats it
+    if (length($org) <= length($cn) &&
+       substr($cn, 0, length($org)) eq $org) {
+       $id_name = $cn;
+       goto got_id_name;
+    }
+
+    # Or a signifcant chunk of it
+    if (length($org) >= 7 &&
+       length($cn) >= 7 &&
+       substr($cn, 0, 7) eq substr($org, 0, 7)) {
+       $id_name = $cn;
+       goto got_id_name;
+    }
+
+    $id_name = $org . ": " . $cn;
+} elsif ($org) {
+    $id_name = $org;
+} elsif ($cn) {
+    $id_name = $cn;
+}
+
+got_id_name:
+
+###############################################################################
+#
+# Output the signer's name and the key identifier that we're going to include
+# in module signatures.
+#
+###############################################################################
+die $src, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n"
+    if (!$subject_key_id);
+
+my $id_key_id = asn1_retrieve($subject_key_id->[1]);
+
+open(OUTFD, ">$ARGV[1]") || die $ARGV[1];
+print OUTFD $id_name;
+close OUTFD || die $ARGV[1];
+
+open(OUTFD, ">$ARGV[2]") || die $ARGV[2];
+print OUTFD $id_key_id;
+close OUTFD || die $ARGV[2];
index 2d1bb8af7696d5d431394cfbe8ac6d5e40f24da2..9e1e005c75967d497831fb67146020aeed4bc4a8 100644 (file)
@@ -773,8 +773,8 @@ static int encrypted_init(struct encrypted_key_payload *epayload,
  *
  * On success, return 0. Otherwise return errno.
  */
-static int encrypted_instantiate(struct key *key, const void *data,
-                                size_t datalen)
+static int encrypted_instantiate(struct key *key,
+                                struct key_preparsed_payload *prep)
 {
        struct encrypted_key_payload *epayload = NULL;
        char *datablob = NULL;
@@ -782,16 +782,17 @@ static int encrypted_instantiate(struct key *key, const void *data,
        char *master_desc = NULL;
        char *decrypted_datalen = NULL;
        char *hex_encoded_iv = NULL;
+       size_t datalen = prep->datalen;
        int ret;
 
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
 
        datablob = kmalloc(datalen + 1, GFP_KERNEL);
        if (!datablob)
                return -ENOMEM;
        datablob[datalen] = 0;
-       memcpy(datablob, data, datalen);
+       memcpy(datablob, prep->data, datalen);
        ret = datablob_parse(datablob, &format, &master_desc,
                             &decrypted_datalen, &hex_encoded_iv);
        if (ret < 0)
@@ -834,16 +835,17 @@ static void encrypted_rcu_free(struct rcu_head *rcu)
  *
  * On success, return 0. Otherwise return errno.
  */
-static int encrypted_update(struct key *key, const void *data, size_t datalen)
+static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)
 {
        struct encrypted_key_payload *epayload = key->payload.data;
        struct encrypted_key_payload *new_epayload;
        char *buf;
        char *new_master_desc = NULL;
        const char *format = NULL;
+       size_t datalen = prep->datalen;
        int ret = 0;
 
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
 
        buf = kmalloc(datalen + 1, GFP_KERNEL);
@@ -851,7 +853,7 @@ static int encrypted_update(struct key *key, const void *data, size_t datalen)
                return -ENOMEM;
 
        buf[datalen] = 0;
-       memcpy(buf, data, datalen);
+       memcpy(buf, prep->data, datalen);
        ret = datablob_parse(buf, &format, &new_master_desc, NULL, NULL);
        if (ret < 0)
                goto out;
index a30e927349051ce651e6f0872861cdda881e5bce..a15c9da8f971832edb41a455b72f738fac4e9cb8 100644 (file)
@@ -405,8 +405,7 @@ EXPORT_SYMBOL(key_payload_reserve);
  * key_construction_mutex.
  */
 static int __key_instantiate_and_link(struct key *key,
-                                     const void *data,
-                                     size_t datalen,
+                                     struct key_preparsed_payload *prep,
                                      struct key *keyring,
                                      struct key *authkey,
                                      unsigned long *_prealloc)
@@ -424,7 +423,7 @@ static int __key_instantiate_and_link(struct key *key,
        /* can't instantiate twice */
        if (!test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) {
                /* instantiate the key */
-               ret = key->type->instantiate(key, data, datalen);
+               ret = key->type->instantiate(key, prep);
 
                if (ret == 0) {
                        /* mark the key as being instantiated */
@@ -475,22 +474,37 @@ int key_instantiate_and_link(struct key *key,
                             struct key *keyring,
                             struct key *authkey)
 {
+       struct key_preparsed_payload prep;
        unsigned long prealloc;
        int ret;
 
+       memset(&prep, 0, sizeof(prep));
+       prep.data = data;
+       prep.datalen = datalen;
+       prep.quotalen = key->type->def_datalen;
+       if (key->type->preparse) {
+               ret = key->type->preparse(&prep);
+               if (ret < 0)
+                       goto error;
+       }
+
        if (keyring) {
                ret = __key_link_begin(keyring, key->type, key->description,
                                       &prealloc);
                if (ret < 0)
-                       return ret;
+                       goto error_free_preparse;
        }
 
-       ret = __key_instantiate_and_link(key, data, datalen, keyring, authkey,
+       ret = __key_instantiate_and_link(key, &prep, keyring, authkey,
                                         &prealloc);
 
        if (keyring)
                __key_link_end(keyring, key->type, prealloc);
 
+error_free_preparse:
+       if (key->type->preparse)
+               key->type->free_preparse(&prep);
+error:
        return ret;
 }
 
@@ -699,7 +713,7 @@ void key_type_put(struct key_type *ktype)
  * if we get an error.
  */
 static inline key_ref_t __key_update(key_ref_t key_ref,
-                                    const void *payload, size_t plen)
+                                    struct key_preparsed_payload *prep)
 {
        struct key *key = key_ref_to_ptr(key_ref);
        int ret;
@@ -715,7 +729,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref,
 
        down_write(&key->sem);
 
-       ret = key->type->update(key, payload, plen);
+       ret = key->type->update(key, prep);
        if (ret == 0)
                /* updating a negative key instantiates it */
                clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
@@ -767,6 +781,7 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
                               unsigned long flags)
 {
        unsigned long prealloc;
+       struct key_preparsed_payload prep;
        const struct cred *cred = current_cred();
        struct key_type *ktype;
        struct key *keyring, *key = NULL;
@@ -782,8 +797,9 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
        }
 
        key_ref = ERR_PTR(-EINVAL);
-       if (!ktype->match || !ktype->instantiate)
-               goto error_2;
+       if (!ktype->match || !ktype->instantiate ||
+           (!description && !ktype->preparse))
+               goto error_put_type;
 
        keyring = key_ref_to_ptr(keyring_ref);
 
@@ -791,18 +807,37 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
 
        key_ref = ERR_PTR(-ENOTDIR);
        if (keyring->type != &key_type_keyring)
-               goto error_2;
+               goto error_put_type;
+
+       memset(&prep, 0, sizeof(prep));
+       prep.data = payload;
+       prep.datalen = plen;
+       prep.quotalen = ktype->def_datalen;
+       if (ktype->preparse) {
+               ret = ktype->preparse(&prep);
+               if (ret < 0) {
+                       key_ref = ERR_PTR(ret);
+                       goto error_put_type;
+               }
+               if (!description)
+                       description = prep.description;
+               key_ref = ERR_PTR(-EINVAL);
+               if (!description)
+                       goto error_free_prep;
+       }
 
        ret = __key_link_begin(keyring, ktype, description, &prealloc);
-       if (ret < 0)
-               goto error_2;
+       if (ret < 0) {
+               key_ref = ERR_PTR(ret);
+               goto error_free_prep;
+       }
 
        /* if we're going to allocate a new key, we're going to have
         * to modify the keyring */
        ret = key_permission(keyring_ref, KEY_WRITE);
        if (ret < 0) {
                key_ref = ERR_PTR(ret);
-               goto error_3;
+               goto error_link_end;
        }
 
        /* if it's possible to update this type of key, search for an existing
@@ -833,25 +868,27 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
                        perm, flags);
        if (IS_ERR(key)) {
                key_ref = ERR_CAST(key);
-               goto error_3;
+               goto error_link_end;
        }
 
        /* instantiate it and link it into the target keyring */
-       ret = __key_instantiate_and_link(key, payload, plen, keyring, NULL,
-                                        &prealloc);
+       ret = __key_instantiate_and_link(key, &prep, keyring, NULL, &prealloc);
        if (ret < 0) {
                key_put(key);
                key_ref = ERR_PTR(ret);
-               goto error_3;
+               goto error_link_end;
        }
 
        key_ref = make_key_ref(key, is_key_possessed(keyring_ref));
 
- error_3:
+error_link_end:
        __key_link_end(keyring, ktype, prealloc);
- error_2:
+error_free_prep:
+       if (ktype->preparse)
+               ktype->free_preparse(&prep);
+error_put_type:
        key_type_put(ktype);
- error:
+error:
        return key_ref;
 
  found_matching_key:
@@ -859,10 +896,9 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
         * - we can drop the locks first as we have the key pinned
         */
        __key_link_end(keyring, ktype, prealloc);
-       key_type_put(ktype);
 
-       key_ref = __key_update(key_ref, payload, plen);
-       goto error;
+       key_ref = __key_update(key_ref, &prep);
+       goto error_free_prep;
 }
 EXPORT_SYMBOL(key_create_or_update);
 
@@ -881,6 +917,7 @@ EXPORT_SYMBOL(key_create_or_update);
  */
 int key_update(key_ref_t key_ref, const void *payload, size_t plen)
 {
+       struct key_preparsed_payload prep;
        struct key *key = key_ref_to_ptr(key_ref);
        int ret;
 
@@ -893,18 +930,31 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen)
 
        /* attempt to update it if supported */
        ret = -EOPNOTSUPP;
-       if (key->type->update) {
-               down_write(&key->sem);
-
-               ret = key->type->update(key, payload, plen);
-               if (ret == 0)
-                       /* updating a negative key instantiates it */
-                       clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
+       if (!key->type->update)
+               goto error;
 
-               up_write(&key->sem);
+       memset(&prep, 0, sizeof(prep));
+       prep.data = payload;
+       prep.datalen = plen;
+       prep.quotalen = key->type->def_datalen;
+       if (key->type->preparse) {
+               ret = key->type->preparse(&prep);
+               if (ret < 0)
+                       goto error;
        }
 
- error:
+       down_write(&key->sem);
+
+       ret = key->type->update(key, &prep);
+       if (ret == 0)
+               /* updating a negative key instantiates it */
+               clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
+
+       up_write(&key->sem);
+
+       if (key->type->preparse)
+               key->type->free_preparse(&prep);
+error:
        return ret;
 }
 EXPORT_SYMBOL(key_update);
index 305ecb76519c8a0aafa115d1847a8b24f3fb71bc..5d34b4e827d6349a46f6b892573e129e500e49db 100644 (file)
@@ -46,6 +46,9 @@ static int key_get_type_from_user(char *type,
  * Extract the description of a new key from userspace and either add it as a
  * new key to the specified keyring or update a matching key in that keyring.
  *
+ * If the description is NULL or an empty string, the key type is asked to
+ * generate one from the payload.
+ *
  * The keyring must be writable so that we can attach the key to it.
  *
  * If successful, the new key's serial number is returned, otherwise an error
@@ -72,10 +75,17 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
        if (ret < 0)
                goto error;
 
-       description = strndup_user(_description, PAGE_SIZE);
-       if (IS_ERR(description)) {
-               ret = PTR_ERR(description);
-               goto error;
+       description = NULL;
+       if (_description) {
+               description = strndup_user(_description, PAGE_SIZE);
+               if (IS_ERR(description)) {
+                       ret = PTR_ERR(description);
+                       goto error;
+               }
+               if (!*description) {
+                       kfree(description);
+                       description = NULL;
+               }
        }
 
        /* pull the payload in if one was supplied */
index a5f5c4b6edc5c521b9e65508fcd50310980fce15..6e42df15a24c3b3509455d8afedaed3dccf66662 100644 (file)
@@ -66,7 +66,7 @@ static inline unsigned keyring_hash(const char *desc)
  * operations.
  */
 static int keyring_instantiate(struct key *keyring,
-                              const void *data, size_t datalen);
+                              struct key_preparsed_payload *prep);
 static int keyring_match(const struct key *keyring, const void *criterion);
 static void keyring_revoke(struct key *keyring);
 static void keyring_destroy(struct key *keyring);
@@ -121,12 +121,12 @@ static void keyring_publish_name(struct key *keyring)
  * Returns 0 on success, -EINVAL if given any data.
  */
 static int keyring_instantiate(struct key *keyring,
-                              const void *data, size_t datalen)
+                              struct key_preparsed_payload *prep)
 {
        int ret;
 
        ret = -EINVAL;
-       if (datalen == 0) {
+       if (prep->datalen == 0) {
                /* make the keyring available by name if it has one */
                keyring_publish_name(keyring);
                ret = 0;
index 60d4e3f5e4bb21373900fb4cedb0907f61f68ea1..85730d5a5a59a05c852b3d22c586778b117589fa 100644 (file)
@@ -19,7 +19,8 @@
 #include <asm/uaccess.h>
 #include "internal.h"
 
-static int request_key_auth_instantiate(struct key *, const void *, size_t);
+static int request_key_auth_instantiate(struct key *,
+                                       struct key_preparsed_payload *);
 static void request_key_auth_describe(const struct key *, struct seq_file *);
 static void request_key_auth_revoke(struct key *);
 static void request_key_auth_destroy(struct key *);
@@ -42,10 +43,9 @@ struct key_type key_type_request_key_auth = {
  * Instantiate a request-key authorisation key.
  */
 static int request_key_auth_instantiate(struct key *key,
-                                       const void *data,
-                                       size_t datalen)
+                                       struct key_preparsed_payload *prep)
 {
-       key->payload.data = (struct request_key_auth *) data;
+       key->payload.data = (struct request_key_auth *)prep->data;
        return 0;
 }
 
index 3f163d0489ad2e8705a8f57c4751038b9d7d6f36..e13fcf7636f7ffa0ff40d7cd60408645621dab1f 100644 (file)
@@ -895,23 +895,24 @@ static struct trusted_key_payload *trusted_payload_alloc(struct key *key)
  *
  * On success, return 0. Otherwise return errno.
  */
-static int trusted_instantiate(struct key *key, const void *data,
-                              size_t datalen)
+static int trusted_instantiate(struct key *key,
+                              struct key_preparsed_payload *prep)
 {
        struct trusted_key_payload *payload = NULL;
        struct trusted_key_options *options = NULL;
+       size_t datalen = prep->datalen;
        char *datablob;
        int ret = 0;
        int key_cmd;
        size_t key_len;
 
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
 
        datablob = kmalloc(datalen + 1, GFP_KERNEL);
        if (!datablob)
                return -ENOMEM;
-       memcpy(datablob, data, datalen);
+       memcpy(datablob, prep->data, datalen);
        datablob[datalen] = '\0';
 
        options = trusted_options_alloc();
@@ -981,17 +982,18 @@ static void trusted_rcu_free(struct rcu_head *rcu)
 /*
  * trusted_update - reseal an existing key with new PCR values
  */
-static int trusted_update(struct key *key, const void *data, size_t datalen)
+static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
 {
        struct trusted_key_payload *p = key->payload.data;
        struct trusted_key_payload *new_p;
        struct trusted_key_options *new_o;
+       size_t datalen = prep->datalen;
        char *datablob;
        int ret = 0;
 
        if (!p->migratable)
                return -EPERM;
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                return -EINVAL;
 
        datablob = kmalloc(datalen + 1, GFP_KERNEL);
@@ -1008,7 +1010,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
                goto out;
        }
 
-       memcpy(datablob, data, datalen);
+       memcpy(datablob, prep->data, datalen);
        datablob[datalen] = '\0';
        ret = datablob_parse(datablob, new_p, new_o);
        if (ret != Opt_update) {
index c7660a25a3e4502673714b39553a0d9d00873672..55dc88939185812f70145427b96c991ed6d636e2 100644 (file)
@@ -58,13 +58,14 @@ EXPORT_SYMBOL_GPL(key_type_logon);
 /*
  * instantiate a user defined key
  */
-int user_instantiate(struct key *key, const void *data, size_t datalen)
+int user_instantiate(struct key *key, struct key_preparsed_payload *prep)
 {
        struct user_key_payload *upayload;
+       size_t datalen = prep->datalen;
        int ret;
 
        ret = -EINVAL;
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                goto error;
 
        ret = key_payload_reserve(key, datalen);
@@ -78,7 +79,7 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
 
        /* attach the data */
        upayload->datalen = datalen;
-       memcpy(upayload->data, data, datalen);
+       memcpy(upayload->data, prep->data, datalen);
        rcu_assign_keypointer(key, upayload);
        ret = 0;
 
@@ -92,13 +93,14 @@ EXPORT_SYMBOL_GPL(user_instantiate);
  * update a user defined key
  * - the key's semaphore is write-locked
  */
-int user_update(struct key *key, const void *data, size_t datalen)
+int user_update(struct key *key, struct key_preparsed_payload *prep)
 {
        struct user_key_payload *upayload, *zap;
+       size_t datalen = prep->datalen;
        int ret;
 
        ret = -EINVAL;
-       if (datalen <= 0 || datalen > 32767 || !data)
+       if (datalen <= 0 || datalen > 32767 || !prep->data)
                goto error;
 
        /* construct a replacement payload */
@@ -108,7 +110,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
                goto error;
 
        upayload->datalen = datalen;
-       memcpy(upayload->data, data, datalen);
+       memcpy(upayload->data, prep->data, datalen);
 
        /* check the quota and attach the new data */
        zap = upayload;
index 247264502fb799cd3bddb9e43b003aad3ed45417..f7c968ad51780760fb5630e35b5091a8b0699826 100644 (file)
@@ -252,10 +252,10 @@ $(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
 
 LIB_FILE=$(OUTPUT)libperf.a
 
-LIB_H += ../../include/linux/perf_event.h
+LIB_H += ../../include/uapi/linux/perf_event.h
 LIB_H += ../../include/linux/rbtree.h
 LIB_H += ../../include/linux/list.h
-LIB_H += ../../include/linux/const.h
+LIB_H += ../../include/uapi/linux/const.h
 LIB_H += ../../include/linux/hash.h
 LIB_H += ../../include/linux/stringify.h
 LIB_H += util/include/linux/bitmap.h
index a89cbbb6180167181111e72a0050f1a44aac8e1d..276287783a03759af243ff3d55c3b848cd357d3f 100644 (file)
@@ -112,7 +112,7 @@ void get_term_dimensions(struct winsize *ws);
 #include <sys/types.h>
 #include <sys/syscall.h>
 
-#include "../../include/linux/perf_event.h"
+#include "../../include/uapi/linux/perf_event.h"
 #include "util/types.h"
 #include <stdbool.h>
 
index ffdd94e9c9c3fa0328ac6aa9734d6be6048afb00..618d41140abd368072d9c978f70969233cd70260 100644 (file)
@@ -19,7 +19,7 @@
 #include "thread_map.h"
 #include "target.h"
 #include "../../../include/linux/hw_breakpoint.h"
-#include "../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 #include "perf_regs.h"
 
 #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
index 3ead0d59c03d7d2cedc9b8cee73c6214d0004152..6f94d6dea00f4b26efb86533509b4c9dace89737 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/list.h>
 #include <stdbool.h>
-#include "../../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 #include "types.h"
 #include "xyarray.h"
 #include "cgroup.h"
index 99bdd3abce594ce8c0a9932a7acb0ac1e5a20092..879d215cdac9007c360fbd4862c2e0d3aaa514e3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __PERF_HEADER_H
 #define __PERF_HEADER_H
 
-#include "../../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 #include <sys/types.h>
 #include <stdbool.h>
 #include "types.h"
index b722abe3a6260a8fc412700c947fcaf3e7f5973a..2a9bdc066307c0f61fc49987cf526900426c1fda 100644 (file)
@@ -1,2 +1,2 @@
 #include <asm/types.h>
-#include "../../../../include/linux/swab.h"
+#include "../../../../include/uapi/linux/swab.h"
index 1b476c9ae649581284161e21339255bf3ded408a..c10a35e1afb86e7c15eec1eb122630df66bff060 100644 (file)
@@ -1 +1 @@
-#include "../../../../include/linux/const.h"
+#include "../../../../include/uapi/linux/const.h"
index c356e443448dbd0f5521bc7cce1835a400e9dda7..839230ceb18bd918b194d0fc719607445ad7bb00 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/list.h>
 #include <stdbool.h>
 #include "types.h"
-#include "../../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 #include "types.h"
 
 struct list_head;
index 53c7794fc4be3b409c72dee5687abce438111707..39f3abac77448021daf35d13f5c8fea57538db49 100644 (file)
@@ -2,7 +2,7 @@
 #define __PMU_H
 
 #include <linux/bitops.h>
-#include "../../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 
 enum {
        PERF_PMU_FORMAT_VALUE_CONFIG,
index aab414fbb64b4f0ba3d455153d68cf9b8860e959..dd6426163ba6d70332d03a7aeac1205f59e146d4 100644 (file)
@@ -7,7 +7,7 @@
 #include "symbol.h"
 #include "thread.h"
 #include <linux/rbtree.h>
-#include "../../../include/linux/perf_event.h"
+#include "../../../include/uapi/linux/perf_event.h"
 
 struct sample_queue;
 struct ip_callchain;
index f576971f6556f0b08dcd30ef24af4fef61d01e91..cd1b03e80899960147c9fc18777a1f5a35f9e08f 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/fcntl.h>
 #include <sys/mount.h>
 #include <sys/statfs.h>
-#include "../../include/linux/magic.h"
+#include "../../include/uapi/linux/magic.h"
 #include "../../include/linux/kernel-page-flags.h"