aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild379
-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/affs_hardblocks.h68
-rw-r--r--include/linux/agpgart.h86
-rw-r--r--include/linux/aio_abi.h111
-rw-r--r--include/linux/apm_bios.h125
-rw-r--r--include/linux/arcfb.h8
-rw-r--r--include/linux/atalk.h43
-rw-r--r--include/linux/atm.h238
-rw-r--r--include/linux/atm_eni.h23
-rw-r--r--include/linux/atm_he.h20
-rw-r--r--include/linux/atm_idt77105.h28
-rw-r--r--include/linux/atm_nicstar.h53
-rw-r--r--include/linux/atm_tcp.h54
-rw-r--r--include/linux/atm_zatm.h52
-rw-r--r--include/linux/atmapi.h29
-rw-r--r--include/linux/atmarp.h41
-rw-r--r--include/linux/atmbr2684.h117
-rw-r--r--include/linux/atmclip.h21
-rw-r--r--include/linux/atmdev.h213
-rw-r--r--include/linux/atmioc.h41
-rw-r--r--include/linux/atmlec.h91
-rw-r--r--include/linux/atmmpc.h126
-rw-r--r--include/linux/atmppp.h24
-rw-r--r--include/linux/atmsap.h162
-rw-r--r--include/linux/atmsvc.h55
-rw-r--r--include/linux/audit.h381
-rw-r--r--include/linux/auto_fs.h68
-rw-r--r--include/linux/auto_fs4.h164
-rw-r--r--include/linux/auxvec.h33
-rw-r--r--include/linux/ax25.h116
-rw-r--r--include/linux/b1lli.h73
-rw-r--r--include/linux/baycom.h39
-rw-r--r--include/linux/bfs_fs.h81
-rw-r--r--include/linux/binfmts.h19
-rw-r--r--include/linux/blkpg.h59
-rw-r--r--include/linux/blktrace_api.h142
-rw-r--r--include/linux/bpqether.h41
-rw-r--r--include/linux/bsg.h63
-rw-r--r--include/linux/can.h162
-rw-r--r--include/linux/capability.h346
-rw-r--r--include/linux/capi.h133
-rw-r--r--include/linux/cciss_defs.h130
-rw-r--r--include/linux/cciss_ioctl.h86
-rw-r--r--include/linux/cdrom.h902
-rw-r--r--include/linux/cgroupstats.h71
-rw-r--r--include/linux/chio.h168
-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/coff.h351
-rw-r--r--include/linux/connector.h56
-rw-r--r--include/linux/const.h24
-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/cycx_cfm.h101
-rw-r--r--include/linux/dcbnl.h684
-rw-r--r--include/linux/dccp.h236
-rw-r--r--include/linux/dlm.h62
-rw-r--r--include/linux/dlm_device.h108
-rw-r--r--include/linux/dlm_netlink.h58
-rw-r--r--include/linux/dlm_plock.h37
-rw-r--r--include/linux/dlmconstants.h163
-rw-r--r--include/linux/dm-ioctl.h339
-rw-r--r--include/linux/dm-log-userspace.h416
-rw-r--r--include/linux/dn.h146
-rw-r--r--include/linux/dqblk_xfs.h166
-rw-r--r--include/linux/edd.h158
-rw-r--r--include/linux/efs_fs_sb.h62
-rw-r--r--include/linux/elf-em.h56
-rw-r--r--include/linux/elf-fdpic.h70
-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/fadvise.h21
-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/fdreg.h137
-rw-r--r--include/linux/fib_rules.h72
-rw-r--r--include/linux/fiemap.h68
-rw-r--r--include/linux/filter.h133
-rw-r--r--include/linux/firewire-cdev.h1039
-rw-r--r--include/linux/firewire-constants.h92
-rw-r--r--include/linux/flat.h50
-rw-r--r--include/linux/fs.h333
-rw-r--r--include/linux/fsl_hypervisor.h180
-rw-r--r--include/linux/fuse.h677
-rw-r--r--include/linux/futex.h150
-rw-r--r--include/linux/gameport.h26
-rw-r--r--include/linux/gen_stats.h67
-rw-r--r--include/linux/genetlink.h82
-rw-r--r--include/linux/gfs2_ondisk.h464
-rw-r--r--include/linux/gigaset_dev.h38
-rw-r--r--include/linux/hdlc.h13
-rw-r--r--include/linux/hdlcdrv.h104
-rw-r--r--include/linux/hdreg.h658
-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/hysdn_if.h33
-rw-r--r--include/linux/i2c-dev.h49
-rw-r--r--include/linux/i2c.h125
-rw-r--r--include/linux/i2o-dev.h421
-rw-r--r--include/linux/i8k.h46
-rw-r--r--include/linux/icmp.h80
-rw-r--r--include/linux/icmpv6.h165
-rw-r--r--include/linux/if.h235
-rw-r--r--include/linux/if_addr.h61
-rw-r--r--include/linux/if_addrlabel.h32
-rw-r--r--include/linux/if_alg.h40
-rw-r--r--include/linux/if_arcnet.h132
-rw-r--r--include/linux/if_arp.h136
-rw-r--r--include/linux/if_bonding.h128
-rw-r--r--include/linux/if_bridge.h89
-rw-r--r--include/linux/if_cablemodem.h22
-rw-r--r--include/linux/if_eql.h36
-rw-r--r--include/linux/if_ether.h115
-rw-r--r--include/linux/if_fc.h51
-rw-r--r--include/linux/if_fddi.h80
-rw-r--r--include/linux/if_frad.h98
-rw-r--r--include/linux/if_hippi.h153
-rw-r--r--include/linux/if_infiniband.h29
-rw-r--r--include/linux/if_link.h427
-rw-r--r--include/linux/if_ltalk.h7
-rw-r--r--include/linux/if_packet.h272
-rw-r--r--include/linux/if_phonet.h7
-rw-r--r--include/linux/if_plip.h27
-rw-r--r--include/linux/if_ppp.h1
-rw-r--r--include/linux/if_pppol2tp.h89
-rw-r--r--include/linux/if_pppox.h143
-rw-r--r--include/linux/if_slip.h30
-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/if_x25.h26
-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/in_route.h32
-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/ioctl.h7
-rw-r--r--include/linux/ip.h119
-rw-r--r--include/linux/ip6_tunnel.h51
-rw-r--r--include/linux/ip_vs.h434
-rw-r--r--include/linux/ipc.h80
-rw-r--r--include/linux/ipmi.h422
-rw-r--r--include/linux/ipmi_msgdefs.h121
-rw-r--r--include/linux/ipsec.h47
-rw-r--r--include/linux/ipv6.h166
-rw-r--r--include/linux/ipv6_route.h45
-rw-r--r--include/linux/ipx.h75
-rw-r--r--include/linux/irda.h251
-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/iso_fs.h165
-rw-r--r--include/linux/ivtv.h73
-rw-r--r--include/linux/ivtvfb.h37
-rw-r--r--include/linux/ixjuser.h720
-rw-r--r--include/linux/jffs2.h223
-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/keyctl.h60
-rw-r--r--include/linux/kvm.h975
-rw-r--r--include/linux/kvm_para.h26
-rw-r--r--include/linux/l2tp.h172
-rw-r--r--include/linux/limits.h20
-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/magic.h72
-rw-r--r--include/linux/major.h177
-rw-r--r--include/linux/map_to_7segment.h187
-rw-r--r--include/linux/matroxfb.h42
-rw-r--r--include/linux/mdio.h287
-rw-r--r--include/linux/media.h132
-rw-r--r--include/linux/mei.h110
-rw-r--r--include/linux/mempolicy.h63
-rw-r--r--include/linux/meye.h66
-rw-r--r--include/linux/mii.h154
-rw-r--r--include/linux/minix_fs.h106
-rw-r--r--include/linux/mman.h12
-rw-r--r--include/linux/mmtimer.h56
-rw-r--r--include/linux/mqueue.h53
-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/mtio.h208
-rw-r--r--include/linux/n_r3964.h56
-rw-r--r--include/linux/nbd.h63
-rw-r--r--include/linux/ncp.h201
-rw-r--r--include/linux/ncp_fs.h146
-rw-r--r--include/linux/ncp_mount.h71
-rw-r--r--include/linux/ncp_no.h19
-rw-r--r--include/linux/neighbour.h159
-rw-r--r--include/linux/net.h39
-rw-r--r--include/linux/net_dropmon.h64
-rw-r--r--include/linux/net_tstamp.h113
-rw-r--r--include/linux/netdevice.h32
-rw-r--r--include/linux/netfilter.h72
-rw-r--r--include/linux/netfilter_arp.h19
-rw-r--r--include/linux/netfilter_bridge.h27
-rw-r--r--include/linux/netfilter_decnet.h79
-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/netrom.h36
-rw-r--r--include/linux/nfc.h197
-rw-r--r--include/linux/nfs.h124
-rw-r--r--include/linux/nfs2.h67
-rw-r--r--include/linux/nfs3.h92
-rw-r--r--include/linux/nfs4.h166
-rw-r--r--include/linux/nfs4_mount.h71
-rw-r--r--include/linux/nfs_fs.h54
-rw-r--r--include/linux/nfs_idmap.h28
-rw-r--r--include/linux/nfs_mount.h77
-rw-r--r--include/linux/nfsacl.h23
-rw-r--r--include/linux/nl80211.h3072
-rw-r--r--include/linux/nubus.h234
-rw-r--r--include/linux/nvram.h14
-rw-r--r--include/linux/omap3isp.h646
-rw-r--r--include/linux/omapfb.h198
-rw-r--r--include/linux/oom.h10
-rw-r--r--include/linux/packet_diag.h72
-rw-r--r--include/linux/param.h6
-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/pci_regs.h846
-rw-r--r--include/linux/perf_event.h600
-rw-r--r--include/linux/personality.h71
-rw-r--r--include/linux/pfkeyv2.h370
-rw-r--r--include/linux/pg.h63
-rw-r--r--include/linux/phantom.h49
-rw-r--r--include/linux/phonet.h162
-rw-r--r--include/linux/pkt_cls.h469
-rw-r--r--include/linux/pkt_sched.h738
-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/posix_types.h37
-rw-r--r--include/linux/ppdev.h99
-rw-r--r--include/linux/ppp-comp.h86
-rw-r--r--include/linux/ppp-ioctl.h119
-rw-r--r--include/linux/ppp_defs.h141
-rw-r--r--include/linux/pps.h131
-rw-r--r--include/linux/prctl.h152
-rw-r--r--include/linux/ptp_clock.h84
-rw-r--r--include/linux/ptrace.h88
-rw-r--r--include/linux/qnx4_fs.h88
-rw-r--r--include/linux/qnxtypes.h28
-rw-r--r--include/linux/quota.h139
-rw-r--r--include/linux/radeonfb.h15
-rw-r--r--include/linux/random.h43
-rw-r--r--include/linux/raw.h18
-rw-r--r--include/linux/rds.h285
-rw-r--r--include/linux/reboot.h38
-rw-r--r--include/linux/reiserfs_fs.h26
-rw-r--r--include/linux/reiserfs_xattr.h24
-rw-r--r--include/linux/resource.h78
-rw-r--r--include/linux/rfkill.h92
-rw-r--r--include/linux/romfs_fs.h59
-rw-r--r--include/linux/rose.h90
-rw-r--r--include/linux/route.h69
-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/selinux_netlink.h50
-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/serial_reg.h371
-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/snmp.h284
-rw-r--r--include/linux/sock_diag.h24
-rw-r--r--include/linux/socket.h20
-rw-r--r--include/linux/sockios.h148
-rw-r--r--include/linux/som.h154
-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/suspend_ioctls.h33
-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/sysinfo.h24
-rw-r--r--include/linux/taskstats.h213
-rw-r--r--include/linux/tcp.h208
-rw-r--r--include/linux/tcp_metrics.h54
-rw-r--r--include/linux/telephony.h262
-rw-r--r--include/linux/termios.h22
-rw-r--r--include/linux/time.h72
-rw-r--r--include/linux/times.h13
-rw-r--r--include/linux/timex.h113
-rw-r--r--include/linux/tiocl.h39
-rw-r--r--include/linux/tipc.h209
-rw-r--r--include/linux/tipc_config.h395
-rw-r--r--include/linux/toshiba.h17
-rw-r--r--include/linux/tty.h37
-rw-r--r--include/linux/tty_flags.h78
-rw-r--r--include/linux/types.h50
-rw-r--r--include/linux/udf_fs_i.h21
-rw-r--r--include/linux/udp.h22
-rw-r--r--include/linux/uhid.h104
-rw-r--r--include/linux/uinput.h109
-rw-r--r--include/linux/uio.h24
-rw-r--r--include/linux/ultrasound.h103
-rw-r--r--include/linux/un.h13
-rw-r--r--include/linux/unistd.h9
-rw-r--r--include/linux/unix_diag.h54
-rw-r--r--include/linux/usbdevice_fs.h151
-rw-r--r--include/linux/utime.h11
-rw-r--r--include/linux/utsname.h33
-rw-r--r--include/linux/uuid.h37
-rw-r--r--include/linux/uvcvideo.h70
-rw-r--r--include/linux/v4l2-common.h71
-rw-r--r--include/linux/v4l2-controls.h803
-rw-r--r--include/linux/v4l2-dv-timings.h816
-rw-r--r--include/linux/v4l2-mediabus.h119
-rw-r--r--include/linux/v4l2-subdev.h180
-rw-r--r--include/linux/veth.h12
-rw-r--r--include/linux/vfio.h357
-rw-r--r--include/linux/vhost.h130
-rw-r--r--include/linux/videodev2.h1940
-rw-r--r--include/linux/virtio_9p.h44
-rw-r--r--include/linux/virtio_balloon.h59
-rw-r--r--include/linux/virtio_blk.h130
-rw-r--r--include/linux/virtio_config.h53
-rw-r--r--include/linux/virtio_console.h45
-rw-r--r--include/linux/virtio_ids.h41
-rw-r--r--include/linux/virtio_net.h169
-rw-r--r--include/linux/virtio_pci.h95
-rw-r--r--include/linux/virtio_ring.h163
-rw-r--r--include/linux/virtio_rng.h8
-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/wimax.h239
-rw-r--r--include/linux/wireless.h1120
-rw-r--r--include/linux/x25.h152
-rw-r--r--include/linux/xattr.h54
-rw-r--r--include/linux/xfrm.h506
379 files changed, 250 insertions, 60011 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index e2a1346514a6..5b57367e28db 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -22,389 +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 += blkpg.h
73header-y += blktrace_api.h
74header-y += bpqether.h
75header-y += bsg.h
76header-y += can.h
77header-y += capability.h
78header-y += capi.h
79header-y += cciss_defs.h
80header-y += cciss_ioctl.h
81header-y += cdrom.h
82header-y += cgroupstats.h
83header-y += chio.h
84header-y += cm4000_cs.h
85header-y += cn_proc.h
86header-y += coda.h
87header-y += coda_psdev.h
88header-y += coff.h
89header-y += connector.h
90header-y += const.h
91header-y += cramfs_fs.h
92header-y += cuda.h
93header-y += cyclades.h
94header-y += cycx_cfm.h
95header-y += dcbnl.h
96header-y += dccp.h
97header-y += dlm.h
98header-y += dlm_device.h
99header-y += dlm_netlink.h
100header-y += dlm_plock.h
101header-y += dlmconstants.h
102header-y += dm-ioctl.h
103header-y += dm-log-userspace.h
104header-y += dn.h
105header-y += dqblk_xfs.h
106header-y += edd.h
107header-y += efs_fs_sb.h
108header-y += elf-em.h
109header-y += elf-fdpic.h
110header-y += elf.h
111header-y += elfcore.h
112header-y += errno.h
113header-y += errqueue.h
114header-y += ethtool.h
115header-y += eventpoll.h
116header-y += fadvise.h
117header-y += falloc.h
118header-y += fanotify.h
119header-y += fb.h
120header-y += fcntl.h
121header-y += fd.h
122header-y += fdreg.h
123header-y += fib_rules.h
124header-y += fiemap.h
125header-y += filter.h
126header-y += firewire-cdev.h
127header-y += firewire-constants.h
128header-y += flat.h
129header-y += fs.h
130header-y += fsl_hypervisor.h
131header-y += fuse.h
132header-y += futex.h
133header-y += gameport.h
134header-y += gen_stats.h
135header-y += genetlink.h
136header-y += gfs2_ondisk.h
137header-y += gigaset_dev.h
138header-y += hdlc.h
139header-y += hdlcdrv.h
140header-y += hdreg.h
141header-y += hid.h
142header-y += hiddev.h
143header-y += hidraw.h
144header-y += hpet.h
145header-y += hysdn_if.h
146header-y += i2c-dev.h
147header-y += i2c.h
148header-y += i2o-dev.h
149header-y += i8k.h
150header-y += icmp.h
151header-y += icmpv6.h
152header-y += if.h
153header-y += if_addr.h
154header-y += if_addrlabel.h
155header-y += if_alg.h
156header-y += if_arcnet.h
157header-y += if_arp.h
158header-y += if_bonding.h
159header-y += if_bridge.h
160header-y += if_cablemodem.h
161header-y += if_eql.h
162header-y += if_ether.h
163header-y += if_fc.h
164header-y += if_fddi.h
165header-y += if_frad.h
166header-y += if_hippi.h
167header-y += if_infiniband.h
168header-y += if_link.h
169header-y += if_ltalk.h
170header-y += if_packet.h
171header-y += if_phonet.h
172header-y += if_plip.h
173header-y += if_ppp.h
174header-y += if_pppol2tp.h
175header-y += if_pppox.h
176header-y += if_slip.h
177header-y += if_team.h
178header-y += if_tun.h
179header-y += if_tunnel.h
180header-y += if_vlan.h
181header-y += if_x25.h
182header-y += igmp.h
183header-y += in.h
184header-y += in6.h
185header-y += in_route.h
186header-y += sock_diag.h
187header-y += inet_diag.h
188header-y += unix_diag.h
189header-y += packet_diag.h
190header-y += inotify.h
191header-y += input.h
192header-y += ioctl.h
193header-y += ip.h
194header-y += ip6_tunnel.h
195header-y += ip_vs.h
196header-y += ipc.h
197header-y += ipmi.h
198header-y += ipmi_msgdefs.h
199header-y += ipsec.h
200header-y += ipv6.h
201header-y += ipv6_route.h
202header-y += ipx.h
203header-y += irda.h
204header-y += irqnr.h
205header-y += isdn.h
206header-y += isdn_divertif.h
207header-y += isdn_ppp.h
208header-y += isdnif.h
209header-y += iso_fs.h
210header-y += ivtv.h
211header-y += ivtvfb.h
212header-y += ixjuser.h
213header-y += jffs2.h
214header-y += joystick.h
215header-y += kd.h
216header-y += kdev_t.h
217header-y += kernel.h
218header-y += kernelcapi.h
219header-y += kernel-page-flags.h
220header-y += kexec.h
221header-y += keyboard.h
222header-y += keyctl.h
223header-y += l2tp.h
224header-y += limits.h
225header-y += llc.h
226header-y += loop.h
227header-y += lp.h
228header-y += magic.h
229header-y += major.h
230header-y += map_to_7segment.h
231header-y += matroxfb.h
232header-y += mdio.h
233header-y += media.h
234header-y += mei.h
235header-y += mempolicy.h
236header-y += meye.h
237header-y += mii.h
238header-y += minix_fs.h
239header-y += mman.h
240header-y += mmtimer.h
241header-y += mqueue.h
242header-y += mroute.h
243header-y += mroute6.h
244header-y += msdos_fs.h
245header-y += msg.h
246header-y += mtio.h
247header-y += n_r3964.h
248header-y += nbd.h
249header-y += ncp.h
250header-y += ncp_fs.h
251header-y += ncp_mount.h
252header-y += ncp_no.h
253header-y += neighbour.h
254header-y += net.h
255header-y += net_dropmon.h
256header-y += net_tstamp.h
257header-y += netdevice.h
258header-y += netfilter.h
259header-y += netfilter_arp.h
260header-y += netfilter_bridge.h
261header-y += netfilter_decnet.h
262header-y += netfilter_ipv4.h
263header-y += netfilter_ipv6.h
264header-y += netlink.h
265header-y += netrom.h
266header-y += nfc.h
267header-y += nfs.h
268header-y += nfs2.h
269header-y += nfs3.h
270header-y += nfs4.h
271header-y += nfs4_mount.h
272header-y += nfs_fs.h
273header-y += nfs_idmap.h
274header-y += nfs_mount.h
275header-y += nfsacl.h
276header-y += nl80211.h
277header-y += nubus.h
278header-y += nvram.h
279header-y += omap3isp.h
280header-y += omapfb.h
281header-y += oom.h
282header-y += param.h
283header-y += parport.h
284header-y += patchkey.h
285header-y += pci.h
286header-y += pci_regs.h
287header-y += perf_event.h
288header-y += personality.h
289header-y += pfkeyv2.h
290header-y += pg.h
291header-y += phantom.h
292header-y += phonet.h
293header-y += pkt_cls.h
294header-y += pkt_sched.h
295header-y += pktcdvd.h
296header-y += pmu.h
297header-y += poll.h
298header-y += posix_types.h
299header-y += ppdev.h
300header-y += ppp-comp.h
301header-y += ppp-ioctl.h
302header-y += ppp_defs.h
303header-y += pps.h
304header-y += prctl.h
305header-y += ptp_clock.h
306header-y += ptrace.h
307header-y += qnx4_fs.h
308header-y += qnxtypes.h
309header-y += quota.h
310header-y += radeonfb.h
311header-y += random.h
312header-y += raw.h
313header-y += rds.h
314header-y += reboot.h
315header-y += reiserfs_fs.h
316header-y += reiserfs_xattr.h
317header-y += resource.h
318header-y += rfkill.h
319header-y += romfs_fs.h
320header-y += rose.h
321header-y += route.h
322header-y += rtc.h
323header-y += rtnetlink.h
324header-y += scc.h
325header-y += sched.h
326header-y += screen_info.h
327header-y += sdla.h
328header-y += seccomp.h
329header-y += securebits.h
330header-y += selinux_netlink.h
331header-y += sem.h
332header-y += serial.h
333header-y += serial_core.h
334header-y += serial_reg.h
335header-y += serio.h
336header-y += shm.h
337header-y += signal.h
338header-y += signalfd.h
339header-y += snmp.h
340header-y += socket.h
341header-y += sockios.h
342header-y += som.h
343header-y += sonet.h
344header-y += sonypi.h
345header-y += sound.h
346header-y += soundcard.h
347header-y += stat.h
348header-y += stddef.h
349header-y += string.h
350header-y += suspend_ioctls.h
351header-y += swab.h
352header-y += synclink.h
353header-y += sysctl.h
354header-y += sysinfo.h
355header-y += taskstats.h
356header-y += tcp.h
357header-y += tcp_metrics.h
358header-y += telephony.h
359header-y += termios.h
360header-y += time.h
361header-y += times.h
362header-y += timex.h
363header-y += tiocl.h
364header-y += tipc.h
365header-y += tipc_config.h
366header-y += toshiba.h
367header-y += tty.h
368header-y += tty_flags.h
369header-y += types.h
370header-y += udf_fs_i.h
371header-y += udp.h
372header-y += uhid.h
373header-y += uinput.h
374header-y += uio.h
375header-y += ultrasound.h
376header-y += un.h
377header-y += unistd.h
378header-y += usbdevice_fs.h
379header-y += utime.h
380header-y += utsname.h
381header-y += uuid.h
382header-y += uvcvideo.h
383header-y += v4l2-common.h
384header-y += v4l2-controls.h
385header-y += v4l2-dv-timings.h
386header-y += v4l2-mediabus.h
387header-y += v4l2-subdev.h
388header-y += veth.h
389header-y += vfio.h
390header-y += vhost.h
391header-y += videodev2.h
392header-y += virtio_9p.h
393header-y += virtio_balloon.h
394header-y += virtio_blk.h
395header-y += virtio_config.h
396header-y += virtio_console.h
397header-y += virtio_ids.h
398header-y += virtio_net.h
399header-y += virtio_pci.h
400header-y += virtio_ring.h
401header-y += virtio_rng.h
402header-y += vt.h
403header-y += wait.h
404header-y += wanrouter.h
405header-y += watchdog.h
406header-y += wimax.h
407header-y += wireless.h
408header-y += x25.h
409header-y += xattr.h
410header-y += xfrm.h
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index e86dfca44589..220f14338895 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 d537aa0ec414..4a5b7cb56079 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 63bca502fa55..cde41300c7ad 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 b19801f73890..0d991071a9d4 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/affs_hardblocks.h b/include/linux/affs_hardblocks.h
deleted file mode 100644
index f1b948c1f592..000000000000
--- a/include/linux/affs_hardblocks.h
+++ /dev/null
@@ -1,68 +0,0 @@
1#ifndef AFFS_HARDBLOCKS_H
2#define AFFS_HARDBLOCKS_H
3
4#include <linux/types.h>
5
6/* Just the needed definitions for the RDB of an Amiga HD. */
7
8struct RigidDiskBlock {
9 __u32 rdb_ID;
10 __be32 rdb_SummedLongs;
11 __s32 rdb_ChkSum;
12 __u32 rdb_HostID;
13 __be32 rdb_BlockBytes;
14 __u32 rdb_Flags;
15 __u32 rdb_BadBlockList;
16 __be32 rdb_PartitionList;
17 __u32 rdb_FileSysHeaderList;
18 __u32 rdb_DriveInit;
19 __u32 rdb_Reserved1[6];
20 __u32 rdb_Cylinders;
21 __u32 rdb_Sectors;
22 __u32 rdb_Heads;
23 __u32 rdb_Interleave;
24 __u32 rdb_Park;
25 __u32 rdb_Reserved2[3];
26 __u32 rdb_WritePreComp;
27 __u32 rdb_ReducedWrite;
28 __u32 rdb_StepRate;
29 __u32 rdb_Reserved3[5];
30 __u32 rdb_RDBBlocksLo;
31 __u32 rdb_RDBBlocksHi;
32 __u32 rdb_LoCylinder;
33 __u32 rdb_HiCylinder;
34 __u32 rdb_CylBlocks;
35 __u32 rdb_AutoParkSeconds;
36 __u32 rdb_HighRDSKBlock;
37 __u32 rdb_Reserved4;
38 char rdb_DiskVendor[8];
39 char rdb_DiskProduct[16];
40 char rdb_DiskRevision[4];
41 char rdb_ControllerVendor[8];
42 char rdb_ControllerProduct[16];
43 char rdb_ControllerRevision[4];
44 __u32 rdb_Reserved5[10];
45};
46
47#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
48
49struct PartitionBlock {
50 __be32 pb_ID;
51 __be32 pb_SummedLongs;
52 __s32 pb_ChkSum;
53 __u32 pb_HostID;
54 __be32 pb_Next;
55 __u32 pb_Flags;
56 __u32 pb_Reserved1[2];
57 __u32 pb_DevFlags;
58 __u8 pb_DriveName[32];
59 __u32 pb_Reserved2[15];
60 __be32 pb_Environment[17];
61 __u32 pb_EReserved[15];
62};
63
64#define IDNAME_PARTITION 0x50415254 /* "PART" */
65
66#define RDB_ALLOCATION_LIMIT 16
67
68#endif /* AFFS_HARDBLOCKS_H */
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index f6778eceb8f4..c6b61ca97053 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/aio_abi.h b/include/linux/aio_abi.h
deleted file mode 100644
index 86fa7a71336a..000000000000
--- a/include/linux/aio_abi.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/* include/linux/aio_abi.h
2 *
3 * Copyright 2000,2001,2002 Red Hat.
4 *
5 * Written by Benjamin LaHaise <bcrl@kvack.org>
6 *
7 * Distribute under the terms of the GPLv2 (see ../../COPYING) or under
8 * the following terms.
9 *
10 * Permission to use, copy, modify, and distribute this software and its
11 * documentation is hereby granted, provided that the above copyright
12 * notice appears in all copies. This software is provided without any
13 * warranty, express or implied. Red Hat makes no representations about
14 * the suitability of this software for any purpose.
15 *
16 * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
17 * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
18 * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED
19 * OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
24 * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
25 * ENHANCEMENTS, OR MODIFICATIONS.
26 */
27#ifndef __LINUX__AIO_ABI_H
28#define __LINUX__AIO_ABI_H
29
30#include <linux/types.h>
31#include <asm/byteorder.h>
32
33typedef __kernel_ulong_t aio_context_t;
34
35enum {
36 IOCB_CMD_PREAD = 0,
37 IOCB_CMD_PWRITE = 1,
38 IOCB_CMD_FSYNC = 2,
39 IOCB_CMD_FDSYNC = 3,
40 /* These two are experimental.
41 * IOCB_CMD_PREADX = 4,
42 * IOCB_CMD_POLL = 5,
43 */
44 IOCB_CMD_NOOP = 6,
45 IOCB_CMD_PREADV = 7,
46 IOCB_CMD_PWRITEV = 8,
47};
48
49/*
50 * Valid flags for the "aio_flags" member of the "struct iocb".
51 *
52 * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
53 * is valid.
54 */
55#define IOCB_FLAG_RESFD (1 << 0)
56
57/* read() from /dev/aio returns these structures. */
58struct io_event {
59 __u64 data; /* the data field from the iocb */
60 __u64 obj; /* what iocb this event came from */
61 __s64 res; /* result code for this event */
62 __s64 res2; /* secondary result */
63};
64
65#if defined(__LITTLE_ENDIAN)
66#define PADDED(x,y) x, y
67#elif defined(__BIG_ENDIAN)
68#define PADDED(x,y) y, x
69#else
70#error edit for your odd byteorder.
71#endif
72
73/*
74 * we always use a 64bit off_t when communicating
75 * with userland. its up to libraries to do the
76 * proper padding and aio_error abstraction
77 */
78
79struct iocb {
80 /* these are internal to the kernel/libc. */
81 __u64 aio_data; /* data to be returned in event's data */
82 __u32 PADDED(aio_key, aio_reserved1);
83 /* the kernel sets aio_key to the req # */
84
85 /* common fields */
86 __u16 aio_lio_opcode; /* see IOCB_CMD_ above */
87 __s16 aio_reqprio;
88 __u32 aio_fildes;
89
90 __u64 aio_buf;
91 __u64 aio_nbytes;
92 __s64 aio_offset;
93
94 /* extra parameters */
95 __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */
96
97 /* flags for the "struct iocb" */
98 __u32 aio_flags;
99
100 /*
101 * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an
102 * eventfd to signal AIO readiness to
103 */
104 __u32 aio_resfd;
105}; /* 64 bytes */
106
107#undef IFBIG
108#undef IFLITTLE
109
110#endif /* __LINUX__AIO_ABI_H */
111
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 01a6244c9bc9..9c3a87184f48 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/arcfb.h b/include/linux/arcfb.h
deleted file mode 100644
index 721e7654daeb..000000000000
--- a/include/linux/arcfb.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __LINUX_ARCFB_H__
2#define __LINUX_ARCFB_H__
3
4#define FBIO_WAITEVENT _IO('F', 0x88)
5#define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t)
6
7#endif
8
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index f57c36881c48..73fd8b7e9534 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 d3b292174aeb..30006c435951 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_eni.h b/include/linux/atm_eni.h
deleted file mode 100644
index 34f317972551..000000000000
--- a/include/linux/atm_eni.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* atm_eni.h - Driver-specific declarations of the ENI driver (for use by
2 driver-specific utilities) */
3
4/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
5
6
7#ifndef LINUX_ATM_ENI_H
8#define LINUX_ATM_ENI_H
9
10#include <linux/atmioc.h>
11
12
13struct eni_multipliers {
14 int tx,rx; /* values are in percent and must be > 100 */
15};
16
17
18#define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc)
19 /* printk memory map */
20#define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc)
21 /* set buffer multipliers */
22
23#endif
diff --git a/include/linux/atm_he.h b/include/linux/atm_he.h
deleted file mode 100644
index 2a7713b597cf..000000000000
--- a/include/linux/atm_he.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* atm_he.h */
2
3#ifndef LINUX_ATM_HE_H
4#define LINUX_ATM_HE_H
5
6#include <linux/atmioc.h>
7
8#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc)
9
10#define HE_REGTYPE_PCI 1
11#define HE_REGTYPE_RCM 2
12#define HE_REGTYPE_TCM 3
13#define HE_REGTYPE_MBOX 4
14
15struct he_ioctl_reg {
16 unsigned addr, val;
17 char type;
18};
19
20#endif /* LINUX_ATM_HE_H */
diff --git a/include/linux/atm_idt77105.h b/include/linux/atm_idt77105.h
deleted file mode 100644
index 8b724000aa50..000000000000
--- a/include/linux/atm_idt77105.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for
2 * use by driver-specific utilities) */
3
4/* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */
5
6
7#ifndef LINUX_ATM_IDT77105_H
8#define LINUX_ATM_IDT77105_H
9
10#include <linux/types.h>
11#include <linux/atmioc.h>
12#include <linux/atmdev.h>
13
14/*
15 * Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls.
16 * Pointed to by `arg' in atmif_sioc.
17 */
18struct idt77105_stats {
19 __u32 symbol_errors; /* wire symbol errors */
20 __u32 tx_cells; /* cells transmitted */
21 __u32 rx_cells; /* cells received */
22 __u32 rx_hec_errors; /* Header Error Check errors on receive */
23};
24
25#define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */
26#define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */
27
28#endif
diff --git a/include/linux/atm_nicstar.h b/include/linux/atm_nicstar.h
deleted file mode 100644
index 577b79f33e8d..000000000000
--- a/include/linux/atm_nicstar.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/******************************************************************************
2 *
3 * atm_nicstar.h
4 *
5 * Driver-specific declarations for use by NICSTAR driver specific utils.
6 *
7 * Author: Rui Prior
8 *
9 * (C) INESC 1998
10 *
11 ******************************************************************************/
12
13
14#ifndef LINUX_ATM_NICSTAR_H
15#define LINUX_ATM_NICSTAR_H
16
17/* Note: non-kernel programs including this file must also include
18 * sys/types.h for struct timeval
19 */
20
21#include <linux/atmapi.h>
22#include <linux/atmioc.h>
23
24#define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc)
25 /* get pool statistics */
26#define NS_SETBUFLEV _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
27 /* set buffer level markers */
28#define NS_ADJBUFLEV _IO('a',ATMIOC_SARPRV+3)
29 /* adjust buffer level */
30
31typedef struct buf_nr
32{
33 unsigned min;
34 unsigned init;
35 unsigned max;
36}buf_nr;
37
38
39typedef struct pool_levels
40{
41 int buftype;
42 int count; /* (At least for now) only used in NS_GETPSTAT */
43 buf_nr level;
44} pool_levels;
45
46/* type must be one of the following: */
47#define NS_BUFTYPE_SMALL 1
48#define NS_BUFTYPE_LARGE 2
49#define NS_BUFTYPE_HUGE 3
50#define NS_BUFTYPE_IOVEC 4
51
52
53#endif /* LINUX_ATM_NICSTAR_H */
diff --git a/include/linux/atm_tcp.h b/include/linux/atm_tcp.h
index 375638f8554b..db6b65fc0aec 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/atm_zatm.h b/include/linux/atm_zatm.h
deleted file mode 100644
index 10f0fa29454f..000000000000
--- a/include/linux/atm_zatm.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by
2 driver-specific utilities) */
3
4/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
5
6
7#ifndef LINUX_ATM_ZATM_H
8#define LINUX_ATM_ZATM_H
9
10/*
11 * Note: non-kernel programs including this file must also include
12 * sys/types.h for struct timeval
13 */
14
15#include <linux/atmapi.h>
16#include <linux/atmioc.h>
17
18#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
19 /* get pool statistics */
20#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
21 /* get statistics and zero */
22#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
23 /* set pool parameters */
24
25struct zatm_pool_info {
26 int ref_count; /* free buffer pool usage counters */
27 int low_water,high_water; /* refill parameters */
28 int rqa_count,rqu_count; /* queue condition counters */
29 int offset,next_off; /* alignment optimizations: offset */
30 int next_cnt,next_thres; /* repetition counter and threshold */
31};
32
33struct zatm_pool_req {
34 int pool_num; /* pool number */
35 struct zatm_pool_info info; /* actual information */
36};
37
38struct zatm_t_hist {
39 struct timeval real; /* real (wall-clock) time */
40 struct timeval expected; /* expected real time */
41};
42
43
44#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
45#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
46#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
47#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
48
49#define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to
50 record; must be 2^n */
51
52#endif
diff --git a/include/linux/atmapi.h b/include/linux/atmapi.h
deleted file mode 100644
index 8fe54d90d95b..000000000000
--- a/include/linux/atmapi.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* atmapi.h - ATM API user space/kernel compatibility */
2
3/* Written 1999,2000 by Werner Almesberger, EPFL ICA */
4
5
6#ifndef _LINUX_ATMAPI_H
7#define _LINUX_ATMAPI_H
8
9#if defined(__sparc__) || defined(__ia64__)
10/* such alignment is not required on 32 bit sparcs, but we can't
11 figure that we are on a sparc64 while compiling user-space programs. */
12#define __ATM_API_ALIGN __attribute__((aligned(8)))
13#else
14#define __ATM_API_ALIGN
15#endif
16
17
18/*
19 * Opaque type for kernel pointers. Note that _ is never accessed. We need
20 * the struct in order hide the array, so that we can make simple assignments
21 * instead of being forced to use memcpy. It also improves error reporting for
22 * code that still assumes that we're passing unsigned longs.
23 *
24 * Convention: NULL pointers are passed as a field of all zeroes.
25 */
26
27typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
28
29#endif
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h
deleted file mode 100644
index 231f4bdec730..000000000000
--- a/include/linux/atmarp.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */
2
3/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef _LINUX_ATMARP_H
7#define _LINUX_ATMARP_H
8
9#include <linux/types.h>
10#include <linux/atmapi.h>
11#include <linux/atmioc.h>
12
13
14#define ATMARP_RETRY_DELAY 30 /* request next resolution or forget
15 NAK after 30 sec - should go into
16 atmclip.h */
17#define ATMARP_MAX_UNRES_PACKETS 5 /* queue that many packets while
18 waiting for the resolver */
19
20
21#define ATMARPD_CTRL _IO('a',ATMIOC_CLIP+1) /* become atmarpd ctrl sock */
22#define ATMARP_MKIP _IO('a',ATMIOC_CLIP+2) /* attach socket to IP */
23#define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */
24#define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */
25
26
27enum atmarp_ctrl_type {
28 act_invalid, /* catch uninitialized structures */
29 act_need, /* need address resolution */
30 act_up, /* interface is coming up */
31 act_down, /* interface is going down */
32 act_change /* interface configuration has changed */
33};
34
35struct atmarp_ctrl {
36 enum atmarp_ctrl_type type; /* message type */
37 int itf_num;/* interface number (if present) */
38 __be32 ip; /* IP address (act_need only) */
39};
40
41#endif
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
deleted file mode 100644
index fdb2629b6189..000000000000
--- a/include/linux/atmbr2684.h
+++ /dev/null
@@ -1,117 +0,0 @@
1#ifndef _LINUX_ATMBR2684_H
2#define _LINUX_ATMBR2684_H
3
4#include <linux/types.h>
5#include <linux/atm.h>
6#include <linux/if.h> /* For IFNAMSIZ */
7
8/*
9 * Type of media we're bridging (ethernet, token ring, etc) Currently only
10 * ethernet is supported
11 */
12#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
13#define BR2684_MEDIA_802_4 (1) /* 802.4 */
14#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
15#define BR2684_MEDIA_FDDI (3)
16#define BR2684_MEDIA_802_6 (4) /* 802.6 */
17
18 /* used only at device creation: */
19#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
20
21/*
22 * Is there FCS inbound on this VC? This currently isn't supported.
23 */
24#define BR2684_FCSIN_NO (0)
25#define BR2684_FCSIN_IGNORE (1)
26#define BR2684_FCSIN_VERIFY (2)
27
28/*
29 * Is there FCS outbound on this VC? This currently isn't supported.
30 */
31#define BR2684_FCSOUT_NO (0)
32#define BR2684_FCSOUT_SENDZERO (1)
33#define BR2684_FCSOUT_GENERATE (2)
34
35/*
36 * Does this VC include LLC encapsulation?
37 */
38#define BR2684_ENCAPS_VC (0) /* VC-mux */
39#define BR2684_ENCAPS_LLC (1)
40#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
41
42/*
43 * Is this VC bridged or routed?
44 */
45
46#define BR2684_PAYLOAD_ROUTED (0)
47#define BR2684_PAYLOAD_BRIDGED (1)
48
49/*
50 * This is for the ATM_NEWBACKENDIF call - these are like socket families:
51 * the first element of the structure is the backend number and the rest
52 * is per-backend specific
53 */
54struct atm_newif_br2684 {
55 atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
56 int media; /* BR2684_MEDIA_*, flags in upper bits */
57 char ifname[IFNAMSIZ];
58 int mtu;
59};
60
61/*
62 * This structure is used to specify a br2684 interface - either by a
63 * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
64 */
65#define BR2684_FIND_BYNOTHING (0)
66#define BR2684_FIND_BYNUM (1)
67#define BR2684_FIND_BYIFNAME (2)
68struct br2684_if_spec {
69 int method; /* BR2684_FIND_* */
70 union {
71 char ifname[IFNAMSIZ];
72 int devnum;
73 } spec;
74};
75
76/*
77 * This is for the ATM_SETBACKEND call - these are like socket families:
78 * the first element of the structure is the backend number and the rest
79 * is per-backend specific
80 */
81struct atm_backend_br2684 {
82 atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
83 struct br2684_if_spec ifspec;
84 int fcs_in; /* BR2684_FCSIN_* */
85 int fcs_out; /* BR2684_FCSOUT_* */
86 int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
87 int encaps; /* BR2684_ENCAPS_* */
88 int has_vpiid; /* 1: use vpn_id - Unsupported */
89 __u8 vpn_id[7];
90 int send_padding; /* unsupported */
91 int min_size; /* we will pad smaller packets than this */
92};
93
94/*
95 * The BR2684_SETFILT ioctl is an experimental mechanism for folks
96 * terminating a large number of IP-only vcc's. When netfilter allows
97 * efficient per-if in/out filters, this support will be removed
98 */
99struct br2684_filter {
100 __be32 prefix; /* network byte order */
101 __be32 netmask; /* 0 = disable filter */
102};
103
104struct br2684_filter_set {
105 struct br2684_if_spec ifspec;
106 struct br2684_filter filter;
107};
108
109enum br2684_payload {
110 p_routed = BR2684_PAYLOAD_ROUTED,
111 p_bridged = BR2684_PAYLOAD_BRIDGED,
112};
113
114#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
115 struct br2684_filter_set)
116
117#endif /* _LINUX_ATMBR2684_H */
diff --git a/include/linux/atmclip.h b/include/linux/atmclip.h
deleted file mode 100644
index 02c94c448dd6..000000000000
--- a/include/linux/atmclip.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* atmclip.h - Classical IP over ATM */
2
3/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef LINUX_ATMCLIP_H
7#define LINUX_ATMCLIP_H
8
9#include <linux/sockios.h>
10#include <linux/atmioc.h>
11
12
13#define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */
14#define RFC1626_MTU 9180 /* RFC1626 default MTU */
15
16#define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */
17#define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */
18
19#define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */
20
21#endif
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 06fd4bbc58f6..22ef21c33d0c 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/atmioc.h b/include/linux/atmioc.h
deleted file mode 100644
index 37f67aa8f1c1..000000000000
--- a/include/linux/atmioc.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/* atmioc.h - ranges for ATM-related ioctl numbers */
2
3/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
4
5
6/*
7 * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of
8 * "magic" ioctl numbers.
9 */
10
11
12#ifndef _LINUX_ATMIOC_H
13#define _LINUX_ATMIOC_H
14
15#include <asm/ioctl.h>
16 /* everybody including atmioc.h will also need _IO{,R,W,WR} */
17
18#define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */
19#define ATMIOC_PHYCOM_END 0x0f
20#define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */
21#define ATMIOC_PHYTYP_END 0x2f
22#define ATMIOC_PHYPRV 0x30 /* PHY dev private ioctls, unique per driver */
23#define ATMIOC_PHYPRV_END 0x4f
24#define ATMIOC_SARCOM 0x50 /* SAR device common ioctls, globally unique */
25#define ATMIOC_SARCOM_END 0x50
26#define ATMIOC_SARPRV 0x60 /* SAR dev private ioctls, unique per driver */
27#define ATMIOC_SARPRV_END 0x7f
28#define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */
29#define ATMIOC_ITF_END 0x8f
30#define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */
31#define ATMIOC_BACKEND_END 0xaf
32/* 0xb0-0xbf: Reserved for future use */
33#define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */
34#define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */
35#define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */
36#define ATMIOC_CLIP 0xe0 /* Classical IP over ATM control, globally u. */
37#define ATMIOC_CLIP_END 0xef
38#define ATMIOC_SPECIAL 0xf0 /* Special-purpose controls, globally unique */
39#define ATMIOC_SPECIAL_END 0xff
40
41#endif
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h
deleted file mode 100644
index 302791e3ab2b..000000000000
--- a/include/linux/atmlec.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * ATM Lan Emulation Daemon driver interface
3 *
4 * Marko Kiiskila <mkiiskila@yahoo.com>
5 */
6
7#ifndef _ATMLEC_H_
8#define _ATMLEC_H_
9
10#include <linux/atmapi.h>
11#include <linux/atmioc.h>
12#include <linux/atm.h>
13#include <linux/if_ether.h>
14#include <linux/types.h>
15
16/* ATM lec daemon control socket */
17#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
18#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
19#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
20
21/* Maximum number of LEC interfaces (tweakable) */
22#define MAX_LEC_ITF 48
23
24typedef enum {
25 l_set_mac_addr,
26 l_del_mac_addr,
27 l_svc_setup,
28 l_addr_delete,
29 l_topology_change,
30 l_flush_complete,
31 l_arp_update,
32 l_narp_req, /* LANE2 mandates the use of this */
33 l_config,
34 l_flush_tran_id,
35 l_set_lecid,
36 l_arp_xmt,
37 l_rdesc_arp_xmt,
38 l_associate_req,
39 l_should_bridge /* should we bridge this MAC? */
40} atmlec_msg_type;
41
42#define ATMLEC_MSG_TYPE_MAX l_should_bridge
43
44struct atmlec_config_msg {
45 unsigned int maximum_unknown_frame_count;
46 unsigned int max_unknown_frame_time;
47 unsigned short max_retry_count;
48 unsigned int aging_time;
49 unsigned int forward_delay_time;
50 unsigned int arp_response_time;
51 unsigned int flush_timeout;
52 unsigned int path_switching_delay;
53 unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
54 int mtu;
55 int is_proxy;
56};
57
58struct atmlec_msg {
59 atmlec_msg_type type;
60 int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
61 union {
62 struct {
63 unsigned char mac_addr[ETH_ALEN];
64 unsigned char atm_addr[ATM_ESA_LEN];
65 unsigned int flag; /*
66 * Topology_change flag,
67 * remoteflag, permanent flag,
68 * lecid, transaction id
69 */
70 unsigned int targetless_le_arp; /* LANE2 */
71 unsigned int no_source_le_narp; /* LANE2 */
72 } normal;
73 struct atmlec_config_msg config;
74 struct {
75 __u16 lec_id; /* requestor lec_id */
76 __u32 tran_id; /* transaction id */
77 unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
78 unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
79 } proxy; /*
80 * For mapping LE_ARP requests to responses. Filled by
81 * zeppelin, returned by kernel. Used only when proxying
82 */
83 } content;
84} __ATM_API_ALIGN;
85
86struct atmlec_ioc {
87 int dev_num;
88 unsigned char atm_addr[ATM_ESA_LEN];
89 unsigned char receive; /* 1= receive vcc, 0 = send vcc */
90};
91#endif /* _ATMLEC_H_ */
diff --git a/include/linux/atmmpc.h b/include/linux/atmmpc.h
deleted file mode 100644
index 2aba5787fa63..000000000000
--- a/include/linux/atmmpc.h
+++ /dev/null
@@ -1,126 +0,0 @@
1#ifndef _ATMMPC_H_
2#define _ATMMPC_H_
3
4#include <linux/atmapi.h>
5#include <linux/atmioc.h>
6#include <linux/atm.h>
7#include <linux/types.h>
8
9#define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
10#define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
11
12#define MPC_SOCKET_INGRESS 1
13#define MPC_SOCKET_EGRESS 2
14
15struct atmmpc_ioc {
16 int dev_num;
17 __be32 ipaddr; /* the IP address of the shortcut */
18 int type; /* ingress or egress */
19};
20
21typedef struct in_ctrl_info {
22 __u8 Last_NHRP_CIE_code;
23 __u8 Last_Q2931_cause_value;
24 __u8 eg_MPC_ATM_addr[ATM_ESA_LEN];
25 __be32 tag;
26 __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
27 __u16 holding_time;
28 __u32 request_id;
29} in_ctrl_info;
30
31typedef struct eg_ctrl_info {
32 __u8 DLL_header[256];
33 __u8 DH_length;
34 __be32 cache_id;
35 __be32 tag;
36 __be32 mps_ip;
37 __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
38 __u8 in_MPC_data_ATM_addr[ATM_ESA_LEN];
39 __u16 holding_time;
40} eg_ctrl_info;
41
42struct mpc_parameters {
43 __u16 mpc_p1; /* Shortcut-Setup Frame Count */
44 __u16 mpc_p2; /* Shortcut-Setup Frame Time */
45 __u8 mpc_p3[8]; /* Flow-detection Protocols */
46 __u16 mpc_p4; /* MPC Initial Retry Time */
47 __u16 mpc_p5; /* MPC Retry Time Maximum */
48 __u16 mpc_p6; /* Hold Down Time */
49} ;
50
51struct k_message {
52 __u16 type;
53 __be32 ip_mask;
54 __u8 MPS_ctrl[ATM_ESA_LEN];
55 union {
56 in_ctrl_info in_info;
57 eg_ctrl_info eg_info;
58 struct mpc_parameters params;
59 } content;
60 struct atm_qos qos;
61} __ATM_API_ALIGN;
62
63struct llc_snap_hdr {
64 /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
65 __u8 dsap; /* Destination Service Access Point (0xAA) */
66 __u8 ssap; /* Source Service Access Point (0xAA) */
67 __u8 ui; /* Unnumbered Information (0x03) */
68 __u8 org[3]; /* Organizational identification (0x000000) */
69 __u8 type[2]; /* Ether type (for IP) (0x0800) */
70};
71
72/* TLVs this MPC recognizes */
73#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a
74
75/* MPOA device types in MPOA Device Type TLV */
76#define NON_MPOA 0
77#define MPS 1
78#define MPC 2
79#define MPS_AND_MPC 3
80
81
82/* MPC parameter defaults */
83
84#define MPC_P1 10 /* Shortcut-Setup Frame Count */
85#define MPC_P2 1 /* Shortcut-Setup Frame Time */
86#define MPC_P3 0 /* Flow-detection Protocols */
87#define MPC_P4 5 /* MPC Initial Retry Time */
88#define MPC_P5 40 /* MPC Retry Time Maximum */
89#define MPC_P6 160 /* Hold Down Time */
90#define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
91
92/* MPC constants */
93
94#define MPC_C1 2 /* Retry Time Multiplier */
95#define MPC_C2 60 /* Initial Keep-Alive Lifetime */
96
97/* Message types - to MPOA daemon */
98
99#define SND_MPOA_RES_RQST 201
100#define SET_MPS_CTRL_ADDR 202
101#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */
102#define STOP_KEEP_ALIVE_SM 204
103#define EGRESS_ENTRY_REMOVED 205
104#define SND_EGRESS_PURGE 206
105#define DIE 207 /* tell the daemon to exit() */
106#define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */
107#define OPEN_INGRESS_SVC 209
108
109/* Message types - from MPOA daemon */
110
111#define MPOA_TRIGGER_RCVD 101
112#define MPOA_RES_REPLY_RCVD 102
113#define INGRESS_PURGE_RCVD 103
114#define EGRESS_PURGE_RCVD 104
115#define MPS_DEATH 105
116#define CACHE_IMPOS_RCVD 106
117#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */
118#define SET_MPS_MAC_ADDR 108
119#define CLEAN_UP_AND_EXIT 109
120#define SET_MPC_PARAMS 110 /* MPC configuration parameters */
121
122/* Message types - bidirectional */
123
124#define RELOAD 301 /* kill -HUP the daemon for reload */
125
126#endif /* _ATMMPC_H_ */
diff --git a/include/linux/atmppp.h b/include/linux/atmppp.h
deleted file mode 100644
index 300dcce0c83f..000000000000
--- a/include/linux/atmppp.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* atmppp.h - RFC2364 PPPoATM */
2
3/* Written 2000 by Mitchell Blank Jr */
4
5#ifndef _LINUX_ATMPPP_H
6#define _LINUX_ATMPPP_H
7
8#include <linux/atm.h>
9
10#define PPPOATM_ENCAPS_AUTODETECT (0)
11#define PPPOATM_ENCAPS_VC (1)
12#define PPPOATM_ENCAPS_LLC (2)
13
14/*
15 * This is for the ATM_SETBACKEND call - these are like socket families:
16 * the first element of the structure is the backend number and the rest
17 * is per-backend specific
18 */
19struct atm_backend_ppp {
20 atm_backend_t backend_num; /* ATM_BACKEND_PPP */
21 int encaps; /* PPPOATM_ENCAPS_* */
22};
23
24#endif /* _LINUX_ATMPPP_H */
diff --git a/include/linux/atmsap.h b/include/linux/atmsap.h
deleted file mode 100644
index 799b104515d7..000000000000
--- a/include/linux/atmsap.h
+++ /dev/null
@@ -1,162 +0,0 @@
1/* atmsap.h - ATM Service Access Point addressing definitions */
2
3/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef _LINUX_ATMSAP_H
7#define _LINUX_ATMSAP_H
8
9#include <linux/atmapi.h>
10
11/*
12 * BEGIN_xx and END_xx markers are used for automatic generation of
13 * documentation. Do not change them.
14 */
15
16
17/*
18 * Layer 2 protocol identifiers
19 */
20
21/* BEGIN_L2 */
22#define ATM_L2_NONE 0 /* L2 not specified */
23#define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
24#define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
25#define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
26#define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
27#define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
28#define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
29#define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
30#define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
31#define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
32#define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
33#define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
34#define ATM_L2_USER 0x10 /* user-specified */
35#define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
36/* END_L2 */
37
38
39/*
40 * Layer 3 protocol identifiers
41 */
42
43/* BEGIN_L3 */
44#define ATM_L3_NONE 0 /* L3 not specified */
45#define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
46#define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
47#define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
48#define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
49#define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
50#define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
51#define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
52#define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
53#define ATM_L3_USER 0x10 /* user-specified */
54/* END_L3 */
55
56
57/*
58 * High layer identifiers
59 */
60
61/* BEGIN_HL */
62#define ATM_HL_NONE 0 /* HL not specified */
63#define ATM_HL_ISO 0x01 /* ISO */
64#define ATM_HL_USER 0x02 /* user-specific */
65#define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
66#define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
67/* END_HL */
68
69
70/*
71 * ITU-T coded mode of operation
72 */
73
74/* BEGIN_IMD */
75#define ATM_IMD_NONE 0 /* mode not specified */
76#define ATM_IMD_NORMAL 1 /* normal mode of operation */
77#define ATM_IMD_EXTENDED 2 /* extended mode of operation */
78/* END_IMD */
79
80/*
81 * H.310 code points
82 */
83
84#define ATM_TT_NONE 0 /* terminal type not specified */
85#define ATM_TT_RX 1 /* receive only */
86#define ATM_TT_TX 2 /* send only */
87#define ATM_TT_RXTX 3 /* receive and send */
88
89#define ATM_MC_NONE 0 /* no multiplexing */
90#define ATM_MC_TS 1 /* transport stream (TS) */
91#define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
92#define ATM_MC_PS 3 /* program stream (PS) */
93#define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
94#define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
95
96/*
97 * SAP structures
98 */
99
100#define ATM_MAX_HLI 8 /* maximum high-layer information length */
101
102
103struct atm_blli {
104 unsigned char l2_proto; /* layer 2 protocol */
105 union {
106 struct {
107 unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
108 /* absent */
109 unsigned char window; /* window size (k), 1-127 (0 to omit) */
110 } itu; /* ITU-T encoding */
111 unsigned char user; /* user-specified l2 information */
112 } l2;
113 unsigned char l3_proto; /* layer 3 protocol */
114 union {
115 struct {
116 unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
117 /* absent */
118 unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
119 /* omit) */
120 unsigned char window;/* packet window size, 1-127 (0 to omit) */
121 } itu; /* ITU-T encoding */
122 unsigned char user; /* user specified l3 information */
123 struct { /* if l3_proto = ATM_L3_H310 */
124 unsigned char term_type; /* terminal type */
125 unsigned char fw_mpx_cap; /* forward multiplexing capability */
126 /* only if term_type != ATM_TT_NONE */
127 unsigned char bw_mpx_cap; /* backward multiplexing capability */
128 /* only if term_type != ATM_TT_NONE */
129 } h310;
130 struct { /* if l3_proto = ATM_L3_TR9577 */
131 unsigned char ipi; /* initial protocol id */
132 unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
133 /* (only if ipi == NLPID_IEEE802_1_SNAP) */
134 } tr9577;
135 } l3;
136} __ATM_API_ALIGN;
137
138
139struct atm_bhli {
140 unsigned char hl_type; /* high layer information type */
141 unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
142 /* hl_type == ATM_HL_ISO) */
143 unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
144};
145
146
147#define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
148
149
150struct atm_sap {
151 struct atm_bhli bhli; /* local SAP, high-layer information */
152 struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
153 /* local SAP, low-layer info */
154};
155
156
157static __inline__ int blli_in_use(struct atm_blli blli)
158{
159 return blli.l2_proto || blli.l3_proto;
160}
161
162#endif
diff --git a/include/linux/atmsvc.h b/include/linux/atmsvc.h
deleted file mode 100644
index aa71583b8da7..000000000000
--- a/include/linux/atmsvc.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/* atmsvc.h - ATM signaling kernel-demon interface definitions */
2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4
5
6#ifndef _LINUX_ATMSVC_H
7#define _LINUX_ATMSVC_H
8
9#include <linux/atmapi.h>
10#include <linux/atm.h>
11#include <linux/atmioc.h>
12
13
14#define ATMSIGD_CTRL _IO('a',ATMIOC_SPECIAL)
15 /* become ATM signaling demon control socket */
16
17enum atmsvc_msg_type { as_catch_null, as_bind, as_connect, as_accept, as_reject,
18 as_listen, as_okay, as_error, as_indicate, as_close,
19 as_itf_notify, as_modify, as_identify, as_terminate,
20 as_addparty, as_dropparty };
21
22struct atmsvc_msg {
23 enum atmsvc_msg_type type;
24 atm_kptr_t vcc;
25 atm_kptr_t listen_vcc; /* indicate */
26 int reply; /* for okay and close: */
27 /* < 0: error before active */
28 /* (sigd has discarded ctx) */
29 /* ==0: success */
30 /* > 0: error when active (still */
31 /* need to close) */
32 struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */
33 struct sockaddr_atmsvc local; /* local SVC address */
34 struct atm_qos qos; /* QOS parameters */
35 struct atm_sap sap; /* SAP */
36 unsigned int session; /* for p2pm */
37 struct sockaddr_atmsvc svc; /* SVC address */
38} __ATM_API_ALIGN;
39
40/*
41 * Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz
42 */
43
44/*
45 * Some policy stuff for atmsigd and for net/atm/svc.c. Both have to agree on
46 * what PCR is used to request bandwidth from the device driver. net/atm/svc.c
47 * tries to do better than that, but only if there's no routing decision (i.e.
48 * if signaling only uses one ATM interface).
49 */
50
51#define SELECT_TOP_PCR(tp) ((tp).pcr ? (tp).pcr : \
52 (tp).max_pcr && (tp).max_pcr != ATM_MAX_PCR ? (tp).max_pcr : \
53 (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR)
54
55#endif
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b889fa64b0e0..bce729afbcf9 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 da64e15004b6..fcd704d354c4 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/auto_fs4.h b/include/linux/auto_fs4.h
deleted file mode 100644
index e02982fa2953..000000000000
--- a/include/linux/auto_fs4.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/* -*- c -*-
2 * linux/include/linux/auto_fs4.h
3 *
4 * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
5 *
6 * This file is part of the Linux kernel and is made available under
7 * the terms of the GNU General Public License, version 2, or at your
8 * option, any later version, incorporated herein by reference.
9 */
10
11#ifndef _LINUX_AUTO_FS4_H
12#define _LINUX_AUTO_FS4_H
13
14/* Include common v3 definitions */
15#include <linux/types.h>
16#include <linux/auto_fs.h>
17
18/* autofs v4 definitions */
19#undef AUTOFS_PROTO_VERSION
20#undef AUTOFS_MIN_PROTO_VERSION
21#undef AUTOFS_MAX_PROTO_VERSION
22
23#define AUTOFS_PROTO_VERSION 5
24#define AUTOFS_MIN_PROTO_VERSION 3
25#define AUTOFS_MAX_PROTO_VERSION 5
26
27#define AUTOFS_PROTO_SUBVERSION 2
28
29/* Mask for expire behaviour */
30#define AUTOFS_EXP_IMMEDIATE 1
31#define AUTOFS_EXP_LEAVES 2
32
33#define AUTOFS_TYPE_ANY 0U
34#define AUTOFS_TYPE_INDIRECT 1U
35#define AUTOFS_TYPE_DIRECT 2U
36#define AUTOFS_TYPE_OFFSET 4U
37
38static inline void set_autofs_type_indirect(unsigned int *type)
39{
40 *type = AUTOFS_TYPE_INDIRECT;
41 return;
42}
43
44static inline unsigned int autofs_type_indirect(unsigned int type)
45{
46 return (type == AUTOFS_TYPE_INDIRECT);
47}
48
49static inline void set_autofs_type_direct(unsigned int *type)
50{
51 *type = AUTOFS_TYPE_DIRECT;
52 return;
53}
54
55static inline unsigned int autofs_type_direct(unsigned int type)
56{
57 return (type == AUTOFS_TYPE_DIRECT);
58}
59
60static inline void set_autofs_type_offset(unsigned int *type)
61{
62 *type = AUTOFS_TYPE_OFFSET;
63 return;
64}
65
66static inline unsigned int autofs_type_offset(unsigned int type)
67{
68 return (type == AUTOFS_TYPE_OFFSET);
69}
70
71static inline unsigned int autofs_type_trigger(unsigned int type)
72{
73 return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
74}
75
76/*
77 * This isn't really a type as we use it to say "no type set" to
78 * indicate we want to search for "any" mount in the
79 * autofs_dev_ioctl_ismountpoint() device ioctl function.
80 */
81static inline void set_autofs_type_any(unsigned int *type)
82{
83 *type = AUTOFS_TYPE_ANY;
84 return;
85}
86
87static inline unsigned int autofs_type_any(unsigned int type)
88{
89 return (type == AUTOFS_TYPE_ANY);
90}
91
92/* Daemon notification packet types */
93enum autofs_notify {
94 NFY_NONE,
95 NFY_MOUNT,
96 NFY_EXPIRE
97};
98
99/* Kernel protocol version 4 packet types */
100
101/* Expire entry (umount request) */
102#define autofs_ptype_expire_multi 2
103
104/* Kernel protocol version 5 packet types */
105
106/* Indirect mount missing and expire requests. */
107#define autofs_ptype_missing_indirect 3
108#define autofs_ptype_expire_indirect 4
109
110/* Direct mount missing and expire requests */
111#define autofs_ptype_missing_direct 5
112#define autofs_ptype_expire_direct 6
113
114/* v4 multi expire (via pipe) */
115struct autofs_packet_expire_multi {
116 struct autofs_packet_hdr hdr;
117 autofs_wqt_t wait_queue_token;
118 int len;
119 char name[NAME_MAX+1];
120};
121
122union autofs_packet_union {
123 struct autofs_packet_hdr hdr;
124 struct autofs_packet_missing missing;
125 struct autofs_packet_expire expire;
126 struct autofs_packet_expire_multi expire_multi;
127};
128
129/* autofs v5 common packet struct */
130struct autofs_v5_packet {
131 struct autofs_packet_hdr hdr;
132 autofs_wqt_t wait_queue_token;
133 __u32 dev;
134 __u64 ino;
135 __u32 uid;
136 __u32 gid;
137 __u32 pid;
138 __u32 tgid;
139 __u32 len;
140 char name[NAME_MAX+1];
141};
142
143typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
144typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
145typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
146typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
147
148union autofs_v5_packet_union {
149 struct autofs_packet_hdr hdr;
150 struct autofs_v5_packet v5_packet;
151 autofs_packet_missing_indirect_t missing_indirect;
152 autofs_packet_expire_indirect_t expire_indirect;
153 autofs_packet_missing_direct_t missing_direct;
154 autofs_packet_expire_direct_t expire_direct;
155};
156
157#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
158#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
159#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
160#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
161#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
162
163
164#endif /* _LINUX_AUTO_FS4_H */
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index f3b5d4e3a2ac..669fef5c745a 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/ax25.h b/include/linux/ax25.h
deleted file mode 100644
index 74c89a41732d..000000000000
--- a/include/linux/ax25.h
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * These are the public elements of the Linux kernel AX.25 code. A similar
3 * file netrom.h exists for the NET/ROM protocol.
4 */
5
6#ifndef AX25_KERNEL_H
7#define AX25_KERNEL_H
8
9#include <linux/socket.h>
10
11#define AX25_MTU 256
12#define AX25_MAX_DIGIS 8
13
14#define AX25_WINDOW 1
15#define AX25_T1 2
16#define AX25_N2 3
17#define AX25_T3 4
18#define AX25_T2 5
19#define AX25_BACKOFF 6
20#define AX25_EXTSEQ 7
21#define AX25_PIDINCL 8
22#define AX25_IDLE 9
23#define AX25_PACLEN 10
24#define AX25_IAMDIGI 12
25
26#define AX25_KILL 99
27
28#define SIOCAX25GETUID (SIOCPROTOPRIVATE+0)
29#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
30#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
31#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
32#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
33#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
34#define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9)
35#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
36#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
37#define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12)
38#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13)
39
40#define AX25_SET_RT_IPMODE 2
41
42#define AX25_NOUID_DEFAULT 0
43#define AX25_NOUID_BLOCK 1
44
45typedef struct {
46 char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */
47} ax25_address;
48
49struct sockaddr_ax25 {
50 __kernel_sa_family_t sax25_family;
51 ax25_address sax25_call;
52 int sax25_ndigis;
53 /* Digipeater ax25_address sets follow */
54};
55
56#define sax25_uid sax25_ndigis
57
58struct full_sockaddr_ax25 {
59 struct sockaddr_ax25 fsa_ax25;
60 ax25_address fsa_digipeater[AX25_MAX_DIGIS];
61};
62
63struct ax25_routes_struct {
64 ax25_address port_addr;
65 ax25_address dest_addr;
66 unsigned char digi_count;
67 ax25_address digi_addr[AX25_MAX_DIGIS];
68};
69
70struct ax25_route_opt_struct {
71 ax25_address port_addr;
72 ax25_address dest_addr;
73 int cmd;
74 int arg;
75};
76
77struct ax25_ctl_struct {
78 ax25_address port_addr;
79 ax25_address source_addr;
80 ax25_address dest_addr;
81 unsigned int cmd;
82 unsigned long arg;
83 unsigned char digi_count;
84 ax25_address digi_addr[AX25_MAX_DIGIS];
85};
86
87/* this will go away. Please do not export to user land */
88struct ax25_info_struct_deprecated {
89 unsigned int n2, n2count;
90 unsigned int t1, t1timer;
91 unsigned int t2, t2timer;
92 unsigned int t3, t3timer;
93 unsigned int idle, idletimer;
94 unsigned int state;
95 unsigned int rcv_q, snd_q;
96};
97
98struct ax25_info_struct {
99 unsigned int n2, n2count;
100 unsigned int t1, t1timer;
101 unsigned int t2, t2timer;
102 unsigned int t3, t3timer;
103 unsigned int idle, idletimer;
104 unsigned int state;
105 unsigned int rcv_q, snd_q;
106 unsigned int vs, vr, va, vs_max;
107 unsigned int paclen;
108 unsigned int window;
109};
110
111struct ax25_fwd_struct {
112 ax25_address port_from;
113 ax25_address port_to;
114};
115
116#endif
diff --git a/include/linux/b1lli.h b/include/linux/b1lli.h
deleted file mode 100644
index 713f712685d3..000000000000
--- a/include/linux/b1lli.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
2 *
3 * ISDN lowlevel-module for AVM B1-card.
4 *
5 * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
9 *
10 */
11
12#ifndef _B1LLI_H_
13#define _B1LLI_H_
14/*
15 * struct for loading t4 file
16 */
17typedef struct avmb1_t4file {
18 int len;
19 unsigned char *data;
20} avmb1_t4file;
21
22typedef struct avmb1_loaddef {
23 int contr;
24 avmb1_t4file t4file;
25} avmb1_loaddef;
26
27typedef struct avmb1_loadandconfigdef {
28 int contr;
29 avmb1_t4file t4file;
30 avmb1_t4file t4config;
31} avmb1_loadandconfigdef;
32
33typedef struct avmb1_resetdef {
34 int contr;
35} avmb1_resetdef;
36
37typedef struct avmb1_getdef {
38 int contr;
39 int cardtype;
40 int cardstate;
41} avmb1_getdef;
42
43/*
44 * struct for adding new cards
45 */
46typedef struct avmb1_carddef {
47 int port;
48 int irq;
49} avmb1_carddef;
50
51#define AVM_CARDTYPE_B1 0
52#define AVM_CARDTYPE_T1 1
53#define AVM_CARDTYPE_M1 2
54#define AVM_CARDTYPE_M2 3
55
56typedef struct avmb1_extcarddef {
57 int port;
58 int irq;
59 int cardtype;
60 int cardnr; /* for HEMA/T1 */
61} avmb1_extcarddef;
62
63#define AVMB1_LOAD 0 /* load image to card */
64#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
65#define AVMB1_RESETCARD 2 /* reset a card */
66#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
67#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
68#define AVMB1_GET_CARDINFO 5 /* get cardtype */
69#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
70
71#define AVMB1_REGISTERCARD_IS_OBSOLETE
72
73#endif /* _B1LLI_H_ */
diff --git a/include/linux/baycom.h b/include/linux/baycom.h
deleted file mode 100644
index 81249e029dad..000000000000
--- a/include/linux/baycom.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * The Linux BAYCOM driver for the Baycom serial 1200 baud modem
3 * and the parallel 9600 baud modem
4 * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA
5 */
6
7#ifndef _BAYCOM_H
8#define _BAYCOM_H
9
10/* -------------------------------------------------------------------- */
11/*
12 * structs for the IOCTL commands
13 */
14
15struct baycom_debug_data {
16 unsigned long debug1;
17 unsigned long debug2;
18 long debug3;
19};
20
21struct baycom_ioctl {
22 int cmd;
23 union {
24 struct baycom_debug_data dbg;
25 } data;
26};
27
28/* -------------------------------------------------------------------- */
29
30/*
31 * ioctl values change for baycom
32 */
33#define BAYCOMCTL_GETDEBUG 0x92
34
35/* -------------------------------------------------------------------- */
36
37#endif /* _BAYCOM_H */
38
39/* --------------------------------------------------------------------- */
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
deleted file mode 100644
index 1c0b355aa515..000000000000
--- a/include/linux/bfs_fs.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * include/linux/bfs_fs.h - BFS data structures on disk.
3 * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
4 */
5
6#ifndef _LINUX_BFS_FS_H
7#define _LINUX_BFS_FS_H
8
9#include <linux/types.h>
10
11#define BFS_BSIZE_BITS 9
12#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
13
14#define BFS_MAGIC 0x1BADFACE
15#define BFS_ROOT_INO 2
16#define BFS_INODES_PER_BLOCK 8
17
18/* SVR4 vnode type values (bfs_inode->i_vtype) */
19#define BFS_VDIR 2L
20#define BFS_VREG 1L
21
22/* BFS inode layout on disk */
23struct bfs_inode {
24 __le16 i_ino;
25 __u16 i_unused;
26 __le32 i_sblock;
27 __le32 i_eblock;
28 __le32 i_eoffset;
29 __le32 i_vtype;
30 __le32 i_mode;
31 __le32 i_uid;
32 __le32 i_gid;
33 __le32 i_nlink;
34 __le32 i_atime;
35 __le32 i_mtime;
36 __le32 i_ctime;
37 __u32 i_padding[4];
38};
39
40#define BFS_NAMELEN 14
41#define BFS_DIRENT_SIZE 16
42#define BFS_DIRS_PER_BLOCK 32
43
44struct bfs_dirent {
45 __le16 ino;
46 char name[BFS_NAMELEN];
47};
48
49/* BFS superblock layout on disk */
50struct bfs_super_block {
51 __le32 s_magic;
52 __le32 s_start;
53 __le32 s_end;
54 __le32 s_from;
55 __le32 s_to;
56 __s32 s_bfrom;
57 __s32 s_bto;
58 char s_fsname[6];
59 char s_volume[6];
60 __u32 s_padding[118];
61};
62
63
64#define BFS_OFF2INO(offset) \
65 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
66
67#define BFS_INO2OFF(ino) \
68 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
69#define BFS_NZFILESIZE(ip) \
70 ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
71
72#define BFS_FILESIZE(ip) \
73 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
74
75#define BFS_FILEBLOCKS(ip) \
76 ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
77#define BFS_UNCLEAN(bfs_sb, sb) \
78 ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
79
80
81#endif /* _LINUX_BFS_FS_H */
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 26531f32bbb2..cfcc6bfcaec0 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/blkpg.h b/include/linux/blkpg.h
deleted file mode 100644
index a8519446c111..000000000000
--- a/include/linux/blkpg.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef _LINUX_BLKPG_H
2#define _LINUX_BLKPG_H
3
4/*
5 * Partition table and disk geometry handling
6 *
7 * A single ioctl with lots of subfunctions:
8 *
9 * Device number stuff:
10 * get_whole_disk() (given the device number of a partition,
11 * find the device number of the encompassing disk)
12 * get_all_partitions() (given the device number of a disk, return the
13 * device numbers of all its known partitions)
14 *
15 * Partition stuff:
16 * add_partition()
17 * delete_partition()
18 * test_partition_in_use() (also for test_disk_in_use)
19 *
20 * Geometry stuff:
21 * get_geometry()
22 * set_geometry()
23 * get_bios_drivedata()
24 *
25 * For today, only the partition stuff - aeb, 990515
26 */
27#include <linux/compiler.h>
28#include <linux/ioctl.h>
29
30#define BLKPG _IO(0x12,105)
31
32/* The argument structure */
33struct blkpg_ioctl_arg {
34 int op;
35 int flags;
36 int datalen;
37 void __user *data;
38};
39
40/* The subfunctions (for the op field) */
41#define BLKPG_ADD_PARTITION 1
42#define BLKPG_DEL_PARTITION 2
43#define BLKPG_RESIZE_PARTITION 3
44
45/* Sizes of name fields. Unused at present. */
46#define BLKPG_DEVNAMELTH 64
47#define BLKPG_VOLNAMELTH 64
48
49/* The data structure for ADD_PARTITION and DEL_PARTITION */
50struct blkpg_partition {
51 long long start; /* starting offset in bytes */
52 long long length; /* length in bytes */
53 int pno; /* partition number */
54 char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
55 to be used in kernel messages */
56 char volname[BLKPG_VOLNAMELTH]; /* volume label */
57};
58
59#endif /* _LINUX_BLKPG_H */
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 4d1a0748eaf8..7c2e030e72f1 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/bpqether.h b/include/linux/bpqether.h
deleted file mode 100644
index a6c35e1a89ad..000000000000
--- a/include/linux/bpqether.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef __BPQETHER_H
2#define __BPQETHER_H
3
4/*
5 * Defines for the BPQETHER pseudo device driver
6 */
7
8#ifndef __LINUX_IF_ETHER_H
9#include <linux/if_ether.h>
10#endif
11
12#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */
13#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1)
14
15struct bpq_ethaddr {
16 unsigned char destination[ETH_ALEN];
17 unsigned char accept[ETH_ALEN];
18};
19
20/*
21 * For SIOCSBPQETHOPT - this is compatible with PI2/PacketTwin card drivers,
22 * currently not implemented, though. If someone wants to hook a radio
23 * to his Ethernet card he may find this useful. ;-)
24 */
25
26#define SIOCGBPQETHPARAM 0x5000 /* get Level 1 parameters */
27#define SIOCSBPQETHPARAM 0x5001 /* set */
28
29struct bpq_req {
30 int cmd;
31 int speed; /* unused */
32 int clockmode; /* unused */
33 int txdelay;
34 unsigned char persist; /* unused */
35 int slotime; /* unused */
36 int squeldelay;
37 int dmachan; /* unused */
38 int irq; /* unused */
39};
40
41#endif
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index ecb4730d0868..7173f6e9d2dd 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/can.h b/include/linux/can.h
deleted file mode 100644
index e52958d7c2d1..000000000000
--- a/include/linux/can.h
+++ /dev/null
@@ -1,162 +0,0 @@
1/*
2 * linux/can.h
3 *
4 * Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
5 *
6 * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Urs Thuermann <urs.thuermann@volkswagen.de>
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved.
10 *
11 */
12
13#ifndef CAN_H
14#define CAN_H
15
16#include <linux/types.h>
17#include <linux/socket.h>
18
19/* controller area network (CAN) kernel definitions */
20
21/* special address description flags for the CAN_ID */
22#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
23#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
24#define CAN_ERR_FLAG 0x20000000U /* error message frame */
25
26/* valid bits in CAN ID for frame formats */
27#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
28#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
29#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
30
31/*
32 * Controller Area Network Identifier structure
33 *
34 * bit 0-28 : CAN identifier (11/29 bit)
35 * bit 29 : error message frame flag (0 = data frame, 1 = error message)
36 * bit 30 : remote transmission request flag (1 = rtr frame)
37 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
38 */
39typedef __u32 canid_t;
40
41#define CAN_SFF_ID_BITS 11
42#define CAN_EFF_ID_BITS 29
43
44/*
45 * Controller Area Network Error Message Frame Mask structure
46 *
47 * bit 0-28 : error class mask (see include/linux/can/error.h)
48 * bit 29-31 : set to zero
49 */
50typedef __u32 can_err_mask_t;
51
52/* CAN payload length and DLC definitions according to ISO 11898-1 */
53#define CAN_MAX_DLC 8
54#define CAN_MAX_DLEN 8
55
56/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
57#define CANFD_MAX_DLC 15
58#define CANFD_MAX_DLEN 64
59
60/**
61 * struct can_frame - basic CAN frame structure
62 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
63 * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
64 * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
65 * mapping of the 'data length code' to the real payload length
66 * @data: CAN frame payload (up to 8 byte)
67 */
68struct can_frame {
69 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
70 __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
71 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
72};
73
74/*
75 * defined bits for canfd_frame.flags
76 *
77 * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
78 * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
79 * the CAN controllers bitstream processor into the CAN FD mode which creates
80 * two new options within the CAN FD frame specification:
81 *
82 * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
83 * Error State Indicator - represents the error state of the transmitting node
84 *
85 * As the CANFD_ESI bit is internally generated by the transmitting CAN
86 * controller only the CANFD_BRS bit is relevant for real CAN controllers when
87 * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
88 * sense for virtual CAN interfaces to test applications with echoed frames.
89 */
90#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
91#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
92
93/**
94 * struct canfd_frame - CAN flexible data rate frame structure
95 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
96 * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
97 * @flags: additional flags for CAN FD
98 * @__res0: reserved / padding
99 * @__res1: reserved / padding
100 * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
101 */
102struct canfd_frame {
103 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
104 __u8 len; /* frame payload length in byte */
105 __u8 flags; /* additional flags for CAN FD */
106 __u8 __res0; /* reserved / padding */
107 __u8 __res1; /* reserved / padding */
108 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
109};
110
111#define CAN_MTU (sizeof(struct can_frame))
112#define CANFD_MTU (sizeof(struct canfd_frame))
113
114/* particular protocols of the protocol family PF_CAN */
115#define CAN_RAW 1 /* RAW sockets */
116#define CAN_BCM 2 /* Broadcast Manager */
117#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
118#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
119#define CAN_MCNET 5 /* Bosch MCNet */
120#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
121#define CAN_NPROTO 7
122
123#define SOL_CAN_BASE 100
124
125/**
126 * struct sockaddr_can - the sockaddr structure for CAN sockets
127 * @can_family: address family number AF_CAN.
128 * @can_ifindex: CAN network interface index.
129 * @can_addr: protocol specific address information
130 */
131struct sockaddr_can {
132 __kernel_sa_family_t can_family;
133 int can_ifindex;
134 union {
135 /* transport protocol class address information (e.g. ISOTP) */
136 struct { canid_t rx_id, tx_id; } tp;
137
138 /* reserved for future CAN protocols address information */
139 } can_addr;
140};
141
142/**
143 * struct can_filter - CAN ID based filter in can_register().
144 * @can_id: relevant bits of CAN ID which are not masked out.
145 * @can_mask: CAN mask (see description)
146 *
147 * Description:
148 * A filter matches, when
149 *
150 * <received_can_id> & mask == can_id & mask
151 *
152 * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
153 * filter for error message frames (CAN_ERR_FLAG bit set in mask).
154 */
155struct can_filter {
156 canid_t can_id;
157 canid_t can_mask;
158};
159
160#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
161
162#endif /* CAN_H */
diff --git a/include/linux/capability.h b/include/linux/capability.h
index d10b7ed595b1..98503b792369 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/capi.h b/include/linux/capi.h
deleted file mode 100644
index 65100d6cb89b..000000000000
--- a/include/linux/capi.h
+++ /dev/null
@@ -1,133 +0,0 @@
1/* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
2 *
3 * CAPI 2.0 Interface for Linux
4 *
5 * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
9 *
10 */
11
12#ifndef __LINUX_CAPI_H__
13#define __LINUX_CAPI_H__
14
15#include <linux/types.h>
16#include <linux/ioctl.h>
17#ifndef __KERNEL__
18#include <linux/kernelcapi.h>
19#endif
20
21/*
22 * CAPI_REGISTER
23 */
24
25typedef struct capi_register_params { /* CAPI_REGISTER */
26 __u32 level3cnt; /* No. of simulatneous user data connections */
27 __u32 datablkcnt; /* No. of buffered data messages */
28 __u32 datablklen; /* Size of buffered data messages */
29} capi_register_params;
30
31#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
32
33/*
34 * CAPI_GET_MANUFACTURER
35 */
36
37#define CAPI_MANUFACTURER_LEN 64
38
39#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
40
41/*
42 * CAPI_GET_VERSION
43 */
44
45typedef struct capi_version {
46 __u32 majorversion;
47 __u32 minorversion;
48 __u32 majormanuversion;
49 __u32 minormanuversion;
50} capi_version;
51
52#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
53
54/*
55 * CAPI_GET_SERIAL
56 */
57
58#define CAPI_SERIAL_LEN 8
59#define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
60
61/*
62 * CAPI_GET_PROFILE
63 */
64
65typedef struct capi_profile {
66 __u16 ncontroller; /* number of installed controller */
67 __u16 nbchannel; /* number of B-Channels */
68 __u32 goptions; /* global options */
69 __u32 support1; /* B1 protocols support */
70 __u32 support2; /* B2 protocols support */
71 __u32 support3; /* B3 protocols support */
72 __u32 reserved[6]; /* reserved */
73 __u32 manu[5]; /* manufacturer specific information */
74} capi_profile;
75
76#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
77
78typedef struct capi_manufacturer_cmd {
79 unsigned long cmd;
80 void __user *data;
81} capi_manufacturer_cmd;
82
83/*
84 * CAPI_MANUFACTURER_CMD
85 */
86
87#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
88
89/*
90 * CAPI_GET_ERRCODE
91 * capi errcode is set, * if read, write, or ioctl returns EIO,
92 * ioctl returns errcode directly, and in arg, if != 0
93 */
94
95#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
96
97/*
98 * CAPI_INSTALLED
99 */
100#define CAPI_INSTALLED _IOR('C',0x22, __u16)
101
102
103/*
104 * member contr is input for
105 * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
106 * and CAPI_GET_PROFILE
107 */
108typedef union capi_ioctl_struct {
109 __u32 contr;
110 capi_register_params rparams;
111 __u8 manufacturer[CAPI_MANUFACTURER_LEN];
112 capi_version version;
113 __u8 serial[CAPI_SERIAL_LEN];
114 capi_profile profile;
115 capi_manufacturer_cmd cmd;
116 __u16 errcode;
117} capi_ioctl_struct;
118
119/*
120 * Middleware extension
121 */
122
123#define CAPIFLAG_HIGHJACKING 0x0001
124
125#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
126#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
127#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
128
129#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
130
131#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
132
133#endif /* __LINUX_CAPI_H__ */
diff --git a/include/linux/cciss_defs.h b/include/linux/cciss_defs.h
deleted file mode 100644
index 316b670d4e33..000000000000
--- a/include/linux/cciss_defs.h
+++ /dev/null
@@ -1,130 +0,0 @@
1#ifndef CCISS_DEFS_H
2#define CCISS_DEFS_H
3
4#include <linux/types.h>
5
6/* general boundary definitions */
7#define SENSEINFOBYTES 32 /* note that this value may vary
8 between host implementations */
9
10/* Command Status value */
11#define CMD_SUCCESS 0x0000
12#define CMD_TARGET_STATUS 0x0001
13#define CMD_DATA_UNDERRUN 0x0002
14#define CMD_DATA_OVERRUN 0x0003
15#define CMD_INVALID 0x0004
16#define CMD_PROTOCOL_ERR 0x0005
17#define CMD_HARDWARE_ERR 0x0006
18#define CMD_CONNECTION_LOST 0x0007
19#define CMD_ABORTED 0x0008
20#define CMD_ABORT_FAILED 0x0009
21#define CMD_UNSOLICITED_ABORT 0x000A
22#define CMD_TIMEOUT 0x000B
23#define CMD_UNABORTABLE 0x000C
24
25/* transfer direction */
26#define XFER_NONE 0x00
27#define XFER_WRITE 0x01
28#define XFER_READ 0x02
29#define XFER_RSVD 0x03
30
31/* task attribute */
32#define ATTR_UNTAGGED 0x00
33#define ATTR_SIMPLE 0x04
34#define ATTR_HEADOFQUEUE 0x05
35#define ATTR_ORDERED 0x06
36#define ATTR_ACA 0x07
37
38/* cdb type */
39#define TYPE_CMD 0x00
40#define TYPE_MSG 0x01
41
42/* Type defs used in the following structs */
43#define BYTE __u8
44#define WORD __u16
45#define HWORD __u16
46#define DWORD __u32
47
48#define CISS_MAX_LUN 1024
49
50#define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
51#define LEVEL3LUN 0
52
53#pragma pack(1)
54
55/* Command List Structure */
56typedef union _SCSI3Addr_struct {
57 struct {
58 BYTE Dev;
59 BYTE Bus:6;
60 BYTE Mode:2; /* b00 */
61 } PeripDev;
62 struct {
63 BYTE DevLSB;
64 BYTE DevMSB:6;
65 BYTE Mode:2; /* b01 */
66 } LogDev;
67 struct {
68 BYTE Dev:5;
69 BYTE Bus:3;
70 BYTE Targ:6;
71 BYTE Mode:2; /* b10 */
72 } LogUnit;
73} SCSI3Addr_struct;
74
75typedef struct _PhysDevAddr_struct {
76 DWORD TargetId:24;
77 DWORD Bus:6;
78 DWORD Mode:2;
79 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
80} PhysDevAddr_struct;
81
82typedef struct _LogDevAddr_struct {
83 DWORD VolId:30;
84 DWORD Mode:2;
85 BYTE reserved[4];
86} LogDevAddr_struct;
87
88typedef union _LUNAddr_struct {
89 BYTE LunAddrBytes[8];
90 SCSI3Addr_struct SCSI3Lun[4];
91 PhysDevAddr_struct PhysDev;
92 LogDevAddr_struct LogDev;
93} LUNAddr_struct;
94
95typedef struct _RequestBlock_struct {
96 BYTE CDBLen;
97 struct {
98 BYTE Type:3;
99 BYTE Attribute:3;
100 BYTE Direction:2;
101 } Type;
102 HWORD Timeout;
103 BYTE CDB[16];
104} RequestBlock_struct;
105
106typedef union _MoreErrInfo_struct{
107 struct {
108 BYTE Reserved[3];
109 BYTE Type;
110 DWORD ErrorInfo;
111 } Common_Info;
112 struct{
113 BYTE Reserved[2];
114 BYTE offense_size; /* size of offending entry */
115 BYTE offense_num; /* byte # of offense 0-base */
116 DWORD offense_value;
117 } Invalid_Cmd;
118} MoreErrInfo_struct;
119typedef struct _ErrorInfo_struct {
120 BYTE ScsiStatus;
121 BYTE SenseLen;
122 HWORD CommandStatus;
123 DWORD ResidualCnt;
124 MoreErrInfo_struct MoreErrInfo;
125 BYTE SenseInfo[SENSEINFOBYTES];
126} ErrorInfo_struct;
127
128#pragma pack()
129
130#endif /* CCISS_DEFS_H */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index 986493f5b92b..84b6e2d0f44d 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 dfd7f187c351..8609d577bb66 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/cgroupstats.h b/include/linux/cgroupstats.h
deleted file mode 100644
index 3753c33160d1..000000000000
--- a/include/linux/cgroupstats.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/* cgroupstats.h - exporting per-cgroup statistics
2 *
3 * Copyright IBM Corporation, 2007
4 * Author Balbir Singh <balbir@linux.vnet.ibm.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15#ifndef _LINUX_CGROUPSTATS_H
16#define _LINUX_CGROUPSTATS_H
17
18#include <linux/types.h>
19#include <linux/taskstats.h>
20
21/*
22 * Data shared between user space and kernel space on a per cgroup
23 * basis. This data is shared using taskstats.
24 *
25 * Most of these states are derived by looking at the task->state value
26 * For the nr_io_wait state, a flag in the delay accounting structure
27 * indicates that the task is waiting on IO
28 *
29 * Each member is aligned to a 8 byte boundary.
30 */
31struct cgroupstats {
32 __u64 nr_sleeping; /* Number of tasks sleeping */
33 __u64 nr_running; /* Number of tasks running */
34 __u64 nr_stopped; /* Number of tasks in stopped state */
35 __u64 nr_uninterruptible; /* Number of tasks in uninterruptible */
36 /* state */
37 __u64 nr_io_wait; /* Number of tasks waiting on IO */
38};
39
40/*
41 * Commands sent from userspace
42 * Not versioned. New commands should only be inserted at the enum's end
43 * prior to __CGROUPSTATS_CMD_MAX
44 */
45
46enum {
47 CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */
48 CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */
49 CGROUPSTATS_CMD_NEW, /* kernel->user event */
50 __CGROUPSTATS_CMD_MAX,
51};
52
53#define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1)
54
55enum {
56 CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */
57 CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */
58 __CGROUPSTATS_TYPE_MAX,
59};
60
61#define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1)
62
63enum {
64 CGROUPSTATS_CMD_ATTR_UNSPEC = 0,
65 CGROUPSTATS_CMD_ATTR_FD,
66 __CGROUPSTATS_CMD_ATTR_MAX,
67};
68
69#define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1)
70
71#endif /* _LINUX_CGROUPSTATS_H */
diff --git a/include/linux/chio.h b/include/linux/chio.h
deleted file mode 100644
index d9bac7f97282..000000000000
--- a/include/linux/chio.h
+++ /dev/null
@@ -1,168 +0,0 @@
1/*
2 * ioctl interface for the scsi media changer driver
3 */
4
5/* changer element types */
6#define CHET_MT 0 /* media transport element (robot) */
7#define CHET_ST 1 /* storage element (media slots) */
8#define CHET_IE 2 /* import/export element */
9#define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */
10#define CHET_V1 4 /* vendor specific #1 */
11#define CHET_V2 5 /* vendor specific #2 */
12#define CHET_V3 6 /* vendor specific #3 */
13#define CHET_V4 7 /* vendor specific #4 */
14
15
16/*
17 * CHIOGPARAMS
18 * query changer properties
19 *
20 * CHIOVGPARAMS
21 * query vendor-specific element types
22 *
23 * accessing elements works by specifing type and unit of the element.
24 * for example, storage elements are addressed with type = CHET_ST and
25 * unit = 0 .. cp_nslots-1
26 *
27 */
28struct changer_params {
29 int cp_curpicker; /* current transport element */
30 int cp_npickers; /* number of transport elements (CHET_MT) */
31 int cp_nslots; /* number of storage elements (CHET_ST) */
32 int cp_nportals; /* number of import/export elements (CHET_IE) */
33 int cp_ndrives; /* number of data transfer elements (CHET_DT) */
34};
35struct changer_vendor_params {
36 int cvp_n1; /* number of vendor specific elems (CHET_V1) */
37 char cvp_label1[16];
38 int cvp_n2; /* number of vendor specific elems (CHET_V2) */
39 char cvp_label2[16];
40 int cvp_n3; /* number of vendor specific elems (CHET_V3) */
41 char cvp_label3[16];
42 int cvp_n4; /* number of vendor specific elems (CHET_V4) */
43 char cvp_label4[16];
44 int reserved[8];
45};
46
47
48/*
49 * CHIOMOVE
50 * move a medium from one element to another
51 */
52struct changer_move {
53 int cm_fromtype; /* type/unit of source element */
54 int cm_fromunit;
55 int cm_totype; /* type/unit of destination element */
56 int cm_tounit;
57 int cm_flags;
58};
59#define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */
60
61
62/*
63 * CHIOEXCHANGE
64 * move one medium from element #1 to element #2,
65 * and another one from element #2 to element #3.
66 * element #1 and #3 are allowed to be identical.
67 */
68struct changer_exchange {
69 int ce_srctype; /* type/unit of element #1 */
70 int ce_srcunit;
71 int ce_fdsttype; /* type/unit of element #2 */
72 int ce_fdstunit;
73 int ce_sdsttype; /* type/unit of element #3 */
74 int ce_sdstunit;
75 int ce_flags;
76};
77#define CE_INVERT1 1
78#define CE_INVERT2 2
79
80
81/*
82 * CHIOPOSITION
83 * move the transport element (robot arm) to a specific element.
84 */
85struct changer_position {
86 int cp_type;
87 int cp_unit;
88 int cp_flags;
89};
90#define CP_INVERT 1
91
92
93/*
94 * CHIOGSTATUS
95 * get element status for all elements of a specific type
96 */
97struct changer_element_status {
98 int ces_type;
99 unsigned char __user *ces_data;
100};
101#define CESTATUS_FULL 0x01 /* full */
102#define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */
103#define CESTATUS_EXCEPT 0x04 /* error condition */
104#define CESTATUS_ACCESS 0x08 /* access allowed */
105#define CESTATUS_EXENAB 0x10 /* element can export media */
106#define CESTATUS_INENAB 0x20 /* element can import media */
107
108
109/*
110 * CHIOGELEM
111 * get more detailed status information for a single element
112 */
113struct changer_get_element {
114 int cge_type; /* type/unit */
115 int cge_unit;
116 int cge_status; /* status */
117 int cge_errno; /* errno */
118 int cge_srctype; /* source element of the last move/exchange */
119 int cge_srcunit;
120 int cge_id; /* scsi id (for data transfer elements) */
121 int cge_lun; /* scsi lun (for data transfer elements) */
122 char cge_pvoltag[36]; /* primary volume tag */
123 char cge_avoltag[36]; /* alternate volume tag */
124 int cge_flags;
125};
126/* flags */
127#define CGE_ERRNO 0x01 /* errno available */
128#define CGE_INVERT 0x02 /* media inverted */
129#define CGE_SRC 0x04 /* media src available */
130#define CGE_IDLUN 0x08 /* ID+LUN available */
131#define CGE_PVOLTAG 0x10 /* primary volume tag available */
132#define CGE_AVOLTAG 0x20 /* alternate volume tag available */
133
134
135/*
136 * CHIOSVOLTAG
137 * set volume tag
138 */
139struct changer_set_voltag {
140 int csv_type; /* type/unit */
141 int csv_unit;
142 char csv_voltag[36]; /* volume tag */
143 int csv_flags;
144};
145#define CSV_PVOLTAG 0x01 /* primary volume tag */
146#define CSV_AVOLTAG 0x02 /* alternate volume tag */
147#define CSV_CLEARTAG 0x04 /* clear volume tag */
148
149/* ioctls */
150#define CHIOMOVE _IOW('c', 1,struct changer_move)
151#define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange)
152#define CHIOPOSITION _IOW('c', 3,struct changer_position)
153#define CHIOGPICKER _IOR('c', 4,int) /* not impl. */
154#define CHIOSPICKER _IOW('c', 5,int) /* not impl. */
155#define CHIOGPARAMS _IOR('c', 6,struct changer_params)
156#define CHIOGSTATUS _IOW('c', 8,struct changer_element_status)
157#define CHIOGELEM _IOW('c',16,struct changer_get_element)
158#define CHIOINITELEM _IO('c',17)
159#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
160#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
161
162/* ---------------------------------------------------------------------- */
163
164/*
165 * Local variables:
166 * c-basic-offset: 8
167 * End:
168 */
diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
index 3c4aac406175..88bee3a33090 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 d03612b196e1..2c1bc1ea04ee 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 96c87693800b..cff544f81105 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 72f2d2f0af91..8031d6eef102 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/coff.h b/include/linux/coff.h
deleted file mode 100644
index 6354a7fe22b2..000000000000
--- a/include/linux/coff.h
+++ /dev/null
@@ -1,351 +0,0 @@
1/* This file is derived from the GAS 2.1.4 assembler control file.
2 The GAS product is under the GNU General Public License, version 2 or later.
3 As such, this file is also under that license.
4
5 If the file format changes in the COFF object, this file should be
6 subsequently updated to reflect the changes.
7
8 The actual loader module only uses a few of these structures. The full
9 set is documented here because I received the full set. If you wish
10 more information about COFF, then O'Reilly has a very excellent book.
11*/
12
13#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
14#define E_FILNMLEN 14 /* Number of characters in a file name */
15#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */
16
17/*
18 * These defines are byte order independent. There is no alignment of fields
19 * permitted in the structures. Therefore they are declared as characters
20 * and the values loaded from the character positions. It also makes it
21 * nice to have it "endian" independent.
22 */
23
24/* Load a short int from the following tables with little-endian formats */
25#define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
26 ((unsigned short)((unsigned char)ps[0]))))
27
28/* Load a long int from the following tables with little-endian formats */
29#define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
30 ((unsigned long)((unsigned char)ps[2])<<16) |\
31 ((unsigned long)((unsigned char)ps[1])<<8) |\
32 ((unsigned long)((unsigned char)ps[0])))))
33
34/* Load a short int from the following tables with big-endian formats */
35#define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
36 ((unsigned short)((unsigned char)ps[1]))))
37
38/* Load a long int from the following tables with big-endian formats */
39#define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
40 ((unsigned long)((unsigned char)ps[1])<<16) |\
41 ((unsigned long)((unsigned char)ps[2])<<8) |\
42 ((unsigned long)((unsigned char)ps[3])))))
43
44/* These may be overridden later by brain dead implementations which generate
45 a big-endian header with little-endian data. In that case, generate a
46 replacement macro which tests a flag and uses either of the two above
47 as appropriate. */
48
49#define COFF_LONG(v) COFF_LONG_L(v)
50#define COFF_SHORT(v) COFF_SHORT_L(v)
51
52/*** coff information for Intel 386/486. */
53
54/********************** FILE HEADER **********************/
55
56struct COFF_filehdr {
57 char f_magic[2]; /* magic number */
58 char f_nscns[2]; /* number of sections */
59 char f_timdat[4]; /* time & date stamp */
60 char f_symptr[4]; /* file pointer to symtab */
61 char f_nsyms[4]; /* number of symtab entries */
62 char f_opthdr[2]; /* sizeof(optional hdr) */
63 char f_flags[2]; /* flags */
64};
65
66/*
67 * Bits for f_flags:
68 *
69 * F_RELFLG relocation info stripped from file
70 * F_EXEC file is executable (i.e. no unresolved external
71 * references)
72 * F_LNNO line numbers stripped from file
73 * F_LSYMS local symbols stripped from file
74 * F_MINMAL this is a minimal object file (".m") output of fextract
75 * F_UPDATE this is a fully bound update file, output of ogen
76 * F_SWABD this file has had its bytes swabbed (in names)
77 * F_AR16WR this file has the byte ordering of an AR16WR
78 * (e.g. 11/70) machine
79 * F_AR32WR this file has the byte ordering of an AR32WR machine
80 * (e.g. vax and iNTEL 386)
81 * F_AR32W this file has the byte ordering of an AR32W machine
82 * (e.g. 3b,maxi)
83 * F_PATCH file contains "patch" list in optional header
84 * F_NODF (minimal file only) no decision functions for
85 * replaced functions
86 */
87
88#define COFF_F_RELFLG 0000001
89#define COFF_F_EXEC 0000002
90#define COFF_F_LNNO 0000004
91#define COFF_F_LSYMS 0000010
92#define COFF_F_MINMAL 0000020
93#define COFF_F_UPDATE 0000040
94#define COFF_F_SWABD 0000100
95#define COFF_F_AR16WR 0000200
96#define COFF_F_AR32WR 0000400
97#define COFF_F_AR32W 0001000
98#define COFF_F_PATCH 0002000
99#define COFF_F_NODF 0002000
100
101#define COFF_I386MAGIC 0x14c /* Linux's system */
102
103#if 0 /* Perhaps, someday, these formats may be used. */
104#define COFF_I386PTXMAGIC 0x154
105#define COFF_I386AIXMAGIC 0x175 /* IBM's AIX system */
106#define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
107 && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
108 && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
109#else
110#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
111#endif
112
113#define COFF_FILHDR struct COFF_filehdr
114#define COFF_FILHSZ sizeof(COFF_FILHDR)
115
116/********************** AOUT "OPTIONAL HEADER" **********************/
117
118/* Linux COFF must have this "optional" header. Standard COFF has no entry
119 location for the "entry" point. They normally would start with the first
120 location of the .text section. This is not a good idea for linux. So,
121 the use of this "optional" header is not optional. It is required.
122
123 Do not be tempted to assume that the size of the optional header is
124 a constant and simply index the next byte by the size of this structure.
125 Use the 'f_opthdr' field in the main coff header for the size of the
126 structure actually written to the file!!
127*/
128
129typedef struct
130{
131 char magic[2]; /* type of file */
132 char vstamp[2]; /* version stamp */
133 char tsize[4]; /* text size in bytes, padded to FW bdry */
134 char dsize[4]; /* initialized data " " */
135 char bsize[4]; /* uninitialized data " " */
136 char entry[4]; /* entry pt. */
137 char text_start[4]; /* base of text used for this file */
138 char data_start[4]; /* base of data used for this file */
139}
140COFF_AOUTHDR;
141
142#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
143
144#define COFF_STMAGIC 0401
145#define COFF_OMAGIC 0404
146#define COFF_JMAGIC 0407 /* dirty text and data image, can't share */
147#define COFF_DMAGIC 0410 /* dirty text segment, data aligned */
148#define COFF_ZMAGIC 0413 /* The proper magic number for executables */
149#define COFF_SHMAGIC 0443 /* shared library header */
150
151/********************** SECTION HEADER **********************/
152
153struct COFF_scnhdr {
154 char s_name[8]; /* section name */
155 char s_paddr[4]; /* physical address, aliased s_nlib */
156 char s_vaddr[4]; /* virtual address */
157 char s_size[4]; /* section size */
158 char s_scnptr[4]; /* file ptr to raw data for section */
159 char s_relptr[4]; /* file ptr to relocation */
160 char s_lnnoptr[4]; /* file ptr to line numbers */
161 char s_nreloc[2]; /* number of relocation entries */
162 char s_nlnno[2]; /* number of line number entries */
163 char s_flags[4]; /* flags */
164};
165
166#define COFF_SCNHDR struct COFF_scnhdr
167#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
168
169/*
170 * names of "special" sections
171 */
172
173#define COFF_TEXT ".text"
174#define COFF_DATA ".data"
175#define COFF_BSS ".bss"
176#define COFF_COMMENT ".comment"
177#define COFF_LIB ".lib"
178
179#define COFF_SECT_TEXT 0 /* Section for instruction code */
180#define COFF_SECT_DATA 1 /* Section for initialized globals */
181#define COFF_SECT_BSS 2 /* Section for un-initialized globals */
182#define COFF_SECT_REQD 3 /* Minimum number of sections for good file */
183
184#define COFF_STYP_REG 0x00 /* regular segment */
185#define COFF_STYP_DSECT 0x01 /* dummy segment */
186#define COFF_STYP_NOLOAD 0x02 /* no-load segment */
187#define COFF_STYP_GROUP 0x04 /* group segment */
188#define COFF_STYP_PAD 0x08 /* .pad segment */
189#define COFF_STYP_COPY 0x10 /* copy section */
190#define COFF_STYP_TEXT 0x20 /* .text segment */
191#define COFF_STYP_DATA 0x40 /* .data segment */
192#define COFF_STYP_BSS 0x80 /* .bss segment */
193#define COFF_STYP_INFO 0x200 /* .comment section */
194#define COFF_STYP_OVER 0x400 /* overlay section */
195#define COFF_STYP_LIB 0x800 /* library section */
196
197/*
198 * Shared libraries have the following section header in the data field for
199 * each library.
200 */
201
202struct COFF_slib {
203 char sl_entsz[4]; /* Size of this entry */
204 char sl_pathndx[4]; /* size of the header field */
205};
206
207#define COFF_SLIBHD struct COFF_slib
208#define COFF_SLIBSZ sizeof(COFF_SLIBHD)
209
210/********************** LINE NUMBERS **********************/
211
212/* 1 line number entry for every "breakpointable" source line in a section.
213 * Line numbers are grouped on a per function basis; first entry in a function
214 * grouping will have l_lnno = 0 and in place of physical address will be the
215 * symbol table index of the function name.
216 */
217
218struct COFF_lineno {
219 union {
220 char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
221 char l_paddr[4]; /* (physical) address of line number */
222 } l_addr;
223 char l_lnno[2]; /* line number */
224};
225
226#define COFF_LINENO struct COFF_lineno
227#define COFF_LINESZ 6
228
229/********************** SYMBOLS **********************/
230
231#define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */
232#define COFF_E_FILNMLEN 14 /* # characters in a file name */
233#define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry */
234
235/*
236 * All symbols and sections have the following definition
237 */
238
239struct COFF_syment
240{
241 union {
242 char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */
243 struct {
244 char e_zeroes[4]; /* Leading zeros */
245 char e_offset[4]; /* Offset if this is a header section */
246 } e;
247 } e;
248
249 char e_value[4]; /* Value (address) of the segment */
250 char e_scnum[2]; /* Section number */
251 char e_type[2]; /* Type of section */
252 char e_sclass[1]; /* Loader class */
253 char e_numaux[1]; /* Number of auxiliary entries which follow */
254};
255
256#define COFF_N_BTMASK (0xf) /* Mask for important class bits */
257#define COFF_N_TMASK (0x30) /* Mask for important type bits */
258#define COFF_N_BTSHFT (4) /* # bits to shift class field */
259#define COFF_N_TSHIFT (2) /* # bits to shift type field */
260
261/*
262 * Auxiliary entries because the main table is too limiting.
263 */
264
265union COFF_auxent {
266
267/*
268 * Debugger information
269 */
270
271 struct {
272 char x_tagndx[4]; /* str, un, or enum tag indx */
273 union {
274 struct {
275 char x_lnno[2]; /* declaration line number */
276 char x_size[2]; /* str/union/array size */
277 } x_lnsz;
278 char x_fsize[4]; /* size of function */
279 } x_misc;
280
281 union {
282 struct { /* if ISFCN, tag, or .bb */
283 char x_lnnoptr[4]; /* ptr to fcn line # */
284 char x_endndx[4]; /* entry ndx past block end */
285 } x_fcn;
286
287 struct { /* if ISARY, up to 4 dimen. */
288 char x_dimen[E_DIMNUM][2];
289 } x_ary;
290 } x_fcnary;
291
292 char x_tvndx[2]; /* tv index */
293 } x_sym;
294
295/*
296 * Source file names (debugger information)
297 */
298
299 union {
300 char x_fname[E_FILNMLEN];
301 struct {
302 char x_zeroes[4];
303 char x_offset[4];
304 } x_n;
305 } x_file;
306
307/*
308 * Section information
309 */
310
311 struct {
312 char x_scnlen[4]; /* section length */
313 char x_nreloc[2]; /* # relocation entries */
314 char x_nlinno[2]; /* # line numbers */
315 } x_scn;
316
317/*
318 * Transfer vector (branch table)
319 */
320
321 struct {
322 char x_tvfill[4]; /* tv fill value */
323 char x_tvlen[2]; /* length of .tv */
324 char x_tvran[2][2]; /* tv range */
325 } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
326};
327
328#define COFF_SYMENT struct COFF_syment
329#define COFF_SYMESZ 18
330#define COFF_AUXENT union COFF_auxent
331#define COFF_AUXESZ 18
332
333#define COFF_ETEXT "etext"
334
335/********************** RELOCATION DIRECTIVES **********************/
336
337struct COFF_reloc {
338 char r_vaddr[4]; /* Virtual address of item */
339 char r_symndx[4]; /* Symbol index in the symtab */
340 char r_type[2]; /* Relocation type */
341};
342
343#define COFF_RELOC struct COFF_reloc
344#define COFF_RELSZ 10
345
346#define COFF_DEF_DATA_SECTION_ALIGNMENT 4
347#define COFF_DEF_BSS_SECTION_ALIGNMENT 4
348#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4
349
350/* For new sections we haven't heard of before */
351#define COFF_DEF_SECTION_ALIGNMENT 4
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 76384074262d..b2b5a41b6a24 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/const.h b/include/linux/const.h
deleted file mode 100644
index c22c707c455d..000000000000
--- a/include/linux/const.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* const.h: Macros for dealing with constants. */
2
3#ifndef _LINUX_CONST_H
4#define _LINUX_CONST_H
5
6/* Some constant macros are used in both assembler and
7 * C code. Therefore we cannot annotate them always with
8 * 'UL' and other type specifiers unilaterally. We
9 * use the following macros to deal with this.
10 *
11 * Similarly, _AT() will cast an expression with a type in C, but
12 * leave it unchanged in asm.
13 */
14
15#ifdef __ASSEMBLY__
16#define _AC(X,Y) X
17#define _AT(T,X) X
18#else
19#define __AC(X,Y) (X##Y)
20#define _AC(X,Y) __AC(X,Y)
21#define _AT(T,X) ((T)(X))
22#endif
23
24#endif /* !(_LINUX_CONST_H) */
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index 0e7bf272ec2f..133789609f23 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 9f9865ff781e..b72332823807 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 a5049eaf782d..19ae518f5471 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/cycx_cfm.h b/include/linux/cycx_cfm.h
deleted file mode 100644
index 032d26ed8384..000000000000
--- a/include/linux/cycx_cfm.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2* cycx_cfm.h Cyclom 2X WAN Link Driver.
3* Definitions for the Cyclom 2X Firmware Module (CFM).
4*
5* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
6*
7* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
8*
9* Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
10*
11* This program is free software; you can redistribute it and/or
12* modify it under the terms of the GNU General Public License
13* as published by the Free Software Foundation; either version
14* 2 of the License, or (at your option) any later version.
15* ============================================================================
16* 1998/08/08 acme Initial version.
17*/
18#ifndef _CYCX_CFM_H
19#define _CYCX_CFM_H
20
21/* Defines */
22
23#define CFM_VERSION 2
24#define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module"
25
26/* min/max */
27#define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */
28#define CFM_DESCR_LEN 256 /* max length of description string */
29#define CFM_MAX_CYCX 1 /* max number of compatible adapters */
30#define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */
31
32/* Firmware Commands */
33#define GEN_POWER_ON 0x1280
34
35#define GEN_SET_SEG 0x1401 /* boot segment setting. */
36#define GEN_BOOT_DAT 0x1402 /* boot data. */
37#define GEN_START 0x1403 /* board start. */
38#define GEN_DEFPAR 0x1404 /* buffer length for boot. */
39
40/* Adapter Types */
41#define CYCX_2X 2
42/* for now only the 2X is supported, no plans to support 8X or 16X */
43#define CYCX_8X 8
44#define CYCX_16X 16
45
46#define CFID_X25_2X 5200
47
48/**
49 * struct cycx_fw_info - firmware module information.
50 * @codeid - firmware ID
51 * @version - firmware version number
52 * @adapter - compatible adapter types
53 * @memsize - minimum memory size
54 * @reserved - reserved
55 * @startoffs - entry point offset
56 * @winoffs - dual-port memory window offset
57 * @codeoffs - code load offset
58 * @codesize - code size
59 * @dataoffs - configuration data load offset
60 * @datasize - configuration data size
61 */
62struct cycx_fw_info {
63 unsigned short codeid;
64 unsigned short version;
65 unsigned short adapter[CFM_MAX_CYCX];
66 unsigned long memsize;
67 unsigned short reserved[2];
68 unsigned short startoffs;
69 unsigned short winoffs;
70 unsigned short codeoffs;
71 unsigned long codesize;
72 unsigned short dataoffs;
73 unsigned long datasize;
74};
75
76/**
77 * struct cycx_firmware - CYCX firmware file structure
78 * @signature - CFM file signature
79 * @version - file format version
80 * @checksum - info + image
81 * @reserved - reserved
82 * @descr - description string
83 * @info - firmware module info
84 * @image - code image (variable size)
85 */
86struct cycx_firmware {
87 char signature[80];
88 unsigned short version;
89 unsigned short checksum;
90 unsigned short reserved[6];
91 char descr[CFM_DESCR_LEN];
92 struct cycx_fw_info info;
93 unsigned char image[0];
94};
95
96struct cycx_fw_header {
97 unsigned long reset_size;
98 unsigned long data_size;
99 unsigned long code_size;
100};
101#endif /* _CYCX_CFM_H */
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
deleted file mode 100644
index 6bb43382f3f3..000000000000
--- a/include/linux/dcbnl.h
+++ /dev/null
@@ -1,684 +0,0 @@
1/*
2 * Copyright (c) 2008-2011, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Author: Lucy Liu <lucy.liu@intel.com>
18 */
19
20#ifndef __LINUX_DCBNL_H__
21#define __LINUX_DCBNL_H__
22
23#include <linux/types.h>
24
25/* IEEE 802.1Qaz std supported values */
26#define IEEE_8021QAZ_MAX_TCS 8
27
28#define IEEE_8021QAZ_TSA_STRICT 0
29#define IEEE_8021QAZ_TSA_CB_SHAPER 1
30#define IEEE_8021QAZ_TSA_ETS 2
31#define IEEE_8021QAZ_TSA_VENDOR 255
32
33/* This structure contains the IEEE 802.1Qaz ETS managed object
34 *
35 * @willing: willing bit in ETS configuration TLV
36 * @ets_cap: indicates supported capacity of ets feature
37 * @cbs: credit based shaper ets algorithm supported
38 * @tc_tx_bw: tc tx bandwidth indexed by traffic class
39 * @tc_rx_bw: tc rx bandwidth indexed by traffic class
40 * @tc_tsa: TSA Assignment table, indexed by traffic class
41 * @prio_tc: priority assignment table mapping 8021Qp to traffic class
42 * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
43 * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
44 * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
45 *
46 * Recommended values are used to set fields in the ETS recommendation TLV
47 * with hardware offloaded LLDP.
48 *
49 * ----
50 * TSA Assignment 8 bit identifiers
51 * 0 strict priority
52 * 1 credit-based shaper
53 * 2 enhanced transmission selection
54 * 3-254 reserved
55 * 255 vendor specific
56 */
57struct ieee_ets {
58 __u8 willing;
59 __u8 ets_cap;
60 __u8 cbs;
61 __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
62 __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
63 __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
64 __u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
65 __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
66 __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
67 __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
68};
69
70/* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
71 * managed object.
72 * Values are 64 bits long and specified in Kbps to enable usage over both
73 * slow and very fast networks.
74 *
75 * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
76 */
77struct ieee_maxrate {
78 __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
79};
80
81/* This structure contains the IEEE 802.1Qaz PFC managed object
82 *
83 * @pfc_cap: Indicates the number of traffic classes on the local device
84 * that may simultaneously have PFC enabled.
85 * @pfc_en: bitmap indicating pfc enabled traffic classes
86 * @mbc: enable macsec bypass capability
87 * @delay: the allowance made for a round-trip propagation delay of the
88 * link in bits.
89 * @requests: count of the sent pfc frames
90 * @indications: count of the received pfc frames
91 */
92struct ieee_pfc {
93 __u8 pfc_cap;
94 __u8 pfc_en;
95 __u8 mbc;
96 __u16 delay;
97 __u64 requests[IEEE_8021QAZ_MAX_TCS];
98 __u64 indications[IEEE_8021QAZ_MAX_TCS];
99};
100
101/* CEE DCBX std supported values */
102#define CEE_DCBX_MAX_PGS 8
103#define CEE_DCBX_MAX_PRIO 8
104
105/**
106 * struct cee_pg - CEE Priority-Group managed object
107 *
108 * @willing: willing bit in the PG tlv
109 * @error: error bit in the PG tlv
110 * @pg_en: enable bit of the PG feature
111 * @tcs_supported: number of traffic classes supported
112 * @pg_bw: bandwidth percentage for each priority group
113 * @prio_pg: priority to PG mapping indexed by priority
114 */
115struct cee_pg {
116 __u8 willing;
117 __u8 error;
118 __u8 pg_en;
119 __u8 tcs_supported;
120 __u8 pg_bw[CEE_DCBX_MAX_PGS];
121 __u8 prio_pg[CEE_DCBX_MAX_PGS];
122};
123
124/**
125 * struct cee_pfc - CEE PFC managed object
126 *
127 * @willing: willing bit in the PFC tlv
128 * @error: error bit in the PFC tlv
129 * @pfc_en: bitmap indicating pfc enabled traffic classes
130 * @tcs_supported: number of traffic classes supported
131 */
132struct cee_pfc {
133 __u8 willing;
134 __u8 error;
135 __u8 pfc_en;
136 __u8 tcs_supported;
137};
138
139/* IEEE 802.1Qaz std supported values */
140#define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
141#define IEEE_8021QAZ_APP_SEL_STREAM 2
142#define IEEE_8021QAZ_APP_SEL_DGRAM 3
143#define IEEE_8021QAZ_APP_SEL_ANY 4
144
145/* This structure contains the IEEE 802.1Qaz APP managed object. This
146 * object is also used for the CEE std as well. There is no difference
147 * between the objects.
148 *
149 * @selector: protocol identifier type
150 * @protocol: protocol of type indicated
151 * @priority: 3-bit unsigned integer indicating priority
152 *
153 * ----
154 * Selector field values
155 * 0 Reserved
156 * 1 Ethertype
157 * 2 Well known port number over TCP or SCTP
158 * 3 Well known port number over UDP or DCCP
159 * 4 Well known port number over TCP, SCTP, UDP, or DCCP
160 * 5-7 Reserved
161 */
162struct dcb_app {
163 __u8 selector;
164 __u8 priority;
165 __u16 protocol;
166};
167
168/**
169 * struct dcb_peer_app_info - APP feature information sent by the peer
170 *
171 * @willing: willing bit in the peer APP tlv
172 * @error: error bit in the peer APP tlv
173 *
174 * In addition to this information the full peer APP tlv also contains
175 * a table of 'app_count' APP objects defined above.
176 */
177struct dcb_peer_app_info {
178 __u8 willing;
179 __u8 error;
180};
181
182struct dcbmsg {
183 __u8 dcb_family;
184 __u8 cmd;
185 __u16 dcb_pad;
186};
187
188/**
189 * enum dcbnl_commands - supported DCB commands
190 *
191 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
192 * @DCB_CMD_GSTATE: request the state of DCB in the device
193 * @DCB_CMD_SSTATE: set the state of DCB in the device
194 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
195 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
196 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
197 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
198 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
199 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
200 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
201 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
202 * device. Only useful when using bonding.
203 * @DCB_CMD_GCAP: request the DCB capabilities of the device
204 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
205 * @DCB_CMD_SNUMTCS: set the number of traffic classes
206 * @DCB_CMD_GBCN: set backward congestion notification configuration
207 * @DCB_CMD_SBCN: get backward congestion notification configration.
208 * @DCB_CMD_GAPP: get application protocol configuration
209 * @DCB_CMD_SAPP: set application protocol configuration
210 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
211 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
212 * @DCB_CMD_GDCBX: get DCBX engine configuration
213 * @DCB_CMD_SDCBX: set DCBX engine configuration
214 * @DCB_CMD_GFEATCFG: get DCBX features flags
215 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
216 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
217 * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
218 */
219enum dcbnl_commands {
220 DCB_CMD_UNDEFINED,
221
222 DCB_CMD_GSTATE,
223 DCB_CMD_SSTATE,
224
225 DCB_CMD_PGTX_GCFG,
226 DCB_CMD_PGTX_SCFG,
227 DCB_CMD_PGRX_GCFG,
228 DCB_CMD_PGRX_SCFG,
229
230 DCB_CMD_PFC_GCFG,
231 DCB_CMD_PFC_SCFG,
232
233 DCB_CMD_SET_ALL,
234
235 DCB_CMD_GPERM_HWADDR,
236
237 DCB_CMD_GCAP,
238
239 DCB_CMD_GNUMTCS,
240 DCB_CMD_SNUMTCS,
241
242 DCB_CMD_PFC_GSTATE,
243 DCB_CMD_PFC_SSTATE,
244
245 DCB_CMD_BCN_GCFG,
246 DCB_CMD_BCN_SCFG,
247
248 DCB_CMD_GAPP,
249 DCB_CMD_SAPP,
250
251 DCB_CMD_IEEE_SET,
252 DCB_CMD_IEEE_GET,
253
254 DCB_CMD_GDCBX,
255 DCB_CMD_SDCBX,
256
257 DCB_CMD_GFEATCFG,
258 DCB_CMD_SFEATCFG,
259
260 DCB_CMD_CEE_GET,
261 DCB_CMD_IEEE_DEL,
262
263 __DCB_CMD_ENUM_MAX,
264 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
265};
266
267/**
268 * enum dcbnl_attrs - DCB top-level netlink attributes
269 *
270 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
271 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
272 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
273 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
274 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
275 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
276 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
277 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
278 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
279 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
280 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
281 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
282 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
283 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
284 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
285 * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
286 */
287enum dcbnl_attrs {
288 DCB_ATTR_UNDEFINED,
289
290 DCB_ATTR_IFNAME,
291 DCB_ATTR_STATE,
292 DCB_ATTR_PFC_STATE,
293 DCB_ATTR_PFC_CFG,
294 DCB_ATTR_NUM_TC,
295 DCB_ATTR_PG_CFG,
296 DCB_ATTR_SET_ALL,
297 DCB_ATTR_PERM_HWADDR,
298 DCB_ATTR_CAP,
299 DCB_ATTR_NUMTCS,
300 DCB_ATTR_BCN,
301 DCB_ATTR_APP,
302
303 /* IEEE std attributes */
304 DCB_ATTR_IEEE,
305
306 DCB_ATTR_DCBX,
307 DCB_ATTR_FEATCFG,
308
309 /* CEE nested attributes */
310 DCB_ATTR_CEE,
311
312 __DCB_ATTR_ENUM_MAX,
313 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
314};
315
316/**
317 * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
318 *
319 * @DCB_ATTR_IEEE_UNSPEC: unspecified
320 * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
321 * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
322 * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
323 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
324 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
325 * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
326 */
327enum ieee_attrs {
328 DCB_ATTR_IEEE_UNSPEC,
329 DCB_ATTR_IEEE_ETS,
330 DCB_ATTR_IEEE_PFC,
331 DCB_ATTR_IEEE_APP_TABLE,
332 DCB_ATTR_IEEE_PEER_ETS,
333 DCB_ATTR_IEEE_PEER_PFC,
334 DCB_ATTR_IEEE_PEER_APP,
335 DCB_ATTR_IEEE_MAXRATE,
336 __DCB_ATTR_IEEE_MAX
337};
338#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
339
340enum ieee_attrs_app {
341 DCB_ATTR_IEEE_APP_UNSPEC,
342 DCB_ATTR_IEEE_APP,
343 __DCB_ATTR_IEEE_APP_MAX
344};
345#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
346
347/**
348 * enum cee_attrs - CEE DCBX get attributes.
349 *
350 * @DCB_ATTR_CEE_UNSPEC: unspecified
351 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
352 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
353 * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
354 * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
355 * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
356 * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
357 * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
358 * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
359 *
360 * An aggregated collection of the cee std negotiated parameters.
361 */
362enum cee_attrs {
363 DCB_ATTR_CEE_UNSPEC,
364 DCB_ATTR_CEE_PEER_PG,
365 DCB_ATTR_CEE_PEER_PFC,
366 DCB_ATTR_CEE_PEER_APP_TABLE,
367 DCB_ATTR_CEE_TX_PG,
368 DCB_ATTR_CEE_RX_PG,
369 DCB_ATTR_CEE_PFC,
370 DCB_ATTR_CEE_APP_TABLE,
371 DCB_ATTR_CEE_FEAT,
372 __DCB_ATTR_CEE_MAX
373};
374#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
375
376enum peer_app_attr {
377 DCB_ATTR_CEE_PEER_APP_UNSPEC,
378 DCB_ATTR_CEE_PEER_APP_INFO,
379 DCB_ATTR_CEE_PEER_APP,
380 __DCB_ATTR_CEE_PEER_APP_MAX
381};
382#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
383
384enum cee_attrs_app {
385 DCB_ATTR_CEE_APP_UNSPEC,
386 DCB_ATTR_CEE_APP,
387 __DCB_ATTR_CEE_APP_MAX
388};
389#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
390
391/**
392 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
393 *
394 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
395 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
396 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
397 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
398 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
399 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
400 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
401 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
402 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
403 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
404 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
405 *
406 */
407enum dcbnl_pfc_up_attrs {
408 DCB_PFC_UP_ATTR_UNDEFINED,
409
410 DCB_PFC_UP_ATTR_0,
411 DCB_PFC_UP_ATTR_1,
412 DCB_PFC_UP_ATTR_2,
413 DCB_PFC_UP_ATTR_3,
414 DCB_PFC_UP_ATTR_4,
415 DCB_PFC_UP_ATTR_5,
416 DCB_PFC_UP_ATTR_6,
417 DCB_PFC_UP_ATTR_7,
418 DCB_PFC_UP_ATTR_ALL,
419
420 __DCB_PFC_UP_ATTR_ENUM_MAX,
421 DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
422};
423
424/**
425 * enum dcbnl_pg_attrs - DCB Priority Group attributes
426 *
427 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
428 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
429 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
430 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
431 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
432 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
433 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
434 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
435 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
436 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
437 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
438 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
439 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
440 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
441 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
442 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
443 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
444 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
445 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
446 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
447 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
448 *
449 */
450enum dcbnl_pg_attrs {
451 DCB_PG_ATTR_UNDEFINED,
452
453 DCB_PG_ATTR_TC_0,
454 DCB_PG_ATTR_TC_1,
455 DCB_PG_ATTR_TC_2,
456 DCB_PG_ATTR_TC_3,
457 DCB_PG_ATTR_TC_4,
458 DCB_PG_ATTR_TC_5,
459 DCB_PG_ATTR_TC_6,
460 DCB_PG_ATTR_TC_7,
461 DCB_PG_ATTR_TC_MAX,
462 DCB_PG_ATTR_TC_ALL,
463
464 DCB_PG_ATTR_BW_ID_0,
465 DCB_PG_ATTR_BW_ID_1,
466 DCB_PG_ATTR_BW_ID_2,
467 DCB_PG_ATTR_BW_ID_3,
468 DCB_PG_ATTR_BW_ID_4,
469 DCB_PG_ATTR_BW_ID_5,
470 DCB_PG_ATTR_BW_ID_6,
471 DCB_PG_ATTR_BW_ID_7,
472 DCB_PG_ATTR_BW_ID_MAX,
473 DCB_PG_ATTR_BW_ID_ALL,
474
475 __DCB_PG_ATTR_ENUM_MAX,
476 DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
477};
478
479/**
480 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
481 *
482 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
483 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
484 * Valid values are: 0-7
485 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
486 * Some devices may not support changing the
487 * user priority map of a TC.
488 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
489 * 0 - none
490 * 1 - group strict
491 * 2 - link strict
492 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
493 * not configured to use link strict priority,
494 * this is the percentage of bandwidth of the
495 * priority group this traffic class belongs to
496 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
497 *
498 */
499enum dcbnl_tc_attrs {
500 DCB_TC_ATTR_PARAM_UNDEFINED,
501
502 DCB_TC_ATTR_PARAM_PGID,
503 DCB_TC_ATTR_PARAM_UP_MAPPING,
504 DCB_TC_ATTR_PARAM_STRICT_PRIO,
505 DCB_TC_ATTR_PARAM_BW_PCT,
506 DCB_TC_ATTR_PARAM_ALL,
507
508 __DCB_TC_ATTR_PARAM_ENUM_MAX,
509 DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
510};
511
512/**
513 * enum dcbnl_cap_attrs - DCB Capability attributes
514 *
515 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
516 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
517 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
518 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
519 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
520 * traffic class mapping
521 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
522 * number of traffic classes the device
523 * can be configured to use for Priority Groups
524 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
525 * number of traffic classes the device can be
526 * configured to use for Priority Flow Control
527 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
528 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
529 * Notification
530 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
531 *
532 */
533enum dcbnl_cap_attrs {
534 DCB_CAP_ATTR_UNDEFINED,
535 DCB_CAP_ATTR_ALL,
536 DCB_CAP_ATTR_PG,
537 DCB_CAP_ATTR_PFC,
538 DCB_CAP_ATTR_UP2TC,
539 DCB_CAP_ATTR_PG_TCS,
540 DCB_CAP_ATTR_PFC_TCS,
541 DCB_CAP_ATTR_GSP,
542 DCB_CAP_ATTR_BCN,
543 DCB_CAP_ATTR_DCBX,
544
545 __DCB_CAP_ATTR_ENUM_MAX,
546 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
547};
548
549/**
550 * DCBX capability flags
551 *
552 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
553 * 'set' routines are used to configure the device with
554 * the negotiated parameters
555 *
556 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
557 * by another entity
558 * 'get' routines are used to retrieve the
559 * negotiated parameters
560 * 'set' routines can be used to set the initial
561 * negotiation configuration
562 *
563 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
564 * supports the CEE protocol flavor
565 *
566 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
567 * supports the IEEE protocol flavor
568 *
569 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
570 * supports static configuration (i.e no actual
571 * negotiation is performed negotiated parameters equal
572 * the initial configuration)
573 *
574 */
575#define DCB_CAP_DCBX_HOST 0x01
576#define DCB_CAP_DCBX_LLD_MANAGED 0x02
577#define DCB_CAP_DCBX_VER_CEE 0x04
578#define DCB_CAP_DCBX_VER_IEEE 0x08
579#define DCB_CAP_DCBX_STATIC 0x10
580
581/**
582 * enum dcbnl_numtcs_attrs - number of traffic classes
583 *
584 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
585 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
586 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
587 * priority groups
588 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
589 * support priority flow control
590 */
591enum dcbnl_numtcs_attrs {
592 DCB_NUMTCS_ATTR_UNDEFINED,
593 DCB_NUMTCS_ATTR_ALL,
594 DCB_NUMTCS_ATTR_PG,
595 DCB_NUMTCS_ATTR_PFC,
596
597 __DCB_NUMTCS_ATTR_ENUM_MAX,
598 DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
599};
600
601enum dcbnl_bcn_attrs{
602 DCB_BCN_ATTR_UNDEFINED = 0,
603
604 DCB_BCN_ATTR_RP_0,
605 DCB_BCN_ATTR_RP_1,
606 DCB_BCN_ATTR_RP_2,
607 DCB_BCN_ATTR_RP_3,
608 DCB_BCN_ATTR_RP_4,
609 DCB_BCN_ATTR_RP_5,
610 DCB_BCN_ATTR_RP_6,
611 DCB_BCN_ATTR_RP_7,
612 DCB_BCN_ATTR_RP_ALL,
613
614 DCB_BCN_ATTR_BCNA_0,
615 DCB_BCN_ATTR_BCNA_1,
616 DCB_BCN_ATTR_ALPHA,
617 DCB_BCN_ATTR_BETA,
618 DCB_BCN_ATTR_GD,
619 DCB_BCN_ATTR_GI,
620 DCB_BCN_ATTR_TMAX,
621 DCB_BCN_ATTR_TD,
622 DCB_BCN_ATTR_RMIN,
623 DCB_BCN_ATTR_W,
624 DCB_BCN_ATTR_RD,
625 DCB_BCN_ATTR_RU,
626 DCB_BCN_ATTR_WRTT,
627 DCB_BCN_ATTR_RI,
628 DCB_BCN_ATTR_C,
629 DCB_BCN_ATTR_ALL,
630
631 __DCB_BCN_ATTR_ENUM_MAX,
632 DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
633};
634
635/**
636 * enum dcb_general_attr_values - general DCB attribute values
637 *
638 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
639 *
640 */
641enum dcb_general_attr_values {
642 DCB_ATTR_VALUE_UNDEFINED = 0xff
643};
644
645#define DCB_APP_IDTYPE_ETHTYPE 0x00
646#define DCB_APP_IDTYPE_PORTNUM 0x01
647enum dcbnl_app_attrs {
648 DCB_APP_ATTR_UNDEFINED,
649
650 DCB_APP_ATTR_IDTYPE,
651 DCB_APP_ATTR_ID,
652 DCB_APP_ATTR_PRIORITY,
653
654 __DCB_APP_ATTR_ENUM_MAX,
655 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
656};
657
658/**
659 * enum dcbnl_featcfg_attrs - features conifiguration flags
660 *
661 * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
662 * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
663 * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
664 * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
665 * flow control
666 * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
667 *
668 */
669#define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
670#define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
671#define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
672#define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
673enum dcbnl_featcfg_attrs {
674 DCB_FEATCFG_ATTR_UNDEFINED,
675 DCB_FEATCFG_ATTR_ALL,
676 DCB_FEATCFG_ATTR_PG,
677 DCB_FEATCFG_ATTR_PFC,
678 DCB_FEATCFG_ATTR_APP,
679
680 __DCB_FEATCFG_ATTR_ENUM_MAX,
681 DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
682};
683
684#endif /* __LINUX_DCBNL_H__ */
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index d16294e2a118..439ff698000a 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 520152411cd1..1d47dcce11e1 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_device.h b/include/linux/dlm_device.h
deleted file mode 100644
index 3060783c4191..000000000000
--- a/include/linux/dlm_device.h
+++ /dev/null
@@ -1,108 +0,0 @@
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2007 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 _LINUX_DLM_DEVICE_H
15#define _LINUX_DLM_DEVICE_H
16
17/* This is the device interface for dlm, most users will use a library
18 * interface.
19 */
20
21#include <linux/dlm.h>
22#include <linux/types.h>
23
24#define DLM_USER_LVB_LEN 32
25
26/* Version of the device interface */
27#define DLM_DEVICE_VERSION_MAJOR 6
28#define DLM_DEVICE_VERSION_MINOR 0
29#define DLM_DEVICE_VERSION_PATCH 1
30
31/* struct passed to the lock write */
32struct dlm_lock_params {
33 __u8 mode;
34 __u8 namelen;
35 __u16 unused;
36 __u32 flags;
37 __u32 lkid;
38 __u32 parent;
39 __u64 xid;
40 __u64 timeout;
41 void __user *castparam;
42 void __user *castaddr;
43 void __user *bastparam;
44 void __user *bastaddr;
45 struct dlm_lksb __user *lksb;
46 char lvb[DLM_USER_LVB_LEN];
47 char name[0];
48};
49
50struct dlm_lspace_params {
51 __u32 flags;
52 __u32 minor;
53 char name[0];
54};
55
56struct dlm_purge_params {
57 __u32 nodeid;
58 __u32 pid;
59};
60
61struct dlm_write_request {
62 __u32 version[3];
63 __u8 cmd;
64 __u8 is64bit;
65 __u8 unused[2];
66
67 union {
68 struct dlm_lock_params lock;
69 struct dlm_lspace_params lspace;
70 struct dlm_purge_params purge;
71 } i;
72};
73
74struct dlm_device_version {
75 __u32 version[3];
76};
77
78/* struct read from the "device" fd,
79 consists mainly of userspace pointers for the library to use */
80
81struct dlm_lock_result {
82 __u32 version[3];
83 __u32 length;
84 void __user * user_astaddr;
85 void __user * user_astparam;
86 struct dlm_lksb __user * user_lksb;
87 struct dlm_lksb lksb;
88 __u8 bast_mode;
89 __u8 unused[3];
90 /* Offsets may be zero if no data is present */
91 __u32 lvb_offset;
92};
93
94/* Commands passed to the device */
95#define DLM_USER_LOCK 1
96#define DLM_USER_UNLOCK 2
97#define DLM_USER_QUERY 3
98#define DLM_USER_CREATE_LOCKSPACE 4
99#define DLM_USER_REMOVE_LOCKSPACE 5
100#define DLM_USER_PURGE 6
101#define DLM_USER_DEADLOCK 7
102
103/* Lockspace flags */
104#define DLM_USER_LSFLG_AUTOFREE 1
105#define DLM_USER_LSFLG_FORCEFREE 2
106
107#endif
108
diff --git a/include/linux/dlm_netlink.h b/include/linux/dlm_netlink.h
deleted file mode 100644
index 647c8ef27227..000000000000
--- a/include/linux/dlm_netlink.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * Copyright (C) 2007 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 _DLM_NETLINK_H
10#define _DLM_NETLINK_H
11
12#include <linux/types.h>
13
14enum {
15 DLM_STATUS_WAITING = 1,
16 DLM_STATUS_GRANTED = 2,
17 DLM_STATUS_CONVERT = 3,
18};
19
20#define DLM_LOCK_DATA_VERSION 1
21
22struct dlm_lock_data {
23 __u16 version;
24 __u32 lockspace_id;
25 int nodeid;
26 int ownpid;
27 __u32 id;
28 __u32 remid;
29 __u64 xid;
30 __s8 status;
31 __s8 grmode;
32 __s8 rqmode;
33 unsigned long timestamp;
34 int resource_namelen;
35 char resource_name[DLM_RESNAME_MAXLEN];
36};
37
38enum {
39 DLM_CMD_UNSPEC = 0,
40 DLM_CMD_HELLO, /* user->kernel */
41 DLM_CMD_TIMEOUT, /* kernel->user */
42 __DLM_CMD_MAX,
43};
44
45#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
46
47enum {
48 DLM_TYPE_UNSPEC = 0,
49 DLM_TYPE_LOCK,
50 __DLM_TYPE_MAX,
51};
52
53#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
54
55#define DLM_GENL_VERSION 0x1
56#define DLM_GENL_NAME "DLM"
57
58#endif /* _DLM_NETLINK_H */
diff --git a/include/linux/dlm_plock.h b/include/linux/dlm_plock.h
index 3b1cc1be419f..95ad387a7769 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/dlmconstants.h b/include/linux/dlmconstants.h
deleted file mode 100644
index 47bf08dc7566..000000000000
--- a/include/linux/dlmconstants.h
+++ /dev/null
@@ -1,163 +0,0 @@
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2007 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 __DLMCONSTANTS_DOT_H__
15#define __DLMCONSTANTS_DOT_H__
16
17/*
18 * Constants used by DLM interface.
19 */
20
21#define DLM_LOCKSPACE_LEN 64
22#define DLM_RESNAME_MAXLEN 64
23
24
25/*
26 * Lock Modes
27 */
28
29#define DLM_LOCK_IV (-1) /* invalid */
30#define DLM_LOCK_NL 0 /* null */
31#define DLM_LOCK_CR 1 /* concurrent read */
32#define DLM_LOCK_CW 2 /* concurrent write */
33#define DLM_LOCK_PR 3 /* protected read */
34#define DLM_LOCK_PW 4 /* protected write */
35#define DLM_LOCK_EX 5 /* exclusive */
36
37
38/*
39 * Flags to dlm_lock
40 *
41 * DLM_LKF_NOQUEUE
42 *
43 * Do not queue the lock request on the wait queue if it cannot be granted
44 * immediately. If the lock cannot be granted because of this flag, DLM will
45 * either return -EAGAIN from the dlm_lock call or will return 0 from
46 * dlm_lock and -EAGAIN in the lock status block when the AST is executed.
47 *
48 * DLM_LKF_CANCEL
49 *
50 * Used to cancel a pending lock request or conversion. A converting lock is
51 * returned to its previously granted mode.
52 *
53 * DLM_LKF_CONVERT
54 *
55 * Indicates a lock conversion request. For conversions the name and namelen
56 * are ignored and the lock ID in the LKSB is used to identify the lock.
57 *
58 * DLM_LKF_VALBLK
59 *
60 * Requests DLM to return the current contents of the lock value block in the
61 * lock status block. When this flag is set in a lock conversion from PW or EX
62 * modes, DLM assigns the value specified in the lock status block to the lock
63 * value block of the lock resource. The LVB is a DLM_LVB_LEN size array
64 * containing application-specific information.
65 *
66 * DLM_LKF_QUECVT
67 *
68 * Force a conversion request to be queued, even if it is compatible with
69 * the granted modes of other locks on the same resource.
70 *
71 * DLM_LKF_IVVALBLK
72 *
73 * Invalidate the lock value block.
74 *
75 * DLM_LKF_CONVDEADLK
76 *
77 * Allows the dlm to resolve conversion deadlocks internally by demoting the
78 * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is
79 * returned for a conversion that's been effected by this.
80 *
81 * DLM_LKF_PERSISTENT
82 *
83 * Only relevant to locks originating in userspace. A persistent lock will not
84 * be removed if the process holding the lock exits.
85 *
86 * DLM_LKF_NODLCKWT
87 *
88 * Do not cancel the lock if it gets into conversion deadlock.
89 * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
90 *
91 * DLM_LKF_NODLCKBLK
92 *
93 * net yet implemented
94 *
95 * DLM_LKF_EXPEDITE
96 *
97 * Used only with new requests for NL mode locks. Tells the lock manager
98 * to grant the lock, ignoring other locks in convert and wait queues.
99 *
100 * DLM_LKF_NOQUEUEBAST
101 *
102 * Send blocking AST's before returning -EAGAIN to the caller. It is only
103 * used along with the NOQUEUE flag. Blocking AST's are not sent for failed
104 * NOQUEUE requests otherwise.
105 *
106 * DLM_LKF_HEADQUE
107 *
108 * Add a lock to the head of the convert or wait queue rather than the tail.
109 *
110 * DLM_LKF_NOORDER
111 *
112 * Disregard the standard grant order rules and grant a lock as soon as it
113 * is compatible with other granted locks.
114 *
115 * DLM_LKF_ORPHAN
116 *
117 * not yet implemented
118 *
119 * DLM_LKF_ALTPR
120 *
121 * If the requested mode cannot be granted immediately, try to grant the lock
122 * in PR mode instead. If this alternate mode is granted instead of the
123 * requested mode, DLM_SBF_ALTMODE is returned in the lksb.
124 *
125 * DLM_LKF_ALTCW
126 *
127 * The same as ALTPR, but the alternate mode is CW.
128 *
129 * DLM_LKF_FORCEUNLOCK
130 *
131 * Unlock the lock even if it is converting or waiting or has sublocks.
132 * Only really for use by the userland device.c code.
133 *
134 */
135
136#define DLM_LKF_NOQUEUE 0x00000001
137#define DLM_LKF_CANCEL 0x00000002
138#define DLM_LKF_CONVERT 0x00000004
139#define DLM_LKF_VALBLK 0x00000008
140#define DLM_LKF_QUECVT 0x00000010
141#define DLM_LKF_IVVALBLK 0x00000020
142#define DLM_LKF_CONVDEADLK 0x00000040
143#define DLM_LKF_PERSISTENT 0x00000080
144#define DLM_LKF_NODLCKWT 0x00000100
145#define DLM_LKF_NODLCKBLK 0x00000200
146#define DLM_LKF_EXPEDITE 0x00000400
147#define DLM_LKF_NOQUEUEBAST 0x00000800
148#define DLM_LKF_HEADQUE 0x00001000
149#define DLM_LKF_NOORDER 0x00002000
150#define DLM_LKF_ORPHAN 0x00004000
151#define DLM_LKF_ALTPR 0x00008000
152#define DLM_LKF_ALTCW 0x00010000
153#define DLM_LKF_FORCEUNLOCK 0x00020000
154#define DLM_LKF_TIMEOUT 0x00040000
155
156/*
157 * Some return codes that are not in errno.h
158 */
159
160#define DLM_ECANCEL 0x10001
161#define DLM_EUNLOCK 0x10002
162
163#endif /* __DLMCONSTANTS_DOT_H__ */
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
deleted file mode 100644
index 91e3a360f611..000000000000
--- a/include/linux/dm-ioctl.h
+++ /dev/null
@@ -1,339 +0,0 @@
1/*
2 * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
3 * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the LGPL.
6 */
7
8#ifndef _LINUX_DM_IOCTL_V4_H
9#define _LINUX_DM_IOCTL_V4_H
10
11#include <linux/types.h>
12
13#define DM_DIR "mapper" /* Slashes not supported */
14#define DM_CONTROL_NODE "control"
15#define DM_MAX_TYPE_NAME 16
16#define DM_NAME_LEN 128
17#define DM_UUID_LEN 129
18
19/*
20 * A traditional ioctl interface for the device mapper.
21 *
22 * Each device can have two tables associated with it, an
23 * 'active' table which is the one currently used by io passing
24 * through the device, and an 'inactive' one which is a table
25 * that is being prepared as a replacement for the 'active' one.
26 *
27 * DM_VERSION:
28 * Just get the version information for the ioctl interface.
29 *
30 * DM_REMOVE_ALL:
31 * Remove all dm devices, destroy all tables. Only really used
32 * for debug.
33 *
34 * DM_LIST_DEVICES:
35 * Get a list of all the dm device names.
36 *
37 * DM_DEV_CREATE:
38 * Create a new device, neither the 'active' or 'inactive' table
39 * slots will be filled. The device will be in suspended state
40 * after creation, however any io to the device will get errored
41 * since it will be out-of-bounds.
42 *
43 * DM_DEV_REMOVE:
44 * Remove a device, destroy any tables.
45 *
46 * DM_DEV_RENAME:
47 * Rename a device or set its uuid if none was previously supplied.
48 *
49 * DM_SUSPEND:
50 * This performs both suspend and resume, depending which flag is
51 * passed in.
52 * Suspend: This command will not return until all pending io to
53 * the device has completed. Further io will be deferred until
54 * the device is resumed.
55 * Resume: It is no longer an error to issue this command on an
56 * unsuspended device. If a table is present in the 'inactive'
57 * slot, it will be moved to the active slot, then the old table
58 * from the active slot will be _destroyed_. Finally the device
59 * is resumed.
60 *
61 * DM_DEV_STATUS:
62 * Retrieves the status for the table in the 'active' slot.
63 *
64 * DM_DEV_WAIT:
65 * Wait for a significant event to occur to the device. This
66 * could either be caused by an event triggered by one of the
67 * targets of the table in the 'active' slot, or a table change.
68 *
69 * DM_TABLE_LOAD:
70 * Load a table into the 'inactive' slot for the device. The
71 * device does _not_ need to be suspended prior to this command.
72 *
73 * DM_TABLE_CLEAR:
74 * Destroy any table in the 'inactive' slot (ie. abort).
75 *
76 * DM_TABLE_DEPS:
77 * Return a set of device dependencies for the 'active' table.
78 *
79 * DM_TABLE_STATUS:
80 * Return the targets status for the 'active' table.
81 *
82 * DM_TARGET_MSG:
83 * Pass a message string to the target at a specific offset of a device.
84 *
85 * DM_DEV_SET_GEOMETRY:
86 * Set the geometry of a device by passing in a string in this format:
87 *
88 * "cylinders heads sectors_per_track start_sector"
89 *
90 * Beware that CHS geometry is nearly obsolete and only provided
91 * for compatibility with dm devices that can be booted by a PC
92 * BIOS. See struct hd_geometry for range limits. Also note that
93 * the geometry is erased if the device size changes.
94 */
95
96/*
97 * All ioctl arguments consist of a single chunk of memory, with
98 * this structure at the start. If a uuid is specified any
99 * lookup (eg. for a DM_INFO) will be done on that, *not* the
100 * name.
101 */
102struct dm_ioctl {
103 /*
104 * The version number is made up of three parts:
105 * major - no backward or forward compatibility,
106 * minor - only backwards compatible,
107 * patch - both backwards and forwards compatible.
108 *
109 * All clients of the ioctl interface should fill in the
110 * version number of the interface that they were
111 * compiled with.
112 *
113 * All recognised ioctl commands (ie. those that don't
114 * return -ENOTTY) fill out this field, even if the
115 * command failed.
116 */
117 __u32 version[3]; /* in/out */
118 __u32 data_size; /* total size of data passed in
119 * including this struct */
120
121 __u32 data_start; /* offset to start of data
122 * relative to start of this struct */
123
124 __u32 target_count; /* in/out */
125 __s32 open_count; /* out */
126 __u32 flags; /* in/out */
127
128 /*
129 * event_nr holds either the event number (input and output) or the
130 * udev cookie value (input only).
131 * The DM_DEV_WAIT ioctl takes an event number as input.
132 * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
133 * use the field as a cookie to return in the DM_COOKIE
134 * variable with the uevents they issue.
135 * For output, the ioctls return the event number, not the cookie.
136 */
137 __u32 event_nr; /* in/out */
138 __u32 padding;
139
140 __u64 dev; /* in/out */
141
142 char name[DM_NAME_LEN]; /* device name */
143 char uuid[DM_UUID_LEN]; /* unique identifier for
144 * the block device */
145 char data[7]; /* padding or data */
146};
147
148/*
149 * Used to specify tables. These structures appear after the
150 * dm_ioctl.
151 */
152struct dm_target_spec {
153 __u64 sector_start;
154 __u64 length;
155 __s32 status; /* used when reading from kernel only */
156
157 /*
158 * Location of the next dm_target_spec.
159 * - When specifying targets on a DM_TABLE_LOAD command, this value is
160 * the number of bytes from the start of the "current" dm_target_spec
161 * to the start of the "next" dm_target_spec.
162 * - When retrieving targets on a DM_TABLE_STATUS command, this value
163 * is the number of bytes from the start of the first dm_target_spec
164 * (that follows the dm_ioctl struct) to the start of the "next"
165 * dm_target_spec.
166 */
167 __u32 next;
168
169 char target_type[DM_MAX_TYPE_NAME];
170
171 /*
172 * Parameter string starts immediately after this object.
173 * Be careful to add padding after string to ensure correct
174 * alignment of subsequent dm_target_spec.
175 */
176};
177
178/*
179 * Used to retrieve the target dependencies.
180 */
181struct dm_target_deps {
182 __u32 count; /* Array size */
183 __u32 padding; /* unused */
184 __u64 dev[0]; /* out */
185};
186
187/*
188 * Used to get a list of all dm devices.
189 */
190struct dm_name_list {
191 __u64 dev;
192 __u32 next; /* offset to the next record from
193 the _start_ of this */
194 char name[0];
195};
196
197/*
198 * Used to retrieve the target versions
199 */
200struct dm_target_versions {
201 __u32 next;
202 __u32 version[3];
203
204 char name[0];
205};
206
207/*
208 * Used to pass message to a target
209 */
210struct dm_target_msg {
211 __u64 sector; /* Device sector */
212
213 char message[0];
214};
215
216/*
217 * If you change this make sure you make the corresponding change
218 * to dm-ioctl.c:lookup_ioctl()
219 */
220enum {
221 /* Top level cmds */
222 DM_VERSION_CMD = 0,
223 DM_REMOVE_ALL_CMD,
224 DM_LIST_DEVICES_CMD,
225
226 /* device level cmds */
227 DM_DEV_CREATE_CMD,
228 DM_DEV_REMOVE_CMD,
229 DM_DEV_RENAME_CMD,
230 DM_DEV_SUSPEND_CMD,
231 DM_DEV_STATUS_CMD,
232 DM_DEV_WAIT_CMD,
233
234 /* Table level cmds */
235 DM_TABLE_LOAD_CMD,
236 DM_TABLE_CLEAR_CMD,
237 DM_TABLE_DEPS_CMD,
238 DM_TABLE_STATUS_CMD,
239
240 /* Added later */
241 DM_LIST_VERSIONS_CMD,
242 DM_TARGET_MSG_CMD,
243 DM_DEV_SET_GEOMETRY_CMD
244};
245
246#define DM_IOCTL 0xfd
247
248#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
249#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
250#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
251
252#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
253#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
254#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
255#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
256#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
257#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
258
259#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
260#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
261#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
262#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
263
264#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
265
266#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268
269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 23
271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
273
274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
276#define DM_SUSPEND_FLAG (1 << 1) /* In/Out */
277#define DM_PERSISTENT_DEV_FLAG (1 << 3) /* In */
278
279/*
280 * Flag passed into ioctl STATUS command to get table information
281 * rather than current status.
282 */
283#define DM_STATUS_TABLE_FLAG (1 << 4) /* In */
284
285/*
286 * Flags that indicate whether a table is present in either of
287 * the two table slots that a device has.
288 */
289#define DM_ACTIVE_PRESENT_FLAG (1 << 5) /* Out */
290#define DM_INACTIVE_PRESENT_FLAG (1 << 6) /* Out */
291
292/*
293 * Indicates that the buffer passed in wasn't big enough for the
294 * results.
295 */
296#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
297
298/*
299 * This flag is now ignored.
300 */
301#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
302
303/*
304 * Set this to avoid attempting to freeze any filesystem when suspending.
305 */
306#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
307
308/*
309 * Set this to suspend without flushing queued ios.
310 * Also disables flushing uncommitted changes in the thin target before
311 * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
312 */
313#define DM_NOFLUSH_FLAG (1 << 11) /* In */
314
315/*
316 * If set, any table information returned will relate to the inactive
317 * table instead of the live one. Always check DM_INACTIVE_PRESENT_FLAG
318 * is set before using the data returned.
319 */
320#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */
321
322/*
323 * If set, a uevent was generated for which the caller may need to wait.
324 */
325#define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */
326
327/*
328 * If set, rename changes the uuid not the name. Only permitted
329 * if no uuid was previously supplied: an existing uuid cannot be changed.
330 */
331#define DM_UUID_FLAG (1 << 14) /* In */
332
333/*
334 * If set, all buffers are wiped after use. Use when sending
335 * or requesting sensitive data such as an encryption key.
336 */
337#define DM_SECURE_DATA_FLAG (1 << 15) /* In */
338
339#endif /* _LINUX_DM_IOCTL_H */
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
deleted file mode 100644
index 0678c2adc421..000000000000
--- a/include/linux/dm-log-userspace.h
+++ /dev/null
@@ -1,416 +0,0 @@
1/*
2 * Copyright (C) 2006-2009 Red Hat, Inc.
3 *
4 * This file is released under the LGPL.
5 */
6
7#ifndef __DM_LOG_USERSPACE_H__
8#define __DM_LOG_USERSPACE_H__
9
10#include <linux/dm-ioctl.h> /* For DM_UUID_LEN */
11
12/*
13 * The device-mapper userspace log module consists of a kernel component and
14 * a user-space component. The kernel component implements the API defined
15 * in dm-dirty-log.h. Its purpose is simply to pass the parameters and
16 * return values of those API functions between kernel and user-space.
17 *
18 * Below are defined the 'request_types' - DM_ULOG_CTR, DM_ULOG_DTR, etc.
19 * These request types represent the different functions in the device-mapper
20 * dirty log API. Each of these is described in more detail below.
21 *
22 * The user-space program must listen for requests from the kernel (representing
23 * the various API functions) and process them.
24 *
25 * User-space begins by setting up the communication link (error checking
26 * removed for clarity):
27 * fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
28 * addr.nl_family = AF_NETLINK;
29 * addr.nl_groups = CN_IDX_DM;
30 * addr.nl_pid = 0;
31 * r = bind(fd, (struct sockaddr *) &addr, sizeof(addr));
32 * opt = addr.nl_groups;
33 * setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &opt, sizeof(opt));
34 *
35 * User-space will then wait to receive requests form the kernel, which it
36 * will process as described below. The requests are received in the form,
37 * ((struct dm_ulog_request) + (additional data)). Depending on the request
38 * type, there may or may not be 'additional data'. In the descriptions below,
39 * you will see 'Payload-to-userspace' and 'Payload-to-kernel'. The
40 * 'Payload-to-userspace' is what the kernel sends in 'additional data' as
41 * necessary parameters to complete the request. The 'Payload-to-kernel' is
42 * the 'additional data' returned to the kernel that contains the necessary
43 * results of the request. The 'data_size' field in the dm_ulog_request
44 * structure denotes the availability and amount of payload data.
45 */
46
47/*
48 * DM_ULOG_CTR corresponds to (found in dm-dirty-log.h):
49 * int (*ctr)(struct dm_dirty_log *log, struct dm_target *ti,
50 * unsigned argc, char **argv);
51 *
52 * Payload-to-userspace:
53 * A single string containing all the argv arguments separated by ' 's
54 * Payload-to-kernel:
55 * A NUL-terminated string that is the name of the device that is used
56 * as the backing store for the log data. 'dm_get_device' will be called
57 * on this device. ('dm_put_device' will be called on this device
58 * automatically after calling DM_ULOG_DTR.) If there is no device needed
59 * for log data, 'data_size' in the dm_ulog_request struct should be 0.
60 *
61 * The UUID contained in the dm_ulog_request structure is the reference that
62 * will be used by all request types to a specific log. The constructor must
63 * record this association with the instance created.
64 *
65 * When the request has been processed, user-space must return the
66 * dm_ulog_request to the kernel - setting the 'error' field, filling the
67 * data field with the log device if necessary, and setting 'data_size'
68 * appropriately.
69 */
70#define DM_ULOG_CTR 1
71
72/*
73 * DM_ULOG_DTR corresponds to (found in dm-dirty-log.h):
74 * void (*dtr)(struct dm_dirty_log *log);
75 *
76 * Payload-to-userspace:
77 * A single string containing all the argv arguments separated by ' 's
78 * Payload-to-kernel:
79 * None. ('data_size' in the dm_ulog_request struct should be 0.)
80 *
81 * The UUID contained in the dm_ulog_request structure is all that is
82 * necessary to identify the log instance being destroyed. There is no
83 * payload data.
84 *
85 * When the request has been processed, user-space must return the
86 * dm_ulog_request to the kernel - setting the 'error' field and clearing
87 * 'data_size' appropriately.
88 */
89#define DM_ULOG_DTR 2
90
91/*
92 * DM_ULOG_PRESUSPEND corresponds to (found in dm-dirty-log.h):
93 * int (*presuspend)(struct dm_dirty_log *log);
94 *
95 * Payload-to-userspace:
96 * None.
97 * Payload-to-kernel:
98 * None.
99 *
100 * The UUID contained in the dm_ulog_request structure is all that is
101 * necessary to identify the log instance being presuspended. There is no
102 * payload data.
103 *
104 * When the request has been processed, user-space must return the
105 * dm_ulog_request to the kernel - setting the 'error' field and
106 * 'data_size' appropriately.
107 */
108#define DM_ULOG_PRESUSPEND 3
109
110/*
111 * DM_ULOG_POSTSUSPEND corresponds to (found in dm-dirty-log.h):
112 * int (*postsuspend)(struct dm_dirty_log *log);
113 *
114 * Payload-to-userspace:
115 * None.
116 * Payload-to-kernel:
117 * None.
118 *
119 * The UUID contained in the dm_ulog_request structure is all that is
120 * necessary to identify the log instance being postsuspended. There is no
121 * payload data.
122 *
123 * When the request has been processed, user-space must return the
124 * dm_ulog_request to the kernel - setting the 'error' field and
125 * 'data_size' appropriately.
126 */
127#define DM_ULOG_POSTSUSPEND 4
128
129/*
130 * DM_ULOG_RESUME corresponds to (found in dm-dirty-log.h):
131 * int (*resume)(struct dm_dirty_log *log);
132 *
133 * Payload-to-userspace:
134 * None.
135 * Payload-to-kernel:
136 * None.
137 *
138 * The UUID contained in the dm_ulog_request structure is all that is
139 * necessary to identify the log instance being resumed. There is no
140 * payload data.
141 *
142 * When the request has been processed, user-space must return the
143 * dm_ulog_request to the kernel - setting the 'error' field and
144 * 'data_size' appropriately.
145 */
146#define DM_ULOG_RESUME 5
147
148/*
149 * DM_ULOG_GET_REGION_SIZE corresponds to (found in dm-dirty-log.h):
150 * uint32_t (*get_region_size)(struct dm_dirty_log *log);
151 *
152 * Payload-to-userspace:
153 * None.
154 * Payload-to-kernel:
155 * uint64_t - contains the region size
156 *
157 * The region size is something that was determined at constructor time.
158 * It is returned in the payload area and 'data_size' is set to
159 * reflect this.
160 *
161 * When the request has been processed, user-space must return the
162 * dm_ulog_request to the kernel - setting the 'error' field appropriately.
163 */
164#define DM_ULOG_GET_REGION_SIZE 6
165
166/*
167 * DM_ULOG_IS_CLEAN corresponds to (found in dm-dirty-log.h):
168 * int (*is_clean)(struct dm_dirty_log *log, region_t region);
169 *
170 * Payload-to-userspace:
171 * uint64_t - the region to get clean status on
172 * Payload-to-kernel:
173 * int64_t - 1 if clean, 0 otherwise
174 *
175 * Payload is sizeof(uint64_t) and contains the region for which the clean
176 * status is being made.
177 *
178 * When the request has been processed, user-space must return the
179 * dm_ulog_request to the kernel - filling the payload with 0 (not clean) or
180 * 1 (clean), setting 'data_size' and 'error' appropriately.
181 */
182#define DM_ULOG_IS_CLEAN 7
183
184/*
185 * DM_ULOG_IN_SYNC corresponds to (found in dm-dirty-log.h):
186 * int (*in_sync)(struct dm_dirty_log *log, region_t region,
187 * int can_block);
188 *
189 * Payload-to-userspace:
190 * uint64_t - the region to get sync status on
191 * Payload-to-kernel:
192 * int64_t - 1 if in-sync, 0 otherwise
193 *
194 * Exactly the same as 'is_clean' above, except this time asking "has the
195 * region been recovered?" vs. "is the region not being modified?"
196 */
197#define DM_ULOG_IN_SYNC 8
198
199/*
200 * DM_ULOG_FLUSH corresponds to (found in dm-dirty-log.h):
201 * int (*flush)(struct dm_dirty_log *log);
202 *
203 * Payload-to-userspace:
204 * None.
205 * Payload-to-kernel:
206 * None.
207 *
208 * No incoming or outgoing payload. Simply flush log state to disk.
209 *
210 * When the request has been processed, user-space must return the
211 * dm_ulog_request to the kernel - setting the 'error' field and clearing
212 * 'data_size' appropriately.
213 */
214#define DM_ULOG_FLUSH 9
215
216/*
217 * DM_ULOG_MARK_REGION corresponds to (found in dm-dirty-log.h):
218 * void (*mark_region)(struct dm_dirty_log *log, region_t region);
219 *
220 * Payload-to-userspace:
221 * uint64_t [] - region(s) to mark
222 * Payload-to-kernel:
223 * None.
224 *
225 * Incoming payload contains the one or more regions to mark dirty.
226 * The number of regions contained in the payload can be determined from
227 * 'data_size/sizeof(uint64_t)'.
228 *
229 * When the request has been processed, user-space must return the
230 * dm_ulog_request to the kernel - setting the 'error' field and clearing
231 * 'data_size' appropriately.
232 */
233#define DM_ULOG_MARK_REGION 10
234
235/*
236 * DM_ULOG_CLEAR_REGION corresponds to (found in dm-dirty-log.h):
237 * void (*clear_region)(struct dm_dirty_log *log, region_t region);
238 *
239 * Payload-to-userspace:
240 * uint64_t [] - region(s) to clear
241 * Payload-to-kernel:
242 * None.
243 *
244 * Incoming payload contains the one or more regions to mark clean.
245 * The number of regions contained in the payload can be determined from
246 * 'data_size/sizeof(uint64_t)'.
247 *
248 * When the request has been processed, user-space must return the
249 * dm_ulog_request to the kernel - setting the 'error' field and clearing
250 * 'data_size' appropriately.
251 */
252#define DM_ULOG_CLEAR_REGION 11
253
254/*
255 * DM_ULOG_GET_RESYNC_WORK corresponds to (found in dm-dirty-log.h):
256 * int (*get_resync_work)(struct dm_dirty_log *log, region_t *region);
257 *
258 * Payload-to-userspace:
259 * None.
260 * Payload-to-kernel:
261 * {
262 * int64_t i; -- 1 if recovery necessary, 0 otherwise
263 * uint64_t r; -- The region to recover if i=1
264 * }
265 * 'data_size' should be set appropriately.
266 *
267 * When the request has been processed, user-space must return the
268 * dm_ulog_request to the kernel - setting the 'error' field appropriately.
269 */
270#define DM_ULOG_GET_RESYNC_WORK 12
271
272/*
273 * DM_ULOG_SET_REGION_SYNC corresponds to (found in dm-dirty-log.h):
274 * void (*set_region_sync)(struct dm_dirty_log *log,
275 * region_t region, int in_sync);
276 *
277 * Payload-to-userspace:
278 * {
279 * uint64_t - region to set sync state on
280 * int64_t - 0 if not-in-sync, 1 if in-sync
281 * }
282 * Payload-to-kernel:
283 * None.
284 *
285 * When the request has been processed, user-space must return the
286 * dm_ulog_request to the kernel - setting the 'error' field and clearing
287 * 'data_size' appropriately.
288 */
289#define DM_ULOG_SET_REGION_SYNC 13
290
291/*
292 * DM_ULOG_GET_SYNC_COUNT corresponds to (found in dm-dirty-log.h):
293 * region_t (*get_sync_count)(struct dm_dirty_log *log);
294 *
295 * Payload-to-userspace:
296 * None.
297 * Payload-to-kernel:
298 * uint64_t - the number of in-sync regions
299 *
300 * No incoming payload. Kernel-bound payload contains the number of
301 * regions that are in-sync (in a size_t).
302 *
303 * When the request has been processed, user-space must return the
304 * dm_ulog_request to the kernel - setting the 'error' field and
305 * 'data_size' appropriately.
306 */
307#define DM_ULOG_GET_SYNC_COUNT 14
308
309/*
310 * DM_ULOG_STATUS_INFO corresponds to (found in dm-dirty-log.h):
311 * int (*status)(struct dm_dirty_log *log, STATUSTYPE_INFO,
312 * char *result, unsigned maxlen);
313 *
314 * Payload-to-userspace:
315 * None.
316 * Payload-to-kernel:
317 * Character string containing STATUSTYPE_INFO
318 *
319 * When the request has been processed, user-space must return the
320 * dm_ulog_request to the kernel - setting the 'error' field and
321 * 'data_size' appropriately.
322 */
323#define DM_ULOG_STATUS_INFO 15
324
325/*
326 * DM_ULOG_STATUS_TABLE corresponds to (found in dm-dirty-log.h):
327 * int (*status)(struct dm_dirty_log *log, STATUSTYPE_TABLE,
328 * char *result, unsigned maxlen);
329 *
330 * Payload-to-userspace:
331 * None.
332 * Payload-to-kernel:
333 * Character string containing STATUSTYPE_TABLE
334 *
335 * When the request has been processed, user-space must return the
336 * dm_ulog_request to the kernel - setting the 'error' field and
337 * 'data_size' appropriately.
338 */
339#define DM_ULOG_STATUS_TABLE 16
340
341/*
342 * DM_ULOG_IS_REMOTE_RECOVERING corresponds to (found in dm-dirty-log.h):
343 * int (*is_remote_recovering)(struct dm_dirty_log *log, region_t region);
344 *
345 * Payload-to-userspace:
346 * uint64_t - region to determine recovery status on
347 * Payload-to-kernel:
348 * {
349 * int64_t is_recovering; -- 0 if no, 1 if yes
350 * uint64_t in_sync_hint; -- lowest region still needing resync
351 * }
352 *
353 * When the request has been processed, user-space must return the
354 * dm_ulog_request to the kernel - setting the 'error' field and
355 * 'data_size' appropriately.
356 */
357#define DM_ULOG_IS_REMOTE_RECOVERING 17
358
359/*
360 * (DM_ULOG_REQUEST_MASK & request_type) to get the request type
361 *
362 * Payload-to-userspace:
363 * A single string containing all the argv arguments separated by ' 's
364 * Payload-to-kernel:
365 * None. ('data_size' in the dm_ulog_request struct should be 0.)
366 *
367 * We are reserving 8 bits of the 32-bit 'request_type' field for the
368 * various request types above. The remaining 24-bits are currently
369 * set to zero and are reserved for future use and compatibility concerns.
370 *
371 * User-space should always use DM_ULOG_REQUEST_TYPE to acquire the
372 * request type from the 'request_type' field to maintain forward compatibility.
373 */
374#define DM_ULOG_REQUEST_MASK 0xFF
375#define DM_ULOG_REQUEST_TYPE(request_type) \
376 (DM_ULOG_REQUEST_MASK & (request_type))
377
378/*
379 * DM_ULOG_REQUEST_VERSION is incremented when there is a
380 * change to the way information is passed between kernel
381 * and userspace. This could be a structure change of
382 * dm_ulog_request or a change in the way requests are
383 * issued/handled. Changes are outlined here:
384 * version 1: Initial implementation
385 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via
387 * 'dm_get_device'.
388 */
389#define DM_ULOG_REQUEST_VERSION 2
390
391struct dm_ulog_request {
392 /*
393 * The local unique identifier (luid) and the universally unique
394 * identifier (uuid) are used to tie a request to a specific
395 * mirror log. A single machine log could probably make due with
396 * just the 'luid', but a cluster-aware log must use the 'uuid' and
397 * the 'luid'. The uuid is what is required for node to node
398 * communication concerning a particular log, but the 'luid' helps
399 * differentiate between logs that are being swapped and have the
400 * same 'uuid'. (Think "live" and "inactive" device-mapper tables.)
401 */
402 uint64_t luid;
403 char uuid[DM_UUID_LEN];
404 char padding[3]; /* Padding because DM_UUID_LEN = 129 */
405
406 uint32_t version; /* See DM_ULOG_REQUEST_VERSION */
407 int32_t error; /* Used to report back processing errors */
408
409 uint32_t seq; /* Sequence number for request */
410 uint32_t request_type; /* DM_ULOG_* defined above */
411 uint32_t data_size; /* How much data (not including this struct) */
412
413 char data[0];
414};
415
416#endif /* __DM_LOG_USERSPACE_H__ */
diff --git a/include/linux/dn.h b/include/linux/dn.h
deleted file mode 100644
index 9c50445462d9..000000000000
--- a/include/linux/dn.h
+++ /dev/null
@@ -1,146 +0,0 @@
1#ifndef _LINUX_DN_H
2#define _LINUX_DN_H
3
4#include <linux/types.h>
5
6/*
7
8 DECnet Data Structures and Constants
9
10*/
11
12/*
13 * DNPROTO_NSP can't be the same as SOL_SOCKET,
14 * so increment each by one (compared to ULTRIX)
15 */
16#define DNPROTO_NSP 2 /* NSP protocol number */
17#define DNPROTO_ROU 3 /* Routing protocol number */
18#define DNPROTO_NML 4 /* Net mgt protocol number */
19#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
20#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
21#define DNPROTO_NSPT 7 /* NSP trace protocol number */
22
23
24#define DN_ADDL 2
25#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
26#define DN_MAXOPTL 16
27#define DN_MAXOBJL 16
28#define DN_MAXACCL 40
29#define DN_MAXALIASL 128
30#define DN_MAXNODEL 256
31#define DNBUFSIZE 65023
32
33/*
34 * SET/GET Socket options - must match the DSO_ numbers below
35 */
36#define SO_CONDATA 1
37#define SO_CONACCESS 2
38#define SO_PROXYUSR 3
39#define SO_LINKINFO 7
40
41#define DSO_CONDATA 1 /* Set/Get connect data */
42#define DSO_DISDATA 10 /* Set/Get disconnect data */
43#define DSO_CONACCESS 2 /* Set/Get connect access data */
44#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
45#define DSO_CONACCEPT 5 /* Accept deferred connection */
46#define DSO_CONREJECT 6 /* Reject deferred connection */
47#define DSO_LINKINFO 7 /* Set/Get link information */
48#define DSO_STREAM 8 /* Set socket type to stream */
49#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
50#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
51#define DSO_NODELAY 12 /* Turn off nagle */
52#define DSO_CORK 13 /* Wait for more data! */
53#define DSO_SERVICES 14 /* NSP Services field */
54#define DSO_INFO 15 /* NSP Info field */
55#define DSO_MAX 15 /* Maximum option number */
56
57
58/* LINK States */
59#define LL_INACTIVE 0
60#define LL_CONNECTING 1
61#define LL_RUNNING 2
62#define LL_DISCONNECTING 3
63
64#define ACC_IMMED 0
65#define ACC_DEFER 1
66
67#define SDF_WILD 1 /* Wild card object */
68#define SDF_PROXY 2 /* Addr eligible for proxy */
69#define SDF_UICPROXY 4 /* Use uic-based proxy */
70
71/* Structures */
72
73
74struct dn_naddr {
75 __le16 a_len;
76 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
77};
78
79struct sockaddr_dn {
80 __u16 sdn_family;
81 __u8 sdn_flags;
82 __u8 sdn_objnum;
83 __le16 sdn_objnamel;
84 __u8 sdn_objname[DN_MAXOBJL];
85 struct dn_naddr sdn_add;
86};
87#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
88#define sdn_nodeaddr sdn_add.a_addr /* Node address */
89
90
91
92/*
93 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
94 */
95struct optdata_dn {
96 __le16 opt_status; /* Extended status return */
97#define opt_sts opt_status
98 __le16 opt_optl; /* Length of user data */
99 __u8 opt_data[16]; /* User data */
100};
101
102struct accessdata_dn {
103 __u8 acc_accl;
104 __u8 acc_acc[DN_MAXACCL];
105 __u8 acc_passl;
106 __u8 acc_pass[DN_MAXACCL];
107 __u8 acc_userl;
108 __u8 acc_user[DN_MAXACCL];
109};
110
111/*
112 * DECnet logical link information structure
113 */
114struct linkinfo_dn {
115 __u16 idn_segsize; /* Segment size for link */
116 __u8 idn_linkstate; /* Logical link state */
117};
118
119/*
120 * Ethernet address format (for DECnet)
121 */
122union etheraddress {
123 __u8 dne_addr[6]; /* Full ethernet address */
124 struct {
125 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
126 __u8 dne_nodeaddr[2]; /* DECnet node address */
127 } dne_remote;
128};
129
130
131/*
132 * DECnet physical socket address format
133 */
134struct dn_addr {
135 __le16 dna_family; /* AF_DECnet */
136 union etheraddress dna_netaddr; /* DECnet ethernet address */
137};
138
139#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
140
141#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
142#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
143#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
144#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
145
146#endif /* _LINUX_DN_H */
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h
deleted file mode 100644
index 86552807aed9..000000000000
--- a/include/linux/dqblk_xfs.h
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesset General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17#ifndef _LINUX_DQBLK_XFS_H
18#define _LINUX_DQBLK_XFS_H
19
20#include <linux/types.h>
21
22/*
23 * Disk quota - quotactl(2) commands for the XFS Quota Manager (XQM).
24 */
25
26#define XQM_CMD(x) (('X'<<8)+(x)) /* note: forms first QCMD argument */
27#define XQM_COMMAND(x) (((x) & (0xff<<8)) == ('X'<<8)) /* test if for XFS */
28
29#define XQM_USRQUOTA 0 /* system call user quota type */
30#define XQM_GRPQUOTA 1 /* system call group quota type */
31#define XQM_PRJQUOTA 2 /* system call project quota type */
32#define XQM_MAXQUOTAS 3
33
34#define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */
35#define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */
36#define Q_XGETQUOTA XQM_CMD(3) /* get disk limits and usage */
37#define Q_XSETQLIM XQM_CMD(4) /* set disk limits */
38#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */
39#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */
40#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */
41
42/*
43 * fs_disk_quota structure:
44 *
45 * This contains the current quota information regarding a user/proj/group.
46 * It is 64-bit aligned, and all the blk units are in BBs (Basic Blocks) of
47 * 512 bytes.
48 */
49#define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */
50typedef struct fs_disk_quota {
51 __s8 d_version; /* version of this structure */
52 __s8 d_flags; /* FS_{USER,PROJ,GROUP}_QUOTA */
53 __u16 d_fieldmask; /* field specifier */
54 __u32 d_id; /* user, project, or group ID */
55 __u64 d_blk_hardlimit;/* absolute limit on disk blks */
56 __u64 d_blk_softlimit;/* preferred limit on disk blks */
57 __u64 d_ino_hardlimit;/* maximum # allocated inodes */
58 __u64 d_ino_softlimit;/* preferred inode limit */
59 __u64 d_bcount; /* # disk blocks owned by the user */
60 __u64 d_icount; /* # inodes owned by the user */
61 __s32 d_itimer; /* zero if within inode limits */
62 /* if not, we refuse service */
63 __s32 d_btimer; /* similar to above; for disk blocks */
64 __u16 d_iwarns; /* # warnings issued wrt num inodes */
65 __u16 d_bwarns; /* # warnings issued wrt disk blocks */
66 __s32 d_padding2; /* padding2 - for future use */
67 __u64 d_rtb_hardlimit;/* absolute limit on realtime blks */
68 __u64 d_rtb_softlimit;/* preferred limit on RT disk blks */
69 __u64 d_rtbcount; /* # realtime blocks owned */
70 __s32 d_rtbtimer; /* similar to above; for RT disk blks */
71 __u16 d_rtbwarns; /* # warnings issued wrt RT disk blks */
72 __s16 d_padding3; /* padding3 - for future use */
73 char d_padding4[8]; /* yet more padding */
74} fs_disk_quota_t;
75
76/*
77 * These fields are sent to Q_XSETQLIM to specify fields that need to change.
78 */
79#define FS_DQ_ISOFT (1<<0)
80#define FS_DQ_IHARD (1<<1)
81#define FS_DQ_BSOFT (1<<2)
82#define FS_DQ_BHARD (1<<3)
83#define FS_DQ_RTBSOFT (1<<4)
84#define FS_DQ_RTBHARD (1<<5)
85#define FS_DQ_LIMIT_MASK (FS_DQ_ISOFT | FS_DQ_IHARD | FS_DQ_BSOFT | \
86 FS_DQ_BHARD | FS_DQ_RTBSOFT | FS_DQ_RTBHARD)
87/*
88 * These timers can only be set in super user's dquot. For others, timers are
89 * automatically started and stopped. Superusers timer values set the limits
90 * for the rest. In case these values are zero, the DQ_{F,B}TIMELIMIT values
91 * defined below are used.
92 * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
93 */
94#define FS_DQ_BTIMER (1<<6)
95#define FS_DQ_ITIMER (1<<7)
96#define FS_DQ_RTBTIMER (1<<8)
97#define FS_DQ_TIMER_MASK (FS_DQ_BTIMER | FS_DQ_ITIMER | FS_DQ_RTBTIMER)
98
99/*
100 * Warning counts are set in both super user's dquot and others. For others,
101 * warnings are set/cleared by the administrators (or automatically by going
102 * below the soft limit). Superusers warning values set the warning limits
103 * for the rest. In case these values are zero, the DQ_{F,B}WARNLIMIT values
104 * defined below are used.
105 * These values also apply only to the d_fieldmask field for Q_XSETQLIM.
106 */
107#define FS_DQ_BWARNS (1<<9)
108#define FS_DQ_IWARNS (1<<10)
109#define FS_DQ_RTBWARNS (1<<11)
110#define FS_DQ_WARNS_MASK (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS)
111
112/*
113 * Accounting values. These can only be set for filesystem with
114 * non-transactional quotas that require quotacheck(8) in userspace.
115 */
116#define FS_DQ_BCOUNT (1<<12)
117#define FS_DQ_ICOUNT (1<<13)
118#define FS_DQ_RTBCOUNT (1<<14)
119#define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT)
120
121/*
122 * Various flags related to quotactl(2).
123 */
124#define FS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
125#define FS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */
126#define FS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */
127#define FS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */
128#define FS_QUOTA_PDQ_ACCT (1<<4) /* project quota accounting */
129#define FS_QUOTA_PDQ_ENFD (1<<5) /* project quota limits enforcement */
130
131#define FS_USER_QUOTA (1<<0) /* user quota type */
132#define FS_PROJ_QUOTA (1<<1) /* project quota type */
133#define FS_GROUP_QUOTA (1<<2) /* group quota type */
134
135/*
136 * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
137 * Provides a centralized way to get meta information about the quota subsystem.
138 * eg. space taken up for user and group quotas, number of dquots currently
139 * incore.
140 */
141#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
142
143/*
144 * Some basic information about 'quota files'.
145 */
146typedef struct fs_qfilestat {
147 __u64 qfs_ino; /* inode number */
148 __u64 qfs_nblks; /* number of BBs 512-byte-blks */
149 __u32 qfs_nextents; /* number of extents */
150} fs_qfilestat_t;
151
152typedef struct fs_quota_stat {
153 __s8 qs_version; /* version number for future changes */
154 __u16 qs_flags; /* FS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
155 __s8 qs_pad; /* unused */
156 fs_qfilestat_t qs_uquota; /* user quota storage information */
157 fs_qfilestat_t qs_gquota; /* group quota storage information */
158 __u32 qs_incoredqs; /* number of dquots incore */
159 __s32 qs_btimelimit; /* limit for blks timer */
160 __s32 qs_itimelimit; /* limit for inodes timer */
161 __s32 qs_rtbtimelimit;/* limit for rt blks timer */
162 __u16 qs_bwarnlimit; /* limit for num warnings */
163 __u16 qs_iwarnlimit; /* limit for num warnings */
164} fs_quota_stat_t;
165
166#endif /* _LINUX_DQBLK_XFS_H */
diff --git a/include/linux/edd.h b/include/linux/edd.h
index 4cbd0fe9df08..83d4371ec996 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/efs_fs_sb.h b/include/linux/efs_fs_sb.h
deleted file mode 100644
index a01be90c58cc..000000000000
--- a/include/linux/efs_fs_sb.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * efs_fs_sb.h
3 *
4 * Copyright (c) 1999 Al Smith
5 *
6 * Portions derived from IRIX header files (c) 1988 Silicon Graphics
7 */
8
9#ifndef __EFS_FS_SB_H__
10#define __EFS_FS_SB_H__
11
12#include <linux/types.h>
13#include <linux/magic.h>
14
15/* EFS superblock magic numbers */
16#define EFS_MAGIC 0x072959
17#define EFS_NEWMAGIC 0x07295a
18
19#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
20
21#define EFS_SUPER 1
22#define EFS_ROOTINODE 2
23
24/* efs superblock on disk */
25struct efs_super {
26 __be32 fs_size; /* size of filesystem, in sectors */
27 __be32 fs_firstcg; /* bb offset to first cg */
28 __be32 fs_cgfsize; /* size of cylinder group in bb's */
29 __be16 fs_cgisize; /* bb's of inodes per cylinder group */
30 __be16 fs_sectors; /* sectors per track */
31 __be16 fs_heads; /* heads per cylinder */
32 __be16 fs_ncg; /* # of cylinder groups in filesystem */
33 __be16 fs_dirty; /* fs needs to be fsck'd */
34 __be32 fs_time; /* last super-block update */
35 __be32 fs_magic; /* magic number */
36 char fs_fname[6]; /* file system name */
37 char fs_fpack[6]; /* file system pack name */
38 __be32 fs_bmsize; /* size of bitmap in bytes */
39 __be32 fs_tfree; /* total free data blocks */
40 __be32 fs_tinode; /* total free inodes */
41 __be32 fs_bmblock; /* bitmap location. */
42 __be32 fs_replsb; /* Location of replicated superblock. */
43 __be32 fs_lastialloc; /* last allocated inode */
44 char fs_spare[20]; /* space for expansion - MUST BE ZERO */
45 __be32 fs_checksum; /* checksum of volume portion of fs */
46};
47
48/* efs superblock information in memory */
49struct efs_sb_info {
50 __u32 fs_magic; /* superblock magic number */
51 __u32 fs_start; /* first block of filesystem */
52 __u32 first_block; /* first data block in filesystem */
53 __u32 total_blocks; /* total number of blocks in filesystem */
54 __u32 group_size; /* # of blocks a group consists of */
55 __u32 data_free; /* # of free data blocks */
56 __u32 inode_free; /* # of free inodes */
57 __u16 inode_blocks; /* # of blocks used for inodes in every grp */
58 __u16 total_groups; /* # of groups */
59};
60
61#endif /* __EFS_FS_SB_H__ */
62
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
deleted file mode 100644
index 8e2b7bac4378..000000000000
--- a/include/linux/elf-em.h
+++ /dev/null
@@ -1,56 +0,0 @@
1#ifndef _LINUX_ELF_EM_H
2#define _LINUX_ELF_EM_H
3
4/* These constants define the various ELF target machines */
5#define EM_NONE 0
6#define EM_M32 1
7#define EM_SPARC 2
8#define EM_386 3
9#define EM_68K 4
10#define EM_88K 5
11#define EM_486 6 /* Perhaps disused */
12#define EM_860 7
13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
14 /* Next two are historical and binaries and
15 modules of these types will be rejected by
16 Linux. */
17#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
18#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
19
20#define EM_PARISC 15 /* HPPA */
21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */
25#define EM_SH 42 /* SuperH */
26#define EM_SPARCV9 43 /* SPARC v9 64-bit */
27#define EM_IA_64 50 /* HP/Intel IA-64 */
28#define EM_X86_64 62 /* AMD x86-64 */
29#define EM_S390 22 /* IBM S/390 */
30#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
31#define EM_V850 87 /* NEC v850 */
32#define EM_M32R 88 /* Renesas M32R */
33#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
34#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */
35#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
36#define EM_TI_C6000 140 /* TI C6X DSPs */
37#define EM_FRV 0x5441 /* Fujitsu FR-V */
38#define EM_AVR32 0x18ad /* Atmel AVR32 */
39
40/*
41 * This is an interim value that we will use until the committee comes
42 * up with a final number.
43 */
44#define EM_ALPHA 0x9026
45
46/* Bogus old v850 magic number, used by old tools. */
47#define EM_CYGNUS_V850 0x9080
48/* Bogus old m32r magic number, used by old tools. */
49#define EM_CYGNUS_M32R 0x9041
50/* This is the old interim value for S/390 architecture */
51#define EM_S390_OLD 0xA390
52/* Also Panasonic/MEI MN10300, AM33 */
53#define EM_CYGNUS_MN10300 0xbeef
54
55
56#endif /* _LINUX_ELF_EM_H */
diff --git a/include/linux/elf-fdpic.h b/include/linux/elf-fdpic.h
deleted file mode 100644
index 7cd2e80cebc8..000000000000
--- a/include/linux/elf-fdpic.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/* elf-fdpic.h: FDPIC ELF load map
2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.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#ifndef _LINUX_ELF_FDPIC_H
13#define _LINUX_ELF_FDPIC_H
14
15#include <linux/elf.h>
16
17#define PT_GNU_STACK (PT_LOOS + 0x474e551)
18
19/* segment mappings for ELF FDPIC libraries/executables/interpreters */
20struct elf32_fdpic_loadseg {
21 Elf32_Addr addr; /* core address to which mapped */
22 Elf32_Addr p_vaddr; /* VMA recorded in file */
23 Elf32_Word p_memsz; /* allocation size recorded in file */
24};
25
26struct elf32_fdpic_loadmap {
27 Elf32_Half version; /* version of these structures, just in case... */
28 Elf32_Half nsegs; /* number of segments */
29 struct elf32_fdpic_loadseg segs[];
30};
31
32#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
33
34/*
35 * binfmt binary parameters structure
36 */
37struct elf_fdpic_params {
38 struct elfhdr hdr; /* ref copy of ELF header */
39 struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */
40 struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */
41 unsigned long elfhdr_addr; /* mapped ELF header user address */
42 unsigned long ph_addr; /* mapped PT_PHDR user address */
43 unsigned long map_addr; /* mapped loadmap user address */
44 unsigned long entry_addr; /* mapped entry user address */
45 unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */
46 unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */
47 unsigned long load_addr; /* user address at which to map binary */
48 unsigned long flags;
49#define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */
50#define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */
51#define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */
52#define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant
53 * displacement */
54#define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */
55#define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */
56#define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */
57#define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */
58#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
59};
60
61#ifdef __KERNEL__
62#ifdef CONFIG_MMU
63extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
64 struct elf_fdpic_params *interp_params,
65 unsigned long *start_stack,
66 unsigned long *start_brk);
67#endif
68#endif /* __KERNEL__ */
69
70#endif /* _LINUX_ELF_FDPIC_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 59ef40650e1e..8c9048e33463 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 0698c79fbcb2..cdd3d13efce7 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 e0de516374da..f6bf082d4d4f 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 fd0628be45ce..9ca23fcfb5d7 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 fcb4f8e60c1c..c8e3e7e39c6b 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 41085d0f3955..6daf6d4971f6 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/fadvise.h b/include/linux/fadvise.h
deleted file mode 100644
index e8e747139b9a..000000000000
--- a/include/linux/fadvise.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef FADVISE_H_INCLUDED
2#define FADVISE_H_INCLUDED
3
4#define POSIX_FADV_NORMAL 0 /* No further special treatment. */
5#define POSIX_FADV_RANDOM 1 /* Expect random page references. */
6#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
7#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
8
9/*
10 * The advise values for POSIX_FADV_DONTNEED and POSIX_ADV_NOREUSE
11 * for s390-64 differ from the values for the rest of the world.
12 */
13#if defined(__s390x__)
14#define POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
15#define POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
16#else
17#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
19#endif
20
21#endif /* FADVISE_H_INCLUDED */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
index d39b824a780c..31591686ac2d 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 6c6133f76e16..cef93ddcc5a0 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 ac3f1c605843..c7a95714b1fe 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 f550f894ba15..76ce329e656d 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 72202b1b9a6a..69275bccc3e4 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/fdreg.h b/include/linux/fdreg.h
deleted file mode 100644
index 61ce64169004..000000000000
--- a/include/linux/fdreg.h
+++ /dev/null
@@ -1,137 +0,0 @@
1#ifndef _LINUX_FDREG_H
2#define _LINUX_FDREG_H
3/*
4 * This file contains some defines for the floppy disk controller.
5 * Various sources. Mostly "IBM Microcomputers: A Programmers
6 * Handbook", Sanches and Canton.
7 */
8
9#ifdef FDPATCHES
10#define FD_IOPORT fdc_state[fdc].address
11#else
12/* It would be a lot saner just to force fdc_state[fdc].address to always
13 be set ! FIXME */
14#define FD_IOPORT 0x3f0
15#endif
16
17/* Fd controller regs. S&C, about page 340 */
18#define FD_STATUS (4 + FD_IOPORT )
19#define FD_DATA (5 + FD_IOPORT )
20
21/* Digital Output Register */
22#define FD_DOR (2 + FD_IOPORT )
23
24/* Digital Input Register (read) */
25#define FD_DIR (7 + FD_IOPORT )
26
27/* Diskette Control Register (write)*/
28#define FD_DCR (7 + FD_IOPORT )
29
30/* Bits of main status register */
31#define STATUS_BUSYMASK 0x0F /* drive busy mask */
32#define STATUS_BUSY 0x10 /* FDC busy */
33#define STATUS_DMA 0x20 /* 0- DMA mode */
34#define STATUS_DIR 0x40 /* 0- cpu->fdc */
35#define STATUS_READY 0x80 /* Data reg ready */
36
37/* Bits of FD_ST0 */
38#define ST0_DS 0x03 /* drive select mask */
39#define ST0_HA 0x04 /* Head (Address) */
40#define ST0_NR 0x08 /* Not Ready */
41#define ST0_ECE 0x10 /* Equipment check error */
42#define ST0_SE 0x20 /* Seek end */
43#define ST0_INTR 0xC0 /* Interrupt code mask */
44
45/* Bits of FD_ST1 */
46#define ST1_MAM 0x01 /* Missing Address Mark */
47#define ST1_WP 0x02 /* Write Protect */
48#define ST1_ND 0x04 /* No Data - unreadable */
49#define ST1_OR 0x10 /* OverRun */
50#define ST1_CRC 0x20 /* CRC error in data or addr */
51#define ST1_EOC 0x80 /* End Of Cylinder */
52
53/* Bits of FD_ST2 */
54#define ST2_MAM 0x01 /* Missing Address Mark (again) */
55#define ST2_BC 0x02 /* Bad Cylinder */
56#define ST2_SNS 0x04 /* Scan Not Satisfied */
57#define ST2_SEH 0x08 /* Scan Equal Hit */
58#define ST2_WC 0x10 /* Wrong Cylinder */
59#define ST2_CRC 0x20 /* CRC error in data field */
60#define ST2_CM 0x40 /* Control Mark = deleted */
61
62/* Bits of FD_ST3 */
63#define ST3_HA 0x04 /* Head (Address) */
64#define ST3_DS 0x08 /* drive is double-sided */
65#define ST3_TZ 0x10 /* Track Zero signal (1=track 0) */
66#define ST3_RY 0x20 /* drive is ready */
67#define ST3_WP 0x40 /* Write Protect */
68#define ST3_FT 0x80 /* Drive Fault */
69
70/* Values for FD_COMMAND */
71#define FD_RECALIBRATE 0x07 /* move to track 0 */
72#define FD_SEEK 0x0F /* seek track */
73#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */
74#define FD_WRITE 0xC5 /* write with MT, MFM */
75#define FD_SENSEI 0x08 /* Sense Interrupt Status */
76#define FD_SPECIFY 0x03 /* specify HUT etc */
77#define FD_FORMAT 0x4D /* format one track */
78#define FD_VERSION 0x10 /* get version code */
79#define FD_CONFIGURE 0x13 /* configure FIFO operation */
80#define FD_PERPENDICULAR 0x12 /* perpendicular r/w mode */
81#define FD_GETSTATUS 0x04 /* read ST3 */
82#define FD_DUMPREGS 0x0E /* dump the contents of the fdc regs */
83#define FD_READID 0xEA /* prints the header of a sector */
84#define FD_UNLOCK 0x14 /* Fifo config unlock */
85#define FD_LOCK 0x94 /* Fifo config lock */
86#define FD_RSEEK_OUT 0x8f /* seek out (i.e. to lower tracks) */
87#define FD_RSEEK_IN 0xcf /* seek in (i.e. to higher tracks) */
88
89/* the following commands are new in the 82078. They are not used in the
90 * floppy driver, except the first three. These commands may be useful for apps
91 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
92 * http://www.intel.com/design/archives/periphrl/docs/29046803.htm */
93
94#define FD_PARTID 0x18 /* part id ("extended" version cmd) */
95#define FD_SAVE 0x2e /* save fdc regs for later restore */
96#define FD_DRIVESPEC 0x8e /* drive specification: Access to the
97 * 2 Mbps data transfer rate for tape
98 * drives */
99
100#define FD_RESTORE 0x4e /* later restore */
101#define FD_POWERDOWN 0x27 /* configure FDC's powersave features */
102#define FD_FORMAT_N_WRITE 0xef /* format and write in one go. */
103#define FD_OPTION 0x33 /* ISO format (which is a clean way to
104 * pack more sectors on a track) */
105
106/* DMA commands */
107#define DMA_READ 0x46
108#define DMA_WRITE 0x4A
109
110/* FDC version return types */
111#define FDC_NONE 0x00
112#define FDC_UNKNOWN 0x10 /* DO NOT USE THIS TYPE EXCEPT IF IDENTIFICATION
113 FAILS EARLY */
114#define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */
115#define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */
116#define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */
117#define FDC_82072A 0x45 /* 82072A (on Sparcs) */
118#define FDC_82077_ORIG 0x51 /* Original version of 82077AA, sans LOCK */
119#define FDC_82077 0x52 /* 82077AA-1 */
120#define FDC_82078_UNKN 0x5f /* Unknown 82078 variant */
121#define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */
122#define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */
123#define FDC_S82078B 0x62 /* S82078B (first seen on Adaptec AVA-2825 VLB
124 * SCSI/EIDE/Floppy controller) */
125#define FDC_87306 0x63 /* National Semiconductor PC 87306 */
126
127/*
128 * Beware: the fdc type list is roughly sorted by increasing features.
129 * Presence of features is tested by comparing the FDC version id with the
130 * "oldest" version that has the needed feature.
131 * If during FDC detection, an obscure test fails late in the sequence, don't
132 * assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
133 * This is especially true if the tests are unneeded.
134 */
135
136#define FD_RESET_DELAY 20
137#endif
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
deleted file mode 100644
index 51da65b68b85..000000000000
--- a/include/linux/fib_rules.h
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifndef __LINUX_FIB_RULES_H
2#define __LINUX_FIB_RULES_H
3
4#include <linux/types.h>
5#include <linux/rtnetlink.h>
6
7/* rule is permanent, and cannot be deleted */
8#define FIB_RULE_PERMANENT 0x00000001
9#define FIB_RULE_INVERT 0x00000002
10#define FIB_RULE_UNRESOLVED 0x00000004
11#define FIB_RULE_IIF_DETACHED 0x00000008
12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
13#define FIB_RULE_OIF_DETACHED 0x00000010
14
15/* try to find source address in routing lookups */
16#define FIB_RULE_FIND_SADDR 0x00010000
17
18struct fib_rule_hdr {
19 __u8 family;
20 __u8 dst_len;
21 __u8 src_len;
22 __u8 tos;
23
24 __u8 table;
25 __u8 res1; /* reserved */
26 __u8 res2; /* reserved */
27 __u8 action;
28
29 __u32 flags;
30};
31
32enum {
33 FRA_UNSPEC,
34 FRA_DST, /* destination address */
35 FRA_SRC, /* source address */
36 FRA_IIFNAME, /* interface name */
37#define FRA_IFNAME FRA_IIFNAME
38 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
39 FRA_UNUSED2,
40 FRA_PRIORITY, /* priority/preference */
41 FRA_UNUSED3,
42 FRA_UNUSED4,
43 FRA_UNUSED5,
44 FRA_FWMARK, /* mark */
45 FRA_FLOW, /* flow/class id */
46 FRA_UNUSED6,
47 FRA_UNUSED7,
48 FRA_UNUSED8,
49 FRA_TABLE, /* Extended table id */
50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME,
52 __FRA_MAX
53};
54
55#define FRA_MAX (__FRA_MAX - 1)
56
57enum {
58 FR_ACT_UNSPEC,
59 FR_ACT_TO_TBL, /* Pass to fixed table */
60 FR_ACT_GOTO, /* Jump to another rule */
61 FR_ACT_NOP, /* No operation */
62 FR_ACT_RES3,
63 FR_ACT_RES4,
64 FR_ACT_BLACKHOLE, /* Drop without notification */
65 FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
66 FR_ACT_PROHIBIT, /* Drop with EACCES */
67 __FR_ACT_MAX,
68};
69
70#define FR_ACT_MAX (__FR_ACT_MAX - 1)
71
72#endif
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
deleted file mode 100644
index d830747f5c0b..000000000000
--- a/include/linux/fiemap.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * FS_IOC_FIEMAP ioctl infrastructure.
3 *
4 * Some portions copyright (C) 2007 Cluster File Systems, Inc
5 *
6 * Authors: Mark Fasheh <mfasheh@suse.com>
7 * Kalpak Shah <kalpak.shah@sun.com>
8 * Andreas Dilger <adilger@sun.com>
9 */
10
11#ifndef _LINUX_FIEMAP_H
12#define _LINUX_FIEMAP_H
13
14#include <linux/types.h>
15
16struct fiemap_extent {
17 __u64 fe_logical; /* logical offset in bytes for the start of
18 * the extent from the beginning of the file */
19 __u64 fe_physical; /* physical offset in bytes for the start
20 * of the extent from the beginning of the disk */
21 __u64 fe_length; /* length in bytes for this extent */
22 __u64 fe_reserved64[2];
23 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
24 __u32 fe_reserved[3];
25};
26
27struct fiemap {
28 __u64 fm_start; /* logical offset (inclusive) at
29 * which to start mapping (in) */
30 __u64 fm_length; /* logical length of mapping which
31 * userspace wants (in) */
32 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
33 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
34 __u32 fm_extent_count; /* size of fm_extents array (in) */
35 __u32 fm_reserved;
36 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
37};
38
39#define FIEMAP_MAX_OFFSET (~0ULL)
40
41#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
42#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
43
44#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
45
46#define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */
47#define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */
48#define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending.
49 * Sets EXTENT_UNKNOWN. */
50#define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read
51 * while fs is unmounted */
52#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs.
53 * Sets EXTENT_NO_BYPASS. */
54#define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be
55 * block aligned. */
56#define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata.
57 * Sets EXTENT_NOT_ALIGNED.*/
58#define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block.
59 * Sets EXTENT_NOT_ALIGNED.*/
60#define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but
61 * no data (i.e. zero). */
62#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
63 * support extents. Result
64 * merged for efficiency. */
65#define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other
66 * files. */
67
68#endif /* _LINUX_FIEMAP_H */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 2ded090e10f4..24d251f3bab0 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/firewire-cdev.h b/include/linux/firewire-cdev.h
deleted file mode 100644
index d50036953497..000000000000
--- a/include/linux/firewire-cdev.h
+++ /dev/null
@@ -1,1039 +0,0 @@
1/*
2 * Char device interface.
3 *
4 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef _LINUX_FIREWIRE_CDEV_H
27#define _LINUX_FIREWIRE_CDEV_H
28
29#include <linux/ioctl.h>
30#include <linux/types.h>
31#include <linux/firewire-constants.h>
32
33/* available since kernel version 2.6.22 */
34#define FW_CDEV_EVENT_BUS_RESET 0x00
35#define FW_CDEV_EVENT_RESPONSE 0x01
36#define FW_CDEV_EVENT_REQUEST 0x02
37#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
38
39/* available since kernel version 2.6.30 */
40#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
41#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
42
43/* available since kernel version 2.6.36 */
44#define FW_CDEV_EVENT_REQUEST2 0x06
45#define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07
46#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08
47#define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
48
49/**
50 * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
51 * @closure: For arbitrary use by userspace
52 * @type: Discriminates the fw_cdev_event_ types
53 *
54 * This struct may be used to access generic members of all fw_cdev_event_
55 * types regardless of the specific type.
56 *
57 * Data passed in the @closure field for a request will be returned in the
58 * corresponding event. It is big enough to hold a pointer on all platforms.
59 * The ioctl used to set @closure depends on the @type of event.
60 */
61struct fw_cdev_event_common {
62 __u64 closure;
63 __u32 type;
64};
65
66/**
67 * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
68 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
69 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
70 * @node_id: New node ID of this node
71 * @local_node_id: Node ID of the local node, i.e. of the controller
72 * @bm_node_id: Node ID of the bus manager
73 * @irm_node_id: Node ID of the iso resource manager
74 * @root_node_id: Node ID of the root node
75 * @generation: New bus generation
76 *
77 * This event is sent when the bus the device belongs to goes through a bus
78 * reset. It provides information about the new bus configuration, such as
79 * new node ID for this device, new root ID, and others.
80 *
81 * If @bm_node_id is 0xffff right after bus reset it can be reread by an
82 * %FW_CDEV_IOC_GET_INFO ioctl after bus manager selection was finished.
83 * Kernels with ABI version < 4 do not set @bm_node_id.
84 */
85struct fw_cdev_event_bus_reset {
86 __u64 closure;
87 __u32 type;
88 __u32 node_id;
89 __u32 local_node_id;
90 __u32 bm_node_id;
91 __u32 irm_node_id;
92 __u32 root_node_id;
93 __u32 generation;
94};
95
96/**
97 * struct fw_cdev_event_response - Sent when a response packet was received
98 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_REQUEST
99 * or %FW_CDEV_IOC_SEND_BROADCAST_REQUEST
100 * or %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl
101 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
102 * @rcode: Response code returned by the remote node
103 * @length: Data length, i.e. the response's payload size in bytes
104 * @data: Payload data, if any
105 *
106 * This event is sent when the stack receives a response to an outgoing request
107 * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
108 * carrying data (read and lock responses) follows immediately and can be
109 * accessed through the @data field.
110 *
111 * The event is also generated after conclusions of transactions that do not
112 * involve response packets. This includes unified write transactions,
113 * broadcast write transactions, and transmission of asynchronous stream
114 * packets. @rcode indicates success or failure of such transmissions.
115 */
116struct fw_cdev_event_response {
117 __u64 closure;
118 __u32 type;
119 __u32 rcode;
120 __u32 length;
121 __u32 data[0];
122};
123
124/**
125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2
126 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
127 *
128 * This event is sent instead of &fw_cdev_event_request2 if the kernel or
129 * the client implements ABI version <= 3. &fw_cdev_event_request lacks
130 * essential information; use &fw_cdev_event_request2 instead.
131 */
132struct fw_cdev_event_request {
133 __u64 closure;
134 __u32 type;
135 __u32 tcode;
136 __u64 offset;
137 __u32 handle;
138 __u32 length;
139 __u32 data[0];
140};
141
142/**
143 * struct fw_cdev_event_request2 - Sent on incoming request to an address region
144 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
145 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST2
146 * @tcode: Transaction code of the incoming request
147 * @offset: The offset into the 48-bit per-node address space
148 * @source_node_id: Sender node ID
149 * @destination_node_id: Destination node ID
150 * @card: The index of the card from which the request came
151 * @generation: Bus generation in which the request is valid
152 * @handle: Reference to the kernel-side pending request
153 * @length: Data length, i.e. the request's payload size in bytes
154 * @data: Incoming data, if any
155 *
156 * This event is sent when the stack receives an incoming request to an address
157 * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
158 * guaranteed to be completely contained in the specified region. Userspace is
159 * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
160 * using the same @handle.
161 *
162 * The payload data for requests carrying data (write and lock requests)
163 * follows immediately and can be accessed through the @data field.
164 *
165 * Unlike &fw_cdev_event_request, @tcode of lock requests is one of the
166 * firewire-core specific %TCODE_LOCK_MASK_SWAP...%TCODE_LOCK_VENDOR_DEPENDENT,
167 * i.e. encodes the extended transaction code.
168 *
169 * @card may differ from &fw_cdev_get_info.card because requests are received
170 * from all cards of the Linux host. @source_node_id, @destination_node_id, and
171 * @generation pertain to that card. Destination node ID and bus generation may
172 * therefore differ from the corresponding fields of the last
173 * &fw_cdev_event_bus_reset.
174 *
175 * @destination_node_id may also differ from the current node ID because of a
176 * non-local bus ID part or in case of a broadcast write request. Note, a
177 * client must call an %FW_CDEV_IOC_SEND_RESPONSE ioctl even in case of a
178 * broadcast write request; the kernel will then release the kernel-side pending
179 * request but will not actually send a response packet.
180 *
181 * In case of a write request to FCP_REQUEST or FCP_RESPONSE, the kernel already
182 * sent a write response immediately after the request was received; in this
183 * case the client must still call an %FW_CDEV_IOC_SEND_RESPONSE ioctl to
184 * release the kernel-side pending request, though another response won't be
185 * sent.
186 *
187 * If the client subsequently needs to initiate requests to the sender node of
188 * an &fw_cdev_event_request2, it needs to use a device file with matching
189 * card index, node ID, and generation for outbound requests.
190 */
191struct fw_cdev_event_request2 {
192 __u64 closure;
193 __u32 type;
194 __u32 tcode;
195 __u64 offset;
196 __u32 source_node_id;
197 __u32 destination_node_id;
198 __u32 card;
199 __u32 generation;
200 __u32 handle;
201 __u32 length;
202 __u32 data[0];
203};
204
205/**
206 * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
207 * @closure: See &fw_cdev_event_common;
208 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
209 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
210 * @cycle: Cycle counter of the last completed packet
211 * @header_length: Total length of following headers, in bytes
212 * @header: Stripped headers, if any
213 *
214 * This event is sent when the controller has completed an &fw_cdev_iso_packet
215 * with the %FW_CDEV_ISO_INTERRUPT bit set, when explicitly requested with
216 * %FW_CDEV_IOC_FLUSH_ISO, or when there have been so many completed packets
217 * without the interrupt bit set that the kernel's internal buffer for @header
218 * is about to overflow. (In the last case, kernels with ABI version < 5 drop
219 * header data up to the next interrupt packet.)
220 *
221 * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT):
222 *
223 * In version 3 and some implementations of version 2 of the ABI, &header_length
224 * is a multiple of 4 and &header contains timestamps of all packets up until
225 * the interrupt packet. The format of the timestamps is as described below for
226 * isochronous reception. In version 1 of the ABI, &header_length was 0.
227 *
228 * Isochronous receive events (context type %FW_CDEV_ISO_CONTEXT_RECEIVE):
229 *
230 * The headers stripped of all packets up until and including the interrupt
231 * packet are returned in the @header field. The amount of header data per
232 * packet is as specified at iso context creation by
233 * &fw_cdev_create_iso_context.header_size.
234 *
235 * Hence, _interrupt.header_length / _context.header_size is the number of
236 * packets received in this interrupt event. The client can now iterate
237 * through the mmap()'ed DMA buffer according to this number of packets and
238 * to the buffer sizes as the client specified in &fw_cdev_queue_iso.
239 *
240 * Since version 2 of this ABI, the portion for each packet in _interrupt.header
241 * consists of the 1394 isochronous packet header, followed by a timestamp
242 * quadlet if &fw_cdev_create_iso_context.header_size > 4, followed by quadlets
243 * from the packet payload if &fw_cdev_create_iso_context.header_size > 8.
244 *
245 * Format of 1394 iso packet header: 16 bits data_length, 2 bits tag, 6 bits
246 * channel, 4 bits tcode, 4 bits sy, in big endian byte order.
247 * data_length is the actual received size of the packet without the four
248 * 1394 iso packet header bytes.
249 *
250 * Format of timestamp: 16 bits invalid, 3 bits cycleSeconds, 13 bits
251 * cycleCount, in big endian byte order.
252 *
253 * In version 1 of the ABI, no timestamp quadlet was inserted; instead, payload
254 * data followed directly after the 1394 is header if header_size > 4.
255 * Behaviour of ver. 1 of this ABI is no longer available since ABI ver. 2.
256 */
257struct fw_cdev_event_iso_interrupt {
258 __u64 closure;
259 __u32 type;
260 __u32 cycle;
261 __u32 header_length;
262 __u32 header[0];
263};
264
265/**
266 * struct fw_cdev_event_iso_interrupt_mc - An iso buffer chunk was completed
267 * @closure: See &fw_cdev_event_common;
268 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
269 * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
270 * @completed: Offset into the receive buffer; data before this offset is valid
271 *
272 * This event is sent in multichannel contexts (context type
273 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer
274 * chunks that have been completely filled and that have the
275 * %FW_CDEV_ISO_INTERRUPT bit set, or when explicitly requested with
276 * %FW_CDEV_IOC_FLUSH_ISO.
277 *
278 * The buffer is continuously filled with the following data, per packet:
279 * - the 1394 iso packet header as described at &fw_cdev_event_iso_interrupt,
280 * but in little endian byte order,
281 * - packet payload (as many bytes as specified in the data_length field of
282 * the 1394 iso packet header) in big endian byte order,
283 * - 0...3 padding bytes as needed to align the following trailer quadlet,
284 * - trailer quadlet, containing the reception timestamp as described at
285 * &fw_cdev_event_iso_interrupt, but in little endian byte order.
286 *
287 * Hence the per-packet size is data_length (rounded up to a multiple of 4) + 8.
288 * When processing the data, stop before a packet that would cross the
289 * @completed offset.
290 *
291 * A packet near the end of a buffer chunk will typically spill over into the
292 * next queued buffer chunk. It is the responsibility of the client to check
293 * for this condition, assemble a broken-up packet from its parts, and not to
294 * re-queue any buffer chunks in which as yet unread packet parts reside.
295 */
296struct fw_cdev_event_iso_interrupt_mc {
297 __u64 closure;
298 __u32 type;
299 __u32 completed;
300};
301
302/**
303 * struct fw_cdev_event_iso_resource - Iso resources were allocated or freed
304 * @closure: See &fw_cdev_event_common;
305 * set by %FW_CDEV_IOC_(DE)ALLOCATE_ISO_RESOURCE(_ONCE) ioctl
306 * @type: %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
307 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
308 * @handle: Reference by which an allocated resource can be deallocated
309 * @channel: Isochronous channel which was (de)allocated, if any
310 * @bandwidth: Bandwidth allocation units which were (de)allocated, if any
311 *
312 * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event is sent after an isochronous
313 * resource was allocated at the IRM. The client has to check @channel and
314 * @bandwidth for whether the allocation actually succeeded.
315 *
316 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event is sent after an isochronous
317 * resource was deallocated at the IRM. It is also sent when automatic
318 * reallocation after a bus reset failed.
319 *
320 * @channel is <0 if no channel was (de)allocated or if reallocation failed.
321 * @bandwidth is 0 if no bandwidth was (de)allocated or if reallocation failed.
322 */
323struct fw_cdev_event_iso_resource {
324 __u64 closure;
325 __u32 type;
326 __u32 handle;
327 __s32 channel;
328 __s32 bandwidth;
329};
330
331/**
332 * struct fw_cdev_event_phy_packet - A PHY packet was transmitted or received
333 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_PHY_PACKET
334 * or %FW_CDEV_IOC_RECEIVE_PHY_PACKETS ioctl
335 * @type: %FW_CDEV_EVENT_PHY_PACKET_SENT or %..._RECEIVED
336 * @rcode: %RCODE_..., indicates success or failure of transmission
337 * @length: Data length in bytes
338 * @data: Incoming data
339 *
340 * If @type is %FW_CDEV_EVENT_PHY_PACKET_SENT, @length is 0 and @data empty,
341 * except in case of a ping packet: Then, @length is 4, and @data[0] is the
342 * ping time in 49.152MHz clocks if @rcode is %RCODE_COMPLETE.
343 *
344 * If @type is %FW_CDEV_EVENT_PHY_PACKET_RECEIVED, @length is 8 and @data
345 * consists of the two PHY packet quadlets, in host byte order.
346 */
347struct fw_cdev_event_phy_packet {
348 __u64 closure;
349 __u32 type;
350 __u32 rcode;
351 __u32 length;
352 __u32 data[0];
353};
354
355/**
356 * union fw_cdev_event - Convenience union of fw_cdev_event_ types
357 * @common: Valid for all types
358 * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
359 * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
360 * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
361 * @request2: Valid if @common.type == %FW_CDEV_EVENT_REQUEST2
362 * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
363 * @iso_interrupt_mc: Valid if @common.type ==
364 * %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
365 * @iso_resource: Valid if @common.type ==
366 * %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED or
367 * %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED
368 * @phy_packet: Valid if @common.type ==
369 * %FW_CDEV_EVENT_PHY_PACKET_SENT or
370 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED
371 *
372 * Convenience union for userspace use. Events could be read(2) into an
373 * appropriately aligned char buffer and then cast to this union for further
374 * processing. Note that for a request, response or iso_interrupt event,
375 * the data[] or header[] may make the size of the full event larger than
376 * sizeof(union fw_cdev_event). Also note that if you attempt to read(2)
377 * an event into a buffer that is not large enough for it, the data that does
378 * not fit will be discarded so that the next read(2) will return a new event.
379 */
380union fw_cdev_event {
381 struct fw_cdev_event_common common;
382 struct fw_cdev_event_bus_reset bus_reset;
383 struct fw_cdev_event_response response;
384 struct fw_cdev_event_request request;
385 struct fw_cdev_event_request2 request2; /* added in 2.6.36 */
386 struct fw_cdev_event_iso_interrupt iso_interrupt;
387 struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc; /* added in 2.6.36 */
388 struct fw_cdev_event_iso_resource iso_resource; /* added in 2.6.30 */
389 struct fw_cdev_event_phy_packet phy_packet; /* added in 2.6.36 */
390};
391
392/* available since kernel version 2.6.22 */
393#define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
394#define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
395#define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
396#define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
397#define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
398#define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
399#define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
400#define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
401#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
402#define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
403#define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
404#define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
405
406/* available since kernel version 2.6.24 */
407#define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
408
409/* available since kernel version 2.6.30 */
410#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
411#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
412#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
413#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
414#define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11) /* returns speed code */
415#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
416#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
417
418/* available since kernel version 2.6.34 */
419#define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
420
421/* available since kernel version 2.6.36 */
422#define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet)
423#define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets)
424#define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels)
425
426/* available since kernel version 3.4 */
427#define FW_CDEV_IOC_FLUSH_ISO _IOW('#', 0x18, struct fw_cdev_flush_iso)
428
429/*
430 * ABI version history
431 * 1 (2.6.22) - initial version
432 * (2.6.24) - added %FW_CDEV_IOC_GET_CYCLE_TIMER
433 * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
434 * &fw_cdev_create_iso_context.header_size is 8 or more
435 * - added %FW_CDEV_IOC_*_ISO_RESOURCE*,
436 * %FW_CDEV_IOC_GET_SPEED, %FW_CDEV_IOC_SEND_BROADCAST_REQUEST,
437 * %FW_CDEV_IOC_SEND_STREAM_PACKET
438 * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt
439 * (2.6.33) - IR has always packet-per-buffer semantics now, not one of
440 * dual-buffer or packet-per-buffer depending on hardware
441 * - shared use and auto-response for FCP registers
442 * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable
443 * - added %FW_CDEV_IOC_GET_CYCLE_TIMER2
444 * 4 (2.6.36) - added %FW_CDEV_EVENT_REQUEST2, %FW_CDEV_EVENT_PHY_PACKET_*,
445 * and &fw_cdev_allocate.region_end
446 * - implemented &fw_cdev_event_bus_reset.bm_node_id
447 * - added %FW_CDEV_IOC_SEND_PHY_PACKET, _RECEIVE_PHY_PACKETS
448 * - added %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL,
449 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and
450 * %FW_CDEV_IOC_SET_ISO_CHANNELS
451 * 5 (3.4) - send %FW_CDEV_EVENT_ISO_INTERRUPT events when needed to
452 * avoid dropping data
453 * - added %FW_CDEV_IOC_FLUSH_ISO
454 */
455
456/**
457 * struct fw_cdev_get_info - General purpose information ioctl
458 * @version: The version field is just a running serial number. Both an
459 * input parameter (ABI version implemented by the client) and
460 * output parameter (ABI version implemented by the kernel).
461 * A client shall fill in the ABI @version for which the client
462 * was implemented. This is necessary for forward compatibility.
463 * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration
464 * ROM will be copied into that user space address. In either
465 * case, @rom_length is updated with the actual length of the
466 * Configuration ROM.
467 * @rom: If non-zero, address of a buffer to be filled by a copy of the
468 * device's Configuration ROM
469 * @bus_reset: If non-zero, address of a buffer to be filled by a
470 * &struct fw_cdev_event_bus_reset with the current state
471 * of the bus. This does not cause a bus reset to happen.
472 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
473 * @card: The index of the card this device belongs to
474 *
475 * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client
476 * performs right after it opened a /dev/fw* file.
477 *
478 * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
479 * is started by this ioctl.
480 */
481struct fw_cdev_get_info {
482 __u32 version;
483 __u32 rom_length;
484 __u64 rom;
485 __u64 bus_reset;
486 __u64 bus_reset_closure;
487 __u32 card;
488};
489
490/**
491 * struct fw_cdev_send_request - Send an asynchronous request packet
492 * @tcode: Transaction code of the request
493 * @length: Length of outgoing payload, in bytes
494 * @offset: 48-bit offset at destination node
495 * @closure: Passed back to userspace in the response event
496 * @data: Userspace pointer to payload
497 * @generation: The bus generation where packet is valid
498 *
499 * Send a request to the device. This ioctl implements all outgoing requests.
500 * Both quadlet and block request specify the payload as a pointer to the data
501 * in the @data field. Once the transaction completes, the kernel writes an
502 * &fw_cdev_event_response event back. The @closure field is passed back to
503 * user space in the response event.
504 */
505struct fw_cdev_send_request {
506 __u32 tcode;
507 __u32 length;
508 __u64 offset;
509 __u64 closure;
510 __u64 data;
511 __u32 generation;
512};
513
514/**
515 * struct fw_cdev_send_response - Send an asynchronous response packet
516 * @rcode: Response code as determined by the userspace handler
517 * @length: Length of outgoing payload, in bytes
518 * @data: Userspace pointer to payload
519 * @handle: The handle from the &fw_cdev_event_request
520 *
521 * Send a response to an incoming request. By setting up an address range using
522 * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
523 * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
524 * send a reply using this ioctl. The event has a handle to the kernel-side
525 * pending transaction, which should be used with this ioctl.
526 */
527struct fw_cdev_send_response {
528 __u32 rcode;
529 __u32 length;
530 __u64 data;
531 __u32 handle;
532};
533
534/**
535 * struct fw_cdev_allocate - Allocate a CSR in an address range
536 * @offset: Start offset of the address range
537 * @closure: To be passed back to userspace in request events
538 * @length: Length of the CSR, in bytes
539 * @handle: Handle to the allocation, written by the kernel
540 * @region_end: First address above the address range (added in ABI v4, 2.6.36)
541 *
542 * Allocate an address range in the 48-bit address space on the local node
543 * (the controller). This allows userspace to listen for requests with an
544 * offset within that address range. Every time when the kernel receives a
545 * request within the range, an &fw_cdev_event_request2 event will be emitted.
546 * (If the kernel or the client implements ABI version <= 3, an
547 * &fw_cdev_event_request will be generated instead.)
548 *
549 * The @closure field is passed back to userspace in these request events.
550 * The @handle field is an out parameter, returning a handle to the allocated
551 * range to be used for later deallocation of the range.
552 *
553 * The address range is allocated on all local nodes. The address allocation
554 * is exclusive except for the FCP command and response registers. If an
555 * exclusive address region is already in use, the ioctl fails with errno set
556 * to %EBUSY.
557 *
558 * If kernel and client implement ABI version >= 4, the kernel looks up a free
559 * spot of size @length inside [@offset..@region_end) and, if found, writes
560 * the start address of the new CSR back in @offset. I.e. @offset is an
561 * in and out parameter. If this automatic placement of a CSR in a bigger
562 * address range is not desired, the client simply needs to set @region_end
563 * = @offset + @length.
564 *
565 * If the kernel or the client implements ABI version <= 3, @region_end is
566 * ignored and effectively assumed to be @offset + @length.
567 *
568 * @region_end is only present in a kernel header >= 2.6.36. If necessary,
569 * this can for example be tested by #ifdef FW_CDEV_EVENT_REQUEST2.
570 */
571struct fw_cdev_allocate {
572 __u64 offset;
573 __u64 closure;
574 __u32 length;
575 __u32 handle;
576 __u64 region_end; /* available since kernel version 2.6.36 */
577};
578
579/**
580 * struct fw_cdev_deallocate - Free a CSR address range or isochronous resource
581 * @handle: Handle to the address range or iso resource, as returned by the
582 * kernel when the range or resource was allocated
583 */
584struct fw_cdev_deallocate {
585 __u32 handle;
586};
587
588#define FW_CDEV_LONG_RESET 0
589#define FW_CDEV_SHORT_RESET 1
590
591/**
592 * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
593 * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
594 *
595 * Initiate a bus reset for the bus this device is on. The bus reset can be
596 * either the original (long) bus reset or the arbitrated (short) bus reset
597 * introduced in 1394a-2000.
598 *
599 * The ioctl returns immediately. A subsequent &fw_cdev_event_bus_reset
600 * indicates when the reset actually happened. Since ABI v4, this may be
601 * considerably later than the ioctl because the kernel ensures a grace period
602 * between subsequent bus resets as per IEEE 1394 bus management specification.
603 */
604struct fw_cdev_initiate_bus_reset {
605 __u32 type;
606};
607
608/**
609 * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
610 * @immediate: If non-zero, immediate key to insert before pointer
611 * @key: Upper 8 bits of root directory pointer
612 * @data: Userspace pointer to contents of descriptor block
613 * @length: Length of descriptor block data, in quadlets
614 * @handle: Handle to the descriptor, written by the kernel
615 *
616 * Add a descriptor block and optionally a preceding immediate key to the local
617 * node's Configuration ROM.
618 *
619 * The @key field specifies the upper 8 bits of the descriptor root directory
620 * pointer and the @data and @length fields specify the contents. The @key
621 * should be of the form 0xXX000000. The offset part of the root directory entry
622 * will be filled in by the kernel.
623 *
624 * If not 0, the @immediate field specifies an immediate key which will be
625 * inserted before the root directory pointer.
626 *
627 * @immediate, @key, and @data array elements are CPU-endian quadlets.
628 *
629 * If successful, the kernel adds the descriptor and writes back a @handle to
630 * the kernel-side object to be used for later removal of the descriptor block
631 * and immediate key. The kernel will also generate a bus reset to signal the
632 * change of the Configuration ROM to other nodes.
633 *
634 * This ioctl affects the Configuration ROMs of all local nodes.
635 * The ioctl only succeeds on device files which represent a local node.
636 */
637struct fw_cdev_add_descriptor {
638 __u32 immediate;
639 __u32 key;
640 __u64 data;
641 __u32 length;
642 __u32 handle;
643};
644
645/**
646 * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM
647 * @handle: Handle to the descriptor, as returned by the kernel when the
648 * descriptor was added
649 *
650 * Remove a descriptor block and accompanying immediate key from the local
651 * nodes' Configuration ROMs. The kernel will also generate a bus reset to
652 * signal the change of the Configuration ROM to other nodes.
653 */
654struct fw_cdev_remove_descriptor {
655 __u32 handle;
656};
657
658#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
659#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
660#define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2 /* added in 2.6.36 */
661
662/**
663 * struct fw_cdev_create_iso_context - Create a context for isochronous I/O
664 * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE or
665 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL
666 * @header_size: Header size to strip in single-channel reception
667 * @channel: Channel to bind to in single-channel reception or transmission
668 * @speed: Transmission speed
669 * @closure: To be returned in &fw_cdev_event_iso_interrupt or
670 * &fw_cdev_event_iso_interrupt_multichannel
671 * @handle: Handle to context, written back by kernel
672 *
673 * Prior to sending or receiving isochronous I/O, a context must be created.
674 * The context records information about the transmit or receive configuration
675 * and typically maps to an underlying hardware resource. A context is set up
676 * for either sending or receiving. It is bound to a specific isochronous
677 * @channel.
678 *
679 * In case of multichannel reception, @header_size and @channel are ignored
680 * and the channels are selected by %FW_CDEV_IOC_SET_ISO_CHANNELS.
681 *
682 * For %FW_CDEV_ISO_CONTEXT_RECEIVE contexts, @header_size must be at least 4
683 * and must be a multiple of 4. It is ignored in other context types.
684 *
685 * @speed is ignored in receive context types.
686 *
687 * If a context was successfully created, the kernel writes back a handle to the
688 * context, which must be passed in for subsequent operations on that context.
689 *
690 * Limitations:
691 * No more than one iso context can be created per fd.
692 * The total number of contexts that all userspace and kernelspace drivers can
693 * create on a card at a time is a hardware limit, typically 4 or 8 contexts per
694 * direction, and of them at most one multichannel receive context.
695 */
696struct fw_cdev_create_iso_context {
697 __u32 type;
698 __u32 header_size;
699 __u32 channel;
700 __u32 speed;
701 __u64 closure;
702 __u32 handle;
703};
704
705/**
706 * struct fw_cdev_set_iso_channels - Select channels in multichannel reception
707 * @channels: Bitmask of channels to listen to
708 * @handle: Handle of the mutichannel receive context
709 *
710 * @channels is the bitwise or of 1ULL << n for each channel n to listen to.
711 *
712 * The ioctl fails with errno %EBUSY if there is already another receive context
713 * on a channel in @channels. In that case, the bitmask of all unoccupied
714 * channels is returned in @channels.
715 */
716struct fw_cdev_set_iso_channels {
717 __u64 channels;
718 __u32 handle;
719};
720
721#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
722#define FW_CDEV_ISO_INTERRUPT (1 << 16)
723#define FW_CDEV_ISO_SKIP (1 << 17)
724#define FW_CDEV_ISO_SYNC (1 << 17)
725#define FW_CDEV_ISO_TAG(v) ((v) << 18)
726#define FW_CDEV_ISO_SY(v) ((v) << 20)
727#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
728
729/**
730 * struct fw_cdev_iso_packet - Isochronous packet
731 * @control: Contains the header length (8 uppermost bits),
732 * the sy field (4 bits), the tag field (2 bits), a sync flag
733 * or a skip flag (1 bit), an interrupt flag (1 bit), and the
734 * payload length (16 lowermost bits)
735 * @header: Header and payload in case of a transmit context.
736 *
737 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
738 * Use the FW_CDEV_ISO_ macros to fill in @control.
739 * The @header array is empty in case of receive contexts.
740 *
741 * Context type %FW_CDEV_ISO_CONTEXT_TRANSMIT:
742 *
743 * @control.HEADER_LENGTH must be a multiple of 4. It specifies the numbers of
744 * bytes in @header that will be prepended to the packet's payload. These bytes
745 * are copied into the kernel and will not be accessed after the ioctl has
746 * returned.
747 *
748 * The @control.SY and TAG fields are copied to the iso packet header. These
749 * fields are specified by IEEE 1394a and IEC 61883-1.
750 *
751 * The @control.SKIP flag specifies that no packet is to be sent in a frame.
752 * When using this, all other fields except @control.INTERRUPT must be zero.
753 *
754 * When a packet with the @control.INTERRUPT flag set has been completed, an
755 * &fw_cdev_event_iso_interrupt event will be sent.
756 *
757 * Context type %FW_CDEV_ISO_CONTEXT_RECEIVE:
758 *
759 * @control.HEADER_LENGTH must be a multiple of the context's header_size.
760 * If the HEADER_LENGTH is larger than the context's header_size, multiple
761 * packets are queued for this entry.
762 *
763 * The @control.SY and TAG fields are ignored.
764 *
765 * If the @control.SYNC flag is set, the context drops all packets until a
766 * packet with a sy field is received which matches &fw_cdev_start_iso.sync.
767 *
768 * @control.PAYLOAD_LENGTH defines how many payload bytes can be received for
769 * one packet (in addition to payload quadlets that have been defined as headers
770 * and are stripped and returned in the &fw_cdev_event_iso_interrupt structure).
771 * If more bytes are received, the additional bytes are dropped. If less bytes
772 * are received, the remaining bytes in this part of the payload buffer will not
773 * be written to, not even by the next packet. I.e., packets received in
774 * consecutive frames will not necessarily be consecutive in memory. If an
775 * entry has queued multiple packets, the PAYLOAD_LENGTH is divided equally
776 * among them.
777 *
778 * When a packet with the @control.INTERRUPT flag set has been completed, an
779 * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued
780 * multiple receive packets is completed when its last packet is completed.
781 *
782 * Context type %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
783 *
784 * Here, &fw_cdev_iso_packet would be more aptly named _iso_buffer_chunk since
785 * it specifies a chunk of the mmap()'ed buffer, while the number and alignment
786 * of packets to be placed into the buffer chunk is not known beforehand.
787 *
788 * @control.PAYLOAD_LENGTH is the size of the buffer chunk and specifies room
789 * for header, payload, padding, and trailer bytes of one or more packets.
790 * It must be a multiple of 4.
791 *
792 * @control.HEADER_LENGTH, TAG and SY are ignored. SYNC is treated as described
793 * for single-channel reception.
794 *
795 * When a buffer chunk with the @control.INTERRUPT flag set has been filled
796 * entirely, an &fw_cdev_event_iso_interrupt_mc event will be sent.
797 */
798struct fw_cdev_iso_packet {
799 __u32 control;
800 __u32 header[0];
801};
802
803/**
804 * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
805 * @packets: Userspace pointer to an array of &fw_cdev_iso_packet
806 * @data: Pointer into mmap()'ed payload buffer
807 * @size: Size of the @packets array, in bytes
808 * @handle: Isochronous context handle
809 *
810 * Queue a number of isochronous packets for reception or transmission.
811 * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
812 * which describe how to transmit from or receive into a contiguous region
813 * of a mmap()'ed payload buffer. As part of transmit packet descriptors,
814 * a series of headers can be supplied, which will be prepended to the
815 * payload during DMA.
816 *
817 * The kernel may or may not queue all packets, but will write back updated
818 * values of the @packets, @data and @size fields, so the ioctl can be
819 * resubmitted easily.
820 *
821 * In case of a multichannel receive context, @data must be quadlet-aligned
822 * relative to the buffer start.
823 */
824struct fw_cdev_queue_iso {
825 __u64 packets;
826 __u64 data;
827 __u32 size;
828 __u32 handle;
829};
830
831#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
832#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
833#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
834#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
835#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
836
837/**
838 * struct fw_cdev_start_iso - Start an isochronous transmission or reception
839 * @cycle: Cycle in which to start I/O. If @cycle is greater than or
840 * equal to 0, the I/O will start on that cycle.
841 * @sync: Determines the value to wait for for receive packets that have
842 * the %FW_CDEV_ISO_SYNC bit set
843 * @tags: Tag filter bit mask. Only valid for isochronous reception.
844 * Determines the tag values for which packets will be accepted.
845 * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
846 * @handle: Isochronous context handle within which to transmit or receive
847 */
848struct fw_cdev_start_iso {
849 __s32 cycle;
850 __u32 sync;
851 __u32 tags;
852 __u32 handle;
853};
854
855/**
856 * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
857 * @handle: Handle of isochronous context to stop
858 */
859struct fw_cdev_stop_iso {
860 __u32 handle;
861};
862
863/**
864 * struct fw_cdev_flush_iso - flush completed iso packets
865 * @handle: handle of isochronous context to flush
866 *
867 * For %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE contexts,
868 * report any completed packets.
869 *
870 * For %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL contexts, report the current
871 * offset in the receive buffer, if it has changed; this is typically in the
872 * middle of some buffer chunk.
873 *
874 * Any %FW_CDEV_EVENT_ISO_INTERRUPT or %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
875 * events generated by this ioctl are sent synchronously, i.e., are available
876 * for reading from the file descriptor when this ioctl returns.
877 */
878struct fw_cdev_flush_iso {
879 __u32 handle;
880};
881
882/**
883 * struct fw_cdev_get_cycle_timer - read cycle timer register
884 * @local_time: system time, in microseconds since the Epoch
885 * @cycle_timer: Cycle Time register contents
886 *
887 * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME
888 * and only with microseconds resolution.
889 *
890 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
891 * monotonic) @cycle_timer values on certain controllers.
892 */
893struct fw_cdev_get_cycle_timer {
894 __u64 local_time;
895 __u32 cycle_timer;
896};
897
898/**
899 * struct fw_cdev_get_cycle_timer2 - read cycle timer register
900 * @tv_sec: system time, seconds
901 * @tv_nsec: system time, sub-seconds part in nanoseconds
902 * @clk_id: input parameter, clock from which to get the system time
903 * @cycle_timer: Cycle Time register contents
904 *
905 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer
906 * and also the system clock. This allows to correlate reception time of
907 * isochronous packets with system time.
908 *
909 * @clk_id lets you choose a clock like with POSIX' clock_gettime function.
910 * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC
911 * and Linux' %CLOCK_MONOTONIC_RAW.
912 *
913 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
914 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
915 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
916 */
917struct fw_cdev_get_cycle_timer2 {
918 __s64 tv_sec;
919 __s32 tv_nsec;
920 __s32 clk_id;
921 __u32 cycle_timer;
922};
923
924/**
925 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
926 * @closure: Passed back to userspace in corresponding iso resource events
927 * @channels: Isochronous channels of which one is to be (de)allocated
928 * @bandwidth: Isochronous bandwidth units to be (de)allocated
929 * @handle: Handle to the allocation, written by the kernel (only valid in
930 * case of %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctls)
931 *
932 * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE ioctl initiates allocation of an
933 * isochronous channel and/or of isochronous bandwidth at the isochronous
934 * resource manager (IRM). Only one of the channels specified in @channels is
935 * allocated. An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED is sent after
936 * communication with the IRM, indicating success or failure in the event data.
937 * The kernel will automatically reallocate the resources after bus resets.
938 * Should a reallocation fail, an %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event
939 * will be sent. The kernel will also automatically deallocate the resources
940 * when the file descriptor is closed.
941 *
942 * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE ioctl can be used to initiate
943 * deallocation of resources which were allocated as described above.
944 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
945 *
946 * The %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE ioctl is a variant of allocation
947 * without automatic re- or deallocation.
948 * An %FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED event concludes this operation,
949 * indicating success or failure in its data.
950 *
951 * The %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE ioctl works like
952 * %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE except that resources are freed
953 * instead of allocated.
954 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
955 *
956 * To summarize, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE allocates iso resources
957 * for the lifetime of the fd or @handle.
958 * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources
959 * for the duration of a bus generation.
960 *
961 * @channels is a host-endian bitfield with the least significant bit
962 * representing channel 0 and the most significant bit representing channel 63:
963 * 1ULL << c for each channel c that is a candidate for (de)allocation.
964 *
965 * @bandwidth is expressed in bandwidth allocation units, i.e. the time to send
966 * one quadlet of data (payload or header data) at speed S1600.
967 */
968struct fw_cdev_allocate_iso_resource {
969 __u64 closure;
970 __u64 channels;
971 __u32 bandwidth;
972 __u32 handle;
973};
974
975/**
976 * struct fw_cdev_send_stream_packet - send an asynchronous stream packet
977 * @length: Length of outgoing payload, in bytes
978 * @tag: Data format tag
979 * @channel: Isochronous channel to transmit to
980 * @sy: Synchronization code
981 * @closure: Passed back to userspace in the response event
982 * @data: Userspace pointer to payload
983 * @generation: The bus generation where packet is valid
984 * @speed: Speed to transmit at
985 *
986 * The %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl sends an asynchronous stream packet
987 * to every device which is listening to the specified channel. The kernel
988 * writes an &fw_cdev_event_response event which indicates success or failure of
989 * the transmission.
990 */
991struct fw_cdev_send_stream_packet {
992 __u32 length;
993 __u32 tag;
994 __u32 channel;
995 __u32 sy;
996 __u64 closure;
997 __u64 data;
998 __u32 generation;
999 __u32 speed;
1000};
1001
1002/**
1003 * struct fw_cdev_send_phy_packet - send a PHY packet
1004 * @closure: Passed back to userspace in the PHY-packet-sent event
1005 * @data: First and second quadlet of the PHY packet
1006 * @generation: The bus generation where packet is valid
1007 *
1008 * The %FW_CDEV_IOC_SEND_PHY_PACKET ioctl sends a PHY packet to all nodes
1009 * on the same card as this device. After transmission, an
1010 * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated.
1011 *
1012 * The payload @data[] shall be specified in host byte order. Usually,
1013 * @data[1] needs to be the bitwise inverse of @data[0]. VersaPHY packets
1014 * are an exception to this rule.
1015 *
1016 * The ioctl is only permitted on device files which represent a local node.
1017 */
1018struct fw_cdev_send_phy_packet {
1019 __u64 closure;
1020 __u32 data[2];
1021 __u32 generation;
1022};
1023
1024/**
1025 * struct fw_cdev_receive_phy_packets - start reception of PHY packets
1026 * @closure: Passed back to userspace in phy packet events
1027 *
1028 * This ioctl activates issuing of %FW_CDEV_EVENT_PHY_PACKET_RECEIVED due to
1029 * incoming PHY packets from any node on the same bus as the device.
1030 *
1031 * The ioctl is only permitted on device files which represent a local node.
1032 */
1033struct fw_cdev_receive_phy_packets {
1034 __u64 closure;
1035};
1036
1037#define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */
1038
1039#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/include/linux/firewire-constants.h b/include/linux/firewire-constants.h
deleted file mode 100644
index 9b4bb5fbba4b..000000000000
--- a/include/linux/firewire-constants.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * IEEE 1394 constants.
3 *
4 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef _LINUX_FIREWIRE_CONSTANTS_H
27#define _LINUX_FIREWIRE_CONSTANTS_H
28
29#define TCODE_WRITE_QUADLET_REQUEST 0x0
30#define TCODE_WRITE_BLOCK_REQUEST 0x1
31#define TCODE_WRITE_RESPONSE 0x2
32#define TCODE_READ_QUADLET_REQUEST 0x4
33#define TCODE_READ_BLOCK_REQUEST 0x5
34#define TCODE_READ_QUADLET_RESPONSE 0x6
35#define TCODE_READ_BLOCK_RESPONSE 0x7
36#define TCODE_CYCLE_START 0x8
37#define TCODE_LOCK_REQUEST 0x9
38#define TCODE_STREAM_DATA 0xa
39#define TCODE_LOCK_RESPONSE 0xb
40
41#define EXTCODE_MASK_SWAP 0x1
42#define EXTCODE_COMPARE_SWAP 0x2
43#define EXTCODE_FETCH_ADD 0x3
44#define EXTCODE_LITTLE_ADD 0x4
45#define EXTCODE_BOUNDED_ADD 0x5
46#define EXTCODE_WRAP_ADD 0x6
47#define EXTCODE_VENDOR_DEPENDENT 0x7
48
49/* Linux firewire-core (Juju) specific tcodes */
50#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP)
51#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP)
52#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD)
53#define TCODE_LOCK_LITTLE_ADD (0x10 | EXTCODE_LITTLE_ADD)
54#define TCODE_LOCK_BOUNDED_ADD (0x10 | EXTCODE_BOUNDED_ADD)
55#define TCODE_LOCK_WRAP_ADD (0x10 | EXTCODE_WRAP_ADD)
56#define TCODE_LOCK_VENDOR_DEPENDENT (0x10 | EXTCODE_VENDOR_DEPENDENT)
57
58#define RCODE_COMPLETE 0x0
59#define RCODE_CONFLICT_ERROR 0x4
60#define RCODE_DATA_ERROR 0x5
61#define RCODE_TYPE_ERROR 0x6
62#define RCODE_ADDRESS_ERROR 0x7
63
64/* Linux firewire-core (Juju) specific rcodes */
65#define RCODE_SEND_ERROR 0x10
66#define RCODE_CANCELLED 0x11
67#define RCODE_BUSY 0x12
68#define RCODE_GENERATION 0x13
69#define RCODE_NO_ACK 0x14
70
71#define SCODE_100 0x0
72#define SCODE_200 0x1
73#define SCODE_400 0x2
74#define SCODE_800 0x3
75#define SCODE_1600 0x4
76#define SCODE_3200 0x5
77#define SCODE_BETA 0x3
78
79#define ACK_COMPLETE 0x1
80#define ACK_PENDING 0x2
81#define ACK_BUSY_X 0x4
82#define ACK_BUSY_A 0x5
83#define ACK_BUSY_B 0x6
84#define ACK_DATA_ERROR 0xd
85#define ACK_TYPE_ERROR 0xe
86
87#define RETRY_1 0x00
88#define RETRY_X 0x01
89#define RETRY_A 0x02
90#define RETRY_B 0x03
91
92#endif /* _LINUX_FIREWIRE_CONSTANTS_H */
diff --git a/include/linux/flat.h b/include/linux/flat.h
index ec56852e2659..2c1eb15c4ba4 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 8cb86cfc9719..001c7cff2d48 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1,337 +1,6 @@
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
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#ifdef __KERNEL__
335 4
336#include <linux/linkage.h> 5#include <linux/linkage.h>
337#include <linux/wait.h> 6#include <linux/wait.h>
@@ -360,6 +29,7 @@ struct inodes_stat_t {
360#include <linux/blk_types.h> 29#include <linux/blk_types.h>
361 30
362#include <asm/byteorder.h> 31#include <asm/byteorder.h>
32#include <uapi/linux/fs.h>
363 33
364struct export_operations; 34struct export_operations;
365struct hd_geometry; 35struct hd_geometry;
@@ -2876,5 +2546,4 @@ static inline void inode_has_no_xattr(struct inode *inode)
2876 inode->i_flags |= S_NOSEC; 2546 inode->i_flags |= S_NOSEC;
2877} 2547}
2878 2548
2879#endif /* __KERNEL__ */
2880#endif /* _LINUX_FS_H */ 2549#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsl_hypervisor.h b/include/linux/fsl_hypervisor.h
index 1cebaeeeef57..2a707d7fb32c 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/fuse.h b/include/linux/fuse.h
deleted file mode 100644
index d8c713e148e3..000000000000
--- a/include/linux/fuse.h
+++ /dev/null
@@ -1,677 +0,0 @@
1/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
9/*
10 * This file defines the kernel interface of FUSE
11 *
12 * Protocol changelog:
13 *
14 * 7.9:
15 * - new fuse_getattr_in input argument of GETATTR
16 * - add lk_flags in fuse_lk_in
17 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
18 * - add blksize field to fuse_attr
19 * - add file flags field to fuse_read_in and fuse_write_in
20 *
21 * 7.10
22 * - add nonseekable open flag
23 *
24 * 7.11
25 * - add IOCTL message
26 * - add unsolicited notification support
27 * - add POLL message and NOTIFY_POLL notification
28 *
29 * 7.12
30 * - add umask flag to input argument of open, mknod and mkdir
31 * - add notification messages for invalidation of inodes and
32 * directory entries
33 *
34 * 7.13
35 * - make max number of background requests and congestion threshold
36 * tunables
37 *
38 * 7.14
39 * - add splice support to fuse device
40 *
41 * 7.15
42 * - add store notify
43 * - add retrieve notify
44 *
45 * 7.16
46 * - add BATCH_FORGET request
47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
49 * - add FUSE_IOCTL_32BIT flag
50 *
51 * 7.17
52 * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
53 *
54 * 7.18
55 * - add FUSE_IOCTL_DIR flag
56 * - add FUSE_NOTIFY_DELETE
57 *
58 * 7.19
59 * - add FUSE_FALLOCATE
60 *
61 * 7.20
62 * - add FUSE_AUTO_INVAL_DATA
63 */
64
65#ifndef _LINUX_FUSE_H
66#define _LINUX_FUSE_H
67
68#include <linux/types.h>
69
70/*
71 * Version negotiation:
72 *
73 * Both the kernel and userspace send the version they support in the
74 * INIT request and reply respectively.
75 *
76 * If the major versions match then both shall use the smallest
77 * of the two minor versions for communication.
78 *
79 * If the kernel supports a larger major version, then userspace shall
80 * reply with the major version it supports, ignore the rest of the
81 * INIT message and expect a new INIT message from the kernel with a
82 * matching major version.
83 *
84 * If the library supports a larger major version, then it shall fall
85 * back to the major protocol version sent by the kernel for
86 * communication and reply with that major version (and an arbitrary
87 * supported minor version).
88 */
89
90/** Version number of this interface */
91#define FUSE_KERNEL_VERSION 7
92
93/** Minor version number of this interface */
94#define FUSE_KERNEL_MINOR_VERSION 20
95
96/** The node ID of the root inode */
97#define FUSE_ROOT_ID 1
98
99/* Make sure all structures are padded to 64bit boundary, so 32bit
100 userspace works under 64bit kernels */
101
102struct fuse_attr {
103 __u64 ino;
104 __u64 size;
105 __u64 blocks;
106 __u64 atime;
107 __u64 mtime;
108 __u64 ctime;
109 __u32 atimensec;
110 __u32 mtimensec;
111 __u32 ctimensec;
112 __u32 mode;
113 __u32 nlink;
114 __u32 uid;
115 __u32 gid;
116 __u32 rdev;
117 __u32 blksize;
118 __u32 padding;
119};
120
121struct fuse_kstatfs {
122 __u64 blocks;
123 __u64 bfree;
124 __u64 bavail;
125 __u64 files;
126 __u64 ffree;
127 __u32 bsize;
128 __u32 namelen;
129 __u32 frsize;
130 __u32 padding;
131 __u32 spare[6];
132};
133
134struct fuse_file_lock {
135 __u64 start;
136 __u64 end;
137 __u32 type;
138 __u32 pid; /* tgid */
139};
140
141/**
142 * Bitmasks for fuse_setattr_in.valid
143 */
144#define FATTR_MODE (1 << 0)
145#define FATTR_UID (1 << 1)
146#define FATTR_GID (1 << 2)
147#define FATTR_SIZE (1 << 3)
148#define FATTR_ATIME (1 << 4)
149#define FATTR_MTIME (1 << 5)
150#define FATTR_FH (1 << 6)
151#define FATTR_ATIME_NOW (1 << 7)
152#define FATTR_MTIME_NOW (1 << 8)
153#define FATTR_LOCKOWNER (1 << 9)
154
155/**
156 * Flags returned by the OPEN request
157 *
158 * FOPEN_DIRECT_IO: bypass page cache for this open file
159 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
160 * FOPEN_NONSEEKABLE: the file is not seekable
161 */
162#define FOPEN_DIRECT_IO (1 << 0)
163#define FOPEN_KEEP_CACHE (1 << 1)
164#define FOPEN_NONSEEKABLE (1 << 2)
165
166/**
167 * INIT request/reply flags
168 *
169 * FUSE_ASYNC_READ: asynchronous read requests
170 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
171 * FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
172 * FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem
173 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
174 * FUSE_BIG_WRITES: filesystem can handle write size larger than 4kB
175 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
176 * FUSE_SPLICE_WRITE: kernel supports splice write on the device
177 * FUSE_SPLICE_MOVE: kernel supports splice move on the device
178 * FUSE_SPLICE_READ: kernel supports splice read on the device
179 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
180 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
181 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
182 */
183#define FUSE_ASYNC_READ (1 << 0)
184#define FUSE_POSIX_LOCKS (1 << 1)
185#define FUSE_FILE_OPS (1 << 2)
186#define FUSE_ATOMIC_O_TRUNC (1 << 3)
187#define FUSE_EXPORT_SUPPORT (1 << 4)
188#define FUSE_BIG_WRITES (1 << 5)
189#define FUSE_DONT_MASK (1 << 6)
190#define FUSE_SPLICE_WRITE (1 << 7)
191#define FUSE_SPLICE_MOVE (1 << 8)
192#define FUSE_SPLICE_READ (1 << 9)
193#define FUSE_FLOCK_LOCKS (1 << 10)
194#define FUSE_HAS_IOCTL_DIR (1 << 11)
195#define FUSE_AUTO_INVAL_DATA (1 << 12)
196
197/**
198 * CUSE INIT request/reply flags
199 *
200 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
201 */
202#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
203
204/**
205 * Release flags
206 */
207#define FUSE_RELEASE_FLUSH (1 << 0)
208#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
209
210/**
211 * Getattr flags
212 */
213#define FUSE_GETATTR_FH (1 << 0)
214
215/**
216 * Lock flags
217 */
218#define FUSE_LK_FLOCK (1 << 0)
219
220/**
221 * WRITE flags
222 *
223 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
224 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
225 */
226#define FUSE_WRITE_CACHE (1 << 0)
227#define FUSE_WRITE_LOCKOWNER (1 << 1)
228
229/**
230 * Read flags
231 */
232#define FUSE_READ_LOCKOWNER (1 << 1)
233
234/**
235 * Ioctl flags
236 *
237 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
238 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
239 * FUSE_IOCTL_RETRY: retry with new iovecs
240 * FUSE_IOCTL_32BIT: 32bit ioctl
241 * FUSE_IOCTL_DIR: is a directory
242 *
243 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
244 */
245#define FUSE_IOCTL_COMPAT (1 << 0)
246#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
247#define FUSE_IOCTL_RETRY (1 << 2)
248#define FUSE_IOCTL_32BIT (1 << 3)
249#define FUSE_IOCTL_DIR (1 << 4)
250
251#define FUSE_IOCTL_MAX_IOV 256
252
253/**
254 * Poll flags
255 *
256 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
257 */
258#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
259
260enum fuse_opcode {
261 FUSE_LOOKUP = 1,
262 FUSE_FORGET = 2, /* no reply */
263 FUSE_GETATTR = 3,
264 FUSE_SETATTR = 4,
265 FUSE_READLINK = 5,
266 FUSE_SYMLINK = 6,
267 FUSE_MKNOD = 8,
268 FUSE_MKDIR = 9,
269 FUSE_UNLINK = 10,
270 FUSE_RMDIR = 11,
271 FUSE_RENAME = 12,
272 FUSE_LINK = 13,
273 FUSE_OPEN = 14,
274 FUSE_READ = 15,
275 FUSE_WRITE = 16,
276 FUSE_STATFS = 17,
277 FUSE_RELEASE = 18,
278 FUSE_FSYNC = 20,
279 FUSE_SETXATTR = 21,
280 FUSE_GETXATTR = 22,
281 FUSE_LISTXATTR = 23,
282 FUSE_REMOVEXATTR = 24,
283 FUSE_FLUSH = 25,
284 FUSE_INIT = 26,
285 FUSE_OPENDIR = 27,
286 FUSE_READDIR = 28,
287 FUSE_RELEASEDIR = 29,
288 FUSE_FSYNCDIR = 30,
289 FUSE_GETLK = 31,
290 FUSE_SETLK = 32,
291 FUSE_SETLKW = 33,
292 FUSE_ACCESS = 34,
293 FUSE_CREATE = 35,
294 FUSE_INTERRUPT = 36,
295 FUSE_BMAP = 37,
296 FUSE_DESTROY = 38,
297 FUSE_IOCTL = 39,
298 FUSE_POLL = 40,
299 FUSE_NOTIFY_REPLY = 41,
300 FUSE_BATCH_FORGET = 42,
301 FUSE_FALLOCATE = 43,
302
303 /* CUSE specific operations */
304 CUSE_INIT = 4096,
305};
306
307enum fuse_notify_code {
308 FUSE_NOTIFY_POLL = 1,
309 FUSE_NOTIFY_INVAL_INODE = 2,
310 FUSE_NOTIFY_INVAL_ENTRY = 3,
311 FUSE_NOTIFY_STORE = 4,
312 FUSE_NOTIFY_RETRIEVE = 5,
313 FUSE_NOTIFY_DELETE = 6,
314 FUSE_NOTIFY_CODE_MAX,
315};
316
317/* The read buffer is required to be at least 8k, but may be much larger */
318#define FUSE_MIN_READ_BUFFER 8192
319
320#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
321
322struct fuse_entry_out {
323 __u64 nodeid; /* Inode ID */
324 __u64 generation; /* Inode generation: nodeid:gen must
325 be unique for the fs's lifetime */
326 __u64 entry_valid; /* Cache timeout for the name */
327 __u64 attr_valid; /* Cache timeout for the attributes */
328 __u32 entry_valid_nsec;
329 __u32 attr_valid_nsec;
330 struct fuse_attr attr;
331};
332
333struct fuse_forget_in {
334 __u64 nlookup;
335};
336
337struct fuse_forget_one {
338 __u64 nodeid;
339 __u64 nlookup;
340};
341
342struct fuse_batch_forget_in {
343 __u32 count;
344 __u32 dummy;
345};
346
347struct fuse_getattr_in {
348 __u32 getattr_flags;
349 __u32 dummy;
350 __u64 fh;
351};
352
353#define FUSE_COMPAT_ATTR_OUT_SIZE 96
354
355struct fuse_attr_out {
356 __u64 attr_valid; /* Cache timeout for the attributes */
357 __u32 attr_valid_nsec;
358 __u32 dummy;
359 struct fuse_attr attr;
360};
361
362#define FUSE_COMPAT_MKNOD_IN_SIZE 8
363
364struct fuse_mknod_in {
365 __u32 mode;
366 __u32 rdev;
367 __u32 umask;
368 __u32 padding;
369};
370
371struct fuse_mkdir_in {
372 __u32 mode;
373 __u32 umask;
374};
375
376struct fuse_rename_in {
377 __u64 newdir;
378};
379
380struct fuse_link_in {
381 __u64 oldnodeid;
382};
383
384struct fuse_setattr_in {
385 __u32 valid;
386 __u32 padding;
387 __u64 fh;
388 __u64 size;
389 __u64 lock_owner;
390 __u64 atime;
391 __u64 mtime;
392 __u64 unused2;
393 __u32 atimensec;
394 __u32 mtimensec;
395 __u32 unused3;
396 __u32 mode;
397 __u32 unused4;
398 __u32 uid;
399 __u32 gid;
400 __u32 unused5;
401};
402
403struct fuse_open_in {
404 __u32 flags;
405 __u32 unused;
406};
407
408struct fuse_create_in {
409 __u32 flags;
410 __u32 mode;
411 __u32 umask;
412 __u32 padding;
413};
414
415struct fuse_open_out {
416 __u64 fh;
417 __u32 open_flags;
418 __u32 padding;
419};
420
421struct fuse_release_in {
422 __u64 fh;
423 __u32 flags;
424 __u32 release_flags;
425 __u64 lock_owner;
426};
427
428struct fuse_flush_in {
429 __u64 fh;
430 __u32 unused;
431 __u32 padding;
432 __u64 lock_owner;
433};
434
435struct fuse_read_in {
436 __u64 fh;
437 __u64 offset;
438 __u32 size;
439 __u32 read_flags;
440 __u64 lock_owner;
441 __u32 flags;
442 __u32 padding;
443};
444
445#define FUSE_COMPAT_WRITE_IN_SIZE 24
446
447struct fuse_write_in {
448 __u64 fh;
449 __u64 offset;
450 __u32 size;
451 __u32 write_flags;
452 __u64 lock_owner;
453 __u32 flags;
454 __u32 padding;
455};
456
457struct fuse_write_out {
458 __u32 size;
459 __u32 padding;
460};
461
462#define FUSE_COMPAT_STATFS_SIZE 48
463
464struct fuse_statfs_out {
465 struct fuse_kstatfs st;
466};
467
468struct fuse_fsync_in {
469 __u64 fh;
470 __u32 fsync_flags;
471 __u32 padding;
472};
473
474struct fuse_setxattr_in {
475 __u32 size;
476 __u32 flags;
477};
478
479struct fuse_getxattr_in {
480 __u32 size;
481 __u32 padding;
482};
483
484struct fuse_getxattr_out {
485 __u32 size;
486 __u32 padding;
487};
488
489struct fuse_lk_in {
490 __u64 fh;
491 __u64 owner;
492 struct fuse_file_lock lk;
493 __u32 lk_flags;
494 __u32 padding;
495};
496
497struct fuse_lk_out {
498 struct fuse_file_lock lk;
499};
500
501struct fuse_access_in {
502 __u32 mask;
503 __u32 padding;
504};
505
506struct fuse_init_in {
507 __u32 major;
508 __u32 minor;
509 __u32 max_readahead;
510 __u32 flags;
511};
512
513struct fuse_init_out {
514 __u32 major;
515 __u32 minor;
516 __u32 max_readahead;
517 __u32 flags;
518 __u16 max_background;
519 __u16 congestion_threshold;
520 __u32 max_write;
521};
522
523#define CUSE_INIT_INFO_MAX 4096
524
525struct cuse_init_in {
526 __u32 major;
527 __u32 minor;
528 __u32 unused;
529 __u32 flags;
530};
531
532struct cuse_init_out {
533 __u32 major;
534 __u32 minor;
535 __u32 unused;
536 __u32 flags;
537 __u32 max_read;
538 __u32 max_write;
539 __u32 dev_major; /* chardev major */
540 __u32 dev_minor; /* chardev minor */
541 __u32 spare[10];
542};
543
544struct fuse_interrupt_in {
545 __u64 unique;
546};
547
548struct fuse_bmap_in {
549 __u64 block;
550 __u32 blocksize;
551 __u32 padding;
552};
553
554struct fuse_bmap_out {
555 __u64 block;
556};
557
558struct fuse_ioctl_in {
559 __u64 fh;
560 __u32 flags;
561 __u32 cmd;
562 __u64 arg;
563 __u32 in_size;
564 __u32 out_size;
565};
566
567struct fuse_ioctl_iovec {
568 __u64 base;
569 __u64 len;
570};
571
572struct fuse_ioctl_out {
573 __s32 result;
574 __u32 flags;
575 __u32 in_iovs;
576 __u32 out_iovs;
577};
578
579struct fuse_poll_in {
580 __u64 fh;
581 __u64 kh;
582 __u32 flags;
583 __u32 padding;
584};
585
586struct fuse_poll_out {
587 __u32 revents;
588 __u32 padding;
589};
590
591struct fuse_notify_poll_wakeup_out {
592 __u64 kh;
593};
594
595struct fuse_fallocate_in {
596 __u64 fh;
597 __u64 offset;
598 __u64 length;
599 __u32 mode;
600 __u32 padding;
601};
602
603struct fuse_in_header {
604 __u32 len;
605 __u32 opcode;
606 __u64 unique;
607 __u64 nodeid;
608 __u32 uid;
609 __u32 gid;
610 __u32 pid;
611 __u32 padding;
612};
613
614struct fuse_out_header {
615 __u32 len;
616 __s32 error;
617 __u64 unique;
618};
619
620struct fuse_dirent {
621 __u64 ino;
622 __u64 off;
623 __u32 namelen;
624 __u32 type;
625 char name[];
626};
627
628#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
629#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
630#define FUSE_DIRENT_SIZE(d) \
631 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
632
633struct fuse_notify_inval_inode_out {
634 __u64 ino;
635 __s64 off;
636 __s64 len;
637};
638
639struct fuse_notify_inval_entry_out {
640 __u64 parent;
641 __u32 namelen;
642 __u32 padding;
643};
644
645struct fuse_notify_delete_out {
646 __u64 parent;
647 __u64 child;
648 __u32 namelen;
649 __u32 padding;
650};
651
652struct fuse_notify_store_out {
653 __u64 nodeid;
654 __u64 offset;
655 __u32 size;
656 __u32 padding;
657};
658
659struct fuse_notify_retrieve_out {
660 __u64 notify_unique;
661 __u64 nodeid;
662 __u64 offset;
663 __u32 size;
664 __u32 padding;
665};
666
667/* Matches the size of fuse_write_in */
668struct fuse_notify_retrieve_in {
669 __u64 dummy1;
670 __u64 offset;
671 __u32 size;
672 __u32 dummy2;
673 __u64 dummy3;
674 __u64 dummy4;
675};
676
677#endif /* _LINUX_FUSE_H */
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 1e5a26d79232..b0d95cac826e 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 b986be513406..bb7de09e8d57 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/gen_stats.h b/include/linux/gen_stats.h
deleted file mode 100644
index 552c8a0a12d1..000000000000
--- a/include/linux/gen_stats.h
+++ /dev/null
@@ -1,67 +0,0 @@
1#ifndef __LINUX_GEN_STATS_H
2#define __LINUX_GEN_STATS_H
3
4#include <linux/types.h>
5
6enum {
7 TCA_STATS_UNSPEC,
8 TCA_STATS_BASIC,
9 TCA_STATS_RATE_EST,
10 TCA_STATS_QUEUE,
11 TCA_STATS_APP,
12 __TCA_STATS_MAX,
13};
14#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
15
16/**
17 * struct gnet_stats_basic - byte/packet throughput statistics
18 * @bytes: number of seen bytes
19 * @packets: number of seen packets
20 */
21struct gnet_stats_basic {
22 __u64 bytes;
23 __u32 packets;
24};
25struct gnet_stats_basic_packed {
26 __u64 bytes;
27 __u32 packets;
28} __attribute__ ((packed));
29
30/**
31 * struct gnet_stats_rate_est - rate estimator
32 * @bps: current byte rate
33 * @pps: current packet rate
34 */
35struct gnet_stats_rate_est {
36 __u32 bps;
37 __u32 pps;
38};
39
40/**
41 * struct gnet_stats_queue - queuing statistics
42 * @qlen: queue length
43 * @backlog: backlog size of queue
44 * @drops: number of dropped packets
45 * @requeues: number of requeues
46 * @overlimits: number of enqueues over the limit
47 */
48struct gnet_stats_queue {
49 __u32 qlen;
50 __u32 backlog;
51 __u32 drops;
52 __u32 requeues;
53 __u32 overlimits;
54};
55
56/**
57 * struct gnet_estimator - rate estimator configuration
58 * @interval: sampling period
59 * @ewma_log: the log of measurement window weight
60 */
61struct gnet_estimator {
62 signed char interval;
63 unsigned char ewma_log;
64};
65
66
67#endif /* __LINUX_GEN_STATS_H */
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 5ab61c1eb6bf..55b685719d52 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/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
deleted file mode 100644
index b2de1f9a88d6..000000000000
--- a/include/linux/gfs2_ondisk.h
+++ /dev/null
@@ -1,464 +0,0 @@
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License v.2.
8 */
9
10#ifndef __GFS2_ONDISK_DOT_H__
11#define __GFS2_ONDISK_DOT_H__
12
13#include <linux/types.h>
14
15#define GFS2_MAGIC 0x01161970
16#define GFS2_BASIC_BLOCK 512
17#define GFS2_BASIC_BLOCK_SHIFT 9
18
19/* Lock numbers of the LM_TYPE_NONDISK type */
20
21#define GFS2_MOUNT_LOCK 0
22#define GFS2_LIVE_LOCK 1
23#define GFS2_TRANS_LOCK 2
24#define GFS2_RENAME_LOCK 3
25#define GFS2_CONTROL_LOCK 4
26#define GFS2_MOUNTED_LOCK 5
27
28/* Format numbers for various metadata types */
29
30#define GFS2_FORMAT_NONE 0
31#define GFS2_FORMAT_SB 100
32#define GFS2_FORMAT_RG 200
33#define GFS2_FORMAT_RB 300
34#define GFS2_FORMAT_DI 400
35#define GFS2_FORMAT_IN 500
36#define GFS2_FORMAT_LF 600
37#define GFS2_FORMAT_JD 700
38#define GFS2_FORMAT_LH 800
39#define GFS2_FORMAT_LD 900
40#define GFS2_FORMAT_LB 1000
41#define GFS2_FORMAT_EA 1600
42#define GFS2_FORMAT_ED 1700
43#define GFS2_FORMAT_QC 1400
44/* These are format numbers for entities contained in files */
45#define GFS2_FORMAT_RI 1100
46#define GFS2_FORMAT_DE 1200
47#define GFS2_FORMAT_QU 1500
48/* These are part of the superblock */
49#define GFS2_FORMAT_FS 1801
50#define GFS2_FORMAT_MULTI 1900
51
52/*
53 * An on-disk inode number
54 */
55
56struct gfs2_inum {
57 __be64 no_formal_ino;
58 __be64 no_addr;
59};
60
61/*
62 * Generic metadata head structure
63 * Every inplace buffer logged in the journal must start with this.
64 */
65
66#define GFS2_METATYPE_NONE 0
67#define GFS2_METATYPE_SB 1
68#define GFS2_METATYPE_RG 2
69#define GFS2_METATYPE_RB 3
70#define GFS2_METATYPE_DI 4
71#define GFS2_METATYPE_IN 5
72#define GFS2_METATYPE_LF 6
73#define GFS2_METATYPE_JD 7
74#define GFS2_METATYPE_LH 8
75#define GFS2_METATYPE_LD 9
76#define GFS2_METATYPE_LB 12
77#define GFS2_METATYPE_EA 10
78#define GFS2_METATYPE_ED 11
79#define GFS2_METATYPE_QC 14
80
81struct gfs2_meta_header {
82 __be32 mh_magic;
83 __be32 mh_type;
84 __be64 __pad0; /* Was generation number in gfs1 */
85 __be32 mh_format;
86 /* This union is to keep userspace happy */
87 union {
88 __be32 mh_jid; /* Was incarnation number in gfs1 */
89 __be32 __pad1;
90 };
91};
92
93/*
94 * super-block structure
95 *
96 * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes)
97 *
98 * Order is important, need to be able to read old superblocks to do on-disk
99 * version upgrades.
100 */
101
102/* Address of superblock in GFS2 basic blocks */
103#define GFS2_SB_ADDR 128
104
105/* The lock number for the superblock (must be zero) */
106#define GFS2_SB_LOCK 0
107
108/* Requirement: GFS2_LOCKNAME_LEN % 8 == 0
109 Includes: the fencing zero at the end */
110#define GFS2_LOCKNAME_LEN 64
111
112struct gfs2_sb {
113 struct gfs2_meta_header sb_header;
114
115 __be32 sb_fs_format;
116 __be32 sb_multihost_format;
117 __u32 __pad0; /* Was superblock flags in gfs1 */
118
119 __be32 sb_bsize;
120 __be32 sb_bsize_shift;
121 __u32 __pad1; /* Was journal segment size in gfs1 */
122
123 struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
124 struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
125 struct gfs2_inum sb_root_dir;
126
127 char sb_lockproto[GFS2_LOCKNAME_LEN];
128 char sb_locktable[GFS2_LOCKNAME_LEN];
129
130 struct gfs2_inum __pad3; /* Was quota inode in gfs1 */
131 struct gfs2_inum __pad4; /* Was licence inode in gfs1 */
132#define GFS2_HAS_UUID 1
133 __u8 sb_uuid[16]; /* The UUID, maybe 0 for backwards compat */
134};
135
136/*
137 * resource index structure
138 */
139
140struct gfs2_rindex {
141 __be64 ri_addr; /* grp block disk address */
142 __be32 ri_length; /* length of rgrp header in fs blocks */
143 __u32 __pad;
144
145 __be64 ri_data0; /* first data location */
146 __be32 ri_data; /* num of data blocks in rgrp */
147
148 __be32 ri_bitbytes; /* number of bytes in data bitmaps */
149
150 __u8 ri_reserved[64];
151};
152
153/*
154 * resource group header structure
155 */
156
157/* Number of blocks per byte in rgrp */
158#define GFS2_NBBY 4
159#define GFS2_BIT_SIZE 2
160#define GFS2_BIT_MASK 0x00000003
161
162#define GFS2_BLKST_FREE 0
163#define GFS2_BLKST_USED 1
164#define GFS2_BLKST_UNLINKED 2
165#define GFS2_BLKST_DINODE 3
166
167#define GFS2_RGF_JOURNAL 0x00000001
168#define GFS2_RGF_METAONLY 0x00000002
169#define GFS2_RGF_DATAONLY 0x00000004
170#define GFS2_RGF_NOALLOC 0x00000008
171#define GFS2_RGF_TRIMMED 0x00000010
172
173struct gfs2_rgrp_lvb {
174 __be32 rl_magic;
175 __be32 rl_flags;
176 __be32 rl_free;
177 __be32 rl_dinodes;
178 __be64 rl_igeneration;
179 __be32 rl_unlinked;
180 __be32 __pad;
181};
182
183struct gfs2_rgrp {
184 struct gfs2_meta_header rg_header;
185
186 __be32 rg_flags;
187 __be32 rg_free;
188 __be32 rg_dinodes;
189 __be32 __pad;
190 __be64 rg_igeneration;
191
192 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
193};
194
195/*
196 * quota structure
197 */
198
199struct gfs2_quota {
200 __be64 qu_limit;
201 __be64 qu_warn;
202 __be64 qu_value;
203 __u8 qu_reserved[64];
204};
205
206/*
207 * dinode structure
208 */
209
210#define GFS2_MAX_META_HEIGHT 10
211#define GFS2_DIR_MAX_DEPTH 17
212
213#define DT2IF(dt) (((dt) << 12) & S_IFMT)
214#define IF2DT(sif) (((sif) & S_IFMT) >> 12)
215
216enum {
217 gfs2fl_Jdata = 0,
218 gfs2fl_ExHash = 1,
219 gfs2fl_Unused = 2,
220 gfs2fl_EaIndirect = 3,
221 gfs2fl_Directio = 4,
222 gfs2fl_Immutable = 5,
223 gfs2fl_AppendOnly = 6,
224 gfs2fl_NoAtime = 7,
225 gfs2fl_Sync = 8,
226 gfs2fl_System = 9,
227 gfs2fl_TopLevel = 10,
228 gfs2fl_TruncInProg = 29,
229 gfs2fl_InheritDirectio = 30,
230 gfs2fl_InheritJdata = 31,
231};
232
233/* Dinode flags */
234#define GFS2_DIF_JDATA 0x00000001
235#define GFS2_DIF_EXHASH 0x00000002
236#define GFS2_DIF_UNUSED 0x00000004 /* only in gfs1 */
237#define GFS2_DIF_EA_INDIRECT 0x00000008
238#define GFS2_DIF_DIRECTIO 0x00000010
239#define GFS2_DIF_IMMUTABLE 0x00000020
240#define GFS2_DIF_APPENDONLY 0x00000040
241#define GFS2_DIF_NOATIME 0x00000080
242#define GFS2_DIF_SYNC 0x00000100
243#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
244#define GFS2_DIF_TOPDIR 0x00000400 /* New in gfs2 */
245#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
246#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 /* only in gfs1 */
247#define GFS2_DIF_INHERIT_JDATA 0x80000000
248
249struct gfs2_dinode {
250 struct gfs2_meta_header di_header;
251
252 struct gfs2_inum di_num;
253
254 __be32 di_mode; /* mode of file */
255 __be32 di_uid; /* owner's user id */
256 __be32 di_gid; /* owner's group id */
257 __be32 di_nlink; /* number of links to this file */
258 __be64 di_size; /* number of bytes in file */
259 __be64 di_blocks; /* number of blocks in file */
260 __be64 di_atime; /* time last accessed */
261 __be64 di_mtime; /* time last modified */
262 __be64 di_ctime; /* time last changed */
263 __be32 di_major; /* device major number */
264 __be32 di_minor; /* device minor number */
265
266 /* This section varies from gfs1. Padding added to align with
267 * remainder of dinode
268 */
269 __be64 di_goal_meta; /* rgrp to alloc from next */
270 __be64 di_goal_data; /* data block goal */
271 __be64 di_generation; /* generation number for NFS */
272
273 __be32 di_flags; /* GFS2_DIF_... */
274 __be32 di_payload_format; /* GFS2_FORMAT_... */
275 __u16 __pad1; /* Was ditype in gfs1 */
276 __be16 di_height; /* height of metadata */
277 __u32 __pad2; /* Unused incarnation number from gfs1 */
278
279 /* These only apply to directories */
280 __u16 __pad3; /* Padding */
281 __be16 di_depth; /* Number of bits in the table */
282 __be32 di_entries; /* The number of entries in the directory */
283
284 struct gfs2_inum __pad4; /* Unused even in current gfs1 */
285
286 __be64 di_eattr; /* extended attribute block number */
287 __be32 di_atime_nsec; /* nsec portion of atime */
288 __be32 di_mtime_nsec; /* nsec portion of mtime */
289 __be32 di_ctime_nsec; /* nsec portion of ctime */
290
291 __u8 di_reserved[44];
292};
293
294/*
295 * directory structure - many of these per directory file
296 */
297
298#define GFS2_FNAMESIZE 255
299#define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7)
300
301struct gfs2_dirent {
302 struct gfs2_inum de_inum;
303 __be32 de_hash;
304 __be16 de_rec_len;
305 __be16 de_name_len;
306 __be16 de_type;
307 __u8 __pad[14];
308};
309
310/*
311 * Header of leaf directory nodes
312 */
313
314struct gfs2_leaf {
315 struct gfs2_meta_header lf_header;
316
317 __be16 lf_depth; /* Depth of leaf */
318 __be16 lf_entries; /* Number of dirents in leaf */
319 __be32 lf_dirent_format; /* Format of the dirents */
320 __be64 lf_next; /* Next leaf, if overflow */
321
322 __u8 lf_reserved[64];
323};
324
325/*
326 * Extended attribute header format
327 *
328 * This works in a similar way to dirents. There is a fixed size header
329 * followed by a variable length section made up of the name and the
330 * associated data. In the case of a "stuffed" entry, the value is
331 * inline directly after the name, the ea_num_ptrs entry will be
332 * zero in that case. For non-"stuffed" entries, there will be
333 * a set of pointers (aligned to 8 byte boundary) to the block(s)
334 * containing the value.
335 *
336 * The blocks containing the values and the blocks containing the
337 * extended attribute headers themselves all start with the common
338 * metadata header. Each inode, if it has extended attributes, will
339 * have either a single block containing the extended attribute headers
340 * or a single indirect block pointing to blocks containing the
341 * extended attribure headers.
342 *
343 * The maximim size of the data part of an extended attribute is 64k
344 * so the number of blocks required depends upon block size. Since the
345 * block size also determines the number of pointers in an indirect
346 * block, its a fairly complicated calculation to work out the maximum
347 * number of blocks that an inode may have relating to extended attributes.
348 *
349 */
350
351#define GFS2_EA_MAX_NAME_LEN 255
352#define GFS2_EA_MAX_DATA_LEN 65536
353
354#define GFS2_EATYPE_UNUSED 0
355#define GFS2_EATYPE_USR 1
356#define GFS2_EATYPE_SYS 2
357#define GFS2_EATYPE_SECURITY 3
358
359#define GFS2_EATYPE_LAST 3
360#define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
361
362#define GFS2_EAFLAG_LAST 0x01 /* last ea in block */
363
364struct gfs2_ea_header {
365 __be32 ea_rec_len;
366 __be32 ea_data_len;
367 __u8 ea_name_len; /* no NULL pointer after the string */
368 __u8 ea_type; /* GFS2_EATYPE_... */
369 __u8 ea_flags; /* GFS2_EAFLAG_... */
370 __u8 ea_num_ptrs;
371 __u32 __pad;
372};
373
374/*
375 * Log header structure
376 */
377
378#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
379
380struct gfs2_log_header {
381 struct gfs2_meta_header lh_header;
382
383 __be64 lh_sequence; /* Sequence number of this transaction */
384 __be32 lh_flags; /* GFS2_LOG_HEAD_... */
385 __be32 lh_tail; /* Block number of log tail */
386 __be32 lh_blkno;
387 __be32 lh_hash;
388};
389
390/*
391 * Log type descriptor
392 */
393
394#define GFS2_LOG_DESC_METADATA 300
395/* ld_data1 is the number of metadata blocks in the descriptor.
396 ld_data2 is unused. */
397
398#define GFS2_LOG_DESC_REVOKE 301
399/* ld_data1 is the number of revoke blocks in the descriptor.
400 ld_data2 is unused. */
401
402#define GFS2_LOG_DESC_JDATA 302
403/* ld_data1 is the number of data blocks in the descriptor.
404 ld_data2 is unused. */
405
406struct gfs2_log_descriptor {
407 struct gfs2_meta_header ld_header;
408
409 __be32 ld_type; /* GFS2_LOG_DESC_... */
410 __be32 ld_length; /* Number of buffers in this chunk */
411 __be32 ld_data1; /* descriptor-specific field */
412 __be32 ld_data2; /* descriptor-specific field */
413
414 __u8 ld_reserved[32];
415};
416
417/*
418 * Inum Range
419 * Describe a range of formal inode numbers allocated to
420 * one machine to assign to inodes.
421 */
422
423#define GFS2_INUM_QUANTUM 1048576
424
425struct gfs2_inum_range {
426 __be64 ir_start;
427 __be64 ir_length;
428};
429
430/*
431 * Statfs change
432 * Describes an change to the pool of free and allocated
433 * blocks.
434 */
435
436struct gfs2_statfs_change {
437 __be64 sc_total;
438 __be64 sc_free;
439 __be64 sc_dinodes;
440};
441
442/*
443 * Quota change
444 * Describes an allocation change for a particular
445 * user or group.
446 */
447
448#define GFS2_QCF_USER 0x00000001
449
450struct gfs2_quota_change {
451 __be64 qc_change;
452 __be32 qc_flags; /* GFS2_QCF_... */
453 __be32 qc_id;
454};
455
456struct gfs2_quota_lvb {
457 __be32 qb_magic;
458 __u32 __pad;
459 __be64 qb_limit; /* Hard limit of # blocks to alloc */
460 __be64 qb_warn; /* Warn user when alloc is above this # */
461 __be64 qb_value; /* Current # blocks allocated */
462};
463
464#endif /* __GFS2_ONDISK_DOT_H__ */
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h
deleted file mode 100644
index 258ba82937e7..000000000000
--- a/include/linux/gigaset_dev.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * interface to user space for the gigaset driver
3 *
4 * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de>
5 *
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 as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 * =====================================================================
12 */
13
14#ifndef GIGASET_INTERFACE_H
15#define GIGASET_INTERFACE_H
16
17#include <linux/ioctl.h>
18
19/* The magic IOCTL value for this interface. */
20#define GIGASET_IOCTL 0x47
21
22/* enable/disable device control via character device (lock out ISDN subsys) */
23#define GIGASET_REDIR _IOWR(GIGASET_IOCTL, 0, int)
24
25/* enable adapter configuration mode (M10x only) */
26#define GIGASET_CONFIG _IOWR(GIGASET_IOCTL, 1, int)
27
28/* set break characters (M105 only) */
29#define GIGASET_BRKCHARS _IOW(GIGASET_IOCTL, 2, unsigned char[6])
30
31/* get version information selected by arg[0] */
32#define GIGASET_VERSION _IOWR(GIGASET_IOCTL, 3, unsigned[4])
33/* values for GIGASET_VERSION arg[0] */
34#define GIGVER_DRIVER 0 /* get driver version */
35#define GIGVER_COMPAT 1 /* get interface compatibility version */
36#define GIGVER_FWBASE 2 /* get base station firmware version */
37
38#endif
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index ee275c8b3df1..1acb1445e05f 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 c010b4a785b8..be3be25bb898 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/hdreg.h b/include/linux/hdreg.h
deleted file mode 100644
index 29ee2873f4a8..000000000000
--- a/include/linux/hdreg.h
+++ /dev/null
@@ -1,658 +0,0 @@
1#ifndef _LINUX_HDREG_H
2#define _LINUX_HDREG_H
3
4#include <linux/types.h>
5
6/*
7 * Command Header sizes for IOCTL commands
8 */
9
10#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
11#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
12#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
13
14#define IDE_DRIVE_TASK_NO_DATA 0
15#ifndef __KERNEL__
16#define IDE_DRIVE_TASK_INVALID -1
17#define IDE_DRIVE_TASK_SET_XFER 1
18#define IDE_DRIVE_TASK_IN 2
19#define IDE_DRIVE_TASK_OUT 3
20#endif
21#define IDE_DRIVE_TASK_RAW_WRITE 4
22
23/*
24 * Define standard taskfile in/out register
25 */
26#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
27#define IDE_HOB_STD_IN_FLAGS 0x3C
28#ifndef __KERNEL__
29#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
30#define IDE_HOB_STD_OUT_FLAGS 0x3C
31
32typedef unsigned char task_ioreg_t;
33typedef unsigned long sata_ioreg_t;
34#endif
35
36typedef union ide_reg_valid_s {
37 unsigned all : 16;
38 struct {
39 unsigned data : 1;
40 unsigned error_feature : 1;
41 unsigned sector : 1;
42 unsigned nsector : 1;
43 unsigned lcyl : 1;
44 unsigned hcyl : 1;
45 unsigned select : 1;
46 unsigned status_command : 1;
47
48 unsigned data_hob : 1;
49 unsigned error_feature_hob : 1;
50 unsigned sector_hob : 1;
51 unsigned nsector_hob : 1;
52 unsigned lcyl_hob : 1;
53 unsigned hcyl_hob : 1;
54 unsigned select_hob : 1;
55 unsigned control_hob : 1;
56 } b;
57} ide_reg_valid_t;
58
59typedef struct ide_task_request_s {
60 __u8 io_ports[8];
61 __u8 hob_ports[8]; /* bytes 6 and 7 are unused */
62 ide_reg_valid_t out_flags;
63 ide_reg_valid_t in_flags;
64 int data_phase;
65 int req_cmd;
66 unsigned long out_size;
67 unsigned long in_size;
68} ide_task_request_t;
69
70typedef struct ide_ioctl_request_s {
71 ide_task_request_t *task_request;
72 unsigned char *out_buffer;
73 unsigned char *in_buffer;
74} ide_ioctl_request_t;
75
76struct hd_drive_cmd_hdr {
77 __u8 command;
78 __u8 sector_number;
79 __u8 feature;
80 __u8 sector_count;
81};
82
83#ifndef __KERNEL__
84typedef struct hd_drive_task_hdr {
85 __u8 data;
86 __u8 feature;
87 __u8 sector_count;
88 __u8 sector_number;
89 __u8 low_cylinder;
90 __u8 high_cylinder;
91 __u8 device_head;
92 __u8 command;
93} task_struct_t;
94
95typedef struct hd_drive_hob_hdr {
96 __u8 data;
97 __u8 feature;
98 __u8 sector_count;
99 __u8 sector_number;
100 __u8 low_cylinder;
101 __u8 high_cylinder;
102 __u8 device_head;
103 __u8 control;
104} hob_struct_t;
105#endif
106
107#define TASKFILE_NO_DATA 0x0000
108
109#define TASKFILE_IN 0x0001
110#define TASKFILE_MULTI_IN 0x0002
111
112#define TASKFILE_OUT 0x0004
113#define TASKFILE_MULTI_OUT 0x0008
114#define TASKFILE_IN_OUT 0x0010
115
116#define TASKFILE_IN_DMA 0x0020
117#define TASKFILE_OUT_DMA 0x0040
118#define TASKFILE_IN_DMAQ 0x0080
119#define TASKFILE_OUT_DMAQ 0x0100
120
121#ifndef __KERNEL__
122#define TASKFILE_P_IN 0x0200
123#define TASKFILE_P_OUT 0x0400
124#define TASKFILE_P_IN_DMA 0x0800
125#define TASKFILE_P_OUT_DMA 0x1000
126#define TASKFILE_P_IN_DMAQ 0x2000
127#define TASKFILE_P_OUT_DMAQ 0x4000
128#define TASKFILE_48 0x8000
129#define TASKFILE_INVALID 0x7fff
130#endif
131
132#ifndef __KERNEL__
133/* ATA/ATAPI Commands pre T13 Spec */
134#define WIN_NOP 0x00
135/*
136 * 0x01->0x02 Reserved
137 */
138#define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */
139/*
140 * 0x04->0x07 Reserved
141 */
142#define WIN_SRST 0x08 /* ATAPI soft reset command */
143#define WIN_DEVICE_RESET 0x08
144/*
145 * 0x09->0x0F Reserved
146 */
147#define WIN_RECAL 0x10
148#define WIN_RESTORE WIN_RECAL
149/*
150 * 0x10->0x1F Reserved
151 */
152#define WIN_READ 0x20 /* 28-Bit */
153#define WIN_READ_ONCE 0x21 /* 28-Bit without retries */
154#define WIN_READ_LONG 0x22 /* 28-Bit */
155#define WIN_READ_LONG_ONCE 0x23 /* 28-Bit without retries */
156#define WIN_READ_EXT 0x24 /* 48-Bit */
157#define WIN_READDMA_EXT 0x25 /* 48-Bit */
158#define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */
159#define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */
160/*
161 * 0x28
162 */
163#define WIN_MULTREAD_EXT 0x29 /* 48-Bit */
164/*
165 * 0x2A->0x2F Reserved
166 */
167#define WIN_WRITE 0x30 /* 28-Bit */
168#define WIN_WRITE_ONCE 0x31 /* 28-Bit without retries */
169#define WIN_WRITE_LONG 0x32 /* 28-Bit */
170#define WIN_WRITE_LONG_ONCE 0x33 /* 28-Bit without retries */
171#define WIN_WRITE_EXT 0x34 /* 48-Bit */
172#define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */
173#define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */
174#define WIN_SET_MAX_EXT 0x37 /* 48-Bit */
175#define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */
176#define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */
177/*
178 * 0x3A->0x3B Reserved
179 */
180#define WIN_WRITE_VERIFY 0x3C /* 28-Bit */
181/*
182 * 0x3D->0x3F Reserved
183 */
184#define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */
185#define WIN_VERIFY_ONCE 0x41 /* 28-Bit - without retries */
186#define WIN_VERIFY_EXT 0x42 /* 48-Bit */
187/*
188 * 0x43->0x4F Reserved
189 */
190#define WIN_FORMAT 0x50
191/*
192 * 0x51->0x5F Reserved
193 */
194#define WIN_INIT 0x60
195/*
196 * 0x61->0x5F Reserved
197 */
198#define WIN_SEEK 0x70 /* 0x70-0x7F Reserved */
199
200#define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */
201#define WIN_DIAGNOSE 0x90
202#define WIN_SPECIFY 0x91 /* set drive geometry translation */
203#define WIN_DOWNLOAD_MICROCODE 0x92
204#define WIN_STANDBYNOW2 0x94
205#define WIN_STANDBY2 0x96
206#define WIN_SETIDLE2 0x97
207#define WIN_CHECKPOWERMODE2 0x98
208#define WIN_SLEEPNOW2 0x99
209/*
210 * 0x9A VENDOR
211 */
212#define WIN_PACKETCMD 0xA0 /* Send a packet command. */
213#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
214#define WIN_QUEUED_SERVICE 0xA2
215#define WIN_SMART 0xB0 /* self-monitoring and reporting */
216#define CFA_ERASE_SECTORS 0xC0
217#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
218#define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */
219#define WIN_SETMULT 0xC6 /* enable/disable multiple mode */
220#define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */
221#define WIN_READDMA 0xC8 /* read sectors using DMA transfers */
222#define WIN_READDMA_ONCE 0xC9 /* 28-Bit - without retries */
223#define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */
224#define WIN_WRITEDMA_ONCE 0xCB /* 28-Bit - without retries */
225#define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */
226#define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */
227#define WIN_GETMEDIASTATUS 0xDA
228#define WIN_ACKMEDIACHANGE 0xDB /* ATA-1, ATA-2 vendor */
229#define WIN_POSTBOOT 0xDC
230#define WIN_PREBOOT 0xDD
231#define WIN_DOORLOCK 0xDE /* lock door on removable drives */
232#define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */
233#define WIN_STANDBYNOW1 0xE0
234#define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */
235#define WIN_STANDBY 0xE2 /* Set device in Standby Mode */
236#define WIN_SETIDLE1 0xE3
237#define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */
238#define WIN_CHECKPOWERMODE1 0xE5
239#define WIN_SLEEPNOW1 0xE6
240#define WIN_FLUSH_CACHE 0xE7
241#define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */
242#define WIN_WRITE_SAME 0xE9 /* read ata-2 to use */
243 /* SET_FEATURES 0x22 or 0xDD */
244#define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */
245#define WIN_IDENTIFY 0xEC /* ask drive to identify itself */
246#define WIN_MEDIAEJECT 0xED
247#define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */
248#define WIN_SETFEATURES 0xEF /* set special drive features */
249#define EXABYTE_ENABLE_NEST 0xF0
250#define WIN_SECURITY_SET_PASS 0xF1
251#define WIN_SECURITY_UNLOCK 0xF2
252#define WIN_SECURITY_ERASE_PREPARE 0xF3
253#define WIN_SECURITY_ERASE_UNIT 0xF4
254#define WIN_SECURITY_FREEZE_LOCK 0xF5
255#define WIN_SECURITY_DISABLE 0xF6
256#define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */
257#define WIN_SET_MAX 0xF9
258#define DISABLE_SEAGATE 0xFB
259
260/* WIN_SMART sub-commands */
261
262#define SMART_READ_VALUES 0xD0
263#define SMART_READ_THRESHOLDS 0xD1
264#define SMART_AUTOSAVE 0xD2
265#define SMART_SAVE 0xD3
266#define SMART_IMMEDIATE_OFFLINE 0xD4
267#define SMART_READ_LOG_SECTOR 0xD5
268#define SMART_WRITE_LOG_SECTOR 0xD6
269#define SMART_WRITE_THRESHOLDS 0xD7
270#define SMART_ENABLE 0xD8
271#define SMART_DISABLE 0xD9
272#define SMART_STATUS 0xDA
273#define SMART_AUTO_OFFLINE 0xDB
274
275/* Password used in TF4 & TF5 executing SMART commands */
276
277#define SMART_LCYL_PASS 0x4F
278#define SMART_HCYL_PASS 0xC2
279
280/* WIN_SETFEATURES sub-commands */
281#define SETFEATURES_EN_8BIT 0x01 /* Enable 8-Bit Transfers */
282#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */
283#define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */
284#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */
285#define SETFEATURES_EN_SAME_R 0x22 /* for a region ATA-1 */
286#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */
287#define SETFEATURES_DIS_RETRY 0x33 /* Disable Retry */
288#define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */
289#define SETFEATURES_RW_LONG 0x44 /* Set Length of VS bytes */
290#define SETFEATURES_SET_CACHE 0x54 /* Set Cache segments to SC Reg. Val */
291#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */
292#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */
293#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */
294#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */
295#define SETFEATURES_DIS_ECC 0x77 /* Disable ECC byte count */
296#define SETFEATURES_DIS_8BIT 0x81 /* Disable 8-Bit Transfers */
297#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */
298#define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */
299#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */
300#define SETFEATURES_EN_ECC 0x88 /* Enable ECC byte count */
301#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */
302#define SETFEATURES_EN_RETRY 0x99 /* Enable Retry */
303#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */
304#define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */
305#define SETFEATURES_EN_REST 0xAC /* ATA-1 */
306#define SETFEATURES_4B_RW_LONG 0xBB /* Set Length of 4 bytes */
307#define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */
308#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */
309#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt ATAPI */
310#define SETFEATURES_EN_SAME_M 0xDD /* for a entire device ATA-1 */
311#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt ATAPI */
312
313/* WIN_SECURITY sub-commands */
314
315#define SECURITY_SET_PASSWORD 0xBA
316#define SECURITY_UNLOCK 0xBB
317#define SECURITY_ERASE_PREPARE 0xBC
318#define SECURITY_ERASE_UNIT 0xBD
319#define SECURITY_FREEZE_LOCK 0xBE
320#define SECURITY_DISABLE_PASSWORD 0xBF
321#endif /* __KERNEL__ */
322
323struct hd_geometry {
324 unsigned char heads;
325 unsigned char sectors;
326 unsigned short cylinders;
327 unsigned long start;
328};
329
330/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
331#define HDIO_GETGEO 0x0301 /* get device geometry */
332#define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */
333#define HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */
334#define HDIO_GET_QDMA 0x0305 /* get use-qdma flag */
335
336#define HDIO_SET_XFER 0x0306 /* set transfer rate via proc */
337
338#define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBSOLETE, DO NOT USE: returns 142 bytes */
339#define HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */
340#define HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */
341#define HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */
342#define HDIO_GET_DMA 0x030b /* get use-dma flag */
343#define HDIO_GET_NICE 0x030c /* get nice flags */
344#define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */
345#define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */
346#define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */
347#define HDIO_GET_ADDRESS 0x0310 /* */
348
349#define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */
350#define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */
351#define HDIO_DRIVE_RESET 0x031c /* execute a device reset */
352#define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */
353#define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */
354#define HDIO_DRIVE_CMD 0x031f /* execute a special drive command */
355#define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
356
357/* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
358#define HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */
359#define HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */
360#define HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */
361#define HDIO_SET_32BIT 0x0324 /* change io_32bit flags */
362#define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */
363#define HDIO_SET_DMA 0x0326 /* change use-dma flag */
364#define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */
365#ifndef __KERNEL__
366#define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */
367#define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */
368#endif
369#define HDIO_SET_NICE 0x0329 /* set nice flags */
370#define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */
371#define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */
372#define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */
373#define HDIO_SET_QDMA 0x032e /* change use-qdma flag */
374#define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */
375
376/* bus states */
377enum {
378 BUSSTATE_OFF = 0,
379 BUSSTATE_ON,
380 BUSSTATE_TRISTATE
381};
382
383/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
384/* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
385/* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
386/* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
387/* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
388
389#define __NEW_HD_DRIVE_ID
390
391#ifndef __KERNEL__
392/*
393 * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
394 *
395 * If you change something here, please remember to update fix_driveid() in
396 * ide/probe.c.
397 */
398struct hd_driveid {
399 unsigned short config; /* lots of obsolete bit flags */
400 unsigned short cyls; /* Obsolete, "physical" cyls */
401 unsigned short reserved2; /* reserved (word 2) */
402 unsigned short heads; /* Obsolete, "physical" heads */
403 unsigned short track_bytes; /* unformatted bytes per track */
404 unsigned short sector_bytes; /* unformatted bytes per sector */
405 unsigned short sectors; /* Obsolete, "physical" sectors per track */
406 unsigned short vendor0; /* vendor unique */
407 unsigned short vendor1; /* vendor unique */
408 unsigned short vendor2; /* Retired vendor unique */
409 unsigned char serial_no[20]; /* 0 = not_specified */
410 unsigned short buf_type; /* Retired */
411 unsigned short buf_size; /* Retired, 512 byte increments
412 * 0 = not_specified
413 */
414 unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
415 unsigned char fw_rev[8]; /* 0 = not_specified */
416 unsigned char model[40]; /* 0 = not_specified */
417 unsigned char max_multsect; /* 0=not_implemented */
418 unsigned char vendor3; /* vendor unique */
419 unsigned short dword_io; /* 0=not_implemented; 1=implemented */
420 unsigned char vendor4; /* vendor unique */
421 unsigned char capability; /* (upper byte of word 49)
422 * 3: IORDYsup
423 * 2: IORDYsw
424 * 1: LBA
425 * 0: DMA
426 */
427 unsigned short reserved50; /* reserved (word 50) */
428 unsigned char vendor5; /* Obsolete, vendor unique */
429 unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
430 unsigned char vendor6; /* Obsolete, vendor unique */
431 unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
432 unsigned short field_valid; /* (word 53)
433 * 2: ultra_ok word 88
434 * 1: eide_ok words 64-70
435 * 0: cur_ok words 54-58
436 */
437 unsigned short cur_cyls; /* Obsolete, logical cylinders */
438 unsigned short cur_heads; /* Obsolete, l heads */
439 unsigned short cur_sectors; /* Obsolete, l sectors per track */
440 unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
441 unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
442 unsigned char multsect; /* current multiple sector count */
443 unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
444 unsigned int lba_capacity; /* Obsolete, total number of sectors */
445 unsigned short dma_1word; /* Obsolete, single-word dma info */
446 unsigned short dma_mword; /* multiple-word dma info */
447 unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
448 unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
449 unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
450 unsigned short eide_pio; /* min cycle time (ns), no IORDY */
451 unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
452 unsigned short words69_70[2]; /* reserved words 69-70
453 * future command overlap and queuing
454 */
455 unsigned short words71_74[4]; /* reserved words 71-74
456 * for IDENTIFY PACKET DEVICE command
457 */
458 unsigned short queue_depth; /* (word 75)
459 * 15:5 reserved
460 * 4:0 Maximum queue depth -1
461 */
462 unsigned short words76_79[4]; /* reserved words 76-79 */
463 unsigned short major_rev_num; /* (word 80) */
464 unsigned short minor_rev_num; /* (word 81) */
465 unsigned short command_set_1; /* (word 82) supported
466 * 15: Obsolete
467 * 14: NOP command
468 * 13: READ_BUFFER
469 * 12: WRITE_BUFFER
470 * 11: Obsolete
471 * 10: Host Protected Area
472 * 9: DEVICE Reset
473 * 8: SERVICE Interrupt
474 * 7: Release Interrupt
475 * 6: look-ahead
476 * 5: write cache
477 * 4: PACKET Command
478 * 3: Power Management Feature Set
479 * 2: Removable Feature Set
480 * 1: Security Feature Set
481 * 0: SMART Feature Set
482 */
483 unsigned short command_set_2; /* (word 83)
484 * 15: Shall be ZERO
485 * 14: Shall be ONE
486 * 13: FLUSH CACHE EXT
487 * 12: FLUSH CACHE
488 * 11: Device Configuration Overlay
489 * 10: 48-bit Address Feature Set
490 * 9: Automatic Acoustic Management
491 * 8: SET MAX security
492 * 7: reserved 1407DT PARTIES
493 * 6: SetF sub-command Power-Up
494 * 5: Power-Up in Standby Feature Set
495 * 4: Removable Media Notification
496 * 3: APM Feature Set
497 * 2: CFA Feature Set
498 * 1: READ/WRITE DMA QUEUED
499 * 0: Download MicroCode
500 */
501 unsigned short cfsse; /* (word 84)
502 * cmd set-feature supported extensions
503 * 15: Shall be ZERO
504 * 14: Shall be ONE
505 * 13:6 reserved
506 * 5: General Purpose Logging
507 * 4: Streaming Feature Set
508 * 3: Media Card Pass Through
509 * 2: Media Serial Number Valid
510 * 1: SMART selt-test supported
511 * 0: SMART error logging
512 */
513 unsigned short cfs_enable_1; /* (word 85)
514 * command set-feature enabled
515 * 15: Obsolete
516 * 14: NOP command
517 * 13: READ_BUFFER
518 * 12: WRITE_BUFFER
519 * 11: Obsolete
520 * 10: Host Protected Area
521 * 9: DEVICE Reset
522 * 8: SERVICE Interrupt
523 * 7: Release Interrupt
524 * 6: look-ahead
525 * 5: write cache
526 * 4: PACKET Command
527 * 3: Power Management Feature Set
528 * 2: Removable Feature Set
529 * 1: Security Feature Set
530 * 0: SMART Feature Set
531 */
532 unsigned short cfs_enable_2; /* (word 86)
533 * command set-feature enabled
534 * 15: Shall be ZERO
535 * 14: Shall be ONE
536 * 13: FLUSH CACHE EXT
537 * 12: FLUSH CACHE
538 * 11: Device Configuration Overlay
539 * 10: 48-bit Address Feature Set
540 * 9: Automatic Acoustic Management
541 * 8: SET MAX security
542 * 7: reserved 1407DT PARTIES
543 * 6: SetF sub-command Power-Up
544 * 5: Power-Up in Standby Feature Set
545 * 4: Removable Media Notification
546 * 3: APM Feature Set
547 * 2: CFA Feature Set
548 * 1: READ/WRITE DMA QUEUED
549 * 0: Download MicroCode
550 */
551 unsigned short csf_default; /* (word 87)
552 * command set-feature default
553 * 15: Shall be ZERO
554 * 14: Shall be ONE
555 * 13:6 reserved
556 * 5: General Purpose Logging enabled
557 * 4: Valid CONFIGURE STREAM executed
558 * 3: Media Card Pass Through enabled
559 * 2: Media Serial Number Valid
560 * 1: SMART selt-test supported
561 * 0: SMART error logging
562 */
563 unsigned short dma_ultra; /* (word 88) */
564 unsigned short trseuc; /* time required for security erase */
565 unsigned short trsEuc; /* time required for enhanced erase */
566 unsigned short CurAPMvalues; /* current APM values */
567 unsigned short mprc; /* master password revision code */
568 unsigned short hw_config; /* hardware config (word 93)
569 * 15: Shall be ZERO
570 * 14: Shall be ONE
571 * 13:
572 * 12:
573 * 11:
574 * 10:
575 * 9:
576 * 8:
577 * 7:
578 * 6:
579 * 5:
580 * 4:
581 * 3:
582 * 2:
583 * 1:
584 * 0: Shall be ONE
585 */
586 unsigned short acoustic; /* (word 94)
587 * 15:8 Vendor's recommended value
588 * 7:0 current value
589 */
590 unsigned short msrqs; /* min stream request size */
591 unsigned short sxfert; /* stream transfer time */
592 unsigned short sal; /* stream access latency */
593 unsigned int spg; /* stream performance granularity */
594 unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
595 unsigned short words104_125[22];/* reserved words 104-125 */
596 unsigned short last_lun; /* (word 126) */
597 unsigned short word127; /* (word 127) Feature Set
598 * Removable Media Notification
599 * 15:2 reserved
600 * 1:0 00 = not supported
601 * 01 = supported
602 * 10 = reserved
603 * 11 = reserved
604 */
605 unsigned short dlf; /* (word 128)
606 * device lock function
607 * 15:9 reserved
608 * 8 security level 1:max 0:high
609 * 7:6 reserved
610 * 5 enhanced erase
611 * 4 expire
612 * 3 frozen
613 * 2 locked
614 * 1 en/disabled
615 * 0 capability
616 */
617 unsigned short csfo; /* (word 129)
618 * current set features options
619 * 15:4 reserved
620 * 3: auto reassign
621 * 2: reverting
622 * 1: read-look-ahead
623 * 0: write cache
624 */
625 unsigned short words130_155[26];/* reserved vendor words 130-155 */
626 unsigned short word156; /* reserved vendor word 156 */
627 unsigned short words157_159[3];/* reserved vendor words 157-159 */
628 unsigned short cfa_power; /* (word 160) CFA Power Mode
629 * 15 word 160 supported
630 * 14 reserved
631 * 13
632 * 12
633 * 11:0
634 */
635 unsigned short words161_175[15];/* Reserved for CFA */
636 unsigned short words176_205[30];/* Current Media Serial Number */
637 unsigned short words206_254[49];/* reserved words 206-254 */
638 unsigned short integrity_word; /* (word 255)
639 * 15:8 Checksum
640 * 7:0 Signature
641 */
642};
643#endif /* __KERNEL__ */
644
645/*
646 * IDE "nice" flags. These are used on a per drive basis to determine
647 * when to be nice and give more bandwidth to the other devices which
648 * share the same IDE bus.
649 */
650#define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */
651#define IDE_NICE_ATAPI_OVERLAP (1) /* not supported yet */
652#define IDE_NICE_1 (3) /* when probably won't affect us much */
653#ifndef __KERNEL__
654#define IDE_NICE_0 (2) /* when sure that it won't affect us */
655#define IDE_NICE_2 (4) /* when we know it's on our expense */
656#endif
657
658#endif /* _LINUX_HDREG_H */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 7e1f37db7582..c076041a069e 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 a3f481a3063b..a5dd8148660b 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 45e9fcb8d877..2451662c728a 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 219ca4f6bea6..9427ab4e01c3 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/hysdn_if.h b/include/linux/hysdn_if.h
deleted file mode 100644
index 00236ae3b04e..000000000000
--- a/include/linux/hysdn_if.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
2 *
3 * Linux driver for HYSDN cards
4 * ioctl definitions shared by hynetmgr and driver.
5 *
6 * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
7 * Copyright 1999 by Werner Cornelius (werner@titro.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/****************/
15/* error values */
16/****************/
17#define ERR_NONE 0 /* no error occurred */
18#define ERR_ALREADY_BOOT 1000 /* we are already booting */
19#define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */
20#define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */
21#define EPOF_INTERNAL 1003 /* internal POF handler error */
22#define EPOF_BAD_IMG_SIZE 1004 /* POF boot image size invalid */
23#define ERR_BOOTIMG_FAIL 1005 /* 1. stage boot image did not start */
24#define ERR_BOOTSEQ_FAIL 1006 /* 2. stage boot seq handshake timeout */
25#define ERR_POF_TIMEOUT 1007 /* timeout waiting for card pof ready */
26#define ERR_NOT_BOOTED 1008 /* operation only allowed when booted */
27#define ERR_CONF_LONG 1009 /* conf line is too long */
28#define ERR_INV_CHAN 1010 /* invalid channel number */
29#define ERR_ASYNC_TIME 1011 /* timeout sending async data */
30
31
32
33
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 8a7406b2114d..79727144c5cd 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 94aed0c85bb0..800de224336b 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/i2o-dev.h b/include/linux/i2o-dev.h
deleted file mode 100644
index a8093bfec3a6..000000000000
--- a/include/linux/i2o-dev.h
+++ /dev/null
@@ -1,421 +0,0 @@
1/*
2 * I2O user space accessible structures/APIs
3 *
4 * (c) Copyright 1999, 2000 Red Hat Software
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 * This header file defines the I2O APIs that are available to both
14 * the kernel and user level applications. Kernel specific structures
15 * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which
16 * automatically includes this file.
17 *
18 */
19
20#ifndef _I2O_DEV_H
21#define _I2O_DEV_H
22
23/* How many controllers are we allowing */
24#define MAX_I2O_CONTROLLERS 32
25
26#include <linux/ioctl.h>
27#include <linux/types.h>
28
29/*
30 * I2O Control IOCTLs and structures
31 */
32#define I2O_MAGIC_NUMBER 'i'
33#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
34#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
35#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
36#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
37#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget)
38#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
39#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
40#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
41#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
42#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
43#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
44#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
45#define I2OPASSTHRU _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
46#define I2OPASSTHRU32 _IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru32)
47
48struct i2o_cmd_passthru32 {
49 unsigned int iop; /* IOP unit number */
50 __u32 msg; /* message */
51};
52
53struct i2o_cmd_passthru {
54 unsigned int iop; /* IOP unit number */
55 void __user *msg; /* message */
56};
57
58struct i2o_cmd_hrtlct {
59 unsigned int iop; /* IOP unit number */
60 void __user *resbuf; /* Buffer for result */
61 unsigned int __user *reslen; /* Buffer length in bytes */
62};
63
64struct i2o_cmd_psetget {
65 unsigned int iop; /* IOP unit number */
66 unsigned int tid; /* Target device TID */
67 void __user *opbuf; /* Operation List buffer */
68 unsigned int oplen; /* Operation List buffer length in bytes */
69 void __user *resbuf; /* Result List buffer */
70 unsigned int __user *reslen; /* Result List buffer length in bytes */
71};
72
73struct i2o_sw_xfer {
74 unsigned int iop; /* IOP unit number */
75 unsigned char flags; /* Flags field */
76 unsigned char sw_type; /* Software type */
77 unsigned int sw_id; /* Software ID */
78 void __user *buf; /* Pointer to software buffer */
79 unsigned int __user *swlen; /* Length of software data */
80 unsigned int __user *maxfrag; /* Maximum fragment count */
81 unsigned int __user *curfrag; /* Current fragment count */
82};
83
84struct i2o_html {
85 unsigned int iop; /* IOP unit number */
86 unsigned int tid; /* Target device ID */
87 unsigned int page; /* HTML page */
88 void __user *resbuf; /* Buffer for reply HTML page */
89 unsigned int __user *reslen; /* Length in bytes of reply buffer */
90 void __user *qbuf; /* Pointer to HTTP query string */
91 unsigned int qlen; /* Length in bytes of query string buffer */
92};
93
94#define I2O_EVT_Q_LEN 32
95
96struct i2o_evt_id {
97 unsigned int iop;
98 unsigned int tid;
99 unsigned int evt_mask;
100};
101
102/* Event data size = frame size - message header + evt indicator */
103#define I2O_EVT_DATA_SIZE 88
104
105struct i2o_evt_info {
106 struct i2o_evt_id id;
107 unsigned char evt_data[I2O_EVT_DATA_SIZE];
108 unsigned int data_size;
109};
110
111struct i2o_evt_get {
112 struct i2o_evt_info info;
113 int pending;
114 int lost;
115};
116
117typedef struct i2o_sg_io_hdr {
118 unsigned int flags; /* see I2O_DPT_SG_IO_FLAGS */
119} i2o_sg_io_hdr_t;
120
121/**************************************************************************
122 * HRT related constants and structures
123 **************************************************************************/
124#define I2O_BUS_LOCAL 0
125#define I2O_BUS_ISA 1
126#define I2O_BUS_EISA 2
127/* was I2O_BUS_MCA 3 */
128#define I2O_BUS_PCI 4
129#define I2O_BUS_PCMCIA 5
130#define I2O_BUS_NUBUS 6
131#define I2O_BUS_CARDBUS 7
132#define I2O_BUS_UNKNOWN 0x80
133
134typedef struct _i2o_pci_bus {
135 __u8 PciFunctionNumber;
136 __u8 PciDeviceNumber;
137 __u8 PciBusNumber;
138 __u8 reserved;
139 __u16 PciVendorID;
140 __u16 PciDeviceID;
141} i2o_pci_bus;
142
143typedef struct _i2o_local_bus {
144 __u16 LbBaseIOPort;
145 __u16 reserved;
146 __u32 LbBaseMemoryAddress;
147} i2o_local_bus;
148
149typedef struct _i2o_isa_bus {
150 __u16 IsaBaseIOPort;
151 __u8 CSN;
152 __u8 reserved;
153 __u32 IsaBaseMemoryAddress;
154} i2o_isa_bus;
155
156typedef struct _i2o_eisa_bus_info {
157 __u16 EisaBaseIOPort;
158 __u8 reserved;
159 __u8 EisaSlotNumber;
160 __u32 EisaBaseMemoryAddress;
161} i2o_eisa_bus;
162
163typedef struct _i2o_mca_bus {
164 __u16 McaBaseIOPort;
165 __u8 reserved;
166 __u8 McaSlotNumber;
167 __u32 McaBaseMemoryAddress;
168} i2o_mca_bus;
169
170typedef struct _i2o_other_bus {
171 __u16 BaseIOPort;
172 __u16 reserved;
173 __u32 BaseMemoryAddress;
174} i2o_other_bus;
175
176typedef struct _i2o_hrt_entry {
177 __u32 adapter_id;
178 __u32 parent_tid:12;
179 __u32 state:4;
180 __u32 bus_num:8;
181 __u32 bus_type:8;
182 union {
183 i2o_pci_bus pci_bus;
184 i2o_local_bus local_bus;
185 i2o_isa_bus isa_bus;
186 i2o_eisa_bus eisa_bus;
187 i2o_mca_bus mca_bus;
188 i2o_other_bus other_bus;
189 } bus;
190} i2o_hrt_entry;
191
192typedef struct _i2o_hrt {
193 __u16 num_entries;
194 __u8 entry_len;
195 __u8 hrt_version;
196 __u32 change_ind;
197 i2o_hrt_entry hrt_entry[1];
198} i2o_hrt;
199
200typedef struct _i2o_lct_entry {
201 __u32 entry_size:16;
202 __u32 tid:12;
203 __u32 reserved:4;
204 __u32 change_ind;
205 __u32 device_flags;
206 __u32 class_id:12;
207 __u32 version:4;
208 __u32 vendor_id:16;
209 __u32 sub_class;
210 __u32 user_tid:12;
211 __u32 parent_tid:12;
212 __u32 bios_info:8;
213 __u8 identity_tag[8];
214 __u32 event_capabilities;
215} i2o_lct_entry;
216
217typedef struct _i2o_lct {
218 __u32 table_size:16;
219 __u32 boot_tid:12;
220 __u32 lct_ver:4;
221 __u32 iop_flags;
222 __u32 change_ind;
223 i2o_lct_entry lct_entry[1];
224} i2o_lct;
225
226typedef struct _i2o_status_block {
227 __u16 org_id;
228 __u16 reserved;
229 __u16 iop_id:12;
230 __u16 reserved1:4;
231 __u16 host_unit_id;
232 __u16 segment_number:12;
233 __u16 i2o_version:4;
234 __u8 iop_state;
235 __u8 msg_type;
236 __u16 inbound_frame_size;
237 __u8 init_code;
238 __u8 reserved2;
239 __u32 max_inbound_frames;
240 __u32 cur_inbound_frames;
241 __u32 max_outbound_frames;
242 char product_id[24];
243 __u32 expected_lct_size;
244 __u32 iop_capabilities;
245 __u32 desired_mem_size;
246 __u32 current_mem_size;
247 __u32 current_mem_base;
248 __u32 desired_io_size;
249 __u32 current_io_size;
250 __u32 current_io_base;
251 __u32 reserved3:24;
252 __u32 cmd_status:8;
253} i2o_status_block;
254
255/* Event indicator mask flags */
256#define I2O_EVT_IND_STATE_CHANGE 0x80000000
257#define I2O_EVT_IND_GENERAL_WARNING 0x40000000
258#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000
259#define I2O_EVT_IND_LOCK_RELEASE 0x10000000
260#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000
261#define I2O_EVT_IND_DEVICE_RESET 0x04000000
262#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000
263#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000
264#define I2O_EVT_IND_VENDOR_EVT 0x00800000
265#define I2O_EVT_IND_DEVICE_STATE 0x00400000
266
267/* Executive event indicitors */
268#define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001
269#define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002
270#define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004
271#define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008
272#define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010
273#define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020
274#define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040
275#define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080
276#define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100
277#define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200
278#define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400
279
280/* Random Block Storage Event Indicators */
281#define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001
282#define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002
283#define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004
284#define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008
285#define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010
286
287/* Event data for generic events */
288#define I2O_EVT_STATE_CHANGE_NORMAL 0x00
289#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01
290#define I2O_EVT_STATE_CHANGE_RESTART 0x02
291#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03
292#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04
293#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05
294#define I2O_EVT_STATE_CHANGE_FAILED 0x10
295#define I2O_EVT_STATE_CHANGE_FAULTED 0x11
296
297#define I2O_EVT_GEN_WARNING_NORMAL 0x00
298#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01
299#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02
300
301#define I2O_EVT_CAPABILITY_OTHER 0x01
302#define I2O_EVT_CAPABILITY_CHANGED 0x02
303
304#define I2O_EVT_SENSOR_STATE_CHANGED 0x01
305
306/*
307 * I2O classes / subclasses
308 */
309
310/* Class ID and Code Assignments
311 * (LCT.ClassID.Version field)
312 */
313#define I2O_CLASS_VERSION_10 0x00
314#define I2O_CLASS_VERSION_11 0x01
315
316/* Class code names
317 * (from v1.5 Table 6-1 Class Code Assignments.)
318 */
319
320#define I2O_CLASS_EXECUTIVE 0x000
321#define I2O_CLASS_DDM 0x001
322#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
323#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
324#define I2O_CLASS_LAN 0x020
325#define I2O_CLASS_WAN 0x030
326#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
327#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
328#define I2O_CLASS_SCSI_PERIPHERAL 0x051
329#define I2O_CLASS_ATE_PORT 0x060
330#define I2O_CLASS_ATE_PERIPHERAL 0x061
331#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
332#define I2O_CLASS_FLOPPY_DEVICE 0x071
333#define I2O_CLASS_BUS_ADAPTER 0x080
334#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
335#define I2O_CLASS_PEER_TRANSPORT 0x091
336#define I2O_CLASS_END 0xfff
337
338/*
339 * Rest of 0x092 - 0x09f reserved for peer-to-peer classes
340 */
341
342#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
343
344/*
345 * Subclasses
346 */
347
348#define I2O_SUBCLASS_i960 0x001
349#define I2O_SUBCLASS_HDM 0x020
350#define I2O_SUBCLASS_ISM 0x021
351
352/* Operation functions */
353
354#define I2O_PARAMS_FIELD_GET 0x0001
355#define I2O_PARAMS_LIST_GET 0x0002
356#define I2O_PARAMS_MORE_GET 0x0003
357#define I2O_PARAMS_SIZE_GET 0x0004
358#define I2O_PARAMS_TABLE_GET 0x0005
359#define I2O_PARAMS_FIELD_SET 0x0006
360#define I2O_PARAMS_LIST_SET 0x0007
361#define I2O_PARAMS_ROW_ADD 0x0008
362#define I2O_PARAMS_ROW_DELETE 0x0009
363#define I2O_PARAMS_TABLE_CLEAR 0x000A
364
365/*
366 * I2O serial number conventions / formats
367 * (circa v1.5)
368 */
369
370#define I2O_SNFORMAT_UNKNOWN 0
371#define I2O_SNFORMAT_BINARY 1
372#define I2O_SNFORMAT_ASCII 2
373#define I2O_SNFORMAT_UNICODE 3
374#define I2O_SNFORMAT_LAN48_MAC 4
375#define I2O_SNFORMAT_WAN 5
376
377/*
378 * Plus new in v2.0 (Yellowstone pdf doc)
379 */
380
381#define I2O_SNFORMAT_LAN64_MAC 6
382#define I2O_SNFORMAT_DDM 7
383#define I2O_SNFORMAT_IEEE_REG64 8
384#define I2O_SNFORMAT_IEEE_REG128 9
385#define I2O_SNFORMAT_UNKNOWN2 0xff
386
387/*
388 * I2O Get Status State values
389 */
390
391#define ADAPTER_STATE_INITIALIZING 0x01
392#define ADAPTER_STATE_RESET 0x02
393#define ADAPTER_STATE_HOLD 0x04
394#define ADAPTER_STATE_READY 0x05
395#define ADAPTER_STATE_OPERATIONAL 0x08
396#define ADAPTER_STATE_FAILED 0x10
397#define ADAPTER_STATE_FAULTED 0x11
398
399/*
400 * Software module types
401 */
402#define I2O_SOFTWARE_MODULE_IRTOS 0x11
403#define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
404#define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
405
406/*
407 * Vendors
408 */
409#define I2O_VENDOR_DPT 0x001b
410
411/*
412 * DPT / Adaptec specific values for i2o_sg_io_hdr flags.
413 */
414#define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
415#define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
416
417#define I2O_DPT_FLASH_FRAG_SIZE 0x10000
418#define I2O_DPT_FLASH_READ 0x0101
419#define I2O_DPT_FLASH_WRITE 0x0102
420
421#endif /* _I2O_DEV_H */
diff --git a/include/linux/i8k.h b/include/linux/i8k.h
deleted file mode 100644
index 1c45ba505115..000000000000
--- a/include/linux/i8k.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * i8k.h -- Linux driver for accessing the SMM BIOS on Dell laptops
3 *
4 * Copyright (C) 2001 Massimo Dal Zotto <dz@debian.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16
17#ifndef _LINUX_I8K_H
18#define _LINUX_I8K_H
19
20#define I8K_PROC "/proc/i8k"
21#define I8K_PROC_FMT "1.0"
22
23#define I8K_BIOS_VERSION _IOR ('i', 0x80, int) /* broken: meant 4 bytes */
24#define I8K_MACHINE_ID _IOR ('i', 0x81, int) /* broken: meant 16 bytes */
25#define I8K_POWER_STATUS _IOR ('i', 0x82, size_t)
26#define I8K_FN_STATUS _IOR ('i', 0x83, size_t)
27#define I8K_GET_TEMP _IOR ('i', 0x84, size_t)
28#define I8K_GET_SPEED _IOWR('i', 0x85, size_t)
29#define I8K_GET_FAN _IOWR('i', 0x86, size_t)
30#define I8K_SET_FAN _IOWR('i', 0x87, size_t)
31
32#define I8K_FAN_LEFT 1
33#define I8K_FAN_RIGHT 0
34#define I8K_FAN_OFF 0
35#define I8K_FAN_LOW 1
36#define I8K_FAN_HIGH 2
37#define I8K_FAN_MAX I8K_FAN_HIGH
38
39#define I8K_VOL_UP 1
40#define I8K_VOL_DOWN 2
41#define I8K_VOL_MUTE 4
42
43#define I8K_AC 1
44#define I8K_BATTERY 0
45
46#endif
diff --git a/include/linux/icmp.h b/include/linux/icmp.h
index 474f2a51cf0a..efc18490627a 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 ba45e6bc0764..b4f6c29caced 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.h b/include/linux/if.h
deleted file mode 100644
index 1ec407b01e46..000000000000
--- a/include/linux/if.h
+++ /dev/null
@@ -1,235 +0,0 @@
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 INET interface module.
7 *
8 * Version: @(#)if.h 1.0.2 04/18/93
9 *
10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
11 * Ross Biro
12 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version.
18 */
19#ifndef _LINUX_IF_H
20#define _LINUX_IF_H
21
22#include <linux/types.h> /* for "__kernel_caddr_t" et al */
23#include <linux/socket.h> /* for "struct sockaddr" et al */
24#include <linux/compiler.h> /* for "__user" et al */
25
26#define IFNAMSIZ 16
27#define IFALIASZ 256
28#include <linux/hdlc/ioctl.h>
29
30/* Standard interface flags (netdevice->flags). */
31#define IFF_UP 0x1 /* interface is up */
32#define IFF_BROADCAST 0x2 /* broadcast address valid */
33#define IFF_DEBUG 0x4 /* turn on debugging */
34#define IFF_LOOPBACK 0x8 /* is a loopback net */
35#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
36#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
37#define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */
38#define IFF_NOARP 0x80 /* no ARP protocol */
39#define IFF_PROMISC 0x100 /* receive all packets */
40#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
41
42#define IFF_MASTER 0x400 /* master of a load balancer */
43#define IFF_SLAVE 0x800 /* slave of a load balancer */
44
45#define IFF_MULTICAST 0x1000 /* Supports multicast */
46
47#define IFF_PORTSEL 0x2000 /* can set media type */
48#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
49#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
50
51#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
52#define IFF_DORMANT 0x20000 /* driver signals dormant */
53
54#define IFF_ECHO 0x40000 /* echo sent packets */
55
56#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
57 IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
58
59/* Private (from user) interface flags (netdevice->priv_flags). */
60#define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */
61#define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */
62#define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */
63#define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */
64#define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */
65#define IFF_BONDING 0x20 /* bonding master or slave */
66#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
67#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */
68#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */
69#define IFF_WAN_HDLC 0x200 /* WAN HDLC device */
70#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to
71 * release skb->dst
72 */
73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
74#define IFF_DISABLE_NETPOLL 0x1000 /* disable netpoll at run-time */
75#define IFF_MACVLAN_PORT 0x2000 /* device used as macvlan port */
76#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */
77#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch
78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
82#define IFF_TEAM_PORT 0x40000 /* device used as team port */
83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
84#define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address
85 * change when it's running */
86
87
88#define IF_GET_IFACE 0x0001 /* for querying only */
89#define IF_GET_PROTO 0x0002
90
91/* For definitions see hdlc.h */
92#define IF_IFACE_V35 0x1000 /* V.35 serial interface */
93#define IF_IFACE_V24 0x1001 /* V.24 serial interface */
94#define IF_IFACE_X21 0x1002 /* X.21 serial interface */
95#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */
96#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */
97#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */
98#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */
99
100/* For definitions see hdlc.h */
101#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */
102#define IF_PROTO_PPP 0x2001 /* PPP protocol */
103#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */
104#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */
105#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */
106#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */
107#define IF_PROTO_X25 0x2006 /* X.25 */
108#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */
109#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */
110#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */
111#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */
112#define IF_PROTO_FR_ETH_PVC 0x200B
113#define IF_PROTO_RAW 0x200C /* RAW Socket */
114
115/* RFC 2863 operational status */
116enum {
117 IF_OPER_UNKNOWN,
118 IF_OPER_NOTPRESENT,
119 IF_OPER_DOWN,
120 IF_OPER_LOWERLAYERDOWN,
121 IF_OPER_TESTING,
122 IF_OPER_DORMANT,
123 IF_OPER_UP,
124};
125
126/* link modes */
127enum {
128 IF_LINK_MODE_DEFAULT,
129 IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
130};
131
132/*
133 * Device mapping structure. I'd just gone off and designed a
134 * beautiful scheme using only loadable modules with arguments
135 * for driver options and along come the PCMCIA people 8)
136 *
137 * Ah well. The get() side of this is good for WDSETUP, and it'll
138 * be handy for debugging things. The set side is fine for now and
139 * being very small might be worth keeping for clean configuration.
140 */
141
142struct ifmap {
143 unsigned long mem_start;
144 unsigned long mem_end;
145 unsigned short base_addr;
146 unsigned char irq;
147 unsigned char dma;
148 unsigned char port;
149 /* 3 bytes spare */
150};
151
152struct if_settings {
153 unsigned int type; /* Type of physical device or protocol */
154 unsigned int size; /* Size of the data allocated by the caller */
155 union {
156 /* {atm/eth/dsl}_settings anyone ? */
157 raw_hdlc_proto __user *raw_hdlc;
158 cisco_proto __user *cisco;
159 fr_proto __user *fr;
160 fr_proto_pvc __user *fr_pvc;
161 fr_proto_pvc_info __user *fr_pvc_info;
162
163 /* interface settings */
164 sync_serial_settings __user *sync;
165 te1_settings __user *te1;
166 } ifs_ifsu;
167};
168
169/*
170 * Interface request structure used for socket
171 * ioctl's. All interface ioctl's must have parameter
172 * definitions which begin with ifr_name. The
173 * remainder may be interface specific.
174 */
175
176struct ifreq {
177#define IFHWADDRLEN 6
178 union
179 {
180 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
181 } ifr_ifrn;
182
183 union {
184 struct sockaddr ifru_addr;
185 struct sockaddr ifru_dstaddr;
186 struct sockaddr ifru_broadaddr;
187 struct sockaddr ifru_netmask;
188 struct sockaddr ifru_hwaddr;
189 short ifru_flags;
190 int ifru_ivalue;
191 int ifru_mtu;
192 struct ifmap ifru_map;
193 char ifru_slave[IFNAMSIZ]; /* Just fits the size */
194 char ifru_newname[IFNAMSIZ];
195 void __user * ifru_data;
196 struct if_settings ifru_settings;
197 } ifr_ifru;
198};
199
200#define ifr_name ifr_ifrn.ifrn_name /* interface name */
201#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
202#define ifr_addr ifr_ifru.ifru_addr /* address */
203#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
204#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
205#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
206#define ifr_flags ifr_ifru.ifru_flags /* flags */
207#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
208#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
209#define ifr_map ifr_ifru.ifru_map /* device map */
210#define ifr_slave ifr_ifru.ifru_slave /* slave device */
211#define ifr_data ifr_ifru.ifru_data /* for use by interface */
212#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
213#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
214#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
215#define ifr_newname ifr_ifru.ifru_newname /* New name */
216#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/
217
218/*
219 * Structure used in SIOCGIFCONF request.
220 * Used to retrieve interface configuration
221 * for machine (useful for programs which
222 * must know all networks accessible).
223 */
224
225struct ifconf {
226 int ifc_len; /* size of buffer */
227 union {
228 char __user *ifcu_buf;
229 struct ifreq __user *ifcu_req;
230 } ifc_ifcu;
231};
232#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
233#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
234
235#endif /* _LINUX_IF_H */
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
deleted file mode 100644
index 23357ab81a77..000000000000
--- a/include/linux/if_addr.h
+++ /dev/null
@@ -1,61 +0,0 @@
1#ifndef __LINUX_IF_ADDR_H
2#define __LINUX_IF_ADDR_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7struct ifaddrmsg {
8 __u8 ifa_family;
9 __u8 ifa_prefixlen; /* The prefix length */
10 __u8 ifa_flags; /* Flags */
11 __u8 ifa_scope; /* Address scope */
12 __u32 ifa_index; /* Link index */
13};
14
15/*
16 * Important comment:
17 * IFA_ADDRESS is prefix address, rather than local interface address.
18 * It makes no difference for normally configured broadcast interfaces,
19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
20 * local address is supplied in IFA_LOCAL attribute.
21 */
22enum {
23 IFA_UNSPEC,
24 IFA_ADDRESS,
25 IFA_LOCAL,
26 IFA_LABEL,
27 IFA_BROADCAST,
28 IFA_ANYCAST,
29 IFA_CACHEINFO,
30 IFA_MULTICAST,
31 __IFA_MAX,
32};
33
34#define IFA_MAX (__IFA_MAX - 1)
35
36/* ifa_flags */
37#define IFA_F_SECONDARY 0x01
38#define IFA_F_TEMPORARY IFA_F_SECONDARY
39
40#define IFA_F_NODAD 0x02
41#define IFA_F_OPTIMISTIC 0x04
42#define IFA_F_DADFAILED 0x08
43#define IFA_F_HOMEADDRESS 0x10
44#define IFA_F_DEPRECATED 0x20
45#define IFA_F_TENTATIVE 0x40
46#define IFA_F_PERMANENT 0x80
47
48struct ifa_cacheinfo {
49 __u32 ifa_prefered;
50 __u32 ifa_valid;
51 __u32 cstamp; /* created timestamp, hundredths of seconds */
52 __u32 tstamp; /* updated timestamp, hundredths of seconds */
53};
54
55/* backwards compatibility for userspace */
56#ifndef __KERNEL__
57#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
58#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
59#endif
60
61#endif
diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
deleted file mode 100644
index 54580c298187..000000000000
--- a/include/linux/if_addrlabel.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * if_addrlabel.h - netlink interface for address labels
3 *
4 * Copyright (C)2007 USAGI/WIDE Project, All Rights Reserved.
5 *
6 * Authors:
7 * YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org>
8 */
9
10#ifndef __LINUX_IF_ADDRLABEL_H
11#define __LINUX_IF_ADDRLABEL_H
12
13#include <linux/types.h>
14
15struct ifaddrlblmsg {
16 __u8 ifal_family; /* Address family */
17 __u8 __ifal_reserved; /* Reserved */
18 __u8 ifal_prefixlen; /* Prefix length */
19 __u8 ifal_flags; /* Flags */
20 __u32 ifal_index; /* Link index */
21 __u32 ifal_seq; /* sequence number */
22};
23
24enum {
25 IFAL_ADDRESS = 1,
26 IFAL_LABEL = 2,
27 __IFAL_MAX
28};
29
30#define IFAL_MAX (__IFAL_MAX - 1)
31
32#endif
diff --git a/include/linux/if_alg.h b/include/linux/if_alg.h
deleted file mode 100644
index 0f9acce5b1ff..000000000000
--- a/include/linux/if_alg.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * if_alg: User-space algorithm interface
3 *
4 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _LINUX_IF_ALG_H
14#define _LINUX_IF_ALG_H
15
16#include <linux/types.h>
17
18struct sockaddr_alg {
19 __u16 salg_family;
20 __u8 salg_type[14];
21 __u32 salg_feat;
22 __u32 salg_mask;
23 __u8 salg_name[64];
24};
25
26struct af_alg_iv {
27 __u32 ivlen;
28 __u8 iv[0];
29};
30
31/* Socket options */
32#define ALG_SET_KEY 1
33#define ALG_SET_IV 2
34#define ALG_SET_OP 3
35
36/* Operations */
37#define ALG_OP_DECRYPT 0
38#define ALG_OP_ENCRYPT 1
39
40#endif /* _LINUX_IF_ALG_H */
diff --git a/include/linux/if_arcnet.h b/include/linux/if_arcnet.h
deleted file mode 100644
index 46e34bd0e783..000000000000
--- a/include/linux/if_arcnet.h
+++ /dev/null
@@ -1,132 +0,0 @@
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 ARCnet interface.
7 *
8 * Authors: David Woodhouse and Avery Pennarun
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 _LINUX_IF_ARCNET_H
17#define _LINUX_IF_ARCNET_H
18
19#include <linux/types.h>
20#include <linux/if_ether.h>
21
22
23/*
24 * These are the defined ARCnet Protocol ID's.
25 */
26
27/* CAP mode */
28/* No macro but uses 1-8 */
29
30/* RFC1201 Protocol ID's */
31#define ARC_P_IP 212 /* 0xD4 */
32#define ARC_P_IPV6 196 /* 0xC4: RFC2497 */
33#define ARC_P_ARP 213 /* 0xD5 */
34#define ARC_P_RARP 214 /* 0xD6 */
35#define ARC_P_IPX 250 /* 0xFA */
36#define ARC_P_NOVELL_EC 236 /* 0xEC */
37
38/* Old RFC1051 Protocol ID's */
39#define ARC_P_IP_RFC1051 240 /* 0xF0 */
40#define ARC_P_ARP_RFC1051 241 /* 0xF1 */
41
42/* MS LanMan/WfWg "NDIS" encapsulation */
43#define ARC_P_ETHER 232 /* 0xE8 */
44
45/* Unsupported/indirectly supported protocols */
46#define ARC_P_DATAPOINT_BOOT 0 /* very old Datapoint equipment */
47#define ARC_P_DATAPOINT_MOUNT 1
48#define ARC_P_POWERLAN_BEACON 8 /* Probably ATA-Netbios related */
49#define ARC_P_POWERLAN_BEACON2 243 /* 0xF3 */
50#define ARC_P_LANSOFT 251 /* 0xFB - what is this? */
51#define ARC_P_ATALK 0xDD
52
53/* Hardware address length */
54#define ARCNET_ALEN 1
55
56/*
57 * The RFC1201-specific components of an arcnet packet header.
58 */
59struct arc_rfc1201 {
60 __u8 proto; /* protocol ID field - varies */
61 __u8 split_flag; /* for use with split packets */
62 __be16 sequence; /* sequence number */
63 __u8 payload[0]; /* space remaining in packet (504 bytes)*/
64};
65#define RFC1201_HDR_SIZE 4
66
67
68/*
69 * The RFC1051-specific components.
70 */
71struct arc_rfc1051 {
72 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
73 __u8 payload[0]; /* 507 bytes */
74};
75#define RFC1051_HDR_SIZE 1
76
77
78/*
79 * The ethernet-encap-specific components. We have a real ethernet header
80 * and some data.
81 */
82struct arc_eth_encap {
83 __u8 proto; /* Always ARC_P_ETHER */
84 struct ethhdr eth; /* standard ethernet header (yuck!) */
85 __u8 payload[0]; /* 493 bytes */
86};
87#define ETH_ENCAP_HDR_SIZE 14
88
89
90struct arc_cap {
91 __u8 proto;
92 __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
93 union {
94 __u8 ack;
95 __u8 raw[0]; /* 507 bytes */
96 } mes;
97};
98
99/*
100 * The data needed by the actual arcnet hardware.
101 *
102 * Now, in the real arcnet hardware, the third and fourth bytes are the
103 * 'offset' specification instead of the length, and the soft data is at
104 * the _end_ of the 512-byte buffer. We hide this complexity inside the
105 * driver.
106 */
107struct arc_hardware {
108 __u8 source, /* source ARCnet - filled in automagically */
109 dest, /* destination ARCnet - 0 for broadcast */
110 offset[2]; /* offset bytes (some weird semantics) */
111};
112#define ARC_HDR_SIZE 4
113
114/*
115 * This is an ARCnet frame header, as seen by the kernel (and userspace,
116 * when you do a raw packet capture).
117 */
118struct archdr {
119 /* hardware requirements */
120 struct arc_hardware hard;
121
122 /* arcnet encapsulation-specific bits */
123 union {
124 struct arc_rfc1201 rfc1201;
125 struct arc_rfc1051 rfc1051;
126 struct arc_eth_encap eth_encap;
127 struct arc_cap cap;
128 __u8 raw[0]; /* 508 bytes */
129 } soft;
130};
131
132#endif /* _LINUX_IF_ARCNET_H */
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 9adcc29f084a..89b4614a4722 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_bonding.h b/include/linux/if_bonding.h
deleted file mode 100644
index a17edda8a781..000000000000
--- a/include/linux/if_bonding.h
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
3 *
4 *
5 * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
6 * NCM: Network and Communications Management, Inc.
7 *
8 * BUT, I'm the one who modified it for ethernet, so:
9 * (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
10 *
11 * This software may be used and distributed according to the terms
12 * of the GNU Public License, incorporated herein by reference.
13 *
14 * 2003/03/18 - Amir Noam <amir.noam at intel dot com>
15 * - Added support for getting slave's speed and duplex via ethtool.
16 * Needed for 802.3ad and other future modes.
17 *
18 * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
19 * Shmulik Hen <shmulik.hen at intel dot com>
20 * - Enable support of modes that need to use the unique mac address of
21 * each slave.
22 *
23 * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
24 * Amir Noam <amir.noam at intel dot com>
25 * - Moved driver's private data types to bonding.h
26 *
27 * 2003/03/18 - Amir Noam <amir.noam at intel dot com>,
28 * Tsippy Mendelson <tsippy.mendelson at intel dot com> and
29 * Shmulik Hen <shmulik.hen at intel dot com>
30 * - Added support for IEEE 802.3ad Dynamic link aggregation mode.
31 *
32 * 2003/05/01 - Amir Noam <amir.noam at intel dot com>
33 * - Added ABI version control to restore compatibility between
34 * new/old ifenslave and new/old bonding.
35 *
36 * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
37 * - Code cleanup and style changes
38 *
39 * 2005/05/05 - Jason Gabler <jygabler at lbl dot gov>
40 * - added definitions for various XOR hashing policies
41 */
42
43#ifndef _LINUX_IF_BONDING_H
44#define _LINUX_IF_BONDING_H
45
46#include <linux/if.h>
47#include <linux/types.h>
48#include <linux/if_ether.h>
49
50/* userland - kernel ABI version (2003/05/08) */
51#define BOND_ABI_VERSION 2
52
53/*
54 * We can remove these ioctl definitions in 2.5. People should use the
55 * SIOC*** versions of them instead
56 */
57#define BOND_ENSLAVE_OLD (SIOCDEVPRIVATE)
58#define BOND_RELEASE_OLD (SIOCDEVPRIVATE + 1)
59#define BOND_SETHWADDR_OLD (SIOCDEVPRIVATE + 2)
60#define BOND_SLAVE_INFO_QUERY_OLD (SIOCDEVPRIVATE + 11)
61#define BOND_INFO_QUERY_OLD (SIOCDEVPRIVATE + 12)
62#define BOND_CHANGE_ACTIVE_OLD (SIOCDEVPRIVATE + 13)
63
64#define BOND_CHECK_MII_STATUS (SIOCGMIIPHY)
65
66#define BOND_MODE_ROUNDROBIN 0
67#define BOND_MODE_ACTIVEBACKUP 1
68#define BOND_MODE_XOR 2
69#define BOND_MODE_BROADCAST 3
70#define BOND_MODE_8023AD 4
71#define BOND_MODE_TLB 5
72#define BOND_MODE_ALB 6 /* TLB + RLB (receive load balancing) */
73
74/* each slave's link has 4 states */
75#define BOND_LINK_UP 0 /* link is up and running */
76#define BOND_LINK_FAIL 1 /* link has just gone down */
77#define BOND_LINK_DOWN 2 /* link has been down for too long time */
78#define BOND_LINK_BACK 3 /* link is going back */
79
80/* each slave has several states */
81#define BOND_STATE_ACTIVE 0 /* link is active */
82#define BOND_STATE_BACKUP 1 /* link is backup */
83
84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
85
86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */
87
88#define BOND_DEFAULT_RESEND_IGMP 1 /* Default number of IGMP membership reports */
89
90/* hashing types */
91#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
92#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
93#define BOND_XMIT_POLICY_LAYER23 2 /* layer 2+3 (IP ^ MAC) */
94
95typedef struct ifbond {
96 __s32 bond_mode;
97 __s32 num_slaves;
98 __s32 miimon;
99} ifbond;
100
101typedef struct ifslave {
102 __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
103 char slave_name[IFNAMSIZ];
104 __s8 link;
105 __s8 state;
106 __u32 link_failure_count;
107} ifslave;
108
109struct ad_info {
110 __u16 aggregator_id;
111 __u16 ports;
112 __u16 actor_key;
113 __u16 partner_key;
114 __u8 partner_system[ETH_ALEN];
115};
116
117#endif /* _LINUX_IF_BONDING_H */
118
119/*
120 * Local variables:
121 * version-control: t
122 * kept-new-versions: 5
123 * c-indent-level: 8
124 * c-basic-offset: 8
125 * tab-width: 8
126 * End:
127 */
128
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index dd3f20139640..1085ffeef956 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_cablemodem.h b/include/linux/if_cablemodem.h
deleted file mode 100644
index 9ca1007edd93..000000000000
--- a/include/linux/if_cablemodem.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef _LINUX_CABLEMODEM_H_
2#define _LINUX_CABLEMODEM_H_
3/*
4 * Author: Franco Venturi <fventuri@mediaone.net>
5 * Copyright 1998 Franco Venturi
6 *
7 * This program is free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General
9 * Public License as published by the Free Software
10 * Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14/* some useful defines for sb1000.c e cmconfig.c - fv */
15#define SIOCGCMSTATS SIOCDEVPRIVATE+0 /* get cable modem stats */
16#define SIOCGCMFIRMWARE SIOCDEVPRIVATE+1 /* get cm firmware version */
17#define SIOCGCMFREQUENCY SIOCDEVPRIVATE+2 /* get cable modem frequency */
18#define SIOCSCMFREQUENCY SIOCDEVPRIVATE+3 /* set cable modem frequency */
19#define SIOCGCMPIDS SIOCDEVPRIVATE+4 /* get cable modem PIDs */
20#define SIOCSCMPIDS SIOCDEVPRIVATE+5 /* set cable modem PIDs */
21
22#endif
diff --git a/include/linux/if_eql.h b/include/linux/if_eql.h
index 18a5d02a8644..d984694c384d 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 167ce5b363d2..12b4d55a02af 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_fc.h b/include/linux/if_fc.h
deleted file mode 100644
index 6ed7f1bf35c8..000000000000
--- a/include/linux/if_fc.h
+++ /dev/null
@@ -1,51 +0,0 @@
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 Fibre Channel.
7 *
8 * Version: @(#)if_fc.h 0.0 11/20/98
9 *
10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
11 * Donald Becker, <becker@super.org>
12 * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
13 * Vineet Abraham, <vma@iol.unh.edu>
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#ifndef _LINUX_IF_FC_H
21#define _LINUX_IF_FC_H
22
23#include <linux/types.h>
24
25#define FC_ALEN 6 /* Octets in one ethernet addr */
26#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
27#define FC_ID_LEN 3 /* Octets in a Fibre Channel Address */
28
29/* LLC and SNAP constants */
30#define EXTENDED_SAP 0xAA
31#define UI_CMD 0x03
32
33/* This is NOT the Fibre Channel frame header. The FC frame header is
34 * constructed in the driver as the Tachyon needs certain fields in
35 * certains positions. So, it can't be generalized here.*/
36
37struct fch_hdr {
38 __u8 daddr[FC_ALEN]; /* destination address */
39 __u8 saddr[FC_ALEN]; /* source address */
40};
41
42/* This is a Fibre Channel LLC structure */
43struct fcllc {
44 __u8 dsap; /* destination SAP */
45 __u8 ssap; /* source SAP */
46 __u8 llc; /* LLC control field */
47 __u8 protid[3]; /* protocol id */
48 __be16 ethertype; /* ether type field */
49};
50
51#endif /* _LINUX_IF_FC_H */
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index e6dc11e7f9a5..f5550b3eeeab 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 191ee0869bc1..4316aa173dde 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_hippi.h b/include/linux/if_hippi.h
deleted file mode 100644
index cdc049f1829a..000000000000
--- a/include/linux/if_hippi.h
+++ /dev/null
@@ -1,153 +0,0 @@
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 HIPPI interface.
7 *
8 * Version: @(#)if_hippi.h 1.0.0 05/26/97
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 * Jes Sorensen, <Jes.Sorensen@cern.ch>
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 */
21
22#ifndef _LINUX_IF_HIPPI_H
23#define _LINUX_IF_HIPPI_H
24
25#include <linux/types.h>
26#include <asm/byteorder.h>
27
28/*
29 * HIPPI magic constants.
30 */
31
32#define HIPPI_ALEN 6 /* Bytes in one HIPPI hw-addr */
33#define HIPPI_HLEN sizeof(struct hippi_hdr)
34#define HIPPI_ZLEN 0 /* Min. bytes in frame without FCS */
35#define HIPPI_DATA_LEN 65280 /* Max. bytes in payload */
36#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
37 /* Max. bytes in frame without FCS */
38
39/*
40 * Define LLC and SNAP constants.
41 */
42#define HIPPI_EXTENDED_SAP 0xAA
43#define HIPPI_UI_CMD 0x03
44
45
46/*
47 * Do we need to list some sort of ID's here?
48 */
49
50/*
51 * HIPPI statistics collection data.
52 */
53
54struct hipnet_statistics {
55 int rx_packets; /* total packets received */
56 int tx_packets; /* total packets transmitted */
57 int rx_errors; /* bad packets received */
58 int tx_errors; /* packet transmit problems */
59 int rx_dropped; /* no space in linux buffers */
60 int tx_dropped; /* no space available in linux */
61
62 /* detailed rx_errors: */
63 int rx_length_errors;
64 int rx_over_errors; /* receiver ring buff overflow */
65 int rx_crc_errors; /* recved pkt with crc error */
66 int rx_frame_errors; /* recv'd frame alignment error */
67 int rx_fifo_errors; /* recv'r fifo overrun */
68 int rx_missed_errors; /* receiver missed packet */
69
70 /* detailed tx_errors */
71 int tx_aborted_errors;
72 int tx_carrier_errors;
73 int tx_fifo_errors;
74 int tx_heartbeat_errors;
75 int tx_window_errors;
76};
77
78
79struct hippi_fp_hdr {
80#if 0
81 __u8 ulp; /* must contain 4 */
82#if defined (__BIG_ENDIAN_BITFIELD)
83 __u8 d1_data_present:1; /* must be 1 */
84 __u8 start_d2_burst_boundary:1; /* must be zero */
85 __u8 reserved:6; /* must be zero */
86#if 0
87 __u16 reserved1:5;
88 __u16 d1_area_size:8; /* must be 3 */
89 __u16 d2_offset:3; /* must be zero */
90#endif
91#elif defined(__LITTLE_ENDIAN_BITFIELD)
92 __u8 reserved:6; /* must be zero */
93 __u8 start_d2_burst_boundary:1; /* must be zero */
94 __u8 d1_data_present:1; /* must be 1 */
95#if 0
96 __u16 d2_offset:3; /* must be zero */
97 __u16 d1_area_size:8; /* must be 3 */
98 __u16 reserved1:5; /* must be zero */
99#endif
100#else
101#error "Please fix <asm/byteorder.h>"
102#endif
103#else
104 __be32 fixed;
105#endif
106 __be32 d2_size;
107} __attribute__((packed));
108
109struct hippi_le_hdr {
110#if defined (__BIG_ENDIAN_BITFIELD)
111 __u8 fc:3;
112 __u8 double_wide:1;
113 __u8 message_type:4;
114#elif defined(__LITTLE_ENDIAN_BITFIELD)
115 __u8 message_type:4;
116 __u8 double_wide:1;
117 __u8 fc:3;
118#endif
119 __u8 dest_switch_addr[3];
120#if defined (__BIG_ENDIAN_BITFIELD)
121 __u8 dest_addr_type:4,
122 src_addr_type:4;
123#elif defined(__LITTLE_ENDIAN_BITFIELD)
124 __u8 src_addr_type:4,
125 dest_addr_type:4;
126#endif
127 __u8 src_switch_addr[3];
128 __u16 reserved;
129 __u8 daddr[HIPPI_ALEN];
130 __u16 locally_administered;
131 __u8 saddr[HIPPI_ALEN];
132} __attribute__((packed));
133
134#define HIPPI_OUI_LEN 3
135/*
136 * Looks like the dsap and ssap fields have been swapped by mistake in
137 * RFC 2067 "IP over HIPPI".
138 */
139struct hippi_snap_hdr {
140 __u8 dsap; /* always 0xAA */
141 __u8 ssap; /* always 0xAA */
142 __u8 ctrl; /* always 0x03 */
143 __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/
144 __be16 ethertype; /* packet type ID field */
145} __attribute__((packed));
146
147struct hippi_hdr {
148 struct hippi_fp_hdr fp;
149 struct hippi_le_hdr le;
150 struct hippi_snap_hdr snap;
151} __attribute__((packed));
152
153#endif /* _LINUX_IF_HIPPI_H */
diff --git a/include/linux/if_infiniband.h b/include/linux/if_infiniband.h
deleted file mode 100644
index 7d958475d4ac..000000000000
--- a/include/linux/if_infiniband.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * This software is available to you under a choice of one of two
3 * licenses. You may choose to be licensed under the terms of the GNU
4 * General Public License (GPL) Version 2, available at
5 * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
6 * license, available in the LICENSE.TXT file accompanying this
7 * software. These details are also available at
8 * <http://www.openfabrics.org/software_license.htm>.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 *
19 * Copyright (c) 2004 Topspin Communications. All rights reserved.
20 *
21 * $Id$
22 */
23
24#ifndef _LINUX_IF_INFINIBAND_H
25#define _LINUX_IF_INFINIBAND_H
26
27#define INFINIBAND_ALEN 20 /* Octets in IPoIB HW addr */
28
29#endif /* _LINUX_IF_INFINIBAND_H */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 3265f332998a..c3f817c3eb45 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 76525760ba48..81e434c50790 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_packet.h b/include/linux/if_packet.h
deleted file mode 100644
index f3799295d231..000000000000
--- a/include/linux/if_packet.h
+++ /dev/null
@@ -1,272 +0,0 @@
1#ifndef __LINUX_IF_PACKET_H
2#define __LINUX_IF_PACKET_H
3
4#include <linux/types.h>
5
6struct sockaddr_pkt {
7 unsigned short spkt_family;
8 unsigned char spkt_device[14];
9 __be16 spkt_protocol;
10};
11
12struct sockaddr_ll {
13 unsigned short sll_family;
14 __be16 sll_protocol;
15 int sll_ifindex;
16 unsigned short sll_hatype;
17 unsigned char sll_pkttype;
18 unsigned char sll_halen;
19 unsigned char sll_addr[8];
20};
21
22/* Packet types */
23
24#define PACKET_HOST 0 /* To us */
25#define PACKET_BROADCAST 1 /* To all */
26#define PACKET_MULTICAST 2 /* To group */
27#define PACKET_OTHERHOST 3 /* To someone else */
28#define PACKET_OUTGOING 4 /* Outgoing of any type */
29/* These ones are invisible by user level */
30#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
31#define PACKET_FASTROUTE 6 /* Fastrouted frame */
32
33/* Packet socket options */
34
35#define PACKET_ADD_MEMBERSHIP 1
36#define PACKET_DROP_MEMBERSHIP 2
37#define PACKET_RECV_OUTPUT 3
38/* Value 4 is still used by obsolete turbo-packet. */
39#define PACKET_RX_RING 5
40#define PACKET_STATISTICS 6
41#define PACKET_COPY_THRESH 7
42#define PACKET_AUXDATA 8
43#define PACKET_ORIGDEV 9
44#define PACKET_VERSION 10
45#define PACKET_HDRLEN 11
46#define PACKET_RESERVE 12
47#define PACKET_TX_RING 13
48#define PACKET_LOSS 14
49#define PACKET_VNET_HDR 15
50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18
53
54#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1
56#define PACKET_FANOUT_CPU 2
57#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
58
59struct tpacket_stats {
60 unsigned int tp_packets;
61 unsigned int tp_drops;
62};
63
64struct tpacket_stats_v3 {
65 unsigned int tp_packets;
66 unsigned int tp_drops;
67 unsigned int tp_freeze_q_cnt;
68};
69
70union tpacket_stats_u {
71 struct tpacket_stats stats1;
72 struct tpacket_stats_v3 stats3;
73};
74
75struct tpacket_auxdata {
76 __u32 tp_status;
77 __u32 tp_len;
78 __u32 tp_snaplen;
79 __u16 tp_mac;
80 __u16 tp_net;
81 __u16 tp_vlan_tci;
82 __u16 tp_padding;
83};
84
85/* Rx ring - header status */
86#define TP_STATUS_KERNEL 0x0
87#define TP_STATUS_USER 0x1
88#define TP_STATUS_COPY 0x2
89#define TP_STATUS_LOSING 0x4
90#define TP_STATUS_CSUMNOTREADY 0x8
91#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
92#define TP_STATUS_BLK_TMO 0x20
93
94/* Tx ring - header status */
95#define TP_STATUS_AVAILABLE 0x0
96#define TP_STATUS_SEND_REQUEST 0x1
97#define TP_STATUS_SENDING 0x2
98#define TP_STATUS_WRONG_FORMAT 0x4
99
100/* Rx ring - feature request bits */
101#define TP_FT_REQ_FILL_RXHASH 0x1
102
103struct tpacket_hdr {
104 unsigned long tp_status;
105 unsigned int tp_len;
106 unsigned int tp_snaplen;
107 unsigned short tp_mac;
108 unsigned short tp_net;
109 unsigned int tp_sec;
110 unsigned int tp_usec;
111};
112
113#define TPACKET_ALIGNMENT 16
114#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
115#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
116
117struct tpacket2_hdr {
118 __u32 tp_status;
119 __u32 tp_len;
120 __u32 tp_snaplen;
121 __u16 tp_mac;
122 __u16 tp_net;
123 __u32 tp_sec;
124 __u32 tp_nsec;
125 __u16 tp_vlan_tci;
126 __u16 tp_padding;
127};
128
129struct tpacket_hdr_variant1 {
130 __u32 tp_rxhash;
131 __u32 tp_vlan_tci;
132};
133
134struct tpacket3_hdr {
135 __u32 tp_next_offset;
136 __u32 tp_sec;
137 __u32 tp_nsec;
138 __u32 tp_snaplen;
139 __u32 tp_len;
140 __u32 tp_status;
141 __u16 tp_mac;
142 __u16 tp_net;
143 /* pkt_hdr variants */
144 union {
145 struct tpacket_hdr_variant1 hv1;
146 };
147};
148
149struct tpacket_bd_ts {
150 unsigned int ts_sec;
151 union {
152 unsigned int ts_usec;
153 unsigned int ts_nsec;
154 };
155};
156
157struct tpacket_hdr_v1 {
158 __u32 block_status;
159 __u32 num_pkts;
160 __u32 offset_to_first_pkt;
161
162 /* Number of valid bytes (including padding)
163 * blk_len <= tp_block_size
164 */
165 __u32 blk_len;
166
167 /*
168 * Quite a few uses of sequence number:
169 * 1. Make sure cache flush etc worked.
170 * Well, one can argue - why not use the increasing ts below?
171 * But look at 2. below first.
172 * 2. When you pass around blocks to other user space decoders,
173 * you can see which blk[s] is[are] outstanding etc.
174 * 3. Validate kernel code.
175 */
176 __aligned_u64 seq_num;
177
178 /*
179 * ts_last_pkt:
180 *
181 * Case 1. Block has 'N'(N >=1) packets and TMO'd(timed out)
182 * ts_last_pkt == 'time-stamp of last packet' and NOT the
183 * time when the timer fired and the block was closed.
184 * By providing the ts of the last packet we can absolutely
185 * guarantee that time-stamp wise, the first packet in the
186 * next block will never precede the last packet of the
187 * previous block.
188 * Case 2. Block has zero packets and TMO'd
189 * ts_last_pkt = time when the timer fired and the block
190 * was closed.
191 * Case 3. Block has 'N' packets and NO TMO.
192 * ts_last_pkt = time-stamp of the last pkt in the block.
193 *
194 * ts_first_pkt:
195 * Is always the time-stamp when the block was opened.
196 * Case a) ZERO packets
197 * No packets to deal with but atleast you know the
198 * time-interval of this block.
199 * Case b) Non-zero packets
200 * Use the ts of the first packet in the block.
201 *
202 */
203 struct tpacket_bd_ts ts_first_pkt, ts_last_pkt;
204};
205
206union tpacket_bd_header_u {
207 struct tpacket_hdr_v1 bh1;
208};
209
210struct tpacket_block_desc {
211 __u32 version;
212 __u32 offset_to_priv;
213 union tpacket_bd_header_u hdr;
214};
215
216#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
217#define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll))
218
219enum tpacket_versions {
220 TPACKET_V1,
221 TPACKET_V2,
222 TPACKET_V3
223};
224
225/*
226 Frame structure:
227
228 - Start. Frame must be aligned to TPACKET_ALIGNMENT=16
229 - struct tpacket_hdr
230 - pad to TPACKET_ALIGNMENT=16
231 - struct sockaddr_ll
232 - Gap, chosen so that packet data (Start+tp_net) alignes to TPACKET_ALIGNMENT=16
233 - Start+tp_mac: [ Optional MAC header ]
234 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
235 - Pad to align to TPACKET_ALIGNMENT=16
236 */
237
238struct tpacket_req {
239 unsigned int tp_block_size; /* Minimal size of contiguous block */
240 unsigned int tp_block_nr; /* Number of blocks */
241 unsigned int tp_frame_size; /* Size of frame */
242 unsigned int tp_frame_nr; /* Total number of frames */
243};
244
245struct tpacket_req3 {
246 unsigned int tp_block_size; /* Minimal size of contiguous block */
247 unsigned int tp_block_nr; /* Number of blocks */
248 unsigned int tp_frame_size; /* Size of frame */
249 unsigned int tp_frame_nr; /* Total number of frames */
250 unsigned int tp_retire_blk_tov; /* timeout in msecs */
251 unsigned int tp_sizeof_priv; /* offset to private data area */
252 unsigned int tp_feature_req_word;
253};
254
255union tpacket_req_u {
256 struct tpacket_req req;
257 struct tpacket_req3 req3;
258};
259
260struct packet_mreq {
261 int mr_ifindex;
262 unsigned short mr_type;
263 unsigned short mr_alen;
264 unsigned char mr_address[8];
265};
266
267#define PACKET_MR_MULTICAST 0
268#define PACKET_MR_PROMISC 1
269#define PACKET_MR_ALLMULTI 2
270#define PACKET_MR_UNICAST 3
271
272#endif
diff --git a/include/linux/if_phonet.h b/include/linux/if_phonet.h
index d70034bcec05..bbcdb0a767d8 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_plip.h b/include/linux/if_plip.h
deleted file mode 100644
index 6298c7e88b2b..000000000000
--- a/include/linux/if_plip.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * NET3 PLIP tuning facilities for the new Niibe PLIP.
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 */
10
11#ifndef _LINUX_IF_PLIP_H
12#define _LINUX_IF_PLIP_H
13
14#include <linux/sockios.h>
15
16#define SIOCDEVPLIP SIOCDEVPRIVATE
17
18struct plipconf {
19 unsigned short pcmd;
20 unsigned long nibble;
21 unsigned long trigger;
22};
23
24#define PLIP_GET_TIMEOUT 0x1
25#define PLIP_SET_TIMEOUT 0x2
26
27#endif
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
deleted file mode 100644
index 9048fabb7a4e..000000000000
--- a/include/linux/if_ppp.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <linux/ppp-ioctl.h>
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index b4775418d525..0fb71e532b2c 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 09c474c480cd..aff7ad8a4ea3 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_slip.h b/include/linux/if_slip.h
deleted file mode 100644
index 1eb4e3a8397a..000000000000
--- a/include/linux/if_slip.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Swansea University Computer Society NET3
3 *
4 * This file declares the constants of special use with the SLIP/CSLIP/
5 * KISS TNC driver.
6 */
7
8#ifndef __LINUX_SLIP_H
9#define __LINUX_SLIP_H
10
11#define SL_MODE_SLIP 0
12#define SL_MODE_CSLIP 1
13#define SL_MODE_KISS 4
14
15#define SL_OPT_SIXBIT 2
16#define SL_OPT_ADAPTIVE 8
17
18/*
19 * VSV = ioctl for keepalive & outfill in SLIP driver
20 */
21
22#define SIOCSKEEPALIVE (SIOCDEVPRIVATE) /* Set keepalive timeout in sec */
23#define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */
24#define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */
25#define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */
26#define SIOCSLEASE (SIOCDEVPRIVATE+4) /* Set "leased" line type */
27#define SIOCGLEASE (SIOCDEVPRIVATE+5) /* Get line type */
28
29
30#endif
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 6d88a7f57680..0245def2aa93 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 06b1829731fd..ed6da2e6df90 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 8c5035ac3142..1cc595a67cc9 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 c0ff748d0aa5..d06cc5c8f58c 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/if_x25.h b/include/linux/if_x25.h
deleted file mode 100644
index 897765f5feb8..000000000000
--- a/include/linux/if_x25.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Linux X.25 packet to device interface
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef _IF_X25_H
16#define _IF_X25_H
17
18#include <linux/types.h>
19
20/* Documentation/networking/x25-iface.txt */
21#define X25_IFACE_DATA 0x00
22#define X25_IFACE_CONNECT 0x01
23#define X25_IFACE_DISCONNECT 0x02
24#define X25_IFACE_PARAMS 0x03
25
26#endif /* _IF_X25_H */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 82de336b8155..7f2bf1518480 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 e0337f11d92e..31b493734763 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 cba469ba11a4..9e2ae26fb598 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/in_route.h b/include/linux/in_route.h
deleted file mode 100644
index b261b8c915f0..000000000000
--- a/include/linux/in_route.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#ifndef _LINUX_IN_ROUTE_H
2#define _LINUX_IN_ROUTE_H
3
4/* IPv4 routing cache flags */
5
6#define RTCF_DEAD RTNH_F_DEAD
7#define RTCF_ONLINK RTNH_F_ONLINK
8
9/* Obsolete flag. About to be deleted */
10#define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC
11
12#define RTCF_NOTIFY 0x00010000
13#define RTCF_DIRECTDST 0x00020000 /* unused */
14#define RTCF_REDIRECTED 0x00040000
15#define RTCF_TPROXY 0x00080000 /* unused */
16
17#define RTCF_FAST 0x00200000 /* unused */
18#define RTCF_MASQ 0x00400000 /* unused */
19#define RTCF_SNAT 0x00800000 /* unused */
20#define RTCF_DOREDIRECT 0x01000000
21#define RTCF_DIRECTSRC 0x04000000
22#define RTCF_DNAT 0x08000000
23#define RTCF_BROADCAST 0x10000000
24#define RTCF_MULTICAST 0x20000000
25#define RTCF_REJECT 0x40000000 /* unused */
26#define RTCF_LOCAL 0x80000000
27
28#define RTCF_NAT (RTCF_DNAT|RTCF_SNAT)
29
30#define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK)
31
32#endif /* _LINUX_IN_ROUTE_H */
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index e788c186ed3a..46da02410a09 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 d33041e2a42a..23aede0b5843 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 15464ba6bf53..cab994ba6d91 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/ioctl.h b/include/linux/ioctl.h
deleted file mode 100644
index aa91eb3951ef..000000000000
--- a/include/linux/ioctl.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _LINUX_IOCTL_H
2#define _LINUX_IOCTL_H
3
4#include <asm/ioctl.h>
5
6#endif /* _LINUX_IOCTL_H */
7
diff --git a/include/linux/ip.h b/include/linux/ip.h
index bd0a2a8631c6..58b82a22a52b 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/ip6_tunnel.h b/include/linux/ip6_tunnel.h
deleted file mode 100644
index 48af63c9a48d..000000000000
--- a/include/linux/ip6_tunnel.h
+++ /dev/null
@@ -1,51 +0,0 @@
1#ifndef _IP6_TUNNEL_H
2#define _IP6_TUNNEL_H
3
4#include <linux/types.h>
5
6#define IPV6_TLV_TNL_ENCAP_LIMIT 4
7#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
8
9/* don't add encapsulation limit if one isn't present in inner packet */
10#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
11/* copy the traffic class field from the inner packet */
12#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
13/* copy the flowlabel from the inner packet */
14#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
15/* being used for Mobile IPv6 */
16#define IP6_TNL_F_MIP6_DEV 0x8
17/* copy DSCP from the outer packet */
18#define IP6_TNL_F_RCV_DSCP_COPY 0x10
19/* copy fwmark from inner packet */
20#define IP6_TNL_F_USE_ORIG_FWMARK 0x20
21
22struct ip6_tnl_parm {
23 char name[IFNAMSIZ]; /* name of tunnel device */
24 int link; /* ifindex of underlying L2 interface */
25 __u8 proto; /* tunnel protocol */
26 __u8 encap_limit; /* encapsulation limit for tunnel */
27 __u8 hop_limit; /* hop limit for tunnel */
28 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
29 __u32 flags; /* tunnel flags */
30 struct in6_addr laddr; /* local tunnel end-point address */
31 struct in6_addr raddr; /* remote tunnel end-point address */
32};
33
34struct ip6_tnl_parm2 {
35 char name[IFNAMSIZ]; /* name of tunnel device */
36 int link; /* ifindex of underlying L2 interface */
37 __u8 proto; /* tunnel protocol */
38 __u8 encap_limit; /* encapsulation limit for tunnel */
39 __u8 hop_limit; /* hop limit for tunnel */
40 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
41 __u32 flags; /* tunnel flags */
42 struct in6_addr laddr; /* local tunnel end-point address */
43 struct in6_addr raddr; /* remote tunnel end-point address */
44
45 __be16 i_flags;
46 __be16 o_flags;
47 __be32 i_key;
48 __be32 o_key;
49};
50
51#endif
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
deleted file mode 100644
index 8a2d438dc499..000000000000
--- a/include/linux/ip_vs.h
+++ /dev/null
@@ -1,434 +0,0 @@
1/*
2 * IP Virtual Server
3 * data structure and functionality definitions
4 */
5
6#ifndef _IP_VS_H
7#define _IP_VS_H
8
9#include <linux/types.h> /* For __beXX types in userland */
10
11#define IP_VS_VERSION_CODE 0x010201
12#define NVERSION(version) \
13 (version >> 16) & 0xFF, \
14 (version >> 8) & 0xFF, \
15 version & 0xFF
16
17/*
18 * Virtual Service Flags
19 */
20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
22#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */
23
24/*
25 * Destination Server Flags
26 */
27#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */
28#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */
29
30/*
31 * IPVS sync daemon states
32 */
33#define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */
34#define IP_VS_STATE_MASTER 0x0001 /* started as master */
35#define IP_VS_STATE_BACKUP 0x0002 /* started as backup */
36
37/*
38 * IPVS socket options
39 */
40#define IP_VS_BASE_CTL (64+1024+64) /* base */
41
42#define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */
43#define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1)
44#define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2)
45#define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3)
46#define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4)
47#define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5)
48#define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6)
49#define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7)
50#define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8)
51#define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9)
52#define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10)
53#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
54#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
55#define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13)
56#define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14)
57#define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15)
58#define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO
59
60#define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL
61#define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1)
62#define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2)
63#define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3)
64#define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4)
65#define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */
66#define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6)
67#define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7)
68#define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON
69
70
71/*
72 * IPVS Connection Flags
73 * Only flags 0..15 are sent to backup server
74 */
75#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */
76#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */
77#define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */
78#define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */
79#define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */
80#define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */
81#define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */
82#define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */
83#define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */
84#define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */
85#define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */
86#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */
87#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
88#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
89#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
90#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
91
92/* Initial bits allowed in backup server */
93#define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \
94 IP_VS_CONN_F_NOOUTPUT | \
95 IP_VS_CONN_F_INACTIVE | \
96 IP_VS_CONN_F_SEQ_MASK | \
97 IP_VS_CONN_F_NO_CPORT | \
98 IP_VS_CONN_F_TEMPLATE \
99 )
100
101/* Bits allowed to update in backup server */
102#define IP_VS_CONN_F_BACKUP_UPD_MASK (IP_VS_CONN_F_INACTIVE | \
103 IP_VS_CONN_F_SEQ_MASK)
104
105/* Flags that are not sent to backup server start from bit 16 */
106#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */
107
108/* Connection flags from destination that can be changed by user space */
109#define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \
110 IP_VS_CONN_F_ONE_PACKET | \
111 IP_VS_CONN_F_NFCT | \
112 0)
113
114#define IP_VS_SCHEDNAME_MAXLEN 16
115#define IP_VS_PENAME_MAXLEN 16
116#define IP_VS_IFNAME_MAXLEN 16
117
118#define IP_VS_PEDATA_MAXLEN 255
119
120/*
121 * The struct ip_vs_service_user and struct ip_vs_dest_user are
122 * used to set IPVS rules through setsockopt.
123 */
124struct ip_vs_service_user {
125 /* virtual service addresses */
126 __u16 protocol;
127 __be32 addr; /* virtual ip address */
128 __be16 port;
129 __u32 fwmark; /* firwall mark of service */
130
131 /* virtual service options */
132 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
133 unsigned int flags; /* virtual service flags */
134 unsigned int timeout; /* persistent timeout in sec */
135 __be32 netmask; /* persistent netmask */
136};
137
138
139struct ip_vs_dest_user {
140 /* destination server address */
141 __be32 addr;
142 __be16 port;
143
144 /* real server options */
145 unsigned int conn_flags; /* connection flags */
146 int weight; /* destination weight */
147
148 /* thresholds for active connections */
149 __u32 u_threshold; /* upper threshold */
150 __u32 l_threshold; /* lower threshold */
151};
152
153
154/*
155 * IPVS statistics object (for user space)
156 */
157struct ip_vs_stats_user {
158 __u32 conns; /* connections scheduled */
159 __u32 inpkts; /* incoming packets */
160 __u32 outpkts; /* outgoing packets */
161 __u64 inbytes; /* incoming bytes */
162 __u64 outbytes; /* outgoing bytes */
163
164 __u32 cps; /* current connection rate */
165 __u32 inpps; /* current in packet rate */
166 __u32 outpps; /* current out packet rate */
167 __u32 inbps; /* current in byte rate */
168 __u32 outbps; /* current out byte rate */
169};
170
171
172/* The argument to IP_VS_SO_GET_INFO */
173struct ip_vs_getinfo {
174 /* version number */
175 unsigned int version;
176
177 /* size of connection hash table */
178 unsigned int size;
179
180 /* number of virtual services */
181 unsigned int num_services;
182};
183
184
185/* The argument to IP_VS_SO_GET_SERVICE */
186struct ip_vs_service_entry {
187 /* which service: user fills in these */
188 __u16 protocol;
189 __be32 addr; /* virtual address */
190 __be16 port;
191 __u32 fwmark; /* firwall mark of service */
192
193 /* service options */
194 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
195 unsigned int flags; /* virtual service flags */
196 unsigned int timeout; /* persistent timeout */
197 __be32 netmask; /* persistent netmask */
198
199 /* number of real servers */
200 unsigned int num_dests;
201
202 /* statistics */
203 struct ip_vs_stats_user stats;
204};
205
206
207struct ip_vs_dest_entry {
208 __be32 addr; /* destination address */
209 __be16 port;
210 unsigned int conn_flags; /* connection flags */
211 int weight; /* destination weight */
212
213 __u32 u_threshold; /* upper threshold */
214 __u32 l_threshold; /* lower threshold */
215
216 __u32 activeconns; /* active connections */
217 __u32 inactconns; /* inactive connections */
218 __u32 persistconns; /* persistent connections */
219
220 /* statistics */
221 struct ip_vs_stats_user stats;
222};
223
224
225/* The argument to IP_VS_SO_GET_DESTS */
226struct ip_vs_get_dests {
227 /* which service: user fills in these */
228 __u16 protocol;
229 __be32 addr; /* virtual address */
230 __be16 port;
231 __u32 fwmark; /* firwall mark of service */
232
233 /* number of real servers */
234 unsigned int num_dests;
235
236 /* the real servers */
237 struct ip_vs_dest_entry entrytable[0];
238};
239
240
241/* The argument to IP_VS_SO_GET_SERVICES */
242struct ip_vs_get_services {
243 /* number of virtual services */
244 unsigned int num_services;
245
246 /* service table */
247 struct ip_vs_service_entry entrytable[0];
248};
249
250
251/* The argument to IP_VS_SO_GET_TIMEOUT */
252struct ip_vs_timeout_user {
253 int tcp_timeout;
254 int tcp_fin_timeout;
255 int udp_timeout;
256};
257
258
259/* The argument to IP_VS_SO_GET_DAEMON */
260struct ip_vs_daemon_user {
261 /* sync daemon state (master/backup) */
262 int state;
263
264 /* multicast interface name */
265 char mcast_ifn[IP_VS_IFNAME_MAXLEN];
266
267 /* SyncID we belong to */
268 int syncid;
269};
270
271/*
272 *
273 * IPVS Generic Netlink interface definitions
274 *
275 */
276
277/* Generic Netlink family info */
278
279#define IPVS_GENL_NAME "IPVS"
280#define IPVS_GENL_VERSION 0x1
281
282struct ip_vs_flags {
283 __be32 flags;
284 __be32 mask;
285};
286
287/* Generic Netlink command attributes */
288enum {
289 IPVS_CMD_UNSPEC = 0,
290
291 IPVS_CMD_NEW_SERVICE, /* add service */
292 IPVS_CMD_SET_SERVICE, /* modify service */
293 IPVS_CMD_DEL_SERVICE, /* delete service */
294 IPVS_CMD_GET_SERVICE, /* get service info */
295
296 IPVS_CMD_NEW_DEST, /* add destination */
297 IPVS_CMD_SET_DEST, /* modify destination */
298 IPVS_CMD_DEL_DEST, /* delete destination */
299 IPVS_CMD_GET_DEST, /* get destination info */
300
301 IPVS_CMD_NEW_DAEMON, /* start sync daemon */
302 IPVS_CMD_DEL_DAEMON, /* stop sync daemon */
303 IPVS_CMD_GET_DAEMON, /* get sync daemon status */
304
305 IPVS_CMD_SET_CONFIG, /* set config settings */
306 IPVS_CMD_GET_CONFIG, /* get config settings */
307
308 IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */
309 IPVS_CMD_GET_INFO, /* get general IPVS info */
310
311 IPVS_CMD_ZERO, /* zero all counters and stats */
312 IPVS_CMD_FLUSH, /* flush services and dests */
313
314 __IPVS_CMD_MAX,
315};
316
317#define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1)
318
319/* Attributes used in the first level of commands */
320enum {
321 IPVS_CMD_ATTR_UNSPEC = 0,
322 IPVS_CMD_ATTR_SERVICE, /* nested service attribute */
323 IPVS_CMD_ATTR_DEST, /* nested destination attribute */
324 IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */
325 IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */
326 IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */
327 IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */
328 __IPVS_CMD_ATTR_MAX,
329};
330
331#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
332
333/*
334 * Attributes used to describe a service
335 *
336 * Used inside nested attribute IPVS_CMD_ATTR_SERVICE
337 */
338enum {
339 IPVS_SVC_ATTR_UNSPEC = 0,
340 IPVS_SVC_ATTR_AF, /* address family */
341 IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */
342 IPVS_SVC_ATTR_ADDR, /* virtual service address */
343 IPVS_SVC_ATTR_PORT, /* virtual service port */
344 IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */
345
346 IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */
347 IPVS_SVC_ATTR_FLAGS, /* virtual service flags */
348 IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */
349 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */
350
351 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */
352
353 IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */
354
355 __IPVS_SVC_ATTR_MAX,
356};
357
358#define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
359
360/*
361 * Attributes used to describe a destination (real server)
362 *
363 * Used inside nested attribute IPVS_CMD_ATTR_DEST
364 */
365enum {
366 IPVS_DEST_ATTR_UNSPEC = 0,
367 IPVS_DEST_ATTR_ADDR, /* real server address */
368 IPVS_DEST_ATTR_PORT, /* real server port */
369
370 IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */
371 IPVS_DEST_ATTR_WEIGHT, /* destination weight */
372
373 IPVS_DEST_ATTR_U_THRESH, /* upper threshold */
374 IPVS_DEST_ATTR_L_THRESH, /* lower threshold */
375
376 IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */
377 IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */
378 IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */
379
380 IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */
381 __IPVS_DEST_ATTR_MAX,
382};
383
384#define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1)
385
386/*
387 * Attributes describing a sync daemon
388 *
389 * Used inside nested attribute IPVS_CMD_ATTR_DAEMON
390 */
391enum {
392 IPVS_DAEMON_ATTR_UNSPEC = 0,
393 IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */
394 IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */
395 IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */
396 __IPVS_DAEMON_ATTR_MAX,
397};
398
399#define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1)
400
401/*
402 * Attributes used to describe service or destination entry statistics
403 *
404 * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS
405 */
406enum {
407 IPVS_STATS_ATTR_UNSPEC = 0,
408 IPVS_STATS_ATTR_CONNS, /* connections scheduled */
409 IPVS_STATS_ATTR_INPKTS, /* incoming packets */
410 IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */
411 IPVS_STATS_ATTR_INBYTES, /* incoming bytes */
412 IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */
413
414 IPVS_STATS_ATTR_CPS, /* current connection rate */
415 IPVS_STATS_ATTR_INPPS, /* current in packet rate */
416 IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */
417 IPVS_STATS_ATTR_INBPS, /* current in byte rate */
418 IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */
419 __IPVS_STATS_ATTR_MAX,
420};
421
422#define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1)
423
424/* Attributes used in response to IPVS_CMD_GET_INFO command */
425enum {
426 IPVS_INFO_ATTR_UNSPEC = 0,
427 IPVS_INFO_ATTR_VERSION, /* IPVS version number */
428 IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */
429 __IPVS_INFO_ATTR_MAX,
430};
431
432#define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1)
433
434#endif /* _IP_VS_H */
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index ca833fdc3138..8d861b2651f7 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 48dcba9b2065..1487e7906bbd 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/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
deleted file mode 100644
index df97e6e31e87..000000000000
--- a/include/linux/ipmi_msgdefs.h
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * ipmi_smi.h
3 *
4 * MontaVista IPMI system management 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 __LINUX_IPMI_MSGDEFS_H
35#define __LINUX_IPMI_MSGDEFS_H
36
37/* Various definitions for IPMI messages used by almost everything in
38 the IPMI stack. */
39
40/* NetFNs and commands used inside the IPMI stack. */
41
42#define IPMI_NETFN_SENSOR_EVENT_REQUEST 0x04
43#define IPMI_NETFN_SENSOR_EVENT_RESPONSE 0x05
44#define IPMI_GET_EVENT_RECEIVER_CMD 0x01
45
46#define IPMI_NETFN_APP_REQUEST 0x06
47#define IPMI_NETFN_APP_RESPONSE 0x07
48#define IPMI_GET_DEVICE_ID_CMD 0x01
49#define IPMI_COLD_RESET_CMD 0x02
50#define IPMI_WARM_RESET_CMD 0x03
51#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
52#define IPMI_GET_DEVICE_GUID_CMD 0x08
53#define IPMI_GET_MSG_FLAGS_CMD 0x31
54#define IPMI_SEND_MSG_CMD 0x34
55#define IPMI_GET_MSG_CMD 0x33
56#define IPMI_SET_BMC_GLOBAL_ENABLES_CMD 0x2e
57#define IPMI_GET_BMC_GLOBAL_ENABLES_CMD 0x2f
58#define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35
59#define IPMI_GET_CHANNEL_INFO_CMD 0x42
60
61/* Bit for BMC global enables. */
62#define IPMI_BMC_RCV_MSG_INTR 0x01
63#define IPMI_BMC_EVT_MSG_INTR 0x02
64#define IPMI_BMC_EVT_MSG_BUFF 0x04
65#define IPMI_BMC_SYS_LOG 0x08
66
67#define IPMI_NETFN_STORAGE_REQUEST 0x0a
68#define IPMI_NETFN_STORAGE_RESPONSE 0x0b
69#define IPMI_ADD_SEL_ENTRY_CMD 0x44
70
71#define IPMI_NETFN_FIRMWARE_REQUEST 0x08
72#define IPMI_NETFN_FIRMWARE_RESPONSE 0x09
73
74/* The default slave address */
75#define IPMI_BMC_SLAVE_ADDR 0x20
76
77/* The BT interface on high-end HP systems supports up to 255 bytes in
78 * one transfer. Its "virtual" BMC supports some commands that are longer
79 * than 128 bytes. Use the full 256, plus NetFn/LUN, Cmd, cCode, plus
80 * some overhead; it's not worth the effort to dynamically size this based
81 * on the results of the "Get BT Capabilities" command. */
82#define IPMI_MAX_MSG_LENGTH 272 /* multiple of 16 */
83
84#define IPMI_CC_NO_ERROR 0x00
85#define IPMI_NODE_BUSY_ERR 0xc0
86#define IPMI_INVALID_COMMAND_ERR 0xc1
87#define IPMI_TIMEOUT_ERR 0xc3
88#define IPMI_ERR_MSG_TRUNCATED 0xc6
89#define IPMI_REQ_LEN_INVALID_ERR 0xc7
90#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc8
91#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */
92#define IPMI_LOST_ARBITRATION_ERR 0x81
93#define IPMI_BUS_ERR 0x82
94#define IPMI_NAK_ON_WRITE_ERR 0x83
95#define IPMI_ERR_UNSPECIFIED 0xff
96
97#define IPMI_CHANNEL_PROTOCOL_IPMB 1
98#define IPMI_CHANNEL_PROTOCOL_ICMB 2
99#define IPMI_CHANNEL_PROTOCOL_SMBUS 4
100#define IPMI_CHANNEL_PROTOCOL_KCS 5
101#define IPMI_CHANNEL_PROTOCOL_SMIC 6
102#define IPMI_CHANNEL_PROTOCOL_BT10 7
103#define IPMI_CHANNEL_PROTOCOL_BT15 8
104#define IPMI_CHANNEL_PROTOCOL_TMODE 9
105
106#define IPMI_CHANNEL_MEDIUM_IPMB 1
107#define IPMI_CHANNEL_MEDIUM_ICMB10 2
108#define IPMI_CHANNEL_MEDIUM_ICMB09 3
109#define IPMI_CHANNEL_MEDIUM_8023LAN 4
110#define IPMI_CHANNEL_MEDIUM_ASYNC 5
111#define IPMI_CHANNEL_MEDIUM_OTHER_LAN 6
112#define IPMI_CHANNEL_MEDIUM_PCI_SMBUS 7
113#define IPMI_CHANNEL_MEDIUM_SMBUS1 8
114#define IPMI_CHANNEL_MEDIUM_SMBUS2 9
115#define IPMI_CHANNEL_MEDIUM_USB1 10
116#define IPMI_CHANNEL_MEDIUM_USB2 11
117#define IPMI_CHANNEL_MEDIUM_SYSINTF 12
118#define IPMI_CHANNEL_MEDIUM_OEM_MIN 0x60
119#define IPMI_CHANNEL_MEDIUM_OEM_MAX 0x7f
120
121#endif /* __LINUX_IPMI_MSGDEFS_H */
diff --git a/include/linux/ipsec.h b/include/linux/ipsec.h
deleted file mode 100644
index d17a6302a0e9..000000000000
--- a/include/linux/ipsec.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef _LINUX_IPSEC_H
2#define _LINUX_IPSEC_H
3
4/* The definitions, required to talk to KAME racoon IKE. */
5
6#include <linux/pfkeyv2.h>
7
8#define IPSEC_PORT_ANY 0
9#define IPSEC_ULPROTO_ANY 255
10#define IPSEC_PROTO_ANY 255
11
12enum {
13 IPSEC_MODE_ANY = 0, /* We do not support this for SA */
14 IPSEC_MODE_TRANSPORT = 1,
15 IPSEC_MODE_TUNNEL = 2,
16 IPSEC_MODE_BEET = 3
17};
18
19enum {
20 IPSEC_DIR_ANY = 0,
21 IPSEC_DIR_INBOUND = 1,
22 IPSEC_DIR_OUTBOUND = 2,
23 IPSEC_DIR_FWD = 3, /* It is our own */
24 IPSEC_DIR_MAX = 4,
25 IPSEC_DIR_INVALID = 5
26};
27
28enum {
29 IPSEC_POLICY_DISCARD = 0,
30 IPSEC_POLICY_NONE = 1,
31 IPSEC_POLICY_IPSEC = 2,
32 IPSEC_POLICY_ENTRUST = 3,
33 IPSEC_POLICY_BYPASS = 4
34};
35
36enum {
37 IPSEC_LEVEL_DEFAULT = 0,
38 IPSEC_LEVEL_USE = 1,
39 IPSEC_LEVEL_REQUIRE = 2,
40 IPSEC_LEVEL_UNIQUE = 3
41};
42
43#define IPSEC_MANUAL_REQID_MAX 0x3fff
44
45#define IPSEC_REPLAYWSIZE 32
46
47#endif /* _LINUX_IPSEC_H */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 0b94e91ed685..bcba48a97868 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 1e7d8af2defe..25b5f1f5e780 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/ipx.h b/include/linux/ipx.h
deleted file mode 100644
index 3d48014cdd71..000000000000
--- a/include/linux/ipx.h
+++ /dev/null
@@ -1,75 +0,0 @@
1#ifndef _IPX_H_
2#define _IPX_H_
3#include <linux/types.h>
4#include <linux/sockios.h>
5#include <linux/socket.h>
6#define IPX_NODE_LEN 6
7#define IPX_MTU 576
8
9struct sockaddr_ipx {
10 __kernel_sa_family_t sipx_family;
11 __be16 sipx_port;
12 __be32 sipx_network;
13 unsigned char sipx_node[IPX_NODE_LEN];
14 __u8 sipx_type;
15 unsigned char sipx_zero; /* 16 byte fill */
16};
17
18/*
19 * So we can fit the extra info for SIOCSIFADDR into the address nicely
20 */
21#define sipx_special sipx_port
22#define sipx_action sipx_zero
23#define IPX_DLTITF 0
24#define IPX_CRTITF 1
25
26struct ipx_route_definition {
27 __be32 ipx_network;
28 __be32 ipx_router_network;
29 unsigned char ipx_router_node[IPX_NODE_LEN];
30};
31
32struct ipx_interface_definition {
33 __be32 ipx_network;
34 unsigned char ipx_device[16];
35 unsigned char ipx_dlink_type;
36#define IPX_FRAME_NONE 0
37#define IPX_FRAME_SNAP 1
38#define IPX_FRAME_8022 2
39#define IPX_FRAME_ETHERII 3
40#define IPX_FRAME_8023 4
41#define IPX_FRAME_TR_8022 5 /* obsolete */
42 unsigned char ipx_special;
43#define IPX_SPECIAL_NONE 0
44#define IPX_PRIMARY 1
45#define IPX_INTERNAL 2
46 unsigned char ipx_node[IPX_NODE_LEN];
47};
48
49struct ipx_config_data {
50 unsigned char ipxcfg_auto_select_primary;
51 unsigned char ipxcfg_auto_create_interfaces;
52};
53
54/*
55 * OLD Route Definition for backward compatibility.
56 */
57
58struct ipx_route_def {
59 __be32 ipx_network;
60 __be32 ipx_router_network;
61#define IPX_ROUTE_NO_ROUTER 0
62 unsigned char ipx_router_node[IPX_NODE_LEN];
63 unsigned char ipx_device[16];
64 unsigned short ipx_flags;
65#define IPX_RT_SNAP 8
66#define IPX_RT_8022 4
67#define IPX_RT_BLUEBOOK 2
68#define IPX_RT_ROUTED 1
69};
70
71#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
72#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
73#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
74#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
75#endif /* _IPX_H_ */
diff --git a/include/linux/irda.h b/include/linux/irda.h
deleted file mode 100644
index a014c3252311..000000000000
--- a/include/linux/irda.h
+++ /dev/null
@@ -1,251 +0,0 @@
1/*********************************************************************
2 *
3 * Filename: irda.h
4 * Version:
5 * Description:
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Mon Mar 8 14:06:12 1999
9 * Modified at: Sat Dec 25 16:06:42 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
11 *
12 * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
22 *
23 ********************************************************************/
24
25#ifndef KERNEL_IRDA_H
26#define KERNEL_IRDA_H
27
28#include <linux/types.h>
29#include <linux/socket.h>
30
31/* Note that this file is shared with user space. */
32
33/* Hint bit positions for first hint byte */
34#define HINT_PNP 0x01
35#define HINT_PDA 0x02
36#define HINT_COMPUTER 0x04
37#define HINT_PRINTER 0x08
38#define HINT_MODEM 0x10
39#define HINT_FAX 0x20
40#define HINT_LAN 0x40
41#define HINT_EXTENSION 0x80
42
43/* Hint bit positions for second hint byte (first extension byte) */
44#define HINT_TELEPHONY 0x01
45#define HINT_FILE_SERVER 0x02
46#define HINT_COMM 0x04
47#define HINT_MESSAGE 0x08
48#define HINT_HTTP 0x10
49#define HINT_OBEX 0x20
50
51/* IrLMP character code values */
52#define CS_ASCII 0x00
53#define CS_ISO_8859_1 0x01
54#define CS_ISO_8859_2 0x02
55#define CS_ISO_8859_3 0x03
56#define CS_ISO_8859_4 0x04
57#define CS_ISO_8859_5 0x05
58#define CS_ISO_8859_6 0x06
59#define CS_ISO_8859_7 0x07
60#define CS_ISO_8859_8 0x08
61#define CS_ISO_8859_9 0x09
62#define CS_UNICODE 0xff
63
64/* These are the currently known dongles */
65typedef enum {
66 IRDA_TEKRAM_DONGLE = 0,
67 IRDA_ESI_DONGLE = 1,
68 IRDA_ACTISYS_DONGLE = 2,
69 IRDA_ACTISYS_PLUS_DONGLE = 3,
70 IRDA_GIRBIL_DONGLE = 4,
71 IRDA_LITELINK_DONGLE = 5,
72 IRDA_AIRPORT_DONGLE = 6,
73 IRDA_OLD_BELKIN_DONGLE = 7,
74 IRDA_EP7211_IR = 8,
75 IRDA_MCP2120_DONGLE = 9,
76 IRDA_ACT200L_DONGLE = 10,
77 IRDA_MA600_DONGLE = 11,
78 IRDA_TOIM3232_DONGLE = 12,
79 IRDA_EP7211_DONGLE = 13,
80} IRDA_DONGLE;
81
82/* Protocol types to be used for SOCK_DGRAM */
83enum {
84 IRDAPROTO_UNITDATA = 0,
85 IRDAPROTO_ULTRA = 1,
86 IRDAPROTO_MAX
87};
88
89#define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
90#define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
91
92#define IRLMP_ENUMDEVICES 1 /* Return discovery log */
93#define IRLMP_IAS_SET 2 /* Set an attribute in local IAS */
94#define IRLMP_IAS_QUERY 3 /* Query remote IAS for attribute */
95#define IRLMP_HINTS_SET 4 /* Set hint bits advertised */
96#define IRLMP_QOS_SET 5
97#define IRLMP_QOS_GET 6
98#define IRLMP_MAX_SDU_SIZE 7
99#define IRLMP_IAS_GET 8 /* Get an attribute from local IAS */
100#define IRLMP_IAS_DEL 9 /* Remove attribute from local IAS */
101#define IRLMP_HINT_MASK_SET 10 /* Set discovery filter */
102#define IRLMP_WAITDEVICE 11 /* Wait for a new discovery */
103
104#define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
105
106#define IAS_MAX_STRING 256 /* See IrLMP 1.1, 4.3.3.2 */
107#define IAS_MAX_OCTET_STRING 1024 /* See IrLMP 1.1, 4.3.3.2 */
108#define IAS_MAX_CLASSNAME 60 /* See IrLMP 1.1, 4.3.1 */
109#define IAS_MAX_ATTRIBNAME 60 /* See IrLMP 1.1, 4.3.3.1 */
110#define IAS_MAX_ATTRIBNUMBER 256 /* See IrLMP 1.1, 4.3.3.1 */
111/* For user space backward compatibility - may be fixed in kernel 2.5.X
112 * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
113#define IAS_EXPORT_CLASSNAME 64
114#define IAS_EXPORT_ATTRIBNAME 256
115
116/* Attribute type needed for struct irda_ias_set */
117#define IAS_MISSING 0
118#define IAS_INTEGER 1
119#define IAS_OCT_SEQ 2
120#define IAS_STRING 3
121
122#define LSAP_ANY 0xff
123
124struct sockaddr_irda {
125 __kernel_sa_family_t sir_family; /* AF_IRDA */
126 __u8 sir_lsap_sel; /* LSAP selector */
127 __u32 sir_addr; /* Device address */
128 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
129};
130
131struct irda_device_info {
132 __u32 saddr; /* Address of local interface */
133 __u32 daddr; /* Address of remote device */
134 char info[22]; /* Description */
135 __u8 charset; /* Charset used for description */
136 __u8 hints[2]; /* Hint bits */
137};
138
139struct irda_device_list {
140 __u32 len;
141 struct irda_device_info dev[1];
142};
143
144struct irda_ias_set {
145 char irda_class_name[IAS_EXPORT_CLASSNAME];
146 char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
147 unsigned int irda_attrib_type;
148 union {
149 unsigned int irda_attrib_int;
150 struct {
151 unsigned short len;
152 __u8 octet_seq[IAS_MAX_OCTET_STRING];
153 } irda_attrib_octet_seq;
154 struct {
155 __u8 len;
156 __u8 charset;
157 __u8 string[IAS_MAX_STRING];
158 } irda_attrib_string;
159 } attribute;
160 __u32 daddr; /* Address of device (for some queries only) */
161};
162
163/* Some private IOCTL's (max 16) */
164#define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
165#define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
166#define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
167#define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
168#define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
169#define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
170#define SIOCSMODE (SIOCDEVPRIVATE + 6)
171#define SIOCGMODE (SIOCDEVPRIVATE + 7)
172#define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
173#define SIOCGQOS (SIOCDEVPRIVATE + 9)
174
175/* No reason to include <linux/if.h> just because of this one ;-) */
176#define IRNAMSIZ 16
177
178/* IrDA quality of service information (must not exceed 16 bytes) */
179struct if_irda_qos {
180 unsigned long baudrate;
181 unsigned short data_size;
182 unsigned short window_size;
183 unsigned short min_turn_time;
184 unsigned short max_turn_time;
185 unsigned char add_bofs;
186 unsigned char link_disc;
187};
188
189/* For setting RTS and DTR lines of a dongle */
190struct if_irda_line {
191 __u8 dtr;
192 __u8 rts;
193};
194
195/* IrDA interface configuration (data part must not exceed 16 bytes) */
196struct if_irda_req {
197 union {
198 char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
199 } ifr_ifrn;
200
201 /* Data part */
202 union {
203 struct if_irda_line ifru_line;
204 struct if_irda_qos ifru_qos;
205 unsigned short ifru_flags;
206 unsigned int ifru_receiving;
207 unsigned int ifru_mode;
208 unsigned int ifru_dongle;
209 } ifr_ifru;
210};
211
212#define ifr_baudrate ifr_ifru.ifru_qos.baudrate
213#define ifr_receiving ifr_ifru.ifru_receiving
214#define ifr_dongle ifr_ifru.ifru_dongle
215#define ifr_mode ifr_ifru.ifru_mode
216#define ifr_dtr ifr_ifru.ifru_line.dtr
217#define ifr_rts ifr_ifru.ifru_line.rts
218
219
220/* IrDA netlink definitions */
221#define IRDA_NL_NAME "irda"
222#define IRDA_NL_VERSION 1
223
224enum irda_nl_commands {
225 IRDA_NL_CMD_UNSPEC,
226 IRDA_NL_CMD_SET_MODE,
227 IRDA_NL_CMD_GET_MODE,
228
229 __IRDA_NL_CMD_AFTER_LAST
230};
231#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
232
233enum nl80211_attrs {
234 IRDA_NL_ATTR_UNSPEC,
235 IRDA_NL_ATTR_IFNAME,
236 IRDA_NL_ATTR_MODE,
237
238 __IRDA_NL_ATTR_AFTER_LAST
239};
240#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
241
242/* IrDA modes */
243#define IRDA_MODE_PRIMARY 0x1
244#define IRDA_MODE_SECONDARY 0x2
245#define IRDA_MODE_MONITOR 0x4
246
247#endif /* KERNEL_IRDA_H */
248
249
250
251
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 3bc4dcab6e82..0a2dc46cdaf6 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 215c41602af8..1e9a0f2a8626 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 a5a50f523807..19ab361f9f07 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 8687a7dc0632..d5f62bc5f4be 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 b8c23f88dd54..0fc6ff276221 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/iso_fs.h b/include/linux/iso_fs.h
deleted file mode 100644
index 4688ac4284e2..000000000000
--- a/include/linux/iso_fs.h
+++ /dev/null
@@ -1,165 +0,0 @@
1#ifndef _ISOFS_FS_H
2#define _ISOFS_FS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6
7/*
8 * The isofs filesystem constants/structures
9 */
10
11/* This part borrowed from the bsd386 isofs */
12#define ISODCL(from, to) (to - from + 1)
13
14struct iso_volume_descriptor {
15 char type[ISODCL(1,1)]; /* 711 */
16 char id[ISODCL(2,6)];
17 char version[ISODCL(7,7)];
18 char data[ISODCL(8,2048)];
19};
20
21/* volume descriptor types */
22#define ISO_VD_PRIMARY 1
23#define ISO_VD_SUPPLEMENTARY 2
24#define ISO_VD_END 255
25
26#define ISO_STANDARD_ID "CD001"
27
28struct iso_primary_descriptor {
29 char type [ISODCL ( 1, 1)]; /* 711 */
30 char id [ISODCL ( 2, 6)];
31 char version [ISODCL ( 7, 7)]; /* 711 */
32 char unused1 [ISODCL ( 8, 8)];
33 char system_id [ISODCL ( 9, 40)]; /* achars */
34 char volume_id [ISODCL ( 41, 72)]; /* dchars */
35 char unused2 [ISODCL ( 73, 80)];
36 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
37 char unused3 [ISODCL ( 89, 120)];
38 char volume_set_size [ISODCL (121, 124)]; /* 723 */
39 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
40 char logical_block_size [ISODCL (129, 132)]; /* 723 */
41 char path_table_size [ISODCL (133, 140)]; /* 733 */
42 char type_l_path_table [ISODCL (141, 144)]; /* 731 */
43 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
44 char type_m_path_table [ISODCL (149, 152)]; /* 732 */
45 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
46 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
47 char volume_set_id [ISODCL (191, 318)]; /* dchars */
48 char publisher_id [ISODCL (319, 446)]; /* achars */
49 char preparer_id [ISODCL (447, 574)]; /* achars */
50 char application_id [ISODCL (575, 702)]; /* achars */
51 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
52 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
53 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
54 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
55 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
56 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
57 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
58 char file_structure_version [ISODCL (882, 882)]; /* 711 */
59 char unused4 [ISODCL (883, 883)];
60 char application_data [ISODCL (884, 1395)];
61 char unused5 [ISODCL (1396, 2048)];
62};
63
64/* Almost the same as the primary descriptor but two fields are specified */
65struct iso_supplementary_descriptor {
66 char type [ISODCL ( 1, 1)]; /* 711 */
67 char id [ISODCL ( 2, 6)];
68 char version [ISODCL ( 7, 7)]; /* 711 */
69 char flags [ISODCL ( 8, 8)]; /* 853 */
70 char system_id [ISODCL ( 9, 40)]; /* achars */
71 char volume_id [ISODCL ( 41, 72)]; /* dchars */
72 char unused2 [ISODCL ( 73, 80)];
73 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
74 char escape [ISODCL ( 89, 120)]; /* 856 */
75 char volume_set_size [ISODCL (121, 124)]; /* 723 */
76 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
77 char logical_block_size [ISODCL (129, 132)]; /* 723 */
78 char path_table_size [ISODCL (133, 140)]; /* 733 */
79 char type_l_path_table [ISODCL (141, 144)]; /* 731 */
80 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
81 char type_m_path_table [ISODCL (149, 152)]; /* 732 */
82 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
83 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
84 char volume_set_id [ISODCL (191, 318)]; /* dchars */
85 char publisher_id [ISODCL (319, 446)]; /* achars */
86 char preparer_id [ISODCL (447, 574)]; /* achars */
87 char application_id [ISODCL (575, 702)]; /* achars */
88 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
89 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
90 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
91 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
92 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
93 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
94 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
95 char file_structure_version [ISODCL (882, 882)]; /* 711 */
96 char unused4 [ISODCL (883, 883)];
97 char application_data [ISODCL (884, 1395)];
98 char unused5 [ISODCL (1396, 2048)];
99};
100
101
102#define HS_STANDARD_ID "CDROM"
103
104struct hs_volume_descriptor {
105 char foo [ISODCL ( 1, 8)]; /* 733 */
106 char type [ISODCL ( 9, 9)]; /* 711 */
107 char id [ISODCL ( 10, 14)];
108 char version [ISODCL ( 15, 15)]; /* 711 */
109 char data[ISODCL(16,2048)];
110};
111
112
113struct hs_primary_descriptor {
114 char foo [ISODCL ( 1, 8)]; /* 733 */
115 char type [ISODCL ( 9, 9)]; /* 711 */
116 char id [ISODCL ( 10, 14)];
117 char version [ISODCL ( 15, 15)]; /* 711 */
118 char unused1 [ISODCL ( 16, 16)]; /* 711 */
119 char system_id [ISODCL ( 17, 48)]; /* achars */
120 char volume_id [ISODCL ( 49, 80)]; /* dchars */
121 char unused2 [ISODCL ( 81, 88)]; /* 733 */
122 char volume_space_size [ISODCL ( 89, 96)]; /* 733 */
123 char unused3 [ISODCL ( 97, 128)]; /* 733 */
124 char volume_set_size [ISODCL (129, 132)]; /* 723 */
125 char volume_sequence_number [ISODCL (133, 136)]; /* 723 */
126 char logical_block_size [ISODCL (137, 140)]; /* 723 */
127 char path_table_size [ISODCL (141, 148)]; /* 733 */
128 char type_l_path_table [ISODCL (149, 152)]; /* 731 */
129 char unused4 [ISODCL (153, 180)]; /* 733 */
130 char root_directory_record [ISODCL (181, 214)]; /* 9.1 */
131};
132
133/* We use this to help us look up the parent inode numbers. */
134
135struct iso_path_table{
136 unsigned char name_len[2]; /* 721 */
137 char extent[4]; /* 731 */
138 char parent[2]; /* 721 */
139 char name[0];
140} __attribute__((packed));
141
142/* high sierra is identical to iso, except that the date is only 6 bytes, and
143 there is an extra reserved byte after the flags */
144
145struct iso_directory_record {
146 char length [ISODCL (1, 1)]; /* 711 */
147 char ext_attr_length [ISODCL (2, 2)]; /* 711 */
148 char extent [ISODCL (3, 10)]; /* 733 */
149 char size [ISODCL (11, 18)]; /* 733 */
150 char date [ISODCL (19, 25)]; /* 7 by 711 */
151 char flags [ISODCL (26, 26)];
152 char file_unit_size [ISODCL (27, 27)]; /* 711 */
153 char interleave [ISODCL (28, 28)]; /* 711 */
154 char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
155 unsigned char name_len [ISODCL (33, 33)]; /* 711 */
156 char name [0];
157} __attribute__((packed));
158
159#define ISOFS_BLOCK_BITS 11
160#define ISOFS_BLOCK_SIZE 2048
161
162#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
163#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
164
165#endif /* _ISOFS_FS_H */
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h
deleted file mode 100644
index 42bf725751af..000000000000
--- a/include/linux/ivtv.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 Public ivtv API header
3 Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
4 Copyright (C) 2004-2007 Hans Verkuil <hverkuil@xs4all.nl>
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
21#ifndef __LINUX_IVTV_H__
22#define __LINUX_IVTV_H__
23
24#include <linux/compiler.h>
25#include <linux/types.h>
26#include <linux/videodev2.h>
27
28/* ivtv knows several distinct output modes: MPEG streaming,
29 YUV streaming, YUV updates through user DMA and the passthrough
30 mode.
31
32 In order to clearly tell the driver that we are in user DMA
33 YUV mode you need to call IVTV_IOC_DMA_FRAME with y_source == NULL
34 first (althrough if you don't then the first time
35 DMA_FRAME is called the mode switch is done automatically).
36
37 When you close the file handle the user DMA mode is exited again.
38
39 While in one mode, you cannot use another mode (EBUSY is returned).
40
41 All this means that if you want to change the YUV interlacing
42 for the user DMA YUV mode you first need to do call IVTV_IOC_DMA_FRAME
43 with y_source == NULL before you can set the correct format using
44 VIDIOC_S_FMT.
45
46 Eventually all this should be replaced with a proper V4L2 API,
47 but for now we have to do it this way. */
48
49struct ivtv_dma_frame {
50 enum v4l2_buf_type type; /* V4L2_BUF_TYPE_VIDEO_OUTPUT */
51 __u32 pixelformat; /* 0 == same as destination */
52 void __user *y_source; /* if NULL and type == V4L2_BUF_TYPE_VIDEO_OUTPUT,
53 then just switch to user DMA YUV output mode */
54 void __user *uv_source; /* Unused for RGB pixelformats */
55 struct v4l2_rect src;
56 struct v4l2_rect dst;
57 __u32 src_width;
58 __u32 src_height;
59};
60
61#define IVTV_IOC_DMA_FRAME _IOW ('V', BASE_VIDIOC_PRIVATE+0, struct ivtv_dma_frame)
62
63/* Select the passthrough mode (if the argument is non-zero). In the passthrough
64 mode the output of the encoder is passed immediately into the decoder. */
65#define IVTV_IOC_PASSTHROUGH_MODE _IOW ('V', BASE_VIDIOC_PRIVATE+1, int)
66
67/* Deprecated defines: applications should use the defines from videodev2.h */
68#define IVTV_SLICED_TYPE_TELETEXT_B V4L2_MPEG_VBI_IVTV_TELETEXT_B
69#define IVTV_SLICED_TYPE_CAPTION_525 V4L2_MPEG_VBI_IVTV_CAPTION_525
70#define IVTV_SLICED_TYPE_WSS_625 V4L2_MPEG_VBI_IVTV_WSS_625
71#define IVTV_SLICED_TYPE_VPS V4L2_MPEG_VBI_IVTV_VPS
72
73#endif /* _LINUX_IVTV_H */
diff --git a/include/linux/ivtvfb.h b/include/linux/ivtvfb.h
deleted file mode 100644
index e8b92f67f10d..000000000000
--- a/include/linux/ivtvfb.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 On Screen Display cx23415 Framebuffer driver
3
4 Copyright (C) 2006, 2007 Ian Armstrong <ian@iarmst.demon.co.uk>
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
21#ifndef __LINUX_IVTVFB_H__
22#define __LINUX_IVTVFB_H__
23
24#include <linux/compiler.h>
25#include <linux/types.h>
26
27/* Framebuffer external API */
28
29struct ivtvfb_dma_frame {
30 void __user *source;
31 unsigned long dest_offset;
32 int count;
33};
34
35#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame)
36
37#endif
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
deleted file mode 100644
index 94ab5e942e53..000000000000
--- a/include/linux/ixjuser.h
+++ /dev/null
@@ -1,720 +0,0 @@
1#ifndef __LINUX_IXJUSER_H
2#define __LINUX_IXJUSER_H
3
4/******************************************************************************
5 *
6 * ixjuser.h
7 *
8 * Device Driver for Quicknet Technologies, Inc.'s Telephony cards
9 * including the Internet PhoneJACK, Internet PhoneJACK Lite,
10 * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and
11 * SmartCABLE
12 *
13 * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
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 * Author: Ed Okerson, <eokerson@quicknet.net>
21 *
22 * Contributors: Greg Herlein, <gherlein@quicknet.net>
23 * David W. Erhart, <derhart@quicknet.net>
24 * John Sellers, <jsellers@quicknet.net>
25 * Mike Preston, <mpreston@quicknet.net>
26 *
27 * More information about the hardware related to this driver can be found
28 * at our website: http://www.quicknet.net
29 *
30 * Fixes:
31 *
32 * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
33 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
34 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
35 * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
38 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
39 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
40 * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
41 * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
42 *
43 *****************************************************************************/
44
45#include <linux/telephony.h>
46
47
48/******************************************************************************
49*
50* IOCTL's used for the Quicknet Telephony Cards
51*
52* If you use the IXJCTL_TESTRAM command, the card must be power cycled to
53* reset the SRAM values before further use.
54*
55******************************************************************************/
56
57#define IXJCTL_DSP_RESET _IO ('q', 0xC0)
58
59#define IXJCTL_RING PHONE_RING
60#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE
61#define IXJCTL_MAXRINGS PHONE_MAXRINGS
62#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE
63#define IXJCTL_RING_START PHONE_RING_START
64#define IXJCTL_RING_STOP PHONE_RING_STOP
65
66#define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int)
67#define IXJCTL_SERIAL _IOR ('q', 0xC2, int)
68#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int)
69#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int)
70#define IXJCTL_VERSION _IOR ('q', 0xDA, char *)
71#define IXJCTL_DSP_IDLE _IO ('q', 0xC5)
72#define IXJCTL_TESTRAM _IO ('q', 0xC6)
73
74/******************************************************************************
75*
76* This group of IOCTLs deal with the record settings of the DSP
77*
78* The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP.
79* Setting a lower depth reduces latency, but increases the demand of the
80* application to service the driver without frame loss. The DSP has 480
81* bytes of physical buffer memory for the record channel so the true
82* maximum limit is determined by how many frames will fit in the buffer.
83*
84* 1 uncompressed (480 byte) 16-bit linear frame.
85* 2 uncompressed (240 byte) 8-bit A-law/mu-law frames.
86* 15 TrueSpeech 8.5 frames.
87* 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames.
88*
89* The default in the driver is currently set to 2 frames.
90*
91* The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8
92* number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the
93* signal by 2.0, 0x80 scales the signal by 0.5. No protection is given
94* against over-scaling, if the multiplication factor times the input
95* signal exceeds 16 bits, overflow distortion will occur. The default
96* setting is 0x100 (1.0).
97*
98* The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on
99* the most recently recorded frame as a 16 bit value.
100******************************************************************************/
101
102#define IXJCTL_REC_CODEC PHONE_REC_CODEC
103#define IXJCTL_REC_START PHONE_REC_START
104#define IXJCTL_REC_STOP PHONE_REC_STOP
105#define IXJCTL_REC_DEPTH PHONE_REC_DEPTH
106#define IXJCTL_FRAME PHONE_FRAME
107#define IXJCTL_REC_VOLUME PHONE_REC_VOLUME
108#define IXJCTL_REC_LEVEL PHONE_REC_LEVEL
109
110typedef enum {
111 f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50,
112 f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400,
113 f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450,
114 f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450,
115 f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587,
116 f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850,
117 f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400,
118 f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336,
119 lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860
120} IXJ_FILTER_FREQ;
121
122typedef struct {
123 unsigned int filter;
124 IXJ_FILTER_FREQ freq;
125 char enable;
126} IXJ_FILTER;
127
128typedef struct {
129 char enable;
130 char en_filter;
131 unsigned int filter;
132 unsigned int on1;
133 unsigned int off1;
134 unsigned int on2;
135 unsigned int off2;
136 unsigned int on3;
137 unsigned int off3;
138} IXJ_FILTER_CADENCE;
139
140#define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *)
141#define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *)
142#define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int)
143#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *)
144#define IXJCTL_PLAY_CID _IO ('q', 0xD7)
145/******************************************************************************
146*
147* This IOCTL allows you to reassign values in the tone index table. The
148* tone table has 32 entries (0 - 31), but the driver only allows entries
149* 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are
150* the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D.
151* The positions used internally for Call Progress Tones are as follows:
152* Dial Tone - 25
153* Ring Back - 26
154* Busy Signal - 27
155*
156* The freq values are calculated as:
157* freq = cos(2 * PI * frequency / 8000)
158*
159* The most commonly needed values are already calculated and listed in the
160* enum IXJ_TONE_FREQ. Each tone index can have two frequencies with
161* different gains, if you are only using a single frequency set the unused
162* one to 0.
163*
164* The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB
165* increments.
166*
167******************************************************************************/
168
169typedef enum {
170 hz20 = 0x7ffa,
171 hz50 = 0x7fe5,
172 hz133 = 0x7f4c,
173 hz200 = 0x7e6b,
174 hz261 = 0x7d50, /* .63 C1 */
175 hz277 = 0x7cfa, /* .18 CS1 */
176 hz293 = 0x7c9f, /* .66 D1 */
177 hz300 = 0x7c75,
178 hz311 = 0x7c32, /* .13 DS1 */
179 hz329 = 0x7bbf, /* .63 E1 */
180 hz330 = 0x7bb8,
181 hz340 = 0x7b75,
182 hz349 = 0x7b37, /* .23 F1 */
183 hz350 = 0x7b30,
184 hz360 = 0x7ae9,
185 hz369 = 0x7aa8, /* .99 FS1 */
186 hz380 = 0x7a56,
187 hz392 = 0x79fa, /* .00 G1 */
188 hz400 = 0x79bb,
189 hz415 = 0x7941, /* .30 GS1 */
190 hz420 = 0x7918,
191 hz425 = 0x78ee,
192 hz435 = 0x7899,
193 hz440 = 0x786d, /* .00 A1 */
194 hz445 = 0x7842,
195 hz450 = 0x7815,
196 hz452 = 0x7803,
197 hz466 = 0x7784, /* .16 AS1 */
198 hz475 = 0x7731,
199 hz480 = 0x7701,
200 hz493 = 0x7685, /* .88 B1 */
201 hz494 = 0x767b,
202 hz500 = 0x7640,
203 hz520 = 0x7578,
204 hz523 = 0x7559, /* .25 C2 */
205 hz525 = 0x7544,
206 hz540 = 0x74a7,
207 hz554 = 0x7411, /* .37 CS2 */
208 hz587 = 0x72a1, /* .33 D2 */
209 hz590 = 0x727f,
210 hz600 = 0x720b,
211 hz620 = 0x711e,
212 hz622 = 0x7106, /* .25 DS2 */
213 hz659 = 0x6f3b, /* .26 E2 */
214 hz660 = 0x6f2e,
215 hz698 = 0x6d3d, /* .46 F2 */
216 hz700 = 0x6d22,
217 hz739 = 0x6b09, /* .99 FS2 */
218 hz740 = 0x6afa,
219 hz750 = 0x6a6c,
220 hz770 = 0x694b,
221 hz783 = 0x688b, /* .99 G2 */
222 hz800 = 0x678d,
223 hz816 = 0x6698,
224 hz830 = 0x65bf, /* .61 GS2 */
225 hz850 = 0x6484,
226 hz857 = 0x6414,
227 hz880 = 0x629f, /* .00 A2 */
228 hz900 = 0x6154,
229 hz932 = 0x5f35, /* .33 AS2 */
230 hz935 = 0x5f01,
231 hz941 = 0x5e9a,
232 hz942 = 0x5e88,
233 hz950 = 0x5dfd,
234 hz975 = 0x5c44,
235 hz1000 = 0x5a81,
236 hz1020 = 0x5912,
237 hz1050 = 0x56e2,
238 hz1100 = 0x5320,
239 hz1140 = 0x5007,
240 hz1200 = 0x4b3b,
241 hz1209 = 0x4a80,
242 hz1215 = 0x4a02,
243 hz1250 = 0x471c,
244 hz1300 = 0x42e0,
245 hz1330 = 0x4049,
246 hz1336 = 0x3fc4,
247 hz1366 = 0x3d22,
248 hz1380 = 0x3be4,
249 hz1400 = 0x3a1b,
250 hz1450 = 0x3596,
251 hz1477 = 0x331c,
252 hz1500 = 0x30fb,
253 hz1600 = 0x278d,
254 hz1633 = 0x2462,
255 hz1638 = 0x23e7,
256 hz1645 = 0x233a,
257 hz1750 = 0x18f8,
258 hz1800 = 0x1405,
259 hz1860 = 0xe0b,
260 hz2100 = 0xf5f6,
261 hz2130 = 0xf2f5,
262 hz2450 = 0xd3b3,
263 hz2750 = 0xb8e4
264} IXJ_FREQ;
265
266typedef enum {
267 C1 = hz261,
268 CS1 = hz277,
269 D1 = hz293,
270 DS1 = hz311,
271 E1 = hz329,
272 F1 = hz349,
273 FS1 = hz369,
274 G1 = hz392,
275 GS1 = hz415,
276 A1 = hz440,
277 AS1 = hz466,
278 B1 = hz493,
279 C2 = hz523,
280 CS2 = hz554,
281 D2 = hz587,
282 DS2 = hz622,
283 E2 = hz659,
284 F2 = hz698,
285 FS2 = hz739,
286 G2 = hz783,
287 GS2 = hz830,
288 A2 = hz880,
289 AS2 = hz932,
290} IXJ_NOTE;
291
292typedef struct {
293 int tone_index;
294 int freq0;
295 int gain0;
296 int freq1;
297 int gain1;
298} IXJ_TONE;
299
300#define IXJCTL_INIT_TONE _IOW ('q', 0xC9, IXJ_TONE *)
301
302/******************************************************************************
303*
304* The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various
305* Call Progress Tones (CPT). This is accomplished by setting up an array of
306* IXJ_CADENCE_ELEMENT structures that sequentially define the states of
307* the tone sequence. The tone_on_time and tone_off time are in
308* 250 microsecond intervals. A pointer to this array is passed to the
309* driver as the ce element of an IXJ_CADENCE structure. The elements_used
310* must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The
311* termination variable defines what to do at the end of a cadence, the
312* options are to play the cadence once and stop, to repeat the last
313* element of the cadence indefinitely, or to repeat the entire cadence
314* indefinitely. The ce variable is a pointer to the array of IXJ_TONE
315* structures. If the freq0 variable is non-zero, the tone table contents
316* for the tone_index are updated to the frequencies and gains defined. It
317* should be noted that DTMF tones cannot be reassigned, so if DTMF tone
318* table indexes are used in a cadence the frequency and gain variables will
319* be ignored.
320*
321* If the array elements contain frequency parameters the driver will
322* initialize the needed tone table elements and begin playing the tone,
323* there is no preset limit on the number of elements in the cadence. If
324* there is more than one frequency used in the cadence, sequential elements
325* of different frequencies MUST use different tone table indexes. Only one
326* cadence can be played at a time. It is possible to build complex
327* cadences with multiple frequencies using 2 tone table indexes by
328* alternating between them.
329*
330******************************************************************************/
331
332typedef struct {
333 int index;
334 int tone_on_time;
335 int tone_off_time;
336 int freq0;
337 int gain0;
338 int freq1;
339 int gain1;
340} IXJ_CADENCE_ELEMENT;
341
342typedef enum {
343 PLAY_ONCE,
344 REPEAT_LAST_ELEMENT,
345 REPEAT_ALL
346} IXJ_CADENCE_TERM;
347
348typedef struct {
349 int elements_used;
350 IXJ_CADENCE_TERM termination;
351 IXJ_CADENCE_ELEMENT __user *ce;
352} IXJ_CADENCE;
353
354#define IXJCTL_TONE_CADENCE _IOW ('q', 0xCA, IXJ_CADENCE *)
355/******************************************************************************
356*
357* This group of IOCTLs deal with the playback settings of the DSP
358*
359******************************************************************************/
360
361#define IXJCTL_PLAY_CODEC PHONE_PLAY_CODEC
362#define IXJCTL_PLAY_START PHONE_PLAY_START
363#define IXJCTL_PLAY_STOP PHONE_PLAY_STOP
364#define IXJCTL_PLAY_DEPTH PHONE_PLAY_DEPTH
365#define IXJCTL_PLAY_VOLUME PHONE_PLAY_VOLUME
366#define IXJCTL_PLAY_LEVEL PHONE_PLAY_LEVEL
367
368/******************************************************************************
369*
370* This group of IOCTLs deal with the Acoustic Echo Cancellation settings
371* of the DSP
372*
373* Issuing the IXJCTL_AEC_START command with a value of AEC_OFF has the
374* same effect as IXJCTL_AEC_STOP. This is to simplify slider bar
375* controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC.
376******************************************************************************/
377#define IXJCTL_AEC_START _IOW ('q', 0xCB, int)
378#define IXJCTL_AEC_STOP _IO ('q', 0xCC)
379#define IXJCTL_AEC_GET_LEVEL _IO ('q', 0xCD)
380
381#define AEC_OFF 0
382#define AEC_LOW 1
383#define AEC_MED 2
384#define AEC_HIGH 3
385#define AEC_AUTO 4
386#define AEC_AGC 5
387/******************************************************************************
388*
389* Call Progress Tones, DTMF, etc.
390* IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band
391* only. If you pass a 1, DTMF is suppressed from the audio stream.
392* Tone on and off times are in 250 microsecond intervals so
393* ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360);
394* will set the tone on time of board ixj1 to 360 * 250us = 90ms
395* the default values of tone on and off times is 840 or 210ms
396******************************************************************************/
397
398#define IXJCTL_DTMF_READY PHONE_DTMF_READY
399#define IXJCTL_GET_DTMF PHONE_GET_DTMF
400#define IXJCTL_GET_DTMF_ASCII PHONE_GET_DTMF_ASCII
401#define IXJCTL_DTMF_OOB PHONE_DTMF_OOB
402#define IXJCTL_EXCEPTION PHONE_EXCEPTION
403#define IXJCTL_PLAY_TONE PHONE_PLAY_TONE
404#define IXJCTL_SET_TONE_ON_TIME PHONE_SET_TONE_ON_TIME
405#define IXJCTL_SET_TONE_OFF_TIME PHONE_SET_TONE_OFF_TIME
406#define IXJCTL_GET_TONE_ON_TIME PHONE_GET_TONE_ON_TIME
407#define IXJCTL_GET_TONE_OFF_TIME PHONE_GET_TONE_OFF_TIME
408#define IXJCTL_GET_TONE_STATE PHONE_GET_TONE_STATE
409#define IXJCTL_BUSY PHONE_BUSY
410#define IXJCTL_RINGBACK PHONE_RINGBACK
411#define IXJCTL_DIALTONE PHONE_DIALTONE
412#define IXJCTL_CPT_STOP PHONE_CPT_STOP
413
414/******************************************************************************
415* LineJACK specific IOCTLs
416*
417* The lsb 4 bits of the LED argument represent the state of each of the 4
418* LED's on the LineJACK
419******************************************************************************/
420
421#define IXJCTL_SET_LED _IOW ('q', 0xCE, int)
422#define IXJCTL_MIXER _IOW ('q', 0xCF, int)
423
424/******************************************************************************
425*
426* The master volume controls use attenuation with 32 levels from 0 to -62dB
427* with steps of 2dB each, the defines should be OR'ed together then sent
428* as the parameter to the mixer command to change the mixer settings.
429*
430******************************************************************************/
431#define MIXER_MASTER_L 0x0000
432#define MIXER_MASTER_R 0x0100
433#define ATT00DB 0x00
434#define ATT02DB 0x01
435#define ATT04DB 0x02
436#define ATT06DB 0x03
437#define ATT08DB 0x04
438#define ATT10DB 0x05
439#define ATT12DB 0x06
440#define ATT14DB 0x07
441#define ATT16DB 0x08
442#define ATT18DB 0x09
443#define ATT20DB 0x0A
444#define ATT22DB 0x0B
445#define ATT24DB 0x0C
446#define ATT26DB 0x0D
447#define ATT28DB 0x0E
448#define ATT30DB 0x0F
449#define ATT32DB 0x10
450#define ATT34DB 0x11
451#define ATT36DB 0x12
452#define ATT38DB 0x13
453#define ATT40DB 0x14
454#define ATT42DB 0x15
455#define ATT44DB 0x16
456#define ATT46DB 0x17
457#define ATT48DB 0x18
458#define ATT50DB 0x19
459#define ATT52DB 0x1A
460#define ATT54DB 0x1B
461#define ATT56DB 0x1C
462#define ATT58DB 0x1D
463#define ATT60DB 0x1E
464#define ATT62DB 0x1F
465#define MASTER_MUTE 0x80
466
467/******************************************************************************
468*
469* The input volume controls use gain with 32 levels from +12dB to -50dB
470* with steps of 2dB each, the defines should be OR'ed together then sent
471* as the parameter to the mixer command to change the mixer settings.
472*
473******************************************************************************/
474#define MIXER_PORT_CD_L 0x0600
475#define MIXER_PORT_CD_R 0x0700
476#define MIXER_PORT_LINE_IN_L 0x0800
477#define MIXER_PORT_LINE_IN_R 0x0900
478#define MIXER_PORT_POTS_REC 0x0C00
479#define MIXER_PORT_MIC 0x0E00
480
481#define GAIN12DB 0x00
482#define GAIN10DB 0x01
483#define GAIN08DB 0x02
484#define GAIN06DB 0x03
485#define GAIN04DB 0x04
486#define GAIN02DB 0x05
487#define GAIN00DB 0x06
488#define GAIN_02DB 0x07
489#define GAIN_04DB 0x08
490#define GAIN_06DB 0x09
491#define GAIN_08DB 0x0A
492#define GAIN_10DB 0x0B
493#define GAIN_12DB 0x0C
494#define GAIN_14DB 0x0D
495#define GAIN_16DB 0x0E
496#define GAIN_18DB 0x0F
497#define GAIN_20DB 0x10
498#define GAIN_22DB 0x11
499#define GAIN_24DB 0x12
500#define GAIN_26DB 0x13
501#define GAIN_28DB 0x14
502#define GAIN_30DB 0x15
503#define GAIN_32DB 0x16
504#define GAIN_34DB 0x17
505#define GAIN_36DB 0x18
506#define GAIN_38DB 0x19
507#define GAIN_40DB 0x1A
508#define GAIN_42DB 0x1B
509#define GAIN_44DB 0x1C
510#define GAIN_46DB 0x1D
511#define GAIN_48DB 0x1E
512#define GAIN_50DB 0x1F
513#define INPUT_MUTE 0x80
514
515/******************************************************************************
516*
517* The POTS volume control use attenuation with 8 levels from 0dB to -28dB
518* with steps of 4dB each, the defines should be OR'ed together then sent
519* as the parameter to the mixer command to change the mixer settings.
520*
521******************************************************************************/
522#define MIXER_PORT_POTS_PLAY 0x0F00
523
524#define POTS_ATT_00DB 0x00
525#define POTS_ATT_04DB 0x01
526#define POTS_ATT_08DB 0x02
527#define POTS_ATT_12DB 0x03
528#define POTS_ATT_16DB 0x04
529#define POTS_ATT_20DB 0x05
530#define POTS_ATT_24DB 0x06
531#define POTS_ATT_28DB 0x07
532#define POTS_MUTE 0x80
533
534/******************************************************************************
535*
536* The DAA controls the interface to the PSTN port. The driver loads the
537* US coefficients by default, so if you live in a different country you
538* need to load the set for your countries phone system.
539*
540******************************************************************************/
541#define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int)
542
543#define DAA_US 1 /*PITA 8kHz */
544#define DAA_UK 2 /*ISAR34 8kHz */
545#define DAA_FRANCE 3 /* */
546#define DAA_GERMANY 4
547#define DAA_AUSTRALIA 5
548#define DAA_JAPAN 6
549
550/******************************************************************************
551*
552* Use IXJCTL_PORT to set or query the port the card is set to. If the
553* argument is set to PORT_QUERY, the return value of the ioctl will
554* indicate which port is currently in use, otherwise it will change the
555* port.
556*
557******************************************************************************/
558#define IXJCTL_PORT _IOW ('q', 0xD1, int)
559
560#define PORT_QUERY 0
561#define PORT_POTS 1
562#define PORT_PSTN 2
563#define PORT_SPEAKER 3
564#define PORT_HANDSET 4
565
566#define IXJCTL_PSTN_SET_STATE PHONE_PSTN_SET_STATE
567#define IXJCTL_PSTN_GET_STATE PHONE_PSTN_GET_STATE
568
569#define PSTN_ON_HOOK 0
570#define PSTN_RINGING 1
571#define PSTN_OFF_HOOK 2
572#define PSTN_PULSE_DIAL 3
573
574/******************************************************************************
575*
576* The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR),
577* and the transmit gain (AGX). OR together the components and pass them
578* as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB.
579*
580******************************************************************************/
581#define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int)
582
583#define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */
584#define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */
585#define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */
586
587#define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */
588#define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */
589#define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */
590#define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */
591
592#define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3)
593
594#define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *)
595#define IXJCTL_VMWI _IOR ('q', 0xD8, int)
596#define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *)
597/******************************************************************************
598*
599* The wink duration is tunable with this ioctl. The default wink duration
600* is 320ms. You do not need to use this ioctl if you do not require a
601* different wink duration.
602*
603******************************************************************************/
604#define IXJCTL_WINK_DURATION PHONE_WINK_DURATION
605
606/******************************************************************************
607*
608* This ioctl will connect the POTS port to the PSTN port on the LineJACK
609* In order for this to work properly the port selection should be set to
610* the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will
611* enable conference calls between PSTN callers and network callers.
612* Passing a 1 to this ioctl enables the POTS<->PSTN connection while
613* passing a 0 turns it back off.
614*
615******************************************************************************/
616#define IXJCTL_POTS_PSTN _IOW ('q', 0xD5, int)
617
618/******************************************************************************
619*
620* IOCTLs added by request.
621*
622* IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in
623* /usr/include/asm/param.h, this determines the fundamental
624* frequency of the clock ticks on your Linux system. The kernel
625* must be rebuilt if you change this value, also all modules you
626* use (except this one) must be recompiled. The default value
627* is 100, and you only need to use this IOCTL if you use some
628* other value.
629*
630*
631* IXJCTL_RATE sets the number of times per second that the driver polls
632* the DSP. This value cannot be larger than HZ. By
633* increasing both of these values, you may be able to reduce
634* latency because the max hang time that can exist between the
635* driver and the DSP will be reduced.
636*
637******************************************************************************/
638
639#define IXJCTL_HZ _IOW ('q', 0xE0, int)
640#define IXJCTL_RATE _IOW ('q', 0xE1, int)
641#define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long)
642#define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long)
643#define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long)
644#define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long)
645#define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long)
646#define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7)
647#define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int)
648
649/******************************************************************************
650*
651* This ioctl allows the user application to control what events the driver
652* will send signals for, and what signals it will send for which event.
653* By default, if signaling is enabled, all events will send SIGIO when
654* they occur. To disable signals for an event set the signal to 0.
655*
656******************************************************************************/
657typedef enum {
658 SIG_DTMF_READY,
659 SIG_HOOKSTATE,
660 SIG_FLASH,
661 SIG_PSTN_RING,
662 SIG_CALLER_ID,
663 SIG_PSTN_WINK,
664 SIG_F0, SIG_F1, SIG_F2, SIG_F3,
665 SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3,
666 SIG_READ_READY = 33,
667 SIG_WRITE_READY = 34
668} IXJ_SIGEVENT;
669
670typedef struct {
671 unsigned int event;
672 int signal;
673} IXJ_SIGDEF;
674
675#define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *)
676
677/******************************************************************************
678*
679* These ioctls allow the user application to change the gain in the
680* Smart Cable of the Internet Phone Card. Sending -1 as a value will cause
681* return value to be the current setting. Valid values to set are 0x00 - 0x1F
682*
683* 11111 = +12 dB
684* 10111 = 0 dB
685* 00000 = -34.5 dB
686*
687* IXJCTL_SC_RXG sets the Receive gain
688* IXJCTL_SC_TXG sets the Transmit gain
689*
690******************************************************************************/
691#define IXJCTL_SC_RXG _IOW ('q', 0xEA, int)
692#define IXJCTL_SC_TXG _IOW ('q', 0xEB, int)
693
694/******************************************************************************
695*
696* The intercom IOCTL's short the output from one card to the input of the
697* other and vice versa (actually done in the DSP read function). It is only
698* necessary to execute the IOCTL on one card, but it is necessary to have
699* both devices open to be able to detect hook switch changes. The record
700* codec and rate of each card must match the playback codec and rate of
701* the other card for this to work properly.
702*
703******************************************************************************/
704
705#define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int)
706#define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int)
707
708/******************************************************************************
709 *
710 * new structure for accessing raw filter information
711 *
712 ******************************************************************************/
713
714typedef struct {
715 unsigned int filter;
716 char enable;
717 unsigned int coeff[19];
718} IXJ_FILTER_RAW;
719
720#endif
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
deleted file mode 100644
index a18b719f49d4..000000000000
--- a/include/linux/jffs2.h
+++ /dev/null
@@ -1,223 +0,0 @@
1/*
2 * JFFS2 -- Journalling Flash File System, Version 2.
3 *
4 * Copyright © 2001-2007 Red Hat, Inc.
5 * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org>
6 *
7 * Created by David Woodhouse <dwmw2@infradead.org>
8 *
9 * For licensing information, see the file 'LICENCE' in the
10 * jffs2 directory.
11 */
12
13#ifndef __LINUX_JFFS2_H__
14#define __LINUX_JFFS2_H__
15
16#include <linux/types.h>
17#include <linux/magic.h>
18
19/* You must include something which defines the C99 uintXX_t types.
20 We don't do it from here because this file is used in too many
21 different environments. */
22
23/* Values we may expect to find in the 'magic' field */
24#define JFFS2_OLD_MAGIC_BITMASK 0x1984
25#define JFFS2_MAGIC_BITMASK 0x1985
26#define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */
27#define JFFS2_EMPTY_BITMASK 0xffff
28#define JFFS2_DIRTY_BITMASK 0x0000
29
30/* Summary node MAGIC marker */
31#define JFFS2_SUM_MAGIC 0x02851885
32
33/* We only allow a single char for length, and 0xFF is empty flash so
34 we don't want it confused with a real length. Hence max 254.
35*/
36#define JFFS2_MAX_NAME_LEN 254
37
38/* How small can we sensibly write nodes? */
39#define JFFS2_MIN_DATA_LEN 128
40
41#define JFFS2_COMPR_NONE 0x00
42#define JFFS2_COMPR_ZERO 0x01
43#define JFFS2_COMPR_RTIME 0x02
44#define JFFS2_COMPR_RUBINMIPS 0x03
45#define JFFS2_COMPR_COPY 0x04
46#define JFFS2_COMPR_DYNRUBIN 0x05
47#define JFFS2_COMPR_ZLIB 0x06
48#define JFFS2_COMPR_LZO 0x07
49/* Compatibility flags. */
50#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
51#define JFFS2_NODE_ACCURATE 0x2000
52/* INCOMPAT: Fail to mount the filesystem */
53#define JFFS2_FEATURE_INCOMPAT 0xc000
54/* ROCOMPAT: Mount read-only */
55#define JFFS2_FEATURE_ROCOMPAT 0x8000
56/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
57#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
58/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
59#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
60
61#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
62#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
63#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
64#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67
68#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
69#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
70
71/* XATTR Related */
72#define JFFS2_XPREFIX_USER 1 /* for "user." */
73#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
74#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
75#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
76#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
77
78#define JFFS2_ACL_VERSION 0x0001
79
80// Maybe later...
81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
83
84
85#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
86 mount time, don't wait for it to
87 happen later */
88#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
89 compression type */
90
91
92/* These can go once we've made sure we've caught all uses without
93 byteswapping */
94
95typedef struct {
96 __u32 v32;
97} __attribute__((packed)) jint32_t;
98
99typedef struct {
100 __u32 m;
101} __attribute__((packed)) jmode_t;
102
103typedef struct {
104 __u16 v16;
105} __attribute__((packed)) jint16_t;
106
107struct jffs2_unknown_node
108{
109 /* All start like this */
110 jint16_t magic;
111 jint16_t nodetype;
112 jint32_t totlen; /* So we can skip over nodes we don't grok */
113 jint32_t hdr_crc;
114};
115
116struct jffs2_raw_dirent
117{
118 jint16_t magic;
119 jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
120 jint32_t totlen;
121 jint32_t hdr_crc;
122 jint32_t pino;
123 jint32_t version;
124 jint32_t ino; /* == zero for unlink */
125 jint32_t mctime;
126 __u8 nsize;
127 __u8 type;
128 __u8 unused[2];
129 jint32_t node_crc;
130 jint32_t name_crc;
131 __u8 name[0];
132};
133
134/* The JFFS2 raw inode structure: Used for storage on physical media. */
135/* The uid, gid, atime, mtime and ctime members could be longer, but
136 are left like this for space efficiency. If and when people decide
137 they really need them extended, it's simple enough to add support for
138 a new type of raw node.
139*/
140struct jffs2_raw_inode
141{
142 jint16_t magic; /* A constant magic number. */
143 jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
144 jint32_t totlen; /* Total length of this node (inc data, etc.) */
145 jint32_t hdr_crc;
146 jint32_t ino; /* Inode number. */
147 jint32_t version; /* Version number. */
148 jmode_t mode; /* The file's type or mode. */
149 jint16_t uid; /* The file's owner. */
150 jint16_t gid; /* The file's group. */
151 jint32_t isize; /* Total resultant size of this inode (used for truncations) */
152 jint32_t atime; /* Last access time. */
153 jint32_t mtime; /* Last modification time. */
154 jint32_t ctime; /* Change time. */
155 jint32_t offset; /* Where to begin to write. */
156 jint32_t csize; /* (Compressed) data size */
157 jint32_t dsize; /* Size of the node's data. (after decompression) */
158 __u8 compr; /* Compression algorithm used */
159 __u8 usercompr; /* Compression algorithm requested by the user */
160 jint16_t flags; /* See JFFS2_INO_FLAG_* */
161 jint32_t data_crc; /* CRC for the (compressed) data. */
162 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
163 __u8 data[0];
164};
165
166struct jffs2_raw_xattr {
167 jint16_t magic;
168 jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
169 jint32_t totlen;
170 jint32_t hdr_crc;
171 jint32_t xid; /* XATTR identifier number */
172 jint32_t version;
173 __u8 xprefix;
174 __u8 name_len;
175 jint16_t value_len;
176 jint32_t data_crc;
177 jint32_t node_crc;
178 __u8 data[0];
179} __attribute__((packed));
180
181struct jffs2_raw_xref
182{
183 jint16_t magic;
184 jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
185 jint32_t totlen;
186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */
189 jint32_t xseqno; /* xref sequential number */
190 jint32_t node_crc;
191} __attribute__((packed));
192
193struct jffs2_raw_summary
194{
195 jint16_t magic;
196 jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
197 jint32_t totlen;
198 jint32_t hdr_crc;
199 jint32_t sum_num; /* number of sum entries*/
200 jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
201 jint32_t padded; /* sum of the size of padding nodes */
202 jint32_t sum_crc; /* summary information crc */
203 jint32_t node_crc; /* node crc */
204 jint32_t sum[0]; /* inode summary info */
205};
206
207union jffs2_node_union
208{
209 struct jffs2_raw_inode i;
210 struct jffs2_raw_dirent d;
211 struct jffs2_raw_xattr x;
212 struct jffs2_raw_xref r;
213 struct jffs2_raw_summary s;
214 struct jffs2_unknown_node u;
215};
216
217/* Data payload for device nodes. */
218union jffs2_device_node {
219 jint16_t old_id;
220 jint32_t new_id;
221};
222
223#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 47199b13e0eb..cbf2aa9e93b9 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 c36d8476db55..25bd17fad239 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 2dacab8beccb..c838abe3ee0a 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 a1bdf6966357..546eb6a76934 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 2451f1f7a1d9..a123b13b70fd 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 9c2683929fd3..9be37da93680 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 37c5f7261142..d0b8458a703a 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 86e5214ae735..131ed5146521 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/keyctl.h b/include/linux/keyctl.h
deleted file mode 100644
index c9b7f4faf97a..000000000000
--- a/include/linux/keyctl.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/* keyctl.h: keyctl command IDs
2 *
3 * Copyright (C) 2004, 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.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#ifndef _LINUX_KEYCTL_H
13#define _LINUX_KEYCTL_H
14
15/* special process keyring shortcut IDs */
16#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */
17#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */
18#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */
19#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */
20#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */
21#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */
22#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */
23#define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */
24
25/* request-key default keyrings */
26#define KEY_REQKEY_DEFL_NO_CHANGE -1
27#define KEY_REQKEY_DEFL_DEFAULT 0
28#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
29#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
30#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
31#define KEY_REQKEY_DEFL_USER_KEYRING 4
32#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
33#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
34#define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
35
36/* keyctl commands */
37#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
38#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
39#define KEYCTL_UPDATE 2 /* update a key */
40#define KEYCTL_REVOKE 3 /* revoke a key */
41#define KEYCTL_CHOWN 4 /* set ownership of a key */
42#define KEYCTL_SETPERM 5 /* set perms on a key */
43#define KEYCTL_DESCRIBE 6 /* describe a key */
44#define KEYCTL_CLEAR 7 /* clear contents of a keyring */
45#define KEYCTL_LINK 8 /* link a key into a keyring */
46#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
47#define KEYCTL_SEARCH 10 /* search for a key in a keyring */
48#define KEYCTL_READ 11 /* read a key or keyring's contents */
49#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
50#define KEYCTL_NEGATE 13 /* negate a partially constructed key */
51#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
52#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
53#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
54#define KEYCTL_GET_SECURITY 17 /* get key security label */
55#define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */
56#define KEYCTL_REJECT 19 /* reject a partially constructed key */
57#define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */
58#define KEYCTL_INVALIDATE 21 /* invalidate a key */
59
60#endif /* _LINUX_KEYCTL_H */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
deleted file mode 100644
index 0a6d6ba44c85..000000000000
--- a/include/linux/kvm.h
+++ /dev/null
@@ -1,975 +0,0 @@
1#ifndef __LINUX_KVM_H
2#define __LINUX_KVM_H
3
4/*
5 * Userspace interface for /dev/kvm - kernel based virtual machine
6 *
7 * Note: you must update KVM_API_VERSION if you change this interface.
8 */
9
10#include <linux/types.h>
11#include <linux/compiler.h>
12#include <linux/ioctl.h>
13#include <asm/kvm.h>
14
15#define KVM_API_VERSION 12
16
17/* *** Deprecated interfaces *** */
18
19#define KVM_TRC_SHIFT 16
20
21#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
22#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1))
23
24#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
25#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
26#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
27
28#define KVM_TRC_HEAD_SIZE 12
29#define KVM_TRC_CYCLE_SIZE 8
30#define KVM_TRC_EXTRA_MAX 7
31
32#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
33#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
34#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
35#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
36#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
37#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
38#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
39#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
40#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
41#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
42#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
43#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
44#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
45#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
46#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
47#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
48#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
49#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
50#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
51#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
52#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
53#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
54#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
55#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
56
57struct kvm_user_trace_setup {
58 __u32 buf_size;
59 __u32 buf_nr;
60};
61
62#define __KVM_DEPRECATED_MAIN_W_0x06 \
63 _IOW(KVMIO, 0x06, struct kvm_user_trace_setup)
64#define __KVM_DEPRECATED_MAIN_0x07 _IO(KVMIO, 0x07)
65#define __KVM_DEPRECATED_MAIN_0x08 _IO(KVMIO, 0x08)
66
67#define __KVM_DEPRECATED_VM_R_0x70 _IOR(KVMIO, 0x70, struct kvm_assigned_irq)
68
69struct kvm_breakpoint {
70 __u32 enabled;
71 __u32 padding;
72 __u64 address;
73};
74
75struct kvm_debug_guest {
76 __u32 enabled;
77 __u32 pad;
78 struct kvm_breakpoint breakpoints[4];
79 __u32 singlestep;
80};
81
82#define __KVM_DEPRECATED_VCPU_W_0x87 _IOW(KVMIO, 0x87, struct kvm_debug_guest)
83
84/* *** End of deprecated interfaces *** */
85
86
87/* for KVM_CREATE_MEMORY_REGION */
88struct kvm_memory_region {
89 __u32 slot;
90 __u32 flags;
91 __u64 guest_phys_addr;
92 __u64 memory_size; /* bytes */
93};
94
95/* for KVM_SET_USER_MEMORY_REGION */
96struct kvm_userspace_memory_region {
97 __u32 slot;
98 __u32 flags;
99 __u64 guest_phys_addr;
100 __u64 memory_size; /* bytes */
101 __u64 userspace_addr; /* start of the userspace allocated memory */
102};
103
104/*
105 * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,
106 * other bits are reserved for kvm internal use which are defined in
107 * include/linux/kvm_host.h.
108 */
109#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
110#define KVM_MEM_READONLY (1UL << 1)
111
112/* for KVM_IRQ_LINE */
113struct kvm_irq_level {
114 /*
115 * ACPI gsi notion of irq.
116 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..
117 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..
118 */
119 union {
120 __u32 irq;
121 __s32 status;
122 };
123 __u32 level;
124};
125
126
127struct kvm_irqchip {
128 __u32 chip_id;
129 __u32 pad;
130 union {
131 char dummy[512]; /* reserving space */
132#ifdef __KVM_HAVE_PIT
133 struct kvm_pic_state pic;
134#endif
135#ifdef __KVM_HAVE_IOAPIC
136 struct kvm_ioapic_state ioapic;
137#endif
138 } chip;
139};
140
141/* for KVM_CREATE_PIT2 */
142struct kvm_pit_config {
143 __u32 flags;
144 __u32 pad[15];
145};
146
147#define KVM_PIT_SPEAKER_DUMMY 1
148
149#define KVM_EXIT_UNKNOWN 0
150#define KVM_EXIT_EXCEPTION 1
151#define KVM_EXIT_IO 2
152#define KVM_EXIT_HYPERCALL 3
153#define KVM_EXIT_DEBUG 4
154#define KVM_EXIT_HLT 5
155#define KVM_EXIT_MMIO 6
156#define KVM_EXIT_IRQ_WINDOW_OPEN 7
157#define KVM_EXIT_SHUTDOWN 8
158#define KVM_EXIT_FAIL_ENTRY 9
159#define KVM_EXIT_INTR 10
160#define KVM_EXIT_SET_TPR 11
161#define KVM_EXIT_TPR_ACCESS 12
162#define KVM_EXIT_S390_SIEIC 13
163#define KVM_EXIT_S390_RESET 14
164#define KVM_EXIT_DCR 15
165#define KVM_EXIT_NMI 16
166#define KVM_EXIT_INTERNAL_ERROR 17
167#define KVM_EXIT_OSI 18
168#define KVM_EXIT_PAPR_HCALL 19
169#define KVM_EXIT_S390_UCONTROL 20
170
171/* For KVM_EXIT_INTERNAL_ERROR */
172#define KVM_INTERNAL_ERROR_EMULATION 1
173#define KVM_INTERNAL_ERROR_SIMUL_EX 2
174
175/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
176struct kvm_run {
177 /* in */
178 __u8 request_interrupt_window;
179 __u8 padding1[7];
180
181 /* out */
182 __u32 exit_reason;
183 __u8 ready_for_interrupt_injection;
184 __u8 if_flag;
185 __u8 padding2[2];
186
187 /* in (pre_kvm_run), out (post_kvm_run) */
188 __u64 cr8;
189 __u64 apic_base;
190
191#ifdef __KVM_S390
192 /* the processor status word for s390 */
193 __u64 psw_mask; /* psw upper half */
194 __u64 psw_addr; /* psw lower half */
195#endif
196 union {
197 /* KVM_EXIT_UNKNOWN */
198 struct {
199 __u64 hardware_exit_reason;
200 } hw;
201 /* KVM_EXIT_FAIL_ENTRY */
202 struct {
203 __u64 hardware_entry_failure_reason;
204 } fail_entry;
205 /* KVM_EXIT_EXCEPTION */
206 struct {
207 __u32 exception;
208 __u32 error_code;
209 } ex;
210 /* KVM_EXIT_IO */
211 struct {
212#define KVM_EXIT_IO_IN 0
213#define KVM_EXIT_IO_OUT 1
214 __u8 direction;
215 __u8 size; /* bytes */
216 __u16 port;
217 __u32 count;
218 __u64 data_offset; /* relative to kvm_run start */
219 } io;
220 struct {
221 struct kvm_debug_exit_arch arch;
222 } debug;
223 /* KVM_EXIT_MMIO */
224 struct {
225 __u64 phys_addr;
226 __u8 data[8];
227 __u32 len;
228 __u8 is_write;
229 } mmio;
230 /* KVM_EXIT_HYPERCALL */
231 struct {
232 __u64 nr;
233 __u64 args[6];
234 __u64 ret;
235 __u32 longmode;
236 __u32 pad;
237 } hypercall;
238 /* KVM_EXIT_TPR_ACCESS */
239 struct {
240 __u64 rip;
241 __u32 is_write;
242 __u32 pad;
243 } tpr_access;
244 /* KVM_EXIT_S390_SIEIC */
245 struct {
246 __u8 icptcode;
247 __u16 ipa;
248 __u32 ipb;
249 } s390_sieic;
250 /* KVM_EXIT_S390_RESET */
251#define KVM_S390_RESET_POR 1
252#define KVM_S390_RESET_CLEAR 2
253#define KVM_S390_RESET_SUBSYSTEM 4
254#define KVM_S390_RESET_CPU_INIT 8
255#define KVM_S390_RESET_IPL 16
256 __u64 s390_reset_flags;
257 /* KVM_EXIT_S390_UCONTROL */
258 struct {
259 __u64 trans_exc_code;
260 __u32 pgm_code;
261 } s390_ucontrol;
262 /* KVM_EXIT_DCR */
263 struct {
264 __u32 dcrn;
265 __u32 data;
266 __u8 is_write;
267 } dcr;
268 struct {
269 __u32 suberror;
270 /* Available with KVM_CAP_INTERNAL_ERROR_DATA: */
271 __u32 ndata;
272 __u64 data[16];
273 } internal;
274 /* KVM_EXIT_OSI */
275 struct {
276 __u64 gprs[32];
277 } osi;
278 struct {
279 __u64 nr;
280 __u64 ret;
281 __u64 args[9];
282 } papr_hcall;
283 /* Fix the size of the union. */
284 char padding[256];
285 };
286
287 /*
288 * shared registers between kvm and userspace.
289 * kvm_valid_regs specifies the register classes set by the host
290 * kvm_dirty_regs specified the register classes dirtied by userspace
291 * struct kvm_sync_regs is architecture specific, as well as the
292 * bits for kvm_valid_regs and kvm_dirty_regs
293 */
294 __u64 kvm_valid_regs;
295 __u64 kvm_dirty_regs;
296 union {
297 struct kvm_sync_regs regs;
298 char padding[1024];
299 } s;
300};
301
302/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */
303
304struct kvm_coalesced_mmio_zone {
305 __u64 addr;
306 __u32 size;
307 __u32 pad;
308};
309
310struct kvm_coalesced_mmio {
311 __u64 phys_addr;
312 __u32 len;
313 __u32 pad;
314 __u8 data[8];
315};
316
317struct kvm_coalesced_mmio_ring {
318 __u32 first, last;
319 struct kvm_coalesced_mmio coalesced_mmio[0];
320};
321
322#define KVM_COALESCED_MMIO_MAX \
323 ((PAGE_SIZE - sizeof(struct kvm_coalesced_mmio_ring)) / \
324 sizeof(struct kvm_coalesced_mmio))
325
326/* for KVM_TRANSLATE */
327struct kvm_translation {
328 /* in */
329 __u64 linear_address;
330
331 /* out */
332 __u64 physical_address;
333 __u8 valid;
334 __u8 writeable;
335 __u8 usermode;
336 __u8 pad[5];
337};
338
339/* for KVM_INTERRUPT */
340struct kvm_interrupt {
341 /* in */
342 __u32 irq;
343};
344
345/* for KVM_GET_DIRTY_LOG */
346struct kvm_dirty_log {
347 __u32 slot;
348 __u32 padding1;
349 union {
350 void __user *dirty_bitmap; /* one bit per page */
351 __u64 padding2;
352 };
353};
354
355/* for KVM_SET_SIGNAL_MASK */
356struct kvm_signal_mask {
357 __u32 len;
358 __u8 sigset[0];
359};
360
361/* for KVM_TPR_ACCESS_REPORTING */
362struct kvm_tpr_access_ctl {
363 __u32 enabled;
364 __u32 flags;
365 __u32 reserved[8];
366};
367
368/* for KVM_SET_VAPIC_ADDR */
369struct kvm_vapic_addr {
370 __u64 vapic_addr;
371};
372
373/* for KVM_SET_MPSTATE */
374
375#define KVM_MP_STATE_RUNNABLE 0
376#define KVM_MP_STATE_UNINITIALIZED 1
377#define KVM_MP_STATE_INIT_RECEIVED 2
378#define KVM_MP_STATE_HALTED 3
379#define KVM_MP_STATE_SIPI_RECEIVED 4
380
381struct kvm_mp_state {
382 __u32 mp_state;
383};
384
385struct kvm_s390_psw {
386 __u64 mask;
387 __u64 addr;
388};
389
390/* valid values for type in kvm_s390_interrupt */
391#define KVM_S390_SIGP_STOP 0xfffe0000u
392#define KVM_S390_PROGRAM_INT 0xfffe0001u
393#define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u
394#define KVM_S390_RESTART 0xfffe0003u
395#define KVM_S390_INT_VIRTIO 0xffff2603u
396#define KVM_S390_INT_SERVICE 0xffff2401u
397#define KVM_S390_INT_EMERGENCY 0xffff1201u
398#define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u
399
400struct kvm_s390_interrupt {
401 __u32 type;
402 __u32 parm;
403 __u64 parm64;
404};
405
406/* for KVM_SET_GUEST_DEBUG */
407
408#define KVM_GUESTDBG_ENABLE 0x00000001
409#define KVM_GUESTDBG_SINGLESTEP 0x00000002
410
411struct kvm_guest_debug {
412 __u32 control;
413 __u32 pad;
414 struct kvm_guest_debug_arch arch;
415};
416
417enum {
418 kvm_ioeventfd_flag_nr_datamatch,
419 kvm_ioeventfd_flag_nr_pio,
420 kvm_ioeventfd_flag_nr_deassign,
421 kvm_ioeventfd_flag_nr_max,
422};
423
424#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
425#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
426#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
427
428#define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1)
429
430struct kvm_ioeventfd {
431 __u64 datamatch;
432 __u64 addr; /* legal pio/mmio address */
433 __u32 len; /* 1, 2, 4, or 8 bytes */
434 __s32 fd;
435 __u32 flags;
436 __u8 pad[36];
437};
438
439/* for KVM_ENABLE_CAP */
440struct kvm_enable_cap {
441 /* in */
442 __u32 cap;
443 __u32 flags;
444 __u64 args[4];
445 __u8 pad[64];
446};
447
448/* for KVM_PPC_GET_PVINFO */
449struct kvm_ppc_pvinfo {
450 /* out */
451 __u32 flags;
452 __u32 hcall[4];
453 __u8 pad[108];
454};
455
456/* for KVM_PPC_GET_SMMU_INFO */
457#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
458
459struct kvm_ppc_one_page_size {
460 __u32 page_shift; /* Page shift (or 0) */
461 __u32 pte_enc; /* Encoding in the HPTE (>>12) */
462};
463
464struct kvm_ppc_one_seg_page_size {
465 __u32 page_shift; /* Base page shift of segment (or 0) */
466 __u32 slb_enc; /* SLB encoding for BookS */
467 struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
468};
469
470#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
471#define KVM_PPC_1T_SEGMENTS 0x00000002
472
473struct kvm_ppc_smmu_info {
474 __u64 flags;
475 __u32 slb_size;
476 __u32 pad;
477 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
478};
479
480#define KVMIO 0xAE
481
482/* machine type bits, to be used as argument to KVM_CREATE_VM */
483#define KVM_VM_S390_UCONTROL 1
484
485#define KVM_S390_SIE_PAGE_OFFSET 1
486
487/*
488 * ioctls for /dev/kvm fds:
489 */
490#define KVM_GET_API_VERSION _IO(KVMIO, 0x00)
491#define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */
492#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
493
494#define KVM_S390_ENABLE_SIE _IO(KVMIO, 0x06)
495/*
496 * Check if a kvm extension is available. Argument is extension number,
497 * return is 1 (yes) or 0 (no, sorry).
498 */
499#define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03)
500/*
501 * Get size for mmap(vcpu_fd)
502 */
503#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
504#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
505#define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
506#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
507#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
508
509/*
510 * Extension capability list.
511 */
512#define KVM_CAP_IRQCHIP 0
513#define KVM_CAP_HLT 1
514#define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2
515#define KVM_CAP_USER_MEMORY 3
516#define KVM_CAP_SET_TSS_ADDR 4
517#define KVM_CAP_VAPIC 6
518#define KVM_CAP_EXT_CPUID 7
519#define KVM_CAP_CLOCKSOURCE 8
520#define KVM_CAP_NR_VCPUS 9 /* returns recommended max vcpus per vm */
521#define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */
522#define KVM_CAP_PIT 11
523#define KVM_CAP_NOP_IO_DELAY 12
524#define KVM_CAP_PV_MMU 13
525#define KVM_CAP_MP_STATE 14
526#define KVM_CAP_COALESCED_MMIO 15
527#define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */
528#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
529#define KVM_CAP_DEVICE_ASSIGNMENT 17
530#endif
531#define KVM_CAP_IOMMU 18
532#ifdef __KVM_HAVE_MSI
533#define KVM_CAP_DEVICE_MSI 20
534#endif
535/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
536#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
537#ifdef __KVM_HAVE_USER_NMI
538#define KVM_CAP_USER_NMI 22
539#endif
540#ifdef __KVM_HAVE_GUEST_DEBUG
541#define KVM_CAP_SET_GUEST_DEBUG 23
542#endif
543#ifdef __KVM_HAVE_PIT
544#define KVM_CAP_REINJECT_CONTROL 24
545#endif
546#ifdef __KVM_HAVE_IOAPIC
547#define KVM_CAP_IRQ_ROUTING 25
548#endif
549#define KVM_CAP_IRQ_INJECT_STATUS 26
550#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
551#define KVM_CAP_DEVICE_DEASSIGNMENT 27
552#endif
553#ifdef __KVM_HAVE_MSIX
554#define KVM_CAP_DEVICE_MSIX 28
555#endif
556#define KVM_CAP_ASSIGN_DEV_IRQ 29
557/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */
558#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
559#ifdef __KVM_HAVE_MCE
560#define KVM_CAP_MCE 31
561#endif
562#define KVM_CAP_IRQFD 32
563#ifdef __KVM_HAVE_PIT
564#define KVM_CAP_PIT2 33
565#endif
566#define KVM_CAP_SET_BOOT_CPU_ID 34
567#ifdef __KVM_HAVE_PIT_STATE2
568#define KVM_CAP_PIT_STATE2 35
569#endif
570#define KVM_CAP_IOEVENTFD 36
571#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
572#ifdef __KVM_HAVE_XEN_HVM
573#define KVM_CAP_XEN_HVM 38
574#endif
575#define KVM_CAP_ADJUST_CLOCK 39
576#define KVM_CAP_INTERNAL_ERROR_DATA 40
577#ifdef __KVM_HAVE_VCPU_EVENTS
578#define KVM_CAP_VCPU_EVENTS 41
579#endif
580#define KVM_CAP_S390_PSW 42
581#define KVM_CAP_PPC_SEGSTATE 43
582#define KVM_CAP_HYPERV 44
583#define KVM_CAP_HYPERV_VAPIC 45
584#define KVM_CAP_HYPERV_SPIN 46
585#define KVM_CAP_PCI_SEGMENT 47
586#define KVM_CAP_PPC_PAIRED_SINGLES 48
587#define KVM_CAP_INTR_SHADOW 49
588#ifdef __KVM_HAVE_DEBUGREGS
589#define KVM_CAP_DEBUGREGS 50
590#endif
591#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
592#define KVM_CAP_PPC_OSI 52
593#define KVM_CAP_PPC_UNSET_IRQ 53
594#define KVM_CAP_ENABLE_CAP 54
595#ifdef __KVM_HAVE_XSAVE
596#define KVM_CAP_XSAVE 55
597#endif
598#ifdef __KVM_HAVE_XCRS
599#define KVM_CAP_XCRS 56
600#endif
601#define KVM_CAP_PPC_GET_PVINFO 57
602#define KVM_CAP_PPC_IRQ_LEVEL 58
603#define KVM_CAP_ASYNC_PF 59
604#define KVM_CAP_TSC_CONTROL 60
605#define KVM_CAP_GET_TSC_KHZ 61
606#define KVM_CAP_PPC_BOOKE_SREGS 62
607#define KVM_CAP_SPAPR_TCE 63
608#define KVM_CAP_PPC_SMT 64
609#define KVM_CAP_PPC_RMA 65
610#define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */
611#define KVM_CAP_PPC_HIOR 67
612#define KVM_CAP_PPC_PAPR 68
613#define KVM_CAP_SW_TLB 69
614#define KVM_CAP_ONE_REG 70
615#define KVM_CAP_S390_GMAP 71
616#define KVM_CAP_TSC_DEADLINE_TIMER 72
617#define KVM_CAP_S390_UCONTROL 73
618#define KVM_CAP_SYNC_REGS 74
619#define KVM_CAP_PCI_2_3 75
620#define KVM_CAP_KVMCLOCK_CTRL 76
621#define KVM_CAP_SIGNAL_MSI 77
622#define KVM_CAP_PPC_GET_SMMU_INFO 78
623#define KVM_CAP_S390_COW 79
624#define KVM_CAP_PPC_ALLOC_HTAB 80
625#ifdef __KVM_HAVE_READONLY_MEM
626#define KVM_CAP_READONLY_MEM 81
627#endif
628#define KVM_CAP_IRQFD_RESAMPLE 82
629
630#ifdef KVM_CAP_IRQ_ROUTING
631
632struct kvm_irq_routing_irqchip {
633 __u32 irqchip;
634 __u32 pin;
635};
636
637struct kvm_irq_routing_msi {
638 __u32 address_lo;
639 __u32 address_hi;
640 __u32 data;
641 __u32 pad;
642};
643
644/* gsi routing entry types */
645#define KVM_IRQ_ROUTING_IRQCHIP 1
646#define KVM_IRQ_ROUTING_MSI 2
647
648struct kvm_irq_routing_entry {
649 __u32 gsi;
650 __u32 type;
651 __u32 flags;
652 __u32 pad;
653 union {
654 struct kvm_irq_routing_irqchip irqchip;
655 struct kvm_irq_routing_msi msi;
656 __u32 pad[8];
657 } u;
658};
659
660struct kvm_irq_routing {
661 __u32 nr;
662 __u32 flags;
663 struct kvm_irq_routing_entry entries[0];
664};
665
666#endif
667
668#ifdef KVM_CAP_MCE
669/* x86 MCE */
670struct kvm_x86_mce {
671 __u64 status;
672 __u64 addr;
673 __u64 misc;
674 __u64 mcg_status;
675 __u8 bank;
676 __u8 pad1[7];
677 __u64 pad2[3];
678};
679#endif
680
681#ifdef KVM_CAP_XEN_HVM
682struct kvm_xen_hvm_config {
683 __u32 flags;
684 __u32 msr;
685 __u64 blob_addr_32;
686 __u64 blob_addr_64;
687 __u8 blob_size_32;
688 __u8 blob_size_64;
689 __u8 pad2[30];
690};
691#endif
692
693#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
694/*
695 * Available with KVM_CAP_IRQFD_RESAMPLE
696 *
697 * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies
698 * the irqfd to operate in resampling mode for level triggered interrupt
699 * emlation. See Documentation/virtual/kvm/api.txt.
700 */
701#define KVM_IRQFD_FLAG_RESAMPLE (1 << 1)
702
703struct kvm_irqfd {
704 __u32 fd;
705 __u32 gsi;
706 __u32 flags;
707 __u32 resamplefd;
708 __u8 pad[16];
709};
710
711struct kvm_clock_data {
712 __u64 clock;
713 __u32 flags;
714 __u32 pad[9];
715};
716
717#define KVM_MMU_FSL_BOOKE_NOHV 0
718#define KVM_MMU_FSL_BOOKE_HV 1
719
720struct kvm_config_tlb {
721 __u64 params;
722 __u64 array;
723 __u32 mmu_type;
724 __u32 array_len;
725};
726
727struct kvm_dirty_tlb {
728 __u64 bitmap;
729 __u32 num_dirty;
730};
731
732/* Available with KVM_CAP_ONE_REG */
733
734#define KVM_REG_ARCH_MASK 0xff00000000000000ULL
735#define KVM_REG_GENERIC 0x0000000000000000ULL
736
737/*
738 * Architecture specific registers are to be defined in arch headers and
739 * ORed with the arch identifier.
740 */
741#define KVM_REG_PPC 0x1000000000000000ULL
742#define KVM_REG_X86 0x2000000000000000ULL
743#define KVM_REG_IA64 0x3000000000000000ULL
744#define KVM_REG_ARM 0x4000000000000000ULL
745#define KVM_REG_S390 0x5000000000000000ULL
746
747#define KVM_REG_SIZE_SHIFT 52
748#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
749#define KVM_REG_SIZE_U8 0x0000000000000000ULL
750#define KVM_REG_SIZE_U16 0x0010000000000000ULL
751#define KVM_REG_SIZE_U32 0x0020000000000000ULL
752#define KVM_REG_SIZE_U64 0x0030000000000000ULL
753#define KVM_REG_SIZE_U128 0x0040000000000000ULL
754#define KVM_REG_SIZE_U256 0x0050000000000000ULL
755#define KVM_REG_SIZE_U512 0x0060000000000000ULL
756#define KVM_REG_SIZE_U1024 0x0070000000000000ULL
757
758struct kvm_one_reg {
759 __u64 id;
760 __u64 addr;
761};
762
763struct kvm_msi {
764 __u32 address_lo;
765 __u32 address_hi;
766 __u32 data;
767 __u32 flags;
768 __u8 pad[16];
769};
770
771/*
772 * ioctls for VM fds
773 */
774#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
775/*
776 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
777 * a vcpu fd.
778 */
779#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
780#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
781/* KVM_SET_MEMORY_ALIAS is obsolete: */
782#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
783#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
784#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
785#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
786 struct kvm_userspace_memory_region)
787#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
788#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
789
790/* enable ucontrol for s390 */
791struct kvm_s390_ucas_mapping {
792 __u64 user_addr;
793 __u64 vcpu_addr;
794 __u64 length;
795};
796#define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
797#define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
798#define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
799
800/* Device model IOC */
801#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
802#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
803#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip)
804#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip)
805#define KVM_CREATE_PIT _IO(KVMIO, 0x64)
806#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state)
807#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state)
808#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level)
809#define KVM_REGISTER_COALESCED_MMIO \
810 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
811#define KVM_UNREGISTER_COALESCED_MMIO \
812 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
813#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \
814 struct kvm_assigned_pci_dev)
815#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing)
816/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */
817#define KVM_ASSIGN_IRQ __KVM_DEPRECATED_VM_R_0x70
818#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq)
819#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71)
820#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \
821 struct kvm_assigned_pci_dev)
822#define KVM_ASSIGN_SET_MSIX_NR _IOW(KVMIO, 0x73, \
823 struct kvm_assigned_msix_nr)
824#define KVM_ASSIGN_SET_MSIX_ENTRY _IOW(KVMIO, 0x74, \
825 struct kvm_assigned_msix_entry)
826#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
827#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
828#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
829#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
830#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
831#define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config)
832#define KVM_SET_CLOCK _IOW(KVMIO, 0x7b, struct kvm_clock_data)
833#define KVM_GET_CLOCK _IOR(KVMIO, 0x7c, struct kvm_clock_data)
834/* Available with KVM_CAP_PIT_STATE2 */
835#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
836#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
837/* Available with KVM_CAP_PPC_GET_PVINFO */
838#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
839/* Available with KVM_CAP_TSC_CONTROL */
840#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
841#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
842/* Available with KVM_CAP_PCI_2_3 */
843#define KVM_ASSIGN_SET_INTX_MASK _IOW(KVMIO, 0xa4, \
844 struct kvm_assigned_pci_dev)
845/* Available with KVM_CAP_SIGNAL_MSI */
846#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
847/* Available with KVM_CAP_PPC_GET_SMMU_INFO */
848#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
849/* Available with KVM_CAP_PPC_ALLOC_HTAB */
850#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
851
852/*
853 * ioctls for vcpu fds
854 */
855#define KVM_RUN _IO(KVMIO, 0x80)
856#define KVM_GET_REGS _IOR(KVMIO, 0x81, struct kvm_regs)
857#define KVM_SET_REGS _IOW(KVMIO, 0x82, struct kvm_regs)
858#define KVM_GET_SREGS _IOR(KVMIO, 0x83, struct kvm_sregs)
859#define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs)
860#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
861#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt)
862/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */
863#define KVM_DEBUG_GUEST __KVM_DEPRECATED_VCPU_W_0x87
864#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs)
865#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs)
866#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid)
867#define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask)
868#define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu)
869#define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu)
870#define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state)
871#define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state)
872#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2)
873#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2)
874/* Available with KVM_CAP_VAPIC */
875#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl)
876/* Available with KVM_CAP_VAPIC */
877#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr)
878/* valid for virtual machine (for floating interrupt)_and_ vcpu */
879#define KVM_S390_INTERRUPT _IOW(KVMIO, 0x94, struct kvm_s390_interrupt)
880/* store status for s390 */
881#define KVM_S390_STORE_STATUS_NOADDR (-1ul)
882#define KVM_S390_STORE_STATUS_PREFIXED (-2ul)
883#define KVM_S390_STORE_STATUS _IOW(KVMIO, 0x95, unsigned long)
884/* initial ipl psw for s390 */
885#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw)
886/* initial reset for s390 */
887#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
888#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
889#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
890/* Available with KVM_CAP_NMI */
891#define KVM_NMI _IO(KVMIO, 0x9a)
892/* Available with KVM_CAP_SET_GUEST_DEBUG */
893#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
894/* MCE for x86 */
895#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
896#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
897#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
898/* IA64 stack access */
899#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
900#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
901/* Available with KVM_CAP_VCPU_EVENTS */
902#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events)
903#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events)
904/* Available with KVM_CAP_DEBUGREGS */
905#define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
906#define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
907#define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
908/* Available with KVM_CAP_XSAVE */
909#define KVM_GET_XSAVE _IOR(KVMIO, 0xa4, struct kvm_xsave)
910#define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave)
911/* Available with KVM_CAP_XCRS */
912#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
913#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
914#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
915/* Available with KVM_CAP_RMA */
916#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
917/* Available with KVM_CAP_SW_TLB */
918#define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb)
919/* Available with KVM_CAP_ONE_REG */
920#define KVM_GET_ONE_REG _IOW(KVMIO, 0xab, struct kvm_one_reg)
921#define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg)
922/* VM is being stopped by host */
923#define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad)
924
925#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
926#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
927#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
928
929struct kvm_assigned_pci_dev {
930 __u32 assigned_dev_id;
931 __u32 busnr;
932 __u32 devfn;
933 __u32 flags;
934 __u32 segnr;
935 union {
936 __u32 reserved[11];
937 };
938};
939
940#define KVM_DEV_IRQ_HOST_INTX (1 << 0)
941#define KVM_DEV_IRQ_HOST_MSI (1 << 1)
942#define KVM_DEV_IRQ_HOST_MSIX (1 << 2)
943
944#define KVM_DEV_IRQ_GUEST_INTX (1 << 8)
945#define KVM_DEV_IRQ_GUEST_MSI (1 << 9)
946#define KVM_DEV_IRQ_GUEST_MSIX (1 << 10)
947
948#define KVM_DEV_IRQ_HOST_MASK 0x00ff
949#define KVM_DEV_IRQ_GUEST_MASK 0xff00
950
951struct kvm_assigned_irq {
952 __u32 assigned_dev_id;
953 __u32 host_irq; /* ignored (legacy field) */
954 __u32 guest_irq;
955 __u32 flags;
956 union {
957 __u32 reserved[12];
958 };
959};
960
961struct kvm_assigned_msix_nr {
962 __u32 assigned_dev_id;
963 __u16 entry_nr;
964 __u16 padding;
965};
966
967#define KVM_MAX_MSIX_PER_DEV 256
968struct kvm_assigned_msix_entry {
969 __u32 assigned_dev_id;
970 __u32 gsi;
971 __u16 entry; /* The index of entry in the MSI-X table */
972 __u16 padding[3];
973};
974
975#endif /* __LINUX_KVM_H */
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index ff476ddaf310..00a97bb905db 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 7eab668f60f3..bffdb962f1a6 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/limits.h b/include/linux/limits.h
deleted file mode 100644
index 2d0f94162fb3..000000000000
--- a/include/linux/limits.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _LINUX_LIMITS_H
2#define _LINUX_LIMITS_H
3
4#define NR_OPEN 1024
5
6#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
7#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
8#define LINK_MAX 127 /* # links a file may have */
9#define MAX_CANON 255 /* size of the canonical input queue */
10#define MAX_INPUT 255 /* size of the type-ahead buffer */
11#define NAME_MAX 255 /* # chars in a file name */
12#define PATH_MAX 4096 /* # chars in a path name including nul */
13#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
14#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
15#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
16#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
17
18#define RTSIG_MAX 32
19
20#endif
diff --git a/include/linux/llc.h b/include/linux/llc.h
index a2418ae13ee9..b965314d017f 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 9635116dd830..6492181bcb1d 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 0df024bfd6f0..0dd276af9e4e 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/magic.h b/include/linux/magic.h
deleted file mode 100644
index e15192cb9cf4..000000000000
--- a/include/linux/magic.h
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifndef __LINUX_MAGIC_H__
2#define __LINUX_MAGIC_H__
3
4#define ADFS_SUPER_MAGIC 0xadf5
5#define AFFS_SUPER_MAGIC 0xadff
6#define AFS_SUPER_MAGIC 0x5346414F
7#define AUTOFS_SUPER_MAGIC 0x0187
8#define CODA_SUPER_MAGIC 0x73757245
9#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
10#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
11#define DEBUGFS_MAGIC 0x64626720
12#define SECURITYFS_MAGIC 0x73636673
13#define SELINUX_MAGIC 0xf97cff8c
14#define RAMFS_MAGIC 0x858458f6 /* some random number */
15#define TMPFS_MAGIC 0x01021994
16#define HUGETLBFS_MAGIC 0x958458f6 /* some random number */
17#define SQUASHFS_MAGIC 0x73717368
18#define ECRYPTFS_SUPER_MAGIC 0xf15f
19#define EFS_SUPER_MAGIC 0x414A53
20#define EXT2_SUPER_MAGIC 0xEF53
21#define EXT3_SUPER_MAGIC 0xEF53
22#define XENFS_SUPER_MAGIC 0xabba1974
23#define EXT4_SUPER_MAGIC 0xEF53
24#define BTRFS_SUPER_MAGIC 0x9123683E
25#define NILFS_SUPER_MAGIC 0x3434
26#define HPFS_SUPER_MAGIC 0xf995e849
27#define ISOFS_SUPER_MAGIC 0x9660
28#define JFFS2_SUPER_MAGIC 0x72b6
29#define PSTOREFS_MAGIC 0x6165676C
30
31#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
32#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
33#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */
34#define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2 fs, 30 char names */
35#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */
36
37#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
38#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
39#define NFS_SUPER_MAGIC 0x6969
40#define OPENPROM_SUPER_MAGIC 0x9fa1
41#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
42#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */
43
44#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
45 /* used by file system utilities that
46 look at the superblock, etc. */
47#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
48#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
49#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
50
51#define SMB_SUPER_MAGIC 0x517B
52#define CGROUP_SUPER_MAGIC 0x27e0eb
53
54
55#define STACK_END_MAGIC 0x57AC6E9D
56
57#define V9FS_MAGIC 0x01021997
58
59#define BDEVFS_MAGIC 0x62646576
60#define BINFMTFS_MAGIC 0x42494e4d
61#define DEVPTS_SUPER_MAGIC 0x1cd1
62#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
63#define PIPEFS_MAGIC 0x50495045
64#define PROC_SUPER_MAGIC 0x9fa0
65#define SOCKFS_MAGIC 0x534F434B
66#define SYSFS_MAGIC 0x62656572
67#define USBDEVICE_SUPER_MAGIC 0x9fa2
68#define MTD_INODE_FS_MAGIC 0x11307854
69#define ANON_INODE_FS_MAGIC 0x09041934
70
71
72#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/major.h b/include/linux/major.h
deleted file mode 100644
index 6a8ca98c9a96..000000000000
--- a/include/linux/major.h
+++ /dev/null
@@ -1,177 +0,0 @@
1#ifndef _LINUX_MAJOR_H
2#define _LINUX_MAJOR_H
3
4/*
5 * This file has definitions for major device numbers.
6 * For the device number assignments, see Documentation/devices.txt.
7 */
8
9#define UNNAMED_MAJOR 0
10#define MEM_MAJOR 1
11#define RAMDISK_MAJOR 1
12#define FLOPPY_MAJOR 2
13#define PTY_MASTER_MAJOR 2
14#define IDE0_MAJOR 3
15#define HD_MAJOR IDE0_MAJOR
16#define PTY_SLAVE_MAJOR 3
17#define TTY_MAJOR 4
18#define TTYAUX_MAJOR 5
19#define LP_MAJOR 6
20#define VCS_MAJOR 7
21#define LOOP_MAJOR 7
22#define SCSI_DISK0_MAJOR 8
23#define SCSI_TAPE_MAJOR 9
24#define MD_MAJOR 9
25#define MISC_MAJOR 10
26#define SCSI_CDROM_MAJOR 11
27#define MUX_MAJOR 11 /* PA-RISC only */
28#define XT_DISK_MAJOR 13
29#define INPUT_MAJOR 13
30#define SOUND_MAJOR 14
31#define CDU31A_CDROM_MAJOR 15
32#define JOYSTICK_MAJOR 15
33#define GOLDSTAR_CDROM_MAJOR 16
34#define OPTICS_CDROM_MAJOR 17
35#define SANYO_CDROM_MAJOR 18
36#define CYCLADES_MAJOR 19
37#define CYCLADESAUX_MAJOR 20
38#define MITSUMI_X_CDROM_MAJOR 20
39#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */
40#define SCSI_GENERIC_MAJOR 21
41#define IDE1_MAJOR 22
42#define DIGICU_MAJOR 22
43#define DIGI_MAJOR 23
44#define MITSUMI_CDROM_MAJOR 23
45#define CDU535_CDROM_MAJOR 24
46#define STL_SERIALMAJOR 24
47#define MATSUSHITA_CDROM_MAJOR 25
48#define STL_CALLOUTMAJOR 25
49#define MATSUSHITA_CDROM2_MAJOR 26
50#define QIC117_TAPE_MAJOR 27
51#define MATSUSHITA_CDROM3_MAJOR 27
52#define MATSUSHITA_CDROM4_MAJOR 28
53#define STL_SIOMEMMAJOR 28
54#define ACSI_MAJOR 28
55#define AZTECH_CDROM_MAJOR 29
56#define FB_MAJOR 29 /* /dev/fb* framebuffers */
57#define CM206_CDROM_MAJOR 32
58#define IDE2_MAJOR 33
59#define IDE3_MAJOR 34
60#define Z8530_MAJOR 34
61#define XPRAM_MAJOR 35 /* Expanded storage on S/390: "slow ram"*/
62#define NETLINK_MAJOR 36
63#define PS2ESDI_MAJOR 36
64#define IDETAPE_MAJOR 37
65#define Z2RAM_MAJOR 37
66#define APBLOCK_MAJOR 38 /* AP1000 Block device */
67#define DDV_MAJOR 39 /* AP1000 DDV block device */
68#define NBD_MAJOR 43 /* Network block device */
69#define RISCOM8_NORMAL_MAJOR 48
70#define DAC960_MAJOR 48 /* 48..55 */
71#define RISCOM8_CALLOUT_MAJOR 49
72#define MKISS_MAJOR 55
73#define DSP56K_MAJOR 55 /* DSP56001 processor device */
74
75#define IDE4_MAJOR 56
76#define IDE5_MAJOR 57
77
78#define SCSI_DISK1_MAJOR 65
79#define SCSI_DISK2_MAJOR 66
80#define SCSI_DISK3_MAJOR 67
81#define SCSI_DISK4_MAJOR 68
82#define SCSI_DISK5_MAJOR 69
83#define SCSI_DISK6_MAJOR 70
84#define SCSI_DISK7_MAJOR 71
85
86#define COMPAQ_SMART2_MAJOR 72
87#define COMPAQ_SMART2_MAJOR1 73
88#define COMPAQ_SMART2_MAJOR2 74
89#define COMPAQ_SMART2_MAJOR3 75
90#define COMPAQ_SMART2_MAJOR4 76
91#define COMPAQ_SMART2_MAJOR5 77
92#define COMPAQ_SMART2_MAJOR6 78
93#define COMPAQ_SMART2_MAJOR7 79
94
95#define SPECIALIX_NORMAL_MAJOR 75
96#define SPECIALIX_CALLOUT_MAJOR 76
97
98#define AURORA_MAJOR 79
99
100#define I2O_MAJOR 80 /* 80->87 */
101
102#define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */
103#define SCSI_CHANGER_MAJOR 86
104
105#define IDE6_MAJOR 88
106#define IDE7_MAJOR 89
107#define IDE8_MAJOR 90
108#define IDE9_MAJOR 91
109
110#define DASD_MAJOR 94
111
112#define MDISK_MAJOR 95
113
114#define UBD_MAJOR 98
115
116#define PP_MAJOR 99
117#define JSFD_MAJOR 99
118
119#define PHONE_MAJOR 100
120
121#define COMPAQ_CISS_MAJOR 104
122#define COMPAQ_CISS_MAJOR1 105
123#define COMPAQ_CISS_MAJOR2 106
124#define COMPAQ_CISS_MAJOR3 107
125#define COMPAQ_CISS_MAJOR4 108
126#define COMPAQ_CISS_MAJOR5 109
127#define COMPAQ_CISS_MAJOR6 110
128#define COMPAQ_CISS_MAJOR7 111
129
130#define VIODASD_MAJOR 112
131#define VIOCD_MAJOR 113
132
133#define ATARAID_MAJOR 114
134
135#define SCSI_DISK8_MAJOR 128
136#define SCSI_DISK9_MAJOR 129
137#define SCSI_DISK10_MAJOR 130
138#define SCSI_DISK11_MAJOR 131
139#define SCSI_DISK12_MAJOR 132
140#define SCSI_DISK13_MAJOR 133
141#define SCSI_DISK14_MAJOR 134
142#define SCSI_DISK15_MAJOR 135
143
144#define UNIX98_PTY_MASTER_MAJOR 128
145#define UNIX98_PTY_MAJOR_COUNT 8
146#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
147
148#define DRBD_MAJOR 147
149#define RTF_MAJOR 150
150#define RAW_MAJOR 162
151
152#define USB_ACM_MAJOR 166
153#define USB_ACM_AUX_MAJOR 167
154#define USB_CHAR_MAJOR 180
155
156#define MMC_BLOCK_MAJOR 179
157
158#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */
159#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
160#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
161
162#define XENVBD_MAJOR 202 /* Xen virtual block device */
163
164#define MSR_MAJOR 202
165#define CPUID_MAJOR 203
166
167#define OSST_MAJOR 206 /* OnStream-SCx0 SCSI tape */
168
169#define IBM_TTY3270_MAJOR 227
170#define IBM_FS3270_MAJOR 228
171
172#define VIOTAPE_MAJOR 230
173
174#define BLOCK_EXT_MAJOR 259
175#define SCSI_OSD_MAJOR 260 /* open-osd's OSD scsi device */
176
177#endif
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h
deleted file mode 100644
index 12d62a54d470..000000000000
--- a/include/linux/map_to_7segment.h
+++ /dev/null
@@ -1,187 +0,0 @@
1/*
2 * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com>
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 as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef MAP_TO_7SEGMENT_H
20#define MAP_TO_7SEGMENT_H
21
22/* This file provides translation primitives and tables for the conversion
23 * of (ASCII) characters to a 7-segments notation.
24 *
25 * The 7 segment's wikipedia notation below is used as standard.
26 * See: http://en.wikipedia.org/wiki/Seven_segment_display
27 *
28 * Notation: +-a-+
29 * f b
30 * +-g-+
31 * e c
32 * +-d-+
33 *
34 * Usage:
35 *
36 * Register a map variable, and fill it with a character set:
37 * static SEG7_DEFAULT_MAP(map_seg7);
38 *
39 *
40 * Then use for conversion:
41 * seg7 = map_to_seg7(&map_seg7, some_char);
42 * ...
43 *
44 * In device drivers it is recommended, if required, to make the char map
45 * accessible via the sysfs interface using the following scheme:
46 *
47 * static ssize_t show_map(struct device *dev, char *buf) {
48 * memcpy(buf, &map_seg7, sizeof(map_seg7));
49 * return sizeof(map_seg7);
50 * }
51 * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) {
52 * if(cnt != sizeof(map_seg7))
53 * return -EINVAL;
54 * memcpy(&map_seg7, buf, cnt);
55 * return cnt;
56 * }
57 * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map);
58 *
59 * History:
60 * 2005-05-31 RFC linux-kernel@vger.kernel.org
61 */
62#include <linux/errno.h>
63
64
65#define BIT_SEG7_A 0
66#define BIT_SEG7_B 1
67#define BIT_SEG7_C 2
68#define BIT_SEG7_D 3
69#define BIT_SEG7_E 4
70#define BIT_SEG7_F 5
71#define BIT_SEG7_G 6
72#define BIT_SEG7_RESERVED 7
73
74struct seg7_conversion_map {
75 unsigned char table[128];
76};
77
78static __inline__ int map_to_seg7(struct seg7_conversion_map *map, int c)
79{
80 return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL;
81}
82
83#define SEG7_CONVERSION_MAP(_name, _map) \
84 struct seg7_conversion_map _name = { .table = { _map } }
85
86/*
87 * It is recommended to use a facility that allows user space to redefine
88 * custom character sets for LCD devices. Please use a sysfs interface
89 * as described above.
90 */
91#define MAP_TO_SEG7_SYSFS_FILE "map_seg7"
92
93/*******************************************************************************
94 * ASCII conversion table
95 ******************************************************************************/
96
97#define _SEG7(l,a,b,c,d,e,f,g) \
98 ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \
99 e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G )
100
101#define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
102 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
103
104#define _MAP_33_47_ASCII_SEG7_SYMBOL \
105 _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\
106 _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\
107 _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\
108 _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\
109 _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1),
110
111#define _MAP_48_57_ASCII_SEG7_NUMERIC \
112 _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\
113 _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\
114 _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\
115 _SEG7('9',1,1,1,1,0,1,1),
116
117#define _MAP_58_64_ASCII_SEG7_SYMBOL \
118 _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\
119 _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\
120 _SEG7('@',1,1,0,1,1,1,1),
121
122#define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
123 _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\
124 _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
125 _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\
126 _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
127 _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\
128 _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\
129 _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\
130 _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
131 _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
132
133#define _MAP_91_96_ASCII_SEG7_SYMBOL \
134 _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\
135 _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0),
136
137#define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
138 _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\
139 _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\
140 _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\
141 _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\
142 _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\
143 _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\
144 _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\
145 _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\
146 _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1),
147
148#define _MAP_123_126_ASCII_SEG7_SYMBOL \
149 _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\
150 _SEG7('~',1,0,0,0,0,0,0),
151
152/* Maps */
153
154/* This set tries to map as close as possible to the visible characteristics
155 * of the ASCII symbol, lowercase and uppercase letters may differ in
156 * presentation on the display.
157 */
158#define MAP_ASCII7SEG_ALPHANUM \
159 _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
160 _MAP_33_47_ASCII_SEG7_SYMBOL \
161 _MAP_48_57_ASCII_SEG7_NUMERIC \
162 _MAP_58_64_ASCII_SEG7_SYMBOL \
163 _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \
164 _MAP_91_96_ASCII_SEG7_SYMBOL \
165 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
166 _MAP_123_126_ASCII_SEG7_SYMBOL
167
168/* This set tries to map as close as possible to the symbolic characteristics
169 * of the ASCII character for maximum discrimination.
170 * For now this means all alpha chars are in lower case representations.
171 * (This for example facilitates the use of hex numbers with uppercase input.)
172 */
173#define MAP_ASCII7SEG_ALPHANUM_LC \
174 _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \
175 _MAP_33_47_ASCII_SEG7_SYMBOL \
176 _MAP_48_57_ASCII_SEG7_NUMERIC \
177 _MAP_58_64_ASCII_SEG7_SYMBOL \
178 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
179 _MAP_91_96_ASCII_SEG7_SYMBOL \
180 _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \
181 _MAP_123_126_ASCII_SEG7_SYMBOL
182
183#define SEG7_DEFAULT_MAP(_name) \
184 SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM)
185
186#endif /* MAP_TO_7SEGMENT_H */
187
diff --git a/include/linux/matroxfb.h b/include/linux/matroxfb.h
deleted file mode 100644
index 8c22a8938642..000000000000
--- a/include/linux/matroxfb.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef __LINUX_MATROXFB_H__
2#define __LINUX_MATROXFB_H__
3
4#include <asm/ioctl.h>
5#include <linux/types.h>
6#include <linux/videodev2.h>
7#include <linux/fb.h>
8
9struct matroxioc_output_mode {
10 __u32 output; /* which output */
11#define MATROXFB_OUTPUT_PRIMARY 0x0000
12#define MATROXFB_OUTPUT_SECONDARY 0x0001
13#define MATROXFB_OUTPUT_DFP 0x0002
14 __u32 mode; /* which mode */
15#define MATROXFB_OUTPUT_MODE_PAL 0x0001
16#define MATROXFB_OUTPUT_MODE_NTSC 0x0002
17#define MATROXFB_OUTPUT_MODE_MONITOR 0x0080
18};
19#define MATROXFB_SET_OUTPUT_MODE _IOW('n',0xFA,size_t)
20#define MATROXFB_GET_OUTPUT_MODE _IOWR('n',0xFA,size_t)
21
22/* bitfield */
23#define MATROXFB_OUTPUT_CONN_PRIMARY (1 << MATROXFB_OUTPUT_PRIMARY)
24#define MATROXFB_OUTPUT_CONN_SECONDARY (1 << MATROXFB_OUTPUT_SECONDARY)
25#define MATROXFB_OUTPUT_CONN_DFP (1 << MATROXFB_OUTPUT_DFP)
26/* connect these outputs to this framebuffer */
27#define MATROXFB_SET_OUTPUT_CONNECTION _IOW('n',0xF8,size_t)
28/* which outputs are connected to this framebuffer */
29#define MATROXFB_GET_OUTPUT_CONNECTION _IOR('n',0xF8,size_t)
30/* which outputs are available for this framebuffer */
31#define MATROXFB_GET_AVAILABLE_OUTPUTS _IOR('n',0xF9,size_t)
32/* which outputs exist on this framebuffer */
33#define MATROXFB_GET_ALL_OUTPUTS _IOR('n',0xFB,size_t)
34
35enum matroxfb_ctrl_id {
36 MATROXFB_CID_TESTOUT = V4L2_CID_PRIVATE_BASE,
37 MATROXFB_CID_DEFLICKER,
38 MATROXFB_CID_LAST
39};
40
41#endif
42
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 6c406845f7e2..3d15c838116c 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/media.h b/include/linux/media.h
deleted file mode 100644
index 0ef883327de2..000000000000
--- a/include/linux/media.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Multimedia device API
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
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 version 2 as
11 * published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __LINUX_MEDIA_H
24#define __LINUX_MEDIA_H
25
26#include <linux/ioctl.h>
27#include <linux/types.h>
28#include <linux/version.h>
29
30#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
31
32struct media_device_info {
33 char driver[16];
34 char model[32];
35 char serial[40];
36 char bus_info[32];
37 __u32 media_version;
38 __u32 hw_revision;
39 __u32 driver_version;
40 __u32 reserved[31];
41};
42
43#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
44
45#define MEDIA_ENT_TYPE_SHIFT 16
46#define MEDIA_ENT_TYPE_MASK 0x00ff0000
47#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
48
49#define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT)
50#define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
51#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
52#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
53#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
54
55#define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
56#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
57#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2)
58#define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3)
59
60#define MEDIA_ENT_FL_DEFAULT (1 << 0)
61
62struct media_entity_desc {
63 __u32 id;
64 char name[32];
65 __u32 type;
66 __u32 revision;
67 __u32 flags;
68 __u32 group_id;
69 __u16 pads;
70 __u16 links;
71
72 __u32 reserved[4];
73
74 union {
75 /* Node specifications */
76 struct {
77 __u32 major;
78 __u32 minor;
79 } v4l;
80 struct {
81 __u32 major;
82 __u32 minor;
83 } fb;
84 struct {
85 __u32 card;
86 __u32 device;
87 __u32 subdevice;
88 } alsa;
89 int dvb;
90
91 /* Sub-device specifications */
92 /* Nothing needed yet */
93 __u8 raw[184];
94 };
95};
96
97#define MEDIA_PAD_FL_SINK (1 << 0)
98#define MEDIA_PAD_FL_SOURCE (1 << 1)
99
100struct media_pad_desc {
101 __u32 entity; /* entity ID */
102 __u16 index; /* pad index */
103 __u32 flags; /* pad flags */
104 __u32 reserved[2];
105};
106
107#define MEDIA_LNK_FL_ENABLED (1 << 0)
108#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
109#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
110
111struct media_link_desc {
112 struct media_pad_desc source;
113 struct media_pad_desc sink;
114 __u32 flags;
115 __u32 reserved[2];
116};
117
118struct media_links_enum {
119 __u32 entity;
120 /* Should have enough room for pads elements */
121 struct media_pad_desc __user *pads;
122 /* Should have enough room for links elements */
123 struct media_link_desc __user *links;
124 __u32 reserved[4];
125};
126
127#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
128#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
129#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
130#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
131
132#endif /* __LINUX_MEDIA_H */
diff --git a/include/linux/mei.h b/include/linux/mei.h
deleted file mode 100644
index bc0d8b69c49e..000000000000
--- a/include/linux/mei.h
+++ /dev/null
@@ -1,110 +0,0 @@
1/******************************************************************************
2 * Intel Management Engine Interface (Intel MEI) Linux driver
3 * Intel MEI Interface Header
4 *
5 * This file is provided under a dual BSD/GPLv2 license. When using or
6 * redistributing this file, you may do so under either license.
7 *
8 * GPL LICENSE SUMMARY
9 *
10 * Copyright(c) 2003 - 2012 Intel Corporation. All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
27 * in the file called LICENSE.GPL.
28 *
29 * Contact Information:
30 * Intel Corporation.
31 * linux-mei@linux.intel.com
32 * http://www.intel.com
33 *
34 * BSD LICENSE
35 *
36 * Copyright(c) 2003 - 2012 Intel Corporation. All rights reserved.
37 * All rights reserved.
38 *
39 * Redistribution and use in source and binary forms, with or without
40 * modification, are permitted provided that the following conditions
41 * are met:
42 *
43 * * Redistributions of source code must retain the above copyright
44 * notice, this list of conditions and the following disclaimer.
45 * * Redistributions in binary form must reproduce the above copyright
46 * notice, this list of conditions and the following disclaimer in
47 * the documentation and/or other materials provided with the
48 * distribution.
49 * * Neither the name Intel Corporation nor the names of its
50 * contributors may be used to endorse or promote products derived
51 * from this software without specific prior written permission.
52 *
53 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
54 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
55 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
56 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
57 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
58 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
59 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
60 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
61 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
62 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
63 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 *
65 *****************************************************************************/
66
67#ifndef _LINUX_MEI_H
68#define _LINUX_MEI_H
69
70#include <linux/uuid.h>
71
72/*
73 * This IOCTL is used to associate the current file descriptor with a
74 * FW Client (given by UUID). This opens a communication channel
75 * between a host client and a FW client. From this point every read and write
76 * will communicate with the associated FW client.
77 * Only in close() (file_operation release()) the communication between
78 * the clients is disconnected
79 *
80 * The IOCTL argument is a struct with a union that contains
81 * the input parameter and the output parameter for this IOCTL.
82 *
83 * The input parameter is UUID of the FW Client.
84 * The output parameter is the properties of the FW client
85 * (FW protocol version and max message size).
86 *
87 */
88#define IOCTL_MEI_CONNECT_CLIENT \
89 _IOWR('H' , 0x01, struct mei_connect_client_data)
90
91/*
92 * Intel MEI client information struct
93 */
94struct mei_client {
95 __u32 max_msg_length;
96 __u8 protocol_version;
97 __u8 reserved[3];
98};
99
100/*
101 * IOCTL Connect Client Data structure
102 */
103struct mei_connect_client_data {
104 union {
105 uuid_le in_client_uuid;
106 struct mei_client out_client_properties;
107 };
108};
109
110#endif /* _LINUX_MEI_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index cec569325608..e5ccb9ddd90e 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/meye.h b/include/linux/meye.h
deleted file mode 100644
index 0dd49954f746..000000000000
--- a/include/linux/meye.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * Motion Eye video4linux driver for Sony Vaio PictureBook
3 *
4 * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net>
5 *
6 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
7 *
8 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
9 *
10 * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
11 *
12 * Some parts borrowed from various video4linux drivers, especially
13 * bttv-driver.c and zoran.c, see original files for credits.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#ifndef _MEYE_H_
31#define _MEYE_H_
32
33/****************************************************************************/
34/* Private API for handling mjpeg capture / playback. */
35/****************************************************************************/
36
37struct meye_params {
38 unsigned char subsample;
39 unsigned char quality;
40 unsigned char sharpness;
41 unsigned char agc;
42 unsigned char picture;
43 unsigned char framerate;
44};
45
46/* query the extended parameters */
47#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOC_PRIVATE+0, struct meye_params)
48/* set the extended parameters */
49#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOC_PRIVATE+1, struct meye_params)
50/* queue a buffer for mjpeg capture */
51#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOC_PRIVATE+2, int)
52/* sync a previously queued mjpeg buffer */
53#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOC_PRIVATE+3, int)
54/* get a still uncompressed snapshot */
55#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOC_PRIVATE+4)
56/* get a jpeg compressed snapshot */
57#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int)
58
59/* V4L2 private controls */
60#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
61#define V4L2_CID_MEYE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1)
62#define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2)
63#define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3)
64#define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4)
65
66#endif
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 8ef3a7a11592..47492c9631b3 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/minix_fs.h b/include/linux/minix_fs.h
deleted file mode 100644
index 13fe09e0576a..000000000000
--- a/include/linux/minix_fs.h
+++ /dev/null
@@ -1,106 +0,0 @@
1#ifndef _LINUX_MINIX_FS_H
2#define _LINUX_MINIX_FS_H
3
4#include <linux/types.h>
5#include <linux/magic.h>
6
7/*
8 * The minix filesystem constants/structures
9 */
10
11/*
12 * Thanks to Kees J Bot for sending me the definitions of the new
13 * minix filesystem (aka V2) with bigger inodes and 32-bit block
14 * pointers.
15 */
16
17#define MINIX_ROOT_INO 1
18
19/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
20#define MINIX_LINK_MAX 250
21#define MINIX2_LINK_MAX 65530
22
23#define MINIX_I_MAP_SLOTS 8
24#define MINIX_Z_MAP_SLOTS 64
25#define MINIX_VALID_FS 0x0001 /* Clean fs. */
26#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
27
28#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
29
30/*
31 * This is the original minix inode layout on disk.
32 * Note the 8-bit gid and atime and ctime.
33 */
34struct minix_inode {
35 __u16 i_mode;
36 __u16 i_uid;
37 __u32 i_size;
38 __u32 i_time;
39 __u8 i_gid;
40 __u8 i_nlinks;
41 __u16 i_zone[9];
42};
43
44/*
45 * The new minix inode has all the time entries, as well as
46 * long block numbers and a third indirect block (7+1+1+1
47 * instead of 7+1+1). Also, some previously 8-bit values are
48 * now 16-bit. The inode is now 64 bytes instead of 32.
49 */
50struct minix2_inode {
51 __u16 i_mode;
52 __u16 i_nlinks;
53 __u16 i_uid;
54 __u16 i_gid;
55 __u32 i_size;
56 __u32 i_atime;
57 __u32 i_mtime;
58 __u32 i_ctime;
59 __u32 i_zone[10];
60};
61
62/*
63 * minix super-block data on disk
64 */
65struct minix_super_block {
66 __u16 s_ninodes;
67 __u16 s_nzones;
68 __u16 s_imap_blocks;
69 __u16 s_zmap_blocks;
70 __u16 s_firstdatazone;
71 __u16 s_log_zone_size;
72 __u32 s_max_size;
73 __u16 s_magic;
74 __u16 s_state;
75 __u32 s_zones;
76};
77
78/*
79 * V3 minix super-block data on disk
80 */
81struct minix3_super_block {
82 __u32 s_ninodes;
83 __u16 s_pad0;
84 __u16 s_imap_blocks;
85 __u16 s_zmap_blocks;
86 __u16 s_firstdatazone;
87 __u16 s_log_zone_size;
88 __u16 s_pad1;
89 __u32 s_max_size;
90 __u32 s_zones;
91 __u16 s_magic;
92 __u16 s_pad2;
93 __u16 s_blocksize;
94 __u8 s_disk_version;
95};
96
97struct minix_dir_entry {
98 __u16 inode;
99 char name[0];
100};
101
102struct minix3_dir_entry {
103 __u32 inode;
104 char name[0];
105};
106#endif
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 77cec2f45cb7..d09dde1e57fb 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/mmtimer.h b/include/linux/mmtimer.h
deleted file mode 100644
index 884cabf16088..000000000000
--- a/include/linux/mmtimer.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * Intel Multimedia Timer device interface
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
9 *
10 * This file should define an interface compatible with the IA-PC Multimedia
11 * Timers Draft Specification (rev. 0.97) from Intel. Note that some
12 * hardware may not be able to safely export its registers to userspace,
13 * so the ioctl interface should support all necessary functionality.
14 *
15 * 11/01/01 - jbarnes - initial revision
16 * 9/10/04 - Christoph Lameter - remove interrupt support
17 * 9/17/04 - jbarnes - remove test program, move some #defines to the driver
18 */
19
20#ifndef _LINUX_MMTIMER_H
21#define _LINUX_MMTIMER_H
22
23/*
24 * Breakdown of the ioctl's available. An 'optional' next to the command
25 * indicates that supporting this command is optional, while 'required'
26 * commands must be implemented if conformance is desired.
27 *
28 * MMTIMER_GETOFFSET - optional
29 * Should return the offset (relative to the start of the page where the
30 * registers are mapped) for the counter in question.
31 *
32 * MMTIMER_GETRES - required
33 * The resolution of the clock in femto (10^-15) seconds
34 *
35 * MMTIMER_GETFREQ - required
36 * Frequency of the clock in Hz
37 *
38 * MMTIMER_GETBITS - required
39 * Number of bits in the clock's counter
40 *
41 * MMTIMER_MMAPAVAIL - required
42 * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise
43 *
44 * MMTIMER_GETCOUNTER - required
45 * Gets the current value in the counter
46 */
47#define MMTIMER_IOCTL_BASE 'm'
48
49#define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0)
50#define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long)
51#define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long)
52#define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4)
53#define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6)
54#define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long)
55
56#endif /* _LINUX_MMTIMER_H */
diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h
deleted file mode 100644
index 8b5a79615fbf..000000000000
--- a/include/linux/mqueue.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/* Copyright (C) 2003 Krzysztof Benedyczak & Michal Wronski
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
7
8 It is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Lesser General Public License for more details.
12
13 You should have received a copy of the GNU Lesser General Public
14 License along with this software; if not, write to the Free
15 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16 02111-1307 USA. */
17
18#ifndef _LINUX_MQUEUE_H
19#define _LINUX_MQUEUE_H
20
21#define MQ_PRIO_MAX 32768
22/* per-uid limit of kernel memory used by mqueue, in bytes */
23#define MQ_BYTES_MAX 819200
24
25struct mq_attr {
26 long mq_flags; /* message queue flags */
27 long mq_maxmsg; /* maximum number of messages */
28 long mq_msgsize; /* maximum message size */
29 long mq_curmsgs; /* number of messages currently queued */
30 long __reserved[4]; /* ignored for input, zeroed for output */
31};
32
33/*
34 * SIGEV_THREAD implementation:
35 * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed
36 * to mq_notify, then
37 * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not
38 * necessary that the socket is bound.
39 * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN
40 * bytes long.
41 * If the notification is triggered, then the cookie is sent to the netlink
42 * socket. The last byte of the cookie is replaced with the NOTIFY_?? codes:
43 * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was
44 * removed, either due to a close() on the message queue fd or due to a
45 * mq_notify() that removed the notification.
46 */
47#define NOTIFY_NONE 0
48#define NOTIFY_WOKENUP 1
49#define NOTIFY_REMOVED 2
50
51#define NOTIFY_COOKIE_LEN 32
52
53#endif
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 46caaf44339d..ea00d9162ee5 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 6d8c7251eb8d..a223561ba12e 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 11cc2ac67e75..e1b163f912fb 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 56abf1558fdd..7a4b9e97d29a 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/mtio.h b/include/linux/mtio.h
deleted file mode 100644
index 18543e2db06f..000000000000
--- a/include/linux/mtio.h
+++ /dev/null
@@ -1,208 +0,0 @@
1/*
2 * linux/mtio.h header file for Linux. Written by H. Bergman
3 *
4 * Modified for special ioctls provided by zftape in September 1997
5 * by C.-J. Heine.
6 */
7
8#ifndef _LINUX_MTIO_H
9#define _LINUX_MTIO_H
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14/*
15 * Structures and definitions for mag tape io control commands
16 */
17
18/* structure for MTIOCTOP - mag tape op command */
19struct mtop {
20 short mt_op; /* operations defined below */
21 int mt_count; /* how many of them */
22};
23
24/* Magnetic Tape operations [Not all operations supported by all drivers]: */
25#define MTRESET 0 /* +reset drive in case of problems */
26#define MTFSF 1 /* forward space over FileMark,
27 * position at first record of next file
28 */
29#define MTBSF 2 /* backward space FileMark (position before FM) */
30#define MTFSR 3 /* forward space record */
31#define MTBSR 4 /* backward space record */
32#define MTWEOF 5 /* write an end-of-file record (mark) */
33#define MTREW 6 /* rewind */
34#define MTOFFL 7 /* rewind and put the drive offline (eject?) */
35#define MTNOP 8 /* no op, set status only (read with MTIOCGET) */
36#define MTRETEN 9 /* retension tape */
37#define MTBSFM 10 /* +backward space FileMark, position at FM */
38#define MTFSFM 11 /* +forward space FileMark, position at FM */
39#define MTEOM 12 /* goto end of recorded media (for appending files).
40 * MTEOM positions after the last FM, ready for
41 * appending another file.
42 */
43#define MTERASE 13 /* erase tape -- be careful! */
44
45#define MTRAS1 14 /* run self test 1 (nondestructive) */
46#define MTRAS2 15 /* run self test 2 (destructive) */
47#define MTRAS3 16 /* reserved for self test 3 */
48
49#define MTSETBLK 20 /* set block length (SCSI) */
50#define MTSETDENSITY 21 /* set tape density (SCSI) */
51#define MTSEEK 22 /* seek to block (Tandberg, etc.) */
52#define MTTELL 23 /* tell block (Tandberg, etc.) */
53#define MTSETDRVBUFFER 24 /* set the drive buffering according to SCSI-2 */
54 /* ordinary buffered operation with code 1 */
55#define MTFSS 25 /* space forward over setmarks */
56#define MTBSS 26 /* space backward over setmarks */
57#define MTWSM 27 /* write setmarks */
58
59#define MTLOCK 28 /* lock the drive door */
60#define MTUNLOCK 29 /* unlock the drive door */
61#define MTLOAD 30 /* execute the SCSI load command */
62#define MTUNLOAD 31 /* execute the SCSI unload command */
63#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */
64#define MTSETPART 33 /* Change the active tape partition */
65#define MTMKPART 34 /* Format the tape with one or two partitions */
66#define MTWEOFI 35 /* write an end-of-file record (mark) in immediate mode */
67
68/* structure for MTIOCGET - mag tape get status command */
69
70struct mtget {
71 long mt_type; /* type of magtape device */
72 long mt_resid; /* residual count: (not sure)
73 * number of bytes ignored, or
74 * number of files not skipped, or
75 * number of records not skipped.
76 */
77 /* the following registers are device dependent */
78 long mt_dsreg; /* status register */
79 long mt_gstat; /* generic (device independent) status */
80 long mt_erreg; /* error register */
81 /* The next two fields are not always used */
82 __kernel_daddr_t mt_fileno; /* number of current file on tape */
83 __kernel_daddr_t mt_blkno; /* current block number */
84};
85
86
87
88/*
89 * Constants for mt_type. Not all of these are supported,
90 * and these are not all of the ones that are supported.
91 */
92#define MT_ISUNKNOWN 0x01
93#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer */
94#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02 */
95#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02? */
96#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?) */
97#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24 */
98#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02 */
99#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L */
100#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L */
101#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller */
102#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features */
103#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24 */
104#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, Teac DC-1 card (Wangtek type) */
105#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40) */
106#define MT_ISDDS1 0x51 /* DDS device without partitions */
107#define MT_ISDDS2 0x52 /* DDS device with partitions */
108#define MT_ISONSTREAM_SC 0x61 /* OnStream SCSI tape drives (SC-x0)
109 and SCSI emulated (DI, DP, USB) */
110#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
111#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
112
113/* QIC-40/80/3010/3020 ftape supported drives.
114 * 20bit vendor ID + 0x800000 (see ftape-vendors.h)
115 */
116#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
117#define MT_ISFTAPE_FLAG 0x800000
118
119
120/* structure for MTIOCPOS - mag tape get position command */
121
122struct mtpos {
123 long mt_blkno; /* current block number */
124};
125
126
127/* mag tape io control commands */
128#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
129#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
130#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */
131
132
133/* Generic Mag Tape (device independent) status macros for examining
134 * mt_gstat -- HP-UX compatible.
135 * There is room for more generic status bits here, but I don't
136 * know which of them are reserved. At least three or so should
137 * be added to make this really useful.
138 */
139#define GMT_EOF(x) ((x) & 0x80000000)
140#define GMT_BOT(x) ((x) & 0x40000000)
141#define GMT_EOT(x) ((x) & 0x20000000)
142#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
143#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
144#define GMT_WR_PROT(x) ((x) & 0x04000000)
145/* #define GMT_ ? ((x) & 0x02000000) */
146#define GMT_ONLINE(x) ((x) & 0x01000000)
147#define GMT_D_6250(x) ((x) & 0x00800000)
148#define GMT_D_1600(x) ((x) & 0x00400000)
149#define GMT_D_800(x) ((x) & 0x00200000)
150/* #define GMT_ ? ((x) & 0x00100000) */
151/* #define GMT_ ? ((x) & 0x00080000) */
152#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */
153/* #define GMT_ ? ((x) & 0x00020000) */
154#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */
155#define GMT_CLN(x) ((x) & 0x00008000) /* cleaning requested */
156/* 15 generic status bits unused */
157
158
159/* SCSI-tape specific definitions */
160/* Bitfield shifts in the status */
161#define MT_ST_BLKSIZE_SHIFT 0
162#define MT_ST_BLKSIZE_MASK 0xffffff
163#define MT_ST_DENSITY_SHIFT 24
164#define MT_ST_DENSITY_MASK 0xff000000
165
166#define MT_ST_SOFTERR_SHIFT 0
167#define MT_ST_SOFTERR_MASK 0xffff
168
169/* Bitfields for the MTSETDRVBUFFER ioctl */
170#define MT_ST_OPTIONS 0xf0000000
171#define MT_ST_BOOLEANS 0x10000000
172#define MT_ST_SETBOOLEANS 0x30000000
173#define MT_ST_CLEARBOOLEANS 0x40000000
174#define MT_ST_WRITE_THRESHOLD 0x20000000
175#define MT_ST_DEF_BLKSIZE 0x50000000
176#define MT_ST_DEF_OPTIONS 0x60000000
177#define MT_ST_TIMEOUTS 0x70000000
178#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
179#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
180#define MT_ST_SET_CLN 0x80000000
181
182#define MT_ST_BUFFER_WRITES 0x1
183#define MT_ST_ASYNC_WRITES 0x2
184#define MT_ST_READ_AHEAD 0x4
185#define MT_ST_DEBUGGING 0x8
186#define MT_ST_TWO_FM 0x10
187#define MT_ST_FAST_MTEOM 0x20
188#define MT_ST_AUTO_LOCK 0x40
189#define MT_ST_DEF_WRITES 0x80
190#define MT_ST_CAN_BSR 0x100
191#define MT_ST_NO_BLKLIMS 0x200
192#define MT_ST_CAN_PARTITIONS 0x400
193#define MT_ST_SCSI2LOGICAL 0x800
194#define MT_ST_SYSV 0x1000
195#define MT_ST_NOWAIT 0x2000
196#define MT_ST_SILI 0x4000
197#define MT_ST_NOWAIT_EOF 0x8000
198
199/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
200#define MT_ST_CLEAR_DEFAULT 0xfffff
201#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
202#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
203#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
204
205/* The offset for the arguments for the special HP changer load command. */
206#define MT_ST_HPLOADER_OFFSET 10000
207
208#endif /* _LINUX_MTIO_H */
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index 54b8e0d8d916..5d0b2a1dee69 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 5c86e2b33e2d..4871170a04a0 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/ncp.h b/include/linux/ncp.h
deleted file mode 100644
index 99f0adeeb3f3..000000000000
--- a/include/linux/ncp.h
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 * ncp.h
3 *
4 * Copyright (C) 1995 by Volker Lendecke
5 * Modified for sparc by J.F. Chadima
6 * Modified for __constant_ntoh by Frank A. Vorstenbosch
7 *
8 */
9
10#ifndef _LINUX_NCP_H
11#define _LINUX_NCP_H
12
13#include <linux/types.h>
14
15#define NCP_PTYPE (0x11)
16#define NCP_PORT (0x0451)
17
18#define NCP_ALLOC_SLOT_REQUEST (0x1111)
19#define NCP_REQUEST (0x2222)
20#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
21
22struct ncp_request_header {
23 __u16 type;
24 __u8 sequence;
25 __u8 conn_low;
26 __u8 task;
27 __u8 conn_high;
28 __u8 function;
29 __u8 data[0];
30} __attribute__((packed));
31
32#define NCP_REPLY (0x3333)
33#define NCP_WATCHDOG (0x3E3E)
34#define NCP_POSITIVE_ACK (0x9999)
35
36struct ncp_reply_header {
37 __u16 type;
38 __u8 sequence;
39 __u8 conn_low;
40 __u8 task;
41 __u8 conn_high;
42 __u8 completion_code;
43 __u8 connection_state;
44 __u8 data[0];
45} __attribute__((packed));
46
47#define NCP_VOLNAME_LEN (16)
48#define NCP_NUMBER_OF_VOLUMES (256)
49struct ncp_volume_info {
50 __u32 total_blocks;
51 __u32 free_blocks;
52 __u32 purgeable_blocks;
53 __u32 not_yet_purgeable_blocks;
54 __u32 total_dir_entries;
55 __u32 available_dir_entries;
56 __u8 sectors_per_block;
57 char volume_name[NCP_VOLNAME_LEN + 1];
58};
59
60#define AR_READ (cpu_to_le16(1))
61#define AR_WRITE (cpu_to_le16(2))
62#define AR_EXCLUSIVE (cpu_to_le16(0x20))
63
64#define NCP_FILE_ID_LEN 6
65
66/* Defines for Name Spaces */
67#define NW_NS_DOS 0
68#define NW_NS_MAC 1
69#define NW_NS_NFS 2
70#define NW_NS_FTAM 3
71#define NW_NS_OS2 4
72
73/* Defines for ReturnInformationMask */
74#define RIM_NAME (cpu_to_le32(1))
75#define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
76#define RIM_ATTRIBUTES (cpu_to_le32(4))
77#define RIM_DATA_SIZE (cpu_to_le32(8))
78#define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
79#define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
80#define RIM_ARCHIVE (cpu_to_le32(0x40))
81#define RIM_MODIFY (cpu_to_le32(0x80))
82#define RIM_CREATION (cpu_to_le32(0x100))
83#define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
84#define RIM_DIRECTORY (cpu_to_le32(0x400))
85#define RIM_RIGHTS (cpu_to_le32(0x800))
86#define RIM_ALL (cpu_to_le32(0xFFF))
87#define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
88
89/* Defines for NSInfoBitMask */
90#define NSIBM_NFS_NAME 0x0001
91#define NSIBM_NFS_MODE 0x0002
92#define NSIBM_NFS_GID 0x0004
93#define NSIBM_NFS_NLINKS 0x0008
94#define NSIBM_NFS_RDEV 0x0010
95#define NSIBM_NFS_LINK 0x0020
96#define NSIBM_NFS_CREATED 0x0040
97#define NSIBM_NFS_UID 0x0080
98#define NSIBM_NFS_ACSFLAG 0x0100
99#define NSIBM_NFS_MYFLAG 0x0200
100
101/* open/create modes */
102#define OC_MODE_OPEN 0x01
103#define OC_MODE_TRUNCATE 0x02
104#define OC_MODE_REPLACE 0x02
105#define OC_MODE_CREATE 0x08
106
107/* open/create results */
108#define OC_ACTION_NONE 0x00
109#define OC_ACTION_OPEN 0x01
110#define OC_ACTION_CREATE 0x02
111#define OC_ACTION_TRUNCATE 0x04
112#define OC_ACTION_REPLACE 0x04
113
114/* access rights attributes */
115#ifndef AR_READ_ONLY
116#define AR_READ_ONLY 0x0001
117#define AR_WRITE_ONLY 0x0002
118#define AR_DENY_READ 0x0004
119#define AR_DENY_WRITE 0x0008
120#define AR_COMPATIBILITY 0x0010
121#define AR_WRITE_THROUGH 0x0040
122#define AR_OPEN_COMPRESSED 0x0100
123#endif
124
125struct nw_nfs_info {
126 __u32 mode;
127 __u32 rdev;
128};
129
130struct nw_info_struct {
131 __u32 spaceAlloc;
132 __le32 attributes;
133 __u16 flags;
134 __le32 dataStreamSize;
135 __le32 totalStreamSize;
136 __u16 numberOfStreams;
137 __le16 creationTime;
138 __le16 creationDate;
139 __u32 creatorID;
140 __le16 modifyTime;
141 __le16 modifyDate;
142 __u32 modifierID;
143 __le16 lastAccessDate;
144 __u16 archiveTime;
145 __u16 archiveDate;
146 __u32 archiverID;
147 __u16 inheritedRightsMask;
148 __le32 dirEntNum;
149 __le32 DosDirNum;
150 __u32 volNumber;
151 __u32 EADataSize;
152 __u32 EAKeyCount;
153 __u32 EAKeySize;
154 __u32 NSCreator;
155 __u8 nameLen;
156 __u8 entryName[256];
157 /* libncp may depend on there being nothing after entryName */
158#ifdef __KERNEL__
159 struct nw_nfs_info nfs;
160#endif
161} __attribute__((packed));
162
163/* modify mask - use with MODIFY_DOS_INFO structure */
164#define DM_ATTRIBUTES (cpu_to_le32(0x02))
165#define DM_CREATE_DATE (cpu_to_le32(0x04))
166#define DM_CREATE_TIME (cpu_to_le32(0x08))
167#define DM_CREATOR_ID (cpu_to_le32(0x10))
168#define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
169#define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
170#define DM_ARCHIVER_ID (cpu_to_le32(0x80))
171#define DM_MODIFY_DATE (cpu_to_le32(0x0100))
172#define DM_MODIFY_TIME (cpu_to_le32(0x0200))
173#define DM_MODIFIER_ID (cpu_to_le32(0x0400))
174#define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
175#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
176#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
177
178struct nw_modify_dos_info {
179 __le32 attributes;
180 __le16 creationDate;
181 __le16 creationTime;
182 __u32 creatorID;
183 __le16 modifyDate;
184 __le16 modifyTime;
185 __u32 modifierID;
186 __u16 archiveDate;
187 __u16 archiveTime;
188 __u32 archiverID;
189 __le16 lastAccessDate;
190 __u16 inheritanceGrantMask;
191 __u16 inheritanceRevokeMask;
192 __u32 maximumSpace;
193} __attribute__((packed));
194
195struct nw_search_sequence {
196 __u8 volNumber;
197 __u32 dirBase;
198 __u32 sequence;
199} __attribute__((packed));
200
201#endif /* _LINUX_NCP_H */
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
deleted file mode 100644
index e13eefef0653..000000000000
--- a/include/linux/ncp_fs.h
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * ncp_fs.h
3 *
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 *
6 */
7
8#ifndef _LINUX_NCP_FS_H
9#define _LINUX_NCP_FS_H
10
11#include <linux/fs.h>
12#include <linux/in.h>
13#include <linux/types.h>
14#include <linux/magic.h>
15
16#include <linux/ipx.h>
17#include <linux/ncp_no.h>
18
19/*
20 * ioctl commands
21 */
22
23struct ncp_ioctl_request {
24 unsigned int function;
25 unsigned int size;
26 char __user *data;
27};
28
29struct ncp_fs_info {
30 int version;
31 struct sockaddr_ipx addr;
32 __kernel_uid_t mounted_uid;
33 int connection; /* Connection number the server assigned us */
34 int buffer_size; /* The negotiated buffer size, to be
35 used for read/write requests! */
36
37 int volume_number;
38 __le32 directory_id;
39};
40
41struct ncp_fs_info_v2 {
42 int version;
43 unsigned long mounted_uid;
44 unsigned int connection;
45 unsigned int buffer_size;
46
47 unsigned int volume_number;
48 __le32 directory_id;
49
50 __u32 dummy1;
51 __u32 dummy2;
52 __u32 dummy3;
53};
54
55struct ncp_sign_init
56{
57 char sign_root[8];
58 char sign_last[16];
59};
60
61struct ncp_lock_ioctl
62{
63#define NCP_LOCK_LOG 0
64#define NCP_LOCK_SH 1
65#define NCP_LOCK_EX 2
66#define NCP_LOCK_CLEAR 256
67 int cmd;
68 int origin;
69 unsigned int offset;
70 unsigned int length;
71#define NCP_LOCK_DEFAULT_TIMEOUT 18
72#define NCP_LOCK_MAX_TIMEOUT 180
73 int timeout;
74};
75
76struct ncp_setroot_ioctl
77{
78 int volNumber;
79 int namespace;
80 __le32 dirEntNum;
81};
82
83struct ncp_objectname_ioctl
84{
85#define NCP_AUTH_NONE 0x00
86#define NCP_AUTH_BIND 0x31
87#define NCP_AUTH_NDS 0x32
88 int auth_type;
89 size_t object_name_len;
90 void __user * object_name; /* a userspace data, in most cases user name */
91};
92
93struct ncp_privatedata_ioctl
94{
95 size_t len;
96 void __user * data; /* ~1000 for NDS */
97};
98
99/* NLS charsets by ioctl */
100#define NCP_IOCSNAME_LEN 20
101struct ncp_nls_ioctl
102{
103 unsigned char codepage[NCP_IOCSNAME_LEN+1];
104 unsigned char iocharset[NCP_IOCSNAME_LEN+1];
105};
106
107#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
108#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t)
109#define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long)
110
111#define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
112
113#define NCP_GET_FS_INFO_VERSION (1)
114#define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
115#define NCP_GET_FS_INFO_VERSION_V2 (2)
116#define NCP_IOC_GET_FS_INFO_V2 _IOWR('n', 4, struct ncp_fs_info_v2)
117
118#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
119#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
120#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
121
122#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
123
124#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
125#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
126
127#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
128#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
129#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
130#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
131
132#define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
133#define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
134
135#define NCP_IOC_GETDENTRYTTL _IOW('n', 12, __u32)
136#define NCP_IOC_SETDENTRYTTL _IOR('n', 12, __u32)
137
138/*
139 * The packet size to allocate. One page should be enough.
140 */
141#define NCP_PACKET_SIZE 4070
142
143#define NCP_MAXPATHLEN 255
144#define NCP_MAXNAMELEN 14
145
146#endif /* _LINUX_NCP_FS_H */
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h
deleted file mode 100644
index dfcbea2d889f..000000000000
--- a/include/linux/ncp_mount.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * ncp_mount.h
3 *
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 *
6 */
7
8#ifndef _LINUX_NCP_MOUNT_H
9#define _LINUX_NCP_MOUNT_H
10
11#include <linux/types.h>
12#include <linux/ncp.h>
13
14#define NCP_MOUNT_VERSION 3 /* Binary */
15
16/* Values for flags */
17#define NCP_MOUNT_SOFT 0x0001
18#define NCP_MOUNT_INTR 0x0002
19#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
20#define NCP_MOUNT_NO_OS2 0x0008 /* do not use OS/2 (LONG) namespace */
21#define NCP_MOUNT_NO_NFS 0x0010 /* do not use NFS namespace */
22#define NCP_MOUNT_EXTRAS 0x0020
23#define NCP_MOUNT_SYMLINKS 0x0040 /* enable symlinks */
24#define NCP_MOUNT_NFS_EXTRAS 0x0080 /* Enable use of NFS NS meta-info */
25
26struct ncp_mount_data {
27 int version;
28 unsigned int ncp_fd; /* The socket to the ncp port */
29 __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
30 __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */
31
32 unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
33 unsigned int time_out; /* How long should I wait after
34 sending a NCP request? */
35 unsigned int retry_count; /* And how often should I retry? */
36 unsigned int flags;
37
38 __kernel_uid_t uid;
39 __kernel_gid_t gid;
40 __kernel_mode_t file_mode;
41 __kernel_mode_t dir_mode;
42};
43
44#define NCP_MOUNT_VERSION_V4 (4) /* Binary or text */
45
46struct ncp_mount_data_v4 {
47 int version;
48 unsigned long flags; /* NCP_MOUNT_* flags */
49 /* MIPS uses long __kernel_uid_t, but... */
50 /* we neever pass -1, so it is safe */
51 unsigned long mounted_uid; /* Who may umount() this filesystem? */
52 /* MIPS uses long __kernel_pid_t */
53 long wdog_pid; /* Who cares for our watchdog packets? */
54
55 unsigned int ncp_fd; /* The socket to the ncp port */
56 unsigned int time_out; /* How long should I wait after
57 sending a NCP request? */
58 unsigned int retry_count; /* And how often should I retry? */
59
60 /* MIPS uses long __kernel_uid_t... */
61 /* we never pass -1, so it is safe */
62 unsigned long uid;
63 unsigned long gid;
64 /* MIPS uses unsigned long __kernel_mode_t */
65 unsigned long file_mode;
66 unsigned long dir_mode;
67};
68
69#define NCP_MOUNT_VERSION_V5 (5) /* Text only */
70
71#endif
diff --git a/include/linux/ncp_no.h b/include/linux/ncp_no.h
deleted file mode 100644
index cddaa48fb182..000000000000
--- a/include/linux/ncp_no.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _NCP_NO
2#define _NCP_NO
3
4/* these define the attribute byte as seen by NCP */
5#define aRONLY (__cpu_to_le32(1))
6#define aHIDDEN (__cpu_to_le32(2))
7#define aSYSTEM (__cpu_to_le32(4))
8#define aEXECUTE (__cpu_to_le32(8))
9#define aDIR (__cpu_to_le32(0x10))
10#define aARCH (__cpu_to_le32(0x20))
11#define aSHARED (__cpu_to_le32(0x80))
12#define aDONTSUBALLOCATE (__cpu_to_le32(1L<<11))
13#define aTRANSACTIONAL (__cpu_to_le32(1L<<12))
14#define aPURGE (__cpu_to_le32(1L<<16))
15#define aRENAMEINHIBIT (__cpu_to_le32(1L<<17))
16#define aDELETEINHIBIT (__cpu_to_le32(1L<<18))
17#define aDONTCOMPRESS (__cpu_to_le32(1L<<27))
18
19#endif /* _NCP_NO */
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
deleted file mode 100644
index 275e5d65dcb2..000000000000
--- a/include/linux/neighbour.h
+++ /dev/null
@@ -1,159 +0,0 @@
1#ifndef __LINUX_NEIGHBOUR_H
2#define __LINUX_NEIGHBOUR_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7struct ndmsg {
8 __u8 ndm_family;
9 __u8 ndm_pad1;
10 __u16 ndm_pad2;
11 __s32 ndm_ifindex;
12 __u16 ndm_state;
13 __u8 ndm_flags;
14 __u8 ndm_type;
15};
16
17enum {
18 NDA_UNSPEC,
19 NDA_DST,
20 NDA_LLADDR,
21 NDA_CACHEINFO,
22 NDA_PROBES,
23 __NDA_MAX
24};
25
26#define NDA_MAX (__NDA_MAX - 1)
27
28/*
29 * Neighbor Cache Entry Flags
30 */
31
32#define NTF_USE 0x01
33#define NTF_PROXY 0x08 /* == ATF_PUBL */
34#define NTF_ROUTER 0x80
35
36#define NTF_SELF 0x02
37#define NTF_MASTER 0x04
38
39/*
40 * Neighbor Cache Entry States.
41 */
42
43#define NUD_INCOMPLETE 0x01
44#define NUD_REACHABLE 0x02
45#define NUD_STALE 0x04
46#define NUD_DELAY 0x08
47#define NUD_PROBE 0x10
48#define NUD_FAILED 0x20
49
50/* Dummy states */
51#define NUD_NOARP 0x40
52#define NUD_PERMANENT 0x80
53#define NUD_NONE 0x00
54
55/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
56 and make no address resolution or NUD.
57 NUD_PERMANENT is also cannot be deleted by garbage collectors.
58 */
59
60struct nda_cacheinfo {
61 __u32 ndm_confirmed;
62 __u32 ndm_used;
63 __u32 ndm_updated;
64 __u32 ndm_refcnt;
65};
66
67/*****************************************************************
68 * Neighbour tables specific messages.
69 *
70 * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
71 * NLM_F_DUMP flag set. Every neighbour table configuration is
72 * spread over multiple messages to avoid running into message
73 * size limits on systems with many interfaces. The first message
74 * in the sequence transports all not device specific data such as
75 * statistics, configuration, and the default parameter set.
76 * This message is followed by 0..n messages carrying device
77 * specific parameter sets.
78 * Although the ordering should be sufficient, NDTA_NAME can be
79 * used to identify sequences. The initial message can be identified
80 * by checking for NDTA_CONFIG. The device specific messages do
81 * not contain this TLV but have NDTPA_IFINDEX set to the
82 * corresponding interface index.
83 *
84 * To change neighbour table attributes, send RTM_SETNEIGHTBL
85 * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
86 * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
87 * otherwise. Device specific parameter sets can be changed by
88 * setting NDTPA_IFINDEX to the interface index of the corresponding
89 * device.
90 ****/
91
92struct ndt_stats {
93 __u64 ndts_allocs;
94 __u64 ndts_destroys;
95 __u64 ndts_hash_grows;
96 __u64 ndts_res_failed;
97 __u64 ndts_lookups;
98 __u64 ndts_hits;
99 __u64 ndts_rcv_probes_mcast;
100 __u64 ndts_rcv_probes_ucast;
101 __u64 ndts_periodic_gc_runs;
102 __u64 ndts_forced_gc_runs;
103};
104
105enum {
106 NDTPA_UNSPEC,
107 NDTPA_IFINDEX, /* u32, unchangeable */
108 NDTPA_REFCNT, /* u32, read-only */
109 NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
110 NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
111 NDTPA_RETRANS_TIME, /* u64, msecs */
112 NDTPA_GC_STALETIME, /* u64, msecs */
113 NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
114 NDTPA_QUEUE_LEN, /* u32 */
115 NDTPA_APP_PROBES, /* u32 */
116 NDTPA_UCAST_PROBES, /* u32 */
117 NDTPA_MCAST_PROBES, /* u32 */
118 NDTPA_ANYCAST_DELAY, /* u64, msecs */
119 NDTPA_PROXY_DELAY, /* u64, msecs */
120 NDTPA_PROXY_QLEN, /* u32 */
121 NDTPA_LOCKTIME, /* u64, msecs */
122 NDTPA_QUEUE_LENBYTES, /* u32 */
123 __NDTPA_MAX
124};
125#define NDTPA_MAX (__NDTPA_MAX - 1)
126
127struct ndtmsg {
128 __u8 ndtm_family;
129 __u8 ndtm_pad1;
130 __u16 ndtm_pad2;
131};
132
133struct ndt_config {
134 __u16 ndtc_key_len;
135 __u16 ndtc_entry_size;
136 __u32 ndtc_entries;
137 __u32 ndtc_last_flush; /* delta to now in msecs */
138 __u32 ndtc_last_rand; /* delta to now in msecs */
139 __u32 ndtc_hash_rnd;
140 __u32 ndtc_hash_mask;
141 __u32 ndtc_hash_chain_gc;
142 __u32 ndtc_proxy_qlen;
143};
144
145enum {
146 NDTA_UNSPEC,
147 NDTA_NAME, /* char *, unchangeable */
148 NDTA_THRESH1, /* u32 */
149 NDTA_THRESH2, /* u32 */
150 NDTA_THRESH3, /* u32 */
151 NDTA_CONFIG, /* struct ndt_config, read-only */
152 NDTA_PARMS, /* nested TLV NDTPA_* */
153 NDTA_STATS, /* struct ndt_stats, read-only */
154 NDTA_GC_INTERVAL, /* u64, msecs */
155 __NDTA_MAX
156};
157#define NDTA_MAX (__NDTA_MAX - 1)
158
159#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 6ab31cabef7c..aa1673160a45 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/net_dropmon.h b/include/linux/net_dropmon.h
deleted file mode 100644
index 2a739462caeb..000000000000
--- a/include/linux/net_dropmon.h
+++ /dev/null
@@ -1,64 +0,0 @@
1#ifndef __NET_DROPMON_H
2#define __NET_DROPMON_H
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7struct net_dm_drop_point {
8 __u8 pc[8];
9 __u32 count;
10};
11
12#define is_drop_point_hw(x) do {\
13 int ____i, ____j;\
14 for (____i = 0; ____i < 8; i ____i++)\
15 ____j |= x[____i];\
16 ____j;\
17} while (0)
18
19#define NET_DM_CFG_VERSION 0
20#define NET_DM_CFG_ALERT_COUNT 1
21#define NET_DM_CFG_ALERT_DELAY 2
22#define NET_DM_CFG_MAX 3
23
24struct net_dm_config_entry {
25 __u32 type;
26 __u64 data __attribute__((aligned(8)));
27};
28
29struct net_dm_config_msg {
30 __u32 entries;
31 struct net_dm_config_entry options[0];
32};
33
34struct net_dm_alert_msg {
35 __u32 entries;
36 struct net_dm_drop_point points[0];
37};
38
39struct net_dm_user_msg {
40 union {
41 struct net_dm_config_msg user;
42 struct net_dm_alert_msg alert;
43 } u;
44};
45
46
47/* These are the netlink message types for this protocol */
48
49enum {
50 NET_DM_CMD_UNSPEC = 0,
51 NET_DM_CMD_ALERT,
52 NET_DM_CMD_CONFIG,
53 NET_DM_CMD_START,
54 NET_DM_CMD_STOP,
55 _NET_DM_CMD_MAX,
56};
57
58#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
59
60/*
61 * Our group identifiers
62 */
63#define NET_DM_GRP_ALERT 1
64#endif
diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
deleted file mode 100644
index ae5df122e42f..000000000000
--- a/include/linux/net_tstamp.h
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * Userspace API for hardware time stamping of network packets
3 *
4 * Copyright (C) 2008,2009 Intel Corporation
5 * Author: Patrick Ohly <patrick.ohly@intel.com>
6 *
7 */
8
9#ifndef _NET_TIMESTAMPING_H
10#define _NET_TIMESTAMPING_H
11
12#include <linux/socket.h> /* for SO_TIMESTAMPING */
13
14/* SO_TIMESTAMPING gets an integer bit field comprised of these values */
15enum {
16 SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),
17 SOF_TIMESTAMPING_TX_SOFTWARE = (1<<1),
18 SOF_TIMESTAMPING_RX_HARDWARE = (1<<2),
19 SOF_TIMESTAMPING_RX_SOFTWARE = (1<<3),
20 SOF_TIMESTAMPING_SOFTWARE = (1<<4),
21 SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5),
22 SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6),
23 SOF_TIMESTAMPING_MASK =
24 (SOF_TIMESTAMPING_RAW_HARDWARE - 1) |
25 SOF_TIMESTAMPING_RAW_HARDWARE
26};
27
28/**
29 * struct hwtstamp_config - %SIOCSHWTSTAMP parameter
30 *
31 * @flags: no flags defined right now, must be zero
32 * @tx_type: one of HWTSTAMP_TX_*
33 * @rx_type: one of one of HWTSTAMP_FILTER_*
34 *
35 * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to
36 * this structure. dev_ifsioc() in the kernel takes care of the
37 * translation between 32 bit userspace and 64 bit kernel. The
38 * structure is intentionally chosen so that it has the same layout on
39 * 32 and 64 bit systems, don't break this!
40 */
41struct hwtstamp_config {
42 int flags;
43 int tx_type;
44 int rx_filter;
45};
46
47/* possible values for hwtstamp_config->tx_type */
48enum hwtstamp_tx_types {
49 /*
50 * No outgoing packet will need hardware time stamping;
51 * should a packet arrive which asks for it, no hardware
52 * time stamping will be done.
53 */
54 HWTSTAMP_TX_OFF,
55
56 /*
57 * Enables hardware time stamping for outgoing packets;
58 * the sender of the packet decides which are to be
59 * time stamped by setting %SOF_TIMESTAMPING_TX_SOFTWARE
60 * before sending the packet.
61 */
62 HWTSTAMP_TX_ON,
63
64 /*
65 * Enables time stamping for outgoing packets just as
66 * HWTSTAMP_TX_ON does, but also enables time stamp insertion
67 * directly into Sync packets. In this case, transmitted Sync
68 * packets will not received a time stamp via the socket error
69 * queue.
70 */
71 HWTSTAMP_TX_ONESTEP_SYNC,
72};
73
74/* possible values for hwtstamp_config->rx_filter */
75enum hwtstamp_rx_filters {
76 /* time stamp no incoming packet at all */
77 HWTSTAMP_FILTER_NONE,
78
79 /* time stamp any incoming packet */
80 HWTSTAMP_FILTER_ALL,
81
82 /* return value: time stamp all packets requested plus some others */
83 HWTSTAMP_FILTER_SOME,
84
85 /* PTP v1, UDP, any kind of event packet */
86 HWTSTAMP_FILTER_PTP_V1_L4_EVENT,
87 /* PTP v1, UDP, Sync packet */
88 HWTSTAMP_FILTER_PTP_V1_L4_SYNC,
89 /* PTP v1, UDP, Delay_req packet */
90 HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ,
91 /* PTP v2, UDP, any kind of event packet */
92 HWTSTAMP_FILTER_PTP_V2_L4_EVENT,
93 /* PTP v2, UDP, Sync packet */
94 HWTSTAMP_FILTER_PTP_V2_L4_SYNC,
95 /* PTP v2, UDP, Delay_req packet */
96 HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ,
97
98 /* 802.AS1, Ethernet, any kind of event packet */
99 HWTSTAMP_FILTER_PTP_V2_L2_EVENT,
100 /* 802.AS1, Ethernet, Sync packet */
101 HWTSTAMP_FILTER_PTP_V2_L2_SYNC,
102 /* 802.AS1, Ethernet, Delay_req packet */
103 HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ,
104
105 /* PTP v2/802.AS1, any layer, any kind of event packet */
106 HWTSTAMP_FILTER_PTP_V2_EVENT,
107 /* PTP v2/802.AS1, any layer, Sync packet */
108 HWTSTAMP_FILTER_PTP_V2_SYNC,
109 /* PTP v2/802.AS1, any layer, Delay_req packet */
110 HWTSTAMP_FILTER_PTP_V2_DELAY_REQ,
111};
112
113#endif /* _NET_TIMESTAMPING_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 561c8bc8976d..f8eda0276f03 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 1dcf2a38e51f..ee142846f56a 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_arp.h b/include/linux/netfilter_arp.h
deleted file mode 100644
index 92bc6ddcbf73..000000000000
--- a/include/linux/netfilter_arp.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef __LINUX_ARP_NETFILTER_H
2#define __LINUX_ARP_NETFILTER_H
3
4/* ARP-specific defines for netfilter.
5 * (C)2002 Rusty Russell IBM -- This code is GPL.
6 */
7
8#include <linux/netfilter.h>
9
10/* There is no PF_ARP. */
11#define NF_ARP 0
12
13/* ARP Hooks */
14#define NF_ARP_IN 0
15#define NF_ARP_OUT 1
16#define NF_ARP_FORWARD 2
17#define NF_ARP_NUMHOOKS 3
18
19#endif /* __LINUX_ARP_NETFILTER_H */
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 31d2844e6572..dfb4d9e52bcb 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_decnet.h b/include/linux/netfilter_decnet.h
deleted file mode 100644
index 0b09732aacd5..000000000000
--- a/include/linux/netfilter_decnet.h
+++ /dev/null
@@ -1,79 +0,0 @@
1#ifndef __LINUX_DECNET_NETFILTER_H
2#define __LINUX_DECNET_NETFILTER_H
3
4/* DECnet-specific defines for netfilter.
5 * This file (C) Steve Whitehouse 1999 derived from the
6 * ipv4 netfilter header file which is
7 * (C)1998 Rusty Russell -- This code is GPL.
8 */
9
10#include <linux/netfilter.h>
11
12/* only for userspace compatibility */
13#ifndef __KERNEL__
14
15#include <limits.h> /* for INT_MIN, INT_MAX */
16
17/* IP Cache bits. */
18/* Src IP address. */
19#define NFC_DN_SRC 0x0001
20/* Dest IP address. */
21#define NFC_DN_DST 0x0002
22/* Input device. */
23#define NFC_DN_IF_IN 0x0004
24/* Output device. */
25#define NFC_DN_IF_OUT 0x0008
26#endif /* ! __KERNEL__ */
27
28/* DECnet Hooks */
29/* After promisc drops, checksum checks. */
30#define NF_DN_PRE_ROUTING 0
31/* If the packet is destined for this box. */
32#define NF_DN_LOCAL_IN 1
33/* If the packet is destined for another interface. */
34#define NF_DN_FORWARD 2
35/* Packets coming from a local process. */
36#define NF_DN_LOCAL_OUT 3
37/* Packets about to hit the wire. */
38#define NF_DN_POST_ROUTING 4
39/* Input Hello Packets */
40#define NF_DN_HELLO 5
41/* Input Routing Packets */
42#define NF_DN_ROUTE 6
43#define NF_DN_NUMHOOKS 7
44
45enum nf_dn_hook_priorities {
46 NF_DN_PRI_FIRST = INT_MIN,
47 NF_DN_PRI_CONNTRACK = -200,
48 NF_DN_PRI_MANGLE = -150,
49 NF_DN_PRI_NAT_DST = -100,
50 NF_DN_PRI_FILTER = 0,
51 NF_DN_PRI_NAT_SRC = 100,
52 NF_DN_PRI_DNRTMSG = 200,
53 NF_DN_PRI_LAST = INT_MAX,
54};
55
56struct nf_dn_rtmsg {
57 int nfdn_ifindex;
58};
59
60#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)))
61
62#ifndef __KERNEL__
63/* backwards compatibility for userspace */
64#define DNRMG_L1_GROUP 0x01
65#define DNRMG_L2_GROUP 0x02
66#endif
67
68enum {
69 DNRNG_NLGRP_NONE,
70#define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE
71 DNRNG_NLGRP_L1,
72#define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1
73 DNRNG_NLGRP_L2,
74#define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2
75 __DNRNG_NLGRP_MAX
76};
77#define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1)
78
79#endif /*__LINUX_DECNET_NETFILTER_H*/
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index b962dfc695ae..dfaf116b3e81 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 7c8a513ce7a3..98ffb54988b6 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 6d3af05c107c..e0f746b7b95c 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/netrom.h b/include/linux/netrom.h
deleted file mode 100644
index af7313cc9cb6..000000000000
--- a/include/linux/netrom.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * These are the public elements of the Linux kernel NET/ROM implementation.
3 * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
4 * definition of the ax25_address structure.
5 */
6
7#ifndef NETROM_KERNEL_H
8#define NETROM_KERNEL_H
9
10#include <linux/ax25.h>
11
12#define NETROM_MTU 236
13
14#define NETROM_T1 1
15#define NETROM_T2 2
16#define NETROM_N2 3
17#define NETROM_T4 6
18#define NETROM_IDLE 7
19
20#define SIOCNRDECOBS (SIOCPROTOPRIVATE+2)
21
22struct nr_route_struct {
23#define NETROM_NEIGH 0
24#define NETROM_NODE 1
25 int type;
26 ax25_address callsign;
27 char device[16];
28 unsigned int quality;
29 char mnemonic[7];
30 ax25_address neighbour;
31 unsigned int obs_count;
32 unsigned int ndigis;
33 ax25_address digipeaters[AX25_MAX_DIGIS];
34};
35
36#endif
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
deleted file mode 100644
index d908d17da56d..000000000000
--- a/include/linux/nfc.h
+++ /dev/null
@@ -1,197 +0,0 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
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
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_NFC_H
25#define __LINUX_NFC_H
26
27#include <linux/types.h>
28#include <linux/socket.h>
29
30#define NFC_GENL_NAME "nfc"
31#define NFC_GENL_VERSION 1
32
33#define NFC_GENL_MCAST_EVENT_NAME "events"
34
35/**
36 * enum nfc_commands - supported nfc commands
37 *
38 * @NFC_CMD_UNSPEC: unspecified command
39 *
40 * @NFC_CMD_GET_DEVICE: request information about a device (requires
41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices
42 * @NFC_CMD_DEV_UP: turn on the nfc device
43 * (requires %NFC_ATTR_DEVICE_INDEX)
44 * @NFC_CMD_DEV_DOWN: turn off the nfc device
45 * (requires %NFC_ATTR_DEVICE_INDEX)
46 * @NFC_CMD_START_POLL: start polling for targets using the given protocols
47 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS)
48 * @NFC_CMD_STOP_POLL: stop polling for targets (requires
49 * %NFC_ATTR_DEVICE_INDEX)
50 * @NFC_CMD_GET_TARGET: dump all targets found by the previous poll (requires
51 * %NFC_ATTR_DEVICE_INDEX)
52 * @NFC_EVENT_TARGETS_FOUND: event emitted when a new target is found
53 * (it sends %NFC_ATTR_DEVICE_INDEX)
54 * @NFC_EVENT_DEVICE_ADDED: event emitted when a new device is registred
55 * (it sends %NFC_ATTR_DEVICE_NAME, %NFC_ATTR_DEVICE_INDEX and
56 * %NFC_ATTR_PROTOCOLS)
57 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
58 * (it sends %NFC_ATTR_DEVICE_INDEX)
59 * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in
60 * target mode.
61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated
62 * from target mode.
63 */
64enum nfc_commands {
65 NFC_CMD_UNSPEC,
66 NFC_CMD_GET_DEVICE,
67 NFC_CMD_DEV_UP,
68 NFC_CMD_DEV_DOWN,
69 NFC_CMD_DEP_LINK_UP,
70 NFC_CMD_DEP_LINK_DOWN,
71 NFC_CMD_START_POLL,
72 NFC_CMD_STOP_POLL,
73 NFC_CMD_GET_TARGET,
74 NFC_EVENT_TARGETS_FOUND,
75 NFC_EVENT_DEVICE_ADDED,
76 NFC_EVENT_DEVICE_REMOVED,
77 NFC_EVENT_TARGET_LOST,
78 NFC_EVENT_TM_ACTIVATED,
79 NFC_EVENT_TM_DEACTIVATED,
80/* private: internal use only */
81 __NFC_CMD_AFTER_LAST
82};
83#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
84
85/**
86 * enum nfc_attrs - supported nfc attributes
87 *
88 * @NFC_ATTR_UNSPEC: unspecified attribute
89 *
90 * @NFC_ATTR_DEVICE_INDEX: index of nfc device
91 * @NFC_ATTR_DEVICE_NAME: device name, max 8 chars
92 * @NFC_ATTR_PROTOCOLS: nfc protocols - bitwise or-ed combination from
93 * NFC_PROTO_*_MASK constants
94 * @NFC_ATTR_TARGET_INDEX: index of the nfc target
95 * @NFC_ATTR_TARGET_SENS_RES: NFC-A targets extra information such as NFCID
96 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
97 * target is not NFC-Forum compliant)
98 * @NFC_ATTR_TARGET_NFCID1: NFC-A targets identifier, max 10 bytes
99 * @NFC_ATTR_TARGET_SENSB_RES: NFC-B targets extra information, max 12 bytes
100 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes
101 * @NFC_ATTR_COMM_MODE: Passive or active mode
102 * @NFC_ATTR_RF_MODE: Initiator or target
103 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for
104 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for
105 */
106enum nfc_attrs {
107 NFC_ATTR_UNSPEC,
108 NFC_ATTR_DEVICE_INDEX,
109 NFC_ATTR_DEVICE_NAME,
110 NFC_ATTR_PROTOCOLS,
111 NFC_ATTR_TARGET_INDEX,
112 NFC_ATTR_TARGET_SENS_RES,
113 NFC_ATTR_TARGET_SEL_RES,
114 NFC_ATTR_TARGET_NFCID1,
115 NFC_ATTR_TARGET_SENSB_RES,
116 NFC_ATTR_TARGET_SENSF_RES,
117 NFC_ATTR_COMM_MODE,
118 NFC_ATTR_RF_MODE,
119 NFC_ATTR_DEVICE_POWERED,
120 NFC_ATTR_IM_PROTOCOLS,
121 NFC_ATTR_TM_PROTOCOLS,
122/* private: internal use only */
123 __NFC_ATTR_AFTER_LAST
124};
125#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
126
127#define NFC_DEVICE_NAME_MAXSIZE 8
128#define NFC_NFCID1_MAXSIZE 10
129#define NFC_SENSB_RES_MAXSIZE 12
130#define NFC_SENSF_RES_MAXSIZE 18
131#define NFC_GB_MAXSIZE 48
132
133/* NFC protocols */
134#define NFC_PROTO_JEWEL 1
135#define NFC_PROTO_MIFARE 2
136#define NFC_PROTO_FELICA 3
137#define NFC_PROTO_ISO14443 4
138#define NFC_PROTO_NFC_DEP 5
139#define NFC_PROTO_ISO14443_B 6
140
141#define NFC_PROTO_MAX 7
142
143/* NFC communication modes */
144#define NFC_COMM_ACTIVE 0
145#define NFC_COMM_PASSIVE 1
146
147/* NFC RF modes */
148#define NFC_RF_INITIATOR 0
149#define NFC_RF_TARGET 1
150#define NFC_RF_NONE 2
151
152/* NFC protocols masks used in bitsets */
153#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
154#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
155#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
156#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
157#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
158#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
159
160struct sockaddr_nfc {
161 sa_family_t sa_family;
162 __u32 dev_idx;
163 __u32 target_idx;
164 __u32 nfc_protocol;
165};
166
167#define NFC_LLCP_MAX_SERVICE_NAME 63
168struct sockaddr_nfc_llcp {
169 sa_family_t sa_family;
170 __u32 dev_idx;
171 __u32 target_idx;
172 __u32 nfc_protocol;
173 __u8 dsap; /* Destination SAP, if known */
174 __u8 ssap; /* Source SAP to be bound to */
175 char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
176 size_t service_name_len;
177};
178
179/* NFC socket protocols */
180#define NFC_SOCKPROTO_RAW 0
181#define NFC_SOCKPROTO_LLCP 1
182#define NFC_SOCKPROTO_MAX 2
183
184#define NFC_HEADER_SIZE 1
185
186/**
187 * Pseudo-header info for raw socket packets
188 * First byte is the adapter index
189 * Second byte contains flags
190 * - 0x01 - Direction (0=RX, 1=TX)
191 * - 0x02-0x80 - Reserved
192 **/
193#define NFC_LLCP_RAW_HEADER_SIZE 2
194#define NFC_LLCP_DIRECTION_RX 0x00
195#define NFC_LLCP_DIRECTION_TX 0x01
196
197#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 6d1fb63f5922..3e794c12e90a 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/nfs2.h b/include/linux/nfs2.h
deleted file mode 100644
index fde24b30cc9e..000000000000
--- a/include/linux/nfs2.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * NFS protocol definitions
3 *
4 * This file contains constants for Version 2 of the protocol.
5 */
6#ifndef _LINUX_NFS2_H
7#define _LINUX_NFS2_H
8
9#define NFS2_PORT 2049
10#define NFS2_MAXDATA 8192
11#define NFS2_MAXPATHLEN 1024
12#define NFS2_MAXNAMLEN 255
13#define NFS2_MAXGROUPS 16
14#define NFS2_FHSIZE 32
15#define NFS2_COOKIESIZE 4
16#define NFS2_FIFO_DEV (-1)
17#define NFS2MODE_FMT 0170000
18#define NFS2MODE_DIR 0040000
19#define NFS2MODE_CHR 0020000
20#define NFS2MODE_BLK 0060000
21#define NFS2MODE_REG 0100000
22#define NFS2MODE_LNK 0120000
23#define NFS2MODE_SOCK 0140000
24#define NFS2MODE_FIFO 0010000
25
26
27/* NFSv2 file types - beware, these are not the same in NFSv3 */
28enum nfs2_ftype {
29 NF2NON = 0,
30 NF2REG = 1,
31 NF2DIR = 2,
32 NF2BLK = 3,
33 NF2CHR = 4,
34 NF2LNK = 5,
35 NF2SOCK = 6,
36 NF2BAD = 7,
37 NF2FIFO = 8
38};
39
40struct nfs2_fh {
41 char data[NFS2_FHSIZE];
42};
43
44/*
45 * Procedure numbers for NFSv2
46 */
47#define NFS2_VERSION 2
48#define NFSPROC_NULL 0
49#define NFSPROC_GETATTR 1
50#define NFSPROC_SETATTR 2
51#define NFSPROC_ROOT 3
52#define NFSPROC_LOOKUP 4
53#define NFSPROC_READLINK 5
54#define NFSPROC_READ 6
55#define NFSPROC_WRITECACHE 7
56#define NFSPROC_WRITE 8
57#define NFSPROC_CREATE 9
58#define NFSPROC_REMOVE 10
59#define NFSPROC_RENAME 11
60#define NFSPROC_LINK 12
61#define NFSPROC_SYMLINK 13
62#define NFSPROC_MKDIR 14
63#define NFSPROC_RMDIR 15
64#define NFSPROC_READDIR 16
65#define NFSPROC_STATFS 17
66
67#endif /* _LINUX_NFS2_H */
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 6ccfe3b641e1..a778ad8e3afd 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 af2d2fa30eee..e111fa419a4e 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/nfs4_mount.h b/include/linux/nfs4_mount.h
deleted file mode 100644
index a0dcf6655657..000000000000
--- a/include/linux/nfs4_mount.h
+++ /dev/null
@@ -1,71 +0,0 @@
1#ifndef _LINUX_NFS4_MOUNT_H
2#define _LINUX_NFS4_MOUNT_H
3
4/*
5 * linux/include/linux/nfs4_mount.h
6 *
7 * Copyright (C) 2002 Trond Myklebust
8 *
9 * structure passed from user-space to kernel-space during an nfsv4 mount
10 */
11
12/*
13 * WARNING! Do not delete or change the order of these fields. If
14 * a new field is required then add it to the end. The version field
15 * tracks which fields are present. This will ensure some measure of
16 * mount-to-kernel version compatibility. Some of these aren't used yet
17 * but here they are anyway.
18 */
19#define NFS4_MOUNT_VERSION 1
20
21struct nfs_string {
22 unsigned int len;
23 const char __user * data;
24};
25
26struct nfs4_mount_data {
27 int version; /* 1 */
28 int flags; /* 1 */
29 int rsize; /* 1 */
30 int wsize; /* 1 */
31 int timeo; /* 1 */
32 int retrans; /* 1 */
33 int acregmin; /* 1 */
34 int acregmax; /* 1 */
35 int acdirmin; /* 1 */
36 int acdirmax; /* 1 */
37
38 /* see the definition of 'struct clientaddr4' in RFC3010 */
39 struct nfs_string client_addr; /* 1 */
40
41 /* Mount path */
42 struct nfs_string mnt_path; /* 1 */
43
44 /* Server details */
45 struct nfs_string hostname; /* 1 */
46 /* Server IP address */
47 unsigned int host_addrlen; /* 1 */
48 struct sockaddr __user * host_addr; /* 1 */
49
50 /* Transport protocol to use */
51 int proto; /* 1 */
52
53 /* Pseudo-flavours to use for authentication. See RFC2623 */
54 int auth_flavourlen; /* 1 */
55 int __user *auth_flavours; /* 1 */
56};
57
58/* bits in the flags field */
59/* Note: the fields that correspond to existing NFSv2/v3 mount options
60 * should mirror the values from include/linux/nfs_mount.h
61 */
62
63#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
64#define NFS4_MOUNT_INTR 0x0002 /* 1 */
65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
68#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
69#define NFS4_MOUNT_FLAGMASK 0x9033
70
71#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 334a2f5f6bf1..1cc25682b20b 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 ece91c57ad79..2dcef3ab58b6 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/nfs_mount.h b/include/linux/nfs_mount.h
deleted file mode 100644
index 576bddd72e04..000000000000
--- a/include/linux/nfs_mount.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef _LINUX_NFS_MOUNT_H
2#define _LINUX_NFS_MOUNT_H
3
4/*
5 * linux/include/linux/nfs_mount.h
6 *
7 * Copyright (C) 1992 Rick Sladkey
8 *
9 * structure passed from user-space to kernel-space during an nfs mount
10 */
11#include <linux/in.h>
12#include <linux/nfs.h>
13#include <linux/nfs2.h>
14#include <linux/nfs3.h>
15
16/*
17 * WARNING! Do not delete or change the order of these fields. If
18 * a new field is required then add it to the end. The version field
19 * tracks which fields are present. This will ensure some measure of
20 * mount-to-kernel version compatibility. Some of these aren't used yet
21 * but here they are anyway.
22 */
23#define NFS_MOUNT_VERSION 6
24#define NFS_MAX_CONTEXT_LEN 256
25
26struct nfs_mount_data {
27 int version; /* 1 */
28 int fd; /* 1 */
29 struct nfs2_fh old_root; /* 1 */
30 int flags; /* 1 */
31 int rsize; /* 1 */
32 int wsize; /* 1 */
33 int timeo; /* 1 */
34 int retrans; /* 1 */
35 int acregmin; /* 1 */
36 int acregmax; /* 1 */
37 int acdirmin; /* 1 */
38 int acdirmax; /* 1 */
39 struct sockaddr_in addr; /* 1 */
40 char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
41 int namlen; /* 2 */
42 unsigned int bsize; /* 3 */
43 struct nfs3_fh root; /* 4 */
44 int pseudoflavor; /* 5 */
45 char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
46};
47
48/* bits in the flags field visible to user space */
49
50#define NFS_MOUNT_SOFT 0x0001 /* 1 */
51#define NFS_MOUNT_INTR 0x0002 /* 1 */ /* now unused, but ABI */
52#define NFS_MOUNT_SECURE 0x0004 /* 1 */
53#define NFS_MOUNT_POSIX 0x0008 /* 1 */
54#define NFS_MOUNT_NOCTO 0x0010 /* 1 */
55#define NFS_MOUNT_NOAC 0x0020 /* 1 */
56#define NFS_MOUNT_TCP 0x0040 /* 2 */
57#define NFS_MOUNT_VER3 0x0080 /* 3 */
58#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
59#define NFS_MOUNT_NONLM 0x0200 /* 3 */
60#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
61#define NFS_MOUNT_NOACL 0x0800 /* 4 */
62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
66#define NFS_MOUNT_FLAGMASK 0xFFFF
67
68/* The following are for internal use only */
69#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000
70#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000
71#define NFS_MOUNT_NORESVPORT 0x40000
72#define NFS_MOUNT_LEGACY_INTERFACE 0x80000
73
74#define NFS_MOUNT_LOCAL_FLOCK 0x100000
75#define NFS_MOUNT_LOCAL_FCNTL 0x200000
76
77#endif
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index fabcb1e5c460..5e69e67b31ab 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/nl80211.h b/include/linux/nl80211.h
deleted file mode 100644
index 7df9b500c804..000000000000
--- a/include/linux/nl80211.h
+++ /dev/null
@@ -1,3072 +0,0 @@
1#ifndef __LINUX_NL80211_H
2#define __LINUX_NL80211_H
3/*
4 * 802.11 netlink interface public header
5 *
6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
9 * Copyright 2008 Michael Buesch <m@bues.ch>
10 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
12 * Copyright 2008 Colin McCabe <colin@cozybit.com>
13 *
14 * Permission to use, copy, modify, and/or distribute this software for any
15 * purpose with or without fee is hereby granted, provided that the above
16 * copyright notice and this permission notice appear in all copies.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 *
26 */
27
28#include <linux/types.h>
29
30/**
31 * DOC: Station handling
32 *
33 * Stations are added per interface, but a special case exists with VLAN
34 * interfaces. When a station is bound to an AP interface, it may be moved
35 * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
36 * The station is still assumed to belong to the AP interface it was added
37 * to.
38 *
39 * TODO: need more info?
40 */
41
42/**
43 * DOC: Frame transmission/registration support
44 *
45 * Frame transmission and registration support exists to allow userspace
46 * management entities such as wpa_supplicant react to management frames
47 * that are not being handled by the kernel. This includes, for example,
48 * certain classes of action frames that cannot be handled in the kernel
49 * for various reasons.
50 *
51 * Frame registration is done on a per-interface basis and registrations
52 * cannot be removed other than by closing the socket. It is possible to
53 * specify a registration filter to register, for example, only for a
54 * certain type of action frame. In particular with action frames, those
55 * that userspace registers for will not be returned as unhandled by the
56 * driver, so that the registered application has to take responsibility
57 * for doing that.
58 *
59 * The type of frame that can be registered for is also dependent on the
60 * driver and interface type. The frame types are advertised in wiphy
61 * attributes so applications know what to expect.
62 *
63 * NOTE: When an interface changes type while registrations are active,
64 * these registrations are ignored until the interface type is
65 * changed again. This means that changing the interface type can
66 * lead to a situation that couldn't otherwise be produced, but
67 * any such registrations will be dormant in the sense that they
68 * will not be serviced, i.e. they will not receive any frames.
69 *
70 * Frame transmission allows userspace to send for example the required
71 * responses to action frames. It is subject to some sanity checking,
72 * but many frames can be transmitted. When a frame was transmitted, its
73 * status is indicated to the sending socket.
74 *
75 * For more technical details, see the corresponding command descriptions
76 * below.
77 */
78
79/**
80 * DOC: Virtual interface / concurrency capabilities
81 *
82 * Some devices are able to operate with virtual MACs, they can have
83 * more than one virtual interface. The capability handling for this
84 * is a bit complex though, as there may be a number of restrictions
85 * on the types of concurrency that are supported.
86 *
87 * To start with, each device supports the interface types listed in
88 * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the
89 * types there no concurrency is implied.
90 *
91 * Once concurrency is desired, more attributes must be observed:
92 * To start with, since some interface types are purely managed in
93 * software, like the AP-VLAN type in mac80211 for example, there's
94 * an additional list of these, they can be added at any time and
95 * are only restricted by some semantic restrictions (e.g. AP-VLAN
96 * cannot be added without a corresponding AP interface). This list
97 * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
98 *
99 * Further, the list of supported combinations is exported. This is
100 * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically,
101 * it exports a list of "groups", and at any point in time the
102 * interfaces that are currently active must fall into any one of
103 * the advertised groups. Within each group, there are restrictions
104 * on the number of interfaces of different types that are supported
105 * and also the number of different channels, along with potentially
106 * some other restrictions. See &enum nl80211_if_combination_attrs.
107 *
108 * All together, these attributes define the concurrency of virtual
109 * interfaces that a given device supports.
110 */
111
112/**
113 * enum nl80211_commands - supported nl80211 commands
114 *
115 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
116 *
117 * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
118 * to get a list of all present wiphys.
119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
122 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
123 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
124 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
125 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
126 * instead, the support here is for backward compatibility only.
127 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
128 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
129 * %NL80211_ATTR_WIPHY_NAME.
130 * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
131 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
132 *
133 * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
134 * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
135 * on an %NL80211_ATTR_IFINDEX is supported.
136 * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
137 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
138 * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
139 * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
140 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
141 * be sent from userspace to request creation of a new virtual interface,
142 * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
143 * %NL80211_ATTR_IFNAME.
144 * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
145 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
146 * userspace to request deletion of a virtual interface, then requires
147 * attribute %NL80211_ATTR_IFINDEX.
148 *
149 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
150 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
151 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
152 * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
153 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
154 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
155 * and %NL80211_ATTR_KEY_SEQ attributes.
156 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
157 * or %NL80211_ATTR_MAC.
158 *
159 * @NL80211_CMD_GET_BEACON: (not used)
160 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
161 * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
162 * attributes. For drivers that generate the beacon and probe responses
163 * internally, the following attributes must be provided: %NL80211_ATTR_IE,
164 * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
165 * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
166 * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
167 * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
168 * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
169 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.
175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
178 *
179 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
180 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
181 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
182 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
183 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
184 * the interface identified by %NL80211_ATTR_IFINDEX.
185 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
186 * or, if no MAC address given, all stations, on the interface identified
187 * by %NL80211_ATTR_IFINDEX.
188 *
189 * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
190 * destination %NL80211_ATTR_MAC on the interface identified by
191 * %NL80211_ATTR_IFINDEX.
192 * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
193 * destination %NL80211_ATTR_MAC on the interface identified by
194 * %NL80211_ATTR_IFINDEX.
195 * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
196 * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
197 * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
198 * %NL80211_ATTR_MAC.
199 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
200 * the interface identified by %NL80211_ATTR_IFINDEX.
201 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
202 * or, if no MAC address given, all mesh paths, on the interface identified
203 * by %NL80211_ATTR_IFINDEX.
204 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
205 * %NL80211_ATTR_IFINDEX.
206 *
207 * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
208 * regulatory domain.
209 * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
210 * after being queried by the kernel. CRDA replies by sending a regulatory
211 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
212 * current alpha2 if it found a match. It also provides
213 * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
214 * regulatory rule is a nested set of attributes given by
215 * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
216 * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
217 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
218 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
219 * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
220 * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
221 * store this as a valid request and then query userspace for it.
222 *
223 * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
224 * interface identified by %NL80211_ATTR_IFINDEX
225 *
226 * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
227 * interface identified by %NL80211_ATTR_IFINDEX
228 *
229 * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
230 * interface is identified with %NL80211_ATTR_IFINDEX and the management
231 * frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
232 * added to the end of the specified management frame is specified with
233 * %NL80211_ATTR_IE. If the command succeeds, the requested data will be
234 * added to all specified management frames generated by
235 * kernel/firmware/driver.
236 * Note: This command has been removed and it is only reserved at this
237 * point to avoid re-using existing command number. The functionality this
238 * command was planned for has been provided with cleaner design with the
239 * option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
240 * NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
241 * NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
242 *
243 * @NL80211_CMD_GET_SCAN: get scan results
244 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
245 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
246 * probe requests at CCK rate or not.
247 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
248 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
249 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
250 * partial scan results may be available
251 *
252 * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
253 * intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
254 * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
255 * are passed, they are used in the probe requests. For
256 * broadcast, a broadcast SSID must be passed (ie. an empty
257 * string). If no SSID is passed, no probe requests are sent and
258 * a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES,
259 * if passed, define which channels should be scanned; if not
260 * passed, all channels allowed for the current regulatory domain
261 * are used. Extra IEs can also be passed from the userspace by
262 * using the %NL80211_ATTR_IE attribute.
263 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT
264 * if scheduled scan is not running.
265 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
266 * results available.
267 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
268 * stopped. The driver may issue this event at any time during a
269 * scheduled scan. One reason for stopping the scan is if the hardware
270 * does not support starting an association or a normal scan while running
271 * a scheduled scan. This event is also sent when the
272 * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
273 * is brought down while a scheduled scan was running.
274 *
275 * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
276 * or noise level
277 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
278 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
279 *
280 * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
281 * (for the BSSID) and %NL80211_ATTR_PMKID.
282 * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
283 * (for the BSSID) and %NL80211_ATTR_PMKID.
284 * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
285 *
286 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
287 * has been changed and provides details of the request information
288 * that caused the change such as who initiated the regulatory request
289 * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
290 * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
291 * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
292 * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
293 * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
294 * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
295 * to (%NL80211_ATTR_REG_ALPHA2).
296 * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
297 * has been found while world roaming thus enabling active scan or
298 * any mode of operation that initiates TX (beacons) on a channel
299 * where we would not have been able to do either before. As an example
300 * if you are world roaming (regulatory domain set to world or if your
301 * driver is using a custom world roaming regulatory domain) and while
302 * doing a passive scan on the 5 GHz band you find an AP there (if not
303 * on a DFS channel) you will now be able to actively scan for that AP
304 * or use AP mode on your card on that same channel. Note that this will
305 * never be used for channels 1-11 on the 2 GHz band as they are always
306 * enabled world wide. This beacon hint is only sent if your device had
307 * either disabled active scanning or beaconing on a channel. We send to
308 * userspace the wiphy on which we removed a restriction from
309 * (%NL80211_ATTR_WIPHY) and the channel on which this occurred
310 * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
311 * the beacon hint was processed.
312 *
313 * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
314 * This command is used both as a command (request to authenticate) and
315 * as an event on the "mlme" multicast group indicating completion of the
316 * authentication process.
317 * When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
318 * interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
319 * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
320 * the SSID (mainly for association, but is included in authentication
321 * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used
322 * to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE
323 * is used to specify the authentication type. %NL80211_ATTR_IE is used to
324 * define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)
325 * to be added to the frame.
326 * When used as an event, this reports reception of an Authentication
327 * frame in station and IBSS modes when the local MLME processed the
328 * frame, i.e., it was for the local STA and was received in correct
329 * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
330 * MLME SAP interface (kernel providing MLME, userspace SME). The
331 * included %NL80211_ATTR_FRAME attribute contains the management frame
332 * (including both the header and frame body, but not FCS). This event is
333 * also used to indicate if the authentication attempt timed out. In that
334 * case the %NL80211_ATTR_FRAME attribute is replaced with a
335 * %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which
336 * pending authentication timed out).
337 * @NL80211_CMD_ASSOCIATE: association request and notification; like
338 * NL80211_CMD_AUTHENTICATE but for Association and Reassociation
339 * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
340 * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
341 * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
342 * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
343 * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
344 * primitives).
345 * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
346 * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
347 * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
348 *
349 * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael
350 * MIC (part of TKIP) failure; sent on the "mlme" multicast group; the
351 * event includes %NL80211_ATTR_MAC to describe the source MAC address of
352 * the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key
353 * type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and
354 * %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this
355 * event matches with MLME-MICHAELMICFAILURE.indication() primitive
356 *
357 * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a
358 * FREQ attribute (for the initial frequency if no peer can be found)
359 * and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those
360 * should be fixed rather than automatically determined. Can only be
361 * executed on a network interface that is UP, and fixed BSSID/FREQ
362 * may be rejected. Another optional parameter is the beacon interval,
363 * given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not
364 * given defaults to 100 TU (102.4ms).
365 * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
366 * determined by the network interface.
367 *
368 * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
369 * to identify the device, and the TESTDATA blob attribute to pass through
370 * to the driver.
371 *
372 * @NL80211_CMD_CONNECT: connection request and notification; this command
373 * requests to connect to a specified network but without separating
374 * auth and assoc steps. For this, you need to specify the SSID in a
375 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
376 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
377 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
378 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
379 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
380 * Background scan period can optionally be
381 * specified in %NL80211_ATTR_BG_SCAN_PERIOD,
382 * if not specified default background scan configuration
383 * in driver is used and if period value is 0, bg scan will be disabled.
384 * This attribute is ignored if driver does not support roam scan.
385 * It is also sent as an event, with the BSSID and response IEs when the
386 * connection is established or failed to be established. This can be
387 * determined by the STATUS_CODE attribute.
388 * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
389 * sent as an event when the card/driver roamed by itself.
390 * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
391 * userspace that a connection was dropped by the AP or due to other
392 * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
393 * %NL80211_ATTR_REASON_CODE attributes are used.
394 *
395 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
396 * associated with this wiphy must be down and will follow.
397 *
398 * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
399 * channel for the specified amount of time. This can be used to do
400 * off-channel operations like transmit a Public Action frame and wait for
401 * a response while being associated to an AP on another channel.
402 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
403 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
404 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
405 * optionally used to specify additional channel parameters.
406 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
407 * to remain on the channel. This command is also used as an event to
408 * notify when the requested duration starts (it may take a while for the
409 * driver to schedule this time due to other concurrent needs for the
410 * radio).
411 * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
412 * that will be included with any events pertaining to this request;
413 * the cookie is also used to cancel the request.
414 * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
415 * pending remain-on-channel duration if the desired operation has been
416 * completed prior to expiration of the originally requested duration.
417 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
418 * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
419 * uniquely identify the request.
420 * This command is also used as an event to notify when a requested
421 * remain-on-channel duration has expired.
422 *
423 * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
424 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
425 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
426 *
427 * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
428 * (via @NL80211_CMD_FRAME) for processing in userspace. This command
429 * requires an interface index, a frame type attribute (optional for
430 * backward compatibility reasons, if not given assumes action frames)
431 * and a match attribute containing the first few bytes of the frame
432 * that should match, e.g. a single byte for only a category match or
433 * four bytes for vendor frames including the OUI. The registration
434 * cannot be dropped, but is removed automatically when the netlink
435 * socket is closed. Multiple registrations can be made.
436 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
437 * backward compatibility
438 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
439 * command is used both as a request to transmit a management frame and
440 * as an event indicating reception of a frame that was not processed in
441 * kernel code, but is for us (i.e., which may need to be processed in a
442 * user space application). %NL80211_ATTR_FRAME is used to specify the
443 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
444 * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
445 * which channel the frame is to be transmitted or was received. If this
446 * channel is not the current channel (remain-on-channel or the
447 * operational channel) the device will switch to the given channel and
448 * transmit the frame, optionally waiting for a response for the time
449 * specified using %NL80211_ATTR_DURATION. When called, this operation
450 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
451 * TX status event pertaining to the TX request.
452 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
453 * management frames at CCK rate or not in 2GHz band.
454 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
455 * command may be used with the corresponding cookie to cancel the wait
456 * time if it is known that it is no longer necessary.
457 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
458 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
459 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
460 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
461 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
462 * the frame.
463 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
464 * backward compatibility.
465 *
466 * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
467 * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
468 *
469 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
470 * is used to configure connection quality monitoring notification trigger
471 * levels.
472 * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
473 * command is used as an event to indicate the that a trigger level was
474 * reached.
475 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
476 * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
477 * by %NL80211_ATTR_IFINDEX) shall operate on.
478 * In case multiple channels are supported by the device, the mechanism
479 * with which it switches channels is implementation-defined.
480 * When a monitor interface is given, it can only switch channel while
481 * no other interfaces are operating to avoid disturbing the operation
482 * of any other interfaces, and other interfaces will again take
483 * precedence when they are used.
484 *
485 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
486 *
487 * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
488 * mesh config parameters may be given.
489 * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
490 * network is determined by the network interface.
491 *
492 * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
493 * notification. This event is used to indicate that an unprotected
494 * deauthentication frame was dropped when MFP is in use.
495 * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
496 * notification. This event is used to indicate that an unprotected
497 * disassociation frame was dropped when MFP is in use.
498 *
499 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
500 * beacon or probe response from a compatible mesh peer. This is only
501 * sent while no station information (sta_info) exists for the new peer
502 * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set. On
503 * reception of this notification, userspace may decide to create a new
504 * station (@NL80211_CMD_NEW_STATION). To stop this notification from
505 * reoccurring, the userspace authentication daemon may want to create the
506 * new station with the AUTHENTICATED flag unset and maybe change it later
507 * depending on the authentication result.
508 *
509 * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
510 * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
511 * Since wireless is more complex than wired ethernet, it supports
512 * various triggers. These triggers can be configured through this
513 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
514 * more background information, see
515 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
516 *
517 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
518 * the necessary information for supporting GTK rekey offload. This
519 * feature is typically used during WoWLAN. The configuration data
520 * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
521 * contains the data in sub-attributes). After rekeying happened,
522 * this command may also be sent by the driver as an MLME event to
523 * inform userspace of the new replay counter.
524 *
525 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
526 * of PMKSA caching dandidates.
527 *
528 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
529 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
530 *
531 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
532 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to
533 * implement sending deauth to stations that send unexpected class 3
534 * frames. Also used as the event sent by the kernel when such a frame
535 * is received.
536 * For the event, the %NL80211_ATTR_MAC attribute carries the TA and
537 * other attributes like the interface index are present.
538 * If used as the command it must have an interface index and you can
539 * only unsubscribe from the event by closing the socket. Subscription
540 * is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events.
541 *
542 * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the
543 * associated station identified by %NL80211_ATTR_MAC sent a 4addr frame
544 * and wasn't already in a 4-addr VLAN. The event will be sent similarly
545 * to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener.
546 *
547 * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
548 * by sending a null data frame to it and reporting when the frame is
549 * acknowleged. This is used to allow timing out inactive clients. Uses
550 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
551 * direct reply with an %NL80211_ATTR_COOKIE that is later used to match
552 * up the event with the request. The event includes the same data and
553 * has %NL80211_ATTR_ACK set if the frame was ACKed.
554 *
555 * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from
556 * other BSSes when any interfaces are in AP mode. This helps implement
557 * OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME
558 * messages. Note that per PHY only one application may register.
559 *
560 * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
561 * No Acknowledgement Policy should be applied.
562 *
563 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
564 * independently of the userspace SME, send this event indicating
565 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with
566 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
567 *
568 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
569 * its %NL80211_ATTR_WDEV identifier. It must have been created with
570 * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
571 * P2P Device can be used for P2P operations, e.g. remain-on-channel and
572 * public action frame TX.
573 * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
574 * its %NL80211_ATTR_WDEV identifier.
575 *
576 * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
577 * notify userspace that AP has rejected the connection request from a
578 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
579 * is used for this.
580 *
581 * @NL80211_CMD_MAX: highest used command number
582 * @__NL80211_CMD_AFTER_LAST: internal use
583 */
584enum nl80211_commands {
585/* don't change the order or add anything between, this is ABI! */
586 NL80211_CMD_UNSPEC,
587
588 NL80211_CMD_GET_WIPHY, /* can dump */
589 NL80211_CMD_SET_WIPHY,
590 NL80211_CMD_NEW_WIPHY,
591 NL80211_CMD_DEL_WIPHY,
592
593 NL80211_CMD_GET_INTERFACE, /* can dump */
594 NL80211_CMD_SET_INTERFACE,
595 NL80211_CMD_NEW_INTERFACE,
596 NL80211_CMD_DEL_INTERFACE,
597
598 NL80211_CMD_GET_KEY,
599 NL80211_CMD_SET_KEY,
600 NL80211_CMD_NEW_KEY,
601 NL80211_CMD_DEL_KEY,
602
603 NL80211_CMD_GET_BEACON,
604 NL80211_CMD_SET_BEACON,
605 NL80211_CMD_START_AP,
606 NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
607 NL80211_CMD_STOP_AP,
608 NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
609
610 NL80211_CMD_GET_STATION,
611 NL80211_CMD_SET_STATION,
612 NL80211_CMD_NEW_STATION,
613 NL80211_CMD_DEL_STATION,
614
615 NL80211_CMD_GET_MPATH,
616 NL80211_CMD_SET_MPATH,
617 NL80211_CMD_NEW_MPATH,
618 NL80211_CMD_DEL_MPATH,
619
620 NL80211_CMD_SET_BSS,
621
622 NL80211_CMD_SET_REG,
623 NL80211_CMD_REQ_SET_REG,
624
625 NL80211_CMD_GET_MESH_CONFIG,
626 NL80211_CMD_SET_MESH_CONFIG,
627
628 NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
629
630 NL80211_CMD_GET_REG,
631
632 NL80211_CMD_GET_SCAN,
633 NL80211_CMD_TRIGGER_SCAN,
634 NL80211_CMD_NEW_SCAN_RESULTS,
635 NL80211_CMD_SCAN_ABORTED,
636
637 NL80211_CMD_REG_CHANGE,
638
639 NL80211_CMD_AUTHENTICATE,
640 NL80211_CMD_ASSOCIATE,
641 NL80211_CMD_DEAUTHENTICATE,
642 NL80211_CMD_DISASSOCIATE,
643
644 NL80211_CMD_MICHAEL_MIC_FAILURE,
645
646 NL80211_CMD_REG_BEACON_HINT,
647
648 NL80211_CMD_JOIN_IBSS,
649 NL80211_CMD_LEAVE_IBSS,
650
651 NL80211_CMD_TESTMODE,
652
653 NL80211_CMD_CONNECT,
654 NL80211_CMD_ROAM,
655 NL80211_CMD_DISCONNECT,
656
657 NL80211_CMD_SET_WIPHY_NETNS,
658
659 NL80211_CMD_GET_SURVEY,
660 NL80211_CMD_NEW_SURVEY_RESULTS,
661
662 NL80211_CMD_SET_PMKSA,
663 NL80211_CMD_DEL_PMKSA,
664 NL80211_CMD_FLUSH_PMKSA,
665
666 NL80211_CMD_REMAIN_ON_CHANNEL,
667 NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
668
669 NL80211_CMD_SET_TX_BITRATE_MASK,
670
671 NL80211_CMD_REGISTER_FRAME,
672 NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
673 NL80211_CMD_FRAME,
674 NL80211_CMD_ACTION = NL80211_CMD_FRAME,
675 NL80211_CMD_FRAME_TX_STATUS,
676 NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
677
678 NL80211_CMD_SET_POWER_SAVE,
679 NL80211_CMD_GET_POWER_SAVE,
680
681 NL80211_CMD_SET_CQM,
682 NL80211_CMD_NOTIFY_CQM,
683
684 NL80211_CMD_SET_CHANNEL,
685 NL80211_CMD_SET_WDS_PEER,
686
687 NL80211_CMD_FRAME_WAIT_CANCEL,
688
689 NL80211_CMD_JOIN_MESH,
690 NL80211_CMD_LEAVE_MESH,
691
692 NL80211_CMD_UNPROT_DEAUTHENTICATE,
693 NL80211_CMD_UNPROT_DISASSOCIATE,
694
695 NL80211_CMD_NEW_PEER_CANDIDATE,
696
697 NL80211_CMD_GET_WOWLAN,
698 NL80211_CMD_SET_WOWLAN,
699
700 NL80211_CMD_START_SCHED_SCAN,
701 NL80211_CMD_STOP_SCHED_SCAN,
702 NL80211_CMD_SCHED_SCAN_RESULTS,
703 NL80211_CMD_SCHED_SCAN_STOPPED,
704
705 NL80211_CMD_SET_REKEY_OFFLOAD,
706
707 NL80211_CMD_PMKSA_CANDIDATE,
708
709 NL80211_CMD_TDLS_OPER,
710 NL80211_CMD_TDLS_MGMT,
711
712 NL80211_CMD_UNEXPECTED_FRAME,
713
714 NL80211_CMD_PROBE_CLIENT,
715
716 NL80211_CMD_REGISTER_BEACONS,
717
718 NL80211_CMD_UNEXPECTED_4ADDR_FRAME,
719
720 NL80211_CMD_SET_NOACK_MAP,
721
722 NL80211_CMD_CH_SWITCH_NOTIFY,
723
724 NL80211_CMD_START_P2P_DEVICE,
725 NL80211_CMD_STOP_P2P_DEVICE,
726
727 NL80211_CMD_CONN_FAILED,
728
729 /* add new commands above here */
730
731 /* used to define NL80211_CMD_MAX below */
732 __NL80211_CMD_AFTER_LAST,
733 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
734};
735
736/*
737 * Allow user space programs to use #ifdef on new commands by defining them
738 * here
739 */
740#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
741#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
742#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
743#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
744#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
745#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
746#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
747#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
748
749#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
750
751/* source-level API compatibility */
752#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
753#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
754#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE
755
756/**
757 * enum nl80211_attrs - nl80211 netlink attributes
758 *
759 * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
760 *
761 * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
762 * /sys/class/ieee80211/<phyname>/index
763 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
764 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
765 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
766 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
767 * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
768 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
769 * this attribute)
770 * NL80211_CHAN_HT20 = HT20 only
771 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
772 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
773 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
774 * less than or equal to the RTS threshold; allowed range: 1..255;
775 * dot11ShortRetryLimit; u8
776 * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
777 * greater than the RTS threshold; allowed range: 1..255;
778 * dot11ShortLongLimit; u8
779 * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
780 * length in octets for frames; allowed range: 256..8000, disable
781 * fragmentation with (u32)-1; dot11FragmentationThreshold; u32
782 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
783 * larger than or equal to this use RTS/CTS handshake); allowed range:
784 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
785 * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
786 * section 7.3.2.9; dot11CoverageClass; u8
787 *
788 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
789 * @NL80211_ATTR_IFNAME: network interface name
790 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
791 *
792 * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
793 * that don't have a netdev (u64)
794 *
795 * @NL80211_ATTR_MAC: MAC address (various uses)
796 *
797 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
798 * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
799 * keys
800 * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
801 * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
802 * section 7.3.2.25.1, e.g. 0x000FAC04)
803 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
804 * CCMP keys, each six bytes in little endian
805 * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
806 * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
807 * default management key
808 * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
809 * other commands, indicates which pairwise cipher suites are used
810 * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
811 * other commands, indicates which group cipher suite is used
812 *
813 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
814 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
815 * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
816 * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
817 *
818 * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
819 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
820 * &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
821 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
822 * IEEE 802.11 7.3.1.6 (u16).
823 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
824 * rates as defined by IEEE 802.11 7.3.2.2 but without the length
825 * restriction (at most %NL80211_MAX_SUPP_RATES).
826 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
827 * to, or the AP interface the station was originally added to to.
828 * @NL80211_ATTR_STA_INFO: information about a station, part of station info
829 * given for %NL80211_CMD_GET_STATION, nested attribute containing
830 * info as possible, see &enum nl80211_sta_info.
831 *
832 * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
833 * consisting of a nested array.
834 *
835 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
836 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link.
837 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
838 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
839 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
840 * &enum nl80211_mpath_info.
841 *
842 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
843 * &enum nl80211_mntr_flags.
844 *
845 * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
846 * current regulatory domain should be set to or is already set to.
847 * For example, 'CR', for Costa Rica. This attribute is used by the kernel
848 * to query the CRDA to retrieve one regulatory domain. This attribute can
849 * also be used by userspace to query the kernel for the currently set
850 * regulatory domain. We chose an alpha2 as that is also used by the
851 * IEEE-802.11d country information element to identify a country.
852 * Users can also simply ask the wireless core to set regulatory domain
853 * to a specific alpha2.
854 * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
855 * rules.
856 *
857 * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
858 * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
859 * (u8, 0 or 1)
860 * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
861 * (u8, 0 or 1)
862 * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
863 * rates in format defined by IEEE 802.11 7.3.2.2 but without the length
864 * restriction (at most %NL80211_MAX_SUPP_RATES).
865 *
866 * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
867 * association request when used with NL80211_CMD_NEW_STATION)
868 *
869 * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
870 * supported interface types, each a flag attribute with the number
871 * of the interface mode.
872 *
873 * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
874 * %NL80211_CMD_SET_MGMT_EXTRA_IE.
875 *
876 * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
877 * %NL80211_CMD_SET_MGMT_EXTRA_IE).
878 *
879 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
880 * a single scan request, a wiphy attribute.
881 * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
882 * scan with a single scheduled scan request, a wiphy attribute.
883 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
884 * that can be added to a scan request
885 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
886 * elements that can be added to a scheduled scan request
887 * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
888 * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
889 *
890 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
891 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
892 * scanning and include a zero-length SSID (wildcard) for wildcard scan
893 * @NL80211_ATTR_BSS: scan result BSS
894 *
895 * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
896 * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
897 * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
898 * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
899 *
900 * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
901 * an array of command numbers (i.e. a mapping index to command number)
902 * that the driver for the given wiphy supports.
903 *
904 * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
905 * and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
906 * NL80211_CMD_ASSOCIATE events
907 * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
908 * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
909 * represented as a u32
910 * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
911 * %NL80211_CMD_DISASSOCIATE, u16
912 *
913 * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as
914 * a u32
915 *
916 * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
917 * due to considerations from a beacon hint. This attribute reflects
918 * the state of the channel _before_ the beacon hint processing. This
919 * attributes consists of a nested attribute containing
920 * NL80211_FREQUENCY_ATTR_*
921 * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
922 * due to considerations from a beacon hint. This attribute reflects
923 * the state of the channel _after_ the beacon hint processing. This
924 * attributes consists of a nested attribute containing
925 * NL80211_FREQUENCY_ATTR_*
926 *
927 * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
928 * cipher suites
929 *
930 * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look
931 * for other networks on different channels
932 *
933 * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this
934 * is used, e.g., with %NL80211_CMD_AUTHENTICATE event
935 *
936 * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
937 * used for the association (&enum nl80211_mfp, represented as a u32);
938 * this attribute can be used
939 * with %NL80211_CMD_ASSOCIATE request
940 *
941 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
942 * &struct nl80211_sta_flag_update.
943 *
944 * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls
945 * IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in
946 * station mode. If the flag is included in %NL80211_CMD_ASSOCIATE
947 * request, the driver will assume that the port is unauthorized until
948 * authorized by user space. Otherwise, port is marked authorized by
949 * default in station mode.
950 * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
951 * ethertype that will be used for key negotiation. It can be
952 * specified with the associate and connect commands. If it is not
953 * specified, the value defaults to 0x888E (PAE, 802.1X). This
954 * attribute is also used as a flag in the wiphy information to
955 * indicate that protocols other than PAE are supported.
956 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
957 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
958 * ethertype frames used for key negotiation must not be encrypted.
959 *
960 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
961 * We recommend using nested, driver-specific attributes within this.
962 *
963 * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
964 * event was due to the AP disconnecting the station, and not due to
965 * a local disconnect request.
966 * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
967 * event (u16)
968 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
969 * that protected APs should be used. This is also used with NEW_BEACON to
970 * indicate that the BSS is to use protection.
971 *
972 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
973 * to indicate which unicast key ciphers will be used with the connection
974 * (an array of u32).
975 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
976 * indicate which group key cipher will be used with the connection (a
977 * u32).
978 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
979 * indicate which WPA version(s) the AP we want to associate with is using
980 * (a u32 with flags from &enum nl80211_wpa_versions).
981 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
982 * indicate which key management algorithm(s) to use (an array of u32).
983 *
984 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
985 * sent out by the card, for ROAM and successful CONNECT events.
986 * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
987 * sent by peer, for ROAM and successful CONNECT events.
988 *
989 * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
990 * commands to specify using a reassociate frame
991 *
992 * @NL80211_ATTR_KEY: key information in a nested attribute with
993 * %NL80211_KEY_* sub-attributes
994 * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
995 * and join_ibss(), key information is in a nested attribute each
996 * with %NL80211_KEY_* sub-attributes
997 *
998 * @NL80211_ATTR_PID: Process ID of a network namespace.
999 *
1000 * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
1001 * dumps. This number increases whenever the object list being
1002 * dumped changes, and as such userspace can verify that it has
1003 * obtained a complete and consistent snapshot by verifying that
1004 * all dump messages contain the same generation number. If it
1005 * changed then the list changed and the dump should be repeated
1006 * completely from scratch.
1007 *
1008 * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
1009 *
1010 * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
1011 * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
1012 * containing info as possible, see &enum survey_info.
1013 *
1014 * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
1015 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
1016 * cache, a wiphy attribute.
1017 *
1018 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
1019 * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
1020 * specifies the maximum duration that can be requested with the
1021 * remain-on-channel operation, in milliseconds, u32.
1022 *
1023 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
1024 *
1025 * @NL80211_ATTR_TX_RATES: Nested set of attributes
1026 * (enum nl80211_tx_rate_attributes) describing TX rates per band. The
1027 * enum nl80211_band value is used as the index (nla_type() of the nested
1028 * data. If a band is not included, it will be configured to allow all
1029 * rates based on negotiated supported rates information. This attribute
1030 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
1031 *
1032 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
1033 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
1034 * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
1035 * @NL80211_CMD_REGISTER_FRAME command.
1036 * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
1037 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
1038 * information about which frame types can be transmitted with
1039 * %NL80211_CMD_FRAME.
1040 * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
1041 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
1042 * information about which frame types can be registered for RX.
1043 *
1044 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
1045 * acknowledged by the recipient.
1046 *
1047 * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
1048 *
1049 * @NL80211_ATTR_CQM: connection quality monitor configuration in a
1050 * nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
1051 *
1052 * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
1053 * is requesting a local authentication/association state change without
1054 * invoking actual management frame exchange. This can be used with
1055 * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
1056 * NL80211_CMD_DISASSOCIATE.
1057 *
1058 * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
1059 * connected to this BSS.
1060 *
1061 * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
1062 * &enum nl80211_tx_power_setting for possible values.
1063 * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
1064 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
1065 * for non-automatic settings.
1066 *
1067 * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
1068 * means support for per-station GTKs.
1069 *
1070 * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
1071 * This can be used to mask out antennas which are not attached or should
1072 * not be used for transmitting. If an antenna is not selected in this
1073 * bitmap the hardware is not allowed to transmit on this antenna.
1074 *
1075 * Each bit represents one antenna, starting with antenna 1 at the first
1076 * bit. Depending on which antennas are selected in the bitmap, 802.11n
1077 * drivers can derive which chainmasks to use (if all antennas belonging to
1078 * a particular chain are disabled this chain should be disabled) and if
1079 * a chain has diversity antennas wether diversity should be used or not.
1080 * HT capabilities (STBC, TX Beamforming, Antenna selection) can be
1081 * derived from the available chains after applying the antenna mask.
1082 * Non-802.11n drivers can derive wether to use diversity or not.
1083 * Drivers may reject configurations or RX/TX mask combinations they cannot
1084 * support by returning -EINVAL.
1085 *
1086 * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
1087 * This can be used to mask out antennas which are not attached or should
1088 * not be used for receiving. If an antenna is not selected in this bitmap
1089 * the hardware should not be configured to receive on this antenna.
1090 * For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX.
1091 *
1092 * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
1093 * for configuration as TX antennas via the above parameters.
1094 *
1095 * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
1096 * for configuration as RX antennas via the above parameters.
1097 *
1098 * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
1099 *
1100 * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
1101 * transmitted on another channel when the channel given doesn't match
1102 * the current channel. If the current channel doesn't match and this
1103 * flag isn't set, the frame will be rejected. This is also used as an
1104 * nl80211 capability flag.
1105 *
1106 * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
1107 *
1108 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
1109 * attributes, specifying what a key should be set as default as.
1110 * See &enum nl80211_key_default_types.
1111 *
1112 * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be
1113 * changed once the mesh is active.
1114 * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
1115 * containing attributes from &enum nl80211_meshconf_params.
1116 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
1117 * allows auth frames in a mesh to be passed to userspace for processing via
1118 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
1119 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as
1120 * defined in &enum nl80211_plink_state. Used when userspace is
1121 * driving the peer link management state machine.
1122 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled.
1123 *
1124 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
1125 * capabilities, the supported WoWLAN triggers
1126 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
1127 * indicate which WoW triggers should be enabled. This is also
1128 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
1129 * triggers.
1130 *
1131 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
1132 * cycles, in msecs.
1133 *
1134 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
1135 * sets of attributes to match during scheduled scans. Only BSSs
1136 * that match any of the sets will be reported. These are
1137 * pass-thru filter rules.
1138 * For a match to succeed, the BSS must match all attributes of a
1139 * set. Since not every hardware supports matching all types of
1140 * attributes, there is no guarantee that the reported BSSs are
1141 * fully complying with the match sets and userspace needs to be
1142 * able to ignore them by itself.
1143 * Thus, the implementation is somewhat hardware-dependent, but
1144 * this is only an optimization and the userspace application
1145 * needs to handle all the non-filtered results anyway.
1146 * If the match attributes don't make sense when combined with
1147 * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
1148 * is included in the probe request, but the match attributes
1149 * will never let it go through), -EINVAL may be returned.
1150 * If ommited, no filtering is done.
1151 *
1152 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
1153 * interface combinations. In each nested item, it contains attributes
1154 * defined in &enum nl80211_if_combination_attrs.
1155 * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
1156 * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
1157 * are managed in software: interfaces of these types aren't subject to
1158 * any restrictions in their number or combinations.
1159 *
1160 * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1161 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1162 *
1163 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
1164 * nested array attribute containing an entry for each band, with the entry
1165 * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
1166 * without the length restriction (at most %NL80211_MAX_SUPP_RATES).
1167 *
1168 * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
1169 * and Probe Response (when response to wildcard Probe Request); see
1170 * &enum nl80211_hidden_ssid, represented as a u32
1171 *
1172 * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
1173 * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
1174 * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
1175 * driver (or firmware) replies to Probe Request frames.
1176 * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
1177 * Response frames. This is used with %NL80211_CMD_NEW_BEACON and
1178 * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
1179 * (Re)Association Response frames when the driver (or firmware) replies to
1180 * (Re)Association Request frames.
1181 *
1182 * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
1183 * of the station, see &enum nl80211_sta_wme_attr.
1184 * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
1185 * as AP.
1186 *
1187 * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
1188 * roaming to another AP in the same ESS if the signal lever is low.
1189 *
1190 * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
1191 * candidate information, see &enum nl80211_pmksa_candidate_attr.
1192 *
1193 * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
1194 * for management frames transmission. In order to avoid p2p probe/action
1195 * frames are being transmitted at CCK rate in 2GHz band, the user space
1196 * applications use this attribute.
1197 * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
1198 * %NL80211_CMD_FRAME commands.
1199 *
1200 * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
1201 * request, link setup confirm, link teardown, etc.). Values are
1202 * described in the TDLS (802.11z) specification.
1203 * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
1204 * TDLS conversation between two devices.
1205 * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
1206 * &enum nl80211_tdls_operation, represented as a u8.
1207 * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
1208 * as a TDLS peer sta.
1209 * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
1210 * procedures should be performed by sending TDLS packets via
1211 * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
1212 * used for asking the driver to perform a TDLS operation.
1213 *
1214 * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices
1215 * that have AP support to indicate that they have the AP SME integrated
1216 * with support for the features listed in this attribute, see
1217 * &enum nl80211_ap_sme_features.
1218 *
1219 * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
1220 * the driver to not wait for an acknowledgement. Note that due to this,
1221 * it will also not give a status callback nor return a cookie. This is
1222 * mostly useful for probe responses to save airtime.
1223 *
1224 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
1225 * &enum nl80211_feature_flags and is advertised in wiphy information.
1226 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
1227 * requests while operating in AP-mode.
1228 * This attribute holds a bitmap of the supported protocols for
1229 * offloading (see &enum nl80211_probe_resp_offload_support_attr).
1230 *
1231 * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
1232 * probe-response frame. The DA field in the 802.11 header is zero-ed out,
1233 * to be filled by the FW.
1234 * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
1235 * this feature. Currently, only supported in mac80211 drivers.
1236 * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
1237 * ATTR_HT_CAPABILITY to which attention should be paid.
1238 * Currently, only mac80211 NICs support this feature.
1239 * The values that may be configured are:
1240 * MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40
1241 * AMPDU density and AMPDU factor.
1242 * All values are treated as suggestions and may be ignored
1243 * by the driver as required. The actual values may be seen in
1244 * the station debugfs ht_caps file.
1245 *
1246 * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
1247 * abides to when initiating radiation on DFS channels. A country maps
1248 * to one DFS region.
1249 *
1250 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
1251 * up to 16 TIDs.
1252 *
1253 * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
1254 * used by the drivers which has MLME in firmware and does not have support
1255 * to report per station tx/rx activity to free up the staion entry from
1256 * the list. This needs to be used when the driver advertises the
1257 * capability to timeout the stations.
1258 *
1259 * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
1260 * this attribute is (depending on the driver capabilities) added to
1261 * received frames indicated with %NL80211_CMD_FRAME.
1262 *
1263 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1264 * or 0 to disable background scan.
1265 *
1266 * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
1267 * userspace. If unset it is assumed the hint comes directly from
1268 * a user. If set code could specify exactly what type of source
1269 * was used to provide the hint. For the different types of
1270 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1271 *
1272 * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
1273 * the connection request from a station. nl80211_connect_failed_reason
1274 * enum has different reasons of connection failure.
1275 *
1276 * @NL80211_ATTR_MAX: highest attribute number currently defined
1277 * @__NL80211_ATTR_AFTER_LAST: internal use
1278 */
1279enum nl80211_attrs {
1280/* don't change the order or add anything between, this is ABI! */
1281 NL80211_ATTR_UNSPEC,
1282
1283 NL80211_ATTR_WIPHY,
1284 NL80211_ATTR_WIPHY_NAME,
1285
1286 NL80211_ATTR_IFINDEX,
1287 NL80211_ATTR_IFNAME,
1288 NL80211_ATTR_IFTYPE,
1289
1290 NL80211_ATTR_MAC,
1291
1292 NL80211_ATTR_KEY_DATA,
1293 NL80211_ATTR_KEY_IDX,
1294 NL80211_ATTR_KEY_CIPHER,
1295 NL80211_ATTR_KEY_SEQ,
1296 NL80211_ATTR_KEY_DEFAULT,
1297
1298 NL80211_ATTR_BEACON_INTERVAL,
1299 NL80211_ATTR_DTIM_PERIOD,
1300 NL80211_ATTR_BEACON_HEAD,
1301 NL80211_ATTR_BEACON_TAIL,
1302
1303 NL80211_ATTR_STA_AID,
1304 NL80211_ATTR_STA_FLAGS,
1305 NL80211_ATTR_STA_LISTEN_INTERVAL,
1306 NL80211_ATTR_STA_SUPPORTED_RATES,
1307 NL80211_ATTR_STA_VLAN,
1308 NL80211_ATTR_STA_INFO,
1309
1310 NL80211_ATTR_WIPHY_BANDS,
1311
1312 NL80211_ATTR_MNTR_FLAGS,
1313
1314 NL80211_ATTR_MESH_ID,
1315 NL80211_ATTR_STA_PLINK_ACTION,
1316 NL80211_ATTR_MPATH_NEXT_HOP,
1317 NL80211_ATTR_MPATH_INFO,
1318
1319 NL80211_ATTR_BSS_CTS_PROT,
1320 NL80211_ATTR_BSS_SHORT_PREAMBLE,
1321 NL80211_ATTR_BSS_SHORT_SLOT_TIME,
1322
1323 NL80211_ATTR_HT_CAPABILITY,
1324
1325 NL80211_ATTR_SUPPORTED_IFTYPES,
1326
1327 NL80211_ATTR_REG_ALPHA2,
1328 NL80211_ATTR_REG_RULES,
1329
1330 NL80211_ATTR_MESH_CONFIG,
1331
1332 NL80211_ATTR_BSS_BASIC_RATES,
1333
1334 NL80211_ATTR_WIPHY_TXQ_PARAMS,
1335 NL80211_ATTR_WIPHY_FREQ,
1336 NL80211_ATTR_WIPHY_CHANNEL_TYPE,
1337
1338 NL80211_ATTR_KEY_DEFAULT_MGMT,
1339
1340 NL80211_ATTR_MGMT_SUBTYPE,
1341 NL80211_ATTR_IE,
1342
1343 NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
1344
1345 NL80211_ATTR_SCAN_FREQUENCIES,
1346 NL80211_ATTR_SCAN_SSIDS,
1347 NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
1348 NL80211_ATTR_BSS,
1349
1350 NL80211_ATTR_REG_INITIATOR,
1351 NL80211_ATTR_REG_TYPE,
1352
1353 NL80211_ATTR_SUPPORTED_COMMANDS,
1354
1355 NL80211_ATTR_FRAME,
1356 NL80211_ATTR_SSID,
1357 NL80211_ATTR_AUTH_TYPE,
1358 NL80211_ATTR_REASON_CODE,
1359
1360 NL80211_ATTR_KEY_TYPE,
1361
1362 NL80211_ATTR_MAX_SCAN_IE_LEN,
1363 NL80211_ATTR_CIPHER_SUITES,
1364
1365 NL80211_ATTR_FREQ_BEFORE,
1366 NL80211_ATTR_FREQ_AFTER,
1367
1368 NL80211_ATTR_FREQ_FIXED,
1369
1370
1371 NL80211_ATTR_WIPHY_RETRY_SHORT,
1372 NL80211_ATTR_WIPHY_RETRY_LONG,
1373 NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
1374 NL80211_ATTR_WIPHY_RTS_THRESHOLD,
1375
1376 NL80211_ATTR_TIMED_OUT,
1377
1378 NL80211_ATTR_USE_MFP,
1379
1380 NL80211_ATTR_STA_FLAGS2,
1381
1382 NL80211_ATTR_CONTROL_PORT,
1383
1384 NL80211_ATTR_TESTDATA,
1385
1386 NL80211_ATTR_PRIVACY,
1387
1388 NL80211_ATTR_DISCONNECTED_BY_AP,
1389 NL80211_ATTR_STATUS_CODE,
1390
1391 NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
1392 NL80211_ATTR_CIPHER_SUITE_GROUP,
1393 NL80211_ATTR_WPA_VERSIONS,
1394 NL80211_ATTR_AKM_SUITES,
1395
1396 NL80211_ATTR_REQ_IE,
1397 NL80211_ATTR_RESP_IE,
1398
1399 NL80211_ATTR_PREV_BSSID,
1400
1401 NL80211_ATTR_KEY,
1402 NL80211_ATTR_KEYS,
1403
1404 NL80211_ATTR_PID,
1405
1406 NL80211_ATTR_4ADDR,
1407
1408 NL80211_ATTR_SURVEY_INFO,
1409
1410 NL80211_ATTR_PMKID,
1411 NL80211_ATTR_MAX_NUM_PMKIDS,
1412
1413 NL80211_ATTR_DURATION,
1414
1415 NL80211_ATTR_COOKIE,
1416
1417 NL80211_ATTR_WIPHY_COVERAGE_CLASS,
1418
1419 NL80211_ATTR_TX_RATES,
1420
1421 NL80211_ATTR_FRAME_MATCH,
1422
1423 NL80211_ATTR_ACK,
1424
1425 NL80211_ATTR_PS_STATE,
1426
1427 NL80211_ATTR_CQM,
1428
1429 NL80211_ATTR_LOCAL_STATE_CHANGE,
1430
1431 NL80211_ATTR_AP_ISOLATE,
1432
1433 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
1434 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
1435
1436 NL80211_ATTR_TX_FRAME_TYPES,
1437 NL80211_ATTR_RX_FRAME_TYPES,
1438 NL80211_ATTR_FRAME_TYPE,
1439
1440 NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
1441 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
1442
1443 NL80211_ATTR_SUPPORT_IBSS_RSN,
1444
1445 NL80211_ATTR_WIPHY_ANTENNA_TX,
1446 NL80211_ATTR_WIPHY_ANTENNA_RX,
1447
1448 NL80211_ATTR_MCAST_RATE,
1449
1450 NL80211_ATTR_OFFCHANNEL_TX_OK,
1451
1452 NL80211_ATTR_BSS_HT_OPMODE,
1453
1454 NL80211_ATTR_KEY_DEFAULT_TYPES,
1455
1456 NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
1457
1458 NL80211_ATTR_MESH_SETUP,
1459
1460 NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
1461 NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
1462
1463 NL80211_ATTR_SUPPORT_MESH_AUTH,
1464 NL80211_ATTR_STA_PLINK_STATE,
1465
1466 NL80211_ATTR_WOWLAN_TRIGGERS,
1467 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
1468
1469 NL80211_ATTR_SCHED_SCAN_INTERVAL,
1470
1471 NL80211_ATTR_INTERFACE_COMBINATIONS,
1472 NL80211_ATTR_SOFTWARE_IFTYPES,
1473
1474 NL80211_ATTR_REKEY_DATA,
1475
1476 NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
1477 NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
1478
1479 NL80211_ATTR_SCAN_SUPP_RATES,
1480
1481 NL80211_ATTR_HIDDEN_SSID,
1482
1483 NL80211_ATTR_IE_PROBE_RESP,
1484 NL80211_ATTR_IE_ASSOC_RESP,
1485
1486 NL80211_ATTR_STA_WME,
1487 NL80211_ATTR_SUPPORT_AP_UAPSD,
1488
1489 NL80211_ATTR_ROAM_SUPPORT,
1490
1491 NL80211_ATTR_SCHED_SCAN_MATCH,
1492 NL80211_ATTR_MAX_MATCH_SETS,
1493
1494 NL80211_ATTR_PMKSA_CANDIDATE,
1495
1496 NL80211_ATTR_TX_NO_CCK_RATE,
1497
1498 NL80211_ATTR_TDLS_ACTION,
1499 NL80211_ATTR_TDLS_DIALOG_TOKEN,
1500 NL80211_ATTR_TDLS_OPERATION,
1501 NL80211_ATTR_TDLS_SUPPORT,
1502 NL80211_ATTR_TDLS_EXTERNAL_SETUP,
1503
1504 NL80211_ATTR_DEVICE_AP_SME,
1505
1506 NL80211_ATTR_DONT_WAIT_FOR_ACK,
1507
1508 NL80211_ATTR_FEATURE_FLAGS,
1509
1510 NL80211_ATTR_PROBE_RESP_OFFLOAD,
1511
1512 NL80211_ATTR_PROBE_RESP,
1513
1514 NL80211_ATTR_DFS_REGION,
1515
1516 NL80211_ATTR_DISABLE_HT,
1517 NL80211_ATTR_HT_CAPABILITY_MASK,
1518
1519 NL80211_ATTR_NOACK_MAP,
1520
1521 NL80211_ATTR_INACTIVITY_TIMEOUT,
1522
1523 NL80211_ATTR_RX_SIGNAL_DBM,
1524
1525 NL80211_ATTR_BG_SCAN_PERIOD,
1526
1527 NL80211_ATTR_WDEV,
1528
1529 NL80211_ATTR_USER_REG_HINT_TYPE,
1530
1531 NL80211_ATTR_CONN_FAILED_REASON,
1532
1533 /* add attributes here, update the policy in nl80211.c */
1534
1535 __NL80211_ATTR_AFTER_LAST,
1536 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
1537};
1538
1539/* source-level API compatibility */
1540#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
1541#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
1542
1543/*
1544 * Allow user space programs to use #ifdef on new attributes by defining them
1545 * here
1546 */
1547#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
1548#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
1549#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
1550#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
1551#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
1552#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
1553#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
1554#define NL80211_ATTR_IE NL80211_ATTR_IE
1555#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
1556#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
1557#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
1558#define NL80211_ATTR_SSID NL80211_ATTR_SSID
1559#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
1560#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
1561#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
1562#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
1563#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
1564#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
1565#define NL80211_ATTR_KEY NL80211_ATTR_KEY
1566#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
1567#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
1568
1569#define NL80211_MAX_SUPP_RATES 32
1570#define NL80211_MAX_SUPP_HT_RATES 77
1571#define NL80211_MAX_SUPP_REG_RULES 32
1572#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
1573#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
1574#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
1575#define NL80211_HT_CAPABILITY_LEN 26
1576
1577#define NL80211_MAX_NR_CIPHER_SUITES 5
1578#define NL80211_MAX_NR_AKM_SUITES 2
1579
1580#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
1581
1582/* default RSSI threshold for scan results if none specified. */
1583#define NL80211_SCAN_RSSI_THOLD_OFF -300
1584
1585#define NL80211_CQM_TXE_MAX_INTVL 1800
1586
1587/**
1588 * enum nl80211_iftype - (virtual) interface types
1589 *
1590 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
1591 * @NL80211_IFTYPE_ADHOC: independent BSS member
1592 * @NL80211_IFTYPE_STATION: managed BSS member
1593 * @NL80211_IFTYPE_AP: access point
1594 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces
1595 * are a bit special in that they must always be tied to a pre-existing
1596 * AP type interface.
1597 * @NL80211_IFTYPE_WDS: wireless distribution interface
1598 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
1599 * @NL80211_IFTYPE_MESH_POINT: mesh point
1600 * @NL80211_IFTYPE_P2P_CLIENT: P2P client
1601 * @NL80211_IFTYPE_P2P_GO: P2P group owner
1602 * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
1603 * and therefore can't be created in the normal ways, use the
1604 * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
1605 * commands to create and destroy one
1606 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
1607 * @NUM_NL80211_IFTYPES: number of defined interface types
1608 *
1609 * These values are used with the %NL80211_ATTR_IFTYPE
1610 * to set the type of an interface.
1611 *
1612 */
1613enum nl80211_iftype {
1614 NL80211_IFTYPE_UNSPECIFIED,
1615 NL80211_IFTYPE_ADHOC,
1616 NL80211_IFTYPE_STATION,
1617 NL80211_IFTYPE_AP,
1618 NL80211_IFTYPE_AP_VLAN,
1619 NL80211_IFTYPE_WDS,
1620 NL80211_IFTYPE_MONITOR,
1621 NL80211_IFTYPE_MESH_POINT,
1622 NL80211_IFTYPE_P2P_CLIENT,
1623 NL80211_IFTYPE_P2P_GO,
1624 NL80211_IFTYPE_P2P_DEVICE,
1625
1626 /* keep last */
1627 NUM_NL80211_IFTYPES,
1628 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
1629};
1630
1631/**
1632 * enum nl80211_sta_flags - station flags
1633 *
1634 * Station flags. When a station is added to an AP interface, it is
1635 * assumed to be already associated (and hence authenticated.)
1636 *
1637 * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
1638 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
1639 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
1640 * with short barker preamble
1641 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
1642 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1643 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
1644 * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should
1645 * only be used in managed mode (even in the flags mask). Note that the
1646 * flag can't be changed, it is only valid while adding a station, and
1647 * attempts to change it will silently be ignored (rather than rejected
1648 * as errors.)
1649 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1650 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
1651 */
1652enum nl80211_sta_flags {
1653 __NL80211_STA_FLAG_INVALID,
1654 NL80211_STA_FLAG_AUTHORIZED,
1655 NL80211_STA_FLAG_SHORT_PREAMBLE,
1656 NL80211_STA_FLAG_WME,
1657 NL80211_STA_FLAG_MFP,
1658 NL80211_STA_FLAG_AUTHENTICATED,
1659 NL80211_STA_FLAG_TDLS_PEER,
1660
1661 /* keep last */
1662 __NL80211_STA_FLAG_AFTER_LAST,
1663 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
1664};
1665
1666#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
1667
1668/**
1669 * struct nl80211_sta_flag_update - station flags mask/set
1670 * @mask: mask of station flags to set
1671 * @set: which values to set them to
1672 *
1673 * Both mask and set contain bits as per &enum nl80211_sta_flags.
1674 */
1675struct nl80211_sta_flag_update {
1676 __u32 mask;
1677 __u32 set;
1678} __attribute__((packed));
1679
1680/**
1681 * enum nl80211_rate_info - bitrate information
1682 *
1683 * These attribute types are used with %NL80211_STA_INFO_TXRATE
1684 * when getting information about the bitrate of a station.
1685 * There are 2 attributes for bitrate, a legacy one that represents
1686 * a 16-bit value, and new one that represents a 32-bit value.
1687 * If the rate value fits into 16 bit, both attributes are reported
1688 * with the same value. If the rate is too high to fit into 16 bits
1689 * (>6.5535Gbps) only 32-bit attribute is included.
1690 * User space tools encouraged to use the 32-bit attribute and fall
1691 * back to the 16-bit one for compatibility with older kernels.
1692 *
1693 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
1694 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
1695 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
1696 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
1697 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
1698 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
1699 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
1700 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
1701 */
1702enum nl80211_rate_info {
1703 __NL80211_RATE_INFO_INVALID,
1704 NL80211_RATE_INFO_BITRATE,
1705 NL80211_RATE_INFO_MCS,
1706 NL80211_RATE_INFO_40_MHZ_WIDTH,
1707 NL80211_RATE_INFO_SHORT_GI,
1708 NL80211_RATE_INFO_BITRATE32,
1709
1710 /* keep last */
1711 __NL80211_RATE_INFO_AFTER_LAST,
1712 NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
1713};
1714
1715/**
1716 * enum nl80211_sta_bss_param - BSS information collected by STA
1717 *
1718 * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM
1719 * when getting information about the bitrate of a station.
1720 *
1721 * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved
1722 * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag)
1723 * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE: whether short preamble is enabled
1724 * (flag)
1725 * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME: whether short slot time is enabled
1726 * (flag)
1727 * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8)
1728 * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16)
1729 * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined
1730 * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use
1731 */
1732enum nl80211_sta_bss_param {
1733 __NL80211_STA_BSS_PARAM_INVALID,
1734 NL80211_STA_BSS_PARAM_CTS_PROT,
1735 NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
1736 NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
1737 NL80211_STA_BSS_PARAM_DTIM_PERIOD,
1738 NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
1739
1740 /* keep last */
1741 __NL80211_STA_BSS_PARAM_AFTER_LAST,
1742 NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
1743};
1744
1745/**
1746 * enum nl80211_sta_info - station information
1747 *
1748 * These attribute types are used with %NL80211_ATTR_STA_INFO
1749 * when getting information about a station.
1750 *
1751 * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
1752 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
1753 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
1754 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
1755 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
1756 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
1757 * containing info as possible, see &enum nl80211_rate_info
1758 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
1759 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
1760 * station)
1761 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
1762 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
1763 * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
1764 * @NL80211_STA_INFO_LLID: the station's mesh LLID
1765 * @NL80211_STA_INFO_PLID: the station's mesh PLID
1766 * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
1767 * (see %enum nl80211_plink_state)
1768 * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested
1769 * attribute, like NL80211_STA_INFO_TX_BITRATE.
1770 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
1771 * containing info as possible, see &enum nl80211_sta_bss_param
1772 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
1773 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
1774 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
1775 * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
1776 * @__NL80211_STA_INFO_AFTER_LAST: internal
1777 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1778 */
1779enum nl80211_sta_info {
1780 __NL80211_STA_INFO_INVALID,
1781 NL80211_STA_INFO_INACTIVE_TIME,
1782 NL80211_STA_INFO_RX_BYTES,
1783 NL80211_STA_INFO_TX_BYTES,
1784 NL80211_STA_INFO_LLID,
1785 NL80211_STA_INFO_PLID,
1786 NL80211_STA_INFO_PLINK_STATE,
1787 NL80211_STA_INFO_SIGNAL,
1788 NL80211_STA_INFO_TX_BITRATE,
1789 NL80211_STA_INFO_RX_PACKETS,
1790 NL80211_STA_INFO_TX_PACKETS,
1791 NL80211_STA_INFO_TX_RETRIES,
1792 NL80211_STA_INFO_TX_FAILED,
1793 NL80211_STA_INFO_SIGNAL_AVG,
1794 NL80211_STA_INFO_RX_BITRATE,
1795 NL80211_STA_INFO_BSS_PARAM,
1796 NL80211_STA_INFO_CONNECTED_TIME,
1797 NL80211_STA_INFO_STA_FLAGS,
1798 NL80211_STA_INFO_BEACON_LOSS,
1799 NL80211_STA_INFO_T_OFFSET,
1800
1801 /* keep last */
1802 __NL80211_STA_INFO_AFTER_LAST,
1803 NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
1804};
1805
1806/**
1807 * enum nl80211_mpath_flags - nl80211 mesh path flags
1808 *
1809 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
1810 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
1811 * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
1812 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
1813 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
1814 */
1815enum nl80211_mpath_flags {
1816 NL80211_MPATH_FLAG_ACTIVE = 1<<0,
1817 NL80211_MPATH_FLAG_RESOLVING = 1<<1,
1818 NL80211_MPATH_FLAG_SN_VALID = 1<<2,
1819 NL80211_MPATH_FLAG_FIXED = 1<<3,
1820 NL80211_MPATH_FLAG_RESOLVED = 1<<4,
1821};
1822
1823/**
1824 * enum nl80211_mpath_info - mesh path information
1825 *
1826 * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
1827 * information about a mesh path.
1828 *
1829 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
1830 * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
1831 * @NL80211_MPATH_INFO_SN: destination sequence number
1832 * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
1833 * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
1834 * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
1835 * &enum nl80211_mpath_flags;
1836 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
1837 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
1838 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
1839 * currently defind
1840 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
1841 */
1842enum nl80211_mpath_info {
1843 __NL80211_MPATH_INFO_INVALID,
1844 NL80211_MPATH_INFO_FRAME_QLEN,
1845 NL80211_MPATH_INFO_SN,
1846 NL80211_MPATH_INFO_METRIC,
1847 NL80211_MPATH_INFO_EXPTIME,
1848 NL80211_MPATH_INFO_FLAGS,
1849 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
1850 NL80211_MPATH_INFO_DISCOVERY_RETRIES,
1851
1852 /* keep last */
1853 __NL80211_MPATH_INFO_AFTER_LAST,
1854 NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
1855};
1856
1857/**
1858 * enum nl80211_band_attr - band attributes
1859 * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
1860 * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
1861 * an array of nested frequency attributes
1862 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
1863 * an array of nested bitrate attributes
1864 * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
1865 * defined in 802.11n
1866 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1867 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1868 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1869 * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
1870 * defined in 802.11ac
1871 * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
1872 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1873 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1874 */
1875enum nl80211_band_attr {
1876 __NL80211_BAND_ATTR_INVALID,
1877 NL80211_BAND_ATTR_FREQS,
1878 NL80211_BAND_ATTR_RATES,
1879
1880 NL80211_BAND_ATTR_HT_MCS_SET,
1881 NL80211_BAND_ATTR_HT_CAPA,
1882 NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
1883 NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
1884
1885 NL80211_BAND_ATTR_VHT_MCS_SET,
1886 NL80211_BAND_ATTR_VHT_CAPA,
1887
1888 /* keep last */
1889 __NL80211_BAND_ATTR_AFTER_LAST,
1890 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
1891};
1892
1893#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
1894
1895/**
1896 * enum nl80211_frequency_attr - frequency attributes
1897 * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
1898 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
1899 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
1900 * regulatory domain.
1901 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
1902 * permitted on this channel in current regulatory domain.
1903 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
1904 * on this channel in current regulatory domain.
1905 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
1906 * on this channel in current regulatory domain.
1907 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
1908 * (100 * dBm).
1909 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
1910 * currently defined
1911 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
1912 */
1913enum nl80211_frequency_attr {
1914 __NL80211_FREQUENCY_ATTR_INVALID,
1915 NL80211_FREQUENCY_ATTR_FREQ,
1916 NL80211_FREQUENCY_ATTR_DISABLED,
1917 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
1918 NL80211_FREQUENCY_ATTR_NO_IBSS,
1919 NL80211_FREQUENCY_ATTR_RADAR,
1920 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
1921
1922 /* keep last */
1923 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
1924 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
1925};
1926
1927#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
1928
1929/**
1930 * enum nl80211_bitrate_attr - bitrate attributes
1931 * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
1932 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
1933 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
1934 * in 2.4 GHz band.
1935 * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
1936 * currently defined
1937 * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
1938 */
1939enum nl80211_bitrate_attr {
1940 __NL80211_BITRATE_ATTR_INVALID,
1941 NL80211_BITRATE_ATTR_RATE,
1942 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
1943
1944 /* keep last */
1945 __NL80211_BITRATE_ATTR_AFTER_LAST,
1946 NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
1947};
1948
1949/**
1950 * enum nl80211_initiator - Indicates the initiator of a reg domain request
1951 * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
1952 * regulatory domain.
1953 * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
1954 * regulatory domain.
1955 * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
1956 * wireless core it thinks its knows the regulatory domain we should be in.
1957 * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
1958 * 802.11 country information element with regulatory information it
1959 * thinks we should consider. cfg80211 only processes the country
1960 * code from the IE, and relies on the regulatory domain information
1961 * structure passed by userspace (CRDA) from our wireless-regdb.
1962 * If a channel is enabled but the country code indicates it should
1963 * be disabled we disable the channel and re-enable it upon disassociation.
1964 */
1965enum nl80211_reg_initiator {
1966 NL80211_REGDOM_SET_BY_CORE,
1967 NL80211_REGDOM_SET_BY_USER,
1968 NL80211_REGDOM_SET_BY_DRIVER,
1969 NL80211_REGDOM_SET_BY_COUNTRY_IE,
1970};
1971
1972/**
1973 * enum nl80211_reg_type - specifies the type of regulatory domain
1974 * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
1975 * to a specific country. When this is set you can count on the
1976 * ISO / IEC 3166 alpha2 country code being valid.
1977 * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
1978 * domain.
1979 * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
1980 * driver specific world regulatory domain. These do not apply system-wide
1981 * and are only applicable to the individual devices which have requested
1982 * them to be applied.
1983 * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
1984 * of an intersection between two regulatory domains -- the previously
1985 * set regulatory domain on the system and the last accepted regulatory
1986 * domain request to be processed.
1987 */
1988enum nl80211_reg_type {
1989 NL80211_REGDOM_TYPE_COUNTRY,
1990 NL80211_REGDOM_TYPE_WORLD,
1991 NL80211_REGDOM_TYPE_CUSTOM_WORLD,
1992 NL80211_REGDOM_TYPE_INTERSECTION,
1993};
1994
1995/**
1996 * enum nl80211_reg_rule_attr - regulatory rule attributes
1997 * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
1998 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
1999 * considerations for a given frequency range. These are the
2000 * &enum nl80211_reg_rule_flags.
2001 * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
2002 * rule in KHz. This is not a center of frequency but an actual regulatory
2003 * band edge.
2004 * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
2005 * in KHz. This is not a center a frequency but an actual regulatory
2006 * band edge.
2007 * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
2008 * frequency range, in KHz.
2009 * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
2010 * for a given frequency range. The value is in mBi (100 * dBi).
2011 * If you don't have one then don't send this.
2012 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
2013 * a given frequency range. The value is in mBm (100 * dBm).
2014 * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
2015 * currently defined
2016 * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
2017 */
2018enum nl80211_reg_rule_attr {
2019 __NL80211_REG_RULE_ATTR_INVALID,
2020 NL80211_ATTR_REG_RULE_FLAGS,
2021
2022 NL80211_ATTR_FREQ_RANGE_START,
2023 NL80211_ATTR_FREQ_RANGE_END,
2024 NL80211_ATTR_FREQ_RANGE_MAX_BW,
2025
2026 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
2027 NL80211_ATTR_POWER_RULE_MAX_EIRP,
2028
2029 /* keep last */
2030 __NL80211_REG_RULE_ATTR_AFTER_LAST,
2031 NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
2032};
2033
2034/**
2035 * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
2036 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
2037 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
2038 * only report BSS with matching SSID.
2039 * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
2040 * BSS in scan results. Filtering is turned off if not specified.
2041 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
2042 * attribute number currently defined
2043 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
2044 */
2045enum nl80211_sched_scan_match_attr {
2046 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
2047
2048 NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
2049 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
2050
2051 /* keep last */
2052 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
2053 NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
2054 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
2055};
2056
2057/* only for backward compatibility */
2058#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
2059
2060/**
2061 * enum nl80211_reg_rule_flags - regulatory rule flags
2062 *
2063 * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
2064 * @NL80211_RRF_NO_CCK: CCK modulation not allowed
2065 * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
2066 * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
2067 * @NL80211_RRF_DFS: DFS support is required to be used
2068 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
2069 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
2070 * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
2071 * @NL80211_RRF_NO_IBSS: no IBSS is allowed
2072 */
2073enum nl80211_reg_rule_flags {
2074 NL80211_RRF_NO_OFDM = 1<<0,
2075 NL80211_RRF_NO_CCK = 1<<1,
2076 NL80211_RRF_NO_INDOOR = 1<<2,
2077 NL80211_RRF_NO_OUTDOOR = 1<<3,
2078 NL80211_RRF_DFS = 1<<4,
2079 NL80211_RRF_PTP_ONLY = 1<<5,
2080 NL80211_RRF_PTMP_ONLY = 1<<6,
2081 NL80211_RRF_PASSIVE_SCAN = 1<<7,
2082 NL80211_RRF_NO_IBSS = 1<<8,
2083};
2084
2085/**
2086 * enum nl80211_dfs_regions - regulatory DFS regions
2087 *
2088 * @NL80211_DFS_UNSET: Country has no DFS master region specified
2089 * @NL80211_DFS_FCC: Country follows DFS master rules from FCC
2090 * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI
2091 * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec
2092 */
2093enum nl80211_dfs_regions {
2094 NL80211_DFS_UNSET = 0,
2095 NL80211_DFS_FCC = 1,
2096 NL80211_DFS_ETSI = 2,
2097 NL80211_DFS_JP = 3,
2098};
2099
2100/**
2101 * enum nl80211_user_reg_hint_type - type of user regulatory hint
2102 *
2103 * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
2104 * assumed if the attribute is not set.
2105 * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
2106 * base station. Device drivers that have been tested to work
2107 * properly to support this type of hint can enable these hints
2108 * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
2109 * capability on the struct wiphy. The wireless core will
2110 * ignore all cell base station hints until at least one device
2111 * present has been registered with the wireless core that
2112 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
2113 * supported feature.
2114 */
2115enum nl80211_user_reg_hint_type {
2116 NL80211_USER_REG_HINT_USER = 0,
2117 NL80211_USER_REG_HINT_CELL_BASE = 1,
2118};
2119
2120/**
2121 * enum nl80211_survey_info - survey information
2122 *
2123 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
2124 * when getting information about a survey.
2125 *
2126 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
2127 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
2128 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
2129 * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
2130 * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
2131 * spent on this channel
2132 * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
2133 * channel was sensed busy (either due to activity or energy detect)
2134 * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
2135 * channel was sensed busy
2136 * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
2137 * receiving data
2138 * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
2139 * transmitting data
2140 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
2141 * currently defined
2142 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
2143 */
2144enum nl80211_survey_info {
2145 __NL80211_SURVEY_INFO_INVALID,
2146 NL80211_SURVEY_INFO_FREQUENCY,
2147 NL80211_SURVEY_INFO_NOISE,
2148 NL80211_SURVEY_INFO_IN_USE,
2149 NL80211_SURVEY_INFO_CHANNEL_TIME,
2150 NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
2151 NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
2152 NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
2153 NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
2154
2155 /* keep last */
2156 __NL80211_SURVEY_INFO_AFTER_LAST,
2157 NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
2158};
2159
2160/**
2161 * enum nl80211_mntr_flags - monitor configuration flags
2162 *
2163 * Monitor configuration flags.
2164 *
2165 * @__NL80211_MNTR_FLAG_INVALID: reserved
2166 *
2167 * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
2168 * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
2169 * @NL80211_MNTR_FLAG_CONTROL: pass control frames
2170 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
2171 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
2172 * overrides all other flags.
2173 *
2174 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
2175 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
2176 */
2177enum nl80211_mntr_flags {
2178 __NL80211_MNTR_FLAG_INVALID,
2179 NL80211_MNTR_FLAG_FCSFAIL,
2180 NL80211_MNTR_FLAG_PLCPFAIL,
2181 NL80211_MNTR_FLAG_CONTROL,
2182 NL80211_MNTR_FLAG_OTHER_BSS,
2183 NL80211_MNTR_FLAG_COOK_FRAMES,
2184
2185 /* keep last */
2186 __NL80211_MNTR_FLAG_AFTER_LAST,
2187 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
2188};
2189
2190/**
2191 * enum nl80211_meshconf_params - mesh configuration parameters
2192 *
2193 * Mesh configuration parameters. These can be changed while the mesh is
2194 * active.
2195 *
2196 * @__NL80211_MESHCONF_INVALID: internal use
2197 *
2198 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
2199 * millisecond units, used by the Peer Link Open message
2200 *
2201 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
2202 * millisecond units, used by the peer link management to close a peer link
2203 *
2204 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
2205 * millisecond units
2206 *
2207 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
2208 * on this mesh interface
2209 *
2210 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
2211 * open retries that can be sent to establish a new peer link instance in a
2212 * mesh
2213 *
2214 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
2215 * point.
2216 *
2217 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
2218 * open peer links when we detect compatible mesh peers.
2219 *
2220 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
2221 * containing a PREQ that an MP can send to a particular destination (path
2222 * target)
2223 *
2224 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
2225 * (in milliseconds)
2226 *
2227 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
2228 * until giving up on a path discovery (in milliseconds)
2229 *
2230 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
2231 * points receiving a PREQ shall consider the forwarding information from
2232 * the root to be valid. (TU = time unit)
2233 *
2234 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
2235 * TUs) during which an MP can send only one action frame containing a PREQ
2236 * reference element
2237 *
2238 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
2239 * that it takes for an HWMP information element to propagate across the
2240 * mesh
2241 *
2242 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
2243 *
2244 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
2245 * source mesh point for path selection elements.
2246 *
2247 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between
2248 * root announcements are transmitted.
2249 *
2250 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
2251 * access to a broader network beyond the MBSS. This is done via Root
2252 * Announcement frames.
2253 *
2254 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
2255 * TUs) during which a mesh STA can send only one Action frame containing a
2256 * PERR element.
2257 *
2258 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
2259 * or forwarding entity (default is TRUE - forwarding entity)
2260 *
2261 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
2262 * threshold for average signal strength of candidate station to establish
2263 * a peer link.
2264 *
2265 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
2266 * to synchronize to for 11s default synchronization method
2267 * (see 11C.12.2.2)
2268 *
2269 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
2270 *
2271 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2272 *
2273 * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
2274 * which mesh STAs receiving a proactive PREQ shall consider the forwarding
2275 * information to the root mesh STA to be valid.
2276 *
2277 * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
2278 * proactive PREQs are transmitted.
2279 *
2280 * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
2281 * (in TUs) during which a mesh STA can send only one Action frame
2282 * containing a PREQ element for root path confirmation.
2283 *
2284 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2285 */
2286enum nl80211_meshconf_params {
2287 __NL80211_MESHCONF_INVALID,
2288 NL80211_MESHCONF_RETRY_TIMEOUT,
2289 NL80211_MESHCONF_CONFIRM_TIMEOUT,
2290 NL80211_MESHCONF_HOLDING_TIMEOUT,
2291 NL80211_MESHCONF_MAX_PEER_LINKS,
2292 NL80211_MESHCONF_MAX_RETRIES,
2293 NL80211_MESHCONF_TTL,
2294 NL80211_MESHCONF_AUTO_OPEN_PLINKS,
2295 NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
2296 NL80211_MESHCONF_PATH_REFRESH_TIME,
2297 NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
2298 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
2299 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
2300 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
2301 NL80211_MESHCONF_HWMP_ROOTMODE,
2302 NL80211_MESHCONF_ELEMENT_TTL,
2303 NL80211_MESHCONF_HWMP_RANN_INTERVAL,
2304 NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
2305 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
2306 NL80211_MESHCONF_FORWARDING,
2307 NL80211_MESHCONF_RSSI_THRESHOLD,
2308 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
2309 NL80211_MESHCONF_HT_OPMODE,
2310 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
2311 NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
2312 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2313
2314 /* keep last */
2315 __NL80211_MESHCONF_ATTR_AFTER_LAST,
2316 NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
2317};
2318
2319/**
2320 * enum nl80211_mesh_setup_params - mesh setup parameters
2321 *
2322 * Mesh setup parameters. These are used to start/join a mesh and cannot be
2323 * changed while the mesh is active.
2324 *
2325 * @__NL80211_MESH_SETUP_INVALID: Internal use
2326 *
2327 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
2328 * vendor specific path selection algorithm or disable it to use the
2329 * default HWMP.
2330 *
2331 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
2332 * vendor specific path metric or disable it to use the default Airtime
2333 * metric.
2334 *
2335 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
2336 * robust security network ie, or a vendor specific information element
2337 * that vendors will use to identify the path selection methods and
2338 * metrics in use.
2339 *
2340 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
2341 * daemon will be authenticating mesh candidates.
2342 *
2343 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
2344 * daemon will be securing peer link frames. AMPE is a secured version of
2345 * Mesh Peering Management (MPM) and is implemented with the assistance of
2346 * a userspace daemon. When this flag is set, the kernel will send peer
2347 * management frames to a userspace daemon that will implement AMPE
2348 * functionality (security capabilities selection, key confirmation, and
2349 * key management). When the flag is unset (default), the kernel can
2350 * autonomously complete (unsecured) mesh peering without the need of a
2351 * userspace daemon.
2352 *
2353 * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
2354 * vendor specific synchronization method or disable it to use the default
2355 * neighbor offset synchronization
2356 *
2357 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2358 *
2359 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
2360 */
2361enum nl80211_mesh_setup_params {
2362 __NL80211_MESH_SETUP_INVALID,
2363 NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
2364 NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
2365 NL80211_MESH_SETUP_IE,
2366 NL80211_MESH_SETUP_USERSPACE_AUTH,
2367 NL80211_MESH_SETUP_USERSPACE_AMPE,
2368 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2369
2370 /* keep last */
2371 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
2372 NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
2373};
2374
2375/**
2376 * enum nl80211_txq_attr - TX queue parameter attributes
2377 * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
2378 * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*)
2379 * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
2380 * disabled
2381 * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
2382 * 2^n-1 in the range 1..32767]
2383 * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
2384 * 2^n-1 in the range 1..32767]
2385 * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
2386 * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
2387 * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
2388 */
2389enum nl80211_txq_attr {
2390 __NL80211_TXQ_ATTR_INVALID,
2391 NL80211_TXQ_ATTR_AC,
2392 NL80211_TXQ_ATTR_TXOP,
2393 NL80211_TXQ_ATTR_CWMIN,
2394 NL80211_TXQ_ATTR_CWMAX,
2395 NL80211_TXQ_ATTR_AIFS,
2396
2397 /* keep last */
2398 __NL80211_TXQ_ATTR_AFTER_LAST,
2399 NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
2400};
2401
2402enum nl80211_ac {
2403 NL80211_AC_VO,
2404 NL80211_AC_VI,
2405 NL80211_AC_BE,
2406 NL80211_AC_BK,
2407 NL80211_NUM_ACS
2408};
2409
2410/* backward compat */
2411#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC
2412#define NL80211_TXQ_Q_VO NL80211_AC_VO
2413#define NL80211_TXQ_Q_VI NL80211_AC_VI
2414#define NL80211_TXQ_Q_BE NL80211_AC_BE
2415#define NL80211_TXQ_Q_BK NL80211_AC_BK
2416
2417enum nl80211_channel_type {
2418 NL80211_CHAN_NO_HT,
2419 NL80211_CHAN_HT20,
2420 NL80211_CHAN_HT40MINUS,
2421 NL80211_CHAN_HT40PLUS
2422};
2423
2424/**
2425 * enum nl80211_bss - netlink attributes for a BSS
2426 *
2427 * @__NL80211_BSS_INVALID: invalid
2428 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
2429 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
2430 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
2431 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
2432 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
2433 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
2434 * raw information elements from the probe response/beacon (bin);
2435 * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are
2436 * from a Probe Response frame; otherwise they are from a Beacon frame.
2437 * However, if the driver does not indicate the source of the IEs, these
2438 * IEs may be from either frame subtype.
2439 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
2440 * in mBm (100 * dBm) (s32)
2441 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
2442 * in unspecified units, scaled to 0..100 (u8)
2443 * @NL80211_BSS_STATUS: status, if this BSS is "used"
2444 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
2445 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
2446 * elements from a Beacon frame (bin); not present if no Beacon frame has
2447 * yet been received
2448 * @__NL80211_BSS_AFTER_LAST: internal
2449 * @NL80211_BSS_MAX: highest BSS attribute
2450 */
2451enum nl80211_bss {
2452 __NL80211_BSS_INVALID,
2453 NL80211_BSS_BSSID,
2454 NL80211_BSS_FREQUENCY,
2455 NL80211_BSS_TSF,
2456 NL80211_BSS_BEACON_INTERVAL,
2457 NL80211_BSS_CAPABILITY,
2458 NL80211_BSS_INFORMATION_ELEMENTS,
2459 NL80211_BSS_SIGNAL_MBM,
2460 NL80211_BSS_SIGNAL_UNSPEC,
2461 NL80211_BSS_STATUS,
2462 NL80211_BSS_SEEN_MS_AGO,
2463 NL80211_BSS_BEACON_IES,
2464
2465 /* keep last */
2466 __NL80211_BSS_AFTER_LAST,
2467 NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
2468};
2469
2470/**
2471 * enum nl80211_bss_status - BSS "status"
2472 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
2473 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
2474 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
2475 *
2476 * The BSS status is a BSS attribute in scan dumps, which
2477 * indicates the status the interface has wrt. this BSS.
2478 */
2479enum nl80211_bss_status {
2480 NL80211_BSS_STATUS_AUTHENTICATED,
2481 NL80211_BSS_STATUS_ASSOCIATED,
2482 NL80211_BSS_STATUS_IBSS_JOINED,
2483};
2484
2485/**
2486 * enum nl80211_auth_type - AuthenticationType
2487 *
2488 * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
2489 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
2490 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
2491 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
2492 * @__NL80211_AUTHTYPE_NUM: internal
2493 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
2494 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
2495 * trying multiple times); this is invalid in netlink -- leave out
2496 * the attribute for this on CONNECT commands.
2497 */
2498enum nl80211_auth_type {
2499 NL80211_AUTHTYPE_OPEN_SYSTEM,
2500 NL80211_AUTHTYPE_SHARED_KEY,
2501 NL80211_AUTHTYPE_FT,
2502 NL80211_AUTHTYPE_NETWORK_EAP,
2503
2504 /* keep last */
2505 __NL80211_AUTHTYPE_NUM,
2506 NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
2507 NL80211_AUTHTYPE_AUTOMATIC
2508};
2509
2510/**
2511 * enum nl80211_key_type - Key Type
2512 * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
2513 * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
2514 * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
2515 * @NUM_NL80211_KEYTYPES: number of defined key types
2516 */
2517enum nl80211_key_type {
2518 NL80211_KEYTYPE_GROUP,
2519 NL80211_KEYTYPE_PAIRWISE,
2520 NL80211_KEYTYPE_PEERKEY,
2521
2522 NUM_NL80211_KEYTYPES
2523};
2524
2525/**
2526 * enum nl80211_mfp - Management frame protection state
2527 * @NL80211_MFP_NO: Management frame protection not used
2528 * @NL80211_MFP_REQUIRED: Management frame protection required
2529 */
2530enum nl80211_mfp {
2531 NL80211_MFP_NO,
2532 NL80211_MFP_REQUIRED,
2533};
2534
2535enum nl80211_wpa_versions {
2536 NL80211_WPA_VERSION_1 = 1 << 0,
2537 NL80211_WPA_VERSION_2 = 1 << 1,
2538};
2539
2540/**
2541 * enum nl80211_key_default_types - key default types
2542 * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
2543 * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
2544 * unicast key
2545 * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
2546 * multicast key
2547 * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
2548 */
2549enum nl80211_key_default_types {
2550 __NL80211_KEY_DEFAULT_TYPE_INVALID,
2551 NL80211_KEY_DEFAULT_TYPE_UNICAST,
2552 NL80211_KEY_DEFAULT_TYPE_MULTICAST,
2553
2554 NUM_NL80211_KEY_DEFAULT_TYPES
2555};
2556
2557/**
2558 * enum nl80211_key_attributes - key attributes
2559 * @__NL80211_KEY_INVALID: invalid
2560 * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
2561 * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
2562 * keys
2563 * @NL80211_KEY_IDX: key ID (u8, 0-3)
2564 * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
2565 * section 7.3.2.25.1, e.g. 0x000FAC04)
2566 * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
2567 * CCMP keys, each six bytes in little endian
2568 * @NL80211_KEY_DEFAULT: flag indicating default key
2569 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
2570 * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
2571 * specified the default depends on whether a MAC address was
2572 * given with the command using the key or not (u32)
2573 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
2574 * attributes, specifying what a key should be set as default as.
2575 * See &enum nl80211_key_default_types.
2576 * @__NL80211_KEY_AFTER_LAST: internal
2577 * @NL80211_KEY_MAX: highest key attribute
2578 */
2579enum nl80211_key_attributes {
2580 __NL80211_KEY_INVALID,
2581 NL80211_KEY_DATA,
2582 NL80211_KEY_IDX,
2583 NL80211_KEY_CIPHER,
2584 NL80211_KEY_SEQ,
2585 NL80211_KEY_DEFAULT,
2586 NL80211_KEY_DEFAULT_MGMT,
2587 NL80211_KEY_TYPE,
2588 NL80211_KEY_DEFAULT_TYPES,
2589
2590 /* keep last */
2591 __NL80211_KEY_AFTER_LAST,
2592 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
2593};
2594
2595/**
2596 * enum nl80211_tx_rate_attributes - TX rate set attributes
2597 * @__NL80211_TXRATE_INVALID: invalid
2598 * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
2599 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
2600 * 1 = 500 kbps) but without the IE length restriction (at most
2601 * %NL80211_MAX_SUPP_RATES in a single array).
2602 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection
2603 * in an array of MCS numbers.
2604 * @__NL80211_TXRATE_AFTER_LAST: internal
2605 * @NL80211_TXRATE_MAX: highest TX rate attribute
2606 */
2607enum nl80211_tx_rate_attributes {
2608 __NL80211_TXRATE_INVALID,
2609 NL80211_TXRATE_LEGACY,
2610 NL80211_TXRATE_MCS,
2611
2612 /* keep last */
2613 __NL80211_TXRATE_AFTER_LAST,
2614 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
2615};
2616
2617/**
2618 * enum nl80211_band - Frequency band
2619 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
2620 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
2621 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
2622 */
2623enum nl80211_band {
2624 NL80211_BAND_2GHZ,
2625 NL80211_BAND_5GHZ,
2626 NL80211_BAND_60GHZ,
2627};
2628
2629/**
2630 * enum nl80211_ps_state - powersave state
2631 * @NL80211_PS_DISABLED: powersave is disabled
2632 * @NL80211_PS_ENABLED: powersave is enabled
2633 */
2634enum nl80211_ps_state {
2635 NL80211_PS_DISABLED,
2636 NL80211_PS_ENABLED,
2637};
2638
2639/**
2640 * enum nl80211_attr_cqm - connection quality monitor attributes
2641 * @__NL80211_ATTR_CQM_INVALID: invalid
2642 * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies
2643 * the threshold for the RSSI level at which an event will be sent. Zero
2644 * to disable.
2645 * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies
2646 * the minimum amount the RSSI level must change after an event before a
2647 * new event may be issued (to reduce effects of RSSI oscillation).
2648 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
2649 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
2650 * consecutive packets were not acknowledged by the peer
2651 * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
2652 * during the given %NL80211_ATTR_CQM_TXE_INTVL before an
2653 * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
2654 * %NL80211_ATTR_CQM_TXE_PKTS is generated.
2655 * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
2656 * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
2657 * checked.
2658 * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
2659 * interval in which %NL80211_ATTR_CQM_TXE_PKTS and
2660 * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
2661 * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
2662 * @__NL80211_ATTR_CQM_AFTER_LAST: internal
2663 * @NL80211_ATTR_CQM_MAX: highest key attribute
2664 */
2665enum nl80211_attr_cqm {
2666 __NL80211_ATTR_CQM_INVALID,
2667 NL80211_ATTR_CQM_RSSI_THOLD,
2668 NL80211_ATTR_CQM_RSSI_HYST,
2669 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
2670 NL80211_ATTR_CQM_PKT_LOSS_EVENT,
2671 NL80211_ATTR_CQM_TXE_RATE,
2672 NL80211_ATTR_CQM_TXE_PKTS,
2673 NL80211_ATTR_CQM_TXE_INTVL,
2674
2675 /* keep last */
2676 __NL80211_ATTR_CQM_AFTER_LAST,
2677 NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
2678};
2679
2680/**
2681 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
2682 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
2683 * configured threshold
2684 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
2685 * configured threshold
2686 * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
2687 * (Note that deauth/disassoc will still follow if the AP is not
2688 * available. This event might get used as roaming event, etc.)
2689 */
2690enum nl80211_cqm_rssi_threshold_event {
2691 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
2692 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
2693 NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
2694};
2695
2696
2697/**
2698 * enum nl80211_tx_power_setting - TX power adjustment
2699 * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
2700 * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
2701 * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
2702 */
2703enum nl80211_tx_power_setting {
2704 NL80211_TX_POWER_AUTOMATIC,
2705 NL80211_TX_POWER_LIMITED,
2706 NL80211_TX_POWER_FIXED,
2707};
2708
2709/**
2710 * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute
2711 * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute
2712 * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has
2713 * a zero bit are ignored
2714 * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have
2715 * a bit for each byte in the pattern. The lowest-order bit corresponds
2716 * to the first byte of the pattern, but the bytes of the pattern are
2717 * in a little-endian-like format, i.e. the 9th byte of the pattern
2718 * corresponds to the lowest-order bit in the second byte of the mask.
2719 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
2720 * xx indicates "don't care") would be represented by a pattern of
2721 * twelve zero bytes, and a mask of "0xed,0x07".
2722 * Note that the pattern matching is done as though frames were not
2723 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
2724 * first (including SNAP header unpacking) and then matched.
2725 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
2726 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
2727 */
2728enum nl80211_wowlan_packet_pattern_attr {
2729 __NL80211_WOWLAN_PKTPAT_INVALID,
2730 NL80211_WOWLAN_PKTPAT_MASK,
2731 NL80211_WOWLAN_PKTPAT_PATTERN,
2732
2733 NUM_NL80211_WOWLAN_PKTPAT,
2734 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
2735};
2736
2737/**
2738 * struct nl80211_wowlan_pattern_support - pattern support information
2739 * @max_patterns: maximum number of patterns supported
2740 * @min_pattern_len: minimum length of each pattern
2741 * @max_pattern_len: maximum length of each pattern
2742 *
2743 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
2744 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
2745 * capability information given by the kernel to userspace.
2746 */
2747struct nl80211_wowlan_pattern_support {
2748 __u32 max_patterns;
2749 __u32 min_pattern_len;
2750 __u32 max_pattern_len;
2751} __attribute__((packed));
2752
2753/**
2754 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
2755 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
2756 * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
2757 * the chip into a special state -- works best with chips that have
2758 * support for low-power operation already (flag)
2759 * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
2760 * is detected is implementation-specific (flag)
2761 * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
2762 * by 16 repetitions of MAC addr, anywhere in payload) (flag)
2763 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
2764 * which are passed in an array of nested attributes, each nested attribute
2765 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
2766 * Each pattern defines a wakeup packet. The matching is done on the MSDU,
2767 * i.e. as though the packet was an 802.3 packet, so the pattern matching
2768 * is done after the packet is converted to the MSDU.
2769 *
2770 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2771 * carrying a &struct nl80211_wowlan_pattern_support.
2772 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
2773 * used when setting, used only to indicate that GTK rekeying is supported
2774 * by the device (flag)
2775 * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
2776 * done by the device) (flag)
2777 * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
2778 * packet (flag)
2779 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
2780 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
2781 * (on devices that have rfkill in the device) (flag)
2782 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2783 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
2784 */
2785enum nl80211_wowlan_triggers {
2786 __NL80211_WOWLAN_TRIG_INVALID,
2787 NL80211_WOWLAN_TRIG_ANY,
2788 NL80211_WOWLAN_TRIG_DISCONNECT,
2789 NL80211_WOWLAN_TRIG_MAGIC_PKT,
2790 NL80211_WOWLAN_TRIG_PKT_PATTERN,
2791 NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
2792 NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
2793 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
2794 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
2795 NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
2796
2797 /* keep last */
2798 NUM_NL80211_WOWLAN_TRIG,
2799 MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
2800};
2801
2802/**
2803 * enum nl80211_iface_limit_attrs - limit attributes
2804 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
2805 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
2806 * can be chosen from this set of interface types (u32)
2807 * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a
2808 * flag attribute for each interface type in this set
2809 * @NUM_NL80211_IFACE_LIMIT: number of attributes
2810 * @MAX_NL80211_IFACE_LIMIT: highest attribute number
2811 */
2812enum nl80211_iface_limit_attrs {
2813 NL80211_IFACE_LIMIT_UNSPEC,
2814 NL80211_IFACE_LIMIT_MAX,
2815 NL80211_IFACE_LIMIT_TYPES,
2816
2817 /* keep last */
2818 NUM_NL80211_IFACE_LIMIT,
2819 MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
2820};
2821
2822/**
2823 * enum nl80211_if_combination_attrs -- interface combination attributes
2824 *
2825 * @NL80211_IFACE_COMB_UNSPEC: (reserved)
2826 * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits
2827 * for given interface types, see &enum nl80211_iface_limit_attrs.
2828 * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of
2829 * interfaces that can be created in this group. This number doesn't
2830 * apply to interfaces purely managed in software, which are listed
2831 * in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE.
2832 * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that
2833 * beacon intervals within this group must be all the same even for
2834 * infrastructure and AP/GO combinations, i.e. the GO(s) must adopt
2835 * the infrastructure network's beacon interval.
2836 * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
2837 * different channels may be used within this group.
2838 * @NUM_NL80211_IFACE_COMB: number of attributes
2839 * @MAX_NL80211_IFACE_COMB: highest attribute number
2840 *
2841 * Examples:
2842 * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
2843 * => allows an AP and a STA that must match BIs
2844 *
2845 * numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8
2846 * => allows 8 of AP/GO
2847 *
2848 * numbers = [ #{STA} <= 2 ], channels = 2, max = 2
2849 * => allows two STAs on different channels
2850 *
2851 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
2852 * => allows a STA plus three P2P interfaces
2853 *
2854 * The list of these four possiblities could completely be contained
2855 * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
2856 * that any of these groups must match.
2857 *
2858 * "Combinations" of just a single interface will not be listed here,
2859 * a single interface of any valid interface type is assumed to always
2860 * be possible by itself. This means that implicitly, for each valid
2861 * interface type, the following group always exists:
2862 * numbers = [ #{<type>} <= 1 ], channels = 1, max = 1
2863 */
2864enum nl80211_if_combination_attrs {
2865 NL80211_IFACE_COMB_UNSPEC,
2866 NL80211_IFACE_COMB_LIMITS,
2867 NL80211_IFACE_COMB_MAXNUM,
2868 NL80211_IFACE_COMB_STA_AP_BI_MATCH,
2869 NL80211_IFACE_COMB_NUM_CHANNELS,
2870
2871 /* keep last */
2872 NUM_NL80211_IFACE_COMB,
2873 MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
2874};
2875
2876
2877/**
2878 * enum nl80211_plink_state - state of a mesh peer link finite state machine
2879 *
2880 * @NL80211_PLINK_LISTEN: initial state, considered the implicit
2881 * state of non existant mesh peer links
2882 * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
2883 * this mesh peer
2884 * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
2885 * from this mesh peer
2886 * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been
2887 * received from this mesh peer
2888 * @NL80211_PLINK_ESTAB: mesh peer link is established
2889 * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
2890 * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
2891 * plink are discarded
2892 * @NUM_NL80211_PLINK_STATES: number of peer link states
2893 * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
2894 */
2895enum nl80211_plink_state {
2896 NL80211_PLINK_LISTEN,
2897 NL80211_PLINK_OPN_SNT,
2898 NL80211_PLINK_OPN_RCVD,
2899 NL80211_PLINK_CNF_RCVD,
2900 NL80211_PLINK_ESTAB,
2901 NL80211_PLINK_HOLDING,
2902 NL80211_PLINK_BLOCKED,
2903
2904 /* keep last */
2905 NUM_NL80211_PLINK_STATES,
2906 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
2907};
2908
2909#define NL80211_KCK_LEN 16
2910#define NL80211_KEK_LEN 16
2911#define NL80211_REPLAY_CTR_LEN 8
2912
2913/**
2914 * enum nl80211_rekey_data - attributes for GTK rekey offload
2915 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
2916 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
2917 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
2918 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
2919 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
2920 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
2921 */
2922enum nl80211_rekey_data {
2923 __NL80211_REKEY_DATA_INVALID,
2924 NL80211_REKEY_DATA_KEK,
2925 NL80211_REKEY_DATA_KCK,
2926 NL80211_REKEY_DATA_REPLAY_CTR,
2927
2928 /* keep last */
2929 NUM_NL80211_REKEY_DATA,
2930 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2931};
2932
2933/**
2934 * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
2935 * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
2936 * Beacon frames)
2937 * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
2938 * in Beacon frames
2939 * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
2940 * element in Beacon frames but zero out each byte in the SSID
2941 */
2942enum nl80211_hidden_ssid {
2943 NL80211_HIDDEN_SSID_NOT_IN_USE,
2944 NL80211_HIDDEN_SSID_ZERO_LEN,
2945 NL80211_HIDDEN_SSID_ZERO_CONTENTS
2946};
2947
2948/**
2949 * enum nl80211_sta_wme_attr - station WME attributes
2950 * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
2951 * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
2952 * is the same as the AC bitmap in the QoS info field.
2953 * @NL80211_STA_WME_MAX_SP: max service period. the format is the same
2954 * as the MAX_SP field in the QoS info field (but already shifted down).
2955 * @__NL80211_STA_WME_AFTER_LAST: internal
2956 * @NL80211_STA_WME_MAX: highest station WME attribute
2957 */
2958enum nl80211_sta_wme_attr {
2959 __NL80211_STA_WME_INVALID,
2960 NL80211_STA_WME_UAPSD_QUEUES,
2961 NL80211_STA_WME_MAX_SP,
2962
2963 /* keep last */
2964 __NL80211_STA_WME_AFTER_LAST,
2965 NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
2966};
2967
2968/**
2969 * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
2970 * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
2971 * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
2972 * priority)
2973 * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
2974 * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
2975 * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
2976 * (internal)
2977 * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
2978 * (internal)
2979 */
2980enum nl80211_pmksa_candidate_attr {
2981 __NL80211_PMKSA_CANDIDATE_INVALID,
2982 NL80211_PMKSA_CANDIDATE_INDEX,
2983 NL80211_PMKSA_CANDIDATE_BSSID,
2984 NL80211_PMKSA_CANDIDATE_PREAUTH,
2985
2986 /* keep last */
2987 NUM_NL80211_PMKSA_CANDIDATE,
2988 MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
2989};
2990
2991/**
2992 * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
2993 * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
2994 * @NL80211_TDLS_SETUP: Setup TDLS link
2995 * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
2996 * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
2997 * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
2998 */
2999enum nl80211_tdls_operation {
3000 NL80211_TDLS_DISCOVERY_REQ,
3001 NL80211_TDLS_SETUP,
3002 NL80211_TDLS_TEARDOWN,
3003 NL80211_TDLS_ENABLE_LINK,
3004 NL80211_TDLS_DISABLE_LINK,
3005};
3006
3007/*
3008 * enum nl80211_ap_sme_features - device-integrated AP features
3009 * Reserved for future use, no bits are defined in
3010 * NL80211_ATTR_DEVICE_AP_SME yet.
3011enum nl80211_ap_sme_features {
3012};
3013 */
3014
3015/**
3016 * enum nl80211_feature_flags - device/driver features
3017 * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back
3018 * TX status to the socket error queue when requested with the
3019 * socket option.
3020 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
3021 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
3022 * the connected inactive stations in AP mode.
3023 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
3024 * to work properly to suppport receiving regulatory hints from
3025 * cellular base stations.
3026 * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
3027 * P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
3028 * in the interface combinations, even when it's only used for scan
3029 * and remain-on-channel. This could be due to, for example, the
3030 * remain-on-channel implementation requiring a channel context.
3031 */
3032enum nl80211_feature_flags {
3033 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
3034 NL80211_FEATURE_HT_IBSS = 1 << 1,
3035 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3036 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
3037 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
3038};
3039
3040/**
3041 * enum nl80211_probe_resp_offload_support_attr - optional supported
3042 * protocols for probe-response offloading by the driver/FW.
3043 * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
3044 * Each enum value represents a bit in the bitmap of supported
3045 * protocols. Typically a subset of probe-requests belonging to a
3046 * supported protocol will be excluded from offload and uploaded
3047 * to the host.
3048 *
3049 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1
3050 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2
3051 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P
3052 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u
3053 */
3054enum nl80211_probe_resp_offload_support_attr {
3055 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1<<0,
3056 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1<<1,
3057 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1<<2,
3058 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
3059};
3060
3061/**
3062 * enum nl80211_connect_failed_reason - connection request failed reasons
3063 * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
3064 * handled by the AP is reached.
3065 * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist.
3066 */
3067enum nl80211_connect_failed_reason {
3068 NL80211_CONN_FAIL_MAX_CLIENTS,
3069 NL80211_CONN_FAIL_BLOCKED_CLIENT,
3070};
3071
3072#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index e137b3c486a7..a8696bbdfbc4 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 9189829c131c..cf0ff555a6ac 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/omap3isp.h b/include/linux/omap3isp.h
deleted file mode 100644
index c090cf9249bb..000000000000
--- a/include/linux/omap3isp.h
+++ /dev/null
@@ -1,646 +0,0 @@
1/*
2 * omap3isp.h
3 *
4 * TI OMAP3 ISP - User-space API
5 *
6 * Copyright (C) 2010 Nokia Corporation
7 * Copyright (C) 2009 Texas Instruments, Inc.
8 *
9 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 * Sakari Ailus <sakari.ailus@iki.fi>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 */
26
27#ifndef OMAP3_ISP_USER_H
28#define OMAP3_ISP_USER_H
29
30#include <linux/types.h>
31#include <linux/videodev2.h>
32
33/*
34 * Private IOCTLs
35 *
36 * VIDIOC_OMAP3ISP_CCDC_CFG: Set CCDC configuration
37 * VIDIOC_OMAP3ISP_PRV_CFG: Set preview engine configuration
38 * VIDIOC_OMAP3ISP_AEWB_CFG: Set AEWB module configuration
39 * VIDIOC_OMAP3ISP_HIST_CFG: Set histogram module configuration
40 * VIDIOC_OMAP3ISP_AF_CFG: Set auto-focus module configuration
41 * VIDIOC_OMAP3ISP_STAT_REQ: Read statistics (AEWB/AF/histogram) data
42 * VIDIOC_OMAP3ISP_STAT_EN: Enable/disable a statistics module
43 */
44
45#define VIDIOC_OMAP3ISP_CCDC_CFG \
46 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config)
47#define VIDIOC_OMAP3ISP_PRV_CFG \
48 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config)
49#define VIDIOC_OMAP3ISP_AEWB_CFG \
50 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config)
51#define VIDIOC_OMAP3ISP_HIST_CFG \
52 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config)
53#define VIDIOC_OMAP3ISP_AF_CFG \
54 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
55#define VIDIOC_OMAP3ISP_STAT_REQ \
56 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)
57#define VIDIOC_OMAP3ISP_STAT_EN \
58 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
59
60/*
61 * Events
62 *
63 * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready
64 * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready
65 * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready
66 */
67
68#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
69#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
70#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
71#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
72
73struct omap3isp_stat_event_status {
74 __u32 frame_number;
75 __u16 config_counter;
76 __u8 buf_err;
77};
78
79/* AE/AWB related structures and flags*/
80
81/* H3A Range Constants */
82#define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023
83#define OMAP3ISP_AEWB_MIN_WIN_H 2
84#define OMAP3ISP_AEWB_MAX_WIN_H 256
85#define OMAP3ISP_AEWB_MIN_WIN_W 6
86#define OMAP3ISP_AEWB_MAX_WIN_W 256
87#define OMAP3ISP_AEWB_MIN_WINVC 1
88#define OMAP3ISP_AEWB_MIN_WINHC 1
89#define OMAP3ISP_AEWB_MAX_WINVC 128
90#define OMAP3ISP_AEWB_MAX_WINHC 36
91#define OMAP3ISP_AEWB_MAX_WINSTART 4095
92#define OMAP3ISP_AEWB_MIN_SUB_INC 2
93#define OMAP3ISP_AEWB_MAX_SUB_INC 32
94#define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600
95
96#define OMAP3ISP_AF_IIRSH_MIN 0
97#define OMAP3ISP_AF_IIRSH_MAX 4095
98#define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1
99#define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36
100#define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1
101#define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128
102#define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2
103#define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32
104#define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2
105#define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256
106#define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16
107#define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256
108#define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1
109#define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095
110#define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0
111#define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095
112#define OMAP3ISP_AF_THRESHOLD_MAX 255
113#define OMAP3ISP_AF_COEF_MAX 4095
114#define OMAP3ISP_AF_PAXEL_SIZE 48
115#define OMAP3ISP_AF_MAX_BUF_SIZE 221184
116
117/**
118 * struct omap3isp_h3a_aewb_config - AE AWB configuration reset values
119 * saturation_limit: Saturation limit.
120 * @win_height: Window Height. Range 2 - 256, even values only.
121 * @win_width: Window Width. Range 6 - 256, even values only.
122 * @ver_win_count: Vertical Window Count. Range 1 - 128.
123 * @hor_win_count: Horizontal Window Count. Range 1 - 36.
124 * @ver_win_start: Vertical Window Start. Range 0 - 4095.
125 * @hor_win_start: Horizontal Window Start. Range 0 - 4095.
126 * @blk_ver_win_start: Black Vertical Windows Start. Range 0 - 4095.
127 * @blk_win_height: Black Window Height. Range 2 - 256, even values only.
128 * @subsample_ver_inc: Subsample Vertical points increment Range 2 - 32, even
129 * values only.
130 * @subsample_hor_inc: Subsample Horizontal points increment Range 2 - 32, even
131 * values only.
132 * @alaw_enable: AEW ALAW EN flag.
133 */
134struct omap3isp_h3a_aewb_config {
135 /*
136 * Common fields.
137 * They should be the first ones and must be in the same order as in
138 * ispstat_generic_config struct.
139 */
140 __u32 buf_size;
141 __u16 config_counter;
142
143 /* Private fields */
144 __u16 saturation_limit;
145 __u16 win_height;
146 __u16 win_width;
147 __u16 ver_win_count;
148 __u16 hor_win_count;
149 __u16 ver_win_start;
150 __u16 hor_win_start;
151 __u16 blk_ver_win_start;
152 __u16 blk_win_height;
153 __u16 subsample_ver_inc;
154 __u16 subsample_hor_inc;
155 __u8 alaw_enable;
156};
157
158/**
159 * struct omap3isp_stat_data - Statistic data sent to or received from user
160 * @ts: Timestamp of returned framestats.
161 * @buf: Pointer to pass to user.
162 * @frame_number: Frame number of requested stats.
163 * @cur_frame: Current frame number being processed.
164 * @config_counter: Number of the configuration associated with the data.
165 */
166struct omap3isp_stat_data {
167 struct timeval ts;
168 void __user *buf;
169 __u32 buf_size;
170 __u16 frame_number;
171 __u16 cur_frame;
172 __u16 config_counter;
173};
174
175
176/* Histogram related structs */
177
178/* Flags for number of bins */
179#define OMAP3ISP_HIST_BINS_32 0
180#define OMAP3ISP_HIST_BINS_64 1
181#define OMAP3ISP_HIST_BINS_128 2
182#define OMAP3ISP_HIST_BINS_256 3
183
184/* Number of bins * 4 colors * 4-bytes word */
185#define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4)
186
187#define OMAP3ISP_HIST_MEM_SIZE 1024
188#define OMAP3ISP_HIST_MIN_REGIONS 1
189#define OMAP3ISP_HIST_MAX_REGIONS 4
190#define OMAP3ISP_HIST_MAX_WB_GAIN 255
191#define OMAP3ISP_HIST_MIN_WB_GAIN 0
192#define OMAP3ISP_HIST_MAX_BIT_WIDTH 14
193#define OMAP3ISP_HIST_MIN_BIT_WIDTH 8
194#define OMAP3ISP_HIST_MAX_WG 4
195#define OMAP3ISP_HIST_MAX_BUF_SIZE 4096
196
197/* Source */
198#define OMAP3ISP_HIST_SOURCE_CCDC 0
199#define OMAP3ISP_HIST_SOURCE_MEM 1
200
201/* CFA pattern */
202#define OMAP3ISP_HIST_CFA_BAYER 0
203#define OMAP3ISP_HIST_CFA_FOVEONX3 1
204
205struct omap3isp_hist_region {
206 __u16 h_start;
207 __u16 h_end;
208 __u16 v_start;
209 __u16 v_end;
210};
211
212struct omap3isp_hist_config {
213 /*
214 * Common fields.
215 * They should be the first ones and must be in the same order as in
216 * ispstat_generic_config struct.
217 */
218 __u32 buf_size;
219 __u16 config_counter;
220
221 __u8 num_acc_frames; /* Num of image frames to be processed and
222 accumulated for each histogram frame */
223 __u16 hist_bins; /* number of bins: 32, 64, 128, or 256 */
224 __u8 cfa; /* BAYER or FOVEON X3 */
225 __u8 wg[OMAP3ISP_HIST_MAX_WG]; /* White Balance Gain */
226 __u8 num_regions; /* number of regions to be configured */
227 struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS];
228};
229
230/* Auto Focus related structs */
231
232#define OMAP3ISP_AF_NUM_COEF 11
233
234enum omap3isp_h3a_af_fvmode {
235 OMAP3ISP_AF_MODE_SUMMED = 0,
236 OMAP3ISP_AF_MODE_PEAK = 1
237};
238
239/* Red, Green, and blue pixel location in the AF windows */
240enum omap3isp_h3a_af_rgbpos {
241 OMAP3ISP_AF_GR_GB_BAYER = 0, /* GR and GB as Bayer pattern */
242 OMAP3ISP_AF_RG_GB_BAYER = 1, /* RG and GB as Bayer pattern */
243 OMAP3ISP_AF_GR_BG_BAYER = 2, /* GR and BG as Bayer pattern */
244 OMAP3ISP_AF_RG_BG_BAYER = 3, /* RG and BG as Bayer pattern */
245 OMAP3ISP_AF_GG_RB_CUSTOM = 4, /* GG and RB as custom pattern */
246 OMAP3ISP_AF_RB_GG_CUSTOM = 5 /* RB and GG as custom pattern */
247};
248
249/* Contains the information regarding the Horizontal Median Filter */
250struct omap3isp_h3a_af_hmf {
251 __u8 enable; /* Status of Horizontal Median Filter */
252 __u8 threshold; /* Threshold Value for Horizontal Median Filter */
253};
254
255/* Contains the information regarding the IIR Filters */
256struct omap3isp_h3a_af_iir {
257 __u16 h_start; /* IIR horizontal start */
258 __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF]; /* Filter coefficient, set 0 */
259 __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF]; /* Filter coefficient, set 1 */
260};
261
262/* Contains the information regarding the Paxels Structure in AF Engine */
263struct omap3isp_h3a_af_paxel {
264 __u16 h_start; /* Horizontal Start Position */
265 __u16 v_start; /* Vertical Start Position */
266 __u8 width; /* Width of the Paxel */
267 __u8 height; /* Height of the Paxel */
268 __u8 h_cnt; /* Horizontal Count */
269 __u8 v_cnt; /* vertical Count */
270 __u8 line_inc; /* Line Increment */
271};
272
273/* Contains the parameters required for hardware set up of AF Engine */
274struct omap3isp_h3a_af_config {
275 /*
276 * Common fields.
277 * They should be the first ones and must be in the same order as in
278 * ispstat_generic_config struct.
279 */
280 __u32 buf_size;
281 __u16 config_counter;
282
283 struct omap3isp_h3a_af_hmf hmf; /* HMF configurations */
284 struct omap3isp_h3a_af_iir iir; /* IIR filter configurations */
285 struct omap3isp_h3a_af_paxel paxel; /* Paxel parameters */
286 enum omap3isp_h3a_af_rgbpos rgb_pos; /* RGB Positions */
287 enum omap3isp_h3a_af_fvmode fvmode; /* Accumulator mode */
288 __u8 alaw_enable; /* AF ALAW status */
289};
290
291/* ISP CCDC structs */
292
293/* Abstraction layer CCDC configurations */
294#define OMAP3ISP_CCDC_ALAW (1 << 0)
295#define OMAP3ISP_CCDC_LPF (1 << 1)
296#define OMAP3ISP_CCDC_BLCLAMP (1 << 2)
297#define OMAP3ISP_CCDC_BCOMP (1 << 3)
298#define OMAP3ISP_CCDC_FPC (1 << 4)
299#define OMAP3ISP_CCDC_CULL (1 << 5)
300#define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7)
301#define OMAP3ISP_CCDC_TBL_LSC (1 << 8)
302
303#define OMAP3ISP_RGB_MAX 3
304
305/* Enumeration constants for Alaw input width */
306enum omap3isp_alaw_ipwidth {
307 OMAP3ISP_ALAW_BIT12_3 = 0x3,
308 OMAP3ISP_ALAW_BIT11_2 = 0x4,
309 OMAP3ISP_ALAW_BIT10_1 = 0x5,
310 OMAP3ISP_ALAW_BIT9_0 = 0x6
311};
312
313/**
314 * struct omap3isp_ccdc_lsc_config - LSC configuration
315 * @offset: Table Offset of the gain table.
316 * @gain_mode_n: Vertical dimension of a paxel in LSC configuration.
317 * @gain_mode_m: Horizontal dimension of a paxel in LSC configuration.
318 * @gain_format: Gain table format.
319 * @fmtsph: Start pixel horizontal from start of the HS sync pulse.
320 * @fmtlnh: Number of pixels in horizontal direction to use for the data
321 * reformatter.
322 * @fmtslv: Start line from start of VS sync pulse for the data reformatter.
323 * @fmtlnv: Number of lines in vertical direction for the data reformatter.
324 * @initial_x: X position, in pixels, of the first active pixel in reference
325 * to the first active paxel. Must be an even number.
326 * @initial_y: Y position, in pixels, of the first active pixel in reference
327 * to the first active paxel. Must be an even number.
328 * @size: Size of LSC gain table. Filled when loaded from userspace.
329 */
330struct omap3isp_ccdc_lsc_config {
331 __u16 offset;
332 __u8 gain_mode_n;
333 __u8 gain_mode_m;
334 __u8 gain_format;
335 __u16 fmtsph;
336 __u16 fmtlnh;
337 __u16 fmtslv;
338 __u16 fmtlnv;
339 __u8 initial_x;
340 __u8 initial_y;
341 __u32 size;
342};
343
344/**
345 * struct omap3isp_ccdc_bclamp - Optical & Digital black clamp subtract
346 * @obgain: Optical black average gain.
347 * @obstpixel: Start Pixel w.r.t. HS pulse in Optical black sample.
348 * @oblines: Optical Black Sample lines.
349 * @oblen: Optical Black Sample Length.
350 * @dcsubval: Digital Black Clamp subtract value.
351 */
352struct omap3isp_ccdc_bclamp {
353 __u8 obgain;
354 __u8 obstpixel;
355 __u8 oblines;
356 __u8 oblen;
357 __u16 dcsubval;
358};
359
360/**
361 * struct omap3isp_ccdc_fpc - Faulty Pixels Correction
362 * @fpnum: Number of faulty pixels to be corrected in the frame.
363 * @fpcaddr: Memory address of the FPC Table
364 */
365struct omap3isp_ccdc_fpc {
366 __u16 fpnum;
367 __u32 fpcaddr;
368};
369
370/**
371 * struct omap3isp_ccdc_blcomp - Black Level Compensation parameters
372 * @b_mg: B/Mg pixels. 2's complement. -128 to +127.
373 * @gb_g: Gb/G pixels. 2's complement. -128 to +127.
374 * @gr_cy: Gr/Cy pixels. 2's complement. -128 to +127.
375 * @r_ye: R/Ye pixels. 2's complement. -128 to +127.
376 */
377struct omap3isp_ccdc_blcomp {
378 __u8 b_mg;
379 __u8 gb_g;
380 __u8 gr_cy;
381 __u8 r_ye;
382};
383
384/**
385 * omap3isp_ccdc_culling - Culling parameters
386 * @v_pattern: Vertical culling pattern.
387 * @h_odd: Horizontal Culling pattern for odd lines.
388 * @h_even: Horizontal Culling pattern for even lines.
389 */
390struct omap3isp_ccdc_culling {
391 __u8 v_pattern;
392 __u16 h_odd;
393 __u16 h_even;
394};
395
396/**
397 * omap3isp_ccdc_update_config - CCDC configuration
398 * @update: Specifies which CCDC registers should be updated.
399 * @flag: Specifies which CCDC functions should be enabled.
400 * @alawip: Enable/Disable A-Law compression.
401 * @bclamp: Black clamp control register.
402 * @blcomp: Black level compensation value for RGrGbB Pixels. 2's complement.
403 * @fpc: Number of faulty pixels corrected in the frame, address of FPC table.
404 * @cull: Cull control register.
405 * @lsc: Pointer to LSC gain table.
406 */
407struct omap3isp_ccdc_update_config {
408 __u16 update;
409 __u16 flag;
410 enum omap3isp_alaw_ipwidth alawip;
411 struct omap3isp_ccdc_bclamp __user *bclamp;
412 struct omap3isp_ccdc_blcomp __user *blcomp;
413 struct omap3isp_ccdc_fpc __user *fpc;
414 struct omap3isp_ccdc_lsc_config __user *lsc_cfg;
415 struct omap3isp_ccdc_culling __user *cull;
416 __u8 __user *lsc;
417};
418
419/* Preview configurations */
420#define OMAP3ISP_PREV_LUMAENH (1 << 0)
421#define OMAP3ISP_PREV_INVALAW (1 << 1)
422#define OMAP3ISP_PREV_HRZ_MED (1 << 2)
423#define OMAP3ISP_PREV_CFA (1 << 3)
424#define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4)
425#define OMAP3ISP_PREV_WB (1 << 5)
426#define OMAP3ISP_PREV_BLKADJ (1 << 6)
427#define OMAP3ISP_PREV_RGB2RGB (1 << 7)
428#define OMAP3ISP_PREV_COLOR_CONV (1 << 8)
429#define OMAP3ISP_PREV_YC_LIMIT (1 << 9)
430#define OMAP3ISP_PREV_DEFECT_COR (1 << 10)
431/* Bit 11 was OMAP3ISP_PREV_GAMMABYPASS, now merged with OMAP3ISP_PREV_GAMMA */
432#define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12)
433#define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13)
434#define OMAP3ISP_PREV_LENS_SHADING (1 << 14)
435#define OMAP3ISP_PREV_NF (1 << 15)
436#define OMAP3ISP_PREV_GAMMA (1 << 16)
437
438#define OMAP3ISP_PREV_NF_TBL_SIZE 64
439#define OMAP3ISP_PREV_CFA_TBL_SIZE 576
440#define OMAP3ISP_PREV_CFA_BLK_SIZE (OMAP3ISP_PREV_CFA_TBL_SIZE / 4)
441#define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024
442#define OMAP3ISP_PREV_YENH_TBL_SIZE 128
443
444#define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4
445
446/**
447 * struct omap3isp_prev_hmed - Horizontal Median Filter
448 * @odddist: Distance between consecutive pixels of same color in the odd line.
449 * @evendist: Distance between consecutive pixels of same color in the even
450 * line.
451 * @thres: Horizontal median filter threshold.
452 */
453struct omap3isp_prev_hmed {
454 __u8 odddist;
455 __u8 evendist;
456 __u8 thres;
457};
458
459/*
460 * Enumeration for CFA Formats supported by preview
461 */
462enum omap3isp_cfa_fmt {
463 OMAP3ISP_CFAFMT_BAYER,
464 OMAP3ISP_CFAFMT_SONYVGA,
465 OMAP3ISP_CFAFMT_RGBFOVEON,
466 OMAP3ISP_CFAFMT_DNSPL,
467 OMAP3ISP_CFAFMT_HONEYCOMB,
468 OMAP3ISP_CFAFMT_RRGGBBFOVEON
469};
470
471/**
472 * struct omap3isp_prev_cfa - CFA Interpolation
473 * @format: CFA Format Enum value supported by preview.
474 * @gradthrs_vert: CFA Gradient Threshold - Vertical.
475 * @gradthrs_horz: CFA Gradient Threshold - Horizontal.
476 * @table: Pointer to the CFA table.
477 */
478struct omap3isp_prev_cfa {
479 enum omap3isp_cfa_fmt format;
480 __u8 gradthrs_vert;
481 __u8 gradthrs_horz;
482 __u32 table[4][OMAP3ISP_PREV_CFA_BLK_SIZE];
483};
484
485/**
486 * struct omap3isp_prev_csup - Chrominance Suppression
487 * @gain: Gain.
488 * @thres: Threshold.
489 * @hypf_en: Flag to enable/disable the High Pass Filter.
490 */
491struct omap3isp_prev_csup {
492 __u8 gain;
493 __u8 thres;
494 __u8 hypf_en;
495};
496
497/**
498 * struct omap3isp_prev_wbal - White Balance
499 * @dgain: Digital gain (U10Q8).
500 * @coef3: White balance gain - COEF 3 (U8Q5).
501 * @coef2: White balance gain - COEF 2 (U8Q5).
502 * @coef1: White balance gain - COEF 1 (U8Q5).
503 * @coef0: White balance gain - COEF 0 (U8Q5).
504 */
505struct omap3isp_prev_wbal {
506 __u16 dgain;
507 __u8 coef3;
508 __u8 coef2;
509 __u8 coef1;
510 __u8 coef0;
511};
512
513/**
514 * struct omap3isp_prev_blkadj - Black Level Adjustment
515 * @red: Black level offset adjustment for Red in 2's complement format
516 * @green: Black level offset adjustment for Green in 2's complement format
517 * @blue: Black level offset adjustment for Blue in 2's complement format
518 */
519struct omap3isp_prev_blkadj {
520 /*Black level offset adjustment for Red in 2's complement format */
521 __u8 red;
522 /*Black level offset adjustment for Green in 2's complement format */
523 __u8 green;
524 /* Black level offset adjustment for Blue in 2's complement format */
525 __u8 blue;
526};
527
528/**
529 * struct omap3isp_prev_rgbtorgb - RGB to RGB Blending
530 * @matrix: Blending values(S12Q8 format)
531 * [RR] [GR] [BR]
532 * [RG] [GG] [BG]
533 * [RB] [GB] [BB]
534 * @offset: Blending offset value for R,G,B in 2's complement integer format.
535 */
536struct omap3isp_prev_rgbtorgb {
537 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
538 __u16 offset[OMAP3ISP_RGB_MAX];
539};
540
541/**
542 * struct omap3isp_prev_csc - Color Space Conversion from RGB-YCbYCr
543 * @matrix: Color space conversion coefficients(S10Q8)
544 * [CSCRY] [CSCGY] [CSCBY]
545 * [CSCRCB] [CSCGCB] [CSCBCB]
546 * [CSCRCR] [CSCGCR] [CSCBCR]
547 * @offset: CSC offset values for Y offset, CB offset and CR offset respectively
548 */
549struct omap3isp_prev_csc {
550 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
551 __s16 offset[OMAP3ISP_RGB_MAX];
552};
553
554/**
555 * struct omap3isp_prev_yclimit - Y, C Value Limit
556 * @minC: Minimum C value
557 * @maxC: Maximum C value
558 * @minY: Minimum Y value
559 * @maxY: Maximum Y value
560 */
561struct omap3isp_prev_yclimit {
562 __u8 minC;
563 __u8 maxC;
564 __u8 minY;
565 __u8 maxY;
566};
567
568/**
569 * struct omap3isp_prev_dcor - Defect correction
570 * @couplet_mode_en: Flag to enable or disable the couplet dc Correction in NF
571 * @detect_correct: Thresholds for correction bit 0:10 detect 16:25 correct
572 */
573struct omap3isp_prev_dcor {
574 __u8 couplet_mode_en;
575 __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS];
576};
577
578/**
579 * struct omap3isp_prev_nf - Noise Filter
580 * @spread: Spread value to be used in Noise Filter
581 * @table: Pointer to the Noise Filter table
582 */
583struct omap3isp_prev_nf {
584 __u8 spread;
585 __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE];
586};
587
588/**
589 * struct omap3isp_prev_gtables - Gamma correction tables
590 * @red: Array for red gamma table.
591 * @green: Array for green gamma table.
592 * @blue: Array for blue gamma table.
593 */
594struct omap3isp_prev_gtables {
595 __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
596 __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
597 __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
598};
599
600/**
601 * struct omap3isp_prev_luma - Luma enhancement
602 * @table: Array for luma enhancement table.
603 */
604struct omap3isp_prev_luma {
605 __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE];
606};
607
608/**
609 * struct omap3isp_prev_update_config - Preview engine configuration (user)
610 * @update: Specifies which ISP Preview registers should be updated.
611 * @flag: Specifies which ISP Preview functions should be enabled.
612 * @shading_shift: 3bit value of shift used in shading compensation.
613 * @luma: Pointer to luma enhancement structure.
614 * @hmed: Pointer to structure containing the odd and even distance.
615 * between the pixels in the image along with the filter threshold.
616 * @cfa: Pointer to structure containing the CFA interpolation table, CFA.
617 * format in the image, vertical and horizontal gradient threshold.
618 * @csup: Pointer to Structure for Chrominance Suppression coefficients.
619 * @wbal: Pointer to structure for White Balance.
620 * @blkadj: Pointer to structure for Black Adjustment.
621 * @rgb2rgb: Pointer to structure for RGB to RGB Blending.
622 * @csc: Pointer to structure for Color Space Conversion from RGB-YCbYCr.
623 * @yclimit: Pointer to structure for Y, C Value Limit.
624 * @dcor: Pointer to structure for defect correction.
625 * @nf: Pointer to structure for Noise Filter
626 * @gamma: Pointer to gamma structure.
627 */
628struct omap3isp_prev_update_config {
629 __u32 update;
630 __u32 flag;
631 __u32 shading_shift;
632 struct omap3isp_prev_luma __user *luma;
633 struct omap3isp_prev_hmed __user *hmed;
634 struct omap3isp_prev_cfa __user *cfa;
635 struct omap3isp_prev_csup __user *csup;
636 struct omap3isp_prev_wbal __user *wbal;
637 struct omap3isp_prev_blkadj __user *blkadj;
638 struct omap3isp_prev_rgbtorgb __user *rgb2rgb;
639 struct omap3isp_prev_csc __user *csc;
640 struct omap3isp_prev_yclimit __user *yclimit;
641 struct omap3isp_prev_dcor __user *dcor;
642 struct omap3isp_prev_nf __user *nf;
643 struct omap3isp_prev_gtables __user *gamma;
644};
645
646#endif /* OMAP3_ISP_USER_H */
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index 85af8184691a..d1f4dccaeede 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 d36a8221f58b..fb9826847b89 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/packet_diag.h b/include/linux/packet_diag.h
deleted file mode 100644
index 93f5fa94a431..000000000000
--- a/include/linux/packet_diag.h
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifndef __PACKET_DIAG_H__
2#define __PACKET_DIAG_H__
3
4#include <linux/types.h>
5
6struct packet_diag_req {
7 __u8 sdiag_family;
8 __u8 sdiag_protocol;
9 __u16 pad;
10 __u32 pdiag_ino;
11 __u32 pdiag_show;
12 __u32 pdiag_cookie[2];
13};
14
15#define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */
16#define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */
17#define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */
18#define PACKET_SHOW_FANOUT 0x00000008
19
20struct packet_diag_msg {
21 __u8 pdiag_family;
22 __u8 pdiag_type;
23 __u16 pdiag_num;
24
25 __u32 pdiag_ino;
26 __u32 pdiag_cookie[2];
27};
28
29enum {
30 PACKET_DIAG_INFO,
31 PACKET_DIAG_MCLIST,
32 PACKET_DIAG_RX_RING,
33 PACKET_DIAG_TX_RING,
34 PACKET_DIAG_FANOUT,
35
36 PACKET_DIAG_MAX,
37};
38
39struct packet_diag_info {
40 __u32 pdi_index;
41 __u32 pdi_version;
42 __u32 pdi_reserve;
43 __u32 pdi_copy_thresh;
44 __u32 pdi_tstamp;
45 __u32 pdi_flags;
46
47#define PDI_RUNNING 0x1
48#define PDI_AUXDATA 0x2
49#define PDI_ORIGDEV 0x4
50#define PDI_VNETHDR 0x8
51#define PDI_LOSS 0x10
52};
53
54struct packet_diag_mclist {
55 __u32 pdmc_index;
56 __u32 pdmc_count;
57 __u16 pdmc_type;
58 __u16 pdmc_alen;
59 __u8 pdmc_addr[MAX_ADDR_LEN];
60};
61
62struct packet_diag_ring {
63 __u32 pdr_block_size;
64 __u32 pdr_block_nr;
65 __u32 pdr_frame_size;
66 __u32 pdr_frame_nr;
67 __u32 pdr_retire_tmo;
68 __u32 pdr_sizeof_priv;
69 __u32 pdr_features;
70};
71
72#endif
diff --git a/include/linux/param.h b/include/linux/param.h
deleted file mode 100644
index 092e92f67b50..000000000000
--- a/include/linux/param.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _LINUX_PARAM_H
2#define _LINUX_PARAM_H
3
4#include <asm/param.h>
5
6#endif
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 106c2ca9440b..c22f12547324 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 aefda0ec6e62..97a919fc9927 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 be1de01de1c4..ee2179546c63 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/pci_regs.h b/include/linux/pci_regs.h
deleted file mode 100644
index 20ae747ddf34..000000000000
--- a/include/linux/pci_regs.h
+++ /dev/null
@@ -1,846 +0,0 @@
1/*
2 * pci_regs.h
3 *
4 * PCI standard defines
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 * For hypertransport information, please consult the following manuals
17 * from http://www.hypertransport.org
18 *
19 * The Hypertransport I/O Link Specification
20 */
21
22#ifndef LINUX_PCI_REGS_H
23#define LINUX_PCI_REGS_H
24
25/*
26 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows:
28 */
29#define PCI_STD_HEADER_SIZEOF 64
30#define PCI_VENDOR_ID 0x00 /* 16 bits */
31#define PCI_DEVICE_ID 0x02 /* 16 bits */
32#define PCI_COMMAND 0x04 /* 16 bits */
33#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
34#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
35#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
36#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
37#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
38#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
39#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
40#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
41#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
42#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
43#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
44
45#define PCI_STATUS 0x06 /* 16 bits */
46#define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */
47#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
48#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
49#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
50#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
51#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
52#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
53#define PCI_STATUS_DEVSEL_FAST 0x000
54#define PCI_STATUS_DEVSEL_MEDIUM 0x200
55#define PCI_STATUS_DEVSEL_SLOW 0x400
56#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
57#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
58#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
59#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
60#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
61
62#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
63#define PCI_REVISION_ID 0x08 /* Revision ID */
64#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
65#define PCI_CLASS_DEVICE 0x0a /* Device class */
66
67#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
68#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
69#define PCI_HEADER_TYPE 0x0e /* 8 bits */
70#define PCI_HEADER_TYPE_NORMAL 0
71#define PCI_HEADER_TYPE_BRIDGE 1
72#define PCI_HEADER_TYPE_CARDBUS 2
73
74#define PCI_BIST 0x0f /* 8 bits */
75#define PCI_BIST_CODE_MASK 0x0f /* Return result */
76#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
77#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
78
79/*
80 * Base addresses specify locations in memory or I/O space.
81 * Decoded size can be determined by writing a value of
82 * 0xffffffff to the register, and reading it back. Only
83 * 1 bits are decoded.
84 */
85#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
86#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
87#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
88#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
89#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
90#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
91#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
92#define PCI_BASE_ADDRESS_SPACE_IO 0x01
93#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
94#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
95#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
96#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
97#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
98#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
99#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
100#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
101/* bit 1 is reserved if address_space = 1 */
102
103/* Header type 0 (normal devices) */
104#define PCI_CARDBUS_CIS 0x28
105#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
106#define PCI_SUBSYSTEM_ID 0x2e
107#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
108#define PCI_ROM_ADDRESS_ENABLE 0x01
109#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
110
111#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
112
113/* 0x35-0x3b are reserved */
114#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
115#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
116#define PCI_MIN_GNT 0x3e /* 8 bits */
117#define PCI_MAX_LAT 0x3f /* 8 bits */
118
119/* Header type 1 (PCI-to-PCI bridges) */
120#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
121#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
122#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
123#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
124#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
125#define PCI_IO_LIMIT 0x1d
126#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
127#define PCI_IO_RANGE_TYPE_16 0x00
128#define PCI_IO_RANGE_TYPE_32 0x01
129#define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */
130#define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */
131#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
132#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
133#define PCI_MEMORY_LIMIT 0x22
134#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
135#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
136#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
137#define PCI_PREF_MEMORY_LIMIT 0x26
138#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
139#define PCI_PREF_RANGE_TYPE_32 0x00
140#define PCI_PREF_RANGE_TYPE_64 0x01
141#define PCI_PREF_RANGE_MASK (~0x0fUL)
142#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
143#define PCI_PREF_LIMIT_UPPER32 0x2c
144#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
145#define PCI_IO_LIMIT_UPPER16 0x32
146/* 0x34 same as for htype 0 */
147/* 0x35-0x3b is reserved */
148#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
149/* 0x3c-0x3d are same as for htype 0 */
150#define PCI_BRIDGE_CONTROL 0x3e
151#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
152#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
153#define PCI_BRIDGE_CTL_ISA 0x04 /* Enable ISA mode */
154#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
155#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
156#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
157#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
158
159/* Header type 2 (CardBus bridges) */
160#define PCI_CB_CAPABILITY_LIST 0x14
161/* 0x15 reserved */
162#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
163#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
164#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
165#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
166#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
167#define PCI_CB_MEMORY_BASE_0 0x1c
168#define PCI_CB_MEMORY_LIMIT_0 0x20
169#define PCI_CB_MEMORY_BASE_1 0x24
170#define PCI_CB_MEMORY_LIMIT_1 0x28
171#define PCI_CB_IO_BASE_0 0x2c
172#define PCI_CB_IO_BASE_0_HI 0x2e
173#define PCI_CB_IO_LIMIT_0 0x30
174#define PCI_CB_IO_LIMIT_0_HI 0x32
175#define PCI_CB_IO_BASE_1 0x34
176#define PCI_CB_IO_BASE_1_HI 0x36
177#define PCI_CB_IO_LIMIT_1 0x38
178#define PCI_CB_IO_LIMIT_1_HI 0x3a
179#define PCI_CB_IO_RANGE_MASK (~0x03UL)
180/* 0x3c-0x3d are same as for htype 0 */
181#define PCI_CB_BRIDGE_CONTROL 0x3e
182#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
183#define PCI_CB_BRIDGE_CTL_SERR 0x02
184#define PCI_CB_BRIDGE_CTL_ISA 0x04
185#define PCI_CB_BRIDGE_CTL_VGA 0x08
186#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
187#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
188#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
189#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
190#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
191#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
192#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
193#define PCI_CB_SUBSYSTEM_ID 0x42
194#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
195/* 0x48-0x7f reserved */
196
197/* Capability lists */
198
199#define PCI_CAP_LIST_ID 0 /* Capability ID */
200#define PCI_CAP_ID_PM 0x01 /* Power Management */
201#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
202#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
203#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
204#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
205#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
206#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
207#define PCI_CAP_ID_HT 0x08 /* HyperTransport */
208#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */
209#define PCI_CAP_ID_DBG 0x0A /* Debug port */
210#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */
211#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
212#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
213#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
214#define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */
215#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
216#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
217#define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */
218#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
219#define PCI_CAP_ID_MAX PCI_CAP_ID_AF
220#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
221#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
222#define PCI_CAP_SIZEOF 4
223
224/* Power Management Registers */
225
226#define PCI_PM_PMC 2 /* PM Capabilities Register */
227#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
228#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
229#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
230#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
231#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxiliary power support mask */
232#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
233#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
234#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
235#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
236#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
237#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
238#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
239#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
240#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
241#define PCI_PM_CAP_PME_SHIFT 11 /* Start of the PME Mask in PMC */
242#define PCI_PM_CTRL 4 /* PM control and status register */
243#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
244#define PCI_PM_CTRL_NO_SOFT_RESET 0x0008 /* No reset for D3hot->D0 */
245#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
246#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
247#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
248#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
249#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
250#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
251#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
252#define PCI_PM_DATA_REGISTER 7 /* (??) */
253#define PCI_PM_SIZEOF 8
254
255/* AGP registers */
256
257#define PCI_AGP_VERSION 2 /* BCD version number */
258#define PCI_AGP_RFU 3 /* Rest of capability flags */
259#define PCI_AGP_STATUS 4 /* Status register */
260#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
261#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
262#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
263#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
264#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
265#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
266#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
267#define PCI_AGP_COMMAND 8 /* Control register */
268#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
269#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
270#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
271#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
272#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
273#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
274#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
275#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
276#define PCI_AGP_SIZEOF 12
277
278/* Vital Product Data */
279
280#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
281#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
282#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
283#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
284#define PCI_CAP_VPD_SIZEOF 8
285
286/* Slot Identification */
287
288#define PCI_SID_ESR 2 /* Expansion Slot Register */
289#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
290#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
291#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
292
293/* Message Signalled Interrupts registers */
294
295#define PCI_MSI_FLAGS 2 /* Various flags */
296#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
297#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
298#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
299#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
300#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
301#define PCI_MSI_RFU 3 /* Rest of capability flags */
302#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
304#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
305#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
306#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
307#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
308#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
310
311/* MSI-X registers */
312#define PCI_MSIX_FLAGS 2
313#define PCI_MSIX_FLAGS_QSIZE 0x7FF
314#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
315#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
316#define PCI_MSIX_TABLE 4
317#define PCI_MSIX_PBA 8
318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
320
321/* MSI-X entry's format */
322#define PCI_MSIX_ENTRY_SIZE 16
323#define PCI_MSIX_ENTRY_LOWER_ADDR 0
324#define PCI_MSIX_ENTRY_UPPER_ADDR 4
325#define PCI_MSIX_ENTRY_DATA 8
326#define PCI_MSIX_ENTRY_VECTOR_CTRL 12
327#define PCI_MSIX_ENTRY_CTRL_MASKBIT 1
328
329/* CompactPCI Hotswap Register */
330
331#define PCI_CHSWP_CSR 2 /* Control and Status Register */
332#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
333#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
334#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
335#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
336#define PCI_CHSWP_PI 0x30 /* Programming Interface */
337#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
338#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
339
340/* PCI Advanced Feature registers */
341
342#define PCI_AF_LENGTH 2
343#define PCI_AF_CAP 3
344#define PCI_AF_CAP_TP 0x01
345#define PCI_AF_CAP_FLR 0x02
346#define PCI_AF_CTRL 4
347#define PCI_AF_CTRL_FLR 0x01
348#define PCI_AF_STATUS 5
349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
351
352/* PCI-X registers */
353
354#define PCI_X_CMD 2 /* Modes & Features */
355#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
356#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
357#define PCI_X_CMD_READ_512 0x0000 /* 512 byte maximum read byte count */
358#define PCI_X_CMD_READ_1K 0x0004 /* 1Kbyte maximum read byte count */
359#define PCI_X_CMD_READ_2K 0x0008 /* 2Kbyte maximum read byte count */
360#define PCI_X_CMD_READ_4K 0x000c /* 4Kbyte maximum read byte count */
361#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
362 /* Max # of outstanding split transactions */
363#define PCI_X_CMD_SPLIT_1 0x0000 /* Max 1 */
364#define PCI_X_CMD_SPLIT_2 0x0010 /* Max 2 */
365#define PCI_X_CMD_SPLIT_3 0x0020 /* Max 3 */
366#define PCI_X_CMD_SPLIT_4 0x0030 /* Max 4 */
367#define PCI_X_CMD_SPLIT_8 0x0040 /* Max 8 */
368#define PCI_X_CMD_SPLIT_12 0x0050 /* Max 12 */
369#define PCI_X_CMD_SPLIT_16 0x0060 /* Max 16 */
370#define PCI_X_CMD_SPLIT_32 0x0070 /* Max 32 */
371#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
372#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
373#define PCI_X_STATUS 4 /* PCI-X capabilities */
374#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
375#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
376#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
377#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
378#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
379#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
380#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
381#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
382#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
383#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
384#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
385#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
386#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
387#define PCI_X_ECC_CSR 8 /* ECC control and status */
388#define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
391
392/* PCI Bridge Subsystem ID registers */
393
394#define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */
395#define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */
396
397/* PCI Express capability registers */
398
399#define PCI_EXP_FLAGS 2 /* Capabilities register */
400#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
401#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
402#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
403#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
404#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
405#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
406#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
407#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
408#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIE Bridge */
409#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */
410#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
411#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
412#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
413#define PCI_EXP_DEVCAP 4 /* Device capabilities */
414#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
415#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
416#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
417#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
418#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
419#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
420#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
421#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
422#define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */
423#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
424#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
425#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
426#define PCI_EXP_DEVCTL 8 /* Device Control */
427#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
428#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
429#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
430#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
431#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
432#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
433#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
434#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
435#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
436#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
437#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
438#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */
439#define PCI_EXP_DEVSTA 10 /* Device Status */
440#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
441#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
442#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
443#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
444#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
445#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
446#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
447#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
448#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
449#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
450#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
451#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */
452#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* L1 Clock Power Management */
453#define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Surprise Down Error Reporting Capable */
454#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */
455#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */
456#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
457#define PCI_EXP_LNKCTL 16 /* Link Control */
458#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
459#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */
460#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */
461#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */
462#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */
463#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */
464#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
465#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
466#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
467#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */
468#define PCI_EXP_LNKSTA 18 /* Link Status */
469#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
470#define PCI_EXP_LNKSTA_CLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */
471#define PCI_EXP_LNKSTA_CLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */
472#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */
473#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
474#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
475#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
476#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
477#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
478#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
479#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */
480#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
481#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
482#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
483#define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */
484#define PCI_EXP_SLTCAP_AIP 0x00000008 /* Attention Indicator Present */
485#define PCI_EXP_SLTCAP_PIP 0x00000010 /* Power Indicator Present */
486#define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */
487#define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */
488#define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */
489#define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */
490#define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */
491#define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */
492#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */
493#define PCI_EXP_SLTCTL 24 /* Slot Control */
494#define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */
495#define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */
496#define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */
497#define PCI_EXP_SLTCTL_PDCE 0x0008 /* Presence Detect Changed Enable */
498#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */
499#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */
500#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */
501#define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */
502#define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */
503#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
504#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
505#define PCI_EXP_SLTSTA 26 /* Slot Status */
506#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
507#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */
508#define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */
509#define PCI_EXP_SLTSTA_PDC 0x0008 /* Presence Detect Changed */
510#define PCI_EXP_SLTSTA_CC 0x0010 /* Command Completed */
511#define PCI_EXP_SLTSTA_MRLSS 0x0020 /* MRL Sensor State */
512#define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */
513#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
514#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */
515#define PCI_EXP_RTCTL 28 /* Root Control */
516#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
517#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
518#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
519#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
520#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
521#define PCI_EXP_RTCAP 30 /* Root Capabilities */
522#define PCI_EXP_RTSTA 32 /* Root Status */
523#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */
524#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */
525/*
526 * Note that the following PCI Express 'Capability Structure' registers
527 * were introduced with 'Capability Version' 0x2 (v2). These registers
528 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2()
529 * to use these fields safely.
530 */
531#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
532#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
533#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */
534#define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */
535#define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */
536#define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */
537#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
538#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */
539#define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */
540#define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */
541#define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */
542#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */
543#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */
544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
546#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */
547#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */
548#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */
549#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */
550#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */
551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
552#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
553#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
554
555/* Extended Capabilities (PCI-X 2.0 and Express) */
556#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
557#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
558#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
559
560#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */
561#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */
562#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */
563#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */
564#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */
565#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */
566#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */
567#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */
568#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */
569#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */
570#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */
571#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */
572#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */
573#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */
574#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */
575#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */
576#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */
577#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */
578#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */
579#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */
580#define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */
581#define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */
582#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */
583#define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */
584#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */
585#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */
586#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */
587#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID
588
589#define PCI_EXT_CAP_DSN_SIZEOF 12
590#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
591
592/* Advanced Error Reporting */
593#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
594#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
595#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
596#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
597#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
598#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
599#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
600#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
601#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
602#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
603#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
604#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
605#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
606#define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */
607#define PCI_ERR_UNC_INTN 0x00400000 /* internal error */
608#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
609#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
610#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
611#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
612 /* Same bits as above */
613#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
614 /* Same bits as above */
615#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
616#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
617#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
618#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
619#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
620#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
621#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
622#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
623#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
624#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
625 /* Same bits as above */
626#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
627#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
628#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
629#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
630#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
631#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
632#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
633#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
634/* Correctable Err Reporting Enable */
635#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
636/* Non-fatal Err Reporting Enable */
637#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
638/* Fatal Err Reporting Enable */
639#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
640#define PCI_ERR_ROOT_STATUS 48
641#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
642/* Multi ERR_COR Received */
643#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
644/* ERR_FATAL/NONFATAL Recevied */
645#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
646/* Multi ERR_FATAL/NONFATAL Recevied */
647#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
648#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
649#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
650#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
651#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
652
653/* Virtual Channel */
654#define PCI_VC_PORT_REG1 4
655#define PCI_VC_REG1_EVCC 0x7 /* extended vc count */
656#define PCI_VC_PORT_REG2 8
657#define PCI_VC_REG2_32_PHASE 0x2
658#define PCI_VC_REG2_64_PHASE 0x4
659#define PCI_VC_REG2_128_PHASE 0x8
660#define PCI_VC_PORT_CTRL 12
661#define PCI_VC_PORT_STATUS 14
662#define PCI_VC_RES_CAP 16
663#define PCI_VC_RES_CTRL 20
664#define PCI_VC_RES_STATUS 26
665#define PCI_CAP_VC_BASE_SIZEOF 0x10
666#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
667
668/* Power Budgeting */
669#define PCI_PWR_DSR 4 /* Data Select Register */
670#define PCI_PWR_DATA 8 /* Data Register */
671#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
672#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
673#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
674#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
675#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
676#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
677#define PCI_PWR_CAP 12 /* Capability */
678#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
679#define PCI_EXT_CAP_PWR_SIZEOF 16
680
681/* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */
682#define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */
683#define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff)
684#define PCI_VNDR_HEADER_REV(x) (((x) >> 16) & 0xf)
685#define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff)
686
687/*
688 * Hypertransport sub capability types
689 *
690 * Unfortunately there are both 3 bit and 5 bit capability types defined
691 * in the HT spec, catering for that is a little messy. You probably don't
692 * want to use these directly, just use pci_find_ht_capability() and it
693 * will do the right thing for you.
694 */
695#define HT_3BIT_CAP_MASK 0xE0
696#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
697#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
698
699#define HT_5BIT_CAP_MASK 0xF8
700#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
701#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
702#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
703#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
704#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
705#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
706#define HT_MSI_FLAGS 0x02 /* Offset to flags */
707#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */
708#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */
709#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */
710#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */
711#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */
712#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */
713#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
714#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
715#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
716#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
717#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
718#define HT_CAP_SIZEOF_LONG 28 /* slave & primary */
719#define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */
720
721/* Alternative Routing-ID Interpretation */
722#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
723#define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */
724#define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */
725#define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */
726#define PCI_ARI_CTRL 0x06 /* ARI Control Register */
727#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
728#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
729#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
730#define PCI_EXT_CAP_ARI_SIZEOF 8
731
732/* Address Translation Service */
733#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
734#define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */
735#define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */
736#define PCI_ATS_CTRL 0x06 /* ATS Control Register */
737#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
738#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
739#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
740#define PCI_EXT_CAP_ATS_SIZEOF 8
741
742/* Page Request Interface */
743#define PCI_PRI_CTRL 0x04 /* PRI control register */
744#define PCI_PRI_CTRL_ENABLE 0x01 /* Enable */
745#define PCI_PRI_CTRL_RESET 0x02 /* Reset */
746#define PCI_PRI_STATUS 0x06 /* PRI status register */
747#define PCI_PRI_STATUS_RF 0x001 /* Response Failure */
748#define PCI_PRI_STATUS_UPRGI 0x002 /* Unexpected PRG index */
749#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
750#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
751#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
752#define PCI_EXT_CAP_PRI_SIZEOF 16
753
754/* PASID capability */
755#define PCI_PASID_CAP 0x04 /* PASID feature register */
756#define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */
757#define PCI_PASID_CAP_PRIV 0x04 /* Priviledge Mode Supported */
758#define PCI_PASID_CTRL 0x06 /* PASID control register */
759#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
760#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
761#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */
762#define PCI_EXT_CAP_PASID_SIZEOF 8
763
764/* Single Root I/O Virtualization */
765#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
766#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */
767#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */
768#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */
769#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */
770#define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */
771#define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */
772#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */
773#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */
774#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */
775#define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */
776#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */
777#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */
778#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */
779#define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */
780#define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */
781#define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */
782#define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */
783#define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */
784#define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */
785#define PCI_SRIOV_BAR 0x24 /* VF BAR0 */
786#define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */
787#define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/
788#define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */
789#define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */
790#define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */
791#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
792#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
793#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
794#define PCI_EXT_CAP_SRIOV_SIZEOF 64
795
796#define PCI_LTR_MAX_SNOOP_LAT 0x4
797#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
798#define PCI_LTR_VALUE_MASK 0x000003ff
799#define PCI_LTR_SCALE_MASK 0x00001c00
800#define PCI_LTR_SCALE_SHIFT 10
801#define PCI_EXT_CAP_LTR_SIZEOF 8
802
803/* Access Control Service */
804#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
805#define PCI_ACS_SV 0x01 /* Source Validation */
806#define PCI_ACS_TB 0x02 /* Translation Blocking */
807#define PCI_ACS_RR 0x04 /* P2P Request Redirect */
808#define PCI_ACS_CR 0x08 /* P2P Completion Redirect */
809#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
810#define PCI_ACS_EC 0x20 /* P2P Egress Control */
811#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
812#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
813#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
814#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
815
816#define PCI_VSEC_HDR 4 /* extended cap - vendor specific */
817#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
818
819/* sata capability */
820#define PCI_SATA_REGS 4 /* SATA REGs specifier */
821#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
822#define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */
823#define PCI_SATA_SIZEOF_SHORT 8
824#define PCI_SATA_SIZEOF_LONG 16
825
826/* resizable BARs */
827#define PCI_REBAR_CTRL 8 /* control register */
828#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
829#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
830
831/* dynamic power allocation */
832#define PCI_DPA_CAP 4 /* capability register */
833#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
834#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
835
836/* TPH Requester */
837#define PCI_TPH_CAP 4 /* capability register */
838#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */
839#define PCI_TPH_LOC_NONE 0x000 /* no location */
840#define PCI_TPH_LOC_CAP 0x200 /* in capability */
841#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
842#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
843#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
844#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
845
846#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index b4166cdfa7a2..2e902359aee5 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 8fc7dd1a57ff..646c0a7d50fa 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/pfkeyv2.h b/include/linux/pfkeyv2.h
deleted file mode 100644
index 0b80c806631f..000000000000
--- a/include/linux/pfkeyv2.h
+++ /dev/null
@@ -1,370 +0,0 @@
1/* PF_KEY user interface, this is defined by rfc2367 so
2 * do not make arbitrary modifications or else this header
3 * file will not be compliant.
4 */
5
6#ifndef _LINUX_PFKEY2_H
7#define _LINUX_PFKEY2_H
8
9#include <linux/types.h>
10
11#define PF_KEY_V2 2
12#define PFKEYV2_REVISION 199806L
13
14struct sadb_msg {
15 __u8 sadb_msg_version;
16 __u8 sadb_msg_type;
17 __u8 sadb_msg_errno;
18 __u8 sadb_msg_satype;
19 __u16 sadb_msg_len;
20 __u16 sadb_msg_reserved;
21 __u32 sadb_msg_seq;
22 __u32 sadb_msg_pid;
23} __attribute__((packed));
24/* sizeof(struct sadb_msg) == 16 */
25
26struct sadb_ext {
27 __u16 sadb_ext_len;
28 __u16 sadb_ext_type;
29} __attribute__((packed));
30/* sizeof(struct sadb_ext) == 4 */
31
32struct sadb_sa {
33 __u16 sadb_sa_len;
34 __u16 sadb_sa_exttype;
35 __be32 sadb_sa_spi;
36 __u8 sadb_sa_replay;
37 __u8 sadb_sa_state;
38 __u8 sadb_sa_auth;
39 __u8 sadb_sa_encrypt;
40 __u32 sadb_sa_flags;
41} __attribute__((packed));
42/* sizeof(struct sadb_sa) == 16 */
43
44struct sadb_lifetime {
45 __u16 sadb_lifetime_len;
46 __u16 sadb_lifetime_exttype;
47 __u32 sadb_lifetime_allocations;
48 __u64 sadb_lifetime_bytes;
49 __u64 sadb_lifetime_addtime;
50 __u64 sadb_lifetime_usetime;
51} __attribute__((packed));
52/* sizeof(struct sadb_lifetime) == 32 */
53
54struct sadb_address {
55 __u16 sadb_address_len;
56 __u16 sadb_address_exttype;
57 __u8 sadb_address_proto;
58 __u8 sadb_address_prefixlen;
59 __u16 sadb_address_reserved;
60} __attribute__((packed));
61/* sizeof(struct sadb_address) == 8 */
62
63struct sadb_key {
64 __u16 sadb_key_len;
65 __u16 sadb_key_exttype;
66 __u16 sadb_key_bits;
67 __u16 sadb_key_reserved;
68} __attribute__((packed));
69/* sizeof(struct sadb_key) == 8 */
70
71struct sadb_ident {
72 __u16 sadb_ident_len;
73 __u16 sadb_ident_exttype;
74 __u16 sadb_ident_type;
75 __u16 sadb_ident_reserved;
76 __u64 sadb_ident_id;
77} __attribute__((packed));
78/* sizeof(struct sadb_ident) == 16 */
79
80struct sadb_sens {
81 __u16 sadb_sens_len;
82 __u16 sadb_sens_exttype;
83 __u32 sadb_sens_dpd;
84 __u8 sadb_sens_sens_level;
85 __u8 sadb_sens_sens_len;
86 __u8 sadb_sens_integ_level;
87 __u8 sadb_sens_integ_len;
88 __u32 sadb_sens_reserved;
89} __attribute__((packed));
90/* sizeof(struct sadb_sens) == 16 */
91
92/* followed by:
93 __u64 sadb_sens_bitmap[sens_len];
94 __u64 sadb_integ_bitmap[integ_len]; */
95
96struct sadb_prop {
97 __u16 sadb_prop_len;
98 __u16 sadb_prop_exttype;
99 __u8 sadb_prop_replay;
100 __u8 sadb_prop_reserved[3];
101} __attribute__((packed));
102/* sizeof(struct sadb_prop) == 8 */
103
104/* followed by:
105 struct sadb_comb sadb_combs[(sadb_prop_len +
106 sizeof(__u64) - sizeof(struct sadb_prop)) /
107 sizeof(struct sadb_comb)]; */
108
109struct sadb_comb {
110 __u8 sadb_comb_auth;
111 __u8 sadb_comb_encrypt;
112 __u16 sadb_comb_flags;
113 __u16 sadb_comb_auth_minbits;
114 __u16 sadb_comb_auth_maxbits;
115 __u16 sadb_comb_encrypt_minbits;
116 __u16 sadb_comb_encrypt_maxbits;
117 __u32 sadb_comb_reserved;
118 __u32 sadb_comb_soft_allocations;
119 __u32 sadb_comb_hard_allocations;
120 __u64 sadb_comb_soft_bytes;
121 __u64 sadb_comb_hard_bytes;
122 __u64 sadb_comb_soft_addtime;
123 __u64 sadb_comb_hard_addtime;
124 __u64 sadb_comb_soft_usetime;
125 __u64 sadb_comb_hard_usetime;
126} __attribute__((packed));
127/* sizeof(struct sadb_comb) == 72 */
128
129struct sadb_supported {
130 __u16 sadb_supported_len;
131 __u16 sadb_supported_exttype;
132 __u32 sadb_supported_reserved;
133} __attribute__((packed));
134/* sizeof(struct sadb_supported) == 8 */
135
136/* followed by:
137 struct sadb_alg sadb_algs[(sadb_supported_len +
138 sizeof(__u64) - sizeof(struct sadb_supported)) /
139 sizeof(struct sadb_alg)]; */
140
141struct sadb_alg {
142 __u8 sadb_alg_id;
143 __u8 sadb_alg_ivlen;
144 __u16 sadb_alg_minbits;
145 __u16 sadb_alg_maxbits;
146 __u16 sadb_alg_reserved;
147} __attribute__((packed));
148/* sizeof(struct sadb_alg) == 8 */
149
150struct sadb_spirange {
151 __u16 sadb_spirange_len;
152 __u16 sadb_spirange_exttype;
153 __u32 sadb_spirange_min;
154 __u32 sadb_spirange_max;
155 __u32 sadb_spirange_reserved;
156} __attribute__((packed));
157/* sizeof(struct sadb_spirange) == 16 */
158
159struct sadb_x_kmprivate {
160 __u16 sadb_x_kmprivate_len;
161 __u16 sadb_x_kmprivate_exttype;
162 __u32 sadb_x_kmprivate_reserved;
163} __attribute__((packed));
164/* sizeof(struct sadb_x_kmprivate) == 8 */
165
166struct sadb_x_sa2 {
167 __u16 sadb_x_sa2_len;
168 __u16 sadb_x_sa2_exttype;
169 __u8 sadb_x_sa2_mode;
170 __u8 sadb_x_sa2_reserved1;
171 __u16 sadb_x_sa2_reserved2;
172 __u32 sadb_x_sa2_sequence;
173 __u32 sadb_x_sa2_reqid;
174} __attribute__((packed));
175/* sizeof(struct sadb_x_sa2) == 16 */
176
177struct sadb_x_policy {
178 __u16 sadb_x_policy_len;
179 __u16 sadb_x_policy_exttype;
180 __u16 sadb_x_policy_type;
181 __u8 sadb_x_policy_dir;
182 __u8 sadb_x_policy_reserved;
183 __u32 sadb_x_policy_id;
184 __u32 sadb_x_policy_priority;
185} __attribute__((packed));
186/* sizeof(struct sadb_x_policy) == 16 */
187
188struct sadb_x_ipsecrequest {
189 __u16 sadb_x_ipsecrequest_len;
190 __u16 sadb_x_ipsecrequest_proto;
191 __u8 sadb_x_ipsecrequest_mode;
192 __u8 sadb_x_ipsecrequest_level;
193 __u16 sadb_x_ipsecrequest_reserved1;
194 __u32 sadb_x_ipsecrequest_reqid;
195 __u32 sadb_x_ipsecrequest_reserved2;
196} __attribute__((packed));
197/* sizeof(struct sadb_x_ipsecrequest) == 16 */
198
199/* This defines the TYPE of Nat Traversal in use. Currently only one
200 * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06
201 */
202struct sadb_x_nat_t_type {
203 __u16 sadb_x_nat_t_type_len;
204 __u16 sadb_x_nat_t_type_exttype;
205 __u8 sadb_x_nat_t_type_type;
206 __u8 sadb_x_nat_t_type_reserved[3];
207} __attribute__((packed));
208/* sizeof(struct sadb_x_nat_t_type) == 8 */
209
210/* Pass a NAT Traversal port (Source or Dest port) */
211struct sadb_x_nat_t_port {
212 __u16 sadb_x_nat_t_port_len;
213 __u16 sadb_x_nat_t_port_exttype;
214 __be16 sadb_x_nat_t_port_port;
215 __u16 sadb_x_nat_t_port_reserved;
216} __attribute__((packed));
217/* sizeof(struct sadb_x_nat_t_port) == 8 */
218
219/* Generic LSM security context */
220struct sadb_x_sec_ctx {
221 __u16 sadb_x_sec_len;
222 __u16 sadb_x_sec_exttype;
223 __u8 sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */
224 __u8 sadb_x_ctx_doi;
225 __u16 sadb_x_ctx_len;
226} __attribute__((packed));
227/* sizeof(struct sadb_sec_ctx) = 8 */
228
229/* Used by MIGRATE to pass addresses IKE will use to perform
230 * negotiation with the peer */
231struct sadb_x_kmaddress {
232 __u16 sadb_x_kmaddress_len;
233 __u16 sadb_x_kmaddress_exttype;
234 __u32 sadb_x_kmaddress_reserved;
235} __attribute__((packed));
236/* sizeof(struct sadb_x_kmaddress) == 8 */
237
238/* Message types */
239#define SADB_RESERVED 0
240#define SADB_GETSPI 1
241#define SADB_UPDATE 2
242#define SADB_ADD 3
243#define SADB_DELETE 4
244#define SADB_GET 5
245#define SADB_ACQUIRE 6
246#define SADB_REGISTER 7
247#define SADB_EXPIRE 8
248#define SADB_FLUSH 9
249#define SADB_DUMP 10
250#define SADB_X_PROMISC 11
251#define SADB_X_PCHANGE 12
252#define SADB_X_SPDUPDATE 13
253#define SADB_X_SPDADD 14
254#define SADB_X_SPDDELETE 15
255#define SADB_X_SPDGET 16
256#define SADB_X_SPDACQUIRE 17
257#define SADB_X_SPDDUMP 18
258#define SADB_X_SPDFLUSH 19
259#define SADB_X_SPDSETIDX 20
260#define SADB_X_SPDEXPIRE 21
261#define SADB_X_SPDDELETE2 22
262#define SADB_X_NAT_T_NEW_MAPPING 23
263#define SADB_X_MIGRATE 24
264#define SADB_MAX 24
265
266/* Security Association flags */
267#define SADB_SAFLAGS_PFS 1
268#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
269#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
270#define SADB_SAFLAGS_NOECN 0x80000000
271
272/* Security Association states */
273#define SADB_SASTATE_LARVAL 0
274#define SADB_SASTATE_MATURE 1
275#define SADB_SASTATE_DYING 2
276#define SADB_SASTATE_DEAD 3
277#define SADB_SASTATE_MAX 3
278
279/* Security Association types */
280#define SADB_SATYPE_UNSPEC 0
281#define SADB_SATYPE_AH 2
282#define SADB_SATYPE_ESP 3
283#define SADB_SATYPE_RSVP 5
284#define SADB_SATYPE_OSPFV2 6
285#define SADB_SATYPE_RIPV2 7
286#define SADB_SATYPE_MIP 8
287#define SADB_X_SATYPE_IPCOMP 9
288#define SADB_SATYPE_MAX 9
289
290/* Authentication algorithms */
291#define SADB_AALG_NONE 0
292#define SADB_AALG_MD5HMAC 2
293#define SADB_AALG_SHA1HMAC 3
294#define SADB_X_AALG_SHA2_256HMAC 5
295#define SADB_X_AALG_SHA2_384HMAC 6
296#define SADB_X_AALG_SHA2_512HMAC 7
297#define SADB_X_AALG_RIPEMD160HMAC 8
298#define SADB_X_AALG_AES_XCBC_MAC 9
299#define SADB_X_AALG_NULL 251 /* kame */
300#define SADB_AALG_MAX 251
301
302/* Encryption algorithms */
303#define SADB_EALG_NONE 0
304#define SADB_EALG_DESCBC 2
305#define SADB_EALG_3DESCBC 3
306#define SADB_X_EALG_CASTCBC 6
307#define SADB_X_EALG_BLOWFISHCBC 7
308#define SADB_EALG_NULL 11
309#define SADB_X_EALG_AESCBC 12
310#define SADB_X_EALG_AESCTR 13
311#define SADB_X_EALG_AES_CCM_ICV8 14
312#define SADB_X_EALG_AES_CCM_ICV12 15
313#define SADB_X_EALG_AES_CCM_ICV16 16
314#define SADB_X_EALG_AES_GCM_ICV8 18
315#define SADB_X_EALG_AES_GCM_ICV12 19
316#define SADB_X_EALG_AES_GCM_ICV16 20
317#define SADB_X_EALG_CAMELLIACBC 22
318#define SADB_X_EALG_NULL_AES_GMAC 23
319#define SADB_EALG_MAX 253 /* last EALG */
320/* private allocations should use 249-255 (RFC2407) */
321#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
322#define SADB_X_EALG_TWOFISHCBC 253 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
323
324/* Compression algorithms */
325#define SADB_X_CALG_NONE 0
326#define SADB_X_CALG_OUI 1
327#define SADB_X_CALG_DEFLATE 2
328#define SADB_X_CALG_LZS 3
329#define SADB_X_CALG_LZJH 4
330#define SADB_X_CALG_MAX 4
331
332/* Extension Header values */
333#define SADB_EXT_RESERVED 0
334#define SADB_EXT_SA 1
335#define SADB_EXT_LIFETIME_CURRENT 2
336#define SADB_EXT_LIFETIME_HARD 3
337#define SADB_EXT_LIFETIME_SOFT 4
338#define SADB_EXT_ADDRESS_SRC 5
339#define SADB_EXT_ADDRESS_DST 6
340#define SADB_EXT_ADDRESS_PROXY 7
341#define SADB_EXT_KEY_AUTH 8
342#define SADB_EXT_KEY_ENCRYPT 9
343#define SADB_EXT_IDENTITY_SRC 10
344#define SADB_EXT_IDENTITY_DST 11
345#define SADB_EXT_SENSITIVITY 12
346#define SADB_EXT_PROPOSAL 13
347#define SADB_EXT_SUPPORTED_AUTH 14
348#define SADB_EXT_SUPPORTED_ENCRYPT 15
349#define SADB_EXT_SPIRANGE 16
350#define SADB_X_EXT_KMPRIVATE 17
351#define SADB_X_EXT_POLICY 18
352#define SADB_X_EXT_SA2 19
353/* The next four entries are for setting up NAT Traversal */
354#define SADB_X_EXT_NAT_T_TYPE 20
355#define SADB_X_EXT_NAT_T_SPORT 21
356#define SADB_X_EXT_NAT_T_DPORT 22
357#define SADB_X_EXT_NAT_T_OA 23
358#define SADB_X_EXT_SEC_CTX 24
359/* Used with MIGRATE to pass @ to IKE for negotiation */
360#define SADB_X_EXT_KMADDRESS 25
361#define SADB_EXT_MAX 25
362
363/* Identity Extension values */
364#define SADB_IDENTTYPE_RESERVED 0
365#define SADB_IDENTTYPE_PREFIX 1
366#define SADB_IDENTTYPE_FQDN 2
367#define SADB_IDENTTYPE_USERFQDN 3
368#define SADB_IDENTTYPE_MAX 3
369
370#endif /* !(_LINUX_PFKEY2_H) */
diff --git a/include/linux/pg.h b/include/linux/pg.h
deleted file mode 100644
index db994bb0c794..000000000000
--- a/include/linux/pg.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/* pg.h (c) 1998 Grant R. Guenther <grant@torque.net>
2 Under the terms of the GNU General Public License
3
4
5 pg.h defines the user interface to the generic ATAPI packet
6 command driver for parallel port ATAPI devices (pg). The
7 driver is loosely modelled after the generic SCSI driver, sg,
8 although the actual interface is different.
9
10 The pg driver provides a simple character device interface for
11 sending ATAPI commands to a device. With the exception of the
12 ATAPI reset operation, all operations are performed by a pair
13 of read and write operations to the appropriate /dev/pgN device.
14 A write operation delivers a command and any outbound data in
15 a single buffer. Normally, the write will succeed unless the
16 device is offline or malfunctioning, or there is already another
17 command pending. If the write succeeds, it should be followed
18 immediately by a read operation, to obtain any returned data and
19 status information. A read will fail if there is no operation
20 in progress.
21
22 As a special case, the device can be reset with a write operation,
23 and in this case, no following read is expected, or permitted.
24
25 There are no ioctl() operations. Any single operation
26 may transfer at most PG_MAX_DATA bytes. Note that the driver must
27 copy the data through an internal buffer. In keeping with all
28 current ATAPI devices, command packets are assumed to be exactly
29 12 bytes in length.
30
31 To permit future changes to this interface, the headers in the
32 read and write buffers contain a single character "magic" flag.
33 Currently this flag must be the character "P".
34
35*/
36
37#define PG_MAGIC 'P'
38#define PG_RESET 'Z'
39#define PG_COMMAND 'C'
40
41#define PG_MAX_DATA 32768
42
43struct pg_write_hdr {
44
45 char magic; /* == PG_MAGIC */
46 char func; /* PG_RESET or PG_COMMAND */
47 int dlen; /* number of bytes expected to transfer */
48 int timeout; /* number of seconds before timeout */
49 char packet[12]; /* packet command */
50
51};
52
53struct pg_read_hdr {
54
55 char magic; /* == PG_MAGIC */
56 char scsi; /* "scsi" status == sense key */
57 int dlen; /* size of device transfer request */
58 int duration; /* time in seconds command took */
59 char pad[12]; /* not used */
60
61};
62
63/* end of pg.h */
diff --git a/include/linux/phantom.h b/include/linux/phantom.h
deleted file mode 100644
index 94dd6645c60a..000000000000
--- a/include/linux/phantom.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright (C) 2005-2007 Jiri Slaby <jirislaby@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef __PHANTOM_H
11#define __PHANTOM_H
12
13#include <linux/types.h>
14
15/* PHN_(G/S)ET_REG param */
16struct phm_reg {
17 __u32 reg;
18 __u32 value;
19};
20
21/* PHN_(G/S)ET_REGS param */
22struct phm_regs {
23 __u32 count;
24 __u32 mask;
25 __u32 values[8];
26};
27
28#define PH_IOC_MAGIC 'p'
29#define PHN_GET_REG _IOWR(PH_IOC_MAGIC, 0, struct phm_reg *)
30#define PHN_SET_REG _IOW(PH_IOC_MAGIC, 1, struct phm_reg *)
31#define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *)
32#define PHN_SET_REGS _IOW(PH_IOC_MAGIC, 3, struct phm_regs *)
33/* this ioctl tells the driver, that the caller is not OpenHaptics and might
34 * use improved registers update (no more phantom switchoffs when using
35 * libphantom) */
36#define PHN_NOT_OH _IO(PH_IOC_MAGIC, 4)
37#define PHN_GETREG _IOWR(PH_IOC_MAGIC, 5, struct phm_reg)
38#define PHN_SETREG _IOW(PH_IOC_MAGIC, 6, struct phm_reg)
39#define PHN_GETREGS _IOWR(PH_IOC_MAGIC, 7, struct phm_regs)
40#define PHN_SETREGS _IOW(PH_IOC_MAGIC, 8, struct phm_regs)
41
42#define PHN_CONTROL 0x6 /* control byte in iaddr space */
43#define PHN_CTL_AMP 0x1 /* switch after torques change */
44#define PHN_CTL_BUT 0x2 /* is button switched */
45#define PHN_CTL_IRQ 0x10 /* is irq enabled */
46
47#define PHN_ZERO_FORCE 2048 /* zero torque on motor */
48
49#endif
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index f48bfc80cb4b..f691b04fc5ce 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/pkt_cls.h b/include/linux/pkt_cls.h
deleted file mode 100644
index 082eafaf026b..000000000000
--- a/include/linux/pkt_cls.h
+++ /dev/null
@@ -1,469 +0,0 @@
1#ifndef __LINUX_PKT_CLS_H
2#define __LINUX_PKT_CLS_H
3
4#include <linux/types.h>
5#include <linux/pkt_sched.h>
6
7/* I think i could have done better macros ; for now this is stolen from
8 * some arch/mips code - jhs
9*/
10#define _TC_MAKE32(x) ((x))
11
12#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
13#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
14#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
15#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
16
17/* verdict bit breakdown
18 *
19bit 0: when set -> this packet has been munged already
20
21bit 1: when set -> It is ok to munge this packet
22
23bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
24assume loop
25
26bit 6,7: Where this packet was last seen
270: Above the transmit example at the socket level
281: on the Ingress
292: on the Egress
30
31bit 8: when set --> Request not to classify on ingress.
32
33bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
34
35 *
36 * */
37
38#define TC_MUNGED _TC_MAKEMASK1(0)
39#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
40#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
41
42#define TC_OK2MUNGE _TC_MAKEMASK1(1)
43#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
44#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
45
46#define S_TC_VERD _TC_MAKE32(2)
47#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
48#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
49#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
50#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
51
52#define S_TC_FROM _TC_MAKE32(6)
53#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
54#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
55#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM)
56#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
57#define AT_STACK 0x0
58#define AT_INGRESS 0x1
59#define AT_EGRESS 0x2
60
61#define TC_NCLS _TC_MAKEMASK1(8)
62#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
63#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
64
65#define S_TC_RTTL _TC_MAKE32(9)
66#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
67#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
68#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
69#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
70
71#define S_TC_AT _TC_MAKE32(12)
72#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
73#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
74#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
75#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
76
77/* Action attributes */
78enum {
79 TCA_ACT_UNSPEC,
80 TCA_ACT_KIND,
81 TCA_ACT_OPTIONS,
82 TCA_ACT_INDEX,
83 TCA_ACT_STATS,
84 __TCA_ACT_MAX
85};
86
87#define TCA_ACT_MAX __TCA_ACT_MAX
88#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
89#define TCA_ACT_MAX_PRIO 32
90#define TCA_ACT_BIND 1
91#define TCA_ACT_NOBIND 0
92#define TCA_ACT_UNBIND 1
93#define TCA_ACT_NOUNBIND 0
94#define TCA_ACT_REPLACE 1
95#define TCA_ACT_NOREPLACE 0
96#define MAX_REC_LOOP 4
97#define MAX_RED_LOOP 4
98
99#define TC_ACT_UNSPEC (-1)
100#define TC_ACT_OK 0
101#define TC_ACT_RECLASSIFY 1
102#define TC_ACT_SHOT 2
103#define TC_ACT_PIPE 3
104#define TC_ACT_STOLEN 4
105#define TC_ACT_QUEUED 5
106#define TC_ACT_REPEAT 6
107#define TC_ACT_JUMP 0x10000000
108
109/* Action type identifiers*/
110enum {
111 TCA_ID_UNSPEC=0,
112 TCA_ID_POLICE=1,
113 /* other actions go here */
114 __TCA_ID_MAX=255
115};
116
117#define TCA_ID_MAX __TCA_ID_MAX
118
119struct tc_police {
120 __u32 index;
121 int action;
122#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
123#define TC_POLICE_OK TC_ACT_OK
124#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
125#define TC_POLICE_SHOT TC_ACT_SHOT
126#define TC_POLICE_PIPE TC_ACT_PIPE
127
128 __u32 limit;
129 __u32 burst;
130 __u32 mtu;
131 struct tc_ratespec rate;
132 struct tc_ratespec peakrate;
133 int refcnt;
134 int bindcnt;
135 __u32 capab;
136};
137
138struct tcf_t {
139 __u64 install;
140 __u64 lastuse;
141 __u64 expires;
142};
143
144struct tc_cnt {
145 int refcnt;
146 int bindcnt;
147};
148
149#define tc_gen \
150 __u32 index; \
151 __u32 capab; \
152 int action; \
153 int refcnt; \
154 int bindcnt
155
156enum {
157 TCA_POLICE_UNSPEC,
158 TCA_POLICE_TBF,
159 TCA_POLICE_RATE,
160 TCA_POLICE_PEAKRATE,
161 TCA_POLICE_AVRATE,
162 TCA_POLICE_RESULT,
163 __TCA_POLICE_MAX
164#define TCA_POLICE_RESULT TCA_POLICE_RESULT
165};
166
167#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
168
169/* U32 filters */
170
171#define TC_U32_HTID(h) ((h)&0xFFF00000)
172#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
173#define TC_U32_HASH(h) (((h)>>12)&0xFF)
174#define TC_U32_NODE(h) ((h)&0xFFF)
175#define TC_U32_KEY(h) ((h)&0xFFFFF)
176#define TC_U32_UNSPEC 0
177#define TC_U32_ROOT (0xFFF00000)
178
179enum {
180 TCA_U32_UNSPEC,
181 TCA_U32_CLASSID,
182 TCA_U32_HASH,
183 TCA_U32_LINK,
184 TCA_U32_DIVISOR,
185 TCA_U32_SEL,
186 TCA_U32_POLICE,
187 TCA_U32_ACT,
188 TCA_U32_INDEV,
189 TCA_U32_PCNT,
190 TCA_U32_MARK,
191 __TCA_U32_MAX
192};
193
194#define TCA_U32_MAX (__TCA_U32_MAX - 1)
195
196struct tc_u32_key {
197 __be32 mask;
198 __be32 val;
199 int off;
200 int offmask;
201};
202
203struct tc_u32_sel {
204 unsigned char flags;
205 unsigned char offshift;
206 unsigned char nkeys;
207
208 __be16 offmask;
209 __u16 off;
210 short offoff;
211
212 short hoff;
213 __be32 hmask;
214 struct tc_u32_key keys[0];
215};
216
217struct tc_u32_mark {
218 __u32 val;
219 __u32 mask;
220 __u32 success;
221};
222
223struct tc_u32_pcnt {
224 __u64 rcnt;
225 __u64 rhit;
226 __u64 kcnts[0];
227};
228
229/* Flags */
230
231#define TC_U32_TERMINAL 1
232#define TC_U32_OFFSET 2
233#define TC_U32_VAROFFSET 4
234#define TC_U32_EAT 8
235
236#define TC_U32_MAXDEPTH 8
237
238
239/* RSVP filter */
240
241enum {
242 TCA_RSVP_UNSPEC,
243 TCA_RSVP_CLASSID,
244 TCA_RSVP_DST,
245 TCA_RSVP_SRC,
246 TCA_RSVP_PINFO,
247 TCA_RSVP_POLICE,
248 TCA_RSVP_ACT,
249 __TCA_RSVP_MAX
250};
251
252#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
253
254struct tc_rsvp_gpi {
255 __u32 key;
256 __u32 mask;
257 int offset;
258};
259
260struct tc_rsvp_pinfo {
261 struct tc_rsvp_gpi dpi;
262 struct tc_rsvp_gpi spi;
263 __u8 protocol;
264 __u8 tunnelid;
265 __u8 tunnelhdr;
266 __u8 pad;
267};
268
269/* ROUTE filter */
270
271enum {
272 TCA_ROUTE4_UNSPEC,
273 TCA_ROUTE4_CLASSID,
274 TCA_ROUTE4_TO,
275 TCA_ROUTE4_FROM,
276 TCA_ROUTE4_IIF,
277 TCA_ROUTE4_POLICE,
278 TCA_ROUTE4_ACT,
279 __TCA_ROUTE4_MAX
280};
281
282#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
283
284
285/* FW filter */
286
287enum {
288 TCA_FW_UNSPEC,
289 TCA_FW_CLASSID,
290 TCA_FW_POLICE,
291 TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */
292 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
293 TCA_FW_MASK,
294 __TCA_FW_MAX
295};
296
297#define TCA_FW_MAX (__TCA_FW_MAX - 1)
298
299/* TC index filter */
300
301enum {
302 TCA_TCINDEX_UNSPEC,
303 TCA_TCINDEX_HASH,
304 TCA_TCINDEX_MASK,
305 TCA_TCINDEX_SHIFT,
306 TCA_TCINDEX_FALL_THROUGH,
307 TCA_TCINDEX_CLASSID,
308 TCA_TCINDEX_POLICE,
309 TCA_TCINDEX_ACT,
310 __TCA_TCINDEX_MAX
311};
312
313#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
314
315/* Flow filter */
316
317enum {
318 FLOW_KEY_SRC,
319 FLOW_KEY_DST,
320 FLOW_KEY_PROTO,
321 FLOW_KEY_PROTO_SRC,
322 FLOW_KEY_PROTO_DST,
323 FLOW_KEY_IIF,
324 FLOW_KEY_PRIORITY,
325 FLOW_KEY_MARK,
326 FLOW_KEY_NFCT,
327 FLOW_KEY_NFCT_SRC,
328 FLOW_KEY_NFCT_DST,
329 FLOW_KEY_NFCT_PROTO_SRC,
330 FLOW_KEY_NFCT_PROTO_DST,
331 FLOW_KEY_RTCLASSID,
332 FLOW_KEY_SKUID,
333 FLOW_KEY_SKGID,
334 FLOW_KEY_VLAN_TAG,
335 FLOW_KEY_RXHASH,
336 __FLOW_KEY_MAX,
337};
338
339#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
340
341enum {
342 FLOW_MODE_MAP,
343 FLOW_MODE_HASH,
344};
345
346enum {
347 TCA_FLOW_UNSPEC,
348 TCA_FLOW_KEYS,
349 TCA_FLOW_MODE,
350 TCA_FLOW_BASECLASS,
351 TCA_FLOW_RSHIFT,
352 TCA_FLOW_ADDEND,
353 TCA_FLOW_MASK,
354 TCA_FLOW_XOR,
355 TCA_FLOW_DIVISOR,
356 TCA_FLOW_ACT,
357 TCA_FLOW_POLICE,
358 TCA_FLOW_EMATCHES,
359 TCA_FLOW_PERTURB,
360 __TCA_FLOW_MAX
361};
362
363#define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1)
364
365/* Basic filter */
366
367enum {
368 TCA_BASIC_UNSPEC,
369 TCA_BASIC_CLASSID,
370 TCA_BASIC_EMATCHES,
371 TCA_BASIC_ACT,
372 TCA_BASIC_POLICE,
373 __TCA_BASIC_MAX
374};
375
376#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
377
378
379/* Cgroup classifier */
380
381enum {
382 TCA_CGROUP_UNSPEC,
383 TCA_CGROUP_ACT,
384 TCA_CGROUP_POLICE,
385 TCA_CGROUP_EMATCHES,
386 __TCA_CGROUP_MAX,
387};
388
389#define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1)
390
391/* Extended Matches */
392
393struct tcf_ematch_tree_hdr {
394 __u16 nmatches;
395 __u16 progid;
396};
397
398enum {
399 TCA_EMATCH_TREE_UNSPEC,
400 TCA_EMATCH_TREE_HDR,
401 TCA_EMATCH_TREE_LIST,
402 __TCA_EMATCH_TREE_MAX
403};
404#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
405
406struct tcf_ematch_hdr {
407 __u16 matchid;
408 __u16 kind;
409 __u16 flags;
410 __u16 pad; /* currently unused */
411};
412
413/* 0 1
414 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
415 * +-----------------------+-+-+---+
416 * | Unused |S|I| R |
417 * +-----------------------+-+-+---+
418 *
419 * R(2) ::= relation to next ematch
420 * where: 0 0 END (last ematch)
421 * 0 1 AND
422 * 1 0 OR
423 * 1 1 Unused (invalid)
424 * I(1) ::= invert result
425 * S(1) ::= simple payload
426 */
427#define TCF_EM_REL_END 0
428#define TCF_EM_REL_AND (1<<0)
429#define TCF_EM_REL_OR (1<<1)
430#define TCF_EM_INVERT (1<<2)
431#define TCF_EM_SIMPLE (1<<3)
432
433#define TCF_EM_REL_MASK 3
434#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
435
436enum {
437 TCF_LAYER_LINK,
438 TCF_LAYER_NETWORK,
439 TCF_LAYER_TRANSPORT,
440 __TCF_LAYER_MAX
441};
442#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
443
444/* Ematch type assignments
445 * 1..32767 Reserved for ematches inside kernel tree
446 * 32768..65535 Free to use, not reliable
447 */
448#define TCF_EM_CONTAINER 0
449#define TCF_EM_CMP 1
450#define TCF_EM_NBYTE 2
451#define TCF_EM_U32 3
452#define TCF_EM_META 4
453#define TCF_EM_TEXT 5
454#define TCF_EM_VLAN 6
455#define TCF_EM_CANID 7
456#define TCF_EM_IPSET 8
457#define TCF_EM_MAX 8
458
459enum {
460 TCF_EM_PROG_TC
461};
462
463enum {
464 TCF_EM_OPND_EQ,
465 TCF_EM_OPND_GT,
466 TCF_EM_OPND_LT
467};
468
469#endif
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
deleted file mode 100644
index 32aef0a439ef..000000000000
--- a/include/linux/pkt_sched.h
+++ /dev/null
@@ -1,738 +0,0 @@
1#ifndef __LINUX_PKT_SCHED_H
2#define __LINUX_PKT_SCHED_H
3
4#include <linux/types.h>
5
6/* Logical priority bands not depending on specific packet scheduler.
7 Every scheduler will map them to real traffic classes, if it has
8 no more precise mechanism to classify packets.
9
10 These numbers have no special meaning, though their coincidence
11 with obsolete IPv6 values is not occasional :-). New IPv6 drafts
12 preferred full anarchy inspired by diffserv group.
13
14 Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
15 class, actually, as rule it will be handled with more care than
16 filler or even bulk.
17 */
18
19#define TC_PRIO_BESTEFFORT 0
20#define TC_PRIO_FILLER 1
21#define TC_PRIO_BULK 2
22#define TC_PRIO_INTERACTIVE_BULK 4
23#define TC_PRIO_INTERACTIVE 6
24#define TC_PRIO_CONTROL 7
25
26#define TC_PRIO_MAX 15
27
28/* Generic queue statistics, available for all the elements.
29 Particular schedulers may have also their private records.
30 */
31
32struct tc_stats {
33 __u64 bytes; /* Number of enqueued bytes */
34 __u32 packets; /* Number of enqueued packets */
35 __u32 drops; /* Packets dropped because of lack of resources */
36 __u32 overlimits; /* Number of throttle events when this
37 * flow goes out of allocated bandwidth */
38 __u32 bps; /* Current flow byte rate */
39 __u32 pps; /* Current flow packet rate */
40 __u32 qlen;
41 __u32 backlog;
42};
43
44struct tc_estimator {
45 signed char interval;
46 unsigned char ewma_log;
47};
48
49/* "Handles"
50 ---------
51
52 All the traffic control objects have 32bit identifiers, or "handles".
53
54 They can be considered as opaque numbers from user API viewpoint,
55 but actually they always consist of two fields: major and
56 minor numbers, which are interpreted by kernel specially,
57 that may be used by applications, though not recommended.
58
59 F.e. qdisc handles always have minor number equal to zero,
60 classes (or flows) have major equal to parent qdisc major, and
61 minor uniquely identifying class inside qdisc.
62
63 Macros to manipulate handles:
64 */
65
66#define TC_H_MAJ_MASK (0xFFFF0000U)
67#define TC_H_MIN_MASK (0x0000FFFFU)
68#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
69#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
70#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
71
72#define TC_H_UNSPEC (0U)
73#define TC_H_ROOT (0xFFFFFFFFU)
74#define TC_H_INGRESS (0xFFFFFFF1U)
75
76struct tc_ratespec {
77 unsigned char cell_log;
78 unsigned char __reserved;
79 unsigned short overhead;
80 short cell_align;
81 unsigned short mpu;
82 __u32 rate;
83};
84
85#define TC_RTAB_SIZE 1024
86
87struct tc_sizespec {
88 unsigned char cell_log;
89 unsigned char size_log;
90 short cell_align;
91 int overhead;
92 unsigned int linklayer;
93 unsigned int mpu;
94 unsigned int mtu;
95 unsigned int tsize;
96};
97
98enum {
99 TCA_STAB_UNSPEC,
100 TCA_STAB_BASE,
101 TCA_STAB_DATA,
102 __TCA_STAB_MAX
103};
104
105#define TCA_STAB_MAX (__TCA_STAB_MAX - 1)
106
107/* FIFO section */
108
109struct tc_fifo_qopt {
110 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
111};
112
113/* PRIO section */
114
115#define TCQ_PRIO_BANDS 16
116#define TCQ_MIN_PRIO_BANDS 2
117
118struct tc_prio_qopt {
119 int bands; /* Number of bands */
120 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
121};
122
123/* MULTIQ section */
124
125struct tc_multiq_qopt {
126 __u16 bands; /* Number of bands */
127 __u16 max_bands; /* Maximum number of queues */
128};
129
130/* PLUG section */
131
132#define TCQ_PLUG_BUFFER 0
133#define TCQ_PLUG_RELEASE_ONE 1
134#define TCQ_PLUG_RELEASE_INDEFINITE 2
135#define TCQ_PLUG_LIMIT 3
136
137struct tc_plug_qopt {
138 /* TCQ_PLUG_BUFFER: Inset a plug into the queue and
139 * buffer any incoming packets
140 * TCQ_PLUG_RELEASE_ONE: Dequeue packets from queue head
141 * to beginning of the next plug.
142 * TCQ_PLUG_RELEASE_INDEFINITE: Dequeue all packets from queue.
143 * Stop buffering packets until the next TCQ_PLUG_BUFFER
144 * command is received (just act as a pass-thru queue).
145 * TCQ_PLUG_LIMIT: Increase/decrease queue size
146 */
147 int action;
148 __u32 limit;
149};
150
151/* TBF section */
152
153struct tc_tbf_qopt {
154 struct tc_ratespec rate;
155 struct tc_ratespec peakrate;
156 __u32 limit;
157 __u32 buffer;
158 __u32 mtu;
159};
160
161enum {
162 TCA_TBF_UNSPEC,
163 TCA_TBF_PARMS,
164 TCA_TBF_RTAB,
165 TCA_TBF_PTAB,
166 __TCA_TBF_MAX,
167};
168
169#define TCA_TBF_MAX (__TCA_TBF_MAX - 1)
170
171
172/* TEQL section */
173
174/* TEQL does not require any parameters */
175
176/* SFQ section */
177
178struct tc_sfq_qopt {
179 unsigned quantum; /* Bytes per round allocated to flow */
180 int perturb_period; /* Period of hash perturbation */
181 __u32 limit; /* Maximal packets in queue */
182 unsigned divisor; /* Hash divisor */
183 unsigned flows; /* Maximal number of flows */
184};
185
186struct tc_sfqred_stats {
187 __u32 prob_drop; /* Early drops, below max threshold */
188 __u32 forced_drop; /* Early drops, after max threshold */
189 __u32 prob_mark; /* Marked packets, below max threshold */
190 __u32 forced_mark; /* Marked packets, after max threshold */
191 __u32 prob_mark_head; /* Marked packets, below max threshold */
192 __u32 forced_mark_head;/* Marked packets, after max threshold */
193};
194
195struct tc_sfq_qopt_v1 {
196 struct tc_sfq_qopt v0;
197 unsigned int depth; /* max number of packets per flow */
198 unsigned int headdrop;
199/* SFQRED parameters */
200 __u32 limit; /* HARD maximal flow queue length (bytes) */
201 __u32 qth_min; /* Min average length threshold (bytes) */
202 __u32 qth_max; /* Max average length threshold (bytes) */
203 unsigned char Wlog; /* log(W) */
204 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
205 unsigned char Scell_log; /* cell size for idle damping */
206 unsigned char flags;
207 __u32 max_P; /* probability, high resolution */
208/* SFQRED stats */
209 struct tc_sfqred_stats stats;
210};
211
212
213struct tc_sfq_xstats {
214 __s32 allot;
215};
216
217/* RED section */
218
219enum {
220 TCA_RED_UNSPEC,
221 TCA_RED_PARMS,
222 TCA_RED_STAB,
223 TCA_RED_MAX_P,
224 __TCA_RED_MAX,
225};
226
227#define TCA_RED_MAX (__TCA_RED_MAX - 1)
228
229struct tc_red_qopt {
230 __u32 limit; /* HARD maximal queue length (bytes) */
231 __u32 qth_min; /* Min average length threshold (bytes) */
232 __u32 qth_max; /* Max average length threshold (bytes) */
233 unsigned char Wlog; /* log(W) */
234 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
235 unsigned char Scell_log; /* cell size for idle damping */
236 unsigned char flags;
237#define TC_RED_ECN 1
238#define TC_RED_HARDDROP 2
239#define TC_RED_ADAPTATIVE 4
240};
241
242struct tc_red_xstats {
243 __u32 early; /* Early drops */
244 __u32 pdrop; /* Drops due to queue limits */
245 __u32 other; /* Drops due to drop() calls */
246 __u32 marked; /* Marked packets */
247};
248
249/* GRED section */
250
251#define MAX_DPs 16
252
253enum {
254 TCA_GRED_UNSPEC,
255 TCA_GRED_PARMS,
256 TCA_GRED_STAB,
257 TCA_GRED_DPS,
258 TCA_GRED_MAX_P,
259 __TCA_GRED_MAX,
260};
261
262#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
263
264struct tc_gred_qopt {
265 __u32 limit; /* HARD maximal queue length (bytes) */
266 __u32 qth_min; /* Min average length threshold (bytes) */
267 __u32 qth_max; /* Max average length threshold (bytes) */
268 __u32 DP; /* up to 2^32 DPs */
269 __u32 backlog;
270 __u32 qave;
271 __u32 forced;
272 __u32 early;
273 __u32 other;
274 __u32 pdrop;
275 __u8 Wlog; /* log(W) */
276 __u8 Plog; /* log(P_max/(qth_max-qth_min)) */
277 __u8 Scell_log; /* cell size for idle damping */
278 __u8 prio; /* prio of this VQ */
279 __u32 packets;
280 __u32 bytesin;
281};
282
283/* gred setup */
284struct tc_gred_sopt {
285 __u32 DPs;
286 __u32 def_DP;
287 __u8 grio;
288 __u8 flags;
289 __u16 pad1;
290};
291
292/* CHOKe section */
293
294enum {
295 TCA_CHOKE_UNSPEC,
296 TCA_CHOKE_PARMS,
297 TCA_CHOKE_STAB,
298 TCA_CHOKE_MAX_P,
299 __TCA_CHOKE_MAX,
300};
301
302#define TCA_CHOKE_MAX (__TCA_CHOKE_MAX - 1)
303
304struct tc_choke_qopt {
305 __u32 limit; /* Hard queue length (packets) */
306 __u32 qth_min; /* Min average threshold (packets) */
307 __u32 qth_max; /* Max average threshold (packets) */
308 unsigned char Wlog; /* log(W) */
309 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
310 unsigned char Scell_log; /* cell size for idle damping */
311 unsigned char flags; /* see RED flags */
312};
313
314struct tc_choke_xstats {
315 __u32 early; /* Early drops */
316 __u32 pdrop; /* Drops due to queue limits */
317 __u32 other; /* Drops due to drop() calls */
318 __u32 marked; /* Marked packets */
319 __u32 matched; /* Drops due to flow match */
320};
321
322/* HTB section */
323#define TC_HTB_NUMPRIO 8
324#define TC_HTB_MAXDEPTH 8
325#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
326
327struct tc_htb_opt {
328 struct tc_ratespec rate;
329 struct tc_ratespec ceil;
330 __u32 buffer;
331 __u32 cbuffer;
332 __u32 quantum;
333 __u32 level; /* out only */
334 __u32 prio;
335};
336struct tc_htb_glob {
337 __u32 version; /* to match HTB/TC */
338 __u32 rate2quantum; /* bps->quantum divisor */
339 __u32 defcls; /* default class number */
340 __u32 debug; /* debug flags */
341
342 /* stats */
343 __u32 direct_pkts; /* count of non shaped packets */
344};
345enum {
346 TCA_HTB_UNSPEC,
347 TCA_HTB_PARMS,
348 TCA_HTB_INIT,
349 TCA_HTB_CTAB,
350 TCA_HTB_RTAB,
351 __TCA_HTB_MAX,
352};
353
354#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
355
356struct tc_htb_xstats {
357 __u32 lends;
358 __u32 borrows;
359 __u32 giants; /* too big packets (rate will not be accurate) */
360 __u32 tokens;
361 __u32 ctokens;
362};
363
364/* HFSC section */
365
366struct tc_hfsc_qopt {
367 __u16 defcls; /* default class */
368};
369
370struct tc_service_curve {
371 __u32 m1; /* slope of the first segment in bps */
372 __u32 d; /* x-projection of the first segment in us */
373 __u32 m2; /* slope of the second segment in bps */
374};
375
376struct tc_hfsc_stats {
377 __u64 work; /* total work done */
378 __u64 rtwork; /* work done by real-time criteria */
379 __u32 period; /* current period */
380 __u32 level; /* class level in hierarchy */
381};
382
383enum {
384 TCA_HFSC_UNSPEC,
385 TCA_HFSC_RSC,
386 TCA_HFSC_FSC,
387 TCA_HFSC_USC,
388 __TCA_HFSC_MAX,
389};
390
391#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
392
393
394/* CBQ section */
395
396#define TC_CBQ_MAXPRIO 8
397#define TC_CBQ_MAXLEVEL 8
398#define TC_CBQ_DEF_EWMA 5
399
400struct tc_cbq_lssopt {
401 unsigned char change;
402 unsigned char flags;
403#define TCF_CBQ_LSS_BOUNDED 1
404#define TCF_CBQ_LSS_ISOLATED 2
405 unsigned char ewma_log;
406 unsigned char level;
407#define TCF_CBQ_LSS_FLAGS 1
408#define TCF_CBQ_LSS_EWMA 2
409#define TCF_CBQ_LSS_MAXIDLE 4
410#define TCF_CBQ_LSS_MINIDLE 8
411#define TCF_CBQ_LSS_OFFTIME 0x10
412#define TCF_CBQ_LSS_AVPKT 0x20
413 __u32 maxidle;
414 __u32 minidle;
415 __u32 offtime;
416 __u32 avpkt;
417};
418
419struct tc_cbq_wrropt {
420 unsigned char flags;
421 unsigned char priority;
422 unsigned char cpriority;
423 unsigned char __reserved;
424 __u32 allot;
425 __u32 weight;
426};
427
428struct tc_cbq_ovl {
429 unsigned char strategy;
430#define TC_CBQ_OVL_CLASSIC 0
431#define TC_CBQ_OVL_DELAY 1
432#define TC_CBQ_OVL_LOWPRIO 2
433#define TC_CBQ_OVL_DROP 3
434#define TC_CBQ_OVL_RCLASSIC 4
435 unsigned char priority2;
436 __u16 pad;
437 __u32 penalty;
438};
439
440struct tc_cbq_police {
441 unsigned char police;
442 unsigned char __res1;
443 unsigned short __res2;
444};
445
446struct tc_cbq_fopt {
447 __u32 split;
448 __u32 defmap;
449 __u32 defchange;
450};
451
452struct tc_cbq_xstats {
453 __u32 borrows;
454 __u32 overactions;
455 __s32 avgidle;
456 __s32 undertime;
457};
458
459enum {
460 TCA_CBQ_UNSPEC,
461 TCA_CBQ_LSSOPT,
462 TCA_CBQ_WRROPT,
463 TCA_CBQ_FOPT,
464 TCA_CBQ_OVL_STRATEGY,
465 TCA_CBQ_RATE,
466 TCA_CBQ_RTAB,
467 TCA_CBQ_POLICE,
468 __TCA_CBQ_MAX,
469};
470
471#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
472
473/* dsmark section */
474
475enum {
476 TCA_DSMARK_UNSPEC,
477 TCA_DSMARK_INDICES,
478 TCA_DSMARK_DEFAULT_INDEX,
479 TCA_DSMARK_SET_TC_INDEX,
480 TCA_DSMARK_MASK,
481 TCA_DSMARK_VALUE,
482 __TCA_DSMARK_MAX,
483};
484
485#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
486
487/* ATM section */
488
489enum {
490 TCA_ATM_UNSPEC,
491 TCA_ATM_FD, /* file/socket descriptor */
492 TCA_ATM_PTR, /* pointer to descriptor - later */
493 TCA_ATM_HDR, /* LL header */
494 TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
495 TCA_ATM_ADDR, /* PVC address (for output only) */
496 TCA_ATM_STATE, /* VC state (ATM_VS_*; for output only) */
497 __TCA_ATM_MAX,
498};
499
500#define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
501
502/* Network emulator */
503
504enum {
505 TCA_NETEM_UNSPEC,
506 TCA_NETEM_CORR,
507 TCA_NETEM_DELAY_DIST,
508 TCA_NETEM_REORDER,
509 TCA_NETEM_CORRUPT,
510 TCA_NETEM_LOSS,
511 TCA_NETEM_RATE,
512 TCA_NETEM_ECN,
513 __TCA_NETEM_MAX,
514};
515
516#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
517
518struct tc_netem_qopt {
519 __u32 latency; /* added delay (us) */
520 __u32 limit; /* fifo limit (packets) */
521 __u32 loss; /* random packet loss (0=none ~0=100%) */
522 __u32 gap; /* re-ordering gap (0 for none) */
523 __u32 duplicate; /* random packet dup (0=none ~0=100%) */
524 __u32 jitter; /* random jitter in latency (us) */
525};
526
527struct tc_netem_corr {
528 __u32 delay_corr; /* delay correlation */
529 __u32 loss_corr; /* packet loss correlation */
530 __u32 dup_corr; /* duplicate correlation */
531};
532
533struct tc_netem_reorder {
534 __u32 probability;
535 __u32 correlation;
536};
537
538struct tc_netem_corrupt {
539 __u32 probability;
540 __u32 correlation;
541};
542
543struct tc_netem_rate {
544 __u32 rate; /* byte/s */
545 __s32 packet_overhead;
546 __u32 cell_size;
547 __s32 cell_overhead;
548};
549
550enum {
551 NETEM_LOSS_UNSPEC,
552 NETEM_LOSS_GI, /* General Intuitive - 4 state model */
553 NETEM_LOSS_GE, /* Gilbert Elliot models */
554 __NETEM_LOSS_MAX
555};
556#define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1)
557
558/* State transition probabilities for 4 state model */
559struct tc_netem_gimodel {
560 __u32 p13;
561 __u32 p31;
562 __u32 p32;
563 __u32 p14;
564 __u32 p23;
565};
566
567/* Gilbert-Elliot models */
568struct tc_netem_gemodel {
569 __u32 p;
570 __u32 r;
571 __u32 h;
572 __u32 k1;
573};
574
575#define NETEM_DIST_SCALE 8192
576#define NETEM_DIST_MAX 16384
577
578/* DRR */
579
580enum {
581 TCA_DRR_UNSPEC,
582 TCA_DRR_QUANTUM,
583 __TCA_DRR_MAX
584};
585
586#define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
587
588struct tc_drr_stats {
589 __u32 deficit;
590};
591
592/* MQPRIO */
593#define TC_QOPT_BITMASK 15
594#define TC_QOPT_MAX_QUEUE 16
595
596struct tc_mqprio_qopt {
597 __u8 num_tc;
598 __u8 prio_tc_map[TC_QOPT_BITMASK + 1];
599 __u8 hw;
600 __u16 count[TC_QOPT_MAX_QUEUE];
601 __u16 offset[TC_QOPT_MAX_QUEUE];
602};
603
604/* SFB */
605
606enum {
607 TCA_SFB_UNSPEC,
608 TCA_SFB_PARMS,
609 __TCA_SFB_MAX,
610};
611
612#define TCA_SFB_MAX (__TCA_SFB_MAX - 1)
613
614/*
615 * Note: increment, decrement are Q0.16 fixed-point values.
616 */
617struct tc_sfb_qopt {
618 __u32 rehash_interval; /* delay between hash move, in ms */
619 __u32 warmup_time; /* double buffering warmup time in ms (warmup_time < rehash_interval) */
620 __u32 max; /* max len of qlen_min */
621 __u32 bin_size; /* maximum queue length per bin */
622 __u32 increment; /* probability increment, (d1 in Blue) */
623 __u32 decrement; /* probability decrement, (d2 in Blue) */
624 __u32 limit; /* max SFB queue length */
625 __u32 penalty_rate; /* inelastic flows are rate limited to 'rate' pps */
626 __u32 penalty_burst;
627};
628
629struct tc_sfb_xstats {
630 __u32 earlydrop;
631 __u32 penaltydrop;
632 __u32 bucketdrop;
633 __u32 queuedrop;
634 __u32 childdrop; /* drops in child qdisc */
635 __u32 marked;
636 __u32 maxqlen;
637 __u32 maxprob;
638 __u32 avgprob;
639};
640
641#define SFB_MAX_PROB 0xFFFF
642
643/* QFQ */
644enum {
645 TCA_QFQ_UNSPEC,
646 TCA_QFQ_WEIGHT,
647 TCA_QFQ_LMAX,
648 __TCA_QFQ_MAX
649};
650
651#define TCA_QFQ_MAX (__TCA_QFQ_MAX - 1)
652
653struct tc_qfq_stats {
654 __u32 weight;
655 __u32 lmax;
656};
657
658/* CODEL */
659
660enum {
661 TCA_CODEL_UNSPEC,
662 TCA_CODEL_TARGET,
663 TCA_CODEL_LIMIT,
664 TCA_CODEL_INTERVAL,
665 TCA_CODEL_ECN,
666 __TCA_CODEL_MAX
667};
668
669#define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1)
670
671struct tc_codel_xstats {
672 __u32 maxpacket; /* largest packet we've seen so far */
673 __u32 count; /* how many drops we've done since the last time we
674 * entered dropping state
675 */
676 __u32 lastcount; /* count at entry to dropping state */
677 __u32 ldelay; /* in-queue delay seen by most recently dequeued packet */
678 __s32 drop_next; /* time to drop next packet */
679 __u32 drop_overlimit; /* number of time max qdisc packet limit was hit */
680 __u32 ecn_mark; /* number of packets we ECN marked instead of dropped */
681 __u32 dropping; /* are we in dropping state ? */
682};
683
684/* FQ_CODEL */
685
686enum {
687 TCA_FQ_CODEL_UNSPEC,
688 TCA_FQ_CODEL_TARGET,
689 TCA_FQ_CODEL_LIMIT,
690 TCA_FQ_CODEL_INTERVAL,
691 TCA_FQ_CODEL_ECN,
692 TCA_FQ_CODEL_FLOWS,
693 TCA_FQ_CODEL_QUANTUM,
694 __TCA_FQ_CODEL_MAX
695};
696
697#define TCA_FQ_CODEL_MAX (__TCA_FQ_CODEL_MAX - 1)
698
699enum {
700 TCA_FQ_CODEL_XSTATS_QDISC,
701 TCA_FQ_CODEL_XSTATS_CLASS,
702};
703
704struct tc_fq_codel_qd_stats {
705 __u32 maxpacket; /* largest packet we've seen so far */
706 __u32 drop_overlimit; /* number of time max qdisc
707 * packet limit was hit
708 */
709 __u32 ecn_mark; /* number of packets we ECN marked
710 * instead of being dropped
711 */
712 __u32 new_flow_count; /* number of time packets
713 * created a 'new flow'
714 */
715 __u32 new_flows_len; /* count of flows in new list */
716 __u32 old_flows_len; /* count of flows in old list */
717};
718
719struct tc_fq_codel_cl_stats {
720 __s32 deficit;
721 __u32 ldelay; /* in-queue delay seen by most recently
722 * dequeued packet
723 */
724 __u32 count;
725 __u32 lastcount;
726 __u32 dropping;
727 __s32 drop_next;
728};
729
730struct tc_fq_codel_xstats {
731 __u32 type;
732 union {
733 struct tc_fq_codel_qd_stats qdisc_stats;
734 struct tc_fq_codel_cl_stats class_stats;
735 };
736};
737
738#endif
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 721301b0a908..93d142ad1528 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 84e6a55a1202..99b400b8a241 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 48fe8bc398d1..c08386fb3e08 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/posix_types.h b/include/linux/posix_types.h
deleted file mode 100644
index 988f76e636e3..000000000000
--- a/include/linux/posix_types.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef _LINUX_POSIX_TYPES_H
2#define _LINUX_POSIX_TYPES_H
3
4#include <linux/stddef.h>
5
6/*
7 * This allows for 1024 file descriptors: if NR_OPEN is ever grown
8 * beyond that you'll have to change this too. But 1024 fd's seem to be
9 * enough even for such "real" unices like OSF/1, so hopefully this is
10 * one limit that doesn't have to be changed [again].
11 *
12 * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
13 * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
14 * place for them. Solved by having dummy defines in <sys/time.h>.
15 */
16
17/*
18 * This macro may have been defined in <gnu/types.h>. But we always
19 * use the one here.
20 */
21#undef __FD_SETSIZE
22#define __FD_SETSIZE 1024
23
24typedef struct {
25 unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))];
26} __kernel_fd_set;
27
28/* Type of a signal handler. */
29typedef void (*__kernel_sighandler_t)(int);
30
31/* Type of a SYSV IPC key. */
32typedef int __kernel_key_t;
33typedef int __kernel_mqd_t;
34
35#include <asm/posix_types.h>
36
37#endif /* _LINUX_POSIX_TYPES_H */
diff --git a/include/linux/ppdev.h b/include/linux/ppdev.h
deleted file mode 100644
index dc18c5d23ebe..000000000000
--- a/include/linux/ppdev.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * linux/include/linux/ppdev.h
3 *
4 * User-space parallel port device driver (header file).
5 *
6 * Copyright (C) 1998-9 Tim Waugh <tim@cyberelk.demon.co.uk>
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 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 * Added PPGETTIME/PPSETTIME, Fred Barnes, 1999
14 * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001
15 */
16
17#define PP_IOCTL 'p'
18
19/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
20#define PPSETMODE _IOW(PP_IOCTL, 0x80, int)
21
22/* Read status */
23#define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char)
24#define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
25
26/* Read/write control */
27#define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char)
28#define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char)
29
30struct ppdev_frob_struct {
31 unsigned char mask;
32 unsigned char val;
33};
34#define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
35
36/* Read/write data */
37#define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char)
38#define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char)
39
40/* Read/write econtrol (not used) */
41#define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
42#define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
43
44/* Read/write FIFO (not used) */
45#define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
46#define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
47
48/* Claim the port to start using it */
49#define PPCLAIM _IO(PP_IOCTL, 0x8b)
50
51/* Release the port when you aren't using it */
52#define PPRELEASE _IO(PP_IOCTL, 0x8c)
53
54/* Yield the port (release it if another driver is waiting,
55 * then reclaim) */
56#define PPYIELD _IO(PP_IOCTL, 0x8d)
57
58/* Register device exclusively (must be before PPCLAIM). */
59#define PPEXCL _IO(PP_IOCTL, 0x8f)
60
61/* Data line direction: non-zero for input mode. */
62#define PPDATADIR _IOW(PP_IOCTL, 0x90, int)
63
64/* Negotiate a particular IEEE 1284 mode. */
65#define PPNEGOT _IOW(PP_IOCTL, 0x91, int)
66
67/* Set control lines when an interrupt occurs. */
68#define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
69
70/* Clear (and return) interrupt count. */
71#define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int)
72
73/* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
74#define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
75
76/* Set and get port timeout (struct timeval's) */
77#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
78#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
79
80/* Get available modes (what the hardware can do) */
81#define PPGETMODES _IOR(PP_IOCTL, 0x97, unsigned int)
82
83/* Get the current mode and phaze */
84#define PPGETMODE _IOR(PP_IOCTL, 0x98, int)
85#define PPGETPHASE _IOR(PP_IOCTL, 0x99, int)
86
87/* get/set flags */
88#define PPGETFLAGS _IOR(PP_IOCTL, 0x9a, int)
89#define PPSETFLAGS _IOW(PP_IOCTL, 0x9b, int)
90
91/* flags visible to the world */
92#define PP_FASTWRITE (1<<2)
93#define PP_FASTREAD (1<<3)
94#define PP_W91284PIC (1<<4)
95
96/* only masks user-visible flags */
97#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
98
99
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index b7dc06f7f1d1..4ea1d377e1ad 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -10,7 +10,8 @@
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#ifdef __KERNEL__ 13#include <uapi/linux/ppp-comp.h>
14
14 15
15struct module; 16struct module;
16 17
@@ -100,89 +101,6 @@ struct compressor {
100#define DECOMP_ERROR -1 /* error detected before decomp. */ 101#define DECOMP_ERROR -1 /* error detected before decomp. */
101#define DECOMP_FATALERROR -2 /* error detected after decomp. */ 102#define DECOMP_FATALERROR -2 /* error detected after decomp. */
102 103
103#endif /* __KERNEL__ */
104
105/*
106 * CCP codes.
107 */
108
109#define CCP_CONFREQ 1
110#define CCP_CONFACK 2
111#define CCP_TERMREQ 5
112#define CCP_TERMACK 6
113#define CCP_RESETREQ 14
114#define CCP_RESETACK 15
115
116/*
117 * Max # bytes for a CCP option
118 */
119
120#define CCP_MAX_OPTION_LENGTH 32
121
122/*
123 * Parts of a CCP packet.
124 */
125
126#define CCP_CODE(dp) ((dp)[0])
127#define CCP_ID(dp) ((dp)[1])
128#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3])
129#define CCP_HDRLEN 4
130
131#define CCP_OPT_CODE(dp) ((dp)[0])
132#define CCP_OPT_LENGTH(dp) ((dp)[1])
133#define CCP_OPT_MINLEN 2
134
135/*
136 * Definitions for BSD-Compress.
137 */
138
139#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */
140#define CILEN_BSD_COMPRESS 3 /* length of config. option */
141
142/* Macros for handling the 3rd byte of the BSD-Compress config option. */
143#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */
144#define BSD_VERSION(x) ((x) >> 5) /* version of option format */
145#define BSD_CURRENT_VERSION 1 /* current version number */
146#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))
147
148#define BSD_MIN_BITS 9 /* smallest code size supported */
149#define BSD_MAX_BITS 15 /* largest code size supported */
150
151/*
152 * Definitions for Deflate.
153 */
154
155#define CI_DEFLATE 26 /* config option for Deflate */
156#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
157#define CILEN_DEFLATE 4 /* length of its config option */
158
159#define DEFLATE_MIN_SIZE 9
160#define DEFLATE_MAX_SIZE 15
161#define DEFLATE_METHOD_VAL 8
162#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
163#define DEFLATE_METHOD(x) ((x) & 0x0F)
164#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
165#define DEFLATE_CHK_SEQUENCE 0
166
167/*
168 * Definitions for MPPE.
169 */
170
171#define CI_MPPE 18 /* config option for MPPE */
172#define CILEN_MPPE 6 /* length of config option */
173
174/*
175 * Definitions for other, as yet unsupported, compression methods.
176 */
177
178#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */
179#define CILEN_PREDICTOR_1 2 /* length of its config option */
180#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
181#define CILEN_PREDICTOR_2 2 /* length of its config option */
182
183#ifdef __KERNEL__
184extern int ppp_register_compressor(struct compressor *); 104extern int ppp_register_compressor(struct compressor *);
185extern void ppp_unregister_compressor(struct compressor *); 105extern void ppp_unregister_compressor(struct compressor *);
186#endif /* __KERNEL__ */
187
188#endif /* _NET_PPP_COMP_H */ 106#endif /* _NET_PPP_COMP_H */
diff --git a/include/linux/ppp-ioctl.h b/include/linux/ppp-ioctl.h
deleted file mode 100644
index 2d9a8859550a..000000000000
--- a/include/linux/ppp-ioctl.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * ppp-ioctl.h - PPP ioctl definitions.
3 *
4 * Copyright 1999-2002 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 _PPP_IOCTL_H
11#define _PPP_IOCTL_H
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15
16/*
17 * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
18 */
19#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
20#define SC_COMP_AC 0x00000002 /* header compression (output) */
21#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
22#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
23#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
24#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
25#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
26#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
27#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
28#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
29#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
30#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
31#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
32#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
33#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
34#define SC_DEBUG 0x00010000 /* enable debug messages */
35#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
36#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
37#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
38#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
39#define SC_SYNC 0x00200000 /* synchronous serial mode */
40#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
41#define SC_MASK 0x0f600fff /* bits that user can change */
42
43/* state bits */
44#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
45#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
46#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
47#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
48#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
49#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
50#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
51
52/* Used with PPPIOCGNPMODE/PPPIOCSNPMODE */
53struct npioctl {
54 int protocol; /* PPP protocol, e.g. PPP_IP */
55 enum NPmode mode;
56};
57
58/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
59struct ppp_option_data {
60 __u8 __user *ptr;
61 __u32 length;
62 int transmit;
63};
64
65/* For PPPIOCGL2TPSTATS */
66struct pppol2tp_ioc_stats {
67 __u16 tunnel_id; /* redundant */
68 __u16 session_id; /* if zero, get tunnel stats */
69 __u32 using_ipsec:1; /* valid only for session_id == 0 */
70 __aligned_u64 tx_packets;
71 __aligned_u64 tx_bytes;
72 __aligned_u64 tx_errors;
73 __aligned_u64 rx_packets;
74 __aligned_u64 rx_bytes;
75 __aligned_u64 rx_seq_discards;
76 __aligned_u64 rx_oos_packets;
77 __aligned_u64 rx_errors;
78};
79
80/*
81 * Ioctl definitions.
82 */
83
84#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
85#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
86#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
87#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
88#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
89#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
90#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
91#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
92#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
93#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
94#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
95#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
96#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
97#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
98#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
99#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
100#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
101#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
102#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
103#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
104#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
105#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
106#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
107#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
108#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
109#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
110#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
111#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
112#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
113#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
114
115#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
116#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
117#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
118
119#endif /* _PPP_IOCTL_H */
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index ba416f67eb62..28aa0237c8c3 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/pps.h b/include/linux/pps.h
deleted file mode 100644
index a9bb1d93451a..000000000000
--- a/include/linux/pps.h
+++ /dev/null
@@ -1,131 +0,0 @@
1/*
2 * PPS API header
3 *
4 * Copyright (C) 2005-2009 Rodolfo Giometti <giometti@linux.it>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21
22#ifndef _PPS_H_
23#define _PPS_H_
24
25#include <linux/types.h>
26
27#define PPS_VERSION "5.3.6"
28#define PPS_MAX_SOURCES 16 /* should be enough... */
29
30/* Implementation note: the logical states ``assert'' and ``clear''
31 * are implemented in terms of the chip register, i.e. ``assert''
32 * means the bit is set. */
33
34/*
35 * 3.2 New data structures
36 */
37
38#define PPS_API_VERS_1 1
39#define PPS_API_VERS PPS_API_VERS_1 /* we use API version 1 */
40#define PPS_MAX_NAME_LEN 32
41
42/* 32-bit vs. 64-bit compatibility.
43 *
44 * 0n i386, the alignment of a uint64_t is only 4 bytes, while on most other
45 * architectures it's 8 bytes. On i386, there will be no padding between the
46 * two consecutive 'struct pps_ktime' members of struct pps_kinfo and struct
47 * pps_kparams. But on most platforms there will be padding to ensure correct
48 * alignment.
49 *
50 * The simple fix is probably to add an explicit padding.
51 * [David Woodhouse]
52 */
53struct pps_ktime {
54 __s64 sec;
55 __s32 nsec;
56 __u32 flags;
57};
58#define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */
59
60struct pps_kinfo {
61 __u32 assert_sequence; /* seq. num. of assert event */
62 __u32 clear_sequence; /* seq. num. of clear event */
63 struct pps_ktime assert_tu; /* time of assert event */
64 struct pps_ktime clear_tu; /* time of clear event */
65 int current_mode; /* current mode bits */
66};
67
68struct pps_kparams {
69 int api_version; /* API version # */
70 int mode; /* mode bits */
71 struct pps_ktime assert_off_tu; /* offset compensation for assert */
72 struct pps_ktime clear_off_tu; /* offset compensation for clear */
73};
74
75/*
76 * 3.3 Mode bit definitions
77 */
78
79/* Device/implementation parameters */
80#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
81#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
82#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
83
84#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
85#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
86
87#define PPS_CANWAIT 0x100 /* can we wait for an event? */
88#define PPS_CANPOLL 0x200 /* bit reserved for future use */
89
90/* Kernel actions */
91#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
92#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
93
94/* Timestamp formats */
95#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
96#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
97
98/*
99 * 3.4.4 New functions: disciplining the kernel timebase
100 */
101
102/* Kernel consumers */
103#define PPS_KC_HARDPPS 0 /* hardpps() (or equivalent) */
104#define PPS_KC_HARDPPS_PLL 1 /* hardpps() constrained to
105 use a phase-locked loop */
106#define PPS_KC_HARDPPS_FLL 2 /* hardpps() constrained to
107 use a frequency-locked loop */
108/*
109 * Here begins the implementation-specific part!
110 */
111
112struct pps_fdata {
113 struct pps_kinfo info;
114 struct pps_ktime timeout;
115};
116
117struct pps_bind_args {
118 int tsformat; /* format of time stamps */
119 int edge; /* selected event type */
120 int consumer; /* selected kernel consumer */
121};
122
123#include <linux/ioctl.h>
124
125#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *)
126#define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *)
127#define PPS_GETCAP _IOR('p', 0xa3, int *)
128#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *)
129#define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *)
130
131#endif /* _PPS_H_ */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
deleted file mode 100644
index 289760f424aa..000000000000
--- a/include/linux/prctl.h
+++ /dev/null
@@ -1,152 +0,0 @@
1#ifndef _LINUX_PRCTL_H
2#define _LINUX_PRCTL_H
3
4/* Values to pass as first argument to prctl() */
5
6#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */
7#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */
8
9/* Get/set current->mm->dumpable */
10#define PR_GET_DUMPABLE 3
11#define PR_SET_DUMPABLE 4
12
13/* Get/set unaligned access control bits (if meaningful) */
14#define PR_GET_UNALIGN 5
15#define PR_SET_UNALIGN 6
16# define PR_UNALIGN_NOPRINT 1 /* silently fix up unaligned user accesses */
17# define PR_UNALIGN_SIGBUS 2 /* generate SIGBUS on unaligned user access */
18
19/* Get/set whether or not to drop capabilities on setuid() away from
20 * uid 0 (as per security/commoncap.c) */
21#define PR_GET_KEEPCAPS 7
22#define PR_SET_KEEPCAPS 8
23
24/* Get/set floating-point emulation control bits (if meaningful) */
25#define PR_GET_FPEMU 9
26#define PR_SET_FPEMU 10
27# define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */
28# define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */
29
30/* Get/set floating-point exception mode (if meaningful) */
31#define PR_GET_FPEXC 11
32#define PR_SET_FPEXC 12
33# define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */
34# define PR_FP_EXC_DIV 0x010000 /* floating point divide by zero */
35# define PR_FP_EXC_OVF 0x020000 /* floating point overflow */
36# define PR_FP_EXC_UND 0x040000 /* floating point underflow */
37# define PR_FP_EXC_RES 0x080000 /* floating point inexact result */
38# define PR_FP_EXC_INV 0x100000 /* floating point invalid operation */
39# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */
40# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */
41# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */
42# define PR_FP_EXC_PRECISE 3 /* precise exception mode */
43
44/* Get/set whether we use statistical process timing or accurate timestamp
45 * based process timing */
46#define PR_GET_TIMING 13
47#define PR_SET_TIMING 14
48# define PR_TIMING_STATISTICAL 0 /* Normal, traditional,
49 statistical process timing */
50# define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based
51 process timing */
52
53#define PR_SET_NAME 15 /* Set process name */
54#define PR_GET_NAME 16 /* Get process name */
55
56/* Get/set process endian */
57#define PR_GET_ENDIAN 19
58#define PR_SET_ENDIAN 20
59# define PR_ENDIAN_BIG 0
60# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
61# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
62
63/* Get/set process seccomp mode */
64#define PR_GET_SECCOMP 21
65#define PR_SET_SECCOMP 22
66
67/* Get/set the capability bounding set (as per security/commoncap.c) */
68#define PR_CAPBSET_READ 23
69#define PR_CAPBSET_DROP 24
70
71/* Get/set the process' ability to use the timestamp counter instruction */
72#define PR_GET_TSC 25
73#define PR_SET_TSC 26
74# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
75# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
76
77/* Get/set securebits (as per security/commoncap.c) */
78#define PR_GET_SECUREBITS 27
79#define PR_SET_SECUREBITS 28
80
81/*
82 * Get/set the timerslack as used by poll/select/nanosleep
83 * A value of 0 means "use default"
84 */
85#define PR_SET_TIMERSLACK 29
86#define PR_GET_TIMERSLACK 30
87
88#define PR_TASK_PERF_EVENTS_DISABLE 31
89#define PR_TASK_PERF_EVENTS_ENABLE 32
90
91/*
92 * Set early/late kill mode for hwpoison memory corruption.
93 * This influences when the process gets killed on a memory corruption.
94 */
95#define PR_MCE_KILL 33
96# define PR_MCE_KILL_CLEAR 0
97# define PR_MCE_KILL_SET 1
98
99# define PR_MCE_KILL_LATE 0
100# define PR_MCE_KILL_EARLY 1
101# define PR_MCE_KILL_DEFAULT 2
102
103#define PR_MCE_KILL_GET 34
104
105/*
106 * Tune up process memory map specifics.
107 */
108#define PR_SET_MM 35
109# define PR_SET_MM_START_CODE 1
110# define PR_SET_MM_END_CODE 2
111# define PR_SET_MM_START_DATA 3
112# define PR_SET_MM_END_DATA 4
113# define PR_SET_MM_START_STACK 5
114# define PR_SET_MM_START_BRK 6
115# define PR_SET_MM_BRK 7
116# define PR_SET_MM_ARG_START 8
117# define PR_SET_MM_ARG_END 9
118# define PR_SET_MM_ENV_START 10
119# define PR_SET_MM_ENV_END 11
120# define PR_SET_MM_AUXV 12
121# define PR_SET_MM_EXE_FILE 13
122
123/*
124 * Set specific pid that is allowed to ptrace the current task.
125 * A value of 0 mean "no process".
126 */
127#define PR_SET_PTRACER 0x59616d61
128# define PR_SET_PTRACER_ANY ((unsigned long)-1)
129
130#define PR_SET_CHILD_SUBREAPER 36
131#define PR_GET_CHILD_SUBREAPER 37
132
133/*
134 * If no_new_privs is set, then operations that grant new privileges (i.e.
135 * execve) will either fail or not grant them. This affects suid/sgid,
136 * file capabilities, and LSMs.
137 *
138 * Operations that merely manipulate or drop existing privileges (setresuid,
139 * capset, etc.) will still work. Drop those privileges if you want them gone.
140 *
141 * Changing LSM security domain is considered a new privilege. So, for example,
142 * asking selinux for a specific new context (e.g. with runcon) will result
143 * in execve returning -EPERM.
144 *
145 * See Documentation/prctl/no_new_privs.txt for more details.
146 */
147#define PR_SET_NO_NEW_PRIVS 38
148#define PR_GET_NO_NEW_PRIVS 39
149
150#define PR_GET_TID_ADDRESS 40
151
152#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/ptp_clock.h b/include/linux/ptp_clock.h
deleted file mode 100644
index 94e981f810a2..000000000000
--- a/include/linux/ptp_clock.h
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * PTP 1588 clock support - user space interface
3 *
4 * Copyright (C) 2010 OMICRON electronics GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _PTP_CLOCK_H_
22#define _PTP_CLOCK_H_
23
24#include <linux/ioctl.h>
25#include <linux/types.h>
26
27/* PTP_xxx bits, for the flags field within the request structures. */
28#define PTP_ENABLE_FEATURE (1<<0)
29#define PTP_RISING_EDGE (1<<1)
30#define PTP_FALLING_EDGE (1<<2)
31
32/*
33 * struct ptp_clock_time - represents a time value
34 *
35 * The sign of the seconds field applies to the whole value. The
36 * nanoseconds field is always unsigned. The reserved field is
37 * included for sub-nanosecond resolution, should the demand for
38 * this ever appear.
39 *
40 */
41struct ptp_clock_time {
42 __s64 sec; /* seconds */
43 __u32 nsec; /* nanoseconds */
44 __u32 reserved;
45};
46
47struct ptp_clock_caps {
48 int max_adj; /* Maximum frequency adjustment in parts per billon. */
49 int n_alarm; /* Number of programmable alarms. */
50 int n_ext_ts; /* Number of external time stamp channels. */
51 int n_per_out; /* Number of programmable periodic signals. */
52 int pps; /* Whether the clock supports a PPS callback. */
53 int rsv[15]; /* Reserved for future use. */
54};
55
56struct ptp_extts_request {
57 unsigned int index; /* Which channel to configure. */
58 unsigned int flags; /* Bit field for PTP_xxx flags. */
59 unsigned int rsv[2]; /* Reserved for future use. */
60};
61
62struct ptp_perout_request {
63 struct ptp_clock_time start; /* Absolute start time. */
64 struct ptp_clock_time period; /* Desired period, zero means disable. */
65 unsigned int index; /* Which channel to configure. */
66 unsigned int flags; /* Reserved for future use. */
67 unsigned int rsv[4]; /* Reserved for future use. */
68};
69
70#define PTP_CLK_MAGIC '='
71
72#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
73#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
74#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
75#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
76
77struct ptp_extts_event {
78 struct ptp_clock_time t; /* Time event occured. */
79 unsigned int index; /* Which channel produced the event. */
80 unsigned int flags; /* Reserved for future use. */
81 unsigned int rsv[2]; /* Reserved for future use. */
82};
83
84#endif
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 1d24ffad59c5..e0ff4689d35a 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/qnx4_fs.h b/include/linux/qnx4_fs.h
deleted file mode 100644
index 8b9aee1a9ce3..000000000000
--- a/include/linux/qnx4_fs.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * Name : qnx4_fs.h
3 * Author : Richard Frowijn
4 * Function : qnx4 global filesystem definitions
5 * History : 23-03-1998 created
6 */
7#ifndef _LINUX_QNX4_FS_H
8#define _LINUX_QNX4_FS_H
9
10#include <linux/types.h>
11#include <linux/qnxtypes.h>
12#include <linux/magic.h>
13
14#define QNX4_ROOT_INO 1
15
16#define QNX4_MAX_XTNTS_PER_XBLK 60
17/* for di_status */
18#define QNX4_FILE_USED 0x01
19#define QNX4_FILE_MODIFIED 0x02
20#define QNX4_FILE_BUSY 0x04
21#define QNX4_FILE_LINK 0x08
22#define QNX4_FILE_INODE 0x10
23#define QNX4_FILE_FSYSCLEAN 0x20
24
25#define QNX4_I_MAP_SLOTS 8
26#define QNX4_Z_MAP_SLOTS 64
27#define QNX4_VALID_FS 0x0001 /* Clean fs. */
28#define QNX4_ERROR_FS 0x0002 /* fs has errors. */
29#define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */
30#define QNX4_BLOCK_SIZE_BITS 9 /* blocksize shift */
31#define QNX4_DIR_ENTRY_SIZE 0x040 /* dir entry size of 64 bytes */
32#define QNX4_DIR_ENTRY_SIZE_BITS 6 /* dir entry size shift */
33#define QNX4_XBLK_ENTRY_SIZE 0x200 /* xblk entry size */
34#define QNX4_INODES_PER_BLOCK 0x08 /* 512 / 64 */
35
36/* for filenames */
37#define QNX4_SHORT_NAME_MAX 16
38#define QNX4_NAME_MAX 48
39
40/*
41 * This is the original qnx4 inode layout on disk.
42 */
43struct qnx4_inode_entry {
44 char di_fname[QNX4_SHORT_NAME_MAX];
45 qnx4_off_t di_size;
46 qnx4_xtnt_t di_first_xtnt;
47 __le32 di_xblk;
48 __le32 di_ftime;
49 __le32 di_mtime;
50 __le32 di_atime;
51 __le32 di_ctime;
52 qnx4_nxtnt_t di_num_xtnts;
53 qnx4_mode_t di_mode;
54 qnx4_muid_t di_uid;
55 qnx4_mgid_t di_gid;
56 qnx4_nlink_t di_nlink;
57 __u8 di_zero[4];
58 qnx4_ftype_t di_type;
59 __u8 di_status;
60};
61
62struct qnx4_link_info {
63 char dl_fname[QNX4_NAME_MAX];
64 __le32 dl_inode_blk;
65 __u8 dl_inode_ndx;
66 __u8 dl_spare[10];
67 __u8 dl_status;
68};
69
70struct qnx4_xblk {
71 __le32 xblk_next_xblk;
72 __le32 xblk_prev_xblk;
73 __u8 xblk_num_xtnts;
74 __u8 xblk_spare[3];
75 __le32 xblk_num_blocks;
76 qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
77 char xblk_signature[8];
78 qnx4_xtnt_t xblk_first_xtnt;
79};
80
81struct qnx4_super_block {
82 struct qnx4_inode_entry RootDir;
83 struct qnx4_inode_entry Inode;
84 struct qnx4_inode_entry Boot;
85 struct qnx4_inode_entry AltBoot;
86};
87
88#endif
diff --git a/include/linux/qnxtypes.h b/include/linux/qnxtypes.h
deleted file mode 100644
index bebbe5cc4fb8..000000000000
--- a/include/linux/qnxtypes.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Name : qnxtypes.h
3 * Author : Richard Frowijn
4 * Function : standard qnx types
5 * History : 22-03-1998 created
6 *
7 */
8
9#ifndef _QNX4TYPES_H
10#define _QNX4TYPES_H
11
12#include <linux/types.h>
13
14typedef __le16 qnx4_nxtnt_t;
15typedef __u8 qnx4_ftype_t;
16
17typedef struct {
18 __le32 xtnt_blk;
19 __le32 xtnt_size;
20} qnx4_xtnt_t;
21
22typedef __le16 qnx4_mode_t;
23typedef __le16 qnx4_muid_t;
24typedef __le16 qnx4_mgid_t;
25typedef __le32 qnx4_off_t;
26typedef __le16 qnx4_nlink_t;
27
28#endif
diff --git a/include/linux/quota.h b/include/linux/quota.h
index dcd5721e626d..58fdef125252 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/radeonfb.h b/include/linux/radeonfb.h
deleted file mode 100644
index 8c4bbdecc44f..000000000000
--- a/include/linux/radeonfb.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef __LINUX_RADEONFB_H__
2#define __LINUX_RADEONFB_H__
3
4#include <asm/ioctl.h>
5#include <linux/types.h>
6
7#define ATY_RADEON_LCD_ON 0x00000001
8#define ATY_RADEON_CRT_ON 0x00000002
9
10
11#define FBIO_RADEON_GET_MIRROR _IOR('@', 3, size_t)
12#define FBIO_RADEON_SET_MIRROR _IOW('@', 4, size_t)
13
14#endif
15
diff --git a/include/linux/random.h b/include/linux/random.h
index ac621ce886ca..6330ed47b38b 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/raw.h b/include/linux/raw.h
deleted file mode 100644
index 62d543e70603..000000000000
--- a/include/linux/raw.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef __LINUX_RAW_H
2#define __LINUX_RAW_H
3
4#include <linux/types.h>
5
6#define RAW_SETBIND _IO( 0xac, 0 )
7#define RAW_GETBIND _IO( 0xac, 1 )
8
9struct raw_config_request
10{
11 int raw_minor;
12 __u64 block_major;
13 __u64 block_minor;
14};
15
16#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS
17
18#endif /* __LINUX_RAW_H */
diff --git a/include/linux/rds.h b/include/linux/rds.h
deleted file mode 100644
index 91950950aa59..000000000000
--- a/include/linux/rds.h
+++ /dev/null
@@ -1,285 +0,0 @@
1/*
2 * Copyright (c) 2008 Oracle. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 *
32 */
33
34#ifndef _LINUX_RDS_H
35#define _LINUX_RDS_H
36
37#include <linux/types.h>
38
39#define RDS_IB_ABI_VERSION 0x301
40
41/*
42 * setsockopt/getsockopt for SOL_RDS
43 */
44#define RDS_CANCEL_SENT_TO 1
45#define RDS_GET_MR 2
46#define RDS_FREE_MR 3
47/* deprecated: RDS_BARRIER 4 */
48#define RDS_RECVERR 5
49#define RDS_CONG_MONITOR 6
50#define RDS_GET_MR_FOR_DEST 7
51
52/*
53 * Control message types for SOL_RDS.
54 *
55 * CMSG_RDMA_ARGS (sendmsg)
56 * Request a RDMA transfer to/from the specified
57 * memory ranges.
58 * The cmsg_data is a struct rds_rdma_args.
59 * RDS_CMSG_RDMA_DEST (recvmsg, sendmsg)
60 * Kernel informs application about intended
61 * source/destination of a RDMA transfer
62 * RDS_CMSG_RDMA_MAP (sendmsg)
63 * Application asks kernel to map the given
64 * memory range into a IB MR, and send the
65 * R_Key along in an RDS extension header.
66 * The cmsg_data is a struct rds_get_mr_args,
67 * the same as for the GET_MR setsockopt.
68 * RDS_CMSG_RDMA_STATUS (recvmsg)
69 * Returns the status of a completed RDMA operation.
70 */
71#define RDS_CMSG_RDMA_ARGS 1
72#define RDS_CMSG_RDMA_DEST 2
73#define RDS_CMSG_RDMA_MAP 3
74#define RDS_CMSG_RDMA_STATUS 4
75#define RDS_CMSG_CONG_UPDATE 5
76#define RDS_CMSG_ATOMIC_FADD 6
77#define RDS_CMSG_ATOMIC_CSWP 7
78#define RDS_CMSG_MASKED_ATOMIC_FADD 8
79#define RDS_CMSG_MASKED_ATOMIC_CSWP 9
80
81#define RDS_INFO_FIRST 10000
82#define RDS_INFO_COUNTERS 10000
83#define RDS_INFO_CONNECTIONS 10001
84/* 10002 aka RDS_INFO_FLOWS is deprecated */
85#define RDS_INFO_SEND_MESSAGES 10003
86#define RDS_INFO_RETRANS_MESSAGES 10004
87#define RDS_INFO_RECV_MESSAGES 10005
88#define RDS_INFO_SOCKETS 10006
89#define RDS_INFO_TCP_SOCKETS 10007
90#define RDS_INFO_IB_CONNECTIONS 10008
91#define RDS_INFO_CONNECTION_STATS 10009
92#define RDS_INFO_IWARP_CONNECTIONS 10010
93#define RDS_INFO_LAST 10010
94
95struct rds_info_counter {
96 uint8_t name[32];
97 uint64_t value;
98} __attribute__((packed));
99
100#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
101#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
102#define RDS_INFO_CONNECTION_FLAG_CONNECTED 0x04
103
104#define TRANSNAMSIZ 16
105
106struct rds_info_connection {
107 uint64_t next_tx_seq;
108 uint64_t next_rx_seq;
109 __be32 laddr;
110 __be32 faddr;
111 uint8_t transport[TRANSNAMSIZ]; /* null term ascii */
112 uint8_t flags;
113} __attribute__((packed));
114
115#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
116#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
117
118struct rds_info_message {
119 uint64_t seq;
120 uint32_t len;
121 __be32 laddr;
122 __be32 faddr;
123 __be16 lport;
124 __be16 fport;
125 uint8_t flags;
126} __attribute__((packed));
127
128struct rds_info_socket {
129 uint32_t sndbuf;
130 __be32 bound_addr;
131 __be32 connected_addr;
132 __be16 bound_port;
133 __be16 connected_port;
134 uint32_t rcvbuf;
135 uint64_t inum;
136} __attribute__((packed));
137
138struct rds_info_tcp_socket {
139 __be32 local_addr;
140 __be16 local_port;
141 __be32 peer_addr;
142 __be16 peer_port;
143 uint64_t hdr_rem;
144 uint64_t data_rem;
145 uint32_t last_sent_nxt;
146 uint32_t last_expected_una;
147 uint32_t last_seen_una;
148} __attribute__((packed));
149
150#define RDS_IB_GID_LEN 16
151struct rds_info_rdma_connection {
152 __be32 src_addr;
153 __be32 dst_addr;
154 uint8_t src_gid[RDS_IB_GID_LEN];
155 uint8_t dst_gid[RDS_IB_GID_LEN];
156
157 uint32_t max_send_wr;
158 uint32_t max_recv_wr;
159 uint32_t max_send_sge;
160 uint32_t rdma_mr_max;
161 uint32_t rdma_mr_size;
162};
163
164/*
165 * Congestion monitoring.
166 * Congestion control in RDS happens at the host connection
167 * level by exchanging a bitmap marking congested ports.
168 * By default, a process sleeping in poll() is always woken
169 * up when the congestion map is updated.
170 * With explicit monitoring, an application can have more
171 * fine-grained control.
172 * The application installs a 64bit mask value in the socket,
173 * where each bit corresponds to a group of ports.
174 * When a congestion update arrives, RDS checks the set of
175 * ports that are now uncongested against the list bit mask
176 * installed in the socket, and if they overlap, we queue a
177 * cong_notification on the socket.
178 *
179 * To install the congestion monitor bitmask, use RDS_CONG_MONITOR
180 * with the 64bit mask.
181 * Congestion updates are received via RDS_CMSG_CONG_UPDATE
182 * control messages.
183 *
184 * The correspondence between bits and ports is
185 * 1 << (portnum % 64)
186 */
187#define RDS_CONG_MONITOR_SIZE 64
188#define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
189#define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
190
191/*
192 * RDMA related types
193 */
194
195/*
196 * This encapsulates a remote memory location.
197 * In the current implementation, it contains the R_Key
198 * of the remote memory region, and the offset into it
199 * (so that the application does not have to worry about
200 * alignment).
201 */
202typedef uint64_t rds_rdma_cookie_t;
203
204struct rds_iovec {
205 uint64_t addr;
206 uint64_t bytes;
207};
208
209struct rds_get_mr_args {
210 struct rds_iovec vec;
211 uint64_t cookie_addr;
212 uint64_t flags;
213};
214
215struct rds_get_mr_for_dest_args {
216 struct sockaddr_storage dest_addr;
217 struct rds_iovec vec;
218 uint64_t cookie_addr;
219 uint64_t flags;
220};
221
222struct rds_free_mr_args {
223 rds_rdma_cookie_t cookie;
224 uint64_t flags;
225};
226
227struct rds_rdma_args {
228 rds_rdma_cookie_t cookie;
229 struct rds_iovec remote_vec;
230 uint64_t local_vec_addr;
231 uint64_t nr_local;
232 uint64_t flags;
233 uint64_t user_token;
234};
235
236struct rds_atomic_args {
237 rds_rdma_cookie_t cookie;
238 uint64_t local_addr;
239 uint64_t remote_addr;
240 union {
241 struct {
242 uint64_t compare;
243 uint64_t swap;
244 } cswp;
245 struct {
246 uint64_t add;
247 } fadd;
248 struct {
249 uint64_t compare;
250 uint64_t swap;
251 uint64_t compare_mask;
252 uint64_t swap_mask;
253 } m_cswp;
254 struct {
255 uint64_t add;
256 uint64_t nocarry_mask;
257 } m_fadd;
258 };
259 uint64_t flags;
260 uint64_t user_token;
261};
262
263struct rds_rdma_notify {
264 uint64_t user_token;
265 int32_t status;
266};
267
268#define RDS_RDMA_SUCCESS 0
269#define RDS_RDMA_REMOTE_ERROR 1
270#define RDS_RDMA_CANCELED 2
271#define RDS_RDMA_DROPPED 3
272#define RDS_RDMA_OTHER_ERROR 4
273
274/*
275 * Common set of flags for all RDMA related structs
276 */
277#define RDS_RDMA_READWRITE 0x0001
278#define RDS_RDMA_FENCE 0x0002 /* use FENCE for immediate send */
279#define RDS_RDMA_INVALIDATE 0x0004 /* invalidate R_Key after freeing MR */
280#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */
281#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */
282#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */
283#define RDS_RDMA_SILENT 0x0040 /* Do not interrupt remote */
284
285#endif /* IB_RDS_H */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index e0879a70e830..23b36304cd88 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/reiserfs_fs.h b/include/linux/reiserfs_fs.h
deleted file mode 100644
index ea3700cd7367..000000000000
--- a/include/linux/reiserfs_fs.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Copyright 1996, 1997, 1998 Hans Reiser, see reiserfs/README for licensing and copyright details
3 */
4#ifndef _LINUX_REISER_FS_H
5#define _LINUX_REISER_FS_H
6
7#include <linux/types.h>
8#include <linux/magic.h>
9
10/*
11 * include/linux/reiser_fs.h
12 *
13 * Reiser File System constants and structures
14 *
15 */
16
17/* ioctl's command */
18#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
19/* define following flags to be the same as in ext2, so that chattr(1),
20 lsattr(1) will work with us. */
21#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
22#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
23#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
24#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
25
26#endif /* _LINUX_REISER_FS_H */
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
deleted file mode 100644
index d8ce17c2459a..000000000000
--- a/include/linux/reiserfs_xattr.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 File: linux/reiserfs_xattr.h
3*/
4
5#ifndef _LINUX_REISERFS_XATTR_H
6#define _LINUX_REISERFS_XATTR_H
7
8#include <linux/types.h>
9
10/* Magic value in header */
11#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
12
13struct reiserfs_xattr_header {
14 __le32 h_magic; /* magic number for identification */
15 __le32 h_hash; /* hash of the value */
16};
17
18struct reiserfs_security_handle {
19 char *name;
20 void *value;
21 size_t length;
22};
23
24#endif /* _LINUX_REISERFS_XATTR_H */
diff --git a/include/linux/resource.h b/include/linux/resource.h
index d01c96c1966e..5bc3116e649c 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 0ec590bb3611..d9010789b4e8 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/romfs_fs.h b/include/linux/romfs_fs.h
deleted file mode 100644
index 5f57f93b284f..000000000000
--- a/include/linux/romfs_fs.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef __LINUX_ROMFS_FS_H
2#define __LINUX_ROMFS_FS_H
3
4#include <linux/types.h>
5#include <linux/fs.h>
6
7/* The basic structures of the romfs filesystem */
8
9#define ROMBSIZE BLOCK_SIZE
10#define ROMBSBITS BLOCK_SIZE_BITS
11#define ROMBMASK (ROMBSIZE-1)
12#define ROMFS_MAGIC 0x7275
13
14#define ROMFS_MAXFN 128
15
16#define __mkw(h,l) (((h)&0x00ff)<< 8|((l)&0x00ff))
17#define __mkl(h,l) (((h)&0xffff)<<16|((l)&0xffff))
18#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a,b),__mkw(c,d)))
19#define ROMSB_WORD0 __mk4('-','r','o','m')
20#define ROMSB_WORD1 __mk4('1','f','s','-')
21
22/* On-disk "super block" */
23
24struct romfs_super_block {
25 __be32 word0;
26 __be32 word1;
27 __be32 size;
28 __be32 checksum;
29 char name[0]; /* volume name */
30};
31
32/* On disk inode */
33
34struct romfs_inode {
35 __be32 next; /* low 4 bits see ROMFH_ */
36 __be32 spec;
37 __be32 size;
38 __be32 checksum;
39 char name[0];
40};
41
42#define ROMFH_TYPE 7
43#define ROMFH_HRD 0
44#define ROMFH_DIR 1
45#define ROMFH_REG 2
46#define ROMFH_SYM 3
47#define ROMFH_BLK 4
48#define ROMFH_CHR 5
49#define ROMFH_SCK 6
50#define ROMFH_FIF 7
51#define ROMFH_EXEC 8
52
53/* Alignment */
54
55#define ROMFH_SIZE 16
56#define ROMFH_PAD (ROMFH_SIZE-1)
57#define ROMFH_MASK (~ROMFH_PAD)
58
59#endif
diff --git a/include/linux/rose.h b/include/linux/rose.h
deleted file mode 100644
index 1fcfe95893b8..000000000000
--- a/include/linux/rose.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * These are the public elements of the Linux kernel Rose implementation.
3 * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
4 * definition of the ax25_address structure.
5 */
6
7#ifndef ROSE_KERNEL_H
8#define ROSE_KERNEL_H
9
10#include <linux/socket.h>
11#include <linux/ax25.h>
12
13#define ROSE_MTU 251
14
15#define ROSE_MAX_DIGIS 6
16
17#define ROSE_DEFER 1
18#define ROSE_T1 2
19#define ROSE_T2 3
20#define ROSE_T3 4
21#define ROSE_IDLE 5
22#define ROSE_QBITINCL 6
23#define ROSE_HOLDBACK 7
24
25#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0)
26#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1)
27#define SIOCRSL2CALL (SIOCPROTOPRIVATE+2)
28#define SIOCRSSL2CALL (SIOCPROTOPRIVATE+2)
29#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3)
30#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4)
31#define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5)
32#define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6)
33
34#define ROSE_DTE_ORIGINATED 0x00
35#define ROSE_NUMBER_BUSY 0x01
36#define ROSE_INVALID_FACILITY 0x03
37#define ROSE_NETWORK_CONGESTION 0x05
38#define ROSE_OUT_OF_ORDER 0x09
39#define ROSE_ACCESS_BARRED 0x0B
40#define ROSE_NOT_OBTAINABLE 0x0D
41#define ROSE_REMOTE_PROCEDURE 0x11
42#define ROSE_LOCAL_PROCEDURE 0x13
43#define ROSE_SHIP_ABSENT 0x39
44
45typedef struct {
46 char rose_addr[5];
47} rose_address;
48
49struct sockaddr_rose {
50 __kernel_sa_family_t srose_family;
51 rose_address srose_addr;
52 ax25_address srose_call;
53 int srose_ndigis;
54 ax25_address srose_digi;
55};
56
57struct full_sockaddr_rose {
58 __kernel_sa_family_t srose_family;
59 rose_address srose_addr;
60 ax25_address srose_call;
61 unsigned int srose_ndigis;
62 ax25_address srose_digis[ROSE_MAX_DIGIS];
63};
64
65struct rose_route_struct {
66 rose_address address;
67 unsigned short mask;
68 ax25_address neighbour;
69 char device[16];
70 unsigned char ndigis;
71 ax25_address digipeaters[AX25_MAX_DIGIS];
72};
73
74struct rose_cause_struct {
75 unsigned char cause;
76 unsigned char diagnostic;
77};
78
79struct rose_facilities_struct {
80 rose_address source_addr, dest_addr;
81 ax25_address source_call, dest_call;
82 unsigned char source_ndigis, dest_ndigis;
83 ax25_address source_digis[ROSE_MAX_DIGIS];
84 ax25_address dest_digis[ROSE_MAX_DIGIS];
85 unsigned int rand;
86 rose_address fail_addr;
87 ax25_address fail_call;
88};
89
90#endif
diff --git a/include/linux/route.h b/include/linux/route.h
deleted file mode 100644
index 6600708311c8..000000000000
--- a/include/linux/route.h
+++ /dev/null
@@ -1,69 +0,0 @@
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 IP router interface.
7 *
8 * Version: @(#)route.h 1.0.3 05/27/93
9 *
10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
11 * for the purposes of compatibility only.
12 *
13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
14 *
15 * Changes:
16 * Mike McLagan : Routing by source
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 _LINUX_ROUTE_H
24#define _LINUX_ROUTE_H
25
26#include <linux/if.h>
27#include <linux/compiler.h>
28
29/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
30struct rtentry {
31 unsigned long rt_pad1;
32 struct sockaddr rt_dst; /* target address */
33 struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
34 struct sockaddr rt_genmask; /* target network mask (IP) */
35 unsigned short rt_flags;
36 short rt_pad2;
37 unsigned long rt_pad3;
38 void *rt_pad4;
39 short rt_metric; /* +1 for binary compatibility! */
40 char __user *rt_dev; /* forcing the device at add */
41 unsigned long rt_mtu; /* per route MTU/Window */
42#ifndef __KERNEL__
43#define rt_mss rt_mtu /* Compatibility :-( */
44#endif
45 unsigned long rt_window; /* Window clamping */
46 unsigned short rt_irtt; /* Initial RTT */
47};
48
49
50#define RTF_UP 0x0001 /* route usable */
51#define RTF_GATEWAY 0x0002 /* destination is a gateway */
52#define RTF_HOST 0x0004 /* host entry (net otherwise) */
53#define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
54#define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
55#define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
56#define RTF_MTU 0x0040 /* specific MTU for this route */
57#define RTF_MSS RTF_MTU /* Compatibility :-( */
58#define RTF_WINDOW 0x0080 /* per route window clamping */
59#define RTF_IRTT 0x0100 /* Initial round trip time */
60#define RTF_REJECT 0x0200 /* Reject route */
61
62/*
63 * <linux/ipv6_route.h> uses RTF values >= 64k
64 */
65
66
67
68#endif /* _LINUX_ROUTE_H */
69
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 20ec4d3bed73..9531845c419f 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 db71c4ad8624..7002bbfd5d4a 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 3495bd953cc6..c5a004962679 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 a83ca5816ecb..0dd42a02df2e 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 fb3c5a8fef3d..005bf3e38db5 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 9995c7fc3f60..fe7a967d7de4 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 84f6320da50f..6f19cfd1840e 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 33406174cbe8..da1b33b33af7 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/selinux_netlink.h b/include/linux/selinux_netlink.h
deleted file mode 100644
index d239797785cf..000000000000
--- a/include/linux/selinux_netlink.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Netlink event notifications for SELinux.
3 *
4 * Author: James Morris <jmorris@redhat.com>
5 *
6 * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2,
10 * as published by the Free Software Foundation.
11 */
12#ifndef _LINUX_SELINUX_NETLINK_H
13#define _LINUX_SELINUX_NETLINK_H
14
15#include <linux/types.h>
16
17/* Message types. */
18#define SELNL_MSG_BASE 0x10
19enum {
20 SELNL_MSG_SETENFORCE = SELNL_MSG_BASE,
21 SELNL_MSG_POLICYLOAD,
22 SELNL_MSG_MAX
23};
24
25#ifndef __KERNEL__
26/* Multicast groups - backwards compatiblility for userspace */
27#define SELNL_GRP_NONE 0x00000000
28#define SELNL_GRP_AVC 0x00000001 /* AVC notifications */
29#define SELNL_GRP_ALL 0xffffffff
30#endif
31
32enum selinux_nlgroups {
33 SELNLGRP_NONE,
34#define SELNLGRP_NONE SELNLGRP_NONE
35 SELNLGRP_AVC,
36#define SELNLGRP_AVC SELNLGRP_AVC
37 __SELNLGRP_MAX
38};
39#define SELNLGRP_MAX (__SELNLGRP_MAX - 1)
40
41/* Message structures */
42struct selnl_msg_setenforce {
43 __s32 val;
44};
45
46struct selnl_msg_policyload {
47 __u32 seqno;
48};
49
50#endif /* _LINUX_SELINUX_NETLINK_H */
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 10d6b226afc5..53d42650b193 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 861e51de476b..0916107c77f9 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 f9b22ec7a9f3..3c430228d232 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/serial_reg.h b/include/linux/serial_reg.h
deleted file mode 100644
index 5ed325e88a81..000000000000
--- a/include/linux/serial_reg.h
+++ /dev/null
@@ -1,371 +0,0 @@
1/*
2 * include/linux/serial_reg.h
3 *
4 * Copyright (C) 1992, 1994 by Theodore Ts'o.
5 *
6 * Redistribution of this file is permitted under the terms of the GNU
7 * Public License (GPL)
8 *
9 * These are the UART port assignments, expressed as offsets from the base
10 * register. These assignments should hold for any serial port based on
11 * a 8250, 16450, or 16550(A).
12 */
13
14#ifndef _LINUX_SERIAL_REG_H
15#define _LINUX_SERIAL_REG_H
16
17/*
18 * DLAB=0
19 */
20#define UART_RX 0 /* In: Receive buffer */
21#define UART_TX 0 /* Out: Transmit buffer */
22
23#define UART_IER 1 /* Out: Interrupt Enable Register */
24#define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
25#define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
26#define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
27#define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
28/*
29 * Sleep mode for ST16650 and TI16750. For the ST16650, EFR[4]=1
30 */
31#define UART_IERX_SLEEP 0x10 /* Enable sleep mode */
32
33#define UART_IIR 2 /* In: Interrupt ID Register */
34#define UART_IIR_NO_INT 0x01 /* No interrupts pending */
35#define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
36#define UART_IIR_MSI 0x00 /* Modem status interrupt */
37#define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
38#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
39#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
40
41#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */
42
43#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */
44#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */
45#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */
46
47#define UART_FCR 2 /* Out: FIFO Control Register */
48#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
49#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
50#define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
51#define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
52/*
53 * Note: The FIFO trigger levels are chip specific:
54 * RX:76 = 00 01 10 11 TX:54 = 00 01 10 11
55 * PC16550D: 1 4 8 14 xx xx xx xx
56 * TI16C550A: 1 4 8 14 xx xx xx xx
57 * TI16C550C: 1 4 8 14 xx xx xx xx
58 * ST16C550: 1 4 8 14 xx xx xx xx
59 * ST16C650: 8 16 24 28 16 8 24 30 PORT_16650V2
60 * NS16C552: 1 4 8 14 xx xx xx xx
61 * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654
62 * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750
63 * TI16C752: 8 16 56 60 8 16 32 56
64 * Tegra: 1 4 8 14 16 8 4 1 PORT_TEGRA
65 */
66#define UART_FCR_R_TRIG_00 0x00
67#define UART_FCR_R_TRIG_01 0x40
68#define UART_FCR_R_TRIG_10 0x80
69#define UART_FCR_R_TRIG_11 0xc0
70#define UART_FCR_T_TRIG_00 0x00
71#define UART_FCR_T_TRIG_01 0x10
72#define UART_FCR_T_TRIG_10 0x20
73#define UART_FCR_T_TRIG_11 0x30
74
75#define UART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
76#define UART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
77#define UART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
78#define UART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
79#define UART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
80/* 16650 definitions */
81#define UART_FCR6_R_TRIGGER_8 0x00 /* Mask for receive trigger set at 1 */
82#define UART_FCR6_R_TRIGGER_16 0x40 /* Mask for receive trigger set at 4 */
83#define UART_FCR6_R_TRIGGER_24 0x80 /* Mask for receive trigger set at 8 */
84#define UART_FCR6_R_TRIGGER_28 0xC0 /* Mask for receive trigger set at 14 */
85#define UART_FCR6_T_TRIGGER_16 0x00 /* Mask for transmit trigger set at 16 */
86#define UART_FCR6_T_TRIGGER_8 0x10 /* Mask for transmit trigger set at 8 */
87#define UART_FCR6_T_TRIGGER_24 0x20 /* Mask for transmit trigger set at 24 */
88#define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */
89#define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */
90
91#define UART_LCR 3 /* Out: Line Control Register */
92/*
93 * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
94 * UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
95 */
96#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
97#define UART_LCR_SBC 0x40 /* Set break control */
98#define UART_LCR_SPAR 0x20 /* Stick parity (?) */
99#define UART_LCR_EPAR 0x10 /* Even parity select */
100#define UART_LCR_PARITY 0x08 /* Parity Enable */
101#define UART_LCR_STOP 0x04 /* Stop bits: 0=1 bit, 1=2 bits */
102#define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
103#define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
104#define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
105#define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
106
107/*
108 * Access to some registers depends on register access / configuration
109 * mode.
110 */
111#define UART_LCR_CONF_MODE_A UART_LCR_DLAB /* Configutation mode A */
112#define UART_LCR_CONF_MODE_B 0xBF /* Configutation mode B */
113
114#define UART_MCR 4 /* Out: Modem Control Register */
115#define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */
116#define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */
117#define UART_MCR_XONANY 0x20 /* Enable Xon Any (TI16C752, EFR[4]=1) */
118#define UART_MCR_AFE 0x20 /* Enable auto-RTS/CTS (TI16C550C/TI16C750) */
119#define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
120#define UART_MCR_OUT2 0x08 /* Out2 complement */
121#define UART_MCR_OUT1 0x04 /* Out1 complement */
122#define UART_MCR_RTS 0x02 /* RTS complement */
123#define UART_MCR_DTR 0x01 /* DTR complement */
124
125#define UART_LSR 5 /* In: Line Status Register */
126#define UART_LSR_FIFOE 0x80 /* Fifo error */
127#define UART_LSR_TEMT 0x40 /* Transmitter empty */
128#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
129#define UART_LSR_BI 0x10 /* Break interrupt indicator */
130#define UART_LSR_FE 0x08 /* Frame error indicator */
131#define UART_LSR_PE 0x04 /* Parity error indicator */
132#define UART_LSR_OE 0x02 /* Overrun error indicator */
133#define UART_LSR_DR 0x01 /* Receiver data ready */
134#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
135
136#define UART_MSR 6 /* In: Modem Status Register */
137#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
138#define UART_MSR_RI 0x40 /* Ring Indicator */
139#define UART_MSR_DSR 0x20 /* Data Set Ready */
140#define UART_MSR_CTS 0x10 /* Clear to Send */
141#define UART_MSR_DDCD 0x08 /* Delta DCD */
142#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
143#define UART_MSR_DDSR 0x02 /* Delta DSR */
144#define UART_MSR_DCTS 0x01 /* Delta CTS */
145#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
146
147#define UART_SCR 7 /* I/O: Scratch Register */
148
149/*
150 * DLAB=1
151 */
152#define UART_DLL 0 /* Out: Divisor Latch Low */
153#define UART_DLM 1 /* Out: Divisor Latch High */
154
155/*
156 * LCR=0xBF (or DLAB=1 for 16C660)
157 */
158#define UART_EFR 2 /* I/O: Extended Features Register */
159#define UART_XR_EFR 9 /* I/O: Extended Features Register (XR17D15x) */
160#define UART_EFR_CTS 0x80 /* CTS flow control */
161#define UART_EFR_RTS 0x40 /* RTS flow control */
162#define UART_EFR_SCD 0x20 /* Special character detect */
163#define UART_EFR_ECB 0x10 /* Enhanced control bit */
164/*
165 * the low four bits control software flow control
166 */
167
168/*
169 * LCR=0xBF, TI16C752, ST16650, ST16650A, ST16654
170 */
171#define UART_XON1 4 /* I/O: Xon character 1 */
172#define UART_XON2 5 /* I/O: Xon character 2 */
173#define UART_XOFF1 6 /* I/O: Xoff character 1 */
174#define UART_XOFF2 7 /* I/O: Xoff character 2 */
175
176/*
177 * EFR[4]=1 MCR[6]=1, TI16C752
178 */
179#define UART_TI752_TCR 6 /* I/O: transmission control register */
180#define UART_TI752_TLR 7 /* I/O: trigger level register */
181
182/*
183 * LCR=0xBF, XR16C85x
184 */
185#define UART_TRG 0 /* FCTR bit 7 selects Rx or Tx
186 * In: Fifo count
187 * Out: Fifo custom trigger levels */
188/*
189 * These are the definitions for the Programmable Trigger Register
190 */
191#define UART_TRG_1 0x01
192#define UART_TRG_4 0x04
193#define UART_TRG_8 0x08
194#define UART_TRG_16 0x10
195#define UART_TRG_32 0x20
196#define UART_TRG_64 0x40
197#define UART_TRG_96 0x60
198#define UART_TRG_120 0x78
199#define UART_TRG_128 0x80
200
201#define UART_FCTR 1 /* Feature Control Register */
202#define UART_FCTR_RTS_NODELAY 0x00 /* RTS flow control delay */
203#define UART_FCTR_RTS_4DELAY 0x01
204#define UART_FCTR_RTS_6DELAY 0x02
205#define UART_FCTR_RTS_8DELAY 0x03
206#define UART_FCTR_IRDA 0x04 /* IrDa data encode select */
207#define UART_FCTR_TX_INT 0x08 /* Tx interrupt type select */
208#define UART_FCTR_TRGA 0x00 /* Tx/Rx 550 trigger table select */
209#define UART_FCTR_TRGB 0x10 /* Tx/Rx 650 trigger table select */
210#define UART_FCTR_TRGC 0x20 /* Tx/Rx 654 trigger table select */
211#define UART_FCTR_TRGD 0x30 /* Tx/Rx 850 programmable trigger select */
212#define UART_FCTR_SCR_SWAP 0x40 /* Scratch pad register swap */
213#define UART_FCTR_RX 0x00 /* Programmable trigger mode select */
214#define UART_FCTR_TX 0x80 /* Programmable trigger mode select */
215
216/*
217 * LCR=0xBF, FCTR[6]=1
218 */
219#define UART_EMSR 7 /* Extended Mode Select Register */
220#define UART_EMSR_FIFO_COUNT 0x01 /* Rx/Tx select */
221#define UART_EMSR_ALT_COUNT 0x02 /* Alternating count select */
222
223/*
224 * The Intel XScale on-chip UARTs define these bits
225 */
226#define UART_IER_DMAE 0x80 /* DMA Requests Enable */
227#define UART_IER_UUE 0x40 /* UART Unit Enable */
228#define UART_IER_NRZE 0x20 /* NRZ coding Enable */
229#define UART_IER_RTOIE 0x10 /* Receiver Time Out Interrupt Enable */
230
231#define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */
232
233#define UART_FCR_PXAR1 0x00 /* receive FIFO threshold = 1 */
234#define UART_FCR_PXAR8 0x40 /* receive FIFO threshold = 8 */
235#define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */
236#define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */
237
238/*
239 * Intel MID on-chip HSU (High Speed UART) defined bits
240 */
241#define UART_FCR_HSU_64_1B 0x00 /* receive FIFO treshold = 1 */
242#define UART_FCR_HSU_64_16B 0x40 /* receive FIFO treshold = 16 */
243#define UART_FCR_HSU_64_32B 0x80 /* receive FIFO treshold = 32 */
244#define UART_FCR_HSU_64_56B 0xc0 /* receive FIFO treshold = 56 */
245
246#define UART_FCR_HSU_16_1B 0x00 /* receive FIFO treshold = 1 */
247#define UART_FCR_HSU_16_4B 0x40 /* receive FIFO treshold = 4 */
248#define UART_FCR_HSU_16_8B 0x80 /* receive FIFO treshold = 8 */
249#define UART_FCR_HSU_16_14B 0xc0 /* receive FIFO treshold = 14 */
250
251#define UART_FCR_HSU_64B_FIFO 0x20 /* chose 64 bytes FIFO */
252#define UART_FCR_HSU_16B_FIFO 0x00 /* chose 16 bytes FIFO */
253
254#define UART_FCR_HALF_EMPT_TXI 0x00 /* trigger TX_EMPT IRQ for half empty */
255#define UART_FCR_FULL_EMPT_TXI 0x08 /* trigger TX_EMPT IRQ for full empty */
256
257/*
258 * These register definitions are for the 16C950
259 */
260#define UART_ASR 0x01 /* Additional Status Register */
261#define UART_RFL 0x03 /* Receiver FIFO level */
262#define UART_TFL 0x04 /* Transmitter FIFO level */
263#define UART_ICR 0x05 /* Index Control Register */
264
265/* The 16950 ICR registers */
266#define UART_ACR 0x00 /* Additional Control Register */
267#define UART_CPR 0x01 /* Clock Prescalar Register */
268#define UART_TCR 0x02 /* Times Clock Register */
269#define UART_CKS 0x03 /* Clock Select Register */
270#define UART_TTL 0x04 /* Transmitter Interrupt Trigger Level */
271#define UART_RTL 0x05 /* Receiver Interrupt Trigger Level */
272#define UART_FCL 0x06 /* Flow Control Level Lower */
273#define UART_FCH 0x07 /* Flow Control Level Higher */
274#define UART_ID1 0x08 /* ID #1 */
275#define UART_ID2 0x09 /* ID #2 */
276#define UART_ID3 0x0A /* ID #3 */
277#define UART_REV 0x0B /* Revision */
278#define UART_CSR 0x0C /* Channel Software Reset */
279#define UART_NMR 0x0D /* Nine-bit Mode Register */
280#define UART_CTR 0xFF
281
282/*
283 * The 16C950 Additional Control Register
284 */
285#define UART_ACR_RXDIS 0x01 /* Receiver disable */
286#define UART_ACR_TXDIS 0x02 /* Transmitter disable */
287#define UART_ACR_DSRFC 0x04 /* DSR Flow Control */
288#define UART_ACR_TLENB 0x20 /* 950 trigger levels enable */
289#define UART_ACR_ICRRD 0x40 /* ICR Read enable */
290#define UART_ACR_ASREN 0x80 /* Additional status enable */
291
292
293
294/*
295 * These definitions are for the RSA-DV II/S card, from
296 *
297 * Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
298 */
299
300#define UART_RSA_BASE (-8)
301
302#define UART_RSA_MSR ((UART_RSA_BASE) + 0) /* I/O: Mode Select Register */
303
304#define UART_RSA_MSR_SWAP (1 << 0) /* Swap low/high 8 bytes in I/O port addr */
305#define UART_RSA_MSR_FIFO (1 << 2) /* Enable the external FIFO */
306#define UART_RSA_MSR_FLOW (1 << 3) /* Enable the auto RTS/CTS flow control */
307#define UART_RSA_MSR_ITYP (1 << 4) /* Level (1) / Edge triger (0) */
308
309#define UART_RSA_IER ((UART_RSA_BASE) + 1) /* I/O: Interrupt Enable Register */
310
311#define UART_RSA_IER_Rx_FIFO_H (1 << 0) /* Enable Rx FIFO half full int. */
312#define UART_RSA_IER_Tx_FIFO_H (1 << 1) /* Enable Tx FIFO half full int. */
313#define UART_RSA_IER_Tx_FIFO_E (1 << 2) /* Enable Tx FIFO empty int. */
314#define UART_RSA_IER_Rx_TOUT (1 << 3) /* Enable char receive timeout int */
315#define UART_RSA_IER_TIMER (1 << 4) /* Enable timer interrupt */
316
317#define UART_RSA_SRR ((UART_RSA_BASE) + 2) /* IN: Status Read Register */
318
319#define UART_RSA_SRR_Tx_FIFO_NEMP (1 << 0) /* Tx FIFO is not empty (1) */
320#define UART_RSA_SRR_Tx_FIFO_NHFL (1 << 1) /* Tx FIFO is not half full (1) */
321#define UART_RSA_SRR_Tx_FIFO_NFUL (1 << 2) /* Tx FIFO is not full (1) */
322#define UART_RSA_SRR_Rx_FIFO_NEMP (1 << 3) /* Rx FIFO is not empty (1) */
323#define UART_RSA_SRR_Rx_FIFO_NHFL (1 << 4) /* Rx FIFO is not half full (1) */
324#define UART_RSA_SRR_Rx_FIFO_NFUL (1 << 5) /* Rx FIFO is not full (1) */
325#define UART_RSA_SRR_Rx_TOUT (1 << 6) /* Character reception timeout occurred (1) */
326#define UART_RSA_SRR_TIMER (1 << 7) /* Timer interrupt occurred */
327
328#define UART_RSA_FRR ((UART_RSA_BASE) + 2) /* OUT: FIFO Reset Register */
329
330#define UART_RSA_TIVSR ((UART_RSA_BASE) + 3) /* I/O: Timer Interval Value Set Register */
331
332#define UART_RSA_TCR ((UART_RSA_BASE) + 4) /* OUT: Timer Control Register */
333
334#define UART_RSA_TCR_SWITCH (1 << 0) /* Timer on */
335
336/*
337 * The RSA DSV/II board has two fixed clock frequencies. One is the
338 * standard rate, and the other is 8 times faster.
339 */
340#define SERIAL_RSA_BAUD_BASE (921600)
341#define SERIAL_RSA_BAUD_BASE_LO (SERIAL_RSA_BAUD_BASE / 8)
342
343/*
344 * Extra serial register definitions for the internal UARTs
345 * in TI OMAP processors.
346 */
347#define UART_OMAP_MDR1 0x08 /* Mode definition register */
348#define UART_OMAP_MDR2 0x09 /* Mode definition register 2 */
349#define UART_OMAP_SCR 0x10 /* Supplementary control register */
350#define UART_OMAP_SSR 0x11 /* Supplementary status register */
351#define UART_OMAP_EBLR 0x12 /* BOF length register */
352#define UART_OMAP_OSC_12M_SEL 0x13 /* OMAP1510 12MHz osc select */
353#define UART_OMAP_MVER 0x14 /* Module version register */
354#define UART_OMAP_SYSC 0x15 /* System configuration register */
355#define UART_OMAP_SYSS 0x16 /* System status register */
356#define UART_OMAP_WER 0x17 /* Wake-up enable register */
357
358/*
359 * These are the definitions for the MDR1 register
360 */
361#define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode */
362#define UART_OMAP_MDR1_SIR_MODE 0x01 /* SIR mode */
363#define UART_OMAP_MDR1_16X_ABAUD_MODE 0x02 /* UART 16x auto-baud */
364#define UART_OMAP_MDR1_13X_MODE 0x03 /* UART 13x mode */
365#define UART_OMAP_MDR1_MIR_MODE 0x04 /* MIR mode */
366#define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */
367#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
368#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
369
370#endif /* _LINUX_SERIAL_REG_H */
371
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 6d6cfd3e94a3..36aac733840a 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 edd086883ccb..bcf8a6a3ec00 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 26b424adc842..e19a011b43b7 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 247399b2979a..eadbe227c256 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/snmp.h b/include/linux/snmp.h
deleted file mode 100644
index fdfba235f9f1..000000000000
--- a/include/linux/snmp.h
+++ /dev/null
@@ -1,284 +0,0 @@
1/*
2 * Definitions for MIBs
3 *
4 * Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
5 */
6
7#ifndef _LINUX_SNMP_H
8#define _LINUX_SNMP_H
9
10/* ipstats mib definitions */
11/*
12 * RFC 1213: MIB-II
13 * RFC 2011 (updates 1213): SNMPv2-MIB-IP
14 * RFC 2863: Interfaces Group MIB
15 * RFC 2465: IPv6 MIB: General Group
16 * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
17 */
18enum
19{
20 IPSTATS_MIB_NUM = 0,
21/* frequently written fields in fast path, kept in same cache line */
22 IPSTATS_MIB_INPKTS, /* InReceives */
23 IPSTATS_MIB_INOCTETS, /* InOctets */
24 IPSTATS_MIB_INDELIVERS, /* InDelivers */
25 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
26 IPSTATS_MIB_OUTPKTS, /* OutRequests */
27 IPSTATS_MIB_OUTOCTETS, /* OutOctets */
28/* other fields */
29 IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
30 IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
31 IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
32 IPSTATS_MIB_INADDRERRORS, /* InAddrErrors */
33 IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
34 IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
35 IPSTATS_MIB_INDISCARDS, /* InDiscards */
36 IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
37 IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
38 IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
39 IPSTATS_MIB_REASMREQDS, /* ReasmReqds */
40 IPSTATS_MIB_REASMOKS, /* ReasmOKs */
41 IPSTATS_MIB_REASMFAILS, /* ReasmFails */
42 IPSTATS_MIB_FRAGOKS, /* FragOKs */
43 IPSTATS_MIB_FRAGFAILS, /* FragFails */
44 IPSTATS_MIB_FRAGCREATES, /* FragCreates */
45 IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */
46 IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
47 IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */
48 IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */
49 IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */
50 IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */
51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
52 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */
53 __IPSTATS_MIB_MAX
54};
55
56/* icmp mib definitions */
57/*
58 * RFC 1213: MIB-II ICMP Group
59 * RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
60 */
61enum
62{
63 ICMP_MIB_NUM = 0,
64 ICMP_MIB_INMSGS, /* InMsgs */
65 ICMP_MIB_INERRORS, /* InErrors */
66 ICMP_MIB_INDESTUNREACHS, /* InDestUnreachs */
67 ICMP_MIB_INTIMEEXCDS, /* InTimeExcds */
68 ICMP_MIB_INPARMPROBS, /* InParmProbs */
69 ICMP_MIB_INSRCQUENCHS, /* InSrcQuenchs */
70 ICMP_MIB_INREDIRECTS, /* InRedirects */
71 ICMP_MIB_INECHOS, /* InEchos */
72 ICMP_MIB_INECHOREPS, /* InEchoReps */
73 ICMP_MIB_INTIMESTAMPS, /* InTimestamps */
74 ICMP_MIB_INTIMESTAMPREPS, /* InTimestampReps */
75 ICMP_MIB_INADDRMASKS, /* InAddrMasks */
76 ICMP_MIB_INADDRMASKREPS, /* InAddrMaskReps */
77 ICMP_MIB_OUTMSGS, /* OutMsgs */
78 ICMP_MIB_OUTERRORS, /* OutErrors */
79 ICMP_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
80 ICMP_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
81 ICMP_MIB_OUTPARMPROBS, /* OutParmProbs */
82 ICMP_MIB_OUTSRCQUENCHS, /* OutSrcQuenchs */
83 ICMP_MIB_OUTREDIRECTS, /* OutRedirects */
84 ICMP_MIB_OUTECHOS, /* OutEchos */
85 ICMP_MIB_OUTECHOREPS, /* OutEchoReps */
86 ICMP_MIB_OUTTIMESTAMPS, /* OutTimestamps */
87 ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
88 ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
89 ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
90 __ICMP_MIB_MAX
91};
92
93#define __ICMPMSG_MIB_MAX 512 /* Out+In for all 8-bit ICMP types */
94
95/* icmp6 mib definitions */
96/*
97 * RFC 2466: ICMPv6-MIB
98 */
99enum
100{
101 ICMP6_MIB_NUM = 0,
102 ICMP6_MIB_INMSGS, /* InMsgs */
103 ICMP6_MIB_INERRORS, /* InErrors */
104 ICMP6_MIB_OUTMSGS, /* OutMsgs */
105 ICMP6_MIB_OUTERRORS, /* OutErrors */
106 __ICMP6_MIB_MAX
107};
108
109#define __ICMP6MSG_MIB_MAX 512 /* Out+In for all 8-bit ICMPv6 types */
110
111/* tcp mib definitions */
112/*
113 * RFC 1213: MIB-II TCP group
114 * RFC 2012 (updates 1213): SNMPv2-MIB-TCP
115 */
116enum
117{
118 TCP_MIB_NUM = 0,
119 TCP_MIB_RTOALGORITHM, /* RtoAlgorithm */
120 TCP_MIB_RTOMIN, /* RtoMin */
121 TCP_MIB_RTOMAX, /* RtoMax */
122 TCP_MIB_MAXCONN, /* MaxConn */
123 TCP_MIB_ACTIVEOPENS, /* ActiveOpens */
124 TCP_MIB_PASSIVEOPENS, /* PassiveOpens */
125 TCP_MIB_ATTEMPTFAILS, /* AttemptFails */
126 TCP_MIB_ESTABRESETS, /* EstabResets */
127 TCP_MIB_CURRESTAB, /* CurrEstab */
128 TCP_MIB_INSEGS, /* InSegs */
129 TCP_MIB_OUTSEGS, /* OutSegs */
130 TCP_MIB_RETRANSSEGS, /* RetransSegs */
131 TCP_MIB_INERRS, /* InErrs */
132 TCP_MIB_OUTRSTS, /* OutRsts */
133 __TCP_MIB_MAX
134};
135
136/* udp mib definitions */
137/*
138 * RFC 1213: MIB-II UDP group
139 * RFC 2013 (updates 1213): SNMPv2-MIB-UDP
140 */
141enum
142{
143 UDP_MIB_NUM = 0,
144 UDP_MIB_INDATAGRAMS, /* InDatagrams */
145 UDP_MIB_NOPORTS, /* NoPorts */
146 UDP_MIB_INERRORS, /* InErrors */
147 UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
148 UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */
149 UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
150 __UDP_MIB_MAX
151};
152
153/* linux mib definitions */
154enum
155{
156 LINUX_MIB_NUM = 0,
157 LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */
158 LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */
159 LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */
160 LINUX_MIB_EMBRYONICRSTS, /* EmbryonicRsts */
161 LINUX_MIB_PRUNECALLED, /* PruneCalled */
162 LINUX_MIB_RCVPRUNED, /* RcvPruned */
163 LINUX_MIB_OFOPRUNED, /* OfoPruned */
164 LINUX_MIB_OUTOFWINDOWICMPS, /* OutOfWindowIcmps */
165 LINUX_MIB_LOCKDROPPEDICMPS, /* LockDroppedIcmps */
166 LINUX_MIB_ARPFILTER, /* ArpFilter */
167 LINUX_MIB_TIMEWAITED, /* TimeWaited */
168 LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */
169 LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
170 LINUX_MIB_PAWSPASSIVEREJECTED, /* PAWSPassiveRejected */
171 LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
172 LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
173 LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
174 LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
175 LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
176 LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */
177 LINUX_MIB_LISTENDROPS, /* ListenDrops */
178 LINUX_MIB_TCPPREQUEUED, /* TCPPrequeued */
179 LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, /* TCPDirectCopyFromBacklog */
180 LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, /* TCPDirectCopyFromPrequeue */
181 LINUX_MIB_TCPPREQUEUEDROPPED, /* TCPPrequeueDropped */
182 LINUX_MIB_TCPHPHITS, /* TCPHPHits */
183 LINUX_MIB_TCPHPHITSTOUSER, /* TCPHPHitsToUser */
184 LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */
185 LINUX_MIB_TCPHPACKS, /* TCPHPAcks */
186 LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */
187 LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */
188 LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */
189 LINUX_MIB_TCPFACKREORDER, /* TCPFACKReorder */
190 LINUX_MIB_TCPSACKREORDER, /* TCPSACKReorder */
191 LINUX_MIB_TCPRENOREORDER, /* TCPRenoReorder */
192 LINUX_MIB_TCPTSREORDER, /* TCPTSReorder */
193 LINUX_MIB_TCPFULLUNDO, /* TCPFullUndo */
194 LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
195 LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
196 LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
197 LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
198 LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
199 LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
200 LINUX_MIB_TCPLOSSFAILURES, /* TCPLossFailures */
201 LINUX_MIB_TCPFASTRETRANS, /* TCPFastRetrans */
202 LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
203 LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
204 LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
205 LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
206 LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
207 LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
208 LINUX_MIB_TCPRCVCOLLAPSED, /* TCPRcvCollapsed */
209 LINUX_MIB_TCPDSACKOLDSENT, /* TCPDSACKOldSent */
210 LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
211 LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
212 LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
213 LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
214 LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
215 LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
216 LINUX_MIB_TCPABORTONTIMEOUT, /* TCPAbortOnTimeout */
217 LINUX_MIB_TCPABORTONLINGER, /* TCPAbortOnLinger */
218 LINUX_MIB_TCPABORTFAILED, /* TCPAbortFailed */
219 LINUX_MIB_TCPMEMORYPRESSURES, /* TCPMemoryPressures */
220 LINUX_MIB_TCPSACKDISCARD, /* TCPSACKDiscard */
221 LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */
222 LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */
223 LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */
224 LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */
225 LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */
226 LINUX_MIB_SACKSHIFTED,
227 LINUX_MIB_SACKMERGED,
228 LINUX_MIB_SACKSHIFTFALLBACK,
229 LINUX_MIB_TCPBACKLOGDROP,
230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
231 LINUX_MIB_TCPDEFERACCEPTDROP,
232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
234 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
235 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
236 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
237 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
238 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
239 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
240 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
241 LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */
242 LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */
243 LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */
244 LINUX_MIB_TCPFASTOPENPASSIVE, /* TCPFastOpenPassive*/
245 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */
246 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
247 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
248 __LINUX_MIB_MAX
249};
250
251/* linux Xfrm mib definitions */
252enum
253{
254 LINUX_MIB_XFRMNUM = 0,
255 LINUX_MIB_XFRMINERROR, /* XfrmInError */
256 LINUX_MIB_XFRMINBUFFERERROR, /* XfrmInBufferError */
257 LINUX_MIB_XFRMINHDRERROR, /* XfrmInHdrError */
258 LINUX_MIB_XFRMINNOSTATES, /* XfrmInNoStates */
259 LINUX_MIB_XFRMINSTATEPROTOERROR, /* XfrmInStateProtoError */
260 LINUX_MIB_XFRMINSTATEMODEERROR, /* XfrmInStateModeError */
261 LINUX_MIB_XFRMINSTATESEQERROR, /* XfrmInStateSeqError */
262 LINUX_MIB_XFRMINSTATEEXPIRED, /* XfrmInStateExpired */
263 LINUX_MIB_XFRMINSTATEMISMATCH, /* XfrmInStateMismatch */
264 LINUX_MIB_XFRMINSTATEINVALID, /* XfrmInStateInvalid */
265 LINUX_MIB_XFRMINTMPLMISMATCH, /* XfrmInTmplMismatch */
266 LINUX_MIB_XFRMINNOPOLS, /* XfrmInNoPols */
267 LINUX_MIB_XFRMINPOLBLOCK, /* XfrmInPolBlock */
268 LINUX_MIB_XFRMINPOLERROR, /* XfrmInPolError */
269 LINUX_MIB_XFRMOUTERROR, /* XfrmOutError */
270 LINUX_MIB_XFRMOUTBUNDLEGENERROR, /* XfrmOutBundleGenError */
271 LINUX_MIB_XFRMOUTBUNDLECHECKERROR, /* XfrmOutBundleCheckError */
272 LINUX_MIB_XFRMOUTNOSTATES, /* XfrmOutNoStates */
273 LINUX_MIB_XFRMOUTSTATEPROTOERROR, /* XfrmOutStateProtoError */
274 LINUX_MIB_XFRMOUTSTATEMODEERROR, /* XfrmOutStateModeError */
275 LINUX_MIB_XFRMOUTSTATESEQERROR, /* XfrmOutStateSeqError */
276 LINUX_MIB_XFRMOUTSTATEEXPIRED, /* XfrmOutStateExpired */
277 LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */
278 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */
279 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
280 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
281 __LINUX_MIB_XFRMMAX
282};
283
284#endif /* _LINUX_SNMP_H */
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index e3e395acc2fd..e8d702e0fd89 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 ba7b2e817cfa..9a546ff853dc 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/sockios.h b/include/linux/sockios.h
deleted file mode 100644
index 7997a506ad41..000000000000
--- a/include/linux/sockios.h
+++ /dev/null
@@ -1,148 +0,0 @@
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 socket-level I/O control calls.
7 *
8 * Version: @(#)sockios.h 1.0.2 03/09/93
9 *
10 * Authors: 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 _LINUX_SOCKIOS_H
19#define _LINUX_SOCKIOS_H
20
21#include <asm/sockios.h>
22
23/* Linux-specific socket ioctls */
24#define SIOCINQ FIONREAD
25#define SIOCOUTQ TIOCOUTQ /* output queue size (not sent + not acked) */
26
27/* Routing table calls. */
28#define SIOCADDRT 0x890B /* add routing table entry */
29#define SIOCDELRT 0x890C /* delete routing table entry */
30#define SIOCRTMSG 0x890D /* call to routing system */
31
32/* Socket configuration controls. */
33#define SIOCGIFNAME 0x8910 /* get iface name */
34#define SIOCSIFLINK 0x8911 /* set iface channel */
35#define SIOCGIFCONF 0x8912 /* get iface list */
36#define SIOCGIFFLAGS 0x8913 /* get flags */
37#define SIOCSIFFLAGS 0x8914 /* set flags */
38#define SIOCGIFADDR 0x8915 /* get PA address */
39#define SIOCSIFADDR 0x8916 /* set PA address */
40#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
41#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
42#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
43#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
44#define SIOCGIFNETMASK 0x891b /* get network PA mask */
45#define SIOCSIFNETMASK 0x891c /* set network PA mask */
46#define SIOCGIFMETRIC 0x891d /* get metric */
47#define SIOCSIFMETRIC 0x891e /* set metric */
48#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
49#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
50#define SIOCGIFMTU 0x8921 /* get MTU size */
51#define SIOCSIFMTU 0x8922 /* set MTU size */
52#define SIOCSIFNAME 0x8923 /* set interface name */
53#define SIOCSIFHWADDR 0x8924 /* set hardware address */
54#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
55#define SIOCSIFENCAP 0x8926
56#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
57#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
58#define SIOCSIFSLAVE 0x8930
59#define SIOCADDMULTI 0x8931 /* Multicast address lists */
60#define SIOCDELMULTI 0x8932
61#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
62#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
63#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
64#define SIOCGIFPFLAGS 0x8935
65#define SIOCDIFADDR 0x8936 /* delete PA address */
66#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
67#define SIOCGIFCOUNT 0x8938 /* get number of devices */
68
69#define SIOCGIFBR 0x8940 /* Bridging support */
70#define SIOCSIFBR 0x8941 /* Set bridging options */
71
72#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
73#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
74
75/* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
76/* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
77
78#define SIOCETHTOOL 0x8946 /* Ethtool interface */
79
80#define SIOCGMIIPHY 0x8947 /* Get address of MII PHY in use. */
81#define SIOCGMIIREG 0x8948 /* Read MII PHY register. */
82#define SIOCSMIIREG 0x8949 /* Write MII PHY register. */
83
84#define SIOCWANDEV 0x894A /* get/set netdev parameters */
85
86#define SIOCOUTQNSD 0x894B /* output queue size (not sent only) */
87
88/* ARP cache control calls. */
89 /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
90#define SIOCDARP 0x8953 /* delete ARP table entry */
91#define SIOCGARP 0x8954 /* get ARP table entry */
92#define SIOCSARP 0x8955 /* set ARP table entry */
93
94/* RARP cache control calls. */
95#define SIOCDRARP 0x8960 /* delete RARP table entry */
96#define SIOCGRARP 0x8961 /* get RARP table entry */
97#define SIOCSRARP 0x8962 /* set RARP table entry */
98
99/* Driver configuration calls */
100
101#define SIOCGIFMAP 0x8970 /* Get device parameters */
102#define SIOCSIFMAP 0x8971 /* Set device parameters */
103
104/* DLCI configuration calls */
105
106#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
107#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
108
109#define SIOCGIFVLAN 0x8982 /* 802.1Q VLAN support */
110#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
111
112/* bonding calls */
113
114#define SIOCBONDENSLAVE 0x8990 /* enslave a device to the bond */
115#define SIOCBONDRELEASE 0x8991 /* release a slave from the bond*/
116#define SIOCBONDSETHWADDR 0x8992 /* set the hw addr of the bond */
117#define SIOCBONDSLAVEINFOQUERY 0x8993 /* rtn info about slave state */
118#define SIOCBONDINFOQUERY 0x8994 /* rtn info about bond state */
119#define SIOCBONDCHANGEACTIVE 0x8995 /* update to a new active slave */
120
121/* bridge calls */
122#define SIOCBRADDBR 0x89a0 /* create new bridge device */
123#define SIOCBRDELBR 0x89a1 /* remove bridge device */
124#define SIOCBRADDIF 0x89a2 /* add interface to bridge */
125#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
126
127/* hardware time stamping: parameters in linux/net_tstamp.h */
128#define SIOCSHWTSTAMP 0x89b0
129
130/* Device private ioctl calls */
131
132/*
133 * These 16 ioctls are available to devices via the do_ioctl() device
134 * vector. Each device should include this file and redefine these names
135 * as their own. Because these are device dependent it is a good idea
136 * _NOT_ to issue them to random objects and hope.
137 *
138 * THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
139 */
140
141#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
142
143/*
144 * These 16 ioctl calls are protocol private
145 */
146
147#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
148#endif /* _LINUX_SOCKIOS_H */
diff --git a/include/linux/som.h b/include/linux/som.h
deleted file mode 100644
index 166594e4e7be..000000000000
--- a/include/linux/som.h
+++ /dev/null
@@ -1,154 +0,0 @@
1#ifndef _LINUX_SOM_H
2#define _LINUX_SOM_H
3
4/* File format definition for SOM executables / shared libraries */
5
6/* we need struct timespec */
7#include <linux/time.h>
8
9#define SOM_PAGESIZE 4096
10
11/* this is the SOM header */
12struct som_hdr {
13 short system_id; /* magic number - system */
14 short a_magic; /* magic number - file type */
15 unsigned int version_id; /* versiod ID: YYMMDDHH */
16 struct timespec file_time; /* system clock */
17 unsigned int entry_space; /* space for entry point */
18 unsigned int entry_subspace; /* subspace for entry point */
19 unsigned int entry_offset; /* offset of entry point */
20 unsigned int aux_header_location; /* auxiliary header location */
21 unsigned int aux_header_size; /* auxiliary header size */
22 unsigned int som_length; /* length of entire SOM */
23 unsigned int presumed_dp; /* compiler's DP value */
24 unsigned int space_location; /* space dictionary location */
25 unsigned int space_total; /* number of space entries */
26 unsigned int subspace_location; /* subspace entries location */
27 unsigned int subspace_total; /* number of subspace entries */
28 unsigned int loader_fixup_location; /* MPE/iX loader fixup */
29 unsigned int loader_fixup_total; /* number of fixup records */
30 unsigned int space_strings_location; /* (sub)space names */
31 unsigned int space_strings_size; /* size of strings area */
32 unsigned int init_array_location; /* reserved */
33 unsigned int init_array_total; /* reserved */
34 unsigned int compiler_location; /* module dictionary */
35 unsigned int compiler_total; /* number of modules */
36 unsigned int symbol_location; /* symbol dictionary */
37 unsigned int symbol_total; /* number of symbols */
38 unsigned int fixup_request_location; /* fixup requests */
39 unsigned int fixup_request_total; /* number of fixup requests */
40 unsigned int symbol_strings_location;/* module & symbol names area */
41 unsigned int symbol_strings_size; /* size of strings area */
42 unsigned int unloadable_sp_location; /* unloadable spaces location */
43 unsigned int unloadable_sp_size; /* size of data */
44 unsigned int checksum;
45};
46
47/* values for system_id */
48
49#define SOM_SID_PARISC_1_0 0x020b
50#define SOM_SID_PARISC_1_1 0x0210
51#define SOM_SID_PARISC_2_0 0x0214
52
53/* values for a_magic */
54
55#define SOM_LIB_EXEC 0x0104
56#define SOM_RELOCATABLE 0x0106
57#define SOM_EXEC_NONSHARE 0x0107
58#define SOM_EXEC_SHARE 0x0108
59#define SOM_EXEC_DEMAND 0x010B
60#define SOM_LIB_DYN 0x010D
61#define SOM_LIB_SHARE 0x010E
62#define SOM_LIB_RELOC 0x0619
63
64/* values for version_id. Decimal not hex, yes. Grr. */
65
66#define SOM_ID_OLD 85082112
67#define SOM_ID_NEW 87102412
68
69struct aux_id {
70 unsigned int mandatory :1; /* the linker must understand this */
71 unsigned int copy :1; /* Must be copied by the linker */
72 unsigned int append :1; /* Must be merged by the linker */
73 unsigned int ignore :1; /* Discard section if unknown */
74 unsigned int reserved :12;
75 unsigned int type :16; /* Header type */
76 unsigned int length; /* length of _following_ data */
77};
78
79/* The Exec Auxiliary Header. Called The HP-UX Header within HP apparently. */
80struct som_exec_auxhdr {
81 struct aux_id som_auxhdr;
82 int exec_tsize; /* Text size in bytes */
83 int exec_tmem; /* Address to load text at */
84 int exec_tfile; /* Location of text in file */
85 int exec_dsize; /* Data size in bytes */
86 int exec_dmem; /* Address to load data at */
87 int exec_dfile; /* Location of data in file */
88 int exec_bsize; /* Uninitialised data (bss) */
89 int exec_entry; /* Address to start executing */
90 int exec_flags; /* loader flags */
91 int exec_bfill; /* initialisation value for bss */
92};
93
94/* Oh, the things people do to avoid casts. Shame it'll break with gcc's
95 * new aliasing rules really.
96 */
97union name_pt {
98 char * n_name;
99 unsigned int n_strx;
100};
101
102/* The Space Dictionary */
103struct space_dictionary_record {
104 union name_pt name; /* index to subspace name */
105 unsigned int is_loadable :1; /* loadable */
106 unsigned int is_defined :1; /* defined within file */
107 unsigned int is_private :1; /* not sharable */
108 unsigned int has_intermediate_code :1; /* contains intermediate code */
109 unsigned int is_tspecific :1; /* thread specific */
110 unsigned int reserved :11; /* for future expansion */
111 unsigned int sort_key :8; /* for linker */
112 unsigned int reserved2 :8; /* for future expansion */
113
114 int space_number; /* index */
115 int subspace_index; /* index into subspace dict */
116 unsigned int subspace_quantity; /* number of subspaces */
117 int loader_fix_index; /* for loader */
118 unsigned int loader_fix_quantity; /* for loader */
119 int init_pointer_index; /* data pointer array index */
120 unsigned int init_pointer_quantity; /* number of data pointers */
121};
122
123/* The Subspace Dictionary */
124struct subspace_dictionary_record {
125 int space_index;
126 unsigned int access_control_bits :7;
127 unsigned int memory_resident :1;
128 unsigned int dup_common :1;
129 unsigned int is_common :1;
130 unsigned int quadrant :2;
131 unsigned int initially_frozen :1;
132 unsigned int is_first :1;
133 unsigned int code_only :1;
134 unsigned int sort_key :8;
135 unsigned int replicate_init :1;
136 unsigned int continuation :1;
137 unsigned int is_tspecific :1;
138 unsigned int is_comdat :1;
139 unsigned int reserved :4;
140
141 int file_loc_init_value;
142 unsigned int initialization_length;
143 unsigned int subspace_start;
144 unsigned int subspace_length;
145
146 unsigned int reserved2 :5;
147 unsigned int alignment :27;
148
149 union name_pt name;
150 int fixup_request_index;
151 unsigned int fixup_request_quantity;
152};
153
154#endif /* _LINUX_SOM_H */
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index de8832dd272b..680f9a31df25 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 c0f87da78f8a..0b7cc265cc0b 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 fae20ba01fbf..73ded040f1d7 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 dfcf86f013a9..96c79cbd79ef 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 46132409a3f7..075cb0c7eb2a 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 1747b6787b9e..f4aec0e75c3a 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 b9178812d9df..630125818ca8 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/suspend_ioctls.h b/include/linux/suspend_ioctls.h
deleted file mode 100644
index 0b30382984fe..000000000000
--- a/include/linux/suspend_ioctls.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef _LINUX_SUSPEND_IOCTLS_H
2#define _LINUX_SUSPEND_IOCTLS_H
3
4#include <linux/types.h>
5/*
6 * This structure is used to pass the values needed for the identification
7 * of the resume swap area from a user space to the kernel via the
8 * SNAPSHOT_SET_SWAP_AREA ioctl
9 */
10struct resume_swap_area {
11 __kernel_loff_t offset;
12 __u32 dev;
13} __attribute__((packed));
14
15#define SNAPSHOT_IOC_MAGIC '3'
16#define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1)
17#define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2)
18#define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4)
19#define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5)
20#define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9)
21#define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11)
22#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \
23 struct resume_swap_area)
24#define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t)
25#define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15)
26#define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16)
27#define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int)
28#define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18)
29#define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t)
30#define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t)
31#define SNAPSHOT_IOC_MAXNR 20
32
33#endif /* _LINUX_SUSPEND_IOCTLS_H */
diff --git a/include/linux/swab.h b/include/linux/swab.h
index ea0c02fd5163..9ad3c60f6cae 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 2e7d81c4e5ad..f1405b1c71ba 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 c34b4c82b0dc..cd844a6a8d5f 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/sysinfo.h b/include/linux/sysinfo.h
deleted file mode 100644
index 934335a22522..000000000000
--- a/include/linux/sysinfo.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _LINUX_SYSINFO_H
2#define _LINUX_SYSINFO_H
3
4#include <linux/types.h>
5
6#define SI_LOAD_SHIFT 16
7struct sysinfo {
8 __kernel_long_t uptime; /* Seconds since boot */
9 __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */
10 __kernel_ulong_t totalram; /* Total usable main memory size */
11 __kernel_ulong_t freeram; /* Available memory size */
12 __kernel_ulong_t sharedram; /* Amount of shared memory */
13 __kernel_ulong_t bufferram; /* Memory used by buffers */
14 __kernel_ulong_t totalswap; /* Total swap space size */
15 __kernel_ulong_t freeswap; /* swap space still available */
16 __u16 procs; /* Number of current processes */
17 __u16 pad; /* Explicit padding for m68k */
18 __kernel_ulong_t totalhigh; /* Total high memory size */
19 __kernel_ulong_t freehigh; /* Available high memory size */
20 __u32 mem_unit; /* Memory unit size in bytes */
21 char _f[20-2*sizeof(__kernel_ulong_t)-sizeof(__u32)]; /* Padding: libc5 uses this.. */
22};
23
24#endif /* _LINUX_SYSINFO_H */
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
deleted file mode 100644
index 2466e550a41d..000000000000
--- a/include/linux/taskstats.h
+++ /dev/null
@@ -1,213 +0,0 @@
1/* taskstats.h - exporting per-task statistics
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 * (C) Jay Lan, SGI, 2006
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2.1 of the GNU Lesser General Public License
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it would be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 */
15
16#ifndef _LINUX_TASKSTATS_H
17#define _LINUX_TASKSTATS_H
18
19#include <linux/types.h>
20
21/* Format for per-task data returned to userland when
22 * - a task exits
23 * - listener requests stats for a task
24 *
25 * The struct is versioned. Newer versions should only add fields to
26 * the bottom of the struct to maintain backward compatibility.
27 *
28 *
29 * To add new fields
30 * a) bump up TASKSTATS_VERSION
31 * b) add comment indicating new version number at end of struct
32 * c) add new fields after version comment; maintain 64-bit alignment
33 */
34
35
36#define TASKSTATS_VERSION 8
37#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
38 * in linux/sched.h */
39
40struct taskstats {
41
42 /* The version number of this struct. This field is always set to
43 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
44 * Each time the struct is changed, the value should be incremented.
45 */
46 __u16 version;
47 __u32 ac_exitcode; /* Exit status */
48
49 /* The accounting flags of a task as defined in <linux/acct.h>
50 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
51 */
52 __u8 ac_flag; /* Record flags */
53 __u8 ac_nice; /* task_nice */
54
55 /* Delay accounting fields start
56 *
57 * All values, until comment "Delay accounting fields end" are
58 * available only if delay accounting is enabled, even though the last
59 * few fields are not delays
60 *
61 * xxx_count is the number of delay values recorded
62 * xxx_delay_total is the corresponding cumulative delay in nanoseconds
63 *
64 * xxx_delay_total wraps around to zero on overflow
65 * xxx_count incremented regardless of overflow
66 */
67
68 /* Delay waiting for cpu, while runnable
69 * count, delay_total NOT updated atomically
70 */
71 __u64 cpu_count __attribute__((aligned(8)));
72 __u64 cpu_delay_total;
73
74 /* Following four fields atomically updated using task->delays->lock */
75
76 /* Delay waiting for synchronous block I/O to complete
77 * does not account for delays in I/O submission
78 */
79 __u64 blkio_count;
80 __u64 blkio_delay_total;
81
82 /* Delay waiting for page fault I/O (swap in only) */
83 __u64 swapin_count;
84 __u64 swapin_delay_total;
85
86 /* cpu "wall-clock" running time
87 * On some architectures, value will adjust for cpu time stolen
88 * from the kernel in involuntary waits due to virtualization.
89 * Value is cumulative, in nanoseconds, without a corresponding count
90 * and wraps around to zero silently on overflow
91 */
92 __u64 cpu_run_real_total;
93
94 /* cpu "virtual" running time
95 * Uses time intervals seen by the kernel i.e. no adjustment
96 * for kernel's involuntary waits due to virtualization.
97 * Value is cumulative, in nanoseconds, without a corresponding count
98 * and wraps around to zero silently on overflow
99 */
100 __u64 cpu_run_virtual_total;
101 /* Delay accounting fields end */
102 /* version 1 ends here */
103
104 /* Basic Accounting Fields start */
105 char ac_comm[TS_COMM_LEN]; /* Command name */
106 __u8 ac_sched __attribute__((aligned(8)));
107 /* Scheduling discipline */
108 __u8 ac_pad[3];
109 __u32 ac_uid __attribute__((aligned(8)));
110 /* User ID */
111 __u32 ac_gid; /* Group ID */
112 __u32 ac_pid; /* Process ID */
113 __u32 ac_ppid; /* Parent process ID */
114 __u32 ac_btime; /* Begin time [sec since 1970] */
115 __u64 ac_etime __attribute__((aligned(8)));
116 /* Elapsed time [usec] */
117 __u64 ac_utime; /* User CPU time [usec] */
118 __u64 ac_stime; /* SYstem CPU time [usec] */
119 __u64 ac_minflt; /* Minor Page Fault Count */
120 __u64 ac_majflt; /* Major Page Fault Count */
121 /* Basic Accounting Fields end */
122
123 /* Extended accounting fields start */
124 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
125 * The current rss usage is added to this counter every time
126 * a tick is charged to a task's system time. So, at the end we
127 * will have memory usage multiplied by system time. Thus an
128 * average usage per system time unit can be calculated.
129 */
130 __u64 coremem; /* accumulated RSS usage in MB-usec */
131 /* Accumulated virtual memory usage in duration of a task.
132 * Same as acct_rss_mem1 above except that we keep track of VM usage.
133 */
134 __u64 virtmem; /* accumulated VM usage in MB-usec */
135
136 /* High watermark of RSS and virtual memory usage in duration of
137 * a task, in KBytes.
138 */
139 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
140 __u64 hiwater_vm; /* High-water VM usage, in KB */
141
142 /* The following four fields are I/O statistics of a task. */
143 __u64 read_char; /* bytes read */
144 __u64 write_char; /* bytes written */
145 __u64 read_syscalls; /* read syscalls */
146 __u64 write_syscalls; /* write syscalls */
147 /* Extended accounting fields end */
148
149#define TASKSTATS_HAS_IO_ACCOUNTING
150 /* Per-task storage I/O accounting starts */
151 __u64 read_bytes; /* bytes of read I/O */
152 __u64 write_bytes; /* bytes of write I/O */
153 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
154
155 __u64 nvcsw; /* voluntary_ctxt_switches */
156 __u64 nivcsw; /* nonvoluntary_ctxt_switches */
157
158 /* time accounting for SMT machines */
159 __u64 ac_utimescaled; /* utime scaled on frequency etc */
160 __u64 ac_stimescaled; /* stime scaled on frequency etc */
161 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
162
163 /* Delay waiting for memory reclaim */
164 __u64 freepages_count;
165 __u64 freepages_delay_total;
166};
167
168
169/*
170 * Commands sent from userspace
171 * Not versioned. New commands should only be inserted at the enum's end
172 * prior to __TASKSTATS_CMD_MAX
173 */
174
175enum {
176 TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
177 TASKSTATS_CMD_GET, /* user->kernel request/get-response */
178 TASKSTATS_CMD_NEW, /* kernel->user event */
179 __TASKSTATS_CMD_MAX,
180};
181
182#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
183
184enum {
185 TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
186 TASKSTATS_TYPE_PID, /* Process id */
187 TASKSTATS_TYPE_TGID, /* Thread group id */
188 TASKSTATS_TYPE_STATS, /* taskstats structure */
189 TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
190 TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
191 TASKSTATS_TYPE_NULL, /* contains nothing */
192 __TASKSTATS_TYPE_MAX,
193};
194
195#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
196
197enum {
198 TASKSTATS_CMD_ATTR_UNSPEC = 0,
199 TASKSTATS_CMD_ATTR_PID,
200 TASKSTATS_CMD_ATTR_TGID,
201 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
202 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
203 __TASKSTATS_CMD_ATTR_MAX,
204};
205
206#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
207
208/* NETLINK_GENERIC related info */
209
210#define TASKSTATS_GENL_NAME "TASKSTATS"
211#define TASKSTATS_GENL_VERSION 0x1
212
213#endif /* _LINUX_TASKSTATS_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 67c789ae719c..8a7fc4be2d75 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/tcp_metrics.h b/include/linux/tcp_metrics.h
deleted file mode 100644
index cb5157b55f32..000000000000
--- a/include/linux/tcp_metrics.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/* tcp_metrics.h - TCP Metrics Interface */
2
3#ifndef _LINUX_TCP_METRICS_H
4#define _LINUX_TCP_METRICS_H
5
6#include <linux/types.h>
7
8/* NETLINK_GENERIC related info
9 */
10#define TCP_METRICS_GENL_NAME "tcp_metrics"
11#define TCP_METRICS_GENL_VERSION 0x1
12
13enum tcp_metric_index {
14 TCP_METRIC_RTT,
15 TCP_METRIC_RTTVAR,
16 TCP_METRIC_SSTHRESH,
17 TCP_METRIC_CWND,
18 TCP_METRIC_REORDERING,
19
20 /* Always last. */
21 __TCP_METRIC_MAX,
22};
23
24#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)
25
26enum {
27 TCP_METRICS_ATTR_UNSPEC,
28 TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */
29 TCP_METRICS_ATTR_ADDR_IPV6, /* binary */
30 TCP_METRICS_ATTR_AGE, /* msecs */
31 TCP_METRICS_ATTR_TW_TSVAL, /* u32, raw, rcv tsval */
32 TCP_METRICS_ATTR_TW_TS_STAMP, /* s32, sec age */
33 TCP_METRICS_ATTR_VALS, /* nested +1, u32 */
34 TCP_METRICS_ATTR_FOPEN_MSS, /* u16 */
35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */
36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */
37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */
38
39 __TCP_METRICS_ATTR_MAX,
40};
41
42#define TCP_METRICS_ATTR_MAX (__TCP_METRICS_ATTR_MAX - 1)
43
44enum {
45 TCP_METRICS_CMD_UNSPEC,
46 TCP_METRICS_CMD_GET,
47 TCP_METRICS_CMD_DEL,
48
49 __TCP_METRICS_CMD_MAX,
50};
51
52#define TCP_METRICS_CMD_MAX (__TCP_METRICS_CMD_MAX - 1)
53
54#endif /* _LINUX_TCP_METRICS_H */
diff --git a/include/linux/telephony.h b/include/linux/telephony.h
deleted file mode 100644
index f63afe330add..000000000000
--- a/include/linux/telephony.h
+++ /dev/null
@@ -1,262 +0,0 @@
1/******************************************************************************
2 *
3 * telephony.h
4 *
5 * Basic Linux Telephony Interface
6 *
7 * (c) Copyright 1999-2001 Quicknet Technologies, Inc.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 * Authors: Ed Okerson, <eokerson@quicknet.net>
15 * Greg Herlein, <gherlein@quicknet.net>
16 *
17 * Contributors: Alan Cox, <alan@lxorguk.ukuu.org.uk>
18 * David W. Erhart, <derhart@quicknet.net>
19 *
20 * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
21 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
22 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
23 * TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
26 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
28 * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
29 * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
30 *
31 *****************************************************************************/
32
33#ifndef TELEPHONY_H
34#define TELEPHONY_H
35
36#define TELEPHONY_VERSION 3013
37
38#define PHONE_VENDOR_IXJ 1
39#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ
40#define PHONE_VENDOR_VOICETRONIX 2
41#define PHONE_VENDOR_ACULAB 3
42#define PHONE_VENDOR_DIGI 4
43#define PHONE_VENDOR_FRANKLIN 5
44
45/******************************************************************************
46 * Vendor Summary Information Area
47 *
48 * Quicknet Technologies, Inc. - makes low density analog telephony cards
49 * with audio compression, POTS and PSTN interfaces (www.quicknet.net)
50 *
51 * (other vendors following this API shuld add a short description of
52 * the telephony products they support under Linux)
53 *
54 *****************************************************************************/
55#define QTI_PHONEJACK 100
56#define QTI_LINEJACK 300
57#define QTI_PHONEJACK_LITE 400
58#define QTI_PHONEJACK_PCI 500
59#define QTI_PHONECARD 600
60
61/******************************************************************************
62*
63* The capabilities ioctls can inform you of the capabilities of each phone
64* device installed in your system. The PHONECTL_CAPABILITIES ioctl
65* returns an integer value indicating the number of capabilities the
66* device has. The PHONECTL_CAPABILITIES_LIST will fill an array of
67* capability structs with all of its capabilities. The
68* PHONECTL_CAPABILITIES_CHECK takes a single capability struct and returns
69* a TRUE if the device has that capability, otherwise it returns false.
70*
71******************************************************************************/
72typedef enum {
73 vendor = 0,
74 device,
75 port,
76 codec,
77 dsp
78} phone_cap;
79
80struct phone_capability {
81 char desc[80];
82 phone_cap captype;
83 int cap;
84 int handle;
85};
86
87typedef enum {
88 pots = 0,
89 pstn,
90 handset,
91 speaker
92} phone_ports;
93
94#define PHONE_CAPABILITIES _IO ('q', 0x80)
95#define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *)
96#define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *)
97
98typedef struct {
99 char month[3];
100 char day[3];
101 char hour[3];
102 char min[3];
103 int numlen;
104 char number[11];
105 int namelen;
106 char name[80];
107} PHONE_CID;
108
109#define PHONE_RING _IO ('q', 0x83)
110#define PHONE_HOOKSTATE _IO ('q', 0x84)
111#define PHONE_MAXRINGS _IOW ('q', 0x85, char)
112#define PHONE_RING_CADENCE _IOW ('q', 0x86, short)
113#define OLD_PHONE_RING_START _IO ('q', 0x87)
114#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *)
115#define PHONE_RING_STOP _IO ('q', 0x88)
116
117#define USA_RING_CADENCE 0xC0C0
118
119#define PHONE_REC_CODEC _IOW ('q', 0x89, int)
120#define PHONE_REC_START _IO ('q', 0x8A)
121#define PHONE_REC_STOP _IO ('q', 0x8B)
122#define PHONE_REC_DEPTH _IOW ('q', 0x8C, int)
123#define PHONE_FRAME _IOW ('q', 0x8D, int)
124#define PHONE_REC_VOLUME _IOW ('q', 0x8E, int)
125#define PHONE_REC_VOLUME_LINEAR _IOW ('q', 0xDB, int)
126#define PHONE_REC_LEVEL _IO ('q', 0x8F)
127
128#define PHONE_PLAY_CODEC _IOW ('q', 0x90, int)
129#define PHONE_PLAY_START _IO ('q', 0x91)
130#define PHONE_PLAY_STOP _IO ('q', 0x92)
131#define PHONE_PLAY_DEPTH _IOW ('q', 0x93, int)
132#define PHONE_PLAY_VOLUME _IOW ('q', 0x94, int)
133#define PHONE_PLAY_VOLUME_LINEAR _IOW ('q', 0xDC, int)
134#define PHONE_PLAY_LEVEL _IO ('q', 0x95)
135#define PHONE_DTMF_READY _IOR ('q', 0x96, int)
136#define PHONE_GET_DTMF _IOR ('q', 0x97, int)
137#define PHONE_GET_DTMF_ASCII _IOR ('q', 0x98, int)
138#define PHONE_DTMF_OOB _IOW ('q', 0x99, int)
139#define PHONE_EXCEPTION _IOR ('q', 0x9A, int)
140#define PHONE_PLAY_TONE _IOW ('q', 0x9B, char)
141#define PHONE_SET_TONE_ON_TIME _IOW ('q', 0x9C, int)
142#define PHONE_SET_TONE_OFF_TIME _IOW ('q', 0x9D, int)
143#define PHONE_GET_TONE_ON_TIME _IO ('q', 0x9E)
144#define PHONE_GET_TONE_OFF_TIME _IO ('q', 0x9F)
145#define PHONE_GET_TONE_STATE _IO ('q', 0xA0)
146#define PHONE_BUSY _IO ('q', 0xA1)
147#define PHONE_RINGBACK _IO ('q', 0xA2)
148#define PHONE_DIALTONE _IO ('q', 0xA3)
149#define PHONE_CPT_STOP _IO ('q', 0xA4)
150
151#define PHONE_PSTN_SET_STATE _IOW ('q', 0xA4, int)
152#define PHONE_PSTN_GET_STATE _IO ('q', 0xA5)
153
154#define PSTN_ON_HOOK 0
155#define PSTN_RINGING 1
156#define PSTN_OFF_HOOK 2
157#define PSTN_PULSE_DIAL 3
158
159/******************************************************************************
160*
161* The wink duration is tunable with this ioctl. The default wink duration
162* is 320ms. You do not need to use this ioctl if you do not require a
163* different wink duration.
164*
165******************************************************************************/
166#define PHONE_WINK_DURATION _IOW ('q', 0xA6, int)
167#define PHONE_WINK _IOW ('q', 0xAA, int)
168
169/******************************************************************************
170*
171* Codec Definitions
172*
173******************************************************************************/
174typedef enum {
175 G723_63 = 1,
176 G723_53 = 2,
177 TS85 = 3,
178 TS48 = 4,
179 TS41 = 5,
180 G728 = 6,
181 G729 = 7,
182 ULAW = 8,
183 ALAW = 9,
184 LINEAR16 = 10,
185 LINEAR8 = 11,
186 WSS = 12,
187 G729B = 13
188} phone_codec;
189
190struct phone_codec_data
191{
192 phone_codec type;
193 unsigned short buf_min, buf_opt, buf_max;
194};
195
196#define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *)
197#define PHONE_PSTN_LINETEST _IO ('q', 0xA8)
198
199/******************************************************************************
200*
201* This controls the VAD/CNG functionality of G.723.1. The driver will
202* always pass full size frames, any unused bytes will be padded with zeros,
203* and frames passed to the driver should also be padded with zeros. The
204* frame type is encoded in the least significant two bits of the first
205* WORD of the frame as follows:
206*
207* bits 1-0 Frame Type Data Rate Significant Words
208* 00 0 G.723.1 6.3 12
209* 01 1 G.723.1 5.3 10
210* 10 2 VAD/CNG 2
211* 11 3 Repeat last CNG 2 bits
212*
213******************************************************************************/
214#define PHONE_VAD _IOW ('q', 0xA9, int)
215
216
217/******************************************************************************
218*
219* The exception structure allows us to multiplex multiple events onto the
220* select() exception set. If any of these flags are set select() will
221* return with a positive indication on the exception set. The dtmf_ready
222* bit indicates if there is data waiting in the DTMF buffer. The
223* hookstate bit is set if there is a change in hookstate status, it does not
224* indicate the current state of the hookswitch. The pstn_ring bit
225* indicates that the DAA on a LineJACK card has detected ring voltage on
226* the PSTN port. The caller_id bit indicates that caller_id data has been
227* received and is available. The pstn_wink bit indicates that the DAA on
228* the LineJACK has received a wink from the telco switch. The f0, f1, f2
229* and f3 bits indicate that the filter has been triggered by detecting the
230* frequency programmed into that filter.
231*
232* The remaining bits should be set to zero. They will become defined over time
233* for other interface cards and their needs.
234*
235******************************************************************************/
236struct phone_except
237{
238 unsigned int dtmf_ready:1;
239 unsigned int hookstate:1;
240 unsigned int pstn_ring:1;
241 unsigned int caller_id:1;
242 unsigned int pstn_wink:1;
243 unsigned int f0:1;
244 unsigned int f1:1;
245 unsigned int f2:1;
246 unsigned int f3:1;
247 unsigned int flash:1;
248 unsigned int fc0:1;
249 unsigned int fc1:1;
250 unsigned int fc2:1;
251 unsigned int fc3:1;
252 unsigned int reserved:18;
253};
254
255union telephony_exception {
256 struct phone_except bits;
257 unsigned int bytes;
258};
259
260
261#endif /* TELEPHONY_H */
262
diff --git a/include/linux/termios.h b/include/linux/termios.h
deleted file mode 100644
index 2acd0c1f8a2a..000000000000
--- a/include/linux/termios.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef _LINUX_TERMIOS_H
2#define _LINUX_TERMIOS_H
3
4#include <linux/types.h>
5#include <asm/termios.h>
6
7#define NFF 5
8
9struct termiox
10{
11 __u16 x_hflag;
12 __u16 x_cflag;
13 __u16 x_rflag[NFF];
14 __u16 x_sflag;
15};
16
17#define RTSXOFF 0x0001 /* RTS flow control on input */
18#define CTSXON 0x0002 /* CTS flow control on output */
19#define DTRXOFF 0x0004 /* DTR flow control on input */
20#define DSRXON 0x0008 /* DCD flow control on output */
21
22#endif
diff --git a/include/linux/time.h b/include/linux/time.h
index b51e664c83e7..4d358e9d10f1 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/times.h b/include/linux/times.h
deleted file mode 100644
index 87b62615cedd..000000000000
--- a/include/linux/times.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _LINUX_TIMES_H
2#define _LINUX_TIMES_H
3
4#include <linux/types.h>
5
6struct tms {
7 __kernel_clock_t tms_utime;
8 __kernel_clock_t tms_stime;
9 __kernel_clock_t tms_cutime;
10 __kernel_clock_t tms_cstime;
11};
12
13#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 7c5ceb20e03a..5ec87c60b97c 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/tiocl.h b/include/linux/tiocl.h
deleted file mode 100644
index 4756862c4ed4..000000000000
--- a/include/linux/tiocl.h
+++ /dev/null
@@ -1,39 +0,0 @@
1#ifndef _LINUX_TIOCL_H
2#define _LINUX_TIOCL_H
3
4#define TIOCL_SETSEL 2 /* set a selection */
5#define TIOCL_SELCHAR 0 /* select characters */
6#define TIOCL_SELWORD 1 /* select whole words */
7#define TIOCL_SELLINE 2 /* select whole lines */
8#define TIOCL_SELPOINTER 3 /* show the pointer */
9#define TIOCL_SELCLEAR 4 /* clear visibility of selection */
10#define TIOCL_SELMOUSEREPORT 16 /* report beginning of selection */
11#define TIOCL_SELBUTTONMASK 15 /* button mask for report */
12/* selection extent */
13struct tiocl_selection {
14 unsigned short xs; /* X start */
15 unsigned short ys; /* Y start */
16 unsigned short xe; /* X end */
17 unsigned short ye; /* Y end */
18 unsigned short sel_mode; /* selection mode */
19};
20
21#define TIOCL_PASTESEL 3 /* paste previous selection */
22#define TIOCL_UNBLANKSCREEN 4 /* unblank screen */
23
24#define TIOCL_SELLOADLUT 5
25 /* set characters to be considered alphabetic when selecting */
26 /* u32[8] bit array, 4 bytes-aligned with type */
27
28/* these two don't return a value: they write it back in the type */
29#define TIOCL_GETSHIFTSTATE 6 /* write shift state */
30#define TIOCL_GETMOUSEREPORTING 7 /* write whether mouse event are reported */
31#define TIOCL_SETVESABLANK 10 /* set vesa blanking mode */
32#define TIOCL_SETKMSGREDIRECT 11 /* restrict kernel messages to a vt */
33#define TIOCL_GETFGCONSOLE 12 /* get foreground vt */
34#define TIOCL_SCROLLCONSOLE 13 /* scroll console */
35#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
36#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
37#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
38
39#endif /* _LINUX_TIOCL_H */
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
deleted file mode 100644
index f2d90091cc20..000000000000
--- a/include/linux/tipc.h
+++ /dev/null
@@ -1,209 +0,0 @@
1/*
2 * include/linux/tipc.h: Include file for TIPC socket interface
3 *
4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, 2010-2011, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
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 names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE 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 BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _LINUX_TIPC_H_
38#define _LINUX_TIPC_H_
39
40#include <linux/types.h>
41
42/*
43 * TIPC addressing primitives
44 */
45
46struct tipc_portid {
47 __u32 ref;
48 __u32 node;
49};
50
51struct tipc_name {
52 __u32 type;
53 __u32 instance;
54};
55
56struct tipc_name_seq {
57 __u32 type;
58 __u32 lower;
59 __u32 upper;
60};
61
62static inline __u32 tipc_addr(unsigned int zone,
63 unsigned int cluster,
64 unsigned int node)
65{
66 return (zone << 24) | (cluster << 12) | node;
67}
68
69static inline unsigned int tipc_zone(__u32 addr)
70{
71 return addr >> 24;
72}
73
74static inline unsigned int tipc_cluster(__u32 addr)
75{
76 return (addr >> 12) & 0xfff;
77}
78
79static inline unsigned int tipc_node(__u32 addr)
80{
81 return addr & 0xfff;
82}
83
84/*
85 * Application-accessible port name types
86 */
87
88#define TIPC_CFG_SRV 0 /* configuration service name type */
89#define TIPC_TOP_SRV 1 /* topology service name type */
90#define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */
91
92/*
93 * Publication scopes when binding port names and port name sequences
94 */
95
96#define TIPC_ZONE_SCOPE 1
97#define TIPC_CLUSTER_SCOPE 2
98#define TIPC_NODE_SCOPE 3
99
100/*
101 * Limiting values for messages
102 */
103
104#define TIPC_MAX_USER_MSG_SIZE 66000U
105
106/*
107 * Message importance levels
108 */
109
110#define TIPC_LOW_IMPORTANCE 0
111#define TIPC_MEDIUM_IMPORTANCE 1
112#define TIPC_HIGH_IMPORTANCE 2
113#define TIPC_CRITICAL_IMPORTANCE 3
114
115/*
116 * Msg rejection/connection shutdown reasons
117 */
118
119#define TIPC_OK 0
120#define TIPC_ERR_NO_NAME 1
121#define TIPC_ERR_NO_PORT 2
122#define TIPC_ERR_NO_NODE 3
123#define TIPC_ERR_OVERLOAD 4
124#define TIPC_CONN_SHUTDOWN 5
125
126/*
127 * TIPC topology subscription service definitions
128 */
129
130#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
133
134#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
135
136struct tipc_subscr {
137 struct tipc_name_seq seq; /* name sequence of interest */
138 __u32 timeout; /* subscription duration (in ms) */
139 __u32 filter; /* bitmask of filter options */
140 char usr_handle[8]; /* available for subscriber use */
141};
142
143#define TIPC_PUBLISHED 1 /* publication event */
144#define TIPC_WITHDRAWN 2 /* withdraw event */
145#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
146
147struct tipc_event {
148 __u32 event; /* event type */
149 __u32 found_lower; /* matching name seq instances */
150 __u32 found_upper; /* " " " " */
151 struct tipc_portid port; /* associated port */
152 struct tipc_subscr s; /* associated subscription */
153};
154
155/*
156 * Socket API
157 */
158
159#ifndef AF_TIPC
160#define AF_TIPC 30
161#endif
162
163#ifndef PF_TIPC
164#define PF_TIPC AF_TIPC
165#endif
166
167#ifndef SOL_TIPC
168#define SOL_TIPC 271
169#endif
170
171#define TIPC_ADDR_NAMESEQ 1
172#define TIPC_ADDR_MCAST 1
173#define TIPC_ADDR_NAME 2
174#define TIPC_ADDR_ID 3
175
176struct sockaddr_tipc {
177 unsigned short family;
178 unsigned char addrtype;
179 signed char scope;
180 union {
181 struct tipc_portid id;
182 struct tipc_name_seq nameseq;
183 struct {
184 struct tipc_name name;
185 __u32 domain;
186 } name;
187 } addr;
188};
189
190/*
191 * Ancillary data objects supported by recvmsg()
192 */
193
194#define TIPC_ERRINFO 1 /* error info */
195#define TIPC_RETDATA 2 /* returned data */
196#define TIPC_DESTNAME 3 /* destination name */
197
198/*
199 * TIPC-specific socket option values
200 */
201
202#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
203#define TIPC_SRC_DROPPABLE 128 /* Default: based on socket type */
204#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
205#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
207#define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */
208
209#endif
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
deleted file mode 100644
index 0b1e3f218a36..000000000000
--- a/include/linux/tipc_config.h
+++ /dev/null
@@ -1,395 +0,0 @@
1/*
2 * include/linux/tipc_config.h: Include file for TIPC configuration interface
3 *
4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005-2007, 2010-2011, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
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 names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE 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 BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _LINUX_TIPC_CONFIG_H_
38#define _LINUX_TIPC_CONFIG_H_
39
40#include <linux/types.h>
41#include <linux/string.h>
42#include <asm/byteorder.h>
43
44#ifndef __KERNEL__
45#include <arpa/inet.h> /* for ntohs etc. */
46#endif
47
48/*
49 * Configuration
50 *
51 * All configuration management messaging involves sending a request message
52 * to the TIPC configuration service on a node, which sends a reply message
53 * back. (In the future multi-message replies may be supported.)
54 *
55 * Both request and reply messages consist of a transport header and payload.
56 * The transport header contains info about the desired operation;
57 * the payload consists of zero or more type/length/value (TLV) items
58 * which specify parameters or results for the operation.
59 *
60 * For many operations, the request and reply messages have a fixed number
61 * of TLVs (usually zero or one); however, some reply messages may return
62 * a variable number of TLVs. A failed request is denoted by the presence
63 * of an "error string" TLV in the reply message instead of the TLV(s) the
64 * reply should contain if the request succeeds.
65 */
66
67/*
68 * Public commands:
69 * May be issued by any process.
70 * Accepted by own node, or by remote node only if remote management enabled.
71 */
72
73#define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */
74#define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */
75#define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */
76#define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */
77#define TIPC_CMD_GET_LINKS 0x0004 /* tx net_addr, rx link_info(s) */
78#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */
79#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */
80#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
81#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */
82
83/*
84 * Protected commands:
85 * May only be issued by "network administration capable" process.
86 * Accepted by own node, or by remote node only if remote management enabled
87 * and this node is zone manager.
88 */
89
90#define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */
91#define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */
92#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* obsoleted */
93#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* obsoleted */
94#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */
95#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */
96#define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */
97#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */
98#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
99
100#define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */
101#define TIPC_CMD_DISABLE_BEARER 0x4102 /* tx bearer_name, rx none */
102#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */
103#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */
104#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */
105#define TIPC_CMD_SET_LOG_SIZE 0x410A /* obsoleted */
106#define TIPC_CMD_DUMP_LOG 0x410B /* obsoleted */
107#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
108
109/*
110 * Private commands:
111 * May only be issued by "network administration capable" process.
112 * Accepted by own node only; cannot be used on a remote node.
113 */
114
115#define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */
116#define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */
117#define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */
118#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* obsoleted */
119#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* obsoleted */
120#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */
121#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */
122#define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */
123#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */
124#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
125
126/*
127 * Reserved commands:
128 * May not be issued by any process.
129 * Used internally by TIPC.
130 */
131
132#define TIPC_CMD_NOT_NET_ADMIN 0xC001 /* tx none, rx none */
133
134/*
135 * TLV types defined for TIPC
136 */
137
138#define TIPC_TLV_NONE 0 /* no TLV present */
139#define TIPC_TLV_VOID 1 /* empty TLV (0 data bytes)*/
140#define TIPC_TLV_UNSIGNED 2 /* 32-bit integer */
141#define TIPC_TLV_STRING 3 /* char[128] (max) */
142#define TIPC_TLV_LARGE_STRING 4 /* char[2048] (max) */
143#define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */
144
145#define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */
146#define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */
147#define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */
148#define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */
149#define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */
150#define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */
151#define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */
152#define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */
153#define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */
154#define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */
155#define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */
156
157/*
158 * Maximum sizes of TIPC bearer-related names (including terminating NUL)
159 */
160
161#define TIPC_MAX_MEDIA_NAME 16 /* format = media */
162#define TIPC_MAX_IF_NAME 16 /* format = interface */
163#define TIPC_MAX_BEARER_NAME 32 /* format = media:interface */
164#define TIPC_MAX_LINK_NAME 60 /* format = Z.C.N:interface-Z.C.N:interface */
165
166/*
167 * Link priority limits (min, default, max, media default)
168 */
169
170#define TIPC_MIN_LINK_PRI 0
171#define TIPC_DEF_LINK_PRI 10
172#define TIPC_MAX_LINK_PRI 31
173#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
174
175/*
176 * Link tolerance limits (min, default, max), in ms
177 */
178
179#define TIPC_MIN_LINK_TOL 50
180#define TIPC_DEF_LINK_TOL 1500
181#define TIPC_MAX_LINK_TOL 30000
182
183#if (TIPC_MIN_LINK_TOL < 16)
184#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
185#endif
186
187/*
188 * Link window limits (min, default, max), in packets
189 */
190
191#define TIPC_MIN_LINK_WIN 16
192#define TIPC_DEF_LINK_WIN 50
193#define TIPC_MAX_LINK_WIN 150
194
195
196struct tipc_node_info {
197 __be32 addr; /* network address of node */
198 __be32 up; /* 0=down, 1= up */
199};
200
201struct tipc_link_info {
202 __be32 dest; /* network address of peer node */
203 __be32 up; /* 0=down, 1=up */
204 char str[TIPC_MAX_LINK_NAME]; /* link name */
205};
206
207struct tipc_bearer_config {
208 __be32 priority; /* Range [1,31]. Override per link */
209 __be32 disc_domain; /* <Z.C.N> describing desired nodes */
210 char name[TIPC_MAX_BEARER_NAME];
211};
212
213struct tipc_link_config {
214 __be32 value;
215 char name[TIPC_MAX_LINK_NAME];
216};
217
218#define TIPC_NTQ_ALLTYPES 0x80000000
219
220struct tipc_name_table_query {
221 __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */
222 __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */
223 __be32 lowbound; /* (i.e. displays all entries of name table) */
224 __be32 upbound;
225};
226
227/*
228 * The error string TLV is a null-terminated string describing the cause
229 * of the request failure. To simplify error processing (and to save space)
230 * the first character of the string can be a special error code character
231 * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason.
232 */
233
234#define TIPC_CFG_TLV_ERROR "\x80" /* request contains incorrect TLV(s) */
235#define TIPC_CFG_NOT_NET_ADMIN "\x81" /* must be network administrator */
236#define TIPC_CFG_NOT_ZONE_MSTR "\x82" /* must be zone master */
237#define TIPC_CFG_NO_REMOTE "\x83" /* remote management not enabled */
238#define TIPC_CFG_NOT_SUPPORTED "\x84" /* request is not supported by TIPC */
239#define TIPC_CFG_INVALID_VALUE "\x85" /* request has invalid argument value */
240
241/*
242 * A TLV consists of a descriptor, followed by the TLV value.
243 * TLV descriptor fields are stored in network byte order;
244 * TLV values must also be stored in network byte order (where applicable).
245 * TLV descriptors must be aligned to addresses which are multiple of 4,
246 * so up to 3 bytes of padding may exist at the end of the TLV value area.
247 * There must not be any padding between the TLV descriptor and its value.
248 */
249
250struct tlv_desc {
251 __be16 tlv_len; /* TLV length (descriptor + value) */
252 __be16 tlv_type; /* TLV identifier */
253};
254
255#define TLV_ALIGNTO 4
256
257#define TLV_ALIGN(datalen) (((datalen)+(TLV_ALIGNTO-1)) & ~(TLV_ALIGNTO-1))
258#define TLV_LENGTH(datalen) (sizeof(struct tlv_desc) + (datalen))
259#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
260#define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
261
262static inline int TLV_OK(const void *tlv, __u16 space)
263{
264 /*
265 * Would also like to check that "tlv" is a multiple of 4,
266 * but don't know how to do this in a portable way.
267 * - Tried doing (!(tlv & (TLV_ALIGNTO-1))), but GCC compiler
268 * won't allow binary "&" with a pointer.
269 * - Tried casting "tlv" to integer type, but causes warning about size
270 * mismatch when pointer is bigger than chosen type (int, long, ...).
271 */
272
273 return (space >= TLV_SPACE(0)) &&
274 (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space);
275}
276
277static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
278{
279 return TLV_OK(tlv, space) &&
280 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
281}
282
283static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
284{
285 struct tlv_desc *tlv_ptr;
286 int tlv_len;
287
288 tlv_len = TLV_LENGTH(len);
289 tlv_ptr = (struct tlv_desc *)tlv;
290 tlv_ptr->tlv_type = htons(type);
291 tlv_ptr->tlv_len = htons(tlv_len);
292 if (len && data)
293 memcpy(TLV_DATA(tlv_ptr), data, tlv_len);
294 return TLV_SPACE(len);
295}
296
297/*
298 * A TLV list descriptor simplifies processing of messages
299 * containing multiple TLVs.
300 */
301
302struct tlv_list_desc {
303 struct tlv_desc *tlv_ptr; /* ptr to current TLV */
304 __u32 tlv_space; /* # bytes from curr TLV to list end */
305};
306
307static inline void TLV_LIST_INIT(struct tlv_list_desc *list,
308 void *data, __u32 space)
309{
310 list->tlv_ptr = (struct tlv_desc *)data;
311 list->tlv_space = space;
312}
313
314static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list)
315{
316 return (list->tlv_space == 0);
317}
318
319static inline int TLV_LIST_CHECK(struct tlv_list_desc *list, __u16 exp_type)
320{
321 return TLV_CHECK(list->tlv_ptr, list->tlv_space, exp_type);
322}
323
324static inline void *TLV_LIST_DATA(struct tlv_list_desc *list)
325{
326 return TLV_DATA(list->tlv_ptr);
327}
328
329static inline void TLV_LIST_STEP(struct tlv_list_desc *list)
330{
331 __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
332
333 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
334 list->tlv_space -= tlv_space;
335}
336
337/*
338 * Configuration messages exchanged via NETLINK_GENERIC use the following
339 * family id, name, version and command.
340 */
341#define TIPC_GENL_NAME "TIPC"
342#define TIPC_GENL_VERSION 0x1
343#define TIPC_GENL_CMD 0x1
344
345/*
346 * TIPC specific header used in NETLINK_GENERIC requests.
347 */
348struct tipc_genlmsghdr {
349 __u32 dest; /* Destination address */
350 __u16 cmd; /* Command */
351 __u16 reserved; /* Unused */
352};
353
354#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
355
356/*
357 * Configuration messages exchanged via TIPC sockets use the TIPC configuration
358 * message header, which is defined below. This structure is analogous
359 * to the Netlink message header, but fields are stored in network byte order
360 * and no padding is permitted between the header and the message data
361 * that follows.
362 */
363
364struct tipc_cfg_msg_hdr {
365 __be32 tcm_len; /* Message length (including header) */
366 __be16 tcm_type; /* Command type */
367 __be16 tcm_flags; /* Additional flags */
368 char tcm_reserved[8]; /* Unused */
369};
370
371#define TCM_F_REQUEST 0x1 /* Flag: Request message */
372#define TCM_F_MORE 0x2 /* Flag: Message to be continued */
373
374#define TCM_ALIGN(datalen) (((datalen)+3) & ~3)
375#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
376#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
377#define TCM_DATA(tcm_hdr) ((void *)((char *)(tcm_hdr) + TCM_LENGTH(0)))
378
379static inline int TCM_SET(void *msg, __u16 cmd, __u16 flags,
380 void *data, __u16 data_len)
381{
382 struct tipc_cfg_msg_hdr *tcm_hdr;
383 int msg_len;
384
385 msg_len = TCM_LENGTH(data_len);
386 tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;
387 tcm_hdr->tcm_len = htonl(msg_len);
388 tcm_hdr->tcm_type = htons(cmd);
389 tcm_hdr->tcm_flags = htons(flags);
390 if (data_len && data)
391 memcpy(TCM_DATA(msg), data, data_len);
392 return TCM_SPACE(data_len);
393}
394
395#endif
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h
index 772dedbc3a22..915c3bb164ac 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 4f6c59a5fb79..f0b4eb47297c 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/tty_flags.h b/include/linux/tty_flags.h
deleted file mode 100644
index eefcb483a2c0..000000000000
--- a/include/linux/tty_flags.h
+++ /dev/null
@@ -1,78 +0,0 @@
1#ifndef _LINUX_TTY_FLAGS_H
2#define _LINUX_TTY_FLAGS_H
3
4/*
5 * Definitions for async_struct (and serial_struct) flags field also
6 * shared by the tty_port flags structures.
7 *
8 * Define ASYNCB_* for convenient use with {test,set,clear}_bit.
9 */
10#define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes
11 * on the callout port */
12#define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */
13#define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */
14#define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */
15#define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */
16#define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */
17#define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */
18#define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during
19 * autoconfiguration */
20#define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */
21#define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */
22#define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */
23#define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */
24#define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */
25#define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */
26#define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety
27 * checks. Note: can be dangerous! */
28#define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */
29#define ASYNCB_LAST_USER 15
30
31/* Internal flags used only by kernel */
32#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
33#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
34#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
35#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
36#define ASYNCB_CLOSING 27 /* Serial port is closing */
37#define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */
38#define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */
39#define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */
40#define ASYNCB_CONS_FLOW 23 /* flow control for console */
41#define ASYNCB_FIRST_KERNEL 22
42
43#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
44#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
45#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
46#define ASYNC_SAK (1U << ASYNCB_SAK)
47#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
48#define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI)
49#define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI)
50#define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST)
51#define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ)
52#define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT)
53#define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT)
54#define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP)
55#define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD)
56#define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI)
57#define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY)
58#define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART)
59#define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE)
60
61#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1)
62#define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \
63 ASYNC_LOW_LATENCY)
64#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
65#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)
66#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
67
68#define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED)
69#define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE)
70#define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF)
71#define ASYNC_CLOSING (1U << ASYNCB_CLOSING)
72#define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW)
73#define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD)
74#define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ)
75#define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW)
76#define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1))
77
78#endif
diff --git a/include/linux/types.h b/include/linux/types.h
index bf0dd7524b2a..1cc0e4b9a048 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/udf_fs_i.h b/include/linux/udf_fs_i.h
deleted file mode 100644
index 3536965913b0..000000000000
--- a/include/linux/udf_fs_i.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * udf_fs_i.h
3 *
4 * This file is intended for the Linux kernel/module.
5 *
6 * COPYRIGHT
7 * This file is distributed under the terms of the GNU General Public
8 * License (GPL). Copies of the GPL can be obtained from:
9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 * Each contributing author retains all rights to their own work.
11 */
12#ifndef _UDF_FS_I_H
13#define _UDF_FS_I_H 1
14
15/* exported IOCTLs, we have 'l', 0x40-0x7f */
16#define UDF_GETEASIZE _IOR('l', 0x40, int)
17#define UDF_GETEABLOCK _IOR('l', 0x41, void *)
18#define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
19#define UDF_RELOCATE_BLOCKS _IOWR('l', 0x43, long)
20
21#endif /* _UDF_FS_I_H */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 03f72a2ba028..0b67d7793520 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/uhid.h b/include/linux/uhid.h
deleted file mode 100644
index 9c6974f16966..000000000000
--- a/include/linux/uhid.h
+++ /dev/null
@@ -1,104 +0,0 @@
1#ifndef __UHID_H_
2#define __UHID_H_
3
4/*
5 * User-space I/O driver support for HID subsystem
6 * Copyright (c) 2012 David Herrmann
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 */
15
16/*
17 * Public header for user-space communication. We try to keep every structure
18 * aligned but to be safe we also use __attribute__((__packed__)). Therefore,
19 * the communication should be ABI compatible even between architectures.
20 */
21
22#include <linux/input.h>
23#include <linux/types.h>
24
25enum uhid_event_type {
26 UHID_CREATE,
27 UHID_DESTROY,
28 UHID_START,
29 UHID_STOP,
30 UHID_OPEN,
31 UHID_CLOSE,
32 UHID_OUTPUT,
33 UHID_OUTPUT_EV,
34 UHID_INPUT,
35 UHID_FEATURE,
36 UHID_FEATURE_ANSWER,
37};
38
39struct uhid_create_req {
40 __u8 name[128];
41 __u8 phys[64];
42 __u8 uniq[64];
43 __u8 __user *rd_data;
44 __u16 rd_size;
45
46 __u16 bus;
47 __u32 vendor;
48 __u32 product;
49 __u32 version;
50 __u32 country;
51} __attribute__((__packed__));
52
53#define UHID_DATA_MAX 4096
54
55enum uhid_report_type {
56 UHID_FEATURE_REPORT,
57 UHID_OUTPUT_REPORT,
58 UHID_INPUT_REPORT,
59};
60
61struct uhid_input_req {
62 __u8 data[UHID_DATA_MAX];
63 __u16 size;
64} __attribute__((__packed__));
65
66struct uhid_output_req {
67 __u8 data[UHID_DATA_MAX];
68 __u16 size;
69 __u8 rtype;
70} __attribute__((__packed__));
71
72struct uhid_output_ev_req {
73 __u16 type;
74 __u16 code;
75 __s32 value;
76} __attribute__((__packed__));
77
78struct uhid_feature_req {
79 __u32 id;
80 __u8 rnum;
81 __u8 rtype;
82} __attribute__((__packed__));
83
84struct uhid_feature_answer_req {
85 __u32 id;
86 __u16 err;
87 __u16 size;
88 __u8 data[UHID_DATA_MAX];
89};
90
91struct uhid_event {
92 __u32 type;
93
94 union {
95 struct uhid_create_req create;
96 struct uhid_input_req input;
97 struct uhid_output_req output;
98 struct uhid_output_ev_req output_ev;
99 struct uhid_feature_req feature;
100 struct uhid_feature_answer_req feature_answer;
101 } u;
102} __attribute__((__packed__));
103
104#endif /* __UHID_H_ */
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index c454bbe39ee7..0a4487d3fb1e 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 98c114323a8b..629aaf51f30b 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/ultrasound.h b/include/linux/ultrasound.h
deleted file mode 100644
index 71339dc531c5..000000000000
--- a/include/linux/ultrasound.h
+++ /dev/null
@@ -1,103 +0,0 @@
1#ifndef _ULTRASOUND_H_
2#define _ULTRASOUND_H_
3/*
4 * ultrasound.h - Macros for programming the Gravis Ultrasound
5 * These macros are extremely device dependent
6 * and not portable.
7 */
8/*
9 * Copyright (C) by Hannu Savolainen 1993-1997
10 *
11 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
12 * Version 2 (June 1991). See the "COPYING" file distributed with this software
13 * for more info.
14 */
15
16
17/*
18 * Private events for Gravis Ultrasound (GUS)
19 *
20 * Format:
21 * byte 0 - SEQ_PRIVATE (0xfe)
22 * byte 1 - Synthesizer device number (0-N)
23 * byte 2 - Command (see below)
24 * byte 3 - Voice number (0-31)
25 * bytes 4 and 5 - parameter P1 (unsigned short)
26 * bytes 6 and 7 - parameter P2 (unsigned short)
27 *
28 * Commands:
29 * Each command affects one voice defined in byte 3.
30 * Unused parameters (P1 and/or P2 *MUST* be initialized to zero).
31 * _GUS_NUMVOICES - Sets max. number of concurrent voices (P1=14-31, default 16)
32 * _GUS_VOICESAMPLE- ************ OBSOLETE *************
33 * _GUS_VOICEON - Starts voice (P1=voice mode)
34 * _GUS_VOICEOFF - Stops voice (no parameters)
35 * _GUS_VOICEFADE - Stops the voice smoothly.
36 * _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode)
37 * _GUS_VOICEBALA - Sets voice balance (P1, 0=left, 7=middle and 15=right, default 7)
38 * _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz)
39 * _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
40 * _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off)
41 * (Like GUS_VOICEVOL but doesn't change the hw
42 * volume. It just updates volume in the voice table).
43 *
44 * _GUS_RAMPRANGE - Sets limits for volume ramping (P1=low volume, P2=high volume)
45 * _GUS_RAMPRATE - Sets the speed for volume ramping (P1=scale, P2=rate)
46 * _GUS_RAMPMODE - Sets the volume ramping mode (P1=ramping mode)
47 * _GUS_RAMPON - Starts volume ramping (no parameters)
48 * _GUS_RAMPOFF - Stops volume ramping (no parameters)
49 * _GUS_VOLUME_SCALE - Changes the volume calculation constants
50 * for all voices.
51 */
52
53#define _GUS_NUMVOICES 0x00
54#define _GUS_VOICESAMPLE 0x01 /* OBSOLETE */
55#define _GUS_VOICEON 0x02
56#define _GUS_VOICEOFF 0x03
57#define _GUS_VOICEMODE 0x04
58#define _GUS_VOICEBALA 0x05
59#define _GUS_VOICEFREQ 0x06
60#define _GUS_VOICEVOL 0x07
61#define _GUS_RAMPRANGE 0x08
62#define _GUS_RAMPRATE 0x09
63#define _GUS_RAMPMODE 0x0a
64#define _GUS_RAMPON 0x0b
65#define _GUS_RAMPOFF 0x0c
66#define _GUS_VOICEFADE 0x0d
67#define _GUS_VOLUME_SCALE 0x0e
68#define _GUS_VOICEVOL2 0x0f
69#define _GUS_VOICE_POS 0x10
70
71/*
72 * GUS API macros
73 */
74
75#define _GUS_CMD(chn, voice, cmd, p1, p2) \
76 {_SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_PRIVATE;\
77 _seqbuf[_seqbufptr+1] = (chn); _seqbuf[_seqbufptr+2] = cmd;\
78 _seqbuf[_seqbufptr+3] = voice;\
79 *(unsigned short*)&_seqbuf[_seqbufptr+4] = p1;\
80 *(unsigned short*)&_seqbuf[_seqbufptr+6] = p2;\
81 _SEQ_ADVBUF(8);}
82
83#define GUS_NUMVOICES(chn, p1) _GUS_CMD(chn, 0, _GUS_NUMVOICES, (p1), 0)
84#define GUS_VOICESAMPLE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICESAMPLE, (p1), 0) /* OBSOLETE */
85#define GUS_VOICEON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEON, (p1), 0)
86#define GUS_VOICEOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEOFF, 0, 0)
87#define GUS_VOICEFADE(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEFADE, 0, 0)
88#define GUS_VOICEMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEMODE, (p1), 0)
89#define GUS_VOICEBALA(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEBALA, (p1), 0)
90#define GUS_VOICEFREQ(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICEFREQ, \
91 (p) & 0xffff, ((p) >> 16) & 0xffff)
92#define GUS_VOICEVOL(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL, (p1), 0)
93#define GUS_VOICEVOL2(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL2, (p1), 0)
94#define GUS_RAMPRANGE(chn, voice, low, high) _GUS_CMD(chn, voice, _GUS_RAMPRANGE, (low), (high))
95#define GUS_RAMPRATE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_RAMPRATE, (p1), (p2))
96#define GUS_RAMPMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPMODE, (p1), 0)
97#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
98#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
99#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
100#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
101 (p) & 0xffff, ((p) >> 16) & 0xffff)
102
103#endif
diff --git a/include/linux/un.h b/include/linux/un.h
deleted file mode 100644
index 3ed3e46c1b1f..000000000000
--- a/include/linux/un.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _LINUX_UN_H
2#define _LINUX_UN_H
3
4#include <linux/socket.h>
5
6#define UNIX_PATH_MAX 108
7
8struct sockaddr_un {
9 __kernel_sa_family_t sun_family; /* AF_UNIX */
10 char sun_path[UNIX_PATH_MAX]; /* pathname */
11};
12
13#endif /* _LINUX_UN_H */
diff --git a/include/linux/unistd.h b/include/linux/unistd.h
deleted file mode 100644
index aa8d5b5e2e3e..000000000000
--- a/include/linux/unistd.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _LINUX_UNISTD_H_
2#define _LINUX_UNISTD_H_
3
4/*
5 * Include machine specific syscall numbers
6 */
7#include <asm/unistd.h>
8
9#endif /* _LINUX_UNISTD_H_ */
diff --git a/include/linux/unix_diag.h b/include/linux/unix_diag.h
deleted file mode 100644
index b1d2bf16b33c..000000000000
--- a/include/linux/unix_diag.h
+++ /dev/null
@@ -1,54 +0,0 @@
1#ifndef __UNIX_DIAG_H__
2#define __UNIX_DIAG_H__
3
4#include <linux/types.h>
5
6struct unix_diag_req {
7 __u8 sdiag_family;
8 __u8 sdiag_protocol;
9 __u16 pad;
10 __u32 udiag_states;
11 __u32 udiag_ino;
12 __u32 udiag_show;
13 __u32 udiag_cookie[2];
14};
15
16#define UDIAG_SHOW_NAME 0x00000001 /* show name (not path) */
17#define UDIAG_SHOW_VFS 0x00000002 /* show VFS inode info */
18#define UDIAG_SHOW_PEER 0x00000004 /* show peer socket info */
19#define UDIAG_SHOW_ICONS 0x00000008 /* show pending connections */
20#define UDIAG_SHOW_RQLEN 0x00000010 /* show skb receive queue len */
21#define UDIAG_SHOW_MEMINFO 0x00000020 /* show memory info of a socket */
22
23struct unix_diag_msg {
24 __u8 udiag_family;
25 __u8 udiag_type;
26 __u8 udiag_state;
27 __u8 pad;
28
29 __u32 udiag_ino;
30 __u32 udiag_cookie[2];
31};
32
33enum {
34 UNIX_DIAG_NAME,
35 UNIX_DIAG_VFS,
36 UNIX_DIAG_PEER,
37 UNIX_DIAG_ICONS,
38 UNIX_DIAG_RQLEN,
39 UNIX_DIAG_MEMINFO,
40
41 UNIX_DIAG_MAX,
42};
43
44struct unix_diag_vfs {
45 __u32 udiag_vfs_ino;
46 __u32 udiag_vfs_dev;
47};
48
49struct unix_diag_rqlen {
50 __u32 udiag_rqueue;
51 __u32 udiag_wqueue;
52};
53
54#endif
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 4abe28e41cbc..04a26285416c 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/utime.h b/include/linux/utime.h
deleted file mode 100644
index 5cdf673afbdb..000000000000
--- a/include/linux/utime.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef _LINUX_UTIME_H
2#define _LINUX_UTIME_H
3
4#include <linux/types.h>
5
6struct utimbuf {
7 __kernel_time_t actime;
8 __kernel_time_t modtime;
9};
10
11#endif
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index c714ed75eae2..2b345206722a 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 f86c37bfd4a0..6df2509033d7 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/uvcvideo.h b/include/linux/uvcvideo.h
deleted file mode 100644
index 3b081862b9e8..000000000000
--- a/include/linux/uvcvideo.h
+++ /dev/null
@@ -1,70 +0,0 @@
1#ifndef __LINUX_UVCVIDEO_H_
2#define __LINUX_UVCVIDEO_H_
3
4#include <linux/ioctl.h>
5#include <linux/types.h>
6
7/*
8 * Dynamic controls
9 */
10
11/* Data types for UVC control data */
12#define UVC_CTRL_DATA_TYPE_RAW 0
13#define UVC_CTRL_DATA_TYPE_SIGNED 1
14#define UVC_CTRL_DATA_TYPE_UNSIGNED 2
15#define UVC_CTRL_DATA_TYPE_BOOLEAN 3
16#define UVC_CTRL_DATA_TYPE_ENUM 4
17#define UVC_CTRL_DATA_TYPE_BITMASK 5
18
19/* Control flags */
20#define UVC_CTRL_FLAG_SET_CUR (1 << 0)
21#define UVC_CTRL_FLAG_GET_CUR (1 << 1)
22#define UVC_CTRL_FLAG_GET_MIN (1 << 2)
23#define UVC_CTRL_FLAG_GET_MAX (1 << 3)
24#define UVC_CTRL_FLAG_GET_RES (1 << 4)
25#define UVC_CTRL_FLAG_GET_DEF (1 << 5)
26/* Control should be saved at suspend and restored at resume. */
27#define UVC_CTRL_FLAG_RESTORE (1 << 6)
28/* Control can be updated by the camera. */
29#define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
30
31#define UVC_CTRL_FLAG_GET_RANGE \
32 (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \
33 UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
34 UVC_CTRL_FLAG_GET_DEF)
35
36struct uvc_menu_info {
37 __u32 value;
38 __u8 name[32];
39};
40
41struct uvc_xu_control_mapping {
42 __u32 id;
43 __u8 name[32];
44 __u8 entity[16];
45 __u8 selector;
46
47 __u8 size;
48 __u8 offset;
49 __u32 v4l2_type;
50 __u32 data_type;
51
52 struct uvc_menu_info __user *menu_info;
53 __u32 menu_count;
54
55 __u32 reserved[4];
56};
57
58struct uvc_xu_control_query {
59 __u8 unit;
60 __u8 selector;
61 __u8 query; /* Video Class-Specific Request Code, */
62 /* defined in linux/usb/video.h A.8. */
63 __u16 size;
64 __u8 __user *data;
65};
66
67#define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping)
68#define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query)
69
70#endif
diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h
deleted file mode 100644
index 4f0667e010dd..000000000000
--- a/include/linux/v4l2-common.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * include/linux/v4l2-common.h
3 *
4 * Common V4L2 and V4L2 subdev definitions.
5 *
6 * Users are advised to #include this file either through videodev2.h
7 * (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
8 * to this file directly.
9 *
10 * Copyright (C) 2012 Nokia Corporation
11 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
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 * version 2 as published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 * 02110-1301 USA
26 *
27 */
28
29#ifndef __V4L2_COMMON__
30#define __V4L2_COMMON__
31
32/*
33 *
34 * Selection interface definitions
35 *
36 */
37
38/* Current cropping area */
39#define V4L2_SEL_TGT_CROP 0x0000
40/* Default cropping area */
41#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
42/* Cropping bounds */
43#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
44/* Current composing area */
45#define V4L2_SEL_TGT_COMPOSE 0x0100
46/* Default composing area */
47#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
48/* Composing bounds */
49#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
50/* Current composing area plus all padding pixels */
51#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
52
53/* Backward compatibility target definitions --- to be removed. */
54#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
55#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
56#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
57#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
58#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
59#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
60
61/* Selection flags */
62#define V4L2_SEL_FLAG_GE (1 << 0)
63#define V4L2_SEL_FLAG_LE (1 << 1)
64#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
65
66/* Backward compatibility flag definitions --- to be removed. */
67#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
68#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
69#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
70
71#endif /* __V4L2_COMMON__ */
diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
deleted file mode 100644
index f56c945cecd4..000000000000
--- a/include/linux/v4l2-controls.h
+++ /dev/null
@@ -1,803 +0,0 @@
1/*
2 * Video for Linux Two controls 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 * The contents of this header was split off from videodev2.h. All control
45 * definitions should be added to this header, which is included by
46 * videodev2.h.
47 */
48
49#ifndef __LINUX_V4L2_CONTROLS_H
50#define __LINUX_V4L2_CONTROLS_H
51
52/* Control classes */
53#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
54#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
55#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
56#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
57#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
58#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
59#define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
60#define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
61#define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */
62
63/* User-class control IDs */
64
65#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
66#define V4L2_CID_USER_BASE V4L2_CID_BASE
67#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
68#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
69#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
70#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
71#define V4L2_CID_HUE (V4L2_CID_BASE+3)
72#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
73#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
74#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
75#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
76#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
77#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
78#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
79#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
80#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
81#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
82#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
83#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
84#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
85#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
86#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
87#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
88#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
89#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
90
91/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
92#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
93#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
94
95#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
96enum v4l2_power_line_frequency {
97 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
98 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
99 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
100 V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
101};
102#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
103#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
104#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
105#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
106#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
107#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
108#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
109enum v4l2_colorfx {
110 V4L2_COLORFX_NONE = 0,
111 V4L2_COLORFX_BW = 1,
112 V4L2_COLORFX_SEPIA = 2,
113 V4L2_COLORFX_NEGATIVE = 3,
114 V4L2_COLORFX_EMBOSS = 4,
115 V4L2_COLORFX_SKETCH = 5,
116 V4L2_COLORFX_SKY_BLUE = 6,
117 V4L2_COLORFX_GRASS_GREEN = 7,
118 V4L2_COLORFX_SKIN_WHITEN = 8,
119 V4L2_COLORFX_VIVID = 9,
120 V4L2_COLORFX_AQUA = 10,
121 V4L2_COLORFX_ART_FREEZE = 11,
122 V4L2_COLORFX_SILHOUETTE = 12,
123 V4L2_COLORFX_SOLARIZATION = 13,
124 V4L2_COLORFX_ANTIQUE = 14,
125 V4L2_COLORFX_SET_CBCR = 15,
126};
127#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
128#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
129
130#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
131#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
132
133#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
134
135#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
136#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
137
138#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
139#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
140
141#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
142#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
143
144/* last CID + 1 */
145#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
146
147
148/* MPEG-class control IDs */
149
150#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
151#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
152
153/* MPEG streams, specific to multiplexed streams */
154#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
155enum v4l2_mpeg_stream_type {
156 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
157 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
158 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
159 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
160 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
161 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
162};
163#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
164#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
165#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
166#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
167#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
168#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
169#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
170enum v4l2_mpeg_stream_vbi_fmt {
171 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
172 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
173};
174
175/* MPEG audio controls specific to multiplexed streams */
176#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
177enum v4l2_mpeg_audio_sampling_freq {
178 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
179 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
180 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
181};
182#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
183enum v4l2_mpeg_audio_encoding {
184 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
185 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
186 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
187 V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
188 V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
189};
190#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
191enum v4l2_mpeg_audio_l1_bitrate {
192 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
193 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
194 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
195 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
196 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
197 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
198 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
199 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
200 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
201 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
202 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
203 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
204 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
205 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
206};
207#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
208enum v4l2_mpeg_audio_l2_bitrate {
209 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
210 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
211 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
212 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
213 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
214 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
215 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
216 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
217 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
218 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
219 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
220 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
221 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
222 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
223};
224#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
225enum v4l2_mpeg_audio_l3_bitrate {
226 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
227 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
228 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
229 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
230 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
231 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
232 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
233 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
234 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
235 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
236 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
237 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
238 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
239 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
240};
241#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
242enum v4l2_mpeg_audio_mode {
243 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
244 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
245 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
246 V4L2_MPEG_AUDIO_MODE_MONO = 3,
247};
248#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
249enum v4l2_mpeg_audio_mode_extension {
250 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
251 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
252 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
253 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
254};
255#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
256enum v4l2_mpeg_audio_emphasis {
257 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
258 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
259 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
260};
261#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
262enum v4l2_mpeg_audio_crc {
263 V4L2_MPEG_AUDIO_CRC_NONE = 0,
264 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
265};
266#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
267#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
268#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
269enum v4l2_mpeg_audio_ac3_bitrate {
270 V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
271 V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
272 V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
273 V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
274 V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
275 V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
276 V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
277 V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
278 V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
279 V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
280 V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
281 V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
282 V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
283 V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
284 V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
285 V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
286 V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
287 V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
288 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
289};
290#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
291enum v4l2_mpeg_audio_dec_playback {
292 V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
293 V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
294 V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
295 V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
296 V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
297 V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
298};
299#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
300
301/* MPEG video controls specific to multiplexed streams */
302#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
303enum v4l2_mpeg_video_encoding {
304 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
305 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
306 V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
307};
308#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
309enum v4l2_mpeg_video_aspect {
310 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
311 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
312 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
313 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
314};
315#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
316#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
317#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
318#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
319#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
320enum v4l2_mpeg_video_bitrate_mode {
321 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
322 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
323};
324#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
325#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
326#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
327#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
328#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
329#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
330#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
331#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
332#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
333#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
334enum v4l2_mpeg_video_header_mode {
335 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
336 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
337
338};
339#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
340#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
341#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
342#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
343#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
344enum v4l2_mpeg_video_multi_slice_mode {
345 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
346 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
347 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
348};
349#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
350#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
351#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
352#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
353
354#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
355#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
356#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
357#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
358#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
359#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
360#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
361#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
362#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
363#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
364#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
365#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
366#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
367enum v4l2_mpeg_video_h264_entropy_mode {
368 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
369 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
370};
371#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
372#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
373enum v4l2_mpeg_video_h264_level {
374 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
375 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
376 V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
377 V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
378 V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
379 V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
380 V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
381 V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
382 V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
383 V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
384 V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
385 V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
386 V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
387 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
388 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
389 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
390};
391#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
392#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
393#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
394enum v4l2_mpeg_video_h264_loop_filter_mode {
395 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
396 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
397 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
398};
399#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
400enum v4l2_mpeg_video_h264_profile {
401 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
402 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
403 V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
404 V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
405 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
406 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
407 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
408 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
409 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
410 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
411 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
412 V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
413 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
414 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
415 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
416 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
417 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
418};
419#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
420#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
421#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
422#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
423enum v4l2_mpeg_video_h264_vui_sar_idc {
424 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
425 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
426 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
427 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
428 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
429 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
430 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
431 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
432 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
433 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
434 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
435 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
436 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
437 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
438 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
439 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
441 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
442};
443#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
444#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
445#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
446enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
447 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD = 0,
448 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
449 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
450 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
451 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
452 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
453};
454#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
455#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
456enum v4l2_mpeg_video_h264_fmo_map_type {
457 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
458 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
459 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
460 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
461 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
462 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
463 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
464};
465#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
466#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
467enum v4l2_mpeg_video_h264_fmo_change_dir {
468 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
469 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
470};
471#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
472#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
473#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
474#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
475#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
476#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
477enum v4l2_mpeg_video_h264_hierarchical_coding_type {
478 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
479 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
480};
481#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
482#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
483#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
484#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
485#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
486#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
487#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
488#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
489enum v4l2_mpeg_video_mpeg4_level {
490 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
491 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
492 V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
493 V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
494 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
495 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
496 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
497 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
498};
499#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
500enum v4l2_mpeg_video_mpeg4_profile {
501 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
502 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
503 V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
504 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
505 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
506};
507#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
508
509/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
510#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
511#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
512enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
513 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
514 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
515};
516#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
517#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
518enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
519 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
520 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
521 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
522 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
523 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
524};
525#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
526enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
527 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
528 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
529};
530#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
531enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
532 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
533 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
534};
535#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
536#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
537enum v4l2_mpeg_cx2341x_video_median_filter_type {
538 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
539 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
540 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
541 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
542 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
543};
544#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
545#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
546#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
547#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
548#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
549
550/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
551#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
552
553#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
554#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
555#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
556enum v4l2_mpeg_mfc51_video_frame_skip_mode {
557 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
558 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
559 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
560};
561#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
562enum v4l2_mpeg_mfc51_video_force_frame_type {
563 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
564 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
565 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
566};
567#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
568#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
569#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
570#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
571#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
572#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
573#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
574#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
575#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
576
577
578/* Camera class control IDs */
579
580#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
581#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
582
583#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
584enum v4l2_exposure_auto_type {
585 V4L2_EXPOSURE_AUTO = 0,
586 V4L2_EXPOSURE_MANUAL = 1,
587 V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
588 V4L2_EXPOSURE_APERTURE_PRIORITY = 3
589};
590#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
591#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
592
593#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
594#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
595#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
596#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
597
598#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
599#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
600
601#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
602#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
603#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
604
605#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
606#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
607#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
608
609#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
610
611#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
612#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
613
614#define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
615
616#define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
617enum v4l2_auto_n_preset_white_balance {
618 V4L2_WHITE_BALANCE_MANUAL = 0,
619 V4L2_WHITE_BALANCE_AUTO = 1,
620 V4L2_WHITE_BALANCE_INCANDESCENT = 2,
621 V4L2_WHITE_BALANCE_FLUORESCENT = 3,
622 V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
623 V4L2_WHITE_BALANCE_HORIZON = 5,
624 V4L2_WHITE_BALANCE_DAYLIGHT = 6,
625 V4L2_WHITE_BALANCE_FLASH = 7,
626 V4L2_WHITE_BALANCE_CLOUDY = 8,
627 V4L2_WHITE_BALANCE_SHADE = 9,
628};
629
630#define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
631#define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
632
633#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
634#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
635enum v4l2_iso_sensitivity_auto_type {
636 V4L2_ISO_SENSITIVITY_MANUAL = 0,
637 V4L2_ISO_SENSITIVITY_AUTO = 1,
638};
639
640#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
641enum v4l2_exposure_metering {
642 V4L2_EXPOSURE_METERING_AVERAGE = 0,
643 V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
644 V4L2_EXPOSURE_METERING_SPOT = 2,
645};
646
647#define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
648enum v4l2_scene_mode {
649 V4L2_SCENE_MODE_NONE = 0,
650 V4L2_SCENE_MODE_BACKLIGHT = 1,
651 V4L2_SCENE_MODE_BEACH_SNOW = 2,
652 V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
653 V4L2_SCENE_MODE_DAWN_DUSK = 4,
654 V4L2_SCENE_MODE_FALL_COLORS = 5,
655 V4L2_SCENE_MODE_FIREWORKS = 6,
656 V4L2_SCENE_MODE_LANDSCAPE = 7,
657 V4L2_SCENE_MODE_NIGHT = 8,
658 V4L2_SCENE_MODE_PARTY_INDOOR = 9,
659 V4L2_SCENE_MODE_PORTRAIT = 10,
660 V4L2_SCENE_MODE_SPORTS = 11,
661 V4L2_SCENE_MODE_SUNSET = 12,
662 V4L2_SCENE_MODE_TEXT = 13,
663};
664
665#define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
666#define V4L2_LOCK_EXPOSURE (1 << 0)
667#define V4L2_LOCK_WHITE_BALANCE (1 << 1)
668#define V4L2_LOCK_FOCUS (1 << 2)
669
670#define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
671#define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
672#define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
673#define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
674#define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
675#define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
676#define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
677
678#define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
679enum v4l2_auto_focus_range {
680 V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
681 V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
682 V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
683 V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
684};
685
686
687/* FM Modulator class control IDs */
688
689#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
690#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
691
692#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
693#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
694#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
695#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
696#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
697
698#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
699#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
700#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
701
702#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
703#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
704#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
705#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
706#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
707
708#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
709#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
710#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
711
712#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
713enum v4l2_preemphasis {
714 V4L2_PREEMPHASIS_DISABLED = 0,
715 V4L2_PREEMPHASIS_50_uS = 1,
716 V4L2_PREEMPHASIS_75_uS = 2,
717};
718#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
719#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
720
721
722/* Flash and privacy (indicator) light controls */
723
724#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
725#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
726
727#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
728enum v4l2_flash_led_mode {
729 V4L2_FLASH_LED_MODE_NONE,
730 V4L2_FLASH_LED_MODE_FLASH,
731 V4L2_FLASH_LED_MODE_TORCH,
732};
733
734#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
735enum v4l2_flash_strobe_source {
736 V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
737 V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
738};
739
740#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
741#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
742#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
743
744#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
745#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
746#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
747#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
748
749#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
750#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
751#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
752#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
753#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
754#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
755#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
756
757#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
758#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
759
760
761/* JPEG-class control IDs */
762
763#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
764#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
765
766#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
767enum v4l2_jpeg_chroma_subsampling {
768 V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
769 V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
770 V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
771 V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
772 V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
773 V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
774};
775#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
776#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
777
778#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
779#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
780#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
781#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
782#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
783#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
784
785/* Image source controls */
786#define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
787#define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
788
789#define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
790#define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
791#define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
792
793
794/* Image processing controls */
795
796#define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
797#define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
798
799#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
800#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
801#define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
802
803#endif
diff --git a/include/linux/v4l2-dv-timings.h b/include/linux/v4l2-dv-timings.h
deleted file mode 100644
index 9ef8172e5ed0..000000000000
--- a/include/linux/v4l2-dv-timings.h
+++ /dev/null
@@ -1,816 +0,0 @@
1/*
2 * V4L2 DV timings header.
3 *
4 * Copyright (C) 2012 Hans Verkuil <hans.verkuil@cisco.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 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20
21#ifndef _V4L2_DV_TIMINGS_H
22#define _V4L2_DV_TIMINGS_H
23
24#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
25/* Sadly gcc versions older than 4.6 have a bug in how they initialize
26 anonymous unions where they require additional curly brackets.
27 This violates the C1x standard. This workaround adds the curly brackets
28 if needed. */
29#define V4L2_INIT_BT_TIMINGS(_width, args...) \
30 { .bt = { _width , ## args } }
31#else
32#define V4L2_INIT_BT_TIMINGS(_width, args...) \
33 .bt = { _width , ## args }
34#endif
35
36/* CEA-861-E timings (i.e. standard HDTV timings) */
37
38#define V4L2_DV_BT_CEA_640X480P59_94 { \
39 .type = V4L2_DV_BT_656_1120, \
40 V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, \
41 25175000, 16, 96, 48, 10, 2, 33, 0, 0, 0, \
42 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CEA861, 0) \
43}
44
45#define V4L2_DV_BT_CEA_720X480P59_94 { \
46 .type = V4L2_DV_BT_656_1120, \
47 V4L2_INIT_BT_TIMINGS(720, 480, 0, 0, \
48 27000000, 16, 62, 60, 9, 6, 30, 0, 0, 0, \
49 V4L2_DV_BT_STD_CEA861, 0) \
50}
51
52#define V4L2_DV_BT_CEA_720X576P50 { \
53 .type = V4L2_DV_BT_656_1120, \
54 V4L2_INIT_BT_TIMINGS(720, 576, 0, 0, \
55 27000000, 12, 64, 68, 5, 5, 39, 0, 0, 0, \
56 V4L2_DV_BT_STD_CEA861, 0) \
57}
58
59#define V4L2_DV_BT_CEA_1280X720P24 { \
60 .type = V4L2_DV_BT_656_1120, \
61 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
62 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
63 59400000, 1760, 40, 220, 5, 5, 20, 0, 0, 0, \
64 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CEA861, \
65 V4L2_DV_FL_CAN_REDUCE_FPS) \
66}
67
68#define V4L2_DV_BT_CEA_1280X720P25 { \
69 .type = V4L2_DV_BT_656_1120, \
70 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
71 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
72 74250000, 2420, 40, 220, 5, 5, 20, 0, 0, 0, \
73 V4L2_DV_BT_STD_CEA861, 0) \
74}
75
76#define V4L2_DV_BT_CEA_1280X720P30 { \
77 .type = V4L2_DV_BT_656_1120, \
78 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
79 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
80 74250000, 1760, 40, 220, 5, 5, 20, 0, 0, 0, \
81 V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
82}
83
84#define V4L2_DV_BT_CEA_1280X720P50 { \
85 .type = V4L2_DV_BT_656_1120, \
86 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
87 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
88 74250000, 440, 40, 220, 5, 5, 20, 0, 0, 0, \
89 V4L2_DV_BT_STD_CEA861, 0) \
90}
91
92#define V4L2_DV_BT_CEA_1280X720P60 { \
93 .type = V4L2_DV_BT_656_1120, \
94 V4L2_INIT_BT_TIMINGS(1280, 720, 0, \
95 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
96 74250000, 110, 40, 220, 5, 5, 20, 0, 0, 0, \
97 V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
98}
99
100#define V4L2_DV_BT_CEA_1920X1080P24 { \
101 .type = V4L2_DV_BT_656_1120, \
102 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
103 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
104 74250000, 638, 44, 148, 4, 5, 36, 0, 0, 0, \
105 V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
106}
107
108#define V4L2_DV_BT_CEA_1920X1080P25 { \
109 .type = V4L2_DV_BT_656_1120, \
110 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
111 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
112 74250000, 528, 44, 148, 4, 5, 36, 0, 0, 0, \
113 V4L2_DV_BT_STD_CEA861, 0) \
114}
115
116#define V4L2_DV_BT_CEA_1920X1080P30 { \
117 .type = V4L2_DV_BT_656_1120, \
118 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
119 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
120 74250000, 88, 44, 148, 4, 5, 36, 0, 0, 0, \
121 V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_CAN_REDUCE_FPS) \
122}
123
124#define V4L2_DV_BT_CEA_1920X1080I50 { \
125 .type = V4L2_DV_BT_656_1120, \
126 V4L2_INIT_BT_TIMINGS(1920, 1080, 1, \
127 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
128 74250000, 528, 44, 148, 2, 5, 15, 2, 5, 16, \
129 V4L2_DV_BT_STD_CEA861, V4L2_DV_FL_HALF_LINE) \
130}
131
132#define V4L2_DV_BT_CEA_1920X1080P50 { \
133 .type = V4L2_DV_BT_656_1120, \
134 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
135 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
136 148500000, 528, 44, 148, 4, 5, 36, 0, 0, 0, \
137 V4L2_DV_BT_STD_CEA861, 0) \
138}
139
140#define V4L2_DV_BT_CEA_1920X1080I60 { \
141 .type = V4L2_DV_BT_656_1120, \
142 V4L2_INIT_BT_TIMINGS(1920, 1080, 1, \
143 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
144 74250000, 88, 44, 148, 2, 5, 15, 2, 5, 16, \
145 V4L2_DV_BT_STD_CEA861, \
146 V4L2_DV_FL_CAN_REDUCE_FPS | V4L2_DV_FL_HALF_LINE) \
147}
148
149#define V4L2_DV_BT_CEA_1920X1080P60 { \
150 .type = V4L2_DV_BT_656_1120, \
151 V4L2_INIT_BT_TIMINGS(1920, 1080, 0, \
152 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
153 148500000, 88, 44, 148, 4, 5, 36, 0, 0, 0, \
154 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CEA861, \
155 V4L2_DV_FL_CAN_REDUCE_FPS) \
156}
157
158
159/* VESA Discrete Monitor Timings as per version 1.0, revision 12 */
160
161#define V4L2_DV_BT_DMT_640X350P85 { \
162 .type = V4L2_DV_BT_656_1120, \
163 V4L2_INIT_BT_TIMINGS(640, 350, 0, V4L2_DV_HSYNC_POS_POL, \
164 31500000, 32, 64, 96, 32, 3, 60, 0, 0, 0, \
165 V4L2_DV_BT_STD_DMT, 0) \
166}
167
168#define V4L2_DV_BT_DMT_640X400P85 { \
169 .type = V4L2_DV_BT_656_1120, \
170 V4L2_INIT_BT_TIMINGS(640, 400, 0, V4L2_DV_VSYNC_POS_POL, \
171 31500000, 32, 64, 96, 1, 3, 41, 0, 0, 0, \
172 V4L2_DV_BT_STD_DMT, 0) \
173}
174
175#define V4L2_DV_BT_DMT_720X400P85 { \
176 .type = V4L2_DV_BT_656_1120, \
177 V4L2_INIT_BT_TIMINGS(720, 400, 0, V4L2_DV_VSYNC_POS_POL, \
178 35500000, 36, 72, 108, 1, 3, 42, 0, 0, 0, \
179 V4L2_DV_BT_STD_DMT, 0) \
180}
181
182/* VGA resolutions */
183#define V4L2_DV_BT_DMT_640X480P60 V4L2_DV_BT_CEA_640X480P59_94
184
185#define V4L2_DV_BT_DMT_640X480P72 { \
186 .type = V4L2_DV_BT_656_1120, \
187 V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, \
188 31500000, 24, 40, 128, 9, 3, 28, 0, 0, 0, \
189 V4L2_DV_BT_STD_DMT, 0) \
190}
191
192#define V4L2_DV_BT_DMT_640X480P75 { \
193 .type = V4L2_DV_BT_656_1120, \
194 V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, \
195 31500000, 16, 64, 120, 1, 3, 16, 0, 0, 0, \
196 V4L2_DV_BT_STD_DMT, 0) \
197}
198
199#define V4L2_DV_BT_DMT_640X480P85 { \
200 .type = V4L2_DV_BT_656_1120, \
201 V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, \
202 36000000, 56, 56, 80, 1, 3, 25, 0, 0, 0, \
203 V4L2_DV_BT_STD_DMT, 0) \
204}
205
206/* SVGA resolutions */
207#define V4L2_DV_BT_DMT_800X600P56 { \
208 .type = V4L2_DV_BT_656_1120, \
209 V4L2_INIT_BT_TIMINGS(800, 600, 0, \
210 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
211 36000000, 24, 72, 128, 1, 2, 22, 0, 0, 0, \
212 V4L2_DV_BT_STD_DMT, 0) \
213}
214
215#define V4L2_DV_BT_DMT_800X600P60 { \
216 .type = V4L2_DV_BT_656_1120, \
217 V4L2_INIT_BT_TIMINGS(800, 600, 0, \
218 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
219 40000000, 40, 128, 88, 1, 4, 23, 0, 0, 0, \
220 V4L2_DV_BT_STD_DMT, 0) \
221}
222
223#define V4L2_DV_BT_DMT_800X600P72 { \
224 .type = V4L2_DV_BT_656_1120, \
225 V4L2_INIT_BT_TIMINGS(800, 600, 0, \
226 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
227 50000000, 56, 120, 64, 37, 6, 23, 0, 0, 0, \
228 V4L2_DV_BT_STD_DMT, 0) \
229}
230
231#define V4L2_DV_BT_DMT_800X600P75 { \
232 .type = V4L2_DV_BT_656_1120, \
233 V4L2_INIT_BT_TIMINGS(800, 600, 0, \
234 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
235 49500000, 16, 80, 160, 1, 3, 21, 0, 0, 0, \
236 V4L2_DV_BT_STD_DMT, 0) \
237}
238
239#define V4L2_DV_BT_DMT_800X600P85 { \
240 .type = V4L2_DV_BT_656_1120, \
241 V4L2_INIT_BT_TIMINGS(800, 600, 0, \
242 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
243 56250000, 32, 64, 152, 1, 3, 27, 0, 0, 0, \
244 V4L2_DV_BT_STD_DMT, 0) \
245}
246
247#define V4L2_DV_BT_DMT_800X600P120_RB { \
248 .type = V4L2_DV_BT_656_1120, \
249 V4L2_INIT_BT_TIMINGS(800, 600, 0, V4L2_DV_HSYNC_POS_POL, \
250 73250000, 48, 32, 80, 3, 4, 29, 0, 0, 0, \
251 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
252 V4L2_DV_FL_REDUCED_BLANKING) \
253}
254
255#define V4L2_DV_BT_DMT_848X480P60 { \
256 .type = V4L2_DV_BT_656_1120, \
257 V4L2_INIT_BT_TIMINGS(848, 480, 0, \
258 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
259 33750000, 16, 112, 112, 6, 8, 23, 0, 0, 0, \
260 V4L2_DV_BT_STD_DMT, 0) \
261}
262
263#define V4L2_DV_BT_DMT_1024X768I43 { \
264 .type = V4L2_DV_BT_656_1120, \
265 V4L2_INIT_BT_TIMINGS(1024, 768, 1, \
266 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
267 44900000, 8, 176, 56, 0, 4, 20, 0, 4, 21, \
268 V4L2_DV_BT_STD_DMT, 0) \
269}
270
271/* XGA resolutions */
272#define V4L2_DV_BT_DMT_1024X768P60 { \
273 .type = V4L2_DV_BT_656_1120, \
274 V4L2_INIT_BT_TIMINGS(1024, 768, 0, 0, \
275 65000000, 24, 136, 160, 3, 6, 29, 0, 0, 0, \
276 V4L2_DV_BT_STD_DMT, 0) \
277}
278
279#define V4L2_DV_BT_DMT_1024X768P70 { \
280 .type = V4L2_DV_BT_656_1120, \
281 V4L2_INIT_BT_TIMINGS(1024, 768, 0, 0, \
282 75000000, 24, 136, 144, 3, 6, 29, 0, 0, 0, \
283 V4L2_DV_BT_STD_DMT, 0) \
284}
285
286#define V4L2_DV_BT_DMT_1024X768P75 { \
287 .type = V4L2_DV_BT_656_1120, \
288 V4L2_INIT_BT_TIMINGS(1024, 768, 0, \
289 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
290 78750000, 16, 96, 176, 1, 3, 28, 0, 0, 0, \
291 V4L2_DV_BT_STD_DMT, 0) \
292}
293
294#define V4L2_DV_BT_DMT_1024X768P85 { \
295 .type = V4L2_DV_BT_656_1120, \
296 V4L2_INIT_BT_TIMINGS(1024, 768, 0, \
297 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
298 94500000, 48, 96, 208, 1, 3, 36, 0, 0, 0, \
299 V4L2_DV_BT_STD_DMT, 0) \
300}
301
302#define V4L2_DV_BT_DMT_1024X768P120_RB { \
303 .type = V4L2_DV_BT_656_1120, \
304 V4L2_INIT_BT_TIMINGS(1024, 768, 0, V4L2_DV_HSYNC_POS_POL, \
305 115500000, 48, 32, 80, 3, 4, 38, 0, 0, 0, \
306 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
307 V4L2_DV_FL_REDUCED_BLANKING) \
308}
309
310/* XGA+ resolution */
311#define V4L2_DV_BT_DMT_1152X864P75 { \
312 .type = V4L2_DV_BT_656_1120, \
313 V4L2_INIT_BT_TIMINGS(1152, 864, 0, \
314 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
315 108000000, 64, 128, 256, 1, 3, 32, 0, 0, 0, \
316 V4L2_DV_BT_STD_DMT, 0) \
317}
318
319#define V4L2_DV_BT_DMT_1280X720P60 V4L2_DV_BT_CEA_1280X720P60
320
321/* WXGA resolutions */
322#define V4L2_DV_BT_DMT_1280X768P60_RB { \
323 .type = V4L2_DV_BT_656_1120, \
324 V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_HSYNC_POS_POL, \
325 68250000, 48, 32, 80, 3, 7, 12, 0, 0, 0, \
326 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
327 V4L2_DV_FL_REDUCED_BLANKING) \
328}
329
330#define V4L2_DV_BT_DMT_1280X768P60 { \
331 .type = V4L2_DV_BT_656_1120, \
332 V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, \
333 79500000, 64, 128, 192, 3, 7, 20, 0, 0, 0, \
334 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
335}
336
337#define V4L2_DV_BT_DMT_1280X768P75 { \
338 .type = V4L2_DV_BT_656_1120, \
339 V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, \
340 102250000, 80, 128, 208, 3, 7, 27, 0, 0, 0, \
341 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
342}
343
344#define V4L2_DV_BT_DMT_1280X768P85 { \
345 .type = V4L2_DV_BT_656_1120, \
346 V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_VSYNC_POS_POL, \
347 117500000, 80, 136, 216, 3, 7, 31, 0, 0, 0, \
348 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
349}
350
351#define V4L2_DV_BT_DMT_1280X768P120_RB { \
352 .type = V4L2_DV_BT_656_1120, \
353 V4L2_INIT_BT_TIMINGS(1280, 768, 0, V4L2_DV_HSYNC_POS_POL, \
354 140250000, 48, 32, 80, 3, 7, 35, 0, 0, 0, \
355 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
356 V4L2_DV_FL_REDUCED_BLANKING) \
357}
358
359#define V4L2_DV_BT_DMT_1280X800P60_RB { \
360 .type = V4L2_DV_BT_656_1120, \
361 V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_HSYNC_POS_POL, \
362 71000000, 48, 32, 80, 3, 6, 14, 0, 0, 0, \
363 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
364 V4L2_DV_FL_REDUCED_BLANKING) \
365}
366
367#define V4L2_DV_BT_DMT_1280X800P60 { \
368 .type = V4L2_DV_BT_656_1120, \
369 V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, \
370 83500000, 72, 128, 200, 3, 6, 22, 0, 0, 0, \
371 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
372}
373
374#define V4L2_DV_BT_DMT_1280X800P75 { \
375 .type = V4L2_DV_BT_656_1120, \
376 V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, \
377 106500000, 80, 128, 208, 3, 6, 29, 0, 0, 0, \
378 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
379}
380
381#define V4L2_DV_BT_DMT_1280X800P85 { \
382 .type = V4L2_DV_BT_656_1120, \
383 V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_VSYNC_POS_POL, \
384 122500000, 80, 136, 216, 3, 6, 34, 0, 0, 0, \
385 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
386}
387
388#define V4L2_DV_BT_DMT_1280X800P120_RB { \
389 .type = V4L2_DV_BT_656_1120, \
390 V4L2_INIT_BT_TIMINGS(1280, 800, 0, V4L2_DV_HSYNC_POS_POL, \
391 146250000, 48, 32, 80, 3, 6, 38, 0, 0, 0, \
392 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
393 V4L2_DV_FL_REDUCED_BLANKING) \
394}
395
396#define V4L2_DV_BT_DMT_1280X960P60 { \
397 .type = V4L2_DV_BT_656_1120, \
398 V4L2_INIT_BT_TIMINGS(1280, 960, 0, \
399 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
400 108000000, 96, 112, 312, 1, 3, 36, 0, 0, 0, \
401 V4L2_DV_BT_STD_DMT, 0) \
402}
403
404#define V4L2_DV_BT_DMT_1280X960P85 { \
405 .type = V4L2_DV_BT_656_1120, \
406 V4L2_INIT_BT_TIMINGS(1280, 960, 0, \
407 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
408 148500000, 64, 160, 224, 1, 3, 47, 0, 0, 0, \
409 V4L2_DV_BT_STD_DMT, 0) \
410}
411
412#define V4L2_DV_BT_DMT_1280X960P120_RB { \
413 .type = V4L2_DV_BT_656_1120, \
414 V4L2_INIT_BT_TIMINGS(1280, 960, 0, V4L2_DV_HSYNC_POS_POL, \
415 175500000, 48, 32, 80, 3, 4, 50, 0, 0, 0, \
416 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
417 V4L2_DV_FL_REDUCED_BLANKING) \
418}
419
420/* SXGA resolutions */
421#define V4L2_DV_BT_DMT_1280X1024P60 { \
422 .type = V4L2_DV_BT_656_1120, \
423 V4L2_INIT_BT_TIMINGS(1280, 1024, 0, \
424 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
425 108000000, 48, 112, 248, 1, 3, 38, 0, 0, 0, \
426 V4L2_DV_BT_STD_DMT, 0) \
427}
428
429#define V4L2_DV_BT_DMT_1280X1024P75 { \
430 .type = V4L2_DV_BT_656_1120, \
431 V4L2_INIT_BT_TIMINGS(1280, 1024, 0, \
432 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
433 135000000, 16, 144, 248, 1, 3, 38, 0, 0, 0, \
434 V4L2_DV_BT_STD_DMT, 0) \
435}
436
437#define V4L2_DV_BT_DMT_1280X1024P85 { \
438 .type = V4L2_DV_BT_656_1120, \
439 V4L2_INIT_BT_TIMINGS(1280, 1024, 0, \
440 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
441 157500000, 64, 160, 224, 1, 3, 44, 0, 0, 0, \
442 V4L2_DV_BT_STD_DMT, 0) \
443}
444
445#define V4L2_DV_BT_DMT_1280X1024P120_RB { \
446 .type = V4L2_DV_BT_656_1120, \
447 V4L2_INIT_BT_TIMINGS(1280, 1024, 0, V4L2_DV_HSYNC_POS_POL, \
448 187250000, 48, 32, 80, 3, 7, 50, 0, 0, 0, \
449 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
450 V4L2_DV_FL_REDUCED_BLANKING) \
451}
452
453#define V4L2_DV_BT_DMT_1360X768P60 { \
454 .type = V4L2_DV_BT_656_1120, \
455 V4L2_INIT_BT_TIMINGS(1360, 768, 0, \
456 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
457 85500000, 64, 112, 256, 3, 6, 18, 0, 0, 0, \
458 V4L2_DV_BT_STD_DMT, 0) \
459}
460
461#define V4L2_DV_BT_DMT_1360X768P120_RB { \
462 .type = V4L2_DV_BT_656_1120, \
463 V4L2_INIT_BT_TIMINGS(1360, 768, 0, V4L2_DV_HSYNC_POS_POL, \
464 148250000, 48, 32, 80, 3, 5, 37, 0, 0, 0, \
465 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
466 V4L2_DV_FL_REDUCED_BLANKING) \
467}
468
469#define V4L2_DV_BT_DMT_1366X768P60 { \
470 .type = V4L2_DV_BT_656_1120, \
471 V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
472 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
473 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
474 V4L2_DV_BT_STD_DMT, 0) \
475}
476
477#define V4L2_DV_BT_DMT_1366X768P60_RB { \
478 .type = V4L2_DV_BT_656_1120, \
479 V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
480 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
481 72000000, 14, 56, 64, 1, 3, 28, 0, 0, 0, \
482 V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) \
483}
484
485/* SXGA+ resolutions */
486#define V4L2_DV_BT_DMT_1400X1050P60_RB { \
487 .type = V4L2_DV_BT_656_1120, \
488 V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_HSYNC_POS_POL, \
489 101000000, 48, 32, 80, 3, 4, 23, 0, 0, 0, \
490 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
491 V4L2_DV_FL_REDUCED_BLANKING) \
492}
493
494#define V4L2_DV_BT_DMT_1400X1050P60 { \
495 .type = V4L2_DV_BT_656_1120, \
496 V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
497 121750000, 88, 144, 232, 3, 4, 32, 0, 0, 0, \
498 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
499}
500
501#define V4L2_DV_BT_DMT_1400X1050P75 { \
502 .type = V4L2_DV_BT_656_1120, \
503 V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
504 156000000, 104, 144, 248, 3, 4, 42, 0, 0, 0, \
505 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
506}
507
508#define V4L2_DV_BT_DMT_1400X1050P85 { \
509 .type = V4L2_DV_BT_656_1120, \
510 V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
511 179500000, 104, 152, 256, 3, 4, 48, 0, 0, 0, \
512 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
513}
514
515#define V4L2_DV_BT_DMT_1400X1050P120_RB { \
516 .type = V4L2_DV_BT_656_1120, \
517 V4L2_INIT_BT_TIMINGS(1400, 1050, 0, V4L2_DV_HSYNC_POS_POL, \
518 208000000, 48, 32, 80, 3, 4, 55, 0, 0, 0, \
519 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
520 V4L2_DV_FL_REDUCED_BLANKING) \
521}
522
523/* WXGA+ resolutions */
524#define V4L2_DV_BT_DMT_1440X900P60_RB { \
525 .type = V4L2_DV_BT_656_1120, \
526 V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_HSYNC_POS_POL, \
527 88750000, 48, 32, 80, 3, 6, 17, 0, 0, 0, \
528 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
529 V4L2_DV_FL_REDUCED_BLANKING) \
530}
531
532#define V4L2_DV_BT_DMT_1440X900P60 { \
533 .type = V4L2_DV_BT_656_1120, \
534 V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, \
535 106500000, 80, 152, 232, 3, 6, 25, 0, 0, 0, \
536 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
537}
538
539#define V4L2_DV_BT_DMT_1440X900P75 { \
540 .type = V4L2_DV_BT_656_1120, \
541 V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, \
542 136750000, 96, 152, 248, 3, 6, 33, 0, 0, 0, \
543 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
544}
545
546#define V4L2_DV_BT_DMT_1440X900P85 { \
547 .type = V4L2_DV_BT_656_1120, \
548 V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_VSYNC_POS_POL, \
549 157000000, 104, 152, 256, 3, 6, 39, 0, 0, 0, \
550 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
551}
552
553#define V4L2_DV_BT_DMT_1440X900P120_RB { \
554 .type = V4L2_DV_BT_656_1120, \
555 V4L2_INIT_BT_TIMINGS(1440, 900, 0, V4L2_DV_HSYNC_POS_POL, \
556 182750000, 48, 32, 80, 3, 6, 44, 0, 0, 0, \
557 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
558 V4L2_DV_FL_REDUCED_BLANKING) \
559}
560
561#define V4L2_DV_BT_DMT_1600X900P60_RB { \
562 .type = V4L2_DV_BT_656_1120, \
563 V4L2_INIT_BT_TIMINGS(1600, 900, 0, \
564 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
565 108000000, 24, 80, 96, 1, 3, 96, 0, 0, 0, \
566 V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) \
567}
568
569/* UXGA resolutions */
570#define V4L2_DV_BT_DMT_1600X1200P60 { \
571 .type = V4L2_DV_BT_656_1120, \
572 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, \
573 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
574 162000000, 64, 192, 304, 1, 3, 46, 0, 0, 0, \
575 V4L2_DV_BT_STD_DMT, 0) \
576}
577
578#define V4L2_DV_BT_DMT_1600X1200P65 { \
579 .type = V4L2_DV_BT_656_1120, \
580 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, \
581 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
582 175500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, \
583 V4L2_DV_BT_STD_DMT, 0) \
584}
585
586#define V4L2_DV_BT_DMT_1600X1200P70 { \
587 .type = V4L2_DV_BT_656_1120, \
588 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, \
589 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
590 189000000, 64, 192, 304, 1, 3, 46, 0, 0, 0, \
591 V4L2_DV_BT_STD_DMT, 0) \
592}
593
594#define V4L2_DV_BT_DMT_1600X1200P75 { \
595 .type = V4L2_DV_BT_656_1120, \
596 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, \
597 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
598 202500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, \
599 V4L2_DV_BT_STD_DMT, 0) \
600}
601
602#define V4L2_DV_BT_DMT_1600X1200P85 { \
603 .type = V4L2_DV_BT_656_1120, \
604 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, \
605 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
606 229500000, 64, 192, 304, 1, 3, 46, 0, 0, 0, \
607 V4L2_DV_BT_STD_DMT, 0) \
608}
609
610#define V4L2_DV_BT_DMT_1600X1200P120_RB { \
611 .type = V4L2_DV_BT_656_1120, \
612 V4L2_INIT_BT_TIMINGS(1600, 1200, 0, V4L2_DV_HSYNC_POS_POL, \
613 268250000, 48, 32, 80, 3, 4, 64, 0, 0, 0, \
614 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
615 V4L2_DV_FL_REDUCED_BLANKING) \
616}
617
618/* WSXGA+ resolutions */
619#define V4L2_DV_BT_DMT_1680X1050P60_RB { \
620 .type = V4L2_DV_BT_656_1120, \
621 V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_HSYNC_POS_POL, \
622 119000000, 48, 32, 80, 3, 6, 21, 0, 0, 0, \
623 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
624 V4L2_DV_FL_REDUCED_BLANKING) \
625}
626
627#define V4L2_DV_BT_DMT_1680X1050P60 { \
628 .type = V4L2_DV_BT_656_1120, \
629 V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
630 146250000, 104, 176, 280, 3, 6, 30, 0, 0, 0, \
631 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
632}
633
634#define V4L2_DV_BT_DMT_1680X1050P75 { \
635 .type = V4L2_DV_BT_656_1120, \
636 V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
637 187000000, 120, 176, 296, 3, 6, 40, 0, 0, 0, \
638 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
639}
640
641#define V4L2_DV_BT_DMT_1680X1050P85 { \
642 .type = V4L2_DV_BT_656_1120, \
643 V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_VSYNC_POS_POL, \
644 214750000, 128, 176, 304, 3, 6, 46, 0, 0, 0, \
645 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
646}
647
648#define V4L2_DV_BT_DMT_1680X1050P120_RB { \
649 .type = V4L2_DV_BT_656_1120, \
650 V4L2_INIT_BT_TIMINGS(1680, 1050, 0, V4L2_DV_HSYNC_POS_POL, \
651 245500000, 48, 32, 80, 3, 6, 53, 0, 0, 0, \
652 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
653 V4L2_DV_FL_REDUCED_BLANKING) \
654}
655
656#define V4L2_DV_BT_DMT_1792X1344P60 { \
657 .type = V4L2_DV_BT_656_1120, \
658 V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_VSYNC_POS_POL, \
659 204750000, 128, 200, 328, 1, 3, 46, 0, 0, 0, \
660 V4L2_DV_BT_STD_DMT, 0) \
661}
662
663#define V4L2_DV_BT_DMT_1792X1344P75 { \
664 .type = V4L2_DV_BT_656_1120, \
665 V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_VSYNC_POS_POL, \
666 261000000, 96, 216, 352, 1, 3, 69, 0, 0, 0, \
667 V4L2_DV_BT_STD_DMT, 0) \
668}
669
670#define V4L2_DV_BT_DMT_1792X1344P120_RB { \
671 .type = V4L2_DV_BT_656_1120, \
672 V4L2_INIT_BT_TIMINGS(1792, 1344, 0, V4L2_DV_HSYNC_POS_POL, \
673 333250000, 48, 32, 80, 3, 4, 72, 0, 0, 0, \
674 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
675 V4L2_DV_FL_REDUCED_BLANKING) \
676}
677
678#define V4L2_DV_BT_DMT_1856X1392P60 { \
679 .type = V4L2_DV_BT_656_1120, \
680 V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_VSYNC_POS_POL, \
681 218250000, 96, 224, 352, 1, 3, 43, 0, 0, 0, \
682 V4L2_DV_BT_STD_DMT, 0) \
683}
684
685#define V4L2_DV_BT_DMT_1856X1392P75 { \
686 .type = V4L2_DV_BT_656_1120, \
687 V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_VSYNC_POS_POL, \
688 288000000, 128, 224, 352, 1, 3, 104, 0, 0, 0, \
689 V4L2_DV_BT_STD_DMT, 0) \
690}
691
692#define V4L2_DV_BT_DMT_1856X1392P120_RB { \
693 .type = V4L2_DV_BT_656_1120, \
694 V4L2_INIT_BT_TIMINGS(1856, 1392, 0, V4L2_DV_HSYNC_POS_POL, \
695 356500000, 48, 32, 80, 3, 4, 75, 0, 0, 0, \
696 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
697 V4L2_DV_FL_REDUCED_BLANKING) \
698}
699
700#define V4L2_DV_BT_DMT_1920X1080P60 V4L2_DV_BT_CEA_1920X1080P60
701
702/* WUXGA resolutions */
703#define V4L2_DV_BT_DMT_1920X1200P60_RB { \
704 .type = V4L2_DV_BT_656_1120, \
705 V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_HSYNC_POS_POL, \
706 154000000, 48, 32, 80, 3, 6, 26, 0, 0, 0, \
707 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
708 V4L2_DV_FL_REDUCED_BLANKING) \
709}
710
711#define V4L2_DV_BT_DMT_1920X1200P60 { \
712 .type = V4L2_DV_BT_656_1120, \
713 V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, \
714 193250000, 136, 200, 336, 3, 6, 36, 0, 0, 0, \
715 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
716}
717
718#define V4L2_DV_BT_DMT_1920X1200P75 { \
719 .type = V4L2_DV_BT_656_1120, \
720 V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, \
721 245250000, 136, 208, 344, 3, 6, 46, 0, 0, 0, \
722 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
723}
724
725#define V4L2_DV_BT_DMT_1920X1200P85 { \
726 .type = V4L2_DV_BT_656_1120, \
727 V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_VSYNC_POS_POL, \
728 281250000, 144, 208, 352, 3, 6, 53, 0, 0, 0, \
729 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
730}
731
732#define V4L2_DV_BT_DMT_1920X1200P120_RB { \
733 .type = V4L2_DV_BT_656_1120, \
734 V4L2_INIT_BT_TIMINGS(1920, 1200, 0, V4L2_DV_HSYNC_POS_POL, \
735 317000000, 48, 32, 80, 3, 6, 62, 0, 0, 0, \
736 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
737 V4L2_DV_FL_REDUCED_BLANKING) \
738}
739
740#define V4L2_DV_BT_DMT_1920X1440P60 { \
741 .type = V4L2_DV_BT_656_1120, \
742 V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_VSYNC_POS_POL, \
743 234000000, 128, 208, 344, 1, 3, 56, 0, 0, 0, \
744 V4L2_DV_BT_STD_DMT, 0) \
745}
746
747#define V4L2_DV_BT_DMT_1920X1440P75 { \
748 .type = V4L2_DV_BT_656_1120, \
749 V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_VSYNC_POS_POL, \
750 297000000, 144, 224, 352, 1, 3, 56, 0, 0, 0, \
751 V4L2_DV_BT_STD_DMT, 0) \
752}
753
754#define V4L2_DV_BT_DMT_1920X1440P120_RB { \
755 .type = V4L2_DV_BT_656_1120, \
756 V4L2_INIT_BT_TIMINGS(1920, 1440, 0, V4L2_DV_HSYNC_POS_POL, \
757 380500000, 48, 32, 80, 3, 4, 78, 0, 0, 0, \
758 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
759 V4L2_DV_FL_REDUCED_BLANKING) \
760}
761
762#define V4L2_DV_BT_DMT_2048X1152P60_RB { \
763 .type = V4L2_DV_BT_656_1120, \
764 V4L2_INIT_BT_TIMINGS(2048, 1152, 0, \
765 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
766 162000000, 26, 80, 96, 1, 3, 44, 0, 0, 0, \
767 V4L2_DV_BT_STD_DMT, V4L2_DV_FL_REDUCED_BLANKING) \
768}
769
770/* WQXGA resolutions */
771#define V4L2_DV_BT_DMT_2560X1600P60_RB { \
772 .type = V4L2_DV_BT_656_1120, \
773 V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_HSYNC_POS_POL, \
774 268500000, 48, 32, 80, 3, 6, 37, 0, 0, 0, \
775 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
776 V4L2_DV_FL_REDUCED_BLANKING) \
777}
778
779#define V4L2_DV_BT_DMT_2560X1600P60 { \
780 .type = V4L2_DV_BT_656_1120, \
781 V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, \
782 348500000, 192, 280, 472, 3, 6, 49, 0, 0, 0, \
783 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
784}
785
786#define V4L2_DV_BT_DMT_2560X1600P75 { \
787 .type = V4L2_DV_BT_656_1120, \
788 V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, \
789 443250000, 208, 280, 488, 3, 6, 63, 0, 0, 0, \
790 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
791}
792
793#define V4L2_DV_BT_DMT_2560X1600P85 { \
794 .type = V4L2_DV_BT_656_1120, \
795 V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_VSYNC_POS_POL, \
796 505250000, 208, 280, 488, 3, 6, 73, 0, 0, 0, \
797 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, 0) \
798}
799
800#define V4L2_DV_BT_DMT_2560X1600P120_RB { \
801 .type = V4L2_DV_BT_656_1120, \
802 V4L2_INIT_BT_TIMINGS(2560, 1600, 0, V4L2_DV_HSYNC_POS_POL, \
803 552750000, 48, 32, 80, 3, 6, 85, 0, 0, 0, \
804 V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \
805 V4L2_DV_FL_REDUCED_BLANKING) \
806}
807
808#define V4L2_DV_BT_DMT_1366X768P60 { \
809 .type = V4L2_DV_BT_656_1120, \
810 V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
811 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
812 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
813 V4L2_DV_BT_STD_DMT, 0) \
814}
815
816#endif
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h
deleted file mode 100644
index 7d64e0e1a18b..000000000000
--- a/include/linux/v4l2-mediabus.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * Media Bus API header
3 *
4 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __LINUX_V4L2_MEDIABUS_H
12#define __LINUX_V4L2_MEDIABUS_H
13
14#include <linux/types.h>
15#include <linux/videodev2.h>
16
17/*
18 * These pixel codes uniquely identify data formats on the media bus. Mostly
19 * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
20 * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
21 * data format is fixed. Additionally, "2X8" means that one pixel is transferred
22 * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
23 * transferred over the bus: "LE" means that the least significant bits are
24 * transferred first, "BE" means that the most significant bits are transferred
25 * first, and "PADHI" and "PADLO" define which bits - low or high, in the
26 * incomplete high byte, are filled with padding bits.
27 *
28 * The pixel codes are grouped by type, bus_width, bits per component, samples
29 * per pixel and order of subsamples. Numerical values are sorted using generic
30 * numerical sort order (8 thus comes before 10).
31 *
32 * As their value can't change when a new pixel code is inserted in the
33 * enumeration, the pixel codes are explicitly given a numerical value. The next
34 * free values for each category are listed below, update them when inserting
35 * new pixel codes.
36 */
37enum v4l2_mbus_pixelcode {
38 V4L2_MBUS_FMT_FIXED = 0x0001,
39
40 /* RGB - next is 0x1009 */
41 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
42 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
43 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
44 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
45 V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005,
46 V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006,
47 V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007,
48 V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008,
49
50 /* YUV (including grey) - next is 0x2014 */
51 V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
52 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
53 V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003,
54 V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004,
55 V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005,
56 V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006,
57 V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007,
58 V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008,
59 V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009,
60 V4L2_MBUS_FMT_Y10_1X10 = 0x200a,
61 V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b,
62 V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c,
63 V4L2_MBUS_FMT_Y12_1X12 = 0x2013,
64 V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f,
65 V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010,
66 V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011,
67 V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012,
68 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
69 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
70
71 /* Bayer - next is 0x3015 */
72 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
73 V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013,
74 V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002,
75 V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014,
76 V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b,
77 V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c,
78 V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009,
79 V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 0x300d,
80 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003,
81 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004,
82 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005,
83 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006,
84 V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007,
85 V4L2_MBUS_FMT_SGBRG10_1X10 = 0x300e,
86 V4L2_MBUS_FMT_SGRBG10_1X10 = 0x300a,
87 V4L2_MBUS_FMT_SRGGB10_1X10 = 0x300f,
88 V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008,
89 V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010,
90 V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011,
91 V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012,
92
93 /* JPEG compressed formats - next is 0x4002 */
94 V4L2_MBUS_FMT_JPEG_1X8 = 0x4001,
95
96 /* Vendor specific formats - next is 0x5002 */
97
98 /* S5C73M3 sensor specific interleaved UYVY and JPEG */
99 V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001,
100};
101
102/**
103 * struct v4l2_mbus_framefmt - frame format on the media bus
104 * @width: frame width
105 * @height: frame height
106 * @code: data format code (from enum v4l2_mbus_pixelcode)
107 * @field: used interlacing type (from enum v4l2_field)
108 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
109 */
110struct v4l2_mbus_framefmt {
111 __u32 width;
112 __u32 height;
113 __u32 code;
114 __u32 field;
115 __u32 colorspace;
116 __u32 reserved[7];
117};
118
119#endif
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
deleted file mode 100644
index a33c4daadce3..000000000000
--- a/include/linux/v4l2-subdev.h
+++ /dev/null
@@ -1,180 +0,0 @@
1/*
2 * V4L2 subdev userspace API
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
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 version 2 as
11 * published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __LINUX_V4L2_SUBDEV_H
24#define __LINUX_V4L2_SUBDEV_H
25
26#include <linux/ioctl.h>
27#include <linux/types.h>
28#include <linux/v4l2-common.h>
29#include <linux/v4l2-mediabus.h>
30
31/**
32 * enum v4l2_subdev_format_whence - Media bus format type
33 * @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only
34 * @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device
35 */
36enum v4l2_subdev_format_whence {
37 V4L2_SUBDEV_FORMAT_TRY = 0,
38 V4L2_SUBDEV_FORMAT_ACTIVE = 1,
39};
40
41/**
42 * struct v4l2_subdev_format - Pad-level media bus format
43 * @which: format type (from enum v4l2_subdev_format_whence)
44 * @pad: pad number, as reported by the media API
45 * @format: media bus format (format code and frame size)
46 */
47struct v4l2_subdev_format {
48 __u32 which;
49 __u32 pad;
50 struct v4l2_mbus_framefmt format;
51 __u32 reserved[8];
52};
53
54/**
55 * struct v4l2_subdev_crop - Pad-level crop settings
56 * @which: format type (from enum v4l2_subdev_format_whence)
57 * @pad: pad number, as reported by the media API
58 * @rect: pad crop rectangle boundaries
59 */
60struct v4l2_subdev_crop {
61 __u32 which;
62 __u32 pad;
63 struct v4l2_rect rect;
64 __u32 reserved[8];
65};
66
67/**
68 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
69 * @pad: pad number, as reported by the media API
70 * @index: format index during enumeration
71 * @code: format code (from enum v4l2_mbus_pixelcode)
72 */
73struct v4l2_subdev_mbus_code_enum {
74 __u32 pad;
75 __u32 index;
76 __u32 code;
77 __u32 reserved[9];
78};
79
80/**
81 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
82 * @pad: pad number, as reported by the media API
83 * @index: format index during enumeration
84 * @code: format code (from enum v4l2_mbus_pixelcode)
85 */
86struct v4l2_subdev_frame_size_enum {
87 __u32 index;
88 __u32 pad;
89 __u32 code;
90 __u32 min_width;
91 __u32 max_width;
92 __u32 min_height;
93 __u32 max_height;
94 __u32 reserved[9];
95};
96
97/**
98 * struct v4l2_subdev_frame_interval - Pad-level frame rate
99 * @pad: pad number, as reported by the media API
100 * @interval: frame interval in seconds
101 */
102struct v4l2_subdev_frame_interval {
103 __u32 pad;
104 struct v4l2_fract interval;
105 __u32 reserved[9];
106};
107
108/**
109 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
110 * @pad: pad number, as reported by the media API
111 * @index: frame interval index during enumeration
112 * @code: format code (from enum v4l2_mbus_pixelcode)
113 * @width: frame width in pixels
114 * @height: frame height in pixels
115 * @interval: frame interval in seconds
116 */
117struct v4l2_subdev_frame_interval_enum {
118 __u32 index;
119 __u32 pad;
120 __u32 code;
121 __u32 width;
122 __u32 height;
123 struct v4l2_fract interval;
124 __u32 reserved[9];
125};
126
127/**
128 * struct v4l2_subdev_selection - selection info
129 *
130 * @which: either V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY
131 * @pad: pad number, as reported by the media API
132 * @target: Selection target, used to choose one of possible rectangles,
133 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
134 * @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
135 * @r: coordinates of the selection window
136 * @reserved: for future use, set to zero for now
137 *
138 * Hardware may use multiple helper windows to process a video stream.
139 * The structure is used to exchange this selection areas between
140 * an application and a driver.
141 */
142struct v4l2_subdev_selection {
143 __u32 which;
144 __u32 pad;
145 __u32 target;
146 __u32 flags;
147 struct v4l2_rect r;
148 __u32 reserved[8];
149};
150
151struct v4l2_subdev_edid {
152 __u32 pad;
153 __u32 start_block;
154 __u32 blocks;
155 __u32 reserved[5];
156 __u8 __user *edid;
157};
158
159#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
160#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
161#define VIDIOC_SUBDEV_G_FRAME_INTERVAL \
162 _IOWR('V', 21, struct v4l2_subdev_frame_interval)
163#define VIDIOC_SUBDEV_S_FRAME_INTERVAL \
164 _IOWR('V', 22, struct v4l2_subdev_frame_interval)
165#define VIDIOC_SUBDEV_ENUM_MBUS_CODE \
166 _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
167#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
168 _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
169#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
170 _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
171#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
172#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
173#define VIDIOC_SUBDEV_G_SELECTION \
174 _IOWR('V', 61, struct v4l2_subdev_selection)
175#define VIDIOC_SUBDEV_S_SELECTION \
176 _IOWR('V', 62, struct v4l2_subdev_selection)
177#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_subdev_edid)
178#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_subdev_edid)
179
180#endif
diff --git a/include/linux/veth.h b/include/linux/veth.h
deleted file mode 100644
index 3354c1eb424e..000000000000
--- a/include/linux/veth.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __NET_VETH_H_
2#define __NET_VETH_H_
3
4enum {
5 VETH_INFO_UNSPEC,
6 VETH_INFO_PEER,
7
8 __VETH_INFO_MAX
9#define VETH_INFO_MAX (__VETH_INFO_MAX - 1)
10};
11
12#endif
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 0a4f180a11d8..ab9e86224c54 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/vhost.h b/include/linux/vhost.h
deleted file mode 100644
index e847f1e30756..000000000000
--- a/include/linux/vhost.h
+++ /dev/null
@@ -1,130 +0,0 @@
1#ifndef _LINUX_VHOST_H
2#define _LINUX_VHOST_H
3/* Userspace interface for in-kernel virtio accelerators. */
4
5/* vhost is used to reduce the number of system calls involved in virtio.
6 *
7 * Existing virtio net code is used in the guest without modification.
8 *
9 * This header includes interface used by userspace hypervisor for
10 * device configuration.
11 */
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15#include <linux/ioctl.h>
16#include <linux/virtio_config.h>
17#include <linux/virtio_ring.h>
18
19struct vhost_vring_state {
20 unsigned int index;
21 unsigned int num;
22};
23
24struct vhost_vring_file {
25 unsigned int index;
26 int fd; /* Pass -1 to unbind from file. */
27
28};
29
30struct vhost_vring_addr {
31 unsigned int index;
32 /* Option flags. */
33 unsigned int flags;
34 /* Flag values: */
35 /* Whether log address is valid. If set enables logging. */
36#define VHOST_VRING_F_LOG 0
37
38 /* Start of array of descriptors (virtually contiguous) */
39 __u64 desc_user_addr;
40 /* Used structure address. Must be 32 bit aligned */
41 __u64 used_user_addr;
42 /* Available structure address. Must be 16 bit aligned */
43 __u64 avail_user_addr;
44 /* Logging support. */
45 /* Log writes to used structure, at offset calculated from specified
46 * address. Address must be 32 bit aligned. */
47 __u64 log_guest_addr;
48};
49
50struct vhost_memory_region {
51 __u64 guest_phys_addr;
52 __u64 memory_size; /* bytes */
53 __u64 userspace_addr;
54 __u64 flags_padding; /* No flags are currently specified. */
55};
56
57/* All region addresses and sizes must be 4K aligned. */
58#define VHOST_PAGE_SIZE 0x1000
59
60struct vhost_memory {
61 __u32 nregions;
62 __u32 padding;
63 struct vhost_memory_region regions[0];
64};
65
66/* ioctls */
67
68#define VHOST_VIRTIO 0xAF
69
70/* Features bitmask for forward compatibility. Transport bits are used for
71 * vhost specific features. */
72#define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
73#define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
74
75/* Set current process as the (exclusive) owner of this file descriptor. This
76 * must be called before any other vhost command. Further calls to
77 * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */
78#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
79/* Give up ownership, and reset the device to default values.
80 * Allows subsequent call to VHOST_OWNER_SET to succeed. */
81#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
82
83/* Set up/modify memory layout */
84#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
85
86/* Write logging setup. */
87/* Memory writes can optionally be logged by setting bit at an offset
88 * (calculated from the physical address) from specified log base.
89 * The bit is set using an atomic 32 bit operation. */
90/* Set base address for logging. */
91#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
92/* Specify an eventfd file descriptor to signal on log write. */
93#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
94
95/* Ring setup. */
96/* Set number of descriptors in ring. This parameter can not
97 * be modified while ring is running (bound to a device). */
98#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state)
99/* Set addresses for the ring. */
100#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr)
101/* Base value where queue looks for available descriptors */
102#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
103/* Get accessor: reads index, writes value in num */
104#define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
105
106/* The following ioctls use eventfd file descriptors to signal and poll
107 * for events. */
108
109/* Set eventfd to poll for added buffers */
110#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file)
111/* Set eventfd to signal when buffers have beed used */
112#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
113/* Set eventfd to signal an error */
114#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
115
116/* VHOST_NET specific defines */
117
118/* Attach virtio net ring to a raw socket, or tap device.
119 * The socket must be already bound to an ethernet device, this device will be
120 * used for transmit. Pass fd -1 to unbind from the socket and the transmit
121 * device. This can be used to stop the ring (e.g. for migration). */
122#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
123
124/* Feature bits */
125/* Log all write descriptors. Can be changed while device is active. */
126#define VHOST_F_LOG_ALL 26
127/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
128#define VHOST_NET_F_VIRTIO_NET_HDR 27
129
130#endif
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 873adbe82988..73ea2fb04731 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_9p.h b/include/linux/virtio_9p.h
deleted file mode 100644
index 277c4ad44e84..000000000000
--- a/include/linux/virtio_9p.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef _LINUX_VIRTIO_9P_H
2#define _LINUX_VIRTIO_9P_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * 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#include <linux/types.h>
29#include <linux/virtio_ids.h>
30#include <linux/virtio_config.h>
31
32/* The feature bitmap for virtio 9P */
33
34/* The mount point is specified in a config variable */
35#define VIRTIO_9P_MOUNT_TAG 0
36
37struct virtio_9p_config {
38 /* length of the tag name */
39 __u16 tag_len;
40 /* non-NULL terminated tag name */
41 __u8 tag[0];
42} __attribute__((packed));
43
44#endif /* _LINUX_VIRTIO_9P_H */
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h
deleted file mode 100644
index 652dc8bea921..000000000000
--- a/include/linux/virtio_balloon.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef _LINUX_VIRTIO_BALLOON_H
2#define _LINUX_VIRTIO_BALLOON_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * 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#include <linux/virtio_ids.h>
29#include <linux/virtio_config.h>
30
31/* The feature bitmap for virtio balloon */
32#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
33#define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */
34
35/* Size of a PFN in the balloon interface. */
36#define VIRTIO_BALLOON_PFN_SHIFT 12
37
38struct virtio_balloon_config
39{
40 /* Number of pages host wants Guest to give up. */
41 __le32 num_pages;
42 /* Number of pages we've actually got in balloon. */
43 __le32 actual;
44};
45
46#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */
47#define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */
48#define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */
49#define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */
50#define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */
51#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
52#define VIRTIO_BALLOON_S_NR 6
53
54struct virtio_balloon_stat {
55 u16 tag;
56 u64 val;
57} __attribute__((packed));
58
59#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
deleted file mode 100644
index 6d8e61c48563..000000000000
--- a/include/linux/virtio_blk.h
+++ /dev/null
@@ -1,130 +0,0 @@
1#ifndef _LINUX_VIRTIO_BLK_H
2#define _LINUX_VIRTIO_BLK_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * 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#include <linux/types.h>
29#include <linux/virtio_ids.h>
30#include <linux/virtio_config.h>
31
32/* Feature bits */
33#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
34#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
35#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
36#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
37#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
38#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
39#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
40#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */
41#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
42#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */
43
44#ifndef __KERNEL__
45/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */
46#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE
47#endif
48
49#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */
50
51struct virtio_blk_config {
52 /* The capacity (in 512-byte sectors). */
53 __u64 capacity;
54 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
55 __u32 size_max;
56 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
57 __u32 seg_max;
58 /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
59 struct virtio_blk_geometry {
60 __u16 cylinders;
61 __u8 heads;
62 __u8 sectors;
63 } geometry;
64
65 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
66 __u32 blk_size;
67
68 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
69 /* exponent for physical block per logical block. */
70 __u8 physical_block_exp;
71 /* alignment offset in logical blocks. */
72 __u8 alignment_offset;
73 /* minimum I/O size without performance penalty in logical blocks. */
74 __u16 min_io_size;
75 /* optimal sustained I/O size in logical blocks. */
76 __u32 opt_io_size;
77
78 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
79 __u8 wce;
80} __attribute__((packed));
81
82/*
83 * Command types
84 *
85 * Usage is a bit tricky as some bits are used as flags and some are not.
86 *
87 * Rules:
88 * VIRTIO_BLK_T_OUT may be combined with VIRTIO_BLK_T_SCSI_CMD or
89 * VIRTIO_BLK_T_BARRIER. VIRTIO_BLK_T_FLUSH is a command of its own
90 * and may not be combined with any of the other flags.
91 */
92
93/* These two define direction. */
94#define VIRTIO_BLK_T_IN 0
95#define VIRTIO_BLK_T_OUT 1
96
97/* This bit says it's a scsi command, not an actual read or write. */
98#define VIRTIO_BLK_T_SCSI_CMD 2
99
100/* Cache flush command */
101#define VIRTIO_BLK_T_FLUSH 4
102
103/* Get device ID command */
104#define VIRTIO_BLK_T_GET_ID 8
105
106/* Barrier before this op. */
107#define VIRTIO_BLK_T_BARRIER 0x80000000
108
109/* This is the first element of the read scatter-gather list. */
110struct virtio_blk_outhdr {
111 /* VIRTIO_BLK_T* */
112 __u32 type;
113 /* io priority. */
114 __u32 ioprio;
115 /* Sector (ie. 512 byte offset) */
116 __u64 sector;
117};
118
119struct virtio_scsi_inhdr {
120 __u32 errors;
121 __u32 data_len;
122 __u32 sense_len;
123 __u32 residual;
124};
125
126/* And this is the final byte of the write scatter-gather list. */
127#define VIRTIO_BLK_S_OK 0
128#define VIRTIO_BLK_S_IOERR 1
129#define VIRTIO_BLK_S_UNSUPP 2
130#endif /* _LINUX_VIRTIO_BLK_H */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index e2850a7ea276..29b9104232b4 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 bdf4b0034739..d2e2785af602 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_ids.h b/include/linux/virtio_ids.h
deleted file mode 100644
index 270fb22c5811..000000000000
--- a/include/linux/virtio_ids.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef _LINUX_VIRTIO_IDS_H
2#define _LINUX_VIRTIO_IDS_H
3/*
4 * Virtio IDs
5 *
6 * This header is BSD licensed so anyone can use the definitions to implement
7 * compatible drivers/servers.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of IBM nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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#define VIRTIO_ID_NET 1 /* virtio net */
33#define VIRTIO_ID_BLOCK 2 /* virtio block */
34#define VIRTIO_ID_CONSOLE 3 /* virtio console */
35#define VIRTIO_ID_RNG 4 /* virtio rng */
36#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
37#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */
38#define VIRTIO_ID_SCSI 8 /* virtio scsi */
39#define VIRTIO_ID_9P 9 /* 9p virtio console */
40
41#endif /* _LINUX_VIRTIO_IDS_H */
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
deleted file mode 100644
index 2470f541af50..000000000000
--- a/include/linux/virtio_net.h
+++ /dev/null
@@ -1,169 +0,0 @@
1#ifndef _LINUX_VIRTIO_NET_H
2#define _LINUX_VIRTIO_NET_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * 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#include <linux/types.h>
29#include <linux/virtio_ids.h>
30#include <linux/virtio_config.h>
31#include <linux/if_ether.h>
32
33/* The feature bitmap for virtio net */
34#define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */
35#define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */
36#define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */
37#define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */
38#define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */
39#define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */
40#define VIRTIO_NET_F_GUEST_ECN 9 /* Guest can handle TSO[6] w/ ECN in. */
41#define VIRTIO_NET_F_GUEST_UFO 10 /* Guest can handle UFO in. */
42#define VIRTIO_NET_F_HOST_TSO4 11 /* Host can handle TSOv4 in. */
43#define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */
44#define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */
45#define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */
46#define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */
47#define VIRTIO_NET_F_STATUS 16 /* virtio_net_config.status available */
48#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
49#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
50#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
51#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
52#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
53 * network */
54
55#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
56#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
57
58struct virtio_net_config {
59 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
60 __u8 mac[6];
61 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
62 __u16 status;
63} __attribute__((packed));
64
65/* This is the first element of the scatter-gather list. If you don't
66 * specify GSO or CSUM features, you can simply ignore the header. */
67struct virtio_net_hdr {
68#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
69#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
70 __u8 flags;
71#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
72#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
73#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
74#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
75#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
76 __u8 gso_type;
77 __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
78 __u16 gso_size; /* Bytes to append to hdr_len per frame */
79 __u16 csum_start; /* Position to start checksumming from */
80 __u16 csum_offset; /* Offset after that to place checksum */
81};
82
83/* This is the version of the header to use when the MRG_RXBUF
84 * feature has been negotiated. */
85struct virtio_net_hdr_mrg_rxbuf {
86 struct virtio_net_hdr hdr;
87 __u16 num_buffers; /* Number of merged rx buffers */
88};
89
90/*
91 * Control virtqueue data structures
92 *
93 * The control virtqueue expects a header in the first sg entry
94 * and an ack/status response in the last entry. Data for the
95 * command goes in between.
96 */
97struct virtio_net_ctrl_hdr {
98 __u8 class;
99 __u8 cmd;
100} __attribute__((packed));
101
102typedef __u8 virtio_net_ctrl_ack;
103
104#define VIRTIO_NET_OK 0
105#define VIRTIO_NET_ERR 1
106
107/*
108 * Control the RX mode, ie. promisucous, allmulti, etc...
109 * All commands require an "out" sg entry containing a 1 byte
110 * state value, zero = disable, non-zero = enable. Commands
111 * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
112 * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
113 */
114#define VIRTIO_NET_CTRL_RX 0
115 #define VIRTIO_NET_CTRL_RX_PROMISC 0
116 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1
117 #define VIRTIO_NET_CTRL_RX_ALLUNI 2
118 #define VIRTIO_NET_CTRL_RX_NOMULTI 3
119 #define VIRTIO_NET_CTRL_RX_NOUNI 4
120 #define VIRTIO_NET_CTRL_RX_NOBCAST 5
121
122/*
123 * Control the MAC filter table.
124 *
125 * The MAC filter table is managed by the hypervisor, the guest should
126 * assume the size is infinite. Filtering should be considered
127 * non-perfect, ie. based on hypervisor resources, the guest may
128 * received packets from sources not specified in the filter list.
129 *
130 * In addition to the class/cmd header, the TABLE_SET command requires
131 * two out scatterlists. Each contains a 4 byte count of entries followed
132 * by a concatenated byte stream of the ETH_ALEN MAC addresses. The
133 * first sg list contains unicast addresses, the second is for multicast.
134 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
135 * is available.
136 */
137struct virtio_net_ctrl_mac {
138 __u32 entries;
139 __u8 macs[][ETH_ALEN];
140} __attribute__((packed));
141
142#define VIRTIO_NET_CTRL_MAC 1
143 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
144
145/*
146 * Control VLAN filtering
147 *
148 * The VLAN filter table is controlled via a simple ADD/DEL interface.
149 * VLAN IDs not added may be filterd by the hypervisor. Del is the
150 * opposite of add. Both commands expect an out entry containing a 2
151 * byte VLAN ID. VLAN filterting is available with the
152 * VIRTIO_NET_F_CTRL_VLAN feature bit.
153 */
154#define VIRTIO_NET_CTRL_VLAN 2
155 #define VIRTIO_NET_CTRL_VLAN_ADD 0
156 #define VIRTIO_NET_CTRL_VLAN_DEL 1
157
158/*
159 * Control link announce acknowledgement
160 *
161 * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
162 * driver has recevied the notification; device would clear the
163 * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
164 * this command.
165 */
166#define VIRTIO_NET_CTRL_ANNOUNCE 3
167 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
168
169#endif /* _LINUX_VIRTIO_NET_H */
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h
deleted file mode 100644
index ea66f3f60d63..000000000000
--- a/include/linux/virtio_pci.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * Virtio PCI driver
3 *
4 * This module allows virtio devices to be used over a virtual PCI device.
5 * This can be used with QEMU based VMMs like KVM or Xen.
6 *
7 * Copyright IBM Corp. 2007
8 *
9 * Authors:
10 * Anthony Liguori <aliguori@us.ibm.com>
11 *
12 * This header is BSD licensed so anyone can use the definitions to implement
13 * compatible drivers/servers.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. Neither the name of IBM nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#ifndef _LINUX_VIRTIO_PCI_H
40#define _LINUX_VIRTIO_PCI_H
41
42#include <linux/virtio_config.h>
43
44/* A 32-bit r/o bitmask of the features supported by the host */
45#define VIRTIO_PCI_HOST_FEATURES 0
46
47/* A 32-bit r/w bitmask of features activated by the guest */
48#define VIRTIO_PCI_GUEST_FEATURES 4
49
50/* A 32-bit r/w PFN for the currently selected queue */
51#define VIRTIO_PCI_QUEUE_PFN 8
52
53/* A 16-bit r/o queue size for the currently selected queue */
54#define VIRTIO_PCI_QUEUE_NUM 12
55
56/* A 16-bit r/w queue selector */
57#define VIRTIO_PCI_QUEUE_SEL 14
58
59/* A 16-bit r/w queue notifier */
60#define VIRTIO_PCI_QUEUE_NOTIFY 16
61
62/* An 8-bit device status register. */
63#define VIRTIO_PCI_STATUS 18
64
65/* An 8-bit r/o interrupt status register. Reading the value will return the
66 * current contents of the ISR and will also clear it. This is effectively
67 * a read-and-acknowledge. */
68#define VIRTIO_PCI_ISR 19
69
70/* The bit of the ISR which indicates a device configuration change. */
71#define VIRTIO_PCI_ISR_CONFIG 0x2
72
73/* MSI-X registers: only enabled if MSI-X is enabled. */
74/* A 16-bit vector for configuration changes. */
75#define VIRTIO_MSI_CONFIG_VECTOR 20
76/* A 16-bit vector for selected queue notifications. */
77#define VIRTIO_MSI_QUEUE_VECTOR 22
78/* Vector value used to disable MSI for queue */
79#define VIRTIO_MSI_NO_VECTOR 0xffff
80
81/* The remaining space is defined by each driver as the per-driver
82 * configuration space */
83#define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20)
84
85/* Virtio ABI version, this must match exactly */
86#define VIRTIO_PCI_ABI_VERSION 0
87
88/* How many bits to shift physical queue address written to QUEUE_PFN.
89 * 12 is historical, and due to x86 page size. */
90#define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12
91
92/* The alignment to use between consumer and producer parts of vring.
93 * x86 pagesize again. */
94#define VIRTIO_PCI_VRING_ALIGN 4096
95#endif
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index c2d793a06ad7..63c6ea199519 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/virtio_rng.h b/include/linux/virtio_rng.h
deleted file mode 100644
index c4d5de896f0c..000000000000
--- a/include/linux/virtio_rng.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _LINUX_VIRTIO_RNG_H
2#define _LINUX_VIRTIO_RNG_H
3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */
5#include <linux/virtio_ids.h>
6#include <linux/virtio_config.h>
7
8#endif /* _LINUX_VIRTIO_RNG_H */
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 30a8dd9c83ff..b186e0435239 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 1dee81c41ff1..168dfe122dd3 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 3157cc1fada6..cec4b4159767 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 da70f0facd2b..b7f45d48b2de 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/wimax.h b/include/linux/wimax.h
deleted file mode 100644
index 9f6b77af2f6d..000000000000
--- a/include/linux/wimax.h
+++ /dev/null
@@ -1,239 +0,0 @@
1/*
2 * Linux WiMax
3 * API for user space
4 *
5 *
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
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 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *
35 * Intel Corporation <linux-wimax@intel.com>
36 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
37 * - Initial implementation
38 *
39 *
40 * This file declares the user/kernel protocol that is spoken over
41 * Generic Netlink, as well as any type declaration that is to be used
42 * by kernel and user space.
43 *
44 * It is intended for user space to clone it verbatim to use it as a
45 * primary reference for definitions.
46 *
47 * Stuff intended for kernel usage as well as full protocol and stack
48 * documentation is rooted in include/net/wimax.h.
49 */
50
51#ifndef __LINUX__WIMAX_H__
52#define __LINUX__WIMAX_H__
53
54#include <linux/types.h>
55
56enum {
57 /**
58 * Version of the interface (unsigned decimal, MMm, max 25.5)
59 * M - Major: change if removing or modifying an existing call.
60 * m - minor: change when adding a new call
61 */
62 WIMAX_GNL_VERSION = 01,
63 /* Generic NetLink attributes */
64 WIMAX_GNL_ATTR_INVALID = 0x00,
65 WIMAX_GNL_ATTR_MAX = 10,
66};
67
68
69/*
70 * Generic NetLink operations
71 *
72 * Most of these map to an API call; _OP_ stands for operation, _RP_
73 * for reply and _RE_ for report (aka: signal).
74 */
75enum {
76 WIMAX_GNL_OP_MSG_FROM_USER, /* User to kernel message */
77 WIMAX_GNL_OP_MSG_TO_USER, /* Kernel to user message */
78 WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */
79 WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */
80 WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */
81 WIMAX_GNL_OP_STATE_GET, /* Request for current state */
82};
83
84
85/* Message from user / to user */
86enum {
87 WIMAX_GNL_MSG_IFIDX = 1,
88 WIMAX_GNL_MSG_PIPE_NAME,
89 WIMAX_GNL_MSG_DATA,
90};
91
92
93/*
94 * wimax_rfkill()
95 *
96 * The state of the radio (ON/OFF) is mapped to the rfkill subsystem's
97 * switch state (DISABLED/ENABLED).
98 */
99enum wimax_rf_state {
100 WIMAX_RF_OFF = 0, /* Radio is off, rfkill on/enabled */
101 WIMAX_RF_ON = 1, /* Radio is on, rfkill off/disabled */
102 WIMAX_RF_QUERY = 2,
103};
104
105/* Attributes */
106enum {
107 WIMAX_GNL_RFKILL_IFIDX = 1,
108 WIMAX_GNL_RFKILL_STATE,
109};
110
111
112/* Attributes for wimax_reset() */
113enum {
114 WIMAX_GNL_RESET_IFIDX = 1,
115};
116
117/* Attributes for wimax_state_get() */
118enum {
119 WIMAX_GNL_STGET_IFIDX = 1,
120};
121
122/*
123 * Attributes for the Report State Change
124 *
125 * For now we just have the old and new states; new attributes might
126 * be added later on.
127 */
128enum {
129 WIMAX_GNL_STCH_IFIDX = 1,
130 WIMAX_GNL_STCH_STATE_OLD,
131 WIMAX_GNL_STCH_STATE_NEW,
132};
133
134
135/**
136 * enum wimax_st - The different states of a WiMAX device
137 * @__WIMAX_ST_NULL: The device structure has been allocated and zeroed,
138 * but still wimax_dev_add() hasn't been called. There is no state.
139 *
140 * @WIMAX_ST_DOWN: The device has been registered with the WiMAX and
141 * networking stacks, but it is not initialized (normally that is
142 * done with 'ifconfig DEV up' [or equivalent], which can upload
143 * firmware and enable communications with the device).
144 * In this state, the device is powered down and using as less
145 * power as possible.
146 * This state is the default after a call to wimax_dev_add(). It
147 * is ok to have drivers move directly to %WIMAX_ST_UNINITIALIZED
148 * or %WIMAX_ST_RADIO_OFF in _probe() after the call to
149 * wimax_dev_add().
150 * It is recommended that the driver leaves this state when
151 * calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV
152 * down'.
153 *
154 * @__WIMAX_ST_QUIESCING: The device is being torn down, so no API
155 * operations are allowed to proceed except the ones needed to
156 * complete the device clean up process.
157 *
158 * @WIMAX_ST_UNINITIALIZED: [optional] Communication with the device
159 * is setup, but the device still requires some configuration
160 * before being operational.
161 * Some WiMAX API calls might work.
162 *
163 * @WIMAX_ST_RADIO_OFF: The device is fully up; radio is off (wether
164 * by hardware or software switches).
165 * It is recommended to always leave the device in this state
166 * after initialization.
167 *
168 * @WIMAX_ST_READY: The device is fully up and radio is on.
169 *
170 * @WIMAX_ST_SCANNING: [optional] The device has been instructed to
171 * scan. In this state, the device cannot be actively connected to
172 * a network.
173 *
174 * @WIMAX_ST_CONNECTING: The device is connecting to a network. This
175 * state exists because in some devices, the connect process can
176 * include a number of negotiations between user space, kernel
177 * space and the device. User space needs to know what the device
178 * is doing. If the connect sequence in a device is atomic and
179 * fast, the device can transition directly to CONNECTED
180 *
181 * @WIMAX_ST_CONNECTED: The device is connected to a network.
182 *
183 * @__WIMAX_ST_INVALID: This is an invalid state used to mark the
184 * maximum numeric value of states.
185 *
186 * Description:
187 *
188 * Transitions from one state to another one are atomic and can only
189 * be caused in kernel space with wimax_state_change(). To read the
190 * state, use wimax_state_get().
191 *
192 * States starting with __ are internal and shall not be used or
193 * referred to by drivers or userspace. They look ugly, but that's the
194 * point -- if any use is made non-internal to the stack, it is easier
195 * to catch on review.
196 *
197 * All API operations [with well defined exceptions] will take the
198 * device mutex before starting and then check the state. If the state
199 * is %__WIMAX_ST_NULL, %WIMAX_ST_DOWN, %WIMAX_ST_UNINITIALIZED or
200 * %__WIMAX_ST_QUIESCING, it will drop the lock and quit with
201 * -%EINVAL, -%ENOMEDIUM, -%ENOTCONN or -%ESHUTDOWN.
202 *
203 * The order of the definitions is important, so we can do numerical
204 * comparisons (eg: < %WIMAX_ST_RADIO_OFF means the device is not ready
205 * to operate).
206 */
207/*
208 * The allowed state transitions are described in the table below
209 * (states in rows can go to states in columns where there is an X):
210 *
211 * UNINI RADIO READY SCAN CONNEC CONNEC
212 * NULL DOWN QUIESCING TIALIZED OFF NING TING TED
213 * NULL - x
214 * DOWN - x x x
215 * QUIESCING x -
216 * UNINITIALIZED x - x
217 * RADIO_OFF x - x
218 * READY x x - x x x
219 * SCANNING x x x - x x
220 * CONNECTING x x x x - x
221 * CONNECTED x x x -
222 *
223 * This table not available in kernel-doc because the formatting messes it up.
224 */
225 enum wimax_st {
226 __WIMAX_ST_NULL = 0,
227 WIMAX_ST_DOWN,
228 __WIMAX_ST_QUIESCING,
229 WIMAX_ST_UNINITIALIZED,
230 WIMAX_ST_RADIO_OFF,
231 WIMAX_ST_READY,
232 WIMAX_ST_SCANNING,
233 WIMAX_ST_CONNECTING,
234 WIMAX_ST_CONNECTED,
235 __WIMAX_ST_INVALID /* Always keep last */
236};
237
238
239#endif /* #ifndef __LINUX__WIMAX_H__ */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 4395b28bb86c..4ea4c6e2383d 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/x25.h b/include/linux/x25.h
deleted file mode 100644
index 810cce6737ea..000000000000
--- a/include/linux/x25.h
+++ /dev/null
@@ -1,152 +0,0 @@
1/*
2 * These are the public elements of the Linux kernel X.25 implementation.
3 *
4 * History
5 * mar/20/00 Daniela Squassoni Disabling/enabling of facilities
6 * negotiation.
7 * apr/02/05 Shaun Pereira Selective sub address matching with
8 * call user data
9 */
10
11#ifndef X25_KERNEL_H
12#define X25_KERNEL_H
13
14#include <linux/types.h>
15#include <linux/socket.h>
16
17#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
18#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
19#define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2)
20#define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3)
21#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
22#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
23#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
24#define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
25#define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
26#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
27#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
28#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
29#define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12)
30
31/*
32 * Values for {get,set}sockopt.
33 */
34#define X25_QBITINCL 1
35
36/*
37 * X.25 Packet Size values.
38 */
39#define X25_PS16 4
40#define X25_PS32 5
41#define X25_PS64 6
42#define X25_PS128 7
43#define X25_PS256 8
44#define X25_PS512 9
45#define X25_PS1024 10
46#define X25_PS2048 11
47#define X25_PS4096 12
48
49/*
50 * An X.121 address, it is held as ASCII text, null terminated, up to 15
51 * digits and a null terminator.
52 */
53struct x25_address {
54 char x25_addr[16];
55};
56
57/*
58 * Linux X.25 Address structure, used for bind, and connect mostly.
59 */
60struct sockaddr_x25 {
61 __kernel_sa_family_t sx25_family; /* Must be AF_X25 */
62 struct x25_address sx25_addr; /* X.121 Address */
63};
64
65/*
66 * DTE/DCE subscription options.
67 *
68 * As this is missing lots of options, user should expect major
69 * changes of this structure in 2.5.x which might break compatibilty.
70 * The somewhat ugly dimension 200-sizeof() is needed to maintain
71 * backward compatibility.
72 */
73struct x25_subscrip_struct {
74 char device[200-sizeof(unsigned long)];
75 unsigned long global_facil_mask; /* 0 to disable negotiation */
76 unsigned int extended;
77};
78
79/* values for above global_facil_mask */
80
81#define X25_MASK_REVERSE 0x01
82#define X25_MASK_THROUGHPUT 0x02
83#define X25_MASK_PACKET_SIZE 0x04
84#define X25_MASK_WINDOW_SIZE 0x08
85
86#define X25_MASK_CALLING_AE 0x10
87#define X25_MASK_CALLED_AE 0x20
88
89
90/*
91 * Routing table control structure.
92 */
93struct x25_route_struct {
94 struct x25_address address;
95 unsigned int sigdigits;
96 char device[200];
97};
98
99/*
100 * Facilities structure.
101 */
102struct x25_facilities {
103 unsigned int winsize_in, winsize_out;
104 unsigned int pacsize_in, pacsize_out;
105 unsigned int throughput;
106 unsigned int reverse;
107};
108
109/*
110* ITU DTE facilities
111* Only the called and calling address
112* extension are currently implemented.
113* The rest are in place to avoid the struct
114* changing size if someone needs them later
115*/
116
117struct x25_dte_facilities {
118 __u16 delay_cumul;
119 __u16 delay_target;
120 __u16 delay_max;
121 __u8 min_throughput;
122 __u8 expedited;
123 __u8 calling_len;
124 __u8 called_len;
125 __u8 calling_ae[20];
126 __u8 called_ae[20];
127};
128
129/*
130 * Call User Data structure.
131 */
132struct x25_calluserdata {
133 unsigned int cudlength;
134 unsigned char cuddata[128];
135};
136
137/*
138 * Call clearing Cause and Diagnostic structure.
139 */
140struct x25_causediag {
141 unsigned char cause;
142 unsigned char diagnostic;
143};
144
145/*
146 * Further optional call user data match length selection
147 */
148struct x25_subaddr {
149 unsigned int cudmatchlength;
150};
151
152#endif
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index cc13e1115970..fdbafc6841cf 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/linux/xfrm.h b/include/linux/xfrm.h
deleted file mode 100644
index 28e493b5b94c..000000000000
--- a/include/linux/xfrm.h
+++ /dev/null
@@ -1,506 +0,0 @@
1#ifndef _LINUX_XFRM_H
2#define _LINUX_XFRM_H
3
4#include <linux/types.h>
5
6/* All of the structures in this file may not change size as they are
7 * passed into the kernel from userspace via netlink sockets.
8 */
9
10/* Structure to encapsulate addresses. I do not want to use
11 * "standard" structure. My apologies.
12 */
13typedef union {
14 __be32 a4;
15 __be32 a6[4];
16} xfrm_address_t;
17
18/* Ident of a specific xfrm_state. It is used on input to lookup
19 * the state by (spi,daddr,ah/esp) or to store information about
20 * spi, protocol and tunnel address on output.
21 */
22struct xfrm_id {
23 xfrm_address_t daddr;
24 __be32 spi;
25 __u8 proto;
26};
27
28struct xfrm_sec_ctx {
29 __u8 ctx_doi;
30 __u8 ctx_alg;
31 __u16 ctx_len;
32 __u32 ctx_sid;
33 char ctx_str[0];
34};
35
36/* Security Context Domains of Interpretation */
37#define XFRM_SC_DOI_RESERVED 0
38#define XFRM_SC_DOI_LSM 1
39
40/* Security Context Algorithms */
41#define XFRM_SC_ALG_RESERVED 0
42#define XFRM_SC_ALG_SELINUX 1
43
44/* Selector, used as selector both on policy rules (SPD) and SAs. */
45
46struct xfrm_selector {
47 xfrm_address_t daddr;
48 xfrm_address_t saddr;
49 __be16 dport;
50 __be16 dport_mask;
51 __be16 sport;
52 __be16 sport_mask;
53 __u16 family;
54 __u8 prefixlen_d;
55 __u8 prefixlen_s;
56 __u8 proto;
57 int ifindex;
58 __kernel_uid32_t user;
59};
60
61#define XFRM_INF (~(__u64)0)
62
63struct xfrm_lifetime_cfg {
64 __u64 soft_byte_limit;
65 __u64 hard_byte_limit;
66 __u64 soft_packet_limit;
67 __u64 hard_packet_limit;
68 __u64 soft_add_expires_seconds;
69 __u64 hard_add_expires_seconds;
70 __u64 soft_use_expires_seconds;
71 __u64 hard_use_expires_seconds;
72};
73
74struct xfrm_lifetime_cur {
75 __u64 bytes;
76 __u64 packets;
77 __u64 add_time;
78 __u64 use_time;
79};
80
81struct xfrm_replay_state {
82 __u32 oseq;
83 __u32 seq;
84 __u32 bitmap;
85};
86
87#define XFRMA_REPLAY_ESN_MAX 4096
88
89struct xfrm_replay_state_esn {
90 unsigned int bmp_len;
91 __u32 oseq;
92 __u32 seq;
93 __u32 oseq_hi;
94 __u32 seq_hi;
95 __u32 replay_window;
96 __u32 bmp[0];
97};
98
99struct xfrm_algo {
100 char alg_name[64];
101 unsigned int alg_key_len; /* in bits */
102 char alg_key[0];
103};
104
105struct xfrm_algo_auth {
106 char alg_name[64];
107 unsigned int alg_key_len; /* in bits */
108 unsigned int alg_trunc_len; /* in bits */
109 char alg_key[0];
110};
111
112struct xfrm_algo_aead {
113 char alg_name[64];
114 unsigned int alg_key_len; /* in bits */
115 unsigned int alg_icv_len; /* in bits */
116 char alg_key[0];
117};
118
119struct xfrm_stats {
120 __u32 replay_window;
121 __u32 replay;
122 __u32 integrity_failed;
123};
124
125enum {
126 XFRM_POLICY_TYPE_MAIN = 0,
127 XFRM_POLICY_TYPE_SUB = 1,
128 XFRM_POLICY_TYPE_MAX = 2,
129 XFRM_POLICY_TYPE_ANY = 255
130};
131
132enum {
133 XFRM_POLICY_IN = 0,
134 XFRM_POLICY_OUT = 1,
135 XFRM_POLICY_FWD = 2,
136 XFRM_POLICY_MASK = 3,
137 XFRM_POLICY_MAX = 3
138};
139
140enum {
141 XFRM_SHARE_ANY, /* No limitations */
142 XFRM_SHARE_SESSION, /* For this session only */
143 XFRM_SHARE_USER, /* For this user only */
144 XFRM_SHARE_UNIQUE /* Use once */
145};
146
147#define XFRM_MODE_TRANSPORT 0
148#define XFRM_MODE_TUNNEL 1
149#define XFRM_MODE_ROUTEOPTIMIZATION 2
150#define XFRM_MODE_IN_TRIGGER 3
151#define XFRM_MODE_BEET 4
152#define XFRM_MODE_MAX 5
153
154/* Netlink configuration messages. */
155enum {
156 XFRM_MSG_BASE = 0x10,
157
158 XFRM_MSG_NEWSA = 0x10,
159#define XFRM_MSG_NEWSA XFRM_MSG_NEWSA
160 XFRM_MSG_DELSA,
161#define XFRM_MSG_DELSA XFRM_MSG_DELSA
162 XFRM_MSG_GETSA,
163#define XFRM_MSG_GETSA XFRM_MSG_GETSA
164
165 XFRM_MSG_NEWPOLICY,
166#define XFRM_MSG_NEWPOLICY XFRM_MSG_NEWPOLICY
167 XFRM_MSG_DELPOLICY,
168#define XFRM_MSG_DELPOLICY XFRM_MSG_DELPOLICY
169 XFRM_MSG_GETPOLICY,
170#define XFRM_MSG_GETPOLICY XFRM_MSG_GETPOLICY
171
172 XFRM_MSG_ALLOCSPI,
173#define XFRM_MSG_ALLOCSPI XFRM_MSG_ALLOCSPI
174 XFRM_MSG_ACQUIRE,
175#define XFRM_MSG_ACQUIRE XFRM_MSG_ACQUIRE
176 XFRM_MSG_EXPIRE,
177#define XFRM_MSG_EXPIRE XFRM_MSG_EXPIRE
178
179 XFRM_MSG_UPDPOLICY,
180#define XFRM_MSG_UPDPOLICY XFRM_MSG_UPDPOLICY
181 XFRM_MSG_UPDSA,
182#define XFRM_MSG_UPDSA XFRM_MSG_UPDSA
183
184 XFRM_MSG_POLEXPIRE,
185#define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE
186
187 XFRM_MSG_FLUSHSA,
188#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA
189 XFRM_MSG_FLUSHPOLICY,
190#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
191
192 XFRM_MSG_NEWAE,
193#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
194 XFRM_MSG_GETAE,
195#define XFRM_MSG_GETAE XFRM_MSG_GETAE
196
197 XFRM_MSG_REPORT,
198#define XFRM_MSG_REPORT XFRM_MSG_REPORT
199
200 XFRM_MSG_MIGRATE,
201#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
202
203 XFRM_MSG_NEWSADINFO,
204#define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO
205 XFRM_MSG_GETSADINFO,
206#define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO
207
208 XFRM_MSG_NEWSPDINFO,
209#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
210 XFRM_MSG_GETSPDINFO,
211#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
212
213 XFRM_MSG_MAPPING,
214#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
215 __XFRM_MSG_MAX
216};
217#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
218
219#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
220
221/*
222 * Generic LSM security context for comunicating to user space
223 * NOTE: Same format as sadb_x_sec_ctx
224 */
225struct xfrm_user_sec_ctx {
226 __u16 len;
227 __u16 exttype;
228 __u8 ctx_alg; /* LSMs: e.g., selinux == 1 */
229 __u8 ctx_doi;
230 __u16 ctx_len;
231};
232
233struct xfrm_user_tmpl {
234 struct xfrm_id id;
235 __u16 family;
236 xfrm_address_t saddr;
237 __u32 reqid;
238 __u8 mode;
239 __u8 share;
240 __u8 optional;
241 __u32 aalgos;
242 __u32 ealgos;
243 __u32 calgos;
244};
245
246struct xfrm_encap_tmpl {
247 __u16 encap_type;
248 __be16 encap_sport;
249 __be16 encap_dport;
250 xfrm_address_t encap_oa;
251};
252
253/* AEVENT flags */
254enum xfrm_ae_ftype_t {
255 XFRM_AE_UNSPEC,
256 XFRM_AE_RTHR=1, /* replay threshold*/
257 XFRM_AE_RVAL=2, /* replay value */
258 XFRM_AE_LVAL=4, /* lifetime value */
259 XFRM_AE_ETHR=8, /* expiry timer threshold */
260 XFRM_AE_CR=16, /* Event cause is replay update */
261 XFRM_AE_CE=32, /* Event cause is timer expiry */
262 XFRM_AE_CU=64, /* Event cause is policy update */
263 __XFRM_AE_MAX
264
265#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
266};
267
268struct xfrm_userpolicy_type {
269 __u8 type;
270 __u16 reserved1;
271 __u8 reserved2;
272};
273
274/* Netlink message attributes. */
275enum xfrm_attr_type_t {
276 XFRMA_UNSPEC,
277 XFRMA_ALG_AUTH, /* struct xfrm_algo */
278 XFRMA_ALG_CRYPT, /* struct xfrm_algo */
279 XFRMA_ALG_COMP, /* struct xfrm_algo */
280 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
281 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
282 XFRMA_SA, /* struct xfrm_usersa_info */
283 XFRMA_POLICY, /*struct xfrm_userpolicy_info */
284 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
285 XFRMA_LTIME_VAL,
286 XFRMA_REPLAY_VAL,
287 XFRMA_REPLAY_THRESH,
288 XFRMA_ETIMER_THRESH,
289 XFRMA_SRCADDR, /* xfrm_address_t */
290 XFRMA_COADDR, /* xfrm_address_t */
291 XFRMA_LASTUSED, /* unsigned long */
292 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
293 XFRMA_MIGRATE,
294 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
295 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
296 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
297 XFRMA_MARK, /* struct xfrm_mark */
298 XFRMA_TFCPAD, /* __u32 */
299 XFRMA_REPLAY_ESN_VAL, /* struct xfrm_replay_esn */
300 __XFRMA_MAX
301
302#define XFRMA_MAX (__XFRMA_MAX - 1)
303};
304
305struct xfrm_mark {
306 __u32 v; /* value */
307 __u32 m; /* mask */
308};
309
310enum xfrm_sadattr_type_t {
311 XFRMA_SAD_UNSPEC,
312 XFRMA_SAD_CNT,
313 XFRMA_SAD_HINFO,
314 __XFRMA_SAD_MAX
315
316#define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1)
317};
318
319struct xfrmu_sadhinfo {
320 __u32 sadhcnt; /* current hash bkts */
321 __u32 sadhmcnt; /* max allowed hash bkts */
322};
323
324enum xfrm_spdattr_type_t {
325 XFRMA_SPD_UNSPEC,
326 XFRMA_SPD_INFO,
327 XFRMA_SPD_HINFO,
328 __XFRMA_SPD_MAX
329
330#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1)
331};
332
333struct xfrmu_spdinfo {
334 __u32 incnt;
335 __u32 outcnt;
336 __u32 fwdcnt;
337 __u32 inscnt;
338 __u32 outscnt;
339 __u32 fwdscnt;
340};
341
342struct xfrmu_spdhinfo {
343 __u32 spdhcnt;
344 __u32 spdhmcnt;
345};
346
347struct xfrm_usersa_info {
348 struct xfrm_selector sel;
349 struct xfrm_id id;
350 xfrm_address_t saddr;
351 struct xfrm_lifetime_cfg lft;
352 struct xfrm_lifetime_cur curlft;
353 struct xfrm_stats stats;
354 __u32 seq;
355 __u32 reqid;
356 __u16 family;
357 __u8 mode; /* XFRM_MODE_xxx */
358 __u8 replay_window;
359 __u8 flags;
360#define XFRM_STATE_NOECN 1
361#define XFRM_STATE_DECAP_DSCP 2
362#define XFRM_STATE_NOPMTUDISC 4
363#define XFRM_STATE_WILDRECV 8
364#define XFRM_STATE_ICMP 16
365#define XFRM_STATE_AF_UNSPEC 32
366#define XFRM_STATE_ALIGN4 64
367#define XFRM_STATE_ESN 128
368};
369
370struct xfrm_usersa_id {
371 xfrm_address_t daddr;
372 __be32 spi;
373 __u16 family;
374 __u8 proto;
375};
376
377struct xfrm_aevent_id {
378 struct xfrm_usersa_id sa_id;
379 xfrm_address_t saddr;
380 __u32 flags;
381 __u32 reqid;
382};
383
384struct xfrm_userspi_info {
385 struct xfrm_usersa_info info;
386 __u32 min;
387 __u32 max;
388};
389
390struct xfrm_userpolicy_info {
391 struct xfrm_selector sel;
392 struct xfrm_lifetime_cfg lft;
393 struct xfrm_lifetime_cur curlft;
394 __u32 priority;
395 __u32 index;
396 __u8 dir;
397 __u8 action;
398#define XFRM_POLICY_ALLOW 0
399#define XFRM_POLICY_BLOCK 1
400 __u8 flags;
401#define XFRM_POLICY_LOCALOK 1 /* Allow user to override global policy */
402 /* Automatically expand selector to include matching ICMP payloads. */
403#define XFRM_POLICY_ICMP 2
404 __u8 share;
405};
406
407struct xfrm_userpolicy_id {
408 struct xfrm_selector sel;
409 __u32 index;
410 __u8 dir;
411};
412
413struct xfrm_user_acquire {
414 struct xfrm_id id;
415 xfrm_address_t saddr;
416 struct xfrm_selector sel;
417 struct xfrm_userpolicy_info policy;
418 __u32 aalgos;
419 __u32 ealgos;
420 __u32 calgos;
421 __u32 seq;
422};
423
424struct xfrm_user_expire {
425 struct xfrm_usersa_info state;
426 __u8 hard;
427};
428
429struct xfrm_user_polexpire {
430 struct xfrm_userpolicy_info pol;
431 __u8 hard;
432};
433
434struct xfrm_usersa_flush {
435 __u8 proto;
436};
437
438struct xfrm_user_report {
439 __u8 proto;
440 struct xfrm_selector sel;
441};
442
443/* Used by MIGRATE to pass addresses IKE should use to perform
444 * SA negotiation with the peer */
445struct xfrm_user_kmaddress {
446 xfrm_address_t local;
447 xfrm_address_t remote;
448 __u32 reserved;
449 __u16 family;
450};
451
452struct xfrm_user_migrate {
453 xfrm_address_t old_daddr;
454 xfrm_address_t old_saddr;
455 xfrm_address_t new_daddr;
456 xfrm_address_t new_saddr;
457 __u8 proto;
458 __u8 mode;
459 __u16 reserved;
460 __u32 reqid;
461 __u16 old_family;
462 __u16 new_family;
463};
464
465struct xfrm_user_mapping {
466 struct xfrm_usersa_id id;
467 __u32 reqid;
468 xfrm_address_t old_saddr;
469 xfrm_address_t new_saddr;
470 __be16 old_sport;
471 __be16 new_sport;
472};
473
474#ifndef __KERNEL__
475/* backwards compatibility for userspace */
476#define XFRMGRP_ACQUIRE 1
477#define XFRMGRP_EXPIRE 2
478#define XFRMGRP_SA 4
479#define XFRMGRP_POLICY 8
480#define XFRMGRP_REPORT 0x20
481#endif
482
483enum xfrm_nlgroups {
484 XFRMNLGRP_NONE,
485#define XFRMNLGRP_NONE XFRMNLGRP_NONE
486 XFRMNLGRP_ACQUIRE,
487#define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE
488 XFRMNLGRP_EXPIRE,
489#define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE
490 XFRMNLGRP_SA,
491#define XFRMNLGRP_SA XFRMNLGRP_SA
492 XFRMNLGRP_POLICY,
493#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
494 XFRMNLGRP_AEVENTS,
495#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
496 XFRMNLGRP_REPORT,
497#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
498 XFRMNLGRP_MIGRATE,
499#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
500 XFRMNLGRP_MAPPING,
501#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
502 __XFRMNLGRP_MAX
503};
504#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
505
506#endif /* _LINUX_XFRM_H */