aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 16:28:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 16:28:32 -0400
commit0b381a286e5d748b1fd80095d3dd52326819742f (patch)
treed72fca56123520b9c78661137f8a02b6ad26f95b /include
parent034b5eeb6bc783e7f60e11299154556e65699e7a (diff)
parent5921e6f8809b1616932ca4afd40fe449faa8fd88 (diff)
Merge tag 'disintegrate-main-20121013' of git://git.infradead.org/users/dhowells/linux-headers
Pull UAPI disintegration for include/linux/{,byteorder/}*.h from David Howells: "The patches contained herein do the following: (1) Remove kernel-only stuff in linux/ppp-comp.h from the UAPI. I checked this with Paul Mackerras before I created the patch and he suggested some extra bits to unexport. (2) Remove linux/blk_types.h entirely from the UAPI as none of it is userspace applicable, and remove from the UAPI that part of linux/fs.h that was the reason for linux/blk_types.h being exported in the first place. I discussed this with Jens Axboe before creating the patch. (3) The big patch of the series to disintegrate include/linux/*.h as a unit. This could be split up, though there would be collisions in moving stuff between the two Kbuild files when the parts are merged as that file is sorted alphabetically rather than being grouped by subsystem. Of this set of headers, 17 files have changed in the UAPI exported region since the 4th and only 8 since the 9th so there isn't much change in this area - as one might expect. It should be pretty obvious and straightforward if it does come to fixing up: stuff in __KERNEL__ guards stays where it is and stuff outside moves to the same file in the include/uapi/linux/ directory. If a new file appears then things get a bit more complicated as the "headers +=" line has to move to include/uapi/linux/Kbuild. Only one new file has appeared since the 9th and I judge this type of event relatively unlikely. (4) A patch to disintegrate include/linux/byteorder/*.h as a unit. Signed-off-by: David Howells <dhowells@redhat.com>" * tag 'disintegrate-main-20121013' of git://git.infradead.org/users/dhowells/linux-headers: UAPI: (Scripted) Disintegrate include/linux/byteorder UAPI: (Scripted) Disintegrate include/linux UAPI: Unexport linux/blk_types.h UAPI: Unexport part of linux/ppp-comp.h
Diffstat (limited to 'include')
-rw-r--r--include/linux/Kbuild380
-rw-r--r--include/linux/a.out.h196
-rw-r--r--include/linux/acct.h108
-rw-r--r--include/linux/adb.h39
-rw-r--r--include/linux/adfs_fs.h42
-rw-r--r--include/linux/agpgart.h86
-rw-r--r--include/linux/apm_bios.h125
-rw-r--r--include/linux/atalk.h43
-rw-r--r--include/linux/atm.h238
-rw-r--r--include/linux/atm_tcp.h54
-rw-r--r--include/linux/atmdev.h213
-rw-r--r--include/linux/audit.h381
-rw-r--r--include/linux/auto_fs.h68
-rw-r--r--include/linux/auxvec.h33
-rw-r--r--include/linux/binfmts.h19
-rw-r--r--include/linux/blktrace_api.h142
-rw-r--r--include/linux/bsg.h63
-rw-r--r--include/linux/byteorder/Kbuild2
-rw-r--r--include/linux/byteorder/big_endian.h103
-rw-r--r--include/linux/byteorder/little_endian.h103
-rw-r--r--include/linux/capability.h346
-rw-r--r--include/linux/cciss_ioctl.h86
-rw-r--r--include/linux/cdrom.h902
-rw-r--r--include/linux/cm4000_cs.h60
-rw-r--r--include/linux/cn_proc.h103
-rw-r--r--include/linux/coda.h680
-rw-r--r--include/linux/coda_psdev.h26
-rw-r--r--include/linux/connector.h56
-rw-r--r--include/linux/cramfs_fs.h86
-rw-r--r--include/linux/cuda.h25
-rw-r--r--include/linux/cyclades.h426
-rw-r--r--include/linux/dccp.h236
-rw-r--r--include/linux/dlm.h62
-rw-r--r--include/linux/dlm_plock.h37
-rw-r--r--include/linux/edd.h158
-rw-r--r--include/linux/elf.h414
-rw-r--r--include/linux/elfcore.h102
-rw-r--r--include/linux/errno.h5
-rw-r--r--include/linux/errqueue.h25
-rw-r--r--include/linux/ethtool.h1076
-rw-r--r--include/linux/eventpoll.h53
-rw-r--r--include/linux/falloc.h7
-rw-r--r--include/linux/fanotify.h114
-rw-r--r--include/linux/fb.h403
-rw-r--r--include/linux/fcntl.h50
-rw-r--r--include/linux/fd.h380
-rw-r--r--include/linux/filter.h133
-rw-r--r--include/linux/flat.h50
-rw-r--r--include/linux/fs.h442
-rw-r--r--include/linux/fsl_hypervisor.h180
-rw-r--r--include/linux/futex.h150
-rw-r--r--include/linux/gameport.h26
-rw-r--r--include/linux/genetlink.h82
-rw-r--r--include/linux/hdlc.h13
-rw-r--r--include/linux/hdlcdrv.h104
-rw-r--r--include/linux/hid.h46
-rw-r--r--include/linux/hiddev.h190
-rw-r--r--include/linux/hidraw.h40
-rw-r--r--include/linux/hpet.h23
-rw-r--r--include/linux/i2c-dev.h49
-rw-r--r--include/linux/i2c.h125
-rw-r--r--include/linux/icmp.h80
-rw-r--r--include/linux/icmpv6.h165
-rw-r--r--include/linux/if_arp.h136
-rw-r--r--include/linux/if_bridge.h89
-rw-r--r--include/linux/if_eql.h36
-rw-r--r--include/linux/if_ether.h115
-rw-r--r--include/linux/if_fddi.h80
-rw-r--r--include/linux/if_frad.h98
-rw-r--r--include/linux/if_link.h427
-rw-r--r--include/linux/if_ltalk.h7
-rw-r--r--include/linux/if_phonet.h7
-rw-r--r--include/linux/if_pppol2tp.h89
-rw-r--r--include/linux/if_pppox.h143
-rw-r--r--include/linux/if_team.h97
-rw-r--r--include/linux/if_tun.h78
-rw-r--r--include/linux/if_tunnel.h94
-rw-r--r--include/linux/if_vlan.h51
-rw-r--r--include/linux/igmp.h113
-rw-r--r--include/linux/in.h235
-rw-r--r--include/linux/in6.h258
-rw-r--r--include/linux/inet_diag.h134
-rw-r--r--include/linux/inotify.h69
-rw-r--r--include/linux/input.h1151
-rw-r--r--include/linux/ip.h119
-rw-r--r--include/linux/ipc.h80
-rw-r--r--include/linux/ipmi.h422
-rw-r--r--include/linux/ipv6.h166
-rw-r--r--include/linux/ipv6_route.h45
-rw-r--r--include/linux/irqnr.h8
-rw-r--r--include/linux/isdn.h130
-rw-r--r--include/linux/isdn_divertif.h18
-rw-r--r--include/linux/isdn_ppp.h55
-rw-r--r--include/linux/isdnif.h43
-rw-r--r--include/linux/joystick.h114
-rw-r--r--include/linux/kd.h181
-rw-r--r--include/linux/kdev_t.h14
-rw-r--r--include/linux/kernel-page-flags.h34
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/kernelcapi.h38
-rw-r--r--include/linux/kexec.h52
-rw-r--r--include/linux/keyboard.h441
-rw-r--r--include/linux/kvm_para.h26
-rw-r--r--include/linux/l2tp.h172
-rw-r--r--include/linux/llc.h74
-rw-r--r--include/linux/loop.h91
-rw-r--r--include/linux/lp.h97
-rw-r--r--include/linux/mdio.h287
-rw-r--r--include/linux/mempolicy.h63
-rw-r--r--include/linux/mii.h154
-rw-r--r--include/linux/mman.h12
-rw-r--r--include/linux/mroute.h146
-rw-r--r--include/linux/mroute6.h138
-rw-r--r--include/linux/msdos_fs.h165
-rw-r--r--include/linux/msg.h74
-rw-r--r--include/linux/n_r3964.h56
-rw-r--r--include/linux/nbd.h63
-rw-r--r--include/linux/net.h39
-rw-r--r--include/linux/netdevice.h32
-rw-r--r--include/linux/netfilter.h72
-rw-r--r--include/linux/netfilter_bridge.h27
-rw-r--r--include/linux/netfilter_ipv4.h80
-rw-r--r--include/linux/netfilter_ipv6.h75
-rw-r--r--include/linux/netlink.h152
-rw-r--r--include/linux/nfs.h124
-rw-r--r--include/linux/nfs3.h92
-rw-r--r--include/linux/nfs4.h166
-rw-r--r--include/linux/nfs_fs.h54
-rw-r--r--include/linux/nfs_idmap.h28
-rw-r--r--include/linux/nfsacl.h23
-rw-r--r--include/linux/nubus.h234
-rw-r--r--include/linux/nvram.h14
-rw-r--r--include/linux/omapfb.h198
-rw-r--r--include/linux/oom.h10
-rw-r--r--include/linux/parport.h89
-rw-r--r--include/linux/patchkey.h24
-rw-r--r--include/linux/pci.h25
-rw-r--r--include/linux/perf_event.h600
-rw-r--r--include/linux/personality.h71
-rw-r--r--include/linux/phonet.h162
-rw-r--r--include/linux/pktcdvd.h99
-rw-r--r--include/linux/pmu.h130
-rw-r--r--include/linux/poll.h6
-rw-r--r--include/linux/ppp-comp.h84
-rw-r--r--include/linux/ppp_defs.h141
-rw-r--r--include/linux/ptrace.h88
-rw-r--r--include/linux/quota.h139
-rw-r--r--include/linux/random.h43
-rw-r--r--include/linux/reboot.h38
-rw-r--r--include/linux/resource.h78
-rw-r--r--include/linux/rfkill.h92
-rw-r--r--include/linux/rtc.h96
-rw-r--r--include/linux/rtnetlink.h611
-rw-r--r--include/linux/scc.h169
-rw-r--r--include/linux/sched.h44
-rw-r--r--include/linux/screen_info.h72
-rw-r--r--include/linux/sdla.h93
-rw-r--r--include/linux/seccomp.h45
-rw-r--r--include/linux/securebits.h51
-rw-r--r--include/linux/sem.h79
-rw-r--r--include/linux/serial.h119
-rw-r--r--include/linux/serial_core.h199
-rw-r--r--include/linux/serio.h76
-rw-r--r--include/linux/shm.h81
-rw-r--r--include/linux/signal.h7
-rw-r--r--include/linux/signalfd.h44
-rw-r--r--include/linux/sock_diag.h24
-rw-r--r--include/linux/socket.h20
-rw-r--r--include/linux/sonet.h58
-rw-r--r--include/linux/sonypi.h110
-rw-r--r--include/linux/sound.h29
-rw-r--r--include/linux/soundcard.h1261
-rw-r--r--include/linux/stat.h46
-rw-r--r--include/linux/stddef.h5
-rw-r--r--include/linux/string.h7
-rw-r--r--include/linux/swab.h280
-rw-r--r--include/linux/synclink.h288
-rw-r--r--include/linux/sysctl.h911
-rw-r--r--include/linux/tcp.h208
-rw-r--r--include/linux/time.h72
-rw-r--r--include/linux/timex.h113
-rw-r--r--include/linux/toshiba.h17
-rw-r--r--include/linux/tty.h37
-rw-r--r--include/linux/types.h50
-rw-r--r--include/linux/udp.h22
-rw-r--r--include/linux/uinput.h109
-rw-r--r--include/linux/uio.h24
-rw-r--r--include/linux/usbdevice_fs.h151
-rw-r--r--include/linux/utsname.h33
-rw-r--r--include/linux/uuid.h37
-rw-r--r--include/linux/vfio.h357
-rw-r--r--include/linux/videodev2.h1940
-rw-r--r--include/linux/virtio_config.h53
-rw-r--r--include/linux/virtio_console.h45
-rw-r--r--include/linux/virtio_ring.h163
-rw-r--r--include/linux/vt.h88
-rw-r--r--include/linux/wait.h20
-rw-r--r--include/linux/wanrouter.h405
-rw-r--r--include/linux/watchdog.h49
-rw-r--r--include/linux/wireless.h1120
-rw-r--r--include/linux/xattr.h54
-rw-r--r--include/uapi/linux/Kbuild393
-rw-r--r--include/uapi/linux/a.out.h274
-rw-r--r--include/uapi/linux/acct.h122
-rw-r--r--include/uapi/linux/adb.h44
-rw-r--r--include/uapi/linux/adfs_fs.h44
-rw-r--r--include/uapi/linux/affs_hardblocks.h (renamed from include/linux/affs_hardblocks.h)0
-rw-r--r--include/uapi/linux/agpgart.h113
-rw-r--r--include/uapi/linux/aio_abi.h (renamed from include/linux/aio_abi.h)0
-rw-r--r--include/uapi/linux/apm_bios.h135
-rw-r--r--include/uapi/linux/arcfb.h (renamed from include/linux/arcfb.h)0
-rw-r--r--include/uapi/linux/atalk.h44
-rw-r--r--include/uapi/linux/atm.h241
-rw-r--r--include/uapi/linux/atm_eni.h (renamed from include/linux/atm_eni.h)0
-rw-r--r--include/uapi/linux/atm_he.h (renamed from include/linux/atm_he.h)0
-rw-r--r--include/uapi/linux/atm_idt77105.h (renamed from include/linux/atm_idt77105.h)0
-rw-r--r--include/uapi/linux/atm_nicstar.h (renamed from include/linux/atm_nicstar.h)0
-rw-r--r--include/uapi/linux/atm_tcp.h61
-rw-r--r--include/uapi/linux/atm_zatm.h (renamed from include/linux/atm_zatm.h)0
-rw-r--r--include/uapi/linux/atmapi.h (renamed from include/linux/atmapi.h)0
-rw-r--r--include/uapi/linux/atmarp.h (renamed from include/linux/atmarp.h)0
-rw-r--r--include/uapi/linux/atmbr2684.h (renamed from include/linux/atmbr2684.h)0
-rw-r--r--include/uapi/linux/atmclip.h (renamed from include/linux/atmclip.h)0
-rw-r--r--include/uapi/linux/atmdev.h215
-rw-r--r--include/uapi/linux/atmioc.h (renamed from include/linux/atmioc.h)0
-rw-r--r--include/uapi/linux/atmlec.h (renamed from include/linux/atmlec.h)0
-rw-r--r--include/uapi/linux/atmmpc.h (renamed from include/linux/atmmpc.h)0
-rw-r--r--include/uapi/linux/atmppp.h (renamed from include/linux/atmppp.h)0
-rw-r--r--include/uapi/linux/atmsap.h (renamed from include/linux/atmsap.h)0
-rw-r--r--include/uapi/linux/atmsvc.h (renamed from include/linux/atmsvc.h)0
-rw-r--r--include/uapi/linux/audit.h404
-rw-r--r--include/uapi/linux/auto_fs.h83
-rw-r--r--include/uapi/linux/auto_fs4.h (renamed from include/linux/auto_fs4.h)0
-rw-r--r--include/uapi/linux/auxvec.h35
-rw-r--r--include/uapi/linux/ax25.h (renamed from include/linux/ax25.h)0
-rw-r--r--include/uapi/linux/b1lli.h (renamed from include/linux/b1lli.h)0
-rw-r--r--include/uapi/linux/baycom.h (renamed from include/linux/baycom.h)0
-rw-r--r--include/uapi/linux/bfs_fs.h (renamed from include/linux/bfs_fs.h)0
-rw-r--r--include/uapi/linux/binfmts.h20
-rw-r--r--include/uapi/linux/blkpg.h (renamed from include/linux/blkpg.h)0
-rw-r--r--include/uapi/linux/blktrace_api.h142
-rw-r--r--include/uapi/linux/bpqether.h (renamed from include/linux/bpqether.h)0
-rw-r--r--include/uapi/linux/bsg.h65
-rw-r--r--include/uapi/linux/byteorder/Kbuild2
-rw-r--r--include/uapi/linux/byteorder/big_endian.h105
-rw-r--r--include/uapi/linux/byteorder/little_endian.h105
-rw-r--r--include/uapi/linux/can.h (renamed from include/linux/can.h)0
-rw-r--r--include/uapi/linux/capability.h358
-rw-r--r--include/uapi/linux/capi.h (renamed from include/linux/capi.h)0
-rw-r--r--include/uapi/linux/cciss_defs.h (renamed from include/linux/cciss_defs.h)0
-rw-r--r--include/uapi/linux/cciss_ioctl.h88
-rw-r--r--include/uapi/linux/cdrom.h912
-rw-r--r--include/uapi/linux/cgroupstats.h (renamed from include/linux/cgroupstats.h)0
-rw-r--r--include/uapi/linux/chio.h (renamed from include/linux/chio.h)0
-rw-r--r--include/uapi/linux/cm4000_cs.h62
-rw-r--r--include/uapi/linux/cn_proc.h121
-rw-r--r--include/uapi/linux/coda.h741
-rw-r--r--include/uapi/linux/coda_psdev.h27
-rw-r--r--include/uapi/linux/coff.h (renamed from include/linux/coff.h)0
-rw-r--r--include/uapi/linux/connector.h77
-rw-r--r--include/uapi/linux/const.h (renamed from include/linux/const.h)0
-rw-r--r--include/uapi/linux/cramfs_fs.h88
-rw-r--r--include/uapi/linux/cuda.h33
-rw-r--r--include/uapi/linux/cyclades.h493
-rw-r--r--include/uapi/linux/cycx_cfm.h (renamed from include/linux/cycx_cfm.h)0
-rw-r--r--include/uapi/linux/dcbnl.h (renamed from include/linux/dcbnl.h)0
-rw-r--r--include/uapi/linux/dccp.h237
-rw-r--r--include/uapi/linux/dlm.h75
-rw-r--r--include/uapi/linux/dlm_device.h (renamed from include/linux/dlm_device.h)0
-rw-r--r--include/uapi/linux/dlm_netlink.h (renamed from include/linux/dlm_netlink.h)0
-rw-r--r--include/uapi/linux/dlm_plock.h45
-rw-r--r--include/uapi/linux/dlmconstants.h (renamed from include/linux/dlmconstants.h)0
-rw-r--r--include/uapi/linux/dm-ioctl.h (renamed from include/linux/dm-ioctl.h)0
-rw-r--r--include/uapi/linux/dm-log-userspace.h (renamed from include/linux/dm-log-userspace.h)0
-rw-r--r--include/uapi/linux/dn.h (renamed from include/linux/dn.h)0
-rw-r--r--include/uapi/linux/dqblk_xfs.h (renamed from include/linux/dqblk_xfs.h)0
-rw-r--r--include/uapi/linux/edd.h191
-rw-r--r--include/uapi/linux/efs_fs_sb.h (renamed from include/linux/efs_fs_sb.h)0
-rw-r--r--include/uapi/linux/elf-em.h (renamed from include/linux/elf-em.h)0
-rw-r--r--include/uapi/linux/elf-fdpic.h (renamed from include/linux/elf-fdpic.h)2
-rw-r--r--include/uapi/linux/elf.h414
-rw-r--r--include/uapi/linux/elfcore.h100
-rw-r--r--include/uapi/linux/errno.h1
-rw-r--r--include/uapi/linux/errqueue.h26
-rw-r--r--include/uapi/linux/ethtool.h1085
-rw-r--r--include/uapi/linux/eventpoll.h66
-rw-r--r--include/uapi/linux/fadvise.h (renamed from include/linux/fadvise.h)0
-rw-r--r--include/uapi/linux/falloc.h9
-rw-r--r--include/uapi/linux/fanotify.h116
-rw-r--r--include/uapi/linux/fb.h402
-rw-r--r--include/uapi/linux/fcntl.h52
-rw-r--r--include/uapi/linux/fd.h382
-rw-r--r--include/uapi/linux/fdreg.h (renamed from include/linux/fdreg.h)0
-rw-r--r--include/uapi/linux/fib_rules.h (renamed from include/linux/fib_rules.h)0
-rw-r--r--include/uapi/linux/fiemap.h (renamed from include/linux/fiemap.h)0
-rw-r--r--include/uapi/linux/filter.h135
-rw-r--r--include/uapi/linux/firewire-cdev.h (renamed from include/linux/firewire-cdev.h)0
-rw-r--r--include/uapi/linux/firewire-constants.h (renamed from include/linux/firewire-constants.h)0
-rw-r--r--include/uapi/linux/flat.h58
-rw-r--r--include/uapi/linux/fs.h334
-rw-r--r--include/uapi/linux/fsl_hypervisor.h220
-rw-r--r--include/uapi/linux/fuse.h (renamed from include/linux/fuse.h)0
-rw-r--r--include/uapi/linux/futex.h152
-rw-r--r--include/uapi/linux/gameport.h28
-rw-r--r--include/uapi/linux/gen_stats.h (renamed from include/linux/gen_stats.h)0
-rw-r--r--include/uapi/linux/genetlink.h84
-rw-r--r--include/uapi/linux/gfs2_ondisk.h (renamed from include/linux/gfs2_ondisk.h)0
-rw-r--r--include/uapi/linux/gigaset_dev.h (renamed from include/linux/gigaset_dev.h)0
-rw-r--r--include/uapi/linux/hdlc.h23
-rw-r--r--include/uapi/linux/hdlcdrv.h110
-rw-r--r--include/uapi/linux/hdreg.h (renamed from include/linux/hdreg.h)0
-rw-r--r--include/uapi/linux/hid.h66
-rw-r--r--include/uapi/linux/hiddev.h212
-rw-r--r--include/uapi/linux/hidraw.h50
-rw-r--r--include/uapi/linux/hpet.h25
-rw-r--r--include/uapi/linux/hysdn_if.h (renamed from include/linux/hysdn_if.h)0
-rw-r--r--include/uapi/linux/i2c-dev.h72
-rw-r--r--include/uapi/linux/i2c.h151
-rw-r--r--include/uapi/linux/i2o-dev.h (renamed from include/linux/i2o-dev.h)0
-rw-r--r--include/uapi/linux/i8k.h (renamed from include/linux/i8k.h)0
-rw-r--r--include/uapi/linux/icmp.h97
-rw-r--r--include/uapi/linux/icmpv6.h164
-rw-r--r--include/uapi/linux/if.h (renamed from include/linux/if.h)0
-rw-r--r--include/uapi/linux/if_addr.h (renamed from include/linux/if_addr.h)0
-rw-r--r--include/uapi/linux/if_addrlabel.h (renamed from include/linux/if_addrlabel.h)0
-rw-r--r--include/uapi/linux/if_alg.h (renamed from include/linux/if_alg.h)0
-rw-r--r--include/uapi/linux/if_arcnet.h (renamed from include/linux/if_arcnet.h)0
-rw-r--r--include/uapi/linux/if_arp.h159
-rw-r--r--include/uapi/linux/if_bonding.h (renamed from include/linux/if_bonding.h)0
-rw-r--r--include/uapi/linux/if_bridge.h101
-rw-r--r--include/uapi/linux/if_cablemodem.h (renamed from include/linux/if_cablemodem.h)0
-rw-r--r--include/uapi/linux/if_eql.h54
-rw-r--r--include/uapi/linux/if_ether.h135
-rw-r--r--include/uapi/linux/if_fc.h (renamed from include/linux/if_fc.h)0
-rw-r--r--include/uapi/linux/if_fddi.h104
-rw-r--r--include/uapi/linux/if_frad.h122
-rw-r--r--include/uapi/linux/if_hippi.h (renamed from include/linux/if_hippi.h)0
-rw-r--r--include/uapi/linux/if_infiniband.h (renamed from include/linux/if_infiniband.h)0
-rw-r--r--include/uapi/linux/if_link.h429
-rw-r--r--include/uapi/linux/if_ltalk.h9
-rw-r--r--include/uapi/linux/if_packet.h (renamed from include/linux/if_packet.h)0
-rw-r--r--include/uapi/linux/if_phonet.h16
-rw-r--r--include/uapi/linux/if_plip.h (renamed from include/linux/if_plip.h)0
-rw-r--r--include/uapi/linux/if_ppp.h (renamed from include/linux/if_ppp.h)0
-rw-r--r--include/uapi/linux/if_pppol2tp.h104
-rw-r--r--include/uapi/linux/if_pppox.h156
-rw-r--r--include/uapi/linux/if_slip.h (renamed from include/linux/if_slip.h)0
-rw-r--r--include/uapi/linux/if_team.h107
-rw-r--r--include/uapi/linux/if_tun.h94
-rw-r--r--include/uapi/linux/if_tunnel.h96
-rw-r--r--include/uapi/linux/if_vlan.h63
-rw-r--r--include/uapi/linux/if_x25.h (renamed from include/linux/if_x25.h)0
-rw-r--r--include/uapi/linux/igmp.h128
-rw-r--r--include/uapi/linux/in.h253
-rw-r--r--include/uapi/linux/in6.h279
-rw-r--r--include/uapi/linux/in_route.h (renamed from include/linux/in_route.h)0
-rw-r--r--include/uapi/linux/inet_diag.h136
-rw-r--r--include/uapi/linux/inotify.h74
-rw-r--r--include/uapi/linux/input.h1153
-rw-r--r--include/uapi/linux/ioctl.h (renamed from include/linux/ioctl.h)0
-rw-r--r--include/uapi/linux/ip.h136
-rw-r--r--include/uapi/linux/ip6_tunnel.h (renamed from include/linux/ip6_tunnel.h)0
-rw-r--r--include/uapi/linux/ip_vs.h (renamed from include/linux/ip_vs.h)0
-rw-r--r--include/uapi/linux/ipc.h81
-rw-r--r--include/uapi/linux/ipmi.h456
-rw-r--r--include/uapi/linux/ipmi_msgdefs.h (renamed from include/linux/ipmi_msgdefs.h)0
-rw-r--r--include/uapi/linux/ipsec.h (renamed from include/linux/ipsec.h)0
-rw-r--r--include/uapi/linux/ipv6.h164
-rw-r--r--include/uapi/linux/ipv6_route.h58
-rw-r--r--include/uapi/linux/ipx.h (renamed from include/linux/ipx.h)0
-rw-r--r--include/uapi/linux/irda.h (renamed from include/linux/irda.h)0
-rw-r--r--include/uapi/linux/irqnr.h0
-rw-r--r--include/uapi/linux/isdn.h143
-rw-r--r--include/uapi/linux/isdn_divertif.h30
-rw-r--r--include/uapi/linux/isdn_ppp.h67
-rw-r--r--include/uapi/linux/isdnif.h56
-rw-r--r--include/uapi/linux/iso_fs.h (renamed from include/linux/iso_fs.h)0
-rw-r--r--include/uapi/linux/ivtv.h (renamed from include/linux/ivtv.h)0
-rw-r--r--include/uapi/linux/ivtvfb.h (renamed from include/linux/ivtvfb.h)0
-rw-r--r--include/uapi/linux/ixjuser.h (renamed from include/linux/ixjuser.h)0
-rw-r--r--include/uapi/linux/jffs2.h (renamed from include/linux/jffs2.h)0
-rw-r--r--include/uapi/linux/joystick.h136
-rw-r--r--include/uapi/linux/kd.h183
-rw-r--r--include/uapi/linux/kdev_t.h13
-rw-r--r--include/uapi/linux/kernel-page-flags.h36
-rw-r--r--include/uapi/linux/kernel.h13
-rw-r--r--include/uapi/linux/kernelcapi.h47
-rw-r--r--include/uapi/linux/kexec.h54
-rw-r--r--include/uapi/linux/keyboard.h443
-rw-r--r--include/uapi/linux/keyctl.h (renamed from include/linux/keyctl.h)0
-rw-r--r--include/uapi/linux/kvm.h (renamed from include/linux/kvm.h)0
-rw-r--r--include/uapi/linux/kvm_para.h28
-rw-r--r--include/uapi/linux/l2tp.h180
-rw-r--r--include/uapi/linux/limits.h (renamed from include/linux/limits.h)0
-rw-r--r--include/uapi/linux/llc.h84
-rw-r--r--include/uapi/linux/loop.h94
-rw-r--r--include/uapi/linux/lp.h100
-rw-r--r--include/uapi/linux/magic.h (renamed from include/linux/magic.h)0
-rw-r--r--include/uapi/linux/major.h (renamed from include/linux/major.h)0
-rw-r--r--include/uapi/linux/map_to_7segment.h (renamed from include/linux/map_to_7segment.h)0
-rw-r--r--include/uapi/linux/matroxfb.h (renamed from include/linux/matroxfb.h)0
-rw-r--r--include/uapi/linux/mdio.h297
-rw-r--r--include/uapi/linux/media.h (renamed from include/linux/media.h)0
-rw-r--r--include/uapi/linux/mei.h (renamed from include/linux/mei.h)0
-rw-r--r--include/uapi/linux/mempolicy.h64
-rw-r--r--include/uapi/linux/meye.h (renamed from include/linux/meye.h)0
-rw-r--r--include/uapi/linux/mii.h161
-rw-r--r--include/uapi/linux/minix_fs.h (renamed from include/linux/minix_fs.h)0
-rw-r--r--include/uapi/linux/mman.h13
-rw-r--r--include/uapi/linux/mmtimer.h (renamed from include/linux/mmtimer.h)0
-rw-r--r--include/uapi/linux/mqueue.h (renamed from include/linux/mqueue.h)0
-rw-r--r--include/uapi/linux/mroute.h143
-rw-r--r--include/uapi/linux/mroute6.h137
-rw-r--r--include/uapi/linux/msdos_fs.h167
-rw-r--r--include/uapi/linux/msg.h75
-rw-r--r--include/uapi/linux/mtio.h (renamed from include/linux/mtio.h)0
-rw-r--r--include/uapi/linux/n_r3964.h98
-rw-r--r--include/uapi/linux/nbd.h77
-rw-r--r--include/uapi/linux/ncp.h (renamed from include/linux/ncp.h)0
-rw-r--r--include/uapi/linux/ncp_fs.h (renamed from include/linux/ncp_fs.h)0
-rw-r--r--include/uapi/linux/ncp_mount.h (renamed from include/linux/ncp_mount.h)0
-rw-r--r--include/uapi/linux/ncp_no.h (renamed from include/linux/ncp_no.h)0
-rw-r--r--include/uapi/linux/neighbour.h (renamed from include/linux/neighbour.h)0
-rw-r--r--include/uapi/linux/net.h57
-rw-r--r--include/uapi/linux/net_dropmon.h (renamed from include/linux/net_dropmon.h)0
-rw-r--r--include/uapi/linux/net_tstamp.h (renamed from include/linux/net_tstamp.h)0
-rw-r--r--include/uapi/linux/netdevice.h53
-rw-r--r--include/uapi/linux/netfilter.h72
-rw-r--r--include/uapi/linux/netfilter_arp.h (renamed from include/linux/netfilter_arp.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge.h27
-rw-r--r--include/uapi/linux/netfilter_decnet.h (renamed from include/linux/netfilter_decnet.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4.h81
-rw-r--r--include/uapi/linux/netfilter_ipv6.h79
-rw-r--r--include/uapi/linux/netlink.h153
-rw-r--r--include/uapi/linux/netrom.h (renamed from include/linux/netrom.h)0
-rw-r--r--include/uapi/linux/nfc.h (renamed from include/linux/nfc.h)0
-rw-r--r--include/uapi/linux/nfs.h131
-rw-r--r--include/uapi/linux/nfs2.h (renamed from include/linux/nfs2.h)0
-rw-r--r--include/uapi/linux/nfs3.h97
-rw-r--r--include/uapi/linux/nfs4.h178
-rw-r--r--include/uapi/linux/nfs4_mount.h (renamed from include/linux/nfs4_mount.h)0
-rw-r--r--include/uapi/linux/nfs_fs.h61
-rw-r--r--include/uapi/linux/nfs_idmap.h65
-rw-r--r--include/uapi/linux/nfs_mount.h (renamed from include/linux/nfs_mount.h)0
-rw-r--r--include/uapi/linux/nfsacl.h29
-rw-r--r--include/uapi/linux/nl80211.h (renamed from include/linux/nl80211.h)0
-rw-r--r--include/uapi/linux/nubus.h244
-rw-r--r--include/uapi/linux/nvram.h16
-rw-r--r--include/uapi/linux/omap3isp.h (renamed from include/linux/omap3isp.h)0
-rw-r--r--include/uapi/linux/omapfb.h222
-rw-r--r--include/uapi/linux/oom.h11
-rw-r--r--include/uapi/linux/packet_diag.h (renamed from include/linux/packet_diag.h)0
-rw-r--r--include/uapi/linux/param.h (renamed from include/linux/param.h)0
-rw-r--r--include/uapi/linux/parport.h95
-rw-r--r--include/uapi/linux/patchkey.h37
-rw-r--r--include/uapi/linux/pci.h41
-rw-r--r--include/uapi/linux/pci_regs.h (renamed from include/linux/pci_regs.h)0
-rw-r--r--include/uapi/linux/perf_event.h615
-rw-r--r--include/uapi/linux/personality.h69
-rw-r--r--include/uapi/linux/pfkeyv2.h (renamed from include/linux/pfkeyv2.h)0
-rw-r--r--include/uapi/linux/pg.h (renamed from include/linux/pg.h)0
-rw-r--r--include/uapi/linux/phantom.h (renamed from include/linux/phantom.h)0
-rw-r--r--include/uapi/linux/phonet.h185
-rw-r--r--include/uapi/linux/pkt_cls.h (renamed from include/linux/pkt_cls.h)0
-rw-r--r--include/uapi/linux/pkt_sched.h (renamed from include/linux/pkt_sched.h)0
-rw-r--r--include/uapi/linux/pktcdvd.h111
-rw-r--r--include/uapi/linux/pmu.h139
-rw-r--r--include/uapi/linux/poll.h1
-rw-r--r--include/uapi/linux/posix_types.h (renamed from include/linux/posix_types.h)0
-rw-r--r--include/uapi/linux/ppdev.h (renamed from include/linux/ppdev.h)0
-rw-r--r--include/uapi/linux/ppp-comp.h93
-rw-r--r--include/uapi/linux/ppp-ioctl.h (renamed from include/linux/ppp-ioctl.h)0
-rw-r--r--include/uapi/linux/ppp_defs.h150
-rw-r--r--include/uapi/linux/pps.h (renamed from include/linux/pps.h)0
-rw-r--r--include/uapi/linux/prctl.h (renamed from include/linux/prctl.h)0
-rw-r--r--include/uapi/linux/ptp_clock.h (renamed from include/linux/ptp_clock.h)0
-rw-r--r--include/uapi/linux/ptrace.h81
-rw-r--r--include/uapi/linux/qnx4_fs.h (renamed from include/linux/qnx4_fs.h)0
-rw-r--r--include/uapi/linux/qnxtypes.h (renamed from include/linux/qnxtypes.h)0
-rw-r--r--include/uapi/linux/quota.h171
-rw-r--r--include/uapi/linux/radeonfb.h (renamed from include/linux/radeonfb.h)0
-rw-r--r--include/uapi/linux/random.h50
-rw-r--r--include/uapi/linux/raw.h (renamed from include/linux/raw.h)0
-rw-r--r--include/uapi/linux/rds.h (renamed from include/linux/rds.h)0
-rw-r--r--include/uapi/linux/reboot.h39
-rw-r--r--include/uapi/linux/reiserfs_fs.h (renamed from include/linux/reiserfs_fs.h)0
-rw-r--r--include/uapi/linux/reiserfs_xattr.h (renamed from include/linux/reiserfs_xattr.h)0
-rw-r--r--include/uapi/linux/resource.h80
-rw-r--r--include/uapi/linux/rfkill.h107
-rw-r--r--include/uapi/linux/romfs_fs.h (renamed from include/linux/romfs_fs.h)0
-rw-r--r--include/uapi/linux/rose.h (renamed from include/linux/rose.h)0
-rw-r--r--include/uapi/linux/route.h (renamed from include/linux/route.h)0
-rw-r--r--include/uapi/linux/rtc.h107
-rw-r--r--include/uapi/linux/rtnetlink.h612
-rw-r--r--include/uapi/linux/scc.h172
-rw-r--r--include/uapi/linux/sched.h46
-rw-r--r--include/uapi/linux/screen_info.h74
-rw-r--r--include/uapi/linux/sdla.h116
-rw-r--r--include/uapi/linux/seccomp.h47
-rw-r--r--include/uapi/linux/securebits.h51
-rw-r--r--include/uapi/linux/selinux_netlink.h (renamed from include/linux/selinux_netlink.h)0
-rw-r--r--include/uapi/linux/sem.h80
-rw-r--r--include/uapi/linux/serial.h126
-rw-r--r--include/uapi/linux/serial_core.h219
-rw-r--r--include/uapi/linux/serial_reg.h (renamed from include/linux/serial_reg.h)0
-rw-r--r--include/uapi/linux/serio.h80
-rw-r--r--include/uapi/linux/shm.h79
-rw-r--r--include/uapi/linux/signal.h8
-rw-r--r--include/uapi/linux/signalfd.h52
-rw-r--r--include/uapi/linux/snmp.h (renamed from include/linux/snmp.h)0
-rw-r--r--include/uapi/linux/sock_diag.h26
-rw-r--r--include/uapi/linux/socket.h21
-rw-r--r--include/uapi/linux/sockios.h (renamed from include/linux/sockios.h)0
-rw-r--r--include/uapi/linux/som.h (renamed from include/linux/som.h)0
-rw-r--r--include/uapi/linux/sonet.h60
-rw-r--r--include/uapi/linux/sonypi.h146
-rw-r--r--include/uapi/linux/sound.h31
-rw-r--r--include/uapi/linux/soundcard.h1282
-rw-r--r--include/uapi/linux/stat.h45
-rw-r--r--include/uapi/linux/stddef.h1
-rw-r--r--include/uapi/linux/string.h9
-rw-r--r--include/uapi/linux/suspend_ioctls.h (renamed from include/linux/suspend_ioctls.h)0
-rw-r--r--include/uapi/linux/swab.h282
-rw-r--r--include/uapi/linux/synclink.h300
-rw-r--r--include/uapi/linux/sysctl.h932
-rw-r--r--include/uapi/linux/sysinfo.h (renamed from include/linux/sysinfo.h)0
-rw-r--r--include/uapi/linux/taskstats.h (renamed from include/linux/taskstats.h)0
-rw-r--r--include/uapi/linux/tcp.h225
-rw-r--r--include/uapi/linux/tcp_metrics.h (renamed from include/linux/tcp_metrics.h)0
-rw-r--r--include/uapi/linux/telephony.h (renamed from include/linux/telephony.h)0
-rw-r--r--include/uapi/linux/termios.h (renamed from include/linux/termios.h)0
-rw-r--r--include/uapi/linux/time.h71
-rw-r--r--include/uapi/linux/times.h (renamed from include/linux/times.h)0
-rw-r--r--include/uapi/linux/timex.h166
-rw-r--r--include/uapi/linux/tiocl.h (renamed from include/linux/tiocl.h)0
-rw-r--r--include/uapi/linux/tipc.h (renamed from include/linux/tipc.h)0
-rw-r--r--include/uapi/linux/tipc_config.h (renamed from include/linux/tipc_config.h)0
-rw-r--r--include/uapi/linux/toshiba.h37
-rw-r--r--include/uapi/linux/tty.h38
-rw-r--r--include/uapi/linux/tty_flags.h (renamed from include/linux/tty_flags.h)0
-rw-r--r--include/uapi/linux/types.h56
-rw-r--r--include/uapi/linux/udf_fs_i.h (renamed from include/linux/udf_fs_i.h)0
-rw-r--r--include/uapi/linux/udp.h39
-rw-r--r--include/uapi/linux/uhid.h (renamed from include/linux/uhid.h)0
-rw-r--r--include/uapi/linux/uinput.h137
-rw-r--r--include/uapi/linux/uio.h30
-rw-r--r--include/uapi/linux/ultrasound.h (renamed from include/linux/ultrasound.h)0
-rw-r--r--include/uapi/linux/un.h (renamed from include/linux/un.h)0
-rw-r--r--include/uapi/linux/unistd.h (renamed from include/linux/unistd.h)0
-rw-r--r--include/uapi/linux/unix_diag.h (renamed from include/linux/unix_diag.h)0
-rw-r--r--include/uapi/linux/usbdevice_fs.h180
-rw-r--r--include/uapi/linux/utime.h (renamed from include/linux/utime.h)0
-rw-r--r--include/uapi/linux/utsname.h34
-rw-r--r--include/uapi/linux/uuid.h58
-rw-r--r--include/uapi/linux/uvcvideo.h (renamed from include/linux/uvcvideo.h)0
-rw-r--r--include/uapi/linux/v4l2-common.h (renamed from include/linux/v4l2-common.h)0
-rw-r--r--include/uapi/linux/v4l2-controls.h (renamed from include/linux/v4l2-controls.h)0
-rw-r--r--include/uapi/linux/v4l2-dv-timings.h (renamed from include/linux/v4l2-dv-timings.h)0
-rw-r--r--include/uapi/linux/v4l2-mediabus.h (renamed from include/linux/v4l2-mediabus.h)0
-rw-r--r--include/uapi/linux/v4l2-subdev.h (renamed from include/linux/v4l2-subdev.h)0
-rw-r--r--include/uapi/linux/veth.h (renamed from include/linux/veth.h)0
-rw-r--r--include/uapi/linux/vfio.h368
-rw-r--r--include/uapi/linux/vhost.h (renamed from include/linux/vhost.h)0
-rw-r--r--include/uapi/linux/videodev2.h1998
-rw-r--r--include/uapi/linux/virtio_9p.h (renamed from include/linux/virtio_9p.h)0
-rw-r--r--include/uapi/linux/virtio_balloon.h (renamed from include/linux/virtio_balloon.h)0
-rw-r--r--include/uapi/linux/virtio_blk.h (renamed from include/linux/virtio_blk.h)0
-rw-r--r--include/uapi/linux/virtio_config.h54
-rw-r--r--include/uapi/linux/virtio_console.h74
-rw-r--r--include/uapi/linux/virtio_ids.h (renamed from include/linux/virtio_ids.h)0
-rw-r--r--include/uapi/linux/virtio_net.h (renamed from include/linux/virtio_net.h)0
-rw-r--r--include/uapi/linux/virtio_pci.h (renamed from include/linux/virtio_pci.h)0
-rw-r--r--include/uapi/linux/virtio_ring.h163
-rw-r--r--include/uapi/linux/virtio_rng.h (renamed from include/linux/virtio_rng.h)0
-rw-r--r--include/uapi/linux/vt.h90
-rw-r--r--include/uapi/linux/wait.h21
-rw-r--r--include/uapi/linux/wanrouter.h452
-rw-r--r--include/uapi/linux/watchdog.h57
-rw-r--r--include/uapi/linux/wimax.h (renamed from include/linux/wimax.h)0
-rw-r--r--include/uapi/linux/wireless.h1128
-rw-r--r--include/uapi/linux/x25.h (renamed from include/linux/x25.h)0
-rw-r--r--include/uapi/linux/xattr.h64
-rw-r--r--include/uapi/linux/xfrm.h (renamed from include/linux/xfrm.h)0
583 files changed, 32927 insertions, 30366 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index d114db9477f..5b57367e28d 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -22,390 +22,10 @@ header-y += wimax/
22 22
23ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ 23ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
24 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),) 24 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
25header-y += a.out.h
26endif 25endif
27ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ 26ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
28 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),) 27 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
29header-y += kvm.h
30endif 28endif
31ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ 29ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
32 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),) 30 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
33header-y += kvm_para.h
34endif 31endif
35
36header-y += acct.h
37header-y += adb.h
38header-y += adfs_fs.h
39header-y += affs_hardblocks.h
40header-y += agpgart.h
41header-y += aio_abi.h
42header-y += apm_bios.h
43header-y += arcfb.h
44header-y += atalk.h
45header-y += atm.h
46header-y += atm_eni.h
47header-y += atm_he.h
48header-y += atm_idt77105.h
49header-y += atm_nicstar.h
50header-y += atm_tcp.h
51header-y += atm_zatm.h
52header-y += atmapi.h
53header-y += atmarp.h
54header-y += atmbr2684.h
55header-y += atmclip.h
56header-y += atmdev.h
57header-y += atmioc.h
58header-y += atmlec.h
59header-y += atmmpc.h
60header-y += atmppp.h
61header-y += atmsap.h
62header-y += atmsvc.h
63header-y += audit.h
64header-y += auto_fs.h
65header-y += auto_fs4.h
66header-y += auxvec.h
67header-y += ax25.h
68header-y += b1lli.h
69header-y += baycom.h
70header-y += bfs_fs.h
71header-y += binfmts.h
72header-y += blk_types.h
73header-y += blkpg.h
74header-y += blktrace_api.h
75header-y += bpqether.h
76header-y += bsg.h
77header-y += can.h
78header-y += capability.h
79header-y += capi.h
80header-y += cciss_defs.h
81header-y += cciss_ioctl.h
82header-y += cdrom.h
83header-y += cgroupstats.h
84header-y += chio.h
85header-y += cm4000_cs.h
86header-y += cn_proc.h
87header-y += coda.h
88header-y += coda_psdev.h
89header-y += coff.h
90header-y += connector.h
91header-y += const.h
92header-y += cramfs_fs.h
93header-y += cuda.h
94header-y += cyclades.h
95header-y += cycx_cfm.h
96header-y += dcbnl.h
97header-y += dccp.h
98header-y += dlm.h
99header-y += dlm_device.h
100header-y += dlm_netlink.h
101header-y += dlm_plock.h
102header-y += dlmconstants.h
103header-y += dm-ioctl.h
104header-y += dm-log-userspace.h
105header-y += dn.h
106header-y += dqblk_xfs.h
107header-y += edd.h
108header-y += efs_fs_sb.h
109header-y += elf-em.h
110header-y += elf-fdpic.h
111header-y += elf.h
112header-y += elfcore.h
113header-y += errno.h
114header-y += errqueue.h
115header-y += ethtool.h
116header-y += eventpoll.h
117header-y += fadvise.h
118header-y += falloc.h
119header-y += fanotify.h
120header-y += fb.h
121header-y += fcntl.h
122header-y += fd.h
123header-y += fdreg.h
124header-y += fib_rules.h
125header-y += fiemap.h
126header-y += filter.h
127header-y += firewire-cdev.h
128header-y += firewire-constants.h
129header-y += flat.h
130header-y += fs.h
131header-y += fsl_hypervisor.h
132header-y += fuse.h
133header-y += futex.h
134header-y += gameport.h
135header-y += gen_stats.h
136header-y += genetlink.h
137header-y += gfs2_ondisk.h
138header-y += gigaset_dev.h
139header-y += hdlc.h
140header-y += hdlcdrv.h
141header-y += hdreg.h
142header-y += hid.h
143header-y += hiddev.h
144header-y += hidraw.h
145header-y += hpet.h
146header-y += hysdn_if.h
147header-y += i2c-dev.h
148header-y += i2c.h
149header-y += i2o-dev.h
150header-y += i8k.h
151header-y += icmp.h
152header-y += icmpv6.h
153header-y += if.h
154header-y += if_addr.h
155header-y += if_addrlabel.h
156header-y += if_alg.h
157header-y += if_arcnet.h
158header-y += if_arp.h
159header-y += if_bonding.h
160header-y += if_bridge.h
161header-y += if_cablemodem.h
162header-y += if_eql.h
163header-y += if_ether.h
164header-y += if_fc.h
165header-y += if_fddi.h
166header-y += if_frad.h
167header-y += if_hippi.h
168header-y += if_infiniband.h
169header-y += if_link.h
170header-y += if_ltalk.h
171header-y += if_packet.h
172header-y += if_phonet.h
173header-y += if_plip.h
174header-y += if_ppp.h
175header-y += if_pppol2tp.h
176header-y += if_pppox.h
177header-y += if_slip.h
178header-y += if_team.h
179header-y += if_tun.h
180header-y += if_tunnel.h
181header-y += if_vlan.h
182header-y += if_x25.h
183header-y += igmp.h
184header-y += in.h
185header-y += in6.h
186header-y += in_route.h
187header-y += sock_diag.h
188header-y += inet_diag.h
189header-y += unix_diag.h
190header-y += packet_diag.h
191header-y += inotify.h
192header-y += input.h
193header-y += ioctl.h
194header-y += ip.h
195header-y += ip6_tunnel.h
196header-y += ip_vs.h
197header-y += ipc.h
198header-y += ipmi.h
199header-y += ipmi_msgdefs.h
200header-y += ipsec.h
201header-y += ipv6.h
202header-y += ipv6_route.h
203header-y += ipx.h
204header-y += irda.h
205header-y += irqnr.h
206header-y += isdn.h
207header-y += isdn_divertif.h
208header-y += isdn_ppp.h
209header-y += isdnif.h
210header-y += iso_fs.h
211header-y += ivtv.h
212header-y += ivtvfb.h
213header-y += ixjuser.h
214header-y += jffs2.h
215header-y += joystick.h
216header-y += kd.h
217header-y += kdev_t.h
218header-y += kernel.h
219header-y += kernelcapi.h
220header-y += kernel-page-flags.h
221header-y += kexec.h
222header-y += keyboard.h
223header-y += keyctl.h
224header-y += l2tp.h
225header-y += limits.h
226header-y += llc.h
227header-y += loop.h
228header-y += lp.h
229header-y += magic.h
230header-y += major.h
231header-y += map_to_7segment.h
232header-y += matroxfb.h
233header-y += mdio.h
234header-y += media.h
235header-y += mei.h
236header-y += mempolicy.h
237header-y += meye.h
238header-y += mii.h
239header-y += minix_fs.h
240header-y += mman.h
241header-y += mmtimer.h
242header-y += mqueue.h
243header-y += mroute.h
244header-y += mroute6.h
245header-y += msdos_fs.h
246header-y += msg.h
247header-y += mtio.h
248header-y += n_r3964.h
249header-y += nbd.h
250header-y += ncp.h
251header-y += ncp_fs.h
252header-y += ncp_mount.h
253header-y += ncp_no.h
254header-y += neighbour.h
255header-y += net.h
256header-y += net_dropmon.h
257header-y += net_tstamp.h
258header-y += netdevice.h
259header-y += netfilter.h
260header-y += netfilter_arp.h
261header-y += netfilter_bridge.h
262header-y += netfilter_decnet.h
263header-y += netfilter_ipv4.h
264header-y += netfilter_ipv6.h
265header-y += netlink.h
266header-y += netrom.h
267header-y += nfc.h
268header-y += nfs.h
269header-y += nfs2.h
270header-y += nfs3.h
271header-y += nfs4.h
272header-y += nfs4_mount.h
273header-y += nfs_fs.h
274header-y += nfs_idmap.h
275header-y += nfs_mount.h
276header-y += nfsacl.h
277header-y += nl80211.h
278header-y += nubus.h
279header-y += nvram.h
280header-y += omap3isp.h
281header-y += omapfb.h
282header-y += oom.h
283header-y += param.h
284header-y += parport.h
285header-y += patchkey.h
286header-y += pci.h
287header-y += pci_regs.h
288header-y += perf_event.h
289header-y += personality.h
290header-y += pfkeyv2.h
291header-y += pg.h
292header-y += phantom.h
293header-y += phonet.h
294header-y += pkt_cls.h
295header-y += pkt_sched.h
296header-y += pktcdvd.h
297header-y += pmu.h
298header-y += poll.h
299header-y += posix_types.h
300header-y += ppdev.h
301header-y += ppp-comp.h
302header-y += ppp-ioctl.h
303header-y += ppp_defs.h
304header-y += pps.h
305header-y += prctl.h
306header-y += ptp_clock.h
307header-y += ptrace.h
308header-y += qnx4_fs.h
309header-y += qnxtypes.h
310header-y += quota.h
311header-y += radeonfb.h
312header-y += random.h
313header-y += raw.h
314header-y += rds.h
315header-y += reboot.h
316header-y += reiserfs_fs.h
317header-y += reiserfs_xattr.h
318header-y += resource.h
319header-y += rfkill.h
320header-y += romfs_fs.h
321header-y += rose.h
322header-y += route.h
323header-y += rtc.h
324header-y += rtnetlink.h
325header-y += scc.h
326header-y += sched.h
327header-y += screen_info.h
328header-y += sdla.h
329header-y += seccomp.h
330header-y += securebits.h
331header-y += selinux_netlink.h
332header-y += sem.h
333header-y += serial.h
334header-y += serial_core.h
335header-y += serial_reg.h
336header-y += serio.h
337header-y += shm.h
338header-y += signal.h
339header-y += signalfd.h
340header-y += snmp.h
341header-y += socket.h
342header-y += sockios.h
343header-y += som.h
344header-y += sonet.h
345header-y += sonypi.h
346header-y += sound.h
347header-y += soundcard.h
348header-y += stat.h
349header-y += stddef.h
350header-y += string.h
351header-y += suspend_ioctls.h
352header-y += swab.h
353header-y += synclink.h
354header-y += sysctl.h
355header-y += sysinfo.h
356header-y += taskstats.h
357header-y += tcp.h
358header-y += tcp_metrics.h
359header-y += telephony.h
360header-y += termios.h
361header-y += time.h
362header-y += times.h
363header-y += timex.h
364header-y += tiocl.h
365header-y += tipc.h
366header-y += tipc_config.h
367header-y += toshiba.h
368header-y += tty.h
369header-y += tty_flags.h
370header-y += types.h
371header-y += udf_fs_i.h
372header-y += udp.h
373header-y += uhid.h
374header-y += uinput.h
375header-y += uio.h
376header-y += ultrasound.h
377header-y += un.h
378header-y += unistd.h
379header-y += usbdevice_fs.h
380header-y += utime.h
381header-y += utsname.h
382header-y += uuid.h
383header-y += uvcvideo.h
384header-y += v4l2-common.h
385header-y += v4l2-controls.h
386header-y += v4l2-dv-timings.h
387header-y += v4l2-mediabus.h
388header-y += v4l2-subdev.h
389header-y += veth.h
390header-y += vfio.h
391header-y += vhost.h
392header-y += videodev2.h
393header-y += virtio_9p.h
394header-y += virtio_balloon.h
395header-y += virtio_blk.h
396header-y += virtio_config.h
397header-y += virtio_console.h
398header-y += virtio_ids.h
399header-y += virtio_net.h
400header-y += virtio_pci.h
401header-y += virtio_ring.h
402header-y += virtio_rng.h
403header-y += vt.h
404header-y += wait.h
405header-y += wanrouter.h
406header-y += watchdog.h
407header-y += wimax.h
408header-y += wireless.h
409header-y += x25.h
410header-y += xattr.h
411header-y += xfrm.h
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index e86dfca4458..220f1433889 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -1,278 +1,84 @@
1#ifndef __A_OUT_GNU_H__ 1#ifndef __A_OUT_GNU_H__
2#define __A_OUT_GNU_H__ 2#define __A_OUT_GNU_H__
3 3
4#define __GNU_EXEC_MACROS__ 4#include <uapi/linux/a.out.h>
5
6#ifndef __STRUCT_EXEC_OVERRIDE__
7
8#include <asm/a.out.h>
9
10#endif /* __STRUCT_EXEC_OVERRIDE__ */
11 5
12#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
13
14/* these go in the N_MACHTYPE field */
15enum machine_type {
16#if defined (M_OLDSUN2) 7#if defined (M_OLDSUN2)
17 M__OLDSUN2 = M_OLDSUN2,
18#else 8#else
19 M_OLDSUN2 = 0,
20#endif 9#endif
21#if defined (M_68010) 10#if defined (M_68010)
22 M__68010 = M_68010,
23#else 11#else
24 M_68010 = 1,
25#endif 12#endif
26#if defined (M_68020) 13#if defined (M_68020)
27 M__68020 = M_68020,
28#else 14#else
29 M_68020 = 2,
30#endif 15#endif
31#if defined (M_SPARC) 16#if defined (M_SPARC)
32 M__SPARC = M_SPARC,
33#else 17#else
34 M_SPARC = 3,
35#endif 18#endif
36 /* skip a bunch so we don't run into any of sun's numbers */
37 M_386 = 100,
38 M_MIPS1 = 151, /* MIPS R3000/R3000 binary */
39 M_MIPS2 = 152 /* MIPS R6000/R4000 binary */
40};
41
42#if !defined (N_MAGIC) 19#if !defined (N_MAGIC)
43#define N_MAGIC(exec) ((exec).a_info & 0xffff)
44#endif 20#endif
45#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
46#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
47#define N_SET_INFO(exec, magic, type, flags) \
48 ((exec).a_info = ((magic) & 0xffff) \
49 | (((int)(type) & 0xff) << 16) \
50 | (((flags) & 0xff) << 24))
51#define N_SET_MAGIC(exec, magic) \
52 ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
53
54#define N_SET_MACHTYPE(exec, machtype) \
55 ((exec).a_info = \
56 ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
57
58#define N_SET_FLAGS(exec, flags) \
59 ((exec).a_info = \
60 ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
61
62/* Code indicating object file or impure executable. */
63#define OMAGIC 0407
64/* Code indicating pure executable. */
65#define NMAGIC 0410
66/* Code indicating demand-paged executable. */
67#define ZMAGIC 0413
68/* This indicates a demand-paged executable with the header in the text.
69 The first page is unmapped to help trap NULL pointer references */
70#define QMAGIC 0314
71
72/* Code indicating core file. */
73#define CMAGIC 0421
74
75#if !defined (N_BADMAG) 21#if !defined (N_BADMAG)
76#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
77 && N_MAGIC(x) != NMAGIC \
78 && N_MAGIC(x) != ZMAGIC \
79 && N_MAGIC(x) != QMAGIC)
80#endif 22#endif
81
82#define _N_HDROFF(x) (1024 - sizeof (struct exec))
83
84#if !defined (N_TXTOFF) 23#if !defined (N_TXTOFF)
85#define N_TXTOFF(x) \
86 (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
87 (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
88#endif 24#endif
89
90#if !defined (N_DATOFF) 25#if !defined (N_DATOFF)
91#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
92#endif 26#endif
93
94#if !defined (N_TRELOFF) 27#if !defined (N_TRELOFF)
95#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
96#endif 28#endif
97
98#if !defined (N_DRELOFF) 29#if !defined (N_DRELOFF)
99#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
100#endif 30#endif
101
102#if !defined (N_SYMOFF) 31#if !defined (N_SYMOFF)
103#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
104#endif 32#endif
105
106#if !defined (N_STROFF) 33#if !defined (N_STROFF)
107#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
108#endif 34#endif
109
110/* Address of text segment in memory after it is loaded. */
111#if !defined (N_TXTADDR) 35#if !defined (N_TXTADDR)
112#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
113#endif 36#endif
114
115/* Address of data segment in memory after it is loaded.
116 Note that it is up to you to define SEGMENT_SIZE
117 on machines not listed here. */
118#if defined(vax) || defined(hp300) || defined(pyr) 37#if defined(vax) || defined(hp300) || defined(pyr)
119#define SEGMENT_SIZE page_size
120#endif 38#endif
121#ifdef sony 39#ifdef sony
122#define SEGMENT_SIZE 0x2000
123#endif /* Sony. */ 40#endif /* Sony. */
124#ifdef is68k 41#ifdef is68k
125#define SEGMENT_SIZE 0x20000
126#endif 42#endif
127#if defined(m68k) && defined(PORTAR) 43#if defined(m68k) && defined(PORTAR)
128#define PAGE_SIZE 0x400
129#define SEGMENT_SIZE PAGE_SIZE
130#endif 44#endif
131
132#ifdef linux 45#ifdef linux
133#ifdef __KERNEL__
134#include <asm/page.h> 46#include <asm/page.h>
135#else
136#include <unistd.h>
137#endif
138#if defined(__i386__) || defined(__mc68000__) 47#if defined(__i386__) || defined(__mc68000__)
139#define SEGMENT_SIZE 1024
140#else 48#else
141#ifndef SEGMENT_SIZE 49#ifndef SEGMENT_SIZE
142#ifdef __KERNEL__
143#define SEGMENT_SIZE PAGE_SIZE 50#define SEGMENT_SIZE PAGE_SIZE
144#else
145#define SEGMENT_SIZE getpagesize()
146#endif
147#endif 51#endif
148#endif 52#endif
149#endif 53#endif
150
151#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
152
153#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
154
155#ifndef N_DATADDR 54#ifndef N_DATADDR
156#define N_DATADDR(x) \
157 (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
158 : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
159#endif 55#endif
160
161/* Address of bss segment in memory after it is loaded. */
162#if !defined (N_BSSADDR) 56#if !defined (N_BSSADDR)
163#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
164#endif 57#endif
165
166#if !defined (N_NLIST_DECLARED) 58#if !defined (N_NLIST_DECLARED)
167struct nlist {
168 union {
169 char *n_name;
170 struct nlist *n_next;
171 long n_strx;
172 } n_un;
173 unsigned char n_type;
174 char n_other;
175 short n_desc;
176 unsigned long n_value;
177};
178#endif /* no N_NLIST_DECLARED. */ 59#endif /* no N_NLIST_DECLARED. */
179
180#if !defined (N_UNDF) 60#if !defined (N_UNDF)
181#define N_UNDF 0
182#endif 61#endif
183#if !defined (N_ABS) 62#if !defined (N_ABS)
184#define N_ABS 2
185#endif 63#endif
186#if !defined (N_TEXT) 64#if !defined (N_TEXT)
187#define N_TEXT 4
188#endif 65#endif
189#if !defined (N_DATA) 66#if !defined (N_DATA)
190#define N_DATA 6
191#endif 67#endif
192#if !defined (N_BSS) 68#if !defined (N_BSS)
193#define N_BSS 8
194#endif 69#endif
195#if !defined (N_FN) 70#if !defined (N_FN)
196#define N_FN 15
197#endif 71#endif
198
199#if !defined (N_EXT) 72#if !defined (N_EXT)
200#define N_EXT 1
201#endif 73#endif
202#if !defined (N_TYPE) 74#if !defined (N_TYPE)
203#define N_TYPE 036
204#endif 75#endif
205#if !defined (N_STAB) 76#if !defined (N_STAB)
206#define N_STAB 0340
207#endif 77#endif
208
209/* The following type indicates the definition of a symbol as being
210 an indirect reference to another symbol. The other symbol
211 appears as an undefined reference, immediately following this symbol.
212
213 Indirection is asymmetrical. The other symbol's value will be used
214 to satisfy requests for the indirect symbol, but not vice versa.
215 If the other symbol does not have a definition, libraries will
216 be searched to find a definition. */
217#define N_INDR 0xa
218
219/* The following symbols refer to set elements.
220 All the N_SET[ATDB] symbols with the same name form one set.
221 Space is allocated for the set in the text section, and each set
222 element's value is stored into one word of the space.
223 The first word of the space is the length of the set (number of elements).
224
225 The address of the set is made into an N_SETV symbol
226 whose name is the same as the name of the set.
227 This symbol acts like a N_DATA global symbol
228 in that it can satisfy undefined external references. */
229
230/* These appear as input to LD, in a .o file. */
231#define N_SETA 0x14 /* Absolute set element symbol */
232#define N_SETT 0x16 /* Text set element symbol */
233#define N_SETD 0x18 /* Data set element symbol */
234#define N_SETB 0x1A /* Bss set element symbol */
235
236/* This is output from LD. */
237#define N_SETV 0x1C /* Pointer to set vector in data area. */
238
239#if !defined (N_RELOCATION_INFO_DECLARED) 78#if !defined (N_RELOCATION_INFO_DECLARED)
240/* This structure describes a single relocation to be performed.
241 The text-relocation section of the file is a vector of these structures,
242 all of which apply to the text section.
243 Likewise, the data-relocation section applies to the data section. */
244
245struct relocation_info
246{
247 /* Address (within segment) to be relocated. */
248 int r_address;
249 /* The meaning of r_symbolnum depends on r_extern. */
250 unsigned int r_symbolnum:24;
251 /* Nonzero means value is a pc-relative offset
252 and it should be relocated for changes in its own address
253 as well as for changes in the symbol or section specified. */
254 unsigned int r_pcrel:1;
255 /* Length (as exponent of 2) of the field to be relocated.
256 Thus, a value of 2 indicates 1<<2 bytes. */
257 unsigned int r_length:2;
258 /* 1 => relocate with value of symbol.
259 r_symbolnum is the index of the symbol
260 in file's the symbol table.
261 0 => relocate with the address of a segment.
262 r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
263 (the N_EXT bit may be set also, but signifies nothing). */
264 unsigned int r_extern:1;
265 /* Four bits that aren't used, but when writing an object file
266 it is desirable to clear them. */
267#ifdef NS32K 79#ifdef NS32K
268 unsigned r_bsr:1;
269 unsigned r_disp:1;
270 unsigned r_pad:2;
271#else 80#else
272 unsigned int r_pad:4;
273#endif 81#endif
274};
275#endif /* no N_RELOCATION_INFO_DECLARED. */ 82#endif /* no N_RELOCATION_INFO_DECLARED. */
276
277#endif /*__ASSEMBLY__ */ 83#endif /*__ASSEMBLY__ */
278#endif /* __A_OUT_GNU_H__ */ 84#endif /* __A_OUT_GNU_H__ */
diff --git a/include/linux/acct.h b/include/linux/acct.h
index d537aa0ec41..4a5b7cb5607 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -11,109 +11,11 @@
11 * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V. 11 * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
12 * 12 *
13 */ 13 */
14
15#ifndef _LINUX_ACCT_H 14#ifndef _LINUX_ACCT_H
16#define _LINUX_ACCT_H 15#define _LINUX_ACCT_H
17 16
18#include <linux/types.h> 17#include <uapi/linux/acct.h>
19
20#include <asm/param.h>
21#include <asm/byteorder.h>
22
23/*
24 * comp_t is a 16-bit "floating" point number with a 3-bit base 8
25 * exponent and a 13-bit fraction.
26 * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
27 * (leading 1 not stored).
28 * See linux/kernel/acct.c for the specific encoding systems used.
29 */
30
31typedef __u16 comp_t;
32typedef __u32 comp2_t;
33
34/*
35 * accounting file record
36 *
37 * This structure contains all of the information written out to the
38 * process accounting file whenever a process exits.
39 */
40 18
41#define ACCT_COMM 16
42
43struct acct
44{
45 char ac_flag; /* Flags */
46 char ac_version; /* Always set to ACCT_VERSION */
47 /* for binary compatibility back until 2.0 */
48 __u16 ac_uid16; /* LSB of Real User ID */
49 __u16 ac_gid16; /* LSB of Real Group ID */
50 __u16 ac_tty; /* Control Terminal */
51 __u32 ac_btime; /* Process Creation Time */
52 comp_t ac_utime; /* User Time */
53 comp_t ac_stime; /* System Time */
54 comp_t ac_etime; /* Elapsed Time */
55 comp_t ac_mem; /* Average Memory Usage */
56 comp_t ac_io; /* Chars Transferred */
57 comp_t ac_rw; /* Blocks Read or Written */
58 comp_t ac_minflt; /* Minor Pagefaults */
59 comp_t ac_majflt; /* Major Pagefaults */
60 comp_t ac_swaps; /* Number of Swaps */
61/* m68k had no padding here. */
62#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
63 __u16 ac_ahz; /* AHZ */
64#endif
65 __u32 ac_exitcode; /* Exitcode */
66 char ac_comm[ACCT_COMM + 1]; /* Command Name */
67 __u8 ac_etime_hi; /* Elapsed Time MSB */
68 __u16 ac_etime_lo; /* Elapsed Time LSB */
69 __u32 ac_uid; /* Real User ID */
70 __u32 ac_gid; /* Real Group ID */
71};
72
73struct acct_v3
74{
75 char ac_flag; /* Flags */
76 char ac_version; /* Always set to ACCT_VERSION */
77 __u16 ac_tty; /* Control Terminal */
78 __u32 ac_exitcode; /* Exitcode */
79 __u32 ac_uid; /* Real User ID */
80 __u32 ac_gid; /* Real Group ID */
81 __u32 ac_pid; /* Process ID */
82 __u32 ac_ppid; /* Parent Process ID */
83 __u32 ac_btime; /* Process Creation Time */
84#ifdef __KERNEL__
85 __u32 ac_etime; /* Elapsed Time */
86#else
87 float ac_etime; /* Elapsed Time */
88#endif
89 comp_t ac_utime; /* User Time */
90 comp_t ac_stime; /* System Time */
91 comp_t ac_mem; /* Average Memory Usage */
92 comp_t ac_io; /* Chars Transferred */
93 comp_t ac_rw; /* Blocks Read or Written */
94 comp_t ac_minflt; /* Minor Pagefaults */
95 comp_t ac_majflt; /* Major Pagefaults */
96 comp_t ac_swaps; /* Number of Swaps */
97 char ac_comm[ACCT_COMM]; /* Command Name */
98};
99
100/*
101 * accounting flags
102 */
103 /* bit set when the process ... */
104#define AFORK 0x01 /* ... executed fork, but did not exec */
105#define ASU 0x02 /* ... used super-user privileges */
106#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
107#define ACORE 0x08 /* ... dumped core */
108#define AXSIG 0x10 /* ... was killed by a signal */
109
110#ifdef __BIG_ENDIAN
111#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
112#else
113#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */
114#endif
115
116#ifdef __KERNEL__
117 19
118 20
119#ifdef CONFIG_BSD_PROCESS_ACCT 21#ifdef CONFIG_BSD_PROCESS_ACCT
@@ -163,12 +65,6 @@ typedef struct acct_v3 acct_t;
163typedef struct acct acct_t; 65typedef struct acct acct_t;
164#endif 66#endif
165 67
166#else
167#define ACCT_VERSION 2
168#define AHZ (HZ)
169#endif /* __KERNEL */
170
171#ifdef __KERNEL__
172#include <linux/jiffies.h> 68#include <linux/jiffies.h>
173/* 69/*
174 * Yet another set of HZ to *HZ helper functions. 70 * Yet another set of HZ to *HZ helper functions.
@@ -210,6 +106,4 @@ static inline u64 nsec_to_AHZ(u64 x)
210 return x; 106 return x;
211} 107}
212 108
213#endif /* __KERNEL */
214
215#endif /* _LINUX_ACCT_H */ 109#endif /* _LINUX_ACCT_H */
diff --git a/include/linux/adb.h b/include/linux/adb.h
index 63bca502fa5..cde41300c7a 100644
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -4,43 +4,8 @@
4#ifndef __ADB_H 4#ifndef __ADB_H
5#define __ADB_H 5#define __ADB_H
6 6
7/* ADB commands */ 7#include <uapi/linux/adb.h>
8#define ADB_BUSRESET 0
9#define ADB_FLUSH(id) (0x01 | ((id) << 4))
10#define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
11#define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
12 8
13/* ADB default device IDs (upper 4 bits of ADB command byte) */
14#define ADB_DONGLE 1 /* "software execution control" devices */
15#define ADB_KEYBOARD 2
16#define ADB_MOUSE 3
17#define ADB_TABLET 4
18#define ADB_MODEM 5
19#define ADB_MISC 7 /* maybe a monitor */
20
21#define ADB_RET_OK 0
22#define ADB_RET_TIMEOUT 3
23
24/* The kind of ADB request. The controller may emulate some
25 or all of those CUDA/PMU packet kinds */
26#define ADB_PACKET 0
27#define CUDA_PACKET 1
28#define ERROR_PACKET 2
29#define TIMER_PACKET 3
30#define POWER_PACKET 4
31#define MACIIC_PACKET 5
32#define PMU_PACKET 6
33#define ADB_QUERY 7
34
35/* ADB queries */
36
37/* ADB_QUERY_GETDEVINFO
38 * Query ADB slot for device presence
39 * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
40 */
41#define ADB_QUERY_GETDEVINFO 1
42
43#ifdef __KERNEL__
44 9
45struct adb_request { 10struct adb_request {
46 unsigned char data[32]; 11 unsigned char data[32];
@@ -98,6 +63,4 @@ int adb_reset_bus(void);
98int adb_try_handler_change(int address, int new_id); 63int adb_try_handler_change(int address, int new_id);
99int adb_get_infos(int address, int *original_address, int *handler_id); 64int adb_get_infos(int address, int *original_address, int *handler_id);
100 65
101#endif /* __KERNEL__ */
102
103#endif /* __ADB_H */ 66#endif /* __ADB_H */
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h
index b19801f7389..0d991071a9d 100644
--- a/include/linux/adfs_fs.h
+++ b/include/linux/adfs_fs.h
@@ -1,47 +1,9 @@
1#ifndef _ADFS_FS_H 1#ifndef _ADFS_FS_H
2#define _ADFS_FS_H 2#define _ADFS_FS_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/adfs_fs.h>
5#include <linux/magic.h>
6 5
7/* 6/*
8 * Disc Record at disc address 0xc00
9 */
10struct adfs_discrecord {
11 __u8 log2secsize;
12 __u8 secspertrack;
13 __u8 heads;
14 __u8 density;
15 __u8 idlen;
16 __u8 log2bpmb;
17 __u8 skew;
18 __u8 bootoption;
19 __u8 lowsector;
20 __u8 nzones;
21 __le16 zone_spare;
22 __le32 root;
23 __le32 disc_size;
24 __le16 disc_id;
25 __u8 disc_name[10];
26 __le32 disc_type;
27 __le32 disc_size_high;
28 __u8 log2sharesize:4;
29 __u8 unused40:4;
30 __u8 big_flag:1;
31 __u8 unused41:1;
32 __u8 nzones_high;
33 __le32 format_version;
34 __le32 root_size;
35 __u8 unused52[60 - 52];
36};
37
38#define ADFS_DISCRECORD (0xc00)
39#define ADFS_DR_OFFSET (0x1c0)
40#define ADFS_DR_SIZE 60
41#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
42
43#ifdef __KERNEL__
44/*
45 * Calculate the boot block checksum on an ADFS drive. Note that this will 7 * Calculate the boot block checksum on an ADFS drive. Note that this will
46 * appear to be correct if the sector contains all zeros, so also check that 8 * appear to be correct if the sector contains all zeros, so also check that
47 * the disk size is non-zero!!! 9 * the disk size is non-zero!!!
@@ -59,5 +21,3 @@ static inline int adfs_checkbblk(unsigned char *ptr)
59 return (result & 0xff) != ptr[511]; 21 return (result & 0xff) != ptr[511];
60} 22}
61#endif 23#endif
62
63#endif
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index f6778eceb8f..c6b61ca9705 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -23,94 +23,12 @@
23 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * 24 *
25 */ 25 */
26
27#ifndef _AGP_H 26#ifndef _AGP_H
28#define _AGP_H 1 27#define _AGP_H 1
29 28
30#define AGPIOC_BASE 'A'
31#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
32#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
33#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
34#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
35#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
36#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
37#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
38#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
39#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
40#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
41#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
42
43#define AGP_DEVICE "/dev/agpgart"
44
45#ifndef TRUE
46#define TRUE 1
47#endif
48
49#ifndef FALSE
50#define FALSE 0
51#endif
52
53#ifndef __KERNEL__
54#include <linux/types.h>
55
56struct agp_version {
57 __u16 major;
58 __u16 minor;
59};
60
61typedef struct _agp_info {
62 struct agp_version version; /* version of the driver */
63 __u32 bridge_id; /* bridge vendor/device */
64 __u32 agp_mode; /* mode info of bridge */
65 unsigned long aper_base;/* base of aperture */
66 size_t aper_size; /* size of aperture */
67 size_t pg_total; /* max pages (swap + system) */
68 size_t pg_system; /* max pages (system) */
69 size_t pg_used; /* current pages used */
70} agp_info;
71
72typedef struct _agp_setup {
73 __u32 agp_mode; /* mode info of bridge */
74} agp_setup;
75
76/*
77 * The "prot" down below needs still a "sleep" flag somehow ...
78 */
79typedef struct _agp_segment {
80 __kernel_off_t pg_start; /* starting page to populate */
81 __kernel_size_t pg_count; /* number of pages */
82 int prot; /* prot flags for mmap */
83} agp_segment;
84
85typedef struct _agp_region {
86 __kernel_pid_t pid; /* pid of process */
87 __kernel_size_t seg_count; /* number of segments */
88 struct _agp_segment *seg_list;
89} agp_region;
90
91typedef struct _agp_allocate {
92 int key; /* tag of allocation */
93 __kernel_size_t pg_count;/* number of pages */
94 __u32 type; /* 0 == normal, other devspec */
95 __u32 physical; /* device specific (some devices
96 * need a phys address of the
97 * actual page behind the gatt
98 * table) */
99} agp_allocate;
100
101typedef struct _agp_bind {
102 int key; /* tag of allocation */
103 __kernel_off_t pg_start;/* starting page to populate */
104} agp_bind;
105
106typedef struct _agp_unbind {
107 int key; /* tag of allocation */
108 __u32 priority; /* priority for paging out */
109} agp_unbind;
110
111#else /* __KERNEL__ */
112#include <linux/mutex.h> 29#include <linux/mutex.h>
113#include <linux/agp_backend.h> 30#include <linux/agp_backend.h>
31#include <uapi/linux/agpgart.h>
114 32
115#define AGPGART_MINOR 175 33#define AGPGART_MINOR 175
116 34
@@ -209,6 +127,4 @@ struct agp_front_data {
209 bool backend_acquired; 127 bool backend_acquired;
210}; 128};
211 129
212#endif /* __KERNEL__ */
213
214#endif /* _AGP_H */ 130#endif /* _AGP_H */
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 01a6244c9bc..9c3a87184f4 100644
--- a/include/linux/apm_bios.h
+++ b/include/linux/apm_bios.h
@@ -1,6 +1,3 @@
1#ifndef _LINUX_APM_H
2#define _LINUX_APM_H
3
4/* 1/*
5 * Include file for the interface to an APM BIOS 2 * Include file for the interface to an APM BIOS
6 * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au) 3 * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
@@ -15,25 +12,11 @@
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details. 13 * General Public License for more details.
17 */ 14 */
15#ifndef _LINUX_APM_H
16#define _LINUX_APM_H
18 17
19#include <linux/types.h> 18#include <uapi/linux/apm_bios.h>
20
21typedef unsigned short apm_event_t;
22typedef unsigned short apm_eventinfo_t;
23
24struct apm_bios_info {
25 __u16 version;
26 __u16 cseg;
27 __u32 offset;
28 __u16 cseg_16;
29 __u16 dseg;
30 __u16 flags;
31 __u16 cseg_len;
32 __u16 cseg_16_len;
33 __u16 dseg_len;
34};
35 19
36#ifdef __KERNEL__
37 20
38#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) 21#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
39#define APM_CS_16 (APM_CS + 8) 22#define APM_CS_16 (APM_CS + 8)
@@ -110,111 +93,9 @@ struct apm_info {
110 */ 93 */
111extern struct apm_info apm_info; 94extern struct apm_info apm_info;
112 95
113#endif /* __KERNEL__ */
114
115/*
116 * Power states
117 */
118#define APM_STATE_READY 0x0000
119#define APM_STATE_STANDBY 0x0001
120#define APM_STATE_SUSPEND 0x0002
121#define APM_STATE_OFF 0x0003
122#define APM_STATE_BUSY 0x0004
123#define APM_STATE_REJECT 0x0005
124#define APM_STATE_OEM_SYS 0x0020
125#define APM_STATE_OEM_DEV 0x0040
126
127#define APM_STATE_DISABLE 0x0000
128#define APM_STATE_ENABLE 0x0001
129
130#define APM_STATE_DISENGAGE 0x0000
131#define APM_STATE_ENGAGE 0x0001
132
133/*
134 * Events (results of Get PM Event)
135 */
136#define APM_SYS_STANDBY 0x0001
137#define APM_SYS_SUSPEND 0x0002
138#define APM_NORMAL_RESUME 0x0003
139#define APM_CRITICAL_RESUME 0x0004
140#define APM_LOW_BATTERY 0x0005
141#define APM_POWER_STATUS_CHANGE 0x0006
142#define APM_UPDATE_TIME 0x0007
143#define APM_CRITICAL_SUSPEND 0x0008
144#define APM_USER_STANDBY 0x0009
145#define APM_USER_SUSPEND 0x000a
146#define APM_STANDBY_RESUME 0x000b
147#define APM_CAPABILITY_CHANGE 0x000c
148
149/*
150 * Error codes
151 */
152#define APM_SUCCESS 0x00
153#define APM_DISABLED 0x01
154#define APM_CONNECTED 0x02
155#define APM_NOT_CONNECTED 0x03
156#define APM_16_CONNECTED 0x05
157#define APM_16_UNSUPPORTED 0x06
158#define APM_32_CONNECTED 0x07
159#define APM_32_UNSUPPORTED 0x08
160#define APM_BAD_DEVICE 0x09
161#define APM_BAD_PARAM 0x0a
162#define APM_NOT_ENGAGED 0x0b
163#define APM_BAD_FUNCTION 0x0c
164#define APM_RESUME_DISABLED 0x0d
165#define APM_NO_ERROR 0x53
166#define APM_BAD_STATE 0x60
167#define APM_NO_EVENTS 0x80
168#define APM_NOT_PRESENT 0x86
169
170/*
171 * APM Device IDs
172 */
173#define APM_DEVICE_BIOS 0x0000
174#define APM_DEVICE_ALL 0x0001
175#define APM_DEVICE_DISPLAY 0x0100
176#define APM_DEVICE_STORAGE 0x0200
177#define APM_DEVICE_PARALLEL 0x0300
178#define APM_DEVICE_SERIAL 0x0400
179#define APM_DEVICE_NETWORK 0x0500
180#define APM_DEVICE_PCMCIA 0x0600
181#define APM_DEVICE_BATTERY 0x8000
182#define APM_DEVICE_OEM 0xe000
183#define APM_DEVICE_OLD_ALL 0xffff
184#define APM_DEVICE_CLASS 0x00ff
185#define APM_DEVICE_MASK 0xff00
186
187#ifdef __KERNEL__
188/* 96/*
189 * This is the "All Devices" ID communicated to the BIOS 97 * This is the "All Devices" ID communicated to the BIOS
190 */ 98 */
191#define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \ 99#define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \
192 APM_DEVICE_ALL : APM_DEVICE_OLD_ALL) 100 APM_DEVICE_ALL : APM_DEVICE_OLD_ALL)
193#endif
194
195/*
196 * Battery status
197 */
198#define APM_MAX_BATTERIES 2
199
200/*
201 * APM defined capability bit flags
202 */
203#define APM_CAP_GLOBAL_STANDBY 0x0001
204#define APM_CAP_GLOBAL_SUSPEND 0x0002
205#define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */
206#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */
207#define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
208#define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
209#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */
210#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */
211
212/*
213 * ioctl operations
214 */
215#include <linux/ioctl.h>
216
217#define APM_IOC_STANDBY _IO('A', 1)
218#define APM_IOC_SUSPEND _IO('A', 2)
219
220#endif /* LINUX_APM_H */ 101#endif /* LINUX_APM_H */
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index f57c36881c4..73fd8b7e953 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -1,49 +1,9 @@
1#ifndef __LINUX_ATALK_H__ 1#ifndef __LINUX_ATALK_H__
2#define __LINUX_ATALK_H__ 2#define __LINUX_ATALK_H__
3 3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6#include <linux/socket.h>
7
8/*
9 * AppleTalk networking structures
10 *
11 * The following are directly referenced from the University Of Michigan
12 * netatalk for compatibility reasons.
13 */
14#define ATPORT_FIRST 1
15#define ATPORT_RESERVED 128
16#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
17#define ATADDR_ANYNET (__u16)0
18#define ATADDR_ANYNODE (__u8)0
19#define ATADDR_ANYPORT (__u8)0
20#define ATADDR_BCAST (__u8)255
21#define DDP_MAXSZ 587
22#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
23
24#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
25
26struct atalk_addr {
27 __be16 s_net;
28 __u8 s_node;
29};
30
31struct sockaddr_at {
32 __kernel_sa_family_t sat_family;
33 __u8 sat_port;
34 struct atalk_addr sat_addr;
35 char sat_zero[8];
36};
37
38struct atalk_netrange {
39 __u8 nr_phase;
40 __be16 nr_firstnet;
41 __be16 nr_lastnet;
42};
43
44#ifdef __KERNEL__
45 4
46#include <net/sock.h> 5#include <net/sock.h>
6#include <uapi/linux/atalk.h>
47 7
48struct atalk_route { 8struct atalk_route {
49 struct net_device *dev; 9 struct net_device *dev;
@@ -205,5 +165,4 @@ extern void atalk_proc_exit(void);
205#define atalk_proc_exit() do { } while(0) 165#define atalk_proc_exit() do { } while(0)
206#endif /* CONFIG_PROC_FS */ 166#endif /* CONFIG_PROC_FS */
207 167
208#endif /* __KERNEL__ */
209#endif /* __LINUX_ATALK_H__ */ 168#endif /* __LINUX_ATALK_H__ */
diff --git a/include/linux/atm.h b/include/linux/atm.h
index d3b292174ae..30006c43595 100644
--- a/include/linux/atm.h
+++ b/include/linux/atm.h
@@ -1,242 +1,9 @@
1/* atm.h - general ATM declarations */ 1/* atm.h - general ATM declarations */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6/*
7 * WARNING: User-space programs should not #include <linux/atm.h> directly.
8 * Instead, #include <atm.h>
9 */
10
11#ifndef _LINUX_ATM_H 2#ifndef _LINUX_ATM_H
12#define _LINUX_ATM_H 3#define _LINUX_ATM_H
13 4
14/* 5#include <uapi/linux/atm.h>
15 * BEGIN_xx and END_xx markers are used for automatic generation of
16 * documentation. Do not change them.
17 */
18
19#include <linux/compiler.h>
20#include <linux/atmapi.h>
21#include <linux/atmsap.h>
22#include <linux/atmioc.h>
23#include <linux/types.h>
24
25
26/* general ATM constants */
27#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */
28#define ATM_CELL_PAYLOAD 48 /* ATM payload size */
29#define ATM_AAL0_SDU 52 /* AAL0 SDU size */
30#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */
31#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */
32#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */
33#define ATM_MAX_CDV 9999 /* maximum (default) CDV */
34#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */
35
36#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */
37#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */
38#define ATM_MAX_VCI 65535 /* maximum VCI */
39
40
41/* "protcol" values for the socket system call */
42#define ATM_NO_AAL 0 /* AAL not specified */
43#define ATM_AAL0 13 /* "raw" ATM cells */
44#define ATM_AAL1 1 /* AAL1 (CBR) */
45#define ATM_AAL2 2 /* AAL2 (VBR) */
46#define ATM_AAL34 3 /* AAL3/4 (data) */
47#define ATM_AAL5 5 /* AAL5 (data) */
48
49/*
50 * socket option name coding functions
51 *
52 * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
53 * << 22 only reserves 9 bits for the level. On some architectures
54 * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
55 */
56
57#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \
58 sizeof(t))
59#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
60#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
61#define __SO_SIZE(c) ((c) & 0x3fff)
62
63/*
64 * ATM layer
65 */
66
67#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
68 /* set CLP bit value - TODO */
69#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
70 /* connection identifier range; socket must be
71 bound or connected */
72#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
73 /* Quality of Service setting */
74#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
75 /* Service Access Point */
76#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
77 /* "PVC" address (also for SVCs); get only */
78#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
79 /* make this vc a p2mp */
80
81
82/*
83 * Note @@@: since the socket layers don't really distinguish the control and
84 * the data plane but generally seems to be data plane-centric, any layer is
85 * about equally wrong for the SAP. If you have a better idea about this,
86 * please speak up ...
87 */
88
89
90/* ATM cell header (for AAL0) */
91
92/* BEGIN_CH */
93#define ATM_HDR_GFC_MASK 0xf0000000
94#define ATM_HDR_GFC_SHIFT 28
95#define ATM_HDR_VPI_MASK 0x0ff00000
96#define ATM_HDR_VPI_SHIFT 20
97#define ATM_HDR_VCI_MASK 0x000ffff0
98#define ATM_HDR_VCI_SHIFT 4
99#define ATM_HDR_PTI_MASK 0x0000000e
100#define ATM_HDR_PTI_SHIFT 1
101#define ATM_HDR_CLP 0x00000001
102/* END_CH */
103
104
105/* PTI codings */
106
107/* BEGIN_PTI */
108#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */
109#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */
110#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */
111#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */
112#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */
113#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */
114#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */
115#define ATM_PTI_RSV 7 /* reserved */
116/* END_PTI */
117
118
119/*
120 * The following items should stay in linux/atm.h, which should be linked to
121 * netatm/atm.h
122 */
123
124/* Traffic description */
125
126#define ATM_NONE 0 /* no traffic */
127#define ATM_UBR 1
128#define ATM_CBR 2
129#define ATM_VBR 3
130#define ATM_ABR 4
131#define ATM_ANYCLASS 5 /* compatible with everything */
132
133#define ATM_MAX_PCR -1 /* maximum available PCR */
134
135struct atm_trafprm {
136 unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */
137 int max_pcr; /* maximum PCR in cells per second */
138 int pcr; /* desired PCR in cells per second */
139 int min_pcr; /* minimum PCR in cells per second */
140 int max_cdv; /* maximum CDV in microseconds */
141 int max_sdu; /* maximum SDU in bytes */
142 /* extra params for ABR */
143 unsigned int icr; /* Initial Cell Rate (24-bit) */
144 unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
145 unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */
146 unsigned int rif : 4; /* Rate Increment Factor (4-bit) */
147 unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */
148 unsigned int nrm_pres :1; /* nrm present bit */
149 unsigned int trm_pres :1; /* rm present bit */
150 unsigned int adtf_pres :1; /* adtf present bit */
151 unsigned int cdf_pres :1; /* cdf present bit*/
152 unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */
153 unsigned int trm :3; /* Time between forward RM cells (3-bit) */
154 unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */
155 unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */
156 unsigned int spare :9; /* spare bits */
157};
158
159struct atm_qos {
160 struct atm_trafprm txtp; /* parameters in TX direction */
161 struct atm_trafprm rxtp __ATM_API_ALIGN;
162 /* parameters in RX direction */
163 unsigned char aal __ATM_API_ALIGN;
164};
165
166/* PVC addressing */
167
168#define ATM_ITF_ANY -1 /* "magic" PVC address values */
169#define ATM_VPI_ANY -1
170#define ATM_VCI_ANY -1
171#define ATM_VPI_UNSPEC -2
172#define ATM_VCI_UNSPEC -2
173
174
175struct sockaddr_atmpvc {
176 unsigned short sap_family; /* address family, AF_ATMPVC */
177 struct { /* PVC address */
178 short itf; /* ATM interface */
179 short vpi; /* VPI (only 8 bits at UNI) */
180 int vci; /* VCI (only 16 bits at UNI) */
181 } sap_addr __ATM_API_ALIGN; /* PVC address */
182};
183
184/* SVC addressing */
185
186#define ATM_ESA_LEN 20 /* ATM End System Address length */
187#define ATM_E164_LEN 12 /* maximum E.164 number length */
188
189#define ATM_AFI_DCC 0x39 /* DCC ATM Format */
190#define ATM_AFI_ICD 0x47 /* ICD ATM Format */
191#define ATM_AFI_E164 0x45 /* E.164 ATM Format */
192#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */
193
194#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */
195#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */
196#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */
197#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */
198 6
199#define ATM_LIJ_NONE 0 /* no leaf-initiated join */
200#define ATM_LIJ 1 /* request joining */
201#define ATM_LIJ_RPJ 2 /* set to root-prompted join */
202#define ATM_LIJ_NJ 3 /* set to network join */
203
204
205struct sockaddr_atmsvc {
206 unsigned short sas_family; /* address family, AF_ATMSVC */
207 struct { /* SVC address */
208 unsigned char prv[ATM_ESA_LEN];/* private ATM address */
209 char pub[ATM_E164_LEN+1]; /* public address (E.164) */
210 /* unused addresses must be bzero'ed */
211 char lij_type; /* role in LIJ call; one of ATM_LIJ* */
212 __u32 lij_id; /* LIJ call identifier */
213 } sas_addr __ATM_API_ALIGN; /* SVC address */
214};
215
216
217static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
218{
219 return *addr.sas_addr.prv || *addr.sas_addr.pub;
220}
221
222
223static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
224{
225 return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
226}
227
228
229/*
230 * Some stuff for linux/sockios.h
231 */
232
233struct atmif_sioc {
234 int number;
235 int length;
236 void __user *arg;
237};
238
239#ifdef __KERNEL__
240#ifdef CONFIG_COMPAT 7#ifdef CONFIG_COMPAT
241#include <linux/compat.h> 8#include <linux/compat.h>
242struct compat_atmif_sioc { 9struct compat_atmif_sioc {
@@ -246,6 +13,3 @@ struct compat_atmif_sioc {
246}; 13};
247#endif 14#endif
248#endif 15#endif
249
250typedef unsigned short atm_backend_t;
251#endif
diff --git a/include/linux/atm_tcp.h b/include/linux/atm_tcp.h
index 375638f8554..db6b65fc0ae 100644
--- a/include/linux/atm_tcp.h
+++ b/include/linux/atm_tcp.h
@@ -3,61 +3,11 @@
3 3
4/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */ 4/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
5 5
6
7#ifndef LINUX_ATM_TCP_H 6#ifndef LINUX_ATM_TCP_H
8#define LINUX_ATM_TCP_H 7#define LINUX_ATM_TCP_H
9 8
10#include <linux/atmapi.h> 9#include <uapi/linux/atm_tcp.h>
11#include <linux/atm.h>
12#include <linux/atmioc.h>
13#include <linux/types.h>
14
15
16/*
17 * All values in struct atmtcp_hdr are in network byte order
18 */
19
20struct atmtcp_hdr {
21 __u16 vpi;
22 __u16 vci;
23 __u32 length; /* ... of data part */
24};
25
26/*
27 * All values in struct atmtcp_command are in host byte order
28 */
29
30#define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */
31#define ATMTCP_CTRL_OPEN 1 /* request/reply */
32#define ATMTCP_CTRL_CLOSE 2 /* request/reply */
33 10
34struct atmtcp_control {
35 struct atmtcp_hdr hdr; /* must be first */
36 int type; /* message type; both directions */
37 atm_kptr_t vcc; /* both directions */
38 struct sockaddr_atmpvc addr; /* suggested value from kernel */
39 struct atm_qos qos; /* both directions */
40 int result; /* to kernel only */
41} __ATM_API_ALIGN;
42
43/*
44 * Field usage:
45 * Messge type dir. hdr.v?i type addr qos vcc result
46 * ----------- ---- ------- ---- ---- --- --- ------
47 * OPEN K->D Y Y Y Y Y 0
48 * OPEN D->K - Y Y Y Y Y
49 * CLOSE K->D - - Y - Y 0
50 * CLOSE D->K - - - - Y Y
51 */
52
53#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */
54#define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP
55 interface */
56#define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP
57 interface */
58
59
60#ifdef __KERNEL__
61 11
62struct atm_tcp_ops { 12struct atm_tcp_ops {
63 int (*attach)(struct atm_vcc *vcc,int itf); 13 int (*attach)(struct atm_vcc *vcc,int itf);
@@ -69,5 +19,3 @@ struct atm_tcp_ops {
69extern struct atm_tcp_ops atm_tcp_ops; 19extern struct atm_tcp_ops atm_tcp_ops;
70 20
71#endif 21#endif
72
73#endif
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 06fd4bbc58f..22ef21c33d0 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -1,218 +1,8 @@
1/* atmdev.h - ATM device driver declarations and various related items */ 1/* atmdev.h - ATM device driver declarations and various related items */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef LINUX_ATMDEV_H 2#ifndef LINUX_ATMDEV_H
7#define LINUX_ATMDEV_H 3#define LINUX_ATMDEV_H
8 4
9 5
10#include <linux/atmapi.h>
11#include <linux/atm.h>
12#include <linux/atmioc.h>
13
14
15#define ESI_LEN 6
16
17#define ATM_OC3_PCR (155520000/270*260/8/53)
18 /* OC3 link rate: 155520000 bps
19 SONET overhead: /270*260 (9 section, 1 path)
20 bits per cell: /8/53
21 max cell rate: 353207.547 cells/sec */
22#define ATM_25_PCR ((25600000/8-8000)/54)
23 /* 25 Mbps ATM cell rate (59111) */
24#define ATM_OC12_PCR (622080000/1080*1040/8/53)
25 /* OC12 link rate: 622080000 bps
26 SONET overhead: /1080*1040
27 bits per cell: /8/53
28 max cell rate: 1412830.188 cells/sec */
29#define ATM_DS3_PCR (8000*12)
30 /* DS3: 12 cells in a 125 usec time slot */
31
32
33#define __AAL_STAT_ITEMS \
34 __HANDLE_ITEM(tx); /* TX okay */ \
35 __HANDLE_ITEM(tx_err); /* TX errors */ \
36 __HANDLE_ITEM(rx); /* RX okay */ \
37 __HANDLE_ITEM(rx_err); /* RX errors */ \
38 __HANDLE_ITEM(rx_drop); /* RX out of memory */
39
40struct atm_aal_stats {
41#define __HANDLE_ITEM(i) int i
42 __AAL_STAT_ITEMS
43#undef __HANDLE_ITEM
44};
45
46
47struct atm_dev_stats {
48 struct atm_aal_stats aal0;
49 struct atm_aal_stats aal34;
50 struct atm_aal_stats aal5;
51} __ATM_API_ALIGN;
52
53
54#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
55 /* get link rate */
56#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
57 /* get interface names (numbers) */
58#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
59 /* get interface type name */
60#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
61 /* get interface ESI */
62#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
63 /* get itf's local ATM addr. list */
64#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
65 /* reset itf's ATM address list */
66#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
67 /* add a local ATM address */
68#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
69 /* remove a local ATM address */
70#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
71 /* get connection identifier range */
72#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
73 /* set connection identifier range */
74#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
75 /* set interface ESI */
76#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
77 /* force interface ESI */
78#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
79 /* register a LECS address */
80#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
81 /* unregister a LECS address */
82#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
83 /* retrieve LECS address(es) */
84
85#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
86 /* get AAL layer statistics */
87#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
88 /* get AAL layer statistics and zero */
89#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
90 /* get loopback mode */
91#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
92 /* set loopback mode */
93#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
94 /* query supported loopback modes */
95#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
96 /* enable or disable single-copy */
97#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
98 /* set backend handler */
99#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
100 /* use backend to make new if */
101#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
102 /* add party to p2mp call */
103#ifdef CONFIG_COMPAT
104/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
105#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
106#endif
107#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
108 /* drop party from p2mp call */
109
110/*
111 * These are backend handkers that can be set via the ATM_SETBACKEND call
112 * above. In the future we may support dynamic loading of these - for now,
113 * they're just being used to share the ATMIOC_BACKEND ioctls
114 */
115#define ATM_BACKEND_RAW 0
116#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
117#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
118
119/* for ATM_GETTYPE */
120#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
121
122/*
123 * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
124 */
125
126/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
127#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
128#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
129#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
130/* RESERVED 4 loop back on PHY side ---' */
131#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
132#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
133
134/* Direction of loopback */
135#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
136#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
137
138#define __ATM_LM_XTLOC(n) ((n) & 0xff)
139#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
140
141#define ATM_LM_NONE 0 /* no loopback */
142
143#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
144#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
145#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
146#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
147
148#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
149#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
150#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
151#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
152
153/*
154 * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
155 * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
156 */
157
158
159struct atm_iobuf {
160 int length;
161 void __user *buffer;
162};
163
164/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
165
166#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
167
168struct atm_cirange {
169 signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
170 signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
171};
172
173/* for ATM_SETSC; actually taken from the ATM_VF number space */
174
175#define ATM_SC_RX 1024 /* enable RX single-copy */
176#define ATM_SC_TX 2048 /* enable TX single-copy */
177
178#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
179 anyway */
180
181/* MF: change_qos (Modify) flags */
182
183#define ATM_MF_IMMED 1 /* Block until change is effective */
184#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
185#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
186#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
187#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
188#define ATM_MF_BWD 32 /* Set the backward direction parameters */
189
190#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
191 ATM_MF_DEC_SHP | ATM_MF_BWD)
192
193/*
194 * ATM_VS_* are used to express VC state in a human-friendly way.
195 */
196
197#define ATM_VS_IDLE 0 /* VC is not used */
198#define ATM_VS_CONNECTED 1 /* VC is connected */
199#define ATM_VS_CLOSING 2 /* VC is closing */
200#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
201#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
202#define ATM_VS_BOUND 5 /* VC is bound */
203
204#define ATM_VS2TXT_MAP \
205 "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
206
207#define ATM_VF2TXT_MAP \
208 "ADDR", "READY", "PARTIAL", "REGIS", \
209 "RELEASED", "HASQOS", "LISTEN", "META", \
210 "256", "512", "1024", "2048", \
211 "SESSION", "HASSAP", "BOUND", "CLOSE"
212
213
214#ifdef __KERNEL__
215
216#include <linux/wait.h> /* wait_queue_head_t */ 6#include <linux/wait.h> /* wait_queue_head_t */
217#include <linux/time.h> /* struct timeval */ 7#include <linux/time.h> /* struct timeval */
218#include <linux/net.h> 8#include <linux/net.h>
@@ -221,6 +11,7 @@ struct atm_cirange {
221#include <linux/uio.h> 11#include <linux/uio.h>
222#include <net/sock.h> 12#include <net/sock.h>
223#include <linux/atomic.h> 13#include <linux/atomic.h>
14#include <uapi/linux/atmdev.h>
224 15
225#ifdef CONFIG_PROC_FS 16#ifdef CONFIG_PROC_FS
226#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
@@ -521,6 +312,4 @@ void deregister_atm_ioctl(struct atm_ioctl *);
521int register_atmdevice_notifier(struct notifier_block *nb); 312int register_atmdevice_notifier(struct notifier_block *nb);
522void unregister_atmdevice_notifier(struct notifier_block *nb); 313void unregister_atmdevice_notifier(struct notifier_block *nb);
523 314
524#endif /* __KERNEL__ */
525
526#endif 315#endif
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b889fa64b0e..bce729afbcf 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -20,389 +20,11 @@
20 * Written by Rickard E. (Rik) Faith <faith@redhat.com> 20 * Written by Rickard E. (Rik) Faith <faith@redhat.com>
21 * 21 *
22 */ 22 */
23
24#ifndef _LINUX_AUDIT_H_ 23#ifndef _LINUX_AUDIT_H_
25#define _LINUX_AUDIT_H_ 24#define _LINUX_AUDIT_H_
26 25
27#include <linux/types.h>
28#include <linux/elf-em.h>
29#include <linux/ptrace.h>
30
31/* The netlink messages for the audit system is divided into blocks:
32 * 1000 - 1099 are for commanding the audit system
33 * 1100 - 1199 user space trusted application messages
34 * 1200 - 1299 messages internal to the audit daemon
35 * 1300 - 1399 audit event messages
36 * 1400 - 1499 SE Linux use
37 * 1500 - 1599 kernel LSPP events
38 * 1600 - 1699 kernel crypto events
39 * 1700 - 1799 kernel anomaly records
40 * 1800 - 1899 kernel integrity events
41 * 1900 - 1999 future kernel use
42 * 2000 is for otherwise unclassified kernel audit messages (legacy)
43 * 2001 - 2099 unused (kernel)
44 * 2100 - 2199 user space anomaly records
45 * 2200 - 2299 user space actions taken in response to anomalies
46 * 2300 - 2399 user space generated LSPP events
47 * 2400 - 2499 user space crypto events
48 * 2500 - 2999 future user space (maybe integrity labels and related events)
49 *
50 * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
51 * exclusively user space. 1300-2099 is kernel --> user space
52 * communication.
53 */
54#define AUDIT_GET 1000 /* Get status */
55#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
56#define AUDIT_LIST 1002 /* List syscall rules -- deprecated */
57#define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */
58#define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */
59#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
60#define AUDIT_LOGIN 1006 /* Define the login id and information */
61#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
62#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
63#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
64#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
65#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
66#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
67#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
68#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
69#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
70#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
71#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
72
73#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
74#define AUDIT_USER_AVC 1107 /* We filter this differently */
75#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
76#define AUDIT_LAST_USER_MSG 1199
77#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
78#define AUDIT_LAST_USER_MSG2 2999
79
80#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
81#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
82#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
83#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
84
85#define AUDIT_SYSCALL 1300 /* Syscall event */
86/* #define AUDIT_FS_WATCH 1301 * Deprecated */
87#define AUDIT_PATH 1302 /* Filename path information */
88#define AUDIT_IPC 1303 /* IPC record */
89#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
90#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
91#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
92#define AUDIT_CWD 1307 /* Current working directory */
93#define AUDIT_EXECVE 1309 /* execve arguments */
94#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
95#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
96#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
97#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
98#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
99#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
100#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
101#define AUDIT_OBJ_PID 1318 /* ptrace target */
102#define AUDIT_TTY 1319 /* Input on an administrative TTY */
103#define AUDIT_EOE 1320 /* End of multi-record event */
104#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
105#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
106#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
107#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */
108#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */
109
110#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
111#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
112#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
113#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
114#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
115#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
116#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
117#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
118#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
119#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
120#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
121#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */
122#define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */
123#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */
124#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
125#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
126#define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */
127#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */
128
129#define AUDIT_FIRST_KERN_ANOM_MSG 1700
130#define AUDIT_LAST_KERN_ANOM_MSG 1799
131#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
132#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
133#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
134#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
135#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
136#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
137#define AUDIT_INTEGRITY_HASH 1803 /* Integrity HASH type */
138#define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */
139#define AUDIT_INTEGRITY_RULE 1805 /* policy rule */
140
141#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
142
143/* Rule flags */
144#define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */
145#define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */
146#define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */
147#define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */
148#define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */
149#define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */
150
151#define AUDIT_NR_FILTERS 6
152
153#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
154
155/* Rule actions */
156#define AUDIT_NEVER 0 /* Do not build context if rule matches */
157#define AUDIT_POSSIBLE 1 /* Build context if rule matches */
158#define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */
159
160/* Rule structure sizes -- if these change, different AUDIT_ADD and
161 * AUDIT_LIST commands must be implemented. */
162#define AUDIT_MAX_FIELDS 64
163#define AUDIT_MAX_KEY_LEN 256
164#define AUDIT_BITMASK_SIZE 64
165#define AUDIT_WORD(nr) ((__u32)((nr)/32))
166#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
167
168#define AUDIT_SYSCALL_CLASSES 16
169#define AUDIT_CLASS_DIR_WRITE 0
170#define AUDIT_CLASS_DIR_WRITE_32 1
171#define AUDIT_CLASS_CHATTR 2
172#define AUDIT_CLASS_CHATTR_32 3
173#define AUDIT_CLASS_READ 4
174#define AUDIT_CLASS_READ_32 5
175#define AUDIT_CLASS_WRITE 6
176#define AUDIT_CLASS_WRITE_32 7
177#define AUDIT_CLASS_SIGNAL 8
178#define AUDIT_CLASS_SIGNAL_32 9
179
180/* This bitmask is used to validate user input. It represents all bits that
181 * are currently used in an audit field constant understood by the kernel.
182 * If you are adding a new #define AUDIT_<whatever>, please ensure that
183 * AUDIT_UNUSED_BITS is updated if need be. */
184#define AUDIT_UNUSED_BITS 0x07FFFC00
185
186/* AUDIT_FIELD_COMPARE rule list */
187#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
188#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
189#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
190#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
191#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
192#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
193#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
194#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
195#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
196
197#define AUDIT_COMPARE_UID_TO_AUID 10
198#define AUDIT_COMPARE_UID_TO_EUID 11
199#define AUDIT_COMPARE_UID_TO_FSUID 12
200#define AUDIT_COMPARE_UID_TO_SUID 13
201
202#define AUDIT_COMPARE_AUID_TO_FSUID 14
203#define AUDIT_COMPARE_AUID_TO_SUID 15
204#define AUDIT_COMPARE_AUID_TO_EUID 16
205
206#define AUDIT_COMPARE_EUID_TO_SUID 17
207#define AUDIT_COMPARE_EUID_TO_FSUID 18
208
209#define AUDIT_COMPARE_SUID_TO_FSUID 19
210
211#define AUDIT_COMPARE_GID_TO_EGID 20
212#define AUDIT_COMPARE_GID_TO_FSGID 21
213#define AUDIT_COMPARE_GID_TO_SGID 22
214
215#define AUDIT_COMPARE_EGID_TO_FSGID 23
216#define AUDIT_COMPARE_EGID_TO_SGID 24
217#define AUDIT_COMPARE_SGID_TO_FSGID 25
218
219#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID
220
221/* Rule fields */
222 /* These are useful when checking the
223 * task structure at task creation time
224 * (AUDIT_PER_TASK). */
225#define AUDIT_PID 0
226#define AUDIT_UID 1
227#define AUDIT_EUID 2
228#define AUDIT_SUID 3
229#define AUDIT_FSUID 4
230#define AUDIT_GID 5
231#define AUDIT_EGID 6
232#define AUDIT_SGID 7
233#define AUDIT_FSGID 8
234#define AUDIT_LOGINUID 9
235#define AUDIT_PERS 10
236#define AUDIT_ARCH 11
237#define AUDIT_MSGTYPE 12
238#define AUDIT_SUBJ_USER 13 /* security label user */
239#define AUDIT_SUBJ_ROLE 14 /* security label role */
240#define AUDIT_SUBJ_TYPE 15 /* security label type */
241#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
242#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
243#define AUDIT_PPID 18
244#define AUDIT_OBJ_USER 19
245#define AUDIT_OBJ_ROLE 20
246#define AUDIT_OBJ_TYPE 21
247#define AUDIT_OBJ_LEV_LOW 22
248#define AUDIT_OBJ_LEV_HIGH 23
249
250 /* These are ONLY useful when checking
251 * at syscall exit time (AUDIT_AT_EXIT). */
252#define AUDIT_DEVMAJOR 100
253#define AUDIT_DEVMINOR 101
254#define AUDIT_INODE 102
255#define AUDIT_EXIT 103
256#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
257#define AUDIT_WATCH 105
258#define AUDIT_PERM 106
259#define AUDIT_DIR 107
260#define AUDIT_FILETYPE 108
261#define AUDIT_OBJ_UID 109
262#define AUDIT_OBJ_GID 110
263#define AUDIT_FIELD_COMPARE 111
264
265#define AUDIT_ARG0 200
266#define AUDIT_ARG1 (AUDIT_ARG0+1)
267#define AUDIT_ARG2 (AUDIT_ARG0+2)
268#define AUDIT_ARG3 (AUDIT_ARG0+3)
269
270#define AUDIT_FILTERKEY 210
271
272#define AUDIT_NEGATE 0x80000000
273
274/* These are the supported operators.
275 * 4 2 1 8
276 * = > < ?
277 * ----------
278 * 0 0 0 0 00 nonsense
279 * 0 0 0 1 08 & bit mask
280 * 0 0 1 0 10 <
281 * 0 1 0 0 20 >
282 * 0 1 1 0 30 !=
283 * 1 0 0 0 40 =
284 * 1 0 0 1 48 &= bit test
285 * 1 0 1 0 50 <=
286 * 1 1 0 0 60 >=
287 * 1 1 1 1 78 all operators
288 */
289#define AUDIT_BIT_MASK 0x08000000
290#define AUDIT_LESS_THAN 0x10000000
291#define AUDIT_GREATER_THAN 0x20000000
292#define AUDIT_NOT_EQUAL 0x30000000
293#define AUDIT_EQUAL 0x40000000
294#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
295#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
296#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
297#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
298
299enum {
300 Audit_equal,
301 Audit_not_equal,
302 Audit_bitmask,
303 Audit_bittest,
304 Audit_lt,
305 Audit_gt,
306 Audit_le,
307 Audit_ge,
308 Audit_bad
309};
310
311/* Status symbols */
312 /* Mask values */
313#define AUDIT_STATUS_ENABLED 0x0001
314#define AUDIT_STATUS_FAILURE 0x0002
315#define AUDIT_STATUS_PID 0x0004
316#define AUDIT_STATUS_RATE_LIMIT 0x0008
317#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
318 /* Failure-to-log actions */
319#define AUDIT_FAIL_SILENT 0
320#define AUDIT_FAIL_PRINTK 1
321#define AUDIT_FAIL_PANIC 2
322
323/* distinguish syscall tables */
324#define __AUDIT_ARCH_64BIT 0x80000000
325#define __AUDIT_ARCH_LE 0x40000000
326#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
327#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
328#define AUDIT_ARCH_ARMEB (EM_ARM)
329#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
330#define AUDIT_ARCH_FRV (EM_FRV)
331#define AUDIT_ARCH_H8300 (EM_H8_300)
332#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
333#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
334#define AUDIT_ARCH_M32R (EM_M32R)
335#define AUDIT_ARCH_M68K (EM_68K)
336#define AUDIT_ARCH_MIPS (EM_MIPS)
337#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
338#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
339#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
340#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
341#define AUDIT_ARCH_PARISC (EM_PARISC)
342#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
343#define AUDIT_ARCH_PPC (EM_PPC)
344#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
345#define AUDIT_ARCH_S390 (EM_S390)
346#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
347#define AUDIT_ARCH_SH (EM_SH)
348#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
349#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
350#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
351#define AUDIT_ARCH_SPARC (EM_SPARC)
352#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
353#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
354
355#define AUDIT_PERM_EXEC 1
356#define AUDIT_PERM_WRITE 2
357#define AUDIT_PERM_READ 4
358#define AUDIT_PERM_ATTR 8
359
360struct audit_status {
361 __u32 mask; /* Bit mask for valid entries */
362 __u32 enabled; /* 1 = enabled, 0 = disabled */
363 __u32 failure; /* Failure-to-log action */
364 __u32 pid; /* pid of auditd process */
365 __u32 rate_limit; /* messages rate limit (per second) */
366 __u32 backlog_limit; /* waiting messages limit */
367 __u32 lost; /* messages lost */
368 __u32 backlog; /* messages waiting in queue */
369};
370
371struct audit_tty_status {
372 __u32 enabled; /* 1 = enabled, 0 = disabled */
373};
374
375/* audit_rule_data supports filter rules with both integer and string
376 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
377 * AUDIT_LIST_RULES requests.
378 */
379struct audit_rule_data {
380 __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
381 __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
382 __u32 field_count;
383 __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
384 __u32 fields[AUDIT_MAX_FIELDS];
385 __u32 values[AUDIT_MAX_FIELDS];
386 __u32 fieldflags[AUDIT_MAX_FIELDS];
387 __u32 buflen; /* total length of string fields */
388 char buf[0]; /* string fields buffer */
389};
390
391/* audit_rule is supported to maintain backward compatibility with
392 * userspace. It supports integer fields only and corresponds to
393 * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
394 */
395struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
396 __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
397 __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
398 __u32 field_count;
399 __u32 mask[AUDIT_BITMASK_SIZE];
400 __u32 fields[AUDIT_MAX_FIELDS];
401 __u32 values[AUDIT_MAX_FIELDS];
402};
403
404#ifdef __KERNEL__
405#include <linux/sched.h> 26#include <linux/sched.h>
27#include <uapi/linux/audit.h>
406 28
407struct audit_sig_info { 29struct audit_sig_info {
408 uid_t uid; 30 uid_t uid;
@@ -860,4 +482,3 @@ static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
860} 482}
861 483
862#endif 484#endif
863#endif
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
index da64e15004b..fcd704d354c 100644
--- a/include/linux/auto_fs.h
+++ b/include/linux/auto_fs.h
@@ -10,77 +10,11 @@
10 * 10 *
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13
14#ifndef _LINUX_AUTO_FS_H 13#ifndef _LINUX_AUTO_FS_H
15#define _LINUX_AUTO_FS_H 14#define _LINUX_AUTO_FS_H
16 15
17#include <linux/types.h>
18#ifdef __KERNEL__
19#include <linux/fs.h> 16#include <linux/fs.h>
20#include <linux/limits.h> 17#include <linux/limits.h>
21#include <linux/ioctl.h> 18#include <linux/ioctl.h>
22#else 19#include <uapi/linux/auto_fs.h>
23#include <sys/ioctl.h>
24#endif /* __KERNEL__ */
25
26/* This file describes autofs v3 */
27#define AUTOFS_PROTO_VERSION 3
28
29/* Range of protocol versions defined */
30#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
31#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
32
33/*
34 * Architectures where both 32- and 64-bit binaries can be executed
35 * on 64-bit kernels need this. This keeps the structure format
36 * uniform, and makes sure the wait_queue_token isn't too big to be
37 * passed back down to the kernel.
38 *
39 * This assumes that on these architectures:
40 * mode 32 bit 64 bit
41 * -------------------------
42 * int 32 bit 32 bit
43 * long 32 bit 64 bit
44 *
45 * If so, 32-bit user-space code should be backwards compatible.
46 */
47
48#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
49 || defined(__powerpc__) || defined(__s390__)
50typedef unsigned int autofs_wqt_t;
51#else
52typedef unsigned long autofs_wqt_t;
53#endif
54
55/* Packet types */
56#define autofs_ptype_missing 0 /* Missing entry (mount request) */
57#define autofs_ptype_expire 1 /* Expire entry (umount request) */
58
59struct autofs_packet_hdr {
60 int proto_version; /* Protocol version */
61 int type; /* Type of packet */
62};
63
64struct autofs_packet_missing {
65 struct autofs_packet_hdr hdr;
66 autofs_wqt_t wait_queue_token;
67 int len;
68 char name[NAME_MAX+1];
69};
70
71/* v3 expire (via ioctl) */
72struct autofs_packet_expire {
73 struct autofs_packet_hdr hdr;
74 int len;
75 char name[NAME_MAX+1];
76};
77
78#define AUTOFS_IOC_READY _IO(0x93,0x60)
79#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
80#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
81#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
82#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
83#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
84#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
85
86#endif /* _LINUX_AUTO_FS_H */ 20#endif /* _LINUX_AUTO_FS_H */
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index f3b5d4e3a2a..669fef5c745 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -1,39 +1,8 @@
1#ifndef _LINUX_AUXVEC_H 1#ifndef _LINUX_AUXVEC_H
2#define _LINUX_AUXVEC_H 2#define _LINUX_AUXVEC_H
3 3
4#include <asm/auxvec.h> 4#include <uapi/linux/auxvec.h>
5 5
6/* Symbolic values for the entries in the auxiliary table
7 put on the initial stack */
8#define AT_NULL 0 /* end of vector */
9#define AT_IGNORE 1 /* entry should be ignored */
10#define AT_EXECFD 2 /* file descriptor of program */
11#define AT_PHDR 3 /* program headers for program */
12#define AT_PHENT 4 /* size of program header entry */
13#define AT_PHNUM 5 /* number of program headers */
14#define AT_PAGESZ 6 /* system page size */
15#define AT_BASE 7 /* base address of interpreter */
16#define AT_FLAGS 8 /* flags */
17#define AT_ENTRY 9 /* entry point of program */
18#define AT_NOTELF 10 /* program is not ELF */
19#define AT_UID 11 /* real uid */
20#define AT_EUID 12 /* effective uid */
21#define AT_GID 13 /* real gid */
22#define AT_EGID 14 /* effective gid */
23#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
24#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
25#define AT_CLKTCK 17 /* frequency at which times() increments */
26/* AT_* values 18 through 22 are reserved */
27#define AT_SECURE 23 /* secure mode boolean */
28#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
29 * differ from AT_PLATFORM. */
30#define AT_RANDOM 25 /* address of 16 random bytes */
31
32#define AT_EXECFN 31 /* filename of program */
33
34#ifdef __KERNEL__
35#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ 6#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */
36 /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ 7 /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
37#endif
38
39#endif /* _LINUX_AUXVEC_H */ 8#endif /* _LINUX_AUXVEC_H */
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 26531f32bbb..cfcc6bfcaec 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -1,26 +1,10 @@
1#ifndef _LINUX_BINFMTS_H 1#ifndef _LINUX_BINFMTS_H
2#define _LINUX_BINFMTS_H 2#define _LINUX_BINFMTS_H
3 3
4#include <linux/capability.h>
5
6struct pt_regs;
7
8/*
9 * These are the maximum length and maximum number of strings passed to the
10 * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
11 * prevent the kernel from being unduly impacted by misaddressed pointers.
12 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
13 */
14#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
15#define MAX_ARG_STRINGS 0x7FFFFFFF
16
17/* sizeof(linux_binprm->buf) */
18#define BINPRM_BUF_SIZE 128
19
20#ifdef __KERNEL__
21#include <linux/sched.h> 4#include <linux/sched.h>
22#include <linux/unistd.h> 5#include <linux/unistd.h>
23#include <asm/exec.h> 6#include <asm/exec.h>
7#include <uapi/linux/binfmts.h>
24 8
25#define CORENAME_MAX_SIZE 128 9#define CORENAME_MAX_SIZE 128
26 10
@@ -141,5 +125,4 @@ extern void free_bprm(struct linux_binprm *);
141extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn; 125extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
142#endif 126#endif
143 127
144#endif /* __KERNEL__ */
145#endif /* _LINUX_BINFMTS_H */ 128#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 4d1a0748eaf..7c2e030e72f 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -1,150 +1,11 @@
1#ifndef BLKTRACE_H 1#ifndef BLKTRACE_H
2#define BLKTRACE_H 2#define BLKTRACE_H
3 3
4#include <linux/types.h>
5#ifdef __KERNEL__
6#include <linux/blkdev.h> 4#include <linux/blkdev.h>
7#include <linux/relay.h> 5#include <linux/relay.h>
8#include <linux/compat.h> 6#include <linux/compat.h>
9#endif 7#include <uapi/linux/blktrace_api.h>
10
11/*
12 * Trace categories
13 */
14enum blktrace_cat {
15 BLK_TC_READ = 1 << 0, /* reads */
16 BLK_TC_WRITE = 1 << 1, /* writes */
17 BLK_TC_FLUSH = 1 << 2, /* flush */
18 BLK_TC_SYNC = 1 << 3, /* sync IO */
19 BLK_TC_SYNCIO = BLK_TC_SYNC,
20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
21 BLK_TC_REQUEUE = 1 << 5, /* requeueing */
22 BLK_TC_ISSUE = 1 << 6, /* issue */
23 BLK_TC_COMPLETE = 1 << 7, /* completions */
24 BLK_TC_FS = 1 << 8, /* fs requests */
25 BLK_TC_PC = 1 << 9, /* pc requests */
26 BLK_TC_NOTIFY = 1 << 10, /* special message */
27 BLK_TC_AHEAD = 1 << 11, /* readahead */
28 BLK_TC_META = 1 << 12, /* metadata */
29 BLK_TC_DISCARD = 1 << 13, /* discard requests */
30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
31 BLK_TC_FUA = 1 << 15, /* fua requests */
32
33 BLK_TC_END = 1 << 15, /* we've run out of bits! */
34};
35
36#define BLK_TC_SHIFT (16)
37#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
38
39/*
40 * Basic trace actions
41 */
42enum blktrace_act {
43 __BLK_TA_QUEUE = 1, /* queued */
44 __BLK_TA_BACKMERGE, /* back merged to existing rq */
45 __BLK_TA_FRONTMERGE, /* front merge to existing rq */
46 __BLK_TA_GETRQ, /* allocated new request */
47 __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */
48 __BLK_TA_REQUEUE, /* request requeued */
49 __BLK_TA_ISSUE, /* sent to driver */
50 __BLK_TA_COMPLETE, /* completed by driver */
51 __BLK_TA_PLUG, /* queue was plugged */
52 __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */
53 __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */
54 __BLK_TA_INSERT, /* insert request */
55 __BLK_TA_SPLIT, /* bio was split */
56 __BLK_TA_BOUNCE, /* bio was bounced */
57 __BLK_TA_REMAP, /* bio was remapped */
58 __BLK_TA_ABORT, /* request aborted */
59 __BLK_TA_DRV_DATA, /* driver-specific binary data */
60};
61
62/*
63 * Notify events.
64 */
65enum blktrace_notify {
66 __BLK_TN_PROCESS = 0, /* establish pid/name mapping */
67 __BLK_TN_TIMESTAMP, /* include system clock */
68 __BLK_TN_MESSAGE, /* Character string message */
69};
70
71
72/*
73 * Trace actions in full. Additionally, read or write is masked
74 */
75#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
76#define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
77#define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
78#define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
79#define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
80#define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
81#define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
82#define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
83#define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
84#define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
85#define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
86#define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
87#define BLK_TA_SPLIT (__BLK_TA_SPLIT)
88#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
89#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
90#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
91#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
92
93#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
94#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
95#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
96
97#define BLK_IO_TRACE_MAGIC 0x65617400
98#define BLK_IO_TRACE_VERSION 0x07
99
100/*
101 * The trace itself
102 */
103struct blk_io_trace {
104 __u32 magic; /* MAGIC << 8 | version */
105 __u32 sequence; /* event number */
106 __u64 time; /* in microseconds */
107 __u64 sector; /* disk offset */
108 __u32 bytes; /* transfer length */
109 __u32 action; /* what happened */
110 __u32 pid; /* who did it */
111 __u32 device; /* device number */
112 __u32 cpu; /* on what cpu did it happen */
113 __u16 error; /* completion error */
114 __u16 pdu_len; /* length of data after this trace */
115};
116
117/*
118 * The remap event
119 */
120struct blk_io_trace_remap {
121 __be32 device_from;
122 __be32 device_to;
123 __be64 sector_from;
124};
125
126enum {
127 Blktrace_setup = 1,
128 Blktrace_running,
129 Blktrace_stopped,
130};
131
132#define BLKTRACE_BDEV_SIZE 32
133
134/*
135 * User setup structure passed with BLKTRACESTART
136 */
137struct blk_user_trace_setup {
138 char name[BLKTRACE_BDEV_SIZE]; /* output */
139 __u16 act_mask; /* input */
140 __u32 buf_size; /* input */
141 __u32 buf_nr; /* input */
142 __u64 start_lba;
143 __u64 end_lba;
144 __u32 pid;
145};
146 8
147#ifdef __KERNEL__
148#if defined(CONFIG_BLK_DEV_IO_TRACE) 9#if defined(CONFIG_BLK_DEV_IO_TRACE)
149 10
150#include <linux/sysfs.h> 11#include <linux/sysfs.h>
@@ -250,5 +111,4 @@ extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
250 111
251#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */ 112#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
252 113
253#endif /* __KERNEL__ */
254#endif 114#endif
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index ecb4730d086..7173f6e9d2d 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -1,67 +1,8 @@
1#ifndef BSG_H 1#ifndef BSG_H
2#define BSG_H 2#define BSG_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/bsg.h>
5 5
6#define BSG_PROTOCOL_SCSI 0
7
8#define BSG_SUB_PROTOCOL_SCSI_CMD 0
9#define BSG_SUB_PROTOCOL_SCSI_TMF 1
10#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
11
12/*
13 * For flags member below
14 * sg.h sg_io_hdr also has bits defined for it's flags member. However
15 * none of these bits are implemented/used by bsg. The bits below are
16 * allocated to not conflict with sg.h ones anyway.
17 */
18#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
19
20struct sg_io_v4 {
21 __s32 guard; /* [i] 'Q' to differentiate from v3 */
22 __u32 protocol; /* [i] 0 -> SCSI , .... */
23 __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
24 management function, .... */
25
26 __u32 request_len; /* [i] in bytes */
27 __u64 request; /* [i], [*i] {SCSI: cdb} */
28 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
29 __u32 request_attr; /* [i] {SCSI: task attribute} */
30 __u32 request_priority; /* [i] {SCSI: task priority} */
31 __u32 request_extra; /* [i] {spare, for padding} */
32 __u32 max_response_len; /* [i] in bytes */
33 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
34
35 /* "dout_": data out (to device); "din_": data in (from device) */
36 __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
37 dout_xfer points to array of iovec */
38 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
39 __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
40 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
41 __u64 dout_xferp; /* [i], [*i] */
42 __u64 din_xferp; /* [i], [*o] */
43
44 __u32 timeout; /* [i] units: millisecond */
45 __u32 flags; /* [i] bit mask */
46 __u64 usr_ptr; /* [i->o] unused internally */
47 __u32 spare_in; /* [i] */
48
49 __u32 driver_status; /* [o] 0 -> ok */
50 __u32 transport_status; /* [o] 0 -> ok */
51 __u32 device_status; /* [o] {SCSI: command completion status} */
52 __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
53 __u32 info; /* [o] additional information */
54 __u32 duration; /* [o] time to complete, in milliseconds */
55 __u32 response_len; /* [o] bytes of response actually written */
56 __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
57 __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
58 __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
59 __u32 spare_out; /* [o] */
60
61 __u32 padding;
62};
63
64#ifdef __KERNEL__
65 6
66#if defined(CONFIG_BLK_DEV_BSG) 7#if defined(CONFIG_BLK_DEV_BSG)
67struct bsg_class_device { 8struct bsg_class_device {
@@ -89,6 +30,4 @@ static inline void bsg_unregister_queue(struct request_queue *q)
89} 30}
90#endif 31#endif
91 32
92#endif /* __KERNEL__ */
93
94#endif 33#endif
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild
index 5896e344ba6..e69de29bb2d 100644
--- a/include/linux/byteorder/Kbuild
+++ b/include/linux/byteorder/Kbuild
@@ -1,2 +0,0 @@
1header-y += big_endian.h
2header-y += little_endian.h
diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h
index 3c80fd7e8b5..392041475c7 100644
--- a/include/linux/byteorder/big_endian.h
+++ b/include/linux/byteorder/big_endian.h
@@ -1,108 +1,7 @@
1#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H 1#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
2#define _LINUX_BYTEORDER_BIG_ENDIAN_H 2#define _LINUX_BYTEORDER_BIG_ENDIAN_H
3 3
4#ifndef __BIG_ENDIAN 4#include <uapi/linux/byteorder/big_endian.h>
5#define __BIG_ENDIAN 4321
6#endif
7#ifndef __BIG_ENDIAN_BITFIELD
8#define __BIG_ENDIAN_BITFIELD
9#endif
10 5
11#include <linux/types.h>
12#include <linux/swab.h>
13
14#define __constant_htonl(x) ((__force __be32)(__u32)(x))
15#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
16#define __constant_htons(x) ((__force __be16)(__u16)(x))
17#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
18#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
19#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
20#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
21#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
22#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
23#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
24#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
25#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
26#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
27#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
28#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
29#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
30#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
31#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
32#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
33#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
34#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
35#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
36#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
37#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
38#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
39#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
40#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
41#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
42
43static inline __le64 __cpu_to_le64p(const __u64 *p)
44{
45 return (__force __le64)__swab64p(p);
46}
47static inline __u64 __le64_to_cpup(const __le64 *p)
48{
49 return __swab64p((__u64 *)p);
50}
51static inline __le32 __cpu_to_le32p(const __u32 *p)
52{
53 return (__force __le32)__swab32p(p);
54}
55static inline __u32 __le32_to_cpup(const __le32 *p)
56{
57 return __swab32p((__u32 *)p);
58}
59static inline __le16 __cpu_to_le16p(const __u16 *p)
60{
61 return (__force __le16)__swab16p(p);
62}
63static inline __u16 __le16_to_cpup(const __le16 *p)
64{
65 return __swab16p((__u16 *)p);
66}
67static inline __be64 __cpu_to_be64p(const __u64 *p)
68{
69 return (__force __be64)*p;
70}
71static inline __u64 __be64_to_cpup(const __be64 *p)
72{
73 return (__force __u64)*p;
74}
75static inline __be32 __cpu_to_be32p(const __u32 *p)
76{
77 return (__force __be32)*p;
78}
79static inline __u32 __be32_to_cpup(const __be32 *p)
80{
81 return (__force __u32)*p;
82}
83static inline __be16 __cpu_to_be16p(const __u16 *p)
84{
85 return (__force __be16)*p;
86}
87static inline __u16 __be16_to_cpup(const __be16 *p)
88{
89 return (__force __u16)*p;
90}
91#define __cpu_to_le64s(x) __swab64s((x))
92#define __le64_to_cpus(x) __swab64s((x))
93#define __cpu_to_le32s(x) __swab32s((x))
94#define __le32_to_cpus(x) __swab32s((x))
95#define __cpu_to_le16s(x) __swab16s((x))
96#define __le16_to_cpus(x) __swab16s((x))
97#define __cpu_to_be64s(x) do { (void)(x); } while (0)
98#define __be64_to_cpus(x) do { (void)(x); } while (0)
99#define __cpu_to_be32s(x) do { (void)(x); } while (0)
100#define __be32_to_cpus(x) do { (void)(x); } while (0)
101#define __cpu_to_be16s(x) do { (void)(x); } while (0)
102#define __be16_to_cpus(x) do { (void)(x); } while (0)
103
104#ifdef __KERNEL__
105#include <linux/byteorder/generic.h> 6#include <linux/byteorder/generic.h>
106#endif
107
108#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ 7#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h
index 83195fb8296..08057377aa2 100644
--- a/include/linux/byteorder/little_endian.h
+++ b/include/linux/byteorder/little_endian.h
@@ -1,108 +1,7 @@
1#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H 1#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
2#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H 2#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
3 3
4#ifndef __LITTLE_ENDIAN 4#include <uapi/linux/byteorder/little_endian.h>
5#define __LITTLE_ENDIAN 1234
6#endif
7#ifndef __LITTLE_ENDIAN_BITFIELD
8#define __LITTLE_ENDIAN_BITFIELD
9#endif
10 5
11#include <linux/types.h>
12#include <linux/swab.h>
13
14#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
15#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
16#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
17#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
18#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
19#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
20#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
21#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
22#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
23#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
24#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
25#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
26#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
27#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
28#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
29#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
30#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
31#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
32#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
33#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
34#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
35#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
36#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
37#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
38#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
39#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
40#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
41#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
42
43static inline __le64 __cpu_to_le64p(const __u64 *p)
44{
45 return (__force __le64)*p;
46}
47static inline __u64 __le64_to_cpup(const __le64 *p)
48{
49 return (__force __u64)*p;
50}
51static inline __le32 __cpu_to_le32p(const __u32 *p)
52{
53 return (__force __le32)*p;
54}
55static inline __u32 __le32_to_cpup(const __le32 *p)
56{
57 return (__force __u32)*p;
58}
59static inline __le16 __cpu_to_le16p(const __u16 *p)
60{
61 return (__force __le16)*p;
62}
63static inline __u16 __le16_to_cpup(const __le16 *p)
64{
65 return (__force __u16)*p;
66}
67static inline __be64 __cpu_to_be64p(const __u64 *p)
68{
69 return (__force __be64)__swab64p(p);
70}
71static inline __u64 __be64_to_cpup(const __be64 *p)
72{
73 return __swab64p((__u64 *)p);
74}
75static inline __be32 __cpu_to_be32p(const __u32 *p)
76{
77 return (__force __be32)__swab32p(p);
78}
79static inline __u32 __be32_to_cpup(const __be32 *p)
80{
81 return __swab32p((__u32 *)p);
82}
83static inline __be16 __cpu_to_be16p(const __u16 *p)
84{
85 return (__force __be16)__swab16p(p);
86}
87static inline __u16 __be16_to_cpup(const __be16 *p)
88{
89 return __swab16p((__u16 *)p);
90}
91#define __cpu_to_le64s(x) do { (void)(x); } while (0)
92#define __le64_to_cpus(x) do { (void)(x); } while (0)
93#define __cpu_to_le32s(x) do { (void)(x); } while (0)
94#define __le32_to_cpus(x) do { (void)(x); } while (0)
95#define __cpu_to_le16s(x) do { (void)(x); } while (0)
96#define __le16_to_cpus(x) do { (void)(x); } while (0)
97#define __cpu_to_be64s(x) __swab64s((x))
98#define __be64_to_cpus(x) __swab64s((x))
99#define __cpu_to_be32s(x) __swab32s((x))
100#define __be32_to_cpus(x) __swab32s((x))
101#define __cpu_to_be16s(x) __swab16s((x))
102#define __be16_to_cpus(x) __swab16s((x))
103
104#ifdef __KERNEL__
105#include <linux/byteorder/generic.h> 6#include <linux/byteorder/generic.h>
106#endif
107
108#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ 7#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
diff --git a/include/linux/capability.h b/include/linux/capability.h
index d10b7ed595b..98503b79236 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -9,82 +9,11 @@
9 * 9 *
10 * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ 10 * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
11 */ 11 */
12
13#ifndef _LINUX_CAPABILITY_H 12#ifndef _LINUX_CAPABILITY_H
14#define _LINUX_CAPABILITY_H 13#define _LINUX_CAPABILITY_H
15 14
16#include <linux/types.h> 15#include <uapi/linux/capability.h>
17
18struct task_struct;
19
20/* User-level do most of the mapping between kernel and user
21 capabilities based on the version tag given by the kernel. The
22 kernel might be somewhat backwards compatible, but don't bet on
23 it. */
24
25/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
26 a set of three capability sets. The transposition of 3*the
27 following structure to such a composite is better handled in a user
28 library since the draft standard requires the use of malloc/free
29 etc.. */
30
31#define _LINUX_CAPABILITY_VERSION_1 0x19980330
32#define _LINUX_CAPABILITY_U32S_1 1
33
34#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */
35#define _LINUX_CAPABILITY_U32S_2 2
36
37#define _LINUX_CAPABILITY_VERSION_3 0x20080522
38#define _LINUX_CAPABILITY_U32S_3 2
39
40typedef struct __user_cap_header_struct {
41 __u32 version;
42 int pid;
43} __user *cap_user_header_t;
44
45typedef struct __user_cap_data_struct {
46 __u32 effective;
47 __u32 permitted;
48 __u32 inheritable;
49} __user *cap_user_data_t;
50
51
52#define VFS_CAP_REVISION_MASK 0xFF000000
53#define VFS_CAP_REVISION_SHIFT 24
54#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
55#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
56
57#define VFS_CAP_REVISION_1 0x01000000
58#define VFS_CAP_U32_1 1
59#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
60
61#define VFS_CAP_REVISION_2 0x02000000
62#define VFS_CAP_U32_2 2
63#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
64 16
65#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
66#define VFS_CAP_U32 VFS_CAP_U32_2
67#define VFS_CAP_REVISION VFS_CAP_REVISION_2
68
69struct vfs_cap_data {
70 __le32 magic_etc; /* Little endian */
71 struct {
72 __le32 permitted; /* Little endian */
73 __le32 inheritable; /* Little endian */
74 } data[VFS_CAP_U32];
75};
76
77#ifndef __KERNEL__
78
79/*
80 * Backwardly compatible definition for source code - trapped in a
81 * 32-bit world. If you find you need this, please consider using
82 * libcap to untrap yourself...
83 */
84#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
85#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
86
87#else
88 17
89#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 18#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
90#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 19#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
@@ -105,277 +34,6 @@ struct cpu_vfs_cap_data {
105#define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct)) 34#define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct))
106#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) 35#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
107 36
108#endif
109
110
111/**
112 ** POSIX-draft defined capabilities.
113 **/
114
115/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
116 overrides the restriction of changing file ownership and group
117 ownership. */
118
119#define CAP_CHOWN 0
120
121/* Override all DAC access, including ACL execute access if
122 [_POSIX_ACL] is defined. Excluding DAC access covered by
123 CAP_LINUX_IMMUTABLE. */
124
125#define CAP_DAC_OVERRIDE 1
126
127/* Overrides all DAC restrictions regarding read and search on files
128 and directories, including ACL restrictions if [_POSIX_ACL] is
129 defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
130
131#define CAP_DAC_READ_SEARCH 2
132
133/* Overrides all restrictions about allowed operations on files, where
134 file owner ID must be equal to the user ID, except where CAP_FSETID
135 is applicable. It doesn't override MAC and DAC restrictions. */
136
137#define CAP_FOWNER 3
138
139/* Overrides the following restrictions that the effective user ID
140 shall match the file owner ID when setting the S_ISUID and S_ISGID
141 bits on that file; that the effective group ID (or one of the
142 supplementary group IDs) shall match the file owner ID when setting
143 the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
144 cleared on successful return from chown(2) (not implemented). */
145
146#define CAP_FSETID 4
147
148/* Overrides the restriction that the real or effective user ID of a
149 process sending a signal must match the real or effective user ID
150 of the process receiving the signal. */
151
152#define CAP_KILL 5
153
154/* Allows setgid(2) manipulation */
155/* Allows setgroups(2) */
156/* Allows forged gids on socket credentials passing. */
157
158#define CAP_SETGID 6
159
160/* Allows set*uid(2) manipulation (including fsuid). */
161/* Allows forged pids on socket credentials passing. */
162
163#define CAP_SETUID 7
164
165
166/**
167 ** Linux-specific capabilities
168 **/
169
170/* Without VFS support for capabilities:
171 * Transfer any capability in your permitted set to any pid,
172 * remove any capability in your permitted set from any pid
173 * With VFS support for capabilities (neither of above, but)
174 * Add any capability from current's capability bounding set
175 * to the current process' inheritable set
176 * Allow taking bits out of capability bounding set
177 * Allow modification of the securebits for a process
178 */
179
180#define CAP_SETPCAP 8
181
182/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
183
184#define CAP_LINUX_IMMUTABLE 9
185
186/* Allows binding to TCP/UDP sockets below 1024 */
187/* Allows binding to ATM VCIs below 32 */
188
189#define CAP_NET_BIND_SERVICE 10
190
191/* Allow broadcasting, listen to multicast */
192
193#define CAP_NET_BROADCAST 11
194
195/* Allow interface configuration */
196/* Allow administration of IP firewall, masquerading and accounting */
197/* Allow setting debug option on sockets */
198/* Allow modification of routing tables */
199/* Allow setting arbitrary process / process group ownership on
200 sockets */
201/* Allow binding to any address for transparent proxying (also via NET_RAW) */
202/* Allow setting TOS (type of service) */
203/* Allow setting promiscuous mode */
204/* Allow clearing driver statistics */
205/* Allow multicasting */
206/* Allow read/write of device-specific registers */
207/* Allow activation of ATM control sockets */
208
209#define CAP_NET_ADMIN 12
210
211/* Allow use of RAW sockets */
212/* Allow use of PACKET sockets */
213/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
214
215#define CAP_NET_RAW 13
216
217/* Allow locking of shared memory segments */
218/* Allow mlock and mlockall (which doesn't really have anything to do
219 with IPC) */
220
221#define CAP_IPC_LOCK 14
222
223/* Override IPC ownership checks */
224
225#define CAP_IPC_OWNER 15
226
227/* Insert and remove kernel modules - modify kernel without limit */
228#define CAP_SYS_MODULE 16
229
230/* Allow ioperm/iopl access */
231/* Allow sending USB messages to any device via /proc/bus/usb */
232
233#define CAP_SYS_RAWIO 17
234
235/* Allow use of chroot() */
236
237#define CAP_SYS_CHROOT 18
238
239/* Allow ptrace() of any process */
240
241#define CAP_SYS_PTRACE 19
242
243/* Allow configuration of process accounting */
244
245#define CAP_SYS_PACCT 20
246
247/* Allow configuration of the secure attention key */
248/* Allow administration of the random device */
249/* Allow examination and configuration of disk quotas */
250/* Allow setting the domainname */
251/* Allow setting the hostname */
252/* Allow calling bdflush() */
253/* Allow mount() and umount(), setting up new smb connection */
254/* Allow some autofs root ioctls */
255/* Allow nfsservctl */
256/* Allow VM86_REQUEST_IRQ */
257/* Allow to read/write pci config on alpha */
258/* Allow irix_prctl on mips (setstacksize) */
259/* Allow flushing all cache on m68k (sys_cacheflush) */
260/* Allow removing semaphores */
261/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
262 and shared memory */
263/* Allow locking/unlocking of shared memory segment */
264/* Allow turning swap on/off */
265/* Allow forged pids on socket credentials passing */
266/* Allow setting readahead and flushing buffers on block devices */
267/* Allow setting geometry in floppy driver */
268/* Allow turning DMA on/off in xd driver */
269/* Allow administration of md devices (mostly the above, but some
270 extra ioctls) */
271/* Allow tuning the ide driver */
272/* Allow access to the nvram device */
273/* Allow administration of apm_bios, serial and bttv (TV) device */
274/* Allow manufacturer commands in isdn CAPI support driver */
275/* Allow reading non-standardized portions of pci configuration space */
276/* Allow DDI debug ioctl on sbpcd driver */
277/* Allow setting up serial ports */
278/* Allow sending raw qic-117 commands */
279/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
280 arbitrary SCSI commands */
281/* Allow setting encryption key on loopback filesystem */
282/* Allow setting zone reclaim policy */
283
284#define CAP_SYS_ADMIN 21
285
286/* Allow use of reboot() */
287
288#define CAP_SYS_BOOT 22
289
290/* Allow raising priority and setting priority on other (different
291 UID) processes */
292/* Allow use of FIFO and round-robin (realtime) scheduling on own
293 processes and setting the scheduling algorithm used by another
294 process. */
295/* Allow setting cpu affinity on other processes */
296
297#define CAP_SYS_NICE 23
298
299/* Override resource limits. Set resource limits. */
300/* Override quota limits. */
301/* Override reserved space on ext2 filesystem */
302/* Modify data journaling mode on ext3 filesystem (uses journaling
303 resources) */
304/* NOTE: ext2 honors fsuid when checking for resource overrides, so
305 you can override using fsuid too */
306/* Override size restrictions on IPC message queues */
307/* Allow more than 64hz interrupts from the real-time clock */
308/* Override max number of consoles on console allocation */
309/* Override max number of keymaps */
310
311#define CAP_SYS_RESOURCE 24
312
313/* Allow manipulation of system clock */
314/* Allow irix_stime on mips */
315/* Allow setting the real-time clock */
316
317#define CAP_SYS_TIME 25
318
319/* Allow configuration of tty devices */
320/* Allow vhangup() of tty */
321
322#define CAP_SYS_TTY_CONFIG 26
323
324/* Allow the privileged aspects of mknod() */
325
326#define CAP_MKNOD 27
327
328/* Allow taking of leases on files */
329
330#define CAP_LEASE 28
331
332#define CAP_AUDIT_WRITE 29
333
334#define CAP_AUDIT_CONTROL 30
335
336#define CAP_SETFCAP 31
337
338/* Override MAC access.
339 The base kernel enforces no MAC policy.
340 An LSM may enforce a MAC policy, and if it does and it chooses
341 to implement capability based overrides of that policy, this is
342 the capability it should use to do so. */
343
344#define CAP_MAC_OVERRIDE 32
345
346/* Allow MAC configuration or state changes.
347 The base kernel requires no MAC configuration.
348 An LSM may enforce a MAC policy, and if it does and it chooses
349 to implement capability based checks on modifications to that
350 policy or the data required to maintain it, this is the
351 capability it should use to do so. */
352
353#define CAP_MAC_ADMIN 33
354
355/* Allow configuring the kernel's syslog (printk behaviour) */
356
357#define CAP_SYSLOG 34
358
359/* Allow triggering something that will wake the system */
360
361#define CAP_WAKE_ALARM 35
362
363/* Allow preventing system suspends */
364
365#define CAP_BLOCK_SUSPEND 36
366
367#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
368
369#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
370
371/*
372 * Bit location of each capability (used by user-space library and kernel)
373 */
374
375#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
376#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
377
378#ifdef __KERNEL__
379 37
380struct inode; 38struct inode;
381struct dentry; 39struct dentry;
@@ -557,6 +215,4 @@ extern bool inode_capable(const struct inode *inode, int cap);
557/* audit system wants to get cap info from files as well */ 215/* audit system wants to get cap info from files as well */
558extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); 216extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
559 217
560#endif /* __KERNEL__ */
561
562#endif /* !_LINUX_CAPABILITY_H */ 218#endif /* !_LINUX_CAPABILITY_H */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index 986493f5b92..84b6e2d0f44 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -1,91 +1,8 @@
1#ifndef CCISS_IOCTLH 1#ifndef CCISS_IOCTLH
2#define CCISS_IOCTLH 2#define CCISS_IOCTLH
3 3
4#include <linux/types.h> 4#include <uapi/linux/cciss_ioctl.h>
5#include <linux/ioctl.h>
6#include <linux/cciss_defs.h>
7 5
8#define CCISS_IOC_MAGIC 'B'
9
10
11typedef struct _cciss_pci_info_struct
12{
13 unsigned char bus;
14 unsigned char dev_fn;
15 unsigned short domain;
16 __u32 board_id;
17} cciss_pci_info_struct;
18
19typedef struct _cciss_coalint_struct
20{
21 __u32 delay;
22 __u32 count;
23} cciss_coalint_struct;
24
25typedef char NodeName_type[16];
26
27typedef __u32 Heartbeat_type;
28
29#define CISS_PARSCSIU2 0x0001
30#define CISS_PARCSCIU3 0x0002
31#define CISS_FIBRE1G 0x0100
32#define CISS_FIBRE2G 0x0200
33typedef __u32 BusTypes_type;
34
35typedef char FirmwareVer_type[4];
36typedef __u32 DriverVer_type;
37
38#define MAX_KMALLOC_SIZE 128000
39
40typedef struct _IOCTL_Command_struct {
41 LUNAddr_struct LUN_info;
42 RequestBlock_struct Request;
43 ErrorInfo_struct error_info;
44 WORD buf_size; /* size in bytes of the buf */
45 BYTE __user *buf;
46} IOCTL_Command_struct;
47
48typedef struct _BIG_IOCTL_Command_struct {
49 LUNAddr_struct LUN_info;
50 RequestBlock_struct Request;
51 ErrorInfo_struct error_info;
52 DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
53 DWORD buf_size; /* size in bytes of the buf */
54 /* < malloc_size * MAXSGENTRIES */
55 BYTE __user *buf;
56} BIG_IOCTL_Command_struct;
57
58typedef struct _LogvolInfo_struct{
59 __u32 LunID;
60 int num_opens; /* number of opens on the logical volume */
61 int num_parts; /* number of partitions configured on logvol */
62} LogvolInfo_struct;
63
64#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
65
66#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
67#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
68
69#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
70#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
71
72#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
73#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
74#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
75#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
76#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
77#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
78#define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
79
80/* no longer used... use REGNEWD instead */
81#define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
82
83#define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
84#define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
85#define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
86#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
87
88#ifdef __KERNEL__
89#ifdef CONFIG_COMPAT 6#ifdef CONFIG_COMPAT
90 7
91/* 32 bit compatible ioctl structs */ 8/* 32 bit compatible ioctl structs */
@@ -111,5 +28,4 @@ typedef struct _BIG_IOCTL32_Command_struct {
111#define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct) 28#define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct)
112 29
113#endif /* CONFIG_COMPAT */ 30#endif /* CONFIG_COMPAT */
114#endif /* __KERNEL__ */
115#endif 31#endif
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index dfd7f187c35..8609d577bb6 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -7,910 +7,12 @@
7 * 1997, 1998 Erik Andersen, andersee@debian.org 7 * 1997, 1998 Erik Andersen, andersee@debian.org
8 * 1998-2002 Jens Axboe, axboe@suse.de 8 * 1998-2002 Jens Axboe, axboe@suse.de
9 */ 9 */
10
11#ifndef _LINUX_CDROM_H 10#ifndef _LINUX_CDROM_H
12#define _LINUX_CDROM_H 11#define _LINUX_CDROM_H
13 12
14#include <linux/types.h>
15#include <asm/byteorder.h>
16
17/*******************************************************
18 * As of Linux 2.1.x, all Linux CD-ROM application programs will use this
19 * (and only this) include file. It is my hope to provide Linux with
20 * a uniform interface between software accessing CD-ROMs and the various
21 * device drivers that actually talk to the drives. There may still be
22 * 23 different kinds of strange CD-ROM drives, but at least there will
23 * now be one, and only one, Linux CD-ROM interface.
24 *
25 * Additionally, as of Linux 2.1.x, all Linux application programs
26 * should use the O_NONBLOCK option when opening a CD-ROM device
27 * for subsequent ioctl commands. This allows for neat system errors
28 * like "No medium found" or "Wrong medium type" upon attempting to
29 * mount or play an empty slot, mount an audio disc, or play a data disc.
30 * Generally, changing an application program to support O_NONBLOCK
31 * is as easy as the following:
32 * - drive = open("/dev/cdrom", O_RDONLY);
33 * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
34 * It is worth the small change.
35 *
36 * Patches for many common CD programs (provided by David A. van Leeuwen)
37 * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
38 *
39 *******************************************************/
40
41/* When a driver supports a certain function, but the cdrom drive we are
42 * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will
43 * borrow the "Operation not supported" error from the network folks to
44 * accomplish this. Maybe someday we will get a more targeted error code,
45 * but this will do for now... */
46#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
47
48/*******************************************************
49 * The CD-ROM IOCTL commands -- these should be supported by
50 * all the various cdrom drivers. For the CD-ROM ioctls, we
51 * will commandeer byte 0x53, or 'S'.
52 *******************************************************/
53#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
54#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
55#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
56#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
57 (struct cdrom_ti) */
58#define CDROMREADTOCHDR 0x5305 /* Read TOC header
59 (struct cdrom_tochdr) */
60#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
61 (struct cdrom_tocentry) */
62#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
63#define CDROMSTART 0x5308 /* Start the cdrom drive */
64#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
65#define CDROMVOLCTRL 0x530a /* Control output volume
66 (struct cdrom_volctrl) */
67#define CDROMSUBCHNL 0x530b /* Read subchannel data
68 (struct cdrom_subchnl) */
69#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
70 (struct cdrom_read) */
71#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
72 (struct cdrom_read) */
73#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
74#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
75#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
76 address of multi session disks
77 (struct cdrom_multisession) */
78#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
79 if available (struct cdrom_mcn) */
80#define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated,
81 but here anyway for compatibility */
82#define CDROMRESET 0x5312 /* hard-reset the drive */
83#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
84 (struct cdrom_volctrl) */
85#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
86 (struct cdrom_read) */
87/*
88 * These ioctls are used only used in aztcd.c and optcd.c
89 */
90#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
91#define CDROMSEEK 0x5316 /* seek msf address */
92
93/*
94 * This ioctl is only used by the scsi-cd driver.
95 It is for playing audio in logical block addressing mode.
96 */
97#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
98
99/*
100 * These ioctls are only used in optcd.c
101 */
102#define CDROMREADALL 0x5318 /* read all 2646 bytes */
103
104/*
105 * These ioctls are (now) only in ide-cd.c for controlling
106 * drive spindown time. They should be implemented in the
107 * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
108 * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
109 * -Erik
110 */
111#define CDROMGETSPINDOWN 0x531d
112#define CDROMSETSPINDOWN 0x531e
113
114/*
115 * These ioctls are implemented through the uniform CD-ROM driver
116 * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
117 * drivers are eventually ported to the uniform CD-ROM driver interface.
118 */
119#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
120#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
121#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
122#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
123#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
124#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
125#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
126#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
127#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
128#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
129#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
130#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
131
132/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
133 * Future CDROM ioctls should be kept below 0x537F
134 */
135
136/* This ioctl is only used by sbpcd at the moment */
137#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
138 /* conflict with SCSI_IOCTL_GET_IDLUN */
139
140/* DVD-ROM Specific ioctls */
141#define DVD_READ_STRUCT 0x5390 /* Read structure */
142#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
143#define DVD_AUTH 0x5392 /* Authentication */
144
145#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
146#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
147#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
148
149/*******************************************************
150 * CDROM IOCTL structures
151 *******************************************************/
152
153/* Address in MSF format */
154struct cdrom_msf0
155{
156 __u8 minute;
157 __u8 second;
158 __u8 frame;
159};
160
161/* Address in either MSF or logical format */
162union cdrom_addr
163{
164 struct cdrom_msf0 msf;
165 int lba;
166};
167
168/* This struct is used by the CDROMPLAYMSF ioctl */
169struct cdrom_msf
170{
171 __u8 cdmsf_min0; /* start minute */
172 __u8 cdmsf_sec0; /* start second */
173 __u8 cdmsf_frame0; /* start frame */
174 __u8 cdmsf_min1; /* end minute */
175 __u8 cdmsf_sec1; /* end second */
176 __u8 cdmsf_frame1; /* end frame */
177};
178
179/* This struct is used by the CDROMPLAYTRKIND ioctl */
180struct cdrom_ti
181{
182 __u8 cdti_trk0; /* start track */
183 __u8 cdti_ind0; /* start index */
184 __u8 cdti_trk1; /* end track */
185 __u8 cdti_ind1; /* end index */
186};
187
188/* This struct is used by the CDROMREADTOCHDR ioctl */
189struct cdrom_tochdr
190{
191 __u8 cdth_trk0; /* start track */
192 __u8 cdth_trk1; /* end track */
193};
194
195/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
196struct cdrom_volctrl
197{
198 __u8 channel0;
199 __u8 channel1;
200 __u8 channel2;
201 __u8 channel3;
202};
203
204/* This struct is used by the CDROMSUBCHNL ioctl */
205struct cdrom_subchnl
206{
207 __u8 cdsc_format;
208 __u8 cdsc_audiostatus;
209 __u8 cdsc_adr: 4;
210 __u8 cdsc_ctrl: 4;
211 __u8 cdsc_trk;
212 __u8 cdsc_ind;
213 union cdrom_addr cdsc_absaddr;
214 union cdrom_addr cdsc_reladdr;
215};
216
217
218/* This struct is used by the CDROMREADTOCENTRY ioctl */
219struct cdrom_tocentry
220{
221 __u8 cdte_track;
222 __u8 cdte_adr :4;
223 __u8 cdte_ctrl :4;
224 __u8 cdte_format;
225 union cdrom_addr cdte_addr;
226 __u8 cdte_datamode;
227};
228
229/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
230struct cdrom_read
231{
232 int cdread_lba;
233 char *cdread_bufaddr;
234 int cdread_buflen;
235};
236
237/* This struct is used by the CDROMREADAUDIO ioctl */
238struct cdrom_read_audio
239{
240 union cdrom_addr addr; /* frame address */
241 __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
242 int nframes; /* number of 2352-byte-frames to read at once */
243 __u8 __user *buf; /* frame buffer (size: nframes*2352 bytes) */
244};
245
246/* This struct is used with the CDROMMULTISESSION ioctl */
247struct cdrom_multisession
248{
249 union cdrom_addr addr; /* frame address: start-of-last-session
250 (not the new "frame 16"!). Only valid
251 if the "xa_flag" is true. */
252 __u8 xa_flag; /* 1: "is XA disk" */
253 __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
254};
255
256/* This struct is used with the CDROM_GET_MCN ioctl.
257 * Very few audio discs actually have Universal Product Code information,
258 * which should just be the Medium Catalog Number on the box. Also note
259 * that the way the codeis written on CD is _not_ uniform across all discs!
260 */
261struct cdrom_mcn
262{
263 __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
264};
265
266/* This is used by the CDROMPLAYBLK ioctl */
267struct cdrom_blk
268{
269 unsigned from;
270 unsigned short len;
271};
272
273#define CDROM_PACKET_SIZE 12
274
275#define CGC_DATA_UNKNOWN 0
276#define CGC_DATA_WRITE 1
277#define CGC_DATA_READ 2
278#define CGC_DATA_NONE 3
279
280/* for CDROM_PACKET_COMMAND ioctl */
281struct cdrom_generic_command
282{
283 unsigned char cmd[CDROM_PACKET_SIZE];
284 unsigned char __user *buffer;
285 unsigned int buflen;
286 int stat;
287 struct request_sense __user *sense;
288 unsigned char data_direction;
289 int quiet;
290 int timeout;
291 void __user *reserved[1]; /* unused, actually */
292};
293
294/*
295 * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
296 * 2340, or 2352 bytes long.
297
298* Sector types of the standard CD-ROM data formats:
299 *
300 * format sector type user data size (bytes)
301 * -----------------------------------------------------------------------------
302 * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW)
303 * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE)
304 * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0)
305 * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE)
306 * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
307 *
308 *
309 * The layout of the standard CD-ROM data formats:
310 * -----------------------------------------------------------------------------
311 * - audio (red): | audio_sample_bytes |
312 * | 2352 |
313 *
314 * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
315 * | 12 - 4 - 2048 - 4 - 8 - 276 |
316 *
317 * - data (yellow, mode2): | sync - head - data |
318 * | 12 - 4 - 2336 |
319 *
320 * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
321 * | 12 - 4 - 8 - 2048 - 4 - 276 |
322 *
323 * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
324 * | 12 - 4 - 8 - 2324 - 4 |
325 *
326 */
327
328/* Some generally useful CD-ROM information -- mostly based on the above */
329#define CD_MINS 74 /* max. minutes per CD, not really a limit */
330#define CD_SECS 60 /* seconds per minute */
331#define CD_FRAMES 75 /* frames per second */
332#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
333#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
334#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
335#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
336#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
337#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
338#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
339#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
340#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
341#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
342#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
343#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
344#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
345/* most drives don't deliver everything: */
346#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
347#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
348
349#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
350#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
351#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
352
353/* CD-ROM address types (cdrom_tocentry.cdte_format) */
354#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
355#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
356
357/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
358#define CDROM_DATA_TRACK 0x04
359
360/* The leadout track is always 0xAA, regardless of # of tracks on disc */
361#define CDROM_LEADOUT 0xAA
362
363/* audio states (from SCSI-2, but seen with other drives, too) */
364#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
365#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
366#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
367#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
368#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
369#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
370
371/* capability flags used with the uniform CD-ROM driver */
372#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
373#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
374#define CDC_LOCK 0x4 /* disable manual eject */
375#define CDC_SELECT_SPEED 0x8 /* programmable speed */
376#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
377#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
378#define CDC_MCN 0x40 /* Medium Catalog Number */
379#define CDC_MEDIA_CHANGED 0x80 /* media changed */
380#define CDC_PLAY_AUDIO 0x100 /* audio functions */
381#define CDC_RESET 0x200 /* hard reset device */
382#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
383#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
384#define CDC_CD_R 0x2000 /* drive is a CD-R */
385#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
386#define CDC_DVD 0x8000 /* drive is a DVD */
387#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
388#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
389#define CDC_MO_DRIVE 0x40000 /* drive is an MO device */
390#define CDC_MRW 0x80000 /* drive can read MRW */
391#define CDC_MRW_W 0x100000 /* drive can write MRW */
392#define CDC_RAM 0x200000 /* ok to open for WRITE */
393
394/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
395#define CDS_NO_INFO 0 /* if not implemented */
396#define CDS_NO_DISC 1
397#define CDS_TRAY_OPEN 2
398#define CDS_DRIVE_NOT_READY 3
399#define CDS_DISC_OK 4
400
401/* return values for the CDROM_DISC_STATUS ioctl */
402/* can also return CDS_NO_[INFO|DISC], from above */
403#define CDS_AUDIO 100
404#define CDS_DATA_1 101
405#define CDS_DATA_2 102
406#define CDS_XA_2_1 103
407#define CDS_XA_2_2 104
408#define CDS_MIXED 105
409
410/* User-configurable behavior options for the uniform CD-ROM driver */
411#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
412#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
413#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
414#define CDO_LOCK 0x8 /* lock tray on open files */
415#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
416
417/* Special codes used when specifying changer slots. */
418#define CDSL_NONE (INT_MAX-1)
419#define CDSL_CURRENT INT_MAX
420
421/* For partition based multisession access. IDE can handle 64 partitions
422 * per drive - SCSI CD-ROM's use minors to differentiate between the
423 * various drives, so we can't do multisessions the same way there.
424 * Use the -o session=x option to mount on them.
425 */
426#define CD_PART_MAX 64
427#define CD_PART_MASK (CD_PART_MAX - 1)
428
429/*********************************************************************
430 * Generic Packet commands, MMC commands, and such
431 *********************************************************************/
432
433 /* The generic packet command opcodes for CD/DVD Logical Units,
434 * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
435#define GPCMD_BLANK 0xa1
436#define GPCMD_CLOSE_TRACK 0x5b
437#define GPCMD_FLUSH_CACHE 0x35
438#define GPCMD_FORMAT_UNIT 0x04
439#define GPCMD_GET_CONFIGURATION 0x46
440#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
441#define GPCMD_GET_PERFORMANCE 0xac
442#define GPCMD_INQUIRY 0x12
443#define GPCMD_LOAD_UNLOAD 0xa6
444#define GPCMD_MECHANISM_STATUS 0xbd
445#define GPCMD_MODE_SELECT_10 0x55
446#define GPCMD_MODE_SENSE_10 0x5a
447#define GPCMD_PAUSE_RESUME 0x4b
448#define GPCMD_PLAY_AUDIO_10 0x45
449#define GPCMD_PLAY_AUDIO_MSF 0x47
450#define GPCMD_PLAY_AUDIO_TI 0x48
451#define GPCMD_PLAY_CD 0xbc
452#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
453#define GPCMD_READ_10 0x28
454#define GPCMD_READ_12 0xa8
455#define GPCMD_READ_BUFFER 0x3c
456#define GPCMD_READ_BUFFER_CAPACITY 0x5c
457#define GPCMD_READ_CDVD_CAPACITY 0x25
458#define GPCMD_READ_CD 0xbe
459#define GPCMD_READ_CD_MSF 0xb9
460#define GPCMD_READ_DISC_INFO 0x51
461#define GPCMD_READ_DVD_STRUCTURE 0xad
462#define GPCMD_READ_FORMAT_CAPACITIES 0x23
463#define GPCMD_READ_HEADER 0x44
464#define GPCMD_READ_TRACK_RZONE_INFO 0x52
465#define GPCMD_READ_SUBCHANNEL 0x42
466#define GPCMD_READ_TOC_PMA_ATIP 0x43
467#define GPCMD_REPAIR_RZONE_TRACK 0x58
468#define GPCMD_REPORT_KEY 0xa4
469#define GPCMD_REQUEST_SENSE 0x03
470#define GPCMD_RESERVE_RZONE_TRACK 0x53
471#define GPCMD_SEND_CUE_SHEET 0x5d
472#define GPCMD_SCAN 0xba
473#define GPCMD_SEEK 0x2b
474#define GPCMD_SEND_DVD_STRUCTURE 0xbf
475#define GPCMD_SEND_EVENT 0xa2
476#define GPCMD_SEND_KEY 0xa3
477#define GPCMD_SEND_OPC 0x54
478#define GPCMD_SET_READ_AHEAD 0xa7
479#define GPCMD_SET_STREAMING 0xb6
480#define GPCMD_START_STOP_UNIT 0x1b
481#define GPCMD_STOP_PLAY_SCAN 0x4e
482#define GPCMD_TEST_UNIT_READY 0x00
483#define GPCMD_VERIFY_10 0x2f
484#define GPCMD_WRITE_10 0x2a
485#define GPCMD_WRITE_12 0xaa
486#define GPCMD_WRITE_AND_VERIFY_10 0x2e
487#define GPCMD_WRITE_BUFFER 0x3b
488/* This is listed as optional in ATAPI 2.6, but is (curiously)
489 * missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
490 * Table 377 as an MMC command for SCSi devices though... Most ATAPI
491 * drives support it. */
492#define GPCMD_SET_SPEED 0xbb
493/* This seems to be a SCSI specific CD-ROM opcode
494 * to play data at track/index */
495#define GPCMD_PLAYAUDIO_TI 0x48
496/*
497 * From MS Media Status Notification Support Specification. For
498 * older drives only.
499 */
500#define GPCMD_GET_MEDIA_STATUS 0xda
501
502/* Mode page codes for mode sense/set */
503#define GPMODE_VENDOR_PAGE 0x00
504#define GPMODE_R_W_ERROR_PAGE 0x01
505#define GPMODE_WRITE_PARMS_PAGE 0x05
506#define GPMODE_WCACHING_PAGE 0x08
507#define GPMODE_AUDIO_CTL_PAGE 0x0e
508#define GPMODE_POWER_PAGE 0x1a
509#define GPMODE_FAULT_FAIL_PAGE 0x1c
510#define GPMODE_TO_PROTECT_PAGE 0x1d
511#define GPMODE_CAPABILITIES_PAGE 0x2a
512#define GPMODE_ALL_PAGES 0x3f
513/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
514 * of MODE_SENSE_POWER_PAGE */
515#define GPMODE_CDROM_PAGE 0x0d
516
517
518
519/* DVD struct types */
520#define DVD_STRUCT_PHYSICAL 0x00
521#define DVD_STRUCT_COPYRIGHT 0x01
522#define DVD_STRUCT_DISCKEY 0x02
523#define DVD_STRUCT_BCA 0x03
524#define DVD_STRUCT_MANUFACT 0x04
525
526struct dvd_layer {
527 __u8 book_version : 4;
528 __u8 book_type : 4;
529 __u8 min_rate : 4;
530 __u8 disc_size : 4;
531 __u8 layer_type : 4;
532 __u8 track_path : 1;
533 __u8 nlayers : 2;
534 __u8 track_density : 4;
535 __u8 linear_density : 4;
536 __u8 bca : 1;
537 __u32 start_sector;
538 __u32 end_sector;
539 __u32 end_sector_l0;
540};
541
542#define DVD_LAYERS 4
543
544struct dvd_physical {
545 __u8 type;
546 __u8 layer_num;
547 struct dvd_layer layer[DVD_LAYERS];
548};
549
550struct dvd_copyright {
551 __u8 type;
552
553 __u8 layer_num;
554 __u8 cpst;
555 __u8 rmi;
556};
557
558struct dvd_disckey {
559 __u8 type;
560
561 unsigned agid : 2;
562 __u8 value[2048];
563};
564
565struct dvd_bca {
566 __u8 type;
567
568 int len;
569 __u8 value[188];
570};
571
572struct dvd_manufact {
573 __u8 type;
574
575 __u8 layer_num;
576 int len;
577 __u8 value[2048];
578};
579
580typedef union {
581 __u8 type;
582
583 struct dvd_physical physical;
584 struct dvd_copyright copyright;
585 struct dvd_disckey disckey;
586 struct dvd_bca bca;
587 struct dvd_manufact manufact;
588} dvd_struct;
589
590/*
591 * DVD authentication ioctl
592 */
593
594/* Authentication states */
595#define DVD_LU_SEND_AGID 0
596#define DVD_HOST_SEND_CHALLENGE 1
597#define DVD_LU_SEND_KEY1 2
598#define DVD_LU_SEND_CHALLENGE 3
599#define DVD_HOST_SEND_KEY2 4
600
601/* Termination states */
602#define DVD_AUTH_ESTABLISHED 5
603#define DVD_AUTH_FAILURE 6
604
605/* Other functions */
606#define DVD_LU_SEND_TITLE_KEY 7
607#define DVD_LU_SEND_ASF 8
608#define DVD_INVALIDATE_AGID 9
609#define DVD_LU_SEND_RPC_STATE 10
610#define DVD_HOST_SEND_RPC_STATE 11
611
612/* State data */
613typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
614typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
615
616struct dvd_lu_send_agid {
617 __u8 type;
618 unsigned agid : 2;
619};
620
621struct dvd_host_send_challenge {
622 __u8 type;
623 unsigned agid : 2;
624
625 dvd_challenge chal;
626};
627
628struct dvd_send_key {
629 __u8 type;
630 unsigned agid : 2;
631
632 dvd_key key;
633};
634
635struct dvd_lu_send_challenge {
636 __u8 type;
637 unsigned agid : 2;
638
639 dvd_challenge chal;
640};
641
642#define DVD_CPM_NO_COPYRIGHT 0
643#define DVD_CPM_COPYRIGHTED 1
644
645#define DVD_CP_SEC_NONE 0
646#define DVD_CP_SEC_EXIST 1
647
648#define DVD_CGMS_UNRESTRICTED 0
649#define DVD_CGMS_SINGLE 2
650#define DVD_CGMS_RESTRICTED 3
651
652struct dvd_lu_send_title_key {
653 __u8 type;
654 unsigned agid : 2;
655
656 dvd_key title_key;
657 int lba;
658 unsigned cpm : 1;
659 unsigned cp_sec : 1;
660 unsigned cgms : 2;
661};
662
663struct dvd_lu_send_asf {
664 __u8 type;
665 unsigned agid : 2;
666
667 unsigned asf : 1;
668};
669
670struct dvd_host_send_rpcstate {
671 __u8 type;
672 __u8 pdrc;
673};
674
675struct dvd_lu_send_rpcstate {
676 __u8 type : 2;
677 __u8 vra : 3;
678 __u8 ucca : 3;
679 __u8 region_mask;
680 __u8 rpc_scheme;
681};
682
683typedef union {
684 __u8 type;
685
686 struct dvd_lu_send_agid lsa;
687 struct dvd_host_send_challenge hsc;
688 struct dvd_send_key lsk;
689 struct dvd_lu_send_challenge lsc;
690 struct dvd_send_key hsk;
691 struct dvd_lu_send_title_key lstk;
692 struct dvd_lu_send_asf lsasf;
693 struct dvd_host_send_rpcstate hrpcs;
694 struct dvd_lu_send_rpcstate lrpcs;
695} dvd_authinfo;
696
697struct request_sense {
698#if defined(__BIG_ENDIAN_BITFIELD)
699 __u8 valid : 1;
700 __u8 error_code : 7;
701#elif defined(__LITTLE_ENDIAN_BITFIELD)
702 __u8 error_code : 7;
703 __u8 valid : 1;
704#endif
705 __u8 segment_number;
706#if defined(__BIG_ENDIAN_BITFIELD)
707 __u8 reserved1 : 2;
708 __u8 ili : 1;
709 __u8 reserved2 : 1;
710 __u8 sense_key : 4;
711#elif defined(__LITTLE_ENDIAN_BITFIELD)
712 __u8 sense_key : 4;
713 __u8 reserved2 : 1;
714 __u8 ili : 1;
715 __u8 reserved1 : 2;
716#endif
717 __u8 information[4];
718 __u8 add_sense_len;
719 __u8 command_info[4];
720 __u8 asc;
721 __u8 ascq;
722 __u8 fruc;
723 __u8 sks[3];
724 __u8 asb[46];
725};
726
727/*
728 * feature profile
729 */
730#define CDF_RWRT 0x0020 /* "Random Writable" */
731#define CDF_HWDM 0x0024 /* "Hardware Defect Management" */
732#define CDF_MRW 0x0028
733
734/*
735 * media status bits
736 */
737#define CDM_MRW_NOTMRW 0
738#define CDM_MRW_BGFORMAT_INACTIVE 1
739#define CDM_MRW_BGFORMAT_ACTIVE 2
740#define CDM_MRW_BGFORMAT_COMPLETE 3
741
742/*
743 * mrw address spaces
744 */
745#define MRW_LBA_DMA 0
746#define MRW_LBA_GAA 1
747
748/*
749 * mrw mode pages (first is deprecated) -- probed at init time and
750 * cdi->mrw_mode_page is set
751 */
752#define MRW_MODE_PC_PRE1 0x2c
753#define MRW_MODE_PC 0x03
754
755struct mrw_feature_desc {
756 __be16 feature_code;
757#if defined(__BIG_ENDIAN_BITFIELD)
758 __u8 reserved1 : 2;
759 __u8 feature_version : 4;
760 __u8 persistent : 1;
761 __u8 curr : 1;
762#elif defined(__LITTLE_ENDIAN_BITFIELD)
763 __u8 curr : 1;
764 __u8 persistent : 1;
765 __u8 feature_version : 4;
766 __u8 reserved1 : 2;
767#endif
768 __u8 add_len;
769#if defined(__BIG_ENDIAN_BITFIELD)
770 __u8 reserved2 : 7;
771 __u8 write : 1;
772#elif defined(__LITTLE_ENDIAN_BITFIELD)
773 __u8 write : 1;
774 __u8 reserved2 : 7;
775#endif
776 __u8 reserved3;
777 __u8 reserved4;
778 __u8 reserved5;
779};
780
781/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
782struct rwrt_feature_desc {
783 __be16 feature_code;
784#if defined(__BIG_ENDIAN_BITFIELD)
785 __u8 reserved1 : 2;
786 __u8 feature_version : 4;
787 __u8 persistent : 1;
788 __u8 curr : 1;
789#elif defined(__LITTLE_ENDIAN_BITFIELD)
790 __u8 curr : 1;
791 __u8 persistent : 1;
792 __u8 feature_version : 4;
793 __u8 reserved1 : 2;
794#endif
795 __u8 add_len;
796 __u32 last_lba;
797 __u32 block_size;
798 __u16 blocking;
799#if defined(__BIG_ENDIAN_BITFIELD)
800 __u8 reserved2 : 7;
801 __u8 page_present : 1;
802#elif defined(__LITTLE_ENDIAN_BITFIELD)
803 __u8 page_present : 1;
804 __u8 reserved2 : 7;
805#endif
806 __u8 reserved3;
807};
808
809typedef struct {
810 __be16 disc_information_length;
811#if defined(__BIG_ENDIAN_BITFIELD)
812 __u8 reserved1 : 3;
813 __u8 erasable : 1;
814 __u8 border_status : 2;
815 __u8 disc_status : 2;
816#elif defined(__LITTLE_ENDIAN_BITFIELD)
817 __u8 disc_status : 2;
818 __u8 border_status : 2;
819 __u8 erasable : 1;
820 __u8 reserved1 : 3;
821#else
822#error "Please fix <asm/byteorder.h>"
823#endif
824 __u8 n_first_track;
825 __u8 n_sessions_lsb;
826 __u8 first_track_lsb;
827 __u8 last_track_lsb;
828#if defined(__BIG_ENDIAN_BITFIELD)
829 __u8 did_v : 1;
830 __u8 dbc_v : 1;
831 __u8 uru : 1;
832 __u8 reserved2 : 2;
833 __u8 dbit : 1;
834 __u8 mrw_status : 2;
835#elif defined(__LITTLE_ENDIAN_BITFIELD)
836 __u8 mrw_status : 2;
837 __u8 dbit : 1;
838 __u8 reserved2 : 2;
839 __u8 uru : 1;
840 __u8 dbc_v : 1;
841 __u8 did_v : 1;
842#endif
843 __u8 disc_type;
844 __u8 n_sessions_msb;
845 __u8 first_track_msb;
846 __u8 last_track_msb;
847 __u32 disc_id;
848 __u32 lead_in;
849 __u32 lead_out;
850 __u8 disc_bar_code[8];
851 __u8 reserved3;
852 __u8 n_opc;
853} disc_information;
854
855typedef struct {
856 __be16 track_information_length;
857 __u8 track_lsb;
858 __u8 session_lsb;
859 __u8 reserved1;
860#if defined(__BIG_ENDIAN_BITFIELD)
861 __u8 reserved2 : 2;
862 __u8 damage : 1;
863 __u8 copy : 1;
864 __u8 track_mode : 4;
865 __u8 rt : 1;
866 __u8 blank : 1;
867 __u8 packet : 1;
868 __u8 fp : 1;
869 __u8 data_mode : 4;
870 __u8 reserved3 : 6;
871 __u8 lra_v : 1;
872 __u8 nwa_v : 1;
873#elif defined(__LITTLE_ENDIAN_BITFIELD)
874 __u8 track_mode : 4;
875 __u8 copy : 1;
876 __u8 damage : 1;
877 __u8 reserved2 : 2;
878 __u8 data_mode : 4;
879 __u8 fp : 1;
880 __u8 packet : 1;
881 __u8 blank : 1;
882 __u8 rt : 1;
883 __u8 nwa_v : 1;
884 __u8 lra_v : 1;
885 __u8 reserved3 : 6;
886#endif
887 __be32 track_start;
888 __be32 next_writable;
889 __be32 free_blocks;
890 __be32 fixed_packet_size;
891 __be32 track_size;
892 __be32 last_rec_address;
893} track_information;
894
895struct feature_header {
896 __u32 data_len;
897 __u8 reserved1;
898 __u8 reserved2;
899 __u16 curr_profile;
900};
901
902struct mode_page_header {
903 __be16 mode_data_length;
904 __u8 medium_type;
905 __u8 reserved1;
906 __u8 reserved2;
907 __u8 reserved3;
908 __be16 desc_length;
909};
910
911#ifdef __KERNEL__
912#include <linux/fs.h> /* not really needed, later.. */ 13#include <linux/fs.h> /* not really needed, later.. */
913#include <linux/list.h> 14#include <linux/list.h>
15#include <uapi/linux/cdrom.h>
914 16
915struct packet_command 17struct packet_command
916{ 18{
@@ -1209,6 +311,4 @@ static inline int msf_to_lba(u8 m, u8 s, u8 f)
1209{ 311{
1210 return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; 312 return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
1211} 313}
1212#endif /* End of kernel only stuff */
1213
1214#endif /* _LINUX_CDROM_H */ 314#endif /* _LINUX_CDROM_H */
diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
index 3c4aac40617..88bee3a3309 100644
--- a/include/linux/cm4000_cs.h
+++ b/include/linux/cm4000_cs.h
@@ -1,68 +1,10 @@
1#ifndef _CM4000_H_ 1#ifndef _CM4000_H_
2#define _CM4000_H_ 2#define _CM4000_H_
3 3
4#include <linux/types.h> 4#include <uapi/linux/cm4000_cs.h>
5 5
6#define MAX_ATR 33
7
8#define CM4000_MAX_DEV 4
9
10/* those two structures are passed via ioctl() from/to userspace. They are
11 * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
12 * not to break compilation of userspace apps. -HW */
13
14typedef struct atreq {
15 __s32 atr_len;
16 unsigned char atr[64];
17 __s32 power_act;
18 unsigned char bIFSD;
19 unsigned char bIFSC;
20} atreq_t;
21
22
23/* what is particularly stupid in the original driver is the arch-dependent
24 * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
25 * will lay out the structure members differently than the 64bit kernel.
26 *
27 * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
28 * On 32bit this will make no difference. With 64bit kernels, it will make
29 * 32bit apps work, too.
30 */
31
32typedef struct ptsreq {
33 __u32 protocol; /*T=0: 2^0, T=1: 2^1*/
34 unsigned char flags;
35 unsigned char pts1;
36 unsigned char pts2;
37 unsigned char pts3;
38} ptsreq_t;
39
40#define CM_IOC_MAGIC 'c'
41#define CM_IOC_MAXNR 255
42
43#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
44#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
45#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
46#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
47#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
48
49#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
50
51/* card and device states */
52#define CM_CARD_INSERTED 0x01
53#define CM_CARD_POWERED 0x02
54#define CM_ATR_PRESENT 0x04
55#define CM_ATR_VALID 0x08
56#define CM_STATE_VALID 0x0f
57/* extra info only from CM4000 */
58#define CM_NO_READER 0x10
59#define CM_BAD_CARD 0x20
60
61
62#ifdef __KERNEL__
63 6
64#define DEVICE_NAME "cmm" 7#define DEVICE_NAME "cmm"
65#define MODULE_NAME "cm4000_cs" 8#define MODULE_NAME "cm4000_cs"
66 9
67#endif /* __KERNEL__ */
68#endif /* _CM4000_H_ */ 10#endif /* _CM4000_H_ */
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index d03612b196e..2c1bc1ea04e 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -14,111 +14,11 @@
14 * WITHOUT ANY WARRANTY; without even the implied warranty of 14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 */ 16 */
17
18#ifndef CN_PROC_H 17#ifndef CN_PROC_H
19#define CN_PROC_H 18#define CN_PROC_H
20 19
21#include <linux/types.h> 20#include <uapi/linux/cn_proc.h>
22
23/*
24 * Userspace sends this enum to register with the kernel that it is listening
25 * for events on the connector.
26 */
27enum proc_cn_mcast_op {
28 PROC_CN_MCAST_LISTEN = 1,
29 PROC_CN_MCAST_IGNORE = 2
30};
31
32/*
33 * From the user's point of view, the process
34 * ID is the thread group ID and thread ID is the internal
35 * kernel "pid". So, fields are assigned as follow:
36 *
37 * In user space - In kernel space
38 *
39 * parent process ID = parent->tgid
40 * parent thread ID = parent->pid
41 * child process ID = child->tgid
42 * child thread ID = child->pid
43 */
44
45struct proc_event {
46 enum what {
47 /* Use successive bits so the enums can be used to record
48 * sets of events as well
49 */
50 PROC_EVENT_NONE = 0x00000000,
51 PROC_EVENT_FORK = 0x00000001,
52 PROC_EVENT_EXEC = 0x00000002,
53 PROC_EVENT_UID = 0x00000004,
54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100,
57 PROC_EVENT_COMM = 0x00000200,
58 /* "next" should be 0x00000400 */
59 /* "last" is the last process event: exit */
60 PROC_EVENT_EXIT = 0x80000000
61 } what;
62 __u32 cpu;
63 __u64 __attribute__((aligned(8))) timestamp_ns;
64 /* Number of nano seconds since system boot */
65 union { /* must be last field of proc_event struct */
66 struct {
67 __u32 err;
68 } ack;
69
70 struct fork_proc_event {
71 __kernel_pid_t parent_pid;
72 __kernel_pid_t parent_tgid;
73 __kernel_pid_t child_pid;
74 __kernel_pid_t child_tgid;
75 } fork;
76
77 struct exec_proc_event {
78 __kernel_pid_t process_pid;
79 __kernel_pid_t process_tgid;
80 } exec;
81
82 struct id_proc_event {
83 __kernel_pid_t process_pid;
84 __kernel_pid_t process_tgid;
85 union {
86 __u32 ruid; /* task uid */
87 __u32 rgid; /* task gid */
88 } r;
89 union {
90 __u32 euid;
91 __u32 egid;
92 } e;
93 } id;
94
95 struct sid_proc_event {
96 __kernel_pid_t process_pid;
97 __kernel_pid_t process_tgid;
98 } sid;
99
100 struct ptrace_proc_event {
101 __kernel_pid_t process_pid;
102 __kernel_pid_t process_tgid;
103 __kernel_pid_t tracer_pid;
104 __kernel_pid_t tracer_tgid;
105 } ptrace;
106
107 struct comm_proc_event {
108 __kernel_pid_t process_pid;
109 __kernel_pid_t process_tgid;
110 char comm[16];
111 } comm;
112
113 struct exit_proc_event {
114 __kernel_pid_t process_pid;
115 __kernel_pid_t process_tgid;
116 __u32 exit_code, exit_signal;
117 } exit;
118 } event_data;
119};
120 21
121#ifdef __KERNEL__
122#ifdef CONFIG_PROC_EVENTS 22#ifdef CONFIG_PROC_EVENTS
123void proc_fork_connector(struct task_struct *task); 23void proc_fork_connector(struct task_struct *task);
124void proc_exec_connector(struct task_struct *task); 24void proc_exec_connector(struct task_struct *task);
@@ -151,5 +51,4 @@ static inline void proc_ptrace_connector(struct task_struct *task,
151static inline void proc_exit_connector(struct task_struct *task) 51static inline void proc_exit_connector(struct task_struct *task)
152{} 52{}
153#endif /* CONFIG_PROC_EVENTS */ 53#endif /* CONFIG_PROC_EVENTS */
154#endif /* __KERNEL__ */
155#endif /* CN_PROC_H */ 54#endif /* CN_PROC_H */
diff --git a/include/linux/coda.h b/include/linux/coda.h
index 96c87693800..cff544f8110 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -55,690 +55,12 @@ Mellon the rights to redistribute these changes without encumbrance.
55 * Linux modifications by 55 * Linux modifications by
56 * Peter Braam, Aug 1996 56 * Peter Braam, Aug 1996
57 */ 57 */
58
59#ifndef _CODA_HEADER_ 58#ifndef _CODA_HEADER_
60#define _CODA_HEADER_ 59#define _CODA_HEADER_
61 60
62
63/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
64#if defined(__NetBSD__) || \
65 ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
66#include <sys/types.h>
67#endif
68
69#ifndef CODA_MAXSYMLINKS
70#define CODA_MAXSYMLINKS 10
71#endif
72
73#if defined(DJGPP) || defined(__CYGWIN32__)
74#ifdef KERNEL
75typedef unsigned long u_long;
76typedef unsigned int u_int;
77typedef unsigned short u_short;
78typedef u_long ino_t;
79typedef u_long dev_t;
80typedef void * caddr_t;
81#ifdef DOS
82typedef unsigned __int64 u_quad_t;
83#else
84typedef unsigned long long u_quad_t;
85#endif
86
87#define inline
88
89struct timespec {
90 long ts_sec;
91 long ts_nsec;
92};
93#else /* DJGPP but not KERNEL */
94#include <sys/time.h>
95typedef unsigned long long u_quad_t;
96#endif /* !KERNEL */
97#endif /* !DJGPP */
98
99
100#if defined(__linux__) 61#if defined(__linux__)
101#include <linux/time.h>
102#define cdev_t u_quad_t
103#ifndef __KERNEL__
104#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
105#define _UQUAD_T_ 1
106typedef unsigned long long u_quad_t; 62typedef unsigned long long u_quad_t;
107#endif
108#else /*__KERNEL__ */
109typedef unsigned long long u_quad_t;
110#endif /* __KERNEL__ */
111#else 63#else
112#define cdev_t dev_t
113#endif
114
115#ifdef __CYGWIN32__
116struct timespec {
117 time_t tv_sec; /* seconds */
118 long tv_nsec; /* nanoseconds */
119};
120#endif
121
122#ifndef __BIT_TYPES_DEFINED__
123#define __BIT_TYPES_DEFINED__
124typedef signed char int8_t;
125typedef unsigned char u_int8_t;
126typedef short int16_t;
127typedef unsigned short u_int16_t;
128typedef int int32_t;
129typedef unsigned int u_int32_t;
130#endif
131
132
133/*
134 * Cfs constants
135 */
136#define CODA_MAXNAMLEN 255
137#define CODA_MAXPATHLEN 1024
138#define CODA_MAXSYMLINK 10
139
140/* these are Coda's version of O_RDONLY etc combinations
141 * to deal with VFS open modes
142 */
143#define C_O_READ 0x001
144#define C_O_WRITE 0x002
145#define C_O_TRUNC 0x010
146#define C_O_EXCL 0x100
147#define C_O_CREAT 0x200
148
149/* these are to find mode bits in Venus */
150#define C_M_READ 00400
151#define C_M_WRITE 00200
152
153/* for access Venus will use */
154#define C_A_C_OK 8 /* Test for writing upon create. */
155#define C_A_R_OK 4 /* Test for read permission. */
156#define C_A_W_OK 2 /* Test for write permission. */
157#define C_A_X_OK 1 /* Test for execute permission. */
158#define C_A_F_OK 0 /* Test for existence. */
159
160
161
162#ifndef _VENUS_DIRENT_T_
163#define _VENUS_DIRENT_T_ 1
164struct venus_dirent {
165 u_int32_t d_fileno; /* file number of entry */
166 u_int16_t d_reclen; /* length of this record */
167 u_int8_t d_type; /* file type, see below */
168 u_int8_t d_namlen; /* length of string in d_name */
169 char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
170};
171#undef DIRSIZ
172#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
173 (((dp)->d_namlen+1 + 3) &~ 3))
174
175/*
176 * File types
177 */
178#define CDT_UNKNOWN 0
179#define CDT_FIFO 1
180#define CDT_CHR 2
181#define CDT_DIR 4
182#define CDT_BLK 6
183#define CDT_REG 8
184#define CDT_LNK 10
185#define CDT_SOCK 12
186#define CDT_WHT 14
187
188/*
189 * Convert between stat structure types and directory types.
190 */
191#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
192#define CDTTOIF(dirtype) ((dirtype) << 12)
193
194#endif 64#endif
195 65#include <uapi/linux/coda.h>
196#ifndef _VUID_T_
197#define _VUID_T_
198typedef u_int32_t vuid_t;
199typedef u_int32_t vgid_t;
200#endif /*_VUID_T_ */
201
202struct CodaFid {
203 u_int32_t opaque[4];
204};
205
206#define coda_f2i(fid)\
207 (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
208
209#ifndef _VENUS_VATTR_T_
210#define _VENUS_VATTR_T_
211/*
212 * Vnode types. VNON means no type.
213 */
214enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
215
216struct coda_vattr {
217 long va_type; /* vnode type (for create) */
218 u_short va_mode; /* files access mode and type */
219 short va_nlink; /* number of references to file */
220 vuid_t va_uid; /* owner user id */
221 vgid_t va_gid; /* owner group id */
222 long va_fileid; /* file id */
223 u_quad_t va_size; /* file size in bytes */
224 long va_blocksize; /* blocksize preferred for i/o */
225 struct timespec va_atime; /* time of last access */
226 struct timespec va_mtime; /* time of last modification */
227 struct timespec va_ctime; /* time file changed */
228 u_long va_gen; /* generation number of file */
229 u_long va_flags; /* flags defined for file */
230 cdev_t va_rdev; /* device special file represents */
231 u_quad_t va_bytes; /* bytes of disk space held by file */
232 u_quad_t va_filerev; /* file modification number */
233};
234
235#endif 66#endif
236
237/* structure used by CODA_STATFS for getting cache information from venus */
238struct coda_statfs {
239 int32_t f_blocks;
240 int32_t f_bfree;
241 int32_t f_bavail;
242 int32_t f_files;
243 int32_t f_ffree;
244};
245
246/*
247 * Kernel <--> Venus communications.
248 */
249
250#define CODA_ROOT 2
251#define CODA_OPEN_BY_FD 3
252#define CODA_OPEN 4
253#define CODA_CLOSE 5
254#define CODA_IOCTL 6
255#define CODA_GETATTR 7
256#define CODA_SETATTR 8
257#define CODA_ACCESS 9
258#define CODA_LOOKUP 10
259#define CODA_CREATE 11
260#define CODA_REMOVE 12
261#define CODA_LINK 13
262#define CODA_RENAME 14
263#define CODA_MKDIR 15
264#define CODA_RMDIR 16
265#define CODA_SYMLINK 18
266#define CODA_READLINK 19
267#define CODA_FSYNC 20
268#define CODA_VGET 22
269#define CODA_SIGNAL 23
270#define CODA_REPLACE 24 /* DOWNCALL */
271#define CODA_FLUSH 25 /* DOWNCALL */
272#define CODA_PURGEUSER 26 /* DOWNCALL */
273#define CODA_ZAPFILE 27 /* DOWNCALL */
274#define CODA_ZAPDIR 28 /* DOWNCALL */
275#define CODA_PURGEFID 30 /* DOWNCALL */
276#define CODA_OPEN_BY_PATH 31
277#define CODA_RESOLVE 32
278#define CODA_REINTEGRATE 33
279#define CODA_STATFS 34
280#define CODA_STORE 35
281#define CODA_RELEASE 36
282#define CODA_NCALLS 37
283
284#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
285
286#define VC_MAXDATASIZE 8192
287#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
288 VC_MAXDATASIZE
289
290#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
291
292#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
293
294/*
295 * Venus <-> Coda RPC arguments
296 */
297struct coda_in_hdr {
298 u_int32_t opcode;
299 u_int32_t unique; /* Keep multiple outstanding msgs distinct */
300 pid_t pid;
301 pid_t pgid;
302 vuid_t uid;
303};
304
305/* Really important that opcode and unique are 1st two fields! */
306struct coda_out_hdr {
307 u_int32_t opcode;
308 u_int32_t unique;
309 u_int32_t result;
310};
311
312/* coda_root: NO_IN */
313struct coda_root_out {
314 struct coda_out_hdr oh;
315 struct CodaFid VFid;
316};
317
318struct coda_root_in {
319 struct coda_in_hdr in;
320};
321
322/* coda_open: */
323struct coda_open_in {
324 struct coda_in_hdr ih;
325 struct CodaFid VFid;
326 int flags;
327};
328
329struct coda_open_out {
330 struct coda_out_hdr oh;
331 cdev_t dev;
332 ino_t inode;
333};
334
335
336/* coda_store: */
337struct coda_store_in {
338 struct coda_in_hdr ih;
339 struct CodaFid VFid;
340 int flags;
341};
342
343struct coda_store_out {
344 struct coda_out_hdr out;
345};
346
347/* coda_release: */
348struct coda_release_in {
349 struct coda_in_hdr ih;
350 struct CodaFid VFid;
351 int flags;
352};
353
354struct coda_release_out {
355 struct coda_out_hdr out;
356};
357
358/* coda_close: */
359struct coda_close_in {
360 struct coda_in_hdr ih;
361 struct CodaFid VFid;
362 int flags;
363};
364
365struct coda_close_out {
366 struct coda_out_hdr out;
367};
368
369/* coda_ioctl: */
370struct coda_ioctl_in {
371 struct coda_in_hdr ih;
372 struct CodaFid VFid;
373 int cmd;
374 int len;
375 int rwflag;
376 char *data; /* Place holder for data. */
377};
378
379struct coda_ioctl_out {
380 struct coda_out_hdr oh;
381 int len;
382 caddr_t data; /* Place holder for data. */
383};
384
385
386/* coda_getattr: */
387struct coda_getattr_in {
388 struct coda_in_hdr ih;
389 struct CodaFid VFid;
390};
391
392struct coda_getattr_out {
393 struct coda_out_hdr oh;
394 struct coda_vattr attr;
395};
396
397
398/* coda_setattr: NO_OUT */
399struct coda_setattr_in {
400 struct coda_in_hdr ih;
401 struct CodaFid VFid;
402 struct coda_vattr attr;
403};
404
405struct coda_setattr_out {
406 struct coda_out_hdr out;
407};
408
409/* coda_access: NO_OUT */
410struct coda_access_in {
411 struct coda_in_hdr ih;
412 struct CodaFid VFid;
413 int flags;
414};
415
416struct coda_access_out {
417 struct coda_out_hdr out;
418};
419
420
421/* lookup flags */
422#define CLU_CASE_SENSITIVE 0x01
423#define CLU_CASE_INSENSITIVE 0x02
424
425/* coda_lookup: */
426struct coda_lookup_in {
427 struct coda_in_hdr ih;
428 struct CodaFid VFid;
429 int name; /* Place holder for data. */
430 int flags;
431};
432
433struct coda_lookup_out {
434 struct coda_out_hdr oh;
435 struct CodaFid VFid;
436 int vtype;
437};
438
439
440/* coda_create: */
441struct coda_create_in {
442 struct coda_in_hdr ih;
443 struct CodaFid VFid;
444 struct coda_vattr attr;
445 int excl;
446 int mode;
447 int name; /* Place holder for data. */
448};
449
450struct coda_create_out {
451 struct coda_out_hdr oh;
452 struct CodaFid VFid;
453 struct coda_vattr attr;
454};
455
456
457/* coda_remove: NO_OUT */
458struct coda_remove_in {
459 struct coda_in_hdr ih;
460 struct CodaFid VFid;
461 int name; /* Place holder for data. */
462};
463
464struct coda_remove_out {
465 struct coda_out_hdr out;
466};
467
468/* coda_link: NO_OUT */
469struct coda_link_in {
470 struct coda_in_hdr ih;
471 struct CodaFid sourceFid; /* cnode to link *to* */
472 struct CodaFid destFid; /* Directory in which to place link */
473 int tname; /* Place holder for data. */
474};
475
476struct coda_link_out {
477 struct coda_out_hdr out;
478};
479
480
481/* coda_rename: NO_OUT */
482struct coda_rename_in {
483 struct coda_in_hdr ih;
484 struct CodaFid sourceFid;
485 int srcname;
486 struct CodaFid destFid;
487 int destname;
488};
489
490struct coda_rename_out {
491 struct coda_out_hdr out;
492};
493
494/* coda_mkdir: */
495struct coda_mkdir_in {
496 struct coda_in_hdr ih;
497 struct CodaFid VFid;
498 struct coda_vattr attr;
499 int name; /* Place holder for data. */
500};
501
502struct coda_mkdir_out {
503 struct coda_out_hdr oh;
504 struct CodaFid VFid;
505 struct coda_vattr attr;
506};
507
508
509/* coda_rmdir: NO_OUT */
510struct coda_rmdir_in {
511 struct coda_in_hdr ih;
512 struct CodaFid VFid;
513 int name; /* Place holder for data. */
514};
515
516struct coda_rmdir_out {
517 struct coda_out_hdr out;
518};
519
520/* coda_symlink: NO_OUT */
521struct coda_symlink_in {
522 struct coda_in_hdr ih;
523 struct CodaFid VFid; /* Directory to put symlink in */
524 int srcname;
525 struct coda_vattr attr;
526 int tname;
527};
528
529struct coda_symlink_out {
530 struct coda_out_hdr out;
531};
532
533/* coda_readlink: */
534struct coda_readlink_in {
535 struct coda_in_hdr ih;
536 struct CodaFid VFid;
537};
538
539struct coda_readlink_out {
540 struct coda_out_hdr oh;
541 int count;
542 caddr_t data; /* Place holder for data. */
543};
544
545
546/* coda_fsync: NO_OUT */
547struct coda_fsync_in {
548 struct coda_in_hdr ih;
549 struct CodaFid VFid;
550};
551
552struct coda_fsync_out {
553 struct coda_out_hdr out;
554};
555
556/* coda_vget: */
557struct coda_vget_in {
558 struct coda_in_hdr ih;
559 struct CodaFid VFid;
560};
561
562struct coda_vget_out {
563 struct coda_out_hdr oh;
564 struct CodaFid VFid;
565 int vtype;
566};
567
568
569/* CODA_SIGNAL is out-of-band, doesn't need data. */
570/* CODA_INVALIDATE is a venus->kernel call */
571/* CODA_FLUSH is a venus->kernel call */
572
573/* coda_purgeuser: */
574/* CODA_PURGEUSER is a venus->kernel call */
575struct coda_purgeuser_out {
576 struct coda_out_hdr oh;
577 vuid_t uid;
578};
579
580/* coda_zapfile: */
581/* CODA_ZAPFILE is a venus->kernel call */
582struct coda_zapfile_out {
583 struct coda_out_hdr oh;
584 struct CodaFid CodaFid;
585};
586
587/* coda_zapdir: */
588/* CODA_ZAPDIR is a venus->kernel call */
589struct coda_zapdir_out {
590 struct coda_out_hdr oh;
591 struct CodaFid CodaFid;
592};
593
594/* coda_purgefid: */
595/* CODA_PURGEFID is a venus->kernel call */
596struct coda_purgefid_out {
597 struct coda_out_hdr oh;
598 struct CodaFid CodaFid;
599};
600
601/* coda_replace: */
602/* CODA_REPLACE is a venus->kernel call */
603struct coda_replace_out { /* coda_replace is a venus->kernel call */
604 struct coda_out_hdr oh;
605 struct CodaFid NewFid;
606 struct CodaFid OldFid;
607};
608
609/* coda_open_by_fd: */
610struct coda_open_by_fd_in {
611 struct coda_in_hdr ih;
612 struct CodaFid VFid;
613 int flags;
614};
615
616struct coda_open_by_fd_out {
617 struct coda_out_hdr oh;
618 int fd;
619
620#ifdef __KERNEL__
621 struct file *fh; /* not passed from userspace but used in-kernel only */
622#endif
623};
624
625/* coda_open_by_path: */
626struct coda_open_by_path_in {
627 struct coda_in_hdr ih;
628 struct CodaFid VFid;
629 int flags;
630};
631
632struct coda_open_by_path_out {
633 struct coda_out_hdr oh;
634 int path;
635};
636
637/* coda_statfs: NO_IN */
638struct coda_statfs_in {
639 struct coda_in_hdr in;
640};
641
642struct coda_statfs_out {
643 struct coda_out_hdr oh;
644 struct coda_statfs stat;
645};
646
647/*
648 * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
649 * For instance, if the fid is inconsistent.
650 * This case is handled by setting the top bit of the type result parameter.
651 */
652#define CODA_NOCACHE 0x80000000
653
654union inputArgs {
655 struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
656 struct coda_open_in coda_open;
657 struct coda_store_in coda_store;
658 struct coda_release_in coda_release;
659 struct coda_close_in coda_close;
660 struct coda_ioctl_in coda_ioctl;
661 struct coda_getattr_in coda_getattr;
662 struct coda_setattr_in coda_setattr;
663 struct coda_access_in coda_access;
664 struct coda_lookup_in coda_lookup;
665 struct coda_create_in coda_create;
666 struct coda_remove_in coda_remove;
667 struct coda_link_in coda_link;
668 struct coda_rename_in coda_rename;
669 struct coda_mkdir_in coda_mkdir;
670 struct coda_rmdir_in coda_rmdir;
671 struct coda_symlink_in coda_symlink;
672 struct coda_readlink_in coda_readlink;
673 struct coda_fsync_in coda_fsync;
674 struct coda_vget_in coda_vget;
675 struct coda_open_by_fd_in coda_open_by_fd;
676 struct coda_open_by_path_in coda_open_by_path;
677 struct coda_statfs_in coda_statfs;
678};
679
680union outputArgs {
681 struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
682 struct coda_root_out coda_root;
683 struct coda_open_out coda_open;
684 struct coda_ioctl_out coda_ioctl;
685 struct coda_getattr_out coda_getattr;
686 struct coda_lookup_out coda_lookup;
687 struct coda_create_out coda_create;
688 struct coda_mkdir_out coda_mkdir;
689 struct coda_readlink_out coda_readlink;
690 struct coda_vget_out coda_vget;
691 struct coda_purgeuser_out coda_purgeuser;
692 struct coda_zapfile_out coda_zapfile;
693 struct coda_zapdir_out coda_zapdir;
694 struct coda_purgefid_out coda_purgefid;
695 struct coda_replace_out coda_replace;
696 struct coda_open_by_fd_out coda_open_by_fd;
697 struct coda_open_by_path_out coda_open_by_path;
698 struct coda_statfs_out coda_statfs;
699};
700
701union coda_downcalls {
702 /* CODA_INVALIDATE is a venus->kernel call */
703 /* CODA_FLUSH is a venus->kernel call */
704 struct coda_purgeuser_out purgeuser;
705 struct coda_zapfile_out zapfile;
706 struct coda_zapdir_out zapdir;
707 struct coda_purgefid_out purgefid;
708 struct coda_replace_out replace;
709};
710
711
712/*
713 * Used for identifying usage of "Control" and pioctls
714 */
715
716#define PIOCPARM_MASK 0x0000ffff
717struct ViceIoctl {
718 void __user *in; /* Data to be transferred in */
719 void __user *out; /* Data to be transferred out */
720 u_short in_size; /* Size of input buffer <= 2K */
721 u_short out_size; /* Maximum size of output buffer, <= 2K */
722};
723
724struct PioctlData {
725 const char __user *path;
726 int follow;
727 struct ViceIoctl vi;
728};
729
730#define CODA_CONTROL ".CONTROL"
731#define CODA_CONTROLLEN 8
732#define CTL_INO -1
733
734/* Data passed to mount */
735
736#define CODA_MOUNT_VERSION 1
737
738struct coda_mount_data {
739 int version;
740 int fd; /* Opened device */
741};
742
743#endif
744
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 72f2d2f0af9..8031d6eef10 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -1,14 +1,9 @@
1#ifndef __CODA_PSDEV_H 1#ifndef __CODA_PSDEV_H
2#define __CODA_PSDEV_H 2#define __CODA_PSDEV_H
3 3
4#include <linux/magic.h>
5
6#define CODA_PSDEV_MAJOR 67
7#define MAX_CODADEVS 5 /* how many do we allow */
8
9#ifdef __KERNEL__
10#include <linux/backing-dev.h> 4#include <linux/backing-dev.h>
11#include <linux/mutex.h> 5#include <linux/mutex.h>
6#include <uapi/linux/coda_psdev.h>
12 7
13struct kstatfs; 8struct kstatfs;
14 9
@@ -74,23 +69,4 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 */ 69 */
75 70
76extern struct venus_comm coda_comms[]; 71extern struct venus_comm coda_comms[];
77#endif /* __KERNEL__ */
78
79/* messages between coda filesystem in kernel and Venus */
80struct upc_req {
81 struct list_head uc_chain;
82 caddr_t uc_data;
83 u_short uc_flags;
84 u_short uc_inSize; /* Size is at most 5000 bytes */
85 u_short uc_outSize;
86 u_short uc_opcode; /* copied from data to save lookup */
87 int uc_unique;
88 wait_queue_head_t uc_sleep; /* process' wait queue */
89};
90
91#define CODA_REQ_ASYNC 0x1
92#define CODA_REQ_READ 0x2
93#define CODA_REQ_WRITE 0x4
94#define CODA_REQ_ABORT 0x8
95
96#endif 72#endif
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 76384074262..b2b5a41b6a2 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -18,63 +18,9 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21
22#ifndef __CONNECTOR_H 21#ifndef __CONNECTOR_H
23#define __CONNECTOR_H 22#define __CONNECTOR_H
24 23
25#include <linux/types.h>
26
27/*
28 * Process Events connector unique ids -- used for message routing
29 */
30#define CN_IDX_PROC 0x1
31#define CN_VAL_PROC 0x1
32#define CN_IDX_CIFS 0x2
33#define CN_VAL_CIFS 0x1
34#define CN_W1_IDX 0x3 /* w1 communication */
35#define CN_W1_VAL 0x1
36#define CN_IDX_V86D 0x4
37#define CN_VAL_V86D_UVESAFB 0x1
38#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
39#define CN_DST_IDX 0x6
40#define CN_DST_VAL 0x1
41#define CN_IDX_DM 0x7 /* Device Mapper */
42#define CN_VAL_DM_USERSPACE_LOG 0x1
43#define CN_IDX_DRBD 0x8
44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46#define CN_KVP_VAL 0x1 /* queries from the kernel */
47
48#define CN_NETLINK_USERS 10 /* Highest index + 1 */
49
50/*
51 * Maximum connector's message size.
52 */
53#define CONNECTOR_MAX_MSG_SIZE 16384
54
55/*
56 * idx and val are unique identifiers which
57 * are used for message routing and
58 * must be registered in connector.h for in-kernel usage.
59 */
60
61struct cb_id {
62 __u32 idx;
63 __u32 val;
64};
65
66struct cn_msg {
67 struct cb_id id;
68
69 __u32 seq;
70 __u32 ack;
71
72 __u16 len; /* Length of the following data */
73 __u16 flags;
74 __u8 data[0];
75};
76
77#ifdef __KERNEL__
78 24
79#include <linux/atomic.h> 25#include <linux/atomic.h>
80 26
@@ -82,6 +28,7 @@ struct cn_msg {
82#include <linux/workqueue.h> 28#include <linux/workqueue.h>
83 29
84#include <net/sock.h> 30#include <net/sock.h>
31#include <uapi/linux/connector.h>
85 32
86#define CN_CBQ_NAMELEN 32 33#define CN_CBQ_NAMELEN 32
87 34
@@ -137,5 +84,4 @@ void cn_queue_free_dev(struct cn_queue_dev *dev);
137 84
138int cn_cb_equal(struct cb_id *, struct cb_id *); 85int cn_cb_equal(struct cb_id *, struct cb_id *);
139 86
140#endif /* __KERNEL__ */
141#endif /* __CONNECTOR_H */ 87#endif /* __CONNECTOR_H */
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index 0e7bf272ec2..133789609f2 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -1,94 +1,10 @@
1#ifndef __CRAMFS_H 1#ifndef __CRAMFS_H
2#define __CRAMFS_H 2#define __CRAMFS_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/cramfs_fs.h>
5#include <linux/magic.h>
6 5
7#define CRAMFS_SIGNATURE "Compressed ROMFS"
8
9/*
10 * Width of various bitfields in struct cramfs_inode.
11 * Primarily used to generate warnings in mkcramfs.
12 */
13#define CRAMFS_MODE_WIDTH 16
14#define CRAMFS_UID_WIDTH 16
15#define CRAMFS_SIZE_WIDTH 24
16#define CRAMFS_GID_WIDTH 8
17#define CRAMFS_NAMELEN_WIDTH 6
18#define CRAMFS_OFFSET_WIDTH 26
19
20/*
21 * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
22 * path length is 63 << 2 = 252.
23 */
24#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
25
26/*
27 * Reasonably terse representation of the inode data.
28 */
29struct cramfs_inode {
30 __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
31 /* SIZE for device files is i_rdev */
32 __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
33 /* NAMELEN is the length of the file name, divided by 4 and
34 rounded up. (cramfs doesn't support hard links.) */
35 /* OFFSET: For symlinks and non-empty regular files, this
36 contains the offset (divided by 4) of the file data in
37 compressed form (starting with an array of block pointers;
38 see README). For non-empty directories it is the offset
39 (divided by 4) of the inode of the first file in that
40 directory. For anything else, offset is zero. */
41 __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
42};
43
44struct cramfs_info {
45 __u32 crc;
46 __u32 edition;
47 __u32 blocks;
48 __u32 files;
49};
50
51/*
52 * Superblock information at the beginning of the FS.
53 */
54struct cramfs_super {
55 __u32 magic; /* 0x28cd3d45 - random number */
56 __u32 size; /* length in bytes */
57 __u32 flags; /* feature flags */
58 __u32 future; /* reserved for future use */
59 __u8 signature[16]; /* "Compressed ROMFS" */
60 struct cramfs_info fsid; /* unique filesystem info */
61 __u8 name[16]; /* user-defined name */
62 struct cramfs_inode root; /* root inode data */
63};
64
65/*
66 * Feature flags
67 *
68 * 0x00000000 - 0x000000ff: features that work for all past kernels
69 * 0x00000100 - 0xffffffff: features that don't work for past kernels
70 */
71#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */
72#define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */
73#define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
74#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
75#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
76
77/*
78 * Valid values in super.flags. Currently we refuse to mount
79 * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be
80 * changed to test super.future instead.
81 */
82#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
83 | CRAMFS_FLAG_HOLES \
84 | CRAMFS_FLAG_WRONG_SIGNATURE \
85 | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
86
87#ifdef __KERNEL__
88/* Uncompression interfaces to the underlying zlib */ 6/* Uncompression interfaces to the underlying zlib */
89int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); 7int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
90int cramfs_uncompress_init(void); 8int cramfs_uncompress_init(void);
91void cramfs_uncompress_exit(void); 9void cramfs_uncompress_exit(void);
92#endif /* __KERNEL__ */
93
94#endif 10#endif
diff --git a/include/linux/cuda.h b/include/linux/cuda.h
index 9f9865ff781..b7233282380 100644
--- a/include/linux/cuda.h
+++ b/include/linux/cuda.h
@@ -4,38 +4,15 @@
4 * 4 *
5 * Copyright (C) 1996 Paul Mackerras. 5 * Copyright (C) 1996 Paul Mackerras.
6 */ 6 */
7
8#ifndef _LINUX_CUDA_H 7#ifndef _LINUX_CUDA_H
9#define _LINUX_CUDA_H 8#define _LINUX_CUDA_H
10 9
11/* CUDA commands (2nd byte) */ 10#include <uapi/linux/cuda.h>
12#define CUDA_WARM_START 0
13#define CUDA_AUTOPOLL 1
14#define CUDA_GET_6805_ADDR 2
15#define CUDA_GET_TIME 3
16#define CUDA_GET_PRAM 7
17#define CUDA_SET_6805_ADDR 8
18#define CUDA_SET_TIME 9
19#define CUDA_POWERDOWN 0xa
20#define CUDA_POWERUP_TIME 0xb
21#define CUDA_SET_PRAM 0xc
22#define CUDA_MS_RESET 0xd
23#define CUDA_SEND_DFAC 0xe
24#define CUDA_RESET_SYSTEM 0x11
25#define CUDA_SET_IPL 0x12
26#define CUDA_SET_AUTO_RATE 0x14
27#define CUDA_GET_AUTO_RATE 0x16
28#define CUDA_SET_DEVICE_LIST 0x19
29#define CUDA_GET_DEVICE_LIST 0x1a
30#define CUDA_GET_SET_IIC 0x22
31 11
32#ifdef __KERNEL__
33 12
34extern int find_via_cuda(void); 13extern int find_via_cuda(void);
35extern int cuda_request(struct adb_request *req, 14extern int cuda_request(struct adb_request *req,
36 void (*done)(struct adb_request *), int nbytes, ...); 15 void (*done)(struct adb_request *), int nbytes, ...);
37extern void cuda_poll(void); 16extern void cuda_poll(void);
38 17
39#endif /* __KERNEL */
40
41#endif /* _LINUX_CUDA_H */ 18#endif /* _LINUX_CUDA_H */
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index a5049eaf782..19ae518f547 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -63,434 +63,11 @@
63 * 63 *
64 * 64 *
65 */ 65 */
66
67#ifndef _LINUX_CYCLADES_H 66#ifndef _LINUX_CYCLADES_H
68#define _LINUX_CYCLADES_H 67#define _LINUX_CYCLADES_H
69 68
70#include <linux/types.h> 69#include <uapi/linux/cyclades.h>
71
72struct cyclades_monitor {
73 unsigned long int_count;
74 unsigned long char_count;
75 unsigned long char_max;
76 unsigned long char_last;
77};
78
79/*
80 * These stats all reflect activity since the device was last initialized.
81 * (i.e., since the port was opened with no other processes already having it
82 * open)
83 */
84struct cyclades_idle_stats {
85 __kernel_time_t in_use; /* Time device has been in use (secs) */
86 __kernel_time_t recv_idle; /* Time since last char received (secs) */
87 __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
88 unsigned long recv_bytes; /* Bytes received */
89 unsigned long xmit_bytes; /* Bytes transmitted */
90 unsigned long overruns; /* Input overruns */
91 unsigned long frame_errs; /* Input framing errors */
92 unsigned long parity_errs; /* Input parity errors */
93};
94
95#define CYCLADES_MAGIC 0x4359
96
97#define CYGETMON 0x435901
98#define CYGETTHRESH 0x435902
99#define CYSETTHRESH 0x435903
100#define CYGETDEFTHRESH 0x435904
101#define CYSETDEFTHRESH 0x435905
102#define CYGETTIMEOUT 0x435906
103#define CYSETTIMEOUT 0x435907
104#define CYGETDEFTIMEOUT 0x435908
105#define CYSETDEFTIMEOUT 0x435909
106#define CYSETRFLOW 0x43590a
107#define CYGETRFLOW 0x43590b
108#define CYSETRTSDTR_INV 0x43590c
109#define CYGETRTSDTR_INV 0x43590d
110#define CYZSETPOLLCYCLE 0x43590e
111#define CYZGETPOLLCYCLE 0x43590f
112#define CYGETCD1400VER 0x435910
113#define CYSETWAIT 0x435912
114#define CYGETWAIT 0x435913
115
116/*************** CYCLOM-Z ADDITIONS ***************/
117
118#define CZIOC ('M' << 8)
119#define CZ_NBOARDS (CZIOC|0xfa)
120#define CZ_BOOT_START (CZIOC|0xfb)
121#define CZ_BOOT_DATA (CZIOC|0xfc)
122#define CZ_BOOT_END (CZIOC|0xfd)
123#define CZ_TEST (CZIOC|0xfe)
124
125#define CZ_DEF_POLL (HZ/25)
126
127#define MAX_BOARD 4 /* Max number of boards */
128#define MAX_DEV 256 /* Max number of ports total */
129#define CYZ_MAX_SPEED 921600
130
131#define CYZ_FIFO_SIZE 16
132
133#define CYZ_BOOT_NWORDS 0x100
134struct CYZ_BOOT_CTRL {
135 unsigned short nboard;
136 int status[MAX_BOARD];
137 int nchannel[MAX_BOARD];
138 int fw_rev[MAX_BOARD];
139 unsigned long offset;
140 unsigned long data[CYZ_BOOT_NWORDS];
141};
142
143
144#ifndef DP_WINDOW_SIZE
145/*
146 * Memory Window Sizes
147 */
148
149#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
150#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
151 8Zo V.2 */
152#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
153
154/*
155 * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
156 * normally will access only interested on the fpga_id, fpga_version,
157 * start_cpu and stop_cpu.
158 */
159
160struct CUSTOM_REG {
161 __u32 fpga_id; /* FPGA Identification Register */
162 __u32 fpga_version; /* FPGA Version Number Register */
163 __u32 cpu_start; /* CPU start Register (write) */
164 __u32 cpu_stop; /* CPU stop Register (write) */
165 __u32 misc_reg; /* Miscellaneous Register */
166 __u32 idt_mode; /* IDT mode Register */
167 __u32 uart_irq_status; /* UART IRQ status Register */
168 __u32 clear_timer0_irq; /* Clear timer interrupt Register */
169 __u32 clear_timer1_irq; /* Clear timer interrupt Register */
170 __u32 clear_timer2_irq; /* Clear timer interrupt Register */
171 __u32 test_register; /* Test Register */
172 __u32 test_count; /* Test Count Register */
173 __u32 timer_select; /* Timer select register */
174 __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
175 __u32 ram_wait_state; /* RAM wait-state Register */
176 __u32 uart_wait_state; /* UART wait-state Register */
177 __u32 timer_wait_state; /* timer wait-state Register */
178 __u32 ack_wait_state; /* ACK wait State Register */
179};
180
181/*
182 * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
183 * registers. This structure can be used to access the 9060 registers
184 * (memory mapped).
185 */
186
187struct RUNTIME_9060 {
188 __u32 loc_addr_range; /* 00h - Local Address Range */
189 __u32 loc_addr_base; /* 04h - Local Address Base */
190 __u32 loc_arbitr; /* 08h - Local Arbitration */
191 __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
192 __u32 loc_rom_range; /* 10h - Local ROM Range */
193 __u32 loc_rom_base; /* 14h - Local ROM Base */
194 __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
195 __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
196 __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
197 __u32 loc_range_io; /* 24h - Local Range for Master IO */
198 __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
199 __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
200 __u32 filler1; /* 30h */
201 __u32 filler2; /* 34h */
202 __u32 filler3; /* 38h */
203 __u32 filler4; /* 3Ch */
204 __u32 mail_box_0; /* 40h - Mail Box 0 */
205 __u32 mail_box_1; /* 44h - Mail Box 1 */
206 __u32 mail_box_2; /* 48h - Mail Box 2 */
207 __u32 mail_box_3; /* 4Ch - Mail Box 3 */
208 __u32 filler5; /* 50h */
209 __u32 filler6; /* 54h */
210 __u32 filler7; /* 58h */
211 __u32 filler8; /* 5Ch */
212 __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
213 __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
214 __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
215 __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
216};
217
218/* Values for the Local Base Address re-map register */
219
220#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
221#define WIN_CREG 0x14000001L /* set the window to custom Registers */
222
223/* Values timer select registers */
224
225#define TIMER_BY_1M 0x00 /* clock divided by 1M */
226#define TIMER_BY_256K 0x01 /* clock divided by 256k */
227#define TIMER_BY_128K 0x02 /* clock divided by 128k */
228#define TIMER_BY_32K 0x03 /* clock divided by 32k */
229
230/****************** ****************** *******************/
231#endif
232
233#ifndef ZFIRM_ID
234/* #include "zfwint.h" */
235/****************** ****************** *******************/
236/*
237 * This file contains the definitions for interfacing with the
238 * Cyclom-Z ZFIRM Firmware.
239 */
240
241/* General Constant definitions */
242
243#define MAX_CHAN 64 /* max number of channels per board */
244
245/* firmware id structure (set after boot) */
246
247#define ID_ADDRESS 0x00000180L /* signature/pointer address */
248#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
249#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
250#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
251
252#define ZF_TINACT_DEF 1000 /* default inactivity timeout
253 (1000 ms) */
254#define ZF_TINACT ZF_TINACT_DEF
255
256struct FIRM_ID {
257 __u32 signature; /* ZFIRM/U signature */
258 __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
259};
260
261/* Op. System id */
262
263#define C_OS_LINUX 0x00000030 /* generic Linux system */
264
265/* channel op_mode */
266
267#define C_CH_DISABLE 0x00000000 /* channel is disabled */
268#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
269#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
270#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
271#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
272
273/* comm_parity - parity */
274
275#define C_PR_NONE 0x00000000 /* None */
276#define C_PR_ODD 0x00000001 /* Odd */
277#define C_PR_EVEN 0x00000002 /* Even */
278#define C_PR_MARK 0x00000004 /* Mark */
279#define C_PR_SPACE 0x00000008 /* Space */
280#define C_PR_PARITY 0x000000ff
281
282#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
283#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
284
285/* comm_data_l - data length and stop bits */
286
287#define C_DL_CS5 0x00000001
288#define C_DL_CS6 0x00000002
289#define C_DL_CS7 0x00000004
290#define C_DL_CS8 0x00000008
291#define C_DL_CS 0x0000000f
292#define C_DL_1STOP 0x00000010
293#define C_DL_15STOP 0x00000020
294#define C_DL_2STOP 0x00000040
295#define C_DL_STOP 0x000000f0
296
297/* interrupt enabling/status */
298
299#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
300#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
301#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
302#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
303#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
304#define C_IN_MDCD 0x00000100 /* modem DCD change */
305#define C_IN_MDSR 0x00000200 /* modem DSR change */
306#define C_IN_MRI 0x00000400 /* modem RI change */
307#define C_IN_MCTS 0x00000800 /* modem CTS change */
308#define C_IN_RXBRK 0x00001000 /* Break received */
309#define C_IN_PR_ERROR 0x00002000 /* parity error */
310#define C_IN_FR_ERROR 0x00004000 /* frame error */
311#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
312#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
313#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
314#define C_IN_MRTS 0x00040000 /* modem RTS drop */
315#define C_IN_ICHAR 0x00080000
316
317/* flow control */
318
319#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
320#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
321#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
322#define C_FL_SWFLOW 0x0000000f
323
324/* flow status */
325
326#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
327#define C_FS_SENDING 0x00000001 /* UART is sending data */
328#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
329
330/* rs_control/rs_status RS-232 signals */
331
332#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
333 IOCTLM command */
334#define C_RS_RTS 0x00000001 /* RTS */
335#define C_RS_DTR 0x00000004 /* DTR */
336#define C_RS_DCD 0x00000100 /* CD */
337#define C_RS_DSR 0x00000200 /* DSR */
338#define C_RS_RI 0x00000400 /* RI */
339#define C_RS_CTS 0x00000800 /* CTS */
340
341/* commands Host <-> Board */
342
343#define C_CM_RESET 0x01 /* reset/flush buffers */
344#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
345#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
346#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
347#define C_CM_SENDXOFF 0x10 /* send Xoff */
348#define C_CM_SENDXON 0x11 /* send Xon */
349#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
350#define C_CM_SENDBRK 0x41 /* send break */
351#define C_CM_INTBACK 0x42 /* Interrupt back */
352#define C_CM_SET_BREAK 0x43 /* Tx break on */
353#define C_CM_CLR_BREAK 0x44 /* Tx break off */
354#define C_CM_CMD_DONE 0x45 /* Previous command done */
355#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
356#define C_CM_TINACT 0x51 /* set inactivity detection */
357#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
358#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
359#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
360#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
361#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
362#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
363#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
364 driver */
365#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
366 driver */
367
368#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
369#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
370#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
371#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
372#define C_CM_TXFEMPTY 0x64
373#define C_CM_ICHAR 0x65
374#define C_CM_MDCD 0x70 /* modem DCD change */
375#define C_CM_MDSR 0x71 /* modem DSR change */
376#define C_CM_MRI 0x72 /* modem RI change */
377#define C_CM_MCTS 0x73 /* modem CTS change */
378#define C_CM_MRTS 0x74 /* modem RTS drop */
379#define C_CM_RXBRK 0x84 /* Break received */
380#define C_CM_PR_ERROR 0x85 /* Parity error */
381#define C_CM_FR_ERROR 0x86 /* Frame error */
382#define C_CM_OVR_ERROR 0x87 /* Overrun error */
383#define C_CM_RXOFL 0x88 /* RX buffer overflow */
384#define C_CM_CMDERROR 0x90 /* command error */
385#define C_CM_FATAL 0x91 /* fatal error */
386#define C_CM_HW_RESET 0x92 /* reset board */
387
388/*
389 * CH_CTRL - This per port structure contains all parameters
390 * that control an specific port. It can be seen as the
391 * configuration registers of a "super-serial-controller".
392 */
393
394struct CH_CTRL {
395 __u32 op_mode; /* operation mode */
396 __u32 intr_enable; /* interrupt masking */
397 __u32 sw_flow; /* SW flow control */
398 __u32 flow_status; /* output flow status */
399 __u32 comm_baud; /* baud rate - numerically specified */
400 __u32 comm_parity; /* parity */
401 __u32 comm_data_l; /* data length/stop */
402 __u32 comm_flags; /* other flags */
403 __u32 hw_flow; /* HW flow control */
404 __u32 rs_control; /* RS-232 outputs */
405 __u32 rs_status; /* RS-232 inputs */
406 __u32 flow_xon; /* xon char */
407 __u32 flow_xoff; /* xoff char */
408 __u32 hw_overflow; /* hw overflow counter */
409 __u32 sw_overflow; /* sw overflow counter */
410 __u32 comm_error; /* frame/parity error counter */
411 __u32 ichar;
412 __u32 filler[7];
413};
414
415
416/*
417 * BUF_CTRL - This per channel structure contains
418 * all Tx and Rx buffer control for a given channel.
419 */
420
421struct BUF_CTRL {
422 __u32 flag_dma; /* buffers are in Host memory */
423 __u32 tx_bufaddr; /* address of the tx buffer */
424 __u32 tx_bufsize; /* tx buffer size */
425 __u32 tx_threshold; /* tx low water mark */
426 __u32 tx_get; /* tail index tx buf */
427 __u32 tx_put; /* head index tx buf */
428 __u32 rx_bufaddr; /* address of the rx buffer */
429 __u32 rx_bufsize; /* rx buffer size */
430 __u32 rx_threshold; /* rx high water mark */
431 __u32 rx_get; /* tail index rx buf */
432 __u32 rx_put; /* head index rx buf */
433 __u32 filler[5]; /* filler to align structures */
434};
435
436/*
437 * BOARD_CTRL - This per board structure contains all global
438 * control fields related to the board.
439 */
440
441struct BOARD_CTRL {
442
443 /* static info provided by the on-board CPU */
444 __u32 n_channel; /* number of channels */
445 __u32 fw_version; /* firmware version */
446
447 /* static info provided by the driver */
448 __u32 op_system; /* op_system id */
449 __u32 dr_version; /* driver version */
450
451 /* board control area */
452 __u32 inactivity; /* inactivity control */
453
454 /* host to FW commands */
455 __u32 hcmd_channel; /* channel number */
456 __u32 hcmd_param; /* pointer to parameters */
457
458 /* FW to Host commands */
459 __u32 fwcmd_channel; /* channel number */
460 __u32 fwcmd_param; /* pointer to parameters */
461 __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
462
463 /* filler so the structures are aligned */
464 __u32 filler[6];
465};
466
467/* Host Interrupt Queue */
468
469#define QUEUE_SIZE (10*MAX_CHAN)
470
471struct INT_QUEUE {
472 unsigned char intr_code[QUEUE_SIZE];
473 unsigned long channel[QUEUE_SIZE];
474 unsigned long param[QUEUE_SIZE];
475 unsigned long put;
476 unsigned long get;
477};
478
479/*
480 * ZFW_CTRL - This is the data structure that includes all other
481 * data structures used by the Firmware.
482 */
483
484struct ZFW_CTRL {
485 struct BOARD_CTRL board_ctrl;
486 struct CH_CTRL ch_ctrl[MAX_CHAN];
487 struct BUF_CTRL buf_ctrl[MAX_CHAN];
488};
489
490/****************** ****************** *******************/
491#endif
492 70
493#ifdef __KERNEL__
494 71
495/* Per card data structure */ 72/* Per card data structure */
496struct cyclades_card { 73struct cyclades_card {
@@ -780,5 +357,4 @@ struct cyclades_port {
780 357
781/***************************************************************************/ 358/***************************************************************************/
782 359
783#endif /* __KERNEL__ */
784#endif /* _LINUX_CYCLADES_H */ 360#endif /* _LINUX_CYCLADES_H */
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index d16294e2a11..439ff698000 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -1,239 +1,6 @@
1#ifndef _LINUX_DCCP_H 1#ifndef _LINUX_DCCP_H
2#define _LINUX_DCCP_H 2#define _LINUX_DCCP_H
3 3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7/**
8 * struct dccp_hdr - generic part of DCCP packet header
9 *
10 * @dccph_sport - Relevant port on the endpoint that sent this packet
11 * @dccph_dport - Relevant port on the other endpoint
12 * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
13 * @dccph_ccval - Used by the HC-Sender CCID
14 * @dccph_cscov - Parts of the packet that are covered by the Checksum field
15 * @dccph_checksum - Internet checksum, depends on dccph_cscov
16 * @dccph_x - 0 = 24 bit sequence number, 1 = 48
17 * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
18 * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
19 */
20struct dccp_hdr {
21 __be16 dccph_sport,
22 dccph_dport;
23 __u8 dccph_doff;
24#if defined(__LITTLE_ENDIAN_BITFIELD)
25 __u8 dccph_cscov:4,
26 dccph_ccval:4;
27#elif defined(__BIG_ENDIAN_BITFIELD)
28 __u8 dccph_ccval:4,
29 dccph_cscov:4;
30#else
31#error "Adjust your <asm/byteorder.h> defines"
32#endif
33 __sum16 dccph_checksum;
34#if defined(__LITTLE_ENDIAN_BITFIELD)
35 __u8 dccph_x:1,
36 dccph_type:4,
37 dccph_reserved:3;
38#elif defined(__BIG_ENDIAN_BITFIELD)
39 __u8 dccph_reserved:3,
40 dccph_type:4,
41 dccph_x:1;
42#else
43#error "Adjust your <asm/byteorder.h> defines"
44#endif
45 __u8 dccph_seq2;
46 __be16 dccph_seq;
47};
48
49/**
50 * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
51 *
52 * @dccph_seq_low - low 24 bits of a 48 bit seq packet
53 */
54struct dccp_hdr_ext {
55 __be32 dccph_seq_low;
56};
57
58/**
59 * struct dccp_hdr_request - Connection initiation request header
60 *
61 * @dccph_req_service - Service to which the client app wants to connect
62 */
63struct dccp_hdr_request {
64 __be32 dccph_req_service;
65};
66/**
67 * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
68 *
69 * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
70 * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
71 */
72struct dccp_hdr_ack_bits {
73 __be16 dccph_reserved1;
74 __be16 dccph_ack_nr_high;
75 __be32 dccph_ack_nr_low;
76};
77/**
78 * struct dccp_hdr_response - Connection initiation response header
79 *
80 * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
81 * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
82 */
83struct dccp_hdr_response {
84 struct dccp_hdr_ack_bits dccph_resp_ack;
85 __be32 dccph_resp_service;
86};
87
88/**
89 * struct dccp_hdr_reset - Unconditionally shut down a connection
90 *
91 * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
92 * @dccph_reset_code - one of %dccp_reset_codes
93 * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
94 */
95struct dccp_hdr_reset {
96 struct dccp_hdr_ack_bits dccph_reset_ack;
97 __u8 dccph_reset_code,
98 dccph_reset_data[3];
99};
100
101enum dccp_pkt_type {
102 DCCP_PKT_REQUEST = 0,
103 DCCP_PKT_RESPONSE,
104 DCCP_PKT_DATA,
105 DCCP_PKT_ACK,
106 DCCP_PKT_DATAACK,
107 DCCP_PKT_CLOSEREQ,
108 DCCP_PKT_CLOSE,
109 DCCP_PKT_RESET,
110 DCCP_PKT_SYNC,
111 DCCP_PKT_SYNCACK,
112 DCCP_PKT_INVALID,
113};
114
115#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
116
117static inline unsigned int dccp_packet_hdr_len(const __u8 type)
118{
119 if (type == DCCP_PKT_DATA)
120 return 0;
121 if (type == DCCP_PKT_DATAACK ||
122 type == DCCP_PKT_ACK ||
123 type == DCCP_PKT_SYNC ||
124 type == DCCP_PKT_SYNCACK ||
125 type == DCCP_PKT_CLOSE ||
126 type == DCCP_PKT_CLOSEREQ)
127 return sizeof(struct dccp_hdr_ack_bits);
128 if (type == DCCP_PKT_REQUEST)
129 return sizeof(struct dccp_hdr_request);
130 if (type == DCCP_PKT_RESPONSE)
131 return sizeof(struct dccp_hdr_response);
132 return sizeof(struct dccp_hdr_reset);
133}
134enum dccp_reset_codes {
135 DCCP_RESET_CODE_UNSPECIFIED = 0,
136 DCCP_RESET_CODE_CLOSED,
137 DCCP_RESET_CODE_ABORTED,
138 DCCP_RESET_CODE_NO_CONNECTION,
139 DCCP_RESET_CODE_PACKET_ERROR,
140 DCCP_RESET_CODE_OPTION_ERROR,
141 DCCP_RESET_CODE_MANDATORY_ERROR,
142 DCCP_RESET_CODE_CONNECTION_REFUSED,
143 DCCP_RESET_CODE_BAD_SERVICE_CODE,
144 DCCP_RESET_CODE_TOO_BUSY,
145 DCCP_RESET_CODE_BAD_INIT_COOKIE,
146 DCCP_RESET_CODE_AGGRESSION_PENALTY,
147
148 DCCP_MAX_RESET_CODES /* Leave at the end! */
149};
150
151/* DCCP options */
152enum {
153 DCCPO_PADDING = 0,
154 DCCPO_MANDATORY = 1,
155 DCCPO_MIN_RESERVED = 3,
156 DCCPO_MAX_RESERVED = 31,
157 DCCPO_CHANGE_L = 32,
158 DCCPO_CONFIRM_L = 33,
159 DCCPO_CHANGE_R = 34,
160 DCCPO_CONFIRM_R = 35,
161 DCCPO_NDP_COUNT = 37,
162 DCCPO_ACK_VECTOR_0 = 38,
163 DCCPO_ACK_VECTOR_1 = 39,
164 DCCPO_TIMESTAMP = 41,
165 DCCPO_TIMESTAMP_ECHO = 42,
166 DCCPO_ELAPSED_TIME = 43,
167 DCCPO_MAX = 45,
168 DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170 DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
172};
173/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
174#define DCCP_SINGLE_OPT_MAXLEN 253
175
176/* DCCP CCIDS */
177enum {
178 DCCPC_CCID2 = 2,
179 DCCPC_CCID3 = 3,
180};
181
182/* DCCP features (RFC 4340 section 6.4) */
183enum dccp_feature_numbers {
184 DCCPF_RESERVED = 0,
185 DCCPF_CCID = 1,
186 DCCPF_SHORT_SEQNOS = 2,
187 DCCPF_SEQUENCE_WINDOW = 3,
188 DCCPF_ECN_INCAPABLE = 4,
189 DCCPF_ACK_RATIO = 5,
190 DCCPF_SEND_ACK_VECTOR = 6,
191 DCCPF_SEND_NDP_COUNT = 7,
192 DCCPF_MIN_CSUM_COVER = 8,
193 DCCPF_DATA_CHECKSUM = 9,
194 /* 10-127 reserved */
195 DCCPF_MIN_CCID_SPECIFIC = 128,
196 DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
197 DCCPF_MAX_CCID_SPECIFIC = 255,
198};
199
200/* DCCP socket control message types for cmsg */
201enum dccp_cmsg_type {
202 DCCP_SCM_PRIORITY = 1,
203 DCCP_SCM_QPOLICY_MAX = 0xFFFF,
204 /* ^-- Up to here reserved exclusively for qpolicy parameters */
205 DCCP_SCM_MAX
206};
207
208/* DCCP priorities for outgoing/queued packets */
209enum dccp_packet_dequeueing_policy {
210 DCCPQ_POLICY_SIMPLE,
211 DCCPQ_POLICY_PRIO,
212 DCCPQ_POLICY_MAX
213};
214
215/* DCCP socket options */
216#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
217#define DCCP_SOCKOPT_SERVICE 2
218#define DCCP_SOCKOPT_CHANGE_L 3
219#define DCCP_SOCKOPT_CHANGE_R 4
220#define DCCP_SOCKOPT_GET_CUR_MPS 5
221#define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
222#define DCCP_SOCKOPT_SEND_CSCOV 10
223#define DCCP_SOCKOPT_RECV_CSCOV 11
224#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
225#define DCCP_SOCKOPT_CCID 13
226#define DCCP_SOCKOPT_TX_CCID 14
227#define DCCP_SOCKOPT_RX_CCID 15
228#define DCCP_SOCKOPT_QPOLICY_ID 16
229#define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
230#define DCCP_SOCKOPT_CCID_RX_INFO 128
231#define DCCP_SOCKOPT_CCID_TX_INFO 192
232
233/* maximum number of services provided on the same listening port */
234#define DCCP_SERVICE_LIST_MAX_LEN 32
235
236#ifdef __KERNEL__
237 4
238#include <linux/in.h> 5#include <linux/in.h>
239#include <linux/interrupt.h> 6#include <linux/interrupt.h>
@@ -246,6 +13,7 @@ enum dccp_packet_dequeueing_policy {
246#include <net/inet_sock.h> 13#include <net/inet_sock.h>
247#include <net/inet_timewait_sock.h> 14#include <net/inet_timewait_sock.h>
248#include <net/tcp_states.h> 15#include <net/tcp_states.h>
16#include <uapi/linux/dccp.h>
249 17
250enum dccp_state { 18enum dccp_state {
251 DCCP_OPEN = TCP_ESTABLISHED, 19 DCCP_OPEN = TCP_ESTABLISHED,
@@ -551,6 +319,4 @@ static inline const char *dccp_role(const struct sock *sk)
551 319
552extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req); 320extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
553 321
554#endif /* __KERNEL__ */
555
556#endif /* _LINUX_DCCP_H */ 322#endif /* _LINUX_DCCP_H */
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 520152411cd..1d47dcce11e 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -10,68 +10,11 @@
10** 10**
11******************************************************************************* 11*******************************************************************************
12******************************************************************************/ 12******************************************************************************/
13
14#ifndef __DLM_DOT_H__ 13#ifndef __DLM_DOT_H__
15#define __DLM_DOT_H__ 14#define __DLM_DOT_H__
16 15
17/* 16#include <uapi/linux/dlm.h>
18 * Interface to Distributed Lock Manager (DLM)
19 * routines and structures to use DLM lockspaces
20 */
21
22/* Lock levels and flags are here */
23#include <linux/dlmconstants.h>
24#include <linux/types.h>
25
26typedef void dlm_lockspace_t;
27
28/*
29 * Lock status block
30 *
31 * Use this structure to specify the contents of the lock value block. For a
32 * conversion request, this structure is used to specify the lock ID of the
33 * lock. DLM writes the status of the lock request and the lock ID assigned
34 * to the request in the lock status block.
35 *
36 * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests.
37 * It is available when dlm_lock returns.
38 *
39 * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
40 * shown for the DLM_LKF_VALBLK flag.
41 *
42 * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
43 * it was first demoted to NL to avoid conversion deadlock.
44 * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
45 *
46 * sb_status: the returned status of the lock request set prior to AST
47 * execution. Possible return values:
48 *
49 * 0 if lock request was successful
50 * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
51 * -DLM_EUNLOCK if unlock request was successful
52 * -DLM_ECANCEL if a cancel completed successfully
53 * -EDEADLK if a deadlock was detected
54 * -ETIMEDOUT if the lock request was canceled due to a timeout
55 */
56
57#define DLM_SBF_DEMOTED 0x01
58#define DLM_SBF_VALNOTVALID 0x02
59#define DLM_SBF_ALTMODE 0x04
60 17
61struct dlm_lksb {
62 int sb_status;
63 __u32 sb_lkid;
64 char sb_flags;
65 char * sb_lvbptr;
66};
67
68/* dlm_new_lockspace() flags */
69
70#define DLM_LSFL_TIMEWARN 0x00000002
71#define DLM_LSFL_FS 0x00000004
72#define DLM_LSFL_NEWEXCL 0x00000008
73
74#ifdef __KERNEL__
75 18
76struct dlm_slot { 19struct dlm_slot {
77 int nodeid; /* 1 to MAX_INT */ 20 int nodeid; /* 1 to MAX_INT */
@@ -226,7 +169,4 @@ int dlm_unlock(dlm_lockspace_t *lockspace,
226 struct dlm_lksb *lksb, 169 struct dlm_lksb *lksb,
227 void *astarg); 170 void *astarg);
228 171
229#endif /* __KERNEL__ */
230
231#endif /* __DLM_DOT_H__ */ 172#endif /* __DLM_DOT_H__ */
232
diff --git a/include/linux/dlm_plock.h b/include/linux/dlm_plock.h
index 3b1cc1be419..95ad387a776 100644
--- a/include/linux/dlm_plock.h
+++ b/include/linux/dlm_plock.h
@@ -5,50 +5,15 @@
5 * modify, copy, or redistribute it subject to the terms and conditions 5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU General Public License v.2. 6 * of the GNU General Public License v.2.
7 */ 7 */
8
9#ifndef __DLM_PLOCK_DOT_H__ 8#ifndef __DLM_PLOCK_DOT_H__
10#define __DLM_PLOCK_DOT_H__ 9#define __DLM_PLOCK_DOT_H__
11 10
12#include <linux/types.h> 11#include <uapi/linux/dlm_plock.h>
13
14#define DLM_PLOCK_MISC_NAME "dlm_plock"
15
16#define DLM_PLOCK_VERSION_MAJOR 1
17#define DLM_PLOCK_VERSION_MINOR 2
18#define DLM_PLOCK_VERSION_PATCH 0
19
20enum {
21 DLM_PLOCK_OP_LOCK = 1,
22 DLM_PLOCK_OP_UNLOCK,
23 DLM_PLOCK_OP_GET,
24};
25 12
26#define DLM_PLOCK_FL_CLOSE 1
27
28struct dlm_plock_info {
29 __u32 version[3];
30 __u8 optype;
31 __u8 ex;
32 __u8 wait;
33 __u8 flags;
34 __u32 pid;
35 __s32 nodeid;
36 __s32 rv;
37 __u32 fsid;
38 __u64 number;
39 __u64 start;
40 __u64 end;
41 __u64 owner;
42};
43
44#ifdef __KERNEL__
45int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, 13int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
46 int cmd, struct file_lock *fl); 14 int cmd, struct file_lock *fl);
47int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file, 15int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
48 struct file_lock *fl); 16 struct file_lock *fl);
49int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file, 17int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
50 struct file_lock *fl); 18 struct file_lock *fl);
51#endif /* __KERNEL__ */
52
53#endif 19#endif
54
diff --git a/include/linux/edd.h b/include/linux/edd.h
index 4cbd0fe9df0..83d4371ec99 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -30,165 +30,9 @@
30#ifndef _LINUX_EDD_H 30#ifndef _LINUX_EDD_H
31#define _LINUX_EDD_H 31#define _LINUX_EDD_H
32 32
33#include <linux/types.h> 33#include <uapi/linux/edd.h>
34
35#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
36 in boot_params - treat this as 1 byte */
37#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
38#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
39#define EDDEXTSIZE 8 /* change these if you muck with the structures */
40#define EDDPARMSIZE 74
41#define CHECKEXTENSIONSPRESENT 0x41
42#define GETDEVICEPARAMETERS 0x48
43#define LEGACYGETDEVICEPARAMETERS 0x08
44#define EDDMAGIC1 0x55AA
45#define EDDMAGIC2 0xAA55
46
47
48#define READ_SECTORS 0x02 /* int13 AH=0x02 is READ_SECTORS command */
49#define EDD_MBR_SIG_OFFSET 0x1B8 /* offset of signature in the MBR */
50#define EDD_MBR_SIG_BUF 0x290 /* addr in boot params */
51#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
52#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
53 in boot_params - treat this as 1 byte */
54 34
55#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
56
57#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
58#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
59#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
60#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
61
62#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
63#define EDD_INFO_GEOMETRY_VALID (1 << 1)
64#define EDD_INFO_REMOVABLE (1 << 2)
65#define EDD_INFO_WRITE_VERIFY (1 << 3)
66#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
67#define EDD_INFO_LOCKABLE (1 << 5)
68#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
69#define EDD_INFO_USE_INT13_FN50 (1 << 7)
70
71struct edd_device_params {
72 __u16 length;
73 __u16 info_flags;
74 __u32 num_default_cylinders;
75 __u32 num_default_heads;
76 __u32 sectors_per_track;
77 __u64 number_of_sectors;
78 __u16 bytes_per_sector;
79 __u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */
80 __u16 key; /* = 0xBEDD */
81 __u8 device_path_info_length; /* = 44 */
82 __u8 reserved2;
83 __u16 reserved3;
84 __u8 host_bus_type[4];
85 __u8 interface_type[8];
86 union {
87 struct {
88 __u16 base_address;
89 __u16 reserved1;
90 __u32 reserved2;
91 } __attribute__ ((packed)) isa;
92 struct {
93 __u8 bus;
94 __u8 slot;
95 __u8 function;
96 __u8 channel;
97 __u32 reserved;
98 } __attribute__ ((packed)) pci;
99 /* pcix is same as pci */
100 struct {
101 __u64 reserved;
102 } __attribute__ ((packed)) ibnd;
103 struct {
104 __u64 reserved;
105 } __attribute__ ((packed)) xprs;
106 struct {
107 __u64 reserved;
108 } __attribute__ ((packed)) htpt;
109 struct {
110 __u64 reserved;
111 } __attribute__ ((packed)) unknown;
112 } interface_path;
113 union {
114 struct {
115 __u8 device;
116 __u8 reserved1;
117 __u16 reserved2;
118 __u32 reserved3;
119 __u64 reserved4;
120 } __attribute__ ((packed)) ata;
121 struct {
122 __u8 device;
123 __u8 lun;
124 __u8 reserved1;
125 __u8 reserved2;
126 __u32 reserved3;
127 __u64 reserved4;
128 } __attribute__ ((packed)) atapi;
129 struct {
130 __u16 id;
131 __u64 lun;
132 __u16 reserved1;
133 __u32 reserved2;
134 } __attribute__ ((packed)) scsi;
135 struct {
136 __u64 serial_number;
137 __u64 reserved;
138 } __attribute__ ((packed)) usb;
139 struct {
140 __u64 eui;
141 __u64 reserved;
142 } __attribute__ ((packed)) i1394;
143 struct {
144 __u64 wwid;
145 __u64 lun;
146 } __attribute__ ((packed)) fibre;
147 struct {
148 __u64 identity_tag;
149 __u64 reserved;
150 } __attribute__ ((packed)) i2o;
151 struct {
152 __u32 array_number;
153 __u32 reserved1;
154 __u64 reserved2;
155 } __attribute__ ((packed)) raid;
156 struct {
157 __u8 device;
158 __u8 reserved1;
159 __u16 reserved2;
160 __u32 reserved3;
161 __u64 reserved4;
162 } __attribute__ ((packed)) sata;
163 struct {
164 __u64 reserved1;
165 __u64 reserved2;
166 } __attribute__ ((packed)) unknown;
167 } device_path;
168 __u8 reserved4;
169 __u8 checksum;
170} __attribute__ ((packed));
171
172struct edd_info {
173 __u8 device;
174 __u8 version;
175 __u16 interface_support;
176 __u16 legacy_max_cylinder;
177 __u8 legacy_max_head;
178 __u8 legacy_sectors_per_track;
179 struct edd_device_params params;
180} __attribute__ ((packed));
181
182struct edd {
183 unsigned int mbr_signature[EDD_MBR_SIG_MAX];
184 struct edd_info edd_info[EDDMAXNR];
185 unsigned char mbr_signature_nr;
186 unsigned char edd_info_nr;
187};
188
189#ifdef __KERNEL__
190extern struct edd edd; 36extern struct edd edd;
191#endif /* __KERNEL__ */
192#endif /*!__ASSEMBLY__ */ 37#endif /*!__ASSEMBLY__ */
193
194#endif /* _LINUX_EDD_H */ 38#endif /* _LINUX_EDD_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 59ef40650e1..8c9048e3346 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -1,420 +1,9 @@
1#ifndef _LINUX_ELF_H 1#ifndef _LINUX_ELF_H
2#define _LINUX_ELF_H 2#define _LINUX_ELF_H
3 3
4#include <linux/types.h>
5#include <linux/elf-em.h>
6#ifdef __KERNEL__
7#include <asm/elf.h> 4#include <asm/elf.h>
8#endif 5#include <uapi/linux/elf.h>
9
10/* 32-bit ELF base types. */
11typedef __u32 Elf32_Addr;
12typedef __u16 Elf32_Half;
13typedef __u32 Elf32_Off;
14typedef __s32 Elf32_Sword;
15typedef __u32 Elf32_Word;
16
17/* 64-bit ELF base types. */
18typedef __u64 Elf64_Addr;
19typedef __u16 Elf64_Half;
20typedef __s16 Elf64_SHalf;
21typedef __u64 Elf64_Off;
22typedef __s32 Elf64_Sword;
23typedef __u32 Elf64_Word;
24typedef __u64 Elf64_Xword;
25typedef __s64 Elf64_Sxword;
26
27/* These constants are for the segment types stored in the image headers */
28#define PT_NULL 0
29#define PT_LOAD 1
30#define PT_DYNAMIC 2
31#define PT_INTERP 3
32#define PT_NOTE 4
33#define PT_SHLIB 5
34#define PT_PHDR 6
35#define PT_TLS 7 /* Thread local storage segment */
36#define PT_LOOS 0x60000000 /* OS-specific */
37#define PT_HIOS 0x6fffffff /* OS-specific */
38#define PT_LOPROC 0x70000000
39#define PT_HIPROC 0x7fffffff
40#define PT_GNU_EH_FRAME 0x6474e550
41
42#define PT_GNU_STACK (PT_LOOS + 0x474e551)
43
44/*
45 * Extended Numbering
46 *
47 * If the real number of program header table entries is larger than
48 * or equal to PN_XNUM(0xffff), it is set to sh_info field of the
49 * section header at index 0, and PN_XNUM is set to e_phnum
50 * field. Otherwise, the section header at index 0 is zero
51 * initialized, if it exists.
52 *
53 * Specifications are available in:
54 *
55 * - Sun microsystems: Linker and Libraries.
56 * Part No: 817-1984-17, September 2008.
57 * URL: http://docs.sun.com/app/docs/doc/817-1984
58 *
59 * - System V ABI AMD64 Architecture Processor Supplement
60 * Draft Version 0.99.,
61 * May 11, 2009.
62 * URL: http://www.x86-64.org/
63 */
64#define PN_XNUM 0xffff
65
66/* These constants define the different elf file types */
67#define ET_NONE 0
68#define ET_REL 1
69#define ET_EXEC 2
70#define ET_DYN 3
71#define ET_CORE 4
72#define ET_LOPROC 0xff00
73#define ET_HIPROC 0xffff
74
75/* This is the info that is needed to parse the dynamic section of the file */
76#define DT_NULL 0
77#define DT_NEEDED 1
78#define DT_PLTRELSZ 2
79#define DT_PLTGOT 3
80#define DT_HASH 4
81#define DT_STRTAB 5
82#define DT_SYMTAB 6
83#define DT_RELA 7
84#define DT_RELASZ 8
85#define DT_RELAENT 9
86#define DT_STRSZ 10
87#define DT_SYMENT 11
88#define DT_INIT 12
89#define DT_FINI 13
90#define DT_SONAME 14
91#define DT_RPATH 15
92#define DT_SYMBOLIC 16
93#define DT_REL 17
94#define DT_RELSZ 18
95#define DT_RELENT 19
96#define DT_PLTREL 20
97#define DT_DEBUG 21
98#define DT_TEXTREL 22
99#define DT_JMPREL 23
100#define DT_ENCODING 32
101#define OLD_DT_LOOS 0x60000000
102#define DT_LOOS 0x6000000d
103#define DT_HIOS 0x6ffff000
104#define DT_VALRNGLO 0x6ffffd00
105#define DT_VALRNGHI 0x6ffffdff
106#define DT_ADDRRNGLO 0x6ffffe00
107#define DT_ADDRRNGHI 0x6ffffeff
108#define DT_VERSYM 0x6ffffff0
109#define DT_RELACOUNT 0x6ffffff9
110#define DT_RELCOUNT 0x6ffffffa
111#define DT_FLAGS_1 0x6ffffffb
112#define DT_VERDEF 0x6ffffffc
113#define DT_VERDEFNUM 0x6ffffffd
114#define DT_VERNEED 0x6ffffffe
115#define DT_VERNEEDNUM 0x6fffffff
116#define OLD_DT_HIOS 0x6fffffff
117#define DT_LOPROC 0x70000000
118#define DT_HIPROC 0x7fffffff
119
120/* This info is needed when parsing the symbol table */
121#define STB_LOCAL 0
122#define STB_GLOBAL 1
123#define STB_WEAK 2
124
125#define STT_NOTYPE 0
126#define STT_OBJECT 1
127#define STT_FUNC 2
128#define STT_SECTION 3
129#define STT_FILE 4
130#define STT_COMMON 5
131#define STT_TLS 6
132
133#define ELF_ST_BIND(x) ((x) >> 4)
134#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
135#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
136#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
137#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
138#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
139
140typedef struct dynamic{
141 Elf32_Sword d_tag;
142 union{
143 Elf32_Sword d_val;
144 Elf32_Addr d_ptr;
145 } d_un;
146} Elf32_Dyn;
147
148typedef struct {
149 Elf64_Sxword d_tag; /* entry tag value */
150 union {
151 Elf64_Xword d_val;
152 Elf64_Addr d_ptr;
153 } d_un;
154} Elf64_Dyn;
155
156/* The following are used with relocations */
157#define ELF32_R_SYM(x) ((x) >> 8)
158#define ELF32_R_TYPE(x) ((x) & 0xff)
159
160#define ELF64_R_SYM(i) ((i) >> 32)
161#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
162
163typedef struct elf32_rel {
164 Elf32_Addr r_offset;
165 Elf32_Word r_info;
166} Elf32_Rel;
167
168typedef struct elf64_rel {
169 Elf64_Addr r_offset; /* Location at which to apply the action */
170 Elf64_Xword r_info; /* index and type of relocation */
171} Elf64_Rel;
172
173typedef struct elf32_rela{
174 Elf32_Addr r_offset;
175 Elf32_Word r_info;
176 Elf32_Sword r_addend;
177} Elf32_Rela;
178
179typedef struct elf64_rela {
180 Elf64_Addr r_offset; /* Location at which to apply the action */
181 Elf64_Xword r_info; /* index and type of relocation */
182 Elf64_Sxword r_addend; /* Constant addend used to compute value */
183} Elf64_Rela;
184
185typedef struct elf32_sym{
186 Elf32_Word st_name;
187 Elf32_Addr st_value;
188 Elf32_Word st_size;
189 unsigned char st_info;
190 unsigned char st_other;
191 Elf32_Half st_shndx;
192} Elf32_Sym;
193
194typedef struct elf64_sym {
195 Elf64_Word st_name; /* Symbol name, index in string tbl */
196 unsigned char st_info; /* Type and binding attributes */
197 unsigned char st_other; /* No defined meaning, 0 */
198 Elf64_Half st_shndx; /* Associated section index */
199 Elf64_Addr st_value; /* Value of the symbol */
200 Elf64_Xword st_size; /* Associated symbol size */
201} Elf64_Sym;
202
203
204#define EI_NIDENT 16
205
206typedef struct elf32_hdr{
207 unsigned char e_ident[EI_NIDENT];
208 Elf32_Half e_type;
209 Elf32_Half e_machine;
210 Elf32_Word e_version;
211 Elf32_Addr e_entry; /* Entry point */
212 Elf32_Off e_phoff;
213 Elf32_Off e_shoff;
214 Elf32_Word e_flags;
215 Elf32_Half e_ehsize;
216 Elf32_Half e_phentsize;
217 Elf32_Half e_phnum;
218 Elf32_Half e_shentsize;
219 Elf32_Half e_shnum;
220 Elf32_Half e_shstrndx;
221} Elf32_Ehdr;
222
223typedef struct elf64_hdr {
224 unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
225 Elf64_Half e_type;
226 Elf64_Half e_machine;
227 Elf64_Word e_version;
228 Elf64_Addr e_entry; /* Entry point virtual address */
229 Elf64_Off e_phoff; /* Program header table file offset */
230 Elf64_Off e_shoff; /* Section header table file offset */
231 Elf64_Word e_flags;
232 Elf64_Half e_ehsize;
233 Elf64_Half e_phentsize;
234 Elf64_Half e_phnum;
235 Elf64_Half e_shentsize;
236 Elf64_Half e_shnum;
237 Elf64_Half e_shstrndx;
238} Elf64_Ehdr;
239
240/* These constants define the permissions on sections in the program
241 header, p_flags. */
242#define PF_R 0x4
243#define PF_W 0x2
244#define PF_X 0x1
245
246typedef struct elf32_phdr{
247 Elf32_Word p_type;
248 Elf32_Off p_offset;
249 Elf32_Addr p_vaddr;
250 Elf32_Addr p_paddr;
251 Elf32_Word p_filesz;
252 Elf32_Word p_memsz;
253 Elf32_Word p_flags;
254 Elf32_Word p_align;
255} Elf32_Phdr;
256
257typedef struct elf64_phdr {
258 Elf64_Word p_type;
259 Elf64_Word p_flags;
260 Elf64_Off p_offset; /* Segment file offset */
261 Elf64_Addr p_vaddr; /* Segment virtual address */
262 Elf64_Addr p_paddr; /* Segment physical address */
263 Elf64_Xword p_filesz; /* Segment size in file */
264 Elf64_Xword p_memsz; /* Segment size in memory */
265 Elf64_Xword p_align; /* Segment alignment, file & memory */
266} Elf64_Phdr;
267
268/* sh_type */
269#define SHT_NULL 0
270#define SHT_PROGBITS 1
271#define SHT_SYMTAB 2
272#define SHT_STRTAB 3
273#define SHT_RELA 4
274#define SHT_HASH 5
275#define SHT_DYNAMIC 6
276#define SHT_NOTE 7
277#define SHT_NOBITS 8
278#define SHT_REL 9
279#define SHT_SHLIB 10
280#define SHT_DYNSYM 11
281#define SHT_NUM 12
282#define SHT_LOPROC 0x70000000
283#define SHT_HIPROC 0x7fffffff
284#define SHT_LOUSER 0x80000000
285#define SHT_HIUSER 0xffffffff
286
287/* sh_flags */
288#define SHF_WRITE 0x1
289#define SHF_ALLOC 0x2
290#define SHF_EXECINSTR 0x4
291#define SHF_MASKPROC 0xf0000000
292
293/* special section indexes */
294#define SHN_UNDEF 0
295#define SHN_LORESERVE 0xff00
296#define SHN_LOPROC 0xff00
297#define SHN_HIPROC 0xff1f
298#define SHN_ABS 0xfff1
299#define SHN_COMMON 0xfff2
300#define SHN_HIRESERVE 0xffff
301
302typedef struct elf32_shdr {
303 Elf32_Word sh_name;
304 Elf32_Word sh_type;
305 Elf32_Word sh_flags;
306 Elf32_Addr sh_addr;
307 Elf32_Off sh_offset;
308 Elf32_Word sh_size;
309 Elf32_Word sh_link;
310 Elf32_Word sh_info;
311 Elf32_Word sh_addralign;
312 Elf32_Word sh_entsize;
313} Elf32_Shdr;
314
315typedef struct elf64_shdr {
316 Elf64_Word sh_name; /* Section name, index in string tbl */
317 Elf64_Word sh_type; /* Type of section */
318 Elf64_Xword sh_flags; /* Miscellaneous section attributes */
319 Elf64_Addr sh_addr; /* Section virtual addr at execution */
320 Elf64_Off sh_offset; /* Section file offset */
321 Elf64_Xword sh_size; /* Size of section in bytes */
322 Elf64_Word sh_link; /* Index of another section */
323 Elf64_Word sh_info; /* Additional section information */
324 Elf64_Xword sh_addralign; /* Section alignment */
325 Elf64_Xword sh_entsize; /* Entry size if section holds table */
326} Elf64_Shdr;
327
328#define EI_MAG0 0 /* e_ident[] indexes */
329#define EI_MAG1 1
330#define EI_MAG2 2
331#define EI_MAG3 3
332#define EI_CLASS 4
333#define EI_DATA 5
334#define EI_VERSION 6
335#define EI_OSABI 7
336#define EI_PAD 8
337
338#define ELFMAG0 0x7f /* EI_MAG */
339#define ELFMAG1 'E'
340#define ELFMAG2 'L'
341#define ELFMAG3 'F'
342#define ELFMAG "\177ELF"
343#define SELFMAG 4
344
345#define ELFCLASSNONE 0 /* EI_CLASS */
346#define ELFCLASS32 1
347#define ELFCLASS64 2
348#define ELFCLASSNUM 3
349
350#define ELFDATANONE 0 /* e_ident[EI_DATA] */
351#define ELFDATA2LSB 1
352#define ELFDATA2MSB 2
353
354#define EV_NONE 0 /* e_version, EI_VERSION */
355#define EV_CURRENT 1
356#define EV_NUM 2
357
358#define ELFOSABI_NONE 0
359#define ELFOSABI_LINUX 3
360
361#ifndef ELF_OSABI
362#define ELF_OSABI ELFOSABI_NONE
363#endif
364
365/*
366 * Notes used in ET_CORE. Architectures export some of the arch register sets
367 * using the corresponding note types via the PTRACE_GETREGSET and
368 * PTRACE_SETREGSET requests.
369 */
370#define NT_PRSTATUS 1
371#define NT_PRFPREG 2
372#define NT_PRPSINFO 3
373#define NT_TASKSTRUCT 4
374#define NT_AUXV 6
375/*
376 * Note to userspace developers: size of NT_SIGINFO note may increase
377 * in the future to accomodate more fields, don't assume it is fixed!
378 */
379#define NT_SIGINFO 0x53494749
380#define NT_FILE 0x46494c45
381#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
382#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
383#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
384#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
385#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
386#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
387#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
388#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
389#define NT_S390_TIMER 0x301 /* s390 timer register */
390#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
391#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
392#define NT_S390_CTRS 0x304 /* s390 control registers */
393#define NT_S390_PREFIX 0x305 /* s390 prefix register */
394#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
395#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
396#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
397#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
398#define NT_ARM_TLS 0x401 /* ARM TLS register */
399#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
400#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
401
402
403/* Note header in a PT_NOTE section */
404typedef struct elf32_note {
405 Elf32_Word n_namesz; /* Name size */
406 Elf32_Word n_descsz; /* Content size */
407 Elf32_Word n_type; /* Content type */
408} Elf32_Nhdr;
409
410/* Note header in a PT_NOTE section */
411typedef struct elf64_note {
412 Elf64_Word n_namesz; /* Name size */
413 Elf64_Word n_descsz; /* Content size */
414 Elf64_Word n_type; /* Content type */
415} Elf64_Nhdr;
416 6
417#ifdef __KERNEL__
418#ifndef elf_read_implies_exec 7#ifndef elf_read_implies_exec
419 /* Executables for which elf_read_implies_exec() returns TRUE will 8 /* Executables for which elf_read_implies_exec() returns TRUE will
420 have the READ_IMPLIES_EXEC personality flag set automatically. 9 have the READ_IMPLIES_EXEC personality flag set automatically.
@@ -455,5 +44,4 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
455extern int elf_coredump_extra_notes_size(void); 44extern int elf_coredump_extra_notes_size(void);
456extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset); 45extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
457#endif 46#endif
458#endif /* __KERNEL__ */
459#endif /* _LINUX_ELF_H */ 47#endif /* _LINUX_ELF_H */
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 0698c79fbcb..cdd3d13efce 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -1,109 +1,11 @@
1#ifndef _LINUX_ELFCORE_H 1#ifndef _LINUX_ELFCORE_H
2#define _LINUX_ELFCORE_H 2#define _LINUX_ELFCORE_H
3 3
4#include <linux/types.h>
5#include <linux/signal.h>
6#include <linux/time.h>
7#ifdef __KERNEL__
8#include <linux/user.h> 4#include <linux/user.h>
9#include <linux/bug.h> 5#include <linux/bug.h>
10#endif
11#include <linux/ptrace.h>
12#include <linux/elf.h>
13#include <linux/fs.h>
14
15struct elf_siginfo
16{
17 int si_signo; /* signal number */
18 int si_code; /* extra code */
19 int si_errno; /* errno */
20};
21
22#ifdef __KERNEL__
23#include <asm/elf.h> 6#include <asm/elf.h>
24#endif 7#include <uapi/linux/elfcore.h>
25 8
26#ifndef __KERNEL__
27typedef elf_greg_t greg_t;
28typedef elf_gregset_t gregset_t;
29typedef elf_fpregset_t fpregset_t;
30typedef elf_fpxregset_t fpxregset_t;
31#define NGREG ELF_NGREG
32#endif
33
34/*
35 * Definitions to generate Intel SVR4-like core files.
36 * These mostly have the same names as the SVR4 types with "elf_"
37 * tacked on the front to prevent clashes with linux definitions,
38 * and the typedef forms have been avoided. This is mostly like
39 * the SVR4 structure, but more Linuxy, with things that Linux does
40 * not support and which gdb doesn't really use excluded.
41 * Fields present but not used are marked with "XXX".
42 */
43struct elf_prstatus
44{
45#if 0
46 long pr_flags; /* XXX Process flags */
47 short pr_why; /* XXX Reason for process halt */
48 short pr_what; /* XXX More detailed reason */
49#endif
50 struct elf_siginfo pr_info; /* Info associated with signal */
51 short pr_cursig; /* Current signal */
52 unsigned long pr_sigpend; /* Set of pending signals */
53 unsigned long pr_sighold; /* Set of held signals */
54#if 0
55 struct sigaltstack pr_altstack; /* Alternate stack info */
56 struct sigaction pr_action; /* Signal action for current sig */
57#endif
58 pid_t pr_pid;
59 pid_t pr_ppid;
60 pid_t pr_pgrp;
61 pid_t pr_sid;
62 struct timeval pr_utime; /* User time */
63 struct timeval pr_stime; /* System time */
64 struct timeval pr_cutime; /* Cumulative user time */
65 struct timeval pr_cstime; /* Cumulative system time */
66#if 0
67 long pr_instr; /* Current instruction */
68#endif
69 elf_gregset_t pr_reg; /* GP registers */
70#ifdef CONFIG_BINFMT_ELF_FDPIC
71 /* When using FDPIC, the loadmap addresses need to be communicated
72 * to GDB in order for GDB to do the necessary relocations. The
73 * fields (below) used to communicate this information are placed
74 * immediately after ``pr_reg'', so that the loadmap addresses may
75 * be viewed as part of the register set if so desired.
76 */
77 unsigned long pr_exec_fdpic_loadmap;
78 unsigned long pr_interp_fdpic_loadmap;
79#endif
80 int pr_fpvalid; /* True if math co-processor being used. */
81};
82
83#define ELF_PRARGSZ (80) /* Number of chars for args */
84
85struct elf_prpsinfo
86{
87 char pr_state; /* numeric process state */
88 char pr_sname; /* char for pr_state */
89 char pr_zomb; /* zombie */
90 char pr_nice; /* nice val */
91 unsigned long pr_flag; /* flags */
92 __kernel_uid_t pr_uid;
93 __kernel_gid_t pr_gid;
94 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
95 /* Lots missing */
96 char pr_fname[16]; /* filename of executable */
97 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
98};
99
100#ifndef __KERNEL__
101typedef struct elf_prstatus prstatus_t;
102typedef struct elf_prpsinfo prpsinfo_t;
103#define PRARGSZ ELF_PRARGSZ
104#endif
105
106#ifdef __KERNEL__
107static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) 9static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
108{ 10{
109#ifdef ELF_CORE_COPY_REGS 11#ifdef ELF_CORE_COPY_REGS
@@ -167,6 +69,4 @@ extern int
167elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); 69elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
168extern size_t elf_core_extra_data_size(void); 70extern size_t elf_core_extra_data_size(void);
169 71
170#endif /* __KERNEL__ */
171
172#endif /* _LINUX_ELFCORE_H */ 72#endif /* _LINUX_ELFCORE_H */
diff --git a/include/linux/errno.h b/include/linux/errno.h
index e0de516374d..f6bf082d4d4 100644
--- a/include/linux/errno.h
+++ b/include/linux/errno.h
@@ -1,9 +1,8 @@
1#ifndef _LINUX_ERRNO_H 1#ifndef _LINUX_ERRNO_H
2#define _LINUX_ERRNO_H 2#define _LINUX_ERRNO_H
3 3
4#include <asm/errno.h> 4#include <uapi/linux/errno.h>
5 5
6#ifdef __KERNEL__
7 6
8/* 7/*
9 * These should never be seen by user programs. To return one of ERESTART* 8 * These should never be seen by user programs. To return one of ERESTART*
@@ -32,5 +31,3 @@
32#define EIOCBRETRY 530 /* iocb queued, will trigger a retry */ 31#define EIOCBRETRY 530 /* iocb queued, will trigger a retry */
33 32
34#endif 33#endif
35
36#endif
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index fd0628be45c..9ca23fcfb5d 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -1,33 +1,12 @@
1#ifndef _LINUX_ERRQUEUE_H 1#ifndef _LINUX_ERRQUEUE_H
2#define _LINUX_ERRQUEUE_H 1 2#define _LINUX_ERRQUEUE_H 1
3 3
4#include <linux/types.h>
5
6struct sock_extended_err {
7 __u32 ee_errno;
8 __u8 ee_origin;
9 __u8 ee_type;
10 __u8 ee_code;
11 __u8 ee_pad;
12 __u32 ee_info;
13 __u32 ee_data;
14};
15
16#define SO_EE_ORIGIN_NONE 0
17#define SO_EE_ORIGIN_LOCAL 1
18#define SO_EE_ORIGIN_ICMP 2
19#define SO_EE_ORIGIN_ICMP6 3
20#define SO_EE_ORIGIN_TXSTATUS 4
21#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
22
23#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
24
25#ifdef __KERNEL__
26 4
27#include <net/ip.h> 5#include <net/ip.h>
28#if IS_ENABLED(CONFIG_IPV6) 6#if IS_ENABLED(CONFIG_IPV6)
29#include <linux/ipv6.h> 7#include <linux/ipv6.h>
30#endif 8#endif
9#include <uapi/linux/errqueue.h>
31 10
32#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb)) 11#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
33 12
@@ -44,5 +23,3 @@ struct sock_exterr_skb {
44}; 23};
45 24
46#endif 25#endif
47
48#endif
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index fcb4f8e60c1..c8e3e7e39c6 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -9,596 +9,12 @@
9 * scott.feldman@intel.com) 9 * scott.feldman@intel.com)
10 * Portions Copyright (C) Sun Microsystems 2008 10 * Portions Copyright (C) Sun Microsystems 2008
11 */ 11 */
12
13#ifndef _LINUX_ETHTOOL_H 12#ifndef _LINUX_ETHTOOL_H
14#define _LINUX_ETHTOOL_H 13#define _LINUX_ETHTOOL_H
15 14
16#ifdef __KERNEL__
17#include <linux/compat.h> 15#include <linux/compat.h>
18#endif 16#include <uapi/linux/ethtool.h>
19#include <linux/types.h>
20#include <linux/if_ether.h>
21
22/* This should work for both 32 and 64 bit userland. */
23struct ethtool_cmd {
24 __u32 cmd;
25 __u32 supported; /* Features this interface supports */
26 __u32 advertising; /* Features this interface advertises */
27 __u16 speed; /* The forced speed (lower bits) in
28 * Mbps. Please use
29 * ethtool_cmd_speed()/_set() to
30 * access it */
31 __u8 duplex; /* Duplex, half or full */
32 __u8 port; /* Which connector port */
33 __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
34 * May be read-only or read-write
35 * depending on the driver.
36 */
37 __u8 transceiver; /* Which transceiver to use */
38 __u8 autoneg; /* Enable or disable autonegotiation */
39 __u8 mdio_support; /* MDIO protocols supported. Read-only.
40 * Not set by all drivers.
41 */
42 __u32 maxtxpkt; /* Tx pkts before generating tx int */
43 __u32 maxrxpkt; /* Rx pkts before generating rx int */
44 __u16 speed_hi; /* The forced speed (upper
45 * bits) in Mbps. Please use
46 * ethtool_cmd_speed()/_set() to
47 * access it */
48 __u8 eth_tp_mdix; /* twisted pair MDI-X status */
49 __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
50 * link should be renegotiated if necessary
51 */
52 __u32 lp_advertising; /* Features the link partner advertises */
53 __u32 reserved[2];
54};
55
56static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
57 __u32 speed)
58{
59
60 ep->speed = (__u16)speed;
61 ep->speed_hi = (__u16)(speed >> 16);
62}
63
64static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
65{
66 return (ep->speed_hi << 16) | ep->speed;
67}
68
69/* Device supports clause 22 register access to PHY or peripherals
70 * using the interface defined in <linux/mii.h>. This should not be
71 * set if there are known to be no such peripherals present or if
72 * the driver only emulates clause 22 registers for compatibility.
73 */
74#define ETH_MDIO_SUPPORTS_C22 1
75
76/* Device supports clause 45 register access to PHY or peripherals
77 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
78 * This should not be set if there are known to be no such peripherals
79 * present.
80 */
81#define ETH_MDIO_SUPPORTS_C45 2
82
83#define ETHTOOL_FWVERS_LEN 32
84#define ETHTOOL_BUSINFO_LEN 32
85/* these strings are set to whatever the driver author decides... */
86struct ethtool_drvinfo {
87 __u32 cmd;
88 char driver[32]; /* driver short name, "tulip", "eepro100" */
89 char version[32]; /* driver version string */
90 char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
91 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
92 /* For PCI devices, use pci_name(pci_dev). */
93 char reserved1[32];
94 char reserved2[12];
95 /*
96 * Some struct members below are filled in
97 * using ops->get_sset_count(). Obtaining
98 * this info from ethtool_drvinfo is now
99 * deprecated; Use ETHTOOL_GSSET_INFO
100 * instead.
101 */
102 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
103 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
104 __u32 testinfo_len;
105 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
106 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
107};
108
109#define SOPASS_MAX 6
110/* wake-on-lan settings */
111struct ethtool_wolinfo {
112 __u32 cmd;
113 __u32 supported;
114 __u32 wolopts;
115 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
116};
117
118/* for passing single values */
119struct ethtool_value {
120 __u32 cmd;
121 __u32 data;
122};
123
124/* for passing big chunks of data */
125struct ethtool_regs {
126 __u32 cmd;
127 __u32 version; /* driver-specific, indicates different chips/revs */
128 __u32 len; /* bytes */
129 __u8 data[0];
130};
131
132/* for passing EEPROM chunks */
133struct ethtool_eeprom {
134 __u32 cmd;
135 __u32 magic;
136 __u32 offset; /* in bytes */
137 __u32 len; /* in bytes */
138 __u8 data[0];
139};
140
141/**
142 * struct ethtool_eee - Energy Efficient Ethernet information
143 * @cmd: ETHTOOL_{G,S}EEE
144 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
145 * for which there is EEE support.
146 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
147 * advertised as eee capable.
148 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
149 * combinations advertised by the link partner as eee capable.
150 * @eee_active: Result of the eee auto negotiation.
151 * @eee_enabled: EEE configured mode (enabled/disabled).
152 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
153 * that eee was negotiated.
154 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
155 * its tx lpi (after reaching 'idle' state). Effective only when eee
156 * was negotiated and tx_lpi_enabled was set.
157 */
158struct ethtool_eee {
159 __u32 cmd;
160 __u32 supported;
161 __u32 advertised;
162 __u32 lp_advertised;
163 __u32 eee_active;
164 __u32 eee_enabled;
165 __u32 tx_lpi_enabled;
166 __u32 tx_lpi_timer;
167 __u32 reserved[2];
168};
169
170/**
171 * struct ethtool_modinfo - plugin module eeprom information
172 * @cmd: %ETHTOOL_GMODULEINFO
173 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
174 * @eeprom_len: Length of the eeprom
175 *
176 * This structure is used to return the information to
177 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
178 * The type code indicates the eeprom data format
179 */
180struct ethtool_modinfo {
181 __u32 cmd;
182 __u32 type;
183 __u32 eeprom_len;
184 __u32 reserved[8];
185};
186
187/**
188 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
189 * @cmd: ETHTOOL_{G,S}COALESCE
190 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
191 * a packet arrives.
192 * @rx_max_coalesced_frames: Maximum number of packets to receive
193 * before an RX interrupt.
194 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
195 * this value applies while an IRQ is being serviced by the host.
196 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
197 * except that this value applies while an IRQ is being serviced
198 * by the host.
199 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
200 * a packet is sent.
201 * @tx_max_coalesced_frames: Maximum number of packets to be sent
202 * before a TX interrupt.
203 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
204 * this value applies while an IRQ is being serviced by the host.
205 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
206 * except that this value applies while an IRQ is being serviced
207 * by the host.
208 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
209 * statistics block updates. Some drivers do not have an
210 * in-memory statistic block, and in such cases this value is
211 * ignored. This value must not be zero.
212 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
213 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
214 * @pkt_rate_low: Threshold for low packet rate (packets per second).
215 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
216 * a packet arrives, when the packet rate is below @pkt_rate_low.
217 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
218 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
219 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
220 * a packet is sent, when the packet rate is below @pkt_rate_low.
221 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
222 * a TX interrupt, when the packet rate is below @pkt_rate_low.
223 * @pkt_rate_high: Threshold for high packet rate (packets per second).
224 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
225 * a packet arrives, when the packet rate is above @pkt_rate_high.
226 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
227 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
228 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
229 * a packet is sent, when the packet rate is above @pkt_rate_high.
230 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
231 * a TX interrupt, when the packet rate is above @pkt_rate_high.
232 * @rate_sample_interval: How often to do adaptive coalescing packet rate
233 * sampling, measured in seconds. Must not be zero.
234 *
235 * Each pair of (usecs, max_frames) fields specifies this exit
236 * condition for interrupt coalescing:
237 * (usecs > 0 && time_since_first_completion >= usecs) ||
238 * (max_frames > 0 && completed_frames >= max_frames)
239 * It is illegal to set both usecs and max_frames to zero as this
240 * would cause interrupts to never be generated. To disable
241 * coalescing, set usecs = 0 and max_frames = 1.
242 *
243 * Some implementations ignore the value of max_frames and use the
244 * condition:
245 * time_since_first_completion >= usecs
246 * This is deprecated. Drivers for hardware that does not support
247 * counting completions should validate that max_frames == !rx_usecs.
248 *
249 * Adaptive RX/TX coalescing is an algorithm implemented by some
250 * drivers to improve latency under low packet rates and improve
251 * throughput under high packet rates. Some drivers only implement
252 * one of RX or TX adaptive coalescing. Anything not implemented by
253 * the driver causes these values to be silently ignored.
254 *
255 * When the packet rate is below @pkt_rate_high but above
256 * @pkt_rate_low (both measured in packets per second) the
257 * normal {rx,tx}_* coalescing parameters are used.
258 */
259struct ethtool_coalesce {
260 __u32 cmd;
261 __u32 rx_coalesce_usecs;
262 __u32 rx_max_coalesced_frames;
263 __u32 rx_coalesce_usecs_irq;
264 __u32 rx_max_coalesced_frames_irq;
265 __u32 tx_coalesce_usecs;
266 __u32 tx_max_coalesced_frames;
267 __u32 tx_coalesce_usecs_irq;
268 __u32 tx_max_coalesced_frames_irq;
269 __u32 stats_block_coalesce_usecs;
270 __u32 use_adaptive_rx_coalesce;
271 __u32 use_adaptive_tx_coalesce;
272 __u32 pkt_rate_low;
273 __u32 rx_coalesce_usecs_low;
274 __u32 rx_max_coalesced_frames_low;
275 __u32 tx_coalesce_usecs_low;
276 __u32 tx_max_coalesced_frames_low;
277 __u32 pkt_rate_high;
278 __u32 rx_coalesce_usecs_high;
279 __u32 rx_max_coalesced_frames_high;
280 __u32 tx_coalesce_usecs_high;
281 __u32 tx_max_coalesced_frames_high;
282 __u32 rate_sample_interval;
283};
284
285/* for configuring RX/TX ring parameters */
286struct ethtool_ringparam {
287 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
288
289 /* Read only attributes. These indicate the maximum number
290 * of pending RX/TX ring entries the driver will allow the
291 * user to set.
292 */
293 __u32 rx_max_pending;
294 __u32 rx_mini_max_pending;
295 __u32 rx_jumbo_max_pending;
296 __u32 tx_max_pending;
297
298 /* Values changeable by the user. The valid values are
299 * in the range 1 to the "*_max_pending" counterpart above.
300 */
301 __u32 rx_pending;
302 __u32 rx_mini_pending;
303 __u32 rx_jumbo_pending;
304 __u32 tx_pending;
305};
306
307/**
308 * struct ethtool_channels - configuring number of network channel
309 * @cmd: ETHTOOL_{G,S}CHANNELS
310 * @max_rx: Read only. Maximum number of receive channel the driver support.
311 * @max_tx: Read only. Maximum number of transmit channel the driver support.
312 * @max_other: Read only. Maximum number of other channel the driver support.
313 * @max_combined: Read only. Maximum number of combined channel the driver
314 * support. Set of queues RX, TX or other.
315 * @rx_count: Valid values are in the range 1 to the max_rx.
316 * @tx_count: Valid values are in the range 1 to the max_tx.
317 * @other_count: Valid values are in the range 1 to the max_other.
318 * @combined_count: Valid values are in the range 1 to the max_combined.
319 *
320 * This can be used to configure RX, TX and other channels.
321 */
322
323struct ethtool_channels {
324 __u32 cmd;
325 __u32 max_rx;
326 __u32 max_tx;
327 __u32 max_other;
328 __u32 max_combined;
329 __u32 rx_count;
330 __u32 tx_count;
331 __u32 other_count;
332 __u32 combined_count;
333};
334
335/* for configuring link flow control parameters */
336struct ethtool_pauseparam {
337 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
338
339 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
340 * being true) the user may set 'autoneg' here non-zero to have the
341 * pause parameters be auto-negotiated too. In such a case, the
342 * {rx,tx}_pause values below determine what capabilities are
343 * advertised.
344 *
345 * If 'autoneg' is zero or the link is not being auto-negotiated,
346 * then {rx,tx}_pause force the driver to use/not-use pause
347 * flow control.
348 */
349 __u32 autoneg;
350 __u32 rx_pause;
351 __u32 tx_pause;
352};
353
354#define ETH_GSTRING_LEN 32
355enum ethtool_stringset {
356 ETH_SS_TEST = 0,
357 ETH_SS_STATS,
358 ETH_SS_PRIV_FLAGS,
359 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
360 ETH_SS_FEATURES,
361};
362
363/* for passing string sets for data tagging */
364struct ethtool_gstrings {
365 __u32 cmd; /* ETHTOOL_GSTRINGS */
366 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
367 __u32 len; /* number of strings in the string set */
368 __u8 data[0];
369};
370
371struct ethtool_sset_info {
372 __u32 cmd; /* ETHTOOL_GSSET_INFO */
373 __u32 reserved;
374 __u64 sset_mask; /* input: each bit selects an sset to query */
375 /* output: each bit a returned sset */
376 __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
377 in sset_mask. One bit implies one
378 __u32, two bits implies two
379 __u32's, etc. */
380};
381
382/**
383 * enum ethtool_test_flags - flags definition of ethtool_test
384 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
385 * only online tests.
386 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
387 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
388 * test.
389 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
390 */
391
392enum ethtool_test_flags {
393 ETH_TEST_FL_OFFLINE = (1 << 0),
394 ETH_TEST_FL_FAILED = (1 << 1),
395 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
396 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
397};
398
399/* for requesting NIC test and getting results*/
400struct ethtool_test {
401 __u32 cmd; /* ETHTOOL_TEST */
402 __u32 flags; /* ETH_TEST_FL_xxx */
403 __u32 reserved;
404 __u32 len; /* result length, in number of u64 elements */
405 __u64 data[0];
406};
407
408/* for dumping NIC-specific statistics */
409struct ethtool_stats {
410 __u32 cmd; /* ETHTOOL_GSTATS */
411 __u32 n_stats; /* number of u64's being returned */
412 __u64 data[0];
413};
414
415struct ethtool_perm_addr {
416 __u32 cmd; /* ETHTOOL_GPERMADDR */
417 __u32 size;
418 __u8 data[0];
419};
420
421/* boolean flags controlling per-interface behavior characteristics.
422 * When reading, the flag indicates whether or not a certain behavior
423 * is enabled/present. When writing, the flag indicates whether
424 * or not the driver should turn on (set) or off (clear) a behavior.
425 *
426 * Some behaviors may read-only (unconditionally absent or present).
427 * If such is the case, return EINVAL in the set-flags operation if the
428 * flag differs from the read-only value.
429 */
430enum ethtool_flags {
431 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
432 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
433 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
434 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
435 ETH_FLAG_RXHASH = (1 << 28),
436};
437 17
438/* The following structures are for supporting RX network flow
439 * classification and RX n-tuple configuration. Note, all multibyte
440 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
441 * be in network byte order.
442 */
443
444/**
445 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
446 * @ip4src: Source host
447 * @ip4dst: Destination host
448 * @psrc: Source port
449 * @pdst: Destination port
450 * @tos: Type-of-service
451 *
452 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
453 */
454struct ethtool_tcpip4_spec {
455 __be32 ip4src;
456 __be32 ip4dst;
457 __be16 psrc;
458 __be16 pdst;
459 __u8 tos;
460};
461
462/**
463 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
464 * @ip4src: Source host
465 * @ip4dst: Destination host
466 * @spi: Security parameters index
467 * @tos: Type-of-service
468 *
469 * This can be used to specify an IPsec transport or tunnel over IPv4.
470 */
471struct ethtool_ah_espip4_spec {
472 __be32 ip4src;
473 __be32 ip4dst;
474 __be32 spi;
475 __u8 tos;
476};
477
478#define ETH_RX_NFC_IP4 1
479
480/**
481 * struct ethtool_usrip4_spec - general flow specification for IPv4
482 * @ip4src: Source host
483 * @ip4dst: Destination host
484 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
485 * @tos: Type-of-service
486 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
487 * @proto: Transport protocol number; mask must be 0
488 */
489struct ethtool_usrip4_spec {
490 __be32 ip4src;
491 __be32 ip4dst;
492 __be32 l4_4_bytes;
493 __u8 tos;
494 __u8 ip_ver;
495 __u8 proto;
496};
497
498union ethtool_flow_union {
499 struct ethtool_tcpip4_spec tcp_ip4_spec;
500 struct ethtool_tcpip4_spec udp_ip4_spec;
501 struct ethtool_tcpip4_spec sctp_ip4_spec;
502 struct ethtool_ah_espip4_spec ah_ip4_spec;
503 struct ethtool_ah_espip4_spec esp_ip4_spec;
504 struct ethtool_usrip4_spec usr_ip4_spec;
505 struct ethhdr ether_spec;
506 __u8 hdata[60];
507};
508
509struct ethtool_flow_ext {
510 __be16 vlan_etype;
511 __be16 vlan_tci;
512 __be32 data[2];
513};
514
515/**
516 * struct ethtool_rx_flow_spec - classification rule for RX flows
517 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
518 * @h_u: Flow fields to match (dependent on @flow_type)
519 * @h_ext: Additional fields to match
520 * @m_u: Masks for flow field bits to be matched
521 * @m_ext: Masks for additional field bits to be matched
522 * Note, all additional fields must be ignored unless @flow_type
523 * includes the %FLOW_EXT flag.
524 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
525 * if packets should be discarded
526 * @location: Location of rule in the table. Locations must be
527 * numbered such that a flow matching multiple rules will be
528 * classified according to the first (lowest numbered) rule.
529 */
530struct ethtool_rx_flow_spec {
531 __u32 flow_type;
532 union ethtool_flow_union h_u;
533 struct ethtool_flow_ext h_ext;
534 union ethtool_flow_union m_u;
535 struct ethtool_flow_ext m_ext;
536 __u64 ring_cookie;
537 __u32 location;
538};
539
540/**
541 * struct ethtool_rxnfc - command to get or set RX flow classification rules
542 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
543 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
544 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
545 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
546 * @data: Command-dependent value
547 * @fs: Flow classification rule
548 * @rule_cnt: Number of rules to be affected
549 * @rule_locs: Array of used rule locations
550 *
551 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
552 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
553 * structure fields must not be used.
554 *
555 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
556 * on return.
557 *
558 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
559 * rules on return. If @data is non-zero on return then it is the
560 * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
561 * driver supports any special location values. If that flag is not
562 * set in @data then special location values should not be used.
563 *
564 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
565 * existing rule on entry and @fs contains the rule on return.
566 *
567 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
568 * user buffer for @rule_locs on entry. On return, @data is the size
569 * of the rule table, @rule_cnt is the number of defined rules, and
570 * @rule_locs contains the locations of the defined rules. Drivers
571 * must use the second parameter to get_rxnfc() instead of @rule_locs.
572 *
573 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
574 * @fs.@location either specifies the location to use or is a special
575 * location value with %RX_CLS_LOC_SPECIAL flag set. On return,
576 * @fs.@location is the actual rule location.
577 *
578 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
579 * existing rule on entry.
580 *
581 * A driver supporting the special location values for
582 * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
583 * location, and may remove a rule at a later location (lower
584 * priority) that matches exactly the same set of flows. The special
585 * values are: %RX_CLS_LOC_ANY, selecting any location;
586 * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
587 * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
588 * location (minimum priority). Additional special values may be
589 * defined in future and drivers must return -%EINVAL for any
590 * unrecognised value.
591 */
592struct ethtool_rxnfc {
593 __u32 cmd;
594 __u32 flow_type;
595 __u64 data;
596 struct ethtool_rx_flow_spec fs;
597 __u32 rule_cnt;
598 __u32 rule_locs[0];
599};
600
601#ifdef __KERNEL__
602#ifdef CONFIG_COMPAT 18#ifdef CONFIG_COMPAT
603 19
604struct compat_ethtool_rx_flow_spec { 20struct compat_ethtool_rx_flow_spec {
@@ -621,223 +37,6 @@ struct compat_ethtool_rxnfc {
621}; 37};
622 38
623#endif /* CONFIG_COMPAT */ 39#endif /* CONFIG_COMPAT */
624#endif /* __KERNEL__ */
625
626/**
627 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
628 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
629 * @size: On entry, the array size of the user buffer, which may be zero.
630 * On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
631 * indirection table.
632 * @ring_index: RX ring/queue index for each hash value
633 *
634 * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
635 * should be returned. For %ETHTOOL_SRXFHINDIR, a @size of zero means
636 * the table should be reset to default values. This last feature
637 * is not supported by the original implementations.
638 */
639struct ethtool_rxfh_indir {
640 __u32 cmd;
641 __u32 size;
642 __u32 ring_index[0];
643};
644
645/**
646 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
647 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
648 * @h_u: Flow field values to match (dependent on @flow_type)
649 * @m_u: Masks for flow field value bits to be ignored
650 * @vlan_tag: VLAN tag to match
651 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
652 * @data: Driver-dependent data to match
653 * @data_mask: Mask for driver-dependent data bits to be ignored
654 * @action: RX ring/queue index to deliver to (non-negative) or other action
655 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
656 *
657 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
658 * a field value and mask are both zero this is treated as if all mask
659 * bits are set i.e. the field is ignored.
660 */
661struct ethtool_rx_ntuple_flow_spec {
662 __u32 flow_type;
663 union {
664 struct ethtool_tcpip4_spec tcp_ip4_spec;
665 struct ethtool_tcpip4_spec udp_ip4_spec;
666 struct ethtool_tcpip4_spec sctp_ip4_spec;
667 struct ethtool_ah_espip4_spec ah_ip4_spec;
668 struct ethtool_ah_espip4_spec esp_ip4_spec;
669 struct ethtool_usrip4_spec usr_ip4_spec;
670 struct ethhdr ether_spec;
671 __u8 hdata[72];
672 } h_u, m_u;
673
674 __u16 vlan_tag;
675 __u16 vlan_tag_mask;
676 __u64 data;
677 __u64 data_mask;
678
679 __s32 action;
680#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
681#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
682};
683
684/**
685 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
686 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
687 * @fs: Flow filter specification
688 */
689struct ethtool_rx_ntuple {
690 __u32 cmd;
691 struct ethtool_rx_ntuple_flow_spec fs;
692};
693
694#define ETHTOOL_FLASH_MAX_FILENAME 128
695enum ethtool_flash_op_type {
696 ETHTOOL_FLASH_ALL_REGIONS = 0,
697};
698
699/* for passing firmware flashing related parameters */
700struct ethtool_flash {
701 __u32 cmd;
702 __u32 region;
703 char data[ETHTOOL_FLASH_MAX_FILENAME];
704};
705
706/**
707 * struct ethtool_dump - used for retrieving, setting device dump
708 * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
709 * %ETHTOOL_SET_DUMP
710 * @version: FW version of the dump, filled in by driver
711 * @flag: driver dependent flag for dump setting, filled in by driver during
712 * get and filled in by ethtool for set operation.
713 * flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
714 * firmware dump is disabled.
715 * @len: length of dump data, used as the length of the user buffer on entry to
716 * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
717 * for %ETHTOOL_GET_DUMP_FLAG command
718 * @data: data collected for get dump data operation
719 */
720
721#define ETH_FW_DUMP_DISABLE 0
722
723struct ethtool_dump {
724 __u32 cmd;
725 __u32 version;
726 __u32 flag;
727 __u32 len;
728 __u8 data[0];
729};
730
731/* for returning and changing feature sets */
732
733/**
734 * struct ethtool_get_features_block - block with state of 32 features
735 * @available: mask of changeable features
736 * @requested: mask of features requested to be enabled if possible
737 * @active: mask of currently enabled features
738 * @never_changed: mask of features not changeable for any device
739 */
740struct ethtool_get_features_block {
741 __u32 available;
742 __u32 requested;
743 __u32 active;
744 __u32 never_changed;
745};
746
747/**
748 * struct ethtool_gfeatures - command to get state of device's features
749 * @cmd: command number = %ETHTOOL_GFEATURES
750 * @size: in: number of elements in the features[] array;
751 * out: number of elements in features[] needed to hold all features
752 * @features: state of features
753 */
754struct ethtool_gfeatures {
755 __u32 cmd;
756 __u32 size;
757 struct ethtool_get_features_block features[0];
758};
759
760/**
761 * struct ethtool_set_features_block - block with request for 32 features
762 * @valid: mask of features to be changed
763 * @requested: values of features to be changed
764 */
765struct ethtool_set_features_block {
766 __u32 valid;
767 __u32 requested;
768};
769
770/**
771 * struct ethtool_sfeatures - command to request change in device's features
772 * @cmd: command number = %ETHTOOL_SFEATURES
773 * @size: array size of the features[] array
774 * @features: feature change masks
775 */
776struct ethtool_sfeatures {
777 __u32 cmd;
778 __u32 size;
779 struct ethtool_set_features_block features[0];
780};
781
782/**
783 * struct ethtool_ts_info - holds a device's timestamping and PHC association
784 * @cmd: command number = %ETHTOOL_GET_TS_INFO
785 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
786 * @phc_index: device index of the associated PHC, or -1 if there is none
787 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
788 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
789 *
790 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
791 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
792 * respectively. For example, if the device supports HWTSTAMP_TX_ON,
793 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
794 */
795struct ethtool_ts_info {
796 __u32 cmd;
797 __u32 so_timestamping;
798 __s32 phc_index;
799 __u32 tx_types;
800 __u32 tx_reserved[3];
801 __u32 rx_filters;
802 __u32 rx_reserved[3];
803};
804
805/*
806 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
807 * values of corresponding bits in features[].requested. Bits in .requested
808 * not set in .valid or not changeable are ignored.
809 *
810 * Returns %EINVAL when .valid contains undefined or never-changeable bits
811 * or size is not equal to required number of features words (32-bit blocks).
812 * Returns >= 0 if request was completed; bits set in the value mean:
813 * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
814 * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
815 * those bits were ignored.
816 * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
817 * resulting state of bits masked by .valid is not equal to .requested.
818 * Probably there are other device-specific constraints on some features
819 * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
820 * here as though ignored bits were cleared.
821 * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
822 * compatibility functions. Requested offload state cannot be properly
823 * managed by kernel.
824 *
825 * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
826 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
827 * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
828 * significant bit in features[0] fields. Empty strings mark undefined features.
829 */
830enum ethtool_sfeatures_retval_bits {
831 ETHTOOL_F_UNSUPPORTED__BIT,
832 ETHTOOL_F_WISH__BIT,
833 ETHTOOL_F_COMPAT__BIT,
834};
835
836#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
837#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
838#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
839
840#ifdef __KERNEL__
841 40
842#include <linux/rculist.h> 41#include <linux/rculist.h>
843 42
@@ -1049,277 +248,4 @@ struct ethtool_ops {
1049 248
1050 249
1051}; 250};
1052#endif /* __KERNEL__ */
1053
1054/* CMDs currently supported */
1055#define ETHTOOL_GSET 0x00000001 /* Get settings. */
1056#define ETHTOOL_SSET 0x00000002 /* Set settings. */
1057#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
1058#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
1059#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
1060#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
1061#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
1062#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
1063#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
1064/* Get link status for host, i.e. whether the interface *and* the
1065 * physical port (if there is one) are up (ethtool_value). */
1066#define ETHTOOL_GLINK 0x0000000a
1067#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
1068#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
1069#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
1070#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
1071#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
1072#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
1073#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
1074#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
1075#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
1076#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
1077#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
1078#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
1079#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
1080 * (ethtool_value) */
1081#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
1082 * (ethtool_value). */
1083#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
1084#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
1085#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
1086#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
1087#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
1088#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
1089#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
1090#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
1091#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
1092#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
1093#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
1094#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
1095#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
1096#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
1097#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
1098
1099#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
1100#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
1101#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
1102#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
1103#define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
1104#define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
1105#define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
1106#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
1107#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
1108#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
1109#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
1110#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
1111#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1112#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
1113#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
1114#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
1115#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
1116
1117#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
1118#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
1119#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
1120#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
1121#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
1122#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
1123#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
1124#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
1125#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
1126#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
1127#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
1128#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
1129
1130/* compatibility with older code */
1131#define SPARC_ETH_GSET ETHTOOL_GSET
1132#define SPARC_ETH_SSET ETHTOOL_SSET
1133
1134/* Indicates what features are supported by the interface. */
1135#define SUPPORTED_10baseT_Half (1 << 0)
1136#define SUPPORTED_10baseT_Full (1 << 1)
1137#define SUPPORTED_100baseT_Half (1 << 2)
1138#define SUPPORTED_100baseT_Full (1 << 3)
1139#define SUPPORTED_1000baseT_Half (1 << 4)
1140#define SUPPORTED_1000baseT_Full (1 << 5)
1141#define SUPPORTED_Autoneg (1 << 6)
1142#define SUPPORTED_TP (1 << 7)
1143#define SUPPORTED_AUI (1 << 8)
1144#define SUPPORTED_MII (1 << 9)
1145#define SUPPORTED_FIBRE (1 << 10)
1146#define SUPPORTED_BNC (1 << 11)
1147#define SUPPORTED_10000baseT_Full (1 << 12)
1148#define SUPPORTED_Pause (1 << 13)
1149#define SUPPORTED_Asym_Pause (1 << 14)
1150#define SUPPORTED_2500baseX_Full (1 << 15)
1151#define SUPPORTED_Backplane (1 << 16)
1152#define SUPPORTED_1000baseKX_Full (1 << 17)
1153#define SUPPORTED_10000baseKX4_Full (1 << 18)
1154#define SUPPORTED_10000baseKR_Full (1 << 19)
1155#define SUPPORTED_10000baseR_FEC (1 << 20)
1156#define SUPPORTED_20000baseMLD2_Full (1 << 21)
1157#define SUPPORTED_20000baseKR2_Full (1 << 22)
1158#define SUPPORTED_40000baseKR4_Full (1 << 23)
1159#define SUPPORTED_40000baseCR4_Full (1 << 24)
1160#define SUPPORTED_40000baseSR4_Full (1 << 25)
1161#define SUPPORTED_40000baseLR4_Full (1 << 26)
1162
1163/* Indicates what features are advertised by the interface. */
1164#define ADVERTISED_10baseT_Half (1 << 0)
1165#define ADVERTISED_10baseT_Full (1 << 1)
1166#define ADVERTISED_100baseT_Half (1 << 2)
1167#define ADVERTISED_100baseT_Full (1 << 3)
1168#define ADVERTISED_1000baseT_Half (1 << 4)
1169#define ADVERTISED_1000baseT_Full (1 << 5)
1170#define ADVERTISED_Autoneg (1 << 6)
1171#define ADVERTISED_TP (1 << 7)
1172#define ADVERTISED_AUI (1 << 8)
1173#define ADVERTISED_MII (1 << 9)
1174#define ADVERTISED_FIBRE (1 << 10)
1175#define ADVERTISED_BNC (1 << 11)
1176#define ADVERTISED_10000baseT_Full (1 << 12)
1177#define ADVERTISED_Pause (1 << 13)
1178#define ADVERTISED_Asym_Pause (1 << 14)
1179#define ADVERTISED_2500baseX_Full (1 << 15)
1180#define ADVERTISED_Backplane (1 << 16)
1181#define ADVERTISED_1000baseKX_Full (1 << 17)
1182#define ADVERTISED_10000baseKX4_Full (1 << 18)
1183#define ADVERTISED_10000baseKR_Full (1 << 19)
1184#define ADVERTISED_10000baseR_FEC (1 << 20)
1185#define ADVERTISED_20000baseMLD2_Full (1 << 21)
1186#define ADVERTISED_20000baseKR2_Full (1 << 22)
1187#define ADVERTISED_40000baseKR4_Full (1 << 23)
1188#define ADVERTISED_40000baseCR4_Full (1 << 24)
1189#define ADVERTISED_40000baseSR4_Full (1 << 25)
1190#define ADVERTISED_40000baseLR4_Full (1 << 26)
1191
1192/* The following are all involved in forcing a particular link
1193 * mode for the device for setting things. When getting the
1194 * devices settings, these indicate the current mode and whether
1195 * it was forced up into this mode or autonegotiated.
1196 */
1197
1198/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
1199#define SPEED_10 10
1200#define SPEED_100 100
1201#define SPEED_1000 1000
1202#define SPEED_2500 2500
1203#define SPEED_10000 10000
1204#define SPEED_UNKNOWN -1
1205
1206/* Duplex, half or full. */
1207#define DUPLEX_HALF 0x00
1208#define DUPLEX_FULL 0x01
1209#define DUPLEX_UNKNOWN 0xff
1210
1211/* Which connector port. */
1212#define PORT_TP 0x00
1213#define PORT_AUI 0x01
1214#define PORT_MII 0x02
1215#define PORT_FIBRE 0x03
1216#define PORT_BNC 0x04
1217#define PORT_DA 0x05
1218#define PORT_NONE 0xef
1219#define PORT_OTHER 0xff
1220
1221/* Which transceiver to use. */
1222#define XCVR_INTERNAL 0x00
1223#define XCVR_EXTERNAL 0x01
1224#define XCVR_DUMMY1 0x02
1225#define XCVR_DUMMY2 0x03
1226#define XCVR_DUMMY3 0x04
1227
1228/* Enable or disable autonegotiation. If this is set to enable,
1229 * the forced link modes above are completely ignored.
1230 */
1231#define AUTONEG_DISABLE 0x00
1232#define AUTONEG_ENABLE 0x01
1233
1234/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
1235 * the driver is required to renegotiate link
1236 */
1237#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
1238#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
1239#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
1240#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
1241
1242/* Wake-On-Lan options. */
1243#define WAKE_PHY (1 << 0)
1244#define WAKE_UCAST (1 << 1)
1245#define WAKE_MCAST (1 << 2)
1246#define WAKE_BCAST (1 << 3)
1247#define WAKE_ARP (1 << 4)
1248#define WAKE_MAGIC (1 << 5)
1249#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1250
1251/* L2-L4 network traffic flow types */
1252#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
1253#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
1254#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
1255#define AH_ESP_V4_FLOW 0x04 /* hash only */
1256#define TCP_V6_FLOW 0x05 /* hash only */
1257#define UDP_V6_FLOW 0x06 /* hash only */
1258#define SCTP_V6_FLOW 0x07 /* hash only */
1259#define AH_ESP_V6_FLOW 0x08 /* hash only */
1260#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
1261#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
1262#define AH_V6_FLOW 0x0b /* hash only */
1263#define ESP_V6_FLOW 0x0c /* hash only */
1264#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1265#define IPV4_FLOW 0x10 /* hash only */
1266#define IPV6_FLOW 0x11 /* hash only */
1267#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1268/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1269#define FLOW_EXT 0x80000000
1270
1271/* L3-L4 network traffic flow hash options */
1272#define RXH_L2DA (1 << 1)
1273#define RXH_VLAN (1 << 2)
1274#define RXH_L3_PROTO (1 << 3)
1275#define RXH_IP_SRC (1 << 4)
1276#define RXH_IP_DST (1 << 5)
1277#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
1278#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
1279#define RXH_DISCARD (1 << 31)
1280
1281#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
1282
1283/* Special RX classification rule insert location values */
1284#define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */
1285#define RX_CLS_LOC_ANY 0xffffffff
1286#define RX_CLS_LOC_FIRST 0xfffffffe
1287#define RX_CLS_LOC_LAST 0xfffffffd
1288
1289/* EEPROM Standards for plug in modules */
1290#define ETH_MODULE_SFF_8079 0x1
1291#define ETH_MODULE_SFF_8079_LEN 256
1292#define ETH_MODULE_SFF_8472 0x2
1293#define ETH_MODULE_SFF_8472_LEN 512
1294
1295/* Reset flags */
1296/* The reset() operation must clear the flags for the components which
1297 * were actually reset. On successful return, the flags indicate the
1298 * components which were not reset, either because they do not exist
1299 * in the hardware or because they cannot be reset independently. The
1300 * driver must never reset any components that were not requested.
1301 */
1302enum ethtool_reset_flags {
1303 /* These flags represent components dedicated to the interface
1304 * the command is addressed to. Shift any flag left by
1305 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
1306 * same type.
1307 */
1308 ETH_RESET_MGMT = 1 << 0, /* Management processor */
1309 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
1310 ETH_RESET_DMA = 1 << 2, /* DMA engine */
1311 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
1312 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
1313 ETH_RESET_MAC = 1 << 5, /* Media access controller */
1314 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
1315 ETH_RESET_RAM = 1 << 7, /* RAM shared between
1316 * multiple components */
1317
1318 ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
1319 * this interface */
1320 ETH_RESET_ALL = 0xffffffff, /* All components used by this
1321 * interface, even if shared */
1322};
1323#define ETH_RESET_SHARED_SHIFT 16
1324
1325#endif /* _LINUX_ETHTOOL_H */ 251#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 41085d0f395..6daf6d4971f 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -10,59 +10,11 @@
10 * Davide Libenzi <davidel@xmailserver.org> 10 * Davide Libenzi <davidel@xmailserver.org>
11 * 11 *
12 */ 12 */
13
14#ifndef _LINUX_EVENTPOLL_H 13#ifndef _LINUX_EVENTPOLL_H
15#define _LINUX_EVENTPOLL_H 14#define _LINUX_EVENTPOLL_H
16 15
17/* For O_CLOEXEC */ 16#include <uapi/linux/eventpoll.h>
18#include <linux/fcntl.h>
19#include <linux/types.h>
20
21/* Flags for epoll_create1. */
22#define EPOLL_CLOEXEC O_CLOEXEC
23
24/* Valid opcodes to issue to sys_epoll_ctl() */
25#define EPOLL_CTL_ADD 1
26#define EPOLL_CTL_DEL 2
27#define EPOLL_CTL_MOD 3
28#define EPOLL_CTL_DISABLE 4
29
30/*
31 * Request the handling of system wakeup events so as to prevent system suspends
32 * from happening while those events are being processed.
33 *
34 * Assuming neither EPOLLET nor EPOLLONESHOT is set, system suspends will not be
35 * re-allowed until epoll_wait is called again after consuming the wakeup
36 * event(s).
37 *
38 * Requires CAP_BLOCK_SUSPEND
39 */
40#define EPOLLWAKEUP (1 << 29)
41
42/* Set the One Shot behaviour for the target file descriptor */
43#define EPOLLONESHOT (1 << 30)
44 17
45/* Set the Edge Triggered behaviour for the target file descriptor */
46#define EPOLLET (1 << 31)
47
48/*
49 * On x86-64 make the 64bit structure have the same alignment as the
50 * 32bit structure. This makes 32bit emulation easier.
51 *
52 * UML/x86_64 needs the same packing as x86_64
53 */
54#ifdef __x86_64__
55#define EPOLL_PACKED __attribute__((packed))
56#else
57#define EPOLL_PACKED
58#endif
59
60struct epoll_event {
61 __u32 events;
62 __u64 data;
63} EPOLL_PACKED;
64
65#ifdef __KERNEL__
66 18
67/* Forward declarations to avoid compiler errors */ 19/* Forward declarations to avoid compiler errors */
68struct file; 20struct file;
@@ -116,7 +68,4 @@ static inline void eventpoll_release(struct file *file) {}
116 68
117#endif 69#endif
118 70
119#endif /* #ifdef __KERNEL__ */
120
121#endif /* #ifndef _LINUX_EVENTPOLL_H */ 71#endif /* #ifndef _LINUX_EVENTPOLL_H */
122
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
index d39b824a780..31591686ac2 100644
--- a/include/linux/falloc.h
+++ b/include/linux/falloc.h
@@ -1,11 +1,8 @@
1#ifndef _FALLOC_H_ 1#ifndef _FALLOC_H_
2#define _FALLOC_H_ 2#define _FALLOC_H_
3 3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ 4#include <uapi/linux/falloc.h>
5#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
6#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
7 5
8#ifdef __KERNEL__
9 6
10/* 7/*
11 * Space reservation ioctls and argument structure 8 * Space reservation ioctls and argument structure
@@ -24,6 +21,4 @@ struct space_resv {
24#define FS_IOC_RESVSP _IOW('X', 40, struct space_resv) 21#define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
25#define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv) 22#define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
26 23
27#endif /* __KERNEL__ */
28
29#endif /* _FALLOC_H_ */ 24#endif /* _FALLOC_H_ */
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 6c6133f76e1..cef93ddcc5a 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -1,120 +1,8 @@
1#ifndef _LINUX_FANOTIFY_H 1#ifndef _LINUX_FANOTIFY_H
2#define _LINUX_FANOTIFY_H 2#define _LINUX_FANOTIFY_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/fanotify.h>
5 5
6/* the following events that user-space can register for */
7#define FAN_ACCESS 0x00000001 /* File was accessed */
8#define FAN_MODIFY 0x00000002 /* File was modified */
9#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
10#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
11#define FAN_OPEN 0x00000020 /* File was opened */
12
13#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
14
15#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
16#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
17
18#define FAN_ONDIR 0x40000000 /* event occurred against dir */
19
20#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
21
22/* helper events */
23#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
24
25/* flags used for fanotify_init() */
26#define FAN_CLOEXEC 0x00000001
27#define FAN_NONBLOCK 0x00000002
28
29/* These are NOT bitwise flags. Both bits are used togther. */
30#define FAN_CLASS_NOTIF 0x00000000
31#define FAN_CLASS_CONTENT 0x00000004
32#define FAN_CLASS_PRE_CONTENT 0x00000008
33#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
34 FAN_CLASS_PRE_CONTENT)
35
36#define FAN_UNLIMITED_QUEUE 0x00000010
37#define FAN_UNLIMITED_MARKS 0x00000020
38
39#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
40 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
41 FAN_UNLIMITED_MARKS)
42
43/* flags used for fanotify_modify_mark() */
44#define FAN_MARK_ADD 0x00000001
45#define FAN_MARK_REMOVE 0x00000002
46#define FAN_MARK_DONT_FOLLOW 0x00000004
47#define FAN_MARK_ONLYDIR 0x00000008
48#define FAN_MARK_MOUNT 0x00000010
49#define FAN_MARK_IGNORED_MASK 0x00000020
50#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
51#define FAN_MARK_FLUSH 0x00000080
52#ifdef __KERNEL__
53/* not valid from userspace, only kernel internal */ 6/* not valid from userspace, only kernel internal */
54#define FAN_MARK_ONDIR 0x00000100 7#define FAN_MARK_ONDIR 0x00000100
55#endif
56
57#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
58 FAN_MARK_REMOVE |\
59 FAN_MARK_DONT_FOLLOW |\
60 FAN_MARK_ONLYDIR |\
61 FAN_MARK_MOUNT |\
62 FAN_MARK_IGNORED_MASK |\
63 FAN_MARK_IGNORED_SURV_MODIFY |\
64 FAN_MARK_FLUSH)
65
66/*
67 * All of the events - we build the list by hand so that we can add flags in
68 * the future and not break backward compatibility. Apps will get only the
69 * events that they originally wanted. Be sure to add new events here!
70 */
71#define FAN_ALL_EVENTS (FAN_ACCESS |\
72 FAN_MODIFY |\
73 FAN_CLOSE |\
74 FAN_OPEN)
75
76/*
77 * All events which require a permission response from userspace
78 */
79#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
80 FAN_ACCESS_PERM)
81
82#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
83 FAN_ALL_PERM_EVENTS |\
84 FAN_Q_OVERFLOW)
85
86#define FANOTIFY_METADATA_VERSION 3
87
88struct fanotify_event_metadata {
89 __u32 event_len;
90 __u8 vers;
91 __u8 reserved;
92 __u16 metadata_len;
93 __aligned_u64 mask;
94 __s32 fd;
95 __s32 pid;
96};
97
98struct fanotify_response {
99 __s32 fd;
100 __u32 response;
101};
102
103/* Legit userspace responses to a _PERM event */
104#define FAN_ALLOW 0x01
105#define FAN_DENY 0x02
106/* No fd set in event */
107#define FAN_NOFD -1
108
109/* Helper functions to deal with fanotify_event_metadata buffers */
110#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
111
112#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
113 (struct fanotify_event_metadata*)(((char *)(meta)) + \
114 (meta)->event_len))
115
116#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
117 (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
118 (long)(meta)->event_len <= (long)(len))
119
120#endif /* _LINUX_FANOTIFY_H */ 8#endif /* _LINUX_FANOTIFY_H */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index ac3f1c60584..c7a95714b1f 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1,409 +1,10 @@
1#ifndef _LINUX_FB_H 1#ifndef _LINUX_FB_H
2#define _LINUX_FB_H 2#define _LINUX_FB_H
3 3
4#include <linux/types.h>
5#include <linux/i2c.h>
6#ifdef __KERNEL__
7#include <linux/kgdb.h> 4#include <linux/kgdb.h>
8#endif /* __KERNEL__ */ 5#include <uapi/linux/fb.h>
9 6
10/* Definitions of frame buffers */
11
12#define FB_MAX 32 /* sufficient for now */
13
14/* ioctls
15 0x46 is 'F' */
16#define FBIOGET_VSCREENINFO 0x4600
17#define FBIOPUT_VSCREENINFO 0x4601
18#define FBIOGET_FSCREENINFO 0x4602
19#define FBIOGETCMAP 0x4604
20#define FBIOPUTCMAP 0x4605
21#define FBIOPAN_DISPLAY 0x4606
22#ifdef __KERNEL__
23#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user) 7#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user)
24#else
25#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
26#endif
27/* 0x4607-0x460B are defined below */
28/* #define FBIOGET_MONITORSPEC 0x460C */
29/* #define FBIOPUT_MONITORSPEC 0x460D */
30/* #define FBIOSWITCH_MONIBIT 0x460E */
31#define FBIOGET_CON2FBMAP 0x460F
32#define FBIOPUT_CON2FBMAP 0x4610
33#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
34#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
35#define FBIO_ALLOC 0x4613
36#define FBIO_FREE 0x4614
37#define FBIOGET_GLYPH 0x4615
38#define FBIOGET_HWCINFO 0x4616
39#define FBIOPUT_MODEINFO 0x4617
40#define FBIOGET_DISPINFO 0x4618
41#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
42
43#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
44#define FB_TYPE_PLANES 1 /* Non interleaved planes */
45#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
46#define FB_TYPE_TEXT 3 /* Text/attributes */
47#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
48#define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */
49
50#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
51#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
52#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
53#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
54#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
55#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
56#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
57#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
58#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
59#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
60#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
61#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
62
63#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
64#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
65#define FB_AUX_VGA_PLANES_CFB8 2 /* CFB8 in planes (VGA) */
66
67#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
68#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
69#define FB_VISUAL_TRUECOLOR 2 /* True color */
70#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
71#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
72#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
73#define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */
74
75#define FB_ACCEL_NONE 0 /* no hardware accelerator */
76#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
77#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
78#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
79#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
80#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
81#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
82#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
83#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
84#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
85#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
86#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
87#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
88#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
89#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
90#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
91#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
92#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
93#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
94#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
95#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
96#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
97#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
98#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
99#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
100#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
101#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
102#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
103#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
104#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
105#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
106#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
107#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
108#define FB_ACCEL_IGS_CYBER2000 33 /* CyberPro 2000 */
109#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
110#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
111#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
112#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
113#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
114#define FB_ACCEL_I810 39 /* Intel 810/815 */
115#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
116#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
117#define FB_ACCEL_I830 42 /* Intel 830M/845G/85x/865G */
118#define FB_ACCEL_NV_10 43 /* nVidia Arch 10 */
119#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
120#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
121#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
122#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
123#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
124#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
125#define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */
126#define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */
127#define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */
128#define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */
129#define FB_ACCEL_CIRRUS_ALPINE 53 /* Cirrus Logic 543x/544x/5480 */
130#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
131#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
132#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
133#define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097 */
134#define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160 */
135#define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200 */
136#define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */
137#define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
138#define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
139#define FB_ACCEL_PXA3XX 99 /* PXA3xx */
140
141#define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
142#define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
143#define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 Savage3D-MV */
144#define FB_ACCEL_SAVAGE2000 0x83 /* S3 Savage2000 */
145#define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 Savage/MX-MV */
146#define FB_ACCEL_SAVAGE_MX 0x85 /* S3 Savage/MX */
147#define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 Savage/IX-MV */
148#define FB_ACCEL_SAVAGE_IX 0x87 /* S3 Savage/IX */
149#define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 ProSavage PM133 */
150#define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 ProSavage KM133 */
151#define FB_ACCEL_S3TWISTER_P 0x8a /* S3 Twister */
152#define FB_ACCEL_S3TWISTER_K 0x8b /* S3 TwisterK */
153#define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 Supersavage */
154#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
155#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
156
157#define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */
158
159#define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */
160
161struct fb_fix_screeninfo {
162 char id[16]; /* identification string eg "TT Builtin" */
163 unsigned long smem_start; /* Start of frame buffer mem */
164 /* (physical address) */
165 __u32 smem_len; /* Length of frame buffer mem */
166 __u32 type; /* see FB_TYPE_* */
167 __u32 type_aux; /* Interleave for interleaved Planes */
168 __u32 visual; /* see FB_VISUAL_* */
169 __u16 xpanstep; /* zero if no hardware panning */
170 __u16 ypanstep; /* zero if no hardware panning */
171 __u16 ywrapstep; /* zero if no hardware ywrap */
172 __u32 line_length; /* length of a line in bytes */
173 unsigned long mmio_start; /* Start of Memory Mapped I/O */
174 /* (physical address) */
175 __u32 mmio_len; /* Length of Memory Mapped I/O */
176 __u32 accel; /* Indicate to driver which */
177 /* specific chip/card we have */
178 __u16 capabilities; /* see FB_CAP_* */
179 __u16 reserved[2]; /* Reserved for future compatibility */
180};
181
182/* Interpretation of offset for color fields: All offsets are from the right,
183 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
184 * can use the offset as right argument to <<). A pixel afterwards is a bit
185 * stream and is written to video memory as that unmodified.
186 *
187 * For pseudocolor: offset and length should be the same for all color
188 * components. Offset specifies the position of the least significant bit
189 * of the pallette index in a pixel value. Length indicates the number
190 * of available palette entries (i.e. # of entries = 1 << length).
191 */
192struct fb_bitfield {
193 __u32 offset; /* beginning of bitfield */
194 __u32 length; /* length of bitfield */
195 __u32 msb_right; /* != 0 : Most significant bit is */
196 /* right */
197};
198
199#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
200#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
201
202#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
203#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
204#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
205#define FB_ACTIVATE_MASK 15
206 /* values */
207#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
208#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
209#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
210#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
211#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
212
213#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
214
215#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
216#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
217#define FB_SYNC_EXT 4 /* external sync */
218#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
219#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
220 /* vtotal = 144d/288n/576i => PAL */
221 /* vtotal = 121d/242n/484i => NTSC */
222#define FB_SYNC_ON_GREEN 32 /* sync on green */
223
224#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
225#define FB_VMODE_INTERLACED 1 /* interlaced */
226#define FB_VMODE_DOUBLE 2 /* double scan */
227#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
228#define FB_VMODE_MASK 255
229
230#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
231#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
232#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
233
234/*
235 * Display rotation support
236 */
237#define FB_ROTATE_UR 0
238#define FB_ROTATE_CW 1
239#define FB_ROTATE_UD 2
240#define FB_ROTATE_CCW 3
241
242#define PICOS2KHZ(a) (1000000000UL/(a))
243#define KHZ2PICOS(a) (1000000000UL/(a))
244
245struct fb_var_screeninfo {
246 __u32 xres; /* visible resolution */
247 __u32 yres;
248 __u32 xres_virtual; /* virtual resolution */
249 __u32 yres_virtual;
250 __u32 xoffset; /* offset from virtual to visible */
251 __u32 yoffset; /* resolution */
252
253 __u32 bits_per_pixel; /* guess what */
254 __u32 grayscale; /* 0 = color, 1 = grayscale, */
255 /* >1 = FOURCC */
256 struct fb_bitfield red; /* bitfield in fb mem if true color, */
257 struct fb_bitfield green; /* else only length is significant */
258 struct fb_bitfield blue;
259 struct fb_bitfield transp; /* transparency */
260
261 __u32 nonstd; /* != 0 Non standard pixel format */
262
263 __u32 activate; /* see FB_ACTIVATE_* */
264
265 __u32 height; /* height of picture in mm */
266 __u32 width; /* width of picture in mm */
267
268 __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
269
270 /* Timing: All values in pixclocks, except pixclock (of course) */
271 __u32 pixclock; /* pixel clock in ps (pico seconds) */
272 __u32 left_margin; /* time from sync to picture */
273 __u32 right_margin; /* time from picture to sync */
274 __u32 upper_margin; /* time from sync to picture */
275 __u32 lower_margin;
276 __u32 hsync_len; /* length of horizontal sync */
277 __u32 vsync_len; /* length of vertical sync */
278 __u32 sync; /* see FB_SYNC_* */
279 __u32 vmode; /* see FB_VMODE_* */
280 __u32 rotate; /* angle we rotate counter clockwise */
281 __u32 colorspace; /* colorspace for FOURCC-based modes */
282 __u32 reserved[4]; /* Reserved for future compatibility */
283};
284
285struct fb_cmap {
286 __u32 start; /* First entry */
287 __u32 len; /* Number of entries */
288 __u16 *red; /* Red values */
289 __u16 *green;
290 __u16 *blue;
291 __u16 *transp; /* transparency, can be NULL */
292};
293
294struct fb_con2fbmap {
295 __u32 console;
296 __u32 framebuffer;
297};
298
299/* VESA Blanking Levels */
300#define VESA_NO_BLANKING 0
301#define VESA_VSYNC_SUSPEND 1
302#define VESA_HSYNC_SUSPEND 2
303#define VESA_POWERDOWN 3
304
305
306enum {
307 /* screen: unblanked, hsync: on, vsync: on */
308 FB_BLANK_UNBLANK = VESA_NO_BLANKING,
309
310 /* screen: blanked, hsync: on, vsync: on */
311 FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
312
313 /* screen: blanked, hsync: on, vsync: off */
314 FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
315
316 /* screen: blanked, hsync: off, vsync: on */
317 FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
318
319 /* screen: blanked, hsync: off, vsync: off */
320 FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
321};
322
323#define FB_VBLANK_VBLANKING 0x001 /* currently in a vertical blank */
324#define FB_VBLANK_HBLANKING 0x002 /* currently in a horizontal blank */
325#define FB_VBLANK_HAVE_VBLANK 0x004 /* vertical blanks can be detected */
326#define FB_VBLANK_HAVE_HBLANK 0x008 /* horizontal blanks can be detected */
327#define FB_VBLANK_HAVE_COUNT 0x010 /* global retrace counter is available */
328#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
329#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
330#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
331#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
332
333struct fb_vblank {
334 __u32 flags; /* FB_VBLANK flags */
335 __u32 count; /* counter of retraces since boot */
336 __u32 vcount; /* current scanline position */
337 __u32 hcount; /* current scandot position */
338 __u32 reserved[4]; /* reserved for future compatibility */
339};
340
341/* Internal HW accel */
342#define ROP_COPY 0
343#define ROP_XOR 1
344
345struct fb_copyarea {
346 __u32 dx;
347 __u32 dy;
348 __u32 width;
349 __u32 height;
350 __u32 sx;
351 __u32 sy;
352};
353
354struct fb_fillrect {
355 __u32 dx; /* screen-relative */
356 __u32 dy;
357 __u32 width;
358 __u32 height;
359 __u32 color;
360 __u32 rop;
361};
362
363struct fb_image {
364 __u32 dx; /* Where to place image */
365 __u32 dy;
366 __u32 width; /* Size of image */
367 __u32 height;
368 __u32 fg_color; /* Only used when a mono bitmap */
369 __u32 bg_color;
370 __u8 depth; /* Depth of the image */
371 const char *data; /* Pointer to image data */
372 struct fb_cmap cmap; /* color map info */
373};
374
375/*
376 * hardware cursor control
377 */
378
379#define FB_CUR_SETIMAGE 0x01
380#define FB_CUR_SETPOS 0x02
381#define FB_CUR_SETHOT 0x04
382#define FB_CUR_SETCMAP 0x08
383#define FB_CUR_SETSHAPE 0x10
384#define FB_CUR_SETSIZE 0x20
385#define FB_CUR_SETALL 0xFF
386
387struct fbcurpos {
388 __u16 x, y;
389};
390
391struct fb_cursor {
392 __u16 set; /* what to set */
393 __u16 enable; /* cursor on/off */
394 __u16 rop; /* bitop operation */
395 const char *mask; /* cursor mask bits */
396 struct fbcurpos hot; /* cursor hot spot */
397 struct fb_image image; /* Cursor image */
398};
399
400#ifdef CONFIG_FB_BACKLIGHT
401/* Settings for the generic backlight code */
402#define FB_BACKLIGHT_LEVELS 128
403#define FB_BACKLIGHT_MAX 0xFF
404#endif
405
406#ifdef __KERNEL__
407 8
408#include <linux/fs.h> 9#include <linux/fs.h>
409#include <linux/init.h> 10#include <linux/init.h>
@@ -1181,6 +782,4 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
1181 const struct fb_videomode *default_mode, 782 const struct fb_videomode *default_mode,
1182 unsigned int default_bpp); 783 unsigned int default_bpp);
1183 784
1184#endif /* __KERNEL__ */
1185
1186#endif /* _LINUX_FB_H */ 785#endif /* _LINUX_FB_H */
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index f550f894ba1..76ce329e656 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -1,54 +1,8 @@
1#ifndef _LINUX_FCNTL_H 1#ifndef _LINUX_FCNTL_H
2#define _LINUX_FCNTL_H 2#define _LINUX_FCNTL_H
3 3
4#include <asm/fcntl.h> 4#include <uapi/linux/fcntl.h>
5 5
6#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
7#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
8
9/*
10 * Cancel a blocking posix lock; internal use only until we expose an
11 * asynchronous lock api to userspace:
12 */
13#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
14
15/* Create a file descriptor with FD_CLOEXEC set. */
16#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
17
18/*
19 * Request nofications on a directory.
20 * See below for events that may be notified.
21 */
22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
23
24/*
25 * Set and get of pipe page size array
26 */
27#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
29
30/*
31 * Types of directory notifications that may be requested.
32 */
33#define DN_ACCESS 0x00000001 /* File accessed */
34#define DN_MODIFY 0x00000002 /* File modified */
35#define DN_CREATE 0x00000004 /* File created */
36#define DN_DELETE 0x00000008 /* File removed */
37#define DN_RENAME 0x00000010 /* File renamed */
38#define DN_ATTRIB 0x00000020 /* File changed attibutes */
39#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
40
41#define AT_FDCWD -100 /* Special value used to indicate
42 openat should use the current
43 working directory. */
44#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
45#define AT_REMOVEDIR 0x200 /* Remove directory instead of
46 unlinking file. */
47#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
48#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
49#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
50
51#ifdef __KERNEL__
52 6
53#ifndef force_o_largefile 7#ifndef force_o_largefile
54#define force_o_largefile() (BITS_PER_LONG != 32) 8#define force_o_largefile() (BITS_PER_LONG != 32)
@@ -74,6 +28,4 @@
74#define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd)) 28#define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd))
75#define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd)) 29#define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd))
76 30
77#endif /* __KERNEL__ */
78
79#endif 31#endif
diff --git a/include/linux/fd.h b/include/linux/fd.h
index 72202b1b9a6..69275bccc3e 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -1,384 +1,8 @@
1#ifndef _LINUX_FD_H 1#ifndef _LINUX_FD_H
2#define _LINUX_FD_H 2#define _LINUX_FD_H
3 3
4#include <linux/ioctl.h> 4#include <uapi/linux/fd.h>
5#include <linux/compiler.h>
6 5
7/* New file layout: Now the ioctl definitions immediately follow the
8 * definitions of the structures that they use */
9
10/*
11 * Geometry
12 */
13struct floppy_struct {
14 unsigned int size, /* nr of sectors total */
15 sect, /* sectors per track */
16 head, /* nr of heads */
17 track, /* nr of tracks */
18 stretch; /* bit 0 !=0 means double track steps */
19 /* bit 1 != 0 means swap sides */
20 /* bits 2..9 give the first sector */
21 /* number (the LSB is flipped) */
22#define FD_STRETCH 1
23#define FD_SWAPSIDES 2
24#define FD_ZEROBASED 4
25#define FD_SECTBASEMASK 0x3FC
26#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
27#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
28
29 unsigned char gap, /* gap1 size */
30
31 rate, /* data rate. |= 0x40 for perpendicular */
32#define FD_2M 0x4
33#define FD_SIZECODEMASK 0x38
34#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
35#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
36 512 : 128 << FD_SIZECODE(floppy) )
37#define FD_PERP 0x40
38
39 spec1, /* stepping rate, head unload time */
40 fmt_gap; /* gap2 size */
41 const char * name; /* used only for predefined formats */
42};
43
44
45/* commands needing write access have 0x40 set */
46/* commands needing super user access have 0x80 set */
47
48#define FDCLRPRM _IO(2, 0x41)
49/* clear user-defined parameters */
50
51#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
52#define FDSETMEDIAPRM FDSETPRM
53/* set user-defined parameters for current media */
54
55#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
56#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
57#define FDDEFMEDIAPRM FDDEFPRM
58#define FDGETMEDIAPRM FDGETPRM
59/* set/get disk parameters */
60
61
62#define FDMSGON _IO(2,0x45)
63#define FDMSGOFF _IO(2,0x46)
64/* issue/don't issue kernel messages on media type change */
65
66
67/*
68 * Formatting (obsolete)
69 */
70#define FD_FILL_BYTE 0xF6 /* format fill byte. */
71
72struct format_descr {
73 unsigned int device,head,track;
74};
75
76#define FDFMTBEG _IO(2,0x47)
77/* begin formatting a disk */
78#define FDFMTTRK _IOW(2,0x48, struct format_descr)
79/* format the specified track */
80#define FDFMTEND _IO(2,0x49)
81/* end formatting a disk */
82
83
84/*
85 * Error thresholds
86 */
87struct floppy_max_errors {
88 unsigned int
89 abort, /* number of errors to be reached before aborting */
90 read_track, /* maximal number of errors permitted to read an
91 * entire track at once */
92 reset, /* maximal number of errors before a reset is tried */
93 recal, /* maximal number of errors before a recalibrate is
94 * tried */
95
96 /*
97 * Threshold for reporting FDC errors to the console.
98 * Setting this to zero may flood your screen when using
99 * ultra cheap floppies ;-)
100 */
101 reporting;
102
103};
104
105#define FDSETEMSGTRESH _IO(2,0x4a)
106/* set fdc error reporting threshold */
107
108#define FDFLUSH _IO(2,0x4b)
109/* flush buffers for media; either for verifying media, or for
110 * handling a media change without closing the file descriptor */
111
112#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
113#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
114/* set/get abortion and read_track threshold. See also floppy_drive_params
115 * structure */
116
117
118typedef char floppy_drive_name[16];
119#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
120/* get drive type: 5 1/4 or 3 1/2 */
121
122
123/*
124 * Drive parameters (user modifiable)
125 */
126struct floppy_drive_params {
127 signed char cmos; /* CMOS type */
128
129 /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
130 * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
131 */
132 unsigned long max_dtr; /* Step rate, usec */
133 unsigned long hlt; /* Head load/settle time, msec */
134 unsigned long hut; /* Head unload time (remnant of
135 * 8" drives) */
136 unsigned long srt; /* Step rate, usec */
137
138 unsigned long spinup; /* time needed for spinup (expressed
139 * in jiffies) */
140 unsigned long spindown; /* timeout needed for spindown */
141 unsigned char spindown_offset; /* decides in which position the disk
142 * will stop */
143 unsigned char select_delay; /* delay to wait after select */
144 unsigned char rps; /* rotations per second */
145 unsigned char tracks; /* maximum number of tracks */
146 unsigned long timeout; /* timeout for interrupt requests */
147
148 unsigned char interleave_sect; /* if there are more sectors, use
149 * interleave */
150
151 struct floppy_max_errors max_errors;
152
153 char flags; /* various flags, including ftd_msg */
154/*
155 * Announce successful media type detection and media information loss after
156 * disk changes.
157 * Also used to enable/disable printing of overrun warnings.
158 */
159
160#define FTD_MSG 0x10
161#define FD_BROKEN_DCL 0x20
162#define FD_DEBUG 0x02
163#define FD_SILENT_DCL_CLEAR 0x4
164#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
165 considerations */
166
167 char read_track; /* use readtrack during probing? */
168
169/*
170 * Auto-detection. Each drive type has eight formats which are
171 * used in succession to try to read the disk. If the FDC cannot lock onto
172 * the disk, the next format is tried. This uses the variable 'probing'.
173 */
174 short autodetect[8]; /* autodetected formats */
175
176 int checkfreq; /* how often should the drive be checked for disk
177 * changes */
178 int native_format; /* native format of this drive */
179};
180
181enum {
182 FD_NEED_TWADDLE_BIT, /* more magic */
183 FD_VERIFY_BIT, /* inquire for write protection */
184 FD_DISK_NEWCHANGE_BIT, /* change detected, and no action undertaken yet
185 * to clear media change status */
186 FD_UNUSED_BIT,
187 FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
188 FD_DISK_WRITABLE_BIT /* disk is writable */
189};
190
191#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
192#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
193/* set/get drive parameters */
194
195
196/*
197 * Current drive state (not directly modifiable by user, readonly)
198 */
199struct floppy_drive_struct {
200 unsigned long flags;
201/* values for these flags */
202#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
203#define FD_VERIFY (1 << FD_VERIFY_BIT)
204#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
205#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
206#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
207
208 unsigned long spinup_date;
209 unsigned long select_date;
210 unsigned long first_read_date;
211 short probed_format;
212 short track; /* current track */
213 short maxblock; /* id of highest block read */
214 short maxtrack; /* id of highest half track read */
215 int generation; /* how many diskchanges? */
216
217/*
218 * (User-provided) media information is _not_ discarded after a media change
219 * if the corresponding keep_data flag is non-zero. Positive values are
220 * decremented after each probe.
221 */
222 int keep_data;
223
224 /* Prevent "aliased" accesses. */
225 int fd_ref;
226 int fd_device;
227 unsigned long last_checked; /* when was the drive last checked for a disk
228 * change? */
229
230 char *dmabuf;
231 int bufblocks;
232};
233
234#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
235#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
236/* get drive state: GET returns the cached state, POLL polls for new state */
237
238
239/*
240 * reset FDC
241 */
242enum reset_mode {
243 FD_RESET_IF_NEEDED, /* reset only if the reset flags is set */
244 FD_RESET_IF_RAWCMD, /* obsolete */
245 FD_RESET_ALWAYS /* reset always */
246};
247#define FDRESET _IO(2, 0x54)
248
249
250/*
251 * FDC state
252 */
253struct floppy_fdc_state {
254 int spec1; /* spec1 value last used */
255 int spec2; /* spec2 value last used */
256 int dtr;
257 unsigned char version; /* FDC version code */
258 unsigned char dor;
259 unsigned long address; /* io address */
260 unsigned int rawcmd:2;
261 unsigned int reset:1;
262 unsigned int need_configure:1;
263 unsigned int perp_mode:2;
264 unsigned int has_fifo:1;
265 unsigned int driver_version; /* version code for floppy driver */
266#define FD_DRIVER_VERSION 0x100
267/* user programs using the floppy API should use floppy_fdc_state to
268 * get the version number of the floppy driver that they are running
269 * on. If this version number is bigger than the one compiled into the
270 * user program (the FD_DRIVER_VERSION define), it should be prepared
271 * to bigger structures
272 */
273
274 unsigned char track[4];
275 /* Position of the heads of the 4 units attached to this FDC,
276 * as stored on the FDC. In the future, the position as stored
277 * on the FDC might not agree with the actual physical
278 * position of these drive heads. By allowing such
279 * disagreement, it will be possible to reset the FDC without
280 * incurring the expensive cost of repositioning all heads.
281 * Right now, these positions are hard wired to 0. */
282
283};
284
285#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
286
287
288/*
289 * Asynchronous Write error tracking
290 */
291struct floppy_write_errors {
292 /* Write error logging.
293 *
294 * These fields can be cleared with the FDWERRORCLR ioctl.
295 * Only writes that were attempted but failed due to a physical media
296 * error are logged. write(2) calls that fail and return an error code
297 * to the user process are not counted.
298 */
299
300 unsigned int write_errors; /* number of physical write errors
301 * encountered */
302
303 /* position of first and last write errors */
304 unsigned long first_error_sector;
305 int first_error_generation;
306 unsigned long last_error_sector;
307 int last_error_generation;
308
309 unsigned int badness; /* highest retry count for a read or write
310 * operation */
311};
312
313#define FDWERRORCLR _IO(2, 0x56)
314/* clear write error and badness information */
315#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
316/* get write error and badness information */
317
318
319/*
320 * Raw commands
321 */
322/* new interface flag: now we can do them in batches */
323#define FDHAVEBATCHEDRAWCMD
324
325struct floppy_raw_cmd {
326 unsigned int flags;
327#define FD_RAW_READ 1
328#define FD_RAW_WRITE 2
329#define FD_RAW_NO_MOTOR 4
330#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
331#define FD_RAW_INTR 8 /* wait for an interrupt */
332#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
333#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
334 * completion */
335#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
336#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
337
338/* more "in" flags */
339#define FD_RAW_MORE 0x100 /* more records follow */
340#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
341#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
342#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
343 * detection too */
344
345/* more "out" flags */
346#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
347#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
348
349 void __user *data;
350 char *kernel_data; /* location of data buffer in the kernel */
351 struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
352 * within the kernel */
353 long length; /* in: length of dma transfer. out: remaining bytes */
354 long phys_length; /* physical length, if different from dma length */
355 int buffer_length; /* length of allocated buffer */
356
357 unsigned char rate;
358 unsigned char cmd_count;
359 unsigned char cmd[16];
360 unsigned char reply_count;
361 unsigned char reply[16];
362 int track;
363 int resultcode;
364
365 int reserved1;
366 int reserved2;
367};
368
369#define FDRAWCMD _IO(2, 0x58)
370/* send a raw command to the fdc. Structure size not included, because of
371 * batches */
372
373#define FDTWADDLE _IO(2, 0x59)
374/* flicker motor-on bit before reading a sector. Experimental */
375
376
377#define FDEJECT _IO(2, 0x5a)
378/* eject the disk */
379
380
381#ifdef __KERNEL__
382#ifdef CONFIG_COMPAT 6#ifdef CONFIG_COMPAT
383#include <linux/compat.h> 7#include <linux/compat.h>
384 8
@@ -398,5 +22,3 @@ struct compat_floppy_struct {
398#define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct) 22#define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct)
399#endif 23#endif
400#endif 24#endif
401
402#endif
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 2ded090e10f..24d251f3bab 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1,141 +1,12 @@
1/* 1/*
2 * Linux Socket Filter Data Structures 2 * Linux Socket Filter Data Structures
3 */ 3 */
4
5#ifndef __LINUX_FILTER_H__ 4#ifndef __LINUX_FILTER_H__
6#define __LINUX_FILTER_H__ 5#define __LINUX_FILTER_H__
7 6
8#include <linux/compiler.h>
9#include <linux/types.h>
10
11#ifdef __KERNEL__
12#include <linux/atomic.h> 7#include <linux/atomic.h>
13#include <linux/compat.h> 8#include <linux/compat.h>
14#endif 9#include <uapi/linux/filter.h>
15
16/*
17 * Current version of the filter code architecture.
18 */
19#define BPF_MAJOR_VERSION 1
20#define BPF_MINOR_VERSION 1
21
22/*
23 * Try and keep these values and structures similar to BSD, especially
24 * the BPF code definitions which need to match so you can share filters
25 */
26
27struct sock_filter { /* Filter block */
28 __u16 code; /* Actual filter code */
29 __u8 jt; /* Jump true */
30 __u8 jf; /* Jump false */
31 __u32 k; /* Generic multiuse field */
32};
33
34struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
35 unsigned short len; /* Number of filter blocks */
36 struct sock_filter __user *filter;
37};
38
39/*
40 * Instruction classes
41 */
42
43#define BPF_CLASS(code) ((code) & 0x07)
44#define BPF_LD 0x00
45#define BPF_LDX 0x01
46#define BPF_ST 0x02
47#define BPF_STX 0x03
48#define BPF_ALU 0x04
49#define BPF_JMP 0x05
50#define BPF_RET 0x06
51#define BPF_MISC 0x07
52
53/* ld/ldx fields */
54#define BPF_SIZE(code) ((code) & 0x18)
55#define BPF_W 0x00
56#define BPF_H 0x08
57#define BPF_B 0x10
58#define BPF_MODE(code) ((code) & 0xe0)
59#define BPF_IMM 0x00
60#define BPF_ABS 0x20
61#define BPF_IND 0x40
62#define BPF_MEM 0x60
63#define BPF_LEN 0x80
64#define BPF_MSH 0xa0
65
66/* alu/jmp fields */
67#define BPF_OP(code) ((code) & 0xf0)
68#define BPF_ADD 0x00
69#define BPF_SUB 0x10
70#define BPF_MUL 0x20
71#define BPF_DIV 0x30
72#define BPF_OR 0x40
73#define BPF_AND 0x50
74#define BPF_LSH 0x60
75#define BPF_RSH 0x70
76#define BPF_NEG 0x80
77#define BPF_MOD 0x90
78#define BPF_XOR 0xa0
79
80#define BPF_JA 0x00
81#define BPF_JEQ 0x10
82#define BPF_JGT 0x20
83#define BPF_JGE 0x30
84#define BPF_JSET 0x40
85#define BPF_SRC(code) ((code) & 0x08)
86#define BPF_K 0x00
87#define BPF_X 0x08
88
89/* ret - BPF_K and BPF_X also apply */
90#define BPF_RVAL(code) ((code) & 0x18)
91#define BPF_A 0x10
92
93/* misc */
94#define BPF_MISCOP(code) ((code) & 0xf8)
95#define BPF_TAX 0x00
96#define BPF_TXA 0x80
97
98#ifndef BPF_MAXINSNS
99#define BPF_MAXINSNS 4096
100#endif
101
102/*
103 * Macros for filter block array initializers.
104 */
105#ifndef BPF_STMT
106#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
107#endif
108#ifndef BPF_JUMP
109#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
110#endif
111
112/*
113 * Number of scratch memory words for: BPF_ST and BPF_STX
114 */
115#define BPF_MEMWORDS 16
116
117/* RATIONALE. Negative offsets are invalid in BPF.
118 We use them to reference ancillary data.
119 Unlike introduction new instructions, it does not break
120 existing compilers/optimizers.
121 */
122#define SKF_AD_OFF (-0x1000)
123#define SKF_AD_PROTOCOL 0
124#define SKF_AD_PKTTYPE 4
125#define SKF_AD_IFINDEX 8
126#define SKF_AD_NLATTR 12
127#define SKF_AD_NLATTR_NEST 16
128#define SKF_AD_MARK 20
129#define SKF_AD_QUEUE 24
130#define SKF_AD_HATYPE 28
131#define SKF_AD_RXHASH 32
132#define SKF_AD_CPU 36
133#define SKF_AD_ALU_XOR_X 40
134#define SKF_AD_MAX 44
135#define SKF_NET_OFF (-0x100000)
136#define SKF_LL_OFF (-0x200000)
137
138#ifdef __KERNEL__
139 10
140#ifdef CONFIG_COMPAT 11#ifdef CONFIG_COMPAT
141/* 12/*
@@ -254,6 +125,4 @@ enum {
254 BPF_S_ANC_SECCOMP_LD_W, 125 BPF_S_ANC_SECCOMP_LD_W,
255}; 126};
256 127
257#endif /* __KERNEL__ */
258
259#endif /* __LINUX_FILTER_H__ */ 128#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/flat.h b/include/linux/flat.h
index ec56852e265..2c1eb15c4ba 100644
--- a/include/linux/flat.h
+++ b/include/linux/flat.h
@@ -6,58 +6,12 @@
6 * This file provides the definitions and structures needed to 6 * This file provides the definitions and structures needed to
7 * support uClinux flat-format executables. 7 * support uClinux flat-format executables.
8 */ 8 */
9
10#ifndef _LINUX_FLAT_H 9#ifndef _LINUX_FLAT_H
11#define _LINUX_FLAT_H 10#define _LINUX_FLAT_H
12 11
13#ifdef __KERNEL__
14#include <asm/flat.h> 12#include <asm/flat.h>
15#endif 13#include <uapi/linux/flat.h>
16
17#define FLAT_VERSION 0x00000004L
18
19#ifdef CONFIG_BINFMT_SHARED_FLAT
20#define MAX_SHARED_LIBS (4)
21#else
22#define MAX_SHARED_LIBS (1)
23#endif
24
25/*
26 * To make everything easier to port and manage cross platform
27 * development, all fields are in network byte order.
28 */
29 14
30struct flat_hdr {
31 char magic[4];
32 unsigned long rev; /* version (as above) */
33 unsigned long entry; /* Offset of first executable instruction
34 with text segment from beginning of file */
35 unsigned long data_start; /* Offset of data segment from beginning of
36 file */
37 unsigned long data_end; /* Offset of end of data segment
38 from beginning of file */
39 unsigned long bss_end; /* Offset of end of bss segment from beginning
40 of file */
41
42 /* (It is assumed that data_end through bss_end forms the bss segment.) */
43
44 unsigned long stack_size; /* Size of stack, in bytes */
45 unsigned long reloc_start; /* Offset of relocation records from
46 beginning of file */
47 unsigned long reloc_count; /* Number of relocation records */
48 unsigned long flags;
49 unsigned long build_date; /* When the program/library was built */
50 unsigned long filler[5]; /* Reservered, set to zero */
51};
52
53#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
54#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
55#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
56#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
57#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
58
59
60#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
61/* 15/*
62 * While it would be nice to keep this header clean, users of older 16 * While it would be nice to keep this header clean, users of older
63 * tools still need this support in the kernel. So this section is 17 * tools still need this support in the kernel. So this section is
@@ -95,6 +49,4 @@ typedef union {
95 } reloc; 49 } reloc;
96} flat_v2_reloc_t; 50} flat_v2_reloc_t;
97 51
98#endif /* __KERNEL__ */
99
100#endif /* _LINUX_FLAT_H */ 52#endif /* _LINUX_FLAT_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 65fbf571023..001c7cff2d4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1,121 +1,68 @@
1#ifndef _LINUX_FS_H 1#ifndef _LINUX_FS_H
2#define _LINUX_FS_H 2#define _LINUX_FS_H
3 3
4/*
5 * This file has definitions for some important file table
6 * structures etc.
7 */
8 4
9#include <linux/limits.h> 5#include <linux/linkage.h>
10#include <linux/ioctl.h> 6#include <linux/wait.h>
7#include <linux/kdev_t.h>
8#include <linux/dcache.h>
9#include <linux/path.h>
10#include <linux/stat.h>
11#include <linux/cache.h>
12#include <linux/list.h>
13#include <linux/radix-tree.h>
14#include <linux/rbtree.h>
15#include <linux/init.h>
16#include <linux/pid.h>
17#include <linux/bug.h>
18#include <linux/mutex.h>
19#include <linux/capability.h>
20#include <linux/semaphore.h>
21#include <linux/fiemap.h>
22#include <linux/rculist_bl.h>
23#include <linux/atomic.h>
24#include <linux/shrinker.h>
25#include <linux/migrate_mode.h>
26#include <linux/uidgid.h>
27#include <linux/lockdep.h>
28#include <linux/percpu-rwsem.h>
11#include <linux/blk_types.h> 29#include <linux/blk_types.h>
12#include <linux/types.h>
13
14/*
15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
16 * the file limit at runtime and only root can increase the per-process
17 * nr_file rlimit, so it's safe to set up a ridiculously high absolute
18 * upper limit on files-per-process.
19 *
20 * Some programs (notably those using select()) may have to be
21 * recompiled to take full advantage of the new limits..
22 */
23
24/* Fixed constants first: */
25#undef NR_OPEN
26#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */
27#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
28
29#define BLOCK_SIZE_BITS 10
30#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
31
32#define SEEK_SET 0 /* seek relative to beginning of file */
33#define SEEK_CUR 1 /* seek relative to current file position */
34#define SEEK_END 2 /* seek relative to end of file */
35#define SEEK_DATA 3 /* seek to the next data */
36#define SEEK_HOLE 4 /* seek to the next hole */
37#define SEEK_MAX SEEK_HOLE
38
39struct fstrim_range {
40 __u64 start;
41 __u64 len;
42 __u64 minlen;
43};
44
45/* And dynamically-tunable limits and defaults: */
46struct files_stat_struct {
47 unsigned long nr_files; /* read only */
48 unsigned long nr_free_files; /* read only */
49 unsigned long max_files; /* tunable */
50};
51
52struct inodes_stat_t {
53 int nr_inodes;
54 int nr_unused;
55 int dummy[5]; /* padding for sysctl ABI compatibility */
56};
57
58
59#define NR_FILE 8192 /* this can well be larger on a larger system */
60
61#define MAY_EXEC 0x00000001
62#define MAY_WRITE 0x00000002
63#define MAY_READ 0x00000004
64#define MAY_APPEND 0x00000008
65#define MAY_ACCESS 0x00000010
66#define MAY_OPEN 0x00000020
67#define MAY_CHDIR 0x00000040
68/* called from RCU mode, don't block */
69#define MAY_NOT_BLOCK 0x00000080
70
71/*
72 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
73 * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
74 */
75
76/* file is open for reading */
77#define FMODE_READ ((__force fmode_t)0x1)
78/* file is open for writing */
79#define FMODE_WRITE ((__force fmode_t)0x2)
80/* file is seekable */
81#define FMODE_LSEEK ((__force fmode_t)0x4)
82/* file can be accessed using pread */
83#define FMODE_PREAD ((__force fmode_t)0x8)
84/* file can be accessed using pwrite */
85#define FMODE_PWRITE ((__force fmode_t)0x10)
86/* File is opened for execution with sys_execve / sys_uselib */
87#define FMODE_EXEC ((__force fmode_t)0x20)
88/* File is opened with O_NDELAY (only set for block devices) */
89#define FMODE_NDELAY ((__force fmode_t)0x40)
90/* File is opened with O_EXCL (only set for block devices) */
91#define FMODE_EXCL ((__force fmode_t)0x80)
92/* File is opened using open(.., 3, ..) and is writeable only for ioctls
93 (specialy hack for floppy.c) */
94#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
95/* 32bit hashes as llseek() offset (for directories) */
96#define FMODE_32BITHASH ((__force fmode_t)0x200)
97/* 64bit hashes as llseek() offset (for directories) */
98#define FMODE_64BITHASH ((__force fmode_t)0x400)
99 30
100/* 31#include <asm/byteorder.h>
101 * Don't update ctime and mtime. 32#include <uapi/linux/fs.h>
102 *
103 * Currently a special hack for the XFS open_by_handle ioctl, but we'll
104 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
105 */
106#define FMODE_NOCMTIME ((__force fmode_t)0x800)
107 33
108/* Expect random access pattern */ 34struct export_operations;
109#define FMODE_RANDOM ((__force fmode_t)0x1000) 35struct hd_geometry;
36struct iovec;
37struct nameidata;
38struct kiocb;
39struct kobject;
40struct pipe_inode_info;
41struct poll_table_struct;
42struct kstatfs;
43struct vm_area_struct;
44struct vfsmount;
45struct cred;
46struct swap_info_struct;
110 47
111/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ 48extern void __init inode_init(void);
112#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) 49extern void __init inode_init_early(void);
50extern void __init files_init(unsigned long);
113 51
114/* File is opened with O_PATH; almost nothing can be done with it */ 52extern struct files_stat_struct files_stat;
115#define FMODE_PATH ((__force fmode_t)0x4000) 53extern unsigned long get_max_files(void);
54extern int sysctl_nr_open;
55extern struct inodes_stat_t inodes_stat;
56extern int leases_enable, lease_break_time;
57extern int sysctl_protected_symlinks;
58extern int sysctl_protected_hardlinks;
116 59
117/* File was opened by fanotify and shouldn't generate fanotify events */ 60struct buffer_head;
118#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 61typedef int (get_block_t)(struct inode *inode, sector_t iblock,
62 struct buffer_head *bh_result, int create);
63typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
64 ssize_t bytes, void *private, int ret,
65 bool is_async);
119 66
120/* 67/*
121 * The below are the various read and write types that we support. Some of 68 * The below are the various read and write types that we support. Some of
@@ -175,284 +122,6 @@ struct inodes_stat_t {
175#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) 122#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
176#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 123#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
177 124
178
179/*
180 * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
181 * that indicates that they should check the contents of the iovec are
182 * valid, but not check the memory that the iovec elements
183 * points too.
184 */
185#define CHECK_IOVEC_ONLY -1
186
187#define SEL_IN 1
188#define SEL_OUT 2
189#define SEL_EX 4
190
191/* public flags for file_system_type */
192#define FS_REQUIRES_DEV 1
193#define FS_BINARY_MOUNTDATA 2
194#define FS_HAS_SUBTYPE 4
195#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
196#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
197 * during rename() internally.
198 */
199
200/*
201 * These are the fs-independent mount-flags: up to 32 flags are supported
202 */
203#define MS_RDONLY 1 /* Mount read-only */
204#define MS_NOSUID 2 /* Ignore suid and sgid bits */
205#define MS_NODEV 4 /* Disallow access to device special files */
206#define MS_NOEXEC 8 /* Disallow program execution */
207#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
208#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
209#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
210#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
211#define MS_NOATIME 1024 /* Do not update access times. */
212#define MS_NODIRATIME 2048 /* Do not update directory access times */
213#define MS_BIND 4096
214#define MS_MOVE 8192
215#define MS_REC 16384
216#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
217 MS_VERBOSE is deprecated. */
218#define MS_SILENT 32768
219#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
220#define MS_UNBINDABLE (1<<17) /* change to unbindable */
221#define MS_PRIVATE (1<<18) /* change to private */
222#define MS_SLAVE (1<<19) /* change to slave */
223#define MS_SHARED (1<<20) /* change to shared */
224#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
225#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
226#define MS_I_VERSION (1<<23) /* Update inode I_version field */
227#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
228#define MS_NOSEC (1<<28)
229#define MS_BORN (1<<29)
230#define MS_ACTIVE (1<<30)
231#define MS_NOUSER (1<<31)
232
233/*
234 * Superblock flags that can be altered by MS_REMOUNT
235 */
236#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
237
238/*
239 * Old magic mount flag and mask
240 */
241#define MS_MGC_VAL 0xC0ED0000
242#define MS_MGC_MSK 0xffff0000
243
244/* Inode flags - they have nothing to superblock flags now */
245
246#define S_SYNC 1 /* Writes are synced at once */
247#define S_NOATIME 2 /* Do not update access times */
248#define S_APPEND 4 /* Append-only file */
249#define S_IMMUTABLE 8 /* Immutable file */
250#define S_DEAD 16 /* removed, but still open directory */
251#define S_NOQUOTA 32 /* Inode is not counted to quota */
252#define S_DIRSYNC 64 /* Directory modifications are synchronous */
253#define S_NOCMTIME 128 /* Do not update file c/mtime */
254#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
255#define S_PRIVATE 512 /* Inode is fs-internal */
256#define S_IMA 1024 /* Inode has an associated IMA struct */
257#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */
258#define S_NOSEC 4096 /* no suid or xattr security attributes */
259
260/*
261 * Note that nosuid etc flags are inode-specific: setting some file-system
262 * flags just means all the inodes inherit those flags by default. It might be
263 * possible to override it selectively if you really wanted to with some
264 * ioctl() that is not currently implemented.
265 *
266 * Exception: MS_RDONLY is always applied to the entire file system.
267 *
268 * Unfortunately, it is possible to change a filesystems flags with it mounted
269 * with files in use. This means that all of the inodes will not have their
270 * i_flags updated. Hence, i_flags no longer inherit the superblock mount
271 * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
272 */
273#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
274
275#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
276#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
277 ((inode)->i_flags & S_SYNC))
278#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
279 ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
280#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
281#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
282#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION)
283
284#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
285#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
286#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
287#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
288
289#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
290#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
291#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
292#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
293#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
294#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)
295#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
296
297/* the read-only stuff doesn't really belong here, but any other place is
298 probably as bad and I don't want to create yet another include file. */
299
300#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
301#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
302#define BLKRRPART _IO(0x12,95) /* re-read partition table */
303#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
304#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
305#define BLKRASET _IO(0x12,98) /* set read ahead for block device */
306#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
307#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
308#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
309#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
310#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
311#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
312#if 0
313#define BLKPG _IO(0x12,105)/* See blkpg.h */
314
315/* Some people are morons. Do not use sizeof! */
316
317#define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */
318#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */
319/* This was here just to show that the number is taken -
320 probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
321#endif
322/* A jump here: 108-111 have been used for various private purposes. */
323#define BLKBSZGET _IOR(0x12,112,size_t)
324#define BLKBSZSET _IOW(0x12,113,size_t)
325#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
326#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
327#define BLKTRACESTART _IO(0x12,116)
328#define BLKTRACESTOP _IO(0x12,117)
329#define BLKTRACETEARDOWN _IO(0x12,118)
330#define BLKDISCARD _IO(0x12,119)
331#define BLKIOMIN _IO(0x12,120)
332#define BLKIOOPT _IO(0x12,121)
333#define BLKALIGNOFF _IO(0x12,122)
334#define BLKPBSZGET _IO(0x12,123)
335#define BLKDISCARDZEROES _IO(0x12,124)
336#define BLKSECDISCARD _IO(0x12,125)
337#define BLKROTATIONAL _IO(0x12,126)
338#define BLKZEROOUT _IO(0x12,127)
339
340#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
341#define FIBMAP _IO(0x00,1) /* bmap access */
342#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
343#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
344#define FITHAW _IOWR('X', 120, int) /* Thaw */
345#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
346
347#define FS_IOC_GETFLAGS _IOR('f', 1, long)
348#define FS_IOC_SETFLAGS _IOW('f', 2, long)
349#define FS_IOC_GETVERSION _IOR('v', 1, long)
350#define FS_IOC_SETVERSION _IOW('v', 2, long)
351#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
352#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
353#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
354#define FS_IOC32_GETVERSION _IOR('v', 1, int)
355#define FS_IOC32_SETVERSION _IOW('v', 2, int)
356
357/*
358 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
359 */
360#define FS_SECRM_FL 0x00000001 /* Secure deletion */
361#define FS_UNRM_FL 0x00000002 /* Undelete */
362#define FS_COMPR_FL 0x00000004 /* Compress file */
363#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
364#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
365#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
366#define FS_NODUMP_FL 0x00000040 /* do not dump file */
367#define FS_NOATIME_FL 0x00000080 /* do not update atime */
368/* Reserved for compression usage... */
369#define FS_DIRTY_FL 0x00000100
370#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
371#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
372#define FS_ECOMPR_FL 0x00000800 /* Compression error */
373/* End compression flags --- maybe not all used */
374#define FS_BTREE_FL 0x00001000 /* btree format dir */
375#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
376#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
377#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
378#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
379#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
380#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
381#define FS_EXTENT_FL 0x00080000 /* Extents */
382#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */
383#define FS_NOCOW_FL 0x00800000 /* Do not cow file */
384#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
385
386#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
387#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
388
389
390#define SYNC_FILE_RANGE_WAIT_BEFORE 1
391#define SYNC_FILE_RANGE_WRITE 2
392#define SYNC_FILE_RANGE_WAIT_AFTER 4
393
394#ifdef __KERNEL__
395
396#include <linux/linkage.h>
397#include <linux/wait.h>
398#include <linux/kdev_t.h>
399#include <linux/dcache.h>
400#include <linux/path.h>
401#include <linux/stat.h>
402#include <linux/cache.h>
403#include <linux/list.h>
404#include <linux/radix-tree.h>
405#include <linux/rbtree.h>
406#include <linux/init.h>
407#include <linux/pid.h>
408#include <linux/bug.h>
409#include <linux/mutex.h>
410#include <linux/capability.h>
411#include <linux/semaphore.h>
412#include <linux/fiemap.h>
413#include <linux/rculist_bl.h>
414#include <linux/atomic.h>
415#include <linux/shrinker.h>
416#include <linux/migrate_mode.h>
417#include <linux/uidgid.h>
418#include <linux/lockdep.h>
419#include <linux/percpu-rwsem.h>
420
421#include <asm/byteorder.h>
422
423struct export_operations;
424struct hd_geometry;
425struct iovec;
426struct nameidata;
427struct kiocb;
428struct kobject;
429struct pipe_inode_info;
430struct poll_table_struct;
431struct kstatfs;
432struct vm_area_struct;
433struct vfsmount;
434struct cred;
435struct swap_info_struct;
436
437extern void __init inode_init(void);
438extern void __init inode_init_early(void);
439extern void __init files_init(unsigned long);
440
441extern struct files_stat_struct files_stat;
442extern unsigned long get_max_files(void);
443extern int sysctl_nr_open;
444extern struct inodes_stat_t inodes_stat;
445extern int leases_enable, lease_break_time;
446extern int sysctl_protected_symlinks;
447extern int sysctl_protected_hardlinks;
448
449struct buffer_head;
450typedef int (get_block_t)(struct inode *inode, sector_t iblock,
451 struct buffer_head *bh_result, int create);
452typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
453 ssize_t bytes, void *private, int ret,
454 bool is_async);
455
456/* 125/*
457 * Attribute flags. These should be or-ed together to figure out what 126 * Attribute flags. These should be or-ed together to figure out what
458 * has been changed! 127 * has been changed!
@@ -2877,5 +2546,4 @@ static inline void inode_has_no_xattr(struct inode *inode)
2877 inode->i_flags |= S_NOSEC; 2546 inode->i_flags |= S_NOSEC;
2878} 2547}
2879 2548
2880#endif /* __KERNEL__ */
2881#endif /* _LINUX_FS_H */ 2549#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsl_hypervisor.h b/include/linux/fsl_hypervisor.h
index 1cebaeeeef5..2a707d7fb32 100644
--- a/include/linux/fsl_hypervisor.h
+++ b/include/linux/fsl_hypervisor.h
@@ -36,187 +36,11 @@
36 * also be included by applications that need to communicate with the driver 36 * also be included by applications that need to communicate with the driver
37 * via the ioctl interface. 37 * via the ioctl interface.
38 */ 38 */
39
40#ifndef FSL_HYPERVISOR_H 39#ifndef FSL_HYPERVISOR_H
41#define FSL_HYPERVISOR_H 40#define FSL_HYPERVISOR_H
42 41
43#include <linux/types.h> 42#include <uapi/linux/fsl_hypervisor.h>
44
45/**
46 * struct fsl_hv_ioctl_restart - restart a partition
47 * @ret: return error code from the hypervisor
48 * @partition: the ID of the partition to restart, or -1 for the
49 * calling partition
50 *
51 * Used by FSL_HV_IOCTL_PARTITION_RESTART
52 */
53struct fsl_hv_ioctl_restart {
54 __u32 ret;
55 __u32 partition;
56};
57 43
58/**
59 * struct fsl_hv_ioctl_status - get a partition's status
60 * @ret: return error code from the hypervisor
61 * @partition: the ID of the partition to query, or -1 for the
62 * calling partition
63 * @status: The returned status of the partition
64 *
65 * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
66 *
67 * Values of 'status':
68 * 0 = Stopped
69 * 1 = Running
70 * 2 = Starting
71 * 3 = Stopping
72 */
73struct fsl_hv_ioctl_status {
74 __u32 ret;
75 __u32 partition;
76 __u32 status;
77};
78
79/**
80 * struct fsl_hv_ioctl_start - start a partition
81 * @ret: return error code from the hypervisor
82 * @partition: the ID of the partition to control
83 * @entry_point: The offset within the guest IMA to start execution
84 * @load: If non-zero, reload the partition's images before starting
85 *
86 * Used by FSL_HV_IOCTL_PARTITION_START
87 */
88struct fsl_hv_ioctl_start {
89 __u32 ret;
90 __u32 partition;
91 __u32 entry_point;
92 __u32 load;
93};
94
95/**
96 * struct fsl_hv_ioctl_stop - stop a partition
97 * @ret: return error code from the hypervisor
98 * @partition: the ID of the partition to stop, or -1 for the calling
99 * partition
100 *
101 * Used by FSL_HV_IOCTL_PARTITION_STOP
102 */
103struct fsl_hv_ioctl_stop {
104 __u32 ret;
105 __u32 partition;
106};
107
108/**
109 * struct fsl_hv_ioctl_memcpy - copy memory between partitions
110 * @ret: return error code from the hypervisor
111 * @source: the partition ID of the source partition, or -1 for this
112 * partition
113 * @target: the partition ID of the target partition, or -1 for this
114 * partition
115 * @reserved: reserved, must be set to 0
116 * @local_addr: user-space virtual address of a buffer in the local
117 * partition
118 * @remote_addr: guest physical address of a buffer in the
119 * remote partition
120 * @count: the number of bytes to copy. Both the local and remote
121 * buffers must be at least 'count' bytes long
122 *
123 * Used by FSL_HV_IOCTL_MEMCPY
124 *
125 * The 'local' partition is the partition that calls this ioctl. The
126 * 'remote' partition is a different partition. The data is copied from
127 * the 'source' paritition' to the 'target' partition.
128 *
129 * The buffer in the remote partition must be guest physically
130 * contiguous.
131 *
132 * This ioctl does not support copying memory between two remote
133 * partitions or within the same partition, so either 'source' or
134 * 'target' (but not both) must be -1. In other words, either
135 *
136 * source == local and target == remote
137 * or
138 * source == remote and target == local
139 */
140struct fsl_hv_ioctl_memcpy {
141 __u32 ret;
142 __u32 source;
143 __u32 target;
144 __u32 reserved; /* padding to ensure local_vaddr is aligned */
145 __u64 local_vaddr;
146 __u64 remote_paddr;
147 __u64 count;
148};
149
150/**
151 * struct fsl_hv_ioctl_doorbell - ring a doorbell
152 * @ret: return error code from the hypervisor
153 * @doorbell: the handle of the doorbell to ring doorbell
154 *
155 * Used by FSL_HV_IOCTL_DOORBELL
156 */
157struct fsl_hv_ioctl_doorbell {
158 __u32 ret;
159 __u32 doorbell;
160};
161
162/**
163 * struct fsl_hv_ioctl_prop - get/set a device tree property
164 * @ret: return error code from the hypervisor
165 * @handle: handle of partition whose tree to access
166 * @path: virtual address of path name of node to access
167 * @propname: virtual address of name of property to access
168 * @propval: virtual address of property data buffer
169 * @proplen: Size of property data buffer
170 * @reserved: reserved, must be set to 0
171 *
172 * Used by FSL_HV_IOCTL_DOORBELL
173 */
174struct fsl_hv_ioctl_prop {
175 __u32 ret;
176 __u32 handle;
177 __u64 path;
178 __u64 propname;
179 __u64 propval;
180 __u32 proplen;
181 __u32 reserved; /* padding to ensure structure is aligned */
182};
183
184/* The ioctl type, documented in ioctl-number.txt */
185#define FSL_HV_IOCTL_TYPE 0xAF
186
187/* Restart another partition */
188#define FSL_HV_IOCTL_PARTITION_RESTART \
189 _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
190
191/* Get a partition's status */
192#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
193 _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
194
195/* Boot another partition */
196#define FSL_HV_IOCTL_PARTITION_START \
197 _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
198
199/* Stop this or another partition */
200#define FSL_HV_IOCTL_PARTITION_STOP \
201 _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
202
203/* Copy data from one partition to another */
204#define FSL_HV_IOCTL_MEMCPY \
205 _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
206
207/* Ring a doorbell */
208#define FSL_HV_IOCTL_DOORBELL \
209 _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
210
211/* Get a property from another guest's device tree */
212#define FSL_HV_IOCTL_GETPROP \
213 _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
214
215/* Set a property in another guest's device tree */
216#define FSL_HV_IOCTL_SETPROP \
217 _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
218
219#ifdef __KERNEL__
220 44
221/** 45/**
222 * fsl_hv_event_register() - register a callback for failover events 46 * fsl_hv_event_register() - register a callback for failover events
@@ -237,5 +61,3 @@ int fsl_hv_failover_register(struct notifier_block *nb);
237int fsl_hv_failover_unregister(struct notifier_block *nb); 61int fsl_hv_failover_unregister(struct notifier_block *nb);
238 62
239#endif 63#endif
240
241#endif
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 1e5a26d7923..b0d95cac826 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -1,129 +1,8 @@
1#ifndef _LINUX_FUTEX_H 1#ifndef _LINUX_FUTEX_H
2#define _LINUX_FUTEX_H 2#define _LINUX_FUTEX_H
3 3
4#include <linux/compiler.h> 4#include <uapi/linux/futex.h>
5#include <linux/types.h>
6 5
7/* Second argument to futex syscall */
8
9
10#define FUTEX_WAIT 0
11#define FUTEX_WAKE 1
12#define FUTEX_FD 2
13#define FUTEX_REQUEUE 3
14#define FUTEX_CMP_REQUEUE 4
15#define FUTEX_WAKE_OP 5
16#define FUTEX_LOCK_PI 6
17#define FUTEX_UNLOCK_PI 7
18#define FUTEX_TRYLOCK_PI 8
19#define FUTEX_WAIT_BITSET 9
20#define FUTEX_WAKE_BITSET 10
21#define FUTEX_WAIT_REQUEUE_PI 11
22#define FUTEX_CMP_REQUEUE_PI 12
23
24#define FUTEX_PRIVATE_FLAG 128
25#define FUTEX_CLOCK_REALTIME 256
26#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
27
28#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
29#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
30#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
31#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
32#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
33#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
34#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
35#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
36#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
37#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
38#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
39 FUTEX_PRIVATE_FLAG)
40#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
41 FUTEX_PRIVATE_FLAG)
42
43/*
44 * Support for robust futexes: the kernel cleans up held futexes at
45 * thread exit time.
46 */
47
48/*
49 * Per-lock list entry - embedded in user-space locks, somewhere close
50 * to the futex field. (Note: user-space uses a double-linked list to
51 * achieve O(1) list add and remove, but the kernel only needs to know
52 * about the forward link)
53 *
54 * NOTE: this structure is part of the syscall ABI, and must not be
55 * changed.
56 */
57struct robust_list {
58 struct robust_list __user *next;
59};
60
61/*
62 * Per-thread list head:
63 *
64 * NOTE: this structure is part of the syscall ABI, and must only be
65 * changed if the change is first communicated with the glibc folks.
66 * (When an incompatible change is done, we'll increase the structure
67 * size, which glibc will detect)
68 */
69struct robust_list_head {
70 /*
71 * The head of the list. Points back to itself if empty:
72 */
73 struct robust_list list;
74
75 /*
76 * This relative offset is set by user-space, it gives the kernel
77 * the relative position of the futex field to examine. This way
78 * we keep userspace flexible, to freely shape its data-structure,
79 * without hardcoding any particular offset into the kernel:
80 */
81 long futex_offset;
82
83 /*
84 * The death of the thread may race with userspace setting
85 * up a lock's links. So to handle this race, userspace first
86 * sets this field to the address of the to-be-taken lock,
87 * then does the lock acquire, and then adds itself to the
88 * list, and then clears this field. Hence the kernel will
89 * always have full knowledge of all locks that the thread
90 * _might_ have taken. We check the owner TID in any case,
91 * so only truly owned locks will be handled.
92 */
93 struct robust_list __user *list_op_pending;
94};
95
96/*
97 * Are there any waiters for this robust futex:
98 */
99#define FUTEX_WAITERS 0x80000000
100
101/*
102 * The kernel signals via this bit that a thread holding a futex
103 * has exited without unlocking the futex. The kernel also does
104 * a FUTEX_WAKE on such futexes, after setting the bit, to wake
105 * up any possible waiters:
106 */
107#define FUTEX_OWNER_DIED 0x40000000
108
109/*
110 * The rest of the robust-futex field is for the TID:
111 */
112#define FUTEX_TID_MASK 0x3fffffff
113
114/*
115 * This limit protects against a deliberately circular list.
116 * (Not worth introducing an rlimit for it)
117 */
118#define ROBUST_LIST_LIMIT 2048
119
120/*
121 * bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
122 * match of any bit.
123 */
124#define FUTEX_BITSET_MATCH_ANY 0xffffffff
125
126#ifdef __KERNEL__
127struct inode; 6struct inode;
128struct mm_struct; 7struct mm_struct;
129struct task_struct; 8struct task_struct;
@@ -185,31 +64,4 @@ static inline void exit_pi_state_list(struct task_struct *curr)
185{ 64{
186} 65}
187#endif 66#endif
188#endif /* __KERNEL__ */
189
190#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
191#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
192#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
193#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
194#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
195
196#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
197
198#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
199#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
200#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
201#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
202#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
203#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
204
205/* FUTEX_WAKE_OP will perform atomically
206 int oldval = *(int *)UADDR2;
207 *(int *)UADDR2 = oldval OP OPARG;
208 if (oldval CMP CMPARG)
209 wake UADDR2; */
210
211#define FUTEX_OP(op, oparg, cmp, cmparg) \
212 (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
213 | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
214
215#endif 67#endif
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index b986be51340..bb7de09e8d5 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -1,6 +1,3 @@
1#ifndef _GAMEPORT_H
2#define _GAMEPORT_H
3
4/* 1/*
5 * Copyright (c) 1999-2002 Vojtech Pavlik 2 * Copyright (c) 1999-2002 Vojtech Pavlik
6 * 3 *
@@ -8,8 +5,9 @@
8 * under the terms of the GNU General Public License version 2 as published by 5 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 6 * the Free Software Foundation.
10 */ 7 */
8#ifndef _GAMEPORT_H
9#define _GAMEPORT_H
11 10
12#ifdef __KERNEL__
13#include <asm/io.h> 11#include <asm/io.h>
14#include <linux/types.h> 12#include <linux/types.h>
15#include <linux/list.h> 13#include <linux/list.h>
@@ -17,6 +15,7 @@
17#include <linux/device.h> 15#include <linux/device.h>
18#include <linux/timer.h> 16#include <linux/timer.h>
19#include <linux/slab.h> 17#include <linux/slab.h>
18#include <uapi/linux/gameport.h>
20 19
21struct gameport { 20struct gameport {
22 21
@@ -166,24 +165,6 @@ void gameport_unregister_driver(struct gameport_driver *drv);
166 module_driver(__gameport_driver, gameport_register_driver, \ 165 module_driver(__gameport_driver, gameport_register_driver, \
167 gameport_unregister_driver) 166 gameport_unregister_driver)
168 167
169#endif /* __KERNEL__ */
170
171#define GAMEPORT_MODE_DISABLED 0
172#define GAMEPORT_MODE_RAW 1
173#define GAMEPORT_MODE_COOKED 2
174
175#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
176#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
177#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
178#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004
179#define GAMEPORT_ID_VENDOR_GENIUS 0x0005
180#define GAMEPORT_ID_VENDOR_INTERACT 0x0006
181#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007
182#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008
183#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
184#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
185
186#ifdef __KERNEL__
187 168
188static inline void gameport_trigger(struct gameport *gameport) 169static inline void gameport_trigger(struct gameport *gameport)
189{ 170{
@@ -235,5 +216,4 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne
235void gameport_start_polling(struct gameport *gameport); 216void gameport_start_polling(struct gameport *gameport);
236void gameport_stop_polling(struct gameport *gameport); 217void gameport_stop_polling(struct gameport *gameport);
237 218
238#endif /* __KERNEL__ */
239#endif 219#endif
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 5ab61c1eb6b..55b685719d5 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -1,86 +1,8 @@
1#ifndef __LINUX_GENERIC_NETLINK_H 1#ifndef __LINUX_GENERIC_NETLINK_H
2#define __LINUX_GENERIC_NETLINK_H 2#define __LINUX_GENERIC_NETLINK_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/genetlink.h>
5#include <linux/netlink.h>
6 5
7#define GENL_NAMSIZ 16 /* length of family name */
8
9#define GENL_MIN_ID NLMSG_MIN_TYPE
10#define GENL_MAX_ID 1023
11
12struct genlmsghdr {
13 __u8 cmd;
14 __u8 version;
15 __u16 reserved;
16};
17
18#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
19
20#define GENL_ADMIN_PERM 0x01
21#define GENL_CMD_CAP_DO 0x02
22#define GENL_CMD_CAP_DUMP 0x04
23#define GENL_CMD_CAP_HASPOL 0x08
24
25/*
26 * List of reserved static generic netlink identifiers:
27 */
28#define GENL_ID_GENERATE 0
29#define GENL_ID_CTRL NLMSG_MIN_TYPE
30
31/**************************************************************************
32 * Controller
33 **************************************************************************/
34
35enum {
36 CTRL_CMD_UNSPEC,
37 CTRL_CMD_NEWFAMILY,
38 CTRL_CMD_DELFAMILY,
39 CTRL_CMD_GETFAMILY,
40 CTRL_CMD_NEWOPS,
41 CTRL_CMD_DELOPS,
42 CTRL_CMD_GETOPS,
43 CTRL_CMD_NEWMCAST_GRP,
44 CTRL_CMD_DELMCAST_GRP,
45 CTRL_CMD_GETMCAST_GRP, /* unused */
46 __CTRL_CMD_MAX,
47};
48
49#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
50
51enum {
52 CTRL_ATTR_UNSPEC,
53 CTRL_ATTR_FAMILY_ID,
54 CTRL_ATTR_FAMILY_NAME,
55 CTRL_ATTR_VERSION,
56 CTRL_ATTR_HDRSIZE,
57 CTRL_ATTR_MAXATTR,
58 CTRL_ATTR_OPS,
59 CTRL_ATTR_MCAST_GROUPS,
60 __CTRL_ATTR_MAX,
61};
62
63#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
64
65enum {
66 CTRL_ATTR_OP_UNSPEC,
67 CTRL_ATTR_OP_ID,
68 CTRL_ATTR_OP_FLAGS,
69 __CTRL_ATTR_OP_MAX,
70};
71
72#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
73
74enum {
75 CTRL_ATTR_MCAST_GRP_UNSPEC,
76 CTRL_ATTR_MCAST_GRP_NAME,
77 CTRL_ATTR_MCAST_GRP_ID,
78 __CTRL_ATTR_MCAST_GRP_MAX,
79};
80
81#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
82
83#ifdef __KERNEL__
84 6
85/* All generic netlink requests are serialized by a global lock. */ 7/* All generic netlink requests are serialized by a global lock. */
86extern void genl_lock(void); 8extern void genl_lock(void);
@@ -113,6 +35,4 @@ extern int lockdep_genl_is_held(void);
113#define MODULE_ALIAS_GENL_FAMILY(family)\ 35#define MODULE_ALIAS_GENL_FAMILY(family)\
114 MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family) 36 MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family)
115 37
116#endif /* __KERNEL__ */
117
118#endif /* __LINUX_GENERIC_NETLINK_H */ 38#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index ee275c8b3df..1acb1445e05 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -7,24 +7,14 @@
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
8 * as published by the Free Software Foundation. 8 * as published by the Free Software Foundation.
9 */ 9 */
10
11#ifndef __HDLC_H 10#ifndef __HDLC_H
12#define __HDLC_H 11#define __HDLC_H
13 12
14 13
15#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
16#if 0
17#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
18#else
19#define HDLC_MAX_MRU 1600 /* as required for FR network */
20#endif
21
22
23#ifdef __KERNEL__
24
25#include <linux/skbuff.h> 14#include <linux/skbuff.h>
26#include <linux/netdevice.h> 15#include <linux/netdevice.h>
27#include <linux/hdlc/ioctl.h> 16#include <linux/hdlc/ioctl.h>
17#include <uapi/linux/hdlc.h>
28 18
29/* This structure is a private property of HDLC protocols. 19/* This structure is a private property of HDLC protocols.
30 Hardware drivers have no interest here */ 20 Hardware drivers have no interest here */
@@ -127,5 +117,4 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
127 return htons(ETH_P_HDLC); 117 return htons(ETH_P_HDLC);
128} 118}
129 119
130#endif /* __KERNEL */
131#endif /* __HDLC_H */ 120#endif /* __HDLC_H */
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index c010b4a785b..be3be25bb89 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -3,110 +3,14 @@
3 * The Linux soundcard driver for 1200 baud and 9600 baud packet radio 3 * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
4 * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA 4 * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
5 */ 5 */
6
7#ifndef _HDLCDRV_H 6#ifndef _HDLCDRV_H
8#define _HDLCDRV_H 7#define _HDLCDRV_H
9 8
10/* -------------------------------------------------------------------- */
11/*
12 * structs for the IOCTL commands
13 */
14
15struct hdlcdrv_params {
16 int iobase;
17 int irq;
18 int dma;
19 int dma2;
20 int seriobase;
21 int pariobase;
22 int midiiobase;
23};
24
25struct hdlcdrv_channel_params {
26 int tx_delay; /* the transmitter keyup delay in 10ms units */
27 int tx_tail; /* the transmitter keyoff delay in 10ms units */
28 int slottime; /* the slottime in 10ms; usually 10 = 100ms */
29 int ppersist; /* the p-persistence 0..255 */
30 int fulldup; /* some driver do not support full duplex, setting */
31 /* this just makes them send even if DCD is on */
32};
33
34struct hdlcdrv_old_channel_state {
35 int ptt;
36 int dcd;
37 int ptt_keyed;
38};
39
40struct hdlcdrv_channel_state {
41 int ptt;
42 int dcd;
43 int ptt_keyed;
44 unsigned long tx_packets;
45 unsigned long tx_errors;
46 unsigned long rx_packets;
47 unsigned long rx_errors;
48};
49
50struct hdlcdrv_ioctl {
51 int cmd;
52 union {
53 struct hdlcdrv_params mp;
54 struct hdlcdrv_channel_params cp;
55 struct hdlcdrv_channel_state cs;
56 struct hdlcdrv_old_channel_state ocs;
57 unsigned int calibrate;
58 unsigned char bits;
59 char modename[128];
60 char drivername[32];
61 } data;
62};
63
64/* -------------------------------------------------------------------- */
65
66/*
67 * ioctl values
68 */
69#define HDLCDRVCTL_GETMODEMPAR 0
70#define HDLCDRVCTL_SETMODEMPAR 1
71#define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
72#define HDLCDRVCTL_GETCHANNELPAR 10
73#define HDLCDRVCTL_SETCHANNELPAR 11
74#define HDLCDRVCTL_OLDGETSTAT 20
75#define HDLCDRVCTL_CALIBRATE 21
76#define HDLCDRVCTL_GETSTAT 22
77
78/*
79 * these are mainly for debugging purposes
80 */
81#define HDLCDRVCTL_GETSAMPLES 30
82#define HDLCDRVCTL_GETBITS 31
83
84/*
85 * not handled by hdlcdrv, but by its depending drivers
86 */
87#define HDLCDRVCTL_GETMODE 40
88#define HDLCDRVCTL_SETMODE 41
89#define HDLCDRVCTL_MODELIST 42
90#define HDLCDRVCTL_DRIVERNAME 43
91
92/*
93 * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
94 */
95#define HDLCDRV_PARMASK_IOBASE (1<<0)
96#define HDLCDRV_PARMASK_IRQ (1<<1)
97#define HDLCDRV_PARMASK_DMA (1<<2)
98#define HDLCDRV_PARMASK_DMA2 (1<<3)
99#define HDLCDRV_PARMASK_SERIOBASE (1<<4)
100#define HDLCDRV_PARMASK_PARIOBASE (1<<5)
101#define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
102
103/* -------------------------------------------------------------------- */
104
105#ifdef __KERNEL__
106 9
107#include <linux/netdevice.h> 10#include <linux/netdevice.h>
108#include <linux/if.h> 11#include <linux/if.h>
109#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <uapi/linux/hdlcdrv.h>
110 14
111#define HDLCDRV_MAGIC 0x5ac6e778 15#define HDLCDRV_MAGIC 0x5ac6e778
112#define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */ 16#define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */
@@ -368,10 +272,4 @@ void hdlcdrv_unregister(struct net_device *dev);
368 272
369 273
370 274
371#endif /* __KERNEL__ */
372
373/* -------------------------------------------------------------------- */
374
375#endif /* _HDLCDRV_H */ 275#endif /* _HDLCDRV_H */
376
377/* -------------------------------------------------------------------- */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 7e1f37db758..c076041a069 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1,12 +1,8 @@
1#ifndef __HID_H
2#define __HID_H
3
4/* 1/*
5 * Copyright (c) 1999 Andreas Gal 2 * Copyright (c) 1999 Andreas Gal
6 * Copyright (c) 2000-2001 Vojtech Pavlik 3 * Copyright (c) 2000-2001 Vojtech Pavlik
7 * Copyright (c) 2006-2007 Jiri Kosina 4 * Copyright (c) 2006-2007 Jiri Kosina
8 */ 5 */
9
10/* 6/*
11 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -26,43 +22,9 @@
26 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: 22 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
27 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic 23 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
28 */ 24 */
25#ifndef __HID_H
26#define __HID_H
29 27
30/*
31 * USB HID (Human Interface Device) interface class code
32 */
33
34#define USB_INTERFACE_CLASS_HID 3
35
36/*
37 * USB HID interface subclass and protocol codes
38 */
39
40#define USB_INTERFACE_SUBCLASS_BOOT 1
41#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
42#define USB_INTERFACE_PROTOCOL_MOUSE 2
43
44/*
45 * HID class requests
46 */
47
48#define HID_REQ_GET_REPORT 0x01
49#define HID_REQ_GET_IDLE 0x02
50#define HID_REQ_GET_PROTOCOL 0x03
51#define HID_REQ_SET_REPORT 0x09
52#define HID_REQ_SET_IDLE 0x0A
53#define HID_REQ_SET_PROTOCOL 0x0B
54
55/*
56 * HID class descriptor types
57 */
58
59#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
60#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
61#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
62
63#define HID_MAX_DESCRIPTOR_SIZE 4096
64
65#ifdef __KERNEL__
66 28
67#include <linux/types.h> 29#include <linux/types.h>
68#include <linux/slab.h> 30#include <linux/slab.h>
@@ -73,6 +35,7 @@
73#include <linux/input.h> 35#include <linux/input.h>
74#include <linux/semaphore.h> 36#include <linux/semaphore.h>
75#include <linux/power_supply.h> 37#include <linux/power_supply.h>
38#include <uapi/linux/hid.h>
76 39
77/* 40/*
78 * We parse each description item into this structure. Short items data 41 * We parse each description item into this structure. Short items data
@@ -943,7 +906,4 @@ do { \
943#define hid_dbg(hid, fmt, arg...) \ 906#define hid_dbg(hid, fmt, arg...) \
944 dev_dbg(&(hid)->dev, fmt, ##arg) 907 dev_dbg(&(hid)->dev, fmt, ##arg)
945 908
946#endif /* __KERNEL__ */
947
948#endif 909#endif
949
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
index a3f481a3063..a5dd8148660 100644
--- a/include/linux/hiddev.h
+++ b/include/linux/hiddev.h
@@ -1,12 +1,8 @@
1#ifndef _HIDDEV_H
2#define _HIDDEV_H
3
4/* 1/*
5 * Copyright (c) 1999-2000 Vojtech Pavlik 2 * Copyright (c) 1999-2000 Vojtech Pavlik
6 * 3 *
7 * Sponsored by SuSE 4 * Sponsored by SuSE
8 */ 5 */
9
10/* 6/*
11 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -26,190 +22,11 @@
26 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail: 22 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
27 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic 23 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
28 */ 24 */
25#ifndef _HIDDEV_H
26#define _HIDDEV_H
29 27
30#include <linux/types.h> 28#include <uapi/linux/hiddev.h>
31
32/*
33 * The event structure itself
34 */
35
36struct hiddev_event {
37 unsigned hid;
38 signed int value;
39};
40
41struct hiddev_devinfo {
42 __u32 bustype;
43 __u32 busnum;
44 __u32 devnum;
45 __u32 ifnum;
46 __s16 vendor;
47 __s16 product;
48 __s16 version;
49 __u32 num_applications;
50};
51
52struct hiddev_collection_info {
53 __u32 index;
54 __u32 type;
55 __u32 usage;
56 __u32 level;
57};
58
59#define HID_STRING_SIZE 256
60struct hiddev_string_descriptor {
61 __s32 index;
62 char value[HID_STRING_SIZE];
63};
64
65struct hiddev_report_info {
66 __u32 report_type;
67 __u32 report_id;
68 __u32 num_fields;
69};
70
71/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
72 * report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
73 * are unknown. Otherwise use a usage_ref struct filled in from a previous
74 * successful GUSAGE call to save time. To actually send a value to the
75 * device, perform a SUSAGE first, followed by a SREPORT. An INITREPORT or a
76 * GREPORT isn't necessary for a GUSAGE to return valid data.
77 */
78#define HID_REPORT_ID_UNKNOWN 0xffffffff
79#define HID_REPORT_ID_FIRST 0x00000100
80#define HID_REPORT_ID_NEXT 0x00000200
81#define HID_REPORT_ID_MASK 0x000000ff
82#define HID_REPORT_ID_MAX 0x000000ff
83
84#define HID_REPORT_TYPE_INPUT 1
85#define HID_REPORT_TYPE_OUTPUT 2
86#define HID_REPORT_TYPE_FEATURE 3
87#define HID_REPORT_TYPE_MIN 1
88#define HID_REPORT_TYPE_MAX 3
89
90struct hiddev_field_info {
91 __u32 report_type;
92 __u32 report_id;
93 __u32 field_index;
94 __u32 maxusage;
95 __u32 flags;
96 __u32 physical; /* physical usage for this field */
97 __u32 logical; /* logical usage for this field */
98 __u32 application; /* application usage for this field */
99 __s32 logical_minimum;
100 __s32 logical_maximum;
101 __s32 physical_minimum;
102 __s32 physical_maximum;
103 __u32 unit_exponent;
104 __u32 unit;
105};
106
107/* Fill in report_type, report_id and field_index to get the information on a
108 * field.
109 */
110#define HID_FIELD_CONSTANT 0x001
111#define HID_FIELD_VARIABLE 0x002
112#define HID_FIELD_RELATIVE 0x004
113#define HID_FIELD_WRAP 0x008
114#define HID_FIELD_NONLINEAR 0x010
115#define HID_FIELD_NO_PREFERRED 0x020
116#define HID_FIELD_NULL_STATE 0x040
117#define HID_FIELD_VOLATILE 0x080
118#define HID_FIELD_BUFFERED_BYTE 0x100
119
120struct hiddev_usage_ref {
121 __u32 report_type;
122 __u32 report_id;
123 __u32 field_index;
124 __u32 usage_index;
125 __u32 usage_code;
126 __s32 value;
127};
128
129/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
130 * It really manifests itself as setting the value of consecutive usages */
131#define HID_MAX_MULTI_USAGES 1024
132struct hiddev_usage_ref_multi {
133 struct hiddev_usage_ref uref;
134 __u32 num_values;
135 __s32 values[HID_MAX_MULTI_USAGES];
136};
137
138/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
139 * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
140 * been sent by the device
141 */
142#define HID_FIELD_INDEX_NONE 0xffffffff
143
144/*
145 * Protocol version.
146 */
147
148#define HID_VERSION 0x010004
149
150/*
151 * IOCTLs (0x00 - 0x7f)
152 */
153
154#define HIDIOCGVERSION _IOR('H', 0x01, int)
155#define HIDIOCAPPLICATION _IO('H', 0x02)
156#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
157#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
158#define HIDIOCINITREPORT _IO('H', 0x05)
159#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
160#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
161#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
162#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
163#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
164#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
165#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
166#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
167#define HIDIOCGFLAG _IOR('H', 0x0E, int)
168#define HIDIOCSFLAG _IOW('H', 0x0F, int)
169#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
170#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
171#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
172
173/* For writing/reading to multiple/consecutive usages */
174#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
175#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
176
177/*
178 * Flags to be used in HIDIOCSFLAG
179 */
180#define HIDDEV_FLAG_UREF 0x1
181#define HIDDEV_FLAG_REPORT 0x2
182#define HIDDEV_FLAGS 0x3
183
184/* To traverse the input report descriptor info for a HID device, perform the
185 * following:
186 *
187 * rinfo.report_type = HID_REPORT_TYPE_INPUT;
188 * rinfo.report_id = HID_REPORT_ID_FIRST;
189 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
190 *
191 * while (ret >= 0) {
192 * for (i = 0; i < rinfo.num_fields; i++) {
193 * finfo.report_type = rinfo.report_type;
194 * finfo.report_id = rinfo.report_id;
195 * finfo.field_index = i;
196 * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
197 * for (j = 0; j < finfo.maxusage; j++) {
198 * uref.report_type = rinfo.report_type;
199 * uref.report_id = rinfo.report_id;
200 * uref.field_index = i;
201 * uref.usage_index = j;
202 * ioctl(fd, HIDIOCGUCODE, &uref);
203 * ioctl(fd, HIDIOCGUSAGE, &uref);
204 * }
205 * }
206 * rinfo.report_id |= HID_REPORT_ID_NEXT;
207 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
208 * }
209 */
210
211 29
212#ifdef __KERNEL__
213 30
214/* 31/*
215 * In-kernel definitions. 32 * In-kernel definitions.
@@ -237,4 +54,3 @@ static inline void hiddev_report_event(struct hid_device *hid, struct hid_report
237#endif 54#endif
238 55
239#endif 56#endif
240#endif
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 45e9fcb8d87..2451662c728 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -1,10 +1,6 @@
1#ifndef _HIDRAW_H
2#define _HIDRAW_H
3
4/* 1/*
5 * Copyright (c) 2007 Jiri Kosina 2 * Copyright (c) 2007 Jiri Kosina
6 */ 3 */
7
8/* 4/*
9 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License, 6 * under the terms and conditions of the GNU General Public License,
@@ -14,39 +10,11 @@
14 * this program; if not, write to the Free Software Foundation, Inc., 10 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 11 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 */ 12 */
13#ifndef _HIDRAW_H
14#define _HIDRAW_H
17 15
18#include <linux/hid.h> 16#include <uapi/linux/hidraw.h>
19#include <linux/types.h>
20
21struct hidraw_report_descriptor {
22 __u32 size;
23 __u8 value[HID_MAX_DESCRIPTOR_SIZE];
24};
25
26struct hidraw_devinfo {
27 __u32 bustype;
28 __s16 vendor;
29 __s16 product;
30};
31
32/* ioctl interface */
33#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
34#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
35#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
36#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
37#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
38/* The first byte of SFEATURE and GFEATURE is the report number */
39#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
40#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
41
42#define HIDRAW_FIRST_MINOR 0
43#define HIDRAW_MAX_DEVICES 64
44/* number of reports to buffer */
45#define HIDRAW_BUFFER_SIZE 64
46
47 17
48/* kernel-only API declarations */
49#ifdef __KERNEL__
50 18
51struct hidraw { 19struct hidraw {
52 unsigned int minor; 20 unsigned int minor;
@@ -88,5 +56,3 @@ static inline void hidraw_disconnect(struct hid_device *hid) { }
88#endif 56#endif
89 57
90#endif 58#endif
91
92#endif
diff --git a/include/linux/hpet.h b/include/linux/hpet.h
index 219ca4f6bea..9427ab4e01c 100644
--- a/include/linux/hpet.h
+++ b/include/linux/hpet.h
@@ -1,9 +1,8 @@
1#ifndef __HPET__ 1#ifndef __HPET__
2#define __HPET__ 1 2#define __HPET__ 1
3 3
4#include <linux/compiler.h> 4#include <uapi/linux/hpet.h>
5 5
6#ifdef __KERNEL__
7 6
8/* 7/*
9 * Offsets into HPET Registers 8 * Offsets into HPET Registers
@@ -108,24 +107,4 @@ static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
108 107
109int hpet_alloc(struct hpet_data *); 108int hpet_alloc(struct hpet_data *);
110 109
111#endif /* __KERNEL__ */
112
113struct hpet_info {
114 unsigned long hi_ireqfreq; /* Hz */
115 unsigned long hi_flags; /* information */
116 unsigned short hi_hpet;
117 unsigned short hi_timer;
118};
119
120#define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */
121
122#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
123#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
124#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
125#define HPET_EPI _IO('h', 0x04) /* enable periodic */
126#define HPET_DPI _IO('h', 0x05) /* disable periodic */
127#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
128
129#define MAX_HPET_TBS 8 /* maximum hpet timer blocks */
130
131#endif /* !__HPET__ */ 110#endif /* !__HPET__ */
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 8a7406b2114..79727144c5c 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -19,57 +19,10 @@
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 MA 02110-1301 USA. 20 MA 02110-1301 USA.
21*/ 21*/
22
23#ifndef _LINUX_I2C_DEV_H 22#ifndef _LINUX_I2C_DEV_H
24#define _LINUX_I2C_DEV_H 23#define _LINUX_I2C_DEV_H
25 24
26#include <linux/types.h> 25#include <uapi/linux/i2c-dev.h>
27#include <linux/compiler.h>
28
29/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
30 * unsigned long, except for:
31 * - I2C_FUNCS, takes pointer to an unsigned long
32 * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
33 * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
34 */
35#define I2C_RETRIES 0x0701 /* number of times a device address should
36 be polled when not acknowledging */
37#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
38
39/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
40 * are NOT supported! (due to code brokenness)
41 */
42#define I2C_SLAVE 0x0703 /* Use this slave address */
43#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
44 is already in use by a driver! */
45#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
46
47#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
48
49#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
50
51#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
52#define I2C_SMBUS 0x0720 /* SMBus transfer */
53 26
54
55/* This is the structure as used in the I2C_SMBUS ioctl call */
56struct i2c_smbus_ioctl_data {
57 __u8 read_write;
58 __u8 command;
59 __u32 size;
60 union i2c_smbus_data __user *data;
61};
62
63/* This is the structure as used in the I2C_RDWR ioctl call */
64struct i2c_rdwr_ioctl_data {
65 struct i2c_msg __user *msgs; /* pointers to i2c_msgs */
66 __u32 nmsgs; /* number of i2c_msgs */
67};
68
69#define I2C_RDRW_IOCTL_MAX_MSGS 42
70
71#ifdef __KERNEL__
72#define I2C_MAJOR 89 /* Device major number */ 27#define I2C_MAJOR 89 /* Device major number */
73#endif
74
75#endif /* _LINUX_I2C_DEV_H */ 28#endif /* _LINUX_I2C_DEV_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 94aed0c85bb..800de224336 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -23,18 +23,16 @@
23 23
24/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 24/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
25 Frodo Looijaard <frodol@dds.nl> */ 25 Frodo Looijaard <frodol@dds.nl> */
26
27#ifndef _LINUX_I2C_H 26#ifndef _LINUX_I2C_H
28#define _LINUX_I2C_H 27#define _LINUX_I2C_H
29 28
30#include <linux/types.h>
31#ifdef __KERNEL__
32#include <linux/mod_devicetable.h> 29#include <linux/mod_devicetable.h>
33#include <linux/device.h> /* for struct device */ 30#include <linux/device.h> /* for struct device */
34#include <linux/sched.h> /* for completion */ 31#include <linux/sched.h> /* for completion */
35#include <linux/mutex.h> 32#include <linux/mutex.h>
36#include <linux/of.h> /* for struct device_node */ 33#include <linux/of.h> /* for struct device_node */
37#include <linux/swab.h> /* for swab16 */ 34#include <linux/swab.h> /* for swab16 */
35#include <uapi/linux/i2c.h>
38 36
39extern struct bus_type i2c_bus_type; 37extern struct bus_type i2c_bus_type;
40extern struct device_type i2c_adapter_type; 38extern struct device_type i2c_adapter_type;
@@ -503,125 +501,4 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
503 i2c_del_driver) 501 i2c_del_driver)
504 502
505#endif /* I2C */ 503#endif /* I2C */
506#endif /* __KERNEL__ */
507
508/**
509 * struct i2c_msg - an I2C transaction segment beginning with START
510 * @addr: Slave address, either seven or ten bits. When this is a ten
511 * bit address, I2C_M_TEN must be set in @flags and the adapter
512 * must support I2C_FUNC_10BIT_ADDR.
513 * @flags: I2C_M_RD is handled by all adapters. No other flags may be
514 * provided unless the adapter exported the relevant I2C_FUNC_*
515 * flags through i2c_check_functionality().
516 * @len: Number of data bytes in @buf being read from or written to the
517 * I2C slave address. For read transactions where I2C_M_RECV_LEN
518 * is set, the caller guarantees that this buffer can hold up to
519 * 32 bytes in addition to the initial length byte sent by the
520 * slave (plus, if used, the SMBus PEC); and this value will be
521 * incremented by the number of block data bytes received.
522 * @buf: The buffer into which data is read, or from which it's written.
523 *
524 * An i2c_msg is the low level representation of one segment of an I2C
525 * transaction. It is visible to drivers in the @i2c_transfer() procedure,
526 * to userspace from i2c-dev, and to I2C adapter drivers through the
527 * @i2c_adapter.@master_xfer() method.
528 *
529 * Except when I2C "protocol mangling" is used, all I2C adapters implement
530 * the standard rules for I2C transactions. Each transaction begins with a
531 * START. That is followed by the slave address, and a bit encoding read
532 * versus write. Then follow all the data bytes, possibly including a byte
533 * with SMBus PEC. The transfer terminates with a NAK, or when all those
534 * bytes have been transferred and ACKed. If this is the last message in a
535 * group, it is followed by a STOP. Otherwise it is followed by the next
536 * @i2c_msg transaction segment, beginning with a (repeated) START.
537 *
538 * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
539 * passing certain @flags may have changed those standard protocol behaviors.
540 * Those flags are only for use with broken/nonconforming slaves, and with
541 * adapters which are known to support the specific mangling options they
542 * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
543 */
544struct i2c_msg {
545 __u16 addr; /* slave address */
546 __u16 flags;
547#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
548#define I2C_M_RD 0x0001 /* read data, from slave to master */
549#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
550#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
551#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
552#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
553#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
554#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
555 __u16 len; /* msg length */
556 __u8 *buf; /* pointer to msg data */
557};
558
559/* To determine what functionality is present */
560
561#define I2C_FUNC_I2C 0x00000001
562#define I2C_FUNC_10BIT_ADDR 0x00000002
563#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_IGNORE_NAK etc. */
564#define I2C_FUNC_SMBUS_PEC 0x00000008
565#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
566#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
567#define I2C_FUNC_SMBUS_QUICK 0x00010000
568#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
569#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
570#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
571#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
572#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
573#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
574#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
575#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
576#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
577#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
578#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
579
580#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
581 I2C_FUNC_SMBUS_WRITE_BYTE)
582#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
583 I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
584#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
585 I2C_FUNC_SMBUS_WRITE_WORD_DATA)
586#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
587 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
588#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
589 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
590
591#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
592 I2C_FUNC_SMBUS_BYTE | \
593 I2C_FUNC_SMBUS_BYTE_DATA | \
594 I2C_FUNC_SMBUS_WORD_DATA | \
595 I2C_FUNC_SMBUS_PROC_CALL | \
596 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
597 I2C_FUNC_SMBUS_I2C_BLOCK | \
598 I2C_FUNC_SMBUS_PEC)
599
600/*
601 * Data for SMBus Messages
602 */
603#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
604union i2c_smbus_data {
605 __u8 byte;
606 __u16 word;
607 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
608 /* and one more for user-space compatibility */
609};
610
611/* i2c_smbus_xfer read or write markers */
612#define I2C_SMBUS_READ 1
613#define I2C_SMBUS_WRITE 0
614
615/* SMBus transaction types (size parameter in the above functions)
616 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
617#define I2C_SMBUS_QUICK 0
618#define I2C_SMBUS_BYTE 1
619#define I2C_SMBUS_BYTE_DATA 2
620#define I2C_SMBUS_WORD_DATA 3
621#define I2C_SMBUS_PROC_CALL 4
622#define I2C_SMBUS_BLOCK_DATA 5
623#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
624#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
625#define I2C_SMBUS_I2C_BLOCK_DATA 8
626
627#endif /* _LINUX_I2C_H */ 504#endif /* _LINUX_I2C_H */
diff --git a/include/linux/icmp.h b/include/linux/icmp.h
index 474f2a51cf0..efc18490627 100644
--- a/include/linux/icmp.h
+++ b/include/linux/icmp.h
@@ -17,89 +17,11 @@
17#ifndef _LINUX_ICMP_H 17#ifndef _LINUX_ICMP_H
18#define _LINUX_ICMP_H 18#define _LINUX_ICMP_H
19 19
20#include <linux/types.h>
21
22#define ICMP_ECHOREPLY 0 /* Echo Reply */
23#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
24#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
25#define ICMP_REDIRECT 5 /* Redirect (change route) */
26#define ICMP_ECHO 8 /* Echo Request */
27#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
28#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
29#define ICMP_TIMESTAMP 13 /* Timestamp Request */
30#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
31#define ICMP_INFO_REQUEST 15 /* Information Request */
32#define ICMP_INFO_REPLY 16 /* Information Reply */
33#define ICMP_ADDRESS 17 /* Address Mask Request */
34#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
35#define NR_ICMP_TYPES 18
36
37
38/* Codes for UNREACH. */
39#define ICMP_NET_UNREACH 0 /* Network Unreachable */
40#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
41#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
42#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
43#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
44#define ICMP_SR_FAILED 5 /* Source Route failed */
45#define ICMP_NET_UNKNOWN 6
46#define ICMP_HOST_UNKNOWN 7
47#define ICMP_HOST_ISOLATED 8
48#define ICMP_NET_ANO 9
49#define ICMP_HOST_ANO 10
50#define ICMP_NET_UNR_TOS 11
51#define ICMP_HOST_UNR_TOS 12
52#define ICMP_PKT_FILTERED 13 /* Packet filtered */
53#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
54#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
55#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
56
57/* Codes for REDIRECT. */
58#define ICMP_REDIR_NET 0 /* Redirect Net */
59#define ICMP_REDIR_HOST 1 /* Redirect Host */
60#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
61#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
62
63/* Codes for TIME_EXCEEDED. */
64#define ICMP_EXC_TTL 0 /* TTL count exceeded */
65#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
66
67
68struct icmphdr {
69 __u8 type;
70 __u8 code;
71 __sum16 checksum;
72 union {
73 struct {
74 __be16 id;
75 __be16 sequence;
76 } echo;
77 __be32 gateway;
78 struct {
79 __be16 __unused;
80 __be16 mtu;
81 } frag;
82 } un;
83};
84
85#ifdef __KERNEL__
86#include <linux/skbuff.h> 20#include <linux/skbuff.h>
21#include <uapi/linux/icmp.h>
87 22
88static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) 23static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
89{ 24{
90 return (struct icmphdr *)skb_transport_header(skb); 25 return (struct icmphdr *)skb_transport_header(skb);
91} 26}
92#endif
93
94/*
95 * constants for (set|get)sockopt
96 */
97
98#define ICMP_FILTER 1
99
100struct icmp_filter {
101 __u32 data;
102};
103
104
105#endif /* _LINUX_ICMP_H */ 27#endif /* _LINUX_ICMP_H */
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index ba45e6bc076..b4f6c29cace 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -1,174 +1,13 @@
1#ifndef _LINUX_ICMPV6_H 1#ifndef _LINUX_ICMPV6_H
2#define _LINUX_ICMPV6_H 2#define _LINUX_ICMPV6_H
3 3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7struct icmp6hdr {
8
9 __u8 icmp6_type;
10 __u8 icmp6_code;
11 __sum16 icmp6_cksum;
12
13
14 union {
15 __be32 un_data32[1];
16 __be16 un_data16[2];
17 __u8 un_data8[4];
18
19 struct icmpv6_echo {
20 __be16 identifier;
21 __be16 sequence;
22 } u_echo;
23
24 struct icmpv6_nd_advt {
25#if defined(__LITTLE_ENDIAN_BITFIELD)
26 __u32 reserved:5,
27 override:1,
28 solicited:1,
29 router:1,
30 reserved2:24;
31#elif defined(__BIG_ENDIAN_BITFIELD)
32 __u32 router:1,
33 solicited:1,
34 override:1,
35 reserved:29;
36#else
37#error "Please fix <asm/byteorder.h>"
38#endif
39 } u_nd_advt;
40
41 struct icmpv6_nd_ra {
42 __u8 hop_limit;
43#if defined(__LITTLE_ENDIAN_BITFIELD)
44 __u8 reserved:3,
45 router_pref:2,
46 home_agent:1,
47 other:1,
48 managed:1;
49
50#elif defined(__BIG_ENDIAN_BITFIELD)
51 __u8 managed:1,
52 other:1,
53 home_agent:1,
54 router_pref:2,
55 reserved:3;
56#else
57#error "Please fix <asm/byteorder.h>"
58#endif
59 __be16 rt_lifetime;
60 } u_nd_ra;
61
62 } icmp6_dataun;
63
64#define icmp6_identifier icmp6_dataun.u_echo.identifier
65#define icmp6_sequence icmp6_dataun.u_echo.sequence
66#define icmp6_pointer icmp6_dataun.un_data32[0]
67#define icmp6_mtu icmp6_dataun.un_data32[0]
68#define icmp6_unused icmp6_dataun.un_data32[0]
69#define icmp6_maxdelay icmp6_dataun.un_data16[0]
70#define icmp6_router icmp6_dataun.u_nd_advt.router
71#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
72#define icmp6_override icmp6_dataun.u_nd_advt.override
73#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
74#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
75#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
76#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
77#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
78#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
79};
80
81#ifdef __KERNEL__
82#include <linux/skbuff.h> 4#include <linux/skbuff.h>
5#include <uapi/linux/icmpv6.h>
83 6
84static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) 7static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
85{ 8{
86 return (struct icmp6hdr *)skb_transport_header(skb); 9 return (struct icmp6hdr *)skb_transport_header(skb);
87} 10}
88#endif
89
90#define ICMPV6_ROUTER_PREF_LOW 0x3
91#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
92#define ICMPV6_ROUTER_PREF_HIGH 0x1
93#define ICMPV6_ROUTER_PREF_INVALID 0x2
94
95#define ICMPV6_DEST_UNREACH 1
96#define ICMPV6_PKT_TOOBIG 2
97#define ICMPV6_TIME_EXCEED 3
98#define ICMPV6_PARAMPROB 4
99
100#define ICMPV6_INFOMSG_MASK 0x80
101
102#define ICMPV6_ECHO_REQUEST 128
103#define ICMPV6_ECHO_REPLY 129
104#define ICMPV6_MGM_QUERY 130
105#define ICMPV6_MGM_REPORT 131
106#define ICMPV6_MGM_REDUCTION 132
107
108#define ICMPV6_NI_QUERY 139
109#define ICMPV6_NI_REPLY 140
110
111#define ICMPV6_MLD2_REPORT 143
112
113#define ICMPV6_DHAAD_REQUEST 144
114#define ICMPV6_DHAAD_REPLY 145
115#define ICMPV6_MOBILE_PREFIX_SOL 146
116#define ICMPV6_MOBILE_PREFIX_ADV 147
117
118/*
119 * Codes for Destination Unreachable
120 */
121#define ICMPV6_NOROUTE 0
122#define ICMPV6_ADM_PROHIBITED 1
123#define ICMPV6_NOT_NEIGHBOUR 2
124#define ICMPV6_ADDR_UNREACH 3
125#define ICMPV6_PORT_UNREACH 4
126
127/*
128 * Codes for Time Exceeded
129 */
130#define ICMPV6_EXC_HOPLIMIT 0
131#define ICMPV6_EXC_FRAGTIME 1
132
133/*
134 * Codes for Parameter Problem
135 */
136#define ICMPV6_HDR_FIELD 0
137#define ICMPV6_UNK_NEXTHDR 1
138#define ICMPV6_UNK_OPTION 2
139
140/*
141 * constants for (set|get)sockopt
142 */
143
144#define ICMPV6_FILTER 1
145
146/*
147 * ICMPV6 filter
148 */
149
150#define ICMPV6_FILTER_BLOCK 1
151#define ICMPV6_FILTER_PASS 2
152#define ICMPV6_FILTER_BLOCKOTHERS 3
153#define ICMPV6_FILTER_PASSONLY 4
154
155struct icmp6_filter {
156 __u32 data[8];
157};
158
159/*
160 * Definitions for MLDv2
161 */
162#define MLD2_MODE_IS_INCLUDE 1
163#define MLD2_MODE_IS_EXCLUDE 2
164#define MLD2_CHANGE_TO_INCLUDE 3
165#define MLD2_CHANGE_TO_EXCLUDE 4
166#define MLD2_ALLOW_NEW_SOURCES 5
167#define MLD2_BLOCK_OLD_SOURCES 6
168
169#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
170
171#ifdef __KERNEL__
172 11
173#include <linux/netdevice.h> 12#include <linux/netdevice.h>
174 13
@@ -192,5 +31,3 @@ extern void icmpv6_flow_init(struct sock *sk,
192 const struct in6_addr *daddr, 31 const struct in6_addr *daddr,
193 int oif); 32 int oif);
194#endif 33#endif
195
196#endif
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 9adcc29f084..89b4614a472 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -23,140 +23,8 @@
23#ifndef _LINUX_IF_ARP_H 23#ifndef _LINUX_IF_ARP_H
24#define _LINUX_IF_ARP_H 24#define _LINUX_IF_ARP_H
25 25
26#include <linux/netdevice.h>
27
28/* ARP protocol HARDWARE identifiers. */
29#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
30#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
31#define ARPHRD_EETHER 2 /* Experimental Ethernet */
32#define ARPHRD_AX25 3 /* AX.25 Level 2 */
33#define ARPHRD_PRONET 4 /* PROnet token ring */
34#define ARPHRD_CHAOS 5 /* Chaosnet */
35#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
36#define ARPHRD_ARCNET 7 /* ARCnet */
37#define ARPHRD_APPLETLK 8 /* APPLEtalk */
38#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
39#define ARPHRD_ATM 19 /* ATM */
40#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
41#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
42#define ARPHRD_EUI64 27 /* EUI-64 */
43#define ARPHRD_INFINIBAND 32 /* InfiniBand */
44
45/* Dummy types for non ARP hardware */
46#define ARPHRD_SLIP 256
47#define ARPHRD_CSLIP 257
48#define ARPHRD_SLIP6 258
49#define ARPHRD_CSLIP6 259
50#define ARPHRD_RSRVD 260 /* Notional KISS type */
51#define ARPHRD_ADAPT 264
52#define ARPHRD_ROSE 270
53#define ARPHRD_X25 271 /* CCITT X.25 */
54#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
55#define ARPHRD_CAN 280 /* Controller Area Network */
56#define ARPHRD_PPP 512
57#define ARPHRD_CISCO 513 /* Cisco HDLC */
58#define ARPHRD_HDLC ARPHRD_CISCO
59#define ARPHRD_LAPB 516 /* LAPB */
60#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
61#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
62
63#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
64#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
65#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
66#define ARPHRD_SKIP 771 /* SKIP vif */
67#define ARPHRD_LOOPBACK 772 /* Loopback device */
68#define ARPHRD_LOCALTLK 773 /* Localtalk device */
69#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
70#define ARPHRD_BIF 775 /* AP1000 BIF */
71#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
72#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
73#define ARPHRD_IPGRE 778 /* GRE over IP */
74#define ARPHRD_PIMREG 779 /* PIMSM register interface */
75#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
76#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
77#define ARPHRD_ECONET 782 /* Acorn Econet */
78#define ARPHRD_IRDA 783 /* Linux-IrDA */
79/* ARP works differently on different FC media .. so */
80#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
81#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
82#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
83#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
84 /* 787->799 reserved for fibrechannel media types */
85#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
86#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
87#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
88#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
89#define ARPHRD_IEEE802154 804
90#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */
91
92#define ARPHRD_PHONET 820 /* PhoNet media type */
93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
94#define ARPHRD_CAIF 822 /* CAIF media type */
95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
96
97#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
98#define ARPHRD_NONE 0xFFFE /* zero header length */
99
100/* ARP protocol opcodes. */
101#define ARPOP_REQUEST 1 /* ARP request */
102#define ARPOP_REPLY 2 /* ARP reply */
103#define ARPOP_RREQUEST 3 /* RARP request */
104#define ARPOP_RREPLY 4 /* RARP reply */
105#define ARPOP_InREQUEST 8 /* InARP request */
106#define ARPOP_InREPLY 9 /* InARP reply */
107#define ARPOP_NAK 10 /* (ATM)ARP NAK */
108
109
110/* ARP ioctl request. */
111struct arpreq {
112 struct sockaddr arp_pa; /* protocol address */
113 struct sockaddr arp_ha; /* hardware address */
114 int arp_flags; /* flags */
115 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
116 char arp_dev[16];
117};
118
119struct arpreq_old {
120 struct sockaddr arp_pa; /* protocol address */
121 struct sockaddr arp_ha; /* hardware address */
122 int arp_flags; /* flags */
123 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
124};
125
126/* ARP Flag values. */
127#define ATF_COM 0x02 /* completed entry (ha valid) */
128#define ATF_PERM 0x04 /* permanent entry */
129#define ATF_PUBL 0x08 /* publish entry */
130#define ATF_USETRAILERS 0x10 /* has requested trailers */
131#define ATF_NETMASK 0x20 /* want to use a netmask (only
132 for proxy entries) */
133#define ATF_DONTPUB 0x40 /* don't answer this addresses */
134
135/*
136 * This structure defines an ethernet arp header.
137 */
138
139struct arphdr {
140 __be16 ar_hrd; /* format of hardware address */
141 __be16 ar_pro; /* format of protocol address */
142 unsigned char ar_hln; /* length of hardware address */
143 unsigned char ar_pln; /* length of protocol address */
144 __be16 ar_op; /* ARP opcode (command) */
145
146#if 0
147 /*
148 * Ethernet looks like this : This bit is variable sized however...
149 */
150 unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
151 unsigned char ar_sip[4]; /* sender IP address */
152 unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
153 unsigned char ar_tip[4]; /* target IP address */
154#endif
155
156};
157
158#ifdef __KERNEL__
159#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <uapi/linux/if_arp.h>
160 28
161static inline struct arphdr *arp_hdr(const struct sk_buff *skb) 29static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
162{ 30{
@@ -168,6 +36,4 @@ static inline int arp_hdr_len(struct net_device *dev)
168 /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ 36 /* ARP header, plus 2 device addresses, plus 2 IP addresses. */
169 return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2; 37 return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
170} 38}
171#endif
172
173#endif /* _LINUX_IF_ARP_H */ 39#endif /* _LINUX_IF_ARP_H */
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index dd3f2013964..1085ffeef95 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -9,97 +9,12 @@
9 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12
13#ifndef _LINUX_IF_BRIDGE_H 12#ifndef _LINUX_IF_BRIDGE_H
14#define _LINUX_IF_BRIDGE_H 13#define _LINUX_IF_BRIDGE_H
15 14
16#include <linux/types.h>
17
18#define SYSFS_BRIDGE_ATTR "bridge"
19#define SYSFS_BRIDGE_FDB "brforward"
20#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
21#define SYSFS_BRIDGE_PORT_ATTR "brport"
22#define SYSFS_BRIDGE_PORT_LINK "bridge"
23
24#define BRCTL_VERSION 1
25
26#define BRCTL_GET_VERSION 0
27#define BRCTL_GET_BRIDGES 1
28#define BRCTL_ADD_BRIDGE 2
29#define BRCTL_DEL_BRIDGE 3
30#define BRCTL_ADD_IF 4
31#define BRCTL_DEL_IF 5
32#define BRCTL_GET_BRIDGE_INFO 6
33#define BRCTL_GET_PORT_LIST 7
34#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
35#define BRCTL_SET_BRIDGE_HELLO_TIME 9
36#define BRCTL_SET_BRIDGE_MAX_AGE 10
37#define BRCTL_SET_AGEING_TIME 11
38#define BRCTL_SET_GC_INTERVAL 12
39#define BRCTL_GET_PORT_INFO 13
40#define BRCTL_SET_BRIDGE_STP_STATE 14
41#define BRCTL_SET_BRIDGE_PRIORITY 15
42#define BRCTL_SET_PORT_PRIORITY 16
43#define BRCTL_SET_PATH_COST 17
44#define BRCTL_GET_FDB_ENTRIES 18
45
46#define BR_STATE_DISABLED 0
47#define BR_STATE_LISTENING 1
48#define BR_STATE_LEARNING 2
49#define BR_STATE_FORWARDING 3
50#define BR_STATE_BLOCKING 4
51
52struct __bridge_info {
53 __u64 designated_root;
54 __u64 bridge_id;
55 __u32 root_path_cost;
56 __u32 max_age;
57 __u32 hello_time;
58 __u32 forward_delay;
59 __u32 bridge_max_age;
60 __u32 bridge_hello_time;
61 __u32 bridge_forward_delay;
62 __u8 topology_change;
63 __u8 topology_change_detected;
64 __u8 root_port;
65 __u8 stp_enabled;
66 __u32 ageing_time;
67 __u32 gc_interval;
68 __u32 hello_timer_value;
69 __u32 tcn_timer_value;
70 __u32 topology_change_timer_value;
71 __u32 gc_timer_value;
72};
73
74struct __port_info {
75 __u64 designated_root;
76 __u64 designated_bridge;
77 __u16 port_id;
78 __u16 designated_port;
79 __u32 path_cost;
80 __u32 designated_cost;
81 __u8 state;
82 __u8 top_change_ack;
83 __u8 config_pending;
84 __u8 unused0;
85 __u32 message_age_timer_value;
86 __u32 forward_delay_timer_value;
87 __u32 hold_timer_value;
88};
89
90struct __fdb_entry {
91 __u8 mac_addr[6];
92 __u8 port_no;
93 __u8 is_local;
94 __u32 ageing_timer_value;
95 __u8 port_hi;
96 __u8 pad0;
97 __u16 unused;
98};
99
100#ifdef __KERNEL__
101 15
102#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <uapi/linux/if_bridge.h>
103 18
104extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 19extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
105 20
@@ -107,5 +22,3 @@ typedef int br_should_route_hook_t(struct sk_buff *skb);
107extern br_should_route_hook_t __rcu *br_should_route_hook; 22extern br_should_route_hook_t __rcu *br_should_route_hook;
108 23
109#endif 24#endif
110
111#endif
diff --git a/include/linux/if_eql.h b/include/linux/if_eql.h
index 18a5d02a864..d984694c384 100644
--- a/include/linux/if_eql.h
+++ b/include/linux/if_eql.h
@@ -15,28 +15,13 @@
15 * McLean VA 22101 15 * McLean VA 22101
16 * Phone: 1-703-847-0040 ext 103 16 * Phone: 1-703-847-0040 ext 103
17 */ 17 */
18
19#ifndef _LINUX_IF_EQL_H 18#ifndef _LINUX_IF_EQL_H
20#define _LINUX_IF_EQL_H 19#define _LINUX_IF_EQL_H
21 20
22#define EQL_DEFAULT_SLAVE_PRIORITY 28800
23#define EQL_DEFAULT_MAX_SLAVES 4
24#define EQL_DEFAULT_MTU 576
25#define EQL_DEFAULT_RESCHED_IVAL HZ
26
27#define EQL_ENSLAVE (SIOCDEVPRIVATE)
28#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)
29
30#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
31#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
32
33#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
34#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
35
36#ifdef __KERNEL__
37 21
38#include <linux/timer.h> 22#include <linux/timer.h>
39#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <uapi/linux/if_eql.h>
40 25
41typedef struct slave { 26typedef struct slave {
42 struct list_head list; 27 struct list_head list;
@@ -61,23 +46,4 @@ typedef struct equalizer {
61 struct timer_list timer; 46 struct timer_list timer;
62} equalizer_t; 47} equalizer_t;
63 48
64#endif /* __KERNEL__ */
65
66typedef struct master_config {
67 char master_name[16];
68 int max_slaves;
69 int min_slaves;
70} master_config_t;
71
72typedef struct slave_config {
73 char slave_name[16];
74 long priority;
75} slave_config_t;
76
77typedef struct slaving_request {
78 char slave_name[16];
79 long priority;
80} slaving_request_t;
81
82
83#endif /* _LINUX_EQL_H */ 49#endif /* _LINUX_EQL_H */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 167ce5b363d..12b4d55a02a 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -17,122 +17,11 @@
17 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20
21#ifndef _LINUX_IF_ETHER_H 20#ifndef _LINUX_IF_ETHER_H
22#define _LINUX_IF_ETHER_H 21#define _LINUX_IF_ETHER_H
23 22
24#include <linux/types.h>
25
26/*
27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
28 * and FCS/CRC (frame check sequence).
29 */
30
31#define ETH_ALEN 6 /* Octets in one ethernet addr */
32#define ETH_HLEN 14 /* Total octets in header. */
33#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
34#define ETH_DATA_LEN 1500 /* Max. octets in payload */
35#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
36#define ETH_FCS_LEN 4 /* Octets in the FCS */
37
38/*
39 * These are the defined Ethernet Protocol ID's.
40 */
41
42#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
43#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
44#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
45#define ETH_P_IP 0x0800 /* Internet Protocol packet */
46#define ETH_P_X25 0x0805 /* CCITT X.25 */
47#define ETH_P_ARP 0x0806 /* Address Resolution packet */
48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
51#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
52#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
53#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
54#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
55#define ETH_P_LAT 0x6004 /* DEC LAT */
56#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
57#define ETH_P_CUST 0x6006 /* DEC Customer use */
58#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
59#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
60#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
61#define ETH_P_ATALK 0x809B /* Appletalk DDP */
62#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
63#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
64#define ETH_P_IPX 0x8137 /* IPX over DIX */
65#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
66#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
67#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
68#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
69 * defined in draft-wilson-wrec-wccp-v2-00.txt */
70#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
71#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
72#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
73#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
74#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
75#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
76#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
77 * over Ethernet
78 */
79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
81#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
82#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
83#define ETH_P_TIPC 0x88CA /* TIPC */
84#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
85#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
86#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
87#define ETH_P_TDLS 0x890D /* TDLS */
88#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
89#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
90#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
91#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
92#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
93#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
94
95/*
96 * Non DIX types. Won't clash for 1500 types.
97 */
98
99#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
100#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
101#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
102#define ETH_P_802_2 0x0004 /* 802.2 frames */
103#define ETH_P_SNAP 0x0005 /* Internal only */
104#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
108#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
109#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
110#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
111#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
112#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
113#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
114#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
115#define ETH_P_ECONET 0x0018 /* Acorn Econet */
116#define ETH_P_HDLC 0x0019 /* HDLC frames */
117#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
118#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
119#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
120#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
121#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
122#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
123
124/*
125 * This is an Ethernet frame header.
126 */
127
128struct ethhdr {
129 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
130 unsigned char h_source[ETH_ALEN]; /* source ether addr */
131 __be16 h_proto; /* packet type ID field */
132} __attribute__((packed));
133
134#ifdef __KERNEL__
135#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <uapi/linux/if_ether.h>
136 25
137static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) 26static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
138{ 27{
@@ -144,6 +33,4 @@ int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
144int mac_pton(const char *s, u8 *mac); 33int mac_pton(const char *s, u8 *mac);
145extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 34extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
146 35
147#endif
148
149#endif /* _LINUX_IF_ETHER_H */ 36#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index e6dc11e7f9a..f5550b3eeea 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -24,84 +24,8 @@
24#ifndef _LINUX_IF_FDDI_H 24#ifndef _LINUX_IF_FDDI_H
25#define _LINUX_IF_FDDI_H 25#define _LINUX_IF_FDDI_H
26 26
27#include <linux/types.h>
28
29/*
30 * Define max and min legal sizes. The frame sizes do not include
31 * 4 byte FCS/CRC (frame check sequence).
32 */
33#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
34#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
35#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
36#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */
37#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */
38#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
39#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
40#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
41#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
42
43/* Define FDDI Frame Control (FC) Byte values */
44#define FDDI_FC_K_VOID 0x00
45#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
46#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
47#define FDDI_FC_K_SMT_MIN 0x41
48#define FDDI_FC_K_SMT_MAX 0x4F
49#define FDDI_FC_K_MAC_MIN 0xC1
50#define FDDI_FC_K_MAC_MAX 0xCF
51#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
52#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
53#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
54#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
55#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
56#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
57#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
58#define FDDI_FC_K_RESERVED_MIN 0x70
59#define FDDI_FC_K_RESERVED_MAX 0x7F
60
61/* Define LLC and SNAP constants */
62#define FDDI_EXTENDED_SAP 0xAA
63#define FDDI_UI_CMD 0x03
64
65/* Define 802.2 Type 1 header */
66struct fddi_8022_1_hdr {
67 __u8 dsap; /* destination service access point */
68 __u8 ssap; /* source service access point */
69 __u8 ctrl; /* control byte #1 */
70} __attribute__((packed));
71
72/* Define 802.2 Type 2 header */
73struct fddi_8022_2_hdr {
74 __u8 dsap; /* destination service access point */
75 __u8 ssap; /* source service access point */
76 __u8 ctrl_1; /* control byte #1 */
77 __u8 ctrl_2; /* control byte #2 */
78} __attribute__((packed));
79
80/* Define 802.2 SNAP header */
81#define FDDI_K_OUI_LEN 3
82struct fddi_snap_hdr {
83 __u8 dsap; /* always 0xAA */
84 __u8 ssap; /* always 0xAA */
85 __u8 ctrl; /* always 0x03 */
86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
87 __be16 ethertype; /* packet type ID field */
88} __attribute__((packed));
89
90/* Define FDDI LLC frame header */
91struct fddihdr {
92 __u8 fc; /* frame control */
93 __u8 daddr[FDDI_K_ALEN]; /* destination address */
94 __u8 saddr[FDDI_K_ALEN]; /* source address */
95 union
96 {
97 struct fddi_8022_1_hdr llc_8022_1;
98 struct fddi_8022_2_hdr llc_8022_2;
99 struct fddi_snap_hdr llc_snap;
100 } hdr;
101} __attribute__((packed));
102
103#ifdef __KERNEL__
104#include <linux/netdevice.h> 27#include <linux/netdevice.h>
28#include <uapi/linux/if_fddi.h>
105 29
106/* Define FDDI statistics structure */ 30/* Define FDDI statistics structure */
107struct fddi_statistics { 31struct fddi_statistics {
@@ -194,6 +118,4 @@ struct fddi_statistics {
194 __u32 port_ler_flag[2]; 118 __u32 port_ler_flag[2];
195 __u32 port_hardware_present[2]; 119 __u32 port_hardware_present[2];
196}; 120};
197#endif /* __KERNEL__ */
198
199#endif /* _LINUX_IF_FDDI_H */ 121#endif /* _LINUX_IF_FDDI_H */
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 191ee0869bc..4316aa173dd 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -20,105 +20,11 @@
20 * as published by the Free Software Foundation; either version 20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version. 21 * 2 of the License, or (at your option) any later version.
22 */ 22 */
23
24#ifndef _FRAD_H_ 23#ifndef _FRAD_H_
25#define _FRAD_H_ 24#define _FRAD_H_
26 25
27#include <linux/if.h> 26#include <uapi/linux/if_frad.h>
28
29/* Structures and constants associated with the DLCI device driver */
30
31struct dlci_add
32{
33 char devname[IFNAMSIZ];
34 short dlci;
35};
36
37#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
38#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
39
40/*
41 * These are related to the Sangoma SDLA and should remain in order.
42 * Code within the SDLA module is based on the specifics of this
43 * structure. Change at your own peril.
44 */
45struct dlci_conf {
46 short flags;
47 short CIR_fwd;
48 short Bc_fwd;
49 short Be_fwd;
50 short CIR_bwd;
51 short Bc_bwd;
52 short Be_bwd;
53
54/* these are part of the status read */
55 short Tc_fwd;
56 short Tc_bwd;
57 short Tf_max;
58 short Tb_max;
59
60/* add any new fields here above is a mirror of sdla_dlci_conf */
61};
62
63#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
64
65/* configuration flags for DLCI */
66#define DLCI_IGNORE_CIR_OUT 0x0001
67#define DLCI_ACCOUNT_CIR_IN 0x0002
68#define DLCI_BUFFER_IF 0x0008
69
70#define DLCI_VALID_FLAGS 0x000B
71 27
72/* defines for the actual Frame Relay hardware */
73#define FRAD_GET_CONF (SIOCDEVPRIVATE)
74#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
75
76#define FRAD_LAST_IOCTL FRAD_SET_CONF
77
78/*
79 * Based on the setup for the Sangoma SDLA. If changes are
80 * necessary to this structure, a routine will need to be
81 * added to that module to copy fields.
82 */
83struct frad_conf
84{
85 short station;
86 short flags;
87 short kbaud;
88 short clocking;
89 short mtu;
90 short T391;
91 short T392;
92 short N391;
93 short N392;
94 short N393;
95 short CIR_fwd;
96 short Bc_fwd;
97 short Be_fwd;
98 short CIR_bwd;
99 short Bc_bwd;
100 short Be_bwd;
101
102/* Add new fields here, above is a mirror of the sdla_conf */
103
104};
105
106#define FRAD_STATION_CPE 0x0000
107#define FRAD_STATION_NODE 0x0001
108
109#define FRAD_TX_IGNORE_CIR 0x0001
110#define FRAD_RX_ACCOUNT_CIR 0x0002
111#define FRAD_DROP_ABORTED 0x0004
112#define FRAD_BUFFERIF 0x0008
113#define FRAD_STATS 0x0010
114#define FRAD_MCI 0x0100
115#define FRAD_AUTODLCI 0x8000
116#define FRAD_VALID_FLAGS 0x811F
117
118#define FRAD_CLOCK_INT 0x0001
119#define FRAD_CLOCK_EXT 0x0000
120
121#ifdef __KERNEL__
122 28
123#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) 29#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
124 30
@@ -188,6 +94,4 @@ struct frad_local
188 94
189extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); 95extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *));
190 96
191#endif /* __KERNEL__ */
192
193#endif 97#endif
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 3265f332998..c3f817c3eb4 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -1,341 +1,8 @@
1#ifndef _LINUX_IF_LINK_H 1#ifndef _LINUX_IF_LINK_H
2#define _LINUX_IF_LINK_H 2#define _LINUX_IF_LINK_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/if_link.h>
5#include <linux/netlink.h>
6 5
7/* This struct should be in sync with struct rtnl_link_stats64 */
8struct rtnl_link_stats {
9 __u32 rx_packets; /* total packets received */
10 __u32 tx_packets; /* total packets transmitted */
11 __u32 rx_bytes; /* total bytes received */
12 __u32 tx_bytes; /* total bytes transmitted */
13 __u32 rx_errors; /* bad packets received */
14 __u32 tx_errors; /* packet transmit problems */
15 __u32 rx_dropped; /* no space in linux buffers */
16 __u32 tx_dropped; /* no space available in linux */
17 __u32 multicast; /* multicast packets received */
18 __u32 collisions;
19
20 /* detailed rx_errors: */
21 __u32 rx_length_errors;
22 __u32 rx_over_errors; /* receiver ring buff overflow */
23 __u32 rx_crc_errors; /* recved pkt with crc error */
24 __u32 rx_frame_errors; /* recv'd frame alignment error */
25 __u32 rx_fifo_errors; /* recv'r fifo overrun */
26 __u32 rx_missed_errors; /* receiver missed packet */
27
28 /* detailed tx_errors */
29 __u32 tx_aborted_errors;
30 __u32 tx_carrier_errors;
31 __u32 tx_fifo_errors;
32 __u32 tx_heartbeat_errors;
33 __u32 tx_window_errors;
34
35 /* for cslip etc */
36 __u32 rx_compressed;
37 __u32 tx_compressed;
38};
39
40/* The main device statistics structure */
41struct rtnl_link_stats64 {
42 __u64 rx_packets; /* total packets received */
43 __u64 tx_packets; /* total packets transmitted */
44 __u64 rx_bytes; /* total bytes received */
45 __u64 tx_bytes; /* total bytes transmitted */
46 __u64 rx_errors; /* bad packets received */
47 __u64 tx_errors; /* packet transmit problems */
48 __u64 rx_dropped; /* no space in linux buffers */
49 __u64 tx_dropped; /* no space available in linux */
50 __u64 multicast; /* multicast packets received */
51 __u64 collisions;
52
53 /* detailed rx_errors: */
54 __u64 rx_length_errors;
55 __u64 rx_over_errors; /* receiver ring buff overflow */
56 __u64 rx_crc_errors; /* recved pkt with crc error */
57 __u64 rx_frame_errors; /* recv'd frame alignment error */
58 __u64 rx_fifo_errors; /* recv'r fifo overrun */
59 __u64 rx_missed_errors; /* receiver missed packet */
60
61 /* detailed tx_errors */
62 __u64 tx_aborted_errors;
63 __u64 tx_carrier_errors;
64 __u64 tx_fifo_errors;
65 __u64 tx_heartbeat_errors;
66 __u64 tx_window_errors;
67
68 /* for cslip etc */
69 __u64 rx_compressed;
70 __u64 tx_compressed;
71};
72
73/* The struct should be in sync with struct ifmap */
74struct rtnl_link_ifmap {
75 __u64 mem_start;
76 __u64 mem_end;
77 __u64 base_addr;
78 __u16 irq;
79 __u8 dma;
80 __u8 port;
81};
82
83/*
84 * IFLA_AF_SPEC
85 * Contains nested attributes for address family specific attributes.
86 * Each address family may create a attribute with the address family
87 * number as type and create its own attribute structure in it.
88 *
89 * Example:
90 * [IFLA_AF_SPEC] = {
91 * [AF_INET] = {
92 * [IFLA_INET_CONF] = ...,
93 * },
94 * [AF_INET6] = {
95 * [IFLA_INET6_FLAGS] = ...,
96 * [IFLA_INET6_CONF] = ...,
97 * }
98 * }
99 */
100
101enum {
102 IFLA_UNSPEC,
103 IFLA_ADDRESS,
104 IFLA_BROADCAST,
105 IFLA_IFNAME,
106 IFLA_MTU,
107 IFLA_LINK,
108 IFLA_QDISC,
109 IFLA_STATS,
110 IFLA_COST,
111#define IFLA_COST IFLA_COST
112 IFLA_PRIORITY,
113#define IFLA_PRIORITY IFLA_PRIORITY
114 IFLA_MASTER,
115#define IFLA_MASTER IFLA_MASTER
116 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
117#define IFLA_WIRELESS IFLA_WIRELESS
118 IFLA_PROTINFO, /* Protocol specific information for a link */
119#define IFLA_PROTINFO IFLA_PROTINFO
120 IFLA_TXQLEN,
121#define IFLA_TXQLEN IFLA_TXQLEN
122 IFLA_MAP,
123#define IFLA_MAP IFLA_MAP
124 IFLA_WEIGHT,
125#define IFLA_WEIGHT IFLA_WEIGHT
126 IFLA_OPERSTATE,
127 IFLA_LINKMODE,
128 IFLA_LINKINFO,
129#define IFLA_LINKINFO IFLA_LINKINFO
130 IFLA_NET_NS_PID,
131 IFLA_IFALIAS,
132 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
133 IFLA_VFINFO_LIST,
134 IFLA_STATS64,
135 IFLA_VF_PORTS,
136 IFLA_PORT_SELF,
137 IFLA_AF_SPEC,
138 IFLA_GROUP, /* Group the device belongs to */
139 IFLA_NET_NS_FD,
140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES,
145 __IFLA_MAX
146};
147
148
149#define IFLA_MAX (__IFLA_MAX - 1)
150
151/* backwards compatibility for userspace */
152#ifndef __KERNEL__
153#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
154#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
155#endif
156
157enum {
158 IFLA_INET_UNSPEC,
159 IFLA_INET_CONF,
160 __IFLA_INET_MAX,
161};
162
163#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
164
165/* ifi_flags.
166
167 IFF_* flags.
168
169 The only change is:
170 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
171 more not changeable by user. They describe link media
172 characteristics and set by device driver.
173
174 Comments:
175 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
176 - If neither of these three flags are set;
177 the interface is NBMA.
178
179 - IFF_MULTICAST does not mean anything special:
180 multicasts can be used on all not-NBMA links.
181 IFF_MULTICAST means that this media uses special encapsulation
182 for multicast frames. Apparently, all IFF_POINTOPOINT and
183 IFF_BROADCAST devices are able to use multicasts too.
184 */
185
186/* IFLA_LINK.
187 For usual devices it is equal ifi_index.
188 If it is a "virtual interface" (f.e. tunnel), ifi_link
189 can point to real physical interface (f.e. for bandwidth calculations),
190 or maybe 0, what means, that real media is unknown (usual
191 for IPIP tunnels, when route to endpoint is allowed to change)
192 */
193
194/* Subtype attributes for IFLA_PROTINFO */
195enum {
196 IFLA_INET6_UNSPEC,
197 IFLA_INET6_FLAGS, /* link flags */
198 IFLA_INET6_CONF, /* sysctl parameters */
199 IFLA_INET6_STATS, /* statistics */
200 IFLA_INET6_MCAST, /* MC things. What of them? */
201 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
202 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
203 __IFLA_INET6_MAX
204};
205
206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
207
208struct ifla_cacheinfo {
209 __u32 max_reasm_len;
210 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
211 __u32 reachable_time;
212 __u32 retrans_time;
213};
214
215enum {
216 IFLA_INFO_UNSPEC,
217 IFLA_INFO_KIND,
218 IFLA_INFO_DATA,
219 IFLA_INFO_XSTATS,
220 __IFLA_INFO_MAX,
221};
222
223#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
224
225/* VLAN section */
226
227enum {
228 IFLA_VLAN_UNSPEC,
229 IFLA_VLAN_ID,
230 IFLA_VLAN_FLAGS,
231 IFLA_VLAN_EGRESS_QOS,
232 IFLA_VLAN_INGRESS_QOS,
233 __IFLA_VLAN_MAX,
234};
235
236#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
237
238struct ifla_vlan_flags {
239 __u32 flags;
240 __u32 mask;
241};
242
243enum {
244 IFLA_VLAN_QOS_UNSPEC,
245 IFLA_VLAN_QOS_MAPPING,
246 __IFLA_VLAN_QOS_MAX
247};
248
249#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
250
251struct ifla_vlan_qos_mapping {
252 __u32 from;
253 __u32 to;
254};
255
256/* MACVLAN section */
257enum {
258 IFLA_MACVLAN_UNSPEC,
259 IFLA_MACVLAN_MODE,
260 IFLA_MACVLAN_FLAGS,
261 __IFLA_MACVLAN_MAX,
262};
263
264#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
265
266enum macvlan_mode {
267 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
268 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
269 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
270 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
271};
272
273#define MACVLAN_FLAG_NOPROMISC 1
274
275/* VXLAN section */
276enum {
277 IFLA_VXLAN_UNSPEC,
278 IFLA_VXLAN_ID,
279 IFLA_VXLAN_GROUP,
280 IFLA_VXLAN_LINK,
281 IFLA_VXLAN_LOCAL,
282 IFLA_VXLAN_TTL,
283 IFLA_VXLAN_TOS,
284 IFLA_VXLAN_LEARNING,
285 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT,
287 IFLA_VXLAN_PORT_RANGE,
288 __IFLA_VXLAN_MAX
289};
290#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
291
292struct ifla_vxlan_port_range {
293 __be16 low;
294 __be16 high;
295};
296
297/* SR-IOV virtual function management section */
298
299enum {
300 IFLA_VF_INFO_UNSPEC,
301 IFLA_VF_INFO,
302 __IFLA_VF_INFO_MAX,
303};
304
305#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
306
307enum {
308 IFLA_VF_UNSPEC,
309 IFLA_VF_MAC, /* Hardware queue specific attributes */
310 IFLA_VF_VLAN,
311 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
312 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
313 __IFLA_VF_MAX,
314};
315
316#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
317
318struct ifla_vf_mac {
319 __u32 vf;
320 __u8 mac[32]; /* MAX_ADDR_LEN */
321};
322
323struct ifla_vf_vlan {
324 __u32 vf;
325 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
326 __u32 qos;
327};
328
329struct ifla_vf_tx_rate {
330 __u32 vf;
331 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
332};
333
334struct ifla_vf_spoofchk {
335 __u32 vf;
336 __u32 setting;
337};
338#ifdef __KERNEL__
339 6
340/* We don't want this structure exposed to user space */ 7/* We don't want this structure exposed to user space */
341struct ifla_vf_info { 8struct ifla_vf_info {
@@ -346,96 +13,4 @@ struct ifla_vf_info {
346 __u32 tx_rate; 13 __u32 tx_rate;
347 __u32 spoofchk; 14 __u32 spoofchk;
348}; 15};
349#endif
350
351/* VF ports management section
352 *
353 * Nested layout of set/get msg is:
354 *
355 * [IFLA_NUM_VF]
356 * [IFLA_VF_PORTS]
357 * [IFLA_VF_PORT]
358 * [IFLA_PORT_*], ...
359 * [IFLA_VF_PORT]
360 * [IFLA_PORT_*], ...
361 * ...
362 * [IFLA_PORT_SELF]
363 * [IFLA_PORT_*], ...
364 */
365
366enum {
367 IFLA_VF_PORT_UNSPEC,
368 IFLA_VF_PORT, /* nest */
369 __IFLA_VF_PORT_MAX,
370};
371
372#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
373
374enum {
375 IFLA_PORT_UNSPEC,
376 IFLA_PORT_VF, /* __u32 */
377 IFLA_PORT_PROFILE, /* string */
378 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
379 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
380 IFLA_PORT_HOST_UUID, /* binary UUID */
381 IFLA_PORT_REQUEST, /* __u8 */
382 IFLA_PORT_RESPONSE, /* __u16, output only */
383 __IFLA_PORT_MAX,
384};
385
386#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
387
388#define PORT_PROFILE_MAX 40
389#define PORT_UUID_MAX 16
390#define PORT_SELF_VF -1
391
392enum {
393 PORT_REQUEST_PREASSOCIATE = 0,
394 PORT_REQUEST_PREASSOCIATE_RR,
395 PORT_REQUEST_ASSOCIATE,
396 PORT_REQUEST_DISASSOCIATE,
397};
398
399enum {
400 PORT_VDP_RESPONSE_SUCCESS = 0,
401 PORT_VDP_RESPONSE_INVALID_FORMAT,
402 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
403 PORT_VDP_RESPONSE_UNUSED_VTID,
404 PORT_VDP_RESPONSE_VTID_VIOLATION,
405 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
406 PORT_VDP_RESPONSE_OUT_OF_SYNC,
407 /* 0x08-0xFF reserved for future VDP use */
408 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
409 PORT_PROFILE_RESPONSE_INPROGRESS,
410 PORT_PROFILE_RESPONSE_INVALID,
411 PORT_PROFILE_RESPONSE_BADSTATE,
412 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
413 PORT_PROFILE_RESPONSE_ERROR,
414};
415
416struct ifla_port_vsi {
417 __u8 vsi_mgr_id;
418 __u8 vsi_type_id[3];
419 __u8 vsi_type_version;
420 __u8 pad[3];
421};
422
423
424/* IPoIB section */
425
426enum {
427 IFLA_IPOIB_UNSPEC,
428 IFLA_IPOIB_PKEY,
429 IFLA_IPOIB_MODE,
430 IFLA_IPOIB_UMCAST,
431 __IFLA_IPOIB_MAX
432};
433
434enum {
435 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
436 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
437};
438
439#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
440
441#endif /* _LINUX_IF_LINK_H */ 16#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_ltalk.h b/include/linux/if_ltalk.h
index 76525760ba4..81e434c5079 100644
--- a/include/linux/if_ltalk.h
+++ b/include/linux/if_ltalk.h
@@ -1,12 +1,7 @@
1#ifndef __LINUX_LTALK_H 1#ifndef __LINUX_LTALK_H
2#define __LINUX_LTALK_H 2#define __LINUX_LTALK_H
3 3
4#define LTALK_HLEN 1 4#include <uapi/linux/if_ltalk.h>
5#define LTALK_MTU 600
6#define LTALK_ALEN 1
7 5
8#ifdef __KERNEL__
9extern struct net_device *alloc_ltalkdev(int sizeof_priv); 6extern struct net_device *alloc_ltalkdev(int sizeof_priv);
10#endif 7#endif
11
12#endif
diff --git a/include/linux/if_phonet.h b/include/linux/if_phonet.h
index d70034bcec0..bbcdb0a767d 100644
--- a/include/linux/if_phonet.h
+++ b/include/linux/if_phonet.h
@@ -8,12 +8,7 @@
8#ifndef LINUX_IF_PHONET_H 8#ifndef LINUX_IF_PHONET_H
9#define LINUX_IF_PHONET_H 9#define LINUX_IF_PHONET_H
10 10
11#define PHONET_MIN_MTU 6 /* pn_length = 0 */ 11#include <uapi/linux/if_phonet.h>
12#define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */
13#define PHONET_DEV_MTU PHONET_MAX_MTU
14 12
15#ifdef __KERNEL__
16extern struct header_ops phonet_header_ops; 13extern struct header_ops phonet_header_ops;
17#endif 14#endif
18
19#endif
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index b4775418d52..0fb71e532b2 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -11,98 +11,11 @@
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 * 12 *
13 */ 13 */
14
15#ifndef __LINUX_IF_PPPOL2TP_H 14#ifndef __LINUX_IF_PPPOL2TP_H
16#define __LINUX_IF_PPPOL2TP_H 15#define __LINUX_IF_PPPOL2TP_H
17 16
18#include <linux/types.h>
19
20#ifdef __KERNEL__
21#include <linux/in.h> 17#include <linux/in.h>
22#include <linux/in6.h> 18#include <linux/in6.h>
23#endif 19#include <uapi/linux/if_pppol2tp.h>
24
25/* Structure used to connect() the socket to a particular tunnel UDP
26 * socket over IPv4.
27 */
28struct pppol2tp_addr {
29 __kernel_pid_t pid; /* pid that owns the fd.
30 * 0 => current */
31 int fd; /* FD of UDP socket to use */
32
33 struct sockaddr_in addr; /* IP address and port to send to */
34
35 __u16 s_tunnel, s_session; /* For matching incoming packets */
36 __u16 d_tunnel, d_session; /* For sending outgoing packets */
37};
38
39/* Structure used to connect() the socket to a particular tunnel UDP
40 * socket over IPv6.
41 */
42struct pppol2tpin6_addr {
43 __kernel_pid_t pid; /* pid that owns the fd.
44 * 0 => current */
45 int fd; /* FD of UDP socket to use */
46
47 __u16 s_tunnel, s_session; /* For matching incoming packets */
48 __u16 d_tunnel, d_session; /* For sending outgoing packets */
49
50 struct sockaddr_in6 addr; /* IP address and port to send to */
51};
52
53/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
54 * bits. So we need a different sockaddr structure.
55 */
56struct pppol2tpv3_addr {
57 __kernel_pid_t pid; /* pid that owns the fd.
58 * 0 => current */
59 int fd; /* FD of UDP or IP socket to use */
60
61 struct sockaddr_in addr; /* IP address and port to send to */
62
63 __u32 s_tunnel, s_session; /* For matching incoming packets */
64 __u32 d_tunnel, d_session; /* For sending outgoing packets */
65};
66
67struct pppol2tpv3in6_addr {
68 __kernel_pid_t pid; /* pid that owns the fd.
69 * 0 => current */
70 int fd; /* FD of UDP or IP socket to use */
71
72 __u32 s_tunnel, s_session; /* For matching incoming packets */
73 __u32 d_tunnel, d_session; /* For sending outgoing packets */
74
75 struct sockaddr_in6 addr; /* IP address and port to send to */
76};
77
78/* Socket options:
79 * DEBUG - bitmask of debug message categories
80 * SENDSEQ - 0 => don't send packets with sequence numbers
81 * 1 => send packets with sequence numbers
82 * RECVSEQ - 0 => receive packet sequence numbers are optional
83 * 1 => drop receive packets without sequence numbers
84 * LNSMODE - 0 => act as LAC.
85 * 1 => act as LNS.
86 * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
87 */
88enum {
89 PPPOL2TP_SO_DEBUG = 1,
90 PPPOL2TP_SO_RECVSEQ = 2,
91 PPPOL2TP_SO_SENDSEQ = 3,
92 PPPOL2TP_SO_LNSMODE = 4,
93 PPPOL2TP_SO_REORDERTO = 5,
94};
95
96/* Debug message categories for the DEBUG socket option */
97enum {
98 PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
99 * compiled in) */
100 PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
101 * interface */
102 PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
103 PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
104};
105
106
107 20
108#endif 21#endif
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 09c474c480c..aff7ad8a4ea 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -12,153 +12,14 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 * 13 *
14 */ 14 */
15
16#ifndef __LINUX_IF_PPPOX_H 15#ifndef __LINUX_IF_PPPOX_H
17#define __LINUX_IF_PPPOX_H 16#define __LINUX_IF_PPPOX_H
18 17
19
20#include <linux/types.h>
21#include <asm/byteorder.h>
22
23#include <linux/socket.h>
24#include <linux/if_ether.h>
25#ifdef __KERNEL__
26#include <linux/if.h> 18#include <linux/if.h>
27#include <linux/netdevice.h> 19#include <linux/netdevice.h>
28#include <linux/ppp_channel.h> 20#include <linux/ppp_channel.h>
29#endif /* __KERNEL__ */
30#include <linux/if_pppol2tp.h>
31
32/* For user-space programs to pick up these definitions
33 * which they wouldn't get otherwise without defining __KERNEL__
34 */
35#ifndef AF_PPPOX
36#define AF_PPPOX 24
37#define PF_PPPOX AF_PPPOX
38#endif /* !(AF_PPPOX) */
39
40/************************************************************************
41 * PPPoE addressing definition
42 */
43typedef __be16 sid_t;
44struct pppoe_addr {
45 sid_t sid; /* Session identifier */
46 unsigned char remote[ETH_ALEN]; /* Remote address */
47 char dev[IFNAMSIZ]; /* Local device to use */
48};
49
50/************************************************************************
51 * PPTP addressing definition
52 */
53struct pptp_addr {
54 __be16 call_id;
55 struct in_addr sin_addr;
56};
57
58/************************************************************************
59 * Protocols supported by AF_PPPOX
60 */
61#define PX_PROTO_OE 0 /* Currently just PPPoE */
62#define PX_PROTO_OL2TP 1 /* Now L2TP also */
63#define PX_PROTO_PPTP 2
64#define PX_MAX_PROTO 3
65
66struct sockaddr_pppox {
67 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
68 unsigned int sa_protocol; /* protocol identifier */
69 union {
70 struct pppoe_addr pppoe;
71 struct pptp_addr pptp;
72 } sa_addr;
73} __packed;
74
75/* The use of the above union isn't viable because the size of this
76 * struct must stay fixed over time -- applications use sizeof(struct
77 * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
78 * type instead.
79 */
80struct sockaddr_pppol2tp {
81 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
82 unsigned int sa_protocol; /* protocol identifier */
83 struct pppol2tp_addr pppol2tp;
84} __packed;
85
86struct sockaddr_pppol2tpin6 {
87 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
88 unsigned int sa_protocol; /* protocol identifier */
89 struct pppol2tpin6_addr pppol2tp;
90} __packed;
91
92/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
93 * bits. So we need a different sockaddr structure.
94 */
95struct sockaddr_pppol2tpv3 {
96 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
97 unsigned int sa_protocol; /* protocol identifier */
98 struct pppol2tpv3_addr pppol2tp;
99} __packed;
100
101struct sockaddr_pppol2tpv3in6 {
102 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
103 unsigned int sa_protocol; /* protocol identifier */
104 struct pppol2tpv3in6_addr pppol2tp;
105} __packed;
106
107/*********************************************************************
108 *
109 * ioctl interface for defining forwarding of connections
110 *
111 ********************************************************************/
112
113#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
114#define PPPOEIOCDFWD _IO(0xB1 ,1)
115/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
116
117/* Codes to identify message types */
118#define PADI_CODE 0x09
119#define PADO_CODE 0x07
120#define PADR_CODE 0x19
121#define PADS_CODE 0x65
122#define PADT_CODE 0xa7
123struct pppoe_tag {
124 __be16 tag_type;
125 __be16 tag_len;
126 char tag_data[0];
127} __attribute__ ((packed));
128
129/* Tag identifiers */
130#define PTT_EOL __cpu_to_be16(0x0000)
131#define PTT_SRV_NAME __cpu_to_be16(0x0101)
132#define PTT_AC_NAME __cpu_to_be16(0x0102)
133#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
134#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
135#define PTT_VENDOR __cpu_to_be16(0x0105)
136#define PTT_RELAY_SID __cpu_to_be16(0x0110)
137#define PTT_SRV_ERR __cpu_to_be16(0x0201)
138#define PTT_SYS_ERR __cpu_to_be16(0x0202)
139#define PTT_GEN_ERR __cpu_to_be16(0x0203)
140
141struct pppoe_hdr {
142#if defined(__LITTLE_ENDIAN_BITFIELD)
143 __u8 ver : 4;
144 __u8 type : 4;
145#elif defined(__BIG_ENDIAN_BITFIELD)
146 __u8 type : 4;
147 __u8 ver : 4;
148#else
149#error "Please fix <asm/byteorder.h>"
150#endif
151 __u8 code;
152 __be16 sid;
153 __be16 length;
154 struct pppoe_tag tag[0];
155} __packed;
156
157/* Length of entire PPPoE + PPP header */
158#define PPPOE_SES_HLEN 8
159
160#ifdef __KERNEL__
161#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <uapi/linux/if_pppox.h>
162 23
163static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb) 24static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
164{ 25{
@@ -232,6 +93,4 @@ enum {
232 PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/ 93 PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/
233}; 94};
234 95
235#endif /* __KERNEL__ */
236
237#endif /* !(__LINUX_IF_PPPOX_H) */ 96#endif /* !(__LINUX_IF_PPPOX_H) */
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 6d88a7f5768..0245def2aa9 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -7,14 +7,13 @@
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
9 */ 9 */
10
11#ifndef _LINUX_IF_TEAM_H_ 10#ifndef _LINUX_IF_TEAM_H_
12#define _LINUX_IF_TEAM_H_ 11#define _LINUX_IF_TEAM_H_
13 12
14#ifdef __KERNEL__
15 13
16#include <linux/netpoll.h> 14#include <linux/netpoll.h>
17#include <net/sch_generic.h> 15#include <net/sch_generic.h>
16#include <uapi/linux/if_team.h>
18 17
19struct team_pcpu_stats { 18struct team_pcpu_stats {
20 u64 rx_packets; 19 u64 rx_packets;
@@ -251,98 +250,4 @@ extern void team_mode_unregister(const struct team_mode *mode);
251#define TEAM_DEFAULT_NUM_TX_QUEUES 16 250#define TEAM_DEFAULT_NUM_TX_QUEUES 16
252#define TEAM_DEFAULT_NUM_RX_QUEUES 16 251#define TEAM_DEFAULT_NUM_RX_QUEUES 16
253 252
254#endif /* __KERNEL__ */
255
256#define TEAM_STRING_MAX_LEN 32
257
258/**********************************
259 * NETLINK_GENERIC netlink family.
260 **********************************/
261
262enum {
263 TEAM_CMD_NOOP,
264 TEAM_CMD_OPTIONS_SET,
265 TEAM_CMD_OPTIONS_GET,
266 TEAM_CMD_PORT_LIST_GET,
267
268 __TEAM_CMD_MAX,
269 TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
270};
271
272enum {
273 TEAM_ATTR_UNSPEC,
274 TEAM_ATTR_TEAM_IFINDEX, /* u32 */
275 TEAM_ATTR_LIST_OPTION, /* nest */
276 TEAM_ATTR_LIST_PORT, /* nest */
277
278 __TEAM_ATTR_MAX,
279 TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
280};
281
282/* Nested layout of get/set msg:
283 *
284 * [TEAM_ATTR_LIST_OPTION]
285 * [TEAM_ATTR_ITEM_OPTION]
286 * [TEAM_ATTR_OPTION_*], ...
287 * [TEAM_ATTR_ITEM_OPTION]
288 * [TEAM_ATTR_OPTION_*], ...
289 * ...
290 * [TEAM_ATTR_LIST_PORT]
291 * [TEAM_ATTR_ITEM_PORT]
292 * [TEAM_ATTR_PORT_*], ...
293 * [TEAM_ATTR_ITEM_PORT]
294 * [TEAM_ATTR_PORT_*], ...
295 * ...
296 */
297
298enum {
299 TEAM_ATTR_ITEM_OPTION_UNSPEC,
300 TEAM_ATTR_ITEM_OPTION, /* nest */
301
302 __TEAM_ATTR_ITEM_OPTION_MAX,
303 TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
304};
305
306enum {
307 TEAM_ATTR_OPTION_UNSPEC,
308 TEAM_ATTR_OPTION_NAME, /* string */
309 TEAM_ATTR_OPTION_CHANGED, /* flag */
310 TEAM_ATTR_OPTION_TYPE, /* u8 */
311 TEAM_ATTR_OPTION_DATA, /* dynamic */
312 TEAM_ATTR_OPTION_REMOVED, /* flag */
313 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
314 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
315
316 __TEAM_ATTR_OPTION_MAX,
317 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
318};
319
320enum {
321 TEAM_ATTR_ITEM_PORT_UNSPEC,
322 TEAM_ATTR_ITEM_PORT, /* nest */
323
324 __TEAM_ATTR_ITEM_PORT_MAX,
325 TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
326};
327
328enum {
329 TEAM_ATTR_PORT_UNSPEC,
330 TEAM_ATTR_PORT_IFINDEX, /* u32 */
331 TEAM_ATTR_PORT_CHANGED, /* flag */
332 TEAM_ATTR_PORT_LINKUP, /* flag */
333 TEAM_ATTR_PORT_SPEED, /* u32 */
334 TEAM_ATTR_PORT_DUPLEX, /* u8 */
335 TEAM_ATTR_PORT_REMOVED, /* flag */
336
337 __TEAM_ATTR_PORT_MAX,
338 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
339};
340
341/*
342 * NETLINK_GENERIC related info
343 */
344#define TEAM_GENL_NAME "team"
345#define TEAM_GENL_VERSION 0x1
346#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
347
348#endif /* _LINUX_IF_TEAM_H_ */ 253#endif /* _LINUX_IF_TEAM_H_ */
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 06b1829731f..ed6da2e6df9 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -12,86 +12,11 @@
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15
16#ifndef __IF_TUN_H 15#ifndef __IF_TUN_H
17#define __IF_TUN_H 16#define __IF_TUN_H
18 17
19#include <linux/types.h> 18#include <uapi/linux/if_tun.h>
20#include <linux/if_ether.h>
21#include <linux/filter.h>
22
23/* Read queue size */
24#define TUN_READQ_SIZE 500
25
26/* TUN device flags */
27#define TUN_TUN_DEV 0x0001
28#define TUN_TAP_DEV 0x0002
29#define TUN_TYPE_MASK 0x000f
30
31#define TUN_FASYNC 0x0010
32#define TUN_NOCHECKSUM 0x0020
33#define TUN_NO_PI 0x0040
34#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100
36#define TUN_VNET_HDR 0x0200
37
38/* Ioctl defines */
39#define TUNSETNOCSUM _IOW('T', 200, int)
40#define TUNSETDEBUG _IOW('T', 201, int)
41#define TUNSETIFF _IOW('T', 202, int)
42#define TUNSETPERSIST _IOW('T', 203, int)
43#define TUNSETOWNER _IOW('T', 204, int)
44#define TUNSETLINK _IOW('T', 205, int)
45#define TUNSETGROUP _IOW('T', 206, int)
46#define TUNGETFEATURES _IOR('T', 207, unsigned int)
47#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
48#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
49#define TUNGETIFF _IOR('T', 210, unsigned int)
50#define TUNGETSNDBUF _IOR('T', 211, int)
51#define TUNSETSNDBUF _IOW('T', 212, int)
52#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
54#define TUNGETVNETHDRSZ _IOR('T', 215, int)
55#define TUNSETVNETHDRSZ _IOW('T', 216, int)
56
57/* TUNSETIFF ifr flags */
58#define IFF_TUN 0x0001
59#define IFF_TAP 0x0002
60#define IFF_NO_PI 0x1000
61#define IFF_ONE_QUEUE 0x2000
62#define IFF_VNET_HDR 0x4000
63#define IFF_TUN_EXCL 0x8000
64
65/* Features for GSO (TUNSETOFFLOAD). */
66#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
67#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
68#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
69#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
70#define TUN_F_UFO 0x10 /* I can handle UFO packets */
71
72/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
73#define TUN_PKT_STRIP 0x0001
74struct tun_pi {
75 __u16 flags;
76 __be16 proto;
77};
78
79/*
80 * Filter spec (used for SETXXFILTER ioctls)
81 * This stuff is applicable only to the TAP (Ethernet) devices.
82 * If the count is zero the filter is disabled and the driver accepts
83 * all packets (promisc mode).
84 * If the filter is enabled in order to accept broadcast packets
85 * broadcast addr must be explicitly included in the addr list.
86 */
87#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
88struct tun_filter {
89 __u16 flags; /* TUN_FLT_ flags see above */
90 __u16 count; /* Number of addresses */
91 __u8 addr[0][ETH_ALEN];
92};
93 19
94#ifdef __KERNEL__
95#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) 20#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
96struct socket *tun_get_socket(struct file *); 21struct socket *tun_get_socket(struct file *);
97#else 22#else
@@ -104,5 +29,4 @@ static inline struct socket *tun_get_socket(struct file *f)
104 return ERR_PTR(-EINVAL); 29 return ERR_PTR(-EINVAL);
105} 30}
106#endif /* CONFIG_TUN */ 31#endif /* CONFIG_TUN */
107#endif /* __KERNEL__ */
108#endif /* __IF_TUN_H */ 32#endif /* __IF_TUN_H */
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 8c5035ac314..1cc595a67cc 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -1,100 +1,8 @@
1#ifndef _IF_TUNNEL_H_ 1#ifndef _IF_TUNNEL_H_
2#define _IF_TUNNEL_H_ 2#define _IF_TUNNEL_H_
3 3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7#ifdef __KERNEL__
8#include <linux/ip.h> 4#include <linux/ip.h>
9#include <linux/in6.h> 5#include <linux/in6.h>
10#endif 6#include <uapi/linux/if_tunnel.h>
11
12#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
13#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
14#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
15#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
16#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
17#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
18#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
19#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
20#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
21#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
22#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
23#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
24
25#define GRE_CSUM __cpu_to_be16(0x8000)
26#define GRE_ROUTING __cpu_to_be16(0x4000)
27#define GRE_KEY __cpu_to_be16(0x2000)
28#define GRE_SEQ __cpu_to_be16(0x1000)
29#define GRE_STRICT __cpu_to_be16(0x0800)
30#define GRE_REC __cpu_to_be16(0x0700)
31#define GRE_FLAGS __cpu_to_be16(0x00F8)
32#define GRE_VERSION __cpu_to_be16(0x0007)
33
34struct ip_tunnel_parm {
35 char name[IFNAMSIZ];
36 int link;
37 __be16 i_flags;
38 __be16 o_flags;
39 __be32 i_key;
40 __be32 o_key;
41 struct iphdr iph;
42};
43
44/* SIT-mode i_flags */
45#define SIT_ISATAP 0x0001
46
47struct ip_tunnel_prl {
48 __be32 addr;
49 __u16 flags;
50 __u16 __reserved;
51 __u32 datalen;
52 __u32 __reserved2;
53 /* data follows */
54};
55
56/* PRL flags */
57#define PRL_DEFAULT 0x0001
58
59struct ip_tunnel_6rd {
60 struct in6_addr prefix;
61 __be32 relay_prefix;
62 __u16 prefixlen;
63 __u16 relay_prefixlen;
64};
65
66enum {
67 IFLA_GRE_UNSPEC,
68 IFLA_GRE_LINK,
69 IFLA_GRE_IFLAGS,
70 IFLA_GRE_OFLAGS,
71 IFLA_GRE_IKEY,
72 IFLA_GRE_OKEY,
73 IFLA_GRE_LOCAL,
74 IFLA_GRE_REMOTE,
75 IFLA_GRE_TTL,
76 IFLA_GRE_TOS,
77 IFLA_GRE_PMTUDISC,
78 IFLA_GRE_ENCAP_LIMIT,
79 IFLA_GRE_FLOWINFO,
80 IFLA_GRE_FLAGS,
81 __IFLA_GRE_MAX,
82};
83
84#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
85
86/* VTI-mode i_flags */
87#define VTI_ISVTI 0x0001
88
89enum {
90 IFLA_VTI_UNSPEC,
91 IFLA_VTI_LINK,
92 IFLA_VTI_IKEY,
93 IFLA_VTI_OKEY,
94 IFLA_VTI_LOCAL,
95 IFLA_VTI_REMOTE,
96 __IFLA_VTI_MAX,
97};
98 7
99#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
100#endif /* _IF_TUNNEL_H_ */ 8#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index c0ff748d0aa..d06cc5c8f58 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -9,15 +9,14 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 * 10 *
11 */ 11 */
12
13#ifndef _LINUX_IF_VLAN_H_ 12#ifndef _LINUX_IF_VLAN_H_
14#define _LINUX_IF_VLAN_H_ 13#define _LINUX_IF_VLAN_H_
15 14
16#ifdef __KERNEL__
17#include <linux/netdevice.h> 15#include <linux/netdevice.h>
18#include <linux/etherdevice.h> 16#include <linux/etherdevice.h>
19#include <linux/rtnetlink.h> 17#include <linux/rtnetlink.h>
20#include <linux/bug.h> 18#include <linux/bug.h>
19#include <uapi/linux/if_vlan.h>
21 20
22#define VLAN_HLEN 4 /* The additional bytes required by VLAN 21#define VLAN_HLEN 4 /* The additional bytes required by VLAN
23 * (in addition to the Ethernet header) 22 * (in addition to the Ethernet header)
@@ -361,52 +360,4 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
361 */ 360 */
362 skb->protocol = htons(ETH_P_802_2); 361 skb->protocol = htons(ETH_P_802_2);
363} 362}
364#endif /* __KERNEL__ */
365
366/* VLAN IOCTLs are found in sockios.h */
367
368/* Passed in vlan_ioctl_args structure to determine behaviour. */
369enum vlan_ioctl_cmds {
370 ADD_VLAN_CMD,
371 DEL_VLAN_CMD,
372 SET_VLAN_INGRESS_PRIORITY_CMD,
373 SET_VLAN_EGRESS_PRIORITY_CMD,
374 GET_VLAN_INGRESS_PRIORITY_CMD,
375 GET_VLAN_EGRESS_PRIORITY_CMD,
376 SET_VLAN_NAME_TYPE_CMD,
377 SET_VLAN_FLAG_CMD,
378 GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
379 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
380};
381
382enum vlan_flags {
383 VLAN_FLAG_REORDER_HDR = 0x1,
384 VLAN_FLAG_GVRP = 0x2,
385 VLAN_FLAG_LOOSE_BINDING = 0x4,
386};
387
388enum vlan_name_types {
389 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
390 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
391 VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
392 VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
393 VLAN_NAME_TYPE_HIGHEST
394};
395
396struct vlan_ioctl_args {
397 int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
398 char device1[24];
399
400 union {
401 char device2[24];
402 int VID;
403 unsigned int skb_priority;
404 unsigned int name_type;
405 unsigned int bind_type;
406 unsigned int flag; /* Matches vlan_dev_priv flags */
407 } u;
408
409 short vlan_qos;
410};
411
412#endif /* !(_LINUX_IF_VLAN_H_) */ 363#endif /* !(_LINUX_IF_VLAN_H_) */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 82de336b815..7f2bf151848 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -12,123 +12,13 @@
12 * as published by the Free Software Foundation; either version 12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15
16#ifndef _LINUX_IGMP_H 15#ifndef _LINUX_IGMP_H
17#define _LINUX_IGMP_H 16#define _LINUX_IGMP_H
18 17
19#include <linux/types.h>
20#include <asm/byteorder.h>
21
22/*
23 * IGMP protocol structures
24 */
25
26/*
27 * Header in on cable format
28 */
29
30struct igmphdr {
31 __u8 type;
32 __u8 code; /* For newer IGMP */
33 __sum16 csum;
34 __be32 group;
35};
36
37/* V3 group record types [grec_type] */
38#define IGMPV3_MODE_IS_INCLUDE 1
39#define IGMPV3_MODE_IS_EXCLUDE 2
40#define IGMPV3_CHANGE_TO_INCLUDE 3
41#define IGMPV3_CHANGE_TO_EXCLUDE 4
42#define IGMPV3_ALLOW_NEW_SOURCES 5
43#define IGMPV3_BLOCK_OLD_SOURCES 6
44
45struct igmpv3_grec {
46 __u8 grec_type;
47 __u8 grec_auxwords;
48 __be16 grec_nsrcs;
49 __be32 grec_mca;
50 __be32 grec_src[0];
51};
52
53struct igmpv3_report {
54 __u8 type;
55 __u8 resv1;
56 __be16 csum;
57 __be16 resv2;
58 __be16 ngrec;
59 struct igmpv3_grec grec[0];
60};
61
62struct igmpv3_query {
63 __u8 type;
64 __u8 code;
65 __be16 csum;
66 __be32 group;
67#if defined(__LITTLE_ENDIAN_BITFIELD)
68 __u8 qrv:3,
69 suppress:1,
70 resv:4;
71#elif defined(__BIG_ENDIAN_BITFIELD)
72 __u8 resv:4,
73 suppress:1,
74 qrv:3;
75#else
76#error "Please fix <asm/byteorder.h>"
77#endif
78 __u8 qqic;
79 __be16 nsrcs;
80 __be32 srcs[0];
81};
82
83#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
84#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
85#define IGMP_DVMRP 0x13 /* DVMRP routing */
86#define IGMP_PIM 0x14 /* PIM routing */
87#define IGMP_TRACE 0x15
88#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */
89#define IGMP_HOST_LEAVE_MESSAGE 0x17
90#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */
91
92#define IGMP_MTRACE_RESP 0x1e
93#define IGMP_MTRACE 0x1f
94
95
96/*
97 * Use the BSD names for these for compatibility
98 */
99
100#define IGMP_DELAYING_MEMBER 0x01
101#define IGMP_IDLE_MEMBER 0x02
102#define IGMP_LAZY_MEMBER 0x03
103#define IGMP_SLEEPING_MEMBER 0x04
104#define IGMP_AWAKENING_MEMBER 0x05
105
106#define IGMP_MINLEN 8
107
108#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
109 /* query (in seconds) */
110
111#define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */
112 /* specifies time in 10th of seconds */
113
114#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */
115 /* message in this period of time, */
116 /* revert to IGMP v2 router. */
117
118#define IGMP_ALL_HOSTS htonl(0xE0000001L)
119#define IGMP_ALL_ROUTER htonl(0xE0000002L)
120#define IGMPV3_ALL_MCR htonl(0xE0000016L)
121#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
122#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
123
124/*
125 * struct for keeping the multicast list in
126 */
127
128#ifdef __KERNEL__
129#include <linux/skbuff.h> 18#include <linux/skbuff.h>
130#include <linux/timer.h> 19#include <linux/timer.h>
131#include <linux/in.h> 20#include <linux/in.h>
21#include <uapi/linux/igmp.h>
132 22
133static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) 23static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
134{ 24{
@@ -241,4 +131,3 @@ extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
241extern void ip_mc_rejoin_groups(struct in_device *in_dev); 131extern void ip_mc_rejoin_groups(struct in_device *in_dev);
242 132
243#endif 133#endif
244#endif
diff --git a/include/linux/in.h b/include/linux/in.h
index e0337f11d92..31b49373476 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -18,240 +18,9 @@
18#ifndef _LINUX_IN_H 18#ifndef _LINUX_IN_H
19#define _LINUX_IN_H 19#define _LINUX_IN_H
20 20
21#include <linux/types.h>
22#include <linux/socket.h>
23
24/* Standard well-defined IP protocols. */
25enum {
26 IPPROTO_IP = 0, /* Dummy protocol for TCP */
27 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
28 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
29 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
30 IPPROTO_TCP = 6, /* Transmission Control Protocol */
31 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
32 IPPROTO_PUP = 12, /* PUP protocol */
33 IPPROTO_UDP = 17, /* User Datagram Protocol */
34 IPPROTO_IDP = 22, /* XNS IDP protocol */
35 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
36 IPPROTO_RSVP = 46, /* RSVP protocol */
37 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
38
39 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
40
41 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
42 IPPROTO_AH = 51, /* Authentication Header protocol */
43 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
44 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
45
46 IPPROTO_COMP = 108, /* Compression Header protocol */
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
49
50 IPPROTO_RAW = 255, /* Raw IP packets */
51 IPPROTO_MAX
52};
53
54
55/* Internet address. */
56struct in_addr {
57 __be32 s_addr;
58};
59
60#define IP_TOS 1
61#define IP_TTL 2
62#define IP_HDRINCL 3
63#define IP_OPTIONS 4
64#define IP_ROUTER_ALERT 5
65#define IP_RECVOPTS 6
66#define IP_RETOPTS 7
67#define IP_PKTINFO 8
68#define IP_PKTOPTIONS 9
69#define IP_MTU_DISCOVER 10
70#define IP_RECVERR 11
71#define IP_RECVTTL 12
72#define IP_RECVTOS 13
73#define IP_MTU 14
74#define IP_FREEBIND 15
75#define IP_IPSEC_POLICY 16
76#define IP_XFRM_POLICY 17
77#define IP_PASSSEC 18
78#define IP_TRANSPARENT 19
79
80/* BSD compatibility */
81#define IP_RECVRETOPTS IP_RETOPTS
82
83/* TProxy original addresses */
84#define IP_ORIGDSTADDR 20
85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
86
87#define IP_MINTTL 21
88#define IP_NODEFRAG 22
89
90/* IP_MTU_DISCOVER values */
91#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
92#define IP_PMTUDISC_WANT 1 /* Use per route hints */
93#define IP_PMTUDISC_DO 2 /* Always DF */
94#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */
95
96#define IP_MULTICAST_IF 32
97#define IP_MULTICAST_TTL 33
98#define IP_MULTICAST_LOOP 34
99#define IP_ADD_MEMBERSHIP 35
100#define IP_DROP_MEMBERSHIP 36
101#define IP_UNBLOCK_SOURCE 37
102#define IP_BLOCK_SOURCE 38
103#define IP_ADD_SOURCE_MEMBERSHIP 39
104#define IP_DROP_SOURCE_MEMBERSHIP 40
105#define IP_MSFILTER 41
106#define MCAST_JOIN_GROUP 42
107#define MCAST_BLOCK_SOURCE 43
108#define MCAST_UNBLOCK_SOURCE 44
109#define MCAST_LEAVE_GROUP 45
110#define MCAST_JOIN_SOURCE_GROUP 46
111#define MCAST_LEAVE_SOURCE_GROUP 47
112#define MCAST_MSFILTER 48
113#define IP_MULTICAST_ALL 49
114#define IP_UNICAST_IF 50
115
116#define MCAST_EXCLUDE 0
117#define MCAST_INCLUDE 1
118
119/* These need to appear somewhere around here */
120#define IP_DEFAULT_MULTICAST_TTL 1
121#define IP_DEFAULT_MULTICAST_LOOP 1
122
123/* Request struct for multicast socket ops */
124
125struct ip_mreq {
126 struct in_addr imr_multiaddr; /* IP multicast address of group */
127 struct in_addr imr_interface; /* local IP address of interface */
128};
129
130struct ip_mreqn {
131 struct in_addr imr_multiaddr; /* IP multicast address of group */
132 struct in_addr imr_address; /* local IP address of interface */
133 int imr_ifindex; /* Interface index */
134};
135
136struct ip_mreq_source {
137 __be32 imr_multiaddr;
138 __be32 imr_interface;
139 __be32 imr_sourceaddr;
140};
141
142struct ip_msfilter {
143 __be32 imsf_multiaddr;
144 __be32 imsf_interface;
145 __u32 imsf_fmode;
146 __u32 imsf_numsrc;
147 __be32 imsf_slist[1];
148};
149
150#define IP_MSFILTER_SIZE(numsrc) \
151 (sizeof(struct ip_msfilter) - sizeof(__u32) \
152 + (numsrc) * sizeof(__u32))
153
154struct group_req {
155 __u32 gr_interface; /* interface index */
156 struct __kernel_sockaddr_storage gr_group; /* group address */
157};
158
159struct group_source_req {
160 __u32 gsr_interface; /* interface index */
161 struct __kernel_sockaddr_storage gsr_group; /* group address */
162 struct __kernel_sockaddr_storage gsr_source; /* source address */
163};
164
165struct group_filter {
166 __u32 gf_interface; /* interface index */
167 struct __kernel_sockaddr_storage gf_group; /* multicast address */
168 __u32 gf_fmode; /* filter mode */
169 __u32 gf_numsrc; /* number of sources */
170 struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
171};
172
173#define GROUP_FILTER_SIZE(numsrc) \
174 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
175 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
176
177struct in_pktinfo {
178 int ipi_ifindex;
179 struct in_addr ipi_spec_dst;
180 struct in_addr ipi_addr;
181};
182
183/* Structure describing an Internet (IP) socket address. */
184#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
185struct sockaddr_in {
186 __kernel_sa_family_t sin_family; /* Address family */
187 __be16 sin_port; /* Port number */
188 struct in_addr sin_addr; /* Internet address */
189
190 /* Pad to size of `struct sockaddr'. */
191 unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
192 sizeof(unsigned short int) - sizeof(struct in_addr)];
193};
194#define sin_zero __pad /* for BSD UNIX comp. -FvK */
195
196
197/*
198 * Definitions of the bits in an Internet address integer.
199 * On subnets, host and network parts are found according
200 * to the subnet mask, not these masks.
201 */
202#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
203#define IN_CLASSA_NET 0xff000000
204#define IN_CLASSA_NSHIFT 24
205#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
206#define IN_CLASSA_MAX 128
207
208#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
209#define IN_CLASSB_NET 0xffff0000
210#define IN_CLASSB_NSHIFT 16
211#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
212#define IN_CLASSB_MAX 65536
213
214#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
215#define IN_CLASSC_NET 0xffffff00
216#define IN_CLASSC_NSHIFT 8
217#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
218
219#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
220#define IN_MULTICAST(a) IN_CLASSD(a)
221#define IN_MULTICAST_NET 0xF0000000
222
223#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
224#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
225
226/* Address to accept any incoming messages. */
227#define INADDR_ANY ((unsigned long int) 0x00000000)
228
229/* Address to send to all hosts. */
230#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
231
232/* Address indicating an error return. */
233#define INADDR_NONE ((unsigned long int) 0xffffffff)
234
235/* Network number for local host loopback. */
236#define IN_LOOPBACKNET 127
237
238/* Address to loopback in software to local host. */
239#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
240#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
241
242/* Defines for Multicast INADDR */
243#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
244#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
245#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
246#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
247
248
249/* <asm/byteorder.h> contains the htonl type stuff.. */
250#include <asm/byteorder.h>
251
252#ifdef __KERNEL__
253 21
254#include <linux/errno.h> 22#include <linux/errno.h>
23#include <uapi/linux/in.h>
255 24
256static inline int proto_ports_offset(int proto) 25static inline int proto_ports_offset(int proto)
257{ 26{
@@ -332,6 +101,4 @@ static inline bool ipv4_is_test_198(__be32 addr)
332{ 101{
333 return (addr & htonl(0xfffe0000)) == htonl(0xc6120000); 102 return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
334} 103}
335#endif
336
337#endif /* _LINUX_IN_H */ 104#endif /* _LINUX_IN_H */
diff --git a/include/linux/in6.h b/include/linux/in6.h
index cba469ba11a..9e2ae26fb59 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -17,32 +17,11 @@
17 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20
21#ifndef _LINUX_IN6_H 20#ifndef _LINUX_IN6_H
22#define _LINUX_IN6_H 21#define _LINUX_IN6_H
23 22
24#include <linux/types.h> 23#include <uapi/linux/in6.h>
25
26/*
27 * IPv6 address structure
28 */
29
30struct in6_addr {
31 union {
32 __u8 u6_addr8[16];
33 __be16 u6_addr16[8];
34 __be32 u6_addr32[4];
35 } in6_u;
36#define s6_addr in6_u.u6_addr8
37#define s6_addr16 in6_u.u6_addr16
38#define s6_addr32 in6_u.u6_addr32
39};
40 24
41/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
42 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
43 * in network byte order, not in host byte order as are the IPv4 equivalents
44 */
45#ifdef __KERNEL__
46extern const struct in6_addr in6addr_any; 25extern const struct in6_addr in6addr_any;
47#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 26#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
48extern const struct in6_addr in6addr_loopback; 27extern const struct in6_addr in6addr_loopback;
@@ -54,238 +33,3 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
54#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ 33#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
55 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } 34 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
56#endif 35#endif
57
58struct sockaddr_in6 {
59 unsigned short int sin6_family; /* AF_INET6 */
60 __be16 sin6_port; /* Transport layer port # */
61 __be32 sin6_flowinfo; /* IPv6 flow information */
62 struct in6_addr sin6_addr; /* IPv6 address */
63 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
64};
65
66struct ipv6_mreq {
67 /* IPv6 multicast address of group */
68 struct in6_addr ipv6mr_multiaddr;
69
70 /* local IPv6 address of interface */
71 int ipv6mr_ifindex;
72};
73
74#define ipv6mr_acaddr ipv6mr_multiaddr
75
76struct in6_flowlabel_req {
77 struct in6_addr flr_dst;
78 __be32 flr_label;
79 __u8 flr_action;
80 __u8 flr_share;
81 __u16 flr_flags;
82 __u16 flr_expires;
83 __u16 flr_linger;
84 __u32 __flr_pad;
85 /* Options in format of IPV6_PKTOPTIONS */
86};
87
88#define IPV6_FL_A_GET 0
89#define IPV6_FL_A_PUT 1
90#define IPV6_FL_A_RENEW 2
91
92#define IPV6_FL_F_CREATE 1
93#define IPV6_FL_F_EXCL 2
94
95#define IPV6_FL_S_NONE 0
96#define IPV6_FL_S_EXCL 1
97#define IPV6_FL_S_PROCESS 2
98#define IPV6_FL_S_USER 3
99#define IPV6_FL_S_ANY 255
100
101
102/*
103 * Bitmask constant declarations to help applications select out the
104 * flow label and priority fields.
105 *
106 * Note that this are in host byte order while the flowinfo field of
107 * sockaddr_in6 is in network byte order.
108 */
109
110#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
111#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
112
113/* These definitions are obsolete */
114#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
115#define IPV6_PRIORITY_FILLER 0x0100
116#define IPV6_PRIORITY_UNATTENDED 0x0200
117#define IPV6_PRIORITY_RESERVED1 0x0300
118#define IPV6_PRIORITY_BULK 0x0400
119#define IPV6_PRIORITY_RESERVED2 0x0500
120#define IPV6_PRIORITY_INTERACTIVE 0x0600
121#define IPV6_PRIORITY_CONTROL 0x0700
122#define IPV6_PRIORITY_8 0x0800
123#define IPV6_PRIORITY_9 0x0900
124#define IPV6_PRIORITY_10 0x0a00
125#define IPV6_PRIORITY_11 0x0b00
126#define IPV6_PRIORITY_12 0x0c00
127#define IPV6_PRIORITY_13 0x0d00
128#define IPV6_PRIORITY_14 0x0e00
129#define IPV6_PRIORITY_15 0x0f00
130
131/*
132 * IPV6 extension headers
133 */
134#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
135#define IPPROTO_ROUTING 43 /* IPv6 routing header */
136#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
137#define IPPROTO_ICMPV6 58 /* ICMPv6 */
138#define IPPROTO_NONE 59 /* IPv6 no next header */
139#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
140#define IPPROTO_MH 135 /* IPv6 mobility header */
141
142/*
143 * IPv6 TLV options.
144 */
145#define IPV6_TLV_PAD1 0
146#define IPV6_TLV_PADN 1
147#define IPV6_TLV_ROUTERALERT 5
148#define IPV6_TLV_JUMBO 194
149#define IPV6_TLV_HAO 201 /* home address option */
150
151/*
152 * IPV6 socket options
153 */
154
155#define IPV6_ADDRFORM 1
156#define IPV6_2292PKTINFO 2
157#define IPV6_2292HOPOPTS 3
158#define IPV6_2292DSTOPTS 4
159#define IPV6_2292RTHDR 5
160#define IPV6_2292PKTOPTIONS 6
161#define IPV6_CHECKSUM 7
162#define IPV6_2292HOPLIMIT 8
163#define IPV6_NEXTHOP 9
164#define IPV6_AUTHHDR 10 /* obsolete */
165#define IPV6_FLOWINFO 11
166
167#define IPV6_UNICAST_HOPS 16
168#define IPV6_MULTICAST_IF 17
169#define IPV6_MULTICAST_HOPS 18
170#define IPV6_MULTICAST_LOOP 19
171#define IPV6_ADD_MEMBERSHIP 20
172#define IPV6_DROP_MEMBERSHIP 21
173#define IPV6_ROUTER_ALERT 22
174#define IPV6_MTU_DISCOVER 23
175#define IPV6_MTU 24
176#define IPV6_RECVERR 25
177#define IPV6_V6ONLY 26
178#define IPV6_JOIN_ANYCAST 27
179#define IPV6_LEAVE_ANYCAST 28
180
181/* IPV6_MTU_DISCOVER values */
182#define IPV6_PMTUDISC_DONT 0
183#define IPV6_PMTUDISC_WANT 1
184#define IPV6_PMTUDISC_DO 2
185#define IPV6_PMTUDISC_PROBE 3
186
187/* Flowlabel */
188#define IPV6_FLOWLABEL_MGR 32
189#define IPV6_FLOWINFO_SEND 33
190
191#define IPV6_IPSEC_POLICY 34
192#define IPV6_XFRM_POLICY 35
193
194/*
195 * Multicast:
196 * Following socket options are shared between IPv4 and IPv6.
197 *
198 * MCAST_JOIN_GROUP 42
199 * MCAST_BLOCK_SOURCE 43
200 * MCAST_UNBLOCK_SOURCE 44
201 * MCAST_LEAVE_GROUP 45
202 * MCAST_JOIN_SOURCE_GROUP 46
203 * MCAST_LEAVE_SOURCE_GROUP 47
204 * MCAST_MSFILTER 48
205 */
206
207/*
208 * Advanced API (RFC3542) (1)
209 *
210 * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
211 */
212
213#define IPV6_RECVPKTINFO 49
214#define IPV6_PKTINFO 50
215#define IPV6_RECVHOPLIMIT 51
216#define IPV6_HOPLIMIT 52
217#define IPV6_RECVHOPOPTS 53
218#define IPV6_HOPOPTS 54
219#define IPV6_RTHDRDSTOPTS 55
220#define IPV6_RECVRTHDR 56
221#define IPV6_RTHDR 57
222#define IPV6_RECVDSTOPTS 58
223#define IPV6_DSTOPTS 59
224#define IPV6_RECVPATHMTU 60
225#define IPV6_PATHMTU 61
226#define IPV6_DONTFRAG 62
227#if 0 /* not yet */
228#define IPV6_USE_MIN_MTU 63
229#endif
230
231/*
232 * Netfilter (1)
233 *
234 * Following socket options are used in ip6_tables;
235 * see include/linux/netfilter_ipv6/ip6_tables.h.
236 *
237 * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64
238 * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65
239 */
240
241/*
242 * Advanced API (RFC3542) (2)
243 */
244#define IPV6_RECVTCLASS 66
245#define IPV6_TCLASS 67
246
247/*
248 * Netfilter (2)
249 *
250 * Following socket options are used in ip6_tables;
251 * see include/linux/netfilter_ipv6/ip6_tables.h.
252 *
253 * IP6T_SO_GET_REVISION_MATCH 68
254 * IP6T_SO_GET_REVISION_TARGET 69
255 */
256
257/* RFC5014: Source address selection */
258#define IPV6_ADDR_PREFERENCES 72
259
260#define IPV6_PREFER_SRC_TMP 0x0001
261#define IPV6_PREFER_SRC_PUBLIC 0x0002
262#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
263#define IPV6_PREFER_SRC_COA 0x0004
264#define IPV6_PREFER_SRC_HOME 0x0400
265#define IPV6_PREFER_SRC_CGA 0x0008
266#define IPV6_PREFER_SRC_NONCGA 0x0800
267
268/* RFC5082: Generalized Ttl Security Mechanism */
269#define IPV6_MINHOPCOUNT 73
270
271#define IPV6_ORIGDSTADDR 74
272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
273#define IPV6_TRANSPARENT 75
274#define IPV6_UNICAST_IF 76
275
276/*
277 * Multicast Routing:
278 * see include/linux/mroute6.h.
279 *
280 * MRT6_INIT 200
281 * MRT6_DONE 201
282 * MRT6_ADD_MIF 202
283 * MRT6_DEL_MIF 203
284 * MRT6_ADD_MFC 204
285 * MRT6_DEL_MFC 205
286 * MRT6_VERSION 206
287 * MRT6_ASSERT 207
288 * MRT6_PIM 208
289 * (reserved) 209
290 */
291#endif
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index e788c186ed3..46da02410a0 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -1,138 +1,8 @@
1#ifndef _INET_DIAG_H_ 1#ifndef _INET_DIAG_H_
2#define _INET_DIAG_H_ 1 2#define _INET_DIAG_H_ 1
3 3
4#include <linux/types.h> 4#include <uapi/linux/inet_diag.h>
5 5
6/* Just some random number */
7#define TCPDIAG_GETSOCK 18
8#define DCCPDIAG_GETSOCK 19
9
10#define INET_DIAG_GETSOCK_MAX 24
11
12/* Socket identity */
13struct inet_diag_sockid {
14 __be16 idiag_sport;
15 __be16 idiag_dport;
16 __be32 idiag_src[4];
17 __be32 idiag_dst[4];
18 __u32 idiag_if;
19 __u32 idiag_cookie[2];
20#define INET_DIAG_NOCOOKIE (~0U)
21};
22
23/* Request structure */
24
25struct inet_diag_req {
26 __u8 idiag_family; /* Family of addresses. */
27 __u8 idiag_src_len;
28 __u8 idiag_dst_len;
29 __u8 idiag_ext; /* Query extended information */
30
31 struct inet_diag_sockid id;
32
33 __u32 idiag_states; /* States to dump */
34 __u32 idiag_dbs; /* Tables to dump (NI) */
35};
36
37struct inet_diag_req_v2 {
38 __u8 sdiag_family;
39 __u8 sdiag_protocol;
40 __u8 idiag_ext;
41 __u8 pad;
42 __u32 idiag_states;
43 struct inet_diag_sockid id;
44};
45
46enum {
47 INET_DIAG_REQ_NONE,
48 INET_DIAG_REQ_BYTECODE,
49};
50
51#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
52
53/* Bytecode is sequence of 4 byte commands followed by variable arguments.
54 * All the commands identified by "code" are conditional jumps forward:
55 * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
56 * length of the command and its arguments.
57 */
58
59struct inet_diag_bc_op {
60 unsigned char code;
61 unsigned char yes;
62 unsigned short no;
63};
64
65enum {
66 INET_DIAG_BC_NOP,
67 INET_DIAG_BC_JMP,
68 INET_DIAG_BC_S_GE,
69 INET_DIAG_BC_S_LE,
70 INET_DIAG_BC_D_GE,
71 INET_DIAG_BC_D_LE,
72 INET_DIAG_BC_AUTO,
73 INET_DIAG_BC_S_COND,
74 INET_DIAG_BC_D_COND,
75};
76
77struct inet_diag_hostcond {
78 __u8 family;
79 __u8 prefix_len;
80 int port;
81 __be32 addr[0];
82};
83
84/* Base info structure. It contains socket identity (addrs/ports/cookie)
85 * and, alas, the information shown by netstat. */
86struct inet_diag_msg {
87 __u8 idiag_family;
88 __u8 idiag_state;
89 __u8 idiag_timer;
90 __u8 idiag_retrans;
91
92 struct inet_diag_sockid id;
93
94 __u32 idiag_expires;
95 __u32 idiag_rqueue;
96 __u32 idiag_wqueue;
97 __u32 idiag_uid;
98 __u32 idiag_inode;
99};
100
101/* Extensions */
102
103enum {
104 INET_DIAG_NONE,
105 INET_DIAG_MEMINFO,
106 INET_DIAG_INFO,
107 INET_DIAG_VEGASINFO,
108 INET_DIAG_CONG,
109 INET_DIAG_TOS,
110 INET_DIAG_TCLASS,
111 INET_DIAG_SKMEMINFO,
112};
113
114#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
115
116
117/* INET_DIAG_MEM */
118
119struct inet_diag_meminfo {
120 __u32 idiag_rmem;
121 __u32 idiag_wmem;
122 __u32 idiag_fmem;
123 __u32 idiag_tmem;
124};
125
126/* INET_DIAG_VEGASINFO */
127
128struct tcpvegas_info {
129 __u32 tcpv_enabled;
130 __u32 tcpv_rttcnt;
131 __u32 tcpv_rtt;
132 __u32 tcpv_minrtt;
133};
134
135#ifdef __KERNEL__
136struct sock; 6struct sock;
137struct inet_hashinfo; 7struct inet_hashinfo;
138struct nlattr; 8struct nlattr;
@@ -173,6 +43,4 @@ int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
173 43
174extern int inet_diag_register(const struct inet_diag_handler *handler); 44extern int inet_diag_register(const struct inet_diag_handler *handler);
175extern void inet_diag_unregister(const struct inet_diag_handler *handler); 45extern void inet_diag_unregister(const struct inet_diag_handler *handler);
176#endif /* __KERNEL__ */
177
178#endif /* _INET_DIAG_H_ */ 46#endif /* _INET_DIAG_H_ */
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index d33041e2a42..23aede0b584 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -3,75 +3,12 @@
3 * 3 *
4 * Copyright (C) 2005 John McCutchan 4 * Copyright (C) 2005 John McCutchan
5 */ 5 */
6
7#ifndef _LINUX_INOTIFY_H 6#ifndef _LINUX_INOTIFY_H
8#define _LINUX_INOTIFY_H 7#define _LINUX_INOTIFY_H
9 8
10/* For O_CLOEXEC and O_NONBLOCK */
11#include <linux/fcntl.h>
12#include <linux/types.h>
13
14/*
15 * struct inotify_event - structure read from the inotify device for each event
16 *
17 * When you are watching a directory, you will receive the filename for events
18 * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
19 */
20struct inotify_event {
21 __s32 wd; /* watch descriptor */
22 __u32 mask; /* watch mask */
23 __u32 cookie; /* cookie to synchronize two events */
24 __u32 len; /* length (including nulls) of name */
25 char name[0]; /* stub for possible name */
26};
27
28/* the following are legal, implemented events that user-space can watch for */
29#define IN_ACCESS 0x00000001 /* File was accessed */
30#define IN_MODIFY 0x00000002 /* File was modified */
31#define IN_ATTRIB 0x00000004 /* Metadata changed */
32#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
33#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
34#define IN_OPEN 0x00000020 /* File was opened */
35#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
36#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
37#define IN_CREATE 0x00000100 /* Subfile was created */
38#define IN_DELETE 0x00000200 /* Subfile was deleted */
39#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
40#define IN_MOVE_SELF 0x00000800 /* Self was moved */
41
42/* the following are legal events. they are sent as needed to any watch */
43#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
44#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
45#define IN_IGNORED 0x00008000 /* File was ignored */
46
47/* helper events */
48#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
49#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
50
51/* special flags */
52#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
53#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
54#define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */
55#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
56#define IN_ISDIR 0x40000000 /* event occurred against dir */
57#define IN_ONESHOT 0x80000000 /* only send event once */
58
59/*
60 * All of the events - we build the list by hand so that we can add flags in
61 * the future and not break backward compatibility. Apps will get only the
62 * events that they originally wanted. Be sure to add new events here!
63 */
64#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
65 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
66 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
67 IN_MOVE_SELF)
68
69/* Flags for sys_inotify_init1. */
70#define IN_CLOEXEC O_CLOEXEC
71#define IN_NONBLOCK O_NONBLOCK
72
73#ifdef __KERNEL__
74#include <linux/sysctl.h> 9#include <linux/sysctl.h>
10#include <uapi/linux/inotify.h>
11
75extern struct ctl_table inotify_table[]; /* for sysctl */ 12extern struct ctl_table inotify_table[]; /* for sysctl */
76 13
77#define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ 14#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 */
82 IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \ 19 IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \
83 IN_ISDIR | IN_ONESHOT) 20 IN_ISDIR | IN_ONESHOT)
84 21
85#endif
86
87#endif /* _LINUX_INOTIFY_H */ 22#endif /* _LINUX_INOTIFY_H */
diff --git a/include/linux/input.h b/include/linux/input.h
index 15464ba6bf5..cab994ba6d9 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1,6 +1,3 @@
1#ifndef _INPUT_H
2#define _INPUT_H
3
4/* 1/*
5 * Copyright (c) 1999-2002 Vojtech Pavlik 2 * Copyright (c) 1999-2002 Vojtech Pavlik
6 * 3 *
@@ -8,1156 +5,15 @@
8 * under the terms of the GNU General Public License version 2 as published by 5 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 6 * the Free Software Foundation.
10 */ 7 */
8#ifndef _INPUT_H
9#define _INPUT_H
11 10
12#ifdef __KERNEL__
13#include <linux/time.h> 11#include <linux/time.h>
14#include <linux/list.h> 12#include <linux/list.h>
15#else 13#include <uapi/linux/input.h>
16#include <sys/time.h>
17#include <sys/ioctl.h>
18#include <sys/types.h>
19#include <linux/types.h>
20#endif
21
22/*
23 * The event structure itself
24 */
25
26struct input_event {
27 struct timeval time;
28 __u16 type;
29 __u16 code;
30 __s32 value;
31};
32
33/*
34 * Protocol version.
35 */
36
37#define EV_VERSION 0x010001
38
39/*
40 * IOCTLs (0x00 - 0x7f)
41 */
42
43struct input_id {
44 __u16 bustype;
45 __u16 vendor;
46 __u16 product;
47 __u16 version;
48};
49
50/**
51 * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls
52 * @value: latest reported value for the axis.
53 * @minimum: specifies minimum value for the axis.
54 * @maximum: specifies maximum value for the axis.
55 * @fuzz: specifies fuzz value that is used to filter noise from
56 * the event stream.
57 * @flat: values that are within this value will be discarded by
58 * joydev interface and reported as 0 instead.
59 * @resolution: specifies resolution for the values reported for
60 * the axis.
61 *
62 * Note that input core does not clamp reported values to the
63 * [minimum, maximum] limits, such task is left to userspace.
64 *
65 * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in
66 * units per millimeter (units/mm), resolution for rotational axes
67 * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
68 */
69struct input_absinfo {
70 __s32 value;
71 __s32 minimum;
72 __s32 maximum;
73 __s32 fuzz;
74 __s32 flat;
75 __s32 resolution;
76};
77
78/**
79 * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
80 * @scancode: scancode represented in machine-endian form.
81 * @len: length of the scancode that resides in @scancode buffer.
82 * @index: index in the keymap, may be used instead of scancode
83 * @flags: allows to specify how kernel should handle the request. For
84 * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
85 * should perform lookup in keymap by @index instead of @scancode
86 * @keycode: key code assigned to this scancode
87 *
88 * The structure is used to retrieve and modify keymap data. Users have
89 * option of performing lookup either by @scancode itself or by @index
90 * in keymap entry. EVIOCGKEYCODE will also return scancode or index
91 * (depending on which element was used to perform lookup).
92 */
93struct input_keymap_entry {
94#define INPUT_KEYMAP_BY_INDEX (1 << 0)
95 __u8 flags;
96 __u8 len;
97 __u16 index;
98 __u32 keycode;
99 __u8 scancode[32];
100};
101
102#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
103#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
104#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
105#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
106
107#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
108#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
109#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
110#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
111
112#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
113#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
114#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
115#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */
116
117/**
118 * EVIOCGMTSLOTS(len) - get MT slot values
119 * @len: size of the data buffer in bytes
120 *
121 * The ioctl buffer argument should be binary equivalent to
122 *
123 * struct input_mt_request_layout {
124 * __u32 code;
125 * __s32 values[num_slots];
126 * };
127 *
128 * where num_slots is the (arbitrary) number of MT slots to extract.
129 *
130 * The ioctl size argument (len) is the size of the buffer, which
131 * should satisfy len = (num_slots + 1) * sizeof(__s32). If len is
132 * too small to fit all available slots, the first num_slots are
133 * returned.
134 *
135 * Before the call, code is set to the wanted ABS_MT event type. On
136 * return, values[] is filled with the slot values for the specified
137 * ABS_MT code.
138 *
139 * If the request code is not an ABS_MT value, -EINVAL is returned.
140 */
141#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
142
143#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
144#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
145#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
146#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
147
148#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */
149#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */
150#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */
151
152#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
153#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
154#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
155
156#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
157
158#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */
159
160/*
161 * Device properties and quirks
162 */
163
164#define INPUT_PROP_POINTER 0x00 /* needs a pointer */
165#define INPUT_PROP_DIRECT 0x01 /* direct input devices */
166#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */
167#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */
168
169#define INPUT_PROP_MAX 0x1f
170#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
171
172/*
173 * Event types
174 */
175
176#define EV_SYN 0x00
177#define EV_KEY 0x01
178#define EV_REL 0x02
179#define EV_ABS 0x03
180#define EV_MSC 0x04
181#define EV_SW 0x05
182#define EV_LED 0x11
183#define EV_SND 0x12
184#define EV_REP 0x14
185#define EV_FF 0x15
186#define EV_PWR 0x16
187#define EV_FF_STATUS 0x17
188#define EV_MAX 0x1f
189#define EV_CNT (EV_MAX+1)
190
191/*
192 * Synchronization events.
193 */
194
195#define SYN_REPORT 0
196#define SYN_CONFIG 1
197#define SYN_MT_REPORT 2
198#define SYN_DROPPED 3
199
200/*
201 * Keys and buttons
202 *
203 * Most of the keys/buttons are modeled after USB HUT 1.12
204 * (see http://www.usb.org/developers/hidpage).
205 * Abbreviations in the comments:
206 * AC - Application Control
207 * AL - Application Launch Button
208 * SC - System Control
209 */
210
211#define KEY_RESERVED 0
212#define KEY_ESC 1
213#define KEY_1 2
214#define KEY_2 3
215#define KEY_3 4
216#define KEY_4 5
217#define KEY_5 6
218#define KEY_6 7
219#define KEY_7 8
220#define KEY_8 9
221#define KEY_9 10
222#define KEY_0 11
223#define KEY_MINUS 12
224#define KEY_EQUAL 13
225#define KEY_BACKSPACE 14
226#define KEY_TAB 15
227#define KEY_Q 16
228#define KEY_W 17
229#define KEY_E 18
230#define KEY_R 19
231#define KEY_T 20
232#define KEY_Y 21
233#define KEY_U 22
234#define KEY_I 23
235#define KEY_O 24
236#define KEY_P 25
237#define KEY_LEFTBRACE 26
238#define KEY_RIGHTBRACE 27
239#define KEY_ENTER 28
240#define KEY_LEFTCTRL 29
241#define KEY_A 30
242#define KEY_S 31
243#define KEY_D 32
244#define KEY_F 33
245#define KEY_G 34
246#define KEY_H 35
247#define KEY_J 36
248#define KEY_K 37
249#define KEY_L 38
250#define KEY_SEMICOLON 39
251#define KEY_APOSTROPHE 40
252#define KEY_GRAVE 41
253#define KEY_LEFTSHIFT 42
254#define KEY_BACKSLASH 43
255#define KEY_Z 44
256#define KEY_X 45
257#define KEY_C 46
258#define KEY_V 47
259#define KEY_B 48
260#define KEY_N 49
261#define KEY_M 50
262#define KEY_COMMA 51
263#define KEY_DOT 52
264#define KEY_SLASH 53
265#define KEY_RIGHTSHIFT 54
266#define KEY_KPASTERISK 55
267#define KEY_LEFTALT 56
268#define KEY_SPACE 57
269#define KEY_CAPSLOCK 58
270#define KEY_F1 59
271#define KEY_F2 60
272#define KEY_F3 61
273#define KEY_F4 62
274#define KEY_F5 63
275#define KEY_F6 64
276#define KEY_F7 65
277#define KEY_F8 66
278#define KEY_F9 67
279#define KEY_F10 68
280#define KEY_NUMLOCK 69
281#define KEY_SCROLLLOCK 70
282#define KEY_KP7 71
283#define KEY_KP8 72
284#define KEY_KP9 73
285#define KEY_KPMINUS 74
286#define KEY_KP4 75
287#define KEY_KP5 76
288#define KEY_KP6 77
289#define KEY_KPPLUS 78
290#define KEY_KP1 79
291#define KEY_KP2 80
292#define KEY_KP3 81
293#define KEY_KP0 82
294#define KEY_KPDOT 83
295
296#define KEY_ZENKAKUHANKAKU 85
297#define KEY_102ND 86
298#define KEY_F11 87
299#define KEY_F12 88
300#define KEY_RO 89
301#define KEY_KATAKANA 90
302#define KEY_HIRAGANA 91
303#define KEY_HENKAN 92
304#define KEY_KATAKANAHIRAGANA 93
305#define KEY_MUHENKAN 94
306#define KEY_KPJPCOMMA 95
307#define KEY_KPENTER 96
308#define KEY_RIGHTCTRL 97
309#define KEY_KPSLASH 98
310#define KEY_SYSRQ 99
311#define KEY_RIGHTALT 100
312#define KEY_LINEFEED 101
313#define KEY_HOME 102
314#define KEY_UP 103
315#define KEY_PAGEUP 104
316#define KEY_LEFT 105
317#define KEY_RIGHT 106
318#define KEY_END 107
319#define KEY_DOWN 108
320#define KEY_PAGEDOWN 109
321#define KEY_INSERT 110
322#define KEY_DELETE 111
323#define KEY_MACRO 112
324#define KEY_MUTE 113
325#define KEY_VOLUMEDOWN 114
326#define KEY_VOLUMEUP 115
327#define KEY_POWER 116 /* SC System Power Down */
328#define KEY_KPEQUAL 117
329#define KEY_KPPLUSMINUS 118
330#define KEY_PAUSE 119
331#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
332
333#define KEY_KPCOMMA 121
334#define KEY_HANGEUL 122
335#define KEY_HANGUEL KEY_HANGEUL
336#define KEY_HANJA 123
337#define KEY_YEN 124
338#define KEY_LEFTMETA 125
339#define KEY_RIGHTMETA 126
340#define KEY_COMPOSE 127
341
342#define KEY_STOP 128 /* AC Stop */
343#define KEY_AGAIN 129
344#define KEY_PROPS 130 /* AC Properties */
345#define KEY_UNDO 131 /* AC Undo */
346#define KEY_FRONT 132
347#define KEY_COPY 133 /* AC Copy */
348#define KEY_OPEN 134 /* AC Open */
349#define KEY_PASTE 135 /* AC Paste */
350#define KEY_FIND 136 /* AC Search */
351#define KEY_CUT 137 /* AC Cut */
352#define KEY_HELP 138 /* AL Integrated Help Center */
353#define KEY_MENU 139 /* Menu (show menu) */
354#define KEY_CALC 140 /* AL Calculator */
355#define KEY_SETUP 141
356#define KEY_SLEEP 142 /* SC System Sleep */
357#define KEY_WAKEUP 143 /* System Wake Up */
358#define KEY_FILE 144 /* AL Local Machine Browser */
359#define KEY_SENDFILE 145
360#define KEY_DELETEFILE 146
361#define KEY_XFER 147
362#define KEY_PROG1 148
363#define KEY_PROG2 149
364#define KEY_WWW 150 /* AL Internet Browser */
365#define KEY_MSDOS 151
366#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
367#define KEY_SCREENLOCK KEY_COFFEE
368#define KEY_DIRECTION 153
369#define KEY_CYCLEWINDOWS 154
370#define KEY_MAIL 155
371#define KEY_BOOKMARKS 156 /* AC Bookmarks */
372#define KEY_COMPUTER 157
373#define KEY_BACK 158 /* AC Back */
374#define KEY_FORWARD 159 /* AC Forward */
375#define KEY_CLOSECD 160
376#define KEY_EJECTCD 161
377#define KEY_EJECTCLOSECD 162
378#define KEY_NEXTSONG 163
379#define KEY_PLAYPAUSE 164
380#define KEY_PREVIOUSSONG 165
381#define KEY_STOPCD 166
382#define KEY_RECORD 167
383#define KEY_REWIND 168
384#define KEY_PHONE 169 /* Media Select Telephone */
385#define KEY_ISO 170
386#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
387#define KEY_HOMEPAGE 172 /* AC Home */
388#define KEY_REFRESH 173 /* AC Refresh */
389#define KEY_EXIT 174 /* AC Exit */
390#define KEY_MOVE 175
391#define KEY_EDIT 176
392#define KEY_SCROLLUP 177
393#define KEY_SCROLLDOWN 178
394#define KEY_KPLEFTPAREN 179
395#define KEY_KPRIGHTPAREN 180
396#define KEY_NEW 181 /* AC New */
397#define KEY_REDO 182 /* AC Redo/Repeat */
398
399#define KEY_F13 183
400#define KEY_F14 184
401#define KEY_F15 185
402#define KEY_F16 186
403#define KEY_F17 187
404#define KEY_F18 188
405#define KEY_F19 189
406#define KEY_F20 190
407#define KEY_F21 191
408#define KEY_F22 192
409#define KEY_F23 193
410#define KEY_F24 194
411
412#define KEY_PLAYCD 200
413#define KEY_PAUSECD 201
414#define KEY_PROG3 202
415#define KEY_PROG4 203
416#define KEY_DASHBOARD 204 /* AL Dashboard */
417#define KEY_SUSPEND 205
418#define KEY_CLOSE 206 /* AC Close */
419#define KEY_PLAY 207
420#define KEY_FASTFORWARD 208
421#define KEY_BASSBOOST 209
422#define KEY_PRINT 210 /* AC Print */
423#define KEY_HP 211
424#define KEY_CAMERA 212
425#define KEY_SOUND 213
426#define KEY_QUESTION 214
427#define KEY_EMAIL 215
428#define KEY_CHAT 216
429#define KEY_SEARCH 217
430#define KEY_CONNECT 218
431#define KEY_FINANCE 219 /* AL Checkbook/Finance */
432#define KEY_SPORT 220
433#define KEY_SHOP 221
434#define KEY_ALTERASE 222
435#define KEY_CANCEL 223 /* AC Cancel */
436#define KEY_BRIGHTNESSDOWN 224
437#define KEY_BRIGHTNESSUP 225
438#define KEY_MEDIA 226
439
440#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
441 outputs (Monitor/LCD/TV-out/etc) */
442#define KEY_KBDILLUMTOGGLE 228
443#define KEY_KBDILLUMDOWN 229
444#define KEY_KBDILLUMUP 230
445
446#define KEY_SEND 231 /* AC Send */
447#define KEY_REPLY 232 /* AC Reply */
448#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
449#define KEY_SAVE 234 /* AC Save */
450#define KEY_DOCUMENTS 235
451
452#define KEY_BATTERY 236
453
454#define KEY_BLUETOOTH 237
455#define KEY_WLAN 238
456#define KEY_UWB 239
457
458#define KEY_UNKNOWN 240
459
460#define KEY_VIDEO_NEXT 241 /* drive next video source */
461#define KEY_VIDEO_PREV 242 /* drive previous video source */
462#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
463#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
464#define KEY_DISPLAY_OFF 245 /* display device to off state */
465
466#define KEY_WIMAX 246
467#define KEY_RFKILL 247 /* Key that controls all radios */
468
469#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
470
471/* Code 255 is reserved for special needs of AT keyboard driver */
472
473#define BTN_MISC 0x100
474#define BTN_0 0x100
475#define BTN_1 0x101
476#define BTN_2 0x102
477#define BTN_3 0x103
478#define BTN_4 0x104
479#define BTN_5 0x105
480#define BTN_6 0x106
481#define BTN_7 0x107
482#define BTN_8 0x108
483#define BTN_9 0x109
484
485#define BTN_MOUSE 0x110
486#define BTN_LEFT 0x110
487#define BTN_RIGHT 0x111
488#define BTN_MIDDLE 0x112
489#define BTN_SIDE 0x113
490#define BTN_EXTRA 0x114
491#define BTN_FORWARD 0x115
492#define BTN_BACK 0x116
493#define BTN_TASK 0x117
494
495#define BTN_JOYSTICK 0x120
496#define BTN_TRIGGER 0x120
497#define BTN_THUMB 0x121
498#define BTN_THUMB2 0x122
499#define BTN_TOP 0x123
500#define BTN_TOP2 0x124
501#define BTN_PINKIE 0x125
502#define BTN_BASE 0x126
503#define BTN_BASE2 0x127
504#define BTN_BASE3 0x128
505#define BTN_BASE4 0x129
506#define BTN_BASE5 0x12a
507#define BTN_BASE6 0x12b
508#define BTN_DEAD 0x12f
509
510#define BTN_GAMEPAD 0x130
511#define BTN_A 0x130
512#define BTN_B 0x131
513#define BTN_C 0x132
514#define BTN_X 0x133
515#define BTN_Y 0x134
516#define BTN_Z 0x135
517#define BTN_TL 0x136
518#define BTN_TR 0x137
519#define BTN_TL2 0x138
520#define BTN_TR2 0x139
521#define BTN_SELECT 0x13a
522#define BTN_START 0x13b
523#define BTN_MODE 0x13c
524#define BTN_THUMBL 0x13d
525#define BTN_THUMBR 0x13e
526
527#define BTN_DIGI 0x140
528#define BTN_TOOL_PEN 0x140
529#define BTN_TOOL_RUBBER 0x141
530#define BTN_TOOL_BRUSH 0x142
531#define BTN_TOOL_PENCIL 0x143
532#define BTN_TOOL_AIRBRUSH 0x144
533#define BTN_TOOL_FINGER 0x145
534#define BTN_TOOL_MOUSE 0x146
535#define BTN_TOOL_LENS 0x147
536#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
537#define BTN_TOUCH 0x14a
538#define BTN_STYLUS 0x14b
539#define BTN_STYLUS2 0x14c
540#define BTN_TOOL_DOUBLETAP 0x14d
541#define BTN_TOOL_TRIPLETAP 0x14e
542#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
543
544#define BTN_WHEEL 0x150
545#define BTN_GEAR_DOWN 0x150
546#define BTN_GEAR_UP 0x151
547
548#define KEY_OK 0x160
549#define KEY_SELECT 0x161
550#define KEY_GOTO 0x162
551#define KEY_CLEAR 0x163
552#define KEY_POWER2 0x164
553#define KEY_OPTION 0x165
554#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
555#define KEY_TIME 0x167
556#define KEY_VENDOR 0x168
557#define KEY_ARCHIVE 0x169
558#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
559#define KEY_CHANNEL 0x16b
560#define KEY_FAVORITES 0x16c
561#define KEY_EPG 0x16d
562#define KEY_PVR 0x16e /* Media Select Home */
563#define KEY_MHP 0x16f
564#define KEY_LANGUAGE 0x170
565#define KEY_TITLE 0x171
566#define KEY_SUBTITLE 0x172
567#define KEY_ANGLE 0x173
568#define KEY_ZOOM 0x174
569#define KEY_MODE 0x175
570#define KEY_KEYBOARD 0x176
571#define KEY_SCREEN 0x177
572#define KEY_PC 0x178 /* Media Select Computer */
573#define KEY_TV 0x179 /* Media Select TV */
574#define KEY_TV2 0x17a /* Media Select Cable */
575#define KEY_VCR 0x17b /* Media Select VCR */
576#define KEY_VCR2 0x17c /* VCR Plus */
577#define KEY_SAT 0x17d /* Media Select Satellite */
578#define KEY_SAT2 0x17e
579#define KEY_CD 0x17f /* Media Select CD */
580#define KEY_TAPE 0x180 /* Media Select Tape */
581#define KEY_RADIO 0x181
582#define KEY_TUNER 0x182 /* Media Select Tuner */
583#define KEY_PLAYER 0x183
584#define KEY_TEXT 0x184
585#define KEY_DVD 0x185 /* Media Select DVD */
586#define KEY_AUX 0x186
587#define KEY_MP3 0x187
588#define KEY_AUDIO 0x188 /* AL Audio Browser */
589#define KEY_VIDEO 0x189 /* AL Movie Browser */
590#define KEY_DIRECTORY 0x18a
591#define KEY_LIST 0x18b
592#define KEY_MEMO 0x18c /* Media Select Messages */
593#define KEY_CALENDAR 0x18d
594#define KEY_RED 0x18e
595#define KEY_GREEN 0x18f
596#define KEY_YELLOW 0x190
597#define KEY_BLUE 0x191
598#define KEY_CHANNELUP 0x192 /* Channel Increment */
599#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
600#define KEY_FIRST 0x194
601#define KEY_LAST 0x195 /* Recall Last */
602#define KEY_AB 0x196
603#define KEY_NEXT 0x197
604#define KEY_RESTART 0x198
605#define KEY_SLOW 0x199
606#define KEY_SHUFFLE 0x19a
607#define KEY_BREAK 0x19b
608#define KEY_PREVIOUS 0x19c
609#define KEY_DIGITS 0x19d
610#define KEY_TEEN 0x19e
611#define KEY_TWEN 0x19f
612#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
613#define KEY_GAMES 0x1a1 /* Media Select Games */
614#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
615#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
616#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
617#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
618#define KEY_EDITOR 0x1a6 /* AL Text Editor */
619#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
620#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
621#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
622#define KEY_DATABASE 0x1aa /* AL Database App */
623#define KEY_NEWS 0x1ab /* AL Newsreader */
624#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
625#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
626#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
627#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
628#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
629#define KEY_LOGOFF 0x1b1 /* AL Logoff */
630
631#define KEY_DOLLAR 0x1b2
632#define KEY_EURO 0x1b3
633
634#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
635#define KEY_FRAMEFORWARD 0x1b5
636#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
637#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
638#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
639#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
640#define KEY_IMAGES 0x1ba /* AL Image Browser */
641
642#define KEY_DEL_EOL 0x1c0
643#define KEY_DEL_EOS 0x1c1
644#define KEY_INS_LINE 0x1c2
645#define KEY_DEL_LINE 0x1c3
646
647#define KEY_FN 0x1d0
648#define KEY_FN_ESC 0x1d1
649#define KEY_FN_F1 0x1d2
650#define KEY_FN_F2 0x1d3
651#define KEY_FN_F3 0x1d4
652#define KEY_FN_F4 0x1d5
653#define KEY_FN_F5 0x1d6
654#define KEY_FN_F6 0x1d7
655#define KEY_FN_F7 0x1d8
656#define KEY_FN_F8 0x1d9
657#define KEY_FN_F9 0x1da
658#define KEY_FN_F10 0x1db
659#define KEY_FN_F11 0x1dc
660#define KEY_FN_F12 0x1dd
661#define KEY_FN_1 0x1de
662#define KEY_FN_2 0x1df
663#define KEY_FN_D 0x1e0
664#define KEY_FN_E 0x1e1
665#define KEY_FN_F 0x1e2
666#define KEY_FN_S 0x1e3
667#define KEY_FN_B 0x1e4
668
669#define KEY_BRL_DOT1 0x1f1
670#define KEY_BRL_DOT2 0x1f2
671#define KEY_BRL_DOT3 0x1f3
672#define KEY_BRL_DOT4 0x1f4
673#define KEY_BRL_DOT5 0x1f5
674#define KEY_BRL_DOT6 0x1f6
675#define KEY_BRL_DOT7 0x1f7
676#define KEY_BRL_DOT8 0x1f8
677#define KEY_BRL_DOT9 0x1f9
678#define KEY_BRL_DOT10 0x1fa
679
680#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
681#define KEY_NUMERIC_1 0x201 /* and other keypads */
682#define KEY_NUMERIC_2 0x202
683#define KEY_NUMERIC_3 0x203
684#define KEY_NUMERIC_4 0x204
685#define KEY_NUMERIC_5 0x205
686#define KEY_NUMERIC_6 0x206
687#define KEY_NUMERIC_7 0x207
688#define KEY_NUMERIC_8 0x208
689#define KEY_NUMERIC_9 0x209
690#define KEY_NUMERIC_STAR 0x20a
691#define KEY_NUMERIC_POUND 0x20b
692
693#define KEY_CAMERA_FOCUS 0x210
694#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
695
696#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */
697#define KEY_TOUCHPAD_ON 0x213
698#define KEY_TOUCHPAD_OFF 0x214
699
700#define KEY_CAMERA_ZOOMIN 0x215
701#define KEY_CAMERA_ZOOMOUT 0x216
702#define KEY_CAMERA_UP 0x217
703#define KEY_CAMERA_DOWN 0x218
704#define KEY_CAMERA_LEFT 0x219
705#define KEY_CAMERA_RIGHT 0x21a
706
707#define BTN_TRIGGER_HAPPY 0x2c0
708#define BTN_TRIGGER_HAPPY1 0x2c0
709#define BTN_TRIGGER_HAPPY2 0x2c1
710#define BTN_TRIGGER_HAPPY3 0x2c2
711#define BTN_TRIGGER_HAPPY4 0x2c3
712#define BTN_TRIGGER_HAPPY5 0x2c4
713#define BTN_TRIGGER_HAPPY6 0x2c5
714#define BTN_TRIGGER_HAPPY7 0x2c6
715#define BTN_TRIGGER_HAPPY8 0x2c7
716#define BTN_TRIGGER_HAPPY9 0x2c8
717#define BTN_TRIGGER_HAPPY10 0x2c9
718#define BTN_TRIGGER_HAPPY11 0x2ca
719#define BTN_TRIGGER_HAPPY12 0x2cb
720#define BTN_TRIGGER_HAPPY13 0x2cc
721#define BTN_TRIGGER_HAPPY14 0x2cd
722#define BTN_TRIGGER_HAPPY15 0x2ce
723#define BTN_TRIGGER_HAPPY16 0x2cf
724#define BTN_TRIGGER_HAPPY17 0x2d0
725#define BTN_TRIGGER_HAPPY18 0x2d1
726#define BTN_TRIGGER_HAPPY19 0x2d2
727#define BTN_TRIGGER_HAPPY20 0x2d3
728#define BTN_TRIGGER_HAPPY21 0x2d4
729#define BTN_TRIGGER_HAPPY22 0x2d5
730#define BTN_TRIGGER_HAPPY23 0x2d6
731#define BTN_TRIGGER_HAPPY24 0x2d7
732#define BTN_TRIGGER_HAPPY25 0x2d8
733#define BTN_TRIGGER_HAPPY26 0x2d9
734#define BTN_TRIGGER_HAPPY27 0x2da
735#define BTN_TRIGGER_HAPPY28 0x2db
736#define BTN_TRIGGER_HAPPY29 0x2dc
737#define BTN_TRIGGER_HAPPY30 0x2dd
738#define BTN_TRIGGER_HAPPY31 0x2de
739#define BTN_TRIGGER_HAPPY32 0x2df
740#define BTN_TRIGGER_HAPPY33 0x2e0
741#define BTN_TRIGGER_HAPPY34 0x2e1
742#define BTN_TRIGGER_HAPPY35 0x2e2
743#define BTN_TRIGGER_HAPPY36 0x2e3
744#define BTN_TRIGGER_HAPPY37 0x2e4
745#define BTN_TRIGGER_HAPPY38 0x2e5
746#define BTN_TRIGGER_HAPPY39 0x2e6
747#define BTN_TRIGGER_HAPPY40 0x2e7
748
749/* We avoid low common keys in module aliases so they don't get huge. */
750#define KEY_MIN_INTERESTING KEY_MUTE
751#define KEY_MAX 0x2ff
752#define KEY_CNT (KEY_MAX+1)
753
754/*
755 * Relative axes
756 */
757
758#define REL_X 0x00
759#define REL_Y 0x01
760#define REL_Z 0x02
761#define REL_RX 0x03
762#define REL_RY 0x04
763#define REL_RZ 0x05
764#define REL_HWHEEL 0x06
765#define REL_DIAL 0x07
766#define REL_WHEEL 0x08
767#define REL_MISC 0x09
768#define REL_MAX 0x0f
769#define REL_CNT (REL_MAX+1)
770
771/*
772 * Absolute axes
773 */
774
775#define ABS_X 0x00
776#define ABS_Y 0x01
777#define ABS_Z 0x02
778#define ABS_RX 0x03
779#define ABS_RY 0x04
780#define ABS_RZ 0x05
781#define ABS_THROTTLE 0x06
782#define ABS_RUDDER 0x07
783#define ABS_WHEEL 0x08
784#define ABS_GAS 0x09
785#define ABS_BRAKE 0x0a
786#define ABS_HAT0X 0x10
787#define ABS_HAT0Y 0x11
788#define ABS_HAT1X 0x12
789#define ABS_HAT1Y 0x13
790#define ABS_HAT2X 0x14
791#define ABS_HAT2Y 0x15
792#define ABS_HAT3X 0x16
793#define ABS_HAT3Y 0x17
794#define ABS_PRESSURE 0x18
795#define ABS_DISTANCE 0x19
796#define ABS_TILT_X 0x1a
797#define ABS_TILT_Y 0x1b
798#define ABS_TOOL_WIDTH 0x1c
799
800#define ABS_VOLUME 0x20
801
802#define ABS_MISC 0x28
803
804#define ABS_MT_SLOT 0x2f /* MT slot being modified */
805#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
806#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
807#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
808#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
809#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
810#define ABS_MT_POSITION_X 0x35 /* Center X touch position */
811#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */
812#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
813#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
814#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
815#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
816#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
817#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
818#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */
819
820#ifdef __KERNEL__
821/* Implementation details, userspace should not care about these */ 14/* Implementation details, userspace should not care about these */
822#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR 15#define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
823#define ABS_MT_LAST ABS_MT_TOOL_Y 16#define ABS_MT_LAST ABS_MT_TOOL_Y
824#endif
825
826#define ABS_MAX 0x3f
827#define ABS_CNT (ABS_MAX+1)
828
829/*
830 * Switch events
831 */
832
833#define SW_LID 0x00 /* set = lid shut */
834#define SW_TABLET_MODE 0x01 /* set = tablet mode */
835#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
836#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any"
837 set = radio enabled */
838#define SW_RADIO SW_RFKILL_ALL /* deprecated */
839#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */
840#define SW_DOCK 0x05 /* set = plugged into dock */
841#define SW_LINEOUT_INSERT 0x06 /* set = inserted */
842#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */
843#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */
844#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */
845#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */
846#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
847#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
848#define SW_LINEIN_INSERT 0x0d /* set = inserted */
849#define SW_MAX 0x0f
850#define SW_CNT (SW_MAX+1)
851
852/*
853 * Misc events
854 */
855
856#define MSC_SERIAL 0x00
857#define MSC_PULSELED 0x01
858#define MSC_GESTURE 0x02
859#define MSC_RAW 0x03
860#define MSC_SCAN 0x04
861#define MSC_MAX 0x07
862#define MSC_CNT (MSC_MAX+1)
863
864/*
865 * LEDs
866 */
867
868#define LED_NUML 0x00
869#define LED_CAPSL 0x01
870#define LED_SCROLLL 0x02
871#define LED_COMPOSE 0x03
872#define LED_KANA 0x04
873#define LED_SLEEP 0x05
874#define LED_SUSPEND 0x06
875#define LED_MUTE 0x07
876#define LED_MISC 0x08
877#define LED_MAIL 0x09
878#define LED_CHARGING 0x0a
879#define LED_MAX 0x0f
880#define LED_CNT (LED_MAX+1)
881
882/*
883 * Autorepeat values
884 */
885
886#define REP_DELAY 0x00
887#define REP_PERIOD 0x01
888#define REP_MAX 0x01
889#define REP_CNT (REP_MAX+1)
890
891/*
892 * Sounds
893 */
894
895#define SND_CLICK 0x00
896#define SND_BELL 0x01
897#define SND_TONE 0x02
898#define SND_MAX 0x07
899#define SND_CNT (SND_MAX+1)
900
901/*
902 * IDs.
903 */
904
905#define ID_BUS 0
906#define ID_VENDOR 1
907#define ID_PRODUCT 2
908#define ID_VERSION 3
909
910#define BUS_PCI 0x01
911#define BUS_ISAPNP 0x02
912#define BUS_USB 0x03
913#define BUS_HIL 0x04
914#define BUS_BLUETOOTH 0x05
915#define BUS_VIRTUAL 0x06
916
917#define BUS_ISA 0x10
918#define BUS_I8042 0x11
919#define BUS_XTKBD 0x12
920#define BUS_RS232 0x13
921#define BUS_GAMEPORT 0x14
922#define BUS_PARPORT 0x15
923#define BUS_AMIGA 0x16
924#define BUS_ADB 0x17
925#define BUS_I2C 0x18
926#define BUS_HOST 0x19
927#define BUS_GSC 0x1A
928#define BUS_ATARI 0x1B
929#define BUS_SPI 0x1C
930
931/*
932 * MT_TOOL types
933 */
934#define MT_TOOL_FINGER 0
935#define MT_TOOL_PEN 1
936#define MT_TOOL_MAX 1
937
938/*
939 * Values describing the status of a force-feedback effect
940 */
941#define FF_STATUS_STOPPED 0x00
942#define FF_STATUS_PLAYING 0x01
943#define FF_STATUS_MAX 0x01
944
945/*
946 * Structures used in ioctls to upload effects to a device
947 * They are pieces of a bigger structure (called ff_effect)
948 */
949
950/*
951 * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
952 * should not be used and have unspecified results.
953 */
954
955/**
956 * struct ff_replay - defines scheduling of the force-feedback effect
957 * @length: duration of the effect
958 * @delay: delay before effect should start playing
959 */
960struct ff_replay {
961 __u16 length;
962 __u16 delay;
963};
964
965/**
966 * struct ff_trigger - defines what triggers the force-feedback effect
967 * @button: number of the button triggering the effect
968 * @interval: controls how soon the effect can be re-triggered
969 */
970struct ff_trigger {
971 __u16 button;
972 __u16 interval;
973};
974
975/**
976 * struct ff_envelope - generic force-feedback effect envelope
977 * @attack_length: duration of the attack (ms)
978 * @attack_level: level at the beginning of the attack
979 * @fade_length: duration of fade (ms)
980 * @fade_level: level at the end of fade
981 *
982 * The @attack_level and @fade_level are absolute values; when applying
983 * envelope force-feedback core will convert to positive/negative
984 * value based on polarity of the default level of the effect.
985 * Valid range for the attack and fade levels is 0x0000 - 0x7fff
986 */
987struct ff_envelope {
988 __u16 attack_length;
989 __u16 attack_level;
990 __u16 fade_length;
991 __u16 fade_level;
992};
993
994/**
995 * struct ff_constant_effect - defines parameters of a constant force-feedback effect
996 * @level: strength of the effect; may be negative
997 * @envelope: envelope data
998 */
999struct ff_constant_effect {
1000 __s16 level;
1001 struct ff_envelope envelope;
1002};
1003
1004/**
1005 * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
1006 * @start_level: beginning strength of the effect; may be negative
1007 * @end_level: final strength of the effect; may be negative
1008 * @envelope: envelope data
1009 */
1010struct ff_ramp_effect {
1011 __s16 start_level;
1012 __s16 end_level;
1013 struct ff_envelope envelope;
1014};
1015
1016/**
1017 * struct ff_condition_effect - defines a spring or friction force-feedback effect
1018 * @right_saturation: maximum level when joystick moved all way to the right
1019 * @left_saturation: same for the left side
1020 * @right_coeff: controls how fast the force grows when the joystick moves
1021 * to the right
1022 * @left_coeff: same for the left side
1023 * @deadband: size of the dead zone, where no force is produced
1024 * @center: position of the dead zone
1025 */
1026struct ff_condition_effect {
1027 __u16 right_saturation;
1028 __u16 left_saturation;
1029
1030 __s16 right_coeff;
1031 __s16 left_coeff;
1032
1033 __u16 deadband;
1034 __s16 center;
1035};
1036
1037/**
1038 * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
1039 * @waveform: kind of the effect (wave)
1040 * @period: period of the wave (ms)
1041 * @magnitude: peak value
1042 * @offset: mean value of the wave (roughly)
1043 * @phase: 'horizontal' shift
1044 * @envelope: envelope data
1045 * @custom_len: number of samples (FF_CUSTOM only)
1046 * @custom_data: buffer of samples (FF_CUSTOM only)
1047 *
1048 * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
1049 * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
1050 * for the time being as no driver supports it yet.
1051 *
1052 * Note: the data pointed by custom_data is copied by the driver.
1053 * You can therefore dispose of the memory after the upload/update.
1054 */
1055struct ff_periodic_effect {
1056 __u16 waveform;
1057 __u16 period;
1058 __s16 magnitude;
1059 __s16 offset;
1060 __u16 phase;
1061
1062 struct ff_envelope envelope;
1063
1064 __u32 custom_len;
1065 __s16 __user *custom_data;
1066};
1067
1068/**
1069 * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
1070 * @strong_magnitude: magnitude of the heavy motor
1071 * @weak_magnitude: magnitude of the light one
1072 *
1073 * Some rumble pads have two motors of different weight. Strong_magnitude
1074 * represents the magnitude of the vibration generated by the heavy one.
1075 */
1076struct ff_rumble_effect {
1077 __u16 strong_magnitude;
1078 __u16 weak_magnitude;
1079};
1080
1081/**
1082 * struct ff_effect - defines force feedback effect
1083 * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
1084 * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
1085 * @id: an unique id assigned to an effect
1086 * @direction: direction of the effect
1087 * @trigger: trigger conditions (struct ff_trigger)
1088 * @replay: scheduling of the effect (struct ff_replay)
1089 * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
1090 * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
1091 * defining effect parameters
1092 *
1093 * This structure is sent through ioctl from the application to the driver.
1094 * To create a new effect application should set its @id to -1; the kernel
1095 * will return assigned @id which can later be used to update or delete
1096 * this effect.
1097 *
1098 * Direction of the effect is encoded as follows:
1099 * 0 deg -> 0x0000 (down)
1100 * 90 deg -> 0x4000 (left)
1101 * 180 deg -> 0x8000 (up)
1102 * 270 deg -> 0xC000 (right)
1103 */
1104struct ff_effect {
1105 __u16 type;
1106 __s16 id;
1107 __u16 direction;
1108 struct ff_trigger trigger;
1109 struct ff_replay replay;
1110
1111 union {
1112 struct ff_constant_effect constant;
1113 struct ff_ramp_effect ramp;
1114 struct ff_periodic_effect periodic;
1115 struct ff_condition_effect condition[2]; /* One for each axis */
1116 struct ff_rumble_effect rumble;
1117 } u;
1118};
1119
1120/*
1121 * Force feedback effect types
1122 */
1123
1124#define FF_RUMBLE 0x50
1125#define FF_PERIODIC 0x51
1126#define FF_CONSTANT 0x52
1127#define FF_SPRING 0x53
1128#define FF_FRICTION 0x54
1129#define FF_DAMPER 0x55
1130#define FF_INERTIA 0x56
1131#define FF_RAMP 0x57
1132
1133#define FF_EFFECT_MIN FF_RUMBLE
1134#define FF_EFFECT_MAX FF_RAMP
1135
1136/*
1137 * Force feedback periodic effect types
1138 */
1139
1140#define FF_SQUARE 0x58
1141#define FF_TRIANGLE 0x59
1142#define FF_SINE 0x5a
1143#define FF_SAW_UP 0x5b
1144#define FF_SAW_DOWN 0x5c
1145#define FF_CUSTOM 0x5d
1146
1147#define FF_WAVEFORM_MIN FF_SQUARE
1148#define FF_WAVEFORM_MAX FF_CUSTOM
1149
1150/*
1151 * Set ff device properties
1152 */
1153
1154#define FF_GAIN 0x60
1155#define FF_AUTOCENTER 0x61
1156
1157#define FF_MAX 0x7f
1158#define FF_CNT (FF_MAX+1)
1159
1160#ifdef __KERNEL__
1161 17
1162/* 18/*
1163 * In-kernel definitions. 19 * In-kernel definitions.
@@ -1668,4 +524,3 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
1668 int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); 524 int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
1669 525
1670#endif 526#endif
1671#endif
diff --git a/include/linux/ip.h b/include/linux/ip.h
index bd0a2a8631c..58b82a22a52 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -16,96 +16,9 @@
16 */ 16 */
17#ifndef _LINUX_IP_H 17#ifndef _LINUX_IP_H
18#define _LINUX_IP_H 18#define _LINUX_IP_H
19#include <linux/types.h>
20#include <asm/byteorder.h>
21 19
22#define IPTOS_TOS_MASK 0x1E
23#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
24#define IPTOS_LOWDELAY 0x10
25#define IPTOS_THROUGHPUT 0x08
26#define IPTOS_RELIABILITY 0x04
27#define IPTOS_MINCOST 0x02
28
29#define IPTOS_PREC_MASK 0xE0
30#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
31#define IPTOS_PREC_NETCONTROL 0xe0
32#define IPTOS_PREC_INTERNETCONTROL 0xc0
33#define IPTOS_PREC_CRITIC_ECP 0xa0
34#define IPTOS_PREC_FLASHOVERRIDE 0x80
35#define IPTOS_PREC_FLASH 0x60
36#define IPTOS_PREC_IMMEDIATE 0x40
37#define IPTOS_PREC_PRIORITY 0x20
38#define IPTOS_PREC_ROUTINE 0x00
39
40
41/* IP options */
42#define IPOPT_COPY 0x80
43#define IPOPT_CLASS_MASK 0x60
44#define IPOPT_NUMBER_MASK 0x1f
45
46#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
47#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
48#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
49
50#define IPOPT_CONTROL 0x00
51#define IPOPT_RESERVED1 0x20
52#define IPOPT_MEASUREMENT 0x40
53#define IPOPT_RESERVED2 0x60
54
55#define IPOPT_END (0 |IPOPT_CONTROL)
56#define IPOPT_NOOP (1 |IPOPT_CONTROL)
57#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
58#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
59#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
60#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
61#define IPOPT_RR (7 |IPOPT_CONTROL)
62#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
63#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
64#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
65
66#define IPVERSION 4
67#define MAXTTL 255
68#define IPDEFTTL 64
69
70#define IPOPT_OPTVAL 0
71#define IPOPT_OLEN 1
72#define IPOPT_OFFSET 2
73#define IPOPT_MINOFF 4
74#define MAX_IPOPTLEN 40
75#define IPOPT_NOP IPOPT_NOOP
76#define IPOPT_EOL IPOPT_END
77#define IPOPT_TS IPOPT_TIMESTAMP
78
79#define IPOPT_TS_TSONLY 0 /* timestamps only */
80#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
81#define IPOPT_TS_PRESPEC 3 /* specified modules only */
82
83#define IPV4_BEET_PHMAXLEN 8
84
85struct iphdr {
86#if defined(__LITTLE_ENDIAN_BITFIELD)
87 __u8 ihl:4,
88 version:4;
89#elif defined (__BIG_ENDIAN_BITFIELD)
90 __u8 version:4,
91 ihl:4;
92#else
93#error "Please fix <asm/byteorder.h>"
94#endif
95 __u8 tos;
96 __be16 tot_len;
97 __be16 id;
98 __be16 frag_off;
99 __u8 ttl;
100 __u8 protocol;
101 __sum16 check;
102 __be32 saddr;
103 __be32 daddr;
104 /*The options start here. */
105};
106
107#ifdef __KERNEL__
108#include <linux/skbuff.h> 20#include <linux/skbuff.h>
21#include <uapi/linux/ip.h>
109 22
110static inline struct iphdr *ip_hdr(const struct sk_buff *skb) 23static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
111{ 24{
@@ -116,34 +29,4 @@ static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
116{ 29{
117 return (struct iphdr *)skb_transport_header(skb); 30 return (struct iphdr *)skb_transport_header(skb);
118} 31}
119#endif
120
121struct ip_auth_hdr {
122 __u8 nexthdr;
123 __u8 hdrlen; /* This one is measured in 32 bit units! */
124 __be16 reserved;
125 __be32 spi;
126 __be32 seq_no; /* Sequence number */
127 __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
128};
129
130struct ip_esp_hdr {
131 __be32 spi;
132 __be32 seq_no; /* Sequence number */
133 __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
134};
135
136struct ip_comp_hdr {
137 __u8 nexthdr;
138 __u8 flags;
139 __be16 cpi;
140};
141
142struct ip_beet_phdr {
143 __u8 nexthdr;
144 __u8 hdrlen;
145 __u8 padlen;
146 __u8 reserved;
147};
148
149#endif /* _LINUX_IP_H */ 32#endif /* _LINUX_IP_H */
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index ca833fdc313..8d861b2651f 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -1,85 +1,9 @@
1#ifndef _LINUX_IPC_H 1#ifndef _LINUX_IPC_H
2#define _LINUX_IPC_H 2#define _LINUX_IPC_H
3 3
4#include <linux/types.h>
5
6#define IPC_PRIVATE ((__kernel_key_t) 0)
7
8/* Obsolete, used only for backwards compatibility and libc5 compiles */
9struct ipc_perm
10{
11 __kernel_key_t key;
12 __kernel_uid_t uid;
13 __kernel_gid_t gid;
14 __kernel_uid_t cuid;
15 __kernel_gid_t cgid;
16 __kernel_mode_t mode;
17 unsigned short seq;
18};
19
20/* Include the definition of ipc64_perm */
21#include <asm/ipcbuf.h>
22
23/* resource get request flags */
24#define IPC_CREAT 00001000 /* create if key is nonexistent */
25#define IPC_EXCL 00002000 /* fail if key exists */
26#define IPC_NOWAIT 00004000 /* return error on wait */
27
28/* these fields are used by the DIPC package so the kernel as standard
29 should avoid using them if possible */
30
31#define IPC_DIPC 00010000 /* make it distributed */
32#define IPC_OWN 00020000 /* this machine is the DIPC owner */
33
34/*
35 * Control commands used with semctl, msgctl and shmctl
36 * see also specific commands in sem.h, msg.h and shm.h
37 */
38#define IPC_RMID 0 /* remove resource */
39#define IPC_SET 1 /* set ipc_perm options */
40#define IPC_STAT 2 /* get ipc_perm options */
41#define IPC_INFO 3 /* see ipcs */
42
43/*
44 * Version flags for semctl, msgctl, and shmctl commands
45 * These are passed as bitflags or-ed with the actual command
46 */
47#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
48 architectures) */
49#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
50 message sizes, etc. */
51
52/*
53 * These are used to wrap system calls.
54 *
55 * See architecture code for ugly details..
56 */
57struct ipc_kludge {
58 struct msgbuf __user *msgp;
59 long msgtyp;
60};
61
62#define SEMOP 1
63#define SEMGET 2
64#define SEMCTL 3
65#define SEMTIMEDOP 4
66#define MSGSND 11
67#define MSGRCV 12
68#define MSGGET 13
69#define MSGCTL 14
70#define SHMAT 21
71#define SHMDT 22
72#define SHMGET 23
73#define SHMCTL 24
74
75/* Used by the DIPC package, try and avoid reusing it */
76#define DIPC 25
77
78#define IPCCALL(version,op) ((version)<<16 | (op))
79
80#ifdef __KERNEL__
81#include <linux/spinlock.h> 4#include <linux/spinlock.h>
82#include <linux/uidgid.h> 5#include <linux/uidgid.h>
6#include <uapi/linux/ipc.h>
83 7
84#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ 8#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
85 9
@@ -99,6 +23,4 @@ struct kern_ipc_perm
99 void *security; 23 void *security;
100}; 24};
101 25
102#endif /* __KERNEL__ */
103
104#endif /* _LINUX_IPC_H */ 26#endif /* _LINUX_IPC_H */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 48dcba9b206..1487e7906bb 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -30,191 +30,11 @@
30 * with this program; if not, write to the Free Software Foundation, Inc., 30 * with this program; if not, write to the Free Software Foundation, Inc.,
31 * 675 Mass Ave, Cambridge, MA 02139, USA. 31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */ 32 */
33
34#ifndef __LINUX_IPMI_H 33#ifndef __LINUX_IPMI_H
35#define __LINUX_IPMI_H 34#define __LINUX_IPMI_H
36 35
37#include <linux/ipmi_msgdefs.h> 36#include <uapi/linux/ipmi.h>
38#include <linux/compiler.h>
39
40/*
41 * This file describes an interface to an IPMI driver. You have to
42 * have a fairly good understanding of IPMI to use this, so go read
43 * the specs first before actually trying to do anything.
44 *
45 * With that said, this driver provides a multi-user interface to the
46 * IPMI driver, and it allows multiple IPMI physical interfaces below
47 * the driver. The physical interfaces bind as a lower layer on the
48 * driver. They appear as interfaces to the application using this
49 * interface.
50 *
51 * Multi-user means that multiple applications may use the driver,
52 * send commands, receive responses, etc. The driver keeps track of
53 * commands the user sends and tracks the responses. The responses
54 * will go back to the application that send the command. If the
55 * response doesn't come back in time, the driver will return a
56 * timeout error response to the application. Asynchronous events
57 * from the BMC event queue will go to all users bound to the driver.
58 * The incoming event queue in the BMC will automatically be flushed
59 * if it becomes full and it is queried once a second to see if
60 * anything is in it. Incoming commands to the driver will get
61 * delivered as commands.
62 *
63 * This driver provides two main interfaces: one for in-kernel
64 * applications and another for userland applications. The
65 * capabilities are basically the same for both interface, although
66 * the interfaces are somewhat different. The stuff in the
67 * #ifdef __KERNEL__ below is the in-kernel interface. The userland
68 * interface is defined later in the file. */
69
70
71
72/*
73 * This is an overlay for all the address types, so it's easy to
74 * determine the actual address type. This is kind of like addresses
75 * work for sockets.
76 */
77#define IPMI_MAX_ADDR_SIZE 32
78struct ipmi_addr {
79 /* Try to take these from the "Channel Medium Type" table
80 in section 6.5 of the IPMI 1.5 manual. */
81 int addr_type;
82 short channel;
83 char data[IPMI_MAX_ADDR_SIZE];
84};
85
86/*
87 * When the address is not used, the type will be set to this value.
88 * The channel is the BMC's channel number for the channel (usually
89 * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
90 */
91#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
92struct ipmi_system_interface_addr {
93 int addr_type;
94 short channel;
95 unsigned char lun;
96};
97
98/* An IPMB Address. */
99#define IPMI_IPMB_ADDR_TYPE 0x01
100/* Used for broadcast get device id as described in section 17.9 of the
101 IPMI 1.5 manual. */
102#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
103struct ipmi_ipmb_addr {
104 int addr_type;
105 short channel;
106 unsigned char slave_addr;
107 unsigned char lun;
108};
109
110/*
111 * A LAN Address. This is an address to/from a LAN interface bridged
112 * by the BMC, not an address actually out on the LAN.
113 *
114 * A conscious decision was made here to deviate slightly from the IPMI
115 * spec. We do not use rqSWID and rsSWID like it shows in the
116 * message. Instead, we use remote_SWID and local_SWID. This means
117 * that any message (a request or response) from another device will
118 * always have exactly the same address. If you didn't do this,
119 * requests and responses from the same device would have different
120 * addresses, and that's not too cool.
121 *
122 * In this address, the remote_SWID is always the SWID the remote
123 * message came from, or the SWID we are sending the message to.
124 * local_SWID is always our SWID. Note that having our SWID in the
125 * message is a little weird, but this is required.
126 */
127#define IPMI_LAN_ADDR_TYPE 0x04
128struct ipmi_lan_addr {
129 int addr_type;
130 short channel;
131 unsigned char privilege;
132 unsigned char session_handle;
133 unsigned char remote_SWID;
134 unsigned char local_SWID;
135 unsigned char lun;
136};
137
138
139/*
140 * Channel for talking directly with the BMC. When using this
141 * channel, This is for the system interface address type only. FIXME
142 * - is this right, or should we use -1?
143 */
144#define IPMI_BMC_CHANNEL 0xf
145#define IPMI_NUM_CHANNELS 0x10
146
147/*
148 * Used to signify an "all channel" bitmask. This is more than the
149 * actual number of channels because this is used in userland and
150 * will cover us if the number of channels is extended.
151 */
152#define IPMI_CHAN_ALL (~0)
153
154
155/*
156 * A raw IPMI message without any addressing. This covers both
157 * commands and responses. The completion code is always the first
158 * byte of data in the response (as the spec shows the messages laid
159 * out).
160 */
161struct ipmi_msg {
162 unsigned char netfn;
163 unsigned char cmd;
164 unsigned short data_len;
165 unsigned char __user *data;
166};
167
168struct kernel_ipmi_msg {
169 unsigned char netfn;
170 unsigned char cmd;
171 unsigned short data_len;
172 unsigned char *data;
173};
174
175/*
176 * Various defines that are useful for IPMI applications.
177 */
178#define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
179#define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
180#define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
181
182 37
183/*
184 * Receive types for messages coming from the receive interface. This
185 * is used for the receive in-kernel interface and in the receive
186 * IOCTL.
187 *
188 * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
189 * it allows you to get the message results when you send a response
190 * message.
191 */
192#define IPMI_RESPONSE_RECV_TYPE 1 /* A response to a command */
193#define IPMI_ASYNC_EVENT_RECV_TYPE 2 /* Something from the event queue */
194#define IPMI_CMD_RECV_TYPE 3 /* A command from somewhere else */
195#define IPMI_RESPONSE_RESPONSE_TYPE 4 /* The response for
196 a sent response, giving any
197 error status for sending the
198 response. When you send a
199 response message, this will
200 be returned. */
201#define IPMI_OEM_RECV_TYPE 5 /* The response for OEM Channels */
202
203/* Note that async events and received commands do not have a completion
204 code as the first byte of the incoming data, unlike a response. */
205
206
207/*
208 * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
209 * setting is the default and means it will be set on certain
210 * commands. Hard setting it on and off will override automatic
211 * operation.
212 */
213#define IPMI_MAINTENANCE_MODE_AUTO 0
214#define IPMI_MAINTENANCE_MODE_OFF 1
215#define IPMI_MAINTENANCE_MODE_ON 2
216
217#ifdef __KERNEL__
218 38
219/* 39/*
220 * The in-kernel interface. 40 * The in-kernel interface.
@@ -493,244 +313,4 @@ struct ipmi_smi_info {
493/* This is to get the private info of ipmi_smi_t */ 313/* This is to get the private info of ipmi_smi_t */
494extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data); 314extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data);
495 315
496#endif /* __KERNEL__ */
497
498
499/*
500 * The userland interface
501 */
502
503/*
504 * The userland interface for the IPMI driver is a standard character
505 * device, with each instance of an interface registered as a minor
506 * number under the major character device.
507 *
508 * The read and write calls do not work, to get messages in and out
509 * requires ioctl calls because of the complexity of the data. select
510 * and poll do work, so you can wait for input using the file
511 * descriptor, you just can use read to get it.
512 *
513 * In general, you send a command down to the interface and receive
514 * responses back. You can use the msgid value to correlate commands
515 * and responses, the driver will take care of figuring out which
516 * incoming messages are for which command and find the proper msgid
517 * value to report. You will only receive reponses for commands you
518 * send. Asynchronous events, however, go to all open users, so you
519 * must be ready to handle these (or ignore them if you don't care).
520 *
521 * The address type depends upon the channel type. When talking
522 * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
523 * (IPMI_UNUSED_ADDR_TYPE). When talking to an IPMB channel, you must
524 * supply a valid IPMB address with the addr_type set properly.
525 *
526 * When talking to normal channels, the driver takes care of the
527 * details of formatting and sending messages on that channel. You do
528 * not, for instance, have to format a send command, you just send
529 * whatever command you want to the channel, the driver will create
530 * the send command, automatically issue receive command and get even
531 * commands, and pass those up to the proper user.
532 */
533
534
535/* The magic IOCTL value for this interface. */
536#define IPMI_IOC_MAGIC 'i'
537
538
539/* Messages sent to the interface are this format. */
540struct ipmi_req {
541 unsigned char __user *addr; /* Address to send the message to. */
542 unsigned int addr_len;
543
544 long msgid; /* The sequence number for the message. This
545 exact value will be reported back in the
546 response to this request if it is a command.
547 If it is a response, this will be used as
548 the sequence value for the response. */
549
550 struct ipmi_msg msg;
551};
552/*
553 * Send a message to the interfaces. error values are:
554 * - EFAULT - an address supplied was invalid.
555 * - EINVAL - The address supplied was not valid, or the command
556 * was not allowed.
557 * - EMSGSIZE - The message to was too large.
558 * - ENOMEM - Buffers could not be allocated for the command.
559 */
560#define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, \
561 struct ipmi_req)
562
563/* Messages sent to the interface with timing parameters are this
564 format. */
565struct ipmi_req_settime {
566 struct ipmi_req req;
567
568 /* See ipmi_request_settime() above for details on these
569 values. */
570 int retries;
571 unsigned int retry_time_ms;
572};
573/*
574 * Send a message to the interfaces with timing parameters. error values
575 * are:
576 * - EFAULT - an address supplied was invalid.
577 * - EINVAL - The address supplied was not valid, or the command
578 * was not allowed.
579 * - EMSGSIZE - The message to was too large.
580 * - ENOMEM - Buffers could not be allocated for the command.
581 */
582#define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, \
583 struct ipmi_req_settime)
584
585/* Messages received from the interface are this format. */
586struct ipmi_recv {
587 int recv_type; /* Is this a command, response or an
588 asyncronous event. */
589
590 unsigned char __user *addr; /* Address the message was from is put
591 here. The caller must supply the
592 memory. */
593 unsigned int addr_len; /* The size of the address buffer.
594 The caller supplies the full buffer
595 length, this value is updated to
596 the actual message length when the
597 message is received. */
598
599 long msgid; /* The sequence number specified in the request
600 if this is a response. If this is a command,
601 this will be the sequence number from the
602 command. */
603
604 struct ipmi_msg msg; /* The data field must point to a buffer.
605 The data_size field must be set to the
606 size of the message buffer. The
607 caller supplies the full buffer
608 length, this value is updated to the
609 actual message length when the message
610 is received. */
611};
612
613/*
614 * Receive a message. error values:
615 * - EAGAIN - no messages in the queue.
616 * - EFAULT - an address supplied was invalid.
617 * - EINVAL - The address supplied was not valid.
618 * - EMSGSIZE - The message to was too large to fit into the message buffer,
619 * the message will be left in the buffer. */
620#define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, \
621 struct ipmi_recv)
622
623/*
624 * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
625 * will truncate the contents instead of leaving the data in the
626 * buffer.
627 */
628#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, \
629 struct ipmi_recv)
630
631/* Register to get commands from other entities on this interface. */
632struct ipmi_cmdspec {
633 unsigned char netfn;
634 unsigned char cmd;
635};
636
637/*
638 * Register to receive a specific command. error values:
639 * - EFAULT - an address supplied was invalid.
640 * - EBUSY - The netfn/cmd supplied was already in use.
641 * - ENOMEM - could not allocate memory for the entry.
642 */
643#define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, \
644 struct ipmi_cmdspec)
645/*
646 * Unregister a regsitered command. error values:
647 * - EFAULT - an address supplied was invalid.
648 * - ENOENT - The netfn/cmd was not found registered for this user.
649 */
650#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
651 struct ipmi_cmdspec)
652
653/*
654 * Register to get commands from other entities on specific channels.
655 * This way, you can only listen on specific channels, or have messages
656 * from some channels go to one place and other channels to someplace
657 * else. The chans field is a bitmask, (1 << channel) for each channel.
658 * It may be IPMI_CHAN_ALL for all channels.
659 */
660struct ipmi_cmdspec_chans {
661 unsigned int netfn;
662 unsigned int cmd;
663 unsigned int chans;
664};
665
666/*
667 * Register to receive a specific command on specific channels. error values:
668 * - EFAULT - an address supplied was invalid.
669 * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
670 * - ENOMEM - could not allocate memory for the entry.
671 */
672#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
673 struct ipmi_cmdspec_chans)
674/*
675 * Unregister some netfn/cmd/chans. error values:
676 * - EFAULT - an address supplied was invalid.
677 * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
678 */
679#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
680 struct ipmi_cmdspec_chans)
681
682/*
683 * Set whether this interface receives events. Note that the first
684 * user registered for events will get all pending events for the
685 * interface. error values:
686 * - EFAULT - an address supplied was invalid.
687 */
688#define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
689
690/*
691 * Set and get the slave address and LUN that we will use for our
692 * source messages. Note that this affects the interface, not just
693 * this user, so it will affect all users of this interface. This is
694 * so some initialization code can come in and do the OEM-specific
695 * things it takes to determine your address (if not the BMC) and set
696 * it for everyone else. You should probably leave the LUN alone.
697 */
698struct ipmi_channel_lun_address_set {
699 unsigned short channel;
700 unsigned char value;
701};
702#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
703 _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
704#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
705 _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
706#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
707 _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
708#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
709 _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
710/* Legacy interfaces, these only set IPMB 0. */
711#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
712#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
713#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
714#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
715
716/*
717 * Get/set the default timing values for an interface. You shouldn't
718 * generally mess with these.
719 */
720struct ipmi_timing_parms {
721 int retries;
722 unsigned int retry_time_ms;
723};
724#define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, \
725 struct ipmi_timing_parms)
726#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
727 struct ipmi_timing_parms)
728
729/*
730 * Set the maintenance mode. See ipmi_set_maintenance_mode() above
731 * for a description of what this does.
732 */
733#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
734#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
735
736#endif /* __LINUX_IPMI_H */ 316#endif /* __LINUX_IPMI_H */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 0b94e91ed68..bcba48a9786 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -1,134 +1,9 @@
1#ifndef _IPV6_H 1#ifndef _IPV6_H
2#define _IPV6_H 2#define _IPV6_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/ipv6.h>
5#include <linux/in6.h>
6#include <asm/byteorder.h>
7 5
8/* The latest drafts declared increase in minimal mtu up to 1280. */
9
10#define IPV6_MIN_MTU 1280
11
12/*
13 * Advanced API
14 * source interface/address selection, source routing, etc...
15 * *under construction*
16 */
17
18
19struct in6_pktinfo {
20 struct in6_addr ipi6_addr;
21 int ipi6_ifindex;
22};
23
24struct ip6_mtuinfo {
25 struct sockaddr_in6 ip6m_addr;
26 __u32 ip6m_mtu;
27};
28
29struct in6_ifreq {
30 struct in6_addr ifr6_addr;
31 __u32 ifr6_prefixlen;
32 int ifr6_ifindex;
33};
34
35#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
36#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
37#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
38
39/*
40 * routing header
41 */
42struct ipv6_rt_hdr {
43 __u8 nexthdr;
44 __u8 hdrlen;
45 __u8 type;
46 __u8 segments_left;
47
48 /*
49 * type specific data
50 * variable length field
51 */
52};
53
54
55struct ipv6_opt_hdr {
56 __u8 nexthdr;
57 __u8 hdrlen;
58 /*
59 * TLV encoded option data follows.
60 */
61} __attribute__((packed)); /* required for some archs */
62
63#define ipv6_destopt_hdr ipv6_opt_hdr
64#define ipv6_hopopt_hdr ipv6_opt_hdr
65
66#ifdef __KERNEL__
67#define ipv6_optlen(p) (((p)->hdrlen+1) << 3) 6#define ipv6_optlen(p) (((p)->hdrlen+1) << 3)
68#endif
69
70/*
71 * routing header type 0 (used in cmsghdr struct)
72 */
73
74struct rt0_hdr {
75 struct ipv6_rt_hdr rt_hdr;
76 __u32 reserved;
77 struct in6_addr addr[0];
78
79#define rt0_type rt_hdr.type
80};
81
82/*
83 * routing header type 2
84 */
85
86struct rt2_hdr {
87 struct ipv6_rt_hdr rt_hdr;
88 __u32 reserved;
89 struct in6_addr addr;
90
91#define rt2_type rt_hdr.type
92};
93
94/*
95 * home address option in destination options header
96 */
97
98struct ipv6_destopt_hao {
99 __u8 type;
100 __u8 length;
101 struct in6_addr addr;
102} __attribute__((packed));
103
104/*
105 * IPv6 fixed header
106 *
107 * BEWARE, it is incorrect. The first 4 bits of flow_lbl
108 * are glued to priority now, forming "class".
109 */
110
111struct ipv6hdr {
112#if defined(__LITTLE_ENDIAN_BITFIELD)
113 __u8 priority:4,
114 version:4;
115#elif defined(__BIG_ENDIAN_BITFIELD)
116 __u8 version:4,
117 priority:4;
118#else
119#error "Please fix <asm/byteorder.h>"
120#endif
121 __u8 flow_lbl[3];
122
123 __be16 payload_len;
124 __u8 nexthdr;
125 __u8 hop_limit;
126
127 struct in6_addr saddr;
128 struct in6_addr daddr;
129};
130
131#ifdef __KERNEL__
132/* 7/*
133 * This structure contains configuration options per IPv6 link. 8 * This structure contains configuration options per IPv6 link.
134 */ 9 */
@@ -180,43 +55,6 @@ struct ipv6_params {
180 __s32 autoconf; 55 __s32 autoconf;
181}; 56};
182extern struct ipv6_params ipv6_defaults; 57extern struct ipv6_params ipv6_defaults;
183#endif
184
185/* index values for the variables in ipv6_devconf */
186enum {
187 DEVCONF_FORWARDING = 0,
188 DEVCONF_HOPLIMIT,
189 DEVCONF_MTU6,
190 DEVCONF_ACCEPT_RA,
191 DEVCONF_ACCEPT_REDIRECTS,
192 DEVCONF_AUTOCONF,
193 DEVCONF_DAD_TRANSMITS,
194 DEVCONF_RTR_SOLICITS,
195 DEVCONF_RTR_SOLICIT_INTERVAL,
196 DEVCONF_RTR_SOLICIT_DELAY,
197 DEVCONF_USE_TEMPADDR,
198 DEVCONF_TEMP_VALID_LFT,
199 DEVCONF_TEMP_PREFERED_LFT,
200 DEVCONF_REGEN_MAX_RETRY,
201 DEVCONF_MAX_DESYNC_FACTOR,
202 DEVCONF_MAX_ADDRESSES,
203 DEVCONF_FORCE_MLD_VERSION,
204 DEVCONF_ACCEPT_RA_DEFRTR,
205 DEVCONF_ACCEPT_RA_PINFO,
206 DEVCONF_ACCEPT_RA_RTR_PREF,
207 DEVCONF_RTR_PROBE_INTERVAL,
208 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
209 DEVCONF_PROXY_NDP,
210 DEVCONF_OPTIMISTIC_DAD,
211 DEVCONF_ACCEPT_SOURCE_ROUTE,
212 DEVCONF_MC_FORWARDING,
213 DEVCONF_DISABLE_IPV6,
214 DEVCONF_ACCEPT_DAD,
215 DEVCONF_FORCE_TLLAO,
216 DEVCONF_MAX
217};
218
219#ifdef __KERNEL__
220#include <linux/icmpv6.h> 58#include <linux/icmpv6.h>
221#include <linux/tcp.h> 59#include <linux/tcp.h>
222#include <linux/udp.h> 60#include <linux/udp.h>
@@ -541,6 +379,4 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
541 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ 379 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \
542 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 380 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
543 381
544#endif /* __KERNEL__ */
545
546#endif /* _IPV6_H */ 382#endif /* _IPV6_H */
diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
index 1e7d8af2def..25b5f1f5e78 100644
--- a/include/linux/ipv6_route.h
+++ b/include/linux/ipv6_route.h
@@ -9,54 +9,11 @@
9 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12
13#ifndef _LINUX_IPV6_ROUTE_H 12#ifndef _LINUX_IPV6_ROUTE_H
14#define _LINUX_IPV6_ROUTE_H 13#define _LINUX_IPV6_ROUTE_H
15 14
16#include <linux/types.h> 15#include <uapi/linux/ipv6_route.h>
17
18#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
19#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
20 fallback, no routers on link */
21#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
22#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */
23#define RTF_ANYCAST 0x00100000 /* Anycast */
24
25#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
26#define RTF_EXPIRES 0x00400000
27
28#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
29
30#define RTF_CACHE 0x01000000 /* cache entry */
31#define RTF_FLOW 0x02000000 /* flow significant route */
32#define RTF_POLICY 0x04000000 /* policy route */
33
34#define RTF_PREF(pref) ((pref) << 27)
35#define RTF_PREF_MASK 0x18000000
36 16
37#define RTF_LOCAL 0x80000000
38
39#ifdef __KERNEL__
40#define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27) 17#define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27)
41#define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */ 18#define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */
42#endif 19#endif
43
44struct in6_rtmsg {
45 struct in6_addr rtmsg_dst;
46 struct in6_addr rtmsg_src;
47 struct in6_addr rtmsg_gateway;
48 __u32 rtmsg_type;
49 __u16 rtmsg_dst_len;
50 __u16 rtmsg_src_len;
51 __u32 rtmsg_metric;
52 unsigned long rtmsg_info;
53 __u32 rtmsg_flags;
54 int rtmsg_ifindex;
55};
56
57#define RTMSG_NEWDEVICE 0x11
58#define RTMSG_DELDEVICE 0x12
59#define RTMSG_NEWROUTE 0x21
60#define RTMSG_DELROUTE 0x22
61
62#endif
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 3bc4dcab6e8..0a2dc46cdaf 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -1,10 +1,8 @@
1#ifndef _LINUX_IRQNR_H 1#ifndef _LINUX_IRQNR_H
2#define _LINUX_IRQNR_H 2#define _LINUX_IRQNR_H
3 3
4/* 4#include <uapi/linux/irqnr.h>
5 * Generic irq_desc iterators: 5
6 */
7#ifdef __KERNEL__
8 6
9#ifndef CONFIG_GENERIC_HARDIRQS 7#ifndef CONFIG_GENERIC_HARDIRQS
10#include <asm/irq.h> 8#include <asm/irq.h>
@@ -57,6 +55,4 @@ unsigned int irq_get_next_irq(unsigned int offset);
57#define for_each_irq_nr(irq) \ 55#define for_each_irq_nr(irq) \
58 for (irq = 0; irq < nr_irqs; irq++) 56 for (irq = 0; irq < nr_irqs; irq++)
59 57
60#endif /* __KERNEL__ */
61
62#endif 58#endif
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 215c41602af..1e9a0f2a862 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -10,136 +10,9 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 * 11 *
12 */ 12 */
13
14#ifndef __ISDN_H__ 13#ifndef __ISDN_H__
15#define __ISDN_H__ 14#define __ISDN_H__
16 15
17#include <linux/ioctl.h>
18#include <linux/tty.h>
19
20#define ISDN_MAX_DRIVERS 32
21#define ISDN_MAX_CHANNELS 64
22
23/* New ioctl-codes */
24#define IIOCNETAIF _IO('I',1)
25#define IIOCNETDIF _IO('I',2)
26#define IIOCNETSCF _IO('I',3)
27#define IIOCNETGCF _IO('I',4)
28#define IIOCNETANM _IO('I',5)
29#define IIOCNETDNM _IO('I',6)
30#define IIOCNETGNM _IO('I',7)
31#define IIOCGETSET _IO('I',8) /* no longer supported */
32#define IIOCSETSET _IO('I',9) /* no longer supported */
33#define IIOCSETVER _IO('I',10)
34#define IIOCNETHUP _IO('I',11)
35#define IIOCSETGST _IO('I',12)
36#define IIOCSETBRJ _IO('I',13)
37#define IIOCSIGPRF _IO('I',14)
38#define IIOCGETPRF _IO('I',15)
39#define IIOCSETPRF _IO('I',16)
40#define IIOCGETMAP _IO('I',17)
41#define IIOCSETMAP _IO('I',18)
42#define IIOCNETASL _IO('I',19)
43#define IIOCNETDIL _IO('I',20)
44#define IIOCGETCPS _IO('I',21)
45#define IIOCGETDVR _IO('I',22)
46#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
47#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
48
49#define IIOCNETALN _IO('I',32)
50#define IIOCNETDLN _IO('I',33)
51
52#define IIOCNETGPN _IO('I',34)
53
54#define IIOCDBGVAR _IO('I',127)
55
56#define IIOCDRVCTL _IO('I',128)
57
58/* cisco hdlck device private ioctls */
59#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
60#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
61#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
62#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
63
64/* Packet encapsulations for net-interfaces */
65#define ISDN_NET_ENCAP_ETHER 0
66#define ISDN_NET_ENCAP_RAWIP 1
67#define ISDN_NET_ENCAP_IPTYP 2
68#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
69#define ISDN_NET_ENCAP_SYNCPPP 4
70#define ISDN_NET_ENCAP_UIHDLC 5
71#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
72#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
73#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
74
75/* Facility which currently uses an ISDN-channel */
76#define ISDN_USAGE_NONE 0
77#define ISDN_USAGE_RAW 1
78#define ISDN_USAGE_MODEM 2
79#define ISDN_USAGE_NET 3
80#define ISDN_USAGE_VOICE 4
81#define ISDN_USAGE_FAX 5
82#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
83#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
84#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
85#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
86
87#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
88#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
89#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
90
91#define ISDN_MSNLEN 32
92#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
93#define TTY_DV 0x06 /* Data version for iprofd etc. */
94
95#define INF_DV 0x01 /* Data version for /dev/isdninfo */
96
97typedef struct {
98 char drvid[25];
99 unsigned long arg;
100} isdn_ioctl_struct;
101
102typedef struct {
103 char name[10];
104 char phone[ISDN_MSNLEN];
105 int outgoing;
106} isdn_net_ioctl_phone;
107
108typedef struct {
109 char name[10]; /* Name of interface */
110 char master[10]; /* Name of Master for Bundling */
111 char slave[10]; /* Name of Slave for Bundling */
112 char eaz[256]; /* EAZ/MSN */
113 char drvid[25]; /* DriverId for Bindings */
114 int onhtime; /* Hangup-Timeout */
115 int charge; /* Charge-Units */
116 int l2_proto; /* Layer-2 protocol */
117 int l3_proto; /* Layer-3 protocol */
118 int p_encap; /* Encapsulation */
119 int exclusive; /* Channel, if bound exclusive */
120 int dialmax; /* Dial Retry-Counter */
121 int slavedelay; /* Delay until slave starts up */
122 int cbdelay; /* Delay before Callback */
123 int chargehup; /* Flag: Charge-Hangup */
124 int ihup; /* Flag: Hangup-Timeout on incoming line */
125 int secure; /* Flag: Secure */
126 int callback; /* Flag: Callback */
127 int cbhup; /* Flag: Reject Call before Callback */
128 int pppbind; /* ippp device for bindings */
129 int chargeint; /* Use fixed charge interval length */
130 int triggercps; /* BogoCPS needed for triggering slave */
131 int dialtimeout; /* Dial-Timeout */
132 int dialwait; /* Time to wait after failed dial */
133 int dialmode; /* Flag: off / on / auto */
134} isdn_net_ioctl_cfg;
135
136#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
137#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
138#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
139#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
140#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
141
142#ifdef __KERNEL__
143 16
144#include <linux/errno.h> 17#include <linux/errno.h>
145#include <linux/fs.h> 18#include <linux/fs.h>
@@ -163,6 +36,7 @@ typedef struct {
163#include <linux/skbuff.h> 36#include <linux/skbuff.h>
164#include <linux/tcp.h> 37#include <linux/tcp.h>
165#include <linux/mutex.h> 38#include <linux/mutex.h>
39#include <uapi/linux/isdn.h>
166 40
167#define ISDN_TTY_MAJOR 43 41#define ISDN_TTY_MAJOR 43
168#define ISDN_TTYAUX_MAJOR 44 42#define ISDN_TTYAUX_MAJOR 44
@@ -595,6 +469,4 @@ typedef struct isdn_devt {
595extern isdn_dev *dev; 469extern isdn_dev *dev;
596 470
597 471
598#endif /* __KERNEL__ */
599
600#endif /* __ISDN_H__ */ 472#endif /* __ISDN_H__ */
diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
index a5a50f52380..19ab361f9f0 100644
--- a/include/linux/isdn_divertif.h
+++ b/include/linux/isdn_divertif.h
@@ -9,26 +9,12 @@
9 * of the GNU General Public License, incorporated herein by reference. 9 * of the GNU General Public License, incorporated herein by reference.
10 * 10 *
11 */ 11 */
12
13#ifndef _LINUX_ISDN_DIVERTIF_H 12#ifndef _LINUX_ISDN_DIVERTIF_H
14#define _LINUX_ISDN_DIVERTIF_H 13#define _LINUX_ISDN_DIVERTIF_H
15 14
16/***********************************************************/
17/* magic value is also used to control version information */
18/***********************************************************/
19#define DIVERT_IF_MAGIC 0x25873401
20#define DIVERT_CMD_REG 0x00 /* register command */
21#define DIVERT_CMD_REL 0x01 /* release command */
22#define DIVERT_NO_ERR 0x00 /* return value no error */
23#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
24#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
25#define DIVERT_REG_ERR 0x03 /* module already registered */
26#define DIVERT_REL_ERR 0x04 /* module not registered */
27#define DIVERT_REG_NAME isdn_register_divert
28
29#ifdef __KERNEL__
30#include <linux/isdnif.h> 15#include <linux/isdnif.h>
31#include <linux/types.h> 16#include <linux/types.h>
17#include <uapi/linux/isdn_divertif.h>
32 18
33/***************************************************************/ 19/***************************************************************/
34/* structure exchanging data between isdn hl and divert module */ 20/* structure exchanging data between isdn hl and divert module */
@@ -46,6 +32,4 @@ typedef struct
46/* function register */ 32/* function register */
47/*********************/ 33/*********************/
48extern int DIVERT_REG_NAME(isdn_divert_if *); 34extern int DIVERT_REG_NAME(isdn_divert_if *);
49#endif
50
51#endif /* _LINUX_ISDN_DIVERTIF_H */ 35#endif /* _LINUX_ISDN_DIVERTIF_H */
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 8687a7dc063..d5f62bc5f4b 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -9,68 +9,16 @@
9 * of the GNU General Public License, incorporated herein by reference. 9 * of the GNU General Public License, incorporated herein by reference.
10 * 10 *
11 */ 11 */
12
13#ifndef _LINUX_ISDN_PPP_H 12#ifndef _LINUX_ISDN_PPP_H
14#define _LINUX_ISDN_PPP_H 13#define _LINUX_ISDN_PPP_H
15 14
16#define CALLTYPE_INCOMING 0x1
17#define CALLTYPE_OUTGOING 0x2
18#define CALLTYPE_CALLBACK 0x4
19
20#define IPPP_VERSION "2.2.0"
21
22struct pppcallinfo
23{
24 int calltype;
25 unsigned char local_num[64];
26 unsigned char remote_num[64];
27 int charge_units;
28};
29
30#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
31#define PPPIOCBUNDLE _IOW('t',129,int)
32#define PPPIOCGMPFLAGS _IOR('t',130,int)
33#define PPPIOCSMPFLAGS _IOW('t',131,int)
34#define PPPIOCSMPMTU _IOW('t',132,int)
35#define PPPIOCSMPMRU _IOW('t',133,int)
36#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
37#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
38#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
39
40
41#define SC_MP_PROT 0x00000200
42#define SC_REJ_MP_PROT 0x00000400
43#define SC_OUT_SHORT_SEQ 0x00000800
44#define SC_IN_SHORT_SEQ 0x00004000
45
46#define SC_DECOMP_ON 0x01
47#define SC_COMP_ON 0x02
48#define SC_DECOMP_DISCARD 0x04
49#define SC_COMP_DISCARD 0x08
50#define SC_LINK_DECOMP_ON 0x10
51#define SC_LINK_COMP_ON 0x20
52#define SC_LINK_DECOMP_DISCARD 0x40
53#define SC_LINK_COMP_DISCARD 0x80
54
55#define ISDN_PPP_COMP_MAX_OPTIONS 16
56
57#define IPPP_COMP_FLAG_XMIT 0x1
58#define IPPP_COMP_FLAG_LINK 0x2
59
60struct isdn_ppp_comp_data {
61 int num;
62 unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
63 int optlen;
64 int flags;
65};
66
67#ifdef __KERNEL__
68 15
69 16
70 17
71#ifdef CONFIG_IPPP_FILTER 18#ifdef CONFIG_IPPP_FILTER
72#include <linux/filter.h> 19#include <linux/filter.h>
73#endif 20#endif
21#include <uapi/linux/isdn_ppp.h>
74 22
75#define DECOMP_ERR_NOMEM (-10) 23#define DECOMP_ERR_NOMEM (-10)
76 24
@@ -244,5 +192,4 @@ struct ippp_struct {
244 unsigned long compflags; 192 unsigned long compflags;
245}; 193};
246 194
247#endif /* __KERNEL__ */
248#endif /* _LINUX_ISDN_PPP_H */ 195#endif /* _LINUX_ISDN_PPP_H */
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index b8c23f88dd5..0fc6ff27622 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -10,51 +10,12 @@
10 * of the GNU General Public License, incorporated herein by reference. 10 * of the GNU General Public License, incorporated herein by reference.
11 * 11 *
12 */ 12 */
13
14#ifndef __ISDNIF_H__ 13#ifndef __ISDNIF_H__
15#define __ISDNIF_H__ 14#define __ISDNIF_H__
16 15
17 16
18/*
19 * Values for general protocol-selection
20 */
21#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
22#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
23#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
24#define ISDN_PTYPE_LEASED 3 /* for leased lines */
25#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
26#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
27
28/*
29 * Values for Layer-2-protocol-selection
30 */
31#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
32#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
33#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
34#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
35#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
36#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
37#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
38#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
39#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
40#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
41#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
42#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
43#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
44#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
45
46/*
47 * Values for Layer-3-protocol-selection
48 */
49#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
50#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
51#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
52#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
53#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
54
55#ifdef __KERNEL__
56
57#include <linux/skbuff.h> 17#include <linux/skbuff.h>
18#include <uapi/linux/isdnif.h>
58 19
59/***************************************************************************/ 20/***************************************************************************/
60/* Extensions made by Werner Cornelius (werner@ikt.de) */ 21/* Extensions made by Werner Cornelius (werner@ikt.de) */
@@ -541,6 +502,4 @@ typedef struct {
541extern int register_isdn(isdn_if*); 502extern int register_isdn(isdn_if*);
542#include <asm/uaccess.h> 503#include <asm/uaccess.h>
543 504
544#endif /* __KERNEL__ */
545
546#endif /* __ISDNIF_H__ */ 505#endif /* __ISDNIF_H__ */
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 47199b13e0e..cbf2aa9e93b 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -1,12 +1,8 @@
1#ifndef _LINUX_JOYSTICK_H
2#define _LINUX_JOYSTICK_H
3
4/* 1/*
5 * Copyright (C) 1996-2000 Vojtech Pavlik 2 * Copyright (C) 1996-2000 Vojtech Pavlik
6 * 3 *
7 * Sponsored by SuSE 4 * Sponsored by SuSE
8 */ 5 */
9
10/* 6/*
11 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -26,113 +22,11 @@
26 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail: 22 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
27 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic 23 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
28 */ 24 */
25#ifndef _LINUX_JOYSTICK_H
26#define _LINUX_JOYSTICK_H
29 27
30#include <linux/types.h> 28#include <uapi/linux/joystick.h>
31#include <linux/input.h>
32
33/*
34 * Version
35 */
36
37#define JS_VERSION 0x020100
38
39/*
40 * Types and constants for reading from /dev/js
41 */
42
43#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
44#define JS_EVENT_AXIS 0x02 /* joystick moved */
45#define JS_EVENT_INIT 0x80 /* initial state of device */
46
47struct js_event {
48 __u32 time; /* event timestamp in milliseconds */
49 __s16 value; /* value */
50 __u8 type; /* event type */
51 __u8 number; /* axis/button number */
52};
53
54/*
55 * IOCTL commands for joystick driver
56 */
57
58#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
59
60#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
61#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
62#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
63
64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
66
67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
71
72/*
73 * Types and constants for get/set correction
74 */
75
76#define JS_CORR_NONE 0x00 /* returns raw values */
77#define JS_CORR_BROKEN 0x01 /* broken line */
78
79struct js_corr {
80 __s32 coef[8];
81 __s16 prec;
82 __u16 type;
83};
84
85/*
86 * v0.x compatibility definitions
87 */
88
89#define JS_RETURN sizeof(struct JS_DATA_TYPE)
90#define JS_TRUE 1
91#define JS_FALSE 0
92#define JS_X_0 0x01
93#define JS_Y_0 0x02
94#define JS_X_1 0x04
95#define JS_Y_1 0x08
96#define JS_MAX 2
97
98#define JS_DEF_TIMEOUT 0x1300
99#define JS_DEF_CORR 0
100#define JS_DEF_TIMELIMIT 10L
101
102#define JS_SET_CAL 1
103#define JS_GET_CAL 2
104#define JS_SET_TIMEOUT 3
105#define JS_GET_TIMEOUT 4
106#define JS_SET_TIMELIMIT 5
107#define JS_GET_TIMELIMIT 6
108#define JS_GET_ALL 7
109#define JS_SET_ALL 8
110
111struct JS_DATA_TYPE {
112 __s32 buttons;
113 __s32 x;
114 __s32 y;
115};
116
117struct JS_DATA_SAVE_TYPE_32 {
118 __s32 JS_TIMEOUT;
119 __s32 BUSY;
120 __s32 JS_EXPIRETIME;
121 __s32 JS_TIMELIMIT;
122 struct JS_DATA_TYPE JS_SAVE;
123 struct JS_DATA_TYPE JS_CORR;
124};
125
126struct JS_DATA_SAVE_TYPE_64 {
127 __s32 JS_TIMEOUT;
128 __s32 BUSY;
129 __s64 JS_EXPIRETIME;
130 __s64 JS_TIMELIMIT;
131 struct JS_DATA_TYPE JS_SAVE;
132 struct JS_DATA_TYPE JS_CORR;
133};
134 29
135#ifdef __KERNEL__
136#if BITS_PER_LONG == 64 30#if BITS_PER_LONG == 64
137#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64 31#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
138#elif BITS_PER_LONG == 32 32#elif BITS_PER_LONG == 32
@@ -140,6 +34,4 @@ struct JS_DATA_SAVE_TYPE_64 {
140#else 34#else
141#error Unexpected BITS_PER_LONG 35#error Unexpected BITS_PER_LONG
142#endif 36#endif
143#endif
144
145#endif /* _LINUX_JOYSTICK_H */ 37#endif /* _LINUX_JOYSTICK_H */
diff --git a/include/linux/kd.h b/include/linux/kd.h
index c36d8476db5..25bd17fad23 100644
--- a/include/linux/kd.h
+++ b/include/linux/kd.h
@@ -1,186 +1,7 @@
1#ifndef _LINUX_KD_H 1#ifndef _LINUX_KD_H
2#define _LINUX_KD_H 2#define _LINUX_KD_H
3#include <linux/types.h>
4#include <linux/compiler.h>
5 3
6/* 0x4B is 'K', to avoid collision with termios and vt */ 4#include <uapi/linux/kd.h>
7 5
8#define GIO_FONT 0x4B60 /* gets font in expanded form */
9#define PIO_FONT 0x4B61 /* use font in expanded form */
10
11#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
12#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
13struct consolefontdesc {
14 unsigned short charcount; /* characters in font (256 or 512) */
15 unsigned short charheight; /* scan lines per character (1-32) */
16 char __user *chardata; /* font data in expanded form */
17};
18
19#define PIO_FONTRESET 0x4B6D /* reset to default font */
20
21#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
22#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
23
24#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
25#define KDMKTONE 0x4B30 /* generate tone */
26
27#define KDGETLED 0x4B31 /* return current led state */
28#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
29#define LED_SCR 0x01 /* scroll lock led */
30#define LED_NUM 0x02 /* num lock led */
31#define LED_CAP 0x04 /* caps lock led */
32
33#define KDGKBTYPE 0x4B33 /* get keyboard type */
34#define KB_84 0x01
35#define KB_101 0x02 /* this is what we always answer */
36#define KB_OTHER 0x03
37
38#define KDADDIO 0x4B34 /* add i/o port as valid */
39#define KDDELIO 0x4B35 /* del i/o port as valid */
40#define KDENABIO 0x4B36 /* enable i/o to video board */
41#define KDDISABIO 0x4B37 /* disable i/o to video board */
42
43#define KDSETMODE 0x4B3A /* set text/graphics mode */
44#define KD_TEXT 0x00
45#define KD_GRAPHICS 0x01
46#define KD_TEXT0 0x02 /* obsolete */
47#define KD_TEXT1 0x03 /* obsolete */
48#define KDGETMODE 0x4B3B /* get current mode */
49
50#define KDMAPDISP 0x4B3C /* map display into address space */
51#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
52
53typedef char scrnmap_t;
54#define E_TABSZ 256
55#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
56#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
57#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
58#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
59
60#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
61struct unipair {
62 unsigned short unicode;
63 unsigned short fontpos;
64};
65struct unimapdesc {
66 unsigned short entry_ct;
67 struct unipair __user *entries;
68};
69#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
70#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
71struct unimapinit {
72 unsigned short advised_hashsize; /* 0 if no opinion */
73 unsigned short advised_hashstep; /* 0 if no opinion */
74 unsigned short advised_hashlevel; /* 0 if no opinion */
75};
76
77#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
78#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
79
80#define K_RAW 0x00
81#define K_XLATE 0x01
82#define K_MEDIUMRAW 0x02
83#define K_UNICODE 0x03
84#define K_OFF 0x04
85#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
86#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
87
88#define K_METABIT 0x03
89#define K_ESCPREFIX 0x04
90#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
91#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
92
93#define K_SCROLLLOCK 0x01
94#define K_NUMLOCK 0x02
95#define K_CAPSLOCK 0x04
96#define KDGKBLED 0x4B64 /* get led flags (not lights) */
97#define KDSKBLED 0x4B65 /* set led flags (not lights) */
98
99struct kbentry {
100 unsigned char kb_table;
101 unsigned char kb_index;
102 unsigned short kb_value;
103};
104#define K_NORMTAB 0x00
105#define K_SHIFTTAB 0x01
106#define K_ALTTAB 0x02
107#define K_ALTSHIFTTAB 0x03
108
109#define KDGKBENT 0x4B46 /* gets one entry in translation table */
110#define KDSKBENT 0x4B47 /* sets one entry in translation table */
111
112struct kbsentry {
113 unsigned char kb_func;
114 unsigned char kb_string[512];
115};
116#define KDGKBSENT 0x4B48 /* gets one function key string entry */
117#define KDSKBSENT 0x4B49 /* sets one function key string entry */
118
119struct kbdiacr {
120 unsigned char diacr, base, result;
121};
122struct kbdiacrs {
123 unsigned int kb_cnt; /* number of entries in following array */
124 struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
125};
126#define KDGKBDIACR 0x4B4A /* read kernel accent table */
127#define KDSKBDIACR 0x4B4B /* write kernel accent table */
128
129struct kbdiacruc {
130 unsigned int diacr, base, result;
131};
132struct kbdiacrsuc {
133 unsigned int kb_cnt; /* number of entries in following array */
134 struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
135};
136#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
137#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
138
139struct kbkeycode {
140 unsigned int scancode, keycode;
141};
142#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
143#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
144
145#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
146
147struct kbd_repeat {
148 int delay; /* in msec; <= 0: don't change */
149 int period; /* in msec; <= 0: don't change */
150 /* earlier this field was misnamed "rate" */
151};
152
153#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
154 * actually used values are returned */
155
156#define KDFONTOP 0x4B72 /* font operations */
157
158struct console_font_op {
159 unsigned int op; /* operation code KD_FONT_OP_* */
160 unsigned int flags; /* KD_FONT_FLAG_* */
161 unsigned int width, height; /* font size */
162 unsigned int charcount;
163 unsigned char __user *data; /* font data with height fixed to 32 */
164};
165
166struct console_font {
167 unsigned int width, height; /* font size */
168 unsigned int charcount;
169 unsigned char *data; /* font data with height fixed to 32 */
170};
171
172#define KD_FONT_OP_SET 0 /* Set font */
173#define KD_FONT_OP_GET 1 /* Get font */
174#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
175#define KD_FONT_OP_COPY 3 /* Copy from another console */
176
177#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
178#ifdef __KERNEL__
179#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */ 6#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */
180#endif
181
182/* note: 0x4B00-0x4B4E all have had a value at some time;
183 don't reuse for the time being */
184/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
185
186#endif /* _LINUX_KD_H */ 7#endif /* _LINUX_KD_H */
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
index 2dacab8becc..c838abe3ee0 100644
--- a/include/linux/kdev_t.h
+++ b/include/linux/kdev_t.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_KDEV_T_H 1#ifndef _LINUX_KDEV_T_H
2#define _LINUX_KDEV_T_H 2#define _LINUX_KDEV_T_H
3#ifdef __KERNEL__ 3
4#include <uapi/linux/kdev_t.h>
5
4#define MINORBITS 20 6#define MINORBITS 20
5#define MINORMASK ((1U << MINORBITS) - 1) 7#define MINORMASK ((1U << MINORBITS) - 1)
6 8
@@ -87,14 +89,4 @@ static inline unsigned sysv_minor(u32 dev)
87 return dev & 0x3ffff; 89 return dev & 0x3ffff;
88} 90}
89 91
90#else /* __KERNEL__ */
91
92/*
93Some programs want their definitions of MAJOR and MINOR and MKDEV
94from the kernel sources. These must be the externally visible ones.
95*/
96#define MAJOR(dev) ((dev)>>8)
97#define MINOR(dev) ((dev) & 0xff)
98#define MKDEV(ma,mi) ((ma)<<8 | (mi))
99#endif /* __KERNEL__ */
100#endif 92#endif
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h
index a1bdf696635..546eb6a7693 100644
--- a/include/linux/kernel-page-flags.h
+++ b/include/linux/kernel-page-flags.h
@@ -1,38 +1,8 @@
1#ifndef LINUX_KERNEL_PAGE_FLAGS_H 1#ifndef LINUX_KERNEL_PAGE_FLAGS_H
2#define LINUX_KERNEL_PAGE_FLAGS_H 2#define LINUX_KERNEL_PAGE_FLAGS_H
3 3
4/* 4#include <uapi/linux/kernel-page-flags.h>
5 * Stable page flag bits exported to user space
6 */
7
8#define KPF_LOCKED 0
9#define KPF_ERROR 1
10#define KPF_REFERENCED 2
11#define KPF_UPTODATE 3
12#define KPF_DIRTY 4
13#define KPF_LRU 5
14#define KPF_ACTIVE 6
15#define KPF_SLAB 7
16#define KPF_WRITEBACK 8
17#define KPF_RECLAIM 9
18#define KPF_BUDDY 10
19
20/* 11-20: new additions in 2.6.31 */
21#define KPF_MMAP 11
22#define KPF_ANON 12
23#define KPF_SWAPCACHE 13
24#define KPF_SWAPBACKED 14
25#define KPF_COMPOUND_HEAD 15
26#define KPF_COMPOUND_TAIL 16
27#define KPF_HUGE 17
28#define KPF_UNEVICTABLE 18
29#define KPF_HWPOISON 19
30#define KPF_NOPAGE 20
31 5
32#define KPF_KSM 21
33#define KPF_THP 22
34
35#ifdef __KERNEL__
36 6
37/* kernel hacking assistances 7/* kernel hacking assistances
38 * WARNING: subject to change, never rely on them! 8 * WARNING: subject to change, never rely on them!
@@ -46,6 +16,4 @@
46#define KPF_ARCH 38 16#define KPF_ARCH 38
47#define KPF_UNCACHED 39 17#define KPF_UNCACHED 39
48 18
49#endif /* __KERNEL__ */
50
51#endif /* LINUX_KERNEL_PAGE_FLAGS_H */ 19#endif /* LINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2451f1f7a1d..a123b13b70f 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -1,15 +1,6 @@
1#ifndef _LINUX_KERNEL_H 1#ifndef _LINUX_KERNEL_H
2#define _LINUX_KERNEL_H 2#define _LINUX_KERNEL_H
3 3
4#include <linux/sysinfo.h>
5
6/*
7 * 'kernel.h' contains some often-used function prototypes etc
8 */
9#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
10#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
11
12#ifdef __KERNEL__
13 4
14#include <stdarg.h> 5#include <stdarg.h>
15#include <linux/linkage.h> 6#include <linux/linkage.h>
@@ -22,6 +13,7 @@
22#include <linux/printk.h> 13#include <linux/printk.h>
23#include <linux/dynamic_debug.h> 14#include <linux/dynamic_debug.h>
24#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16#include <uapi/linux/kernel.h>
25 17
26#define USHRT_MAX ((u16)(~0U)) 18#define USHRT_MAX ((u16)(~0U))
27#define SHRT_MAX ((s16)(USHRT_MAX>>1)) 19#define SHRT_MAX ((s16)(USHRT_MAX>>1))
@@ -716,6 +708,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
716 708
717extern int do_sysinfo(struct sysinfo *info); 709extern int do_sysinfo(struct sysinfo *info);
718 710
719#endif /* __KERNEL__ */
720
721#endif 711#endif
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 9c2683929fd..9be37da9368 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -6,49 +6,15 @@
6 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) 6 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7 * 7 *
8 */ 8 */
9
10#ifndef __KERNELCAPI_H__ 9#ifndef __KERNELCAPI_H__
11#define __KERNELCAPI_H__ 10#define __KERNELCAPI_H__
12 11
13#define CAPI_MAXAPPL 240 /* maximum number of applications */
14#define CAPI_MAXCONTR 32 /* maximum number of controller */
15#define CAPI_MAXDATAWINDOW 8
16
17
18typedef struct kcapi_flagdef {
19 int contr;
20 int flag;
21} kcapi_flagdef;
22
23typedef struct kcapi_carddef {
24 char driver[32];
25 unsigned int port;
26 unsigned irq;
27 unsigned int membase;
28 int cardnr;
29} kcapi_carddef;
30
31/* new ioctls >= 10 */
32#define KCAPI_CMD_TRACE 10
33#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
34
35/*
36 * flag > 2 => trace also data
37 * flag & 1 => show trace
38 */
39#define KCAPI_TRACE_OFF 0
40#define KCAPI_TRACE_SHORT_NO_DATA 1
41#define KCAPI_TRACE_FULL_NO_DATA 2
42#define KCAPI_TRACE_SHORT 3
43#define KCAPI_TRACE_FULL 4
44
45
46#ifdef __KERNEL__
47 12
48#include <linux/list.h> 13#include <linux/list.h>
49#include <linux/skbuff.h> 14#include <linux/skbuff.h>
50#include <linux/workqueue.h> 15#include <linux/workqueue.h>
51#include <linux/notifier.h> 16#include <linux/notifier.h>
17#include <uapi/linux/kernelcapi.h>
52 18
53struct capi20_appl { 19struct capi20_appl {
54 u16 applid; 20 u16 applid;
@@ -150,6 +116,4 @@ typedef enum {
150 CapiCallGivenToOtherApplication = 0x3304, 116 CapiCallGivenToOtherApplication = 0x3304,
151} CAPI_REASON; 117} CAPI_REASON;
152 118
153#endif /* __KERNEL__ */
154
155#endif /* __KERNELCAPI_H__ */ 119#endif /* __KERNELCAPI_H__ */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 37c5f726114..d0b8458a703 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -1,57 +1,8 @@
1#ifndef LINUX_KEXEC_H 1#ifndef LINUX_KEXEC_H
2#define LINUX_KEXEC_H 2#define LINUX_KEXEC_H
3 3
4/* kexec system call - It loads the new kernel to boot into. 4#include <uapi/linux/kexec.h>
5 * kexec does not sync, or unmount filesystems so if you need
6 * that to happen you need to do that yourself.
7 */
8
9#include <linux/types.h>
10
11/* kexec flags for different usage scenarios */
12#define KEXEC_ON_CRASH 0x00000001
13#define KEXEC_PRESERVE_CONTEXT 0x00000002
14#define KEXEC_ARCH_MASK 0xffff0000
15
16/* These values match the ELF architecture values.
17 * Unless there is a good reason that should continue to be the case.
18 */
19#define KEXEC_ARCH_DEFAULT ( 0 << 16)
20#define KEXEC_ARCH_386 ( 3 << 16)
21#define KEXEC_ARCH_X86_64 (62 << 16)
22#define KEXEC_ARCH_PPC (20 << 16)
23#define KEXEC_ARCH_PPC64 (21 << 16)
24#define KEXEC_ARCH_IA_64 (50 << 16)
25#define KEXEC_ARCH_ARM (40 << 16)
26#define KEXEC_ARCH_S390 (22 << 16)
27#define KEXEC_ARCH_SH (42 << 16)
28#define KEXEC_ARCH_MIPS_LE (10 << 16)
29#define KEXEC_ARCH_MIPS ( 8 << 16)
30
31/* The artificial cap on the number of segments passed to kexec_load. */
32#define KEXEC_SEGMENT_MAX 16
33
34#ifndef __KERNEL__
35/*
36 * This structure is used to hold the arguments that are used when
37 * loading kernel binaries.
38 */
39struct kexec_segment {
40 const void *buf;
41 size_t bufsz;
42 const void *mem;
43 size_t memsz;
44};
45
46/* Load a new kernel image as described by the kexec_segment array
47 * consisting of passed number of segments at the entry-point address.
48 * The flags allow different useage types.
49 */
50extern int kexec_load(void *, size_t, struct kexec_segment *,
51 unsigned long int);
52#endif /* __KERNEL__ */
53 5
54#ifdef __KERNEL__
55#ifdef CONFIG_KEXEC 6#ifdef CONFIG_KEXEC
56#include <linux/list.h> 7#include <linux/list.h>
57#include <linux/linkage.h> 8#include <linux/linkage.h>
@@ -258,5 +209,4 @@ struct task_struct;
258static inline void crash_kexec(struct pt_regs *regs) { } 209static inline void crash_kexec(struct pt_regs *regs) { }
259static inline int kexec_should_crash(struct task_struct *p) { return 0; } 210static inline int kexec_should_crash(struct task_struct *p) { return 0; }
260#endif /* CONFIG_KEXEC */ 211#endif /* CONFIG_KEXEC */
261#endif /* __KERNEL__ */
262#endif /* LINUX_KEXEC_H */ 212#endif /* LINUX_KEXEC_H */
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index 86e5214ae73..131ed514652 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -1,28 +1,8 @@
1#ifndef __LINUX_KEYBOARD_H 1#ifndef __LINUX_KEYBOARD_H
2#define __LINUX_KEYBOARD_H 2#define __LINUX_KEYBOARD_H
3 3
4#include <linux/wait.h> 4#include <uapi/linux/keyboard.h>
5 5
6#define KG_SHIFT 0
7#define KG_CTRL 2
8#define KG_ALT 3
9#define KG_ALTGR 1
10#define KG_SHIFTL 4
11#define KG_KANASHIFT 4
12#define KG_SHIFTR 5
13#define KG_CTRLL 6
14#define KG_CTRLR 7
15#define KG_CAPSSHIFT 8
16
17#define NR_SHIFT 9
18
19#define NR_KEYS 256
20#define MAX_NR_KEYMAPS 256
21/* This means 128Kb if all keymaps are allocated. Only the superuser
22 may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
23#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
24
25#ifdef __KERNEL__
26struct notifier_block; 6struct notifier_block;
27extern unsigned short *key_maps[MAX_NR_KEYMAPS]; 7extern unsigned short *key_maps[MAX_NR_KEYMAPS];
28extern unsigned short plain_map[NR_KEYS]; 8extern unsigned short plain_map[NR_KEYS];
@@ -38,422 +18,3 @@ struct keyboard_notifier_param {
38extern int register_keyboard_notifier(struct notifier_block *nb); 18extern int register_keyboard_notifier(struct notifier_block *nb);
39extern int unregister_keyboard_notifier(struct notifier_block *nb); 19extern int unregister_keyboard_notifier(struct notifier_block *nb);
40#endif 20#endif
41
42#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
43
44#define KT_LATIN 0 /* we depend on this being zero */
45#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
46#define KT_FN 1
47#define KT_SPEC 2
48#define KT_PAD 3
49#define KT_DEAD 4
50#define KT_CONS 5
51#define KT_CUR 6
52#define KT_SHIFT 7
53#define KT_META 8
54#define KT_ASCII 9
55#define KT_LOCK 10
56#define KT_SLOCK 12
57#define KT_DEAD2 13
58#define KT_BRL 14
59
60#define K(t,v) (((t)<<8)|(v))
61#define KTYP(x) ((x) >> 8)
62#define KVAL(x) ((x) & 0xff)
63
64#define K_F1 K(KT_FN,0)
65#define K_F2 K(KT_FN,1)
66#define K_F3 K(KT_FN,2)
67#define K_F4 K(KT_FN,3)
68#define K_F5 K(KT_FN,4)
69#define K_F6 K(KT_FN,5)
70#define K_F7 K(KT_FN,6)
71#define K_F8 K(KT_FN,7)
72#define K_F9 K(KT_FN,8)
73#define K_F10 K(KT_FN,9)
74#define K_F11 K(KT_FN,10)
75#define K_F12 K(KT_FN,11)
76#define K_F13 K(KT_FN,12)
77#define K_F14 K(KT_FN,13)
78#define K_F15 K(KT_FN,14)
79#define K_F16 K(KT_FN,15)
80#define K_F17 K(KT_FN,16)
81#define K_F18 K(KT_FN,17)
82#define K_F19 K(KT_FN,18)
83#define K_F20 K(KT_FN,19)
84#define K_FIND K(KT_FN,20)
85#define K_INSERT K(KT_FN,21)
86#define K_REMOVE K(KT_FN,22)
87#define K_SELECT K(KT_FN,23)
88#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
89#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
90#define K_MACRO K(KT_FN,26)
91#define K_HELP K(KT_FN,27)
92#define K_DO K(KT_FN,28)
93#define K_PAUSE K(KT_FN,29)
94#define K_F21 K(KT_FN,30)
95#define K_F22 K(KT_FN,31)
96#define K_F23 K(KT_FN,32)
97#define K_F24 K(KT_FN,33)
98#define K_F25 K(KT_FN,34)
99#define K_F26 K(KT_FN,35)
100#define K_F27 K(KT_FN,36)
101#define K_F28 K(KT_FN,37)
102#define K_F29 K(KT_FN,38)
103#define K_F30 K(KT_FN,39)
104#define K_F31 K(KT_FN,40)
105#define K_F32 K(KT_FN,41)
106#define K_F33 K(KT_FN,42)
107#define K_F34 K(KT_FN,43)
108#define K_F35 K(KT_FN,44)
109#define K_F36 K(KT_FN,45)
110#define K_F37 K(KT_FN,46)
111#define K_F38 K(KT_FN,47)
112#define K_F39 K(KT_FN,48)
113#define K_F40 K(KT_FN,49)
114#define K_F41 K(KT_FN,50)
115#define K_F42 K(KT_FN,51)
116#define K_F43 K(KT_FN,52)
117#define K_F44 K(KT_FN,53)
118#define K_F45 K(KT_FN,54)
119#define K_F46 K(KT_FN,55)
120#define K_F47 K(KT_FN,56)
121#define K_F48 K(KT_FN,57)
122#define K_F49 K(KT_FN,58)
123#define K_F50 K(KT_FN,59)
124#define K_F51 K(KT_FN,60)
125#define K_F52 K(KT_FN,61)
126#define K_F53 K(KT_FN,62)
127#define K_F54 K(KT_FN,63)
128#define K_F55 K(KT_FN,64)
129#define K_F56 K(KT_FN,65)
130#define K_F57 K(KT_FN,66)
131#define K_F58 K(KT_FN,67)
132#define K_F59 K(KT_FN,68)
133#define K_F60 K(KT_FN,69)
134#define K_F61 K(KT_FN,70)
135#define K_F62 K(KT_FN,71)
136#define K_F63 K(KT_FN,72)
137#define K_F64 K(KT_FN,73)
138#define K_F65 K(KT_FN,74)
139#define K_F66 K(KT_FN,75)
140#define K_F67 K(KT_FN,76)
141#define K_F68 K(KT_FN,77)
142#define K_F69 K(KT_FN,78)
143#define K_F70 K(KT_FN,79)
144#define K_F71 K(KT_FN,80)
145#define K_F72 K(KT_FN,81)
146#define K_F73 K(KT_FN,82)
147#define K_F74 K(KT_FN,83)
148#define K_F75 K(KT_FN,84)
149#define K_F76 K(KT_FN,85)
150#define K_F77 K(KT_FN,86)
151#define K_F78 K(KT_FN,87)
152#define K_F79 K(KT_FN,88)
153#define K_F80 K(KT_FN,89)
154#define K_F81 K(KT_FN,90)
155#define K_F82 K(KT_FN,91)
156#define K_F83 K(KT_FN,92)
157#define K_F84 K(KT_FN,93)
158#define K_F85 K(KT_FN,94)
159#define K_F86 K(KT_FN,95)
160#define K_F87 K(KT_FN,96)
161#define K_F88 K(KT_FN,97)
162#define K_F89 K(KT_FN,98)
163#define K_F90 K(KT_FN,99)
164#define K_F91 K(KT_FN,100)
165#define K_F92 K(KT_FN,101)
166#define K_F93 K(KT_FN,102)
167#define K_F94 K(KT_FN,103)
168#define K_F95 K(KT_FN,104)
169#define K_F96 K(KT_FN,105)
170#define K_F97 K(KT_FN,106)
171#define K_F98 K(KT_FN,107)
172#define K_F99 K(KT_FN,108)
173#define K_F100 K(KT_FN,109)
174#define K_F101 K(KT_FN,110)
175#define K_F102 K(KT_FN,111)
176#define K_F103 K(KT_FN,112)
177#define K_F104 K(KT_FN,113)
178#define K_F105 K(KT_FN,114)
179#define K_F106 K(KT_FN,115)
180#define K_F107 K(KT_FN,116)
181#define K_F108 K(KT_FN,117)
182#define K_F109 K(KT_FN,118)
183#define K_F110 K(KT_FN,119)
184#define K_F111 K(KT_FN,120)
185#define K_F112 K(KT_FN,121)
186#define K_F113 K(KT_FN,122)
187#define K_F114 K(KT_FN,123)
188#define K_F115 K(KT_FN,124)
189#define K_F116 K(KT_FN,125)
190#define K_F117 K(KT_FN,126)
191#define K_F118 K(KT_FN,127)
192#define K_F119 K(KT_FN,128)
193#define K_F120 K(KT_FN,129)
194#define K_F121 K(KT_FN,130)
195#define K_F122 K(KT_FN,131)
196#define K_F123 K(KT_FN,132)
197#define K_F124 K(KT_FN,133)
198#define K_F125 K(KT_FN,134)
199#define K_F126 K(KT_FN,135)
200#define K_F127 K(KT_FN,136)
201#define K_F128 K(KT_FN,137)
202#define K_F129 K(KT_FN,138)
203#define K_F130 K(KT_FN,139)
204#define K_F131 K(KT_FN,140)
205#define K_F132 K(KT_FN,141)
206#define K_F133 K(KT_FN,142)
207#define K_F134 K(KT_FN,143)
208#define K_F135 K(KT_FN,144)
209#define K_F136 K(KT_FN,145)
210#define K_F137 K(KT_FN,146)
211#define K_F138 K(KT_FN,147)
212#define K_F139 K(KT_FN,148)
213#define K_F140 K(KT_FN,149)
214#define K_F141 K(KT_FN,150)
215#define K_F142 K(KT_FN,151)
216#define K_F143 K(KT_FN,152)
217#define K_F144 K(KT_FN,153)
218#define K_F145 K(KT_FN,154)
219#define K_F146 K(KT_FN,155)
220#define K_F147 K(KT_FN,156)
221#define K_F148 K(KT_FN,157)
222#define K_F149 K(KT_FN,158)
223#define K_F150 K(KT_FN,159)
224#define K_F151 K(KT_FN,160)
225#define K_F152 K(KT_FN,161)
226#define K_F153 K(KT_FN,162)
227#define K_F154 K(KT_FN,163)
228#define K_F155 K(KT_FN,164)
229#define K_F156 K(KT_FN,165)
230#define K_F157 K(KT_FN,166)
231#define K_F158 K(KT_FN,167)
232#define K_F159 K(KT_FN,168)
233#define K_F160 K(KT_FN,169)
234#define K_F161 K(KT_FN,170)
235#define K_F162 K(KT_FN,171)
236#define K_F163 K(KT_FN,172)
237#define K_F164 K(KT_FN,173)
238#define K_F165 K(KT_FN,174)
239#define K_F166 K(KT_FN,175)
240#define K_F167 K(KT_FN,176)
241#define K_F168 K(KT_FN,177)
242#define K_F169 K(KT_FN,178)
243#define K_F170 K(KT_FN,179)
244#define K_F171 K(KT_FN,180)
245#define K_F172 K(KT_FN,181)
246#define K_F173 K(KT_FN,182)
247#define K_F174 K(KT_FN,183)
248#define K_F175 K(KT_FN,184)
249#define K_F176 K(KT_FN,185)
250#define K_F177 K(KT_FN,186)
251#define K_F178 K(KT_FN,187)
252#define K_F179 K(KT_FN,188)
253#define K_F180 K(KT_FN,189)
254#define K_F181 K(KT_FN,190)
255#define K_F182 K(KT_FN,191)
256#define K_F183 K(KT_FN,192)
257#define K_F184 K(KT_FN,193)
258#define K_F185 K(KT_FN,194)
259#define K_F186 K(KT_FN,195)
260#define K_F187 K(KT_FN,196)
261#define K_F188 K(KT_FN,197)
262#define K_F189 K(KT_FN,198)
263#define K_F190 K(KT_FN,199)
264#define K_F191 K(KT_FN,200)
265#define K_F192 K(KT_FN,201)
266#define K_F193 K(KT_FN,202)
267#define K_F194 K(KT_FN,203)
268#define K_F195 K(KT_FN,204)
269#define K_F196 K(KT_FN,205)
270#define K_F197 K(KT_FN,206)
271#define K_F198 K(KT_FN,207)
272#define K_F199 K(KT_FN,208)
273#define K_F200 K(KT_FN,209)
274#define K_F201 K(KT_FN,210)
275#define K_F202 K(KT_FN,211)
276#define K_F203 K(KT_FN,212)
277#define K_F204 K(KT_FN,213)
278#define K_F205 K(KT_FN,214)
279#define K_F206 K(KT_FN,215)
280#define K_F207 K(KT_FN,216)
281#define K_F208 K(KT_FN,217)
282#define K_F209 K(KT_FN,218)
283#define K_F210 K(KT_FN,219)
284#define K_F211 K(KT_FN,220)
285#define K_F212 K(KT_FN,221)
286#define K_F213 K(KT_FN,222)
287#define K_F214 K(KT_FN,223)
288#define K_F215 K(KT_FN,224)
289#define K_F216 K(KT_FN,225)
290#define K_F217 K(KT_FN,226)
291#define K_F218 K(KT_FN,227)
292#define K_F219 K(KT_FN,228)
293#define K_F220 K(KT_FN,229)
294#define K_F221 K(KT_FN,230)
295#define K_F222 K(KT_FN,231)
296#define K_F223 K(KT_FN,232)
297#define K_F224 K(KT_FN,233)
298#define K_F225 K(KT_FN,234)
299#define K_F226 K(KT_FN,235)
300#define K_F227 K(KT_FN,236)
301#define K_F228 K(KT_FN,237)
302#define K_F229 K(KT_FN,238)
303#define K_F230 K(KT_FN,239)
304#define K_F231 K(KT_FN,240)
305#define K_F232 K(KT_FN,241)
306#define K_F233 K(KT_FN,242)
307#define K_F234 K(KT_FN,243)
308#define K_F235 K(KT_FN,244)
309#define K_F236 K(KT_FN,245)
310#define K_F237 K(KT_FN,246)
311#define K_F238 K(KT_FN,247)
312#define K_F239 K(KT_FN,248)
313#define K_F240 K(KT_FN,249)
314#define K_F241 K(KT_FN,250)
315#define K_F242 K(KT_FN,251)
316#define K_F243 K(KT_FN,252)
317#define K_F244 K(KT_FN,253)
318#define K_F245 K(KT_FN,254)
319#define K_UNDO K(KT_FN,255)
320
321
322#define K_HOLE K(KT_SPEC,0)
323#define K_ENTER K(KT_SPEC,1)
324#define K_SH_REGS K(KT_SPEC,2)
325#define K_SH_MEM K(KT_SPEC,3)
326#define K_SH_STAT K(KT_SPEC,4)
327#define K_BREAK K(KT_SPEC,5)
328#define K_CONS K(KT_SPEC,6)
329#define K_CAPS K(KT_SPEC,7)
330#define K_NUM K(KT_SPEC,8)
331#define K_HOLD K(KT_SPEC,9)
332#define K_SCROLLFORW K(KT_SPEC,10)
333#define K_SCROLLBACK K(KT_SPEC,11)
334#define K_BOOT K(KT_SPEC,12)
335#define K_CAPSON K(KT_SPEC,13)
336#define K_COMPOSE K(KT_SPEC,14)
337#define K_SAK K(KT_SPEC,15)
338#define K_DECRCONSOLE K(KT_SPEC,16)
339#define K_INCRCONSOLE K(KT_SPEC,17)
340#define K_SPAWNCONSOLE K(KT_SPEC,18)
341#define K_BARENUMLOCK K(KT_SPEC,19)
342
343#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
344#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
345
346#define K_P0 K(KT_PAD,0)
347#define K_P1 K(KT_PAD,1)
348#define K_P2 K(KT_PAD,2)
349#define K_P3 K(KT_PAD,3)
350#define K_P4 K(KT_PAD,4)
351#define K_P5 K(KT_PAD,5)
352#define K_P6 K(KT_PAD,6)
353#define K_P7 K(KT_PAD,7)
354#define K_P8 K(KT_PAD,8)
355#define K_P9 K(KT_PAD,9)
356#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
357#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
358#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
359#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
360#define K_PENTER K(KT_PAD,14) /* key-pad enter */
361#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
362#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
363#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
364#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
365#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
366
367#define NR_PAD 20
368
369#define K_DGRAVE K(KT_DEAD,0)
370#define K_DACUTE K(KT_DEAD,1)
371#define K_DCIRCM K(KT_DEAD,2)
372#define K_DTILDE K(KT_DEAD,3)
373#define K_DDIERE K(KT_DEAD,4)
374#define K_DCEDIL K(KT_DEAD,5)
375
376#define NR_DEAD 6
377
378#define K_DOWN K(KT_CUR,0)
379#define K_LEFT K(KT_CUR,1)
380#define K_RIGHT K(KT_CUR,2)
381#define K_UP K(KT_CUR,3)
382
383#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
384#define K_CTRL K(KT_SHIFT,KG_CTRL)
385#define K_ALT K(KT_SHIFT,KG_ALT)
386#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
387#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
388#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
389#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
390#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
391#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
392
393#define K_ASC0 K(KT_ASCII,0)
394#define K_ASC1 K(KT_ASCII,1)
395#define K_ASC2 K(KT_ASCII,2)
396#define K_ASC3 K(KT_ASCII,3)
397#define K_ASC4 K(KT_ASCII,4)
398#define K_ASC5 K(KT_ASCII,5)
399#define K_ASC6 K(KT_ASCII,6)
400#define K_ASC7 K(KT_ASCII,7)
401#define K_ASC8 K(KT_ASCII,8)
402#define K_ASC9 K(KT_ASCII,9)
403#define K_HEX0 K(KT_ASCII,10)
404#define K_HEX1 K(KT_ASCII,11)
405#define K_HEX2 K(KT_ASCII,12)
406#define K_HEX3 K(KT_ASCII,13)
407#define K_HEX4 K(KT_ASCII,14)
408#define K_HEX5 K(KT_ASCII,15)
409#define K_HEX6 K(KT_ASCII,16)
410#define K_HEX7 K(KT_ASCII,17)
411#define K_HEX8 K(KT_ASCII,18)
412#define K_HEX9 K(KT_ASCII,19)
413#define K_HEXa K(KT_ASCII,20)
414#define K_HEXb K(KT_ASCII,21)
415#define K_HEXc K(KT_ASCII,22)
416#define K_HEXd K(KT_ASCII,23)
417#define K_HEXe K(KT_ASCII,24)
418#define K_HEXf K(KT_ASCII,25)
419
420#define NR_ASCII 26
421
422#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
423#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
424#define K_ALTLOCK K(KT_LOCK,KG_ALT)
425#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
426#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
427#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
428#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
429#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
430#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
431
432#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
433#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
434#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
435#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
436#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
437#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
438#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
439#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
440#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
441
442#define NR_LOCK 9
443
444#define K_BRL_BLANK K(KT_BRL, 0)
445#define K_BRL_DOT1 K(KT_BRL, 1)
446#define K_BRL_DOT2 K(KT_BRL, 2)
447#define K_BRL_DOT3 K(KT_BRL, 3)
448#define K_BRL_DOT4 K(KT_BRL, 4)
449#define K_BRL_DOT5 K(KT_BRL, 5)
450#define K_BRL_DOT6 K(KT_BRL, 6)
451#define K_BRL_DOT7 K(KT_BRL, 7)
452#define K_BRL_DOT8 K(KT_BRL, 8)
453#define K_BRL_DOT9 K(KT_BRL, 9)
454#define K_BRL_DOT10 K(KT_BRL, 10)
455
456#define NR_BRL 11
457
458#define MAX_DIACR 256
459#endif
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index ff476ddaf31..00a97bb905d 100644
--- a/include/linux/kvm_para.h
+++ b/include/linux/kvm_para.h
@@ -1,31 +1,8 @@
1#ifndef __LINUX_KVM_PARA_H 1#ifndef __LINUX_KVM_PARA_H
2#define __LINUX_KVM_PARA_H 2#define __LINUX_KVM_PARA_H
3 3
4/* 4#include <uapi/linux/kvm_para.h>
5 * This header file provides a method for making a hypercall to the host
6 * Architectures should define:
7 * - kvm_hypercall0, kvm_hypercall1...
8 * - kvm_arch_para_features
9 * - kvm_para_available
10 */
11 5
12/* Return values for hypercalls */
13#define KVM_ENOSYS 1000
14#define KVM_EFAULT EFAULT
15#define KVM_E2BIG E2BIG
16#define KVM_EPERM EPERM
17
18#define KVM_HC_VAPIC_POLL_IRQ 1
19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
22
23/*
24 * hypercalls use architecture specific
25 */
26#include <asm/kvm_para.h>
27
28#ifdef __KERNEL__
29 6
30static inline int kvm_para_has_feature(unsigned int feature) 7static inline int kvm_para_has_feature(unsigned int feature)
31{ 8{
@@ -33,5 +10,4 @@ static inline int kvm_para_has_feature(unsigned int feature)
33 return 1; 10 return 1;
34 return 0; 11 return 0;
35} 12}
36#endif /* __KERNEL__ */
37#endif /* __LINUX_KVM_PARA_H */ 13#endif /* __LINUX_KVM_PARA_H */
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h
index 7eab668f60f..bffdb962f1a 100644
--- a/include/linux/l2tp.h
+++ b/include/linux/l2tp.h
@@ -3,181 +3,11 @@
3 * 3 *
4 * Author: James Chapman <jchapman@katalix.com> 4 * Author: James Chapman <jchapman@katalix.com>
5 */ 5 */
6
7#ifndef _LINUX_L2TP_H_ 6#ifndef _LINUX_L2TP_H_
8#define _LINUX_L2TP_H_ 7#define _LINUX_L2TP_H_
9 8
10#include <linux/types.h>
11#include <linux/socket.h>
12#ifdef __KERNEL__
13#include <linux/in.h> 9#include <linux/in.h>
14#include <linux/in6.h> 10#include <linux/in6.h>
15#else 11#include <uapi/linux/l2tp.h>
16#include <netinet/in.h>
17#endif
18
19#define IPPROTO_L2TP 115
20
21/**
22 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
23 * @l2tp_family: address family number AF_L2TPIP.
24 * @l2tp_addr: protocol specific address information
25 * @l2tp_conn_id: connection id of tunnel
26 */
27#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
28struct sockaddr_l2tpip {
29 /* The first fields must match struct sockaddr_in */
30 __kernel_sa_family_t l2tp_family; /* AF_INET */
31 __be16 l2tp_unused; /* INET port number (unused) */
32 struct in_addr l2tp_addr; /* Internet address */
33
34 __u32 l2tp_conn_id; /* Connection ID of tunnel */
35
36 /* Pad to size of `struct sockaddr'. */
37 unsigned char __pad[sizeof(struct sockaddr) -
38 sizeof(__kernel_sa_family_t) -
39 sizeof(__be16) - sizeof(struct in_addr) -
40 sizeof(__u32)];
41};
42
43/**
44 * struct sockaddr_l2tpip6 - the sockaddr structure for L2TP-over-IPv6 sockets
45 * @l2tp_family: address family number AF_L2TPIP.
46 * @l2tp_addr: protocol specific address information
47 * @l2tp_conn_id: connection id of tunnel
48 */
49struct sockaddr_l2tpip6 {
50 /* The first fields must match struct sockaddr_in6 */
51 __kernel_sa_family_t l2tp_family; /* AF_INET6 */
52 __be16 l2tp_unused; /* INET port number (unused) */
53 __be32 l2tp_flowinfo; /* IPv6 flow information */
54 struct in6_addr l2tp_addr; /* IPv6 address */
55 __u32 l2tp_scope_id; /* scope id (new in RFC2553) */
56 __u32 l2tp_conn_id; /* Connection ID of tunnel */
57};
58
59/*****************************************************************************
60 * NETLINK_GENERIC netlink family.
61 *****************************************************************************/
62
63/*
64 * Commands.
65 * Valid TLVs of each command are:-
66 * TUNNEL_CREATE - CONN_ID, pw_type, netns, ifname, ipinfo, udpinfo, udpcsum, vlanid
67 * TUNNEL_DELETE - CONN_ID
68 * TUNNEL_MODIFY - CONN_ID, udpcsum
69 * TUNNEL_GETSTATS - CONN_ID, (stats)
70 * TUNNEL_GET - CONN_ID, (...)
71 * SESSION_CREATE - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec
72 * SESSION_DELETE - SESSION_ID
73 * SESSION_MODIFY - SESSION_ID, data_seq
74 * SESSION_GET - SESSION_ID, (...)
75 * SESSION_GETSTATS - SESSION_ID, (stats)
76 *
77 */
78enum {
79 L2TP_CMD_NOOP,
80 L2TP_CMD_TUNNEL_CREATE,
81 L2TP_CMD_TUNNEL_DELETE,
82 L2TP_CMD_TUNNEL_MODIFY,
83 L2TP_CMD_TUNNEL_GET,
84 L2TP_CMD_SESSION_CREATE,
85 L2TP_CMD_SESSION_DELETE,
86 L2TP_CMD_SESSION_MODIFY,
87 L2TP_CMD_SESSION_GET,
88 __L2TP_CMD_MAX,
89};
90
91#define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
92
93/*
94 * ATTR types defined for L2TP
95 */
96enum {
97 L2TP_ATTR_NONE, /* no data */
98 L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */
99 L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */
100 L2TP_ATTR_OFFSET, /* u16 */
101 L2TP_ATTR_DATA_SEQ, /* u16 */
102 L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */
103 L2TP_ATTR_L2SPEC_LEN, /* u8, enum l2tp_l2spec_type */
104 L2TP_ATTR_PROTO_VERSION, /* u8 */
105 L2TP_ATTR_IFNAME, /* string */
106 L2TP_ATTR_CONN_ID, /* u32 */
107 L2TP_ATTR_PEER_CONN_ID, /* u32 */
108 L2TP_ATTR_SESSION_ID, /* u32 */
109 L2TP_ATTR_PEER_SESSION_ID, /* u32 */
110 L2TP_ATTR_UDP_CSUM, /* u8 */
111 L2TP_ATTR_VLAN_ID, /* u16 */
112 L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */
113 L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */
114 L2TP_ATTR_DEBUG, /* u32 */
115 L2TP_ATTR_RECV_SEQ, /* u8 */
116 L2TP_ATTR_SEND_SEQ, /* u8 */
117 L2TP_ATTR_LNS_MODE, /* u8 */
118 L2TP_ATTR_USING_IPSEC, /* u8 */
119 L2TP_ATTR_RECV_TIMEOUT, /* msec */
120 L2TP_ATTR_FD, /* int */
121 L2TP_ATTR_IP_SADDR, /* u32 */
122 L2TP_ATTR_IP_DADDR, /* u32 */
123 L2TP_ATTR_UDP_SPORT, /* u16 */
124 L2TP_ATTR_UDP_DPORT, /* u16 */
125 L2TP_ATTR_MTU, /* u16 */
126 L2TP_ATTR_MRU, /* u16 */
127 L2TP_ATTR_STATS, /* nested */
128 L2TP_ATTR_IP6_SADDR, /* struct in6_addr */
129 L2TP_ATTR_IP6_DADDR, /* struct in6_addr */
130 __L2TP_ATTR_MAX,
131};
132
133#define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
134
135/* Nested in L2TP_ATTR_STATS */
136enum {
137 L2TP_ATTR_STATS_NONE, /* no data */
138 L2TP_ATTR_TX_PACKETS, /* u64 */
139 L2TP_ATTR_TX_BYTES, /* u64 */
140 L2TP_ATTR_TX_ERRORS, /* u64 */
141 L2TP_ATTR_RX_PACKETS, /* u64 */
142 L2TP_ATTR_RX_BYTES, /* u64 */
143 L2TP_ATTR_RX_SEQ_DISCARDS, /* u64 */
144 L2TP_ATTR_RX_OOS_PACKETS, /* u64 */
145 L2TP_ATTR_RX_ERRORS, /* u64 */
146 __L2TP_ATTR_STATS_MAX,
147};
148
149#define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
150
151enum l2tp_pwtype {
152 L2TP_PWTYPE_NONE = 0x0000,
153 L2TP_PWTYPE_ETH_VLAN = 0x0004,
154 L2TP_PWTYPE_ETH = 0x0005,
155 L2TP_PWTYPE_PPP = 0x0007,
156 L2TP_PWTYPE_PPP_AC = 0x0008,
157 L2TP_PWTYPE_IP = 0x000b,
158 __L2TP_PWTYPE_MAX
159};
160
161enum l2tp_l2spec_type {
162 L2TP_L2SPECTYPE_NONE,
163 L2TP_L2SPECTYPE_DEFAULT,
164};
165
166enum l2tp_encap_type {
167 L2TP_ENCAPTYPE_UDP,
168 L2TP_ENCAPTYPE_IP,
169};
170
171enum l2tp_seqmode {
172 L2TP_SEQ_NONE = 0,
173 L2TP_SEQ_IP = 1,
174 L2TP_SEQ_ALL = 2,
175};
176
177/*
178 * NETLINK_GENERIC related info
179 */
180#define L2TP_GENL_NAME "l2tp"
181#define L2TP_GENL_VERSION 0x1
182 12
183#endif 13#endif
diff --git a/include/linux/llc.h b/include/linux/llc.h
index a2418ae13ee..b965314d017 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -1,5 +1,3 @@
1#ifndef __LINUX_LLC_H
2#define __LINUX_LLC_H
3/* 1/*
4 * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators. 2 * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
5 * 3 *
@@ -12,80 +10,14 @@
12 * 10 *
13 * See the GNU General Public License for more details. 11 * See the GNU General Public License for more details.
14 */ 12 */
13#ifndef __LINUX_LLC_H
14#define __LINUX_LLC_H
15 15
16#include <linux/socket.h> 16#include <uapi/linux/llc.h>
17
18#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
19struct sockaddr_llc {
20 __kernel_sa_family_t sllc_family; /* AF_LLC */
21 __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
22 unsigned char sllc_test;
23 unsigned char sllc_xid;
24 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
25 unsigned char sllc_sap;
26 unsigned char sllc_mac[IFHWADDRLEN];
27 unsigned char __pad[__LLC_SOCK_SIZE__ -
28 sizeof(__kernel_sa_family_t) * 2 -
29 sizeof(unsigned char) * 4 - IFHWADDRLEN];
30};
31
32/* sockopt definitions. */
33enum llc_sockopts {
34 LLC_OPT_UNKNOWN = 0,
35 LLC_OPT_RETRY, /* max retrans attempts. */
36 LLC_OPT_SIZE, /* max PDU size (octets). */
37 LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
38 LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
39 LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
40 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
41 LLC_OPT_TX_WIN, /* tx window size. */
42 LLC_OPT_RX_WIN, /* rx window size. */
43 LLC_OPT_PKTINFO, /* ancillary packet information. */
44 LLC_OPT_MAX
45};
46
47#define LLC_OPT_MAX_RETRY 100
48#define LLC_OPT_MAX_SIZE 4196
49#define LLC_OPT_MAX_WIN 127
50#define LLC_OPT_MAX_ACK_TMR_EXP 60
51#define LLC_OPT_MAX_P_TMR_EXP 60
52#define LLC_OPT_MAX_REJ_TMR_EXP 60
53#define LLC_OPT_MAX_BUSY_TMR_EXP 60
54
55/* LLC SAP types. */
56#define LLC_SAP_NULL 0x00 /* NULL SAP. */
57#define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */
58#define LLC_SAP_SNA 0x04 /* SNA Path Control. */
59#define LLC_SAP_PNM 0x0E /* Proway Network Management. */
60#define LLC_SAP_IP 0x06 /* TCP/IP. */
61#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
62#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
63#define LLC_SAP_8208 0x7E /* ISO 8208 */
64#define LLC_SAP_3COM 0x80 /* 3COM. */
65#define LLC_SAP_PRO 0x8E /* Proway Active Station List */
66#define LLC_SAP_SNAP 0xAA /* SNAP. */
67#define LLC_SAP_BANYAN 0xBC /* Banyan. */
68#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
69#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
70#define LLC_SAP_LANMGR 0xF4 /* LanManager. */
71#define LLC_SAP_IMPL 0xF8 /* IMPL */
72#define LLC_SAP_DISC 0xFC /* Discovery */
73#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
74#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
75#define LLC_SAP_RM 0xD4 /* Resource Management */
76#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
77
78struct llc_pktinfo {
79 int lpi_ifindex;
80 unsigned char lpi_sap;
81 unsigned char lpi_mac[IFHWADDRLEN];
82};
83 17
84#ifdef __KERNEL__
85#define LLC_SAP_DYN_START 0xC0 18#define LLC_SAP_DYN_START 0xC0
86#define LLC_SAP_DYN_STOP 0xDE 19#define LLC_SAP_DYN_STOP 0xDE
87#define LLC_SAP_DYN_TRIES 4 20#define LLC_SAP_DYN_TRIES 4
88 21
89#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0])) 22#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
90#endif /* __KERNEL__ */
91#endif /* __LINUX_LLC_H */ 23#endif /* __LINUX_LLC_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 9635116dd83..6492181bcb1 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -1,6 +1,3 @@
1#ifndef _LINUX_LOOP_H
2#define _LINUX_LOOP_H
3
4/* 1/*
5 * include/linux/loop.h 2 * include/linux/loop.h
6 * 3 *
@@ -9,15 +6,14 @@
9 * Copyright 1993 by Theodore Ts'o. Redistribution of this file is 6 * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
10 * permitted under the GNU General Public License. 7 * permitted under the GNU General Public License.
11 */ 8 */
9#ifndef _LINUX_LOOP_H
10#define _LINUX_LOOP_H
12 11
13#define LO_NAME_SIZE 64
14#define LO_KEY_SIZE 32
15
16#ifdef __KERNEL__
17#include <linux/bio.h> 12#include <linux/bio.h>
18#include <linux/blkdev.h> 13#include <linux/blkdev.h>
19#include <linux/spinlock.h> 14#include <linux/spinlock.h>
20#include <linux/mutex.h> 15#include <linux/mutex.h>
16#include <uapi/linux/loop.h>
21 17
22/* Possible states of device */ 18/* Possible states of device */
23enum { 19enum {
@@ -66,69 +62,6 @@ struct loop_device {
66 struct gendisk *lo_disk; 62 struct gendisk *lo_disk;
67}; 63};
68 64
69#endif /* __KERNEL__ */
70
71/*
72 * Loop flags
73 */
74enum {
75 LO_FLAGS_READ_ONLY = 1,
76 LO_FLAGS_AUTOCLEAR = 4,
77 LO_FLAGS_PARTSCAN = 8,
78};
79
80#include <asm/posix_types.h> /* for __kernel_old_dev_t */
81#include <linux/types.h> /* for __u64 */
82
83/* Backwards compatibility version */
84struct loop_info {
85 int lo_number; /* ioctl r/o */
86 __kernel_old_dev_t lo_device; /* ioctl r/o */
87 unsigned long lo_inode; /* ioctl r/o */
88 __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
89 int lo_offset;
90 int lo_encrypt_type;
91 int lo_encrypt_key_size; /* ioctl w/o */
92 int lo_flags; /* ioctl r/o */
93 char lo_name[LO_NAME_SIZE];
94 unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
95 unsigned long lo_init[2];
96 char reserved[4];
97};
98
99struct loop_info64 {
100 __u64 lo_device; /* ioctl r/o */
101 __u64 lo_inode; /* ioctl r/o */
102 __u64 lo_rdevice; /* ioctl r/o */
103 __u64 lo_offset;
104 __u64 lo_sizelimit;/* bytes, 0 == max available */
105 __u32 lo_number; /* ioctl r/o */
106 __u32 lo_encrypt_type;
107 __u32 lo_encrypt_key_size; /* ioctl w/o */
108 __u32 lo_flags; /* ioctl r/o */
109 __u8 lo_file_name[LO_NAME_SIZE];
110 __u8 lo_crypt_name[LO_NAME_SIZE];
111 __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
112 __u64 lo_init[2];
113};
114
115/*
116 * Loop filter types
117 */
118
119#define LO_CRYPT_NONE 0
120#define LO_CRYPT_XOR 1
121#define LO_CRYPT_DES 2
122#define LO_CRYPT_FISH2 3 /* Twofish encryption */
123#define LO_CRYPT_BLOW 4
124#define LO_CRYPT_CAST128 5
125#define LO_CRYPT_IDEA 6
126#define LO_CRYPT_DUMMY 9
127#define LO_CRYPT_SKIPJACK 10
128#define LO_CRYPT_CRYPTOAPI 18
129#define MAX_LO_CRYPT 20
130
131#ifdef __KERNEL__
132/* Support for loadable transfer modules */ 65/* Support for loadable transfer modules */
133struct loop_func_table { 66struct loop_func_table {
134 int number; /* filter type */ 67 int number; /* filter type */
@@ -147,21 +80,3 @@ int loop_register_transfer(struct loop_func_table *funcs);
147int loop_unregister_transfer(int number); 80int loop_unregister_transfer(int number);
148 81
149#endif 82#endif
150/*
151 * IOCTL commands --- we will commandeer 0x4C ('L')
152 */
153
154#define LOOP_SET_FD 0x4C00
155#define LOOP_CLR_FD 0x4C01
156#define LOOP_SET_STATUS 0x4C02
157#define LOOP_GET_STATUS 0x4C03
158#define LOOP_SET_STATUS64 0x4C04
159#define LOOP_GET_STATUS64 0x4C05
160#define LOOP_CHANGE_FD 0x4C06
161#define LOOP_SET_CAPACITY 0x4C07
162
163/* /dev/loop-control interface */
164#define LOOP_CTL_ADD 0x4C80
165#define LOOP_CTL_REMOVE 0x4C81
166#define LOOP_CTL_GET_FREE 0x4C82
167#endif
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 0df024bfd6f..0dd276af9e4 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -1,105 +1,16 @@
1#ifndef _LINUX_LP_H
2#define _LINUX_LP_H
3
4/* 1/*
5 * usr/include/linux/lp.h c.1991-1992 James Wiegand 2 * usr/include/linux/lp.h c.1991-1992 James Wiegand
6 * many modifications copyright (C) 1992 Michael K. Johnson 3 * many modifications copyright (C) 1992 Michael K. Johnson
7 * Interrupt support added 1993 Nigel Gamble 4 * Interrupt support added 1993 Nigel Gamble
8 * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti 5 * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti
9 */ 6 */
7#ifndef _LINUX_LP_H
8#define _LINUX_LP_H
10 9
11/*
12 * Per POSIX guidelines, this module reserves the LP and lp prefixes
13 * These are the lp_table[minor].flags flags...
14 */
15#define LP_EXIST 0x0001
16#define LP_SELEC 0x0002
17#define LP_BUSY 0x0004
18#define LP_BUSY_BIT_POS 2
19#define LP_OFFL 0x0008
20#define LP_NOPA 0x0010
21#define LP_ERR 0x0020
22#define LP_ABORT 0x0040
23#define LP_CAREFUL 0x0080 /* obsoleted -arca */
24#define LP_ABORTOPEN 0x0100
25
26#define LP_TRUST_IRQ_ 0x0200 /* obsolete */
27#define LP_NO_REVERSE 0x0400 /* No reverse mode available. */
28#define LP_DATA_AVAIL 0x0800 /* Data is available. */
29
30/*
31 * bit defines for 8255 status port
32 * base + 1
33 * accessed with LP_S(minor), which gets the byte...
34 */
35#define LP_PBUSY 0x80 /* inverted input, active high */
36#define LP_PACK 0x40 /* unchanged input, active low */
37#define LP_POUTPA 0x20 /* unchanged input, active high */
38#define LP_PSELECD 0x10 /* unchanged input, active high */
39#define LP_PERRORP 0x08 /* unchanged input, active low */
40
41/* timeout for each character. This is relative to bus cycles -- it
42 * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you
43 * have extremely slow printing, or if the machine seems to slow down
44 * a lot when you print. If you have slow printing, increase this
45 * number and recompile, and if your system gets bogged down, decrease
46 * this number. This can be changed with the tunelp(8) command as well.
47 */
48
49#define LP_INIT_CHAR 1000
50
51/* The parallel port specs apparently say that there needs to be
52 * a .5usec wait before and after the strobe.
53 */
54
55#define LP_INIT_WAIT 1
56
57/* This is the amount of time that the driver waits for the printer to
58 * catch up when the printer's buffer appears to be filled. If you
59 * want to tune this and have a fast printer (i.e. HPIIIP), decrease
60 * this number, and if you have a slow printer, increase this number.
61 * This is in hundredths of a second, the default 2 being .05 second.
62 * Or use the tunelp(8) command, which is especially nice if you want
63 * change back and forth between character and graphics printing, which
64 * are wildly different...
65 */
66
67#define LP_INIT_TIME 2
68
69/* IOCTL numbers */
70#define LPCHAR 0x0601 /* corresponds to LP_INIT_CHAR */
71#define LPTIME 0x0602 /* corresponds to LP_INIT_TIME */
72#define LPABORT 0x0604 /* call with TRUE arg to abort on error,
73 FALSE to retry. Default is retry. */
74#define LPSETIRQ 0x0605 /* call with new IRQ number,
75 or 0 for polling (no IRQ) */
76#define LPGETIRQ 0x0606 /* get the current IRQ number */
77#define LPWAIT 0x0608 /* corresponds to LP_INIT_WAIT */
78/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
79#define LPCAREFUL 0x0609 /* call with TRUE arg to require out-of-paper, off-
80 line, and error indicators good on all writes,
81 FALSE to ignore them. Default is ignore. */
82#define LPABORTOPEN 0x060a /* call with TRUE arg to abort open() on error,
83 FALSE to ignore error. Default is ignore. */
84#define LPGETSTATUS 0x060b /* return LP_S(minor) */
85#define LPRESET 0x060c /* reset printer */
86#ifdef LP_STATS
87#define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */
88#endif
89#define LPGETFLAGS 0x060e /* get status flags */
90#define LPSETTIMEOUT 0x060f /* set parport timeout */
91
92/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
93 This is also used for re-checking error conditions if LP_ABORT is
94 not set. This is the default behavior. */
95
96#define LP_TIMEOUT_INTERRUPT (60 * HZ)
97#define LP_TIMEOUT_POLLED (10 * HZ)
98
99#ifdef __KERNEL__
100 10
101#include <linux/wait.h> 11#include <linux/wait.h>
102#include <linux/mutex.h> 12#include <linux/mutex.h>
13#include <uapi/linux/lp.h>
103 14
104/* Magic numbers for defining port-device mappings */ 15/* Magic numbers for defining port-device mappings */
105#define LP_PARPORT_UNSPEC -4 16#define LP_PARPORT_UNSPEC -4
@@ -187,5 +98,3 @@ struct lp_struct {
187#define LP_DELAY 50 98#define LP_DELAY 50
188 99
189#endif 100#endif
190
191#endif
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 6c406845f7e..3d15c838116 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -6,295 +6,11 @@
6 * under the terms of the GNU General Public License version 2 as published 6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference. 7 * by the Free Software Foundation, incorporated herein by reference.
8 */ 8 */
9
10#ifndef __LINUX_MDIO_H__ 9#ifndef __LINUX_MDIO_H__
11#define __LINUX_MDIO_H__ 10#define __LINUX_MDIO_H__
12 11
13#include <linux/types.h> 12#include <uapi/linux/mdio.h>
14#include <linux/mii.h>
15
16/* MDIO Manageable Devices (MMDs). */
17#define MDIO_MMD_PMAPMD 1 /* Physical Medium Attachment/
18 * Physical Medium Dependent */
19#define MDIO_MMD_WIS 2 /* WAN Interface Sublayer */
20#define MDIO_MMD_PCS 3 /* Physical Coding Sublayer */
21#define MDIO_MMD_PHYXS 4 /* PHY Extender Sublayer */
22#define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */
23#define MDIO_MMD_TC 6 /* Transmission Convergence */
24#define MDIO_MMD_AN 7 /* Auto-Negotiation */
25#define MDIO_MMD_C22EXT 29 /* Clause 22 extension */
26#define MDIO_MMD_VEND1 30 /* Vendor specific 1 */
27#define MDIO_MMD_VEND2 31 /* Vendor specific 2 */
28
29/* Generic MDIO registers. */
30#define MDIO_CTRL1 MII_BMCR
31#define MDIO_STAT1 MII_BMSR
32#define MDIO_DEVID1 MII_PHYSID1
33#define MDIO_DEVID2 MII_PHYSID2
34#define MDIO_SPEED 4 /* Speed ability */
35#define MDIO_DEVS1 5 /* Devices in package */
36#define MDIO_DEVS2 6
37#define MDIO_CTRL2 7 /* 10G control 2 */
38#define MDIO_STAT2 8 /* 10G status 2 */
39#define MDIO_PMA_TXDIS 9 /* 10G PMA/PMD transmit disable */
40#define MDIO_PMA_RXDET 10 /* 10G PMA/PMD receive signal detect */
41#define MDIO_PMA_EXTABLE 11 /* 10G PMA/PMD extended ability */
42#define MDIO_PKGID1 14 /* Package identifier */
43#define MDIO_PKGID2 15
44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
46#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */
47#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */
48#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
49#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
50#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */
51
52/* Media-dependent registers. */
53#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
54#define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */
55#define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A.
56 * Lanes B-D are numbered 134-136. */
57#define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */
58#define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */
59#define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */
60#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
61#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
62#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
63
64/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
65#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
66#define MDIO_PMA_LASI_TXCTRL 0x9001 /* TX_ALARM control */
67#define MDIO_PMA_LASI_CTRL 0x9002 /* LASI control */
68#define MDIO_PMA_LASI_RXSTAT 0x9003 /* RX_ALARM status */
69#define MDIO_PMA_LASI_TXSTAT 0x9004 /* TX_ALARM status */
70#define MDIO_PMA_LASI_STAT 0x9005 /* LASI status */
71
72/* Control register 1. */
73/* Enable extended speed selection */
74#define MDIO_CTRL1_SPEEDSELEXT (BMCR_SPEED1000 | BMCR_SPEED100)
75/* All speed selection bits */
76#define MDIO_CTRL1_SPEEDSEL (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
77#define MDIO_CTRL1_FULLDPLX BMCR_FULLDPLX
78#define MDIO_CTRL1_LPOWER BMCR_PDOWN
79#define MDIO_CTRL1_RESET BMCR_RESET
80#define MDIO_PMA_CTRL1_LOOPBACK 0x0001
81#define MDIO_PMA_CTRL1_SPEED1000 BMCR_SPEED1000
82#define MDIO_PMA_CTRL1_SPEED100 BMCR_SPEED100
83#define MDIO_PCS_CTRL1_LOOPBACK BMCR_LOOPBACK
84#define MDIO_PHYXS_CTRL1_LOOPBACK BMCR_LOOPBACK
85#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
86#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
87#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */
88#define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */
89
90/* 10 Gb/s */
91#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
92/* 10PASS-TS/2BASE-TL */
93#define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)
94
95/* Status register 1. */
96#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */
97#define MDIO_STAT1_LSTATUS BMSR_LSTATUS
98#define MDIO_STAT1_FAULT 0x0080 /* Fault */
99#define MDIO_AN_STAT1_LPABLE 0x0001 /* Link partner AN ability */
100#define MDIO_AN_STAT1_ABLE BMSR_ANEGCAPABLE
101#define MDIO_AN_STAT1_RFAULT BMSR_RFAULT
102#define MDIO_AN_STAT1_COMPLETE BMSR_ANEGCOMPLETE
103#define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */
104#define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */
105
106/* Speed register. */
107#define MDIO_SPEED_10G 0x0001 /* 10G capable */
108#define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */
109#define MDIO_PMA_SPEED_10P 0x0004 /* 10PASS-TS capable */
110#define MDIO_PMA_SPEED_1000 0x0010 /* 1000M capable */
111#define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */
112#define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */
113#define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */
114
115/* Device present registers. */
116#define MDIO_DEVS_PRESENT(devad) (1 << (devad))
117#define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
118#define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
119#define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
120#define MDIO_DEVS_PHYXS MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
121#define MDIO_DEVS_DTEXS MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
122#define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC)
123#define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN)
124#define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
125
126/* Control register 2. */
127#define MDIO_PMA_CTRL2_TYPE 0x000f /* PMA/PMD type selection */
128#define MDIO_PMA_CTRL2_10GBCX4 0x0000 /* 10GBASE-CX4 type */
129#define MDIO_PMA_CTRL2_10GBEW 0x0001 /* 10GBASE-EW type */
130#define MDIO_PMA_CTRL2_10GBLW 0x0002 /* 10GBASE-LW type */
131#define MDIO_PMA_CTRL2_10GBSW 0x0003 /* 10GBASE-SW type */
132#define MDIO_PMA_CTRL2_10GBLX4 0x0004 /* 10GBASE-LX4 type */
133#define MDIO_PMA_CTRL2_10GBER 0x0005 /* 10GBASE-ER type */
134#define MDIO_PMA_CTRL2_10GBLR 0x0006 /* 10GBASE-LR type */
135#define MDIO_PMA_CTRL2_10GBSR 0x0007 /* 10GBASE-SR type */
136#define MDIO_PMA_CTRL2_10GBLRM 0x0008 /* 10GBASE-LRM type */
137#define MDIO_PMA_CTRL2_10GBT 0x0009 /* 10GBASE-T type */
138#define MDIO_PMA_CTRL2_10GBKX4 0x000a /* 10GBASE-KX4 type */
139#define MDIO_PMA_CTRL2_10GBKR 0x000b /* 10GBASE-KR type */
140#define MDIO_PMA_CTRL2_1000BT 0x000c /* 1000BASE-T type */
141#define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */
142#define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */
143#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */
144#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */
145#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */
146#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */
147#define MDIO_PCS_CTRL2_10GBW 0x0002 /* 10GBASE-W type */
148#define MDIO_PCS_CTRL2_10GBT 0x0003 /* 10GBASE-T type */
149
150/* Status register 2. */
151#define MDIO_STAT2_RXFAULT 0x0400 /* Receive fault */
152#define MDIO_STAT2_TXFAULT 0x0800 /* Transmit fault */
153#define MDIO_STAT2_DEVPRST 0xc000 /* Device present */
154#define MDIO_STAT2_DEVPRST_VAL 0x8000 /* Device present value */
155#define MDIO_PMA_STAT2_LBABLE 0x0001 /* PMA loopback ability */
156#define MDIO_PMA_STAT2_10GBEW 0x0002 /* 10GBASE-EW ability */
157#define MDIO_PMA_STAT2_10GBLW 0x0004 /* 10GBASE-LW ability */
158#define MDIO_PMA_STAT2_10GBSW 0x0008 /* 10GBASE-SW ability */
159#define MDIO_PMA_STAT2_10GBLX4 0x0010 /* 10GBASE-LX4 ability */
160#define MDIO_PMA_STAT2_10GBER 0x0020 /* 10GBASE-ER ability */
161#define MDIO_PMA_STAT2_10GBLR 0x0040 /* 10GBASE-LR ability */
162#define MDIO_PMA_STAT2_10GBSR 0x0080 /* 10GBASE-SR ability */
163#define MDIO_PMD_STAT2_TXDISAB 0x0100 /* PMD TX disable ability */
164#define MDIO_PMA_STAT2_EXTABLE 0x0200 /* Extended abilities */
165#define MDIO_PMA_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */
166#define MDIO_PMA_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */
167#define MDIO_PCS_STAT2_10GBR 0x0001 /* 10GBASE-R capable */
168#define MDIO_PCS_STAT2_10GBX 0x0002 /* 10GBASE-X capable */
169#define MDIO_PCS_STAT2_10GBW 0x0004 /* 10GBASE-W capable */
170#define MDIO_PCS_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */
171#define MDIO_PCS_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */
172
173/* Transmit disable register. */
174#define MDIO_PMD_TXDIS_GLOBAL 0x0001 /* Global PMD TX disable */
175#define MDIO_PMD_TXDIS_0 0x0002 /* PMD TX disable 0 */
176#define MDIO_PMD_TXDIS_1 0x0004 /* PMD TX disable 1 */
177#define MDIO_PMD_TXDIS_2 0x0008 /* PMD TX disable 2 */
178#define MDIO_PMD_TXDIS_3 0x0010 /* PMD TX disable 3 */
179
180/* Receive signal detect register. */
181#define MDIO_PMD_RXDET_GLOBAL 0x0001 /* Global PMD RX signal detect */
182#define MDIO_PMD_RXDET_0 0x0002 /* PMD RX signal detect 0 */
183#define MDIO_PMD_RXDET_1 0x0004 /* PMD RX signal detect 1 */
184#define MDIO_PMD_RXDET_2 0x0008 /* PMD RX signal detect 2 */
185#define MDIO_PMD_RXDET_3 0x0010 /* PMD RX signal detect 3 */
186
187/* Extended abilities register. */
188#define MDIO_PMA_EXTABLE_10GCX4 0x0001 /* 10GBASE-CX4 ability */
189#define MDIO_PMA_EXTABLE_10GBLRM 0x0002 /* 10GBASE-LRM ability */
190#define MDIO_PMA_EXTABLE_10GBT 0x0004 /* 10GBASE-T ability */
191#define MDIO_PMA_EXTABLE_10GBKX4 0x0008 /* 10GBASE-KX4 ability */
192#define MDIO_PMA_EXTABLE_10GBKR 0x0010 /* 10GBASE-KR ability */
193#define MDIO_PMA_EXTABLE_1000BT 0x0020 /* 1000BASE-T ability */
194#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */
195#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */
196#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */
197
198/* PHY XGXS lane state register. */
199#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
200#define MDIO_PHYXS_LNSTAT_SYNC1 0x0002
201#define MDIO_PHYXS_LNSTAT_SYNC2 0x0004
202#define MDIO_PHYXS_LNSTAT_SYNC3 0x0008
203#define MDIO_PHYXS_LNSTAT_ALIGN 0x1000
204
205/* PMA 10GBASE-T pair swap & polarity */
206#define MDIO_PMA_10GBT_SWAPPOL_ABNX 0x0001 /* Pair A/B uncrossed */
207#define MDIO_PMA_10GBT_SWAPPOL_CDNX 0x0002 /* Pair C/D uncrossed */
208#define MDIO_PMA_10GBT_SWAPPOL_AREV 0x0100 /* Pair A polarity reversed */
209#define MDIO_PMA_10GBT_SWAPPOL_BREV 0x0200 /* Pair B polarity reversed */
210#define MDIO_PMA_10GBT_SWAPPOL_CREV 0x0400 /* Pair C polarity reversed */
211#define MDIO_PMA_10GBT_SWAPPOL_DREV 0x0800 /* Pair D polarity reversed */
212
213/* PMA 10GBASE-T TX power register. */
214#define MDIO_PMA_10GBT_TXPWR_SHORT 0x0001 /* Short-reach mode */
215
216/* PMA 10GBASE-T SNR registers. */
217/* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */
218#define MDIO_PMA_10GBT_SNR_BIAS 0x8000
219#define MDIO_PMA_10GBT_SNR_MAX 127
220
221/* PMA 10GBASE-R FEC ability register. */
222#define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */
223#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */
224
225/* PCS 10GBASE-R/-T status register 1. */
226#define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001 /* Block lock attained */
227
228/* PCS 10GBASE-R/-T status register 2. */
229#define MDIO_PCS_10GBRT_STAT2_ERR 0x00ff
230#define MDIO_PCS_10GBRT_STAT2_BER 0x3f00
231
232/* AN 10GBASE-T control register. */
233#define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */
234
235/* AN 10GBASE-T status register. */
236#define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */
237#define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */
238#define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */
239#define MDIO_AN_10GBT_STAT_REMOK 0x1000 /* Remote OK */
240#define MDIO_AN_10GBT_STAT_LOCOK 0x2000 /* Local OK */
241#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
242#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
243
244/* EEE Supported/Advertisement/LP Advertisement registers.
245 *
246 * EEE capability Register (3.20), Advertisement (7.60) and
247 * Link partner ability (7.61) registers have and can use the same identical
248 * bit masks.
249 */
250#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
251#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
252/* Note: the two defines above can be potentially used by the user-land
253 * and cannot remove them now.
254 * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
255 * using the previous ones (that can be considered obsolete).
256 */
257#define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX /* 100TX EEE cap */
258#define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T /* 1000T EEE cap */
259#define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */
260#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
261#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
262#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
263
264/* LASI RX_ALARM control/status registers. */
265#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
266#define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */
267#define MDIO_PMA_LASI_RX_PMALFLT 0x0010 /* PMA/PMD RX local fault */
268#define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020 /* RX optical power fault */
269#define MDIO_PMA_LASI_RX_WISLFLT 0x0200 /* WIS local fault */
270
271/* LASI TX_ALARM control/status registers. */
272#define MDIO_PMA_LASI_TX_PHYXSLFLT 0x0001 /* PHY XS TX local fault */
273#define MDIO_PMA_LASI_TX_PCSLFLT 0x0008 /* PCS TX local fault */
274#define MDIO_PMA_LASI_TX_PMALFLT 0x0010 /* PMA/PMD TX local fault */
275#define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080 /* Laser output power fault */
276#define MDIO_PMA_LASI_TX_LASERTEMPFLT 0x0100 /* Laser temperature fault */
277#define MDIO_PMA_LASI_TX_LASERBICURRFLT 0x0200 /* Laser bias current fault */
278
279/* LASI control/status registers. */
280#define MDIO_PMA_LASI_LSALARM 0x0001 /* LS_ALARM enable/status */
281#define MDIO_PMA_LASI_TXALARM 0x0002 /* TX_ALARM enable/status */
282#define MDIO_PMA_LASI_RXALARM 0x0004 /* RX_ALARM enable/status */
283
284/* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */
285
286#define MDIO_PHY_ID_C45 0x8000
287#define MDIO_PHY_ID_PRTAD 0x03e0
288#define MDIO_PHY_ID_DEVAD 0x001f
289#define MDIO_PHY_ID_C45_MASK \
290 (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
291
292static inline __u16 mdio_phy_id_c45(int prtad, int devad)
293{
294 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
295}
296 13
297#ifdef __KERNEL__
298 14
299static inline bool mdio_phy_id_is_c45(int phy_id) 15static inline bool mdio_phy_id_is_c45(int phy_id)
300{ 16{
@@ -460,5 +176,4 @@ static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv)
460 return reg; 176 return reg;
461} 177}
462 178
463#endif /* __KERNEL__ */
464#endif /* __LINUX_MDIO_H__ */ 179#endif /* __LINUX_MDIO_H__ */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index cec56932560..e5ccb9ddd90 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -1,66 +1,10 @@
1#ifndef _LINUX_MEMPOLICY_H
2#define _LINUX_MEMPOLICY_H 1
3
4#include <linux/errno.h>
5
6/* 1/*
7 * NUMA memory policies for Linux. 2 * NUMA memory policies for Linux.
8 * Copyright 2003,2004 Andi Kleen SuSE Labs 3 * Copyright 2003,2004 Andi Kleen SuSE Labs
9 */ 4 */
5#ifndef _LINUX_MEMPOLICY_H
6#define _LINUX_MEMPOLICY_H 1
10 7
11/*
12 * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
13 * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
14 * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
15 */
16
17/* Policies */
18enum {
19 MPOL_DEFAULT,
20 MPOL_PREFERRED,
21 MPOL_BIND,
22 MPOL_INTERLEAVE,
23 MPOL_MAX, /* always last member of enum */
24};
25
26enum mpol_rebind_step {
27 MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */
28 MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */
29 MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/
30 MPOL_REBIND_NSTEP,
31};
32
33/* Flags for set_mempolicy */
34#define MPOL_F_STATIC_NODES (1 << 15)
35#define MPOL_F_RELATIVE_NODES (1 << 14)
36
37/*
38 * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
39 * either set_mempolicy() or mbind().
40 */
41#define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
42
43/* Flags for get_mempolicy */
44#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
45#define MPOL_F_ADDR (1<<1) /* look up vma using address */
46#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
47
48/* Flags for mbind */
49#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
50#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
51#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
52#define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */
53
54/*
55 * Internal flags that share the struct mempolicy flags word with
56 * "mode flags". These flags are allocated from bit 0 up, as they
57 * are never OR'ed into the mode in mempolicy API arguments.
58 */
59#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
60#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
61#define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */
62
63#ifdef __KERNEL__
64 8
65#include <linux/mmzone.h> 9#include <linux/mmzone.h>
66#include <linux/slab.h> 10#include <linux/slab.h>
@@ -68,6 +12,7 @@ enum mpol_rebind_step {
68#include <linux/spinlock.h> 12#include <linux/spinlock.h>
69#include <linux/nodemask.h> 13#include <linux/nodemask.h>
70#include <linux/pagemap.h> 14#include <linux/pagemap.h>
15#include <uapi/linux/mempolicy.h>
71 16
72struct mm_struct; 17struct mm_struct;
73 18
@@ -379,6 +324,4 @@ static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
379} 324}
380 325
381#endif /* CONFIG_NUMA */ 326#endif /* CONFIG_NUMA */
382#endif /* __KERNEL__ */
383
384#endif 327#endif
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 8ef3a7a1159..47492c9631b 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -4,163 +4,12 @@
4 * 4 *
5 * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com) 5 * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
6 */ 6 */
7
8#ifndef __LINUX_MII_H__ 7#ifndef __LINUX_MII_H__
9#define __LINUX_MII_H__ 8#define __LINUX_MII_H__
10 9
11#include <linux/types.h>
12#include <linux/ethtool.h>
13
14/* Generic MII registers. */
15#define MII_BMCR 0x00 /* Basic mode control register */
16#define MII_BMSR 0x01 /* Basic mode status register */
17#define MII_PHYSID1 0x02 /* PHYS ID 1 */
18#define MII_PHYSID2 0x03 /* PHYS ID 2 */
19#define MII_ADVERTISE 0x04 /* Advertisement control reg */
20#define MII_LPA 0x05 /* Link partner ability reg */
21#define MII_EXPANSION 0x06 /* Expansion register */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */
24#define MII_MMD_CTRL 0x0d /* MMD Access Control Register */
25#define MII_MMD_DATA 0x0e /* MMD Access Data Register */
26#define MII_ESTATUS 0x0f /* Extended Status */
27#define MII_DCOUNTER 0x12 /* Disconnect counter */
28#define MII_FCSCOUNTER 0x13 /* False carrier counter */
29#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
30#define MII_RERRCOUNTER 0x15 /* Receive error counter */
31#define MII_SREVISION 0x16 /* Silicon revision */
32#define MII_RESV1 0x17 /* Reserved... */
33#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
34#define MII_PHYADDR 0x19 /* PHY address */
35#define MII_RESV2 0x1a /* Reserved... */
36#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
37#define MII_NCONFIG 0x1c /* Network interface config */
38
39/* Basic mode control register. */
40#define BMCR_RESV 0x003f /* Unused... */
41#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
42#define BMCR_CTST 0x0080 /* Collision test */
43#define BMCR_FULLDPLX 0x0100 /* Full duplex */
44#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
45#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */
46#define BMCR_PDOWN 0x0800 /* Enable low power state */
47#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
48#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
49#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
50#define BMCR_RESET 0x8000 /* Reset to default state */
51
52/* Basic mode status register. */
53#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
54#define BMSR_JCD 0x0002 /* Jabber detected */
55#define BMSR_LSTATUS 0x0004 /* Link status */
56#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
57#define BMSR_RFAULT 0x0010 /* Remote fault detected */
58#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
59#define BMSR_RESV 0x00c0 /* Unused... */
60#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
61#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
62#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
63#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
64#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
65#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
66#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
67#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
68
69/* Advertisement control register. */
70#define ADVERTISE_SLCT 0x001f /* Selector bits */
71#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
72#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
73#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
74#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
75#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
76#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
77#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
78#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
79#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
80#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
81#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
82#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
83#define ADVERTISE_RESV 0x1000 /* Unused... */
84#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
85#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
86#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
87
88#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
89 ADVERTISE_CSMA)
90#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
91 ADVERTISE_100HALF | ADVERTISE_100FULL)
92
93/* Link partner ability register. */
94#define LPA_SLCT 0x001f /* Same as advertise selector */
95#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
96#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
97#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
98#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
99#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
100#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
101#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
102#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
103#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
104#define LPA_PAUSE_CAP 0x0400 /* Can pause */
105#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
106#define LPA_RESV 0x1000 /* Unused... */
107#define LPA_RFAULT 0x2000 /* Link partner faulted */
108#define LPA_LPACK 0x4000 /* Link partner acked us */
109#define LPA_NPAGE 0x8000 /* Next page bit */
110
111#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
112#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
113
114/* Expansion register for auto-negotiation. */
115#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
116#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
117#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
118#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
119#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
120#define EXPANSION_RESV 0xffe0 /* Unused... */
121
122#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
123#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
124
125/* N-way test register. */
126#define NWAYTEST_RESV1 0x00ff /* Unused... */
127#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
128#define NWAYTEST_RESV2 0xfe00 /* Unused... */
129
130/* 1000BASE-T Control register */
131#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
132#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
133#define CTL1000_AS_MASTER 0x0800
134#define CTL1000_ENABLE_MASTER 0x1000
135
136/* 1000BASE-T Status register */
137#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
138#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
139#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
140#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
141
142/* Flow control flags */
143#define FLOW_CTRL_TX 0x01
144#define FLOW_CTRL_RX 0x02
145
146/* MMD Access Control register fields */
147#define MII_MMD_CTRL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/
148#define MII_MMD_CTRL_ADDR 0x0000 /* Address */
149#define MII_MMD_CTRL_NOINCR 0x4000 /* no post increment */
150#define MII_MMD_CTRL_INCR_RDWT 0x8000 /* post increment on reads & writes */
151#define MII_MMD_CTRL_INCR_ON_WT 0xC000 /* post increment on writes only */
152
153/* This structure is used in all SIOCxMIIxxx ioctl calls */
154struct mii_ioctl_data {
155 __u16 phy_id;
156 __u16 reg_num;
157 __u16 val_in;
158 __u16 val_out;
159};
160
161#ifdef __KERNEL__
162 10
163#include <linux/if.h> 11#include <linux/if.h>
12#include <uapi/linux/mii.h>
164 13
165struct ethtool_cmd; 14struct ethtool_cmd;
166 15
@@ -487,5 +336,4 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
487 return cap; 336 return cap;
488} 337}
489 338
490#endif /* __KERNEL__ */
491#endif /* __LINUX_MII_H__ */ 339#endif /* __LINUX_MII_H__ */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 77cec2f45cb..d09dde1e57f 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -1,20 +1,11 @@
1#ifndef _LINUX_MMAN_H 1#ifndef _LINUX_MMAN_H
2#define _LINUX_MMAN_H 2#define _LINUX_MMAN_H
3 3
4#include <asm/mman.h>
5
6#define MREMAP_MAYMOVE 1
7#define MREMAP_FIXED 2
8
9#define OVERCOMMIT_GUESS 0
10#define OVERCOMMIT_ALWAYS 1
11#define OVERCOMMIT_NEVER 2
12
13#ifdef __KERNEL__
14#include <linux/mm.h> 4#include <linux/mm.h>
15#include <linux/percpu_counter.h> 5#include <linux/percpu_counter.h>
16 6
17#include <linux/atomic.h> 7#include <linux/atomic.h>
8#include <uapi/linux/mman.h>
18 9
19extern int sysctl_overcommit_memory; 10extern int sysctl_overcommit_memory;
20extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
@@ -88,5 +79,4 @@ calc_vm_flag_bits(unsigned long flags)
88 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | 79 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) |
89 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); 80 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
90} 81}
91#endif /* __KERNEL__ */
92#endif /* _LINUX_MMAN_H */ 82#endif /* _LINUX_MMAN_H */
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 46caaf44339..ea00d9162ee 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -1,138 +1,10 @@
1#ifndef __LINUX_MROUTE_H 1#ifndef __LINUX_MROUTE_H
2#define __LINUX_MROUTE_H 2#define __LINUX_MROUTE_H
3 3
4#include <linux/sockios.h>
5#include <linux/types.h>
6#ifdef __KERNEL__
7#include <linux/in.h> 4#include <linux/in.h>
8#endif
9
10/*
11 * Based on the MROUTING 3.5 defines primarily to keep
12 * source compatibility with BSD.
13 *
14 * See the mrouted code for the original history.
15 *
16 * Protocol Independent Multicast (PIM) data structures included
17 * Carlos Picoto (cap@di.fc.ul.pt)
18 *
19 */
20
21#define MRT_BASE 200
22#define MRT_INIT (MRT_BASE) /* Activate the kernel mroute code */
23#define MRT_DONE (MRT_BASE+1) /* Shutdown the kernel mroute */
24#define MRT_ADD_VIF (MRT_BASE+2) /* Add a virtual interface */
25#define MRT_DEL_VIF (MRT_BASE+3) /* Delete a virtual interface */
26#define MRT_ADD_MFC (MRT_BASE+4) /* Add a multicast forwarding entry */
27#define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */
28#define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */
29#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */
30#define MRT_PIM (MRT_BASE+8) /* enable PIM code */
31#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */
32
33#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
34#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
35#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
36
37#define MAXVIFS 32
38typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
39typedef unsigned short vifi_t;
40#define ALL_VIFS ((vifi_t)(-1))
41
42/*
43 * Same idea as select
44 */
45
46#define VIFM_SET(n,m) ((m)|=(1<<(n)))
47#define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
48#define VIFM_ISSET(n,m) ((m)&(1<<(n)))
49#define VIFM_CLRALL(m) ((m)=0)
50#define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
51#define VIFM_SAME(m1,m2) ((m1)==(m2))
52
53/*
54 * Passed by mrouted for an MRT_ADD_VIF - again we use the
55 * mrouted 3.6 structures for compatibility
56 */
57
58struct vifctl {
59 vifi_t vifc_vifi; /* Index of VIF */
60 unsigned char vifc_flags; /* VIFF_ flags */
61 unsigned char vifc_threshold; /* ttl limit */
62 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
63 union {
64 struct in_addr vifc_lcl_addr; /* Local interface address */
65 int vifc_lcl_ifindex; /* Local interface index */
66 };
67 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
68};
69
70#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
71#define VIFF_SRCRT 0x2 /* NI */
72#define VIFF_REGISTER 0x4 /* register vif */
73#define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of
74 vifc_lcl_addr to find an interface */
75
76/*
77 * Cache manipulation structures for mrouted and PIMd
78 */
79
80struct mfcctl {
81 struct in_addr mfcc_origin; /* Origin of mcast */
82 struct in_addr mfcc_mcastgrp; /* Group in question */
83 vifi_t mfcc_parent; /* Where it arrived */
84 unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */
85 unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */
86 unsigned int mfcc_byte_cnt;
87 unsigned int mfcc_wrong_if;
88 int mfcc_expire;
89};
90
91/*
92 * Group count retrieval for mrouted
93 */
94
95struct sioc_sg_req {
96 struct in_addr src;
97 struct in_addr grp;
98 unsigned long pktcnt;
99 unsigned long bytecnt;
100 unsigned long wrong_if;
101};
102
103/*
104 * To get vif packet counts
105 */
106
107struct sioc_vif_req {
108 vifi_t vifi; /* Which iface */
109 unsigned long icount; /* In packets */
110 unsigned long ocount; /* Out packets */
111 unsigned long ibytes; /* In bytes */
112 unsigned long obytes; /* Out bytes */
113};
114
115/*
116 * This is the format the mroute daemon expects to see IGMP control
117 * data. Magically happens to be like an IP packet as per the original
118 */
119
120struct igmpmsg {
121 __u32 unused1,unused2;
122 unsigned char im_msgtype; /* What is this */
123 unsigned char im_mbz; /* Must be zero */
124 unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */
125 unsigned char unused3;
126 struct in_addr im_src,im_dst;
127};
128
129/*
130 * That's all usermode folks
131 */
132
133#ifdef __KERNEL__
134#include <linux/pim.h> 5#include <linux/pim.h>
135#include <net/sock.h> 6#include <net/sock.h>
7#include <uapi/linux/mroute.h>
136 8
137#ifdef CONFIG_IP_MROUTE 9#ifdef CONFIG_IP_MROUTE
138static inline int ip_mroute_opt(int opt) 10static inline int ip_mroute_opt(int opt)
@@ -228,24 +100,8 @@ struct mfc_cache {
228#define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1)) 100#define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
229#endif 101#endif
230 102
231#endif
232
233
234#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
235
236/*
237 * Pseudo messages used by mrouted
238 */
239
240#define IGMPMSG_NOCACHE 1 /* Kern cache fill request to mrouted */
241#define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */
242#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */
243
244#ifdef __KERNEL__
245struct rtmsg; 103struct rtmsg;
246extern int ipmr_get_route(struct net *net, struct sk_buff *skb, 104extern int ipmr_get_route(struct net *net, struct sk_buff *skb,
247 __be32 saddr, __be32 daddr, 105 __be32 saddr, __be32 daddr,
248 struct rtmsg *rtm, int nowait); 106 struct rtmsg *rtm, int nowait);
249#endif 107#endif
250
251#endif
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 6d8c7251eb8..a223561ba12 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -1,123 +1,11 @@
1#ifndef __LINUX_MROUTE6_H 1#ifndef __LINUX_MROUTE6_H
2#define __LINUX_MROUTE6_H 2#define __LINUX_MROUTE6_H
3 3
4#include <linux/types.h>
5#include <linux/sockios.h>
6
7/*
8 * Based on the MROUTING 3.5 defines primarily to keep
9 * source compatibility with BSD.
10 *
11 * See the pim6sd code for the original history.
12 *
13 * Protocol Independent Multicast (PIM) data structures included
14 * Carlos Picoto (cap@di.fc.ul.pt)
15 *
16 */
17
18#define MRT6_BASE 200
19#define MRT6_INIT (MRT6_BASE) /* Activate the kernel mroute code */
20#define MRT6_DONE (MRT6_BASE+1) /* Shutdown the kernel mroute */
21#define MRT6_ADD_MIF (MRT6_BASE+2) /* Add a virtual interface */
22#define MRT6_DEL_MIF (MRT6_BASE+3) /* Delete a virtual interface */
23#define MRT6_ADD_MFC (MRT6_BASE+4) /* Add a multicast forwarding entry */
24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
29
30#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
31#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
32#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
33
34#define MAXMIFS 32
35typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
36typedef unsigned short mifi_t;
37#define ALL_MIFS ((mifi_t)(-1))
38
39#ifndef IF_SETSIZE
40#define IF_SETSIZE 256
41#endif
42
43typedef __u32 if_mask;
44#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
45
46#if !defined(__KERNEL__)
47#if !defined(DIV_ROUND_UP)
48#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
49#endif
50#endif
51
52typedef struct if_set {
53 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
54} if_set;
55
56#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
57#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
58#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
59#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
60#define IF_ZERO(p) bzero(p, sizeof(*(p)))
61
62/*
63 * Passed by mrouted for an MRT_ADD_MIF - again we use the
64 * mrouted 3.6 structures for compatibility
65 */
66
67struct mif6ctl {
68 mifi_t mif6c_mifi; /* Index of MIF */
69 unsigned char mif6c_flags; /* MIFF_ flags */
70 unsigned char vifc_threshold; /* ttl limit */
71 __u16 mif6c_pifi; /* the index of the physical IF */
72 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
73};
74
75#define MIFF_REGISTER 0x1 /* register vif */
76
77/*
78 * Cache manipulation structures for mrouted and PIMd
79 */
80
81struct mf6cctl {
82 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
83 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
84 mifi_t mf6cc_parent; /* Where it arrived */
85 struct if_set mf6cc_ifset; /* Where it is going */
86};
87
88/*
89 * Group count retrieval for pim6sd
90 */
91
92struct sioc_sg_req6 {
93 struct sockaddr_in6 src;
94 struct sockaddr_in6 grp;
95 unsigned long pktcnt;
96 unsigned long bytecnt;
97 unsigned long wrong_if;
98};
99
100/*
101 * To get vif packet counts
102 */
103
104struct sioc_mif_req6 {
105 mifi_t mifi; /* Which iface */
106 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */
108 unsigned long ibytes; /* In bytes */
109 unsigned long obytes; /* Out bytes */
110};
111
112/*
113 * That's all usermode folks
114 */
115
116#ifdef __KERNEL__
117 4
118#include <linux/pim.h> 5#include <linux/pim.h>
119#include <linux/skbuff.h> /* for struct sk_buff_head */ 6#include <linux/skbuff.h> /* for struct sk_buff_head */
120#include <net/net_namespace.h> 7#include <net/net_namespace.h>
8#include <uapi/linux/mroute6.h>
121 9
122#ifdef CONFIG_IPV6_MROUTE 10#ifdef CONFIG_IPV6_MROUTE
123static inline int ip6_mroute_opt(int opt) 11static inline int ip6_mroute_opt(int opt)
@@ -225,9 +113,6 @@ struct mfc6_cache {
225 113
226#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */ 114#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
227 115
228#endif
229
230#ifdef __KERNEL__
231struct rtmsg; 116struct rtmsg;
232extern int ip6mr_get_route(struct net *net, struct sk_buff *skb, 117extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
233 struct rtmsg *rtm, int nowait); 118 struct rtmsg *rtm, int nowait);
@@ -246,24 +131,3 @@ static inline int ip6mr_sk_done(struct sock *sk)
246} 131}
247#endif 132#endif
248#endif 133#endif
249
250/*
251 * Structure used to communicate from kernel to multicast router.
252 * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
253 * used for IPv4 implementation). This is because this structure will be passed via an
254 * IPv6 raw socket, on which an application will only receiver the payload i.e the data after
255 * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
256 */
257
258struct mrt6msg {
259#define MRT6MSG_NOCACHE 1
260#define MRT6MSG_WRONGMIF 2
261#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
262 __u8 im6_mbz; /* must be zero */
263 __u8 im6_msgtype; /* what type of message */
264 __u16 im6_mif; /* mif rec'd on */
265 __u32 im6_pad; /* padding for 64 bit arch */
266 struct in6_addr im6_src, im6_dst;
267};
268
269#endif
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 11cc2ac67e7..e1b163f912f 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -1,174 +1,11 @@
1#ifndef _LINUX_MSDOS_FS_H 1#ifndef _LINUX_MSDOS_FS_H
2#define _LINUX_MSDOS_FS_H 2#define _LINUX_MSDOS_FS_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/msdos_fs.h>
5#include <linux/magic.h>
6#include <asm/byteorder.h>
7 5
8/*
9 * The MS-DOS filesystem constants/structures
10 */
11
12#define SECTOR_SIZE 512 /* sector size (bytes) */
13#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
14#define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
15#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
16#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
17#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
18#define MSDOS_LONGNAME 256 /* maximum name length */
19#define CF_LE_W(v) le16_to_cpu(v)
20#define CF_LE_L(v) le32_to_cpu(v)
21#define CT_LE_W(v) cpu_to_le16(v)
22#define CT_LE_L(v) cpu_to_le32(v)
23
24#define MSDOS_ROOT_INO 1 /* The root inode number */
25#define MSDOS_FSINFO_INO 2 /* Used for managing the FSINFO block */
26
27#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
28
29/* directory limit */
30#define FAT_MAX_DIR_ENTRIES (65536)
31#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
32
33#define ATTR_NONE 0 /* no attribute bits */
34#define ATTR_RO 1 /* read-only */
35#define ATTR_HIDDEN 2 /* hidden */
36#define ATTR_SYS 4 /* system */
37#define ATTR_VOLUME 8 /* volume label */
38#define ATTR_DIR 16 /* directory */
39#define ATTR_ARCH 32 /* archived */
40
41/* attribute bits that are copied "as is" */
42#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
43/* bits that are used by the Windows 95/Windows NT extended FAT */
44#define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
45
46#define CASE_LOWER_BASE 8 /* base is lower case */
47#define CASE_LOWER_EXT 16 /* extension is lower case */
48
49#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
50#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
51
52#define FAT_LFN_LEN 255 /* maximum long name length */
53#define MSDOS_NAME 11 /* maximum name length */
54#define MSDOS_SLOTS 21 /* max # of slots for short and long names */
55#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
56#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
57
58#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
59 MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
60
61/* start of data cluster's entry (number of reserved clusters) */
62#define FAT_START_ENT 2
63
64/* maximum number of clusters */
65#define MAX_FAT12 0xFF4
66#define MAX_FAT16 0xFFF4
67#define MAX_FAT32 0x0FFFFFF6
68#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
69 MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
70
71/* bad cluster mark */
72#define BAD_FAT12 0xFF7
73#define BAD_FAT16 0xFFF7
74#define BAD_FAT32 0x0FFFFFF7
75
76/* standard EOF */
77#define EOF_FAT12 0xFFF
78#define EOF_FAT16 0xFFFF
79#define EOF_FAT32 0x0FFFFFFF
80
81#define FAT_ENT_FREE (0)
82#define FAT_ENT_BAD (BAD_FAT32)
83#define FAT_ENT_EOF (EOF_FAT32)
84
85#define FAT_FSINFO_SIG1 0x41615252
86#define FAT_FSINFO_SIG2 0x61417272
87#define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
88 && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
89
90struct __fat_dirent {
91 long d_ino;
92 __kernel_off_t d_off;
93 unsigned short d_reclen;
94 char d_name[256]; /* We must not include limits.h! */
95};
96
97/*
98 * ioctl commands
99 */
100#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct __fat_dirent[2])
101#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct __fat_dirent[2])
102/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
103#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
104#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
105
106struct fat_boot_sector {
107 __u8 ignored[3]; /* Boot strap short or near jump */
108 __u8 system_id[8]; /* Name - can be used to special case
109 partition manager volumes */
110 __u8 sector_size[2]; /* bytes per logical sector */
111 __u8 sec_per_clus; /* sectors/cluster */
112 __le16 reserved; /* reserved sectors */
113 __u8 fats; /* number of FATs */
114 __u8 dir_entries[2]; /* root directory entries */
115 __u8 sectors[2]; /* number of sectors */
116 __u8 media; /* media code */
117 __le16 fat_length; /* sectors/FAT */
118 __le16 secs_track; /* sectors per track */
119 __le16 heads; /* number of heads */
120 __le32 hidden; /* hidden sectors (unused) */
121 __le32 total_sect; /* number of sectors (if sectors == 0) */
122
123 /* The following fields are only used by FAT32 */
124 __le32 fat32_length; /* sectors/FAT */
125 __le16 flags; /* bit 8: fat mirroring, low 4: active fat */
126 __u8 version[2]; /* major, minor filesystem version */
127 __le32 root_cluster; /* first cluster in root directory */
128 __le16 info_sector; /* filesystem info sector */
129 __le16 backup_boot; /* backup boot sector */
130 __le16 reserved2[6]; /* Unused */
131};
132
133struct fat_boot_fsinfo {
134 __le32 signature1; /* 0x41615252L */
135 __le32 reserved1[120]; /* Nothing as far as I can tell */
136 __le32 signature2; /* 0x61417272L */
137 __le32 free_clusters; /* Free cluster count. -1 if unknown */
138 __le32 next_cluster; /* Most recently allocated cluster */
139 __le32 reserved2[4];
140};
141
142struct msdos_dir_entry {
143 __u8 name[MSDOS_NAME];/* name and extension */
144 __u8 attr; /* attribute bits */
145 __u8 lcase; /* Case for base and extension */
146 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
147 __le16 ctime; /* Creation time */
148 __le16 cdate; /* Creation date */
149 __le16 adate; /* Last access date */
150 __le16 starthi; /* High 16 bits of cluster in FAT32 */
151 __le16 time,date,start;/* time, date and first cluster */
152 __le32 size; /* file size (in bytes) */
153};
154
155/* Up to 13 characters of the name */
156struct msdos_dir_slot {
157 __u8 id; /* sequence number for slot */
158 __u8 name0_4[10]; /* first 5 characters in name */
159 __u8 attr; /* attribute byte */
160 __u8 reserved; /* always 0 */
161 __u8 alias_checksum; /* checksum for 8.3 alias */
162 __u8 name5_10[12]; /* 6 more characters in name */
163 __le16 start; /* starting cluster number, 0 in long slots */
164 __u8 name11_12[4]; /* last 2 characters in name */
165};
166
167#ifdef __KERNEL__
168/* media of boot sector */ 6/* media of boot sector */
169static inline int fat_valid_media(u8 media) 7static inline int fat_valid_media(u8 media)
170{ 8{
171 return 0xf8 <= media || media == 0xf0; 9 return 0xf8 <= media || media == 0xf0;
172} 10}
173#endif /* !__KERNEL__ */
174#endif /* !_LINUX_MSDOS_FS_H */ 11#endif /* !_LINUX_MSDOS_FS_H */
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 56abf1558fd..7a4b9e97d29 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -1,78 +1,8 @@
1#ifndef _LINUX_MSG_H 1#ifndef _LINUX_MSG_H
2#define _LINUX_MSG_H 2#define _LINUX_MSG_H
3 3
4#include <linux/ipc.h>
5
6/* ipcs ctl commands */
7#define MSG_STAT 11
8#define MSG_INFO 12
9
10/* msgrcv options */
11#define MSG_NOERROR 010000 /* no error if message is too big */
12#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
13
14/* Obsolete, used only for backwards compatibility and libc5 compiles */
15struct msqid_ds {
16 struct ipc_perm msg_perm;
17 struct msg *msg_first; /* first message on queue,unused */
18 struct msg *msg_last; /* last message in queue,unused */
19 __kernel_time_t msg_stime; /* last msgsnd time */
20 __kernel_time_t msg_rtime; /* last msgrcv time */
21 __kernel_time_t msg_ctime; /* last change time */
22 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
23 unsigned long msg_lqbytes; /* ditto */
24 unsigned short msg_cbytes; /* current number of bytes on queue */
25 unsigned short msg_qnum; /* number of messages in queue */
26 unsigned short msg_qbytes; /* max number of bytes on queue */
27 __kernel_ipc_pid_t msg_lspid; /* pid of last msgsnd */
28 __kernel_ipc_pid_t msg_lrpid; /* last receive pid */
29};
30
31/* Include the definition of msqid64_ds */
32#include <asm/msgbuf.h>
33
34/* message buffer for msgsnd and msgrcv calls */
35struct msgbuf {
36 long mtype; /* type of message */
37 char mtext[1]; /* message text */
38};
39
40/* buffer for msgctl calls IPC_INFO, MSG_INFO */
41struct msginfo {
42 int msgpool;
43 int msgmap;
44 int msgmax;
45 int msgmnb;
46 int msgmni;
47 int msgssz;
48 int msgtql;
49 unsigned short msgseg;
50};
51
52/*
53 * Scaling factor to compute msgmni:
54 * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
55 * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
56 * up to 8MB : msgmni = 16 (MSGMNI)
57 * 4 GB : msgmni = 8K
58 * more than 16 GB : msgmni = 32K (IPCMNI)
59 */
60#define MSG_MEM_SCALE 32
61
62#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
63#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
64#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
65
66/* unused */
67#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
68#define MSGTQL MSGMNB /* number of system message headers */
69#define MSGMAP MSGMNB /* number of entries in message map */
70#define MSGSSZ 16 /* message segment size */
71#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
72#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
73
74#ifdef __KERNEL__
75#include <linux/list.h> 4#include <linux/list.h>
5#include <uapi/linux/msg.h>
76 6
77/* one msg_msg structure for each message */ 7/* one msg_msg structure for each message */
78struct msg_msg { 8struct msg_msg {
@@ -107,6 +37,4 @@ extern long do_msgsnd(int msqid, long mtype, void __user *mtext,
107extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext, 37extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
108 size_t msgsz, long msgtyp, int msgflg); 38 size_t msgsz, long msgtyp, int msgflg);
109 39
110#endif /* __KERNEL__ */
111
112#endif /* _LINUX_MSG_H */ 40#endif /* _LINUX_MSG_H */
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index 54b8e0d8d91..5d0b2a1dee6 100644
--- a/include/linux/n_r3964.h
+++ b/include/linux/n_r3964.h
@@ -43,15 +43,12 @@
43 * 43 *
44 * 44 *
45 */ 45 */
46
47#ifndef __LINUX_N_R3964_H__ 46#ifndef __LINUX_N_R3964_H__
48#define __LINUX_N_R3964_H__ 47#define __LINUX_N_R3964_H__
49 48
50/* line disciplines for r3964 protocol */
51
52#ifdef __KERNEL__
53 49
54#include <linux/param.h> 50#include <linux/param.h>
51#include <uapi/linux/n_r3964.h>
55 52
56/* 53/*
57 * Common ascii handshake characters: 54 * Common ascii handshake characters:
@@ -73,32 +70,6 @@
73#define R3964_TO_RX_PANIC ((4000)*HZ/1000) 70#define R3964_TO_RX_PANIC ((4000)*HZ/1000)
74#define R3964_MAX_RETRIES 5 71#define R3964_MAX_RETRIES 5
75 72
76#endif
77
78/*
79 * Ioctl-commands
80 */
81
82#define R3964_ENABLE_SIGNALS 0x5301
83#define R3964_SETPRIORITY 0x5302
84#define R3964_USE_BCC 0x5303
85#define R3964_READ_TELEGRAM 0x5304
86
87/* Options for R3964_SETPRIORITY */
88#define R3964_MASTER 0
89#define R3964_SLAVE 1
90
91/* Options for R3964_ENABLE_SIGNALS */
92#define R3964_SIG_ACK 0x0001
93#define R3964_SIG_DATA 0x0002
94#define R3964_SIG_ALL 0x000f
95#define R3964_SIG_NONE 0x0000
96#define R3964_USE_SIGIO 0x1000
97
98/*
99 * r3964 operation states:
100 */
101#ifdef __KERNEL__
102 73
103enum { R3964_IDLE, 74enum { R3964_IDLE,
104 R3964_TX_REQUEST, R3964_TRANSMITTING, 75 R3964_TX_REQUEST, R3964_TRANSMITTING,
@@ -127,29 +98,6 @@ struct r3964_client_info {
127}; 98};
128 99
129 100
130#endif
131
132/* types for msg_id: */
133enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
134
135#define R3964_MAX_MSG_COUNT 32
136
137/* error codes for client messages */
138#define R3964_OK 0 /* no error. */
139#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
140#define R3964_OVERFLOW -2 /* msg queue overflow */
141
142/* the client gets this struct when calling read(fd,...): */
143struct r3964_client_message {
144 int msg_id;
145 int arg;
146 int error_code;
147};
148
149#define R3964_MTU 256
150
151
152#ifdef __KERNEL__
153 101
154struct r3964_block_header; 102struct r3964_block_header;
155 103
@@ -226,6 +174,4 @@ struct r3964_info {
226 int nRetry; 174 int nRetry;
227}; 175};
228 176
229#endif
230
231#endif 177#endif
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 5c86e2b33e2..4871170a04a 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -11,45 +11,13 @@
11 * 2004/02/19 Paul Clements 11 * 2004/02/19 Paul Clements
12 * Removed PARANOIA, plus various cleanup and comments 12 * Removed PARANOIA, plus various cleanup and comments
13 */ 13 */
14
15#ifndef LINUX_NBD_H 14#ifndef LINUX_NBD_H
16#define LINUX_NBD_H 15#define LINUX_NBD_H
17 16
18#include <linux/types.h>
19
20#define NBD_SET_SOCK _IO( 0xab, 0 )
21#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
22#define NBD_SET_SIZE _IO( 0xab, 2 )
23#define NBD_DO_IT _IO( 0xab, 3 )
24#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
25#define NBD_CLEAR_QUE _IO( 0xab, 5 )
26#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
28#define NBD_DISCONNECT _IO( 0xab, 8 )
29#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
30#define NBD_SET_FLAGS _IO( 0xab, 10)
31
32enum {
33 NBD_CMD_READ = 0,
34 NBD_CMD_WRITE = 1,
35 NBD_CMD_DISC = 2,
36 /* there is a gap here to match userspace */
37 NBD_CMD_TRIM = 4
38};
39
40/* values for flags field */
41#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
42#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
43/* there is a gap here to match userspace */
44#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
45
46#define nbd_cmd(req) ((req)->cmd[0])
47
48/* userspace doesn't need the nbd_device structure */
49#ifdef __KERNEL__
50 17
51#include <linux/wait.h> 18#include <linux/wait.h>
52#include <linux/mutex.h> 19#include <linux/mutex.h>
20#include <uapi/linux/nbd.h>
53 21
54struct request; 22struct request;
55 23
@@ -76,32 +44,3 @@ struct nbd_device {
76}; 44};
77 45
78#endif 46#endif
79
80/* These are sent over the network in the request/reply magic fields */
81
82#define NBD_REQUEST_MAGIC 0x25609513
83#define NBD_REPLY_MAGIC 0x67446698
84/* Do *not* use magics: 0x12560953 0x96744668. */
85
86/*
87 * This is the packet used for communication between client and
88 * server. All data are in network byte order.
89 */
90struct nbd_request {
91 __be32 magic;
92 __be32 type; /* == READ || == WRITE */
93 char handle[8];
94 __be64 from;
95 __be32 len;
96} __attribute__((packed));
97
98/*
99 * This is the reply packet that nbd-server sends back to the client after
100 * it has completed an I/O request (or an error occurs).
101 */
102struct nbd_reply {
103 __be32 magic;
104 __be32 error; /* 0 = ok, else error */
105 char handle[8]; /* handle you got from request */
106};
107#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 6ab31cabef7..aa1673160a4 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -18,49 +18,13 @@
18#ifndef _LINUX_NET_H 18#ifndef _LINUX_NET_H
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/socket.h>
22#include <asm/socket.h>
23
24#define NPROTO AF_MAX
25
26#define SYS_SOCKET 1 /* sys_socket(2) */
27#define SYS_BIND 2 /* sys_bind(2) */
28#define SYS_CONNECT 3 /* sys_connect(2) */
29#define SYS_LISTEN 4 /* sys_listen(2) */
30#define SYS_ACCEPT 5 /* sys_accept(2) */
31#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
32#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
33#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
34#define SYS_SEND 9 /* sys_send(2) */
35#define SYS_RECV 10 /* sys_recv(2) */
36#define SYS_SENDTO 11 /* sys_sendto(2) */
37#define SYS_RECVFROM 12 /* sys_recvfrom(2) */
38#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
39#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
40#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
43#define SYS_ACCEPT4 18 /* sys_accept4(2) */
44#define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */
45#define SYS_SENDMMSG 20 /* sys_sendmmsg(2) */
46
47typedef enum {
48 SS_FREE = 0, /* not allocated */
49 SS_UNCONNECTED, /* unconnected to any socket */
50 SS_CONNECTING, /* in process of connecting */
51 SS_CONNECTED, /* connected to socket */
52 SS_DISCONNECTING /* in process of disconnecting */
53} socket_state;
54
55#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
56
57#ifdef __KERNEL__
58#include <linux/stringify.h> 21#include <linux/stringify.h>
59#include <linux/random.h> 22#include <linux/random.h>
60#include <linux/wait.h> 23#include <linux/wait.h>
61#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ 24#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
62#include <linux/kmemcheck.h> 25#include <linux/kmemcheck.h>
63#include <linux/rcupdate.h> 26#include <linux/rcupdate.h>
27#include <uapi/linux/net.h>
64 28
65struct poll_table_struct; 29struct poll_table_struct;
66struct pipe_inode_info; 30struct pipe_inode_info;
@@ -319,5 +283,4 @@ extern int kernel_sock_shutdown(struct socket *sock,
319#define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \ 283#define MODULE_ALIAS_NET_PF_PROTO_NAME(pf, proto, name) \
320 MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \ 284 MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
321 name) 285 name)
322#endif /* __KERNEL__ */
323#endif /* _LINUX_NET_H */ 286#endif /* _LINUX_NET_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 561c8bc8976..f8eda0276f0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -25,12 +25,6 @@
25#ifndef _LINUX_NETDEVICE_H 25#ifndef _LINUX_NETDEVICE_H
26#define _LINUX_NETDEVICE_H 26#define _LINUX_NETDEVICE_H
27 27
28#include <linux/if.h>
29#include <linux/if_ether.h>
30#include <linux/if_packet.h>
31#include <linux/if_link.h>
32
33#ifdef __KERNEL__
34#include <linux/pm_qos.h> 28#include <linux/pm_qos.h>
35#include <linux/timer.h> 29#include <linux/timer.h>
36#include <linux/bug.h> 30#include <linux/bug.h>
@@ -55,6 +49,7 @@
55 49
56#include <linux/netdev_features.h> 50#include <linux/netdev_features.h>
57#include <linux/neighbour.h> 51#include <linux/neighbour.h>
52#include <uapi/linux/netdevice.h>
58 53
59struct netpoll_info; 54struct netpoll_info;
60struct device; 55struct device;
@@ -133,14 +128,6 @@ static inline bool dev_xmit_complete(int rc)
133 return false; 128 return false;
134} 129}
135 130
136#endif
137
138#define MAX_ADDR_LEN 32 /* Largest hardware address length */
139
140/* Initial net device group. All devices belong to group 0 by default. */
141#define INIT_NETDEV_GROUP 0
142
143#ifdef __KERNEL__
144/* 131/*
145 * Compute the worst case header length according to the protocols 132 * Compute the worst case header length according to the protocols
146 * used. 133 * used.
@@ -196,21 +183,6 @@ struct net_device_stats {
196 unsigned long tx_compressed; 183 unsigned long tx_compressed;
197}; 184};
198 185
199#endif /* __KERNEL__ */
200
201
202/* Media selection options. */
203enum {
204 IF_PORT_UNKNOWN = 0,
205 IF_PORT_10BASE2,
206 IF_PORT_10BASET,
207 IF_PORT_AUI,
208 IF_PORT_100BASET,
209 IF_PORT_100BASETX,
210 IF_PORT_100BASEFX
211};
212
213#ifdef __KERNEL__
214 186
215#include <linux/cache.h> 187#include <linux/cache.h>
216#include <linux/skbuff.h> 188#include <linux/skbuff.h>
@@ -2844,6 +2816,4 @@ do { \
2844}) 2816})
2845#endif 2817#endif
2846 2818
2847#endif /* __KERNEL__ */
2848
2849#endif /* _LINUX_NETDEVICE_H */ 2819#endif /* _LINUX_NETDEVICE_H */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 1dcf2a38e51..ee142846f56 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_NETFILTER_H 1#ifndef __LINUX_NETFILTER_H
2#define __LINUX_NETFILTER_H 2#define __LINUX_NETFILTER_H
3 3
4#ifdef __KERNEL__
5#include <linux/init.h> 4#include <linux/init.h>
6#include <linux/skbuff.h> 5#include <linux/skbuff.h>
7#include <linux/net.h> 6#include <linux/net.h>
@@ -10,75 +9,7 @@
10#include <linux/in6.h> 9#include <linux/in6.h>
11#include <linux/wait.h> 10#include <linux/wait.h>
12#include <linux/list.h> 11#include <linux/list.h>
13#endif 12#include <uapi/linux/netfilter.h>
14#include <linux/types.h>
15#include <linux/compiler.h>
16#include <linux/sysctl.h>
17
18/* Responses from hook functions. */
19#define NF_DROP 0
20#define NF_ACCEPT 1
21#define NF_STOLEN 2
22#define NF_QUEUE 3
23#define NF_REPEAT 4
24#define NF_STOP 5
25#define NF_MAX_VERDICT NF_STOP
26
27/* we overload the higher bits for encoding auxiliary data such as the queue
28 * number or errno values. Not nice, but better than additional function
29 * arguments. */
30#define NF_VERDICT_MASK 0x000000ff
31
32/* extra verdict flags have mask 0x0000ff00 */
33#define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
34
35/* queue number (NF_QUEUE) or errno (NF_DROP) */
36#define NF_VERDICT_QMASK 0xffff0000
37#define NF_VERDICT_QBITS 16
38
39#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
40
41#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
42
43/* only for userspace compatibility */
44#ifndef __KERNEL__
45/* Generic cache responses from hook functions.
46 <= 0x2000 is used for protocol-flags. */
47#define NFC_UNKNOWN 0x4000
48#define NFC_ALTERED 0x8000
49
50/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
51#define NF_VERDICT_BITS 16
52#endif
53
54enum nf_inet_hooks {
55 NF_INET_PRE_ROUTING,
56 NF_INET_LOCAL_IN,
57 NF_INET_FORWARD,
58 NF_INET_LOCAL_OUT,
59 NF_INET_POST_ROUTING,
60 NF_INET_NUMHOOKS
61};
62
63enum {
64 NFPROTO_UNSPEC = 0,
65 NFPROTO_IPV4 = 2,
66 NFPROTO_ARP = 3,
67 NFPROTO_BRIDGE = 7,
68 NFPROTO_IPV6 = 10,
69 NFPROTO_DECNET = 12,
70 NFPROTO_NUMPROTO,
71};
72
73union nf_inet_addr {
74 __u32 all[4];
75 __be32 ip;
76 __be32 ip6[4];
77 struct in_addr in;
78 struct in6_addr in6;
79};
80
81#ifdef __KERNEL__
82#ifdef CONFIG_NETFILTER 13#ifdef CONFIG_NETFILTER
83static inline int NF_DROP_GETERR(int verdict) 14static inline int NF_DROP_GETERR(int verdict)
84{ 15{
@@ -411,5 +342,4 @@ extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook;
411static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 342static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
412#endif 343#endif
413 344
414#endif /*__KERNEL__*/
415#endif /*__LINUX_NETFILTER_H*/ 345#endif /*__LINUX_NETFILTER_H*/
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 31d2844e657..dfb4d9e52bc 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -1,30 +1,8 @@
1#ifndef __LINUX_BRIDGE_NETFILTER_H 1#ifndef __LINUX_BRIDGE_NETFILTER_H
2#define __LINUX_BRIDGE_NETFILTER_H 2#define __LINUX_BRIDGE_NETFILTER_H
3 3
4/* bridge-specific defines for netfilter. 4#include <uapi/linux/netfilter_bridge.h>
5 */ 5
6
7#include <linux/netfilter.h>
8#include <linux/if_ether.h>
9#include <linux/if_vlan.h>
10#include <linux/if_pppox.h>
11
12/* Bridge Hooks */
13/* After promisc drops, checksum checks. */
14#define NF_BR_PRE_ROUTING 0
15/* If the packet is destined for this box. */
16#define NF_BR_LOCAL_IN 1
17/* If the packet is destined for another interface. */
18#define NF_BR_FORWARD 2
19/* Packets coming from a local process. */
20#define NF_BR_LOCAL_OUT 3
21/* Packets about to hit the wire. */
22#define NF_BR_POST_ROUTING 4
23/* Not really a hook, but used for the ebtables broute table */
24#define NF_BR_BROUTING 5
25#define NF_BR_NUMHOOKS 6
26
27#ifdef __KERNEL__
28 6
29enum nf_br_hook_priorities { 7enum nf_br_hook_priorities {
30 NF_BR_PRI_FIRST = INT_MIN, 8 NF_BR_PRI_FIRST = INT_MIN,
@@ -118,5 +96,4 @@ static inline void br_drop_fake_rtable(struct sk_buff *skb)
118#define br_drop_fake_rtable(skb) do { } while (0) 96#define br_drop_fake_rtable(skb) do { } while (0)
119#endif /* CONFIG_BRIDGE_NETFILTER */ 97#endif /* CONFIG_BRIDGE_NETFILTER */
120 98
121#endif /* __KERNEL__ */
122#endif 99#endif
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index b962dfc695a..dfaf116b3e8 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -1,86 +1,12 @@
1#ifndef __LINUX_IP_NETFILTER_H
2#define __LINUX_IP_NETFILTER_H
3
4/* IPv4-specific defines for netfilter. 1/* IPv4-specific defines for netfilter.
5 * (C)1998 Rusty Russell -- This code is GPL. 2 * (C)1998 Rusty Russell -- This code is GPL.
6 */ 3 */
4#ifndef __LINUX_IP_NETFILTER_H
5#define __LINUX_IP_NETFILTER_H
7 6
8#include <linux/netfilter.h> 7#include <uapi/linux/netfilter_ipv4.h>
9
10/* only for userspace compatibility */
11#ifndef __KERNEL__
12
13#include <limits.h> /* for INT_MIN, INT_MAX */
14
15/* IP Cache bits. */
16/* Src IP address. */
17#define NFC_IP_SRC 0x0001
18/* Dest IP address. */
19#define NFC_IP_DST 0x0002
20/* Input device. */
21#define NFC_IP_IF_IN 0x0004
22/* Output device. */
23#define NFC_IP_IF_OUT 0x0008
24/* TOS. */
25#define NFC_IP_TOS 0x0010
26/* Protocol. */
27#define NFC_IP_PROTO 0x0020
28/* IP options. */
29#define NFC_IP_OPTIONS 0x0040
30/* Frag & flags. */
31#define NFC_IP_FRAG 0x0080
32
33/* Per-protocol information: only matters if proto match. */
34/* TCP flags. */
35#define NFC_IP_TCPFLAGS 0x0100
36/* Source port. */
37#define NFC_IP_SRC_PT 0x0200
38/* Dest port. */
39#define NFC_IP_DST_PT 0x0400
40/* Something else about the proto */
41#define NFC_IP_PROTO_UNKNOWN 0x2000
42
43/* IP Hooks */
44/* After promisc drops, checksum checks. */
45#define NF_IP_PRE_ROUTING 0
46/* If the packet is destined for this box. */
47#define NF_IP_LOCAL_IN 1
48/* If the packet is destined for another interface. */
49#define NF_IP_FORWARD 2
50/* Packets coming from a local process. */
51#define NF_IP_LOCAL_OUT 3
52/* Packets about to hit the wire. */
53#define NF_IP_POST_ROUTING 4
54#define NF_IP_NUMHOOKS 5
55#endif /* ! __KERNEL__ */
56
57enum nf_ip_hook_priorities {
58 NF_IP_PRI_FIRST = INT_MIN,
59 NF_IP_PRI_CONNTRACK_DEFRAG = -400,
60 NF_IP_PRI_RAW = -300,
61 NF_IP_PRI_SELINUX_FIRST = -225,
62 NF_IP_PRI_CONNTRACK = -200,
63 NF_IP_PRI_MANGLE = -150,
64 NF_IP_PRI_NAT_DST = -100,
65 NF_IP_PRI_FILTER = 0,
66 NF_IP_PRI_SECURITY = 50,
67 NF_IP_PRI_NAT_SRC = 100,
68 NF_IP_PRI_SELINUX_LAST = 225,
69 NF_IP_PRI_CONNTRACK_HELPER = 300,
70 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
71 NF_IP_PRI_LAST = INT_MAX,
72};
73
74/* Arguments for setsockopt SOL_IP: */
75/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
76/* 2.2 firewalling (+ masq) went from 64 through 76 */
77/* 2.4 firewalling went 64 through 67. */
78#define SO_ORIGINAL_DST 80
79 8
80#ifdef __KERNEL__
81extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); 9extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
82extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 10extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
83 unsigned int dataoff, u_int8_t protocol); 11 unsigned int dataoff, u_int8_t protocol);
84#endif /*__KERNEL__*/
85
86#endif /*__LINUX_IP_NETFILTER_H*/ 12#endif /*__LINUX_IP_NETFILTER_H*/
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 7c8a513ce7a..98ffb54988b 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -1,81 +1,14 @@
1#ifndef __LINUX_IP6_NETFILTER_H
2#define __LINUX_IP6_NETFILTER_H
3
4/* IPv6-specific defines for netfilter. 1/* IPv6-specific defines for netfilter.
5 * (C)1998 Rusty Russell -- This code is GPL. 2 * (C)1998 Rusty Russell -- This code is GPL.
6 * (C)1999 David Jeffery 3 * (C)1999 David Jeffery
7 * this header was blatantly ripped from netfilter_ipv4.h 4 * this header was blatantly ripped from netfilter_ipv4.h
8 * it's amazing what adding a bunch of 6s can do =8^) 5 * it's amazing what adding a bunch of 6s can do =8^)
9 */ 6 */
7#ifndef __LINUX_IP6_NETFILTER_H
8#define __LINUX_IP6_NETFILTER_H
10 9
11#include <linux/netfilter.h> 10#include <uapi/linux/netfilter_ipv6.h>
12
13/* only for userspace compatibility */
14#ifndef __KERNEL__
15
16#include <limits.h> /* for INT_MIN, INT_MAX */
17
18/* IP Cache bits. */
19/* Src IP address. */
20#define NFC_IP6_SRC 0x0001
21/* Dest IP address. */
22#define NFC_IP6_DST 0x0002
23/* Input device. */
24#define NFC_IP6_IF_IN 0x0004
25/* Output device. */
26#define NFC_IP6_IF_OUT 0x0008
27/* TOS. */
28#define NFC_IP6_TOS 0x0010
29/* Protocol. */
30#define NFC_IP6_PROTO 0x0020
31/* IP options. */
32#define NFC_IP6_OPTIONS 0x0040
33/* Frag & flags. */
34#define NFC_IP6_FRAG 0x0080
35
36
37/* Per-protocol information: only matters if proto match. */
38/* TCP flags. */
39#define NFC_IP6_TCPFLAGS 0x0100
40/* Source port. */
41#define NFC_IP6_SRC_PT 0x0200
42/* Dest port. */
43#define NFC_IP6_DST_PT 0x0400
44/* Something else about the proto */
45#define NFC_IP6_PROTO_UNKNOWN 0x2000
46
47/* IP6 Hooks */
48/* After promisc drops, checksum checks. */
49#define NF_IP6_PRE_ROUTING 0
50/* If the packet is destined for this box. */
51#define NF_IP6_LOCAL_IN 1
52/* If the packet is destined for another interface. */
53#define NF_IP6_FORWARD 2
54/* Packets coming from a local process. */
55#define NF_IP6_LOCAL_OUT 3
56/* Packets about to hit the wire. */
57#define NF_IP6_POST_ROUTING 4
58#define NF_IP6_NUMHOOKS 5
59#endif /* ! __KERNEL__ */
60
61
62enum nf_ip6_hook_priorities {
63 NF_IP6_PRI_FIRST = INT_MIN,
64 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
65 NF_IP6_PRI_RAW = -300,
66 NF_IP6_PRI_SELINUX_FIRST = -225,
67 NF_IP6_PRI_CONNTRACK = -200,
68 NF_IP6_PRI_MANGLE = -150,
69 NF_IP6_PRI_NAT_DST = -100,
70 NF_IP6_PRI_FILTER = 0,
71 NF_IP6_PRI_SECURITY = 50,
72 NF_IP6_PRI_NAT_SRC = 100,
73 NF_IP6_PRI_SELINUX_LAST = 225,
74 NF_IP6_PRI_CONNTRACK_HELPER = 300,
75 NF_IP6_PRI_LAST = INT_MAX,
76};
77 11
78#ifdef __KERNEL__
79 12
80#ifdef CONFIG_NETFILTER 13#ifdef CONFIG_NETFILTER
81extern int ip6_route_me_harder(struct sk_buff *skb); 14extern int ip6_route_me_harder(struct sk_buff *skb);
@@ -89,6 +22,4 @@ static inline int ipv6_netfilter_init(void) { return 0; }
89static inline void ipv6_netfilter_fini(void) { return; } 22static inline void ipv6_netfilter_fini(void) { return; }
90#endif /* CONFIG_NETFILTER */ 23#endif /* CONFIG_NETFILTER */
91 24
92#endif /* __KERNEL__ */
93
94#endif /*__LINUX_IP6_NETFILTER_H*/ 25#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 6d3af05c107..e0f746b7b95 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -1,160 +1,12 @@
1#ifndef __LINUX_NETLINK_H 1#ifndef __LINUX_NETLINK_H
2#define __LINUX_NETLINK_H 2#define __LINUX_NETLINK_H
3 3
4#include <linux/socket.h> /* for __kernel_sa_family_t */
5#include <linux/types.h>
6
7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_UNUSED 1 /* Unused number */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
11#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
13#define NETLINK_XFRM 6 /* ipsec */
14#define NETLINK_SELINUX 7 /* SELinux event notifications */
15#define NETLINK_ISCSI 8 /* Open-iSCSI */
16#define NETLINK_AUDIT 9 /* auditing */
17#define NETLINK_FIB_LOOKUP 10
18#define NETLINK_CONNECTOR 11
19#define NETLINK_NETFILTER 12 /* netfilter subsystem */
20#define NETLINK_IP6_FW 13
21#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
22#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
23#define NETLINK_GENERIC 16
24/* leave room for NETLINK_DM (DM Events) */
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19
27#define NETLINK_RDMA 20
28#define NETLINK_CRYPTO 21 /* Crypto layer */
29
30#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
31
32#define MAX_LINKS 32
33
34struct sockaddr_nl {
35 __kernel_sa_family_t nl_family; /* AF_NETLINK */
36 unsigned short nl_pad; /* zero */
37 __u32 nl_pid; /* port ID */
38 __u32 nl_groups; /* multicast groups mask */
39};
40
41struct nlmsghdr {
42 __u32 nlmsg_len; /* Length of message including header */
43 __u16 nlmsg_type; /* Message content */
44 __u16 nlmsg_flags; /* Additional flags */
45 __u32 nlmsg_seq; /* Sequence number */
46 __u32 nlmsg_pid; /* Sending process port ID */
47};
48
49/* Flags values */
50
51#define NLM_F_REQUEST 1 /* It is request message. */
52#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
53#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
54#define NLM_F_ECHO 8 /* Echo this request */
55#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
56
57/* Modifiers to GET request */
58#define NLM_F_ROOT 0x100 /* specify tree root */
59#define NLM_F_MATCH 0x200 /* return all matching */
60#define NLM_F_ATOMIC 0x400 /* atomic GET */
61#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
62
63/* Modifiers to NEW request */
64#define NLM_F_REPLACE 0x100 /* Override existing */
65#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
66#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
67#define NLM_F_APPEND 0x800 /* Add to end of list */
68
69/*
70 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
71 4.4BSD CHANGE NLM_F_REPLACE
72
73 True CHANGE NLM_F_CREATE|NLM_F_REPLACE
74 Append NLM_F_CREATE
75 Check NLM_F_EXCL
76 */
77
78#define NLMSG_ALIGNTO 4U
79#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
80#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
81#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
82#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
83#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
84#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
85 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
86#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
87 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
88 (nlh)->nlmsg_len <= (len))
89#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
90
91#define NLMSG_NOOP 0x1 /* Nothing. */
92#define NLMSG_ERROR 0x2 /* Error */
93#define NLMSG_DONE 0x3 /* End of a dump */
94#define NLMSG_OVERRUN 0x4 /* Data lost */
95
96#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
97
98struct nlmsgerr {
99 int error;
100 struct nlmsghdr msg;
101};
102
103#define NETLINK_ADD_MEMBERSHIP 1
104#define NETLINK_DROP_MEMBERSHIP 2
105#define NETLINK_PKTINFO 3
106#define NETLINK_BROADCAST_ERROR 4
107#define NETLINK_NO_ENOBUFS 5
108
109struct nl_pktinfo {
110 __u32 group;
111};
112
113#define NET_MAJOR 36 /* Major 36 is reserved for networking */
114
115enum {
116 NETLINK_UNCONNECTED = 0,
117 NETLINK_CONNECTED,
118};
119
120/*
121 * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
122 * +---------------------+- - -+- - - - - - - - - -+- - -+
123 * | Header | Pad | Payload | Pad |
124 * | (struct nlattr) | ing | | ing |
125 * +---------------------+- - -+- - - - - - - - - -+- - -+
126 * <-------------- nlattr->nla_len -------------->
127 */
128
129struct nlattr {
130 __u16 nla_len;
131 __u16 nla_type;
132};
133
134/*
135 * nla_type (16 bits)
136 * +---+---+-------------------------------+
137 * | N | O | Attribute Type |
138 * +---+---+-------------------------------+
139 * N := Carries nested attributes
140 * O := Payload stored in network byte order
141 *
142 * Note: The N and O flag are mutually exclusive.
143 */
144#define NLA_F_NESTED (1 << 15)
145#define NLA_F_NET_BYTEORDER (1 << 14)
146#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
147
148#define NLA_ALIGNTO 4
149#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
150#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
151
152#ifdef __KERNEL__
153 4
154#include <linux/capability.h> 5#include <linux/capability.h>
155#include <linux/skbuff.h> 6#include <linux/skbuff.h>
156#include <linux/export.h> 7#include <linux/export.h>
157#include <net/scm.h> 8#include <net/scm.h>
9#include <uapi/linux/netlink.h>
158 10
159struct net; 11struct net;
160 12
@@ -283,6 +135,4 @@ static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
283 return __netlink_dump_start(ssk, skb, nlh, control); 135 return __netlink_dump_start(ssk, skb, nlh, control);
284} 136}
285 137
286#endif /* __KERNEL__ */
287
288#endif /* __LINUX_NETLINK_H */ 138#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 6d1fb63f592..3e794c12e90 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -7,130 +7,9 @@
7#ifndef _LINUX_NFS_H 7#ifndef _LINUX_NFS_H
8#define _LINUX_NFS_H 8#define _LINUX_NFS_H
9 9
10#define NFS_PROGRAM 100003
11#define NFS_PORT 2049
12#define NFS_MAXDATA 8192
13#define NFS_MAXPATHLEN 1024
14#define NFS_MAXNAMLEN 255
15#define NFS_MAXGROUPS 16
16#define NFS_FHSIZE 32
17#define NFS_COOKIESIZE 4
18#define NFS_FIFO_DEV (-1)
19#define NFSMODE_FMT 0170000
20#define NFSMODE_DIR 0040000
21#define NFSMODE_CHR 0020000
22#define NFSMODE_BLK 0060000
23#define NFSMODE_REG 0100000
24#define NFSMODE_LNK 0120000
25#define NFSMODE_SOCK 0140000
26#define NFSMODE_FIFO 0010000
27
28#define NFS_MNT_PROGRAM 100005
29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3
31
32#define NFS_PIPE_DIRNAME "nfs"
33
34/*
35 * NFS stats. The good thing with these values is that NFSv3 errors are
36 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
37 * no-one uses anyway), so we can happily mix code as long as we make sure
38 * no NFSv3 errors are returned to NFSv2 clients.
39 * Error codes that have a `--' in the v2 column are not part of the
40 * standard, but seem to be widely used nevertheless.
41 */
42 enum nfs_stat {
43 NFS_OK = 0, /* v2 v3 v4 */
44 NFSERR_PERM = 1, /* v2 v3 v4 */
45 NFSERR_NOENT = 2, /* v2 v3 v4 */
46 NFSERR_IO = 5, /* v2 v3 v4 */
47 NFSERR_NXIO = 6, /* v2 v3 v4 */
48 NFSERR_EAGAIN = 11, /* v2 v3 */
49 NFSERR_ACCES = 13, /* v2 v3 v4 */
50 NFSERR_EXIST = 17, /* v2 v3 v4 */
51 NFSERR_XDEV = 18, /* v3 v4 */
52 NFSERR_NODEV = 19, /* v2 v3 v4 */
53 NFSERR_NOTDIR = 20, /* v2 v3 v4 */
54 NFSERR_ISDIR = 21, /* v2 v3 v4 */
55 NFSERR_INVAL = 22, /* v2 v3 v4 */
56 NFSERR_FBIG = 27, /* v2 v3 v4 */
57 NFSERR_NOSPC = 28, /* v2 v3 v4 */
58 NFSERR_ROFS = 30, /* v2 v3 v4 */
59 NFSERR_MLINK = 31, /* v3 v4 */
60 NFSERR_OPNOTSUPP = 45, /* v2 v3 */
61 NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */
62 NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */
63 NFSERR_DQUOT = 69, /* v2 v3 v4 */
64 NFSERR_STALE = 70, /* v2 v3 v4 */
65 NFSERR_REMOTE = 71, /* v2 v3 */
66 NFSERR_WFLUSH = 99, /* v2 */
67 NFSERR_BADHANDLE = 10001, /* v3 v4 */
68 NFSERR_NOT_SYNC = 10002, /* v3 */
69 NFSERR_BAD_COOKIE = 10003, /* v3 v4 */
70 NFSERR_NOTSUPP = 10004, /* v3 v4 */
71 NFSERR_TOOSMALL = 10005, /* v3 v4 */
72 NFSERR_SERVERFAULT = 10006, /* v3 v4 */
73 NFSERR_BADTYPE = 10007, /* v3 v4 */
74 NFSERR_JUKEBOX = 10008, /* v3 v4 */
75 NFSERR_SAME = 10009, /* v4 */
76 NFSERR_DENIED = 10010, /* v4 */
77 NFSERR_EXPIRED = 10011, /* v4 */
78 NFSERR_LOCKED = 10012, /* v4 */
79 NFSERR_GRACE = 10013, /* v4 */
80 NFSERR_FHEXPIRED = 10014, /* v4 */
81 NFSERR_SHARE_DENIED = 10015, /* v4 */
82 NFSERR_WRONGSEC = 10016, /* v4 */
83 NFSERR_CLID_INUSE = 10017, /* v4 */
84 NFSERR_RESOURCE = 10018, /* v4 */
85 NFSERR_MOVED = 10019, /* v4 */
86 NFSERR_NOFILEHANDLE = 10020, /* v4 */
87 NFSERR_MINOR_VERS_MISMATCH = 10021, /* v4 */
88 NFSERR_STALE_CLIENTID = 10022, /* v4 */
89 NFSERR_STALE_STATEID = 10023, /* v4 */
90 NFSERR_OLD_STATEID = 10024, /* v4 */
91 NFSERR_BAD_STATEID = 10025, /* v4 */
92 NFSERR_BAD_SEQID = 10026, /* v4 */
93 NFSERR_NOT_SAME = 10027, /* v4 */
94 NFSERR_LOCK_RANGE = 10028, /* v4 */
95 NFSERR_SYMLINK = 10029, /* v4 */
96 NFSERR_RESTOREFH = 10030, /* v4 */
97 NFSERR_LEASE_MOVED = 10031, /* v4 */
98 NFSERR_ATTRNOTSUPP = 10032, /* v4 */
99 NFSERR_NO_GRACE = 10033, /* v4 */
100 NFSERR_RECLAIM_BAD = 10034, /* v4 */
101 NFSERR_RECLAIM_CONFLICT = 10035,/* v4 */
102 NFSERR_BAD_XDR = 10036, /* v4 */
103 NFSERR_LOCKS_HELD = 10037, /* v4 */
104 NFSERR_OPENMODE = 10038, /* v4 */
105 NFSERR_BADOWNER = 10039, /* v4 */
106 NFSERR_BADCHAR = 10040, /* v4 */
107 NFSERR_BADNAME = 10041, /* v4 */
108 NFSERR_BAD_RANGE = 10042, /* v4 */
109 NFSERR_LOCK_NOTSUPP = 10043, /* v4 */
110 NFSERR_OP_ILLEGAL = 10044, /* v4 */
111 NFSERR_DEADLOCK = 10045, /* v4 */
112 NFSERR_FILE_OPEN = 10046, /* v4 */
113 NFSERR_ADMIN_REVOKED = 10047, /* v4 */
114 NFSERR_CB_PATH_DOWN = 10048, /* v4 */
115};
116
117/* NFSv2 file types - beware, these are not the same in NFSv3 */
118
119enum nfs_ftype {
120 NFNON = 0,
121 NFREG = 1,
122 NFDIR = 2,
123 NFBLK = 3,
124 NFCHR = 4,
125 NFLNK = 5,
126 NFSOCK = 6,
127 NFBAD = 7,
128 NFFIFO = 8
129};
130
131#ifdef __KERNEL__
132#include <linux/sunrpc/msg_prot.h> 10#include <linux/sunrpc/msg_prot.h>
133#include <linux/string.h> 11#include <linux/string.h>
12#include <uapi/linux/nfs.h>
134 13
135/* 14/*
136 * This is the kernel NFS client file handle representation 15 * This is the kernel NFS client file handle representation
@@ -169,5 +48,4 @@ enum nfs3_stable_how {
169 NFS_DATA_SYNC = 1, 48 NFS_DATA_SYNC = 1,
170 NFS_FILE_SYNC = 2 49 NFS_FILE_SYNC = 2
171}; 50};
172#endif /* __KERNEL__ */
173#endif /* _LINUX_NFS_H */ 51#endif /* _LINUX_NFS_H */
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 6ccfe3b641e..a778ad8e3af 100644
--- a/include/linux/nfs3.h
+++ b/include/linux/nfs3.h
@@ -4,100 +4,10 @@
4#ifndef _LINUX_NFS3_H 4#ifndef _LINUX_NFS3_H
5#define _LINUX_NFS3_H 5#define _LINUX_NFS3_H
6 6
7#define NFS3_PORT 2049 7#include <uapi/linux/nfs3.h>
8#define NFS3_MAXDATA 32768
9#define NFS3_MAXPATHLEN PATH_MAX
10#define NFS3_MAXNAMLEN NAME_MAX
11#define NFS3_MAXGROUPS 16
12#define NFS3_FHSIZE 64
13#define NFS3_COOKIESIZE 4
14#define NFS3_CREATEVERFSIZE 8
15#define NFS3_COOKIEVERFSIZE 8
16#define NFS3_WRITEVERFSIZE 8
17#define NFS3_FIFO_DEV (-1)
18#define NFS3MODE_FMT 0170000
19#define NFS3MODE_DIR 0040000
20#define NFS3MODE_CHR 0020000
21#define NFS3MODE_BLK 0060000
22#define NFS3MODE_REG 0100000
23#define NFS3MODE_LNK 0120000
24#define NFS3MODE_SOCK 0140000
25#define NFS3MODE_FIFO 0010000
26 8
27/* Flags for access() call */
28#define NFS3_ACCESS_READ 0x0001
29#define NFS3_ACCESS_LOOKUP 0x0002
30#define NFS3_ACCESS_MODIFY 0x0004
31#define NFS3_ACCESS_EXTEND 0x0008
32#define NFS3_ACCESS_DELETE 0x0010
33#define NFS3_ACCESS_EXECUTE 0x0020
34#define NFS3_ACCESS_FULL 0x003f
35
36/* Flags for create mode */
37enum nfs3_createmode {
38 NFS3_CREATE_UNCHECKED = 0,
39 NFS3_CREATE_GUARDED = 1,
40 NFS3_CREATE_EXCLUSIVE = 2
41};
42
43/* NFSv3 file system properties */
44#define NFS3_FSF_LINK 0x0001
45#define NFS3_FSF_SYMLINK 0x0002
46#define NFS3_FSF_HOMOGENEOUS 0x0008
47#define NFS3_FSF_CANSETTIME 0x0010
48/* Some shorthands. See fs/nfsd/nfs3proc.c */
49#define NFS3_FSF_DEFAULT 0x001B
50#define NFS3_FSF_BILLYBOY 0x0018
51#define NFS3_FSF_READONLY 0x0008
52
53enum nfs3_ftype {
54 NF3NON = 0,
55 NF3REG = 1,
56 NF3DIR = 2,
57 NF3BLK = 3,
58 NF3CHR = 4,
59 NF3LNK = 5,
60 NF3SOCK = 6,
61 NF3FIFO = 7, /* changed from NFSv2 (was 8) */
62 NF3BAD = 8
63};
64
65struct nfs3_fh {
66 unsigned short size;
67 unsigned char data[NFS3_FHSIZE];
68};
69
70#define NFS3_VERSION 3
71#define NFS3PROC_NULL 0
72#define NFS3PROC_GETATTR 1
73#define NFS3PROC_SETATTR 2
74#define NFS3PROC_LOOKUP 3
75#define NFS3PROC_ACCESS 4
76#define NFS3PROC_READLINK 5
77#define NFS3PROC_READ 6
78#define NFS3PROC_WRITE 7
79#define NFS3PROC_CREATE 8
80#define NFS3PROC_MKDIR 9
81#define NFS3PROC_SYMLINK 10
82#define NFS3PROC_MKNOD 11
83#define NFS3PROC_REMOVE 12
84#define NFS3PROC_RMDIR 13
85#define NFS3PROC_RENAME 14
86#define NFS3PROC_LINK 15
87#define NFS3PROC_READDIR 16
88#define NFS3PROC_READDIRPLUS 17
89#define NFS3PROC_FSSTAT 18
90#define NFS3PROC_FSINFO 19
91#define NFS3PROC_PATHCONF 20
92#define NFS3PROC_COMMIT 21
93
94#define NFS_MNT3_VERSION 3
95
96
97#if defined(__KERNEL__)
98 9
99/* Number of 32bit words in post_op_attr */ 10/* Number of 32bit words in post_op_attr */
100#define NFS3_POST_OP_ATTR_WORDS 22 11#define NFS3_POST_OP_ATTR_WORDS 22
101 12
102#endif /* __KERNEL__ */
103#endif /* _LINUX_NFS3_H */ 13#endif /* _LINUX_NFS3_H */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index af2d2fa30ee..e111fa419a4 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -9,168 +9,11 @@
9 * Kendrick Smith <kmsmith@umich.edu> 9 * Kendrick Smith <kmsmith@umich.edu>
10 * Andy Adamson <andros@umich.edu> 10 * Andy Adamson <andros@umich.edu>
11 */ 11 */
12
13#ifndef _LINUX_NFS4_H 12#ifndef _LINUX_NFS4_H
14#define _LINUX_NFS4_H 13#define _LINUX_NFS4_H
15 14
16#include <linux/types.h>
17
18#define NFS4_BITMAP_SIZE 2
19#define NFS4_VERIFIER_SIZE 8
20#define NFS4_STATEID_SEQID_SIZE 4
21#define NFS4_STATEID_OTHER_SIZE 12
22#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
23#define NFS4_FHSIZE 128
24#define NFS4_MAXPATHLEN PATH_MAX
25#define NFS4_MAXNAMLEN NAME_MAX
26#define NFS4_OPAQUE_LIMIT 1024
27#define NFS4_MAX_SESSIONID_LEN 16
28
29#define NFS4_ACCESS_READ 0x0001
30#define NFS4_ACCESS_LOOKUP 0x0002
31#define NFS4_ACCESS_MODIFY 0x0004
32#define NFS4_ACCESS_EXTEND 0x0008
33#define NFS4_ACCESS_DELETE 0x0010
34#define NFS4_ACCESS_EXECUTE 0x0020
35
36#define NFS4_FH_PERSISTENT 0x0000
37#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
38#define NFS4_FH_VOLATILE_ANY 0x0002
39#define NFS4_FH_VOL_MIGRATION 0x0004
40#define NFS4_FH_VOL_RENAME 0x0008
41
42#define NFS4_OPEN_RESULT_CONFIRM 0x0002
43#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
44
45#define NFS4_SHARE_ACCESS_MASK 0x000F
46#define NFS4_SHARE_ACCESS_READ 0x0001
47#define NFS4_SHARE_ACCESS_WRITE 0x0002
48#define NFS4_SHARE_ACCESS_BOTH 0x0003
49#define NFS4_SHARE_DENY_READ 0x0001
50#define NFS4_SHARE_DENY_WRITE 0x0002
51#define NFS4_SHARE_DENY_BOTH 0x0003
52
53/* nfs41 */
54#define NFS4_SHARE_WANT_MASK 0xFF00
55#define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000
56#define NFS4_SHARE_WANT_READ_DELEG 0x0100
57#define NFS4_SHARE_WANT_WRITE_DELEG 0x0200
58#define NFS4_SHARE_WANT_ANY_DELEG 0x0300
59#define NFS4_SHARE_WANT_NO_DELEG 0x0400
60#define NFS4_SHARE_WANT_CANCEL 0x0500
61
62#define NFS4_SHARE_WHEN_MASK 0xF0000
63#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
64#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
65
66#define NFS4_CDFC4_FORE 0x1
67#define NFS4_CDFC4_BACK 0x2
68#define NFS4_CDFC4_BOTH 0x3
69#define NFS4_CDFC4_FORE_OR_BOTH 0x3
70#define NFS4_CDFC4_BACK_OR_BOTH 0x7
71
72#define NFS4_CDFS4_FORE 0x1
73#define NFS4_CDFS4_BACK 0x2
74#define NFS4_CDFS4_BOTH 0x3
75
76#define NFS4_SET_TO_SERVER_TIME 0
77#define NFS4_SET_TO_CLIENT_TIME 1
78
79#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
80#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
81#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
82#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
83
84#define ACL4_SUPPORT_ALLOW_ACL 0x01
85#define ACL4_SUPPORT_DENY_ACL 0x02
86#define ACL4_SUPPORT_AUDIT_ACL 0x04
87#define ACL4_SUPPORT_ALARM_ACL 0x08
88
89#define NFS4_ACE_FILE_INHERIT_ACE 0x00000001
90#define NFS4_ACE_DIRECTORY_INHERIT_ACE 0x00000002
91#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
92#define NFS4_ACE_INHERIT_ONLY_ACE 0x00000008
93#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
94#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
95#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
96
97#define NFS4_ACE_READ_DATA 0x00000001
98#define NFS4_ACE_LIST_DIRECTORY 0x00000001
99#define NFS4_ACE_WRITE_DATA 0x00000002
100#define NFS4_ACE_ADD_FILE 0x00000002
101#define NFS4_ACE_APPEND_DATA 0x00000004
102#define NFS4_ACE_ADD_SUBDIRECTORY 0x00000004
103#define NFS4_ACE_READ_NAMED_ATTRS 0x00000008
104#define NFS4_ACE_WRITE_NAMED_ATTRS 0x00000010
105#define NFS4_ACE_EXECUTE 0x00000020
106#define NFS4_ACE_DELETE_CHILD 0x00000040
107#define NFS4_ACE_READ_ATTRIBUTES 0x00000080
108#define NFS4_ACE_WRITE_ATTRIBUTES 0x00000100
109#define NFS4_ACE_DELETE 0x00010000
110#define NFS4_ACE_READ_ACL 0x00020000
111#define NFS4_ACE_WRITE_ACL 0x00040000
112#define NFS4_ACE_WRITE_OWNER 0x00080000
113#define NFS4_ACE_SYNCHRONIZE 0x00100000
114#define NFS4_ACE_GENERIC_READ 0x00120081
115#define NFS4_ACE_GENERIC_WRITE 0x00160106
116#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
117#define NFS4_ACE_MASK_ALL 0x001F01FF
118
119#define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001
120#define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002
121#define EXCHGID4_FLAG_BIND_PRINC_STATEID 0x00000100
122
123#define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000
124#define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000
125#define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000
126#define EXCHGID4_FLAG_MASK_PNFS 0x00070000
127
128#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
129#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
130/*
131 * Since the validity of these bits depends on whether
132 * they're set in the argument or response, have separate
133 * invalid flag masks for arg (_A) and resp (_R).
134 */
135#define EXCHGID4_FLAG_MASK_A 0x40070103
136#define EXCHGID4_FLAG_MASK_R 0x80070103
137
138#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
139#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
140#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004
141#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008
142#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
143#define SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020
144#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
145#define SEQ4_STATUS_LEASE_MOVED 0x00000080
146#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
147#define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200
148#define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400
149
150#define NFS4_SECINFO_STYLE4_CURRENT_FH 0
151#define NFS4_SECINFO_STYLE4_PARENT 1
152
153#define NFS4_MAX_UINT64 (~(u64)0)
154
155/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
156 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
157 */
158#define NFS4_MAX_OPS 8
159
160/* Our NFS4 client back channel server only wants the cb_sequene and the
161 * actual operation per compound
162 */
163#define NFS4_MAX_BACK_CHANNEL_OPS 2
164
165enum nfs4_acl_whotype {
166 NFS4_ACL_WHO_NAMED = 0,
167 NFS4_ACL_WHO_OWNER,
168 NFS4_ACL_WHO_GROUP,
169 NFS4_ACL_WHO_EVERYONE,
170};
171
172#ifdef __KERNEL__
173#include <linux/list.h> 15#include <linux/list.h>
16#include <uapi/linux/nfs4.h>
174 17
175struct nfs4_ace { 18struct nfs4_ace {
176 uint32_t type; 19 uint32_t type;
@@ -673,10 +516,3 @@ struct nfs4_deviceid {
673}; 516};
674 517
675#endif 518#endif
676#endif
677
678/*
679 * Local variables:
680 * c-basic-offset: 8
681 * End:
682 */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 334a2f5f6bf..1cc25682b20 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -5,38 +5,11 @@
5 * 5 *
6 * OS-specific nfs filesystem definitions and declarations 6 * OS-specific nfs filesystem definitions and declarations
7 */ 7 */
8
9#ifndef _LINUX_NFS_FS_H 8#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 9#define _LINUX_NFS_FS_H
11 10
12#include <linux/magic.h> 11#include <uapi/linux/nfs_fs.h>
13
14/* Default timeout values */
15#define NFS_DEF_UDP_TIMEO (11)
16#define NFS_DEF_UDP_RETRANS (3)
17#define NFS_DEF_TCP_TIMEO (600)
18#define NFS_DEF_TCP_RETRANS (2)
19
20#define NFS_MAX_UDP_TIMEOUT (60*HZ)
21#define NFS_MAX_TCP_TIMEOUT (600*HZ)
22 12
23#define NFS_DEF_ACREGMIN (3)
24#define NFS_DEF_ACREGMAX (60)
25#define NFS_DEF_ACDIRMIN (30)
26#define NFS_DEF_ACDIRMAX (60)
27
28/*
29 * When flushing a cluster of dirty pages, there can be different
30 * strategies:
31 */
32#define FLUSH_SYNC 1 /* file being synced, or contention */
33#define FLUSH_STABLE 4 /* commit to stable storage */
34#define FLUSH_LOWPRI 8 /* low priority background flush */
35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
36#define FLUSH_COND_STABLE 32 /* conditional stable write - only stable
37 * if everything fits in one RPC */
38
39#ifdef __KERNEL__
40 13
41/* 14/*
42 * Enable dprintk() debugging support for nfs client. 15 * Enable dprintk() debugging support for nfs client.
@@ -613,29 +586,6 @@ nfs_fileid_to_ino_t(u64 fileid)
613 586
614#define NFS_JUKEBOX_RETRY_TIME (5 * HZ) 587#define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
615 588
616#endif /* __KERNEL__ */
617
618/*
619 * NFS debug flags
620 */
621#define NFSDBG_VFS 0x0001
622#define NFSDBG_DIRCACHE 0x0002
623#define NFSDBG_LOOKUPCACHE 0x0004
624#define NFSDBG_PAGECACHE 0x0008
625#define NFSDBG_PROC 0x0010
626#define NFSDBG_XDR 0x0020
627#define NFSDBG_FILE 0x0040
628#define NFSDBG_ROOT 0x0080
629#define NFSDBG_CALLBACK 0x0100
630#define NFSDBG_CLIENT 0x0200
631#define NFSDBG_MOUNT 0x0400
632#define NFSDBG_FSCACHE 0x0800
633#define NFSDBG_PNFS 0x1000
634#define NFSDBG_PNFS_LD 0x2000
635#define NFSDBG_STATE 0x4000
636#define NFSDBG_ALL 0xFFFF
637
638#ifdef __KERNEL__
639 589
640# undef ifdebug 590# undef ifdebug
641# ifdef NFS_DEBUG 591# ifdef NFS_DEBUG
@@ -645,6 +595,4 @@ nfs_fileid_to_ino_t(u64 fileid)
645# define ifdebug(fac) if (0) 595# define ifdebug(fac) if (0)
646# define NFS_IFDEBUG(x) 596# define NFS_IFDEBUG(x)
647# endif 597# endif
648#endif /* __KERNEL */
649
650#endif 598#endif
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index ece91c57ad7..2dcef3ab58b 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -33,35 +33,11 @@
33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */ 35 */
36
37#ifndef NFS_IDMAP_H 36#ifndef NFS_IDMAP_H
38#define NFS_IDMAP_H 37#define NFS_IDMAP_H
39 38
40#include <linux/types.h> 39#include <uapi/linux/nfs_idmap.h>
41
42/* XXX from bits/utmp.h */
43#define IDMAP_NAMESZ 128
44
45#define IDMAP_TYPE_USER 0
46#define IDMAP_TYPE_GROUP 1
47
48#define IDMAP_CONV_IDTONAME 0
49#define IDMAP_CONV_NAMETOID 1
50 40
51#define IDMAP_STATUS_INVALIDMSG 0x01
52#define IDMAP_STATUS_AGAIN 0x02
53#define IDMAP_STATUS_LOOKUPFAIL 0x04
54#define IDMAP_STATUS_SUCCESS 0x08
55
56struct idmap_msg {
57 __u8 im_type;
58 __u8 im_conv;
59 char im_name[IDMAP_NAMESZ];
60 __u32 im_id;
61 __u8 im_status;
62};
63
64#ifdef __KERNEL__
65 41
66/* Forward declaration to make this header independent of others */ 42/* Forward declaration to make this header independent of others */
67struct nfs_client; 43struct nfs_client;
@@ -97,6 +73,4 @@ int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t);
97int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t); 73int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t);
98 74
99extern unsigned int nfs_idmap_cache_timeout; 75extern unsigned int nfs_idmap_cache_timeout;
100#endif /* __KERNEL__ */
101
102#endif /* NFS_IDMAP_H */ 76#endif /* NFS_IDMAP_H */
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index fabcb1e5c46..5e69e67b31a 100644
--- a/include/linux/nfsacl.h
+++ b/include/linux/nfsacl.h
@@ -6,30 +6,10 @@
6#ifndef __LINUX_NFSACL_H 6#ifndef __LINUX_NFSACL_H
7#define __LINUX_NFSACL_H 7#define __LINUX_NFSACL_H
8 8
9#define NFS_ACL_PROGRAM 100227
10
11#define ACLPROC2_GETACL 1
12#define ACLPROC2_SETACL 2
13#define ACLPROC2_GETATTR 3
14#define ACLPROC2_ACCESS 4
15
16#define ACLPROC3_GETACL 1
17#define ACLPROC3_SETACL 2
18
19
20/* Flags for the getacl/setacl mode */
21#define NFS_ACL 0x0001
22#define NFS_ACLCNT 0x0002
23#define NFS_DFACL 0x0004
24#define NFS_DFACLCNT 0x0008
25
26/* Flag for Default ACL entries */
27#define NFS_ACL_DEFAULT 0x1000
28
29#ifdef __KERNEL__
30 9
31#include <linux/posix_acl.h> 10#include <linux/posix_acl.h>
32#include <linux/sunrpc/xdr.h> 11#include <linux/sunrpc/xdr.h>
12#include <uapi/linux/nfsacl.h>
33 13
34/* Maximum number of ACL entries over NFS */ 14/* Maximum number of ACL entries over NFS */
35#define NFS_ACL_MAX_ENTRIES 1024 15#define NFS_ACL_MAX_ENTRIES 1024
@@ -58,5 +38,4 @@ extern int
58nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt, 38nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt,
59 struct posix_acl **pacl); 39 struct posix_acl **pacl);
60 40
61#endif /* __KERNEL__ */
62#endif /* __LINUX_NFSACL_H */ 41#endif /* __LINUX_NFSACL_H */
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index e137b3c486a..a8696bbdfbc 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -8,236 +8,12 @@
8 Some of the constants in here are from the corresponding 8 Some of the constants in here are from the corresponding
9 NetBSD/OpenBSD header file, by Allen Briggs. We figured out the 9 NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
10 rest of them on our own. */ 10 rest of them on our own. */
11
12#ifndef LINUX_NUBUS_H 11#ifndef LINUX_NUBUS_H
13#define LINUX_NUBUS_H 12#define LINUX_NUBUS_H
14 13
15#include <linux/types.h>
16#ifdef __KERNEL__
17#include <asm/nubus.h> 14#include <asm/nubus.h>
18#endif 15#include <uapi/linux/nubus.h>
19
20enum nubus_category {
21 NUBUS_CAT_BOARD = 0x0001,
22 NUBUS_CAT_DISPLAY = 0x0003,
23 NUBUS_CAT_NETWORK = 0x0004,
24 NUBUS_CAT_COMMUNICATIONS = 0x0006,
25 NUBUS_CAT_FONT = 0x0009,
26 NUBUS_CAT_CPU = 0x000A,
27 /* For lack of a better name */
28 NUBUS_CAT_DUODOCK = 0x0020
29};
30
31enum nubus_type_network {
32 NUBUS_TYPE_ETHERNET = 0x0001,
33 NUBUS_TYPE_RS232 = 0x0002
34};
35
36enum nubus_type_display {
37 NUBUS_TYPE_VIDEO = 0x0001
38};
39
40enum nubus_type_cpu {
41 NUBUS_TYPE_68020 = 0x0003,
42 NUBUS_TYPE_68030 = 0x0004,
43 NUBUS_TYPE_68040 = 0x0005
44};
45
46/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
47 * 68030 motherboards: <10,4,0,24>
48 * 68040 motherboards: <10,5,0,24>
49 * DuoDock Plus: <32,1,1,2>
50 *
51 * Toby Frame Buffer card: <3,1,1,1>
52 * RBV built-in video (IIci): <3,1,1,24>
53 * Valkyrie built-in video (Q630): <3,1,1,46>
54 * Macintosh Display Card: <3,1,1,25>
55 * Sonora built-in video (P460): <3,1,1,34>
56 * Jet framebuffer (DuoDock Plus): <3,1,1,41>
57 *
58 * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
59 * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
60 * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
61 * Sonic Systems Ethernet A-Series Card: <4,1,268,256>
62 * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
63 * ROM on the above card: <2,1,0,0>
64 * Cabletron ethernet card: <4,1,1,265>
65 * Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
66 * Kinetics EtherPort IIN: <4,1,259,262>
67 * API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
68 *
69 * Add your devices to the list! You can obtain the "Slots" utility
70 * from Apple's FTP site at:
71 * ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
72 *
73 * Alternately, TattleTech can be found at any Info-Mac mirror site.
74 * or from its distribution site: ftp://ftp.decismkr.com/dms
75 */
76
77/* DrSW: Uniquely identifies the software interface to a board. This
78 is usually the one you want to look at when writing a driver. It's
79 not as useful as you think, though, because as we should know by
80 now (duh), "Apple Compatible" can mean a lot of things... */
81
82/* Add known DrSW values here */
83enum nubus_drsw {
84 /* NUBUS_CAT_DISPLAY */
85 NUBUS_DRSW_APPLE = 0x0001,
86 NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
87
88 /* NUBUS_CAT_NETWORK */
89 NUBUS_DRSW_3COM = 0x0000,
90 NUBUS_DRSW_CABLETRON = 0x0001,
91 NUBUS_DRSW_SONIC_LC = 0x0001,
92 NUBUS_DRSW_KINETICS = 0x0103,
93 NUBUS_DRSW_ASANTE = 0x0104,
94 NUBUS_DRSW_TECHWORKS = 0x0109,
95 NUBUS_DRSW_DAYNA = 0x010b,
96 NUBUS_DRSW_FARALLON = 0x010c,
97 NUBUS_DRSW_APPLE_SN = 0x010f,
98 NUBUS_DRSW_DAYNA2 = 0x0115,
99 NUBUS_DRSW_FOCUS = 0x011a,
100 NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
101 NUBUS_DRSW_DAYNA_LC = 0x011e,
102
103 /* NUBUS_CAT_CPU */
104 NUBUS_DRSW_NONE = 0x0000,
105};
106
107/* DrHW: Uniquely identifies the hardware interface to a board (or at
108 least, it should... some video cards are known to incorrectly
109 identify themselves as Toby cards) */
110
111/* Add known DrHW values here */
112enum nubus_drhw {
113 /* NUBUS_CAT_DISPLAY */
114 NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
115 NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
116 NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
117 NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
118 NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
119 NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
120 NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
121 NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
122 NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
123 NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
124 NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
125 NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
126 NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
127 NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
128 NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
129 NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
130 NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
131 NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
132 NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
133 NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
134 NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
135 NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
136 NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
137 NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
138 NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
139 NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
140 NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
141 NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
142 NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
143 NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
144 NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
145
146 /* NUBUS_CAT_NETWORK */
147 NUBUS_DRHW_INTERLAN = 0x0100,
148 NUBUS_DRHW_SMC9194 = 0x0101,
149 NUBUS_DRHW_KINETICS = 0x0106,
150 NUBUS_DRHW_CABLETRON = 0x0109,
151 NUBUS_DRHW_ASANTE_LC = 0x010f,
152 NUBUS_DRHW_SONIC = 0x0110,
153 NUBUS_DRHW_TECHWORKS = 0x0112,
154 NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
155 NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
156 NUBUS_DRHW_FOCUS = 0x011c,
157 NUBUS_DRHW_SONNET = 0x011d,
158};
159 16
160/* Resource IDs: These are the identifiers for the various weird and
161 wonderful tidbits of information that may or may not reside in the
162 NuBus ROM directory. */
163enum nubus_res_id {
164 NUBUS_RESID_TYPE = 0x0001,
165 NUBUS_RESID_NAME = 0x0002,
166 NUBUS_RESID_ICON = 0x0003,
167 NUBUS_RESID_DRVRDIR = 0x0004,
168 NUBUS_RESID_LOADREC = 0x0005,
169 NUBUS_RESID_BOOTREC = 0x0006,
170 NUBUS_RESID_FLAGS = 0x0007,
171 NUBUS_RESID_HWDEVID = 0x0008,
172 NUBUS_RESID_MINOR_BASEOS = 0x000a,
173 NUBUS_RESID_MINOR_LENGTH = 0x000b,
174 NUBUS_RESID_MAJOR_BASEOS = 0x000c,
175 NUBUS_RESID_MAJOR_LENGTH = 0x000d,
176 NUBUS_RESID_CICN = 0x000f,
177 NUBUS_RESID_ICL8 = 0x0010,
178 NUBUS_RESID_ICL4 = 0x0011,
179};
180
181/* Category-specific resources. */
182enum nubus_board_res_id {
183 NUBUS_RESID_BOARDID = 0x0020,
184 NUBUS_RESID_PRAMINITDATA = 0x0021,
185 NUBUS_RESID_PRIMARYINIT = 0x0022,
186 NUBUS_RESID_TIMEOUTCONST = 0x0023,
187 NUBUS_RESID_VENDORINFO = 0x0024,
188 NUBUS_RESID_BOARDFLAGS = 0x0025,
189 NUBUS_RESID_SECONDINIT = 0x0026,
190
191 /* Not sure why Apple put these next two in here */
192 NUBUS_RESID_VIDNAMES = 0x0041,
193 NUBUS_RESID_VIDMODES = 0x007e
194};
195
196/* Fields within the vendor info directory */
197enum nubus_vendor_res_id {
198 NUBUS_RESID_VEND_ID = 0x0001,
199 NUBUS_RESID_VEND_SERIAL = 0x0002,
200 NUBUS_RESID_VEND_REV = 0x0003,
201 NUBUS_RESID_VEND_PART = 0x0004,
202 NUBUS_RESID_VEND_DATE = 0x0005
203};
204
205enum nubus_net_res_id {
206 NUBUS_RESID_MAC_ADDRESS = 0x0080
207};
208
209enum nubus_cpu_res_id {
210 NUBUS_RESID_MEMINFO = 0x0081,
211 NUBUS_RESID_ROMINFO = 0x0082
212};
213
214enum nubus_display_res_id {
215 NUBUS_RESID_GAMMADIR = 0x0040,
216 NUBUS_RESID_FIRSTMODE = 0x0080,
217 NUBUS_RESID_SECONDMODE = 0x0081,
218 NUBUS_RESID_THIRDMODE = 0x0082,
219 NUBUS_RESID_FOURTHMODE = 0x0083,
220 NUBUS_RESID_FIFTHMODE = 0x0084,
221 NUBUS_RESID_SIXTHMODE = 0x0085
222};
223
224struct nubus_dir
225{
226 unsigned char *base;
227 unsigned char *ptr;
228 int done;
229 int mask;
230};
231
232struct nubus_dirent
233{
234 unsigned char *base;
235 unsigned char type;
236 __u32 data; /* Actually 24bits used */
237 int mask;
238};
239
240#ifdef __KERNEL__
241struct nubus_board { 17struct nubus_board {
242 struct nubus_board* next; 18 struct nubus_board* next;
243 struct nubus_dev* first_dev; 19 struct nubus_dev* first_dev;
@@ -352,12 +128,4 @@ void nubus_get_rsrc_mem(void* dest,
352void nubus_get_rsrc_str(void* dest, 128void nubus_get_rsrc_str(void* dest,
353 const struct nubus_dirent *dirent, 129 const struct nubus_dirent *dirent,
354 int maxlen); 130 int maxlen);
355#endif /* __KERNEL__ */
356
357/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
358static inline void *nubus_slot_addr(int slot)
359{
360 return (void *)(0xF0000000|(slot<<24));
361}
362
363#endif /* LINUX_NUBUS_H */ 131#endif /* LINUX_NUBUS_H */
diff --git a/include/linux/nvram.h b/include/linux/nvram.h
index 9189829c131..cf0ff555a6a 100644
--- a/include/linux/nvram.h
+++ b/include/linux/nvram.h
@@ -1,18 +1,8 @@
1#ifndef _LINUX_NVRAM_H 1#ifndef _LINUX_NVRAM_H
2#define _LINUX_NVRAM_H 2#define _LINUX_NVRAM_H
3 3
4#include <linux/ioctl.h> 4#include <uapi/linux/nvram.h>
5 5
6/* /dev/nvram ioctls */
7#define NVRAM_INIT _IO('p', 0x40) /* initialize NVRAM and set checksum */
8#define NVRAM_SETCKS _IO('p', 0x41) /* recalculate checksum */
9
10/* for all current systems, this is where NVRAM starts */
11#define NVRAM_FIRST_BYTE 14
12/* all these functions expect an NVRAM offset, not an absolute */
13#define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE)
14
15#ifdef __KERNEL__
16/* __foo is foo without grabbing the rtc_lock - get it yourself */ 6/* __foo is foo without grabbing the rtc_lock - get it yourself */
17extern unsigned char __nvram_read_byte(int i); 7extern unsigned char __nvram_read_byte(int i);
18extern unsigned char nvram_read_byte(int i); 8extern unsigned char nvram_read_byte(int i);
@@ -20,6 +10,4 @@ extern void __nvram_write_byte(unsigned char c, int i);
20extern void nvram_write_byte(unsigned char c, int i); 10extern void nvram_write_byte(unsigned char c, int i);
21extern int __nvram_check_checksum(void); 11extern int __nvram_check_checksum(void);
22extern int nvram_check_checksum(void); 12extern int nvram_check_checksum(void);
23#endif
24
25#endif /* _LINUX_NVRAM_H */ 13#endif /* _LINUX_NVRAM_H */
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index 85af8184691..d1f4dccaeed 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -20,205 +20,11 @@
20 * with this program; if not, write to the Free Software Foundation, Inc., 20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */ 22 */
23
24#ifndef __LINUX_OMAPFB_H__ 23#ifndef __LINUX_OMAPFB_H__
25#define __LINUX_OMAPFB_H__ 24#define __LINUX_OMAPFB_H__
26 25
27#include <linux/fb.h> 26#include <uapi/linux/omapfb.h>
28#include <linux/ioctl.h>
29#include <linux/types.h>
30
31/* IOCTL commands. */
32
33#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
34#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
35#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
36#define OMAP_IO(num) _IO('O', num)
37
38#define OMAPFB_MIRROR OMAP_IOW(31, int)
39#define OMAPFB_SYNC_GFX OMAP_IO(37)
40#define OMAPFB_VSYNC OMAP_IO(38)
41#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
42#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
43#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
44#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
45#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
46#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
47#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
48#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
49#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
50#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
51#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
52#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
53#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
54#define OMAPFB_WAITFORVSYNC OMAP_IO(57)
55#define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
56#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
61
62#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
63#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
64#define OMAPFB_CAPS_PANEL_MASK 0xff000000
65
66#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
67#define OMAPFB_CAPS_TEARSYNC 0x00002000
68#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
69#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
70#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
71#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
72#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
73#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
74#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
75
76/* Values from DSP must map to lower 16-bits */
77#define OMAPFB_FORMAT_MASK 0x00ff
78#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
79#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
80#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
81#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
82#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
83
84#define OMAPFB_MEMTYPE_SDRAM 0
85#define OMAPFB_MEMTYPE_SRAM 1
86#define OMAPFB_MEMTYPE_MAX 1
87
88#define OMAPFB_MEM_IDX_ENABLED 0x80
89#define OMAPFB_MEM_IDX_MASK 0x7f
90
91enum omapfb_color_format {
92 OMAPFB_COLOR_RGB565 = 0,
93 OMAPFB_COLOR_YUV422,
94 OMAPFB_COLOR_YUV420,
95 OMAPFB_COLOR_CLUT_8BPP,
96 OMAPFB_COLOR_CLUT_4BPP,
97 OMAPFB_COLOR_CLUT_2BPP,
98 OMAPFB_COLOR_CLUT_1BPP,
99 OMAPFB_COLOR_RGB444,
100 OMAPFB_COLOR_YUY422,
101
102 OMAPFB_COLOR_ARGB16,
103 OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */
104 OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */
105 OMAPFB_COLOR_ARGB32,
106 OMAPFB_COLOR_RGBA32,
107 OMAPFB_COLOR_RGBX32,
108};
109
110struct omapfb_update_window {
111 __u32 x, y;
112 __u32 width, height;
113 __u32 format;
114 __u32 out_x, out_y;
115 __u32 out_width, out_height;
116 __u32 reserved[8];
117};
118 27
119struct omapfb_update_window_old {
120 __u32 x, y;
121 __u32 width, height;
122 __u32 format;
123};
124
125enum omapfb_plane {
126 OMAPFB_PLANE_GFX = 0,
127 OMAPFB_PLANE_VID1,
128 OMAPFB_PLANE_VID2,
129};
130
131enum omapfb_channel_out {
132 OMAPFB_CHANNEL_OUT_LCD = 0,
133 OMAPFB_CHANNEL_OUT_DIGIT,
134};
135
136struct omapfb_plane_info {
137 __u32 pos_x;
138 __u32 pos_y;
139 __u8 enabled;
140 __u8 channel_out;
141 __u8 mirror;
142 __u8 mem_idx;
143 __u32 out_width;
144 __u32 out_height;
145 __u32 reserved2[12];
146};
147
148struct omapfb_mem_info {
149 __u32 size;
150 __u8 type;
151 __u8 reserved[3];
152};
153
154struct omapfb_caps {
155 __u32 ctrl;
156 __u32 plane_color;
157 __u32 wnd_color;
158};
159
160enum omapfb_color_key_type {
161 OMAPFB_COLOR_KEY_DISABLED = 0,
162 OMAPFB_COLOR_KEY_GFX_DST,
163 OMAPFB_COLOR_KEY_VID_SRC,
164};
165
166struct omapfb_color_key {
167 __u8 channel_out;
168 __u32 background;
169 __u32 trans_key;
170 __u8 key_type;
171};
172
173enum omapfb_update_mode {
174 OMAPFB_UPDATE_DISABLED = 0,
175 OMAPFB_AUTO_UPDATE,
176 OMAPFB_MANUAL_UPDATE
177};
178
179struct omapfb_memory_read {
180 __u16 x;
181 __u16 y;
182 __u16 w;
183 __u16 h;
184 size_t buffer_size;
185 void __user *buffer;
186};
187
188struct omapfb_ovl_colormode {
189 __u8 overlay_idx;
190 __u8 mode_idx;
191 __u32 bits_per_pixel;
192 __u32 nonstd;
193 struct fb_bitfield red;
194 struct fb_bitfield green;
195 struct fb_bitfield blue;
196 struct fb_bitfield transp;
197};
198
199struct omapfb_vram_info {
200 __u32 total;
201 __u32 free;
202 __u32 largest_free_block;
203 __u32 reserved[5];
204};
205
206struct omapfb_tearsync_info {
207 __u8 enabled;
208 __u8 reserved1[3];
209 __u16 line;
210 __u16 reserved2;
211};
212
213struct omapfb_display_info {
214 __u16 xres;
215 __u16 yres;
216 __u32 width; /* phys width of the display in micrometers */
217 __u32 height; /* phys height of the display in micrometers */
218 __u32 reserved[5];
219};
220
221#ifdef __KERNEL__
222 28
223struct omap_lcd_config { 29struct omap_lcd_config {
224 char panel_name[16]; 30 char panel_name[16];
@@ -233,6 +39,4 @@ struct omapfb_platform_data {
233 39
234void __init omapfb_set_lcd_config(const struct omap_lcd_config *config); 40void __init omapfb_set_lcd_config(const struct omap_lcd_config *config);
235 41
236#endif
237
238#endif /* __OMAPFB_H */ 42#endif /* __OMAPFB_H */
diff --git a/include/linux/oom.h b/include/linux/oom.h
index d36a8221f58..fb9826847b8 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -1,18 +1,11 @@
1#ifndef __INCLUDE_LINUX_OOM_H 1#ifndef __INCLUDE_LINUX_OOM_H
2#define __INCLUDE_LINUX_OOM_H 2#define __INCLUDE_LINUX_OOM_H
3 3
4/*
5 * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for
6 * pid.
7 */
8#define OOM_SCORE_ADJ_MIN (-1000)
9#define OOM_SCORE_ADJ_MAX 1000
10
11#ifdef __KERNEL__
12 4
13#include <linux/sched.h> 5#include <linux/sched.h>
14#include <linux/types.h> 6#include <linux/types.h>
15#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <uapi/linux/oom.h>
16 9
17struct zonelist; 10struct zonelist;
18struct notifier_block; 11struct notifier_block;
@@ -82,5 +75,4 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p);
82extern int sysctl_oom_dump_tasks; 75extern int sysctl_oom_dump_tasks;
83extern int sysctl_oom_kill_allocating_task; 76extern int sysctl_oom_kill_allocating_task;
84extern int sysctl_panic_on_oom; 77extern int sysctl_panic_on_oom;
85#endif /* __KERNEL__*/
86#endif /* _INCLUDE_LINUX_OOM_H */ 78#endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 106c2ca9440..c22f1254732 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -3,96 +3,9 @@
3 * the GNU Free Documentation License, Version 1.1 or any later version 3 * the GNU Free Documentation License, Version 1.1 or any later version
4 * published by the Free Software Foundation. 4 * published by the Free Software Foundation.
5 */ 5 */
6
7#ifndef _PARPORT_H_ 6#ifndef _PARPORT_H_
8#define _PARPORT_H_ 7#define _PARPORT_H_
9 8
10/* Start off with user-visible constants */
11
12/* Maximum of 16 ports per machine */
13#define PARPORT_MAX 16
14
15/* Magic numbers */
16#define PARPORT_IRQ_NONE -1
17#define PARPORT_DMA_NONE -1
18#define PARPORT_IRQ_AUTO -2
19#define PARPORT_DMA_AUTO -2
20#define PARPORT_DMA_NOFIFO -3
21#define PARPORT_DISABLE -2
22#define PARPORT_IRQ_PROBEONLY -3
23#define PARPORT_IOHI_AUTO -1
24
25#define PARPORT_CONTROL_STROBE 0x1
26#define PARPORT_CONTROL_AUTOFD 0x2
27#define PARPORT_CONTROL_INIT 0x4
28#define PARPORT_CONTROL_SELECT 0x8
29
30#define PARPORT_STATUS_ERROR 0x8
31#define PARPORT_STATUS_SELECT 0x10
32#define PARPORT_STATUS_PAPEROUT 0x20
33#define PARPORT_STATUS_ACK 0x40
34#define PARPORT_STATUS_BUSY 0x80
35
36/* Type classes for Plug-and-Play probe. */
37typedef enum {
38 PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
39 PARPORT_CLASS_PRINTER,
40 PARPORT_CLASS_MODEM,
41 PARPORT_CLASS_NET,
42 PARPORT_CLASS_HDC, /* Hard disk controller */
43 PARPORT_CLASS_PCMCIA,
44 PARPORT_CLASS_MEDIA, /* Multimedia device */
45 PARPORT_CLASS_FDC, /* Floppy disk controller */
46 PARPORT_CLASS_PORTS,
47 PARPORT_CLASS_SCANNER,
48 PARPORT_CLASS_DIGCAM,
49 PARPORT_CLASS_OTHER, /* Anything else */
50 PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
51 PARPORT_CLASS_SCSIADAPTER
52} parport_device_class;
53
54/* The "modes" entry in parport is a bit field representing the
55 capabilities of the hardware. */
56#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */
57#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */
58#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */
59#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */
60#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
61#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */
62#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
63
64/* IEEE1284 modes:
65 Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
66 'extensibility request' values. Others are special.
67 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */
68#define IEEE1284_MODE_NIBBLE 0
69#define IEEE1284_MODE_BYTE (1<<0)
70#define IEEE1284_MODE_COMPAT (1<<8)
71#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */
72#define IEEE1284_MODE_ECP (1<<4)
73#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))
74#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */
75#define IEEE1284_MODE_EPP (1<<6)
76#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
77#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
78#define IEEE1284_DEVICEID (1<<2) /* This is a flag */
79#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
80 * extensibility link to
81 * be requested, using
82 * bits 0-6. */
83
84/* For the benefit of parport_read/write, you can use these with
85 * parport_negotiate to use address operations. They have no effect
86 * other than to make parport_read/write use address transfers. */
87#define IEEE1284_ADDR (1<<13) /* This is a flag */
88#define IEEE1284_DATA 0 /* So is this */
89
90/* Flags for block transfer operations. */
91#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
92#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
93
94/* The rest is for the kernel only */
95#ifdef __KERNEL__
96 9
97#include <linux/jiffies.h> 10#include <linux/jiffies.h>
98#include <linux/proc_fs.h> 11#include <linux/proc_fs.h>
@@ -101,6 +14,7 @@ typedef enum {
101#include <linux/irqreturn.h> 14#include <linux/irqreturn.h>
102#include <linux/semaphore.h> 15#include <linux/semaphore.h>
103#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <uapi/linux/parport.h>
104 18
105/* Define this later. */ 19/* Define this later. */
106struct parport; 20struct parport;
@@ -564,5 +478,4 @@ extern int parport_device_proc_unregister(struct pardevice *device);
564extern unsigned long parport_default_timeslice; 478extern unsigned long parport_default_timeslice;
565extern int parport_default_spintime; 479extern int parport_default_spintime;
566 480
567#endif /* __KERNEL__ */
568#endif /* _PARPORT_H_ */ 481#endif /* _PARPORT_H_ */
diff --git a/include/linux/patchkey.h b/include/linux/patchkey.h
index aefda0ec6e6..97a919fc992 100644
--- a/include/linux/patchkey.h
+++ b/include/linux/patchkey.h
@@ -9,22 +9,12 @@
9 * Do not include this file directly. Please use <sys/soundcard.h> instead. 9 * Do not include this file directly. Please use <sys/soundcard.h> instead.
10 * For kernel code, use <linux/soundcard.h> 10 * For kernel code, use <linux/soundcard.h>
11 */ 11 */
12
13#ifndef _LINUX_PATCHKEY_H_INDIRECT
14#error "patchkey.h included directly"
15#endif
16
17#ifndef _LINUX_PATCHKEY_H 12#ifndef _LINUX_PATCHKEY_H
18#define _LINUX_PATCHKEY_H 13#define _LINUX_PATCHKEY_H
19 14
20/* Endian macros. */
21#ifdef __KERNEL__
22# include <asm/byteorder.h> 15# include <asm/byteorder.h>
23#else 16#include <uapi/linux/patchkey.h>
24# include <endian.h>
25#endif
26 17
27#if defined(__KERNEL__)
28# if defined(__BIG_ENDIAN) 18# if defined(__BIG_ENDIAN)
29# define _PATCHKEY(id) (0xfd00|id) 19# define _PATCHKEY(id) (0xfd00|id)
30# elif defined(__LITTLE_ENDIAN) 20# elif defined(__LITTLE_ENDIAN)
@@ -32,16 +22,4 @@
32# else 22# else
33# error "could not determine byte order" 23# error "could not determine byte order"
34# endif 24# endif
35#else
36#if defined(__BYTE_ORDER)
37# if __BYTE_ORDER == __BIG_ENDIAN
38# define _PATCHKEY(id) (0xfd00|id)
39# elif __BYTE_ORDER == __LITTLE_ENDIAN
40# define _PATCHKEY(id) ((id<<8)|0x00fd)
41# else
42# error "could not determine byte order"
43# endif
44#endif
45#endif
46
47#endif /* _LINUX_PATCHKEY_H */ 25#endif /* _LINUX_PATCHKEY_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index be1de01de1c..ee2179546c6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -13,32 +13,9 @@
13 * PCI to PCI Bridge Specification 13 * PCI to PCI Bridge Specification
14 * PCI System Design Guide 14 * PCI System Design Guide
15 */ 15 */
16
17#ifndef LINUX_PCI_H 16#ifndef LINUX_PCI_H
18#define LINUX_PCI_H 17#define LINUX_PCI_H
19 18
20#include <linux/pci_regs.h> /* The pci register defines */
21
22/*
23 * The PCI interface treats multi-function devices as independent
24 * devices. The slot/function address of each device is encoded
25 * in a single byte as follows:
26 *
27 * 7:3 = slot
28 * 2:0 = function
29 */
30#define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
31#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
32#define PCI_FUNC(devfn) ((devfn) & 0x07)
33
34/* Ioctls for /proc/bus/pci/X/Y nodes. */
35#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
36#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */
37#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */
38#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */
39#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */
40
41#ifdef __KERNEL__
42 19
43#include <linux/mod_devicetable.h> 20#include <linux/mod_devicetable.h>
44 21
@@ -53,6 +30,7 @@
53#include <linux/device.h> 30#include <linux/device.h>
54#include <linux/io.h> 31#include <linux/io.h>
55#include <linux/irqreturn.h> 32#include <linux/irqreturn.h>
33#include <uapi/linux/pci.h>
56 34
57/* Include the ID list */ 35/* Include the ID list */
58#include <linux/pci_ids.h> 36#include <linux/pci_ids.h>
@@ -1831,5 +1809,4 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
1831 */ 1809 */
1832struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev); 1810struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
1833 1811
1834#endif /* __KERNEL__ */
1835#endif /* LINUX_PCI_H */ 1812#endif /* LINUX_PCI_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index b4166cdfa7a..2e902359aee 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -14,606 +14,9 @@
14#ifndef _LINUX_PERF_EVENT_H 14#ifndef _LINUX_PERF_EVENT_H
15#define _LINUX_PERF_EVENT_H 15#define _LINUX_PERF_EVENT_H
16 16
17#include <linux/types.h> 17#include <uapi/linux/perf_event.h>
18#include <linux/ioctl.h>
19#include <asm/byteorder.h>
20 18
21/* 19/*
22 * User-space ABI bits:
23 */
24
25/*
26 * attr.type
27 */
28enum perf_type_id {
29 PERF_TYPE_HARDWARE = 0,
30 PERF_TYPE_SOFTWARE = 1,
31 PERF_TYPE_TRACEPOINT = 2,
32 PERF_TYPE_HW_CACHE = 3,
33 PERF_TYPE_RAW = 4,
34 PERF_TYPE_BREAKPOINT = 5,
35
36 PERF_TYPE_MAX, /* non-ABI */
37};
38
39/*
40 * Generalized performance event event_id types, used by the
41 * attr.event_id parameter of the sys_perf_event_open()
42 * syscall:
43 */
44enum perf_hw_id {
45 /*
46 * Common hardware events, generalized by the kernel:
47 */
48 PERF_COUNT_HW_CPU_CYCLES = 0,
49 PERF_COUNT_HW_INSTRUCTIONS = 1,
50 PERF_COUNT_HW_CACHE_REFERENCES = 2,
51 PERF_COUNT_HW_CACHE_MISSES = 3,
52 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
53 PERF_COUNT_HW_BRANCH_MISSES = 5,
54 PERF_COUNT_HW_BUS_CYCLES = 6,
55 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
56 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
57 PERF_COUNT_HW_REF_CPU_CYCLES = 9,
58
59 PERF_COUNT_HW_MAX, /* non-ABI */
60};
61
62/*
63 * Generalized hardware cache events:
64 *
65 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
66 * { read, write, prefetch } x
67 * { accesses, misses }
68 */
69enum perf_hw_cache_id {
70 PERF_COUNT_HW_CACHE_L1D = 0,
71 PERF_COUNT_HW_CACHE_L1I = 1,
72 PERF_COUNT_HW_CACHE_LL = 2,
73 PERF_COUNT_HW_CACHE_DTLB = 3,
74 PERF_COUNT_HW_CACHE_ITLB = 4,
75 PERF_COUNT_HW_CACHE_BPU = 5,
76 PERF_COUNT_HW_CACHE_NODE = 6,
77
78 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
79};
80
81enum perf_hw_cache_op_id {
82 PERF_COUNT_HW_CACHE_OP_READ = 0,
83 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
84 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
85
86 PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */
87};
88
89enum perf_hw_cache_op_result_id {
90 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
91 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
92
93 PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */
94};
95
96/*
97 * Special "software" events provided by the kernel, even if the hardware
98 * does not support performance events. These events measure various
99 * physical and sw events of the kernel (and allow the profiling of them as
100 * well):
101 */
102enum perf_sw_ids {
103 PERF_COUNT_SW_CPU_CLOCK = 0,
104 PERF_COUNT_SW_TASK_CLOCK = 1,
105 PERF_COUNT_SW_PAGE_FAULTS = 2,
106 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
107 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
108 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
111 PERF_COUNT_SW_EMULATION_FAULTS = 8,
112
113 PERF_COUNT_SW_MAX, /* non-ABI */
114};
115
116/*
117 * Bits that can be set in attr.sample_type to request information
118 * in the overflow packets.
119 */
120enum perf_event_sample_format {
121 PERF_SAMPLE_IP = 1U << 0,
122 PERF_SAMPLE_TID = 1U << 1,
123 PERF_SAMPLE_TIME = 1U << 2,
124 PERF_SAMPLE_ADDR = 1U << 3,
125 PERF_SAMPLE_READ = 1U << 4,
126 PERF_SAMPLE_CALLCHAIN = 1U << 5,
127 PERF_SAMPLE_ID = 1U << 6,
128 PERF_SAMPLE_CPU = 1U << 7,
129 PERF_SAMPLE_PERIOD = 1U << 8,
130 PERF_SAMPLE_STREAM_ID = 1U << 9,
131 PERF_SAMPLE_RAW = 1U << 10,
132 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
133 PERF_SAMPLE_REGS_USER = 1U << 12,
134 PERF_SAMPLE_STACK_USER = 1U << 13,
135
136 PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */
137};
138
139/*
140 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
141 *
142 * If the user does not pass priv level information via branch_sample_type,
143 * the kernel uses the event's priv level. Branch and event priv levels do
144 * not have to match. Branch priv level is checked for permissions.
145 *
146 * The branch types can be combined, however BRANCH_ANY covers all types
147 * of branches and therefore it supersedes all the other types.
148 */
149enum perf_branch_sample_type {
150 PERF_SAMPLE_BRANCH_USER = 1U << 0, /* user branches */
151 PERF_SAMPLE_BRANCH_KERNEL = 1U << 1, /* kernel branches */
152 PERF_SAMPLE_BRANCH_HV = 1U << 2, /* hypervisor branches */
153
154 PERF_SAMPLE_BRANCH_ANY = 1U << 3, /* any branch types */
155 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */
156 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */
157 PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */
158
159 PERF_SAMPLE_BRANCH_MAX = 1U << 7, /* non-ABI */
160};
161
162#define PERF_SAMPLE_BRANCH_PLM_ALL \
163 (PERF_SAMPLE_BRANCH_USER|\
164 PERF_SAMPLE_BRANCH_KERNEL|\
165 PERF_SAMPLE_BRANCH_HV)
166
167/*
168 * Values to determine ABI of the registers dump.
169 */
170enum perf_sample_regs_abi {
171 PERF_SAMPLE_REGS_ABI_NONE = 0,
172 PERF_SAMPLE_REGS_ABI_32 = 1,
173 PERF_SAMPLE_REGS_ABI_64 = 2,
174};
175
176/*
177 * The format of the data returned by read() on a perf event fd,
178 * as specified by attr.read_format:
179 *
180 * struct read_format {
181 * { u64 value;
182 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
183 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
184 * { u64 id; } && PERF_FORMAT_ID
185 * } && !PERF_FORMAT_GROUP
186 *
187 * { u64 nr;
188 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
189 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
190 * { u64 value;
191 * { u64 id; } && PERF_FORMAT_ID
192 * } cntr[nr];
193 * } && PERF_FORMAT_GROUP
194 * };
195 */
196enum perf_event_read_format {
197 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
198 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
199 PERF_FORMAT_ID = 1U << 2,
200 PERF_FORMAT_GROUP = 1U << 3,
201
202 PERF_FORMAT_MAX = 1U << 4, /* non-ABI */
203};
204
205#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
206#define PERF_ATTR_SIZE_VER1 72 /* add: config2 */
207#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */
208#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
209 /* add: sample_stack_user */
210
211/*
212 * Hardware event_id to monitor via a performance monitoring event:
213 */
214struct perf_event_attr {
215
216 /*
217 * Major type: hardware/software/tracepoint/etc.
218 */
219 __u32 type;
220
221 /*
222 * Size of the attr structure, for fwd/bwd compat.
223 */
224 __u32 size;
225
226 /*
227 * Type specific configuration information.
228 */
229 __u64 config;
230
231 union {
232 __u64 sample_period;
233 __u64 sample_freq;
234 };
235
236 __u64 sample_type;
237 __u64 read_format;
238
239 __u64 disabled : 1, /* off by default */
240 inherit : 1, /* children inherit it */
241 pinned : 1, /* must always be on PMU */
242 exclusive : 1, /* only group on PMU */
243 exclude_user : 1, /* don't count user */
244 exclude_kernel : 1, /* ditto kernel */
245 exclude_hv : 1, /* ditto hypervisor */
246 exclude_idle : 1, /* don't count when idle */
247 mmap : 1, /* include mmap data */
248 comm : 1, /* include comm data */
249 freq : 1, /* use freq, not period */
250 inherit_stat : 1, /* per task counts */
251 enable_on_exec : 1, /* next exec enables */
252 task : 1, /* trace fork/exit */
253 watermark : 1, /* wakeup_watermark */
254 /*
255 * precise_ip:
256 *
257 * 0 - SAMPLE_IP can have arbitrary skid
258 * 1 - SAMPLE_IP must have constant skid
259 * 2 - SAMPLE_IP requested to have 0 skid
260 * 3 - SAMPLE_IP must have 0 skid
261 *
262 * See also PERF_RECORD_MISC_EXACT_IP
263 */
264 precise_ip : 2, /* skid constraint */
265 mmap_data : 1, /* non-exec mmap data */
266 sample_id_all : 1, /* sample_type all events */
267
268 exclude_host : 1, /* don't count in host */
269 exclude_guest : 1, /* don't count in guest */
270
271 exclude_callchain_kernel : 1, /* exclude kernel callchains */
272 exclude_callchain_user : 1, /* exclude user callchains */
273
274 __reserved_1 : 41;
275
276 union {
277 __u32 wakeup_events; /* wakeup every n events */
278 __u32 wakeup_watermark; /* bytes before wakeup */
279 };
280
281 __u32 bp_type;
282 union {
283 __u64 bp_addr;
284 __u64 config1; /* extension of config */
285 };
286 union {
287 __u64 bp_len;
288 __u64 config2; /* extension of config1 */
289 };
290 __u64 branch_sample_type; /* enum perf_branch_sample_type */
291
292 /*
293 * Defines set of user regs to dump on samples.
294 * See asm/perf_regs.h for details.
295 */
296 __u64 sample_regs_user;
297
298 /*
299 * Defines size of the user stack to dump on samples.
300 */
301 __u32 sample_stack_user;
302
303 /* Align to u64. */
304 __u32 __reserved_2;
305};
306
307#define perf_flags(attr) (*(&(attr)->read_format + 1))
308
309/*
310 * Ioctls that can be done on a perf event fd:
311 */
312#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
313#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
314#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
315#define PERF_EVENT_IOC_RESET _IO ('$', 3)
316#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
317#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
318#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
319
320enum perf_event_ioc_flags {
321 PERF_IOC_FLAG_GROUP = 1U << 0,
322};
323
324/*
325 * Structure of the page that can be mapped via mmap
326 */
327struct perf_event_mmap_page {
328 __u32 version; /* version number of this structure */
329 __u32 compat_version; /* lowest version this is compat with */
330
331 /*
332 * Bits needed to read the hw events in user-space.
333 *
334 * u32 seq, time_mult, time_shift, idx, width;
335 * u64 count, enabled, running;
336 * u64 cyc, time_offset;
337 * s64 pmc = 0;
338 *
339 * do {
340 * seq = pc->lock;
341 * barrier()
342 *
343 * enabled = pc->time_enabled;
344 * running = pc->time_running;
345 *
346 * if (pc->cap_usr_time && enabled != running) {
347 * cyc = rdtsc();
348 * time_offset = pc->time_offset;
349 * time_mult = pc->time_mult;
350 * time_shift = pc->time_shift;
351 * }
352 *
353 * idx = pc->index;
354 * count = pc->offset;
355 * if (pc->cap_usr_rdpmc && idx) {
356 * width = pc->pmc_width;
357 * pmc = rdpmc(idx - 1);
358 * }
359 *
360 * barrier();
361 * } while (pc->lock != seq);
362 *
363 * NOTE: for obvious reason this only works on self-monitoring
364 * processes.
365 */
366 __u32 lock; /* seqlock for synchronization */
367 __u32 index; /* hardware event identifier */
368 __s64 offset; /* add to hardware event value */
369 __u64 time_enabled; /* time event active */
370 __u64 time_running; /* time event on cpu */
371 union {
372 __u64 capabilities;
373 __u64 cap_usr_time : 1,
374 cap_usr_rdpmc : 1,
375 cap_____res : 62;
376 };
377
378 /*
379 * If cap_usr_rdpmc this field provides the bit-width of the value
380 * read using the rdpmc() or equivalent instruction. This can be used
381 * to sign extend the result like:
382 *
383 * pmc <<= 64 - width;
384 * pmc >>= 64 - width; // signed shift right
385 * count += pmc;
386 */
387 __u16 pmc_width;
388
389 /*
390 * If cap_usr_time the below fields can be used to compute the time
391 * delta since time_enabled (in ns) using rdtsc or similar.
392 *
393 * u64 quot, rem;
394 * u64 delta;
395 *
396 * quot = (cyc >> time_shift);
397 * rem = cyc & ((1 << time_shift) - 1);
398 * delta = time_offset + quot * time_mult +
399 * ((rem * time_mult) >> time_shift);
400 *
401 * Where time_offset,time_mult,time_shift and cyc are read in the
402 * seqcount loop described above. This delta can then be added to
403 * enabled and possible running (if idx), improving the scaling:
404 *
405 * enabled += delta;
406 * if (idx)
407 * running += delta;
408 *
409 * quot = count / running;
410 * rem = count % running;
411 * count = quot * enabled + (rem * enabled) / running;
412 */
413 __u16 time_shift;
414 __u32 time_mult;
415 __u64 time_offset;
416
417 /*
418 * Hole for extension of the self monitor capabilities
419 */
420
421 __u64 __reserved[120]; /* align to 1k */
422
423 /*
424 * Control data for the mmap() data buffer.
425 *
426 * User-space reading the @data_head value should issue an rmb(), on
427 * SMP capable platforms, after reading this value -- see
428 * perf_event_wakeup().
429 *
430 * When the mapping is PROT_WRITE the @data_tail value should be
431 * written by userspace to reflect the last read data. In this case
432 * the kernel will not over-write unread data.
433 */
434 __u64 data_head; /* head in the data section */
435 __u64 data_tail; /* user-space written tail */
436};
437
438#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
439#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
440#define PERF_RECORD_MISC_KERNEL (1 << 0)
441#define PERF_RECORD_MISC_USER (2 << 0)
442#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
443#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
444#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
445
446/*
447 * Indicates that the content of PERF_SAMPLE_IP points to
448 * the actual instruction that triggered the event. See also
449 * perf_event_attr::precise_ip.
450 */
451#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
452/*
453 * Reserve the last bit to indicate some extended misc field
454 */
455#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
456
457struct perf_event_header {
458 __u32 type;
459 __u16 misc;
460 __u16 size;
461};
462
463enum perf_event_type {
464
465 /*
466 * If perf_event_attr.sample_id_all is set then all event types will
467 * have the sample_type selected fields related to where/when
468 * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID)
469 * described in PERF_RECORD_SAMPLE below, it will be stashed just after
470 * the perf_event_header and the fields already present for the existing
471 * fields, i.e. at the end of the payload. That way a newer perf.data
472 * file will be supported by older perf tools, with these new optional
473 * fields being ignored.
474 *
475 * The MMAP events record the PROT_EXEC mappings so that we can
476 * correlate userspace IPs to code. They have the following structure:
477 *
478 * struct {
479 * struct perf_event_header header;
480 *
481 * u32 pid, tid;
482 * u64 addr;
483 * u64 len;
484 * u64 pgoff;
485 * char filename[];
486 * };
487 */
488 PERF_RECORD_MMAP = 1,
489
490 /*
491 * struct {
492 * struct perf_event_header header;
493 * u64 id;
494 * u64 lost;
495 * };
496 */
497 PERF_RECORD_LOST = 2,
498
499 /*
500 * struct {
501 * struct perf_event_header header;
502 *
503 * u32 pid, tid;
504 * char comm[];
505 * };
506 */
507 PERF_RECORD_COMM = 3,
508
509 /*
510 * struct {
511 * struct perf_event_header header;
512 * u32 pid, ppid;
513 * u32 tid, ptid;
514 * u64 time;
515 * };
516 */
517 PERF_RECORD_EXIT = 4,
518
519 /*
520 * struct {
521 * struct perf_event_header header;
522 * u64 time;
523 * u64 id;
524 * u64 stream_id;
525 * };
526 */
527 PERF_RECORD_THROTTLE = 5,
528 PERF_RECORD_UNTHROTTLE = 6,
529
530 /*
531 * struct {
532 * struct perf_event_header header;
533 * u32 pid, ppid;
534 * u32 tid, ptid;
535 * u64 time;
536 * };
537 */
538 PERF_RECORD_FORK = 7,
539
540 /*
541 * struct {
542 * struct perf_event_header header;
543 * u32 pid, tid;
544 *
545 * struct read_format values;
546 * };
547 */
548 PERF_RECORD_READ = 8,
549
550 /*
551 * struct {
552 * struct perf_event_header header;
553 *
554 * { u64 ip; } && PERF_SAMPLE_IP
555 * { u32 pid, tid; } && PERF_SAMPLE_TID
556 * { u64 time; } && PERF_SAMPLE_TIME
557 * { u64 addr; } && PERF_SAMPLE_ADDR
558 * { u64 id; } && PERF_SAMPLE_ID
559 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
560 * { u32 cpu, res; } && PERF_SAMPLE_CPU
561 * { u64 period; } && PERF_SAMPLE_PERIOD
562 *
563 * { struct read_format values; } && PERF_SAMPLE_READ
564 *
565 * { u64 nr,
566 * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN
567 *
568 * #
569 * # The RAW record below is opaque data wrt the ABI
570 * #
571 * # That is, the ABI doesn't make any promises wrt to
572 * # the stability of its content, it may vary depending
573 * # on event, hardware, kernel version and phase of
574 * # the moon.
575 * #
576 * # In other words, PERF_SAMPLE_RAW contents are not an ABI.
577 * #
578 *
579 * { u32 size;
580 * char data[size];}&& PERF_SAMPLE_RAW
581 *
582 * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK
583 *
584 * { u64 abi; # enum perf_sample_regs_abi
585 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
586 *
587 * { u64 size;
588 * char data[size];
589 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
590 * };
591 */
592 PERF_RECORD_SAMPLE = 9,
593
594 PERF_RECORD_MAX, /* non-ABI */
595};
596
597#define PERF_MAX_STACK_DEPTH 127
598
599enum perf_callchain_context {
600 PERF_CONTEXT_HV = (__u64)-32,
601 PERF_CONTEXT_KERNEL = (__u64)-128,
602 PERF_CONTEXT_USER = (__u64)-512,
603
604 PERF_CONTEXT_GUEST = (__u64)-2048,
605 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
606 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
607
608 PERF_CONTEXT_MAX = (__u64)-4095,
609};
610
611#define PERF_FLAG_FD_NO_GROUP (1U << 0)
612#define PERF_FLAG_FD_OUTPUT (1U << 1)
613#define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */
614
615#ifdef __KERNEL__
616/*
617 * Kernel-internal data types and definitions: 20 * Kernel-internal data types and definitions:
618 */ 21 */
619 22
@@ -1422,5 +825,4 @@ _name##_show(struct device *dev, \
1422 \ 825 \
1423static struct device_attribute format_attr_##_name = __ATTR_RO(_name) 826static struct device_attribute format_attr_##_name = __ATTR_RO(_name)
1424 827
1425#endif /* __KERNEL__ */
1426#endif /* _LINUX_PERF_EVENT_H */ 828#endif /* _LINUX_PERF_EVENT_H */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 8fc7dd1a57f..646c0a7d50f 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_PERSONALITY_H 1#ifndef _LINUX_PERSONALITY_H
2#define _LINUX_PERSONALITY_H 2#define _LINUX_PERSONALITY_H
3 3
4#ifdef __KERNEL__ 4#include <uapi/linux/personality.h>
5
5 6
6/* 7/*
7 * Handling of different ABIs (personalities). 8 * Handling of different ABIs (personalities).
@@ -14,72 +15,6 @@ extern int register_exec_domain(struct exec_domain *);
14extern int unregister_exec_domain(struct exec_domain *); 15extern int unregister_exec_domain(struct exec_domain *);
15extern int __set_personality(unsigned int); 16extern int __set_personality(unsigned int);
16 17
17#endif /* __KERNEL__ */
18
19/*
20 * Flags for bug emulation.
21 *
22 * These occupy the top three bytes.
23 */
24enum {
25 UNAME26 = 0x0020000,
26 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
27 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
28 * (signal handling)
29 */
30 MMAP_PAGE_ZERO = 0x0100000,
31 ADDR_COMPAT_LAYOUT = 0x0200000,
32 READ_IMPLIES_EXEC = 0x0400000,
33 ADDR_LIMIT_32BIT = 0x0800000,
34 SHORT_INODE = 0x1000000,
35 WHOLE_SECONDS = 0x2000000,
36 STICKY_TIMEOUTS = 0x4000000,
37 ADDR_LIMIT_3GB = 0x8000000,
38};
39
40/*
41 * Security-relevant compatibility flags that must be
42 * cleared upon setuid or setgid exec:
43 */
44#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
45 ADDR_NO_RANDOMIZE | \
46 ADDR_COMPAT_LAYOUT | \
47 MMAP_PAGE_ZERO)
48
49/*
50 * Personality types.
51 *
52 * These go in the low byte. Avoid using the top bit, it will
53 * conflict with error returns.
54 */
55enum {
56 PER_LINUX = 0x0000,
57 PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
58 PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
59 PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
60 PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
61 PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
62 WHOLE_SECONDS | SHORT_INODE,
63 PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
64 PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
65 PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
66 PER_BSD = 0x0006,
67 PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
68 PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
69 PER_LINUX32 = 0x0008,
70 PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
71 PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
72 PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
73 PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
74 PER_RISCOS = 0x000c,
75 PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
76 PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
77 PER_OSF4 = 0x000f, /* OSF/1 v4 */
78 PER_HPUX = 0x0010,
79 PER_MASK = 0x00ff,
80};
81
82#ifdef __KERNEL__
83 18
84/* 19/*
85 * Description of an execution domain. 20 * Description of an execution domain.
@@ -116,6 +51,4 @@ struct exec_domain {
116#define set_personality(pers) \ 51#define set_personality(pers) \
117 ((current->personality == (pers)) ? 0 : __set_personality(pers)) 52 ((current->personality == (pers)) ? 0 : __set_personality(pers))
118 53
119#endif /* __KERNEL__ */
120
121#endif /* _LINUX_PERSONALITY_H */ 54#endif /* _LINUX_PERSONALITY_H */
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index f48bfc80cb4..f691b04fc5c 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -19,169 +19,11 @@
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA 20 * 02110-1301 USA
21 */ 21 */
22
23#ifndef LINUX_PHONET_H 22#ifndef LINUX_PHONET_H
24#define LINUX_PHONET_H 23#define LINUX_PHONET_H
25 24
26#include <linux/types.h> 25#include <uapi/linux/phonet.h>
27#include <linux/socket.h>
28
29/* Automatic protocol selection */
30#define PN_PROTO_TRANSPORT 0
31/* Phonet datagram socket */
32#define PN_PROTO_PHONET 1
33/* Phonet pipe */
34#define PN_PROTO_PIPE 2
35#define PHONET_NPROTO 3
36
37/* Socket options for SOL_PNPIPE level */
38#define PNPIPE_ENCAP 1
39#define PNPIPE_IFINDEX 2
40#define PNPIPE_HANDLE 3
41#define PNPIPE_INITSTATE 4
42
43#define PNADDR_ANY 0
44#define PNADDR_BROADCAST 0xFC
45#define PNPORT_RESOURCE_ROUTING 0
46
47/* Values for PNPIPE_ENCAP option */
48#define PNPIPE_ENCAP_NONE 0
49#define PNPIPE_ENCAP_IP 1
50
51/* ioctls */
52#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
53#define SIOCPNENABLEPIPE (SIOCPROTOPRIVATE + 13)
54#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
55#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
56
57/* Phonet protocol header */
58struct phonethdr {
59 __u8 pn_rdev;
60 __u8 pn_sdev;
61 __u8 pn_res;
62 __be16 pn_length;
63 __u8 pn_robj;
64 __u8 pn_sobj;
65} __attribute__((packed));
66
67/* Common Phonet payload header */
68struct phonetmsg {
69 __u8 pn_trans_id; /* transaction ID */
70 __u8 pn_msg_id; /* message type */
71 union {
72 struct {
73 __u8 pn_submsg_id; /* message subtype */
74 __u8 pn_data[5];
75 } base;
76 struct {
77 __u16 pn_e_res_id; /* extended resource ID */
78 __u8 pn_e_submsg_id; /* message subtype */
79 __u8 pn_e_data[3];
80 } ext;
81 } pn_msg_u;
82};
83#define PN_COMMON_MESSAGE 0xF0
84#define PN_COMMGR 0x10
85#define PN_PREFIX 0xE0 /* resource for extended messages */
86#define pn_submsg_id pn_msg_u.base.pn_submsg_id
87#define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
88#define pn_e_res_id pn_msg_u.ext.pn_e_res_id
89#define pn_data pn_msg_u.base.pn_data
90#define pn_e_data pn_msg_u.ext.pn_e_data
91
92/* data for unreachable errors */
93#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
94#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
95#define pn_orig_msg_id pn_data[0]
96#define pn_status pn_data[1]
97#define pn_e_orig_msg_id pn_e_data[0]
98#define pn_e_status pn_e_data[1]
99
100/* Phonet socket address structure */
101struct sockaddr_pn {
102 __kernel_sa_family_t spn_family;
103 __u8 spn_obj;
104 __u8 spn_dev;
105 __u8 spn_resource;
106 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
107} __attribute__((packed));
108
109/* Well known address */
110#define PN_DEV_PC 0x10
111
112static inline __u16 pn_object(__u8 addr, __u16 port)
113{
114 return (addr << 8) | (port & 0x3ff);
115}
116 26
117static inline __u8 pn_obj(__u16 handle)
118{
119 return handle & 0xff;
120}
121
122static inline __u8 pn_dev(__u16 handle)
123{
124 return handle >> 8;
125}
126
127static inline __u16 pn_port(__u16 handle)
128{
129 return handle & 0x3ff;
130}
131
132static inline __u8 pn_addr(__u16 handle)
133{
134 return (handle >> 8) & 0xfc;
135}
136
137static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
138{
139 spn->spn_dev &= 0x03;
140 spn->spn_dev |= addr & 0xfc;
141}
142
143static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
144{
145 spn->spn_dev &= 0xfc;
146 spn->spn_dev |= (port >> 8) & 0x03;
147 spn->spn_obj = port & 0xff;
148}
149
150static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
151 __u16 handle)
152{
153 spn->spn_dev = pn_dev(handle);
154 spn->spn_obj = pn_obj(handle);
155}
156
157static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
158 __u8 resource)
159{
160 spn->spn_resource = resource;
161}
162
163static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
164{
165 return spn->spn_dev & 0xfc;
166}
167
168static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
169{
170 return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
171}
172
173static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
174{
175 return pn_object(spn->spn_dev, spn->spn_obj);
176}
177
178static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
179{
180 return spn->spn_resource;
181}
182
183/* Phonet device ioctl requests */
184#ifdef __KERNEL__
185#define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0) 27#define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0)
186 28
187struct if_phonet_autoconf { 29struct if_phonet_autoconf {
@@ -195,6 +37,4 @@ struct if_phonet_req {
195 } ifr_ifru; 37 } ifr_ifru;
196}; 38};
197#define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf 39#define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf
198#endif /* __KERNEL__ */
199
200#endif 40#endif
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 721301b0a90..93d142ad152 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -12,108 +12,13 @@
12#ifndef __PKTCDVD_H 12#ifndef __PKTCDVD_H
13#define __PKTCDVD_H 13#define __PKTCDVD_H
14 14
15#include <linux/types.h>
16
17/*
18 * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
19 */
20#define PACKET_DEBUG 1
21
22#define MAX_WRITERS 8
23
24#define PKT_RB_POOL_SIZE 512
25
26/*
27 * How long we should hold a non-full packet before starting data gathering.
28 */
29#define PACKET_WAIT_TIME (HZ * 5 / 1000)
30
31/*
32 * use drive write caching -- we need deferred error handling to be
33 * able to successfully recover with this option (drive will return good
34 * status as soon as the cdb is validated).
35 */
36#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
37#define USE_WCACHING 1
38#else
39#define USE_WCACHING 0
40#endif
41
42/*
43 * No user-servicable parts beyond this point ->
44 */
45
46/*
47 * device types
48 */
49#define PACKET_CDR 1
50#define PACKET_CDRW 2
51#define PACKET_DVDR 3
52#define PACKET_DVDRW 4
53
54/*
55 * flags
56 */
57#define PACKET_WRITABLE 1 /* pd is writable */
58#define PACKET_NWA_VALID 2 /* next writable address valid */
59#define PACKET_LRA_VALID 3 /* last recorded address valid */
60#define PACKET_MERGE_SEGS 4 /* perform segment merging to keep */
61 /* underlying cdrom device happy */
62
63/*
64 * Disc status -- from READ_DISC_INFO
65 */
66#define PACKET_DISC_EMPTY 0
67#define PACKET_DISC_INCOMPLETE 1
68#define PACKET_DISC_COMPLETE 2
69#define PACKET_DISC_OTHER 3
70
71/*
72 * write type, and corresponding data block type
73 */
74#define PACKET_MODE1 1
75#define PACKET_MODE2 2
76#define PACKET_BLOCK_MODE1 8
77#define PACKET_BLOCK_MODE2 10
78
79/*
80 * Last session/border status
81 */
82#define PACKET_SESSION_EMPTY 0
83#define PACKET_SESSION_INCOMPLETE 1
84#define PACKET_SESSION_RESERVED 2
85#define PACKET_SESSION_COMPLETE 3
86
87#define PACKET_MCN "4a656e734178626f65323030300000"
88
89#undef PACKET_USE_LS
90
91#define PKT_CTRL_CMD_SETUP 0
92#define PKT_CTRL_CMD_TEARDOWN 1
93#define PKT_CTRL_CMD_STATUS 2
94
95struct pkt_ctrl_command {
96 __u32 command; /* in: Setup, teardown, status */
97 __u32 dev_index; /* in/out: Device index */
98 __u32 dev; /* in/out: Device nr for cdrw device */
99 __u32 pkt_dev; /* in/out: Device nr for packet device */
100 __u32 num_devices; /* out: Largest device index + 1 */
101 __u32 padding; /* Not used */
102};
103
104/*
105 * packet ioctls
106 */
107#define PACKET_IOCTL_MAGIC ('X')
108#define PACKET_CTRL_CMD _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
109
110#ifdef __KERNEL__
111#include <linux/blkdev.h> 15#include <linux/blkdev.h>
112#include <linux/completion.h> 16#include <linux/completion.h>
113#include <linux/cdrom.h> 17#include <linux/cdrom.h>
114#include <linux/kobject.h> 18#include <linux/kobject.h>
115#include <linux/sysfs.h> 19#include <linux/sysfs.h>
116#include <linux/mempool.h> 20#include <linux/mempool.h>
21#include <uapi/linux/pktcdvd.h>
117 22
118/* default bio write queue congestion marks */ 23/* default bio write queue congestion marks */
119#define PKT_WRITE_CONGESTION_ON 10000 24#define PKT_WRITE_CONGESTION_ON 10000
@@ -297,6 +202,4 @@ struct pktcdvd_device
297 struct dentry *dfs_f_info; /* debugfs: info file */ 202 struct dentry *dfs_f_info; /* debugfs: info file */
298}; 203};
299 204
300#endif /* __KERNEL__ */
301
302#endif /* __PKTCDVD_H */ 205#endif /* __PKTCDVD_H */
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 84e6a55a120..99b400b8a24 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -5,137 +5,11 @@
5 * 5 *
6 * Copyright (C) 1998 Paul Mackerras. 6 * Copyright (C) 1998 Paul Mackerras.
7 */ 7 */
8
9#ifndef _LINUX_PMU_H 8#ifndef _LINUX_PMU_H
10#define _LINUX_PMU_H 9#define _LINUX_PMU_H
11 10
12#define PMU_DRIVER_VERSION 2 11#include <uapi/linux/pmu.h>
13
14/*
15 * PMU commands
16 */
17#define PMU_POWER_CTRL0 0x10 /* control power of some devices */
18#define PMU_POWER_CTRL 0x11 /* control power of some devices */
19#define PMU_ADB_CMD 0x20 /* send ADB packet */
20#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
21#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */
22#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */
23#define PMU_SET_RTC 0x30 /* set real-time clock */
24#define PMU_READ_RTC 0x38 /* read real-time clock */
25#define PMU_SET_VOLBUTTON 0x40 /* set volume up/down position */
26#define PMU_BACKLIGHT_BRIGHT 0x41 /* set backlight brightness */
27#define PMU_GET_VOLBUTTON 0x48 /* get volume up/down position */
28#define PMU_PCEJECT 0x4c /* eject PC-card from slot */
29#define PMU_BATTERY_STATE 0x6b /* report battery state etc. */
30#define PMU_SMART_BATTERY_STATE 0x6f /* report battery state (new way) */
31#define PMU_SET_INTR_MASK 0x70 /* set PMU interrupt mask */
32#define PMU_INT_ACK 0x78 /* read interrupt bits */
33#define PMU_SHUTDOWN 0x7e /* turn power off */
34#define PMU_CPU_SPEED 0x7d /* control CPU speed on some models */
35#define PMU_SLEEP 0x7f /* put CPU to sleep */
36#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */
37#define PMU_I2C_CMD 0x9a /* I2C operations */
38#define PMU_RESET 0xd0 /* reset CPU */
39#define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */
40#define PMU_GET_COVER 0xdc /* report cover open/closed */
41#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */
42#define PMU_GET_VERSION 0xea /* read the PMU version */
43
44/* Bits to use with the PMU_POWER_CTRL0 command */
45#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
46#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
47#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */
48
49/* Bits to use with the PMU_POWER_CTRL command */
50#define PMU_POW_ON 0x80 /* OR this to power ON the device */
51#define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
52#define PMU_POW_BACKLIGHT 0x01 /* backlight power */
53#define PMU_POW_CHARGER 0x02 /* battery charger power */
54#define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */
55#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */
56
57/* Bits in PMU interrupt and interrupt mask bytes */
58#define PMU_INT_PCEJECT 0x04 /* PC-card eject buttons */
59#define PMU_INT_SNDBRT 0x08 /* sound/brightness up/down buttons */
60#define PMU_INT_ADB 0x10 /* ADB autopoll or reply data */
61#define PMU_INT_BATTERY 0x20 /* Battery state change */
62#define PMU_INT_ENVIRONMENT 0x40 /* Environment interrupts */
63#define PMU_INT_TICK 0x80 /* 1-second tick interrupt */
64
65/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
66#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
67#define PMU_INT_WAITING_CHARGER 0x01 /* ??? */
68#define PMU_INT_AUTO_SRQ_POLL 0x02 /* ??? */
69
70/* Bits in the environement message (either obtained via PMU_GET_COVER,
71 * or via PMU_INT_ENVIRONMENT on core99 */
72#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
73
74/* I2C related definitions */
75#define PMU_I2C_MODE_SIMPLE 0
76#define PMU_I2C_MODE_STDSUB 1
77#define PMU_I2C_MODE_COMBINED 2
78
79#define PMU_I2C_BUS_STATUS 0
80#define PMU_I2C_BUS_SYSCLK 1
81#define PMU_I2C_BUS_POWER 2
82
83#define PMU_I2C_STATUS_OK 0
84#define PMU_I2C_STATUS_DATAREAD 1
85#define PMU_I2C_STATUS_BUSY 0xfe
86
87
88/* Kind of PMU (model) */
89enum {
90 PMU_UNKNOWN,
91 PMU_OHARE_BASED, /* 2400, 3400, 3500 (old G3 powerbook) */
92 PMU_HEATHROW_BASED, /* PowerBook G3 series */
93 PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */
94 PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
95 PMU_68K_V1, /* 68K PMU, version 1 */
96 PMU_68K_V2, /* 68K PMU, version 2 */
97};
98 12
99/* PMU PMU_POWER_EVENTS commands */
100enum {
101 PMU_PWR_GET_POWERUP_EVENTS = 0x00,
102 PMU_PWR_SET_POWERUP_EVENTS = 0x01,
103 PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
104 PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
105 PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
106 PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
107};
108
109/* Power events wakeup bits */
110enum {
111 PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
112 PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
113 PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
114 PMU_PWR_WAKEUP_LID_OPEN = 0x08,
115 PMU_PWR_WAKEUP_RING = 0x10,
116};
117
118/*
119 * Ioctl commands for the /dev/pmu device
120 */
121#include <linux/ioctl.h>
122
123/* no param */
124#define PMU_IOC_SLEEP _IO('B', 0)
125/* out param: u32* backlight value: 0 to 15 */
126#define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t)
127/* in param: u32 backlight value: 0 to 15 */
128#define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t)
129/* out param: u32* PMU model */
130#define PMU_IOC_GET_MODEL _IOR('B', 3, size_t)
131/* out param: u32* has_adb: 0 or 1 */
132#define PMU_IOC_HAS_ADB _IOR('B', 4, size_t)
133/* out param: u32* can_sleep: 0 or 1 */
134#define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t)
135/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
136#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t)
137
138#ifdef __KERNEL__
139 13
140extern int find_via_pmu(void); 14extern int find_via_pmu(void);
141 15
@@ -208,6 +82,4 @@ extern int pmu_sys_suspended;
208#define pmu_sys_suspended 0 82#define pmu_sys_suspended 0
209#endif 83#endif
210 84
211#endif /* __KERNEL__ */
212
213#endif /* _LINUX_PMU_H */ 85#endif /* _LINUX_PMU_H */
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 48fe8bc398d..c08386fb3e0 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -1,9 +1,6 @@
1#ifndef _LINUX_POLL_H 1#ifndef _LINUX_POLL_H
2#define _LINUX_POLL_H 2#define _LINUX_POLL_H
3 3
4#include <asm/poll.h>
5
6#ifdef __KERNEL__
7 4
8#include <linux/compiler.h> 5#include <linux/compiler.h>
9#include <linux/ktime.h> 6#include <linux/ktime.h>
@@ -12,6 +9,7 @@
12#include <linux/fs.h> 9#include <linux/fs.h>
13#include <linux/sysctl.h> 10#include <linux/sysctl.h>
14#include <asm/uaccess.h> 11#include <asm/uaccess.h>
12#include <uapi/linux/poll.h>
15 13
16extern struct ctl_table epoll_table[]; /* for sysctl */ 14extern struct ctl_table epoll_table[]; /* for sysctl */
17/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating 15/* ~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,
163 161
164extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec); 162extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec);
165 163
166#endif /* KERNEL */
167
168#endif /* _LINUX_POLL_H */ 164#endif /* _LINUX_POLL_H */
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index e53ff65935d..4ea1d377e1a 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -10,6 +10,9 @@
10#ifndef _NET_PPP_COMP_H 10#ifndef _NET_PPP_COMP_H
11#define _NET_PPP_COMP_H 11#define _NET_PPP_COMP_H
12 12
13#include <uapi/linux/ppp-comp.h>
14
15
13struct module; 16struct module;
14 17
15/* 18/*
@@ -98,87 +101,6 @@ struct compressor {
98#define DECOMP_ERROR -1 /* error detected before decomp. */ 101#define DECOMP_ERROR -1 /* error detected before decomp. */
99#define DECOMP_FATALERROR -2 /* error detected after decomp. */ 102#define DECOMP_FATALERROR -2 /* error detected after decomp. */
100 103
101/*
102 * CCP codes.
103 */
104
105#define CCP_CONFREQ 1
106#define CCP_CONFACK 2
107#define CCP_TERMREQ 5
108#define CCP_TERMACK 6
109#define CCP_RESETREQ 14
110#define CCP_RESETACK 15
111
112/*
113 * Max # bytes for a CCP option
114 */
115
116#define CCP_MAX_OPTION_LENGTH 32
117
118/*
119 * Parts of a CCP packet.
120 */
121
122#define CCP_CODE(dp) ((dp)[0])
123#define CCP_ID(dp) ((dp)[1])
124#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
125#define CCP_HDRLEN 4
126
127#define CCP_OPT_CODE(dp) ((dp)[0])
128#define CCP_OPT_LENGTH(dp) ((dp)[1])
129#define CCP_OPT_MINLEN 2
130
131/*
132 * Definitions for BSD-Compress.
133 */
134
135#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
136#define CILEN_BSD_COMPRESS 3 /* length of config. option */
137
138/* Macros for handling the 3rd byte of the BSD-Compress config option. */
139#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
140#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
141#define BSD_CURRENT_VERSION 1 /* current version number */
142#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
143
144#define BSD_MIN_BITS 9 /* smallest code size supported */
145#define BSD_MAX_BITS 15 /* largest code size supported */
146
147/*
148 * Definitions for Deflate.
149 */
150
151#define CI_DEFLATE 26 /* config option for Deflate */
152#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
153#define CILEN_DEFLATE 4 /* length of its config option */
154
155#define DEFLATE_MIN_SIZE 9
156#define DEFLATE_MAX_SIZE 15
157#define DEFLATE_METHOD_VAL 8
158#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
159#define DEFLATE_METHOD(x) ((x) & 0x0F)
160#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
161#define DEFLATE_CHK_SEQUENCE 0
162
163/*
164 * Definitions for MPPE.
165 */
166
167#define CI_MPPE 18 /* config option for MPPE */
168#define CILEN_MPPE 6 /* length of config option */
169
170/*
171 * Definitions for other, as yet unsupported, compression methods.
172 */
173
174#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
175#define CILEN_PREDICTOR_1 2 /* length of its config option */
176#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
177#define CILEN_PREDICTOR_2 2 /* length of its config option */
178
179#ifdef __KERNEL__
180extern int ppp_register_compressor(struct compressor *); 104extern int ppp_register_compressor(struct compressor *);
181extern void ppp_unregister_compressor(struct compressor *); 105extern void ppp_unregister_compressor(struct compressor *);
182#endif /* __KERNEL__ */
183
184#endif /* _NET_PPP_COMP_H */ 106#endif /* _NET_PPP_COMP_H */
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index ba416f67eb6..28aa0237c8c 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -7,148 +7,11 @@
7 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation. 8 * version 2 as published by the Free Software Foundation.
9 */ 9 */
10#include <linux/types.h>
11
12#ifndef _PPP_DEFS_H_ 10#ifndef _PPP_DEFS_H_
13#define _PPP_DEFS_H_ 11#define _PPP_DEFS_H_
14 12
15/*
16 * The basic PPP frame.
17 */
18#define PPP_HDRLEN 4 /* octets for standard ppp header */
19#define PPP_FCSLEN 2 /* octets for FCS */
20#define PPP_MRU 1500 /* default MRU = max length of info field */
21
22#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
23#define PPP_CONTROL(p) (((__u8 *)(p))[1])
24#define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
25
26/*
27 * Significant octet values.
28 */
29#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
30#define PPP_UI 0x03 /* Unnumbered Information */
31#define PPP_FLAG 0x7e /* Flag Sequence */
32#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
33#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
34
35/*
36 * Protocol field values.
37 */
38#define PPP_IP 0x21 /* Internet Protocol */
39#define PPP_AT 0x29 /* AppleTalk Protocol */
40#define PPP_IPX 0x2b /* IPX protocol */
41#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
42#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
43#define PPP_MP 0x3d /* Multilink protocol */
44#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
45#define PPP_COMPFRAG 0xfb /* fragment compressed below bundle */
46#define PPP_COMP 0xfd /* compressed packet */
47#define PPP_MPLS_UC 0x0281 /* Multi Protocol Label Switching - Unicast */
48#define PPP_MPLS_MC 0x0283 /* Multi Protocol Label Switching - Multicast */
49#define PPP_IPCP 0x8021 /* IP Control Protocol */
50#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
51#define PPP_IPXCP 0x802b /* IPX Control Protocol */
52#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
53#define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */
54#define PPP_CCP 0x80fd /* Compression Control Protocol */
55#define PPP_MPLSCP 0x80fd /* MPLS Control Protocol */
56#define PPP_LCP 0xc021 /* Link Control Protocol */
57#define PPP_PAP 0xc023 /* Password Authentication Protocol */
58#define PPP_LQR 0xc025 /* Link Quality Report protocol */
59#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
60#define PPP_CBCP 0xc029 /* Callback Control Protocol */
61
62/*
63 * Values for FCS calculations.
64 */
65
66#define PPP_INITFCS 0xffff /* Initial FCS value */
67#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
68
69#ifdef __KERNEL__
70#include <linux/crc-ccitt.h> 13#include <linux/crc-ccitt.h>
71#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) 14#include <uapi/linux/ppp_defs.h>
72#endif
73
74/*
75 * Extended asyncmap - allows any character to be escaped.
76 */
77
78typedef __u32 ext_accm[8];
79
80/*
81 * What to do with network protocol (NP) packets.
82 */
83enum NPmode {
84 NPMODE_PASS, /* pass the packet through */
85 NPMODE_DROP, /* silently drop the packet */
86 NPMODE_ERROR, /* return an error */
87 NPMODE_QUEUE /* save it up for later. */
88};
89
90/*
91 * Statistics for LQRP and pppstats
92 */
93struct pppstat {
94 __u32 ppp_discards; /* # frames discarded */
95
96 __u32 ppp_ibytes; /* bytes received */
97 __u32 ppp_ioctects; /* bytes received not in error */
98 __u32 ppp_ipackets; /* packets received */
99 __u32 ppp_ierrors; /* receive errors */
100 __u32 ppp_ilqrs; /* # LQR frames received */
101
102 __u32 ppp_obytes; /* raw bytes sent */
103 __u32 ppp_ooctects; /* frame bytes sent */
104 __u32 ppp_opackets; /* packets sent */
105 __u32 ppp_oerrors; /* transmit errors */
106 __u32 ppp_olqrs; /* # LQR frames sent */
107};
108
109struct vjstat {
110 __u32 vjs_packets; /* outbound packets */
111 __u32 vjs_compressed; /* outbound compressed packets */
112 __u32 vjs_searches; /* searches for connection state */
113 __u32 vjs_misses; /* times couldn't find conn. state */
114 __u32 vjs_uncompressedin; /* inbound uncompressed packets */
115 __u32 vjs_compressedin; /* inbound compressed packets */
116 __u32 vjs_errorin; /* inbound unknown type packets */
117 __u32 vjs_tossed; /* inbound packets tossed because of error */
118};
119
120struct compstat {
121 __u32 unc_bytes; /* total uncompressed bytes */
122 __u32 unc_packets; /* total uncompressed packets */
123 __u32 comp_bytes; /* compressed bytes */
124 __u32 comp_packets; /* compressed packets */
125 __u32 inc_bytes; /* incompressible bytes */
126 __u32 inc_packets; /* incompressible packets */
127
128 /* the compression ratio is defined as in_count / bytes_out */
129 __u32 in_count; /* Bytes received */
130 __u32 bytes_out; /* Bytes transmitted */
131
132 double ratio; /* not computed in kernel. */
133};
134
135struct ppp_stats {
136 struct pppstat p; /* basic PPP statistics */
137 struct vjstat vj; /* VJ header compression statistics */
138};
139
140struct ppp_comp_stats {
141 struct compstat c; /* packet compression statistics */
142 struct compstat d; /* packet decompression statistics */
143};
144
145/*
146 * The following structure records the time in seconds since
147 * the last NP packet was sent or received.
148 */
149struct ppp_idle {
150 __kernel_time_t xmit_idle; /* time since last NP packet sent */
151 __kernel_time_t recv_idle; /* time since last NP packet received */
152};
153 15
16#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
154#endif /* _PPP_DEFS_H_ */ 17#endif /* _PPP_DEFS_H_ */
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 1d24ffad59c..e0ff4689d35 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -1,83 +1,13 @@
1#ifndef _LINUX_PTRACE_H 1#ifndef _LINUX_PTRACE_H
2#define _LINUX_PTRACE_H 2#define _LINUX_PTRACE_H
3/* ptrace.h */
4/* structs and defines to help the user use the ptrace system call. */
5 3
6/* has the defines to get at the registers. */ 4#include <linux/compiler.h> /* For unlikely. */
7 5#include <linux/sched.h> /* For struct task_struct. */
8#define PTRACE_TRACEME 0 6#include <linux/err.h> /* for IS_ERR_VALUE */
9#define PTRACE_PEEKTEXT 1 7#include <linux/bug.h> /* For BUG_ON. */
10#define PTRACE_PEEKDATA 2 8#include <uapi/linux/ptrace.h>
11#define PTRACE_PEEKUSR 3
12#define PTRACE_POKETEXT 4
13#define PTRACE_POKEDATA 5
14#define PTRACE_POKEUSR 6
15#define PTRACE_CONT 7
16#define PTRACE_KILL 8
17#define PTRACE_SINGLESTEP 9
18
19#define PTRACE_ATTACH 16
20#define PTRACE_DETACH 17
21
22#define PTRACE_SYSCALL 24
23
24/* 0x4200-0x4300 are reserved for architecture-independent additions. */
25#define PTRACE_SETOPTIONS 0x4200
26#define PTRACE_GETEVENTMSG 0x4201
27#define PTRACE_GETSIGINFO 0x4202
28#define PTRACE_SETSIGINFO 0x4203
29 9
30/* 10/*
31 * Generic ptrace interface that exports the architecture specific regsets
32 * using the corresponding NT_* types (which are also used in the core dump).
33 * Please note that the NT_PRSTATUS note type in a core dump contains a full
34 * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
35 * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
36 * other user_regset flavors, the user_regset layout and the ELF core dump note
37 * payload are exactly the same layout.
38 *
39 * This interface usage is as follows:
40 * struct iovec iov = { buf, len};
41 *
42 * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
43 *
44 * On the successful completion, iov.len will be updated by the kernel,
45 * specifying how much the kernel has written/read to/from the user's iov.buf.
46 */
47#define PTRACE_GETREGSET 0x4204
48#define PTRACE_SETREGSET 0x4205
49
50#define PTRACE_SEIZE 0x4206
51#define PTRACE_INTERRUPT 0x4207
52#define PTRACE_LISTEN 0x4208
53
54/* Wait extended result codes for the above trace options. */
55#define PTRACE_EVENT_FORK 1
56#define PTRACE_EVENT_VFORK 2
57#define PTRACE_EVENT_CLONE 3
58#define PTRACE_EVENT_EXEC 4
59#define PTRACE_EVENT_VFORK_DONE 5
60#define PTRACE_EVENT_EXIT 6
61#define PTRACE_EVENT_SECCOMP 7
62/* Extended result codes which enabled by means other than options. */
63#define PTRACE_EVENT_STOP 128
64
65/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
66#define PTRACE_O_TRACESYSGOOD 1
67#define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
68#define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
69#define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
70#define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
71#define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
72#define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
73#define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
74
75#define PTRACE_O_MASK 0x000000ff
76
77#include <asm/ptrace.h>
78
79#ifdef __KERNEL__
80/*
81 * Ptrace flags 11 * Ptrace flags
82 * 12 *
83 * The owner ship rules for task->ptrace which holds the ptrace 13 * The owner ship rules for task->ptrace which holds the ptrace
@@ -108,12 +38,6 @@
108#define PT_BLOCKSTEP_BIT 30 38#define PT_BLOCKSTEP_BIT 30
109#define PT_BLOCKSTEP (1<<PT_BLOCKSTEP_BIT) 39#define PT_BLOCKSTEP (1<<PT_BLOCKSTEP_BIT)
110 40
111#include <linux/compiler.h> /* For unlikely. */
112#include <linux/sched.h> /* For struct task_struct. */
113#include <linux/err.h> /* for IS_ERR_VALUE */
114#include <linux/bug.h> /* For BUG_ON. */
115
116
117extern long arch_ptrace(struct task_struct *child, long request, 41extern long arch_ptrace(struct task_struct *child, long request,
118 unsigned long addr, unsigned long data); 42 unsigned long addr, unsigned long data);
119extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 43extern 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);
416static inline void ptrace_put_breakpoints(struct task_struct *tsk) { } 340static inline void ptrace_put_breakpoints(struct task_struct *tsk) { }
417#endif /* CONFIG_HAVE_HW_BREAKPOINT */ 341#endif /* CONFIG_HAVE_HW_BREAKPOINT */
418 342
419#endif /* __KERNEL */
420
421#endif 343#endif
diff --git a/include/linux/quota.h b/include/linux/quota.h
index dcd5721e626..58fdef12525 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -29,146 +29,9 @@
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE. 30 * SUCH DAMAGE.
31 */ 31 */
32
33#ifndef _LINUX_QUOTA_ 32#ifndef _LINUX_QUOTA_
34#define _LINUX_QUOTA_ 33#define _LINUX_QUOTA_
35 34
36#include <linux/errno.h>
37#include <linux/types.h>
38
39#define __DQUOT_VERSION__ "dquot_6.5.2"
40
41#define MAXQUOTAS 2
42#define USRQUOTA 0 /* element used for user quotas */
43#define GRPQUOTA 1 /* element used for group quotas */
44
45/*
46 * Definitions for the default names of the quotas files.
47 */
48#define INITQFNAMES { \
49 "user", /* USRQUOTA */ \
50 "group", /* GRPQUOTA */ \
51 "undefined", \
52};
53
54/*
55 * Command definitions for the 'quotactl' system call.
56 * The commands are broken into a main command defined below
57 * and a subcommand that is used to convey the type of
58 * quota that is being manipulated (see above).
59 */
60#define SUBCMDMASK 0x00ff
61#define SUBCMDSHIFT 8
62#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
63
64#define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
65#define Q_QUOTAON 0x800002 /* turn quotas on */
66#define Q_QUOTAOFF 0x800003 /* turn quotas off */
67#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
68#define Q_GETINFO 0x800005 /* get information about quota files */
69#define Q_SETINFO 0x800006 /* set information about quota files */
70#define Q_GETQUOTA 0x800007 /* get user quota structure */
71#define Q_SETQUOTA 0x800008 /* set user quota structure */
72
73/* Quota format type IDs */
74#define QFMT_VFS_OLD 1
75#define QFMT_VFS_V0 2
76#define QFMT_OCFS2 3
77#define QFMT_VFS_V1 4
78
79/* Size of block in which space limits are passed through the quota
80 * interface */
81#define QIF_DQBLKSIZE_BITS 10
82#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS)
83
84/*
85 * Quota structure used for communication with userspace via quotactl
86 * Following flags are used to specify which fields are valid
87 */
88enum {
89 QIF_BLIMITS_B = 0,
90 QIF_SPACE_B,
91 QIF_ILIMITS_B,
92 QIF_INODES_B,
93 QIF_BTIME_B,
94 QIF_ITIME_B,
95};
96
97#define QIF_BLIMITS (1 << QIF_BLIMITS_B)
98#define QIF_SPACE (1 << QIF_SPACE_B)
99#define QIF_ILIMITS (1 << QIF_ILIMITS_B)
100#define QIF_INODES (1 << QIF_INODES_B)
101#define QIF_BTIME (1 << QIF_BTIME_B)
102#define QIF_ITIME (1 << QIF_ITIME_B)
103#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
104#define QIF_USAGE (QIF_SPACE | QIF_INODES)
105#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
106#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
107
108struct if_dqblk {
109 __u64 dqb_bhardlimit;
110 __u64 dqb_bsoftlimit;
111 __u64 dqb_curspace;
112 __u64 dqb_ihardlimit;
113 __u64 dqb_isoftlimit;
114 __u64 dqb_curinodes;
115 __u64 dqb_btime;
116 __u64 dqb_itime;
117 __u32 dqb_valid;
118};
119
120/*
121 * Structure used for setting quota information about file via quotactl
122 * Following flags are used to specify which fields are valid
123 */
124#define IIF_BGRACE 1
125#define IIF_IGRACE 2
126#define IIF_FLAGS 4
127#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
128
129struct if_dqinfo {
130 __u64 dqi_bgrace;
131 __u64 dqi_igrace;
132 __u32 dqi_flags;
133 __u32 dqi_valid;
134};
135
136/*
137 * Definitions for quota netlink interface
138 */
139#define QUOTA_NL_NOWARN 0
140#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */
141#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */
142#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */
143#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */
144#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */
145#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */
146#define QUOTA_NL_IHARDBELOW 7 /* Usage got below inode hardlimit */
147#define QUOTA_NL_ISOFTBELOW 8 /* Usage got below inode softlimit */
148#define QUOTA_NL_BHARDBELOW 9 /* Usage got below block hardlimit */
149#define QUOTA_NL_BSOFTBELOW 10 /* Usage got below block softlimit */
150
151enum {
152 QUOTA_NL_C_UNSPEC,
153 QUOTA_NL_C_WARNING,
154 __QUOTA_NL_C_MAX,
155};
156#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
157
158enum {
159 QUOTA_NL_A_UNSPEC,
160 QUOTA_NL_A_QTYPE,
161 QUOTA_NL_A_EXCESS_ID,
162 QUOTA_NL_A_WARNING,
163 QUOTA_NL_A_DEV_MAJOR,
164 QUOTA_NL_A_DEV_MINOR,
165 QUOTA_NL_A_CAUSED_ID,
166 __QUOTA_NL_A_MAX,
167};
168#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
169
170
171#ifdef __KERNEL__
172#include <linux/list.h> 35#include <linux/list.h>
173#include <linux/mutex.h> 36#include <linux/mutex.h>
174#include <linux/rwsem.h> 37#include <linux/rwsem.h>
@@ -183,6 +46,7 @@ enum {
183#include <linux/atomic.h> 46#include <linux/atomic.h>
184#include <linux/uidgid.h> 47#include <linux/uidgid.h>
185#include <linux/projid.h> 48#include <linux/projid.h>
49#include <uapi/linux/quota.h>
186 50
187#undef USRQUOTA 51#undef USRQUOTA
188#undef GRPQUOTA 52#undef GRPQUOTA
@@ -543,5 +407,4 @@ struct quota_module_name {
543 {QFMT_VFS_V0, "quota_v2"},\ 407 {QFMT_VFS_V0, "quota_v2"},\
544 {0, NULL}} 408 {0, NULL}}
545 409
546#endif /* __KERNEL__ */
547#endif /* _QUOTA_ */ 410#endif /* _QUOTA_ */
diff --git a/include/linux/random.h b/include/linux/random.h
index ac621ce886c..6330ed47b38 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -3,50 +3,11 @@
3 * 3 *
4 * Include file for the random number generator. 4 * Include file for the random number generator.
5 */ 5 */
6
7#ifndef _LINUX_RANDOM_H 6#ifndef _LINUX_RANDOM_H
8#define _LINUX_RANDOM_H 7#define _LINUX_RANDOM_H
9 8
10#include <linux/types.h> 9#include <uapi/linux/random.h>
11#include <linux/ioctl.h>
12#include <linux/irqnr.h>
13
14/* ioctl()'s for the random number generator */
15
16/* Get the entropy count. */
17#define RNDGETENTCNT _IOR( 'R', 0x00, int )
18
19/* Add to (or subtract from) the entropy count. (Superuser only.) */
20#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
21
22/* Get the contents of the entropy pool. (Superuser only.) */
23#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
24
25/*
26 * Write bytes into the entropy pool and add to the entropy count.
27 * (Superuser only.)
28 */
29#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
30 10
31/* Clear entropy count to 0. (Superuser only.) */
32#define RNDZAPENTCNT _IO( 'R', 0x04 )
33
34/* Clear the entropy pool and associated counters. (Superuser only.) */
35#define RNDCLEARPOOL _IO( 'R', 0x06 )
36
37struct rand_pool_info {
38 int entropy_count;
39 int buf_size;
40 __u32 buf[0];
41};
42
43struct rnd_state {
44 __u32 s1, s2, s3;
45};
46
47/* Exported functions */
48
49#ifdef __KERNEL__
50 11
51extern void add_device_randomness(const void *, unsigned int); 12extern void add_device_randomness(const void *, unsigned int);
52extern void add_input_randomness(unsigned int type, unsigned int code, 13extern void add_input_randomness(unsigned int type, unsigned int code,
@@ -104,6 +65,4 @@ static inline int arch_get_random_int(unsigned int *v)
104} 65}
105#endif 66#endif
106 67
107#endif /* __KERNEL___ */
108
109#endif /* _LINUX_RANDOM_H */ 68#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index e0879a70e83..23b36304cd8 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -1,43 +1,9 @@
1#ifndef _LINUX_REBOOT_H 1#ifndef _LINUX_REBOOT_H
2#define _LINUX_REBOOT_H 2#define _LINUX_REBOOT_H
3 3
4/*
5 * Magic values required to use _reboot() system call.
6 */
7
8#define LINUX_REBOOT_MAGIC1 0xfee1dead
9#define LINUX_REBOOT_MAGIC2 672274793
10#define LINUX_REBOOT_MAGIC2A 85072278
11#define LINUX_REBOOT_MAGIC2B 369367448
12#define LINUX_REBOOT_MAGIC2C 537993216
13
14
15/*
16 * Commands accepted by the _reboot() system call.
17 *
18 * RESTART Restart system using default command and mode.
19 * HALT Stop OS and give system control to ROM monitor, if any.
20 * CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
21 * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
22 * POWER_OFF Stop OS and remove all power from system, if possible.
23 * RESTART2 Restart system using given command string.
24 * SW_SUSPEND Suspend system using software suspend if compiled in.
25 * KEXEC Restart system using a previously loaded Linux kernel
26 */
27
28#define LINUX_REBOOT_CMD_RESTART 0x01234567
29#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
30#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
31#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
32#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
33#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
34#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
35#define LINUX_REBOOT_CMD_KEXEC 0x45584543
36
37
38#ifdef __KERNEL__
39 4
40#include <linux/notifier.h> 5#include <linux/notifier.h>
6#include <uapi/linux/reboot.h>
41 7
42#define SYS_DOWN 0x0001 /* Notify of system down */ 8#define SYS_DOWN 0x0001 /* Notify of system down */
43#define SYS_RESTART SYS_DOWN 9#define SYS_RESTART SYS_DOWN
@@ -84,6 +50,4 @@ extern int orderly_poweroff(bool force);
84extern void emergency_restart(void); 50extern void emergency_restart(void);
85#include <asm/emergency-restart.h> 51#include <asm/emergency-restart.h>
86 52
87#endif
88
89#endif /* _LINUX_REBOOT_H */ 53#endif /* _LINUX_REBOOT_H */
diff --git a/include/linux/resource.h b/include/linux/resource.h
index d01c96c1966..5bc3116e649 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -1,82 +1,8 @@
1#ifndef _LINUX_RESOURCE_H 1#ifndef _LINUX_RESOURCE_H
2#define _LINUX_RESOURCE_H 2#define _LINUX_RESOURCE_H
3 3
4#include <linux/time.h> 4#include <uapi/linux/resource.h>
5#include <linux/types.h>
6 5
7/*
8 * Resource control/accounting header file for linux
9 */
10
11/*
12 * Definition of struct rusage taken from BSD 4.3 Reno
13 *
14 * We don't support all of these yet, but we might as well have them....
15 * Otherwise, each time we add new items, programs which depend on this
16 * structure will lose. This reduces the chances of that happening.
17 */
18#define RUSAGE_SELF 0
19#define RUSAGE_CHILDREN (-1)
20#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
21#define RUSAGE_THREAD 1 /* only the calling thread */
22
23struct rusage {
24 struct timeval ru_utime; /* user time used */
25 struct timeval ru_stime; /* system time used */
26 long ru_maxrss; /* maximum resident set size */
27 long ru_ixrss; /* integral shared memory size */
28 long ru_idrss; /* integral unshared data size */
29 long ru_isrss; /* integral unshared stack size */
30 long ru_minflt; /* page reclaims */
31 long ru_majflt; /* page faults */
32 long ru_nswap; /* swaps */
33 long ru_inblock; /* block input operations */
34 long ru_oublock; /* block output operations */
35 long ru_msgsnd; /* messages sent */
36 long ru_msgrcv; /* messages received */
37 long ru_nsignals; /* signals received */
38 long ru_nvcsw; /* voluntary context switches */
39 long ru_nivcsw; /* involuntary " */
40};
41
42struct rlimit {
43 unsigned long rlim_cur;
44 unsigned long rlim_max;
45};
46
47#define RLIM64_INFINITY (~0ULL)
48
49struct rlimit64 {
50 __u64 rlim_cur;
51 __u64 rlim_max;
52};
53
54#define PRIO_MIN (-20)
55#define PRIO_MAX 20
56
57#define PRIO_PROCESS 0
58#define PRIO_PGRP 1
59#define PRIO_USER 2
60
61/*
62 * Limit the stack by to some sane default: root can always
63 * increase this limit if needed.. 8MB seems reasonable.
64 */
65#define _STK_LIM (8*1024*1024)
66
67/*
68 * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
69 * and other sensitive information are never written to disk.
70 */
71#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
72
73/*
74 * Due to binary compatibility, the actual resource numbers
75 * may be different for different linux versions..
76 */
77#include <asm/resource.h>
78
79#ifdef __KERNEL__
80 6
81struct task_struct; 7struct task_struct;
82 8
@@ -84,6 +10,4 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
84int do_prlimit(struct task_struct *tsk, unsigned int resource, 10int do_prlimit(struct task_struct *tsk, unsigned int resource,
85 struct rlimit *new_rlim, struct rlimit *old_rlim); 11 struct rlimit *new_rlim, struct rlimit *old_rlim);
86 12
87#endif /* __KERNEL__ */
88
89#endif 13#endif
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 0ec590bb361..d9010789b4e 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -1,6 +1,3 @@
1#ifndef __RFKILL_H
2#define __RFKILL_H
3
4/* 1/*
5 * Copyright (C) 2006 - 2007 Ivo van Doorn 2 * Copyright (C) 2006 - 2007 Ivo van Doorn
6 * Copyright (C) 2007 Dmitry Torokhov 3 * Copyright (C) 2007 Dmitry Torokhov
@@ -18,92 +15,11 @@
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */ 17 */
18#ifndef __RFKILL_H
19#define __RFKILL_H
21 20
22#include <linux/types.h> 21#include <uapi/linux/rfkill.h>
23
24/* define userspace visible states */
25#define RFKILL_STATE_SOFT_BLOCKED 0
26#define RFKILL_STATE_UNBLOCKED 1
27#define RFKILL_STATE_HARD_BLOCKED 2
28
29/**
30 * enum rfkill_type - type of rfkill switch.
31 *
32 * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
33 * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
34 * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
36 * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
37 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
38 * @RFKILL_TYPE_GPS: switch is on a GPS device.
39 * @RFKILL_TYPE_FM: switch is on a FM radio device.
40 * @NUM_RFKILL_TYPES: number of defined rfkill types
41 */
42enum rfkill_type {
43 RFKILL_TYPE_ALL = 0,
44 RFKILL_TYPE_WLAN,
45 RFKILL_TYPE_BLUETOOTH,
46 RFKILL_TYPE_UWB,
47 RFKILL_TYPE_WIMAX,
48 RFKILL_TYPE_WWAN,
49 RFKILL_TYPE_GPS,
50 RFKILL_TYPE_FM,
51 NUM_RFKILL_TYPES,
52};
53
54/**
55 * enum rfkill_operation - operation types
56 * @RFKILL_OP_ADD: a device was added
57 * @RFKILL_OP_DEL: a device was removed
58 * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
59 * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
60 */
61enum rfkill_operation {
62 RFKILL_OP_ADD = 0,
63 RFKILL_OP_DEL,
64 RFKILL_OP_CHANGE,
65 RFKILL_OP_CHANGE_ALL,
66};
67
68/**
69 * struct rfkill_event - events for userspace on /dev/rfkill
70 * @idx: index of dev rfkill
71 * @type: type of the rfkill struct
72 * @op: operation code
73 * @hard: hard state (0/1)
74 * @soft: soft state (0/1)
75 *
76 * Structure used for userspace communication on /dev/rfkill,
77 * used for events from the kernel and control to the kernel.
78 */
79struct rfkill_event {
80 __u32 idx;
81 __u8 type;
82 __u8 op;
83 __u8 soft, hard;
84} __attribute__((packed));
85
86/*
87 * We are planning to be backward and forward compatible with changes
88 * to the event struct, by adding new, optional, members at the end.
89 * When reading an event (whether the kernel from userspace or vice
90 * versa) we need to accept anything that's at least as large as the
91 * version 1 event size, but might be able to accept other sizes in
92 * the future.
93 *
94 * One exception is the kernel -- we already have two event sizes in
95 * that we've made the 'hard' member optional since our only option
96 * is to ignore it anyway.
97 */
98#define RFKILL_EVENT_SIZE_V1 8
99
100/* ioctl for turning off rfkill-input (if present) */
101#define RFKILL_IOC_MAGIC 'R'
102#define RFKILL_IOC_NOINPUT 1
103#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
104 22
105/* and that's all userspace gets */
106#ifdef __KERNEL__
107/* don't allow anyone to use these in the kernel */ 23/* don't allow anyone to use these in the kernel */
108enum rfkill_user_states { 24enum rfkill_user_states {
109 RFKILL_USER_STATE_SOFT_BLOCKED = RFKILL_STATE_SOFT_BLOCKED, 25 RFKILL_USER_STATE_SOFT_BLOCKED = RFKILL_STATE_SOFT_BLOCKED,
@@ -385,6 +301,4 @@ rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name)
385} 301}
386#endif 302#endif
387 303
388#endif /* __KERNEL__ */
389
390#endif /* RFKILL_H */ 304#endif /* RFKILL_H */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 20ec4d3bed7..9531845c419 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -11,102 +11,10 @@
11#ifndef _LINUX_RTC_H_ 11#ifndef _LINUX_RTC_H_
12#define _LINUX_RTC_H_ 12#define _LINUX_RTC_H_
13 13
14/*
15 * The struct used to pass data via the following ioctl. Similar to the
16 * struct tm in <time.h>, but it needs to be here so that the kernel
17 * source is self contained, allowing cross-compiles, etc. etc.
18 */
19
20struct rtc_time {
21 int tm_sec;
22 int tm_min;
23 int tm_hour;
24 int tm_mday;
25 int tm_mon;
26 int tm_year;
27 int tm_wday;
28 int tm_yday;
29 int tm_isdst;
30};
31
32/*
33 * This data structure is inspired by the EFI (v0.92) wakeup
34 * alarm API.
35 */
36struct rtc_wkalrm {
37 unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
38 unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
39 struct rtc_time time; /* time the alarm is set to */
40};
41
42/*
43 * Data structure to control PLL correction some better RTC feature
44 * pll_value is used to get or set current value of correction,
45 * the rest of the struct is used to query HW capabilities.
46 * This is modeled after the RTC used in Q40/Q60 computers but
47 * should be sufficiently flexible for other devices
48 *
49 * +ve pll_value means clock will run faster by
50 * pll_value*pll_posmult/pll_clock
51 * -ve pll_value means clock will run slower by
52 * pll_value*pll_negmult/pll_clock
53 */
54
55struct rtc_pll_info {
56 int pll_ctrl; /* placeholder for fancier control */
57 int pll_value; /* get/set correction value */
58 int pll_max; /* max +ve (faster) adjustment value */
59 int pll_min; /* max -ve (slower) adjustment value */
60 int pll_posmult; /* factor for +ve correction */
61 int pll_negmult; /* factor for -ve correction */
62 long pll_clock; /* base PLL frequency */
63};
64
65/*
66 * ioctl calls that are permitted to the /dev/rtc interface, if
67 * any of the RTC drivers are enabled.
68 */
69
70#define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */
71#define RTC_AIE_OFF _IO('p', 0x02) /* ... off */
72#define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */
73#define RTC_UIE_OFF _IO('p', 0x04) /* ... off */
74#define RTC_PIE_ON _IO('p', 0x05) /* Periodic int. enable on */
75#define RTC_PIE_OFF _IO('p', 0x06) /* ... off */
76#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */
77#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */
78
79#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) /* Set alarm time */
80#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
81#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) /* Read RTC time */
82#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */
83#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */
84#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */
85#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
86#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
87
88#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
89#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
90
91#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
92#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
93
94#define RTC_VL_READ _IOR('p', 0x13, int) /* Voltage low detector */
95#define RTC_VL_CLR _IO('p', 0x14) /* Clear voltage low information */
96
97/* interrupt flags */
98#define RTC_IRQF 0x80 /* Any of the following is active */
99#define RTC_PF 0x40 /* Periodic interrupt */
100#define RTC_AF 0x20 /* Alarm interrupt */
101#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
102
103
104#define RTC_MAX_FREQ 8192
105
106#ifdef __KERNEL__
107 14
108#include <linux/types.h> 15#include <linux/types.h>
109#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <uapi/linux/rtc.h>
110 18
111extern int rtc_month_days(unsigned int month, unsigned int year); 19extern int rtc_month_days(unsigned int month, unsigned int year);
112extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); 20extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
@@ -282,6 +190,4 @@ extern int rtc_hctosys_ret;
282#define rtc_hctosys_ret -ENODEV 190#define rtc_hctosys_ret -ENODEV
283#endif 191#endif
284 192
285#endif /* __KERNEL__ */
286
287#endif /* _LINUX_RTC_H_ */ 193#endif /* _LINUX_RTC_H_ */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index db71c4ad862..7002bbfd5d4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -1,616 +1,10 @@
1#ifndef __LINUX_RTNETLINK_H 1#ifndef __LINUX_RTNETLINK_H
2#define __LINUX_RTNETLINK_H 2#define __LINUX_RTNETLINK_H
3 3
4#include <linux/types.h>
5#include <linux/netlink.h>
6#include <linux/if_link.h>
7#include <linux/if_addr.h>
8#include <linux/neighbour.h>
9
10/* rtnetlink families. Values up to 127 are reserved for real address
11 * families, values above 128 may be used arbitrarily.
12 */
13#define RTNL_FAMILY_IPMR 128
14#define RTNL_FAMILY_IP6MR 129
15#define RTNL_FAMILY_MAX 129
16
17/****
18 * Routing/neighbour discovery messages.
19 ****/
20
21/* Types of messages */
22
23enum {
24 RTM_BASE = 16,
25#define RTM_BASE RTM_BASE
26
27 RTM_NEWLINK = 16,
28#define RTM_NEWLINK RTM_NEWLINK
29 RTM_DELLINK,
30#define RTM_DELLINK RTM_DELLINK
31 RTM_GETLINK,
32#define RTM_GETLINK RTM_GETLINK
33 RTM_SETLINK,
34#define RTM_SETLINK RTM_SETLINK
35
36 RTM_NEWADDR = 20,
37#define RTM_NEWADDR RTM_NEWADDR
38 RTM_DELADDR,
39#define RTM_DELADDR RTM_DELADDR
40 RTM_GETADDR,
41#define RTM_GETADDR RTM_GETADDR
42
43 RTM_NEWROUTE = 24,
44#define RTM_NEWROUTE RTM_NEWROUTE
45 RTM_DELROUTE,
46#define RTM_DELROUTE RTM_DELROUTE
47 RTM_GETROUTE,
48#define RTM_GETROUTE RTM_GETROUTE
49
50 RTM_NEWNEIGH = 28,
51#define RTM_NEWNEIGH RTM_NEWNEIGH
52 RTM_DELNEIGH,
53#define RTM_DELNEIGH RTM_DELNEIGH
54 RTM_GETNEIGH,
55#define RTM_GETNEIGH RTM_GETNEIGH
56
57 RTM_NEWRULE = 32,
58#define RTM_NEWRULE RTM_NEWRULE
59 RTM_DELRULE,
60#define RTM_DELRULE RTM_DELRULE
61 RTM_GETRULE,
62#define RTM_GETRULE RTM_GETRULE
63
64 RTM_NEWQDISC = 36,
65#define RTM_NEWQDISC RTM_NEWQDISC
66 RTM_DELQDISC,
67#define RTM_DELQDISC RTM_DELQDISC
68 RTM_GETQDISC,
69#define RTM_GETQDISC RTM_GETQDISC
70
71 RTM_NEWTCLASS = 40,
72#define RTM_NEWTCLASS RTM_NEWTCLASS
73 RTM_DELTCLASS,
74#define RTM_DELTCLASS RTM_DELTCLASS
75 RTM_GETTCLASS,
76#define RTM_GETTCLASS RTM_GETTCLASS
77
78 RTM_NEWTFILTER = 44,
79#define RTM_NEWTFILTER RTM_NEWTFILTER
80 RTM_DELTFILTER,
81#define RTM_DELTFILTER RTM_DELTFILTER
82 RTM_GETTFILTER,
83#define RTM_GETTFILTER RTM_GETTFILTER
84
85 RTM_NEWACTION = 48,
86#define RTM_NEWACTION RTM_NEWACTION
87 RTM_DELACTION,
88#define RTM_DELACTION RTM_DELACTION
89 RTM_GETACTION,
90#define RTM_GETACTION RTM_GETACTION
91
92 RTM_NEWPREFIX = 52,
93#define RTM_NEWPREFIX RTM_NEWPREFIX
94
95 RTM_GETMULTICAST = 58,
96#define RTM_GETMULTICAST RTM_GETMULTICAST
97
98 RTM_GETANYCAST = 62,
99#define RTM_GETANYCAST RTM_GETANYCAST
100
101 RTM_NEWNEIGHTBL = 64,
102#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
103 RTM_GETNEIGHTBL = 66,
104#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
105 RTM_SETNEIGHTBL,
106#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
107
108 RTM_NEWNDUSEROPT = 68,
109#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
110
111 RTM_NEWADDRLABEL = 72,
112#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
113 RTM_DELADDRLABEL,
114#define RTM_DELADDRLABEL RTM_DELADDRLABEL
115 RTM_GETADDRLABEL,
116#define RTM_GETADDRLABEL RTM_GETADDRLABEL
117
118 RTM_GETDCB = 78,
119#define RTM_GETDCB RTM_GETDCB
120 RTM_SETDCB,
121#define RTM_SETDCB RTM_SETDCB
122
123 __RTM_MAX,
124#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
125};
126
127#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
128#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
129#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
130
131/*
132 Generic structure for encapsulation of optional route information.
133 It is reminiscent of sockaddr, but with sa_family replaced
134 with attribute type.
135 */
136
137struct rtattr {
138 unsigned short rta_len;
139 unsigned short rta_type;
140};
141
142/* Macros to handle rtattributes */
143
144#define RTA_ALIGNTO 4
145#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
146#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
147 (rta)->rta_len >= sizeof(struct rtattr) && \
148 (rta)->rta_len <= (len))
149#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
150 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
151#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
152#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
153#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
154#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
155
156
157
158
159/******************************************************************************
160 * Definitions used in routing table administration.
161 ****/
162
163struct rtmsg {
164 unsigned char rtm_family;
165 unsigned char rtm_dst_len;
166 unsigned char rtm_src_len;
167 unsigned char rtm_tos;
168
169 unsigned char rtm_table; /* Routing table id */
170 unsigned char rtm_protocol; /* Routing protocol; see below */
171 unsigned char rtm_scope; /* See below */
172 unsigned char rtm_type; /* See below */
173
174 unsigned rtm_flags;
175};
176
177/* rtm_type */
178
179enum {
180 RTN_UNSPEC,
181 RTN_UNICAST, /* Gateway or direct route */
182 RTN_LOCAL, /* Accept locally */
183 RTN_BROADCAST, /* Accept locally as broadcast,
184 send as broadcast */
185 RTN_ANYCAST, /* Accept locally as broadcast,
186 but send as unicast */
187 RTN_MULTICAST, /* Multicast route */
188 RTN_BLACKHOLE, /* Drop */
189 RTN_UNREACHABLE, /* Destination is unreachable */
190 RTN_PROHIBIT, /* Administratively prohibited */
191 RTN_THROW, /* Not in this table */
192 RTN_NAT, /* Translate this address */
193 RTN_XRESOLVE, /* Use external resolver */
194 __RTN_MAX
195};
196
197#define RTN_MAX (__RTN_MAX - 1)
198
199
200/* rtm_protocol */
201
202#define RTPROT_UNSPEC 0
203#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
204 not used by current IPv4 */
205#define RTPROT_KERNEL 2 /* Route installed by kernel */
206#define RTPROT_BOOT 3 /* Route installed during boot */
207#define RTPROT_STATIC 4 /* Route installed by administrator */
208
209/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
210 they are just passed from user and back as is.
211 It will be used by hypothetical multiple routing daemons.
212 Note that protocol values should be standardized in order to
213 avoid conflicts.
214 */
215
216#define RTPROT_GATED 8 /* Apparently, GateD */
217#define RTPROT_RA 9 /* RDISC/ND router advertisements */
218#define RTPROT_MRT 10 /* Merit MRT */
219#define RTPROT_ZEBRA 11 /* Zebra */
220#define RTPROT_BIRD 12 /* BIRD */
221#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
222#define RTPROT_XORP 14 /* XORP */
223#define RTPROT_NTK 15 /* Netsukuku */
224#define RTPROT_DHCP 16 /* DHCP client */
225
226/* rtm_scope
227
228 Really it is not scope, but sort of distance to the destination.
229 NOWHERE are reserved for not existing destinations, HOST is our
230 local addresses, LINK are destinations, located on directly attached
231 link and UNIVERSE is everywhere in the Universe.
232
233 Intermediate values are also possible f.e. interior routes
234 could be assigned a value between UNIVERSE and LINK.
235*/
236
237enum rt_scope_t {
238 RT_SCOPE_UNIVERSE=0,
239/* User defined values */
240 RT_SCOPE_SITE=200,
241 RT_SCOPE_LINK=253,
242 RT_SCOPE_HOST=254,
243 RT_SCOPE_NOWHERE=255
244};
245
246/* rtm_flags */
247
248#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
249#define RTM_F_CLONED 0x200 /* This route is cloned */
250#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
251#define RTM_F_PREFIX 0x800 /* Prefix addresses */
252
253/* Reserved table identifiers */
254
255enum rt_class_t {
256 RT_TABLE_UNSPEC=0,
257/* User defined values */
258 RT_TABLE_COMPAT=252,
259 RT_TABLE_DEFAULT=253,
260 RT_TABLE_MAIN=254,
261 RT_TABLE_LOCAL=255,
262 RT_TABLE_MAX=0xFFFFFFFF
263};
264
265
266/* Routing message attributes */
267
268enum rtattr_type_t {
269 RTA_UNSPEC,
270 RTA_DST,
271 RTA_SRC,
272 RTA_IIF,
273 RTA_OIF,
274 RTA_GATEWAY,
275 RTA_PRIORITY,
276 RTA_PREFSRC,
277 RTA_METRICS,
278 RTA_MULTIPATH,
279 RTA_PROTOINFO, /* no longer used */
280 RTA_FLOW,
281 RTA_CACHEINFO,
282 RTA_SESSION, /* no longer used */
283 RTA_MP_ALGO, /* no longer used */
284 RTA_TABLE,
285 RTA_MARK,
286 __RTA_MAX
287};
288
289#define RTA_MAX (__RTA_MAX - 1)
290
291#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
292#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
293
294/* RTM_MULTIPATH --- array of struct rtnexthop.
295 *
296 * "struct rtnexthop" describes all necessary nexthop information,
297 * i.e. parameters of path to a destination via this nexthop.
298 *
299 * At the moment it is impossible to set different prefsrc, mtu, window
300 * and rtt for different paths from multipath.
301 */
302
303struct rtnexthop {
304 unsigned short rtnh_len;
305 unsigned char rtnh_flags;
306 unsigned char rtnh_hops;
307 int rtnh_ifindex;
308};
309
310/* rtnh_flags */
311
312#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
313#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
314#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
315
316/* Macros to handle hexthops */
317
318#define RTNH_ALIGNTO 4
319#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
320#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
321 ((int)(rtnh)->rtnh_len) <= (len))
322#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
323#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
324#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
325#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
326
327/* RTM_CACHEINFO */
328
329struct rta_cacheinfo {
330 __u32 rta_clntref;
331 __u32 rta_lastuse;
332 __s32 rta_expires;
333 __u32 rta_error;
334 __u32 rta_used;
335
336#define RTNETLINK_HAVE_PEERINFO 1
337 __u32 rta_id;
338 __u32 rta_ts;
339 __u32 rta_tsage;
340};
341
342/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
343
344enum {
345 RTAX_UNSPEC,
346#define RTAX_UNSPEC RTAX_UNSPEC
347 RTAX_LOCK,
348#define RTAX_LOCK RTAX_LOCK
349 RTAX_MTU,
350#define RTAX_MTU RTAX_MTU
351 RTAX_WINDOW,
352#define RTAX_WINDOW RTAX_WINDOW
353 RTAX_RTT,
354#define RTAX_RTT RTAX_RTT
355 RTAX_RTTVAR,
356#define RTAX_RTTVAR RTAX_RTTVAR
357 RTAX_SSTHRESH,
358#define RTAX_SSTHRESH RTAX_SSTHRESH
359 RTAX_CWND,
360#define RTAX_CWND RTAX_CWND
361 RTAX_ADVMSS,
362#define RTAX_ADVMSS RTAX_ADVMSS
363 RTAX_REORDERING,
364#define RTAX_REORDERING RTAX_REORDERING
365 RTAX_HOPLIMIT,
366#define RTAX_HOPLIMIT RTAX_HOPLIMIT
367 RTAX_INITCWND,
368#define RTAX_INITCWND RTAX_INITCWND
369 RTAX_FEATURES,
370#define RTAX_FEATURES RTAX_FEATURES
371 RTAX_RTO_MIN,
372#define RTAX_RTO_MIN RTAX_RTO_MIN
373 RTAX_INITRWND,
374#define RTAX_INITRWND RTAX_INITRWND
375 __RTAX_MAX
376};
377
378#define RTAX_MAX (__RTAX_MAX - 1)
379
380#define RTAX_FEATURE_ECN 0x00000001
381#define RTAX_FEATURE_SACK 0x00000002
382#define RTAX_FEATURE_TIMESTAMP 0x00000004
383#define RTAX_FEATURE_ALLFRAG 0x00000008
384
385struct rta_session {
386 __u8 proto;
387 __u8 pad1;
388 __u16 pad2;
389
390 union {
391 struct {
392 __u16 sport;
393 __u16 dport;
394 } ports;
395
396 struct {
397 __u8 type;
398 __u8 code;
399 __u16 ident;
400 } icmpt;
401
402 __u32 spi;
403 } u;
404};
405
406/****
407 * General form of address family dependent message.
408 ****/
409
410struct rtgenmsg {
411 unsigned char rtgen_family;
412};
413
414/*****************************************************************
415 * Link layer specific messages.
416 ****/
417
418/* struct ifinfomsg
419 * passes link level specific information, not dependent
420 * on network protocol.
421 */
422
423struct ifinfomsg {
424 unsigned char ifi_family;
425 unsigned char __ifi_pad;
426 unsigned short ifi_type; /* ARPHRD_* */
427 int ifi_index; /* Link index */
428 unsigned ifi_flags; /* IFF_* flags */
429 unsigned ifi_change; /* IFF_* change mask */
430};
431
432/********************************************************************
433 * prefix information
434 ****/
435
436struct prefixmsg {
437 unsigned char prefix_family;
438 unsigned char prefix_pad1;
439 unsigned short prefix_pad2;
440 int prefix_ifindex;
441 unsigned char prefix_type;
442 unsigned char prefix_len;
443 unsigned char prefix_flags;
444 unsigned char prefix_pad3;
445};
446
447enum
448{
449 PREFIX_UNSPEC,
450 PREFIX_ADDRESS,
451 PREFIX_CACHEINFO,
452 __PREFIX_MAX
453};
454
455#define PREFIX_MAX (__PREFIX_MAX - 1)
456
457struct prefix_cacheinfo {
458 __u32 preferred_time;
459 __u32 valid_time;
460};
461
462
463/*****************************************************************
464 * Traffic control messages.
465 ****/
466
467struct tcmsg {
468 unsigned char tcm_family;
469 unsigned char tcm__pad1;
470 unsigned short tcm__pad2;
471 int tcm_ifindex;
472 __u32 tcm_handle;
473 __u32 tcm_parent;
474 __u32 tcm_info;
475};
476
477enum {
478 TCA_UNSPEC,
479 TCA_KIND,
480 TCA_OPTIONS,
481 TCA_STATS,
482 TCA_XSTATS,
483 TCA_RATE,
484 TCA_FCNT,
485 TCA_STATS2,
486 TCA_STAB,
487 __TCA_MAX
488};
489
490#define TCA_MAX (__TCA_MAX - 1)
491
492#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
493#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
494
495/********************************************************************
496 * Neighbor Discovery userland options
497 ****/
498
499struct nduseroptmsg {
500 unsigned char nduseropt_family;
501 unsigned char nduseropt_pad1;
502 unsigned short nduseropt_opts_len; /* Total length of options */
503 int nduseropt_ifindex;
504 __u8 nduseropt_icmp_type;
505 __u8 nduseropt_icmp_code;
506 unsigned short nduseropt_pad2;
507 unsigned int nduseropt_pad3;
508 /* Followed by one or more ND options */
509};
510
511enum {
512 NDUSEROPT_UNSPEC,
513 NDUSEROPT_SRCADDR,
514 __NDUSEROPT_MAX
515};
516
517#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
518
519#ifndef __KERNEL__
520/* RTnetlink multicast groups - backwards compatibility for userspace */
521#define RTMGRP_LINK 1
522#define RTMGRP_NOTIFY 2
523#define RTMGRP_NEIGH 4
524#define RTMGRP_TC 8
525
526#define RTMGRP_IPV4_IFADDR 0x10
527#define RTMGRP_IPV4_MROUTE 0x20
528#define RTMGRP_IPV4_ROUTE 0x40
529#define RTMGRP_IPV4_RULE 0x80
530
531#define RTMGRP_IPV6_IFADDR 0x100
532#define RTMGRP_IPV6_MROUTE 0x200
533#define RTMGRP_IPV6_ROUTE 0x400
534#define RTMGRP_IPV6_IFINFO 0x800
535
536#define RTMGRP_DECnet_IFADDR 0x1000
537#define RTMGRP_DECnet_ROUTE 0x4000
538
539#define RTMGRP_IPV6_PREFIX 0x20000
540#endif
541
542/* RTnetlink multicast groups */
543enum rtnetlink_groups {
544 RTNLGRP_NONE,
545#define RTNLGRP_NONE RTNLGRP_NONE
546 RTNLGRP_LINK,
547#define RTNLGRP_LINK RTNLGRP_LINK
548 RTNLGRP_NOTIFY,
549#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
550 RTNLGRP_NEIGH,
551#define RTNLGRP_NEIGH RTNLGRP_NEIGH
552 RTNLGRP_TC,
553#define RTNLGRP_TC RTNLGRP_TC
554 RTNLGRP_IPV4_IFADDR,
555#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
556 RTNLGRP_IPV4_MROUTE,
557#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
558 RTNLGRP_IPV4_ROUTE,
559#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
560 RTNLGRP_IPV4_RULE,
561#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
562 RTNLGRP_IPV6_IFADDR,
563#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
564 RTNLGRP_IPV6_MROUTE,
565#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
566 RTNLGRP_IPV6_ROUTE,
567#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
568 RTNLGRP_IPV6_IFINFO,
569#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
570 RTNLGRP_DECnet_IFADDR,
571#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
572 RTNLGRP_NOP2,
573 RTNLGRP_DECnet_ROUTE,
574#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
575 RTNLGRP_DECnet_RULE,
576#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
577 RTNLGRP_NOP4,
578 RTNLGRP_IPV6_PREFIX,
579#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
580 RTNLGRP_IPV6_RULE,
581#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
582 RTNLGRP_ND_USEROPT,
583#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
584 RTNLGRP_PHONET_IFADDR,
585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
586 RTNLGRP_PHONET_ROUTE,
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB
590 __RTNLGRP_MAX
591};
592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
593
594/* TC action piece */
595struct tcamsg {
596 unsigned char tca_family;
597 unsigned char tca__pad1;
598 unsigned short tca__pad2;
599};
600#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
601#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
602#define TCA_ACT_TAB 1 /* attr type must be >=1 */
603#define TCAA_MAX 1
604
605/* New extended info filters for IFLA_EXT_MASK */
606#define RTEXT_FILTER_VF (1 << 0)
607
608/* End of information exported to user level */
609
610#ifdef __KERNEL__
611 4
612#include <linux/mutex.h> 5#include <linux/mutex.h>
613#include <linux/netdevice.h> 6#include <linux/netdevice.h>
7#include <uapi/linux/rtnetlink.h>
614 8
615extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 9extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
616extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); 10extern 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,
675 struct netlink_callback *cb, 69 struct netlink_callback *cb,
676 struct net_device *dev, 70 struct net_device *dev,
677 int idx); 71 int idx);
678#endif /* __KERNEL__ */
679
680
681#endif /* __LINUX_RTNETLINK_H */ 72#endif /* __LINUX_RTNETLINK_H */
diff --git a/include/linux/scc.h b/include/linux/scc.h
index 3495bd953cc..c5a00496267 100644
--- a/include/linux/scc.h
+++ b/include/linux/scc.h
@@ -1,175 +1,9 @@
1/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */ 1/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
2
3#ifndef _SCC_H 2#ifndef _SCC_H
4#define _SCC_H 3#define _SCC_H
5 4
5#include <uapi/linux/scc.h>
6 6
7/* selection of hardware types */
8
9#define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */
10#define EAGLE 0x01 /* hardware type for EAGLE card */
11#define PC100 0x02 /* hardware type for PC100 card */
12#define PRIMUS 0x04 /* hardware type for PRIMUS-PC (DG9BL) card */
13#define DRSI 0x08 /* hardware type for DRSI PC*Packet card */
14#define BAYCOM 0x10 /* hardware type for BayCom (U)SCC */
15
16/* DEV ioctl() commands */
17
18enum SCC_ioctl_cmds {
19 SIOCSCCRESERVED = SIOCDEVPRIVATE,
20 SIOCSCCCFG,
21 SIOCSCCINI,
22 SIOCSCCCHANINI,
23 SIOCSCCSMEM,
24 SIOCSCCGKISS,
25 SIOCSCCSKISS,
26 SIOCSCCGSTAT,
27 SIOCSCCCAL
28};
29
30/* Device parameter control (from WAMPES) */
31
32enum L1_params {
33 PARAM_DATA,
34 PARAM_TXDELAY,
35 PARAM_PERSIST,
36 PARAM_SLOTTIME,
37 PARAM_TXTAIL,
38 PARAM_FULLDUP,
39 PARAM_SOFTDCD, /* was: PARAM_HW */
40 PARAM_MUTE, /* ??? */
41 PARAM_DTR,
42 PARAM_RTS,
43 PARAM_SPEED,
44 PARAM_ENDDELAY, /* ??? */
45 PARAM_GROUP,
46 PARAM_IDLE,
47 PARAM_MIN,
48 PARAM_MAXKEY,
49 PARAM_WAIT,
50 PARAM_MAXDEFER,
51 PARAM_TX,
52 PARAM_HWEVENT = 31,
53 PARAM_RETURN = 255 /* reset kiss mode */
54};
55
56/* fulldup parameter */
57
58enum FULLDUP_modes {
59 KISS_DUPLEX_HALF, /* normal CSMA operation */
60 KISS_DUPLEX_FULL, /* fullduplex, key down trx after transmission */
61 KISS_DUPLEX_LINK, /* fullduplex, key down trx after 'idletime' sec */
62 KISS_DUPLEX_OPTIMA /* fullduplex, let the protocol layer control the hw */
63};
64
65/* misc. parameters */
66
67#define TIMER_OFF 65535U /* to switch off timers */
68#define NO_SUCH_PARAM 65534U /* param not implemented */
69
70/* HWEVENT parameter */
71
72enum HWEVENT_opts {
73 HWEV_DCD_ON,
74 HWEV_DCD_OFF,
75 HWEV_ALL_SENT
76};
77
78/* channel grouping */
79
80#define RXGROUP 0100 /* if set, only tx when all channels clear */
81#define TXGROUP 0200 /* if set, don't transmit simultaneously */
82
83/* Tx/Rx clock sources */
84
85enum CLOCK_sources {
86 CLK_DPLL, /* normal halfduplex operation */
87 CLK_EXTERNAL, /* external clocking (G3RUH/DF9IC modems) */
88 CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */
89 /* modems without clock regeneration */
90 CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */
91 /* MODEMs without clock recovery */
92};
93
94/* Tx state */
95
96enum TX_state {
97 TXS_IDLE, /* Transmitter off, no data pending */
98 TXS_BUSY, /* waiting for permission to send / tailtime */
99 TXS_ACTIVE, /* Transmitter on, sending data */
100 TXS_NEWFRAME, /* reset CRC and send (next) frame */
101 TXS_IDLE2, /* Transmitter on, no data pending */
102 TXS_WAIT, /* Waiting for Mintime to expire */
103 TXS_TIMEOUT /* We had a transmission timeout */
104};
105
106typedef unsigned long io_port; /* type definition for an 'io port address' */
107
108/* SCC statistical information */
109
110struct scc_stat {
111 long rxints; /* Receiver interrupts */
112 long txints; /* Transmitter interrupts */
113 long exints; /* External/status interrupts */
114 long spints; /* Special receiver interrupts */
115
116 long txframes; /* Packets sent */
117 long rxframes; /* Number of Frames Actually Received */
118 long rxerrs; /* CRC Errors */
119 long txerrs; /* KISS errors */
120
121 unsigned int nospace; /* "Out of buffers" */
122 unsigned int rx_over; /* Receiver Overruns */
123 unsigned int tx_under; /* Transmitter Underruns */
124
125 unsigned int tx_state; /* Transmitter state */
126 int tx_queued; /* tx frames enqueued */
127
128 unsigned int maxqueue; /* allocated tx_buffers */
129 unsigned int bufsize; /* used buffersize */
130};
131
132struct scc_modem {
133 long speed; /* Line speed, bps */
134 char clocksrc; /* 0 = DPLL, 1 = external, 2 = divider */
135 char nrz; /* NRZ instead of NRZI */
136};
137
138struct scc_kiss_cmd {
139 int command; /* one of the KISS-Commands defined above */
140 unsigned param; /* KISS-Param */
141};
142
143struct scc_hw_config {
144 io_port data_a; /* data port channel A */
145 io_port ctrl_a; /* control port channel A */
146 io_port data_b; /* data port channel B */
147 io_port ctrl_b; /* control port channel B */
148 io_port vector_latch; /* INTACK-Latch (#) */
149 io_port special; /* special function port */
150
151 int irq; /* irq */
152 long clock; /* clock */
153 char option; /* command for function port */
154
155 char brand; /* hardware type */
156 char escc; /* use ext. features of a 8580/85180/85280 */
157};
158
159/* (#) only one INTACK latch allowed. */
160
161
162struct scc_mem_config {
163 unsigned int dummy;
164 unsigned int bufsize;
165};
166
167struct scc_calibrate {
168 unsigned int time;
169 unsigned char pattern;
170};
171
172#ifdef __KERNEL__
173 7
174enum {TX_OFF, TX_ON}; /* command for scc_key_trx() */ 8enum {TX_OFF, TX_ON}; /* command for scc_key_trx() */
175 9
@@ -248,5 +82,4 @@ struct scc_channel {
248 spinlock_t lock; /* Channel guard lock */ 82 spinlock_t lock; /* Channel guard lock */
249}; 83};
250 84
251#endif /* defined(__KERNEL__) */
252#endif /* defined(_SCC_H) */ 85#endif /* defined(_SCC_H) */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a83ca5816ec..0dd42a02df2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1,48 +1,8 @@
1#ifndef _LINUX_SCHED_H 1#ifndef _LINUX_SCHED_H
2#define _LINUX_SCHED_H 2#define _LINUX_SCHED_H
3 3
4/* 4#include <uapi/linux/sched.h>
5 * cloning flags:
6 */
7#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
8#define CLONE_VM 0x00000100 /* set if VM shared between processes */
9#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
10#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
11#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
12#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
13#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
14#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
15#define CLONE_THREAD 0x00010000 /* Same thread group? */
16#define CLONE_NEWNS 0x00020000 /* New namespace group? */
17#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
18#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
19#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
20#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
21#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
22#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
23#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
24/* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state)
25 and is now available for re-use. */
26#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
27#define CLONE_NEWIPC 0x08000000 /* New ipcs */
28#define CLONE_NEWUSER 0x10000000 /* New user namespace */
29#define CLONE_NEWPID 0x20000000 /* New pid namespace */
30#define CLONE_NEWNET 0x40000000 /* New network namespace */
31#define CLONE_IO 0x80000000 /* Clone io context */
32
33/*
34 * Scheduling policies
35 */
36#define SCHED_NORMAL 0
37#define SCHED_FIFO 1
38#define SCHED_RR 2
39#define SCHED_BATCH 3
40/* SCHED_ISO: reserved but not implemented yet */
41#define SCHED_IDLE 5
42/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
43#define SCHED_RESET_ON_FORK 0x40000000
44 5
45#ifdef __KERNEL__
46 6
47struct sched_param { 7struct sched_param {
48 int sched_priority; 8 int sched_priority;
@@ -2828,6 +2788,4 @@ static inline unsigned long rlimit_max(unsigned int limit)
2828 return task_rlimit_max(current, limit); 2788 return task_rlimit_max(current, limit);
2829} 2789}
2830 2790
2831#endif /* __KERNEL__ */
2832
2833#endif 2791#endif
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index fb3c5a8fef3..005bf3e38db 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -1,76 +1,8 @@
1#ifndef _SCREEN_INFO_H 1#ifndef _SCREEN_INFO_H
2#define _SCREEN_INFO_H 2#define _SCREEN_INFO_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/screen_info.h>
5 5
6/*
7 * These are set up by the setup-routine at boot-time:
8 */
9
10struct screen_info {
11 __u8 orig_x; /* 0x00 */
12 __u8 orig_y; /* 0x01 */
13 __u16 ext_mem_k; /* 0x02 */
14 __u16 orig_video_page; /* 0x04 */
15 __u8 orig_video_mode; /* 0x06 */
16 __u8 orig_video_cols; /* 0x07 */
17 __u8 flags; /* 0x08 */
18 __u8 unused2; /* 0x09 */
19 __u16 orig_video_ega_bx;/* 0x0a */
20 __u16 unused3; /* 0x0c */
21 __u8 orig_video_lines; /* 0x0e */
22 __u8 orig_video_isVGA; /* 0x0f */
23 __u16 orig_video_points;/* 0x10 */
24
25 /* VESA graphic mode -- linear frame buffer */
26 __u16 lfb_width; /* 0x12 */
27 __u16 lfb_height; /* 0x14 */
28 __u16 lfb_depth; /* 0x16 */
29 __u32 lfb_base; /* 0x18 */
30 __u32 lfb_size; /* 0x1c */
31 __u16 cl_magic, cl_offset; /* 0x20 */
32 __u16 lfb_linelength; /* 0x24 */
33 __u8 red_size; /* 0x26 */
34 __u8 red_pos; /* 0x27 */
35 __u8 green_size; /* 0x28 */
36 __u8 green_pos; /* 0x29 */
37 __u8 blue_size; /* 0x2a */
38 __u8 blue_pos; /* 0x2b */
39 __u8 rsvd_size; /* 0x2c */
40 __u8 rsvd_pos; /* 0x2d */
41 __u16 vesapm_seg; /* 0x2e */
42 __u16 vesapm_off; /* 0x30 */
43 __u16 pages; /* 0x32 */
44 __u16 vesa_attributes; /* 0x34 */
45 __u32 capabilities; /* 0x36 */
46 __u8 _reserved[6]; /* 0x3a */
47} __attribute__((packed));
48
49#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
50#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
51#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
52#define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */
53#define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */
54#define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
55
56#define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */
57#define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */
58#define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */
59
60#define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */
61
62#define VIDEO_TYPE_SUN 0x50 /* Sun frame buffer. */
63#define VIDEO_TYPE_SUNPCI 0x51 /* Sun PCI based frame buffer. */
64
65#define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */
66
67#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
68
69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
70
71#define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0)
72
73#ifdef __KERNEL__
74extern struct screen_info screen_info; 6extern struct screen_info screen_info;
75 7
76#define ORIG_X (screen_info.orig_x) 8#define ORIG_X (screen_info.orig_x)
@@ -81,6 +13,4 @@ extern struct screen_info screen_info;
81#define ORIG_VIDEO_LINES (screen_info.orig_video_lines) 13#define ORIG_VIDEO_LINES (screen_info.orig_video_lines)
82#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) 14#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA)
83#define ORIG_VIDEO_POINTS (screen_info.orig_video_points) 15#define ORIG_VIDEO_POINTS (screen_info.orig_video_points)
84#endif /* __KERNEL__ */
85
86#endif /* _SCREEN_INFO_H */ 16#endif /* _SCREEN_INFO_H */
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 9995c7fc3f6..fe7a967d7de 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -19,100 +19,11 @@
19 * as published by the Free Software Foundation; either version 19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version. 20 * 2 of the License, or (at your option) any later version.
21 */ 21 */
22
23#ifndef SDLA_H 22#ifndef SDLA_H
24#define SDLA_H 23#define SDLA_H
25 24
26/* adapter type */ 25#include <uapi/linux/sdla.h>
27#define SDLA_TYPES
28#define SDLA_S502A 5020
29#define SDLA_S502E 5021
30#define SDLA_S503 5030
31#define SDLA_S507 5070
32#define SDLA_S508 5080
33#define SDLA_S509 5090
34#define SDLA_UNKNOWN -1
35
36/* port selection flags for the S508 */
37#define SDLA_S508_PORT_V35 0x00
38#define SDLA_S508_PORT_RS232 0x02
39
40/* Z80 CPU speeds */
41#define SDLA_CPU_3M 0x00
42#define SDLA_CPU_5M 0x01
43#define SDLA_CPU_7M 0x02
44#define SDLA_CPU_8M 0x03
45#define SDLA_CPU_10M 0x04
46#define SDLA_CPU_16M 0x05
47#define SDLA_CPU_12M 0x06
48
49/* some private IOCTLs */
50#define SDLA_IDENTIFY (FRAD_LAST_IOCTL + 1)
51#define SDLA_CPUSPEED (FRAD_LAST_IOCTL + 2)
52#define SDLA_PROTOCOL (FRAD_LAST_IOCTL + 3)
53
54#define SDLA_CLEARMEM (FRAD_LAST_IOCTL + 4)
55#define SDLA_WRITEMEM (FRAD_LAST_IOCTL + 5)
56#define SDLA_READMEM (FRAD_LAST_IOCTL + 6)
57
58struct sdla_mem {
59 int addr;
60 int len;
61 void __user *data;
62};
63
64#define SDLA_START (FRAD_LAST_IOCTL + 7)
65#define SDLA_STOP (FRAD_LAST_IOCTL + 8)
66 26
67/* some offsets in the Z80's memory space */
68#define SDLA_NMIADDR 0x0000
69#define SDLA_CONF_ADDR 0x0010
70#define SDLA_S502A_NMIADDR 0x0066
71#define SDLA_CODE_BASEADDR 0x0100
72#define SDLA_WINDOW_SIZE 0x2000
73#define SDLA_ADDR_MASK 0x1FFF
74
75/* largest handleable block of data */
76#define SDLA_MAX_DATA 4080
77#define SDLA_MAX_MTU 4072 /* MAX_DATA - sizeof(fradhdr) */
78#define SDLA_MAX_DLCI 24
79
80/* this should be the same as frad_conf */
81struct sdla_conf {
82 short station;
83 short config;
84 short kbaud;
85 short clocking;
86 short max_frm;
87 short T391;
88 short T392;
89 short N391;
90 short N392;
91 short N393;
92 short CIR_fwd;
93 short Bc_fwd;
94 short Be_fwd;
95 short CIR_bwd;
96 short Bc_bwd;
97 short Be_bwd;
98};
99
100/* this should be the same as dlci_conf */
101struct sdla_dlci_conf {
102 short config;
103 short CIR_fwd;
104 short Bc_fwd;
105 short Be_fwd;
106 short CIR_bwd;
107 short Bc_bwd;
108 short Be_bwd;
109 short Tc_fwd;
110 short Tc_bwd;
111 short Tf_max;
112 short Tb_max;
113};
114
115#ifdef __KERNEL__
116 27
117/* important Z80 window addresses */ 28/* important Z80 window addresses */
118#define SDLA_CONTROL_WND 0xE000 29#define SDLA_CONTROL_WND 0xE000
@@ -331,5 +242,3 @@ struct buf_entry {
331} __attribute__((packed)); 242} __attribute__((packed));
332 243
333#endif 244#endif
334
335#endif
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 84f6320da50..6f19cfd1840 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -1,50 +1,8 @@
1#ifndef _LINUX_SECCOMP_H 1#ifndef _LINUX_SECCOMP_H
2#define _LINUX_SECCOMP_H 2#define _LINUX_SECCOMP_H
3 3
4#include <linux/compiler.h> 4#include <uapi/linux/seccomp.h>
5#include <linux/types.h>
6 5
7
8/* Valid values for seccomp.mode and prctl(PR_SET_SECCOMP, <mode>) */
9#define SECCOMP_MODE_DISABLED 0 /* seccomp is not in use. */
10#define SECCOMP_MODE_STRICT 1 /* uses hard-coded filter. */
11#define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */
12
13/*
14 * All BPF programs must return a 32-bit value.
15 * The bottom 16-bits are for optional return data.
16 * The upper 16-bits are ordered from least permissive values to most.
17 *
18 * The ordering ensures that a min_t() over composed return values always
19 * selects the least permissive choice.
20 */
21#define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */
22#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
23#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
24#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */
25#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
26
27/* Masks for the return value sections. */
28#define SECCOMP_RET_ACTION 0x7fff0000U
29#define SECCOMP_RET_DATA 0x0000ffffU
30
31/**
32 * struct seccomp_data - the format the BPF program executes over.
33 * @nr: the system call number
34 * @arch: indicates system call convention as an AUDIT_ARCH_* value
35 * as defined in <linux/audit.h>.
36 * @instruction_pointer: at the time of the system call.
37 * @args: up to 6 system call arguments always stored as 64-bit values
38 * regardless of the architecture.
39 */
40struct seccomp_data {
41 int nr;
42 __u32 arch;
43 __u64 instruction_pointer;
44 __u64 args[6];
45};
46
47#ifdef __KERNEL__
48#ifdef CONFIG_SECCOMP 6#ifdef CONFIG_SECCOMP
49 7
50#include <linux/thread_info.h> 8#include <linux/thread_info.h>
@@ -129,5 +87,4 @@ static inline void get_seccomp_filter(struct task_struct *tsk)
129 return; 87 return;
130} 88}
131#endif /* CONFIG_SECCOMP_FILTER */ 89#endif /* CONFIG_SECCOMP_FILTER */
132#endif /* __KERNEL__ */
133#endif /* _LINUX_SECCOMP_H */ 90#endif /* _LINUX_SECCOMP_H */
diff --git a/include/linux/securebits.h b/include/linux/securebits.h
index 33406174cbe..da1b33b33af 100644
--- a/include/linux/securebits.h
+++ b/include/linux/securebits.h
@@ -1,54 +1,7 @@
1#ifndef _LINUX_SECUREBITS_H 1#ifndef _LINUX_SECUREBITS_H
2#define _LINUX_SECUREBITS_H 1 2#define _LINUX_SECUREBITS_H 1
3 3
4/* Each securesetting is implemented using two bits. One bit specifies 4#include <uapi/linux/securebits.h>
5 whether the setting is on or off. The other bit specify whether the
6 setting is locked or not. A setting which is locked cannot be
7 changed from user-level. */
8#define issecure_mask(X) (1 << (X))
9#ifdef __KERNEL__
10#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
11#endif
12
13#define SECUREBITS_DEFAULT 0x00000000
14
15/* When set UID 0 has no special privileges. When unset, we support
16 inheritance of root-permissions and suid-root executable under
17 compatibility mode. We raise the effective and inheritable bitmasks
18 *of the executable file* if the effective uid of the new process is
19 0. If the real uid is 0, we raise the effective (legacy) bit of the
20 executable file. */
21#define SECURE_NOROOT 0
22#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */
23
24#define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT))
25#define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED))
26
27/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
28 When unset, to provide compatiblility with old programs relying on
29 set*uid to gain/lose privilege, transitions to/from uid 0 cause
30 capabilities to be gained/lost. */
31#define SECURE_NO_SETUID_FIXUP 2
32#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */
33
34#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
35#define SECBIT_NO_SETUID_FIXUP_LOCKED \
36 (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
37
38/* When set, a process can retain its capabilities even after
39 transitioning to a non-root user (the set-uid fixup suppressed by
40 bit 2). Bit-4 is cleared when a process calls exec(); setting both
41 bit 4 and 5 will create a barrier through exec that no exec()'d
42 child can use this feature again. */
43#define SECURE_KEEP_CAPS 4
44#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */
45
46#define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS))
47#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
48
49#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \
50 issecure_mask(SECURE_NO_SETUID_FIXUP) | \
51 issecure_mask(SECURE_KEEP_CAPS))
52#define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1)
53 5
6#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
54#endif /* !_LINUX_SECUREBITS_H */ 7#endif /* !_LINUX_SECUREBITS_H */
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 10d6b226afc..53d42650b19 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -1,85 +1,10 @@
1#ifndef _LINUX_SEM_H 1#ifndef _LINUX_SEM_H
2#define _LINUX_SEM_H 2#define _LINUX_SEM_H
3 3
4#include <linux/ipc.h>
5
6/* semop flags */
7#define SEM_UNDO 0x1000 /* undo the operation on exit */
8
9/* semctl Command Definitions. */
10#define GETPID 11 /* get sempid */
11#define GETVAL 12 /* get semval */
12#define GETALL 13 /* get all semval's */
13#define GETNCNT 14 /* get semncnt */
14#define GETZCNT 15 /* get semzcnt */
15#define SETVAL 16 /* set semval */
16#define SETALL 17 /* set all semval's */
17
18/* ipcs ctl cmds */
19#define SEM_STAT 18
20#define SEM_INFO 19
21
22/* Obsolete, used only for backwards compatibility and libc5 compiles */
23struct semid_ds {
24 struct ipc_perm sem_perm; /* permissions .. see ipc.h */
25 __kernel_time_t sem_otime; /* last semop time */
26 __kernel_time_t sem_ctime; /* last change time */
27 struct sem *sem_base; /* ptr to first semaphore in array */
28 struct sem_queue *sem_pending; /* pending operations to be processed */
29 struct sem_queue **sem_pending_last; /* last pending operation */
30 struct sem_undo *undo; /* undo requests on this array */
31 unsigned short sem_nsems; /* no. of semaphores in array */
32};
33
34/* Include the definition of semid64_ds */
35#include <asm/sembuf.h>
36
37/* semop system calls takes an array of these. */
38struct sembuf {
39 unsigned short sem_num; /* semaphore index in array */
40 short sem_op; /* semaphore operation */
41 short sem_flg; /* operation flags */
42};
43
44/* arg for semctl system calls. */
45union semun {
46 int val; /* value for SETVAL */
47 struct semid_ds __user *buf; /* buffer for IPC_STAT & IPC_SET */
48 unsigned short __user *array; /* array for GETALL & SETALL */
49 struct seminfo __user *__buf; /* buffer for IPC_INFO */
50 void __user *__pad;
51};
52
53struct seminfo {
54 int semmap;
55 int semmni;
56 int semmns;
57 int semmnu;
58 int semmsl;
59 int semopm;
60 int semume;
61 int semusz;
62 int semvmx;
63 int semaem;
64};
65
66#define SEMMNI 128 /* <= IPCMNI max # of semaphore identifiers */
67#define SEMMSL 250 /* <= 8 000 max num of semaphores per id */
68#define SEMMNS (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
69#define SEMOPM 32 /* <= 1 000 max num of ops per semop call */
70#define SEMVMX 32767 /* <= 32767 semaphore maximum value */
71#define SEMAEM SEMVMX /* adjust on exit max value */
72
73/* unused */
74#define SEMUME SEMOPM /* max num of undo entries per process */
75#define SEMMNU SEMMNS /* num of undo structures system wide */
76#define SEMMAP SEMMNS /* # of entries in semaphore map */
77#define SEMUSZ 20 /* sizeof struct sem_undo */
78
79#ifdef __KERNEL__
80#include <linux/atomic.h> 4#include <linux/atomic.h>
81#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
82#include <linux/cache.h> 6#include <linux/cache.h>
7#include <uapi/linux/sem.h>
83 8
84struct task_struct; 9struct task_struct;
85 10
@@ -122,6 +47,4 @@ static inline void exit_sem(struct task_struct *tsk)
122} 47}
123#endif 48#endif
124 49
125#endif /* __KERNEL__ */
126
127#endif /* _LINUX_SEM_H */ 50#endif /* _LINUX_SEM_H */
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 861e51de476..0916107c77f 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -6,16 +6,11 @@
6 * Redistribution of this file is permitted under the terms of the GNU 6 * Redistribution of this file is permitted under the terms of the GNU
7 * Public License (GPL) 7 * Public License (GPL)
8 */ 8 */
9
10#ifndef _LINUX_SERIAL_H 9#ifndef _LINUX_SERIAL_H
11#define _LINUX_SERIAL_H 10#define _LINUX_SERIAL_H
12 11
13#include <linux/types.h>
14
15#include <linux/tty_flags.h>
16
17#ifdef __KERNEL__
18#include <asm/page.h> 12#include <asm/page.h>
13#include <uapi/linux/serial.h>
19 14
20 15
21/* 16/*
@@ -33,118 +28,6 @@ struct async_icount {
33 */ 28 */
34#define SERIAL_XMIT_SIZE PAGE_SIZE 29#define SERIAL_XMIT_SIZE PAGE_SIZE
35 30
36#endif
37
38struct serial_struct {
39 int type;
40 int line;
41 unsigned int port;
42 int irq;
43 int flags;
44 int xmit_fifo_size;
45 int custom_divisor;
46 int baud_base;
47 unsigned short close_delay;
48 char io_type;
49 char reserved_char[1];
50 int hub6;
51 unsigned short closing_wait; /* time to wait before closing */
52 unsigned short closing_wait2; /* no longer used... */
53 unsigned char *iomem_base;
54 unsigned short iomem_reg_shift;
55 unsigned int port_high;
56 unsigned long iomap_base; /* cookie passed into ioremap */
57};
58
59/*
60 * For the close wait times, 0 means wait forever for serial port to
61 * flush its output. 65535 means don't wait at all.
62 */
63#define ASYNC_CLOSING_WAIT_INF 0
64#define ASYNC_CLOSING_WAIT_NONE 65535
65
66/*
67 * These are the supported serial types.
68 */
69#define PORT_UNKNOWN 0
70#define PORT_8250 1
71#define PORT_16450 2
72#define PORT_16550 3
73#define PORT_16550A 4
74#define PORT_CIRRUS 5 /* usurped by cyclades.c */
75#define PORT_16650 6
76#define PORT_16650V2 7
77#define PORT_16750 8
78#define PORT_STARTECH 9 /* usurped by cyclades.c */
79#define PORT_16C950 10 /* Oxford Semiconductor */
80#define PORT_16654 11
81#define PORT_16850 12
82#define PORT_RSA 13 /* RSA-DV II/S card */
83#define PORT_MAX 13
84
85#define SERIAL_IO_PORT 0
86#define SERIAL_IO_HUB6 1
87#define SERIAL_IO_MEM 2
88
89#define UART_CLEAR_FIFO 0x01
90#define UART_USE_FIFO 0x02
91#define UART_STARTECH 0x04
92#define UART_NATSEMI 0x08
93
94
95/*
96 * Multiport serial configuration structure --- external structure
97 */
98struct serial_multiport_struct {
99 int irq;
100 int port1;
101 unsigned char mask1, match1;
102 int port2;
103 unsigned char mask2, match2;
104 int port3;
105 unsigned char mask3, match3;
106 int port4;
107 unsigned char mask4, match4;
108 int port_monitor;
109 int reserved[32];
110};
111
112/*
113 * Serial input interrupt line counters -- external structure
114 * Four lines can interrupt: CTS, DSR, RI, DCD
115 */
116struct serial_icounter_struct {
117 int cts, dsr, rng, dcd;
118 int rx, tx;
119 int frame, overrun, parity, brk;
120 int buf_overrun;
121 int reserved[9];
122};
123
124/*
125 * Serial interface for controlling RS485 settings on chips with suitable
126 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
127 * platform. The set function returns the new state, with any unsupported bits
128 * reverted appropriately.
129 */
130
131struct serial_rs485 {
132 __u32 flags; /* RS485 feature flags */
133#define SER_RS485_ENABLED (1 << 0) /* If enabled */
134#define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for
135 RTS pin when
136 sending */
137#define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for
138 RTS pin after sent*/
139#define SER_RS485_RX_DURING_TX (1 << 4)
140 __u32 delay_rts_before_send; /* Delay before send (milliseconds) */
141 __u32 delay_rts_after_send; /* Delay after send (milliseconds) */
142 __u32 padding[5]; /* Memory is cheap, new structs
143 are a royal PITA .. */
144};
145
146#ifdef __KERNEL__
147#include <linux/compiler.h> 31#include <linux/compiler.h>
148 32
149#endif /* __KERNEL__ */
150#endif /* _LINUX_SERIAL_H */ 33#endif /* _LINUX_SERIAL_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f9b22ec7a9f..3c430228d23 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -20,202 +20,6 @@
20#ifndef LINUX_SERIAL_CORE_H 20#ifndef LINUX_SERIAL_CORE_H
21#define LINUX_SERIAL_CORE_H 21#define LINUX_SERIAL_CORE_H
22 22
23#include <linux/serial.h>
24
25/*
26 * The type definitions. These are from Ted Ts'o's serial.h
27 */
28#define PORT_UNKNOWN 0
29#define PORT_8250 1
30#define PORT_16450 2
31#define PORT_16550 3
32#define PORT_16550A 4
33#define PORT_CIRRUS 5
34#define PORT_16650 6
35#define PORT_16650V2 7
36#define PORT_16750 8
37#define PORT_STARTECH 9
38#define PORT_16C950 10
39#define PORT_16654 11
40#define PORT_16850 12
41#define PORT_RSA 13
42#define PORT_NS16550A 14
43#define PORT_XSCALE 15
44#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
45#define PORT_OCTEON 17 /* Cavium OCTEON internal UART */
46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
51#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
52#define PORT_MAX_8250 23 /* max port ID */
53
54/*
55 * ARM specific type numbers. These are not currently guaranteed
56 * to be implemented, and will change in the future. These are
57 * separate so any additions to the old serial.c that occur before
58 * we are merged can be easily merged here.
59 */
60#define PORT_PXA 31
61#define PORT_AMBA 32
62#define PORT_CLPS711X 33
63#define PORT_SA1100 34
64#define PORT_UART00 35
65#define PORT_21285 37
66
67/* Sparc type numbers. */
68#define PORT_SUNZILOG 38
69#define PORT_SUNSAB 39
70
71/* DEC */
72#define PORT_DZ 46
73#define PORT_ZS 47
74
75/* Parisc type numbers. */
76#define PORT_MUX 48
77
78/* Atmel AT91 / AT32 SoC */
79#define PORT_ATMEL 49
80
81/* Macintosh Zilog type numbers */
82#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
83#define PORT_PMAC_ZILOG 51
84
85/* SH-SCI */
86#define PORT_SCI 52
87#define PORT_SCIF 53
88#define PORT_IRDA 54
89
90/* Samsung S3C2410 SoC and derivatives thereof */
91#define PORT_S3C2410 55
92
93/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
94#define PORT_IP22ZILOG 56
95
96/* Sharp LH7a40x -- an ARM9 SoC series */
97#define PORT_LH7A40X 57
98
99/* PPC CPM type number */
100#define PORT_CPM 58
101
102/* MPC52xx (and MPC512x) type numbers */
103#define PORT_MPC52xx 59
104
105/* IBM icom */
106#define PORT_ICOM 60
107
108/* Samsung S3C2440 SoC */
109#define PORT_S3C2440 61
110
111/* Motorola i.MX SoC */
112#define PORT_IMX 62
113
114/* Marvell MPSC */
115#define PORT_MPSC 63
116
117/* TXX9 type number */
118#define PORT_TXX9 64
119
120/* NEC VR4100 series SIU/DSIU */
121#define PORT_VR41XX_SIU 65
122#define PORT_VR41XX_DSIU 66
123
124/* Samsung S3C2400 SoC */
125#define PORT_S3C2400 67
126
127/* M32R SIO */
128#define PORT_M32R_SIO 68
129
130/*Digi jsm */
131#define PORT_JSM 69
132
133#define PORT_PNX8XXX 70
134
135/* Hilscher netx */
136#define PORT_NETX 71
137
138/* SUN4V Hypervisor Console */
139#define PORT_SUNHV 72
140
141#define PORT_S3C2412 73
142
143/* Xilinx uartlite */
144#define PORT_UARTLITE 74
145
146/* Blackfin bf5xx */
147#define PORT_BFIN 75
148
149/* Micrel KS8695 */
150#define PORT_KS8695 76
151
152/* Broadcom SB1250, etc. SOC */
153#define PORT_SB1250_DUART 77
154
155/* Freescale ColdFire */
156#define PORT_MCF 78
157
158/* Blackfin SPORT */
159#define PORT_BFIN_SPORT 79
160
161/* MN10300 on-chip UART numbers */
162#define PORT_MN10300 80
163#define PORT_MN10300_CTS 81
164
165#define PORT_SC26XX 82
166
167/* SH-SCI */
168#define PORT_SCIFA 83
169
170#define PORT_S3C6400 84
171
172/* NWPSERIAL */
173#define PORT_NWPSERIAL 85
174
175/* MAX3100 */
176#define PORT_MAX3100 86
177
178/* Timberdale UART */
179#define PORT_TIMBUART 87
180
181/* Qualcomm MSM SoCs */
182#define PORT_MSM 88
183
184/* BCM63xx family SoCs */
185#define PORT_BCM63XX 89
186
187/* Aeroflex Gaisler GRLIB APBUART */
188#define PORT_APBUART 90
189
190/* Altera UARTs */
191#define PORT_ALTERA_JTAGUART 91
192#define PORT_ALTERA_UART 92
193
194/* SH-SCI */
195#define PORT_SCIFB 93
196
197/* MAX310X */
198#define PORT_MAX310X 94
199
200/* High Speed UART for Medfield */
201#define PORT_MFD 95
202
203/* TI OMAP-UART */
204#define PORT_OMAP 96
205
206/* VIA VT8500 SoC */
207#define PORT_VT8500 97
208
209/* Xilinx PSS UART */
210#define PORT_XUARTPS 98
211
212/* Atheros AR933X SoC */
213#define PORT_AR933X 99
214
215/* Energy Micro efm32 SoC */
216#define PORT_EFMUART 100
217
218#ifdef __KERNEL__
219 23
220#include <linux/compiler.h> 24#include <linux/compiler.h>
221#include <linux/interrupt.h> 25#include <linux/interrupt.h>
@@ -226,6 +30,7 @@
226#include <linux/mutex.h> 30#include <linux/mutex.h>
227#include <linux/sysrq.h> 31#include <linux/sysrq.h>
228#include <linux/pps_kernel.h> 32#include <linux/pps_kernel.h>
33#include <uapi/linux/serial_core.h>
229 34
230struct uart_port; 35struct uart_port;
231struct serial_struct; 36struct serial_struct;
@@ -562,6 +367,4 @@ static inline int uart_handle_break(struct uart_port *port)
562 (cflag) & CRTSCTS || \ 367 (cflag) & CRTSCTS || \
563 !((cflag) & CLOCAL)) 368 !((cflag) & CLOCAL))
564 369
565#endif
566
567#endif /* LINUX_SERIAL_CORE_H */ 370#endif /* LINUX_SERIAL_CORE_H */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 6d6cfd3e94a..36aac733840 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -1,6 +1,3 @@
1#ifndef _SERIO_H
2#define _SERIO_H
3
4/* 1/*
5 * Copyright (C) 1999-2002 Vojtech Pavlik 2 * Copyright (C) 1999-2002 Vojtech Pavlik
6* 3*
@@ -8,12 +5,9 @@
8 * under the terms of the GNU General Public License version 2 as published by 5 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 6 * the Free Software Foundation.
10 */ 7 */
8#ifndef _SERIO_H
9#define _SERIO_H
11 10
12#include <linux/ioctl.h>
13
14#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
15
16#ifdef __KERNEL__
17 11
18#include <linux/types.h> 12#include <linux/types.h>
19#include <linux/interrupt.h> 13#include <linux/interrupt.h>
@@ -22,6 +16,7 @@
22#include <linux/mutex.h> 16#include <linux/mutex.h>
23#include <linux/device.h> 17#include <linux/device.h>
24#include <linux/mod_devicetable.h> 18#include <linux/mod_devicetable.h>
19#include <uapi/linux/serio.h>
25 20
26struct serio { 21struct serio {
27 void *port_data; 22 void *port_data;
@@ -152,68 +147,3 @@ static inline void serio_continue_rx(struct serio *serio)
152} 147}
153 148
154#endif 149#endif
155
156/*
157 * bit masks for use in "interrupt" flags (3rd argument)
158 */
159#define SERIO_TIMEOUT 1
160#define SERIO_PARITY 2
161#define SERIO_FRAME 4
162
163/*
164 * Serio types
165 */
166#define SERIO_XT 0x00
167#define SERIO_8042 0x01
168#define SERIO_RS232 0x02
169#define SERIO_HIL_MLC 0x03
170#define SERIO_PS_PSTHRU 0x05
171#define SERIO_8042_XL 0x06
172
173/*
174 * Serio protocols
175 */
176#define SERIO_UNKNOWN 0x00
177#define SERIO_MSC 0x01
178#define SERIO_SUN 0x02
179#define SERIO_MS 0x03
180#define SERIO_MP 0x04
181#define SERIO_MZ 0x05
182#define SERIO_MZP 0x06
183#define SERIO_MZPP 0x07
184#define SERIO_VSXXXAA 0x08
185#define SERIO_SUNKBD 0x10
186#define SERIO_WARRIOR 0x18
187#define SERIO_SPACEORB 0x19
188#define SERIO_MAGELLAN 0x1a
189#define SERIO_SPACEBALL 0x1b
190#define SERIO_GUNZE 0x1c
191#define SERIO_IFORCE 0x1d
192#define SERIO_STINGER 0x1e
193#define SERIO_NEWTON 0x1f
194#define SERIO_STOWAWAY 0x20
195#define SERIO_H3600 0x21
196#define SERIO_PS2SER 0x22
197#define SERIO_TWIDKBD 0x23
198#define SERIO_TWIDJOY 0x24
199#define SERIO_HIL 0x25
200#define SERIO_SNES232 0x26
201#define SERIO_SEMTECH 0x27
202#define SERIO_LKKBD 0x28
203#define SERIO_ELO 0x29
204#define SERIO_MICROTOUCH 0x30
205#define SERIO_PENMOUNT 0x31
206#define SERIO_TOUCHRIGHT 0x32
207#define SERIO_TOUCHWIN 0x33
208#define SERIO_TAOSEVM 0x34
209#define SERIO_FUJITSU 0x35
210#define SERIO_ZHENHUA 0x36
211#define SERIO_INEXIO 0x37
212#define SERIO_TOUCHIT213 0x38
213#define SERIO_W8001 0x39
214#define SERIO_DYNAPRO 0x3a
215#define SERIO_HAMPSHIRE 0x3b
216#define SERIO_PS2MULT 0x3c
217#define SERIO_TSC40 0x3d
218
219#endif
diff --git a/include/linux/shm.h b/include/linux/shm.h
index edd086883cc..bcf8a6a3ec0 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -1,88 +1,11 @@
1#ifndef _LINUX_SHM_H_ 1#ifndef _LINUX_SHM_H_
2#define _LINUX_SHM_H_ 2#define _LINUX_SHM_H_
3 3
4#include <linux/ipc.h>
5#include <linux/errno.h>
6#ifdef __KERNEL__
7#include <asm/page.h> 4#include <asm/page.h>
8#else 5#include <uapi/linux/shm.h>
9#include <unistd.h>
10#endif
11
12/*
13 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
14 * be increased by sysctl
15 */
16 6
17#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
18#define SHMMIN 1 /* min shared seg size (bytes) */
19#define SHMMNI 4096 /* max num of segs system wide */
20#ifdef __KERNEL__
21#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ 7#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
22#else
23#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
24#endif
25#define SHMSEG SHMMNI /* max shared segs per process */
26
27#ifdef __KERNEL__
28#include <asm/shmparam.h> 8#include <asm/shmparam.h>
29#endif
30
31/* Obsolete, used only for backwards compatibility and libc5 compiles */
32struct shmid_ds {
33 struct ipc_perm shm_perm; /* operation perms */
34 int shm_segsz; /* size of segment (bytes) */
35 __kernel_time_t shm_atime; /* last attach time */
36 __kernel_time_t shm_dtime; /* last detach time */
37 __kernel_time_t shm_ctime; /* last change time */
38 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
39 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
40 unsigned short shm_nattch; /* no. of current attaches */
41 unsigned short shm_unused; /* compatibility */
42 void *shm_unused2; /* ditto - used by DIPC */
43 void *shm_unused3; /* unused */
44};
45
46/* Include the definition of shmid64_ds and shminfo64 */
47#include <asm/shmbuf.h>
48
49/* permission flag for shmget */
50#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
51#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
52
53/* mode for attach */
54#define SHM_RDONLY 010000 /* read-only access */
55#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
56#define SHM_REMAP 040000 /* take-over region on attach */
57#define SHM_EXEC 0100000 /* execution access */
58
59/* super user shmctl commands */
60#define SHM_LOCK 11
61#define SHM_UNLOCK 12
62
63/* ipcs ctl commands */
64#define SHM_STAT 13
65#define SHM_INFO 14
66
67/* Obsolete, used only for backwards compatibility */
68struct shminfo {
69 int shmmax;
70 int shmmin;
71 int shmmni;
72 int shmseg;
73 int shmall;
74};
75
76struct shm_info {
77 int used_ids;
78 unsigned long shm_tot; /* total allocated shm */
79 unsigned long shm_rss; /* total resident shm */
80 unsigned long shm_swp; /* total swapped shm */
81 unsigned long swap_attempts;
82 unsigned long swap_successes;
83};
84
85#ifdef __KERNEL__
86struct shmid_kernel /* private to the kernel */ 9struct shmid_kernel /* private to the kernel */
87{ 10{
88 struct kern_ipc_perm shm_perm; 11 struct kern_ipc_perm shm_perm;
@@ -127,6 +50,4 @@ static inline void exit_shm(struct task_struct *task)
127} 50}
128#endif 51#endif
129 52
130#endif /* __KERNEL__ */
131
132#endif /* _LINUX_SHM_H_ */ 53#endif /* _LINUX_SHM_H_ */
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 26b424adc84..e19a011b43b 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -1,11 +1,8 @@
1#ifndef _LINUX_SIGNAL_H 1#ifndef _LINUX_SIGNAL_H
2#define _LINUX_SIGNAL_H 2#define _LINUX_SIGNAL_H
3 3
4#include <asm/signal.h>
5#include <asm/siginfo.h>
6
7#ifdef __KERNEL__
8#include <linux/list.h> 4#include <linux/list.h>
5#include <uapi/linux/signal.h>
9 6
10struct task_struct; 7struct task_struct;
11 8
@@ -388,6 +385,4 @@ int unhandled_signal(struct task_struct *tsk, int sig);
388 385
389void signals_init(void); 386void signals_init(void);
390 387
391#endif /* __KERNEL__ */
392
393#endif /* _LINUX_SIGNAL_H */ 388#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
index 247399b2979..eadbe227c25 100644
--- a/include/linux/signalfd.h
+++ b/include/linux/signalfd.h
@@ -4,51 +4,11 @@
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> 4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
5 * 5 *
6 */ 6 */
7
8#ifndef _LINUX_SIGNALFD_H 7#ifndef _LINUX_SIGNALFD_H
9#define _LINUX_SIGNALFD_H 8#define _LINUX_SIGNALFD_H
10 9
11#include <linux/types.h> 10#include <uapi/linux/signalfd.h>
12/* For O_CLOEXEC and O_NONBLOCK */
13#include <linux/fcntl.h>
14
15/* Flags for signalfd4. */
16#define SFD_CLOEXEC O_CLOEXEC
17#define SFD_NONBLOCK O_NONBLOCK
18
19struct signalfd_siginfo {
20 __u32 ssi_signo;
21 __s32 ssi_errno;
22 __s32 ssi_code;
23 __u32 ssi_pid;
24 __u32 ssi_uid;
25 __s32 ssi_fd;
26 __u32 ssi_tid;
27 __u32 ssi_band;
28 __u32 ssi_overrun;
29 __u32 ssi_trapno;
30 __s32 ssi_status;
31 __s32 ssi_int;
32 __u64 ssi_ptr;
33 __u64 ssi_utime;
34 __u64 ssi_stime;
35 __u64 ssi_addr;
36 __u16 ssi_addr_lsb;
37 11
38 /*
39 * Pad strcture to 128 bytes. Remember to update the
40 * pad size when you add new members. We use a fixed
41 * size structure to avoid compatibility problems with
42 * future versions, and we leave extra space for additional
43 * members. We use fixed size members because this strcture
44 * comes out of a read(2) and we really don't want to have
45 * a compat on read(2).
46 */
47 __u8 __pad[46];
48};
49
50
51#ifdef __KERNEL__
52 12
53#ifdef CONFIG_SIGNALFD 13#ifdef CONFIG_SIGNALFD
54 14
@@ -71,6 +31,4 @@ static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
71 31
72#endif /* CONFIG_SIGNALFD */ 32#endif /* CONFIG_SIGNALFD */
73 33
74#endif /* __KERNEL__ */
75
76#endif /* _LINUX_SIGNALFD_H */ 34#endif /* _LINUX_SIGNALFD_H */
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index e3e395acc2f..e8d702e0fd8 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -1,29 +1,8 @@
1#ifndef __SOCK_DIAG_H__ 1#ifndef __SOCK_DIAG_H__
2#define __SOCK_DIAG_H__ 2#define __SOCK_DIAG_H__
3 3
4#include <linux/types.h> 4#include <uapi/linux/sock_diag.h>
5 5
6#define SOCK_DIAG_BY_FAMILY 20
7
8struct sock_diag_req {
9 __u8 sdiag_family;
10 __u8 sdiag_protocol;
11};
12
13enum {
14 SK_MEMINFO_RMEM_ALLOC,
15 SK_MEMINFO_RCVBUF,
16 SK_MEMINFO_WMEM_ALLOC,
17 SK_MEMINFO_SNDBUF,
18 SK_MEMINFO_FWD_ALLOC,
19 SK_MEMINFO_WMEM_QUEUED,
20 SK_MEMINFO_OPTMEM,
21 SK_MEMINFO_BACKLOG,
22
23 SK_MEMINFO_VARS,
24};
25
26#ifdef __KERNEL__
27struct sk_buff; 6struct sk_buff;
28struct nlmsghdr; 7struct nlmsghdr;
29struct sock; 8struct sock;
@@ -44,5 +23,4 @@ void sock_diag_save_cookie(void *sk, __u32 *cookie);
44 23
45int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); 24int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
46 25
47#endif /* KERNEL */
48#endif 26#endif
diff --git a/include/linux/socket.h b/include/linux/socket.h
index ba7b2e817cf..9a546ff853d 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -1,30 +1,13 @@
1#ifndef _LINUX_SOCKET_H 1#ifndef _LINUX_SOCKET_H
2#define _LINUX_SOCKET_H 2#define _LINUX_SOCKET_H
3 3
4/*
5 * Desired design of maximum size and alignment (see RFC2553)
6 */
7#define _K_SS_MAXSIZE 128 /* Implementation specific max size */
8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
9 /* Implementation specific desired alignment */
10
11typedef unsigned short __kernel_sa_family_t;
12
13struct __kernel_sockaddr_storage {
14 __kernel_sa_family_t ss_family; /* address family */
15 /* Following field(s) are implementation specific */
16 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
17 /* space to achieve desired size, */
18 /* _SS_MAXSIZE value minus size of ss_family */
19} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
20
21#ifdef __KERNEL__
22 4
23#include <asm/socket.h> /* arch-dependent defines */ 5#include <asm/socket.h> /* arch-dependent defines */
24#include <linux/sockios.h> /* the SIOCxxx I/O controls */ 6#include <linux/sockios.h> /* the SIOCxxx I/O controls */
25#include <linux/uio.h> /* iovec support */ 7#include <linux/uio.h> /* iovec support */
26#include <linux/types.h> /* pid_t */ 8#include <linux/types.h> /* pid_t */
27#include <linux/compiler.h> /* __user */ 9#include <linux/compiler.h> /* __user */
10#include <uapi/linux/socket.h>
28 11
29struct pid; 12struct pid;
30struct cred; 13struct cred;
@@ -340,5 +323,4 @@ extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen
340 unsigned int flags, struct timespec *timeout); 323 unsigned int flags, struct timespec *timeout);
341extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, 324extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg,
342 unsigned int vlen, unsigned int flags); 325 unsigned int vlen, unsigned int flags);
343#endif /* not kernel and not glibc */
344#endif /* _LINUX_SOCKET_H */ 326#endif /* _LINUX_SOCKET_H */
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index de8832dd272..680f9a31df2 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -1,64 +1,10 @@
1/* sonet.h - SONET/SHD physical layer control */ 1/* sonet.h - SONET/SHD physical layer control */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef LINUX_SONET_H 2#ifndef LINUX_SONET_H
7#define LINUX_SONET_H 3#define LINUX_SONET_H
8 4
9#define __SONET_ITEMS \
10 __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
11 __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
12 __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
13 __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
14 __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
15 __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
16 __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
17 __HANDLE_ITEM(tx_cells); /* cells sent */ \
18 __HANDLE_ITEM(rx_cells); /* cells received */
19
20struct sonet_stats {
21#define __HANDLE_ITEM(i) int i
22 __SONET_ITEMS
23#undef __HANDLE_ITEM
24} __attribute__ ((packed));
25
26
27#define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
28 /* get statistics */
29#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
30 /* ... and zero counters */
31#define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
32 /* set error insertion */
33#define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
34 /* clear error insertion */
35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
36 /* query error insertion */
37#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
38 /* set framing mode (SONET/SDH) */
39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
40 /* get framing mode */
41#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
42 unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
43
44#define SONET_INS_SBIP 1 /* section BIP */
45#define SONET_INS_LBIP 2 /* line BIP */
46#define SONET_INS_PBIP 4 /* path BIP */
47#define SONET_INS_FRAME 8 /* out of frame */
48#define SONET_INS_LOS 16 /* set line to zero */
49#define SONET_INS_LAIS 32 /* line alarm indication signal */
50#define SONET_INS_PAIS 64 /* path alarm indication signal */
51#define SONET_INS_HCS 128 /* insert HCS error */
52
53#define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
54#define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
55
56#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
57
58
59#ifdef __KERNEL__
60 5
61#include <linux/atomic.h> 6#include <linux/atomic.h>
7#include <uapi/linux/sonet.h>
62 8
63struct k_sonet_stats { 9struct k_sonet_stats {
64#define __HANDLE_ITEM(i) atomic_t i 10#define __HANDLE_ITEM(i) atomic_t i
@@ -71,5 +17,3 @@ extern void sonet_subtract_stats(struct k_sonet_stats *from,
71 struct sonet_stats *to); 17 struct sonet_stats *to);
72 18
73#endif 19#endif
74
75#endif
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index c0f87da78f8..0b7cc265cc0 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -32,117 +32,11 @@
32 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 32 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 * 33 *
34 */ 34 */
35
36#ifndef _SONYPI_H_ 35#ifndef _SONYPI_H_
37#define _SONYPI_H_ 36#define _SONYPI_H_
38 37
39#include <linux/types.h> 38#include <uapi/linux/sonypi.h>
40
41/* events the user application reading /dev/sonypi can use */
42
43#define SONYPI_EVENT_IGNORE 0
44#define SONYPI_EVENT_JOGDIAL_DOWN 1
45#define SONYPI_EVENT_JOGDIAL_UP 2
46#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED 3
47#define SONYPI_EVENT_JOGDIAL_UP_PRESSED 4
48#define SONYPI_EVENT_JOGDIAL_PRESSED 5
49#define SONYPI_EVENT_JOGDIAL_RELEASED 6 /* obsolete */
50#define SONYPI_EVENT_CAPTURE_PRESSED 7
51#define SONYPI_EVENT_CAPTURE_RELEASED 8 /* obsolete */
52#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED 9
53#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED 10
54#define SONYPI_EVENT_FNKEY_ESC 11
55#define SONYPI_EVENT_FNKEY_F1 12
56#define SONYPI_EVENT_FNKEY_F2 13
57#define SONYPI_EVENT_FNKEY_F3 14
58#define SONYPI_EVENT_FNKEY_F4 15
59#define SONYPI_EVENT_FNKEY_F5 16
60#define SONYPI_EVENT_FNKEY_F6 17
61#define SONYPI_EVENT_FNKEY_F7 18
62#define SONYPI_EVENT_FNKEY_F8 19
63#define SONYPI_EVENT_FNKEY_F9 20
64#define SONYPI_EVENT_FNKEY_F10 21
65#define SONYPI_EVENT_FNKEY_F11 22
66#define SONYPI_EVENT_FNKEY_F12 23
67#define SONYPI_EVENT_FNKEY_1 24
68#define SONYPI_EVENT_FNKEY_2 25
69#define SONYPI_EVENT_FNKEY_D 26
70#define SONYPI_EVENT_FNKEY_E 27
71#define SONYPI_EVENT_FNKEY_F 28
72#define SONYPI_EVENT_FNKEY_S 29
73#define SONYPI_EVENT_FNKEY_B 30
74#define SONYPI_EVENT_BLUETOOTH_PRESSED 31
75#define SONYPI_EVENT_PKEY_P1 32
76#define SONYPI_EVENT_PKEY_P2 33
77#define SONYPI_EVENT_PKEY_P3 34
78#define SONYPI_EVENT_BACK_PRESSED 35
79#define SONYPI_EVENT_LID_CLOSED 36
80#define SONYPI_EVENT_LID_OPENED 37
81#define SONYPI_EVENT_BLUETOOTH_ON 38
82#define SONYPI_EVENT_BLUETOOTH_OFF 39
83#define SONYPI_EVENT_HELP_PRESSED 40
84#define SONYPI_EVENT_FNKEY_ONLY 41
85#define SONYPI_EVENT_JOGDIAL_FAST_DOWN 42
86#define SONYPI_EVENT_JOGDIAL_FAST_UP 43
87#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
88#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED 45
89#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN 46
90#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
91#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
92#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
93#define SONYPI_EVENT_ZOOM_PRESSED 50
94#define SONYPI_EVENT_THUMBPHRASE_PRESSED 51
95#define SONYPI_EVENT_MEYE_FACE 52
96#define SONYPI_EVENT_MEYE_OPPOSITE 53
97#define SONYPI_EVENT_MEMORYSTICK_INSERT 54
98#define SONYPI_EVENT_MEMORYSTICK_EJECT 55
99#define SONYPI_EVENT_ANYBUTTON_RELEASED 56
100#define SONYPI_EVENT_BATTERY_INSERT 57
101#define SONYPI_EVENT_BATTERY_REMOVE 58
102#define SONYPI_EVENT_FNKEY_RELEASED 59
103#define SONYPI_EVENT_WIRELESS_ON 60
104#define SONYPI_EVENT_WIRELESS_OFF 61
105#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
106#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
107#define SONYPI_EVENT_CD_EJECT_PRESSED 64
108#define SONYPI_EVENT_MODEKEY_PRESSED 65
109#define SONYPI_EVENT_PKEY_P4 66
110#define SONYPI_EVENT_PKEY_P5 67
111#define SONYPI_EVENT_SETTINGKEY_PRESSED 68
112#define SONYPI_EVENT_VOLUME_INC_PRESSED 69
113#define SONYPI_EVENT_VOLUME_DEC_PRESSED 70
114#define SONYPI_EVENT_BRIGHTNESS_PRESSED 71
115#define SONYPI_EVENT_MEDIA_PRESSED 72
116#define SONYPI_EVENT_VENDOR_PRESSED 73
117
118/* get/set brightness */
119#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
120#define SONYPI_IOCSBRT _IOW('v', 0, __u8)
121
122/* get battery full capacity/remaining capacity */
123#define SONYPI_IOCGBAT1CAP _IOR('v', 2, __u16)
124#define SONYPI_IOCGBAT1REM _IOR('v', 3, __u16)
125#define SONYPI_IOCGBAT2CAP _IOR('v', 4, __u16)
126#define SONYPI_IOCGBAT2REM _IOR('v', 5, __u16)
127 39
128/* get battery flags: battery1/battery2/ac adapter present */
129#define SONYPI_BFLAGS_B1 0x01
130#define SONYPI_BFLAGS_B2 0x02
131#define SONYPI_BFLAGS_AC 0x04
132#define SONYPI_IOCGBATFLAGS _IOR('v', 7, __u8)
133
134/* get/set bluetooth subsystem state on/off */
135#define SONYPI_IOCGBLUE _IOR('v', 8, __u8)
136#define SONYPI_IOCSBLUE _IOW('v', 9, __u8)
137
138/* get/set fan state on/off */
139#define SONYPI_IOCGFAN _IOR('v', 10, __u8)
140#define SONYPI_IOCSFAN _IOW('v', 11, __u8)
141
142/* get temperature (C) */
143#define SONYPI_IOCGTEMP _IOR('v', 12, __u8)
144
145#ifdef __KERNEL__
146 40
147/* used only for communication between v4l and sonypi */ 41/* used only for communication between v4l and sonypi */
148 42
@@ -166,6 +60,4 @@
166#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ 60#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */
167#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ 61#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */
168 62
169#endif /* __KERNEL__ */
170
171#endif /* _SONYPI_H_ */ 63#endif /* _SONYPI_H_ */
diff --git a/include/linux/sound.h b/include/linux/sound.h
index fae20ba01fb..73ded040f1d 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -1,33 +1,8 @@
1#ifndef _LINUX_SOUND_H 1#ifndef _LINUX_SOUND_H
2#define _LINUX_SOUND_H 2#define _LINUX_SOUND_H
3 3
4/* 4#include <uapi/linux/sound.h>
5 * Minor numbers for the sound driver.
6 */
7
8#include <linux/fs.h>
9 5
10#define SND_DEV_CTL 0 /* Control port /dev/mixer */
11#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
12 synthesizer and MIDI output) */
13#define SND_DEV_MIDIN 2 /* Raw midi access */
14#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
15#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
16#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
17/* #define SND_DEV_STATUS 6 */ /* /dev/sndstat (obsolete) */
18#define SND_DEV_UNUSED 6
19#define SND_DEV_AWFM 7 /* Reserved */
20#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
21/* #define SND_DEV_SNDPROC 9 */ /* /dev/sndproc for programmable devices (not used) */
22/* #define SND_DEV_DMMIDI 9 */
23#define SND_DEV_SYNTH 9 /* Raw synth access /dev/synth (same as /dev/dmfm) */
24#define SND_DEV_DMFM 10 /* Raw synth access /dev/dmfm */
25#define SND_DEV_UNKNOWN11 11
26#define SND_DEV_ADSP 12 /* Like /dev/dsp (obsolete) */
27#define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
28#define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
29
30#ifdef __KERNEL__
31/* 6/*
32 * Sound core interface functions 7 * Sound core interface functions
33 */ 8 */
@@ -43,6 +18,4 @@ extern void unregister_sound_special(int unit);
43extern void unregister_sound_mixer(int unit); 18extern void unregister_sound_mixer(int unit);
44extern void unregister_sound_midi(int unit); 19extern void unregister_sound_midi(int unit);
45extern void unregister_sound_dsp(int unit); 20extern void unregister_sound_dsp(int unit);
46#endif /* __KERNEL__ */
47
48#endif /* _LINUX_SOUND_H */ 21#endif /* _LINUX_SOUND_H */
diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h
index dfcf86f013a..96c79cbd79e 100644
--- a/include/linux/soundcard.h
+++ b/include/linux/soundcard.h
@@ -1,5 +1,3 @@
1#ifndef SOUNDCARD_H
2#define SOUNDCARD_H
3/* 1/*
4 * Copyright by Hannu Savolainen 1993-1997 2 * Copyright by Hannu Savolainen 1993-1997
5 * 3 *
@@ -23,174 +21,12 @@
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE. 22 * SUCH DAMAGE.
25 */ 23 */
24#ifndef SOUNDCARD_H
25#define SOUNDCARD_H
26 26
27
28/*
29 * OSS interface version. With versions earlier than 3.6 this value is
30 * an integer with value less than 361. In versions 3.6 and later
31 * it's a six digit hexadecimal value. For example value
32 * of 0x030600 represents OSS version 3.6.0.
33 * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
34 * the currently active driver.
35 */
36#define SOUND_VERSION 0x030802
37#define OPEN_SOUND_SYSTEM
38
39/* In Linux we need to be prepared for cross compiling */
40#include <linux/ioctl.h>
41
42/* Endian macros. */
43#ifdef __KERNEL__
44# include <asm/byteorder.h> 27# include <asm/byteorder.h>
45#else 28#include <uapi/linux/soundcard.h>
46# include <endian.h>
47#endif
48
49/*
50 * Supported card ID numbers (Should be somewhere else?)
51 */
52
53#define SNDCARD_ADLIB 1
54#define SNDCARD_SB 2
55#define SNDCARD_PAS 3
56#define SNDCARD_GUS 4
57#define SNDCARD_MPU401 5
58#define SNDCARD_SB16 6
59#define SNDCARD_SB16MIDI 7
60#define SNDCARD_UART6850 8
61#define SNDCARD_GUS16 9
62#define SNDCARD_MSS 10
63#define SNDCARD_PSS 11
64#define SNDCARD_SSCAPE 12
65#define SNDCARD_PSS_MPU 13
66#define SNDCARD_PSS_MSS 14
67#define SNDCARD_SSCAPE_MSS 15
68#define SNDCARD_TRXPRO 16
69#define SNDCARD_TRXPRO_SB 17
70#define SNDCARD_TRXPRO_MPU 18
71#define SNDCARD_MAD16 19
72#define SNDCARD_MAD16_MPU 20
73#define SNDCARD_CS4232 21
74#define SNDCARD_CS4232_MPU 22
75#define SNDCARD_MAUI 23
76#define SNDCARD_PSEUDO_MSS 24
77#define SNDCARD_GUSPNP 25
78#define SNDCARD_UART401 26
79/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
80
81/***********************************
82 * IOCTL Commands for /dev/sequencer
83 */
84
85#ifndef _SIOWR
86#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
87/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
88#define SIOCPARM_MASK IOCPARM_MASK
89#define SIOC_VOID IOC_VOID
90#define SIOC_OUT IOC_OUT
91#define SIOC_IN IOC_IN
92#define SIOC_INOUT IOC_INOUT
93#define _SIOC_SIZE _IOC_SIZE
94#define _SIOC_DIR _IOC_DIR
95#define _SIOC_NONE _IOC_NONE
96#define _SIOC_READ _IOC_READ
97#define _SIOC_WRITE _IOC_WRITE
98#define _SIO _IO
99#define _SIOR _IOR
100#define _SIOW _IOW
101#define _SIOWR _IOWR
102#else
103 29
104/* Ioctl's have the command encoded in the lower word,
105 * and the size of any in or out parameters in the upper
106 * word. The high 2 bits of the upper word are used
107 * to encode the in/out status of the parameter; for now
108 * we restrict parameters to at most 8191 bytes.
109 */
110/* #define SIOCTYPE (0xff<<8) */
111#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
112#define SIOC_VOID 0x00000000 /* no parameters */
113#define SIOC_OUT 0x20000000 /* copy out parameters */
114#define SIOC_IN 0x40000000 /* copy in parameters */
115#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
116/* the 0x20000000 is so we can distinguish new ioctl's from old */
117#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
118#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
119#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
120/* this should be _SIORW, but stdio got there first */
121#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
122#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
123#define _SIOC_DIR(x) (x & 0xf0000000)
124#define _SIOC_NONE SIOC_VOID
125#define _SIOC_READ SIOC_OUT
126#define _SIOC_WRITE SIOC_IN
127# endif /* _IOWR */
128#endif /* !_SIOWR */
129
130#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
131#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
132#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
133#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
134#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
135#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
136#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
137#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
138#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
139#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
140#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
141#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
142#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
143#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
144#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
145#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
146#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
147#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
148#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
149#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
150#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
151#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
152
153typedef struct synth_control
154{
155 int devno; /* Synthesizer # */
156 char data[4000]; /* Device spesific command/data record */
157}synth_control;
158
159typedef struct remove_sample
160{
161 int devno; /* Synthesizer # */
162 int bankno; /* MIDI bank # (0=General MIDI) */
163 int instrno; /* MIDI instrument number */
164} remove_sample;
165
166typedef struct seq_event_rec {
167 unsigned char arr[8];
168} seq_event_rec;
169
170#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
171#define SNDCTL_TMR_START _SIO ('T', 2)
172#define SNDCTL_TMR_STOP _SIO ('T', 3)
173#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
174#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
175#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
176# define TMR_INTERNAL 0x00000001
177# define TMR_EXTERNAL 0x00000002
178# define TMR_MODE_MIDI 0x00000010
179# define TMR_MODE_FSK 0x00000020
180# define TMR_MODE_CLS 0x00000040
181# define TMR_MODE_SMPTE 0x00000080
182#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
183#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
184
185/*
186 * Some big endian/little endian handling macros
187 */
188
189#define _LINUX_PATCHKEY_H_INDIRECT
190#include <linux/patchkey.h>
191#undef _LINUX_PATCHKEY_H_INDIRECT
192
193#if defined(__KERNEL__)
194# if defined(__BIG_ENDIAN) 30# if defined(__BIG_ENDIAN)
195# define AFMT_S16_NE AFMT_S16_BE 31# define AFMT_S16_NE AFMT_S16_BE
196# elif defined(__LITTLE_ENDIAN) 32# elif defined(__LITTLE_ENDIAN)
@@ -198,1095 +34,4 @@ typedef struct seq_event_rec {
198# else 34# else
199# error "could not determine byte order" 35# error "could not determine byte order"
200# endif 36# endif
201#else
202# if defined(__BYTE_ORDER)
203# if __BYTE_ORDER == __BIG_ENDIAN
204# define AFMT_S16_NE AFMT_S16_BE
205# elif __BYTE_ORDER == __LITTLE_ENDIAN
206# define AFMT_S16_NE AFMT_S16_LE
207# else
208# error "could not determine byte order"
209# endif
210# endif
211#endif
212
213/*
214 * Sample loading mechanism for internal synthesizers (/dev/sequencer)
215 * The following patch_info structure has been designed to support
216 * Gravis UltraSound. It tries to be universal format for uploading
217 * sample based patches but is probably too limited.
218 *
219 * (PBD) As Hannu guessed, the GUS structure is too limited for
220 * the WaveFront, but this is the right place for a constant definition.
221 */
222
223struct patch_info {
224 unsigned short key; /* Use WAVE_PATCH here */
225#define WAVE_PATCH _PATCHKEY(0x04)
226#define GUS_PATCH WAVE_PATCH
227#define WAVEFRONT_PATCH _PATCHKEY(0x06)
228
229 short device_no; /* Synthesizer number */
230 short instr_no; /* Midi pgm# */
231
232 unsigned int mode;
233/*
234 * The least significant byte has the same format than the GUS .PAT
235 * files
236 */
237#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
238#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
239#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
240#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
241#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
242#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
243#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
244#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
245 /* (use the env_rate/env_offs fields). */
246/* Linux specific bits */
247#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
248#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
249#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
250#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
251/* Reserved bits */
252#define WAVE_ROM 0x40000000 /* For future use */
253#define WAVE_MULAW 0x20000000 /* For future use */
254/* Other bits must be zeroed */
255
256 int len; /* Size of the wave data in bytes */
257 int loop_start, loop_end; /* Byte offsets from the beginning */
258
259/*
260 * The base_freq and base_note fields are used when computing the
261 * playback speed for a note. The base_note defines the tone frequency
262 * which is heard if the sample is played using the base_freq as the
263 * playback speed.
264 *
265 * The low_note and high_note fields define the minimum and maximum note
266 * frequencies for which this sample is valid. It is possible to define
267 * more than one samples for an instrument number at the same time. The
268 * low_note and high_note fields are used to select the most suitable one.
269 *
270 * The fields base_note, high_note and low_note should contain
271 * the note frequency multiplied by 1000. For example value for the
272 * middle A is 440*1000.
273 */
274
275 unsigned int base_freq;
276 unsigned int base_note;
277 unsigned int high_note;
278 unsigned int low_note;
279 int panning; /* -128=left, 127=right */
280 int detuning;
281
282/* New fields introduced in version 1.99.5 */
283
284 /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
285 unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
286 unsigned char env_offset[ 6 ]; /* 255 == 100% */
287
288 /*
289 * The tremolo, vibrato and scale info are not supported yet.
290 * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
291 * WAVE_SCALE
292 */
293
294 unsigned char tremolo_sweep;
295 unsigned char tremolo_rate;
296 unsigned char tremolo_depth;
297
298 unsigned char vibrato_sweep;
299 unsigned char vibrato_rate;
300 unsigned char vibrato_depth;
301
302 int scale_frequency;
303 unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
304
305 int volume;
306 int fractions;
307 int reserved1;
308 int spare[2];
309 char data[1]; /* The waveform data starts here */
310 };
311
312struct sysex_info {
313 short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
314#define SYSEX_PATCH _PATCHKEY(0x05)
315#define MAUI_PATCH _PATCHKEY(0x06)
316 short device_no; /* Synthesizer number */
317 int len; /* Size of the sysex data in bytes */
318 unsigned char data[1]; /* Sysex data starts here */
319 };
320
321/*
322 * /dev/sequencer input events.
323 *
324 * The data written to the /dev/sequencer is a stream of events. Events
325 * are records of 4 or 8 bytes. The first byte defines the size.
326 * Any number of events can be written with a write call. There
327 * is a set of macros for sending these events. Use these macros if you
328 * want to maximize portability of your program.
329 *
330 * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
331 * (All input events are currently 4 bytes long. Be prepared to support
332 * 8 byte events also. If you receive any event having first byte >= 128,
333 * it's a 8 byte event.
334 *
335 * The events are documented at the end of this file.
336 *
337 * Normal events (4 bytes)
338 * There is also a 8 byte version of most of the 4 byte events. The
339 * 8 byte one is recommended.
340 */
341#define SEQ_NOTEOFF 0
342#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
343#define SEQ_NOTEON 1
344#define SEQ_FMNOTEON SEQ_NOTEON
345#define SEQ_WAIT TMR_WAIT_ABS
346#define SEQ_PGMCHANGE 3
347#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
348#define SEQ_SYNCTIMER TMR_START
349#define SEQ_MIDIPUTC 5
350#define SEQ_DRUMON 6 /*** OBSOLETE ***/
351#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
352#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
353#define SEQ_AFTERTOUCH 9
354#define SEQ_CONTROLLER 10
355
356/*******************************************
357 * Midi controller numbers
358 *******************************************
359 * Controllers 0 to 31 (0x00 to 0x1f) and
360 * 32 to 63 (0x20 to 0x3f) are continuous
361 * controllers.
362 * In the MIDI 1.0 these controllers are sent using
363 * two messages. Controller numbers 0 to 31 are used
364 * to send the MSB and the controller numbers 32 to 63
365 * are for the LSB. Note that just 7 bits are used in MIDI bytes.
366 */
367
368#define CTL_BANK_SELECT 0x00
369#define CTL_MODWHEEL 0x01
370#define CTL_BREATH 0x02
371/* undefined 0x03 */
372#define CTL_FOOT 0x04
373#define CTL_PORTAMENTO_TIME 0x05
374#define CTL_DATA_ENTRY 0x06
375#define CTL_MAIN_VOLUME 0x07
376#define CTL_BALANCE 0x08
377/* undefined 0x09 */
378#define CTL_PAN 0x0a
379#define CTL_EXPRESSION 0x0b
380/* undefined 0x0c */
381/* undefined 0x0d */
382/* undefined 0x0e */
383/* undefined 0x0f */
384#define CTL_GENERAL_PURPOSE1 0x10
385#define CTL_GENERAL_PURPOSE2 0x11
386#define CTL_GENERAL_PURPOSE3 0x12
387#define CTL_GENERAL_PURPOSE4 0x13
388/* undefined 0x14 - 0x1f */
389
390/* undefined 0x20 */
391/* The controller numbers 0x21 to 0x3f are reserved for the */
392/* least significant bytes of the controllers 0x00 to 0x1f. */
393/* These controllers are not recognised by the driver. */
394
395/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
396/* 0=OFF and 127=ON (intermediate values are possible) */
397#define CTL_DAMPER_PEDAL 0x40
398#define CTL_SUSTAIN 0x40 /* Alias */
399#define CTL_HOLD 0x40 /* Alias */
400#define CTL_PORTAMENTO 0x41
401#define CTL_SOSTENUTO 0x42
402#define CTL_SOFT_PEDAL 0x43
403/* undefined 0x44 */
404#define CTL_HOLD2 0x45
405/* undefined 0x46 - 0x4f */
406
407#define CTL_GENERAL_PURPOSE5 0x50
408#define CTL_GENERAL_PURPOSE6 0x51
409#define CTL_GENERAL_PURPOSE7 0x52
410#define CTL_GENERAL_PURPOSE8 0x53
411/* undefined 0x54 - 0x5a */
412#define CTL_EXT_EFF_DEPTH 0x5b
413#define CTL_TREMOLO_DEPTH 0x5c
414#define CTL_CHORUS_DEPTH 0x5d
415#define CTL_DETUNE_DEPTH 0x5e
416#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
417#define CTL_PHASER_DEPTH 0x5f
418#define CTL_DATA_INCREMENT 0x60
419#define CTL_DATA_DECREMENT 0x61
420#define CTL_NONREG_PARM_NUM_LSB 0x62
421#define CTL_NONREG_PARM_NUM_MSB 0x63
422#define CTL_REGIST_PARM_NUM_LSB 0x64
423#define CTL_REGIST_PARM_NUM_MSB 0x65
424/* undefined 0x66 - 0x78 */
425/* reserved 0x79 - 0x7f */
426
427/* Pseudo controllers (not midi compatible) */
428#define CTRL_PITCH_BENDER 255
429#define CTRL_PITCH_BENDER_RANGE 254
430#define CTRL_EXPRESSION 253 /* Obsolete */
431#define CTRL_MAIN_VOLUME 252 /* Obsolete */
432#define SEQ_BALANCE 11
433#define SEQ_VOLMODE 12
434
435/*
436 * Volume mode decides how volumes are used
437 */
438
439#define VOL_METHOD_ADAGIO 1
440#define VOL_METHOD_LINEAR 2
441
442/*
443 * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
444 * input events.
445 */
446
447/*
448 * Event codes 0xf0 to 0xfc are reserved for future extensions.
449 */
450
451#define SEQ_FULLSIZE 0xfd /* Long events */
452/*
453 * SEQ_FULLSIZE events are used for loading patches/samples to the
454 * synthesizer devices. These events are passed directly to the driver
455 * of the associated synthesizer device. There is no limit to the size
456 * of the extended events. These events are not queued but executed
457 * immediately when the write() is called (execution can take several
458 * seconds of time).
459 *
460 * When a SEQ_FULLSIZE message is written to the device, it must
461 * be written using exactly one write() call. Other events cannot
462 * be mixed to the same write.
463 *
464 * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
465 * /dev/sequencer. Don't write other data together with the instrument structure
466 * Set the key field of the structure to FM_PATCH. The device field is used to
467 * route the patch to the corresponding device.
468 *
469 * For wave table use struct patch_info. Initialize the key field
470 * to WAVE_PATCH.
471 */
472#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
473#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
474
475/*
476 * Record for FM patches
477 */
478
479typedef unsigned char sbi_instr_data[32];
480
481struct sbi_instrument {
482 unsigned short key; /* FM_PATCH or OPL3_PATCH */
483#define FM_PATCH _PATCHKEY(0x01)
484#define OPL3_PATCH _PATCHKEY(0x03)
485 short device; /* Synth# (0-4) */
486 int channel; /* Program# to be initialized */
487 sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
488 };
489
490struct synth_info { /* Read only */
491 char name[30];
492 int device; /* 0-N. INITIALIZE BEFORE CALLING */
493 int synth_type;
494#define SYNTH_TYPE_FM 0
495#define SYNTH_TYPE_SAMPLE 1
496#define SYNTH_TYPE_MIDI 2 /* Midi interface */
497
498 int synth_subtype;
499#define FM_TYPE_ADLIB 0x00
500#define FM_TYPE_OPL3 0x01
501#define MIDI_TYPE_MPU401 0x401
502
503#define SAMPLE_TYPE_BASIC 0x10
504#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
505#define SAMPLE_TYPE_WAVEFRONT 0x11
506
507 int perc_mode; /* No longer supported */
508 int nr_voices;
509 int nr_drums; /* Obsolete field */
510 int instr_bank_size;
511 unsigned int capabilities;
512#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
513#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
514#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
515 int dummies[19]; /* Reserve space */
516 };
517
518struct sound_timer_info {
519 char name[32];
520 int caps;
521 };
522
523#define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
524
525struct midi_info {
526 char name[30];
527 int device; /* 0-N. INITIALIZE BEFORE CALLING */
528 unsigned int capabilities; /* To be defined later */
529 int dev_type;
530 int dummies[18]; /* Reserve space */
531 };
532
533/********************************************
534 * ioctl commands for the /dev/midi##
535 */
536typedef struct {
537 unsigned char cmd;
538 char nr_args, nr_returns;
539 unsigned char data[30];
540 } mpu_command_rec;
541
542#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
543#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
544#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
545
546/********************************************
547 * IOCTL commands for /dev/dsp and /dev/audio
548 */
549
550#define SNDCTL_DSP_RESET _SIO ('P', 0)
551#define SNDCTL_DSP_SYNC _SIO ('P', 1)
552#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
553#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
554#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
555#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
556#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
557#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
558#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
559#define SNDCTL_DSP_POST _SIO ('P', 8)
560#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
561#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
562
563/* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
564#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */
565#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/
566# define AFMT_QUERY 0x00000000 /* Return current fmt */
567# define AFMT_MU_LAW 0x00000001
568# define AFMT_A_LAW 0x00000002
569# define AFMT_IMA_ADPCM 0x00000004
570# define AFMT_U8 0x00000008
571# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/
572# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
573# define AFMT_S8 0x00000040
574# define AFMT_U16_LE 0x00000080 /* Little endian U16 */
575# define AFMT_U16_BE 0x00000100 /* Big endian U16 */
576# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
577# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
578
579/*
580 * Buffer status queries.
581 */
582typedef struct audio_buf_info {
583 int fragments; /* # of available fragments (partially usend ones not counted) */
584 int fragstotal; /* Total # of fragments allocated */
585 int fragsize; /* Size of a fragment in bytes */
586
587 int bytes; /* Available space in bytes (includes partially used fragments) */
588 /* Note! 'bytes' could be more than fragments*fragsize */
589 } audio_buf_info;
590
591#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
592#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
593#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
594#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
595# define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
596# define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
597# define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
598# define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
599 /* internal buffers which may */
600 /* cause some delays and */
601 /* decrease precision of timing */
602# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
603 /* Sometimes it's a DSP */
604 /* but usually not */
605# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
606# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
607# define DSP_CAP_MULTI 0x00004000 /* support multiple open */
608# define DSP_CAP_BIND 0x00008000 /* channel binding to front/rear/cneter/lfe */
609
610
611#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
612#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
613# define PCM_ENABLE_INPUT 0x00000001
614# define PCM_ENABLE_OUTPUT 0x00000002
615
616typedef struct count_info {
617 int bytes; /* Total # of bytes processed */
618 int blocks; /* # of fragment transitions since last time */
619 int ptr; /* Current DMA pointer value */
620 } count_info;
621
622#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
623#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
624
625typedef struct buffmem_desc {
626 unsigned *buffer;
627 int size;
628 } buffmem_desc;
629#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
630#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
631#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
632#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
633#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
634
635#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
636#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
637# define DSP_BIND_QUERY 0x00000000
638# define DSP_BIND_FRONT 0x00000001
639# define DSP_BIND_SURR 0x00000002
640# define DSP_BIND_CENTER_LFE 0x00000004
641# define DSP_BIND_HANDSET 0x00000008
642# define DSP_BIND_MIC 0x00000010
643# define DSP_BIND_MODEM1 0x00000020
644# define DSP_BIND_MODEM2 0x00000040
645# define DSP_BIND_I2S 0x00000080
646# define DSP_BIND_SPDIF 0x00000100
647
648#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
649#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
650# define SPDIF_PRO 0x0001
651# define SPDIF_N_AUD 0x0002
652# define SPDIF_COPY 0x0004
653# define SPDIF_PRE 0x0008
654# define SPDIF_CC 0x07f0
655# define SPDIF_L 0x0800
656# define SPDIF_DRS 0x4000
657# define SPDIF_V 0x8000
658
659/*
660 * Application's profile defines the way how playback underrun situations should be handled.
661 *
662 * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
663 * playback buffer whenever an underrun occurs. This consumes some time
664 * prevents looping the existing buffer.
665 * APF_CPUINTENS is intended to be set by CPU intensive applications which
666 * are likely to run out of time occasionally. In this mode the buffer cleanup is
667 * disabled which saves CPU time but also let's the previous buffer content to
668 * be played during the "pause" after the underrun.
669 */
670#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
671#define APF_NORMAL 0 /* Normal applications */
672#define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
673#define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
674
675#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
676#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
677#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
678#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
679
680/* Some alias names */
681#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
682#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
683#define SOUND_PCM_POST SNDCTL_DSP_POST
684#define SOUND_PCM_RESET SNDCTL_DSP_RESET
685#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
686#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
687#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
688#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
689#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
690#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
691#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
692#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
693#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
694#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
695#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
696#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
697#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
698#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
699#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
700#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
701
702/*
703 * ioctl calls to be used in communication with coprocessors and
704 * DSP chips.
705 */
706
707typedef struct copr_buffer {
708 int command; /* Set to 0 if not used */
709 int flags;
710#define CPF_NONE 0x0000
711#define CPF_FIRST 0x0001 /* First block */
712#define CPF_LAST 0x0002 /* Last block */
713 int len;
714 int offs; /* If required by the device (0 if not used) */
715
716 unsigned char data[4000]; /* NOTE! 4000 is not 4k */
717 } copr_buffer;
718
719typedef struct copr_debug_buf {
720 int command; /* Used internally. Set to 0 */
721 int parm1;
722 int parm2;
723 int flags;
724 int len; /* Length of data in bytes */
725 } copr_debug_buf;
726
727typedef struct copr_msg {
728 int len;
729 unsigned char data[4000];
730 } copr_msg;
731
732#define SNDCTL_COPR_RESET _SIO ('C', 0)
733#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
734#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
735#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
736#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
737#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
738#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
739#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
740#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
741#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
742
743/*********************************************
744 * IOCTL commands for /dev/mixer
745 */
746
747/*
748 * Mixer devices
749 *
750 * There can be up to 20 different analog mixer channels. The
751 * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
752 * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
753 * the devices supported by the particular mixer.
754 */
755
756#define SOUND_MIXER_NRDEVICES 25
757#define SOUND_MIXER_VOLUME 0
758#define SOUND_MIXER_BASS 1
759#define SOUND_MIXER_TREBLE 2
760#define SOUND_MIXER_SYNTH 3
761#define SOUND_MIXER_PCM 4
762#define SOUND_MIXER_SPEAKER 5
763#define SOUND_MIXER_LINE 6
764#define SOUND_MIXER_MIC 7
765#define SOUND_MIXER_CD 8
766#define SOUND_MIXER_IMIX 9 /* Recording monitor */
767#define SOUND_MIXER_ALTPCM 10
768#define SOUND_MIXER_RECLEV 11 /* Recording level */
769#define SOUND_MIXER_IGAIN 12 /* Input gain */
770#define SOUND_MIXER_OGAIN 13 /* Output gain */
771/*
772 * The AD1848 codec and compatibles have three line level inputs
773 * (line, aux1 and aux2). Since each card manufacturer have assigned
774 * different meanings to these inputs, it's inpractical to assign
775 * specific meanings (line, cd, synth etc.) to them.
776 */
777#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
778#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
779#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
780#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
781#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
782#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
783#define SOUND_MIXER_PHONEIN 20 /* Phone input */
784#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
785#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
786#define SOUND_MIXER_RADIO 23 /* Radio in */
787#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
788
789/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
790/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
791#define SOUND_ONOFF_MIN 28
792#define SOUND_ONOFF_MAX 30
793
794/* Note! Number 31 cannot be used since the sign bit is reserved */
795#define SOUND_MIXER_NONE 31
796
797/*
798 * The following unsupported macros are no longer functional.
799 * Use SOUND_MIXER_PRIVATE# macros in future.
800 */
801#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
802#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
803#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
804
805
806#define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
807 "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
808 "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
809 "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
810
811#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
812 "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
813 "line1", "line2", "line3", "dig1", "dig2", "dig3", \
814 "phin", "phout", "video", "radio", "monitor"}
815
816/* Device bitmask identifiers */
817
818#define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
819#define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
820#define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
821#define SOUND_MIXER_CAPS 0xfc
822# define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
823#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
824#define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
825#define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
826
827/* Device mask bits */
828
829#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
830#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
831#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
832#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
833#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
834#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
835#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
836#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
837#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
838#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
839#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
840#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
841#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
842#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
843#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
844#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
845#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
846#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
847#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
848#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
849#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
850#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
851#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
852#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
853#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
854
855/* Obsolete macros */
856#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
857#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
858#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
859
860#define MIXER_READ(dev) _SIOR('M', dev, int)
861#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
862#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
863#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
864#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
865#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
866#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
867#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
868#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
869#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
870#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
871#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
872#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
873#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
874#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
875#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
876#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
877#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
878
879/* Obsolete macros */
880#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
881#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
882#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
883
884#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
885#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
886#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
887#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
888#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
889
890#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
891#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
892#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
893#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
894#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
895#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
896#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
897#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
898#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
899#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
900#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
901#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
902#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
903#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
904#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
905#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
906#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
907#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
908
909/* Obsolete macros */
910#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
911#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
912#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
913
914#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
915
916typedef struct mixer_info
917{
918 char id[16];
919 char name[32];
920 int modify_counter;
921 int fillers[10];
922} mixer_info;
923
924typedef struct _old_mixer_info /* Obsolete */
925{
926 char id[16];
927 char name[32];
928} _old_mixer_info;
929
930#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
931#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
932
933/*
934 * A mechanism for accessing "proprietary" mixer features. This method
935 * permits passing 128 bytes of arbitrary data between a mixer application
936 * and the mixer driver. Interpretation of the record is defined by
937 * the particular mixer driver.
938 */
939typedef unsigned char mixer_record[128];
940
941#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
942
943/*
944 * Two ioctls for special souncard function
945 */
946#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
947#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
948
949/*
950 * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
951 * These features can be used when accessing device specific features.
952 */
953#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
954#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
955#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
956#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
957#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
958
959/*
960 * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
961 * for querying current mixer settings from the driver and for loading
962 * default volume settings _prior_ activating the mixer (loading
963 * doesn't affect current state of the mixer hardware). These calls
964 * are for internal use only.
965 */
966
967typedef struct mixer_vol_table {
968 int num; /* Index to volume table */
969 char name[32];
970 int levels[32];
971} mixer_vol_table;
972
973#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
974#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
975
976/*
977 * An ioctl for identifying the driver version. It will return value
978 * of the SOUND_VERSION macro used when compiling the driver.
979 * This call was introduced in OSS version 3.6 and it will not work
980 * with earlier versions (returns EINVAL).
981 */
982#define OSS_GETVERSION _SIOR ('M', 118, int)
983
984/*
985 * Level 2 event types for /dev/sequencer
986 */
987
988/*
989 * The 4 most significant bits of byte 0 specify the class of
990 * the event:
991 *
992 * 0x8X = system level events,
993 * 0x9X = device/port specific events, event[1] = device/port,
994 * The last 4 bits give the subtype:
995 * 0x02 = Channel event (event[3] = chn).
996 * 0x01 = note event (event[4] = note).
997 * (0x01 is not used alone but always with bit 0x02).
998 * event[2] = MIDI message code (0x80=note off etc.)
999 *
1000 */
1001
1002#define EV_SEQ_LOCAL 0x80
1003#define EV_TIMING 0x81
1004#define EV_CHN_COMMON 0x92
1005#define EV_CHN_VOICE 0x93
1006#define EV_SYSEX 0x94
1007/*
1008 * Event types 200 to 220 are reserved for application use.
1009 * These numbers will not be used by the driver.
1010 */
1011
1012/*
1013 * Events for event type EV_CHN_VOICE
1014 */
1015
1016#define MIDI_NOTEOFF 0x80
1017#define MIDI_NOTEON 0x90
1018#define MIDI_KEY_PRESSURE 0xA0
1019
1020/*
1021 * Events for event type EV_CHN_COMMON
1022 */
1023
1024#define MIDI_CTL_CHANGE 0xB0
1025#define MIDI_PGM_CHANGE 0xC0
1026#define MIDI_CHN_PRESSURE 0xD0
1027#define MIDI_PITCH_BEND 0xE0
1028
1029#define MIDI_SYSTEM_PREFIX 0xF0
1030
1031/*
1032 * Timer event types
1033 */
1034#define TMR_WAIT_REL 1 /* Time relative to the prev time */
1035#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
1036#define TMR_STOP 3
1037#define TMR_START 4
1038#define TMR_CONTINUE 5
1039#define TMR_TEMPO 6
1040#define TMR_ECHO 8
1041#define TMR_CLOCK 9 /* MIDI clock */
1042#define TMR_SPP 10 /* Song position pointer */
1043#define TMR_TIMESIG 11 /* Time signature */
1044
1045/*
1046 * Local event types
1047 */
1048#define LOCL_STARTAUDIO 1
1049
1050#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
1051/*
1052 * Some convenience macros to simplify programming of the
1053 * /dev/sequencer interface
1054 *
1055 * This is a legacy interface for applications written against
1056 * the OSSlib-3.8 style interface. It is no longer possible
1057 * to actually link against OSSlib with this header, but we
1058 * still provide these macros for programs using them.
1059 *
1060 * If you want to use OSSlib, it is recommended that you get
1061 * the GPL version of OSS-4.x and build against that version
1062 * of the header.
1063 *
1064 * We redefine the extern keyword so that make headers_check
1065 * does not complain about SEQ_USE_EXTBUF.
1066 */
1067#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
1068
1069void seqbuf_dump(void); /* This function must be provided by programs */
1070
1071#define SEQ_PM_DEFINES int __foo_bar___
1072
1073#define SEQ_LOAD_GMINSTR(dev, instr)
1074#define SEQ_LOAD_GMDRUM(dev, drum)
1075
1076#define _SEQ_EXTERN extern
1077#define SEQ_USE_EXTBUF() \
1078 _SEQ_EXTERN unsigned char _seqbuf[]; \
1079 _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
1080
1081#ifndef USE_SIMPLE_MACROS
1082/* Sample seqbuf_dump() implementation:
1083 *
1084 * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
1085 *
1086 * int seqfd; -- The file descriptor for /dev/sequencer.
1087 *
1088 * void
1089 * seqbuf_dump ()
1090 * {
1091 * if (_seqbufptr)
1092 * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
1093 * {
1094 * perror ("write /dev/sequencer");
1095 * exit (-1);
1096 * }
1097 * _seqbufptr = 0;
1098 * }
1099 */
1100
1101#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
1102#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
1103#define _SEQ_ADVBUF(len) _seqbufptr += len
1104#define SEQ_DUMPBUF seqbuf_dump
1105#else
1106/*
1107 * This variation of the sequencer macros is used just to format one event
1108 * using fixed buffer.
1109 *
1110 * The program using the macro library must define the following macros before
1111 * using this library.
1112 *
1113 * #define _seqbuf name of the buffer (unsigned char[])
1114 * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
1115 * size of the event, this macro can be used.
1116 * Otherwise this must be defined as empty.
1117 * #define _seqbufptr Define the name of index variable or 0 if
1118 * not required.
1119 */
1120#define _SEQ_NEEDBUF(len) /* empty */
1121#endif
1122
1123#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
1124 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1125 _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
1126 _seqbuf[_seqbufptr+2] = (dev);\
1127 _seqbuf[_seqbufptr+3] = (mode);\
1128 _seqbuf[_seqbufptr+4] = 0;\
1129 _seqbuf[_seqbufptr+5] = 0;\
1130 _seqbuf[_seqbufptr+6] = 0;\
1131 _seqbuf[_seqbufptr+7] = 0;\
1132 _SEQ_ADVBUF(8);}
1133
1134/*
1135 * Midi voice messages
1136 */
1137
1138#define _CHN_VOICE(dev, event, chn, note, parm) \
1139 {_SEQ_NEEDBUF(8);\
1140 _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
1141 _seqbuf[_seqbufptr+1] = (dev);\
1142 _seqbuf[_seqbufptr+2] = (event);\
1143 _seqbuf[_seqbufptr+3] = (chn);\
1144 _seqbuf[_seqbufptr+4] = (note);\
1145 _seqbuf[_seqbufptr+5] = (parm);\
1146 _seqbuf[_seqbufptr+6] = (0);\
1147 _seqbuf[_seqbufptr+7] = 0;\
1148 _SEQ_ADVBUF(8);}
1149
1150#define SEQ_START_NOTE(dev, chn, note, vol) \
1151 _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
1152
1153#define SEQ_STOP_NOTE(dev, chn, note, vol) \
1154 _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
1155
1156#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
1157 _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
1158
1159/*
1160 * Midi channel messages
1161 */
1162
1163#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
1164 {_SEQ_NEEDBUF(8);\
1165 _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
1166 _seqbuf[_seqbufptr+1] = (dev);\
1167 _seqbuf[_seqbufptr+2] = (event);\
1168 _seqbuf[_seqbufptr+3] = (chn);\
1169 _seqbuf[_seqbufptr+4] = (p1);\
1170 _seqbuf[_seqbufptr+5] = (p2);\
1171 *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
1172 _SEQ_ADVBUF(8);}
1173/*
1174 * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
1175 * sending any MIDI bytes but it's absolutely not possible. Trying to do
1176 * so _will_ cause problems with MPU401 intelligent mode).
1177 *
1178 * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
1179 * sent by calling SEQ_SYSEX() several times (there must be no other events
1180 * between them). First sysex fragment must have 0xf0 in the first byte
1181 * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
1182 * between these sysex start and end markers cannot be larger than 0x7f. Also
1183 * lengths of each fragments (except the last one) must be 6.
1184 *
1185 * Breaking the above rules may work with some MIDI ports but is likely to
1186 * cause fatal problems with some other devices (such as MPU401).
1187 */
1188#define SEQ_SYSEX(dev, buf, len) \
1189 {int ii, ll=(len); \
1190 unsigned char *bufp=buf;\
1191 if (ll>6)ll=6;\
1192 _SEQ_NEEDBUF(8);\
1193 _seqbuf[_seqbufptr] = EV_SYSEX;\
1194 _seqbuf[_seqbufptr+1] = (dev);\
1195 for(ii=0;ii<ll;ii++)\
1196 _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
1197 for(ii=ll;ii<6;ii++)\
1198 _seqbuf[_seqbufptr+ii+2] = 0xff;\
1199 _SEQ_ADVBUF(8);}
1200
1201#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
1202 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
1203
1204#define SEQ_SET_PATCH SEQ_PGM_CHANGE
1205#define SEQ_PGM_CHANGE(dev, chn, patch) \
1206 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
1207
1208#define SEQ_CONTROL(dev, chn, controller, value) \
1209 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
1210
1211#define SEQ_BENDER(dev, chn, value) \
1212 _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
1213
1214
1215#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
1216 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1217 _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
1218 _seqbuf[_seqbufptr+2] = (dev);\
1219 _seqbuf[_seqbufptr+3] = (voice);\
1220 _seqbuf[_seqbufptr+4] = (controller);\
1221 _seqbuf[_seqbufptr+5] = ((value)&0xff);\
1222 _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
1223 _seqbuf[_seqbufptr+7] = 0;\
1224 _SEQ_ADVBUF(8);}
1225/*
1226 * The following 5 macros are incorrectly implemented and obsolete.
1227 * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
1228 */
1229#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
1230#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
1231#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
1232#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
1233#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
1234
1235/*
1236 * Timing and synchronization macros
1237 */
1238
1239#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1240 _seqbuf[_seqbufptr+0] = EV_TIMING; \
1241 _seqbuf[_seqbufptr+1] = (ev); \
1242 _seqbuf[_seqbufptr+2] = 0;\
1243 _seqbuf[_seqbufptr+3] = 0;\
1244 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1245 _SEQ_ADVBUF(8);}
1246
1247#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
1248#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
1249#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
1250#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
1251#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
1252#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
1253#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
1254#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
1255#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
1256
1257/*
1258 * Local control events
1259 */
1260
1261#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1262 _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
1263 _seqbuf[_seqbufptr+1] = (ev); \
1264 _seqbuf[_seqbufptr+2] = 0;\
1265 _seqbuf[_seqbufptr+3] = 0;\
1266 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1267 _SEQ_ADVBUF(8);}
1268
1269#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
1270/*
1271 * Events for the level 1 interface only
1272 */
1273
1274#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
1275 _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
1276 _seqbuf[_seqbufptr+1] = (byte);\
1277 _seqbuf[_seqbufptr+2] = (device);\
1278 _seqbuf[_seqbufptr+3] = 0;\
1279 _SEQ_ADVBUF(4);}
1280
1281/*
1282 * Patch loading.
1283 */
1284#define SEQ_WRPATCH(patchx, len) \
1285 {if (_seqbufptr) SEQ_DUMPBUF();\
1286 if (write(seqfd, (char*)(patchx), len)==-1) \
1287 perror("Write patch: /dev/sequencer");}
1288#define SEQ_WRPATCH2(patchx, len) \
1289 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
1290
1291#endif
1292#endif 37#endif
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 46132409a3f..075cb0c7eb2 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -1,52 +1,10 @@
1#ifndef _LINUX_STAT_H 1#ifndef _LINUX_STAT_H
2#define _LINUX_STAT_H 2#define _LINUX_STAT_H
3 3
4#ifdef __KERNEL__
5 4
6#include <asm/stat.h> 5#include <asm/stat.h>
6#include <uapi/linux/stat.h>
7 7
8#endif
9
10#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
11
12#define S_IFMT 00170000
13#define S_IFSOCK 0140000
14#define S_IFLNK 0120000
15#define S_IFREG 0100000
16#define S_IFBLK 0060000
17#define S_IFDIR 0040000
18#define S_IFCHR 0020000
19#define S_IFIFO 0010000
20#define S_ISUID 0004000
21#define S_ISGID 0002000
22#define S_ISVTX 0001000
23
24#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
25#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
26#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
27#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
28#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
29#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
30#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
31
32#define S_IRWXU 00700
33#define S_IRUSR 00400
34#define S_IWUSR 00200
35#define S_IXUSR 00100
36
37#define S_IRWXG 00070
38#define S_IRGRP 00040
39#define S_IWGRP 00020
40#define S_IXGRP 00010
41
42#define S_IRWXO 00007
43#define S_IROTH 00004
44#define S_IWOTH 00002
45#define S_IXOTH 00001
46
47#endif
48
49#ifdef __KERNEL__
50#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) 8#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
51#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO) 9#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
52#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) 10#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
@@ -77,5 +35,3 @@ struct kstat {
77}; 35};
78 36
79#endif 37#endif
80
81#endif
diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index 1747b6787b9..f4aec0e75c3 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -1,9 +1,8 @@
1#ifndef _LINUX_STDDEF_H 1#ifndef _LINUX_STDDEF_H
2#define _LINUX_STDDEF_H 2#define _LINUX_STDDEF_H
3 3
4#include <linux/compiler.h> 4#include <uapi/linux/stddef.h>
5 5
6#ifdef __KERNEL__
7 6
8#undef NULL 7#undef NULL
9#define NULL ((void *)0) 8#define NULL ((void *)0)
@@ -19,6 +18,4 @@ enum {
19#else 18#else
20#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 19#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
21#endif 20#endif
22#endif /* __KERNEL__ */
23
24#endif 21#endif
diff --git a/include/linux/string.h b/include/linux/string.h
index b9178812d9d..630125818ca 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -1,16 +1,12 @@
1#ifndef _LINUX_STRING_H_ 1#ifndef _LINUX_STRING_H_
2#define _LINUX_STRING_H_ 2#define _LINUX_STRING_H_
3 3
4/* We don't want strings.h stuff being used by user stuff by accident */
5
6#ifndef __KERNEL__
7#include <string.h>
8#else
9 4
10#include <linux/compiler.h> /* for inline */ 5#include <linux/compiler.h> /* for inline */
11#include <linux/types.h> /* for size_t */ 6#include <linux/types.h> /* for size_t */
12#include <linux/stddef.h> /* for NULL */ 7#include <linux/stddef.h> /* for NULL */
13#include <stdarg.h> 8#include <stdarg.h>
9#include <uapi/linux/string.h>
14 10
15extern char *strndup_user(const char __user *, long); 11extern char *strndup_user(const char __user *, long);
16extern void *memdup_user(const void __user *, size_t); 12extern void *memdup_user(const void __user *, size_t);
@@ -147,5 +143,4 @@ static inline bool strstarts(const char *str, const char *prefix)
147 143
148extern size_t memweight(const void *ptr, size_t bytes); 144extern size_t memweight(const void *ptr, size_t bytes);
149 145
150#endif /* __KERNEL__ */
151#endif /* _LINUX_STRING_H_ */ 146#endif /* _LINUX_STRING_H_ */
diff --git a/include/linux/swab.h b/include/linux/swab.h
index ea0c02fd516..9ad3c60f6ca 100644
--- a/include/linux/swab.h
+++ b/include/linux/swab.h
@@ -1,284 +1,8 @@
1#ifndef _LINUX_SWAB_H 1#ifndef _LINUX_SWAB_H
2#define _LINUX_SWAB_H 2#define _LINUX_SWAB_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/swab.h>
5#include <linux/compiler.h>
6#include <asm/swab.h>
7 5
8/*
9 * casts are necessary for constants, because we never know how for sure
10 * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
11 */
12#define ___constant_swab16(x) ((__u16)( \
13 (((__u16)(x) & (__u16)0x00ffU) << 8) | \
14 (((__u16)(x) & (__u16)0xff00U) >> 8)))
15
16#define ___constant_swab32(x) ((__u32)( \
17 (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
18 (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
19 (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
20 (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
21
22#define ___constant_swab64(x) ((__u64)( \
23 (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
24 (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
25 (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
26 (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
27 (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
28 (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
29 (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
30 (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
31
32#define ___constant_swahw32(x) ((__u32)( \
33 (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
34 (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
35
36#define ___constant_swahb32(x) ((__u32)( \
37 (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
38 (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
39
40/*
41 * Implement the following as inlines, but define the interface using
42 * macros to allow constant folding when possible:
43 * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
44 */
45
46static inline __attribute_const__ __u16 __fswab16(__u16 val)
47{
48#ifdef __arch_swab16
49 return __arch_swab16(val);
50#else
51 return ___constant_swab16(val);
52#endif
53}
54
55static inline __attribute_const__ __u32 __fswab32(__u32 val)
56{
57#ifdef __arch_swab32
58 return __arch_swab32(val);
59#else
60 return ___constant_swab32(val);
61#endif
62}
63
64static inline __attribute_const__ __u64 __fswab64(__u64 val)
65{
66#ifdef __arch_swab64
67 return __arch_swab64(val);
68#elif defined(__SWAB_64_THRU_32__)
69 __u32 h = val >> 32;
70 __u32 l = val & ((1ULL << 32) - 1);
71 return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
72#else
73 return ___constant_swab64(val);
74#endif
75}
76
77static inline __attribute_const__ __u32 __fswahw32(__u32 val)
78{
79#ifdef __arch_swahw32
80 return __arch_swahw32(val);
81#else
82 return ___constant_swahw32(val);
83#endif
84}
85
86static inline __attribute_const__ __u32 __fswahb32(__u32 val)
87{
88#ifdef __arch_swahb32
89 return __arch_swahb32(val);
90#else
91 return ___constant_swahb32(val);
92#endif
93}
94
95/**
96 * __swab16 - return a byteswapped 16-bit value
97 * @x: value to byteswap
98 */
99#define __swab16(x) \
100 (__builtin_constant_p((__u16)(x)) ? \
101 ___constant_swab16(x) : \
102 __fswab16(x))
103
104/**
105 * __swab32 - return a byteswapped 32-bit value
106 * @x: value to byteswap
107 */
108#define __swab32(x) \
109 (__builtin_constant_p((__u32)(x)) ? \
110 ___constant_swab32(x) : \
111 __fswab32(x))
112
113/**
114 * __swab64 - return a byteswapped 64-bit value
115 * @x: value to byteswap
116 */
117#define __swab64(x) \
118 (__builtin_constant_p((__u64)(x)) ? \
119 ___constant_swab64(x) : \
120 __fswab64(x))
121
122/**
123 * __swahw32 - return a word-swapped 32-bit value
124 * @x: value to wordswap
125 *
126 * __swahw32(0x12340000) is 0x00001234
127 */
128#define __swahw32(x) \
129 (__builtin_constant_p((__u32)(x)) ? \
130 ___constant_swahw32(x) : \
131 __fswahw32(x))
132
133/**
134 * __swahb32 - return a high and low byte-swapped 32-bit value
135 * @x: value to byteswap
136 *
137 * __swahb32(0x12345678) is 0x34127856
138 */
139#define __swahb32(x) \
140 (__builtin_constant_p((__u32)(x)) ? \
141 ___constant_swahb32(x) : \
142 __fswahb32(x))
143
144/**
145 * __swab16p - return a byteswapped 16-bit value from a pointer
146 * @p: pointer to a naturally-aligned 16-bit value
147 */
148static inline __u16 __swab16p(const __u16 *p)
149{
150#ifdef __arch_swab16p
151 return __arch_swab16p(p);
152#else
153 return __swab16(*p);
154#endif
155}
156
157/**
158 * __swab32p - return a byteswapped 32-bit value from a pointer
159 * @p: pointer to a naturally-aligned 32-bit value
160 */
161static inline __u32 __swab32p(const __u32 *p)
162{
163#ifdef __arch_swab32p
164 return __arch_swab32p(p);
165#else
166 return __swab32(*p);
167#endif
168}
169
170/**
171 * __swab64p - return a byteswapped 64-bit value from a pointer
172 * @p: pointer to a naturally-aligned 64-bit value
173 */
174static inline __u64 __swab64p(const __u64 *p)
175{
176#ifdef __arch_swab64p
177 return __arch_swab64p(p);
178#else
179 return __swab64(*p);
180#endif
181}
182
183/**
184 * __swahw32p - return a wordswapped 32-bit value from a pointer
185 * @p: pointer to a naturally-aligned 32-bit value
186 *
187 * See __swahw32() for details of wordswapping.
188 */
189static inline __u32 __swahw32p(const __u32 *p)
190{
191#ifdef __arch_swahw32p
192 return __arch_swahw32p(p);
193#else
194 return __swahw32(*p);
195#endif
196}
197
198/**
199 * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
200 * @p: pointer to a naturally-aligned 32-bit value
201 *
202 * See __swahb32() for details of high/low byteswapping.
203 */
204static inline __u32 __swahb32p(const __u32 *p)
205{
206#ifdef __arch_swahb32p
207 return __arch_swahb32p(p);
208#else
209 return __swahb32(*p);
210#endif
211}
212
213/**
214 * __swab16s - byteswap a 16-bit value in-place
215 * @p: pointer to a naturally-aligned 16-bit value
216 */
217static inline void __swab16s(__u16 *p)
218{
219#ifdef __arch_swab16s
220 __arch_swab16s(p);
221#else
222 *p = __swab16p(p);
223#endif
224}
225/**
226 * __swab32s - byteswap a 32-bit value in-place
227 * @p: pointer to a naturally-aligned 32-bit value
228 */
229static inline void __swab32s(__u32 *p)
230{
231#ifdef __arch_swab32s
232 __arch_swab32s(p);
233#else
234 *p = __swab32p(p);
235#endif
236}
237
238/**
239 * __swab64s - byteswap a 64-bit value in-place
240 * @p: pointer to a naturally-aligned 64-bit value
241 */
242static inline void __swab64s(__u64 *p)
243{
244#ifdef __arch_swab64s
245 __arch_swab64s(p);
246#else
247 *p = __swab64p(p);
248#endif
249}
250
251/**
252 * __swahw32s - wordswap a 32-bit value in-place
253 * @p: pointer to a naturally-aligned 32-bit value
254 *
255 * See __swahw32() for details of wordswapping
256 */
257static inline void __swahw32s(__u32 *p)
258{
259#ifdef __arch_swahw32s
260 __arch_swahw32s(p);
261#else
262 *p = __swahw32p(p);
263#endif
264}
265
266/**
267 * __swahb32s - high and low byteswap a 32-bit value in-place
268 * @p: pointer to a naturally-aligned 32-bit value
269 *
270 * See __swahb32() for details of high and low byte swapping
271 */
272static inline void __swahb32s(__u32 *p)
273{
274#ifdef __arch_swahb32s
275 __arch_swahb32s(p);
276#else
277 *p = __swahb32p(p);
278#endif
279}
280
281#ifdef __KERNEL__
282# define swab16 __swab16 6# define swab16 __swab16
283# define swab32 __swab32 7# define swab32 __swab32
284# define swab64 __swab64 8# define swab64 __swab64
@@ -294,6 +18,4 @@ static inline void __swahb32s(__u32 *p)
294# define swab64s __swab64s 18# define swab64s __swab64s
295# define swahw32s __swahw32s 19# define swahw32s __swahw32s
296# define swahb32s __swahb32s 20# define swahb32s __swahb32s
297#endif /* __KERNEL__ */
298
299#endif /* _LINUX_SWAB_H */ 21#endif /* _LINUX_SWAB_H */
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 2e7d81c4e5a..f1405b1c71b 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -8,295 +8,11 @@
8 * Redistribution of this file is permitted under 8 * Redistribution of this file is permitted under
9 * the terms of the GNU Public License (GPL) 9 * the terms of the GNU Public License (GPL)
10 */ 10 */
11
12#ifndef _SYNCLINK_H_ 11#ifndef _SYNCLINK_H_
13#define _SYNCLINK_H_ 12#define _SYNCLINK_H_
14#define SYNCLINK_H_VERSION 3.6
15
16#include <linux/types.h>
17
18#define BIT0 0x0001
19#define BIT1 0x0002
20#define BIT2 0x0004
21#define BIT3 0x0008
22#define BIT4 0x0010
23#define BIT5 0x0020
24#define BIT6 0x0040
25#define BIT7 0x0080
26#define BIT8 0x0100
27#define BIT9 0x0200
28#define BIT10 0x0400
29#define BIT11 0x0800
30#define BIT12 0x1000
31#define BIT13 0x2000
32#define BIT14 0x4000
33#define BIT15 0x8000
34#define BIT16 0x00010000
35#define BIT17 0x00020000
36#define BIT18 0x00040000
37#define BIT19 0x00080000
38#define BIT20 0x00100000
39#define BIT21 0x00200000
40#define BIT22 0x00400000
41#define BIT23 0x00800000
42#define BIT24 0x01000000
43#define BIT25 0x02000000
44#define BIT26 0x04000000
45#define BIT27 0x08000000
46#define BIT28 0x10000000
47#define BIT29 0x20000000
48#define BIT30 0x40000000
49#define BIT31 0x80000000
50
51
52#define HDLC_MAX_FRAME_SIZE 65535
53#define MAX_ASYNC_TRANSMIT 4096
54#define MAX_ASYNC_BUFFER_SIZE 4096
55
56#define ASYNC_PARITY_NONE 0
57#define ASYNC_PARITY_EVEN 1
58#define ASYNC_PARITY_ODD 2
59#define ASYNC_PARITY_SPACE 3
60
61#define HDLC_FLAG_UNDERRUN_ABORT7 0x0000
62#define HDLC_FLAG_UNDERRUN_ABORT15 0x0001
63#define HDLC_FLAG_UNDERRUN_FLAG 0x0002
64#define HDLC_FLAG_UNDERRUN_CRC 0x0004
65#define HDLC_FLAG_SHARE_ZERO 0x0010
66#define HDLC_FLAG_AUTO_CTS 0x0020
67#define HDLC_FLAG_AUTO_DCD 0x0040
68#define HDLC_FLAG_AUTO_RTS 0x0080
69#define HDLC_FLAG_RXC_DPLL 0x0100
70#define HDLC_FLAG_RXC_BRG 0x0200
71#define HDLC_FLAG_RXC_TXCPIN 0x8000
72#define HDLC_FLAG_RXC_RXCPIN 0x0000
73#define HDLC_FLAG_TXC_DPLL 0x0400
74#define HDLC_FLAG_TXC_BRG 0x0800
75#define HDLC_FLAG_TXC_TXCPIN 0x0000
76#define HDLC_FLAG_TXC_RXCPIN 0x0008
77#define HDLC_FLAG_DPLL_DIV8 0x1000
78#define HDLC_FLAG_DPLL_DIV16 0x2000
79#define HDLC_FLAG_DPLL_DIV32 0x0000
80#define HDLC_FLAG_HDLC_LOOPMODE 0x4000
81
82#define HDLC_CRC_NONE 0
83#define HDLC_CRC_16_CCITT 1
84#define HDLC_CRC_32_CCITT 2
85#define HDLC_CRC_MASK 0x00ff
86#define HDLC_CRC_RETURN_EX 0x8000
87
88#define RX_OK 0
89#define RX_CRC_ERROR 1
90
91#define HDLC_TXIDLE_FLAGS 0
92#define HDLC_TXIDLE_ALT_ZEROS_ONES 1
93#define HDLC_TXIDLE_ZEROS 2
94#define HDLC_TXIDLE_ONES 3
95#define HDLC_TXIDLE_ALT_MARK_SPACE 4
96#define HDLC_TXIDLE_SPACE 5
97#define HDLC_TXIDLE_MARK 6
98#define HDLC_TXIDLE_CUSTOM_8 0x10000000
99#define HDLC_TXIDLE_CUSTOM_16 0x20000000
100
101#define HDLC_ENCODING_NRZ 0
102#define HDLC_ENCODING_NRZB 1
103#define HDLC_ENCODING_NRZI_MARK 2
104#define HDLC_ENCODING_NRZI_SPACE 3
105#define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE
106#define HDLC_ENCODING_BIPHASE_MARK 4
107#define HDLC_ENCODING_BIPHASE_SPACE 5
108#define HDLC_ENCODING_BIPHASE_LEVEL 6
109#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL 7
110
111#define HDLC_PREAMBLE_LENGTH_8BITS 0
112#define HDLC_PREAMBLE_LENGTH_16BITS 1
113#define HDLC_PREAMBLE_LENGTH_32BITS 2
114#define HDLC_PREAMBLE_LENGTH_64BITS 3
115
116#define HDLC_PREAMBLE_PATTERN_NONE 0
117#define HDLC_PREAMBLE_PATTERN_ZEROS 1
118#define HDLC_PREAMBLE_PATTERN_FLAGS 2
119#define HDLC_PREAMBLE_PATTERN_10 3
120#define HDLC_PREAMBLE_PATTERN_01 4
121#define HDLC_PREAMBLE_PATTERN_ONES 5
122
123#define MGSL_MODE_ASYNC 1
124#define MGSL_MODE_HDLC 2
125#define MGSL_MODE_MONOSYNC 3
126#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6
128#define MGSL_MODE_BASE_CLOCK 7
129#define MGSL_MODE_XSYNC 8
130
131#define MGSL_BUS_TYPE_ISA 1
132#define MGSL_BUS_TYPE_EISA 2
133#define MGSL_BUS_TYPE_PCI 5
134
135#define MGSL_INTERFACE_MASK 0xf
136#define MGSL_INTERFACE_DISABLE 0
137#define MGSL_INTERFACE_RS232 1
138#define MGSL_INTERFACE_V35 2
139#define MGSL_INTERFACE_RS422 3
140#define MGSL_INTERFACE_RTS_EN 0x10
141#define MGSL_INTERFACE_LL 0x20
142#define MGSL_INTERFACE_RL 0x40
143#define MGSL_INTERFACE_MSB_FIRST 0x80
144
145typedef struct _MGSL_PARAMS
146{
147 /* Common */
148
149 unsigned long mode; /* Asynchronous or HDLC */
150 unsigned char loopback; /* internal loopback mode */
151
152 /* HDLC Only */
153
154 unsigned short flags;
155 unsigned char encoding; /* NRZ, NRZI, etc. */
156 unsigned long clock_speed; /* external clock speed in bits per second */
157 unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */
158 unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */
159 unsigned char preamble_length;
160 unsigned char preamble;
161 13
162 /* Async Only */ 14#include <uapi/linux/synclink.h>
163 15
164 unsigned long data_rate; /* bits per second */
165 unsigned char data_bits; /* 7 or 8 data bits */
166 unsigned char stop_bits; /* 1 or 2 stop bits */
167 unsigned char parity; /* none, even, or odd */
168
169} MGSL_PARAMS, *PMGSL_PARAMS;
170
171#define MICROGATE_VENDOR_ID 0x13c0
172#define SYNCLINK_DEVICE_ID 0x0010
173#define MGSCC_DEVICE_ID 0x0020
174#define SYNCLINK_SCA_DEVICE_ID 0x0030
175#define SYNCLINK_GT_DEVICE_ID 0x0070
176#define SYNCLINK_GT4_DEVICE_ID 0x0080
177#define SYNCLINK_AC_DEVICE_ID 0x0090
178#define SYNCLINK_GT2_DEVICE_ID 0x00A0
179#define MGSL_MAX_SERIAL_NUMBER 30
180
181/*
182** device diagnostics status
183*/
184
185#define DiagStatus_OK 0
186#define DiagStatus_AddressFailure 1
187#define DiagStatus_AddressConflict 2
188#define DiagStatus_IrqFailure 3
189#define DiagStatus_IrqConflict 4
190#define DiagStatus_DmaFailure 5
191#define DiagStatus_DmaConflict 6
192#define DiagStatus_PciAdapterNotFound 7
193#define DiagStatus_CantAssignPciResources 8
194#define DiagStatus_CantAssignPciMemAddr 9
195#define DiagStatus_CantAssignPciIoAddr 10
196#define DiagStatus_CantAssignPciIrq 11
197#define DiagStatus_MemoryError 12
198
199#define SerialSignal_DCD 0x01 /* Data Carrier Detect */
200#define SerialSignal_TXD 0x02 /* Transmit Data */
201#define SerialSignal_RI 0x04 /* Ring Indicator */
202#define SerialSignal_RXD 0x08 /* Receive Data */
203#define SerialSignal_CTS 0x10 /* Clear to Send */
204#define SerialSignal_RTS 0x20 /* Request to Send */
205#define SerialSignal_DSR 0x40 /* Data Set Ready */
206#define SerialSignal_DTR 0x80 /* Data Terminal Ready */
207
208
209/*
210 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
211 */
212struct mgsl_icount {
213 __u32 cts, dsr, rng, dcd, tx, rx;
214 __u32 frame, parity, overrun, brk;
215 __u32 buf_overrun;
216 __u32 txok;
217 __u32 txunder;
218 __u32 txabort;
219 __u32 txtimeout;
220 __u32 rxshort;
221 __u32 rxlong;
222 __u32 rxabort;
223 __u32 rxover;
224 __u32 rxcrc;
225 __u32 rxok;
226 __u32 exithunt;
227 __u32 rxidle;
228};
229
230struct gpio_desc {
231 __u32 state;
232 __u32 smask;
233 __u32 dir;
234 __u32 dmask;
235};
236
237#define DEBUG_LEVEL_DATA 1
238#define DEBUG_LEVEL_ERROR 2
239#define DEBUG_LEVEL_INFO 3
240#define DEBUG_LEVEL_BH 4
241#define DEBUG_LEVEL_ISR 5
242
243/*
244** Event bit flags for use with MgslWaitEvent
245*/
246
247#define MgslEvent_DsrActive 0x0001
248#define MgslEvent_DsrInactive 0x0002
249#define MgslEvent_Dsr 0x0003
250#define MgslEvent_CtsActive 0x0004
251#define MgslEvent_CtsInactive 0x0008
252#define MgslEvent_Cts 0x000c
253#define MgslEvent_DcdActive 0x0010
254#define MgslEvent_DcdInactive 0x0020
255#define MgslEvent_Dcd 0x0030
256#define MgslEvent_RiActive 0x0040
257#define MgslEvent_RiInactive 0x0080
258#define MgslEvent_Ri 0x00c0
259#define MgslEvent_ExitHuntMode 0x0100
260#define MgslEvent_IdleReceived 0x0200
261
262/* Private IOCTL codes:
263 *
264 * MGSL_IOCSPARAMS set MGSL_PARAMS structure values
265 * MGSL_IOCGPARAMS get current MGSL_PARAMS structure values
266 * MGSL_IOCSTXIDLE set current transmit idle mode
267 * MGSL_IOCGTXIDLE get current transmit idle mode
268 * MGSL_IOCTXENABLE enable or disable transmitter
269 * MGSL_IOCRXENABLE enable or disable receiver
270 * MGSL_IOCTXABORT abort transmitting frame (HDLC)
271 * MGSL_IOCGSTATS return current statistics
272 * MGSL_IOCWAITEVENT wait for specified event to occur
273 * MGSL_LOOPTXDONE transmit in HDLC LoopMode done
274 * MGSL_IOCSIF set the serial interface type
275 * MGSL_IOCGIF get the serial interface type
276 */
277#define MGSL_MAGIC_IOC 'm'
278#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
279#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
280#define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC,2)
281#define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC,3)
282#define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC,4)
283#define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC,5)
284#define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC,6)
285#define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC,7)
286#define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC,8,int)
287#define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC,15)
288#define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9)
289#define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10)
290#define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11)
291#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
292#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
293#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
294#define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19)
295#define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20)
296#define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21)
297#define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22)
298
299#ifdef __KERNEL__
300/* provide 32 bit ioctl compatibility on 64 bit systems */ 16/* provide 32 bit ioctl compatibility on 64 bit systems */
301#ifdef CONFIG_COMPAT 17#ifdef CONFIG_COMPAT
302#include <linux/compat.h> 18#include <linux/compat.h>
@@ -318,6 +34,4 @@ struct MGSL_PARAMS32 {
318#define MGSL_IOCSPARAMS32 _IOW(MGSL_MAGIC_IOC,0,struct MGSL_PARAMS32) 34#define MGSL_IOCSPARAMS32 _IOW(MGSL_MAGIC_IOC,0,struct MGSL_PARAMS32)
319#define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct MGSL_PARAMS32) 35#define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct MGSL_PARAMS32)
320#endif 36#endif
321#endif
322
323#endif /* _SYNCLINK_H_ */ 37#endif /* _SYNCLINK_H_ */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index c34b4c82b0d..cd844a6a8d5 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -18,921 +18,14 @@
18 **************************************************************** 18 ****************************************************************
19 **************************************************************** 19 ****************************************************************
20 */ 20 */
21
22#ifndef _LINUX_SYSCTL_H 21#ifndef _LINUX_SYSCTL_H
23#define _LINUX_SYSCTL_H 22#define _LINUX_SYSCTL_H
24 23
25#include <linux/kernel.h>
26#include <linux/types.h>
27#include <linux/compiler.h>
28
29struct completion;
30
31#define CTL_MAXNAME 10 /* how many path components do we allow in a
32 call to sysctl? In other words, what is
33 the largest acceptable value for the nlen
34 member of a struct __sysctl_args to have? */
35
36struct __sysctl_args {
37 int __user *name;
38 int nlen;
39 void __user *oldval;
40 size_t __user *oldlenp;
41 void __user *newval;
42 size_t newlen;
43 unsigned long __unused[4];
44};
45
46/* Define sysctl names first */
47
48/* Top-level names: */
49
50enum
51{
52 CTL_KERN=1, /* General kernel info and control */
53 CTL_VM=2, /* VM management */
54 CTL_NET=3, /* Networking */
55 CTL_PROC=4, /* removal breaks strace(1) compilation */
56 CTL_FS=5, /* Filesystems */
57 CTL_DEBUG=6, /* Debugging */
58 CTL_DEV=7, /* Devices */
59 CTL_BUS=8, /* Busses */
60 CTL_ABI=9, /* Binary emulation */
61 CTL_CPU=10, /* CPU stuff (speed scaling, etc) */
62 CTL_ARLAN=254, /* arlan wireless driver */
63 CTL_S390DBF=5677, /* s390 debug */
64 CTL_SUNRPC=7249, /* sunrpc debug */
65 CTL_PM=9899, /* frv power management */
66 CTL_FRV=9898, /* frv specific sysctls */
67};
68
69/* CTL_BUS names: */
70enum
71{
72 CTL_BUS_ISA=1 /* ISA */
73};
74
75/* /proc/sys/fs/inotify/ */
76enum
77{
78 INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
79 INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
80 INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
81};
82
83/* CTL_KERN names: */
84enum
85{
86 KERN_OSTYPE=1, /* string: system version */
87 KERN_OSRELEASE=2, /* string: system release */
88 KERN_OSREV=3, /* int: system revision */
89 KERN_VERSION=4, /* string: compile time info */
90 KERN_SECUREMASK=5, /* struct: maximum rights mask */
91 KERN_PROF=6, /* table: profiling information */
92 KERN_NODENAME=7, /* string: hostname */
93 KERN_DOMAINNAME=8, /* string: domainname */
94
95 KERN_PANIC=15, /* int: panic timeout */
96 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
97
98 KERN_SPARC_REBOOT=21, /* reboot command on Sparc */
99 KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */
100 KERN_PRINTK=23, /* struct: control printk logging parameters */
101 KERN_NAMETRANS=24, /* Name translation */
102 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
103 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
104 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
105 KERN_MODPROBE=28, /* string: modprobe path */
106 KERN_SG_BIG_BUFF=29, /* int: sg driver reserved buffer size */
107 KERN_ACCT=30, /* BSD process accounting parameters */
108 KERN_PPC_L2CR=31, /* l2cr register on PPC */
109
110 KERN_RTSIGNR=32, /* Number of rt sigs queued */
111 KERN_RTSIGMAX=33, /* Max queuable */
112
113 KERN_SHMMAX=34, /* long: Maximum shared memory segment */
114 KERN_MSGMAX=35, /* int: Maximum size of a messege */
115 KERN_MSGMNB=36, /* int: Maximum message queue size */
116 KERN_MSGPOOL=37, /* int: Maximum system message pool size */
117 KERN_SYSRQ=38, /* int: Sysreq enable */
118 KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */
119 KERN_RANDOM=40, /* Random driver */
120 KERN_SHMALL=41, /* int: Maximum size of shared memory */
121 KERN_MSGMNI=42, /* int: msg queue identifiers */
122 KERN_SEM=43, /* struct: sysv semaphore limits */
123 KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
124 KERN_SHMMNI=45, /* int: shm array identifiers */
125 KERN_OVERFLOWUID=46, /* int: overflow UID */
126 KERN_OVERFLOWGID=47, /* int: overflow GID */
127 KERN_SHMPATH=48, /* string: path to shm fs */
128 KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */
129 KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
130 KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
131 KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
132 KERN_TAINTED=53, /* int: various kernel tainted flags */
133 KERN_CADPID=54, /* int: PID of the process to notify on CAD */
134 KERN_PIDMAX=55, /* int: PID # limit */
135 KERN_CORE_PATTERN=56, /* string: pattern for core-file names */
136 KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */
137 KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */
138 KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
139 KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
140 KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
141 KERN_PTY=62, /* dir: pty driver */
142 KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */
143 KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
144 KERN_HZ_TIMER=65, /* int: hz timer on or off */
145 KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
146 KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
147 KERN_RANDOMIZE=68, /* int: randomize virtual address space */
148 KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
149 KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
150 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
151 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
152 KERN_COMPAT_LOG=73, /* int: print compat layer messages */
153 KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
154 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
155 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
156};
157
158
159
160/* CTL_VM names: */
161enum
162{
163 VM_UNUSED1=1, /* was: struct: Set vm swapping control */
164 VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */
165 VM_UNUSED3=3, /* was: struct: Set free page thresholds */
166 VM_UNUSED4=4, /* Spare */
167 VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
168 VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */
169 VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */
170 VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */
171 VM_UNUSED9=9, /* was: struct: Set page table cache parameters */
172 VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
173 VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
174 VM_DIRTY_RATIO=12, /* dirty_ratio */
175 VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */
176 VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */
177 VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
178 VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
179 VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
180 VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */
181 VM_SWAPPINESS=19, /* Tendency to steal mapped memory */
182 VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
183 VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */
184 VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */
185 VM_LAPTOP_MODE=23, /* vm laptop mode */
186 VM_BLOCK_DUMP=24, /* block dump mode */
187 VM_HUGETLB_GROUP=25, /* permitted hugetlb group */
188 VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
189 VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
190 VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
191 VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */
192 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
193 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
194 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
195 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
196 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
197 VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */
198};
199
200
201/* CTL_NET names: */
202enum
203{
204 NET_CORE=1,
205 NET_ETHER=2,
206 NET_802=3,
207 NET_UNIX=4,
208 NET_IPV4=5,
209 NET_IPX=6,
210 NET_ATALK=7,
211 NET_NETROM=8,
212 NET_AX25=9,
213 NET_BRIDGE=10,
214 NET_ROSE=11,
215 NET_IPV6=12,
216 NET_X25=13,
217 NET_TR=14,
218 NET_DECNET=15,
219 NET_ECONET=16,
220 NET_SCTP=17,
221 NET_LLC=18,
222 NET_NETFILTER=19,
223 NET_DCCP=20,
224 NET_IRDA=412,
225};
226
227/* /proc/sys/kernel/random */
228enum
229{
230 RANDOM_POOLSIZE=1,
231 RANDOM_ENTROPY_COUNT=2,
232 RANDOM_READ_THRESH=3,
233 RANDOM_WRITE_THRESH=4,
234 RANDOM_BOOT_ID=5,
235 RANDOM_UUID=6
236};
237
238/* /proc/sys/kernel/pty */
239enum
240{
241 PTY_MAX=1,
242 PTY_NR=2
243};
244
245/* /proc/sys/bus/isa */
246enum
247{
248 BUS_ISA_MEM_BASE=1,
249 BUS_ISA_PORT_BASE=2,
250 BUS_ISA_PORT_SHIFT=3
251};
252
253/* /proc/sys/net/core */
254enum
255{
256 NET_CORE_WMEM_MAX=1,
257 NET_CORE_RMEM_MAX=2,
258 NET_CORE_WMEM_DEFAULT=3,
259 NET_CORE_RMEM_DEFAULT=4,
260/* was NET_CORE_DESTROY_DELAY */
261 NET_CORE_MAX_BACKLOG=6,
262 NET_CORE_FASTROUTE=7,
263 NET_CORE_MSG_COST=8,
264 NET_CORE_MSG_BURST=9,
265 NET_CORE_OPTMEM_MAX=10,
266 NET_CORE_HOT_LIST_LENGTH=11,
267 NET_CORE_DIVERT_VERSION=12,
268 NET_CORE_NO_CONG_THRESH=13,
269 NET_CORE_NO_CONG=14,
270 NET_CORE_LO_CONG=15,
271 NET_CORE_MOD_CONG=16,
272 NET_CORE_DEV_WEIGHT=17,
273 NET_CORE_SOMAXCONN=18,
274 NET_CORE_BUDGET=19,
275 NET_CORE_AEVENT_ETIME=20,
276 NET_CORE_AEVENT_RSEQTH=21,
277 NET_CORE_WARNINGS=22,
278};
279
280/* /proc/sys/net/ethernet */
281
282/* /proc/sys/net/802 */
283
284/* /proc/sys/net/unix */
285
286enum
287{
288 NET_UNIX_DESTROY_DELAY=1,
289 NET_UNIX_DELETE_DELAY=2,
290 NET_UNIX_MAX_DGRAM_QLEN=3,
291};
292
293/* /proc/sys/net/netfilter */
294enum
295{
296 NET_NF_CONNTRACK_MAX=1,
297 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
298 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
299 NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
300 NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
301 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
302 NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
303 NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
304 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
305 NET_NF_CONNTRACK_UDP_TIMEOUT=10,
306 NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
307 NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
308 NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
309 NET_NF_CONNTRACK_BUCKETS=14,
310 NET_NF_CONNTRACK_LOG_INVALID=15,
311 NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
312 NET_NF_CONNTRACK_TCP_LOOSE=17,
313 NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
314 NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
315 NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
316 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
317 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
318 NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
319 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
320 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
321 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
322 NET_NF_CONNTRACK_COUNT=27,
323 NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
324 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
325 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
326 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
327 NET_NF_CONNTRACK_CHECKSUM=32,
328};
329
330/* /proc/sys/net/ipv4 */
331enum
332{
333 /* v2.0 compatibile variables */
334 NET_IPV4_FORWARD=8,
335 NET_IPV4_DYNADDR=9,
336
337 NET_IPV4_CONF=16,
338 NET_IPV4_NEIGH=17,
339 NET_IPV4_ROUTE=18,
340 NET_IPV4_FIB_HASH=19,
341 NET_IPV4_NETFILTER=20,
342
343 NET_IPV4_TCP_TIMESTAMPS=33,
344 NET_IPV4_TCP_WINDOW_SCALING=34,
345 NET_IPV4_TCP_SACK=35,
346 NET_IPV4_TCP_RETRANS_COLLAPSE=36,
347 NET_IPV4_DEFAULT_TTL=37,
348 NET_IPV4_AUTOCONFIG=38,
349 NET_IPV4_NO_PMTU_DISC=39,
350 NET_IPV4_TCP_SYN_RETRIES=40,
351 NET_IPV4_IPFRAG_HIGH_THRESH=41,
352 NET_IPV4_IPFRAG_LOW_THRESH=42,
353 NET_IPV4_IPFRAG_TIME=43,
354 NET_IPV4_TCP_MAX_KA_PROBES=44,
355 NET_IPV4_TCP_KEEPALIVE_TIME=45,
356 NET_IPV4_TCP_KEEPALIVE_PROBES=46,
357 NET_IPV4_TCP_RETRIES1=47,
358 NET_IPV4_TCP_RETRIES2=48,
359 NET_IPV4_TCP_FIN_TIMEOUT=49,
360 NET_IPV4_IP_MASQ_DEBUG=50,
361 NET_TCP_SYNCOOKIES=51,
362 NET_TCP_STDURG=52,
363 NET_TCP_RFC1337=53,
364 NET_TCP_SYN_TAILDROP=54,
365 NET_TCP_MAX_SYN_BACKLOG=55,
366 NET_IPV4_LOCAL_PORT_RANGE=56,
367 NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
368 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
369 NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
370 NET_IPV4_ICMP_DESTUNREACH_RATE=60,
371 NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
372 NET_IPV4_ICMP_PARAMPROB_RATE=62,
373 NET_IPV4_ICMP_ECHOREPLY_RATE=63,
374 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
375 NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
376 NET_TCP_TW_RECYCLE=66,
377 NET_IPV4_ALWAYS_DEFRAG=67,
378 NET_IPV4_TCP_KEEPALIVE_INTVL=68,
379 NET_IPV4_INET_PEER_THRESHOLD=69,
380 NET_IPV4_INET_PEER_MINTTL=70,
381 NET_IPV4_INET_PEER_MAXTTL=71,
382 NET_IPV4_INET_PEER_GC_MINTIME=72,
383 NET_IPV4_INET_PEER_GC_MAXTIME=73,
384 NET_TCP_ORPHAN_RETRIES=74,
385 NET_TCP_ABORT_ON_OVERFLOW=75,
386 NET_TCP_SYNACK_RETRIES=76,
387 NET_TCP_MAX_ORPHANS=77,
388 NET_TCP_MAX_TW_BUCKETS=78,
389 NET_TCP_FACK=79,
390 NET_TCP_REORDERING=80,
391 NET_TCP_ECN=81,
392 NET_TCP_DSACK=82,
393 NET_TCP_MEM=83,
394 NET_TCP_WMEM=84,
395 NET_TCP_RMEM=85,
396 NET_TCP_APP_WIN=86,
397 NET_TCP_ADV_WIN_SCALE=87,
398 NET_IPV4_NONLOCAL_BIND=88,
399 NET_IPV4_ICMP_RATELIMIT=89,
400 NET_IPV4_ICMP_RATEMASK=90,
401 NET_TCP_TW_REUSE=91,
402 NET_TCP_FRTO=92,
403 NET_TCP_LOW_LATENCY=93,
404 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
405 NET_IPV4_IGMP_MAX_MSF=96,
406 NET_TCP_NO_METRICS_SAVE=97,
407 NET_TCP_DEFAULT_WIN_SCALE=105,
408 NET_TCP_MODERATE_RCVBUF=106,
409 NET_TCP_TSO_WIN_DIVISOR=107,
410 NET_TCP_BIC_BETA=108,
411 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
412 NET_TCP_CONG_CONTROL=110,
413 NET_TCP_ABC=111,
414 NET_IPV4_IPFRAG_MAX_DIST=112,
415 NET_TCP_MTU_PROBING=113,
416 NET_TCP_BASE_MSS=114,
417 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
418 NET_TCP_DMA_COPYBREAK=116,
419 NET_TCP_SLOW_START_AFTER_IDLE=117,
420 NET_CIPSOV4_CACHE_ENABLE=118,
421 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
422 NET_CIPSOV4_RBM_OPTFMT=120,
423 NET_CIPSOV4_RBM_STRICTVALID=121,
424 NET_TCP_AVAIL_CONG_CONTROL=122,
425 NET_TCP_ALLOWED_CONG_CONTROL=123,
426 NET_TCP_MAX_SSTHRESH=124,
427 NET_TCP_FRTO_RESPONSE=125,
428};
429
430enum {
431 NET_IPV4_ROUTE_FLUSH=1,
432 NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
433 NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
434 NET_IPV4_ROUTE_GC_THRESH=4,
435 NET_IPV4_ROUTE_MAX_SIZE=5,
436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
437 NET_IPV4_ROUTE_GC_TIMEOUT=7,
438 NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
439 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
442 NET_IPV4_ROUTE_ERROR_COST=12,
443 NET_IPV4_ROUTE_ERROR_BURST=13,
444 NET_IPV4_ROUTE_GC_ELASTICITY=14,
445 NET_IPV4_ROUTE_MTU_EXPIRES=15,
446 NET_IPV4_ROUTE_MIN_PMTU=16,
447 NET_IPV4_ROUTE_MIN_ADVMSS=17,
448 NET_IPV4_ROUTE_SECRET_INTERVAL=18,
449 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
450};
451
452enum
453{
454 NET_PROTO_CONF_ALL=-2,
455 NET_PROTO_CONF_DEFAULT=-3
456
457 /* And device ifindices ... */
458};
459
460enum
461{
462 NET_IPV4_CONF_FORWARDING=1,
463 NET_IPV4_CONF_MC_FORWARDING=2,
464 NET_IPV4_CONF_PROXY_ARP=3,
465 NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
466 NET_IPV4_CONF_SECURE_REDIRECTS=5,
467 NET_IPV4_CONF_SEND_REDIRECTS=6,
468 NET_IPV4_CONF_SHARED_MEDIA=7,
469 NET_IPV4_CONF_RP_FILTER=8,
470 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
471 NET_IPV4_CONF_BOOTP_RELAY=10,
472 NET_IPV4_CONF_LOG_MARTIANS=11,
473 NET_IPV4_CONF_TAG=12,
474 NET_IPV4_CONF_ARPFILTER=13,
475 NET_IPV4_CONF_MEDIUM_ID=14,
476 NET_IPV4_CONF_NOXFRM=15,
477 NET_IPV4_CONF_NOPOLICY=16,
478 NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
479 NET_IPV4_CONF_ARP_ANNOUNCE=18,
480 NET_IPV4_CONF_ARP_IGNORE=19,
481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
482 NET_IPV4_CONF_ARP_ACCEPT=21,
483 NET_IPV4_CONF_ARP_NOTIFY=22,
484};
485
486/* /proc/sys/net/ipv4/netfilter */
487enum
488{
489 NET_IPV4_NF_CONNTRACK_MAX=1,
490 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
491 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
492 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
493 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
494 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
495 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
496 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
497 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
498 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
499 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
500 NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
501 NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
502 NET_IPV4_NF_CONNTRACK_BUCKETS=14,
503 NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
504 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
505 NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
506 NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
507 NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
508 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
509 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
510 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
511 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
512 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
513 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
514 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
515 NET_IPV4_NF_CONNTRACK_COUNT=27,
516 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
517};
518
519/* /proc/sys/net/ipv6 */
520enum {
521 NET_IPV6_CONF=16,
522 NET_IPV6_NEIGH=17,
523 NET_IPV6_ROUTE=18,
524 NET_IPV6_ICMP=19,
525 NET_IPV6_BINDV6ONLY=20,
526 NET_IPV6_IP6FRAG_HIGH_THRESH=21,
527 NET_IPV6_IP6FRAG_LOW_THRESH=22,
528 NET_IPV6_IP6FRAG_TIME=23,
529 NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
530 NET_IPV6_MLD_MAX_MSF=25,
531};
532
533enum {
534 NET_IPV6_ROUTE_FLUSH=1,
535 NET_IPV6_ROUTE_GC_THRESH=2,
536 NET_IPV6_ROUTE_MAX_SIZE=3,
537 NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
538 NET_IPV6_ROUTE_GC_TIMEOUT=5,
539 NET_IPV6_ROUTE_GC_INTERVAL=6,
540 NET_IPV6_ROUTE_GC_ELASTICITY=7,
541 NET_IPV6_ROUTE_MTU_EXPIRES=8,
542 NET_IPV6_ROUTE_MIN_ADVMSS=9,
543 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
544};
545
546enum {
547 NET_IPV6_FORWARDING=1,
548 NET_IPV6_HOP_LIMIT=2,
549 NET_IPV6_MTU=3,
550 NET_IPV6_ACCEPT_RA=4,
551 NET_IPV6_ACCEPT_REDIRECTS=5,
552 NET_IPV6_AUTOCONF=6,
553 NET_IPV6_DAD_TRANSMITS=7,
554 NET_IPV6_RTR_SOLICITS=8,
555 NET_IPV6_RTR_SOLICIT_INTERVAL=9,
556 NET_IPV6_RTR_SOLICIT_DELAY=10,
557 NET_IPV6_USE_TEMPADDR=11,
558 NET_IPV6_TEMP_VALID_LFT=12,
559 NET_IPV6_TEMP_PREFERED_LFT=13,
560 NET_IPV6_REGEN_MAX_RETRY=14,
561 NET_IPV6_MAX_DESYNC_FACTOR=15,
562 NET_IPV6_MAX_ADDRESSES=16,
563 NET_IPV6_FORCE_MLD_VERSION=17,
564 NET_IPV6_ACCEPT_RA_DEFRTR=18,
565 NET_IPV6_ACCEPT_RA_PINFO=19,
566 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
567 NET_IPV6_RTR_PROBE_INTERVAL=21,
568 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
569 NET_IPV6_PROXY_NDP=23,
570 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
571 __NET_IPV6_MAX
572};
573
574/* /proc/sys/net/ipv6/icmp */
575enum {
576 NET_IPV6_ICMP_RATELIMIT=1
577};
578
579/* /proc/sys/net/<protocol>/neigh/<dev> */
580enum {
581 NET_NEIGH_MCAST_SOLICIT=1,
582 NET_NEIGH_UCAST_SOLICIT=2,
583 NET_NEIGH_APP_SOLICIT=3,
584 NET_NEIGH_RETRANS_TIME=4,
585 NET_NEIGH_REACHABLE_TIME=5,
586 NET_NEIGH_DELAY_PROBE_TIME=6,
587 NET_NEIGH_GC_STALE_TIME=7,
588 NET_NEIGH_UNRES_QLEN=8,
589 NET_NEIGH_PROXY_QLEN=9,
590 NET_NEIGH_ANYCAST_DELAY=10,
591 NET_NEIGH_PROXY_DELAY=11,
592 NET_NEIGH_LOCKTIME=12,
593 NET_NEIGH_GC_INTERVAL=13,
594 NET_NEIGH_GC_THRESH1=14,
595 NET_NEIGH_GC_THRESH2=15,
596 NET_NEIGH_GC_THRESH3=16,
597 NET_NEIGH_RETRANS_TIME_MS=17,
598 NET_NEIGH_REACHABLE_TIME_MS=18,
599};
600
601/* /proc/sys/net/dccp */
602enum {
603 NET_DCCP_DEFAULT=1,
604};
605
606/* /proc/sys/net/ipx */
607enum {
608 NET_IPX_PPROP_BROADCASTING=1,
609 NET_IPX_FORWARDING=2
610};
611
612/* /proc/sys/net/llc */
613enum {
614 NET_LLC2=1,
615 NET_LLC_STATION=2,
616};
617
618/* /proc/sys/net/llc/llc2 */
619enum {
620 NET_LLC2_TIMEOUT=1,
621};
622
623/* /proc/sys/net/llc/station */
624enum {
625 NET_LLC_STATION_ACK_TIMEOUT=1,
626};
627
628/* /proc/sys/net/llc/llc2/timeout */
629enum {
630 NET_LLC2_ACK_TIMEOUT=1,
631 NET_LLC2_P_TIMEOUT=2,
632 NET_LLC2_REJ_TIMEOUT=3,
633 NET_LLC2_BUSY_TIMEOUT=4,
634};
635
636/* /proc/sys/net/appletalk */
637enum {
638 NET_ATALK_AARP_EXPIRY_TIME=1,
639 NET_ATALK_AARP_TICK_TIME=2,
640 NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
641 NET_ATALK_AARP_RESOLVE_TIME=4
642};
643
644
645/* /proc/sys/net/netrom */
646enum {
647 NET_NETROM_DEFAULT_PATH_QUALITY=1,
648 NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
649 NET_NETROM_NETWORK_TTL_INITIALISER=3,
650 NET_NETROM_TRANSPORT_TIMEOUT=4,
651 NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
652 NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
653 NET_NETROM_TRANSPORT_BUSY_DELAY=7,
654 NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
655 NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
656 NET_NETROM_ROUTING_CONTROL=10,
657 NET_NETROM_LINK_FAILS_COUNT=11,
658 NET_NETROM_RESET=12
659};
660
661/* /proc/sys/net/ax25 */
662enum {
663 NET_AX25_IP_DEFAULT_MODE=1,
664 NET_AX25_DEFAULT_MODE=2,
665 NET_AX25_BACKOFF_TYPE=3,
666 NET_AX25_CONNECT_MODE=4,
667 NET_AX25_STANDARD_WINDOW=5,
668 NET_AX25_EXTENDED_WINDOW=6,
669 NET_AX25_T1_TIMEOUT=7,
670 NET_AX25_T2_TIMEOUT=8,
671 NET_AX25_T3_TIMEOUT=9,
672 NET_AX25_IDLE_TIMEOUT=10,
673 NET_AX25_N2=11,
674 NET_AX25_PACLEN=12,
675 NET_AX25_PROTOCOL=13,
676 NET_AX25_DAMA_SLAVE_TIMEOUT=14
677};
678
679/* /proc/sys/net/rose */
680enum {
681 NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
682 NET_ROSE_CALL_REQUEST_TIMEOUT=2,
683 NET_ROSE_RESET_REQUEST_TIMEOUT=3,
684 NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
685 NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
686 NET_ROSE_ROUTING_CONTROL=6,
687 NET_ROSE_LINK_FAIL_TIMEOUT=7,
688 NET_ROSE_MAX_VCS=8,
689 NET_ROSE_WINDOW_SIZE=9,
690 NET_ROSE_NO_ACTIVITY_TIMEOUT=10
691};
692
693/* /proc/sys/net/x25 */
694enum {
695 NET_X25_RESTART_REQUEST_TIMEOUT=1,
696 NET_X25_CALL_REQUEST_TIMEOUT=2,
697 NET_X25_RESET_REQUEST_TIMEOUT=3,
698 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
699 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
700 NET_X25_FORWARD=6
701};
702
703/* /proc/sys/net/token-ring */
704enum
705{
706 NET_TR_RIF_TIMEOUT=1
707};
708
709/* /proc/sys/net/decnet/ */
710enum {
711 NET_DECNET_NODE_TYPE = 1,
712 NET_DECNET_NODE_ADDRESS = 2,
713 NET_DECNET_NODE_NAME = 3,
714 NET_DECNET_DEFAULT_DEVICE = 4,
715 NET_DECNET_TIME_WAIT = 5,
716 NET_DECNET_DN_COUNT = 6,
717 NET_DECNET_DI_COUNT = 7,
718 NET_DECNET_DR_COUNT = 8,
719 NET_DECNET_DST_GC_INTERVAL = 9,
720 NET_DECNET_CONF = 10,
721 NET_DECNET_NO_FC_MAX_CWND = 11,
722 NET_DECNET_MEM = 12,
723 NET_DECNET_RMEM = 13,
724 NET_DECNET_WMEM = 14,
725 NET_DECNET_DEBUG_LEVEL = 255
726};
727
728/* /proc/sys/net/decnet/conf/<dev> */
729enum {
730 NET_DECNET_CONF_LOOPBACK = -2,
731 NET_DECNET_CONF_DDCMP = -3,
732 NET_DECNET_CONF_PPP = -4,
733 NET_DECNET_CONF_X25 = -5,
734 NET_DECNET_CONF_GRE = -6,
735 NET_DECNET_CONF_ETHER = -7
736
737 /* ... and ifindex of devices */
738};
739
740/* /proc/sys/net/decnet/conf/<dev>/ */
741enum {
742 NET_DECNET_CONF_DEV_PRIORITY = 1,
743 NET_DECNET_CONF_DEV_T1 = 2,
744 NET_DECNET_CONF_DEV_T2 = 3,
745 NET_DECNET_CONF_DEV_T3 = 4,
746 NET_DECNET_CONF_DEV_FORWARDING = 5,
747 NET_DECNET_CONF_DEV_BLKSIZE = 6,
748 NET_DECNET_CONF_DEV_STATE = 7
749};
750
751/* /proc/sys/net/sctp */
752enum {
753 NET_SCTP_RTO_INITIAL = 1,
754 NET_SCTP_RTO_MIN = 2,
755 NET_SCTP_RTO_MAX = 3,
756 NET_SCTP_RTO_ALPHA = 4,
757 NET_SCTP_RTO_BETA = 5,
758 NET_SCTP_VALID_COOKIE_LIFE = 6,
759 NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
760 NET_SCTP_PATH_MAX_RETRANS = 8,
761 NET_SCTP_MAX_INIT_RETRANSMITS = 9,
762 NET_SCTP_HB_INTERVAL = 10,
763 NET_SCTP_PRESERVE_ENABLE = 11,
764 NET_SCTP_MAX_BURST = 12,
765 NET_SCTP_ADDIP_ENABLE = 13,
766 NET_SCTP_PRSCTP_ENABLE = 14,
767 NET_SCTP_SNDBUF_POLICY = 15,
768 NET_SCTP_SACK_TIMEOUT = 16,
769 NET_SCTP_RCVBUF_POLICY = 17,
770};
771
772/* /proc/sys/net/bridge */
773enum {
774 NET_BRIDGE_NF_CALL_ARPTABLES = 1,
775 NET_BRIDGE_NF_CALL_IPTABLES = 2,
776 NET_BRIDGE_NF_CALL_IP6TABLES = 3,
777 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
778 NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
779};
780
781/* proc/sys/net/irda */
782enum {
783 NET_IRDA_DISCOVERY=1,
784 NET_IRDA_DEVNAME=2,
785 NET_IRDA_DEBUG=3,
786 NET_IRDA_FAST_POLL=4,
787 NET_IRDA_DISCOVERY_SLOTS=5,
788 NET_IRDA_DISCOVERY_TIMEOUT=6,
789 NET_IRDA_SLOT_TIMEOUT=7,
790 NET_IRDA_MAX_BAUD_RATE=8,
791 NET_IRDA_MIN_TX_TURN_TIME=9,
792 NET_IRDA_MAX_TX_DATA_SIZE=10,
793 NET_IRDA_MAX_TX_WINDOW=11,
794 NET_IRDA_MAX_NOREPLY_TIME=12,
795 NET_IRDA_WARN_NOREPLY_TIME=13,
796 NET_IRDA_LAP_KEEPALIVE_TIME=14,
797};
798
799
800/* CTL_FS names: */
801enum
802{
803 FS_NRINODE=1, /* int:current number of allocated inodes */
804 FS_STATINODE=2,
805 FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */
806 FS_NRDQUOT=4, /* int:current number of allocated dquots */
807 FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */
808 FS_NRFILE=6, /* int:current number of allocated filedescriptors */
809 FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */
810 FS_DENTRY=8,
811 FS_NRSUPER=9, /* int:current number of allocated super_blocks */
812 FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
813 FS_OVERFLOWUID=11, /* int: overflow UID */
814 FS_OVERFLOWGID=12, /* int: overflow GID */
815 FS_LEASES=13, /* int: leases enabled */
816 FS_DIR_NOTIFY=14, /* int: directory notification enabled */
817 FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */
818 FS_DQSTATS=16, /* disc quota usage statistics and control */
819 FS_XFS=17, /* struct: control xfs parameters */
820 FS_AIO_NR=18, /* current system-wide number of aio requests */
821 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
822 FS_INOTIFY=20, /* inotify submenu */
823 FS_OCFS2=988, /* ocfs2 */
824};
825
826/* /proc/sys/fs/quota/ */
827enum {
828 FS_DQ_LOOKUPS = 1,
829 FS_DQ_DROPS = 2,
830 FS_DQ_READS = 3,
831 FS_DQ_WRITES = 4,
832 FS_DQ_CACHE_HITS = 5,
833 FS_DQ_ALLOCATED = 6,
834 FS_DQ_FREE = 7,
835 FS_DQ_SYNCS = 8,
836 FS_DQ_WARNINGS = 9,
837};
838
839/* CTL_DEBUG names: */
840
841/* CTL_DEV names: */
842enum {
843 DEV_CDROM=1,
844 DEV_HWMON=2,
845 DEV_PARPORT=3,
846 DEV_RAID=4,
847 DEV_MAC_HID=5,
848 DEV_SCSI=6,
849 DEV_IPMI=7,
850};
851
852/* /proc/sys/dev/cdrom */
853enum {
854 DEV_CDROM_INFO=1,
855 DEV_CDROM_AUTOCLOSE=2,
856 DEV_CDROM_AUTOEJECT=3,
857 DEV_CDROM_DEBUG=4,
858 DEV_CDROM_LOCK=5,
859 DEV_CDROM_CHECK_MEDIA=6
860};
861
862/* /proc/sys/dev/parport */
863enum {
864 DEV_PARPORT_DEFAULT=-3
865};
866
867/* /proc/sys/dev/raid */
868enum {
869 DEV_RAID_SPEED_LIMIT_MIN=1,
870 DEV_RAID_SPEED_LIMIT_MAX=2
871};
872
873/* /proc/sys/dev/parport/default */
874enum {
875 DEV_PARPORT_DEFAULT_TIMESLICE=1,
876 DEV_PARPORT_DEFAULT_SPINTIME=2
877};
878
879/* /proc/sys/dev/parport/parport n */
880enum {
881 DEV_PARPORT_SPINTIME=1,
882 DEV_PARPORT_BASE_ADDR=2,
883 DEV_PARPORT_IRQ=3,
884 DEV_PARPORT_DMA=4,
885 DEV_PARPORT_MODES=5,
886 DEV_PARPORT_DEVICES=6,
887 DEV_PARPORT_AUTOPROBE=16
888};
889
890/* /proc/sys/dev/parport/parport n/devices/ */
891enum {
892 DEV_PARPORT_DEVICES_ACTIVE=-3,
893};
894
895/* /proc/sys/dev/parport/parport n/devices/device n */
896enum {
897 DEV_PARPORT_DEVICE_TIMESLICE=1,
898};
899
900/* /proc/sys/dev/mac_hid */
901enum {
902 DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
903 DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
904 DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
905 DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
906 DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
907 DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
908};
909
910/* /proc/sys/dev/scsi */
911enum {
912 DEV_SCSI_LOGGING_LEVEL=1,
913};
914
915/* /proc/sys/dev/ipmi */
916enum {
917 DEV_IPMI_POWEROFF_POWERCYCLE=1,
918};
919
920/* /proc/sys/abi */
921enum
922{
923 ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */
924 ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */
925 ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
926 ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
927 ABI_TRACE=5, /* tracing flags */
928 ABI_FAKE_UTSNAME=6, /* fake target utsname information */
929};
930
931#ifdef __KERNEL__
932#include <linux/list.h> 24#include <linux/list.h>
933#include <linux/rcupdate.h> 25#include <linux/rcupdate.h>
934#include <linux/wait.h> 26#include <linux/wait.h>
935#include <linux/rbtree.h> 27#include <linux/rbtree.h>
28#include <uapi/linux/sysctl.h>
936 29
937/* For the /proc/sys support */ 30/* For the /proc/sys support */
938struct ctl_table; 31struct ctl_table;
@@ -1122,6 +215,4 @@ static inline void setup_sysctl_set(struct ctl_table_set *p,
1122 215
1123#endif /* CONFIG_SYSCTL */ 216#endif /* CONFIG_SYSCTL */
1124 217
1125#endif /* __KERNEL__ */
1126
1127#endif /* _LINUX_SYSCTL_H */ 218#endif /* _LINUX_SYSCTL_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 67c789ae719..8a7fc4be2d7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -17,217 +17,13 @@
17#ifndef _LINUX_TCP_H 17#ifndef _LINUX_TCP_H
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h>
21#include <asm/byteorder.h>
22#include <linux/socket.h>
23
24struct tcphdr {
25 __be16 source;
26 __be16 dest;
27 __be32 seq;
28 __be32 ack_seq;
29#if defined(__LITTLE_ENDIAN_BITFIELD)
30 __u16 res1:4,
31 doff:4,
32 fin:1,
33 syn:1,
34 rst:1,
35 psh:1,
36 ack:1,
37 urg:1,
38 ece:1,
39 cwr:1;
40#elif defined(__BIG_ENDIAN_BITFIELD)
41 __u16 doff:4,
42 res1:4,
43 cwr:1,
44 ece:1,
45 urg:1,
46 ack:1,
47 psh:1,
48 rst:1,
49 syn:1,
50 fin:1;
51#else
52#error "Adjust your <asm/byteorder.h> defines"
53#endif
54 __be16 window;
55 __sum16 check;
56 __be16 urg_ptr;
57};
58
59/*
60 * The union cast uses a gcc extension to avoid aliasing problems
61 * (union is compatible to any of its members)
62 * This means this part of the code is -fstrict-aliasing safe now.
63 */
64union tcp_word_hdr {
65 struct tcphdr hdr;
66 __be32 words[5];
67};
68
69#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
70
71enum {
72 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
73 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
74 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
75 TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
76 TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
77 TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
78 TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
79 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
80 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
81 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
82};
83
84/*
85 * TCP general constants
86 */
87#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
88#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
89
90/* TCP socket options */
91#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
92#define TCP_MAXSEG 2 /* Limit MSS */
93#define TCP_CORK 3 /* Never send partially complete segments */
94#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
95#define TCP_KEEPINTVL 5 /* Interval between keepalives */
96#define TCP_KEEPCNT 6 /* Number of keepalives before death */
97#define TCP_SYNCNT 7 /* Number of SYN retransmits */
98#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
99#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
100#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
101#define TCP_INFO 11 /* Information about this connection. */
102#define TCP_QUICKACK 12 /* Block/reenable quick acks */
103#define TCP_CONGESTION 13 /* Congestion control algorithm */
104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
109#define TCP_REPAIR 19 /* TCP sock is under repair right now */
110#define TCP_REPAIR_QUEUE 20
111#define TCP_QUEUE_SEQ 21
112#define TCP_REPAIR_OPTIONS 22
113#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
114
115struct tcp_repair_opt {
116 __u32 opt_code;
117 __u32 opt_val;
118};
119
120enum {
121 TCP_NO_QUEUE,
122 TCP_RECV_QUEUE,
123 TCP_SEND_QUEUE,
124 TCP_QUEUES_NR,
125};
126
127/* for TCP_INFO socket option */
128#define TCPI_OPT_TIMESTAMPS 1
129#define TCPI_OPT_SACK 2
130#define TCPI_OPT_WSCALE 4
131#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
132#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
133
134enum tcp_ca_state {
135 TCP_CA_Open = 0,
136#define TCPF_CA_Open (1<<TCP_CA_Open)
137 TCP_CA_Disorder = 1,
138#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
139 TCP_CA_CWR = 2,
140#define TCPF_CA_CWR (1<<TCP_CA_CWR)
141 TCP_CA_Recovery = 3,
142#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
143 TCP_CA_Loss = 4
144#define TCPF_CA_Loss (1<<TCP_CA_Loss)
145};
146
147struct tcp_info {
148 __u8 tcpi_state;
149 __u8 tcpi_ca_state;
150 __u8 tcpi_retransmits;
151 __u8 tcpi_probes;
152 __u8 tcpi_backoff;
153 __u8 tcpi_options;
154 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
155
156 __u32 tcpi_rto;
157 __u32 tcpi_ato;
158 __u32 tcpi_snd_mss;
159 __u32 tcpi_rcv_mss;
160
161 __u32 tcpi_unacked;
162 __u32 tcpi_sacked;
163 __u32 tcpi_lost;
164 __u32 tcpi_retrans;
165 __u32 tcpi_fackets;
166
167 /* Times. */
168 __u32 tcpi_last_data_sent;
169 __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
170 __u32 tcpi_last_data_recv;
171 __u32 tcpi_last_ack_recv;
172
173 /* Metrics. */
174 __u32 tcpi_pmtu;
175 __u32 tcpi_rcv_ssthresh;
176 __u32 tcpi_rtt;
177 __u32 tcpi_rttvar;
178 __u32 tcpi_snd_ssthresh;
179 __u32 tcpi_snd_cwnd;
180 __u32 tcpi_advmss;
181 __u32 tcpi_reordering;
182
183 __u32 tcpi_rcv_rtt;
184 __u32 tcpi_rcv_space;
185
186 __u32 tcpi_total_retrans;
187};
188
189/* for TCP_MD5SIG socket option */
190#define TCP_MD5SIG_MAXKEYLEN 80
191
192struct tcp_md5sig {
193 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
194 __u16 __tcpm_pad1; /* zero */
195 __u16 tcpm_keylen; /* key length */
196 __u32 __tcpm_pad2; /* zero */
197 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
198};
199
200/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
201#define TCP_COOKIE_MIN 8 /* 64-bits */
202#define TCP_COOKIE_MAX 16 /* 128-bits */
203#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
204
205/* Flags for both getsockopt and setsockopt */
206#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
207#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
208 * supercedes everything. */
209
210/* Flags for getsockopt */
211#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
212#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
213
214/* TCP_COOKIE_TRANSACTIONS data */
215struct tcp_cookie_transactions {
216 __u16 tcpct_flags; /* see above */
217 __u8 __tcpct_pad1; /* zero */
218 __u8 tcpct_cookie_desired; /* bytes */
219 __u16 tcpct_s_data_desired; /* bytes of variable data */
220 __u16 tcpct_used; /* bytes in value */
221 __u8 tcpct_value[TCP_MSS_DEFAULT];
222};
223
224#ifdef __KERNEL__
225 20
226#include <linux/skbuff.h> 21#include <linux/skbuff.h>
227#include <linux/dmaengine.h> 22#include <linux/dmaengine.h>
228#include <net/sock.h> 23#include <net/sock.h>
229#include <net/inet_connection_sock.h> 24#include <net/inet_connection_sock.h>
230#include <net/inet_timewait_sock.h> 25#include <net/inet_timewait_sock.h>
26#include <uapi/linux/tcp.h>
231 27
232static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) 28static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
233{ 29{
@@ -595,6 +391,4 @@ static inline int fastopen_init_queue(struct sock *sk, int backlog)
595 return 0; 391 return 0;
596} 392}
597 393
598#endif /* __KERNEL__ */
599
600#endif /* _LINUX_TCP_H */ 394#endif /* _LINUX_TCP_H */
diff --git a/include/linux/time.h b/include/linux/time.h
index b51e664c83e..4d358e9d10f 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -1,33 +1,10 @@
1#ifndef _LINUX_TIME_H 1#ifndef _LINUX_TIME_H
2#define _LINUX_TIME_H 2#define _LINUX_TIME_H
3 3
4#include <linux/types.h>
5
6#ifdef __KERNEL__
7# include <linux/cache.h> 4# include <linux/cache.h>
8# include <linux/seqlock.h> 5# include <linux/seqlock.h>
9# include <linux/math64.h> 6# include <linux/math64.h>
10#endif 7#include <uapi/linux/time.h>
11
12#ifndef _STRUCT_TIMESPEC
13#define _STRUCT_TIMESPEC
14struct timespec {
15 __kernel_time_t tv_sec; /* seconds */
16 long tv_nsec; /* nanoseconds */
17};
18#endif
19
20struct timeval {
21 __kernel_time_t tv_sec; /* seconds */
22 __kernel_suseconds_t tv_usec; /* microseconds */
23};
24
25struct timezone {
26 int tz_minuteswest; /* minutes west of Greenwich */
27 int tz_dsttime; /* type of dst correction */
28};
29
30#ifdef __KERNEL__
31 8
32extern struct timezone sys_tz; 9extern struct timezone sys_tz;
33 10
@@ -280,51 +257,4 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
280 a->tv_nsec = ns; 257 a->tv_nsec = ns;
281} 258}
282 259
283#endif /* __KERNEL__ */
284
285/*
286 * Names of the interval timers, and structure
287 * defining a timer setting:
288 */
289#define ITIMER_REAL 0
290#define ITIMER_VIRTUAL 1
291#define ITIMER_PROF 2
292
293struct itimerspec {
294 struct timespec it_interval; /* timer period */
295 struct timespec it_value; /* timer expiration */
296};
297
298struct itimerval {
299 struct timeval it_interval; /* timer interval */
300 struct timeval it_value; /* current value */
301};
302
303/*
304 * The IDs of the various system clocks (for POSIX.1b interval timers):
305 */
306#define CLOCK_REALTIME 0
307#define CLOCK_MONOTONIC 1
308#define CLOCK_PROCESS_CPUTIME_ID 2
309#define CLOCK_THREAD_CPUTIME_ID 3
310#define CLOCK_MONOTONIC_RAW 4
311#define CLOCK_REALTIME_COARSE 5
312#define CLOCK_MONOTONIC_COARSE 6
313#define CLOCK_BOOTTIME 7
314#define CLOCK_REALTIME_ALARM 8
315#define CLOCK_BOOTTIME_ALARM 9
316
317/*
318 * The IDs of various hardware clocks:
319 */
320#define CLOCK_SGI_CYCLE 10
321#define MAX_CLOCKS 16
322#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
323#define CLOCKS_MONO CLOCK_MONOTONIC
324
325/*
326 * The various flags for setting POSIX.1b interval timers:
327 */
328#define TIMER_ABSTIME 0x01
329
330#endif 260#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 7c5ceb20e03..5ec87c60b97 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -53,120 +53,11 @@
53#ifndef _LINUX_TIMEX_H 53#ifndef _LINUX_TIMEX_H
54#define _LINUX_TIMEX_H 54#define _LINUX_TIMEX_H
55 55
56#include <linux/time.h> 56#include <uapi/linux/timex.h>
57 57
58#define NTP_API 4 /* NTP API version */
59
60/*
61 * syscall interface - used (mainly by NTP daemon)
62 * to discipline kernel clock oscillator
63 */
64struct timex {
65 unsigned int modes; /* mode selector */
66 long offset; /* time offset (usec) */
67 long freq; /* frequency offset (scaled ppm) */
68 long maxerror; /* maximum error (usec) */
69 long esterror; /* estimated error (usec) */
70 int status; /* clock command/status */
71 long constant; /* pll time constant */
72 long precision; /* clock precision (usec) (read only) */
73 long tolerance; /* clock frequency tolerance (ppm)
74 * (read only)
75 */
76 struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
77 long tick; /* (modified) usecs between clock ticks */
78
79 long ppsfreq; /* pps frequency (scaled ppm) (ro) */
80 long jitter; /* pps jitter (us) (ro) */
81 int shift; /* interval duration (s) (shift) (ro) */
82 long stabil; /* pps stability (scaled ppm) (ro) */
83 long jitcnt; /* jitter limit exceeded (ro) */
84 long calcnt; /* calibration intervals (ro) */
85 long errcnt; /* calibration errors (ro) */
86 long stbcnt; /* stability limit exceeded (ro) */
87
88 int tai; /* TAI offset (ro) */
89
90 int :32; int :32; int :32; int :32;
91 int :32; int :32; int :32; int :32;
92 int :32; int :32; int :32;
93};
94
95/*
96 * Mode codes (timex.mode)
97 */
98#define ADJ_OFFSET 0x0001 /* time offset */
99#define ADJ_FREQUENCY 0x0002 /* frequency offset */
100#define ADJ_MAXERROR 0x0004 /* maximum time error */
101#define ADJ_ESTERROR 0x0008 /* estimated time error */
102#define ADJ_STATUS 0x0010 /* clock status */
103#define ADJ_TIMECONST 0x0020 /* pll time constant */
104#define ADJ_TAI 0x0080 /* set TAI offset */
105#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
106#define ADJ_MICRO 0x1000 /* select microsecond resolution */
107#define ADJ_NANO 0x2000 /* select nanosecond resolution */
108#define ADJ_TICK 0x4000 /* tick value */
109
110#ifdef __KERNEL__
111#define ADJ_ADJTIME 0x8000 /* switch between adjtime/adjtimex modes */ 58#define ADJ_ADJTIME 0x8000 /* switch between adjtime/adjtimex modes */
112#define ADJ_OFFSET_SINGLESHOT 0x0001 /* old-fashioned adjtime */ 59#define ADJ_OFFSET_SINGLESHOT 0x0001 /* old-fashioned adjtime */
113#define ADJ_OFFSET_READONLY 0x2000 /* read-only adjtime */ 60#define ADJ_OFFSET_READONLY 0x2000 /* read-only adjtime */
114#else
115#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
116#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
117#endif
118
119/* NTP userland likes the MOD_ prefix better */
120#define MOD_OFFSET ADJ_OFFSET
121#define MOD_FREQUENCY ADJ_FREQUENCY
122#define MOD_MAXERROR ADJ_MAXERROR
123#define MOD_ESTERROR ADJ_ESTERROR
124#define MOD_STATUS ADJ_STATUS
125#define MOD_TIMECONST ADJ_TIMECONST
126#define MOD_TAI ADJ_TAI
127#define MOD_MICRO ADJ_MICRO
128#define MOD_NANO ADJ_NANO
129
130
131/*
132 * Status codes (timex.status)
133 */
134#define STA_PLL 0x0001 /* enable PLL updates (rw) */
135#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
136#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
137#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
138
139#define STA_INS 0x0010 /* insert leap (rw) */
140#define STA_DEL 0x0020 /* delete leap (rw) */
141#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
142#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
143
144#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
145#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
146#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
147#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
148
149#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
150#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
151#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
152#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
153
154/* read-only bits */
155#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
156 STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
157
158/*
159 * Clock states (time_state)
160 */
161#define TIME_OK 0 /* clock synchronized, no leap second */
162#define TIME_INS 1 /* insert leap second */
163#define TIME_DEL 2 /* delete leap second */
164#define TIME_OOP 3 /* leap second in progress */
165#define TIME_WAIT 4 /* leap second has occurred */
166#define TIME_ERROR 5 /* clock not synchronized */
167#define TIME_BAD TIME_ERROR /* bw compat */
168
169#ifdef __KERNEL__
170#include <linux/compiler.h> 61#include <linux/compiler.h>
171#include <linux/types.h> 62#include <linux/types.h>
172#include <linux/param.h> 63#include <linux/param.h>
@@ -261,6 +152,4 @@ int read_current_timer(unsigned long *timer_val);
261/* The clock frequency of the i8253/i8254 PIT */ 152/* The clock frequency of the i8253/i8254 PIT */
262#define PIT_TICK_RATE 1193182ul 153#define PIT_TICK_RATE 1193182ul
263 154
264#endif /* KERNEL */
265
266#endif /* LINUX_TIMEX_H */ 155#endif /* LINUX_TIMEX_H */
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h
index 772dedbc3a2..915c3bb164a 100644
--- a/include/linux/toshiba.h
+++ b/include/linux/toshiba.h
@@ -16,25 +16,10 @@
16 * General Public License for more details. 16 * General Public License for more details.
17 * 17 *
18 */ 18 */
19
20#ifndef _LINUX_TOSHIBA_H 19#ifndef _LINUX_TOSHIBA_H
21#define _LINUX_TOSHIBA_H 20#define _LINUX_TOSHIBA_H
22 21
23#define TOSH_PROC "/proc/toshiba" 22#include <uapi/linux/toshiba.h>
24#define TOSH_DEVICE "/dev/toshiba"
25#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
26
27typedef struct {
28 unsigned int eax;
29 unsigned int ebx __attribute__ ((packed));
30 unsigned int ecx __attribute__ ((packed));
31 unsigned int edx __attribute__ ((packed));
32 unsigned int esi __attribute__ ((packed));
33 unsigned int edi __attribute__ ((packed));
34} SMMRegisters;
35 23
36#ifdef __KERNEL__
37int tosh_smm(SMMRegisters *regs); 24int tosh_smm(SMMRegisters *regs);
38#endif /* __KERNEL__ */
39
40#endif 25#endif
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 4f6c59a5fb7..f0b4eb47297 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -1,41 +1,6 @@
1#ifndef _LINUX_TTY_H 1#ifndef _LINUX_TTY_H
2#define _LINUX_TTY_H 2#define _LINUX_TTY_H
3 3
4/*
5 * 'tty.h' defines some structures used by tty_io.c and some defines.
6 */
7
8#define NR_LDISCS 30
9
10/* line disciplines */
11#define N_TTY 0
12#define N_SLIP 1
13#define N_MOUSE 2
14#define N_PPP 3
15#define N_STRIP 4
16#define N_AX25 5
17#define N_X25 6 /* X.25 async */
18#define N_6PACK 7
19#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
20#define N_R3964 9 /* Reserved for Simatic R3964 module */
21#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */
22#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
23#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data */
24 /* cards about SMS messages */
25#define N_HDLC 13 /* synchronous HDLC */
26#define N_SYNC_PPP 14 /* synchronous PPP */
27#define N_HCI 15 /* Bluetooth HCI UART */
28#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */
29#define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */
30#define N_PPS 18 /* Pulse per Second */
31#define N_V253 19 /* Codec control over voice modem */
32#define N_CAIF 20 /* CAIF protocol for talking to modems */
33#define N_GSM0710 21 /* GSM 0710 Mux */
34#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
35#define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */
36#define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */
37
38#ifdef __KERNEL__
39#include <linux/fs.h> 4#include <linux/fs.h>
40#include <linux/major.h> 5#include <linux/major.h>
41#include <linux/termios.h> 6#include <linux/termios.h>
@@ -44,6 +9,7 @@
44#include <linux/tty_ldisc.h> 9#include <linux/tty_ldisc.h>
45#include <linux/mutex.h> 10#include <linux/mutex.h>
46#include <linux/tty_flags.h> 11#include <linux/tty_flags.h>
12#include <uapi/linux/tty.h>
47 13
48 14
49 15
@@ -694,5 +660,4 @@ do { \
694} while (0) 660} while (0)
695 661
696 662
697#endif /* __KERNEL__ */
698#endif 663#endif
diff --git a/include/linux/types.h b/include/linux/types.h
index bf0dd7524b2..1cc0e4b9a04 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -1,22 +1,13 @@
1#ifndef _LINUX_TYPES_H 1#ifndef _LINUX_TYPES_H
2#define _LINUX_TYPES_H 2#define _LINUX_TYPES_H
3 3
4#include <asm/types.h> 4#define __EXPORTED_HEADERS__
5#include <uapi/linux/types.h>
5 6
6#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
7#ifdef __KERNEL__
8 8
9#define DECLARE_BITMAP(name,bits) \ 9#define DECLARE_BITMAP(name,bits) \
10 unsigned long name[BITS_TO_LONGS(bits)] 10 unsigned long name[BITS_TO_LONGS(bits)]
11#else
12#ifndef __EXPORTED_HEADERS__
13#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
14#endif /* __EXPORTED_HEADERS__ */
15#endif
16
17#include <linux/posix_types.h>
18
19#ifdef __KERNEL__
20 11
21typedef __u32 __kernel_dev_t; 12typedef __u32 __kernel_dev_t;
22 13
@@ -157,48 +148,12 @@ typedef u64 dma_addr_t;
157typedef u32 dma_addr_t; 148typedef u32 dma_addr_t;
158#endif /* dma_addr_t */ 149#endif /* dma_addr_t */
159 150
160#endif /* __KERNEL__ */
161
162/*
163 * Below are truly Linux-specific types that should never collide with
164 * any application/library that wants linux/types.h.
165 */
166
167#ifdef __CHECKER__ 151#ifdef __CHECKER__
168#define __bitwise__ __attribute__((bitwise))
169#else 152#else
170#define __bitwise__
171#endif 153#endif
172#ifdef __CHECK_ENDIAN__ 154#ifdef __CHECK_ENDIAN__
173#define __bitwise __bitwise__
174#else 155#else
175#define __bitwise
176#endif 156#endif
177
178typedef __u16 __bitwise __le16;
179typedef __u16 __bitwise __be16;
180typedef __u32 __bitwise __le32;
181typedef __u32 __bitwise __be32;
182typedef __u64 __bitwise __le64;
183typedef __u64 __bitwise __be64;
184
185typedef __u16 __bitwise __sum16;
186typedef __u32 __bitwise __wsum;
187
188/*
189 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
190 * common 32/64-bit compat problems.
191 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
192 * architectures) and to 8-byte boundaries on 64-bit architectures. The new
193 * aligned_64 type enforces 8-byte alignment so that structs containing
194 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
195 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
196 */
197#define __aligned_u64 __u64 __attribute__((aligned(8)))
198#define __aligned_be64 __be64 __attribute__((aligned(8)))
199#define __aligned_le64 __le64 __attribute__((aligned(8)))
200
201#ifdef __KERNEL__
202typedef unsigned __bitwise__ gfp_t; 157typedef unsigned __bitwise__ gfp_t;
203typedef unsigned __bitwise__ fmode_t; 158typedef unsigned __bitwise__ fmode_t;
204 159
@@ -256,6 +211,5 @@ struct callback_head {
256}; 211};
257#define rcu_head callback_head 212#define rcu_head callback_head
258 213
259#endif /* __KERNEL__ */
260#endif /* __ASSEMBLY__ */ 214#endif /* __ASSEMBLY__ */
261#endif /* _LINUX_TYPES_H */ 215#endif /* _LINUX_TYPES_H */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 03f72a2ba02..0b67d779352 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -17,28 +17,10 @@
17#ifndef _LINUX_UDP_H 17#ifndef _LINUX_UDP_H
18#define _LINUX_UDP_H 18#define _LINUX_UDP_H
19 19
20#include <linux/types.h>
21
22struct udphdr {
23 __be16 source;
24 __be16 dest;
25 __be16 len;
26 __sum16 check;
27};
28
29/* UDP socket options */
30#define UDP_CORK 1 /* Never send partially complete segments */
31#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
32
33/* UDP encapsulation types */
34#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
36#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
37
38#ifdef __KERNEL__
39#include <net/inet_sock.h> 20#include <net/inet_sock.h>
40#include <linux/skbuff.h> 21#include <linux/skbuff.h>
41#include <net/netns/hash.h> 22#include <net/netns/hash.h>
23#include <uapi/linux/udp.h>
42 24
43static inline struct udphdr *udp_hdr(const struct sk_buff *skb) 25static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
44{ 26{
@@ -96,6 +78,4 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
96 78
97#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) 79#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
98 80
99#endif
100
101#endif /* _LINUX_UDP_H */ 81#endif /* _LINUX_UDP_H */
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index c454bbe39ee..0a4487d3fb1 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -1,5 +1,3 @@
1#ifndef __UINPUT_H_
2#define __UINPUT_H_
3/* 1/*
4 * User level driver support for input subsystem 2 * User level driver support for input subsystem
5 * 3 *
@@ -31,13 +29,11 @@
31 * 0.1 20/06/2002 29 * 0.1 20/06/2002
32 * - first public version 30 * - first public version
33 */ 31 */
32#ifndef __UINPUT_H_
33#define __UINPUT_H_
34 34
35#include <linux/types.h> 35#include <uapi/linux/uinput.h>
36#include <linux/input.h>
37
38#define UINPUT_VERSION 3
39 36
40#ifdef __KERNEL__
41#define UINPUT_NAME "uinput" 37#define UINPUT_NAME "uinput"
42#define UINPUT_BUFFER_SIZE 16 38#define UINPUT_BUFFER_SIZE 16
43#define UINPUT_NUM_REQUESTS 16 39#define UINPUT_NUM_REQUESTS 16
@@ -75,103 +71,4 @@ struct uinput_device {
75 wait_queue_head_t requests_waitq; 71 wait_queue_head_t requests_waitq;
76 spinlock_t requests_lock; 72 spinlock_t requests_lock;
77}; 73};
78#endif /* __KERNEL__ */
79
80struct uinput_ff_upload {
81 __u32 request_id;
82 __s32 retval;
83 struct ff_effect effect;
84 struct ff_effect old;
85};
86
87struct uinput_ff_erase {
88 __u32 request_id;
89 __s32 retval;
90 __u32 effect_id;
91};
92
93/* ioctl */
94#define UINPUT_IOCTL_BASE 'U'
95#define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1)
96#define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2)
97
98#define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int)
99#define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int)
100#define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int)
101#define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int)
102#define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int)
103#define UI_SET_LEDBIT _IOW(UINPUT_IOCTL_BASE, 105, int)
104#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
105#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
106#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
107#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
108#define UI_SET_PROPBIT _IOW(UINPUT_IOCTL_BASE, 110, int)
109
110#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
111#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
112#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
113#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
114
115/*
116 * To write a force-feedback-capable driver, the upload_effect
117 * and erase_effect callbacks in input_dev must be implemented.
118 * The uinput driver will generate a fake input event when one of
119 * these callbacks are invoked. The userspace code then uses
120 * ioctls to retrieve additional parameters and send the return code.
121 * The callback blocks until this return code is sent.
122 *
123 * The described callback mechanism is only used if ff_effects_max
124 * is set.
125 *
126 * To implement upload_effect():
127 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
128 * A request ID will be given in 'value'.
129 * 2. Allocate a uinput_ff_upload struct, fill in request_id with
130 * the 'value' from the EV_UINPUT event.
131 * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
132 * uinput_ff_upload struct. It will be filled in with the
133 * ff_effects passed to upload_effect().
134 * 4. Perform the effect upload, and place a return code back into
135 the uinput_ff_upload struct.
136 * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
137 * uinput_ff_upload_effect struct. This will complete execution
138 * of our upload_effect() handler.
139 *
140 * To implement erase_effect():
141 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
142 * A request ID will be given in 'value'.
143 * 2. Allocate a uinput_ff_erase struct, fill in request_id with
144 * the 'value' from the EV_UINPUT event.
145 * 3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
146 * uinput_ff_erase struct. It will be filled in with the
147 * effect ID passed to erase_effect().
148 * 4. Perform the effect erasure, and place a return code back
149 * into the uinput_ff_erase struct.
150 * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the
151 * uinput_ff_erase_effect struct. This will complete execution
152 * of our erase_effect() handler.
153 */
154
155/*
156 * This is the new event type, used only by uinput.
157 * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
158 * is the unique request ID. This number was picked
159 * arbitrarily, above EV_MAX (since the input system
160 * never sees it) but in the range of a 16-bit int.
161 */
162#define EV_UINPUT 0x0101
163#define UI_FF_UPLOAD 1
164#define UI_FF_ERASE 2
165
166#define UINPUT_MAX_NAME_SIZE 80
167struct uinput_user_dev {
168 char name[UINPUT_MAX_NAME_SIZE];
169 struct input_id id;
170 __u32 ff_effects_max;
171 __s32 absmax[ABS_CNT];
172 __s32 absmin[ABS_CNT];
173 __s32 absfuzz[ABS_CNT];
174 __s32 absflat[ABS_CNT];
175};
176#endif /* __UINPUT_H_ */ 74#endif /* __UINPUT_H_ */
177
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 98c114323a8..629aaf51f30 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -1,9 +1,3 @@
1#ifndef __LINUX_UIO_H
2#define __LINUX_UIO_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6
7/* 1/*
8 * Berkeley style UIO structures - Alan Cox 1994. 2 * Berkeley style UIO structures - Alan Cox 1994.
9 * 3 *
@@ -12,21 +6,11 @@
12 * as published by the Free Software Foundation; either version 6 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
14 */ 8 */
9#ifndef __LINUX_UIO_H
10#define __LINUX_UIO_H
15 11
16struct iovec 12#include <uapi/linux/uio.h>
17{
18 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
20};
21
22/*
23 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
24 */
25
26#define UIO_FASTIOV 8
27#define UIO_MAXIOV 1024
28 13
29#ifdef __KERNEL__
30 14
31struct kvec { 15struct kvec {
32 void *iov_base; /* and that should *never* hold a userland pointer */ 16 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)
52 36
53unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); 37unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
54#endif 38#endif
55
56#endif
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 4abe28e41cb..04a26285416 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -25,126 +25,11 @@
25 */ 25 */
26 26
27/*****************************************************************************/ 27/*****************************************************************************/
28
29#ifndef _LINUX_USBDEVICE_FS_H 28#ifndef _LINUX_USBDEVICE_FS_H
30#define _LINUX_USBDEVICE_FS_H 29#define _LINUX_USBDEVICE_FS_H
31 30
32#include <linux/types.h> 31#include <uapi/linux/usbdevice_fs.h>
33#include <linux/magic.h>
34
35/* --------------------------------------------------------------------- */
36
37/* usbdevfs ioctl codes */
38
39struct usbdevfs_ctrltransfer {
40 __u8 bRequestType;
41 __u8 bRequest;
42 __u16 wValue;
43 __u16 wIndex;
44 __u16 wLength;
45 __u32 timeout; /* in milliseconds */
46 void __user *data;
47};
48
49struct usbdevfs_bulktransfer {
50 unsigned int ep;
51 unsigned int len;
52 unsigned int timeout; /* in milliseconds */
53 void __user *data;
54};
55
56struct usbdevfs_setinterface {
57 unsigned int interface;
58 unsigned int altsetting;
59};
60
61struct usbdevfs_disconnectsignal {
62 unsigned int signr;
63 void __user *context;
64};
65
66#define USBDEVFS_MAXDRIVERNAME 255
67
68struct usbdevfs_getdriver {
69 unsigned int interface;
70 char driver[USBDEVFS_MAXDRIVERNAME + 1];
71};
72
73struct usbdevfs_connectinfo {
74 unsigned int devnum;
75 unsigned char slow;
76};
77
78#define USBDEVFS_URB_SHORT_NOT_OK 0x01
79#define USBDEVFS_URB_ISO_ASAP 0x02
80#define USBDEVFS_URB_BULK_CONTINUATION 0x04
81#define USBDEVFS_URB_NO_FSBR 0x20
82#define USBDEVFS_URB_ZERO_PACKET 0x40
83#define USBDEVFS_URB_NO_INTERRUPT 0x80
84
85#define USBDEVFS_URB_TYPE_ISO 0
86#define USBDEVFS_URB_TYPE_INTERRUPT 1
87#define USBDEVFS_URB_TYPE_CONTROL 2
88#define USBDEVFS_URB_TYPE_BULK 3
89 32
90struct usbdevfs_iso_packet_desc {
91 unsigned int length;
92 unsigned int actual_length;
93 unsigned int status;
94};
95
96struct usbdevfs_urb {
97 unsigned char type;
98 unsigned char endpoint;
99 int status;
100 unsigned int flags;
101 void __user *buffer;
102 int buffer_length;
103 int actual_length;
104 int start_frame;
105 int number_of_packets;
106 int error_count;
107 unsigned int signr; /* signal to be sent on completion,
108 or 0 if none should be sent. */
109 void __user *usercontext;
110 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
111};
112
113/* ioctls for talking directly to drivers */
114struct usbdevfs_ioctl {
115 int ifno; /* interface 0..N ; negative numbers reserved */
116 int ioctl_code; /* MUST encode size + direction of data so the
117 * macros in <asm/ioctl.h> give correct values */
118 void __user *data; /* param buffer (in, or out) */
119};
120
121/* You can do most things with hubs just through control messages,
122 * except find out what device connects to what port. */
123struct usbdevfs_hub_portinfo {
124 char nports; /* number of downstream ports in this hub */
125 char port [127]; /* e.g. port 3 connects to device 27 */
126};
127
128/* Device capability flags */
129#define USBDEVFS_CAP_ZERO_PACKET 0x01
130#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
131#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
132#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
133
134/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
135
136/* disconnect-and-claim if the driver matches the driver field */
137#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
138/* disconnect-and-claim except when the driver matches the driver field */
139#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
140
141struct usbdevfs_disconnect_claim {
142 unsigned int interface;
143 unsigned int flags;
144 char driver[USBDEVFS_MAXDRIVERNAME + 1];
145};
146
147#ifdef __KERNEL__
148#ifdef CONFIG_COMPAT 33#ifdef CONFIG_COMPAT
149#include <linux/compat.h> 34#include <linux/compat.h>
150 35
@@ -192,38 +77,4 @@ struct usbdevfs_ioctl32 {
192 compat_caddr_t data; 77 compat_caddr_t data;
193}; 78};
194#endif 79#endif
195#endif /* __KERNEL__ */
196
197#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
198#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
199#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
200#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
201#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
202#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
203#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
204#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
205#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
206#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
207#define USBDEVFS_DISCARDURB _IO('U', 11)
208#define USBDEVFS_REAPURB _IOW('U', 12, void *)
209#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
210#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
211#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
212#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
213#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
214#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
215#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
216#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
217#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
218#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
219#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
220#define USBDEVFS_RESET _IO('U', 20)
221#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
222#define USBDEVFS_DISCONNECT _IO('U', 22)
223#define USBDEVFS_CONNECT _IO('U', 23)
224#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
225#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
226#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
227#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
228
229#endif /* _LINUX_USBDEVICE_FS_H */ 80#endif /* _LINUX_USBDEVICE_FS_H */
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index c714ed75eae..2b345206722 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -1,41 +1,12 @@
1#ifndef _LINUX_UTSNAME_H 1#ifndef _LINUX_UTSNAME_H
2#define _LINUX_UTSNAME_H 2#define _LINUX_UTSNAME_H
3 3
4#define __OLD_UTS_LEN 8
5
6struct oldold_utsname {
7 char sysname[9];
8 char nodename[9];
9 char release[9];
10 char version[9];
11 char machine[9];
12};
13
14#define __NEW_UTS_LEN 64
15
16struct old_utsname {
17 char sysname[65];
18 char nodename[65];
19 char release[65];
20 char version[65];
21 char machine[65];
22};
23
24struct new_utsname {
25 char sysname[__NEW_UTS_LEN + 1];
26 char nodename[__NEW_UTS_LEN + 1];
27 char release[__NEW_UTS_LEN + 1];
28 char version[__NEW_UTS_LEN + 1];
29 char machine[__NEW_UTS_LEN + 1];
30 char domainname[__NEW_UTS_LEN + 1];
31};
32
33#ifdef __KERNEL__
34 4
35#include <linux/sched.h> 5#include <linux/sched.h>
36#include <linux/kref.h> 6#include <linux/kref.h>
37#include <linux/nsproxy.h> 7#include <linux/nsproxy.h>
38#include <linux/err.h> 8#include <linux/err.h>
9#include <uapi/linux/utsname.h>
39 10
40enum uts_proc { 11enum uts_proc {
41 UTS_PROC_OSTYPE, 12 UTS_PROC_OSTYPE,
@@ -108,6 +79,4 @@ static inline struct new_utsname *init_utsname(void)
108 79
109extern struct rw_semaphore uts_sem; 80extern struct rw_semaphore uts_sem;
110 81
111#endif /* __KERNEL__ */
112
113#endif /* _LINUX_UTSNAME_H */ 82#endif /* _LINUX_UTSNAME_H */
diff --git a/include/linux/uuid.h b/include/linux/uuid.h
index f86c37bfd4a..6df2509033d 100644
--- a/include/linux/uuid.h
+++ b/include/linux/uuid.h
@@ -17,44 +17,11 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20
21#ifndef _LINUX_UUID_H_ 20#ifndef _LINUX_UUID_H_
22#define _LINUX_UUID_H_ 21#define _LINUX_UUID_H_
23 22
24#include <linux/types.h> 23#include <uapi/linux/uuid.h>
25#include <linux/string.h>
26
27typedef struct {
28 __u8 b[16];
29} uuid_le;
30
31typedef struct {
32 __u8 b[16];
33} uuid_be;
34
35#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
36((uuid_le) \
37{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
38 (b) & 0xff, ((b) >> 8) & 0xff, \
39 (c) & 0xff, ((c) >> 8) & 0xff, \
40 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
41 24
42#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
43((uuid_be) \
44{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
45 ((b) >> 8) & 0xff, (b) & 0xff, \
46 ((c) >> 8) & 0xff, (c) & 0xff, \
47 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
48
49#define NULL_UUID_LE \
50 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
51 0x00, 0x00, 0x00, 0x00)
52
53#define NULL_UUID_BE \
54 UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
55 0x00, 0x00, 0x00, 0x00)
56
57#ifdef __KERNEL__
58 25
59static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2) 26static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
60{ 27{
@@ -69,6 +36,4 @@ static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
69extern void uuid_le_gen(uuid_le *u); 36extern void uuid_le_gen(uuid_le *u);
70extern void uuid_be_gen(uuid_be *u); 37extern void uuid_be_gen(uuid_be *u);
71 38
72#endif /* __KERNEL__ */
73
74#endif 39#endif
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 0a4f180a11d..ab9e86224c5 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -11,15 +11,10 @@
11#ifndef VFIO_H 11#ifndef VFIO_H
12#define VFIO_H 12#define VFIO_H
13 13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17#define VFIO_API_VERSION 0
18
19#ifdef __KERNEL__ /* Internal VFIO-core/bus driver API */
20 14
21#include <linux/iommu.h> 15#include <linux/iommu.h>
22#include <linux/mm.h> 16#include <linux/mm.h>
17#include <uapi/linux/vfio.h>
23 18
24/** 19/**
25 * struct vfio_device_ops - VFIO bus driver device callbacks 20 * struct vfio_device_ops - VFIO bus driver device callbacks
@@ -92,354 +87,4 @@ extern void vfio_unregister_iommu_driver(
92 TYPE tmp; \ 87 TYPE tmp; \
93 offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); }) \ 88 offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); }) \
94 89
95#endif /* __KERNEL__ */
96
97/* Kernel & User level defines for VFIO IOCTLs. */
98
99/* Extensions */
100
101#define VFIO_TYPE1_IOMMU 1
102
103/*
104 * The IOCTL interface is designed for extensibility by embedding the
105 * structure length (argsz) and flags into structures passed between
106 * kernel and userspace. We therefore use the _IO() macro for these
107 * defines to avoid implicitly embedding a size into the ioctl request.
108 * As structure fields are added, argsz will increase to match and flag
109 * bits will be defined to indicate additional fields with valid data.
110 * It's *always* the caller's responsibility to indicate the size of
111 * the structure passed by setting argsz appropriately.
112 */
113
114#define VFIO_TYPE (';')
115#define VFIO_BASE 100
116
117/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
118
119/**
120 * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
121 *
122 * Report the version of the VFIO API. This allows us to bump the entire
123 * API version should we later need to add or change features in incompatible
124 * ways.
125 * Return: VFIO_API_VERSION
126 * Availability: Always
127 */
128#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
129
130/**
131 * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
132 *
133 * Check whether an extension is supported.
134 * Return: 0 if not supported, 1 (or some other positive integer) if supported.
135 * Availability: Always
136 */
137#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
138
139/**
140 * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
141 *
142 * Set the iommu to the given type. The type must be supported by an
143 * iommu driver as verified by calling CHECK_EXTENSION using the same
144 * type. A group must be set to this file descriptor before this
145 * ioctl is available. The IOMMU interfaces enabled by this call are
146 * specific to the value set.
147 * Return: 0 on success, -errno on failure
148 * Availability: When VFIO group attached
149 */
150#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
151
152/* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */
153
154/**
155 * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3,
156 * struct vfio_group_status)
157 *
158 * Retrieve information about the group. Fills in provided
159 * struct vfio_group_info. Caller sets argsz.
160 * Return: 0 on succes, -errno on failure.
161 * Availability: Always
162 */
163struct vfio_group_status {
164 __u32 argsz;
165 __u32 flags;
166#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
167#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
168};
169#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
170
171/**
172 * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
173 *
174 * Set the container for the VFIO group to the open VFIO file
175 * descriptor provided. Groups may only belong to a single
176 * container. Containers may, at their discretion, support multiple
177 * groups. Only when a container is set are all of the interfaces
178 * of the VFIO file descriptor and the VFIO group file descriptor
179 * available to the user.
180 * Return: 0 on success, -errno on failure.
181 * Availability: Always
182 */
183#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
184
185/**
186 * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
187 *
188 * Remove the group from the attached container. This is the
189 * opposite of the SET_CONTAINER call and returns the group to
190 * an initial state. All device file descriptors must be released
191 * prior to calling this interface. When removing the last group
192 * from a container, the IOMMU will be disabled and all state lost,
193 * effectively also returning the VFIO file descriptor to an initial
194 * state.
195 * Return: 0 on success, -errno on failure.
196 * Availability: When attached to container
197 */
198#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
199
200/**
201 * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
202 *
203 * Return a new file descriptor for the device object described by
204 * the provided string. The string should match a device listed in
205 * the devices subdirectory of the IOMMU group sysfs entry. The
206 * group containing the device must already be added to this context.
207 * Return: new file descriptor on success, -errno on failure.
208 * Availability: When attached to container
209 */
210#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
211
212/* --------------- IOCTLs for DEVICE file descriptors --------------- */
213
214/**
215 * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7,
216 * struct vfio_device_info)
217 *
218 * Retrieve information about the device. Fills in provided
219 * struct vfio_device_info. Caller sets argsz.
220 * Return: 0 on success, -errno on failure.
221 */
222struct vfio_device_info {
223 __u32 argsz;
224 __u32 flags;
225#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */
226#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */
227 __u32 num_regions; /* Max region index + 1 */
228 __u32 num_irqs; /* Max IRQ index + 1 */
229};
230#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
231
232/**
233 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
234 * struct vfio_region_info)
235 *
236 * Retrieve information about a device region. Caller provides
237 * struct vfio_region_info with index value set. Caller sets argsz.
238 * Implementation of region mapping is bus driver specific. This is
239 * intended to describe MMIO, I/O port, as well as bus specific
240 * regions (ex. PCI config space). Zero sized regions may be used
241 * to describe unimplemented regions (ex. unimplemented PCI BARs).
242 * Return: 0 on success, -errno on failure.
243 */
244struct vfio_region_info {
245 __u32 argsz;
246 __u32 flags;
247#define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */
248#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */
249#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */
250 __u32 index; /* Region index */
251 __u32 resv; /* Reserved for alignment */
252 __u64 size; /* Region size (bytes) */
253 __u64 offset; /* Region offset from start of device fd */
254};
255#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
256
257/**
258 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
259 * struct vfio_irq_info)
260 *
261 * Retrieve information about a device IRQ. Caller provides
262 * struct vfio_irq_info with index value set. Caller sets argsz.
263 * Implementation of IRQ mapping is bus driver specific. Indexes
264 * using multiple IRQs are primarily intended to support MSI-like
265 * interrupt blocks. Zero count irq blocks may be used to describe
266 * unimplemented interrupt types.
267 *
268 * The EVENTFD flag indicates the interrupt index supports eventfd based
269 * signaling.
270 *
271 * The MASKABLE flags indicates the index supports MASK and UNMASK
272 * actions described below.
273 *
274 * AUTOMASKED indicates that after signaling, the interrupt line is
275 * automatically masked by VFIO and the user needs to unmask the line
276 * to receive new interrupts. This is primarily intended to distinguish
277 * level triggered interrupts.
278 *
279 * The NORESIZE flag indicates that the interrupt lines within the index
280 * are setup as a set and new subindexes cannot be enabled without first
281 * disabling the entire index. This is used for interrupts like PCI MSI
282 * and MSI-X where the driver may only use a subset of the available
283 * indexes, but VFIO needs to enable a specific number of vectors
284 * upfront. In the case of MSI-X, where the user can enable MSI-X and
285 * then add and unmask vectors, it's up to userspace to make the decision
286 * whether to allocate the maximum supported number of vectors or tear
287 * down setup and incrementally increase the vectors as each is enabled.
288 */
289struct vfio_irq_info {
290 __u32 argsz;
291 __u32 flags;
292#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
293#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
294#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
295#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
296 __u32 index; /* IRQ index */
297 __u32 count; /* Number of IRQs within this index */
298};
299#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
300
301/**
302 * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
303 *
304 * Set signaling, masking, and unmasking of interrupts. Caller provides
305 * struct vfio_irq_set with all fields set. 'start' and 'count' indicate
306 * the range of subindexes being specified.
307 *
308 * The DATA flags specify the type of data provided. If DATA_NONE, the
309 * operation performs the specified action immediately on the specified
310 * interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]:
311 * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
312 *
313 * DATA_BOOL allows sparse support for the same on arrays of interrupts.
314 * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]):
315 * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3,
316 * data = {1,0,1}
317 *
318 * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
319 * A value of -1 can be used to either de-assign interrupts if already
320 * assigned or skip un-assigned interrupts. For example, to set an eventfd
321 * to be trigger for interrupts [0,0] and [0,2]:
322 * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3,
323 * data = {fd1, -1, fd2}
324 * If index [0,1] is previously set, two count = 1 ioctls calls would be
325 * required to set [0,0] and [0,2] without changing [0,1].
326 *
327 * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used
328 * with ACTION_TRIGGER to perform kernel level interrupt loopback testing
329 * from userspace (ie. simulate hardware triggering).
330 *
331 * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER
332 * enables the interrupt index for the device. Individual subindex interrupts
333 * can be disabled using the -1 value for DATA_EVENTFD or the index can be
334 * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
335 *
336 * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while
337 * ACTION_TRIGGER specifies kernel->user signaling.
338 */
339struct vfio_irq_set {
340 __u32 argsz;
341 __u32 flags;
342#define VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */
343#define VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */
344#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */
345#define VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */
346#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */
347#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */
348 __u32 index;
349 __u32 start;
350 __u32 count;
351 __u8 data[];
352};
353#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
354
355#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | \
356 VFIO_IRQ_SET_DATA_BOOL | \
357 VFIO_IRQ_SET_DATA_EVENTFD)
358#define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | \
359 VFIO_IRQ_SET_ACTION_UNMASK | \
360 VFIO_IRQ_SET_ACTION_TRIGGER)
361/**
362 * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
363 *
364 * Reset a device.
365 */
366#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
367
368/*
369 * The VFIO-PCI bus driver makes use of the following fixed region and
370 * IRQ index mapping. Unimplemented regions return a size of zero.
371 * Unimplemented IRQ types return a count of zero.
372 */
373
374enum {
375 VFIO_PCI_BAR0_REGION_INDEX,
376 VFIO_PCI_BAR1_REGION_INDEX,
377 VFIO_PCI_BAR2_REGION_INDEX,
378 VFIO_PCI_BAR3_REGION_INDEX,
379 VFIO_PCI_BAR4_REGION_INDEX,
380 VFIO_PCI_BAR5_REGION_INDEX,
381 VFIO_PCI_ROM_REGION_INDEX,
382 VFIO_PCI_CONFIG_REGION_INDEX,
383 VFIO_PCI_NUM_REGIONS
384};
385
386enum {
387 VFIO_PCI_INTX_IRQ_INDEX,
388 VFIO_PCI_MSI_IRQ_INDEX,
389 VFIO_PCI_MSIX_IRQ_INDEX,
390 VFIO_PCI_NUM_IRQS
391};
392
393/* -------- API for Type1 VFIO IOMMU -------- */
394
395/**
396 * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info)
397 *
398 * Retrieve information about the IOMMU object. Fills in provided
399 * struct vfio_iommu_info. Caller sets argsz.
400 *
401 * XXX Should we do these by CHECK_EXTENSION too?
402 */
403struct vfio_iommu_type1_info {
404 __u32 argsz;
405 __u32 flags;
406#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
407 __u64 iova_pgsizes; /* Bitmap of supported page sizes */
408};
409
410#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
411
412/**
413 * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map)
414 *
415 * Map process virtual addresses to IO virtual addresses using the
416 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
417 */
418struct vfio_iommu_type1_dma_map {
419 __u32 argsz;
420 __u32 flags;
421#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
422#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
423 __u64 vaddr; /* Process virtual address */
424 __u64 iova; /* IO virtual address */
425 __u64 size; /* Size of mapping (bytes) */
426};
427
428#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
429
430/**
431 * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap)
432 *
433 * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
434 * Caller sets argsz.
435 */
436struct vfio_iommu_type1_dma_unmap {
437 __u32 argsz;
438 __u32 flags;
439 __u64 iova; /* IO virtual address */
440 __u64 size; /* Size of mapping (bytes) */
441};
442
443#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
444
445#endif /* VFIO_H */ 90#endif /* VFIO_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 873adbe8298..73ea2fb0473 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -56,1945 +56,7 @@
56#ifndef __LINUX_VIDEODEV2_H 56#ifndef __LINUX_VIDEODEV2_H
57#define __LINUX_VIDEODEV2_H 57#define __LINUX_VIDEODEV2_H
58 58
59#ifdef __KERNEL__
60#include <linux/time.h> /* need struct timeval */ 59#include <linux/time.h> /* need struct timeval */
61#else 60#include <uapi/linux/videodev2.h>
62#include <sys/time.h>
63#endif
64#include <linux/compiler.h>
65#include <linux/ioctl.h>
66#include <linux/types.h>
67#include <linux/v4l2-common.h>
68#include <linux/v4l2-controls.h>
69
70/*
71 * Common stuff for both V4L1 and V4L2
72 * Moved from videodev.h
73 */
74#define VIDEO_MAX_FRAME 32
75#define VIDEO_MAX_PLANES 8
76
77#ifndef __KERNEL__
78
79/* These defines are V4L1 specific and should not be used with the V4L2 API!
80 They will be removed from this header in the future. */
81
82#define VID_TYPE_CAPTURE 1 /* Can capture */
83#define VID_TYPE_TUNER 2 /* Can tune */
84#define VID_TYPE_TELETEXT 4 /* Does teletext */
85#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
86#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
87#define VID_TYPE_CLIPPING 32 /* Can clip */
88#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
89#define VID_TYPE_SCALES 128 /* Scalable */
90#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
91#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
92#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
93#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
94#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
95#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
96#endif
97
98/*
99 * M I S C E L L A N E O U S
100 */
101
102/* Four-character-code (FOURCC) */
103#define v4l2_fourcc(a, b, c, d)\
104 ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
105
106/*
107 * E N U M S
108 */
109enum v4l2_field {
110 V4L2_FIELD_ANY = 0, /* driver can choose from none,
111 top, bottom, interlaced
112 depending on whatever it thinks
113 is approximate ... */
114 V4L2_FIELD_NONE = 1, /* this device has no fields ... */
115 V4L2_FIELD_TOP = 2, /* top field only */
116 V4L2_FIELD_BOTTOM = 3, /* bottom field only */
117 V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
118 V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
119 buffer, top-bottom order */
120 V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
121 V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
122 separate buffers */
123 V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
124 first and the top field is
125 transmitted first */
126 V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
127 first and the bottom field is
128 transmitted first */
129};
130#define V4L2_FIELD_HAS_TOP(field) \
131 ((field) == V4L2_FIELD_TOP ||\
132 (field) == V4L2_FIELD_INTERLACED ||\
133 (field) == V4L2_FIELD_INTERLACED_TB ||\
134 (field) == V4L2_FIELD_INTERLACED_BT ||\
135 (field) == V4L2_FIELD_SEQ_TB ||\
136 (field) == V4L2_FIELD_SEQ_BT)
137#define V4L2_FIELD_HAS_BOTTOM(field) \
138 ((field) == V4L2_FIELD_BOTTOM ||\
139 (field) == V4L2_FIELD_INTERLACED ||\
140 (field) == V4L2_FIELD_INTERLACED_TB ||\
141 (field) == V4L2_FIELD_INTERLACED_BT ||\
142 (field) == V4L2_FIELD_SEQ_TB ||\
143 (field) == V4L2_FIELD_SEQ_BT)
144#define V4L2_FIELD_HAS_BOTH(field) \
145 ((field) == V4L2_FIELD_INTERLACED ||\
146 (field) == V4L2_FIELD_INTERLACED_TB ||\
147 (field) == V4L2_FIELD_INTERLACED_BT ||\
148 (field) == V4L2_FIELD_SEQ_TB ||\
149 (field) == V4L2_FIELD_SEQ_BT)
150
151enum v4l2_buf_type {
152 V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
153 V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
154 V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
155 V4L2_BUF_TYPE_VBI_CAPTURE = 4,
156 V4L2_BUF_TYPE_VBI_OUTPUT = 5,
157 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
158 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
159#if 1
160 /* Experimental */
161 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
162#endif
163 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
164 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
165 /* Deprecated, do not use */
166 V4L2_BUF_TYPE_PRIVATE = 0x80,
167};
168
169#define V4L2_TYPE_IS_MULTIPLANAR(type) \
170 ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
171 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
172
173#define V4L2_TYPE_IS_OUTPUT(type) \
174 ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
175 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
176 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
177 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
178 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
179 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
180
181enum v4l2_tuner_type {
182 V4L2_TUNER_RADIO = 1,
183 V4L2_TUNER_ANALOG_TV = 2,
184 V4L2_TUNER_DIGITAL_TV = 3,
185};
186
187enum v4l2_memory {
188 V4L2_MEMORY_MMAP = 1,
189 V4L2_MEMORY_USERPTR = 2,
190 V4L2_MEMORY_OVERLAY = 3,
191};
192
193/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
194enum v4l2_colorspace {
195 /* ITU-R 601 -- broadcast NTSC/PAL */
196 V4L2_COLORSPACE_SMPTE170M = 1,
197
198 /* 1125-Line (US) HDTV */
199 V4L2_COLORSPACE_SMPTE240M = 2,
200
201 /* HD and modern captures. */
202 V4L2_COLORSPACE_REC709 = 3,
203
204 /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
205 V4L2_COLORSPACE_BT878 = 4,
206
207 /* These should be useful. Assume 601 extents. */
208 V4L2_COLORSPACE_470_SYSTEM_M = 5,
209 V4L2_COLORSPACE_470_SYSTEM_BG = 6,
210
211 /* I know there will be cameras that send this. So, this is
212 * unspecified chromaticities and full 0-255 on each of the
213 * Y'CbCr components
214 */
215 V4L2_COLORSPACE_JPEG = 7,
216
217 /* For RGB colourspaces, this is probably a good start. */
218 V4L2_COLORSPACE_SRGB = 8,
219};
220
221enum v4l2_priority {
222 V4L2_PRIORITY_UNSET = 0, /* not initialized */
223 V4L2_PRIORITY_BACKGROUND = 1,
224 V4L2_PRIORITY_INTERACTIVE = 2,
225 V4L2_PRIORITY_RECORD = 3,
226 V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
227};
228
229struct v4l2_rect {
230 __s32 left;
231 __s32 top;
232 __s32 width;
233 __s32 height;
234};
235
236struct v4l2_fract {
237 __u32 numerator;
238 __u32 denominator;
239};
240
241/**
242 * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
243 *
244 * @driver: name of the driver module (e.g. "bttv")
245 * @card: name of the card (e.g. "Hauppauge WinTV")
246 * @bus_info: name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
247 * @version: KERNEL_VERSION
248 * @capabilities: capabilities of the physical device as a whole
249 * @device_caps: capabilities accessed via this particular device (node)
250 * @reserved: reserved fields for future extensions
251 */
252struct v4l2_capability {
253 __u8 driver[16];
254 __u8 card[32];
255 __u8 bus_info[32];
256 __u32 version;
257 __u32 capabilities;
258 __u32 device_caps;
259 __u32 reserved[3];
260};
261
262/* Values for 'capabilities' field */
263#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
264#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
265#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
266#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
267#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
268#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
269#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
270#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
271#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
272#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
273#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
274
275/* Is a video capture device that supports multiplanar formats */
276#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
277/* Is a video output device that supports multiplanar formats */
278#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
279/* Is a video mem-to-mem device that supports multiplanar formats */
280#define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
281/* Is a video mem-to-mem device */
282#define V4L2_CAP_VIDEO_M2M 0x00008000
283
284#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
285#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
286#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
287#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */
288
289#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
290#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
291#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
292
293#define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
294
295/*
296 * V I D E O I M A G E F O R M A T
297 */
298struct v4l2_pix_format {
299 __u32 width;
300 __u32 height;
301 __u32 pixelformat;
302 __u32 field; /* enum v4l2_field */
303 __u32 bytesperline; /* for padding, zero if unused */
304 __u32 sizeimage;
305 __u32 colorspace; /* enum v4l2_colorspace */
306 __u32 priv; /* private data, depends on pixelformat */
307};
308
309/* Pixel format FOURCC depth Description */
310
311/* RGB formats */
312#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
313#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
314#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
315#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
316#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
317#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
318#define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
319#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
320#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
321#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
322#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
323
324/* Grey formats */
325#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
326#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
327#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
328#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
329#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
330#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
331
332/* Grey bit-packed formats */
333#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
334
335/* Palette formats */
336#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
337
338/* Luminance+Chrominance formats */
339#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
340#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
341#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
342#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
343#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
344#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
345#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
346#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
347#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
348#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
349#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
350#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
351#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
352#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
353#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
354#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
355#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
356#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
357#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
358
359/* two planes -- one Y, one Cr + Cb interleaved */
360#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
361#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
362#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
363#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
364#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
365#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
366
367/* two non contiguous planes - one Y, one Cr + Cb interleaved */
368#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
369#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
370#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
371#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
372
373/* three non contiguous planes - Y, Cb, Cr */
374#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
375#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */
376
377/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
378#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
379#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
380#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
381#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
382#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
383#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
384#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
385#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
386#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
387#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
388#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
389#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
390 /* 10bit raw bayer DPCM compressed to 8 bits */
391#define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
392#define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
393#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
394#define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
395 /*
396 * 10bit raw bayer, expanded to 16 bits
397 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
398 */
399#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
400
401/* compressed formats */
402#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
403#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
404#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
405#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
406#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
407#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
408#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
409#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
410#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
411#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
412#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
413#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
414#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
415#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
416#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
417
418/* Vendor-specific formats */
419#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
420#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
421#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
422#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
423#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
424#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
425#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
426#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
427#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
428#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
429#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
430#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
431#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
432#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
433#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
434#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
435#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
436#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
437#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
438#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
439#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
440#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
441#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
442#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
443#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
444#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
445
446/*
447 * F O R M A T E N U M E R A T I O N
448 */
449struct v4l2_fmtdesc {
450 __u32 index; /* Format number */
451 __u32 type; /* enum v4l2_buf_type */
452 __u32 flags;
453 __u8 description[32]; /* Description string */
454 __u32 pixelformat; /* Format fourcc */
455 __u32 reserved[4];
456};
457
458#define V4L2_FMT_FLAG_COMPRESSED 0x0001
459#define V4L2_FMT_FLAG_EMULATED 0x0002
460
461#if 1
462 /* Experimental Frame Size and frame rate enumeration */
463/*
464 * F R A M E S I Z E E N U M E R A T I O N
465 */
466enum v4l2_frmsizetypes {
467 V4L2_FRMSIZE_TYPE_DISCRETE = 1,
468 V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
469 V4L2_FRMSIZE_TYPE_STEPWISE = 3,
470};
471
472struct v4l2_frmsize_discrete {
473 __u32 width; /* Frame width [pixel] */
474 __u32 height; /* Frame height [pixel] */
475};
476
477struct v4l2_frmsize_stepwise {
478 __u32 min_width; /* Minimum frame width [pixel] */
479 __u32 max_width; /* Maximum frame width [pixel] */
480 __u32 step_width; /* Frame width step size [pixel] */
481 __u32 min_height; /* Minimum frame height [pixel] */
482 __u32 max_height; /* Maximum frame height [pixel] */
483 __u32 step_height; /* Frame height step size [pixel] */
484};
485
486struct v4l2_frmsizeenum {
487 __u32 index; /* Frame size number */
488 __u32 pixel_format; /* Pixel format */
489 __u32 type; /* Frame size type the device supports. */
490
491 union { /* Frame size */
492 struct v4l2_frmsize_discrete discrete;
493 struct v4l2_frmsize_stepwise stepwise;
494 };
495
496 __u32 reserved[2]; /* Reserved space for future use */
497};
498
499/*
500 * F R A M E R A T E E N U M E R A T I O N
501 */
502enum v4l2_frmivaltypes {
503 V4L2_FRMIVAL_TYPE_DISCRETE = 1,
504 V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
505 V4L2_FRMIVAL_TYPE_STEPWISE = 3,
506};
507
508struct v4l2_frmival_stepwise {
509 struct v4l2_fract min; /* Minimum frame interval [s] */
510 struct v4l2_fract max; /* Maximum frame interval [s] */
511 struct v4l2_fract step; /* Frame interval step size [s] */
512};
513
514struct v4l2_frmivalenum {
515 __u32 index; /* Frame format index */
516 __u32 pixel_format; /* Pixel format */
517 __u32 width; /* Frame width */
518 __u32 height; /* Frame height */
519 __u32 type; /* Frame interval type the device supports. */
520
521 union { /* Frame interval */
522 struct v4l2_fract discrete;
523 struct v4l2_frmival_stepwise stepwise;
524 };
525
526 __u32 reserved[2]; /* Reserved space for future use */
527};
528#endif
529
530/*
531 * T I M E C O D E
532 */
533struct v4l2_timecode {
534 __u32 type;
535 __u32 flags;
536 __u8 frames;
537 __u8 seconds;
538 __u8 minutes;
539 __u8 hours;
540 __u8 userbits[4];
541};
542
543/* Type */
544#define V4L2_TC_TYPE_24FPS 1
545#define V4L2_TC_TYPE_25FPS 2
546#define V4L2_TC_TYPE_30FPS 3
547#define V4L2_TC_TYPE_50FPS 4
548#define V4L2_TC_TYPE_60FPS 5
549
550/* Flags */
551#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
552#define V4L2_TC_FLAG_COLORFRAME 0x0002
553#define V4L2_TC_USERBITS_field 0x000C
554#define V4L2_TC_USERBITS_USERDEFINED 0x0000
555#define V4L2_TC_USERBITS_8BITCHARS 0x0008
556/* The above is based on SMPTE timecodes */
557
558struct v4l2_jpegcompression {
559 int quality;
560
561 int APPn; /* Number of APP segment to be written,
562 * must be 0..15 */
563 int APP_len; /* Length of data in JPEG APPn segment */
564 char APP_data[60]; /* Data in the JPEG APPn segment. */
565
566 int COM_len; /* Length of data in JPEG COM segment */
567 char COM_data[60]; /* Data in JPEG COM segment */
568
569 __u32 jpeg_markers; /* Which markers should go into the JPEG
570 * output. Unless you exactly know what
571 * you do, leave them untouched.
572 * Inluding less markers will make the
573 * resulting code smaller, but there will
574 * be fewer applications which can read it.
575 * The presence of the APP and COM marker
576 * is influenced by APP_len and COM_len
577 * ONLY, not by this property! */
578
579#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
580#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
581#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
582#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
583#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
584 * allways use APP0 */
585};
586
587/*
588 * M E M O R Y - M A P P I N G B U F F E R S
589 */
590struct v4l2_requestbuffers {
591 __u32 count;
592 __u32 type; /* enum v4l2_buf_type */
593 __u32 memory; /* enum v4l2_memory */
594 __u32 reserved[2];
595};
596
597/**
598 * struct v4l2_plane - plane info for multi-planar buffers
599 * @bytesused: number of bytes occupied by data in the plane (payload)
600 * @length: size of this plane (NOT the payload) in bytes
601 * @mem_offset: when memory in the associated struct v4l2_buffer is
602 * V4L2_MEMORY_MMAP, equals the offset from the start of
603 * the device memory for this plane (or is a "cookie" that
604 * should be passed to mmap() called on the video node)
605 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
606 * pointing to this plane
607 * @data_offset: offset in the plane to the start of data; usually 0,
608 * unless there is a header in front of the data
609 *
610 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
611 * with two planes can have one plane for Y, and another for interleaved CbCr
612 * components. Each plane can reside in a separate memory buffer, or even in
613 * a completely separate memory node (e.g. in embedded devices).
614 */
615struct v4l2_plane {
616 __u32 bytesused;
617 __u32 length;
618 union {
619 __u32 mem_offset;
620 unsigned long userptr;
621 } m;
622 __u32 data_offset;
623 __u32 reserved[11];
624};
625
626/**
627 * struct v4l2_buffer - video buffer info
628 * @index: id number of the buffer
629 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
630 * multiplanar buffers);
631 * @bytesused: number of bytes occupied by data in the buffer (payload);
632 * unused (set to 0) for multiplanar buffers
633 * @flags: buffer informational flags
634 * @field: enum v4l2_field; field order of the image in the buffer
635 * @timestamp: frame timestamp
636 * @timecode: frame timecode
637 * @sequence: sequence count of this frame
638 * @memory: enum v4l2_memory; the method, in which the actual video data is
639 * passed
640 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
641 * offset from the start of the device memory for this plane,
642 * (or a "cookie" that should be passed to mmap() as offset)
643 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
644 * a userspace pointer pointing to this buffer
645 * @planes: for multiplanar buffers; userspace pointer to the array of plane
646 * info structs for this buffer
647 * @length: size in bytes of the buffer (NOT its payload) for single-plane
648 * buffers (when type != *_MPLANE); number of elements in the
649 * planes array for multi-plane buffers
650 * @input: input number from which the video data has has been captured
651 *
652 * Contains data exchanged by application and driver using one of the Streaming
653 * I/O methods.
654 */
655struct v4l2_buffer {
656 __u32 index;
657 __u32 type;
658 __u32 bytesused;
659 __u32 flags;
660 __u32 field;
661 struct timeval timestamp;
662 struct v4l2_timecode timecode;
663 __u32 sequence;
664
665 /* memory location */
666 __u32 memory;
667 union {
668 __u32 offset;
669 unsigned long userptr;
670 struct v4l2_plane *planes;
671 } m;
672 __u32 length;
673 __u32 reserved2;
674 __u32 reserved;
675};
676
677/* Flags for 'flags' field */
678#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
679#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
680#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
681#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
682#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
683#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
684/* Buffer is ready, but the data contained within is corrupted. */
685#define V4L2_BUF_FLAG_ERROR 0x0040
686#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
687#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
688/* Cache handling flags */
689#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
690#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
691
692/*
693 * O V E R L A Y P R E V I E W
694 */
695struct v4l2_framebuffer {
696 __u32 capability;
697 __u32 flags;
698/* FIXME: in theory we should pass something like PCI device + memory
699 * region + offset instead of some physical address */
700 void *base;
701 struct v4l2_pix_format fmt;
702};
703/* Flags for the 'capability' field. Read only */
704#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
705#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
706#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
707#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
708#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
709#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
710#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
711#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
712/* Flags for the 'flags' field. */
713#define V4L2_FBUF_FLAG_PRIMARY 0x0001
714#define V4L2_FBUF_FLAG_OVERLAY 0x0002
715#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
716#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
717#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
718#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
719#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
720
721struct v4l2_clip {
722 struct v4l2_rect c;
723 struct v4l2_clip __user *next;
724};
725
726struct v4l2_window {
727 struct v4l2_rect w;
728 __u32 field; /* enum v4l2_field */
729 __u32 chromakey;
730 struct v4l2_clip __user *clips;
731 __u32 clipcount;
732 void __user *bitmap;
733 __u8 global_alpha;
734};
735
736/*
737 * C A P T U R E P A R A M E T E R S
738 */
739struct v4l2_captureparm {
740 __u32 capability; /* Supported modes */
741 __u32 capturemode; /* Current mode */
742 struct v4l2_fract timeperframe; /* Time per frame in .1us units */
743 __u32 extendedmode; /* Driver-specific extensions */
744 __u32 readbuffers; /* # of buffers for read */
745 __u32 reserved[4];
746};
747
748/* Flags for 'capability' and 'capturemode' fields */
749#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
750#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
751
752struct v4l2_outputparm {
753 __u32 capability; /* Supported modes */
754 __u32 outputmode; /* Current mode */
755 struct v4l2_fract timeperframe; /* Time per frame in seconds */
756 __u32 extendedmode; /* Driver-specific extensions */
757 __u32 writebuffers; /* # of buffers for write */
758 __u32 reserved[4];
759};
760
761/*
762 * I N P U T I M A G E C R O P P I N G
763 */
764struct v4l2_cropcap {
765 __u32 type; /* enum v4l2_buf_type */
766 struct v4l2_rect bounds;
767 struct v4l2_rect defrect;
768 struct v4l2_fract pixelaspect;
769};
770
771struct v4l2_crop {
772 __u32 type; /* enum v4l2_buf_type */
773 struct v4l2_rect c;
774};
775
776/**
777 * struct v4l2_selection - selection info
778 * @type: buffer type (do not use *_MPLANE types)
779 * @target: Selection target, used to choose one of possible rectangles;
780 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
781 * @flags: constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
782 * @r: coordinates of selection window
783 * @reserved: for future use, rounds structure size to 64 bytes, set to zero
784 *
785 * Hardware may use multiple helper windows to process a video stream.
786 * The structure is used to exchange this selection areas between
787 * an application and a driver.
788 */
789struct v4l2_selection {
790 __u32 type;
791 __u32 target;
792 __u32 flags;
793 struct v4l2_rect r;
794 __u32 reserved[9];
795};
796
797
798/*
799 * A N A L O G V I D E O S T A N D A R D
800 */
801
802typedef __u64 v4l2_std_id;
803
804/* one bit for each */
805#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
806#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
807#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
808#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
809#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
810#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
811#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
812#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
813
814#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
815#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
816#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
817#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
818
819#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */
820#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */
821#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
822#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */
823
824#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
825#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
826#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
827#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
828#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
829#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
830#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
831#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
832
833/* ATSC/HDTV */
834#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
835#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
836
837/* FIXME:
838 Although std_id is 64 bits, there is an issue on PPC32 architecture that
839 makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
840 this value to 32 bits.
841 As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
842 it should work fine. However, if needed to add more than two standards,
843 v4l2-common.c should be fixed.
844 */
845
846/*
847 * Some macros to merge video standards in order to make live easier for the
848 * drivers and V4L2 applications
849 */
850
851/*
852 * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
853 * Missing here.
854 */
855#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
856 V4L2_STD_NTSC_M_JP |\
857 V4L2_STD_NTSC_M_KR)
858/* Secam macros */
859#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
860 V4L2_STD_SECAM_K |\
861 V4L2_STD_SECAM_K1)
862/* All Secam Standards */
863#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
864 V4L2_STD_SECAM_G |\
865 V4L2_STD_SECAM_H |\
866 V4L2_STD_SECAM_DK |\
867 V4L2_STD_SECAM_L |\
868 V4L2_STD_SECAM_LC)
869/* PAL macros */
870#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
871 V4L2_STD_PAL_B1 |\
872 V4L2_STD_PAL_G)
873#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
874 V4L2_STD_PAL_D1 |\
875 V4L2_STD_PAL_K)
876/*
877 * "Common" PAL - This macro is there to be compatible with the old
878 * V4L1 concept of "PAL": /BGDKHI.
879 * Several PAL standards are mising here: /M, /N and /Nc
880 */
881#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
882 V4L2_STD_PAL_DK |\
883 V4L2_STD_PAL_H |\
884 V4L2_STD_PAL_I)
885/* Chroma "agnostic" standards */
886#define V4L2_STD_B (V4L2_STD_PAL_B |\
887 V4L2_STD_PAL_B1 |\
888 V4L2_STD_SECAM_B)
889#define V4L2_STD_G (V4L2_STD_PAL_G |\
890 V4L2_STD_SECAM_G)
891#define V4L2_STD_H (V4L2_STD_PAL_H |\
892 V4L2_STD_SECAM_H)
893#define V4L2_STD_L (V4L2_STD_SECAM_L |\
894 V4L2_STD_SECAM_LC)
895#define V4L2_STD_GH (V4L2_STD_G |\
896 V4L2_STD_H)
897#define V4L2_STD_DK (V4L2_STD_PAL_DK |\
898 V4L2_STD_SECAM_DK)
899#define V4L2_STD_BG (V4L2_STD_B |\
900 V4L2_STD_G)
901#define V4L2_STD_MN (V4L2_STD_PAL_M |\
902 V4L2_STD_PAL_N |\
903 V4L2_STD_PAL_Nc |\
904 V4L2_STD_NTSC)
905
906/* Standards where MTS/BTSC stereo could be found */
907#define V4L2_STD_MTS (V4L2_STD_NTSC_M |\
908 V4L2_STD_PAL_M |\
909 V4L2_STD_PAL_N |\
910 V4L2_STD_PAL_Nc)
911
912/* Standards for Countries with 60Hz Line frequency */
913#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
914 V4L2_STD_PAL_60 |\
915 V4L2_STD_NTSC |\
916 V4L2_STD_NTSC_443)
917/* Standards for Countries with 50Hz Line frequency */
918#define V4L2_STD_625_50 (V4L2_STD_PAL |\
919 V4L2_STD_PAL_N |\
920 V4L2_STD_PAL_Nc |\
921 V4L2_STD_SECAM)
922
923#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
924 V4L2_STD_ATSC_16_VSB)
925/* Macros with none and all analog standards */
926#define V4L2_STD_UNKNOWN 0
927#define V4L2_STD_ALL (V4L2_STD_525_60 |\
928 V4L2_STD_625_50)
929
930struct v4l2_standard {
931 __u32 index;
932 v4l2_std_id id;
933 __u8 name[24];
934 struct v4l2_fract frameperiod; /* Frames, not fields */
935 __u32 framelines;
936 __u32 reserved[4];
937};
938
939/* The DV Preset API is deprecated in favor of the DV Timings API.
940 New drivers shouldn't use this anymore! */
941
942/*
943 * V I D E O T I M I N G S D V P R E S E T
944 */
945struct v4l2_dv_preset {
946 __u32 preset;
947 __u32 reserved[4];
948};
949
950/*
951 * D V P R E S E T S E N U M E R A T I O N
952 */
953struct v4l2_dv_enum_preset {
954 __u32 index;
955 __u32 preset;
956 __u8 name[32]; /* Name of the preset timing */
957 __u32 width;
958 __u32 height;
959 __u32 reserved[4];
960};
961
962/*
963 * D V P R E S E T V A L U E S
964 */
965#define V4L2_DV_INVALID 0
966#define V4L2_DV_480P59_94 1 /* BT.1362 */
967#define V4L2_DV_576P50 2 /* BT.1362 */
968#define V4L2_DV_720P24 3 /* SMPTE 296M */
969#define V4L2_DV_720P25 4 /* SMPTE 296M */
970#define V4L2_DV_720P30 5 /* SMPTE 296M */
971#define V4L2_DV_720P50 6 /* SMPTE 296M */
972#define V4L2_DV_720P59_94 7 /* SMPTE 274M */
973#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
974#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
975#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
976#define V4L2_DV_1080I25 11 /* BT.1120 */
977#define V4L2_DV_1080I50 12 /* SMPTE 296M */
978#define V4L2_DV_1080I60 13 /* SMPTE 296M */
979#define V4L2_DV_1080P24 14 /* SMPTE 296M */
980#define V4L2_DV_1080P25 15 /* SMPTE 296M */
981#define V4L2_DV_1080P30 16 /* SMPTE 296M */
982#define V4L2_DV_1080P50 17 /* BT.1120 */
983#define V4L2_DV_1080P60 18 /* BT.1120 */
984
985/*
986 * D V B T T I M I N G S
987 */
988
989/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
990 * @width: total width of the active video in pixels
991 * @height: total height of the active video in lines
992 * @interlaced: Interlaced or progressive
993 * @polarities: Positive or negative polarities
994 * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
995 * @hfrontporch:Horizontal front porch in pixels
996 * @hsync: Horizontal Sync length in pixels
997 * @hbackporch: Horizontal back porch in pixels
998 * @vfrontporch:Vertical front porch in lines
999 * @vsync: Vertical Sync length in lines
1000 * @vbackporch: Vertical back porch in lines
1001 * @il_vfrontporch:Vertical front porch for the even field
1002 * (aka field 2) of interlaced field formats
1003 * @il_vsync: Vertical Sync length for the even field
1004 * (aka field 2) of interlaced field formats
1005 * @il_vbackporch:Vertical back porch for the even field
1006 * (aka field 2) of interlaced field formats
1007 * @standards: Standards the timing belongs to
1008 * @flags: Flags
1009 * @reserved: Reserved fields, must be zeroed.
1010 *
1011 * A note regarding vertical interlaced timings: height refers to the total
1012 * height of the active video frame (= two fields). The blanking timings refer
1013 * to the blanking of each field. So the height of the total frame is
1014 * calculated as follows:
1015 *
1016 * tot_height = height + vfrontporch + vsync + vbackporch +
1017 * il_vfrontporch + il_vsync + il_vbackporch
1018 *
1019 * The active height of each field is height / 2.
1020 */
1021struct v4l2_bt_timings {
1022 __u32 width;
1023 __u32 height;
1024 __u32 interlaced;
1025 __u32 polarities;
1026 __u64 pixelclock;
1027 __u32 hfrontporch;
1028 __u32 hsync;
1029 __u32 hbackporch;
1030 __u32 vfrontporch;
1031 __u32 vsync;
1032 __u32 vbackporch;
1033 __u32 il_vfrontporch;
1034 __u32 il_vsync;
1035 __u32 il_vbackporch;
1036 __u32 standards;
1037 __u32 flags;
1038 __u32 reserved[14];
1039} __attribute__ ((packed));
1040
1041/* Interlaced or progressive format */
1042#define V4L2_DV_PROGRESSIVE 0
1043#define V4L2_DV_INTERLACED 1
1044
1045/* Polarities. If bit is not set, it is assumed to be negative polarity */
1046#define V4L2_DV_VSYNC_POS_POL 0x00000001
1047#define V4L2_DV_HSYNC_POS_POL 0x00000002
1048
1049/* Timings standards */
1050#define V4L2_DV_BT_STD_CEA861 (1 << 0) /* CEA-861 Digital TV Profile */
1051#define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */
1052#define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */
1053#define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */
1054
1055/* Flags */
1056
1057/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
1058 GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
1059 intervals are reduced, allowing a higher resolution over the same
1060 bandwidth. This is a read-only flag. */
1061#define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
1062/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
1063 of six. These formats can be optionally played at 1 / 1.001 speed.
1064 This is a read-only flag. */
1065#define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
1066/* CEA-861 specific: only valid for video transmitters, the flag is cleared
1067 by receivers.
1068 If the framerate of the format is a multiple of six, then the pixelclock
1069 used to set up the transmitter is divided by 1.001 to make it compatible
1070 with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
1071 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
1072 such frequencies, then the flag will also be cleared. */
1073#define V4L2_DV_FL_REDUCED_FPS (1 << 2)
1074/* Specific to interlaced formats: if set, then field 1 is really one half-line
1075 longer and field 2 is really one half-line shorter, so each field has
1076 exactly the same number of half-lines. Whether half-lines can be detected
1077 or used depends on the hardware. */
1078#define V4L2_DV_FL_HALF_LINE (1 << 0)
1079
1080
1081/** struct v4l2_dv_timings - DV timings
1082 * @type: the type of the timings
1083 * @bt: BT656/1120 timings
1084 */
1085struct v4l2_dv_timings {
1086 __u32 type;
1087 union {
1088 struct v4l2_bt_timings bt;
1089 __u32 reserved[32];
1090 };
1091} __attribute__ ((packed));
1092
1093/* Values for the type field */
1094#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
1095
1096
1097/** struct v4l2_enum_dv_timings - DV timings enumeration
1098 * @index: enumeration index
1099 * @reserved: must be zeroed
1100 * @timings: the timings for the given index
1101 */
1102struct v4l2_enum_dv_timings {
1103 __u32 index;
1104 __u32 reserved[3];
1105 struct v4l2_dv_timings timings;
1106};
1107
1108/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
1109 * @min_width: width in pixels
1110 * @max_width: width in pixels
1111 * @min_height: height in lines
1112 * @max_height: height in lines
1113 * @min_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1114 * @max_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1115 * @standards: Supported standards
1116 * @capabilities: Supported capabilities
1117 * @reserved: Must be zeroed
1118 */
1119struct v4l2_bt_timings_cap {
1120 __u32 min_width;
1121 __u32 max_width;
1122 __u32 min_height;
1123 __u32 max_height;
1124 __u64 min_pixelclock;
1125 __u64 max_pixelclock;
1126 __u32 standards;
1127 __u32 capabilities;
1128 __u32 reserved[16];
1129} __attribute__ ((packed));
1130
1131/* Supports interlaced formats */
1132#define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
1133/* Supports progressive formats */
1134#define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
1135/* Supports CVT/GTF reduced blanking */
1136#define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
1137/* Supports custom formats */
1138#define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
1139
1140/** struct v4l2_dv_timings_cap - DV timings capabilities
1141 * @type: the type of the timings (same as in struct v4l2_dv_timings)
1142 * @bt: the BT656/1120 timings capabilities
1143 */
1144struct v4l2_dv_timings_cap {
1145 __u32 type;
1146 __u32 reserved[3];
1147 union {
1148 struct v4l2_bt_timings_cap bt;
1149 __u32 raw_data[32];
1150 };
1151};
1152
1153
1154/*
1155 * V I D E O I N P U T S
1156 */
1157struct v4l2_input {
1158 __u32 index; /* Which input */
1159 __u8 name[32]; /* Label */
1160 __u32 type; /* Type of input */
1161 __u32 audioset; /* Associated audios (bitfield) */
1162 __u32 tuner; /* enum v4l2_tuner_type */
1163 v4l2_std_id std;
1164 __u32 status;
1165 __u32 capabilities;
1166 __u32 reserved[3];
1167};
1168
1169/* Values for the 'type' field */
1170#define V4L2_INPUT_TYPE_TUNER 1
1171#define V4L2_INPUT_TYPE_CAMERA 2
1172
1173/* field 'status' - general */
1174#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
1175#define V4L2_IN_ST_NO_SIGNAL 0x00000002
1176#define V4L2_IN_ST_NO_COLOR 0x00000004
1177
1178/* field 'status' - sensor orientation */
1179/* If sensor is mounted upside down set both bits */
1180#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
1181#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
1182
1183/* field 'status' - analog */
1184#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
1185#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
1186
1187/* field 'status' - digital */
1188#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
1189#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
1190#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
1191
1192/* field 'status' - VCR and set-top box */
1193#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
1194#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
1195#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
1196
1197/* capabilities flags */
1198#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1199#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1200#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
1201#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
1202
1203/*
1204 * V I D E O O U T P U T S
1205 */
1206struct v4l2_output {
1207 __u32 index; /* Which output */
1208 __u8 name[32]; /* Label */
1209 __u32 type; /* Type of output */
1210 __u32 audioset; /* Associated audios (bitfield) */
1211 __u32 modulator; /* Associated modulator */
1212 v4l2_std_id std;
1213 __u32 capabilities;
1214 __u32 reserved[3];
1215};
1216/* Values for the 'type' field */
1217#define V4L2_OUTPUT_TYPE_MODULATOR 1
1218#define V4L2_OUTPUT_TYPE_ANALOG 2
1219#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
1220
1221/* capabilities flags */
1222#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1223#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1224#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
1225#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
1226
1227/*
1228 * C O N T R O L S
1229 */
1230struct v4l2_control {
1231 __u32 id;
1232 __s32 value;
1233};
1234
1235struct v4l2_ext_control {
1236 __u32 id;
1237 __u32 size;
1238 __u32 reserved2[1];
1239 union {
1240 __s32 value;
1241 __s64 value64;
1242 char *string;
1243 };
1244} __attribute__ ((packed));
1245
1246struct v4l2_ext_controls {
1247 __u32 ctrl_class;
1248 __u32 count;
1249 __u32 error_idx;
1250 __u32 reserved[2];
1251 struct v4l2_ext_control *controls;
1252};
1253
1254#define V4L2_CTRL_ID_MASK (0x0fffffff)
1255#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1256#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
1257
1258enum v4l2_ctrl_type {
1259 V4L2_CTRL_TYPE_INTEGER = 1,
1260 V4L2_CTRL_TYPE_BOOLEAN = 2,
1261 V4L2_CTRL_TYPE_MENU = 3,
1262 V4L2_CTRL_TYPE_BUTTON = 4,
1263 V4L2_CTRL_TYPE_INTEGER64 = 5,
1264 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1265 V4L2_CTRL_TYPE_STRING = 7,
1266 V4L2_CTRL_TYPE_BITMASK = 8,
1267 V4L2_CTRL_TYPE_INTEGER_MENU = 9,
1268};
1269
1270/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
1271struct v4l2_queryctrl {
1272 __u32 id;
1273 __u32 type; /* enum v4l2_ctrl_type */
1274 __u8 name[32]; /* Whatever */
1275 __s32 minimum; /* Note signedness */
1276 __s32 maximum;
1277 __s32 step;
1278 __s32 default_value;
1279 __u32 flags;
1280 __u32 reserved[2];
1281};
1282
1283/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
1284struct v4l2_querymenu {
1285 __u32 id;
1286 __u32 index;
1287 union {
1288 __u8 name[32]; /* Whatever */
1289 __s64 value;
1290 };
1291 __u32 reserved;
1292} __attribute__ ((packed));
1293
1294/* Control flags */
1295#define V4L2_CTRL_FLAG_DISABLED 0x0001
1296#define V4L2_CTRL_FLAG_GRABBED 0x0002
1297#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
1298#define V4L2_CTRL_FLAG_UPDATE 0x0008
1299#define V4L2_CTRL_FLAG_INACTIVE 0x0010
1300#define V4L2_CTRL_FLAG_SLIDER 0x0020
1301#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
1302#define V4L2_CTRL_FLAG_VOLATILE 0x0080
1303
1304/* Query flag, to be ORed with the control ID */
1305#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
1306
1307/* User-class control IDs defined by V4L2 */
1308#define V4L2_CID_MAX_CTRLS 1024
1309/* IDs reserved for driver specific controls */
1310#define V4L2_CID_PRIVATE_BASE 0x08000000
1311
1312
1313/* DV-class control IDs defined by V4L2 */
1314#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
1315#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
1316
1317#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
1318#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
1319#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
1320#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
1321enum v4l2_dv_tx_mode {
1322 V4L2_DV_TX_MODE_DVI_D = 0,
1323 V4L2_DV_TX_MODE_HDMI = 1,
1324};
1325#define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5)
1326enum v4l2_dv_rgb_range {
1327 V4L2_DV_RGB_RANGE_AUTO = 0,
1328 V4L2_DV_RGB_RANGE_LIMITED = 1,
1329 V4L2_DV_RGB_RANGE_FULL = 2,
1330};
1331
1332#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
1333#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
1334
1335/*
1336 * T U N I N G
1337 */
1338struct v4l2_tuner {
1339 __u32 index;
1340 __u8 name[32];
1341 __u32 type; /* enum v4l2_tuner_type */
1342 __u32 capability;
1343 __u32 rangelow;
1344 __u32 rangehigh;
1345 __u32 rxsubchans;
1346 __u32 audmode;
1347 __s32 signal;
1348 __s32 afc;
1349 __u32 reserved[4];
1350};
1351
1352struct v4l2_modulator {
1353 __u32 index;
1354 __u8 name[32];
1355 __u32 capability;
1356 __u32 rangelow;
1357 __u32 rangehigh;
1358 __u32 txsubchans;
1359 __u32 reserved[4];
1360};
1361
1362/* Flags for the 'capability' field */
1363#define V4L2_TUNER_CAP_LOW 0x0001
1364#define V4L2_TUNER_CAP_NORM 0x0002
1365#define V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
1366#define V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
1367#define V4L2_TUNER_CAP_STEREO 0x0010
1368#define V4L2_TUNER_CAP_LANG2 0x0020
1369#define V4L2_TUNER_CAP_SAP 0x0020
1370#define V4L2_TUNER_CAP_LANG1 0x0040
1371#define V4L2_TUNER_CAP_RDS 0x0080
1372#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1373#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1374#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
1375#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
1376
1377/* Flags for the 'rxsubchans' field */
1378#define V4L2_TUNER_SUB_MONO 0x0001
1379#define V4L2_TUNER_SUB_STEREO 0x0002
1380#define V4L2_TUNER_SUB_LANG2 0x0004
1381#define V4L2_TUNER_SUB_SAP 0x0004
1382#define V4L2_TUNER_SUB_LANG1 0x0008
1383#define V4L2_TUNER_SUB_RDS 0x0010
1384
1385/* Values for the 'audmode' field */
1386#define V4L2_TUNER_MODE_MONO 0x0000
1387#define V4L2_TUNER_MODE_STEREO 0x0001
1388#define V4L2_TUNER_MODE_LANG2 0x0002
1389#define V4L2_TUNER_MODE_SAP 0x0002
1390#define V4L2_TUNER_MODE_LANG1 0x0003
1391#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
1392
1393struct v4l2_frequency {
1394 __u32 tuner;
1395 __u32 type; /* enum v4l2_tuner_type */
1396 __u32 frequency;
1397 __u32 reserved[8];
1398};
1399
1400#define V4L2_BAND_MODULATION_VSB (1 << 1)
1401#define V4L2_BAND_MODULATION_FM (1 << 2)
1402#define V4L2_BAND_MODULATION_AM (1 << 3)
1403
1404struct v4l2_frequency_band {
1405 __u32 tuner;
1406 __u32 type; /* enum v4l2_tuner_type */
1407 __u32 index;
1408 __u32 capability;
1409 __u32 rangelow;
1410 __u32 rangehigh;
1411 __u32 modulation;
1412 __u32 reserved[9];
1413};
1414
1415struct v4l2_hw_freq_seek {
1416 __u32 tuner;
1417 __u32 type; /* enum v4l2_tuner_type */
1418 __u32 seek_upward;
1419 __u32 wrap_around;
1420 __u32 spacing;
1421 __u32 rangelow;
1422 __u32 rangehigh;
1423 __u32 reserved[5];
1424};
1425
1426/*
1427 * R D S
1428 */
1429
1430struct v4l2_rds_data {
1431 __u8 lsb;
1432 __u8 msb;
1433 __u8 block;
1434} __attribute__ ((packed));
1435
1436#define V4L2_RDS_BLOCK_MSK 0x7
1437#define V4L2_RDS_BLOCK_A 0
1438#define V4L2_RDS_BLOCK_B 1
1439#define V4L2_RDS_BLOCK_C 2
1440#define V4L2_RDS_BLOCK_D 3
1441#define V4L2_RDS_BLOCK_C_ALT 4
1442#define V4L2_RDS_BLOCK_INVALID 7
1443
1444#define V4L2_RDS_BLOCK_CORRECTED 0x40
1445#define V4L2_RDS_BLOCK_ERROR 0x80
1446
1447/*
1448 * A U D I O
1449 */
1450struct v4l2_audio {
1451 __u32 index;
1452 __u8 name[32];
1453 __u32 capability;
1454 __u32 mode;
1455 __u32 reserved[2];
1456};
1457
1458/* Flags for the 'capability' field */
1459#define V4L2_AUDCAP_STEREO 0x00001
1460#define V4L2_AUDCAP_AVL 0x00002
1461
1462/* Flags for the 'mode' field */
1463#define V4L2_AUDMODE_AVL 0x00001
1464
1465struct v4l2_audioout {
1466 __u32 index;
1467 __u8 name[32];
1468 __u32 capability;
1469 __u32 mode;
1470 __u32 reserved[2];
1471};
1472
1473/*
1474 * M P E G S E R V I C E S
1475 *
1476 * NOTE: EXPERIMENTAL API
1477 */
1478#if 1
1479#define V4L2_ENC_IDX_FRAME_I (0)
1480#define V4L2_ENC_IDX_FRAME_P (1)
1481#define V4L2_ENC_IDX_FRAME_B (2)
1482#define V4L2_ENC_IDX_FRAME_MASK (0xf)
1483
1484struct v4l2_enc_idx_entry {
1485 __u64 offset;
1486 __u64 pts;
1487 __u32 length;
1488 __u32 flags;
1489 __u32 reserved[2];
1490};
1491
1492#define V4L2_ENC_IDX_ENTRIES (64)
1493struct v4l2_enc_idx {
1494 __u32 entries;
1495 __u32 entries_cap;
1496 __u32 reserved[4];
1497 struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
1498};
1499
1500
1501#define V4L2_ENC_CMD_START (0)
1502#define V4L2_ENC_CMD_STOP (1)
1503#define V4L2_ENC_CMD_PAUSE (2)
1504#define V4L2_ENC_CMD_RESUME (3)
1505
1506/* Flags for V4L2_ENC_CMD_STOP */
1507#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
1508
1509struct v4l2_encoder_cmd {
1510 __u32 cmd;
1511 __u32 flags;
1512 union {
1513 struct {
1514 __u32 data[8];
1515 } raw;
1516 };
1517};
1518
1519/* Decoder commands */
1520#define V4L2_DEC_CMD_START (0)
1521#define V4L2_DEC_CMD_STOP (1)
1522#define V4L2_DEC_CMD_PAUSE (2)
1523#define V4L2_DEC_CMD_RESUME (3)
1524
1525/* Flags for V4L2_DEC_CMD_START */
1526#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
1527
1528/* Flags for V4L2_DEC_CMD_PAUSE */
1529#define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)
1530
1531/* Flags for V4L2_DEC_CMD_STOP */
1532#define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
1533#define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)
1534
1535/* Play format requirements (returned by the driver): */
1536
1537/* The decoder has no special format requirements */
1538#define V4L2_DEC_START_FMT_NONE (0)
1539/* The decoder requires full GOPs */
1540#define V4L2_DEC_START_FMT_GOP (1)
1541
1542/* The structure must be zeroed before use by the application
1543 This ensures it can be extended safely in the future. */
1544struct v4l2_decoder_cmd {
1545 __u32 cmd;
1546 __u32 flags;
1547 union {
1548 struct {
1549 __u64 pts;
1550 } stop;
1551
1552 struct {
1553 /* 0 or 1000 specifies normal speed,
1554 1 specifies forward single stepping,
1555 -1 specifies backward single stepping,
1556 >1: playback at speed/1000 of the normal speed,
1557 <-1: reverse playback at (-speed/1000) of the normal speed. */
1558 __s32 speed;
1559 __u32 format;
1560 } start;
1561
1562 struct {
1563 __u32 data[16];
1564 } raw;
1565 };
1566};
1567#endif
1568
1569
1570/*
1571 * D A T A S E R V I C E S ( V B I )
1572 *
1573 * Data services API by Michael Schimek
1574 */
1575
1576/* Raw VBI */
1577struct v4l2_vbi_format {
1578 __u32 sampling_rate; /* in 1 Hz */
1579 __u32 offset;
1580 __u32 samples_per_line;
1581 __u32 sample_format; /* V4L2_PIX_FMT_* */
1582 __s32 start[2];
1583 __u32 count[2];
1584 __u32 flags; /* V4L2_VBI_* */
1585 __u32 reserved[2]; /* must be zero */
1586};
1587
1588/* VBI flags */
1589#define V4L2_VBI_UNSYNC (1 << 0)
1590#define V4L2_VBI_INTERLACED (1 << 1)
1591
1592/* Sliced VBI
1593 *
1594 * This implements is a proposal V4L2 API to allow SLICED VBI
1595 * required for some hardware encoders. It should change without
1596 * notice in the definitive implementation.
1597 */
1598
1599struct v4l2_sliced_vbi_format {
1600 __u16 service_set;
1601 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1602 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1603 (equals frame lines 313-336 for 625 line video
1604 standards, 263-286 for 525 line standards) */
1605 __u16 service_lines[2][24];
1606 __u32 io_size;
1607 __u32 reserved[2]; /* must be zero */
1608};
1609
1610/* Teletext World System Teletext
1611 (WST), defined on ITU-R BT.653-2 */
1612#define V4L2_SLICED_TELETEXT_B (0x0001)
1613/* Video Program System, defined on ETS 300 231*/
1614#define V4L2_SLICED_VPS (0x0400)
1615/* Closed Caption, defined on EIA-608 */
1616#define V4L2_SLICED_CAPTION_525 (0x1000)
1617/* Wide Screen System, defined on ITU-R BT1119.1 */
1618#define V4L2_SLICED_WSS_625 (0x4000)
1619
1620#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
1621#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
1622
1623struct v4l2_sliced_vbi_cap {
1624 __u16 service_set;
1625 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1626 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1627 (equals frame lines 313-336 for 625 line video
1628 standards, 263-286 for 525 line standards) */
1629 __u16 service_lines[2][24];
1630 __u32 type; /* enum v4l2_buf_type */
1631 __u32 reserved[3]; /* must be 0 */
1632};
1633
1634struct v4l2_sliced_vbi_data {
1635 __u32 id;
1636 __u32 field; /* 0: first field, 1: second field */
1637 __u32 line; /* 1-23 */
1638 __u32 reserved; /* must be 0 */
1639 __u8 data[48];
1640};
1641
1642/*
1643 * Sliced VBI data inserted into MPEG Streams
1644 */
1645
1646/*
1647 * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
1648 *
1649 * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
1650 * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
1651 * data
1652 *
1653 * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
1654 * definitions are not included here. See the MPEG-2 specifications for details
1655 * on these headers.
1656 */
1657
1658/* Line type IDs */
1659#define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
1660#define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
1661#define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
1662#define V4L2_MPEG_VBI_IVTV_VPS (7)
1663
1664struct v4l2_mpeg_vbi_itv0_line {
1665 __u8 id; /* One of V4L2_MPEG_VBI_IVTV_* above */
1666 __u8 data[42]; /* Sliced VBI data for the line */
1667} __attribute__ ((packed));
1668
1669struct v4l2_mpeg_vbi_itv0 {
1670 __le32 linemask[2]; /* Bitmasks of VBI service lines present */
1671 struct v4l2_mpeg_vbi_itv0_line line[35];
1672} __attribute__ ((packed));
1673
1674struct v4l2_mpeg_vbi_ITV0 {
1675 struct v4l2_mpeg_vbi_itv0_line line[36];
1676} __attribute__ ((packed));
1677
1678#define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
1679#define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
1680
1681struct v4l2_mpeg_vbi_fmt_ivtv {
1682 __u8 magic[4];
1683 union {
1684 struct v4l2_mpeg_vbi_itv0 itv0;
1685 struct v4l2_mpeg_vbi_ITV0 ITV0;
1686 };
1687} __attribute__ ((packed));
1688
1689/*
1690 * A G G R E G A T E S T R U C T U R E S
1691 */
1692
1693/**
1694 * struct v4l2_plane_pix_format - additional, per-plane format definition
1695 * @sizeimage: maximum size in bytes required for data, for which
1696 * this plane will be used
1697 * @bytesperline: distance in bytes between the leftmost pixels in two
1698 * adjacent lines
1699 */
1700struct v4l2_plane_pix_format {
1701 __u32 sizeimage;
1702 __u16 bytesperline;
1703 __u16 reserved[7];
1704} __attribute__ ((packed));
1705
1706/**
1707 * struct v4l2_pix_format_mplane - multiplanar format definition
1708 * @width: image width in pixels
1709 * @height: image height in pixels
1710 * @pixelformat: little endian four character code (fourcc)
1711 * @field: enum v4l2_field; field order (for interlaced video)
1712 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
1713 * @plane_fmt: per-plane information
1714 * @num_planes: number of planes for this format
1715 */
1716struct v4l2_pix_format_mplane {
1717 __u32 width;
1718 __u32 height;
1719 __u32 pixelformat;
1720 __u32 field;
1721 __u32 colorspace;
1722
1723 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
1724 __u8 num_planes;
1725 __u8 reserved[11];
1726} __attribute__ ((packed));
1727
1728/**
1729 * struct v4l2_format - stream data format
1730 * @type: enum v4l2_buf_type; type of the data stream
1731 * @pix: definition of an image format
1732 * @pix_mp: definition of a multiplanar image format
1733 * @win: definition of an overlaid image
1734 * @vbi: raw VBI capture or output parameters
1735 * @sliced: sliced VBI capture or output parameters
1736 * @raw_data: placeholder for future extensions and custom formats
1737 */
1738struct v4l2_format {
1739 __u32 type;
1740 union {
1741 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
1742 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
1743 struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
1744 struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
1745 struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
1746 __u8 raw_data[200]; /* user-defined */
1747 } fmt;
1748};
1749
1750/* Stream type-dependent parameters
1751 */
1752struct v4l2_streamparm {
1753 __u32 type; /* enum v4l2_buf_type */
1754 union {
1755 struct v4l2_captureparm capture;
1756 struct v4l2_outputparm output;
1757 __u8 raw_data[200]; /* user-defined */
1758 } parm;
1759};
1760
1761/*
1762 * E V E N T S
1763 */
1764
1765#define V4L2_EVENT_ALL 0
1766#define V4L2_EVENT_VSYNC 1
1767#define V4L2_EVENT_EOS 2
1768#define V4L2_EVENT_CTRL 3
1769#define V4L2_EVENT_FRAME_SYNC 4
1770#define V4L2_EVENT_PRIVATE_START 0x08000000
1771
1772/* Payload for V4L2_EVENT_VSYNC */
1773struct v4l2_event_vsync {
1774 /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
1775 __u8 field;
1776} __attribute__ ((packed));
1777
1778/* Payload for V4L2_EVENT_CTRL */
1779#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
1780#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
1781
1782struct v4l2_event_ctrl {
1783 __u32 changes;
1784 __u32 type;
1785 union {
1786 __s32 value;
1787 __s64 value64;
1788 };
1789 __u32 flags;
1790 __s32 minimum;
1791 __s32 maximum;
1792 __s32 step;
1793 __s32 default_value;
1794};
1795
1796struct v4l2_event_frame_sync {
1797 __u32 frame_sequence;
1798};
1799
1800struct v4l2_event {
1801 __u32 type;
1802 union {
1803 struct v4l2_event_vsync vsync;
1804 struct v4l2_event_ctrl ctrl;
1805 struct v4l2_event_frame_sync frame_sync;
1806 __u8 data[64];
1807 } u;
1808 __u32 pending;
1809 __u32 sequence;
1810 struct timespec timestamp;
1811 __u32 id;
1812 __u32 reserved[8];
1813};
1814
1815#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
1816#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
1817
1818struct v4l2_event_subscription {
1819 __u32 type;
1820 __u32 id;
1821 __u32 flags;
1822 __u32 reserved[5];
1823};
1824
1825/*
1826 * A D V A N C E D D E B U G G I N G
1827 *
1828 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
1829 * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
1830 */
1831
1832/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
1833
1834#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
1835#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1836#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1837#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
1838
1839struct v4l2_dbg_match {
1840 __u32 type; /* Match type */
1841 union { /* Match this chip, meaning determined by type */
1842 __u32 addr;
1843 char name[32];
1844 };
1845} __attribute__ ((packed));
1846
1847struct v4l2_dbg_register {
1848 struct v4l2_dbg_match match;
1849 __u32 size; /* register size in bytes */
1850 __u64 reg;
1851 __u64 val;
1852} __attribute__ ((packed));
1853
1854/* VIDIOC_DBG_G_CHIP_IDENT */
1855struct v4l2_dbg_chip_ident {
1856 struct v4l2_dbg_match match;
1857 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
1858 __u32 revision; /* chip revision, chip specific */
1859} __attribute__ ((packed));
1860
1861/**
1862 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
1863 * @index: on return, index of the first created buffer
1864 * @count: entry: number of requested buffers,
1865 * return: number of created buffers
1866 * @memory: enum v4l2_memory; buffer memory type
1867 * @format: frame format, for which buffers are requested
1868 * @reserved: future extensions
1869 */
1870struct v4l2_create_buffers {
1871 __u32 index;
1872 __u32 count;
1873 __u32 memory;
1874 struct v4l2_format format;
1875 __u32 reserved[8];
1876};
1877
1878/*
1879 * 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
1880 *
1881 */
1882#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
1883#define VIDIOC_RESERVED _IO('V', 1)
1884#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
1885#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
1886#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
1887#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
1888#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
1889#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
1890#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1891#define VIDIOC_OVERLAY _IOW('V', 14, int)
1892#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
1893#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1894#define VIDIOC_STREAMON _IOW('V', 18, int)
1895#define VIDIOC_STREAMOFF _IOW('V', 19, int)
1896#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
1897#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
1898#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
1899#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
1900#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
1901#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
1902#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
1903#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
1904#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
1905#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
1906#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
1907#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
1908#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
1909#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
1910#define VIDIOC_G_INPUT _IOR('V', 38, int)
1911#define VIDIOC_S_INPUT _IOWR('V', 39, int)
1912#define VIDIOC_G_OUTPUT _IOR('V', 46, int)
1913#define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
1914#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
1915#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
1916#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
1917#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
1918#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
1919#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
1920#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
1921#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
1922#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
1923#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
1924#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
1925#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
1926#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
1927#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
1928#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
1929#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
1930#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */
1931#define VIDIOC_S_PRIORITY _IOW('V', 68, __u32) /* enum v4l2_priority */
1932#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
1933#define VIDIOC_LOG_STATUS _IO('V', 70)
1934#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
1935#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
1936#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
1937#if 1
1938#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
1939#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
1940#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
1941#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
1942#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
1943#endif
1944
1945#if 1
1946/* Experimental, meant for debugging, testing and internal use.
1947 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
1948 You must be root to use these ioctls. Never use these in applications! */
1949#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
1950#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
1951
1952/* Experimental, meant for debugging, testing and internal use.
1953 Never use this ioctl in applications! */
1954#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
1955#endif
1956
1957#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
1958
1959/* These four DV Preset ioctls are deprecated in favor of the DV Timings
1960 ioctls. */
1961#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset)
1962#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset)
1963#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset)
1964#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset)
1965#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
1966#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
1967#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
1968#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
1969#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
1970
1971/* Experimental, the below two ioctls may change over the next couple of kernel
1972 versions */
1973#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
1974#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
1975
1976/* Experimental selection API */
1977#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
1978#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
1979
1980/* Experimental, these two ioctls may change over the next couple of kernel
1981 versions. */
1982#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
1983#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
1984
1985/* Experimental, these three ioctls may change over the next couple of kernel
1986 versions. */
1987#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
1988#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
1989#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
1990
1991/* Experimental, this ioctl may change over the next couple of kernel
1992 versions. */
1993#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
1994
1995/* Reminder: when adding new ioctls please add support for them to
1996 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1997
1998#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1999 61
2000#endif /* __LINUX_VIDEODEV2_H */ 62#endif /* __LINUX_VIDEODEV2_H */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index e2850a7ea27..29b9104232b 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -1,60 +1,10 @@
1#ifndef _LINUX_VIRTIO_CONFIG_H 1#ifndef _LINUX_VIRTIO_CONFIG_H
2#define _LINUX_VIRTIO_CONFIG_H 2#define _LINUX_VIRTIO_CONFIG_H
3/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
4 * anyone can use the definitions to implement compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
28
29/* Virtio devices use a standardized configuration space to define their
30 * features and pass configuration information, but each implementation can
31 * store and access that space differently. */
32#include <linux/types.h>
33
34/* Status byte for guest to report progress, and synchronize features. */
35/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
36#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1
37/* We have found a driver for the device. */
38#define VIRTIO_CONFIG_S_DRIVER 2
39/* Driver has used its parts of the config, and is happy */
40#define VIRTIO_CONFIG_S_DRIVER_OK 4
41/* We've given up on this device. */
42#define VIRTIO_CONFIG_S_FAILED 0x80
43
44/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
45 * transport being used (eg. virtio_ring), the rest are per-device feature
46 * bits. */
47#define VIRTIO_TRANSPORT_F_START 28
48#define VIRTIO_TRANSPORT_F_END 32
49
50/* Do we get callbacks when the ring is completely used, even if we've
51 * suppressed them? */
52#define VIRTIO_F_NOTIFY_ON_EMPTY 24
53 3
54#ifdef __KERNEL__
55#include <linux/err.h> 4#include <linux/err.h>
56#include <linux/bug.h> 5#include <linux/bug.h>
57#include <linux/virtio.h> 6#include <linux/virtio.h>
7#include <uapi/linux/virtio_config.h>
58 8
59/** 9/**
60 * virtio_config_ops - operations for configuring a virtio device 10 * virtio_config_ops - operations for configuring a virtio device
@@ -213,5 +163,4 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu)
213} 163}
214 164
215 165
216#endif /* __KERNEL__ */
217#endif /* _LINUX_VIRTIO_CONFIG_H */ 166#endif /* _LINUX_VIRTIO_CONFIG_H */
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index bdf4b003473..d2e2785af60 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -1,8 +1,3 @@
1#ifndef _LINUX_VIRTIO_CONSOLE_H
2#define _LINUX_VIRTIO_CONSOLE_H
3#include <linux/types.h>
4#include <linux/virtio_ids.h>
5#include <linux/virtio_config.h>
6/* 1/*
7 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 2 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
8 * anyone can use the definitions to implement compatible drivers/servers: 3 * anyone can use the definitions to implement compatible drivers/servers:
@@ -34,44 +29,10 @@
34 * Copyright (C) Red Hat, Inc., 2009, 2010, 2011 29 * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
35 * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011 30 * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
36 */ 31 */
32#ifndef _LINUX_VIRTIO_CONSOLE_H
33#define _LINUX_VIRTIO_CONSOLE_H
37 34
38/* Feature bits */ 35#include <uapi/linux/virtio_console.h>
39#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
40#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
41
42#define VIRTIO_CONSOLE_BAD_ID (~(u32)0)
43
44struct virtio_console_config {
45 /* colums of the screens */
46 __u16 cols;
47 /* rows of the screens */
48 __u16 rows;
49 /* max. number of ports this device can hold */
50 __u32 max_nr_ports;
51} __attribute__((packed));
52
53/*
54 * A message that's passed between the Host and the Guest for a
55 * particular port.
56 */
57struct virtio_console_control {
58 __u32 id; /* Port number */
59 __u16 event; /* The kind of control event (see below) */
60 __u16 value; /* Extra information for the key */
61};
62
63/* Some events for control messages */
64#define VIRTIO_CONSOLE_DEVICE_READY 0
65#define VIRTIO_CONSOLE_PORT_ADD 1
66#define VIRTIO_CONSOLE_PORT_REMOVE 2
67#define VIRTIO_CONSOLE_PORT_READY 3
68#define VIRTIO_CONSOLE_CONSOLE_PORT 4
69#define VIRTIO_CONSOLE_RESIZE 5
70#define VIRTIO_CONSOLE_PORT_OPEN 6
71#define VIRTIO_CONSOLE_PORT_NAME 7
72 36
73#ifdef __KERNEL__
74int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); 37int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
75#endif /* __KERNEL__ */
76
77#endif /* _LINUX_VIRTIO_CONSOLE_H */ 38#endif /* _LINUX_VIRTIO_CONSOLE_H */
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index c2d793a06ad..63c6ea19951 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -1,167 +1,9 @@
1#ifndef _LINUX_VIRTIO_RING_H 1#ifndef _LINUX_VIRTIO_RING_H
2#define _LINUX_VIRTIO_RING_H 2#define _LINUX_VIRTIO_RING_H
3/* An interface for efficient virtio implementation, currently for use by KVM
4 * and lguest, but hopefully others soon. Do NOT change this since it will
5 * break existing servers and clients.
6 *
7 * This header is BSD licensed so anyone can use the definitions to implement
8 * compatible drivers/servers.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of IBM nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * Copyright Rusty Russell IBM Corporation 2007. */
34#include <linux/types.h>
35 3
36/* This marks a buffer as continuing via the next field. */
37#define VRING_DESC_F_NEXT 1
38/* This marks a buffer as write-only (otherwise read-only). */
39#define VRING_DESC_F_WRITE 2
40/* This means the buffer contains a list of buffer descriptors. */
41#define VRING_DESC_F_INDIRECT 4
42
43/* The Host uses this in used->flags to advise the Guest: don't kick me when
44 * you add a buffer. It's unreliable, so it's simply an optimization. Guest
45 * will still kick if it's out of buffers. */
46#define VRING_USED_F_NO_NOTIFY 1
47/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
48 * when you consume a buffer. It's unreliable, so it's simply an
49 * optimization. */
50#define VRING_AVAIL_F_NO_INTERRUPT 1
51
52/* We support indirect buffer descriptors */
53#define VIRTIO_RING_F_INDIRECT_DESC 28
54
55/* The Guest publishes the used index for which it expects an interrupt
56 * at the end of the avail ring. Host should ignore the avail->flags field. */
57/* The Host publishes the avail index for which it expects a kick
58 * at the end of the used ring. Guest should ignore the used->flags field. */
59#define VIRTIO_RING_F_EVENT_IDX 29
60
61/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
62struct vring_desc {
63 /* Address (guest-physical). */
64 __u64 addr;
65 /* Length. */
66 __u32 len;
67 /* The flags as indicated above. */
68 __u16 flags;
69 /* We chain unused descriptors via this, too */
70 __u16 next;
71};
72
73struct vring_avail {
74 __u16 flags;
75 __u16 idx;
76 __u16 ring[];
77};
78
79/* u32 is used here for ids for padding reasons. */
80struct vring_used_elem {
81 /* Index of start of used descriptor chain. */
82 __u32 id;
83 /* Total length of the descriptor chain which was used (written to) */
84 __u32 len;
85};
86
87struct vring_used {
88 __u16 flags;
89 __u16 idx;
90 struct vring_used_elem ring[];
91};
92
93struct vring {
94 unsigned int num;
95
96 struct vring_desc *desc;
97
98 struct vring_avail *avail;
99
100 struct vring_used *used;
101};
102
103/* The standard layout for the ring is a continuous chunk of memory which looks
104 * like this. We assume num is a power of 2.
105 *
106 * struct vring
107 * {
108 * // The actual descriptors (16 bytes each)
109 * struct vring_desc desc[num];
110 *
111 * // A ring of available descriptor heads with free-running index.
112 * __u16 avail_flags;
113 * __u16 avail_idx;
114 * __u16 available[num];
115 * __u16 used_event_idx;
116 *
117 * // Padding to the next align boundary.
118 * char pad[];
119 *
120 * // A ring of used descriptor heads with free-running index.
121 * __u16 used_flags;
122 * __u16 used_idx;
123 * struct vring_used_elem used[num];
124 * __u16 avail_event_idx;
125 * };
126 */
127/* We publish the used event index at the end of the available ring, and vice
128 * versa. They are at the end for backwards compatibility. */
129#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
130#define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num])
131
132static inline void vring_init(struct vring *vr, unsigned int num, void *p,
133 unsigned long align)
134{
135 vr->num = num;
136 vr->desc = p;
137 vr->avail = p + num*sizeof(struct vring_desc);
138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
139 + align-1) & ~(align - 1));
140}
141
142static inline unsigned vring_size(unsigned int num, unsigned long align)
143{
144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
145 + align - 1) & ~(align - 1))
146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
147}
148
149/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
150/* Assuming a given event_idx value from the other size, if
151 * we have just incremented index from old to new_idx,
152 * should we trigger an event? */
153static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
154{
155 /* Note: Xen has similar logic for notification hold-off
156 * in include/xen/interface/io/ring.h with req_event and req_prod
157 * corresponding to event_idx + 1 and new_idx respectively.
158 * Note also that req_event and req_prod in Xen start at 1,
159 * event indexes in virtio start at 0. */
160 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
161}
162
163#ifdef __KERNEL__
164#include <linux/irqreturn.h> 4#include <linux/irqreturn.h>
5#include <uapi/linux/virtio_ring.h>
6
165struct virtio_device; 7struct virtio_device;
166struct virtqueue; 8struct virtqueue;
167 9
@@ -179,5 +21,4 @@ void vring_del_virtqueue(struct virtqueue *vq);
179void vring_transport_features(struct virtio_device *vdev); 21void vring_transport_features(struct virtio_device *vdev);
180 22
181irqreturn_t vring_interrupt(int irq, void *_vq); 23irqreturn_t vring_interrupt(int irq, void *_vq);
182#endif /* __KERNEL__ */
183#endif /* _LINUX_VIRTIO_RING_H */ 24#endif /* _LINUX_VIRTIO_RING_H */
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 30a8dd9c83f..b186e043523 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -1,90 +1,8 @@
1#ifndef _LINUX_VT_H 1#ifndef _LINUX_VT_H
2#define _LINUX_VT_H 2#define _LINUX_VT_H
3 3
4#include <uapi/linux/vt.h>
4 5
5/*
6 * These constants are also useful for user-level apps (e.g., VC
7 * resizing).
8 */
9#define MIN_NR_CONSOLES 1 /* must be at least 1 */
10#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
11#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
12 /* Note: the ioctl VT_GETSTATE does not work for
13 consoles 16 and higher (since it returns a short) */
14
15/* 0x56 is 'V', to avoid collision with termios and kd */
16
17#define VT_OPENQRY 0x5600 /* find available vt */
18
19struct vt_mode {
20 char mode; /* vt mode */
21 char waitv; /* if set, hang on writes if not active */
22 short relsig; /* signal to raise on release req */
23 short acqsig; /* signal to raise on acquisition */
24 short frsig; /* unused (set to 0) */
25};
26#define VT_GETMODE 0x5601 /* get mode of active vt */
27#define VT_SETMODE 0x5602 /* set mode of active vt */
28#define VT_AUTO 0x00 /* auto vt switching */
29#define VT_PROCESS 0x01 /* process controls switching */
30#define VT_ACKACQ 0x02 /* acknowledge switch */
31
32struct vt_stat {
33 unsigned short v_active; /* active vt */
34 unsigned short v_signal; /* signal to send */
35 unsigned short v_state; /* vt bitmask */
36};
37#define VT_GETSTATE 0x5603 /* get global vt state info */
38#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
39
40#define VT_RELDISP 0x5605 /* release display */
41
42#define VT_ACTIVATE 0x5606 /* make vt active */
43#define VT_WAITACTIVE 0x5607 /* wait for vt active */
44#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
45
46struct vt_sizes {
47 unsigned short v_rows; /* number of rows */
48 unsigned short v_cols; /* number of columns */
49 unsigned short v_scrollsize; /* number of lines of scrollback */
50};
51#define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
52
53struct vt_consize {
54 unsigned short v_rows; /* number of rows */
55 unsigned short v_cols; /* number of columns */
56 unsigned short v_vlin; /* number of pixel rows on screen */
57 unsigned short v_clin; /* number of pixel rows per character */
58 unsigned short v_vcol; /* number of pixel columns on screen */
59 unsigned short v_ccol; /* number of pixel columns per character */
60};
61#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
62#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
63#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
64#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
65
66struct vt_event {
67 unsigned int event;
68#define VT_EVENT_SWITCH 0x0001 /* Console switch */
69#define VT_EVENT_BLANK 0x0002 /* Screen blank */
70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
71#define VT_EVENT_RESIZE 0x0008 /* Resize display */
72#define VT_MAX_EVENT 0x000F
73 unsigned int oldev; /* Old console */
74 unsigned int newev; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */
76};
77
78#define VT_WAITEVENT 0x560E /* Wait for an event */
79
80struct vt_setactivate {
81 unsigned int console;
82 struct vt_mode mode;
83};
84
85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
86
87#ifdef __KERNEL__
88 6
89/* Virtual Terminal events. */ 7/* Virtual Terminal events. */
90#define VT_ALLOCATE 0x0001 /* Console got allocated */ 8#define VT_ALLOCATE 0x0001 /* Console got allocated */
@@ -106,8 +24,4 @@ static inline int vt_kmsg_redirect(int new)
106 24
107#endif 25#endif
108 26
109#endif /* __KERNEL__ */
110
111#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
112
113#endif /* _LINUX_VT_H */ 27#endif /* _LINUX_VT_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 1dee81c41ff..168dfe122dd 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -1,28 +1,12 @@
1#ifndef _LINUX_WAIT_H 1#ifndef _LINUX_WAIT_H
2#define _LINUX_WAIT_H 2#define _LINUX_WAIT_H
3 3
4#define WNOHANG 0x00000001
5#define WUNTRACED 0x00000002
6#define WSTOPPED WUNTRACED
7#define WEXITED 0x00000004
8#define WCONTINUED 0x00000008
9#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
10
11#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */
12#define __WALL 0x40000000 /* Wait on all children, regardless of type */
13#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
14
15/* First argument to waitid: */
16#define P_ALL 0
17#define P_PID 1
18#define P_PGID 2
19
20#ifdef __KERNEL__
21 4
22#include <linux/list.h> 5#include <linux/list.h>
23#include <linux/stddef.h> 6#include <linux/stddef.h>
24#include <linux/spinlock.h> 7#include <linux/spinlock.h>
25#include <asm/current.h> 8#include <asm/current.h>
9#include <uapi/linux/wait.h>
26 10
27typedef struct __wait_queue wait_queue_t; 11typedef struct __wait_queue wait_queue_t;
28typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); 12typedef 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,
663 return out_of_line_wait_on_bit_lock(word, bit, action, mode); 647 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
664} 648}
665 649
666#endif /* __KERNEL__ */
667
668#endif 650#endif
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 3157cc1fada..cec4b415976 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -43,413 +43,11 @@
43* Jan 16, 1997 Gene Kozin router_devlist made public 43* Jan 16, 1997 Gene Kozin router_devlist made public
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). 44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/ 45*****************************************************************************/
46
47#ifndef _ROUTER_H 46#ifndef _ROUTER_H
48#define _ROUTER_H 47#define _ROUTER_H
49 48
50#define ROUTER_NAME "wanrouter" /* in case we ever change it */ 49#include <uapi/linux/wanrouter.h>
51#define ROUTER_VERSION 1 /* version number */
52#define ROUTER_RELEASE 1 /* release (minor version) number */
53#define ROUTER_IOCTL 'W' /* for IOCTL calls */
54#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
55
56/* IOCTL codes for /proc/router/<device> entries (up to 255) */
57enum router_ioctls
58{
59 ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */
60 ROUTER_DOWN, /* shut down device */
61 ROUTER_STAT, /* get device status */
62 ROUTER_IFNEW, /* add interface */
63 ROUTER_IFDEL, /* delete interface */
64 ROUTER_IFSTAT, /* get interface status */
65 ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
66 ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
67};
68
69/* identifiers for displaying proc file data for dual port adapters */
70#define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */
71#define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */
72
73/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
74#define NLPID_IP 0xCC /* Internet Protocol Datagram */
75#define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */
76#define NLPID_CLNP 0x81 /* ISO/IEC 8473 */
77#define NLPID_ESIS 0x82 /* ISO/IEC 9542 */
78#define NLPID_ISIS 0x83 /* ISO/IEC ISIS */
79#define NLPID_Q933 0x08 /* CCITT Q.933 */
80
81/* Miscellaneous */
82#define WAN_IFNAME_SZ 15 /* max length of the interface name */
83#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
84#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
85#define USED_BY_FIELD 8 /* max length of the used by field */
86
87/* Defines for UDP PACKET TYPE */
88#define UDP_PTPIPE_TYPE 0x01
89#define UDP_FPIPE_TYPE 0x02
90#define UDP_CPIPE_TYPE 0x03
91#define UDP_DRVSTATS_TYPE 0x04
92#define UDP_INVALID_TYPE 0x05
93
94/* Command return code */
95#define CMD_OK 0 /* normal firmware return code */
96#define CMD_TIMEOUT 0xFF /* firmware command timed out */
97
98/* UDP Packet Management */
99#define UDP_PKT_FRM_STACK 0x00
100#define UDP_PKT_FRM_NETWORK 0x01
101
102/* Maximum interrupt test counter */
103#define MAX_INTR_TEST_COUNTER 100
104
105/* Critical Values for RACE conditions*/
106#define CRITICAL_IN_ISR 0xA1
107#define CRITICAL_INTR_HANDLED 0xB1
108
109/****** Data Types **********************************************************/
110
111/*----------------------------------------------------------------------------
112 * X.25-specific link-level configuration.
113 */
114typedef struct wan_x25_conf
115{
116 unsigned lo_pvc; /* lowest permanent circuit number */
117 unsigned hi_pvc; /* highest permanent circuit number */
118 unsigned lo_svc; /* lowest switched circuit number */
119 unsigned hi_svc; /* highest switched circuit number */
120 unsigned hdlc_window; /* HDLC window size (1..7) */
121 unsigned pkt_window; /* X.25 packet window size (1..7) */
122 unsigned t1; /* HDLC timer T1, sec (1..30) */
123 unsigned t2; /* HDLC timer T2, sec (0..29) */
124 unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */
125 unsigned n2; /* HDLC retransmission limit (1..30) */
126 unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */
127 unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */
128 unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */
129 unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */
130 unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */
131 unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */
132 unsigned r10_r20; /* RESTART retransmission limit (0..250) */
133 unsigned r12_r22; /* RESET retransmission limit (0..250) */
134 unsigned r13_r23; /* CLEAR retransmission limit (0..250) */
135 unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */
136 unsigned x25_conf_opt; /* User defined x25 config optoins */
137 unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
138 unsigned char logging; /* Control connection logging */
139 unsigned char oob_on_modem; /* Whether to send modem status to the user app */
140} wan_x25_conf_t;
141
142/*----------------------------------------------------------------------------
143 * Frame relay specific link-level configuration.
144 */
145typedef struct wan_fr_conf
146{
147 unsigned signalling; /* local in-channel signalling type */
148 unsigned t391; /* link integrity verification timer */
149 unsigned t392; /* polling verification timer */
150 unsigned n391; /* full status polling cycle counter */
151 unsigned n392; /* error threshold counter */
152 unsigned n393; /* monitored events counter */
153 unsigned dlci_num; /* number of DLCs (access node) */
154 unsigned dlci[100]; /* List of all DLCIs */
155} wan_fr_conf_t;
156
157/*----------------------------------------------------------------------------
158 * PPP-specific link-level configuration.
159 */
160typedef struct wan_ppp_conf
161{
162 unsigned restart_tmr; /* restart timer */
163 unsigned auth_rsrt_tmr; /* authentication timer */
164 unsigned auth_wait_tmr; /* authentication timer */
165 unsigned mdm_fail_tmr; /* modem failure timer */
166 unsigned dtr_drop_tmr; /* DTR drop timer */
167 unsigned connect_tmout; /* connection timeout */
168 unsigned conf_retry; /* max. retry */
169 unsigned term_retry; /* max. retry */
170 unsigned fail_retry; /* max. retry */
171 unsigned auth_retry; /* max. retry */
172 unsigned auth_options; /* authentication opt. */
173 unsigned ip_options; /* IP options */
174 char authenticator; /* AUTHENTICATOR or not */
175 char ip_mode; /* Static/Host/Peer */
176} wan_ppp_conf_t;
177
178/*----------------------------------------------------------------------------
179 * CHDLC-specific link-level configuration.
180 */
181typedef struct wan_chdlc_conf
182{
183 unsigned char ignore_dcd; /* Protocol options: */
184 unsigned char ignore_cts; /* Ignore these to determine */
185 unsigned char ignore_keepalive; /* link status (Yes or No) */
186 unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */
187 unsigned char receive_only; /* no transmit buffering (Y/N) */
188 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
189 unsigned keepalive_rx_tmr; /* receive keepalive timer */
190 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
191 unsigned slarp_timer; /* SLARP request timer */
192} wan_chdlc_conf_t;
193
194
195/*----------------------------------------------------------------------------
196 * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
197 */
198typedef struct wandev_conf
199{
200 unsigned magic; /* magic number (for verification) */
201 unsigned config_id; /* configuration structure identifier */
202 /****** hardware configuration ******/
203 unsigned ioport; /* adapter I/O port base */
204 unsigned long maddr; /* dual-port memory address */
205 unsigned msize; /* dual-port memory size */
206 int irq; /* interrupt request level */
207 int dma; /* DMA request level */
208 char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */
209 unsigned PCI_slot_no; /* S514 PCI adapter slot number */
210 char auto_pci_cfg; /* S515 PCI automatic slot detection */
211 char comm_port; /* Communication Port (PRI=0, SEC=1) */
212 unsigned bps; /* data transfer rate */
213 unsigned mtu; /* maximum transmit unit size */
214 unsigned udp_port; /* UDP port for management */
215 unsigned char ttl; /* Time To Live for UDP security */
216 unsigned char ft1; /* FT1 Configurator Option */
217 char interface; /* RS-232/V.35, etc. */
218 char clocking; /* external/internal */
219 char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
220 char station; /* DTE/DCE, primary/secondary, etc. */
221 char connection; /* permanent/switched/on-demand */
222 char read_mode; /* read mode: Polling or interrupt */
223 char receive_only; /* disable tx buffers */
224 char tty; /* Create a fake tty device */
225 unsigned tty_major; /* Major number for wanpipe tty device */
226 unsigned tty_minor; /* Minor number for wanpipe tty device */
227 unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */
228 char backup; /* Backup Mode */
229 unsigned hw_opt[4]; /* other hardware options */
230 unsigned reserved[4];
231 /****** arbitrary data ***************/
232 unsigned data_size; /* data buffer size */
233 void* data; /* data buffer, e.g. firmware */
234 union /****** protocol-specific ************/
235 {
236 wan_x25_conf_t x25; /* X.25 configuration */
237 wan_ppp_conf_t ppp; /* PPP configuration */
238 wan_fr_conf_t fr; /* frame relay configuration */
239 wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
240 } u;
241} wandev_conf_t;
242
243/* 'config_id' definitions */
244#define WANCONFIG_X25 101 /* X.25 link */
245#define WANCONFIG_FR 102 /* frame relay link */
246#define WANCONFIG_PPP 103 /* synchronous PPP link */
247#define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */
248#define WANCONFIG_BSC 105 /* BiSync Streaming */
249#define WANCONFIG_HDLC 106 /* HDLC Support */
250#define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */
251
252/*
253 * Configuration options defines.
254 */
255/* general options */
256#define WANOPT_OFF 0
257#define WANOPT_ON 1
258#define WANOPT_NO 0
259#define WANOPT_YES 1
260
261/* intercace options */
262#define WANOPT_RS232 0
263#define WANOPT_V35 1
264
265/* data encoding options */
266#define WANOPT_NRZ 0
267#define WANOPT_NRZI 1
268#define WANOPT_FM0 2
269#define WANOPT_FM1 3
270
271/* link type options */
272#define WANOPT_POINTTOPOINT 0 /* RTS always active */
273#define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */
274
275/* clocking options */
276#define WANOPT_EXTERNAL 0
277#define WANOPT_INTERNAL 1
278
279/* station options */
280#define WANOPT_DTE 0
281#define WANOPT_DCE 1
282#define WANOPT_CPE 0
283#define WANOPT_NODE 1
284#define WANOPT_SECONDARY 0
285#define WANOPT_PRIMARY 1
286
287/* connection options */
288#define WANOPT_PERMANENT 0 /* DTR always active */
289#define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */
290#define WANOPT_ONDEMAND 2 /* activate DTR only before sending */
291
292/* frame relay in-channel signalling */
293#define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */
294#define WANOPT_FR_Q933 2 /* ITU Q.933A */
295#define WANOPT_FR_LMI 3 /* LMI */
296
297/* PPP IP Mode Options */
298#define WANOPT_PPP_STATIC 0
299#define WANOPT_PPP_HOST 1
300#define WANOPT_PPP_PEER 2
301
302/* ASY Mode Options */
303#define WANOPT_ONE 1
304#define WANOPT_TWO 2
305#define WANOPT_ONE_AND_HALF 3
306
307#define WANOPT_NONE 0
308#define WANOPT_ODD 1
309#define WANOPT_EVEN 2
310
311/* CHDLC Protocol Options */
312/* DF Commented out for now.
313
314#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
315#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
316#define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT
317*/
318
319/* Port options */
320#define WANOPT_PRI 0
321#define WANOPT_SEC 1
322/* read mode */
323#define WANOPT_INTR 0
324#define WANOPT_POLL 1
325
326
327#define WANOPT_TTY_SYNC 0
328#define WANOPT_TTY_ASYNC 1
329/*----------------------------------------------------------------------------
330 * WAN Link Status Info (for ROUTER_STAT IOCTL).
331 */
332typedef struct wandev_stat
333{
334 unsigned state; /* link state */
335 unsigned ndev; /* number of configured interfaces */
336
337 /* link/interface configuration */
338 unsigned connection; /* permanent/switched/on-demand */
339 unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */
340 unsigned mtu; /* max. transmit unit for this device */
341
342 /* physical level statistics */
343 unsigned modem_status; /* modem status */
344 unsigned rx_frames; /* received frames count */
345 unsigned rx_overruns; /* receiver overrun error count */
346 unsigned rx_crc_err; /* receive CRC error count */
347 unsigned rx_aborts; /* received aborted frames count */
348 unsigned rx_bad_length; /* unexpetedly long/short frames count */
349 unsigned rx_dropped; /* frames discarded at device level */
350 unsigned tx_frames; /* transmitted frames count */
351 unsigned tx_underruns; /* aborted transmissions (underruns) count */
352 unsigned tx_timeouts; /* transmission timeouts */
353 unsigned tx_rejects; /* other transmit errors */
354
355 /* media level statistics */
356 unsigned rx_bad_format; /* frames with invalid format */
357 unsigned rx_bad_addr; /* frames with invalid media address */
358 unsigned tx_retries; /* frames re-transmitted */
359 unsigned reserved[16]; /* reserved for future use */
360} wandev_stat_t;
361
362/* 'state' defines */
363enum wan_states
364{
365 WAN_UNCONFIGURED, /* link/channel is not configured */
366 WAN_DISCONNECTED, /* link/channel is disconnected */
367 WAN_CONNECTING, /* connection is in progress */
368 WAN_CONNECTED, /* link/channel is operational */
369 WAN_LIMIT, /* for verification only */
370 WAN_DUALPORT, /* for Dual Port cards */
371 WAN_DISCONNECTING,
372 WAN_FT1_READY /* FT1 Configurator Ready */
373};
374
375enum {
376 WAN_LOCAL_IP,
377 WAN_POINTOPOINT_IP,
378 WAN_NETMASK_IP,
379 WAN_BROADCAST_IP
380};
381
382/* 'modem_status' masks */
383#define WAN_MODEM_CTS 0x0001 /* CTS line active */
384#define WAN_MODEM_DCD 0x0002 /* DCD line active */
385#define WAN_MODEM_DTR 0x0010 /* DTR line active */
386#define WAN_MODEM_RTS 0x0020 /* RTS line active */
387
388/*----------------------------------------------------------------------------
389 * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
390 */
391typedef struct wanif_conf
392{
393 unsigned magic; /* magic number */
394 unsigned config_id; /* configuration identifier */
395 char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */
396 char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
397 char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */
398 unsigned idle_timeout; /* sec, before disconnecting */
399 unsigned hold_timeout; /* sec, before re-connecting */
400 unsigned cir; /* Committed Information Rate fwd,bwd*/
401 unsigned bc; /* Committed Burst Size fwd, bwd */
402 unsigned be; /* Excess Burst Size fwd, bwd */
403 unsigned char enable_IPX; /* Enable or Disable IPX */
404 unsigned char inarp; /* Send Inverse ARP requests Y/N */
405 unsigned inarp_interval; /* sec, between InARP requests */
406 unsigned long network_number; /* Network Number for IPX */
407 char mc; /* Multicast on or off */
408 char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
409 unsigned char port; /* board port */
410 unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */
411 char pap; /* PAP enabled or disabled */
412 char chap; /* CHAP enabled or disabled */
413 unsigned char userid[511]; /* List of User Id */
414 unsigned char passwd[511]; /* List of passwords */
415 unsigned char sysname[31]; /* Name of the system */
416 unsigned char ignore_dcd; /* Protocol options: */
417 unsigned char ignore_cts; /* Ignore these to determine */
418 unsigned char ignore_keepalive; /* link status (Yes or No) */
419 unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */
420 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
421 unsigned keepalive_rx_tmr; /* receive keepalive timer */
422 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
423 unsigned slarp_timer; /* SLARP request timer */
424 unsigned char ttl; /* Time To Live for UDP security */
425 char interface; /* RS-232/V.35, etc. */
426 char clocking; /* external/internal */
427 unsigned bps; /* data transfer rate */
428 unsigned mtu; /* maximum transmit unit size */
429 unsigned char if_down; /* brind down interface when disconnected */
430 unsigned char gateway; /* Is this interface a gateway */
431 unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
432
433 unsigned char asy_data_trans; /* async API options */
434 unsigned char rts_hs_for_receive; /* async Protocol options */
435 unsigned char xon_xoff_hs_for_receive;
436 unsigned char xon_xoff_hs_for_transmit;
437 unsigned char dcd_hs_for_transmit;
438 unsigned char cts_hs_for_transmit;
439 unsigned char async_mode;
440 unsigned tx_bits_per_char;
441 unsigned rx_bits_per_char;
442 unsigned stop_bits;
443 unsigned char parity;
444 unsigned break_timer;
445 unsigned inter_char_timer;
446 unsigned rx_complete_length;
447 unsigned xon_char;
448 unsigned xoff_char;
449 unsigned char receive_only; /* no transmit buffering (Y/N) */
450} wanif_conf_t;
451 50
452#ifdef __KERNEL__
453/****** Kernel Interface ****************************************************/ 51/****** Kernel Interface ****************************************************/
454 52
455#include <linux/fs.h> /* support for device drivers */ 53#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
528/* list of registered devices */ 126/* list of registered devices */
529extern struct wan_device *wanrouter_router_devlist; 127extern struct wan_device *wanrouter_router_devlist;
530 128
531#endif /* __KERNEL__ */
532#endif /* _ROUTER_H */ 129#endif /* _ROUTER_H */
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index da70f0facd2..b7f45d48b2d 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -5,59 +5,14 @@
5 * by Ken Hollis <khollis@bitgate.com> 5 * by Ken Hollis <khollis@bitgate.com>
6 * 6 *
7 */ 7 */
8
9#ifndef _LINUX_WATCHDOG_H 8#ifndef _LINUX_WATCHDOG_H
10#define _LINUX_WATCHDOG_H 9#define _LINUX_WATCHDOG_H
11 10
12#include <linux/ioctl.h>
13#include <linux/types.h>
14
15#define WATCHDOG_IOCTL_BASE 'W'
16
17struct watchdog_info {
18 __u32 options; /* Options the card/driver supports */
19 __u32 firmware_version; /* Firmware version of the card */
20 __u8 identity[32]; /* Identity of the board */
21};
22
23#define WDIOC_GETSUPPORT _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
24#define WDIOC_GETSTATUS _IOR(WATCHDOG_IOCTL_BASE, 1, int)
25#define WDIOC_GETBOOTSTATUS _IOR(WATCHDOG_IOCTL_BASE, 2, int)
26#define WDIOC_GETTEMP _IOR(WATCHDOG_IOCTL_BASE, 3, int)
27#define WDIOC_SETOPTIONS _IOR(WATCHDOG_IOCTL_BASE, 4, int)
28#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
29#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
30#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int)
31#define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
32#define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int)
33#define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int)
34
35#define WDIOF_UNKNOWN -1 /* Unknown flag error */
36#define WDIOS_UNKNOWN -1 /* Unknown status error */
37
38#define WDIOF_OVERHEAT 0x0001 /* Reset due to CPU overheat */
39#define WDIOF_FANFAULT 0x0002 /* Fan failed */
40#define WDIOF_EXTERN1 0x0004 /* External relay 1 */
41#define WDIOF_EXTERN2 0x0008 /* External relay 2 */
42#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */
43#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */
44#define WDIOF_POWEROVER 0x0040 /* Power over voltage */
45#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */
46#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */
47#define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */
48#define WDIOF_ALARMONLY 0x0400 /* Watchdog triggers a management or
49 other external alarm not a reboot */
50#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */
51
52#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */
53#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */
54#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */
55
56#ifdef __KERNEL__
57 11
58#include <linux/bitops.h> 12#include <linux/bitops.h>
59#include <linux/device.h> 13#include <linux/device.h>
60#include <linux/cdev.h> 14#include <linux/cdev.h>
15#include <uapi/linux/watchdog.h>
61 16
62struct watchdog_ops; 17struct watchdog_ops;
63struct watchdog_device; 18struct watchdog_device;
@@ -178,6 +133,4 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
178extern int watchdog_register_device(struct watchdog_device *); 133extern int watchdog_register_device(struct watchdog_device *);
179extern void watchdog_unregister_device(struct watchdog_device *); 134extern void watchdog_unregister_device(struct watchdog_device *);
180 135
181#endif /* __KERNEL__ */
182
183#endif /* ifndef _LINUX_WATCHDOG_H */ 136#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 4395b28bb86..4ea4c6e2383 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -6,690 +6,11 @@
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. 7 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
8 */ 8 */
9
10#ifndef _LINUX_WIRELESS_H 9#ifndef _LINUX_WIRELESS_H
11#define _LINUX_WIRELESS_H 10#define _LINUX_WIRELESS_H
12 11
13/************************** DOCUMENTATION **************************/ 12#include <uapi/linux/wireless.h>
14/*
15 * Initial APIs (1996 -> onward) :
16 * -----------------------------
17 * Basically, the wireless extensions are for now a set of standard ioctl
18 * call + /proc/net/wireless
19 *
20 * The entry /proc/net/wireless give statistics and information on the
21 * driver.
22 * This is better than having each driver having its entry because
23 * its centralised and we may remove the driver module safely.
24 *
25 * Ioctl are used to configure the driver and issue commands. This is
26 * better than command line options of insmod because we may want to
27 * change dynamically (while the driver is running) some parameters.
28 *
29 * The ioctl mechanimsm are copied from standard devices ioctl.
30 * We have the list of command plus a structure descibing the
31 * data exchanged...
32 * Note that to add these ioctl, I was obliged to modify :
33 * # net/core/dev.c (two place + add include)
34 * # net/ipv4/af_inet.c (one place + add include)
35 *
36 * /proc/net/wireless is a copy of /proc/net/dev.
37 * We have a structure for data passed from the driver to /proc/net/wireless
38 * Too add this, I've modified :
39 * # net/core/dev.c (two other places)
40 * # include/linux/netdevice.h (one place)
41 * # include/linux/proc_fs.h (one place)
42 *
43 * New driver API (2002 -> onward) :
44 * -------------------------------
45 * This file is only concerned with the user space API and common definitions.
46 * The new driver API is defined and documented in :
47 * # include/net/iw_handler.h
48 *
49 * Note as well that /proc/net/wireless implementation has now moved in :
50 * # net/core/wireless.c
51 *
52 * Wireless Events (2002 -> onward) :
53 * --------------------------------
54 * Events are defined at the end of this file, and implemented in :
55 * # net/core/wireless.c
56 *
57 * Other comments :
58 * --------------
59 * Do not add here things that are redundant with other mechanisms
60 * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
61 * wireless specific.
62 *
63 * These wireless extensions are not magic : each driver has to provide
64 * support for them...
65 *
66 * IMPORTANT NOTE : As everything in the kernel, this is very much a
67 * work in progress. Contact me if you have ideas of improvements...
68 */
69
70/***************************** INCLUDES *****************************/
71
72#include <linux/types.h> /* for __u* and __s* typedefs */
73#include <linux/socket.h> /* for "struct sockaddr" et al */
74#include <linux/if.h> /* for IFNAMSIZ and co... */
75
76/***************************** VERSION *****************************/
77/*
78 * This constant is used to know the availability of the wireless
79 * extensions and to know which version of wireless extensions it is
80 * (there is some stuff that will be added in the future...)
81 * I just plan to increment with each new version.
82 */
83#define WIRELESS_EXT 22
84
85/*
86 * Changes :
87 *
88 * V2 to V3
89 * --------
90 * Alan Cox start some incompatibles changes. I've integrated a bit more.
91 * - Encryption renamed to Encode to avoid US regulation problems
92 * - Frequency changed from float to struct to avoid problems on old 386
93 *
94 * V3 to V4
95 * --------
96 * - Add sensitivity
97 *
98 * V4 to V5
99 * --------
100 * - Missing encoding definitions in range
101 * - Access points stuff
102 *
103 * V5 to V6
104 * --------
105 * - 802.11 support (ESSID ioctls)
106 *
107 * V6 to V7
108 * --------
109 * - define IW_ESSID_MAX_SIZE and IW_MAX_AP
110 *
111 * V7 to V8
112 * --------
113 * - Changed my e-mail address
114 * - More 802.11 support (nickname, rate, rts, frag)
115 * - List index in frequencies
116 *
117 * V8 to V9
118 * --------
119 * - Support for 'mode of operation' (ad-hoc, managed...)
120 * - Support for unicast and multicast power saving
121 * - Change encoding to support larger tokens (>64 bits)
122 * - Updated iw_params (disable, flags) and use it for NWID
123 * - Extracted iw_point from iwreq for clarity
124 *
125 * V9 to V10
126 * ---------
127 * - Add PM capability to range structure
128 * - Add PM modifier : MAX/MIN/RELATIVE
129 * - Add encoding option : IW_ENCODE_NOKEY
130 * - Add TxPower ioctls (work like TxRate)
131 *
132 * V10 to V11
133 * ----------
134 * - Add WE version in range (help backward/forward compatibility)
135 * - Add retry ioctls (work like PM)
136 *
137 * V11 to V12
138 * ----------
139 * - Add SIOCSIWSTATS to get /proc/net/wireless programatically
140 * - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
141 * - Add new statistics (frag, retry, beacon)
142 * - Add average quality (for user space calibration)
143 *
144 * V12 to V13
145 * ----------
146 * - Document creation of new driver API.
147 * - Extract union iwreq_data from struct iwreq (for new driver API).
148 * - Rename SIOCSIWNAME as SIOCSIWCOMMIT
149 *
150 * V13 to V14
151 * ----------
152 * - Wireless Events support : define struct iw_event
153 * - Define additional specific event numbers
154 * - Add "addr" and "param" fields in union iwreq_data
155 * - AP scanning stuff (SIOCSIWSCAN and friends)
156 *
157 * V14 to V15
158 * ----------
159 * - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
160 * - Make struct iw_freq signed (both m & e), add explicit padding
161 * - Add IWEVCUSTOM for driver specific event/scanning token
162 * - Add IW_MAX_GET_SPY for driver returning a lot of addresses
163 * - Add IW_TXPOW_RANGE for range of Tx Powers
164 * - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
165 * - Add IW_MODE_MONITOR for passive monitor
166 *
167 * V15 to V16
168 * ----------
169 * - Increase the number of bitrates in iw_range to 32 (for 802.11g)
170 * - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
171 * - Reshuffle struct iw_range for increases, add filler
172 * - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
173 * - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
174 * - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
175 * - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
176 *
177 * V16 to V17
178 * ----------
179 * - Add flags to frequency -> auto/fixed
180 * - Document (struct iw_quality *)->updated, add new flags (INVALID)
181 * - Wireless Event capability in struct iw_range
182 * - Add support for relative TxPower (yick !)
183 *
184 * V17 to V18 (From Jouni Malinen <j@w1.fi>)
185 * ----------
186 * - Add support for WPA/WPA2
187 * - Add extended encoding configuration (SIOCSIWENCODEEXT and
188 * SIOCGIWENCODEEXT)
189 * - Add SIOCSIWGENIE/SIOCGIWGENIE
190 * - Add SIOCSIWMLME
191 * - Add SIOCSIWPMKSA
192 * - Add struct iw_range bit field for supported encoding capabilities
193 * - Add optional scan request parameters for SIOCSIWSCAN
194 * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
195 * related parameters (extensible up to 4096 parameter values)
196 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
197 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
198 *
199 * V18 to V19
200 * ----------
201 * - Remove (struct iw_point *)->pointer from events and streams
202 * - Remove header includes to help user space
203 * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
204 * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
205 * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
206 * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
207 *
208 * V19 to V20
209 * ----------
210 * - RtNetlink requests support (SET/GET)
211 *
212 * V20 to V21
213 * ----------
214 * - Remove (struct net_device *)->get_wireless_stats()
215 * - Change length in ESSID and NICK to strlen() instead of strlen()+1
216 * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
217 * - Power/Retry relative values no longer * 100000
218 * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
219 *
220 * V21 to V22
221 * ----------
222 * - Prevent leaking of kernel space in stream on 64 bits.
223 */
224
225/**************************** CONSTANTS ****************************/
226
227/* -------------------------- IOCTL LIST -------------------------- */
228
229/* Wireless Identification */
230#define SIOCSIWCOMMIT 0x8B00 /* Commit pending changes to driver */
231#define SIOCGIWNAME 0x8B01 /* get name == wireless protocol */
232/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
233 * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
234 * Don't put the name of your driver there, it's useless. */
235
236/* Basic operations */
237#define SIOCSIWNWID 0x8B02 /* set network id (pre-802.11) */
238#define SIOCGIWNWID 0x8B03 /* get network id (the cell) */
239#define SIOCSIWFREQ 0x8B04 /* set channel/frequency (Hz) */
240#define SIOCGIWFREQ 0x8B05 /* get channel/frequency (Hz) */
241#define SIOCSIWMODE 0x8B06 /* set operation mode */
242#define SIOCGIWMODE 0x8B07 /* get operation mode */
243#define SIOCSIWSENS 0x8B08 /* set sensitivity (dBm) */
244#define SIOCGIWSENS 0x8B09 /* get sensitivity (dBm) */
245
246/* Informative stuff */
247#define SIOCSIWRANGE 0x8B0A /* Unused */
248#define SIOCGIWRANGE 0x8B0B /* Get range of parameters */
249#define SIOCSIWPRIV 0x8B0C /* Unused */
250#define SIOCGIWPRIV 0x8B0D /* get private ioctl interface info */
251#define SIOCSIWSTATS 0x8B0E /* Unused */
252#define SIOCGIWSTATS 0x8B0F /* Get /proc/net/wireless stats */
253/* SIOCGIWSTATS is strictly used between user space and the kernel, and
254 * is never passed to the driver (i.e. the driver will never see it). */
255
256/* Spy support (statistics per MAC address - used for Mobile IP support) */
257#define SIOCSIWSPY 0x8B10 /* set spy addresses */
258#define SIOCGIWSPY 0x8B11 /* get spy info (quality of link) */
259#define SIOCSIWTHRSPY 0x8B12 /* set spy threshold (spy event) */
260#define SIOCGIWTHRSPY 0x8B13 /* get spy threshold */
261
262/* Access Point manipulation */
263#define SIOCSIWAP 0x8B14 /* set access point MAC addresses */
264#define SIOCGIWAP 0x8B15 /* get access point MAC addresses */
265#define SIOCGIWAPLIST 0x8B17 /* Deprecated in favor of scanning */
266#define SIOCSIWSCAN 0x8B18 /* trigger scanning (list cells) */
267#define SIOCGIWSCAN 0x8B19 /* get scanning results */
268
269/* 802.11 specific support */
270#define SIOCSIWESSID 0x8B1A /* set ESSID (network name) */
271#define SIOCGIWESSID 0x8B1B /* get ESSID */
272#define SIOCSIWNICKN 0x8B1C /* set node name/nickname */
273#define SIOCGIWNICKN 0x8B1D /* get node name/nickname */
274/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
275 * within the 'iwreq' structure, so we need to use the 'data' member to
276 * point to a string in user space, like it is done for RANGE... */
277
278/* Other parameters useful in 802.11 and some other devices */
279#define SIOCSIWRATE 0x8B20 /* set default bit rate (bps) */
280#define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
281#define SIOCSIWRTS 0x8B22 /* set RTS/CTS threshold (bytes) */
282#define SIOCGIWRTS 0x8B23 /* get RTS/CTS threshold (bytes) */
283#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
284#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
285#define SIOCSIWTXPOW 0x8B26 /* set transmit power (dBm) */
286#define SIOCGIWTXPOW 0x8B27 /* get transmit power (dBm) */
287#define SIOCSIWRETRY 0x8B28 /* set retry limits and lifetime */
288#define SIOCGIWRETRY 0x8B29 /* get retry limits and lifetime */
289
290/* Encoding stuff (scrambling, hardware security, WEP...) */
291#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
292#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
293/* Power saving stuff (power management, unicast and multicast) */
294#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
295#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
296
297/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
298 * This ioctl uses struct iw_point and data buffer that includes IE id and len
299 * fields. More than one IE may be included in the request. Setting the generic
300 * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
301 * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
302 * are required to report the used IE as a wireless event, e.g., when
303 * associating with an AP. */
304#define SIOCSIWGENIE 0x8B30 /* set generic IE */
305#define SIOCGIWGENIE 0x8B31 /* get generic IE */
306
307/* WPA : IEEE 802.11 MLME requests */
308#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
309 * struct iw_mlme */
310/* WPA : Authentication mode parameters */
311#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
312#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
313
314/* WPA : Extended version of encoding configuration */
315#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
316#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
317
318/* WPA2 : PMKSA cache management */
319#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
320
321/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
322
323/* These 32 ioctl are wireless device private, for 16 commands.
324 * Each driver is free to use them for whatever purpose it chooses,
325 * however the driver *must* export the description of those ioctls
326 * with SIOCGIWPRIV and *must* use arguments as defined below.
327 * If you don't follow those rules, DaveM is going to hate you (reason :
328 * it make mixed 32/64bit operation impossible).
329 */
330#define SIOCIWFIRSTPRIV 0x8BE0
331#define SIOCIWLASTPRIV 0x8BFF
332/* Previously, we were using SIOCDEVPRIVATE, but we now have our
333 * separate range because of collisions with other tools such as
334 * 'mii-tool'.
335 * We now have 32 commands, so a bit more space ;-).
336 * Also, all 'even' commands are only usable by root and don't return the
337 * content of ifr/iwr to user (but you are not obliged to use the set/get
338 * convention, just use every other two command). More details in iwpriv.c.
339 * And I repeat : you are not forced to use them with iwpriv, but you
340 * must be compliant with it.
341 */
342
343/* ------------------------- IOCTL STUFF ------------------------- */
344
345/* The first and the last (range) */
346#define SIOCIWFIRST 0x8B00
347#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
348#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
349#define IW_HANDLER(id, func) \
350 [IW_IOCTL_IDX(id)] = func
351
352/* Odd : get (world access), even : set (root access) */
353#define IW_IS_SET(cmd) (!((cmd) & 0x1))
354#define IW_IS_GET(cmd) ((cmd) & 0x1)
355
356/* ----------------------- WIRELESS EVENTS ----------------------- */
357/* Those are *NOT* ioctls, do not issue request on them !!! */
358/* Most events use the same identifier as ioctl requests */
359
360#define IWEVTXDROP 0x8C00 /* Packet dropped to excessive retry */
361#define IWEVQUAL 0x8C01 /* Quality part of statistics (scan) */
362#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
363#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
364#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
365#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
366 * (scan results); This includes id and
367 * length fields. One IWEVGENIE may
368 * contain more than one IE. Scan
369 * results may contain one or more
370 * IWEVGENIE events. */
371#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
372 * (struct iw_michaelmicfailure)
373 */
374#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
375 * The data includes id and length
376 * fields and may contain more than one
377 * IE. This event is required in
378 * Managed mode if the driver
379 * generates its own WPA/RSN IE. This
380 * should be sent just before
381 * IWEVREGISTERED event for the
382 * association. */
383#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
384 * Response. The data includes id and
385 * length fields and may contain more
386 * than one IE. This may be sent
387 * between IWEVASSOCREQIE and
388 * IWEVREGISTERED events for the
389 * association. */
390#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
391 * pre-authentication
392 * (struct iw_pmkid_cand) */
393
394#define IWEVFIRST 0x8C00
395#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
396
397/* ------------------------- PRIVATE INFO ------------------------- */
398/*
399 * The following is used with SIOCGIWPRIV. It allow a driver to define
400 * the interface (name, type of data) for its private ioctl.
401 * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
402 */
403
404#define IW_PRIV_TYPE_MASK 0x7000 /* Type of arguments */
405#define IW_PRIV_TYPE_NONE 0x0000
406#define IW_PRIV_TYPE_BYTE 0x1000 /* Char as number */
407#define IW_PRIV_TYPE_CHAR 0x2000 /* Char as character */
408#define IW_PRIV_TYPE_INT 0x4000 /* 32 bits int */
409#define IW_PRIV_TYPE_FLOAT 0x5000 /* struct iw_freq */
410#define IW_PRIV_TYPE_ADDR 0x6000 /* struct sockaddr */
411
412#define IW_PRIV_SIZE_FIXED 0x0800 /* Variable or fixed number of args */
413
414#define IW_PRIV_SIZE_MASK 0x07FF /* Max number of those args */
415
416/*
417 * Note : if the number of args is fixed and the size < 16 octets,
418 * instead of passing a pointer we will put args in the iwreq struct...
419 */
420
421/* ----------------------- OTHER CONSTANTS ----------------------- */
422
423/* Maximum frequencies in the range struct */
424#define IW_MAX_FREQUENCIES 32
425/* Note : if you have something like 80 frequencies,
426 * don't increase this constant and don't fill the frequency list.
427 * The user will be able to set by channel anyway... */
428
429/* Maximum bit rates in the range struct */
430#define IW_MAX_BITRATES 32
431
432/* Maximum tx powers in the range struct */
433#define IW_MAX_TXPOWER 8
434/* Note : if you more than 8 TXPowers, just set the max and min or
435 * a few of them in the struct iw_range. */
436
437/* Maximum of address that you may set with SPY */
438#define IW_MAX_SPY 8
439
440/* Maximum of address that you may get in the
441 list of access points in range */
442#define IW_MAX_AP 64
443
444/* Maximum size of the ESSID and NICKN strings */
445#define IW_ESSID_MAX_SIZE 32
446
447/* Modes of operation */
448#define IW_MODE_AUTO 0 /* Let the driver decides */
449#define IW_MODE_ADHOC 1 /* Single cell network */
450#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
451#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
452#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
453#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
454#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
455#define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
456
457/* Statistics flags (bitmask in updated) */
458#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
459#define IW_QUAL_LEVEL_UPDATED 0x02
460#define IW_QUAL_NOISE_UPDATED 0x04
461#define IW_QUAL_ALL_UPDATED 0x07
462#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
463#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
464#define IW_QUAL_LEVEL_INVALID 0x20
465#define IW_QUAL_NOISE_INVALID 0x40
466#define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */
467#define IW_QUAL_ALL_INVALID 0x70
468
469/* Frequency flags */
470#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
471#define IW_FREQ_FIXED 0x01 /* Force a specific value */
472
473/* Maximum number of size of encoding token available
474 * they are listed in the range structure */
475#define IW_MAX_ENCODING_SIZES 8
476
477/* Maximum size of the encoding token in bytes */
478#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
479
480/* Flags for encoding (along with the token) */
481#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
482#define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */
483#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
484#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
485#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
486#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
487#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
488#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */
489#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
490
491/* Power management flags available (along with the value, if any) */
492#define IW_POWER_ON 0x0000 /* No details... */
493#define IW_POWER_TYPE 0xF000 /* Type of parameter */
494#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
495#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
496#define IW_POWER_MODE 0x0F00 /* Power Management mode */
497#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
498#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
499#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
500#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
501#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
502#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */
503#define IW_POWER_MIN 0x0001 /* Value is a minimum */
504#define IW_POWER_MAX 0x0002 /* Value is a maximum */
505#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
506
507/* Transmit Power flags available */
508#define IW_TXPOW_TYPE 0x00FF /* Type of value */
509#define IW_TXPOW_DBM 0x0000 /* Value is in dBm */
510#define IW_TXPOW_MWATT 0x0001 /* Value is in mW */
511#define IW_TXPOW_RELATIVE 0x0002 /* Value is in arbitrary units */
512#define IW_TXPOW_RANGE 0x1000 /* Range of value between min/max */
513
514/* Retry limits and lifetime flags available */
515#define IW_RETRY_ON 0x0000 /* No details... */
516#define IW_RETRY_TYPE 0xF000 /* Type of parameter */
517#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/
518#define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */
519#define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */
520#define IW_RETRY_MIN 0x0001 /* Value is a minimum */
521#define IW_RETRY_MAX 0x0002 /* Value is a maximum */
522#define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
523#define IW_RETRY_SHORT 0x0010 /* Value is for short packets */
524#define IW_RETRY_LONG 0x0020 /* Value is for long packets */
525
526/* Scanning request flags */
527#define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */
528#define IW_SCAN_ALL_ESSID 0x0001 /* Scan all ESSIDs */
529#define IW_SCAN_THIS_ESSID 0x0002 /* Scan only this ESSID */
530#define IW_SCAN_ALL_FREQ 0x0004 /* Scan all Frequencies */
531#define IW_SCAN_THIS_FREQ 0x0008 /* Scan only this Frequency */
532#define IW_SCAN_ALL_MODE 0x0010 /* Scan all Modes */
533#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
534#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
535#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
536/* struct iw_scan_req scan_type */
537#define IW_SCAN_TYPE_ACTIVE 0
538#define IW_SCAN_TYPE_PASSIVE 1
539/* Maximum size of returned data */
540#define IW_SCAN_MAX_DATA 4096 /* In bytes */
541
542/* Scan capability flags - in (struct iw_range *)->scan_capa */
543#define IW_SCAN_CAPA_NONE 0x00
544#define IW_SCAN_CAPA_ESSID 0x01
545#define IW_SCAN_CAPA_BSSID 0x02
546#define IW_SCAN_CAPA_CHANNEL 0x04
547#define IW_SCAN_CAPA_MODE 0x08
548#define IW_SCAN_CAPA_RATE 0x10
549#define IW_SCAN_CAPA_TYPE 0x20
550#define IW_SCAN_CAPA_TIME 0x40
551
552/* Max number of char in custom event - use multiple of them if needed */
553#define IW_CUSTOM_MAX 256 /* In bytes */
554
555/* Generic information element */
556#define IW_GENERIC_IE_MAX 1024
557
558/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
559#define IW_MLME_DEAUTH 0
560#define IW_MLME_DISASSOC 1
561#define IW_MLME_AUTH 2
562#define IW_MLME_ASSOC 3
563
564/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
565#define IW_AUTH_INDEX 0x0FFF
566#define IW_AUTH_FLAGS 0xF000
567/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
568 * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
569 * parameter that is being set/get to; value will be read/written to
570 * struct iw_param value field) */
571#define IW_AUTH_WPA_VERSION 0
572#define IW_AUTH_CIPHER_PAIRWISE 1
573#define IW_AUTH_CIPHER_GROUP 2
574#define IW_AUTH_KEY_MGMT 3
575#define IW_AUTH_TKIP_COUNTERMEASURES 4
576#define IW_AUTH_DROP_UNENCRYPTED 5
577#define IW_AUTH_80211_AUTH_ALG 6
578#define IW_AUTH_WPA_ENABLED 7
579#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
580#define IW_AUTH_ROAMING_CONTROL 9
581#define IW_AUTH_PRIVACY_INVOKED 10
582#define IW_AUTH_CIPHER_GROUP_MGMT 11
583#define IW_AUTH_MFP 12
584
585/* IW_AUTH_WPA_VERSION values (bit field) */
586#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
587#define IW_AUTH_WPA_VERSION_WPA 0x00000002
588#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
589
590/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
591 * values (bit field) */
592#define IW_AUTH_CIPHER_NONE 0x00000001
593#define IW_AUTH_CIPHER_WEP40 0x00000002
594#define IW_AUTH_CIPHER_TKIP 0x00000004
595#define IW_AUTH_CIPHER_CCMP 0x00000008
596#define IW_AUTH_CIPHER_WEP104 0x00000010
597#define IW_AUTH_CIPHER_AES_CMAC 0x00000020
598
599/* IW_AUTH_KEY_MGMT values (bit field) */
600#define IW_AUTH_KEY_MGMT_802_1X 1
601#define IW_AUTH_KEY_MGMT_PSK 2
602
603/* IW_AUTH_80211_AUTH_ALG values (bit field) */
604#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
605#define IW_AUTH_ALG_SHARED_KEY 0x00000002
606#define IW_AUTH_ALG_LEAP 0x00000004
607
608/* IW_AUTH_ROAMING_CONTROL values */
609#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
610#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
611 * control */
612
613/* IW_AUTH_MFP (management frame protection) values */
614#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
615#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
616#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
617
618/* SIOCSIWENCODEEXT definitions */
619#define IW_ENCODE_SEQ_MAX_SIZE 8
620/* struct iw_encode_ext ->alg */
621#define IW_ENCODE_ALG_NONE 0
622#define IW_ENCODE_ALG_WEP 1
623#define IW_ENCODE_ALG_TKIP 2
624#define IW_ENCODE_ALG_CCMP 3
625#define IW_ENCODE_ALG_PMK 4
626#define IW_ENCODE_ALG_AES_CMAC 5
627/* struct iw_encode_ext ->ext_flags */
628#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
629#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
630#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
631#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
632
633/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
634#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
635#define IW_MICFAILURE_GROUP 0x00000004
636#define IW_MICFAILURE_PAIRWISE 0x00000008
637#define IW_MICFAILURE_STAKEY 0x00000010
638#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
639 */
640
641/* Bit field values for enc_capa in struct iw_range */
642#define IW_ENC_CAPA_WPA 0x00000001
643#define IW_ENC_CAPA_WPA2 0x00000002
644#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
645#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
646#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
647
648/* Event capability macros - in (struct iw_range *)->event_capa
649 * Because we have more than 32 possible events, we use an array of
650 * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
651#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \
652 (cmd - SIOCIWFIRSTPRIV + 0x60) : \
653 (cmd - SIOCIWFIRST))
654#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5)
655#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
656/* Event capability constants - event autogenerated by the kernel
657 * This list is valid for most 802.11 devices, customise as needed... */
658#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | \
659 IW_EVENT_CAPA_MASK(0x8B06) | \
660 IW_EVENT_CAPA_MASK(0x8B1A))
661#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A))
662/* "Easy" macro to set events in iw_range (less efficient) */
663#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
664#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
665
666
667/****************************** TYPES ******************************/
668
669/* --------------------------- SUBTYPES --------------------------- */
670/*
671 * Generic format for most parameters that fit in an int
672 */
673struct iw_param
674{
675 __s32 value; /* The value of the parameter itself */
676 __u8 fixed; /* Hardware should not use auto select */
677 __u8 disabled; /* Disable the feature */
678 __u16 flags; /* Various specifc flags (if any) */
679};
680
681/*
682 * For all data larger than 16 octets, we need to use a
683 * pointer to memory allocated in user space.
684 */
685struct iw_point
686{
687 void __user *pointer; /* Pointer to the data (in user space) */
688 __u16 length; /* number of fields or size in bytes */
689 __u16 flags; /* Optional params */
690};
691 13
692#ifdef __KERNEL__
693#ifdef CONFIG_COMPAT 14#ifdef CONFIG_COMPAT
694 15
695#include <linux/compat.h> 16#include <linux/compat.h>
@@ -700,432 +21,6 @@ struct compat_iw_point {
700 __u16 flags; 21 __u16 flags;
701}; 22};
702#endif 23#endif
703#endif
704
705/*
706 * A frequency
707 * For numbers lower than 10^9, we encode the number in 'm' and
708 * set 'e' to 0
709 * For number greater than 10^9, we divide it by the lowest power
710 * of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
711 * The power of 10 is in 'e', the result of the division is in 'm'.
712 */
713struct iw_freq
714{
715 __s32 m; /* Mantissa */
716 __s16 e; /* Exponent */
717 __u8 i; /* List index (when in range struct) */
718 __u8 flags; /* Flags (fixed/auto) */
719};
720
721/*
722 * Quality of the link
723 */
724struct iw_quality
725{
726 __u8 qual; /* link quality (%retries, SNR,
727 %missed beacons or better...) */
728 __u8 level; /* signal level (dBm) */
729 __u8 noise; /* noise level (dBm) */
730 __u8 updated; /* Flags to know if updated */
731};
732
733/*
734 * Packet discarded in the wireless adapter due to
735 * "wireless" specific problems...
736 * Note : the list of counter and statistics in net_device_stats
737 * is already pretty exhaustive, and you should use that first.
738 * This is only additional stats...
739 */
740struct iw_discarded
741{
742 __u32 nwid; /* Rx : Wrong nwid/essid */
743 __u32 code; /* Rx : Unable to code/decode (WEP) */
744 __u32 fragment; /* Rx : Can't perform MAC reassembly */
745 __u32 retries; /* Tx : Max MAC retries num reached */
746 __u32 misc; /* Others cases */
747};
748
749/*
750 * Packet/Time period missed in the wireless adapter due to
751 * "wireless" specific problems...
752 */
753struct iw_missed
754{
755 __u32 beacon; /* Missed beacons/superframe */
756};
757
758/*
759 * Quality range (for spy threshold)
760 */
761struct iw_thrspy
762{
763 struct sockaddr addr; /* Source address (hw/mac) */
764 struct iw_quality qual; /* Quality of the link */
765 struct iw_quality low; /* Low threshold */
766 struct iw_quality high; /* High threshold */
767};
768
769/*
770 * Optional data for scan request
771 *
772 * Note: these optional parameters are controlling parameters for the
773 * scanning behavior, these do not apply to getting scan results
774 * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
775 * provide a merged results with all BSSes even if the previous scan
776 * request limited scanning to a subset, e.g., by specifying an SSID.
777 * Especially, scan results are required to include an entry for the
778 * current BSS if the driver is in Managed mode and associated with an AP.
779 */
780struct iw_scan_req
781{
782 __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
783 __u8 essid_len;
784 __u8 num_channels; /* num entries in channel_list;
785 * 0 = scan all allowed channels */
786 __u8 flags; /* reserved as padding; use zero, this may
787 * be used in the future for adding flags
788 * to request different scan behavior */
789 struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
790 * individual address of a specific BSS */
791
792 /*
793 * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
794 * the current ESSID. This allows scan requests for specific ESSID
795 * without having to change the current ESSID and potentially breaking
796 * the current association.
797 */
798 __u8 essid[IW_ESSID_MAX_SIZE];
799
800 /*
801 * Optional parameters for changing the default scanning behavior.
802 * These are based on the MLME-SCAN.request from IEEE Std 802.11.
803 * TU is 1.024 ms. If these are set to 0, driver is expected to use
804 * reasonable default values. min_channel_time defines the time that
805 * will be used to wait for the first reply on each channel. If no
806 * replies are received, next channel will be scanned after this. If
807 * replies are received, total time waited on the channel is defined by
808 * max_channel_time.
809 */
810 __u32 min_channel_time; /* in TU */
811 __u32 max_channel_time; /* in TU */
812
813 struct iw_freq channel_list[IW_MAX_FREQUENCIES];
814};
815
816/* ------------------------- WPA SUPPORT ------------------------- */
817
818/*
819 * Extended data structure for get/set encoding (this is used with
820 * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
821 * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
822 * only the data contents changes (key data -> this structure, including
823 * key data).
824 *
825 * If the new key is the first group key, it will be set as the default
826 * TX key. Otherwise, default TX key index is only changed if
827 * IW_ENCODE_EXT_SET_TX_KEY flag is set.
828 *
829 * Key will be changed with SIOCSIWENCODEEXT in all cases except for
830 * special "change TX key index" operation which is indicated by setting
831 * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
832 *
833 * tx_seq/rx_seq are only used when respective
834 * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
835 * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
836 * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
837 * used only by an Authenticator (AP or an IBSS station) to get the
838 * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
839 * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
840 * debugging/testing.
841 */
842struct iw_encode_ext
843{
844 __u32 ext_flags; /* IW_ENCODE_EXT_* */
845 __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
846 __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
847 struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
848 * (group) keys or unicast address for
849 * individual keys */
850 __u16 alg; /* IW_ENCODE_ALG_* */
851 __u16 key_len;
852 __u8 key[0];
853};
854
855/* SIOCSIWMLME data */
856struct iw_mlme
857{
858 __u16 cmd; /* IW_MLME_* */
859 __u16 reason_code;
860 struct sockaddr addr;
861};
862
863/* SIOCSIWPMKSA data */
864#define IW_PMKSA_ADD 1
865#define IW_PMKSA_REMOVE 2
866#define IW_PMKSA_FLUSH 3
867
868#define IW_PMKID_LEN 16
869
870struct iw_pmksa
871{
872 __u32 cmd; /* IW_PMKSA_* */
873 struct sockaddr bssid;
874 __u8 pmkid[IW_PMKID_LEN];
875};
876
877/* IWEVMICHAELMICFAILURE data */
878struct iw_michaelmicfailure
879{
880 __u32 flags;
881 struct sockaddr src_addr;
882 __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
883};
884
885/* IWEVPMKIDCAND data */
886#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
887struct iw_pmkid_cand
888{
889 __u32 flags; /* IW_PMKID_CAND_* */
890 __u32 index; /* the smaller the index, the higher the
891 * priority */
892 struct sockaddr bssid;
893};
894
895/* ------------------------ WIRELESS STATS ------------------------ */
896/*
897 * Wireless statistics (used for /proc/net/wireless)
898 */
899struct iw_statistics
900{
901 __u16 status; /* Status
902 * - device dependent for now */
903
904 struct iw_quality qual; /* Quality of the link
905 * (instant/mean/max) */
906 struct iw_discarded discard; /* Packet discarded counts */
907 struct iw_missed miss; /* Packet missed counts */
908};
909
910/* ------------------------ IOCTL REQUEST ------------------------ */
911/*
912 * This structure defines the payload of an ioctl, and is used
913 * below.
914 *
915 * Note that this structure should fit on the memory footprint
916 * of iwreq (which is the same as ifreq), which mean a max size of
917 * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
918 * You should check this when increasing the structures defined
919 * above in this file...
920 */
921union iwreq_data
922{
923 /* Config - generic */
924 char name[IFNAMSIZ];
925 /* Name : used to verify the presence of wireless extensions.
926 * Name of the protocol/provider... */
927
928 struct iw_point essid; /* Extended network name */
929 struct iw_param nwid; /* network id (or domain - the cell) */
930 struct iw_freq freq; /* frequency or channel :
931 * 0-1000 = channel
932 * > 1000 = frequency in Hz */
933
934 struct iw_param sens; /* signal level threshold */
935 struct iw_param bitrate; /* default bit rate */
936 struct iw_param txpower; /* default transmit power */
937 struct iw_param rts; /* RTS threshold threshold */
938 struct iw_param frag; /* Fragmentation threshold */
939 __u32 mode; /* Operation mode */
940 struct iw_param retry; /* Retry limits & lifetime */
941
942 struct iw_point encoding; /* Encoding stuff : tokens */
943 struct iw_param power; /* PM duration/timeout */
944 struct iw_quality qual; /* Quality part of statistics */
945
946 struct sockaddr ap_addr; /* Access point address */
947 struct sockaddr addr; /* Destination address (hw/mac) */
948
949 struct iw_param param; /* Other small parameters */
950 struct iw_point data; /* Other large parameters */
951};
952
953/*
954 * The structure to exchange data for ioctl.
955 * This structure is the same as 'struct ifreq', but (re)defined for
956 * convenience...
957 * Do I need to remind you about structure size (32 octets) ?
958 */
959struct iwreq
960{
961 union
962 {
963 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
964 } ifr_ifrn;
965
966 /* Data part (defined just above) */
967 union iwreq_data u;
968};
969
970/* -------------------------- IOCTL DATA -------------------------- */
971/*
972 * For those ioctl which want to exchange mode data that what could
973 * fit in the above structure...
974 */
975
976/*
977 * Range of parameters
978 */
979
980struct iw_range
981{
982 /* Informative stuff (to choose between different interface) */
983 __u32 throughput; /* To give an idea... */
984 /* In theory this value should be the maximum benchmarked
985 * TCP/IP throughput, because with most of these devices the
986 * bit rate is meaningless (overhead an co) to estimate how
987 * fast the connection will go and pick the fastest one.
988 * I suggest people to play with Netperf or any benchmark...
989 */
990
991 /* NWID (or domain id) */
992 __u32 min_nwid; /* Minimal NWID we are able to set */
993 __u32 max_nwid; /* Maximal NWID we are able to set */
994
995 /* Old Frequency (backward compat - moved lower ) */
996 __u16 old_num_channels;
997 __u8 old_num_frequency;
998
999 /* Scan capabilities */
1000 __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */
1001
1002 /* Wireless event capability bitmasks */
1003 __u32 event_capa[6];
1004
1005 /* signal level threshold range */
1006 __s32 sensitivity;
1007
1008 /* Quality of link & SNR stuff */
1009 /* Quality range (link, level, noise)
1010 * If the quality is absolute, it will be in the range [0 ; max_qual],
1011 * if the quality is dBm, it will be in the range [max_qual ; 0].
1012 * Don't forget that we use 8 bit arithmetics... */
1013 struct iw_quality max_qual; /* Quality of the link */
1014 /* This should contain the average/typical values of the quality
1015 * indicator. This should be the threshold between a "good" and
1016 * a "bad" link (example : monitor going from green to orange).
1017 * Currently, user space apps like quality monitors don't have any
1018 * way to calibrate the measurement. With this, they can split
1019 * the range between 0 and max_qual in different quality level
1020 * (using a geometric subdivision centered on the average).
1021 * I expect that people doing the user space apps will feedback
1022 * us on which value we need to put in each driver... */
1023 struct iw_quality avg_qual; /* Quality of the link */
1024
1025 /* Rates */
1026 __u8 num_bitrates; /* Number of entries in the list */
1027 __s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
1028
1029 /* RTS threshold */
1030 __s32 min_rts; /* Minimal RTS threshold */
1031 __s32 max_rts; /* Maximal RTS threshold */
1032
1033 /* Frag threshold */
1034 __s32 min_frag; /* Minimal frag threshold */
1035 __s32 max_frag; /* Maximal frag threshold */
1036
1037 /* Power Management duration & timeout */
1038 __s32 min_pmp; /* Minimal PM period */
1039 __s32 max_pmp; /* Maximal PM period */
1040 __s32 min_pmt; /* Minimal PM timeout */
1041 __s32 max_pmt; /* Maximal PM timeout */
1042 __u16 pmp_flags; /* How to decode max/min PM period */
1043 __u16 pmt_flags; /* How to decode max/min PM timeout */
1044 __u16 pm_capa; /* What PM options are supported */
1045
1046 /* Encoder stuff */
1047 __u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
1048 __u8 num_encoding_sizes; /* Number of entry in the list */
1049 __u8 max_encoding_tokens; /* Max number of tokens */
1050 /* For drivers that need a "login/passwd" form */
1051 __u8 encoding_login_index; /* token index for login token */
1052
1053 /* Transmit power */
1054 __u16 txpower_capa; /* What options are supported */
1055 __u8 num_txpower; /* Number of entries in the list */
1056 __s32 txpower[IW_MAX_TXPOWER]; /* list, in bps */
1057
1058 /* Wireless Extension version info */
1059 __u8 we_version_compiled; /* Must be WIRELESS_EXT */
1060 __u8 we_version_source; /* Last update of source */
1061
1062 /* Retry limits and lifetime */
1063 __u16 retry_capa; /* What retry options are supported */
1064 __u16 retry_flags; /* How to decode max/min retry limit */
1065 __u16 r_time_flags; /* How to decode max/min retry life */
1066 __s32 min_retry; /* Minimal number of retries */
1067 __s32 max_retry; /* Maximal number of retries */
1068 __s32 min_r_time; /* Minimal retry lifetime */
1069 __s32 max_r_time; /* Maximal retry lifetime */
1070
1071 /* Frequency */
1072 __u16 num_channels; /* Number of channels [0; num - 1] */
1073 __u8 num_frequency; /* Number of entry in the list */
1074 struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
1075 /* Note : this frequency list doesn't need to fit channel numbers,
1076 * because each entry contain its channel index */
1077
1078 __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
1079};
1080
1081/*
1082 * Private ioctl interface information
1083 */
1084
1085struct iw_priv_args
1086{
1087 __u32 cmd; /* Number of the ioctl to issue */
1088 __u16 set_args; /* Type and number of args */
1089 __u16 get_args; /* Type and number of args */
1090 char name[IFNAMSIZ]; /* Name of the extension */
1091};
1092
1093/* ----------------------- WIRELESS EVENTS ----------------------- */
1094/*
1095 * Wireless events are carried through the rtnetlink socket to user
1096 * space. They are encapsulated in the IFLA_WIRELESS field of
1097 * a RTM_NEWLINK message.
1098 */
1099
1100/*
1101 * A Wireless Event. Contains basically the same data as the ioctl...
1102 */
1103struct iw_event
1104{
1105 __u16 len; /* Real length of this stuff */
1106 __u16 cmd; /* Wireless IOCTL */
1107 union iwreq_data u; /* IOCTL fixed payload */
1108};
1109
1110/* Size of the Event prefix (including padding and alignement junk) */
1111#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data))
1112/* Size of the various events */
1113#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
1114#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
1115#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
1116#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
1117#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
1118#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
1119
1120/* iw_point events are special. First, the payload (extra data) come at
1121 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1122 * we omit the pointer, so start at an offset. */
1123#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1124 (char *) NULL)
1125#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1126 IW_EV_POINT_OFF)
1127
1128#ifdef __KERNEL__
1129#ifdef CONFIG_COMPAT 24#ifdef CONFIG_COMPAT
1130struct __compat_iw_event { 25struct __compat_iw_event {
1131 __u16 len; /* Real length of this stuff */ 26 __u16 len; /* Real length of this stuff */
@@ -1146,17 +41,4 @@ struct __compat_iw_event {
1146 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ 41 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
1147 IW_EV_COMPAT_POINT_OFF) 42 IW_EV_COMPAT_POINT_OFF)
1148#endif 43#endif
1149#endif
1150
1151/* Size of the Event prefix when packed in stream */
1152#define IW_EV_LCP_PK_LEN (4)
1153/* Size of the various events when packed in stream */
1154#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ)
1155#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32))
1156#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
1157#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
1158#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
1159#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
1160#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4)
1161
1162#endif /* _LINUX_WIRELESS_H */ 44#endif /* _LINUX_WIRELESS_H */
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index cc13e111597..fdbafc6841c 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -10,61 +10,11 @@
10#ifndef _LINUX_XATTR_H 10#ifndef _LINUX_XATTR_H
11#define _LINUX_XATTR_H 11#define _LINUX_XATTR_H
12 12
13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
15
16/* Namespaces */
17#define XATTR_OS2_PREFIX "os2."
18#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
19
20#define XATTR_SECURITY_PREFIX "security."
21#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
22
23#define XATTR_SYSTEM_PREFIX "system."
24#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
25
26#define XATTR_TRUSTED_PREFIX "trusted."
27#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
28
29#define XATTR_USER_PREFIX "user."
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31
32/* Security namespace */
33#define XATTR_EVM_SUFFIX "evm"
34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
35
36#define XATTR_IMA_SUFFIX "ima"
37#define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
38
39#define XATTR_SELINUX_SUFFIX "selinux"
40#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
41
42#define XATTR_SMACK_SUFFIX "SMACK64"
43#define XATTR_SMACK_IPIN "SMACK64IPIN"
44#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
45#define XATTR_SMACK_EXEC "SMACK64EXEC"
46#define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
47#define XATTR_SMACK_MMAP "SMACK64MMAP"
48#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
49#define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
50#define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
51#define XATTR_NAME_SMACKEXEC XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
52#define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
53#define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
54
55#define XATTR_CAPS_SUFFIX "capability"
56#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
57
58#define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
59#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
60#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
61#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
62
63#ifdef __KERNEL__
64 13
65#include <linux/slab.h> 14#include <linux/slab.h>
66#include <linux/types.h> 15#include <linux/types.h>
67#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <uapi/linux/xattr.h>
68 18
69struct inode; 19struct inode;
70struct dentry; 20struct dentry;
@@ -147,6 +97,4 @@ ssize_t simple_xattr_list(struct simple_xattrs *xattrs, char *buffer,
147void simple_xattr_list_add(struct simple_xattrs *xattrs, 97void simple_xattr_list_add(struct simple_xattrs *xattrs,
148 struct simple_xattr *new_xattr); 98 struct simple_xattr *new_xattr);
149 99
150#endif /* __KERNEL__ */
151
152#endif /* _LINUX_XATTR_H */ 100#endif /* _LINUX_XATTR_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index b0fd4d03499..e194387ef78 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -22,3 +22,396 @@ header-y += usb/
22header-y += wimax/ 22header-y += wimax/
23 23
24genhdr-y += version.h 24genhdr-y += version.h
25
26ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h \
27 $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),)
28header-y += a.out.h
29endif
30
31header-y += acct.h
32header-y += adb.h
33header-y += adfs_fs.h
34header-y += affs_hardblocks.h
35header-y += agpgart.h
36header-y += aio_abi.h
37header-y += apm_bios.h
38header-y += arcfb.h
39header-y += atalk.h
40header-y += atm.h
41header-y += atm_eni.h
42header-y += atm_he.h
43header-y += atm_idt77105.h
44header-y += atm_nicstar.h
45header-y += atm_tcp.h
46header-y += atm_zatm.h
47header-y += atmapi.h
48header-y += atmarp.h
49header-y += atmbr2684.h
50header-y += atmclip.h
51header-y += atmdev.h
52header-y += atmioc.h
53header-y += atmlec.h
54header-y += atmmpc.h
55header-y += atmppp.h
56header-y += atmsap.h
57header-y += atmsvc.h
58header-y += audit.h
59header-y += auto_fs.h
60header-y += auto_fs4.h
61header-y += auxvec.h
62header-y += ax25.h
63header-y += b1lli.h
64header-y += baycom.h
65header-y += bfs_fs.h
66header-y += binfmts.h
67header-y += blkpg.h
68header-y += blktrace_api.h
69header-y += bpqether.h
70header-y += bsg.h
71header-y += can.h
72header-y += capability.h
73header-y += capi.h
74header-y += cciss_defs.h
75header-y += cciss_ioctl.h
76header-y += cdrom.h
77header-y += cgroupstats.h
78header-y += chio.h
79header-y += cm4000_cs.h
80header-y += cn_proc.h
81header-y += coda.h
82header-y += coda_psdev.h
83header-y += coff.h
84header-y += connector.h
85header-y += const.h
86header-y += cramfs_fs.h
87header-y += cuda.h
88header-y += cyclades.h
89header-y += cycx_cfm.h
90header-y += dcbnl.h
91header-y += dccp.h
92header-y += dlm.h
93header-y += dlm_device.h
94header-y += dlm_netlink.h
95header-y += dlm_plock.h
96header-y += dlmconstants.h
97header-y += dm-ioctl.h
98header-y += dm-log-userspace.h
99header-y += dn.h
100header-y += dqblk_xfs.h
101header-y += edd.h
102header-y += efs_fs_sb.h
103header-y += elf-em.h
104header-y += elf-fdpic.h
105header-y += elf.h
106header-y += elfcore.h
107header-y += errno.h
108header-y += errqueue.h
109header-y += ethtool.h
110header-y += eventpoll.h
111header-y += fadvise.h
112header-y += falloc.h
113header-y += fanotify.h
114header-y += fb.h
115header-y += fcntl.h
116header-y += fd.h
117header-y += fdreg.h
118header-y += fib_rules.h
119header-y += fiemap.h
120header-y += filter.h
121header-y += firewire-cdev.h
122header-y += firewire-constants.h
123header-y += flat.h
124header-y += fs.h
125header-y += fsl_hypervisor.h
126header-y += fuse.h
127header-y += futex.h
128header-y += gameport.h
129header-y += gen_stats.h
130header-y += genetlink.h
131header-y += gfs2_ondisk.h
132header-y += gigaset_dev.h
133header-y += hdlc.h
134header-y += hdlcdrv.h
135header-y += hdreg.h
136header-y += hid.h
137header-y += hiddev.h
138header-y += hidraw.h
139header-y += hpet.h
140header-y += hysdn_if.h
141header-y += i2c-dev.h
142header-y += i2c.h
143header-y += i2o-dev.h
144header-y += i8k.h
145header-y += icmp.h
146header-y += icmpv6.h
147header-y += if.h
148header-y += if_addr.h
149header-y += if_addrlabel.h
150header-y += if_alg.h
151header-y += if_arcnet.h
152header-y += if_arp.h
153header-y += if_bonding.h
154header-y += if_bridge.h
155header-y += if_cablemodem.h
156header-y += if_eql.h
157header-y += if_ether.h
158header-y += if_fc.h
159header-y += if_fddi.h
160header-y += if_frad.h
161header-y += if_hippi.h
162header-y += if_infiniband.h
163header-y += if_link.h
164header-y += if_ltalk.h
165header-y += if_packet.h
166header-y += if_phonet.h
167header-y += if_plip.h
168header-y += if_ppp.h
169header-y += if_pppol2tp.h
170header-y += if_pppox.h
171header-y += if_slip.h
172header-y += if_team.h
173header-y += if_tun.h
174header-y += if_tunnel.h
175header-y += if_vlan.h
176header-y += if_x25.h
177header-y += igmp.h
178header-y += in.h
179header-y += in6.h
180header-y += in_route.h
181header-y += inet_diag.h
182header-y += inotify.h
183header-y += input.h
184header-y += ioctl.h
185header-y += ip.h
186header-y += ip6_tunnel.h
187header-y += ip_vs.h
188header-y += ipc.h
189header-y += ipmi.h
190header-y += ipmi_msgdefs.h
191header-y += ipsec.h
192header-y += ipv6.h
193header-y += ipv6_route.h
194header-y += ipx.h
195header-y += irda.h
196header-y += irqnr.h
197header-y += isdn.h
198header-y += isdn_divertif.h
199header-y += isdn_ppp.h
200header-y += isdnif.h
201header-y += iso_fs.h
202header-y += ivtv.h
203header-y += ivtvfb.h
204header-y += ixjuser.h
205header-y += jffs2.h
206header-y += joystick.h
207header-y += kd.h
208header-y += kdev_t.h
209header-y += kernel-page-flags.h
210header-y += kernel.h
211header-y += kernelcapi.h
212header-y += kexec.h
213header-y += keyboard.h
214header-y += keyctl.h
215
216ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h \
217 $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),)
218header-y += kvm.h
219endif
220
221
222ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h \
223 $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h),)
224header-y += kvm_para.h
225endif
226
227header-y += l2tp.h
228header-y += limits.h
229header-y += llc.h
230header-y += loop.h
231header-y += lp.h
232header-y += magic.h
233header-y += major.h
234header-y += map_to_7segment.h
235header-y += matroxfb.h
236header-y += mdio.h
237header-y += media.h
238header-y += mei.h
239header-y += mempolicy.h
240header-y += meye.h
241header-y += mii.h
242header-y += minix_fs.h
243header-y += mman.h
244header-y += mmtimer.h
245header-y += mqueue.h
246header-y += mroute.h
247header-y += mroute6.h
248header-y += msdos_fs.h
249header-y += msg.h
250header-y += mtio.h
251header-y += n_r3964.h
252header-y += nbd.h
253header-y += ncp.h
254header-y += ncp_fs.h
255header-y += ncp_mount.h
256header-y += ncp_no.h
257header-y += neighbour.h
258header-y += net.h
259header-y += net_dropmon.h
260header-y += net_tstamp.h
261header-y += netdevice.h
262header-y += netfilter.h
263header-y += netfilter_arp.h
264header-y += netfilter_bridge.h
265header-y += netfilter_decnet.h
266header-y += netfilter_ipv4.h
267header-y += netfilter_ipv6.h
268header-y += netlink.h
269header-y += netrom.h
270header-y += nfc.h
271header-y += nfs.h
272header-y += nfs2.h
273header-y += nfs3.h
274header-y += nfs4.h
275header-y += nfs4_mount.h
276header-y += nfs_fs.h
277header-y += nfs_idmap.h
278header-y += nfs_mount.h
279header-y += nfsacl.h
280header-y += nl80211.h
281header-y += nubus.h
282header-y += nvram.h
283header-y += omap3isp.h
284header-y += omapfb.h
285header-y += oom.h
286header-y += packet_diag.h
287header-y += param.h
288header-y += parport.h
289header-y += patchkey.h
290header-y += pci.h
291header-y += pci_regs.h
292header-y += perf_event.h
293header-y += personality.h
294header-y += pfkeyv2.h
295header-y += pg.h
296header-y += phantom.h
297header-y += phonet.h
298header-y += pkt_cls.h
299header-y += pkt_sched.h
300header-y += pktcdvd.h
301header-y += pmu.h
302header-y += poll.h
303header-y += posix_types.h
304header-y += ppdev.h
305header-y += ppp-comp.h
306header-y += ppp-ioctl.h
307header-y += ppp_defs.h
308header-y += pps.h
309header-y += prctl.h
310header-y += ptp_clock.h
311header-y += ptrace.h
312header-y += qnx4_fs.h
313header-y += qnxtypes.h
314header-y += quota.h
315header-y += radeonfb.h
316header-y += random.h
317header-y += raw.h
318header-y += rds.h
319header-y += reboot.h
320header-y += reiserfs_fs.h
321header-y += reiserfs_xattr.h
322header-y += resource.h
323header-y += rfkill.h
324header-y += romfs_fs.h
325header-y += rose.h
326header-y += route.h
327header-y += rtc.h
328header-y += rtnetlink.h
329header-y += scc.h
330header-y += sched.h
331header-y += screen_info.h
332header-y += sdla.h
333header-y += seccomp.h
334header-y += securebits.h
335header-y += selinux_netlink.h
336header-y += sem.h
337header-y += serial.h
338header-y += serial_core.h
339header-y += serial_reg.h
340header-y += serio.h
341header-y += shm.h
342header-y += signal.h
343header-y += signalfd.h
344header-y += snmp.h
345header-y += sock_diag.h
346header-y += socket.h
347header-y += sockios.h
348header-y += som.h
349header-y += sonet.h
350header-y += sonypi.h
351header-y += sound.h
352header-y += soundcard.h
353header-y += stat.h
354header-y += stddef.h
355header-y += string.h
356header-y += suspend_ioctls.h
357header-y += swab.h
358header-y += synclink.h
359header-y += sysctl.h
360header-y += sysinfo.h
361header-y += taskstats.h
362header-y += tcp.h
363header-y += tcp_metrics.h
364header-y += telephony.h
365header-y += termios.h
366header-y += time.h
367header-y += times.h
368header-y += timex.h
369header-y += tiocl.h
370header-y += tipc.h
371header-y += tipc_config.h
372header-y += toshiba.h
373header-y += tty.h
374header-y += tty_flags.h
375header-y += types.h
376header-y += udf_fs_i.h
377header-y += udp.h
378header-y += uhid.h
379header-y += uinput.h
380header-y += uio.h
381header-y += ultrasound.h
382header-y += un.h
383header-y += unistd.h
384header-y += unix_diag.h
385header-y += usbdevice_fs.h
386header-y += utime.h
387header-y += utsname.h
388header-y += uuid.h
389header-y += uvcvideo.h
390header-y += v4l2-common.h
391header-y += v4l2-controls.h
392header-y += v4l2-dv-timings.h
393header-y += v4l2-mediabus.h
394header-y += v4l2-subdev.h
395header-y += veth.h
396header-y += vfio.h
397header-y += vhost.h
398header-y += videodev2.h
399header-y += virtio_9p.h
400header-y += virtio_balloon.h
401header-y += virtio_blk.h
402header-y += virtio_config.h
403header-y += virtio_console.h
404header-y += virtio_ids.h
405header-y += virtio_net.h
406header-y += virtio_pci.h
407header-y += virtio_ring.h
408header-y += virtio_rng.h
409header-y += vt.h
410header-y += wait.h
411header-y += wanrouter.h
412header-y += watchdog.h
413header-y += wimax.h
414header-y += wireless.h
415header-y += x25.h
416header-y += xattr.h
417header-y += xfrm.h
diff --git a/include/uapi/linux/a.out.h b/include/uapi/linux/a.out.h
new file mode 100644
index 00000000000..7caf44c7fa5
--- /dev/null
+++ b/include/uapi/linux/a.out.h
@@ -0,0 +1,274 @@
1#ifndef _UAPI__A_OUT_GNU_H__
2#define _UAPI__A_OUT_GNU_H__
3
4#define __GNU_EXEC_MACROS__
5
6#ifndef __STRUCT_EXEC_OVERRIDE__
7
8#include <asm/a.out.h>
9
10#endif /* __STRUCT_EXEC_OVERRIDE__ */
11
12#ifndef __ASSEMBLY__
13
14/* these go in the N_MACHTYPE field */
15enum machine_type {
16#if defined (M_OLDSUN2)
17 M__OLDSUN2 = M_OLDSUN2,
18#else
19 M_OLDSUN2 = 0,
20#endif
21#if defined (M_68010)
22 M__68010 = M_68010,
23#else
24 M_68010 = 1,
25#endif
26#if defined (M_68020)
27 M__68020 = M_68020,
28#else
29 M_68020 = 2,
30#endif
31#if defined (M_SPARC)
32 M__SPARC = M_SPARC,
33#else
34 M_SPARC = 3,
35#endif
36 /* skip a bunch so we don't run into any of sun's numbers */
37 M_386 = 100,
38 M_MIPS1 = 151, /* MIPS R3000/R3000 binary */
39 M_MIPS2 = 152 /* MIPS R6000/R4000 binary */
40};
41
42#if !defined (N_MAGIC)
43#define N_MAGIC(exec) ((exec).a_info & 0xffff)
44#endif
45#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
46#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
47#define N_SET_INFO(exec, magic, type, flags) \
48 ((exec).a_info = ((magic) & 0xffff) \
49 | (((int)(type) & 0xff) << 16) \
50 | (((flags) & 0xff) << 24))
51#define N_SET_MAGIC(exec, magic) \
52 ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
53
54#define N_SET_MACHTYPE(exec, machtype) \
55 ((exec).a_info = \
56 ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
57
58#define N_SET_FLAGS(exec, flags) \
59 ((exec).a_info = \
60 ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
61
62/* Code indicating object file or impure executable. */
63#define OMAGIC 0407
64/* Code indicating pure executable. */
65#define NMAGIC 0410
66/* Code indicating demand-paged executable. */
67#define ZMAGIC 0413
68/* This indicates a demand-paged executable with the header in the text.
69 The first page is unmapped to help trap NULL pointer references */
70#define QMAGIC 0314
71
72/* Code indicating core file. */
73#define CMAGIC 0421
74
75#if !defined (N_BADMAG)
76#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
77 && N_MAGIC(x) != NMAGIC \
78 && N_MAGIC(x) != ZMAGIC \
79 && N_MAGIC(x) != QMAGIC)
80#endif
81
82#define _N_HDROFF(x) (1024 - sizeof (struct exec))
83
84#if !defined (N_TXTOFF)
85#define N_TXTOFF(x) \
86 (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
87 (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
88#endif
89
90#if !defined (N_DATOFF)
91#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
92#endif
93
94#if !defined (N_TRELOFF)
95#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
96#endif
97
98#if !defined (N_DRELOFF)
99#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
100#endif
101
102#if !defined (N_SYMOFF)
103#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
104#endif
105
106#if !defined (N_STROFF)
107#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
108#endif
109
110/* Address of text segment in memory after it is loaded. */
111#if !defined (N_TXTADDR)
112#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
113#endif
114
115/* Address of data segment in memory after it is loaded.
116 Note that it is up to you to define SEGMENT_SIZE
117 on machines not listed here. */
118#if defined(vax) || defined(hp300) || defined(pyr)
119#define SEGMENT_SIZE page_size
120#endif
121#ifdef sony
122#define SEGMENT_SIZE 0x2000
123#endif /* Sony. */
124#ifdef is68k
125#define SEGMENT_SIZE 0x20000
126#endif
127#if defined(m68k) && defined(PORTAR)
128#define PAGE_SIZE 0x400
129#define SEGMENT_SIZE PAGE_SIZE
130#endif
131
132#ifdef linux
133#ifndef __KERNEL__
134#include <unistd.h>
135#endif
136#if defined(__i386__) || defined(__mc68000__)
137#define SEGMENT_SIZE 1024
138#else
139#ifndef SEGMENT_SIZE
140#ifndef __KERNEL__
141#define SEGMENT_SIZE getpagesize()
142#endif
143#endif
144#endif
145#endif
146
147#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
148
149#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
150
151#ifndef N_DATADDR
152#define N_DATADDR(x) \
153 (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
154 : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
155#endif
156
157/* Address of bss segment in memory after it is loaded. */
158#if !defined (N_BSSADDR)
159#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
160#endif
161
162#if !defined (N_NLIST_DECLARED)
163struct nlist {
164 union {
165 char *n_name;
166 struct nlist *n_next;
167 long n_strx;
168 } n_un;
169 unsigned char n_type;
170 char n_other;
171 short n_desc;
172 unsigned long n_value;
173};
174#endif /* no N_NLIST_DECLARED. */
175
176#if !defined (N_UNDF)
177#define N_UNDF 0
178#endif
179#if !defined (N_ABS)
180#define N_ABS 2
181#endif
182#if !defined (N_TEXT)
183#define N_TEXT 4
184#endif
185#if !defined (N_DATA)
186#define N_DATA 6
187#endif
188#if !defined (N_BSS)
189#define N_BSS 8
190#endif
191#if !defined (N_FN)
192#define N_FN 15
193#endif
194
195#if !defined (N_EXT)
196#define N_EXT 1
197#endif
198#if !defined (N_TYPE)
199#define N_TYPE 036
200#endif
201#if !defined (N_STAB)
202#define N_STAB 0340
203#endif
204
205/* The following type indicates the definition of a symbol as being
206 an indirect reference to another symbol. The other symbol
207 appears as an undefined reference, immediately following this symbol.
208
209 Indirection is asymmetrical. The other symbol's value will be used
210 to satisfy requests for the indirect symbol, but not vice versa.
211 If the other symbol does not have a definition, libraries will
212 be searched to find a definition. */
213#define N_INDR 0xa
214
215/* The following symbols refer to set elements.
216 All the N_SET[ATDB] symbols with the same name form one set.
217 Space is allocated for the set in the text section, and each set
218 element's value is stored into one word of the space.
219 The first word of the space is the length of the set (number of elements).
220
221 The address of the set is made into an N_SETV symbol
222 whose name is the same as the name of the set.
223 This symbol acts like a N_DATA global symbol
224 in that it can satisfy undefined external references. */
225
226/* These appear as input to LD, in a .o file. */
227#define N_SETA 0x14 /* Absolute set element symbol */
228#define N_SETT 0x16 /* Text set element symbol */
229#define N_SETD 0x18 /* Data set element symbol */
230#define N_SETB 0x1A /* Bss set element symbol */
231
232/* This is output from LD. */
233#define N_SETV 0x1C /* Pointer to set vector in data area. */
234
235#if !defined (N_RELOCATION_INFO_DECLARED)
236/* This structure describes a single relocation to be performed.
237 The text-relocation section of the file is a vector of these structures,
238 all of which apply to the text section.
239 Likewise, the data-relocation section applies to the data section. */
240
241struct relocation_info
242{
243 /* Address (within segment) to be relocated. */
244 int r_address;
245 /* The meaning of r_symbolnum depends on r_extern. */
246 unsigned int r_symbolnum:24;
247 /* Nonzero means value is a pc-relative offset
248 and it should be relocated for changes in its own address
249 as well as for changes in the symbol or section specified. */
250 unsigned int r_pcrel:1;
251 /* Length (as exponent of 2) of the field to be relocated.
252 Thus, a value of 2 indicates 1<<2 bytes. */
253 unsigned int r_length:2;
254 /* 1 => relocate with value of symbol.
255 r_symbolnum is the index of the symbol
256 in file's the symbol table.
257 0 => relocate with the address of a segment.
258 r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
259 (the N_EXT bit may be set also, but signifies nothing). */
260 unsigned int r_extern:1;
261 /* Four bits that aren't used, but when writing an object file
262 it is desirable to clear them. */
263#ifdef NS32K
264 unsigned r_bsr:1;
265 unsigned r_disp:1;
266 unsigned r_pad:2;
267#else
268 unsigned int r_pad:4;
269#endif
270};
271#endif /* no N_RELOCATION_INFO_DECLARED. */
272
273#endif /*__ASSEMBLY__ */
274#endif /* _UAPI__A_OUT_GNU_H__ */
diff --git a/include/uapi/linux/acct.h b/include/uapi/linux/acct.h
new file mode 100644
index 00000000000..11b6ca3e087
--- /dev/null
+++ b/include/uapi/linux/acct.h
@@ -0,0 +1,122 @@
1/*
2 * BSD Process Accounting for Linux - Definitions
3 *
4 * Author: Marco van Wieringen (mvw@planets.elm.net)
5 *
6 * This header file contains the definitions needed to implement
7 * BSD-style process accounting. The kernel accounting code and all
8 * user-level programs that try to do something useful with the
9 * process accounting log must include this file.
10 *
11 * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
12 *
13 */
14
15#ifndef _UAPI_LINUX_ACCT_H
16#define _UAPI_LINUX_ACCT_H
17
18#include <linux/types.h>
19
20#include <asm/param.h>
21#include <asm/byteorder.h>
22
23/*
24 * comp_t is a 16-bit "floating" point number with a 3-bit base 8
25 * exponent and a 13-bit fraction.
26 * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
27 * (leading 1 not stored).
28 * See linux/kernel/acct.c for the specific encoding systems used.
29 */
30
31typedef __u16 comp_t;
32typedef __u32 comp2_t;
33
34/*
35 * accounting file record
36 *
37 * This structure contains all of the information written out to the
38 * process accounting file whenever a process exits.
39 */
40
41#define ACCT_COMM 16
42
43struct acct
44{
45 char ac_flag; /* Flags */
46 char ac_version; /* Always set to ACCT_VERSION */
47 /* for binary compatibility back until 2.0 */
48 __u16 ac_uid16; /* LSB of Real User ID */
49 __u16 ac_gid16; /* LSB of Real Group ID */
50 __u16 ac_tty; /* Control Terminal */
51 __u32 ac_btime; /* Process Creation Time */
52 comp_t ac_utime; /* User Time */
53 comp_t ac_stime; /* System Time */
54 comp_t ac_etime; /* Elapsed Time */
55 comp_t ac_mem; /* Average Memory Usage */
56 comp_t ac_io; /* Chars Transferred */
57 comp_t ac_rw; /* Blocks Read or Written */
58 comp_t ac_minflt; /* Minor Pagefaults */
59 comp_t ac_majflt; /* Major Pagefaults */
60 comp_t ac_swaps; /* Number of Swaps */
61/* m68k had no padding here. */
62#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
63 __u16 ac_ahz; /* AHZ */
64#endif
65 __u32 ac_exitcode; /* Exitcode */
66 char ac_comm[ACCT_COMM + 1]; /* Command Name */
67 __u8 ac_etime_hi; /* Elapsed Time MSB */
68 __u16 ac_etime_lo; /* Elapsed Time LSB */
69 __u32 ac_uid; /* Real User ID */
70 __u32 ac_gid; /* Real Group ID */
71};
72
73struct acct_v3
74{
75 char ac_flag; /* Flags */
76 char ac_version; /* Always set to ACCT_VERSION */
77 __u16 ac_tty; /* Control Terminal */
78 __u32 ac_exitcode; /* Exitcode */
79 __u32 ac_uid; /* Real User ID */
80 __u32 ac_gid; /* Real Group ID */
81 __u32 ac_pid; /* Process ID */
82 __u32 ac_ppid; /* Parent Process ID */
83 __u32 ac_btime; /* Process Creation Time */
84#ifdef __KERNEL__
85 __u32 ac_etime; /* Elapsed Time */
86#else
87 float ac_etime; /* Elapsed Time */
88#endif
89 comp_t ac_utime; /* User Time */
90 comp_t ac_stime; /* System Time */
91 comp_t ac_mem; /* Average Memory Usage */
92 comp_t ac_io; /* Chars Transferred */
93 comp_t ac_rw; /* Blocks Read or Written */
94 comp_t ac_minflt; /* Minor Pagefaults */
95 comp_t ac_majflt; /* Major Pagefaults */
96 comp_t ac_swaps; /* Number of Swaps */
97 char ac_comm[ACCT_COMM]; /* Command Name */
98};
99
100/*
101 * accounting flags
102 */
103 /* bit set when the process ... */
104#define AFORK 0x01 /* ... executed fork, but did not exec */
105#define ASU 0x02 /* ... used super-user privileges */
106#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
107#define ACORE 0x08 /* ... dumped core */
108#define AXSIG 0x10 /* ... was killed by a signal */
109
110#ifdef __BIG_ENDIAN
111#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
112#else
113#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */
114#endif
115
116#ifndef __KERNEL__
117#define ACCT_VERSION 2
118#define AHZ (HZ)
119#endif /* __KERNEL */
120
121
122#endif /* _UAPI_LINUX_ACCT_H */
diff --git a/include/uapi/linux/adb.h b/include/uapi/linux/adb.h
new file mode 100644
index 00000000000..0ea1075fc4a
--- /dev/null
+++ b/include/uapi/linux/adb.h
@@ -0,0 +1,44 @@
1/*
2 * Definitions for ADB (Apple Desktop Bus) support.
3 */
4#ifndef _UAPI__ADB_H
5#define _UAPI__ADB_H
6
7/* ADB commands */
8#define ADB_BUSRESET 0
9#define ADB_FLUSH(id) (0x01 | ((id) << 4))
10#define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
11#define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
12
13/* ADB default device IDs (upper 4 bits of ADB command byte) */
14#define ADB_DONGLE 1 /* "software execution control" devices */
15#define ADB_KEYBOARD 2
16#define ADB_MOUSE 3
17#define ADB_TABLET 4
18#define ADB_MODEM 5
19#define ADB_MISC 7 /* maybe a monitor */
20
21#define ADB_RET_OK 0
22#define ADB_RET_TIMEOUT 3
23
24/* The kind of ADB request. The controller may emulate some
25 or all of those CUDA/PMU packet kinds */
26#define ADB_PACKET 0
27#define CUDA_PACKET 1
28#define ERROR_PACKET 2
29#define TIMER_PACKET 3
30#define POWER_PACKET 4
31#define MACIIC_PACKET 5
32#define PMU_PACKET 6
33#define ADB_QUERY 7
34
35/* ADB queries */
36
37/* ADB_QUERY_GETDEVINFO
38 * Query ADB slot for device presence
39 * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
40 */
41#define ADB_QUERY_GETDEVINFO 1
42
43
44#endif /* _UAPI__ADB_H */
diff --git a/include/uapi/linux/adfs_fs.h b/include/uapi/linux/adfs_fs.h
new file mode 100644
index 00000000000..a1bf43754dd
--- /dev/null
+++ b/include/uapi/linux/adfs_fs.h
@@ -0,0 +1,44 @@
1#ifndef _UAPI_ADFS_FS_H
2#define _UAPI_ADFS_FS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6
7/*
8 * Disc Record at disc address 0xc00
9 */
10struct adfs_discrecord {
11 __u8 log2secsize;
12 __u8 secspertrack;
13 __u8 heads;
14 __u8 density;
15 __u8 idlen;
16 __u8 log2bpmb;
17 __u8 skew;
18 __u8 bootoption;
19 __u8 lowsector;
20 __u8 nzones;
21 __le16 zone_spare;
22 __le32 root;
23 __le32 disc_size;
24 __le16 disc_id;
25 __u8 disc_name[10];
26 __le32 disc_type;
27 __le32 disc_size_high;
28 __u8 log2sharesize:4;
29 __u8 unused40:4;
30 __u8 big_flag:1;
31 __u8 unused41:1;
32 __u8 nzones_high;
33 __le32 format_version;
34 __le32 root_size;
35 __u8 unused52[60 - 52];
36};
37
38#define ADFS_DISCRECORD (0xc00)
39#define ADFS_DR_OFFSET (0x1c0)
40#define ADFS_DR_SIZE 60
41#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
42
43
44#endif /* _UAPI_ADFS_FS_H */
diff --git a/include/linux/affs_hardblocks.h b/include/uapi/linux/affs_hardblocks.h
index f1b948c1f59..f1b948c1f59 100644
--- a/include/linux/affs_hardblocks.h
+++ b/include/uapi/linux/affs_hardblocks.h
diff --git a/include/uapi/linux/agpgart.h b/include/uapi/linux/agpgart.h
new file mode 100644
index 00000000000..4e828cf487b
--- /dev/null
+++ b/include/uapi/linux/agpgart.h
@@ -0,0 +1,113 @@
1/*
2 * AGPGART module version 0.99
3 * Copyright (C) 1999 Jeff Hartmann
4 * Copyright (C) 1999 Precision Insight, Inc.
5 * Copyright (C) 1999 Xi Graphics, Inc.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
27#ifndef _UAPI_AGP_H
28#define _UAPI_AGP_H
29
30#define AGPIOC_BASE 'A'
31#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
32#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
33#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
34#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
35#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
36#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
37#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
38#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
39#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
40#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
41#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
42
43#define AGP_DEVICE "/dev/agpgart"
44
45#ifndef TRUE
46#define TRUE 1
47#endif
48
49#ifndef FALSE
50#define FALSE 0
51#endif
52
53#ifndef __KERNEL__
54#include <linux/types.h>
55
56struct agp_version {
57 __u16 major;
58 __u16 minor;
59};
60
61typedef struct _agp_info {
62 struct agp_version version; /* version of the driver */
63 __u32 bridge_id; /* bridge vendor/device */
64 __u32 agp_mode; /* mode info of bridge */
65 unsigned long aper_base;/* base of aperture */
66 size_t aper_size; /* size of aperture */
67 size_t pg_total; /* max pages (swap + system) */
68 size_t pg_system; /* max pages (system) */
69 size_t pg_used; /* current pages used */
70} agp_info;
71
72typedef struct _agp_setup {
73 __u32 agp_mode; /* mode info of bridge */
74} agp_setup;
75
76/*
77 * The "prot" down below needs still a "sleep" flag somehow ...
78 */
79typedef struct _agp_segment {
80 __kernel_off_t pg_start; /* starting page to populate */
81 __kernel_size_t pg_count; /* number of pages */
82 int prot; /* prot flags for mmap */
83} agp_segment;
84
85typedef struct _agp_region {
86 __kernel_pid_t pid; /* pid of process */
87 __kernel_size_t seg_count; /* number of segments */
88 struct _agp_segment *seg_list;
89} agp_region;
90
91typedef struct _agp_allocate {
92 int key; /* tag of allocation */
93 __kernel_size_t pg_count;/* number of pages */
94 __u32 type; /* 0 == normal, other devspec */
95 __u32 physical; /* device specific (some devices
96 * need a phys address of the
97 * actual page behind the gatt
98 * table) */
99} agp_allocate;
100
101typedef struct _agp_bind {
102 int key; /* tag of allocation */
103 __kernel_off_t pg_start;/* starting page to populate */
104} agp_bind;
105
106typedef struct _agp_unbind {
107 int key; /* tag of allocation */
108 __u32 priority; /* priority for paging out */
109} agp_unbind;
110
111#endif /* __KERNEL__ */
112
113#endif /* _UAPI_AGP_H */
diff --git a/include/linux/aio_abi.h b/include/uapi/linux/aio_abi.h
index 86fa7a71336..86fa7a71336 100644
--- a/include/linux/aio_abi.h
+++ b/include/uapi/linux/aio_abi.h
diff --git a/include/uapi/linux/apm_bios.h b/include/uapi/linux/apm_bios.h
new file mode 100644
index 00000000000..724f409adae
--- /dev/null
+++ b/include/uapi/linux/apm_bios.h
@@ -0,0 +1,135 @@
1/*
2 * Include file for the interface to an APM BIOS
3 * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2, or (at your option) any
8 * later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15#ifndef _UAPI_LINUX_APM_H
16#define _UAPI_LINUX_APM_H
17
18
19#include <linux/types.h>
20
21typedef unsigned short apm_event_t;
22typedef unsigned short apm_eventinfo_t;
23
24struct apm_bios_info {
25 __u16 version;
26 __u16 cseg;
27 __u32 offset;
28 __u16 cseg_16;
29 __u16 dseg;
30 __u16 flags;
31 __u16 cseg_len;
32 __u16 cseg_16_len;
33 __u16 dseg_len;
34};
35
36
37/*
38 * Power states
39 */
40#define APM_STATE_READY 0x0000
41#define APM_STATE_STANDBY 0x0001
42#define APM_STATE_SUSPEND 0x0002
43#define APM_STATE_OFF 0x0003
44#define APM_STATE_BUSY 0x0004
45#define APM_STATE_REJECT 0x0005
46#define APM_STATE_OEM_SYS 0x0020
47#define APM_STATE_OEM_DEV 0x0040
48
49#define APM_STATE_DISABLE 0x0000
50#define APM_STATE_ENABLE 0x0001
51
52#define APM_STATE_DISENGAGE 0x0000
53#define APM_STATE_ENGAGE 0x0001
54
55/*
56 * Events (results of Get PM Event)
57 */
58#define APM_SYS_STANDBY 0x0001
59#define APM_SYS_SUSPEND 0x0002
60#define APM_NORMAL_RESUME 0x0003
61#define APM_CRITICAL_RESUME 0x0004
62#define APM_LOW_BATTERY 0x0005
63#define APM_POWER_STATUS_CHANGE 0x0006
64#define APM_UPDATE_TIME 0x0007
65#define APM_CRITICAL_SUSPEND 0x0008
66#define APM_USER_STANDBY 0x0009
67#define APM_USER_SUSPEND 0x000a
68#define APM_STANDBY_RESUME 0x000b
69#define APM_CAPABILITY_CHANGE 0x000c
70
71/*
72 * Error codes
73 */
74#define APM_SUCCESS 0x00
75#define APM_DISABLED 0x01
76#define APM_CONNECTED 0x02
77#define APM_NOT_CONNECTED 0x03
78#define APM_16_CONNECTED 0x05
79#define APM_16_UNSUPPORTED 0x06
80#define APM_32_CONNECTED 0x07
81#define APM_32_UNSUPPORTED 0x08
82#define APM_BAD_DEVICE 0x09
83#define APM_BAD_PARAM 0x0a
84#define APM_NOT_ENGAGED 0x0b
85#define APM_BAD_FUNCTION 0x0c
86#define APM_RESUME_DISABLED 0x0d
87#define APM_NO_ERROR 0x53
88#define APM_BAD_STATE 0x60
89#define APM_NO_EVENTS 0x80
90#define APM_NOT_PRESENT 0x86
91
92/*
93 * APM Device IDs
94 */
95#define APM_DEVICE_BIOS 0x0000
96#define APM_DEVICE_ALL 0x0001
97#define APM_DEVICE_DISPLAY 0x0100
98#define APM_DEVICE_STORAGE 0x0200
99#define APM_DEVICE_PARALLEL 0x0300
100#define APM_DEVICE_SERIAL 0x0400
101#define APM_DEVICE_NETWORK 0x0500
102#define APM_DEVICE_PCMCIA 0x0600
103#define APM_DEVICE_BATTERY 0x8000
104#define APM_DEVICE_OEM 0xe000
105#define APM_DEVICE_OLD_ALL 0xffff
106#define APM_DEVICE_CLASS 0x00ff
107#define APM_DEVICE_MASK 0xff00
108
109
110/*
111 * Battery status
112 */
113#define APM_MAX_BATTERIES 2
114
115/*
116 * APM defined capability bit flags
117 */
118#define APM_CAP_GLOBAL_STANDBY 0x0001
119#define APM_CAP_GLOBAL_SUSPEND 0x0002
120#define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */
121#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */
122#define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
123#define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
124#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */
125#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */
126
127/*
128 * ioctl operations
129 */
130#include <linux/ioctl.h>
131
132#define APM_IOC_STANDBY _IO('A', 1)
133#define APM_IOC_SUSPEND _IO('A', 2)
134
135#endif /* _UAPI_LINUX_APM_H */
diff --git a/include/linux/arcfb.h b/include/uapi/linux/arcfb.h
index 721e7654dae..721e7654dae 100644
--- a/include/linux/arcfb.h
+++ b/include/uapi/linux/arcfb.h
diff --git a/include/uapi/linux/atalk.h b/include/uapi/linux/atalk.h
new file mode 100644
index 00000000000..4bcd596e638
--- /dev/null
+++ b/include/uapi/linux/atalk.h
@@ -0,0 +1,44 @@
1#ifndef _UAPI__LINUX_ATALK_H__
2#define _UAPI__LINUX_ATALK_H__
3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6#include <linux/socket.h>
7
8/*
9 * AppleTalk networking structures
10 *
11 * The following are directly referenced from the University Of Michigan
12 * netatalk for compatibility reasons.
13 */
14#define ATPORT_FIRST 1
15#define ATPORT_RESERVED 128
16#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
17#define ATADDR_ANYNET (__u16)0
18#define ATADDR_ANYNODE (__u8)0
19#define ATADDR_ANYPORT (__u8)0
20#define ATADDR_BCAST (__u8)255
21#define DDP_MAXSZ 587
22#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
23
24#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
25
26struct atalk_addr {
27 __be16 s_net;
28 __u8 s_node;
29};
30
31struct sockaddr_at {
32 __kernel_sa_family_t sat_family;
33 __u8 sat_port;
34 struct atalk_addr sat_addr;
35 char sat_zero[8];
36};
37
38struct atalk_netrange {
39 __u8 nr_phase;
40 __be16 nr_firstnet;
41 __be16 nr_lastnet;
42};
43
44#endif /* _UAPI__LINUX_ATALK_H__ */
diff --git a/include/uapi/linux/atm.h b/include/uapi/linux/atm.h
new file mode 100644
index 00000000000..88399db602a
--- /dev/null
+++ b/include/uapi/linux/atm.h
@@ -0,0 +1,241 @@
1/* atm.h - general ATM declarations */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6/*
7 * WARNING: User-space programs should not #include <linux/atm.h> directly.
8 * Instead, #include <atm.h>
9 */
10
11#ifndef _UAPI_LINUX_ATM_H
12#define _UAPI_LINUX_ATM_H
13
14/*
15 * BEGIN_xx and END_xx markers are used for automatic generation of
16 * documentation. Do not change them.
17 */
18
19#include <linux/compiler.h>
20#include <linux/atmapi.h>
21#include <linux/atmsap.h>
22#include <linux/atmioc.h>
23#include <linux/types.h>
24
25
26/* general ATM constants */
27#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */
28#define ATM_CELL_PAYLOAD 48 /* ATM payload size */
29#define ATM_AAL0_SDU 52 /* AAL0 SDU size */
30#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */
31#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */
32#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */
33#define ATM_MAX_CDV 9999 /* maximum (default) CDV */
34#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */
35
36#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */
37#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */
38#define ATM_MAX_VCI 65535 /* maximum VCI */
39
40
41/* "protcol" values for the socket system call */
42#define ATM_NO_AAL 0 /* AAL not specified */
43#define ATM_AAL0 13 /* "raw" ATM cells */
44#define ATM_AAL1 1 /* AAL1 (CBR) */
45#define ATM_AAL2 2 /* AAL2 (VBR) */
46#define ATM_AAL34 3 /* AAL3/4 (data) */
47#define ATM_AAL5 5 /* AAL5 (data) */
48
49/*
50 * socket option name coding functions
51 *
52 * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
53 * << 22 only reserves 9 bits for the level. On some architectures
54 * SOL_SOCKET is 0xFFFF, so that's a bit of a problem
55 */
56
57#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \
58 sizeof(t))
59#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
60#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
61#define __SO_SIZE(c) ((c) & 0x3fff)
62
63/*
64 * ATM layer
65 */
66
67#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
68 /* set CLP bit value - TODO */
69#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
70 /* connection identifier range; socket must be
71 bound or connected */
72#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
73 /* Quality of Service setting */
74#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
75 /* Service Access Point */
76#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
77 /* "PVC" address (also for SVCs); get only */
78#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
79 /* make this vc a p2mp */
80
81
82/*
83 * Note @@@: since the socket layers don't really distinguish the control and
84 * the data plane but generally seems to be data plane-centric, any layer is
85 * about equally wrong for the SAP. If you have a better idea about this,
86 * please speak up ...
87 */
88
89
90/* ATM cell header (for AAL0) */
91
92/* BEGIN_CH */
93#define ATM_HDR_GFC_MASK 0xf0000000
94#define ATM_HDR_GFC_SHIFT 28
95#define ATM_HDR_VPI_MASK 0x0ff00000
96#define ATM_HDR_VPI_SHIFT 20
97#define ATM_HDR_VCI_MASK 0x000ffff0
98#define ATM_HDR_VCI_SHIFT 4
99#define ATM_HDR_PTI_MASK 0x0000000e
100#define ATM_HDR_PTI_SHIFT 1
101#define ATM_HDR_CLP 0x00000001
102/* END_CH */
103
104
105/* PTI codings */
106
107/* BEGIN_PTI */
108#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */
109#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */
110#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */
111#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */
112#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */
113#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */
114#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */
115#define ATM_PTI_RSV 7 /* reserved */
116/* END_PTI */
117
118
119/*
120 * The following items should stay in linux/atm.h, which should be linked to
121 * netatm/atm.h
122 */
123
124/* Traffic description */
125
126#define ATM_NONE 0 /* no traffic */
127#define ATM_UBR 1
128#define ATM_CBR 2
129#define ATM_VBR 3
130#define ATM_ABR 4
131#define ATM_ANYCLASS 5 /* compatible with everything */
132
133#define ATM_MAX_PCR -1 /* maximum available PCR */
134
135struct atm_trafprm {
136 unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */
137 int max_pcr; /* maximum PCR in cells per second */
138 int pcr; /* desired PCR in cells per second */
139 int min_pcr; /* minimum PCR in cells per second */
140 int max_cdv; /* maximum CDV in microseconds */
141 int max_sdu; /* maximum SDU in bytes */
142 /* extra params for ABR */
143 unsigned int icr; /* Initial Cell Rate (24-bit) */
144 unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
145 unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */
146 unsigned int rif : 4; /* Rate Increment Factor (4-bit) */
147 unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */
148 unsigned int nrm_pres :1; /* nrm present bit */
149 unsigned int trm_pres :1; /* rm present bit */
150 unsigned int adtf_pres :1; /* adtf present bit */
151 unsigned int cdf_pres :1; /* cdf present bit*/
152 unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */
153 unsigned int trm :3; /* Time between forward RM cells (3-bit) */
154 unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */
155 unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */
156 unsigned int spare :9; /* spare bits */
157};
158
159struct atm_qos {
160 struct atm_trafprm txtp; /* parameters in TX direction */
161 struct atm_trafprm rxtp __ATM_API_ALIGN;
162 /* parameters in RX direction */
163 unsigned char aal __ATM_API_ALIGN;
164};
165
166/* PVC addressing */
167
168#define ATM_ITF_ANY -1 /* "magic" PVC address values */
169#define ATM_VPI_ANY -1
170#define ATM_VCI_ANY -1
171#define ATM_VPI_UNSPEC -2
172#define ATM_VCI_UNSPEC -2
173
174
175struct sockaddr_atmpvc {
176 unsigned short sap_family; /* address family, AF_ATMPVC */
177 struct { /* PVC address */
178 short itf; /* ATM interface */
179 short vpi; /* VPI (only 8 bits at UNI) */
180 int vci; /* VCI (only 16 bits at UNI) */
181 } sap_addr __ATM_API_ALIGN; /* PVC address */
182};
183
184/* SVC addressing */
185
186#define ATM_ESA_LEN 20 /* ATM End System Address length */
187#define ATM_E164_LEN 12 /* maximum E.164 number length */
188
189#define ATM_AFI_DCC 0x39 /* DCC ATM Format */
190#define ATM_AFI_ICD 0x47 /* ICD ATM Format */
191#define ATM_AFI_E164 0x45 /* E.164 ATM Format */
192#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */
193
194#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */
195#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */
196#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */
197#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */
198
199#define ATM_LIJ_NONE 0 /* no leaf-initiated join */
200#define ATM_LIJ 1 /* request joining */
201#define ATM_LIJ_RPJ 2 /* set to root-prompted join */
202#define ATM_LIJ_NJ 3 /* set to network join */
203
204
205struct sockaddr_atmsvc {
206 unsigned short sas_family; /* address family, AF_ATMSVC */
207 struct { /* SVC address */
208 unsigned char prv[ATM_ESA_LEN];/* private ATM address */
209 char pub[ATM_E164_LEN+1]; /* public address (E.164) */
210 /* unused addresses must be bzero'ed */
211 char lij_type; /* role in LIJ call; one of ATM_LIJ* */
212 __u32 lij_id; /* LIJ call identifier */
213 } sas_addr __ATM_API_ALIGN; /* SVC address */
214};
215
216
217static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
218{
219 return *addr.sas_addr.prv || *addr.sas_addr.pub;
220}
221
222
223static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
224{
225 return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
226}
227
228
229/*
230 * Some stuff for linux/sockios.h
231 */
232
233struct atmif_sioc {
234 int number;
235 int length;
236 void __user *arg;
237};
238
239
240typedef unsigned short atm_backend_t;
241#endif /* _UAPI_LINUX_ATM_H */
diff --git a/include/linux/atm_eni.h b/include/uapi/linux/atm_eni.h
index 34f31797255..34f31797255 100644
--- a/include/linux/atm_eni.h
+++ b/include/uapi/linux/atm_eni.h
diff --git a/include/linux/atm_he.h b/include/uapi/linux/atm_he.h
index 2a7713b597c..2a7713b597c 100644
--- a/include/linux/atm_he.h
+++ b/include/uapi/linux/atm_he.h
diff --git a/include/linux/atm_idt77105.h b/include/uapi/linux/atm_idt77105.h
index 8b724000aa5..8b724000aa5 100644
--- a/include/linux/atm_idt77105.h
+++ b/include/uapi/linux/atm_idt77105.h
diff --git a/include/linux/atm_nicstar.h b/include/uapi/linux/atm_nicstar.h
index 577b79f33e8..577b79f33e8 100644
--- a/include/linux/atm_nicstar.h
+++ b/include/uapi/linux/atm_nicstar.h
diff --git a/include/uapi/linux/atm_tcp.h b/include/uapi/linux/atm_tcp.h
new file mode 100644
index 00000000000..914e821da64
--- /dev/null
+++ b/include/uapi/linux/atm_tcp.h
@@ -0,0 +1,61 @@
1/* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by
2 driver-specific utilities) */
3
4/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
5
6
7#ifndef _UAPILINUX_ATM_TCP_H
8#define _UAPILINUX_ATM_TCP_H
9
10#include <linux/atmapi.h>
11#include <linux/atm.h>
12#include <linux/atmioc.h>
13#include <linux/types.h>
14
15
16/*
17 * All values in struct atmtcp_hdr are in network byte order
18 */
19
20struct atmtcp_hdr {
21 __u16 vpi;
22 __u16 vci;
23 __u32 length; /* ... of data part */
24};
25
26/*
27 * All values in struct atmtcp_command are in host byte order
28 */
29
30#define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */
31#define ATMTCP_CTRL_OPEN 1 /* request/reply */
32#define ATMTCP_CTRL_CLOSE 2 /* request/reply */
33
34struct atmtcp_control {
35 struct atmtcp_hdr hdr; /* must be first */
36 int type; /* message type; both directions */
37 atm_kptr_t vcc; /* both directions */
38 struct sockaddr_atmpvc addr; /* suggested value from kernel */
39 struct atm_qos qos; /* both directions */
40 int result; /* to kernel only */
41} __ATM_API_ALIGN;
42
43/*
44 * Field usage:
45 * Messge type dir. hdr.v?i type addr qos vcc result
46 * ----------- ---- ------- ---- ---- --- --- ------
47 * OPEN K->D Y Y Y Y Y 0
48 * OPEN D->K - Y Y Y Y Y
49 * CLOSE K->D - - Y - Y 0
50 * CLOSE D->K - - - - Y Y
51 */
52
53#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */
54#define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP
55 interface */
56#define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP
57 interface */
58
59
60
61#endif /* _UAPILINUX_ATM_TCP_H */
diff --git a/include/linux/atm_zatm.h b/include/uapi/linux/atm_zatm.h
index 10f0fa29454..10f0fa29454 100644
--- a/include/linux/atm_zatm.h
+++ b/include/uapi/linux/atm_zatm.h
diff --git a/include/linux/atmapi.h b/include/uapi/linux/atmapi.h
index 8fe54d90d95..8fe54d90d95 100644
--- a/include/linux/atmapi.h
+++ b/include/uapi/linux/atmapi.h
diff --git a/include/linux/atmarp.h b/include/uapi/linux/atmarp.h
index 231f4bdec73..231f4bdec73 100644
--- a/include/linux/atmarp.h
+++ b/include/uapi/linux/atmarp.h
diff --git a/include/linux/atmbr2684.h b/include/uapi/linux/atmbr2684.h
index fdb2629b618..fdb2629b618 100644
--- a/include/linux/atmbr2684.h
+++ b/include/uapi/linux/atmbr2684.h
diff --git a/include/linux/atmclip.h b/include/uapi/linux/atmclip.h
index 02c94c448dd..02c94c448dd 100644
--- a/include/linux/atmclip.h
+++ b/include/uapi/linux/atmclip.h
diff --git a/include/uapi/linux/atmdev.h b/include/uapi/linux/atmdev.h
new file mode 100644
index 00000000000..93e0ec008ca
--- /dev/null
+++ b/include/uapi/linux/atmdev.h
@@ -0,0 +1,215 @@
1/* atmdev.h - ATM device driver declarations and various related items */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef _UAPILINUX_ATMDEV_H
7#define _UAPILINUX_ATMDEV_H
8
9
10#include <linux/atmapi.h>
11#include <linux/atm.h>
12#include <linux/atmioc.h>
13
14
15#define ESI_LEN 6
16
17#define ATM_OC3_PCR (155520000/270*260/8/53)
18 /* OC3 link rate: 155520000 bps
19 SONET overhead: /270*260 (9 section, 1 path)
20 bits per cell: /8/53
21 max cell rate: 353207.547 cells/sec */
22#define ATM_25_PCR ((25600000/8-8000)/54)
23 /* 25 Mbps ATM cell rate (59111) */
24#define ATM_OC12_PCR (622080000/1080*1040/8/53)
25 /* OC12 link rate: 622080000 bps
26 SONET overhead: /1080*1040
27 bits per cell: /8/53
28 max cell rate: 1412830.188 cells/sec */
29#define ATM_DS3_PCR (8000*12)
30 /* DS3: 12 cells in a 125 usec time slot */
31
32
33#define __AAL_STAT_ITEMS \
34 __HANDLE_ITEM(tx); /* TX okay */ \
35 __HANDLE_ITEM(tx_err); /* TX errors */ \
36 __HANDLE_ITEM(rx); /* RX okay */ \
37 __HANDLE_ITEM(rx_err); /* RX errors */ \
38 __HANDLE_ITEM(rx_drop); /* RX out of memory */
39
40struct atm_aal_stats {
41#define __HANDLE_ITEM(i) int i
42 __AAL_STAT_ITEMS
43#undef __HANDLE_ITEM
44};
45
46
47struct atm_dev_stats {
48 struct atm_aal_stats aal0;
49 struct atm_aal_stats aal34;
50 struct atm_aal_stats aal5;
51} __ATM_API_ALIGN;
52
53
54#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
55 /* get link rate */
56#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
57 /* get interface names (numbers) */
58#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
59 /* get interface type name */
60#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
61 /* get interface ESI */
62#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
63 /* get itf's local ATM addr. list */
64#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
65 /* reset itf's ATM address list */
66#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
67 /* add a local ATM address */
68#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
69 /* remove a local ATM address */
70#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
71 /* get connection identifier range */
72#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
73 /* set connection identifier range */
74#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
75 /* set interface ESI */
76#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
77 /* force interface ESI */
78#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
79 /* register a LECS address */
80#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
81 /* unregister a LECS address */
82#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
83 /* retrieve LECS address(es) */
84
85#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
86 /* get AAL layer statistics */
87#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
88 /* get AAL layer statistics and zero */
89#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
90 /* get loopback mode */
91#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
92 /* set loopback mode */
93#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
94 /* query supported loopback modes */
95#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
96 /* enable or disable single-copy */
97#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
98 /* set backend handler */
99#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
100 /* use backend to make new if */
101#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
102 /* add party to p2mp call */
103#ifdef CONFIG_COMPAT
104/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
105#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
106#endif
107#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
108 /* drop party from p2mp call */
109
110/*
111 * These are backend handkers that can be set via the ATM_SETBACKEND call
112 * above. In the future we may support dynamic loading of these - for now,
113 * they're just being used to share the ATMIOC_BACKEND ioctls
114 */
115#define ATM_BACKEND_RAW 0
116#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
117#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
118
119/* for ATM_GETTYPE */
120#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
121
122/*
123 * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
124 */
125
126/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
127#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
128#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
129#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
130/* RESERVED 4 loop back on PHY side ---' */
131#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
132#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
133
134/* Direction of loopback */
135#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
136#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
137
138#define __ATM_LM_XTLOC(n) ((n) & 0xff)
139#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
140
141#define ATM_LM_NONE 0 /* no loopback */
142
143#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
144#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
145#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
146#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
147
148#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
149#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
150#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
151#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
152
153/*
154 * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
155 * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
156 */
157
158
159struct atm_iobuf {
160 int length;
161 void __user *buffer;
162};
163
164/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
165
166#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
167
168struct atm_cirange {
169 signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
170 signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
171};
172
173/* for ATM_SETSC; actually taken from the ATM_VF number space */
174
175#define ATM_SC_RX 1024 /* enable RX single-copy */
176#define ATM_SC_TX 2048 /* enable TX single-copy */
177
178#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
179 anyway */
180
181/* MF: change_qos (Modify) flags */
182
183#define ATM_MF_IMMED 1 /* Block until change is effective */
184#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
185#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
186#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
187#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
188#define ATM_MF_BWD 32 /* Set the backward direction parameters */
189
190#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
191 ATM_MF_DEC_SHP | ATM_MF_BWD)
192
193/*
194 * ATM_VS_* are used to express VC state in a human-friendly way.
195 */
196
197#define ATM_VS_IDLE 0 /* VC is not used */
198#define ATM_VS_CONNECTED 1 /* VC is connected */
199#define ATM_VS_CLOSING 2 /* VC is closing */
200#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
201#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
202#define ATM_VS_BOUND 5 /* VC is bound */
203
204#define ATM_VS2TXT_MAP \
205 "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
206
207#define ATM_VF2TXT_MAP \
208 "ADDR", "READY", "PARTIAL", "REGIS", \
209 "RELEASED", "HASQOS", "LISTEN", "META", \
210 "256", "512", "1024", "2048", \
211 "SESSION", "HASSAP", "BOUND", "CLOSE"
212
213
214
215#endif /* _UAPILINUX_ATMDEV_H */
diff --git a/include/linux/atmioc.h b/include/uapi/linux/atmioc.h
index 37f67aa8f1c..37f67aa8f1c 100644
--- a/include/linux/atmioc.h
+++ b/include/uapi/linux/atmioc.h
diff --git a/include/linux/atmlec.h b/include/uapi/linux/atmlec.h
index 302791e3ab2..302791e3ab2 100644
--- a/include/linux/atmlec.h
+++ b/include/uapi/linux/atmlec.h
diff --git a/include/linux/atmmpc.h b/include/uapi/linux/atmmpc.h
index 2aba5787fa6..2aba5787fa6 100644
--- a/include/linux/atmmpc.h
+++ b/include/uapi/linux/atmmpc.h
diff --git a/include/linux/atmppp.h b/include/uapi/linux/atmppp.h
index 300dcce0c83..300dcce0c83 100644
--- a/include/linux/atmppp.h
+++ b/include/uapi/linux/atmppp.h
diff --git a/include/linux/atmsap.h b/include/uapi/linux/atmsap.h
index 799b104515d..799b104515d 100644
--- a/include/linux/atmsap.h
+++ b/include/uapi/linux/atmsap.h
diff --git a/include/linux/atmsvc.h b/include/uapi/linux/atmsvc.h
index aa71583b8da..aa71583b8da 100644
--- a/include/linux/atmsvc.h
+++ b/include/uapi/linux/atmsvc.h
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
new file mode 100644
index 00000000000..76352ac45f2
--- /dev/null
+++ b/include/uapi/linux/audit.h
@@ -0,0 +1,404 @@
1/* audit.h -- Auditing support
2 *
3 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
4 * All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Written by Rickard E. (Rik) Faith <faith@redhat.com>
21 *
22 */
23
24#ifndef _UAPI_LINUX_AUDIT_H_
25#define _UAPI_LINUX_AUDIT_H_
26
27#include <linux/types.h>
28#include <linux/elf-em.h>
29#include <linux/ptrace.h>
30
31/* The netlink messages for the audit system is divided into blocks:
32 * 1000 - 1099 are for commanding the audit system
33 * 1100 - 1199 user space trusted application messages
34 * 1200 - 1299 messages internal to the audit daemon
35 * 1300 - 1399 audit event messages
36 * 1400 - 1499 SE Linux use
37 * 1500 - 1599 kernel LSPP events
38 * 1600 - 1699 kernel crypto events
39 * 1700 - 1799 kernel anomaly records
40 * 1800 - 1899 kernel integrity events
41 * 1900 - 1999 future kernel use
42 * 2000 is for otherwise unclassified kernel audit messages (legacy)
43 * 2001 - 2099 unused (kernel)
44 * 2100 - 2199 user space anomaly records
45 * 2200 - 2299 user space actions taken in response to anomalies
46 * 2300 - 2399 user space generated LSPP events
47 * 2400 - 2499 user space crypto events
48 * 2500 - 2999 future user space (maybe integrity labels and related events)
49 *
50 * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
51 * exclusively user space. 1300-2099 is kernel --> user space
52 * communication.
53 */
54#define AUDIT_GET 1000 /* Get status */
55#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
56#define AUDIT_LIST 1002 /* List syscall rules -- deprecated */
57#define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */
58#define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */
59#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
60#define AUDIT_LOGIN 1006 /* Define the login id and information */
61#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
62#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
63#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
64#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
65#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
66#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
67#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
68#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
69#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
70#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
71#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
72
73#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
74#define AUDIT_USER_AVC 1107 /* We filter this differently */
75#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
76#define AUDIT_LAST_USER_MSG 1199
77#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
78#define AUDIT_LAST_USER_MSG2 2999
79
80#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
81#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
82#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
83#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
84
85#define AUDIT_SYSCALL 1300 /* Syscall event */
86/* #define AUDIT_FS_WATCH 1301 * Deprecated */
87#define AUDIT_PATH 1302 /* Filename path information */
88#define AUDIT_IPC 1303 /* IPC record */
89#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
90#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
91#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
92#define AUDIT_CWD 1307 /* Current working directory */
93#define AUDIT_EXECVE 1309 /* execve arguments */
94#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
95#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
96#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
97#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
98#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
99#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
100#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
101#define AUDIT_OBJ_PID 1318 /* ptrace target */
102#define AUDIT_TTY 1319 /* Input on an administrative TTY */
103#define AUDIT_EOE 1320 /* End of multi-record event */
104#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
105#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
106#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
107#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */
108#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */
109
110#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
111#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
112#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
113#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
114#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
115#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
116#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
117#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
118#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
119#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
120#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
121#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */
122#define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */
123#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */
124#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
125#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
126#define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */
127#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */
128
129#define AUDIT_FIRST_KERN_ANOM_MSG 1700
130#define AUDIT_LAST_KERN_ANOM_MSG 1799
131#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
132#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
133#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
134#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
135#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
136#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
137#define AUDIT_INTEGRITY_HASH 1803 /* Integrity HASH type */
138#define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */
139#define AUDIT_INTEGRITY_RULE 1805 /* policy rule */
140
141#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
142
143/* Rule flags */
144#define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */
145#define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */
146#define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */
147#define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */
148#define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */
149#define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */
150
151#define AUDIT_NR_FILTERS 6
152
153#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
154
155/* Rule actions */
156#define AUDIT_NEVER 0 /* Do not build context if rule matches */
157#define AUDIT_POSSIBLE 1 /* Build context if rule matches */
158#define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */
159
160/* Rule structure sizes -- if these change, different AUDIT_ADD and
161 * AUDIT_LIST commands must be implemented. */
162#define AUDIT_MAX_FIELDS 64
163#define AUDIT_MAX_KEY_LEN 256
164#define AUDIT_BITMASK_SIZE 64
165#define AUDIT_WORD(nr) ((__u32)((nr)/32))
166#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
167
168#define AUDIT_SYSCALL_CLASSES 16
169#define AUDIT_CLASS_DIR_WRITE 0
170#define AUDIT_CLASS_DIR_WRITE_32 1
171#define AUDIT_CLASS_CHATTR 2
172#define AUDIT_CLASS_CHATTR_32 3
173#define AUDIT_CLASS_READ 4
174#define AUDIT_CLASS_READ_32 5
175#define AUDIT_CLASS_WRITE 6
176#define AUDIT_CLASS_WRITE_32 7
177#define AUDIT_CLASS_SIGNAL 8
178#define AUDIT_CLASS_SIGNAL_32 9
179
180/* This bitmask is used to validate user input. It represents all bits that
181 * are currently used in an audit field constant understood by the kernel.
182 * If you are adding a new #define AUDIT_<whatever>, please ensure that
183 * AUDIT_UNUSED_BITS is updated if need be. */
184#define AUDIT_UNUSED_BITS 0x07FFFC00
185
186/* AUDIT_FIELD_COMPARE rule list */
187#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
188#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
189#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
190#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
191#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
192#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
193#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
194#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
195#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
196
197#define AUDIT_COMPARE_UID_TO_AUID 10
198#define AUDIT_COMPARE_UID_TO_EUID 11
199#define AUDIT_COMPARE_UID_TO_FSUID 12
200#define AUDIT_COMPARE_UID_TO_SUID 13
201
202#define AUDIT_COMPARE_AUID_TO_FSUID 14
203#define AUDIT_COMPARE_AUID_TO_SUID 15
204#define AUDIT_COMPARE_AUID_TO_EUID 16
205
206#define AUDIT_COMPARE_EUID_TO_SUID 17
207#define AUDIT_COMPARE_EUID_TO_FSUID 18
208
209#define AUDIT_COMPARE_SUID_TO_FSUID 19
210
211#define AUDIT_COMPARE_GID_TO_EGID 20
212#define AUDIT_COMPARE_GID_TO_FSGID 21
213#define AUDIT_COMPARE_GID_TO_SGID 22
214
215#define AUDIT_COMPARE_EGID_TO_FSGID 23
216#define AUDIT_COMPARE_EGID_TO_SGID 24
217#define AUDIT_COMPARE_SGID_TO_FSGID 25
218
219#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID
220
221/* Rule fields */
222 /* These are useful when checking the
223 * task structure at task creation time
224 * (AUDIT_PER_TASK). */
225#define AUDIT_PID 0
226#define AUDIT_UID 1
227#define AUDIT_EUID 2
228#define AUDIT_SUID 3
229#define AUDIT_FSUID 4
230#define AUDIT_GID 5
231#define AUDIT_EGID 6
232#define AUDIT_SGID 7
233#define AUDIT_FSGID 8
234#define AUDIT_LOGINUID 9
235#define AUDIT_PERS 10
236#define AUDIT_ARCH 11
237#define AUDIT_MSGTYPE 12
238#define AUDIT_SUBJ_USER 13 /* security label user */
239#define AUDIT_SUBJ_ROLE 14 /* security label role */
240#define AUDIT_SUBJ_TYPE 15 /* security label type */
241#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
242#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
243#define AUDIT_PPID 18
244#define AUDIT_OBJ_USER 19
245#define AUDIT_OBJ_ROLE 20
246#define AUDIT_OBJ_TYPE 21
247#define AUDIT_OBJ_LEV_LOW 22
248#define AUDIT_OBJ_LEV_HIGH 23
249
250 /* These are ONLY useful when checking
251 * at syscall exit time (AUDIT_AT_EXIT). */
252#define AUDIT_DEVMAJOR 100
253#define AUDIT_DEVMINOR 101
254#define AUDIT_INODE 102
255#define AUDIT_EXIT 103
256#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
257#define AUDIT_WATCH 105
258#define AUDIT_PERM 106
259#define AUDIT_DIR 107
260#define AUDIT_FILETYPE 108
261#define AUDIT_OBJ_UID 109
262#define AUDIT_OBJ_GID 110
263#define AUDIT_FIELD_COMPARE 111
264
265#define AUDIT_ARG0 200
266#define AUDIT_ARG1 (AUDIT_ARG0+1)
267#define AUDIT_ARG2 (AUDIT_ARG0+2)
268#define AUDIT_ARG3 (AUDIT_ARG0+3)
269
270#define AUDIT_FILTERKEY 210
271
272#define AUDIT_NEGATE 0x80000000
273
274/* These are the supported operators.
275 * 4 2 1 8
276 * = > < ?
277 * ----------
278 * 0 0 0 0 00 nonsense
279 * 0 0 0 1 08 & bit mask
280 * 0 0 1 0 10 <
281 * 0 1 0 0 20 >
282 * 0 1 1 0 30 !=
283 * 1 0 0 0 40 =
284 * 1 0 0 1 48 &= bit test
285 * 1 0 1 0 50 <=
286 * 1 1 0 0 60 >=
287 * 1 1 1 1 78 all operators
288 */
289#define AUDIT_BIT_MASK 0x08000000
290#define AUDIT_LESS_THAN 0x10000000
291#define AUDIT_GREATER_THAN 0x20000000
292#define AUDIT_NOT_EQUAL 0x30000000
293#define AUDIT_EQUAL 0x40000000
294#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
295#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
296#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
297#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
298
299enum {
300 Audit_equal,
301 Audit_not_equal,
302 Audit_bitmask,
303 Audit_bittest,
304 Audit_lt,
305 Audit_gt,
306 Audit_le,
307 Audit_ge,
308 Audit_bad
309};
310
311/* Status symbols */
312 /* Mask values */
313#define AUDIT_STATUS_ENABLED 0x0001
314#define AUDIT_STATUS_FAILURE 0x0002
315#define AUDIT_STATUS_PID 0x0004
316#define AUDIT_STATUS_RATE_LIMIT 0x0008
317#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
318 /* Failure-to-log actions */
319#define AUDIT_FAIL_SILENT 0
320#define AUDIT_FAIL_PRINTK 1
321#define AUDIT_FAIL_PANIC 2
322
323/* distinguish syscall tables */
324#define __AUDIT_ARCH_64BIT 0x80000000
325#define __AUDIT_ARCH_LE 0x40000000
326#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
327#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
328#define AUDIT_ARCH_ARMEB (EM_ARM)
329#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
330#define AUDIT_ARCH_FRV (EM_FRV)
331#define AUDIT_ARCH_H8300 (EM_H8_300)
332#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
333#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
334#define AUDIT_ARCH_M32R (EM_M32R)
335#define AUDIT_ARCH_M68K (EM_68K)
336#define AUDIT_ARCH_MIPS (EM_MIPS)
337#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
338#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
339#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
340#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
341#define AUDIT_ARCH_PARISC (EM_PARISC)
342#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
343#define AUDIT_ARCH_PPC (EM_PPC)
344#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
345#define AUDIT_ARCH_S390 (EM_S390)
346#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
347#define AUDIT_ARCH_SH (EM_SH)
348#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
349#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
350#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
351#define AUDIT_ARCH_SPARC (EM_SPARC)
352#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
353#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
354
355#define AUDIT_PERM_EXEC 1
356#define AUDIT_PERM_WRITE 2
357#define AUDIT_PERM_READ 4
358#define AUDIT_PERM_ATTR 8
359
360struct audit_status {
361 __u32 mask; /* Bit mask for valid entries */
362 __u32 enabled; /* 1 = enabled, 0 = disabled */
363 __u32 failure; /* Failure-to-log action */
364 __u32 pid; /* pid of auditd process */
365 __u32 rate_limit; /* messages rate limit (per second) */
366 __u32 backlog_limit; /* waiting messages limit */
367 __u32 lost; /* messages lost */
368 __u32 backlog; /* messages waiting in queue */
369};
370
371struct audit_tty_status {
372 __u32 enabled; /* 1 = enabled, 0 = disabled */
373};
374
375/* audit_rule_data supports filter rules with both integer and string
376 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
377 * AUDIT_LIST_RULES requests.
378 */
379struct audit_rule_data {
380 __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
381 __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
382 __u32 field_count;
383 __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
384 __u32 fields[AUDIT_MAX_FIELDS];
385 __u32 values[AUDIT_MAX_FIELDS];
386 __u32 fieldflags[AUDIT_MAX_FIELDS];
387 __u32 buflen; /* total length of string fields */
388 char buf[0]; /* string fields buffer */
389};
390
391/* audit_rule is supported to maintain backward compatibility with
392 * userspace. It supports integer fields only and corresponds to
393 * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
394 */
395struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
396 __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
397 __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
398 __u32 field_count;
399 __u32 mask[AUDIT_BITMASK_SIZE];
400 __u32 fields[AUDIT_MAX_FIELDS];
401 __u32 values[AUDIT_MAX_FIELDS];
402};
403
404#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
index 00000000000..77cdba9df27
--- /dev/null
+++ b/include/uapi/linux/auto_fs.h
@@ -0,0 +1,83 @@
1/* -*- linux-c -*- ------------------------------------------------------- *
2 *
3 * linux/include/linux/auto_fs.h
4 *
5 * Copyright 1997 Transmeta Corporation - All Rights Reserved
6 *
7 * This file is part of the Linux kernel and is made available under
8 * the terms of the GNU General Public License, version 2, or at your
9 * option, any later version, incorporated herein by reference.
10 *
11 * ----------------------------------------------------------------------- */
12
13
14#ifndef _UAPI_LINUX_AUTO_FS_H
15#define _UAPI_LINUX_AUTO_FS_H
16
17#include <linux/types.h>
18#ifndef __KERNEL__
19#include <sys/ioctl.h>
20#endif /* __KERNEL__ */
21
22
23/* This file describes autofs v3 */
24#define AUTOFS_PROTO_VERSION 3
25
26/* Range of protocol versions defined */
27#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
28#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
29
30/*
31 * Architectures where both 32- and 64-bit binaries can be executed
32 * on 64-bit kernels need this. This keeps the structure format
33 * uniform, and makes sure the wait_queue_token isn't too big to be
34 * passed back down to the kernel.
35 *
36 * This assumes that on these architectures:
37 * mode 32 bit 64 bit
38 * -------------------------
39 * int 32 bit 32 bit
40 * long 32 bit 64 bit
41 *
42 * If so, 32-bit user-space code should be backwards compatible.
43 */
44
45#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
46 || defined(__powerpc__) || defined(__s390__)
47typedef unsigned int autofs_wqt_t;
48#else
49typedef unsigned long autofs_wqt_t;
50#endif
51
52/* Packet types */
53#define autofs_ptype_missing 0 /* Missing entry (mount request) */
54#define autofs_ptype_expire 1 /* Expire entry (umount request) */
55
56struct autofs_packet_hdr {
57 int proto_version; /* Protocol version */
58 int type; /* Type of packet */
59};
60
61struct autofs_packet_missing {
62 struct autofs_packet_hdr hdr;
63 autofs_wqt_t wait_queue_token;
64 int len;
65 char name[NAME_MAX+1];
66};
67
68/* v3 expire (via ioctl) */
69struct autofs_packet_expire {
70 struct autofs_packet_hdr hdr;
71 int len;
72 char name[NAME_MAX+1];
73};
74
75#define AUTOFS_IOC_READY _IO(0x93,0x60)
76#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
77#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
78#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
79#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
80#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
81#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
82
83#endif /* _UAPI_LINUX_AUTO_FS_H */
diff --git a/include/linux/auto_fs4.h b/include/uapi/linux/auto_fs4.h
index e02982fa295..e02982fa295 100644
--- a/include/linux/auto_fs4.h
+++ b/include/uapi/linux/auto_fs4.h
diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h
new file mode 100644
index 00000000000..61594d598e7
--- /dev/null
+++ b/include/uapi/linux/auxvec.h
@@ -0,0 +1,35 @@
1#ifndef _UAPI_LINUX_AUXVEC_H
2#define _UAPI_LINUX_AUXVEC_H
3
4#include <asm/auxvec.h>
5
6/* Symbolic values for the entries in the auxiliary table
7 put on the initial stack */
8#define AT_NULL 0 /* end of vector */
9#define AT_IGNORE 1 /* entry should be ignored */
10#define AT_EXECFD 2 /* file descriptor of program */
11#define AT_PHDR 3 /* program headers for program */
12#define AT_PHENT 4 /* size of program header entry */
13#define AT_PHNUM 5 /* number of program headers */
14#define AT_PAGESZ 6 /* system page size */
15#define AT_BASE 7 /* base address of interpreter */
16#define AT_FLAGS 8 /* flags */
17#define AT_ENTRY 9 /* entry point of program */
18#define AT_NOTELF 10 /* program is not ELF */
19#define AT_UID 11 /* real uid */
20#define AT_EUID 12 /* effective uid */
21#define AT_GID 13 /* real gid */
22#define AT_EGID 14 /* effective gid */
23#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
24#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
25#define AT_CLKTCK 17 /* frequency at which times() increments */
26/* AT_* values 18 through 22 are reserved */
27#define AT_SECURE 23 /* secure mode boolean */
28#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
29 * differ from AT_PLATFORM. */
30#define AT_RANDOM 25 /* address of 16 random bytes */
31
32#define AT_EXECFN 31 /* filename of program */
33
34
35#endif /* _UAPI_LINUX_AUXVEC_H */
diff --git a/include/linux/ax25.h b/include/uapi/linux/ax25.h
index 74c89a41732..74c89a41732 100644
--- a/include/linux/ax25.h
+++ b/include/uapi/linux/ax25.h
diff --git a/include/linux/b1lli.h b/include/uapi/linux/b1lli.h
index 713f712685d..713f712685d 100644
--- a/include/linux/b1lli.h
+++ b/include/uapi/linux/b1lli.h
diff --git a/include/linux/baycom.h b/include/uapi/linux/baycom.h
index 81249e029da..81249e029da 100644
--- a/include/linux/baycom.h
+++ b/include/uapi/linux/baycom.h
diff --git a/include/linux/bfs_fs.h b/include/uapi/linux/bfs_fs.h
index 1c0b355aa51..1c0b355aa51 100644
--- a/include/linux/bfs_fs.h
+++ b/include/uapi/linux/bfs_fs.h
diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
new file mode 100644
index 00000000000..4eb5972867c
--- /dev/null
+++ b/include/uapi/linux/binfmts.h
@@ -0,0 +1,20 @@
1#ifndef _UAPI_LINUX_BINFMTS_H
2#define _UAPI_LINUX_BINFMTS_H
3
4#include <linux/capability.h>
5
6struct pt_regs;
7
8/*
9 * These are the maximum length and maximum number of strings passed to the
10 * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
11 * prevent the kernel from being unduly impacted by misaddressed pointers.
12 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
13 */
14#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
15#define MAX_ARG_STRINGS 0x7FFFFFFF
16
17/* sizeof(linux_binprm->buf) */
18#define BINPRM_BUF_SIZE 128
19
20#endif /* _UAPI_LINUX_BINFMTS_H */
diff --git a/include/linux/blkpg.h b/include/uapi/linux/blkpg.h
index a8519446c11..a8519446c11 100644
--- a/include/linux/blkpg.h
+++ b/include/uapi/linux/blkpg.h
diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
new file mode 100644
index 00000000000..c590ca6bfbd
--- /dev/null
+++ b/include/uapi/linux/blktrace_api.h
@@ -0,0 +1,142 @@
1#ifndef _UAPIBLKTRACE_H
2#define _UAPIBLKTRACE_H
3
4#include <linux/types.h>
5
6/*
7 * Trace categories
8 */
9enum blktrace_cat {
10 BLK_TC_READ = 1 << 0, /* reads */
11 BLK_TC_WRITE = 1 << 1, /* writes */
12 BLK_TC_FLUSH = 1 << 2, /* flush */
13 BLK_TC_SYNC = 1 << 3, /* sync IO */
14 BLK_TC_SYNCIO = BLK_TC_SYNC,
15 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
16 BLK_TC_REQUEUE = 1 << 5, /* requeueing */
17 BLK_TC_ISSUE = 1 << 6, /* issue */
18 BLK_TC_COMPLETE = 1 << 7, /* completions */
19 BLK_TC_FS = 1 << 8, /* fs requests */
20 BLK_TC_PC = 1 << 9, /* pc requests */
21 BLK_TC_NOTIFY = 1 << 10, /* special message */
22 BLK_TC_AHEAD = 1 << 11, /* readahead */
23 BLK_TC_META = 1 << 12, /* metadata */
24 BLK_TC_DISCARD = 1 << 13, /* discard requests */
25 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
26 BLK_TC_FUA = 1 << 15, /* fua requests */
27
28 BLK_TC_END = 1 << 15, /* we've run out of bits! */
29};
30
31#define BLK_TC_SHIFT (16)
32#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
33
34/*
35 * Basic trace actions
36 */
37enum blktrace_act {
38 __BLK_TA_QUEUE = 1, /* queued */
39 __BLK_TA_BACKMERGE, /* back merged to existing rq */
40 __BLK_TA_FRONTMERGE, /* front merge to existing rq */
41 __BLK_TA_GETRQ, /* allocated new request */
42 __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */
43 __BLK_TA_REQUEUE, /* request requeued */
44 __BLK_TA_ISSUE, /* sent to driver */
45 __BLK_TA_COMPLETE, /* completed by driver */
46 __BLK_TA_PLUG, /* queue was plugged */
47 __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */
48 __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */
49 __BLK_TA_INSERT, /* insert request */
50 __BLK_TA_SPLIT, /* bio was split */
51 __BLK_TA_BOUNCE, /* bio was bounced */
52 __BLK_TA_REMAP, /* bio was remapped */
53 __BLK_TA_ABORT, /* request aborted */
54 __BLK_TA_DRV_DATA, /* driver-specific binary data */
55};
56
57/*
58 * Notify events.
59 */
60enum blktrace_notify {
61 __BLK_TN_PROCESS = 0, /* establish pid/name mapping */
62 __BLK_TN_TIMESTAMP, /* include system clock */
63 __BLK_TN_MESSAGE, /* Character string message */
64};
65
66
67/*
68 * Trace actions in full. Additionally, read or write is masked
69 */
70#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
71#define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
72#define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
73#define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
74#define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
75#define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
76#define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
77#define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
78#define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
79#define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
80#define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
81#define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
82#define BLK_TA_SPLIT (__BLK_TA_SPLIT)
83#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
84#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
85#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
86#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
87
88#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
89#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
90#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
91
92#define BLK_IO_TRACE_MAGIC 0x65617400
93#define BLK_IO_TRACE_VERSION 0x07
94
95/*
96 * The trace itself
97 */
98struct blk_io_trace {
99 __u32 magic; /* MAGIC << 8 | version */
100 __u32 sequence; /* event number */
101 __u64 time; /* in microseconds */
102 __u64 sector; /* disk offset */
103 __u32 bytes; /* transfer length */
104 __u32 action; /* what happened */
105 __u32 pid; /* who did it */
106 __u32 device; /* device number */
107 __u32 cpu; /* on what cpu did it happen */
108 __u16 error; /* completion error */
109 __u16 pdu_len; /* length of data after this trace */
110};
111
112/*
113 * The remap event
114 */
115struct blk_io_trace_remap {
116 __be32 device_from;
117 __be32 device_to;
118 __be64 sector_from;
119};
120
121enum {
122 Blktrace_setup = 1,
123 Blktrace_running,
124 Blktrace_stopped,
125};
126
127#define BLKTRACE_BDEV_SIZE 32
128
129/*
130 * User setup structure passed with BLKTRACESTART
131 */
132struct blk_user_trace_setup {
133 char name[BLKTRACE_BDEV_SIZE]; /* output */
134 __u16 act_mask; /* input */
135 __u32 buf_size; /* input */
136 __u32 buf_nr; /* input */
137 __u64 start_lba;
138 __u64 end_lba;
139 __u32 pid;
140};
141
142#endif /* _UAPIBLKTRACE_H */
diff --git a/include/linux/bpqether.h b/include/uapi/linux/bpqether.h
index a6c35e1a89a..a6c35e1a89a 100644
--- a/include/linux/bpqether.h
+++ b/include/uapi/linux/bpqether.h
diff --git a/include/uapi/linux/bsg.h b/include/uapi/linux/bsg.h
new file mode 100644
index 00000000000..7a12e1c0f37
--- /dev/null
+++ b/include/uapi/linux/bsg.h
@@ -0,0 +1,65 @@
1#ifndef _UAPIBSG_H
2#define _UAPIBSG_H
3
4#include <linux/types.h>
5
6#define BSG_PROTOCOL_SCSI 0
7
8#define BSG_SUB_PROTOCOL_SCSI_CMD 0
9#define BSG_SUB_PROTOCOL_SCSI_TMF 1
10#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
11
12/*
13 * For flags member below
14 * sg.h sg_io_hdr also has bits defined for it's flags member. However
15 * none of these bits are implemented/used by bsg. The bits below are
16 * allocated to not conflict with sg.h ones anyway.
17 */
18#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
19
20struct sg_io_v4 {
21 __s32 guard; /* [i] 'Q' to differentiate from v3 */
22 __u32 protocol; /* [i] 0 -> SCSI , .... */
23 __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
24 management function, .... */
25
26 __u32 request_len; /* [i] in bytes */
27 __u64 request; /* [i], [*i] {SCSI: cdb} */
28 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
29 __u32 request_attr; /* [i] {SCSI: task attribute} */
30 __u32 request_priority; /* [i] {SCSI: task priority} */
31 __u32 request_extra; /* [i] {spare, for padding} */
32 __u32 max_response_len; /* [i] in bytes */
33 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
34
35 /* "dout_": data out (to device); "din_": data in (from device) */
36 __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
37 dout_xfer points to array of iovec */
38 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
39 __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
40 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
41 __u64 dout_xferp; /* [i], [*i] */
42 __u64 din_xferp; /* [i], [*o] */
43
44 __u32 timeout; /* [i] units: millisecond */
45 __u32 flags; /* [i] bit mask */
46 __u64 usr_ptr; /* [i->o] unused internally */
47 __u32 spare_in; /* [i] */
48
49 __u32 driver_status; /* [o] 0 -> ok */
50 __u32 transport_status; /* [o] 0 -> ok */
51 __u32 device_status; /* [o] {SCSI: command completion status} */
52 __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
53 __u32 info; /* [o] additional information */
54 __u32 duration; /* [o] time to complete, in milliseconds */
55 __u32 response_len; /* [o] bytes of response actually written */
56 __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
57 __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
58 __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
59 __u32 spare_out; /* [o] */
60
61 __u32 padding;
62};
63
64
65#endif /* _UAPIBSG_H */
diff --git a/include/uapi/linux/byteorder/Kbuild b/include/uapi/linux/byteorder/Kbuild
index aafaa5aa54d..619225b9ff2 100644
--- a/include/uapi/linux/byteorder/Kbuild
+++ b/include/uapi/linux/byteorder/Kbuild
@@ -1 +1,3 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += big_endian.h
3header-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
index 00000000000..67237445009
--- /dev/null
+++ b/include/uapi/linux/byteorder/big_endian.h
@@ -0,0 +1,105 @@
1#ifndef _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H
2#define _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H
3
4#ifndef __BIG_ENDIAN
5#define __BIG_ENDIAN 4321
6#endif
7#ifndef __BIG_ENDIAN_BITFIELD
8#define __BIG_ENDIAN_BITFIELD
9#endif
10
11#include <linux/types.h>
12#include <linux/swab.h>
13
14#define __constant_htonl(x) ((__force __be32)(__u32)(x))
15#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
16#define __constant_htons(x) ((__force __be16)(__u16)(x))
17#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
18#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
19#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
20#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
21#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
22#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
23#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
24#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
25#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
26#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
27#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
28#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
29#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
30#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
31#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
32#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
33#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
34#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
35#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
36#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
37#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
38#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
39#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
40#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
41#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
42
43static inline __le64 __cpu_to_le64p(const __u64 *p)
44{
45 return (__force __le64)__swab64p(p);
46}
47static inline __u64 __le64_to_cpup(const __le64 *p)
48{
49 return __swab64p((__u64 *)p);
50}
51static inline __le32 __cpu_to_le32p(const __u32 *p)
52{
53 return (__force __le32)__swab32p(p);
54}
55static inline __u32 __le32_to_cpup(const __le32 *p)
56{
57 return __swab32p((__u32 *)p);
58}
59static inline __le16 __cpu_to_le16p(const __u16 *p)
60{
61 return (__force __le16)__swab16p(p);
62}
63static inline __u16 __le16_to_cpup(const __le16 *p)
64{
65 return __swab16p((__u16 *)p);
66}
67static inline __be64 __cpu_to_be64p(const __u64 *p)
68{
69 return (__force __be64)*p;
70}
71static inline __u64 __be64_to_cpup(const __be64 *p)
72{
73 return (__force __u64)*p;
74}
75static inline __be32 __cpu_to_be32p(const __u32 *p)
76{
77 return (__force __be32)*p;
78}
79static inline __u32 __be32_to_cpup(const __be32 *p)
80{
81 return (__force __u32)*p;
82}
83static inline __be16 __cpu_to_be16p(const __u16 *p)
84{
85 return (__force __be16)*p;
86}
87static inline __u16 __be16_to_cpup(const __be16 *p)
88{
89 return (__force __u16)*p;
90}
91#define __cpu_to_le64s(x) __swab64s((x))
92#define __le64_to_cpus(x) __swab64s((x))
93#define __cpu_to_le32s(x) __swab32s((x))
94#define __le32_to_cpus(x) __swab32s((x))
95#define __cpu_to_le16s(x) __swab16s((x))
96#define __le16_to_cpus(x) __swab16s((x))
97#define __cpu_to_be64s(x) do { (void)(x); } while (0)
98#define __be64_to_cpus(x) do { (void)(x); } while (0)
99#define __cpu_to_be32s(x) do { (void)(x); } while (0)
100#define __be32_to_cpus(x) do { (void)(x); } while (0)
101#define __cpu_to_be16s(x) do { (void)(x); } while (0)
102#define __be16_to_cpus(x) do { (void)(x); } while (0)
103
104
105#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
index 00000000000..d876736a001
--- /dev/null
+++ b/include/uapi/linux/byteorder/little_endian.h
@@ -0,0 +1,105 @@
1#ifndef _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H
2#define _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H
3
4#ifndef __LITTLE_ENDIAN
5#define __LITTLE_ENDIAN 1234
6#endif
7#ifndef __LITTLE_ENDIAN_BITFIELD
8#define __LITTLE_ENDIAN_BITFIELD
9#endif
10
11#include <linux/types.h>
12#include <linux/swab.h>
13
14#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
15#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
16#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
17#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
18#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
19#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
20#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
21#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
22#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
23#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
24#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
25#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
26#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
27#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
28#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
29#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
30#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
31#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
32#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
33#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
34#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
35#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
36#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
37#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
38#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
39#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
40#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
41#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
42
43static inline __le64 __cpu_to_le64p(const __u64 *p)
44{
45 return (__force __le64)*p;
46}
47static inline __u64 __le64_to_cpup(const __le64 *p)
48{
49 return (__force __u64)*p;
50}
51static inline __le32 __cpu_to_le32p(const __u32 *p)
52{
53 return (__force __le32)*p;
54}
55static inline __u32 __le32_to_cpup(const __le32 *p)
56{
57 return (__force __u32)*p;
58}
59static inline __le16 __cpu_to_le16p(const __u16 *p)
60{
61 return (__force __le16)*p;
62}
63static inline __u16 __le16_to_cpup(const __le16 *p)
64{
65 return (__force __u16)*p;
66}
67static inline __be64 __cpu_to_be64p(const __u64 *p)
68{
69 return (__force __be64)__swab64p(p);
70}
71static inline __u64 __be64_to_cpup(const __be64 *p)
72{
73 return __swab64p((__u64 *)p);
74}
75static inline __be32 __cpu_to_be32p(const __u32 *p)
76{
77 return (__force __be32)__swab32p(p);
78}
79static inline __u32 __be32_to_cpup(const __be32 *p)
80{
81 return __swab32p((__u32 *)p);
82}
83static inline __be16 __cpu_to_be16p(const __u16 *p)
84{
85 return (__force __be16)__swab16p(p);
86}
87static inline __u16 __be16_to_cpup(const __be16 *p)
88{
89 return __swab16p((__u16 *)p);
90}
91#define __cpu_to_le64s(x) do { (void)(x); } while (0)
92#define __le64_to_cpus(x) do { (void)(x); } while (0)
93#define __cpu_to_le32s(x) do { (void)(x); } while (0)
94#define __le32_to_cpus(x) do { (void)(x); } while (0)
95#define __cpu_to_le16s(x) do { (void)(x); } while (0)
96#define __le16_to_cpus(x) do { (void)(x); } while (0)
97#define __cpu_to_be64s(x) __swab64s((x))
98#define __be64_to_cpus(x) __swab64s((x))
99#define __cpu_to_be32s(x) __swab32s((x))
100#define __be32_to_cpus(x) __swab32s((x))
101#define __cpu_to_be16s(x) __swab16s((x))
102#define __be16_to_cpus(x) __swab16s((x))
103
104
105#endif /* _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H */
diff --git a/include/linux/can.h b/include/uapi/linux/can.h
index e52958d7c2d..e52958d7c2d 100644
--- a/include/linux/can.h
+++ b/include/uapi/linux/can.h
diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
new file mode 100644
index 00000000000..ba478fa3012
--- /dev/null
+++ b/include/uapi/linux/capability.h
@@ -0,0 +1,358 @@
1/*
2 * This is <linux/capability.h>
3 *
4 * Andrew G. Morgan <morgan@kernel.org>
5 * Alexander Kjeldaas <astor@guardian.no>
6 * with help from Aleph1, Roland Buresund and Andrew Main.
7 *
8 * See here for the libcap library ("POSIX draft" compliance):
9 *
10 * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
11 */
12
13#ifndef _UAPI_LINUX_CAPABILITY_H
14#define _UAPI_LINUX_CAPABILITY_H
15
16#include <linux/types.h>
17
18struct task_struct;
19
20/* User-level do most of the mapping between kernel and user
21 capabilities based on the version tag given by the kernel. The
22 kernel might be somewhat backwards compatible, but don't bet on
23 it. */
24
25/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
26 a set of three capability sets. The transposition of 3*the
27 following structure to such a composite is better handled in a user
28 library since the draft standard requires the use of malloc/free
29 etc.. */
30
31#define _LINUX_CAPABILITY_VERSION_1 0x19980330
32#define _LINUX_CAPABILITY_U32S_1 1
33
34#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */
35#define _LINUX_CAPABILITY_U32S_2 2
36
37#define _LINUX_CAPABILITY_VERSION_3 0x20080522
38#define _LINUX_CAPABILITY_U32S_3 2
39
40typedef struct __user_cap_header_struct {
41 __u32 version;
42 int pid;
43} __user *cap_user_header_t;
44
45typedef struct __user_cap_data_struct {
46 __u32 effective;
47 __u32 permitted;
48 __u32 inheritable;
49} __user *cap_user_data_t;
50
51
52#define VFS_CAP_REVISION_MASK 0xFF000000
53#define VFS_CAP_REVISION_SHIFT 24
54#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
55#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
56
57#define VFS_CAP_REVISION_1 0x01000000
58#define VFS_CAP_U32_1 1
59#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
60
61#define VFS_CAP_REVISION_2 0x02000000
62#define VFS_CAP_U32_2 2
63#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
64
65#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
66#define VFS_CAP_U32 VFS_CAP_U32_2
67#define VFS_CAP_REVISION VFS_CAP_REVISION_2
68
69struct vfs_cap_data {
70 __le32 magic_etc; /* Little endian */
71 struct {
72 __le32 permitted; /* Little endian */
73 __le32 inheritable; /* Little endian */
74 } data[VFS_CAP_U32];
75};
76
77#ifndef __KERNEL__
78
79/*
80 * Backwardly compatible definition for source code - trapped in a
81 * 32-bit world. If you find you need this, please consider using
82 * libcap to untrap yourself...
83 */
84#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
85#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
86
87#endif
88
89
90/**
91 ** POSIX-draft defined capabilities.
92 **/
93
94/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
95 overrides the restriction of changing file ownership and group
96 ownership. */
97
98#define CAP_CHOWN 0
99
100/* Override all DAC access, including ACL execute access if
101 [_POSIX_ACL] is defined. Excluding DAC access covered by
102 CAP_LINUX_IMMUTABLE. */
103
104#define CAP_DAC_OVERRIDE 1
105
106/* Overrides all DAC restrictions regarding read and search on files
107 and directories, including ACL restrictions if [_POSIX_ACL] is
108 defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
109
110#define CAP_DAC_READ_SEARCH 2
111
112/* Overrides all restrictions about allowed operations on files, where
113 file owner ID must be equal to the user ID, except where CAP_FSETID
114 is applicable. It doesn't override MAC and DAC restrictions. */
115
116#define CAP_FOWNER 3
117
118/* Overrides the following restrictions that the effective user ID
119 shall match the file owner ID when setting the S_ISUID and S_ISGID
120 bits on that file; that the effective group ID (or one of the
121 supplementary group IDs) shall match the file owner ID when setting
122 the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
123 cleared on successful return from chown(2) (not implemented). */
124
125#define CAP_FSETID 4
126
127/* Overrides the restriction that the real or effective user ID of a
128 process sending a signal must match the real or effective user ID
129 of the process receiving the signal. */
130
131#define CAP_KILL 5
132
133/* Allows setgid(2) manipulation */
134/* Allows setgroups(2) */
135/* Allows forged gids on socket credentials passing. */
136
137#define CAP_SETGID 6
138
139/* Allows set*uid(2) manipulation (including fsuid). */
140/* Allows forged pids on socket credentials passing. */
141
142#define CAP_SETUID 7
143
144
145/**
146 ** Linux-specific capabilities
147 **/
148
149/* Without VFS support for capabilities:
150 * Transfer any capability in your permitted set to any pid,
151 * remove any capability in your permitted set from any pid
152 * With VFS support for capabilities (neither of above, but)
153 * Add any capability from current's capability bounding set
154 * to the current process' inheritable set
155 * Allow taking bits out of capability bounding set
156 * Allow modification of the securebits for a process
157 */
158
159#define CAP_SETPCAP 8
160
161/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
162
163#define CAP_LINUX_IMMUTABLE 9
164
165/* Allows binding to TCP/UDP sockets below 1024 */
166/* Allows binding to ATM VCIs below 32 */
167
168#define CAP_NET_BIND_SERVICE 10
169
170/* Allow broadcasting, listen to multicast */
171
172#define CAP_NET_BROADCAST 11
173
174/* Allow interface configuration */
175/* Allow administration of IP firewall, masquerading and accounting */
176/* Allow setting debug option on sockets */
177/* Allow modification of routing tables */
178/* Allow setting arbitrary process / process group ownership on
179 sockets */
180/* Allow binding to any address for transparent proxying (also via NET_RAW) */
181/* Allow setting TOS (type of service) */
182/* Allow setting promiscuous mode */
183/* Allow clearing driver statistics */
184/* Allow multicasting */
185/* Allow read/write of device-specific registers */
186/* Allow activation of ATM control sockets */
187
188#define CAP_NET_ADMIN 12
189
190/* Allow use of RAW sockets */
191/* Allow use of PACKET sockets */
192/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
193
194#define CAP_NET_RAW 13
195
196/* Allow locking of shared memory segments */
197/* Allow mlock and mlockall (which doesn't really have anything to do
198 with IPC) */
199
200#define CAP_IPC_LOCK 14
201
202/* Override IPC ownership checks */
203
204#define CAP_IPC_OWNER 15
205
206/* Insert and remove kernel modules - modify kernel without limit */
207#define CAP_SYS_MODULE 16
208
209/* Allow ioperm/iopl access */
210/* Allow sending USB messages to any device via /proc/bus/usb */
211
212#define CAP_SYS_RAWIO 17
213
214/* Allow use of chroot() */
215
216#define CAP_SYS_CHROOT 18
217
218/* Allow ptrace() of any process */
219
220#define CAP_SYS_PTRACE 19
221
222/* Allow configuration of process accounting */
223
224#define CAP_SYS_PACCT 20
225
226/* Allow configuration of the secure attention key */
227/* Allow administration of the random device */
228/* Allow examination and configuration of disk quotas */
229/* Allow setting the domainname */
230/* Allow setting the hostname */
231/* Allow calling bdflush() */
232/* Allow mount() and umount(), setting up new smb connection */
233/* Allow some autofs root ioctls */
234/* Allow nfsservctl */
235/* Allow VM86_REQUEST_IRQ */
236/* Allow to read/write pci config on alpha */
237/* Allow irix_prctl on mips (setstacksize) */
238/* Allow flushing all cache on m68k (sys_cacheflush) */
239/* Allow removing semaphores */
240/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
241 and shared memory */
242/* Allow locking/unlocking of shared memory segment */
243/* Allow turning swap on/off */
244/* Allow forged pids on socket credentials passing */
245/* Allow setting readahead and flushing buffers on block devices */
246/* Allow setting geometry in floppy driver */
247/* Allow turning DMA on/off in xd driver */
248/* Allow administration of md devices (mostly the above, but some
249 extra ioctls) */
250/* Allow tuning the ide driver */
251/* Allow access to the nvram device */
252/* Allow administration of apm_bios, serial and bttv (TV) device */
253/* Allow manufacturer commands in isdn CAPI support driver */
254/* Allow reading non-standardized portions of pci configuration space */
255/* Allow DDI debug ioctl on sbpcd driver */
256/* Allow setting up serial ports */
257/* Allow sending raw qic-117 commands */
258/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
259 arbitrary SCSI commands */
260/* Allow setting encryption key on loopback filesystem */
261/* Allow setting zone reclaim policy */
262
263#define CAP_SYS_ADMIN 21
264
265/* Allow use of reboot() */
266
267#define CAP_SYS_BOOT 22
268
269/* Allow raising priority and setting priority on other (different
270 UID) processes */
271/* Allow use of FIFO and round-robin (realtime) scheduling on own
272 processes and setting the scheduling algorithm used by another
273 process. */
274/* Allow setting cpu affinity on other processes */
275
276#define CAP_SYS_NICE 23
277
278/* Override resource limits. Set resource limits. */
279/* Override quota limits. */
280/* Override reserved space on ext2 filesystem */
281/* Modify data journaling mode on ext3 filesystem (uses journaling
282 resources) */
283/* NOTE: ext2 honors fsuid when checking for resource overrides, so
284 you can override using fsuid too */
285/* Override size restrictions on IPC message queues */
286/* Allow more than 64hz interrupts from the real-time clock */
287/* Override max number of consoles on console allocation */
288/* Override max number of keymaps */
289
290#define CAP_SYS_RESOURCE 24
291
292/* Allow manipulation of system clock */
293/* Allow irix_stime on mips */
294/* Allow setting the real-time clock */
295
296#define CAP_SYS_TIME 25
297
298/* Allow configuration of tty devices */
299/* Allow vhangup() of tty */
300
301#define CAP_SYS_TTY_CONFIG 26
302
303/* Allow the privileged aspects of mknod() */
304
305#define CAP_MKNOD 27
306
307/* Allow taking of leases on files */
308
309#define CAP_LEASE 28
310
311#define CAP_AUDIT_WRITE 29
312
313#define CAP_AUDIT_CONTROL 30
314
315#define CAP_SETFCAP 31
316
317/* Override MAC access.
318 The base kernel enforces no MAC policy.
319 An LSM may enforce a MAC policy, and if it does and it chooses
320 to implement capability based overrides of that policy, this is
321 the capability it should use to do so. */
322
323#define CAP_MAC_OVERRIDE 32
324
325/* Allow MAC configuration or state changes.
326 The base kernel requires no MAC configuration.
327 An LSM may enforce a MAC policy, and if it does and it chooses
328 to implement capability based checks on modifications to that
329 policy or the data required to maintain it, this is the
330 capability it should use to do so. */
331
332#define CAP_MAC_ADMIN 33
333
334/* Allow configuring the kernel's syslog (printk behaviour) */
335
336#define CAP_SYSLOG 34
337
338/* Allow triggering something that will wake the system */
339
340#define CAP_WAKE_ALARM 35
341
342/* Allow preventing system suspends */
343
344#define CAP_BLOCK_SUSPEND 36
345
346#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
347
348#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
349
350/*
351 * Bit location of each capability (used by user-space library and kernel)
352 */
353
354#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
355#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
356
357
358#endif /* _UAPI_LINUX_CAPABILITY_H */
diff --git a/include/linux/capi.h b/include/uapi/linux/capi.h
index 65100d6cb89..65100d6cb89 100644
--- a/include/linux/capi.h
+++ b/include/uapi/linux/capi.h
diff --git a/include/linux/cciss_defs.h b/include/uapi/linux/cciss_defs.h
index 316b670d4e3..316b670d4e3 100644
--- a/include/linux/cciss_defs.h
+++ b/include/uapi/linux/cciss_defs.h
diff --git a/include/uapi/linux/cciss_ioctl.h b/include/uapi/linux/cciss_ioctl.h
new file mode 100644
index 00000000000..bb0b9ddf7ee
--- /dev/null
+++ b/include/uapi/linux/cciss_ioctl.h
@@ -0,0 +1,88 @@
1#ifndef _UAPICCISS_IOCTLH
2#define _UAPICCISS_IOCTLH
3
4#include <linux/types.h>
5#include <linux/ioctl.h>
6#include <linux/cciss_defs.h>
7
8#define CCISS_IOC_MAGIC 'B'
9
10
11typedef struct _cciss_pci_info_struct
12{
13 unsigned char bus;
14 unsigned char dev_fn;
15 unsigned short domain;
16 __u32 board_id;
17} cciss_pci_info_struct;
18
19typedef struct _cciss_coalint_struct
20{
21 __u32 delay;
22 __u32 count;
23} cciss_coalint_struct;
24
25typedef char NodeName_type[16];
26
27typedef __u32 Heartbeat_type;
28
29#define CISS_PARSCSIU2 0x0001
30#define CISS_PARCSCIU3 0x0002
31#define CISS_FIBRE1G 0x0100
32#define CISS_FIBRE2G 0x0200
33typedef __u32 BusTypes_type;
34
35typedef char FirmwareVer_type[4];
36typedef __u32 DriverVer_type;
37
38#define MAX_KMALLOC_SIZE 128000
39
40typedef struct _IOCTL_Command_struct {
41 LUNAddr_struct LUN_info;
42 RequestBlock_struct Request;
43 ErrorInfo_struct error_info;
44 WORD buf_size; /* size in bytes of the buf */
45 BYTE __user *buf;
46} IOCTL_Command_struct;
47
48typedef struct _BIG_IOCTL_Command_struct {
49 LUNAddr_struct LUN_info;
50 RequestBlock_struct Request;
51 ErrorInfo_struct error_info;
52 DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
53 DWORD buf_size; /* size in bytes of the buf */
54 /* < malloc_size * MAXSGENTRIES */
55 BYTE __user *buf;
56} BIG_IOCTL_Command_struct;
57
58typedef struct _LogvolInfo_struct{
59 __u32 LunID;
60 int num_opens; /* number of opens on the logical volume */
61 int num_parts; /* number of partitions configured on logvol */
62} LogvolInfo_struct;
63
64#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
65
66#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
67#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
68
69#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
70#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
71
72#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
73#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
74#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
75#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
76#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
77#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
78#define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
79
80/* no longer used... use REGNEWD instead */
81#define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
82
83#define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
84#define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
85#define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
86#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
87
88#endif /* _UAPICCISS_IOCTLH */
diff --git a/include/uapi/linux/cdrom.h b/include/uapi/linux/cdrom.h
new file mode 100644
index 00000000000..898b866b300
--- /dev/null
+++ b/include/uapi/linux/cdrom.h
@@ -0,0 +1,912 @@
1/*
2 * -- <linux/cdrom.h>
3 * General header file for linux CD-ROM drivers
4 * Copyright (C) 1992 David Giller, rafetmad@oxy.edu
5 * 1994, 1995 Eberhard Mönkeberg, emoenke@gwdg.de
6 * 1996 David van Leeuwen, david@tm.tno.nl
7 * 1997, 1998 Erik Andersen, andersee@debian.org
8 * 1998-2002 Jens Axboe, axboe@suse.de
9 */
10
11#ifndef _UAPI_LINUX_CDROM_H
12#define _UAPI_LINUX_CDROM_H
13
14#include <linux/types.h>
15#include <asm/byteorder.h>
16
17/*******************************************************
18 * As of Linux 2.1.x, all Linux CD-ROM application programs will use this
19 * (and only this) include file. It is my hope to provide Linux with
20 * a uniform interface between software accessing CD-ROMs and the various
21 * device drivers that actually talk to the drives. There may still be
22 * 23 different kinds of strange CD-ROM drives, but at least there will
23 * now be one, and only one, Linux CD-ROM interface.
24 *
25 * Additionally, as of Linux 2.1.x, all Linux application programs
26 * should use the O_NONBLOCK option when opening a CD-ROM device
27 * for subsequent ioctl commands. This allows for neat system errors
28 * like "No medium found" or "Wrong medium type" upon attempting to
29 * mount or play an empty slot, mount an audio disc, or play a data disc.
30 * Generally, changing an application program to support O_NONBLOCK
31 * is as easy as the following:
32 * - drive = open("/dev/cdrom", O_RDONLY);
33 * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
34 * It is worth the small change.
35 *
36 * Patches for many common CD programs (provided by David A. van Leeuwen)
37 * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
38 *
39 *******************************************************/
40
41/* When a driver supports a certain function, but the cdrom drive we are
42 * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will
43 * borrow the "Operation not supported" error from the network folks to
44 * accomplish this. Maybe someday we will get a more targeted error code,
45 * but this will do for now... */
46#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
47
48/*******************************************************
49 * The CD-ROM IOCTL commands -- these should be supported by
50 * all the various cdrom drivers. For the CD-ROM ioctls, we
51 * will commandeer byte 0x53, or 'S'.
52 *******************************************************/
53#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
54#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
55#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
56#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
57 (struct cdrom_ti) */
58#define CDROMREADTOCHDR 0x5305 /* Read TOC header
59 (struct cdrom_tochdr) */
60#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
61 (struct cdrom_tocentry) */
62#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
63#define CDROMSTART 0x5308 /* Start the cdrom drive */
64#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
65#define CDROMVOLCTRL 0x530a /* Control output volume
66 (struct cdrom_volctrl) */
67#define CDROMSUBCHNL 0x530b /* Read subchannel data
68 (struct cdrom_subchnl) */
69#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
70 (struct cdrom_read) */
71#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
72 (struct cdrom_read) */
73#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
74#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
75#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
76 address of multi session disks
77 (struct cdrom_multisession) */
78#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
79 if available (struct cdrom_mcn) */
80#define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated,
81 but here anyway for compatibility */
82#define CDROMRESET 0x5312 /* hard-reset the drive */
83#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
84 (struct cdrom_volctrl) */
85#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
86 (struct cdrom_read) */
87/*
88 * These ioctls are used only used in aztcd.c and optcd.c
89 */
90#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
91#define CDROMSEEK 0x5316 /* seek msf address */
92
93/*
94 * This ioctl is only used by the scsi-cd driver.
95 It is for playing audio in logical block addressing mode.
96 */
97#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
98
99/*
100 * These ioctls are only used in optcd.c
101 */
102#define CDROMREADALL 0x5318 /* read all 2646 bytes */
103
104/*
105 * These ioctls are (now) only in ide-cd.c for controlling
106 * drive spindown time. They should be implemented in the
107 * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
108 * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
109 * -Erik
110 */
111#define CDROMGETSPINDOWN 0x531d
112#define CDROMSETSPINDOWN 0x531e
113
114/*
115 * These ioctls are implemented through the uniform CD-ROM driver
116 * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
117 * drivers are eventually ported to the uniform CD-ROM driver interface.
118 */
119#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
120#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
121#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
122#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
123#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
124#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
125#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
126#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
127#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
128#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
129#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
130#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
131
132/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
133 * Future CDROM ioctls should be kept below 0x537F
134 */
135
136/* This ioctl is only used by sbpcd at the moment */
137#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
138 /* conflict with SCSI_IOCTL_GET_IDLUN */
139
140/* DVD-ROM Specific ioctls */
141#define DVD_READ_STRUCT 0x5390 /* Read structure */
142#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
143#define DVD_AUTH 0x5392 /* Authentication */
144
145#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
146#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
147#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
148
149/*******************************************************
150 * CDROM IOCTL structures
151 *******************************************************/
152
153/* Address in MSF format */
154struct cdrom_msf0
155{
156 __u8 minute;
157 __u8 second;
158 __u8 frame;
159};
160
161/* Address in either MSF or logical format */
162union cdrom_addr
163{
164 struct cdrom_msf0 msf;
165 int lba;
166};
167
168/* This struct is used by the CDROMPLAYMSF ioctl */
169struct cdrom_msf
170{
171 __u8 cdmsf_min0; /* start minute */
172 __u8 cdmsf_sec0; /* start second */
173 __u8 cdmsf_frame0; /* start frame */
174 __u8 cdmsf_min1; /* end minute */
175 __u8 cdmsf_sec1; /* end second */
176 __u8 cdmsf_frame1; /* end frame */
177};
178
179/* This struct is used by the CDROMPLAYTRKIND ioctl */
180struct cdrom_ti
181{
182 __u8 cdti_trk0; /* start track */
183 __u8 cdti_ind0; /* start index */
184 __u8 cdti_trk1; /* end track */
185 __u8 cdti_ind1; /* end index */
186};
187
188/* This struct is used by the CDROMREADTOCHDR ioctl */
189struct cdrom_tochdr
190{
191 __u8 cdth_trk0; /* start track */
192 __u8 cdth_trk1; /* end track */
193};
194
195/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
196struct cdrom_volctrl
197{
198 __u8 channel0;
199 __u8 channel1;
200 __u8 channel2;
201 __u8 channel3;
202};
203
204/* This struct is used by the CDROMSUBCHNL ioctl */
205struct cdrom_subchnl
206{
207 __u8 cdsc_format;
208 __u8 cdsc_audiostatus;
209 __u8 cdsc_adr: 4;
210 __u8 cdsc_ctrl: 4;
211 __u8 cdsc_trk;
212 __u8 cdsc_ind;
213 union cdrom_addr cdsc_absaddr;
214 union cdrom_addr cdsc_reladdr;
215};
216
217
218/* This struct is used by the CDROMREADTOCENTRY ioctl */
219struct cdrom_tocentry
220{
221 __u8 cdte_track;
222 __u8 cdte_adr :4;
223 __u8 cdte_ctrl :4;
224 __u8 cdte_format;
225 union cdrom_addr cdte_addr;
226 __u8 cdte_datamode;
227};
228
229/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
230struct cdrom_read
231{
232 int cdread_lba;
233 char *cdread_bufaddr;
234 int cdread_buflen;
235};
236
237/* This struct is used by the CDROMREADAUDIO ioctl */
238struct cdrom_read_audio
239{
240 union cdrom_addr addr; /* frame address */
241 __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
242 int nframes; /* number of 2352-byte-frames to read at once */
243 __u8 __user *buf; /* frame buffer (size: nframes*2352 bytes) */
244};
245
246/* This struct is used with the CDROMMULTISESSION ioctl */
247struct cdrom_multisession
248{
249 union cdrom_addr addr; /* frame address: start-of-last-session
250 (not the new "frame 16"!). Only valid
251 if the "xa_flag" is true. */
252 __u8 xa_flag; /* 1: "is XA disk" */
253 __u8 addr_format; /* CDROM_LBA or CDROM_MSF */
254};
255
256/* This struct is used with the CDROM_GET_MCN ioctl.
257 * Very few audio discs actually have Universal Product Code information,
258 * which should just be the Medium Catalog Number on the box. Also note
259 * that the way the codeis written on CD is _not_ uniform across all discs!
260 */
261struct cdrom_mcn
262{
263 __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
264};
265
266/* This is used by the CDROMPLAYBLK ioctl */
267struct cdrom_blk
268{
269 unsigned from;
270 unsigned short len;
271};
272
273#define CDROM_PACKET_SIZE 12
274
275#define CGC_DATA_UNKNOWN 0
276#define CGC_DATA_WRITE 1
277#define CGC_DATA_READ 2
278#define CGC_DATA_NONE 3
279
280/* for CDROM_PACKET_COMMAND ioctl */
281struct cdrom_generic_command
282{
283 unsigned char cmd[CDROM_PACKET_SIZE];
284 unsigned char __user *buffer;
285 unsigned int buflen;
286 int stat;
287 struct request_sense __user *sense;
288 unsigned char data_direction;
289 int quiet;
290 int timeout;
291 void __user *reserved[1]; /* unused, actually */
292};
293
294/*
295 * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
296 * 2340, or 2352 bytes long.
297
298* Sector types of the standard CD-ROM data formats:
299 *
300 * format sector type user data size (bytes)
301 * -----------------------------------------------------------------------------
302 * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW)
303 * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE)
304 * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0)
305 * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE)
306 * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
307 *
308 *
309 * The layout of the standard CD-ROM data formats:
310 * -----------------------------------------------------------------------------
311 * - audio (red): | audio_sample_bytes |
312 * | 2352 |
313 *
314 * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
315 * | 12 - 4 - 2048 - 4 - 8 - 276 |
316 *
317 * - data (yellow, mode2): | sync - head - data |
318 * | 12 - 4 - 2336 |
319 *
320 * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
321 * | 12 - 4 - 8 - 2048 - 4 - 276 |
322 *
323 * - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
324 * | 12 - 4 - 8 - 2324 - 4 |
325 *
326 */
327
328/* Some generally useful CD-ROM information -- mostly based on the above */
329#define CD_MINS 74 /* max. minutes per CD, not really a limit */
330#define CD_SECS 60 /* seconds per minute */
331#define CD_FRAMES 75 /* frames per second */
332#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
333#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
334#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
335#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
336#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
337#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
338#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
339#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
340#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
341#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
342#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
343#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
344#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
345/* most drives don't deliver everything: */
346#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
347#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
348
349#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
350#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
351#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
352
353/* CD-ROM address types (cdrom_tocentry.cdte_format) */
354#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
355#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
356
357/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
358#define CDROM_DATA_TRACK 0x04
359
360/* The leadout track is always 0xAA, regardless of # of tracks on disc */
361#define CDROM_LEADOUT 0xAA
362
363/* audio states (from SCSI-2, but seen with other drives, too) */
364#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
365#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
366#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
367#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
368#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
369#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
370
371/* capability flags used with the uniform CD-ROM driver */
372#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
373#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
374#define CDC_LOCK 0x4 /* disable manual eject */
375#define CDC_SELECT_SPEED 0x8 /* programmable speed */
376#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
377#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
378#define CDC_MCN 0x40 /* Medium Catalog Number */
379#define CDC_MEDIA_CHANGED 0x80 /* media changed */
380#define CDC_PLAY_AUDIO 0x100 /* audio functions */
381#define CDC_RESET 0x200 /* hard reset device */
382#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
383#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
384#define CDC_CD_R 0x2000 /* drive is a CD-R */
385#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
386#define CDC_DVD 0x8000 /* drive is a DVD */
387#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
388#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
389#define CDC_MO_DRIVE 0x40000 /* drive is an MO device */
390#define CDC_MRW 0x80000 /* drive can read MRW */
391#define CDC_MRW_W 0x100000 /* drive can write MRW */
392#define CDC_RAM 0x200000 /* ok to open for WRITE */
393
394/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
395#define CDS_NO_INFO 0 /* if not implemented */
396#define CDS_NO_DISC 1
397#define CDS_TRAY_OPEN 2
398#define CDS_DRIVE_NOT_READY 3
399#define CDS_DISC_OK 4
400
401/* return values for the CDROM_DISC_STATUS ioctl */
402/* can also return CDS_NO_[INFO|DISC], from above */
403#define CDS_AUDIO 100
404#define CDS_DATA_1 101
405#define CDS_DATA_2 102
406#define CDS_XA_2_1 103
407#define CDS_XA_2_2 104
408#define CDS_MIXED 105
409
410/* User-configurable behavior options for the uniform CD-ROM driver */
411#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
412#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
413#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
414#define CDO_LOCK 0x8 /* lock tray on open files */
415#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
416
417/* Special codes used when specifying changer slots. */
418#define CDSL_NONE (INT_MAX-1)
419#define CDSL_CURRENT INT_MAX
420
421/* For partition based multisession access. IDE can handle 64 partitions
422 * per drive - SCSI CD-ROM's use minors to differentiate between the
423 * various drives, so we can't do multisessions the same way there.
424 * Use the -o session=x option to mount on them.
425 */
426#define CD_PART_MAX 64
427#define CD_PART_MASK (CD_PART_MAX - 1)
428
429/*********************************************************************
430 * Generic Packet commands, MMC commands, and such
431 *********************************************************************/
432
433 /* The generic packet command opcodes for CD/DVD Logical Units,
434 * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
435#define GPCMD_BLANK 0xa1
436#define GPCMD_CLOSE_TRACK 0x5b
437#define GPCMD_FLUSH_CACHE 0x35
438#define GPCMD_FORMAT_UNIT 0x04
439#define GPCMD_GET_CONFIGURATION 0x46
440#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
441#define GPCMD_GET_PERFORMANCE 0xac
442#define GPCMD_INQUIRY 0x12
443#define GPCMD_LOAD_UNLOAD 0xa6
444#define GPCMD_MECHANISM_STATUS 0xbd
445#define GPCMD_MODE_SELECT_10 0x55
446#define GPCMD_MODE_SENSE_10 0x5a
447#define GPCMD_PAUSE_RESUME 0x4b
448#define GPCMD_PLAY_AUDIO_10 0x45
449#define GPCMD_PLAY_AUDIO_MSF 0x47
450#define GPCMD_PLAY_AUDIO_TI 0x48
451#define GPCMD_PLAY_CD 0xbc
452#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
453#define GPCMD_READ_10 0x28
454#define GPCMD_READ_12 0xa8
455#define GPCMD_READ_BUFFER 0x3c
456#define GPCMD_READ_BUFFER_CAPACITY 0x5c
457#define GPCMD_READ_CDVD_CAPACITY 0x25
458#define GPCMD_READ_CD 0xbe
459#define GPCMD_READ_CD_MSF 0xb9
460#define GPCMD_READ_DISC_INFO 0x51
461#define GPCMD_READ_DVD_STRUCTURE 0xad
462#define GPCMD_READ_FORMAT_CAPACITIES 0x23
463#define GPCMD_READ_HEADER 0x44
464#define GPCMD_READ_TRACK_RZONE_INFO 0x52
465#define GPCMD_READ_SUBCHANNEL 0x42
466#define GPCMD_READ_TOC_PMA_ATIP 0x43
467#define GPCMD_REPAIR_RZONE_TRACK 0x58
468#define GPCMD_REPORT_KEY 0xa4
469#define GPCMD_REQUEST_SENSE 0x03
470#define GPCMD_RESERVE_RZONE_TRACK 0x53
471#define GPCMD_SEND_CUE_SHEET 0x5d
472#define GPCMD_SCAN 0xba
473#define GPCMD_SEEK 0x2b
474#define GPCMD_SEND_DVD_STRUCTURE 0xbf
475#define GPCMD_SEND_EVENT 0xa2
476#define GPCMD_SEND_KEY 0xa3
477#define GPCMD_SEND_OPC 0x54
478#define GPCMD_SET_READ_AHEAD 0xa7
479#define GPCMD_SET_STREAMING 0xb6
480#define GPCMD_START_STOP_UNIT 0x1b
481#define GPCMD_STOP_PLAY_SCAN 0x4e
482#define GPCMD_TEST_UNIT_READY 0x00
483#define GPCMD_VERIFY_10 0x2f
484#define GPCMD_WRITE_10 0x2a
485#define GPCMD_WRITE_12 0xaa
486#define GPCMD_WRITE_AND_VERIFY_10 0x2e
487#define GPCMD_WRITE_BUFFER 0x3b
488/* This is listed as optional in ATAPI 2.6, but is (curiously)
489 * missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
490 * Table 377 as an MMC command for SCSi devices though... Most ATAPI
491 * drives support it. */
492#define GPCMD_SET_SPEED 0xbb
493/* This seems to be a SCSI specific CD-ROM opcode
494 * to play data at track/index */
495#define GPCMD_PLAYAUDIO_TI 0x48
496/*
497 * From MS Media Status Notification Support Specification. For
498 * older drives only.
499 */
500#define GPCMD_GET_MEDIA_STATUS 0xda
501
502/* Mode page codes for mode sense/set */
503#define GPMODE_VENDOR_PAGE 0x00
504#define GPMODE_R_W_ERROR_PAGE 0x01
505#define GPMODE_WRITE_PARMS_PAGE 0x05
506#define GPMODE_WCACHING_PAGE 0x08
507#define GPMODE_AUDIO_CTL_PAGE 0x0e
508#define GPMODE_POWER_PAGE 0x1a
509#define GPMODE_FAULT_FAIL_PAGE 0x1c
510#define GPMODE_TO_PROTECT_PAGE 0x1d
511#define GPMODE_CAPABILITIES_PAGE 0x2a
512#define GPMODE_ALL_PAGES 0x3f
513/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
514 * of MODE_SENSE_POWER_PAGE */
515#define GPMODE_CDROM_PAGE 0x0d
516
517
518
519/* DVD struct types */
520#define DVD_STRUCT_PHYSICAL 0x00
521#define DVD_STRUCT_COPYRIGHT 0x01
522#define DVD_STRUCT_DISCKEY 0x02
523#define DVD_STRUCT_BCA 0x03
524#define DVD_STRUCT_MANUFACT 0x04
525
526struct dvd_layer {
527 __u8 book_version : 4;
528 __u8 book_type : 4;
529 __u8 min_rate : 4;
530 __u8 disc_size : 4;
531 __u8 layer_type : 4;
532 __u8 track_path : 1;
533 __u8 nlayers : 2;
534 __u8 track_density : 4;
535 __u8 linear_density : 4;
536 __u8 bca : 1;
537 __u32 start_sector;
538 __u32 end_sector;
539 __u32 end_sector_l0;
540};
541
542#define DVD_LAYERS 4
543
544struct dvd_physical {
545 __u8 type;
546 __u8 layer_num;
547 struct dvd_layer layer[DVD_LAYERS];
548};
549
550struct dvd_copyright {
551 __u8 type;
552
553 __u8 layer_num;
554 __u8 cpst;
555 __u8 rmi;
556};
557
558struct dvd_disckey {
559 __u8 type;
560
561 unsigned agid : 2;
562 __u8 value[2048];
563};
564
565struct dvd_bca {
566 __u8 type;
567
568 int len;
569 __u8 value[188];
570};
571
572struct dvd_manufact {
573 __u8 type;
574
575 __u8 layer_num;
576 int len;
577 __u8 value[2048];
578};
579
580typedef union {
581 __u8 type;
582
583 struct dvd_physical physical;
584 struct dvd_copyright copyright;
585 struct dvd_disckey disckey;
586 struct dvd_bca bca;
587 struct dvd_manufact manufact;
588} dvd_struct;
589
590/*
591 * DVD authentication ioctl
592 */
593
594/* Authentication states */
595#define DVD_LU_SEND_AGID 0
596#define DVD_HOST_SEND_CHALLENGE 1
597#define DVD_LU_SEND_KEY1 2
598#define DVD_LU_SEND_CHALLENGE 3
599#define DVD_HOST_SEND_KEY2 4
600
601/* Termination states */
602#define DVD_AUTH_ESTABLISHED 5
603#define DVD_AUTH_FAILURE 6
604
605/* Other functions */
606#define DVD_LU_SEND_TITLE_KEY 7
607#define DVD_LU_SEND_ASF 8
608#define DVD_INVALIDATE_AGID 9
609#define DVD_LU_SEND_RPC_STATE 10
610#define DVD_HOST_SEND_RPC_STATE 11
611
612/* State data */
613typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
614typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
615
616struct dvd_lu_send_agid {
617 __u8 type;
618 unsigned agid : 2;
619};
620
621struct dvd_host_send_challenge {
622 __u8 type;
623 unsigned agid : 2;
624
625 dvd_challenge chal;
626};
627
628struct dvd_send_key {
629 __u8 type;
630 unsigned agid : 2;
631
632 dvd_key key;
633};
634
635struct dvd_lu_send_challenge {
636 __u8 type;
637 unsigned agid : 2;
638
639 dvd_challenge chal;
640};
641
642#define DVD_CPM_NO_COPYRIGHT 0
643#define DVD_CPM_COPYRIGHTED 1
644
645#define DVD_CP_SEC_NONE 0
646#define DVD_CP_SEC_EXIST 1
647
648#define DVD_CGMS_UNRESTRICTED 0
649#define DVD_CGMS_SINGLE 2
650#define DVD_CGMS_RESTRICTED 3
651
652struct dvd_lu_send_title_key {
653 __u8 type;
654 unsigned agid : 2;
655
656 dvd_key title_key;
657 int lba;
658 unsigned cpm : 1;
659 unsigned cp_sec : 1;
660 unsigned cgms : 2;
661};
662
663struct dvd_lu_send_asf {
664 __u8 type;
665 unsigned agid : 2;
666
667 unsigned asf : 1;
668};
669
670struct dvd_host_send_rpcstate {
671 __u8 type;
672 __u8 pdrc;
673};
674
675struct dvd_lu_send_rpcstate {
676 __u8 type : 2;
677 __u8 vra : 3;
678 __u8 ucca : 3;
679 __u8 region_mask;
680 __u8 rpc_scheme;
681};
682
683typedef union {
684 __u8 type;
685
686 struct dvd_lu_send_agid lsa;
687 struct dvd_host_send_challenge hsc;
688 struct dvd_send_key lsk;
689 struct dvd_lu_send_challenge lsc;
690 struct dvd_send_key hsk;
691 struct dvd_lu_send_title_key lstk;
692 struct dvd_lu_send_asf lsasf;
693 struct dvd_host_send_rpcstate hrpcs;
694 struct dvd_lu_send_rpcstate lrpcs;
695} dvd_authinfo;
696
697struct request_sense {
698#if defined(__BIG_ENDIAN_BITFIELD)
699 __u8 valid : 1;
700 __u8 error_code : 7;
701#elif defined(__LITTLE_ENDIAN_BITFIELD)
702 __u8 error_code : 7;
703 __u8 valid : 1;
704#endif
705 __u8 segment_number;
706#if defined(__BIG_ENDIAN_BITFIELD)
707 __u8 reserved1 : 2;
708 __u8 ili : 1;
709 __u8 reserved2 : 1;
710 __u8 sense_key : 4;
711#elif defined(__LITTLE_ENDIAN_BITFIELD)
712 __u8 sense_key : 4;
713 __u8 reserved2 : 1;
714 __u8 ili : 1;
715 __u8 reserved1 : 2;
716#endif
717 __u8 information[4];
718 __u8 add_sense_len;
719 __u8 command_info[4];
720 __u8 asc;
721 __u8 ascq;
722 __u8 fruc;
723 __u8 sks[3];
724 __u8 asb[46];
725};
726
727/*
728 * feature profile
729 */
730#define CDF_RWRT 0x0020 /* "Random Writable" */
731#define CDF_HWDM 0x0024 /* "Hardware Defect Management" */
732#define CDF_MRW 0x0028
733
734/*
735 * media status bits
736 */
737#define CDM_MRW_NOTMRW 0
738#define CDM_MRW_BGFORMAT_INACTIVE 1
739#define CDM_MRW_BGFORMAT_ACTIVE 2
740#define CDM_MRW_BGFORMAT_COMPLETE 3
741
742/*
743 * mrw address spaces
744 */
745#define MRW_LBA_DMA 0
746#define MRW_LBA_GAA 1
747
748/*
749 * mrw mode pages (first is deprecated) -- probed at init time and
750 * cdi->mrw_mode_page is set
751 */
752#define MRW_MODE_PC_PRE1 0x2c
753#define MRW_MODE_PC 0x03
754
755struct mrw_feature_desc {
756 __be16 feature_code;
757#if defined(__BIG_ENDIAN_BITFIELD)
758 __u8 reserved1 : 2;
759 __u8 feature_version : 4;
760 __u8 persistent : 1;
761 __u8 curr : 1;
762#elif defined(__LITTLE_ENDIAN_BITFIELD)
763 __u8 curr : 1;
764 __u8 persistent : 1;
765 __u8 feature_version : 4;
766 __u8 reserved1 : 2;
767#endif
768 __u8 add_len;
769#if defined(__BIG_ENDIAN_BITFIELD)
770 __u8 reserved2 : 7;
771 __u8 write : 1;
772#elif defined(__LITTLE_ENDIAN_BITFIELD)
773 __u8 write : 1;
774 __u8 reserved2 : 7;
775#endif
776 __u8 reserved3;
777 __u8 reserved4;
778 __u8 reserved5;
779};
780
781/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
782struct rwrt_feature_desc {
783 __be16 feature_code;
784#if defined(__BIG_ENDIAN_BITFIELD)
785 __u8 reserved1 : 2;
786 __u8 feature_version : 4;
787 __u8 persistent : 1;
788 __u8 curr : 1;
789#elif defined(__LITTLE_ENDIAN_BITFIELD)
790 __u8 curr : 1;
791 __u8 persistent : 1;
792 __u8 feature_version : 4;
793 __u8 reserved1 : 2;
794#endif
795 __u8 add_len;
796 __u32 last_lba;
797 __u32 block_size;
798 __u16 blocking;
799#if defined(__BIG_ENDIAN_BITFIELD)
800 __u8 reserved2 : 7;
801 __u8 page_present : 1;
802#elif defined(__LITTLE_ENDIAN_BITFIELD)
803 __u8 page_present : 1;
804 __u8 reserved2 : 7;
805#endif
806 __u8 reserved3;
807};
808
809typedef struct {
810 __be16 disc_information_length;
811#if defined(__BIG_ENDIAN_BITFIELD)
812 __u8 reserved1 : 3;
813 __u8 erasable : 1;
814 __u8 border_status : 2;
815 __u8 disc_status : 2;
816#elif defined(__LITTLE_ENDIAN_BITFIELD)
817 __u8 disc_status : 2;
818 __u8 border_status : 2;
819 __u8 erasable : 1;
820 __u8 reserved1 : 3;
821#else
822#error "Please fix <asm/byteorder.h>"
823#endif
824 __u8 n_first_track;
825 __u8 n_sessions_lsb;
826 __u8 first_track_lsb;
827 __u8 last_track_lsb;
828#if defined(__BIG_ENDIAN_BITFIELD)
829 __u8 did_v : 1;
830 __u8 dbc_v : 1;
831 __u8 uru : 1;
832 __u8 reserved2 : 2;
833 __u8 dbit : 1;
834 __u8 mrw_status : 2;
835#elif defined(__LITTLE_ENDIAN_BITFIELD)
836 __u8 mrw_status : 2;
837 __u8 dbit : 1;
838 __u8 reserved2 : 2;
839 __u8 uru : 1;
840 __u8 dbc_v : 1;
841 __u8 did_v : 1;
842#endif
843 __u8 disc_type;
844 __u8 n_sessions_msb;
845 __u8 first_track_msb;
846 __u8 last_track_msb;
847 __u32 disc_id;
848 __u32 lead_in;
849 __u32 lead_out;
850 __u8 disc_bar_code[8];
851 __u8 reserved3;
852 __u8 n_opc;
853} disc_information;
854
855typedef struct {
856 __be16 track_information_length;
857 __u8 track_lsb;
858 __u8 session_lsb;
859 __u8 reserved1;
860#if defined(__BIG_ENDIAN_BITFIELD)
861 __u8 reserved2 : 2;
862 __u8 damage : 1;
863 __u8 copy : 1;
864 __u8 track_mode : 4;
865 __u8 rt : 1;
866 __u8 blank : 1;
867 __u8 packet : 1;
868 __u8 fp : 1;
869 __u8 data_mode : 4;
870 __u8 reserved3 : 6;
871 __u8 lra_v : 1;
872 __u8 nwa_v : 1;
873#elif defined(__LITTLE_ENDIAN_BITFIELD)
874 __u8 track_mode : 4;
875 __u8 copy : 1;
876 __u8 damage : 1;
877 __u8 reserved2 : 2;
878 __u8 data_mode : 4;
879 __u8 fp : 1;
880 __u8 packet : 1;
881 __u8 blank : 1;
882 __u8 rt : 1;
883 __u8 nwa_v : 1;
884 __u8 lra_v : 1;
885 __u8 reserved3 : 6;
886#endif
887 __be32 track_start;
888 __be32 next_writable;
889 __be32 free_blocks;
890 __be32 fixed_packet_size;
891 __be32 track_size;
892 __be32 last_rec_address;
893} track_information;
894
895struct feature_header {
896 __u32 data_len;
897 __u8 reserved1;
898 __u8 reserved2;
899 __u16 curr_profile;
900};
901
902struct mode_page_header {
903 __be16 mode_data_length;
904 __u8 medium_type;
905 __u8 reserved1;
906 __u8 reserved2;
907 __u8 reserved3;
908 __be16 desc_length;
909};
910
911
912#endif /* _UAPI_LINUX_CDROM_H */
diff --git a/include/linux/cgroupstats.h b/include/uapi/linux/cgroupstats.h
index 3753c33160d..3753c33160d 100644
--- a/include/linux/cgroupstats.h
+++ b/include/uapi/linux/cgroupstats.h
diff --git a/include/linux/chio.h b/include/uapi/linux/chio.h
index d9bac7f9728..d9bac7f9728 100644
--- a/include/linux/chio.h
+++ b/include/uapi/linux/chio.h
diff --git a/include/uapi/linux/cm4000_cs.h b/include/uapi/linux/cm4000_cs.h
new file mode 100644
index 00000000000..bc51f77db91
--- /dev/null
+++ b/include/uapi/linux/cm4000_cs.h
@@ -0,0 +1,62 @@
1#ifndef _UAPI_CM4000_H_
2#define _UAPI_CM4000_H_
3
4#include <linux/types.h>
5
6#define MAX_ATR 33
7
8#define CM4000_MAX_DEV 4
9
10/* those two structures are passed via ioctl() from/to userspace. They are
11 * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
12 * not to break compilation of userspace apps. -HW */
13
14typedef struct atreq {
15 __s32 atr_len;
16 unsigned char atr[64];
17 __s32 power_act;
18 unsigned char bIFSD;
19 unsigned char bIFSC;
20} atreq_t;
21
22
23/* what is particularly stupid in the original driver is the arch-dependent
24 * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
25 * will lay out the structure members differently than the 64bit kernel.
26 *
27 * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
28 * On 32bit this will make no difference. With 64bit kernels, it will make
29 * 32bit apps work, too.
30 */
31
32typedef struct ptsreq {
33 __u32 protocol; /*T=0: 2^0, T=1: 2^1*/
34 unsigned char flags;
35 unsigned char pts1;
36 unsigned char pts2;
37 unsigned char pts3;
38} ptsreq_t;
39
40#define CM_IOC_MAGIC 'c'
41#define CM_IOC_MAXNR 255
42
43#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
44#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
45#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
46#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
47#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
48
49#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
50
51/* card and device states */
52#define CM_CARD_INSERTED 0x01
53#define CM_CARD_POWERED 0x02
54#define CM_ATR_PRESENT 0x04
55#define CM_ATR_VALID 0x08
56#define CM_STATE_VALID 0x0f
57/* extra info only from CM4000 */
58#define CM_NO_READER 0x10
59#define CM_BAD_CARD 0x20
60
61
62#endif /* _UAPI_CM4000_H_ */
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
new file mode 100644
index 00000000000..0d7b49973bb
--- /dev/null
+++ b/include/uapi/linux/cn_proc.h
@@ -0,0 +1,121 @@
1/*
2 * cn_proc.h - process events connector
3 *
4 * Copyright (C) Matt Helsley, IBM Corp. 2005
5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
6 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
7 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it would be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 */
17
18#ifndef _UAPICN_PROC_H
19#define _UAPICN_PROC_H
20
21#include <linux/types.h>
22
23/*
24 * Userspace sends this enum to register with the kernel that it is listening
25 * for events on the connector.
26 */
27enum proc_cn_mcast_op {
28 PROC_CN_MCAST_LISTEN = 1,
29 PROC_CN_MCAST_IGNORE = 2
30};
31
32/*
33 * From the user's point of view, the process
34 * ID is the thread group ID and thread ID is the internal
35 * kernel "pid". So, fields are assigned as follow:
36 *
37 * In user space - In kernel space
38 *
39 * parent process ID = parent->tgid
40 * parent thread ID = parent->pid
41 * child process ID = child->tgid
42 * child thread ID = child->pid
43 */
44
45struct proc_event {
46 enum what {
47 /* Use successive bits so the enums can be used to record
48 * sets of events as well
49 */
50 PROC_EVENT_NONE = 0x00000000,
51 PROC_EVENT_FORK = 0x00000001,
52 PROC_EVENT_EXEC = 0x00000002,
53 PROC_EVENT_UID = 0x00000004,
54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100,
57 PROC_EVENT_COMM = 0x00000200,
58 /* "next" should be 0x00000400 */
59 /* "last" is the last process event: exit */
60 PROC_EVENT_EXIT = 0x80000000
61 } what;
62 __u32 cpu;
63 __u64 __attribute__((aligned(8))) timestamp_ns;
64 /* Number of nano seconds since system boot */
65 union { /* must be last field of proc_event struct */
66 struct {
67 __u32 err;
68 } ack;
69
70 struct fork_proc_event {
71 __kernel_pid_t parent_pid;
72 __kernel_pid_t parent_tgid;
73 __kernel_pid_t child_pid;
74 __kernel_pid_t child_tgid;
75 } fork;
76
77 struct exec_proc_event {
78 __kernel_pid_t process_pid;
79 __kernel_pid_t process_tgid;
80 } exec;
81
82 struct id_proc_event {
83 __kernel_pid_t process_pid;
84 __kernel_pid_t process_tgid;
85 union {
86 __u32 ruid; /* task uid */
87 __u32 rgid; /* task gid */
88 } r;
89 union {
90 __u32 euid;
91 __u32 egid;
92 } e;
93 } id;
94
95 struct sid_proc_event {
96 __kernel_pid_t process_pid;
97 __kernel_pid_t process_tgid;
98 } sid;
99
100 struct ptrace_proc_event {
101 __kernel_pid_t process_pid;
102 __kernel_pid_t process_tgid;
103 __kernel_pid_t tracer_pid;
104 __kernel_pid_t tracer_tgid;
105 } ptrace;
106
107 struct comm_proc_event {
108 __kernel_pid_t process_pid;
109 __kernel_pid_t process_tgid;
110 char comm[16];
111 } comm;
112
113 struct exit_proc_event {
114 __kernel_pid_t process_pid;
115 __kernel_pid_t process_tgid;
116 __u32 exit_code, exit_signal;
117 } exit;
118 } event_data;
119};
120
121#endif /* _UAPICN_PROC_H */
diff --git a/include/uapi/linux/coda.h b/include/uapi/linux/coda.h
new file mode 100644
index 00000000000..695fade33c6
--- /dev/null
+++ b/include/uapi/linux/coda.h
@@ -0,0 +1,741 @@
1/*
2 You may distribute this file under either of the two licenses that
3 follow at your discretion.
4*/
5
6/* BLURB lgpl
7
8 Coda File System
9 Release 5
10
11 Copyright (c) 1987-1999 Carnegie Mellon University
12 Additional copyrights listed below
13
14This code is distributed "AS IS" without warranty of any kind under
15the terms of the GNU Library General Public Licence Version 2, as
16shown in the file LICENSE, or under the license shown below. The
17technical and financial contributors to Coda are listed in the file
18CREDITS.
19
20 Additional copyrights
21*/
22
23/*
24
25 Coda: an Experimental Distributed File System
26 Release 4.0
27
28 Copyright (c) 1987-1999 Carnegie Mellon University
29 All Rights Reserved
30
31Permission to use, copy, modify and distribute this software and its
32documentation is hereby granted, provided that both the copyright
33notice and this permission notice appear in all copies of the
34software, derivative works or modified versions, and any portions
35thereof, and that both notices appear in supporting documentation, and
36that credit is given to Carnegie Mellon University in all documents
37and publicity pertaining to direct or indirect use of this code or its
38derivatives.
39
40CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
41SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
42FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
43DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
44RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
45ANY DERIVATIVE WORK.
46
47Carnegie Mellon encourages users of this software to return any
48improvements or extensions that they make, and to grant Carnegie
49Mellon the rights to redistribute these changes without encumbrance.
50*/
51
52/*
53 *
54 * Based on cfs.h from Mach, but revamped for increased simplicity.
55 * Linux modifications by
56 * Peter Braam, Aug 1996
57 */
58
59#ifndef _UAPI_CODA_HEADER_
60#define _UAPI_CODA_HEADER_
61
62
63/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
64#if defined(__NetBSD__) || \
65 ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
66#include <sys/types.h>
67#endif
68
69#ifndef CODA_MAXSYMLINKS
70#define CODA_MAXSYMLINKS 10
71#endif
72
73#if defined(DJGPP) || defined(__CYGWIN32__)
74#ifdef KERNEL
75typedef unsigned long u_long;
76typedef unsigned int u_int;
77typedef unsigned short u_short;
78typedef u_long ino_t;
79typedef u_long dev_t;
80typedef void * caddr_t;
81#ifdef DOS
82typedef unsigned __int64 u_quad_t;
83#else
84typedef unsigned long long u_quad_t;
85#endif
86
87#define inline
88
89struct timespec {
90 long ts_sec;
91 long ts_nsec;
92};
93#else /* DJGPP but not KERNEL */
94#include <sys/time.h>
95typedef unsigned long long u_quad_t;
96#endif /* !KERNEL */
97#endif /* !DJGPP */
98
99
100#if defined(__linux__)
101#include <linux/time.h>
102#define cdev_t u_quad_t
103#ifndef __KERNEL__
104#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
105#define _UQUAD_T_ 1
106typedef unsigned long long u_quad_t;
107#endif
108#endif /* __KERNEL__ */
109#else
110#define cdev_t dev_t
111#endif
112
113#ifdef __CYGWIN32__
114struct timespec {
115 time_t tv_sec; /* seconds */
116 long tv_nsec; /* nanoseconds */
117};
118#endif
119
120#ifndef __BIT_TYPES_DEFINED__
121#define __BIT_TYPES_DEFINED__
122typedef signed char int8_t;
123typedef unsigned char u_int8_t;
124typedef short int16_t;
125typedef unsigned short u_int16_t;
126typedef int int32_t;
127typedef unsigned int u_int32_t;
128#endif
129
130
131/*
132 * Cfs constants
133 */
134#define CODA_MAXNAMLEN 255
135#define CODA_MAXPATHLEN 1024
136#define CODA_MAXSYMLINK 10
137
138/* these are Coda's version of O_RDONLY etc combinations
139 * to deal with VFS open modes
140 */
141#define C_O_READ 0x001
142#define C_O_WRITE 0x002
143#define C_O_TRUNC 0x010
144#define C_O_EXCL 0x100
145#define C_O_CREAT 0x200
146
147/* these are to find mode bits in Venus */
148#define C_M_READ 00400
149#define C_M_WRITE 00200
150
151/* for access Venus will use */
152#define C_A_C_OK 8 /* Test for writing upon create. */
153#define C_A_R_OK 4 /* Test for read permission. */
154#define C_A_W_OK 2 /* Test for write permission. */
155#define C_A_X_OK 1 /* Test for execute permission. */
156#define C_A_F_OK 0 /* Test for existence. */
157
158
159
160#ifndef _VENUS_DIRENT_T_
161#define _VENUS_DIRENT_T_ 1
162struct venus_dirent {
163 u_int32_t d_fileno; /* file number of entry */
164 u_int16_t d_reclen; /* length of this record */
165 u_int8_t d_type; /* file type, see below */
166 u_int8_t d_namlen; /* length of string in d_name */
167 char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
168};
169#undef DIRSIZ
170#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
171 (((dp)->d_namlen+1 + 3) &~ 3))
172
173/*
174 * File types
175 */
176#define CDT_UNKNOWN 0
177#define CDT_FIFO 1
178#define CDT_CHR 2
179#define CDT_DIR 4
180#define CDT_BLK 6
181#define CDT_REG 8
182#define CDT_LNK 10
183#define CDT_SOCK 12
184#define CDT_WHT 14
185
186/*
187 * Convert between stat structure types and directory types.
188 */
189#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
190#define CDTTOIF(dirtype) ((dirtype) << 12)
191
192#endif
193
194#ifndef _VUID_T_
195#define _VUID_T_
196typedef u_int32_t vuid_t;
197typedef u_int32_t vgid_t;
198#endif /*_VUID_T_ */
199
200struct CodaFid {
201 u_int32_t opaque[4];
202};
203
204#define coda_f2i(fid)\
205 (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
206
207#ifndef _VENUS_VATTR_T_
208#define _VENUS_VATTR_T_
209/*
210 * Vnode types. VNON means no type.
211 */
212enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
213
214struct coda_vattr {
215 long va_type; /* vnode type (for create) */
216 u_short va_mode; /* files access mode and type */
217 short va_nlink; /* number of references to file */
218 vuid_t va_uid; /* owner user id */
219 vgid_t va_gid; /* owner group id */
220 long va_fileid; /* file id */
221 u_quad_t va_size; /* file size in bytes */
222 long va_blocksize; /* blocksize preferred for i/o */
223 struct timespec va_atime; /* time of last access */
224 struct timespec va_mtime; /* time of last modification */
225 struct timespec va_ctime; /* time file changed */
226 u_long va_gen; /* generation number of file */
227 u_long va_flags; /* flags defined for file */
228 cdev_t va_rdev; /* device special file represents */
229 u_quad_t va_bytes; /* bytes of disk space held by file */
230 u_quad_t va_filerev; /* file modification number */
231};
232
233#endif
234
235/* structure used by CODA_STATFS for getting cache information from venus */
236struct coda_statfs {
237 int32_t f_blocks;
238 int32_t f_bfree;
239 int32_t f_bavail;
240 int32_t f_files;
241 int32_t f_ffree;
242};
243
244/*
245 * Kernel <--> Venus communications.
246 */
247
248#define CODA_ROOT 2
249#define CODA_OPEN_BY_FD 3
250#define CODA_OPEN 4
251#define CODA_CLOSE 5
252#define CODA_IOCTL 6
253#define CODA_GETATTR 7
254#define CODA_SETATTR 8
255#define CODA_ACCESS 9
256#define CODA_LOOKUP 10
257#define CODA_CREATE 11
258#define CODA_REMOVE 12
259#define CODA_LINK 13
260#define CODA_RENAME 14
261#define CODA_MKDIR 15
262#define CODA_RMDIR 16
263#define CODA_SYMLINK 18
264#define CODA_READLINK 19
265#define CODA_FSYNC 20
266#define CODA_VGET 22
267#define CODA_SIGNAL 23
268#define CODA_REPLACE 24 /* DOWNCALL */
269#define CODA_FLUSH 25 /* DOWNCALL */
270#define CODA_PURGEUSER 26 /* DOWNCALL */
271#define CODA_ZAPFILE 27 /* DOWNCALL */
272#define CODA_ZAPDIR 28 /* DOWNCALL */
273#define CODA_PURGEFID 30 /* DOWNCALL */
274#define CODA_OPEN_BY_PATH 31
275#define CODA_RESOLVE 32
276#define CODA_REINTEGRATE 33
277#define CODA_STATFS 34
278#define CODA_STORE 35
279#define CODA_RELEASE 36
280#define CODA_NCALLS 37
281
282#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
283
284#define VC_MAXDATASIZE 8192
285#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
286 VC_MAXDATASIZE
287
288#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
289
290#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
291
292/*
293 * Venus <-> Coda RPC arguments
294 */
295struct coda_in_hdr {
296 u_int32_t opcode;
297 u_int32_t unique; /* Keep multiple outstanding msgs distinct */
298 pid_t pid;
299 pid_t pgid;
300 vuid_t uid;
301};
302
303/* Really important that opcode and unique are 1st two fields! */
304struct coda_out_hdr {
305 u_int32_t opcode;
306 u_int32_t unique;
307 u_int32_t result;
308};
309
310/* coda_root: NO_IN */
311struct coda_root_out {
312 struct coda_out_hdr oh;
313 struct CodaFid VFid;
314};
315
316struct coda_root_in {
317 struct coda_in_hdr in;
318};
319
320/* coda_open: */
321struct coda_open_in {
322 struct coda_in_hdr ih;
323 struct CodaFid VFid;
324 int flags;
325};
326
327struct coda_open_out {
328 struct coda_out_hdr oh;
329 cdev_t dev;
330 ino_t inode;
331};
332
333
334/* coda_store: */
335struct coda_store_in {
336 struct coda_in_hdr ih;
337 struct CodaFid VFid;
338 int flags;
339};
340
341struct coda_store_out {
342 struct coda_out_hdr out;
343};
344
345/* coda_release: */
346struct coda_release_in {
347 struct coda_in_hdr ih;
348 struct CodaFid VFid;
349 int flags;
350};
351
352struct coda_release_out {
353 struct coda_out_hdr out;
354};
355
356/* coda_close: */
357struct coda_close_in {
358 struct coda_in_hdr ih;
359 struct CodaFid VFid;
360 int flags;
361};
362
363struct coda_close_out {
364 struct coda_out_hdr out;
365};
366
367/* coda_ioctl: */
368struct coda_ioctl_in {
369 struct coda_in_hdr ih;
370 struct CodaFid VFid;
371 int cmd;
372 int len;
373 int rwflag;
374 char *data; /* Place holder for data. */
375};
376
377struct coda_ioctl_out {
378 struct coda_out_hdr oh;
379 int len;
380 caddr_t data; /* Place holder for data. */
381};
382
383
384/* coda_getattr: */
385struct coda_getattr_in {
386 struct coda_in_hdr ih;
387 struct CodaFid VFid;
388};
389
390struct coda_getattr_out {
391 struct coda_out_hdr oh;
392 struct coda_vattr attr;
393};
394
395
396/* coda_setattr: NO_OUT */
397struct coda_setattr_in {
398 struct coda_in_hdr ih;
399 struct CodaFid VFid;
400 struct coda_vattr attr;
401};
402
403struct coda_setattr_out {
404 struct coda_out_hdr out;
405};
406
407/* coda_access: NO_OUT */
408struct coda_access_in {
409 struct coda_in_hdr ih;
410 struct CodaFid VFid;
411 int flags;
412};
413
414struct coda_access_out {
415 struct coda_out_hdr out;
416};
417
418
419/* lookup flags */
420#define CLU_CASE_SENSITIVE 0x01
421#define CLU_CASE_INSENSITIVE 0x02
422
423/* coda_lookup: */
424struct coda_lookup_in {
425 struct coda_in_hdr ih;
426 struct CodaFid VFid;
427 int name; /* Place holder for data. */
428 int flags;
429};
430
431struct coda_lookup_out {
432 struct coda_out_hdr oh;
433 struct CodaFid VFid;
434 int vtype;
435};
436
437
438/* coda_create: */
439struct coda_create_in {
440 struct coda_in_hdr ih;
441 struct CodaFid VFid;
442 struct coda_vattr attr;
443 int excl;
444 int mode;
445 int name; /* Place holder for data. */
446};
447
448struct coda_create_out {
449 struct coda_out_hdr oh;
450 struct CodaFid VFid;
451 struct coda_vattr attr;
452};
453
454
455/* coda_remove: NO_OUT */
456struct coda_remove_in {
457 struct coda_in_hdr ih;
458 struct CodaFid VFid;
459 int name; /* Place holder for data. */
460};
461
462struct coda_remove_out {
463 struct coda_out_hdr out;
464};
465
466/* coda_link: NO_OUT */
467struct coda_link_in {
468 struct coda_in_hdr ih;
469 struct CodaFid sourceFid; /* cnode to link *to* */
470 struct CodaFid destFid; /* Directory in which to place link */
471 int tname; /* Place holder for data. */
472};
473
474struct coda_link_out {
475 struct coda_out_hdr out;
476};
477
478
479/* coda_rename: NO_OUT */
480struct coda_rename_in {
481 struct coda_in_hdr ih;
482 struct CodaFid sourceFid;
483 int srcname;
484 struct CodaFid destFid;
485 int destname;
486};
487
488struct coda_rename_out {
489 struct coda_out_hdr out;
490};
491
492/* coda_mkdir: */
493struct coda_mkdir_in {
494 struct coda_in_hdr ih;
495 struct CodaFid VFid;
496 struct coda_vattr attr;
497 int name; /* Place holder for data. */
498};
499
500struct coda_mkdir_out {
501 struct coda_out_hdr oh;
502 struct CodaFid VFid;
503 struct coda_vattr attr;
504};
505
506
507/* coda_rmdir: NO_OUT */
508struct coda_rmdir_in {
509 struct coda_in_hdr ih;
510 struct CodaFid VFid;
511 int name; /* Place holder for data. */
512};
513
514struct coda_rmdir_out {
515 struct coda_out_hdr out;
516};
517
518/* coda_symlink: NO_OUT */
519struct coda_symlink_in {
520 struct coda_in_hdr ih;
521 struct CodaFid VFid; /* Directory to put symlink in */
522 int srcname;
523 struct coda_vattr attr;
524 int tname;
525};
526
527struct coda_symlink_out {
528 struct coda_out_hdr out;
529};
530
531/* coda_readlink: */
532struct coda_readlink_in {
533 struct coda_in_hdr ih;
534 struct CodaFid VFid;
535};
536
537struct coda_readlink_out {
538 struct coda_out_hdr oh;
539 int count;
540 caddr_t data; /* Place holder for data. */
541};
542
543
544/* coda_fsync: NO_OUT */
545struct coda_fsync_in {
546 struct coda_in_hdr ih;
547 struct CodaFid VFid;
548};
549
550struct coda_fsync_out {
551 struct coda_out_hdr out;
552};
553
554/* coda_vget: */
555struct coda_vget_in {
556 struct coda_in_hdr ih;
557 struct CodaFid VFid;
558};
559
560struct coda_vget_out {
561 struct coda_out_hdr oh;
562 struct CodaFid VFid;
563 int vtype;
564};
565
566
567/* CODA_SIGNAL is out-of-band, doesn't need data. */
568/* CODA_INVALIDATE is a venus->kernel call */
569/* CODA_FLUSH is a venus->kernel call */
570
571/* coda_purgeuser: */
572/* CODA_PURGEUSER is a venus->kernel call */
573struct coda_purgeuser_out {
574 struct coda_out_hdr oh;
575 vuid_t uid;
576};
577
578/* coda_zapfile: */
579/* CODA_ZAPFILE is a venus->kernel call */
580struct coda_zapfile_out {
581 struct coda_out_hdr oh;
582 struct CodaFid CodaFid;
583};
584
585/* coda_zapdir: */
586/* CODA_ZAPDIR is a venus->kernel call */
587struct coda_zapdir_out {
588 struct coda_out_hdr oh;
589 struct CodaFid CodaFid;
590};
591
592/* coda_purgefid: */
593/* CODA_PURGEFID is a venus->kernel call */
594struct coda_purgefid_out {
595 struct coda_out_hdr oh;
596 struct CodaFid CodaFid;
597};
598
599/* coda_replace: */
600/* CODA_REPLACE is a venus->kernel call */
601struct coda_replace_out { /* coda_replace is a venus->kernel call */
602 struct coda_out_hdr oh;
603 struct CodaFid NewFid;
604 struct CodaFid OldFid;
605};
606
607/* coda_open_by_fd: */
608struct coda_open_by_fd_in {
609 struct coda_in_hdr ih;
610 struct CodaFid VFid;
611 int flags;
612};
613
614struct coda_open_by_fd_out {
615 struct coda_out_hdr oh;
616 int fd;
617
618#ifdef __KERNEL__
619 struct file *fh; /* not passed from userspace but used in-kernel only */
620#endif
621};
622
623/* coda_open_by_path: */
624struct coda_open_by_path_in {
625 struct coda_in_hdr ih;
626 struct CodaFid VFid;
627 int flags;
628};
629
630struct coda_open_by_path_out {
631 struct coda_out_hdr oh;
632 int path;
633};
634
635/* coda_statfs: NO_IN */
636struct coda_statfs_in {
637 struct coda_in_hdr in;
638};
639
640struct coda_statfs_out {
641 struct coda_out_hdr oh;
642 struct coda_statfs stat;
643};
644
645/*
646 * Occasionally, we don't cache the fid returned by CODA_LOOKUP.
647 * For instance, if the fid is inconsistent.
648 * This case is handled by setting the top bit of the type result parameter.
649 */
650#define CODA_NOCACHE 0x80000000
651
652union inputArgs {
653 struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
654 struct coda_open_in coda_open;
655 struct coda_store_in coda_store;
656 struct coda_release_in coda_release;
657 struct coda_close_in coda_close;
658 struct coda_ioctl_in coda_ioctl;
659 struct coda_getattr_in coda_getattr;
660 struct coda_setattr_in coda_setattr;
661 struct coda_access_in coda_access;
662 struct coda_lookup_in coda_lookup;
663 struct coda_create_in coda_create;
664 struct coda_remove_in coda_remove;
665 struct coda_link_in coda_link;
666 struct coda_rename_in coda_rename;
667 struct coda_mkdir_in coda_mkdir;
668 struct coda_rmdir_in coda_rmdir;
669 struct coda_symlink_in coda_symlink;
670 struct coda_readlink_in coda_readlink;
671 struct coda_fsync_in coda_fsync;
672 struct coda_vget_in coda_vget;
673 struct coda_open_by_fd_in coda_open_by_fd;
674 struct coda_open_by_path_in coda_open_by_path;
675 struct coda_statfs_in coda_statfs;
676};
677
678union outputArgs {
679 struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
680 struct coda_root_out coda_root;
681 struct coda_open_out coda_open;
682 struct coda_ioctl_out coda_ioctl;
683 struct coda_getattr_out coda_getattr;
684 struct coda_lookup_out coda_lookup;
685 struct coda_create_out coda_create;
686 struct coda_mkdir_out coda_mkdir;
687 struct coda_readlink_out coda_readlink;
688 struct coda_vget_out coda_vget;
689 struct coda_purgeuser_out coda_purgeuser;
690 struct coda_zapfile_out coda_zapfile;
691 struct coda_zapdir_out coda_zapdir;
692 struct coda_purgefid_out coda_purgefid;
693 struct coda_replace_out coda_replace;
694 struct coda_open_by_fd_out coda_open_by_fd;
695 struct coda_open_by_path_out coda_open_by_path;
696 struct coda_statfs_out coda_statfs;
697};
698
699union coda_downcalls {
700 /* CODA_INVALIDATE is a venus->kernel call */
701 /* CODA_FLUSH is a venus->kernel call */
702 struct coda_purgeuser_out purgeuser;
703 struct coda_zapfile_out zapfile;
704 struct coda_zapdir_out zapdir;
705 struct coda_purgefid_out purgefid;
706 struct coda_replace_out replace;
707};
708
709
710/*
711 * Used for identifying usage of "Control" and pioctls
712 */
713
714#define PIOCPARM_MASK 0x0000ffff
715struct ViceIoctl {
716 void __user *in; /* Data to be transferred in */
717 void __user *out; /* Data to be transferred out */
718 u_short in_size; /* Size of input buffer <= 2K */
719 u_short out_size; /* Maximum size of output buffer, <= 2K */
720};
721
722struct PioctlData {
723 const char __user *path;
724 int follow;
725 struct ViceIoctl vi;
726};
727
728#define CODA_CONTROL ".CONTROL"
729#define CODA_CONTROLLEN 8
730#define CTL_INO -1
731
732/* Data passed to mount */
733
734#define CODA_MOUNT_VERSION 1
735
736struct coda_mount_data {
737 int version;
738 int fd; /* Opened device */
739};
740
741#endif /* _UAPI_CODA_HEADER_ */
diff --git a/include/uapi/linux/coda_psdev.h b/include/uapi/linux/coda_psdev.h
new file mode 100644
index 00000000000..79d05981fc4
--- /dev/null
+++ b/include/uapi/linux/coda_psdev.h
@@ -0,0 +1,27 @@
1#ifndef _UAPI__CODA_PSDEV_H
2#define _UAPI__CODA_PSDEV_H
3
4#include <linux/magic.h>
5
6#define CODA_PSDEV_MAJOR 67
7#define MAX_CODADEVS 5 /* how many do we allow */
8
9
10/* messages between coda filesystem in kernel and Venus */
11struct upc_req {
12 struct list_head uc_chain;
13 caddr_t uc_data;
14 u_short uc_flags;
15 u_short uc_inSize; /* Size is at most 5000 bytes */
16 u_short uc_outSize;
17 u_short uc_opcode; /* copied from data to save lookup */
18 int uc_unique;
19 wait_queue_head_t uc_sleep; /* process' wait queue */
20};
21
22#define CODA_REQ_ASYNC 0x1
23#define CODA_REQ_READ 0x2
24#define CODA_REQ_WRITE 0x4
25#define CODA_REQ_ABORT 0x8
26
27#endif /* _UAPI__CODA_PSDEV_H */
diff --git a/include/linux/coff.h b/include/uapi/linux/coff.h
index 6354a7fe22b..6354a7fe22b 100644
--- a/include/linux/coff.h
+++ b/include/uapi/linux/coff.h
diff --git a/include/uapi/linux/connector.h b/include/uapi/linux/connector.h
new file mode 100644
index 00000000000..8761a0349c7
--- /dev/null
+++ b/include/uapi/linux/connector.h
@@ -0,0 +1,77 @@
1/*
2 * connector.h
3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef _UAPI__CONNECTOR_H
23#define _UAPI__CONNECTOR_H
24
25#include <linux/types.h>
26
27/*
28 * Process Events connector unique ids -- used for message routing
29 */
30#define CN_IDX_PROC 0x1
31#define CN_VAL_PROC 0x1
32#define CN_IDX_CIFS 0x2
33#define CN_VAL_CIFS 0x1
34#define CN_W1_IDX 0x3 /* w1 communication */
35#define CN_W1_VAL 0x1
36#define CN_IDX_V86D 0x4
37#define CN_VAL_V86D_UVESAFB 0x1
38#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
39#define CN_DST_IDX 0x6
40#define CN_DST_VAL 0x1
41#define CN_IDX_DM 0x7 /* Device Mapper */
42#define CN_VAL_DM_USERSPACE_LOG 0x1
43#define CN_IDX_DRBD 0x8
44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46#define CN_KVP_VAL 0x1 /* queries from the kernel */
47
48#define CN_NETLINK_USERS 10 /* Highest index + 1 */
49
50/*
51 * Maximum connector's message size.
52 */
53#define CONNECTOR_MAX_MSG_SIZE 16384
54
55/*
56 * idx and val are unique identifiers which
57 * are used for message routing and
58 * must be registered in connector.h for in-kernel usage.
59 */
60
61struct cb_id {
62 __u32 idx;
63 __u32 val;
64};
65
66struct cn_msg {
67 struct cb_id id;
68
69 __u32 seq;
70 __u32 ack;
71
72 __u16 len; /* Length of the following data */
73 __u16 flags;
74 __u8 data[0];
75};
76
77#endif /* _UAPI__CONNECTOR_H */
diff --git a/include/linux/const.h b/include/uapi/linux/const.h
index c22c707c455..c22c707c455 100644
--- a/include/linux/const.h
+++ b/include/uapi/linux/const.h
diff --git a/include/uapi/linux/cramfs_fs.h b/include/uapi/linux/cramfs_fs.h
new file mode 100644
index 00000000000..e4611a9b924
--- /dev/null
+++ b/include/uapi/linux/cramfs_fs.h
@@ -0,0 +1,88 @@
1#ifndef _UAPI__CRAMFS_H
2#define _UAPI__CRAMFS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6
7#define CRAMFS_SIGNATURE "Compressed ROMFS"
8
9/*
10 * Width of various bitfields in struct cramfs_inode.
11 * Primarily used to generate warnings in mkcramfs.
12 */
13#define CRAMFS_MODE_WIDTH 16
14#define CRAMFS_UID_WIDTH 16
15#define CRAMFS_SIZE_WIDTH 24
16#define CRAMFS_GID_WIDTH 8
17#define CRAMFS_NAMELEN_WIDTH 6
18#define CRAMFS_OFFSET_WIDTH 26
19
20/*
21 * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
22 * path length is 63 << 2 = 252.
23 */
24#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
25
26/*
27 * Reasonably terse representation of the inode data.
28 */
29struct cramfs_inode {
30 __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
31 /* SIZE for device files is i_rdev */
32 __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
33 /* NAMELEN is the length of the file name, divided by 4 and
34 rounded up. (cramfs doesn't support hard links.) */
35 /* OFFSET: For symlinks and non-empty regular files, this
36 contains the offset (divided by 4) of the file data in
37 compressed form (starting with an array of block pointers;
38 see README). For non-empty directories it is the offset
39 (divided by 4) of the inode of the first file in that
40 directory. For anything else, offset is zero. */
41 __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
42};
43
44struct cramfs_info {
45 __u32 crc;
46 __u32 edition;
47 __u32 blocks;
48 __u32 files;
49};
50
51/*
52 * Superblock information at the beginning of the FS.
53 */
54struct cramfs_super {
55 __u32 magic; /* 0x28cd3d45 - random number */
56 __u32 size; /* length in bytes */
57 __u32 flags; /* feature flags */
58 __u32 future; /* reserved for future use */
59 __u8 signature[16]; /* "Compressed ROMFS" */
60 struct cramfs_info fsid; /* unique filesystem info */
61 __u8 name[16]; /* user-defined name */
62 struct cramfs_inode root; /* root inode data */
63};
64
65/*
66 * Feature flags
67 *
68 * 0x00000000 - 0x000000ff: features that work for all past kernels
69 * 0x00000100 - 0xffffffff: features that don't work for past kernels
70 */
71#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */
72#define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */
73#define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
74#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
75#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
76
77/*
78 * Valid values in super.flags. Currently we refuse to mount
79 * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be
80 * changed to test super.future instead.
81 */
82#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
83 | CRAMFS_FLAG_HOLES \
84 | CRAMFS_FLAG_WRONG_SIGNATURE \
85 | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
86
87
88#endif /* _UAPI__CRAMFS_H */
diff --git a/include/uapi/linux/cuda.h b/include/uapi/linux/cuda.h
new file mode 100644
index 00000000000..286f9f10fce
--- /dev/null
+++ b/include/uapi/linux/cuda.h
@@ -0,0 +1,33 @@
1/*
2 * Definitions for talking to the CUDA. The CUDA is a microcontroller
3 * which controls the ADB, system power, RTC, and various other things.
4 *
5 * Copyright (C) 1996 Paul Mackerras.
6 */
7
8#ifndef _UAPI_LINUX_CUDA_H
9#define _UAPI_LINUX_CUDA_H
10
11/* CUDA commands (2nd byte) */
12#define CUDA_WARM_START 0
13#define CUDA_AUTOPOLL 1
14#define CUDA_GET_6805_ADDR 2
15#define CUDA_GET_TIME 3
16#define CUDA_GET_PRAM 7
17#define CUDA_SET_6805_ADDR 8
18#define CUDA_SET_TIME 9
19#define CUDA_POWERDOWN 0xa
20#define CUDA_POWERUP_TIME 0xb
21#define CUDA_SET_PRAM 0xc
22#define CUDA_MS_RESET 0xd
23#define CUDA_SEND_DFAC 0xe
24#define CUDA_RESET_SYSTEM 0x11
25#define CUDA_SET_IPL 0x12
26#define CUDA_SET_AUTO_RATE 0x14
27#define CUDA_GET_AUTO_RATE 0x16
28#define CUDA_SET_DEVICE_LIST 0x19
29#define CUDA_GET_DEVICE_LIST 0x1a
30#define CUDA_GET_SET_IIC 0x22
31
32
33#endif /* _UAPI_LINUX_CUDA_H */
diff --git a/include/uapi/linux/cyclades.h b/include/uapi/linux/cyclades.h
new file mode 100644
index 00000000000..12b587aa361
--- /dev/null
+++ b/include/uapi/linux/cyclades.h
@@ -0,0 +1,493 @@
1/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
2 * linux/include/linux/cyclades.h
3 *
4 * This file was initially written by
5 * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
6 * Ivan Passos <ivan@cyclades.com>.
7 *
8 * This file contains the general definitions for the cyclades.c driver
9 *$Log: cyclades.h,v $
10 *Revision 3.1 2002/01/29 11:36:16 henrique
11 *added throttle field on struct cyclades_port to indicate whether the
12 *port is throttled or not
13 *
14 *Revision 3.1 2000/04/19 18:52:52 ivan
15 *converted address fields to unsigned long and added fields for physical
16 *addresses on cyclades_card structure;
17 *
18 *Revision 3.0 1998/11/02 14:20:59 ivan
19 *added nports field on cyclades_card structure;
20 *
21 *Revision 2.5 1998/08/03 16:57:01 ivan
22 *added cyclades_idle_stats structure;
23 *
24 *Revision 2.4 1998/06/01 12:09:53 ivan
25 *removed closing_wait2 from cyclades_port structure;
26 *
27 *Revision 2.3 1998/03/16 18:01:12 ivan
28 *changes in the cyclades_port structure to get it closer to the
29 *standard serial port structure;
30 *added constants for new ioctls;
31 *
32 *Revision 2.2 1998/02/17 16:50:00 ivan
33 *changes in the cyclades_port structure (addition of shutdown_wait and
34 *chip_rev variables);
35 *added constants for new ioctls and for CD1400 rev. numbers.
36 *
37 *Revision 2.1 1997/10/24 16:03:00 ivan
38 *added rflow (which allows enabling the CD1400 special flow control
39 *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
40 *cyclades_port structure;
41 *added Alpha support
42 *
43 *Revision 2.0 1997/06/30 10:30:00 ivan
44 *added some new doorbell command constants related to IOCTLW and
45 *UART error signaling
46 *
47 *Revision 1.8 1997/06/03 15:30:00 ivan
48 *added constant ZFIRM_HLT
49 *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
50 *
51 *Revision 1.7 1997/03/26 10:30:00 daniel
52 *new entries at the end of cyclades_port struct to reallocate
53 *variables illegally allocated within card memory.
54 *
55 *Revision 1.6 1996/09/09 18:35:30 bentson
56 *fold in changes for Cyclom-Z -- including structures for
57 *communicating with board as well modest changes to original
58 *structures to support new features.
59 *
60 *Revision 1.5 1995/11/13 21:13:31 bentson
61 *changes suggested by Michael Chastain <mec@duracef.shout.net>
62 *to support use of this file in non-kernel applications
63 *
64 *
65 */
66
67#ifndef _UAPI_LINUX_CYCLADES_H
68#define _UAPI_LINUX_CYCLADES_H
69
70#include <linux/types.h>
71
72struct cyclades_monitor {
73 unsigned long int_count;
74 unsigned long char_count;
75 unsigned long char_max;
76 unsigned long char_last;
77};
78
79/*
80 * These stats all reflect activity since the device was last initialized.
81 * (i.e., since the port was opened with no other processes already having it
82 * open)
83 */
84struct cyclades_idle_stats {
85 __kernel_time_t in_use; /* Time device has been in use (secs) */
86 __kernel_time_t recv_idle; /* Time since last char received (secs) */
87 __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
88 unsigned long recv_bytes; /* Bytes received */
89 unsigned long xmit_bytes; /* Bytes transmitted */
90 unsigned long overruns; /* Input overruns */
91 unsigned long frame_errs; /* Input framing errors */
92 unsigned long parity_errs; /* Input parity errors */
93};
94
95#define CYCLADES_MAGIC 0x4359
96
97#define CYGETMON 0x435901
98#define CYGETTHRESH 0x435902
99#define CYSETTHRESH 0x435903
100#define CYGETDEFTHRESH 0x435904
101#define CYSETDEFTHRESH 0x435905
102#define CYGETTIMEOUT 0x435906
103#define CYSETTIMEOUT 0x435907
104#define CYGETDEFTIMEOUT 0x435908
105#define CYSETDEFTIMEOUT 0x435909
106#define CYSETRFLOW 0x43590a
107#define CYGETRFLOW 0x43590b
108#define CYSETRTSDTR_INV 0x43590c
109#define CYGETRTSDTR_INV 0x43590d
110#define CYZSETPOLLCYCLE 0x43590e
111#define CYZGETPOLLCYCLE 0x43590f
112#define CYGETCD1400VER 0x435910
113#define CYSETWAIT 0x435912
114#define CYGETWAIT 0x435913
115
116/*************** CYCLOM-Z ADDITIONS ***************/
117
118#define CZIOC ('M' << 8)
119#define CZ_NBOARDS (CZIOC|0xfa)
120#define CZ_BOOT_START (CZIOC|0xfb)
121#define CZ_BOOT_DATA (CZIOC|0xfc)
122#define CZ_BOOT_END (CZIOC|0xfd)
123#define CZ_TEST (CZIOC|0xfe)
124
125#define CZ_DEF_POLL (HZ/25)
126
127#define MAX_BOARD 4 /* Max number of boards */
128#define MAX_DEV 256 /* Max number of ports total */
129#define CYZ_MAX_SPEED 921600
130
131#define CYZ_FIFO_SIZE 16
132
133#define CYZ_BOOT_NWORDS 0x100
134struct CYZ_BOOT_CTRL {
135 unsigned short nboard;
136 int status[MAX_BOARD];
137 int nchannel[MAX_BOARD];
138 int fw_rev[MAX_BOARD];
139 unsigned long offset;
140 unsigned long data[CYZ_BOOT_NWORDS];
141};
142
143
144#ifndef DP_WINDOW_SIZE
145/*
146 * Memory Window Sizes
147 */
148
149#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
150#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
151 8Zo V.2 */
152#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
153
154/*
155 * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
156 * normally will access only interested on the fpga_id, fpga_version,
157 * start_cpu and stop_cpu.
158 */
159
160struct CUSTOM_REG {
161 __u32 fpga_id; /* FPGA Identification Register */
162 __u32 fpga_version; /* FPGA Version Number Register */
163 __u32 cpu_start; /* CPU start Register (write) */
164 __u32 cpu_stop; /* CPU stop Register (write) */
165 __u32 misc_reg; /* Miscellaneous Register */
166 __u32 idt_mode; /* IDT mode Register */
167 __u32 uart_irq_status; /* UART IRQ status Register */
168 __u32 clear_timer0_irq; /* Clear timer interrupt Register */
169 __u32 clear_timer1_irq; /* Clear timer interrupt Register */
170 __u32 clear_timer2_irq; /* Clear timer interrupt Register */
171 __u32 test_register; /* Test Register */
172 __u32 test_count; /* Test Count Register */
173 __u32 timer_select; /* Timer select register */
174 __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
175 __u32 ram_wait_state; /* RAM wait-state Register */
176 __u32 uart_wait_state; /* UART wait-state Register */
177 __u32 timer_wait_state; /* timer wait-state Register */
178 __u32 ack_wait_state; /* ACK wait State Register */
179};
180
181/*
182 * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
183 * registers. This structure can be used to access the 9060 registers
184 * (memory mapped).
185 */
186
187struct RUNTIME_9060 {
188 __u32 loc_addr_range; /* 00h - Local Address Range */
189 __u32 loc_addr_base; /* 04h - Local Address Base */
190 __u32 loc_arbitr; /* 08h - Local Arbitration */
191 __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
192 __u32 loc_rom_range; /* 10h - Local ROM Range */
193 __u32 loc_rom_base; /* 14h - Local ROM Base */
194 __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
195 __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
196 __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
197 __u32 loc_range_io; /* 24h - Local Range for Master IO */
198 __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
199 __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
200 __u32 filler1; /* 30h */
201 __u32 filler2; /* 34h */
202 __u32 filler3; /* 38h */
203 __u32 filler4; /* 3Ch */
204 __u32 mail_box_0; /* 40h - Mail Box 0 */
205 __u32 mail_box_1; /* 44h - Mail Box 1 */
206 __u32 mail_box_2; /* 48h - Mail Box 2 */
207 __u32 mail_box_3; /* 4Ch - Mail Box 3 */
208 __u32 filler5; /* 50h */
209 __u32 filler6; /* 54h */
210 __u32 filler7; /* 58h */
211 __u32 filler8; /* 5Ch */
212 __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
213 __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
214 __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
215 __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
216};
217
218/* Values for the Local Base Address re-map register */
219
220#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
221#define WIN_CREG 0x14000001L /* set the window to custom Registers */
222
223/* Values timer select registers */
224
225#define TIMER_BY_1M 0x00 /* clock divided by 1M */
226#define TIMER_BY_256K 0x01 /* clock divided by 256k */
227#define TIMER_BY_128K 0x02 /* clock divided by 128k */
228#define TIMER_BY_32K 0x03 /* clock divided by 32k */
229
230/****************** ****************** *******************/
231#endif
232
233#ifndef ZFIRM_ID
234/* #include "zfwint.h" */
235/****************** ****************** *******************/
236/*
237 * This file contains the definitions for interfacing with the
238 * Cyclom-Z ZFIRM Firmware.
239 */
240
241/* General Constant definitions */
242
243#define MAX_CHAN 64 /* max number of channels per board */
244
245/* firmware id structure (set after boot) */
246
247#define ID_ADDRESS 0x00000180L /* signature/pointer address */
248#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
249#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
250#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
251
252#define ZF_TINACT_DEF 1000 /* default inactivity timeout
253 (1000 ms) */
254#define ZF_TINACT ZF_TINACT_DEF
255
256struct FIRM_ID {
257 __u32 signature; /* ZFIRM/U signature */
258 __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
259};
260
261/* Op. System id */
262
263#define C_OS_LINUX 0x00000030 /* generic Linux system */
264
265/* channel op_mode */
266
267#define C_CH_DISABLE 0x00000000 /* channel is disabled */
268#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
269#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
270#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
271#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
272
273/* comm_parity - parity */
274
275#define C_PR_NONE 0x00000000 /* None */
276#define C_PR_ODD 0x00000001 /* Odd */
277#define C_PR_EVEN 0x00000002 /* Even */
278#define C_PR_MARK 0x00000004 /* Mark */
279#define C_PR_SPACE 0x00000008 /* Space */
280#define C_PR_PARITY 0x000000ff
281
282#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
283#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
284
285/* comm_data_l - data length and stop bits */
286
287#define C_DL_CS5 0x00000001
288#define C_DL_CS6 0x00000002
289#define C_DL_CS7 0x00000004
290#define C_DL_CS8 0x00000008
291#define C_DL_CS 0x0000000f
292#define C_DL_1STOP 0x00000010
293#define C_DL_15STOP 0x00000020
294#define C_DL_2STOP 0x00000040
295#define C_DL_STOP 0x000000f0
296
297/* interrupt enabling/status */
298
299#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
300#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
301#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
302#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
303#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
304#define C_IN_MDCD 0x00000100 /* modem DCD change */
305#define C_IN_MDSR 0x00000200 /* modem DSR change */
306#define C_IN_MRI 0x00000400 /* modem RI change */
307#define C_IN_MCTS 0x00000800 /* modem CTS change */
308#define C_IN_RXBRK 0x00001000 /* Break received */
309#define C_IN_PR_ERROR 0x00002000 /* parity error */
310#define C_IN_FR_ERROR 0x00004000 /* frame error */
311#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
312#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
313#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
314#define C_IN_MRTS 0x00040000 /* modem RTS drop */
315#define C_IN_ICHAR 0x00080000
316
317/* flow control */
318
319#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
320#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
321#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
322#define C_FL_SWFLOW 0x0000000f
323
324/* flow status */
325
326#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
327#define C_FS_SENDING 0x00000001 /* UART is sending data */
328#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
329
330/* rs_control/rs_status RS-232 signals */
331
332#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
333 IOCTLM command */
334#define C_RS_RTS 0x00000001 /* RTS */
335#define C_RS_DTR 0x00000004 /* DTR */
336#define C_RS_DCD 0x00000100 /* CD */
337#define C_RS_DSR 0x00000200 /* DSR */
338#define C_RS_RI 0x00000400 /* RI */
339#define C_RS_CTS 0x00000800 /* CTS */
340
341/* commands Host <-> Board */
342
343#define C_CM_RESET 0x01 /* reset/flush buffers */
344#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
345#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
346#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
347#define C_CM_SENDXOFF 0x10 /* send Xoff */
348#define C_CM_SENDXON 0x11 /* send Xon */
349#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
350#define C_CM_SENDBRK 0x41 /* send break */
351#define C_CM_INTBACK 0x42 /* Interrupt back */
352#define C_CM_SET_BREAK 0x43 /* Tx break on */
353#define C_CM_CLR_BREAK 0x44 /* Tx break off */
354#define C_CM_CMD_DONE 0x45 /* Previous command done */
355#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
356#define C_CM_TINACT 0x51 /* set inactivity detection */
357#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
358#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
359#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
360#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
361#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
362#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
363#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
364 driver */
365#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
366 driver */
367
368#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
369#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
370#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
371#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
372#define C_CM_TXFEMPTY 0x64
373#define C_CM_ICHAR 0x65
374#define C_CM_MDCD 0x70 /* modem DCD change */
375#define C_CM_MDSR 0x71 /* modem DSR change */
376#define C_CM_MRI 0x72 /* modem RI change */
377#define C_CM_MCTS 0x73 /* modem CTS change */
378#define C_CM_MRTS 0x74 /* modem RTS drop */
379#define C_CM_RXBRK 0x84 /* Break received */
380#define C_CM_PR_ERROR 0x85 /* Parity error */
381#define C_CM_FR_ERROR 0x86 /* Frame error */
382#define C_CM_OVR_ERROR 0x87 /* Overrun error */
383#define C_CM_RXOFL 0x88 /* RX buffer overflow */
384#define C_CM_CMDERROR 0x90 /* command error */
385#define C_CM_FATAL 0x91 /* fatal error */
386#define C_CM_HW_RESET 0x92 /* reset board */
387
388/*
389 * CH_CTRL - This per port structure contains all parameters
390 * that control an specific port. It can be seen as the
391 * configuration registers of a "super-serial-controller".
392 */
393
394struct CH_CTRL {
395 __u32 op_mode; /* operation mode */
396 __u32 intr_enable; /* interrupt masking */
397 __u32 sw_flow; /* SW flow control */
398 __u32 flow_status; /* output flow status */
399 __u32 comm_baud; /* baud rate - numerically specified */
400 __u32 comm_parity; /* parity */
401 __u32 comm_data_l; /* data length/stop */
402 __u32 comm_flags; /* other flags */
403 __u32 hw_flow; /* HW flow control */
404 __u32 rs_control; /* RS-232 outputs */
405 __u32 rs_status; /* RS-232 inputs */
406 __u32 flow_xon; /* xon char */
407 __u32 flow_xoff; /* xoff char */
408 __u32 hw_overflow; /* hw overflow counter */
409 __u32 sw_overflow; /* sw overflow counter */
410 __u32 comm_error; /* frame/parity error counter */
411 __u32 ichar;
412 __u32 filler[7];
413};
414
415
416/*
417 * BUF_CTRL - This per channel structure contains
418 * all Tx and Rx buffer control for a given channel.
419 */
420
421struct BUF_CTRL {
422 __u32 flag_dma; /* buffers are in Host memory */
423 __u32 tx_bufaddr; /* address of the tx buffer */
424 __u32 tx_bufsize; /* tx buffer size */
425 __u32 tx_threshold; /* tx low water mark */
426 __u32 tx_get; /* tail index tx buf */
427 __u32 tx_put; /* head index tx buf */
428 __u32 rx_bufaddr; /* address of the rx buffer */
429 __u32 rx_bufsize; /* rx buffer size */
430 __u32 rx_threshold; /* rx high water mark */
431 __u32 rx_get; /* tail index rx buf */
432 __u32 rx_put; /* head index rx buf */
433 __u32 filler[5]; /* filler to align structures */
434};
435
436/*
437 * BOARD_CTRL - This per board structure contains all global
438 * control fields related to the board.
439 */
440
441struct BOARD_CTRL {
442
443 /* static info provided by the on-board CPU */
444 __u32 n_channel; /* number of channels */
445 __u32 fw_version; /* firmware version */
446
447 /* static info provided by the driver */
448 __u32 op_system; /* op_system id */
449 __u32 dr_version; /* driver version */
450
451 /* board control area */
452 __u32 inactivity; /* inactivity control */
453
454 /* host to FW commands */
455 __u32 hcmd_channel; /* channel number */
456 __u32 hcmd_param; /* pointer to parameters */
457
458 /* FW to Host commands */
459 __u32 fwcmd_channel; /* channel number */
460 __u32 fwcmd_param; /* pointer to parameters */
461 __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
462
463 /* filler so the structures are aligned */
464 __u32 filler[6];
465};
466
467/* Host Interrupt Queue */
468
469#define QUEUE_SIZE (10*MAX_CHAN)
470
471struct INT_QUEUE {
472 unsigned char intr_code[QUEUE_SIZE];
473 unsigned long channel[QUEUE_SIZE];
474 unsigned long param[QUEUE_SIZE];
475 unsigned long put;
476 unsigned long get;
477};
478
479/*
480 * ZFW_CTRL - This is the data structure that includes all other
481 * data structures used by the Firmware.
482 */
483
484struct ZFW_CTRL {
485 struct BOARD_CTRL board_ctrl;
486 struct CH_CTRL ch_ctrl[MAX_CHAN];
487 struct BUF_CTRL buf_ctrl[MAX_CHAN];
488};
489
490/****************** ****************** *******************/
491#endif
492
493#endif /* _UAPI_LINUX_CYCLADES_H */
diff --git a/include/linux/cycx_cfm.h b/include/uapi/linux/cycx_cfm.h
index 032d26ed838..032d26ed838 100644
--- a/include/linux/cycx_cfm.h
+++ b/include/uapi/linux/cycx_cfm.h
diff --git a/include/linux/dcbnl.h b/include/uapi/linux/dcbnl.h
index 6bb43382f3f..6bb43382f3f 100644
--- a/include/linux/dcbnl.h
+++ b/include/uapi/linux/dcbnl.h
diff --git a/include/uapi/linux/dccp.h b/include/uapi/linux/dccp.h
new file mode 100644
index 00000000000..52a9cd7307e
--- /dev/null
+++ b/include/uapi/linux/dccp.h
@@ -0,0 +1,237 @@
1#ifndef _UAPI_LINUX_DCCP_H
2#define _UAPI_LINUX_DCCP_H
3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7/**
8 * struct dccp_hdr - generic part of DCCP packet header
9 *
10 * @dccph_sport - Relevant port on the endpoint that sent this packet
11 * @dccph_dport - Relevant port on the other endpoint
12 * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
13 * @dccph_ccval - Used by the HC-Sender CCID
14 * @dccph_cscov - Parts of the packet that are covered by the Checksum field
15 * @dccph_checksum - Internet checksum, depends on dccph_cscov
16 * @dccph_x - 0 = 24 bit sequence number, 1 = 48
17 * @dccph_type - packet type, see DCCP_PKT_ prefixed macros
18 * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
19 */
20struct dccp_hdr {
21 __be16 dccph_sport,
22 dccph_dport;
23 __u8 dccph_doff;
24#if defined(__LITTLE_ENDIAN_BITFIELD)
25 __u8 dccph_cscov:4,
26 dccph_ccval:4;
27#elif defined(__BIG_ENDIAN_BITFIELD)
28 __u8 dccph_ccval:4,
29 dccph_cscov:4;
30#else
31#error "Adjust your <asm/byteorder.h> defines"
32#endif
33 __sum16 dccph_checksum;
34#if defined(__LITTLE_ENDIAN_BITFIELD)
35 __u8 dccph_x:1,
36 dccph_type:4,
37 dccph_reserved:3;
38#elif defined(__BIG_ENDIAN_BITFIELD)
39 __u8 dccph_reserved:3,
40 dccph_type:4,
41 dccph_x:1;
42#else
43#error "Adjust your <asm/byteorder.h> defines"
44#endif
45 __u8 dccph_seq2;
46 __be16 dccph_seq;
47};
48
49/**
50 * struct dccp_hdr_ext - the low bits of a 48 bit seq packet
51 *
52 * @dccph_seq_low - low 24 bits of a 48 bit seq packet
53 */
54struct dccp_hdr_ext {
55 __be32 dccph_seq_low;
56};
57
58/**
59 * struct dccp_hdr_request - Connection initiation request header
60 *
61 * @dccph_req_service - Service to which the client app wants to connect
62 */
63struct dccp_hdr_request {
64 __be32 dccph_req_service;
65};
66/**
67 * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
68 *
69 * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
70 * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
71 */
72struct dccp_hdr_ack_bits {
73 __be16 dccph_reserved1;
74 __be16 dccph_ack_nr_high;
75 __be32 dccph_ack_nr_low;
76};
77/**
78 * struct dccp_hdr_response - Connection initiation response header
79 *
80 * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
81 * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
82 */
83struct dccp_hdr_response {
84 struct dccp_hdr_ack_bits dccph_resp_ack;
85 __be32 dccph_resp_service;
86};
87
88/**
89 * struct dccp_hdr_reset - Unconditionally shut down a connection
90 *
91 * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
92 * @dccph_reset_code - one of %dccp_reset_codes
93 * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
94 */
95struct dccp_hdr_reset {
96 struct dccp_hdr_ack_bits dccph_reset_ack;
97 __u8 dccph_reset_code,
98 dccph_reset_data[3];
99};
100
101enum dccp_pkt_type {
102 DCCP_PKT_REQUEST = 0,
103 DCCP_PKT_RESPONSE,
104 DCCP_PKT_DATA,
105 DCCP_PKT_ACK,
106 DCCP_PKT_DATAACK,
107 DCCP_PKT_CLOSEREQ,
108 DCCP_PKT_CLOSE,
109 DCCP_PKT_RESET,
110 DCCP_PKT_SYNC,
111 DCCP_PKT_SYNCACK,
112 DCCP_PKT_INVALID,
113};
114
115#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
116
117static inline unsigned int dccp_packet_hdr_len(const __u8 type)
118{
119 if (type == DCCP_PKT_DATA)
120 return 0;
121 if (type == DCCP_PKT_DATAACK ||
122 type == DCCP_PKT_ACK ||
123 type == DCCP_PKT_SYNC ||
124 type == DCCP_PKT_SYNCACK ||
125 type == DCCP_PKT_CLOSE ||
126 type == DCCP_PKT_CLOSEREQ)
127 return sizeof(struct dccp_hdr_ack_bits);
128 if (type == DCCP_PKT_REQUEST)
129 return sizeof(struct dccp_hdr_request);
130 if (type == DCCP_PKT_RESPONSE)
131 return sizeof(struct dccp_hdr_response);
132 return sizeof(struct dccp_hdr_reset);
133}
134enum dccp_reset_codes {
135 DCCP_RESET_CODE_UNSPECIFIED = 0,
136 DCCP_RESET_CODE_CLOSED,
137 DCCP_RESET_CODE_ABORTED,
138 DCCP_RESET_CODE_NO_CONNECTION,
139 DCCP_RESET_CODE_PACKET_ERROR,
140 DCCP_RESET_CODE_OPTION_ERROR,
141 DCCP_RESET_CODE_MANDATORY_ERROR,
142 DCCP_RESET_CODE_CONNECTION_REFUSED,
143 DCCP_RESET_CODE_BAD_SERVICE_CODE,
144 DCCP_RESET_CODE_TOO_BUSY,
145 DCCP_RESET_CODE_BAD_INIT_COOKIE,
146 DCCP_RESET_CODE_AGGRESSION_PENALTY,
147
148 DCCP_MAX_RESET_CODES /* Leave at the end! */
149};
150
151/* DCCP options */
152enum {
153 DCCPO_PADDING = 0,
154 DCCPO_MANDATORY = 1,
155 DCCPO_MIN_RESERVED = 3,
156 DCCPO_MAX_RESERVED = 31,
157 DCCPO_CHANGE_L = 32,
158 DCCPO_CONFIRM_L = 33,
159 DCCPO_CHANGE_R = 34,
160 DCCPO_CONFIRM_R = 35,
161 DCCPO_NDP_COUNT = 37,
162 DCCPO_ACK_VECTOR_0 = 38,
163 DCCPO_ACK_VECTOR_1 = 39,
164 DCCPO_TIMESTAMP = 41,
165 DCCPO_TIMESTAMP_ECHO = 42,
166 DCCPO_ELAPSED_TIME = 43,
167 DCCPO_MAX = 45,
168 DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170 DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
172};
173/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
174#define DCCP_SINGLE_OPT_MAXLEN 253
175
176/* DCCP CCIDS */
177enum {
178 DCCPC_CCID2 = 2,
179 DCCPC_CCID3 = 3,
180};
181
182/* DCCP features (RFC 4340 section 6.4) */
183enum dccp_feature_numbers {
184 DCCPF_RESERVED = 0,
185 DCCPF_CCID = 1,
186 DCCPF_SHORT_SEQNOS = 2,
187 DCCPF_SEQUENCE_WINDOW = 3,
188 DCCPF_ECN_INCAPABLE = 4,
189 DCCPF_ACK_RATIO = 5,
190 DCCPF_SEND_ACK_VECTOR = 6,
191 DCCPF_SEND_NDP_COUNT = 7,
192 DCCPF_MIN_CSUM_COVER = 8,
193 DCCPF_DATA_CHECKSUM = 9,
194 /* 10-127 reserved */
195 DCCPF_MIN_CCID_SPECIFIC = 128,
196 DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
197 DCCPF_MAX_CCID_SPECIFIC = 255,
198};
199
200/* DCCP socket control message types for cmsg */
201enum dccp_cmsg_type {
202 DCCP_SCM_PRIORITY = 1,
203 DCCP_SCM_QPOLICY_MAX = 0xFFFF,
204 /* ^-- Up to here reserved exclusively for qpolicy parameters */
205 DCCP_SCM_MAX
206};
207
208/* DCCP priorities for outgoing/queued packets */
209enum dccp_packet_dequeueing_policy {
210 DCCPQ_POLICY_SIMPLE,
211 DCCPQ_POLICY_PRIO,
212 DCCPQ_POLICY_MAX
213};
214
215/* DCCP socket options */
216#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
217#define DCCP_SOCKOPT_SERVICE 2
218#define DCCP_SOCKOPT_CHANGE_L 3
219#define DCCP_SOCKOPT_CHANGE_R 4
220#define DCCP_SOCKOPT_GET_CUR_MPS 5
221#define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
222#define DCCP_SOCKOPT_SEND_CSCOV 10
223#define DCCP_SOCKOPT_RECV_CSCOV 11
224#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
225#define DCCP_SOCKOPT_CCID 13
226#define DCCP_SOCKOPT_TX_CCID 14
227#define DCCP_SOCKOPT_RX_CCID 15
228#define DCCP_SOCKOPT_QPOLICY_ID 16
229#define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
230#define DCCP_SOCKOPT_CCID_RX_INFO 128
231#define DCCP_SOCKOPT_CCID_TX_INFO 192
232
233/* maximum number of services provided on the same listening port */
234#define DCCP_SERVICE_LIST_MAX_LEN 32
235
236
237#endif /* _UAPI_LINUX_DCCP_H */
diff --git a/include/uapi/linux/dlm.h b/include/uapi/linux/dlm.h
new file mode 100644
index 00000000000..1f73cc06168
--- /dev/null
+++ b/include/uapi/linux/dlm.h
@@ -0,0 +1,75 @@
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
6**
7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions
9** of the GNU General Public License v.2.
10**
11*******************************************************************************
12******************************************************************************/
13
14#ifndef _UAPI__DLM_DOT_H__
15#define _UAPI__DLM_DOT_H__
16
17/*
18 * Interface to Distributed Lock Manager (DLM)
19 * routines and structures to use DLM lockspaces
20 */
21
22/* Lock levels and flags are here */
23#include <linux/dlmconstants.h>
24#include <linux/types.h>
25
26typedef void dlm_lockspace_t;
27
28/*
29 * Lock status block
30 *
31 * Use this structure to specify the contents of the lock value block. For a
32 * conversion request, this structure is used to specify the lock ID of the
33 * lock. DLM writes the status of the lock request and the lock ID assigned
34 * to the request in the lock status block.
35 *
36 * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests.
37 * It is available when dlm_lock returns.
38 *
39 * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
40 * shown for the DLM_LKF_VALBLK flag.
41 *
42 * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
43 * it was first demoted to NL to avoid conversion deadlock.
44 * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
45 *
46 * sb_status: the returned status of the lock request set prior to AST
47 * execution. Possible return values:
48 *
49 * 0 if lock request was successful
50 * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
51 * -DLM_EUNLOCK if unlock request was successful
52 * -DLM_ECANCEL if a cancel completed successfully
53 * -EDEADLK if a deadlock was detected
54 * -ETIMEDOUT if the lock request was canceled due to a timeout
55 */
56
57#define DLM_SBF_DEMOTED 0x01
58#define DLM_SBF_VALNOTVALID 0x02
59#define DLM_SBF_ALTMODE 0x04
60
61struct dlm_lksb {
62 int sb_status;
63 __u32 sb_lkid;
64 char sb_flags;
65 char * sb_lvbptr;
66};
67
68/* dlm_new_lockspace() flags */
69
70#define DLM_LSFL_TIMEWARN 0x00000002
71#define DLM_LSFL_FS 0x00000004
72#define DLM_LSFL_NEWEXCL 0x00000008
73
74
75#endif /* _UAPI__DLM_DOT_H__ */
diff --git a/include/linux/dlm_device.h b/include/uapi/linux/dlm_device.h
index 3060783c419..3060783c419 100644
--- a/include/linux/dlm_device.h
+++ b/include/uapi/linux/dlm_device.h
diff --git a/include/linux/dlm_netlink.h b/include/uapi/linux/dlm_netlink.h
index 647c8ef2722..647c8ef2722 100644
--- a/include/linux/dlm_netlink.h
+++ b/include/uapi/linux/dlm_netlink.h
diff --git a/include/uapi/linux/dlm_plock.h b/include/uapi/linux/dlm_plock.h
new file mode 100644
index 00000000000..6ae692c909c
--- /dev/null
+++ b/include/uapi/linux/dlm_plock.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
3 *
4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU General Public License v.2.
7 */
8
9#ifndef _UAPI__DLM_PLOCK_DOT_H__
10#define _UAPI__DLM_PLOCK_DOT_H__
11
12#include <linux/types.h>
13
14#define DLM_PLOCK_MISC_NAME "dlm_plock"
15
16#define DLM_PLOCK_VERSION_MAJOR 1
17#define DLM_PLOCK_VERSION_MINOR 2
18#define DLM_PLOCK_VERSION_PATCH 0
19
20enum {
21 DLM_PLOCK_OP_LOCK = 1,
22 DLM_PLOCK_OP_UNLOCK,
23 DLM_PLOCK_OP_GET,
24};
25
26#define DLM_PLOCK_FL_CLOSE 1
27
28struct dlm_plock_info {
29 __u32 version[3];
30 __u8 optype;
31 __u8 ex;
32 __u8 wait;
33 __u8 flags;
34 __u32 pid;
35 __s32 nodeid;
36 __s32 rv;
37 __u32 fsid;
38 __u64 number;
39 __u64 start;
40 __u64 end;
41 __u64 owner;
42};
43
44
45#endif /* _UAPI__DLM_PLOCK_DOT_H__ */
diff --git a/include/linux/dlmconstants.h b/include/uapi/linux/dlmconstants.h
index 47bf08dc756..47bf08dc756 100644
--- a/include/linux/dlmconstants.h
+++ b/include/uapi/linux/dlmconstants.h
diff --git a/include/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h
index 91e3a360f61..91e3a360f61 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/uapi/linux/dm-ioctl.h
diff --git a/include/linux/dm-log-userspace.h b/include/uapi/linux/dm-log-userspace.h
index 0678c2adc42..0678c2adc42 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/uapi/linux/dm-log-userspace.h
diff --git a/include/linux/dn.h b/include/uapi/linux/dn.h
index 9c50445462d..9c50445462d 100644
--- a/include/linux/dn.h
+++ b/include/uapi/linux/dn.h
diff --git a/include/linux/dqblk_xfs.h b/include/uapi/linux/dqblk_xfs.h
index 86552807aed..86552807aed 100644
--- a/include/linux/dqblk_xfs.h
+++ b/include/uapi/linux/dqblk_xfs.h
diff --git a/include/uapi/linux/edd.h b/include/uapi/linux/edd.h
new file mode 100644
index 00000000000..89240a04e4c
--- /dev/null
+++ b/include/uapi/linux/edd.h
@@ -0,0 +1,191 @@
1/*
2 * linux/include/linux/edd.h
3 * Copyright (C) 2002, 2003, 2004 Dell Inc.
4 * by Matt Domsch <Matt_Domsch@dell.com>
5 *
6 * structures and definitions for the int 13h, ax={41,48}h
7 * BIOS Enhanced Disk Drive Services
8 * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
9 * available at http://www.t13.org/docs2002/d1572r0.pdf. It is
10 * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
11 *
12 * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch
13 * table in the boot_params that contains a list of BIOS-enumerated
14 * boot devices.
15 * In arch/{i386,x86_64}/kernel/setup.c, this information is
16 * transferred into the edd structure, and in drivers/firmware/edd.c, that
17 * information is used to identify BIOS boot disk. The code in setup.S
18 * is very sensitive to the size of these structures.
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License v2.0 as published by
22 * the Free Software Foundation
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 */
30#ifndef _UAPI_LINUX_EDD_H
31#define _UAPI_LINUX_EDD_H
32
33#include <linux/types.h>
34
35#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
36 in boot_params - treat this as 1 byte */
37#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
38#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
39#define EDDEXTSIZE 8 /* change these if you muck with the structures */
40#define EDDPARMSIZE 74
41#define CHECKEXTENSIONSPRESENT 0x41
42#define GETDEVICEPARAMETERS 0x48
43#define LEGACYGETDEVICEPARAMETERS 0x08
44#define EDDMAGIC1 0x55AA
45#define EDDMAGIC2 0xAA55
46
47
48#define READ_SECTORS 0x02 /* int13 AH=0x02 is READ_SECTORS command */
49#define EDD_MBR_SIG_OFFSET 0x1B8 /* offset of signature in the MBR */
50#define EDD_MBR_SIG_BUF 0x290 /* addr in boot params */
51#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
52#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
53 in boot_params - treat this as 1 byte */
54
55#ifndef __ASSEMBLY__
56
57#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
58#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
59#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
60#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
61
62#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
63#define EDD_INFO_GEOMETRY_VALID (1 << 1)
64#define EDD_INFO_REMOVABLE (1 << 2)
65#define EDD_INFO_WRITE_VERIFY (1 << 3)
66#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
67#define EDD_INFO_LOCKABLE (1 << 5)
68#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
69#define EDD_INFO_USE_INT13_FN50 (1 << 7)
70
71struct edd_device_params {
72 __u16 length;
73 __u16 info_flags;
74 __u32 num_default_cylinders;
75 __u32 num_default_heads;
76 __u32 sectors_per_track;
77 __u64 number_of_sectors;
78 __u16 bytes_per_sector;
79 __u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */
80 __u16 key; /* = 0xBEDD */
81 __u8 device_path_info_length; /* = 44 */
82 __u8 reserved2;
83 __u16 reserved3;
84 __u8 host_bus_type[4];
85 __u8 interface_type[8];
86 union {
87 struct {
88 __u16 base_address;
89 __u16 reserved1;
90 __u32 reserved2;
91 } __attribute__ ((packed)) isa;
92 struct {
93 __u8 bus;
94 __u8 slot;
95 __u8 function;
96 __u8 channel;
97 __u32 reserved;
98 } __attribute__ ((packed)) pci;
99 /* pcix is same as pci */
100 struct {
101 __u64 reserved;
102 } __attribute__ ((packed)) ibnd;
103 struct {
104 __u64 reserved;
105 } __attribute__ ((packed)) xprs;
106 struct {
107 __u64 reserved;
108 } __attribute__ ((packed)) htpt;
109 struct {
110 __u64 reserved;
111 } __attribute__ ((packed)) unknown;
112 } interface_path;
113 union {
114 struct {
115 __u8 device;
116 __u8 reserved1;
117 __u16 reserved2;
118 __u32 reserved3;
119 __u64 reserved4;
120 } __attribute__ ((packed)) ata;
121 struct {
122 __u8 device;
123 __u8 lun;
124 __u8 reserved1;
125 __u8 reserved2;
126 __u32 reserved3;
127 __u64 reserved4;
128 } __attribute__ ((packed)) atapi;
129 struct {
130 __u16 id;
131 __u64 lun;
132 __u16 reserved1;
133 __u32 reserved2;
134 } __attribute__ ((packed)) scsi;
135 struct {
136 __u64 serial_number;
137 __u64 reserved;
138 } __attribute__ ((packed)) usb;
139 struct {
140 __u64 eui;
141 __u64 reserved;
142 } __attribute__ ((packed)) i1394;
143 struct {
144 __u64 wwid;
145 __u64 lun;
146 } __attribute__ ((packed)) fibre;
147 struct {
148 __u64 identity_tag;
149 __u64 reserved;
150 } __attribute__ ((packed)) i2o;
151 struct {
152 __u32 array_number;
153 __u32 reserved1;
154 __u64 reserved2;
155 } __attribute__ ((packed)) raid;
156 struct {
157 __u8 device;
158 __u8 reserved1;
159 __u16 reserved2;
160 __u32 reserved3;
161 __u64 reserved4;
162 } __attribute__ ((packed)) sata;
163 struct {
164 __u64 reserved1;
165 __u64 reserved2;
166 } __attribute__ ((packed)) unknown;
167 } device_path;
168 __u8 reserved4;
169 __u8 checksum;
170} __attribute__ ((packed));
171
172struct edd_info {
173 __u8 device;
174 __u8 version;
175 __u16 interface_support;
176 __u16 legacy_max_cylinder;
177 __u8 legacy_max_head;
178 __u8 legacy_sectors_per_track;
179 struct edd_device_params params;
180} __attribute__ ((packed));
181
182struct edd {
183 unsigned int mbr_signature[EDD_MBR_SIG_MAX];
184 struct edd_info edd_info[EDDMAXNR];
185 unsigned char mbr_signature_nr;
186 unsigned char edd_info_nr;
187};
188
189#endif /*!__ASSEMBLY__ */
190
191#endif /* _UAPI_LINUX_EDD_H */
diff --git a/include/linux/efs_fs_sb.h b/include/uapi/linux/efs_fs_sb.h
index a01be90c58c..a01be90c58c 100644
--- a/include/linux/efs_fs_sb.h
+++ b/include/uapi/linux/efs_fs_sb.h
diff --git a/include/linux/elf-em.h b/include/uapi/linux/elf-em.h
index 8e2b7bac437..8e2b7bac437 100644
--- a/include/linux/elf-em.h
+++ b/include/uapi/linux/elf-em.h
diff --git a/include/linux/elf-fdpic.h b/include/uapi/linux/elf-fdpic.h
index 7cd2e80cebc..1065078938f 100644
--- a/include/linux/elf-fdpic.h
+++ b/include/uapi/linux/elf-fdpic.h
@@ -31,6 +31,7 @@ struct elf32_fdpic_loadmap {
31 31
32#define ELF32_FDPIC_LOADMAP_VERSION 0x0000 32#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
33 33
34#ifndef __KERNEL__
34/* 35/*
35 * binfmt binary parameters structure 36 * binfmt binary parameters structure
36 */ 37 */
@@ -58,7 +59,6 @@ struct elf_fdpic_params {
58#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */ 59#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
59}; 60};
60 61
61#ifdef __KERNEL__
62#ifdef CONFIG_MMU 62#ifdef CONFIG_MMU
63extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params, 63extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
64 struct elf_fdpic_params *interp_params, 64 struct elf_fdpic_params *interp_params,
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
new file mode 100644
index 00000000000..126a8175e3e
--- /dev/null
+++ b/include/uapi/linux/elf.h
@@ -0,0 +1,414 @@
1#ifndef _UAPI_LINUX_ELF_H
2#define _UAPI_LINUX_ELF_H
3
4#include <linux/types.h>
5#include <linux/elf-em.h>
6
7/* 32-bit ELF base types. */
8typedef __u32 Elf32_Addr;
9typedef __u16 Elf32_Half;
10typedef __u32 Elf32_Off;
11typedef __s32 Elf32_Sword;
12typedef __u32 Elf32_Word;
13
14/* 64-bit ELF base types. */
15typedef __u64 Elf64_Addr;
16typedef __u16 Elf64_Half;
17typedef __s16 Elf64_SHalf;
18typedef __u64 Elf64_Off;
19typedef __s32 Elf64_Sword;
20typedef __u32 Elf64_Word;
21typedef __u64 Elf64_Xword;
22typedef __s64 Elf64_Sxword;
23
24/* These constants are for the segment types stored in the image headers */
25#define PT_NULL 0
26#define PT_LOAD 1
27#define PT_DYNAMIC 2
28#define PT_INTERP 3
29#define PT_NOTE 4
30#define PT_SHLIB 5
31#define PT_PHDR 6
32#define PT_TLS 7 /* Thread local storage segment */
33#define PT_LOOS 0x60000000 /* OS-specific */
34#define PT_HIOS 0x6fffffff /* OS-specific */
35#define PT_LOPROC 0x70000000
36#define PT_HIPROC 0x7fffffff
37#define PT_GNU_EH_FRAME 0x6474e550
38
39#define PT_GNU_STACK (PT_LOOS + 0x474e551)
40
41/*
42 * Extended Numbering
43 *
44 * If the real number of program header table entries is larger than
45 * or equal to PN_XNUM(0xffff), it is set to sh_info field of the
46 * section header at index 0, and PN_XNUM is set to e_phnum
47 * field. Otherwise, the section header at index 0 is zero
48 * initialized, if it exists.
49 *
50 * Specifications are available in:
51 *
52 * - Sun microsystems: Linker and Libraries.
53 * Part No: 817-1984-17, September 2008.
54 * URL: http://docs.sun.com/app/docs/doc/817-1984
55 *
56 * - System V ABI AMD64 Architecture Processor Supplement
57 * Draft Version 0.99.,
58 * May 11, 2009.
59 * URL: http://www.x86-64.org/
60 */
61#define PN_XNUM 0xffff
62
63/* These constants define the different elf file types */
64#define ET_NONE 0
65#define ET_REL 1
66#define ET_EXEC 2
67#define ET_DYN 3
68#define ET_CORE 4
69#define ET_LOPROC 0xff00
70#define ET_HIPROC 0xffff
71
72/* This is the info that is needed to parse the dynamic section of the file */
73#define DT_NULL 0
74#define DT_NEEDED 1
75#define DT_PLTRELSZ 2
76#define DT_PLTGOT 3
77#define DT_HASH 4
78#define DT_STRTAB 5
79#define DT_SYMTAB 6
80#define DT_RELA 7
81#define DT_RELASZ 8
82#define DT_RELAENT 9
83#define DT_STRSZ 10
84#define DT_SYMENT 11
85#define DT_INIT 12
86#define DT_FINI 13
87#define DT_SONAME 14
88#define DT_RPATH 15
89#define DT_SYMBOLIC 16
90#define DT_REL 17
91#define DT_RELSZ 18
92#define DT_RELENT 19
93#define DT_PLTREL 20
94#define DT_DEBUG 21
95#define DT_TEXTREL 22
96#define DT_JMPREL 23
97#define DT_ENCODING 32
98#define OLD_DT_LOOS 0x60000000
99#define DT_LOOS 0x6000000d
100#define DT_HIOS 0x6ffff000
101#define DT_VALRNGLO 0x6ffffd00
102#define DT_VALRNGHI 0x6ffffdff
103#define DT_ADDRRNGLO 0x6ffffe00
104#define DT_ADDRRNGHI 0x6ffffeff
105#define DT_VERSYM 0x6ffffff0
106#define DT_RELACOUNT 0x6ffffff9
107#define DT_RELCOUNT 0x6ffffffa
108#define DT_FLAGS_1 0x6ffffffb
109#define DT_VERDEF 0x6ffffffc
110#define DT_VERDEFNUM 0x6ffffffd
111#define DT_VERNEED 0x6ffffffe
112#define DT_VERNEEDNUM 0x6fffffff
113#define OLD_DT_HIOS 0x6fffffff
114#define DT_LOPROC 0x70000000
115#define DT_HIPROC 0x7fffffff
116
117/* This info is needed when parsing the symbol table */
118#define STB_LOCAL 0
119#define STB_GLOBAL 1
120#define STB_WEAK 2
121
122#define STT_NOTYPE 0
123#define STT_OBJECT 1
124#define STT_FUNC 2
125#define STT_SECTION 3
126#define STT_FILE 4
127#define STT_COMMON 5
128#define STT_TLS 6
129
130#define ELF_ST_BIND(x) ((x) >> 4)
131#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
132#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
133#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
134#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
135#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
136
137typedef struct dynamic{
138 Elf32_Sword d_tag;
139 union{
140 Elf32_Sword d_val;
141 Elf32_Addr d_ptr;
142 } d_un;
143} Elf32_Dyn;
144
145typedef struct {
146 Elf64_Sxword d_tag; /* entry tag value */
147 union {
148 Elf64_Xword d_val;
149 Elf64_Addr d_ptr;
150 } d_un;
151} Elf64_Dyn;
152
153/* The following are used with relocations */
154#define ELF32_R_SYM(x) ((x) >> 8)
155#define ELF32_R_TYPE(x) ((x) & 0xff)
156
157#define ELF64_R_SYM(i) ((i) >> 32)
158#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
159
160typedef struct elf32_rel {
161 Elf32_Addr r_offset;
162 Elf32_Word r_info;
163} Elf32_Rel;
164
165typedef struct elf64_rel {
166 Elf64_Addr r_offset; /* Location at which to apply the action */
167 Elf64_Xword r_info; /* index and type of relocation */
168} Elf64_Rel;
169
170typedef struct elf32_rela{
171 Elf32_Addr r_offset;
172 Elf32_Word r_info;
173 Elf32_Sword r_addend;
174} Elf32_Rela;
175
176typedef struct elf64_rela {
177 Elf64_Addr r_offset; /* Location at which to apply the action */
178 Elf64_Xword r_info; /* index and type of relocation */
179 Elf64_Sxword r_addend; /* Constant addend used to compute value */
180} Elf64_Rela;
181
182typedef struct elf32_sym{
183 Elf32_Word st_name;
184 Elf32_Addr st_value;
185 Elf32_Word st_size;
186 unsigned char st_info;
187 unsigned char st_other;
188 Elf32_Half st_shndx;
189} Elf32_Sym;
190
191typedef struct elf64_sym {
192 Elf64_Word st_name; /* Symbol name, index in string tbl */
193 unsigned char st_info; /* Type and binding attributes */
194 unsigned char st_other; /* No defined meaning, 0 */
195 Elf64_Half st_shndx; /* Associated section index */
196 Elf64_Addr st_value; /* Value of the symbol */
197 Elf64_Xword st_size; /* Associated symbol size */
198} Elf64_Sym;
199
200
201#define EI_NIDENT 16
202
203typedef struct elf32_hdr{
204 unsigned char e_ident[EI_NIDENT];
205 Elf32_Half e_type;
206 Elf32_Half e_machine;
207 Elf32_Word e_version;
208 Elf32_Addr e_entry; /* Entry point */
209 Elf32_Off e_phoff;
210 Elf32_Off e_shoff;
211 Elf32_Word e_flags;
212 Elf32_Half e_ehsize;
213 Elf32_Half e_phentsize;
214 Elf32_Half e_phnum;
215 Elf32_Half e_shentsize;
216 Elf32_Half e_shnum;
217 Elf32_Half e_shstrndx;
218} Elf32_Ehdr;
219
220typedef struct elf64_hdr {
221 unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
222 Elf64_Half e_type;
223 Elf64_Half e_machine;
224 Elf64_Word e_version;
225 Elf64_Addr e_entry; /* Entry point virtual address */
226 Elf64_Off e_phoff; /* Program header table file offset */
227 Elf64_Off e_shoff; /* Section header table file offset */
228 Elf64_Word e_flags;
229 Elf64_Half e_ehsize;
230 Elf64_Half e_phentsize;
231 Elf64_Half e_phnum;
232 Elf64_Half e_shentsize;
233 Elf64_Half e_shnum;
234 Elf64_Half e_shstrndx;
235} Elf64_Ehdr;
236
237/* These constants define the permissions on sections in the program
238 header, p_flags. */
239#define PF_R 0x4
240#define PF_W 0x2
241#define PF_X 0x1
242
243typedef struct elf32_phdr{
244 Elf32_Word p_type;
245 Elf32_Off p_offset;
246 Elf32_Addr p_vaddr;
247 Elf32_Addr p_paddr;
248 Elf32_Word p_filesz;
249 Elf32_Word p_memsz;
250 Elf32_Word p_flags;
251 Elf32_Word p_align;
252} Elf32_Phdr;
253
254typedef struct elf64_phdr {
255 Elf64_Word p_type;
256 Elf64_Word p_flags;
257 Elf64_Off p_offset; /* Segment file offset */
258 Elf64_Addr p_vaddr; /* Segment virtual address */
259 Elf64_Addr p_paddr; /* Segment physical address */
260 Elf64_Xword p_filesz; /* Segment size in file */
261 Elf64_Xword p_memsz; /* Segment size in memory */
262 Elf64_Xword p_align; /* Segment alignment, file & memory */
263} Elf64_Phdr;
264
265/* sh_type */
266#define SHT_NULL 0
267#define SHT_PROGBITS 1
268#define SHT_SYMTAB 2
269#define SHT_STRTAB 3
270#define SHT_RELA 4
271#define SHT_HASH 5
272#define SHT_DYNAMIC 6
273#define SHT_NOTE 7
274#define SHT_NOBITS 8
275#define SHT_REL 9
276#define SHT_SHLIB 10
277#define SHT_DYNSYM 11
278#define SHT_NUM 12
279#define SHT_LOPROC 0x70000000
280#define SHT_HIPROC 0x7fffffff
281#define SHT_LOUSER 0x80000000
282#define SHT_HIUSER 0xffffffff
283
284/* sh_flags */
285#define SHF_WRITE 0x1
286#define SHF_ALLOC 0x2
287#define SHF_EXECINSTR 0x4
288#define SHF_MASKPROC 0xf0000000
289
290/* special section indexes */
291#define SHN_UNDEF 0
292#define SHN_LORESERVE 0xff00
293#define SHN_LOPROC 0xff00
294#define SHN_HIPROC 0xff1f
295#define SHN_ABS 0xfff1
296#define SHN_COMMON 0xfff2
297#define SHN_HIRESERVE 0xffff
298
299typedef struct elf32_shdr {
300 Elf32_Word sh_name;
301 Elf32_Word sh_type;
302 Elf32_Word sh_flags;
303 Elf32_Addr sh_addr;
304 Elf32_Off sh_offset;
305 Elf32_Word sh_size;
306 Elf32_Word sh_link;
307 Elf32_Word sh_info;
308 Elf32_Word sh_addralign;
309 Elf32_Word sh_entsize;
310} Elf32_Shdr;
311
312typedef struct elf64_shdr {
313 Elf64_Word sh_name; /* Section name, index in string tbl */
314 Elf64_Word sh_type; /* Type of section */
315 Elf64_Xword sh_flags; /* Miscellaneous section attributes */
316 Elf64_Addr sh_addr; /* Section virtual addr at execution */
317 Elf64_Off sh_offset; /* Section file offset */
318 Elf64_Xword sh_size; /* Size of section in bytes */
319 Elf64_Word sh_link; /* Index of another section */
320 Elf64_Word sh_info; /* Additional section information */
321 Elf64_Xword sh_addralign; /* Section alignment */
322 Elf64_Xword sh_entsize; /* Entry size if section holds table */
323} Elf64_Shdr;
324
325#define EI_MAG0 0 /* e_ident[] indexes */
326#define EI_MAG1 1
327#define EI_MAG2 2
328#define EI_MAG3 3
329#define EI_CLASS 4
330#define EI_DATA 5
331#define EI_VERSION 6
332#define EI_OSABI 7
333#define EI_PAD 8
334
335#define ELFMAG0 0x7f /* EI_MAG */
336#define ELFMAG1 'E'
337#define ELFMAG2 'L'
338#define ELFMAG3 'F'
339#define ELFMAG "\177ELF"
340#define SELFMAG 4
341
342#define ELFCLASSNONE 0 /* EI_CLASS */
343#define ELFCLASS32 1
344#define ELFCLASS64 2
345#define ELFCLASSNUM 3
346
347#define ELFDATANONE 0 /* e_ident[EI_DATA] */
348#define ELFDATA2LSB 1
349#define ELFDATA2MSB 2
350
351#define EV_NONE 0 /* e_version, EI_VERSION */
352#define EV_CURRENT 1
353#define EV_NUM 2
354
355#define ELFOSABI_NONE 0
356#define ELFOSABI_LINUX 3
357
358#ifndef ELF_OSABI
359#define ELF_OSABI ELFOSABI_NONE
360#endif
361
362/*
363 * Notes used in ET_CORE. Architectures export some of the arch register sets
364 * using the corresponding note types via the PTRACE_GETREGSET and
365 * PTRACE_SETREGSET requests.
366 */
367#define NT_PRSTATUS 1
368#define NT_PRFPREG 2
369#define NT_PRPSINFO 3
370#define NT_TASKSTRUCT 4
371#define NT_AUXV 6
372/*
373 * Note to userspace developers: size of NT_SIGINFO note may increase
374 * in the future to accomodate more fields, don't assume it is fixed!
375 */
376#define NT_SIGINFO 0x53494749
377#define NT_FILE 0x46494c45
378#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
379#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
380#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
381#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
382#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
383#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
384#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
385#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
386#define NT_S390_TIMER 0x301 /* s390 timer register */
387#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
388#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
389#define NT_S390_CTRS 0x304 /* s390 control registers */
390#define NT_S390_PREFIX 0x305 /* s390 prefix register */
391#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
392#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
393#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
394#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
395#define NT_ARM_TLS 0x401 /* ARM TLS register */
396#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
397#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
398
399
400/* Note header in a PT_NOTE section */
401typedef struct elf32_note {
402 Elf32_Word n_namesz; /* Name size */
403 Elf32_Word n_descsz; /* Content size */
404 Elf32_Word n_type; /* Content type */
405} Elf32_Nhdr;
406
407/* Note header in a PT_NOTE section */
408typedef struct elf64_note {
409 Elf64_Word n_namesz; /* Name size */
410 Elf64_Word n_descsz; /* Content size */
411 Elf64_Word n_type; /* Content type */
412} Elf64_Nhdr;
413
414#endif /* _UAPI_LINUX_ELF_H */
diff --git a/include/uapi/linux/elfcore.h b/include/uapi/linux/elfcore.h
new file mode 100644
index 00000000000..569737cfb55
--- /dev/null
+++ b/include/uapi/linux/elfcore.h
@@ -0,0 +1,100 @@
1#ifndef _UAPI_LINUX_ELFCORE_H
2#define _UAPI_LINUX_ELFCORE_H
3
4#include <linux/types.h>
5#include <linux/signal.h>
6#include <linux/time.h>
7#include <linux/ptrace.h>
8#include <linux/elf.h>
9#include <linux/fs.h>
10
11struct elf_siginfo
12{
13 int si_signo; /* signal number */
14 int si_code; /* extra code */
15 int si_errno; /* errno */
16};
17
18
19#ifndef __KERNEL__
20typedef elf_greg_t greg_t;
21typedef elf_gregset_t gregset_t;
22typedef elf_fpregset_t fpregset_t;
23typedef elf_fpxregset_t fpxregset_t;
24#define NGREG ELF_NGREG
25#endif
26
27/*
28 * Definitions to generate Intel SVR4-like core files.
29 * These mostly have the same names as the SVR4 types with "elf_"
30 * tacked on the front to prevent clashes with linux definitions,
31 * and the typedef forms have been avoided. This is mostly like
32 * the SVR4 structure, but more Linuxy, with things that Linux does
33 * not support and which gdb doesn't really use excluded.
34 * Fields present but not used are marked with "XXX".
35 */
36struct elf_prstatus
37{
38#if 0
39 long pr_flags; /* XXX Process flags */
40 short pr_why; /* XXX Reason for process halt */
41 short pr_what; /* XXX More detailed reason */
42#endif
43 struct elf_siginfo pr_info; /* Info associated with signal */
44 short pr_cursig; /* Current signal */
45 unsigned long pr_sigpend; /* Set of pending signals */
46 unsigned long pr_sighold; /* Set of held signals */
47#if 0
48 struct sigaltstack pr_altstack; /* Alternate stack info */
49 struct sigaction pr_action; /* Signal action for current sig */
50#endif
51 pid_t pr_pid;
52 pid_t pr_ppid;
53 pid_t pr_pgrp;
54 pid_t pr_sid;
55 struct timeval pr_utime; /* User time */
56 struct timeval pr_stime; /* System time */
57 struct timeval pr_cutime; /* Cumulative user time */
58 struct timeval pr_cstime; /* Cumulative system time */
59#if 0
60 long pr_instr; /* Current instruction */
61#endif
62 elf_gregset_t pr_reg; /* GP registers */
63#ifdef CONFIG_BINFMT_ELF_FDPIC
64 /* When using FDPIC, the loadmap addresses need to be communicated
65 * to GDB in order for GDB to do the necessary relocations. The
66 * fields (below) used to communicate this information are placed
67 * immediately after ``pr_reg'', so that the loadmap addresses may
68 * be viewed as part of the register set if so desired.
69 */
70 unsigned long pr_exec_fdpic_loadmap;
71 unsigned long pr_interp_fdpic_loadmap;
72#endif
73 int pr_fpvalid; /* True if math co-processor being used. */
74};
75
76#define ELF_PRARGSZ (80) /* Number of chars for args */
77
78struct elf_prpsinfo
79{
80 char pr_state; /* numeric process state */
81 char pr_sname; /* char for pr_state */
82 char pr_zomb; /* zombie */
83 char pr_nice; /* nice val */
84 unsigned long pr_flag; /* flags */
85 __kernel_uid_t pr_uid;
86 __kernel_gid_t pr_gid;
87 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
88 /* Lots missing */
89 char pr_fname[16]; /* filename of executable */
90 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
91};
92
93#ifndef __KERNEL__
94typedef struct elf_prstatus prstatus_t;
95typedef struct elf_prpsinfo prpsinfo_t;
96#define PRARGSZ ELF_PRARGSZ
97#endif
98
99
100#endif /* _UAPI_LINUX_ELFCORE_H */
diff --git a/include/uapi/linux/errno.h b/include/uapi/linux/errno.h
new file mode 100644
index 00000000000..70f2bd34e33
--- /dev/null
+++ b/include/uapi/linux/errno.h
@@ -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
index 00000000000..aacd4fb7102
--- /dev/null
+++ b/include/uapi/linux/errqueue.h
@@ -0,0 +1,26 @@
1#ifndef _UAPI_LINUX_ERRQUEUE_H
2#define _UAPI_LINUX_ERRQUEUE_H
3
4#include <linux/types.h>
5
6struct sock_extended_err {
7 __u32 ee_errno;
8 __u8 ee_origin;
9 __u8 ee_type;
10 __u8 ee_code;
11 __u8 ee_pad;
12 __u32 ee_info;
13 __u32 ee_data;
14};
15
16#define SO_EE_ORIGIN_NONE 0
17#define SO_EE_ORIGIN_LOCAL 1
18#define SO_EE_ORIGIN_ICMP 2
19#define SO_EE_ORIGIN_ICMP6 3
20#define SO_EE_ORIGIN_TXSTATUS 4
21#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
22
23#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
24
25
26#endif /* _UAPI_LINUX_ERRQUEUE_H */
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
new file mode 100644
index 00000000000..d3eaaaf1009
--- /dev/null
+++ b/include/uapi/linux/ethtool.h
@@ -0,0 +1,1085 @@
1/*
2 * ethtool.h: Defines for Linux ethtool.
3 *
4 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
5 * Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
6 * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
7 * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
8 * christopher.leech@intel.com,
9 * scott.feldman@intel.com)
10 * Portions Copyright (C) Sun Microsystems 2008
11 */
12
13#ifndef _UAPI_LINUX_ETHTOOL_H
14#define _UAPI_LINUX_ETHTOOL_H
15
16#include <linux/types.h>
17#include <linux/if_ether.h>
18
19/* This should work for both 32 and 64 bit userland. */
20struct ethtool_cmd {
21 __u32 cmd;
22 __u32 supported; /* Features this interface supports */
23 __u32 advertising; /* Features this interface advertises */
24 __u16 speed; /* The forced speed (lower bits) in
25 * Mbps. Please use
26 * ethtool_cmd_speed()/_set() to
27 * access it */
28 __u8 duplex; /* Duplex, half or full */
29 __u8 port; /* Which connector port */
30 __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
31 * May be read-only or read-write
32 * depending on the driver.
33 */
34 __u8 transceiver; /* Which transceiver to use */
35 __u8 autoneg; /* Enable or disable autonegotiation */
36 __u8 mdio_support; /* MDIO protocols supported. Read-only.
37 * Not set by all drivers.
38 */
39 __u32 maxtxpkt; /* Tx pkts before generating tx int */
40 __u32 maxrxpkt; /* Rx pkts before generating rx int */
41 __u16 speed_hi; /* The forced speed (upper
42 * bits) in Mbps. Please use
43 * ethtool_cmd_speed()/_set() to
44 * access it */
45 __u8 eth_tp_mdix; /* twisted pair MDI-X status */
46 __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
47 * link should be renegotiated if necessary
48 */
49 __u32 lp_advertising; /* Features the link partner advertises */
50 __u32 reserved[2];
51};
52
53static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
54 __u32 speed)
55{
56
57 ep->speed = (__u16)speed;
58 ep->speed_hi = (__u16)(speed >> 16);
59}
60
61static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
62{
63 return (ep->speed_hi << 16) | ep->speed;
64}
65
66/* Device supports clause 22 register access to PHY or peripherals
67 * using the interface defined in <linux/mii.h>. This should not be
68 * set if there are known to be no such peripherals present or if
69 * the driver only emulates clause 22 registers for compatibility.
70 */
71#define ETH_MDIO_SUPPORTS_C22 1
72
73/* Device supports clause 45 register access to PHY or peripherals
74 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
75 * This should not be set if there are known to be no such peripherals
76 * present.
77 */
78#define ETH_MDIO_SUPPORTS_C45 2
79
80#define ETHTOOL_FWVERS_LEN 32
81#define ETHTOOL_BUSINFO_LEN 32
82/* these strings are set to whatever the driver author decides... */
83struct ethtool_drvinfo {
84 __u32 cmd;
85 char driver[32]; /* driver short name, "tulip", "eepro100" */
86 char version[32]; /* driver version string */
87 char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
88 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
89 /* For PCI devices, use pci_name(pci_dev). */
90 char reserved1[32];
91 char reserved2[12];
92 /*
93 * Some struct members below are filled in
94 * using ops->get_sset_count(). Obtaining
95 * this info from ethtool_drvinfo is now
96 * deprecated; Use ETHTOOL_GSSET_INFO
97 * instead.
98 */
99 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
100 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
101 __u32 testinfo_len;
102 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
103 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
104};
105
106#define SOPASS_MAX 6
107/* wake-on-lan settings */
108struct ethtool_wolinfo {
109 __u32 cmd;
110 __u32 supported;
111 __u32 wolopts;
112 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
113};
114
115/* for passing single values */
116struct ethtool_value {
117 __u32 cmd;
118 __u32 data;
119};
120
121/* for passing big chunks of data */
122struct ethtool_regs {
123 __u32 cmd;
124 __u32 version; /* driver-specific, indicates different chips/revs */
125 __u32 len; /* bytes */
126 __u8 data[0];
127};
128
129/* for passing EEPROM chunks */
130struct ethtool_eeprom {
131 __u32 cmd;
132 __u32 magic;
133 __u32 offset; /* in bytes */
134 __u32 len; /* in bytes */
135 __u8 data[0];
136};
137
138/**
139 * struct ethtool_eee - Energy Efficient Ethernet information
140 * @cmd: ETHTOOL_{G,S}EEE
141 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
142 * for which there is EEE support.
143 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
144 * advertised as eee capable.
145 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
146 * combinations advertised by the link partner as eee capable.
147 * @eee_active: Result of the eee auto negotiation.
148 * @eee_enabled: EEE configured mode (enabled/disabled).
149 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
150 * that eee was negotiated.
151 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
152 * its tx lpi (after reaching 'idle' state). Effective only when eee
153 * was negotiated and tx_lpi_enabled was set.
154 */
155struct ethtool_eee {
156 __u32 cmd;
157 __u32 supported;
158 __u32 advertised;
159 __u32 lp_advertised;
160 __u32 eee_active;
161 __u32 eee_enabled;
162 __u32 tx_lpi_enabled;
163 __u32 tx_lpi_timer;
164 __u32 reserved[2];
165};
166
167/**
168 * struct ethtool_modinfo - plugin module eeprom information
169 * @cmd: %ETHTOOL_GMODULEINFO
170 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
171 * @eeprom_len: Length of the eeprom
172 *
173 * This structure is used to return the information to
174 * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM.
175 * The type code indicates the eeprom data format
176 */
177struct ethtool_modinfo {
178 __u32 cmd;
179 __u32 type;
180 __u32 eeprom_len;
181 __u32 reserved[8];
182};
183
184/**
185 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
186 * @cmd: ETHTOOL_{G,S}COALESCE
187 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
188 * a packet arrives.
189 * @rx_max_coalesced_frames: Maximum number of packets to receive
190 * before an RX interrupt.
191 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
192 * this value applies while an IRQ is being serviced by the host.
193 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
194 * except that this value applies while an IRQ is being serviced
195 * by the host.
196 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
197 * a packet is sent.
198 * @tx_max_coalesced_frames: Maximum number of packets to be sent
199 * before a TX interrupt.
200 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
201 * this value applies while an IRQ is being serviced by the host.
202 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
203 * except that this value applies while an IRQ is being serviced
204 * by the host.
205 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
206 * statistics block updates. Some drivers do not have an
207 * in-memory statistic block, and in such cases this value is
208 * ignored. This value must not be zero.
209 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
210 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
211 * @pkt_rate_low: Threshold for low packet rate (packets per second).
212 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
213 * a packet arrives, when the packet rate is below @pkt_rate_low.
214 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
215 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
216 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
217 * a packet is sent, when the packet rate is below @pkt_rate_low.
218 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
219 * a TX interrupt, when the packet rate is below @pkt_rate_low.
220 * @pkt_rate_high: Threshold for high packet rate (packets per second).
221 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
222 * a packet arrives, when the packet rate is above @pkt_rate_high.
223 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
224 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
225 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
226 * a packet is sent, when the packet rate is above @pkt_rate_high.
227 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
228 * a TX interrupt, when the packet rate is above @pkt_rate_high.
229 * @rate_sample_interval: How often to do adaptive coalescing packet rate
230 * sampling, measured in seconds. Must not be zero.
231 *
232 * Each pair of (usecs, max_frames) fields specifies this exit
233 * condition for interrupt coalescing:
234 * (usecs > 0 && time_since_first_completion >= usecs) ||
235 * (max_frames > 0 && completed_frames >= max_frames)
236 * It is illegal to set both usecs and max_frames to zero as this
237 * would cause interrupts to never be generated. To disable
238 * coalescing, set usecs = 0 and max_frames = 1.
239 *
240 * Some implementations ignore the value of max_frames and use the
241 * condition:
242 * time_since_first_completion >= usecs
243 * This is deprecated. Drivers for hardware that does not support
244 * counting completions should validate that max_frames == !rx_usecs.
245 *
246 * Adaptive RX/TX coalescing is an algorithm implemented by some
247 * drivers to improve latency under low packet rates and improve
248 * throughput under high packet rates. Some drivers only implement
249 * one of RX or TX adaptive coalescing. Anything not implemented by
250 * the driver causes these values to be silently ignored.
251 *
252 * When the packet rate is below @pkt_rate_high but above
253 * @pkt_rate_low (both measured in packets per second) the
254 * normal {rx,tx}_* coalescing parameters are used.
255 */
256struct ethtool_coalesce {
257 __u32 cmd;
258 __u32 rx_coalesce_usecs;
259 __u32 rx_max_coalesced_frames;
260 __u32 rx_coalesce_usecs_irq;
261 __u32 rx_max_coalesced_frames_irq;
262 __u32 tx_coalesce_usecs;
263 __u32 tx_max_coalesced_frames;
264 __u32 tx_coalesce_usecs_irq;
265 __u32 tx_max_coalesced_frames_irq;
266 __u32 stats_block_coalesce_usecs;
267 __u32 use_adaptive_rx_coalesce;
268 __u32 use_adaptive_tx_coalesce;
269 __u32 pkt_rate_low;
270 __u32 rx_coalesce_usecs_low;
271 __u32 rx_max_coalesced_frames_low;
272 __u32 tx_coalesce_usecs_low;
273 __u32 tx_max_coalesced_frames_low;
274 __u32 pkt_rate_high;
275 __u32 rx_coalesce_usecs_high;
276 __u32 rx_max_coalesced_frames_high;
277 __u32 tx_coalesce_usecs_high;
278 __u32 tx_max_coalesced_frames_high;
279 __u32 rate_sample_interval;
280};
281
282/* for configuring RX/TX ring parameters */
283struct ethtool_ringparam {
284 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
285
286 /* Read only attributes. These indicate the maximum number
287 * of pending RX/TX ring entries the driver will allow the
288 * user to set.
289 */
290 __u32 rx_max_pending;
291 __u32 rx_mini_max_pending;
292 __u32 rx_jumbo_max_pending;
293 __u32 tx_max_pending;
294
295 /* Values changeable by the user. The valid values are
296 * in the range 1 to the "*_max_pending" counterpart above.
297 */
298 __u32 rx_pending;
299 __u32 rx_mini_pending;
300 __u32 rx_jumbo_pending;
301 __u32 tx_pending;
302};
303
304/**
305 * struct ethtool_channels - configuring number of network channel
306 * @cmd: ETHTOOL_{G,S}CHANNELS
307 * @max_rx: Read only. Maximum number of receive channel the driver support.
308 * @max_tx: Read only. Maximum number of transmit channel the driver support.
309 * @max_other: Read only. Maximum number of other channel the driver support.
310 * @max_combined: Read only. Maximum number of combined channel the driver
311 * support. Set of queues RX, TX or other.
312 * @rx_count: Valid values are in the range 1 to the max_rx.
313 * @tx_count: Valid values are in the range 1 to the max_tx.
314 * @other_count: Valid values are in the range 1 to the max_other.
315 * @combined_count: Valid values are in the range 1 to the max_combined.
316 *
317 * This can be used to configure RX, TX and other channels.
318 */
319
320struct ethtool_channels {
321 __u32 cmd;
322 __u32 max_rx;
323 __u32 max_tx;
324 __u32 max_other;
325 __u32 max_combined;
326 __u32 rx_count;
327 __u32 tx_count;
328 __u32 other_count;
329 __u32 combined_count;
330};
331
332/* for configuring link flow control parameters */
333struct ethtool_pauseparam {
334 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
335
336 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
337 * being true) the user may set 'autoneg' here non-zero to have the
338 * pause parameters be auto-negotiated too. In such a case, the
339 * {rx,tx}_pause values below determine what capabilities are
340 * advertised.
341 *
342 * If 'autoneg' is zero or the link is not being auto-negotiated,
343 * then {rx,tx}_pause force the driver to use/not-use pause
344 * flow control.
345 */
346 __u32 autoneg;
347 __u32 rx_pause;
348 __u32 tx_pause;
349};
350
351#define ETH_GSTRING_LEN 32
352enum ethtool_stringset {
353 ETH_SS_TEST = 0,
354 ETH_SS_STATS,
355 ETH_SS_PRIV_FLAGS,
356 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
357 ETH_SS_FEATURES,
358};
359
360/* for passing string sets for data tagging */
361struct ethtool_gstrings {
362 __u32 cmd; /* ETHTOOL_GSTRINGS */
363 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
364 __u32 len; /* number of strings in the string set */
365 __u8 data[0];
366};
367
368struct ethtool_sset_info {
369 __u32 cmd; /* ETHTOOL_GSSET_INFO */
370 __u32 reserved;
371 __u64 sset_mask; /* input: each bit selects an sset to query */
372 /* output: each bit a returned sset */
373 __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
374 in sset_mask. One bit implies one
375 __u32, two bits implies two
376 __u32's, etc. */
377};
378
379/**
380 * enum ethtool_test_flags - flags definition of ethtool_test
381 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
382 * only online tests.
383 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
384 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
385 * test.
386 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
387 */
388
389enum ethtool_test_flags {
390 ETH_TEST_FL_OFFLINE = (1 << 0),
391 ETH_TEST_FL_FAILED = (1 << 1),
392 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
393 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
394};
395
396/* for requesting NIC test and getting results*/
397struct ethtool_test {
398 __u32 cmd; /* ETHTOOL_TEST */
399 __u32 flags; /* ETH_TEST_FL_xxx */
400 __u32 reserved;
401 __u32 len; /* result length, in number of u64 elements */
402 __u64 data[0];
403};
404
405/* for dumping NIC-specific statistics */
406struct ethtool_stats {
407 __u32 cmd; /* ETHTOOL_GSTATS */
408 __u32 n_stats; /* number of u64's being returned */
409 __u64 data[0];
410};
411
412struct ethtool_perm_addr {
413 __u32 cmd; /* ETHTOOL_GPERMADDR */
414 __u32 size;
415 __u8 data[0];
416};
417
418/* boolean flags controlling per-interface behavior characteristics.
419 * When reading, the flag indicates whether or not a certain behavior
420 * is enabled/present. When writing, the flag indicates whether
421 * or not the driver should turn on (set) or off (clear) a behavior.
422 *
423 * Some behaviors may read-only (unconditionally absent or present).
424 * If such is the case, return EINVAL in the set-flags operation if the
425 * flag differs from the read-only value.
426 */
427enum ethtool_flags {
428 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
429 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
430 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
431 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
432 ETH_FLAG_RXHASH = (1 << 28),
433};
434
435/* The following structures are for supporting RX network flow
436 * classification and RX n-tuple configuration. Note, all multibyte
437 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
438 * be in network byte order.
439 */
440
441/**
442 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
443 * @ip4src: Source host
444 * @ip4dst: Destination host
445 * @psrc: Source port
446 * @pdst: Destination port
447 * @tos: Type-of-service
448 *
449 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
450 */
451struct ethtool_tcpip4_spec {
452 __be32 ip4src;
453 __be32 ip4dst;
454 __be16 psrc;
455 __be16 pdst;
456 __u8 tos;
457};
458
459/**
460 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
461 * @ip4src: Source host
462 * @ip4dst: Destination host
463 * @spi: Security parameters index
464 * @tos: Type-of-service
465 *
466 * This can be used to specify an IPsec transport or tunnel over IPv4.
467 */
468struct ethtool_ah_espip4_spec {
469 __be32 ip4src;
470 __be32 ip4dst;
471 __be32 spi;
472 __u8 tos;
473};
474
475#define ETH_RX_NFC_IP4 1
476
477/**
478 * struct ethtool_usrip4_spec - general flow specification for IPv4
479 * @ip4src: Source host
480 * @ip4dst: Destination host
481 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
482 * @tos: Type-of-service
483 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
484 * @proto: Transport protocol number; mask must be 0
485 */
486struct ethtool_usrip4_spec {
487 __be32 ip4src;
488 __be32 ip4dst;
489 __be32 l4_4_bytes;
490 __u8 tos;
491 __u8 ip_ver;
492 __u8 proto;
493};
494
495union ethtool_flow_union {
496 struct ethtool_tcpip4_spec tcp_ip4_spec;
497 struct ethtool_tcpip4_spec udp_ip4_spec;
498 struct ethtool_tcpip4_spec sctp_ip4_spec;
499 struct ethtool_ah_espip4_spec ah_ip4_spec;
500 struct ethtool_ah_espip4_spec esp_ip4_spec;
501 struct ethtool_usrip4_spec usr_ip4_spec;
502 struct ethhdr ether_spec;
503 __u8 hdata[60];
504};
505
506struct ethtool_flow_ext {
507 __be16 vlan_etype;
508 __be16 vlan_tci;
509 __be32 data[2];
510};
511
512/**
513 * struct ethtool_rx_flow_spec - classification rule for RX flows
514 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
515 * @h_u: Flow fields to match (dependent on @flow_type)
516 * @h_ext: Additional fields to match
517 * @m_u: Masks for flow field bits to be matched
518 * @m_ext: Masks for additional field bits to be matched
519 * Note, all additional fields must be ignored unless @flow_type
520 * includes the %FLOW_EXT flag.
521 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
522 * if packets should be discarded
523 * @location: Location of rule in the table. Locations must be
524 * numbered such that a flow matching multiple rules will be
525 * classified according to the first (lowest numbered) rule.
526 */
527struct ethtool_rx_flow_spec {
528 __u32 flow_type;
529 union ethtool_flow_union h_u;
530 struct ethtool_flow_ext h_ext;
531 union ethtool_flow_union m_u;
532 struct ethtool_flow_ext m_ext;
533 __u64 ring_cookie;
534 __u32 location;
535};
536
537/**
538 * struct ethtool_rxnfc - command to get or set RX flow classification rules
539 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
540 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
541 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
542 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
543 * @data: Command-dependent value
544 * @fs: Flow classification rule
545 * @rule_cnt: Number of rules to be affected
546 * @rule_locs: Array of used rule locations
547 *
548 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
549 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
550 * structure fields must not be used.
551 *
552 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
553 * on return.
554 *
555 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
556 * rules on return. If @data is non-zero on return then it is the
557 * size of the rule table, plus the flag %RX_CLS_LOC_SPECIAL if the
558 * driver supports any special location values. If that flag is not
559 * set in @data then special location values should not be used.
560 *
561 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
562 * existing rule on entry and @fs contains the rule on return.
563 *
564 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
565 * user buffer for @rule_locs on entry. On return, @data is the size
566 * of the rule table, @rule_cnt is the number of defined rules, and
567 * @rule_locs contains the locations of the defined rules. Drivers
568 * must use the second parameter to get_rxnfc() instead of @rule_locs.
569 *
570 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
571 * @fs.@location either specifies the location to use or is a special
572 * location value with %RX_CLS_LOC_SPECIAL flag set. On return,
573 * @fs.@location is the actual rule location.
574 *
575 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
576 * existing rule on entry.
577 *
578 * A driver supporting the special location values for
579 * %ETHTOOL_SRXCLSRLINS may add the rule at any suitable unused
580 * location, and may remove a rule at a later location (lower
581 * priority) that matches exactly the same set of flows. The special
582 * values are: %RX_CLS_LOC_ANY, selecting any location;
583 * %RX_CLS_LOC_FIRST, selecting the first suitable location (maximum
584 * priority); and %RX_CLS_LOC_LAST, selecting the last suitable
585 * location (minimum priority). Additional special values may be
586 * defined in future and drivers must return -%EINVAL for any
587 * unrecognised value.
588 */
589struct ethtool_rxnfc {
590 __u32 cmd;
591 __u32 flow_type;
592 __u64 data;
593 struct ethtool_rx_flow_spec fs;
594 __u32 rule_cnt;
595 __u32 rule_locs[0];
596};
597
598
599/**
600 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
601 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
602 * @size: On entry, the array size of the user buffer, which may be zero.
603 * On return from %ETHTOOL_GRXFHINDIR, the array size of the hardware
604 * indirection table.
605 * @ring_index: RX ring/queue index for each hash value
606 *
607 * For %ETHTOOL_GRXFHINDIR, a @size of zero means that only the size
608 * should be returned. For %ETHTOOL_SRXFHINDIR, a @size of zero means
609 * the table should be reset to default values. This last feature
610 * is not supported by the original implementations.
611 */
612struct ethtool_rxfh_indir {
613 __u32 cmd;
614 __u32 size;
615 __u32 ring_index[0];
616};
617
618/**
619 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
620 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
621 * @h_u: Flow field values to match (dependent on @flow_type)
622 * @m_u: Masks for flow field value bits to be ignored
623 * @vlan_tag: VLAN tag to match
624 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
625 * @data: Driver-dependent data to match
626 * @data_mask: Mask for driver-dependent data bits to be ignored
627 * @action: RX ring/queue index to deliver to (non-negative) or other action
628 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
629 *
630 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
631 * a field value and mask are both zero this is treated as if all mask
632 * bits are set i.e. the field is ignored.
633 */
634struct ethtool_rx_ntuple_flow_spec {
635 __u32 flow_type;
636 union {
637 struct ethtool_tcpip4_spec tcp_ip4_spec;
638 struct ethtool_tcpip4_spec udp_ip4_spec;
639 struct ethtool_tcpip4_spec sctp_ip4_spec;
640 struct ethtool_ah_espip4_spec ah_ip4_spec;
641 struct ethtool_ah_espip4_spec esp_ip4_spec;
642 struct ethtool_usrip4_spec usr_ip4_spec;
643 struct ethhdr ether_spec;
644 __u8 hdata[72];
645 } h_u, m_u;
646
647 __u16 vlan_tag;
648 __u16 vlan_tag_mask;
649 __u64 data;
650 __u64 data_mask;
651
652 __s32 action;
653#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
654#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
655};
656
657/**
658 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
659 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
660 * @fs: Flow filter specification
661 */
662struct ethtool_rx_ntuple {
663 __u32 cmd;
664 struct ethtool_rx_ntuple_flow_spec fs;
665};
666
667#define ETHTOOL_FLASH_MAX_FILENAME 128
668enum ethtool_flash_op_type {
669 ETHTOOL_FLASH_ALL_REGIONS = 0,
670};
671
672/* for passing firmware flashing related parameters */
673struct ethtool_flash {
674 __u32 cmd;
675 __u32 region;
676 char data[ETHTOOL_FLASH_MAX_FILENAME];
677};
678
679/**
680 * struct ethtool_dump - used for retrieving, setting device dump
681 * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or
682 * %ETHTOOL_SET_DUMP
683 * @version: FW version of the dump, filled in by driver
684 * @flag: driver dependent flag for dump setting, filled in by driver during
685 * get and filled in by ethtool for set operation.
686 * flag must be initialized by macro ETH_FW_DUMP_DISABLE value when
687 * firmware dump is disabled.
688 * @len: length of dump data, used as the length of the user buffer on entry to
689 * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver
690 * for %ETHTOOL_GET_DUMP_FLAG command
691 * @data: data collected for get dump data operation
692 */
693
694#define ETH_FW_DUMP_DISABLE 0
695
696struct ethtool_dump {
697 __u32 cmd;
698 __u32 version;
699 __u32 flag;
700 __u32 len;
701 __u8 data[0];
702};
703
704/* for returning and changing feature sets */
705
706/**
707 * struct ethtool_get_features_block - block with state of 32 features
708 * @available: mask of changeable features
709 * @requested: mask of features requested to be enabled if possible
710 * @active: mask of currently enabled features
711 * @never_changed: mask of features not changeable for any device
712 */
713struct ethtool_get_features_block {
714 __u32 available;
715 __u32 requested;
716 __u32 active;
717 __u32 never_changed;
718};
719
720/**
721 * struct ethtool_gfeatures - command to get state of device's features
722 * @cmd: command number = %ETHTOOL_GFEATURES
723 * @size: in: number of elements in the features[] array;
724 * out: number of elements in features[] needed to hold all features
725 * @features: state of features
726 */
727struct ethtool_gfeatures {
728 __u32 cmd;
729 __u32 size;
730 struct ethtool_get_features_block features[0];
731};
732
733/**
734 * struct ethtool_set_features_block - block with request for 32 features
735 * @valid: mask of features to be changed
736 * @requested: values of features to be changed
737 */
738struct ethtool_set_features_block {
739 __u32 valid;
740 __u32 requested;
741};
742
743/**
744 * struct ethtool_sfeatures - command to request change in device's features
745 * @cmd: command number = %ETHTOOL_SFEATURES
746 * @size: array size of the features[] array
747 * @features: feature change masks
748 */
749struct ethtool_sfeatures {
750 __u32 cmd;
751 __u32 size;
752 struct ethtool_set_features_block features[0];
753};
754
755/**
756 * struct ethtool_ts_info - holds a device's timestamping and PHC association
757 * @cmd: command number = %ETHTOOL_GET_TS_INFO
758 * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
759 * @phc_index: device index of the associated PHC, or -1 if there is none
760 * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
761 * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
762 *
763 * The bits in the 'tx_types' and 'rx_filters' fields correspond to
764 * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
765 * respectively. For example, if the device supports HWTSTAMP_TX_ON,
766 * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
767 */
768struct ethtool_ts_info {
769 __u32 cmd;
770 __u32 so_timestamping;
771 __s32 phc_index;
772 __u32 tx_types;
773 __u32 tx_reserved[3];
774 __u32 rx_filters;
775 __u32 rx_reserved[3];
776};
777
778/*
779 * %ETHTOOL_SFEATURES changes features present in features[].valid to the
780 * values of corresponding bits in features[].requested. Bits in .requested
781 * not set in .valid or not changeable are ignored.
782 *
783 * Returns %EINVAL when .valid contains undefined or never-changeable bits
784 * or size is not equal to required number of features words (32-bit blocks).
785 * Returns >= 0 if request was completed; bits set in the value mean:
786 * %ETHTOOL_F_UNSUPPORTED - there were bits set in .valid that are not
787 * changeable (not present in %ETHTOOL_GFEATURES' features[].available)
788 * those bits were ignored.
789 * %ETHTOOL_F_WISH - some or all changes requested were recorded but the
790 * resulting state of bits masked by .valid is not equal to .requested.
791 * Probably there are other device-specific constraints on some features
792 * in the set. When %ETHTOOL_F_UNSUPPORTED is set, .valid is considered
793 * here as though ignored bits were cleared.
794 * %ETHTOOL_F_COMPAT - some or all changes requested were made by calling
795 * compatibility functions. Requested offload state cannot be properly
796 * managed by kernel.
797 *
798 * Meaning of bits in the masks are obtained by %ETHTOOL_GSSET_INFO (number of
799 * bits in the arrays - always multiple of 32) and %ETHTOOL_GSTRINGS commands
800 * for ETH_SS_FEATURES string set. First entry in the table corresponds to least
801 * significant bit in features[0] fields. Empty strings mark undefined features.
802 */
803enum ethtool_sfeatures_retval_bits {
804 ETHTOOL_F_UNSUPPORTED__BIT,
805 ETHTOOL_F_WISH__BIT,
806 ETHTOOL_F_COMPAT__BIT,
807};
808
809#define ETHTOOL_F_UNSUPPORTED (1 << ETHTOOL_F_UNSUPPORTED__BIT)
810#define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
811#define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
812
813
814/* CMDs currently supported */
815#define ETHTOOL_GSET 0x00000001 /* Get settings. */
816#define ETHTOOL_SSET 0x00000002 /* Set settings. */
817#define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
818#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
819#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
820#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
821#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
822#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
823#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
824/* Get link status for host, i.e. whether the interface *and* the
825 * physical port (if there is one) are up (ethtool_value). */
826#define ETHTOOL_GLINK 0x0000000a
827#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
828#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
829#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
830#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
831#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
832#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
833#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
834#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
835#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
836#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
837#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
838#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
839#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
840 * (ethtool_value) */
841#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
842 * (ethtool_value). */
843#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
844#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
845#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
846#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
847#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
848#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
849#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
850#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
851#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
852#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
853#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
854#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
855#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
856#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
857#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
858
859#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
860#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
861#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
862#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
863#define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */
864#define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */
865#define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */
866#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
867#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
868#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
869#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
870#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
871#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
872#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
873#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
874#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
875#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
876
877#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
878#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
879#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
880#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
881#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
882#define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */
883#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
884#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
885#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
886#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
887#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
888#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
889
890/* compatibility with older code */
891#define SPARC_ETH_GSET ETHTOOL_GSET
892#define SPARC_ETH_SSET ETHTOOL_SSET
893
894/* Indicates what features are supported by the interface. */
895#define SUPPORTED_10baseT_Half (1 << 0)
896#define SUPPORTED_10baseT_Full (1 << 1)
897#define SUPPORTED_100baseT_Half (1 << 2)
898#define SUPPORTED_100baseT_Full (1 << 3)
899#define SUPPORTED_1000baseT_Half (1 << 4)
900#define SUPPORTED_1000baseT_Full (1 << 5)
901#define SUPPORTED_Autoneg (1 << 6)
902#define SUPPORTED_TP (1 << 7)
903#define SUPPORTED_AUI (1 << 8)
904#define SUPPORTED_MII (1 << 9)
905#define SUPPORTED_FIBRE (1 << 10)
906#define SUPPORTED_BNC (1 << 11)
907#define SUPPORTED_10000baseT_Full (1 << 12)
908#define SUPPORTED_Pause (1 << 13)
909#define SUPPORTED_Asym_Pause (1 << 14)
910#define SUPPORTED_2500baseX_Full (1 << 15)
911#define SUPPORTED_Backplane (1 << 16)
912#define SUPPORTED_1000baseKX_Full (1 << 17)
913#define SUPPORTED_10000baseKX4_Full (1 << 18)
914#define SUPPORTED_10000baseKR_Full (1 << 19)
915#define SUPPORTED_10000baseR_FEC (1 << 20)
916#define SUPPORTED_20000baseMLD2_Full (1 << 21)
917#define SUPPORTED_20000baseKR2_Full (1 << 22)
918#define SUPPORTED_40000baseKR4_Full (1 << 23)
919#define SUPPORTED_40000baseCR4_Full (1 << 24)
920#define SUPPORTED_40000baseSR4_Full (1 << 25)
921#define SUPPORTED_40000baseLR4_Full (1 << 26)
922
923/* Indicates what features are advertised by the interface. */
924#define ADVERTISED_10baseT_Half (1 << 0)
925#define ADVERTISED_10baseT_Full (1 << 1)
926#define ADVERTISED_100baseT_Half (1 << 2)
927#define ADVERTISED_100baseT_Full (1 << 3)
928#define ADVERTISED_1000baseT_Half (1 << 4)
929#define ADVERTISED_1000baseT_Full (1 << 5)
930#define ADVERTISED_Autoneg (1 << 6)
931#define ADVERTISED_TP (1 << 7)
932#define ADVERTISED_AUI (1 << 8)
933#define ADVERTISED_MII (1 << 9)
934#define ADVERTISED_FIBRE (1 << 10)
935#define ADVERTISED_BNC (1 << 11)
936#define ADVERTISED_10000baseT_Full (1 << 12)
937#define ADVERTISED_Pause (1 << 13)
938#define ADVERTISED_Asym_Pause (1 << 14)
939#define ADVERTISED_2500baseX_Full (1 << 15)
940#define ADVERTISED_Backplane (1 << 16)
941#define ADVERTISED_1000baseKX_Full (1 << 17)
942#define ADVERTISED_10000baseKX4_Full (1 << 18)
943#define ADVERTISED_10000baseKR_Full (1 << 19)
944#define ADVERTISED_10000baseR_FEC (1 << 20)
945#define ADVERTISED_20000baseMLD2_Full (1 << 21)
946#define ADVERTISED_20000baseKR2_Full (1 << 22)
947#define ADVERTISED_40000baseKR4_Full (1 << 23)
948#define ADVERTISED_40000baseCR4_Full (1 << 24)
949#define ADVERTISED_40000baseSR4_Full (1 << 25)
950#define ADVERTISED_40000baseLR4_Full (1 << 26)
951
952/* The following are all involved in forcing a particular link
953 * mode for the device for setting things. When getting the
954 * devices settings, these indicate the current mode and whether
955 * it was forced up into this mode or autonegotiated.
956 */
957
958/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
959#define SPEED_10 10
960#define SPEED_100 100
961#define SPEED_1000 1000
962#define SPEED_2500 2500
963#define SPEED_10000 10000
964#define SPEED_UNKNOWN -1
965
966/* Duplex, half or full. */
967#define DUPLEX_HALF 0x00
968#define DUPLEX_FULL 0x01
969#define DUPLEX_UNKNOWN 0xff
970
971/* Which connector port. */
972#define PORT_TP 0x00
973#define PORT_AUI 0x01
974#define PORT_MII 0x02
975#define PORT_FIBRE 0x03
976#define PORT_BNC 0x04
977#define PORT_DA 0x05
978#define PORT_NONE 0xef
979#define PORT_OTHER 0xff
980
981/* Which transceiver to use. */
982#define XCVR_INTERNAL 0x00
983#define XCVR_EXTERNAL 0x01
984#define XCVR_DUMMY1 0x02
985#define XCVR_DUMMY2 0x03
986#define XCVR_DUMMY3 0x04
987
988/* Enable or disable autonegotiation. If this is set to enable,
989 * the forced link modes above are completely ignored.
990 */
991#define AUTONEG_DISABLE 0x00
992#define AUTONEG_ENABLE 0x01
993
994/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
995 * the driver is required to renegotiate link
996 */
997#define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */
998#define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */
999#define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */
1000#define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */
1001
1002/* Wake-On-Lan options. */
1003#define WAKE_PHY (1 << 0)
1004#define WAKE_UCAST (1 << 1)
1005#define WAKE_MCAST (1 << 2)
1006#define WAKE_BCAST (1 << 3)
1007#define WAKE_ARP (1 << 4)
1008#define WAKE_MAGIC (1 << 5)
1009#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
1010
1011/* L2-L4 network traffic flow types */
1012#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
1013#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
1014#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
1015#define AH_ESP_V4_FLOW 0x04 /* hash only */
1016#define TCP_V6_FLOW 0x05 /* hash only */
1017#define UDP_V6_FLOW 0x06 /* hash only */
1018#define SCTP_V6_FLOW 0x07 /* hash only */
1019#define AH_ESP_V6_FLOW 0x08 /* hash only */
1020#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
1021#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
1022#define AH_V6_FLOW 0x0b /* hash only */
1023#define ESP_V6_FLOW 0x0c /* hash only */
1024#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1025#define IPV4_FLOW 0x10 /* hash only */
1026#define IPV6_FLOW 0x11 /* hash only */
1027#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1028/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1029#define FLOW_EXT 0x80000000
1030
1031/* L3-L4 network traffic flow hash options */
1032#define RXH_L2DA (1 << 1)
1033#define RXH_VLAN (1 << 2)
1034#define RXH_L3_PROTO (1 << 3)
1035#define RXH_IP_SRC (1 << 4)
1036#define RXH_IP_DST (1 << 5)
1037#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
1038#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
1039#define RXH_DISCARD (1 << 31)
1040
1041#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
1042
1043/* Special RX classification rule insert location values */
1044#define RX_CLS_LOC_SPECIAL 0x80000000 /* flag */
1045#define RX_CLS_LOC_ANY 0xffffffff
1046#define RX_CLS_LOC_FIRST 0xfffffffe
1047#define RX_CLS_LOC_LAST 0xfffffffd
1048
1049/* EEPROM Standards for plug in modules */
1050#define ETH_MODULE_SFF_8079 0x1
1051#define ETH_MODULE_SFF_8079_LEN 256
1052#define ETH_MODULE_SFF_8472 0x2
1053#define ETH_MODULE_SFF_8472_LEN 512
1054
1055/* Reset flags */
1056/* The reset() operation must clear the flags for the components which
1057 * were actually reset. On successful return, the flags indicate the
1058 * components which were not reset, either because they do not exist
1059 * in the hardware or because they cannot be reset independently. The
1060 * driver must never reset any components that were not requested.
1061 */
1062enum ethtool_reset_flags {
1063 /* These flags represent components dedicated to the interface
1064 * the command is addressed to. Shift any flag left by
1065 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
1066 * same type.
1067 */
1068 ETH_RESET_MGMT = 1 << 0, /* Management processor */
1069 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
1070 ETH_RESET_DMA = 1 << 2, /* DMA engine */
1071 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
1072 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
1073 ETH_RESET_MAC = 1 << 5, /* Media access controller */
1074 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
1075 ETH_RESET_RAM = 1 << 7, /* RAM shared between
1076 * multiple components */
1077
1078 ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
1079 * this interface */
1080 ETH_RESET_ALL = 0xffffffff, /* All components used by this
1081 * interface, even if shared */
1082};
1083#define ETH_RESET_SHARED_SHIFT 16
1084
1085#endif /* _UAPI_LINUX_ETHTOOL_H */
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h
new file mode 100644
index 00000000000..8c99ce7202c
--- /dev/null
+++ b/include/uapi/linux/eventpoll.h
@@ -0,0 +1,66 @@
1/*
2 * include/linux/eventpoll.h ( Efficient event polling implementation )
3 * Copyright (C) 2001,...,2006 Davide Libenzi
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Davide Libenzi <davidel@xmailserver.org>
11 *
12 */
13
14#ifndef _UAPI_LINUX_EVENTPOLL_H
15#define _UAPI_LINUX_EVENTPOLL_H
16
17/* For O_CLOEXEC */
18#include <linux/fcntl.h>
19#include <linux/types.h>
20
21/* Flags for epoll_create1. */
22#define EPOLL_CLOEXEC O_CLOEXEC
23
24/* Valid opcodes to issue to sys_epoll_ctl() */
25#define EPOLL_CTL_ADD 1
26#define EPOLL_CTL_DEL 2
27#define EPOLL_CTL_MOD 3
28#define EPOLL_CTL_DISABLE 4
29
30/*
31 * Request the handling of system wakeup events so as to prevent system suspends
32 * from happening while those events are being processed.
33 *
34 * Assuming neither EPOLLET nor EPOLLONESHOT is set, system suspends will not be
35 * re-allowed until epoll_wait is called again after consuming the wakeup
36 * event(s).
37 *
38 * Requires CAP_BLOCK_SUSPEND
39 */
40#define EPOLLWAKEUP (1 << 29)
41
42/* Set the One Shot behaviour for the target file descriptor */
43#define EPOLLONESHOT (1 << 30)
44
45/* Set the Edge Triggered behaviour for the target file descriptor */
46#define EPOLLET (1 << 31)
47
48/*
49 * On x86-64 make the 64bit structure have the same alignment as the
50 * 32bit structure. This makes 32bit emulation easier.
51 *
52 * UML/x86_64 needs the same packing as x86_64
53 */
54#ifdef __x86_64__
55#define EPOLL_PACKED __attribute__((packed))
56#else
57#define EPOLL_PACKED
58#endif
59
60struct epoll_event {
61 __u32 events;
62 __u64 data;
63} EPOLL_PACKED;
64
65
66#endif /* _UAPI_LINUX_EVENTPOLL_H */
diff --git a/include/linux/fadvise.h b/include/uapi/linux/fadvise.h
index e8e747139b9..e8e747139b9 100644
--- a/include/linux/fadvise.h
+++ b/include/uapi/linux/fadvise.h
diff --git a/include/uapi/linux/falloc.h b/include/uapi/linux/falloc.h
new file mode 100644
index 00000000000..990c4ccf8b6
--- /dev/null
+++ b/include/uapi/linux/falloc.h
@@ -0,0 +1,9 @@
1#ifndef _UAPI_FALLOC_H_
2#define _UAPI_FALLOC_H_
3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
6#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
7
8
9#endif /* _UAPI_FALLOC_H_ */
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
new file mode 100644
index 00000000000..030508d195d
--- /dev/null
+++ b/include/uapi/linux/fanotify.h
@@ -0,0 +1,116 @@
1#ifndef _UAPI_LINUX_FANOTIFY_H
2#define _UAPI_LINUX_FANOTIFY_H
3
4#include <linux/types.h>
5
6/* the following events that user-space can register for */
7#define FAN_ACCESS 0x00000001 /* File was accessed */
8#define FAN_MODIFY 0x00000002 /* File was modified */
9#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
10#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
11#define FAN_OPEN 0x00000020 /* File was opened */
12
13#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
14
15#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
16#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
17
18#define FAN_ONDIR 0x40000000 /* event occurred against dir */
19
20#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
21
22/* helper events */
23#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
24
25/* flags used for fanotify_init() */
26#define FAN_CLOEXEC 0x00000001
27#define FAN_NONBLOCK 0x00000002
28
29/* These are NOT bitwise flags. Both bits are used togther. */
30#define FAN_CLASS_NOTIF 0x00000000
31#define FAN_CLASS_CONTENT 0x00000004
32#define FAN_CLASS_PRE_CONTENT 0x00000008
33#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
34 FAN_CLASS_PRE_CONTENT)
35
36#define FAN_UNLIMITED_QUEUE 0x00000010
37#define FAN_UNLIMITED_MARKS 0x00000020
38
39#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
40 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
41 FAN_UNLIMITED_MARKS)
42
43/* flags used for fanotify_modify_mark() */
44#define FAN_MARK_ADD 0x00000001
45#define FAN_MARK_REMOVE 0x00000002
46#define FAN_MARK_DONT_FOLLOW 0x00000004
47#define FAN_MARK_ONLYDIR 0x00000008
48#define FAN_MARK_MOUNT 0x00000010
49#define FAN_MARK_IGNORED_MASK 0x00000020
50#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
51#define FAN_MARK_FLUSH 0x00000080
52
53#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
54 FAN_MARK_REMOVE |\
55 FAN_MARK_DONT_FOLLOW |\
56 FAN_MARK_ONLYDIR |\
57 FAN_MARK_MOUNT |\
58 FAN_MARK_IGNORED_MASK |\
59 FAN_MARK_IGNORED_SURV_MODIFY |\
60 FAN_MARK_FLUSH)
61
62/*
63 * All of the events - we build the list by hand so that we can add flags in
64 * the future and not break backward compatibility. Apps will get only the
65 * events that they originally wanted. Be sure to add new events here!
66 */
67#define FAN_ALL_EVENTS (FAN_ACCESS |\
68 FAN_MODIFY |\
69 FAN_CLOSE |\
70 FAN_OPEN)
71
72/*
73 * All events which require a permission response from userspace
74 */
75#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
76 FAN_ACCESS_PERM)
77
78#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
79 FAN_ALL_PERM_EVENTS |\
80 FAN_Q_OVERFLOW)
81
82#define FANOTIFY_METADATA_VERSION 3
83
84struct fanotify_event_metadata {
85 __u32 event_len;
86 __u8 vers;
87 __u8 reserved;
88 __u16 metadata_len;
89 __aligned_u64 mask;
90 __s32 fd;
91 __s32 pid;
92};
93
94struct fanotify_response {
95 __s32 fd;
96 __u32 response;
97};
98
99/* Legit userspace responses to a _PERM event */
100#define FAN_ALLOW 0x01
101#define FAN_DENY 0x02
102/* No fd set in event */
103#define FAN_NOFD -1
104
105/* Helper functions to deal with fanotify_event_metadata buffers */
106#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
107
108#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
109 (struct fanotify_event_metadata*)(((char *)(meta)) + \
110 (meta)->event_len))
111
112#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
113 (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
114 (long)(meta)->event_len <= (long)(len))
115
116#endif /* _UAPI_LINUX_FANOTIFY_H */
diff --git a/include/uapi/linux/fb.h b/include/uapi/linux/fb.h
new file mode 100644
index 00000000000..fb795c3b3c1
--- /dev/null
+++ b/include/uapi/linux/fb.h
@@ -0,0 +1,402 @@
1#ifndef _UAPI_LINUX_FB_H
2#define _UAPI_LINUX_FB_H
3
4#include <linux/types.h>
5#include <linux/i2c.h>
6
7/* Definitions of frame buffers */
8
9#define FB_MAX 32 /* sufficient for now */
10
11/* ioctls
12 0x46 is 'F' */
13#define FBIOGET_VSCREENINFO 0x4600
14#define FBIOPUT_VSCREENINFO 0x4601
15#define FBIOGET_FSCREENINFO 0x4602
16#define FBIOGETCMAP 0x4604
17#define FBIOPUTCMAP 0x4605
18#define FBIOPAN_DISPLAY 0x4606
19#ifndef __KERNEL__
20#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
21#endif
22/* 0x4607-0x460B are defined below */
23/* #define FBIOGET_MONITORSPEC 0x460C */
24/* #define FBIOPUT_MONITORSPEC 0x460D */
25/* #define FBIOSWITCH_MONIBIT 0x460E */
26#define FBIOGET_CON2FBMAP 0x460F
27#define FBIOPUT_CON2FBMAP 0x4610
28#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
29#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
30#define FBIO_ALLOC 0x4613
31#define FBIO_FREE 0x4614
32#define FBIOGET_GLYPH 0x4615
33#define FBIOGET_HWCINFO 0x4616
34#define FBIOPUT_MODEINFO 0x4617
35#define FBIOGET_DISPINFO 0x4618
36#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
37
38#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
39#define FB_TYPE_PLANES 1 /* Non interleaved planes */
40#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
41#define FB_TYPE_TEXT 3 /* Text/attributes */
42#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
43#define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */
44
45#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
46#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
47#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
48#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
49#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
50#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
51#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
52#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
53#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
54#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
55#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
56#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
57
58#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
59#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
60#define FB_AUX_VGA_PLANES_CFB8 2 /* CFB8 in planes (VGA) */
61
62#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
63#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
64#define FB_VISUAL_TRUECOLOR 2 /* True color */
65#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
66#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
67#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
68#define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */
69
70#define FB_ACCEL_NONE 0 /* no hardware accelerator */
71#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
72#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
73#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
74#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
75#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
76#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
77#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
78#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
79#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
80#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
81#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
82#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
83#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
84#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
85#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
86#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
87#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
88#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
89#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
90#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
91#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
92#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
93#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
94#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
95#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
96#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
97#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
98#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
99#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
100#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
101#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
102#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
103#define FB_ACCEL_IGS_CYBER2000 33 /* CyberPro 2000 */
104#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
105#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
106#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
107#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
108#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
109#define FB_ACCEL_I810 39 /* Intel 810/815 */
110#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
111#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
112#define FB_ACCEL_I830 42 /* Intel 830M/845G/85x/865G */
113#define FB_ACCEL_NV_10 43 /* nVidia Arch 10 */
114#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
115#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
116#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
117#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
118#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
119#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
120#define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */
121#define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */
122#define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */
123#define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */
124#define FB_ACCEL_CIRRUS_ALPINE 53 /* Cirrus Logic 543x/544x/5480 */
125#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
126#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
127#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
128#define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097 */
129#define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160 */
130#define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200 */
131#define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */
132#define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
133#define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
134#define FB_ACCEL_PXA3XX 99 /* PXA3xx */
135
136#define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
137#define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
138#define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 Savage3D-MV */
139#define FB_ACCEL_SAVAGE2000 0x83 /* S3 Savage2000 */
140#define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 Savage/MX-MV */
141#define FB_ACCEL_SAVAGE_MX 0x85 /* S3 Savage/MX */
142#define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 Savage/IX-MV */
143#define FB_ACCEL_SAVAGE_IX 0x87 /* S3 Savage/IX */
144#define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 ProSavage PM133 */
145#define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 ProSavage KM133 */
146#define FB_ACCEL_S3TWISTER_P 0x8a /* S3 Twister */
147#define FB_ACCEL_S3TWISTER_K 0x8b /* S3 TwisterK */
148#define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 Supersavage */
149#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
150#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
151
152#define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */
153
154#define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */
155
156struct fb_fix_screeninfo {
157 char id[16]; /* identification string eg "TT Builtin" */
158 unsigned long smem_start; /* Start of frame buffer mem */
159 /* (physical address) */
160 __u32 smem_len; /* Length of frame buffer mem */
161 __u32 type; /* see FB_TYPE_* */
162 __u32 type_aux; /* Interleave for interleaved Planes */
163 __u32 visual; /* see FB_VISUAL_* */
164 __u16 xpanstep; /* zero if no hardware panning */
165 __u16 ypanstep; /* zero if no hardware panning */
166 __u16 ywrapstep; /* zero if no hardware ywrap */
167 __u32 line_length; /* length of a line in bytes */
168 unsigned long mmio_start; /* Start of Memory Mapped I/O */
169 /* (physical address) */
170 __u32 mmio_len; /* Length of Memory Mapped I/O */
171 __u32 accel; /* Indicate to driver which */
172 /* specific chip/card we have */
173 __u16 capabilities; /* see FB_CAP_* */
174 __u16 reserved[2]; /* Reserved for future compatibility */
175};
176
177/* Interpretation of offset for color fields: All offsets are from the right,
178 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
179 * can use the offset as right argument to <<). A pixel afterwards is a bit
180 * stream and is written to video memory as that unmodified.
181 *
182 * For pseudocolor: offset and length should be the same for all color
183 * components. Offset specifies the position of the least significant bit
184 * of the pallette index in a pixel value. Length indicates the number
185 * of available palette entries (i.e. # of entries = 1 << length).
186 */
187struct fb_bitfield {
188 __u32 offset; /* beginning of bitfield */
189 __u32 length; /* length of bitfield */
190 __u32 msb_right; /* != 0 : Most significant bit is */
191 /* right */
192};
193
194#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
195#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
196
197#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
198#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
199#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
200#define FB_ACTIVATE_MASK 15
201 /* values */
202#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
203#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
204#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
205#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
206#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
207
208#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
209
210#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
211#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
212#define FB_SYNC_EXT 4 /* external sync */
213#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
214#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
215 /* vtotal = 144d/288n/576i => PAL */
216 /* vtotal = 121d/242n/484i => NTSC */
217#define FB_SYNC_ON_GREEN 32 /* sync on green */
218
219#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
220#define FB_VMODE_INTERLACED 1 /* interlaced */
221#define FB_VMODE_DOUBLE 2 /* double scan */
222#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
223#define FB_VMODE_MASK 255
224
225#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
226#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
227#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
228
229/*
230 * Display rotation support
231 */
232#define FB_ROTATE_UR 0
233#define FB_ROTATE_CW 1
234#define FB_ROTATE_UD 2
235#define FB_ROTATE_CCW 3
236
237#define PICOS2KHZ(a) (1000000000UL/(a))
238#define KHZ2PICOS(a) (1000000000UL/(a))
239
240struct fb_var_screeninfo {
241 __u32 xres; /* visible resolution */
242 __u32 yres;
243 __u32 xres_virtual; /* virtual resolution */
244 __u32 yres_virtual;
245 __u32 xoffset; /* offset from virtual to visible */
246 __u32 yoffset; /* resolution */
247
248 __u32 bits_per_pixel; /* guess what */
249 __u32 grayscale; /* 0 = color, 1 = grayscale, */
250 /* >1 = FOURCC */
251 struct fb_bitfield red; /* bitfield in fb mem if true color, */
252 struct fb_bitfield green; /* else only length is significant */
253 struct fb_bitfield blue;
254 struct fb_bitfield transp; /* transparency */
255
256 __u32 nonstd; /* != 0 Non standard pixel format */
257
258 __u32 activate; /* see FB_ACTIVATE_* */
259
260 __u32 height; /* height of picture in mm */
261 __u32 width; /* width of picture in mm */
262
263 __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
264
265 /* Timing: All values in pixclocks, except pixclock (of course) */
266 __u32 pixclock; /* pixel clock in ps (pico seconds) */
267 __u32 left_margin; /* time from sync to picture */
268 __u32 right_margin; /* time from picture to sync */
269 __u32 upper_margin; /* time from sync to picture */
270 __u32 lower_margin;
271 __u32 hsync_len; /* length of horizontal sync */
272 __u32 vsync_len; /* length of vertical sync */
273 __u32 sync; /* see FB_SYNC_* */
274 __u32 vmode; /* see FB_VMODE_* */
275 __u32 rotate; /* angle we rotate counter clockwise */
276 __u32 colorspace; /* colorspace for FOURCC-based modes */
277 __u32 reserved[4]; /* Reserved for future compatibility */
278};
279
280struct fb_cmap {
281 __u32 start; /* First entry */
282 __u32 len; /* Number of entries */
283 __u16 *red; /* Red values */
284 __u16 *green;
285 __u16 *blue;
286 __u16 *transp; /* transparency, can be NULL */
287};
288
289struct fb_con2fbmap {
290 __u32 console;
291 __u32 framebuffer;
292};
293
294/* VESA Blanking Levels */
295#define VESA_NO_BLANKING 0
296#define VESA_VSYNC_SUSPEND 1
297#define VESA_HSYNC_SUSPEND 2
298#define VESA_POWERDOWN 3
299
300
301enum {
302 /* screen: unblanked, hsync: on, vsync: on */
303 FB_BLANK_UNBLANK = VESA_NO_BLANKING,
304
305 /* screen: blanked, hsync: on, vsync: on */
306 FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
307
308 /* screen: blanked, hsync: on, vsync: off */
309 FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
310
311 /* screen: blanked, hsync: off, vsync: on */
312 FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
313
314 /* screen: blanked, hsync: off, vsync: off */
315 FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
316};
317
318#define FB_VBLANK_VBLANKING 0x001 /* currently in a vertical blank */
319#define FB_VBLANK_HBLANKING 0x002 /* currently in a horizontal blank */
320#define FB_VBLANK_HAVE_VBLANK 0x004 /* vertical blanks can be detected */
321#define FB_VBLANK_HAVE_HBLANK 0x008 /* horizontal blanks can be detected */
322#define FB_VBLANK_HAVE_COUNT 0x010 /* global retrace counter is available */
323#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
324#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
325#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
326#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
327
328struct fb_vblank {
329 __u32 flags; /* FB_VBLANK flags */
330 __u32 count; /* counter of retraces since boot */
331 __u32 vcount; /* current scanline position */
332 __u32 hcount; /* current scandot position */
333 __u32 reserved[4]; /* reserved for future compatibility */
334};
335
336/* Internal HW accel */
337#define ROP_COPY 0
338#define ROP_XOR 1
339
340struct fb_copyarea {
341 __u32 dx;
342 __u32 dy;
343 __u32 width;
344 __u32 height;
345 __u32 sx;
346 __u32 sy;
347};
348
349struct fb_fillrect {
350 __u32 dx; /* screen-relative */
351 __u32 dy;
352 __u32 width;
353 __u32 height;
354 __u32 color;
355 __u32 rop;
356};
357
358struct fb_image {
359 __u32 dx; /* Where to place image */
360 __u32 dy;
361 __u32 width; /* Size of image */
362 __u32 height;
363 __u32 fg_color; /* Only used when a mono bitmap */
364 __u32 bg_color;
365 __u8 depth; /* Depth of the image */
366 const char *data; /* Pointer to image data */
367 struct fb_cmap cmap; /* color map info */
368};
369
370/*
371 * hardware cursor control
372 */
373
374#define FB_CUR_SETIMAGE 0x01
375#define FB_CUR_SETPOS 0x02
376#define FB_CUR_SETHOT 0x04
377#define FB_CUR_SETCMAP 0x08
378#define FB_CUR_SETSHAPE 0x10
379#define FB_CUR_SETSIZE 0x20
380#define FB_CUR_SETALL 0xFF
381
382struct fbcurpos {
383 __u16 x, y;
384};
385
386struct fb_cursor {
387 __u16 set; /* what to set */
388 __u16 enable; /* cursor on/off */
389 __u16 rop; /* bitop operation */
390 const char *mask; /* cursor mask bits */
391 struct fbcurpos hot; /* cursor hot spot */
392 struct fb_image image; /* Cursor image */
393};
394
395#ifdef CONFIG_FB_BACKLIGHT
396/* Settings for the generic backlight code */
397#define FB_BACKLIGHT_LEVELS 128
398#define FB_BACKLIGHT_MAX 0xFF
399#endif
400
401
402#endif /* _UAPI_LINUX_FB_H */
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
new file mode 100644
index 00000000000..074b886c6be
--- /dev/null
+++ b/include/uapi/linux/fcntl.h
@@ -0,0 +1,52 @@
1#ifndef _UAPI_LINUX_FCNTL_H
2#define _UAPI_LINUX_FCNTL_H
3
4#include <asm/fcntl.h>
5
6#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
7#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
8
9/*
10 * Cancel a blocking posix lock; internal use only until we expose an
11 * asynchronous lock api to userspace:
12 */
13#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
14
15/* Create a file descriptor with FD_CLOEXEC set. */
16#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
17
18/*
19 * Request nofications on a directory.
20 * See below for events that may be notified.
21 */
22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
23
24/*
25 * Set and get of pipe page size array
26 */
27#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
29
30/*
31 * Types of directory notifications that may be requested.
32 */
33#define DN_ACCESS 0x00000001 /* File accessed */
34#define DN_MODIFY 0x00000002 /* File modified */
35#define DN_CREATE 0x00000004 /* File created */
36#define DN_DELETE 0x00000008 /* File removed */
37#define DN_RENAME 0x00000010 /* File renamed */
38#define DN_ATTRIB 0x00000020 /* File changed attibutes */
39#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
40
41#define AT_FDCWD -100 /* Special value used to indicate
42 openat should use the current
43 working directory. */
44#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
45#define AT_REMOVEDIR 0x200 /* Remove directory instead of
46 unlinking file. */
47#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
48#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
49#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
50
51
52#endif /* _UAPI_LINUX_FCNTL_H */
diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h
new file mode 100644
index 00000000000..f1f3dd5981b
--- /dev/null
+++ b/include/uapi/linux/fd.h
@@ -0,0 +1,382 @@
1#ifndef _UAPI_LINUX_FD_H
2#define _UAPI_LINUX_FD_H
3
4#include <linux/ioctl.h>
5#include <linux/compiler.h>
6
7/* New file layout: Now the ioctl definitions immediately follow the
8 * definitions of the structures that they use */
9
10/*
11 * Geometry
12 */
13struct floppy_struct {
14 unsigned int size, /* nr of sectors total */
15 sect, /* sectors per track */
16 head, /* nr of heads */
17 track, /* nr of tracks */
18 stretch; /* bit 0 !=0 means double track steps */
19 /* bit 1 != 0 means swap sides */
20 /* bits 2..9 give the first sector */
21 /* number (the LSB is flipped) */
22#define FD_STRETCH 1
23#define FD_SWAPSIDES 2
24#define FD_ZEROBASED 4
25#define FD_SECTBASEMASK 0x3FC
26#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
27#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
28
29 unsigned char gap, /* gap1 size */
30
31 rate, /* data rate. |= 0x40 for perpendicular */
32#define FD_2M 0x4
33#define FD_SIZECODEMASK 0x38
34#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
35#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
36 512 : 128 << FD_SIZECODE(floppy) )
37#define FD_PERP 0x40
38
39 spec1, /* stepping rate, head unload time */
40 fmt_gap; /* gap2 size */
41 const char * name; /* used only for predefined formats */
42};
43
44
45/* commands needing write access have 0x40 set */
46/* commands needing super user access have 0x80 set */
47
48#define FDCLRPRM _IO(2, 0x41)
49/* clear user-defined parameters */
50
51#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
52#define FDSETMEDIAPRM FDSETPRM
53/* set user-defined parameters for current media */
54
55#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
56#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
57#define FDDEFMEDIAPRM FDDEFPRM
58#define FDGETMEDIAPRM FDGETPRM
59/* set/get disk parameters */
60
61
62#define FDMSGON _IO(2,0x45)
63#define FDMSGOFF _IO(2,0x46)
64/* issue/don't issue kernel messages on media type change */
65
66
67/*
68 * Formatting (obsolete)
69 */
70#define FD_FILL_BYTE 0xF6 /* format fill byte. */
71
72struct format_descr {
73 unsigned int device,head,track;
74};
75
76#define FDFMTBEG _IO(2,0x47)
77/* begin formatting a disk */
78#define FDFMTTRK _IOW(2,0x48, struct format_descr)
79/* format the specified track */
80#define FDFMTEND _IO(2,0x49)
81/* end formatting a disk */
82
83
84/*
85 * Error thresholds
86 */
87struct floppy_max_errors {
88 unsigned int
89 abort, /* number of errors to be reached before aborting */
90 read_track, /* maximal number of errors permitted to read an
91 * entire track at once */
92 reset, /* maximal number of errors before a reset is tried */
93 recal, /* maximal number of errors before a recalibrate is
94 * tried */
95
96 /*
97 * Threshold for reporting FDC errors to the console.
98 * Setting this to zero may flood your screen when using
99 * ultra cheap floppies ;-)
100 */
101 reporting;
102
103};
104
105#define FDSETEMSGTRESH _IO(2,0x4a)
106/* set fdc error reporting threshold */
107
108#define FDFLUSH _IO(2,0x4b)
109/* flush buffers for media; either for verifying media, or for
110 * handling a media change without closing the file descriptor */
111
112#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
113#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
114/* set/get abortion and read_track threshold. See also floppy_drive_params
115 * structure */
116
117
118typedef char floppy_drive_name[16];
119#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
120/* get drive type: 5 1/4 or 3 1/2 */
121
122
123/*
124 * Drive parameters (user modifiable)
125 */
126struct floppy_drive_params {
127 signed char cmos; /* CMOS type */
128
129 /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
130 * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
131 */
132 unsigned long max_dtr; /* Step rate, usec */
133 unsigned long hlt; /* Head load/settle time, msec */
134 unsigned long hut; /* Head unload time (remnant of
135 * 8" drives) */
136 unsigned long srt; /* Step rate, usec */
137
138 unsigned long spinup; /* time needed for spinup (expressed
139 * in jiffies) */
140 unsigned long spindown; /* timeout needed for spindown */
141 unsigned char spindown_offset; /* decides in which position the disk
142 * will stop */
143 unsigned char select_delay; /* delay to wait after select */
144 unsigned char rps; /* rotations per second */
145 unsigned char tracks; /* maximum number of tracks */
146 unsigned long timeout; /* timeout for interrupt requests */
147
148 unsigned char interleave_sect; /* if there are more sectors, use
149 * interleave */
150
151 struct floppy_max_errors max_errors;
152
153 char flags; /* various flags, including ftd_msg */
154/*
155 * Announce successful media type detection and media information loss after
156 * disk changes.
157 * Also used to enable/disable printing of overrun warnings.
158 */
159
160#define FTD_MSG 0x10
161#define FD_BROKEN_DCL 0x20
162#define FD_DEBUG 0x02
163#define FD_SILENT_DCL_CLEAR 0x4
164#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
165 considerations */
166
167 char read_track; /* use readtrack during probing? */
168
169/*
170 * Auto-detection. Each drive type has eight formats which are
171 * used in succession to try to read the disk. If the FDC cannot lock onto
172 * the disk, the next format is tried. This uses the variable 'probing'.
173 */
174 short autodetect[8]; /* autodetected formats */
175
176 int checkfreq; /* how often should the drive be checked for disk
177 * changes */
178 int native_format; /* native format of this drive */
179};
180
181enum {
182 FD_NEED_TWADDLE_BIT, /* more magic */
183 FD_VERIFY_BIT, /* inquire for write protection */
184 FD_DISK_NEWCHANGE_BIT, /* change detected, and no action undertaken yet
185 * to clear media change status */
186 FD_UNUSED_BIT,
187 FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
188 FD_DISK_WRITABLE_BIT /* disk is writable */
189};
190
191#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
192#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
193/* set/get drive parameters */
194
195
196/*
197 * Current drive state (not directly modifiable by user, readonly)
198 */
199struct floppy_drive_struct {
200 unsigned long flags;
201/* values for these flags */
202#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
203#define FD_VERIFY (1 << FD_VERIFY_BIT)
204#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
205#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
206#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
207
208 unsigned long spinup_date;
209 unsigned long select_date;
210 unsigned long first_read_date;
211 short probed_format;
212 short track; /* current track */
213 short maxblock; /* id of highest block read */
214 short maxtrack; /* id of highest half track read */
215 int generation; /* how many diskchanges? */
216
217/*
218 * (User-provided) media information is _not_ discarded after a media change
219 * if the corresponding keep_data flag is non-zero. Positive values are
220 * decremented after each probe.
221 */
222 int keep_data;
223
224 /* Prevent "aliased" accesses. */
225 int fd_ref;
226 int fd_device;
227 unsigned long last_checked; /* when was the drive last checked for a disk
228 * change? */
229
230 char *dmabuf;
231 int bufblocks;
232};
233
234#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
235#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
236/* get drive state: GET returns the cached state, POLL polls for new state */
237
238
239/*
240 * reset FDC
241 */
242enum reset_mode {
243 FD_RESET_IF_NEEDED, /* reset only if the reset flags is set */
244 FD_RESET_IF_RAWCMD, /* obsolete */
245 FD_RESET_ALWAYS /* reset always */
246};
247#define FDRESET _IO(2, 0x54)
248
249
250/*
251 * FDC state
252 */
253struct floppy_fdc_state {
254 int spec1; /* spec1 value last used */
255 int spec2; /* spec2 value last used */
256 int dtr;
257 unsigned char version; /* FDC version code */
258 unsigned char dor;
259 unsigned long address; /* io address */
260 unsigned int rawcmd:2;
261 unsigned int reset:1;
262 unsigned int need_configure:1;
263 unsigned int perp_mode:2;
264 unsigned int has_fifo:1;
265 unsigned int driver_version; /* version code for floppy driver */
266#define FD_DRIVER_VERSION 0x100
267/* user programs using the floppy API should use floppy_fdc_state to
268 * get the version number of the floppy driver that they are running
269 * on. If this version number is bigger than the one compiled into the
270 * user program (the FD_DRIVER_VERSION define), it should be prepared
271 * to bigger structures
272 */
273
274 unsigned char track[4];
275 /* Position of the heads of the 4 units attached to this FDC,
276 * as stored on the FDC. In the future, the position as stored
277 * on the FDC might not agree with the actual physical
278 * position of these drive heads. By allowing such
279 * disagreement, it will be possible to reset the FDC without
280 * incurring the expensive cost of repositioning all heads.
281 * Right now, these positions are hard wired to 0. */
282
283};
284
285#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
286
287
288/*
289 * Asynchronous Write error tracking
290 */
291struct floppy_write_errors {
292 /* Write error logging.
293 *
294 * These fields can be cleared with the FDWERRORCLR ioctl.
295 * Only writes that were attempted but failed due to a physical media
296 * error are logged. write(2) calls that fail and return an error code
297 * to the user process are not counted.
298 */
299
300 unsigned int write_errors; /* number of physical write errors
301 * encountered */
302
303 /* position of first and last write errors */
304 unsigned long first_error_sector;
305 int first_error_generation;
306 unsigned long last_error_sector;
307 int last_error_generation;
308
309 unsigned int badness; /* highest retry count for a read or write
310 * operation */
311};
312
313#define FDWERRORCLR _IO(2, 0x56)
314/* clear write error and badness information */
315#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
316/* get write error and badness information */
317
318
319/*
320 * Raw commands
321 */
322/* new interface flag: now we can do them in batches */
323#define FDHAVEBATCHEDRAWCMD
324
325struct floppy_raw_cmd {
326 unsigned int flags;
327#define FD_RAW_READ 1
328#define FD_RAW_WRITE 2
329#define FD_RAW_NO_MOTOR 4
330#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
331#define FD_RAW_INTR 8 /* wait for an interrupt */
332#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
333#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
334 * completion */
335#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
336#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
337
338/* more "in" flags */
339#define FD_RAW_MORE 0x100 /* more records follow */
340#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
341#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
342#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
343 * detection too */
344
345/* more "out" flags */
346#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
347#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
348
349 void __user *data;
350 char *kernel_data; /* location of data buffer in the kernel */
351 struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
352 * within the kernel */
353 long length; /* in: length of dma transfer. out: remaining bytes */
354 long phys_length; /* physical length, if different from dma length */
355 int buffer_length; /* length of allocated buffer */
356
357 unsigned char rate;
358 unsigned char cmd_count;
359 unsigned char cmd[16];
360 unsigned char reply_count;
361 unsigned char reply[16];
362 int track;
363 int resultcode;
364
365 int reserved1;
366 int reserved2;
367};
368
369#define FDRAWCMD _IO(2, 0x58)
370/* send a raw command to the fdc. Structure size not included, because of
371 * batches */
372
373#define FDTWADDLE _IO(2, 0x59)
374/* flicker motor-on bit before reading a sector. Experimental */
375
376
377#define FDEJECT _IO(2, 0x5a)
378/* eject the disk */
379
380
381
382#endif /* _UAPI_LINUX_FD_H */
diff --git a/include/linux/fdreg.h b/include/uapi/linux/fdreg.h
index 61ce6416900..61ce6416900 100644
--- a/include/linux/fdreg.h
+++ b/include/uapi/linux/fdreg.h
diff --git a/include/linux/fib_rules.h b/include/uapi/linux/fib_rules.h
index 51da65b68b8..51da65b68b8 100644
--- a/include/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
diff --git a/include/linux/fiemap.h b/include/uapi/linux/fiemap.h
index d830747f5c0..d830747f5c0 100644
--- a/include/linux/fiemap.h
+++ b/include/uapi/linux/fiemap.h
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
new file mode 100644
index 00000000000..3d7922433ab
--- /dev/null
+++ b/include/uapi/linux/filter.h
@@ -0,0 +1,135 @@
1/*
2 * Linux Socket Filter Data Structures
3 */
4
5#ifndef _UAPI__LINUX_FILTER_H__
6#define _UAPI__LINUX_FILTER_H__
7
8#include <linux/compiler.h>
9#include <linux/types.h>
10
11
12/*
13 * Current version of the filter code architecture.
14 */
15#define BPF_MAJOR_VERSION 1
16#define BPF_MINOR_VERSION 1
17
18/*
19 * Try and keep these values and structures similar to BSD, especially
20 * the BPF code definitions which need to match so you can share filters
21 */
22
23struct sock_filter { /* Filter block */
24 __u16 code; /* Actual filter code */
25 __u8 jt; /* Jump true */
26 __u8 jf; /* Jump false */
27 __u32 k; /* Generic multiuse field */
28};
29
30struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
31 unsigned short len; /* Number of filter blocks */
32 struct sock_filter __user *filter;
33};
34
35/*
36 * Instruction classes
37 */
38
39#define BPF_CLASS(code) ((code) & 0x07)
40#define BPF_LD 0x00
41#define BPF_LDX 0x01
42#define BPF_ST 0x02
43#define BPF_STX 0x03
44#define BPF_ALU 0x04
45#define BPF_JMP 0x05
46#define BPF_RET 0x06
47#define BPF_MISC 0x07
48
49/* ld/ldx fields */
50#define BPF_SIZE(code) ((code) & 0x18)
51#define BPF_W 0x00
52#define BPF_H 0x08
53#define BPF_B 0x10
54#define BPF_MODE(code) ((code) & 0xe0)
55#define BPF_IMM 0x00
56#define BPF_ABS 0x20
57#define BPF_IND 0x40
58#define BPF_MEM 0x60
59#define BPF_LEN 0x80
60#define BPF_MSH 0xa0
61
62/* alu/jmp fields */
63#define BPF_OP(code) ((code) & 0xf0)
64#define BPF_ADD 0x00
65#define BPF_SUB 0x10
66#define BPF_MUL 0x20
67#define BPF_DIV 0x30
68#define BPF_OR 0x40
69#define BPF_AND 0x50
70#define BPF_LSH 0x60
71#define BPF_RSH 0x70
72#define BPF_NEG 0x80
73#define BPF_MOD 0x90
74#define BPF_XOR 0xa0
75
76#define BPF_JA 0x00
77#define BPF_JEQ 0x10
78#define BPF_JGT 0x20
79#define BPF_JGE 0x30
80#define BPF_JSET 0x40
81#define BPF_SRC(code) ((code) & 0x08)
82#define BPF_K 0x00
83#define BPF_X 0x08
84
85/* ret - BPF_K and BPF_X also apply */
86#define BPF_RVAL(code) ((code) & 0x18)
87#define BPF_A 0x10
88
89/* misc */
90#define BPF_MISCOP(code) ((code) & 0xf8)
91#define BPF_TAX 0x00
92#define BPF_TXA 0x80
93
94#ifndef BPF_MAXINSNS
95#define BPF_MAXINSNS 4096
96#endif
97
98/*
99 * Macros for filter block array initializers.
100 */
101#ifndef BPF_STMT
102#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
103#endif
104#ifndef BPF_JUMP
105#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
106#endif
107
108/*
109 * Number of scratch memory words for: BPF_ST and BPF_STX
110 */
111#define BPF_MEMWORDS 16
112
113/* RATIONALE. Negative offsets are invalid in BPF.
114 We use them to reference ancillary data.
115 Unlike introduction new instructions, it does not break
116 existing compilers/optimizers.
117 */
118#define SKF_AD_OFF (-0x1000)
119#define SKF_AD_PROTOCOL 0
120#define SKF_AD_PKTTYPE 4
121#define SKF_AD_IFINDEX 8
122#define SKF_AD_NLATTR 12
123#define SKF_AD_NLATTR_NEST 16
124#define SKF_AD_MARK 20
125#define SKF_AD_QUEUE 24
126#define SKF_AD_HATYPE 28
127#define SKF_AD_RXHASH 32
128#define SKF_AD_CPU 36
129#define SKF_AD_ALU_XOR_X 40
130#define SKF_AD_MAX 44
131#define SKF_NET_OFF (-0x100000)
132#define SKF_LL_OFF (-0x200000)
133
134
135#endif /* _UAPI__LINUX_FILTER_H__ */
diff --git a/include/linux/firewire-cdev.h b/include/uapi/linux/firewire-cdev.h
index d5003695349..d5003695349 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/uapi/linux/firewire-cdev.h
diff --git a/include/linux/firewire-constants.h b/include/uapi/linux/firewire-constants.h
index 9b4bb5fbba4..9b4bb5fbba4 100644
--- a/include/linux/firewire-constants.h
+++ b/include/uapi/linux/firewire-constants.h
diff --git a/include/uapi/linux/flat.h b/include/uapi/linux/flat.h
new file mode 100644
index 00000000000..88cd6baba8f
--- /dev/null
+++ b/include/uapi/linux/flat.h
@@ -0,0 +1,58 @@
1/*
2 * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
3 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
4 * The Silver Hammer Group, Ltd.
5 *
6 * This file provides the definitions and structures needed to
7 * support uClinux flat-format executables.
8 */
9
10#ifndef _UAPI_LINUX_FLAT_H
11#define _UAPI_LINUX_FLAT_H
12
13
14#define FLAT_VERSION 0x00000004L
15
16#ifdef CONFIG_BINFMT_SHARED_FLAT
17#define MAX_SHARED_LIBS (4)
18#else
19#define MAX_SHARED_LIBS (1)
20#endif
21
22/*
23 * To make everything easier to port and manage cross platform
24 * development, all fields are in network byte order.
25 */
26
27struct flat_hdr {
28 char magic[4];
29 unsigned long rev; /* version (as above) */
30 unsigned long entry; /* Offset of first executable instruction
31 with text segment from beginning of file */
32 unsigned long data_start; /* Offset of data segment from beginning of
33 file */
34 unsigned long data_end; /* Offset of end of data segment
35 from beginning of file */
36 unsigned long bss_end; /* Offset of end of bss segment from beginning
37 of file */
38
39 /* (It is assumed that data_end through bss_end forms the bss segment.) */
40
41 unsigned long stack_size; /* Size of stack, in bytes */
42 unsigned long reloc_start; /* Offset of relocation records from
43 beginning of file */
44 unsigned long reloc_count; /* Number of relocation records */
45 unsigned long flags;
46 unsigned long build_date; /* When the program/library was built */
47 unsigned long filler[5]; /* Reservered, set to zero */
48};
49
50#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
51#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
52#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
53#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
54#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
55
56
57
58#endif /* _UAPI_LINUX_FLAT_H */
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
new file mode 100644
index 00000000000..9fcc880d4be
--- /dev/null
+++ b/include/uapi/linux/fs.h
@@ -0,0 +1,334 @@
1#ifndef _UAPI_LINUX_FS_H
2#define _UAPI_LINUX_FS_H
3
4/*
5 * This file has definitions for some important file table
6 * structures etc.
7 */
8
9#include <linux/limits.h>
10#include <linux/ioctl.h>
11#include <linux/types.h>
12
13/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
15 * the file limit at runtime and only root can increase the per-process
16 * nr_file rlimit, so it's safe to set up a ridiculously high absolute
17 * upper limit on files-per-process.
18 *
19 * Some programs (notably those using select()) may have to be
20 * recompiled to take full advantage of the new limits..
21 */
22
23/* Fixed constants first: */
24#undef NR_OPEN
25#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */
26#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
27
28#define BLOCK_SIZE_BITS 10
29#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
30
31#define SEEK_SET 0 /* seek relative to beginning of file */
32#define SEEK_CUR 1 /* seek relative to current file position */
33#define SEEK_END 2 /* seek relative to end of file */
34#define SEEK_DATA 3 /* seek to the next data */
35#define SEEK_HOLE 4 /* seek to the next hole */
36#define SEEK_MAX SEEK_HOLE
37
38struct fstrim_range {
39 __u64 start;
40 __u64 len;
41 __u64 minlen;
42};
43
44/* And dynamically-tunable limits and defaults: */
45struct files_stat_struct {
46 unsigned long nr_files; /* read only */
47 unsigned long nr_free_files; /* read only */
48 unsigned long max_files; /* tunable */
49};
50
51struct inodes_stat_t {
52 int nr_inodes;
53 int nr_unused;
54 int dummy[5]; /* padding for sysctl ABI compatibility */
55};
56
57
58#define NR_FILE 8192 /* this can well be larger on a larger system */
59
60#define MAY_EXEC 0x00000001
61#define MAY_WRITE 0x00000002
62#define MAY_READ 0x00000004
63#define MAY_APPEND 0x00000008
64#define MAY_ACCESS 0x00000010
65#define MAY_OPEN 0x00000020
66#define MAY_CHDIR 0x00000040
67/* called from RCU mode, don't block */
68#define MAY_NOT_BLOCK 0x00000080
69
70/*
71 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
72 * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
73 */
74
75/* file is open for reading */
76#define FMODE_READ ((__force fmode_t)0x1)
77/* file is open for writing */
78#define FMODE_WRITE ((__force fmode_t)0x2)
79/* file is seekable */
80#define FMODE_LSEEK ((__force fmode_t)0x4)
81/* file can be accessed using pread */
82#define FMODE_PREAD ((__force fmode_t)0x8)
83/* file can be accessed using pwrite */
84#define FMODE_PWRITE ((__force fmode_t)0x10)
85/* File is opened for execution with sys_execve / sys_uselib */
86#define FMODE_EXEC ((__force fmode_t)0x20)
87/* File is opened with O_NDELAY (only set for block devices) */
88#define FMODE_NDELAY ((__force fmode_t)0x40)
89/* File is opened with O_EXCL (only set for block devices) */
90#define FMODE_EXCL ((__force fmode_t)0x80)
91/* File is opened using open(.., 3, ..) and is writeable only for ioctls
92 (specialy hack for floppy.c) */
93#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
94/* 32bit hashes as llseek() offset (for directories) */
95#define FMODE_32BITHASH ((__force fmode_t)0x200)
96/* 64bit hashes as llseek() offset (for directories) */
97#define FMODE_64BITHASH ((__force fmode_t)0x400)
98
99/*
100 * Don't update ctime and mtime.
101 *
102 * Currently a special hack for the XFS open_by_handle ioctl, but we'll
103 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
104 */
105#define FMODE_NOCMTIME ((__force fmode_t)0x800)
106
107/* Expect random access pattern */
108#define FMODE_RANDOM ((__force fmode_t)0x1000)
109
110/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
111#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
112
113/* File is opened with O_PATH; almost nothing can be done with it */
114#define FMODE_PATH ((__force fmode_t)0x4000)
115
116/* File was opened by fanotify and shouldn't generate fanotify events */
117#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
118
119/*
120 * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
121 * that indicates that they should check the contents of the iovec are
122 * valid, but not check the memory that the iovec elements
123 * points too.
124 */
125#define CHECK_IOVEC_ONLY -1
126
127#define SEL_IN 1
128#define SEL_OUT 2
129#define SEL_EX 4
130
131/* public flags for file_system_type */
132#define FS_REQUIRES_DEV 1
133#define FS_BINARY_MOUNTDATA 2
134#define FS_HAS_SUBTYPE 4
135#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
136#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
137 * during rename() internally.
138 */
139
140/*
141 * These are the fs-independent mount-flags: up to 32 flags are supported
142 */
143#define MS_RDONLY 1 /* Mount read-only */
144#define MS_NOSUID 2 /* Ignore suid and sgid bits */
145#define MS_NODEV 4 /* Disallow access to device special files */
146#define MS_NOEXEC 8 /* Disallow program execution */
147#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
148#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
149#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
150#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
151#define MS_NOATIME 1024 /* Do not update access times. */
152#define MS_NODIRATIME 2048 /* Do not update directory access times */
153#define MS_BIND 4096
154#define MS_MOVE 8192
155#define MS_REC 16384
156#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
157 MS_VERBOSE is deprecated. */
158#define MS_SILENT 32768
159#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
160#define MS_UNBINDABLE (1<<17) /* change to unbindable */
161#define MS_PRIVATE (1<<18) /* change to private */
162#define MS_SLAVE (1<<19) /* change to slave */
163#define MS_SHARED (1<<20) /* change to shared */
164#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
165#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
166#define MS_I_VERSION (1<<23) /* Update inode I_version field */
167#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
168#define MS_NOSEC (1<<28)
169#define MS_BORN (1<<29)
170#define MS_ACTIVE (1<<30)
171#define MS_NOUSER (1<<31)
172
173/*
174 * Superblock flags that can be altered by MS_REMOUNT
175 */
176#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
177
178/*
179 * Old magic mount flag and mask
180 */
181#define MS_MGC_VAL 0xC0ED0000
182#define MS_MGC_MSK 0xffff0000
183
184/* Inode flags - they have nothing to superblock flags now */
185
186#define S_SYNC 1 /* Writes are synced at once */
187#define S_NOATIME 2 /* Do not update access times */
188#define S_APPEND 4 /* Append-only file */
189#define S_IMMUTABLE 8 /* Immutable file */
190#define S_DEAD 16 /* removed, but still open directory */
191#define S_NOQUOTA 32 /* Inode is not counted to quota */
192#define S_DIRSYNC 64 /* Directory modifications are synchronous */
193#define S_NOCMTIME 128 /* Do not update file c/mtime */
194#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
195#define S_PRIVATE 512 /* Inode is fs-internal */
196#define S_IMA 1024 /* Inode has an associated IMA struct */
197#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */
198#define S_NOSEC 4096 /* no suid or xattr security attributes */
199
200/*
201 * Note that nosuid etc flags are inode-specific: setting some file-system
202 * flags just means all the inodes inherit those flags by default. It might be
203 * possible to override it selectively if you really wanted to with some
204 * ioctl() that is not currently implemented.
205 *
206 * Exception: MS_RDONLY is always applied to the entire file system.
207 *
208 * Unfortunately, it is possible to change a filesystems flags with it mounted
209 * with files in use. This means that all of the inodes will not have their
210 * i_flags updated. Hence, i_flags no longer inherit the superblock mount
211 * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
212 */
213#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
214
215#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
216#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
217 ((inode)->i_flags & S_SYNC))
218#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
219 ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
220#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
221#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
222#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION)
223
224#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
225#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
226#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
227#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
228
229#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
230#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
231#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
232#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
233#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
234#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)
235#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
236
237/* the read-only stuff doesn't really belong here, but any other place is
238 probably as bad and I don't want to create yet another include file. */
239
240#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
241#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
242#define BLKRRPART _IO(0x12,95) /* re-read partition table */
243#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
244#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
245#define BLKRASET _IO(0x12,98) /* set read ahead for block device */
246#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
247#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
248#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
249#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
250#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
251#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
252#if 0
253#define BLKPG _IO(0x12,105)/* See blkpg.h */
254
255/* Some people are morons. Do not use sizeof! */
256
257#define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */
258#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */
259/* This was here just to show that the number is taken -
260 probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
261#endif
262/* A jump here: 108-111 have been used for various private purposes. */
263#define BLKBSZGET _IOR(0x12,112,size_t)
264#define BLKBSZSET _IOW(0x12,113,size_t)
265#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
266#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
267#define BLKTRACESTART _IO(0x12,116)
268#define BLKTRACESTOP _IO(0x12,117)
269#define BLKTRACETEARDOWN _IO(0x12,118)
270#define BLKDISCARD _IO(0x12,119)
271#define BLKIOMIN _IO(0x12,120)
272#define BLKIOOPT _IO(0x12,121)
273#define BLKALIGNOFF _IO(0x12,122)
274#define BLKPBSZGET _IO(0x12,123)
275#define BLKDISCARDZEROES _IO(0x12,124)
276#define BLKSECDISCARD _IO(0x12,125)
277#define BLKROTATIONAL _IO(0x12,126)
278#define BLKZEROOUT _IO(0x12,127)
279
280#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
281#define FIBMAP _IO(0x00,1) /* bmap access */
282#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
283#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
284#define FITHAW _IOWR('X', 120, int) /* Thaw */
285#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
286
287#define FS_IOC_GETFLAGS _IOR('f', 1, long)
288#define FS_IOC_SETFLAGS _IOW('f', 2, long)
289#define FS_IOC_GETVERSION _IOR('v', 1, long)
290#define FS_IOC_SETVERSION _IOW('v', 2, long)
291#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
292#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
293#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
294#define FS_IOC32_GETVERSION _IOR('v', 1, int)
295#define FS_IOC32_SETVERSION _IOW('v', 2, int)
296
297/*
298 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
299 */
300#define FS_SECRM_FL 0x00000001 /* Secure deletion */
301#define FS_UNRM_FL 0x00000002 /* Undelete */
302#define FS_COMPR_FL 0x00000004 /* Compress file */
303#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
304#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
305#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
306#define FS_NODUMP_FL 0x00000040 /* do not dump file */
307#define FS_NOATIME_FL 0x00000080 /* do not update atime */
308/* Reserved for compression usage... */
309#define FS_DIRTY_FL 0x00000100
310#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
311#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
312#define FS_ECOMPR_FL 0x00000800 /* Compression error */
313/* End compression flags --- maybe not all used */
314#define FS_BTREE_FL 0x00001000 /* btree format dir */
315#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
316#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
317#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
318#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
319#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
320#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
321#define FS_EXTENT_FL 0x00080000 /* Extents */
322#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */
323#define FS_NOCOW_FL 0x00800000 /* Do not cow file */
324#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
325
326#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
327#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
328
329
330#define SYNC_FILE_RANGE_WAIT_BEFORE 1
331#define SYNC_FILE_RANGE_WRITE 2
332#define SYNC_FILE_RANGE_WAIT_AFTER 4
333
334#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
index 00000000000..1bf04967fec
--- /dev/null
+++ b/include/uapi/linux/fsl_hypervisor.h
@@ -0,0 +1,220 @@
1/*
2 * Freescale hypervisor ioctl and kernel interface
3 *
4 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
5 * Author: Timur Tabi <timur@freescale.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of Freescale Semiconductor nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 *
19 * ALTERNATIVELY, this software may be distributed under the terms of the
20 * GNU General Public License ("GPL") as published by the Free Software
21 * Foundation, either version 2 of that License or (at your option) any
22 * later version.
23 *
24 * This software is provided by Freescale Semiconductor "as is" and any
25 * express or implied warranties, including, but not limited to, the implied
26 * warranties of merchantability and fitness for a particular purpose are
27 * disclaimed. In no event shall Freescale Semiconductor be liable for any
28 * direct, indirect, incidental, special, exemplary, or consequential damages
29 * (including, but not limited to, procurement of substitute goods or services;
30 * loss of use, data, or profits; or business interruption) however caused and
31 * on any theory of liability, whether in contract, strict liability, or tort
32 * (including negligence or otherwise) arising in any way out of the use of this
33 * software, even if advised of the possibility of such damage.
34 *
35 * This file is used by the Freescale hypervisor management driver. It can
36 * also be included by applications that need to communicate with the driver
37 * via the ioctl interface.
38 */
39
40#ifndef _UAPIFSL_HYPERVISOR_H
41#define _UAPIFSL_HYPERVISOR_H
42
43#include <linux/types.h>
44
45/**
46 * struct fsl_hv_ioctl_restart - restart a partition
47 * @ret: return error code from the hypervisor
48 * @partition: the ID of the partition to restart, or -1 for the
49 * calling partition
50 *
51 * Used by FSL_HV_IOCTL_PARTITION_RESTART
52 */
53struct fsl_hv_ioctl_restart {
54 __u32 ret;
55 __u32 partition;
56};
57
58/**
59 * struct fsl_hv_ioctl_status - get a partition's status
60 * @ret: return error code from the hypervisor
61 * @partition: the ID of the partition to query, or -1 for the
62 * calling partition
63 * @status: The returned status of the partition
64 *
65 * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
66 *
67 * Values of 'status':
68 * 0 = Stopped
69 * 1 = Running
70 * 2 = Starting
71 * 3 = Stopping
72 */
73struct fsl_hv_ioctl_status {
74 __u32 ret;
75 __u32 partition;
76 __u32 status;
77};
78
79/**
80 * struct fsl_hv_ioctl_start - start a partition
81 * @ret: return error code from the hypervisor
82 * @partition: the ID of the partition to control
83 * @entry_point: The offset within the guest IMA to start execution
84 * @load: If non-zero, reload the partition's images before starting
85 *
86 * Used by FSL_HV_IOCTL_PARTITION_START
87 */
88struct fsl_hv_ioctl_start {
89 __u32 ret;
90 __u32 partition;
91 __u32 entry_point;
92 __u32 load;
93};
94
95/**
96 * struct fsl_hv_ioctl_stop - stop a partition
97 * @ret: return error code from the hypervisor
98 * @partition: the ID of the partition to stop, or -1 for the calling
99 * partition
100 *
101 * Used by FSL_HV_IOCTL_PARTITION_STOP
102 */
103struct fsl_hv_ioctl_stop {
104 __u32 ret;
105 __u32 partition;
106};
107
108/**
109 * struct fsl_hv_ioctl_memcpy - copy memory between partitions
110 * @ret: return error code from the hypervisor
111 * @source: the partition ID of the source partition, or -1 for this
112 * partition
113 * @target: the partition ID of the target partition, or -1 for this
114 * partition
115 * @reserved: reserved, must be set to 0
116 * @local_addr: user-space virtual address of a buffer in the local
117 * partition
118 * @remote_addr: guest physical address of a buffer in the
119 * remote partition
120 * @count: the number of bytes to copy. Both the local and remote
121 * buffers must be at least 'count' bytes long
122 *
123 * Used by FSL_HV_IOCTL_MEMCPY
124 *
125 * The 'local' partition is the partition that calls this ioctl. The
126 * 'remote' partition is a different partition. The data is copied from
127 * the 'source' paritition' to the 'target' partition.
128 *
129 * The buffer in the remote partition must be guest physically
130 * contiguous.
131 *
132 * This ioctl does not support copying memory between two remote
133 * partitions or within the same partition, so either 'source' or
134 * 'target' (but not both) must be -1. In other words, either
135 *
136 * source == local and target == remote
137 * or
138 * source == remote and target == local
139 */
140struct fsl_hv_ioctl_memcpy {
141 __u32 ret;
142 __u32 source;
143 __u32 target;
144 __u32 reserved; /* padding to ensure local_vaddr is aligned */
145 __u64 local_vaddr;
146 __u64 remote_paddr;
147 __u64 count;
148};
149
150/**
151 * struct fsl_hv_ioctl_doorbell - ring a doorbell
152 * @ret: return error code from the hypervisor
153 * @doorbell: the handle of the doorbell to ring doorbell
154 *
155 * Used by FSL_HV_IOCTL_DOORBELL
156 */
157struct fsl_hv_ioctl_doorbell {
158 __u32 ret;
159 __u32 doorbell;
160};
161
162/**
163 * struct fsl_hv_ioctl_prop - get/set a device tree property
164 * @ret: return error code from the hypervisor
165 * @handle: handle of partition whose tree to access
166 * @path: virtual address of path name of node to access
167 * @propname: virtual address of name of property to access
168 * @propval: virtual address of property data buffer
169 * @proplen: Size of property data buffer
170 * @reserved: reserved, must be set to 0
171 *
172 * Used by FSL_HV_IOCTL_DOORBELL
173 */
174struct fsl_hv_ioctl_prop {
175 __u32 ret;
176 __u32 handle;
177 __u64 path;
178 __u64 propname;
179 __u64 propval;
180 __u32 proplen;
181 __u32 reserved; /* padding to ensure structure is aligned */
182};
183
184/* The ioctl type, documented in ioctl-number.txt */
185#define FSL_HV_IOCTL_TYPE 0xAF
186
187/* Restart another partition */
188#define FSL_HV_IOCTL_PARTITION_RESTART \
189 _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
190
191/* Get a partition's status */
192#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
193 _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
194
195/* Boot another partition */
196#define FSL_HV_IOCTL_PARTITION_START \
197 _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
198
199/* Stop this or another partition */
200#define FSL_HV_IOCTL_PARTITION_STOP \
201 _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
202
203/* Copy data from one partition to another */
204#define FSL_HV_IOCTL_MEMCPY \
205 _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
206
207/* Ring a doorbell */
208#define FSL_HV_IOCTL_DOORBELL \
209 _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
210
211/* Get a property from another guest's device tree */
212#define FSL_HV_IOCTL_GETPROP \
213 _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
214
215/* Set a property in another guest's device tree */
216#define FSL_HV_IOCTL_SETPROP \
217 _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
218
219
220#endif /* _UAPIFSL_HYPERVISOR_H */
diff --git a/include/linux/fuse.h b/include/uapi/linux/fuse.h
index d8c713e148e..d8c713e148e 100644
--- a/include/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h
new file mode 100644
index 00000000000..0b1f716373c
--- /dev/null
+++ b/include/uapi/linux/futex.h
@@ -0,0 +1,152 @@
1#ifndef _UAPI_LINUX_FUTEX_H
2#define _UAPI_LINUX_FUTEX_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6
7/* Second argument to futex syscall */
8
9
10#define FUTEX_WAIT 0
11#define FUTEX_WAKE 1
12#define FUTEX_FD 2
13#define FUTEX_REQUEUE 3
14#define FUTEX_CMP_REQUEUE 4
15#define FUTEX_WAKE_OP 5
16#define FUTEX_LOCK_PI 6
17#define FUTEX_UNLOCK_PI 7
18#define FUTEX_TRYLOCK_PI 8
19#define FUTEX_WAIT_BITSET 9
20#define FUTEX_WAKE_BITSET 10
21#define FUTEX_WAIT_REQUEUE_PI 11
22#define FUTEX_CMP_REQUEUE_PI 12
23
24#define FUTEX_PRIVATE_FLAG 128
25#define FUTEX_CLOCK_REALTIME 256
26#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
27
28#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
29#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
30#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
31#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
32#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
33#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
34#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
35#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
36#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
37#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
38#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
39 FUTEX_PRIVATE_FLAG)
40#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
41 FUTEX_PRIVATE_FLAG)
42
43/*
44 * Support for robust futexes: the kernel cleans up held futexes at
45 * thread exit time.
46 */
47
48/*
49 * Per-lock list entry - embedded in user-space locks, somewhere close
50 * to the futex field. (Note: user-space uses a double-linked list to
51 * achieve O(1) list add and remove, but the kernel only needs to know
52 * about the forward link)
53 *
54 * NOTE: this structure is part of the syscall ABI, and must not be
55 * changed.
56 */
57struct robust_list {
58 struct robust_list __user *next;
59};
60
61/*
62 * Per-thread list head:
63 *
64 * NOTE: this structure is part of the syscall ABI, and must only be
65 * changed if the change is first communicated with the glibc folks.
66 * (When an incompatible change is done, we'll increase the structure
67 * size, which glibc will detect)
68 */
69struct robust_list_head {
70 /*
71 * The head of the list. Points back to itself if empty:
72 */
73 struct robust_list list;
74
75 /*
76 * This relative offset is set by user-space, it gives the kernel
77 * the relative position of the futex field to examine. This way
78 * we keep userspace flexible, to freely shape its data-structure,
79 * without hardcoding any particular offset into the kernel:
80 */
81 long futex_offset;
82
83 /*
84 * The death of the thread may race with userspace setting
85 * up a lock's links. So to handle this race, userspace first
86 * sets this field to the address of the to-be-taken lock,
87 * then does the lock acquire, and then adds itself to the
88 * list, and then clears this field. Hence the kernel will
89 * always have full knowledge of all locks that the thread
90 * _might_ have taken. We check the owner TID in any case,
91 * so only truly owned locks will be handled.
92 */
93 struct robust_list __user *list_op_pending;
94};
95
96/*
97 * Are there any waiters for this robust futex:
98 */
99#define FUTEX_WAITERS 0x80000000
100
101/*
102 * The kernel signals via this bit that a thread holding a futex
103 * has exited without unlocking the futex. The kernel also does
104 * a FUTEX_WAKE on such futexes, after setting the bit, to wake
105 * up any possible waiters:
106 */
107#define FUTEX_OWNER_DIED 0x40000000
108
109/*
110 * The rest of the robust-futex field is for the TID:
111 */
112#define FUTEX_TID_MASK 0x3fffffff
113
114/*
115 * This limit protects against a deliberately circular list.
116 * (Not worth introducing an rlimit for it)
117 */
118#define ROBUST_LIST_LIMIT 2048
119
120/*
121 * bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
122 * match of any bit.
123 */
124#define FUTEX_BITSET_MATCH_ANY 0xffffffff
125
126
127#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
128#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
129#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
130#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
131#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
132
133#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
134
135#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
136#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
137#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
138#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
139#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
140#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
141
142/* FUTEX_WAKE_OP will perform atomically
143 int oldval = *(int *)UADDR2;
144 *(int *)UADDR2 = oldval OP OPARG;
145 if (oldval CMP CMPARG)
146 wake UADDR2; */
147
148#define FUTEX_OP(op, oparg, cmp, cmparg) \
149 (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
150 | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
151
152#endif /* _UAPI_LINUX_FUTEX_H */
diff --git a/include/uapi/linux/gameport.h b/include/uapi/linux/gameport.h
new file mode 100644
index 00000000000..49b29b068f4
--- /dev/null
+++ b/include/uapi/linux/gameport.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (c) 1999-2002 Vojtech Pavlik
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published by
6 * the Free Software Foundation.
7 */
8#ifndef _UAPI_GAMEPORT_H
9#define _UAPI_GAMEPORT_H
10
11
12
13#define GAMEPORT_MODE_DISABLED 0
14#define GAMEPORT_MODE_RAW 1
15#define GAMEPORT_MODE_COOKED 2
16
17#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
18#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
19#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
20#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004
21#define GAMEPORT_ID_VENDOR_GENIUS 0x0005
22#define GAMEPORT_ID_VENDOR_INTERACT 0x0006
23#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007
24#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008
25#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
26#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
27
28#endif /* _UAPI_GAMEPORT_H */
diff --git a/include/linux/gen_stats.h b/include/uapi/linux/gen_stats.h
index 552c8a0a12d..552c8a0a12d 100644
--- a/include/linux/gen_stats.h
+++ b/include/uapi/linux/gen_stats.h
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h
new file mode 100644
index 00000000000..c880a417d8a
--- /dev/null
+++ b/include/uapi/linux/genetlink.h
@@ -0,0 +1,84 @@
1#ifndef _UAPI__LINUX_GENERIC_NETLINK_H
2#define _UAPI__LINUX_GENERIC_NETLINK_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7#define GENL_NAMSIZ 16 /* length of family name */
8
9#define GENL_MIN_ID NLMSG_MIN_TYPE
10#define GENL_MAX_ID 1023
11
12struct genlmsghdr {
13 __u8 cmd;
14 __u8 version;
15 __u16 reserved;
16};
17
18#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
19
20#define GENL_ADMIN_PERM 0x01
21#define GENL_CMD_CAP_DO 0x02
22#define GENL_CMD_CAP_DUMP 0x04
23#define GENL_CMD_CAP_HASPOL 0x08
24
25/*
26 * List of reserved static generic netlink identifiers:
27 */
28#define GENL_ID_GENERATE 0
29#define GENL_ID_CTRL NLMSG_MIN_TYPE
30
31/**************************************************************************
32 * Controller
33 **************************************************************************/
34
35enum {
36 CTRL_CMD_UNSPEC,
37 CTRL_CMD_NEWFAMILY,
38 CTRL_CMD_DELFAMILY,
39 CTRL_CMD_GETFAMILY,
40 CTRL_CMD_NEWOPS,
41 CTRL_CMD_DELOPS,
42 CTRL_CMD_GETOPS,
43 CTRL_CMD_NEWMCAST_GRP,
44 CTRL_CMD_DELMCAST_GRP,
45 CTRL_CMD_GETMCAST_GRP, /* unused */
46 __CTRL_CMD_MAX,
47};
48
49#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
50
51enum {
52 CTRL_ATTR_UNSPEC,
53 CTRL_ATTR_FAMILY_ID,
54 CTRL_ATTR_FAMILY_NAME,
55 CTRL_ATTR_VERSION,
56 CTRL_ATTR_HDRSIZE,
57 CTRL_ATTR_MAXATTR,
58 CTRL_ATTR_OPS,
59 CTRL_ATTR_MCAST_GROUPS,
60 __CTRL_ATTR_MAX,
61};
62
63#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
64
65enum {
66 CTRL_ATTR_OP_UNSPEC,
67 CTRL_ATTR_OP_ID,
68 CTRL_ATTR_OP_FLAGS,
69 __CTRL_ATTR_OP_MAX,
70};
71
72#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
73
74enum {
75 CTRL_ATTR_MCAST_GRP_UNSPEC,
76 CTRL_ATTR_MCAST_GRP_NAME,
77 CTRL_ATTR_MCAST_GRP_ID,
78 __CTRL_ATTR_MCAST_GRP_MAX,
79};
80
81#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
82
83
84#endif /* _UAPI__LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h
index b2de1f9a88d..b2de1f9a88d 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
diff --git a/include/linux/gigaset_dev.h b/include/uapi/linux/gigaset_dev.h
index 258ba82937e..258ba82937e 100644
--- a/include/linux/gigaset_dev.h
+++ b/include/uapi/linux/gigaset_dev.h
diff --git a/include/uapi/linux/hdlc.h b/include/uapi/linux/hdlc.h
new file mode 100644
index 00000000000..2c5f0aff4cf
--- /dev/null
+++ b/include/uapi/linux/hdlc.h
@@ -0,0 +1,23 @@
1/*
2 * Generic HDLC support routines for Linux
3 *
4 * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License
8 * as published by the Free Software Foundation.
9 */
10
11#ifndef _UAPI__HDLC_H
12#define _UAPI__HDLC_H
13
14
15#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
16#if 0
17#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
18#else
19#define HDLC_MAX_MRU 1600 /* as required for FR network */
20#endif
21
22
23#endif /* _UAPI__HDLC_H */
diff --git a/include/uapi/linux/hdlcdrv.h b/include/uapi/linux/hdlcdrv.h
new file mode 100644
index 00000000000..ffc79c0b44a
--- /dev/null
+++ b/include/uapi/linux/hdlcdrv.h
@@ -0,0 +1,110 @@
1/*
2 * hdlcdrv.h -- HDLC packet radio network driver.
3 * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
4 * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
5 */
6
7#ifndef _UAPI_HDLCDRV_H
8#define _UAPI_HDLCDRV_H
9
10/* -------------------------------------------------------------------- */
11/*
12 * structs for the IOCTL commands
13 */
14
15struct hdlcdrv_params {
16 int iobase;
17 int irq;
18 int dma;
19 int dma2;
20 int seriobase;
21 int pariobase;
22 int midiiobase;
23};
24
25struct hdlcdrv_channel_params {
26 int tx_delay; /* the transmitter keyup delay in 10ms units */
27 int tx_tail; /* the transmitter keyoff delay in 10ms units */
28 int slottime; /* the slottime in 10ms; usually 10 = 100ms */
29 int ppersist; /* the p-persistence 0..255 */
30 int fulldup; /* some driver do not support full duplex, setting */
31 /* this just makes them send even if DCD is on */
32};
33
34struct hdlcdrv_old_channel_state {
35 int ptt;
36 int dcd;
37 int ptt_keyed;
38};
39
40struct hdlcdrv_channel_state {
41 int ptt;
42 int dcd;
43 int ptt_keyed;
44 unsigned long tx_packets;
45 unsigned long tx_errors;
46 unsigned long rx_packets;
47 unsigned long rx_errors;
48};
49
50struct hdlcdrv_ioctl {
51 int cmd;
52 union {
53 struct hdlcdrv_params mp;
54 struct hdlcdrv_channel_params cp;
55 struct hdlcdrv_channel_state cs;
56 struct hdlcdrv_old_channel_state ocs;
57 unsigned int calibrate;
58 unsigned char bits;
59 char modename[128];
60 char drivername[32];
61 } data;
62};
63
64/* -------------------------------------------------------------------- */
65
66/*
67 * ioctl values
68 */
69#define HDLCDRVCTL_GETMODEMPAR 0
70#define HDLCDRVCTL_SETMODEMPAR 1
71#define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
72#define HDLCDRVCTL_GETCHANNELPAR 10
73#define HDLCDRVCTL_SETCHANNELPAR 11
74#define HDLCDRVCTL_OLDGETSTAT 20
75#define HDLCDRVCTL_CALIBRATE 21
76#define HDLCDRVCTL_GETSTAT 22
77
78/*
79 * these are mainly for debugging purposes
80 */
81#define HDLCDRVCTL_GETSAMPLES 30
82#define HDLCDRVCTL_GETBITS 31
83
84/*
85 * not handled by hdlcdrv, but by its depending drivers
86 */
87#define HDLCDRVCTL_GETMODE 40
88#define HDLCDRVCTL_SETMODE 41
89#define HDLCDRVCTL_MODELIST 42
90#define HDLCDRVCTL_DRIVERNAME 43
91
92/*
93 * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
94 */
95#define HDLCDRV_PARMASK_IOBASE (1<<0)
96#define HDLCDRV_PARMASK_IRQ (1<<1)
97#define HDLCDRV_PARMASK_DMA (1<<2)
98#define HDLCDRV_PARMASK_DMA2 (1<<3)
99#define HDLCDRV_PARMASK_SERIOBASE (1<<4)
100#define HDLCDRV_PARMASK_PARIOBASE (1<<5)
101#define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
102
103/* -------------------------------------------------------------------- */
104
105
106/* -------------------------------------------------------------------- */
107
108#endif /* _UAPI_HDLCDRV_H */
109
110/* -------------------------------------------------------------------- */
diff --git a/include/linux/hdreg.h b/include/uapi/linux/hdreg.h
index 29ee2873f4a..29ee2873f4a 100644
--- a/include/linux/hdreg.h
+++ b/include/uapi/linux/hdreg.h
diff --git a/include/uapi/linux/hid.h b/include/uapi/linux/hid.h
new file mode 100644
index 00000000000..b60f4842bd9
--- /dev/null
+++ b/include/uapi/linux/hid.h
@@ -0,0 +1,66 @@
1/*
2 * Copyright (c) 1999 Andreas Gal
3 * Copyright (c) 2000-2001 Vojtech Pavlik
4 * Copyright (c) 2006-2007 Jiri Kosina
5 */
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Should you need to contact me, the author, you can do so either by
22 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
23 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
24 */
25#ifndef _UAPI__HID_H
26#define _UAPI__HID_H
27
28
29
30/*
31 * USB HID (Human Interface Device) interface class code
32 */
33
34#define USB_INTERFACE_CLASS_HID 3
35
36/*
37 * USB HID interface subclass and protocol codes
38 */
39
40#define USB_INTERFACE_SUBCLASS_BOOT 1
41#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
42#define USB_INTERFACE_PROTOCOL_MOUSE 2
43
44/*
45 * HID class requests
46 */
47
48#define HID_REQ_GET_REPORT 0x01
49#define HID_REQ_GET_IDLE 0x02
50#define HID_REQ_GET_PROTOCOL 0x03
51#define HID_REQ_SET_REPORT 0x09
52#define HID_REQ_SET_IDLE 0x0A
53#define HID_REQ_SET_PROTOCOL 0x0B
54
55/*
56 * HID class descriptor types
57 */
58
59#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
60#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
61#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
62
63#define HID_MAX_DESCRIPTOR_SIZE 4096
64
65
66#endif /* _UAPI__HID_H */
diff --git a/include/uapi/linux/hiddev.h b/include/uapi/linux/hiddev.h
new file mode 100644
index 00000000000..7df7884bf5c
--- /dev/null
+++ b/include/uapi/linux/hiddev.h
@@ -0,0 +1,212 @@
1/*
2 * Copyright (c) 1999-2000 Vojtech Pavlik
3 *
4 * Sponsored by SuSE
5 */
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Should you need to contact me, the author, you can do so either by
22 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
23 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
24 */
25#ifndef _UAPI_HIDDEV_H
26#define _UAPI_HIDDEV_H
27
28
29
30#include <linux/types.h>
31
32/*
33 * The event structure itself
34 */
35
36struct hiddev_event {
37 unsigned hid;
38 signed int value;
39};
40
41struct hiddev_devinfo {
42 __u32 bustype;
43 __u32 busnum;
44 __u32 devnum;
45 __u32 ifnum;
46 __s16 vendor;
47 __s16 product;
48 __s16 version;
49 __u32 num_applications;
50};
51
52struct hiddev_collection_info {
53 __u32 index;
54 __u32 type;
55 __u32 usage;
56 __u32 level;
57};
58
59#define HID_STRING_SIZE 256
60struct hiddev_string_descriptor {
61 __s32 index;
62 char value[HID_STRING_SIZE];
63};
64
65struct hiddev_report_info {
66 __u32 report_type;
67 __u32 report_id;
68 __u32 num_fields;
69};
70
71/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
72 * report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
73 * are unknown. Otherwise use a usage_ref struct filled in from a previous
74 * successful GUSAGE call to save time. To actually send a value to the
75 * device, perform a SUSAGE first, followed by a SREPORT. An INITREPORT or a
76 * GREPORT isn't necessary for a GUSAGE to return valid data.
77 */
78#define HID_REPORT_ID_UNKNOWN 0xffffffff
79#define HID_REPORT_ID_FIRST 0x00000100
80#define HID_REPORT_ID_NEXT 0x00000200
81#define HID_REPORT_ID_MASK 0x000000ff
82#define HID_REPORT_ID_MAX 0x000000ff
83
84#define HID_REPORT_TYPE_INPUT 1
85#define HID_REPORT_TYPE_OUTPUT 2
86#define HID_REPORT_TYPE_FEATURE 3
87#define HID_REPORT_TYPE_MIN 1
88#define HID_REPORT_TYPE_MAX 3
89
90struct hiddev_field_info {
91 __u32 report_type;
92 __u32 report_id;
93 __u32 field_index;
94 __u32 maxusage;
95 __u32 flags;
96 __u32 physical; /* physical usage for this field */
97 __u32 logical; /* logical usage for this field */
98 __u32 application; /* application usage for this field */
99 __s32 logical_minimum;
100 __s32 logical_maximum;
101 __s32 physical_minimum;
102 __s32 physical_maximum;
103 __u32 unit_exponent;
104 __u32 unit;
105};
106
107/* Fill in report_type, report_id and field_index to get the information on a
108 * field.
109 */
110#define HID_FIELD_CONSTANT 0x001
111#define HID_FIELD_VARIABLE 0x002
112#define HID_FIELD_RELATIVE 0x004
113#define HID_FIELD_WRAP 0x008
114#define HID_FIELD_NONLINEAR 0x010
115#define HID_FIELD_NO_PREFERRED 0x020
116#define HID_FIELD_NULL_STATE 0x040
117#define HID_FIELD_VOLATILE 0x080
118#define HID_FIELD_BUFFERED_BYTE 0x100
119
120struct hiddev_usage_ref {
121 __u32 report_type;
122 __u32 report_id;
123 __u32 field_index;
124 __u32 usage_index;
125 __u32 usage_code;
126 __s32 value;
127};
128
129/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
130 * It really manifests itself as setting the value of consecutive usages */
131#define HID_MAX_MULTI_USAGES 1024
132struct hiddev_usage_ref_multi {
133 struct hiddev_usage_ref uref;
134 __u32 num_values;
135 __s32 values[HID_MAX_MULTI_USAGES];
136};
137
138/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
139 * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
140 * been sent by the device
141 */
142#define HID_FIELD_INDEX_NONE 0xffffffff
143
144/*
145 * Protocol version.
146 */
147
148#define HID_VERSION 0x010004
149
150/*
151 * IOCTLs (0x00 - 0x7f)
152 */
153
154#define HIDIOCGVERSION _IOR('H', 0x01, int)
155#define HIDIOCAPPLICATION _IO('H', 0x02)
156#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
157#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
158#define HIDIOCINITREPORT _IO('H', 0x05)
159#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
160#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
161#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
162#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
163#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
164#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
165#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
166#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
167#define HIDIOCGFLAG _IOR('H', 0x0E, int)
168#define HIDIOCSFLAG _IOW('H', 0x0F, int)
169#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
170#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
171#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
172
173/* For writing/reading to multiple/consecutive usages */
174#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
175#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
176
177/*
178 * Flags to be used in HIDIOCSFLAG
179 */
180#define HIDDEV_FLAG_UREF 0x1
181#define HIDDEV_FLAG_REPORT 0x2
182#define HIDDEV_FLAGS 0x3
183
184/* To traverse the input report descriptor info for a HID device, perform the
185 * following:
186 *
187 * rinfo.report_type = HID_REPORT_TYPE_INPUT;
188 * rinfo.report_id = HID_REPORT_ID_FIRST;
189 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
190 *
191 * while (ret >= 0) {
192 * for (i = 0; i < rinfo.num_fields; i++) {
193 * finfo.report_type = rinfo.report_type;
194 * finfo.report_id = rinfo.report_id;
195 * finfo.field_index = i;
196 * ioctl(fd, HIDIOCGFIELDINFO, &finfo);
197 * for (j = 0; j < finfo.maxusage; j++) {
198 * uref.report_type = rinfo.report_type;
199 * uref.report_id = rinfo.report_id;
200 * uref.field_index = i;
201 * uref.usage_index = j;
202 * ioctl(fd, HIDIOCGUCODE, &uref);
203 * ioctl(fd, HIDIOCGUSAGE, &uref);
204 * }
205 * }
206 * rinfo.report_id |= HID_REPORT_ID_NEXT;
207 * ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
208 * }
209 */
210
211
212#endif /* _UAPI_HIDDEV_H */
diff --git a/include/uapi/linux/hidraw.h b/include/uapi/linux/hidraw.h
new file mode 100644
index 00000000000..f5b732979a7
--- /dev/null
+++ b/include/uapi/linux/hidraw.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2007 Jiri Kosina
3 */
4/*
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
12 */
13#ifndef _UAPI_HIDRAW_H
14#define _UAPI_HIDRAW_H
15
16
17
18#include <linux/hid.h>
19#include <linux/types.h>
20
21struct hidraw_report_descriptor {
22 __u32 size;
23 __u8 value[HID_MAX_DESCRIPTOR_SIZE];
24};
25
26struct hidraw_devinfo {
27 __u32 bustype;
28 __s16 vendor;
29 __s16 product;
30};
31
32/* ioctl interface */
33#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
34#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
35#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
36#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
37#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
38/* The first byte of SFEATURE and GFEATURE is the report number */
39#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
40#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
41
42#define HIDRAW_FIRST_MINOR 0
43#define HIDRAW_MAX_DEVICES 64
44/* number of reports to buffer */
45#define HIDRAW_BUFFER_SIZE 64
46
47
48/* kernel-only API declarations */
49
50#endif /* _UAPI_HIDRAW_H */
diff --git a/include/uapi/linux/hpet.h b/include/uapi/linux/hpet.h
new file mode 100644
index 00000000000..8af3c70abc8
--- /dev/null
+++ b/include/uapi/linux/hpet.h
@@ -0,0 +1,25 @@
1#ifndef _UAPI__HPET__
2#define _UAPI__HPET__
3
4#include <linux/compiler.h>
5
6
7struct hpet_info {
8 unsigned long hi_ireqfreq; /* Hz */
9 unsigned long hi_flags; /* information */
10 unsigned short hi_hpet;
11 unsigned short hi_timer;
12};
13
14#define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */
15
16#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
17#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
18#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
19#define HPET_EPI _IO('h', 0x04) /* enable periodic */
20#define HPET_DPI _IO('h', 0x05) /* disable periodic */
21#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
22
23#define MAX_HPET_TBS 8 /* maximum hpet timer blocks */
24
25#endif /* _UAPI__HPET__ */
diff --git a/include/linux/hysdn_if.h b/include/uapi/linux/hysdn_if.h
index 00236ae3b04..00236ae3b04 100644
--- a/include/linux/hysdn_if.h
+++ b/include/uapi/linux/hysdn_if.h
diff --git a/include/uapi/linux/i2c-dev.h b/include/uapi/linux/i2c-dev.h
new file mode 100644
index 00000000000..3f311551795
--- /dev/null
+++ b/include/uapi/linux/i2c-dev.h
@@ -0,0 +1,72 @@
1/*
2 i2c-dev.h - i2c-bus driver, char device interface
3
4 Copyright (C) 1995-97 Simon G. Vogl
5 Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 MA 02110-1301 USA.
21*/
22
23#ifndef _UAPI_LINUX_I2C_DEV_H
24#define _UAPI_LINUX_I2C_DEV_H
25
26#include <linux/types.h>
27#include <linux/compiler.h>
28
29/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
30 * unsigned long, except for:
31 * - I2C_FUNCS, takes pointer to an unsigned long
32 * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
33 * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
34 */
35#define I2C_RETRIES 0x0701 /* number of times a device address should
36 be polled when not acknowledging */
37#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
38
39/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
40 * are NOT supported! (due to code brokenness)
41 */
42#define I2C_SLAVE 0x0703 /* Use this slave address */
43#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
44 is already in use by a driver! */
45#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
46
47#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
48
49#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
50
51#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
52#define I2C_SMBUS 0x0720 /* SMBus transfer */
53
54
55/* This is the structure as used in the I2C_SMBUS ioctl call */
56struct i2c_smbus_ioctl_data {
57 __u8 read_write;
58 __u8 command;
59 __u32 size;
60 union i2c_smbus_data __user *data;
61};
62
63/* This is the structure as used in the I2C_RDWR ioctl call */
64struct i2c_rdwr_ioctl_data {
65 struct i2c_msg __user *msgs; /* pointers to i2c_msgs */
66 __u32 nmsgs; /* number of i2c_msgs */
67};
68
69#define I2C_RDRW_IOCTL_MAX_MSGS 42
70
71
72#endif /* _UAPI_LINUX_I2C_DEV_H */
diff --git a/include/uapi/linux/i2c.h b/include/uapi/linux/i2c.h
new file mode 100644
index 00000000000..0e949cbfd33
--- /dev/null
+++ b/include/uapi/linux/i2c.h
@@ -0,0 +1,151 @@
1/* ------------------------------------------------------------------------- */
2/* */
3/* i2c.h - definitions for the i2c-bus interface */
4/* */
5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-2000 Simon G. Vogl
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 MA 02110-1301 USA. */
22/* ------------------------------------------------------------------------- */
23
24/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
25 Frodo Looijaard <frodol@dds.nl> */
26
27#ifndef _UAPI_LINUX_I2C_H
28#define _UAPI_LINUX_I2C_H
29
30#include <linux/types.h>
31
32/**
33 * struct i2c_msg - an I2C transaction segment beginning with START
34 * @addr: Slave address, either seven or ten bits. When this is a ten
35 * bit address, I2C_M_TEN must be set in @flags and the adapter
36 * must support I2C_FUNC_10BIT_ADDR.
37 * @flags: I2C_M_RD is handled by all adapters. No other flags may be
38 * provided unless the adapter exported the relevant I2C_FUNC_*
39 * flags through i2c_check_functionality().
40 * @len: Number of data bytes in @buf being read from or written to the
41 * I2C slave address. For read transactions where I2C_M_RECV_LEN
42 * is set, the caller guarantees that this buffer can hold up to
43 * 32 bytes in addition to the initial length byte sent by the
44 * slave (plus, if used, the SMBus PEC); and this value will be
45 * incremented by the number of block data bytes received.
46 * @buf: The buffer into which data is read, or from which it's written.
47 *
48 * An i2c_msg is the low level representation of one segment of an I2C
49 * transaction. It is visible to drivers in the @i2c_transfer() procedure,
50 * to userspace from i2c-dev, and to I2C adapter drivers through the
51 * @i2c_adapter.@master_xfer() method.
52 *
53 * Except when I2C "protocol mangling" is used, all I2C adapters implement
54 * the standard rules for I2C transactions. Each transaction begins with a
55 * START. That is followed by the slave address, and a bit encoding read
56 * versus write. Then follow all the data bytes, possibly including a byte
57 * with SMBus PEC. The transfer terminates with a NAK, or when all those
58 * bytes have been transferred and ACKed. If this is the last message in a
59 * group, it is followed by a STOP. Otherwise it is followed by the next
60 * @i2c_msg transaction segment, beginning with a (repeated) START.
61 *
62 * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
63 * passing certain @flags may have changed those standard protocol behaviors.
64 * Those flags are only for use with broken/nonconforming slaves, and with
65 * adapters which are known to support the specific mangling options they
66 * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
67 */
68struct i2c_msg {
69 __u16 addr; /* slave address */
70 __u16 flags;
71#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
72#define I2C_M_RD 0x0001 /* read data, from slave to master */
73#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
74#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
75#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
76#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
77#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
78#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
79 __u16 len; /* msg length */
80 __u8 *buf; /* pointer to msg data */
81};
82
83/* To determine what functionality is present */
84
85#define I2C_FUNC_I2C 0x00000001
86#define I2C_FUNC_10BIT_ADDR 0x00000002
87#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_IGNORE_NAK etc. */
88#define I2C_FUNC_SMBUS_PEC 0x00000008
89#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
90#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
91#define I2C_FUNC_SMBUS_QUICK 0x00010000
92#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
93#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
94#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
95#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
96#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
97#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
98#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
99#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
100#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
101#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
102#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
103
104#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
105 I2C_FUNC_SMBUS_WRITE_BYTE)
106#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
107 I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
108#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
109 I2C_FUNC_SMBUS_WRITE_WORD_DATA)
110#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
111 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
112#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
113 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
114
115#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
116 I2C_FUNC_SMBUS_BYTE | \
117 I2C_FUNC_SMBUS_BYTE_DATA | \
118 I2C_FUNC_SMBUS_WORD_DATA | \
119 I2C_FUNC_SMBUS_PROC_CALL | \
120 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
121 I2C_FUNC_SMBUS_I2C_BLOCK | \
122 I2C_FUNC_SMBUS_PEC)
123
124/*
125 * Data for SMBus Messages
126 */
127#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
128union i2c_smbus_data {
129 __u8 byte;
130 __u16 word;
131 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
132 /* and one more for user-space compatibility */
133};
134
135/* i2c_smbus_xfer read or write markers */
136#define I2C_SMBUS_READ 1
137#define I2C_SMBUS_WRITE 0
138
139/* SMBus transaction types (size parameter in the above functions)
140 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
141#define I2C_SMBUS_QUICK 0
142#define I2C_SMBUS_BYTE 1
143#define I2C_SMBUS_BYTE_DATA 2
144#define I2C_SMBUS_WORD_DATA 3
145#define I2C_SMBUS_PROC_CALL 4
146#define I2C_SMBUS_BLOCK_DATA 5
147#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
148#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
149#define I2C_SMBUS_I2C_BLOCK_DATA 8
150
151#endif /* _UAPI_LINUX_I2C_H */
diff --git a/include/linux/i2o-dev.h b/include/uapi/linux/i2o-dev.h
index a8093bfec3a..a8093bfec3a 100644
--- a/include/linux/i2o-dev.h
+++ b/include/uapi/linux/i2o-dev.h
diff --git a/include/linux/i8k.h b/include/uapi/linux/i8k.h
index 1c45ba50511..1c45ba50511 100644
--- a/include/linux/i8k.h
+++ b/include/uapi/linux/i8k.h
diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h
new file mode 100644
index 00000000000..16fff055f73
--- /dev/null
+++ b/include/uapi/linux/icmp.h
@@ -0,0 +1,97 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the ICMP protocol.
7 *
8 * Version: @(#)icmp.h 1.0.3 04/28/93
9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17#ifndef _UAPI_LINUX_ICMP_H
18#define _UAPI_LINUX_ICMP_H
19
20#include <linux/types.h>
21
22#define ICMP_ECHOREPLY 0 /* Echo Reply */
23#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
24#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
25#define ICMP_REDIRECT 5 /* Redirect (change route) */
26#define ICMP_ECHO 8 /* Echo Request */
27#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
28#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
29#define ICMP_TIMESTAMP 13 /* Timestamp Request */
30#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
31#define ICMP_INFO_REQUEST 15 /* Information Request */
32#define ICMP_INFO_REPLY 16 /* Information Reply */
33#define ICMP_ADDRESS 17 /* Address Mask Request */
34#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
35#define NR_ICMP_TYPES 18
36
37
38/* Codes for UNREACH. */
39#define ICMP_NET_UNREACH 0 /* Network Unreachable */
40#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
41#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
42#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
43#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
44#define ICMP_SR_FAILED 5 /* Source Route failed */
45#define ICMP_NET_UNKNOWN 6
46#define ICMP_HOST_UNKNOWN 7
47#define ICMP_HOST_ISOLATED 8
48#define ICMP_NET_ANO 9
49#define ICMP_HOST_ANO 10
50#define ICMP_NET_UNR_TOS 11
51#define ICMP_HOST_UNR_TOS 12
52#define ICMP_PKT_FILTERED 13 /* Packet filtered */
53#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
54#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
55#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
56
57/* Codes for REDIRECT. */
58#define ICMP_REDIR_NET 0 /* Redirect Net */
59#define ICMP_REDIR_HOST 1 /* Redirect Host */
60#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
61#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
62
63/* Codes for TIME_EXCEEDED. */
64#define ICMP_EXC_TTL 0 /* TTL count exceeded */
65#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
66
67
68struct icmphdr {
69 __u8 type;
70 __u8 code;
71 __sum16 checksum;
72 union {
73 struct {
74 __be16 id;
75 __be16 sequence;
76 } echo;
77 __be32 gateway;
78 struct {
79 __be16 __unused;
80 __be16 mtu;
81 } frag;
82 } un;
83};
84
85
86/*
87 * constants for (set|get)sockopt
88 */
89
90#define ICMP_FILTER 1
91
92struct icmp_filter {
93 __u32 data;
94};
95
96
97#endif /* _UAPI_LINUX_ICMP_H */
diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
new file mode 100644
index 00000000000..e0133c73c30
--- /dev/null
+++ b/include/uapi/linux/icmpv6.h
@@ -0,0 +1,164 @@
1#ifndef _UAPI_LINUX_ICMPV6_H
2#define _UAPI_LINUX_ICMPV6_H
3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7struct icmp6hdr {
8
9 __u8 icmp6_type;
10 __u8 icmp6_code;
11 __sum16 icmp6_cksum;
12
13
14 union {
15 __be32 un_data32[1];
16 __be16 un_data16[2];
17 __u8 un_data8[4];
18
19 struct icmpv6_echo {
20 __be16 identifier;
21 __be16 sequence;
22 } u_echo;
23
24 struct icmpv6_nd_advt {
25#if defined(__LITTLE_ENDIAN_BITFIELD)
26 __u32 reserved:5,
27 override:1,
28 solicited:1,
29 router:1,
30 reserved2:24;
31#elif defined(__BIG_ENDIAN_BITFIELD)
32 __u32 router:1,
33 solicited:1,
34 override:1,
35 reserved:29;
36#else
37#error "Please fix <asm/byteorder.h>"
38#endif
39 } u_nd_advt;
40
41 struct icmpv6_nd_ra {
42 __u8 hop_limit;
43#if defined(__LITTLE_ENDIAN_BITFIELD)
44 __u8 reserved:3,
45 router_pref:2,
46 home_agent:1,
47 other:1,
48 managed:1;
49
50#elif defined(__BIG_ENDIAN_BITFIELD)
51 __u8 managed:1,
52 other:1,
53 home_agent:1,
54 router_pref:2,
55 reserved:3;
56#else
57#error "Please fix <asm/byteorder.h>"
58#endif
59 __be16 rt_lifetime;
60 } u_nd_ra;
61
62 } icmp6_dataun;
63
64#define icmp6_identifier icmp6_dataun.u_echo.identifier
65#define icmp6_sequence icmp6_dataun.u_echo.sequence
66#define icmp6_pointer icmp6_dataun.un_data32[0]
67#define icmp6_mtu icmp6_dataun.un_data32[0]
68#define icmp6_unused icmp6_dataun.un_data32[0]
69#define icmp6_maxdelay icmp6_dataun.un_data16[0]
70#define icmp6_router icmp6_dataun.u_nd_advt.router
71#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
72#define icmp6_override icmp6_dataun.u_nd_advt.override
73#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
74#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
75#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
76#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
77#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
78#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
79};
80
81
82#define ICMPV6_ROUTER_PREF_LOW 0x3
83#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
84#define ICMPV6_ROUTER_PREF_HIGH 0x1
85#define ICMPV6_ROUTER_PREF_INVALID 0x2
86
87#define ICMPV6_DEST_UNREACH 1
88#define ICMPV6_PKT_TOOBIG 2
89#define ICMPV6_TIME_EXCEED 3
90#define ICMPV6_PARAMPROB 4
91
92#define ICMPV6_INFOMSG_MASK 0x80
93
94#define ICMPV6_ECHO_REQUEST 128
95#define ICMPV6_ECHO_REPLY 129
96#define ICMPV6_MGM_QUERY 130
97#define ICMPV6_MGM_REPORT 131
98#define ICMPV6_MGM_REDUCTION 132
99
100#define ICMPV6_NI_QUERY 139
101#define ICMPV6_NI_REPLY 140
102
103#define ICMPV6_MLD2_REPORT 143
104
105#define ICMPV6_DHAAD_REQUEST 144
106#define ICMPV6_DHAAD_REPLY 145
107#define ICMPV6_MOBILE_PREFIX_SOL 146
108#define ICMPV6_MOBILE_PREFIX_ADV 147
109
110/*
111 * Codes for Destination Unreachable
112 */
113#define ICMPV6_NOROUTE 0
114#define ICMPV6_ADM_PROHIBITED 1
115#define ICMPV6_NOT_NEIGHBOUR 2
116#define ICMPV6_ADDR_UNREACH 3
117#define ICMPV6_PORT_UNREACH 4
118
119/*
120 * Codes for Time Exceeded
121 */
122#define ICMPV6_EXC_HOPLIMIT 0
123#define ICMPV6_EXC_FRAGTIME 1
124
125/*
126 * Codes for Parameter Problem
127 */
128#define ICMPV6_HDR_FIELD 0
129#define ICMPV6_UNK_NEXTHDR 1
130#define ICMPV6_UNK_OPTION 2
131
132/*
133 * constants for (set|get)sockopt
134 */
135
136#define ICMPV6_FILTER 1
137
138/*
139 * ICMPV6 filter
140 */
141
142#define ICMPV6_FILTER_BLOCK 1
143#define ICMPV6_FILTER_PASS 2
144#define ICMPV6_FILTER_BLOCKOTHERS 3
145#define ICMPV6_FILTER_PASSONLY 4
146
147struct icmp6_filter {
148 __u32 data[8];
149};
150
151/*
152 * Definitions for MLDv2
153 */
154#define MLD2_MODE_IS_INCLUDE 1
155#define MLD2_MODE_IS_EXCLUDE 2
156#define MLD2_CHANGE_TO_INCLUDE 3
157#define MLD2_CHANGE_TO_EXCLUDE 4
158#define MLD2_ALLOW_NEW_SOURCES 5
159#define MLD2_BLOCK_OLD_SOURCES 6
160
161#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
162
163
164#endif /* _UAPI_LINUX_ICMPV6_H */
diff --git a/include/linux/if.h b/include/uapi/linux/if.h
index 1ec407b01e4..1ec407b01e4 100644
--- a/include/linux/if.h
+++ b/include/uapi/linux/if.h
diff --git a/include/linux/if_addr.h b/include/uapi/linux/if_addr.h
index 23357ab81a7..23357ab81a7 100644
--- a/include/linux/if_addr.h
+++ b/include/uapi/linux/if_addr.h
diff --git a/include/linux/if_addrlabel.h b/include/uapi/linux/if_addrlabel.h
index 54580c29818..54580c29818 100644
--- a/include/linux/if_addrlabel.h
+++ b/include/uapi/linux/if_addrlabel.h
diff --git a/include/linux/if_alg.h b/include/uapi/linux/if_alg.h
index 0f9acce5b1f..0f9acce5b1f 100644
--- a/include/linux/if_alg.h
+++ b/include/uapi/linux/if_alg.h
diff --git a/include/linux/if_arcnet.h b/include/uapi/linux/if_arcnet.h
index 46e34bd0e78..46e34bd0e78 100644
--- a/include/linux/if_arcnet.h
+++ b/include/uapi/linux/if_arcnet.h
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
new file mode 100644
index 00000000000..82c7d1bdade
--- /dev/null
+++ b/include/uapi/linux/if_arp.h
@@ -0,0 +1,159 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Global definitions for the ARP (RFC 826) protocol.
7 *
8 * Version: @(#)if_arp.h 1.0.1 04/16/93
9 *
10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
11 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
12 * Ross Biro
13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 * Florian La Roche,
15 * Jonathan Layes <layes@loran.com>
16 * Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 */
23#ifndef _UAPI_LINUX_IF_ARP_H
24#define _UAPI_LINUX_IF_ARP_H
25
26#include <linux/netdevice.h>
27
28/* ARP protocol HARDWARE identifiers. */
29#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
30#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
31#define ARPHRD_EETHER 2 /* Experimental Ethernet */
32#define ARPHRD_AX25 3 /* AX.25 Level 2 */
33#define ARPHRD_PRONET 4 /* PROnet token ring */
34#define ARPHRD_CHAOS 5 /* Chaosnet */
35#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
36#define ARPHRD_ARCNET 7 /* ARCnet */
37#define ARPHRD_APPLETLK 8 /* APPLEtalk */
38#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
39#define ARPHRD_ATM 19 /* ATM */
40#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
41#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
42#define ARPHRD_EUI64 27 /* EUI-64 */
43#define ARPHRD_INFINIBAND 32 /* InfiniBand */
44
45/* Dummy types for non ARP hardware */
46#define ARPHRD_SLIP 256
47#define ARPHRD_CSLIP 257
48#define ARPHRD_SLIP6 258
49#define ARPHRD_CSLIP6 259
50#define ARPHRD_RSRVD 260 /* Notional KISS type */
51#define ARPHRD_ADAPT 264
52#define ARPHRD_ROSE 270
53#define ARPHRD_X25 271 /* CCITT X.25 */
54#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
55#define ARPHRD_CAN 280 /* Controller Area Network */
56#define ARPHRD_PPP 512
57#define ARPHRD_CISCO 513 /* Cisco HDLC */
58#define ARPHRD_HDLC ARPHRD_CISCO
59#define ARPHRD_LAPB 516 /* LAPB */
60#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
61#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
62
63#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
64#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
65#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
66#define ARPHRD_SKIP 771 /* SKIP vif */
67#define ARPHRD_LOOPBACK 772 /* Loopback device */
68#define ARPHRD_LOCALTLK 773 /* Localtalk device */
69#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
70#define ARPHRD_BIF 775 /* AP1000 BIF */
71#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
72#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
73#define ARPHRD_IPGRE 778 /* GRE over IP */
74#define ARPHRD_PIMREG 779 /* PIMSM register interface */
75#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
76#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
77#define ARPHRD_ECONET 782 /* Acorn Econet */
78#define ARPHRD_IRDA 783 /* Linux-IrDA */
79/* ARP works differently on different FC media .. so */
80#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
81#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
82#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
83#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
84 /* 787->799 reserved for fibrechannel media types */
85#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
86#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
87#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
88#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
89#define ARPHRD_IEEE802154 804
90#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */
91
92#define ARPHRD_PHONET 820 /* PhoNet media type */
93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
94#define ARPHRD_CAIF 822 /* CAIF media type */
95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
96
97#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
98#define ARPHRD_NONE 0xFFFE /* zero header length */
99
100/* ARP protocol opcodes. */
101#define ARPOP_REQUEST 1 /* ARP request */
102#define ARPOP_REPLY 2 /* ARP reply */
103#define ARPOP_RREQUEST 3 /* RARP request */
104#define ARPOP_RREPLY 4 /* RARP reply */
105#define ARPOP_InREQUEST 8 /* InARP request */
106#define ARPOP_InREPLY 9 /* InARP reply */
107#define ARPOP_NAK 10 /* (ATM)ARP NAK */
108
109
110/* ARP ioctl request. */
111struct arpreq {
112 struct sockaddr arp_pa; /* protocol address */
113 struct sockaddr arp_ha; /* hardware address */
114 int arp_flags; /* flags */
115 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
116 char arp_dev[16];
117};
118
119struct arpreq_old {
120 struct sockaddr arp_pa; /* protocol address */
121 struct sockaddr arp_ha; /* hardware address */
122 int arp_flags; /* flags */
123 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
124};
125
126/* ARP Flag values. */
127#define ATF_COM 0x02 /* completed entry (ha valid) */
128#define ATF_PERM 0x04 /* permanent entry */
129#define ATF_PUBL 0x08 /* publish entry */
130#define ATF_USETRAILERS 0x10 /* has requested trailers */
131#define ATF_NETMASK 0x20 /* want to use a netmask (only
132 for proxy entries) */
133#define ATF_DONTPUB 0x40 /* don't answer this addresses */
134
135/*
136 * This structure defines an ethernet arp header.
137 */
138
139struct arphdr {
140 __be16 ar_hrd; /* format of hardware address */
141 __be16 ar_pro; /* format of protocol address */
142 unsigned char ar_hln; /* length of hardware address */
143 unsigned char ar_pln; /* length of protocol address */
144 __be16 ar_op; /* ARP opcode (command) */
145
146#if 0
147 /*
148 * Ethernet looks like this : This bit is variable sized however...
149 */
150 unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
151 unsigned char ar_sip[4]; /* sender IP address */
152 unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
153 unsigned char ar_tip[4]; /* target IP address */
154#endif
155
156};
157
158
159#endif /* _UAPI_LINUX_IF_ARP_H */
diff --git a/include/linux/if_bonding.h b/include/uapi/linux/if_bonding.h
index a17edda8a78..a17edda8a78 100644
--- a/include/linux/if_bonding.h
+++ b/include/uapi/linux/if_bonding.h
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
new file mode 100644
index 00000000000..a8fe9549ddb
--- /dev/null
+++ b/include/uapi/linux/if_bridge.h
@@ -0,0 +1,101 @@
1/*
2 * Linux ethernet bridge
3 *
4 * Authors:
5 * Lennert Buytenhek <buytenh@gnu.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _UAPI_LINUX_IF_BRIDGE_H
14#define _UAPI_LINUX_IF_BRIDGE_H
15
16#include <linux/types.h>
17
18#define SYSFS_BRIDGE_ATTR "bridge"
19#define SYSFS_BRIDGE_FDB "brforward"
20#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
21#define SYSFS_BRIDGE_PORT_ATTR "brport"
22#define SYSFS_BRIDGE_PORT_LINK "bridge"
23
24#define BRCTL_VERSION 1
25
26#define BRCTL_GET_VERSION 0
27#define BRCTL_GET_BRIDGES 1
28#define BRCTL_ADD_BRIDGE 2
29#define BRCTL_DEL_BRIDGE 3
30#define BRCTL_ADD_IF 4
31#define BRCTL_DEL_IF 5
32#define BRCTL_GET_BRIDGE_INFO 6
33#define BRCTL_GET_PORT_LIST 7
34#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
35#define BRCTL_SET_BRIDGE_HELLO_TIME 9
36#define BRCTL_SET_BRIDGE_MAX_AGE 10
37#define BRCTL_SET_AGEING_TIME 11
38#define BRCTL_SET_GC_INTERVAL 12
39#define BRCTL_GET_PORT_INFO 13
40#define BRCTL_SET_BRIDGE_STP_STATE 14
41#define BRCTL_SET_BRIDGE_PRIORITY 15
42#define BRCTL_SET_PORT_PRIORITY 16
43#define BRCTL_SET_PATH_COST 17
44#define BRCTL_GET_FDB_ENTRIES 18
45
46#define BR_STATE_DISABLED 0
47#define BR_STATE_LISTENING 1
48#define BR_STATE_LEARNING 2
49#define BR_STATE_FORWARDING 3
50#define BR_STATE_BLOCKING 4
51
52struct __bridge_info {
53 __u64 designated_root;
54 __u64 bridge_id;
55 __u32 root_path_cost;
56 __u32 max_age;
57 __u32 hello_time;
58 __u32 forward_delay;
59 __u32 bridge_max_age;
60 __u32 bridge_hello_time;
61 __u32 bridge_forward_delay;
62 __u8 topology_change;
63 __u8 topology_change_detected;
64 __u8 root_port;
65 __u8 stp_enabled;
66 __u32 ageing_time;
67 __u32 gc_interval;
68 __u32 hello_timer_value;
69 __u32 tcn_timer_value;
70 __u32 topology_change_timer_value;
71 __u32 gc_timer_value;
72};
73
74struct __port_info {
75 __u64 designated_root;
76 __u64 designated_bridge;
77 __u16 port_id;
78 __u16 designated_port;
79 __u32 path_cost;
80 __u32 designated_cost;
81 __u8 state;
82 __u8 top_change_ack;
83 __u8 config_pending;
84 __u8 unused0;
85 __u32 message_age_timer_value;
86 __u32 forward_delay_timer_value;
87 __u32 hold_timer_value;
88};
89
90struct __fdb_entry {
91 __u8 mac_addr[6];
92 __u8 port_no;
93 __u8 is_local;
94 __u32 ageing_timer_value;
95 __u8 port_hi;
96 __u8 pad0;
97 __u16 unused;
98};
99
100
101#endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/linux/if_cablemodem.h b/include/uapi/linux/if_cablemodem.h
index 9ca1007edd9..9ca1007edd9 100644
--- a/include/linux/if_cablemodem.h
+++ b/include/uapi/linux/if_cablemodem.h
diff --git a/include/uapi/linux/if_eql.h b/include/uapi/linux/if_eql.h
new file mode 100644
index 00000000000..06e818c9e7c
--- /dev/null
+++ b/include/uapi/linux/if_eql.h
@@ -0,0 +1,54 @@
1/*
2 * Equalizer Load-balancer for serial network interfaces.
3 *
4 * (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
5 * NCM: Network and Communications Management, Inc.
6 *
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 * The author may be reached as simon@ncm.com, or C/O
12 * NCM
13 * Attn: Simon Janes
14 * 6803 Whittier Ave
15 * McLean VA 22101
16 * Phone: 1-703-847-0040 ext 103
17 */
18
19#ifndef _UAPI_LINUX_IF_EQL_H
20#define _UAPI_LINUX_IF_EQL_H
21
22#define EQL_DEFAULT_SLAVE_PRIORITY 28800
23#define EQL_DEFAULT_MAX_SLAVES 4
24#define EQL_DEFAULT_MTU 576
25#define EQL_DEFAULT_RESCHED_IVAL HZ
26
27#define EQL_ENSLAVE (SIOCDEVPRIVATE)
28#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)
29
30#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
31#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
32
33#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
34#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
35
36
37typedef struct master_config {
38 char master_name[16];
39 int max_slaves;
40 int min_slaves;
41} master_config_t;
42
43typedef struct slave_config {
44 char slave_name[16];
45 long priority;
46} slave_config_t;
47
48typedef struct slaving_request {
49 char slave_name[16];
50 long priority;
51} slaving_request_t;
52
53
54#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
index 00000000000..0343e1f0582
--- /dev/null
+++ b/include/uapi/linux/if_ether.h
@@ -0,0 +1,135 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Global definitions for the Ethernet IEEE 802.3 interface.
7 *
8 * Version: @(#)if_ether.h 1.0.1a 02/08/94
9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 * Donald Becker, <becker@super.org>
12 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
13 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20
21#ifndef _UAPI_LINUX_IF_ETHER_H
22#define _UAPI_LINUX_IF_ETHER_H
23
24#include <linux/types.h>
25
26/*
27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
28 * and FCS/CRC (frame check sequence).
29 */
30
31#define ETH_ALEN 6 /* Octets in one ethernet addr */
32#define ETH_HLEN 14 /* Total octets in header. */
33#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
34#define ETH_DATA_LEN 1500 /* Max. octets in payload */
35#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
36#define ETH_FCS_LEN 4 /* Octets in the FCS */
37
38/*
39 * These are the defined Ethernet Protocol ID's.
40 */
41
42#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
43#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
44#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
45#define ETH_P_IP 0x0800 /* Internet Protocol packet */
46#define ETH_P_X25 0x0805 /* CCITT X.25 */
47#define ETH_P_ARP 0x0806 /* Address Resolution packet */
48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
51#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
52#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
53#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
54#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
55#define ETH_P_LAT 0x6004 /* DEC LAT */
56#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
57#define ETH_P_CUST 0x6006 /* DEC Customer use */
58#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
59#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
60#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
61#define ETH_P_ATALK 0x809B /* Appletalk DDP */
62#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
63#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
64#define ETH_P_IPX 0x8137 /* IPX over DIX */
65#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
66#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
67#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
68#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
69 * defined in draft-wilson-wrec-wccp-v2-00.txt */
70#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
71#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
72#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
73#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
74#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
75#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
76#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
77 * over Ethernet
78 */
79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
81#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
82#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
83#define ETH_P_TIPC 0x88CA /* TIPC */
84#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
85#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
86#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
87#define ETH_P_TDLS 0x890D /* TDLS */
88#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
89#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
90#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
91#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
92#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
93#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
94
95/*
96 * Non DIX types. Won't clash for 1500 types.
97 */
98
99#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
100#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
101#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
102#define ETH_P_802_2 0x0004 /* 802.2 frames */
103#define ETH_P_SNAP 0x0005 /* Internal only */
104#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
108#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
109#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
110#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
111#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
112#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
113#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
114#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
115#define ETH_P_ECONET 0x0018 /* Acorn Econet */
116#define ETH_P_HDLC 0x0019 /* HDLC frames */
117#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
118#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
119#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
120#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
121#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
122#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
123
124/*
125 * This is an Ethernet frame header.
126 */
127
128struct ethhdr {
129 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
130 unsigned char h_source[ETH_ALEN]; /* source ether addr */
131 __be16 h_proto; /* packet type ID field */
132} __attribute__((packed));
133
134
135#endif /* _UAPI_LINUX_IF_ETHER_H */
diff --git a/include/linux/if_fc.h b/include/uapi/linux/if_fc.h
index 6ed7f1bf35c..6ed7f1bf35c 100644
--- a/include/linux/if_fc.h
+++ b/include/uapi/linux/if_fc.h
diff --git a/include/uapi/linux/if_fddi.h b/include/uapi/linux/if_fddi.h
new file mode 100644
index 00000000000..0d36909c3ae
--- /dev/null
+++ b/include/uapi/linux/if_fddi.h
@@ -0,0 +1,104 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Global definitions for the ANSI FDDI interface.
7 *
8 * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004
9 *
10 * Author: Lawrence V. Stefani, <stefani@lkg.dec.com>
11 *
12 * if_fddi.h is based on previous if_ether.h and if_tr.h work by
13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 * Donald Becker, <becker@super.org>
15 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
16 * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
17 * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24#ifndef _UAPI_LINUX_IF_FDDI_H
25#define _UAPI_LINUX_IF_FDDI_H
26
27#include <linux/types.h>
28
29/*
30 * Define max and min legal sizes. The frame sizes do not include
31 * 4 byte FCS/CRC (frame check sequence).
32 */
33#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
34#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
35#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
36#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */
37#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */
38#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
39#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
40#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
41#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
42
43/* Define FDDI Frame Control (FC) Byte values */
44#define FDDI_FC_K_VOID 0x00
45#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
46#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
47#define FDDI_FC_K_SMT_MIN 0x41
48#define FDDI_FC_K_SMT_MAX 0x4F
49#define FDDI_FC_K_MAC_MIN 0xC1
50#define FDDI_FC_K_MAC_MAX 0xCF
51#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
52#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
53#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
54#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
55#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
56#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
57#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
58#define FDDI_FC_K_RESERVED_MIN 0x70
59#define FDDI_FC_K_RESERVED_MAX 0x7F
60
61/* Define LLC and SNAP constants */
62#define FDDI_EXTENDED_SAP 0xAA
63#define FDDI_UI_CMD 0x03
64
65/* Define 802.2 Type 1 header */
66struct fddi_8022_1_hdr {
67 __u8 dsap; /* destination service access point */
68 __u8 ssap; /* source service access point */
69 __u8 ctrl; /* control byte #1 */
70} __attribute__((packed));
71
72/* Define 802.2 Type 2 header */
73struct fddi_8022_2_hdr {
74 __u8 dsap; /* destination service access point */
75 __u8 ssap; /* source service access point */
76 __u8 ctrl_1; /* control byte #1 */
77 __u8 ctrl_2; /* control byte #2 */
78} __attribute__((packed));
79
80/* Define 802.2 SNAP header */
81#define FDDI_K_OUI_LEN 3
82struct fddi_snap_hdr {
83 __u8 dsap; /* always 0xAA */
84 __u8 ssap; /* always 0xAA */
85 __u8 ctrl; /* always 0x03 */
86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
87 __be16 ethertype; /* packet type ID field */
88} __attribute__((packed));
89
90/* Define FDDI LLC frame header */
91struct fddihdr {
92 __u8 fc; /* frame control */
93 __u8 daddr[FDDI_K_ALEN]; /* destination address */
94 __u8 saddr[FDDI_K_ALEN]; /* source address */
95 union
96 {
97 struct fddi_8022_1_hdr llc_8022_1;
98 struct fddi_8022_2_hdr llc_8022_2;
99 struct fddi_snap_hdr llc_snap;
100 } hdr;
101} __attribute__((packed));
102
103
104#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
index 00000000000..f25b08d5eb6
--- /dev/null
+++ b/include/uapi/linux/if_frad.h
@@ -0,0 +1,122 @@
1/*
2 * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are
3 * created for each DLCI associated with a FRAD. The FRAD driver
4 * is not truly a network device, but the lower level device
5 * handler. This allows other FRAD manufacturers to use the DLCI
6 * code, including its RFC1490 encapsulation alongside the current
7 * implementation for the Sangoma cards.
8 *
9 * Version: @(#)if_ifrad.h 0.15 31 Mar 96
10 *
11 * Author: Mike McLagan <mike.mclagan@linux.org>
12 *
13 * Changes:
14 * 0.15 Mike McLagan changed structure defs (packed)
15 * re-arranged flags
16 * added DLCI_RET vars
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 */
23
24#ifndef _UAPI_FRAD_H_
25#define _UAPI_FRAD_H_
26
27#include <linux/if.h>
28
29/* Structures and constants associated with the DLCI device driver */
30
31struct dlci_add
32{
33 char devname[IFNAMSIZ];
34 short dlci;
35};
36
37#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
38#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
39
40/*
41 * These are related to the Sangoma SDLA and should remain in order.
42 * Code within the SDLA module is based on the specifics of this
43 * structure. Change at your own peril.
44 */
45struct dlci_conf {
46 short flags;
47 short CIR_fwd;
48 short Bc_fwd;
49 short Be_fwd;
50 short CIR_bwd;
51 short Bc_bwd;
52 short Be_bwd;
53
54/* these are part of the status read */
55 short Tc_fwd;
56 short Tc_bwd;
57 short Tf_max;
58 short Tb_max;
59
60/* add any new fields here above is a mirror of sdla_dlci_conf */
61};
62
63#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
64
65/* configuration flags for DLCI */
66#define DLCI_IGNORE_CIR_OUT 0x0001
67#define DLCI_ACCOUNT_CIR_IN 0x0002
68#define DLCI_BUFFER_IF 0x0008
69
70#define DLCI_VALID_FLAGS 0x000B
71
72/* defines for the actual Frame Relay hardware */
73#define FRAD_GET_CONF (SIOCDEVPRIVATE)
74#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
75
76#define FRAD_LAST_IOCTL FRAD_SET_CONF
77
78/*
79 * Based on the setup for the Sangoma SDLA. If changes are
80 * necessary to this structure, a routine will need to be
81 * added to that module to copy fields.
82 */
83struct frad_conf
84{
85 short station;
86 short flags;
87 short kbaud;
88 short clocking;
89 short mtu;
90 short T391;
91 short T392;
92 short N391;
93 short N392;
94 short N393;
95 short CIR_fwd;
96 short Bc_fwd;
97 short Be_fwd;
98 short CIR_bwd;
99 short Bc_bwd;
100 short Be_bwd;
101
102/* Add new fields here, above is a mirror of the sdla_conf */
103
104};
105
106#define FRAD_STATION_CPE 0x0000
107#define FRAD_STATION_NODE 0x0001
108
109#define FRAD_TX_IGNORE_CIR 0x0001
110#define FRAD_RX_ACCOUNT_CIR 0x0002
111#define FRAD_DROP_ABORTED 0x0004
112#define FRAD_BUFFERIF 0x0008
113#define FRAD_STATS 0x0010
114#define FRAD_MCI 0x0100
115#define FRAD_AUTODLCI 0x8000
116#define FRAD_VALID_FLAGS 0x811F
117
118#define FRAD_CLOCK_INT 0x0001
119#define FRAD_CLOCK_EXT 0x0000
120
121
122#endif /* _UAPI_FRAD_H_ */
diff --git a/include/linux/if_hippi.h b/include/uapi/linux/if_hippi.h
index cdc049f1829..cdc049f1829 100644
--- a/include/linux/if_hippi.h
+++ b/include/uapi/linux/if_hippi.h
diff --git a/include/linux/if_infiniband.h b/include/uapi/linux/if_infiniband.h
index 7d958475d4a..7d958475d4a 100644
--- a/include/linux/if_infiniband.h
+++ b/include/uapi/linux/if_infiniband.h
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
new file mode 100644
index 00000000000..5c80cb11518
--- /dev/null
+++ b/include/uapi/linux/if_link.h
@@ -0,0 +1,429 @@
1#ifndef _UAPI_LINUX_IF_LINK_H
2#define _UAPI_LINUX_IF_LINK_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7/* This struct should be in sync with struct rtnl_link_stats64 */
8struct rtnl_link_stats {
9 __u32 rx_packets; /* total packets received */
10 __u32 tx_packets; /* total packets transmitted */
11 __u32 rx_bytes; /* total bytes received */
12 __u32 tx_bytes; /* total bytes transmitted */
13 __u32 rx_errors; /* bad packets received */
14 __u32 tx_errors; /* packet transmit problems */
15 __u32 rx_dropped; /* no space in linux buffers */
16 __u32 tx_dropped; /* no space available in linux */
17 __u32 multicast; /* multicast packets received */
18 __u32 collisions;
19
20 /* detailed rx_errors: */
21 __u32 rx_length_errors;
22 __u32 rx_over_errors; /* receiver ring buff overflow */
23 __u32 rx_crc_errors; /* recved pkt with crc error */
24 __u32 rx_frame_errors; /* recv'd frame alignment error */
25 __u32 rx_fifo_errors; /* recv'r fifo overrun */
26 __u32 rx_missed_errors; /* receiver missed packet */
27
28 /* detailed tx_errors */
29 __u32 tx_aborted_errors;
30 __u32 tx_carrier_errors;
31 __u32 tx_fifo_errors;
32 __u32 tx_heartbeat_errors;
33 __u32 tx_window_errors;
34
35 /* for cslip etc */
36 __u32 rx_compressed;
37 __u32 tx_compressed;
38};
39
40/* The main device statistics structure */
41struct rtnl_link_stats64 {
42 __u64 rx_packets; /* total packets received */
43 __u64 tx_packets; /* total packets transmitted */
44 __u64 rx_bytes; /* total bytes received */
45 __u64 tx_bytes; /* total bytes transmitted */
46 __u64 rx_errors; /* bad packets received */
47 __u64 tx_errors; /* packet transmit problems */
48 __u64 rx_dropped; /* no space in linux buffers */
49 __u64 tx_dropped; /* no space available in linux */
50 __u64 multicast; /* multicast packets received */
51 __u64 collisions;
52
53 /* detailed rx_errors: */
54 __u64 rx_length_errors;
55 __u64 rx_over_errors; /* receiver ring buff overflow */
56 __u64 rx_crc_errors; /* recved pkt with crc error */
57 __u64 rx_frame_errors; /* recv'd frame alignment error */
58 __u64 rx_fifo_errors; /* recv'r fifo overrun */
59 __u64 rx_missed_errors; /* receiver missed packet */
60
61 /* detailed tx_errors */
62 __u64 tx_aborted_errors;
63 __u64 tx_carrier_errors;
64 __u64 tx_fifo_errors;
65 __u64 tx_heartbeat_errors;
66 __u64 tx_window_errors;
67
68 /* for cslip etc */
69 __u64 rx_compressed;
70 __u64 tx_compressed;
71};
72
73/* The struct should be in sync with struct ifmap */
74struct rtnl_link_ifmap {
75 __u64 mem_start;
76 __u64 mem_end;
77 __u64 base_addr;
78 __u16 irq;
79 __u8 dma;
80 __u8 port;
81};
82
83/*
84 * IFLA_AF_SPEC
85 * Contains nested attributes for address family specific attributes.
86 * Each address family may create a attribute with the address family
87 * number as type and create its own attribute structure in it.
88 *
89 * Example:
90 * [IFLA_AF_SPEC] = {
91 * [AF_INET] = {
92 * [IFLA_INET_CONF] = ...,
93 * },
94 * [AF_INET6] = {
95 * [IFLA_INET6_FLAGS] = ...,
96 * [IFLA_INET6_CONF] = ...,
97 * }
98 * }
99 */
100
101enum {
102 IFLA_UNSPEC,
103 IFLA_ADDRESS,
104 IFLA_BROADCAST,
105 IFLA_IFNAME,
106 IFLA_MTU,
107 IFLA_LINK,
108 IFLA_QDISC,
109 IFLA_STATS,
110 IFLA_COST,
111#define IFLA_COST IFLA_COST
112 IFLA_PRIORITY,
113#define IFLA_PRIORITY IFLA_PRIORITY
114 IFLA_MASTER,
115#define IFLA_MASTER IFLA_MASTER
116 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
117#define IFLA_WIRELESS IFLA_WIRELESS
118 IFLA_PROTINFO, /* Protocol specific information for a link */
119#define IFLA_PROTINFO IFLA_PROTINFO
120 IFLA_TXQLEN,
121#define IFLA_TXQLEN IFLA_TXQLEN
122 IFLA_MAP,
123#define IFLA_MAP IFLA_MAP
124 IFLA_WEIGHT,
125#define IFLA_WEIGHT IFLA_WEIGHT
126 IFLA_OPERSTATE,
127 IFLA_LINKMODE,
128 IFLA_LINKINFO,
129#define IFLA_LINKINFO IFLA_LINKINFO
130 IFLA_NET_NS_PID,
131 IFLA_IFALIAS,
132 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
133 IFLA_VFINFO_LIST,
134 IFLA_STATS64,
135 IFLA_VF_PORTS,
136 IFLA_PORT_SELF,
137 IFLA_AF_SPEC,
138 IFLA_GROUP, /* Group the device belongs to */
139 IFLA_NET_NS_FD,
140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES,
145 __IFLA_MAX
146};
147
148
149#define IFLA_MAX (__IFLA_MAX - 1)
150
151/* backwards compatibility for userspace */
152#ifndef __KERNEL__
153#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
154#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
155#endif
156
157enum {
158 IFLA_INET_UNSPEC,
159 IFLA_INET_CONF,
160 __IFLA_INET_MAX,
161};
162
163#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
164
165/* ifi_flags.
166
167 IFF_* flags.
168
169 The only change is:
170 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
171 more not changeable by user. They describe link media
172 characteristics and set by device driver.
173
174 Comments:
175 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
176 - If neither of these three flags are set;
177 the interface is NBMA.
178
179 - IFF_MULTICAST does not mean anything special:
180 multicasts can be used on all not-NBMA links.
181 IFF_MULTICAST means that this media uses special encapsulation
182 for multicast frames. Apparently, all IFF_POINTOPOINT and
183 IFF_BROADCAST devices are able to use multicasts too.
184 */
185
186/* IFLA_LINK.
187 For usual devices it is equal ifi_index.
188 If it is a "virtual interface" (f.e. tunnel), ifi_link
189 can point to real physical interface (f.e. for bandwidth calculations),
190 or maybe 0, what means, that real media is unknown (usual
191 for IPIP tunnels, when route to endpoint is allowed to change)
192 */
193
194/* Subtype attributes for IFLA_PROTINFO */
195enum {
196 IFLA_INET6_UNSPEC,
197 IFLA_INET6_FLAGS, /* link flags */
198 IFLA_INET6_CONF, /* sysctl parameters */
199 IFLA_INET6_STATS, /* statistics */
200 IFLA_INET6_MCAST, /* MC things. What of them? */
201 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
202 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
203 __IFLA_INET6_MAX
204};
205
206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
207
208struct ifla_cacheinfo {
209 __u32 max_reasm_len;
210 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
211 __u32 reachable_time;
212 __u32 retrans_time;
213};
214
215enum {
216 IFLA_INFO_UNSPEC,
217 IFLA_INFO_KIND,
218 IFLA_INFO_DATA,
219 IFLA_INFO_XSTATS,
220 __IFLA_INFO_MAX,
221};
222
223#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
224
225/* VLAN section */
226
227enum {
228 IFLA_VLAN_UNSPEC,
229 IFLA_VLAN_ID,
230 IFLA_VLAN_FLAGS,
231 IFLA_VLAN_EGRESS_QOS,
232 IFLA_VLAN_INGRESS_QOS,
233 __IFLA_VLAN_MAX,
234};
235
236#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
237
238struct ifla_vlan_flags {
239 __u32 flags;
240 __u32 mask;
241};
242
243enum {
244 IFLA_VLAN_QOS_UNSPEC,
245 IFLA_VLAN_QOS_MAPPING,
246 __IFLA_VLAN_QOS_MAX
247};
248
249#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
250
251struct ifla_vlan_qos_mapping {
252 __u32 from;
253 __u32 to;
254};
255
256/* MACVLAN section */
257enum {
258 IFLA_MACVLAN_UNSPEC,
259 IFLA_MACVLAN_MODE,
260 IFLA_MACVLAN_FLAGS,
261 __IFLA_MACVLAN_MAX,
262};
263
264#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
265
266enum macvlan_mode {
267 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
268 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
269 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
270 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
271};
272
273#define MACVLAN_FLAG_NOPROMISC 1
274
275/* VXLAN section */
276enum {
277 IFLA_VXLAN_UNSPEC,
278 IFLA_VXLAN_ID,
279 IFLA_VXLAN_GROUP,
280 IFLA_VXLAN_LINK,
281 IFLA_VXLAN_LOCAL,
282 IFLA_VXLAN_TTL,
283 IFLA_VXLAN_TOS,
284 IFLA_VXLAN_LEARNING,
285 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT,
287 IFLA_VXLAN_PORT_RANGE,
288 __IFLA_VXLAN_MAX
289};
290#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
291
292struct ifla_vxlan_port_range {
293 __be16 low;
294 __be16 high;
295};
296
297/* SR-IOV virtual function management section */
298
299enum {
300 IFLA_VF_INFO_UNSPEC,
301 IFLA_VF_INFO,
302 __IFLA_VF_INFO_MAX,
303};
304
305#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
306
307enum {
308 IFLA_VF_UNSPEC,
309 IFLA_VF_MAC, /* Hardware queue specific attributes */
310 IFLA_VF_VLAN,
311 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
312 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
313 __IFLA_VF_MAX,
314};
315
316#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
317
318struct ifla_vf_mac {
319 __u32 vf;
320 __u8 mac[32]; /* MAX_ADDR_LEN */
321};
322
323struct ifla_vf_vlan {
324 __u32 vf;
325 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
326 __u32 qos;
327};
328
329struct ifla_vf_tx_rate {
330 __u32 vf;
331 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
332};
333
334struct ifla_vf_spoofchk {
335 __u32 vf;
336 __u32 setting;
337};
338
339/* VF ports management section
340 *
341 * Nested layout of set/get msg is:
342 *
343 * [IFLA_NUM_VF]
344 * [IFLA_VF_PORTS]
345 * [IFLA_VF_PORT]
346 * [IFLA_PORT_*], ...
347 * [IFLA_VF_PORT]
348 * [IFLA_PORT_*], ...
349 * ...
350 * [IFLA_PORT_SELF]
351 * [IFLA_PORT_*], ...
352 */
353
354enum {
355 IFLA_VF_PORT_UNSPEC,
356 IFLA_VF_PORT, /* nest */
357 __IFLA_VF_PORT_MAX,
358};
359
360#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
361
362enum {
363 IFLA_PORT_UNSPEC,
364 IFLA_PORT_VF, /* __u32 */
365 IFLA_PORT_PROFILE, /* string */
366 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
367 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
368 IFLA_PORT_HOST_UUID, /* binary UUID */
369 IFLA_PORT_REQUEST, /* __u8 */
370 IFLA_PORT_RESPONSE, /* __u16, output only */
371 __IFLA_PORT_MAX,
372};
373
374#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
375
376#define PORT_PROFILE_MAX 40
377#define PORT_UUID_MAX 16
378#define PORT_SELF_VF -1
379
380enum {
381 PORT_REQUEST_PREASSOCIATE = 0,
382 PORT_REQUEST_PREASSOCIATE_RR,
383 PORT_REQUEST_ASSOCIATE,
384 PORT_REQUEST_DISASSOCIATE,
385};
386
387enum {
388 PORT_VDP_RESPONSE_SUCCESS = 0,
389 PORT_VDP_RESPONSE_INVALID_FORMAT,
390 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
391 PORT_VDP_RESPONSE_UNUSED_VTID,
392 PORT_VDP_RESPONSE_VTID_VIOLATION,
393 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
394 PORT_VDP_RESPONSE_OUT_OF_SYNC,
395 /* 0x08-0xFF reserved for future VDP use */
396 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
397 PORT_PROFILE_RESPONSE_INPROGRESS,
398 PORT_PROFILE_RESPONSE_INVALID,
399 PORT_PROFILE_RESPONSE_BADSTATE,
400 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
401 PORT_PROFILE_RESPONSE_ERROR,
402};
403
404struct ifla_port_vsi {
405 __u8 vsi_mgr_id;
406 __u8 vsi_type_id[3];
407 __u8 vsi_type_version;
408 __u8 pad[3];
409};
410
411
412/* IPoIB section */
413
414enum {
415 IFLA_IPOIB_UNSPEC,
416 IFLA_IPOIB_PKEY,
417 IFLA_IPOIB_MODE,
418 IFLA_IPOIB_UMCAST,
419 __IFLA_IPOIB_MAX
420};
421
422enum {
423 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
424 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
425};
426
427#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
428
429#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
index 00000000000..b92c1fb6ac1
--- /dev/null
+++ b/include/uapi/linux/if_ltalk.h
@@ -0,0 +1,9 @@
1#ifndef _UAPI__LINUX_LTALK_H
2#define _UAPI__LINUX_LTALK_H
3
4#define LTALK_HLEN 1
5#define LTALK_MTU 600
6#define LTALK_ALEN 1
7
8
9#endif /* _UAPI__LINUX_LTALK_H */
diff --git a/include/linux/if_packet.h b/include/uapi/linux/if_packet.h
index f3799295d23..f3799295d23 100644
--- a/include/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
diff --git a/include/uapi/linux/if_phonet.h b/include/uapi/linux/if_phonet.h
new file mode 100644
index 00000000000..f7ad9e24eb3
--- /dev/null
+++ b/include/uapi/linux/if_phonet.h
@@ -0,0 +1,16 @@
1/*
2 * File: if_phonet.h
3 *
4 * Phonet interface kernel definitions
5 *
6 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
7 */
8#ifndef _UAPILINUX_IF_PHONET_H
9#define _UAPILINUX_IF_PHONET_H
10
11#define PHONET_MIN_MTU 6 /* pn_length = 0 */
12#define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */
13#define PHONET_DEV_MTU PHONET_MAX_MTU
14
15
16#endif /* _UAPILINUX_IF_PHONET_H */
diff --git a/include/linux/if_plip.h b/include/uapi/linux/if_plip.h
index 6298c7e88b2..6298c7e88b2 100644
--- a/include/linux/if_plip.h
+++ b/include/uapi/linux/if_plip.h
diff --git a/include/linux/if_ppp.h b/include/uapi/linux/if_ppp.h
index 9048fabb7a4..9048fabb7a4 100644
--- a/include/linux/if_ppp.h
+++ b/include/uapi/linux/if_ppp.h
diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
new file mode 100644
index 00000000000..163e8adac2d
--- /dev/null
+++ b/include/uapi/linux/if_pppol2tp.h
@@ -0,0 +1,104 @@
1/***************************************************************************
2 * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
3 *
4 * This file supplies definitions required by the PPP over L2TP driver
5 * (l2tp_ppp.c). All version information wrt this file is located in l2tp_ppp.c
6 *
7 * License:
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 */
14
15#ifndef _UAPI__LINUX_IF_PPPOL2TP_H
16#define _UAPI__LINUX_IF_PPPOL2TP_H
17
18#include <linux/types.h>
19
20
21/* Structure used to connect() the socket to a particular tunnel UDP
22 * socket over IPv4.
23 */
24struct pppol2tp_addr {
25 __kernel_pid_t pid; /* pid that owns the fd.
26 * 0 => current */
27 int fd; /* FD of UDP socket to use */
28
29 struct sockaddr_in addr; /* IP address and port to send to */
30
31 __u16 s_tunnel, s_session; /* For matching incoming packets */
32 __u16 d_tunnel, d_session; /* For sending outgoing packets */
33};
34
35/* Structure used to connect() the socket to a particular tunnel UDP
36 * socket over IPv6.
37 */
38struct pppol2tpin6_addr {
39 __kernel_pid_t pid; /* pid that owns the fd.
40 * 0 => current */
41 int fd; /* FD of UDP socket to use */
42
43 __u16 s_tunnel, s_session; /* For matching incoming packets */
44 __u16 d_tunnel, d_session; /* For sending outgoing packets */
45
46 struct sockaddr_in6 addr; /* IP address and port to send to */
47};
48
49/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
50 * bits. So we need a different sockaddr structure.
51 */
52struct pppol2tpv3_addr {
53 __kernel_pid_t pid; /* pid that owns the fd.
54 * 0 => current */
55 int fd; /* FD of UDP or IP socket to use */
56
57 struct sockaddr_in addr; /* IP address and port to send to */
58
59 __u32 s_tunnel, s_session; /* For matching incoming packets */
60 __u32 d_tunnel, d_session; /* For sending outgoing packets */
61};
62
63struct pppol2tpv3in6_addr {
64 __kernel_pid_t pid; /* pid that owns the fd.
65 * 0 => current */
66 int fd; /* FD of UDP or IP socket to use */
67
68 __u32 s_tunnel, s_session; /* For matching incoming packets */
69 __u32 d_tunnel, d_session; /* For sending outgoing packets */
70
71 struct sockaddr_in6 addr; /* IP address and port to send to */
72};
73
74/* Socket options:
75 * DEBUG - bitmask of debug message categories
76 * SENDSEQ - 0 => don't send packets with sequence numbers
77 * 1 => send packets with sequence numbers
78 * RECVSEQ - 0 => receive packet sequence numbers are optional
79 * 1 => drop receive packets without sequence numbers
80 * LNSMODE - 0 => act as LAC.
81 * 1 => act as LNS.
82 * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
83 */
84enum {
85 PPPOL2TP_SO_DEBUG = 1,
86 PPPOL2TP_SO_RECVSEQ = 2,
87 PPPOL2TP_SO_SENDSEQ = 3,
88 PPPOL2TP_SO_LNSMODE = 4,
89 PPPOL2TP_SO_REORDERTO = 5,
90};
91
92/* Debug message categories for the DEBUG socket option */
93enum {
94 PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
95 * compiled in) */
96 PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
97 * interface */
98 PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
99 PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
100};
101
102
103
104#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
index 00000000000..0b46fd57c8f
--- /dev/null
+++ b/include/uapi/linux/if_pppox.h
@@ -0,0 +1,156 @@
1/***************************************************************************
2 * Linux PPP over X - Generic PPP transport layer sockets
3 * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
4 *
5 * This file supplies definitions required by the PPP over Ethernet driver
6 * (pppox.c). All version information wrt this file is located in pppox.c
7 *
8 * License:
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16#ifndef _UAPI__LINUX_IF_PPPOX_H
17#define _UAPI__LINUX_IF_PPPOX_H
18
19
20#include <linux/types.h>
21#include <asm/byteorder.h>
22
23#include <linux/socket.h>
24#include <linux/if_ether.h>
25#include <linux/if_pppol2tp.h>
26
27/* For user-space programs to pick up these definitions
28 * which they wouldn't get otherwise without defining __KERNEL__
29 */
30#ifndef AF_PPPOX
31#define AF_PPPOX 24
32#define PF_PPPOX AF_PPPOX
33#endif /* !(AF_PPPOX) */
34
35/************************************************************************
36 * PPPoE addressing definition
37 */
38typedef __be16 sid_t;
39struct pppoe_addr {
40 sid_t sid; /* Session identifier */
41 unsigned char remote[ETH_ALEN]; /* Remote address */
42 char dev[IFNAMSIZ]; /* Local device to use */
43};
44
45/************************************************************************
46 * PPTP addressing definition
47 */
48struct pptp_addr {
49 __be16 call_id;
50 struct in_addr sin_addr;
51};
52
53/************************************************************************
54 * Protocols supported by AF_PPPOX
55 */
56#define PX_PROTO_OE 0 /* Currently just PPPoE */
57#define PX_PROTO_OL2TP 1 /* Now L2TP also */
58#define PX_PROTO_PPTP 2
59#define PX_MAX_PROTO 3
60
61struct sockaddr_pppox {
62 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
63 unsigned int sa_protocol; /* protocol identifier */
64 union {
65 struct pppoe_addr pppoe;
66 struct pptp_addr pptp;
67 } sa_addr;
68} __packed;
69
70/* The use of the above union isn't viable because the size of this
71 * struct must stay fixed over time -- applications use sizeof(struct
72 * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
73 * type instead.
74 */
75struct sockaddr_pppol2tp {
76 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
77 unsigned int sa_protocol; /* protocol identifier */
78 struct pppol2tp_addr pppol2tp;
79} __packed;
80
81struct sockaddr_pppol2tpin6 {
82 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
83 unsigned int sa_protocol; /* protocol identifier */
84 struct pppol2tpin6_addr pppol2tp;
85} __packed;
86
87/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
88 * bits. So we need a different sockaddr structure.
89 */
90struct sockaddr_pppol2tpv3 {
91 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
92 unsigned int sa_protocol; /* protocol identifier */
93 struct pppol2tpv3_addr pppol2tp;
94} __packed;
95
96struct sockaddr_pppol2tpv3in6 {
97 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
98 unsigned int sa_protocol; /* protocol identifier */
99 struct pppol2tpv3in6_addr pppol2tp;
100} __packed;
101
102/*********************************************************************
103 *
104 * ioctl interface for defining forwarding of connections
105 *
106 ********************************************************************/
107
108#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
109#define PPPOEIOCDFWD _IO(0xB1 ,1)
110/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
111
112/* Codes to identify message types */
113#define PADI_CODE 0x09
114#define PADO_CODE 0x07
115#define PADR_CODE 0x19
116#define PADS_CODE 0x65
117#define PADT_CODE 0xa7
118struct pppoe_tag {
119 __be16 tag_type;
120 __be16 tag_len;
121 char tag_data[0];
122} __attribute__ ((packed));
123
124/* Tag identifiers */
125#define PTT_EOL __cpu_to_be16(0x0000)
126#define PTT_SRV_NAME __cpu_to_be16(0x0101)
127#define PTT_AC_NAME __cpu_to_be16(0x0102)
128#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
129#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
130#define PTT_VENDOR __cpu_to_be16(0x0105)
131#define PTT_RELAY_SID __cpu_to_be16(0x0110)
132#define PTT_SRV_ERR __cpu_to_be16(0x0201)
133#define PTT_SYS_ERR __cpu_to_be16(0x0202)
134#define PTT_GEN_ERR __cpu_to_be16(0x0203)
135
136struct pppoe_hdr {
137#if defined(__LITTLE_ENDIAN_BITFIELD)
138 __u8 ver : 4;
139 __u8 type : 4;
140#elif defined(__BIG_ENDIAN_BITFIELD)
141 __u8 type : 4;
142 __u8 ver : 4;
143#else
144#error "Please fix <asm/byteorder.h>"
145#endif
146 __u8 code;
147 __be16 sid;
148 __be16 length;
149 struct pppoe_tag tag[0];
150} __packed;
151
152/* Length of entire PPPoE + PPP header */
153#define PPPOE_SES_HLEN 8
154
155
156#endif /* _UAPI__LINUX_IF_PPPOX_H */
diff --git a/include/linux/if_slip.h b/include/uapi/linux/if_slip.h
index 1eb4e3a8397..1eb4e3a8397 100644
--- a/include/linux/if_slip.h
+++ b/include/uapi/linux/if_slip.h
diff --git a/include/uapi/linux/if_team.h b/include/uapi/linux/if_team.h
new file mode 100644
index 00000000000..7b8fa339de3
--- /dev/null
+++ b/include/uapi/linux/if_team.h
@@ -0,0 +1,107 @@
1/*
2 * include/linux/if_team.h - Network team device driver header
3 * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#ifndef _UAPI_LINUX_IF_TEAM_H_
12#define _UAPI_LINUX_IF_TEAM_H_
13
14
15#define TEAM_STRING_MAX_LEN 32
16
17/**********************************
18 * NETLINK_GENERIC netlink family.
19 **********************************/
20
21enum {
22 TEAM_CMD_NOOP,
23 TEAM_CMD_OPTIONS_SET,
24 TEAM_CMD_OPTIONS_GET,
25 TEAM_CMD_PORT_LIST_GET,
26
27 __TEAM_CMD_MAX,
28 TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
29};
30
31enum {
32 TEAM_ATTR_UNSPEC,
33 TEAM_ATTR_TEAM_IFINDEX, /* u32 */
34 TEAM_ATTR_LIST_OPTION, /* nest */
35 TEAM_ATTR_LIST_PORT, /* nest */
36
37 __TEAM_ATTR_MAX,
38 TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
39};
40
41/* Nested layout of get/set msg:
42 *
43 * [TEAM_ATTR_LIST_OPTION]
44 * [TEAM_ATTR_ITEM_OPTION]
45 * [TEAM_ATTR_OPTION_*], ...
46 * [TEAM_ATTR_ITEM_OPTION]
47 * [TEAM_ATTR_OPTION_*], ...
48 * ...
49 * [TEAM_ATTR_LIST_PORT]
50 * [TEAM_ATTR_ITEM_PORT]
51 * [TEAM_ATTR_PORT_*], ...
52 * [TEAM_ATTR_ITEM_PORT]
53 * [TEAM_ATTR_PORT_*], ...
54 * ...
55 */
56
57enum {
58 TEAM_ATTR_ITEM_OPTION_UNSPEC,
59 TEAM_ATTR_ITEM_OPTION, /* nest */
60
61 __TEAM_ATTR_ITEM_OPTION_MAX,
62 TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
63};
64
65enum {
66 TEAM_ATTR_OPTION_UNSPEC,
67 TEAM_ATTR_OPTION_NAME, /* string */
68 TEAM_ATTR_OPTION_CHANGED, /* flag */
69 TEAM_ATTR_OPTION_TYPE, /* u8 */
70 TEAM_ATTR_OPTION_DATA, /* dynamic */
71 TEAM_ATTR_OPTION_REMOVED, /* flag */
72 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
73 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
74
75 __TEAM_ATTR_OPTION_MAX,
76 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
77};
78
79enum {
80 TEAM_ATTR_ITEM_PORT_UNSPEC,
81 TEAM_ATTR_ITEM_PORT, /* nest */
82
83 __TEAM_ATTR_ITEM_PORT_MAX,
84 TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
85};
86
87enum {
88 TEAM_ATTR_PORT_UNSPEC,
89 TEAM_ATTR_PORT_IFINDEX, /* u32 */
90 TEAM_ATTR_PORT_CHANGED, /* flag */
91 TEAM_ATTR_PORT_LINKUP, /* flag */
92 TEAM_ATTR_PORT_SPEED, /* u32 */
93 TEAM_ATTR_PORT_DUPLEX, /* u8 */
94 TEAM_ATTR_PORT_REMOVED, /* flag */
95
96 __TEAM_ATTR_PORT_MAX,
97 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
98};
99
100/*
101 * NETLINK_GENERIC related info
102 */
103#define TEAM_GENL_NAME "team"
104#define TEAM_GENL_VERSION 0x1
105#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
106
107#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
index 00000000000..25a585ce23e
--- /dev/null
+++ b/include/uapi/linux/if_tun.h
@@ -0,0 +1,94 @@
1/*
2 * Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _UAPI__IF_TUN_H
17#define _UAPI__IF_TUN_H
18
19#include <linux/types.h>
20#include <linux/if_ether.h>
21#include <linux/filter.h>
22
23/* Read queue size */
24#define TUN_READQ_SIZE 500
25
26/* TUN device flags */
27#define TUN_TUN_DEV 0x0001
28#define TUN_TAP_DEV 0x0002
29#define TUN_TYPE_MASK 0x000f
30
31#define TUN_FASYNC 0x0010
32#define TUN_NOCHECKSUM 0x0020
33#define TUN_NO_PI 0x0040
34#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100
36#define TUN_VNET_HDR 0x0200
37
38/* Ioctl defines */
39#define TUNSETNOCSUM _IOW('T', 200, int)
40#define TUNSETDEBUG _IOW('T', 201, int)
41#define TUNSETIFF _IOW('T', 202, int)
42#define TUNSETPERSIST _IOW('T', 203, int)
43#define TUNSETOWNER _IOW('T', 204, int)
44#define TUNSETLINK _IOW('T', 205, int)
45#define TUNSETGROUP _IOW('T', 206, int)
46#define TUNGETFEATURES _IOR('T', 207, unsigned int)
47#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
48#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
49#define TUNGETIFF _IOR('T', 210, unsigned int)
50#define TUNGETSNDBUF _IOR('T', 211, int)
51#define TUNSETSNDBUF _IOW('T', 212, int)
52#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
54#define TUNGETVNETHDRSZ _IOR('T', 215, int)
55#define TUNSETVNETHDRSZ _IOW('T', 216, int)
56
57/* TUNSETIFF ifr flags */
58#define IFF_TUN 0x0001
59#define IFF_TAP 0x0002
60#define IFF_NO_PI 0x1000
61#define IFF_ONE_QUEUE 0x2000
62#define IFF_VNET_HDR 0x4000
63#define IFF_TUN_EXCL 0x8000
64
65/* Features for GSO (TUNSETOFFLOAD). */
66#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
67#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
68#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
69#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
70#define TUN_F_UFO 0x10 /* I can handle UFO packets */
71
72/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
73#define TUN_PKT_STRIP 0x0001
74struct tun_pi {
75 __u16 flags;
76 __be16 proto;
77};
78
79/*
80 * Filter spec (used for SETXXFILTER ioctls)
81 * This stuff is applicable only to the TAP (Ethernet) devices.
82 * If the count is zero the filter is disabled and the driver accepts
83 * all packets (promisc mode).
84 * If the filter is enabled in order to accept broadcast packets
85 * broadcast addr must be explicitly included in the addr list.
86 */
87#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
88struct tun_filter {
89 __u16 flags; /* TUN_FLT_ flags see above */
90 __u16 count; /* Number of addresses */
91 __u8 addr[0][ETH_ALEN];
92};
93
94#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
index 00000000000..5db5942575f
--- /dev/null
+++ b/include/uapi/linux/if_tunnel.h
@@ -0,0 +1,96 @@
1#ifndef _UAPI_IF_TUNNEL_H_
2#define _UAPI_IF_TUNNEL_H_
3
4#include <linux/types.h>
5#include <asm/byteorder.h>
6
7
8#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
9#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
10#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
11#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
12#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
13#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
14#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
15#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
16#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
17#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
18#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
19#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
20
21#define GRE_CSUM __cpu_to_be16(0x8000)
22#define GRE_ROUTING __cpu_to_be16(0x4000)
23#define GRE_KEY __cpu_to_be16(0x2000)
24#define GRE_SEQ __cpu_to_be16(0x1000)
25#define GRE_STRICT __cpu_to_be16(0x0800)
26#define GRE_REC __cpu_to_be16(0x0700)
27#define GRE_FLAGS __cpu_to_be16(0x00F8)
28#define GRE_VERSION __cpu_to_be16(0x0007)
29
30struct ip_tunnel_parm {
31 char name[IFNAMSIZ];
32 int link;
33 __be16 i_flags;
34 __be16 o_flags;
35 __be32 i_key;
36 __be32 o_key;
37 struct iphdr iph;
38};
39
40/* SIT-mode i_flags */
41#define SIT_ISATAP 0x0001
42
43struct ip_tunnel_prl {
44 __be32 addr;
45 __u16 flags;
46 __u16 __reserved;
47 __u32 datalen;
48 __u32 __reserved2;
49 /* data follows */
50};
51
52/* PRL flags */
53#define PRL_DEFAULT 0x0001
54
55struct ip_tunnel_6rd {
56 struct in6_addr prefix;
57 __be32 relay_prefix;
58 __u16 prefixlen;
59 __u16 relay_prefixlen;
60};
61
62enum {
63 IFLA_GRE_UNSPEC,
64 IFLA_GRE_LINK,
65 IFLA_GRE_IFLAGS,
66 IFLA_GRE_OFLAGS,
67 IFLA_GRE_IKEY,
68 IFLA_GRE_OKEY,
69 IFLA_GRE_LOCAL,
70 IFLA_GRE_REMOTE,
71 IFLA_GRE_TTL,
72 IFLA_GRE_TOS,
73 IFLA_GRE_PMTUDISC,
74 IFLA_GRE_ENCAP_LIMIT,
75 IFLA_GRE_FLOWINFO,
76 IFLA_GRE_FLAGS,
77 __IFLA_GRE_MAX,
78};
79
80#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
81
82/* VTI-mode i_flags */
83#define VTI_ISVTI 0x0001
84
85enum {
86 IFLA_VTI_UNSPEC,
87 IFLA_VTI_LINK,
88 IFLA_VTI_IKEY,
89 IFLA_VTI_OKEY,
90 IFLA_VTI_LOCAL,
91 IFLA_VTI_REMOTE,
92 __IFLA_VTI_MAX,
93};
94
95#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
96#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
index 00000000000..0744f8e65d1
--- /dev/null
+++ b/include/uapi/linux/if_vlan.h
@@ -0,0 +1,63 @@
1/*
2 * VLAN An implementation of 802.1Q VLAN tagging.
3 *
4 * Authors: Ben Greear <greearb@candelatech.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#ifndef _UAPI_LINUX_IF_VLAN_H_
14#define _UAPI_LINUX_IF_VLAN_H_
15
16
17/* VLAN IOCTLs are found in sockios.h */
18
19/* Passed in vlan_ioctl_args structure to determine behaviour. */
20enum vlan_ioctl_cmds {
21 ADD_VLAN_CMD,
22 DEL_VLAN_CMD,
23 SET_VLAN_INGRESS_PRIORITY_CMD,
24 SET_VLAN_EGRESS_PRIORITY_CMD,
25 GET_VLAN_INGRESS_PRIORITY_CMD,
26 GET_VLAN_EGRESS_PRIORITY_CMD,
27 SET_VLAN_NAME_TYPE_CMD,
28 SET_VLAN_FLAG_CMD,
29 GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
30 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
31};
32
33enum vlan_flags {
34 VLAN_FLAG_REORDER_HDR = 0x1,
35 VLAN_FLAG_GVRP = 0x2,
36 VLAN_FLAG_LOOSE_BINDING = 0x4,
37};
38
39enum vlan_name_types {
40 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
41 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
42 VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
43 VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
44 VLAN_NAME_TYPE_HIGHEST
45};
46
47struct vlan_ioctl_args {
48 int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
49 char device1[24];
50
51 union {
52 char device2[24];
53 int VID;
54 unsigned int skb_priority;
55 unsigned int name_type;
56 unsigned int bind_type;
57 unsigned int flag; /* Matches vlan_dev_priv flags */
58 } u;
59
60 short vlan_qos;
61};
62
63#endif /* _UAPI_LINUX_IF_VLAN_H_ */
diff --git a/include/linux/if_x25.h b/include/uapi/linux/if_x25.h
index 897765f5feb..897765f5feb 100644
--- a/include/linux/if_x25.h
+++ b/include/uapi/linux/if_x25.h
diff --git a/include/uapi/linux/igmp.h b/include/uapi/linux/igmp.h
new file mode 100644
index 00000000000..ccbb32aa670
--- /dev/null
+++ b/include/uapi/linux/igmp.h
@@ -0,0 +1,128 @@
1/*
2 * Linux NET3: Internet Group Management Protocol [IGMP]
3 *
4 * Authors:
5 * Alan Cox <alan@lxorguk.ukuu.org.uk>
6 *
7 * Extended to talk the BSD extended IGMP protocol of mrouted 3.6
8 *
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#ifndef _UAPI_LINUX_IGMP_H
17#define _UAPI_LINUX_IGMP_H
18
19#include <linux/types.h>
20#include <asm/byteorder.h>
21
22/*
23 * IGMP protocol structures
24 */
25
26/*
27 * Header in on cable format
28 */
29
30struct igmphdr {
31 __u8 type;
32 __u8 code; /* For newer IGMP */
33 __sum16 csum;
34 __be32 group;
35};
36
37/* V3 group record types [grec_type] */
38#define IGMPV3_MODE_IS_INCLUDE 1
39#define IGMPV3_MODE_IS_EXCLUDE 2
40#define IGMPV3_CHANGE_TO_INCLUDE 3
41#define IGMPV3_CHANGE_TO_EXCLUDE 4
42#define IGMPV3_ALLOW_NEW_SOURCES 5
43#define IGMPV3_BLOCK_OLD_SOURCES 6
44
45struct igmpv3_grec {
46 __u8 grec_type;
47 __u8 grec_auxwords;
48 __be16 grec_nsrcs;
49 __be32 grec_mca;
50 __be32 grec_src[0];
51};
52
53struct igmpv3_report {
54 __u8 type;
55 __u8 resv1;
56 __be16 csum;
57 __be16 resv2;
58 __be16 ngrec;
59 struct igmpv3_grec grec[0];
60};
61
62struct igmpv3_query {
63 __u8 type;
64 __u8 code;
65 __be16 csum;
66 __be32 group;
67#if defined(__LITTLE_ENDIAN_BITFIELD)
68 __u8 qrv:3,
69 suppress:1,
70 resv:4;
71#elif defined(__BIG_ENDIAN_BITFIELD)
72 __u8 resv:4,
73 suppress:1,
74 qrv:3;
75#else
76#error "Please fix <asm/byteorder.h>"
77#endif
78 __u8 qqic;
79 __be16 nsrcs;
80 __be32 srcs[0];
81};
82
83#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
84#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
85#define IGMP_DVMRP 0x13 /* DVMRP routing */
86#define IGMP_PIM 0x14 /* PIM routing */
87#define IGMP_TRACE 0x15
88#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */
89#define IGMP_HOST_LEAVE_MESSAGE 0x17
90#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */
91
92#define IGMP_MTRACE_RESP 0x1e
93#define IGMP_MTRACE 0x1f
94
95
96/*
97 * Use the BSD names for these for compatibility
98 */
99
100#define IGMP_DELAYING_MEMBER 0x01
101#define IGMP_IDLE_MEMBER 0x02
102#define IGMP_LAZY_MEMBER 0x03
103#define IGMP_SLEEPING_MEMBER 0x04
104#define IGMP_AWAKENING_MEMBER 0x05
105
106#define IGMP_MINLEN 8
107
108#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
109 /* query (in seconds) */
110
111#define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */
112 /* specifies time in 10th of seconds */
113
114#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */
115 /* message in this period of time, */
116 /* revert to IGMP v2 router. */
117
118#define IGMP_ALL_HOSTS htonl(0xE0000001L)
119#define IGMP_ALL_ROUTER htonl(0xE0000002L)
120#define IGMPV3_ALL_MCR htonl(0xE0000016L)
121#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
122#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
123
124/*
125 * struct for keeping the multicast list in
126 */
127
128#endif /* _UAPI_LINUX_IGMP_H */
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
new file mode 100644
index 00000000000..9edb441df82
--- /dev/null
+++ b/include/uapi/linux/in.h
@@ -0,0 +1,253 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions of the Internet Protocol.
7 *
8 * Version: @(#)in.h 1.0.1 04/21/93
9 *
10 * Authors: Original taken from the GNU Project <netinet/in.h> file.
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18#ifndef _UAPI_LINUX_IN_H
19#define _UAPI_LINUX_IN_H
20
21#include <linux/types.h>
22#include <linux/socket.h>
23
24/* Standard well-defined IP protocols. */
25enum {
26 IPPROTO_IP = 0, /* Dummy protocol for TCP */
27 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
28 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
29 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
30 IPPROTO_TCP = 6, /* Transmission Control Protocol */
31 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
32 IPPROTO_PUP = 12, /* PUP protocol */
33 IPPROTO_UDP = 17, /* User Datagram Protocol */
34 IPPROTO_IDP = 22, /* XNS IDP protocol */
35 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
36 IPPROTO_RSVP = 46, /* RSVP protocol */
37 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
38
39 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
40
41 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
42 IPPROTO_AH = 51, /* Authentication Header protocol */
43 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
44 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
45
46 IPPROTO_COMP = 108, /* Compression Header protocol */
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
49
50 IPPROTO_RAW = 255, /* Raw IP packets */
51 IPPROTO_MAX
52};
53
54
55/* Internet address. */
56struct in_addr {
57 __be32 s_addr;
58};
59
60#define IP_TOS 1
61#define IP_TTL 2
62#define IP_HDRINCL 3
63#define IP_OPTIONS 4
64#define IP_ROUTER_ALERT 5
65#define IP_RECVOPTS 6
66#define IP_RETOPTS 7
67#define IP_PKTINFO 8
68#define IP_PKTOPTIONS 9
69#define IP_MTU_DISCOVER 10
70#define IP_RECVERR 11
71#define IP_RECVTTL 12
72#define IP_RECVTOS 13
73#define IP_MTU 14
74#define IP_FREEBIND 15
75#define IP_IPSEC_POLICY 16
76#define IP_XFRM_POLICY 17
77#define IP_PASSSEC 18
78#define IP_TRANSPARENT 19
79
80/* BSD compatibility */
81#define IP_RECVRETOPTS IP_RETOPTS
82
83/* TProxy original addresses */
84#define IP_ORIGDSTADDR 20
85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
86
87#define IP_MINTTL 21
88#define IP_NODEFRAG 22
89
90/* IP_MTU_DISCOVER values */
91#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
92#define IP_PMTUDISC_WANT 1 /* Use per route hints */
93#define IP_PMTUDISC_DO 2 /* Always DF */
94#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */
95
96#define IP_MULTICAST_IF 32
97#define IP_MULTICAST_TTL 33
98#define IP_MULTICAST_LOOP 34
99#define IP_ADD_MEMBERSHIP 35
100#define IP_DROP_MEMBERSHIP 36
101#define IP_UNBLOCK_SOURCE 37
102#define IP_BLOCK_SOURCE 38
103#define IP_ADD_SOURCE_MEMBERSHIP 39
104#define IP_DROP_SOURCE_MEMBERSHIP 40
105#define IP_MSFILTER 41
106#define MCAST_JOIN_GROUP 42
107#define MCAST_BLOCK_SOURCE 43
108#define MCAST_UNBLOCK_SOURCE 44
109#define MCAST_LEAVE_GROUP 45
110#define MCAST_JOIN_SOURCE_GROUP 46
111#define MCAST_LEAVE_SOURCE_GROUP 47
112#define MCAST_MSFILTER 48
113#define IP_MULTICAST_ALL 49
114#define IP_UNICAST_IF 50
115
116#define MCAST_EXCLUDE 0
117#define MCAST_INCLUDE 1
118
119/* These need to appear somewhere around here */
120#define IP_DEFAULT_MULTICAST_TTL 1
121#define IP_DEFAULT_MULTICAST_LOOP 1
122
123/* Request struct for multicast socket ops */
124
125struct ip_mreq {
126 struct in_addr imr_multiaddr; /* IP multicast address of group */
127 struct in_addr imr_interface; /* local IP address of interface */
128};
129
130struct ip_mreqn {
131 struct in_addr imr_multiaddr; /* IP multicast address of group */
132 struct in_addr imr_address; /* local IP address of interface */
133 int imr_ifindex; /* Interface index */
134};
135
136struct ip_mreq_source {
137 __be32 imr_multiaddr;
138 __be32 imr_interface;
139 __be32 imr_sourceaddr;
140};
141
142struct ip_msfilter {
143 __be32 imsf_multiaddr;
144 __be32 imsf_interface;
145 __u32 imsf_fmode;
146 __u32 imsf_numsrc;
147 __be32 imsf_slist[1];
148};
149
150#define IP_MSFILTER_SIZE(numsrc) \
151 (sizeof(struct ip_msfilter) - sizeof(__u32) \
152 + (numsrc) * sizeof(__u32))
153
154struct group_req {
155 __u32 gr_interface; /* interface index */
156 struct __kernel_sockaddr_storage gr_group; /* group address */
157};
158
159struct group_source_req {
160 __u32 gsr_interface; /* interface index */
161 struct __kernel_sockaddr_storage gsr_group; /* group address */
162 struct __kernel_sockaddr_storage gsr_source; /* source address */
163};
164
165struct group_filter {
166 __u32 gf_interface; /* interface index */
167 struct __kernel_sockaddr_storage gf_group; /* multicast address */
168 __u32 gf_fmode; /* filter mode */
169 __u32 gf_numsrc; /* number of sources */
170 struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
171};
172
173#define GROUP_FILTER_SIZE(numsrc) \
174 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
175 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
176
177struct in_pktinfo {
178 int ipi_ifindex;
179 struct in_addr ipi_spec_dst;
180 struct in_addr ipi_addr;
181};
182
183/* Structure describing an Internet (IP) socket address. */
184#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
185struct sockaddr_in {
186 __kernel_sa_family_t sin_family; /* Address family */
187 __be16 sin_port; /* Port number */
188 struct in_addr sin_addr; /* Internet address */
189
190 /* Pad to size of `struct sockaddr'. */
191 unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
192 sizeof(unsigned short int) - sizeof(struct in_addr)];
193};
194#define sin_zero __pad /* for BSD UNIX comp. -FvK */
195
196
197/*
198 * Definitions of the bits in an Internet address integer.
199 * On subnets, host and network parts are found according
200 * to the subnet mask, not these masks.
201 */
202#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
203#define IN_CLASSA_NET 0xff000000
204#define IN_CLASSA_NSHIFT 24
205#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
206#define IN_CLASSA_MAX 128
207
208#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
209#define IN_CLASSB_NET 0xffff0000
210#define IN_CLASSB_NSHIFT 16
211#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
212#define IN_CLASSB_MAX 65536
213
214#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
215#define IN_CLASSC_NET 0xffffff00
216#define IN_CLASSC_NSHIFT 8
217#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
218
219#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
220#define IN_MULTICAST(a) IN_CLASSD(a)
221#define IN_MULTICAST_NET 0xF0000000
222
223#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
224#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
225
226/* Address to accept any incoming messages. */
227#define INADDR_ANY ((unsigned long int) 0x00000000)
228
229/* Address to send to all hosts. */
230#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
231
232/* Address indicating an error return. */
233#define INADDR_NONE ((unsigned long int) 0xffffffff)
234
235/* Network number for local host loopback. */
236#define IN_LOOPBACKNET 127
237
238/* Address to loopback in software to local host. */
239#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
240#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
241
242/* Defines for Multicast INADDR */
243#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
244#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
245#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
246#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
247
248
249/* <asm/byteorder.h> contains the htonl type stuff.. */
250#include <asm/byteorder.h>
251
252
253#endif /* _UAPI_LINUX_IN_H */
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
new file mode 100644
index 00000000000..1e315998995
--- /dev/null
+++ b/include/uapi/linux/in6.h
@@ -0,0 +1,279 @@
1/*
2 * Types and definitions for AF_INET6
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * Sources:
9 * IPv6 Program Interfaces for BSD Systems
10 * <draft-ietf-ipngwg-bsd-api-05.txt>
11 *
12 * Advanced Sockets API for IPv6
13 * <draft-stevens-advanced-api-00.txt>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20
21#ifndef _UAPI_LINUX_IN6_H
22#define _UAPI_LINUX_IN6_H
23
24#include <linux/types.h>
25
26/*
27 * IPv6 address structure
28 */
29
30struct in6_addr {
31 union {
32 __u8 u6_addr8[16];
33 __be16 u6_addr16[8];
34 __be32 u6_addr32[4];
35 } in6_u;
36#define s6_addr in6_u.u6_addr8
37#define s6_addr16 in6_u.u6_addr16
38#define s6_addr32 in6_u.u6_addr32
39};
40
41/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
42 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
43 * in network byte order, not in host byte order as are the IPv4 equivalents
44 */
45
46struct sockaddr_in6 {
47 unsigned short int sin6_family; /* AF_INET6 */
48 __be16 sin6_port; /* Transport layer port # */
49 __be32 sin6_flowinfo; /* IPv6 flow information */
50 struct in6_addr sin6_addr; /* IPv6 address */
51 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
52};
53
54struct ipv6_mreq {
55 /* IPv6 multicast address of group */
56 struct in6_addr ipv6mr_multiaddr;
57
58 /* local IPv6 address of interface */
59 int ipv6mr_ifindex;
60};
61
62#define ipv6mr_acaddr ipv6mr_multiaddr
63
64struct in6_flowlabel_req {
65 struct in6_addr flr_dst;
66 __be32 flr_label;
67 __u8 flr_action;
68 __u8 flr_share;
69 __u16 flr_flags;
70 __u16 flr_expires;
71 __u16 flr_linger;
72 __u32 __flr_pad;
73 /* Options in format of IPV6_PKTOPTIONS */
74};
75
76#define IPV6_FL_A_GET 0
77#define IPV6_FL_A_PUT 1
78#define IPV6_FL_A_RENEW 2
79
80#define IPV6_FL_F_CREATE 1
81#define IPV6_FL_F_EXCL 2
82
83#define IPV6_FL_S_NONE 0
84#define IPV6_FL_S_EXCL 1
85#define IPV6_FL_S_PROCESS 2
86#define IPV6_FL_S_USER 3
87#define IPV6_FL_S_ANY 255
88
89
90/*
91 * Bitmask constant declarations to help applications select out the
92 * flow label and priority fields.
93 *
94 * Note that this are in host byte order while the flowinfo field of
95 * sockaddr_in6 is in network byte order.
96 */
97
98#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
99#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
100
101/* These definitions are obsolete */
102#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
103#define IPV6_PRIORITY_FILLER 0x0100
104#define IPV6_PRIORITY_UNATTENDED 0x0200
105#define IPV6_PRIORITY_RESERVED1 0x0300
106#define IPV6_PRIORITY_BULK 0x0400
107#define IPV6_PRIORITY_RESERVED2 0x0500
108#define IPV6_PRIORITY_INTERACTIVE 0x0600
109#define IPV6_PRIORITY_CONTROL 0x0700
110#define IPV6_PRIORITY_8 0x0800
111#define IPV6_PRIORITY_9 0x0900
112#define IPV6_PRIORITY_10 0x0a00
113#define IPV6_PRIORITY_11 0x0b00
114#define IPV6_PRIORITY_12 0x0c00
115#define IPV6_PRIORITY_13 0x0d00
116#define IPV6_PRIORITY_14 0x0e00
117#define IPV6_PRIORITY_15 0x0f00
118
119/*
120 * IPV6 extension headers
121 */
122#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
123#define IPPROTO_ROUTING 43 /* IPv6 routing header */
124#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
125#define IPPROTO_ICMPV6 58 /* ICMPv6 */
126#define IPPROTO_NONE 59 /* IPv6 no next header */
127#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
128#define IPPROTO_MH 135 /* IPv6 mobility header */
129
130/*
131 * IPv6 TLV options.
132 */
133#define IPV6_TLV_PAD1 0
134#define IPV6_TLV_PADN 1
135#define IPV6_TLV_ROUTERALERT 5
136#define IPV6_TLV_JUMBO 194
137#define IPV6_TLV_HAO 201 /* home address option */
138
139/*
140 * IPV6 socket options
141 */
142
143#define IPV6_ADDRFORM 1
144#define IPV6_2292PKTINFO 2
145#define IPV6_2292HOPOPTS 3
146#define IPV6_2292DSTOPTS 4
147#define IPV6_2292RTHDR 5
148#define IPV6_2292PKTOPTIONS 6
149#define IPV6_CHECKSUM 7
150#define IPV6_2292HOPLIMIT 8
151#define IPV6_NEXTHOP 9
152#define IPV6_AUTHHDR 10 /* obsolete */
153#define IPV6_FLOWINFO 11
154
155#define IPV6_UNICAST_HOPS 16
156#define IPV6_MULTICAST_IF 17
157#define IPV6_MULTICAST_HOPS 18
158#define IPV6_MULTICAST_LOOP 19
159#define IPV6_ADD_MEMBERSHIP 20
160#define IPV6_DROP_MEMBERSHIP 21
161#define IPV6_ROUTER_ALERT 22
162#define IPV6_MTU_DISCOVER 23
163#define IPV6_MTU 24
164#define IPV6_RECVERR 25
165#define IPV6_V6ONLY 26
166#define IPV6_JOIN_ANYCAST 27
167#define IPV6_LEAVE_ANYCAST 28
168
169/* IPV6_MTU_DISCOVER values */
170#define IPV6_PMTUDISC_DONT 0
171#define IPV6_PMTUDISC_WANT 1
172#define IPV6_PMTUDISC_DO 2
173#define IPV6_PMTUDISC_PROBE 3
174
175/* Flowlabel */
176#define IPV6_FLOWLABEL_MGR 32
177#define IPV6_FLOWINFO_SEND 33
178
179#define IPV6_IPSEC_POLICY 34
180#define IPV6_XFRM_POLICY 35
181
182/*
183 * Multicast:
184 * Following socket options are shared between IPv4 and IPv6.
185 *
186 * MCAST_JOIN_GROUP 42
187 * MCAST_BLOCK_SOURCE 43
188 * MCAST_UNBLOCK_SOURCE 44
189 * MCAST_LEAVE_GROUP 45
190 * MCAST_JOIN_SOURCE_GROUP 46
191 * MCAST_LEAVE_SOURCE_GROUP 47
192 * MCAST_MSFILTER 48
193 */
194
195/*
196 * Advanced API (RFC3542) (1)
197 *
198 * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
199 */
200
201#define IPV6_RECVPKTINFO 49
202#define IPV6_PKTINFO 50
203#define IPV6_RECVHOPLIMIT 51
204#define IPV6_HOPLIMIT 52
205#define IPV6_RECVHOPOPTS 53
206#define IPV6_HOPOPTS 54
207#define IPV6_RTHDRDSTOPTS 55
208#define IPV6_RECVRTHDR 56
209#define IPV6_RTHDR 57
210#define IPV6_RECVDSTOPTS 58
211#define IPV6_DSTOPTS 59
212#define IPV6_RECVPATHMTU 60
213#define IPV6_PATHMTU 61
214#define IPV6_DONTFRAG 62
215#if 0 /* not yet */
216#define IPV6_USE_MIN_MTU 63
217#endif
218
219/*
220 * Netfilter (1)
221 *
222 * Following socket options are used in ip6_tables;
223 * see include/linux/netfilter_ipv6/ip6_tables.h.
224 *
225 * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64
226 * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65
227 */
228
229/*
230 * Advanced API (RFC3542) (2)
231 */
232#define IPV6_RECVTCLASS 66
233#define IPV6_TCLASS 67
234
235/*
236 * Netfilter (2)
237 *
238 * Following socket options are used in ip6_tables;
239 * see include/linux/netfilter_ipv6/ip6_tables.h.
240 *
241 * IP6T_SO_GET_REVISION_MATCH 68
242 * IP6T_SO_GET_REVISION_TARGET 69
243 */
244
245/* RFC5014: Source address selection */
246#define IPV6_ADDR_PREFERENCES 72
247
248#define IPV6_PREFER_SRC_TMP 0x0001
249#define IPV6_PREFER_SRC_PUBLIC 0x0002
250#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
251#define IPV6_PREFER_SRC_COA 0x0004
252#define IPV6_PREFER_SRC_HOME 0x0400
253#define IPV6_PREFER_SRC_CGA 0x0008
254#define IPV6_PREFER_SRC_NONCGA 0x0800
255
256/* RFC5082: Generalized Ttl Security Mechanism */
257#define IPV6_MINHOPCOUNT 73
258
259#define IPV6_ORIGDSTADDR 74
260#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
261#define IPV6_TRANSPARENT 75
262#define IPV6_UNICAST_IF 76
263
264/*
265 * Multicast Routing:
266 * see include/linux/mroute6.h.
267 *
268 * MRT6_INIT 200
269 * MRT6_DONE 201
270 * MRT6_ADD_MIF 202
271 * MRT6_DEL_MIF 203
272 * MRT6_ADD_MFC 204
273 * MRT6_DEL_MFC 205
274 * MRT6_VERSION 206
275 * MRT6_ASSERT 207
276 * MRT6_PIM 208
277 * (reserved) 209
278 */
279#endif /* _UAPI_LINUX_IN6_H */
diff --git a/include/linux/in_route.h b/include/uapi/linux/in_route.h
index b261b8c915f..b261b8c915f 100644
--- a/include/linux/in_route.h
+++ b/include/uapi/linux/in_route.h
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
new file mode 100644
index 00000000000..8c469af939a
--- /dev/null
+++ b/include/uapi/linux/inet_diag.h
@@ -0,0 +1,136 @@
1#ifndef _UAPI_INET_DIAG_H_
2#define _UAPI_INET_DIAG_H_
3
4#include <linux/types.h>
5
6/* Just some random number */
7#define TCPDIAG_GETSOCK 18
8#define DCCPDIAG_GETSOCK 19
9
10#define INET_DIAG_GETSOCK_MAX 24
11
12/* Socket identity */
13struct inet_diag_sockid {
14 __be16 idiag_sport;
15 __be16 idiag_dport;
16 __be32 idiag_src[4];
17 __be32 idiag_dst[4];
18 __u32 idiag_if;
19 __u32 idiag_cookie[2];
20#define INET_DIAG_NOCOOKIE (~0U)
21};
22
23/* Request structure */
24
25struct inet_diag_req {
26 __u8 idiag_family; /* Family of addresses. */
27 __u8 idiag_src_len;
28 __u8 idiag_dst_len;
29 __u8 idiag_ext; /* Query extended information */
30
31 struct inet_diag_sockid id;
32
33 __u32 idiag_states; /* States to dump */
34 __u32 idiag_dbs; /* Tables to dump (NI) */
35};
36
37struct inet_diag_req_v2 {
38 __u8 sdiag_family;
39 __u8 sdiag_protocol;
40 __u8 idiag_ext;
41 __u8 pad;
42 __u32 idiag_states;
43 struct inet_diag_sockid id;
44};
45
46enum {
47 INET_DIAG_REQ_NONE,
48 INET_DIAG_REQ_BYTECODE,
49};
50
51#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
52
53/* Bytecode is sequence of 4 byte commands followed by variable arguments.
54 * All the commands identified by "code" are conditional jumps forward:
55 * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
56 * length of the command and its arguments.
57 */
58
59struct inet_diag_bc_op {
60 unsigned char code;
61 unsigned char yes;
62 unsigned short no;
63};
64
65enum {
66 INET_DIAG_BC_NOP,
67 INET_DIAG_BC_JMP,
68 INET_DIAG_BC_S_GE,
69 INET_DIAG_BC_S_LE,
70 INET_DIAG_BC_D_GE,
71 INET_DIAG_BC_D_LE,
72 INET_DIAG_BC_AUTO,
73 INET_DIAG_BC_S_COND,
74 INET_DIAG_BC_D_COND,
75};
76
77struct inet_diag_hostcond {
78 __u8 family;
79 __u8 prefix_len;
80 int port;
81 __be32 addr[0];
82};
83
84/* Base info structure. It contains socket identity (addrs/ports/cookie)
85 * and, alas, the information shown by netstat. */
86struct inet_diag_msg {
87 __u8 idiag_family;
88 __u8 idiag_state;
89 __u8 idiag_timer;
90 __u8 idiag_retrans;
91
92 struct inet_diag_sockid id;
93
94 __u32 idiag_expires;
95 __u32 idiag_rqueue;
96 __u32 idiag_wqueue;
97 __u32 idiag_uid;
98 __u32 idiag_inode;
99};
100
101/* Extensions */
102
103enum {
104 INET_DIAG_NONE,
105 INET_DIAG_MEMINFO,
106 INET_DIAG_INFO,
107 INET_DIAG_VEGASINFO,
108 INET_DIAG_CONG,
109 INET_DIAG_TOS,
110 INET_DIAG_TCLASS,
111 INET_DIAG_SKMEMINFO,
112};
113
114#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
115
116
117/* INET_DIAG_MEM */
118
119struct inet_diag_meminfo {
120 __u32 idiag_rmem;
121 __u32 idiag_wmem;
122 __u32 idiag_fmem;
123 __u32 idiag_tmem;
124};
125
126/* INET_DIAG_VEGASINFO */
127
128struct tcpvegas_info {
129 __u32 tcpv_enabled;
130 __u32 tcpv_rttcnt;
131 __u32 tcpv_rtt;
132 __u32 tcpv_minrtt;
133};
134
135
136#endif /* _UAPI_INET_DIAG_H_ */
diff --git a/include/uapi/linux/inotify.h b/include/uapi/linux/inotify.h
new file mode 100644
index 00000000000..e6bf35b2dd3
--- /dev/null
+++ b/include/uapi/linux/inotify.h
@@ -0,0 +1,74 @@
1/*
2 * Inode based directory notification for Linux
3 *
4 * Copyright (C) 2005 John McCutchan
5 */
6
7#ifndef _UAPI_LINUX_INOTIFY_H
8#define _UAPI_LINUX_INOTIFY_H
9
10/* For O_CLOEXEC and O_NONBLOCK */
11#include <linux/fcntl.h>
12#include <linux/types.h>
13
14/*
15 * struct inotify_event - structure read from the inotify device for each event
16 *
17 * When you are watching a directory, you will receive the filename for events
18 * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
19 */
20struct inotify_event {
21 __s32 wd; /* watch descriptor */
22 __u32 mask; /* watch mask */
23 __u32 cookie; /* cookie to synchronize two events */
24 __u32 len; /* length (including nulls) of name */
25 char name[0]; /* stub for possible name */
26};
27
28/* the following are legal, implemented events that user-space can watch for */
29#define IN_ACCESS 0x00000001 /* File was accessed */
30#define IN_MODIFY 0x00000002 /* File was modified */
31#define IN_ATTRIB 0x00000004 /* Metadata changed */
32#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
33#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
34#define IN_OPEN 0x00000020 /* File was opened */
35#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
36#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
37#define IN_CREATE 0x00000100 /* Subfile was created */
38#define IN_DELETE 0x00000200 /* Subfile was deleted */
39#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
40#define IN_MOVE_SELF 0x00000800 /* Self was moved */
41
42/* the following are legal events. they are sent as needed to any watch */
43#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
44#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
45#define IN_IGNORED 0x00008000 /* File was ignored */
46
47/* helper events */
48#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
49#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
50
51/* special flags */
52#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
53#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
54#define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */
55#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
56#define IN_ISDIR 0x40000000 /* event occurred against dir */
57#define IN_ONESHOT 0x80000000 /* only send event once */
58
59/*
60 * All of the events - we build the list by hand so that we can add flags in
61 * the future and not break backward compatibility. Apps will get only the
62 * events that they originally wanted. Be sure to add new events here!
63 */
64#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
65 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
66 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
67 IN_MOVE_SELF)
68
69/* Flags for sys_inotify_init1. */
70#define IN_CLOEXEC O_CLOEXEC
71#define IN_NONBLOCK O_NONBLOCK
72
73
74#endif /* _UAPI_LINUX_INOTIFY_H */
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
new file mode 100644
index 00000000000..558828590a6
--- /dev/null
+++ b/include/uapi/linux/input.h
@@ -0,0 +1,1153 @@
1/*
2 * Copyright (c) 1999-2002 Vojtech Pavlik
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published by
6 * the Free Software Foundation.
7 */
8#ifndef _UAPI_INPUT_H
9#define _UAPI_INPUT_H
10
11
12#ifndef __KERNEL__
13#include <sys/time.h>
14#include <sys/ioctl.h>
15#include <sys/types.h>
16#include <linux/types.h>
17#endif
18
19
20/*
21 * The event structure itself
22 */
23
24struct input_event {
25 struct timeval time;
26 __u16 type;
27 __u16 code;
28 __s32 value;
29};
30
31/*
32 * Protocol version.
33 */
34
35#define EV_VERSION 0x010001
36
37/*
38 * IOCTLs (0x00 - 0x7f)
39 */
40
41struct input_id {
42 __u16 bustype;
43 __u16 vendor;
44 __u16 product;
45 __u16 version;
46};
47
48/**
49 * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls
50 * @value: latest reported value for the axis.
51 * @minimum: specifies minimum value for the axis.
52 * @maximum: specifies maximum value for the axis.
53 * @fuzz: specifies fuzz value that is used to filter noise from
54 * the event stream.
55 * @flat: values that are within this value will be discarded by
56 * joydev interface and reported as 0 instead.
57 * @resolution: specifies resolution for the values reported for
58 * the axis.
59 *
60 * Note that input core does not clamp reported values to the
61 * [minimum, maximum] limits, such task is left to userspace.
62 *
63 * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in
64 * units per millimeter (units/mm), resolution for rotational axes
65 * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
66 */
67struct input_absinfo {
68 __s32 value;
69 __s32 minimum;
70 __s32 maximum;
71 __s32 fuzz;
72 __s32 flat;
73 __s32 resolution;
74};
75
76/**
77 * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
78 * @scancode: scancode represented in machine-endian form.
79 * @len: length of the scancode that resides in @scancode buffer.
80 * @index: index in the keymap, may be used instead of scancode
81 * @flags: allows to specify how kernel should handle the request. For
82 * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
83 * should perform lookup in keymap by @index instead of @scancode
84 * @keycode: key code assigned to this scancode
85 *
86 * The structure is used to retrieve and modify keymap data. Users have
87 * option of performing lookup either by @scancode itself or by @index
88 * in keymap entry. EVIOCGKEYCODE will also return scancode or index
89 * (depending on which element was used to perform lookup).
90 */
91struct input_keymap_entry {
92#define INPUT_KEYMAP_BY_INDEX (1 << 0)
93 __u8 flags;
94 __u8 len;
95 __u16 index;
96 __u32 keycode;
97 __u8 scancode[32];
98};
99
100#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
101#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
102#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
103#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
104
105#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
106#define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry)
107#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
108#define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry)
109
110#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
111#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
112#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
113#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */
114
115/**
116 * EVIOCGMTSLOTS(len) - get MT slot values
117 * @len: size of the data buffer in bytes
118 *
119 * The ioctl buffer argument should be binary equivalent to
120 *
121 * struct input_mt_request_layout {
122 * __u32 code;
123 * __s32 values[num_slots];
124 * };
125 *
126 * where num_slots is the (arbitrary) number of MT slots to extract.
127 *
128 * The ioctl size argument (len) is the size of the buffer, which
129 * should satisfy len = (num_slots + 1) * sizeof(__s32). If len is
130 * too small to fit all available slots, the first num_slots are
131 * returned.
132 *
133 * Before the call, code is set to the wanted ABS_MT event type. On
134 * return, values[] is filled with the slot values for the specified
135 * ABS_MT code.
136 *
137 * If the request code is not an ABS_MT value, -EINVAL is returned.
138 */
139#define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len)
140
141#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
142#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
143#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
144#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
145
146#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */
147#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */
148#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */
149
150#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
151#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
152#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
153
154#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
155
156#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */
157
158/*
159 * Device properties and quirks
160 */
161
162#define INPUT_PROP_POINTER 0x00 /* needs a pointer */
163#define INPUT_PROP_DIRECT 0x01 /* direct input devices */
164#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */
165#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */
166
167#define INPUT_PROP_MAX 0x1f
168#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
169
170/*
171 * Event types
172 */
173
174#define EV_SYN 0x00
175#define EV_KEY 0x01
176#define EV_REL 0x02
177#define EV_ABS 0x03
178#define EV_MSC 0x04
179#define EV_SW 0x05
180#define EV_LED 0x11
181#define EV_SND 0x12
182#define EV_REP 0x14
183#define EV_FF 0x15
184#define EV_PWR 0x16
185#define EV_FF_STATUS 0x17
186#define EV_MAX 0x1f
187#define EV_CNT (EV_MAX+1)
188
189/*
190 * Synchronization events.
191 */
192
193#define SYN_REPORT 0
194#define SYN_CONFIG 1
195#define SYN_MT_REPORT 2
196#define SYN_DROPPED 3
197
198/*
199 * Keys and buttons
200 *
201 * Most of the keys/buttons are modeled after USB HUT 1.12
202 * (see http://www.usb.org/developers/hidpage).
203 * Abbreviations in the comments:
204 * AC - Application Control
205 * AL - Application Launch Button
206 * SC - System Control
207 */
208
209#define KEY_RESERVED 0
210#define KEY_ESC 1
211#define KEY_1 2
212#define KEY_2 3
213#define KEY_3 4
214#define KEY_4 5
215#define KEY_5 6
216#define KEY_6 7
217#define KEY_7 8
218#define KEY_8 9
219#define KEY_9 10
220#define KEY_0 11
221#define KEY_MINUS 12
222#define KEY_EQUAL 13
223#define KEY_BACKSPACE 14
224#define KEY_TAB 15
225#define KEY_Q 16
226#define KEY_W 17
227#define KEY_E 18
228#define KEY_R 19
229#define KEY_T 20
230#define KEY_Y 21
231#define KEY_U 22
232#define KEY_I 23
233#define KEY_O 24
234#define KEY_P 25
235#define KEY_LEFTBRACE 26
236#define KEY_RIGHTBRACE 27
237#define KEY_ENTER 28
238#define KEY_LEFTCTRL 29
239#define KEY_A 30
240#define KEY_S 31
241#define KEY_D 32
242#define KEY_F 33
243#define KEY_G 34
244#define KEY_H 35
245#define KEY_J 36
246#define KEY_K 37
247#define KEY_L 38
248#define KEY_SEMICOLON 39
249#define KEY_APOSTROPHE 40
250#define KEY_GRAVE 41
251#define KEY_LEFTSHIFT 42
252#define KEY_BACKSLASH 43
253#define KEY_Z 44
254#define KEY_X 45
255#define KEY_C 46
256#define KEY_V 47
257#define KEY_B 48
258#define KEY_N 49
259#define KEY_M 50
260#define KEY_COMMA 51
261#define KEY_DOT 52
262#define KEY_SLASH 53
263#define KEY_RIGHTSHIFT 54
264#define KEY_KPASTERISK 55
265#define KEY_LEFTALT 56
266#define KEY_SPACE 57
267#define KEY_CAPSLOCK 58
268#define KEY_F1 59
269#define KEY_F2 60
270#define KEY_F3 61
271#define KEY_F4 62
272#define KEY_F5 63
273#define KEY_F6 64
274#define KEY_F7 65
275#define KEY_F8 66
276#define KEY_F9 67
277#define KEY_F10 68
278#define KEY_NUMLOCK 69
279#define KEY_SCROLLLOCK 70
280#define KEY_KP7 71
281#define KEY_KP8 72
282#define KEY_KP9 73
283#define KEY_KPMINUS 74
284#define KEY_KP4 75
285#define KEY_KP5 76
286#define KEY_KP6 77
287#define KEY_KPPLUS 78
288#define KEY_KP1 79
289#define KEY_KP2 80
290#define KEY_KP3 81
291#define KEY_KP0 82
292#define KEY_KPDOT 83
293
294#define KEY_ZENKAKUHANKAKU 85
295#define KEY_102ND 86
296#define KEY_F11 87
297#define KEY_F12 88
298#define KEY_RO 89
299#define KEY_KATAKANA 90
300#define KEY_HIRAGANA 91
301#define KEY_HENKAN 92
302#define KEY_KATAKANAHIRAGANA 93
303#define KEY_MUHENKAN 94
304#define KEY_KPJPCOMMA 95
305#define KEY_KPENTER 96
306#define KEY_RIGHTCTRL 97
307#define KEY_KPSLASH 98
308#define KEY_SYSRQ 99
309#define KEY_RIGHTALT 100
310#define KEY_LINEFEED 101
311#define KEY_HOME 102
312#define KEY_UP 103
313#define KEY_PAGEUP 104
314#define KEY_LEFT 105
315#define KEY_RIGHT 106
316#define KEY_END 107
317#define KEY_DOWN 108
318#define KEY_PAGEDOWN 109
319#define KEY_INSERT 110
320#define KEY_DELETE 111
321#define KEY_MACRO 112
322#define KEY_MUTE 113
323#define KEY_VOLUMEDOWN 114
324#define KEY_VOLUMEUP 115
325#define KEY_POWER 116 /* SC System Power Down */
326#define KEY_KPEQUAL 117
327#define KEY_KPPLUSMINUS 118
328#define KEY_PAUSE 119
329#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
330
331#define KEY_KPCOMMA 121
332#define KEY_HANGEUL 122
333#define KEY_HANGUEL KEY_HANGEUL
334#define KEY_HANJA 123
335#define KEY_YEN 124
336#define KEY_LEFTMETA 125
337#define KEY_RIGHTMETA 126
338#define KEY_COMPOSE 127
339
340#define KEY_STOP 128 /* AC Stop */
341#define KEY_AGAIN 129
342#define KEY_PROPS 130 /* AC Properties */
343#define KEY_UNDO 131 /* AC Undo */
344#define KEY_FRONT 132
345#define KEY_COPY 133 /* AC Copy */
346#define KEY_OPEN 134 /* AC Open */
347#define KEY_PASTE 135 /* AC Paste */
348#define KEY_FIND 136 /* AC Search */
349#define KEY_CUT 137 /* AC Cut */
350#define KEY_HELP 138 /* AL Integrated Help Center */
351#define KEY_MENU 139 /* Menu (show menu) */
352#define KEY_CALC 140 /* AL Calculator */
353#define KEY_SETUP 141
354#define KEY_SLEEP 142 /* SC System Sleep */
355#define KEY_WAKEUP 143 /* System Wake Up */
356#define KEY_FILE 144 /* AL Local Machine Browser */
357#define KEY_SENDFILE 145
358#define KEY_DELETEFILE 146
359#define KEY_XFER 147
360#define KEY_PROG1 148
361#define KEY_PROG2 149
362#define KEY_WWW 150 /* AL Internet Browser */
363#define KEY_MSDOS 151
364#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
365#define KEY_SCREENLOCK KEY_COFFEE
366#define KEY_DIRECTION 153
367#define KEY_CYCLEWINDOWS 154
368#define KEY_MAIL 155
369#define KEY_BOOKMARKS 156 /* AC Bookmarks */
370#define KEY_COMPUTER 157
371#define KEY_BACK 158 /* AC Back */
372#define KEY_FORWARD 159 /* AC Forward */
373#define KEY_CLOSECD 160
374#define KEY_EJECTCD 161
375#define KEY_EJECTCLOSECD 162
376#define KEY_NEXTSONG 163
377#define KEY_PLAYPAUSE 164
378#define KEY_PREVIOUSSONG 165
379#define KEY_STOPCD 166
380#define KEY_RECORD 167
381#define KEY_REWIND 168
382#define KEY_PHONE 169 /* Media Select Telephone */
383#define KEY_ISO 170
384#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
385#define KEY_HOMEPAGE 172 /* AC Home */
386#define KEY_REFRESH 173 /* AC Refresh */
387#define KEY_EXIT 174 /* AC Exit */
388#define KEY_MOVE 175
389#define KEY_EDIT 176
390#define KEY_SCROLLUP 177
391#define KEY_SCROLLDOWN 178
392#define KEY_KPLEFTPAREN 179
393#define KEY_KPRIGHTPAREN 180
394#define KEY_NEW 181 /* AC New */
395#define KEY_REDO 182 /* AC Redo/Repeat */
396
397#define KEY_F13 183
398#define KEY_F14 184
399#define KEY_F15 185
400#define KEY_F16 186
401#define KEY_F17 187
402#define KEY_F18 188
403#define KEY_F19 189
404#define KEY_F20 190
405#define KEY_F21 191
406#define KEY_F22 192
407#define KEY_F23 193
408#define KEY_F24 194
409
410#define KEY_PLAYCD 200
411#define KEY_PAUSECD 201
412#define KEY_PROG3 202
413#define KEY_PROG4 203
414#define KEY_DASHBOARD 204 /* AL Dashboard */
415#define KEY_SUSPEND 205
416#define KEY_CLOSE 206 /* AC Close */
417#define KEY_PLAY 207
418#define KEY_FASTFORWARD 208
419#define KEY_BASSBOOST 209
420#define KEY_PRINT 210 /* AC Print */
421#define KEY_HP 211
422#define KEY_CAMERA 212
423#define KEY_SOUND 213
424#define KEY_QUESTION 214
425#define KEY_EMAIL 215
426#define KEY_CHAT 216
427#define KEY_SEARCH 217
428#define KEY_CONNECT 218
429#define KEY_FINANCE 219 /* AL Checkbook/Finance */
430#define KEY_SPORT 220
431#define KEY_SHOP 221
432#define KEY_ALTERASE 222
433#define KEY_CANCEL 223 /* AC Cancel */
434#define KEY_BRIGHTNESSDOWN 224
435#define KEY_BRIGHTNESSUP 225
436#define KEY_MEDIA 226
437
438#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
439 outputs (Monitor/LCD/TV-out/etc) */
440#define KEY_KBDILLUMTOGGLE 228
441#define KEY_KBDILLUMDOWN 229
442#define KEY_KBDILLUMUP 230
443
444#define KEY_SEND 231 /* AC Send */
445#define KEY_REPLY 232 /* AC Reply */
446#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
447#define KEY_SAVE 234 /* AC Save */
448#define KEY_DOCUMENTS 235
449
450#define KEY_BATTERY 236
451
452#define KEY_BLUETOOTH 237
453#define KEY_WLAN 238
454#define KEY_UWB 239
455
456#define KEY_UNKNOWN 240
457
458#define KEY_VIDEO_NEXT 241 /* drive next video source */
459#define KEY_VIDEO_PREV 242 /* drive previous video source */
460#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
461#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
462#define KEY_DISPLAY_OFF 245 /* display device to off state */
463
464#define KEY_WIMAX 246
465#define KEY_RFKILL 247 /* Key that controls all radios */
466
467#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
468
469/* Code 255 is reserved for special needs of AT keyboard driver */
470
471#define BTN_MISC 0x100
472#define BTN_0 0x100
473#define BTN_1 0x101
474#define BTN_2 0x102
475#define BTN_3 0x103
476#define BTN_4 0x104
477#define BTN_5 0x105
478#define BTN_6 0x106
479#define BTN_7 0x107
480#define BTN_8 0x108
481#define BTN_9 0x109
482
483#define BTN_MOUSE 0x110
484#define BTN_LEFT 0x110
485#define BTN_RIGHT 0x111
486#define BTN_MIDDLE 0x112
487#define BTN_SIDE 0x113
488#define BTN_EXTRA 0x114
489#define BTN_FORWARD 0x115
490#define BTN_BACK 0x116
491#define BTN_TASK 0x117
492
493#define BTN_JOYSTICK 0x120
494#define BTN_TRIGGER 0x120
495#define BTN_THUMB 0x121
496#define BTN_THUMB2 0x122
497#define BTN_TOP 0x123
498#define BTN_TOP2 0x124
499#define BTN_PINKIE 0x125
500#define BTN_BASE 0x126
501#define BTN_BASE2 0x127
502#define BTN_BASE3 0x128
503#define BTN_BASE4 0x129
504#define BTN_BASE5 0x12a
505#define BTN_BASE6 0x12b
506#define BTN_DEAD 0x12f
507
508#define BTN_GAMEPAD 0x130
509#define BTN_A 0x130
510#define BTN_B 0x131
511#define BTN_C 0x132
512#define BTN_X 0x133
513#define BTN_Y 0x134
514#define BTN_Z 0x135
515#define BTN_TL 0x136
516#define BTN_TR 0x137
517#define BTN_TL2 0x138
518#define BTN_TR2 0x139
519#define BTN_SELECT 0x13a
520#define BTN_START 0x13b
521#define BTN_MODE 0x13c
522#define BTN_THUMBL 0x13d
523#define BTN_THUMBR 0x13e
524
525#define BTN_DIGI 0x140
526#define BTN_TOOL_PEN 0x140
527#define BTN_TOOL_RUBBER 0x141
528#define BTN_TOOL_BRUSH 0x142
529#define BTN_TOOL_PENCIL 0x143
530#define BTN_TOOL_AIRBRUSH 0x144
531#define BTN_TOOL_FINGER 0x145
532#define BTN_TOOL_MOUSE 0x146
533#define BTN_TOOL_LENS 0x147
534#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
535#define BTN_TOUCH 0x14a
536#define BTN_STYLUS 0x14b
537#define BTN_STYLUS2 0x14c
538#define BTN_TOOL_DOUBLETAP 0x14d
539#define BTN_TOOL_TRIPLETAP 0x14e
540#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
541
542#define BTN_WHEEL 0x150
543#define BTN_GEAR_DOWN 0x150
544#define BTN_GEAR_UP 0x151
545
546#define KEY_OK 0x160
547#define KEY_SELECT 0x161
548#define KEY_GOTO 0x162
549#define KEY_CLEAR 0x163
550#define KEY_POWER2 0x164
551#define KEY_OPTION 0x165
552#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
553#define KEY_TIME 0x167
554#define KEY_VENDOR 0x168
555#define KEY_ARCHIVE 0x169
556#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
557#define KEY_CHANNEL 0x16b
558#define KEY_FAVORITES 0x16c
559#define KEY_EPG 0x16d
560#define KEY_PVR 0x16e /* Media Select Home */
561#define KEY_MHP 0x16f
562#define KEY_LANGUAGE 0x170
563#define KEY_TITLE 0x171
564#define KEY_SUBTITLE 0x172
565#define KEY_ANGLE 0x173
566#define KEY_ZOOM 0x174
567#define KEY_MODE 0x175
568#define KEY_KEYBOARD 0x176
569#define KEY_SCREEN 0x177
570#define KEY_PC 0x178 /* Media Select Computer */
571#define KEY_TV 0x179 /* Media Select TV */
572#define KEY_TV2 0x17a /* Media Select Cable */
573#define KEY_VCR 0x17b /* Media Select VCR */
574#define KEY_VCR2 0x17c /* VCR Plus */
575#define KEY_SAT 0x17d /* Media Select Satellite */
576#define KEY_SAT2 0x17e
577#define KEY_CD 0x17f /* Media Select CD */
578#define KEY_TAPE 0x180 /* Media Select Tape */
579#define KEY_RADIO 0x181
580#define KEY_TUNER 0x182 /* Media Select Tuner */
581#define KEY_PLAYER 0x183
582#define KEY_TEXT 0x184
583#define KEY_DVD 0x185 /* Media Select DVD */
584#define KEY_AUX 0x186
585#define KEY_MP3 0x187
586#define KEY_AUDIO 0x188 /* AL Audio Browser */
587#define KEY_VIDEO 0x189 /* AL Movie Browser */
588#define KEY_DIRECTORY 0x18a
589#define KEY_LIST 0x18b
590#define KEY_MEMO 0x18c /* Media Select Messages */
591#define KEY_CALENDAR 0x18d
592#define KEY_RED 0x18e
593#define KEY_GREEN 0x18f
594#define KEY_YELLOW 0x190
595#define KEY_BLUE 0x191
596#define KEY_CHANNELUP 0x192 /* Channel Increment */
597#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
598#define KEY_FIRST 0x194
599#define KEY_LAST 0x195 /* Recall Last */
600#define KEY_AB 0x196
601#define KEY_NEXT 0x197
602#define KEY_RESTART 0x198
603#define KEY_SLOW 0x199
604#define KEY_SHUFFLE 0x19a
605#define KEY_BREAK 0x19b
606#define KEY_PREVIOUS 0x19c
607#define KEY_DIGITS 0x19d
608#define KEY_TEEN 0x19e
609#define KEY_TWEN 0x19f
610#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
611#define KEY_GAMES 0x1a1 /* Media Select Games */
612#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
613#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
614#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
615#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
616#define KEY_EDITOR 0x1a6 /* AL Text Editor */
617#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
618#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
619#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
620#define KEY_DATABASE 0x1aa /* AL Database App */
621#define KEY_NEWS 0x1ab /* AL Newsreader */
622#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
623#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
624#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
625#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
626#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
627#define KEY_LOGOFF 0x1b1 /* AL Logoff */
628
629#define KEY_DOLLAR 0x1b2
630#define KEY_EURO 0x1b3
631
632#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
633#define KEY_FRAMEFORWARD 0x1b5
634#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
635#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
636#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
637#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
638#define KEY_IMAGES 0x1ba /* AL Image Browser */
639
640#define KEY_DEL_EOL 0x1c0
641#define KEY_DEL_EOS 0x1c1
642#define KEY_INS_LINE 0x1c2
643#define KEY_DEL_LINE 0x1c3
644
645#define KEY_FN 0x1d0
646#define KEY_FN_ESC 0x1d1
647#define KEY_FN_F1 0x1d2
648#define KEY_FN_F2 0x1d3
649#define KEY_FN_F3 0x1d4
650#define KEY_FN_F4 0x1d5
651#define KEY_FN_F5 0x1d6
652#define KEY_FN_F6 0x1d7
653#define KEY_FN_F7 0x1d8
654#define KEY_FN_F8 0x1d9
655#define KEY_FN_F9 0x1da
656#define KEY_FN_F10 0x1db
657#define KEY_FN_F11 0x1dc
658#define KEY_FN_F12 0x1dd
659#define KEY_FN_1 0x1de
660#define KEY_FN_2 0x1df
661#define KEY_FN_D 0x1e0
662#define KEY_FN_E 0x1e1
663#define KEY_FN_F 0x1e2
664#define KEY_FN_S 0x1e3
665#define KEY_FN_B 0x1e4
666
667#define KEY_BRL_DOT1 0x1f1
668#define KEY_BRL_DOT2 0x1f2
669#define KEY_BRL_DOT3 0x1f3
670#define KEY_BRL_DOT4 0x1f4
671#define KEY_BRL_DOT5 0x1f5
672#define KEY_BRL_DOT6 0x1f6
673#define KEY_BRL_DOT7 0x1f7
674#define KEY_BRL_DOT8 0x1f8
675#define KEY_BRL_DOT9 0x1f9
676#define KEY_BRL_DOT10 0x1fa
677
678#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
679#define KEY_NUMERIC_1 0x201 /* and other keypads */
680#define KEY_NUMERIC_2 0x202
681#define KEY_NUMERIC_3 0x203
682#define KEY_NUMERIC_4 0x204
683#define KEY_NUMERIC_5 0x205
684#define KEY_NUMERIC_6 0x206
685#define KEY_NUMERIC_7 0x207
686#define KEY_NUMERIC_8 0x208
687#define KEY_NUMERIC_9 0x209
688#define KEY_NUMERIC_STAR 0x20a
689#define KEY_NUMERIC_POUND 0x20b
690
691#define KEY_CAMERA_FOCUS 0x210
692#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
693
694#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */
695#define KEY_TOUCHPAD_ON 0x213
696#define KEY_TOUCHPAD_OFF 0x214
697
698#define KEY_CAMERA_ZOOMIN 0x215
699#define KEY_CAMERA_ZOOMOUT 0x216
700#define KEY_CAMERA_UP 0x217
701#define KEY_CAMERA_DOWN 0x218
702#define KEY_CAMERA_LEFT 0x219
703#define KEY_CAMERA_RIGHT 0x21a
704
705#define BTN_TRIGGER_HAPPY 0x2c0
706#define BTN_TRIGGER_HAPPY1 0x2c0
707#define BTN_TRIGGER_HAPPY2 0x2c1
708#define BTN_TRIGGER_HAPPY3 0x2c2
709#define BTN_TRIGGER_HAPPY4 0x2c3
710#define BTN_TRIGGER_HAPPY5 0x2c4
711#define BTN_TRIGGER_HAPPY6 0x2c5
712#define BTN_TRIGGER_HAPPY7 0x2c6
713#define BTN_TRIGGER_HAPPY8 0x2c7
714#define BTN_TRIGGER_HAPPY9 0x2c8
715#define BTN_TRIGGER_HAPPY10 0x2c9
716#define BTN_TRIGGER_HAPPY11 0x2ca
717#define BTN_TRIGGER_HAPPY12 0x2cb
718#define BTN_TRIGGER_HAPPY13 0x2cc
719#define BTN_TRIGGER_HAPPY14 0x2cd
720#define BTN_TRIGGER_HAPPY15 0x2ce
721#define BTN_TRIGGER_HAPPY16 0x2cf
722#define BTN_TRIGGER_HAPPY17 0x2d0
723#define BTN_TRIGGER_HAPPY18 0x2d1
724#define BTN_TRIGGER_HAPPY19 0x2d2
725#define BTN_TRIGGER_HAPPY20 0x2d3
726#define BTN_TRIGGER_HAPPY21 0x2d4
727#define BTN_TRIGGER_HAPPY22 0x2d5
728#define BTN_TRIGGER_HAPPY23 0x2d6
729#define BTN_TRIGGER_HAPPY24 0x2d7
730#define BTN_TRIGGER_HAPPY25 0x2d8
731#define BTN_TRIGGER_HAPPY26 0x2d9
732#define BTN_TRIGGER_HAPPY27 0x2da
733#define BTN_TRIGGER_HAPPY28 0x2db
734#define BTN_TRIGGER_HAPPY29 0x2dc
735#define BTN_TRIGGER_HAPPY30 0x2dd
736#define BTN_TRIGGER_HAPPY31 0x2de
737#define BTN_TRIGGER_HAPPY32 0x2df
738#define BTN_TRIGGER_HAPPY33 0x2e0
739#define BTN_TRIGGER_HAPPY34 0x2e1
740#define BTN_TRIGGER_HAPPY35 0x2e2
741#define BTN_TRIGGER_HAPPY36 0x2e3
742#define BTN_TRIGGER_HAPPY37 0x2e4
743#define BTN_TRIGGER_HAPPY38 0x2e5
744#define BTN_TRIGGER_HAPPY39 0x2e6
745#define BTN_TRIGGER_HAPPY40 0x2e7
746
747/* We avoid low common keys in module aliases so they don't get huge. */
748#define KEY_MIN_INTERESTING KEY_MUTE
749#define KEY_MAX 0x2ff
750#define KEY_CNT (KEY_MAX+1)
751
752/*
753 * Relative axes
754 */
755
756#define REL_X 0x00
757#define REL_Y 0x01
758#define REL_Z 0x02
759#define REL_RX 0x03
760#define REL_RY 0x04
761#define REL_RZ 0x05
762#define REL_HWHEEL 0x06
763#define REL_DIAL 0x07
764#define REL_WHEEL 0x08
765#define REL_MISC 0x09
766#define REL_MAX 0x0f
767#define REL_CNT (REL_MAX+1)
768
769/*
770 * Absolute axes
771 */
772
773#define ABS_X 0x00
774#define ABS_Y 0x01
775#define ABS_Z 0x02
776#define ABS_RX 0x03
777#define ABS_RY 0x04
778#define ABS_RZ 0x05
779#define ABS_THROTTLE 0x06
780#define ABS_RUDDER 0x07
781#define ABS_WHEEL 0x08
782#define ABS_GAS 0x09
783#define ABS_BRAKE 0x0a
784#define ABS_HAT0X 0x10
785#define ABS_HAT0Y 0x11
786#define ABS_HAT1X 0x12
787#define ABS_HAT1Y 0x13
788#define ABS_HAT2X 0x14
789#define ABS_HAT2Y 0x15
790#define ABS_HAT3X 0x16
791#define ABS_HAT3Y 0x17
792#define ABS_PRESSURE 0x18
793#define ABS_DISTANCE 0x19
794#define ABS_TILT_X 0x1a
795#define ABS_TILT_Y 0x1b
796#define ABS_TOOL_WIDTH 0x1c
797
798#define ABS_VOLUME 0x20
799
800#define ABS_MISC 0x28
801
802#define ABS_MT_SLOT 0x2f /* MT slot being modified */
803#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
804#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */
805#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */
806#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */
807#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
808#define ABS_MT_POSITION_X 0x35 /* Center X touch position */
809#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */
810#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
811#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
812#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
813#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
814#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */
815#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
816#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */
817
818
819#define ABS_MAX 0x3f
820#define ABS_CNT (ABS_MAX+1)
821
822/*
823 * Switch events
824 */
825
826#define SW_LID 0x00 /* set = lid shut */
827#define SW_TABLET_MODE 0x01 /* set = tablet mode */
828#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
829#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any"
830 set = radio enabled */
831#define SW_RADIO SW_RFKILL_ALL /* deprecated */
832#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */
833#define SW_DOCK 0x05 /* set = plugged into dock */
834#define SW_LINEOUT_INSERT 0x06 /* set = inserted */
835#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */
836#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */
837#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */
838#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */
839#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
840#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
841#define SW_LINEIN_INSERT 0x0d /* set = inserted */
842#define SW_MAX 0x0f
843#define SW_CNT (SW_MAX+1)
844
845/*
846 * Misc events
847 */
848
849#define MSC_SERIAL 0x00
850#define MSC_PULSELED 0x01
851#define MSC_GESTURE 0x02
852#define MSC_RAW 0x03
853#define MSC_SCAN 0x04
854#define MSC_MAX 0x07
855#define MSC_CNT (MSC_MAX+1)
856
857/*
858 * LEDs
859 */
860
861#define LED_NUML 0x00
862#define LED_CAPSL 0x01
863#define LED_SCROLLL 0x02
864#define LED_COMPOSE 0x03
865#define LED_KANA 0x04
866#define LED_SLEEP 0x05
867#define LED_SUSPEND 0x06
868#define LED_MUTE 0x07
869#define LED_MISC 0x08
870#define LED_MAIL 0x09
871#define LED_CHARGING 0x0a
872#define LED_MAX 0x0f
873#define LED_CNT (LED_MAX+1)
874
875/*
876 * Autorepeat values
877 */
878
879#define REP_DELAY 0x00
880#define REP_PERIOD 0x01
881#define REP_MAX 0x01
882#define REP_CNT (REP_MAX+1)
883
884/*
885 * Sounds
886 */
887
888#define SND_CLICK 0x00
889#define SND_BELL 0x01
890#define SND_TONE 0x02
891#define SND_MAX 0x07
892#define SND_CNT (SND_MAX+1)
893
894/*
895 * IDs.
896 */
897
898#define ID_BUS 0
899#define ID_VENDOR 1
900#define ID_PRODUCT 2
901#define ID_VERSION 3
902
903#define BUS_PCI 0x01
904#define BUS_ISAPNP 0x02
905#define BUS_USB 0x03
906#define BUS_HIL 0x04
907#define BUS_BLUETOOTH 0x05
908#define BUS_VIRTUAL 0x06
909
910#define BUS_ISA 0x10
911#define BUS_I8042 0x11
912#define BUS_XTKBD 0x12
913#define BUS_RS232 0x13
914#define BUS_GAMEPORT 0x14
915#define BUS_PARPORT 0x15
916#define BUS_AMIGA 0x16
917#define BUS_ADB 0x17
918#define BUS_I2C 0x18
919#define BUS_HOST 0x19
920#define BUS_GSC 0x1A
921#define BUS_ATARI 0x1B
922#define BUS_SPI 0x1C
923
924/*
925 * MT_TOOL types
926 */
927#define MT_TOOL_FINGER 0
928#define MT_TOOL_PEN 1
929#define MT_TOOL_MAX 1
930
931/*
932 * Values describing the status of a force-feedback effect
933 */
934#define FF_STATUS_STOPPED 0x00
935#define FF_STATUS_PLAYING 0x01
936#define FF_STATUS_MAX 0x01
937
938/*
939 * Structures used in ioctls to upload effects to a device
940 * They are pieces of a bigger structure (called ff_effect)
941 */
942
943/*
944 * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
945 * should not be used and have unspecified results.
946 */
947
948/**
949 * struct ff_replay - defines scheduling of the force-feedback effect
950 * @length: duration of the effect
951 * @delay: delay before effect should start playing
952 */
953struct ff_replay {
954 __u16 length;
955 __u16 delay;
956};
957
958/**
959 * struct ff_trigger - defines what triggers the force-feedback effect
960 * @button: number of the button triggering the effect
961 * @interval: controls how soon the effect can be re-triggered
962 */
963struct ff_trigger {
964 __u16 button;
965 __u16 interval;
966};
967
968/**
969 * struct ff_envelope - generic force-feedback effect envelope
970 * @attack_length: duration of the attack (ms)
971 * @attack_level: level at the beginning of the attack
972 * @fade_length: duration of fade (ms)
973 * @fade_level: level at the end of fade
974 *
975 * The @attack_level and @fade_level are absolute values; when applying
976 * envelope force-feedback core will convert to positive/negative
977 * value based on polarity of the default level of the effect.
978 * Valid range for the attack and fade levels is 0x0000 - 0x7fff
979 */
980struct ff_envelope {
981 __u16 attack_length;
982 __u16 attack_level;
983 __u16 fade_length;
984 __u16 fade_level;
985};
986
987/**
988 * struct ff_constant_effect - defines parameters of a constant force-feedback effect
989 * @level: strength of the effect; may be negative
990 * @envelope: envelope data
991 */
992struct ff_constant_effect {
993 __s16 level;
994 struct ff_envelope envelope;
995};
996
997/**
998 * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
999 * @start_level: beginning strength of the effect; may be negative
1000 * @end_level: final strength of the effect; may be negative
1001 * @envelope: envelope data
1002 */
1003struct ff_ramp_effect {
1004 __s16 start_level;
1005 __s16 end_level;
1006 struct ff_envelope envelope;
1007};
1008
1009/**
1010 * struct ff_condition_effect - defines a spring or friction force-feedback effect
1011 * @right_saturation: maximum level when joystick moved all way to the right
1012 * @left_saturation: same for the left side
1013 * @right_coeff: controls how fast the force grows when the joystick moves
1014 * to the right
1015 * @left_coeff: same for the left side
1016 * @deadband: size of the dead zone, where no force is produced
1017 * @center: position of the dead zone
1018 */
1019struct ff_condition_effect {
1020 __u16 right_saturation;
1021 __u16 left_saturation;
1022
1023 __s16 right_coeff;
1024 __s16 left_coeff;
1025
1026 __u16 deadband;
1027 __s16 center;
1028};
1029
1030/**
1031 * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
1032 * @waveform: kind of the effect (wave)
1033 * @period: period of the wave (ms)
1034 * @magnitude: peak value
1035 * @offset: mean value of the wave (roughly)
1036 * @phase: 'horizontal' shift
1037 * @envelope: envelope data
1038 * @custom_len: number of samples (FF_CUSTOM only)
1039 * @custom_data: buffer of samples (FF_CUSTOM only)
1040 *
1041 * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
1042 * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
1043 * for the time being as no driver supports it yet.
1044 *
1045 * Note: the data pointed by custom_data is copied by the driver.
1046 * You can therefore dispose of the memory after the upload/update.
1047 */
1048struct ff_periodic_effect {
1049 __u16 waveform;
1050 __u16 period;
1051 __s16 magnitude;
1052 __s16 offset;
1053 __u16 phase;
1054
1055 struct ff_envelope envelope;
1056
1057 __u32 custom_len;
1058 __s16 __user *custom_data;
1059};
1060
1061/**
1062 * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
1063 * @strong_magnitude: magnitude of the heavy motor
1064 * @weak_magnitude: magnitude of the light one
1065 *
1066 * Some rumble pads have two motors of different weight. Strong_magnitude
1067 * represents the magnitude of the vibration generated by the heavy one.
1068 */
1069struct ff_rumble_effect {
1070 __u16 strong_magnitude;
1071 __u16 weak_magnitude;
1072};
1073
1074/**
1075 * struct ff_effect - defines force feedback effect
1076 * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
1077 * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
1078 * @id: an unique id assigned to an effect
1079 * @direction: direction of the effect
1080 * @trigger: trigger conditions (struct ff_trigger)
1081 * @replay: scheduling of the effect (struct ff_replay)
1082 * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
1083 * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
1084 * defining effect parameters
1085 *
1086 * This structure is sent through ioctl from the application to the driver.
1087 * To create a new effect application should set its @id to -1; the kernel
1088 * will return assigned @id which can later be used to update or delete
1089 * this effect.
1090 *
1091 * Direction of the effect is encoded as follows:
1092 * 0 deg -> 0x0000 (down)
1093 * 90 deg -> 0x4000 (left)
1094 * 180 deg -> 0x8000 (up)
1095 * 270 deg -> 0xC000 (right)
1096 */
1097struct ff_effect {
1098 __u16 type;
1099 __s16 id;
1100 __u16 direction;
1101 struct ff_trigger trigger;
1102 struct ff_replay replay;
1103
1104 union {
1105 struct ff_constant_effect constant;
1106 struct ff_ramp_effect ramp;
1107 struct ff_periodic_effect periodic;
1108 struct ff_condition_effect condition[2]; /* One for each axis */
1109 struct ff_rumble_effect rumble;
1110 } u;
1111};
1112
1113/*
1114 * Force feedback effect types
1115 */
1116
1117#define FF_RUMBLE 0x50
1118#define FF_PERIODIC 0x51
1119#define FF_CONSTANT 0x52
1120#define FF_SPRING 0x53
1121#define FF_FRICTION 0x54
1122#define FF_DAMPER 0x55
1123#define FF_INERTIA 0x56
1124#define FF_RAMP 0x57
1125
1126#define FF_EFFECT_MIN FF_RUMBLE
1127#define FF_EFFECT_MAX FF_RAMP
1128
1129/*
1130 * Force feedback periodic effect types
1131 */
1132
1133#define FF_SQUARE 0x58
1134#define FF_TRIANGLE 0x59
1135#define FF_SINE 0x5a
1136#define FF_SAW_UP 0x5b
1137#define FF_SAW_DOWN 0x5c
1138#define FF_CUSTOM 0x5d
1139
1140#define FF_WAVEFORM_MIN FF_SQUARE
1141#define FF_WAVEFORM_MAX FF_CUSTOM
1142
1143/*
1144 * Set ff device properties
1145 */
1146
1147#define FF_GAIN 0x60
1148#define FF_AUTOCENTER 0x61
1149
1150#define FF_MAX 0x7f
1151#define FF_CNT (FF_MAX+1)
1152
1153#endif /* _UAPI_INPUT_H */
diff --git a/include/linux/ioctl.h b/include/uapi/linux/ioctl.h
index aa91eb3951e..aa91eb3951e 100644
--- a/include/linux/ioctl.h
+++ b/include/uapi/linux/ioctl.h
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
new file mode 100644
index 00000000000..6cf06bfd841
--- /dev/null
+++ b/include/uapi/linux/ip.h
@@ -0,0 +1,136 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the IP protocol.
7 *
8 * Version: @(#)ip.h 1.0.2 04/28/93
9 *
10 * Authors: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17#ifndef _UAPI_LINUX_IP_H
18#define _UAPI_LINUX_IP_H
19#include <linux/types.h>
20#include <asm/byteorder.h>
21
22#define IPTOS_TOS_MASK 0x1E
23#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
24#define IPTOS_LOWDELAY 0x10
25#define IPTOS_THROUGHPUT 0x08
26#define IPTOS_RELIABILITY 0x04
27#define IPTOS_MINCOST 0x02
28
29#define IPTOS_PREC_MASK 0xE0
30#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
31#define IPTOS_PREC_NETCONTROL 0xe0
32#define IPTOS_PREC_INTERNETCONTROL 0xc0
33#define IPTOS_PREC_CRITIC_ECP 0xa0
34#define IPTOS_PREC_FLASHOVERRIDE 0x80
35#define IPTOS_PREC_FLASH 0x60
36#define IPTOS_PREC_IMMEDIATE 0x40
37#define IPTOS_PREC_PRIORITY 0x20
38#define IPTOS_PREC_ROUTINE 0x00
39
40
41/* IP options */
42#define IPOPT_COPY 0x80
43#define IPOPT_CLASS_MASK 0x60
44#define IPOPT_NUMBER_MASK 0x1f
45
46#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
47#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
48#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
49
50#define IPOPT_CONTROL 0x00
51#define IPOPT_RESERVED1 0x20
52#define IPOPT_MEASUREMENT 0x40
53#define IPOPT_RESERVED2 0x60
54
55#define IPOPT_END (0 |IPOPT_CONTROL)
56#define IPOPT_NOOP (1 |IPOPT_CONTROL)
57#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
58#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
59#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
60#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
61#define IPOPT_RR (7 |IPOPT_CONTROL)
62#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
63#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
64#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
65
66#define IPVERSION 4
67#define MAXTTL 255
68#define IPDEFTTL 64
69
70#define IPOPT_OPTVAL 0
71#define IPOPT_OLEN 1
72#define IPOPT_OFFSET 2
73#define IPOPT_MINOFF 4
74#define MAX_IPOPTLEN 40
75#define IPOPT_NOP IPOPT_NOOP
76#define IPOPT_EOL IPOPT_END
77#define IPOPT_TS IPOPT_TIMESTAMP
78
79#define IPOPT_TS_TSONLY 0 /* timestamps only */
80#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
81#define IPOPT_TS_PRESPEC 3 /* specified modules only */
82
83#define IPV4_BEET_PHMAXLEN 8
84
85struct iphdr {
86#if defined(__LITTLE_ENDIAN_BITFIELD)
87 __u8 ihl:4,
88 version:4;
89#elif defined (__BIG_ENDIAN_BITFIELD)
90 __u8 version:4,
91 ihl:4;
92#else
93#error "Please fix <asm/byteorder.h>"
94#endif
95 __u8 tos;
96 __be16 tot_len;
97 __be16 id;
98 __be16 frag_off;
99 __u8 ttl;
100 __u8 protocol;
101 __sum16 check;
102 __be32 saddr;
103 __be32 daddr;
104 /*The options start here. */
105};
106
107
108struct ip_auth_hdr {
109 __u8 nexthdr;
110 __u8 hdrlen; /* This one is measured in 32 bit units! */
111 __be16 reserved;
112 __be32 spi;
113 __be32 seq_no; /* Sequence number */
114 __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
115};
116
117struct ip_esp_hdr {
118 __be32 spi;
119 __be32 seq_no; /* Sequence number */
120 __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
121};
122
123struct ip_comp_hdr {
124 __u8 nexthdr;
125 __u8 flags;
126 __be16 cpi;
127};
128
129struct ip_beet_phdr {
130 __u8 nexthdr;
131 __u8 hdrlen;
132 __u8 padlen;
133 __u8 reserved;
134};
135
136#endif /* _UAPI_LINUX_IP_H */
diff --git a/include/linux/ip6_tunnel.h b/include/uapi/linux/ip6_tunnel.h
index 48af63c9a48..48af63c9a48 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/uapi/linux/ip6_tunnel.h
diff --git a/include/linux/ip_vs.h b/include/uapi/linux/ip_vs.h
index 8a2d438dc49..8a2d438dc49 100644
--- a/include/linux/ip_vs.h
+++ b/include/uapi/linux/ip_vs.h
diff --git a/include/uapi/linux/ipc.h b/include/uapi/linux/ipc.h
new file mode 100644
index 00000000000..de08dd46dda
--- /dev/null
+++ b/include/uapi/linux/ipc.h
@@ -0,0 +1,81 @@
1#ifndef _UAPI_LINUX_IPC_H
2#define _UAPI_LINUX_IPC_H
3
4#include <linux/types.h>
5
6#define IPC_PRIVATE ((__kernel_key_t) 0)
7
8/* Obsolete, used only for backwards compatibility and libc5 compiles */
9struct ipc_perm
10{
11 __kernel_key_t key;
12 __kernel_uid_t uid;
13 __kernel_gid_t gid;
14 __kernel_uid_t cuid;
15 __kernel_gid_t cgid;
16 __kernel_mode_t mode;
17 unsigned short seq;
18};
19
20/* Include the definition of ipc64_perm */
21#include <asm/ipcbuf.h>
22
23/* resource get request flags */
24#define IPC_CREAT 00001000 /* create if key is nonexistent */
25#define IPC_EXCL 00002000 /* fail if key exists */
26#define IPC_NOWAIT 00004000 /* return error on wait */
27
28/* these fields are used by the DIPC package so the kernel as standard
29 should avoid using them if possible */
30
31#define IPC_DIPC 00010000 /* make it distributed */
32#define IPC_OWN 00020000 /* this machine is the DIPC owner */
33
34/*
35 * Control commands used with semctl, msgctl and shmctl
36 * see also specific commands in sem.h, msg.h and shm.h
37 */
38#define IPC_RMID 0 /* remove resource */
39#define IPC_SET 1 /* set ipc_perm options */
40#define IPC_STAT 2 /* get ipc_perm options */
41#define IPC_INFO 3 /* see ipcs */
42
43/*
44 * Version flags for semctl, msgctl, and shmctl commands
45 * These are passed as bitflags or-ed with the actual command
46 */
47#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
48 architectures) */
49#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
50 message sizes, etc. */
51
52/*
53 * These are used to wrap system calls.
54 *
55 * See architecture code for ugly details..
56 */
57struct ipc_kludge {
58 struct msgbuf __user *msgp;
59 long msgtyp;
60};
61
62#define SEMOP 1
63#define SEMGET 2
64#define SEMCTL 3
65#define SEMTIMEDOP 4
66#define MSGSND 11
67#define MSGRCV 12
68#define MSGGET 13
69#define MSGCTL 14
70#define SHMAT 21
71#define SHMDT 22
72#define SHMGET 23
73#define SHMCTL 24
74
75/* Used by the DIPC package, try and avoid reusing it */
76#define DIPC 25
77
78#define IPCCALL(version,op) ((version)<<16 | (op))
79
80
81#endif /* _UAPI_LINUX_IPC_H */
diff --git a/include/uapi/linux/ipmi.h b/include/uapi/linux/ipmi.h
new file mode 100644
index 00000000000..33fbc99b381
--- /dev/null
+++ b/include/uapi/linux/ipmi.h
@@ -0,0 +1,456 @@
1/*
2 * ipmi.h
3 *
4 * MontaVista IPMI interface
5 *
6 * Author: MontaVista Software, Inc.
7 * Corey Minyard <minyard@mvista.com>
8 * source@mvista.com
9 *
10 * Copyright 2002 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
26 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
27 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * You should have received a copy of the GNU General Public License along
30 * with this program; if not, write to the Free Software Foundation, Inc.,
31 * 675 Mass Ave, Cambridge, MA 02139, USA.
32 */
33
34#ifndef _UAPI__LINUX_IPMI_H
35#define _UAPI__LINUX_IPMI_H
36
37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h>
39
40/*
41 * This file describes an interface to an IPMI driver. You have to
42 * have a fairly good understanding of IPMI to use this, so go read
43 * the specs first before actually trying to do anything.
44 *
45 * With that said, this driver provides a multi-user interface to the
46 * IPMI driver, and it allows multiple IPMI physical interfaces below
47 * the driver. The physical interfaces bind as a lower layer on the
48 * driver. They appear as interfaces to the application using this
49 * interface.
50 *
51 * Multi-user means that multiple applications may use the driver,
52 * send commands, receive responses, etc. The driver keeps track of
53 * commands the user sends and tracks the responses. The responses
54 * will go back to the application that send the command. If the
55 * response doesn't come back in time, the driver will return a
56 * timeout error response to the application. Asynchronous events
57 * from the BMC event queue will go to all users bound to the driver.
58 * The incoming event queue in the BMC will automatically be flushed
59 * if it becomes full and it is queried once a second to see if
60 * anything is in it. Incoming commands to the driver will get
61 * delivered as commands.
62 *
63 * This driver provides two main interfaces: one for in-kernel
64 * applications and another for userland applications. The
65 * capabilities are basically the same for both interface, although
66 * the interfaces are somewhat different. The stuff in the
67 * #ifdef __KERNEL__ below is the in-kernel interface. The userland
68 * interface is defined later in the file. */
69
70
71
72/*
73 * This is an overlay for all the address types, so it's easy to
74 * determine the actual address type. This is kind of like addresses
75 * work for sockets.
76 */
77#define IPMI_MAX_ADDR_SIZE 32
78struct ipmi_addr {
79 /* Try to take these from the "Channel Medium Type" table
80 in section 6.5 of the IPMI 1.5 manual. */
81 int addr_type;
82 short channel;
83 char data[IPMI_MAX_ADDR_SIZE];
84};
85
86/*
87 * When the address is not used, the type will be set to this value.
88 * The channel is the BMC's channel number for the channel (usually
89 * 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
90 */
91#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
92struct ipmi_system_interface_addr {
93 int addr_type;
94 short channel;
95 unsigned char lun;
96};
97
98/* An IPMB Address. */
99#define IPMI_IPMB_ADDR_TYPE 0x01
100/* Used for broadcast get device id as described in section 17.9 of the
101 IPMI 1.5 manual. */
102#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
103struct ipmi_ipmb_addr {
104 int addr_type;
105 short channel;
106 unsigned char slave_addr;
107 unsigned char lun;
108};
109
110/*
111 * A LAN Address. This is an address to/from a LAN interface bridged
112 * by the BMC, not an address actually out on the LAN.
113 *
114 * A conscious decision was made here to deviate slightly from the IPMI
115 * spec. We do not use rqSWID and rsSWID like it shows in the
116 * message. Instead, we use remote_SWID and local_SWID. This means
117 * that any message (a request or response) from another device will
118 * always have exactly the same address. If you didn't do this,
119 * requests and responses from the same device would have different
120 * addresses, and that's not too cool.
121 *
122 * In this address, the remote_SWID is always the SWID the remote
123 * message came from, or the SWID we are sending the message to.
124 * local_SWID is always our SWID. Note that having our SWID in the
125 * message is a little weird, but this is required.
126 */
127#define IPMI_LAN_ADDR_TYPE 0x04
128struct ipmi_lan_addr {
129 int addr_type;
130 short channel;
131 unsigned char privilege;
132 unsigned char session_handle;
133 unsigned char remote_SWID;
134 unsigned char local_SWID;
135 unsigned char lun;
136};
137
138
139/*
140 * Channel for talking directly with the BMC. When using this
141 * channel, This is for the system interface address type only. FIXME
142 * - is this right, or should we use -1?
143 */
144#define IPMI_BMC_CHANNEL 0xf
145#define IPMI_NUM_CHANNELS 0x10
146
147/*
148 * Used to signify an "all channel" bitmask. This is more than the
149 * actual number of channels because this is used in userland and
150 * will cover us if the number of channels is extended.
151 */
152#define IPMI_CHAN_ALL (~0)
153
154
155/*
156 * A raw IPMI message without any addressing. This covers both
157 * commands and responses. The completion code is always the first
158 * byte of data in the response (as the spec shows the messages laid
159 * out).
160 */
161struct ipmi_msg {
162 unsigned char netfn;
163 unsigned char cmd;
164 unsigned short data_len;
165 unsigned char __user *data;
166};
167
168struct kernel_ipmi_msg {
169 unsigned char netfn;
170 unsigned char cmd;
171 unsigned short data_len;
172 unsigned char *data;
173};
174
175/*
176 * Various defines that are useful for IPMI applications.
177 */
178#define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
179#define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
180#define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
181
182
183/*
184 * Receive types for messages coming from the receive interface. This
185 * is used for the receive in-kernel interface and in the receive
186 * IOCTL.
187 *
188 * The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
189 * it allows you to get the message results when you send a response
190 * message.
191 */
192#define IPMI_RESPONSE_RECV_TYPE 1 /* A response to a command */
193#define IPMI_ASYNC_EVENT_RECV_TYPE 2 /* Something from the event queue */
194#define IPMI_CMD_RECV_TYPE 3 /* A command from somewhere else */
195#define IPMI_RESPONSE_RESPONSE_TYPE 4 /* The response for
196 a sent response, giving any
197 error status for sending the
198 response. When you send a
199 response message, this will
200 be returned. */
201#define IPMI_OEM_RECV_TYPE 5 /* The response for OEM Channels */
202
203/* Note that async events and received commands do not have a completion
204 code as the first byte of the incoming data, unlike a response. */
205
206
207/*
208 * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
209 * setting is the default and means it will be set on certain
210 * commands. Hard setting it on and off will override automatic
211 * operation.
212 */
213#define IPMI_MAINTENANCE_MODE_AUTO 0
214#define IPMI_MAINTENANCE_MODE_OFF 1
215#define IPMI_MAINTENANCE_MODE_ON 2
216
217
218
219/*
220 * The userland interface
221 */
222
223/*
224 * The userland interface for the IPMI driver is a standard character
225 * device, with each instance of an interface registered as a minor
226 * number under the major character device.
227 *
228 * The read and write calls do not work, to get messages in and out
229 * requires ioctl calls because of the complexity of the data. select
230 * and poll do work, so you can wait for input using the file
231 * descriptor, you just can use read to get it.
232 *
233 * In general, you send a command down to the interface and receive
234 * responses back. You can use the msgid value to correlate commands
235 * and responses, the driver will take care of figuring out which
236 * incoming messages are for which command and find the proper msgid
237 * value to report. You will only receive reponses for commands you
238 * send. Asynchronous events, however, go to all open users, so you
239 * must be ready to handle these (or ignore them if you don't care).
240 *
241 * The address type depends upon the channel type. When talking
242 * directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
243 * (IPMI_UNUSED_ADDR_TYPE). When talking to an IPMB channel, you must
244 * supply a valid IPMB address with the addr_type set properly.
245 *
246 * When talking to normal channels, the driver takes care of the
247 * details of formatting and sending messages on that channel. You do
248 * not, for instance, have to format a send command, you just send
249 * whatever command you want to the channel, the driver will create
250 * the send command, automatically issue receive command and get even
251 * commands, and pass those up to the proper user.
252 */
253
254
255/* The magic IOCTL value for this interface. */
256#define IPMI_IOC_MAGIC 'i'
257
258
259/* Messages sent to the interface are this format. */
260struct ipmi_req {
261 unsigned char __user *addr; /* Address to send the message to. */
262 unsigned int addr_len;
263
264 long msgid; /* The sequence number for the message. This
265 exact value will be reported back in the
266 response to this request if it is a command.
267 If it is a response, this will be used as
268 the sequence value for the response. */
269
270 struct ipmi_msg msg;
271};
272/*
273 * Send a message to the interfaces. error values are:
274 * - EFAULT - an address supplied was invalid.
275 * - EINVAL - The address supplied was not valid, or the command
276 * was not allowed.
277 * - EMSGSIZE - The message to was too large.
278 * - ENOMEM - Buffers could not be allocated for the command.
279 */
280#define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, \
281 struct ipmi_req)
282
283/* Messages sent to the interface with timing parameters are this
284 format. */
285struct ipmi_req_settime {
286 struct ipmi_req req;
287
288 /* See ipmi_request_settime() above for details on these
289 values. */
290 int retries;
291 unsigned int retry_time_ms;
292};
293/*
294 * Send a message to the interfaces with timing parameters. error values
295 * are:
296 * - EFAULT - an address supplied was invalid.
297 * - EINVAL - The address supplied was not valid, or the command
298 * was not allowed.
299 * - EMSGSIZE - The message to was too large.
300 * - ENOMEM - Buffers could not be allocated for the command.
301 */
302#define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, \
303 struct ipmi_req_settime)
304
305/* Messages received from the interface are this format. */
306struct ipmi_recv {
307 int recv_type; /* Is this a command, response or an
308 asyncronous event. */
309
310 unsigned char __user *addr; /* Address the message was from is put
311 here. The caller must supply the
312 memory. */
313 unsigned int addr_len; /* The size of the address buffer.
314 The caller supplies the full buffer
315 length, this value is updated to
316 the actual message length when the
317 message is received. */
318
319 long msgid; /* The sequence number specified in the request
320 if this is a response. If this is a command,
321 this will be the sequence number from the
322 command. */
323
324 struct ipmi_msg msg; /* The data field must point to a buffer.
325 The data_size field must be set to the
326 size of the message buffer. The
327 caller supplies the full buffer
328 length, this value is updated to the
329 actual message length when the message
330 is received. */
331};
332
333/*
334 * Receive a message. error values:
335 * - EAGAIN - no messages in the queue.
336 * - EFAULT - an address supplied was invalid.
337 * - EINVAL - The address supplied was not valid.
338 * - EMSGSIZE - The message to was too large to fit into the message buffer,
339 * the message will be left in the buffer. */
340#define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, \
341 struct ipmi_recv)
342
343/*
344 * Like RECEIVE_MSG, but if the message won't fit in the buffer, it
345 * will truncate the contents instead of leaving the data in the
346 * buffer.
347 */
348#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, \
349 struct ipmi_recv)
350
351/* Register to get commands from other entities on this interface. */
352struct ipmi_cmdspec {
353 unsigned char netfn;
354 unsigned char cmd;
355};
356
357/*
358 * Register to receive a specific command. error values:
359 * - EFAULT - an address supplied was invalid.
360 * - EBUSY - The netfn/cmd supplied was already in use.
361 * - ENOMEM - could not allocate memory for the entry.
362 */
363#define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, \
364 struct ipmi_cmdspec)
365/*
366 * Unregister a regsitered command. error values:
367 * - EFAULT - an address supplied was invalid.
368 * - ENOENT - The netfn/cmd was not found registered for this user.
369 */
370#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
371 struct ipmi_cmdspec)
372
373/*
374 * Register to get commands from other entities on specific channels.
375 * This way, you can only listen on specific channels, or have messages
376 * from some channels go to one place and other channels to someplace
377 * else. The chans field is a bitmask, (1 << channel) for each channel.
378 * It may be IPMI_CHAN_ALL for all channels.
379 */
380struct ipmi_cmdspec_chans {
381 unsigned int netfn;
382 unsigned int cmd;
383 unsigned int chans;
384};
385
386/*
387 * Register to receive a specific command on specific channels. error values:
388 * - EFAULT - an address supplied was invalid.
389 * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
390 * - ENOMEM - could not allocate memory for the entry.
391 */
392#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
393 struct ipmi_cmdspec_chans)
394/*
395 * Unregister some netfn/cmd/chans. error values:
396 * - EFAULT - an address supplied was invalid.
397 * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
398 */
399#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
400 struct ipmi_cmdspec_chans)
401
402/*
403 * Set whether this interface receives events. Note that the first
404 * user registered for events will get all pending events for the
405 * interface. error values:
406 * - EFAULT - an address supplied was invalid.
407 */
408#define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
409
410/*
411 * Set and get the slave address and LUN that we will use for our
412 * source messages. Note that this affects the interface, not just
413 * this user, so it will affect all users of this interface. This is
414 * so some initialization code can come in and do the OEM-specific
415 * things it takes to determine your address (if not the BMC) and set
416 * it for everyone else. You should probably leave the LUN alone.
417 */
418struct ipmi_channel_lun_address_set {
419 unsigned short channel;
420 unsigned char value;
421};
422#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
423 _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
424#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
425 _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
426#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
427 _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
428#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
429 _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
430/* Legacy interfaces, these only set IPMB 0. */
431#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
432#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
433#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
434#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
435
436/*
437 * Get/set the default timing values for an interface. You shouldn't
438 * generally mess with these.
439 */
440struct ipmi_timing_parms {
441 int retries;
442 unsigned int retry_time_ms;
443};
444#define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, \
445 struct ipmi_timing_parms)
446#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
447 struct ipmi_timing_parms)
448
449/*
450 * Set the maintenance mode. See ipmi_set_maintenance_mode() above
451 * for a description of what this does.
452 */
453#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
454#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
455
456#endif /* _UAPI__LINUX_IPMI_H */
diff --git a/include/linux/ipmi_msgdefs.h b/include/uapi/linux/ipmi_msgdefs.h
index df97e6e31e8..df97e6e31e8 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/uapi/linux/ipmi_msgdefs.h
diff --git a/include/linux/ipsec.h b/include/uapi/linux/ipsec.h
index d17a6302a0e..d17a6302a0e 100644
--- a/include/linux/ipsec.h
+++ b/include/uapi/linux/ipsec.h
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
new file mode 100644
index 00000000000..a6d7d1c536c
--- /dev/null
+++ b/include/uapi/linux/ipv6.h
@@ -0,0 +1,164 @@
1#ifndef _UAPI_IPV6_H
2#define _UAPI_IPV6_H
3
4#include <linux/types.h>
5#include <linux/in6.h>
6#include <asm/byteorder.h>
7
8/* The latest drafts declared increase in minimal mtu up to 1280. */
9
10#define IPV6_MIN_MTU 1280
11
12/*
13 * Advanced API
14 * source interface/address selection, source routing, etc...
15 * *under construction*
16 */
17
18
19struct in6_pktinfo {
20 struct in6_addr ipi6_addr;
21 int ipi6_ifindex;
22};
23
24struct ip6_mtuinfo {
25 struct sockaddr_in6 ip6m_addr;
26 __u32 ip6m_mtu;
27};
28
29struct in6_ifreq {
30 struct in6_addr ifr6_addr;
31 __u32 ifr6_prefixlen;
32 int ifr6_ifindex;
33};
34
35#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
36#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
37#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
38
39/*
40 * routing header
41 */
42struct ipv6_rt_hdr {
43 __u8 nexthdr;
44 __u8 hdrlen;
45 __u8 type;
46 __u8 segments_left;
47
48 /*
49 * type specific data
50 * variable length field
51 */
52};
53
54
55struct ipv6_opt_hdr {
56 __u8 nexthdr;
57 __u8 hdrlen;
58 /*
59 * TLV encoded option data follows.
60 */
61} __attribute__((packed)); /* required for some archs */
62
63#define ipv6_destopt_hdr ipv6_opt_hdr
64#define ipv6_hopopt_hdr ipv6_opt_hdr
65
66
67/*
68 * routing header type 0 (used in cmsghdr struct)
69 */
70
71struct rt0_hdr {
72 struct ipv6_rt_hdr rt_hdr;
73 __u32 reserved;
74 struct in6_addr addr[0];
75
76#define rt0_type rt_hdr.type
77};
78
79/*
80 * routing header type 2
81 */
82
83struct rt2_hdr {
84 struct ipv6_rt_hdr rt_hdr;
85 __u32 reserved;
86 struct in6_addr addr;
87
88#define rt2_type rt_hdr.type
89};
90
91/*
92 * home address option in destination options header
93 */
94
95struct ipv6_destopt_hao {
96 __u8 type;
97 __u8 length;
98 struct in6_addr addr;
99} __attribute__((packed));
100
101/*
102 * IPv6 fixed header
103 *
104 * BEWARE, it is incorrect. The first 4 bits of flow_lbl
105 * are glued to priority now, forming "class".
106 */
107
108struct ipv6hdr {
109#if defined(__LITTLE_ENDIAN_BITFIELD)
110 __u8 priority:4,
111 version:4;
112#elif defined(__BIG_ENDIAN_BITFIELD)
113 __u8 version:4,
114 priority:4;
115#else
116#error "Please fix <asm/byteorder.h>"
117#endif
118 __u8 flow_lbl[3];
119
120 __be16 payload_len;
121 __u8 nexthdr;
122 __u8 hop_limit;
123
124 struct in6_addr saddr;
125 struct in6_addr daddr;
126};
127
128
129/* index values for the variables in ipv6_devconf */
130enum {
131 DEVCONF_FORWARDING = 0,
132 DEVCONF_HOPLIMIT,
133 DEVCONF_MTU6,
134 DEVCONF_ACCEPT_RA,
135 DEVCONF_ACCEPT_REDIRECTS,
136 DEVCONF_AUTOCONF,
137 DEVCONF_DAD_TRANSMITS,
138 DEVCONF_RTR_SOLICITS,
139 DEVCONF_RTR_SOLICIT_INTERVAL,
140 DEVCONF_RTR_SOLICIT_DELAY,
141 DEVCONF_USE_TEMPADDR,
142 DEVCONF_TEMP_VALID_LFT,
143 DEVCONF_TEMP_PREFERED_LFT,
144 DEVCONF_REGEN_MAX_RETRY,
145 DEVCONF_MAX_DESYNC_FACTOR,
146 DEVCONF_MAX_ADDRESSES,
147 DEVCONF_FORCE_MLD_VERSION,
148 DEVCONF_ACCEPT_RA_DEFRTR,
149 DEVCONF_ACCEPT_RA_PINFO,
150 DEVCONF_ACCEPT_RA_RTR_PREF,
151 DEVCONF_RTR_PROBE_INTERVAL,
152 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
153 DEVCONF_PROXY_NDP,
154 DEVCONF_OPTIMISTIC_DAD,
155 DEVCONF_ACCEPT_SOURCE_ROUTE,
156 DEVCONF_MC_FORWARDING,
157 DEVCONF_DISABLE_IPV6,
158 DEVCONF_ACCEPT_DAD,
159 DEVCONF_FORCE_TLLAO,
160 DEVCONF_MAX
161};
162
163
164#endif /* _UAPI_IPV6_H */
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h
new file mode 100644
index 00000000000..0459664c263
--- /dev/null
+++ b/include/uapi/linux/ipv6_route.h
@@ -0,0 +1,58 @@
1/*
2 * Linux INET6 implementation
3 *
4 * Authors:
5 * Pedro Roque <roque@di.fc.ul.pt>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _UAPI_LINUX_IPV6_ROUTE_H
14#define _UAPI_LINUX_IPV6_ROUTE_H
15
16#include <linux/types.h>
17
18#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
19#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
20 fallback, no routers on link */
21#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
22#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */
23#define RTF_ANYCAST 0x00100000 /* Anycast */
24
25#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
26#define RTF_EXPIRES 0x00400000
27
28#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
29
30#define RTF_CACHE 0x01000000 /* cache entry */
31#define RTF_FLOW 0x02000000 /* flow significant route */
32#define RTF_POLICY 0x04000000 /* policy route */
33
34#define RTF_PREF(pref) ((pref) << 27)
35#define RTF_PREF_MASK 0x18000000
36
37#define RTF_LOCAL 0x80000000
38
39
40struct in6_rtmsg {
41 struct in6_addr rtmsg_dst;
42 struct in6_addr rtmsg_src;
43 struct in6_addr rtmsg_gateway;
44 __u32 rtmsg_type;
45 __u16 rtmsg_dst_len;
46 __u16 rtmsg_src_len;
47 __u32 rtmsg_metric;
48 unsigned long rtmsg_info;
49 __u32 rtmsg_flags;
50 int rtmsg_ifindex;
51};
52
53#define RTMSG_NEWDEVICE 0x11
54#define RTMSG_DELDEVICE 0x12
55#define RTMSG_NEWROUTE 0x21
56#define RTMSG_DELROUTE 0x22
57
58#endif /* _UAPI_LINUX_IPV6_ROUTE_H */
diff --git a/include/linux/ipx.h b/include/uapi/linux/ipx.h
index 3d48014cdd7..3d48014cdd7 100644
--- a/include/linux/ipx.h
+++ b/include/uapi/linux/ipx.h
diff --git a/include/linux/irda.h b/include/uapi/linux/irda.h
index a014c325231..a014c325231 100644
--- a/include/linux/irda.h
+++ b/include/uapi/linux/irda.h
diff --git a/include/uapi/linux/irqnr.h b/include/uapi/linux/irqnr.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/include/uapi/linux/irqnr.h
diff --git a/include/uapi/linux/isdn.h b/include/uapi/linux/isdn.h
new file mode 100644
index 00000000000..eb1995fffc3
--- /dev/null
+++ b/include/uapi/linux/isdn.h
@@ -0,0 +1,143 @@
1/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
2 *
3 * Main header for the Linux ISDN subsystem (linklevel).
4 *
5 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
6 * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
7 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13
14#ifndef _UAPI__ISDN_H__
15#define _UAPI__ISDN_H__
16
17#include <linux/ioctl.h>
18#include <linux/tty.h>
19
20#define ISDN_MAX_DRIVERS 32
21#define ISDN_MAX_CHANNELS 64
22
23/* New ioctl-codes */
24#define IIOCNETAIF _IO('I',1)
25#define IIOCNETDIF _IO('I',2)
26#define IIOCNETSCF _IO('I',3)
27#define IIOCNETGCF _IO('I',4)
28#define IIOCNETANM _IO('I',5)
29#define IIOCNETDNM _IO('I',6)
30#define IIOCNETGNM _IO('I',7)
31#define IIOCGETSET _IO('I',8) /* no longer supported */
32#define IIOCSETSET _IO('I',9) /* no longer supported */
33#define IIOCSETVER _IO('I',10)
34#define IIOCNETHUP _IO('I',11)
35#define IIOCSETGST _IO('I',12)
36#define IIOCSETBRJ _IO('I',13)
37#define IIOCSIGPRF _IO('I',14)
38#define IIOCGETPRF _IO('I',15)
39#define IIOCSETPRF _IO('I',16)
40#define IIOCGETMAP _IO('I',17)
41#define IIOCSETMAP _IO('I',18)
42#define IIOCNETASL _IO('I',19)
43#define IIOCNETDIL _IO('I',20)
44#define IIOCGETCPS _IO('I',21)
45#define IIOCGETDVR _IO('I',22)
46#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
47#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
48
49#define IIOCNETALN _IO('I',32)
50#define IIOCNETDLN _IO('I',33)
51
52#define IIOCNETGPN _IO('I',34)
53
54#define IIOCDBGVAR _IO('I',127)
55
56#define IIOCDRVCTL _IO('I',128)
57
58/* cisco hdlck device private ioctls */
59#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
60#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
61#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
62#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
63
64/* Packet encapsulations for net-interfaces */
65#define ISDN_NET_ENCAP_ETHER 0
66#define ISDN_NET_ENCAP_RAWIP 1
67#define ISDN_NET_ENCAP_IPTYP 2
68#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
69#define ISDN_NET_ENCAP_SYNCPPP 4
70#define ISDN_NET_ENCAP_UIHDLC 5
71#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
72#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
73#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
74
75/* Facility which currently uses an ISDN-channel */
76#define ISDN_USAGE_NONE 0
77#define ISDN_USAGE_RAW 1
78#define ISDN_USAGE_MODEM 2
79#define ISDN_USAGE_NET 3
80#define ISDN_USAGE_VOICE 4
81#define ISDN_USAGE_FAX 5
82#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
83#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
84#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
85#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
86
87#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
88#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
89#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
90
91#define ISDN_MSNLEN 32
92#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
93#define TTY_DV 0x06 /* Data version for iprofd etc. */
94
95#define INF_DV 0x01 /* Data version for /dev/isdninfo */
96
97typedef struct {
98 char drvid[25];
99 unsigned long arg;
100} isdn_ioctl_struct;
101
102typedef struct {
103 char name[10];
104 char phone[ISDN_MSNLEN];
105 int outgoing;
106} isdn_net_ioctl_phone;
107
108typedef struct {
109 char name[10]; /* Name of interface */
110 char master[10]; /* Name of Master for Bundling */
111 char slave[10]; /* Name of Slave for Bundling */
112 char eaz[256]; /* EAZ/MSN */
113 char drvid[25]; /* DriverId for Bindings */
114 int onhtime; /* Hangup-Timeout */
115 int charge; /* Charge-Units */
116 int l2_proto; /* Layer-2 protocol */
117 int l3_proto; /* Layer-3 protocol */
118 int p_encap; /* Encapsulation */
119 int exclusive; /* Channel, if bound exclusive */
120 int dialmax; /* Dial Retry-Counter */
121 int slavedelay; /* Delay until slave starts up */
122 int cbdelay; /* Delay before Callback */
123 int chargehup; /* Flag: Charge-Hangup */
124 int ihup; /* Flag: Hangup-Timeout on incoming line */
125 int secure; /* Flag: Secure */
126 int callback; /* Flag: Callback */
127 int cbhup; /* Flag: Reject Call before Callback */
128 int pppbind; /* ippp device for bindings */
129 int chargeint; /* Use fixed charge interval length */
130 int triggercps; /* BogoCPS needed for triggering slave */
131 int dialtimeout; /* Dial-Timeout */
132 int dialwait; /* Time to wait after failed dial */
133 int dialmode; /* Flag: off / on / auto */
134} isdn_net_ioctl_cfg;
135
136#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
137#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
138#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
139#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
140#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
141
142
143#endif /* _UAPI__ISDN_H__ */
diff --git a/include/uapi/linux/isdn_divertif.h b/include/uapi/linux/isdn_divertif.h
new file mode 100644
index 00000000000..3e3c2d89841
--- /dev/null
+++ b/include/uapi/linux/isdn_divertif.h
@@ -0,0 +1,30 @@
1/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
2 *
3 * Header for the diversion supplementary interface for i4l.
4 *
5 * Author Werner Cornelius (werner@titro.de)
6 * Copyright by Werner Cornelius (werner@titro.de)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13#ifndef _UAPI_LINUX_ISDN_DIVERTIF_H
14#define _UAPI_LINUX_ISDN_DIVERTIF_H
15
16/***********************************************************/
17/* magic value is also used to control version information */
18/***********************************************************/
19#define DIVERT_IF_MAGIC 0x25873401
20#define DIVERT_CMD_REG 0x00 /* register command */
21#define DIVERT_CMD_REL 0x01 /* release command */
22#define DIVERT_NO_ERR 0x00 /* return value no error */
23#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
24#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
25#define DIVERT_REG_ERR 0x03 /* module already registered */
26#define DIVERT_REL_ERR 0x04 /* module not registered */
27#define DIVERT_REG_NAME isdn_register_divert
28
29
30#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
index 00000000000..e7d7bd2aed3
--- /dev/null
+++ b/include/uapi/linux/isdn_ppp.h
@@ -0,0 +1,67 @@
1/* Linux ISDN subsystem, sync PPP, interface to ipppd
2 *
3 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
4 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
5 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
6 * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13#ifndef _UAPI_LINUX_ISDN_PPP_H
14#define _UAPI_LINUX_ISDN_PPP_H
15
16#define CALLTYPE_INCOMING 0x1
17#define CALLTYPE_OUTGOING 0x2
18#define CALLTYPE_CALLBACK 0x4
19
20#define IPPP_VERSION "2.2.0"
21
22struct pppcallinfo
23{
24 int calltype;
25 unsigned char local_num[64];
26 unsigned char remote_num[64];
27 int charge_units;
28};
29
30#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
31#define PPPIOCBUNDLE _IOW('t',129,int)
32#define PPPIOCGMPFLAGS _IOR('t',130,int)
33#define PPPIOCSMPFLAGS _IOW('t',131,int)
34#define PPPIOCSMPMTU _IOW('t',132,int)
35#define PPPIOCSMPMRU _IOW('t',133,int)
36#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
37#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
38#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
39
40
41#define SC_MP_PROT 0x00000200
42#define SC_REJ_MP_PROT 0x00000400
43#define SC_OUT_SHORT_SEQ 0x00000800
44#define SC_IN_SHORT_SEQ 0x00004000
45
46#define SC_DECOMP_ON 0x01
47#define SC_COMP_ON 0x02
48#define SC_DECOMP_DISCARD 0x04
49#define SC_COMP_DISCARD 0x08
50#define SC_LINK_DECOMP_ON 0x10
51#define SC_LINK_COMP_ON 0x20
52#define SC_LINK_DECOMP_DISCARD 0x40
53#define SC_LINK_COMP_DISCARD 0x80
54
55#define ISDN_PPP_COMP_MAX_OPTIONS 16
56
57#define IPPP_COMP_FLAG_XMIT 0x1
58#define IPPP_COMP_FLAG_LINK 0x2
59
60struct isdn_ppp_comp_data {
61 int num;
62 unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
63 int optlen;
64 int flags;
65};
66
67#endif /* _UAPI_LINUX_ISDN_PPP_H */
diff --git a/include/uapi/linux/isdnif.h b/include/uapi/linux/isdnif.h
new file mode 100644
index 00000000000..246138c01c4
--- /dev/null
+++ b/include/uapi/linux/isdnif.h
@@ -0,0 +1,56 @@
1/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
2 *
3 * Linux ISDN subsystem
4 * Definition of the interface between the subsystem and its low-level drivers.
5 *
6 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
7 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13
14#ifndef _UAPI__ISDNIF_H__
15#define _UAPI__ISDNIF_H__
16
17
18/*
19 * Values for general protocol-selection
20 */
21#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
22#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
23#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
24#define ISDN_PTYPE_LEASED 3 /* for leased lines */
25#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
26#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
27
28/*
29 * Values for Layer-2-protocol-selection
30 */
31#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
32#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
33#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
34#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
35#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
36#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
37#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
38#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
39#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
40#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
41#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
42#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
43#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
44#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
45
46/*
47 * Values for Layer-3-protocol-selection
48 */
49#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
50#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
51#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
52#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
53#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
54
55
56#endif /* _UAPI__ISDNIF_H__ */
diff --git a/include/linux/iso_fs.h b/include/uapi/linux/iso_fs.h
index 4688ac4284e..4688ac4284e 100644
--- a/include/linux/iso_fs.h
+++ b/include/uapi/linux/iso_fs.h
diff --git a/include/linux/ivtv.h b/include/uapi/linux/ivtv.h
index 42bf725751a..42bf725751a 100644
--- a/include/linux/ivtv.h
+++ b/include/uapi/linux/ivtv.h
diff --git a/include/linux/ivtvfb.h b/include/uapi/linux/ivtvfb.h
index e8b92f67f10..e8b92f67f10 100644
--- a/include/linux/ivtvfb.h
+++ b/include/uapi/linux/ivtvfb.h
diff --git a/include/linux/ixjuser.h b/include/uapi/linux/ixjuser.h
index 94ab5e942e5..94ab5e942e5 100644
--- a/include/linux/ixjuser.h
+++ b/include/uapi/linux/ixjuser.h
diff --git a/include/linux/jffs2.h b/include/uapi/linux/jffs2.h
index a18b719f49d..a18b719f49d 100644
--- a/include/linux/jffs2.h
+++ b/include/uapi/linux/jffs2.h
diff --git a/include/uapi/linux/joystick.h b/include/uapi/linux/joystick.h
new file mode 100644
index 00000000000..b856fd11c70
--- /dev/null
+++ b/include/uapi/linux/joystick.h
@@ -0,0 +1,136 @@
1/*
2 * Copyright (C) 1996-2000 Vojtech Pavlik
3 *
4 * Sponsored by SuSE
5 */
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Should you need to contact me, the author, you can do so either by
22 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
23 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
24 */
25#ifndef _UAPI_LINUX_JOYSTICK_H
26#define _UAPI_LINUX_JOYSTICK_H
27
28
29
30#include <linux/types.h>
31#include <linux/input.h>
32
33/*
34 * Version
35 */
36
37#define JS_VERSION 0x020100
38
39/*
40 * Types and constants for reading from /dev/js
41 */
42
43#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
44#define JS_EVENT_AXIS 0x02 /* joystick moved */
45#define JS_EVENT_INIT 0x80 /* initial state of device */
46
47struct js_event {
48 __u32 time; /* event timestamp in milliseconds */
49 __s16 value; /* value */
50 __u8 type; /* event type */
51 __u8 number; /* axis/button number */
52};
53
54/*
55 * IOCTL commands for joystick driver
56 */
57
58#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
59
60#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
61#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
62#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
63
64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
66
67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
71
72/*
73 * Types and constants for get/set correction
74 */
75
76#define JS_CORR_NONE 0x00 /* returns raw values */
77#define JS_CORR_BROKEN 0x01 /* broken line */
78
79struct js_corr {
80 __s32 coef[8];
81 __s16 prec;
82 __u16 type;
83};
84
85/*
86 * v0.x compatibility definitions
87 */
88
89#define JS_RETURN sizeof(struct JS_DATA_TYPE)
90#define JS_TRUE 1
91#define JS_FALSE 0
92#define JS_X_0 0x01
93#define JS_Y_0 0x02
94#define JS_X_1 0x04
95#define JS_Y_1 0x08
96#define JS_MAX 2
97
98#define JS_DEF_TIMEOUT 0x1300
99#define JS_DEF_CORR 0
100#define JS_DEF_TIMELIMIT 10L
101
102#define JS_SET_CAL 1
103#define JS_GET_CAL 2
104#define JS_SET_TIMEOUT 3
105#define JS_GET_TIMEOUT 4
106#define JS_SET_TIMELIMIT 5
107#define JS_GET_TIMELIMIT 6
108#define JS_GET_ALL 7
109#define JS_SET_ALL 8
110
111struct JS_DATA_TYPE {
112 __s32 buttons;
113 __s32 x;
114 __s32 y;
115};
116
117struct JS_DATA_SAVE_TYPE_32 {
118 __s32 JS_TIMEOUT;
119 __s32 BUSY;
120 __s32 JS_EXPIRETIME;
121 __s32 JS_TIMELIMIT;
122 struct JS_DATA_TYPE JS_SAVE;
123 struct JS_DATA_TYPE JS_CORR;
124};
125
126struct JS_DATA_SAVE_TYPE_64 {
127 __s32 JS_TIMEOUT;
128 __s32 BUSY;
129 __s64 JS_EXPIRETIME;
130 __s64 JS_TIMELIMIT;
131 struct JS_DATA_TYPE JS_SAVE;
132 struct JS_DATA_TYPE JS_CORR;
133};
134
135
136#endif /* _UAPI_LINUX_JOYSTICK_H */
diff --git a/include/uapi/linux/kd.h b/include/uapi/linux/kd.h
new file mode 100644
index 00000000000..87b7cc439d7
--- /dev/null
+++ b/include/uapi/linux/kd.h
@@ -0,0 +1,183 @@
1#ifndef _UAPI_LINUX_KD_H
2#define _UAPI_LINUX_KD_H
3#include <linux/types.h>
4#include <linux/compiler.h>
5
6/* 0x4B is 'K', to avoid collision with termios and vt */
7
8#define GIO_FONT 0x4B60 /* gets font in expanded form */
9#define PIO_FONT 0x4B61 /* use font in expanded form */
10
11#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
12#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
13struct consolefontdesc {
14 unsigned short charcount; /* characters in font (256 or 512) */
15 unsigned short charheight; /* scan lines per character (1-32) */
16 char __user *chardata; /* font data in expanded form */
17};
18
19#define PIO_FONTRESET 0x4B6D /* reset to default font */
20
21#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
22#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
23
24#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
25#define KDMKTONE 0x4B30 /* generate tone */
26
27#define KDGETLED 0x4B31 /* return current led state */
28#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
29#define LED_SCR 0x01 /* scroll lock led */
30#define LED_NUM 0x02 /* num lock led */
31#define LED_CAP 0x04 /* caps lock led */
32
33#define KDGKBTYPE 0x4B33 /* get keyboard type */
34#define KB_84 0x01
35#define KB_101 0x02 /* this is what we always answer */
36#define KB_OTHER 0x03
37
38#define KDADDIO 0x4B34 /* add i/o port as valid */
39#define KDDELIO 0x4B35 /* del i/o port as valid */
40#define KDENABIO 0x4B36 /* enable i/o to video board */
41#define KDDISABIO 0x4B37 /* disable i/o to video board */
42
43#define KDSETMODE 0x4B3A /* set text/graphics mode */
44#define KD_TEXT 0x00
45#define KD_GRAPHICS 0x01
46#define KD_TEXT0 0x02 /* obsolete */
47#define KD_TEXT1 0x03 /* obsolete */
48#define KDGETMODE 0x4B3B /* get current mode */
49
50#define KDMAPDISP 0x4B3C /* map display into address space */
51#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
52
53typedef char scrnmap_t;
54#define E_TABSZ 256
55#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
56#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
57#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
58#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
59
60#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
61struct unipair {
62 unsigned short unicode;
63 unsigned short fontpos;
64};
65struct unimapdesc {
66 unsigned short entry_ct;
67 struct unipair __user *entries;
68};
69#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
70#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
71struct unimapinit {
72 unsigned short advised_hashsize; /* 0 if no opinion */
73 unsigned short advised_hashstep; /* 0 if no opinion */
74 unsigned short advised_hashlevel; /* 0 if no opinion */
75};
76
77#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
78#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
79
80#define K_RAW 0x00
81#define K_XLATE 0x01
82#define K_MEDIUMRAW 0x02
83#define K_UNICODE 0x03
84#define K_OFF 0x04
85#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
86#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
87
88#define K_METABIT 0x03
89#define K_ESCPREFIX 0x04
90#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
91#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
92
93#define K_SCROLLLOCK 0x01
94#define K_NUMLOCK 0x02
95#define K_CAPSLOCK 0x04
96#define KDGKBLED 0x4B64 /* get led flags (not lights) */
97#define KDSKBLED 0x4B65 /* set led flags (not lights) */
98
99struct kbentry {
100 unsigned char kb_table;
101 unsigned char kb_index;
102 unsigned short kb_value;
103};
104#define K_NORMTAB 0x00
105#define K_SHIFTTAB 0x01
106#define K_ALTTAB 0x02
107#define K_ALTSHIFTTAB 0x03
108
109#define KDGKBENT 0x4B46 /* gets one entry in translation table */
110#define KDSKBENT 0x4B47 /* sets one entry in translation table */
111
112struct kbsentry {
113 unsigned char kb_func;
114 unsigned char kb_string[512];
115};
116#define KDGKBSENT 0x4B48 /* gets one function key string entry */
117#define KDSKBSENT 0x4B49 /* sets one function key string entry */
118
119struct kbdiacr {
120 unsigned char diacr, base, result;
121};
122struct kbdiacrs {
123 unsigned int kb_cnt; /* number of entries in following array */
124 struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
125};
126#define KDGKBDIACR 0x4B4A /* read kernel accent table */
127#define KDSKBDIACR 0x4B4B /* write kernel accent table */
128
129struct kbdiacruc {
130 unsigned int diacr, base, result;
131};
132struct kbdiacrsuc {
133 unsigned int kb_cnt; /* number of entries in following array */
134 struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
135};
136#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
137#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
138
139struct kbkeycode {
140 unsigned int scancode, keycode;
141};
142#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
143#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
144
145#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
146
147struct kbd_repeat {
148 int delay; /* in msec; <= 0: don't change */
149 int period; /* in msec; <= 0: don't change */
150 /* earlier this field was misnamed "rate" */
151};
152
153#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
154 * actually used values are returned */
155
156#define KDFONTOP 0x4B72 /* font operations */
157
158struct console_font_op {
159 unsigned int op; /* operation code KD_FONT_OP_* */
160 unsigned int flags; /* KD_FONT_FLAG_* */
161 unsigned int width, height; /* font size */
162 unsigned int charcount;
163 unsigned char __user *data; /* font data with height fixed to 32 */
164};
165
166struct console_font {
167 unsigned int width, height; /* font size */
168 unsigned int charcount;
169 unsigned char *data; /* font data with height fixed to 32 */
170};
171
172#define KD_FONT_OP_SET 0 /* Set font */
173#define KD_FONT_OP_GET 1 /* Get font */
174#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
175#define KD_FONT_OP_COPY 3 /* Copy from another console */
176
177#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
178
179/* note: 0x4B00-0x4B4E all have had a value at some time;
180 don't reuse for the time being */
181/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
182
183#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
index 00000000000..0d881fa7eb9
--- /dev/null
+++ b/include/uapi/linux/kdev_t.h
@@ -0,0 +1,13 @@
1#ifndef _UAPI_LINUX_KDEV_T_H
2#define _UAPI_LINUX_KDEV_T_H
3#ifndef __KERNEL__
4
5/*
6Some programs want their definitions of MAJOR and MINOR and MKDEV
7from the kernel sources. These must be the externally visible ones.
8*/
9#define MAJOR(dev) ((dev)>>8)
10#define MINOR(dev) ((dev) & 0xff)
11#define MKDEV(ma,mi) ((ma)<<8 | (mi))
12#endif /* __KERNEL__ */
13#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
index 00000000000..5116a0e4817
--- /dev/null
+++ b/include/uapi/linux/kernel-page-flags.h
@@ -0,0 +1,36 @@
1#ifndef _UAPILINUX_KERNEL_PAGE_FLAGS_H
2#define _UAPILINUX_KERNEL_PAGE_FLAGS_H
3
4/*
5 * Stable page flag bits exported to user space
6 */
7
8#define KPF_LOCKED 0
9#define KPF_ERROR 1
10#define KPF_REFERENCED 2
11#define KPF_UPTODATE 3
12#define KPF_DIRTY 4
13#define KPF_LRU 5
14#define KPF_ACTIVE 6
15#define KPF_SLAB 7
16#define KPF_WRITEBACK 8
17#define KPF_RECLAIM 9
18#define KPF_BUDDY 10
19
20/* 11-20: new additions in 2.6.31 */
21#define KPF_MMAP 11
22#define KPF_ANON 12
23#define KPF_SWAPCACHE 13
24#define KPF_SWAPBACKED 14
25#define KPF_COMPOUND_HEAD 15
26#define KPF_COMPOUND_TAIL 16
27#define KPF_HUGE 17
28#define KPF_UNEVICTABLE 18
29#define KPF_HWPOISON 19
30#define KPF_NOPAGE 20
31
32#define KPF_KSM 21
33#define KPF_THP 22
34
35
36#endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
new file mode 100644
index 00000000000..321e399457f
--- /dev/null
+++ b/include/uapi/linux/kernel.h
@@ -0,0 +1,13 @@
1#ifndef _UAPI_LINUX_KERNEL_H
2#define _UAPI_LINUX_KERNEL_H
3
4#include <linux/sysinfo.h>
5
6/*
7 * 'kernel.h' contains some often-used function prototypes etc
8 */
9#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
10#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
11
12
13#endif /* _UAPI_LINUX_KERNEL_H */
diff --git a/include/uapi/linux/kernelcapi.h b/include/uapi/linux/kernelcapi.h
new file mode 100644
index 00000000000..89bf40d36d2
--- /dev/null
+++ b/include/uapi/linux/kernelcapi.h
@@ -0,0 +1,47 @@
1/*
2 * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $
3 *
4 * Kernel CAPI 2.0 Interface for Linux
5 *
6 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
7 *
8 */
9
10#ifndef _UAPI__KERNELCAPI_H__
11#define _UAPI__KERNELCAPI_H__
12
13#define CAPI_MAXAPPL 240 /* maximum number of applications */
14#define CAPI_MAXCONTR 32 /* maximum number of controller */
15#define CAPI_MAXDATAWINDOW 8
16
17
18typedef struct kcapi_flagdef {
19 int contr;
20 int flag;
21} kcapi_flagdef;
22
23typedef struct kcapi_carddef {
24 char driver[32];
25 unsigned int port;
26 unsigned irq;
27 unsigned int membase;
28 int cardnr;
29} kcapi_carddef;
30
31/* new ioctls >= 10 */
32#define KCAPI_CMD_TRACE 10
33#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
34
35/*
36 * flag > 2 => trace also data
37 * flag & 1 => show trace
38 */
39#define KCAPI_TRACE_OFF 0
40#define KCAPI_TRACE_SHORT_NO_DATA 1
41#define KCAPI_TRACE_FULL_NO_DATA 2
42#define KCAPI_TRACE_SHORT 3
43#define KCAPI_TRACE_FULL 4
44
45
46
47#endif /* _UAPI__KERNELCAPI_H__ */
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
new file mode 100644
index 00000000000..104838f65bc
--- /dev/null
+++ b/include/uapi/linux/kexec.h
@@ -0,0 +1,54 @@
1#ifndef _UAPILINUX_KEXEC_H
2#define _UAPILINUX_KEXEC_H
3
4/* kexec system call - It loads the new kernel to boot into.
5 * kexec does not sync, or unmount filesystems so if you need
6 * that to happen you need to do that yourself.
7 */
8
9#include <linux/types.h>
10
11/* kexec flags for different usage scenarios */
12#define KEXEC_ON_CRASH 0x00000001
13#define KEXEC_PRESERVE_CONTEXT 0x00000002
14#define KEXEC_ARCH_MASK 0xffff0000
15
16/* These values match the ELF architecture values.
17 * Unless there is a good reason that should continue to be the case.
18 */
19#define KEXEC_ARCH_DEFAULT ( 0 << 16)
20#define KEXEC_ARCH_386 ( 3 << 16)
21#define KEXEC_ARCH_X86_64 (62 << 16)
22#define KEXEC_ARCH_PPC (20 << 16)
23#define KEXEC_ARCH_PPC64 (21 << 16)
24#define KEXEC_ARCH_IA_64 (50 << 16)
25#define KEXEC_ARCH_ARM (40 << 16)
26#define KEXEC_ARCH_S390 (22 << 16)
27#define KEXEC_ARCH_SH (42 << 16)
28#define KEXEC_ARCH_MIPS_LE (10 << 16)
29#define KEXEC_ARCH_MIPS ( 8 << 16)
30
31/* The artificial cap on the number of segments passed to kexec_load. */
32#define KEXEC_SEGMENT_MAX 16
33
34#ifndef __KERNEL__
35/*
36 * This structure is used to hold the arguments that are used when
37 * loading kernel binaries.
38 */
39struct kexec_segment {
40 const void *buf;
41 size_t bufsz;
42 const void *mem;
43 size_t memsz;
44};
45
46/* Load a new kernel image as described by the kexec_segment array
47 * consisting of passed number of segments at the entry-point address.
48 * The flags allow different useage types.
49 */
50extern int kexec_load(void *, size_t, struct kexec_segment *,
51 unsigned long int);
52#endif /* __KERNEL__ */
53
54#endif /* _UAPILINUX_KEXEC_H */
diff --git a/include/uapi/linux/keyboard.h b/include/uapi/linux/keyboard.h
new file mode 100644
index 00000000000..5a6849721ab
--- /dev/null
+++ b/include/uapi/linux/keyboard.h
@@ -0,0 +1,443 @@
1#ifndef _UAPI__LINUX_KEYBOARD_H
2#define _UAPI__LINUX_KEYBOARD_H
3
4#include <linux/wait.h>
5
6#define KG_SHIFT 0
7#define KG_CTRL 2
8#define KG_ALT 3
9#define KG_ALTGR 1
10#define KG_SHIFTL 4
11#define KG_KANASHIFT 4
12#define KG_SHIFTR 5
13#define KG_CTRLL 6
14#define KG_CTRLR 7
15#define KG_CAPSSHIFT 8
16
17#define NR_SHIFT 9
18
19#define NR_KEYS 256
20#define MAX_NR_KEYMAPS 256
21/* This means 128Kb if all keymaps are allocated. Only the superuser
22 may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
23#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
24
25
26#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
27
28#define KT_LATIN 0 /* we depend on this being zero */
29#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
30#define KT_FN 1
31#define KT_SPEC 2
32#define KT_PAD 3
33#define KT_DEAD 4
34#define KT_CONS 5
35#define KT_CUR 6
36#define KT_SHIFT 7
37#define KT_META 8
38#define KT_ASCII 9
39#define KT_LOCK 10
40#define KT_SLOCK 12
41#define KT_DEAD2 13
42#define KT_BRL 14
43
44#define K(t,v) (((t)<<8)|(v))
45#define KTYP(x) ((x) >> 8)
46#define KVAL(x) ((x) & 0xff)
47
48#define K_F1 K(KT_FN,0)
49#define K_F2 K(KT_FN,1)
50#define K_F3 K(KT_FN,2)
51#define K_F4 K(KT_FN,3)
52#define K_F5 K(KT_FN,4)
53#define K_F6 K(KT_FN,5)
54#define K_F7 K(KT_FN,6)
55#define K_F8 K(KT_FN,7)
56#define K_F9 K(KT_FN,8)
57#define K_F10 K(KT_FN,9)
58#define K_F11 K(KT_FN,10)
59#define K_F12 K(KT_FN,11)
60#define K_F13 K(KT_FN,12)
61#define K_F14 K(KT_FN,13)
62#define K_F15 K(KT_FN,14)
63#define K_F16 K(KT_FN,15)
64#define K_F17 K(KT_FN,16)
65#define K_F18 K(KT_FN,17)
66#define K_F19 K(KT_FN,18)
67#define K_F20 K(KT_FN,19)
68#define K_FIND K(KT_FN,20)
69#define K_INSERT K(KT_FN,21)
70#define K_REMOVE K(KT_FN,22)
71#define K_SELECT K(KT_FN,23)
72#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
73#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
74#define K_MACRO K(KT_FN,26)
75#define K_HELP K(KT_FN,27)
76#define K_DO K(KT_FN,28)
77#define K_PAUSE K(KT_FN,29)
78#define K_F21 K(KT_FN,30)
79#define K_F22 K(KT_FN,31)
80#define K_F23 K(KT_FN,32)
81#define K_F24 K(KT_FN,33)
82#define K_F25 K(KT_FN,34)
83#define K_F26 K(KT_FN,35)
84#define K_F27 K(KT_FN,36)
85#define K_F28 K(KT_FN,37)
86#define K_F29 K(KT_FN,38)
87#define K_F30 K(KT_FN,39)
88#define K_F31 K(KT_FN,40)
89#define K_F32 K(KT_FN,41)
90#define K_F33 K(KT_FN,42)
91#define K_F34 K(KT_FN,43)
92#define K_F35 K(KT_FN,44)
93#define K_F36 K(KT_FN,45)
94#define K_F37 K(KT_FN,46)
95#define K_F38 K(KT_FN,47)
96#define K_F39 K(KT_FN,48)
97#define K_F40 K(KT_FN,49)
98#define K_F41 K(KT_FN,50)
99#define K_F42 K(KT_FN,51)
100#define K_F43 K(KT_FN,52)
101#define K_F44 K(KT_FN,53)
102#define K_F45 K(KT_FN,54)
103#define K_F46 K(KT_FN,55)
104#define K_F47 K(KT_FN,56)
105#define K_F48 K(KT_FN,57)
106#define K_F49 K(KT_FN,58)
107#define K_F50 K(KT_FN,59)
108#define K_F51 K(KT_FN,60)
109#define K_F52 K(KT_FN,61)
110#define K_F53 K(KT_FN,62)
111#define K_F54 K(KT_FN,63)
112#define K_F55 K(KT_FN,64)
113#define K_F56 K(KT_FN,65)
114#define K_F57 K(KT_FN,66)
115#define K_F58 K(KT_FN,67)
116#define K_F59 K(KT_FN,68)
117#define K_F60 K(KT_FN,69)
118#define K_F61 K(KT_FN,70)
119#define K_F62 K(KT_FN,71)
120#define K_F63 K(KT_FN,72)
121#define K_F64 K(KT_FN,73)
122#define K_F65 K(KT_FN,74)
123#define K_F66 K(KT_FN,75)
124#define K_F67 K(KT_FN,76)
125#define K_F68 K(KT_FN,77)
126#define K_F69 K(KT_FN,78)
127#define K_F70 K(KT_FN,79)
128#define K_F71 K(KT_FN,80)
129#define K_F72 K(KT_FN,81)
130#define K_F73 K(KT_FN,82)
131#define K_F74 K(KT_FN,83)
132#define K_F75 K(KT_FN,84)
133#define K_F76 K(KT_FN,85)
134#define K_F77 K(KT_FN,86)
135#define K_F78 K(KT_FN,87)
136#define K_F79 K(KT_FN,88)
137#define K_F80 K(KT_FN,89)
138#define K_F81 K(KT_FN,90)
139#define K_F82 K(KT_FN,91)
140#define K_F83 K(KT_FN,92)
141#define K_F84 K(KT_FN,93)
142#define K_F85 K(KT_FN,94)
143#define K_F86 K(KT_FN,95)
144#define K_F87 K(KT_FN,96)
145#define K_F88 K(KT_FN,97)
146#define K_F89 K(KT_FN,98)
147#define K_F90 K(KT_FN,99)
148#define K_F91 K(KT_FN,100)
149#define K_F92 K(KT_FN,101)
150#define K_F93 K(KT_FN,102)
151#define K_F94 K(KT_FN,103)
152#define K_F95 K(KT_FN,104)
153#define K_F96 K(KT_FN,105)
154#define K_F97 K(KT_FN,106)
155#define K_F98 K(KT_FN,107)
156#define K_F99 K(KT_FN,108)
157#define K_F100 K(KT_FN,109)
158#define K_F101 K(KT_FN,110)
159#define K_F102 K(KT_FN,111)
160#define K_F103 K(KT_FN,112)
161#define K_F104 K(KT_FN,113)
162#define K_F105 K(KT_FN,114)
163#define K_F106 K(KT_FN,115)
164#define K_F107 K(KT_FN,116)
165#define K_F108 K(KT_FN,117)
166#define K_F109 K(KT_FN,118)
167#define K_F110 K(KT_FN,119)
168#define K_F111 K(KT_FN,120)
169#define K_F112 K(KT_FN,121)
170#define K_F113 K(KT_FN,122)
171#define K_F114 K(KT_FN,123)
172#define K_F115 K(KT_FN,124)
173#define K_F116 K(KT_FN,125)
174#define K_F117 K(KT_FN,126)
175#define K_F118 K(KT_FN,127)
176#define K_F119 K(KT_FN,128)
177#define K_F120 K(KT_FN,129)
178#define K_F121 K(KT_FN,130)
179#define K_F122 K(KT_FN,131)
180#define K_F123 K(KT_FN,132)
181#define K_F124 K(KT_FN,133)
182#define K_F125 K(KT_FN,134)
183#define K_F126 K(KT_FN,135)
184#define K_F127 K(KT_FN,136)
185#define K_F128 K(KT_FN,137)
186#define K_F129 K(KT_FN,138)
187#define K_F130 K(KT_FN,139)
188#define K_F131 K(KT_FN,140)
189#define K_F132 K(KT_FN,141)
190#define K_F133 K(KT_FN,142)
191#define K_F134 K(KT_FN,143)
192#define K_F135 K(KT_FN,144)
193#define K_F136 K(KT_FN,145)
194#define K_F137 K(KT_FN,146)
195#define K_F138 K(KT_FN,147)
196#define K_F139 K(KT_FN,148)
197#define K_F140 K(KT_FN,149)
198#define K_F141 K(KT_FN,150)
199#define K_F142 K(KT_FN,151)
200#define K_F143 K(KT_FN,152)
201#define K_F144 K(KT_FN,153)
202#define K_F145 K(KT_FN,154)
203#define K_F146 K(KT_FN,155)
204#define K_F147 K(KT_FN,156)
205#define K_F148 K(KT_FN,157)
206#define K_F149 K(KT_FN,158)
207#define K_F150 K(KT_FN,159)
208#define K_F151 K(KT_FN,160)
209#define K_F152 K(KT_FN,161)
210#define K_F153 K(KT_FN,162)
211#define K_F154 K(KT_FN,163)
212#define K_F155 K(KT_FN,164)
213#define K_F156 K(KT_FN,165)
214#define K_F157 K(KT_FN,166)
215#define K_F158 K(KT_FN,167)
216#define K_F159 K(KT_FN,168)
217#define K_F160 K(KT_FN,169)
218#define K_F161 K(KT_FN,170)
219#define K_F162 K(KT_FN,171)
220#define K_F163 K(KT_FN,172)
221#define K_F164 K(KT_FN,173)
222#define K_F165 K(KT_FN,174)
223#define K_F166 K(KT_FN,175)
224#define K_F167 K(KT_FN,176)
225#define K_F168 K(KT_FN,177)
226#define K_F169 K(KT_FN,178)
227#define K_F170 K(KT_FN,179)
228#define K_F171 K(KT_FN,180)
229#define K_F172 K(KT_FN,181)
230#define K_F173 K(KT_FN,182)
231#define K_F174 K(KT_FN,183)
232#define K_F175 K(KT_FN,184)
233#define K_F176 K(KT_FN,185)
234#define K_F177 K(KT_FN,186)
235#define K_F178 K(KT_FN,187)
236#define K_F179 K(KT_FN,188)
237#define K_F180 K(KT_FN,189)
238#define K_F181 K(KT_FN,190)
239#define K_F182 K(KT_FN,191)
240#define K_F183 K(KT_FN,192)
241#define K_F184 K(KT_FN,193)
242#define K_F185 K(KT_FN,194)
243#define K_F186 K(KT_FN,195)
244#define K_F187 K(KT_FN,196)
245#define K_F188 K(KT_FN,197)
246#define K_F189 K(KT_FN,198)
247#define K_F190 K(KT_FN,199)
248#define K_F191 K(KT_FN,200)
249#define K_F192 K(KT_FN,201)
250#define K_F193 K(KT_FN,202)
251#define K_F194 K(KT_FN,203)
252#define K_F195 K(KT_FN,204)
253#define K_F196 K(KT_FN,205)
254#define K_F197 K(KT_FN,206)
255#define K_F198 K(KT_FN,207)
256#define K_F199 K(KT_FN,208)
257#define K_F200 K(KT_FN,209)
258#define K_F201 K(KT_FN,210)
259#define K_F202 K(KT_FN,211)
260#define K_F203 K(KT_FN,212)
261#define K_F204 K(KT_FN,213)
262#define K_F205 K(KT_FN,214)
263#define K_F206 K(KT_FN,215)
264#define K_F207 K(KT_FN,216)
265#define K_F208 K(KT_FN,217)
266#define K_F209 K(KT_FN,218)
267#define K_F210 K(KT_FN,219)
268#define K_F211 K(KT_FN,220)
269#define K_F212 K(KT_FN,221)
270#define K_F213 K(KT_FN,222)
271#define K_F214 K(KT_FN,223)
272#define K_F215 K(KT_FN,224)
273#define K_F216 K(KT_FN,225)
274#define K_F217 K(KT_FN,226)
275#define K_F218 K(KT_FN,227)
276#define K_F219 K(KT_FN,228)
277#define K_F220 K(KT_FN,229)
278#define K_F221 K(KT_FN,230)
279#define K_F222 K(KT_FN,231)
280#define K_F223 K(KT_FN,232)
281#define K_F224 K(KT_FN,233)
282#define K_F225 K(KT_FN,234)
283#define K_F226 K(KT_FN,235)
284#define K_F227 K(KT_FN,236)
285#define K_F228 K(KT_FN,237)
286#define K_F229 K(KT_FN,238)
287#define K_F230 K(KT_FN,239)
288#define K_F231 K(KT_FN,240)
289#define K_F232 K(KT_FN,241)
290#define K_F233 K(KT_FN,242)
291#define K_F234 K(KT_FN,243)
292#define K_F235 K(KT_FN,244)
293#define K_F236 K(KT_FN,245)
294#define K_F237 K(KT_FN,246)
295#define K_F238 K(KT_FN,247)
296#define K_F239 K(KT_FN,248)
297#define K_F240 K(KT_FN,249)
298#define K_F241 K(KT_FN,250)
299#define K_F242 K(KT_FN,251)
300#define K_F243 K(KT_FN,252)
301#define K_F244 K(KT_FN,253)
302#define K_F245 K(KT_FN,254)
303#define K_UNDO K(KT_FN,255)
304
305
306#define K_HOLE K(KT_SPEC,0)
307#define K_ENTER K(KT_SPEC,1)
308#define K_SH_REGS K(KT_SPEC,2)
309#define K_SH_MEM K(KT_SPEC,3)
310#define K_SH_STAT K(KT_SPEC,4)
311#define K_BREAK K(KT_SPEC,5)
312#define K_CONS K(KT_SPEC,6)
313#define K_CAPS K(KT_SPEC,7)
314#define K_NUM K(KT_SPEC,8)
315#define K_HOLD K(KT_SPEC,9)
316#define K_SCROLLFORW K(KT_SPEC,10)
317#define K_SCROLLBACK K(KT_SPEC,11)
318#define K_BOOT K(KT_SPEC,12)
319#define K_CAPSON K(KT_SPEC,13)
320#define K_COMPOSE K(KT_SPEC,14)
321#define K_SAK K(KT_SPEC,15)
322#define K_DECRCONSOLE K(KT_SPEC,16)
323#define K_INCRCONSOLE K(KT_SPEC,17)
324#define K_SPAWNCONSOLE K(KT_SPEC,18)
325#define K_BARENUMLOCK K(KT_SPEC,19)
326
327#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
328#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
329
330#define K_P0 K(KT_PAD,0)
331#define K_P1 K(KT_PAD,1)
332#define K_P2 K(KT_PAD,2)
333#define K_P3 K(KT_PAD,3)
334#define K_P4 K(KT_PAD,4)
335#define K_P5 K(KT_PAD,5)
336#define K_P6 K(KT_PAD,6)
337#define K_P7 K(KT_PAD,7)
338#define K_P8 K(KT_PAD,8)
339#define K_P9 K(KT_PAD,9)
340#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
341#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
342#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
343#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
344#define K_PENTER K(KT_PAD,14) /* key-pad enter */
345#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
346#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
347#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
348#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
349#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
350
351#define NR_PAD 20
352
353#define K_DGRAVE K(KT_DEAD,0)
354#define K_DACUTE K(KT_DEAD,1)
355#define K_DCIRCM K(KT_DEAD,2)
356#define K_DTILDE K(KT_DEAD,3)
357#define K_DDIERE K(KT_DEAD,4)
358#define K_DCEDIL K(KT_DEAD,5)
359
360#define NR_DEAD 6
361
362#define K_DOWN K(KT_CUR,0)
363#define K_LEFT K(KT_CUR,1)
364#define K_RIGHT K(KT_CUR,2)
365#define K_UP K(KT_CUR,3)
366
367#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
368#define K_CTRL K(KT_SHIFT,KG_CTRL)
369#define K_ALT K(KT_SHIFT,KG_ALT)
370#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
371#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
372#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
373#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
374#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
375#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
376
377#define K_ASC0 K(KT_ASCII,0)
378#define K_ASC1 K(KT_ASCII,1)
379#define K_ASC2 K(KT_ASCII,2)
380#define K_ASC3 K(KT_ASCII,3)
381#define K_ASC4 K(KT_ASCII,4)
382#define K_ASC5 K(KT_ASCII,5)
383#define K_ASC6 K(KT_ASCII,6)
384#define K_ASC7 K(KT_ASCII,7)
385#define K_ASC8 K(KT_ASCII,8)
386#define K_ASC9 K(KT_ASCII,9)
387#define K_HEX0 K(KT_ASCII,10)
388#define K_HEX1 K(KT_ASCII,11)
389#define K_HEX2 K(KT_ASCII,12)
390#define K_HEX3 K(KT_ASCII,13)
391#define K_HEX4 K(KT_ASCII,14)
392#define K_HEX5 K(KT_ASCII,15)
393#define K_HEX6 K(KT_ASCII,16)
394#define K_HEX7 K(KT_ASCII,17)
395#define K_HEX8 K(KT_ASCII,18)
396#define K_HEX9 K(KT_ASCII,19)
397#define K_HEXa K(KT_ASCII,20)
398#define K_HEXb K(KT_ASCII,21)
399#define K_HEXc K(KT_ASCII,22)
400#define K_HEXd K(KT_ASCII,23)
401#define K_HEXe K(KT_ASCII,24)
402#define K_HEXf K(KT_ASCII,25)
403
404#define NR_ASCII 26
405
406#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
407#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
408#define K_ALTLOCK K(KT_LOCK,KG_ALT)
409#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
410#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
411#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
412#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
413#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
414#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
415
416#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
417#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
418#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
419#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
420#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
421#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
422#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
423#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
424#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
425
426#define NR_LOCK 9
427
428#define K_BRL_BLANK K(KT_BRL, 0)
429#define K_BRL_DOT1 K(KT_BRL, 1)
430#define K_BRL_DOT2 K(KT_BRL, 2)
431#define K_BRL_DOT3 K(KT_BRL, 3)
432#define K_BRL_DOT4 K(KT_BRL, 4)
433#define K_BRL_DOT5 K(KT_BRL, 5)
434#define K_BRL_DOT6 K(KT_BRL, 6)
435#define K_BRL_DOT7 K(KT_BRL, 7)
436#define K_BRL_DOT8 K(KT_BRL, 8)
437#define K_BRL_DOT9 K(KT_BRL, 9)
438#define K_BRL_DOT10 K(KT_BRL, 10)
439
440#define NR_BRL 11
441
442#define MAX_DIACR 256
443#endif /* _UAPI__LINUX_KEYBOARD_H */
diff --git a/include/linux/keyctl.h b/include/uapi/linux/keyctl.h
index c9b7f4faf97..c9b7f4faf97 100644
--- a/include/linux/keyctl.h
+++ b/include/uapi/linux/keyctl.h
diff --git a/include/linux/kvm.h b/include/uapi/linux/kvm.h
index 0a6d6ba44c8..0a6d6ba44c8 100644
--- a/include/linux/kvm.h
+++ b/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
index 00000000000..cea2c5c72d2
--- /dev/null
+++ b/include/uapi/linux/kvm_para.h
@@ -0,0 +1,28 @@
1#ifndef _UAPI__LINUX_KVM_PARA_H
2#define _UAPI__LINUX_KVM_PARA_H
3
4/*
5 * This header file provides a method for making a hypercall to the host
6 * Architectures should define:
7 * - kvm_hypercall0, kvm_hypercall1...
8 * - kvm_arch_para_features
9 * - kvm_para_available
10 */
11
12/* Return values for hypercalls */
13#define KVM_ENOSYS 1000
14#define KVM_EFAULT EFAULT
15#define KVM_E2BIG E2BIG
16#define KVM_EPERM EPERM
17
18#define KVM_HC_VAPIC_POLL_IRQ 1
19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
22
23/*
24 * hypercalls use architecture specific
25 */
26#include <asm/kvm_para.h>
27
28#endif /* _UAPI__LINUX_KVM_PARA_H */
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
new file mode 100644
index 00000000000..8adb6816032
--- /dev/null
+++ b/include/uapi/linux/l2tp.h
@@ -0,0 +1,180 @@
1/*
2 * L2TP-over-IP socket for L2TPv3.
3 *
4 * Author: James Chapman <jchapman@katalix.com>
5 */
6
7#ifndef _UAPI_LINUX_L2TP_H_
8#define _UAPI_LINUX_L2TP_H_
9
10#include <linux/types.h>
11#include <linux/socket.h>
12#ifndef __KERNEL__
13#include <netinet/in.h>
14#endif
15
16#define IPPROTO_L2TP 115
17
18/**
19 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
20 * @l2tp_family: address family number AF_L2TPIP.
21 * @l2tp_addr: protocol specific address information
22 * @l2tp_conn_id: connection id of tunnel
23 */
24#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
25struct sockaddr_l2tpip {
26 /* The first fields must match struct sockaddr_in */
27 __kernel_sa_family_t l2tp_family; /* AF_INET */
28 __be16 l2tp_unused; /* INET port number (unused) */
29 struct in_addr l2tp_addr; /* Internet address */
30
31 __u32 l2tp_conn_id; /* Connection ID of tunnel */
32
33 /* Pad to size of `struct sockaddr'. */
34 unsigned char __pad[sizeof(struct sockaddr) -
35 sizeof(__kernel_sa_family_t) -
36 sizeof(__be16) - sizeof(struct in_addr) -
37 sizeof(__u32)];
38};
39
40/**
41 * struct sockaddr_l2tpip6 - the sockaddr structure for L2TP-over-IPv6 sockets
42 * @l2tp_family: address family number AF_L2TPIP.
43 * @l2tp_addr: protocol specific address information
44 * @l2tp_conn_id: connection id of tunnel
45 */
46struct sockaddr_l2tpip6 {
47 /* The first fields must match struct sockaddr_in6 */
48 __kernel_sa_family_t l2tp_family; /* AF_INET6 */
49 __be16 l2tp_unused; /* INET port number (unused) */
50 __be32 l2tp_flowinfo; /* IPv6 flow information */
51 struct in6_addr l2tp_addr; /* IPv6 address */
52 __u32 l2tp_scope_id; /* scope id (new in RFC2553) */
53 __u32 l2tp_conn_id; /* Connection ID of tunnel */
54};
55
56/*****************************************************************************
57 * NETLINK_GENERIC netlink family.
58 *****************************************************************************/
59
60/*
61 * Commands.
62 * Valid TLVs of each command are:-
63 * TUNNEL_CREATE - CONN_ID, pw_type, netns, ifname, ipinfo, udpinfo, udpcsum, vlanid
64 * TUNNEL_DELETE - CONN_ID
65 * TUNNEL_MODIFY - CONN_ID, udpcsum
66 * TUNNEL_GETSTATS - CONN_ID, (stats)
67 * TUNNEL_GET - CONN_ID, (...)
68 * SESSION_CREATE - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec
69 * SESSION_DELETE - SESSION_ID
70 * SESSION_MODIFY - SESSION_ID, data_seq
71 * SESSION_GET - SESSION_ID, (...)
72 * SESSION_GETSTATS - SESSION_ID, (stats)
73 *
74 */
75enum {
76 L2TP_CMD_NOOP,
77 L2TP_CMD_TUNNEL_CREATE,
78 L2TP_CMD_TUNNEL_DELETE,
79 L2TP_CMD_TUNNEL_MODIFY,
80 L2TP_CMD_TUNNEL_GET,
81 L2TP_CMD_SESSION_CREATE,
82 L2TP_CMD_SESSION_DELETE,
83 L2TP_CMD_SESSION_MODIFY,
84 L2TP_CMD_SESSION_GET,
85 __L2TP_CMD_MAX,
86};
87
88#define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
89
90/*
91 * ATTR types defined for L2TP
92 */
93enum {
94 L2TP_ATTR_NONE, /* no data */
95 L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */
96 L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */
97 L2TP_ATTR_OFFSET, /* u16 */
98 L2TP_ATTR_DATA_SEQ, /* u16 */
99 L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */
100 L2TP_ATTR_L2SPEC_LEN, /* u8, enum l2tp_l2spec_type */
101 L2TP_ATTR_PROTO_VERSION, /* u8 */
102 L2TP_ATTR_IFNAME, /* string */
103 L2TP_ATTR_CONN_ID, /* u32 */
104 L2TP_ATTR_PEER_CONN_ID, /* u32 */
105 L2TP_ATTR_SESSION_ID, /* u32 */
106 L2TP_ATTR_PEER_SESSION_ID, /* u32 */
107 L2TP_ATTR_UDP_CSUM, /* u8 */
108 L2TP_ATTR_VLAN_ID, /* u16 */
109 L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */
110 L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */
111 L2TP_ATTR_DEBUG, /* u32 */
112 L2TP_ATTR_RECV_SEQ, /* u8 */
113 L2TP_ATTR_SEND_SEQ, /* u8 */
114 L2TP_ATTR_LNS_MODE, /* u8 */
115 L2TP_ATTR_USING_IPSEC, /* u8 */
116 L2TP_ATTR_RECV_TIMEOUT, /* msec */
117 L2TP_ATTR_FD, /* int */
118 L2TP_ATTR_IP_SADDR, /* u32 */
119 L2TP_ATTR_IP_DADDR, /* u32 */
120 L2TP_ATTR_UDP_SPORT, /* u16 */
121 L2TP_ATTR_UDP_DPORT, /* u16 */
122 L2TP_ATTR_MTU, /* u16 */
123 L2TP_ATTR_MRU, /* u16 */
124 L2TP_ATTR_STATS, /* nested */
125 L2TP_ATTR_IP6_SADDR, /* struct in6_addr */
126 L2TP_ATTR_IP6_DADDR, /* struct in6_addr */
127 __L2TP_ATTR_MAX,
128};
129
130#define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
131
132/* Nested in L2TP_ATTR_STATS */
133enum {
134 L2TP_ATTR_STATS_NONE, /* no data */
135 L2TP_ATTR_TX_PACKETS, /* u64 */
136 L2TP_ATTR_TX_BYTES, /* u64 */
137 L2TP_ATTR_TX_ERRORS, /* u64 */
138 L2TP_ATTR_RX_PACKETS, /* u64 */
139 L2TP_ATTR_RX_BYTES, /* u64 */
140 L2TP_ATTR_RX_SEQ_DISCARDS, /* u64 */
141 L2TP_ATTR_RX_OOS_PACKETS, /* u64 */
142 L2TP_ATTR_RX_ERRORS, /* u64 */
143 __L2TP_ATTR_STATS_MAX,
144};
145
146#define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
147
148enum l2tp_pwtype {
149 L2TP_PWTYPE_NONE = 0x0000,
150 L2TP_PWTYPE_ETH_VLAN = 0x0004,
151 L2TP_PWTYPE_ETH = 0x0005,
152 L2TP_PWTYPE_PPP = 0x0007,
153 L2TP_PWTYPE_PPP_AC = 0x0008,
154 L2TP_PWTYPE_IP = 0x000b,
155 __L2TP_PWTYPE_MAX
156};
157
158enum l2tp_l2spec_type {
159 L2TP_L2SPECTYPE_NONE,
160 L2TP_L2SPECTYPE_DEFAULT,
161};
162
163enum l2tp_encap_type {
164 L2TP_ENCAPTYPE_UDP,
165 L2TP_ENCAPTYPE_IP,
166};
167
168enum l2tp_seqmode {
169 L2TP_SEQ_NONE = 0,
170 L2TP_SEQ_IP = 1,
171 L2TP_SEQ_ALL = 2,
172};
173
174/*
175 * NETLINK_GENERIC related info
176 */
177#define L2TP_GENL_NAME "l2tp"
178#define L2TP_GENL_VERSION 0x1
179
180#endif /* _UAPI_LINUX_L2TP_H_ */
diff --git a/include/linux/limits.h b/include/uapi/linux/limits.h
index 2d0f94162fb..2d0f94162fb 100644
--- a/include/linux/limits.h
+++ b/include/uapi/linux/limits.h
diff --git a/include/uapi/linux/llc.h b/include/uapi/linux/llc.h
new file mode 100644
index 00000000000..9c987a40247
--- /dev/null
+++ b/include/uapi/linux/llc.h
@@ -0,0 +1,84 @@
1/*
2 * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
3 *
4 * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
5 *
6 * This program can be redistributed or modified under the terms of the
7 * GNU General Public License as published by the Free Software Foundation.
8 * This program is distributed without any warranty or implied warranty
9 * of merchantability or fitness for a particular purpose.
10 *
11 * See the GNU General Public License for more details.
12 */
13#ifndef _UAPI__LINUX_LLC_H
14#define _UAPI__LINUX_LLC_H
15
16#include <linux/socket.h>
17
18#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
19struct sockaddr_llc {
20 __kernel_sa_family_t sllc_family; /* AF_LLC */
21 __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
22 unsigned char sllc_test;
23 unsigned char sllc_xid;
24 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
25 unsigned char sllc_sap;
26 unsigned char sllc_mac[IFHWADDRLEN];
27 unsigned char __pad[__LLC_SOCK_SIZE__ -
28 sizeof(__kernel_sa_family_t) * 2 -
29 sizeof(unsigned char) * 4 - IFHWADDRLEN];
30};
31
32/* sockopt definitions. */
33enum llc_sockopts {
34 LLC_OPT_UNKNOWN = 0,
35 LLC_OPT_RETRY, /* max retrans attempts. */
36 LLC_OPT_SIZE, /* max PDU size (octets). */
37 LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
38 LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
39 LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
40 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
41 LLC_OPT_TX_WIN, /* tx window size. */
42 LLC_OPT_RX_WIN, /* rx window size. */
43 LLC_OPT_PKTINFO, /* ancillary packet information. */
44 LLC_OPT_MAX
45};
46
47#define LLC_OPT_MAX_RETRY 100
48#define LLC_OPT_MAX_SIZE 4196
49#define LLC_OPT_MAX_WIN 127
50#define LLC_OPT_MAX_ACK_TMR_EXP 60
51#define LLC_OPT_MAX_P_TMR_EXP 60
52#define LLC_OPT_MAX_REJ_TMR_EXP 60
53#define LLC_OPT_MAX_BUSY_TMR_EXP 60
54
55/* LLC SAP types. */
56#define LLC_SAP_NULL 0x00 /* NULL SAP. */
57#define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */
58#define LLC_SAP_SNA 0x04 /* SNA Path Control. */
59#define LLC_SAP_PNM 0x0E /* Proway Network Management. */
60#define LLC_SAP_IP 0x06 /* TCP/IP. */
61#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
62#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
63#define LLC_SAP_8208 0x7E /* ISO 8208 */
64#define LLC_SAP_3COM 0x80 /* 3COM. */
65#define LLC_SAP_PRO 0x8E /* Proway Active Station List */
66#define LLC_SAP_SNAP 0xAA /* SNAP. */
67#define LLC_SAP_BANYAN 0xBC /* Banyan. */
68#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
69#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
70#define LLC_SAP_LANMGR 0xF4 /* LanManager. */
71#define LLC_SAP_IMPL 0xF8 /* IMPL */
72#define LLC_SAP_DISC 0xFC /* Discovery */
73#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
74#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
75#define LLC_SAP_RM 0xD4 /* Resource Management */
76#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
77
78struct llc_pktinfo {
79 int lpi_ifindex;
80 unsigned char lpi_sap;
81 unsigned char lpi_mac[IFHWADDRLEN];
82};
83
84#endif /* _UAPI__LINUX_LLC_H */
diff --git a/include/uapi/linux/loop.h b/include/uapi/linux/loop.h
new file mode 100644
index 00000000000..e0cecd2eabd
--- /dev/null
+++ b/include/uapi/linux/loop.h
@@ -0,0 +1,94 @@
1/*
2 * include/linux/loop.h
3 *
4 * Written by Theodore Ts'o, 3/29/93.
5 *
6 * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
7 * permitted under the GNU General Public License.
8 */
9#ifndef _UAPI_LINUX_LOOP_H
10#define _UAPI_LINUX_LOOP_H
11
12
13#define LO_NAME_SIZE 64
14#define LO_KEY_SIZE 32
15
16
17/*
18 * Loop flags
19 */
20enum {
21 LO_FLAGS_READ_ONLY = 1,
22 LO_FLAGS_AUTOCLEAR = 4,
23 LO_FLAGS_PARTSCAN = 8,
24};
25
26#include <asm/posix_types.h> /* for __kernel_old_dev_t */
27#include <linux/types.h> /* for __u64 */
28
29/* Backwards compatibility version */
30struct loop_info {
31 int lo_number; /* ioctl r/o */
32 __kernel_old_dev_t lo_device; /* ioctl r/o */
33 unsigned long lo_inode; /* ioctl r/o */
34 __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
35 int lo_offset;
36 int lo_encrypt_type;
37 int lo_encrypt_key_size; /* ioctl w/o */
38 int lo_flags; /* ioctl r/o */
39 char lo_name[LO_NAME_SIZE];
40 unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
41 unsigned long lo_init[2];
42 char reserved[4];
43};
44
45struct loop_info64 {
46 __u64 lo_device; /* ioctl r/o */
47 __u64 lo_inode; /* ioctl r/o */
48 __u64 lo_rdevice; /* ioctl r/o */
49 __u64 lo_offset;
50 __u64 lo_sizelimit;/* bytes, 0 == max available */
51 __u32 lo_number; /* ioctl r/o */
52 __u32 lo_encrypt_type;
53 __u32 lo_encrypt_key_size; /* ioctl w/o */
54 __u32 lo_flags; /* ioctl r/o */
55 __u8 lo_file_name[LO_NAME_SIZE];
56 __u8 lo_crypt_name[LO_NAME_SIZE];
57 __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
58 __u64 lo_init[2];
59};
60
61/*
62 * Loop filter types
63 */
64
65#define LO_CRYPT_NONE 0
66#define LO_CRYPT_XOR 1
67#define LO_CRYPT_DES 2
68#define LO_CRYPT_FISH2 3 /* Twofish encryption */
69#define LO_CRYPT_BLOW 4
70#define LO_CRYPT_CAST128 5
71#define LO_CRYPT_IDEA 6
72#define LO_CRYPT_DUMMY 9
73#define LO_CRYPT_SKIPJACK 10
74#define LO_CRYPT_CRYPTOAPI 18
75#define MAX_LO_CRYPT 20
76
77/*
78 * IOCTL commands --- we will commandeer 0x4C ('L')
79 */
80
81#define LOOP_SET_FD 0x4C00
82#define LOOP_CLR_FD 0x4C01
83#define LOOP_SET_STATUS 0x4C02
84#define LOOP_GET_STATUS 0x4C03
85#define LOOP_SET_STATUS64 0x4C04
86#define LOOP_GET_STATUS64 0x4C05
87#define LOOP_CHANGE_FD 0x4C06
88#define LOOP_SET_CAPACITY 0x4C07
89
90/* /dev/loop-control interface */
91#define LOOP_CTL_ADD 0x4C80
92#define LOOP_CTL_REMOVE 0x4C81
93#define LOOP_CTL_GET_FREE 0x4C82
94#endif /* _UAPI_LINUX_LOOP_H */
diff --git a/include/uapi/linux/lp.h b/include/uapi/linux/lp.h
new file mode 100644
index 00000000000..a3406a51f19
--- /dev/null
+++ b/include/uapi/linux/lp.h
@@ -0,0 +1,100 @@
1/*
2 * usr/include/linux/lp.h c.1991-1992 James Wiegand
3 * many modifications copyright (C) 1992 Michael K. Johnson
4 * Interrupt support added 1993 Nigel Gamble
5 * Removed 8255 status defines from inside __KERNEL__ Marcelo Tosatti
6 */
7#ifndef _UAPI_LINUX_LP_H
8#define _UAPI_LINUX_LP_H
9
10
11/*
12 * Per POSIX guidelines, this module reserves the LP and lp prefixes
13 * These are the lp_table[minor].flags flags...
14 */
15#define LP_EXIST 0x0001
16#define LP_SELEC 0x0002
17#define LP_BUSY 0x0004
18#define LP_BUSY_BIT_POS 2
19#define LP_OFFL 0x0008
20#define LP_NOPA 0x0010
21#define LP_ERR 0x0020
22#define LP_ABORT 0x0040
23#define LP_CAREFUL 0x0080 /* obsoleted -arca */
24#define LP_ABORTOPEN 0x0100
25
26#define LP_TRUST_IRQ_ 0x0200 /* obsolete */
27#define LP_NO_REVERSE 0x0400 /* No reverse mode available. */
28#define LP_DATA_AVAIL 0x0800 /* Data is available. */
29
30/*
31 * bit defines for 8255 status port
32 * base + 1
33 * accessed with LP_S(minor), which gets the byte...
34 */
35#define LP_PBUSY 0x80 /* inverted input, active high */
36#define LP_PACK 0x40 /* unchanged input, active low */
37#define LP_POUTPA 0x20 /* unchanged input, active high */
38#define LP_PSELECD 0x10 /* unchanged input, active high */
39#define LP_PERRORP 0x08 /* unchanged input, active low */
40
41/* timeout for each character. This is relative to bus cycles -- it
42 * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you
43 * have extremely slow printing, or if the machine seems to slow down
44 * a lot when you print. If you have slow printing, increase this
45 * number and recompile, and if your system gets bogged down, decrease
46 * this number. This can be changed with the tunelp(8) command as well.
47 */
48
49#define LP_INIT_CHAR 1000
50
51/* The parallel port specs apparently say that there needs to be
52 * a .5usec wait before and after the strobe.
53 */
54
55#define LP_INIT_WAIT 1
56
57/* This is the amount of time that the driver waits for the printer to
58 * catch up when the printer's buffer appears to be filled. If you
59 * want to tune this and have a fast printer (i.e. HPIIIP), decrease
60 * this number, and if you have a slow printer, increase this number.
61 * This is in hundredths of a second, the default 2 being .05 second.
62 * Or use the tunelp(8) command, which is especially nice if you want
63 * change back and forth between character and graphics printing, which
64 * are wildly different...
65 */
66
67#define LP_INIT_TIME 2
68
69/* IOCTL numbers */
70#define LPCHAR 0x0601 /* corresponds to LP_INIT_CHAR */
71#define LPTIME 0x0602 /* corresponds to LP_INIT_TIME */
72#define LPABORT 0x0604 /* call with TRUE arg to abort on error,
73 FALSE to retry. Default is retry. */
74#define LPSETIRQ 0x0605 /* call with new IRQ number,
75 or 0 for polling (no IRQ) */
76#define LPGETIRQ 0x0606 /* get the current IRQ number */
77#define LPWAIT 0x0608 /* corresponds to LP_INIT_WAIT */
78/* NOTE: LPCAREFUL is obsoleted and it' s always the default right now -arca */
79#define LPCAREFUL 0x0609 /* call with TRUE arg to require out-of-paper, off-
80 line, and error indicators good on all writes,
81 FALSE to ignore them. Default is ignore. */
82#define LPABORTOPEN 0x060a /* call with TRUE arg to abort open() on error,
83 FALSE to ignore error. Default is ignore. */
84#define LPGETSTATUS 0x060b /* return LP_S(minor) */
85#define LPRESET 0x060c /* reset printer */
86#ifdef LP_STATS
87#define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */
88#endif
89#define LPGETFLAGS 0x060e /* get status flags */
90#define LPSETTIMEOUT 0x060f /* set parport timeout */
91
92/* timeout for printk'ing a timeout, in jiffies (100ths of a second).
93 This is also used for re-checking error conditions if LP_ABORT is
94 not set. This is the default behavior. */
95
96#define LP_TIMEOUT_INTERRUPT (60 * HZ)
97#define LP_TIMEOUT_POLLED (10 * HZ)
98
99
100#endif /* _UAPI_LINUX_LP_H */
diff --git a/include/linux/magic.h b/include/uapi/linux/magic.h
index e15192cb9cf..e15192cb9cf 100644
--- a/include/linux/magic.h
+++ b/include/uapi/linux/magic.h
diff --git a/include/linux/major.h b/include/uapi/linux/major.h
index 6a8ca98c9a9..6a8ca98c9a9 100644
--- a/include/linux/major.h
+++ b/include/uapi/linux/major.h
diff --git a/include/linux/map_to_7segment.h b/include/uapi/linux/map_to_7segment.h
index 12d62a54d47..12d62a54d47 100644
--- a/include/linux/map_to_7segment.h
+++ b/include/uapi/linux/map_to_7segment.h
diff --git a/include/linux/matroxfb.h b/include/uapi/linux/matroxfb.h
index 8c22a893864..8c22a893864 100644
--- a/include/linux/matroxfb.h
+++ b/include/uapi/linux/matroxfb.h
diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
new file mode 100644
index 00000000000..c94a510a577
--- /dev/null
+++ b/include/uapi/linux/mdio.h
@@ -0,0 +1,297 @@
1/*
2 * linux/mdio.h: definitions for MDIO (clause 45) transceivers
3 * Copyright 2006-2009 Solarflare Communications Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
8 */
9
10#ifndef _UAPI__LINUX_MDIO_H__
11#define _UAPI__LINUX_MDIO_H__
12
13#include <linux/types.h>
14#include <linux/mii.h>
15
16/* MDIO Manageable Devices (MMDs). */
17#define MDIO_MMD_PMAPMD 1 /* Physical Medium Attachment/
18 * Physical Medium Dependent */
19#define MDIO_MMD_WIS 2 /* WAN Interface Sublayer */
20#define MDIO_MMD_PCS 3 /* Physical Coding Sublayer */
21#define MDIO_MMD_PHYXS 4 /* PHY Extender Sublayer */
22#define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */
23#define MDIO_MMD_TC 6 /* Transmission Convergence */
24#define MDIO_MMD_AN 7 /* Auto-Negotiation */
25#define MDIO_MMD_C22EXT 29 /* Clause 22 extension */
26#define MDIO_MMD_VEND1 30 /* Vendor specific 1 */
27#define MDIO_MMD_VEND2 31 /* Vendor specific 2 */
28
29/* Generic MDIO registers. */
30#define MDIO_CTRL1 MII_BMCR
31#define MDIO_STAT1 MII_BMSR
32#define MDIO_DEVID1 MII_PHYSID1
33#define MDIO_DEVID2 MII_PHYSID2
34#define MDIO_SPEED 4 /* Speed ability */
35#define MDIO_DEVS1 5 /* Devices in package */
36#define MDIO_DEVS2 6
37#define MDIO_CTRL2 7 /* 10G control 2 */
38#define MDIO_STAT2 8 /* 10G status 2 */
39#define MDIO_PMA_TXDIS 9 /* 10G PMA/PMD transmit disable */
40#define MDIO_PMA_RXDET 10 /* 10G PMA/PMD receive signal detect */
41#define MDIO_PMA_EXTABLE 11 /* 10G PMA/PMD extended ability */
42#define MDIO_PKGID1 14 /* Package identifier */
43#define MDIO_PKGID2 15
44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
46#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */
47#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */
48#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
49#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
50#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */
51
52/* Media-dependent registers. */
53#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
54#define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */
55#define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A.
56 * Lanes B-D are numbered 134-136. */
57#define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */
58#define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */
59#define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */
60#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
61#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
62#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
63
64/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
65#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
66#define MDIO_PMA_LASI_TXCTRL 0x9001 /* TX_ALARM control */
67#define MDIO_PMA_LASI_CTRL 0x9002 /* LASI control */
68#define MDIO_PMA_LASI_RXSTAT 0x9003 /* RX_ALARM status */
69#define MDIO_PMA_LASI_TXSTAT 0x9004 /* TX_ALARM status */
70#define MDIO_PMA_LASI_STAT 0x9005 /* LASI status */
71
72/* Control register 1. */
73/* Enable extended speed selection */
74#define MDIO_CTRL1_SPEEDSELEXT (BMCR_SPEED1000 | BMCR_SPEED100)
75/* All speed selection bits */
76#define MDIO_CTRL1_SPEEDSEL (MDIO_CTRL1_SPEEDSELEXT | 0x003c)
77#define MDIO_CTRL1_FULLDPLX BMCR_FULLDPLX
78#define MDIO_CTRL1_LPOWER BMCR_PDOWN
79#define MDIO_CTRL1_RESET BMCR_RESET
80#define MDIO_PMA_CTRL1_LOOPBACK 0x0001
81#define MDIO_PMA_CTRL1_SPEED1000 BMCR_SPEED1000
82#define MDIO_PMA_CTRL1_SPEED100 BMCR_SPEED100
83#define MDIO_PCS_CTRL1_LOOPBACK BMCR_LOOPBACK
84#define MDIO_PHYXS_CTRL1_LOOPBACK BMCR_LOOPBACK
85#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
86#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
87#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */
88#define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */
89
90/* 10 Gb/s */
91#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
92/* 10PASS-TS/2BASE-TL */
93#define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04)
94
95/* Status register 1. */
96#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */
97#define MDIO_STAT1_LSTATUS BMSR_LSTATUS
98#define MDIO_STAT1_FAULT 0x0080 /* Fault */
99#define MDIO_AN_STAT1_LPABLE 0x0001 /* Link partner AN ability */
100#define MDIO_AN_STAT1_ABLE BMSR_ANEGCAPABLE
101#define MDIO_AN_STAT1_RFAULT BMSR_RFAULT
102#define MDIO_AN_STAT1_COMPLETE BMSR_ANEGCOMPLETE
103#define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */
104#define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */
105
106/* Speed register. */
107#define MDIO_SPEED_10G 0x0001 /* 10G capable */
108#define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */
109#define MDIO_PMA_SPEED_10P 0x0004 /* 10PASS-TS capable */
110#define MDIO_PMA_SPEED_1000 0x0010 /* 1000M capable */
111#define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */
112#define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */
113#define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */
114
115/* Device present registers. */
116#define MDIO_DEVS_PRESENT(devad) (1 << (devad))
117#define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD)
118#define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS)
119#define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS)
120#define MDIO_DEVS_PHYXS MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS)
121#define MDIO_DEVS_DTEXS MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS)
122#define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC)
123#define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN)
124#define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT)
125
126/* Control register 2. */
127#define MDIO_PMA_CTRL2_TYPE 0x000f /* PMA/PMD type selection */
128#define MDIO_PMA_CTRL2_10GBCX4 0x0000 /* 10GBASE-CX4 type */
129#define MDIO_PMA_CTRL2_10GBEW 0x0001 /* 10GBASE-EW type */
130#define MDIO_PMA_CTRL2_10GBLW 0x0002 /* 10GBASE-LW type */
131#define MDIO_PMA_CTRL2_10GBSW 0x0003 /* 10GBASE-SW type */
132#define MDIO_PMA_CTRL2_10GBLX4 0x0004 /* 10GBASE-LX4 type */
133#define MDIO_PMA_CTRL2_10GBER 0x0005 /* 10GBASE-ER type */
134#define MDIO_PMA_CTRL2_10GBLR 0x0006 /* 10GBASE-LR type */
135#define MDIO_PMA_CTRL2_10GBSR 0x0007 /* 10GBASE-SR type */
136#define MDIO_PMA_CTRL2_10GBLRM 0x0008 /* 10GBASE-LRM type */
137#define MDIO_PMA_CTRL2_10GBT 0x0009 /* 10GBASE-T type */
138#define MDIO_PMA_CTRL2_10GBKX4 0x000a /* 10GBASE-KX4 type */
139#define MDIO_PMA_CTRL2_10GBKR 0x000b /* 10GBASE-KR type */
140#define MDIO_PMA_CTRL2_1000BT 0x000c /* 1000BASE-T type */
141#define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */
142#define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */
143#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */
144#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */
145#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */
146#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */
147#define MDIO_PCS_CTRL2_10GBW 0x0002 /* 10GBASE-W type */
148#define MDIO_PCS_CTRL2_10GBT 0x0003 /* 10GBASE-T type */
149
150/* Status register 2. */
151#define MDIO_STAT2_RXFAULT 0x0400 /* Receive fault */
152#define MDIO_STAT2_TXFAULT 0x0800 /* Transmit fault */
153#define MDIO_STAT2_DEVPRST 0xc000 /* Device present */
154#define MDIO_STAT2_DEVPRST_VAL 0x8000 /* Device present value */
155#define MDIO_PMA_STAT2_LBABLE 0x0001 /* PMA loopback ability */
156#define MDIO_PMA_STAT2_10GBEW 0x0002 /* 10GBASE-EW ability */
157#define MDIO_PMA_STAT2_10GBLW 0x0004 /* 10GBASE-LW ability */
158#define MDIO_PMA_STAT2_10GBSW 0x0008 /* 10GBASE-SW ability */
159#define MDIO_PMA_STAT2_10GBLX4 0x0010 /* 10GBASE-LX4 ability */
160#define MDIO_PMA_STAT2_10GBER 0x0020 /* 10GBASE-ER ability */
161#define MDIO_PMA_STAT2_10GBLR 0x0040 /* 10GBASE-LR ability */
162#define MDIO_PMA_STAT2_10GBSR 0x0080 /* 10GBASE-SR ability */
163#define MDIO_PMD_STAT2_TXDISAB 0x0100 /* PMD TX disable ability */
164#define MDIO_PMA_STAT2_EXTABLE 0x0200 /* Extended abilities */
165#define MDIO_PMA_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */
166#define MDIO_PMA_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */
167#define MDIO_PCS_STAT2_10GBR 0x0001 /* 10GBASE-R capable */
168#define MDIO_PCS_STAT2_10GBX 0x0002 /* 10GBASE-X capable */
169#define MDIO_PCS_STAT2_10GBW 0x0004 /* 10GBASE-W capable */
170#define MDIO_PCS_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */
171#define MDIO_PCS_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */
172
173/* Transmit disable register. */
174#define MDIO_PMD_TXDIS_GLOBAL 0x0001 /* Global PMD TX disable */
175#define MDIO_PMD_TXDIS_0 0x0002 /* PMD TX disable 0 */
176#define MDIO_PMD_TXDIS_1 0x0004 /* PMD TX disable 1 */
177#define MDIO_PMD_TXDIS_2 0x0008 /* PMD TX disable 2 */
178#define MDIO_PMD_TXDIS_3 0x0010 /* PMD TX disable 3 */
179
180/* Receive signal detect register. */
181#define MDIO_PMD_RXDET_GLOBAL 0x0001 /* Global PMD RX signal detect */
182#define MDIO_PMD_RXDET_0 0x0002 /* PMD RX signal detect 0 */
183#define MDIO_PMD_RXDET_1 0x0004 /* PMD RX signal detect 1 */
184#define MDIO_PMD_RXDET_2 0x0008 /* PMD RX signal detect 2 */
185#define MDIO_PMD_RXDET_3 0x0010 /* PMD RX signal detect 3 */
186
187/* Extended abilities register. */
188#define MDIO_PMA_EXTABLE_10GCX4 0x0001 /* 10GBASE-CX4 ability */
189#define MDIO_PMA_EXTABLE_10GBLRM 0x0002 /* 10GBASE-LRM ability */
190#define MDIO_PMA_EXTABLE_10GBT 0x0004 /* 10GBASE-T ability */
191#define MDIO_PMA_EXTABLE_10GBKX4 0x0008 /* 10GBASE-KX4 ability */
192#define MDIO_PMA_EXTABLE_10GBKR 0x0010 /* 10GBASE-KR ability */
193#define MDIO_PMA_EXTABLE_1000BT 0x0020 /* 1000BASE-T ability */
194#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */
195#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */
196#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */
197
198/* PHY XGXS lane state register. */
199#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
200#define MDIO_PHYXS_LNSTAT_SYNC1 0x0002
201#define MDIO_PHYXS_LNSTAT_SYNC2 0x0004
202#define MDIO_PHYXS_LNSTAT_SYNC3 0x0008
203#define MDIO_PHYXS_LNSTAT_ALIGN 0x1000
204
205/* PMA 10GBASE-T pair swap & polarity */
206#define MDIO_PMA_10GBT_SWAPPOL_ABNX 0x0001 /* Pair A/B uncrossed */
207#define MDIO_PMA_10GBT_SWAPPOL_CDNX 0x0002 /* Pair C/D uncrossed */
208#define MDIO_PMA_10GBT_SWAPPOL_AREV 0x0100 /* Pair A polarity reversed */
209#define MDIO_PMA_10GBT_SWAPPOL_BREV 0x0200 /* Pair B polarity reversed */
210#define MDIO_PMA_10GBT_SWAPPOL_CREV 0x0400 /* Pair C polarity reversed */
211#define MDIO_PMA_10GBT_SWAPPOL_DREV 0x0800 /* Pair D polarity reversed */
212
213/* PMA 10GBASE-T TX power register. */
214#define MDIO_PMA_10GBT_TXPWR_SHORT 0x0001 /* Short-reach mode */
215
216/* PMA 10GBASE-T SNR registers. */
217/* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */
218#define MDIO_PMA_10GBT_SNR_BIAS 0x8000
219#define MDIO_PMA_10GBT_SNR_MAX 127
220
221/* PMA 10GBASE-R FEC ability register. */
222#define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */
223#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */
224
225/* PCS 10GBASE-R/-T status register 1. */
226#define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001 /* Block lock attained */
227
228/* PCS 10GBASE-R/-T status register 2. */
229#define MDIO_PCS_10GBRT_STAT2_ERR 0x00ff
230#define MDIO_PCS_10GBRT_STAT2_BER 0x3f00
231
232/* AN 10GBASE-T control register. */
233#define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */
234
235/* AN 10GBASE-T status register. */
236#define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */
237#define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */
238#define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */
239#define MDIO_AN_10GBT_STAT_REMOK 0x1000 /* Remote OK */
240#define MDIO_AN_10GBT_STAT_LOCOK 0x2000 /* Local OK */
241#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
242#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
243
244/* EEE Supported/Advertisement/LP Advertisement registers.
245 *
246 * EEE capability Register (3.20), Advertisement (7.60) and
247 * Link partner ability (7.61) registers have and can use the same identical
248 * bit masks.
249 */
250#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
251#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
252/* Note: the two defines above can be potentially used by the user-land
253 * and cannot remove them now.
254 * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
255 * using the previous ones (that can be considered obsolete).
256 */
257#define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX /* 100TX EEE cap */
258#define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T /* 1000T EEE cap */
259#define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */
260#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
261#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
262#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
263
264/* LASI RX_ALARM control/status registers. */
265#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
266#define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */
267#define MDIO_PMA_LASI_RX_PMALFLT 0x0010 /* PMA/PMD RX local fault */
268#define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020 /* RX optical power fault */
269#define MDIO_PMA_LASI_RX_WISLFLT 0x0200 /* WIS local fault */
270
271/* LASI TX_ALARM control/status registers. */
272#define MDIO_PMA_LASI_TX_PHYXSLFLT 0x0001 /* PHY XS TX local fault */
273#define MDIO_PMA_LASI_TX_PCSLFLT 0x0008 /* PCS TX local fault */
274#define MDIO_PMA_LASI_TX_PMALFLT 0x0010 /* PMA/PMD TX local fault */
275#define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080 /* Laser output power fault */
276#define MDIO_PMA_LASI_TX_LASERTEMPFLT 0x0100 /* Laser temperature fault */
277#define MDIO_PMA_LASI_TX_LASERBICURRFLT 0x0200 /* Laser bias current fault */
278
279/* LASI control/status registers. */
280#define MDIO_PMA_LASI_LSALARM 0x0001 /* LS_ALARM enable/status */
281#define MDIO_PMA_LASI_TXALARM 0x0002 /* TX_ALARM enable/status */
282#define MDIO_PMA_LASI_RXALARM 0x0004 /* RX_ALARM enable/status */
283
284/* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */
285
286#define MDIO_PHY_ID_C45 0x8000
287#define MDIO_PHY_ID_PRTAD 0x03e0
288#define MDIO_PHY_ID_DEVAD 0x001f
289#define MDIO_PHY_ID_C45_MASK \
290 (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD)
291
292static inline __u16 mdio_phy_id_c45(int prtad, int devad)
293{
294 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
295}
296
297#endif /* _UAPI__LINUX_MDIO_H__ */
diff --git a/include/linux/media.h b/include/uapi/linux/media.h
index 0ef883327de..0ef883327de 100644
--- a/include/linux/media.h
+++ b/include/uapi/linux/media.h
diff --git a/include/linux/mei.h b/include/uapi/linux/mei.h
index bc0d8b69c49..bc0d8b69c49 100644
--- a/include/linux/mei.h
+++ b/include/uapi/linux/mei.h
diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h
new file mode 100644
index 00000000000..23e62e0537e
--- /dev/null
+++ b/include/uapi/linux/mempolicy.h
@@ -0,0 +1,64 @@
1/*
2 * NUMA memory policies for Linux.
3 * Copyright 2003,2004 Andi Kleen SuSE Labs
4 */
5#ifndef _UAPI_LINUX_MEMPOLICY_H
6#define _UAPI_LINUX_MEMPOLICY_H
7
8#include <linux/errno.h>
9
10
11/*
12 * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
13 * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
14 * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
15 */
16
17/* Policies */
18enum {
19 MPOL_DEFAULT,
20 MPOL_PREFERRED,
21 MPOL_BIND,
22 MPOL_INTERLEAVE,
23 MPOL_MAX, /* always last member of enum */
24};
25
26enum mpol_rebind_step {
27 MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */
28 MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */
29 MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/
30 MPOL_REBIND_NSTEP,
31};
32
33/* Flags for set_mempolicy */
34#define MPOL_F_STATIC_NODES (1 << 15)
35#define MPOL_F_RELATIVE_NODES (1 << 14)
36
37/*
38 * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
39 * either set_mempolicy() or mbind().
40 */
41#define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES)
42
43/* Flags for get_mempolicy */
44#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
45#define MPOL_F_ADDR (1<<1) /* look up vma using address */
46#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
47
48/* Flags for mbind */
49#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
50#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
51#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
52#define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */
53
54/*
55 * Internal flags that share the struct mempolicy flags word with
56 * "mode flags". These flags are allocated from bit 0 up, as they
57 * are never OR'ed into the mode in mempolicy API arguments.
58 */
59#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
60#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
61#define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */
62
63
64#endif /* _UAPI_LINUX_MEMPOLICY_H */
diff --git a/include/linux/meye.h b/include/uapi/linux/meye.h
index 0dd49954f74..0dd49954f74 100644
--- a/include/linux/meye.h
+++ b/include/uapi/linux/meye.h
diff --git a/include/uapi/linux/mii.h b/include/uapi/linux/mii.h
new file mode 100644
index 00000000000..237fac4bc17
--- /dev/null
+++ b/include/uapi/linux/mii.h
@@ -0,0 +1,161 @@
1/*
2 * linux/mii.h: definitions for MII-compatible transceivers
3 * Originally drivers/net/sunhme.h.
4 *
5 * Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
6 */
7
8#ifndef _UAPI__LINUX_MII_H__
9#define _UAPI__LINUX_MII_H__
10
11#include <linux/types.h>
12#include <linux/ethtool.h>
13
14/* Generic MII registers. */
15#define MII_BMCR 0x00 /* Basic mode control register */
16#define MII_BMSR 0x01 /* Basic mode status register */
17#define MII_PHYSID1 0x02 /* PHYS ID 1 */
18#define MII_PHYSID2 0x03 /* PHYS ID 2 */
19#define MII_ADVERTISE 0x04 /* Advertisement control reg */
20#define MII_LPA 0x05 /* Link partner ability reg */
21#define MII_EXPANSION 0x06 /* Expansion register */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */
24#define MII_MMD_CTRL 0x0d /* MMD Access Control Register */
25#define MII_MMD_DATA 0x0e /* MMD Access Data Register */
26#define MII_ESTATUS 0x0f /* Extended Status */
27#define MII_DCOUNTER 0x12 /* Disconnect counter */
28#define MII_FCSCOUNTER 0x13 /* False carrier counter */
29#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
30#define MII_RERRCOUNTER 0x15 /* Receive error counter */
31#define MII_SREVISION 0x16 /* Silicon revision */
32#define MII_RESV1 0x17 /* Reserved... */
33#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
34#define MII_PHYADDR 0x19 /* PHY address */
35#define MII_RESV2 0x1a /* Reserved... */
36#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
37#define MII_NCONFIG 0x1c /* Network interface config */
38
39/* Basic mode control register. */
40#define BMCR_RESV 0x003f /* Unused... */
41#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
42#define BMCR_CTST 0x0080 /* Collision test */
43#define BMCR_FULLDPLX 0x0100 /* Full duplex */
44#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
45#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */
46#define BMCR_PDOWN 0x0800 /* Enable low power state */
47#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
48#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
49#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
50#define BMCR_RESET 0x8000 /* Reset to default state */
51
52/* Basic mode status register. */
53#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
54#define BMSR_JCD 0x0002 /* Jabber detected */
55#define BMSR_LSTATUS 0x0004 /* Link status */
56#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
57#define BMSR_RFAULT 0x0010 /* Remote fault detected */
58#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
59#define BMSR_RESV 0x00c0 /* Unused... */
60#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
61#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
62#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
63#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
64#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
65#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
66#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
67#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
68
69/* Advertisement control register. */
70#define ADVERTISE_SLCT 0x001f /* Selector bits */
71#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
72#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
73#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
74#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
75#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
76#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
77#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
78#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
79#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
80#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
81#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
82#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
83#define ADVERTISE_RESV 0x1000 /* Unused... */
84#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
85#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
86#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
87
88#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
89 ADVERTISE_CSMA)
90#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
91 ADVERTISE_100HALF | ADVERTISE_100FULL)
92
93/* Link partner ability register. */
94#define LPA_SLCT 0x001f /* Same as advertise selector */
95#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
96#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
97#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
98#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
99#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
100#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
101#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
102#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
103#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
104#define LPA_PAUSE_CAP 0x0400 /* Can pause */
105#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
106#define LPA_RESV 0x1000 /* Unused... */
107#define LPA_RFAULT 0x2000 /* Link partner faulted */
108#define LPA_LPACK 0x4000 /* Link partner acked us */
109#define LPA_NPAGE 0x8000 /* Next page bit */
110
111#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
112#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
113
114/* Expansion register for auto-negotiation. */
115#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
116#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
117#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
118#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
119#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
120#define EXPANSION_RESV 0xffe0 /* Unused... */
121
122#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
123#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
124
125/* N-way test register. */
126#define NWAYTEST_RESV1 0x00ff /* Unused... */
127#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
128#define NWAYTEST_RESV2 0xfe00 /* Unused... */
129
130/* 1000BASE-T Control register */
131#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
132#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
133#define CTL1000_AS_MASTER 0x0800
134#define CTL1000_ENABLE_MASTER 0x1000
135
136/* 1000BASE-T Status register */
137#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
138#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
139#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
140#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
141
142/* Flow control flags */
143#define FLOW_CTRL_TX 0x01
144#define FLOW_CTRL_RX 0x02
145
146/* MMD Access Control register fields */
147#define MII_MMD_CTRL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/
148#define MII_MMD_CTRL_ADDR 0x0000 /* Address */
149#define MII_MMD_CTRL_NOINCR 0x4000 /* no post increment */
150#define MII_MMD_CTRL_INCR_RDWT 0x8000 /* post increment on reads & writes */
151#define MII_MMD_CTRL_INCR_ON_WT 0xC000 /* post increment on writes only */
152
153/* This structure is used in all SIOCxMIIxxx ioctl calls */
154struct mii_ioctl_data {
155 __u16 phy_id;
156 __u16 reg_num;
157 __u16 val_in;
158 __u16 val_out;
159};
160
161#endif /* _UAPI__LINUX_MII_H__ */
diff --git a/include/linux/minix_fs.h b/include/uapi/linux/minix_fs.h
index 13fe09e0576..13fe09e0576 100644
--- a/include/linux/minix_fs.h
+++ b/include/uapi/linux/minix_fs.h
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
new file mode 100644
index 00000000000..ade4acd3a90
--- /dev/null
+++ b/include/uapi/linux/mman.h
@@ -0,0 +1,13 @@
1#ifndef _UAPI_LINUX_MMAN_H
2#define _UAPI_LINUX_MMAN_H
3
4#include <asm/mman.h>
5
6#define MREMAP_MAYMOVE 1
7#define MREMAP_FIXED 2
8
9#define OVERCOMMIT_GUESS 0
10#define OVERCOMMIT_ALWAYS 1
11#define OVERCOMMIT_NEVER 2
12
13#endif /* _UAPI_LINUX_MMAN_H */
diff --git a/include/linux/mmtimer.h b/include/uapi/linux/mmtimer.h
index 884cabf1608..884cabf1608 100644
--- a/include/linux/mmtimer.h
+++ b/include/uapi/linux/mmtimer.h
diff --git a/include/linux/mqueue.h b/include/uapi/linux/mqueue.h
index 8b5a79615fb..8b5a79615fb 100644
--- a/include/linux/mqueue.h
+++ b/include/uapi/linux/mqueue.h
diff --git a/include/uapi/linux/mroute.h b/include/uapi/linux/mroute.h
new file mode 100644
index 00000000000..16929993acc
--- /dev/null
+++ b/include/uapi/linux/mroute.h
@@ -0,0 +1,143 @@
1#ifndef _UAPI__LINUX_MROUTE_H
2#define _UAPI__LINUX_MROUTE_H
3
4#include <linux/sockios.h>
5#include <linux/types.h>
6
7/*
8 * Based on the MROUTING 3.5 defines primarily to keep
9 * source compatibility with BSD.
10 *
11 * See the mrouted code for the original history.
12 *
13 * Protocol Independent Multicast (PIM) data structures included
14 * Carlos Picoto (cap@di.fc.ul.pt)
15 *
16 */
17
18#define MRT_BASE 200
19#define MRT_INIT (MRT_BASE) /* Activate the kernel mroute code */
20#define MRT_DONE (MRT_BASE+1) /* Shutdown the kernel mroute */
21#define MRT_ADD_VIF (MRT_BASE+2) /* Add a virtual interface */
22#define MRT_DEL_VIF (MRT_BASE+3) /* Delete a virtual interface */
23#define MRT_ADD_MFC (MRT_BASE+4) /* Add a multicast forwarding entry */
24#define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */
26#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */
27#define MRT_PIM (MRT_BASE+8) /* enable PIM code */
28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */
29
30#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
31#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
32#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
33
34#define MAXVIFS 32
35typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
36typedef unsigned short vifi_t;
37#define ALL_VIFS ((vifi_t)(-1))
38
39/*
40 * Same idea as select
41 */
42
43#define VIFM_SET(n,m) ((m)|=(1<<(n)))
44#define VIFM_CLR(n,m) ((m)&=~(1<<(n)))
45#define VIFM_ISSET(n,m) ((m)&(1<<(n)))
46#define VIFM_CLRALL(m) ((m)=0)
47#define VIFM_COPY(mfrom,mto) ((mto)=(mfrom))
48#define VIFM_SAME(m1,m2) ((m1)==(m2))
49
50/*
51 * Passed by mrouted for an MRT_ADD_VIF - again we use the
52 * mrouted 3.6 structures for compatibility
53 */
54
55struct vifctl {
56 vifi_t vifc_vifi; /* Index of VIF */
57 unsigned char vifc_flags; /* VIFF_ flags */
58 unsigned char vifc_threshold; /* ttl limit */
59 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
60 union {
61 struct in_addr vifc_lcl_addr; /* Local interface address */
62 int vifc_lcl_ifindex; /* Local interface index */
63 };
64 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
65};
66
67#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
68#define VIFF_SRCRT 0x2 /* NI */
69#define VIFF_REGISTER 0x4 /* register vif */
70#define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of
71 vifc_lcl_addr to find an interface */
72
73/*
74 * Cache manipulation structures for mrouted and PIMd
75 */
76
77struct mfcctl {
78 struct in_addr mfcc_origin; /* Origin of mcast */
79 struct in_addr mfcc_mcastgrp; /* Group in question */
80 vifi_t mfcc_parent; /* Where it arrived */
81 unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */
82 unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */
83 unsigned int mfcc_byte_cnt;
84 unsigned int mfcc_wrong_if;
85 int mfcc_expire;
86};
87
88/*
89 * Group count retrieval for mrouted
90 */
91
92struct sioc_sg_req {
93 struct in_addr src;
94 struct in_addr grp;
95 unsigned long pktcnt;
96 unsigned long bytecnt;
97 unsigned long wrong_if;
98};
99
100/*
101 * To get vif packet counts
102 */
103
104struct sioc_vif_req {
105 vifi_t vifi; /* Which iface */
106 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */
108 unsigned long ibytes; /* In bytes */
109 unsigned long obytes; /* Out bytes */
110};
111
112/*
113 * This is the format the mroute daemon expects to see IGMP control
114 * data. Magically happens to be like an IP packet as per the original
115 */
116
117struct igmpmsg {
118 __u32 unused1,unused2;
119 unsigned char im_msgtype; /* What is this */
120 unsigned char im_mbz; /* Must be zero */
121 unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */
122 unsigned char unused3;
123 struct in_addr im_src,im_dst;
124};
125
126/*
127 * That's all usermode folks
128 */
129
130
131
132#define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */
133
134/*
135 * Pseudo messages used by mrouted
136 */
137
138#define IGMPMSG_NOCACHE 1 /* Kern cache fill request to mrouted */
139#define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */
140#define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */
141
142
143#endif /* _UAPI__LINUX_MROUTE_H */
diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h
new file mode 100644
index 00000000000..3e89b5e7f9e
--- /dev/null
+++ b/include/uapi/linux/mroute6.h
@@ -0,0 +1,137 @@
1#ifndef _UAPI__LINUX_MROUTE6_H
2#define _UAPI__LINUX_MROUTE6_H
3
4#include <linux/types.h>
5#include <linux/sockios.h>
6
7/*
8 * Based on the MROUTING 3.5 defines primarily to keep
9 * source compatibility with BSD.
10 *
11 * See the pim6sd code for the original history.
12 *
13 * Protocol Independent Multicast (PIM) data structures included
14 * Carlos Picoto (cap@di.fc.ul.pt)
15 *
16 */
17
18#define MRT6_BASE 200
19#define MRT6_INIT (MRT6_BASE) /* Activate the kernel mroute code */
20#define MRT6_DONE (MRT6_BASE+1) /* Shutdown the kernel mroute */
21#define MRT6_ADD_MIF (MRT6_BASE+2) /* Add a virtual interface */
22#define MRT6_DEL_MIF (MRT6_BASE+3) /* Delete a virtual interface */
23#define MRT6_ADD_MFC (MRT6_BASE+4) /* Add a multicast forwarding entry */
24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
29
30#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
31#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
32#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
33
34#define MAXMIFS 32
35typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
36typedef unsigned short mifi_t;
37#define ALL_MIFS ((mifi_t)(-1))
38
39#ifndef IF_SETSIZE
40#define IF_SETSIZE 256
41#endif
42
43typedef __u32 if_mask;
44#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
45
46#if !defined(__KERNEL__)
47#if !defined(DIV_ROUND_UP)
48#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
49#endif
50#endif
51
52typedef struct if_set {
53 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
54} if_set;
55
56#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
57#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
58#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
59#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f)))
60#define IF_ZERO(p) bzero(p, sizeof(*(p)))
61
62/*
63 * Passed by mrouted for an MRT_ADD_MIF - again we use the
64 * mrouted 3.6 structures for compatibility
65 */
66
67struct mif6ctl {
68 mifi_t mif6c_mifi; /* Index of MIF */
69 unsigned char mif6c_flags; /* MIFF_ flags */
70 unsigned char vifc_threshold; /* ttl limit */
71 __u16 mif6c_pifi; /* the index of the physical IF */
72 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
73};
74
75#define MIFF_REGISTER 0x1 /* register vif */
76
77/*
78 * Cache manipulation structures for mrouted and PIMd
79 */
80
81struct mf6cctl {
82 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
83 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
84 mifi_t mf6cc_parent; /* Where it arrived */
85 struct if_set mf6cc_ifset; /* Where it is going */
86};
87
88/*
89 * Group count retrieval for pim6sd
90 */
91
92struct sioc_sg_req6 {
93 struct sockaddr_in6 src;
94 struct sockaddr_in6 grp;
95 unsigned long pktcnt;
96 unsigned long bytecnt;
97 unsigned long wrong_if;
98};
99
100/*
101 * To get vif packet counts
102 */
103
104struct sioc_mif_req6 {
105 mifi_t mifi; /* Which iface */
106 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */
108 unsigned long ibytes; /* In bytes */
109 unsigned long obytes; /* Out bytes */
110};
111
112/*
113 * That's all usermode folks
114 */
115
116
117
118/*
119 * Structure used to communicate from kernel to multicast router.
120 * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{}
121 * used for IPv4 implementation). This is because this structure will be passed via an
122 * IPv6 raw socket, on which an application will only receiver the payload i.e the data after
123 * the IPv6 header and all the extension headers. (See section 3 of RFC 3542)
124 */
125
126struct mrt6msg {
127#define MRT6MSG_NOCACHE 1
128#define MRT6MSG_WRONGMIF 2
129#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
130 __u8 im6_mbz; /* must be zero */
131 __u8 im6_msgtype; /* what type of message */
132 __u16 im6_mif; /* mif rec'd on */
133 __u32 im6_pad; /* padding for 64 bit arch */
134 struct in6_addr im6_src, im6_dst;
135};
136
137#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
index 00000000000..996719f82e2
--- /dev/null
+++ b/include/uapi/linux/msdos_fs.h
@@ -0,0 +1,167 @@
1#ifndef _UAPI_LINUX_MSDOS_FS_H
2#define _UAPI_LINUX_MSDOS_FS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6#include <asm/byteorder.h>
7
8/*
9 * The MS-DOS filesystem constants/structures
10 */
11
12#define SECTOR_SIZE 512 /* sector size (bytes) */
13#define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */
14#define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */
15#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
16#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
17#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
18#define MSDOS_LONGNAME 256 /* maximum name length */
19#define CF_LE_W(v) le16_to_cpu(v)
20#define CF_LE_L(v) le32_to_cpu(v)
21#define CT_LE_W(v) cpu_to_le16(v)
22#define CT_LE_L(v) cpu_to_le32(v)
23
24#define MSDOS_ROOT_INO 1 /* The root inode number */
25#define MSDOS_FSINFO_INO 2 /* Used for managing the FSINFO block */
26
27#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
28
29/* directory limit */
30#define FAT_MAX_DIR_ENTRIES (65536)
31#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
32
33#define ATTR_NONE 0 /* no attribute bits */
34#define ATTR_RO 1 /* read-only */
35#define ATTR_HIDDEN 2 /* hidden */
36#define ATTR_SYS 4 /* system */
37#define ATTR_VOLUME 8 /* volume label */
38#define ATTR_DIR 16 /* directory */
39#define ATTR_ARCH 32 /* archived */
40
41/* attribute bits that are copied "as is" */
42#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
43/* bits that are used by the Windows 95/Windows NT extended FAT */
44#define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
45
46#define CASE_LOWER_BASE 8 /* base is lower case */
47#define CASE_LOWER_EXT 16 /* extension is lower case */
48
49#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
50#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
51
52#define FAT_LFN_LEN 255 /* maximum long name length */
53#define MSDOS_NAME 11 /* maximum name length */
54#define MSDOS_SLOTS 21 /* max # of slots for short and long names */
55#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
56#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
57
58#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
59 MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
60
61/* start of data cluster's entry (number of reserved clusters) */
62#define FAT_START_ENT 2
63
64/* maximum number of clusters */
65#define MAX_FAT12 0xFF4
66#define MAX_FAT16 0xFFF4
67#define MAX_FAT32 0x0FFFFFF6
68#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
69 MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
70
71/* bad cluster mark */
72#define BAD_FAT12 0xFF7
73#define BAD_FAT16 0xFFF7
74#define BAD_FAT32 0x0FFFFFF7
75
76/* standard EOF */
77#define EOF_FAT12 0xFFF
78#define EOF_FAT16 0xFFFF
79#define EOF_FAT32 0x0FFFFFFF
80
81#define FAT_ENT_FREE (0)
82#define FAT_ENT_BAD (BAD_FAT32)
83#define FAT_ENT_EOF (EOF_FAT32)
84
85#define FAT_FSINFO_SIG1 0x41615252
86#define FAT_FSINFO_SIG2 0x61417272
87#define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \
88 && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
89
90struct __fat_dirent {
91 long d_ino;
92 __kernel_off_t d_off;
93 unsigned short d_reclen;
94 char d_name[256]; /* We must not include limits.h! */
95};
96
97/*
98 * ioctl commands
99 */
100#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct __fat_dirent[2])
101#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct __fat_dirent[2])
102/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
103#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
104#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
105
106struct fat_boot_sector {
107 __u8 ignored[3]; /* Boot strap short or near jump */
108 __u8 system_id[8]; /* Name - can be used to special case
109 partition manager volumes */
110 __u8 sector_size[2]; /* bytes per logical sector */
111 __u8 sec_per_clus; /* sectors/cluster */
112 __le16 reserved; /* reserved sectors */
113 __u8 fats; /* number of FATs */
114 __u8 dir_entries[2]; /* root directory entries */
115 __u8 sectors[2]; /* number of sectors */
116 __u8 media; /* media code */
117 __le16 fat_length; /* sectors/FAT */
118 __le16 secs_track; /* sectors per track */
119 __le16 heads; /* number of heads */
120 __le32 hidden; /* hidden sectors (unused) */
121 __le32 total_sect; /* number of sectors (if sectors == 0) */
122
123 /* The following fields are only used by FAT32 */
124 __le32 fat32_length; /* sectors/FAT */
125 __le16 flags; /* bit 8: fat mirroring, low 4: active fat */
126 __u8 version[2]; /* major, minor filesystem version */
127 __le32 root_cluster; /* first cluster in root directory */
128 __le16 info_sector; /* filesystem info sector */
129 __le16 backup_boot; /* backup boot sector */
130 __le16 reserved2[6]; /* Unused */
131};
132
133struct fat_boot_fsinfo {
134 __le32 signature1; /* 0x41615252L */
135 __le32 reserved1[120]; /* Nothing as far as I can tell */
136 __le32 signature2; /* 0x61417272L */
137 __le32 free_clusters; /* Free cluster count. -1 if unknown */
138 __le32 next_cluster; /* Most recently allocated cluster */
139 __le32 reserved2[4];
140};
141
142struct msdos_dir_entry {
143 __u8 name[MSDOS_NAME];/* name and extension */
144 __u8 attr; /* attribute bits */
145 __u8 lcase; /* Case for base and extension */
146 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
147 __le16 ctime; /* Creation time */
148 __le16 cdate; /* Creation date */
149 __le16 adate; /* Last access date */
150 __le16 starthi; /* High 16 bits of cluster in FAT32 */
151 __le16 time,date,start;/* time, date and first cluster */
152 __le32 size; /* file size (in bytes) */
153};
154
155/* Up to 13 characters of the name */
156struct msdos_dir_slot {
157 __u8 id; /* sequence number for slot */
158 __u8 name0_4[10]; /* first 5 characters in name */
159 __u8 attr; /* attribute byte */
160 __u8 reserved; /* always 0 */
161 __u8 alias_checksum; /* checksum for 8.3 alias */
162 __u8 name5_10[12]; /* 6 more characters in name */
163 __le16 start; /* starting cluster number, 0 in long slots */
164 __u8 name11_12[4]; /* last 2 characters in name */
165};
166
167#endif /* _UAPI_LINUX_MSDOS_FS_H */
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h
new file mode 100644
index 00000000000..78dbd2f996a
--- /dev/null
+++ b/include/uapi/linux/msg.h
@@ -0,0 +1,75 @@
1#ifndef _UAPI_LINUX_MSG_H
2#define _UAPI_LINUX_MSG_H
3
4#include <linux/ipc.h>
5
6/* ipcs ctl commands */
7#define MSG_STAT 11
8#define MSG_INFO 12
9
10/* msgrcv options */
11#define MSG_NOERROR 010000 /* no error if message is too big */
12#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
13
14/* Obsolete, used only for backwards compatibility and libc5 compiles */
15struct msqid_ds {
16 struct ipc_perm msg_perm;
17 struct msg *msg_first; /* first message on queue,unused */
18 struct msg *msg_last; /* last message in queue,unused */
19 __kernel_time_t msg_stime; /* last msgsnd time */
20 __kernel_time_t msg_rtime; /* last msgrcv time */
21 __kernel_time_t msg_ctime; /* last change time */
22 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
23 unsigned long msg_lqbytes; /* ditto */
24 unsigned short msg_cbytes; /* current number of bytes on queue */
25 unsigned short msg_qnum; /* number of messages in queue */
26 unsigned short msg_qbytes; /* max number of bytes on queue */
27 __kernel_ipc_pid_t msg_lspid; /* pid of last msgsnd */
28 __kernel_ipc_pid_t msg_lrpid; /* last receive pid */
29};
30
31/* Include the definition of msqid64_ds */
32#include <asm/msgbuf.h>
33
34/* message buffer for msgsnd and msgrcv calls */
35struct msgbuf {
36 long mtype; /* type of message */
37 char mtext[1]; /* message text */
38};
39
40/* buffer for msgctl calls IPC_INFO, MSG_INFO */
41struct msginfo {
42 int msgpool;
43 int msgmap;
44 int msgmax;
45 int msgmnb;
46 int msgmni;
47 int msgssz;
48 int msgtql;
49 unsigned short msgseg;
50};
51
52/*
53 * Scaling factor to compute msgmni:
54 * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
55 * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
56 * up to 8MB : msgmni = 16 (MSGMNI)
57 * 4 GB : msgmni = 8K
58 * more than 16 GB : msgmni = 32K (IPCMNI)
59 */
60#define MSG_MEM_SCALE 32
61
62#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
63#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
64#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
65
66/* unused */
67#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
68#define MSGTQL MSGMNB /* number of system message headers */
69#define MSGMAP MSGMNB /* number of entries in message map */
70#define MSGSSZ 16 /* message segment size */
71#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
72#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
73
74
75#endif /* _UAPI_LINUX_MSG_H */
diff --git a/include/linux/mtio.h b/include/uapi/linux/mtio.h
index 18543e2db06..18543e2db06 100644
--- a/include/linux/mtio.h
+++ b/include/uapi/linux/mtio.h
diff --git a/include/uapi/linux/n_r3964.h b/include/uapi/linux/n_r3964.h
new file mode 100644
index 00000000000..81337cbf40b
--- /dev/null
+++ b/include/uapi/linux/n_r3964.h
@@ -0,0 +1,98 @@
1/* r3964 linediscipline for linux
2 *
3 * -----------------------------------------------------------
4 * Copyright by
5 * Philips Automation Projects
6 * Kassel (Germany)
7 * -----------------------------------------------------------
8 * This software may be used and distributed according to the terms of
9 * the GNU General Public License, incorporated herein by reference.
10 *
11 * Author:
12 * L. Haag
13 *
14 * $Log: r3964.h,v $
15 * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de>
16 * Fixed HZ usage on 2.6 kernels
17 * Removed unnecessary include
18 *
19 * Revision 1.3 2001/03/18 13:02:24 dwmw2
20 * Fix timer usage, use spinlocks properly.
21 *
22 * Revision 1.2 2001/03/18 12:53:15 dwmw2
23 * Merge changes in 2.4.2
24 *
25 * Revision 1.1.1.1 1998/10/13 16:43:14 dwmw2
26 * This'll screw the version control
27 *
28 * Revision 1.6 1998/09/30 00:40:38 dwmw2
29 * Updated to use kernel's N_R3964 if available
30 *
31 * Revision 1.4 1998/04/02 20:29:44 lhaag
32 * select, blocking, ...
33 *
34 * Revision 1.3 1998/02/12 18:58:43 root
35 * fixed some memory leaks
36 * calculation of checksum characters
37 *
38 * Revision 1.2 1998/02/07 13:03:17 root
39 * ioctl read_telegram
40 *
41 * Revision 1.1 1998/02/06 19:19:43 root
42 * Initial revision
43 *
44 *
45 */
46
47#ifndef _UAPI__LINUX_N_R3964_H__
48#define _UAPI__LINUX_N_R3964_H__
49
50/* line disciplines for r3964 protocol */
51
52
53/*
54 * Ioctl-commands
55 */
56
57#define R3964_ENABLE_SIGNALS 0x5301
58#define R3964_SETPRIORITY 0x5302
59#define R3964_USE_BCC 0x5303
60#define R3964_READ_TELEGRAM 0x5304
61
62/* Options for R3964_SETPRIORITY */
63#define R3964_MASTER 0
64#define R3964_SLAVE 1
65
66/* Options for R3964_ENABLE_SIGNALS */
67#define R3964_SIG_ACK 0x0001
68#define R3964_SIG_DATA 0x0002
69#define R3964_SIG_ALL 0x000f
70#define R3964_SIG_NONE 0x0000
71#define R3964_USE_SIGIO 0x1000
72
73/*
74 * r3964 operation states:
75 */
76
77/* types for msg_id: */
78enum {R3964_MSG_ACK=1, R3964_MSG_DATA };
79
80#define R3964_MAX_MSG_COUNT 32
81
82/* error codes for client messages */
83#define R3964_OK 0 /* no error. */
84#define R3964_TX_FAIL -1 /* transmission error, block NOT sent */
85#define R3964_OVERFLOW -2 /* msg queue overflow */
86
87/* the client gets this struct when calling read(fd,...): */
88struct r3964_client_message {
89 int msg_id;
90 int arg;
91 int error_code;
92};
93
94#define R3964_MTU 256
95
96
97
98#endif /* _UAPI__LINUX_N_R3964_H__ */
diff --git a/include/uapi/linux/nbd.h b/include/uapi/linux/nbd.h
new file mode 100644
index 00000000000..dfb514472cb
--- /dev/null
+++ b/include/uapi/linux/nbd.h
@@ -0,0 +1,77 @@
1/*
2 * 1999 Copyright (C) Pavel Machek, pavel@ucw.cz. This code is GPL.
3 * 1999/11/04 Copyright (C) 1999 VMware, Inc. (Regis "HPReg" Duchesne)
4 * Made nbd_end_request() use the io_request_lock
5 * 2001 Copyright (C) Steven Whitehouse
6 * New nbd_end_request() for compatibility with new linux block
7 * layer code.
8 * 2003/06/24 Louis D. Langholtz <ldl@aros.net>
9 * Removed unneeded blksize_bits field from nbd_device struct.
10 * Cleanup PARANOIA usage & code.
11 * 2004/02/19 Paul Clements
12 * Removed PARANOIA, plus various cleanup and comments
13 */
14
15#ifndef _UAPILINUX_NBD_H
16#define _UAPILINUX_NBD_H
17
18#include <linux/types.h>
19
20#define NBD_SET_SOCK _IO( 0xab, 0 )
21#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
22#define NBD_SET_SIZE _IO( 0xab, 2 )
23#define NBD_DO_IT _IO( 0xab, 3 )
24#define NBD_CLEAR_SOCK _IO( 0xab, 4 )
25#define NBD_CLEAR_QUE _IO( 0xab, 5 )
26#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
28#define NBD_DISCONNECT _IO( 0xab, 8 )
29#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
30#define NBD_SET_FLAGS _IO( 0xab, 10)
31
32enum {
33 NBD_CMD_READ = 0,
34 NBD_CMD_WRITE = 1,
35 NBD_CMD_DISC = 2,
36 /* there is a gap here to match userspace */
37 NBD_CMD_TRIM = 4
38};
39
40/* values for flags field */
41#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
42#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
43/* there is a gap here to match userspace */
44#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
45
46#define nbd_cmd(req) ((req)->cmd[0])
47
48/* userspace doesn't need the nbd_device structure */
49
50/* These are sent over the network in the request/reply magic fields */
51
52#define NBD_REQUEST_MAGIC 0x25609513
53#define NBD_REPLY_MAGIC 0x67446698
54/* Do *not* use magics: 0x12560953 0x96744668. */
55
56/*
57 * This is the packet used for communication between client and
58 * server. All data are in network byte order.
59 */
60struct nbd_request {
61 __be32 magic;
62 __be32 type; /* == READ || == WRITE */
63 char handle[8];
64 __be64 from;
65 __be32 len;
66} __attribute__((packed));
67
68/*
69 * This is the reply packet that nbd-server sends back to the client after
70 * it has completed an I/O request (or an error occurs).
71 */
72struct nbd_reply {
73 __be32 magic;
74 __be32 error; /* 0 = ok, else error */
75 char handle[8]; /* handle you got from request */
76};
77#endif /* _UAPILINUX_NBD_H */
diff --git a/include/linux/ncp.h b/include/uapi/linux/ncp.h
index 99f0adeeb3f..99f0adeeb3f 100644
--- a/include/linux/ncp.h
+++ b/include/uapi/linux/ncp.h
diff --git a/include/linux/ncp_fs.h b/include/uapi/linux/ncp_fs.h
index e13eefef065..e13eefef065 100644
--- a/include/linux/ncp_fs.h
+++ b/include/uapi/linux/ncp_fs.h
diff --git a/include/linux/ncp_mount.h b/include/uapi/linux/ncp_mount.h
index dfcbea2d889..dfcbea2d889 100644
--- a/include/linux/ncp_mount.h
+++ b/include/uapi/linux/ncp_mount.h
diff --git a/include/linux/ncp_no.h b/include/uapi/linux/ncp_no.h
index cddaa48fb18..cddaa48fb18 100644
--- a/include/linux/ncp_no.h
+++ b/include/uapi/linux/ncp_no.h
diff --git a/include/linux/neighbour.h b/include/uapi/linux/neighbour.h
index 275e5d65dcb..275e5d65dcb 100644
--- a/include/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
diff --git a/include/uapi/linux/net.h b/include/uapi/linux/net.h
new file mode 100644
index 00000000000..9457239ed21
--- /dev/null
+++ b/include/uapi/linux/net.h
@@ -0,0 +1,57 @@
1/*
2 * NET An implementation of the SOCKET network access protocol.
3 * This is the master header file for the Linux NET layer,
4 * or, in plain English: the networking handling part of the
5 * kernel.
6 *
7 * Version: @(#)net.h 1.0.3 05/25/93
8 *
9 * Authors: Orest Zborowski, <obz@Kodak.COM>
10 * Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18#ifndef _UAPI_LINUX_NET_H
19#define _UAPI_LINUX_NET_H
20
21#include <linux/socket.h>
22#include <asm/socket.h>
23
24#define NPROTO AF_MAX
25
26#define SYS_SOCKET 1 /* sys_socket(2) */
27#define SYS_BIND 2 /* sys_bind(2) */
28#define SYS_CONNECT 3 /* sys_connect(2) */
29#define SYS_LISTEN 4 /* sys_listen(2) */
30#define SYS_ACCEPT 5 /* sys_accept(2) */
31#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
32#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
33#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
34#define SYS_SEND 9 /* sys_send(2) */
35#define SYS_RECV 10 /* sys_recv(2) */
36#define SYS_SENDTO 11 /* sys_sendto(2) */
37#define SYS_RECVFROM 12 /* sys_recvfrom(2) */
38#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
39#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
40#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
43#define SYS_ACCEPT4 18 /* sys_accept4(2) */
44#define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */
45#define SYS_SENDMMSG 20 /* sys_sendmmsg(2) */
46
47typedef enum {
48 SS_FREE = 0, /* not allocated */
49 SS_UNCONNECTED, /* unconnected to any socket */
50 SS_CONNECTING, /* in process of connecting */
51 SS_CONNECTED, /* connected to socket */
52 SS_DISCONNECTING /* in process of disconnecting */
53} socket_state;
54
55#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
56
57#endif /* _UAPI_LINUX_NET_H */
diff --git a/include/linux/net_dropmon.h b/include/uapi/linux/net_dropmon.h
index 2a739462cae..2a739462cae 100644
--- a/include/linux/net_dropmon.h
+++ b/include/uapi/linux/net_dropmon.h
diff --git a/include/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index ae5df122e42..ae5df122e42 100644
--- a/include/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
diff --git a/include/uapi/linux/netdevice.h b/include/uapi/linux/netdevice.h
new file mode 100644
index 00000000000..6b9500bc2d5
--- /dev/null
+++ b/include/uapi/linux/netdevice.h
@@ -0,0 +1,53 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the Interfaces handler.
7 *
8 * Version: @(#)dev.h 1.0.10 08/12/93
9 *
10 * Authors: Ross Biro
11 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12 * Corey Minyard <wf-rch!minyard@relay.EU.net>
13 * Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
14 * Alan Cox, <alan@lxorguk.ukuu.org.uk>
15 * Bjorn Ekwall. <bj0rn@blox.se>
16 * Pekka Riikonen <priikone@poseidon.pspt.fi>
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 *
23 * Moved to /usr/include/linux for NET3
24 */
25#ifndef _UAPI_LINUX_NETDEVICE_H
26#define _UAPI_LINUX_NETDEVICE_H
27
28#include <linux/if.h>
29#include <linux/if_ether.h>
30#include <linux/if_packet.h>
31#include <linux/if_link.h>
32
33
34#define MAX_ADDR_LEN 32 /* Largest hardware address length */
35
36/* Initial net device group. All devices belong to group 0 by default. */
37#define INIT_NETDEV_GROUP 0
38
39
40
41/* Media selection options. */
42enum {
43 IF_PORT_UNKNOWN = 0,
44 IF_PORT_10BASE2,
45 IF_PORT_10BASET,
46 IF_PORT_AUI,
47 IF_PORT_100BASET,
48 IF_PORT_100BASETX,
49 IF_PORT_100BASEFX
50};
51
52
53#endif /* _UAPI_LINUX_NETDEVICE_H */
diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
new file mode 100644
index 00000000000..f7dc0ebeeba
--- /dev/null
+++ b/include/uapi/linux/netfilter.h
@@ -0,0 +1,72 @@
1#ifndef _UAPI__LINUX_NETFILTER_H
2#define _UAPI__LINUX_NETFILTER_H
3
4#include <linux/types.h>
5#include <linux/compiler.h>
6#include <linux/sysctl.h>
7
8
9/* Responses from hook functions. */
10#define NF_DROP 0
11#define NF_ACCEPT 1
12#define NF_STOLEN 2
13#define NF_QUEUE 3
14#define NF_REPEAT 4
15#define NF_STOP 5
16#define NF_MAX_VERDICT NF_STOP
17
18/* we overload the higher bits for encoding auxiliary data such as the queue
19 * number or errno values. Not nice, but better than additional function
20 * arguments. */
21#define NF_VERDICT_MASK 0x000000ff
22
23/* extra verdict flags have mask 0x0000ff00 */
24#define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
25
26/* queue number (NF_QUEUE) or errno (NF_DROP) */
27#define NF_VERDICT_QMASK 0xffff0000
28#define NF_VERDICT_QBITS 16
29
30#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
31
32#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
33
34/* only for userspace compatibility */
35#ifndef __KERNEL__
36/* Generic cache responses from hook functions.
37 <= 0x2000 is used for protocol-flags. */
38#define NFC_UNKNOWN 0x4000
39#define NFC_ALTERED 0x8000
40
41/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
42#define NF_VERDICT_BITS 16
43#endif
44
45enum nf_inet_hooks {
46 NF_INET_PRE_ROUTING,
47 NF_INET_LOCAL_IN,
48 NF_INET_FORWARD,
49 NF_INET_LOCAL_OUT,
50 NF_INET_POST_ROUTING,
51 NF_INET_NUMHOOKS
52};
53
54enum {
55 NFPROTO_UNSPEC = 0,
56 NFPROTO_IPV4 = 2,
57 NFPROTO_ARP = 3,
58 NFPROTO_BRIDGE = 7,
59 NFPROTO_IPV6 = 10,
60 NFPROTO_DECNET = 12,
61 NFPROTO_NUMPROTO,
62};
63
64union nf_inet_addr {
65 __u32 all[4];
66 __be32 ip;
67 __be32 ip6[4];
68 struct in_addr in;
69 struct in6_addr in6;
70};
71
72#endif /* _UAPI__LINUX_NETFILTER_H */
diff --git a/include/linux/netfilter_arp.h b/include/uapi/linux/netfilter_arp.h
index 92bc6ddcbf7..92bc6ddcbf7 100644
--- a/include/linux/netfilter_arp.h
+++ b/include/uapi/linux/netfilter_arp.h
diff --git a/include/uapi/linux/netfilter_bridge.h b/include/uapi/linux/netfilter_bridge.h
new file mode 100644
index 00000000000..a5eda6db8d7
--- /dev/null
+++ b/include/uapi/linux/netfilter_bridge.h
@@ -0,0 +1,27 @@
1#ifndef _UAPI__LINUX_BRIDGE_NETFILTER_H
2#define _UAPI__LINUX_BRIDGE_NETFILTER_H
3
4/* bridge-specific defines for netfilter.
5 */
6
7#include <linux/netfilter.h>
8#include <linux/if_ether.h>
9#include <linux/if_vlan.h>
10#include <linux/if_pppox.h>
11
12/* Bridge Hooks */
13/* After promisc drops, checksum checks. */
14#define NF_BR_PRE_ROUTING 0
15/* If the packet is destined for this box. */
16#define NF_BR_LOCAL_IN 1
17/* If the packet is destined for another interface. */
18#define NF_BR_FORWARD 2
19/* Packets coming from a local process. */
20#define NF_BR_LOCAL_OUT 3
21/* Packets about to hit the wire. */
22#define NF_BR_POST_ROUTING 4
23/* Not really a hook, but used for the ebtables broute table */
24#define NF_BR_BROUTING 5
25#define NF_BR_NUMHOOKS 6
26
27#endif /* _UAPI__LINUX_BRIDGE_NETFILTER_H */
diff --git a/include/linux/netfilter_decnet.h b/include/uapi/linux/netfilter_decnet.h
index 0b09732aacd..0b09732aacd 100644
--- a/include/linux/netfilter_decnet.h
+++ b/include/uapi/linux/netfilter_decnet.h
diff --git a/include/uapi/linux/netfilter_ipv4.h b/include/uapi/linux/netfilter_ipv4.h
new file mode 100644
index 00000000000..91ddd1f6fd4
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv4.h
@@ -0,0 +1,81 @@
1/* IPv4-specific defines for netfilter.
2 * (C)1998 Rusty Russell -- This code is GPL.
3 */
4#ifndef _UAPI__LINUX_IP_NETFILTER_H
5#define _UAPI__LINUX_IP_NETFILTER_H
6
7
8#include <linux/netfilter.h>
9
10/* only for userspace compatibility */
11#ifndef __KERNEL__
12
13#include <limits.h> /* for INT_MIN, INT_MAX */
14
15/* IP Cache bits. */
16/* Src IP address. */
17#define NFC_IP_SRC 0x0001
18/* Dest IP address. */
19#define NFC_IP_DST 0x0002
20/* Input device. */
21#define NFC_IP_IF_IN 0x0004
22/* Output device. */
23#define NFC_IP_IF_OUT 0x0008
24/* TOS. */
25#define NFC_IP_TOS 0x0010
26/* Protocol. */
27#define NFC_IP_PROTO 0x0020
28/* IP options. */
29#define NFC_IP_OPTIONS 0x0040
30/* Frag & flags. */
31#define NFC_IP_FRAG 0x0080
32
33/* Per-protocol information: only matters if proto match. */
34/* TCP flags. */
35#define NFC_IP_TCPFLAGS 0x0100
36/* Source port. */
37#define NFC_IP_SRC_PT 0x0200
38/* Dest port. */
39#define NFC_IP_DST_PT 0x0400
40/* Something else about the proto */
41#define NFC_IP_PROTO_UNKNOWN 0x2000
42
43/* IP Hooks */
44/* After promisc drops, checksum checks. */
45#define NF_IP_PRE_ROUTING 0
46/* If the packet is destined for this box. */
47#define NF_IP_LOCAL_IN 1
48/* If the packet is destined for another interface. */
49#define NF_IP_FORWARD 2
50/* Packets coming from a local process. */
51#define NF_IP_LOCAL_OUT 3
52/* Packets about to hit the wire. */
53#define NF_IP_POST_ROUTING 4
54#define NF_IP_NUMHOOKS 5
55#endif /* ! __KERNEL__ */
56
57enum nf_ip_hook_priorities {
58 NF_IP_PRI_FIRST = INT_MIN,
59 NF_IP_PRI_CONNTRACK_DEFRAG = -400,
60 NF_IP_PRI_RAW = -300,
61 NF_IP_PRI_SELINUX_FIRST = -225,
62 NF_IP_PRI_CONNTRACK = -200,
63 NF_IP_PRI_MANGLE = -150,
64 NF_IP_PRI_NAT_DST = -100,
65 NF_IP_PRI_FILTER = 0,
66 NF_IP_PRI_SECURITY = 50,
67 NF_IP_PRI_NAT_SRC = 100,
68 NF_IP_PRI_SELINUX_LAST = 225,
69 NF_IP_PRI_CONNTRACK_HELPER = 300,
70 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
71 NF_IP_PRI_LAST = INT_MAX,
72};
73
74/* Arguments for setsockopt SOL_IP: */
75/* 2.0 firewalling went from 64 through 71 (and +256, +512, etc). */
76/* 2.2 firewalling (+ masq) went from 64 through 76 */
77/* 2.4 firewalling went 64 through 67. */
78#define SO_ORIGINAL_DST 80
79
80
81#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
index 00000000000..12497c6c794
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv6.h
@@ -0,0 +1,79 @@
1/* IPv6-specific defines for netfilter.
2 * (C)1998 Rusty Russell -- This code is GPL.
3 * (C)1999 David Jeffery
4 * this header was blatantly ripped from netfilter_ipv4.h
5 * it's amazing what adding a bunch of 6s can do =8^)
6 */
7#ifndef _UAPI__LINUX_IP6_NETFILTER_H
8#define _UAPI__LINUX_IP6_NETFILTER_H
9
10
11#include <linux/netfilter.h>
12
13/* only for userspace compatibility */
14#ifndef __KERNEL__
15
16#include <limits.h> /* for INT_MIN, INT_MAX */
17
18/* IP Cache bits. */
19/* Src IP address. */
20#define NFC_IP6_SRC 0x0001
21/* Dest IP address. */
22#define NFC_IP6_DST 0x0002
23/* Input device. */
24#define NFC_IP6_IF_IN 0x0004
25/* Output device. */
26#define NFC_IP6_IF_OUT 0x0008
27/* TOS. */
28#define NFC_IP6_TOS 0x0010
29/* Protocol. */
30#define NFC_IP6_PROTO 0x0020
31/* IP options. */
32#define NFC_IP6_OPTIONS 0x0040
33/* Frag & flags. */
34#define NFC_IP6_FRAG 0x0080
35
36
37/* Per-protocol information: only matters if proto match. */
38/* TCP flags. */
39#define NFC_IP6_TCPFLAGS 0x0100
40/* Source port. */
41#define NFC_IP6_SRC_PT 0x0200
42/* Dest port. */
43#define NFC_IP6_DST_PT 0x0400
44/* Something else about the proto */
45#define NFC_IP6_PROTO_UNKNOWN 0x2000
46
47/* IP6 Hooks */
48/* After promisc drops, checksum checks. */
49#define NF_IP6_PRE_ROUTING 0
50/* If the packet is destined for this box. */
51#define NF_IP6_LOCAL_IN 1
52/* If the packet is destined for another interface. */
53#define NF_IP6_FORWARD 2
54/* Packets coming from a local process. */
55#define NF_IP6_LOCAL_OUT 3
56/* Packets about to hit the wire. */
57#define NF_IP6_POST_ROUTING 4
58#define NF_IP6_NUMHOOKS 5
59#endif /* ! __KERNEL__ */
60
61
62enum nf_ip6_hook_priorities {
63 NF_IP6_PRI_FIRST = INT_MIN,
64 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
65 NF_IP6_PRI_RAW = -300,
66 NF_IP6_PRI_SELINUX_FIRST = -225,
67 NF_IP6_PRI_CONNTRACK = -200,
68 NF_IP6_PRI_MANGLE = -150,
69 NF_IP6_PRI_NAT_DST = -100,
70 NF_IP6_PRI_FILTER = 0,
71 NF_IP6_PRI_SECURITY = 50,
72 NF_IP6_PRI_NAT_SRC = 100,
73 NF_IP6_PRI_SELINUX_LAST = 225,
74 NF_IP6_PRI_CONNTRACK_HELPER = 300,
75 NF_IP6_PRI_LAST = INT_MAX,
76};
77
78
79#endif /* _UAPI__LINUX_IP6_NETFILTER_H */
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
new file mode 100644
index 00000000000..78d5b8a546d
--- /dev/null
+++ b/include/uapi/linux/netlink.h
@@ -0,0 +1,153 @@
1#ifndef _UAPI__LINUX_NETLINK_H
2#define _UAPI__LINUX_NETLINK_H
3
4#include <linux/socket.h> /* for __kernel_sa_family_t */
5#include <linux/types.h>
6
7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_UNUSED 1 /* Unused number */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
11#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
13#define NETLINK_XFRM 6 /* ipsec */
14#define NETLINK_SELINUX 7 /* SELinux event notifications */
15#define NETLINK_ISCSI 8 /* Open-iSCSI */
16#define NETLINK_AUDIT 9 /* auditing */
17#define NETLINK_FIB_LOOKUP 10
18#define NETLINK_CONNECTOR 11
19#define NETLINK_NETFILTER 12 /* netfilter subsystem */
20#define NETLINK_IP6_FW 13
21#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
22#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
23#define NETLINK_GENERIC 16
24/* leave room for NETLINK_DM (DM Events) */
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19
27#define NETLINK_RDMA 20
28#define NETLINK_CRYPTO 21 /* Crypto layer */
29
30#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
31
32#define MAX_LINKS 32
33
34struct sockaddr_nl {
35 __kernel_sa_family_t nl_family; /* AF_NETLINK */
36 unsigned short nl_pad; /* zero */
37 __u32 nl_pid; /* port ID */
38 __u32 nl_groups; /* multicast groups mask */
39};
40
41struct nlmsghdr {
42 __u32 nlmsg_len; /* Length of message including header */
43 __u16 nlmsg_type; /* Message content */
44 __u16 nlmsg_flags; /* Additional flags */
45 __u32 nlmsg_seq; /* Sequence number */
46 __u32 nlmsg_pid; /* Sending process port ID */
47};
48
49/* Flags values */
50
51#define NLM_F_REQUEST 1 /* It is request message. */
52#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
53#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
54#define NLM_F_ECHO 8 /* Echo this request */
55#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
56
57/* Modifiers to GET request */
58#define NLM_F_ROOT 0x100 /* specify tree root */
59#define NLM_F_MATCH 0x200 /* return all matching */
60#define NLM_F_ATOMIC 0x400 /* atomic GET */
61#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
62
63/* Modifiers to NEW request */
64#define NLM_F_REPLACE 0x100 /* Override existing */
65#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
66#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
67#define NLM_F_APPEND 0x800 /* Add to end of list */
68
69/*
70 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
71 4.4BSD CHANGE NLM_F_REPLACE
72
73 True CHANGE NLM_F_CREATE|NLM_F_REPLACE
74 Append NLM_F_CREATE
75 Check NLM_F_EXCL
76 */
77
78#define NLMSG_ALIGNTO 4U
79#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
80#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
81#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
82#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
83#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
84#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
85 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
86#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
87 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
88 (nlh)->nlmsg_len <= (len))
89#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
90
91#define NLMSG_NOOP 0x1 /* Nothing. */
92#define NLMSG_ERROR 0x2 /* Error */
93#define NLMSG_DONE 0x3 /* End of a dump */
94#define NLMSG_OVERRUN 0x4 /* Data lost */
95
96#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
97
98struct nlmsgerr {
99 int error;
100 struct nlmsghdr msg;
101};
102
103#define NETLINK_ADD_MEMBERSHIP 1
104#define NETLINK_DROP_MEMBERSHIP 2
105#define NETLINK_PKTINFO 3
106#define NETLINK_BROADCAST_ERROR 4
107#define NETLINK_NO_ENOBUFS 5
108
109struct nl_pktinfo {
110 __u32 group;
111};
112
113#define NET_MAJOR 36 /* Major 36 is reserved for networking */
114
115enum {
116 NETLINK_UNCONNECTED = 0,
117 NETLINK_CONNECTED,
118};
119
120/*
121 * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
122 * +---------------------+- - -+- - - - - - - - - -+- - -+
123 * | Header | Pad | Payload | Pad |
124 * | (struct nlattr) | ing | | ing |
125 * +---------------------+- - -+- - - - - - - - - -+- - -+
126 * <-------------- nlattr->nla_len -------------->
127 */
128
129struct nlattr {
130 __u16 nla_len;
131 __u16 nla_type;
132};
133
134/*
135 * nla_type (16 bits)
136 * +---+---+-------------------------------+
137 * | N | O | Attribute Type |
138 * +---+---+-------------------------------+
139 * N := Carries nested attributes
140 * O := Payload stored in network byte order
141 *
142 * Note: The N and O flag are mutually exclusive.
143 */
144#define NLA_F_NESTED (1 << 15)
145#define NLA_F_NET_BYTEORDER (1 << 14)
146#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
147
148#define NLA_ALIGNTO 4
149#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
150#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
151
152
153#endif /* _UAPI__LINUX_NETLINK_H */
diff --git a/include/linux/netrom.h b/include/uapi/linux/netrom.h
index af7313cc9cb..af7313cc9cb 100644
--- a/include/linux/netrom.h
+++ b/include/uapi/linux/netrom.h
diff --git a/include/linux/nfc.h b/include/uapi/linux/nfc.h
index d908d17da56..d908d17da56 100644
--- a/include/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
diff --git a/include/uapi/linux/nfs.h b/include/uapi/linux/nfs.h
new file mode 100644
index 00000000000..5199a36dd57
--- /dev/null
+++ b/include/uapi/linux/nfs.h
@@ -0,0 +1,131 @@
1/*
2 * NFS protocol definitions
3 *
4 * This file contains constants mostly for Version 2 of the protocol,
5 * but also has a couple of NFSv3 bits in (notably the error codes).
6 */
7#ifndef _UAPI_LINUX_NFS_H
8#define _UAPI_LINUX_NFS_H
9
10#define NFS_PROGRAM 100003
11#define NFS_PORT 2049
12#define NFS_MAXDATA 8192
13#define NFS_MAXPATHLEN 1024
14#define NFS_MAXNAMLEN 255
15#define NFS_MAXGROUPS 16
16#define NFS_FHSIZE 32
17#define NFS_COOKIESIZE 4
18#define NFS_FIFO_DEV (-1)
19#define NFSMODE_FMT 0170000
20#define NFSMODE_DIR 0040000
21#define NFSMODE_CHR 0020000
22#define NFSMODE_BLK 0060000
23#define NFSMODE_REG 0100000
24#define NFSMODE_LNK 0120000
25#define NFSMODE_SOCK 0140000
26#define NFSMODE_FIFO 0010000
27
28#define NFS_MNT_PROGRAM 100005
29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3
31
32#define NFS_PIPE_DIRNAME "nfs"
33
34/*
35 * NFS stats. The good thing with these values is that NFSv3 errors are
36 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
37 * no-one uses anyway), so we can happily mix code as long as we make sure
38 * no NFSv3 errors are returned to NFSv2 clients.
39 * Error codes that have a `--' in the v2 column are not part of the
40 * standard, but seem to be widely used nevertheless.
41 */
42 enum nfs_stat {
43 NFS_OK = 0, /* v2 v3 v4 */
44 NFSERR_PERM = 1, /* v2 v3 v4 */
45 NFSERR_NOENT = 2, /* v2 v3 v4 */
46 NFSERR_IO = 5, /* v2 v3 v4 */
47 NFSERR_NXIO = 6, /* v2 v3 v4 */
48 NFSERR_EAGAIN = 11, /* v2 v3 */
49 NFSERR_ACCES = 13, /* v2 v3 v4 */
50 NFSERR_EXIST = 17, /* v2 v3 v4 */
51 NFSERR_XDEV = 18, /* v3 v4 */
52 NFSERR_NODEV = 19, /* v2 v3 v4 */
53 NFSERR_NOTDIR = 20, /* v2 v3 v4 */
54 NFSERR_ISDIR = 21, /* v2 v3 v4 */
55 NFSERR_INVAL = 22, /* v2 v3 v4 */
56 NFSERR_FBIG = 27, /* v2 v3 v4 */
57 NFSERR_NOSPC = 28, /* v2 v3 v4 */
58 NFSERR_ROFS = 30, /* v2 v3 v4 */
59 NFSERR_MLINK = 31, /* v3 v4 */
60 NFSERR_OPNOTSUPP = 45, /* v2 v3 */
61 NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */
62 NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */
63 NFSERR_DQUOT = 69, /* v2 v3 v4 */
64 NFSERR_STALE = 70, /* v2 v3 v4 */
65 NFSERR_REMOTE = 71, /* v2 v3 */
66 NFSERR_WFLUSH = 99, /* v2 */
67 NFSERR_BADHANDLE = 10001, /* v3 v4 */
68 NFSERR_NOT_SYNC = 10002, /* v3 */
69 NFSERR_BAD_COOKIE = 10003, /* v3 v4 */
70 NFSERR_NOTSUPP = 10004, /* v3 v4 */
71 NFSERR_TOOSMALL = 10005, /* v3 v4 */
72 NFSERR_SERVERFAULT = 10006, /* v3 v4 */
73 NFSERR_BADTYPE = 10007, /* v3 v4 */
74 NFSERR_JUKEBOX = 10008, /* v3 v4 */
75 NFSERR_SAME = 10009, /* v4 */
76 NFSERR_DENIED = 10010, /* v4 */
77 NFSERR_EXPIRED = 10011, /* v4 */
78 NFSERR_LOCKED = 10012, /* v4 */
79 NFSERR_GRACE = 10013, /* v4 */
80 NFSERR_FHEXPIRED = 10014, /* v4 */
81 NFSERR_SHARE_DENIED = 10015, /* v4 */
82 NFSERR_WRONGSEC = 10016, /* v4 */
83 NFSERR_CLID_INUSE = 10017, /* v4 */
84 NFSERR_RESOURCE = 10018, /* v4 */
85 NFSERR_MOVED = 10019, /* v4 */
86 NFSERR_NOFILEHANDLE = 10020, /* v4 */
87 NFSERR_MINOR_VERS_MISMATCH = 10021, /* v4 */
88 NFSERR_STALE_CLIENTID = 10022, /* v4 */
89 NFSERR_STALE_STATEID = 10023, /* v4 */
90 NFSERR_OLD_STATEID = 10024, /* v4 */
91 NFSERR_BAD_STATEID = 10025, /* v4 */
92 NFSERR_BAD_SEQID = 10026, /* v4 */
93 NFSERR_NOT_SAME = 10027, /* v4 */
94 NFSERR_LOCK_RANGE = 10028, /* v4 */
95 NFSERR_SYMLINK = 10029, /* v4 */
96 NFSERR_RESTOREFH = 10030, /* v4 */
97 NFSERR_LEASE_MOVED = 10031, /* v4 */
98 NFSERR_ATTRNOTSUPP = 10032, /* v4 */
99 NFSERR_NO_GRACE = 10033, /* v4 */
100 NFSERR_RECLAIM_BAD = 10034, /* v4 */
101 NFSERR_RECLAIM_CONFLICT = 10035,/* v4 */
102 NFSERR_BAD_XDR = 10036, /* v4 */
103 NFSERR_LOCKS_HELD = 10037, /* v4 */
104 NFSERR_OPENMODE = 10038, /* v4 */
105 NFSERR_BADOWNER = 10039, /* v4 */
106 NFSERR_BADCHAR = 10040, /* v4 */
107 NFSERR_BADNAME = 10041, /* v4 */
108 NFSERR_BAD_RANGE = 10042, /* v4 */
109 NFSERR_LOCK_NOTSUPP = 10043, /* v4 */
110 NFSERR_OP_ILLEGAL = 10044, /* v4 */
111 NFSERR_DEADLOCK = 10045, /* v4 */
112 NFSERR_FILE_OPEN = 10046, /* v4 */
113 NFSERR_ADMIN_REVOKED = 10047, /* v4 */
114 NFSERR_CB_PATH_DOWN = 10048, /* v4 */
115};
116
117/* NFSv2 file types - beware, these are not the same in NFSv3 */
118
119enum nfs_ftype {
120 NFNON = 0,
121 NFREG = 1,
122 NFDIR = 2,
123 NFBLK = 3,
124 NFCHR = 4,
125 NFLNK = 5,
126 NFSOCK = 6,
127 NFBAD = 7,
128 NFFIFO = 8
129};
130
131#endif /* _UAPI_LINUX_NFS_H */
diff --git a/include/linux/nfs2.h b/include/uapi/linux/nfs2.h
index fde24b30cc9..fde24b30cc9 100644
--- a/include/linux/nfs2.h
+++ b/include/uapi/linux/nfs2.h
diff --git a/include/uapi/linux/nfs3.h b/include/uapi/linux/nfs3.h
new file mode 100644
index 00000000000..231ef4e6982
--- /dev/null
+++ b/include/uapi/linux/nfs3.h
@@ -0,0 +1,97 @@
1/*
2 * NFSv3 protocol definitions
3 */
4#ifndef _UAPI_LINUX_NFS3_H
5#define _UAPI_LINUX_NFS3_H
6
7#define NFS3_PORT 2049
8#define NFS3_MAXDATA 32768
9#define NFS3_MAXPATHLEN PATH_MAX
10#define NFS3_MAXNAMLEN NAME_MAX
11#define NFS3_MAXGROUPS 16
12#define NFS3_FHSIZE 64
13#define NFS3_COOKIESIZE 4
14#define NFS3_CREATEVERFSIZE 8
15#define NFS3_COOKIEVERFSIZE 8
16#define NFS3_WRITEVERFSIZE 8
17#define NFS3_FIFO_DEV (-1)
18#define NFS3MODE_FMT 0170000
19#define NFS3MODE_DIR 0040000
20#define NFS3MODE_CHR 0020000
21#define NFS3MODE_BLK 0060000
22#define NFS3MODE_REG 0100000
23#define NFS3MODE_LNK 0120000
24#define NFS3MODE_SOCK 0140000
25#define NFS3MODE_FIFO 0010000
26
27/* Flags for access() call */
28#define NFS3_ACCESS_READ 0x0001
29#define NFS3_ACCESS_LOOKUP 0x0002
30#define NFS3_ACCESS_MODIFY 0x0004
31#define NFS3_ACCESS_EXTEND 0x0008
32#define NFS3_ACCESS_DELETE 0x0010
33#define NFS3_ACCESS_EXECUTE 0x0020
34#define NFS3_ACCESS_FULL 0x003f
35
36/* Flags for create mode */
37enum nfs3_createmode {
38 NFS3_CREATE_UNCHECKED = 0,
39 NFS3_CREATE_GUARDED = 1,
40 NFS3_CREATE_EXCLUSIVE = 2
41};
42
43/* NFSv3 file system properties */
44#define NFS3_FSF_LINK 0x0001
45#define NFS3_FSF_SYMLINK 0x0002
46#define NFS3_FSF_HOMOGENEOUS 0x0008
47#define NFS3_FSF_CANSETTIME 0x0010
48/* Some shorthands. See fs/nfsd/nfs3proc.c */
49#define NFS3_FSF_DEFAULT 0x001B
50#define NFS3_FSF_BILLYBOY 0x0018
51#define NFS3_FSF_READONLY 0x0008
52
53enum nfs3_ftype {
54 NF3NON = 0,
55 NF3REG = 1,
56 NF3DIR = 2,
57 NF3BLK = 3,
58 NF3CHR = 4,
59 NF3LNK = 5,
60 NF3SOCK = 6,
61 NF3FIFO = 7, /* changed from NFSv2 (was 8) */
62 NF3BAD = 8
63};
64
65struct nfs3_fh {
66 unsigned short size;
67 unsigned char data[NFS3_FHSIZE];
68};
69
70#define NFS3_VERSION 3
71#define NFS3PROC_NULL 0
72#define NFS3PROC_GETATTR 1
73#define NFS3PROC_SETATTR 2
74#define NFS3PROC_LOOKUP 3
75#define NFS3PROC_ACCESS 4
76#define NFS3PROC_READLINK 5
77#define NFS3PROC_READ 6
78#define NFS3PROC_WRITE 7
79#define NFS3PROC_CREATE 8
80#define NFS3PROC_MKDIR 9
81#define NFS3PROC_SYMLINK 10
82#define NFS3PROC_MKNOD 11
83#define NFS3PROC_REMOVE 12
84#define NFS3PROC_RMDIR 13
85#define NFS3PROC_RENAME 14
86#define NFS3PROC_LINK 15
87#define NFS3PROC_READDIR 16
88#define NFS3PROC_READDIRPLUS 17
89#define NFS3PROC_FSSTAT 18
90#define NFS3PROC_FSINFO 19
91#define NFS3PROC_PATHCONF 20
92#define NFS3PROC_COMMIT 21
93
94#define NFS_MNT3_VERSION 3
95
96
97#endif /* _UAPI_LINUX_NFS3_H */
diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h
new file mode 100644
index 00000000000..788128ebac4
--- /dev/null
+++ b/include/uapi/linux/nfs4.h
@@ -0,0 +1,178 @@
1/*
2 * include/linux/nfs4.h
3 *
4 * NFSv4 protocol definitions.
5 *
6 * Copyright (c) 2002 The Regents of the University of Michigan.
7 * All rights reserved.
8 *
9 * Kendrick Smith <kmsmith@umich.edu>
10 * Andy Adamson <andros@umich.edu>
11 */
12
13#ifndef _UAPI_LINUX_NFS4_H
14#define _UAPI_LINUX_NFS4_H
15
16#include <linux/types.h>
17
18#define NFS4_BITMAP_SIZE 2
19#define NFS4_VERIFIER_SIZE 8
20#define NFS4_STATEID_SEQID_SIZE 4
21#define NFS4_STATEID_OTHER_SIZE 12
22#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
23#define NFS4_FHSIZE 128
24#define NFS4_MAXPATHLEN PATH_MAX
25#define NFS4_MAXNAMLEN NAME_MAX
26#define NFS4_OPAQUE_LIMIT 1024
27#define NFS4_MAX_SESSIONID_LEN 16
28
29#define NFS4_ACCESS_READ 0x0001
30#define NFS4_ACCESS_LOOKUP 0x0002
31#define NFS4_ACCESS_MODIFY 0x0004
32#define NFS4_ACCESS_EXTEND 0x0008
33#define NFS4_ACCESS_DELETE 0x0010
34#define NFS4_ACCESS_EXECUTE 0x0020
35
36#define NFS4_FH_PERSISTENT 0x0000
37#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
38#define NFS4_FH_VOLATILE_ANY 0x0002
39#define NFS4_FH_VOL_MIGRATION 0x0004
40#define NFS4_FH_VOL_RENAME 0x0008
41
42#define NFS4_OPEN_RESULT_CONFIRM 0x0002
43#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
44
45#define NFS4_SHARE_ACCESS_MASK 0x000F
46#define NFS4_SHARE_ACCESS_READ 0x0001
47#define NFS4_SHARE_ACCESS_WRITE 0x0002
48#define NFS4_SHARE_ACCESS_BOTH 0x0003
49#define NFS4_SHARE_DENY_READ 0x0001
50#define NFS4_SHARE_DENY_WRITE 0x0002
51#define NFS4_SHARE_DENY_BOTH 0x0003
52
53/* nfs41 */
54#define NFS4_SHARE_WANT_MASK 0xFF00
55#define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000
56#define NFS4_SHARE_WANT_READ_DELEG 0x0100
57#define NFS4_SHARE_WANT_WRITE_DELEG 0x0200
58#define NFS4_SHARE_WANT_ANY_DELEG 0x0300
59#define NFS4_SHARE_WANT_NO_DELEG 0x0400
60#define NFS4_SHARE_WANT_CANCEL 0x0500
61
62#define NFS4_SHARE_WHEN_MASK 0xF0000
63#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
64#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
65
66#define NFS4_CDFC4_FORE 0x1
67#define NFS4_CDFC4_BACK 0x2
68#define NFS4_CDFC4_BOTH 0x3
69#define NFS4_CDFC4_FORE_OR_BOTH 0x3
70#define NFS4_CDFC4_BACK_OR_BOTH 0x7
71
72#define NFS4_CDFS4_FORE 0x1
73#define NFS4_CDFS4_BACK 0x2
74#define NFS4_CDFS4_BOTH 0x3
75
76#define NFS4_SET_TO_SERVER_TIME 0
77#define NFS4_SET_TO_CLIENT_TIME 1
78
79#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
80#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
81#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
82#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
83
84#define ACL4_SUPPORT_ALLOW_ACL 0x01
85#define ACL4_SUPPORT_DENY_ACL 0x02
86#define ACL4_SUPPORT_AUDIT_ACL 0x04
87#define ACL4_SUPPORT_ALARM_ACL 0x08
88
89#define NFS4_ACE_FILE_INHERIT_ACE 0x00000001
90#define NFS4_ACE_DIRECTORY_INHERIT_ACE 0x00000002
91#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
92#define NFS4_ACE_INHERIT_ONLY_ACE 0x00000008
93#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
94#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
95#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
96
97#define NFS4_ACE_READ_DATA 0x00000001
98#define NFS4_ACE_LIST_DIRECTORY 0x00000001
99#define NFS4_ACE_WRITE_DATA 0x00000002
100#define NFS4_ACE_ADD_FILE 0x00000002
101#define NFS4_ACE_APPEND_DATA 0x00000004
102#define NFS4_ACE_ADD_SUBDIRECTORY 0x00000004
103#define NFS4_ACE_READ_NAMED_ATTRS 0x00000008
104#define NFS4_ACE_WRITE_NAMED_ATTRS 0x00000010
105#define NFS4_ACE_EXECUTE 0x00000020
106#define NFS4_ACE_DELETE_CHILD 0x00000040
107#define NFS4_ACE_READ_ATTRIBUTES 0x00000080
108#define NFS4_ACE_WRITE_ATTRIBUTES 0x00000100
109#define NFS4_ACE_DELETE 0x00010000
110#define NFS4_ACE_READ_ACL 0x00020000
111#define NFS4_ACE_WRITE_ACL 0x00040000
112#define NFS4_ACE_WRITE_OWNER 0x00080000
113#define NFS4_ACE_SYNCHRONIZE 0x00100000
114#define NFS4_ACE_GENERIC_READ 0x00120081
115#define NFS4_ACE_GENERIC_WRITE 0x00160106
116#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
117#define NFS4_ACE_MASK_ALL 0x001F01FF
118
119#define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001
120#define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002
121#define EXCHGID4_FLAG_BIND_PRINC_STATEID 0x00000100
122
123#define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000
124#define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000
125#define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000
126#define EXCHGID4_FLAG_MASK_PNFS 0x00070000
127
128#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
129#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
130/*
131 * Since the validity of these bits depends on whether
132 * they're set in the argument or response, have separate
133 * invalid flag masks for arg (_A) and resp (_R).
134 */
135#define EXCHGID4_FLAG_MASK_A 0x40070103
136#define EXCHGID4_FLAG_MASK_R 0x80070103
137
138#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
139#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
140#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004
141#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008
142#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
143#define SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020
144#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
145#define SEQ4_STATUS_LEASE_MOVED 0x00000080
146#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
147#define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200
148#define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400
149
150#define NFS4_SECINFO_STYLE4_CURRENT_FH 0
151#define NFS4_SECINFO_STYLE4_PARENT 1
152
153#define NFS4_MAX_UINT64 (~(u64)0)
154
155/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
156 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
157 */
158#define NFS4_MAX_OPS 8
159
160/* Our NFS4 client back channel server only wants the cb_sequene and the
161 * actual operation per compound
162 */
163#define NFS4_MAX_BACK_CHANNEL_OPS 2
164
165enum nfs4_acl_whotype {
166 NFS4_ACL_WHO_NAMED = 0,
167 NFS4_ACL_WHO_OWNER,
168 NFS4_ACL_WHO_GROUP,
169 NFS4_ACL_WHO_EVERYONE,
170};
171
172#endif /* _UAPI_LINUX_NFS4_H */
173
174/*
175 * Local variables:
176 * c-basic-offset: 8
177 * End:
178 */
diff --git a/include/linux/nfs4_mount.h b/include/uapi/linux/nfs4_mount.h
index a0dcf665565..a0dcf665565 100644
--- a/include/linux/nfs4_mount.h
+++ b/include/uapi/linux/nfs4_mount.h
diff --git a/include/uapi/linux/nfs_fs.h b/include/uapi/linux/nfs_fs.h
new file mode 100644
index 00000000000..49142287999
--- /dev/null
+++ b/include/uapi/linux/nfs_fs.h
@@ -0,0 +1,61 @@
1/*
2 * linux/include/linux/nfs_fs.h
3 *
4 * Copyright (C) 1992 Rick Sladkey
5 *
6 * OS-specific nfs filesystem definitions and declarations
7 */
8
9#ifndef _UAPI_LINUX_NFS_FS_H
10#define _UAPI_LINUX_NFS_FS_H
11
12#include <linux/magic.h>
13
14/* Default timeout values */
15#define NFS_DEF_UDP_TIMEO (11)
16#define NFS_DEF_UDP_RETRANS (3)
17#define NFS_DEF_TCP_TIMEO (600)
18#define NFS_DEF_TCP_RETRANS (2)
19
20#define NFS_MAX_UDP_TIMEOUT (60*HZ)
21#define NFS_MAX_TCP_TIMEOUT (600*HZ)
22
23#define NFS_DEF_ACREGMIN (3)
24#define NFS_DEF_ACREGMAX (60)
25#define NFS_DEF_ACDIRMIN (30)
26#define NFS_DEF_ACDIRMAX (60)
27
28/*
29 * When flushing a cluster of dirty pages, there can be different
30 * strategies:
31 */
32#define FLUSH_SYNC 1 /* file being synced, or contention */
33#define FLUSH_STABLE 4 /* commit to stable storage */
34#define FLUSH_LOWPRI 8 /* low priority background flush */
35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
36#define FLUSH_COND_STABLE 32 /* conditional stable write - only stable
37 * if everything fits in one RPC */
38
39
40/*
41 * NFS debug flags
42 */
43#define NFSDBG_VFS 0x0001
44#define NFSDBG_DIRCACHE 0x0002
45#define NFSDBG_LOOKUPCACHE 0x0004
46#define NFSDBG_PAGECACHE 0x0008
47#define NFSDBG_PROC 0x0010
48#define NFSDBG_XDR 0x0020
49#define NFSDBG_FILE 0x0040
50#define NFSDBG_ROOT 0x0080
51#define NFSDBG_CALLBACK 0x0100
52#define NFSDBG_CLIENT 0x0200
53#define NFSDBG_MOUNT 0x0400
54#define NFSDBG_FSCACHE 0x0800
55#define NFSDBG_PNFS 0x1000
56#define NFSDBG_PNFS_LD 0x2000
57#define NFSDBG_STATE 0x4000
58#define NFSDBG_ALL 0xFFFF
59
60
61#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
index 00000000000..8d4b1c7b24d
--- /dev/null
+++ b/include/uapi/linux/nfs_idmap.h
@@ -0,0 +1,65 @@
1/*
2 * include/linux/nfs_idmap.h
3 *
4 * UID and GID to name mapping for clients.
5 *
6 * Copyright (c) 2002 The Regents of the University of Michigan.
7 * All rights reserved.
8 *
9 * Marius Aamodt Eriksen <marius@umich.edu>
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _UAPINFS_IDMAP_H
38#define _UAPINFS_IDMAP_H
39
40#include <linux/types.h>
41
42/* XXX from bits/utmp.h */
43#define IDMAP_NAMESZ 128
44
45#define IDMAP_TYPE_USER 0
46#define IDMAP_TYPE_GROUP 1
47
48#define IDMAP_CONV_IDTONAME 0
49#define IDMAP_CONV_NAMETOID 1
50
51#define IDMAP_STATUS_INVALIDMSG 0x01
52#define IDMAP_STATUS_AGAIN 0x02
53#define IDMAP_STATUS_LOOKUPFAIL 0x04
54#define IDMAP_STATUS_SUCCESS 0x08
55
56struct idmap_msg {
57 __u8 im_type;
58 __u8 im_conv;
59 char im_name[IDMAP_NAMESZ];
60 __u32 im_id;
61 __u8 im_status;
62};
63
64
65#endif /* _UAPINFS_IDMAP_H */
diff --git a/include/linux/nfs_mount.h b/include/uapi/linux/nfs_mount.h
index 576bddd72e0..576bddd72e0 100644
--- a/include/linux/nfs_mount.h
+++ b/include/uapi/linux/nfs_mount.h
diff --git a/include/uapi/linux/nfsacl.h b/include/uapi/linux/nfsacl.h
new file mode 100644
index 00000000000..9bb9771a107
--- /dev/null
+++ b/include/uapi/linux/nfsacl.h
@@ -0,0 +1,29 @@
1/*
2 * File: linux/nfsacl.h
3 *
4 * (C) 2003 Andreas Gruenbacher <agruen@suse.de>
5 */
6#ifndef _UAPI__LINUX_NFSACL_H
7#define _UAPI__LINUX_NFSACL_H
8
9#define NFS_ACL_PROGRAM 100227
10
11#define ACLPROC2_GETACL 1
12#define ACLPROC2_SETACL 2
13#define ACLPROC2_GETATTR 3
14#define ACLPROC2_ACCESS 4
15
16#define ACLPROC3_GETACL 1
17#define ACLPROC3_SETACL 2
18
19
20/* Flags for the getacl/setacl mode */
21#define NFS_ACL 0x0001
22#define NFS_ACLCNT 0x0002
23#define NFS_DFACL 0x0004
24#define NFS_DFACLCNT 0x0008
25
26/* Flag for Default ACL entries */
27#define NFS_ACL_DEFAULT 0x1000
28
29#endif /* _UAPI__LINUX_NFSACL_H */
diff --git a/include/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 7df9b500c80..7df9b500c80 100644
--- a/include/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
diff --git a/include/uapi/linux/nubus.h b/include/uapi/linux/nubus.h
new file mode 100644
index 00000000000..77513d2b563
--- /dev/null
+++ b/include/uapi/linux/nubus.h
@@ -0,0 +1,244 @@
1/*
2 nubus.h: various definitions and prototypes for NuBus drivers to use.
3
4 Originally written by Alan Cox.
5
6 Hacked to death by C. Scott Ananian and David Huggins-Daines.
7
8 Some of the constants in here are from the corresponding
9 NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
10 rest of them on our own. */
11
12#ifndef _UAPILINUX_NUBUS_H
13#define _UAPILINUX_NUBUS_H
14
15#include <linux/types.h>
16
17enum nubus_category {
18 NUBUS_CAT_BOARD = 0x0001,
19 NUBUS_CAT_DISPLAY = 0x0003,
20 NUBUS_CAT_NETWORK = 0x0004,
21 NUBUS_CAT_COMMUNICATIONS = 0x0006,
22 NUBUS_CAT_FONT = 0x0009,
23 NUBUS_CAT_CPU = 0x000A,
24 /* For lack of a better name */
25 NUBUS_CAT_DUODOCK = 0x0020
26};
27
28enum nubus_type_network {
29 NUBUS_TYPE_ETHERNET = 0x0001,
30 NUBUS_TYPE_RS232 = 0x0002
31};
32
33enum nubus_type_display {
34 NUBUS_TYPE_VIDEO = 0x0001
35};
36
37enum nubus_type_cpu {
38 NUBUS_TYPE_68020 = 0x0003,
39 NUBUS_TYPE_68030 = 0x0004,
40 NUBUS_TYPE_68040 = 0x0005
41};
42
43/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
44 * 68030 motherboards: <10,4,0,24>
45 * 68040 motherboards: <10,5,0,24>
46 * DuoDock Plus: <32,1,1,2>
47 *
48 * Toby Frame Buffer card: <3,1,1,1>
49 * RBV built-in video (IIci): <3,1,1,24>
50 * Valkyrie built-in video (Q630): <3,1,1,46>
51 * Macintosh Display Card: <3,1,1,25>
52 * Sonora built-in video (P460): <3,1,1,34>
53 * Jet framebuffer (DuoDock Plus): <3,1,1,41>
54 *
55 * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
56 * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
57 * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
58 * Sonic Systems Ethernet A-Series Card: <4,1,268,256>
59 * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
60 * ROM on the above card: <2,1,0,0>
61 * Cabletron ethernet card: <4,1,1,265>
62 * Farallon ethernet card: <4,1,268,256> (identical to Sonic Systems card)
63 * Kinetics EtherPort IIN: <4,1,259,262>
64 * API Engineering EtherRun_LCa PDS enet card: <4,1,282,256>
65 *
66 * Add your devices to the list! You can obtain the "Slots" utility
67 * from Apple's FTP site at:
68 * ftp://dev.apple.com/devworld/Tool_Chest/Devices_-_Hardware/NuBus_Slot_Manager/
69 *
70 * Alternately, TattleTech can be found at any Info-Mac mirror site.
71 * or from its distribution site: ftp://ftp.decismkr.com/dms
72 */
73
74/* DrSW: Uniquely identifies the software interface to a board. This
75 is usually the one you want to look at when writing a driver. It's
76 not as useful as you think, though, because as we should know by
77 now (duh), "Apple Compatible" can mean a lot of things... */
78
79/* Add known DrSW values here */
80enum nubus_drsw {
81 /* NUBUS_CAT_DISPLAY */
82 NUBUS_DRSW_APPLE = 0x0001,
83 NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
84
85 /* NUBUS_CAT_NETWORK */
86 NUBUS_DRSW_3COM = 0x0000,
87 NUBUS_DRSW_CABLETRON = 0x0001,
88 NUBUS_DRSW_SONIC_LC = 0x0001,
89 NUBUS_DRSW_KINETICS = 0x0103,
90 NUBUS_DRSW_ASANTE = 0x0104,
91 NUBUS_DRSW_TECHWORKS = 0x0109,
92 NUBUS_DRSW_DAYNA = 0x010b,
93 NUBUS_DRSW_FARALLON = 0x010c,
94 NUBUS_DRSW_APPLE_SN = 0x010f,
95 NUBUS_DRSW_DAYNA2 = 0x0115,
96 NUBUS_DRSW_FOCUS = 0x011a,
97 NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
98 NUBUS_DRSW_DAYNA_LC = 0x011e,
99
100 /* NUBUS_CAT_CPU */
101 NUBUS_DRSW_NONE = 0x0000,
102};
103
104/* DrHW: Uniquely identifies the hardware interface to a board (or at
105 least, it should... some video cards are known to incorrectly
106 identify themselves as Toby cards) */
107
108/* Add known DrHW values here */
109enum nubus_drhw {
110 /* NUBUS_CAT_DISPLAY */
111 NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
112 NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
113 NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
114 NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
115 NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
116 NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
117 NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
118 NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
119 NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
120 NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
121 NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
122 NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
123 NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
124 NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
125 NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
126 NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
127 NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
128 NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
129 NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
130 NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
131 NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
132 NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
133 NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
134 NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
135 NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
136 NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
137 NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
138 NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
139 NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
140 NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
141 NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
142
143 /* NUBUS_CAT_NETWORK */
144 NUBUS_DRHW_INTERLAN = 0x0100,
145 NUBUS_DRHW_SMC9194 = 0x0101,
146 NUBUS_DRHW_KINETICS = 0x0106,
147 NUBUS_DRHW_CABLETRON = 0x0109,
148 NUBUS_DRHW_ASANTE_LC = 0x010f,
149 NUBUS_DRHW_SONIC = 0x0110,
150 NUBUS_DRHW_TECHWORKS = 0x0112,
151 NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
152 NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
153 NUBUS_DRHW_FOCUS = 0x011c,
154 NUBUS_DRHW_SONNET = 0x011d,
155};
156
157/* Resource IDs: These are the identifiers for the various weird and
158 wonderful tidbits of information that may or may not reside in the
159 NuBus ROM directory. */
160enum nubus_res_id {
161 NUBUS_RESID_TYPE = 0x0001,
162 NUBUS_RESID_NAME = 0x0002,
163 NUBUS_RESID_ICON = 0x0003,
164 NUBUS_RESID_DRVRDIR = 0x0004,
165 NUBUS_RESID_LOADREC = 0x0005,
166 NUBUS_RESID_BOOTREC = 0x0006,
167 NUBUS_RESID_FLAGS = 0x0007,
168 NUBUS_RESID_HWDEVID = 0x0008,
169 NUBUS_RESID_MINOR_BASEOS = 0x000a,
170 NUBUS_RESID_MINOR_LENGTH = 0x000b,
171 NUBUS_RESID_MAJOR_BASEOS = 0x000c,
172 NUBUS_RESID_MAJOR_LENGTH = 0x000d,
173 NUBUS_RESID_CICN = 0x000f,
174 NUBUS_RESID_ICL8 = 0x0010,
175 NUBUS_RESID_ICL4 = 0x0011,
176};
177
178/* Category-specific resources. */
179enum nubus_board_res_id {
180 NUBUS_RESID_BOARDID = 0x0020,
181 NUBUS_RESID_PRAMINITDATA = 0x0021,
182 NUBUS_RESID_PRIMARYINIT = 0x0022,
183 NUBUS_RESID_TIMEOUTCONST = 0x0023,
184 NUBUS_RESID_VENDORINFO = 0x0024,
185 NUBUS_RESID_BOARDFLAGS = 0x0025,
186 NUBUS_RESID_SECONDINIT = 0x0026,
187
188 /* Not sure why Apple put these next two in here */
189 NUBUS_RESID_VIDNAMES = 0x0041,
190 NUBUS_RESID_VIDMODES = 0x007e
191};
192
193/* Fields within the vendor info directory */
194enum nubus_vendor_res_id {
195 NUBUS_RESID_VEND_ID = 0x0001,
196 NUBUS_RESID_VEND_SERIAL = 0x0002,
197 NUBUS_RESID_VEND_REV = 0x0003,
198 NUBUS_RESID_VEND_PART = 0x0004,
199 NUBUS_RESID_VEND_DATE = 0x0005
200};
201
202enum nubus_net_res_id {
203 NUBUS_RESID_MAC_ADDRESS = 0x0080
204};
205
206enum nubus_cpu_res_id {
207 NUBUS_RESID_MEMINFO = 0x0081,
208 NUBUS_RESID_ROMINFO = 0x0082
209};
210
211enum nubus_display_res_id {
212 NUBUS_RESID_GAMMADIR = 0x0040,
213 NUBUS_RESID_FIRSTMODE = 0x0080,
214 NUBUS_RESID_SECONDMODE = 0x0081,
215 NUBUS_RESID_THIRDMODE = 0x0082,
216 NUBUS_RESID_FOURTHMODE = 0x0083,
217 NUBUS_RESID_FIFTHMODE = 0x0084,
218 NUBUS_RESID_SIXTHMODE = 0x0085
219};
220
221struct nubus_dir
222{
223 unsigned char *base;
224 unsigned char *ptr;
225 int done;
226 int mask;
227};
228
229struct nubus_dirent
230{
231 unsigned char *base;
232 unsigned char type;
233 __u32 data; /* Actually 24bits used */
234 int mask;
235};
236
237
238/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
239static inline void *nubus_slot_addr(int slot)
240{
241 return (void *)(0xF0000000|(slot<<24));
242}
243
244#endif /* _UAPILINUX_NUBUS_H */
diff --git a/include/uapi/linux/nvram.h b/include/uapi/linux/nvram.h
new file mode 100644
index 00000000000..0986c433738
--- /dev/null
+++ b/include/uapi/linux/nvram.h
@@ -0,0 +1,16 @@
1#ifndef _UAPI_LINUX_NVRAM_H
2#define _UAPI_LINUX_NVRAM_H
3
4#include <linux/ioctl.h>
5
6/* /dev/nvram ioctls */
7#define NVRAM_INIT _IO('p', 0x40) /* initialize NVRAM and set checksum */
8#define NVRAM_SETCKS _IO('p', 0x41) /* recalculate checksum */
9
10/* for all current systems, this is where NVRAM starts */
11#define NVRAM_FIRST_BYTE 14
12/* all these functions expect an NVRAM offset, not an absolute */
13#define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE)
14
15
16#endif /* _UAPI_LINUX_NVRAM_H */
diff --git a/include/linux/omap3isp.h b/include/uapi/linux/omap3isp.h
index c090cf9249b..c090cf9249b 100644
--- a/include/linux/omap3isp.h
+++ b/include/uapi/linux/omap3isp.h
diff --git a/include/uapi/linux/omapfb.h b/include/uapi/linux/omapfb.h
new file mode 100644
index 00000000000..7c97bc00ac6
--- /dev/null
+++ b/include/uapi/linux/omapfb.h
@@ -0,0 +1,222 @@
1/*
2 * File: include/linux/omapfb.h
3 *
4 * Framebuffer driver for TI OMAP boards
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef _UAPI__LINUX_OMAPFB_H__
25#define _UAPI__LINUX_OMAPFB_H__
26
27#include <linux/fb.h>
28#include <linux/ioctl.h>
29#include <linux/types.h>
30
31/* IOCTL commands. */
32
33#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
34#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
35#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
36#define OMAP_IO(num) _IO('O', num)
37
38#define OMAPFB_MIRROR OMAP_IOW(31, int)
39#define OMAPFB_SYNC_GFX OMAP_IO(37)
40#define OMAPFB_VSYNC OMAP_IO(38)
41#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
42#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
43#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
44#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
45#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
46#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
47#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
48#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
49#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
50#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
51#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
52#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
53#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
54#define OMAPFB_WAITFORVSYNC OMAP_IO(57)
55#define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
56#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
61
62#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
63#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
64#define OMAPFB_CAPS_PANEL_MASK 0xff000000
65
66#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
67#define OMAPFB_CAPS_TEARSYNC 0x00002000
68#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
69#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
70#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
71#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
72#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
73#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
74#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
75
76/* Values from DSP must map to lower 16-bits */
77#define OMAPFB_FORMAT_MASK 0x00ff
78#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
79#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
80#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
81#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
82#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
83
84#define OMAPFB_MEMTYPE_SDRAM 0
85#define OMAPFB_MEMTYPE_SRAM 1
86#define OMAPFB_MEMTYPE_MAX 1
87
88#define OMAPFB_MEM_IDX_ENABLED 0x80
89#define OMAPFB_MEM_IDX_MASK 0x7f
90
91enum omapfb_color_format {
92 OMAPFB_COLOR_RGB565 = 0,
93 OMAPFB_COLOR_YUV422,
94 OMAPFB_COLOR_YUV420,
95 OMAPFB_COLOR_CLUT_8BPP,
96 OMAPFB_COLOR_CLUT_4BPP,
97 OMAPFB_COLOR_CLUT_2BPP,
98 OMAPFB_COLOR_CLUT_1BPP,
99 OMAPFB_COLOR_RGB444,
100 OMAPFB_COLOR_YUY422,
101
102 OMAPFB_COLOR_ARGB16,
103 OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */
104 OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */
105 OMAPFB_COLOR_ARGB32,
106 OMAPFB_COLOR_RGBA32,
107 OMAPFB_COLOR_RGBX32,
108};
109
110struct omapfb_update_window {
111 __u32 x, y;
112 __u32 width, height;
113 __u32 format;
114 __u32 out_x, out_y;
115 __u32 out_width, out_height;
116 __u32 reserved[8];
117};
118
119struct omapfb_update_window_old {
120 __u32 x, y;
121 __u32 width, height;
122 __u32 format;
123};
124
125enum omapfb_plane {
126 OMAPFB_PLANE_GFX = 0,
127 OMAPFB_PLANE_VID1,
128 OMAPFB_PLANE_VID2,
129};
130
131enum omapfb_channel_out {
132 OMAPFB_CHANNEL_OUT_LCD = 0,
133 OMAPFB_CHANNEL_OUT_DIGIT,
134};
135
136struct omapfb_plane_info {
137 __u32 pos_x;
138 __u32 pos_y;
139 __u8 enabled;
140 __u8 channel_out;
141 __u8 mirror;
142 __u8 mem_idx;
143 __u32 out_width;
144 __u32 out_height;
145 __u32 reserved2[12];
146};
147
148struct omapfb_mem_info {
149 __u32 size;
150 __u8 type;
151 __u8 reserved[3];
152};
153
154struct omapfb_caps {
155 __u32 ctrl;
156 __u32 plane_color;
157 __u32 wnd_color;
158};
159
160enum omapfb_color_key_type {
161 OMAPFB_COLOR_KEY_DISABLED = 0,
162 OMAPFB_COLOR_KEY_GFX_DST,
163 OMAPFB_COLOR_KEY_VID_SRC,
164};
165
166struct omapfb_color_key {
167 __u8 channel_out;
168 __u32 background;
169 __u32 trans_key;
170 __u8 key_type;
171};
172
173enum omapfb_update_mode {
174 OMAPFB_UPDATE_DISABLED = 0,
175 OMAPFB_AUTO_UPDATE,
176 OMAPFB_MANUAL_UPDATE
177};
178
179struct omapfb_memory_read {
180 __u16 x;
181 __u16 y;
182 __u16 w;
183 __u16 h;
184 size_t buffer_size;
185 void __user *buffer;
186};
187
188struct omapfb_ovl_colormode {
189 __u8 overlay_idx;
190 __u8 mode_idx;
191 __u32 bits_per_pixel;
192 __u32 nonstd;
193 struct fb_bitfield red;
194 struct fb_bitfield green;
195 struct fb_bitfield blue;
196 struct fb_bitfield transp;
197};
198
199struct omapfb_vram_info {
200 __u32 total;
201 __u32 free;
202 __u32 largest_free_block;
203 __u32 reserved[5];
204};
205
206struct omapfb_tearsync_info {
207 __u8 enabled;
208 __u8 reserved1[3];
209 __u16 line;
210 __u16 reserved2;
211};
212
213struct omapfb_display_info {
214 __u16 xres;
215 __u16 yres;
216 __u32 width; /* phys width of the display in micrometers */
217 __u32 height; /* phys height of the display in micrometers */
218 __u32 reserved[5];
219};
220
221
222#endif /* _UAPI__LINUX_OMAPFB_H__ */
diff --git a/include/uapi/linux/oom.h b/include/uapi/linux/oom.h
new file mode 100644
index 00000000000..a49c4afc706
--- /dev/null
+++ b/include/uapi/linux/oom.h
@@ -0,0 +1,11 @@
1#ifndef _UAPI__INCLUDE_LINUX_OOM_H
2#define _UAPI__INCLUDE_LINUX_OOM_H
3
4/*
5 * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for
6 * pid.
7 */
8#define OOM_SCORE_ADJ_MIN (-1000)
9#define OOM_SCORE_ADJ_MAX 1000
10
11#endif /* _UAPI__INCLUDE_LINUX_OOM_H */
diff --git a/include/linux/packet_diag.h b/include/uapi/linux/packet_diag.h
index 93f5fa94a43..93f5fa94a43 100644
--- a/include/linux/packet_diag.h
+++ b/include/uapi/linux/packet_diag.h
diff --git a/include/linux/param.h b/include/uapi/linux/param.h
index 092e92f67b5..092e92f67b5 100644
--- a/include/linux/param.h
+++ b/include/uapi/linux/param.h
diff --git a/include/uapi/linux/parport.h b/include/uapi/linux/parport.h
new file mode 100644
index 00000000000..f41388f88dc
--- /dev/null
+++ b/include/uapi/linux/parport.h
@@ -0,0 +1,95 @@
1/*
2 * Any part of this program may be used in documents licensed under
3 * the GNU Free Documentation License, Version 1.1 or any later version
4 * published by the Free Software Foundation.
5 */
6
7#ifndef _UAPI_PARPORT_H_
8#define _UAPI_PARPORT_H_
9
10/* Start off with user-visible constants */
11
12/* Maximum of 16 ports per machine */
13#define PARPORT_MAX 16
14
15/* Magic numbers */
16#define PARPORT_IRQ_NONE -1
17#define PARPORT_DMA_NONE -1
18#define PARPORT_IRQ_AUTO -2
19#define PARPORT_DMA_AUTO -2
20#define PARPORT_DMA_NOFIFO -3
21#define PARPORT_DISABLE -2
22#define PARPORT_IRQ_PROBEONLY -3
23#define PARPORT_IOHI_AUTO -1
24
25#define PARPORT_CONTROL_STROBE 0x1
26#define PARPORT_CONTROL_AUTOFD 0x2
27#define PARPORT_CONTROL_INIT 0x4
28#define PARPORT_CONTROL_SELECT 0x8
29
30#define PARPORT_STATUS_ERROR 0x8
31#define PARPORT_STATUS_SELECT 0x10
32#define PARPORT_STATUS_PAPEROUT 0x20
33#define PARPORT_STATUS_ACK 0x40
34#define PARPORT_STATUS_BUSY 0x80
35
36/* Type classes for Plug-and-Play probe. */
37typedef enum {
38 PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
39 PARPORT_CLASS_PRINTER,
40 PARPORT_CLASS_MODEM,
41 PARPORT_CLASS_NET,
42 PARPORT_CLASS_HDC, /* Hard disk controller */
43 PARPORT_CLASS_PCMCIA,
44 PARPORT_CLASS_MEDIA, /* Multimedia device */
45 PARPORT_CLASS_FDC, /* Floppy disk controller */
46 PARPORT_CLASS_PORTS,
47 PARPORT_CLASS_SCANNER,
48 PARPORT_CLASS_DIGCAM,
49 PARPORT_CLASS_OTHER, /* Anything else */
50 PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
51 PARPORT_CLASS_SCSIADAPTER
52} parport_device_class;
53
54/* The "modes" entry in parport is a bit field representing the
55 capabilities of the hardware. */
56#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */
57#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */
58#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */
59#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */
60#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */
61#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */
62#define PARPORT_MODE_SAFEININT (1<<6) /* SPP registers accessible in IRQ. */
63
64/* IEEE1284 modes:
65 Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
66 'extensibility request' values. Others are special.
67 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */
68#define IEEE1284_MODE_NIBBLE 0
69#define IEEE1284_MODE_BYTE (1<<0)
70#define IEEE1284_MODE_COMPAT (1<<8)
71#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */
72#define IEEE1284_MODE_ECP (1<<4)
73#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5))
74#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */
75#define IEEE1284_MODE_EPP (1<<6)
76#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */
77#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */
78#define IEEE1284_DEVICEID (1<<2) /* This is a flag */
79#define IEEE1284_EXT_LINK (1<<14) /* This flag causes the
80 * extensibility link to
81 * be requested, using
82 * bits 0-6. */
83
84/* For the benefit of parport_read/write, you can use these with
85 * parport_negotiate to use address operations. They have no effect
86 * other than to make parport_read/write use address transfers. */
87#define IEEE1284_ADDR (1<<13) /* This is a flag */
88#define IEEE1284_DATA 0 /* So is this */
89
90/* Flags for block transfer operations. */
91#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
92#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
93
94/* The rest is for the kernel only */
95#endif /* _UAPI_PARPORT_H_ */
diff --git a/include/uapi/linux/patchkey.h b/include/uapi/linux/patchkey.h
new file mode 100644
index 00000000000..1bda0e56bc5
--- /dev/null
+++ b/include/uapi/linux/patchkey.h
@@ -0,0 +1,37 @@
1/*
2 * <linux/patchkey.h> -- definition of _PATCHKEY macro
3 *
4 * Copyright (C) 2005 Stuart Brady
5 *
6 * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
7 * clear whether removing this would break anything in userspace.
8 *
9 * Do not include this file directly. Please use <sys/soundcard.h> instead.
10 * For kernel code, use <linux/soundcard.h>
11 */
12
13#ifndef _LINUX_PATCHKEY_H_INDIRECT
14#error "patchkey.h included directly"
15#endif
16
17#ifndef _UAPI_LINUX_PATCHKEY_H
18#define _UAPI_LINUX_PATCHKEY_H
19
20/* Endian macros. */
21#ifndef __KERNEL__
22# include <endian.h>
23#endif
24
25#if !defined(__KERNEL__)
26#if defined(__BYTE_ORDER)
27# if __BYTE_ORDER == __BIG_ENDIAN
28# define _PATCHKEY(id) (0xfd00|id)
29# elif __BYTE_ORDER == __LITTLE_ENDIAN
30# define _PATCHKEY(id) ((id<<8)|0x00fd)
31# else
32# error "could not determine byte order"
33# endif
34#endif
35#endif
36
37#endif /* _UAPI_LINUX_PATCHKEY_H */
diff --git a/include/uapi/linux/pci.h b/include/uapi/linux/pci.h
new file mode 100644
index 00000000000..3c292bc0d1c
--- /dev/null
+++ b/include/uapi/linux/pci.h
@@ -0,0 +1,41 @@
1/*
2 * pci.h
3 *
4 * PCI defines and function prototypes
5 * Copyright 1994, Drew Eckhardt
6 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
7 *
8 * For more information, please consult the following manuals (look at
9 * http://www.pcisig.com/ for how to get them):
10 *
11 * PCI BIOS Specification
12 * PCI Local Bus Specification
13 * PCI to PCI Bridge Specification
14 * PCI System Design Guide
15 */
16
17#ifndef _UAPILINUX_PCI_H
18#define _UAPILINUX_PCI_H
19
20#include <linux/pci_regs.h> /* The pci register defines */
21
22/*
23 * The PCI interface treats multi-function devices as independent
24 * devices. The slot/function address of each device is encoded
25 * in a single byte as follows:
26 *
27 * 7:3 = slot
28 * 2:0 = function
29 */
30#define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
31#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
32#define PCI_FUNC(devfn) ((devfn) & 0x07)
33
34/* Ioctls for /proc/bus/pci/X/Y nodes. */
35#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
36#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */
37#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */
38#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */
39#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */
40
41#endif /* _UAPILINUX_PCI_H */
diff --git a/include/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 20ae747ddf3..20ae747ddf3 100644
--- a/include/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
new file mode 100644
index 00000000000..4f63c05d27c
--- /dev/null
+++ b/include/uapi/linux/perf_event.h
@@ -0,0 +1,615 @@
1/*
2 * Performance events:
3 *
4 * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de>
5 * Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar
6 * Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra
7 *
8 * Data type definitions, declarations, prototypes.
9 *
10 * Started by: Thomas Gleixner and Ingo Molnar
11 *
12 * For licencing details see kernel-base/COPYING
13 */
14#ifndef _UAPI_LINUX_PERF_EVENT_H
15#define _UAPI_LINUX_PERF_EVENT_H
16
17#include <linux/types.h>
18#include <linux/ioctl.h>
19#include <asm/byteorder.h>
20
21/*
22 * User-space ABI bits:
23 */
24
25/*
26 * attr.type
27 */
28enum perf_type_id {
29 PERF_TYPE_HARDWARE = 0,
30 PERF_TYPE_SOFTWARE = 1,
31 PERF_TYPE_TRACEPOINT = 2,
32 PERF_TYPE_HW_CACHE = 3,
33 PERF_TYPE_RAW = 4,
34 PERF_TYPE_BREAKPOINT = 5,
35
36 PERF_TYPE_MAX, /* non-ABI */
37};
38
39/*
40 * Generalized performance event event_id types, used by the
41 * attr.event_id parameter of the sys_perf_event_open()
42 * syscall:
43 */
44enum perf_hw_id {
45 /*
46 * Common hardware events, generalized by the kernel:
47 */
48 PERF_COUNT_HW_CPU_CYCLES = 0,
49 PERF_COUNT_HW_INSTRUCTIONS = 1,
50 PERF_COUNT_HW_CACHE_REFERENCES = 2,
51 PERF_COUNT_HW_CACHE_MISSES = 3,
52 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
53 PERF_COUNT_HW_BRANCH_MISSES = 5,
54 PERF_COUNT_HW_BUS_CYCLES = 6,
55 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
56 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
57 PERF_COUNT_HW_REF_CPU_CYCLES = 9,
58
59 PERF_COUNT_HW_MAX, /* non-ABI */
60};
61
62/*
63 * Generalized hardware cache events:
64 *
65 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
66 * { read, write, prefetch } x
67 * { accesses, misses }
68 */
69enum perf_hw_cache_id {
70 PERF_COUNT_HW_CACHE_L1D = 0,
71 PERF_COUNT_HW_CACHE_L1I = 1,
72 PERF_COUNT_HW_CACHE_LL = 2,
73 PERF_COUNT_HW_CACHE_DTLB = 3,
74 PERF_COUNT_HW_CACHE_ITLB = 4,
75 PERF_COUNT_HW_CACHE_BPU = 5,
76 PERF_COUNT_HW_CACHE_NODE = 6,
77
78 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
79};
80
81enum perf_hw_cache_op_id {
82 PERF_COUNT_HW_CACHE_OP_READ = 0,
83 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
84 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
85
86 PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */
87};
88
89enum perf_hw_cache_op_result_id {
90 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
91 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
92
93 PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */
94};
95
96/*
97 * Special "software" events provided by the kernel, even if the hardware
98 * does not support performance events. These events measure various
99 * physical and sw events of the kernel (and allow the profiling of them as
100 * well):
101 */
102enum perf_sw_ids {
103 PERF_COUNT_SW_CPU_CLOCK = 0,
104 PERF_COUNT_SW_TASK_CLOCK = 1,
105 PERF_COUNT_SW_PAGE_FAULTS = 2,
106 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
107 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
108 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
111 PERF_COUNT_SW_EMULATION_FAULTS = 8,
112
113 PERF_COUNT_SW_MAX, /* non-ABI */
114};
115
116/*
117 * Bits that can be set in attr.sample_type to request information
118 * in the overflow packets.
119 */
120enum perf_event_sample_format {
121 PERF_SAMPLE_IP = 1U << 0,
122 PERF_SAMPLE_TID = 1U << 1,
123 PERF_SAMPLE_TIME = 1U << 2,
124 PERF_SAMPLE_ADDR = 1U << 3,
125 PERF_SAMPLE_READ = 1U << 4,
126 PERF_SAMPLE_CALLCHAIN = 1U << 5,
127 PERF_SAMPLE_ID = 1U << 6,
128 PERF_SAMPLE_CPU = 1U << 7,
129 PERF_SAMPLE_PERIOD = 1U << 8,
130 PERF_SAMPLE_STREAM_ID = 1U << 9,
131 PERF_SAMPLE_RAW = 1U << 10,
132 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
133 PERF_SAMPLE_REGS_USER = 1U << 12,
134 PERF_SAMPLE_STACK_USER = 1U << 13,
135
136 PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */
137};
138
139/*
140 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
141 *
142 * If the user does not pass priv level information via branch_sample_type,
143 * the kernel uses the event's priv level. Branch and event priv levels do
144 * not have to match. Branch priv level is checked for permissions.
145 *
146 * The branch types can be combined, however BRANCH_ANY covers all types
147 * of branches and therefore it supersedes all the other types.
148 */
149enum perf_branch_sample_type {
150 PERF_SAMPLE_BRANCH_USER = 1U << 0, /* user branches */
151 PERF_SAMPLE_BRANCH_KERNEL = 1U << 1, /* kernel branches */
152 PERF_SAMPLE_BRANCH_HV = 1U << 2, /* hypervisor branches */
153
154 PERF_SAMPLE_BRANCH_ANY = 1U << 3, /* any branch types */
155 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */
156 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */
157 PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */
158
159 PERF_SAMPLE_BRANCH_MAX = 1U << 7, /* non-ABI */
160};
161
162#define PERF_SAMPLE_BRANCH_PLM_ALL \
163 (PERF_SAMPLE_BRANCH_USER|\
164 PERF_SAMPLE_BRANCH_KERNEL|\
165 PERF_SAMPLE_BRANCH_HV)
166
167/*
168 * Values to determine ABI of the registers dump.
169 */
170enum perf_sample_regs_abi {
171 PERF_SAMPLE_REGS_ABI_NONE = 0,
172 PERF_SAMPLE_REGS_ABI_32 = 1,
173 PERF_SAMPLE_REGS_ABI_64 = 2,
174};
175
176/*
177 * The format of the data returned by read() on a perf event fd,
178 * as specified by attr.read_format:
179 *
180 * struct read_format {
181 * { u64 value;
182 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
183 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
184 * { u64 id; } && PERF_FORMAT_ID
185 * } && !PERF_FORMAT_GROUP
186 *
187 * { u64 nr;
188 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
189 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
190 * { u64 value;
191 * { u64 id; } && PERF_FORMAT_ID
192 * } cntr[nr];
193 * } && PERF_FORMAT_GROUP
194 * };
195 */
196enum perf_event_read_format {
197 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
198 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
199 PERF_FORMAT_ID = 1U << 2,
200 PERF_FORMAT_GROUP = 1U << 3,
201
202 PERF_FORMAT_MAX = 1U << 4, /* non-ABI */
203};
204
205#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
206#define PERF_ATTR_SIZE_VER1 72 /* add: config2 */
207#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */
208#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
209 /* add: sample_stack_user */
210
211/*
212 * Hardware event_id to monitor via a performance monitoring event:
213 */
214struct perf_event_attr {
215
216 /*
217 * Major type: hardware/software/tracepoint/etc.
218 */
219 __u32 type;
220
221 /*
222 * Size of the attr structure, for fwd/bwd compat.
223 */
224 __u32 size;
225
226 /*
227 * Type specific configuration information.
228 */
229 __u64 config;
230
231 union {
232 __u64 sample_period;
233 __u64 sample_freq;
234 };
235
236 __u64 sample_type;
237 __u64 read_format;
238
239 __u64 disabled : 1, /* off by default */
240 inherit : 1, /* children inherit it */
241 pinned : 1, /* must always be on PMU */
242 exclusive : 1, /* only group on PMU */
243 exclude_user : 1, /* don't count user */
244 exclude_kernel : 1, /* ditto kernel */
245 exclude_hv : 1, /* ditto hypervisor */
246 exclude_idle : 1, /* don't count when idle */
247 mmap : 1, /* include mmap data */
248 comm : 1, /* include comm data */
249 freq : 1, /* use freq, not period */
250 inherit_stat : 1, /* per task counts */
251 enable_on_exec : 1, /* next exec enables */
252 task : 1, /* trace fork/exit */
253 watermark : 1, /* wakeup_watermark */
254 /*
255 * precise_ip:
256 *
257 * 0 - SAMPLE_IP can have arbitrary skid
258 * 1 - SAMPLE_IP must have constant skid
259 * 2 - SAMPLE_IP requested to have 0 skid
260 * 3 - SAMPLE_IP must have 0 skid
261 *
262 * See also PERF_RECORD_MISC_EXACT_IP
263 */
264 precise_ip : 2, /* skid constraint */
265 mmap_data : 1, /* non-exec mmap data */
266 sample_id_all : 1, /* sample_type all events */
267
268 exclude_host : 1, /* don't count in host */
269 exclude_guest : 1, /* don't count in guest */
270
271 exclude_callchain_kernel : 1, /* exclude kernel callchains */
272 exclude_callchain_user : 1, /* exclude user callchains */
273
274 __reserved_1 : 41;
275
276 union {
277 __u32 wakeup_events; /* wakeup every n events */
278 __u32 wakeup_watermark; /* bytes before wakeup */
279 };
280
281 __u32 bp_type;
282 union {
283 __u64 bp_addr;
284 __u64 config1; /* extension of config */
285 };
286 union {
287 __u64 bp_len;
288 __u64 config2; /* extension of config1 */
289 };
290 __u64 branch_sample_type; /* enum perf_branch_sample_type */
291
292 /*
293 * Defines set of user regs to dump on samples.
294 * See asm/perf_regs.h for details.
295 */
296 __u64 sample_regs_user;
297
298 /*
299 * Defines size of the user stack to dump on samples.
300 */
301 __u32 sample_stack_user;
302
303 /* Align to u64. */
304 __u32 __reserved_2;
305};
306
307#define perf_flags(attr) (*(&(attr)->read_format + 1))
308
309/*
310 * Ioctls that can be done on a perf event fd:
311 */
312#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
313#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
314#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
315#define PERF_EVENT_IOC_RESET _IO ('$', 3)
316#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
317#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
318#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
319
320enum perf_event_ioc_flags {
321 PERF_IOC_FLAG_GROUP = 1U << 0,
322};
323
324/*
325 * Structure of the page that can be mapped via mmap
326 */
327struct perf_event_mmap_page {
328 __u32 version; /* version number of this structure */
329 __u32 compat_version; /* lowest version this is compat with */
330
331 /*
332 * Bits needed to read the hw events in user-space.
333 *
334 * u32 seq, time_mult, time_shift, idx, width;
335 * u64 count, enabled, running;
336 * u64 cyc, time_offset;
337 * s64 pmc = 0;
338 *
339 * do {
340 * seq = pc->lock;
341 * barrier()
342 *
343 * enabled = pc->time_enabled;
344 * running = pc->time_running;
345 *
346 * if (pc->cap_usr_time && enabled != running) {
347 * cyc = rdtsc();
348 * time_offset = pc->time_offset;
349 * time_mult = pc->time_mult;
350 * time_shift = pc->time_shift;
351 * }
352 *
353 * idx = pc->index;
354 * count = pc->offset;
355 * if (pc->cap_usr_rdpmc && idx) {
356 * width = pc->pmc_width;
357 * pmc = rdpmc(idx - 1);
358 * }
359 *
360 * barrier();
361 * } while (pc->lock != seq);
362 *
363 * NOTE: for obvious reason this only works on self-monitoring
364 * processes.
365 */
366 __u32 lock; /* seqlock for synchronization */
367 __u32 index; /* hardware event identifier */
368 __s64 offset; /* add to hardware event value */
369 __u64 time_enabled; /* time event active */
370 __u64 time_running; /* time event on cpu */
371 union {
372 __u64 capabilities;
373 __u64 cap_usr_time : 1,
374 cap_usr_rdpmc : 1,
375 cap_____res : 62;
376 };
377
378 /*
379 * If cap_usr_rdpmc this field provides the bit-width of the value
380 * read using the rdpmc() or equivalent instruction. This can be used
381 * to sign extend the result like:
382 *
383 * pmc <<= 64 - width;
384 * pmc >>= 64 - width; // signed shift right
385 * count += pmc;
386 */
387 __u16 pmc_width;
388
389 /*
390 * If cap_usr_time the below fields can be used to compute the time
391 * delta since time_enabled (in ns) using rdtsc or similar.
392 *
393 * u64 quot, rem;
394 * u64 delta;
395 *
396 * quot = (cyc >> time_shift);
397 * rem = cyc & ((1 << time_shift) - 1);
398 * delta = time_offset + quot * time_mult +
399 * ((rem * time_mult) >> time_shift);
400 *
401 * Where time_offset,time_mult,time_shift and cyc are read in the
402 * seqcount loop described above. This delta can then be added to
403 * enabled and possible running (if idx), improving the scaling:
404 *
405 * enabled += delta;
406 * if (idx)
407 * running += delta;
408 *
409 * quot = count / running;
410 * rem = count % running;
411 * count = quot * enabled + (rem * enabled) / running;
412 */
413 __u16 time_shift;
414 __u32 time_mult;
415 __u64 time_offset;
416
417 /*
418 * Hole for extension of the self monitor capabilities
419 */
420
421 __u64 __reserved[120]; /* align to 1k */
422
423 /*
424 * Control data for the mmap() data buffer.
425 *
426 * User-space reading the @data_head value should issue an rmb(), on
427 * SMP capable platforms, after reading this value -- see
428 * perf_event_wakeup().
429 *
430 * When the mapping is PROT_WRITE the @data_tail value should be
431 * written by userspace to reflect the last read data. In this case
432 * the kernel will not over-write unread data.
433 */
434 __u64 data_head; /* head in the data section */
435 __u64 data_tail; /* user-space written tail */
436};
437
438#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
439#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
440#define PERF_RECORD_MISC_KERNEL (1 << 0)
441#define PERF_RECORD_MISC_USER (2 << 0)
442#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
443#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
444#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
445
446/*
447 * Indicates that the content of PERF_SAMPLE_IP points to
448 * the actual instruction that triggered the event. See also
449 * perf_event_attr::precise_ip.
450 */
451#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
452/*
453 * Reserve the last bit to indicate some extended misc field
454 */
455#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
456
457struct perf_event_header {
458 __u32 type;
459 __u16 misc;
460 __u16 size;
461};
462
463enum perf_event_type {
464
465 /*
466 * If perf_event_attr.sample_id_all is set then all event types will
467 * have the sample_type selected fields related to where/when
468 * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID)
469 * described in PERF_RECORD_SAMPLE below, it will be stashed just after
470 * the perf_event_header and the fields already present for the existing
471 * fields, i.e. at the end of the payload. That way a newer perf.data
472 * file will be supported by older perf tools, with these new optional
473 * fields being ignored.
474 *
475 * The MMAP events record the PROT_EXEC mappings so that we can
476 * correlate userspace IPs to code. They have the following structure:
477 *
478 * struct {
479 * struct perf_event_header header;
480 *
481 * u32 pid, tid;
482 * u64 addr;
483 * u64 len;
484 * u64 pgoff;
485 * char filename[];
486 * };
487 */
488 PERF_RECORD_MMAP = 1,
489
490 /*
491 * struct {
492 * struct perf_event_header header;
493 * u64 id;
494 * u64 lost;
495 * };
496 */
497 PERF_RECORD_LOST = 2,
498
499 /*
500 * struct {
501 * struct perf_event_header header;
502 *
503 * u32 pid, tid;
504 * char comm[];
505 * };
506 */
507 PERF_RECORD_COMM = 3,
508
509 /*
510 * struct {
511 * struct perf_event_header header;
512 * u32 pid, ppid;
513 * u32 tid, ptid;
514 * u64 time;
515 * };
516 */
517 PERF_RECORD_EXIT = 4,
518
519 /*
520 * struct {
521 * struct perf_event_header header;
522 * u64 time;
523 * u64 id;
524 * u64 stream_id;
525 * };
526 */
527 PERF_RECORD_THROTTLE = 5,
528 PERF_RECORD_UNTHROTTLE = 6,
529
530 /*
531 * struct {
532 * struct perf_event_header header;
533 * u32 pid, ppid;
534 * u32 tid, ptid;
535 * u64 time;
536 * };
537 */
538 PERF_RECORD_FORK = 7,
539
540 /*
541 * struct {
542 * struct perf_event_header header;
543 * u32 pid, tid;
544 *
545 * struct read_format values;
546 * };
547 */
548 PERF_RECORD_READ = 8,
549
550 /*
551 * struct {
552 * struct perf_event_header header;
553 *
554 * { u64 ip; } && PERF_SAMPLE_IP
555 * { u32 pid, tid; } && PERF_SAMPLE_TID
556 * { u64 time; } && PERF_SAMPLE_TIME
557 * { u64 addr; } && PERF_SAMPLE_ADDR
558 * { u64 id; } && PERF_SAMPLE_ID
559 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
560 * { u32 cpu, res; } && PERF_SAMPLE_CPU
561 * { u64 period; } && PERF_SAMPLE_PERIOD
562 *
563 * { struct read_format values; } && PERF_SAMPLE_READ
564 *
565 * { u64 nr,
566 * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN
567 *
568 * #
569 * # The RAW record below is opaque data wrt the ABI
570 * #
571 * # That is, the ABI doesn't make any promises wrt to
572 * # the stability of its content, it may vary depending
573 * # on event, hardware, kernel version and phase of
574 * # the moon.
575 * #
576 * # In other words, PERF_SAMPLE_RAW contents are not an ABI.
577 * #
578 *
579 * { u32 size;
580 * char data[size];}&& PERF_SAMPLE_RAW
581 *
582 * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK
583 *
584 * { u64 abi; # enum perf_sample_regs_abi
585 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
586 *
587 * { u64 size;
588 * char data[size];
589 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
590 * };
591 */
592 PERF_RECORD_SAMPLE = 9,
593
594 PERF_RECORD_MAX, /* non-ABI */
595};
596
597#define PERF_MAX_STACK_DEPTH 127
598
599enum perf_callchain_context {
600 PERF_CONTEXT_HV = (__u64)-32,
601 PERF_CONTEXT_KERNEL = (__u64)-128,
602 PERF_CONTEXT_USER = (__u64)-512,
603
604 PERF_CONTEXT_GUEST = (__u64)-2048,
605 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
606 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
607
608 PERF_CONTEXT_MAX = (__u64)-4095,
609};
610
611#define PERF_FLAG_FD_NO_GROUP (1U << 0)
612#define PERF_FLAG_FD_OUTPUT (1U << 1)
613#define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */
614
615#endif /* _UAPI_LINUX_PERF_EVENT_H */
diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h
new file mode 100644
index 00000000000..aa169c4339d
--- /dev/null
+++ b/include/uapi/linux/personality.h
@@ -0,0 +1,69 @@
1#ifndef _UAPI_LINUX_PERSONALITY_H
2#define _UAPI_LINUX_PERSONALITY_H
3
4
5/*
6 * Flags for bug emulation.
7 *
8 * These occupy the top three bytes.
9 */
10enum {
11 UNAME26 = 0x0020000,
12 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
13 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
14 * (signal handling)
15 */
16 MMAP_PAGE_ZERO = 0x0100000,
17 ADDR_COMPAT_LAYOUT = 0x0200000,
18 READ_IMPLIES_EXEC = 0x0400000,
19 ADDR_LIMIT_32BIT = 0x0800000,
20 SHORT_INODE = 0x1000000,
21 WHOLE_SECONDS = 0x2000000,
22 STICKY_TIMEOUTS = 0x4000000,
23 ADDR_LIMIT_3GB = 0x8000000,
24};
25
26/*
27 * Security-relevant compatibility flags that must be
28 * cleared upon setuid or setgid exec:
29 */
30#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
31 ADDR_NO_RANDOMIZE | \
32 ADDR_COMPAT_LAYOUT | \
33 MMAP_PAGE_ZERO)
34
35/*
36 * Personality types.
37 *
38 * These go in the low byte. Avoid using the top bit, it will
39 * conflict with error returns.
40 */
41enum {
42 PER_LINUX = 0x0000,
43 PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
44 PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
45 PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
46 PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
47 PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
48 WHOLE_SECONDS | SHORT_INODE,
49 PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
50 PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
51 PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
52 PER_BSD = 0x0006,
53 PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
54 PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
55 PER_LINUX32 = 0x0008,
56 PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
57 PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
58 PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
59 PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
60 PER_RISCOS = 0x000c,
61 PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
62 PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
63 PER_OSF4 = 0x000f, /* OSF/1 v4 */
64 PER_HPUX = 0x0010,
65 PER_MASK = 0x00ff,
66};
67
68
69#endif /* _UAPI_LINUX_PERSONALITY_H */
diff --git a/include/linux/pfkeyv2.h b/include/uapi/linux/pfkeyv2.h
index 0b80c806631..0b80c806631 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/uapi/linux/pfkeyv2.h
diff --git a/include/linux/pg.h b/include/uapi/linux/pg.h
index db994bb0c79..db994bb0c79 100644
--- a/include/linux/pg.h
+++ b/include/uapi/linux/pg.h
diff --git a/include/linux/phantom.h b/include/uapi/linux/phantom.h
index 94dd6645c60..94dd6645c60 100644
--- a/include/linux/phantom.h
+++ b/include/uapi/linux/phantom.h
diff --git a/include/uapi/linux/phonet.h b/include/uapi/linux/phonet.h
new file mode 100644
index 00000000000..a3e1d65b3ed
--- /dev/null
+++ b/include/uapi/linux/phonet.h
@@ -0,0 +1,185 @@
1/**
2 * file phonet.h
3 *
4 * Phonet sockets kernel interface
5 *
6 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef _UAPILINUX_PHONET_H
24#define _UAPILINUX_PHONET_H
25
26#include <linux/types.h>
27#include <linux/socket.h>
28
29/* Automatic protocol selection */
30#define PN_PROTO_TRANSPORT 0
31/* Phonet datagram socket */
32#define PN_PROTO_PHONET 1
33/* Phonet pipe */
34#define PN_PROTO_PIPE 2
35#define PHONET_NPROTO 3
36
37/* Socket options for SOL_PNPIPE level */
38#define PNPIPE_ENCAP 1
39#define PNPIPE_IFINDEX 2
40#define PNPIPE_HANDLE 3
41#define PNPIPE_INITSTATE 4
42
43#define PNADDR_ANY 0
44#define PNADDR_BROADCAST 0xFC
45#define PNPORT_RESOURCE_ROUTING 0
46
47/* Values for PNPIPE_ENCAP option */
48#define PNPIPE_ENCAP_NONE 0
49#define PNPIPE_ENCAP_IP 1
50
51/* ioctls */
52#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
53#define SIOCPNENABLEPIPE (SIOCPROTOPRIVATE + 13)
54#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
55#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
56
57/* Phonet protocol header */
58struct phonethdr {
59 __u8 pn_rdev;
60 __u8 pn_sdev;
61 __u8 pn_res;
62 __be16 pn_length;
63 __u8 pn_robj;
64 __u8 pn_sobj;
65} __attribute__((packed));
66
67/* Common Phonet payload header */
68struct phonetmsg {
69 __u8 pn_trans_id; /* transaction ID */
70 __u8 pn_msg_id; /* message type */
71 union {
72 struct {
73 __u8 pn_submsg_id; /* message subtype */
74 __u8 pn_data[5];
75 } base;
76 struct {
77 __u16 pn_e_res_id; /* extended resource ID */
78 __u8 pn_e_submsg_id; /* message subtype */
79 __u8 pn_e_data[3];
80 } ext;
81 } pn_msg_u;
82};
83#define PN_COMMON_MESSAGE 0xF0
84#define PN_COMMGR 0x10
85#define PN_PREFIX 0xE0 /* resource for extended messages */
86#define pn_submsg_id pn_msg_u.base.pn_submsg_id
87#define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
88#define pn_e_res_id pn_msg_u.ext.pn_e_res_id
89#define pn_data pn_msg_u.base.pn_data
90#define pn_e_data pn_msg_u.ext.pn_e_data
91
92/* data for unreachable errors */
93#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
94#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
95#define pn_orig_msg_id pn_data[0]
96#define pn_status pn_data[1]
97#define pn_e_orig_msg_id pn_e_data[0]
98#define pn_e_status pn_e_data[1]
99
100/* Phonet socket address structure */
101struct sockaddr_pn {
102 __kernel_sa_family_t spn_family;
103 __u8 spn_obj;
104 __u8 spn_dev;
105 __u8 spn_resource;
106 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
107} __attribute__((packed));
108
109/* Well known address */
110#define PN_DEV_PC 0x10
111
112static inline __u16 pn_object(__u8 addr, __u16 port)
113{
114 return (addr << 8) | (port & 0x3ff);
115}
116
117static inline __u8 pn_obj(__u16 handle)
118{
119 return handle & 0xff;
120}
121
122static inline __u8 pn_dev(__u16 handle)
123{
124 return handle >> 8;
125}
126
127static inline __u16 pn_port(__u16 handle)
128{
129 return handle & 0x3ff;
130}
131
132static inline __u8 pn_addr(__u16 handle)
133{
134 return (handle >> 8) & 0xfc;
135}
136
137static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
138{
139 spn->spn_dev &= 0x03;
140 spn->spn_dev |= addr & 0xfc;
141}
142
143static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
144{
145 spn->spn_dev &= 0xfc;
146 spn->spn_dev |= (port >> 8) & 0x03;
147 spn->spn_obj = port & 0xff;
148}
149
150static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
151 __u16 handle)
152{
153 spn->spn_dev = pn_dev(handle);
154 spn->spn_obj = pn_obj(handle);
155}
156
157static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
158 __u8 resource)
159{
160 spn->spn_resource = resource;
161}
162
163static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
164{
165 return spn->spn_dev & 0xfc;
166}
167
168static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
169{
170 return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj;
171}
172
173static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
174{
175 return pn_object(spn->spn_dev, spn->spn_obj);
176}
177
178static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
179{
180 return spn->spn_resource;
181}
182
183/* Phonet device ioctl requests */
184
185#endif /* _UAPILINUX_PHONET_H */
diff --git a/include/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index 082eafaf026..082eafaf026 100644
--- a/include/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
diff --git a/include/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 32aef0a439e..32aef0a439e 100644
--- a/include/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
diff --git a/include/uapi/linux/pktcdvd.h b/include/uapi/linux/pktcdvd.h
new file mode 100644
index 00000000000..2640b9d4e24
--- /dev/null
+++ b/include/uapi/linux/pktcdvd.h
@@ -0,0 +1,111 @@
1/*
2 * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
3 * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
4 *
5 * May be copied or modified under the terms of the GNU General Public
6 * License. See linux/COPYING for more information.
7 *
8 * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
9 * DVD-RW devices.
10 *
11 */
12#ifndef _UAPI__PKTCDVD_H
13#define _UAPI__PKTCDVD_H
14
15#include <linux/types.h>
16
17/*
18 * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
19 */
20#define PACKET_DEBUG 1
21
22#define MAX_WRITERS 8
23
24#define PKT_RB_POOL_SIZE 512
25
26/*
27 * How long we should hold a non-full packet before starting data gathering.
28 */
29#define PACKET_WAIT_TIME (HZ * 5 / 1000)
30
31/*
32 * use drive write caching -- we need deferred error handling to be
33 * able to successfully recover with this option (drive will return good
34 * status as soon as the cdb is validated).
35 */
36#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
37#define USE_WCACHING 1
38#else
39#define USE_WCACHING 0
40#endif
41
42/*
43 * No user-servicable parts beyond this point ->
44 */
45
46/*
47 * device types
48 */
49#define PACKET_CDR 1
50#define PACKET_CDRW 2
51#define PACKET_DVDR 3
52#define PACKET_DVDRW 4
53
54/*
55 * flags
56 */
57#define PACKET_WRITABLE 1 /* pd is writable */
58#define PACKET_NWA_VALID 2 /* next writable address valid */
59#define PACKET_LRA_VALID 3 /* last recorded address valid */
60#define PACKET_MERGE_SEGS 4 /* perform segment merging to keep */
61 /* underlying cdrom device happy */
62
63/*
64 * Disc status -- from READ_DISC_INFO
65 */
66#define PACKET_DISC_EMPTY 0
67#define PACKET_DISC_INCOMPLETE 1
68#define PACKET_DISC_COMPLETE 2
69#define PACKET_DISC_OTHER 3
70
71/*
72 * write type, and corresponding data block type
73 */
74#define PACKET_MODE1 1
75#define PACKET_MODE2 2
76#define PACKET_BLOCK_MODE1 8
77#define PACKET_BLOCK_MODE2 10
78
79/*
80 * Last session/border status
81 */
82#define PACKET_SESSION_EMPTY 0
83#define PACKET_SESSION_INCOMPLETE 1
84#define PACKET_SESSION_RESERVED 2
85#define PACKET_SESSION_COMPLETE 3
86
87#define PACKET_MCN "4a656e734178626f65323030300000"
88
89#undef PACKET_USE_LS
90
91#define PKT_CTRL_CMD_SETUP 0
92#define PKT_CTRL_CMD_TEARDOWN 1
93#define PKT_CTRL_CMD_STATUS 2
94
95struct pkt_ctrl_command {
96 __u32 command; /* in: Setup, teardown, status */
97 __u32 dev_index; /* in/out: Device index */
98 __u32 dev; /* in/out: Device nr for cdrw device */
99 __u32 pkt_dev; /* in/out: Device nr for packet device */
100 __u32 num_devices; /* out: Largest device index + 1 */
101 __u32 padding; /* Not used */
102};
103
104/*
105 * packet ioctls
106 */
107#define PACKET_IOCTL_MAGIC ('X')
108#define PACKET_CTRL_CMD _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
109
110
111#endif /* _UAPI__PKTCDVD_H */
diff --git a/include/uapi/linux/pmu.h b/include/uapi/linux/pmu.h
new file mode 100644
index 00000000000..caead364b6e
--- /dev/null
+++ b/include/uapi/linux/pmu.h
@@ -0,0 +1,139 @@
1/*
2 * Definitions for talking to the PMU. The PMU is a microcontroller
3 * which controls battery charging and system power on PowerBook 3400
4 * and 2400 models as well as the RTC and various other things.
5 *
6 * Copyright (C) 1998 Paul Mackerras.
7 */
8
9#ifndef _UAPI_LINUX_PMU_H
10#define _UAPI_LINUX_PMU_H
11
12#define PMU_DRIVER_VERSION 2
13
14/*
15 * PMU commands
16 */
17#define PMU_POWER_CTRL0 0x10 /* control power of some devices */
18#define PMU_POWER_CTRL 0x11 /* control power of some devices */
19#define PMU_ADB_CMD 0x20 /* send ADB packet */
20#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
21#define PMU_WRITE_NVRAM 0x33 /* write non-volatile RAM */
22#define PMU_READ_NVRAM 0x3b /* read non-volatile RAM */
23#define PMU_SET_RTC 0x30 /* set real-time clock */
24#define PMU_READ_RTC 0x38 /* read real-time clock */
25#define PMU_SET_VOLBUTTON 0x40 /* set volume up/down position */
26#define PMU_BACKLIGHT_BRIGHT 0x41 /* set backlight brightness */
27#define PMU_GET_VOLBUTTON 0x48 /* get volume up/down position */
28#define PMU_PCEJECT 0x4c /* eject PC-card from slot */
29#define PMU_BATTERY_STATE 0x6b /* report battery state etc. */
30#define PMU_SMART_BATTERY_STATE 0x6f /* report battery state (new way) */
31#define PMU_SET_INTR_MASK 0x70 /* set PMU interrupt mask */
32#define PMU_INT_ACK 0x78 /* read interrupt bits */
33#define PMU_SHUTDOWN 0x7e /* turn power off */
34#define PMU_CPU_SPEED 0x7d /* control CPU speed on some models */
35#define PMU_SLEEP 0x7f /* put CPU to sleep */
36#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */
37#define PMU_I2C_CMD 0x9a /* I2C operations */
38#define PMU_RESET 0xd0 /* reset CPU */
39#define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */
40#define PMU_GET_COVER 0xdc /* report cover open/closed */
41#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */
42#define PMU_GET_VERSION 0xea /* read the PMU version */
43
44/* Bits to use with the PMU_POWER_CTRL0 command */
45#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
46#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
47#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */
48
49/* Bits to use with the PMU_POWER_CTRL command */
50#define PMU_POW_ON 0x80 /* OR this to power ON the device */
51#define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
52#define PMU_POW_BACKLIGHT 0x01 /* backlight power */
53#define PMU_POW_CHARGER 0x02 /* battery charger power */
54#define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */
55#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */
56
57/* Bits in PMU interrupt and interrupt mask bytes */
58#define PMU_INT_PCEJECT 0x04 /* PC-card eject buttons */
59#define PMU_INT_SNDBRT 0x08 /* sound/brightness up/down buttons */
60#define PMU_INT_ADB 0x10 /* ADB autopoll or reply data */
61#define PMU_INT_BATTERY 0x20 /* Battery state change */
62#define PMU_INT_ENVIRONMENT 0x40 /* Environment interrupts */
63#define PMU_INT_TICK 0x80 /* 1-second tick interrupt */
64
65/* Other bits in PMU interrupt valid when PMU_INT_ADB is set */
66#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
67#define PMU_INT_WAITING_CHARGER 0x01 /* ??? */
68#define PMU_INT_AUTO_SRQ_POLL 0x02 /* ??? */
69
70/* Bits in the environement message (either obtained via PMU_GET_COVER,
71 * or via PMU_INT_ENVIRONMENT on core99 */
72#define PMU_ENV_LID_CLOSED 0x01 /* The lid is closed */
73
74/* I2C related definitions */
75#define PMU_I2C_MODE_SIMPLE 0
76#define PMU_I2C_MODE_STDSUB 1
77#define PMU_I2C_MODE_COMBINED 2
78
79#define PMU_I2C_BUS_STATUS 0
80#define PMU_I2C_BUS_SYSCLK 1
81#define PMU_I2C_BUS_POWER 2
82
83#define PMU_I2C_STATUS_OK 0
84#define PMU_I2C_STATUS_DATAREAD 1
85#define PMU_I2C_STATUS_BUSY 0xfe
86
87
88/* Kind of PMU (model) */
89enum {
90 PMU_UNKNOWN,
91 PMU_OHARE_BASED, /* 2400, 3400, 3500 (old G3 powerbook) */
92 PMU_HEATHROW_BASED, /* PowerBook G3 series */
93 PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */
94 PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
95 PMU_68K_V1, /* 68K PMU, version 1 */
96 PMU_68K_V2, /* 68K PMU, version 2 */
97};
98
99/* PMU PMU_POWER_EVENTS commands */
100enum {
101 PMU_PWR_GET_POWERUP_EVENTS = 0x00,
102 PMU_PWR_SET_POWERUP_EVENTS = 0x01,
103 PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
104 PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
105 PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
106 PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
107};
108
109/* Power events wakeup bits */
110enum {
111 PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
112 PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
113 PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
114 PMU_PWR_WAKEUP_LID_OPEN = 0x08,
115 PMU_PWR_WAKEUP_RING = 0x10,
116};
117
118/*
119 * Ioctl commands for the /dev/pmu device
120 */
121#include <linux/ioctl.h>
122
123/* no param */
124#define PMU_IOC_SLEEP _IO('B', 0)
125/* out param: u32* backlight value: 0 to 15 */
126#define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t)
127/* in param: u32 backlight value: 0 to 15 */
128#define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t)
129/* out param: u32* PMU model */
130#define PMU_IOC_GET_MODEL _IOR('B', 3, size_t)
131/* out param: u32* has_adb: 0 or 1 */
132#define PMU_IOC_HAS_ADB _IOR('B', 4, size_t)
133/* out param: u32* can_sleep: 0 or 1 */
134#define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t)
135/* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */
136#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t)
137
138
139#endif /* _UAPI_LINUX_PMU_H */
diff --git a/include/uapi/linux/poll.h b/include/uapi/linux/poll.h
new file mode 100644
index 00000000000..2001fedfb22
--- /dev/null
+++ b/include/uapi/linux/poll.h
@@ -0,0 +1 @@
#include <asm/poll.h>
diff --git a/include/linux/posix_types.h b/include/uapi/linux/posix_types.h
index 988f76e636e..988f76e636e 100644
--- a/include/linux/posix_types.h
+++ b/include/uapi/linux/posix_types.h
diff --git a/include/linux/ppdev.h b/include/uapi/linux/ppdev.h
index dc18c5d23eb..dc18c5d23eb 100644
--- a/include/linux/ppdev.h
+++ b/include/uapi/linux/ppdev.h
diff --git a/include/uapi/linux/ppp-comp.h b/include/uapi/linux/ppp-comp.h
new file mode 100644
index 00000000000..0a15bbb04e1
--- /dev/null
+++ b/include/uapi/linux/ppp-comp.h
@@ -0,0 +1,93 @@
1/*
2 * ppp-comp.h - Definitions for doing PPP packet compression.
3 *
4 * Copyright 1994-1998 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 */
10#ifndef _UAPI_NET_PPP_COMP_H
11#define _UAPI_NET_PPP_COMP_H
12
13
14/*
15 * CCP codes.
16 */
17
18#define CCP_CONFREQ 1
19#define CCP_CONFACK 2
20#define CCP_TERMREQ 5
21#define CCP_TERMACK 6
22#define CCP_RESETREQ 14
23#define CCP_RESETACK 15
24
25/*
26 * Max # bytes for a CCP option
27 */
28
29#define CCP_MAX_OPTION_LENGTH 32
30
31/*
32 * Parts of a CCP packet.
33 */
34
35#define CCP_CODE(dp) ((dp)[0])
36#define CCP_ID(dp) ((dp)[1])
37#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
38#define CCP_HDRLEN 4
39
40#define CCP_OPT_CODE(dp) ((dp)[0])
41#define CCP_OPT_LENGTH(dp) ((dp)[1])
42#define CCP_OPT_MINLEN 2
43
44/*
45 * Definitions for BSD-Compress.
46 */
47
48#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
49#define CILEN_BSD_COMPRESS 3 /* length of config. option */
50
51/* Macros for handling the 3rd byte of the BSD-Compress config option. */
52#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
53#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
54#define BSD_CURRENT_VERSION 1 /* current version number */
55#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
56
57#define BSD_MIN_BITS 9 /* smallest code size supported */
58#define BSD_MAX_BITS 15 /* largest code size supported */
59
60/*
61 * Definitions for Deflate.
62 */
63
64#define CI_DEFLATE 26 /* config option for Deflate */
65#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
66#define CILEN_DEFLATE 4 /* length of its config option */
67
68#define DEFLATE_MIN_SIZE 9
69#define DEFLATE_MAX_SIZE 15
70#define DEFLATE_METHOD_VAL 8
71#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
72#define DEFLATE_METHOD(x) ((x) & 0x0F)
73#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
74#define DEFLATE_CHK_SEQUENCE 0
75
76/*
77 * Definitions for MPPE.
78 */
79
80#define CI_MPPE 18 /* config option for MPPE */
81#define CILEN_MPPE 6 /* length of config option */
82
83/*
84 * Definitions for other, as yet unsupported, compression methods.
85 */
86
87#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
88#define CILEN_PREDICTOR_1 2 /* length of its config option */
89#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
90#define CILEN_PREDICTOR_2 2 /* length of its config option */
91
92
93#endif /* _UAPI_NET_PPP_COMP_H */
diff --git a/include/linux/ppp-ioctl.h b/include/uapi/linux/ppp-ioctl.h
index 2d9a8859550..2d9a8859550 100644
--- a/include/linux/ppp-ioctl.h
+++ b/include/uapi/linux/ppp-ioctl.h
diff --git a/include/uapi/linux/ppp_defs.h b/include/uapi/linux/ppp_defs.h
new file mode 100644
index 00000000000..283fc05dbbd
--- /dev/null
+++ b/include/uapi/linux/ppp_defs.h
@@ -0,0 +1,150 @@
1/*
2 * ppp_defs.h - PPP definitions.
3 *
4 * Copyright 1994-2000 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 */
10#include <linux/types.h>
11
12#ifndef _UAPI_PPP_DEFS_H_
13#define _UAPI_PPP_DEFS_H_
14
15/*
16 * The basic PPP frame.
17 */
18#define PPP_HDRLEN 4 /* octets for standard ppp header */
19#define PPP_FCSLEN 2 /* octets for FCS */
20#define PPP_MRU 1500 /* default MRU = max length of info field */
21
22#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
23#define PPP_CONTROL(p) (((__u8 *)(p))[1])
24#define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
25
26/*
27 * Significant octet values.
28 */
29#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
30#define PPP_UI 0x03 /* Unnumbered Information */
31#define PPP_FLAG 0x7e /* Flag Sequence */
32#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
33#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
34
35/*
36 * Protocol field values.
37 */
38#define PPP_IP 0x21 /* Internet Protocol */
39#define PPP_AT 0x29 /* AppleTalk Protocol */
40#define PPP_IPX 0x2b /* IPX protocol */
41#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
42#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
43#define PPP_MP 0x3d /* Multilink protocol */
44#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
45#define PPP_COMPFRAG 0xfb /* fragment compressed below bundle */
46#define PPP_COMP 0xfd /* compressed packet */
47#define PPP_MPLS_UC 0x0281 /* Multi Protocol Label Switching - Unicast */
48#define PPP_MPLS_MC 0x0283 /* Multi Protocol Label Switching - Multicast */
49#define PPP_IPCP 0x8021 /* IP Control Protocol */
50#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
51#define PPP_IPXCP 0x802b /* IPX Control Protocol */
52#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
53#define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */
54#define PPP_CCP 0x80fd /* Compression Control Protocol */
55#define PPP_MPLSCP 0x80fd /* MPLS Control Protocol */
56#define PPP_LCP 0xc021 /* Link Control Protocol */
57#define PPP_PAP 0xc023 /* Password Authentication Protocol */
58#define PPP_LQR 0xc025 /* Link Quality Report protocol */
59#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
60#define PPP_CBCP 0xc029 /* Callback Control Protocol */
61
62/*
63 * Values for FCS calculations.
64 */
65
66#define PPP_INITFCS 0xffff /* Initial FCS value */
67#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
68
69
70/*
71 * Extended asyncmap - allows any character to be escaped.
72 */
73
74typedef __u32 ext_accm[8];
75
76/*
77 * What to do with network protocol (NP) packets.
78 */
79enum NPmode {
80 NPMODE_PASS, /* pass the packet through */
81 NPMODE_DROP, /* silently drop the packet */
82 NPMODE_ERROR, /* return an error */
83 NPMODE_QUEUE /* save it up for later. */
84};
85
86/*
87 * Statistics for LQRP and pppstats
88 */
89struct pppstat {
90 __u32 ppp_discards; /* # frames discarded */
91
92 __u32 ppp_ibytes; /* bytes received */
93 __u32 ppp_ioctects; /* bytes received not in error */
94 __u32 ppp_ipackets; /* packets received */
95 __u32 ppp_ierrors; /* receive errors */
96 __u32 ppp_ilqrs; /* # LQR frames received */
97
98 __u32 ppp_obytes; /* raw bytes sent */
99 __u32 ppp_ooctects; /* frame bytes sent */
100 __u32 ppp_opackets; /* packets sent */
101 __u32 ppp_oerrors; /* transmit errors */
102 __u32 ppp_olqrs; /* # LQR frames sent */
103};
104
105struct vjstat {
106 __u32 vjs_packets; /* outbound packets */
107 __u32 vjs_compressed; /* outbound compressed packets */
108 __u32 vjs_searches; /* searches for connection state */
109 __u32 vjs_misses; /* times couldn't find conn. state */
110 __u32 vjs_uncompressedin; /* inbound uncompressed packets */
111 __u32 vjs_compressedin; /* inbound compressed packets */
112 __u32 vjs_errorin; /* inbound unknown type packets */
113 __u32 vjs_tossed; /* inbound packets tossed because of error */
114};
115
116struct compstat {
117 __u32 unc_bytes; /* total uncompressed bytes */
118 __u32 unc_packets; /* total uncompressed packets */
119 __u32 comp_bytes; /* compressed bytes */
120 __u32 comp_packets; /* compressed packets */
121 __u32 inc_bytes; /* incompressible bytes */
122 __u32 inc_packets; /* incompressible packets */
123
124 /* the compression ratio is defined as in_count / bytes_out */
125 __u32 in_count; /* Bytes received */
126 __u32 bytes_out; /* Bytes transmitted */
127
128 double ratio; /* not computed in kernel. */
129};
130
131struct ppp_stats {
132 struct pppstat p; /* basic PPP statistics */
133 struct vjstat vj; /* VJ header compression statistics */
134};
135
136struct ppp_comp_stats {
137 struct compstat c; /* packet compression statistics */
138 struct compstat d; /* packet decompression statistics */
139};
140
141/*
142 * The following structure records the time in seconds since
143 * the last NP packet was sent or received.
144 */
145struct ppp_idle {
146 __kernel_time_t xmit_idle; /* time since last NP packet sent */
147 __kernel_time_t recv_idle; /* time since last NP packet received */
148};
149
150#endif /* _UAPI_PPP_DEFS_H_ */
diff --git a/include/linux/pps.h b/include/uapi/linux/pps.h
index a9bb1d93451..a9bb1d93451 100644
--- a/include/linux/pps.h
+++ b/include/uapi/linux/pps.h
diff --git a/include/linux/prctl.h b/include/uapi/linux/prctl.h
index 289760f424a..289760f424a 100644
--- a/include/linux/prctl.h
+++ b/include/uapi/linux/prctl.h
diff --git a/include/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index 94e981f810a..94e981f810a 100644
--- a/include/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
new file mode 100644
index 00000000000..1ef6c056a9e
--- /dev/null
+++ b/include/uapi/linux/ptrace.h
@@ -0,0 +1,81 @@
1#ifndef _UAPI_LINUX_PTRACE_H
2#define _UAPI_LINUX_PTRACE_H
3/* ptrace.h */
4/* structs and defines to help the user use the ptrace system call. */
5
6/* has the defines to get at the registers. */
7
8
9#define PTRACE_TRACEME 0
10#define PTRACE_PEEKTEXT 1
11#define PTRACE_PEEKDATA 2
12#define PTRACE_PEEKUSR 3
13#define PTRACE_POKETEXT 4
14#define PTRACE_POKEDATA 5
15#define PTRACE_POKEUSR 6
16#define PTRACE_CONT 7
17#define PTRACE_KILL 8
18#define PTRACE_SINGLESTEP 9
19
20#define PTRACE_ATTACH 16
21#define PTRACE_DETACH 17
22
23#define PTRACE_SYSCALL 24
24
25/* 0x4200-0x4300 are reserved for architecture-independent additions. */
26#define PTRACE_SETOPTIONS 0x4200
27#define PTRACE_GETEVENTMSG 0x4201
28#define PTRACE_GETSIGINFO 0x4202
29#define PTRACE_SETSIGINFO 0x4203
30
31/*
32 * Generic ptrace interface that exports the architecture specific regsets
33 * using the corresponding NT_* types (which are also used in the core dump).
34 * Please note that the NT_PRSTATUS note type in a core dump contains a full
35 * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
36 * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
37 * other user_regset flavors, the user_regset layout and the ELF core dump note
38 * payload are exactly the same layout.
39 *
40 * This interface usage is as follows:
41 * struct iovec iov = { buf, len};
42 *
43 * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
44 *
45 * On the successful completion, iov.len will be updated by the kernel,
46 * specifying how much the kernel has written/read to/from the user's iov.buf.
47 */
48#define PTRACE_GETREGSET 0x4204
49#define PTRACE_SETREGSET 0x4205
50
51#define PTRACE_SEIZE 0x4206
52#define PTRACE_INTERRUPT 0x4207
53#define PTRACE_LISTEN 0x4208
54
55/* Wait extended result codes for the above trace options. */
56#define PTRACE_EVENT_FORK 1
57#define PTRACE_EVENT_VFORK 2
58#define PTRACE_EVENT_CLONE 3
59#define PTRACE_EVENT_EXEC 4
60#define PTRACE_EVENT_VFORK_DONE 5
61#define PTRACE_EVENT_EXIT 6
62#define PTRACE_EVENT_SECCOMP 7
63/* Extended result codes which enabled by means other than options. */
64#define PTRACE_EVENT_STOP 128
65
66/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
67#define PTRACE_O_TRACESYSGOOD 1
68#define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
69#define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
70#define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
71#define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
72#define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
73#define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
74#define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
75
76#define PTRACE_O_MASK 0x000000ff
77
78#include <asm/ptrace.h>
79
80
81#endif /* _UAPI_LINUX_PTRACE_H */
diff --git a/include/linux/qnx4_fs.h b/include/uapi/linux/qnx4_fs.h
index 8b9aee1a9ce..8b9aee1a9ce 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/uapi/linux/qnx4_fs.h
diff --git a/include/linux/qnxtypes.h b/include/uapi/linux/qnxtypes.h
index bebbe5cc4fb..bebbe5cc4fb 100644
--- a/include/linux/qnxtypes.h
+++ b/include/uapi/linux/qnxtypes.h
diff --git a/include/uapi/linux/quota.h b/include/uapi/linux/quota.h
new file mode 100644
index 00000000000..3b6cfbeb086
--- /dev/null
+++ b/include/uapi/linux/quota.h
@@ -0,0 +1,171 @@
1/*
2 * Copyright (c) 1982, 1986 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Robert Elz at The University of Melbourne.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef _UAPI_LINUX_QUOTA_
34#define _UAPI_LINUX_QUOTA_
35
36#include <linux/errno.h>
37#include <linux/types.h>
38
39#define __DQUOT_VERSION__ "dquot_6.5.2"
40
41#define MAXQUOTAS 2
42#define USRQUOTA 0 /* element used for user quotas */
43#define GRPQUOTA 1 /* element used for group quotas */
44
45/*
46 * Definitions for the default names of the quotas files.
47 */
48#define INITQFNAMES { \
49 "user", /* USRQUOTA */ \
50 "group", /* GRPQUOTA */ \
51 "undefined", \
52};
53
54/*
55 * Command definitions for the 'quotactl' system call.
56 * The commands are broken into a main command defined below
57 * and a subcommand that is used to convey the type of
58 * quota that is being manipulated (see above).
59 */
60#define SUBCMDMASK 0x00ff
61#define SUBCMDSHIFT 8
62#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
63
64#define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
65#define Q_QUOTAON 0x800002 /* turn quotas on */
66#define Q_QUOTAOFF 0x800003 /* turn quotas off */
67#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
68#define Q_GETINFO 0x800005 /* get information about quota files */
69#define Q_SETINFO 0x800006 /* set information about quota files */
70#define Q_GETQUOTA 0x800007 /* get user quota structure */
71#define Q_SETQUOTA 0x800008 /* set user quota structure */
72
73/* Quota format type IDs */
74#define QFMT_VFS_OLD 1
75#define QFMT_VFS_V0 2
76#define QFMT_OCFS2 3
77#define QFMT_VFS_V1 4
78
79/* Size of block in which space limits are passed through the quota
80 * interface */
81#define QIF_DQBLKSIZE_BITS 10
82#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS)
83
84/*
85 * Quota structure used for communication with userspace via quotactl
86 * Following flags are used to specify which fields are valid
87 */
88enum {
89 QIF_BLIMITS_B = 0,
90 QIF_SPACE_B,
91 QIF_ILIMITS_B,
92 QIF_INODES_B,
93 QIF_BTIME_B,
94 QIF_ITIME_B,
95};
96
97#define QIF_BLIMITS (1 << QIF_BLIMITS_B)
98#define QIF_SPACE (1 << QIF_SPACE_B)
99#define QIF_ILIMITS (1 << QIF_ILIMITS_B)
100#define QIF_INODES (1 << QIF_INODES_B)
101#define QIF_BTIME (1 << QIF_BTIME_B)
102#define QIF_ITIME (1 << QIF_ITIME_B)
103#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
104#define QIF_USAGE (QIF_SPACE | QIF_INODES)
105#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
106#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
107
108struct if_dqblk {
109 __u64 dqb_bhardlimit;
110 __u64 dqb_bsoftlimit;
111 __u64 dqb_curspace;
112 __u64 dqb_ihardlimit;
113 __u64 dqb_isoftlimit;
114 __u64 dqb_curinodes;
115 __u64 dqb_btime;
116 __u64 dqb_itime;
117 __u32 dqb_valid;
118};
119
120/*
121 * Structure used for setting quota information about file via quotactl
122 * Following flags are used to specify which fields are valid
123 */
124#define IIF_BGRACE 1
125#define IIF_IGRACE 2
126#define IIF_FLAGS 4
127#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
128
129struct if_dqinfo {
130 __u64 dqi_bgrace;
131 __u64 dqi_igrace;
132 __u32 dqi_flags;
133 __u32 dqi_valid;
134};
135
136/*
137 * Definitions for quota netlink interface
138 */
139#define QUOTA_NL_NOWARN 0
140#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */
141#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */
142#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */
143#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */
144#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */
145#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */
146#define QUOTA_NL_IHARDBELOW 7 /* Usage got below inode hardlimit */
147#define QUOTA_NL_ISOFTBELOW 8 /* Usage got below inode softlimit */
148#define QUOTA_NL_BHARDBELOW 9 /* Usage got below block hardlimit */
149#define QUOTA_NL_BSOFTBELOW 10 /* Usage got below block softlimit */
150
151enum {
152 QUOTA_NL_C_UNSPEC,
153 QUOTA_NL_C_WARNING,
154 __QUOTA_NL_C_MAX,
155};
156#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
157
158enum {
159 QUOTA_NL_A_UNSPEC,
160 QUOTA_NL_A_QTYPE,
161 QUOTA_NL_A_EXCESS_ID,
162 QUOTA_NL_A_WARNING,
163 QUOTA_NL_A_DEV_MAJOR,
164 QUOTA_NL_A_DEV_MINOR,
165 QUOTA_NL_A_CAUSED_ID,
166 __QUOTA_NL_A_MAX,
167};
168#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
169
170
171#endif /* _UAPI_LINUX_QUOTA_ */
diff --git a/include/linux/radeonfb.h b/include/uapi/linux/radeonfb.h
index 8c4bbdecc44..8c4bbdecc44 100644
--- a/include/linux/radeonfb.h
+++ b/include/uapi/linux/radeonfb.h
diff --git a/include/uapi/linux/random.h b/include/uapi/linux/random.h
new file mode 100644
index 00000000000..7471b5b3b8b
--- /dev/null
+++ b/include/uapi/linux/random.h
@@ -0,0 +1,50 @@
1/*
2 * include/linux/random.h
3 *
4 * Include file for the random number generator.
5 */
6
7#ifndef _UAPI_LINUX_RANDOM_H
8#define _UAPI_LINUX_RANDOM_H
9
10#include <linux/types.h>
11#include <linux/ioctl.h>
12#include <linux/irqnr.h>
13
14/* ioctl()'s for the random number generator */
15
16/* Get the entropy count. */
17#define RNDGETENTCNT _IOR( 'R', 0x00, int )
18
19/* Add to (or subtract from) the entropy count. (Superuser only.) */
20#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
21
22/* Get the contents of the entropy pool. (Superuser only.) */
23#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
24
25/*
26 * Write bytes into the entropy pool and add to the entropy count.
27 * (Superuser only.)
28 */
29#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
30
31/* Clear entropy count to 0. (Superuser only.) */
32#define RNDZAPENTCNT _IO( 'R', 0x04 )
33
34/* Clear the entropy pool and associated counters. (Superuser only.) */
35#define RNDCLEARPOOL _IO( 'R', 0x06 )
36
37struct rand_pool_info {
38 int entropy_count;
39 int buf_size;
40 __u32 buf[0];
41};
42
43struct rnd_state {
44 __u32 s1, s2, s3;
45};
46
47/* Exported functions */
48
49
50#endif /* _UAPI_LINUX_RANDOM_H */
diff --git a/include/linux/raw.h b/include/uapi/linux/raw.h
index 62d543e7060..62d543e7060 100644
--- a/include/linux/raw.h
+++ b/include/uapi/linux/raw.h
diff --git a/include/linux/rds.h b/include/uapi/linux/rds.h
index 91950950aa5..91950950aa5 100644
--- a/include/linux/rds.h
+++ b/include/uapi/linux/rds.h
diff --git a/include/uapi/linux/reboot.h b/include/uapi/linux/reboot.h
new file mode 100644
index 00000000000..09d056d4fc5
--- /dev/null
+++ b/include/uapi/linux/reboot.h
@@ -0,0 +1,39 @@
1#ifndef _UAPI_LINUX_REBOOT_H
2#define _UAPI_LINUX_REBOOT_H
3
4/*
5 * Magic values required to use _reboot() system call.
6 */
7
8#define LINUX_REBOOT_MAGIC1 0xfee1dead
9#define LINUX_REBOOT_MAGIC2 672274793
10#define LINUX_REBOOT_MAGIC2A 85072278
11#define LINUX_REBOOT_MAGIC2B 369367448
12#define LINUX_REBOOT_MAGIC2C 537993216
13
14
15/*
16 * Commands accepted by the _reboot() system call.
17 *
18 * RESTART Restart system using default command and mode.
19 * HALT Stop OS and give system control to ROM monitor, if any.
20 * CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
21 * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
22 * POWER_OFF Stop OS and remove all power from system, if possible.
23 * RESTART2 Restart system using given command string.
24 * SW_SUSPEND Suspend system using software suspend if compiled in.
25 * KEXEC Restart system using a previously loaded Linux kernel
26 */
27
28#define LINUX_REBOOT_CMD_RESTART 0x01234567
29#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
30#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
31#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
32#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
33#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
34#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
35#define LINUX_REBOOT_CMD_KEXEC 0x45584543
36
37
38
39#endif /* _UAPI_LINUX_REBOOT_H */
diff --git a/include/linux/reiserfs_fs.h b/include/uapi/linux/reiserfs_fs.h
index ea3700cd736..ea3700cd736 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/uapi/linux/reiserfs_fs.h
diff --git a/include/linux/reiserfs_xattr.h b/include/uapi/linux/reiserfs_xattr.h
index d8ce17c2459..d8ce17c2459 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/uapi/linux/reiserfs_xattr.h
diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
new file mode 100644
index 00000000000..e0ed28477f4
--- /dev/null
+++ b/include/uapi/linux/resource.h
@@ -0,0 +1,80 @@
1#ifndef _UAPI_LINUX_RESOURCE_H
2#define _UAPI_LINUX_RESOURCE_H
3
4#include <linux/time.h>
5#include <linux/types.h>
6
7/*
8 * Resource control/accounting header file for linux
9 */
10
11/*
12 * Definition of struct rusage taken from BSD 4.3 Reno
13 *
14 * We don't support all of these yet, but we might as well have them....
15 * Otherwise, each time we add new items, programs which depend on this
16 * structure will lose. This reduces the chances of that happening.
17 */
18#define RUSAGE_SELF 0
19#define RUSAGE_CHILDREN (-1)
20#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
21#define RUSAGE_THREAD 1 /* only the calling thread */
22
23struct rusage {
24 struct timeval ru_utime; /* user time used */
25 struct timeval ru_stime; /* system time used */
26 long ru_maxrss; /* maximum resident set size */
27 long ru_ixrss; /* integral shared memory size */
28 long ru_idrss; /* integral unshared data size */
29 long ru_isrss; /* integral unshared stack size */
30 long ru_minflt; /* page reclaims */
31 long ru_majflt; /* page faults */
32 long ru_nswap; /* swaps */
33 long ru_inblock; /* block input operations */
34 long ru_oublock; /* block output operations */
35 long ru_msgsnd; /* messages sent */
36 long ru_msgrcv; /* messages received */
37 long ru_nsignals; /* signals received */
38 long ru_nvcsw; /* voluntary context switches */
39 long ru_nivcsw; /* involuntary " */
40};
41
42struct rlimit {
43 unsigned long rlim_cur;
44 unsigned long rlim_max;
45};
46
47#define RLIM64_INFINITY (~0ULL)
48
49struct rlimit64 {
50 __u64 rlim_cur;
51 __u64 rlim_max;
52};
53
54#define PRIO_MIN (-20)
55#define PRIO_MAX 20
56
57#define PRIO_PROCESS 0
58#define PRIO_PGRP 1
59#define PRIO_USER 2
60
61/*
62 * Limit the stack by to some sane default: root can always
63 * increase this limit if needed.. 8MB seems reasonable.
64 */
65#define _STK_LIM (8*1024*1024)
66
67/*
68 * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
69 * and other sensitive information are never written to disk.
70 */
71#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
72
73/*
74 * Due to binary compatibility, the actual resource numbers
75 * may be different for different linux versions..
76 */
77#include <asm/resource.h>
78
79
80#endif /* _UAPI_LINUX_RESOURCE_H */
diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h
new file mode 100644
index 00000000000..2753c6cc974
--- /dev/null
+++ b/include/uapi/linux/rfkill.h
@@ -0,0 +1,107 @@
1/*
2 * Copyright (C) 2006 - 2007 Ivo van Doorn
3 * Copyright (C) 2007 Dmitry Torokhov
4 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18#ifndef _UAPI__RFKILL_H
19#define _UAPI__RFKILL_H
20
21
22#include <linux/types.h>
23
24/* define userspace visible states */
25#define RFKILL_STATE_SOFT_BLOCKED 0
26#define RFKILL_STATE_UNBLOCKED 1
27#define RFKILL_STATE_HARD_BLOCKED 2
28
29/**
30 * enum rfkill_type - type of rfkill switch.
31 *
32 * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
33 * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
34 * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
36 * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
37 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
38 * @RFKILL_TYPE_GPS: switch is on a GPS device.
39 * @RFKILL_TYPE_FM: switch is on a FM radio device.
40 * @NUM_RFKILL_TYPES: number of defined rfkill types
41 */
42enum rfkill_type {
43 RFKILL_TYPE_ALL = 0,
44 RFKILL_TYPE_WLAN,
45 RFKILL_TYPE_BLUETOOTH,
46 RFKILL_TYPE_UWB,
47 RFKILL_TYPE_WIMAX,
48 RFKILL_TYPE_WWAN,
49 RFKILL_TYPE_GPS,
50 RFKILL_TYPE_FM,
51 NUM_RFKILL_TYPES,
52};
53
54/**
55 * enum rfkill_operation - operation types
56 * @RFKILL_OP_ADD: a device was added
57 * @RFKILL_OP_DEL: a device was removed
58 * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
59 * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
60 */
61enum rfkill_operation {
62 RFKILL_OP_ADD = 0,
63 RFKILL_OP_DEL,
64 RFKILL_OP_CHANGE,
65 RFKILL_OP_CHANGE_ALL,
66};
67
68/**
69 * struct rfkill_event - events for userspace on /dev/rfkill
70 * @idx: index of dev rfkill
71 * @type: type of the rfkill struct
72 * @op: operation code
73 * @hard: hard state (0/1)
74 * @soft: soft state (0/1)
75 *
76 * Structure used for userspace communication on /dev/rfkill,
77 * used for events from the kernel and control to the kernel.
78 */
79struct rfkill_event {
80 __u32 idx;
81 __u8 type;
82 __u8 op;
83 __u8 soft, hard;
84} __attribute__((packed));
85
86/*
87 * We are planning to be backward and forward compatible with changes
88 * to the event struct, by adding new, optional, members at the end.
89 * When reading an event (whether the kernel from userspace or vice
90 * versa) we need to accept anything that's at least as large as the
91 * version 1 event size, but might be able to accept other sizes in
92 * the future.
93 *
94 * One exception is the kernel -- we already have two event sizes in
95 * that we've made the 'hard' member optional since our only option
96 * is to ignore it anyway.
97 */
98#define RFKILL_EVENT_SIZE_V1 8
99
100/* ioctl for turning off rfkill-input (if present) */
101#define RFKILL_IOC_MAGIC 'R'
102#define RFKILL_IOC_NOINPUT 1
103#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
104
105/* and that's all userspace gets */
106
107#endif /* _UAPI__RFKILL_H */
diff --git a/include/linux/romfs_fs.h b/include/uapi/linux/romfs_fs.h
index 5f57f93b284..5f57f93b284 100644
--- a/include/linux/romfs_fs.h
+++ b/include/uapi/linux/romfs_fs.h
diff --git a/include/linux/rose.h b/include/uapi/linux/rose.h
index 1fcfe95893b..1fcfe95893b 100644
--- a/include/linux/rose.h
+++ b/include/uapi/linux/rose.h
diff --git a/include/linux/route.h b/include/uapi/linux/route.h
index 6600708311c..6600708311c 100644
--- a/include/linux/route.h
+++ b/include/uapi/linux/route.h
diff --git a/include/uapi/linux/rtc.h b/include/uapi/linux/rtc.h
new file mode 100644
index 00000000000..f8c82e6f25d
--- /dev/null
+++ b/include/uapi/linux/rtc.h
@@ -0,0 +1,107 @@
1/*
2 * Generic RTC interface.
3 * This version contains the part of the user interface to the Real Time Clock
4 * service. It is used with both the legacy mc146818 and also EFI
5 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
6 * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
7 *
8 * Copyright (C) 1999 Hewlett-Packard Co.
9 * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
10 */
11#ifndef _UAPI_LINUX_RTC_H_
12#define _UAPI_LINUX_RTC_H_
13
14/*
15 * The struct used to pass data via the following ioctl. Similar to the
16 * struct tm in <time.h>, but it needs to be here so that the kernel
17 * source is self contained, allowing cross-compiles, etc. etc.
18 */
19
20struct rtc_time {
21 int tm_sec;
22 int tm_min;
23 int tm_hour;
24 int tm_mday;
25 int tm_mon;
26 int tm_year;
27 int tm_wday;
28 int tm_yday;
29 int tm_isdst;
30};
31
32/*
33 * This data structure is inspired by the EFI (v0.92) wakeup
34 * alarm API.
35 */
36struct rtc_wkalrm {
37 unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
38 unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
39 struct rtc_time time; /* time the alarm is set to */
40};
41
42/*
43 * Data structure to control PLL correction some better RTC feature
44 * pll_value is used to get or set current value of correction,
45 * the rest of the struct is used to query HW capabilities.
46 * This is modeled after the RTC used in Q40/Q60 computers but
47 * should be sufficiently flexible for other devices
48 *
49 * +ve pll_value means clock will run faster by
50 * pll_value*pll_posmult/pll_clock
51 * -ve pll_value means clock will run slower by
52 * pll_value*pll_negmult/pll_clock
53 */
54
55struct rtc_pll_info {
56 int pll_ctrl; /* placeholder for fancier control */
57 int pll_value; /* get/set correction value */
58 int pll_max; /* max +ve (faster) adjustment value */
59 int pll_min; /* max -ve (slower) adjustment value */
60 int pll_posmult; /* factor for +ve correction */
61 int pll_negmult; /* factor for -ve correction */
62 long pll_clock; /* base PLL frequency */
63};
64
65/*
66 * ioctl calls that are permitted to the /dev/rtc interface, if
67 * any of the RTC drivers are enabled.
68 */
69
70#define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */
71#define RTC_AIE_OFF _IO('p', 0x02) /* ... off */
72#define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */
73#define RTC_UIE_OFF _IO('p', 0x04) /* ... off */
74#define RTC_PIE_ON _IO('p', 0x05) /* Periodic int. enable on */
75#define RTC_PIE_OFF _IO('p', 0x06) /* ... off */
76#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */
77#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */
78
79#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) /* Set alarm time */
80#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) /* Read alarm time */
81#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) /* Read RTC time */
82#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */
83#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */
84#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */
85#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
86#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
87
88#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
89#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
90
91#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
92#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
93
94#define RTC_VL_READ _IOR('p', 0x13, int) /* Voltage low detector */
95#define RTC_VL_CLR _IO('p', 0x14) /* Clear voltage low information */
96
97/* interrupt flags */
98#define RTC_IRQF 0x80 /* Any of the following is active */
99#define RTC_PF 0x40 /* Periodic interrupt */
100#define RTC_AF 0x20 /* Alarm interrupt */
101#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
102
103
104#define RTC_MAX_FREQ 8192
105
106
107#endif /* _UAPI_LINUX_RTC_H_ */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
new file mode 100644
index 00000000000..fcd768b09f6
--- /dev/null
+++ b/include/uapi/linux/rtnetlink.h
@@ -0,0 +1,612 @@
1#ifndef _UAPI__LINUX_RTNETLINK_H
2#define _UAPI__LINUX_RTNETLINK_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6#include <linux/if_link.h>
7#include <linux/if_addr.h>
8#include <linux/neighbour.h>
9
10/* rtnetlink families. Values up to 127 are reserved for real address
11 * families, values above 128 may be used arbitrarily.
12 */
13#define RTNL_FAMILY_IPMR 128
14#define RTNL_FAMILY_IP6MR 129
15#define RTNL_FAMILY_MAX 129
16
17/****
18 * Routing/neighbour discovery messages.
19 ****/
20
21/* Types of messages */
22
23enum {
24 RTM_BASE = 16,
25#define RTM_BASE RTM_BASE
26
27 RTM_NEWLINK = 16,
28#define RTM_NEWLINK RTM_NEWLINK
29 RTM_DELLINK,
30#define RTM_DELLINK RTM_DELLINK
31 RTM_GETLINK,
32#define RTM_GETLINK RTM_GETLINK
33 RTM_SETLINK,
34#define RTM_SETLINK RTM_SETLINK
35
36 RTM_NEWADDR = 20,
37#define RTM_NEWADDR RTM_NEWADDR
38 RTM_DELADDR,
39#define RTM_DELADDR RTM_DELADDR
40 RTM_GETADDR,
41#define RTM_GETADDR RTM_GETADDR
42
43 RTM_NEWROUTE = 24,
44#define RTM_NEWROUTE RTM_NEWROUTE
45 RTM_DELROUTE,
46#define RTM_DELROUTE RTM_DELROUTE
47 RTM_GETROUTE,
48#define RTM_GETROUTE RTM_GETROUTE
49
50 RTM_NEWNEIGH = 28,
51#define RTM_NEWNEIGH RTM_NEWNEIGH
52 RTM_DELNEIGH,
53#define RTM_DELNEIGH RTM_DELNEIGH
54 RTM_GETNEIGH,
55#define RTM_GETNEIGH RTM_GETNEIGH
56
57 RTM_NEWRULE = 32,
58#define RTM_NEWRULE RTM_NEWRULE
59 RTM_DELRULE,
60#define RTM_DELRULE RTM_DELRULE
61 RTM_GETRULE,
62#define RTM_GETRULE RTM_GETRULE
63
64 RTM_NEWQDISC = 36,
65#define RTM_NEWQDISC RTM_NEWQDISC
66 RTM_DELQDISC,
67#define RTM_DELQDISC RTM_DELQDISC
68 RTM_GETQDISC,
69#define RTM_GETQDISC RTM_GETQDISC
70
71 RTM_NEWTCLASS = 40,
72#define RTM_NEWTCLASS RTM_NEWTCLASS
73 RTM_DELTCLASS,
74#define RTM_DELTCLASS RTM_DELTCLASS
75 RTM_GETTCLASS,
76#define RTM_GETTCLASS RTM_GETTCLASS
77
78 RTM_NEWTFILTER = 44,
79#define RTM_NEWTFILTER RTM_NEWTFILTER
80 RTM_DELTFILTER,
81#define RTM_DELTFILTER RTM_DELTFILTER
82 RTM_GETTFILTER,
83#define RTM_GETTFILTER RTM_GETTFILTER
84
85 RTM_NEWACTION = 48,
86#define RTM_NEWACTION RTM_NEWACTION
87 RTM_DELACTION,
88#define RTM_DELACTION RTM_DELACTION
89 RTM_GETACTION,
90#define RTM_GETACTION RTM_GETACTION
91
92 RTM_NEWPREFIX = 52,
93#define RTM_NEWPREFIX RTM_NEWPREFIX
94
95 RTM_GETMULTICAST = 58,
96#define RTM_GETMULTICAST RTM_GETMULTICAST
97
98 RTM_GETANYCAST = 62,
99#define RTM_GETANYCAST RTM_GETANYCAST
100
101 RTM_NEWNEIGHTBL = 64,
102#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
103 RTM_GETNEIGHTBL = 66,
104#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
105 RTM_SETNEIGHTBL,
106#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
107
108 RTM_NEWNDUSEROPT = 68,
109#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
110
111 RTM_NEWADDRLABEL = 72,
112#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
113 RTM_DELADDRLABEL,
114#define RTM_DELADDRLABEL RTM_DELADDRLABEL
115 RTM_GETADDRLABEL,
116#define RTM_GETADDRLABEL RTM_GETADDRLABEL
117
118 RTM_GETDCB = 78,
119#define RTM_GETDCB RTM_GETDCB
120 RTM_SETDCB,
121#define RTM_SETDCB RTM_SETDCB
122
123 __RTM_MAX,
124#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
125};
126
127#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
128#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
129#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
130
131/*
132 Generic structure for encapsulation of optional route information.
133 It is reminiscent of sockaddr, but with sa_family replaced
134 with attribute type.
135 */
136
137struct rtattr {
138 unsigned short rta_len;
139 unsigned short rta_type;
140};
141
142/* Macros to handle rtattributes */
143
144#define RTA_ALIGNTO 4
145#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
146#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
147 (rta)->rta_len >= sizeof(struct rtattr) && \
148 (rta)->rta_len <= (len))
149#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \
150 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
151#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
152#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
153#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
154#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
155
156
157
158
159/******************************************************************************
160 * Definitions used in routing table administration.
161 ****/
162
163struct rtmsg {
164 unsigned char rtm_family;
165 unsigned char rtm_dst_len;
166 unsigned char rtm_src_len;
167 unsigned char rtm_tos;
168
169 unsigned char rtm_table; /* Routing table id */
170 unsigned char rtm_protocol; /* Routing protocol; see below */
171 unsigned char rtm_scope; /* See below */
172 unsigned char rtm_type; /* See below */
173
174 unsigned rtm_flags;
175};
176
177/* rtm_type */
178
179enum {
180 RTN_UNSPEC,
181 RTN_UNICAST, /* Gateway or direct route */
182 RTN_LOCAL, /* Accept locally */
183 RTN_BROADCAST, /* Accept locally as broadcast,
184 send as broadcast */
185 RTN_ANYCAST, /* Accept locally as broadcast,
186 but send as unicast */
187 RTN_MULTICAST, /* Multicast route */
188 RTN_BLACKHOLE, /* Drop */
189 RTN_UNREACHABLE, /* Destination is unreachable */
190 RTN_PROHIBIT, /* Administratively prohibited */
191 RTN_THROW, /* Not in this table */
192 RTN_NAT, /* Translate this address */
193 RTN_XRESOLVE, /* Use external resolver */
194 __RTN_MAX
195};
196
197#define RTN_MAX (__RTN_MAX - 1)
198
199
200/* rtm_protocol */
201
202#define RTPROT_UNSPEC 0
203#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects;
204 not used by current IPv4 */
205#define RTPROT_KERNEL 2 /* Route installed by kernel */
206#define RTPROT_BOOT 3 /* Route installed during boot */
207#define RTPROT_STATIC 4 /* Route installed by administrator */
208
209/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
210 they are just passed from user and back as is.
211 It will be used by hypothetical multiple routing daemons.
212 Note that protocol values should be standardized in order to
213 avoid conflicts.
214 */
215
216#define RTPROT_GATED 8 /* Apparently, GateD */
217#define RTPROT_RA 9 /* RDISC/ND router advertisements */
218#define RTPROT_MRT 10 /* Merit MRT */
219#define RTPROT_ZEBRA 11 /* Zebra */
220#define RTPROT_BIRD 12 /* BIRD */
221#define RTPROT_DNROUTED 13 /* DECnet routing daemon */
222#define RTPROT_XORP 14 /* XORP */
223#define RTPROT_NTK 15 /* Netsukuku */
224#define RTPROT_DHCP 16 /* DHCP client */
225
226/* rtm_scope
227
228 Really it is not scope, but sort of distance to the destination.
229 NOWHERE are reserved for not existing destinations, HOST is our
230 local addresses, LINK are destinations, located on directly attached
231 link and UNIVERSE is everywhere in the Universe.
232
233 Intermediate values are also possible f.e. interior routes
234 could be assigned a value between UNIVERSE and LINK.
235*/
236
237enum rt_scope_t {
238 RT_SCOPE_UNIVERSE=0,
239/* User defined values */
240 RT_SCOPE_SITE=200,
241 RT_SCOPE_LINK=253,
242 RT_SCOPE_HOST=254,
243 RT_SCOPE_NOWHERE=255
244};
245
246/* rtm_flags */
247
248#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
249#define RTM_F_CLONED 0x200 /* This route is cloned */
250#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
251#define RTM_F_PREFIX 0x800 /* Prefix addresses */
252
253/* Reserved table identifiers */
254
255enum rt_class_t {
256 RT_TABLE_UNSPEC=0,
257/* User defined values */
258 RT_TABLE_COMPAT=252,
259 RT_TABLE_DEFAULT=253,
260 RT_TABLE_MAIN=254,
261 RT_TABLE_LOCAL=255,
262 RT_TABLE_MAX=0xFFFFFFFF
263};
264
265
266/* Routing message attributes */
267
268enum rtattr_type_t {
269 RTA_UNSPEC,
270 RTA_DST,
271 RTA_SRC,
272 RTA_IIF,
273 RTA_OIF,
274 RTA_GATEWAY,
275 RTA_PRIORITY,
276 RTA_PREFSRC,
277 RTA_METRICS,
278 RTA_MULTIPATH,
279 RTA_PROTOINFO, /* no longer used */
280 RTA_FLOW,
281 RTA_CACHEINFO,
282 RTA_SESSION, /* no longer used */
283 RTA_MP_ALGO, /* no longer used */
284 RTA_TABLE,
285 RTA_MARK,
286 __RTA_MAX
287};
288
289#define RTA_MAX (__RTA_MAX - 1)
290
291#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
292#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
293
294/* RTM_MULTIPATH --- array of struct rtnexthop.
295 *
296 * "struct rtnexthop" describes all necessary nexthop information,
297 * i.e. parameters of path to a destination via this nexthop.
298 *
299 * At the moment it is impossible to set different prefsrc, mtu, window
300 * and rtt for different paths from multipath.
301 */
302
303struct rtnexthop {
304 unsigned short rtnh_len;
305 unsigned char rtnh_flags;
306 unsigned char rtnh_hops;
307 int rtnh_ifindex;
308};
309
310/* rtnh_flags */
311
312#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
313#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
314#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
315
316/* Macros to handle hexthops */
317
318#define RTNH_ALIGNTO 4
319#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
320#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
321 ((int)(rtnh)->rtnh_len) <= (len))
322#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
323#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
324#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
325#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
326
327/* RTM_CACHEINFO */
328
329struct rta_cacheinfo {
330 __u32 rta_clntref;
331 __u32 rta_lastuse;
332 __s32 rta_expires;
333 __u32 rta_error;
334 __u32 rta_used;
335
336#define RTNETLINK_HAVE_PEERINFO 1
337 __u32 rta_id;
338 __u32 rta_ts;
339 __u32 rta_tsage;
340};
341
342/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
343
344enum {
345 RTAX_UNSPEC,
346#define RTAX_UNSPEC RTAX_UNSPEC
347 RTAX_LOCK,
348#define RTAX_LOCK RTAX_LOCK
349 RTAX_MTU,
350#define RTAX_MTU RTAX_MTU
351 RTAX_WINDOW,
352#define RTAX_WINDOW RTAX_WINDOW
353 RTAX_RTT,
354#define RTAX_RTT RTAX_RTT
355 RTAX_RTTVAR,
356#define RTAX_RTTVAR RTAX_RTTVAR
357 RTAX_SSTHRESH,
358#define RTAX_SSTHRESH RTAX_SSTHRESH
359 RTAX_CWND,
360#define RTAX_CWND RTAX_CWND
361 RTAX_ADVMSS,
362#define RTAX_ADVMSS RTAX_ADVMSS
363 RTAX_REORDERING,
364#define RTAX_REORDERING RTAX_REORDERING
365 RTAX_HOPLIMIT,
366#define RTAX_HOPLIMIT RTAX_HOPLIMIT
367 RTAX_INITCWND,
368#define RTAX_INITCWND RTAX_INITCWND
369 RTAX_FEATURES,
370#define RTAX_FEATURES RTAX_FEATURES
371 RTAX_RTO_MIN,
372#define RTAX_RTO_MIN RTAX_RTO_MIN
373 RTAX_INITRWND,
374#define RTAX_INITRWND RTAX_INITRWND
375 __RTAX_MAX
376};
377
378#define RTAX_MAX (__RTAX_MAX - 1)
379
380#define RTAX_FEATURE_ECN 0x00000001
381#define RTAX_FEATURE_SACK 0x00000002
382#define RTAX_FEATURE_TIMESTAMP 0x00000004
383#define RTAX_FEATURE_ALLFRAG 0x00000008
384
385struct rta_session {
386 __u8 proto;
387 __u8 pad1;
388 __u16 pad2;
389
390 union {
391 struct {
392 __u16 sport;
393 __u16 dport;
394 } ports;
395
396 struct {
397 __u8 type;
398 __u8 code;
399 __u16 ident;
400 } icmpt;
401
402 __u32 spi;
403 } u;
404};
405
406/****
407 * General form of address family dependent message.
408 ****/
409
410struct rtgenmsg {
411 unsigned char rtgen_family;
412};
413
414/*****************************************************************
415 * Link layer specific messages.
416 ****/
417
418/* struct ifinfomsg
419 * passes link level specific information, not dependent
420 * on network protocol.
421 */
422
423struct ifinfomsg {
424 unsigned char ifi_family;
425 unsigned char __ifi_pad;
426 unsigned short ifi_type; /* ARPHRD_* */
427 int ifi_index; /* Link index */
428 unsigned ifi_flags; /* IFF_* flags */
429 unsigned ifi_change; /* IFF_* change mask */
430};
431
432/********************************************************************
433 * prefix information
434 ****/
435
436struct prefixmsg {
437 unsigned char prefix_family;
438 unsigned char prefix_pad1;
439 unsigned short prefix_pad2;
440 int prefix_ifindex;
441 unsigned char prefix_type;
442 unsigned char prefix_len;
443 unsigned char prefix_flags;
444 unsigned char prefix_pad3;
445};
446
447enum
448{
449 PREFIX_UNSPEC,
450 PREFIX_ADDRESS,
451 PREFIX_CACHEINFO,
452 __PREFIX_MAX
453};
454
455#define PREFIX_MAX (__PREFIX_MAX - 1)
456
457struct prefix_cacheinfo {
458 __u32 preferred_time;
459 __u32 valid_time;
460};
461
462
463/*****************************************************************
464 * Traffic control messages.
465 ****/
466
467struct tcmsg {
468 unsigned char tcm_family;
469 unsigned char tcm__pad1;
470 unsigned short tcm__pad2;
471 int tcm_ifindex;
472 __u32 tcm_handle;
473 __u32 tcm_parent;
474 __u32 tcm_info;
475};
476
477enum {
478 TCA_UNSPEC,
479 TCA_KIND,
480 TCA_OPTIONS,
481 TCA_STATS,
482 TCA_XSTATS,
483 TCA_RATE,
484 TCA_FCNT,
485 TCA_STATS2,
486 TCA_STAB,
487 __TCA_MAX
488};
489
490#define TCA_MAX (__TCA_MAX - 1)
491
492#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
493#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
494
495/********************************************************************
496 * Neighbor Discovery userland options
497 ****/
498
499struct nduseroptmsg {
500 unsigned char nduseropt_family;
501 unsigned char nduseropt_pad1;
502 unsigned short nduseropt_opts_len; /* Total length of options */
503 int nduseropt_ifindex;
504 __u8 nduseropt_icmp_type;
505 __u8 nduseropt_icmp_code;
506 unsigned short nduseropt_pad2;
507 unsigned int nduseropt_pad3;
508 /* Followed by one or more ND options */
509};
510
511enum {
512 NDUSEROPT_UNSPEC,
513 NDUSEROPT_SRCADDR,
514 __NDUSEROPT_MAX
515};
516
517#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
518
519#ifndef __KERNEL__
520/* RTnetlink multicast groups - backwards compatibility for userspace */
521#define RTMGRP_LINK 1
522#define RTMGRP_NOTIFY 2
523#define RTMGRP_NEIGH 4
524#define RTMGRP_TC 8
525
526#define RTMGRP_IPV4_IFADDR 0x10
527#define RTMGRP_IPV4_MROUTE 0x20
528#define RTMGRP_IPV4_ROUTE 0x40
529#define RTMGRP_IPV4_RULE 0x80
530
531#define RTMGRP_IPV6_IFADDR 0x100
532#define RTMGRP_IPV6_MROUTE 0x200
533#define RTMGRP_IPV6_ROUTE 0x400
534#define RTMGRP_IPV6_IFINFO 0x800
535
536#define RTMGRP_DECnet_IFADDR 0x1000
537#define RTMGRP_DECnet_ROUTE 0x4000
538
539#define RTMGRP_IPV6_PREFIX 0x20000
540#endif
541
542/* RTnetlink multicast groups */
543enum rtnetlink_groups {
544 RTNLGRP_NONE,
545#define RTNLGRP_NONE RTNLGRP_NONE
546 RTNLGRP_LINK,
547#define RTNLGRP_LINK RTNLGRP_LINK
548 RTNLGRP_NOTIFY,
549#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
550 RTNLGRP_NEIGH,
551#define RTNLGRP_NEIGH RTNLGRP_NEIGH
552 RTNLGRP_TC,
553#define RTNLGRP_TC RTNLGRP_TC
554 RTNLGRP_IPV4_IFADDR,
555#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
556 RTNLGRP_IPV4_MROUTE,
557#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
558 RTNLGRP_IPV4_ROUTE,
559#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
560 RTNLGRP_IPV4_RULE,
561#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
562 RTNLGRP_IPV6_IFADDR,
563#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
564 RTNLGRP_IPV6_MROUTE,
565#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
566 RTNLGRP_IPV6_ROUTE,
567#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
568 RTNLGRP_IPV6_IFINFO,
569#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
570 RTNLGRP_DECnet_IFADDR,
571#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
572 RTNLGRP_NOP2,
573 RTNLGRP_DECnet_ROUTE,
574#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
575 RTNLGRP_DECnet_RULE,
576#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
577 RTNLGRP_NOP4,
578 RTNLGRP_IPV6_PREFIX,
579#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
580 RTNLGRP_IPV6_RULE,
581#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
582 RTNLGRP_ND_USEROPT,
583#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
584 RTNLGRP_PHONET_IFADDR,
585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
586 RTNLGRP_PHONET_ROUTE,
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB
590 __RTNLGRP_MAX
591};
592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
593
594/* TC action piece */
595struct tcamsg {
596 unsigned char tca_family;
597 unsigned char tca__pad1;
598 unsigned short tca__pad2;
599};
600#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
601#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
602#define TCA_ACT_TAB 1 /* attr type must be >=1 */
603#define TCAA_MAX 1
604
605/* New extended info filters for IFLA_EXT_MASK */
606#define RTEXT_FILTER_VF (1 << 0)
607
608/* End of information exported to user level */
609
610
611
612#endif /* _UAPI__LINUX_RTNETLINK_H */
diff --git a/include/uapi/linux/scc.h b/include/uapi/linux/scc.h
new file mode 100644
index 00000000000..72b6b815337
--- /dev/null
+++ b/include/uapi/linux/scc.h
@@ -0,0 +1,172 @@
1/* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
2
3#ifndef _UAPI_SCC_H
4#define _UAPI_SCC_H
5
6
7/* selection of hardware types */
8
9#define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */
10#define EAGLE 0x01 /* hardware type for EAGLE card */
11#define PC100 0x02 /* hardware type for PC100 card */
12#define PRIMUS 0x04 /* hardware type for PRIMUS-PC (DG9BL) card */
13#define DRSI 0x08 /* hardware type for DRSI PC*Packet card */
14#define BAYCOM 0x10 /* hardware type for BayCom (U)SCC */
15
16/* DEV ioctl() commands */
17
18enum SCC_ioctl_cmds {
19 SIOCSCCRESERVED = SIOCDEVPRIVATE,
20 SIOCSCCCFG,
21 SIOCSCCINI,
22 SIOCSCCCHANINI,
23 SIOCSCCSMEM,
24 SIOCSCCGKISS,
25 SIOCSCCSKISS,
26 SIOCSCCGSTAT,
27 SIOCSCCCAL
28};
29
30/* Device parameter control (from WAMPES) */
31
32enum L1_params {
33 PARAM_DATA,
34 PARAM_TXDELAY,
35 PARAM_PERSIST,
36 PARAM_SLOTTIME,
37 PARAM_TXTAIL,
38 PARAM_FULLDUP,
39 PARAM_SOFTDCD, /* was: PARAM_HW */
40 PARAM_MUTE, /* ??? */
41 PARAM_DTR,
42 PARAM_RTS,
43 PARAM_SPEED,
44 PARAM_ENDDELAY, /* ??? */
45 PARAM_GROUP,
46 PARAM_IDLE,
47 PARAM_MIN,
48 PARAM_MAXKEY,
49 PARAM_WAIT,
50 PARAM_MAXDEFER,
51 PARAM_TX,
52 PARAM_HWEVENT = 31,
53 PARAM_RETURN = 255 /* reset kiss mode */
54};
55
56/* fulldup parameter */
57
58enum FULLDUP_modes {
59 KISS_DUPLEX_HALF, /* normal CSMA operation */
60 KISS_DUPLEX_FULL, /* fullduplex, key down trx after transmission */
61 KISS_DUPLEX_LINK, /* fullduplex, key down trx after 'idletime' sec */
62 KISS_DUPLEX_OPTIMA /* fullduplex, let the protocol layer control the hw */
63};
64
65/* misc. parameters */
66
67#define TIMER_OFF 65535U /* to switch off timers */
68#define NO_SUCH_PARAM 65534U /* param not implemented */
69
70/* HWEVENT parameter */
71
72enum HWEVENT_opts {
73 HWEV_DCD_ON,
74 HWEV_DCD_OFF,
75 HWEV_ALL_SENT
76};
77
78/* channel grouping */
79
80#define RXGROUP 0100 /* if set, only tx when all channels clear */
81#define TXGROUP 0200 /* if set, don't transmit simultaneously */
82
83/* Tx/Rx clock sources */
84
85enum CLOCK_sources {
86 CLK_DPLL, /* normal halfduplex operation */
87 CLK_EXTERNAL, /* external clocking (G3RUH/DF9IC modems) */
88 CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */
89 /* modems without clock regeneration */
90 CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */
91 /* MODEMs without clock recovery */
92};
93
94/* Tx state */
95
96enum TX_state {
97 TXS_IDLE, /* Transmitter off, no data pending */
98 TXS_BUSY, /* waiting for permission to send / tailtime */
99 TXS_ACTIVE, /* Transmitter on, sending data */
100 TXS_NEWFRAME, /* reset CRC and send (next) frame */
101 TXS_IDLE2, /* Transmitter on, no data pending */
102 TXS_WAIT, /* Waiting for Mintime to expire */
103 TXS_TIMEOUT /* We had a transmission timeout */
104};
105
106typedef unsigned long io_port; /* type definition for an 'io port address' */
107
108/* SCC statistical information */
109
110struct scc_stat {
111 long rxints; /* Receiver interrupts */
112 long txints; /* Transmitter interrupts */
113 long exints; /* External/status interrupts */
114 long spints; /* Special receiver interrupts */
115
116 long txframes; /* Packets sent */
117 long rxframes; /* Number of Frames Actually Received */
118 long rxerrs; /* CRC Errors */
119 long txerrs; /* KISS errors */
120
121 unsigned int nospace; /* "Out of buffers" */
122 unsigned int rx_over; /* Receiver Overruns */
123 unsigned int tx_under; /* Transmitter Underruns */
124
125 unsigned int tx_state; /* Transmitter state */
126 int tx_queued; /* tx frames enqueued */
127
128 unsigned int maxqueue; /* allocated tx_buffers */
129 unsigned int bufsize; /* used buffersize */
130};
131
132struct scc_modem {
133 long speed; /* Line speed, bps */
134 char clocksrc; /* 0 = DPLL, 1 = external, 2 = divider */
135 char nrz; /* NRZ instead of NRZI */
136};
137
138struct scc_kiss_cmd {
139 int command; /* one of the KISS-Commands defined above */
140 unsigned param; /* KISS-Param */
141};
142
143struct scc_hw_config {
144 io_port data_a; /* data port channel A */
145 io_port ctrl_a; /* control port channel A */
146 io_port data_b; /* data port channel B */
147 io_port ctrl_b; /* control port channel B */
148 io_port vector_latch; /* INTACK-Latch (#) */
149 io_port special; /* special function port */
150
151 int irq; /* irq */
152 long clock; /* clock */
153 char option; /* command for function port */
154
155 char brand; /* hardware type */
156 char escc; /* use ext. features of a 8580/85180/85280 */
157};
158
159/* (#) only one INTACK latch allowed. */
160
161
162struct scc_mem_config {
163 unsigned int dummy;
164 unsigned int bufsize;
165};
166
167struct scc_calibrate {
168 unsigned int time;
169 unsigned char pattern;
170};
171
172#endif /* _UAPI_SCC_H */
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
new file mode 100644
index 00000000000..5a0f945927a
--- /dev/null
+++ b/include/uapi/linux/sched.h
@@ -0,0 +1,46 @@
1#ifndef _UAPI_LINUX_SCHED_H
2#define _UAPI_LINUX_SCHED_H
3
4/*
5 * cloning flags:
6 */
7#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
8#define CLONE_VM 0x00000100 /* set if VM shared between processes */
9#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
10#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
11#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
12#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
13#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
14#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
15#define CLONE_THREAD 0x00010000 /* Same thread group? */
16#define CLONE_NEWNS 0x00020000 /* New namespace group? */
17#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
18#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
19#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
20#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
21#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
22#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
23#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
24/* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state)
25 and is now available for re-use. */
26#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
27#define CLONE_NEWIPC 0x08000000 /* New ipcs */
28#define CLONE_NEWUSER 0x10000000 /* New user namespace */
29#define CLONE_NEWPID 0x20000000 /* New pid namespace */
30#define CLONE_NEWNET 0x40000000 /* New network namespace */
31#define CLONE_IO 0x80000000 /* Clone io context */
32
33/*
34 * Scheduling policies
35 */
36#define SCHED_NORMAL 0
37#define SCHED_FIFO 1
38#define SCHED_RR 2
39#define SCHED_BATCH 3
40/* SCHED_ISO: reserved but not implemented yet */
41#define SCHED_IDLE 5
42/* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */
43#define SCHED_RESET_ON_FORK 0x40000000
44
45
46#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
index 00000000000..7530e744762
--- /dev/null
+++ b/include/uapi/linux/screen_info.h
@@ -0,0 +1,74 @@
1#ifndef _UAPI_SCREEN_INFO_H
2#define _UAPI_SCREEN_INFO_H
3
4#include <linux/types.h>
5
6/*
7 * These are set up by the setup-routine at boot-time:
8 */
9
10struct screen_info {
11 __u8 orig_x; /* 0x00 */
12 __u8 orig_y; /* 0x01 */
13 __u16 ext_mem_k; /* 0x02 */
14 __u16 orig_video_page; /* 0x04 */
15 __u8 orig_video_mode; /* 0x06 */
16 __u8 orig_video_cols; /* 0x07 */
17 __u8 flags; /* 0x08 */
18 __u8 unused2; /* 0x09 */
19 __u16 orig_video_ega_bx;/* 0x0a */
20 __u16 unused3; /* 0x0c */
21 __u8 orig_video_lines; /* 0x0e */
22 __u8 orig_video_isVGA; /* 0x0f */
23 __u16 orig_video_points;/* 0x10 */
24
25 /* VESA graphic mode -- linear frame buffer */
26 __u16 lfb_width; /* 0x12 */
27 __u16 lfb_height; /* 0x14 */
28 __u16 lfb_depth; /* 0x16 */
29 __u32 lfb_base; /* 0x18 */
30 __u32 lfb_size; /* 0x1c */
31 __u16 cl_magic, cl_offset; /* 0x20 */
32 __u16 lfb_linelength; /* 0x24 */
33 __u8 red_size; /* 0x26 */
34 __u8 red_pos; /* 0x27 */
35 __u8 green_size; /* 0x28 */
36 __u8 green_pos; /* 0x29 */
37 __u8 blue_size; /* 0x2a */
38 __u8 blue_pos; /* 0x2b */
39 __u8 rsvd_size; /* 0x2c */
40 __u8 rsvd_pos; /* 0x2d */
41 __u16 vesapm_seg; /* 0x2e */
42 __u16 vesapm_off; /* 0x30 */
43 __u16 pages; /* 0x32 */
44 __u16 vesa_attributes; /* 0x34 */
45 __u32 capabilities; /* 0x36 */
46 __u8 _reserved[6]; /* 0x3a */
47} __attribute__((packed));
48
49#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
50#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
51#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
52#define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */
53#define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */
54#define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
55
56#define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */
57#define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */
58#define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */
59
60#define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */
61
62#define VIDEO_TYPE_SUN 0x50 /* Sun frame buffer. */
63#define VIDEO_TYPE_SUNPCI 0x51 /* Sun PCI based frame buffer. */
64
65#define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */
66
67#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
68
69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
70
71#define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0)
72
73
74#endif /* _UAPI_SCREEN_INFO_H */
diff --git a/include/uapi/linux/sdla.h b/include/uapi/linux/sdla.h
new file mode 100644
index 00000000000..95eaff9c9e4
--- /dev/null
+++ b/include/uapi/linux/sdla.h
@@ -0,0 +1,116 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Global definitions for the Frame relay interface.
7 *
8 * Version: @(#)if_ifrad.h 0.20 13 Apr 96
9 *
10 * Author: Mike McLagan <mike.mclagan@linux.org>
11 *
12 * Changes:
13 * 0.15 Mike McLagan Structure packing
14 *
15 * 0.20 Mike McLagan New flags for S508 buffer handling
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 */
22
23#ifndef _UAPISDLA_H
24#define _UAPISDLA_H
25
26/* adapter type */
27#define SDLA_TYPES
28#define SDLA_S502A 5020
29#define SDLA_S502E 5021
30#define SDLA_S503 5030
31#define SDLA_S507 5070
32#define SDLA_S508 5080
33#define SDLA_S509 5090
34#define SDLA_UNKNOWN -1
35
36/* port selection flags for the S508 */
37#define SDLA_S508_PORT_V35 0x00
38#define SDLA_S508_PORT_RS232 0x02
39
40/* Z80 CPU speeds */
41#define SDLA_CPU_3M 0x00
42#define SDLA_CPU_5M 0x01
43#define SDLA_CPU_7M 0x02
44#define SDLA_CPU_8M 0x03
45#define SDLA_CPU_10M 0x04
46#define SDLA_CPU_16M 0x05
47#define SDLA_CPU_12M 0x06
48
49/* some private IOCTLs */
50#define SDLA_IDENTIFY (FRAD_LAST_IOCTL + 1)
51#define SDLA_CPUSPEED (FRAD_LAST_IOCTL + 2)
52#define SDLA_PROTOCOL (FRAD_LAST_IOCTL + 3)
53
54#define SDLA_CLEARMEM (FRAD_LAST_IOCTL + 4)
55#define SDLA_WRITEMEM (FRAD_LAST_IOCTL + 5)
56#define SDLA_READMEM (FRAD_LAST_IOCTL + 6)
57
58struct sdla_mem {
59 int addr;
60 int len;
61 void __user *data;
62};
63
64#define SDLA_START (FRAD_LAST_IOCTL + 7)
65#define SDLA_STOP (FRAD_LAST_IOCTL + 8)
66
67/* some offsets in the Z80's memory space */
68#define SDLA_NMIADDR 0x0000
69#define SDLA_CONF_ADDR 0x0010
70#define SDLA_S502A_NMIADDR 0x0066
71#define SDLA_CODE_BASEADDR 0x0100
72#define SDLA_WINDOW_SIZE 0x2000
73#define SDLA_ADDR_MASK 0x1FFF
74
75/* largest handleable block of data */
76#define SDLA_MAX_DATA 4080
77#define SDLA_MAX_MTU 4072 /* MAX_DATA - sizeof(fradhdr) */
78#define SDLA_MAX_DLCI 24
79
80/* this should be the same as frad_conf */
81struct sdla_conf {
82 short station;
83 short config;
84 short kbaud;
85 short clocking;
86 short max_frm;
87 short T391;
88 short T392;
89 short N391;
90 short N392;
91 short N393;
92 short CIR_fwd;
93 short Bc_fwd;
94 short Be_fwd;
95 short CIR_bwd;
96 short Bc_bwd;
97 short Be_bwd;
98};
99
100/* this should be the same as dlci_conf */
101struct sdla_dlci_conf {
102 short config;
103 short CIR_fwd;
104 short Bc_fwd;
105 short Be_fwd;
106 short CIR_bwd;
107 short Bc_bwd;
108 short Be_bwd;
109 short Tc_fwd;
110 short Tc_bwd;
111 short Tf_max;
112 short Tb_max;
113};
114
115
116#endif /* _UAPISDLA_H */
diff --git a/include/uapi/linux/seccomp.h b/include/uapi/linux/seccomp.h
new file mode 100644
index 00000000000..ac2dc9f7297
--- /dev/null
+++ b/include/uapi/linux/seccomp.h
@@ -0,0 +1,47 @@
1#ifndef _UAPI_LINUX_SECCOMP_H
2#define _UAPI_LINUX_SECCOMP_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6
7
8/* Valid values for seccomp.mode and prctl(PR_SET_SECCOMP, <mode>) */
9#define SECCOMP_MODE_DISABLED 0 /* seccomp is not in use. */
10#define SECCOMP_MODE_STRICT 1 /* uses hard-coded filter. */
11#define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */
12
13/*
14 * All BPF programs must return a 32-bit value.
15 * The bottom 16-bits are for optional return data.
16 * The upper 16-bits are ordered from least permissive values to most.
17 *
18 * The ordering ensures that a min_t() over composed return values always
19 * selects the least permissive choice.
20 */
21#define SECCOMP_RET_KILL 0x00000000U /* kill the task immediately */
22#define SECCOMP_RET_TRAP 0x00030000U /* disallow and force a SIGSYS */
23#define SECCOMP_RET_ERRNO 0x00050000U /* returns an errno */
24#define SECCOMP_RET_TRACE 0x7ff00000U /* pass to a tracer or disallow */
25#define SECCOMP_RET_ALLOW 0x7fff0000U /* allow */
26
27/* Masks for the return value sections. */
28#define SECCOMP_RET_ACTION 0x7fff0000U
29#define SECCOMP_RET_DATA 0x0000ffffU
30
31/**
32 * struct seccomp_data - the format the BPF program executes over.
33 * @nr: the system call number
34 * @arch: indicates system call convention as an AUDIT_ARCH_* value
35 * as defined in <linux/audit.h>.
36 * @instruction_pointer: at the time of the system call.
37 * @args: up to 6 system call arguments always stored as 64-bit values
38 * regardless of the architecture.
39 */
40struct seccomp_data {
41 int nr;
42 __u32 arch;
43 __u64 instruction_pointer;
44 __u64 args[6];
45};
46
47#endif /* _UAPI_LINUX_SECCOMP_H */
diff --git a/include/uapi/linux/securebits.h b/include/uapi/linux/securebits.h
new file mode 100644
index 00000000000..985aac9e6bf
--- /dev/null
+++ b/include/uapi/linux/securebits.h
@@ -0,0 +1,51 @@
1#ifndef _UAPI_LINUX_SECUREBITS_H
2#define _UAPI_LINUX_SECUREBITS_H
3
4/* Each securesetting is implemented using two bits. One bit specifies
5 whether the setting is on or off. The other bit specify whether the
6 setting is locked or not. A setting which is locked cannot be
7 changed from user-level. */
8#define issecure_mask(X) (1 << (X))
9
10#define SECUREBITS_DEFAULT 0x00000000
11
12/* When set UID 0 has no special privileges. When unset, we support
13 inheritance of root-permissions and suid-root executable under
14 compatibility mode. We raise the effective and inheritable bitmasks
15 *of the executable file* if the effective uid of the new process is
16 0. If the real uid is 0, we raise the effective (legacy) bit of the
17 executable file. */
18#define SECURE_NOROOT 0
19#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */
20
21#define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT))
22#define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED))
23
24/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
25 When unset, to provide compatiblility with old programs relying on
26 set*uid to gain/lose privilege, transitions to/from uid 0 cause
27 capabilities to be gained/lost. */
28#define SECURE_NO_SETUID_FIXUP 2
29#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */
30
31#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
32#define SECBIT_NO_SETUID_FIXUP_LOCKED \
33 (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
34
35/* When set, a process can retain its capabilities even after
36 transitioning to a non-root user (the set-uid fixup suppressed by
37 bit 2). Bit-4 is cleared when a process calls exec(); setting both
38 bit 4 and 5 will create a barrier through exec that no exec()'d
39 child can use this feature again. */
40#define SECURE_KEEP_CAPS 4
41#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */
42
43#define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS))
44#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
45
46#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \
47 issecure_mask(SECURE_NO_SETUID_FIXUP) | \
48 issecure_mask(SECURE_KEEP_CAPS))
49#define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1)
50
51#endif /* _UAPI_LINUX_SECUREBITS_H */
diff --git a/include/linux/selinux_netlink.h b/include/uapi/linux/selinux_netlink.h
index d239797785c..d239797785c 100644
--- a/include/linux/selinux_netlink.h
+++ b/include/uapi/linux/selinux_netlink.h
diff --git a/include/uapi/linux/sem.h b/include/uapi/linux/sem.h
new file mode 100644
index 00000000000..541fce03b50
--- /dev/null
+++ b/include/uapi/linux/sem.h
@@ -0,0 +1,80 @@
1#ifndef _UAPI_LINUX_SEM_H
2#define _UAPI_LINUX_SEM_H
3
4#include <linux/ipc.h>
5
6/* semop flags */
7#define SEM_UNDO 0x1000 /* undo the operation on exit */
8
9/* semctl Command Definitions. */
10#define GETPID 11 /* get sempid */
11#define GETVAL 12 /* get semval */
12#define GETALL 13 /* get all semval's */
13#define GETNCNT 14 /* get semncnt */
14#define GETZCNT 15 /* get semzcnt */
15#define SETVAL 16 /* set semval */
16#define SETALL 17 /* set all semval's */
17
18/* ipcs ctl cmds */
19#define SEM_STAT 18
20#define SEM_INFO 19
21
22/* Obsolete, used only for backwards compatibility and libc5 compiles */
23struct semid_ds {
24 struct ipc_perm sem_perm; /* permissions .. see ipc.h */
25 __kernel_time_t sem_otime; /* last semop time */
26 __kernel_time_t sem_ctime; /* last change time */
27 struct sem *sem_base; /* ptr to first semaphore in array */
28 struct sem_queue *sem_pending; /* pending operations to be processed */
29 struct sem_queue **sem_pending_last; /* last pending operation */
30 struct sem_undo *undo; /* undo requests on this array */
31 unsigned short sem_nsems; /* no. of semaphores in array */
32};
33
34/* Include the definition of semid64_ds */
35#include <asm/sembuf.h>
36
37/* semop system calls takes an array of these. */
38struct sembuf {
39 unsigned short sem_num; /* semaphore index in array */
40 short sem_op; /* semaphore operation */
41 short sem_flg; /* operation flags */
42};
43
44/* arg for semctl system calls. */
45union semun {
46 int val; /* value for SETVAL */
47 struct semid_ds __user *buf; /* buffer for IPC_STAT & IPC_SET */
48 unsigned short __user *array; /* array for GETALL & SETALL */
49 struct seminfo __user *__buf; /* buffer for IPC_INFO */
50 void __user *__pad;
51};
52
53struct seminfo {
54 int semmap;
55 int semmni;
56 int semmns;
57 int semmnu;
58 int semmsl;
59 int semopm;
60 int semume;
61 int semusz;
62 int semvmx;
63 int semaem;
64};
65
66#define SEMMNI 128 /* <= IPCMNI max # of semaphore identifiers */
67#define SEMMSL 250 /* <= 8 000 max num of semaphores per id */
68#define SEMMNS (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
69#define SEMOPM 32 /* <= 1 000 max num of ops per semop call */
70#define SEMVMX 32767 /* <= 32767 semaphore maximum value */
71#define SEMAEM SEMVMX /* adjust on exit max value */
72
73/* unused */
74#define SEMUME SEMOPM /* max num of undo entries per process */
75#define SEMMNU SEMMNS /* num of undo structures system wide */
76#define SEMMAP SEMMNS /* # of entries in semaphore map */
77#define SEMUSZ 20 /* sizeof struct sem_undo */
78
79
80#endif /* _UAPI_LINUX_SEM_H */
diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h
new file mode 100644
index 00000000000..5e0d0ed61cf
--- /dev/null
+++ b/include/uapi/linux/serial.h
@@ -0,0 +1,126 @@
1/*
2 * include/linux/serial.h
3 *
4 * Copyright (C) 1992 by Theodore Ts'o.
5 *
6 * Redistribution of this file is permitted under the terms of the GNU
7 * Public License (GPL)
8 */
9
10#ifndef _UAPI_LINUX_SERIAL_H
11#define _UAPI_LINUX_SERIAL_H
12
13#include <linux/types.h>
14
15#include <linux/tty_flags.h>
16
17
18struct serial_struct {
19 int type;
20 int line;
21 unsigned int port;
22 int irq;
23 int flags;
24 int xmit_fifo_size;
25 int custom_divisor;
26 int baud_base;
27 unsigned short close_delay;
28 char io_type;
29 char reserved_char[1];
30 int hub6;
31 unsigned short closing_wait; /* time to wait before closing */
32 unsigned short closing_wait2; /* no longer used... */
33 unsigned char *iomem_base;
34 unsigned short iomem_reg_shift;
35 unsigned int port_high;
36 unsigned long iomap_base; /* cookie passed into ioremap */
37};
38
39/*
40 * For the close wait times, 0 means wait forever for serial port to
41 * flush its output. 65535 means don't wait at all.
42 */
43#define ASYNC_CLOSING_WAIT_INF 0
44#define ASYNC_CLOSING_WAIT_NONE 65535
45
46/*
47 * These are the supported serial types.
48 */
49#define PORT_UNKNOWN 0
50#define PORT_8250 1
51#define PORT_16450 2
52#define PORT_16550 3
53#define PORT_16550A 4
54#define PORT_CIRRUS 5 /* usurped by cyclades.c */
55#define PORT_16650 6
56#define PORT_16650V2 7
57#define PORT_16750 8
58#define PORT_STARTECH 9 /* usurped by cyclades.c */
59#define PORT_16C950 10 /* Oxford Semiconductor */
60#define PORT_16654 11
61#define PORT_16850 12
62#define PORT_RSA 13 /* RSA-DV II/S card */
63#define PORT_MAX 13
64
65#define SERIAL_IO_PORT 0
66#define SERIAL_IO_HUB6 1
67#define SERIAL_IO_MEM 2
68
69#define UART_CLEAR_FIFO 0x01
70#define UART_USE_FIFO 0x02
71#define UART_STARTECH 0x04
72#define UART_NATSEMI 0x08
73
74
75/*
76 * Multiport serial configuration structure --- external structure
77 */
78struct serial_multiport_struct {
79 int irq;
80 int port1;
81 unsigned char mask1, match1;
82 int port2;
83 unsigned char mask2, match2;
84 int port3;
85 unsigned char mask3, match3;
86 int port4;
87 unsigned char mask4, match4;
88 int port_monitor;
89 int reserved[32];
90};
91
92/*
93 * Serial input interrupt line counters -- external structure
94 * Four lines can interrupt: CTS, DSR, RI, DCD
95 */
96struct serial_icounter_struct {
97 int cts, dsr, rng, dcd;
98 int rx, tx;
99 int frame, overrun, parity, brk;
100 int buf_overrun;
101 int reserved[9];
102};
103
104/*
105 * Serial interface for controlling RS485 settings on chips with suitable
106 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
107 * platform. The set function returns the new state, with any unsupported bits
108 * reverted appropriately.
109 */
110
111struct serial_rs485 {
112 __u32 flags; /* RS485 feature flags */
113#define SER_RS485_ENABLED (1 << 0) /* If enabled */
114#define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for
115 RTS pin when
116 sending */
117#define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for
118 RTS pin after sent*/
119#define SER_RS485_RX_DURING_TX (1 << 4)
120 __u32 delay_rts_before_send; /* Delay before send (milliseconds) */
121 __u32 delay_rts_after_send; /* Delay after send (milliseconds) */
122 __u32 padding[5]; /* Memory is cheap, new structs
123 are a royal PITA .. */
124};
125
126#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
index 00000000000..7e1ab20adc0
--- /dev/null
+++ b/include/uapi/linux/serial_core.h
@@ -0,0 +1,219 @@
1/*
2 * linux/drivers/char/serial_core.h
3 *
4 * Copyright (C) 2000 Deep Blue Solutions Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef _UAPILINUX_SERIAL_CORE_H
21#define _UAPILINUX_SERIAL_CORE_H
22
23#include <linux/serial.h>
24
25/*
26 * The type definitions. These are from Ted Ts'o's serial.h
27 */
28#define PORT_UNKNOWN 0
29#define PORT_8250 1
30#define PORT_16450 2
31#define PORT_16550 3
32#define PORT_16550A 4
33#define PORT_CIRRUS 5
34#define PORT_16650 6
35#define PORT_16650V2 7
36#define PORT_16750 8
37#define PORT_STARTECH 9
38#define PORT_16C950 10
39#define PORT_16654 11
40#define PORT_16850 12
41#define PORT_RSA 13
42#define PORT_NS16550A 14
43#define PORT_XSCALE 15
44#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
45#define PORT_OCTEON 17 /* Cavium OCTEON internal UART */
46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
51#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
52#define PORT_MAX_8250 23 /* max port ID */
53
54/*
55 * ARM specific type numbers. These are not currently guaranteed
56 * to be implemented, and will change in the future. These are
57 * separate so any additions to the old serial.c that occur before
58 * we are merged can be easily merged here.
59 */
60#define PORT_PXA 31
61#define PORT_AMBA 32
62#define PORT_CLPS711X 33
63#define PORT_SA1100 34
64#define PORT_UART00 35
65#define PORT_21285 37
66
67/* Sparc type numbers. */
68#define PORT_SUNZILOG 38
69#define PORT_SUNSAB 39
70
71/* DEC */
72#define PORT_DZ 46
73#define PORT_ZS 47
74
75/* Parisc type numbers. */
76#define PORT_MUX 48
77
78/* Atmel AT91 / AT32 SoC */
79#define PORT_ATMEL 49
80
81/* Macintosh Zilog type numbers */
82#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
83#define PORT_PMAC_ZILOG 51
84
85/* SH-SCI */
86#define PORT_SCI 52
87#define PORT_SCIF 53
88#define PORT_IRDA 54
89
90/* Samsung S3C2410 SoC and derivatives thereof */
91#define PORT_S3C2410 55
92
93/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
94#define PORT_IP22ZILOG 56
95
96/* Sharp LH7a40x -- an ARM9 SoC series */
97#define PORT_LH7A40X 57
98
99/* PPC CPM type number */
100#define PORT_CPM 58
101
102/* MPC52xx (and MPC512x) type numbers */
103#define PORT_MPC52xx 59
104
105/* IBM icom */
106#define PORT_ICOM 60
107
108/* Samsung S3C2440 SoC */
109#define PORT_S3C2440 61
110
111/* Motorola i.MX SoC */
112#define PORT_IMX 62
113
114/* Marvell MPSC */
115#define PORT_MPSC 63
116
117/* TXX9 type number */
118#define PORT_TXX9 64
119
120/* NEC VR4100 series SIU/DSIU */
121#define PORT_VR41XX_SIU 65
122#define PORT_VR41XX_DSIU 66
123
124/* Samsung S3C2400 SoC */
125#define PORT_S3C2400 67
126
127/* M32R SIO */
128#define PORT_M32R_SIO 68
129
130/*Digi jsm */
131#define PORT_JSM 69
132
133#define PORT_PNX8XXX 70
134
135/* Hilscher netx */
136#define PORT_NETX 71
137
138/* SUN4V Hypervisor Console */
139#define PORT_SUNHV 72
140
141#define PORT_S3C2412 73
142
143/* Xilinx uartlite */
144#define PORT_UARTLITE 74
145
146/* Blackfin bf5xx */
147#define PORT_BFIN 75
148
149/* Micrel KS8695 */
150#define PORT_KS8695 76
151
152/* Broadcom SB1250, etc. SOC */
153#define PORT_SB1250_DUART 77
154
155/* Freescale ColdFire */
156#define PORT_MCF 78
157
158/* Blackfin SPORT */
159#define PORT_BFIN_SPORT 79
160
161/* MN10300 on-chip UART numbers */
162#define PORT_MN10300 80
163#define PORT_MN10300_CTS 81
164
165#define PORT_SC26XX 82
166
167/* SH-SCI */
168#define PORT_SCIFA 83
169
170#define PORT_S3C6400 84
171
172/* NWPSERIAL */
173#define PORT_NWPSERIAL 85
174
175/* MAX3100 */
176#define PORT_MAX3100 86
177
178/* Timberdale UART */
179#define PORT_TIMBUART 87
180
181/* Qualcomm MSM SoCs */
182#define PORT_MSM 88
183
184/* BCM63xx family SoCs */
185#define PORT_BCM63XX 89
186
187/* Aeroflex Gaisler GRLIB APBUART */
188#define PORT_APBUART 90
189
190/* Altera UARTs */
191#define PORT_ALTERA_JTAGUART 91
192#define PORT_ALTERA_UART 92
193
194/* SH-SCI */
195#define PORT_SCIFB 93
196
197/* MAX310X */
198#define PORT_MAX310X 94
199
200/* High Speed UART for Medfield */
201#define PORT_MFD 95
202
203/* TI OMAP-UART */
204#define PORT_OMAP 96
205
206/* VIA VT8500 SoC */
207#define PORT_VT8500 97
208
209/* Xilinx PSS UART */
210#define PORT_XUARTPS 98
211
212/* Atheros AR933X SoC */
213#define PORT_AR933X 99
214
215/* Energy Micro efm32 SoC */
216#define PORT_EFMUART 100
217
218
219#endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/include/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index 5ed325e88a8..5ed325e88a8 100644
--- a/include/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
diff --git a/include/uapi/linux/serio.h b/include/uapi/linux/serio.h
new file mode 100644
index 00000000000..9f53fa7fc13
--- /dev/null
+++ b/include/uapi/linux/serio.h
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 1999-2002 Vojtech Pavlik
3*
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published by
6 * the Free Software Foundation.
7 */
8#ifndef _UAPI_SERIO_H
9#define _UAPI_SERIO_H
10
11
12#include <linux/ioctl.h>
13
14#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
15
16
17/*
18 * bit masks for use in "interrupt" flags (3rd argument)
19 */
20#define SERIO_TIMEOUT 1
21#define SERIO_PARITY 2
22#define SERIO_FRAME 4
23
24/*
25 * Serio types
26 */
27#define SERIO_XT 0x00
28#define SERIO_8042 0x01
29#define SERIO_RS232 0x02
30#define SERIO_HIL_MLC 0x03
31#define SERIO_PS_PSTHRU 0x05
32#define SERIO_8042_XL 0x06
33
34/*
35 * Serio protocols
36 */
37#define SERIO_UNKNOWN 0x00
38#define SERIO_MSC 0x01
39#define SERIO_SUN 0x02
40#define SERIO_MS 0x03
41#define SERIO_MP 0x04
42#define SERIO_MZ 0x05
43#define SERIO_MZP 0x06
44#define SERIO_MZPP 0x07
45#define SERIO_VSXXXAA 0x08
46#define SERIO_SUNKBD 0x10
47#define SERIO_WARRIOR 0x18
48#define SERIO_SPACEORB 0x19
49#define SERIO_MAGELLAN 0x1a
50#define SERIO_SPACEBALL 0x1b
51#define SERIO_GUNZE 0x1c
52#define SERIO_IFORCE 0x1d
53#define SERIO_STINGER 0x1e
54#define SERIO_NEWTON 0x1f
55#define SERIO_STOWAWAY 0x20
56#define SERIO_H3600 0x21
57#define SERIO_PS2SER 0x22
58#define SERIO_TWIDKBD 0x23
59#define SERIO_TWIDJOY 0x24
60#define SERIO_HIL 0x25
61#define SERIO_SNES232 0x26
62#define SERIO_SEMTECH 0x27
63#define SERIO_LKKBD 0x28
64#define SERIO_ELO 0x29
65#define SERIO_MICROTOUCH 0x30
66#define SERIO_PENMOUNT 0x31
67#define SERIO_TOUCHRIGHT 0x32
68#define SERIO_TOUCHWIN 0x33
69#define SERIO_TAOSEVM 0x34
70#define SERIO_FUJITSU 0x35
71#define SERIO_ZHENHUA 0x36
72#define SERIO_INEXIO 0x37
73#define SERIO_TOUCHIT213 0x38
74#define SERIO_W8001 0x39
75#define SERIO_DYNAPRO 0x3a
76#define SERIO_HAMPSHIRE 0x3b
77#define SERIO_PS2MULT 0x3c
78#define SERIO_TSC40 0x3d
79
80#endif /* _UAPI_SERIO_H */
diff --git a/include/uapi/linux/shm.h b/include/uapi/linux/shm.h
new file mode 100644
index 00000000000..ec36fa1a83a
--- /dev/null
+++ b/include/uapi/linux/shm.h
@@ -0,0 +1,79 @@
1#ifndef _UAPI_LINUX_SHM_H_
2#define _UAPI_LINUX_SHM_H_
3
4#include <linux/ipc.h>
5#include <linux/errno.h>
6#ifndef __KERNEL__
7#include <unistd.h>
8#endif
9
10/*
11 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
12 * be increased by sysctl
13 */
14
15#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
16#define SHMMIN 1 /* min shared seg size (bytes) */
17#define SHMMNI 4096 /* max num of segs system wide */
18#ifndef __KERNEL__
19#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
20#endif
21#define SHMSEG SHMMNI /* max shared segs per process */
22
23
24/* Obsolete, used only for backwards compatibility and libc5 compiles */
25struct shmid_ds {
26 struct ipc_perm shm_perm; /* operation perms */
27 int shm_segsz; /* size of segment (bytes) */
28 __kernel_time_t shm_atime; /* last attach time */
29 __kernel_time_t shm_dtime; /* last detach time */
30 __kernel_time_t shm_ctime; /* last change time */
31 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
32 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
33 unsigned short shm_nattch; /* no. of current attaches */
34 unsigned short shm_unused; /* compatibility */
35 void *shm_unused2; /* ditto - used by DIPC */
36 void *shm_unused3; /* unused */
37};
38
39/* Include the definition of shmid64_ds and shminfo64 */
40#include <asm/shmbuf.h>
41
42/* permission flag for shmget */
43#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
44#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
45
46/* mode for attach */
47#define SHM_RDONLY 010000 /* read-only access */
48#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
49#define SHM_REMAP 040000 /* take-over region on attach */
50#define SHM_EXEC 0100000 /* execution access */
51
52/* super user shmctl commands */
53#define SHM_LOCK 11
54#define SHM_UNLOCK 12
55
56/* ipcs ctl commands */
57#define SHM_STAT 13
58#define SHM_INFO 14
59
60/* Obsolete, used only for backwards compatibility */
61struct shminfo {
62 int shmmax;
63 int shmmin;
64 int shmmni;
65 int shmseg;
66 int shmall;
67};
68
69struct shm_info {
70 int used_ids;
71 unsigned long shm_tot; /* total allocated shm */
72 unsigned long shm_rss; /* total resident shm */
73 unsigned long shm_swp; /* total swapped shm */
74 unsigned long swap_attempts;
75 unsigned long swap_successes;
76};
77
78
79#endif /* _UAPI_LINUX_SHM_H_ */
diff --git a/include/uapi/linux/signal.h b/include/uapi/linux/signal.h
new file mode 100644
index 00000000000..dff452ed6d0
--- /dev/null
+++ b/include/uapi/linux/signal.h
@@ -0,0 +1,8 @@
1#ifndef _UAPI_LINUX_SIGNAL_H
2#define _UAPI_LINUX_SIGNAL_H
3
4#include <asm/signal.h>
5#include <asm/siginfo.h>
6
7
8#endif /* _UAPI_LINUX_SIGNAL_H */
diff --git a/include/uapi/linux/signalfd.h b/include/uapi/linux/signalfd.h
new file mode 100644
index 00000000000..492c6def340
--- /dev/null
+++ b/include/uapi/linux/signalfd.h
@@ -0,0 +1,52 @@
1/*
2 * include/linux/signalfd.h
3 *
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
5 *
6 */
7
8#ifndef _UAPI_LINUX_SIGNALFD_H
9#define _UAPI_LINUX_SIGNALFD_H
10
11#include <linux/types.h>
12/* For O_CLOEXEC and O_NONBLOCK */
13#include <linux/fcntl.h>
14
15/* Flags for signalfd4. */
16#define SFD_CLOEXEC O_CLOEXEC
17#define SFD_NONBLOCK O_NONBLOCK
18
19struct signalfd_siginfo {
20 __u32 ssi_signo;
21 __s32 ssi_errno;
22 __s32 ssi_code;
23 __u32 ssi_pid;
24 __u32 ssi_uid;
25 __s32 ssi_fd;
26 __u32 ssi_tid;
27 __u32 ssi_band;
28 __u32 ssi_overrun;
29 __u32 ssi_trapno;
30 __s32 ssi_status;
31 __s32 ssi_int;
32 __u64 ssi_ptr;
33 __u64 ssi_utime;
34 __u64 ssi_stime;
35 __u64 ssi_addr;
36 __u16 ssi_addr_lsb;
37
38 /*
39 * Pad strcture to 128 bytes. Remember to update the
40 * pad size when you add new members. We use a fixed
41 * size structure to avoid compatibility problems with
42 * future versions, and we leave extra space for additional
43 * members. We use fixed size members because this strcture
44 * comes out of a read(2) and we really don't want to have
45 * a compat on read(2).
46 */
47 __u8 __pad[46];
48};
49
50
51
52#endif /* _UAPI_LINUX_SIGNALFD_H */
diff --git a/include/linux/snmp.h b/include/uapi/linux/snmp.h
index fdfba235f9f..fdfba235f9f 100644
--- a/include/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
diff --git a/include/uapi/linux/sock_diag.h b/include/uapi/linux/sock_diag.h
new file mode 100644
index 00000000000..b00e29efb16
--- /dev/null
+++ b/include/uapi/linux/sock_diag.h
@@ -0,0 +1,26 @@
1#ifndef _UAPI__SOCK_DIAG_H__
2#define _UAPI__SOCK_DIAG_H__
3
4#include <linux/types.h>
5
6#define SOCK_DIAG_BY_FAMILY 20
7
8struct sock_diag_req {
9 __u8 sdiag_family;
10 __u8 sdiag_protocol;
11};
12
13enum {
14 SK_MEMINFO_RMEM_ALLOC,
15 SK_MEMINFO_RCVBUF,
16 SK_MEMINFO_WMEM_ALLOC,
17 SK_MEMINFO_SNDBUF,
18 SK_MEMINFO_FWD_ALLOC,
19 SK_MEMINFO_WMEM_QUEUED,
20 SK_MEMINFO_OPTMEM,
21 SK_MEMINFO_BACKLOG,
22
23 SK_MEMINFO_VARS,
24};
25
26#endif /* _UAPI__SOCK_DIAG_H__ */
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
new file mode 100644
index 00000000000..76ab0c68561
--- /dev/null
+++ b/include/uapi/linux/socket.h
@@ -0,0 +1,21 @@
1#ifndef _UAPI_LINUX_SOCKET_H
2#define _UAPI_LINUX_SOCKET_H
3
4/*
5 * Desired design of maximum size and alignment (see RFC2553)
6 */
7#define _K_SS_MAXSIZE 128 /* Implementation specific max size */
8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
9 /* Implementation specific desired alignment */
10
11typedef unsigned short __kernel_sa_family_t;
12
13struct __kernel_sockaddr_storage {
14 __kernel_sa_family_t ss_family; /* address family */
15 /* Following field(s) are implementation specific */
16 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
17 /* space to achieve desired size, */
18 /* _SS_MAXSIZE value minus size of ss_family */
19} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
20
21#endif /* _UAPI_LINUX_SOCKET_H */
diff --git a/include/linux/sockios.h b/include/uapi/linux/sockios.h
index 7997a506ad4..7997a506ad4 100644
--- a/include/linux/sockios.h
+++ b/include/uapi/linux/sockios.h
diff --git a/include/linux/som.h b/include/uapi/linux/som.h
index 166594e4e7b..166594e4e7b 100644
--- a/include/linux/som.h
+++ b/include/uapi/linux/som.h
diff --git a/include/uapi/linux/sonet.h b/include/uapi/linux/sonet.h
new file mode 100644
index 00000000000..cc54acee81b
--- /dev/null
+++ b/include/uapi/linux/sonet.h
@@ -0,0 +1,60 @@
1/* sonet.h - SONET/SHD physical layer control */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef _UAPILINUX_SONET_H
7#define _UAPILINUX_SONET_H
8
9#define __SONET_ITEMS \
10 __HANDLE_ITEM(section_bip); /* section parity errors (B1) */ \
11 __HANDLE_ITEM(line_bip); /* line parity errors (B2) */ \
12 __HANDLE_ITEM(path_bip); /* path parity errors (B3) */ \
13 __HANDLE_ITEM(line_febe); /* line parity errors at remote */ \
14 __HANDLE_ITEM(path_febe); /* path parity errors at remote */ \
15 __HANDLE_ITEM(corr_hcs); /* correctable header errors */ \
16 __HANDLE_ITEM(uncorr_hcs); /* uncorrectable header errors */ \
17 __HANDLE_ITEM(tx_cells); /* cells sent */ \
18 __HANDLE_ITEM(rx_cells); /* cells received */
19
20struct sonet_stats {
21#define __HANDLE_ITEM(i) int i
22 __SONET_ITEMS
23#undef __HANDLE_ITEM
24} __attribute__ ((packed));
25
26
27#define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats)
28 /* get statistics */
29#define SONET_GETSTATZ _IOR('a',ATMIOC_PHYTYP+1,struct sonet_stats)
30 /* ... and zero counters */
31#define SONET_SETDIAG _IOWR('a',ATMIOC_PHYTYP+2,int)
32 /* set error insertion */
33#define SONET_CLRDIAG _IOWR('a',ATMIOC_PHYTYP+3,int)
34 /* clear error insertion */
35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
36 /* query error insertion */
37#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
38 /* set framing mode (SONET/SDH) */
39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
40 /* get framing mode */
41#define SONET_GETFRSENSE _IOR('a',ATMIOC_PHYTYP+7, \
42 unsigned char[SONET_FRSENSE_SIZE]) /* get framing sense information */
43
44#define SONET_INS_SBIP 1 /* section BIP */
45#define SONET_INS_LBIP 2 /* line BIP */
46#define SONET_INS_PBIP 4 /* path BIP */
47#define SONET_INS_FRAME 8 /* out of frame */
48#define SONET_INS_LOS 16 /* set line to zero */
49#define SONET_INS_LAIS 32 /* line alarm indication signal */
50#define SONET_INS_PAIS 64 /* path alarm indication signal */
51#define SONET_INS_HCS 128 /* insert HCS error */
52
53#define SONET_FRAME_SONET 0 /* SONET STS-3 framing */
54#define SONET_FRAME_SDH 1 /* SDH STM-1 framing */
55
56#define SONET_FRSENSE_SIZE 6 /* C1[3],H1[3] (0xff for unknown) */
57
58
59
60#endif /* _UAPILINUX_SONET_H */
diff --git a/include/uapi/linux/sonypi.h b/include/uapi/linux/sonypi.h
new file mode 100644
index 00000000000..85078a28357
--- /dev/null
+++ b/include/uapi/linux/sonypi.h
@@ -0,0 +1,146 @@
1/*
2 * Sony Programmable I/O Control Device driver for VAIO
3 *
4 * Copyright (C) 2001-2005 Stelian Pop <stelian@popies.net>
5 *
6 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
7
8 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
9 *
10 * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
11 *
12 * Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
13 *
14 * Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
15 *
16 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
17 *
18 * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 *
34 */
35
36#ifndef _UAPI_SONYPI_H_
37#define _UAPI_SONYPI_H_
38
39#include <linux/types.h>
40
41/* events the user application reading /dev/sonypi can use */
42
43#define SONYPI_EVENT_IGNORE 0
44#define SONYPI_EVENT_JOGDIAL_DOWN 1
45#define SONYPI_EVENT_JOGDIAL_UP 2
46#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED 3
47#define SONYPI_EVENT_JOGDIAL_UP_PRESSED 4
48#define SONYPI_EVENT_JOGDIAL_PRESSED 5
49#define SONYPI_EVENT_JOGDIAL_RELEASED 6 /* obsolete */
50#define SONYPI_EVENT_CAPTURE_PRESSED 7
51#define SONYPI_EVENT_CAPTURE_RELEASED 8 /* obsolete */
52#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED 9
53#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED 10
54#define SONYPI_EVENT_FNKEY_ESC 11
55#define SONYPI_EVENT_FNKEY_F1 12
56#define SONYPI_EVENT_FNKEY_F2 13
57#define SONYPI_EVENT_FNKEY_F3 14
58#define SONYPI_EVENT_FNKEY_F4 15
59#define SONYPI_EVENT_FNKEY_F5 16
60#define SONYPI_EVENT_FNKEY_F6 17
61#define SONYPI_EVENT_FNKEY_F7 18
62#define SONYPI_EVENT_FNKEY_F8 19
63#define SONYPI_EVENT_FNKEY_F9 20
64#define SONYPI_EVENT_FNKEY_F10 21
65#define SONYPI_EVENT_FNKEY_F11 22
66#define SONYPI_EVENT_FNKEY_F12 23
67#define SONYPI_EVENT_FNKEY_1 24
68#define SONYPI_EVENT_FNKEY_2 25
69#define SONYPI_EVENT_FNKEY_D 26
70#define SONYPI_EVENT_FNKEY_E 27
71#define SONYPI_EVENT_FNKEY_F 28
72#define SONYPI_EVENT_FNKEY_S 29
73#define SONYPI_EVENT_FNKEY_B 30
74#define SONYPI_EVENT_BLUETOOTH_PRESSED 31
75#define SONYPI_EVENT_PKEY_P1 32
76#define SONYPI_EVENT_PKEY_P2 33
77#define SONYPI_EVENT_PKEY_P3 34
78#define SONYPI_EVENT_BACK_PRESSED 35
79#define SONYPI_EVENT_LID_CLOSED 36
80#define SONYPI_EVENT_LID_OPENED 37
81#define SONYPI_EVENT_BLUETOOTH_ON 38
82#define SONYPI_EVENT_BLUETOOTH_OFF 39
83#define SONYPI_EVENT_HELP_PRESSED 40
84#define SONYPI_EVENT_FNKEY_ONLY 41
85#define SONYPI_EVENT_JOGDIAL_FAST_DOWN 42
86#define SONYPI_EVENT_JOGDIAL_FAST_UP 43
87#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
88#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED 45
89#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN 46
90#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
91#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
92#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
93#define SONYPI_EVENT_ZOOM_PRESSED 50
94#define SONYPI_EVENT_THUMBPHRASE_PRESSED 51
95#define SONYPI_EVENT_MEYE_FACE 52
96#define SONYPI_EVENT_MEYE_OPPOSITE 53
97#define SONYPI_EVENT_MEMORYSTICK_INSERT 54
98#define SONYPI_EVENT_MEMORYSTICK_EJECT 55
99#define SONYPI_EVENT_ANYBUTTON_RELEASED 56
100#define SONYPI_EVENT_BATTERY_INSERT 57
101#define SONYPI_EVENT_BATTERY_REMOVE 58
102#define SONYPI_EVENT_FNKEY_RELEASED 59
103#define SONYPI_EVENT_WIRELESS_ON 60
104#define SONYPI_EVENT_WIRELESS_OFF 61
105#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
106#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
107#define SONYPI_EVENT_CD_EJECT_PRESSED 64
108#define SONYPI_EVENT_MODEKEY_PRESSED 65
109#define SONYPI_EVENT_PKEY_P4 66
110#define SONYPI_EVENT_PKEY_P5 67
111#define SONYPI_EVENT_SETTINGKEY_PRESSED 68
112#define SONYPI_EVENT_VOLUME_INC_PRESSED 69
113#define SONYPI_EVENT_VOLUME_DEC_PRESSED 70
114#define SONYPI_EVENT_BRIGHTNESS_PRESSED 71
115#define SONYPI_EVENT_MEDIA_PRESSED 72
116#define SONYPI_EVENT_VENDOR_PRESSED 73
117
118/* get/set brightness */
119#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
120#define SONYPI_IOCSBRT _IOW('v', 0, __u8)
121
122/* get battery full capacity/remaining capacity */
123#define SONYPI_IOCGBAT1CAP _IOR('v', 2, __u16)
124#define SONYPI_IOCGBAT1REM _IOR('v', 3, __u16)
125#define SONYPI_IOCGBAT2CAP _IOR('v', 4, __u16)
126#define SONYPI_IOCGBAT2REM _IOR('v', 5, __u16)
127
128/* get battery flags: battery1/battery2/ac adapter present */
129#define SONYPI_BFLAGS_B1 0x01
130#define SONYPI_BFLAGS_B2 0x02
131#define SONYPI_BFLAGS_AC 0x04
132#define SONYPI_IOCGBATFLAGS _IOR('v', 7, __u8)
133
134/* get/set bluetooth subsystem state on/off */
135#define SONYPI_IOCGBLUE _IOR('v', 8, __u8)
136#define SONYPI_IOCSBLUE _IOW('v', 9, __u8)
137
138/* get/set fan state on/off */
139#define SONYPI_IOCGFAN _IOR('v', 10, __u8)
140#define SONYPI_IOCSFAN _IOW('v', 11, __u8)
141
142/* get temperature (C) */
143#define SONYPI_IOCGTEMP _IOR('v', 12, __u8)
144
145
146#endif /* _UAPI_SONYPI_H_ */
diff --git a/include/uapi/linux/sound.h b/include/uapi/linux/sound.h
new file mode 100644
index 00000000000..014c9117c22
--- /dev/null
+++ b/include/uapi/linux/sound.h
@@ -0,0 +1,31 @@
1#ifndef _UAPI_LINUX_SOUND_H
2#define _UAPI_LINUX_SOUND_H
3
4/*
5 * Minor numbers for the sound driver.
6 */
7
8#include <linux/fs.h>
9
10#define SND_DEV_CTL 0 /* Control port /dev/mixer */
11#define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
12 synthesizer and MIDI output) */
13#define SND_DEV_MIDIN 2 /* Raw midi access */
14#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
15#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
16#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
17/* #define SND_DEV_STATUS 6 */ /* /dev/sndstat (obsolete) */
18#define SND_DEV_UNUSED 6
19#define SND_DEV_AWFM 7 /* Reserved */
20#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
21/* #define SND_DEV_SNDPROC 9 */ /* /dev/sndproc for programmable devices (not used) */
22/* #define SND_DEV_DMMIDI 9 */
23#define SND_DEV_SYNTH 9 /* Raw synth access /dev/synth (same as /dev/dmfm) */
24#define SND_DEV_DMFM 10 /* Raw synth access /dev/dmfm */
25#define SND_DEV_UNKNOWN11 11
26#define SND_DEV_ADSP 12 /* Like /dev/dsp (obsolete) */
27#define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
28#define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
29
30
31#endif /* _UAPI_LINUX_SOUND_H */
diff --git a/include/uapi/linux/soundcard.h b/include/uapi/linux/soundcard.h
new file mode 100644
index 00000000000..f3b21f98987
--- /dev/null
+++ b/include/uapi/linux/soundcard.h
@@ -0,0 +1,1282 @@
1/*
2 * Copyright by Hannu Savolainen 1993-1997
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: 1. Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer. 2.
8 * Redistributions in binary form must reproduce the above copyright notice,
9 * this list of conditions and the following disclaimer in the documentation
10 * and/or other materials provided with the distribution.
11 *
12 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
13 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
16 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22 * SUCH DAMAGE.
23 */
24#ifndef _UAPISOUNDCARD_H
25#define _UAPISOUNDCARD_H
26
27
28/*
29 * OSS interface version. With versions earlier than 3.6 this value is
30 * an integer with value less than 361. In versions 3.6 and later
31 * it's a six digit hexadecimal value. For example value
32 * of 0x030600 represents OSS version 3.6.0.
33 * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
34 * the currently active driver.
35 */
36#define SOUND_VERSION 0x030802
37#define OPEN_SOUND_SYSTEM
38
39/* In Linux we need to be prepared for cross compiling */
40#include <linux/ioctl.h>
41
42/* Endian macros. */
43#ifndef __KERNEL__
44# include <endian.h>
45#endif
46
47/*
48 * Supported card ID numbers (Should be somewhere else?)
49 */
50
51#define SNDCARD_ADLIB 1
52#define SNDCARD_SB 2
53#define SNDCARD_PAS 3
54#define SNDCARD_GUS 4
55#define SNDCARD_MPU401 5
56#define SNDCARD_SB16 6
57#define SNDCARD_SB16MIDI 7
58#define SNDCARD_UART6850 8
59#define SNDCARD_GUS16 9
60#define SNDCARD_MSS 10
61#define SNDCARD_PSS 11
62#define SNDCARD_SSCAPE 12
63#define SNDCARD_PSS_MPU 13
64#define SNDCARD_PSS_MSS 14
65#define SNDCARD_SSCAPE_MSS 15
66#define SNDCARD_TRXPRO 16
67#define SNDCARD_TRXPRO_SB 17
68#define SNDCARD_TRXPRO_MPU 18
69#define SNDCARD_MAD16 19
70#define SNDCARD_MAD16_MPU 20
71#define SNDCARD_CS4232 21
72#define SNDCARD_CS4232_MPU 22
73#define SNDCARD_MAUI 23
74#define SNDCARD_PSEUDO_MSS 24
75#define SNDCARD_GUSPNP 25
76#define SNDCARD_UART401 26
77/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
78
79/***********************************
80 * IOCTL Commands for /dev/sequencer
81 */
82
83#ifndef _SIOWR
84#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
85/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
86#define SIOCPARM_MASK IOCPARM_MASK
87#define SIOC_VOID IOC_VOID
88#define SIOC_OUT IOC_OUT
89#define SIOC_IN IOC_IN
90#define SIOC_INOUT IOC_INOUT
91#define _SIOC_SIZE _IOC_SIZE
92#define _SIOC_DIR _IOC_DIR
93#define _SIOC_NONE _IOC_NONE
94#define _SIOC_READ _IOC_READ
95#define _SIOC_WRITE _IOC_WRITE
96#define _SIO _IO
97#define _SIOR _IOR
98#define _SIOW _IOW
99#define _SIOWR _IOWR
100#else
101
102/* Ioctl's have the command encoded in the lower word,
103 * and the size of any in or out parameters in the upper
104 * word. The high 2 bits of the upper word are used
105 * to encode the in/out status of the parameter; for now
106 * we restrict parameters to at most 8191 bytes.
107 */
108/* #define SIOCTYPE (0xff<<8) */
109#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
110#define SIOC_VOID 0x00000000 /* no parameters */
111#define SIOC_OUT 0x20000000 /* copy out parameters */
112#define SIOC_IN 0x40000000 /* copy in parameters */
113#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
114/* the 0x20000000 is so we can distinguish new ioctl's from old */
115#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
116#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
117#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
118/* this should be _SIORW, but stdio got there first */
119#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
120#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
121#define _SIOC_DIR(x) (x & 0xf0000000)
122#define _SIOC_NONE SIOC_VOID
123#define _SIOC_READ SIOC_OUT
124#define _SIOC_WRITE SIOC_IN
125# endif /* _IOWR */
126#endif /* !_SIOWR */
127
128#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
129#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
130#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
131#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
132#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
133#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
134#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
135#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
136#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
137#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
138#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
139#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
140#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
141#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
142#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
143#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
144#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
145#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
146#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
147#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
148#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
149#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
150
151typedef struct synth_control
152{
153 int devno; /* Synthesizer # */
154 char data[4000]; /* Device spesific command/data record */
155}synth_control;
156
157typedef struct remove_sample
158{
159 int devno; /* Synthesizer # */
160 int bankno; /* MIDI bank # (0=General MIDI) */
161 int instrno; /* MIDI instrument number */
162} remove_sample;
163
164typedef struct seq_event_rec {
165 unsigned char arr[8];
166} seq_event_rec;
167
168#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
169#define SNDCTL_TMR_START _SIO ('T', 2)
170#define SNDCTL_TMR_STOP _SIO ('T', 3)
171#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
172#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
173#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
174# define TMR_INTERNAL 0x00000001
175# define TMR_EXTERNAL 0x00000002
176# define TMR_MODE_MIDI 0x00000010
177# define TMR_MODE_FSK 0x00000020
178# define TMR_MODE_CLS 0x00000040
179# define TMR_MODE_SMPTE 0x00000080
180#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
181#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
182
183/*
184 * Some big endian/little endian handling macros
185 */
186
187#define _LINUX_PATCHKEY_H_INDIRECT
188#include <linux/patchkey.h>
189#undef _LINUX_PATCHKEY_H_INDIRECT
190
191#if !defined(__KERNEL__)
192# if defined(__BYTE_ORDER)
193# if __BYTE_ORDER == __BIG_ENDIAN
194# define AFMT_S16_NE AFMT_S16_BE
195# elif __BYTE_ORDER == __LITTLE_ENDIAN
196# define AFMT_S16_NE AFMT_S16_LE
197# else
198# error "could not determine byte order"
199# endif
200# endif
201#endif
202
203/*
204 * Sample loading mechanism for internal synthesizers (/dev/sequencer)
205 * The following patch_info structure has been designed to support
206 * Gravis UltraSound. It tries to be universal format for uploading
207 * sample based patches but is probably too limited.
208 *
209 * (PBD) As Hannu guessed, the GUS structure is too limited for
210 * the WaveFront, but this is the right place for a constant definition.
211 */
212
213struct patch_info {
214 unsigned short key; /* Use WAVE_PATCH here */
215#define WAVE_PATCH _PATCHKEY(0x04)
216#define GUS_PATCH WAVE_PATCH
217#define WAVEFRONT_PATCH _PATCHKEY(0x06)
218
219 short device_no; /* Synthesizer number */
220 short instr_no; /* Midi pgm# */
221
222 unsigned int mode;
223/*
224 * The least significant byte has the same format than the GUS .PAT
225 * files
226 */
227#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
228#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
229#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
230#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
231#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
232#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
233#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
234#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
235 /* (use the env_rate/env_offs fields). */
236/* Linux specific bits */
237#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
238#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
239#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
240#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
241/* Reserved bits */
242#define WAVE_ROM 0x40000000 /* For future use */
243#define WAVE_MULAW 0x20000000 /* For future use */
244/* Other bits must be zeroed */
245
246 int len; /* Size of the wave data in bytes */
247 int loop_start, loop_end; /* Byte offsets from the beginning */
248
249/*
250 * The base_freq and base_note fields are used when computing the
251 * playback speed for a note. The base_note defines the tone frequency
252 * which is heard if the sample is played using the base_freq as the
253 * playback speed.
254 *
255 * The low_note and high_note fields define the minimum and maximum note
256 * frequencies for which this sample is valid. It is possible to define
257 * more than one samples for an instrument number at the same time. The
258 * low_note and high_note fields are used to select the most suitable one.
259 *
260 * The fields base_note, high_note and low_note should contain
261 * the note frequency multiplied by 1000. For example value for the
262 * middle A is 440*1000.
263 */
264
265 unsigned int base_freq;
266 unsigned int base_note;
267 unsigned int high_note;
268 unsigned int low_note;
269 int panning; /* -128=left, 127=right */
270 int detuning;
271
272/* New fields introduced in version 1.99.5 */
273
274 /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
275 unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
276 unsigned char env_offset[ 6 ]; /* 255 == 100% */
277
278 /*
279 * The tremolo, vibrato and scale info are not supported yet.
280 * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
281 * WAVE_SCALE
282 */
283
284 unsigned char tremolo_sweep;
285 unsigned char tremolo_rate;
286 unsigned char tremolo_depth;
287
288 unsigned char vibrato_sweep;
289 unsigned char vibrato_rate;
290 unsigned char vibrato_depth;
291
292 int scale_frequency;
293 unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
294
295 int volume;
296 int fractions;
297 int reserved1;
298 int spare[2];
299 char data[1]; /* The waveform data starts here */
300 };
301
302struct sysex_info {
303 short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
304#define SYSEX_PATCH _PATCHKEY(0x05)
305#define MAUI_PATCH _PATCHKEY(0x06)
306 short device_no; /* Synthesizer number */
307 int len; /* Size of the sysex data in bytes */
308 unsigned char data[1]; /* Sysex data starts here */
309 };
310
311/*
312 * /dev/sequencer input events.
313 *
314 * The data written to the /dev/sequencer is a stream of events. Events
315 * are records of 4 or 8 bytes. The first byte defines the size.
316 * Any number of events can be written with a write call. There
317 * is a set of macros for sending these events. Use these macros if you
318 * want to maximize portability of your program.
319 *
320 * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
321 * (All input events are currently 4 bytes long. Be prepared to support
322 * 8 byte events also. If you receive any event having first byte >= 128,
323 * it's a 8 byte event.
324 *
325 * The events are documented at the end of this file.
326 *
327 * Normal events (4 bytes)
328 * There is also a 8 byte version of most of the 4 byte events. The
329 * 8 byte one is recommended.
330 */
331#define SEQ_NOTEOFF 0
332#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
333#define SEQ_NOTEON 1
334#define SEQ_FMNOTEON SEQ_NOTEON
335#define SEQ_WAIT TMR_WAIT_ABS
336#define SEQ_PGMCHANGE 3
337#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
338#define SEQ_SYNCTIMER TMR_START
339#define SEQ_MIDIPUTC 5
340#define SEQ_DRUMON 6 /*** OBSOLETE ***/
341#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
342#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
343#define SEQ_AFTERTOUCH 9
344#define SEQ_CONTROLLER 10
345
346/*******************************************
347 * Midi controller numbers
348 *******************************************
349 * Controllers 0 to 31 (0x00 to 0x1f) and
350 * 32 to 63 (0x20 to 0x3f) are continuous
351 * controllers.
352 * In the MIDI 1.0 these controllers are sent using
353 * two messages. Controller numbers 0 to 31 are used
354 * to send the MSB and the controller numbers 32 to 63
355 * are for the LSB. Note that just 7 bits are used in MIDI bytes.
356 */
357
358#define CTL_BANK_SELECT 0x00
359#define CTL_MODWHEEL 0x01
360#define CTL_BREATH 0x02
361/* undefined 0x03 */
362#define CTL_FOOT 0x04
363#define CTL_PORTAMENTO_TIME 0x05
364#define CTL_DATA_ENTRY 0x06
365#define CTL_MAIN_VOLUME 0x07
366#define CTL_BALANCE 0x08
367/* undefined 0x09 */
368#define CTL_PAN 0x0a
369#define CTL_EXPRESSION 0x0b
370/* undefined 0x0c */
371/* undefined 0x0d */
372/* undefined 0x0e */
373/* undefined 0x0f */
374#define CTL_GENERAL_PURPOSE1 0x10
375#define CTL_GENERAL_PURPOSE2 0x11
376#define CTL_GENERAL_PURPOSE3 0x12
377#define CTL_GENERAL_PURPOSE4 0x13
378/* undefined 0x14 - 0x1f */
379
380/* undefined 0x20 */
381/* The controller numbers 0x21 to 0x3f are reserved for the */
382/* least significant bytes of the controllers 0x00 to 0x1f. */
383/* These controllers are not recognised by the driver. */
384
385/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
386/* 0=OFF and 127=ON (intermediate values are possible) */
387#define CTL_DAMPER_PEDAL 0x40
388#define CTL_SUSTAIN 0x40 /* Alias */
389#define CTL_HOLD 0x40 /* Alias */
390#define CTL_PORTAMENTO 0x41
391#define CTL_SOSTENUTO 0x42
392#define CTL_SOFT_PEDAL 0x43
393/* undefined 0x44 */
394#define CTL_HOLD2 0x45
395/* undefined 0x46 - 0x4f */
396
397#define CTL_GENERAL_PURPOSE5 0x50
398#define CTL_GENERAL_PURPOSE6 0x51
399#define CTL_GENERAL_PURPOSE7 0x52
400#define CTL_GENERAL_PURPOSE8 0x53
401/* undefined 0x54 - 0x5a */
402#define CTL_EXT_EFF_DEPTH 0x5b
403#define CTL_TREMOLO_DEPTH 0x5c
404#define CTL_CHORUS_DEPTH 0x5d
405#define CTL_DETUNE_DEPTH 0x5e
406#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
407#define CTL_PHASER_DEPTH 0x5f
408#define CTL_DATA_INCREMENT 0x60
409#define CTL_DATA_DECREMENT 0x61
410#define CTL_NONREG_PARM_NUM_LSB 0x62
411#define CTL_NONREG_PARM_NUM_MSB 0x63
412#define CTL_REGIST_PARM_NUM_LSB 0x64
413#define CTL_REGIST_PARM_NUM_MSB 0x65
414/* undefined 0x66 - 0x78 */
415/* reserved 0x79 - 0x7f */
416
417/* Pseudo controllers (not midi compatible) */
418#define CTRL_PITCH_BENDER 255
419#define CTRL_PITCH_BENDER_RANGE 254
420#define CTRL_EXPRESSION 253 /* Obsolete */
421#define CTRL_MAIN_VOLUME 252 /* Obsolete */
422#define SEQ_BALANCE 11
423#define SEQ_VOLMODE 12
424
425/*
426 * Volume mode decides how volumes are used
427 */
428
429#define VOL_METHOD_ADAGIO 1
430#define VOL_METHOD_LINEAR 2
431
432/*
433 * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
434 * input events.
435 */
436
437/*
438 * Event codes 0xf0 to 0xfc are reserved for future extensions.
439 */
440
441#define SEQ_FULLSIZE 0xfd /* Long events */
442/*
443 * SEQ_FULLSIZE events are used for loading patches/samples to the
444 * synthesizer devices. These events are passed directly to the driver
445 * of the associated synthesizer device. There is no limit to the size
446 * of the extended events. These events are not queued but executed
447 * immediately when the write() is called (execution can take several
448 * seconds of time).
449 *
450 * When a SEQ_FULLSIZE message is written to the device, it must
451 * be written using exactly one write() call. Other events cannot
452 * be mixed to the same write.
453 *
454 * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
455 * /dev/sequencer. Don't write other data together with the instrument structure
456 * Set the key field of the structure to FM_PATCH. The device field is used to
457 * route the patch to the corresponding device.
458 *
459 * For wave table use struct patch_info. Initialize the key field
460 * to WAVE_PATCH.
461 */
462#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
463#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
464
465/*
466 * Record for FM patches
467 */
468
469typedef unsigned char sbi_instr_data[32];
470
471struct sbi_instrument {
472 unsigned short key; /* FM_PATCH or OPL3_PATCH */
473#define FM_PATCH _PATCHKEY(0x01)
474#define OPL3_PATCH _PATCHKEY(0x03)
475 short device; /* Synth# (0-4) */
476 int channel; /* Program# to be initialized */
477 sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
478 };
479
480struct synth_info { /* Read only */
481 char name[30];
482 int device; /* 0-N. INITIALIZE BEFORE CALLING */
483 int synth_type;
484#define SYNTH_TYPE_FM 0
485#define SYNTH_TYPE_SAMPLE 1
486#define SYNTH_TYPE_MIDI 2 /* Midi interface */
487
488 int synth_subtype;
489#define FM_TYPE_ADLIB 0x00
490#define FM_TYPE_OPL3 0x01
491#define MIDI_TYPE_MPU401 0x401
492
493#define SAMPLE_TYPE_BASIC 0x10
494#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
495#define SAMPLE_TYPE_WAVEFRONT 0x11
496
497 int perc_mode; /* No longer supported */
498 int nr_voices;
499 int nr_drums; /* Obsolete field */
500 int instr_bank_size;
501 unsigned int capabilities;
502#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
503#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
504#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
505 int dummies[19]; /* Reserve space */
506 };
507
508struct sound_timer_info {
509 char name[32];
510 int caps;
511 };
512
513#define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
514
515struct midi_info {
516 char name[30];
517 int device; /* 0-N. INITIALIZE BEFORE CALLING */
518 unsigned int capabilities; /* To be defined later */
519 int dev_type;
520 int dummies[18]; /* Reserve space */
521 };
522
523/********************************************
524 * ioctl commands for the /dev/midi##
525 */
526typedef struct {
527 unsigned char cmd;
528 char nr_args, nr_returns;
529 unsigned char data[30];
530 } mpu_command_rec;
531
532#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
533#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
534#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
535
536/********************************************
537 * IOCTL commands for /dev/dsp and /dev/audio
538 */
539
540#define SNDCTL_DSP_RESET _SIO ('P', 0)
541#define SNDCTL_DSP_SYNC _SIO ('P', 1)
542#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
543#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
544#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
545#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
546#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
547#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
548#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
549#define SNDCTL_DSP_POST _SIO ('P', 8)
550#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
551#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
552
553/* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
554#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */
555#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/
556# define AFMT_QUERY 0x00000000 /* Return current fmt */
557# define AFMT_MU_LAW 0x00000001
558# define AFMT_A_LAW 0x00000002
559# define AFMT_IMA_ADPCM 0x00000004
560# define AFMT_U8 0x00000008
561# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/
562# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
563# define AFMT_S8 0x00000040
564# define AFMT_U16_LE 0x00000080 /* Little endian U16 */
565# define AFMT_U16_BE 0x00000100 /* Big endian U16 */
566# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
567# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
568
569/*
570 * Buffer status queries.
571 */
572typedef struct audio_buf_info {
573 int fragments; /* # of available fragments (partially usend ones not counted) */
574 int fragstotal; /* Total # of fragments allocated */
575 int fragsize; /* Size of a fragment in bytes */
576
577 int bytes; /* Available space in bytes (includes partially used fragments) */
578 /* Note! 'bytes' could be more than fragments*fragsize */
579 } audio_buf_info;
580
581#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
582#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
583#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
584#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
585# define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
586# define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
587# define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
588# define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
589 /* internal buffers which may */
590 /* cause some delays and */
591 /* decrease precision of timing */
592# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
593 /* Sometimes it's a DSP */
594 /* but usually not */
595# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
596# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
597# define DSP_CAP_MULTI 0x00004000 /* support multiple open */
598# define DSP_CAP_BIND 0x00008000 /* channel binding to front/rear/cneter/lfe */
599
600
601#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
602#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
603# define PCM_ENABLE_INPUT 0x00000001
604# define PCM_ENABLE_OUTPUT 0x00000002
605
606typedef struct count_info {
607 int bytes; /* Total # of bytes processed */
608 int blocks; /* # of fragment transitions since last time */
609 int ptr; /* Current DMA pointer value */
610 } count_info;
611
612#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
613#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
614
615typedef struct buffmem_desc {
616 unsigned *buffer;
617 int size;
618 } buffmem_desc;
619#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
620#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
621#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
622#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
623#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
624
625#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
626#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
627# define DSP_BIND_QUERY 0x00000000
628# define DSP_BIND_FRONT 0x00000001
629# define DSP_BIND_SURR 0x00000002
630# define DSP_BIND_CENTER_LFE 0x00000004
631# define DSP_BIND_HANDSET 0x00000008
632# define DSP_BIND_MIC 0x00000010
633# define DSP_BIND_MODEM1 0x00000020
634# define DSP_BIND_MODEM2 0x00000040
635# define DSP_BIND_I2S 0x00000080
636# define DSP_BIND_SPDIF 0x00000100
637
638#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
639#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
640# define SPDIF_PRO 0x0001
641# define SPDIF_N_AUD 0x0002
642# define SPDIF_COPY 0x0004
643# define SPDIF_PRE 0x0008
644# define SPDIF_CC 0x07f0
645# define SPDIF_L 0x0800
646# define SPDIF_DRS 0x4000
647# define SPDIF_V 0x8000
648
649/*
650 * Application's profile defines the way how playback underrun situations should be handled.
651 *
652 * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
653 * playback buffer whenever an underrun occurs. This consumes some time
654 * prevents looping the existing buffer.
655 * APF_CPUINTENS is intended to be set by CPU intensive applications which
656 * are likely to run out of time occasionally. In this mode the buffer cleanup is
657 * disabled which saves CPU time but also let's the previous buffer content to
658 * be played during the "pause" after the underrun.
659 */
660#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
661#define APF_NORMAL 0 /* Normal applications */
662#define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
663#define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
664
665#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
666#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
667#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
668#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
669
670/* Some alias names */
671#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
672#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
673#define SOUND_PCM_POST SNDCTL_DSP_POST
674#define SOUND_PCM_RESET SNDCTL_DSP_RESET
675#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
676#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
677#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
678#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
679#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
680#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
681#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
682#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
683#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
684#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
685#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
686#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
687#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
688#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
689#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
690#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
691
692/*
693 * ioctl calls to be used in communication with coprocessors and
694 * DSP chips.
695 */
696
697typedef struct copr_buffer {
698 int command; /* Set to 0 if not used */
699 int flags;
700#define CPF_NONE 0x0000
701#define CPF_FIRST 0x0001 /* First block */
702#define CPF_LAST 0x0002 /* Last block */
703 int len;
704 int offs; /* If required by the device (0 if not used) */
705
706 unsigned char data[4000]; /* NOTE! 4000 is not 4k */
707 } copr_buffer;
708
709typedef struct copr_debug_buf {
710 int command; /* Used internally. Set to 0 */
711 int parm1;
712 int parm2;
713 int flags;
714 int len; /* Length of data in bytes */
715 } copr_debug_buf;
716
717typedef struct copr_msg {
718 int len;
719 unsigned char data[4000];
720 } copr_msg;
721
722#define SNDCTL_COPR_RESET _SIO ('C', 0)
723#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
724#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
725#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
726#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
727#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
728#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
729#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
730#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
731#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
732
733/*********************************************
734 * IOCTL commands for /dev/mixer
735 */
736
737/*
738 * Mixer devices
739 *
740 * There can be up to 20 different analog mixer channels. The
741 * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
742 * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
743 * the devices supported by the particular mixer.
744 */
745
746#define SOUND_MIXER_NRDEVICES 25
747#define SOUND_MIXER_VOLUME 0
748#define SOUND_MIXER_BASS 1
749#define SOUND_MIXER_TREBLE 2
750#define SOUND_MIXER_SYNTH 3
751#define SOUND_MIXER_PCM 4
752#define SOUND_MIXER_SPEAKER 5
753#define SOUND_MIXER_LINE 6
754#define SOUND_MIXER_MIC 7
755#define SOUND_MIXER_CD 8
756#define SOUND_MIXER_IMIX 9 /* Recording monitor */
757#define SOUND_MIXER_ALTPCM 10
758#define SOUND_MIXER_RECLEV 11 /* Recording level */
759#define SOUND_MIXER_IGAIN 12 /* Input gain */
760#define SOUND_MIXER_OGAIN 13 /* Output gain */
761/*
762 * The AD1848 codec and compatibles have three line level inputs
763 * (line, aux1 and aux2). Since each card manufacturer have assigned
764 * different meanings to these inputs, it's inpractical to assign
765 * specific meanings (line, cd, synth etc.) to them.
766 */
767#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
768#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
769#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
770#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
771#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
772#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
773#define SOUND_MIXER_PHONEIN 20 /* Phone input */
774#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
775#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
776#define SOUND_MIXER_RADIO 23 /* Radio in */
777#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
778
779/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
780/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
781#define SOUND_ONOFF_MIN 28
782#define SOUND_ONOFF_MAX 30
783
784/* Note! Number 31 cannot be used since the sign bit is reserved */
785#define SOUND_MIXER_NONE 31
786
787/*
788 * The following unsupported macros are no longer functional.
789 * Use SOUND_MIXER_PRIVATE# macros in future.
790 */
791#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
792#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
793#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
794
795
796#define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
797 "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
798 "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
799 "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
800
801#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
802 "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
803 "line1", "line2", "line3", "dig1", "dig2", "dig3", \
804 "phin", "phout", "video", "radio", "monitor"}
805
806/* Device bitmask identifiers */
807
808#define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
809#define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
810#define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
811#define SOUND_MIXER_CAPS 0xfc
812# define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
813#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
814#define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
815#define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
816
817/* Device mask bits */
818
819#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
820#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
821#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
822#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
823#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
824#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
825#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
826#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
827#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
828#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
829#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
830#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
831#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
832#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
833#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
834#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
835#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
836#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
837#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
838#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
839#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
840#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
841#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
842#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
843#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
844
845/* Obsolete macros */
846#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
847#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
848#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
849
850#define MIXER_READ(dev) _SIOR('M', dev, int)
851#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
852#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
853#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
854#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
855#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
856#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
857#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
858#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
859#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
860#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
861#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
862#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
863#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
864#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
865#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
866#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
867#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
868
869/* Obsolete macros */
870#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
871#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
872#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
873
874#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
875#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
876#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
877#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
878#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
879
880#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
881#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
882#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
883#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
884#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
885#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
886#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
887#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
888#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
889#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
890#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
891#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
892#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
893#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
894#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
895#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
896#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
897#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
898
899/* Obsolete macros */
900#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
901#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
902#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
903
904#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
905
906typedef struct mixer_info
907{
908 char id[16];
909 char name[32];
910 int modify_counter;
911 int fillers[10];
912} mixer_info;
913
914typedef struct _old_mixer_info /* Obsolete */
915{
916 char id[16];
917 char name[32];
918} _old_mixer_info;
919
920#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
921#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
922
923/*
924 * A mechanism for accessing "proprietary" mixer features. This method
925 * permits passing 128 bytes of arbitrary data between a mixer application
926 * and the mixer driver. Interpretation of the record is defined by
927 * the particular mixer driver.
928 */
929typedef unsigned char mixer_record[128];
930
931#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
932
933/*
934 * Two ioctls for special souncard function
935 */
936#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
937#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
938
939/*
940 * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
941 * These features can be used when accessing device specific features.
942 */
943#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
944#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
945#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
946#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
947#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
948
949/*
950 * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
951 * for querying current mixer settings from the driver and for loading
952 * default volume settings _prior_ activating the mixer (loading
953 * doesn't affect current state of the mixer hardware). These calls
954 * are for internal use only.
955 */
956
957typedef struct mixer_vol_table {
958 int num; /* Index to volume table */
959 char name[32];
960 int levels[32];
961} mixer_vol_table;
962
963#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
964#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
965
966/*
967 * An ioctl for identifying the driver version. It will return value
968 * of the SOUND_VERSION macro used when compiling the driver.
969 * This call was introduced in OSS version 3.6 and it will not work
970 * with earlier versions (returns EINVAL).
971 */
972#define OSS_GETVERSION _SIOR ('M', 118, int)
973
974/*
975 * Level 2 event types for /dev/sequencer
976 */
977
978/*
979 * The 4 most significant bits of byte 0 specify the class of
980 * the event:
981 *
982 * 0x8X = system level events,
983 * 0x9X = device/port specific events, event[1] = device/port,
984 * The last 4 bits give the subtype:
985 * 0x02 = Channel event (event[3] = chn).
986 * 0x01 = note event (event[4] = note).
987 * (0x01 is not used alone but always with bit 0x02).
988 * event[2] = MIDI message code (0x80=note off etc.)
989 *
990 */
991
992#define EV_SEQ_LOCAL 0x80
993#define EV_TIMING 0x81
994#define EV_CHN_COMMON 0x92
995#define EV_CHN_VOICE 0x93
996#define EV_SYSEX 0x94
997/*
998 * Event types 200 to 220 are reserved for application use.
999 * These numbers will not be used by the driver.
1000 */
1001
1002/*
1003 * Events for event type EV_CHN_VOICE
1004 */
1005
1006#define MIDI_NOTEOFF 0x80
1007#define MIDI_NOTEON 0x90
1008#define MIDI_KEY_PRESSURE 0xA0
1009
1010/*
1011 * Events for event type EV_CHN_COMMON
1012 */
1013
1014#define MIDI_CTL_CHANGE 0xB0
1015#define MIDI_PGM_CHANGE 0xC0
1016#define MIDI_CHN_PRESSURE 0xD0
1017#define MIDI_PITCH_BEND 0xE0
1018
1019#define MIDI_SYSTEM_PREFIX 0xF0
1020
1021/*
1022 * Timer event types
1023 */
1024#define TMR_WAIT_REL 1 /* Time relative to the prev time */
1025#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
1026#define TMR_STOP 3
1027#define TMR_START 4
1028#define TMR_CONTINUE 5
1029#define TMR_TEMPO 6
1030#define TMR_ECHO 8
1031#define TMR_CLOCK 9 /* MIDI clock */
1032#define TMR_SPP 10 /* Song position pointer */
1033#define TMR_TIMESIG 11 /* Time signature */
1034
1035/*
1036 * Local event types
1037 */
1038#define LOCL_STARTAUDIO 1
1039
1040#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
1041/*
1042 * Some convenience macros to simplify programming of the
1043 * /dev/sequencer interface
1044 *
1045 * This is a legacy interface for applications written against
1046 * the OSSlib-3.8 style interface. It is no longer possible
1047 * to actually link against OSSlib with this header, but we
1048 * still provide these macros for programs using them.
1049 *
1050 * If you want to use OSSlib, it is recommended that you get
1051 * the GPL version of OSS-4.x and build against that version
1052 * of the header.
1053 *
1054 * We redefine the extern keyword so that make headers_check
1055 * does not complain about SEQ_USE_EXTBUF.
1056 */
1057#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
1058
1059void seqbuf_dump(void); /* This function must be provided by programs */
1060
1061#define SEQ_PM_DEFINES int __foo_bar___
1062
1063#define SEQ_LOAD_GMINSTR(dev, instr)
1064#define SEQ_LOAD_GMDRUM(dev, drum)
1065
1066#define _SEQ_EXTERN extern
1067#define SEQ_USE_EXTBUF() \
1068 _SEQ_EXTERN unsigned char _seqbuf[]; \
1069 _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
1070
1071#ifndef USE_SIMPLE_MACROS
1072/* Sample seqbuf_dump() implementation:
1073 *
1074 * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
1075 *
1076 * int seqfd; -- The file descriptor for /dev/sequencer.
1077 *
1078 * void
1079 * seqbuf_dump ()
1080 * {
1081 * if (_seqbufptr)
1082 * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
1083 * {
1084 * perror ("write /dev/sequencer");
1085 * exit (-1);
1086 * }
1087 * _seqbufptr = 0;
1088 * }
1089 */
1090
1091#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
1092#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
1093#define _SEQ_ADVBUF(len) _seqbufptr += len
1094#define SEQ_DUMPBUF seqbuf_dump
1095#else
1096/*
1097 * This variation of the sequencer macros is used just to format one event
1098 * using fixed buffer.
1099 *
1100 * The program using the macro library must define the following macros before
1101 * using this library.
1102 *
1103 * #define _seqbuf name of the buffer (unsigned char[])
1104 * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
1105 * size of the event, this macro can be used.
1106 * Otherwise this must be defined as empty.
1107 * #define _seqbufptr Define the name of index variable or 0 if
1108 * not required.
1109 */
1110#define _SEQ_NEEDBUF(len) /* empty */
1111#endif
1112
1113#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
1114 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1115 _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
1116 _seqbuf[_seqbufptr+2] = (dev);\
1117 _seqbuf[_seqbufptr+3] = (mode);\
1118 _seqbuf[_seqbufptr+4] = 0;\
1119 _seqbuf[_seqbufptr+5] = 0;\
1120 _seqbuf[_seqbufptr+6] = 0;\
1121 _seqbuf[_seqbufptr+7] = 0;\
1122 _SEQ_ADVBUF(8);}
1123
1124/*
1125 * Midi voice messages
1126 */
1127
1128#define _CHN_VOICE(dev, event, chn, note, parm) \
1129 {_SEQ_NEEDBUF(8);\
1130 _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
1131 _seqbuf[_seqbufptr+1] = (dev);\
1132 _seqbuf[_seqbufptr+2] = (event);\
1133 _seqbuf[_seqbufptr+3] = (chn);\
1134 _seqbuf[_seqbufptr+4] = (note);\
1135 _seqbuf[_seqbufptr+5] = (parm);\
1136 _seqbuf[_seqbufptr+6] = (0);\
1137 _seqbuf[_seqbufptr+7] = 0;\
1138 _SEQ_ADVBUF(8);}
1139
1140#define SEQ_START_NOTE(dev, chn, note, vol) \
1141 _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
1142
1143#define SEQ_STOP_NOTE(dev, chn, note, vol) \
1144 _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
1145
1146#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
1147 _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
1148
1149/*
1150 * Midi channel messages
1151 */
1152
1153#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
1154 {_SEQ_NEEDBUF(8);\
1155 _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
1156 _seqbuf[_seqbufptr+1] = (dev);\
1157 _seqbuf[_seqbufptr+2] = (event);\
1158 _seqbuf[_seqbufptr+3] = (chn);\
1159 _seqbuf[_seqbufptr+4] = (p1);\
1160 _seqbuf[_seqbufptr+5] = (p2);\
1161 *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
1162 _SEQ_ADVBUF(8);}
1163/*
1164 * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
1165 * sending any MIDI bytes but it's absolutely not possible. Trying to do
1166 * so _will_ cause problems with MPU401 intelligent mode).
1167 *
1168 * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
1169 * sent by calling SEQ_SYSEX() several times (there must be no other events
1170 * between them). First sysex fragment must have 0xf0 in the first byte
1171 * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
1172 * between these sysex start and end markers cannot be larger than 0x7f. Also
1173 * lengths of each fragments (except the last one) must be 6.
1174 *
1175 * Breaking the above rules may work with some MIDI ports but is likely to
1176 * cause fatal problems with some other devices (such as MPU401).
1177 */
1178#define SEQ_SYSEX(dev, buf, len) \
1179 {int ii, ll=(len); \
1180 unsigned char *bufp=buf;\
1181 if (ll>6)ll=6;\
1182 _SEQ_NEEDBUF(8);\
1183 _seqbuf[_seqbufptr] = EV_SYSEX;\
1184 _seqbuf[_seqbufptr+1] = (dev);\
1185 for(ii=0;ii<ll;ii++)\
1186 _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
1187 for(ii=ll;ii<6;ii++)\
1188 _seqbuf[_seqbufptr+ii+2] = 0xff;\
1189 _SEQ_ADVBUF(8);}
1190
1191#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
1192 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
1193
1194#define SEQ_SET_PATCH SEQ_PGM_CHANGE
1195#define SEQ_PGM_CHANGE(dev, chn, patch) \
1196 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
1197
1198#define SEQ_CONTROL(dev, chn, controller, value) \
1199 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
1200
1201#define SEQ_BENDER(dev, chn, value) \
1202 _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
1203
1204
1205#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
1206 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1207 _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
1208 _seqbuf[_seqbufptr+2] = (dev);\
1209 _seqbuf[_seqbufptr+3] = (voice);\
1210 _seqbuf[_seqbufptr+4] = (controller);\
1211 _seqbuf[_seqbufptr+5] = ((value)&0xff);\
1212 _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
1213 _seqbuf[_seqbufptr+7] = 0;\
1214 _SEQ_ADVBUF(8);}
1215/*
1216 * The following 5 macros are incorrectly implemented and obsolete.
1217 * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
1218 */
1219#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
1220#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
1221#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
1222#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
1223#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
1224
1225/*
1226 * Timing and synchronization macros
1227 */
1228
1229#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1230 _seqbuf[_seqbufptr+0] = EV_TIMING; \
1231 _seqbuf[_seqbufptr+1] = (ev); \
1232 _seqbuf[_seqbufptr+2] = 0;\
1233 _seqbuf[_seqbufptr+3] = 0;\
1234 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1235 _SEQ_ADVBUF(8);}
1236
1237#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
1238#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
1239#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
1240#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
1241#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
1242#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
1243#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
1244#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
1245#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
1246
1247/*
1248 * Local control events
1249 */
1250
1251#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1252 _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
1253 _seqbuf[_seqbufptr+1] = (ev); \
1254 _seqbuf[_seqbufptr+2] = 0;\
1255 _seqbuf[_seqbufptr+3] = 0;\
1256 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1257 _SEQ_ADVBUF(8);}
1258
1259#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
1260/*
1261 * Events for the level 1 interface only
1262 */
1263
1264#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
1265 _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
1266 _seqbuf[_seqbufptr+1] = (byte);\
1267 _seqbuf[_seqbufptr+2] = (device);\
1268 _seqbuf[_seqbufptr+3] = 0;\
1269 _SEQ_ADVBUF(4);}
1270
1271/*
1272 * Patch loading.
1273 */
1274#define SEQ_WRPATCH(patchx, len) \
1275 {if (_seqbufptr) SEQ_DUMPBUF();\
1276 if (write(seqfd, (char*)(patchx), len)==-1) \
1277 perror("Write patch: /dev/sequencer");}
1278#define SEQ_WRPATCH2(patchx, len) \
1279 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
1280
1281#endif
1282#endif /* _UAPISOUNDCARD_H */
diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
new file mode 100644
index 00000000000..7fec7e36d92
--- /dev/null
+++ b/include/uapi/linux/stat.h
@@ -0,0 +1,45 @@
1#ifndef _UAPI_LINUX_STAT_H
2#define _UAPI_LINUX_STAT_H
3
4
5#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
6
7#define S_IFMT 00170000
8#define S_IFSOCK 0140000
9#define S_IFLNK 0120000
10#define S_IFREG 0100000
11#define S_IFBLK 0060000
12#define S_IFDIR 0040000
13#define S_IFCHR 0020000
14#define S_IFIFO 0010000
15#define S_ISUID 0004000
16#define S_ISGID 0002000
17#define S_ISVTX 0001000
18
19#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
20#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
21#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
22#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
23#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
24#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
25#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
26
27#define S_IRWXU 00700
28#define S_IRUSR 00400
29#define S_IWUSR 00200
30#define S_IXUSR 00100
31
32#define S_IRWXG 00070
33#define S_IRGRP 00040
34#define S_IWGRP 00020
35#define S_IXGRP 00010
36
37#define S_IRWXO 00007
38#define S_IROTH 00004
39#define S_IWOTH 00002
40#define S_IXOTH 00001
41
42#endif
43
44
45#endif /* _UAPI_LINUX_STAT_H */
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
new file mode 100644
index 00000000000..aa9f1042874
--- /dev/null
+++ b/include/uapi/linux/stddef.h
@@ -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
index 00000000000..e32e545cff5
--- /dev/null
+++ b/include/uapi/linux/string.h
@@ -0,0 +1,9 @@
1#ifndef _UAPI_LINUX_STRING_H_
2#define _UAPI_LINUX_STRING_H_
3
4/* We don't want strings.h stuff being used by user stuff by accident */
5
6#ifndef __KERNEL__
7#include <string.h>
8#endif /* __KERNEL__ */
9#endif /* _UAPI_LINUX_STRING_H_ */
diff --git a/include/linux/suspend_ioctls.h b/include/uapi/linux/suspend_ioctls.h
index 0b30382984f..0b30382984f 100644
--- a/include/linux/suspend_ioctls.h
+++ b/include/uapi/linux/suspend_ioctls.h
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
new file mode 100644
index 00000000000..e811474724c
--- /dev/null
+++ b/include/uapi/linux/swab.h
@@ -0,0 +1,282 @@
1#ifndef _UAPI_LINUX_SWAB_H
2#define _UAPI_LINUX_SWAB_H
3
4#include <linux/types.h>
5#include <linux/compiler.h>
6#include <asm/swab.h>
7
8/*
9 * casts are necessary for constants, because we never know how for sure
10 * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
11 */
12#define ___constant_swab16(x) ((__u16)( \
13 (((__u16)(x) & (__u16)0x00ffU) << 8) | \
14 (((__u16)(x) & (__u16)0xff00U) >> 8)))
15
16#define ___constant_swab32(x) ((__u32)( \
17 (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
18 (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
19 (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
20 (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
21
22#define ___constant_swab64(x) ((__u64)( \
23 (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
24 (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
25 (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
26 (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
27 (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
28 (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
29 (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
30 (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
31
32#define ___constant_swahw32(x) ((__u32)( \
33 (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
34 (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
35
36#define ___constant_swahb32(x) ((__u32)( \
37 (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
38 (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
39
40/*
41 * Implement the following as inlines, but define the interface using
42 * macros to allow constant folding when possible:
43 * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
44 */
45
46static inline __attribute_const__ __u16 __fswab16(__u16 val)
47{
48#ifdef __arch_swab16
49 return __arch_swab16(val);
50#else
51 return ___constant_swab16(val);
52#endif
53}
54
55static inline __attribute_const__ __u32 __fswab32(__u32 val)
56{
57#ifdef __arch_swab32
58 return __arch_swab32(val);
59#else
60 return ___constant_swab32(val);
61#endif
62}
63
64static inline __attribute_const__ __u64 __fswab64(__u64 val)
65{
66#ifdef __arch_swab64
67 return __arch_swab64(val);
68#elif defined(__SWAB_64_THRU_32__)
69 __u32 h = val >> 32;
70 __u32 l = val & ((1ULL << 32) - 1);
71 return (((__u64)__fswab32(l)) << 32) | ((__u64)(__fswab32(h)));
72#else
73 return ___constant_swab64(val);
74#endif
75}
76
77static inline __attribute_const__ __u32 __fswahw32(__u32 val)
78{
79#ifdef __arch_swahw32
80 return __arch_swahw32(val);
81#else
82 return ___constant_swahw32(val);
83#endif
84}
85
86static inline __attribute_const__ __u32 __fswahb32(__u32 val)
87{
88#ifdef __arch_swahb32
89 return __arch_swahb32(val);
90#else
91 return ___constant_swahb32(val);
92#endif
93}
94
95/**
96 * __swab16 - return a byteswapped 16-bit value
97 * @x: value to byteswap
98 */
99#define __swab16(x) \
100 (__builtin_constant_p((__u16)(x)) ? \
101 ___constant_swab16(x) : \
102 __fswab16(x))
103
104/**
105 * __swab32 - return a byteswapped 32-bit value
106 * @x: value to byteswap
107 */
108#define __swab32(x) \
109 (__builtin_constant_p((__u32)(x)) ? \
110 ___constant_swab32(x) : \
111 __fswab32(x))
112
113/**
114 * __swab64 - return a byteswapped 64-bit value
115 * @x: value to byteswap
116 */
117#define __swab64(x) \
118 (__builtin_constant_p((__u64)(x)) ? \
119 ___constant_swab64(x) : \
120 __fswab64(x))
121
122/**
123 * __swahw32 - return a word-swapped 32-bit value
124 * @x: value to wordswap
125 *
126 * __swahw32(0x12340000) is 0x00001234
127 */
128#define __swahw32(x) \
129 (__builtin_constant_p((__u32)(x)) ? \
130 ___constant_swahw32(x) : \
131 __fswahw32(x))
132
133/**
134 * __swahb32 - return a high and low byte-swapped 32-bit value
135 * @x: value to byteswap
136 *
137 * __swahb32(0x12345678) is 0x34127856
138 */
139#define __swahb32(x) \
140 (__builtin_constant_p((__u32)(x)) ? \
141 ___constant_swahb32(x) : \
142 __fswahb32(x))
143
144/**
145 * __swab16p - return a byteswapped 16-bit value from a pointer
146 * @p: pointer to a naturally-aligned 16-bit value
147 */
148static inline __u16 __swab16p(const __u16 *p)
149{
150#ifdef __arch_swab16p
151 return __arch_swab16p(p);
152#else
153 return __swab16(*p);
154#endif
155}
156
157/**
158 * __swab32p - return a byteswapped 32-bit value from a pointer
159 * @p: pointer to a naturally-aligned 32-bit value
160 */
161static inline __u32 __swab32p(const __u32 *p)
162{
163#ifdef __arch_swab32p
164 return __arch_swab32p(p);
165#else
166 return __swab32(*p);
167#endif
168}
169
170/**
171 * __swab64p - return a byteswapped 64-bit value from a pointer
172 * @p: pointer to a naturally-aligned 64-bit value
173 */
174static inline __u64 __swab64p(const __u64 *p)
175{
176#ifdef __arch_swab64p
177 return __arch_swab64p(p);
178#else
179 return __swab64(*p);
180#endif
181}
182
183/**
184 * __swahw32p - return a wordswapped 32-bit value from a pointer
185 * @p: pointer to a naturally-aligned 32-bit value
186 *
187 * See __swahw32() for details of wordswapping.
188 */
189static inline __u32 __swahw32p(const __u32 *p)
190{
191#ifdef __arch_swahw32p
192 return __arch_swahw32p(p);
193#else
194 return __swahw32(*p);
195#endif
196}
197
198/**
199 * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
200 * @p: pointer to a naturally-aligned 32-bit value
201 *
202 * See __swahb32() for details of high/low byteswapping.
203 */
204static inline __u32 __swahb32p(const __u32 *p)
205{
206#ifdef __arch_swahb32p
207 return __arch_swahb32p(p);
208#else
209 return __swahb32(*p);
210#endif
211}
212
213/**
214 * __swab16s - byteswap a 16-bit value in-place
215 * @p: pointer to a naturally-aligned 16-bit value
216 */
217static inline void __swab16s(__u16 *p)
218{
219#ifdef __arch_swab16s
220 __arch_swab16s(p);
221#else
222 *p = __swab16p(p);
223#endif
224}
225/**
226 * __swab32s - byteswap a 32-bit value in-place
227 * @p: pointer to a naturally-aligned 32-bit value
228 */
229static inline void __swab32s(__u32 *p)
230{
231#ifdef __arch_swab32s
232 __arch_swab32s(p);
233#else
234 *p = __swab32p(p);
235#endif
236}
237
238/**
239 * __swab64s - byteswap a 64-bit value in-place
240 * @p: pointer to a naturally-aligned 64-bit value
241 */
242static inline void __swab64s(__u64 *p)
243{
244#ifdef __arch_swab64s
245 __arch_swab64s(p);
246#else
247 *p = __swab64p(p);
248#endif
249}
250
251/**
252 * __swahw32s - wordswap a 32-bit value in-place
253 * @p: pointer to a naturally-aligned 32-bit value
254 *
255 * See __swahw32() for details of wordswapping
256 */
257static inline void __swahw32s(__u32 *p)
258{
259#ifdef __arch_swahw32s
260 __arch_swahw32s(p);
261#else
262 *p = __swahw32p(p);
263#endif
264}
265
266/**
267 * __swahb32s - high and low byteswap a 32-bit value in-place
268 * @p: pointer to a naturally-aligned 32-bit value
269 *
270 * See __swahb32() for details of high and low byte swapping
271 */
272static inline void __swahb32s(__u32 *p)
273{
274#ifdef __arch_swahb32s
275 __arch_swahb32s(p);
276#else
277 *p = __swahb32p(p);
278#endif
279}
280
281
282#endif /* _UAPI_LINUX_SWAB_H */
diff --git a/include/uapi/linux/synclink.h b/include/uapi/linux/synclink.h
new file mode 100644
index 00000000000..7dcb065a5f7
--- /dev/null
+++ b/include/uapi/linux/synclink.h
@@ -0,0 +1,300 @@
1/*
2 * SyncLink Multiprotocol Serial Adapter Driver
3 *
4 * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
5 *
6 * Copyright (C) 1998-2000 by Microgate Corporation
7 *
8 * Redistribution of this file is permitted under
9 * the terms of the GNU Public License (GPL)
10 */
11
12#ifndef _UAPI_SYNCLINK_H_
13#define _UAPI_SYNCLINK_H_
14#define SYNCLINK_H_VERSION 3.6
15
16#include <linux/types.h>
17
18#define BIT0 0x0001
19#define BIT1 0x0002
20#define BIT2 0x0004
21#define BIT3 0x0008
22#define BIT4 0x0010
23#define BIT5 0x0020
24#define BIT6 0x0040
25#define BIT7 0x0080
26#define BIT8 0x0100
27#define BIT9 0x0200
28#define BIT10 0x0400
29#define BIT11 0x0800
30#define BIT12 0x1000
31#define BIT13 0x2000
32#define BIT14 0x4000
33#define BIT15 0x8000
34#define BIT16 0x00010000
35#define BIT17 0x00020000
36#define BIT18 0x00040000
37#define BIT19 0x00080000
38#define BIT20 0x00100000
39#define BIT21 0x00200000
40#define BIT22 0x00400000
41#define BIT23 0x00800000
42#define BIT24 0x01000000
43#define BIT25 0x02000000
44#define BIT26 0x04000000
45#define BIT27 0x08000000
46#define BIT28 0x10000000
47#define BIT29 0x20000000
48#define BIT30 0x40000000
49#define BIT31 0x80000000
50
51
52#define HDLC_MAX_FRAME_SIZE 65535
53#define MAX_ASYNC_TRANSMIT 4096
54#define MAX_ASYNC_BUFFER_SIZE 4096
55
56#define ASYNC_PARITY_NONE 0
57#define ASYNC_PARITY_EVEN 1
58#define ASYNC_PARITY_ODD 2
59#define ASYNC_PARITY_SPACE 3
60
61#define HDLC_FLAG_UNDERRUN_ABORT7 0x0000
62#define HDLC_FLAG_UNDERRUN_ABORT15 0x0001
63#define HDLC_FLAG_UNDERRUN_FLAG 0x0002
64#define HDLC_FLAG_UNDERRUN_CRC 0x0004
65#define HDLC_FLAG_SHARE_ZERO 0x0010
66#define HDLC_FLAG_AUTO_CTS 0x0020
67#define HDLC_FLAG_AUTO_DCD 0x0040
68#define HDLC_FLAG_AUTO_RTS 0x0080
69#define HDLC_FLAG_RXC_DPLL 0x0100
70#define HDLC_FLAG_RXC_BRG 0x0200
71#define HDLC_FLAG_RXC_TXCPIN 0x8000
72#define HDLC_FLAG_RXC_RXCPIN 0x0000
73#define HDLC_FLAG_TXC_DPLL 0x0400
74#define HDLC_FLAG_TXC_BRG 0x0800
75#define HDLC_FLAG_TXC_TXCPIN 0x0000
76#define HDLC_FLAG_TXC_RXCPIN 0x0008
77#define HDLC_FLAG_DPLL_DIV8 0x1000
78#define HDLC_FLAG_DPLL_DIV16 0x2000
79#define HDLC_FLAG_DPLL_DIV32 0x0000
80#define HDLC_FLAG_HDLC_LOOPMODE 0x4000
81
82#define HDLC_CRC_NONE 0
83#define HDLC_CRC_16_CCITT 1
84#define HDLC_CRC_32_CCITT 2
85#define HDLC_CRC_MASK 0x00ff
86#define HDLC_CRC_RETURN_EX 0x8000
87
88#define RX_OK 0
89#define RX_CRC_ERROR 1
90
91#define HDLC_TXIDLE_FLAGS 0
92#define HDLC_TXIDLE_ALT_ZEROS_ONES 1
93#define HDLC_TXIDLE_ZEROS 2
94#define HDLC_TXIDLE_ONES 3
95#define HDLC_TXIDLE_ALT_MARK_SPACE 4
96#define HDLC_TXIDLE_SPACE 5
97#define HDLC_TXIDLE_MARK 6
98#define HDLC_TXIDLE_CUSTOM_8 0x10000000
99#define HDLC_TXIDLE_CUSTOM_16 0x20000000
100
101#define HDLC_ENCODING_NRZ 0
102#define HDLC_ENCODING_NRZB 1
103#define HDLC_ENCODING_NRZI_MARK 2
104#define HDLC_ENCODING_NRZI_SPACE 3
105#define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE
106#define HDLC_ENCODING_BIPHASE_MARK 4
107#define HDLC_ENCODING_BIPHASE_SPACE 5
108#define HDLC_ENCODING_BIPHASE_LEVEL 6
109#define HDLC_ENCODING_DIFF_BIPHASE_LEVEL 7
110
111#define HDLC_PREAMBLE_LENGTH_8BITS 0
112#define HDLC_PREAMBLE_LENGTH_16BITS 1
113#define HDLC_PREAMBLE_LENGTH_32BITS 2
114#define HDLC_PREAMBLE_LENGTH_64BITS 3
115
116#define HDLC_PREAMBLE_PATTERN_NONE 0
117#define HDLC_PREAMBLE_PATTERN_ZEROS 1
118#define HDLC_PREAMBLE_PATTERN_FLAGS 2
119#define HDLC_PREAMBLE_PATTERN_10 3
120#define HDLC_PREAMBLE_PATTERN_01 4
121#define HDLC_PREAMBLE_PATTERN_ONES 5
122
123#define MGSL_MODE_ASYNC 1
124#define MGSL_MODE_HDLC 2
125#define MGSL_MODE_MONOSYNC 3
126#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6
128#define MGSL_MODE_BASE_CLOCK 7
129#define MGSL_MODE_XSYNC 8
130
131#define MGSL_BUS_TYPE_ISA 1
132#define MGSL_BUS_TYPE_EISA 2
133#define MGSL_BUS_TYPE_PCI 5
134
135#define MGSL_INTERFACE_MASK 0xf
136#define MGSL_INTERFACE_DISABLE 0
137#define MGSL_INTERFACE_RS232 1
138#define MGSL_INTERFACE_V35 2
139#define MGSL_INTERFACE_RS422 3
140#define MGSL_INTERFACE_RTS_EN 0x10
141#define MGSL_INTERFACE_LL 0x20
142#define MGSL_INTERFACE_RL 0x40
143#define MGSL_INTERFACE_MSB_FIRST 0x80
144
145typedef struct _MGSL_PARAMS
146{
147 /* Common */
148
149 unsigned long mode; /* Asynchronous or HDLC */
150 unsigned char loopback; /* internal loopback mode */
151
152 /* HDLC Only */
153
154 unsigned short flags;
155 unsigned char encoding; /* NRZ, NRZI, etc. */
156 unsigned long clock_speed; /* external clock speed in bits per second */
157 unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */
158 unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */
159 unsigned char preamble_length;
160 unsigned char preamble;
161
162 /* Async Only */
163
164 unsigned long data_rate; /* bits per second */
165 unsigned char data_bits; /* 7 or 8 data bits */
166 unsigned char stop_bits; /* 1 or 2 stop bits */
167 unsigned char parity; /* none, even, or odd */
168
169} MGSL_PARAMS, *PMGSL_PARAMS;
170
171#define MICROGATE_VENDOR_ID 0x13c0
172#define SYNCLINK_DEVICE_ID 0x0010
173#define MGSCC_DEVICE_ID 0x0020
174#define SYNCLINK_SCA_DEVICE_ID 0x0030
175#define SYNCLINK_GT_DEVICE_ID 0x0070
176#define SYNCLINK_GT4_DEVICE_ID 0x0080
177#define SYNCLINK_AC_DEVICE_ID 0x0090
178#define SYNCLINK_GT2_DEVICE_ID 0x00A0
179#define MGSL_MAX_SERIAL_NUMBER 30
180
181/*
182** device diagnostics status
183*/
184
185#define DiagStatus_OK 0
186#define DiagStatus_AddressFailure 1
187#define DiagStatus_AddressConflict 2
188#define DiagStatus_IrqFailure 3
189#define DiagStatus_IrqConflict 4
190#define DiagStatus_DmaFailure 5
191#define DiagStatus_DmaConflict 6
192#define DiagStatus_PciAdapterNotFound 7
193#define DiagStatus_CantAssignPciResources 8
194#define DiagStatus_CantAssignPciMemAddr 9
195#define DiagStatus_CantAssignPciIoAddr 10
196#define DiagStatus_CantAssignPciIrq 11
197#define DiagStatus_MemoryError 12
198
199#define SerialSignal_DCD 0x01 /* Data Carrier Detect */
200#define SerialSignal_TXD 0x02 /* Transmit Data */
201#define SerialSignal_RI 0x04 /* Ring Indicator */
202#define SerialSignal_RXD 0x08 /* Receive Data */
203#define SerialSignal_CTS 0x10 /* Clear to Send */
204#define SerialSignal_RTS 0x20 /* Request to Send */
205#define SerialSignal_DSR 0x40 /* Data Set Ready */
206#define SerialSignal_DTR 0x80 /* Data Terminal Ready */
207
208
209/*
210 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
211 */
212struct mgsl_icount {
213 __u32 cts, dsr, rng, dcd, tx, rx;
214 __u32 frame, parity, overrun, brk;
215 __u32 buf_overrun;
216 __u32 txok;
217 __u32 txunder;
218 __u32 txabort;
219 __u32 txtimeout;
220 __u32 rxshort;
221 __u32 rxlong;
222 __u32 rxabort;
223 __u32 rxover;
224 __u32 rxcrc;
225 __u32 rxok;
226 __u32 exithunt;
227 __u32 rxidle;
228};
229
230struct gpio_desc {
231 __u32 state;
232 __u32 smask;
233 __u32 dir;
234 __u32 dmask;
235};
236
237#define DEBUG_LEVEL_DATA 1
238#define DEBUG_LEVEL_ERROR 2
239#define DEBUG_LEVEL_INFO 3
240#define DEBUG_LEVEL_BH 4
241#define DEBUG_LEVEL_ISR 5
242
243/*
244** Event bit flags for use with MgslWaitEvent
245*/
246
247#define MgslEvent_DsrActive 0x0001
248#define MgslEvent_DsrInactive 0x0002
249#define MgslEvent_Dsr 0x0003
250#define MgslEvent_CtsActive 0x0004
251#define MgslEvent_CtsInactive 0x0008
252#define MgslEvent_Cts 0x000c
253#define MgslEvent_DcdActive 0x0010
254#define MgslEvent_DcdInactive 0x0020
255#define MgslEvent_Dcd 0x0030
256#define MgslEvent_RiActive 0x0040
257#define MgslEvent_RiInactive 0x0080
258#define MgslEvent_Ri 0x00c0
259#define MgslEvent_ExitHuntMode 0x0100
260#define MgslEvent_IdleReceived 0x0200
261
262/* Private IOCTL codes:
263 *
264 * MGSL_IOCSPARAMS set MGSL_PARAMS structure values
265 * MGSL_IOCGPARAMS get current MGSL_PARAMS structure values
266 * MGSL_IOCSTXIDLE set current transmit idle mode
267 * MGSL_IOCGTXIDLE get current transmit idle mode
268 * MGSL_IOCTXENABLE enable or disable transmitter
269 * MGSL_IOCRXENABLE enable or disable receiver
270 * MGSL_IOCTXABORT abort transmitting frame (HDLC)
271 * MGSL_IOCGSTATS return current statistics
272 * MGSL_IOCWAITEVENT wait for specified event to occur
273 * MGSL_LOOPTXDONE transmit in HDLC LoopMode done
274 * MGSL_IOCSIF set the serial interface type
275 * MGSL_IOCGIF get the serial interface type
276 */
277#define MGSL_MAGIC_IOC 'm'
278#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
279#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
280#define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC,2)
281#define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC,3)
282#define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC,4)
283#define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC,5)
284#define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC,6)
285#define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC,7)
286#define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC,8,int)
287#define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC,15)
288#define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9)
289#define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10)
290#define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11)
291#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
292#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
293#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
294#define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19)
295#define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20)
296#define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21)
297#define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22)
298
299
300#endif /* _UAPI_SYNCLINK_H_ */
diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
new file mode 100644
index 00000000000..6d6721341f4
--- /dev/null
+++ b/include/uapi/linux/sysctl.h
@@ -0,0 +1,932 @@
1/*
2 * sysctl.h: General linux system control interface
3 *
4 * Begun 24 March 1995, Stephen Tweedie
5 *
6 ****************************************************************
7 ****************************************************************
8 **
9 ** WARNING:
10 ** The values in this file are exported to user space via
11 ** the sysctl() binary interface. Do *NOT* change the
12 ** numbering of any existing values here, and do not change
13 ** any numbers within any one set of values. If you have to
14 ** redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface.
17 **
18 ****************************************************************
19 ****************************************************************
20 */
21
22#ifndef _UAPI_LINUX_SYSCTL_H
23#define _UAPI_LINUX_SYSCTL_H
24
25#include <linux/kernel.h>
26#include <linux/types.h>
27#include <linux/compiler.h>
28
29struct completion;
30
31#define CTL_MAXNAME 10 /* how many path components do we allow in a
32 call to sysctl? In other words, what is
33 the largest acceptable value for the nlen
34 member of a struct __sysctl_args to have? */
35
36struct __sysctl_args {
37 int __user *name;
38 int nlen;
39 void __user *oldval;
40 size_t __user *oldlenp;
41 void __user *newval;
42 size_t newlen;
43 unsigned long __unused[4];
44};
45
46/* Define sysctl names first */
47
48/* Top-level names: */
49
50enum
51{
52 CTL_KERN=1, /* General kernel info and control */
53 CTL_VM=2, /* VM management */
54 CTL_NET=3, /* Networking */
55 CTL_PROC=4, /* removal breaks strace(1) compilation */
56 CTL_FS=5, /* Filesystems */
57 CTL_DEBUG=6, /* Debugging */
58 CTL_DEV=7, /* Devices */
59 CTL_BUS=8, /* Busses */
60 CTL_ABI=9, /* Binary emulation */
61 CTL_CPU=10, /* CPU stuff (speed scaling, etc) */
62 CTL_ARLAN=254, /* arlan wireless driver */
63 CTL_S390DBF=5677, /* s390 debug */
64 CTL_SUNRPC=7249, /* sunrpc debug */
65 CTL_PM=9899, /* frv power management */
66 CTL_FRV=9898, /* frv specific sysctls */
67};
68
69/* CTL_BUS names: */
70enum
71{
72 CTL_BUS_ISA=1 /* ISA */
73};
74
75/* /proc/sys/fs/inotify/ */
76enum
77{
78 INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
79 INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
80 INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
81};
82
83/* CTL_KERN names: */
84enum
85{
86 KERN_OSTYPE=1, /* string: system version */
87 KERN_OSRELEASE=2, /* string: system release */
88 KERN_OSREV=3, /* int: system revision */
89 KERN_VERSION=4, /* string: compile time info */
90 KERN_SECUREMASK=5, /* struct: maximum rights mask */
91 KERN_PROF=6, /* table: profiling information */
92 KERN_NODENAME=7, /* string: hostname */
93 KERN_DOMAINNAME=8, /* string: domainname */
94
95 KERN_PANIC=15, /* int: panic timeout */
96 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
97
98 KERN_SPARC_REBOOT=21, /* reboot command on Sparc */
99 KERN_CTLALTDEL=22, /* int: allow ctl-alt-del to reboot */
100 KERN_PRINTK=23, /* struct: control printk logging parameters */
101 KERN_NAMETRANS=24, /* Name translation */
102 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
103 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
104 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
105 KERN_MODPROBE=28, /* string: modprobe path */
106 KERN_SG_BIG_BUFF=29, /* int: sg driver reserved buffer size */
107 KERN_ACCT=30, /* BSD process accounting parameters */
108 KERN_PPC_L2CR=31, /* l2cr register on PPC */
109
110 KERN_RTSIGNR=32, /* Number of rt sigs queued */
111 KERN_RTSIGMAX=33, /* Max queuable */
112
113 KERN_SHMMAX=34, /* long: Maximum shared memory segment */
114 KERN_MSGMAX=35, /* int: Maximum size of a messege */
115 KERN_MSGMNB=36, /* int: Maximum message queue size */
116 KERN_MSGPOOL=37, /* int: Maximum system message pool size */
117 KERN_SYSRQ=38, /* int: Sysreq enable */
118 KERN_MAX_THREADS=39, /* int: Maximum nr of threads in the system */
119 KERN_RANDOM=40, /* Random driver */
120 KERN_SHMALL=41, /* int: Maximum size of shared memory */
121 KERN_MSGMNI=42, /* int: msg queue identifiers */
122 KERN_SEM=43, /* struct: sysv semaphore limits */
123 KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
124 KERN_SHMMNI=45, /* int: shm array identifiers */
125 KERN_OVERFLOWUID=46, /* int: overflow UID */
126 KERN_OVERFLOWGID=47, /* int: overflow GID */
127 KERN_SHMPATH=48, /* string: path to shm fs */
128 KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */
129 KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
130 KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
131 KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
132 KERN_TAINTED=53, /* int: various kernel tainted flags */
133 KERN_CADPID=54, /* int: PID of the process to notify on CAD */
134 KERN_PIDMAX=55, /* int: PID # limit */
135 KERN_CORE_PATTERN=56, /* string: pattern for core-file names */
136 KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */
137 KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */
138 KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */
139 KERN_PRINTK_RATELIMIT=60, /* int: tune printk ratelimiting */
140 KERN_PRINTK_RATELIMIT_BURST=61, /* int: tune printk ratelimiting */
141 KERN_PTY=62, /* dir: pty driver */
142 KERN_NGROUPS_MAX=63, /* int: NGROUPS_MAX */
143 KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
144 KERN_HZ_TIMER=65, /* int: hz timer on or off */
145 KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
146 KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
147 KERN_RANDOMIZE=68, /* int: randomize virtual address space */
148 KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
149 KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
150 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
151 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
152 KERN_COMPAT_LOG=73, /* int: print compat layer messages */
153 KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
154 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
155 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
156};
157
158
159
160/* CTL_VM names: */
161enum
162{
163 VM_UNUSED1=1, /* was: struct: Set vm swapping control */
164 VM_UNUSED2=2, /* was; int: Linear or sqrt() swapout for hogs */
165 VM_UNUSED3=3, /* was: struct: Set free page thresholds */
166 VM_UNUSED4=4, /* Spare */
167 VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */
168 VM_UNUSED5=6, /* was: struct: Set buffer memory thresholds */
169 VM_UNUSED7=7, /* was: struct: Set cache memory thresholds */
170 VM_UNUSED8=8, /* was: struct: Control kswapd behaviour */
171 VM_UNUSED9=9, /* was: struct: Set page table cache parameters */
172 VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
173 VM_DIRTY_BACKGROUND=11, /* dirty_background_ratio */
174 VM_DIRTY_RATIO=12, /* dirty_ratio */
175 VM_DIRTY_WB_CS=13, /* dirty_writeback_centisecs */
176 VM_DIRTY_EXPIRE_CS=14, /* dirty_expire_centisecs */
177 VM_NR_PDFLUSH_THREADS=15, /* nr_pdflush_threads */
178 VM_OVERCOMMIT_RATIO=16, /* percent of RAM to allow overcommit in */
179 VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
180 VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */
181 VM_SWAPPINESS=19, /* Tendency to steal mapped memory */
182 VM_LOWMEM_RESERVE_RATIO=20,/* reservation ratio for lower memory zones */
183 VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */
184 VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */
185 VM_LAPTOP_MODE=23, /* vm laptop mode */
186 VM_BLOCK_DUMP=24, /* block dump mode */
187 VM_HUGETLB_GROUP=25, /* permitted hugetlb group */
188 VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
189 VM_LEGACY_VA_LAYOUT=27, /* legacy/compatibility virtual address space layout */
190 VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */
191 VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */
192 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
193 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
194 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
195 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
196 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
197 VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */
198};
199
200
201/* CTL_NET names: */
202enum
203{
204 NET_CORE=1,
205 NET_ETHER=2,
206 NET_802=3,
207 NET_UNIX=4,
208 NET_IPV4=5,
209 NET_IPX=6,
210 NET_ATALK=7,
211 NET_NETROM=8,
212 NET_AX25=9,
213 NET_BRIDGE=10,
214 NET_ROSE=11,
215 NET_IPV6=12,
216 NET_X25=13,
217 NET_TR=14,
218 NET_DECNET=15,
219 NET_ECONET=16,
220 NET_SCTP=17,
221 NET_LLC=18,
222 NET_NETFILTER=19,
223 NET_DCCP=20,
224 NET_IRDA=412,
225};
226
227/* /proc/sys/kernel/random */
228enum
229{
230 RANDOM_POOLSIZE=1,
231 RANDOM_ENTROPY_COUNT=2,
232 RANDOM_READ_THRESH=3,
233 RANDOM_WRITE_THRESH=4,
234 RANDOM_BOOT_ID=5,
235 RANDOM_UUID=6
236};
237
238/* /proc/sys/kernel/pty */
239enum
240{
241 PTY_MAX=1,
242 PTY_NR=2
243};
244
245/* /proc/sys/bus/isa */
246enum
247{
248 BUS_ISA_MEM_BASE=1,
249 BUS_ISA_PORT_BASE=2,
250 BUS_ISA_PORT_SHIFT=3
251};
252
253/* /proc/sys/net/core */
254enum
255{
256 NET_CORE_WMEM_MAX=1,
257 NET_CORE_RMEM_MAX=2,
258 NET_CORE_WMEM_DEFAULT=3,
259 NET_CORE_RMEM_DEFAULT=4,
260/* was NET_CORE_DESTROY_DELAY */
261 NET_CORE_MAX_BACKLOG=6,
262 NET_CORE_FASTROUTE=7,
263 NET_CORE_MSG_COST=8,
264 NET_CORE_MSG_BURST=9,
265 NET_CORE_OPTMEM_MAX=10,
266 NET_CORE_HOT_LIST_LENGTH=11,
267 NET_CORE_DIVERT_VERSION=12,
268 NET_CORE_NO_CONG_THRESH=13,
269 NET_CORE_NO_CONG=14,
270 NET_CORE_LO_CONG=15,
271 NET_CORE_MOD_CONG=16,
272 NET_CORE_DEV_WEIGHT=17,
273 NET_CORE_SOMAXCONN=18,
274 NET_CORE_BUDGET=19,
275 NET_CORE_AEVENT_ETIME=20,
276 NET_CORE_AEVENT_RSEQTH=21,
277 NET_CORE_WARNINGS=22,
278};
279
280/* /proc/sys/net/ethernet */
281
282/* /proc/sys/net/802 */
283
284/* /proc/sys/net/unix */
285
286enum
287{
288 NET_UNIX_DESTROY_DELAY=1,
289 NET_UNIX_DELETE_DELAY=2,
290 NET_UNIX_MAX_DGRAM_QLEN=3,
291};
292
293/* /proc/sys/net/netfilter */
294enum
295{
296 NET_NF_CONNTRACK_MAX=1,
297 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
298 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
299 NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
300 NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
301 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
302 NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
303 NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
304 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
305 NET_NF_CONNTRACK_UDP_TIMEOUT=10,
306 NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
307 NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
308 NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
309 NET_NF_CONNTRACK_BUCKETS=14,
310 NET_NF_CONNTRACK_LOG_INVALID=15,
311 NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
312 NET_NF_CONNTRACK_TCP_LOOSE=17,
313 NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
314 NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
315 NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
316 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
317 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
318 NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
319 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
320 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
321 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
322 NET_NF_CONNTRACK_COUNT=27,
323 NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
324 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
325 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
326 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
327 NET_NF_CONNTRACK_CHECKSUM=32,
328};
329
330/* /proc/sys/net/ipv4 */
331enum
332{
333 /* v2.0 compatibile variables */
334 NET_IPV4_FORWARD=8,
335 NET_IPV4_DYNADDR=9,
336
337 NET_IPV4_CONF=16,
338 NET_IPV4_NEIGH=17,
339 NET_IPV4_ROUTE=18,
340 NET_IPV4_FIB_HASH=19,
341 NET_IPV4_NETFILTER=20,
342
343 NET_IPV4_TCP_TIMESTAMPS=33,
344 NET_IPV4_TCP_WINDOW_SCALING=34,
345 NET_IPV4_TCP_SACK=35,
346 NET_IPV4_TCP_RETRANS_COLLAPSE=36,
347 NET_IPV4_DEFAULT_TTL=37,
348 NET_IPV4_AUTOCONFIG=38,
349 NET_IPV4_NO_PMTU_DISC=39,
350 NET_IPV4_TCP_SYN_RETRIES=40,
351 NET_IPV4_IPFRAG_HIGH_THRESH=41,
352 NET_IPV4_IPFRAG_LOW_THRESH=42,
353 NET_IPV4_IPFRAG_TIME=43,
354 NET_IPV4_TCP_MAX_KA_PROBES=44,
355 NET_IPV4_TCP_KEEPALIVE_TIME=45,
356 NET_IPV4_TCP_KEEPALIVE_PROBES=46,
357 NET_IPV4_TCP_RETRIES1=47,
358 NET_IPV4_TCP_RETRIES2=48,
359 NET_IPV4_TCP_FIN_TIMEOUT=49,
360 NET_IPV4_IP_MASQ_DEBUG=50,
361 NET_TCP_SYNCOOKIES=51,
362 NET_TCP_STDURG=52,
363 NET_TCP_RFC1337=53,
364 NET_TCP_SYN_TAILDROP=54,
365 NET_TCP_MAX_SYN_BACKLOG=55,
366 NET_IPV4_LOCAL_PORT_RANGE=56,
367 NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
368 NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
369 NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
370 NET_IPV4_ICMP_DESTUNREACH_RATE=60,
371 NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
372 NET_IPV4_ICMP_PARAMPROB_RATE=62,
373 NET_IPV4_ICMP_ECHOREPLY_RATE=63,
374 NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
375 NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
376 NET_TCP_TW_RECYCLE=66,
377 NET_IPV4_ALWAYS_DEFRAG=67,
378 NET_IPV4_TCP_KEEPALIVE_INTVL=68,
379 NET_IPV4_INET_PEER_THRESHOLD=69,
380 NET_IPV4_INET_PEER_MINTTL=70,
381 NET_IPV4_INET_PEER_MAXTTL=71,
382 NET_IPV4_INET_PEER_GC_MINTIME=72,
383 NET_IPV4_INET_PEER_GC_MAXTIME=73,
384 NET_TCP_ORPHAN_RETRIES=74,
385 NET_TCP_ABORT_ON_OVERFLOW=75,
386 NET_TCP_SYNACK_RETRIES=76,
387 NET_TCP_MAX_ORPHANS=77,
388 NET_TCP_MAX_TW_BUCKETS=78,
389 NET_TCP_FACK=79,
390 NET_TCP_REORDERING=80,
391 NET_TCP_ECN=81,
392 NET_TCP_DSACK=82,
393 NET_TCP_MEM=83,
394 NET_TCP_WMEM=84,
395 NET_TCP_RMEM=85,
396 NET_TCP_APP_WIN=86,
397 NET_TCP_ADV_WIN_SCALE=87,
398 NET_IPV4_NONLOCAL_BIND=88,
399 NET_IPV4_ICMP_RATELIMIT=89,
400 NET_IPV4_ICMP_RATEMASK=90,
401 NET_TCP_TW_REUSE=91,
402 NET_TCP_FRTO=92,
403 NET_TCP_LOW_LATENCY=93,
404 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
405 NET_IPV4_IGMP_MAX_MSF=96,
406 NET_TCP_NO_METRICS_SAVE=97,
407 NET_TCP_DEFAULT_WIN_SCALE=105,
408 NET_TCP_MODERATE_RCVBUF=106,
409 NET_TCP_TSO_WIN_DIVISOR=107,
410 NET_TCP_BIC_BETA=108,
411 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
412 NET_TCP_CONG_CONTROL=110,
413 NET_TCP_ABC=111,
414 NET_IPV4_IPFRAG_MAX_DIST=112,
415 NET_TCP_MTU_PROBING=113,
416 NET_TCP_BASE_MSS=114,
417 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
418 NET_TCP_DMA_COPYBREAK=116,
419 NET_TCP_SLOW_START_AFTER_IDLE=117,
420 NET_CIPSOV4_CACHE_ENABLE=118,
421 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
422 NET_CIPSOV4_RBM_OPTFMT=120,
423 NET_CIPSOV4_RBM_STRICTVALID=121,
424 NET_TCP_AVAIL_CONG_CONTROL=122,
425 NET_TCP_ALLOWED_CONG_CONTROL=123,
426 NET_TCP_MAX_SSTHRESH=124,
427 NET_TCP_FRTO_RESPONSE=125,
428};
429
430enum {
431 NET_IPV4_ROUTE_FLUSH=1,
432 NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
433 NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
434 NET_IPV4_ROUTE_GC_THRESH=4,
435 NET_IPV4_ROUTE_MAX_SIZE=5,
436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
437 NET_IPV4_ROUTE_GC_TIMEOUT=7,
438 NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
439 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
442 NET_IPV4_ROUTE_ERROR_COST=12,
443 NET_IPV4_ROUTE_ERROR_BURST=13,
444 NET_IPV4_ROUTE_GC_ELASTICITY=14,
445 NET_IPV4_ROUTE_MTU_EXPIRES=15,
446 NET_IPV4_ROUTE_MIN_PMTU=16,
447 NET_IPV4_ROUTE_MIN_ADVMSS=17,
448 NET_IPV4_ROUTE_SECRET_INTERVAL=18,
449 NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
450};
451
452enum
453{
454 NET_PROTO_CONF_ALL=-2,
455 NET_PROTO_CONF_DEFAULT=-3
456
457 /* And device ifindices ... */
458};
459
460enum
461{
462 NET_IPV4_CONF_FORWARDING=1,
463 NET_IPV4_CONF_MC_FORWARDING=2,
464 NET_IPV4_CONF_PROXY_ARP=3,
465 NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
466 NET_IPV4_CONF_SECURE_REDIRECTS=5,
467 NET_IPV4_CONF_SEND_REDIRECTS=6,
468 NET_IPV4_CONF_SHARED_MEDIA=7,
469 NET_IPV4_CONF_RP_FILTER=8,
470 NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
471 NET_IPV4_CONF_BOOTP_RELAY=10,
472 NET_IPV4_CONF_LOG_MARTIANS=11,
473 NET_IPV4_CONF_TAG=12,
474 NET_IPV4_CONF_ARPFILTER=13,
475 NET_IPV4_CONF_MEDIUM_ID=14,
476 NET_IPV4_CONF_NOXFRM=15,
477 NET_IPV4_CONF_NOPOLICY=16,
478 NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
479 NET_IPV4_CONF_ARP_ANNOUNCE=18,
480 NET_IPV4_CONF_ARP_IGNORE=19,
481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
482 NET_IPV4_CONF_ARP_ACCEPT=21,
483 NET_IPV4_CONF_ARP_NOTIFY=22,
484};
485
486/* /proc/sys/net/ipv4/netfilter */
487enum
488{
489 NET_IPV4_NF_CONNTRACK_MAX=1,
490 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
491 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
492 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
493 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
494 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
495 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
496 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
497 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
498 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
499 NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
500 NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
501 NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
502 NET_IPV4_NF_CONNTRACK_BUCKETS=14,
503 NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
504 NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
505 NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
506 NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
507 NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
508 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
509 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
510 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
511 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
512 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
513 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
514 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
515 NET_IPV4_NF_CONNTRACK_COUNT=27,
516 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
517};
518
519/* /proc/sys/net/ipv6 */
520enum {
521 NET_IPV6_CONF=16,
522 NET_IPV6_NEIGH=17,
523 NET_IPV6_ROUTE=18,
524 NET_IPV6_ICMP=19,
525 NET_IPV6_BINDV6ONLY=20,
526 NET_IPV6_IP6FRAG_HIGH_THRESH=21,
527 NET_IPV6_IP6FRAG_LOW_THRESH=22,
528 NET_IPV6_IP6FRAG_TIME=23,
529 NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
530 NET_IPV6_MLD_MAX_MSF=25,
531};
532
533enum {
534 NET_IPV6_ROUTE_FLUSH=1,
535 NET_IPV6_ROUTE_GC_THRESH=2,
536 NET_IPV6_ROUTE_MAX_SIZE=3,
537 NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
538 NET_IPV6_ROUTE_GC_TIMEOUT=5,
539 NET_IPV6_ROUTE_GC_INTERVAL=6,
540 NET_IPV6_ROUTE_GC_ELASTICITY=7,
541 NET_IPV6_ROUTE_MTU_EXPIRES=8,
542 NET_IPV6_ROUTE_MIN_ADVMSS=9,
543 NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
544};
545
546enum {
547 NET_IPV6_FORWARDING=1,
548 NET_IPV6_HOP_LIMIT=2,
549 NET_IPV6_MTU=3,
550 NET_IPV6_ACCEPT_RA=4,
551 NET_IPV6_ACCEPT_REDIRECTS=5,
552 NET_IPV6_AUTOCONF=6,
553 NET_IPV6_DAD_TRANSMITS=7,
554 NET_IPV6_RTR_SOLICITS=8,
555 NET_IPV6_RTR_SOLICIT_INTERVAL=9,
556 NET_IPV6_RTR_SOLICIT_DELAY=10,
557 NET_IPV6_USE_TEMPADDR=11,
558 NET_IPV6_TEMP_VALID_LFT=12,
559 NET_IPV6_TEMP_PREFERED_LFT=13,
560 NET_IPV6_REGEN_MAX_RETRY=14,
561 NET_IPV6_MAX_DESYNC_FACTOR=15,
562 NET_IPV6_MAX_ADDRESSES=16,
563 NET_IPV6_FORCE_MLD_VERSION=17,
564 NET_IPV6_ACCEPT_RA_DEFRTR=18,
565 NET_IPV6_ACCEPT_RA_PINFO=19,
566 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
567 NET_IPV6_RTR_PROBE_INTERVAL=21,
568 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
569 NET_IPV6_PROXY_NDP=23,
570 NET_IPV6_ACCEPT_SOURCE_ROUTE=25,
571 __NET_IPV6_MAX
572};
573
574/* /proc/sys/net/ipv6/icmp */
575enum {
576 NET_IPV6_ICMP_RATELIMIT=1
577};
578
579/* /proc/sys/net/<protocol>/neigh/<dev> */
580enum {
581 NET_NEIGH_MCAST_SOLICIT=1,
582 NET_NEIGH_UCAST_SOLICIT=2,
583 NET_NEIGH_APP_SOLICIT=3,
584 NET_NEIGH_RETRANS_TIME=4,
585 NET_NEIGH_REACHABLE_TIME=5,
586 NET_NEIGH_DELAY_PROBE_TIME=6,
587 NET_NEIGH_GC_STALE_TIME=7,
588 NET_NEIGH_UNRES_QLEN=8,
589 NET_NEIGH_PROXY_QLEN=9,
590 NET_NEIGH_ANYCAST_DELAY=10,
591 NET_NEIGH_PROXY_DELAY=11,
592 NET_NEIGH_LOCKTIME=12,
593 NET_NEIGH_GC_INTERVAL=13,
594 NET_NEIGH_GC_THRESH1=14,
595 NET_NEIGH_GC_THRESH2=15,
596 NET_NEIGH_GC_THRESH3=16,
597 NET_NEIGH_RETRANS_TIME_MS=17,
598 NET_NEIGH_REACHABLE_TIME_MS=18,
599};
600
601/* /proc/sys/net/dccp */
602enum {
603 NET_DCCP_DEFAULT=1,
604};
605
606/* /proc/sys/net/ipx */
607enum {
608 NET_IPX_PPROP_BROADCASTING=1,
609 NET_IPX_FORWARDING=2
610};
611
612/* /proc/sys/net/llc */
613enum {
614 NET_LLC2=1,
615 NET_LLC_STATION=2,
616};
617
618/* /proc/sys/net/llc/llc2 */
619enum {
620 NET_LLC2_TIMEOUT=1,
621};
622
623/* /proc/sys/net/llc/station */
624enum {
625 NET_LLC_STATION_ACK_TIMEOUT=1,
626};
627
628/* /proc/sys/net/llc/llc2/timeout */
629enum {
630 NET_LLC2_ACK_TIMEOUT=1,
631 NET_LLC2_P_TIMEOUT=2,
632 NET_LLC2_REJ_TIMEOUT=3,
633 NET_LLC2_BUSY_TIMEOUT=4,
634};
635
636/* /proc/sys/net/appletalk */
637enum {
638 NET_ATALK_AARP_EXPIRY_TIME=1,
639 NET_ATALK_AARP_TICK_TIME=2,
640 NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
641 NET_ATALK_AARP_RESOLVE_TIME=4
642};
643
644
645/* /proc/sys/net/netrom */
646enum {
647 NET_NETROM_DEFAULT_PATH_QUALITY=1,
648 NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
649 NET_NETROM_NETWORK_TTL_INITIALISER=3,
650 NET_NETROM_TRANSPORT_TIMEOUT=4,
651 NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
652 NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
653 NET_NETROM_TRANSPORT_BUSY_DELAY=7,
654 NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
655 NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
656 NET_NETROM_ROUTING_CONTROL=10,
657 NET_NETROM_LINK_FAILS_COUNT=11,
658 NET_NETROM_RESET=12
659};
660
661/* /proc/sys/net/ax25 */
662enum {
663 NET_AX25_IP_DEFAULT_MODE=1,
664 NET_AX25_DEFAULT_MODE=2,
665 NET_AX25_BACKOFF_TYPE=3,
666 NET_AX25_CONNECT_MODE=4,
667 NET_AX25_STANDARD_WINDOW=5,
668 NET_AX25_EXTENDED_WINDOW=6,
669 NET_AX25_T1_TIMEOUT=7,
670 NET_AX25_T2_TIMEOUT=8,
671 NET_AX25_T3_TIMEOUT=9,
672 NET_AX25_IDLE_TIMEOUT=10,
673 NET_AX25_N2=11,
674 NET_AX25_PACLEN=12,
675 NET_AX25_PROTOCOL=13,
676 NET_AX25_DAMA_SLAVE_TIMEOUT=14
677};
678
679/* /proc/sys/net/rose */
680enum {
681 NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
682 NET_ROSE_CALL_REQUEST_TIMEOUT=2,
683 NET_ROSE_RESET_REQUEST_TIMEOUT=3,
684 NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
685 NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
686 NET_ROSE_ROUTING_CONTROL=6,
687 NET_ROSE_LINK_FAIL_TIMEOUT=7,
688 NET_ROSE_MAX_VCS=8,
689 NET_ROSE_WINDOW_SIZE=9,
690 NET_ROSE_NO_ACTIVITY_TIMEOUT=10
691};
692
693/* /proc/sys/net/x25 */
694enum {
695 NET_X25_RESTART_REQUEST_TIMEOUT=1,
696 NET_X25_CALL_REQUEST_TIMEOUT=2,
697 NET_X25_RESET_REQUEST_TIMEOUT=3,
698 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
699 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
700 NET_X25_FORWARD=6
701};
702
703/* /proc/sys/net/token-ring */
704enum
705{
706 NET_TR_RIF_TIMEOUT=1
707};
708
709/* /proc/sys/net/decnet/ */
710enum {
711 NET_DECNET_NODE_TYPE = 1,
712 NET_DECNET_NODE_ADDRESS = 2,
713 NET_DECNET_NODE_NAME = 3,
714 NET_DECNET_DEFAULT_DEVICE = 4,
715 NET_DECNET_TIME_WAIT = 5,
716 NET_DECNET_DN_COUNT = 6,
717 NET_DECNET_DI_COUNT = 7,
718 NET_DECNET_DR_COUNT = 8,
719 NET_DECNET_DST_GC_INTERVAL = 9,
720 NET_DECNET_CONF = 10,
721 NET_DECNET_NO_FC_MAX_CWND = 11,
722 NET_DECNET_MEM = 12,
723 NET_DECNET_RMEM = 13,
724 NET_DECNET_WMEM = 14,
725 NET_DECNET_DEBUG_LEVEL = 255
726};
727
728/* /proc/sys/net/decnet/conf/<dev> */
729enum {
730 NET_DECNET_CONF_LOOPBACK = -2,
731 NET_DECNET_CONF_DDCMP = -3,
732 NET_DECNET_CONF_PPP = -4,
733 NET_DECNET_CONF_X25 = -5,
734 NET_DECNET_CONF_GRE = -6,
735 NET_DECNET_CONF_ETHER = -7
736
737 /* ... and ifindex of devices */
738};
739
740/* /proc/sys/net/decnet/conf/<dev>/ */
741enum {
742 NET_DECNET_CONF_DEV_PRIORITY = 1,
743 NET_DECNET_CONF_DEV_T1 = 2,
744 NET_DECNET_CONF_DEV_T2 = 3,
745 NET_DECNET_CONF_DEV_T3 = 4,
746 NET_DECNET_CONF_DEV_FORWARDING = 5,
747 NET_DECNET_CONF_DEV_BLKSIZE = 6,
748 NET_DECNET_CONF_DEV_STATE = 7
749};
750
751/* /proc/sys/net/sctp */
752enum {
753 NET_SCTP_RTO_INITIAL = 1,
754 NET_SCTP_RTO_MIN = 2,
755 NET_SCTP_RTO_MAX = 3,
756 NET_SCTP_RTO_ALPHA = 4,
757 NET_SCTP_RTO_BETA = 5,
758 NET_SCTP_VALID_COOKIE_LIFE = 6,
759 NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
760 NET_SCTP_PATH_MAX_RETRANS = 8,
761 NET_SCTP_MAX_INIT_RETRANSMITS = 9,
762 NET_SCTP_HB_INTERVAL = 10,
763 NET_SCTP_PRESERVE_ENABLE = 11,
764 NET_SCTP_MAX_BURST = 12,
765 NET_SCTP_ADDIP_ENABLE = 13,
766 NET_SCTP_PRSCTP_ENABLE = 14,
767 NET_SCTP_SNDBUF_POLICY = 15,
768 NET_SCTP_SACK_TIMEOUT = 16,
769 NET_SCTP_RCVBUF_POLICY = 17,
770};
771
772/* /proc/sys/net/bridge */
773enum {
774 NET_BRIDGE_NF_CALL_ARPTABLES = 1,
775 NET_BRIDGE_NF_CALL_IPTABLES = 2,
776 NET_BRIDGE_NF_CALL_IP6TABLES = 3,
777 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
778 NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
779};
780
781/* proc/sys/net/irda */
782enum {
783 NET_IRDA_DISCOVERY=1,
784 NET_IRDA_DEVNAME=2,
785 NET_IRDA_DEBUG=3,
786 NET_IRDA_FAST_POLL=4,
787 NET_IRDA_DISCOVERY_SLOTS=5,
788 NET_IRDA_DISCOVERY_TIMEOUT=6,
789 NET_IRDA_SLOT_TIMEOUT=7,
790 NET_IRDA_MAX_BAUD_RATE=8,
791 NET_IRDA_MIN_TX_TURN_TIME=9,
792 NET_IRDA_MAX_TX_DATA_SIZE=10,
793 NET_IRDA_MAX_TX_WINDOW=11,
794 NET_IRDA_MAX_NOREPLY_TIME=12,
795 NET_IRDA_WARN_NOREPLY_TIME=13,
796 NET_IRDA_LAP_KEEPALIVE_TIME=14,
797};
798
799
800/* CTL_FS names: */
801enum
802{
803 FS_NRINODE=1, /* int:current number of allocated inodes */
804 FS_STATINODE=2,
805 FS_MAXINODE=3, /* int:maximum number of inodes that can be allocated */
806 FS_NRDQUOT=4, /* int:current number of allocated dquots */
807 FS_MAXDQUOT=5, /* int:maximum number of dquots that can be allocated */
808 FS_NRFILE=6, /* int:current number of allocated filedescriptors */
809 FS_MAXFILE=7, /* int:maximum number of filedescriptors that can be allocated */
810 FS_DENTRY=8,
811 FS_NRSUPER=9, /* int:current number of allocated super_blocks */
812 FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
813 FS_OVERFLOWUID=11, /* int: overflow UID */
814 FS_OVERFLOWGID=12, /* int: overflow GID */
815 FS_LEASES=13, /* int: leases enabled */
816 FS_DIR_NOTIFY=14, /* int: directory notification enabled */
817 FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */
818 FS_DQSTATS=16, /* disc quota usage statistics and control */
819 FS_XFS=17, /* struct: control xfs parameters */
820 FS_AIO_NR=18, /* current system-wide number of aio requests */
821 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
822 FS_INOTIFY=20, /* inotify submenu */
823 FS_OCFS2=988, /* ocfs2 */
824};
825
826/* /proc/sys/fs/quota/ */
827enum {
828 FS_DQ_LOOKUPS = 1,
829 FS_DQ_DROPS = 2,
830 FS_DQ_READS = 3,
831 FS_DQ_WRITES = 4,
832 FS_DQ_CACHE_HITS = 5,
833 FS_DQ_ALLOCATED = 6,
834 FS_DQ_FREE = 7,
835 FS_DQ_SYNCS = 8,
836 FS_DQ_WARNINGS = 9,
837};
838
839/* CTL_DEBUG names: */
840
841/* CTL_DEV names: */
842enum {
843 DEV_CDROM=1,
844 DEV_HWMON=2,
845 DEV_PARPORT=3,
846 DEV_RAID=4,
847 DEV_MAC_HID=5,
848 DEV_SCSI=6,
849 DEV_IPMI=7,
850};
851
852/* /proc/sys/dev/cdrom */
853enum {
854 DEV_CDROM_INFO=1,
855 DEV_CDROM_AUTOCLOSE=2,
856 DEV_CDROM_AUTOEJECT=3,
857 DEV_CDROM_DEBUG=4,
858 DEV_CDROM_LOCK=5,
859 DEV_CDROM_CHECK_MEDIA=6
860};
861
862/* /proc/sys/dev/parport */
863enum {
864 DEV_PARPORT_DEFAULT=-3
865};
866
867/* /proc/sys/dev/raid */
868enum {
869 DEV_RAID_SPEED_LIMIT_MIN=1,
870 DEV_RAID_SPEED_LIMIT_MAX=2
871};
872
873/* /proc/sys/dev/parport/default */
874enum {
875 DEV_PARPORT_DEFAULT_TIMESLICE=1,
876 DEV_PARPORT_DEFAULT_SPINTIME=2
877};
878
879/* /proc/sys/dev/parport/parport n */
880enum {
881 DEV_PARPORT_SPINTIME=1,
882 DEV_PARPORT_BASE_ADDR=2,
883 DEV_PARPORT_IRQ=3,
884 DEV_PARPORT_DMA=4,
885 DEV_PARPORT_MODES=5,
886 DEV_PARPORT_DEVICES=6,
887 DEV_PARPORT_AUTOPROBE=16
888};
889
890/* /proc/sys/dev/parport/parport n/devices/ */
891enum {
892 DEV_PARPORT_DEVICES_ACTIVE=-3,
893};
894
895/* /proc/sys/dev/parport/parport n/devices/device n */
896enum {
897 DEV_PARPORT_DEVICE_TIMESLICE=1,
898};
899
900/* /proc/sys/dev/mac_hid */
901enum {
902 DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
903 DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
904 DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
905 DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
906 DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
907 DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
908};
909
910/* /proc/sys/dev/scsi */
911enum {
912 DEV_SCSI_LOGGING_LEVEL=1,
913};
914
915/* /proc/sys/dev/ipmi */
916enum {
917 DEV_IPMI_POWEROFF_POWERCYCLE=1,
918};
919
920/* /proc/sys/abi */
921enum
922{
923 ABI_DEFHANDLER_COFF=1, /* default handler for coff binaries */
924 ABI_DEFHANDLER_ELF=2, /* default handler for ELF binaries */
925 ABI_DEFHANDLER_LCALL7=3,/* default handler for procs using lcall7 */
926 ABI_DEFHANDLER_LIBCSO=4,/* default handler for an libc.so ELF interp */
927 ABI_TRACE=5, /* tracing flags */
928 ABI_FAKE_UTSNAME=6, /* fake target utsname information */
929};
930
931
932#endif /* _UAPI_LINUX_SYSCTL_H */
diff --git a/include/linux/sysinfo.h b/include/uapi/linux/sysinfo.h
index 934335a2252..934335a2252 100644
--- a/include/linux/sysinfo.h
+++ b/include/uapi/linux/sysinfo.h
diff --git a/include/linux/taskstats.h b/include/uapi/linux/taskstats.h
index 2466e550a41..2466e550a41 100644
--- a/include/linux/taskstats.h
+++ b/include/uapi/linux/taskstats.h
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
new file mode 100644
index 00000000000..c4b89a5cb7d
--- /dev/null
+++ b/include/uapi/linux/tcp.h
@@ -0,0 +1,225 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the TCP protocol.
7 *
8 * Version: @(#)tcp.h 1.0.2 04/28/93
9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17#ifndef _UAPI_LINUX_TCP_H
18#define _UAPI_LINUX_TCP_H
19
20#include <linux/types.h>
21#include <asm/byteorder.h>
22#include <linux/socket.h>
23
24struct tcphdr {
25 __be16 source;
26 __be16 dest;
27 __be32 seq;
28 __be32 ack_seq;
29#if defined(__LITTLE_ENDIAN_BITFIELD)
30 __u16 res1:4,
31 doff:4,
32 fin:1,
33 syn:1,
34 rst:1,
35 psh:1,
36 ack:1,
37 urg:1,
38 ece:1,
39 cwr:1;
40#elif defined(__BIG_ENDIAN_BITFIELD)
41 __u16 doff:4,
42 res1:4,
43 cwr:1,
44 ece:1,
45 urg:1,
46 ack:1,
47 psh:1,
48 rst:1,
49 syn:1,
50 fin:1;
51#else
52#error "Adjust your <asm/byteorder.h> defines"
53#endif
54 __be16 window;
55 __sum16 check;
56 __be16 urg_ptr;
57};
58
59/*
60 * The union cast uses a gcc extension to avoid aliasing problems
61 * (union is compatible to any of its members)
62 * This means this part of the code is -fstrict-aliasing safe now.
63 */
64union tcp_word_hdr {
65 struct tcphdr hdr;
66 __be32 words[5];
67};
68
69#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
70
71enum {
72 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
73 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
74 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
75 TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
76 TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
77 TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
78 TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
79 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
80 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
81 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
82};
83
84/*
85 * TCP general constants
86 */
87#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
88#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
89
90/* TCP socket options */
91#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
92#define TCP_MAXSEG 2 /* Limit MSS */
93#define TCP_CORK 3 /* Never send partially complete segments */
94#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
95#define TCP_KEEPINTVL 5 /* Interval between keepalives */
96#define TCP_KEEPCNT 6 /* Number of keepalives before death */
97#define TCP_SYNCNT 7 /* Number of SYN retransmits */
98#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
99#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
100#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
101#define TCP_INFO 11 /* Information about this connection. */
102#define TCP_QUICKACK 12 /* Block/reenable quick acks */
103#define TCP_CONGESTION 13 /* Congestion control algorithm */
104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
109#define TCP_REPAIR 19 /* TCP sock is under repair right now */
110#define TCP_REPAIR_QUEUE 20
111#define TCP_QUEUE_SEQ 21
112#define TCP_REPAIR_OPTIONS 22
113#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
114
115struct tcp_repair_opt {
116 __u32 opt_code;
117 __u32 opt_val;
118};
119
120enum {
121 TCP_NO_QUEUE,
122 TCP_RECV_QUEUE,
123 TCP_SEND_QUEUE,
124 TCP_QUEUES_NR,
125};
126
127/* for TCP_INFO socket option */
128#define TCPI_OPT_TIMESTAMPS 1
129#define TCPI_OPT_SACK 2
130#define TCPI_OPT_WSCALE 4
131#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
132#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
133
134enum tcp_ca_state {
135 TCP_CA_Open = 0,
136#define TCPF_CA_Open (1<<TCP_CA_Open)
137 TCP_CA_Disorder = 1,
138#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
139 TCP_CA_CWR = 2,
140#define TCPF_CA_CWR (1<<TCP_CA_CWR)
141 TCP_CA_Recovery = 3,
142#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
143 TCP_CA_Loss = 4
144#define TCPF_CA_Loss (1<<TCP_CA_Loss)
145};
146
147struct tcp_info {
148 __u8 tcpi_state;
149 __u8 tcpi_ca_state;
150 __u8 tcpi_retransmits;
151 __u8 tcpi_probes;
152 __u8 tcpi_backoff;
153 __u8 tcpi_options;
154 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
155
156 __u32 tcpi_rto;
157 __u32 tcpi_ato;
158 __u32 tcpi_snd_mss;
159 __u32 tcpi_rcv_mss;
160
161 __u32 tcpi_unacked;
162 __u32 tcpi_sacked;
163 __u32 tcpi_lost;
164 __u32 tcpi_retrans;
165 __u32 tcpi_fackets;
166
167 /* Times. */
168 __u32 tcpi_last_data_sent;
169 __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
170 __u32 tcpi_last_data_recv;
171 __u32 tcpi_last_ack_recv;
172
173 /* Metrics. */
174 __u32 tcpi_pmtu;
175 __u32 tcpi_rcv_ssthresh;
176 __u32 tcpi_rtt;
177 __u32 tcpi_rttvar;
178 __u32 tcpi_snd_ssthresh;
179 __u32 tcpi_snd_cwnd;
180 __u32 tcpi_advmss;
181 __u32 tcpi_reordering;
182
183 __u32 tcpi_rcv_rtt;
184 __u32 tcpi_rcv_space;
185
186 __u32 tcpi_total_retrans;
187};
188
189/* for TCP_MD5SIG socket option */
190#define TCP_MD5SIG_MAXKEYLEN 80
191
192struct tcp_md5sig {
193 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
194 __u16 __tcpm_pad1; /* zero */
195 __u16 tcpm_keylen; /* key length */
196 __u32 __tcpm_pad2; /* zero */
197 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
198};
199
200/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
201#define TCP_COOKIE_MIN 8 /* 64-bits */
202#define TCP_COOKIE_MAX 16 /* 128-bits */
203#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
204
205/* Flags for both getsockopt and setsockopt */
206#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
207#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
208 * supercedes everything. */
209
210/* Flags for getsockopt */
211#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
212#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
213
214/* TCP_COOKIE_TRANSACTIONS data */
215struct tcp_cookie_transactions {
216 __u16 tcpct_flags; /* see above */
217 __u8 __tcpct_pad1; /* zero */
218 __u8 tcpct_cookie_desired; /* bytes */
219 __u16 tcpct_s_data_desired; /* bytes of variable data */
220 __u16 tcpct_used; /* bytes in value */
221 __u8 tcpct_value[TCP_MSS_DEFAULT];
222};
223
224
225#endif /* _UAPI_LINUX_TCP_H */
diff --git a/include/linux/tcp_metrics.h b/include/uapi/linux/tcp_metrics.h
index cb5157b55f3..cb5157b55f3 100644
--- a/include/linux/tcp_metrics.h
+++ b/include/uapi/linux/tcp_metrics.h
diff --git a/include/linux/telephony.h b/include/uapi/linux/telephony.h
index f63afe330ad..f63afe330ad 100644
--- a/include/linux/telephony.h
+++ b/include/uapi/linux/telephony.h
diff --git a/include/linux/termios.h b/include/uapi/linux/termios.h
index 2acd0c1f8a2..2acd0c1f8a2 100644
--- a/include/linux/termios.h
+++ b/include/uapi/linux/termios.h
diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h
new file mode 100644
index 00000000000..0d3c0edc3ed
--- /dev/null
+++ b/include/uapi/linux/time.h
@@ -0,0 +1,71 @@
1#ifndef _UAPI_LINUX_TIME_H
2#define _UAPI_LINUX_TIME_H
3
4#include <linux/types.h>
5
6
7#ifndef _STRUCT_TIMESPEC
8#define _STRUCT_TIMESPEC
9struct timespec {
10 __kernel_time_t tv_sec; /* seconds */
11 long tv_nsec; /* nanoseconds */
12};
13#endif
14
15struct timeval {
16 __kernel_time_t tv_sec; /* seconds */
17 __kernel_suseconds_t tv_usec; /* microseconds */
18};
19
20struct timezone {
21 int tz_minuteswest; /* minutes west of Greenwich */
22 int tz_dsttime; /* type of dst correction */
23};
24
25
26/*
27 * Names of the interval timers, and structure
28 * defining a timer setting:
29 */
30#define ITIMER_REAL 0
31#define ITIMER_VIRTUAL 1
32#define ITIMER_PROF 2
33
34struct itimerspec {
35 struct timespec it_interval; /* timer period */
36 struct timespec it_value; /* timer expiration */
37};
38
39struct itimerval {
40 struct timeval it_interval; /* timer interval */
41 struct timeval it_value; /* current value */
42};
43
44/*
45 * The IDs of the various system clocks (for POSIX.1b interval timers):
46 */
47#define CLOCK_REALTIME 0
48#define CLOCK_MONOTONIC 1
49#define CLOCK_PROCESS_CPUTIME_ID 2
50#define CLOCK_THREAD_CPUTIME_ID 3
51#define CLOCK_MONOTONIC_RAW 4
52#define CLOCK_REALTIME_COARSE 5
53#define CLOCK_MONOTONIC_COARSE 6
54#define CLOCK_BOOTTIME 7
55#define CLOCK_REALTIME_ALARM 8
56#define CLOCK_BOOTTIME_ALARM 9
57
58/*
59 * The IDs of various hardware clocks:
60 */
61#define CLOCK_SGI_CYCLE 10
62#define MAX_CLOCKS 16
63#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
64#define CLOCKS_MONO CLOCK_MONOTONIC
65
66/*
67 * The various flags for setting POSIX.1b interval timers:
68 */
69#define TIMER_ABSTIME 0x01
70
71#endif /* _UAPI_LINUX_TIME_H */
diff --git a/include/linux/times.h b/include/uapi/linux/times.h
index 87b62615ced..87b62615ced 100644
--- a/include/linux/times.h
+++ b/include/uapi/linux/times.h
diff --git a/include/uapi/linux/timex.h b/include/uapi/linux/timex.h
new file mode 100644
index 00000000000..a7ea81f1371
--- /dev/null
+++ b/include/uapi/linux/timex.h
@@ -0,0 +1,166 @@
1/*****************************************************************************
2 * *
3 * Copyright (c) David L. Mills 1993 *
4 * *
5 * Permission to use, copy, modify, and distribute this software and its *
6 * documentation for any purpose and without fee is hereby granted, provided *
7 * that the above copyright notice appears in all copies and that both the *
8 * copyright notice and this permission notice appear in supporting *
9 * documentation, and that the name University of Delaware not be used in *
10 * advertising or publicity pertaining to distribution of the software *
11 * without specific, written prior permission. The University of Delaware *
12 * makes no representations about the suitability this software for any *
13 * purpose. It is provided "as is" without express or implied warranty. *
14 * *
15 *****************************************************************************/
16
17/*
18 * Modification history timex.h
19 *
20 * 29 Dec 97 Russell King
21 * Moved CLOCK_TICK_RATE, CLOCK_TICK_FACTOR and FINETUNE to asm/timex.h
22 * for ARM machines
23 *
24 * 9 Jan 97 Adrian Sun
25 * Shifted LATCH define to allow access to alpha machines.
26 *
27 * 26 Sep 94 David L. Mills
28 * Added defines for hybrid phase/frequency-lock loop.
29 *
30 * 19 Mar 94 David L. Mills
31 * Moved defines from kernel routines to header file and added new
32 * defines for PPS phase-lock loop.
33 *
34 * 20 Feb 94 David L. Mills
35 * Revised status codes and structures for external clock and PPS
36 * signal discipline.
37 *
38 * 28 Nov 93 David L. Mills
39 * Adjusted parameters to improve stability and increase poll
40 * interval.
41 *
42 * 17 Sep 93 David L. Mills
43 * Created file $NTP/include/sys/timex.h
44 * 07 Oct 93 Torsten Duwe
45 * Derived linux/timex.h
46 * 1995-08-13 Torsten Duwe
47 * kernel PLL updated to 1994-12-13 specs (rfc-1589)
48 * 1997-08-30 Ulrich Windl
49 * Added new constant NTP_PHASE_LIMIT
50 * 2004-08-12 Christoph Lameter
51 * Reworked time interpolation logic
52 */
53#ifndef _UAPI_LINUX_TIMEX_H
54#define _UAPI_LINUX_TIMEX_H
55
56#include <linux/time.h>
57
58#define NTP_API 4 /* NTP API version */
59
60/*
61 * syscall interface - used (mainly by NTP daemon)
62 * to discipline kernel clock oscillator
63 */
64struct timex {
65 unsigned int modes; /* mode selector */
66 long offset; /* time offset (usec) */
67 long freq; /* frequency offset (scaled ppm) */
68 long maxerror; /* maximum error (usec) */
69 long esterror; /* estimated error (usec) */
70 int status; /* clock command/status */
71 long constant; /* pll time constant */
72 long precision; /* clock precision (usec) (read only) */
73 long tolerance; /* clock frequency tolerance (ppm)
74 * (read only)
75 */
76 struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
77 long tick; /* (modified) usecs between clock ticks */
78
79 long ppsfreq; /* pps frequency (scaled ppm) (ro) */
80 long jitter; /* pps jitter (us) (ro) */
81 int shift; /* interval duration (s) (shift) (ro) */
82 long stabil; /* pps stability (scaled ppm) (ro) */
83 long jitcnt; /* jitter limit exceeded (ro) */
84 long calcnt; /* calibration intervals (ro) */
85 long errcnt; /* calibration errors (ro) */
86 long stbcnt; /* stability limit exceeded (ro) */
87
88 int tai; /* TAI offset (ro) */
89
90 int :32; int :32; int :32; int :32;
91 int :32; int :32; int :32; int :32;
92 int :32; int :32; int :32;
93};
94
95/*
96 * Mode codes (timex.mode)
97 */
98#define ADJ_OFFSET 0x0001 /* time offset */
99#define ADJ_FREQUENCY 0x0002 /* frequency offset */
100#define ADJ_MAXERROR 0x0004 /* maximum time error */
101#define ADJ_ESTERROR 0x0008 /* estimated time error */
102#define ADJ_STATUS 0x0010 /* clock status */
103#define ADJ_TIMECONST 0x0020 /* pll time constant */
104#define ADJ_TAI 0x0080 /* set TAI offset */
105#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
106#define ADJ_MICRO 0x1000 /* select microsecond resolution */
107#define ADJ_NANO 0x2000 /* select nanosecond resolution */
108#define ADJ_TICK 0x4000 /* tick value */
109
110#ifndef __KERNEL__
111#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
112#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
113#endif
114
115/* NTP userland likes the MOD_ prefix better */
116#define MOD_OFFSET ADJ_OFFSET
117#define MOD_FREQUENCY ADJ_FREQUENCY
118#define MOD_MAXERROR ADJ_MAXERROR
119#define MOD_ESTERROR ADJ_ESTERROR
120#define MOD_STATUS ADJ_STATUS
121#define MOD_TIMECONST ADJ_TIMECONST
122#define MOD_TAI ADJ_TAI
123#define MOD_MICRO ADJ_MICRO
124#define MOD_NANO ADJ_NANO
125
126
127/*
128 * Status codes (timex.status)
129 */
130#define STA_PLL 0x0001 /* enable PLL updates (rw) */
131#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
132#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
133#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
134
135#define STA_INS 0x0010 /* insert leap (rw) */
136#define STA_DEL 0x0020 /* delete leap (rw) */
137#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
138#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
139
140#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
141#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
142#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
143#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
144
145#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
146#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
147#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
148#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */
149
150/* read-only bits */
151#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
152 STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
153
154/*
155 * Clock states (time_state)
156 */
157#define TIME_OK 0 /* clock synchronized, no leap second */
158#define TIME_INS 1 /* insert leap second */
159#define TIME_DEL 2 /* delete leap second */
160#define TIME_OOP 3 /* leap second in progress */
161#define TIME_WAIT 4 /* leap second has occurred */
162#define TIME_ERROR 5 /* clock not synchronized */
163#define TIME_BAD TIME_ERROR /* bw compat */
164
165
166#endif /* _UAPI_LINUX_TIMEX_H */
diff --git a/include/linux/tiocl.h b/include/uapi/linux/tiocl.h
index 4756862c4ed..4756862c4ed 100644
--- a/include/linux/tiocl.h
+++ b/include/uapi/linux/tiocl.h
diff --git a/include/linux/tipc.h b/include/uapi/linux/tipc.h
index f2d90091cc2..f2d90091cc2 100644
--- a/include/linux/tipc.h
+++ b/include/uapi/linux/tipc.h
diff --git a/include/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 0b1e3f218a3..0b1e3f218a3 100644
--- a/include/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
diff --git a/include/uapi/linux/toshiba.h b/include/uapi/linux/toshiba.h
new file mode 100644
index 00000000000..e9bef5b2f91
--- /dev/null
+++ b/include/uapi/linux/toshiba.h
@@ -0,0 +1,37 @@
1/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops
2 *
3 * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
4 *
5 * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
6 * on making sure the structure is aligned and packed.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 */
19
20#ifndef _UAPI_LINUX_TOSHIBA_H
21#define _UAPI_LINUX_TOSHIBA_H
22
23#define TOSH_PROC "/proc/toshiba"
24#define TOSH_DEVICE "/dev/toshiba"
25#define TOSH_SMM _IOWR('t', 0x90, int) /* broken: meant 24 bytes */
26
27typedef struct {
28 unsigned int eax;
29 unsigned int ebx __attribute__ ((packed));
30 unsigned int ecx __attribute__ ((packed));
31 unsigned int edx __attribute__ ((packed));
32 unsigned int esi __attribute__ ((packed));
33 unsigned int edi __attribute__ ((packed));
34} SMMRegisters;
35
36
37#endif /* _UAPI_LINUX_TOSHIBA_H */
diff --git a/include/uapi/linux/tty.h b/include/uapi/linux/tty.h
new file mode 100644
index 00000000000..dac199a2dba
--- /dev/null
+++ b/include/uapi/linux/tty.h
@@ -0,0 +1,38 @@
1#ifndef _UAPI_LINUX_TTY_H
2#define _UAPI_LINUX_TTY_H
3
4/*
5 * 'tty.h' defines some structures used by tty_io.c and some defines.
6 */
7
8#define NR_LDISCS 30
9
10/* line disciplines */
11#define N_TTY 0
12#define N_SLIP 1
13#define N_MOUSE 2
14#define N_PPP 3
15#define N_STRIP 4
16#define N_AX25 5
17#define N_X25 6 /* X.25 async */
18#define N_6PACK 7
19#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
20#define N_R3964 9 /* Reserved for Simatic R3964 module */
21#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */
22#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
23#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data */
24 /* cards about SMS messages */
25#define N_HDLC 13 /* synchronous HDLC */
26#define N_SYNC_PPP 14 /* synchronous PPP */
27#define N_HCI 15 /* Bluetooth HCI UART */
28#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */
29#define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */
30#define N_PPS 18 /* Pulse per Second */
31#define N_V253 19 /* Codec control over voice modem */
32#define N_CAIF 20 /* CAIF protocol for talking to modems */
33#define N_GSM0710 21 /* GSM 0710 Mux */
34#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
35#define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */
36#define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */
37
38#endif /* _UAPI_LINUX_TTY_H */
diff --git a/include/linux/tty_flags.h b/include/uapi/linux/tty_flags.h
index eefcb483a2c..eefcb483a2c 100644
--- a/include/linux/tty_flags.h
+++ b/include/uapi/linux/tty_flags.h
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
new file mode 100644
index 00000000000..acf0979b790
--- /dev/null
+++ b/include/uapi/linux/types.h
@@ -0,0 +1,56 @@
1#ifndef _UAPI_LINUX_TYPES_H
2#define _UAPI_LINUX_TYPES_H
3
4#include <asm/types.h>
5
6#ifndef __ASSEMBLY__
7#ifndef __KERNEL__
8#ifndef __EXPORTED_HEADERS__
9#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
10#endif /* __EXPORTED_HEADERS__ */
11#endif
12
13#include <linux/posix_types.h>
14
15
16/*
17 * Below are truly Linux-specific types that should never collide with
18 * any application/library that wants linux/types.h.
19 */
20
21#ifdef __CHECKER__
22#define __bitwise__ __attribute__((bitwise))
23#else
24#define __bitwise__
25#endif
26#ifdef __CHECK_ENDIAN__
27#define __bitwise __bitwise__
28#else
29#define __bitwise
30#endif
31
32typedef __u16 __bitwise __le16;
33typedef __u16 __bitwise __be16;
34typedef __u32 __bitwise __le32;
35typedef __u32 __bitwise __be32;
36typedef __u64 __bitwise __le64;
37typedef __u64 __bitwise __be64;
38
39typedef __u16 __bitwise __sum16;
40typedef __u32 __bitwise __wsum;
41
42/*
43 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
44 * common 32/64-bit compat problems.
45 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
46 * architectures) and to 8-byte boundaries on 64-bit architectures. The new
47 * aligned_64 type enforces 8-byte alignment so that structs containing
48 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
49 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
50 */
51#define __aligned_u64 __u64 __attribute__((aligned(8)))
52#define __aligned_be64 __be64 __attribute__((aligned(8)))
53#define __aligned_le64 __le64 __attribute__((aligned(8)))
54
55#endif /* __ASSEMBLY__ */
56#endif /* _UAPI_LINUX_TYPES_H */
diff --git a/include/linux/udf_fs_i.h b/include/uapi/linux/udf_fs_i.h
index 3536965913b..3536965913b 100644
--- a/include/linux/udf_fs_i.h
+++ b/include/uapi/linux/udf_fs_i.h
diff --git a/include/uapi/linux/udp.h b/include/uapi/linux/udp.h
new file mode 100644
index 00000000000..e2bcfd75a30
--- /dev/null
+++ b/include/uapi/linux/udp.h
@@ -0,0 +1,39 @@
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Definitions for the UDP protocol.
7 *
8 * Version: @(#)udp.h 1.0.2 04/28/93
9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17#ifndef _UAPI_LINUX_UDP_H
18#define _UAPI_LINUX_UDP_H
19
20#include <linux/types.h>
21
22struct udphdr {
23 __be16 source;
24 __be16 dest;
25 __be16 len;
26 __sum16 check;
27};
28
29/* UDP socket options */
30#define UDP_CORK 1 /* Never send partially complete segments */
31#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */
32
33/* UDP encapsulation types */
34#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
36#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
37
38
39#endif /* _UAPI_LINUX_UDP_H */
diff --git a/include/linux/uhid.h b/include/uapi/linux/uhid.h
index 9c6974f1696..9c6974f1696 100644
--- a/include/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h
new file mode 100644
index 00000000000..fe46431593f
--- /dev/null
+++ b/include/uapi/linux/uinput.h
@@ -0,0 +1,137 @@
1/*
2 * User level driver support for input subsystem
3 *
4 * Heavily based on evdev.c by Vojtech Pavlik
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
21 *
22 * Changes/Revisions:
23 * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
24 * - update ff support for the changes in kernel interface
25 * - add UINPUT_VERSION
26 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
27 * - added force feedback support
28 * - added UI_SET_PHYS
29 * 0.1 20/06/2002
30 * - first public version
31 */
32#ifndef _UAPI__UINPUT_H_
33#define _UAPI__UINPUT_H_
34
35#include <linux/types.h>
36#include <linux/input.h>
37
38#define UINPUT_VERSION 3
39
40
41struct uinput_ff_upload {
42 __u32 request_id;
43 __s32 retval;
44 struct ff_effect effect;
45 struct ff_effect old;
46};
47
48struct uinput_ff_erase {
49 __u32 request_id;
50 __s32 retval;
51 __u32 effect_id;
52};
53
54/* ioctl */
55#define UINPUT_IOCTL_BASE 'U'
56#define UI_DEV_CREATE _IO(UINPUT_IOCTL_BASE, 1)
57#define UI_DEV_DESTROY _IO(UINPUT_IOCTL_BASE, 2)
58
59#define UI_SET_EVBIT _IOW(UINPUT_IOCTL_BASE, 100, int)
60#define UI_SET_KEYBIT _IOW(UINPUT_IOCTL_BASE, 101, int)
61#define UI_SET_RELBIT _IOW(UINPUT_IOCTL_BASE, 102, int)
62#define UI_SET_ABSBIT _IOW(UINPUT_IOCTL_BASE, 103, int)
63#define UI_SET_MSCBIT _IOW(UINPUT_IOCTL_BASE, 104, int)
64#define UI_SET_LEDBIT _IOW(UINPUT_IOCTL_BASE, 105, int)
65#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
66#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
67#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
68#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
69#define UI_SET_PROPBIT _IOW(UINPUT_IOCTL_BASE, 110, int)
70
71#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
72#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
73#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
74#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
75
76/*
77 * To write a force-feedback-capable driver, the upload_effect
78 * and erase_effect callbacks in input_dev must be implemented.
79 * The uinput driver will generate a fake input event when one of
80 * these callbacks are invoked. The userspace code then uses
81 * ioctls to retrieve additional parameters and send the return code.
82 * The callback blocks until this return code is sent.
83 *
84 * The described callback mechanism is only used if ff_effects_max
85 * is set.
86 *
87 * To implement upload_effect():
88 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
89 * A request ID will be given in 'value'.
90 * 2. Allocate a uinput_ff_upload struct, fill in request_id with
91 * the 'value' from the EV_UINPUT event.
92 * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
93 * uinput_ff_upload struct. It will be filled in with the
94 * ff_effects passed to upload_effect().
95 * 4. Perform the effect upload, and place a return code back into
96 the uinput_ff_upload struct.
97 * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
98 * uinput_ff_upload_effect struct. This will complete execution
99 * of our upload_effect() handler.
100 *
101 * To implement erase_effect():
102 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
103 * A request ID will be given in 'value'.
104 * 2. Allocate a uinput_ff_erase struct, fill in request_id with
105 * the 'value' from the EV_UINPUT event.
106 * 3. Issue a UI_BEGIN_FF_ERASE ioctl, giving it the
107 * uinput_ff_erase struct. It will be filled in with the
108 * effect ID passed to erase_effect().
109 * 4. Perform the effect erasure, and place a return code back
110 * into the uinput_ff_erase struct.
111 * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the
112 * uinput_ff_erase_effect struct. This will complete execution
113 * of our erase_effect() handler.
114 */
115
116/*
117 * This is the new event type, used only by uinput.
118 * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
119 * is the unique request ID. This number was picked
120 * arbitrarily, above EV_MAX (since the input system
121 * never sees it) but in the range of a 16-bit int.
122 */
123#define EV_UINPUT 0x0101
124#define UI_FF_UPLOAD 1
125#define UI_FF_ERASE 2
126
127#define UINPUT_MAX_NAME_SIZE 80
128struct uinput_user_dev {
129 char name[UINPUT_MAX_NAME_SIZE];
130 struct input_id id;
131 __u32 ff_effects_max;
132 __s32 absmax[ABS_CNT];
133 __s32 absmin[ABS_CNT];
134 __s32 absfuzz[ABS_CNT];
135 __s32 absflat[ABS_CNT];
136};
137#endif /* _UAPI__UINPUT_H_ */
diff --git a/include/uapi/linux/uio.h b/include/uapi/linux/uio.h
new file mode 100644
index 00000000000..2731d56a548
--- /dev/null
+++ b/include/uapi/linux/uio.h
@@ -0,0 +1,30 @@
1/*
2 * Berkeley style UIO structures - Alan Cox 1994.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#ifndef _UAPI__LINUX_UIO_H
10#define _UAPI__LINUX_UIO_H
11
12#include <linux/compiler.h>
13#include <linux/types.h>
14
15
16struct iovec
17{
18 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
20};
21
22/*
23 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
24 */
25
26#define UIO_FASTIOV 8
27#define UIO_MAXIOV 1024
28
29
30#endif /* _UAPI__LINUX_UIO_H */
diff --git a/include/linux/ultrasound.h b/include/uapi/linux/ultrasound.h
index 71339dc531c..71339dc531c 100644
--- a/include/linux/ultrasound.h
+++ b/include/uapi/linux/ultrasound.h
diff --git a/include/linux/un.h b/include/uapi/linux/un.h
index 3ed3e46c1b1..3ed3e46c1b1 100644
--- a/include/linux/un.h
+++ b/include/uapi/linux/un.h
diff --git a/include/linux/unistd.h b/include/uapi/linux/unistd.h
index aa8d5b5e2e3..aa8d5b5e2e3 100644
--- a/include/linux/unistd.h
+++ b/include/uapi/linux/unistd.h
diff --git a/include/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b1d2bf16b33..b1d2bf16b33 100644
--- a/include/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbdevice_fs.h
new file mode 100644
index 00000000000..0c65e4b1261
--- /dev/null
+++ b/include/uapi/linux/usbdevice_fs.h
@@ -0,0 +1,180 @@
1/*****************************************************************************/
2
3/*
4 * usbdevice_fs.h -- USB device file system.
5 *
6 * Copyright (C) 2000
7 * Thomas Sailer (sailer@ife.ee.ethz.ch)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * History:
24 * 0.1 04.01.2000 Created
25 */
26
27/*****************************************************************************/
28
29#ifndef _UAPI_LINUX_USBDEVICE_FS_H
30#define _UAPI_LINUX_USBDEVICE_FS_H
31
32#include <linux/types.h>
33#include <linux/magic.h>
34
35/* --------------------------------------------------------------------- */
36
37/* usbdevfs ioctl codes */
38
39struct usbdevfs_ctrltransfer {
40 __u8 bRequestType;
41 __u8 bRequest;
42 __u16 wValue;
43 __u16 wIndex;
44 __u16 wLength;
45 __u32 timeout; /* in milliseconds */
46 void __user *data;
47};
48
49struct usbdevfs_bulktransfer {
50 unsigned int ep;
51 unsigned int len;
52 unsigned int timeout; /* in milliseconds */
53 void __user *data;
54};
55
56struct usbdevfs_setinterface {
57 unsigned int interface;
58 unsigned int altsetting;
59};
60
61struct usbdevfs_disconnectsignal {
62 unsigned int signr;
63 void __user *context;
64};
65
66#define USBDEVFS_MAXDRIVERNAME 255
67
68struct usbdevfs_getdriver {
69 unsigned int interface;
70 char driver[USBDEVFS_MAXDRIVERNAME + 1];
71};
72
73struct usbdevfs_connectinfo {
74 unsigned int devnum;
75 unsigned char slow;
76};
77
78#define USBDEVFS_URB_SHORT_NOT_OK 0x01
79#define USBDEVFS_URB_ISO_ASAP 0x02
80#define USBDEVFS_URB_BULK_CONTINUATION 0x04
81#define USBDEVFS_URB_NO_FSBR 0x20
82#define USBDEVFS_URB_ZERO_PACKET 0x40
83#define USBDEVFS_URB_NO_INTERRUPT 0x80
84
85#define USBDEVFS_URB_TYPE_ISO 0
86#define USBDEVFS_URB_TYPE_INTERRUPT 1
87#define USBDEVFS_URB_TYPE_CONTROL 2
88#define USBDEVFS_URB_TYPE_BULK 3
89
90struct usbdevfs_iso_packet_desc {
91 unsigned int length;
92 unsigned int actual_length;
93 unsigned int status;
94};
95
96struct usbdevfs_urb {
97 unsigned char type;
98 unsigned char endpoint;
99 int status;
100 unsigned int flags;
101 void __user *buffer;
102 int buffer_length;
103 int actual_length;
104 int start_frame;
105 int number_of_packets;
106 int error_count;
107 unsigned int signr; /* signal to be sent on completion,
108 or 0 if none should be sent. */
109 void __user *usercontext;
110 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
111};
112
113/* ioctls for talking directly to drivers */
114struct usbdevfs_ioctl {
115 int ifno; /* interface 0..N ; negative numbers reserved */
116 int ioctl_code; /* MUST encode size + direction of data so the
117 * macros in <asm/ioctl.h> give correct values */
118 void __user *data; /* param buffer (in, or out) */
119};
120
121/* You can do most things with hubs just through control messages,
122 * except find out what device connects to what port. */
123struct usbdevfs_hub_portinfo {
124 char nports; /* number of downstream ports in this hub */
125 char port [127]; /* e.g. port 3 connects to device 27 */
126};
127
128/* Device capability flags */
129#define USBDEVFS_CAP_ZERO_PACKET 0x01
130#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
131#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
132#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
133
134/* USBDEVFS_DISCONNECT_CLAIM flags & struct */
135
136/* disconnect-and-claim if the driver matches the driver field */
137#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
138/* disconnect-and-claim except when the driver matches the driver field */
139#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
140
141struct usbdevfs_disconnect_claim {
142 unsigned int interface;
143 unsigned int flags;
144 char driver[USBDEVFS_MAXDRIVERNAME + 1];
145};
146
147
148#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
149#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
150#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
151#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
152#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
153#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
154#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
155#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
156#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
157#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
158#define USBDEVFS_DISCARDURB _IO('U', 11)
159#define USBDEVFS_REAPURB _IOW('U', 12, void *)
160#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
161#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
162#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
163#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
164#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
165#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
166#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
167#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
168#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
169#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
170#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
171#define USBDEVFS_RESET _IO('U', 20)
172#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
173#define USBDEVFS_DISCONNECT _IO('U', 22)
174#define USBDEVFS_CONNECT _IO('U', 23)
175#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
176#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
177#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
178#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
179
180#endif /* _UAPI_LINUX_USBDEVICE_FS_H */
diff --git a/include/linux/utime.h b/include/uapi/linux/utime.h
index 5cdf673afbd..5cdf673afbd 100644
--- a/include/linux/utime.h
+++ b/include/uapi/linux/utime.h
diff --git a/include/uapi/linux/utsname.h b/include/uapi/linux/utsname.h
new file mode 100644
index 00000000000..872c2df10de
--- /dev/null
+++ b/include/uapi/linux/utsname.h
@@ -0,0 +1,34 @@
1#ifndef _UAPI_LINUX_UTSNAME_H
2#define _UAPI_LINUX_UTSNAME_H
3
4#define __OLD_UTS_LEN 8
5
6struct oldold_utsname {
7 char sysname[9];
8 char nodename[9];
9 char release[9];
10 char version[9];
11 char machine[9];
12};
13
14#define __NEW_UTS_LEN 64
15
16struct old_utsname {
17 char sysname[65];
18 char nodename[65];
19 char release[65];
20 char version[65];
21 char machine[65];
22};
23
24struct new_utsname {
25 char sysname[__NEW_UTS_LEN + 1];
26 char nodename[__NEW_UTS_LEN + 1];
27 char release[__NEW_UTS_LEN + 1];
28 char version[__NEW_UTS_LEN + 1];
29 char machine[__NEW_UTS_LEN + 1];
30 char domainname[__NEW_UTS_LEN + 1];
31};
32
33
34#endif /* _UAPI_LINUX_UTSNAME_H */
diff --git a/include/uapi/linux/uuid.h b/include/uapi/linux/uuid.h
new file mode 100644
index 00000000000..786f0773cc3
--- /dev/null
+++ b/include/uapi/linux/uuid.h
@@ -0,0 +1,58 @@
1/*
2 * UUID/GUID definition
3 *
4 * Copyright (C) 2010, Intel Corp.
5 * Huang Ying <ying.huang@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation;
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _UAPI_LINUX_UUID_H_
22#define _UAPI_LINUX_UUID_H_
23
24#include <linux/types.h>
25#include <linux/string.h>
26
27typedef struct {
28 __u8 b[16];
29} uuid_le;
30
31typedef struct {
32 __u8 b[16];
33} uuid_be;
34
35#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
36((uuid_le) \
37{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
38 (b) & 0xff, ((b) >> 8) & 0xff, \
39 (c) & 0xff, ((c) >> 8) & 0xff, \
40 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
41
42#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
43((uuid_be) \
44{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
45 ((b) >> 8) & 0xff, (b) & 0xff, \
46 ((c) >> 8) & 0xff, (c) & 0xff, \
47 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
48
49#define NULL_UUID_LE \
50 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
51 0x00, 0x00, 0x00, 0x00)
52
53#define NULL_UUID_BE \
54 UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
55 0x00, 0x00, 0x00, 0x00)
56
57
58#endif /* _UAPI_LINUX_UUID_H_ */
diff --git a/include/linux/uvcvideo.h b/include/uapi/linux/uvcvideo.h
index 3b081862b9e..3b081862b9e 100644
--- a/include/linux/uvcvideo.h
+++ b/include/uapi/linux/uvcvideo.h
diff --git a/include/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
index 4f0667e010d..4f0667e010d 100644
--- a/include/linux/v4l2-common.h
+++ b/include/uapi/linux/v4l2-common.h
diff --git a/include/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index f56c945cecd..f56c945cecd 100644
--- a/include/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
diff --git a/include/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h
index 9ef8172e5ed..9ef8172e5ed 100644
--- a/include/linux/v4l2-dv-timings.h
+++ b/include/uapi/linux/v4l2-dv-timings.h
diff --git a/include/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 7d64e0e1a18..7d64e0e1a18 100644
--- a/include/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
diff --git a/include/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
index a33c4daadce..a33c4daadce 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/uapi/linux/v4l2-subdev.h
diff --git a/include/linux/veth.h b/include/uapi/linux/veth.h
index 3354c1eb424..3354c1eb424 100644
--- a/include/linux/veth.h
+++ b/include/uapi/linux/veth.h
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
new file mode 100644
index 00000000000..4758d1bfcf4
--- /dev/null
+++ b/include/uapi/linux/vfio.h
@@ -0,0 +1,368 @@
1/*
2 * VFIO API definition
3 *
4 * Copyright (C) 2012 Red Hat, Inc. All rights reserved.
5 * Author: Alex Williamson <alex.williamson@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _UAPIVFIO_H
12#define _UAPIVFIO_H
13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17#define VFIO_API_VERSION 0
18
19
20/* Kernel & User level defines for VFIO IOCTLs. */
21
22/* Extensions */
23
24#define VFIO_TYPE1_IOMMU 1
25
26/*
27 * The IOCTL interface is designed for extensibility by embedding the
28 * structure length (argsz) and flags into structures passed between
29 * kernel and userspace. We therefore use the _IO() macro for these
30 * defines to avoid implicitly embedding a size into the ioctl request.
31 * As structure fields are added, argsz will increase to match and flag
32 * bits will be defined to indicate additional fields with valid data.
33 * It's *always* the caller's responsibility to indicate the size of
34 * the structure passed by setting argsz appropriately.
35 */
36
37#define VFIO_TYPE (';')
38#define VFIO_BASE 100
39
40/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
41
42/**
43 * VFIO_GET_API_VERSION - _IO(VFIO_TYPE, VFIO_BASE + 0)
44 *
45 * Report the version of the VFIO API. This allows us to bump the entire
46 * API version should we later need to add or change features in incompatible
47 * ways.
48 * Return: VFIO_API_VERSION
49 * Availability: Always
50 */
51#define VFIO_GET_API_VERSION _IO(VFIO_TYPE, VFIO_BASE + 0)
52
53/**
54 * VFIO_CHECK_EXTENSION - _IOW(VFIO_TYPE, VFIO_BASE + 1, __u32)
55 *
56 * Check whether an extension is supported.
57 * Return: 0 if not supported, 1 (or some other positive integer) if supported.
58 * Availability: Always
59 */
60#define VFIO_CHECK_EXTENSION _IO(VFIO_TYPE, VFIO_BASE + 1)
61
62/**
63 * VFIO_SET_IOMMU - _IOW(VFIO_TYPE, VFIO_BASE + 2, __s32)
64 *
65 * Set the iommu to the given type. The type must be supported by an
66 * iommu driver as verified by calling CHECK_EXTENSION using the same
67 * type. A group must be set to this file descriptor before this
68 * ioctl is available. The IOMMU interfaces enabled by this call are
69 * specific to the value set.
70 * Return: 0 on success, -errno on failure
71 * Availability: When VFIO group attached
72 */
73#define VFIO_SET_IOMMU _IO(VFIO_TYPE, VFIO_BASE + 2)
74
75/* -------- IOCTLs for GROUP file descriptors (/dev/vfio/$GROUP) -------- */
76
77/**
78 * VFIO_GROUP_GET_STATUS - _IOR(VFIO_TYPE, VFIO_BASE + 3,
79 * struct vfio_group_status)
80 *
81 * Retrieve information about the group. Fills in provided
82 * struct vfio_group_info. Caller sets argsz.
83 * Return: 0 on succes, -errno on failure.
84 * Availability: Always
85 */
86struct vfio_group_status {
87 __u32 argsz;
88 __u32 flags;
89#define VFIO_GROUP_FLAGS_VIABLE (1 << 0)
90#define VFIO_GROUP_FLAGS_CONTAINER_SET (1 << 1)
91};
92#define VFIO_GROUP_GET_STATUS _IO(VFIO_TYPE, VFIO_BASE + 3)
93
94/**
95 * VFIO_GROUP_SET_CONTAINER - _IOW(VFIO_TYPE, VFIO_BASE + 4, __s32)
96 *
97 * Set the container for the VFIO group to the open VFIO file
98 * descriptor provided. Groups may only belong to a single
99 * container. Containers may, at their discretion, support multiple
100 * groups. Only when a container is set are all of the interfaces
101 * of the VFIO file descriptor and the VFIO group file descriptor
102 * available to the user.
103 * Return: 0 on success, -errno on failure.
104 * Availability: Always
105 */
106#define VFIO_GROUP_SET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 4)
107
108/**
109 * VFIO_GROUP_UNSET_CONTAINER - _IO(VFIO_TYPE, VFIO_BASE + 5)
110 *
111 * Remove the group from the attached container. This is the
112 * opposite of the SET_CONTAINER call and returns the group to
113 * an initial state. All device file descriptors must be released
114 * prior to calling this interface. When removing the last group
115 * from a container, the IOMMU will be disabled and all state lost,
116 * effectively also returning the VFIO file descriptor to an initial
117 * state.
118 * Return: 0 on success, -errno on failure.
119 * Availability: When attached to container
120 */
121#define VFIO_GROUP_UNSET_CONTAINER _IO(VFIO_TYPE, VFIO_BASE + 5)
122
123/**
124 * VFIO_GROUP_GET_DEVICE_FD - _IOW(VFIO_TYPE, VFIO_BASE + 6, char)
125 *
126 * Return a new file descriptor for the device object described by
127 * the provided string. The string should match a device listed in
128 * the devices subdirectory of the IOMMU group sysfs entry. The
129 * group containing the device must already be added to this context.
130 * Return: new file descriptor on success, -errno on failure.
131 * Availability: When attached to container
132 */
133#define VFIO_GROUP_GET_DEVICE_FD _IO(VFIO_TYPE, VFIO_BASE + 6)
134
135/* --------------- IOCTLs for DEVICE file descriptors --------------- */
136
137/**
138 * VFIO_DEVICE_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 7,
139 * struct vfio_device_info)
140 *
141 * Retrieve information about the device. Fills in provided
142 * struct vfio_device_info. Caller sets argsz.
143 * Return: 0 on success, -errno on failure.
144 */
145struct vfio_device_info {
146 __u32 argsz;
147 __u32 flags;
148#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */
149#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */
150 __u32 num_regions; /* Max region index + 1 */
151 __u32 num_irqs; /* Max IRQ index + 1 */
152};
153#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
154
155/**
156 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
157 * struct vfio_region_info)
158 *
159 * Retrieve information about a device region. Caller provides
160 * struct vfio_region_info with index value set. Caller sets argsz.
161 * Implementation of region mapping is bus driver specific. This is
162 * intended to describe MMIO, I/O port, as well as bus specific
163 * regions (ex. PCI config space). Zero sized regions may be used
164 * to describe unimplemented regions (ex. unimplemented PCI BARs).
165 * Return: 0 on success, -errno on failure.
166 */
167struct vfio_region_info {
168 __u32 argsz;
169 __u32 flags;
170#define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */
171#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */
172#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */
173 __u32 index; /* Region index */
174 __u32 resv; /* Reserved for alignment */
175 __u64 size; /* Region size (bytes) */
176 __u64 offset; /* Region offset from start of device fd */
177};
178#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
179
180/**
181 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
182 * struct vfio_irq_info)
183 *
184 * Retrieve information about a device IRQ. Caller provides
185 * struct vfio_irq_info with index value set. Caller sets argsz.
186 * Implementation of IRQ mapping is bus driver specific. Indexes
187 * using multiple IRQs are primarily intended to support MSI-like
188 * interrupt blocks. Zero count irq blocks may be used to describe
189 * unimplemented interrupt types.
190 *
191 * The EVENTFD flag indicates the interrupt index supports eventfd based
192 * signaling.
193 *
194 * The MASKABLE flags indicates the index supports MASK and UNMASK
195 * actions described below.
196 *
197 * AUTOMASKED indicates that after signaling, the interrupt line is
198 * automatically masked by VFIO and the user needs to unmask the line
199 * to receive new interrupts. This is primarily intended to distinguish
200 * level triggered interrupts.
201 *
202 * The NORESIZE flag indicates that the interrupt lines within the index
203 * are setup as a set and new subindexes cannot be enabled without first
204 * disabling the entire index. This is used for interrupts like PCI MSI
205 * and MSI-X where the driver may only use a subset of the available
206 * indexes, but VFIO needs to enable a specific number of vectors
207 * upfront. In the case of MSI-X, where the user can enable MSI-X and
208 * then add and unmask vectors, it's up to userspace to make the decision
209 * whether to allocate the maximum supported number of vectors or tear
210 * down setup and incrementally increase the vectors as each is enabled.
211 */
212struct vfio_irq_info {
213 __u32 argsz;
214 __u32 flags;
215#define VFIO_IRQ_INFO_EVENTFD (1 << 0)
216#define VFIO_IRQ_INFO_MASKABLE (1 << 1)
217#define VFIO_IRQ_INFO_AUTOMASKED (1 << 2)
218#define VFIO_IRQ_INFO_NORESIZE (1 << 3)
219 __u32 index; /* IRQ index */
220 __u32 count; /* Number of IRQs within this index */
221};
222#define VFIO_DEVICE_GET_IRQ_INFO _IO(VFIO_TYPE, VFIO_BASE + 9)
223
224/**
225 * VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
226 *
227 * Set signaling, masking, and unmasking of interrupts. Caller provides
228 * struct vfio_irq_set with all fields set. 'start' and 'count' indicate
229 * the range of subindexes being specified.
230 *
231 * The DATA flags specify the type of data provided. If DATA_NONE, the
232 * operation performs the specified action immediately on the specified
233 * interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]:
234 * flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
235 *
236 * DATA_BOOL allows sparse support for the same on arrays of interrupts.
237 * For example, to mask interrupts [0,1] and [0,3] (but not [0,2]):
238 * flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3,
239 * data = {1,0,1}
240 *
241 * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
242 * A value of -1 can be used to either de-assign interrupts if already
243 * assigned or skip un-assigned interrupts. For example, to set an eventfd
244 * to be trigger for interrupts [0,0] and [0,2]:
245 * flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3,
246 * data = {fd1, -1, fd2}
247 * If index [0,1] is previously set, two count = 1 ioctls calls would be
248 * required to set [0,0] and [0,2] without changing [0,1].
249 *
250 * Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used
251 * with ACTION_TRIGGER to perform kernel level interrupt loopback testing
252 * from userspace (ie. simulate hardware triggering).
253 *
254 * Setting of an event triggering mechanism to userspace for ACTION_TRIGGER
255 * enables the interrupt index for the device. Individual subindex interrupts
256 * can be disabled using the -1 value for DATA_EVENTFD or the index can be
257 * disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
258 *
259 * Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while
260 * ACTION_TRIGGER specifies kernel->user signaling.
261 */
262struct vfio_irq_set {
263 __u32 argsz;
264 __u32 flags;
265#define VFIO_IRQ_SET_DATA_NONE (1 << 0) /* Data not present */
266#define VFIO_IRQ_SET_DATA_BOOL (1 << 1) /* Data is bool (u8) */
267#define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */
268#define VFIO_IRQ_SET_ACTION_MASK (1 << 3) /* Mask interrupt */
269#define VFIO_IRQ_SET_ACTION_UNMASK (1 << 4) /* Unmask interrupt */
270#define VFIO_IRQ_SET_ACTION_TRIGGER (1 << 5) /* Trigger interrupt */
271 __u32 index;
272 __u32 start;
273 __u32 count;
274 __u8 data[];
275};
276#define VFIO_DEVICE_SET_IRQS _IO(VFIO_TYPE, VFIO_BASE + 10)
277
278#define VFIO_IRQ_SET_DATA_TYPE_MASK (VFIO_IRQ_SET_DATA_NONE | \
279 VFIO_IRQ_SET_DATA_BOOL | \
280 VFIO_IRQ_SET_DATA_EVENTFD)
281#define VFIO_IRQ_SET_ACTION_TYPE_MASK (VFIO_IRQ_SET_ACTION_MASK | \
282 VFIO_IRQ_SET_ACTION_UNMASK | \
283 VFIO_IRQ_SET_ACTION_TRIGGER)
284/**
285 * VFIO_DEVICE_RESET - _IO(VFIO_TYPE, VFIO_BASE + 11)
286 *
287 * Reset a device.
288 */
289#define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
290
291/*
292 * The VFIO-PCI bus driver makes use of the following fixed region and
293 * IRQ index mapping. Unimplemented regions return a size of zero.
294 * Unimplemented IRQ types return a count of zero.
295 */
296
297enum {
298 VFIO_PCI_BAR0_REGION_INDEX,
299 VFIO_PCI_BAR1_REGION_INDEX,
300 VFIO_PCI_BAR2_REGION_INDEX,
301 VFIO_PCI_BAR3_REGION_INDEX,
302 VFIO_PCI_BAR4_REGION_INDEX,
303 VFIO_PCI_BAR5_REGION_INDEX,
304 VFIO_PCI_ROM_REGION_INDEX,
305 VFIO_PCI_CONFIG_REGION_INDEX,
306 VFIO_PCI_NUM_REGIONS
307};
308
309enum {
310 VFIO_PCI_INTX_IRQ_INDEX,
311 VFIO_PCI_MSI_IRQ_INDEX,
312 VFIO_PCI_MSIX_IRQ_INDEX,
313 VFIO_PCI_NUM_IRQS
314};
315
316/* -------- API for Type1 VFIO IOMMU -------- */
317
318/**
319 * VFIO_IOMMU_GET_INFO - _IOR(VFIO_TYPE, VFIO_BASE + 12, struct vfio_iommu_info)
320 *
321 * Retrieve information about the IOMMU object. Fills in provided
322 * struct vfio_iommu_info. Caller sets argsz.
323 *
324 * XXX Should we do these by CHECK_EXTENSION too?
325 */
326struct vfio_iommu_type1_info {
327 __u32 argsz;
328 __u32 flags;
329#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
330 __u64 iova_pgsizes; /* Bitmap of supported page sizes */
331};
332
333#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
334
335/**
336 * VFIO_IOMMU_MAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 13, struct vfio_dma_map)
337 *
338 * Map process virtual addresses to IO virtual addresses using the
339 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
340 */
341struct vfio_iommu_type1_dma_map {
342 __u32 argsz;
343 __u32 flags;
344#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
345#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
346 __u64 vaddr; /* Process virtual address */
347 __u64 iova; /* IO virtual address */
348 __u64 size; /* Size of mapping (bytes) */
349};
350
351#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
352
353/**
354 * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap)
355 *
356 * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
357 * Caller sets argsz.
358 */
359struct vfio_iommu_type1_dma_unmap {
360 __u32 argsz;
361 __u32 flags;
362 __u64 iova; /* IO virtual address */
363 __u64 size; /* Size of mapping (bytes) */
364};
365
366#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
367
368#endif /* _UAPIVFIO_H */
diff --git a/include/linux/vhost.h b/include/uapi/linux/vhost.h
index e847f1e3075..e847f1e3075 100644
--- a/include/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
new file mode 100644
index 00000000000..57bfa59cda7
--- /dev/null
+++ b/include/uapi/linux/videodev2.h
@@ -0,0 +1,1998 @@
1/*
2 * Video for Linux Two header file
3 *
4 * Copyright (C) 1999-2012 the contributors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * Alternatively you can redistribute this file under the terms of the
17 * BSD license as stated below:
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in
26 * the documentation and/or other materials provided with the
27 * distribution.
28 * 3. The names of its contributors may not be used to endorse or promote
29 * products derived from this software without specific prior written
30 * permission.
31 *
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
38 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 *
44 * Header file for v4l or V4L2 drivers and applications
45 * with public API.
46 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
47 * no #if __KERNEL tests are allowed here
48 *
49 * See http://linuxtv.org for more info
50 *
51 * Author: Bill Dirks <bill@thedirks.org>
52 * Justin Schoeman
53 * Hans Verkuil <hverkuil@xs4all.nl>
54 * et al.
55 */
56#ifndef _UAPI__LINUX_VIDEODEV2_H
57#define _UAPI__LINUX_VIDEODEV2_H
58
59#ifndef __KERNEL__
60#include <sys/time.h>
61#endif
62#include <linux/compiler.h>
63#include <linux/ioctl.h>
64#include <linux/types.h>
65#include <linux/v4l2-common.h>
66#include <linux/v4l2-controls.h>
67
68/*
69 * Common stuff for both V4L1 and V4L2
70 * Moved from videodev.h
71 */
72#define VIDEO_MAX_FRAME 32
73#define VIDEO_MAX_PLANES 8
74
75#ifndef __KERNEL__
76
77/* These defines are V4L1 specific and should not be used with the V4L2 API!
78 They will be removed from this header in the future. */
79
80#define VID_TYPE_CAPTURE 1 /* Can capture */
81#define VID_TYPE_TUNER 2 /* Can tune */
82#define VID_TYPE_TELETEXT 4 /* Does teletext */
83#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
84#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
85#define VID_TYPE_CLIPPING 32 /* Can clip */
86#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
87#define VID_TYPE_SCALES 128 /* Scalable */
88#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
89#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
90#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
91#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
92#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
93#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
94#endif
95
96/*
97 * M I S C E L L A N E O U S
98 */
99
100/* Four-character-code (FOURCC) */
101#define v4l2_fourcc(a, b, c, d)\
102 ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
103
104/*
105 * E N U M S
106 */
107enum v4l2_field {
108 V4L2_FIELD_ANY = 0, /* driver can choose from none,
109 top, bottom, interlaced
110 depending on whatever it thinks
111 is approximate ... */
112 V4L2_FIELD_NONE = 1, /* this device has no fields ... */
113 V4L2_FIELD_TOP = 2, /* top field only */
114 V4L2_FIELD_BOTTOM = 3, /* bottom field only */
115 V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
116 V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
117 buffer, top-bottom order */
118 V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
119 V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
120 separate buffers */
121 V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
122 first and the top field is
123 transmitted first */
124 V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
125 first and the bottom field is
126 transmitted first */
127};
128#define V4L2_FIELD_HAS_TOP(field) \
129 ((field) == V4L2_FIELD_TOP ||\
130 (field) == V4L2_FIELD_INTERLACED ||\
131 (field) == V4L2_FIELD_INTERLACED_TB ||\
132 (field) == V4L2_FIELD_INTERLACED_BT ||\
133 (field) == V4L2_FIELD_SEQ_TB ||\
134 (field) == V4L2_FIELD_SEQ_BT)
135#define V4L2_FIELD_HAS_BOTTOM(field) \
136 ((field) == V4L2_FIELD_BOTTOM ||\
137 (field) == V4L2_FIELD_INTERLACED ||\
138 (field) == V4L2_FIELD_INTERLACED_TB ||\
139 (field) == V4L2_FIELD_INTERLACED_BT ||\
140 (field) == V4L2_FIELD_SEQ_TB ||\
141 (field) == V4L2_FIELD_SEQ_BT)
142#define V4L2_FIELD_HAS_BOTH(field) \
143 ((field) == V4L2_FIELD_INTERLACED ||\
144 (field) == V4L2_FIELD_INTERLACED_TB ||\
145 (field) == V4L2_FIELD_INTERLACED_BT ||\
146 (field) == V4L2_FIELD_SEQ_TB ||\
147 (field) == V4L2_FIELD_SEQ_BT)
148
149enum v4l2_buf_type {
150 V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
151 V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
152 V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
153 V4L2_BUF_TYPE_VBI_CAPTURE = 4,
154 V4L2_BUF_TYPE_VBI_OUTPUT = 5,
155 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
156 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
157#if 1
158 /* Experimental */
159 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
160#endif
161 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
162 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
163 /* Deprecated, do not use */
164 V4L2_BUF_TYPE_PRIVATE = 0x80,
165};
166
167#define V4L2_TYPE_IS_MULTIPLANAR(type) \
168 ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
169 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
170
171#define V4L2_TYPE_IS_OUTPUT(type) \
172 ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
173 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
174 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
175 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
176 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
177 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
178
179enum v4l2_tuner_type {
180 V4L2_TUNER_RADIO = 1,
181 V4L2_TUNER_ANALOG_TV = 2,
182 V4L2_TUNER_DIGITAL_TV = 3,
183};
184
185enum v4l2_memory {
186 V4L2_MEMORY_MMAP = 1,
187 V4L2_MEMORY_USERPTR = 2,
188 V4L2_MEMORY_OVERLAY = 3,
189};
190
191/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
192enum v4l2_colorspace {
193 /* ITU-R 601 -- broadcast NTSC/PAL */
194 V4L2_COLORSPACE_SMPTE170M = 1,
195
196 /* 1125-Line (US) HDTV */
197 V4L2_COLORSPACE_SMPTE240M = 2,
198
199 /* HD and modern captures. */
200 V4L2_COLORSPACE_REC709 = 3,
201
202 /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
203 V4L2_COLORSPACE_BT878 = 4,
204
205 /* These should be useful. Assume 601 extents. */
206 V4L2_COLORSPACE_470_SYSTEM_M = 5,
207 V4L2_COLORSPACE_470_SYSTEM_BG = 6,
208
209 /* I know there will be cameras that send this. So, this is
210 * unspecified chromaticities and full 0-255 on each of the
211 * Y'CbCr components
212 */
213 V4L2_COLORSPACE_JPEG = 7,
214
215 /* For RGB colourspaces, this is probably a good start. */
216 V4L2_COLORSPACE_SRGB = 8,
217};
218
219enum v4l2_priority {
220 V4L2_PRIORITY_UNSET = 0, /* not initialized */
221 V4L2_PRIORITY_BACKGROUND = 1,
222 V4L2_PRIORITY_INTERACTIVE = 2,
223 V4L2_PRIORITY_RECORD = 3,
224 V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
225};
226
227struct v4l2_rect {
228 __s32 left;
229 __s32 top;
230 __s32 width;
231 __s32 height;
232};
233
234struct v4l2_fract {
235 __u32 numerator;
236 __u32 denominator;
237};
238
239/**
240 * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
241 *
242 * @driver: name of the driver module (e.g. "bttv")
243 * @card: name of the card (e.g. "Hauppauge WinTV")
244 * @bus_info: name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
245 * @version: KERNEL_VERSION
246 * @capabilities: capabilities of the physical device as a whole
247 * @device_caps: capabilities accessed via this particular device (node)
248 * @reserved: reserved fields for future extensions
249 */
250struct v4l2_capability {
251 __u8 driver[16];
252 __u8 card[32];
253 __u8 bus_info[32];
254 __u32 version;
255 __u32 capabilities;
256 __u32 device_caps;
257 __u32 reserved[3];
258};
259
260/* Values for 'capabilities' field */
261#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
262#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
263#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
264#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
265#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
266#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
267#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
268#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
269#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
270#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
271#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
272
273/* Is a video capture device that supports multiplanar formats */
274#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
275/* Is a video output device that supports multiplanar formats */
276#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
277/* Is a video mem-to-mem device that supports multiplanar formats */
278#define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
279/* Is a video mem-to-mem device */
280#define V4L2_CAP_VIDEO_M2M 0x00008000
281
282#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
283#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
284#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
285#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */
286
287#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
288#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
289#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
290
291#define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
292
293/*
294 * V I D E O I M A G E F O R M A T
295 */
296struct v4l2_pix_format {
297 __u32 width;
298 __u32 height;
299 __u32 pixelformat;
300 __u32 field; /* enum v4l2_field */
301 __u32 bytesperline; /* for padding, zero if unused */
302 __u32 sizeimage;
303 __u32 colorspace; /* enum v4l2_colorspace */
304 __u32 priv; /* private data, depends on pixelformat */
305};
306
307/* Pixel format FOURCC depth Description */
308
309/* RGB formats */
310#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
311#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
312#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
313#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
314#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
315#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
316#define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
317#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
318#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
319#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
320#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
321
322/* Grey formats */
323#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
324#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
325#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
326#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
327#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
328#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
329
330/* Grey bit-packed formats */
331#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
332
333/* Palette formats */
334#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
335
336/* Luminance+Chrominance formats */
337#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
338#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
339#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
340#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
341#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
342#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
343#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
344#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
345#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
346#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
347#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
348#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
349#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
350#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
351#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
352#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
353#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
354#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
355#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
356
357/* two planes -- one Y, one Cr + Cb interleaved */
358#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
359#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
360#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
361#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
362#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
363#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
364
365/* two non contiguous planes - one Y, one Cr + Cb interleaved */
366#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
367#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
368#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
369#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
370
371/* three non contiguous planes - Y, Cb, Cr */
372#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
373#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */
374
375/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
376#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
377#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
378#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
379#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
380#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
381#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
382#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
383#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
384#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
385#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
386#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
387#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
388 /* 10bit raw bayer DPCM compressed to 8 bits */
389#define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
390#define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
391#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
392#define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
393 /*
394 * 10bit raw bayer, expanded to 16 bits
395 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
396 */
397#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
398
399/* compressed formats */
400#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
401#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
402#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
403#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
404#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
405#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
406#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
407#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
408#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
409#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
410#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
411#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
412#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
413#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
414#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
415
416/* Vendor-specific formats */
417#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
418#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
419#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
420#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
421#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
422#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
423#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
424#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
425#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
426#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
427#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
428#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
429#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
430#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
431#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
432#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
433#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
434#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
435#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
436#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
437#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
438#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
439#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
440#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
441#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
442#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
443
444/*
445 * F O R M A T E N U M E R A T I O N
446 */
447struct v4l2_fmtdesc {
448 __u32 index; /* Format number */
449 __u32 type; /* enum v4l2_buf_type */
450 __u32 flags;
451 __u8 description[32]; /* Description string */
452 __u32 pixelformat; /* Format fourcc */
453 __u32 reserved[4];
454};
455
456#define V4L2_FMT_FLAG_COMPRESSED 0x0001
457#define V4L2_FMT_FLAG_EMULATED 0x0002
458
459#if 1
460 /* Experimental Frame Size and frame rate enumeration */
461/*
462 * F R A M E S I Z E E N U M E R A T I O N
463 */
464enum v4l2_frmsizetypes {
465 V4L2_FRMSIZE_TYPE_DISCRETE = 1,
466 V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
467 V4L2_FRMSIZE_TYPE_STEPWISE = 3,
468};
469
470struct v4l2_frmsize_discrete {
471 __u32 width; /* Frame width [pixel] */
472 __u32 height; /* Frame height [pixel] */
473};
474
475struct v4l2_frmsize_stepwise {
476 __u32 min_width; /* Minimum frame width [pixel] */
477 __u32 max_width; /* Maximum frame width [pixel] */
478 __u32 step_width; /* Frame width step size [pixel] */
479 __u32 min_height; /* Minimum frame height [pixel] */
480 __u32 max_height; /* Maximum frame height [pixel] */
481 __u32 step_height; /* Frame height step size [pixel] */
482};
483
484struct v4l2_frmsizeenum {
485 __u32 index; /* Frame size number */
486 __u32 pixel_format; /* Pixel format */
487 __u32 type; /* Frame size type the device supports. */
488
489 union { /* Frame size */
490 struct v4l2_frmsize_discrete discrete;
491 struct v4l2_frmsize_stepwise stepwise;
492 };
493
494 __u32 reserved[2]; /* Reserved space for future use */
495};
496
497/*
498 * F R A M E R A T E E N U M E R A T I O N
499 */
500enum v4l2_frmivaltypes {
501 V4L2_FRMIVAL_TYPE_DISCRETE = 1,
502 V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
503 V4L2_FRMIVAL_TYPE_STEPWISE = 3,
504};
505
506struct v4l2_frmival_stepwise {
507 struct v4l2_fract min; /* Minimum frame interval [s] */
508 struct v4l2_fract max; /* Maximum frame interval [s] */
509 struct v4l2_fract step; /* Frame interval step size [s] */
510};
511
512struct v4l2_frmivalenum {
513 __u32 index; /* Frame format index */
514 __u32 pixel_format; /* Pixel format */
515 __u32 width; /* Frame width */
516 __u32 height; /* Frame height */
517 __u32 type; /* Frame interval type the device supports. */
518
519 union { /* Frame interval */
520 struct v4l2_fract discrete;
521 struct v4l2_frmival_stepwise stepwise;
522 };
523
524 __u32 reserved[2]; /* Reserved space for future use */
525};
526#endif
527
528/*
529 * T I M E C O D E
530 */
531struct v4l2_timecode {
532 __u32 type;
533 __u32 flags;
534 __u8 frames;
535 __u8 seconds;
536 __u8 minutes;
537 __u8 hours;
538 __u8 userbits[4];
539};
540
541/* Type */
542#define V4L2_TC_TYPE_24FPS 1
543#define V4L2_TC_TYPE_25FPS 2
544#define V4L2_TC_TYPE_30FPS 3
545#define V4L2_TC_TYPE_50FPS 4
546#define V4L2_TC_TYPE_60FPS 5
547
548/* Flags */
549#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
550#define V4L2_TC_FLAG_COLORFRAME 0x0002
551#define V4L2_TC_USERBITS_field 0x000C
552#define V4L2_TC_USERBITS_USERDEFINED 0x0000
553#define V4L2_TC_USERBITS_8BITCHARS 0x0008
554/* The above is based on SMPTE timecodes */
555
556struct v4l2_jpegcompression {
557 int quality;
558
559 int APPn; /* Number of APP segment to be written,
560 * must be 0..15 */
561 int APP_len; /* Length of data in JPEG APPn segment */
562 char APP_data[60]; /* Data in the JPEG APPn segment. */
563
564 int COM_len; /* Length of data in JPEG COM segment */
565 char COM_data[60]; /* Data in JPEG COM segment */
566
567 __u32 jpeg_markers; /* Which markers should go into the JPEG
568 * output. Unless you exactly know what
569 * you do, leave them untouched.
570 * Inluding less markers will make the
571 * resulting code smaller, but there will
572 * be fewer applications which can read it.
573 * The presence of the APP and COM marker
574 * is influenced by APP_len and COM_len
575 * ONLY, not by this property! */
576
577#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
578#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
579#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
580#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
581#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
582 * allways use APP0 */
583};
584
585/*
586 * M E M O R Y - M A P P I N G B U F F E R S
587 */
588struct v4l2_requestbuffers {
589 __u32 count;
590 __u32 type; /* enum v4l2_buf_type */
591 __u32 memory; /* enum v4l2_memory */
592 __u32 reserved[2];
593};
594
595/**
596 * struct v4l2_plane - plane info for multi-planar buffers
597 * @bytesused: number of bytes occupied by data in the plane (payload)
598 * @length: size of this plane (NOT the payload) in bytes
599 * @mem_offset: when memory in the associated struct v4l2_buffer is
600 * V4L2_MEMORY_MMAP, equals the offset from the start of
601 * the device memory for this plane (or is a "cookie" that
602 * should be passed to mmap() called on the video node)
603 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
604 * pointing to this plane
605 * @data_offset: offset in the plane to the start of data; usually 0,
606 * unless there is a header in front of the data
607 *
608 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
609 * with two planes can have one plane for Y, and another for interleaved CbCr
610 * components. Each plane can reside in a separate memory buffer, or even in
611 * a completely separate memory node (e.g. in embedded devices).
612 */
613struct v4l2_plane {
614 __u32 bytesused;
615 __u32 length;
616 union {
617 __u32 mem_offset;
618 unsigned long userptr;
619 } m;
620 __u32 data_offset;
621 __u32 reserved[11];
622};
623
624/**
625 * struct v4l2_buffer - video buffer info
626 * @index: id number of the buffer
627 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
628 * multiplanar buffers);
629 * @bytesused: number of bytes occupied by data in the buffer (payload);
630 * unused (set to 0) for multiplanar buffers
631 * @flags: buffer informational flags
632 * @field: enum v4l2_field; field order of the image in the buffer
633 * @timestamp: frame timestamp
634 * @timecode: frame timecode
635 * @sequence: sequence count of this frame
636 * @memory: enum v4l2_memory; the method, in which the actual video data is
637 * passed
638 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
639 * offset from the start of the device memory for this plane,
640 * (or a "cookie" that should be passed to mmap() as offset)
641 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
642 * a userspace pointer pointing to this buffer
643 * @planes: for multiplanar buffers; userspace pointer to the array of plane
644 * info structs for this buffer
645 * @length: size in bytes of the buffer (NOT its payload) for single-plane
646 * buffers (when type != *_MPLANE); number of elements in the
647 * planes array for multi-plane buffers
648 * @input: input number from which the video data has has been captured
649 *
650 * Contains data exchanged by application and driver using one of the Streaming
651 * I/O methods.
652 */
653struct v4l2_buffer {
654 __u32 index;
655 __u32 type;
656 __u32 bytesused;
657 __u32 flags;
658 __u32 field;
659 struct timeval timestamp;
660 struct v4l2_timecode timecode;
661 __u32 sequence;
662
663 /* memory location */
664 __u32 memory;
665 union {
666 __u32 offset;
667 unsigned long userptr;
668 struct v4l2_plane *planes;
669 } m;
670 __u32 length;
671 __u32 reserved2;
672 __u32 reserved;
673};
674
675/* Flags for 'flags' field */
676#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
677#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
678#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
679#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
680#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
681#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
682/* Buffer is ready, but the data contained within is corrupted. */
683#define V4L2_BUF_FLAG_ERROR 0x0040
684#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
685#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
686/* Cache handling flags */
687#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
688#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
689
690/*
691 * O V E R L A Y P R E V I E W
692 */
693struct v4l2_framebuffer {
694 __u32 capability;
695 __u32 flags;
696/* FIXME: in theory we should pass something like PCI device + memory
697 * region + offset instead of some physical address */
698 void *base;
699 struct v4l2_pix_format fmt;
700};
701/* Flags for the 'capability' field. Read only */
702#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
703#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
704#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
705#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
706#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
707#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
708#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
709#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
710/* Flags for the 'flags' field. */
711#define V4L2_FBUF_FLAG_PRIMARY 0x0001
712#define V4L2_FBUF_FLAG_OVERLAY 0x0002
713#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
714#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
715#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
716#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
717#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
718
719struct v4l2_clip {
720 struct v4l2_rect c;
721 struct v4l2_clip __user *next;
722};
723
724struct v4l2_window {
725 struct v4l2_rect w;
726 __u32 field; /* enum v4l2_field */
727 __u32 chromakey;
728 struct v4l2_clip __user *clips;
729 __u32 clipcount;
730 void __user *bitmap;
731 __u8 global_alpha;
732};
733
734/*
735 * C A P T U R E P A R A M E T E R S
736 */
737struct v4l2_captureparm {
738 __u32 capability; /* Supported modes */
739 __u32 capturemode; /* Current mode */
740 struct v4l2_fract timeperframe; /* Time per frame in .1us units */
741 __u32 extendedmode; /* Driver-specific extensions */
742 __u32 readbuffers; /* # of buffers for read */
743 __u32 reserved[4];
744};
745
746/* Flags for 'capability' and 'capturemode' fields */
747#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
748#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
749
750struct v4l2_outputparm {
751 __u32 capability; /* Supported modes */
752 __u32 outputmode; /* Current mode */
753 struct v4l2_fract timeperframe; /* Time per frame in seconds */
754 __u32 extendedmode; /* Driver-specific extensions */
755 __u32 writebuffers; /* # of buffers for write */
756 __u32 reserved[4];
757};
758
759/*
760 * I N P U T I M A G E C R O P P I N G
761 */
762struct v4l2_cropcap {
763 __u32 type; /* enum v4l2_buf_type */
764 struct v4l2_rect bounds;
765 struct v4l2_rect defrect;
766 struct v4l2_fract pixelaspect;
767};
768
769struct v4l2_crop {
770 __u32 type; /* enum v4l2_buf_type */
771 struct v4l2_rect c;
772};
773
774/**
775 * struct v4l2_selection - selection info
776 * @type: buffer type (do not use *_MPLANE types)
777 * @target: Selection target, used to choose one of possible rectangles;
778 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
779 * @flags: constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
780 * @r: coordinates of selection window
781 * @reserved: for future use, rounds structure size to 64 bytes, set to zero
782 *
783 * Hardware may use multiple helper windows to process a video stream.
784 * The structure is used to exchange this selection areas between
785 * an application and a driver.
786 */
787struct v4l2_selection {
788 __u32 type;
789 __u32 target;
790 __u32 flags;
791 struct v4l2_rect r;
792 __u32 reserved[9];
793};
794
795
796/*
797 * A N A L O G V I D E O S T A N D A R D
798 */
799
800typedef __u64 v4l2_std_id;
801
802/* one bit for each */
803#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
804#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
805#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
806#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
807#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
808#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
809#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
810#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
811
812#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
813#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
814#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
815#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
816
817#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */
818#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */
819#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
820#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */
821
822#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
823#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
824#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
825#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
826#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
827#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
828#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
829#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
830
831/* ATSC/HDTV */
832#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
833#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
834
835/* FIXME:
836 Although std_id is 64 bits, there is an issue on PPC32 architecture that
837 makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
838 this value to 32 bits.
839 As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
840 it should work fine. However, if needed to add more than two standards,
841 v4l2-common.c should be fixed.
842 */
843
844/*
845 * Some macros to merge video standards in order to make live easier for the
846 * drivers and V4L2 applications
847 */
848
849/*
850 * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
851 * Missing here.
852 */
853#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
854 V4L2_STD_NTSC_M_JP |\
855 V4L2_STD_NTSC_M_KR)
856/* Secam macros */
857#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
858 V4L2_STD_SECAM_K |\
859 V4L2_STD_SECAM_K1)
860/* All Secam Standards */
861#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
862 V4L2_STD_SECAM_G |\
863 V4L2_STD_SECAM_H |\
864 V4L2_STD_SECAM_DK |\
865 V4L2_STD_SECAM_L |\
866 V4L2_STD_SECAM_LC)
867/* PAL macros */
868#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
869 V4L2_STD_PAL_B1 |\
870 V4L2_STD_PAL_G)
871#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
872 V4L2_STD_PAL_D1 |\
873 V4L2_STD_PAL_K)
874/*
875 * "Common" PAL - This macro is there to be compatible with the old
876 * V4L1 concept of "PAL": /BGDKHI.
877 * Several PAL standards are mising here: /M, /N and /Nc
878 */
879#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
880 V4L2_STD_PAL_DK |\
881 V4L2_STD_PAL_H |\
882 V4L2_STD_PAL_I)
883/* Chroma "agnostic" standards */
884#define V4L2_STD_B (V4L2_STD_PAL_B |\
885 V4L2_STD_PAL_B1 |\
886 V4L2_STD_SECAM_B)
887#define V4L2_STD_G (V4L2_STD_PAL_G |\
888 V4L2_STD_SECAM_G)
889#define V4L2_STD_H (V4L2_STD_PAL_H |\
890 V4L2_STD_SECAM_H)
891#define V4L2_STD_L (V4L2_STD_SECAM_L |\
892 V4L2_STD_SECAM_LC)
893#define V4L2_STD_GH (V4L2_STD_G |\
894 V4L2_STD_H)
895#define V4L2_STD_DK (V4L2_STD_PAL_DK |\
896 V4L2_STD_SECAM_DK)
897#define V4L2_STD_BG (V4L2_STD_B |\
898 V4L2_STD_G)
899#define V4L2_STD_MN (V4L2_STD_PAL_M |\
900 V4L2_STD_PAL_N |\
901 V4L2_STD_PAL_Nc |\
902 V4L2_STD_NTSC)
903
904/* Standards where MTS/BTSC stereo could be found */
905#define V4L2_STD_MTS (V4L2_STD_NTSC_M |\
906 V4L2_STD_PAL_M |\
907 V4L2_STD_PAL_N |\
908 V4L2_STD_PAL_Nc)
909
910/* Standards for Countries with 60Hz Line frequency */
911#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
912 V4L2_STD_PAL_60 |\
913 V4L2_STD_NTSC |\
914 V4L2_STD_NTSC_443)
915/* Standards for Countries with 50Hz Line frequency */
916#define V4L2_STD_625_50 (V4L2_STD_PAL |\
917 V4L2_STD_PAL_N |\
918 V4L2_STD_PAL_Nc |\
919 V4L2_STD_SECAM)
920
921#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
922 V4L2_STD_ATSC_16_VSB)
923/* Macros with none and all analog standards */
924#define V4L2_STD_UNKNOWN 0
925#define V4L2_STD_ALL (V4L2_STD_525_60 |\
926 V4L2_STD_625_50)
927
928struct v4l2_standard {
929 __u32 index;
930 v4l2_std_id id;
931 __u8 name[24];
932 struct v4l2_fract frameperiod; /* Frames, not fields */
933 __u32 framelines;
934 __u32 reserved[4];
935};
936
937/* The DV Preset API is deprecated in favor of the DV Timings API.
938 New drivers shouldn't use this anymore! */
939
940/*
941 * V I D E O T I M I N G S D V P R E S E T
942 */
943struct v4l2_dv_preset {
944 __u32 preset;
945 __u32 reserved[4];
946};
947
948/*
949 * D V P R E S E T S E N U M E R A T I O N
950 */
951struct v4l2_dv_enum_preset {
952 __u32 index;
953 __u32 preset;
954 __u8 name[32]; /* Name of the preset timing */
955 __u32 width;
956 __u32 height;
957 __u32 reserved[4];
958};
959
960/*
961 * D V P R E S E T V A L U E S
962 */
963#define V4L2_DV_INVALID 0
964#define V4L2_DV_480P59_94 1 /* BT.1362 */
965#define V4L2_DV_576P50 2 /* BT.1362 */
966#define V4L2_DV_720P24 3 /* SMPTE 296M */
967#define V4L2_DV_720P25 4 /* SMPTE 296M */
968#define V4L2_DV_720P30 5 /* SMPTE 296M */
969#define V4L2_DV_720P50 6 /* SMPTE 296M */
970#define V4L2_DV_720P59_94 7 /* SMPTE 274M */
971#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
972#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
973#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
974#define V4L2_DV_1080I25 11 /* BT.1120 */
975#define V4L2_DV_1080I50 12 /* SMPTE 296M */
976#define V4L2_DV_1080I60 13 /* SMPTE 296M */
977#define V4L2_DV_1080P24 14 /* SMPTE 296M */
978#define V4L2_DV_1080P25 15 /* SMPTE 296M */
979#define V4L2_DV_1080P30 16 /* SMPTE 296M */
980#define V4L2_DV_1080P50 17 /* BT.1120 */
981#define V4L2_DV_1080P60 18 /* BT.1120 */
982
983/*
984 * D V B T T I M I N G S
985 */
986
987/** struct v4l2_bt_timings - BT.656/BT.1120 timing data
988 * @width: total width of the active video in pixels
989 * @height: total height of the active video in lines
990 * @interlaced: Interlaced or progressive
991 * @polarities: Positive or negative polarities
992 * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
993 * @hfrontporch:Horizontal front porch in pixels
994 * @hsync: Horizontal Sync length in pixels
995 * @hbackporch: Horizontal back porch in pixels
996 * @vfrontporch:Vertical front porch in lines
997 * @vsync: Vertical Sync length in lines
998 * @vbackporch: Vertical back porch in lines
999 * @il_vfrontporch:Vertical front porch for the even field
1000 * (aka field 2) of interlaced field formats
1001 * @il_vsync: Vertical Sync length for the even field
1002 * (aka field 2) of interlaced field formats
1003 * @il_vbackporch:Vertical back porch for the even field
1004 * (aka field 2) of interlaced field formats
1005 * @standards: Standards the timing belongs to
1006 * @flags: Flags
1007 * @reserved: Reserved fields, must be zeroed.
1008 *
1009 * A note regarding vertical interlaced timings: height refers to the total
1010 * height of the active video frame (= two fields). The blanking timings refer
1011 * to the blanking of each field. So the height of the total frame is
1012 * calculated as follows:
1013 *
1014 * tot_height = height + vfrontporch + vsync + vbackporch +
1015 * il_vfrontporch + il_vsync + il_vbackporch
1016 *
1017 * The active height of each field is height / 2.
1018 */
1019struct v4l2_bt_timings {
1020 __u32 width;
1021 __u32 height;
1022 __u32 interlaced;
1023 __u32 polarities;
1024 __u64 pixelclock;
1025 __u32 hfrontporch;
1026 __u32 hsync;
1027 __u32 hbackporch;
1028 __u32 vfrontporch;
1029 __u32 vsync;
1030 __u32 vbackporch;
1031 __u32 il_vfrontporch;
1032 __u32 il_vsync;
1033 __u32 il_vbackporch;
1034 __u32 standards;
1035 __u32 flags;
1036 __u32 reserved[14];
1037} __attribute__ ((packed));
1038
1039/* Interlaced or progressive format */
1040#define V4L2_DV_PROGRESSIVE 0
1041#define V4L2_DV_INTERLACED 1
1042
1043/* Polarities. If bit is not set, it is assumed to be negative polarity */
1044#define V4L2_DV_VSYNC_POS_POL 0x00000001
1045#define V4L2_DV_HSYNC_POS_POL 0x00000002
1046
1047/* Timings standards */
1048#define V4L2_DV_BT_STD_CEA861 (1 << 0) /* CEA-861 Digital TV Profile */
1049#define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */
1050#define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */
1051#define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */
1052
1053/* Flags */
1054
1055/* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
1056 GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
1057 intervals are reduced, allowing a higher resolution over the same
1058 bandwidth. This is a read-only flag. */
1059#define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
1060/* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
1061 of six. These formats can be optionally played at 1 / 1.001 speed.
1062 This is a read-only flag. */
1063#define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
1064/* CEA-861 specific: only valid for video transmitters, the flag is cleared
1065 by receivers.
1066 If the framerate of the format is a multiple of six, then the pixelclock
1067 used to set up the transmitter is divided by 1.001 to make it compatible
1068 with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
1069 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
1070 such frequencies, then the flag will also be cleared. */
1071#define V4L2_DV_FL_REDUCED_FPS (1 << 2)
1072/* Specific to interlaced formats: if set, then field 1 is really one half-line
1073 longer and field 2 is really one half-line shorter, so each field has
1074 exactly the same number of half-lines. Whether half-lines can be detected
1075 or used depends on the hardware. */
1076#define V4L2_DV_FL_HALF_LINE (1 << 0)
1077
1078
1079/** struct v4l2_dv_timings - DV timings
1080 * @type: the type of the timings
1081 * @bt: BT656/1120 timings
1082 */
1083struct v4l2_dv_timings {
1084 __u32 type;
1085 union {
1086 struct v4l2_bt_timings bt;
1087 __u32 reserved[32];
1088 };
1089} __attribute__ ((packed));
1090
1091/* Values for the type field */
1092#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
1093
1094
1095/** struct v4l2_enum_dv_timings - DV timings enumeration
1096 * @index: enumeration index
1097 * @reserved: must be zeroed
1098 * @timings: the timings for the given index
1099 */
1100struct v4l2_enum_dv_timings {
1101 __u32 index;
1102 __u32 reserved[3];
1103 struct v4l2_dv_timings timings;
1104};
1105
1106/** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
1107 * @min_width: width in pixels
1108 * @max_width: width in pixels
1109 * @min_height: height in lines
1110 * @max_height: height in lines
1111 * @min_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1112 * @max_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
1113 * @standards: Supported standards
1114 * @capabilities: Supported capabilities
1115 * @reserved: Must be zeroed
1116 */
1117struct v4l2_bt_timings_cap {
1118 __u32 min_width;
1119 __u32 max_width;
1120 __u32 min_height;
1121 __u32 max_height;
1122 __u64 min_pixelclock;
1123 __u64 max_pixelclock;
1124 __u32 standards;
1125 __u32 capabilities;
1126 __u32 reserved[16];
1127} __attribute__ ((packed));
1128
1129/* Supports interlaced formats */
1130#define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
1131/* Supports progressive formats */
1132#define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
1133/* Supports CVT/GTF reduced blanking */
1134#define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
1135/* Supports custom formats */
1136#define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
1137
1138/** struct v4l2_dv_timings_cap - DV timings capabilities
1139 * @type: the type of the timings (same as in struct v4l2_dv_timings)
1140 * @bt: the BT656/1120 timings capabilities
1141 */
1142struct v4l2_dv_timings_cap {
1143 __u32 type;
1144 __u32 reserved[3];
1145 union {
1146 struct v4l2_bt_timings_cap bt;
1147 __u32 raw_data[32];
1148 };
1149};
1150
1151
1152/*
1153 * V I D E O I N P U T S
1154 */
1155struct v4l2_input {
1156 __u32 index; /* Which input */
1157 __u8 name[32]; /* Label */
1158 __u32 type; /* Type of input */
1159 __u32 audioset; /* Associated audios (bitfield) */
1160 __u32 tuner; /* enum v4l2_tuner_type */
1161 v4l2_std_id std;
1162 __u32 status;
1163 __u32 capabilities;
1164 __u32 reserved[3];
1165};
1166
1167/* Values for the 'type' field */
1168#define V4L2_INPUT_TYPE_TUNER 1
1169#define V4L2_INPUT_TYPE_CAMERA 2
1170
1171/* field 'status' - general */
1172#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
1173#define V4L2_IN_ST_NO_SIGNAL 0x00000002
1174#define V4L2_IN_ST_NO_COLOR 0x00000004
1175
1176/* field 'status' - sensor orientation */
1177/* If sensor is mounted upside down set both bits */
1178#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
1179#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
1180
1181/* field 'status' - analog */
1182#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
1183#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
1184
1185/* field 'status' - digital */
1186#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
1187#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
1188#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
1189
1190/* field 'status' - VCR and set-top box */
1191#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
1192#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
1193#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
1194
1195/* capabilities flags */
1196#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1197#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1198#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
1199#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
1200
1201/*
1202 * V I D E O O U T P U T S
1203 */
1204struct v4l2_output {
1205 __u32 index; /* Which output */
1206 __u8 name[32]; /* Label */
1207 __u32 type; /* Type of output */
1208 __u32 audioset; /* Associated audios (bitfield) */
1209 __u32 modulator; /* Associated modulator */
1210 v4l2_std_id std;
1211 __u32 capabilities;
1212 __u32 reserved[3];
1213};
1214/* Values for the 'type' field */
1215#define V4L2_OUTPUT_TYPE_MODULATOR 1
1216#define V4L2_OUTPUT_TYPE_ANALOG 2
1217#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
1218
1219/* capabilities flags */
1220#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
1221#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1222#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
1223#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
1224
1225/*
1226 * C O N T R O L S
1227 */
1228struct v4l2_control {
1229 __u32 id;
1230 __s32 value;
1231};
1232
1233struct v4l2_ext_control {
1234 __u32 id;
1235 __u32 size;
1236 __u32 reserved2[1];
1237 union {
1238 __s32 value;
1239 __s64 value64;
1240 char *string;
1241 };
1242} __attribute__ ((packed));
1243
1244struct v4l2_ext_controls {
1245 __u32 ctrl_class;
1246 __u32 count;
1247 __u32 error_idx;
1248 __u32 reserved[2];
1249 struct v4l2_ext_control *controls;
1250};
1251
1252#define V4L2_CTRL_ID_MASK (0x0fffffff)
1253#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
1254#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
1255
1256enum v4l2_ctrl_type {
1257 V4L2_CTRL_TYPE_INTEGER = 1,
1258 V4L2_CTRL_TYPE_BOOLEAN = 2,
1259 V4L2_CTRL_TYPE_MENU = 3,
1260 V4L2_CTRL_TYPE_BUTTON = 4,
1261 V4L2_CTRL_TYPE_INTEGER64 = 5,
1262 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1263 V4L2_CTRL_TYPE_STRING = 7,
1264 V4L2_CTRL_TYPE_BITMASK = 8,
1265 V4L2_CTRL_TYPE_INTEGER_MENU = 9,
1266};
1267
1268/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
1269struct v4l2_queryctrl {
1270 __u32 id;
1271 __u32 type; /* enum v4l2_ctrl_type */
1272 __u8 name[32]; /* Whatever */
1273 __s32 minimum; /* Note signedness */
1274 __s32 maximum;
1275 __s32 step;
1276 __s32 default_value;
1277 __u32 flags;
1278 __u32 reserved[2];
1279};
1280
1281/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
1282struct v4l2_querymenu {
1283 __u32 id;
1284 __u32 index;
1285 union {
1286 __u8 name[32]; /* Whatever */
1287 __s64 value;
1288 };
1289 __u32 reserved;
1290} __attribute__ ((packed));
1291
1292/* Control flags */
1293#define V4L2_CTRL_FLAG_DISABLED 0x0001
1294#define V4L2_CTRL_FLAG_GRABBED 0x0002
1295#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
1296#define V4L2_CTRL_FLAG_UPDATE 0x0008
1297#define V4L2_CTRL_FLAG_INACTIVE 0x0010
1298#define V4L2_CTRL_FLAG_SLIDER 0x0020
1299#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
1300#define V4L2_CTRL_FLAG_VOLATILE 0x0080
1301
1302/* Query flag, to be ORed with the control ID */
1303#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
1304
1305/* User-class control IDs defined by V4L2 */
1306#define V4L2_CID_MAX_CTRLS 1024
1307/* IDs reserved for driver specific controls */
1308#define V4L2_CID_PRIVATE_BASE 0x08000000
1309
1310
1311/* DV-class control IDs defined by V4L2 */
1312#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
1313#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
1314
1315#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
1316#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
1317#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
1318#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
1319enum v4l2_dv_tx_mode {
1320 V4L2_DV_TX_MODE_DVI_D = 0,
1321 V4L2_DV_TX_MODE_HDMI = 1,
1322};
1323#define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5)
1324enum v4l2_dv_rgb_range {
1325 V4L2_DV_RGB_RANGE_AUTO = 0,
1326 V4L2_DV_RGB_RANGE_LIMITED = 1,
1327 V4L2_DV_RGB_RANGE_FULL = 2,
1328};
1329
1330#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
1331#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
1332
1333/*
1334 * T U N I N G
1335 */
1336struct v4l2_tuner {
1337 __u32 index;
1338 __u8 name[32];
1339 __u32 type; /* enum v4l2_tuner_type */
1340 __u32 capability;
1341 __u32 rangelow;
1342 __u32 rangehigh;
1343 __u32 rxsubchans;
1344 __u32 audmode;
1345 __s32 signal;
1346 __s32 afc;
1347 __u32 reserved[4];
1348};
1349
1350struct v4l2_modulator {
1351 __u32 index;
1352 __u8 name[32];
1353 __u32 capability;
1354 __u32 rangelow;
1355 __u32 rangehigh;
1356 __u32 txsubchans;
1357 __u32 reserved[4];
1358};
1359
1360/* Flags for the 'capability' field */
1361#define V4L2_TUNER_CAP_LOW 0x0001
1362#define V4L2_TUNER_CAP_NORM 0x0002
1363#define V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
1364#define V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
1365#define V4L2_TUNER_CAP_STEREO 0x0010
1366#define V4L2_TUNER_CAP_LANG2 0x0020
1367#define V4L2_TUNER_CAP_SAP 0x0020
1368#define V4L2_TUNER_CAP_LANG1 0x0040
1369#define V4L2_TUNER_CAP_RDS 0x0080
1370#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1371#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1372#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
1373#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
1374
1375/* Flags for the 'rxsubchans' field */
1376#define V4L2_TUNER_SUB_MONO 0x0001
1377#define V4L2_TUNER_SUB_STEREO 0x0002
1378#define V4L2_TUNER_SUB_LANG2 0x0004
1379#define V4L2_TUNER_SUB_SAP 0x0004
1380#define V4L2_TUNER_SUB_LANG1 0x0008
1381#define V4L2_TUNER_SUB_RDS 0x0010
1382
1383/* Values for the 'audmode' field */
1384#define V4L2_TUNER_MODE_MONO 0x0000
1385#define V4L2_TUNER_MODE_STEREO 0x0001
1386#define V4L2_TUNER_MODE_LANG2 0x0002
1387#define V4L2_TUNER_MODE_SAP 0x0002
1388#define V4L2_TUNER_MODE_LANG1 0x0003
1389#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
1390
1391struct v4l2_frequency {
1392 __u32 tuner;
1393 __u32 type; /* enum v4l2_tuner_type */
1394 __u32 frequency;
1395 __u32 reserved[8];
1396};
1397
1398#define V4L2_BAND_MODULATION_VSB (1 << 1)
1399#define V4L2_BAND_MODULATION_FM (1 << 2)
1400#define V4L2_BAND_MODULATION_AM (1 << 3)
1401
1402struct v4l2_frequency_band {
1403 __u32 tuner;
1404 __u32 type; /* enum v4l2_tuner_type */
1405 __u32 index;
1406 __u32 capability;
1407 __u32 rangelow;
1408 __u32 rangehigh;
1409 __u32 modulation;
1410 __u32 reserved[9];
1411};
1412
1413struct v4l2_hw_freq_seek {
1414 __u32 tuner;
1415 __u32 type; /* enum v4l2_tuner_type */
1416 __u32 seek_upward;
1417 __u32 wrap_around;
1418 __u32 spacing;
1419 __u32 rangelow;
1420 __u32 rangehigh;
1421 __u32 reserved[5];
1422};
1423
1424/*
1425 * R D S
1426 */
1427
1428struct v4l2_rds_data {
1429 __u8 lsb;
1430 __u8 msb;
1431 __u8 block;
1432} __attribute__ ((packed));
1433
1434#define V4L2_RDS_BLOCK_MSK 0x7
1435#define V4L2_RDS_BLOCK_A 0
1436#define V4L2_RDS_BLOCK_B 1
1437#define V4L2_RDS_BLOCK_C 2
1438#define V4L2_RDS_BLOCK_D 3
1439#define V4L2_RDS_BLOCK_C_ALT 4
1440#define V4L2_RDS_BLOCK_INVALID 7
1441
1442#define V4L2_RDS_BLOCK_CORRECTED 0x40
1443#define V4L2_RDS_BLOCK_ERROR 0x80
1444
1445/*
1446 * A U D I O
1447 */
1448struct v4l2_audio {
1449 __u32 index;
1450 __u8 name[32];
1451 __u32 capability;
1452 __u32 mode;
1453 __u32 reserved[2];
1454};
1455
1456/* Flags for the 'capability' field */
1457#define V4L2_AUDCAP_STEREO 0x00001
1458#define V4L2_AUDCAP_AVL 0x00002
1459
1460/* Flags for the 'mode' field */
1461#define V4L2_AUDMODE_AVL 0x00001
1462
1463struct v4l2_audioout {
1464 __u32 index;
1465 __u8 name[32];
1466 __u32 capability;
1467 __u32 mode;
1468 __u32 reserved[2];
1469};
1470
1471/*
1472 * M P E G S E R V I C E S
1473 *
1474 * NOTE: EXPERIMENTAL API
1475 */
1476#if 1
1477#define V4L2_ENC_IDX_FRAME_I (0)
1478#define V4L2_ENC_IDX_FRAME_P (1)
1479#define V4L2_ENC_IDX_FRAME_B (2)
1480#define V4L2_ENC_IDX_FRAME_MASK (0xf)
1481
1482struct v4l2_enc_idx_entry {
1483 __u64 offset;
1484 __u64 pts;
1485 __u32 length;
1486 __u32 flags;
1487 __u32 reserved[2];
1488};
1489
1490#define V4L2_ENC_IDX_ENTRIES (64)
1491struct v4l2_enc_idx {
1492 __u32 entries;
1493 __u32 entries_cap;
1494 __u32 reserved[4];
1495 struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
1496};
1497
1498
1499#define V4L2_ENC_CMD_START (0)
1500#define V4L2_ENC_CMD_STOP (1)
1501#define V4L2_ENC_CMD_PAUSE (2)
1502#define V4L2_ENC_CMD_RESUME (3)
1503
1504/* Flags for V4L2_ENC_CMD_STOP */
1505#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
1506
1507struct v4l2_encoder_cmd {
1508 __u32 cmd;
1509 __u32 flags;
1510 union {
1511 struct {
1512 __u32 data[8];
1513 } raw;
1514 };
1515};
1516
1517/* Decoder commands */
1518#define V4L2_DEC_CMD_START (0)
1519#define V4L2_DEC_CMD_STOP (1)
1520#define V4L2_DEC_CMD_PAUSE (2)
1521#define V4L2_DEC_CMD_RESUME (3)
1522
1523/* Flags for V4L2_DEC_CMD_START */
1524#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
1525
1526/* Flags for V4L2_DEC_CMD_PAUSE */
1527#define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)
1528
1529/* Flags for V4L2_DEC_CMD_STOP */
1530#define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
1531#define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)
1532
1533/* Play format requirements (returned by the driver): */
1534
1535/* The decoder has no special format requirements */
1536#define V4L2_DEC_START_FMT_NONE (0)
1537/* The decoder requires full GOPs */
1538#define V4L2_DEC_START_FMT_GOP (1)
1539
1540/* The structure must be zeroed before use by the application
1541 This ensures it can be extended safely in the future. */
1542struct v4l2_decoder_cmd {
1543 __u32 cmd;
1544 __u32 flags;
1545 union {
1546 struct {
1547 __u64 pts;
1548 } stop;
1549
1550 struct {
1551 /* 0 or 1000 specifies normal speed,
1552 1 specifies forward single stepping,
1553 -1 specifies backward single stepping,
1554 >1: playback at speed/1000 of the normal speed,
1555 <-1: reverse playback at (-speed/1000) of the normal speed. */
1556 __s32 speed;
1557 __u32 format;
1558 } start;
1559
1560 struct {
1561 __u32 data[16];
1562 } raw;
1563 };
1564};
1565#endif
1566
1567
1568/*
1569 * D A T A S E R V I C E S ( V B I )
1570 *
1571 * Data services API by Michael Schimek
1572 */
1573
1574/* Raw VBI */
1575struct v4l2_vbi_format {
1576 __u32 sampling_rate; /* in 1 Hz */
1577 __u32 offset;
1578 __u32 samples_per_line;
1579 __u32 sample_format; /* V4L2_PIX_FMT_* */
1580 __s32 start[2];
1581 __u32 count[2];
1582 __u32 flags; /* V4L2_VBI_* */
1583 __u32 reserved[2]; /* must be zero */
1584};
1585
1586/* VBI flags */
1587#define V4L2_VBI_UNSYNC (1 << 0)
1588#define V4L2_VBI_INTERLACED (1 << 1)
1589
1590/* Sliced VBI
1591 *
1592 * This implements is a proposal V4L2 API to allow SLICED VBI
1593 * required for some hardware encoders. It should change without
1594 * notice in the definitive implementation.
1595 */
1596
1597struct v4l2_sliced_vbi_format {
1598 __u16 service_set;
1599 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1600 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1601 (equals frame lines 313-336 for 625 line video
1602 standards, 263-286 for 525 line standards) */
1603 __u16 service_lines[2][24];
1604 __u32 io_size;
1605 __u32 reserved[2]; /* must be zero */
1606};
1607
1608/* Teletext World System Teletext
1609 (WST), defined on ITU-R BT.653-2 */
1610#define V4L2_SLICED_TELETEXT_B (0x0001)
1611/* Video Program System, defined on ETS 300 231*/
1612#define V4L2_SLICED_VPS (0x0400)
1613/* Closed Caption, defined on EIA-608 */
1614#define V4L2_SLICED_CAPTION_525 (0x1000)
1615/* Wide Screen System, defined on ITU-R BT1119.1 */
1616#define V4L2_SLICED_WSS_625 (0x4000)
1617
1618#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
1619#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
1620
1621struct v4l2_sliced_vbi_cap {
1622 __u16 service_set;
1623 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
1624 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
1625 (equals frame lines 313-336 for 625 line video
1626 standards, 263-286 for 525 line standards) */
1627 __u16 service_lines[2][24];
1628 __u32 type; /* enum v4l2_buf_type */
1629 __u32 reserved[3]; /* must be 0 */
1630};
1631
1632struct v4l2_sliced_vbi_data {
1633 __u32 id;
1634 __u32 field; /* 0: first field, 1: second field */
1635 __u32 line; /* 1-23 */
1636 __u32 reserved; /* must be 0 */
1637 __u8 data[48];
1638};
1639
1640/*
1641 * Sliced VBI data inserted into MPEG Streams
1642 */
1643
1644/*
1645 * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
1646 *
1647 * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
1648 * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
1649 * data
1650 *
1651 * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
1652 * definitions are not included here. See the MPEG-2 specifications for details
1653 * on these headers.
1654 */
1655
1656/* Line type IDs */
1657#define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
1658#define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
1659#define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
1660#define V4L2_MPEG_VBI_IVTV_VPS (7)
1661
1662struct v4l2_mpeg_vbi_itv0_line {
1663 __u8 id; /* One of V4L2_MPEG_VBI_IVTV_* above */
1664 __u8 data[42]; /* Sliced VBI data for the line */
1665} __attribute__ ((packed));
1666
1667struct v4l2_mpeg_vbi_itv0 {
1668 __le32 linemask[2]; /* Bitmasks of VBI service lines present */
1669 struct v4l2_mpeg_vbi_itv0_line line[35];
1670} __attribute__ ((packed));
1671
1672struct v4l2_mpeg_vbi_ITV0 {
1673 struct v4l2_mpeg_vbi_itv0_line line[36];
1674} __attribute__ ((packed));
1675
1676#define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
1677#define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
1678
1679struct v4l2_mpeg_vbi_fmt_ivtv {
1680 __u8 magic[4];
1681 union {
1682 struct v4l2_mpeg_vbi_itv0 itv0;
1683 struct v4l2_mpeg_vbi_ITV0 ITV0;
1684 };
1685} __attribute__ ((packed));
1686
1687/*
1688 * A G G R E G A T E S T R U C T U R E S
1689 */
1690
1691/**
1692 * struct v4l2_plane_pix_format - additional, per-plane format definition
1693 * @sizeimage: maximum size in bytes required for data, for which
1694 * this plane will be used
1695 * @bytesperline: distance in bytes between the leftmost pixels in two
1696 * adjacent lines
1697 */
1698struct v4l2_plane_pix_format {
1699 __u32 sizeimage;
1700 __u16 bytesperline;
1701 __u16 reserved[7];
1702} __attribute__ ((packed));
1703
1704/**
1705 * struct v4l2_pix_format_mplane - multiplanar format definition
1706 * @width: image width in pixels
1707 * @height: image height in pixels
1708 * @pixelformat: little endian four character code (fourcc)
1709 * @field: enum v4l2_field; field order (for interlaced video)
1710 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
1711 * @plane_fmt: per-plane information
1712 * @num_planes: number of planes for this format
1713 */
1714struct v4l2_pix_format_mplane {
1715 __u32 width;
1716 __u32 height;
1717 __u32 pixelformat;
1718 __u32 field;
1719 __u32 colorspace;
1720
1721 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
1722 __u8 num_planes;
1723 __u8 reserved[11];
1724} __attribute__ ((packed));
1725
1726/**
1727 * struct v4l2_format - stream data format
1728 * @type: enum v4l2_buf_type; type of the data stream
1729 * @pix: definition of an image format
1730 * @pix_mp: definition of a multiplanar image format
1731 * @win: definition of an overlaid image
1732 * @vbi: raw VBI capture or output parameters
1733 * @sliced: sliced VBI capture or output parameters
1734 * @raw_data: placeholder for future extensions and custom formats
1735 */
1736struct v4l2_format {
1737 __u32 type;
1738 union {
1739 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
1740 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
1741 struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
1742 struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
1743 struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
1744 __u8 raw_data[200]; /* user-defined */
1745 } fmt;
1746};
1747
1748/* Stream type-dependent parameters
1749 */
1750struct v4l2_streamparm {
1751 __u32 type; /* enum v4l2_buf_type */
1752 union {
1753 struct v4l2_captureparm capture;
1754 struct v4l2_outputparm output;
1755 __u8 raw_data[200]; /* user-defined */
1756 } parm;
1757};
1758
1759/*
1760 * E V E N T S
1761 */
1762
1763#define V4L2_EVENT_ALL 0
1764#define V4L2_EVENT_VSYNC 1
1765#define V4L2_EVENT_EOS 2
1766#define V4L2_EVENT_CTRL 3
1767#define V4L2_EVENT_FRAME_SYNC 4
1768#define V4L2_EVENT_PRIVATE_START 0x08000000
1769
1770/* Payload for V4L2_EVENT_VSYNC */
1771struct v4l2_event_vsync {
1772 /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
1773 __u8 field;
1774} __attribute__ ((packed));
1775
1776/* Payload for V4L2_EVENT_CTRL */
1777#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
1778#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
1779
1780struct v4l2_event_ctrl {
1781 __u32 changes;
1782 __u32 type;
1783 union {
1784 __s32 value;
1785 __s64 value64;
1786 };
1787 __u32 flags;
1788 __s32 minimum;
1789 __s32 maximum;
1790 __s32 step;
1791 __s32 default_value;
1792};
1793
1794struct v4l2_event_frame_sync {
1795 __u32 frame_sequence;
1796};
1797
1798struct v4l2_event {
1799 __u32 type;
1800 union {
1801 struct v4l2_event_vsync vsync;
1802 struct v4l2_event_ctrl ctrl;
1803 struct v4l2_event_frame_sync frame_sync;
1804 __u8 data[64];
1805 } u;
1806 __u32 pending;
1807 __u32 sequence;
1808 struct timespec timestamp;
1809 __u32 id;
1810 __u32 reserved[8];
1811};
1812
1813#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
1814#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
1815
1816struct v4l2_event_subscription {
1817 __u32 type;
1818 __u32 id;
1819 __u32 flags;
1820 __u32 reserved[5];
1821};
1822
1823/*
1824 * A D V A N C E D D E B U G G I N G
1825 *
1826 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
1827 * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
1828 */
1829
1830/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
1831
1832#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
1833#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1834#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1835#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
1836
1837struct v4l2_dbg_match {
1838 __u32 type; /* Match type */
1839 union { /* Match this chip, meaning determined by type */
1840 __u32 addr;
1841 char name[32];
1842 };
1843} __attribute__ ((packed));
1844
1845struct v4l2_dbg_register {
1846 struct v4l2_dbg_match match;
1847 __u32 size; /* register size in bytes */
1848 __u64 reg;
1849 __u64 val;
1850} __attribute__ ((packed));
1851
1852/* VIDIOC_DBG_G_CHIP_IDENT */
1853struct v4l2_dbg_chip_ident {
1854 struct v4l2_dbg_match match;
1855 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
1856 __u32 revision; /* chip revision, chip specific */
1857} __attribute__ ((packed));
1858
1859/**
1860 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
1861 * @index: on return, index of the first created buffer
1862 * @count: entry: number of requested buffers,
1863 * return: number of created buffers
1864 * @memory: enum v4l2_memory; buffer memory type
1865 * @format: frame format, for which buffers are requested
1866 * @reserved: future extensions
1867 */
1868struct v4l2_create_buffers {
1869 __u32 index;
1870 __u32 count;
1871 __u32 memory;
1872 struct v4l2_format format;
1873 __u32 reserved[8];
1874};
1875
1876/*
1877 * 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
1878 *
1879 */
1880#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
1881#define VIDIOC_RESERVED _IO('V', 1)
1882#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
1883#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
1884#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
1885#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
1886#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
1887#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
1888#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1889#define VIDIOC_OVERLAY _IOW('V', 14, int)
1890#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
1891#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1892#define VIDIOC_STREAMON _IOW('V', 18, int)
1893#define VIDIOC_STREAMOFF _IOW('V', 19, int)
1894#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
1895#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
1896#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
1897#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
1898#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
1899#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
1900#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
1901#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
1902#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
1903#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
1904#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
1905#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
1906#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
1907#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
1908#define VIDIOC_G_INPUT _IOR('V', 38, int)
1909#define VIDIOC_S_INPUT _IOWR('V', 39, int)
1910#define VIDIOC_G_OUTPUT _IOR('V', 46, int)
1911#define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
1912#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
1913#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
1914#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
1915#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
1916#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
1917#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
1918#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
1919#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
1920#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
1921#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
1922#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
1923#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
1924#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
1925#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
1926#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
1927#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
1928#define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */
1929#define VIDIOC_S_PRIORITY _IOW('V', 68, __u32) /* enum v4l2_priority */
1930#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
1931#define VIDIOC_LOG_STATUS _IO('V', 70)
1932#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
1933#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
1934#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
1935#if 1
1936#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
1937#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
1938#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
1939#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
1940#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
1941#endif
1942
1943#if 1
1944/* Experimental, meant for debugging, testing and internal use.
1945 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
1946 You must be root to use these ioctls. Never use these in applications! */
1947#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
1948#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
1949
1950/* Experimental, meant for debugging, testing and internal use.
1951 Never use this ioctl in applications! */
1952#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
1953#endif
1954
1955#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
1956
1957/* These four DV Preset ioctls are deprecated in favor of the DV Timings
1958 ioctls. */
1959#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset)
1960#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset)
1961#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset)
1962#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset)
1963#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
1964#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
1965#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
1966#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
1967#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
1968
1969/* Experimental, the below two ioctls may change over the next couple of kernel
1970 versions */
1971#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
1972#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
1973
1974/* Experimental selection API */
1975#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
1976#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
1977
1978/* Experimental, these two ioctls may change over the next couple of kernel
1979 versions. */
1980#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
1981#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
1982
1983/* Experimental, these three ioctls may change over the next couple of kernel
1984 versions. */
1985#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
1986#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
1987#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
1988
1989/* Experimental, this ioctl may change over the next couple of kernel
1990 versions. */
1991#define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
1992
1993/* Reminder: when adding new ioctls please add support for them to
1994 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1995
1996#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1997
1998#endif /* _UAPI__LINUX_VIDEODEV2_H */
diff --git a/include/linux/virtio_9p.h b/include/uapi/linux/virtio_9p.h
index 277c4ad44e8..277c4ad44e8 100644
--- a/include/linux/virtio_9p.h
+++ b/include/uapi/linux/virtio_9p.h
diff --git a/include/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 652dc8bea92..652dc8bea92 100644
--- a/include/linux/virtio_balloon.h
+++ b/include/uapi/linux/virtio_balloon.h
diff --git a/include/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h
index 6d8e61c4856..6d8e61c4856 100644
--- a/include/linux/virtio_blk.h
+++ b/include/uapi/linux/virtio_blk.h
diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
new file mode 100644
index 00000000000..b7cda390fd0
--- /dev/null
+++ b/include/uapi/linux/virtio_config.h
@@ -0,0 +1,54 @@
1#ifndef _UAPI_LINUX_VIRTIO_CONFIG_H
2#define _UAPI_LINUX_VIRTIO_CONFIG_H
3/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
4 * anyone can use the definitions to implement compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
28
29/* Virtio devices use a standardized configuration space to define their
30 * features and pass configuration information, but each implementation can
31 * store and access that space differently. */
32#include <linux/types.h>
33
34/* Status byte for guest to report progress, and synchronize features. */
35/* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
36#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1
37/* We have found a driver for the device. */
38#define VIRTIO_CONFIG_S_DRIVER 2
39/* Driver has used its parts of the config, and is happy */
40#define VIRTIO_CONFIG_S_DRIVER_OK 4
41/* We've given up on this device. */
42#define VIRTIO_CONFIG_S_FAILED 0x80
43
44/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
45 * transport being used (eg. virtio_ring), the rest are per-device feature
46 * bits. */
47#define VIRTIO_TRANSPORT_F_START 28
48#define VIRTIO_TRANSPORT_F_END 32
49
50/* Do we get callbacks when the ring is completely used, even if we've
51 * suppressed them? */
52#define VIRTIO_F_NOTIFY_ON_EMPTY 24
53
54#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
index 00000000000..ee13ab6c361
--- /dev/null
+++ b/include/uapi/linux/virtio_console.h
@@ -0,0 +1,74 @@
1/*
2 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
3 * anyone can use the definitions to implement compatible drivers/servers:
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
30 * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
31 */
32#ifndef _UAPI_LINUX_VIRTIO_CONSOLE_H
33#define _UAPI_LINUX_VIRTIO_CONSOLE_H
34#include <linux/types.h>
35#include <linux/virtio_ids.h>
36#include <linux/virtio_config.h>
37
38/* Feature bits */
39#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
40#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
41
42#define VIRTIO_CONSOLE_BAD_ID (~(u32)0)
43
44struct virtio_console_config {
45 /* colums of the screens */
46 __u16 cols;
47 /* rows of the screens */
48 __u16 rows;
49 /* max. number of ports this device can hold */
50 __u32 max_nr_ports;
51} __attribute__((packed));
52
53/*
54 * A message that's passed between the Host and the Guest for a
55 * particular port.
56 */
57struct virtio_console_control {
58 __u32 id; /* Port number */
59 __u16 event; /* The kind of control event (see below) */
60 __u16 value; /* Extra information for the key */
61};
62
63/* Some events for control messages */
64#define VIRTIO_CONSOLE_DEVICE_READY 0
65#define VIRTIO_CONSOLE_PORT_ADD 1
66#define VIRTIO_CONSOLE_PORT_REMOVE 2
67#define VIRTIO_CONSOLE_PORT_READY 3
68#define VIRTIO_CONSOLE_CONSOLE_PORT 4
69#define VIRTIO_CONSOLE_RESIZE 5
70#define VIRTIO_CONSOLE_PORT_OPEN 6
71#define VIRTIO_CONSOLE_PORT_NAME 7
72
73
74#endif /* _UAPI_LINUX_VIRTIO_CONSOLE_H */
diff --git a/include/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
index 270fb22c581..270fb22c581 100644
--- a/include/linux/virtio_ids.h
+++ b/include/uapi/linux/virtio_ids.h
diff --git a/include/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 2470f541af5..2470f541af5 100644
--- a/include/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
diff --git a/include/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index ea66f3f60d6..ea66f3f60d6 100644
--- a/include/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h
new file mode 100644
index 00000000000..a99f9b7caa6
--- /dev/null
+++ b/include/uapi/linux/virtio_ring.h
@@ -0,0 +1,163 @@
1#ifndef _UAPI_LINUX_VIRTIO_RING_H
2#define _UAPI_LINUX_VIRTIO_RING_H
3/* An interface for efficient virtio implementation, currently for use by KVM
4 * and lguest, but hopefully others soon. Do NOT change this since it will
5 * break existing servers and clients.
6 *
7 * This header is BSD licensed so anyone can use the definitions to implement
8 * compatible drivers/servers.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of IBM nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * Copyright Rusty Russell IBM Corporation 2007. */
34#include <linux/types.h>
35
36/* This marks a buffer as continuing via the next field. */
37#define VRING_DESC_F_NEXT 1
38/* This marks a buffer as write-only (otherwise read-only). */
39#define VRING_DESC_F_WRITE 2
40/* This means the buffer contains a list of buffer descriptors. */
41#define VRING_DESC_F_INDIRECT 4
42
43/* The Host uses this in used->flags to advise the Guest: don't kick me when
44 * you add a buffer. It's unreliable, so it's simply an optimization. Guest
45 * will still kick if it's out of buffers. */
46#define VRING_USED_F_NO_NOTIFY 1
47/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
48 * when you consume a buffer. It's unreliable, so it's simply an
49 * optimization. */
50#define VRING_AVAIL_F_NO_INTERRUPT 1
51
52/* We support indirect buffer descriptors */
53#define VIRTIO_RING_F_INDIRECT_DESC 28
54
55/* The Guest publishes the used index for which it expects an interrupt
56 * at the end of the avail ring. Host should ignore the avail->flags field. */
57/* The Host publishes the avail index for which it expects a kick
58 * at the end of the used ring. Guest should ignore the used->flags field. */
59#define VIRTIO_RING_F_EVENT_IDX 29
60
61/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
62struct vring_desc {
63 /* Address (guest-physical). */
64 __u64 addr;
65 /* Length. */
66 __u32 len;
67 /* The flags as indicated above. */
68 __u16 flags;
69 /* We chain unused descriptors via this, too */
70 __u16 next;
71};
72
73struct vring_avail {
74 __u16 flags;
75 __u16 idx;
76 __u16 ring[];
77};
78
79/* u32 is used here for ids for padding reasons. */
80struct vring_used_elem {
81 /* Index of start of used descriptor chain. */
82 __u32 id;
83 /* Total length of the descriptor chain which was used (written to) */
84 __u32 len;
85};
86
87struct vring_used {
88 __u16 flags;
89 __u16 idx;
90 struct vring_used_elem ring[];
91};
92
93struct vring {
94 unsigned int num;
95
96 struct vring_desc *desc;
97
98 struct vring_avail *avail;
99
100 struct vring_used *used;
101};
102
103/* The standard layout for the ring is a continuous chunk of memory which looks
104 * like this. We assume num is a power of 2.
105 *
106 * struct vring
107 * {
108 * // The actual descriptors (16 bytes each)
109 * struct vring_desc desc[num];
110 *
111 * // A ring of available descriptor heads with free-running index.
112 * __u16 avail_flags;
113 * __u16 avail_idx;
114 * __u16 available[num];
115 * __u16 used_event_idx;
116 *
117 * // Padding to the next align boundary.
118 * char pad[];
119 *
120 * // A ring of used descriptor heads with free-running index.
121 * __u16 used_flags;
122 * __u16 used_idx;
123 * struct vring_used_elem used[num];
124 * __u16 avail_event_idx;
125 * };
126 */
127/* We publish the used event index at the end of the available ring, and vice
128 * versa. They are at the end for backwards compatibility. */
129#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
130#define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num])
131
132static inline void vring_init(struct vring *vr, unsigned int num, void *p,
133 unsigned long align)
134{
135 vr->num = num;
136 vr->desc = p;
137 vr->avail = p + num*sizeof(struct vring_desc);
138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
139 + align-1) & ~(align - 1));
140}
141
142static inline unsigned vring_size(unsigned int num, unsigned long align)
143{
144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
145 + align - 1) & ~(align - 1))
146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
147}
148
149/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
150/* Assuming a given event_idx value from the other size, if
151 * we have just incremented index from old to new_idx,
152 * should we trigger an event? */
153static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
154{
155 /* Note: Xen has similar logic for notification hold-off
156 * in include/xen/interface/io/ring.h with req_event and req_prod
157 * corresponding to event_idx + 1 and new_idx respectively.
158 * Note also that req_event and req_prod in Xen start at 1,
159 * event indexes in virtio start at 0. */
160 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
161}
162
163#endif /* _UAPI_LINUX_VIRTIO_RING_H */
diff --git a/include/linux/virtio_rng.h b/include/uapi/linux/virtio_rng.h
index c4d5de896f0..c4d5de896f0 100644
--- a/include/linux/virtio_rng.h
+++ b/include/uapi/linux/virtio_rng.h
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
new file mode 100644
index 00000000000..4b59a26799a
--- /dev/null
+++ b/include/uapi/linux/vt.h
@@ -0,0 +1,90 @@
1#ifndef _UAPI_LINUX_VT_H
2#define _UAPI_LINUX_VT_H
3
4
5/*
6 * These constants are also useful for user-level apps (e.g., VC
7 * resizing).
8 */
9#define MIN_NR_CONSOLES 1 /* must be at least 1 */
10#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
11#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
12 /* Note: the ioctl VT_GETSTATE does not work for
13 consoles 16 and higher (since it returns a short) */
14
15/* 0x56 is 'V', to avoid collision with termios and kd */
16
17#define VT_OPENQRY 0x5600 /* find available vt */
18
19struct vt_mode {
20 char mode; /* vt mode */
21 char waitv; /* if set, hang on writes if not active */
22 short relsig; /* signal to raise on release req */
23 short acqsig; /* signal to raise on acquisition */
24 short frsig; /* unused (set to 0) */
25};
26#define VT_GETMODE 0x5601 /* get mode of active vt */
27#define VT_SETMODE 0x5602 /* set mode of active vt */
28#define VT_AUTO 0x00 /* auto vt switching */
29#define VT_PROCESS 0x01 /* process controls switching */
30#define VT_ACKACQ 0x02 /* acknowledge switch */
31
32struct vt_stat {
33 unsigned short v_active; /* active vt */
34 unsigned short v_signal; /* signal to send */
35 unsigned short v_state; /* vt bitmask */
36};
37#define VT_GETSTATE 0x5603 /* get global vt state info */
38#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
39
40#define VT_RELDISP 0x5605 /* release display */
41
42#define VT_ACTIVATE 0x5606 /* make vt active */
43#define VT_WAITACTIVE 0x5607 /* wait for vt active */
44#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
45
46struct vt_sizes {
47 unsigned short v_rows; /* number of rows */
48 unsigned short v_cols; /* number of columns */
49 unsigned short v_scrollsize; /* number of lines of scrollback */
50};
51#define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
52
53struct vt_consize {
54 unsigned short v_rows; /* number of rows */
55 unsigned short v_cols; /* number of columns */
56 unsigned short v_vlin; /* number of pixel rows on screen */
57 unsigned short v_clin; /* number of pixel rows per character */
58 unsigned short v_vcol; /* number of pixel columns on screen */
59 unsigned short v_ccol; /* number of pixel columns per character */
60};
61#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
62#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
63#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
64#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
65
66struct vt_event {
67 unsigned int event;
68#define VT_EVENT_SWITCH 0x0001 /* Console switch */
69#define VT_EVENT_BLANK 0x0002 /* Screen blank */
70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
71#define VT_EVENT_RESIZE 0x0008 /* Resize display */
72#define VT_MAX_EVENT 0x000F
73 unsigned int oldev; /* Old console */
74 unsigned int newev; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */
76};
77
78#define VT_WAITEVENT 0x560E /* Wait for an event */
79
80struct vt_setactivate {
81 unsigned int console;
82 struct vt_mode mode;
83};
84
85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
86
87
88#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
89
90#endif /* _UAPI_LINUX_VT_H */
diff --git a/include/uapi/linux/wait.h b/include/uapi/linux/wait.h
new file mode 100644
index 00000000000..9393eead23e
--- /dev/null
+++ b/include/uapi/linux/wait.h
@@ -0,0 +1,21 @@
1#ifndef _UAPI_LINUX_WAIT_H
2#define _UAPI_LINUX_WAIT_H
3
4#define WNOHANG 0x00000001
5#define WUNTRACED 0x00000002
6#define WSTOPPED WUNTRACED
7#define WEXITED 0x00000004
8#define WCONTINUED 0x00000008
9#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
10
11#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */
12#define __WALL 0x40000000 /* Wait on all children, regardless of type */
13#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
14
15/* First argument to waitid: */
16#define P_ALL 0
17#define P_PID 1
18#define P_PGID 2
19
20
21#endif /* _UAPI_LINUX_WAIT_H */
diff --git a/include/uapi/linux/wanrouter.h b/include/uapi/linux/wanrouter.h
new file mode 100644
index 00000000000..7617df2833d
--- /dev/null
+++ b/include/uapi/linux/wanrouter.h
@@ -0,0 +1,452 @@
1/*****************************************************************************
2* wanrouter.h Definitions for the WAN Multiprotocol Router Module.
3* This module provides API and common services for WAN Link
4* Drivers and is completely hardware-independent.
5*
6* Author: Nenad Corbic <ncorbic@sangoma.com>
7* Gideon Hack
8* Additions: Arnaldo Melo
9*
10* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version
15* 2 of the License, or (at your option) any later version.
16* ============================================================================
17* Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State
18* Feb 24, 2000 Nenad Corbic Added support for socket based x25api
19* Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol.
20* Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release
21* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
22* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
23* WAN_DISCONNECTING state added
24* Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t'
25* Jun 12, 1998 David Fong Added Cisco HDLC support.
26* Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to
27* 'wanif_conf_t'
28* Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t'
29* Added 'authenticator' to 'wan_ppp_conf_t'
30* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
31* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
32* Added 'enable_IPX' and 'network_number' to
33* 'wan_device_t'. Also added defines for
34* UDP PACKET TYPE, Interrupt test, critical values
35* for RACE conditions.
36* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
37* 'wan_fr_conf_t' to configure a list of dlci(s)
38* for a NODE
39* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
40* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
41* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
42* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
43* Jan 16, 1997 Gene Kozin router_devlist made public
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/
46
47#ifndef _UAPI_ROUTER_H
48#define _UAPI_ROUTER_H
49
50#define ROUTER_NAME "wanrouter" /* in case we ever change it */
51#define ROUTER_VERSION 1 /* version number */
52#define ROUTER_RELEASE 1 /* release (minor version) number */
53#define ROUTER_IOCTL 'W' /* for IOCTL calls */
54#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
55
56/* IOCTL codes for /proc/router/<device> entries (up to 255) */
57enum router_ioctls
58{
59 ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */
60 ROUTER_DOWN, /* shut down device */
61 ROUTER_STAT, /* get device status */
62 ROUTER_IFNEW, /* add interface */
63 ROUTER_IFDEL, /* delete interface */
64 ROUTER_IFSTAT, /* get interface status */
65 ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
66 ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
67};
68
69/* identifiers for displaying proc file data for dual port adapters */
70#define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */
71#define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */
72
73/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
74#define NLPID_IP 0xCC /* Internet Protocol Datagram */
75#define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */
76#define NLPID_CLNP 0x81 /* ISO/IEC 8473 */
77#define NLPID_ESIS 0x82 /* ISO/IEC 9542 */
78#define NLPID_ISIS 0x83 /* ISO/IEC ISIS */
79#define NLPID_Q933 0x08 /* CCITT Q.933 */
80
81/* Miscellaneous */
82#define WAN_IFNAME_SZ 15 /* max length of the interface name */
83#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
84#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
85#define USED_BY_FIELD 8 /* max length of the used by field */
86
87/* Defines for UDP PACKET TYPE */
88#define UDP_PTPIPE_TYPE 0x01
89#define UDP_FPIPE_TYPE 0x02
90#define UDP_CPIPE_TYPE 0x03
91#define UDP_DRVSTATS_TYPE 0x04
92#define UDP_INVALID_TYPE 0x05
93
94/* Command return code */
95#define CMD_OK 0 /* normal firmware return code */
96#define CMD_TIMEOUT 0xFF /* firmware command timed out */
97
98/* UDP Packet Management */
99#define UDP_PKT_FRM_STACK 0x00
100#define UDP_PKT_FRM_NETWORK 0x01
101
102/* Maximum interrupt test counter */
103#define MAX_INTR_TEST_COUNTER 100
104
105/* Critical Values for RACE conditions*/
106#define CRITICAL_IN_ISR 0xA1
107#define CRITICAL_INTR_HANDLED 0xB1
108
109/****** Data Types **********************************************************/
110
111/*----------------------------------------------------------------------------
112 * X.25-specific link-level configuration.
113 */
114typedef struct wan_x25_conf
115{
116 unsigned lo_pvc; /* lowest permanent circuit number */
117 unsigned hi_pvc; /* highest permanent circuit number */
118 unsigned lo_svc; /* lowest switched circuit number */
119 unsigned hi_svc; /* highest switched circuit number */
120 unsigned hdlc_window; /* HDLC window size (1..7) */
121 unsigned pkt_window; /* X.25 packet window size (1..7) */
122 unsigned t1; /* HDLC timer T1, sec (1..30) */
123 unsigned t2; /* HDLC timer T2, sec (0..29) */
124 unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */
125 unsigned n2; /* HDLC retransmission limit (1..30) */
126 unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */
127 unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */
128 unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */
129 unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */
130 unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */
131 unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */
132 unsigned r10_r20; /* RESTART retransmission limit (0..250) */
133 unsigned r12_r22; /* RESET retransmission limit (0..250) */
134 unsigned r13_r23; /* CLEAR retransmission limit (0..250) */
135 unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */
136 unsigned x25_conf_opt; /* User defined x25 config optoins */
137 unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
138 unsigned char logging; /* Control connection logging */
139 unsigned char oob_on_modem; /* Whether to send modem status to the user app */
140} wan_x25_conf_t;
141
142/*----------------------------------------------------------------------------
143 * Frame relay specific link-level configuration.
144 */
145typedef struct wan_fr_conf
146{
147 unsigned signalling; /* local in-channel signalling type */
148 unsigned t391; /* link integrity verification timer */
149 unsigned t392; /* polling verification timer */
150 unsigned n391; /* full status polling cycle counter */
151 unsigned n392; /* error threshold counter */
152 unsigned n393; /* monitored events counter */
153 unsigned dlci_num; /* number of DLCs (access node) */
154 unsigned dlci[100]; /* List of all DLCIs */
155} wan_fr_conf_t;
156
157/*----------------------------------------------------------------------------
158 * PPP-specific link-level configuration.
159 */
160typedef struct wan_ppp_conf
161{
162 unsigned restart_tmr; /* restart timer */
163 unsigned auth_rsrt_tmr; /* authentication timer */
164 unsigned auth_wait_tmr; /* authentication timer */
165 unsigned mdm_fail_tmr; /* modem failure timer */
166 unsigned dtr_drop_tmr; /* DTR drop timer */
167 unsigned connect_tmout; /* connection timeout */
168 unsigned conf_retry; /* max. retry */
169 unsigned term_retry; /* max. retry */
170 unsigned fail_retry; /* max. retry */
171 unsigned auth_retry; /* max. retry */
172 unsigned auth_options; /* authentication opt. */
173 unsigned ip_options; /* IP options */
174 char authenticator; /* AUTHENTICATOR or not */
175 char ip_mode; /* Static/Host/Peer */
176} wan_ppp_conf_t;
177
178/*----------------------------------------------------------------------------
179 * CHDLC-specific link-level configuration.
180 */
181typedef struct wan_chdlc_conf
182{
183 unsigned char ignore_dcd; /* Protocol options: */
184 unsigned char ignore_cts; /* Ignore these to determine */
185 unsigned char ignore_keepalive; /* link status (Yes or No) */
186 unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */
187 unsigned char receive_only; /* no transmit buffering (Y/N) */
188 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
189 unsigned keepalive_rx_tmr; /* receive keepalive timer */
190 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
191 unsigned slarp_timer; /* SLARP request timer */
192} wan_chdlc_conf_t;
193
194
195/*----------------------------------------------------------------------------
196 * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
197 */
198typedef struct wandev_conf
199{
200 unsigned magic; /* magic number (for verification) */
201 unsigned config_id; /* configuration structure identifier */
202 /****** hardware configuration ******/
203 unsigned ioport; /* adapter I/O port base */
204 unsigned long maddr; /* dual-port memory address */
205 unsigned msize; /* dual-port memory size */
206 int irq; /* interrupt request level */
207 int dma; /* DMA request level */
208 char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */
209 unsigned PCI_slot_no; /* S514 PCI adapter slot number */
210 char auto_pci_cfg; /* S515 PCI automatic slot detection */
211 char comm_port; /* Communication Port (PRI=0, SEC=1) */
212 unsigned bps; /* data transfer rate */
213 unsigned mtu; /* maximum transmit unit size */
214 unsigned udp_port; /* UDP port for management */
215 unsigned char ttl; /* Time To Live for UDP security */
216 unsigned char ft1; /* FT1 Configurator Option */
217 char interface; /* RS-232/V.35, etc. */
218 char clocking; /* external/internal */
219 char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
220 char station; /* DTE/DCE, primary/secondary, etc. */
221 char connection; /* permanent/switched/on-demand */
222 char read_mode; /* read mode: Polling or interrupt */
223 char receive_only; /* disable tx buffers */
224 char tty; /* Create a fake tty device */
225 unsigned tty_major; /* Major number for wanpipe tty device */
226 unsigned tty_minor; /* Minor number for wanpipe tty device */
227 unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */
228 char backup; /* Backup Mode */
229 unsigned hw_opt[4]; /* other hardware options */
230 unsigned reserved[4];
231 /****** arbitrary data ***************/
232 unsigned data_size; /* data buffer size */
233 void* data; /* data buffer, e.g. firmware */
234 union /****** protocol-specific ************/
235 {
236 wan_x25_conf_t x25; /* X.25 configuration */
237 wan_ppp_conf_t ppp; /* PPP configuration */
238 wan_fr_conf_t fr; /* frame relay configuration */
239 wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
240 } u;
241} wandev_conf_t;
242
243/* 'config_id' definitions */
244#define WANCONFIG_X25 101 /* X.25 link */
245#define WANCONFIG_FR 102 /* frame relay link */
246#define WANCONFIG_PPP 103 /* synchronous PPP link */
247#define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */
248#define WANCONFIG_BSC 105 /* BiSync Streaming */
249#define WANCONFIG_HDLC 106 /* HDLC Support */
250#define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */
251
252/*
253 * Configuration options defines.
254 */
255/* general options */
256#define WANOPT_OFF 0
257#define WANOPT_ON 1
258#define WANOPT_NO 0
259#define WANOPT_YES 1
260
261/* intercace options */
262#define WANOPT_RS232 0
263#define WANOPT_V35 1
264
265/* data encoding options */
266#define WANOPT_NRZ 0
267#define WANOPT_NRZI 1
268#define WANOPT_FM0 2
269#define WANOPT_FM1 3
270
271/* link type options */
272#define WANOPT_POINTTOPOINT 0 /* RTS always active */
273#define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */
274
275/* clocking options */
276#define WANOPT_EXTERNAL 0
277#define WANOPT_INTERNAL 1
278
279/* station options */
280#define WANOPT_DTE 0
281#define WANOPT_DCE 1
282#define WANOPT_CPE 0
283#define WANOPT_NODE 1
284#define WANOPT_SECONDARY 0
285#define WANOPT_PRIMARY 1
286
287/* connection options */
288#define WANOPT_PERMANENT 0 /* DTR always active */
289#define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */
290#define WANOPT_ONDEMAND 2 /* activate DTR only before sending */
291
292/* frame relay in-channel signalling */
293#define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */
294#define WANOPT_FR_Q933 2 /* ITU Q.933A */
295#define WANOPT_FR_LMI 3 /* LMI */
296
297/* PPP IP Mode Options */
298#define WANOPT_PPP_STATIC 0
299#define WANOPT_PPP_HOST 1
300#define WANOPT_PPP_PEER 2
301
302/* ASY Mode Options */
303#define WANOPT_ONE 1
304#define WANOPT_TWO 2
305#define WANOPT_ONE_AND_HALF 3
306
307#define WANOPT_NONE 0
308#define WANOPT_ODD 1
309#define WANOPT_EVEN 2
310
311/* CHDLC Protocol Options */
312/* DF Commented out for now.
313
314#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
315#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
316#define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT
317*/
318
319/* Port options */
320#define WANOPT_PRI 0
321#define WANOPT_SEC 1
322/* read mode */
323#define WANOPT_INTR 0
324#define WANOPT_POLL 1
325
326
327#define WANOPT_TTY_SYNC 0
328#define WANOPT_TTY_ASYNC 1
329/*----------------------------------------------------------------------------
330 * WAN Link Status Info (for ROUTER_STAT IOCTL).
331 */
332typedef struct wandev_stat
333{
334 unsigned state; /* link state */
335 unsigned ndev; /* number of configured interfaces */
336
337 /* link/interface configuration */
338 unsigned connection; /* permanent/switched/on-demand */
339 unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */
340 unsigned mtu; /* max. transmit unit for this device */
341
342 /* physical level statistics */
343 unsigned modem_status; /* modem status */
344 unsigned rx_frames; /* received frames count */
345 unsigned rx_overruns; /* receiver overrun error count */
346 unsigned rx_crc_err; /* receive CRC error count */
347 unsigned rx_aborts; /* received aborted frames count */
348 unsigned rx_bad_length; /* unexpetedly long/short frames count */
349 unsigned rx_dropped; /* frames discarded at device level */
350 unsigned tx_frames; /* transmitted frames count */
351 unsigned tx_underruns; /* aborted transmissions (underruns) count */
352 unsigned tx_timeouts; /* transmission timeouts */
353 unsigned tx_rejects; /* other transmit errors */
354
355 /* media level statistics */
356 unsigned rx_bad_format; /* frames with invalid format */
357 unsigned rx_bad_addr; /* frames with invalid media address */
358 unsigned tx_retries; /* frames re-transmitted */
359 unsigned reserved[16]; /* reserved for future use */
360} wandev_stat_t;
361
362/* 'state' defines */
363enum wan_states
364{
365 WAN_UNCONFIGURED, /* link/channel is not configured */
366 WAN_DISCONNECTED, /* link/channel is disconnected */
367 WAN_CONNECTING, /* connection is in progress */
368 WAN_CONNECTED, /* link/channel is operational */
369 WAN_LIMIT, /* for verification only */
370 WAN_DUALPORT, /* for Dual Port cards */
371 WAN_DISCONNECTING,
372 WAN_FT1_READY /* FT1 Configurator Ready */
373};
374
375enum {
376 WAN_LOCAL_IP,
377 WAN_POINTOPOINT_IP,
378 WAN_NETMASK_IP,
379 WAN_BROADCAST_IP
380};
381
382/* 'modem_status' masks */
383#define WAN_MODEM_CTS 0x0001 /* CTS line active */
384#define WAN_MODEM_DCD 0x0002 /* DCD line active */
385#define WAN_MODEM_DTR 0x0010 /* DTR line active */
386#define WAN_MODEM_RTS 0x0020 /* RTS line active */
387
388/*----------------------------------------------------------------------------
389 * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
390 */
391typedef struct wanif_conf
392{
393 unsigned magic; /* magic number */
394 unsigned config_id; /* configuration identifier */
395 char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */
396 char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
397 char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */
398 unsigned idle_timeout; /* sec, before disconnecting */
399 unsigned hold_timeout; /* sec, before re-connecting */
400 unsigned cir; /* Committed Information Rate fwd,bwd*/
401 unsigned bc; /* Committed Burst Size fwd, bwd */
402 unsigned be; /* Excess Burst Size fwd, bwd */
403 unsigned char enable_IPX; /* Enable or Disable IPX */
404 unsigned char inarp; /* Send Inverse ARP requests Y/N */
405 unsigned inarp_interval; /* sec, between InARP requests */
406 unsigned long network_number; /* Network Number for IPX */
407 char mc; /* Multicast on or off */
408 char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
409 unsigned char port; /* board port */
410 unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */
411 char pap; /* PAP enabled or disabled */
412 char chap; /* CHAP enabled or disabled */
413 unsigned char userid[511]; /* List of User Id */
414 unsigned char passwd[511]; /* List of passwords */
415 unsigned char sysname[31]; /* Name of the system */
416 unsigned char ignore_dcd; /* Protocol options: */
417 unsigned char ignore_cts; /* Ignore these to determine */
418 unsigned char ignore_keepalive; /* link status (Yes or No) */
419 unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */
420 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
421 unsigned keepalive_rx_tmr; /* receive keepalive timer */
422 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
423 unsigned slarp_timer; /* SLARP request timer */
424 unsigned char ttl; /* Time To Live for UDP security */
425 char interface; /* RS-232/V.35, etc. */
426 char clocking; /* external/internal */
427 unsigned bps; /* data transfer rate */
428 unsigned mtu; /* maximum transmit unit size */
429 unsigned char if_down; /* brind down interface when disconnected */
430 unsigned char gateway; /* Is this interface a gateway */
431 unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
432
433 unsigned char asy_data_trans; /* async API options */
434 unsigned char rts_hs_for_receive; /* async Protocol options */
435 unsigned char xon_xoff_hs_for_receive;
436 unsigned char xon_xoff_hs_for_transmit;
437 unsigned char dcd_hs_for_transmit;
438 unsigned char cts_hs_for_transmit;
439 unsigned char async_mode;
440 unsigned tx_bits_per_char;
441 unsigned rx_bits_per_char;
442 unsigned stop_bits;
443 unsigned char parity;
444 unsigned break_timer;
445 unsigned inter_char_timer;
446 unsigned rx_complete_length;
447 unsigned xon_char;
448 unsigned xoff_char;
449 unsigned char receive_only; /* no transmit buffering (Y/N) */
450} wanif_conf_t;
451
452#endif /* _UAPI_ROUTER_H */
diff --git a/include/uapi/linux/watchdog.h b/include/uapi/linux/watchdog.h
new file mode 100644
index 00000000000..2babe72870b
--- /dev/null
+++ b/include/uapi/linux/watchdog.h
@@ -0,0 +1,57 @@
1/*
2 * Generic watchdog defines. Derived from..
3 *
4 * Berkshire PC Watchdog Defines
5 * by Ken Hollis <khollis@bitgate.com>
6 *
7 */
8
9#ifndef _UAPI_LINUX_WATCHDOG_H
10#define _UAPI_LINUX_WATCHDOG_H
11
12#include <linux/ioctl.h>
13#include <linux/types.h>
14
15#define WATCHDOG_IOCTL_BASE 'W'
16
17struct watchdog_info {
18 __u32 options; /* Options the card/driver supports */
19 __u32 firmware_version; /* Firmware version of the card */
20 __u8 identity[32]; /* Identity of the board */
21};
22
23#define WDIOC_GETSUPPORT _IOR(WATCHDOG_IOCTL_BASE, 0, struct watchdog_info)
24#define WDIOC_GETSTATUS _IOR(WATCHDOG_IOCTL_BASE, 1, int)
25#define WDIOC_GETBOOTSTATUS _IOR(WATCHDOG_IOCTL_BASE, 2, int)
26#define WDIOC_GETTEMP _IOR(WATCHDOG_IOCTL_BASE, 3, int)
27#define WDIOC_SETOPTIONS _IOR(WATCHDOG_IOCTL_BASE, 4, int)
28#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
29#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
30#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int)
31#define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
32#define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int)
33#define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int)
34
35#define WDIOF_UNKNOWN -1 /* Unknown flag error */
36#define WDIOS_UNKNOWN -1 /* Unknown status error */
37
38#define WDIOF_OVERHEAT 0x0001 /* Reset due to CPU overheat */
39#define WDIOF_FANFAULT 0x0002 /* Fan failed */
40#define WDIOF_EXTERN1 0x0004 /* External relay 1 */
41#define WDIOF_EXTERN2 0x0008 /* External relay 2 */
42#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */
43#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */
44#define WDIOF_POWEROVER 0x0040 /* Power over voltage */
45#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */
46#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */
47#define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */
48#define WDIOF_ALARMONLY 0x0400 /* Watchdog triggers a management or
49 other external alarm not a reboot */
50#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */
51
52#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */
53#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */
54#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */
55
56
57#endif /* _UAPI_LINUX_WATCHDOG_H */
diff --git a/include/linux/wimax.h b/include/uapi/linux/wimax.h
index 9f6b77af2f6..9f6b77af2f6 100644
--- a/include/linux/wimax.h
+++ b/include/uapi/linux/wimax.h
diff --git a/include/uapi/linux/wireless.h b/include/uapi/linux/wireless.h
new file mode 100644
index 00000000000..c1592e3e403
--- /dev/null
+++ b/include/uapi/linux/wireless.h
@@ -0,0 +1,1128 @@
1/*
2 * This file define a set of standard wireless extensions
3 *
4 * Version : 22 16.3.07
5 *
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
8 */
9
10#ifndef _UAPI_LINUX_WIRELESS_H
11#define _UAPI_LINUX_WIRELESS_H
12
13/************************** DOCUMENTATION **************************/
14/*
15 * Initial APIs (1996 -> onward) :
16 * -----------------------------
17 * Basically, the wireless extensions are for now a set of standard ioctl
18 * call + /proc/net/wireless
19 *
20 * The entry /proc/net/wireless give statistics and information on the
21 * driver.
22 * This is better than having each driver having its entry because
23 * its centralised and we may remove the driver module safely.
24 *
25 * Ioctl are used to configure the driver and issue commands. This is
26 * better than command line options of insmod because we may want to
27 * change dynamically (while the driver is running) some parameters.
28 *
29 * The ioctl mechanimsm are copied from standard devices ioctl.
30 * We have the list of command plus a structure descibing the
31 * data exchanged...
32 * Note that to add these ioctl, I was obliged to modify :
33 * # net/core/dev.c (two place + add include)
34 * # net/ipv4/af_inet.c (one place + add include)
35 *
36 * /proc/net/wireless is a copy of /proc/net/dev.
37 * We have a structure for data passed from the driver to /proc/net/wireless
38 * Too add this, I've modified :
39 * # net/core/dev.c (two other places)
40 * # include/linux/netdevice.h (one place)
41 * # include/linux/proc_fs.h (one place)
42 *
43 * New driver API (2002 -> onward) :
44 * -------------------------------
45 * This file is only concerned with the user space API and common definitions.
46 * The new driver API is defined and documented in :
47 * # include/net/iw_handler.h
48 *
49 * Note as well that /proc/net/wireless implementation has now moved in :
50 * # net/core/wireless.c
51 *
52 * Wireless Events (2002 -> onward) :
53 * --------------------------------
54 * Events are defined at the end of this file, and implemented in :
55 * # net/core/wireless.c
56 *
57 * Other comments :
58 * --------------
59 * Do not add here things that are redundant with other mechanisms
60 * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
61 * wireless specific.
62 *
63 * These wireless extensions are not magic : each driver has to provide
64 * support for them...
65 *
66 * IMPORTANT NOTE : As everything in the kernel, this is very much a
67 * work in progress. Contact me if you have ideas of improvements...
68 */
69
70/***************************** INCLUDES *****************************/
71
72#include <linux/types.h> /* for __u* and __s* typedefs */
73#include <linux/socket.h> /* for "struct sockaddr" et al */
74#include <linux/if.h> /* for IFNAMSIZ and co... */
75
76/***************************** VERSION *****************************/
77/*
78 * This constant is used to know the availability of the wireless
79 * extensions and to know which version of wireless extensions it is
80 * (there is some stuff that will be added in the future...)
81 * I just plan to increment with each new version.
82 */
83#define WIRELESS_EXT 22
84
85/*
86 * Changes :
87 *
88 * V2 to V3
89 * --------
90 * Alan Cox start some incompatibles changes. I've integrated a bit more.
91 * - Encryption renamed to Encode to avoid US regulation problems
92 * - Frequency changed from float to struct to avoid problems on old 386
93 *
94 * V3 to V4
95 * --------
96 * - Add sensitivity
97 *
98 * V4 to V5
99 * --------
100 * - Missing encoding definitions in range
101 * - Access points stuff
102 *
103 * V5 to V6
104 * --------
105 * - 802.11 support (ESSID ioctls)
106 *
107 * V6 to V7
108 * --------
109 * - define IW_ESSID_MAX_SIZE and IW_MAX_AP
110 *
111 * V7 to V8
112 * --------
113 * - Changed my e-mail address
114 * - More 802.11 support (nickname, rate, rts, frag)
115 * - List index in frequencies
116 *
117 * V8 to V9
118 * --------
119 * - Support for 'mode of operation' (ad-hoc, managed...)
120 * - Support for unicast and multicast power saving
121 * - Change encoding to support larger tokens (>64 bits)
122 * - Updated iw_params (disable, flags) and use it for NWID
123 * - Extracted iw_point from iwreq for clarity
124 *
125 * V9 to V10
126 * ---------
127 * - Add PM capability to range structure
128 * - Add PM modifier : MAX/MIN/RELATIVE
129 * - Add encoding option : IW_ENCODE_NOKEY
130 * - Add TxPower ioctls (work like TxRate)
131 *
132 * V10 to V11
133 * ----------
134 * - Add WE version in range (help backward/forward compatibility)
135 * - Add retry ioctls (work like PM)
136 *
137 * V11 to V12
138 * ----------
139 * - Add SIOCSIWSTATS to get /proc/net/wireless programatically
140 * - Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
141 * - Add new statistics (frag, retry, beacon)
142 * - Add average quality (for user space calibration)
143 *
144 * V12 to V13
145 * ----------
146 * - Document creation of new driver API.
147 * - Extract union iwreq_data from struct iwreq (for new driver API).
148 * - Rename SIOCSIWNAME as SIOCSIWCOMMIT
149 *
150 * V13 to V14
151 * ----------
152 * - Wireless Events support : define struct iw_event
153 * - Define additional specific event numbers
154 * - Add "addr" and "param" fields in union iwreq_data
155 * - AP scanning stuff (SIOCSIWSCAN and friends)
156 *
157 * V14 to V15
158 * ----------
159 * - Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
160 * - Make struct iw_freq signed (both m & e), add explicit padding
161 * - Add IWEVCUSTOM for driver specific event/scanning token
162 * - Add IW_MAX_GET_SPY for driver returning a lot of addresses
163 * - Add IW_TXPOW_RANGE for range of Tx Powers
164 * - Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
165 * - Add IW_MODE_MONITOR for passive monitor
166 *
167 * V15 to V16
168 * ----------
169 * - Increase the number of bitrates in iw_range to 32 (for 802.11g)
170 * - Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
171 * - Reshuffle struct iw_range for increases, add filler
172 * - Increase IW_MAX_AP to 64 for driver returning a lot of addresses
173 * - Remove IW_MAX_GET_SPY because conflict with enhanced spy support
174 * - Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
175 * - Add IW_ENCODE_TEMP and iw_range->encoding_login_index
176 *
177 * V16 to V17
178 * ----------
179 * - Add flags to frequency -> auto/fixed
180 * - Document (struct iw_quality *)->updated, add new flags (INVALID)
181 * - Wireless Event capability in struct iw_range
182 * - Add support for relative TxPower (yick !)
183 *
184 * V17 to V18 (From Jouni Malinen <j@w1.fi>)
185 * ----------
186 * - Add support for WPA/WPA2
187 * - Add extended encoding configuration (SIOCSIWENCODEEXT and
188 * SIOCGIWENCODEEXT)
189 * - Add SIOCSIWGENIE/SIOCGIWGENIE
190 * - Add SIOCSIWMLME
191 * - Add SIOCSIWPMKSA
192 * - Add struct iw_range bit field for supported encoding capabilities
193 * - Add optional scan request parameters for SIOCSIWSCAN
194 * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
195 * related parameters (extensible up to 4096 parameter values)
196 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
197 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
198 *
199 * V18 to V19
200 * ----------
201 * - Remove (struct iw_point *)->pointer from events and streams
202 * - Remove header includes to help user space
203 * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
204 * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
205 * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
206 * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
207 *
208 * V19 to V20
209 * ----------
210 * - RtNetlink requests support (SET/GET)
211 *
212 * V20 to V21
213 * ----------
214 * - Remove (struct net_device *)->get_wireless_stats()
215 * - Change length in ESSID and NICK to strlen() instead of strlen()+1
216 * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
217 * - Power/Retry relative values no longer * 100000
218 * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
219 *
220 * V21 to V22
221 * ----------
222 * - Prevent leaking of kernel space in stream on 64 bits.
223 */
224
225/**************************** CONSTANTS ****************************/
226
227/* -------------------------- IOCTL LIST -------------------------- */
228
229/* Wireless Identification */
230#define SIOCSIWCOMMIT 0x8B00 /* Commit pending changes to driver */
231#define SIOCGIWNAME 0x8B01 /* get name == wireless protocol */
232/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
233 * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
234 * Don't put the name of your driver there, it's useless. */
235
236/* Basic operations */
237#define SIOCSIWNWID 0x8B02 /* set network id (pre-802.11) */
238#define SIOCGIWNWID 0x8B03 /* get network id (the cell) */
239#define SIOCSIWFREQ 0x8B04 /* set channel/frequency (Hz) */
240#define SIOCGIWFREQ 0x8B05 /* get channel/frequency (Hz) */
241#define SIOCSIWMODE 0x8B06 /* set operation mode */
242#define SIOCGIWMODE 0x8B07 /* get operation mode */
243#define SIOCSIWSENS 0x8B08 /* set sensitivity (dBm) */
244#define SIOCGIWSENS 0x8B09 /* get sensitivity (dBm) */
245
246/* Informative stuff */
247#define SIOCSIWRANGE 0x8B0A /* Unused */
248#define SIOCGIWRANGE 0x8B0B /* Get range of parameters */
249#define SIOCSIWPRIV 0x8B0C /* Unused */
250#define SIOCGIWPRIV 0x8B0D /* get private ioctl interface info */
251#define SIOCSIWSTATS 0x8B0E /* Unused */
252#define SIOCGIWSTATS 0x8B0F /* Get /proc/net/wireless stats */
253/* SIOCGIWSTATS is strictly used between user space and the kernel, and
254 * is never passed to the driver (i.e. the driver will never see it). */
255
256/* Spy support (statistics per MAC address - used for Mobile IP support) */
257#define SIOCSIWSPY 0x8B10 /* set spy addresses */
258#define SIOCGIWSPY 0x8B11 /* get spy info (quality of link) */
259#define SIOCSIWTHRSPY 0x8B12 /* set spy threshold (spy event) */
260#define SIOCGIWTHRSPY 0x8B13 /* get spy threshold */
261
262/* Access Point manipulation */
263#define SIOCSIWAP 0x8B14 /* set access point MAC addresses */
264#define SIOCGIWAP 0x8B15 /* get access point MAC addresses */
265#define SIOCGIWAPLIST 0x8B17 /* Deprecated in favor of scanning */
266#define SIOCSIWSCAN 0x8B18 /* trigger scanning (list cells) */
267#define SIOCGIWSCAN 0x8B19 /* get scanning results */
268
269/* 802.11 specific support */
270#define SIOCSIWESSID 0x8B1A /* set ESSID (network name) */
271#define SIOCGIWESSID 0x8B1B /* get ESSID */
272#define SIOCSIWNICKN 0x8B1C /* set node name/nickname */
273#define SIOCGIWNICKN 0x8B1D /* get node name/nickname */
274/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
275 * within the 'iwreq' structure, so we need to use the 'data' member to
276 * point to a string in user space, like it is done for RANGE... */
277
278/* Other parameters useful in 802.11 and some other devices */
279#define SIOCSIWRATE 0x8B20 /* set default bit rate (bps) */
280#define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
281#define SIOCSIWRTS 0x8B22 /* set RTS/CTS threshold (bytes) */
282#define SIOCGIWRTS 0x8B23 /* get RTS/CTS threshold (bytes) */
283#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
284#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
285#define SIOCSIWTXPOW 0x8B26 /* set transmit power (dBm) */
286#define SIOCGIWTXPOW 0x8B27 /* get transmit power (dBm) */
287#define SIOCSIWRETRY 0x8B28 /* set retry limits and lifetime */
288#define SIOCGIWRETRY 0x8B29 /* get retry limits and lifetime */
289
290/* Encoding stuff (scrambling, hardware security, WEP...) */
291#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
292#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
293/* Power saving stuff (power management, unicast and multicast) */
294#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
295#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
296
297/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
298 * This ioctl uses struct iw_point and data buffer that includes IE id and len
299 * fields. More than one IE may be included in the request. Setting the generic
300 * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
301 * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
302 * are required to report the used IE as a wireless event, e.g., when
303 * associating with an AP. */
304#define SIOCSIWGENIE 0x8B30 /* set generic IE */
305#define SIOCGIWGENIE 0x8B31 /* get generic IE */
306
307/* WPA : IEEE 802.11 MLME requests */
308#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
309 * struct iw_mlme */
310/* WPA : Authentication mode parameters */
311#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
312#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
313
314/* WPA : Extended version of encoding configuration */
315#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
316#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
317
318/* WPA2 : PMKSA cache management */
319#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
320
321/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
322
323/* These 32 ioctl are wireless device private, for 16 commands.
324 * Each driver is free to use them for whatever purpose it chooses,
325 * however the driver *must* export the description of those ioctls
326 * with SIOCGIWPRIV and *must* use arguments as defined below.
327 * If you don't follow those rules, DaveM is going to hate you (reason :
328 * it make mixed 32/64bit operation impossible).
329 */
330#define SIOCIWFIRSTPRIV 0x8BE0
331#define SIOCIWLASTPRIV 0x8BFF
332/* Previously, we were using SIOCDEVPRIVATE, but we now have our
333 * separate range because of collisions with other tools such as
334 * 'mii-tool'.
335 * We now have 32 commands, so a bit more space ;-).
336 * Also, all 'even' commands are only usable by root and don't return the
337 * content of ifr/iwr to user (but you are not obliged to use the set/get
338 * convention, just use every other two command). More details in iwpriv.c.
339 * And I repeat : you are not forced to use them with iwpriv, but you
340 * must be compliant with it.
341 */
342
343/* ------------------------- IOCTL STUFF ------------------------- */
344
345/* The first and the last (range) */
346#define SIOCIWFIRST 0x8B00
347#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
348#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
349#define IW_HANDLER(id, func) \
350 [IW_IOCTL_IDX(id)] = func
351
352/* Odd : get (world access), even : set (root access) */
353#define IW_IS_SET(cmd) (!((cmd) & 0x1))
354#define IW_IS_GET(cmd) ((cmd) & 0x1)
355
356/* ----------------------- WIRELESS EVENTS ----------------------- */
357/* Those are *NOT* ioctls, do not issue request on them !!! */
358/* Most events use the same identifier as ioctl requests */
359
360#define IWEVTXDROP 0x8C00 /* Packet dropped to excessive retry */
361#define IWEVQUAL 0x8C01 /* Quality part of statistics (scan) */
362#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
363#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
364#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
365#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
366 * (scan results); This includes id and
367 * length fields. One IWEVGENIE may
368 * contain more than one IE. Scan
369 * results may contain one or more
370 * IWEVGENIE events. */
371#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
372 * (struct iw_michaelmicfailure)
373 */
374#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
375 * The data includes id and length
376 * fields and may contain more than one
377 * IE. This event is required in
378 * Managed mode if the driver
379 * generates its own WPA/RSN IE. This
380 * should be sent just before
381 * IWEVREGISTERED event for the
382 * association. */
383#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
384 * Response. The data includes id and
385 * length fields and may contain more
386 * than one IE. This may be sent
387 * between IWEVASSOCREQIE and
388 * IWEVREGISTERED events for the
389 * association. */
390#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
391 * pre-authentication
392 * (struct iw_pmkid_cand) */
393
394#define IWEVFIRST 0x8C00
395#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
396
397/* ------------------------- PRIVATE INFO ------------------------- */
398/*
399 * The following is used with SIOCGIWPRIV. It allow a driver to define
400 * the interface (name, type of data) for its private ioctl.
401 * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
402 */
403
404#define IW_PRIV_TYPE_MASK 0x7000 /* Type of arguments */
405#define IW_PRIV_TYPE_NONE 0x0000
406#define IW_PRIV_TYPE_BYTE 0x1000 /* Char as number */
407#define IW_PRIV_TYPE_CHAR 0x2000 /* Char as character */
408#define IW_PRIV_TYPE_INT 0x4000 /* 32 bits int */
409#define IW_PRIV_TYPE_FLOAT 0x5000 /* struct iw_freq */
410#define IW_PRIV_TYPE_ADDR 0x6000 /* struct sockaddr */
411
412#define IW_PRIV_SIZE_FIXED 0x0800 /* Variable or fixed number of args */
413
414#define IW_PRIV_SIZE_MASK 0x07FF /* Max number of those args */
415
416/*
417 * Note : if the number of args is fixed and the size < 16 octets,
418 * instead of passing a pointer we will put args in the iwreq struct...
419 */
420
421/* ----------------------- OTHER CONSTANTS ----------------------- */
422
423/* Maximum frequencies in the range struct */
424#define IW_MAX_FREQUENCIES 32
425/* Note : if you have something like 80 frequencies,
426 * don't increase this constant and don't fill the frequency list.
427 * The user will be able to set by channel anyway... */
428
429/* Maximum bit rates in the range struct */
430#define IW_MAX_BITRATES 32
431
432/* Maximum tx powers in the range struct */
433#define IW_MAX_TXPOWER 8
434/* Note : if you more than 8 TXPowers, just set the max and min or
435 * a few of them in the struct iw_range. */
436
437/* Maximum of address that you may set with SPY */
438#define IW_MAX_SPY 8
439
440/* Maximum of address that you may get in the
441 list of access points in range */
442#define IW_MAX_AP 64
443
444/* Maximum size of the ESSID and NICKN strings */
445#define IW_ESSID_MAX_SIZE 32
446
447/* Modes of operation */
448#define IW_MODE_AUTO 0 /* Let the driver decides */
449#define IW_MODE_ADHOC 1 /* Single cell network */
450#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
451#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
452#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
453#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
454#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
455#define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
456
457/* Statistics flags (bitmask in updated) */
458#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
459#define IW_QUAL_LEVEL_UPDATED 0x02
460#define IW_QUAL_NOISE_UPDATED 0x04
461#define IW_QUAL_ALL_UPDATED 0x07
462#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
463#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
464#define IW_QUAL_LEVEL_INVALID 0x20
465#define IW_QUAL_NOISE_INVALID 0x40
466#define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */
467#define IW_QUAL_ALL_INVALID 0x70
468
469/* Frequency flags */
470#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
471#define IW_FREQ_FIXED 0x01 /* Force a specific value */
472
473/* Maximum number of size of encoding token available
474 * they are listed in the range structure */
475#define IW_MAX_ENCODING_SIZES 8
476
477/* Maximum size of the encoding token in bytes */
478#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
479
480/* Flags for encoding (along with the token) */
481#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
482#define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */
483#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
484#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
485#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
486#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
487#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
488#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */
489#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
490
491/* Power management flags available (along with the value, if any) */
492#define IW_POWER_ON 0x0000 /* No details... */
493#define IW_POWER_TYPE 0xF000 /* Type of parameter */
494#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
495#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
496#define IW_POWER_MODE 0x0F00 /* Power Management mode */
497#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
498#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
499#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
500#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
501#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
502#define IW_POWER_MODIFIER 0x000F /* Modify a parameter */
503#define IW_POWER_MIN 0x0001 /* Value is a minimum */
504#define IW_POWER_MAX 0x0002 /* Value is a maximum */
505#define IW_POWER_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
506
507/* Transmit Power flags available */
508#define IW_TXPOW_TYPE 0x00FF /* Type of value */
509#define IW_TXPOW_DBM 0x0000 /* Value is in dBm */
510#define IW_TXPOW_MWATT 0x0001 /* Value is in mW */
511#define IW_TXPOW_RELATIVE 0x0002 /* Value is in arbitrary units */
512#define IW_TXPOW_RANGE 0x1000 /* Range of value between min/max */
513
514/* Retry limits and lifetime flags available */
515#define IW_RETRY_ON 0x0000 /* No details... */
516#define IW_RETRY_TYPE 0xF000 /* Type of parameter */
517#define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/
518#define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */
519#define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */
520#define IW_RETRY_MIN 0x0001 /* Value is a minimum */
521#define IW_RETRY_MAX 0x0002 /* Value is a maximum */
522#define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */
523#define IW_RETRY_SHORT 0x0010 /* Value is for short packets */
524#define IW_RETRY_LONG 0x0020 /* Value is for long packets */
525
526/* Scanning request flags */
527#define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */
528#define IW_SCAN_ALL_ESSID 0x0001 /* Scan all ESSIDs */
529#define IW_SCAN_THIS_ESSID 0x0002 /* Scan only this ESSID */
530#define IW_SCAN_ALL_FREQ 0x0004 /* Scan all Frequencies */
531#define IW_SCAN_THIS_FREQ 0x0008 /* Scan only this Frequency */
532#define IW_SCAN_ALL_MODE 0x0010 /* Scan all Modes */
533#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
534#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
535#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
536/* struct iw_scan_req scan_type */
537#define IW_SCAN_TYPE_ACTIVE 0
538#define IW_SCAN_TYPE_PASSIVE 1
539/* Maximum size of returned data */
540#define IW_SCAN_MAX_DATA 4096 /* In bytes */
541
542/* Scan capability flags - in (struct iw_range *)->scan_capa */
543#define IW_SCAN_CAPA_NONE 0x00
544#define IW_SCAN_CAPA_ESSID 0x01
545#define IW_SCAN_CAPA_BSSID 0x02
546#define IW_SCAN_CAPA_CHANNEL 0x04
547#define IW_SCAN_CAPA_MODE 0x08
548#define IW_SCAN_CAPA_RATE 0x10
549#define IW_SCAN_CAPA_TYPE 0x20
550#define IW_SCAN_CAPA_TIME 0x40
551
552/* Max number of char in custom event - use multiple of them if needed */
553#define IW_CUSTOM_MAX 256 /* In bytes */
554
555/* Generic information element */
556#define IW_GENERIC_IE_MAX 1024
557
558/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
559#define IW_MLME_DEAUTH 0
560#define IW_MLME_DISASSOC 1
561#define IW_MLME_AUTH 2
562#define IW_MLME_ASSOC 3
563
564/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
565#define IW_AUTH_INDEX 0x0FFF
566#define IW_AUTH_FLAGS 0xF000
567/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
568 * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
569 * parameter that is being set/get to; value will be read/written to
570 * struct iw_param value field) */
571#define IW_AUTH_WPA_VERSION 0
572#define IW_AUTH_CIPHER_PAIRWISE 1
573#define IW_AUTH_CIPHER_GROUP 2
574#define IW_AUTH_KEY_MGMT 3
575#define IW_AUTH_TKIP_COUNTERMEASURES 4
576#define IW_AUTH_DROP_UNENCRYPTED 5
577#define IW_AUTH_80211_AUTH_ALG 6
578#define IW_AUTH_WPA_ENABLED 7
579#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
580#define IW_AUTH_ROAMING_CONTROL 9
581#define IW_AUTH_PRIVACY_INVOKED 10
582#define IW_AUTH_CIPHER_GROUP_MGMT 11
583#define IW_AUTH_MFP 12
584
585/* IW_AUTH_WPA_VERSION values (bit field) */
586#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
587#define IW_AUTH_WPA_VERSION_WPA 0x00000002
588#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
589
590/* IW_AUTH_PAIRWISE_CIPHER, IW_AUTH_GROUP_CIPHER, and IW_AUTH_CIPHER_GROUP_MGMT
591 * values (bit field) */
592#define IW_AUTH_CIPHER_NONE 0x00000001
593#define IW_AUTH_CIPHER_WEP40 0x00000002
594#define IW_AUTH_CIPHER_TKIP 0x00000004
595#define IW_AUTH_CIPHER_CCMP 0x00000008
596#define IW_AUTH_CIPHER_WEP104 0x00000010
597#define IW_AUTH_CIPHER_AES_CMAC 0x00000020
598
599/* IW_AUTH_KEY_MGMT values (bit field) */
600#define IW_AUTH_KEY_MGMT_802_1X 1
601#define IW_AUTH_KEY_MGMT_PSK 2
602
603/* IW_AUTH_80211_AUTH_ALG values (bit field) */
604#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
605#define IW_AUTH_ALG_SHARED_KEY 0x00000002
606#define IW_AUTH_ALG_LEAP 0x00000004
607
608/* IW_AUTH_ROAMING_CONTROL values */
609#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
610#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
611 * control */
612
613/* IW_AUTH_MFP (management frame protection) values */
614#define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
615#define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
616#define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
617
618/* SIOCSIWENCODEEXT definitions */
619#define IW_ENCODE_SEQ_MAX_SIZE 8
620/* struct iw_encode_ext ->alg */
621#define IW_ENCODE_ALG_NONE 0
622#define IW_ENCODE_ALG_WEP 1
623#define IW_ENCODE_ALG_TKIP 2
624#define IW_ENCODE_ALG_CCMP 3
625#define IW_ENCODE_ALG_PMK 4
626#define IW_ENCODE_ALG_AES_CMAC 5
627/* struct iw_encode_ext ->ext_flags */
628#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
629#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
630#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
631#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
632
633/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
634#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
635#define IW_MICFAILURE_GROUP 0x00000004
636#define IW_MICFAILURE_PAIRWISE 0x00000008
637#define IW_MICFAILURE_STAKEY 0x00000010
638#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
639 */
640
641/* Bit field values for enc_capa in struct iw_range */
642#define IW_ENC_CAPA_WPA 0x00000001
643#define IW_ENC_CAPA_WPA2 0x00000002
644#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
645#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
646#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
647
648/* Event capability macros - in (struct iw_range *)->event_capa
649 * Because we have more than 32 possible events, we use an array of
650 * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
651#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \
652 (cmd - SIOCIWFIRSTPRIV + 0x60) : \
653 (cmd - SIOCIWFIRST))
654#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5)
655#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
656/* Event capability constants - event autogenerated by the kernel
657 * This list is valid for most 802.11 devices, customise as needed... */
658#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | \
659 IW_EVENT_CAPA_MASK(0x8B06) | \
660 IW_EVENT_CAPA_MASK(0x8B1A))
661#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A))
662/* "Easy" macro to set events in iw_range (less efficient) */
663#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
664#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
665
666
667/****************************** TYPES ******************************/
668
669/* --------------------------- SUBTYPES --------------------------- */
670/*
671 * Generic format for most parameters that fit in an int
672 */
673struct iw_param
674{
675 __s32 value; /* The value of the parameter itself */
676 __u8 fixed; /* Hardware should not use auto select */
677 __u8 disabled; /* Disable the feature */
678 __u16 flags; /* Various specifc flags (if any) */
679};
680
681/*
682 * For all data larger than 16 octets, we need to use a
683 * pointer to memory allocated in user space.
684 */
685struct iw_point
686{
687 void __user *pointer; /* Pointer to the data (in user space) */
688 __u16 length; /* number of fields or size in bytes */
689 __u16 flags; /* Optional params */
690};
691
692
693/*
694 * A frequency
695 * For numbers lower than 10^9, we encode the number in 'm' and
696 * set 'e' to 0
697 * For number greater than 10^9, we divide it by the lowest power
698 * of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
699 * The power of 10 is in 'e', the result of the division is in 'm'.
700 */
701struct iw_freq
702{
703 __s32 m; /* Mantissa */
704 __s16 e; /* Exponent */
705 __u8 i; /* List index (when in range struct) */
706 __u8 flags; /* Flags (fixed/auto) */
707};
708
709/*
710 * Quality of the link
711 */
712struct iw_quality
713{
714 __u8 qual; /* link quality (%retries, SNR,
715 %missed beacons or better...) */
716 __u8 level; /* signal level (dBm) */
717 __u8 noise; /* noise level (dBm) */
718 __u8 updated; /* Flags to know if updated */
719};
720
721/*
722 * Packet discarded in the wireless adapter due to
723 * "wireless" specific problems...
724 * Note : the list of counter and statistics in net_device_stats
725 * is already pretty exhaustive, and you should use that first.
726 * This is only additional stats...
727 */
728struct iw_discarded
729{
730 __u32 nwid; /* Rx : Wrong nwid/essid */
731 __u32 code; /* Rx : Unable to code/decode (WEP) */
732 __u32 fragment; /* Rx : Can't perform MAC reassembly */
733 __u32 retries; /* Tx : Max MAC retries num reached */
734 __u32 misc; /* Others cases */
735};
736
737/*
738 * Packet/Time period missed in the wireless adapter due to
739 * "wireless" specific problems...
740 */
741struct iw_missed
742{
743 __u32 beacon; /* Missed beacons/superframe */
744};
745
746/*
747 * Quality range (for spy threshold)
748 */
749struct iw_thrspy
750{
751 struct sockaddr addr; /* Source address (hw/mac) */
752 struct iw_quality qual; /* Quality of the link */
753 struct iw_quality low; /* Low threshold */
754 struct iw_quality high; /* High threshold */
755};
756
757/*
758 * Optional data for scan request
759 *
760 * Note: these optional parameters are controlling parameters for the
761 * scanning behavior, these do not apply to getting scan results
762 * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
763 * provide a merged results with all BSSes even if the previous scan
764 * request limited scanning to a subset, e.g., by specifying an SSID.
765 * Especially, scan results are required to include an entry for the
766 * current BSS if the driver is in Managed mode and associated with an AP.
767 */
768struct iw_scan_req
769{
770 __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
771 __u8 essid_len;
772 __u8 num_channels; /* num entries in channel_list;
773 * 0 = scan all allowed channels */
774 __u8 flags; /* reserved as padding; use zero, this may
775 * be used in the future for adding flags
776 * to request different scan behavior */
777 struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
778 * individual address of a specific BSS */
779
780 /*
781 * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
782 * the current ESSID. This allows scan requests for specific ESSID
783 * without having to change the current ESSID and potentially breaking
784 * the current association.
785 */
786 __u8 essid[IW_ESSID_MAX_SIZE];
787
788 /*
789 * Optional parameters for changing the default scanning behavior.
790 * These are based on the MLME-SCAN.request from IEEE Std 802.11.
791 * TU is 1.024 ms. If these are set to 0, driver is expected to use
792 * reasonable default values. min_channel_time defines the time that
793 * will be used to wait for the first reply on each channel. If no
794 * replies are received, next channel will be scanned after this. If
795 * replies are received, total time waited on the channel is defined by
796 * max_channel_time.
797 */
798 __u32 min_channel_time; /* in TU */
799 __u32 max_channel_time; /* in TU */
800
801 struct iw_freq channel_list[IW_MAX_FREQUENCIES];
802};
803
804/* ------------------------- WPA SUPPORT ------------------------- */
805
806/*
807 * Extended data structure for get/set encoding (this is used with
808 * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
809 * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
810 * only the data contents changes (key data -> this structure, including
811 * key data).
812 *
813 * If the new key is the first group key, it will be set as the default
814 * TX key. Otherwise, default TX key index is only changed if
815 * IW_ENCODE_EXT_SET_TX_KEY flag is set.
816 *
817 * Key will be changed with SIOCSIWENCODEEXT in all cases except for
818 * special "change TX key index" operation which is indicated by setting
819 * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
820 *
821 * tx_seq/rx_seq are only used when respective
822 * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
823 * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
824 * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
825 * used only by an Authenticator (AP or an IBSS station) to get the
826 * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
827 * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
828 * debugging/testing.
829 */
830struct iw_encode_ext
831{
832 __u32 ext_flags; /* IW_ENCODE_EXT_* */
833 __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
834 __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
835 struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
836 * (group) keys or unicast address for
837 * individual keys */
838 __u16 alg; /* IW_ENCODE_ALG_* */
839 __u16 key_len;
840 __u8 key[0];
841};
842
843/* SIOCSIWMLME data */
844struct iw_mlme
845{
846 __u16 cmd; /* IW_MLME_* */
847 __u16 reason_code;
848 struct sockaddr addr;
849};
850
851/* SIOCSIWPMKSA data */
852#define IW_PMKSA_ADD 1
853#define IW_PMKSA_REMOVE 2
854#define IW_PMKSA_FLUSH 3
855
856#define IW_PMKID_LEN 16
857
858struct iw_pmksa
859{
860 __u32 cmd; /* IW_PMKSA_* */
861 struct sockaddr bssid;
862 __u8 pmkid[IW_PMKID_LEN];
863};
864
865/* IWEVMICHAELMICFAILURE data */
866struct iw_michaelmicfailure
867{
868 __u32 flags;
869 struct sockaddr src_addr;
870 __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
871};
872
873/* IWEVPMKIDCAND data */
874#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
875struct iw_pmkid_cand
876{
877 __u32 flags; /* IW_PMKID_CAND_* */
878 __u32 index; /* the smaller the index, the higher the
879 * priority */
880 struct sockaddr bssid;
881};
882
883/* ------------------------ WIRELESS STATS ------------------------ */
884/*
885 * Wireless statistics (used for /proc/net/wireless)
886 */
887struct iw_statistics
888{
889 __u16 status; /* Status
890 * - device dependent for now */
891
892 struct iw_quality qual; /* Quality of the link
893 * (instant/mean/max) */
894 struct iw_discarded discard; /* Packet discarded counts */
895 struct iw_missed miss; /* Packet missed counts */
896};
897
898/* ------------------------ IOCTL REQUEST ------------------------ */
899/*
900 * This structure defines the payload of an ioctl, and is used
901 * below.
902 *
903 * Note that this structure should fit on the memory footprint
904 * of iwreq (which is the same as ifreq), which mean a max size of
905 * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
906 * You should check this when increasing the structures defined
907 * above in this file...
908 */
909union iwreq_data
910{
911 /* Config - generic */
912 char name[IFNAMSIZ];
913 /* Name : used to verify the presence of wireless extensions.
914 * Name of the protocol/provider... */
915
916 struct iw_point essid; /* Extended network name */
917 struct iw_param nwid; /* network id (or domain - the cell) */
918 struct iw_freq freq; /* frequency or channel :
919 * 0-1000 = channel
920 * > 1000 = frequency in Hz */
921
922 struct iw_param sens; /* signal level threshold */
923 struct iw_param bitrate; /* default bit rate */
924 struct iw_param txpower; /* default transmit power */
925 struct iw_param rts; /* RTS threshold threshold */
926 struct iw_param frag; /* Fragmentation threshold */
927 __u32 mode; /* Operation mode */
928 struct iw_param retry; /* Retry limits & lifetime */
929
930 struct iw_point encoding; /* Encoding stuff : tokens */
931 struct iw_param power; /* PM duration/timeout */
932 struct iw_quality qual; /* Quality part of statistics */
933
934 struct sockaddr ap_addr; /* Access point address */
935 struct sockaddr addr; /* Destination address (hw/mac) */
936
937 struct iw_param param; /* Other small parameters */
938 struct iw_point data; /* Other large parameters */
939};
940
941/*
942 * The structure to exchange data for ioctl.
943 * This structure is the same as 'struct ifreq', but (re)defined for
944 * convenience...
945 * Do I need to remind you about structure size (32 octets) ?
946 */
947struct iwreq
948{
949 union
950 {
951 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
952 } ifr_ifrn;
953
954 /* Data part (defined just above) */
955 union iwreq_data u;
956};
957
958/* -------------------------- IOCTL DATA -------------------------- */
959/*
960 * For those ioctl which want to exchange mode data that what could
961 * fit in the above structure...
962 */
963
964/*
965 * Range of parameters
966 */
967
968struct iw_range
969{
970 /* Informative stuff (to choose between different interface) */
971 __u32 throughput; /* To give an idea... */
972 /* In theory this value should be the maximum benchmarked
973 * TCP/IP throughput, because with most of these devices the
974 * bit rate is meaningless (overhead an co) to estimate how
975 * fast the connection will go and pick the fastest one.
976 * I suggest people to play with Netperf or any benchmark...
977 */
978
979 /* NWID (or domain id) */
980 __u32 min_nwid; /* Minimal NWID we are able to set */
981 __u32 max_nwid; /* Maximal NWID we are able to set */
982
983 /* Old Frequency (backward compat - moved lower ) */
984 __u16 old_num_channels;
985 __u8 old_num_frequency;
986
987 /* Scan capabilities */
988 __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */
989
990 /* Wireless event capability bitmasks */
991 __u32 event_capa[6];
992
993 /* signal level threshold range */
994 __s32 sensitivity;
995
996 /* Quality of link & SNR stuff */
997 /* Quality range (link, level, noise)
998 * If the quality is absolute, it will be in the range [0 ; max_qual],
999 * if the quality is dBm, it will be in the range [max_qual ; 0].
1000 * Don't forget that we use 8 bit arithmetics... */
1001 struct iw_quality max_qual; /* Quality of the link */
1002 /* This should contain the average/typical values of the quality
1003 * indicator. This should be the threshold between a "good" and
1004 * a "bad" link (example : monitor going from green to orange).
1005 * Currently, user space apps like quality monitors don't have any
1006 * way to calibrate the measurement. With this, they can split
1007 * the range between 0 and max_qual in different quality level
1008 * (using a geometric subdivision centered on the average).
1009 * I expect that people doing the user space apps will feedback
1010 * us on which value we need to put in each driver... */
1011 struct iw_quality avg_qual; /* Quality of the link */
1012
1013 /* Rates */
1014 __u8 num_bitrates; /* Number of entries in the list */
1015 __s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
1016
1017 /* RTS threshold */
1018 __s32 min_rts; /* Minimal RTS threshold */
1019 __s32 max_rts; /* Maximal RTS threshold */
1020
1021 /* Frag threshold */
1022 __s32 min_frag; /* Minimal frag threshold */
1023 __s32 max_frag; /* Maximal frag threshold */
1024
1025 /* Power Management duration & timeout */
1026 __s32 min_pmp; /* Minimal PM period */
1027 __s32 max_pmp; /* Maximal PM period */
1028 __s32 min_pmt; /* Minimal PM timeout */
1029 __s32 max_pmt; /* Maximal PM timeout */
1030 __u16 pmp_flags; /* How to decode max/min PM period */
1031 __u16 pmt_flags; /* How to decode max/min PM timeout */
1032 __u16 pm_capa; /* What PM options are supported */
1033
1034 /* Encoder stuff */
1035 __u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
1036 __u8 num_encoding_sizes; /* Number of entry in the list */
1037 __u8 max_encoding_tokens; /* Max number of tokens */
1038 /* For drivers that need a "login/passwd" form */
1039 __u8 encoding_login_index; /* token index for login token */
1040
1041 /* Transmit power */
1042 __u16 txpower_capa; /* What options are supported */
1043 __u8 num_txpower; /* Number of entries in the list */
1044 __s32 txpower[IW_MAX_TXPOWER]; /* list, in bps */
1045
1046 /* Wireless Extension version info */
1047 __u8 we_version_compiled; /* Must be WIRELESS_EXT */
1048 __u8 we_version_source; /* Last update of source */
1049
1050 /* Retry limits and lifetime */
1051 __u16 retry_capa; /* What retry options are supported */
1052 __u16 retry_flags; /* How to decode max/min retry limit */
1053 __u16 r_time_flags; /* How to decode max/min retry life */
1054 __s32 min_retry; /* Minimal number of retries */
1055 __s32 max_retry; /* Maximal number of retries */
1056 __s32 min_r_time; /* Minimal retry lifetime */
1057 __s32 max_r_time; /* Maximal retry lifetime */
1058
1059 /* Frequency */
1060 __u16 num_channels; /* Number of channels [0; num - 1] */
1061 __u8 num_frequency; /* Number of entry in the list */
1062 struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
1063 /* Note : this frequency list doesn't need to fit channel numbers,
1064 * because each entry contain its channel index */
1065
1066 __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
1067};
1068
1069/*
1070 * Private ioctl interface information
1071 */
1072
1073struct iw_priv_args
1074{
1075 __u32 cmd; /* Number of the ioctl to issue */
1076 __u16 set_args; /* Type and number of args */
1077 __u16 get_args; /* Type and number of args */
1078 char name[IFNAMSIZ]; /* Name of the extension */
1079};
1080
1081/* ----------------------- WIRELESS EVENTS ----------------------- */
1082/*
1083 * Wireless events are carried through the rtnetlink socket to user
1084 * space. They are encapsulated in the IFLA_WIRELESS field of
1085 * a RTM_NEWLINK message.
1086 */
1087
1088/*
1089 * A Wireless Event. Contains basically the same data as the ioctl...
1090 */
1091struct iw_event
1092{
1093 __u16 len; /* Real length of this stuff */
1094 __u16 cmd; /* Wireless IOCTL */
1095 union iwreq_data u; /* IOCTL fixed payload */
1096};
1097
1098/* Size of the Event prefix (including padding and alignement junk) */
1099#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data))
1100/* Size of the various events */
1101#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
1102#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
1103#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
1104#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
1105#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
1106#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
1107
1108/* iw_point events are special. First, the payload (extra data) come at
1109 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1110 * we omit the pointer, so start at an offset. */
1111#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1112 (char *) NULL)
1113#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1114 IW_EV_POINT_OFF)
1115
1116
1117/* Size of the Event prefix when packed in stream */
1118#define IW_EV_LCP_PK_LEN (4)
1119/* Size of the various events when packed in stream */
1120#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ)
1121#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32))
1122#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
1123#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
1124#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
1125#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
1126#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4)
1127
1128#endif /* _UAPI_LINUX_WIRELESS_H */
diff --git a/include/linux/x25.h b/include/uapi/linux/x25.h
index 810cce6737e..810cce6737e 100644
--- a/include/linux/x25.h
+++ b/include/uapi/linux/x25.h
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h
new file mode 100644
index 00000000000..26607bd965f
--- /dev/null
+++ b/include/uapi/linux/xattr.h
@@ -0,0 +1,64 @@
1/*
2 File: linux/xattr.h
3
4 Extended attributes handling.
5
6 Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
7 Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
8 Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
9*/
10#ifndef _UAPI_LINUX_XATTR_H
11#define _UAPI_LINUX_XATTR_H
12
13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
15
16/* Namespaces */
17#define XATTR_OS2_PREFIX "os2."
18#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
19
20#define XATTR_SECURITY_PREFIX "security."
21#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
22
23#define XATTR_SYSTEM_PREFIX "system."
24#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
25
26#define XATTR_TRUSTED_PREFIX "trusted."
27#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
28
29#define XATTR_USER_PREFIX "user."
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31
32/* Security namespace */
33#define XATTR_EVM_SUFFIX "evm"
34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
35
36#define XATTR_IMA_SUFFIX "ima"
37#define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX
38
39#define XATTR_SELINUX_SUFFIX "selinux"
40#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
41
42#define XATTR_SMACK_SUFFIX "SMACK64"
43#define XATTR_SMACK_IPIN "SMACK64IPIN"
44#define XATTR_SMACK_IPOUT "SMACK64IPOUT"
45#define XATTR_SMACK_EXEC "SMACK64EXEC"
46#define XATTR_SMACK_TRANSMUTE "SMACK64TRANSMUTE"
47#define XATTR_SMACK_MMAP "SMACK64MMAP"
48#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX
49#define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN
50#define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT
51#define XATTR_NAME_SMACKEXEC XATTR_SECURITY_PREFIX XATTR_SMACK_EXEC
52#define XATTR_NAME_SMACKTRANSMUTE XATTR_SECURITY_PREFIX XATTR_SMACK_TRANSMUTE
53#define XATTR_NAME_SMACKMMAP XATTR_SECURITY_PREFIX XATTR_SMACK_MMAP
54
55#define XATTR_CAPS_SUFFIX "capability"
56#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
57
58#define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
59#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
60#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
61#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
62
63
64#endif /* _UAPI_LINUX_XATTR_H */
diff --git a/include/linux/xfrm.h b/include/uapi/linux/xfrm.h
index 28e493b5b94..28e493b5b94 100644
--- a/include/linux/xfrm.h
+++ b/include/uapi/linux/xfrm.h