UAPI: (Scripted) Disintegrate include/linux
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
This commit is contained in:
Родитель
08cce05c5a
Коммит
607ca46e97
|
@ -22,389 +22,10 @@ header-y += wimax/
|
|||
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
|
||||
header-y += a.out.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
|
||||
header-y += kvm.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
|
||||
header-y += kvm_para.h
|
||||
endif
|
||||
|
||||
header-y += acct.h
|
||||
header-y += adb.h
|
||||
header-y += adfs_fs.h
|
||||
header-y += affs_hardblocks.h
|
||||
header-y += agpgart.h
|
||||
header-y += aio_abi.h
|
||||
header-y += apm_bios.h
|
||||
header-y += arcfb.h
|
||||
header-y += atalk.h
|
||||
header-y += atm.h
|
||||
header-y += atm_eni.h
|
||||
header-y += atm_he.h
|
||||
header-y += atm_idt77105.h
|
||||
header-y += atm_nicstar.h
|
||||
header-y += atm_tcp.h
|
||||
header-y += atm_zatm.h
|
||||
header-y += atmapi.h
|
||||
header-y += atmarp.h
|
||||
header-y += atmbr2684.h
|
||||
header-y += atmclip.h
|
||||
header-y += atmdev.h
|
||||
header-y += atmioc.h
|
||||
header-y += atmlec.h
|
||||
header-y += atmmpc.h
|
||||
header-y += atmppp.h
|
||||
header-y += atmsap.h
|
||||
header-y += atmsvc.h
|
||||
header-y += audit.h
|
||||
header-y += auto_fs.h
|
||||
header-y += auto_fs4.h
|
||||
header-y += auxvec.h
|
||||
header-y += ax25.h
|
||||
header-y += b1lli.h
|
||||
header-y += baycom.h
|
||||
header-y += bfs_fs.h
|
||||
header-y += binfmts.h
|
||||
header-y += blkpg.h
|
||||
header-y += blktrace_api.h
|
||||
header-y += bpqether.h
|
||||
header-y += bsg.h
|
||||
header-y += can.h
|
||||
header-y += capability.h
|
||||
header-y += capi.h
|
||||
header-y += cciss_defs.h
|
||||
header-y += cciss_ioctl.h
|
||||
header-y += cdrom.h
|
||||
header-y += cgroupstats.h
|
||||
header-y += chio.h
|
||||
header-y += cm4000_cs.h
|
||||
header-y += cn_proc.h
|
||||
header-y += coda.h
|
||||
header-y += coda_psdev.h
|
||||
header-y += coff.h
|
||||
header-y += connector.h
|
||||
header-y += const.h
|
||||
header-y += cramfs_fs.h
|
||||
header-y += cuda.h
|
||||
header-y += cyclades.h
|
||||
header-y += cycx_cfm.h
|
||||
header-y += dcbnl.h
|
||||
header-y += dccp.h
|
||||
header-y += dlm.h
|
||||
header-y += dlm_device.h
|
||||
header-y += dlm_netlink.h
|
||||
header-y += dlm_plock.h
|
||||
header-y += dlmconstants.h
|
||||
header-y += dm-ioctl.h
|
||||
header-y += dm-log-userspace.h
|
||||
header-y += dn.h
|
||||
header-y += dqblk_xfs.h
|
||||
header-y += edd.h
|
||||
header-y += efs_fs_sb.h
|
||||
header-y += elf-em.h
|
||||
header-y += elf-fdpic.h
|
||||
header-y += elf.h
|
||||
header-y += elfcore.h
|
||||
header-y += errno.h
|
||||
header-y += errqueue.h
|
||||
header-y += ethtool.h
|
||||
header-y += eventpoll.h
|
||||
header-y += fadvise.h
|
||||
header-y += falloc.h
|
||||
header-y += fanotify.h
|
||||
header-y += fb.h
|
||||
header-y += fcntl.h
|
||||
header-y += fd.h
|
||||
header-y += fdreg.h
|
||||
header-y += fib_rules.h
|
||||
header-y += fiemap.h
|
||||
header-y += filter.h
|
||||
header-y += firewire-cdev.h
|
||||
header-y += firewire-constants.h
|
||||
header-y += flat.h
|
||||
header-y += fs.h
|
||||
header-y += fsl_hypervisor.h
|
||||
header-y += fuse.h
|
||||
header-y += futex.h
|
||||
header-y += gameport.h
|
||||
header-y += gen_stats.h
|
||||
header-y += genetlink.h
|
||||
header-y += gfs2_ondisk.h
|
||||
header-y += gigaset_dev.h
|
||||
header-y += hdlc.h
|
||||
header-y += hdlcdrv.h
|
||||
header-y += hdreg.h
|
||||
header-y += hid.h
|
||||
header-y += hiddev.h
|
||||
header-y += hidraw.h
|
||||
header-y += hpet.h
|
||||
header-y += hysdn_if.h
|
||||
header-y += i2c-dev.h
|
||||
header-y += i2c.h
|
||||
header-y += i2o-dev.h
|
||||
header-y += i8k.h
|
||||
header-y += icmp.h
|
||||
header-y += icmpv6.h
|
||||
header-y += if.h
|
||||
header-y += if_addr.h
|
||||
header-y += if_addrlabel.h
|
||||
header-y += if_alg.h
|
||||
header-y += if_arcnet.h
|
||||
header-y += if_arp.h
|
||||
header-y += if_bonding.h
|
||||
header-y += if_bridge.h
|
||||
header-y += if_cablemodem.h
|
||||
header-y += if_eql.h
|
||||
header-y += if_ether.h
|
||||
header-y += if_fc.h
|
||||
header-y += if_fddi.h
|
||||
header-y += if_frad.h
|
||||
header-y += if_hippi.h
|
||||
header-y += if_infiniband.h
|
||||
header-y += if_link.h
|
||||
header-y += if_ltalk.h
|
||||
header-y += if_packet.h
|
||||
header-y += if_phonet.h
|
||||
header-y += if_plip.h
|
||||
header-y += if_ppp.h
|
||||
header-y += if_pppol2tp.h
|
||||
header-y += if_pppox.h
|
||||
header-y += if_slip.h
|
||||
header-y += if_team.h
|
||||
header-y += if_tun.h
|
||||
header-y += if_tunnel.h
|
||||
header-y += if_vlan.h
|
||||
header-y += if_x25.h
|
||||
header-y += igmp.h
|
||||
header-y += in.h
|
||||
header-y += in6.h
|
||||
header-y += in_route.h
|
||||
header-y += sock_diag.h
|
||||
header-y += inet_diag.h
|
||||
header-y += unix_diag.h
|
||||
header-y += packet_diag.h
|
||||
header-y += inotify.h
|
||||
header-y += input.h
|
||||
header-y += ioctl.h
|
||||
header-y += ip.h
|
||||
header-y += ip6_tunnel.h
|
||||
header-y += ip_vs.h
|
||||
header-y += ipc.h
|
||||
header-y += ipmi.h
|
||||
header-y += ipmi_msgdefs.h
|
||||
header-y += ipsec.h
|
||||
header-y += ipv6.h
|
||||
header-y += ipv6_route.h
|
||||
header-y += ipx.h
|
||||
header-y += irda.h
|
||||
header-y += irqnr.h
|
||||
header-y += isdn.h
|
||||
header-y += isdn_divertif.h
|
||||
header-y += isdn_ppp.h
|
||||
header-y += isdnif.h
|
||||
header-y += iso_fs.h
|
||||
header-y += ivtv.h
|
||||
header-y += ivtvfb.h
|
||||
header-y += ixjuser.h
|
||||
header-y += jffs2.h
|
||||
header-y += joystick.h
|
||||
header-y += kd.h
|
||||
header-y += kdev_t.h
|
||||
header-y += kernel.h
|
||||
header-y += kernelcapi.h
|
||||
header-y += kernel-page-flags.h
|
||||
header-y += kexec.h
|
||||
header-y += keyboard.h
|
||||
header-y += keyctl.h
|
||||
header-y += l2tp.h
|
||||
header-y += limits.h
|
||||
header-y += llc.h
|
||||
header-y += loop.h
|
||||
header-y += lp.h
|
||||
header-y += magic.h
|
||||
header-y += major.h
|
||||
header-y += map_to_7segment.h
|
||||
header-y += matroxfb.h
|
||||
header-y += mdio.h
|
||||
header-y += media.h
|
||||
header-y += mei.h
|
||||
header-y += mempolicy.h
|
||||
header-y += meye.h
|
||||
header-y += mii.h
|
||||
header-y += minix_fs.h
|
||||
header-y += mman.h
|
||||
header-y += mmtimer.h
|
||||
header-y += mqueue.h
|
||||
header-y += mroute.h
|
||||
header-y += mroute6.h
|
||||
header-y += msdos_fs.h
|
||||
header-y += msg.h
|
||||
header-y += mtio.h
|
||||
header-y += n_r3964.h
|
||||
header-y += nbd.h
|
||||
header-y += ncp.h
|
||||
header-y += ncp_fs.h
|
||||
header-y += ncp_mount.h
|
||||
header-y += ncp_no.h
|
||||
header-y += neighbour.h
|
||||
header-y += net.h
|
||||
header-y += net_dropmon.h
|
||||
header-y += net_tstamp.h
|
||||
header-y += netdevice.h
|
||||
header-y += netfilter.h
|
||||
header-y += netfilter_arp.h
|
||||
header-y += netfilter_bridge.h
|
||||
header-y += netfilter_decnet.h
|
||||
header-y += netfilter_ipv4.h
|
||||
header-y += netfilter_ipv6.h
|
||||
header-y += netlink.h
|
||||
header-y += netrom.h
|
||||
header-y += nfc.h
|
||||
header-y += nfs.h
|
||||
header-y += nfs2.h
|
||||
header-y += nfs3.h
|
||||
header-y += nfs4.h
|
||||
header-y += nfs4_mount.h
|
||||
header-y += nfs_fs.h
|
||||
header-y += nfs_idmap.h
|
||||
header-y += nfs_mount.h
|
||||
header-y += nfsacl.h
|
||||
header-y += nl80211.h
|
||||
header-y += nubus.h
|
||||
header-y += nvram.h
|
||||
header-y += omap3isp.h
|
||||
header-y += omapfb.h
|
||||
header-y += oom.h
|
||||
header-y += param.h
|
||||
header-y += parport.h
|
||||
header-y += patchkey.h
|
||||
header-y += pci.h
|
||||
header-y += pci_regs.h
|
||||
header-y += perf_event.h
|
||||
header-y += personality.h
|
||||
header-y += pfkeyv2.h
|
||||
header-y += pg.h
|
||||
header-y += phantom.h
|
||||
header-y += phonet.h
|
||||
header-y += pkt_cls.h
|
||||
header-y += pkt_sched.h
|
||||
header-y += pktcdvd.h
|
||||
header-y += pmu.h
|
||||
header-y += poll.h
|
||||
header-y += posix_types.h
|
||||
header-y += ppdev.h
|
||||
header-y += ppp-comp.h
|
||||
header-y += ppp-ioctl.h
|
||||
header-y += ppp_defs.h
|
||||
header-y += pps.h
|
||||
header-y += prctl.h
|
||||
header-y += ptp_clock.h
|
||||
header-y += ptrace.h
|
||||
header-y += qnx4_fs.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += quota.h
|
||||
header-y += radeonfb.h
|
||||
header-y += random.h
|
||||
header-y += raw.h
|
||||
header-y += rds.h
|
||||
header-y += reboot.h
|
||||
header-y += reiserfs_fs.h
|
||||
header-y += reiserfs_xattr.h
|
||||
header-y += resource.h
|
||||
header-y += rfkill.h
|
||||
header-y += romfs_fs.h
|
||||
header-y += rose.h
|
||||
header-y += route.h
|
||||
header-y += rtc.h
|
||||
header-y += rtnetlink.h
|
||||
header-y += scc.h
|
||||
header-y += sched.h
|
||||
header-y += screen_info.h
|
||||
header-y += sdla.h
|
||||
header-y += seccomp.h
|
||||
header-y += securebits.h
|
||||
header-y += selinux_netlink.h
|
||||
header-y += sem.h
|
||||
header-y += serial.h
|
||||
header-y += serial_core.h
|
||||
header-y += serial_reg.h
|
||||
header-y += serio.h
|
||||
header-y += shm.h
|
||||
header-y += signal.h
|
||||
header-y += signalfd.h
|
||||
header-y += snmp.h
|
||||
header-y += socket.h
|
||||
header-y += sockios.h
|
||||
header-y += som.h
|
||||
header-y += sonet.h
|
||||
header-y += sonypi.h
|
||||
header-y += sound.h
|
||||
header-y += soundcard.h
|
||||
header-y += stat.h
|
||||
header-y += stddef.h
|
||||
header-y += string.h
|
||||
header-y += suspend_ioctls.h
|
||||
header-y += swab.h
|
||||
header-y += synclink.h
|
||||
header-y += sysctl.h
|
||||
header-y += sysinfo.h
|
||||
header-y += taskstats.h
|
||||
header-y += tcp.h
|
||||
header-y += tcp_metrics.h
|
||||
header-y += telephony.h
|
||||
header-y += termios.h
|
||||
header-y += time.h
|
||||
header-y += times.h
|
||||
header-y += timex.h
|
||||
header-y += tiocl.h
|
||||
header-y += tipc.h
|
||||
header-y += tipc_config.h
|
||||
header-y += toshiba.h
|
||||
header-y += tty.h
|
||||
header-y += tty_flags.h
|
||||
header-y += types.h
|
||||
header-y += udf_fs_i.h
|
||||
header-y += udp.h
|
||||
header-y += uhid.h
|
||||
header-y += uinput.h
|
||||
header-y += uio.h
|
||||
header-y += ultrasound.h
|
||||
header-y += un.h
|
||||
header-y += unistd.h
|
||||
header-y += usbdevice_fs.h
|
||||
header-y += utime.h
|
||||
header-y += utsname.h
|
||||
header-y += uuid.h
|
||||
header-y += uvcvideo.h
|
||||
header-y += v4l2-common.h
|
||||
header-y += v4l2-controls.h
|
||||
header-y += v4l2-dv-timings.h
|
||||
header-y += v4l2-mediabus.h
|
||||
header-y += v4l2-subdev.h
|
||||
header-y += veth.h
|
||||
header-y += vfio.h
|
||||
header-y += vhost.h
|
||||
header-y += videodev2.h
|
||||
header-y += virtio_9p.h
|
||||
header-y += virtio_balloon.h
|
||||
header-y += virtio_blk.h
|
||||
header-y += virtio_config.h
|
||||
header-y += virtio_console.h
|
||||
header-y += virtio_ids.h
|
||||
header-y += virtio_net.h
|
||||
header-y += virtio_pci.h
|
||||
header-y += virtio_ring.h
|
||||
header-y += virtio_rng.h
|
||||
header-y += vt.h
|
||||
header-y += wait.h
|
||||
header-y += wanrouter.h
|
||||
header-y += watchdog.h
|
||||
header-y += wimax.h
|
||||
header-y += wireless.h
|
||||
header-y += x25.h
|
||||
header-y += xattr.h
|
||||
header-y += xfrm.h
|
||||
|
|
|
@ -1,278 +1,84 @@
|
|||
#ifndef __A_OUT_GNU_H__
|
||||
#define __A_OUT_GNU_H__
|
||||
|
||||
#define __GNU_EXEC_MACROS__
|
||||
|
||||
#ifndef __STRUCT_EXEC_OVERRIDE__
|
||||
|
||||
#include <asm/a.out.h>
|
||||
|
||||
#endif /* __STRUCT_EXEC_OVERRIDE__ */
|
||||
#include <uapi/linux/a.out.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* these go in the N_MACHTYPE field */
|
||||
enum machine_type {
|
||||
#if defined (M_OLDSUN2)
|
||||
M__OLDSUN2 = M_OLDSUN2,
|
||||
#else
|
||||
M_OLDSUN2 = 0,
|
||||
#endif
|
||||
#if defined (M_68010)
|
||||
M__68010 = M_68010,
|
||||
#else
|
||||
M_68010 = 1,
|
||||
#endif
|
||||
#if defined (M_68020)
|
||||
M__68020 = M_68020,
|
||||
#else
|
||||
M_68020 = 2,
|
||||
#endif
|
||||
#if defined (M_SPARC)
|
||||
M__SPARC = M_SPARC,
|
||||
#else
|
||||
M_SPARC = 3,
|
||||
#endif
|
||||
/* skip a bunch so we don't run into any of sun's numbers */
|
||||
M_386 = 100,
|
||||
M_MIPS1 = 151, /* MIPS R3000/R3000 binary */
|
||||
M_MIPS2 = 152 /* MIPS R6000/R4000 binary */
|
||||
};
|
||||
|
||||
#if !defined (N_MAGIC)
|
||||
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
|
||||
#endif
|
||||
#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
|
||||
#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
|
||||
#define N_SET_INFO(exec, magic, type, flags) \
|
||||
((exec).a_info = ((magic) & 0xffff) \
|
||||
| (((int)(type) & 0xff) << 16) \
|
||||
| (((flags) & 0xff) << 24))
|
||||
#define N_SET_MAGIC(exec, magic) \
|
||||
((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
|
||||
|
||||
#define N_SET_MACHTYPE(exec, machtype) \
|
||||
((exec).a_info = \
|
||||
((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
|
||||
|
||||
#define N_SET_FLAGS(exec, flags) \
|
||||
((exec).a_info = \
|
||||
((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
|
||||
|
||||
/* Code indicating object file or impure executable. */
|
||||
#define OMAGIC 0407
|
||||
/* Code indicating pure executable. */
|
||||
#define NMAGIC 0410
|
||||
/* Code indicating demand-paged executable. */
|
||||
#define ZMAGIC 0413
|
||||
/* This indicates a demand-paged executable with the header in the text.
|
||||
The first page is unmapped to help trap NULL pointer references */
|
||||
#define QMAGIC 0314
|
||||
|
||||
/* Code indicating core file. */
|
||||
#define CMAGIC 0421
|
||||
|
||||
#if !defined (N_BADMAG)
|
||||
#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
|
||||
&& N_MAGIC(x) != NMAGIC \
|
||||
&& N_MAGIC(x) != ZMAGIC \
|
||||
&& N_MAGIC(x) != QMAGIC)
|
||||
#endif
|
||||
|
||||
#define _N_HDROFF(x) (1024 - sizeof (struct exec))
|
||||
|
||||
#if !defined (N_TXTOFF)
|
||||
#define N_TXTOFF(x) \
|
||||
(N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
|
||||
(N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
|
||||
#endif
|
||||
|
||||
#if !defined (N_DATOFF)
|
||||
#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
|
||||
#endif
|
||||
|
||||
#if !defined (N_TRELOFF)
|
||||
#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
|
||||
#endif
|
||||
|
||||
#if !defined (N_DRELOFF)
|
||||
#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
|
||||
#endif
|
||||
|
||||
#if !defined (N_SYMOFF)
|
||||
#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
|
||||
#endif
|
||||
|
||||
#if !defined (N_STROFF)
|
||||
#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
|
||||
#endif
|
||||
|
||||
/* Address of text segment in memory after it is loaded. */
|
||||
#if !defined (N_TXTADDR)
|
||||
#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
|
||||
#endif
|
||||
|
||||
/* Address of data segment in memory after it is loaded.
|
||||
Note that it is up to you to define SEGMENT_SIZE
|
||||
on machines not listed here. */
|
||||
#if defined(vax) || defined(hp300) || defined(pyr)
|
||||
#define SEGMENT_SIZE page_size
|
||||
#endif
|
||||
#ifdef sony
|
||||
#define SEGMENT_SIZE 0x2000
|
||||
#endif /* Sony. */
|
||||
#ifdef is68k
|
||||
#define SEGMENT_SIZE 0x20000
|
||||
#endif
|
||||
#if defined(m68k) && defined(PORTAR)
|
||||
#define PAGE_SIZE 0x400
|
||||
#define SEGMENT_SIZE PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#ifdef linux
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/page.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(__i386__) || defined(__mc68000__)
|
||||
#define SEGMENT_SIZE 1024
|
||||
#else
|
||||
#ifndef SEGMENT_SIZE
|
||||
#ifdef __KERNEL__
|
||||
#define SEGMENT_SIZE PAGE_SIZE
|
||||
#else
|
||||
#define SEGMENT_SIZE getpagesize()
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
|
||||
|
||||
#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
|
||||
|
||||
#ifndef N_DATADDR
|
||||
#define N_DATADDR(x) \
|
||||
(N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
|
||||
: (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
|
||||
#endif
|
||||
|
||||
/* Address of bss segment in memory after it is loaded. */
|
||||
#if !defined (N_BSSADDR)
|
||||
#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
|
||||
#endif
|
||||
|
||||
#if !defined (N_NLIST_DECLARED)
|
||||
struct nlist {
|
||||
union {
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx;
|
||||
} n_un;
|
||||
unsigned char n_type;
|
||||
char n_other;
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
#endif /* no N_NLIST_DECLARED. */
|
||||
|
||||
#if !defined (N_UNDF)
|
||||
#define N_UNDF 0
|
||||
#endif
|
||||
#if !defined (N_ABS)
|
||||
#define N_ABS 2
|
||||
#endif
|
||||
#if !defined (N_TEXT)
|
||||
#define N_TEXT 4
|
||||
#endif
|
||||
#if !defined (N_DATA)
|
||||
#define N_DATA 6
|
||||
#endif
|
||||
#if !defined (N_BSS)
|
||||
#define N_BSS 8
|
||||
#endif
|
||||
#if !defined (N_FN)
|
||||
#define N_FN 15
|
||||
#endif
|
||||
|
||||
#if !defined (N_EXT)
|
||||
#define N_EXT 1
|
||||
#endif
|
||||
#if !defined (N_TYPE)
|
||||
#define N_TYPE 036
|
||||
#endif
|
||||
#if !defined (N_STAB)
|
||||
#define N_STAB 0340
|
||||
#endif
|
||||
|
||||
/* The following type indicates the definition of a symbol as being
|
||||
an indirect reference to another symbol. The other symbol
|
||||
appears as an undefined reference, immediately following this symbol.
|
||||
|
||||
Indirection is asymmetrical. The other symbol's value will be used
|
||||
to satisfy requests for the indirect symbol, but not vice versa.
|
||||
If the other symbol does not have a definition, libraries will
|
||||
be searched to find a definition. */
|
||||
#define N_INDR 0xa
|
||||
|
||||
/* The following symbols refer to set elements.
|
||||
All the N_SET[ATDB] symbols with the same name form one set.
|
||||
Space is allocated for the set in the text section, and each set
|
||||
element's value is stored into one word of the space.
|
||||
The first word of the space is the length of the set (number of elements).
|
||||
|
||||
The address of the set is made into an N_SETV symbol
|
||||
whose name is the same as the name of the set.
|
||||
This symbol acts like a N_DATA global symbol
|
||||
in that it can satisfy undefined external references. */
|
||||
|
||||
/* These appear as input to LD, in a .o file. */
|
||||
#define N_SETA 0x14 /* Absolute set element symbol */
|
||||
#define N_SETT 0x16 /* Text set element symbol */
|
||||
#define N_SETD 0x18 /* Data set element symbol */
|
||||
#define N_SETB 0x1A /* Bss set element symbol */
|
||||
|
||||
/* This is output from LD. */
|
||||
#define N_SETV 0x1C /* Pointer to set vector in data area. */
|
||||
|
||||
#if !defined (N_RELOCATION_INFO_DECLARED)
|
||||
/* This structure describes a single relocation to be performed.
|
||||
The text-relocation section of the file is a vector of these structures,
|
||||
all of which apply to the text section.
|
||||
Likewise, the data-relocation section applies to the data section. */
|
||||
|
||||
struct relocation_info
|
||||
{
|
||||
/* Address (within segment) to be relocated. */
|
||||
int r_address;
|
||||
/* The meaning of r_symbolnum depends on r_extern. */
|
||||
unsigned int r_symbolnum:24;
|
||||
/* Nonzero means value is a pc-relative offset
|
||||
and it should be relocated for changes in its own address
|
||||
as well as for changes in the symbol or section specified. */
|
||||
unsigned int r_pcrel:1;
|
||||
/* Length (as exponent of 2) of the field to be relocated.
|
||||
Thus, a value of 2 indicates 1<<2 bytes. */
|
||||
unsigned int r_length:2;
|
||||
/* 1 => relocate with value of symbol.
|
||||
r_symbolnum is the index of the symbol
|
||||
in file's the symbol table.
|
||||
0 => relocate with the address of a segment.
|
||||
r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
|
||||
(the N_EXT bit may be set also, but signifies nothing). */
|
||||
unsigned int r_extern:1;
|
||||
/* Four bits that aren't used, but when writing an object file
|
||||
it is desirable to clear them. */
|
||||
#ifdef NS32K
|
||||
unsigned r_bsr:1;
|
||||
unsigned r_disp:1;
|
||||
unsigned r_pad:2;
|
||||
#else
|
||||
unsigned int r_pad:4;
|
||||
#endif
|
||||
};
|
||||
#endif /* no N_RELOCATION_INFO_DECLARED. */
|
||||
|
||||
#endif /*__ASSEMBLY__ */
|
||||
#endif /* __A_OUT_GNU_H__ */
|
||||
|
|
|
@ -11,109 +11,11 @@
|
|||
* Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ACCT_H
|
||||
#define _LINUX_ACCT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/acct.h>
|
||||
|
||||
#include <asm/param.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/*
|
||||
* comp_t is a 16-bit "floating" point number with a 3-bit base 8
|
||||
* exponent and a 13-bit fraction.
|
||||
* comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
|
||||
* (leading 1 not stored).
|
||||
* See linux/kernel/acct.c for the specific encoding systems used.
|
||||
*/
|
||||
|
||||
typedef __u16 comp_t;
|
||||
typedef __u32 comp2_t;
|
||||
|
||||
/*
|
||||
* accounting file record
|
||||
*
|
||||
* This structure contains all of the information written out to the
|
||||
* process accounting file whenever a process exits.
|
||||
*/
|
||||
|
||||
#define ACCT_COMM 16
|
||||
|
||||
struct acct
|
||||
{
|
||||
char ac_flag; /* Flags */
|
||||
char ac_version; /* Always set to ACCT_VERSION */
|
||||
/* for binary compatibility back until 2.0 */
|
||||
__u16 ac_uid16; /* LSB of Real User ID */
|
||||
__u16 ac_gid16; /* LSB of Real Group ID */
|
||||
__u16 ac_tty; /* Control Terminal */
|
||||
__u32 ac_btime; /* Process Creation Time */
|
||||
comp_t ac_utime; /* User Time */
|
||||
comp_t ac_stime; /* System Time */
|
||||
comp_t ac_etime; /* Elapsed Time */
|
||||
comp_t ac_mem; /* Average Memory Usage */
|
||||
comp_t ac_io; /* Chars Transferred */
|
||||
comp_t ac_rw; /* Blocks Read or Written */
|
||||
comp_t ac_minflt; /* Minor Pagefaults */
|
||||
comp_t ac_majflt; /* Major Pagefaults */
|
||||
comp_t ac_swaps; /* Number of Swaps */
|
||||
/* m68k had no padding here. */
|
||||
#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
|
||||
__u16 ac_ahz; /* AHZ */
|
||||
#endif
|
||||
__u32 ac_exitcode; /* Exitcode */
|
||||
char ac_comm[ACCT_COMM + 1]; /* Command Name */
|
||||
__u8 ac_etime_hi; /* Elapsed Time MSB */
|
||||
__u16 ac_etime_lo; /* Elapsed Time LSB */
|
||||
__u32 ac_uid; /* Real User ID */
|
||||
__u32 ac_gid; /* Real Group ID */
|
||||
};
|
||||
|
||||
struct acct_v3
|
||||
{
|
||||
char ac_flag; /* Flags */
|
||||
char ac_version; /* Always set to ACCT_VERSION */
|
||||
__u16 ac_tty; /* Control Terminal */
|
||||
__u32 ac_exitcode; /* Exitcode */
|
||||
__u32 ac_uid; /* Real User ID */
|
||||
__u32 ac_gid; /* Real Group ID */
|
||||
__u32 ac_pid; /* Process ID */
|
||||
__u32 ac_ppid; /* Parent Process ID */
|
||||
__u32 ac_btime; /* Process Creation Time */
|
||||
#ifdef __KERNEL__
|
||||
__u32 ac_etime; /* Elapsed Time */
|
||||
#else
|
||||
float ac_etime; /* Elapsed Time */
|
||||
#endif
|
||||
comp_t ac_utime; /* User Time */
|
||||
comp_t ac_stime; /* System Time */
|
||||
comp_t ac_mem; /* Average Memory Usage */
|
||||
comp_t ac_io; /* Chars Transferred */
|
||||
comp_t ac_rw; /* Blocks Read or Written */
|
||||
comp_t ac_minflt; /* Minor Pagefaults */
|
||||
comp_t ac_majflt; /* Major Pagefaults */
|
||||
comp_t ac_swaps; /* Number of Swaps */
|
||||
char ac_comm[ACCT_COMM]; /* Command Name */
|
||||
};
|
||||
|
||||
/*
|
||||
* accounting flags
|
||||
*/
|
||||
/* bit set when the process ... */
|
||||
#define AFORK 0x01 /* ... executed fork, but did not exec */
|
||||
#define ASU 0x02 /* ... used super-user privileges */
|
||||
#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
|
||||
#define ACORE 0x08 /* ... dumped core */
|
||||
#define AXSIG 0x10 /* ... was killed by a signal */
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
|
||||
#else
|
||||
#define ACCT_BYTEORDER 0x00 /* accounting file is little endian */
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
||||
#ifdef CONFIG_BSD_PROCESS_ACCT
|
||||
|
@ -163,12 +65,6 @@ typedef struct acct_v3 acct_t;
|
|||
typedef struct acct acct_t;
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define ACCT_VERSION 2
|
||||
#define AHZ (HZ)
|
||||
#endif /* __KERNEL */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/jiffies.h>
|
||||
/*
|
||||
* Yet another set of HZ to *HZ helper functions.
|
||||
|
@ -210,6 +106,4 @@ static inline u64 nsec_to_AHZ(u64 x)
|
|||
return x;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL */
|
||||
|
||||
#endif /* _LINUX_ACCT_H */
|
||||
|
|
|
@ -4,43 +4,8 @@
|
|||
#ifndef __ADB_H
|
||||
#define __ADB_H
|
||||
|
||||
/* ADB commands */
|
||||
#define ADB_BUSRESET 0
|
||||
#define ADB_FLUSH(id) (0x01 | ((id) << 4))
|
||||
#define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
|
||||
#define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
|
||||
#include <uapi/linux/adb.h>
|
||||
|
||||
/* ADB default device IDs (upper 4 bits of ADB command byte) */
|
||||
#define ADB_DONGLE 1 /* "software execution control" devices */
|
||||
#define ADB_KEYBOARD 2
|
||||
#define ADB_MOUSE 3
|
||||
#define ADB_TABLET 4
|
||||
#define ADB_MODEM 5
|
||||
#define ADB_MISC 7 /* maybe a monitor */
|
||||
|
||||
#define ADB_RET_OK 0
|
||||
#define ADB_RET_TIMEOUT 3
|
||||
|
||||
/* The kind of ADB request. The controller may emulate some
|
||||
or all of those CUDA/PMU packet kinds */
|
||||
#define ADB_PACKET 0
|
||||
#define CUDA_PACKET 1
|
||||
#define ERROR_PACKET 2
|
||||
#define TIMER_PACKET 3
|
||||
#define POWER_PACKET 4
|
||||
#define MACIIC_PACKET 5
|
||||
#define PMU_PACKET 6
|
||||
#define ADB_QUERY 7
|
||||
|
||||
/* ADB queries */
|
||||
|
||||
/* ADB_QUERY_GETDEVINFO
|
||||
* Query ADB slot for device presence
|
||||
* data[2] = id, rep[0] = orig addr, rep[1] = handler_id
|
||||
*/
|
||||
#define ADB_QUERY_GETDEVINFO 1
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct adb_request {
|
||||
unsigned char data[32];
|
||||
|
@ -98,6 +63,4 @@ int adb_reset_bus(void);
|
|||
int adb_try_handler_change(int address, int new_id);
|
||||
int adb_get_infos(int address, int *original_address, int *handler_id);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ADB_H */
|
||||
|
|
|
@ -1,46 +1,8 @@
|
|||
#ifndef _ADFS_FS_H
|
||||
#define _ADFS_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
#include <uapi/linux/adfs_fs.h>
|
||||
|
||||
/*
|
||||
* Disc Record at disc address 0xc00
|
||||
*/
|
||||
struct adfs_discrecord {
|
||||
__u8 log2secsize;
|
||||
__u8 secspertrack;
|
||||
__u8 heads;
|
||||
__u8 density;
|
||||
__u8 idlen;
|
||||
__u8 log2bpmb;
|
||||
__u8 skew;
|
||||
__u8 bootoption;
|
||||
__u8 lowsector;
|
||||
__u8 nzones;
|
||||
__le16 zone_spare;
|
||||
__le32 root;
|
||||
__le32 disc_size;
|
||||
__le16 disc_id;
|
||||
__u8 disc_name[10];
|
||||
__le32 disc_type;
|
||||
__le32 disc_size_high;
|
||||
__u8 log2sharesize:4;
|
||||
__u8 unused40:4;
|
||||
__u8 big_flag:1;
|
||||
__u8 unused41:1;
|
||||
__u8 nzones_high;
|
||||
__le32 format_version;
|
||||
__le32 root_size;
|
||||
__u8 unused52[60 - 52];
|
||||
};
|
||||
|
||||
#define ADFS_DISCRECORD (0xc00)
|
||||
#define ADFS_DR_OFFSET (0x1c0)
|
||||
#define ADFS_DR_SIZE 60
|
||||
#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/*
|
||||
* Calculate the boot block checksum on an ADFS drive. Note that this will
|
||||
* appear to be correct if the sector contains all zeros, so also check that
|
||||
|
@ -59,5 +21,3 @@ static inline int adfs_checkbblk(unsigned char *ptr)
|
|||
return (result & 0xff) != ptr[511];
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,94 +23,12 @@
|
|||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AGP_H
|
||||
#define _AGP_H 1
|
||||
|
||||
#define AGPIOC_BASE 'A'
|
||||
#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
|
||||
#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
|
||||
#define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
|
||||
#define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
|
||||
#define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
|
||||
#define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
|
||||
#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
|
||||
#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
|
||||
#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
|
||||
#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
|
||||
#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
|
||||
|
||||
#define AGP_DEVICE "/dev/agpgart"
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <linux/types.h>
|
||||
|
||||
struct agp_version {
|
||||
__u16 major;
|
||||
__u16 minor;
|
||||
};
|
||||
|
||||
typedef struct _agp_info {
|
||||
struct agp_version version; /* version of the driver */
|
||||
__u32 bridge_id; /* bridge vendor/device */
|
||||
__u32 agp_mode; /* mode info of bridge */
|
||||
unsigned long aper_base;/* base of aperture */
|
||||
size_t aper_size; /* size of aperture */
|
||||
size_t pg_total; /* max pages (swap + system) */
|
||||
size_t pg_system; /* max pages (system) */
|
||||
size_t pg_used; /* current pages used */
|
||||
} agp_info;
|
||||
|
||||
typedef struct _agp_setup {
|
||||
__u32 agp_mode; /* mode info of bridge */
|
||||
} agp_setup;
|
||||
|
||||
/*
|
||||
* The "prot" down below needs still a "sleep" flag somehow ...
|
||||
*/
|
||||
typedef struct _agp_segment {
|
||||
__kernel_off_t pg_start; /* starting page to populate */
|
||||
__kernel_size_t pg_count; /* number of pages */
|
||||
int prot; /* prot flags for mmap */
|
||||
} agp_segment;
|
||||
|
||||
typedef struct _agp_region {
|
||||
__kernel_pid_t pid; /* pid of process */
|
||||
__kernel_size_t seg_count; /* number of segments */
|
||||
struct _agp_segment *seg_list;
|
||||
} agp_region;
|
||||
|
||||
typedef struct _agp_allocate {
|
||||
int key; /* tag of allocation */
|
||||
__kernel_size_t pg_count;/* number of pages */
|
||||
__u32 type; /* 0 == normal, other devspec */
|
||||
__u32 physical; /* device specific (some devices
|
||||
* need a phys address of the
|
||||
* actual page behind the gatt
|
||||
* table) */
|
||||
} agp_allocate;
|
||||
|
||||
typedef struct _agp_bind {
|
||||
int key; /* tag of allocation */
|
||||
__kernel_off_t pg_start;/* starting page to populate */
|
||||
} agp_bind;
|
||||
|
||||
typedef struct _agp_unbind {
|
||||
int key; /* tag of allocation */
|
||||
__u32 priority; /* priority for paging out */
|
||||
} agp_unbind;
|
||||
|
||||
#else /* __KERNEL__ */
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/agp_backend.h>
|
||||
#include <uapi/linux/agpgart.h>
|
||||
|
||||
#define AGPGART_MINOR 175
|
||||
|
||||
|
@ -209,6 +127,4 @@ struct agp_front_data {
|
|||
bool backend_acquired;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _AGP_H */
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#ifndef _LINUX_APM_H
|
||||
#define _LINUX_APM_H
|
||||
|
||||
/*
|
||||
* Include file for the interface to an APM BIOS
|
||||
* Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
|
||||
|
@ -15,25 +12,11 @@
|
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
#ifndef _LINUX_APM_H
|
||||
#define _LINUX_APM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/apm_bios.h>
|
||||
|
||||
typedef unsigned short apm_event_t;
|
||||
typedef unsigned short apm_eventinfo_t;
|
||||
|
||||
struct apm_bios_info {
|
||||
__u16 version;
|
||||
__u16 cseg;
|
||||
__u32 offset;
|
||||
__u16 cseg_16;
|
||||
__u16 dseg;
|
||||
__u16 flags;
|
||||
__u16 cseg_len;
|
||||
__u16 cseg_16_len;
|
||||
__u16 dseg_len;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
|
||||
#define APM_CS_16 (APM_CS + 8)
|
||||
|
@ -110,111 +93,9 @@ struct apm_info {
|
|||
*/
|
||||
extern struct apm_info apm_info;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/*
|
||||
* Power states
|
||||
*/
|
||||
#define APM_STATE_READY 0x0000
|
||||
#define APM_STATE_STANDBY 0x0001
|
||||
#define APM_STATE_SUSPEND 0x0002
|
||||
#define APM_STATE_OFF 0x0003
|
||||
#define APM_STATE_BUSY 0x0004
|
||||
#define APM_STATE_REJECT 0x0005
|
||||
#define APM_STATE_OEM_SYS 0x0020
|
||||
#define APM_STATE_OEM_DEV 0x0040
|
||||
|
||||
#define APM_STATE_DISABLE 0x0000
|
||||
#define APM_STATE_ENABLE 0x0001
|
||||
|
||||
#define APM_STATE_DISENGAGE 0x0000
|
||||
#define APM_STATE_ENGAGE 0x0001
|
||||
|
||||
/*
|
||||
* Events (results of Get PM Event)
|
||||
*/
|
||||
#define APM_SYS_STANDBY 0x0001
|
||||
#define APM_SYS_SUSPEND 0x0002
|
||||
#define APM_NORMAL_RESUME 0x0003
|
||||
#define APM_CRITICAL_RESUME 0x0004
|
||||
#define APM_LOW_BATTERY 0x0005
|
||||
#define APM_POWER_STATUS_CHANGE 0x0006
|
||||
#define APM_UPDATE_TIME 0x0007
|
||||
#define APM_CRITICAL_SUSPEND 0x0008
|
||||
#define APM_USER_STANDBY 0x0009
|
||||
#define APM_USER_SUSPEND 0x000a
|
||||
#define APM_STANDBY_RESUME 0x000b
|
||||
#define APM_CAPABILITY_CHANGE 0x000c
|
||||
|
||||
/*
|
||||
* Error codes
|
||||
*/
|
||||
#define APM_SUCCESS 0x00
|
||||
#define APM_DISABLED 0x01
|
||||
#define APM_CONNECTED 0x02
|
||||
#define APM_NOT_CONNECTED 0x03
|
||||
#define APM_16_CONNECTED 0x05
|
||||
#define APM_16_UNSUPPORTED 0x06
|
||||
#define APM_32_CONNECTED 0x07
|
||||
#define APM_32_UNSUPPORTED 0x08
|
||||
#define APM_BAD_DEVICE 0x09
|
||||
#define APM_BAD_PARAM 0x0a
|
||||
#define APM_NOT_ENGAGED 0x0b
|
||||
#define APM_BAD_FUNCTION 0x0c
|
||||
#define APM_RESUME_DISABLED 0x0d
|
||||
#define APM_NO_ERROR 0x53
|
||||
#define APM_BAD_STATE 0x60
|
||||
#define APM_NO_EVENTS 0x80
|
||||
#define APM_NOT_PRESENT 0x86
|
||||
|
||||
/*
|
||||
* APM Device IDs
|
||||
*/
|
||||
#define APM_DEVICE_BIOS 0x0000
|
||||
#define APM_DEVICE_ALL 0x0001
|
||||
#define APM_DEVICE_DISPLAY 0x0100
|
||||
#define APM_DEVICE_STORAGE 0x0200
|
||||
#define APM_DEVICE_PARALLEL 0x0300
|
||||
#define APM_DEVICE_SERIAL 0x0400
|
||||
#define APM_DEVICE_NETWORK 0x0500
|
||||
#define APM_DEVICE_PCMCIA 0x0600
|
||||
#define APM_DEVICE_BATTERY 0x8000
|
||||
#define APM_DEVICE_OEM 0xe000
|
||||
#define APM_DEVICE_OLD_ALL 0xffff
|
||||
#define APM_DEVICE_CLASS 0x00ff
|
||||
#define APM_DEVICE_MASK 0xff00
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/*
|
||||
* This is the "All Devices" ID communicated to the BIOS
|
||||
*/
|
||||
#define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \
|
||||
APM_DEVICE_ALL : APM_DEVICE_OLD_ALL)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Battery status
|
||||
*/
|
||||
#define APM_MAX_BATTERIES 2
|
||||
|
||||
/*
|
||||
* APM defined capability bit flags
|
||||
*/
|
||||
#define APM_CAP_GLOBAL_STANDBY 0x0001
|
||||
#define APM_CAP_GLOBAL_SUSPEND 0x0002
|
||||
#define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */
|
||||
#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */
|
||||
#define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */
|
||||
#define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */
|
||||
#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */
|
||||
#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */
|
||||
|
||||
/*
|
||||
* ioctl operations
|
||||
*/
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define APM_IOC_STANDBY _IO('A', 1)
|
||||
#define APM_IOC_SUSPEND _IO('A', 2)
|
||||
|
||||
#endif /* LINUX_APM_H */
|
||||
|
|
|
@ -1,49 +1,9 @@
|
|||
#ifndef __LINUX_ATALK_H__
|
||||
#define __LINUX_ATALK_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/socket.h>
|
||||
|
||||
/*
|
||||
* AppleTalk networking structures
|
||||
*
|
||||
* The following are directly referenced from the University Of Michigan
|
||||
* netatalk for compatibility reasons.
|
||||
*/
|
||||
#define ATPORT_FIRST 1
|
||||
#define ATPORT_RESERVED 128
|
||||
#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
|
||||
#define ATADDR_ANYNET (__u16)0
|
||||
#define ATADDR_ANYNODE (__u8)0
|
||||
#define ATADDR_ANYPORT (__u8)0
|
||||
#define ATADDR_BCAST (__u8)255
|
||||
#define DDP_MAXSZ 587
|
||||
#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
|
||||
|
||||
#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
|
||||
|
||||
struct atalk_addr {
|
||||
__be16 s_net;
|
||||
__u8 s_node;
|
||||
};
|
||||
|
||||
struct sockaddr_at {
|
||||
__kernel_sa_family_t sat_family;
|
||||
__u8 sat_port;
|
||||
struct atalk_addr sat_addr;
|
||||
char sat_zero[8];
|
||||
};
|
||||
|
||||
struct atalk_netrange {
|
||||
__u8 nr_phase;
|
||||
__be16 nr_firstnet;
|
||||
__be16 nr_lastnet;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <net/sock.h>
|
||||
#include <uapi/linux/atalk.h>
|
||||
|
||||
struct atalk_route {
|
||||
struct net_device *dev;
|
||||
|
@ -205,5 +165,4 @@ extern void atalk_proc_exit(void);
|
|||
#define atalk_proc_exit() do { } while(0)
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __LINUX_ATALK_H__ */
|
||||
|
|
|
@ -1,242 +1,9 @@
|
|||
/* atm.h - general ATM declarations */
|
||||
|
||||
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
/*
|
||||
* WARNING: User-space programs should not #include <linux/atm.h> directly.
|
||||
* Instead, #include <atm.h>
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ATM_H
|
||||
#define _LINUX_ATM_H
|
||||
|
||||
/*
|
||||
* BEGIN_xx and END_xx markers are used for automatic generation of
|
||||
* documentation. Do not change them.
|
||||
*/
|
||||
#include <uapi/linux/atm.h>
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmsap.h>
|
||||
#include <linux/atmioc.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
|
||||
/* general ATM constants */
|
||||
#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */
|
||||
#define ATM_CELL_PAYLOAD 48 /* ATM payload size */
|
||||
#define ATM_AAL0_SDU 52 /* AAL0 SDU size */
|
||||
#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */
|
||||
#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */
|
||||
#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */
|
||||
#define ATM_MAX_CDV 9999 /* maximum (default) CDV */
|
||||
#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */
|
||||
|
||||
#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */
|
||||
#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */
|
||||
#define ATM_MAX_VCI 65535 /* maximum VCI */
|
||||
|
||||
|
||||
/* "protcol" values for the socket system call */
|
||||
#define ATM_NO_AAL 0 /* AAL not specified */
|
||||
#define ATM_AAL0 13 /* "raw" ATM cells */
|
||||
#define ATM_AAL1 1 /* AAL1 (CBR) */
|
||||
#define ATM_AAL2 2 /* AAL2 (VBR) */
|
||||
#define ATM_AAL34 3 /* AAL3/4 (data) */
|
||||
#define ATM_AAL5 5 /* AAL5 (data) */
|
||||
|
||||
/*
|
||||
* socket option name coding functions
|
||||
*
|
||||
* Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the
|
||||
* << 22 only reserves 9 bits for the level. On some architectures
|
||||
* SOL_SOCKET is 0xFFFF, so that's a bit of a problem
|
||||
*/
|
||||
|
||||
#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \
|
||||
sizeof(t))
|
||||
#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
|
||||
#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
|
||||
#define __SO_SIZE(c) ((c) & 0x3fff)
|
||||
|
||||
/*
|
||||
* ATM layer
|
||||
*/
|
||||
|
||||
#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
|
||||
/* set CLP bit value - TODO */
|
||||
#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
|
||||
/* connection identifier range; socket must be
|
||||
bound or connected */
|
||||
#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
|
||||
/* Quality of Service setting */
|
||||
#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
|
||||
/* Service Access Point */
|
||||
#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
|
||||
/* "PVC" address (also for SVCs); get only */
|
||||
#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
|
||||
/* make this vc a p2mp */
|
||||
|
||||
|
||||
/*
|
||||
* Note @@@: since the socket layers don't really distinguish the control and
|
||||
* the data plane but generally seems to be data plane-centric, any layer is
|
||||
* about equally wrong for the SAP. If you have a better idea about this,
|
||||
* please speak up ...
|
||||
*/
|
||||
|
||||
|
||||
/* ATM cell header (for AAL0) */
|
||||
|
||||
/* BEGIN_CH */
|
||||
#define ATM_HDR_GFC_MASK 0xf0000000
|
||||
#define ATM_HDR_GFC_SHIFT 28
|
||||
#define ATM_HDR_VPI_MASK 0x0ff00000
|
||||
#define ATM_HDR_VPI_SHIFT 20
|
||||
#define ATM_HDR_VCI_MASK 0x000ffff0
|
||||
#define ATM_HDR_VCI_SHIFT 4
|
||||
#define ATM_HDR_PTI_MASK 0x0000000e
|
||||
#define ATM_HDR_PTI_SHIFT 1
|
||||
#define ATM_HDR_CLP 0x00000001
|
||||
/* END_CH */
|
||||
|
||||
|
||||
/* PTI codings */
|
||||
|
||||
/* BEGIN_PTI */
|
||||
#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */
|
||||
#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */
|
||||
#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */
|
||||
#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */
|
||||
#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */
|
||||
#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */
|
||||
#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */
|
||||
#define ATM_PTI_RSV 7 /* reserved */
|
||||
/* END_PTI */
|
||||
|
||||
|
||||
/*
|
||||
* The following items should stay in linux/atm.h, which should be linked to
|
||||
* netatm/atm.h
|
||||
*/
|
||||
|
||||
/* Traffic description */
|
||||
|
||||
#define ATM_NONE 0 /* no traffic */
|
||||
#define ATM_UBR 1
|
||||
#define ATM_CBR 2
|
||||
#define ATM_VBR 3
|
||||
#define ATM_ABR 4
|
||||
#define ATM_ANYCLASS 5 /* compatible with everything */
|
||||
|
||||
#define ATM_MAX_PCR -1 /* maximum available PCR */
|
||||
|
||||
struct atm_trafprm {
|
||||
unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */
|
||||
int max_pcr; /* maximum PCR in cells per second */
|
||||
int pcr; /* desired PCR in cells per second */
|
||||
int min_pcr; /* minimum PCR in cells per second */
|
||||
int max_cdv; /* maximum CDV in microseconds */
|
||||
int max_sdu; /* maximum SDU in bytes */
|
||||
/* extra params for ABR */
|
||||
unsigned int icr; /* Initial Cell Rate (24-bit) */
|
||||
unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
|
||||
unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */
|
||||
unsigned int rif : 4; /* Rate Increment Factor (4-bit) */
|
||||
unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */
|
||||
unsigned int nrm_pres :1; /* nrm present bit */
|
||||
unsigned int trm_pres :1; /* rm present bit */
|
||||
unsigned int adtf_pres :1; /* adtf present bit */
|
||||
unsigned int cdf_pres :1; /* cdf present bit*/
|
||||
unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */
|
||||
unsigned int trm :3; /* Time between forward RM cells (3-bit) */
|
||||
unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */
|
||||
unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */
|
||||
unsigned int spare :9; /* spare bits */
|
||||
};
|
||||
|
||||
struct atm_qos {
|
||||
struct atm_trafprm txtp; /* parameters in TX direction */
|
||||
struct atm_trafprm rxtp __ATM_API_ALIGN;
|
||||
/* parameters in RX direction */
|
||||
unsigned char aal __ATM_API_ALIGN;
|
||||
};
|
||||
|
||||
/* PVC addressing */
|
||||
|
||||
#define ATM_ITF_ANY -1 /* "magic" PVC address values */
|
||||
#define ATM_VPI_ANY -1
|
||||
#define ATM_VCI_ANY -1
|
||||
#define ATM_VPI_UNSPEC -2
|
||||
#define ATM_VCI_UNSPEC -2
|
||||
|
||||
|
||||
struct sockaddr_atmpvc {
|
||||
unsigned short sap_family; /* address family, AF_ATMPVC */
|
||||
struct { /* PVC address */
|
||||
short itf; /* ATM interface */
|
||||
short vpi; /* VPI (only 8 bits at UNI) */
|
||||
int vci; /* VCI (only 16 bits at UNI) */
|
||||
} sap_addr __ATM_API_ALIGN; /* PVC address */
|
||||
};
|
||||
|
||||
/* SVC addressing */
|
||||
|
||||
#define ATM_ESA_LEN 20 /* ATM End System Address length */
|
||||
#define ATM_E164_LEN 12 /* maximum E.164 number length */
|
||||
|
||||
#define ATM_AFI_DCC 0x39 /* DCC ATM Format */
|
||||
#define ATM_AFI_ICD 0x47 /* ICD ATM Format */
|
||||
#define ATM_AFI_E164 0x45 /* E.164 ATM Format */
|
||||
#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */
|
||||
|
||||
#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */
|
||||
#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */
|
||||
#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */
|
||||
#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */
|
||||
|
||||
#define ATM_LIJ_NONE 0 /* no leaf-initiated join */
|
||||
#define ATM_LIJ 1 /* request joining */
|
||||
#define ATM_LIJ_RPJ 2 /* set to root-prompted join */
|
||||
#define ATM_LIJ_NJ 3 /* set to network join */
|
||||
|
||||
|
||||
struct sockaddr_atmsvc {
|
||||
unsigned short sas_family; /* address family, AF_ATMSVC */
|
||||
struct { /* SVC address */
|
||||
unsigned char prv[ATM_ESA_LEN];/* private ATM address */
|
||||
char pub[ATM_E164_LEN+1]; /* public address (E.164) */
|
||||
/* unused addresses must be bzero'ed */
|
||||
char lij_type; /* role in LIJ call; one of ATM_LIJ* */
|
||||
__u32 lij_id; /* LIJ call identifier */
|
||||
} sas_addr __ATM_API_ALIGN; /* SVC address */
|
||||
};
|
||||
|
||||
|
||||
static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr)
|
||||
{
|
||||
return *addr.sas_addr.prv || *addr.sas_addr.pub;
|
||||
}
|
||||
|
||||
|
||||
static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
|
||||
{
|
||||
return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Some stuff for linux/sockios.h
|
||||
*/
|
||||
|
||||
struct atmif_sioc {
|
||||
int number;
|
||||
int length;
|
||||
void __user *arg;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_COMPAT
|
||||
#include <linux/compat.h>
|
||||
struct compat_atmif_sioc {
|
||||
|
@ -246,6 +13,3 @@ struct compat_atmif_sioc {
|
|||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef unsigned short atm_backend_t;
|
||||
#endif
|
||||
|
|
|
@ -3,62 +3,12 @@
|
|||
|
||||
/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef LINUX_ATM_TCP_H
|
||||
#define LINUX_ATM_TCP_H
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/atmioc.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/atm_tcp.h>
|
||||
|
||||
|
||||
/*
|
||||
* All values in struct atmtcp_hdr are in network byte order
|
||||
*/
|
||||
|
||||
struct atmtcp_hdr {
|
||||
__u16 vpi;
|
||||
__u16 vci;
|
||||
__u32 length; /* ... of data part */
|
||||
};
|
||||
|
||||
/*
|
||||
* All values in struct atmtcp_command are in host byte order
|
||||
*/
|
||||
|
||||
#define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */
|
||||
#define ATMTCP_CTRL_OPEN 1 /* request/reply */
|
||||
#define ATMTCP_CTRL_CLOSE 2 /* request/reply */
|
||||
|
||||
struct atmtcp_control {
|
||||
struct atmtcp_hdr hdr; /* must be first */
|
||||
int type; /* message type; both directions */
|
||||
atm_kptr_t vcc; /* both directions */
|
||||
struct sockaddr_atmpvc addr; /* suggested value from kernel */
|
||||
struct atm_qos qos; /* both directions */
|
||||
int result; /* to kernel only */
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
/*
|
||||
* Field usage:
|
||||
* Messge type dir. hdr.v?i type addr qos vcc result
|
||||
* ----------- ---- ------- ---- ---- --- --- ------
|
||||
* OPEN K->D Y Y Y Y Y 0
|
||||
* OPEN D->K - Y Y Y Y Y
|
||||
* CLOSE K->D - - Y - Y 0
|
||||
* CLOSE D->K - - - - Y Y
|
||||
*/
|
||||
|
||||
#define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */
|
||||
#define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP
|
||||
interface */
|
||||
#define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP
|
||||
interface */
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct atm_tcp_ops {
|
||||
int (*attach)(struct atm_vcc *vcc,int itf);
|
||||
int (*create_persistent)(int itf);
|
||||
|
@ -69,5 +19,3 @@ struct atm_tcp_ops {
|
|||
extern struct atm_tcp_ops atm_tcp_ops;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,218 +1,8 @@
|
|||
/* atmdev.h - ATM device driver declarations and various related items */
|
||||
|
||||
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef LINUX_ATMDEV_H
|
||||
#define LINUX_ATMDEV_H
|
||||
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
||||
#define ESI_LEN 6
|
||||
|
||||
#define ATM_OC3_PCR (155520000/270*260/8/53)
|
||||
/* OC3 link rate: 155520000 bps
|
||||
SONET overhead: /270*260 (9 section, 1 path)
|
||||
bits per cell: /8/53
|
||||
max cell rate: 353207.547 cells/sec */
|
||||
#define ATM_25_PCR ((25600000/8-8000)/54)
|
||||
/* 25 Mbps ATM cell rate (59111) */
|
||||
#define ATM_OC12_PCR (622080000/1080*1040/8/53)
|
||||
/* OC12 link rate: 622080000 bps
|
||||
SONET overhead: /1080*1040
|
||||
bits per cell: /8/53
|
||||
max cell rate: 1412830.188 cells/sec */
|
||||
#define ATM_DS3_PCR (8000*12)
|
||||
/* DS3: 12 cells in a 125 usec time slot */
|
||||
|
||||
|
||||
#define __AAL_STAT_ITEMS \
|
||||
__HANDLE_ITEM(tx); /* TX okay */ \
|
||||
__HANDLE_ITEM(tx_err); /* TX errors */ \
|
||||
__HANDLE_ITEM(rx); /* RX okay */ \
|
||||
__HANDLE_ITEM(rx_err); /* RX errors */ \
|
||||
__HANDLE_ITEM(rx_drop); /* RX out of memory */
|
||||
|
||||
struct atm_aal_stats {
|
||||
#define __HANDLE_ITEM(i) int i
|
||||
__AAL_STAT_ITEMS
|
||||
#undef __HANDLE_ITEM
|
||||
};
|
||||
|
||||
|
||||
struct atm_dev_stats {
|
||||
struct atm_aal_stats aal0;
|
||||
struct atm_aal_stats aal34;
|
||||
struct atm_aal_stats aal5;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
|
||||
#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
|
||||
/* get link rate */
|
||||
#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
|
||||
/* get interface names (numbers) */
|
||||
#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
|
||||
/* get interface type name */
|
||||
#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
|
||||
/* get interface ESI */
|
||||
#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
|
||||
/* get itf's local ATM addr. list */
|
||||
#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
|
||||
/* reset itf's ATM address list */
|
||||
#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
|
||||
/* add a local ATM address */
|
||||
#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
|
||||
/* remove a local ATM address */
|
||||
#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
|
||||
/* get connection identifier range */
|
||||
#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
|
||||
/* set connection identifier range */
|
||||
#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
|
||||
/* set interface ESI */
|
||||
#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
|
||||
/* force interface ESI */
|
||||
#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
|
||||
/* register a LECS address */
|
||||
#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
|
||||
/* unregister a LECS address */
|
||||
#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
|
||||
/* retrieve LECS address(es) */
|
||||
|
||||
#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
|
||||
/* get AAL layer statistics */
|
||||
#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
|
||||
/* get AAL layer statistics and zero */
|
||||
#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
|
||||
/* get loopback mode */
|
||||
#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
|
||||
/* set loopback mode */
|
||||
#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
|
||||
/* query supported loopback modes */
|
||||
#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
|
||||
/* enable or disable single-copy */
|
||||
#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
|
||||
/* set backend handler */
|
||||
#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
|
||||
/* use backend to make new if */
|
||||
#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
|
||||
/* add party to p2mp call */
|
||||
#ifdef CONFIG_COMPAT
|
||||
/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
|
||||
#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
|
||||
#endif
|
||||
#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
|
||||
/* drop party from p2mp call */
|
||||
|
||||
/*
|
||||
* These are backend handkers that can be set via the ATM_SETBACKEND call
|
||||
* above. In the future we may support dynamic loading of these - for now,
|
||||
* they're just being used to share the ATMIOC_BACKEND ioctls
|
||||
*/
|
||||
#define ATM_BACKEND_RAW 0
|
||||
#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
|
||||
#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
|
||||
|
||||
/* for ATM_GETTYPE */
|
||||
#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
|
||||
|
||||
/*
|
||||
* Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
|
||||
*/
|
||||
|
||||
/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
|
||||
#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
|
||||
#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
|
||||
#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
|
||||
/* RESERVED 4 loop back on PHY side ---' */
|
||||
#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
|
||||
#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
|
||||
|
||||
/* Direction of loopback */
|
||||
#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
|
||||
#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
|
||||
|
||||
#define __ATM_LM_XTLOC(n) ((n) & 0xff)
|
||||
#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
|
||||
|
||||
#define ATM_LM_NONE 0 /* no loopback */
|
||||
|
||||
#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
|
||||
#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
|
||||
#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
|
||||
#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
|
||||
|
||||
#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
|
||||
#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
|
||||
#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
|
||||
#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
|
||||
|
||||
/*
|
||||
* Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
|
||||
* __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
|
||||
*/
|
||||
|
||||
|
||||
struct atm_iobuf {
|
||||
int length;
|
||||
void __user *buffer;
|
||||
};
|
||||
|
||||
/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
|
||||
|
||||
#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
|
||||
|
||||
struct atm_cirange {
|
||||
signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
|
||||
signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
|
||||
};
|
||||
|
||||
/* for ATM_SETSC; actually taken from the ATM_VF number space */
|
||||
|
||||
#define ATM_SC_RX 1024 /* enable RX single-copy */
|
||||
#define ATM_SC_TX 2048 /* enable TX single-copy */
|
||||
|
||||
#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
|
||||
anyway */
|
||||
|
||||
/* MF: change_qos (Modify) flags */
|
||||
|
||||
#define ATM_MF_IMMED 1 /* Block until change is effective */
|
||||
#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
|
||||
#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
|
||||
#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
|
||||
#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
|
||||
#define ATM_MF_BWD 32 /* Set the backward direction parameters */
|
||||
|
||||
#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
|
||||
ATM_MF_DEC_SHP | ATM_MF_BWD)
|
||||
|
||||
/*
|
||||
* ATM_VS_* are used to express VC state in a human-friendly way.
|
||||
*/
|
||||
|
||||
#define ATM_VS_IDLE 0 /* VC is not used */
|
||||
#define ATM_VS_CONNECTED 1 /* VC is connected */
|
||||
#define ATM_VS_CLOSING 2 /* VC is closing */
|
||||
#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
|
||||
#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
|
||||
#define ATM_VS_BOUND 5 /* VC is bound */
|
||||
|
||||
#define ATM_VS2TXT_MAP \
|
||||
"IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
|
||||
|
||||
#define ATM_VF2TXT_MAP \
|
||||
"ADDR", "READY", "PARTIAL", "REGIS", \
|
||||
"RELEASED", "HASQOS", "LISTEN", "META", \
|
||||
"256", "512", "1024", "2048", \
|
||||
"SESSION", "HASSAP", "BOUND", "CLOSE"
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/wait.h> /* wait_queue_head_t */
|
||||
#include <linux/time.h> /* struct timeval */
|
||||
#include <linux/net.h>
|
||||
|
@ -221,6 +11,7 @@ struct atm_cirange {
|
|||
#include <linux/uio.h>
|
||||
#include <net/sock.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <uapi/linux/atmdev.h>
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
#include <linux/proc_fs.h>
|
||||
|
@ -521,6 +312,4 @@ void deregister_atm_ioctl(struct atm_ioctl *);
|
|||
int register_atmdevice_notifier(struct notifier_block *nb);
|
||||
void unregister_atmdevice_notifier(struct notifier_block *nb);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,389 +20,11 @@
|
|||
* Written by Rickard E. (Rik) Faith <faith@redhat.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_AUDIT_H_
|
||||
#define _LINUX_AUDIT_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/elf-em.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
/* The netlink messages for the audit system is divided into blocks:
|
||||
* 1000 - 1099 are for commanding the audit system
|
||||
* 1100 - 1199 user space trusted application messages
|
||||
* 1200 - 1299 messages internal to the audit daemon
|
||||
* 1300 - 1399 audit event messages
|
||||
* 1400 - 1499 SE Linux use
|
||||
* 1500 - 1599 kernel LSPP events
|
||||
* 1600 - 1699 kernel crypto events
|
||||
* 1700 - 1799 kernel anomaly records
|
||||
* 1800 - 1899 kernel integrity events
|
||||
* 1900 - 1999 future kernel use
|
||||
* 2000 is for otherwise unclassified kernel audit messages (legacy)
|
||||
* 2001 - 2099 unused (kernel)
|
||||
* 2100 - 2199 user space anomaly records
|
||||
* 2200 - 2299 user space actions taken in response to anomalies
|
||||
* 2300 - 2399 user space generated LSPP events
|
||||
* 2400 - 2499 user space crypto events
|
||||
* 2500 - 2999 future user space (maybe integrity labels and related events)
|
||||
*
|
||||
* Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
|
||||
* exclusively user space. 1300-2099 is kernel --> user space
|
||||
* communication.
|
||||
*/
|
||||
#define AUDIT_GET 1000 /* Get status */
|
||||
#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
|
||||
#define AUDIT_LIST 1002 /* List syscall rules -- deprecated */
|
||||
#define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */
|
||||
#define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */
|
||||
#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
|
||||
#define AUDIT_LOGIN 1006 /* Define the login id and information */
|
||||
#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
|
||||
#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
|
||||
#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
|
||||
#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
|
||||
#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
|
||||
#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
|
||||
#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
|
||||
#define AUDIT_TRIM 1014 /* Trim junk from watched tree */
|
||||
#define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */
|
||||
#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
|
||||
#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
|
||||
|
||||
#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
|
||||
#define AUDIT_USER_AVC 1107 /* We filter this differently */
|
||||
#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
|
||||
#define AUDIT_LAST_USER_MSG 1199
|
||||
#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
|
||||
#define AUDIT_LAST_USER_MSG2 2999
|
||||
|
||||
#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
|
||||
#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
|
||||
#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
|
||||
#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
|
||||
|
||||
#define AUDIT_SYSCALL 1300 /* Syscall event */
|
||||
/* #define AUDIT_FS_WATCH 1301 * Deprecated */
|
||||
#define AUDIT_PATH 1302 /* Filename path information */
|
||||
#define AUDIT_IPC 1303 /* IPC record */
|
||||
#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
|
||||
#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
|
||||
#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
|
||||
#define AUDIT_CWD 1307 /* Current working directory */
|
||||
#define AUDIT_EXECVE 1309 /* execve arguments */
|
||||
#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
|
||||
#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
|
||||
#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
|
||||
#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
|
||||
#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
|
||||
#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
|
||||
#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
|
||||
#define AUDIT_OBJ_PID 1318 /* ptrace target */
|
||||
#define AUDIT_TTY 1319 /* Input on an administrative TTY */
|
||||
#define AUDIT_EOE 1320 /* End of multi-record event */
|
||||
#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
|
||||
#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
|
||||
#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
|
||||
#define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */
|
||||
#define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */
|
||||
|
||||
#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
|
||||
#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
|
||||
#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
|
||||
#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
|
||||
#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
|
||||
#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
|
||||
#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
|
||||
#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
|
||||
#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
|
||||
#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
|
||||
#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
|
||||
#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */
|
||||
#define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */
|
||||
#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */
|
||||
#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */
|
||||
#define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */
|
||||
#define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */
|
||||
#define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */
|
||||
|
||||
#define AUDIT_FIRST_KERN_ANOM_MSG 1700
|
||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
||||
#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
|
||||
#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
|
||||
#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
|
||||
#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
|
||||
#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
|
||||
#define AUDIT_INTEGRITY_HASH 1803 /* Integrity HASH type */
|
||||
#define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */
|
||||
#define AUDIT_INTEGRITY_RULE 1805 /* policy rule */
|
||||
|
||||
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
||||
|
||||
/* Rule flags */
|
||||
#define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */
|
||||
#define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */
|
||||
#define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */
|
||||
#define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */
|
||||
#define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */
|
||||
#define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */
|
||||
|
||||
#define AUDIT_NR_FILTERS 6
|
||||
|
||||
#define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */
|
||||
|
||||
/* Rule actions */
|
||||
#define AUDIT_NEVER 0 /* Do not build context if rule matches */
|
||||
#define AUDIT_POSSIBLE 1 /* Build context if rule matches */
|
||||
#define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */
|
||||
|
||||
/* Rule structure sizes -- if these change, different AUDIT_ADD and
|
||||
* AUDIT_LIST commands must be implemented. */
|
||||
#define AUDIT_MAX_FIELDS 64
|
||||
#define AUDIT_MAX_KEY_LEN 256
|
||||
#define AUDIT_BITMASK_SIZE 64
|
||||
#define AUDIT_WORD(nr) ((__u32)((nr)/32))
|
||||
#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
|
||||
|
||||
#define AUDIT_SYSCALL_CLASSES 16
|
||||
#define AUDIT_CLASS_DIR_WRITE 0
|
||||
#define AUDIT_CLASS_DIR_WRITE_32 1
|
||||
#define AUDIT_CLASS_CHATTR 2
|
||||
#define AUDIT_CLASS_CHATTR_32 3
|
||||
#define AUDIT_CLASS_READ 4
|
||||
#define AUDIT_CLASS_READ_32 5
|
||||
#define AUDIT_CLASS_WRITE 6
|
||||
#define AUDIT_CLASS_WRITE_32 7
|
||||
#define AUDIT_CLASS_SIGNAL 8
|
||||
#define AUDIT_CLASS_SIGNAL_32 9
|
||||
|
||||
/* This bitmask is used to validate user input. It represents all bits that
|
||||
* are currently used in an audit field constant understood by the kernel.
|
||||
* If you are adding a new #define AUDIT_<whatever>, please ensure that
|
||||
* AUDIT_UNUSED_BITS is updated if need be. */
|
||||
#define AUDIT_UNUSED_BITS 0x07FFFC00
|
||||
|
||||
/* AUDIT_FIELD_COMPARE rule list */
|
||||
#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
|
||||
#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
|
||||
#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
|
||||
#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
|
||||
#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
|
||||
#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
|
||||
#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
|
||||
#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
|
||||
#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
|
||||
|
||||
#define AUDIT_COMPARE_UID_TO_AUID 10
|
||||
#define AUDIT_COMPARE_UID_TO_EUID 11
|
||||
#define AUDIT_COMPARE_UID_TO_FSUID 12
|
||||
#define AUDIT_COMPARE_UID_TO_SUID 13
|
||||
|
||||
#define AUDIT_COMPARE_AUID_TO_FSUID 14
|
||||
#define AUDIT_COMPARE_AUID_TO_SUID 15
|
||||
#define AUDIT_COMPARE_AUID_TO_EUID 16
|
||||
|
||||
#define AUDIT_COMPARE_EUID_TO_SUID 17
|
||||
#define AUDIT_COMPARE_EUID_TO_FSUID 18
|
||||
|
||||
#define AUDIT_COMPARE_SUID_TO_FSUID 19
|
||||
|
||||
#define AUDIT_COMPARE_GID_TO_EGID 20
|
||||
#define AUDIT_COMPARE_GID_TO_FSGID 21
|
||||
#define AUDIT_COMPARE_GID_TO_SGID 22
|
||||
|
||||
#define AUDIT_COMPARE_EGID_TO_FSGID 23
|
||||
#define AUDIT_COMPARE_EGID_TO_SGID 24
|
||||
#define AUDIT_COMPARE_SGID_TO_FSGID 25
|
||||
|
||||
#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID
|
||||
|
||||
/* Rule fields */
|
||||
/* These are useful when checking the
|
||||
* task structure at task creation time
|
||||
* (AUDIT_PER_TASK). */
|
||||
#define AUDIT_PID 0
|
||||
#define AUDIT_UID 1
|
||||
#define AUDIT_EUID 2
|
||||
#define AUDIT_SUID 3
|
||||
#define AUDIT_FSUID 4
|
||||
#define AUDIT_GID 5
|
||||
#define AUDIT_EGID 6
|
||||
#define AUDIT_SGID 7
|
||||
#define AUDIT_FSGID 8
|
||||
#define AUDIT_LOGINUID 9
|
||||
#define AUDIT_PERS 10
|
||||
#define AUDIT_ARCH 11
|
||||
#define AUDIT_MSGTYPE 12
|
||||
#define AUDIT_SUBJ_USER 13 /* security label user */
|
||||
#define AUDIT_SUBJ_ROLE 14 /* security label role */
|
||||
#define AUDIT_SUBJ_TYPE 15 /* security label type */
|
||||
#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
|
||||
#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
|
||||
#define AUDIT_PPID 18
|
||||
#define AUDIT_OBJ_USER 19
|
||||
#define AUDIT_OBJ_ROLE 20
|
||||
#define AUDIT_OBJ_TYPE 21
|
||||
#define AUDIT_OBJ_LEV_LOW 22
|
||||
#define AUDIT_OBJ_LEV_HIGH 23
|
||||
|
||||
/* These are ONLY useful when checking
|
||||
* at syscall exit time (AUDIT_AT_EXIT). */
|
||||
#define AUDIT_DEVMAJOR 100
|
||||
#define AUDIT_DEVMINOR 101
|
||||
#define AUDIT_INODE 102
|
||||
#define AUDIT_EXIT 103
|
||||
#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
|
||||
#define AUDIT_WATCH 105
|
||||
#define AUDIT_PERM 106
|
||||
#define AUDIT_DIR 107
|
||||
#define AUDIT_FILETYPE 108
|
||||
#define AUDIT_OBJ_UID 109
|
||||
#define AUDIT_OBJ_GID 110
|
||||
#define AUDIT_FIELD_COMPARE 111
|
||||
|
||||
#define AUDIT_ARG0 200
|
||||
#define AUDIT_ARG1 (AUDIT_ARG0+1)
|
||||
#define AUDIT_ARG2 (AUDIT_ARG0+2)
|
||||
#define AUDIT_ARG3 (AUDIT_ARG0+3)
|
||||
|
||||
#define AUDIT_FILTERKEY 210
|
||||
|
||||
#define AUDIT_NEGATE 0x80000000
|
||||
|
||||
/* These are the supported operators.
|
||||
* 4 2 1 8
|
||||
* = > < ?
|
||||
* ----------
|
||||
* 0 0 0 0 00 nonsense
|
||||
* 0 0 0 1 08 & bit mask
|
||||
* 0 0 1 0 10 <
|
||||
* 0 1 0 0 20 >
|
||||
* 0 1 1 0 30 !=
|
||||
* 1 0 0 0 40 =
|
||||
* 1 0 0 1 48 &= bit test
|
||||
* 1 0 1 0 50 <=
|
||||
* 1 1 0 0 60 >=
|
||||
* 1 1 1 1 78 all operators
|
||||
*/
|
||||
#define AUDIT_BIT_MASK 0x08000000
|
||||
#define AUDIT_LESS_THAN 0x10000000
|
||||
#define AUDIT_GREATER_THAN 0x20000000
|
||||
#define AUDIT_NOT_EQUAL 0x30000000
|
||||
#define AUDIT_EQUAL 0x40000000
|
||||
#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
|
||||
#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
|
||||
#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
|
||||
#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
|
||||
|
||||
enum {
|
||||
Audit_equal,
|
||||
Audit_not_equal,
|
||||
Audit_bitmask,
|
||||
Audit_bittest,
|
||||
Audit_lt,
|
||||
Audit_gt,
|
||||
Audit_le,
|
||||
Audit_ge,
|
||||
Audit_bad
|
||||
};
|
||||
|
||||
/* Status symbols */
|
||||
/* Mask values */
|
||||
#define AUDIT_STATUS_ENABLED 0x0001
|
||||
#define AUDIT_STATUS_FAILURE 0x0002
|
||||
#define AUDIT_STATUS_PID 0x0004
|
||||
#define AUDIT_STATUS_RATE_LIMIT 0x0008
|
||||
#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
|
||||
/* Failure-to-log actions */
|
||||
#define AUDIT_FAIL_SILENT 0
|
||||
#define AUDIT_FAIL_PRINTK 1
|
||||
#define AUDIT_FAIL_PANIC 2
|
||||
|
||||
/* distinguish syscall tables */
|
||||
#define __AUDIT_ARCH_64BIT 0x80000000
|
||||
#define __AUDIT_ARCH_LE 0x40000000
|
||||
#define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_ARMEB (EM_ARM)
|
||||
#define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_FRV (EM_FRV)
|
||||
#define AUDIT_ARCH_H8300 (EM_H8_300)
|
||||
#define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_M32R (EM_M32R)
|
||||
#define AUDIT_ARCH_M68K (EM_68K)
|
||||
#define AUDIT_ARCH_MIPS (EM_MIPS)
|
||||
#define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
|
||||
#define AUDIT_ARCH_PARISC (EM_PARISC)
|
||||
#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_PPC (EM_PPC)
|
||||
#define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_S390 (EM_S390)
|
||||
#define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_SH (EM_SH)
|
||||
#define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
|
||||
#define AUDIT_ARCH_SPARC (EM_SPARC)
|
||||
#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
|
||||
#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
|
||||
|
||||
#define AUDIT_PERM_EXEC 1
|
||||
#define AUDIT_PERM_WRITE 2
|
||||
#define AUDIT_PERM_READ 4
|
||||
#define AUDIT_PERM_ATTR 8
|
||||
|
||||
struct audit_status {
|
||||
__u32 mask; /* Bit mask for valid entries */
|
||||
__u32 enabled; /* 1 = enabled, 0 = disabled */
|
||||
__u32 failure; /* Failure-to-log action */
|
||||
__u32 pid; /* pid of auditd process */
|
||||
__u32 rate_limit; /* messages rate limit (per second) */
|
||||
__u32 backlog_limit; /* waiting messages limit */
|
||||
__u32 lost; /* messages lost */
|
||||
__u32 backlog; /* messages waiting in queue */
|
||||
};
|
||||
|
||||
struct audit_tty_status {
|
||||
__u32 enabled; /* 1 = enabled, 0 = disabled */
|
||||
};
|
||||
|
||||
/* audit_rule_data supports filter rules with both integer and string
|
||||
* fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
|
||||
* AUDIT_LIST_RULES requests.
|
||||
*/
|
||||
struct audit_rule_data {
|
||||
__u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
|
||||
__u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
|
||||
__u32 field_count;
|
||||
__u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */
|
||||
__u32 fields[AUDIT_MAX_FIELDS];
|
||||
__u32 values[AUDIT_MAX_FIELDS];
|
||||
__u32 fieldflags[AUDIT_MAX_FIELDS];
|
||||
__u32 buflen; /* total length of string fields */
|
||||
char buf[0]; /* string fields buffer */
|
||||
};
|
||||
|
||||
/* audit_rule is supported to maintain backward compatibility with
|
||||
* userspace. It supports integer fields only and corresponds to
|
||||
* AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests.
|
||||
*/
|
||||
struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
|
||||
__u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */
|
||||
__u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */
|
||||
__u32 field_count;
|
||||
__u32 mask[AUDIT_BITMASK_SIZE];
|
||||
__u32 fields[AUDIT_MAX_FIELDS];
|
||||
__u32 values[AUDIT_MAX_FIELDS];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/sched.h>
|
||||
#include <uapi/linux/audit.h>
|
||||
|
||||
struct audit_sig_info {
|
||||
uid_t uid;
|
||||
|
@ -860,4 +482,3 @@ static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
|
|||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,77 +10,11 @@
|
|||
*
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#ifndef _LINUX_AUTO_FS_H
|
||||
#define _LINUX_AUTO_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/fs.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* This file describes autofs v3 */
|
||||
#define AUTOFS_PROTO_VERSION 3
|
||||
|
||||
/* Range of protocol versions defined */
|
||||
#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
|
||||
#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
|
||||
|
||||
/*
|
||||
* Architectures where both 32- and 64-bit binaries can be executed
|
||||
* on 64-bit kernels need this. This keeps the structure format
|
||||
* uniform, and makes sure the wait_queue_token isn't too big to be
|
||||
* passed back down to the kernel.
|
||||
*
|
||||
* This assumes that on these architectures:
|
||||
* mode 32 bit 64 bit
|
||||
* -------------------------
|
||||
* int 32 bit 32 bit
|
||||
* long 32 bit 64 bit
|
||||
*
|
||||
* If so, 32-bit user-space code should be backwards compatible.
|
||||
*/
|
||||
|
||||
#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \
|
||||
|| defined(__powerpc__) || defined(__s390__)
|
||||
typedef unsigned int autofs_wqt_t;
|
||||
#else
|
||||
typedef unsigned long autofs_wqt_t;
|
||||
#endif
|
||||
|
||||
/* Packet types */
|
||||
#define autofs_ptype_missing 0 /* Missing entry (mount request) */
|
||||
#define autofs_ptype_expire 1 /* Expire entry (umount request) */
|
||||
|
||||
struct autofs_packet_hdr {
|
||||
int proto_version; /* Protocol version */
|
||||
int type; /* Type of packet */
|
||||
};
|
||||
|
||||
struct autofs_packet_missing {
|
||||
struct autofs_packet_hdr hdr;
|
||||
autofs_wqt_t wait_queue_token;
|
||||
int len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
/* v3 expire (via ioctl) */
|
||||
struct autofs_packet_expire {
|
||||
struct autofs_packet_hdr hdr;
|
||||
int len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
#define AUTOFS_IOC_READY _IO(0x93,0x60)
|
||||
#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
|
||||
#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
|
||||
#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
|
||||
#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t)
|
||||
#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
|
||||
#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
|
||||
|
||||
#include <uapi/linux/auto_fs.h>
|
||||
#endif /* _LINUX_AUTO_FS_H */
|
||||
|
|
|
@ -1,39 +1,8 @@
|
|||
#ifndef _LINUX_AUXVEC_H
|
||||
#define _LINUX_AUXVEC_H
|
||||
|
||||
#include <asm/auxvec.h>
|
||||
#include <uapi/linux/auxvec.h>
|
||||
|
||||
/* Symbolic values for the entries in the auxiliary table
|
||||
put on the initial stack */
|
||||
#define AT_NULL 0 /* end of vector */
|
||||
#define AT_IGNORE 1 /* entry should be ignored */
|
||||
#define AT_EXECFD 2 /* file descriptor of program */
|
||||
#define AT_PHDR 3 /* program headers for program */
|
||||
#define AT_PHENT 4 /* size of program header entry */
|
||||
#define AT_PHNUM 5 /* number of program headers */
|
||||
#define AT_PAGESZ 6 /* system page size */
|
||||
#define AT_BASE 7 /* base address of interpreter */
|
||||
#define AT_FLAGS 8 /* flags */
|
||||
#define AT_ENTRY 9 /* entry point of program */
|
||||
#define AT_NOTELF 10 /* program is not ELF */
|
||||
#define AT_UID 11 /* real uid */
|
||||
#define AT_EUID 12 /* effective uid */
|
||||
#define AT_GID 13 /* real gid */
|
||||
#define AT_EGID 14 /* effective gid */
|
||||
#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
|
||||
#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
|
||||
#define AT_CLKTCK 17 /* frequency at which times() increments */
|
||||
/* AT_* values 18 through 22 are reserved */
|
||||
#define AT_SECURE 23 /* secure mode boolean */
|
||||
#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
|
||||
* differ from AT_PLATFORM. */
|
||||
#define AT_RANDOM 25 /* address of 16 random bytes */
|
||||
|
||||
#define AT_EXECFN 31 /* filename of program */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */
|
||||
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_AUXVEC_H */
|
||||
|
|
|
@ -1,26 +1,10 @@
|
|||
#ifndef _LINUX_BINFMTS_H
|
||||
#define _LINUX_BINFMTS_H
|
||||
|
||||
#include <linux/capability.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/*
|
||||
* These are the maximum length and maximum number of strings passed to the
|
||||
* execve() system call. MAX_ARG_STRLEN is essentially random but serves to
|
||||
* prevent the kernel from being unduly impacted by misaddressed pointers.
|
||||
* MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
|
||||
*/
|
||||
#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
|
||||
#define MAX_ARG_STRINGS 0x7FFFFFFF
|
||||
|
||||
/* sizeof(linux_binprm->buf) */
|
||||
#define BINPRM_BUF_SIZE 128
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/sched.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <asm/exec.h>
|
||||
#include <uapi/linux/binfmts.h>
|
||||
|
||||
#define CORENAME_MAX_SIZE 128
|
||||
|
||||
|
@ -141,5 +125,4 @@ extern void free_bprm(struct linux_binprm *);
|
|||
extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_BINFMTS_H */
|
||||
|
|
|
@ -1,150 +1,11 @@
|
|||
#ifndef BLKTRACE_H
|
||||
#define BLKTRACE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/relay.h>
|
||||
#include <linux/compat.h>
|
||||
#endif
|
||||
#include <uapi/linux/blktrace_api.h>
|
||||
|
||||
/*
|
||||
* Trace categories
|
||||
*/
|
||||
enum blktrace_cat {
|
||||
BLK_TC_READ = 1 << 0, /* reads */
|
||||
BLK_TC_WRITE = 1 << 1, /* writes */
|
||||
BLK_TC_FLUSH = 1 << 2, /* flush */
|
||||
BLK_TC_SYNC = 1 << 3, /* sync IO */
|
||||
BLK_TC_SYNCIO = BLK_TC_SYNC,
|
||||
BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
|
||||
BLK_TC_REQUEUE = 1 << 5, /* requeueing */
|
||||
BLK_TC_ISSUE = 1 << 6, /* issue */
|
||||
BLK_TC_COMPLETE = 1 << 7, /* completions */
|
||||
BLK_TC_FS = 1 << 8, /* fs requests */
|
||||
BLK_TC_PC = 1 << 9, /* pc requests */
|
||||
BLK_TC_NOTIFY = 1 << 10, /* special message */
|
||||
BLK_TC_AHEAD = 1 << 11, /* readahead */
|
||||
BLK_TC_META = 1 << 12, /* metadata */
|
||||
BLK_TC_DISCARD = 1 << 13, /* discard requests */
|
||||
BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
|
||||
BLK_TC_FUA = 1 << 15, /* fua requests */
|
||||
|
||||
BLK_TC_END = 1 << 15, /* we've run out of bits! */
|
||||
};
|
||||
|
||||
#define BLK_TC_SHIFT (16)
|
||||
#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
|
||||
|
||||
/*
|
||||
* Basic trace actions
|
||||
*/
|
||||
enum blktrace_act {
|
||||
__BLK_TA_QUEUE = 1, /* queued */
|
||||
__BLK_TA_BACKMERGE, /* back merged to existing rq */
|
||||
__BLK_TA_FRONTMERGE, /* front merge to existing rq */
|
||||
__BLK_TA_GETRQ, /* allocated new request */
|
||||
__BLK_TA_SLEEPRQ, /* sleeping on rq allocation */
|
||||
__BLK_TA_REQUEUE, /* request requeued */
|
||||
__BLK_TA_ISSUE, /* sent to driver */
|
||||
__BLK_TA_COMPLETE, /* completed by driver */
|
||||
__BLK_TA_PLUG, /* queue was plugged */
|
||||
__BLK_TA_UNPLUG_IO, /* queue was unplugged by io */
|
||||
__BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */
|
||||
__BLK_TA_INSERT, /* insert request */
|
||||
__BLK_TA_SPLIT, /* bio was split */
|
||||
__BLK_TA_BOUNCE, /* bio was bounced */
|
||||
__BLK_TA_REMAP, /* bio was remapped */
|
||||
__BLK_TA_ABORT, /* request aborted */
|
||||
__BLK_TA_DRV_DATA, /* driver-specific binary data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Notify events.
|
||||
*/
|
||||
enum blktrace_notify {
|
||||
__BLK_TN_PROCESS = 0, /* establish pid/name mapping */
|
||||
__BLK_TN_TIMESTAMP, /* include system clock */
|
||||
__BLK_TN_MESSAGE, /* Character string message */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Trace actions in full. Additionally, read or write is masked
|
||||
*/
|
||||
#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
|
||||
#define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
|
||||
#define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
|
||||
#define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_SPLIT (__BLK_TA_SPLIT)
|
||||
#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
|
||||
#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
|
||||
#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
|
||||
|
||||
#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
|
||||
#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
|
||||
#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
|
||||
|
||||
#define BLK_IO_TRACE_MAGIC 0x65617400
|
||||
#define BLK_IO_TRACE_VERSION 0x07
|
||||
|
||||
/*
|
||||
* The trace itself
|
||||
*/
|
||||
struct blk_io_trace {
|
||||
__u32 magic; /* MAGIC << 8 | version */
|
||||
__u32 sequence; /* event number */
|
||||
__u64 time; /* in microseconds */
|
||||
__u64 sector; /* disk offset */
|
||||
__u32 bytes; /* transfer length */
|
||||
__u32 action; /* what happened */
|
||||
__u32 pid; /* who did it */
|
||||
__u32 device; /* device number */
|
||||
__u32 cpu; /* on what cpu did it happen */
|
||||
__u16 error; /* completion error */
|
||||
__u16 pdu_len; /* length of data after this trace */
|
||||
};
|
||||
|
||||
/*
|
||||
* The remap event
|
||||
*/
|
||||
struct blk_io_trace_remap {
|
||||
__be32 device_from;
|
||||
__be32 device_to;
|
||||
__be64 sector_from;
|
||||
};
|
||||
|
||||
enum {
|
||||
Blktrace_setup = 1,
|
||||
Blktrace_running,
|
||||
Blktrace_stopped,
|
||||
};
|
||||
|
||||
#define BLKTRACE_BDEV_SIZE 32
|
||||
|
||||
/*
|
||||
* User setup structure passed with BLKTRACESTART
|
||||
*/
|
||||
struct blk_user_trace_setup {
|
||||
char name[BLKTRACE_BDEV_SIZE]; /* output */
|
||||
__u16 act_mask; /* input */
|
||||
__u32 buf_size; /* input */
|
||||
__u32 buf_nr; /* input */
|
||||
__u64 start_lba;
|
||||
__u64 end_lba;
|
||||
__u32 pid;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#if defined(CONFIG_BLK_DEV_IO_TRACE)
|
||||
|
||||
#include <linux/sysfs.h>
|
||||
|
@ -250,5 +111,4 @@ extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
|
|||
|
||||
#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
|
|
@ -1,67 +1,8 @@
|
|||
#ifndef BSG_H
|
||||
#define BSG_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/bsg.h>
|
||||
|
||||
#define BSG_PROTOCOL_SCSI 0
|
||||
|
||||
#define BSG_SUB_PROTOCOL_SCSI_CMD 0
|
||||
#define BSG_SUB_PROTOCOL_SCSI_TMF 1
|
||||
#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
|
||||
|
||||
/*
|
||||
* For flags member below
|
||||
* sg.h sg_io_hdr also has bits defined for it's flags member. However
|
||||
* none of these bits are implemented/used by bsg. The bits below are
|
||||
* allocated to not conflict with sg.h ones anyway.
|
||||
*/
|
||||
#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */
|
||||
|
||||
struct sg_io_v4 {
|
||||
__s32 guard; /* [i] 'Q' to differentiate from v3 */
|
||||
__u32 protocol; /* [i] 0 -> SCSI , .... */
|
||||
__u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
|
||||
management function, .... */
|
||||
|
||||
__u32 request_len; /* [i] in bytes */
|
||||
__u64 request; /* [i], [*i] {SCSI: cdb} */
|
||||
__u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
|
||||
__u32 request_attr; /* [i] {SCSI: task attribute} */
|
||||
__u32 request_priority; /* [i] {SCSI: task priority} */
|
||||
__u32 request_extra; /* [i] {spare, for padding} */
|
||||
__u32 max_response_len; /* [i] in bytes */
|
||||
__u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
|
||||
|
||||
/* "dout_": data out (to device); "din_": data in (from device) */
|
||||
__u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
|
||||
dout_xfer points to array of iovec */
|
||||
__u32 dout_xfer_len; /* [i] bytes to be transferred to device */
|
||||
__u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
|
||||
__u32 din_xfer_len; /* [i] bytes to be transferred from device */
|
||||
__u64 dout_xferp; /* [i], [*i] */
|
||||
__u64 din_xferp; /* [i], [*o] */
|
||||
|
||||
__u32 timeout; /* [i] units: millisecond */
|
||||
__u32 flags; /* [i] bit mask */
|
||||
__u64 usr_ptr; /* [i->o] unused internally */
|
||||
__u32 spare_in; /* [i] */
|
||||
|
||||
__u32 driver_status; /* [o] 0 -> ok */
|
||||
__u32 transport_status; /* [o] 0 -> ok */
|
||||
__u32 device_status; /* [o] {SCSI: command completion status} */
|
||||
__u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
|
||||
__u32 info; /* [o] additional information */
|
||||
__u32 duration; /* [o] time to complete, in milliseconds */
|
||||
__u32 response_len; /* [o] bytes of response actually written */
|
||||
__s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
|
||||
__s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
|
||||
__u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
|
||||
__u32 spare_out; /* [o] */
|
||||
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_BSG)
|
||||
struct bsg_class_device {
|
||||
|
@ -89,6 +30,4 @@ static inline void bsg_unregister_queue(struct request_queue *q)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,82 +9,11 @@
|
|||
*
|
||||
* ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
#define _LINUX_CAPABILITY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/capability.h>
|
||||
|
||||
struct task_struct;
|
||||
|
||||
/* User-level do most of the mapping between kernel and user
|
||||
capabilities based on the version tag given by the kernel. The
|
||||
kernel might be somewhat backwards compatible, but don't bet on
|
||||
it. */
|
||||
|
||||
/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
|
||||
a set of three capability sets. The transposition of 3*the
|
||||
following structure to such a composite is better handled in a user
|
||||
library since the draft standard requires the use of malloc/free
|
||||
etc.. */
|
||||
|
||||
#define _LINUX_CAPABILITY_VERSION_1 0x19980330
|
||||
#define _LINUX_CAPABILITY_U32S_1 1
|
||||
|
||||
#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */
|
||||
#define _LINUX_CAPABILITY_U32S_2 2
|
||||
|
||||
#define _LINUX_CAPABILITY_VERSION_3 0x20080522
|
||||
#define _LINUX_CAPABILITY_U32S_3 2
|
||||
|
||||
typedef struct __user_cap_header_struct {
|
||||
__u32 version;
|
||||
int pid;
|
||||
} __user *cap_user_header_t;
|
||||
|
||||
typedef struct __user_cap_data_struct {
|
||||
__u32 effective;
|
||||
__u32 permitted;
|
||||
__u32 inheritable;
|
||||
} __user *cap_user_data_t;
|
||||
|
||||
|
||||
#define VFS_CAP_REVISION_MASK 0xFF000000
|
||||
#define VFS_CAP_REVISION_SHIFT 24
|
||||
#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
|
||||
#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
|
||||
|
||||
#define VFS_CAP_REVISION_1 0x01000000
|
||||
#define VFS_CAP_U32_1 1
|
||||
#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
|
||||
|
||||
#define VFS_CAP_REVISION_2 0x02000000
|
||||
#define VFS_CAP_U32_2 2
|
||||
#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
|
||||
|
||||
#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
|
||||
#define VFS_CAP_U32 VFS_CAP_U32_2
|
||||
#define VFS_CAP_REVISION VFS_CAP_REVISION_2
|
||||
|
||||
struct vfs_cap_data {
|
||||
__le32 magic_etc; /* Little endian */
|
||||
struct {
|
||||
__le32 permitted; /* Little endian */
|
||||
__le32 inheritable; /* Little endian */
|
||||
} data[VFS_CAP_U32];
|
||||
};
|
||||
|
||||
#ifndef __KERNEL__
|
||||
|
||||
/*
|
||||
* Backwardly compatible definition for source code - trapped in a
|
||||
* 32-bit world. If you find you need this, please consider using
|
||||
* libcap to untrap yourself...
|
||||
*/
|
||||
#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
|
||||
#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
|
||||
|
||||
#else
|
||||
|
||||
#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
|
||||
#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
|
||||
|
@ -105,277 +34,6 @@ struct cpu_vfs_cap_data {
|
|||
#define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct))
|
||||
#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
** POSIX-draft defined capabilities.
|
||||
**/
|
||||
|
||||
/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
|
||||
overrides the restriction of changing file ownership and group
|
||||
ownership. */
|
||||
|
||||
#define CAP_CHOWN 0
|
||||
|
||||
/* Override all DAC access, including ACL execute access if
|
||||
[_POSIX_ACL] is defined. Excluding DAC access covered by
|
||||
CAP_LINUX_IMMUTABLE. */
|
||||
|
||||
#define CAP_DAC_OVERRIDE 1
|
||||
|
||||
/* Overrides all DAC restrictions regarding read and search on files
|
||||
and directories, including ACL restrictions if [_POSIX_ACL] is
|
||||
defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
|
||||
|
||||
#define CAP_DAC_READ_SEARCH 2
|
||||
|
||||
/* Overrides all restrictions about allowed operations on files, where
|
||||
file owner ID must be equal to the user ID, except where CAP_FSETID
|
||||
is applicable. It doesn't override MAC and DAC restrictions. */
|
||||
|
||||
#define CAP_FOWNER 3
|
||||
|
||||
/* Overrides the following restrictions that the effective user ID
|
||||
shall match the file owner ID when setting the S_ISUID and S_ISGID
|
||||
bits on that file; that the effective group ID (or one of the
|
||||
supplementary group IDs) shall match the file owner ID when setting
|
||||
the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
|
||||
cleared on successful return from chown(2) (not implemented). */
|
||||
|
||||
#define CAP_FSETID 4
|
||||
|
||||
/* Overrides the restriction that the real or effective user ID of a
|
||||
process sending a signal must match the real or effective user ID
|
||||
of the process receiving the signal. */
|
||||
|
||||
#define CAP_KILL 5
|
||||
|
||||
/* Allows setgid(2) manipulation */
|
||||
/* Allows setgroups(2) */
|
||||
/* Allows forged gids on socket credentials passing. */
|
||||
|
||||
#define CAP_SETGID 6
|
||||
|
||||
/* Allows set*uid(2) manipulation (including fsuid). */
|
||||
/* Allows forged pids on socket credentials passing. */
|
||||
|
||||
#define CAP_SETUID 7
|
||||
|
||||
|
||||
/**
|
||||
** Linux-specific capabilities
|
||||
**/
|
||||
|
||||
/* Without VFS support for capabilities:
|
||||
* Transfer any capability in your permitted set to any pid,
|
||||
* remove any capability in your permitted set from any pid
|
||||
* With VFS support for capabilities (neither of above, but)
|
||||
* Add any capability from current's capability bounding set
|
||||
* to the current process' inheritable set
|
||||
* Allow taking bits out of capability bounding set
|
||||
* Allow modification of the securebits for a process
|
||||
*/
|
||||
|
||||
#define CAP_SETPCAP 8
|
||||
|
||||
/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
|
||||
|
||||
#define CAP_LINUX_IMMUTABLE 9
|
||||
|
||||
/* Allows binding to TCP/UDP sockets below 1024 */
|
||||
/* Allows binding to ATM VCIs below 32 */
|
||||
|
||||
#define CAP_NET_BIND_SERVICE 10
|
||||
|
||||
/* Allow broadcasting, listen to multicast */
|
||||
|
||||
#define CAP_NET_BROADCAST 11
|
||||
|
||||
/* Allow interface configuration */
|
||||
/* Allow administration of IP firewall, masquerading and accounting */
|
||||
/* Allow setting debug option on sockets */
|
||||
/* Allow modification of routing tables */
|
||||
/* Allow setting arbitrary process / process group ownership on
|
||||
sockets */
|
||||
/* Allow binding to any address for transparent proxying (also via NET_RAW) */
|
||||
/* Allow setting TOS (type of service) */
|
||||
/* Allow setting promiscuous mode */
|
||||
/* Allow clearing driver statistics */
|
||||
/* Allow multicasting */
|
||||
/* Allow read/write of device-specific registers */
|
||||
/* Allow activation of ATM control sockets */
|
||||
|
||||
#define CAP_NET_ADMIN 12
|
||||
|
||||
/* Allow use of RAW sockets */
|
||||
/* Allow use of PACKET sockets */
|
||||
/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
|
||||
|
||||
#define CAP_NET_RAW 13
|
||||
|
||||
/* Allow locking of shared memory segments */
|
||||
/* Allow mlock and mlockall (which doesn't really have anything to do
|
||||
with IPC) */
|
||||
|
||||
#define CAP_IPC_LOCK 14
|
||||
|
||||
/* Override IPC ownership checks */
|
||||
|
||||
#define CAP_IPC_OWNER 15
|
||||
|
||||
/* Insert and remove kernel modules - modify kernel without limit */
|
||||
#define CAP_SYS_MODULE 16
|
||||
|
||||
/* Allow ioperm/iopl access */
|
||||
/* Allow sending USB messages to any device via /proc/bus/usb */
|
||||
|
||||
#define CAP_SYS_RAWIO 17
|
||||
|
||||
/* Allow use of chroot() */
|
||||
|
||||
#define CAP_SYS_CHROOT 18
|
||||
|
||||
/* Allow ptrace() of any process */
|
||||
|
||||
#define CAP_SYS_PTRACE 19
|
||||
|
||||
/* Allow configuration of process accounting */
|
||||
|
||||
#define CAP_SYS_PACCT 20
|
||||
|
||||
/* Allow configuration of the secure attention key */
|
||||
/* Allow administration of the random device */
|
||||
/* Allow examination and configuration of disk quotas */
|
||||
/* Allow setting the domainname */
|
||||
/* Allow setting the hostname */
|
||||
/* Allow calling bdflush() */
|
||||
/* Allow mount() and umount(), setting up new smb connection */
|
||||
/* Allow some autofs root ioctls */
|
||||
/* Allow nfsservctl */
|
||||
/* Allow VM86_REQUEST_IRQ */
|
||||
/* Allow to read/write pci config on alpha */
|
||||
/* Allow irix_prctl on mips (setstacksize) */
|
||||
/* Allow flushing all cache on m68k (sys_cacheflush) */
|
||||
/* Allow removing semaphores */
|
||||
/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
|
||||
and shared memory */
|
||||
/* Allow locking/unlocking of shared memory segment */
|
||||
/* Allow turning swap on/off */
|
||||
/* Allow forged pids on socket credentials passing */
|
||||
/* Allow setting readahead and flushing buffers on block devices */
|
||||
/* Allow setting geometry in floppy driver */
|
||||
/* Allow turning DMA on/off in xd driver */
|
||||
/* Allow administration of md devices (mostly the above, but some
|
||||
extra ioctls) */
|
||||
/* Allow tuning the ide driver */
|
||||
/* Allow access to the nvram device */
|
||||
/* Allow administration of apm_bios, serial and bttv (TV) device */
|
||||
/* Allow manufacturer commands in isdn CAPI support driver */
|
||||
/* Allow reading non-standardized portions of pci configuration space */
|
||||
/* Allow DDI debug ioctl on sbpcd driver */
|
||||
/* Allow setting up serial ports */
|
||||
/* Allow sending raw qic-117 commands */
|
||||
/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
|
||||
arbitrary SCSI commands */
|
||||
/* Allow setting encryption key on loopback filesystem */
|
||||
/* Allow setting zone reclaim policy */
|
||||
|
||||
#define CAP_SYS_ADMIN 21
|
||||
|
||||
/* Allow use of reboot() */
|
||||
|
||||
#define CAP_SYS_BOOT 22
|
||||
|
||||
/* Allow raising priority and setting priority on other (different
|
||||
UID) processes */
|
||||
/* Allow use of FIFO and round-robin (realtime) scheduling on own
|
||||
processes and setting the scheduling algorithm used by another
|
||||
process. */
|
||||
/* Allow setting cpu affinity on other processes */
|
||||
|
||||
#define CAP_SYS_NICE 23
|
||||
|
||||
/* Override resource limits. Set resource limits. */
|
||||
/* Override quota limits. */
|
||||
/* Override reserved space on ext2 filesystem */
|
||||
/* Modify data journaling mode on ext3 filesystem (uses journaling
|
||||
resources) */
|
||||
/* NOTE: ext2 honors fsuid when checking for resource overrides, so
|
||||
you can override using fsuid too */
|
||||
/* Override size restrictions on IPC message queues */
|
||||
/* Allow more than 64hz interrupts from the real-time clock */
|
||||
/* Override max number of consoles on console allocation */
|
||||
/* Override max number of keymaps */
|
||||
|
||||
#define CAP_SYS_RESOURCE 24
|
||||
|
||||
/* Allow manipulation of system clock */
|
||||
/* Allow irix_stime on mips */
|
||||
/* Allow setting the real-time clock */
|
||||
|
||||
#define CAP_SYS_TIME 25
|
||||
|
||||
/* Allow configuration of tty devices */
|
||||
/* Allow vhangup() of tty */
|
||||
|
||||
#define CAP_SYS_TTY_CONFIG 26
|
||||
|
||||
/* Allow the privileged aspects of mknod() */
|
||||
|
||||
#define CAP_MKNOD 27
|
||||
|
||||
/* Allow taking of leases on files */
|
||||
|
||||
#define CAP_LEASE 28
|
||||
|
||||
#define CAP_AUDIT_WRITE 29
|
||||
|
||||
#define CAP_AUDIT_CONTROL 30
|
||||
|
||||
#define CAP_SETFCAP 31
|
||||
|
||||
/* Override MAC access.
|
||||
The base kernel enforces no MAC policy.
|
||||
An LSM may enforce a MAC policy, and if it does and it chooses
|
||||
to implement capability based overrides of that policy, this is
|
||||
the capability it should use to do so. */
|
||||
|
||||
#define CAP_MAC_OVERRIDE 32
|
||||
|
||||
/* Allow MAC configuration or state changes.
|
||||
The base kernel requires no MAC configuration.
|
||||
An LSM may enforce a MAC policy, and if it does and it chooses
|
||||
to implement capability based checks on modifications to that
|
||||
policy or the data required to maintain it, this is the
|
||||
capability it should use to do so. */
|
||||
|
||||
#define CAP_MAC_ADMIN 33
|
||||
|
||||
/* Allow configuring the kernel's syslog (printk behaviour) */
|
||||
|
||||
#define CAP_SYSLOG 34
|
||||
|
||||
/* Allow triggering something that will wake the system */
|
||||
|
||||
#define CAP_WAKE_ALARM 35
|
||||
|
||||
/* Allow preventing system suspends */
|
||||
|
||||
#define CAP_BLOCK_SUSPEND 36
|
||||
|
||||
#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
|
||||
|
||||
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
|
||||
|
||||
/*
|
||||
* Bit location of each capability (used by user-space library and kernel)
|
||||
*/
|
||||
|
||||
#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
|
||||
#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct inode;
|
||||
struct dentry;
|
||||
|
@ -557,6 +215,4 @@ extern bool inode_capable(const struct inode *inode, int cap);
|
|||
/* audit system wants to get cap info from files as well */
|
||||
extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* !_LINUX_CAPABILITY_H */
|
||||
|
|
|
@ -1,91 +1,8 @@
|
|||
#ifndef CCISS_IOCTLH
|
||||
#define CCISS_IOCTLH
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/cciss_defs.h>
|
||||
#include <uapi/linux/cciss_ioctl.h>
|
||||
|
||||
#define CCISS_IOC_MAGIC 'B'
|
||||
|
||||
|
||||
typedef struct _cciss_pci_info_struct
|
||||
{
|
||||
unsigned char bus;
|
||||
unsigned char dev_fn;
|
||||
unsigned short domain;
|
||||
__u32 board_id;
|
||||
} cciss_pci_info_struct;
|
||||
|
||||
typedef struct _cciss_coalint_struct
|
||||
{
|
||||
__u32 delay;
|
||||
__u32 count;
|
||||
} cciss_coalint_struct;
|
||||
|
||||
typedef char NodeName_type[16];
|
||||
|
||||
typedef __u32 Heartbeat_type;
|
||||
|
||||
#define CISS_PARSCSIU2 0x0001
|
||||
#define CISS_PARCSCIU3 0x0002
|
||||
#define CISS_FIBRE1G 0x0100
|
||||
#define CISS_FIBRE2G 0x0200
|
||||
typedef __u32 BusTypes_type;
|
||||
|
||||
typedef char FirmwareVer_type[4];
|
||||
typedef __u32 DriverVer_type;
|
||||
|
||||
#define MAX_KMALLOC_SIZE 128000
|
||||
|
||||
typedef struct _IOCTL_Command_struct {
|
||||
LUNAddr_struct LUN_info;
|
||||
RequestBlock_struct Request;
|
||||
ErrorInfo_struct error_info;
|
||||
WORD buf_size; /* size in bytes of the buf */
|
||||
BYTE __user *buf;
|
||||
} IOCTL_Command_struct;
|
||||
|
||||
typedef struct _BIG_IOCTL_Command_struct {
|
||||
LUNAddr_struct LUN_info;
|
||||
RequestBlock_struct Request;
|
||||
ErrorInfo_struct error_info;
|
||||
DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
|
||||
DWORD buf_size; /* size in bytes of the buf */
|
||||
/* < malloc_size * MAXSGENTRIES */
|
||||
BYTE __user *buf;
|
||||
} BIG_IOCTL_Command_struct;
|
||||
|
||||
typedef struct _LogvolInfo_struct{
|
||||
__u32 LunID;
|
||||
int num_opens; /* number of opens on the logical volume */
|
||||
int num_parts; /* number of partitions configured on logvol */
|
||||
} LogvolInfo_struct;
|
||||
|
||||
#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
|
||||
|
||||
#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
|
||||
#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
|
||||
|
||||
#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
|
||||
#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
|
||||
|
||||
#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
|
||||
#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
|
||||
#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
|
||||
#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
|
||||
#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
|
||||
#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
|
||||
#define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
|
||||
|
||||
/* no longer used... use REGNEWD instead */
|
||||
#define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
|
||||
|
||||
#define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
|
||||
#define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
|
||||
#define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
|
||||
#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
/* 32 bit compatible ioctl structs */
|
||||
|
@ -111,5 +28,4 @@ typedef struct _BIG_IOCTL32_Command_struct {
|
|||
#define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct)
|
||||
|
||||
#endif /* CONFIG_COMPAT */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
|
|
@ -7,910 +7,12 @@
|
|||
* 1997, 1998 Erik Andersen, andersee@debian.org
|
||||
* 1998-2002 Jens Axboe, axboe@suse.de
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CDROM_H
|
||||
#define _LINUX_CDROM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/*******************************************************
|
||||
* As of Linux 2.1.x, all Linux CD-ROM application programs will use this
|
||||
* (and only this) include file. It is my hope to provide Linux with
|
||||
* a uniform interface between software accessing CD-ROMs and the various
|
||||
* device drivers that actually talk to the drives. There may still be
|
||||
* 23 different kinds of strange CD-ROM drives, but at least there will
|
||||
* now be one, and only one, Linux CD-ROM interface.
|
||||
*
|
||||
* Additionally, as of Linux 2.1.x, all Linux application programs
|
||||
* should use the O_NONBLOCK option when opening a CD-ROM device
|
||||
* for subsequent ioctl commands. This allows for neat system errors
|
||||
* like "No medium found" or "Wrong medium type" upon attempting to
|
||||
* mount or play an empty slot, mount an audio disc, or play a data disc.
|
||||
* Generally, changing an application program to support O_NONBLOCK
|
||||
* is as easy as the following:
|
||||
* - drive = open("/dev/cdrom", O_RDONLY);
|
||||
* + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
|
||||
* It is worth the small change.
|
||||
*
|
||||
* Patches for many common CD programs (provided by David A. van Leeuwen)
|
||||
* can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/
|
||||
*
|
||||
*******************************************************/
|
||||
|
||||
/* When a driver supports a certain function, but the cdrom drive we are
|
||||
* using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will
|
||||
* borrow the "Operation not supported" error from the network folks to
|
||||
* accomplish this. Maybe someday we will get a more targeted error code,
|
||||
* but this will do for now... */
|
||||
#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
|
||||
|
||||
/*******************************************************
|
||||
* The CD-ROM IOCTL commands -- these should be supported by
|
||||
* all the various cdrom drivers. For the CD-ROM ioctls, we
|
||||
* will commandeer byte 0x53, or 'S'.
|
||||
*******************************************************/
|
||||
#define CDROMPAUSE 0x5301 /* Pause Audio Operation */
|
||||
#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */
|
||||
#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */
|
||||
#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index
|
||||
(struct cdrom_ti) */
|
||||
#define CDROMREADTOCHDR 0x5305 /* Read TOC header
|
||||
(struct cdrom_tochdr) */
|
||||
#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry
|
||||
(struct cdrom_tocentry) */
|
||||
#define CDROMSTOP 0x5307 /* Stop the cdrom drive */
|
||||
#define CDROMSTART 0x5308 /* Start the cdrom drive */
|
||||
#define CDROMEJECT 0x5309 /* Ejects the cdrom media */
|
||||
#define CDROMVOLCTRL 0x530a /* Control output volume
|
||||
(struct cdrom_volctrl) */
|
||||
#define CDROMSUBCHNL 0x530b /* Read subchannel data
|
||||
(struct cdrom_subchnl) */
|
||||
#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes)
|
||||
(struct cdrom_read) */
|
||||
#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes)
|
||||
(struct cdrom_read) */
|
||||
#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
|
||||
#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */
|
||||
#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session
|
||||
address of multi session disks
|
||||
(struct cdrom_multisession) */
|
||||
#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code"
|
||||
if available (struct cdrom_mcn) */
|
||||
#define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated,
|
||||
but here anyway for compatibility */
|
||||
#define CDROMRESET 0x5312 /* hard-reset the drive */
|
||||
#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting
|
||||
(struct cdrom_volctrl) */
|
||||
#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes)
|
||||
(struct cdrom_read) */
|
||||
/*
|
||||
* These ioctls are used only used in aztcd.c and optcd.c
|
||||
*/
|
||||
#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */
|
||||
#define CDROMSEEK 0x5316 /* seek msf address */
|
||||
|
||||
/*
|
||||
* This ioctl is only used by the scsi-cd driver.
|
||||
It is for playing audio in logical block addressing mode.
|
||||
*/
|
||||
#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */
|
||||
|
||||
/*
|
||||
* These ioctls are only used in optcd.c
|
||||
*/
|
||||
#define CDROMREADALL 0x5318 /* read all 2646 bytes */
|
||||
|
||||
/*
|
||||
* These ioctls are (now) only in ide-cd.c for controlling
|
||||
* drive spindown time. They should be implemented in the
|
||||
* Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
|
||||
* GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
|
||||
* -Erik
|
||||
*/
|
||||
#define CDROMGETSPINDOWN 0x531d
|
||||
#define CDROMSETSPINDOWN 0x531e
|
||||
|
||||
/*
|
||||
* These ioctls are implemented through the uniform CD-ROM driver
|
||||
* They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM
|
||||
* drivers are eventually ported to the uniform CD-ROM driver interface.
|
||||
*/
|
||||
#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */
|
||||
#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */
|
||||
#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */
|
||||
#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
|
||||
#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */
|
||||
#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */
|
||||
#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */
|
||||
#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */
|
||||
#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */
|
||||
#define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */
|
||||
#define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */
|
||||
#define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */
|
||||
|
||||
/* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386.
|
||||
* Future CDROM ioctls should be kept below 0x537F
|
||||
*/
|
||||
|
||||
/* This ioctl is only used by sbpcd at the moment */
|
||||
#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
|
||||
/* conflict with SCSI_IOCTL_GET_IDLUN */
|
||||
|
||||
/* DVD-ROM Specific ioctls */
|
||||
#define DVD_READ_STRUCT 0x5390 /* Read structure */
|
||||
#define DVD_WRITE_STRUCT 0x5391 /* Write structure */
|
||||
#define DVD_AUTH 0x5392 /* Authentication */
|
||||
|
||||
#define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */
|
||||
#define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */
|
||||
#define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */
|
||||
|
||||
/*******************************************************
|
||||
* CDROM IOCTL structures
|
||||
*******************************************************/
|
||||
|
||||
/* Address in MSF format */
|
||||
struct cdrom_msf0
|
||||
{
|
||||
__u8 minute;
|
||||
__u8 second;
|
||||
__u8 frame;
|
||||
};
|
||||
|
||||
/* Address in either MSF or logical format */
|
||||
union cdrom_addr
|
||||
{
|
||||
struct cdrom_msf0 msf;
|
||||
int lba;
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMPLAYMSF ioctl */
|
||||
struct cdrom_msf
|
||||
{
|
||||
__u8 cdmsf_min0; /* start minute */
|
||||
__u8 cdmsf_sec0; /* start second */
|
||||
__u8 cdmsf_frame0; /* start frame */
|
||||
__u8 cdmsf_min1; /* end minute */
|
||||
__u8 cdmsf_sec1; /* end second */
|
||||
__u8 cdmsf_frame1; /* end frame */
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMPLAYTRKIND ioctl */
|
||||
struct cdrom_ti
|
||||
{
|
||||
__u8 cdti_trk0; /* start track */
|
||||
__u8 cdti_ind0; /* start index */
|
||||
__u8 cdti_trk1; /* end track */
|
||||
__u8 cdti_ind1; /* end index */
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMREADTOCHDR ioctl */
|
||||
struct cdrom_tochdr
|
||||
{
|
||||
__u8 cdth_trk0; /* start track */
|
||||
__u8 cdth_trk1; /* end track */
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */
|
||||
struct cdrom_volctrl
|
||||
{
|
||||
__u8 channel0;
|
||||
__u8 channel1;
|
||||
__u8 channel2;
|
||||
__u8 channel3;
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMSUBCHNL ioctl */
|
||||
struct cdrom_subchnl
|
||||
{
|
||||
__u8 cdsc_format;
|
||||
__u8 cdsc_audiostatus;
|
||||
__u8 cdsc_adr: 4;
|
||||
__u8 cdsc_ctrl: 4;
|
||||
__u8 cdsc_trk;
|
||||
__u8 cdsc_ind;
|
||||
union cdrom_addr cdsc_absaddr;
|
||||
union cdrom_addr cdsc_reladdr;
|
||||
};
|
||||
|
||||
|
||||
/* This struct is used by the CDROMREADTOCENTRY ioctl */
|
||||
struct cdrom_tocentry
|
||||
{
|
||||
__u8 cdte_track;
|
||||
__u8 cdte_adr :4;
|
||||
__u8 cdte_ctrl :4;
|
||||
__u8 cdte_format;
|
||||
union cdrom_addr cdte_addr;
|
||||
__u8 cdte_datamode;
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */
|
||||
struct cdrom_read
|
||||
{
|
||||
int cdread_lba;
|
||||
char *cdread_bufaddr;
|
||||
int cdread_buflen;
|
||||
};
|
||||
|
||||
/* This struct is used by the CDROMREADAUDIO ioctl */
|
||||
struct cdrom_read_audio
|
||||
{
|
||||
union cdrom_addr addr; /* frame address */
|
||||
__u8 addr_format; /* CDROM_LBA or CDROM_MSF */
|
||||
int nframes; /* number of 2352-byte-frames to read at once */
|
||||
__u8 __user *buf; /* frame buffer (size: nframes*2352 bytes) */
|
||||
};
|
||||
|
||||
/* This struct is used with the CDROMMULTISESSION ioctl */
|
||||
struct cdrom_multisession
|
||||
{
|
||||
union cdrom_addr addr; /* frame address: start-of-last-session
|
||||
(not the new "frame 16"!). Only valid
|
||||
if the "xa_flag" is true. */
|
||||
__u8 xa_flag; /* 1: "is XA disk" */
|
||||
__u8 addr_format; /* CDROM_LBA or CDROM_MSF */
|
||||
};
|
||||
|
||||
/* This struct is used with the CDROM_GET_MCN ioctl.
|
||||
* Very few audio discs actually have Universal Product Code information,
|
||||
* which should just be the Medium Catalog Number on the box. Also note
|
||||
* that the way the codeis written on CD is _not_ uniform across all discs!
|
||||
*/
|
||||
struct cdrom_mcn
|
||||
{
|
||||
__u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
|
||||
};
|
||||
|
||||
/* This is used by the CDROMPLAYBLK ioctl */
|
||||
struct cdrom_blk
|
||||
{
|
||||
unsigned from;
|
||||
unsigned short len;
|
||||
};
|
||||
|
||||
#define CDROM_PACKET_SIZE 12
|
||||
|
||||
#define CGC_DATA_UNKNOWN 0
|
||||
#define CGC_DATA_WRITE 1
|
||||
#define CGC_DATA_READ 2
|
||||
#define CGC_DATA_NONE 3
|
||||
|
||||
/* for CDROM_PACKET_COMMAND ioctl */
|
||||
struct cdrom_generic_command
|
||||
{
|
||||
unsigned char cmd[CDROM_PACKET_SIZE];
|
||||
unsigned char __user *buffer;
|
||||
unsigned int buflen;
|
||||
int stat;
|
||||
struct request_sense __user *sense;
|
||||
unsigned char data_direction;
|
||||
int quiet;
|
||||
int timeout;
|
||||
void __user *reserved[1]; /* unused, actually */
|
||||
};
|
||||
|
||||
/*
|
||||
* A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
|
||||
* 2340, or 2352 bytes long.
|
||||
|
||||
* Sector types of the standard CD-ROM data formats:
|
||||
*
|
||||
* format sector type user data size (bytes)
|
||||
* -----------------------------------------------------------------------------
|
||||
* 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW)
|
||||
* 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE)
|
||||
* 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0)
|
||||
* 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE)
|
||||
* 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
|
||||
*
|
||||
*
|
||||
* The layout of the standard CD-ROM data formats:
|
||||
* -----------------------------------------------------------------------------
|
||||
* - audio (red): | audio_sample_bytes |
|
||||
* | 2352 |
|
||||
*
|
||||
* - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
|
||||
* | 12 - 4 - 2048 - 4 - 8 - 276 |
|
||||
*
|
||||
* - data (yellow, mode2): | sync - head - data |
|
||||
* | 12 - 4 - 2336 |
|
||||
*
|
||||
* - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
|
||||
* | 12 - 4 - 8 - 2048 - 4 - 276 |
|
||||
*
|
||||
* - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
|
||||
* | 12 - 4 - 8 - 2324 - 4 |
|
||||
*
|
||||
*/
|
||||
|
||||
/* Some generally useful CD-ROM information -- mostly based on the above */
|
||||
#define CD_MINS 74 /* max. minutes per CD, not really a limit */
|
||||
#define CD_SECS 60 /* seconds per minute */
|
||||
#define CD_FRAMES 75 /* frames per second */
|
||||
#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */
|
||||
#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */
|
||||
#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
|
||||
#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
|
||||
#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */
|
||||
#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */
|
||||
#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */
|
||||
#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */
|
||||
#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */
|
||||
#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */
|
||||
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
|
||||
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
|
||||
#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */
|
||||
/* most drives don't deliver everything: */
|
||||
#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/
|
||||
#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
|
||||
|
||||
#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */
|
||||
#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */
|
||||
#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */
|
||||
|
||||
/* CD-ROM address types (cdrom_tocentry.cdte_format) */
|
||||
#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */
|
||||
#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */
|
||||
|
||||
/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */
|
||||
#define CDROM_DATA_TRACK 0x04
|
||||
|
||||
/* The leadout track is always 0xAA, regardless of # of tracks on disc */
|
||||
#define CDROM_LEADOUT 0xAA
|
||||
|
||||
/* audio states (from SCSI-2, but seen with other drives, too) */
|
||||
#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
|
||||
#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
|
||||
#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
|
||||
#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
|
||||
#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
|
||||
#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
|
||||
|
||||
/* capability flags used with the uniform CD-ROM driver */
|
||||
#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */
|
||||
#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */
|
||||
#define CDC_LOCK 0x4 /* disable manual eject */
|
||||
#define CDC_SELECT_SPEED 0x8 /* programmable speed */
|
||||
#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */
|
||||
#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */
|
||||
#define CDC_MCN 0x40 /* Medium Catalog Number */
|
||||
#define CDC_MEDIA_CHANGED 0x80 /* media changed */
|
||||
#define CDC_PLAY_AUDIO 0x100 /* audio functions */
|
||||
#define CDC_RESET 0x200 /* hard reset device */
|
||||
#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */
|
||||
#define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */
|
||||
#define CDC_CD_R 0x2000 /* drive is a CD-R */
|
||||
#define CDC_CD_RW 0x4000 /* drive is a CD-RW */
|
||||
#define CDC_DVD 0x8000 /* drive is a DVD */
|
||||
#define CDC_DVD_R 0x10000 /* drive can write DVD-R */
|
||||
#define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */
|
||||
#define CDC_MO_DRIVE 0x40000 /* drive is an MO device */
|
||||
#define CDC_MRW 0x80000 /* drive can read MRW */
|
||||
#define CDC_MRW_W 0x100000 /* drive can write MRW */
|
||||
#define CDC_RAM 0x200000 /* ok to open for WRITE */
|
||||
|
||||
/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
|
||||
#define CDS_NO_INFO 0 /* if not implemented */
|
||||
#define CDS_NO_DISC 1
|
||||
#define CDS_TRAY_OPEN 2
|
||||
#define CDS_DRIVE_NOT_READY 3
|
||||
#define CDS_DISC_OK 4
|
||||
|
||||
/* return values for the CDROM_DISC_STATUS ioctl */
|
||||
/* can also return CDS_NO_[INFO|DISC], from above */
|
||||
#define CDS_AUDIO 100
|
||||
#define CDS_DATA_1 101
|
||||
#define CDS_DATA_2 102
|
||||
#define CDS_XA_2_1 103
|
||||
#define CDS_XA_2_2 104
|
||||
#define CDS_MIXED 105
|
||||
|
||||
/* User-configurable behavior options for the uniform CD-ROM driver */
|
||||
#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
|
||||
#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */
|
||||
#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */
|
||||
#define CDO_LOCK 0x8 /* lock tray on open files */
|
||||
#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
|
||||
|
||||
/* Special codes used when specifying changer slots. */
|
||||
#define CDSL_NONE (INT_MAX-1)
|
||||
#define CDSL_CURRENT INT_MAX
|
||||
|
||||
/* For partition based multisession access. IDE can handle 64 partitions
|
||||
* per drive - SCSI CD-ROM's use minors to differentiate between the
|
||||
* various drives, so we can't do multisessions the same way there.
|
||||
* Use the -o session=x option to mount on them.
|
||||
*/
|
||||
#define CD_PART_MAX 64
|
||||
#define CD_PART_MASK (CD_PART_MAX - 1)
|
||||
|
||||
/*********************************************************************
|
||||
* Generic Packet commands, MMC commands, and such
|
||||
*********************************************************************/
|
||||
|
||||
/* The generic packet command opcodes for CD/DVD Logical Units,
|
||||
* From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
|
||||
#define GPCMD_BLANK 0xa1
|
||||
#define GPCMD_CLOSE_TRACK 0x5b
|
||||
#define GPCMD_FLUSH_CACHE 0x35
|
||||
#define GPCMD_FORMAT_UNIT 0x04
|
||||
#define GPCMD_GET_CONFIGURATION 0x46
|
||||
#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
|
||||
#define GPCMD_GET_PERFORMANCE 0xac
|
||||
#define GPCMD_INQUIRY 0x12
|
||||
#define GPCMD_LOAD_UNLOAD 0xa6
|
||||
#define GPCMD_MECHANISM_STATUS 0xbd
|
||||
#define GPCMD_MODE_SELECT_10 0x55
|
||||
#define GPCMD_MODE_SENSE_10 0x5a
|
||||
#define GPCMD_PAUSE_RESUME 0x4b
|
||||
#define GPCMD_PLAY_AUDIO_10 0x45
|
||||
#define GPCMD_PLAY_AUDIO_MSF 0x47
|
||||
#define GPCMD_PLAY_AUDIO_TI 0x48
|
||||
#define GPCMD_PLAY_CD 0xbc
|
||||
#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
|
||||
#define GPCMD_READ_10 0x28
|
||||
#define GPCMD_READ_12 0xa8
|
||||
#define GPCMD_READ_BUFFER 0x3c
|
||||
#define GPCMD_READ_BUFFER_CAPACITY 0x5c
|
||||
#define GPCMD_READ_CDVD_CAPACITY 0x25
|
||||
#define GPCMD_READ_CD 0xbe
|
||||
#define GPCMD_READ_CD_MSF 0xb9
|
||||
#define GPCMD_READ_DISC_INFO 0x51
|
||||
#define GPCMD_READ_DVD_STRUCTURE 0xad
|
||||
#define GPCMD_READ_FORMAT_CAPACITIES 0x23
|
||||
#define GPCMD_READ_HEADER 0x44
|
||||
#define GPCMD_READ_TRACK_RZONE_INFO 0x52
|
||||
#define GPCMD_READ_SUBCHANNEL 0x42
|
||||
#define GPCMD_READ_TOC_PMA_ATIP 0x43
|
||||
#define GPCMD_REPAIR_RZONE_TRACK 0x58
|
||||
#define GPCMD_REPORT_KEY 0xa4
|
||||
#define GPCMD_REQUEST_SENSE 0x03
|
||||
#define GPCMD_RESERVE_RZONE_TRACK 0x53
|
||||
#define GPCMD_SEND_CUE_SHEET 0x5d
|
||||
#define GPCMD_SCAN 0xba
|
||||
#define GPCMD_SEEK 0x2b
|
||||
#define GPCMD_SEND_DVD_STRUCTURE 0xbf
|
||||
#define GPCMD_SEND_EVENT 0xa2
|
||||
#define GPCMD_SEND_KEY 0xa3
|
||||
#define GPCMD_SEND_OPC 0x54
|
||||
#define GPCMD_SET_READ_AHEAD 0xa7
|
||||
#define GPCMD_SET_STREAMING 0xb6
|
||||
#define GPCMD_START_STOP_UNIT 0x1b
|
||||
#define GPCMD_STOP_PLAY_SCAN 0x4e
|
||||
#define GPCMD_TEST_UNIT_READY 0x00
|
||||
#define GPCMD_VERIFY_10 0x2f
|
||||
#define GPCMD_WRITE_10 0x2a
|
||||
#define GPCMD_WRITE_12 0xaa
|
||||
#define GPCMD_WRITE_AND_VERIFY_10 0x2e
|
||||
#define GPCMD_WRITE_BUFFER 0x3b
|
||||
/* This is listed as optional in ATAPI 2.6, but is (curiously)
|
||||
* missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
|
||||
* Table 377 as an MMC command for SCSi devices though... Most ATAPI
|
||||
* drives support it. */
|
||||
#define GPCMD_SET_SPEED 0xbb
|
||||
/* This seems to be a SCSI specific CD-ROM opcode
|
||||
* to play data at track/index */
|
||||
#define GPCMD_PLAYAUDIO_TI 0x48
|
||||
/*
|
||||
* From MS Media Status Notification Support Specification. For
|
||||
* older drives only.
|
||||
*/
|
||||
#define GPCMD_GET_MEDIA_STATUS 0xda
|
||||
|
||||
/* Mode page codes for mode sense/set */
|
||||
#define GPMODE_VENDOR_PAGE 0x00
|
||||
#define GPMODE_R_W_ERROR_PAGE 0x01
|
||||
#define GPMODE_WRITE_PARMS_PAGE 0x05
|
||||
#define GPMODE_WCACHING_PAGE 0x08
|
||||
#define GPMODE_AUDIO_CTL_PAGE 0x0e
|
||||
#define GPMODE_POWER_PAGE 0x1a
|
||||
#define GPMODE_FAULT_FAIL_PAGE 0x1c
|
||||
#define GPMODE_TO_PROTECT_PAGE 0x1d
|
||||
#define GPMODE_CAPABILITIES_PAGE 0x2a
|
||||
#define GPMODE_ALL_PAGES 0x3f
|
||||
/* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor
|
||||
* of MODE_SENSE_POWER_PAGE */
|
||||
#define GPMODE_CDROM_PAGE 0x0d
|
||||
|
||||
|
||||
|
||||
/* DVD struct types */
|
||||
#define DVD_STRUCT_PHYSICAL 0x00
|
||||
#define DVD_STRUCT_COPYRIGHT 0x01
|
||||
#define DVD_STRUCT_DISCKEY 0x02
|
||||
#define DVD_STRUCT_BCA 0x03
|
||||
#define DVD_STRUCT_MANUFACT 0x04
|
||||
|
||||
struct dvd_layer {
|
||||
__u8 book_version : 4;
|
||||
__u8 book_type : 4;
|
||||
__u8 min_rate : 4;
|
||||
__u8 disc_size : 4;
|
||||
__u8 layer_type : 4;
|
||||
__u8 track_path : 1;
|
||||
__u8 nlayers : 2;
|
||||
__u8 track_density : 4;
|
||||
__u8 linear_density : 4;
|
||||
__u8 bca : 1;
|
||||
__u32 start_sector;
|
||||
__u32 end_sector;
|
||||
__u32 end_sector_l0;
|
||||
};
|
||||
|
||||
#define DVD_LAYERS 4
|
||||
|
||||
struct dvd_physical {
|
||||
__u8 type;
|
||||
__u8 layer_num;
|
||||
struct dvd_layer layer[DVD_LAYERS];
|
||||
};
|
||||
|
||||
struct dvd_copyright {
|
||||
__u8 type;
|
||||
|
||||
__u8 layer_num;
|
||||
__u8 cpst;
|
||||
__u8 rmi;
|
||||
};
|
||||
|
||||
struct dvd_disckey {
|
||||
__u8 type;
|
||||
|
||||
unsigned agid : 2;
|
||||
__u8 value[2048];
|
||||
};
|
||||
|
||||
struct dvd_bca {
|
||||
__u8 type;
|
||||
|
||||
int len;
|
||||
__u8 value[188];
|
||||
};
|
||||
|
||||
struct dvd_manufact {
|
||||
__u8 type;
|
||||
|
||||
__u8 layer_num;
|
||||
int len;
|
||||
__u8 value[2048];
|
||||
};
|
||||
|
||||
typedef union {
|
||||
__u8 type;
|
||||
|
||||
struct dvd_physical physical;
|
||||
struct dvd_copyright copyright;
|
||||
struct dvd_disckey disckey;
|
||||
struct dvd_bca bca;
|
||||
struct dvd_manufact manufact;
|
||||
} dvd_struct;
|
||||
|
||||
/*
|
||||
* DVD authentication ioctl
|
||||
*/
|
||||
|
||||
/* Authentication states */
|
||||
#define DVD_LU_SEND_AGID 0
|
||||
#define DVD_HOST_SEND_CHALLENGE 1
|
||||
#define DVD_LU_SEND_KEY1 2
|
||||
#define DVD_LU_SEND_CHALLENGE 3
|
||||
#define DVD_HOST_SEND_KEY2 4
|
||||
|
||||
/* Termination states */
|
||||
#define DVD_AUTH_ESTABLISHED 5
|
||||
#define DVD_AUTH_FAILURE 6
|
||||
|
||||
/* Other functions */
|
||||
#define DVD_LU_SEND_TITLE_KEY 7
|
||||
#define DVD_LU_SEND_ASF 8
|
||||
#define DVD_INVALIDATE_AGID 9
|
||||
#define DVD_LU_SEND_RPC_STATE 10
|
||||
#define DVD_HOST_SEND_RPC_STATE 11
|
||||
|
||||
/* State data */
|
||||
typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */
|
||||
typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */
|
||||
|
||||
struct dvd_lu_send_agid {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
};
|
||||
|
||||
struct dvd_host_send_challenge {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_challenge chal;
|
||||
};
|
||||
|
||||
struct dvd_send_key {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_key key;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_challenge {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_challenge chal;
|
||||
};
|
||||
|
||||
#define DVD_CPM_NO_COPYRIGHT 0
|
||||
#define DVD_CPM_COPYRIGHTED 1
|
||||
|
||||
#define DVD_CP_SEC_NONE 0
|
||||
#define DVD_CP_SEC_EXIST 1
|
||||
|
||||
#define DVD_CGMS_UNRESTRICTED 0
|
||||
#define DVD_CGMS_SINGLE 2
|
||||
#define DVD_CGMS_RESTRICTED 3
|
||||
|
||||
struct dvd_lu_send_title_key {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
dvd_key title_key;
|
||||
int lba;
|
||||
unsigned cpm : 1;
|
||||
unsigned cp_sec : 1;
|
||||
unsigned cgms : 2;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_asf {
|
||||
__u8 type;
|
||||
unsigned agid : 2;
|
||||
|
||||
unsigned asf : 1;
|
||||
};
|
||||
|
||||
struct dvd_host_send_rpcstate {
|
||||
__u8 type;
|
||||
__u8 pdrc;
|
||||
};
|
||||
|
||||
struct dvd_lu_send_rpcstate {
|
||||
__u8 type : 2;
|
||||
__u8 vra : 3;
|
||||
__u8 ucca : 3;
|
||||
__u8 region_mask;
|
||||
__u8 rpc_scheme;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
__u8 type;
|
||||
|
||||
struct dvd_lu_send_agid lsa;
|
||||
struct dvd_host_send_challenge hsc;
|
||||
struct dvd_send_key lsk;
|
||||
struct dvd_lu_send_challenge lsc;
|
||||
struct dvd_send_key hsk;
|
||||
struct dvd_lu_send_title_key lstk;
|
||||
struct dvd_lu_send_asf lsasf;
|
||||
struct dvd_host_send_rpcstate hrpcs;
|
||||
struct dvd_lu_send_rpcstate lrpcs;
|
||||
} dvd_authinfo;
|
||||
|
||||
struct request_sense {
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 valid : 1;
|
||||
__u8 error_code : 7;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 error_code : 7;
|
||||
__u8 valid : 1;
|
||||
#endif
|
||||
__u8 segment_number;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved1 : 2;
|
||||
__u8 ili : 1;
|
||||
__u8 reserved2 : 1;
|
||||
__u8 sense_key : 4;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 sense_key : 4;
|
||||
__u8 reserved2 : 1;
|
||||
__u8 ili : 1;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 information[4];
|
||||
__u8 add_sense_len;
|
||||
__u8 command_info[4];
|
||||
__u8 asc;
|
||||
__u8 ascq;
|
||||
__u8 fruc;
|
||||
__u8 sks[3];
|
||||
__u8 asb[46];
|
||||
};
|
||||
|
||||
/*
|
||||
* feature profile
|
||||
*/
|
||||
#define CDF_RWRT 0x0020 /* "Random Writable" */
|
||||
#define CDF_HWDM 0x0024 /* "Hardware Defect Management" */
|
||||
#define CDF_MRW 0x0028
|
||||
|
||||
/*
|
||||
* media status bits
|
||||
*/
|
||||
#define CDM_MRW_NOTMRW 0
|
||||
#define CDM_MRW_BGFORMAT_INACTIVE 1
|
||||
#define CDM_MRW_BGFORMAT_ACTIVE 2
|
||||
#define CDM_MRW_BGFORMAT_COMPLETE 3
|
||||
|
||||
/*
|
||||
* mrw address spaces
|
||||
*/
|
||||
#define MRW_LBA_DMA 0
|
||||
#define MRW_LBA_GAA 1
|
||||
|
||||
/*
|
||||
* mrw mode pages (first is deprecated) -- probed at init time and
|
||||
* cdi->mrw_mode_page is set
|
||||
*/
|
||||
#define MRW_MODE_PC_PRE1 0x2c
|
||||
#define MRW_MODE_PC 0x03
|
||||
|
||||
struct mrw_feature_desc {
|
||||
__be16 feature_code;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved1 : 2;
|
||||
__u8 feature_version : 4;
|
||||
__u8 persistent : 1;
|
||||
__u8 curr : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 curr : 1;
|
||||
__u8 persistent : 1;
|
||||
__u8 feature_version : 4;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 add_len;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved2 : 7;
|
||||
__u8 write : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 write : 1;
|
||||
__u8 reserved2 : 7;
|
||||
#endif
|
||||
__u8 reserved3;
|
||||
__u8 reserved4;
|
||||
__u8 reserved5;
|
||||
};
|
||||
|
||||
/* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */
|
||||
struct rwrt_feature_desc {
|
||||
__be16 feature_code;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved1 : 2;
|
||||
__u8 feature_version : 4;
|
||||
__u8 persistent : 1;
|
||||
__u8 curr : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 curr : 1;
|
||||
__u8 persistent : 1;
|
||||
__u8 feature_version : 4;
|
||||
__u8 reserved1 : 2;
|
||||
#endif
|
||||
__u8 add_len;
|
||||
__u32 last_lba;
|
||||
__u32 block_size;
|
||||
__u16 blocking;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved2 : 7;
|
||||
__u8 page_present : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 page_present : 1;
|
||||
__u8 reserved2 : 7;
|
||||
#endif
|
||||
__u8 reserved3;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
__be16 disc_information_length;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved1 : 3;
|
||||
__u8 erasable : 1;
|
||||
__u8 border_status : 2;
|
||||
__u8 disc_status : 2;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 disc_status : 2;
|
||||
__u8 border_status : 2;
|
||||
__u8 erasable : 1;
|
||||
__u8 reserved1 : 3;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 n_first_track;
|
||||
__u8 n_sessions_lsb;
|
||||
__u8 first_track_lsb;
|
||||
__u8 last_track_lsb;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 did_v : 1;
|
||||
__u8 dbc_v : 1;
|
||||
__u8 uru : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 dbit : 1;
|
||||
__u8 mrw_status : 2;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 mrw_status : 2;
|
||||
__u8 dbit : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 uru : 1;
|
||||
__u8 dbc_v : 1;
|
||||
__u8 did_v : 1;
|
||||
#endif
|
||||
__u8 disc_type;
|
||||
__u8 n_sessions_msb;
|
||||
__u8 first_track_msb;
|
||||
__u8 last_track_msb;
|
||||
__u32 disc_id;
|
||||
__u32 lead_in;
|
||||
__u32 lead_out;
|
||||
__u8 disc_bar_code[8];
|
||||
__u8 reserved3;
|
||||
__u8 n_opc;
|
||||
} disc_information;
|
||||
|
||||
typedef struct {
|
||||
__be16 track_information_length;
|
||||
__u8 track_lsb;
|
||||
__u8 session_lsb;
|
||||
__u8 reserved1;
|
||||
#if defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 reserved2 : 2;
|
||||
__u8 damage : 1;
|
||||
__u8 copy : 1;
|
||||
__u8 track_mode : 4;
|
||||
__u8 rt : 1;
|
||||
__u8 blank : 1;
|
||||
__u8 packet : 1;
|
||||
__u8 fp : 1;
|
||||
__u8 data_mode : 4;
|
||||
__u8 reserved3 : 6;
|
||||
__u8 lra_v : 1;
|
||||
__u8 nwa_v : 1;
|
||||
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 track_mode : 4;
|
||||
__u8 copy : 1;
|
||||
__u8 damage : 1;
|
||||
__u8 reserved2 : 2;
|
||||
__u8 data_mode : 4;
|
||||
__u8 fp : 1;
|
||||
__u8 packet : 1;
|
||||
__u8 blank : 1;
|
||||
__u8 rt : 1;
|
||||
__u8 nwa_v : 1;
|
||||
__u8 lra_v : 1;
|
||||
__u8 reserved3 : 6;
|
||||
#endif
|
||||
__be32 track_start;
|
||||
__be32 next_writable;
|
||||
__be32 free_blocks;
|
||||
__be32 fixed_packet_size;
|
||||
__be32 track_size;
|
||||
__be32 last_rec_address;
|
||||
} track_information;
|
||||
|
||||
struct feature_header {
|
||||
__u32 data_len;
|
||||
__u8 reserved1;
|
||||
__u8 reserved2;
|
||||
__u16 curr_profile;
|
||||
};
|
||||
|
||||
struct mode_page_header {
|
||||
__be16 mode_data_length;
|
||||
__u8 medium_type;
|
||||
__u8 reserved1;
|
||||
__u8 reserved2;
|
||||
__u8 reserved3;
|
||||
__be16 desc_length;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/fs.h> /* not really needed, later.. */
|
||||
#include <linux/list.h>
|
||||
#include <uapi/linux/cdrom.h>
|
||||
|
||||
struct packet_command
|
||||
{
|
||||
|
@ -1209,6 +311,4 @@ static inline int msf_to_lba(u8 m, u8 s, u8 f)
|
|||
{
|
||||
return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
|
||||
}
|
||||
#endif /* End of kernel only stuff */
|
||||
|
||||
#endif /* _LINUX_CDROM_H */
|
||||
|
|
|
@ -1,68 +1,10 @@
|
|||
#ifndef _CM4000_H_
|
||||
#define _CM4000_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/cm4000_cs.h>
|
||||
|
||||
#define MAX_ATR 33
|
||||
|
||||
#define CM4000_MAX_DEV 4
|
||||
|
||||
/* those two structures are passed via ioctl() from/to userspace. They are
|
||||
* used by existing userspace programs, so I kepth the awkward "bIFSD" naming
|
||||
* not to break compilation of userspace apps. -HW */
|
||||
|
||||
typedef struct atreq {
|
||||
__s32 atr_len;
|
||||
unsigned char atr[64];
|
||||
__s32 power_act;
|
||||
unsigned char bIFSD;
|
||||
unsigned char bIFSC;
|
||||
} atreq_t;
|
||||
|
||||
|
||||
/* what is particularly stupid in the original driver is the arch-dependent
|
||||
* member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
|
||||
* will lay out the structure members differently than the 64bit kernel.
|
||||
*
|
||||
* I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
|
||||
* On 32bit this will make no difference. With 64bit kernels, it will make
|
||||
* 32bit apps work, too.
|
||||
*/
|
||||
|
||||
typedef struct ptsreq {
|
||||
__u32 protocol; /*T=0: 2^0, T=1: 2^1*/
|
||||
unsigned char flags;
|
||||
unsigned char pts1;
|
||||
unsigned char pts2;
|
||||
unsigned char pts3;
|
||||
} ptsreq_t;
|
||||
|
||||
#define CM_IOC_MAGIC 'c'
|
||||
#define CM_IOC_MAXNR 255
|
||||
|
||||
#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
|
||||
#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
|
||||
#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
|
||||
#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
|
||||
#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
|
||||
|
||||
#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
|
||||
|
||||
/* card and device states */
|
||||
#define CM_CARD_INSERTED 0x01
|
||||
#define CM_CARD_POWERED 0x02
|
||||
#define CM_ATR_PRESENT 0x04
|
||||
#define CM_ATR_VALID 0x08
|
||||
#define CM_STATE_VALID 0x0f
|
||||
/* extra info only from CM4000 */
|
||||
#define CM_NO_READER 0x10
|
||||
#define CM_BAD_CARD 0x20
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define DEVICE_NAME "cmm"
|
||||
#define MODULE_NAME "cm4000_cs"
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _CM4000_H_ */
|
||||
|
|
|
@ -14,111 +14,11 @@
|
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef CN_PROC_H
|
||||
#define CN_PROC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/cn_proc.h>
|
||||
|
||||
/*
|
||||
* Userspace sends this enum to register with the kernel that it is listening
|
||||
* for events on the connector.
|
||||
*/
|
||||
enum proc_cn_mcast_op {
|
||||
PROC_CN_MCAST_LISTEN = 1,
|
||||
PROC_CN_MCAST_IGNORE = 2
|
||||
};
|
||||
|
||||
/*
|
||||
* From the user's point of view, the process
|
||||
* ID is the thread group ID and thread ID is the internal
|
||||
* kernel "pid". So, fields are assigned as follow:
|
||||
*
|
||||
* In user space - In kernel space
|
||||
*
|
||||
* parent process ID = parent->tgid
|
||||
* parent thread ID = parent->pid
|
||||
* child process ID = child->tgid
|
||||
* child thread ID = child->pid
|
||||
*/
|
||||
|
||||
struct proc_event {
|
||||
enum what {
|
||||
/* Use successive bits so the enums can be used to record
|
||||
* sets of events as well
|
||||
*/
|
||||
PROC_EVENT_NONE = 0x00000000,
|
||||
PROC_EVENT_FORK = 0x00000001,
|
||||
PROC_EVENT_EXEC = 0x00000002,
|
||||
PROC_EVENT_UID = 0x00000004,
|
||||
PROC_EVENT_GID = 0x00000040,
|
||||
PROC_EVENT_SID = 0x00000080,
|
||||
PROC_EVENT_PTRACE = 0x00000100,
|
||||
PROC_EVENT_COMM = 0x00000200,
|
||||
/* "next" should be 0x00000400 */
|
||||
/* "last" is the last process event: exit */
|
||||
PROC_EVENT_EXIT = 0x80000000
|
||||
} what;
|
||||
__u32 cpu;
|
||||
__u64 __attribute__((aligned(8))) timestamp_ns;
|
||||
/* Number of nano seconds since system boot */
|
||||
union { /* must be last field of proc_event struct */
|
||||
struct {
|
||||
__u32 err;
|
||||
} ack;
|
||||
|
||||
struct fork_proc_event {
|
||||
__kernel_pid_t parent_pid;
|
||||
__kernel_pid_t parent_tgid;
|
||||
__kernel_pid_t child_pid;
|
||||
__kernel_pid_t child_tgid;
|
||||
} fork;
|
||||
|
||||
struct exec_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
} exec;
|
||||
|
||||
struct id_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
union {
|
||||
__u32 ruid; /* task uid */
|
||||
__u32 rgid; /* task gid */
|
||||
} r;
|
||||
union {
|
||||
__u32 euid;
|
||||
__u32 egid;
|
||||
} e;
|
||||
} id;
|
||||
|
||||
struct sid_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
} sid;
|
||||
|
||||
struct ptrace_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
__kernel_pid_t tracer_pid;
|
||||
__kernel_pid_t tracer_tgid;
|
||||
} ptrace;
|
||||
|
||||
struct comm_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
char comm[16];
|
||||
} comm;
|
||||
|
||||
struct exit_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
__u32 exit_code, exit_signal;
|
||||
} exit;
|
||||
} event_data;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_PROC_EVENTS
|
||||
void proc_fork_connector(struct task_struct *task);
|
||||
void proc_exec_connector(struct task_struct *task);
|
||||
|
@ -151,5 +51,4 @@ static inline void proc_ptrace_connector(struct task_struct *task,
|
|||
static inline void proc_exit_connector(struct task_struct *task)
|
||||
{}
|
||||
#endif /* CONFIG_PROC_EVENTS */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* CN_PROC_H */
|
||||
|
|
|
@ -55,690 +55,12 @@ Mellon the rights to redistribute these changes without encumbrance.
|
|||
* Linux modifications by
|
||||
* Peter Braam, Aug 1996
|
||||
*/
|
||||
|
||||
#ifndef _CODA_HEADER_
|
||||
#define _CODA_HEADER_
|
||||
|
||||
|
||||
/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
|
||||
#if defined(__NetBSD__) || \
|
||||
((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL))
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef CODA_MAXSYMLINKS
|
||||
#define CODA_MAXSYMLINKS 10
|
||||
#endif
|
||||
|
||||
#if defined(DJGPP) || defined(__CYGWIN32__)
|
||||
#ifdef KERNEL
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned short u_short;
|
||||
typedef u_long ino_t;
|
||||
typedef u_long dev_t;
|
||||
typedef void * caddr_t;
|
||||
#ifdef DOS
|
||||
typedef unsigned __int64 u_quad_t;
|
||||
#else
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif
|
||||
|
||||
#define inline
|
||||
|
||||
struct timespec {
|
||||
long ts_sec;
|
||||
long ts_nsec;
|
||||
};
|
||||
#else /* DJGPP but not KERNEL */
|
||||
#include <sys/time.h>
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif /* !KERNEL */
|
||||
#endif /* !DJGPP */
|
||||
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <linux/time.h>
|
||||
#define cdev_t u_quad_t
|
||||
#ifndef __KERNEL__
|
||||
#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
|
||||
#define _UQUAD_T_ 1
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif
|
||||
#else /*__KERNEL__ */
|
||||
typedef unsigned long long u_quad_t;
|
||||
#endif /* __KERNEL__ */
|
||||
#else
|
||||
#define cdev_t dev_t
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* nanoseconds */
|
||||
};
|
||||
#include <uapi/linux/coda.h>
|
||||
#endif
|
||||
|
||||
#ifndef __BIT_TYPES_DEFINED__
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned short u_int16_t;
|
||||
typedef int int32_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Cfs constants
|
||||
*/
|
||||
#define CODA_MAXNAMLEN 255
|
||||
#define CODA_MAXPATHLEN 1024
|
||||
#define CODA_MAXSYMLINK 10
|
||||
|
||||
/* these are Coda's version of O_RDONLY etc combinations
|
||||
* to deal with VFS open modes
|
||||
*/
|
||||
#define C_O_READ 0x001
|
||||
#define C_O_WRITE 0x002
|
||||
#define C_O_TRUNC 0x010
|
||||
#define C_O_EXCL 0x100
|
||||
#define C_O_CREAT 0x200
|
||||
|
||||
/* these are to find mode bits in Venus */
|
||||
#define C_M_READ 00400
|
||||
#define C_M_WRITE 00200
|
||||
|
||||
/* for access Venus will use */
|
||||
#define C_A_C_OK 8 /* Test for writing upon create. */
|
||||
#define C_A_R_OK 4 /* Test for read permission. */
|
||||
#define C_A_W_OK 2 /* Test for write permission. */
|
||||
#define C_A_X_OK 1 /* Test for execute permission. */
|
||||
#define C_A_F_OK 0 /* Test for existence. */
|
||||
|
||||
|
||||
|
||||
#ifndef _VENUS_DIRENT_T_
|
||||
#define _VENUS_DIRENT_T_ 1
|
||||
struct venus_dirent {
|
||||
u_int32_t d_fileno; /* file number of entry */
|
||||
u_int16_t d_reclen; /* length of this record */
|
||||
u_int8_t d_type; /* file type, see below */
|
||||
u_int8_t d_namlen; /* length of string in d_name */
|
||||
char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
|
||||
};
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
|
||||
(((dp)->d_namlen+1 + 3) &~ 3))
|
||||
|
||||
/*
|
||||
* File types
|
||||
*/
|
||||
#define CDT_UNKNOWN 0
|
||||
#define CDT_FIFO 1
|
||||
#define CDT_CHR 2
|
||||
#define CDT_DIR 4
|
||||
#define CDT_BLK 6
|
||||
#define CDT_REG 8
|
||||
#define CDT_LNK 10
|
||||
#define CDT_SOCK 12
|
||||
#define CDT_WHT 14
|
||||
|
||||
/*
|
||||
* Convert between stat structure types and directory types.
|
||||
*/
|
||||
#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
|
||||
#define CDTTOIF(dirtype) ((dirtype) << 12)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _VUID_T_
|
||||
#define _VUID_T_
|
||||
typedef u_int32_t vuid_t;
|
||||
typedef u_int32_t vgid_t;
|
||||
#endif /*_VUID_T_ */
|
||||
|
||||
struct CodaFid {
|
||||
u_int32_t opaque[4];
|
||||
};
|
||||
|
||||
#define coda_f2i(fid)\
|
||||
(fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
|
||||
|
||||
#ifndef _VENUS_VATTR_T_
|
||||
#define _VENUS_VATTR_T_
|
||||
/*
|
||||
* Vnode types. VNON means no type.
|
||||
*/
|
||||
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
|
||||
|
||||
struct coda_vattr {
|
||||
long va_type; /* vnode type (for create) */
|
||||
u_short va_mode; /* files access mode and type */
|
||||
short va_nlink; /* number of references to file */
|
||||
vuid_t va_uid; /* owner user id */
|
||||
vgid_t va_gid; /* owner group id */
|
||||
long va_fileid; /* file id */
|
||||
u_quad_t va_size; /* file size in bytes */
|
||||
long va_blocksize; /* blocksize preferred for i/o */
|
||||
struct timespec va_atime; /* time of last access */
|
||||
struct timespec va_mtime; /* time of last modification */
|
||||
struct timespec va_ctime; /* time file changed */
|
||||
u_long va_gen; /* generation number of file */
|
||||
u_long va_flags; /* flags defined for file */
|
||||
cdev_t va_rdev; /* device special file represents */
|
||||
u_quad_t va_bytes; /* bytes of disk space held by file */
|
||||
u_quad_t va_filerev; /* file modification number */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* structure used by CODA_STATFS for getting cache information from venus */
|
||||
struct coda_statfs {
|
||||
int32_t f_blocks;
|
||||
int32_t f_bfree;
|
||||
int32_t f_bavail;
|
||||
int32_t f_files;
|
||||
int32_t f_ffree;
|
||||
};
|
||||
|
||||
/*
|
||||
* Kernel <--> Venus communications.
|
||||
*/
|
||||
|
||||
#define CODA_ROOT 2
|
||||
#define CODA_OPEN_BY_FD 3
|
||||
#define CODA_OPEN 4
|
||||
#define CODA_CLOSE 5
|
||||
#define CODA_IOCTL 6
|
||||
#define CODA_GETATTR 7
|
||||
#define CODA_SETATTR 8
|
||||
#define CODA_ACCESS 9
|
||||
#define CODA_LOOKUP 10
|
||||
#define CODA_CREATE 11
|
||||
#define CODA_REMOVE 12
|
||||
#define CODA_LINK 13
|
||||
#define CODA_RENAME 14
|
||||
#define CODA_MKDIR 15
|
||||
#define CODA_RMDIR 16
|
||||
#define CODA_SYMLINK 18
|
||||
#define CODA_READLINK 19
|
||||
#define CODA_FSYNC 20
|
||||
#define CODA_VGET 22
|
||||
#define CODA_SIGNAL 23
|
||||
#define CODA_REPLACE 24 /* DOWNCALL */
|
||||
#define CODA_FLUSH 25 /* DOWNCALL */
|
||||
#define CODA_PURGEUSER 26 /* DOWNCALL */
|
||||
#define CODA_ZAPFILE 27 /* DOWNCALL */
|
||||
#define CODA_ZAPDIR 28 /* DOWNCALL */
|
||||
#define CODA_PURGEFID 30 /* DOWNCALL */
|
||||
#define CODA_OPEN_BY_PATH 31
|
||||
#define CODA_RESOLVE 32
|
||||
#define CODA_REINTEGRATE 33
|
||||
#define CODA_STATFS 34
|
||||
#define CODA_STORE 35
|
||||
#define CODA_RELEASE 36
|
||||
#define CODA_NCALLS 37
|
||||
|
||||
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
|
||||
|
||||
#define VC_MAXDATASIZE 8192
|
||||
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
|
||||
VC_MAXDATASIZE
|
||||
|
||||
#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
|
||||
|
||||
#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
|
||||
|
||||
/*
|
||||
* Venus <-> Coda RPC arguments
|
||||
*/
|
||||
struct coda_in_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique; /* Keep multiple outstanding msgs distinct */
|
||||
pid_t pid;
|
||||
pid_t pgid;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
/* Really important that opcode and unique are 1st two fields! */
|
||||
struct coda_out_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique;
|
||||
u_int32_t result;
|
||||
};
|
||||
|
||||
/* coda_root: NO_IN */
|
||||
struct coda_root_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_root_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
/* coda_open: */
|
||||
struct coda_open_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_out {
|
||||
struct coda_out_hdr oh;
|
||||
cdev_t dev;
|
||||
ino_t inode;
|
||||
};
|
||||
|
||||
|
||||
/* coda_store: */
|
||||
struct coda_store_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_store_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_release: */
|
||||
struct coda_release_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_release_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_close: */
|
||||
struct coda_close_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_close_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_ioctl: */
|
||||
struct coda_ioctl_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int cmd;
|
||||
int len;
|
||||
int rwflag;
|
||||
char *data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_ioctl_out {
|
||||
struct coda_out_hdr oh;
|
||||
int len;
|
||||
caddr_t data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
|
||||
/* coda_getattr: */
|
||||
struct coda_getattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_getattr_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_setattr: NO_OUT */
|
||||
struct coda_setattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_setattr_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_access: NO_OUT */
|
||||
struct coda_access_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_access_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
|
||||
/* lookup flags */
|
||||
#define CLU_CASE_SENSITIVE 0x01
|
||||
#define CLU_CASE_INSENSITIVE 0x02
|
||||
|
||||
/* coda_lookup: */
|
||||
struct coda_lookup_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_lookup_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
|
||||
/* coda_create: */
|
||||
struct coda_create_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int excl;
|
||||
int mode;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_create_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_remove: NO_OUT */
|
||||
struct coda_remove_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_remove_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_link: NO_OUT */
|
||||
struct coda_link_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid; /* cnode to link *to* */
|
||||
struct CodaFid destFid; /* Directory in which to place link */
|
||||
int tname; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_link_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
|
||||
/* coda_rename: NO_OUT */
|
||||
struct coda_rename_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid;
|
||||
int srcname;
|
||||
struct CodaFid destFid;
|
||||
int destname;
|
||||
};
|
||||
|
||||
struct coda_rename_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_mkdir: */
|
||||
struct coda_mkdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_mkdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_rmdir: NO_OUT */
|
||||
struct coda_rmdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_rmdir_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_symlink: NO_OUT */
|
||||
struct coda_symlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid; /* Directory to put symlink in */
|
||||
int srcname;
|
||||
struct coda_vattr attr;
|
||||
int tname;
|
||||
};
|
||||
|
||||
struct coda_symlink_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_readlink: */
|
||||
struct coda_readlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_readlink_out {
|
||||
struct coda_out_hdr oh;
|
||||
int count;
|
||||
caddr_t data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
|
||||
/* coda_fsync: NO_OUT */
|
||||
struct coda_fsync_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_fsync_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_vget: */
|
||||
struct coda_vget_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_vget_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
|
||||
/* CODA_SIGNAL is out-of-band, doesn't need data. */
|
||||
/* CODA_INVALIDATE is a venus->kernel call */
|
||||
/* CODA_FLUSH is a venus->kernel call */
|
||||
|
||||
/* coda_purgeuser: */
|
||||
/* CODA_PURGEUSER is a venus->kernel call */
|
||||
struct coda_purgeuser_out {
|
||||
struct coda_out_hdr oh;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
/* coda_zapfile: */
|
||||
/* CODA_ZAPFILE is a venus->kernel call */
|
||||
struct coda_zapfile_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_zapdir: */
|
||||
/* CODA_ZAPDIR is a venus->kernel call */
|
||||
struct coda_zapdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_purgefid: */
|
||||
/* CODA_PURGEFID is a venus->kernel call */
|
||||
struct coda_purgefid_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_replace: */
|
||||
/* CODA_REPLACE is a venus->kernel call */
|
||||
struct coda_replace_out { /* coda_replace is a venus->kernel call */
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid NewFid;
|
||||
struct CodaFid OldFid;
|
||||
};
|
||||
|
||||
/* coda_open_by_fd: */
|
||||
struct coda_open_by_fd_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_fd_out {
|
||||
struct coda_out_hdr oh;
|
||||
int fd;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct file *fh; /* not passed from userspace but used in-kernel only */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* coda_open_by_path: */
|
||||
struct coda_open_by_path_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_path_out {
|
||||
struct coda_out_hdr oh;
|
||||
int path;
|
||||
};
|
||||
|
||||
/* coda_statfs: NO_IN */
|
||||
struct coda_statfs_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
struct coda_statfs_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_statfs stat;
|
||||
};
|
||||
|
||||
/*
|
||||
* Occasionally, we don't cache the fid returned by CODA_LOOKUP.
|
||||
* For instance, if the fid is inconsistent.
|
||||
* This case is handled by setting the top bit of the type result parameter.
|
||||
*/
|
||||
#define CODA_NOCACHE 0x80000000
|
||||
|
||||
union inputArgs {
|
||||
struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
|
||||
struct coda_open_in coda_open;
|
||||
struct coda_store_in coda_store;
|
||||
struct coda_release_in coda_release;
|
||||
struct coda_close_in coda_close;
|
||||
struct coda_ioctl_in coda_ioctl;
|
||||
struct coda_getattr_in coda_getattr;
|
||||
struct coda_setattr_in coda_setattr;
|
||||
struct coda_access_in coda_access;
|
||||
struct coda_lookup_in coda_lookup;
|
||||
struct coda_create_in coda_create;
|
||||
struct coda_remove_in coda_remove;
|
||||
struct coda_link_in coda_link;
|
||||
struct coda_rename_in coda_rename;
|
||||
struct coda_mkdir_in coda_mkdir;
|
||||
struct coda_rmdir_in coda_rmdir;
|
||||
struct coda_symlink_in coda_symlink;
|
||||
struct coda_readlink_in coda_readlink;
|
||||
struct coda_fsync_in coda_fsync;
|
||||
struct coda_vget_in coda_vget;
|
||||
struct coda_open_by_fd_in coda_open_by_fd;
|
||||
struct coda_open_by_path_in coda_open_by_path;
|
||||
struct coda_statfs_in coda_statfs;
|
||||
};
|
||||
|
||||
union outputArgs {
|
||||
struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
|
||||
struct coda_root_out coda_root;
|
||||
struct coda_open_out coda_open;
|
||||
struct coda_ioctl_out coda_ioctl;
|
||||
struct coda_getattr_out coda_getattr;
|
||||
struct coda_lookup_out coda_lookup;
|
||||
struct coda_create_out coda_create;
|
||||
struct coda_mkdir_out coda_mkdir;
|
||||
struct coda_readlink_out coda_readlink;
|
||||
struct coda_vget_out coda_vget;
|
||||
struct coda_purgeuser_out coda_purgeuser;
|
||||
struct coda_zapfile_out coda_zapfile;
|
||||
struct coda_zapdir_out coda_zapdir;
|
||||
struct coda_purgefid_out coda_purgefid;
|
||||
struct coda_replace_out coda_replace;
|
||||
struct coda_open_by_fd_out coda_open_by_fd;
|
||||
struct coda_open_by_path_out coda_open_by_path;
|
||||
struct coda_statfs_out coda_statfs;
|
||||
};
|
||||
|
||||
union coda_downcalls {
|
||||
/* CODA_INVALIDATE is a venus->kernel call */
|
||||
/* CODA_FLUSH is a venus->kernel call */
|
||||
struct coda_purgeuser_out purgeuser;
|
||||
struct coda_zapfile_out zapfile;
|
||||
struct coda_zapdir_out zapdir;
|
||||
struct coda_purgefid_out purgefid;
|
||||
struct coda_replace_out replace;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Used for identifying usage of "Control" and pioctls
|
||||
*/
|
||||
|
||||
#define PIOCPARM_MASK 0x0000ffff
|
||||
struct ViceIoctl {
|
||||
void __user *in; /* Data to be transferred in */
|
||||
void __user *out; /* Data to be transferred out */
|
||||
u_short in_size; /* Size of input buffer <= 2K */
|
||||
u_short out_size; /* Maximum size of output buffer, <= 2K */
|
||||
};
|
||||
|
||||
struct PioctlData {
|
||||
const char __user *path;
|
||||
int follow;
|
||||
struct ViceIoctl vi;
|
||||
};
|
||||
|
||||
#define CODA_CONTROL ".CONTROL"
|
||||
#define CODA_CONTROLLEN 8
|
||||
#define CTL_INO -1
|
||||
|
||||
/* Data passed to mount */
|
||||
|
||||
#define CODA_MOUNT_VERSION 1
|
||||
|
||||
struct coda_mount_data {
|
||||
int version;
|
||||
int fd; /* Opened device */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
#ifndef __CODA_PSDEV_H
|
||||
#define __CODA_PSDEV_H
|
||||
|
||||
#include <linux/magic.h>
|
||||
|
||||
#define CODA_PSDEV_MAJOR 67
|
||||
#define MAX_CODADEVS 5 /* how many do we allow */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <uapi/linux/coda_psdev.h>
|
||||
|
||||
struct kstatfs;
|
||||
|
||||
|
@ -74,23 +69,4 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
|
|||
*/
|
||||
|
||||
extern struct venus_comm coda_comms[];
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* messages between coda filesystem in kernel and Venus */
|
||||
struct upc_req {
|
||||
struct list_head uc_chain;
|
||||
caddr_t uc_data;
|
||||
u_short uc_flags;
|
||||
u_short uc_inSize; /* Size is at most 5000 bytes */
|
||||
u_short uc_outSize;
|
||||
u_short uc_opcode; /* copied from data to save lookup */
|
||||
int uc_unique;
|
||||
wait_queue_head_t uc_sleep; /* process' wait queue */
|
||||
};
|
||||
|
||||
#define CODA_REQ_ASYNC 0x1
|
||||
#define CODA_REQ_READ 0x2
|
||||
#define CODA_REQ_WRITE 0x4
|
||||
#define CODA_REQ_ABORT 0x8
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,63 +18,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __CONNECTOR_H
|
||||
#define __CONNECTOR_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Process Events connector unique ids -- used for message routing
|
||||
*/
|
||||
#define CN_IDX_PROC 0x1
|
||||
#define CN_VAL_PROC 0x1
|
||||
#define CN_IDX_CIFS 0x2
|
||||
#define CN_VAL_CIFS 0x1
|
||||
#define CN_W1_IDX 0x3 /* w1 communication */
|
||||
#define CN_W1_VAL 0x1
|
||||
#define CN_IDX_V86D 0x4
|
||||
#define CN_VAL_V86D_UVESAFB 0x1
|
||||
#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
|
||||
#define CN_DST_IDX 0x6
|
||||
#define CN_DST_VAL 0x1
|
||||
#define CN_IDX_DM 0x7 /* Device Mapper */
|
||||
#define CN_VAL_DM_USERSPACE_LOG 0x1
|
||||
#define CN_IDX_DRBD 0x8
|
||||
#define CN_VAL_DRBD 0x1
|
||||
#define CN_KVP_IDX 0x9 /* HyperV KVP */
|
||||
#define CN_KVP_VAL 0x1 /* queries from the kernel */
|
||||
|
||||
#define CN_NETLINK_USERS 10 /* Highest index + 1 */
|
||||
|
||||
/*
|
||||
* Maximum connector's message size.
|
||||
*/
|
||||
#define CONNECTOR_MAX_MSG_SIZE 16384
|
||||
|
||||
/*
|
||||
* idx and val are unique identifiers which
|
||||
* are used for message routing and
|
||||
* must be registered in connector.h for in-kernel usage.
|
||||
*/
|
||||
|
||||
struct cb_id {
|
||||
__u32 idx;
|
||||
__u32 val;
|
||||
};
|
||||
|
||||
struct cn_msg {
|
||||
struct cb_id id;
|
||||
|
||||
__u32 seq;
|
||||
__u32 ack;
|
||||
|
||||
__u16 len; /* Length of the following data */
|
||||
__u16 flags;
|
||||
__u8 data[0];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/atomic.h>
|
||||
|
||||
|
@ -82,6 +28,7 @@ struct cn_msg {
|
|||
#include <linux/workqueue.h>
|
||||
|
||||
#include <net/sock.h>
|
||||
#include <uapi/linux/connector.h>
|
||||
|
||||
#define CN_CBQ_NAMELEN 32
|
||||
|
||||
|
@ -137,5 +84,4 @@ void cn_queue_free_dev(struct cn_queue_dev *dev);
|
|||
|
||||
int cn_cb_equal(struct cb_id *, struct cb_id *);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __CONNECTOR_H */
|
||||
|
|
|
@ -1,94 +1,10 @@
|
|||
#ifndef __CRAMFS_H
|
||||
#define __CRAMFS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
#include <uapi/linux/cramfs_fs.h>
|
||||
|
||||
#define CRAMFS_SIGNATURE "Compressed ROMFS"
|
||||
|
||||
/*
|
||||
* Width of various bitfields in struct cramfs_inode.
|
||||
* Primarily used to generate warnings in mkcramfs.
|
||||
*/
|
||||
#define CRAMFS_MODE_WIDTH 16
|
||||
#define CRAMFS_UID_WIDTH 16
|
||||
#define CRAMFS_SIZE_WIDTH 24
|
||||
#define CRAMFS_GID_WIDTH 8
|
||||
#define CRAMFS_NAMELEN_WIDTH 6
|
||||
#define CRAMFS_OFFSET_WIDTH 26
|
||||
|
||||
/*
|
||||
* Since inode.namelen is a unsigned 6-bit number, the maximum cramfs
|
||||
* path length is 63 << 2 = 252.
|
||||
*/
|
||||
#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
|
||||
|
||||
/*
|
||||
* Reasonably terse representation of the inode data.
|
||||
*/
|
||||
struct cramfs_inode {
|
||||
__u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
|
||||
/* SIZE for device files is i_rdev */
|
||||
__u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
|
||||
/* NAMELEN is the length of the file name, divided by 4 and
|
||||
rounded up. (cramfs doesn't support hard links.) */
|
||||
/* OFFSET: For symlinks and non-empty regular files, this
|
||||
contains the offset (divided by 4) of the file data in
|
||||
compressed form (starting with an array of block pointers;
|
||||
see README). For non-empty directories it is the offset
|
||||
(divided by 4) of the inode of the first file in that
|
||||
directory. For anything else, offset is zero. */
|
||||
__u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
|
||||
};
|
||||
|
||||
struct cramfs_info {
|
||||
__u32 crc;
|
||||
__u32 edition;
|
||||
__u32 blocks;
|
||||
__u32 files;
|
||||
};
|
||||
|
||||
/*
|
||||
* Superblock information at the beginning of the FS.
|
||||
*/
|
||||
struct cramfs_super {
|
||||
__u32 magic; /* 0x28cd3d45 - random number */
|
||||
__u32 size; /* length in bytes */
|
||||
__u32 flags; /* feature flags */
|
||||
__u32 future; /* reserved for future use */
|
||||
__u8 signature[16]; /* "Compressed ROMFS" */
|
||||
struct cramfs_info fsid; /* unique filesystem info */
|
||||
__u8 name[16]; /* user-defined name */
|
||||
struct cramfs_inode root; /* root inode data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Feature flags
|
||||
*
|
||||
* 0x00000000 - 0x000000ff: features that work for all past kernels
|
||||
* 0x00000100 - 0xffffffff: features that don't work for past kernels
|
||||
*/
|
||||
#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */
|
||||
#define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */
|
||||
#define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */
|
||||
#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */
|
||||
#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */
|
||||
|
||||
/*
|
||||
* Valid values in super.flags. Currently we refuse to mount
|
||||
* if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be
|
||||
* changed to test super.future instead.
|
||||
*/
|
||||
#define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \
|
||||
| CRAMFS_FLAG_HOLES \
|
||||
| CRAMFS_FLAG_WRONG_SIGNATURE \
|
||||
| CRAMFS_FLAG_SHIFTED_ROOT_OFFSET )
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/* Uncompression interfaces to the underlying zlib */
|
||||
int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
|
||||
int cramfs_uncompress_init(void);
|
||||
void cramfs_uncompress_exit(void);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,38 +4,15 @@
|
|||
*
|
||||
* Copyright (C) 1996 Paul Mackerras.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CUDA_H
|
||||
#define _LINUX_CUDA_H
|
||||
|
||||
/* CUDA commands (2nd byte) */
|
||||
#define CUDA_WARM_START 0
|
||||
#define CUDA_AUTOPOLL 1
|
||||
#define CUDA_GET_6805_ADDR 2
|
||||
#define CUDA_GET_TIME 3
|
||||
#define CUDA_GET_PRAM 7
|
||||
#define CUDA_SET_6805_ADDR 8
|
||||
#define CUDA_SET_TIME 9
|
||||
#define CUDA_POWERDOWN 0xa
|
||||
#define CUDA_POWERUP_TIME 0xb
|
||||
#define CUDA_SET_PRAM 0xc
|
||||
#define CUDA_MS_RESET 0xd
|
||||
#define CUDA_SEND_DFAC 0xe
|
||||
#define CUDA_RESET_SYSTEM 0x11
|
||||
#define CUDA_SET_IPL 0x12
|
||||
#define CUDA_SET_AUTO_RATE 0x14
|
||||
#define CUDA_GET_AUTO_RATE 0x16
|
||||
#define CUDA_SET_DEVICE_LIST 0x19
|
||||
#define CUDA_GET_DEVICE_LIST 0x1a
|
||||
#define CUDA_GET_SET_IIC 0x22
|
||||
#include <uapi/linux/cuda.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
extern int find_via_cuda(void);
|
||||
extern int cuda_request(struct adb_request *req,
|
||||
void (*done)(struct adb_request *), int nbytes, ...);
|
||||
extern void cuda_poll(void);
|
||||
|
||||
#endif /* __KERNEL */
|
||||
|
||||
#endif /* _LINUX_CUDA_H */
|
||||
|
|
|
@ -63,434 +63,11 @@
|
|||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CYCLADES_H
|
||||
#define _LINUX_CYCLADES_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/cyclades.h>
|
||||
|
||||
struct cyclades_monitor {
|
||||
unsigned long int_count;
|
||||
unsigned long char_count;
|
||||
unsigned long char_max;
|
||||
unsigned long char_last;
|
||||
};
|
||||
|
||||
/*
|
||||
* These stats all reflect activity since the device was last initialized.
|
||||
* (i.e., since the port was opened with no other processes already having it
|
||||
* open)
|
||||
*/
|
||||
struct cyclades_idle_stats {
|
||||
__kernel_time_t in_use; /* Time device has been in use (secs) */
|
||||
__kernel_time_t recv_idle; /* Time since last char received (secs) */
|
||||
__kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
|
||||
unsigned long recv_bytes; /* Bytes received */
|
||||
unsigned long xmit_bytes; /* Bytes transmitted */
|
||||
unsigned long overruns; /* Input overruns */
|
||||
unsigned long frame_errs; /* Input framing errors */
|
||||
unsigned long parity_errs; /* Input parity errors */
|
||||
};
|
||||
|
||||
#define CYCLADES_MAGIC 0x4359
|
||||
|
||||
#define CYGETMON 0x435901
|
||||
#define CYGETTHRESH 0x435902
|
||||
#define CYSETTHRESH 0x435903
|
||||
#define CYGETDEFTHRESH 0x435904
|
||||
#define CYSETDEFTHRESH 0x435905
|
||||
#define CYGETTIMEOUT 0x435906
|
||||
#define CYSETTIMEOUT 0x435907
|
||||
#define CYGETDEFTIMEOUT 0x435908
|
||||
#define CYSETDEFTIMEOUT 0x435909
|
||||
#define CYSETRFLOW 0x43590a
|
||||
#define CYGETRFLOW 0x43590b
|
||||
#define CYSETRTSDTR_INV 0x43590c
|
||||
#define CYGETRTSDTR_INV 0x43590d
|
||||
#define CYZSETPOLLCYCLE 0x43590e
|
||||
#define CYZGETPOLLCYCLE 0x43590f
|
||||
#define CYGETCD1400VER 0x435910
|
||||
#define CYSETWAIT 0x435912
|
||||
#define CYGETWAIT 0x435913
|
||||
|
||||
/*************** CYCLOM-Z ADDITIONS ***************/
|
||||
|
||||
#define CZIOC ('M' << 8)
|
||||
#define CZ_NBOARDS (CZIOC|0xfa)
|
||||
#define CZ_BOOT_START (CZIOC|0xfb)
|
||||
#define CZ_BOOT_DATA (CZIOC|0xfc)
|
||||
#define CZ_BOOT_END (CZIOC|0xfd)
|
||||
#define CZ_TEST (CZIOC|0xfe)
|
||||
|
||||
#define CZ_DEF_POLL (HZ/25)
|
||||
|
||||
#define MAX_BOARD 4 /* Max number of boards */
|
||||
#define MAX_DEV 256 /* Max number of ports total */
|
||||
#define CYZ_MAX_SPEED 921600
|
||||
|
||||
#define CYZ_FIFO_SIZE 16
|
||||
|
||||
#define CYZ_BOOT_NWORDS 0x100
|
||||
struct CYZ_BOOT_CTRL {
|
||||
unsigned short nboard;
|
||||
int status[MAX_BOARD];
|
||||
int nchannel[MAX_BOARD];
|
||||
int fw_rev[MAX_BOARD];
|
||||
unsigned long offset;
|
||||
unsigned long data[CYZ_BOOT_NWORDS];
|
||||
};
|
||||
|
||||
|
||||
#ifndef DP_WINDOW_SIZE
|
||||
/*
|
||||
* Memory Window Sizes
|
||||
*/
|
||||
|
||||
#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
|
||||
#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
|
||||
8Zo V.2 */
|
||||
#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
|
||||
|
||||
/*
|
||||
* CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
|
||||
* normally will access only interested on the fpga_id, fpga_version,
|
||||
* start_cpu and stop_cpu.
|
||||
*/
|
||||
|
||||
struct CUSTOM_REG {
|
||||
__u32 fpga_id; /* FPGA Identification Register */
|
||||
__u32 fpga_version; /* FPGA Version Number Register */
|
||||
__u32 cpu_start; /* CPU start Register (write) */
|
||||
__u32 cpu_stop; /* CPU stop Register (write) */
|
||||
__u32 misc_reg; /* Miscellaneous Register */
|
||||
__u32 idt_mode; /* IDT mode Register */
|
||||
__u32 uart_irq_status; /* UART IRQ status Register */
|
||||
__u32 clear_timer0_irq; /* Clear timer interrupt Register */
|
||||
__u32 clear_timer1_irq; /* Clear timer interrupt Register */
|
||||
__u32 clear_timer2_irq; /* Clear timer interrupt Register */
|
||||
__u32 test_register; /* Test Register */
|
||||
__u32 test_count; /* Test Count Register */
|
||||
__u32 timer_select; /* Timer select register */
|
||||
__u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
|
||||
__u32 ram_wait_state; /* RAM wait-state Register */
|
||||
__u32 uart_wait_state; /* UART wait-state Register */
|
||||
__u32 timer_wait_state; /* timer wait-state Register */
|
||||
__u32 ack_wait_state; /* ACK wait State Register */
|
||||
};
|
||||
|
||||
/*
|
||||
* RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
|
||||
* registers. This structure can be used to access the 9060 registers
|
||||
* (memory mapped).
|
||||
*/
|
||||
|
||||
struct RUNTIME_9060 {
|
||||
__u32 loc_addr_range; /* 00h - Local Address Range */
|
||||
__u32 loc_addr_base; /* 04h - Local Address Base */
|
||||
__u32 loc_arbitr; /* 08h - Local Arbitration */
|
||||
__u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
|
||||
__u32 loc_rom_range; /* 10h - Local ROM Range */
|
||||
__u32 loc_rom_base; /* 14h - Local ROM Base */
|
||||
__u32 loc_bus_descr; /* 18h - Local Bus descriptor */
|
||||
__u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
|
||||
__u32 loc_base_mst; /* 20h - Local Base for Master PCI */
|
||||
__u32 loc_range_io; /* 24h - Local Range for Master IO */
|
||||
__u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
|
||||
__u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
|
||||
__u32 filler1; /* 30h */
|
||||
__u32 filler2; /* 34h */
|
||||
__u32 filler3; /* 38h */
|
||||
__u32 filler4; /* 3Ch */
|
||||
__u32 mail_box_0; /* 40h - Mail Box 0 */
|
||||
__u32 mail_box_1; /* 44h - Mail Box 1 */
|
||||
__u32 mail_box_2; /* 48h - Mail Box 2 */
|
||||
__u32 mail_box_3; /* 4Ch - Mail Box 3 */
|
||||
__u32 filler5; /* 50h */
|
||||
__u32 filler6; /* 54h */
|
||||
__u32 filler7; /* 58h */
|
||||
__u32 filler8; /* 5Ch */
|
||||
__u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
|
||||
__u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
|
||||
__u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
|
||||
__u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
|
||||
};
|
||||
|
||||
/* Values for the Local Base Address re-map register */
|
||||
|
||||
#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
|
||||
#define WIN_CREG 0x14000001L /* set the window to custom Registers */
|
||||
|
||||
/* Values timer select registers */
|
||||
|
||||
#define TIMER_BY_1M 0x00 /* clock divided by 1M */
|
||||
#define TIMER_BY_256K 0x01 /* clock divided by 256k */
|
||||
#define TIMER_BY_128K 0x02 /* clock divided by 128k */
|
||||
#define TIMER_BY_32K 0x03 /* clock divided by 32k */
|
||||
|
||||
/****************** ****************** *******************/
|
||||
#endif
|
||||
|
||||
#ifndef ZFIRM_ID
|
||||
/* #include "zfwint.h" */
|
||||
/****************** ****************** *******************/
|
||||
/*
|
||||
* This file contains the definitions for interfacing with the
|
||||
* Cyclom-Z ZFIRM Firmware.
|
||||
*/
|
||||
|
||||
/* General Constant definitions */
|
||||
|
||||
#define MAX_CHAN 64 /* max number of channels per board */
|
||||
|
||||
/* firmware id structure (set after boot) */
|
||||
|
||||
#define ID_ADDRESS 0x00000180L /* signature/pointer address */
|
||||
#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
|
||||
#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
|
||||
#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
|
||||
|
||||
#define ZF_TINACT_DEF 1000 /* default inactivity timeout
|
||||
(1000 ms) */
|
||||
#define ZF_TINACT ZF_TINACT_DEF
|
||||
|
||||
struct FIRM_ID {
|
||||
__u32 signature; /* ZFIRM/U signature */
|
||||
__u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
|
||||
};
|
||||
|
||||
/* Op. System id */
|
||||
|
||||
#define C_OS_LINUX 0x00000030 /* generic Linux system */
|
||||
|
||||
/* channel op_mode */
|
||||
|
||||
#define C_CH_DISABLE 0x00000000 /* channel is disabled */
|
||||
#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
|
||||
#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
|
||||
#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
|
||||
#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
|
||||
|
||||
/* comm_parity - parity */
|
||||
|
||||
#define C_PR_NONE 0x00000000 /* None */
|
||||
#define C_PR_ODD 0x00000001 /* Odd */
|
||||
#define C_PR_EVEN 0x00000002 /* Even */
|
||||
#define C_PR_MARK 0x00000004 /* Mark */
|
||||
#define C_PR_SPACE 0x00000008 /* Space */
|
||||
#define C_PR_PARITY 0x000000ff
|
||||
|
||||
#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
|
||||
#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
|
||||
|
||||
/* comm_data_l - data length and stop bits */
|
||||
|
||||
#define C_DL_CS5 0x00000001
|
||||
#define C_DL_CS6 0x00000002
|
||||
#define C_DL_CS7 0x00000004
|
||||
#define C_DL_CS8 0x00000008
|
||||
#define C_DL_CS 0x0000000f
|
||||
#define C_DL_1STOP 0x00000010
|
||||
#define C_DL_15STOP 0x00000020
|
||||
#define C_DL_2STOP 0x00000040
|
||||
#define C_DL_STOP 0x000000f0
|
||||
|
||||
/* interrupt enabling/status */
|
||||
|
||||
#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
|
||||
#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
|
||||
#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
|
||||
#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
|
||||
#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
|
||||
#define C_IN_MDCD 0x00000100 /* modem DCD change */
|
||||
#define C_IN_MDSR 0x00000200 /* modem DSR change */
|
||||
#define C_IN_MRI 0x00000400 /* modem RI change */
|
||||
#define C_IN_MCTS 0x00000800 /* modem CTS change */
|
||||
#define C_IN_RXBRK 0x00001000 /* Break received */
|
||||
#define C_IN_PR_ERROR 0x00002000 /* parity error */
|
||||
#define C_IN_FR_ERROR 0x00004000 /* frame error */
|
||||
#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
|
||||
#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
|
||||
#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
|
||||
#define C_IN_MRTS 0x00040000 /* modem RTS drop */
|
||||
#define C_IN_ICHAR 0x00080000
|
||||
|
||||
/* flow control */
|
||||
|
||||
#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
|
||||
#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
|
||||
#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
|
||||
#define C_FL_SWFLOW 0x0000000f
|
||||
|
||||
/* flow status */
|
||||
|
||||
#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
|
||||
#define C_FS_SENDING 0x00000001 /* UART is sending data */
|
||||
#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
|
||||
|
||||
/* rs_control/rs_status RS-232 signals */
|
||||
|
||||
#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
|
||||
IOCTLM command */
|
||||
#define C_RS_RTS 0x00000001 /* RTS */
|
||||
#define C_RS_DTR 0x00000004 /* DTR */
|
||||
#define C_RS_DCD 0x00000100 /* CD */
|
||||
#define C_RS_DSR 0x00000200 /* DSR */
|
||||
#define C_RS_RI 0x00000400 /* RI */
|
||||
#define C_RS_CTS 0x00000800 /* CTS */
|
||||
|
||||
/* commands Host <-> Board */
|
||||
|
||||
#define C_CM_RESET 0x01 /* reset/flush buffers */
|
||||
#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
|
||||
#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
|
||||
#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
|
||||
#define C_CM_SENDXOFF 0x10 /* send Xoff */
|
||||
#define C_CM_SENDXON 0x11 /* send Xon */
|
||||
#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
|
||||
#define C_CM_SENDBRK 0x41 /* send break */
|
||||
#define C_CM_INTBACK 0x42 /* Interrupt back */
|
||||
#define C_CM_SET_BREAK 0x43 /* Tx break on */
|
||||
#define C_CM_CLR_BREAK 0x44 /* Tx break off */
|
||||
#define C_CM_CMD_DONE 0x45 /* Previous command done */
|
||||
#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
|
||||
#define C_CM_TINACT 0x51 /* set inactivity detection */
|
||||
#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
|
||||
#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
|
||||
#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
|
||||
#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
|
||||
#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
|
||||
#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
|
||||
#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
|
||||
driver */
|
||||
#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
|
||||
driver */
|
||||
|
||||
#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
|
||||
#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
|
||||
#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
|
||||
#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
|
||||
#define C_CM_TXFEMPTY 0x64
|
||||
#define C_CM_ICHAR 0x65
|
||||
#define C_CM_MDCD 0x70 /* modem DCD change */
|
||||
#define C_CM_MDSR 0x71 /* modem DSR change */
|
||||
#define C_CM_MRI 0x72 /* modem RI change */
|
||||
#define C_CM_MCTS 0x73 /* modem CTS change */
|
||||
#define C_CM_MRTS 0x74 /* modem RTS drop */
|
||||
#define C_CM_RXBRK 0x84 /* Break received */
|
||||
#define C_CM_PR_ERROR 0x85 /* Parity error */
|
||||
#define C_CM_FR_ERROR 0x86 /* Frame error */
|
||||
#define C_CM_OVR_ERROR 0x87 /* Overrun error */
|
||||
#define C_CM_RXOFL 0x88 /* RX buffer overflow */
|
||||
#define C_CM_CMDERROR 0x90 /* command error */
|
||||
#define C_CM_FATAL 0x91 /* fatal error */
|
||||
#define C_CM_HW_RESET 0x92 /* reset board */
|
||||
|
||||
/*
|
||||
* CH_CTRL - This per port structure contains all parameters
|
||||
* that control an specific port. It can be seen as the
|
||||
* configuration registers of a "super-serial-controller".
|
||||
*/
|
||||
|
||||
struct CH_CTRL {
|
||||
__u32 op_mode; /* operation mode */
|
||||
__u32 intr_enable; /* interrupt masking */
|
||||
__u32 sw_flow; /* SW flow control */
|
||||
__u32 flow_status; /* output flow status */
|
||||
__u32 comm_baud; /* baud rate - numerically specified */
|
||||
__u32 comm_parity; /* parity */
|
||||
__u32 comm_data_l; /* data length/stop */
|
||||
__u32 comm_flags; /* other flags */
|
||||
__u32 hw_flow; /* HW flow control */
|
||||
__u32 rs_control; /* RS-232 outputs */
|
||||
__u32 rs_status; /* RS-232 inputs */
|
||||
__u32 flow_xon; /* xon char */
|
||||
__u32 flow_xoff; /* xoff char */
|
||||
__u32 hw_overflow; /* hw overflow counter */
|
||||
__u32 sw_overflow; /* sw overflow counter */
|
||||
__u32 comm_error; /* frame/parity error counter */
|
||||
__u32 ichar;
|
||||
__u32 filler[7];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* BUF_CTRL - This per channel structure contains
|
||||
* all Tx and Rx buffer control for a given channel.
|
||||
*/
|
||||
|
||||
struct BUF_CTRL {
|
||||
__u32 flag_dma; /* buffers are in Host memory */
|
||||
__u32 tx_bufaddr; /* address of the tx buffer */
|
||||
__u32 tx_bufsize; /* tx buffer size */
|
||||
__u32 tx_threshold; /* tx low water mark */
|
||||
__u32 tx_get; /* tail index tx buf */
|
||||
__u32 tx_put; /* head index tx buf */
|
||||
__u32 rx_bufaddr; /* address of the rx buffer */
|
||||
__u32 rx_bufsize; /* rx buffer size */
|
||||
__u32 rx_threshold; /* rx high water mark */
|
||||
__u32 rx_get; /* tail index rx buf */
|
||||
__u32 rx_put; /* head index rx buf */
|
||||
__u32 filler[5]; /* filler to align structures */
|
||||
};
|
||||
|
||||
/*
|
||||
* BOARD_CTRL - This per board structure contains all global
|
||||
* control fields related to the board.
|
||||
*/
|
||||
|
||||
struct BOARD_CTRL {
|
||||
|
||||
/* static info provided by the on-board CPU */
|
||||
__u32 n_channel; /* number of channels */
|
||||
__u32 fw_version; /* firmware version */
|
||||
|
||||
/* static info provided by the driver */
|
||||
__u32 op_system; /* op_system id */
|
||||
__u32 dr_version; /* driver version */
|
||||
|
||||
/* board control area */
|
||||
__u32 inactivity; /* inactivity control */
|
||||
|
||||
/* host to FW commands */
|
||||
__u32 hcmd_channel; /* channel number */
|
||||
__u32 hcmd_param; /* pointer to parameters */
|
||||
|
||||
/* FW to Host commands */
|
||||
__u32 fwcmd_channel; /* channel number */
|
||||
__u32 fwcmd_param; /* pointer to parameters */
|
||||
__u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
|
||||
|
||||
/* filler so the structures are aligned */
|
||||
__u32 filler[6];
|
||||
};
|
||||
|
||||
/* Host Interrupt Queue */
|
||||
|
||||
#define QUEUE_SIZE (10*MAX_CHAN)
|
||||
|
||||
struct INT_QUEUE {
|
||||
unsigned char intr_code[QUEUE_SIZE];
|
||||
unsigned long channel[QUEUE_SIZE];
|
||||
unsigned long param[QUEUE_SIZE];
|
||||
unsigned long put;
|
||||
unsigned long get;
|
||||
};
|
||||
|
||||
/*
|
||||
* ZFW_CTRL - This is the data structure that includes all other
|
||||
* data structures used by the Firmware.
|
||||
*/
|
||||
|
||||
struct ZFW_CTRL {
|
||||
struct BOARD_CTRL board_ctrl;
|
||||
struct CH_CTRL ch_ctrl[MAX_CHAN];
|
||||
struct BUF_CTRL buf_ctrl[MAX_CHAN];
|
||||
};
|
||||
|
||||
/****************** ****************** *******************/
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* Per card data structure */
|
||||
struct cyclades_card {
|
||||
|
@ -780,5 +357,4 @@ struct cyclades_port {
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_CYCLADES_H */
|
||||
|
|
|
@ -1,239 +1,6 @@
|
|||
#ifndef _LINUX_DCCP_H
|
||||
#define _LINUX_DCCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/**
|
||||
* struct dccp_hdr - generic part of DCCP packet header
|
||||
*
|
||||
* @dccph_sport - Relevant port on the endpoint that sent this packet
|
||||
* @dccph_dport - Relevant port on the other endpoint
|
||||
* @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
|
||||
* @dccph_ccval - Used by the HC-Sender CCID
|
||||
* @dccph_cscov - Parts of the packet that are covered by the Checksum field
|
||||
* @dccph_checksum - Internet checksum, depends on dccph_cscov
|
||||
* @dccph_x - 0 = 24 bit sequence number, 1 = 48
|
||||
* @dccph_type - packet type, see DCCP_PKT_ prefixed macros
|
||||
* @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
|
||||
*/
|
||||
struct dccp_hdr {
|
||||
__be16 dccph_sport,
|
||||
dccph_dport;
|
||||
__u8 dccph_doff;
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 dccph_cscov:4,
|
||||
dccph_ccval:4;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 dccph_ccval:4,
|
||||
dccph_cscov:4;
|
||||
#else
|
||||
#error "Adjust your <asm/byteorder.h> defines"
|
||||
#endif
|
||||
__sum16 dccph_checksum;
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 dccph_x:1,
|
||||
dccph_type:4,
|
||||
dccph_reserved:3;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 dccph_reserved:3,
|
||||
dccph_type:4,
|
||||
dccph_x:1;
|
||||
#else
|
||||
#error "Adjust your <asm/byteorder.h> defines"
|
||||
#endif
|
||||
__u8 dccph_seq2;
|
||||
__be16 dccph_seq;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dccp_hdr_ext - the low bits of a 48 bit seq packet
|
||||
*
|
||||
* @dccph_seq_low - low 24 bits of a 48 bit seq packet
|
||||
*/
|
||||
struct dccp_hdr_ext {
|
||||
__be32 dccph_seq_low;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dccp_hdr_request - Connection initiation request header
|
||||
*
|
||||
* @dccph_req_service - Service to which the client app wants to connect
|
||||
*/
|
||||
struct dccp_hdr_request {
|
||||
__be32 dccph_req_service;
|
||||
};
|
||||
/**
|
||||
* struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
|
||||
*
|
||||
* @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
|
||||
* @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
|
||||
*/
|
||||
struct dccp_hdr_ack_bits {
|
||||
__be16 dccph_reserved1;
|
||||
__be16 dccph_ack_nr_high;
|
||||
__be32 dccph_ack_nr_low;
|
||||
};
|
||||
/**
|
||||
* struct dccp_hdr_response - Connection initiation response header
|
||||
*
|
||||
* @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3)
|
||||
* @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
|
||||
*/
|
||||
struct dccp_hdr_response {
|
||||
struct dccp_hdr_ack_bits dccph_resp_ack;
|
||||
__be32 dccph_resp_service;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dccp_hdr_reset - Unconditionally shut down a connection
|
||||
*
|
||||
* @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6)
|
||||
* @dccph_reset_code - one of %dccp_reset_codes
|
||||
* @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6
|
||||
*/
|
||||
struct dccp_hdr_reset {
|
||||
struct dccp_hdr_ack_bits dccph_reset_ack;
|
||||
__u8 dccph_reset_code,
|
||||
dccph_reset_data[3];
|
||||
};
|
||||
|
||||
enum dccp_pkt_type {
|
||||
DCCP_PKT_REQUEST = 0,
|
||||
DCCP_PKT_RESPONSE,
|
||||
DCCP_PKT_DATA,
|
||||
DCCP_PKT_ACK,
|
||||
DCCP_PKT_DATAACK,
|
||||
DCCP_PKT_CLOSEREQ,
|
||||
DCCP_PKT_CLOSE,
|
||||
DCCP_PKT_RESET,
|
||||
DCCP_PKT_SYNC,
|
||||
DCCP_PKT_SYNCACK,
|
||||
DCCP_PKT_INVALID,
|
||||
};
|
||||
|
||||
#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
|
||||
|
||||
static inline unsigned int dccp_packet_hdr_len(const __u8 type)
|
||||
{
|
||||
if (type == DCCP_PKT_DATA)
|
||||
return 0;
|
||||
if (type == DCCP_PKT_DATAACK ||
|
||||
type == DCCP_PKT_ACK ||
|
||||
type == DCCP_PKT_SYNC ||
|
||||
type == DCCP_PKT_SYNCACK ||
|
||||
type == DCCP_PKT_CLOSE ||
|
||||
type == DCCP_PKT_CLOSEREQ)
|
||||
return sizeof(struct dccp_hdr_ack_bits);
|
||||
if (type == DCCP_PKT_REQUEST)
|
||||
return sizeof(struct dccp_hdr_request);
|
||||
if (type == DCCP_PKT_RESPONSE)
|
||||
return sizeof(struct dccp_hdr_response);
|
||||
return sizeof(struct dccp_hdr_reset);
|
||||
}
|
||||
enum dccp_reset_codes {
|
||||
DCCP_RESET_CODE_UNSPECIFIED = 0,
|
||||
DCCP_RESET_CODE_CLOSED,
|
||||
DCCP_RESET_CODE_ABORTED,
|
||||
DCCP_RESET_CODE_NO_CONNECTION,
|
||||
DCCP_RESET_CODE_PACKET_ERROR,
|
||||
DCCP_RESET_CODE_OPTION_ERROR,
|
||||
DCCP_RESET_CODE_MANDATORY_ERROR,
|
||||
DCCP_RESET_CODE_CONNECTION_REFUSED,
|
||||
DCCP_RESET_CODE_BAD_SERVICE_CODE,
|
||||
DCCP_RESET_CODE_TOO_BUSY,
|
||||
DCCP_RESET_CODE_BAD_INIT_COOKIE,
|
||||
DCCP_RESET_CODE_AGGRESSION_PENALTY,
|
||||
|
||||
DCCP_MAX_RESET_CODES /* Leave at the end! */
|
||||
};
|
||||
|
||||
/* DCCP options */
|
||||
enum {
|
||||
DCCPO_PADDING = 0,
|
||||
DCCPO_MANDATORY = 1,
|
||||
DCCPO_MIN_RESERVED = 3,
|
||||
DCCPO_MAX_RESERVED = 31,
|
||||
DCCPO_CHANGE_L = 32,
|
||||
DCCPO_CONFIRM_L = 33,
|
||||
DCCPO_CHANGE_R = 34,
|
||||
DCCPO_CONFIRM_R = 35,
|
||||
DCCPO_NDP_COUNT = 37,
|
||||
DCCPO_ACK_VECTOR_0 = 38,
|
||||
DCCPO_ACK_VECTOR_1 = 39,
|
||||
DCCPO_TIMESTAMP = 41,
|
||||
DCCPO_TIMESTAMP_ECHO = 42,
|
||||
DCCPO_ELAPSED_TIME = 43,
|
||||
DCCPO_MAX = 45,
|
||||
DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
|
||||
DCCPO_MAX_RX_CCID_SPECIFIC = 191,
|
||||
DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
|
||||
DCCPO_MAX_TX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
|
||||
#define DCCP_SINGLE_OPT_MAXLEN 253
|
||||
|
||||
/* DCCP CCIDS */
|
||||
enum {
|
||||
DCCPC_CCID2 = 2,
|
||||
DCCPC_CCID3 = 3,
|
||||
};
|
||||
|
||||
/* DCCP features (RFC 4340 section 6.4) */
|
||||
enum dccp_feature_numbers {
|
||||
DCCPF_RESERVED = 0,
|
||||
DCCPF_CCID = 1,
|
||||
DCCPF_SHORT_SEQNOS = 2,
|
||||
DCCPF_SEQUENCE_WINDOW = 3,
|
||||
DCCPF_ECN_INCAPABLE = 4,
|
||||
DCCPF_ACK_RATIO = 5,
|
||||
DCCPF_SEND_ACK_VECTOR = 6,
|
||||
DCCPF_SEND_NDP_COUNT = 7,
|
||||
DCCPF_MIN_CSUM_COVER = 8,
|
||||
DCCPF_DATA_CHECKSUM = 9,
|
||||
/* 10-127 reserved */
|
||||
DCCPF_MIN_CCID_SPECIFIC = 128,
|
||||
DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
|
||||
DCCPF_MAX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
|
||||
/* DCCP socket control message types for cmsg */
|
||||
enum dccp_cmsg_type {
|
||||
DCCP_SCM_PRIORITY = 1,
|
||||
DCCP_SCM_QPOLICY_MAX = 0xFFFF,
|
||||
/* ^-- Up to here reserved exclusively for qpolicy parameters */
|
||||
DCCP_SCM_MAX
|
||||
};
|
||||
|
||||
/* DCCP priorities for outgoing/queued packets */
|
||||
enum dccp_packet_dequeueing_policy {
|
||||
DCCPQ_POLICY_SIMPLE,
|
||||
DCCPQ_POLICY_PRIO,
|
||||
DCCPQ_POLICY_MAX
|
||||
};
|
||||
|
||||
/* DCCP socket options */
|
||||
#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
|
||||
#define DCCP_SOCKOPT_SERVICE 2
|
||||
#define DCCP_SOCKOPT_CHANGE_L 3
|
||||
#define DCCP_SOCKOPT_CHANGE_R 4
|
||||
#define DCCP_SOCKOPT_GET_CUR_MPS 5
|
||||
#define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
|
||||
#define DCCP_SOCKOPT_SEND_CSCOV 10
|
||||
#define DCCP_SOCKOPT_RECV_CSCOV 11
|
||||
#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
|
||||
#define DCCP_SOCKOPT_CCID 13
|
||||
#define DCCP_SOCKOPT_TX_CCID 14
|
||||
#define DCCP_SOCKOPT_RX_CCID 15
|
||||
#define DCCP_SOCKOPT_QPOLICY_ID 16
|
||||
#define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
|
||||
#define DCCP_SOCKOPT_CCID_RX_INFO 128
|
||||
#define DCCP_SOCKOPT_CCID_TX_INFO 192
|
||||
|
||||
/* maximum number of services provided on the same listening port */
|
||||
#define DCCP_SERVICE_LIST_MAX_LEN 32
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/in.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
@ -246,6 +13,7 @@ enum dccp_packet_dequeueing_policy {
|
|||
#include <net/inet_sock.h>
|
||||
#include <net/inet_timewait_sock.h>
|
||||
#include <net/tcp_states.h>
|
||||
#include <uapi/linux/dccp.h>
|
||||
|
||||
enum dccp_state {
|
||||
DCCP_OPEN = TCP_ESTABLISHED,
|
||||
|
@ -551,6 +319,4 @@ static inline const char *dccp_role(const struct sock *sk)
|
|||
|
||||
extern void dccp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_DCCP_H */
|
||||
|
|
|
@ -10,68 +10,11 @@
|
|||
**
|
||||
*******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __DLM_DOT_H__
|
||||
#define __DLM_DOT_H__
|
||||
|
||||
/*
|
||||
* Interface to Distributed Lock Manager (DLM)
|
||||
* routines and structures to use DLM lockspaces
|
||||
*/
|
||||
#include <uapi/linux/dlm.h>
|
||||
|
||||
/* Lock levels and flags are here */
|
||||
#include <linux/dlmconstants.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
typedef void dlm_lockspace_t;
|
||||
|
||||
/*
|
||||
* Lock status block
|
||||
*
|
||||
* Use this structure to specify the contents of the lock value block. For a
|
||||
* conversion request, this structure is used to specify the lock ID of the
|
||||
* lock. DLM writes the status of the lock request and the lock ID assigned
|
||||
* to the request in the lock status block.
|
||||
*
|
||||
* sb_lkid: the returned lock ID. It is set on new (non-conversion) requests.
|
||||
* It is available when dlm_lock returns.
|
||||
*
|
||||
* sb_lvbptr: saves or returns the contents of the lock's LVB according to rules
|
||||
* shown for the DLM_LKF_VALBLK flag.
|
||||
*
|
||||
* sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock,
|
||||
* it was first demoted to NL to avoid conversion deadlock.
|
||||
* DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid.
|
||||
*
|
||||
* sb_status: the returned status of the lock request set prior to AST
|
||||
* execution. Possible return values:
|
||||
*
|
||||
* 0 if lock request was successful
|
||||
* -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE
|
||||
* -DLM_EUNLOCK if unlock request was successful
|
||||
* -DLM_ECANCEL if a cancel completed successfully
|
||||
* -EDEADLK if a deadlock was detected
|
||||
* -ETIMEDOUT if the lock request was canceled due to a timeout
|
||||
*/
|
||||
|
||||
#define DLM_SBF_DEMOTED 0x01
|
||||
#define DLM_SBF_VALNOTVALID 0x02
|
||||
#define DLM_SBF_ALTMODE 0x04
|
||||
|
||||
struct dlm_lksb {
|
||||
int sb_status;
|
||||
__u32 sb_lkid;
|
||||
char sb_flags;
|
||||
char * sb_lvbptr;
|
||||
};
|
||||
|
||||
/* dlm_new_lockspace() flags */
|
||||
|
||||
#define DLM_LSFL_TIMEWARN 0x00000002
|
||||
#define DLM_LSFL_FS 0x00000004
|
||||
#define DLM_LSFL_NEWEXCL 0x00000008
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct dlm_slot {
|
||||
int nodeid; /* 1 to MAX_INT */
|
||||
|
@ -226,7 +169,4 @@ int dlm_unlock(dlm_lockspace_t *lockspace,
|
|||
struct dlm_lksb *lksb,
|
||||
void *astarg);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __DLM_DOT_H__ */
|
||||
|
||||
|
|
|
@ -5,50 +5,15 @@
|
|||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU General Public License v.2.
|
||||
*/
|
||||
|
||||
#ifndef __DLM_PLOCK_DOT_H__
|
||||
#define __DLM_PLOCK_DOT_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/dlm_plock.h>
|
||||
|
||||
#define DLM_PLOCK_MISC_NAME "dlm_plock"
|
||||
|
||||
#define DLM_PLOCK_VERSION_MAJOR 1
|
||||
#define DLM_PLOCK_VERSION_MINOR 2
|
||||
#define DLM_PLOCK_VERSION_PATCH 0
|
||||
|
||||
enum {
|
||||
DLM_PLOCK_OP_LOCK = 1,
|
||||
DLM_PLOCK_OP_UNLOCK,
|
||||
DLM_PLOCK_OP_GET,
|
||||
};
|
||||
|
||||
#define DLM_PLOCK_FL_CLOSE 1
|
||||
|
||||
struct dlm_plock_info {
|
||||
__u32 version[3];
|
||||
__u8 optype;
|
||||
__u8 ex;
|
||||
__u8 wait;
|
||||
__u8 flags;
|
||||
__u32 pid;
|
||||
__s32 nodeid;
|
||||
__s32 rv;
|
||||
__u32 fsid;
|
||||
__u64 number;
|
||||
__u64 start;
|
||||
__u64 end;
|
||||
__u64 owner;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
|
||||
int cmd, struct file_lock *fl);
|
||||
int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
|
||||
struct file_lock *fl);
|
||||
int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
|
||||
struct file_lock *fl);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,165 +30,9 @@
|
|||
#ifndef _LINUX_EDD_H
|
||||
#define _LINUX_EDD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
|
||||
in boot_params - treat this as 1 byte */
|
||||
#define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
|
||||
#define EDDMAXNR 6 /* number of edd_info structs starting at EDDBUF */
|
||||
#define EDDEXTSIZE 8 /* change these if you muck with the structures */
|
||||
#define EDDPARMSIZE 74
|
||||
#define CHECKEXTENSIONSPRESENT 0x41
|
||||
#define GETDEVICEPARAMETERS 0x48
|
||||
#define LEGACYGETDEVICEPARAMETERS 0x08
|
||||
#define EDDMAGIC1 0x55AA
|
||||
#define EDDMAGIC2 0xAA55
|
||||
|
||||
|
||||
#define READ_SECTORS 0x02 /* int13 AH=0x02 is READ_SECTORS command */
|
||||
#define EDD_MBR_SIG_OFFSET 0x1B8 /* offset of signature in the MBR */
|
||||
#define EDD_MBR_SIG_BUF 0x290 /* addr in boot params */
|
||||
#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
|
||||
#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
|
||||
in boot_params - treat this as 1 byte */
|
||||
#include <uapi/linux/edd.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)
|
||||
#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
|
||||
#define EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT (1 << 2)
|
||||
#define EDD_EXT_64BIT_EXTENSIONS (1 << 3)
|
||||
|
||||
#define EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT (1 << 0)
|
||||
#define EDD_INFO_GEOMETRY_VALID (1 << 1)
|
||||
#define EDD_INFO_REMOVABLE (1 << 2)
|
||||
#define EDD_INFO_WRITE_VERIFY (1 << 3)
|
||||
#define EDD_INFO_MEDIA_CHANGE_NOTIFICATION (1 << 4)
|
||||
#define EDD_INFO_LOCKABLE (1 << 5)
|
||||
#define EDD_INFO_NO_MEDIA_PRESENT (1 << 6)
|
||||
#define EDD_INFO_USE_INT13_FN50 (1 << 7)
|
||||
|
||||
struct edd_device_params {
|
||||
__u16 length;
|
||||
__u16 info_flags;
|
||||
__u32 num_default_cylinders;
|
||||
__u32 num_default_heads;
|
||||
__u32 sectors_per_track;
|
||||
__u64 number_of_sectors;
|
||||
__u16 bytes_per_sector;
|
||||
__u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */
|
||||
__u16 key; /* = 0xBEDD */
|
||||
__u8 device_path_info_length; /* = 44 */
|
||||
__u8 reserved2;
|
||||
__u16 reserved3;
|
||||
__u8 host_bus_type[4];
|
||||
__u8 interface_type[8];
|
||||
union {
|
||||
struct {
|
||||
__u16 base_address;
|
||||
__u16 reserved1;
|
||||
__u32 reserved2;
|
||||
} __attribute__ ((packed)) isa;
|
||||
struct {
|
||||
__u8 bus;
|
||||
__u8 slot;
|
||||
__u8 function;
|
||||
__u8 channel;
|
||||
__u32 reserved;
|
||||
} __attribute__ ((packed)) pci;
|
||||
/* pcix is same as pci */
|
||||
struct {
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) ibnd;
|
||||
struct {
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) xprs;
|
||||
struct {
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) htpt;
|
||||
struct {
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) unknown;
|
||||
} interface_path;
|
||||
union {
|
||||
struct {
|
||||
__u8 device;
|
||||
__u8 reserved1;
|
||||
__u16 reserved2;
|
||||
__u32 reserved3;
|
||||
__u64 reserved4;
|
||||
} __attribute__ ((packed)) ata;
|
||||
struct {
|
||||
__u8 device;
|
||||
__u8 lun;
|
||||
__u8 reserved1;
|
||||
__u8 reserved2;
|
||||
__u32 reserved3;
|
||||
__u64 reserved4;
|
||||
} __attribute__ ((packed)) atapi;
|
||||
struct {
|
||||
__u16 id;
|
||||
__u64 lun;
|
||||
__u16 reserved1;
|
||||
__u32 reserved2;
|
||||
} __attribute__ ((packed)) scsi;
|
||||
struct {
|
||||
__u64 serial_number;
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) usb;
|
||||
struct {
|
||||
__u64 eui;
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) i1394;
|
||||
struct {
|
||||
__u64 wwid;
|
||||
__u64 lun;
|
||||
} __attribute__ ((packed)) fibre;
|
||||
struct {
|
||||
__u64 identity_tag;
|
||||
__u64 reserved;
|
||||
} __attribute__ ((packed)) i2o;
|
||||
struct {
|
||||
__u32 array_number;
|
||||
__u32 reserved1;
|
||||
__u64 reserved2;
|
||||
} __attribute__ ((packed)) raid;
|
||||
struct {
|
||||
__u8 device;
|
||||
__u8 reserved1;
|
||||
__u16 reserved2;
|
||||
__u32 reserved3;
|
||||
__u64 reserved4;
|
||||
} __attribute__ ((packed)) sata;
|
||||
struct {
|
||||
__u64 reserved1;
|
||||
__u64 reserved2;
|
||||
} __attribute__ ((packed)) unknown;
|
||||
} device_path;
|
||||
__u8 reserved4;
|
||||
__u8 checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct edd_info {
|
||||
__u8 device;
|
||||
__u8 version;
|
||||
__u16 interface_support;
|
||||
__u16 legacy_max_cylinder;
|
||||
__u8 legacy_max_head;
|
||||
__u8 legacy_sectors_per_track;
|
||||
struct edd_device_params params;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct edd {
|
||||
unsigned int mbr_signature[EDD_MBR_SIG_MAX];
|
||||
struct edd_info edd_info[EDDMAXNR];
|
||||
unsigned char mbr_signature_nr;
|
||||
unsigned char edd_info_nr;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern struct edd edd;
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /*!__ASSEMBLY__ */
|
||||
|
||||
#endif /* _LINUX_EDD_H */
|
||||
|
|
|
@ -1,420 +1,9 @@
|
|||
#ifndef _LINUX_ELF_H
|
||||
#define _LINUX_ELF_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/elf-em.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/elf.h>
|
||||
#endif
|
||||
#include <uapi/linux/elf.h>
|
||||
|
||||
/* 32-bit ELF base types. */
|
||||
typedef __u32 Elf32_Addr;
|
||||
typedef __u16 Elf32_Half;
|
||||
typedef __u32 Elf32_Off;
|
||||
typedef __s32 Elf32_Sword;
|
||||
typedef __u32 Elf32_Word;
|
||||
|
||||
/* 64-bit ELF base types. */
|
||||
typedef __u64 Elf64_Addr;
|
||||
typedef __u16 Elf64_Half;
|
||||
typedef __s16 Elf64_SHalf;
|
||||
typedef __u64 Elf64_Off;
|
||||
typedef __s32 Elf64_Sword;
|
||||
typedef __u32 Elf64_Word;
|
||||
typedef __u64 Elf64_Xword;
|
||||
typedef __s64 Elf64_Sxword;
|
||||
|
||||
/* These constants are for the segment types stored in the image headers */
|
||||
#define PT_NULL 0
|
||||
#define PT_LOAD 1
|
||||
#define PT_DYNAMIC 2
|
||||
#define PT_INTERP 3
|
||||
#define PT_NOTE 4
|
||||
#define PT_SHLIB 5
|
||||
#define PT_PHDR 6
|
||||
#define PT_TLS 7 /* Thread local storage segment */
|
||||
#define PT_LOOS 0x60000000 /* OS-specific */
|
||||
#define PT_HIOS 0x6fffffff /* OS-specific */
|
||||
#define PT_LOPROC 0x70000000
|
||||
#define PT_HIPROC 0x7fffffff
|
||||
#define PT_GNU_EH_FRAME 0x6474e550
|
||||
|
||||
#define PT_GNU_STACK (PT_LOOS + 0x474e551)
|
||||
|
||||
/*
|
||||
* Extended Numbering
|
||||
*
|
||||
* If the real number of program header table entries is larger than
|
||||
* or equal to PN_XNUM(0xffff), it is set to sh_info field of the
|
||||
* section header at index 0, and PN_XNUM is set to e_phnum
|
||||
* field. Otherwise, the section header at index 0 is zero
|
||||
* initialized, if it exists.
|
||||
*
|
||||
* Specifications are available in:
|
||||
*
|
||||
* - Sun microsystems: Linker and Libraries.
|
||||
* Part No: 817-1984-17, September 2008.
|
||||
* URL: http://docs.sun.com/app/docs/doc/817-1984
|
||||
*
|
||||
* - System V ABI AMD64 Architecture Processor Supplement
|
||||
* Draft Version 0.99.,
|
||||
* May 11, 2009.
|
||||
* URL: http://www.x86-64.org/
|
||||
*/
|
||||
#define PN_XNUM 0xffff
|
||||
|
||||
/* These constants define the different elf file types */
|
||||
#define ET_NONE 0
|
||||
#define ET_REL 1
|
||||
#define ET_EXEC 2
|
||||
#define ET_DYN 3
|
||||
#define ET_CORE 4
|
||||
#define ET_LOPROC 0xff00
|
||||
#define ET_HIPROC 0xffff
|
||||
|
||||
/* This is the info that is needed to parse the dynamic section of the file */
|
||||
#define DT_NULL 0
|
||||
#define DT_NEEDED 1
|
||||
#define DT_PLTRELSZ 2
|
||||
#define DT_PLTGOT 3
|
||||
#define DT_HASH 4
|
||||
#define DT_STRTAB 5
|
||||
#define DT_SYMTAB 6
|
||||
#define DT_RELA 7
|
||||
#define DT_RELASZ 8
|
||||
#define DT_RELAENT 9
|
||||
#define DT_STRSZ 10
|
||||
#define DT_SYMENT 11
|
||||
#define DT_INIT 12
|
||||
#define DT_FINI 13
|
||||
#define DT_SONAME 14
|
||||
#define DT_RPATH 15
|
||||
#define DT_SYMBOLIC 16
|
||||
#define DT_REL 17
|
||||
#define DT_RELSZ 18
|
||||
#define DT_RELENT 19
|
||||
#define DT_PLTREL 20
|
||||
#define DT_DEBUG 21
|
||||
#define DT_TEXTREL 22
|
||||
#define DT_JMPREL 23
|
||||
#define DT_ENCODING 32
|
||||
#define OLD_DT_LOOS 0x60000000
|
||||
#define DT_LOOS 0x6000000d
|
||||
#define DT_HIOS 0x6ffff000
|
||||
#define DT_VALRNGLO 0x6ffffd00
|
||||
#define DT_VALRNGHI 0x6ffffdff
|
||||
#define DT_ADDRRNGLO 0x6ffffe00
|
||||
#define DT_ADDRRNGHI 0x6ffffeff
|
||||
#define DT_VERSYM 0x6ffffff0
|
||||
#define DT_RELACOUNT 0x6ffffff9
|
||||
#define DT_RELCOUNT 0x6ffffffa
|
||||
#define DT_FLAGS_1 0x6ffffffb
|
||||
#define DT_VERDEF 0x6ffffffc
|
||||
#define DT_VERDEFNUM 0x6ffffffd
|
||||
#define DT_VERNEED 0x6ffffffe
|
||||
#define DT_VERNEEDNUM 0x6fffffff
|
||||
#define OLD_DT_HIOS 0x6fffffff
|
||||
#define DT_LOPROC 0x70000000
|
||||
#define DT_HIPROC 0x7fffffff
|
||||
|
||||
/* This info is needed when parsing the symbol table */
|
||||
#define STB_LOCAL 0
|
||||
#define STB_GLOBAL 1
|
||||
#define STB_WEAK 2
|
||||
|
||||
#define STT_NOTYPE 0
|
||||
#define STT_OBJECT 1
|
||||
#define STT_FUNC 2
|
||||
#define STT_SECTION 3
|
||||
#define STT_FILE 4
|
||||
#define STT_COMMON 5
|
||||
#define STT_TLS 6
|
||||
|
||||
#define ELF_ST_BIND(x) ((x) >> 4)
|
||||
#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
|
||||
#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
|
||||
#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
|
||||
#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
|
||||
#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
|
||||
|
||||
typedef struct dynamic{
|
||||
Elf32_Sword d_tag;
|
||||
union{
|
||||
Elf32_Sword d_val;
|
||||
Elf32_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
typedef struct {
|
||||
Elf64_Sxword d_tag; /* entry tag value */
|
||||
union {
|
||||
Elf64_Xword d_val;
|
||||
Elf64_Addr d_ptr;
|
||||
} d_un;
|
||||
} Elf64_Dyn;
|
||||
|
||||
/* The following are used with relocations */
|
||||
#define ELF32_R_SYM(x) ((x) >> 8)
|
||||
#define ELF32_R_TYPE(x) ((x) & 0xff)
|
||||
|
||||
#define ELF64_R_SYM(i) ((i) >> 32)
|
||||
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
|
||||
|
||||
typedef struct elf32_rel {
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
} Elf32_Rel;
|
||||
|
||||
typedef struct elf64_rel {
|
||||
Elf64_Addr r_offset; /* Location at which to apply the action */
|
||||
Elf64_Xword r_info; /* index and type of relocation */
|
||||
} Elf64_Rel;
|
||||
|
||||
typedef struct elf32_rela{
|
||||
Elf32_Addr r_offset;
|
||||
Elf32_Word r_info;
|
||||
Elf32_Sword r_addend;
|
||||
} Elf32_Rela;
|
||||
|
||||
typedef struct elf64_rela {
|
||||
Elf64_Addr r_offset; /* Location at which to apply the action */
|
||||
Elf64_Xword r_info; /* index and type of relocation */
|
||||
Elf64_Sxword r_addend; /* Constant addend used to compute value */
|
||||
} Elf64_Rela;
|
||||
|
||||
typedef struct elf32_sym{
|
||||
Elf32_Word st_name;
|
||||
Elf32_Addr st_value;
|
||||
Elf32_Word st_size;
|
||||
unsigned char st_info;
|
||||
unsigned char st_other;
|
||||
Elf32_Half st_shndx;
|
||||
} Elf32_Sym;
|
||||
|
||||
typedef struct elf64_sym {
|
||||
Elf64_Word st_name; /* Symbol name, index in string tbl */
|
||||
unsigned char st_info; /* Type and binding attributes */
|
||||
unsigned char st_other; /* No defined meaning, 0 */
|
||||
Elf64_Half st_shndx; /* Associated section index */
|
||||
Elf64_Addr st_value; /* Value of the symbol */
|
||||
Elf64_Xword st_size; /* Associated symbol size */
|
||||
} Elf64_Sym;
|
||||
|
||||
|
||||
#define EI_NIDENT 16
|
||||
|
||||
typedef struct elf32_hdr{
|
||||
unsigned char e_ident[EI_NIDENT];
|
||||
Elf32_Half e_type;
|
||||
Elf32_Half e_machine;
|
||||
Elf32_Word e_version;
|
||||
Elf32_Addr e_entry; /* Entry point */
|
||||
Elf32_Off e_phoff;
|
||||
Elf32_Off e_shoff;
|
||||
Elf32_Word e_flags;
|
||||
Elf32_Half e_ehsize;
|
||||
Elf32_Half e_phentsize;
|
||||
Elf32_Half e_phnum;
|
||||
Elf32_Half e_shentsize;
|
||||
Elf32_Half e_shnum;
|
||||
Elf32_Half e_shstrndx;
|
||||
} Elf32_Ehdr;
|
||||
|
||||
typedef struct elf64_hdr {
|
||||
unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
|
||||
Elf64_Half e_type;
|
||||
Elf64_Half e_machine;
|
||||
Elf64_Word e_version;
|
||||
Elf64_Addr e_entry; /* Entry point virtual address */
|
||||
Elf64_Off e_phoff; /* Program header table file offset */
|
||||
Elf64_Off e_shoff; /* Section header table file offset */
|
||||
Elf64_Word e_flags;
|
||||
Elf64_Half e_ehsize;
|
||||
Elf64_Half e_phentsize;
|
||||
Elf64_Half e_phnum;
|
||||
Elf64_Half e_shentsize;
|
||||
Elf64_Half e_shnum;
|
||||
Elf64_Half e_shstrndx;
|
||||
} Elf64_Ehdr;
|
||||
|
||||
/* These constants define the permissions on sections in the program
|
||||
header, p_flags. */
|
||||
#define PF_R 0x4
|
||||
#define PF_W 0x2
|
||||
#define PF_X 0x1
|
||||
|
||||
typedef struct elf32_phdr{
|
||||
Elf32_Word p_type;
|
||||
Elf32_Off p_offset;
|
||||
Elf32_Addr p_vaddr;
|
||||
Elf32_Addr p_paddr;
|
||||
Elf32_Word p_filesz;
|
||||
Elf32_Word p_memsz;
|
||||
Elf32_Word p_flags;
|
||||
Elf32_Word p_align;
|
||||
} Elf32_Phdr;
|
||||
|
||||
typedef struct elf64_phdr {
|
||||
Elf64_Word p_type;
|
||||
Elf64_Word p_flags;
|
||||
Elf64_Off p_offset; /* Segment file offset */
|
||||
Elf64_Addr p_vaddr; /* Segment virtual address */
|
||||
Elf64_Addr p_paddr; /* Segment physical address */
|
||||
Elf64_Xword p_filesz; /* Segment size in file */
|
||||
Elf64_Xword p_memsz; /* Segment size in memory */
|
||||
Elf64_Xword p_align; /* Segment alignment, file & memory */
|
||||
} Elf64_Phdr;
|
||||
|
||||
/* sh_type */
|
||||
#define SHT_NULL 0
|
||||
#define SHT_PROGBITS 1
|
||||
#define SHT_SYMTAB 2
|
||||
#define SHT_STRTAB 3
|
||||
#define SHT_RELA 4
|
||||
#define SHT_HASH 5
|
||||
#define SHT_DYNAMIC 6
|
||||
#define SHT_NOTE 7
|
||||
#define SHT_NOBITS 8
|
||||
#define SHT_REL 9
|
||||
#define SHT_SHLIB 10
|
||||
#define SHT_DYNSYM 11
|
||||
#define SHT_NUM 12
|
||||
#define SHT_LOPROC 0x70000000
|
||||
#define SHT_HIPROC 0x7fffffff
|
||||
#define SHT_LOUSER 0x80000000
|
||||
#define SHT_HIUSER 0xffffffff
|
||||
|
||||
/* sh_flags */
|
||||
#define SHF_WRITE 0x1
|
||||
#define SHF_ALLOC 0x2
|
||||
#define SHF_EXECINSTR 0x4
|
||||
#define SHF_MASKPROC 0xf0000000
|
||||
|
||||
/* special section indexes */
|
||||
#define SHN_UNDEF 0
|
||||
#define SHN_LORESERVE 0xff00
|
||||
#define SHN_LOPROC 0xff00
|
||||
#define SHN_HIPROC 0xff1f
|
||||
#define SHN_ABS 0xfff1
|
||||
#define SHN_COMMON 0xfff2
|
||||
#define SHN_HIRESERVE 0xffff
|
||||
|
||||
typedef struct elf32_shdr {
|
||||
Elf32_Word sh_name;
|
||||
Elf32_Word sh_type;
|
||||
Elf32_Word sh_flags;
|
||||
Elf32_Addr sh_addr;
|
||||
Elf32_Off sh_offset;
|
||||
Elf32_Word sh_size;
|
||||
Elf32_Word sh_link;
|
||||
Elf32_Word sh_info;
|
||||
Elf32_Word sh_addralign;
|
||||
Elf32_Word sh_entsize;
|
||||
} Elf32_Shdr;
|
||||
|
||||
typedef struct elf64_shdr {
|
||||
Elf64_Word sh_name; /* Section name, index in string tbl */
|
||||
Elf64_Word sh_type; /* Type of section */
|
||||
Elf64_Xword sh_flags; /* Miscellaneous section attributes */
|
||||
Elf64_Addr sh_addr; /* Section virtual addr at execution */
|
||||
Elf64_Off sh_offset; /* Section file offset */
|
||||
Elf64_Xword sh_size; /* Size of section in bytes */
|
||||
Elf64_Word sh_link; /* Index of another section */
|
||||
Elf64_Word sh_info; /* Additional section information */
|
||||
Elf64_Xword sh_addralign; /* Section alignment */
|
||||
Elf64_Xword sh_entsize; /* Entry size if section holds table */
|
||||
} Elf64_Shdr;
|
||||
|
||||
#define EI_MAG0 0 /* e_ident[] indexes */
|
||||
#define EI_MAG1 1
|
||||
#define EI_MAG2 2
|
||||
#define EI_MAG3 3
|
||||
#define EI_CLASS 4
|
||||
#define EI_DATA 5
|
||||
#define EI_VERSION 6
|
||||
#define EI_OSABI 7
|
||||
#define EI_PAD 8
|
||||
|
||||
#define ELFMAG0 0x7f /* EI_MAG */
|
||||
#define ELFMAG1 'E'
|
||||
#define ELFMAG2 'L'
|
||||
#define ELFMAG3 'F'
|
||||
#define ELFMAG "\177ELF"
|
||||
#define SELFMAG 4
|
||||
|
||||
#define ELFCLASSNONE 0 /* EI_CLASS */
|
||||
#define ELFCLASS32 1
|
||||
#define ELFCLASS64 2
|
||||
#define ELFCLASSNUM 3
|
||||
|
||||
#define ELFDATANONE 0 /* e_ident[EI_DATA] */
|
||||
#define ELFDATA2LSB 1
|
||||
#define ELFDATA2MSB 2
|
||||
|
||||
#define EV_NONE 0 /* e_version, EI_VERSION */
|
||||
#define EV_CURRENT 1
|
||||
#define EV_NUM 2
|
||||
|
||||
#define ELFOSABI_NONE 0
|
||||
#define ELFOSABI_LINUX 3
|
||||
|
||||
#ifndef ELF_OSABI
|
||||
#define ELF_OSABI ELFOSABI_NONE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Notes used in ET_CORE. Architectures export some of the arch register sets
|
||||
* using the corresponding note types via the PTRACE_GETREGSET and
|
||||
* PTRACE_SETREGSET requests.
|
||||
*/
|
||||
#define NT_PRSTATUS 1
|
||||
#define NT_PRFPREG 2
|
||||
#define NT_PRPSINFO 3
|
||||
#define NT_TASKSTRUCT 4
|
||||
#define NT_AUXV 6
|
||||
/*
|
||||
* Note to userspace developers: size of NT_SIGINFO note may increase
|
||||
* in the future to accomodate more fields, don't assume it is fixed!
|
||||
*/
|
||||
#define NT_SIGINFO 0x53494749
|
||||
#define NT_FILE 0x46494c45
|
||||
#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
|
||||
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
|
||||
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
|
||||
#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
|
||||
#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
|
||||
#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
|
||||
#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
|
||||
#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
|
||||
#define NT_S390_TIMER 0x301 /* s390 timer register */
|
||||
#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
|
||||
#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
|
||||
#define NT_S390_CTRS 0x304 /* s390 control registers */
|
||||
#define NT_S390_PREFIX 0x305 /* s390 prefix register */
|
||||
#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
|
||||
#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
|
||||
#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
|
||||
#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
|
||||
#define NT_ARM_TLS 0x401 /* ARM TLS register */
|
||||
#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
|
||||
#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
|
||||
|
||||
|
||||
/* Note header in a PT_NOTE section */
|
||||
typedef struct elf32_note {
|
||||
Elf32_Word n_namesz; /* Name size */
|
||||
Elf32_Word n_descsz; /* Content size */
|
||||
Elf32_Word n_type; /* Content type */
|
||||
} Elf32_Nhdr;
|
||||
|
||||
/* Note header in a PT_NOTE section */
|
||||
typedef struct elf64_note {
|
||||
Elf64_Word n_namesz; /* Name size */
|
||||
Elf64_Word n_descsz; /* Content size */
|
||||
Elf64_Word n_type; /* Content type */
|
||||
} Elf64_Nhdr;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifndef elf_read_implies_exec
|
||||
/* Executables for which elf_read_implies_exec() returns TRUE will
|
||||
have the READ_IMPLIES_EXEC personality flag set automatically.
|
||||
|
@ -455,5 +44,4 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
|
|||
extern int elf_coredump_extra_notes_size(void);
|
||||
extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
|
||||
#endif
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_ELF_H */
|
||||
|
|
|
@ -1,109 +1,11 @@
|
|||
#ifndef _LINUX_ELFCORE_H
|
||||
#define _LINUX_ELFCORE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/time.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/user.h>
|
||||
#include <linux/bug.h>
|
||||
#endif
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
struct elf_siginfo
|
||||
{
|
||||
int si_signo; /* signal number */
|
||||
int si_code; /* extra code */
|
||||
int si_errno; /* errno */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/elf.h>
|
||||
#endif
|
||||
#include <uapi/linux/elfcore.h>
|
||||
|
||||
#ifndef __KERNEL__
|
||||
typedef elf_greg_t greg_t;
|
||||
typedef elf_gregset_t gregset_t;
|
||||
typedef elf_fpregset_t fpregset_t;
|
||||
typedef elf_fpxregset_t fpxregset_t;
|
||||
#define NGREG ELF_NGREG
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definitions to generate Intel SVR4-like core files.
|
||||
* These mostly have the same names as the SVR4 types with "elf_"
|
||||
* tacked on the front to prevent clashes with linux definitions,
|
||||
* and the typedef forms have been avoided. This is mostly like
|
||||
* the SVR4 structure, but more Linuxy, with things that Linux does
|
||||
* not support and which gdb doesn't really use excluded.
|
||||
* Fields present but not used are marked with "XXX".
|
||||
*/
|
||||
struct elf_prstatus
|
||||
{
|
||||
#if 0
|
||||
long pr_flags; /* XXX Process flags */
|
||||
short pr_why; /* XXX Reason for process halt */
|
||||
short pr_what; /* XXX More detailed reason */
|
||||
#endif
|
||||
struct elf_siginfo pr_info; /* Info associated with signal */
|
||||
short pr_cursig; /* Current signal */
|
||||
unsigned long pr_sigpend; /* Set of pending signals */
|
||||
unsigned long pr_sighold; /* Set of held signals */
|
||||
#if 0
|
||||
struct sigaltstack pr_altstack; /* Alternate stack info */
|
||||
struct sigaction pr_action; /* Signal action for current sig */
|
||||
#endif
|
||||
pid_t pr_pid;
|
||||
pid_t pr_ppid;
|
||||
pid_t pr_pgrp;
|
||||
pid_t pr_sid;
|
||||
struct timeval pr_utime; /* User time */
|
||||
struct timeval pr_stime; /* System time */
|
||||
struct timeval pr_cutime; /* Cumulative user time */
|
||||
struct timeval pr_cstime; /* Cumulative system time */
|
||||
#if 0
|
||||
long pr_instr; /* Current instruction */
|
||||
#endif
|
||||
elf_gregset_t pr_reg; /* GP registers */
|
||||
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||
/* When using FDPIC, the loadmap addresses need to be communicated
|
||||
* to GDB in order for GDB to do the necessary relocations. The
|
||||
* fields (below) used to communicate this information are placed
|
||||
* immediately after ``pr_reg'', so that the loadmap addresses may
|
||||
* be viewed as part of the register set if so desired.
|
||||
*/
|
||||
unsigned long pr_exec_fdpic_loadmap;
|
||||
unsigned long pr_interp_fdpic_loadmap;
|
||||
#endif
|
||||
int pr_fpvalid; /* True if math co-processor being used. */
|
||||
};
|
||||
|
||||
#define ELF_PRARGSZ (80) /* Number of chars for args */
|
||||
|
||||
struct elf_prpsinfo
|
||||
{
|
||||
char pr_state; /* numeric process state */
|
||||
char pr_sname; /* char for pr_state */
|
||||
char pr_zomb; /* zombie */
|
||||
char pr_nice; /* nice val */
|
||||
unsigned long pr_flag; /* flags */
|
||||
__kernel_uid_t pr_uid;
|
||||
__kernel_gid_t pr_gid;
|
||||
pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
||||
/* Lots missing */
|
||||
char pr_fname[16]; /* filename of executable */
|
||||
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
|
||||
};
|
||||
|
||||
#ifndef __KERNEL__
|
||||
typedef struct elf_prstatus prstatus_t;
|
||||
typedef struct elf_prpsinfo prpsinfo_t;
|
||||
#define PRARGSZ ELF_PRARGSZ
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
|
||||
{
|
||||
#ifdef ELF_CORE_COPY_REGS
|
||||
|
@ -167,6 +69,4 @@ extern int
|
|||
elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
|
||||
extern size_t elf_core_extra_data_size(void);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_ELFCORE_H */
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef _LINUX_ERRNO_H
|
||||
#define _LINUX_ERRNO_H
|
||||
|
||||
#include <asm/errno.h>
|
||||
#include <uapi/linux/errno.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* These should never be seen by user programs. To return one of ERESTART*
|
||||
|
@ -32,5 +31,3 @@
|
|||
#define EIOCBRETRY 530 /* iocb queued, will trigger a retry */
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,33 +1,12 @@
|
|||
#ifndef _LINUX_ERRQUEUE_H
|
||||
#define _LINUX_ERRQUEUE_H 1
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct sock_extended_err {
|
||||
__u32 ee_errno;
|
||||
__u8 ee_origin;
|
||||
__u8 ee_type;
|
||||
__u8 ee_code;
|
||||
__u8 ee_pad;
|
||||
__u32 ee_info;
|
||||
__u32 ee_data;
|
||||
};
|
||||
|
||||
#define SO_EE_ORIGIN_NONE 0
|
||||
#define SO_EE_ORIGIN_LOCAL 1
|
||||
#define SO_EE_ORIGIN_ICMP 2
|
||||
#define SO_EE_ORIGIN_ICMP6 3
|
||||
#define SO_EE_ORIGIN_TXSTATUS 4
|
||||
#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
|
||||
|
||||
#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <net/ip.h>
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
#include <linux/ipv6.h>
|
||||
#endif
|
||||
#include <uapi/linux/errqueue.h>
|
||||
|
||||
#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
|
||||
|
||||
|
@ -44,5 +23,3 @@ struct sock_exterr_skb {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -10,59 +10,11 @@
|
|||
* Davide Libenzi <davidel@xmailserver.org>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_EVENTPOLL_H
|
||||
#define _LINUX_EVENTPOLL_H
|
||||
|
||||
/* For O_CLOEXEC */
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/eventpoll.h>
|
||||
|
||||
/* Flags for epoll_create1. */
|
||||
#define EPOLL_CLOEXEC O_CLOEXEC
|
||||
|
||||
/* Valid opcodes to issue to sys_epoll_ctl() */
|
||||
#define EPOLL_CTL_ADD 1
|
||||
#define EPOLL_CTL_DEL 2
|
||||
#define EPOLL_CTL_MOD 3
|
||||
#define EPOLL_CTL_DISABLE 4
|
||||
|
||||
/*
|
||||
* Request the handling of system wakeup events so as to prevent system suspends
|
||||
* from happening while those events are being processed.
|
||||
*
|
||||
* Assuming neither EPOLLET nor EPOLLONESHOT is set, system suspends will not be
|
||||
* re-allowed until epoll_wait is called again after consuming the wakeup
|
||||
* event(s).
|
||||
*
|
||||
* Requires CAP_BLOCK_SUSPEND
|
||||
*/
|
||||
#define EPOLLWAKEUP (1 << 29)
|
||||
|
||||
/* Set the One Shot behaviour for the target file descriptor */
|
||||
#define EPOLLONESHOT (1 << 30)
|
||||
|
||||
/* Set the Edge Triggered behaviour for the target file descriptor */
|
||||
#define EPOLLET (1 << 31)
|
||||
|
||||
/*
|
||||
* On x86-64 make the 64bit structure have the same alignment as the
|
||||
* 32bit structure. This makes 32bit emulation easier.
|
||||
*
|
||||
* UML/x86_64 needs the same packing as x86_64
|
||||
*/
|
||||
#ifdef __x86_64__
|
||||
#define EPOLL_PACKED __attribute__((packed))
|
||||
#else
|
||||
#define EPOLL_PACKED
|
||||
#endif
|
||||
|
||||
struct epoll_event {
|
||||
__u32 events;
|
||||
__u64 data;
|
||||
} EPOLL_PACKED;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* Forward declarations to avoid compiler errors */
|
||||
struct file;
|
||||
|
@ -116,7 +68,4 @@ static inline void eventpoll_release(struct file *file) {}
|
|||
|
||||
#endif
|
||||
|
||||
#endif /* #ifdef __KERNEL__ */
|
||||
|
||||
#endif /* #ifndef _LINUX_EVENTPOLL_H */
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#ifndef _FALLOC_H_
|
||||
#define _FALLOC_H_
|
||||
|
||||
#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
|
||||
#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
|
||||
#define FALLOC_FL_NO_HIDE_STALE 0x04 /* reserved codepoint */
|
||||
#include <uapi/linux/falloc.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* Space reservation ioctls and argument structure
|
||||
|
@ -24,6 +21,4 @@ struct space_resv {
|
|||
#define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
|
||||
#define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _FALLOC_H_ */
|
||||
|
|
|
@ -1,120 +1,8 @@
|
|||
#ifndef _LINUX_FANOTIFY_H
|
||||
#define _LINUX_FANOTIFY_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/fanotify.h>
|
||||
|
||||
/* the following events that user-space can register for */
|
||||
#define FAN_ACCESS 0x00000001 /* File was accessed */
|
||||
#define FAN_MODIFY 0x00000002 /* File was modified */
|
||||
#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
|
||||
#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
|
||||
#define FAN_OPEN 0x00000020 /* File was opened */
|
||||
|
||||
#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
|
||||
|
||||
#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
|
||||
#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
|
||||
|
||||
#define FAN_ONDIR 0x40000000 /* event occurred against dir */
|
||||
|
||||
#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
|
||||
|
||||
/* helper events */
|
||||
#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
|
||||
|
||||
/* flags used for fanotify_init() */
|
||||
#define FAN_CLOEXEC 0x00000001
|
||||
#define FAN_NONBLOCK 0x00000002
|
||||
|
||||
/* These are NOT bitwise flags. Both bits are used togther. */
|
||||
#define FAN_CLASS_NOTIF 0x00000000
|
||||
#define FAN_CLASS_CONTENT 0x00000004
|
||||
#define FAN_CLASS_PRE_CONTENT 0x00000008
|
||||
#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
|
||||
FAN_CLASS_PRE_CONTENT)
|
||||
|
||||
#define FAN_UNLIMITED_QUEUE 0x00000010
|
||||
#define FAN_UNLIMITED_MARKS 0x00000020
|
||||
|
||||
#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
|
||||
FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
|
||||
FAN_UNLIMITED_MARKS)
|
||||
|
||||
/* flags used for fanotify_modify_mark() */
|
||||
#define FAN_MARK_ADD 0x00000001
|
||||
#define FAN_MARK_REMOVE 0x00000002
|
||||
#define FAN_MARK_DONT_FOLLOW 0x00000004
|
||||
#define FAN_MARK_ONLYDIR 0x00000008
|
||||
#define FAN_MARK_MOUNT 0x00000010
|
||||
#define FAN_MARK_IGNORED_MASK 0x00000020
|
||||
#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
|
||||
#define FAN_MARK_FLUSH 0x00000080
|
||||
#ifdef __KERNEL__
|
||||
/* not valid from userspace, only kernel internal */
|
||||
#define FAN_MARK_ONDIR 0x00000100
|
||||
#endif
|
||||
|
||||
#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
|
||||
FAN_MARK_REMOVE |\
|
||||
FAN_MARK_DONT_FOLLOW |\
|
||||
FAN_MARK_ONLYDIR |\
|
||||
FAN_MARK_MOUNT |\
|
||||
FAN_MARK_IGNORED_MASK |\
|
||||
FAN_MARK_IGNORED_SURV_MODIFY |\
|
||||
FAN_MARK_FLUSH)
|
||||
|
||||
/*
|
||||
* All of the events - we build the list by hand so that we can add flags in
|
||||
* the future and not break backward compatibility. Apps will get only the
|
||||
* events that they originally wanted. Be sure to add new events here!
|
||||
*/
|
||||
#define FAN_ALL_EVENTS (FAN_ACCESS |\
|
||||
FAN_MODIFY |\
|
||||
FAN_CLOSE |\
|
||||
FAN_OPEN)
|
||||
|
||||
/*
|
||||
* All events which require a permission response from userspace
|
||||
*/
|
||||
#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
|
||||
FAN_ACCESS_PERM)
|
||||
|
||||
#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
|
||||
FAN_ALL_PERM_EVENTS |\
|
||||
FAN_Q_OVERFLOW)
|
||||
|
||||
#define FANOTIFY_METADATA_VERSION 3
|
||||
|
||||
struct fanotify_event_metadata {
|
||||
__u32 event_len;
|
||||
__u8 vers;
|
||||
__u8 reserved;
|
||||
__u16 metadata_len;
|
||||
__aligned_u64 mask;
|
||||
__s32 fd;
|
||||
__s32 pid;
|
||||
};
|
||||
|
||||
struct fanotify_response {
|
||||
__s32 fd;
|
||||
__u32 response;
|
||||
};
|
||||
|
||||
/* Legit userspace responses to a _PERM event */
|
||||
#define FAN_ALLOW 0x01
|
||||
#define FAN_DENY 0x02
|
||||
/* No fd set in event */
|
||||
#define FAN_NOFD -1
|
||||
|
||||
/* Helper functions to deal with fanotify_event_metadata buffers */
|
||||
#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
|
||||
|
||||
#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
|
||||
(struct fanotify_event_metadata*)(((char *)(meta)) + \
|
||||
(meta)->event_len))
|
||||
|
||||
#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
|
||||
(long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
|
||||
(long)(meta)->event_len <= (long)(len))
|
||||
|
||||
#endif /* _LINUX_FANOTIFY_H */
|
||||
|
|
|
@ -1,409 +1,10 @@
|
|||
#ifndef _LINUX_FB_H
|
||||
#define _LINUX_FB_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/i2c.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/kgdb.h>
|
||||
#endif /* __KERNEL__ */
|
||||
#include <uapi/linux/fb.h>
|
||||
|
||||
/* Definitions of frame buffers */
|
||||
|
||||
#define FB_MAX 32 /* sufficient for now */
|
||||
|
||||
/* ioctls
|
||||
0x46 is 'F' */
|
||||
#define FBIOGET_VSCREENINFO 0x4600
|
||||
#define FBIOPUT_VSCREENINFO 0x4601
|
||||
#define FBIOGET_FSCREENINFO 0x4602
|
||||
#define FBIOGETCMAP 0x4604
|
||||
#define FBIOPUTCMAP 0x4605
|
||||
#define FBIOPAN_DISPLAY 0x4606
|
||||
#ifdef __KERNEL__
|
||||
#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user)
|
||||
#else
|
||||
#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
|
||||
#endif
|
||||
/* 0x4607-0x460B are defined below */
|
||||
/* #define FBIOGET_MONITORSPEC 0x460C */
|
||||
/* #define FBIOPUT_MONITORSPEC 0x460D */
|
||||
/* #define FBIOSWITCH_MONIBIT 0x460E */
|
||||
#define FBIOGET_CON2FBMAP 0x460F
|
||||
#define FBIOPUT_CON2FBMAP 0x4610
|
||||
#define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
|
||||
#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
|
||||
#define FBIO_ALLOC 0x4613
|
||||
#define FBIO_FREE 0x4614
|
||||
#define FBIOGET_GLYPH 0x4615
|
||||
#define FBIOGET_HWCINFO 0x4616
|
||||
#define FBIOPUT_MODEINFO 0x4617
|
||||
#define FBIOGET_DISPINFO 0x4618
|
||||
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
|
||||
|
||||
#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
|
||||
#define FB_TYPE_PLANES 1 /* Non interleaved planes */
|
||||
#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
|
||||
#define FB_TYPE_TEXT 3 /* Text/attributes */
|
||||
#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
|
||||
#define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */
|
||||
|
||||
#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
|
||||
#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
|
||||
#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
|
||||
#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
|
||||
#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
|
||||
#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
|
||||
#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
|
||||
#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
|
||||
#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
|
||||
#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
|
||||
#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
|
||||
#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
|
||||
|
||||
#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
|
||||
#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
|
||||
#define FB_AUX_VGA_PLANES_CFB8 2 /* CFB8 in planes (VGA) */
|
||||
|
||||
#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
|
||||
#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
|
||||
#define FB_VISUAL_TRUECOLOR 2 /* True color */
|
||||
#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
|
||||
#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
|
||||
#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
|
||||
#define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */
|
||||
|
||||
#define FB_ACCEL_NONE 0 /* no hardware accelerator */
|
||||
#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
|
||||
#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
|
||||
#define FB_ACCEL_S3_TRIO64 3 /* Cybervision64 (S3 Trio64) */
|
||||
#define FB_ACCEL_NCR_77C32BLT 4 /* RetinaZ3 (NCR 77C32BLT) */
|
||||
#define FB_ACCEL_S3_VIRGE 5 /* Cybervision64/3D (S3 ViRGE) */
|
||||
#define FB_ACCEL_ATI_MACH64GX 6 /* ATI Mach 64GX family */
|
||||
#define FB_ACCEL_DEC_TGA 7 /* DEC 21030 TGA */
|
||||
#define FB_ACCEL_ATI_MACH64CT 8 /* ATI Mach 64CT family */
|
||||
#define FB_ACCEL_ATI_MACH64VT 9 /* ATI Mach 64CT family VT class */
|
||||
#define FB_ACCEL_ATI_MACH64GT 10 /* ATI Mach 64CT family GT class */
|
||||
#define FB_ACCEL_SUN_CREATOR 11 /* Sun Creator/Creator3D */
|
||||
#define FB_ACCEL_SUN_CGSIX 12 /* Sun cg6 */
|
||||
#define FB_ACCEL_SUN_LEO 13 /* Sun leo/zx */
|
||||
#define FB_ACCEL_IMS_TWINTURBO 14 /* IMS Twin Turbo */
|
||||
#define FB_ACCEL_3DLABS_PERMEDIA2 15 /* 3Dlabs Permedia 2 */
|
||||
#define FB_ACCEL_MATROX_MGA2064W 16 /* Matrox MGA2064W (Millenium) */
|
||||
#define FB_ACCEL_MATROX_MGA1064SG 17 /* Matrox MGA1064SG (Mystique) */
|
||||
#define FB_ACCEL_MATROX_MGA2164W 18 /* Matrox MGA2164W (Millenium II) */
|
||||
#define FB_ACCEL_MATROX_MGA2164W_AGP 19 /* Matrox MGA2164W (Millenium II) */
|
||||
#define FB_ACCEL_MATROX_MGAG100 20 /* Matrox G100 (Productiva G100) */
|
||||
#define FB_ACCEL_MATROX_MGAG200 21 /* Matrox G200 (Myst, Mill, ...) */
|
||||
#define FB_ACCEL_SUN_CG14 22 /* Sun cgfourteen */
|
||||
#define FB_ACCEL_SUN_BWTWO 23 /* Sun bwtwo */
|
||||
#define FB_ACCEL_SUN_CGTHREE 24 /* Sun cgthree */
|
||||
#define FB_ACCEL_SUN_TCX 25 /* Sun tcx */
|
||||
#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
|
||||
#define FB_ACCEL_NV3 27 /* nVidia RIVA 128 */
|
||||
#define FB_ACCEL_NV4 28 /* nVidia RIVA TNT */
|
||||
#define FB_ACCEL_NV5 29 /* nVidia RIVA TNT2 */
|
||||
#define FB_ACCEL_CT_6555x 30 /* C&T 6555x */
|
||||
#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
|
||||
#define FB_ACCEL_ATI_RAGE128 32 /* ATI Rage128 family */
|
||||
#define FB_ACCEL_IGS_CYBER2000 33 /* CyberPro 2000 */
|
||||
#define FB_ACCEL_IGS_CYBER2010 34 /* CyberPro 2010 */
|
||||
#define FB_ACCEL_IGS_CYBER5000 35 /* CyberPro 5000 */
|
||||
#define FB_ACCEL_SIS_GLAMOUR 36 /* SiS 300/630/540 */
|
||||
#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
|
||||
#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
|
||||
#define FB_ACCEL_I810 39 /* Intel 810/815 */
|
||||
#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
|
||||
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
|
||||
#define FB_ACCEL_I830 42 /* Intel 830M/845G/85x/865G */
|
||||
#define FB_ACCEL_NV_10 43 /* nVidia Arch 10 */
|
||||
#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
|
||||
#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
|
||||
#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
|
||||
#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
|
||||
#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
|
||||
#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
|
||||
#define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */
|
||||
#define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */
|
||||
#define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */
|
||||
#define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */
|
||||
#define FB_ACCEL_CIRRUS_ALPINE 53 /* Cirrus Logic 543x/544x/5480 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2097 93 /* NeoMagic NM2097 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2160 94 /* NeoMagic NM2160 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2200 95 /* NeoMagic NM2200 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
|
||||
#define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
|
||||
#define FB_ACCEL_PXA3XX 99 /* PXA3xx */
|
||||
|
||||
#define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
|
||||
#define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
|
||||
#define FB_ACCEL_SAVAGE3D_MV 0x82 /* S3 Savage3D-MV */
|
||||
#define FB_ACCEL_SAVAGE2000 0x83 /* S3 Savage2000 */
|
||||
#define FB_ACCEL_SAVAGE_MX_MV 0x84 /* S3 Savage/MX-MV */
|
||||
#define FB_ACCEL_SAVAGE_MX 0x85 /* S3 Savage/MX */
|
||||
#define FB_ACCEL_SAVAGE_IX_MV 0x86 /* S3 Savage/IX-MV */
|
||||
#define FB_ACCEL_SAVAGE_IX 0x87 /* S3 Savage/IX */
|
||||
#define FB_ACCEL_PROSAVAGE_PM 0x88 /* S3 ProSavage PM133 */
|
||||
#define FB_ACCEL_PROSAVAGE_KM 0x89 /* S3 ProSavage KM133 */
|
||||
#define FB_ACCEL_S3TWISTER_P 0x8a /* S3 Twister */
|
||||
#define FB_ACCEL_S3TWISTER_K 0x8b /* S3 TwisterK */
|
||||
#define FB_ACCEL_SUPERSAVAGE 0x8c /* S3 Supersavage */
|
||||
#define FB_ACCEL_PROSAVAGE_DDR 0x8d /* S3 ProSavage DDR */
|
||||
#define FB_ACCEL_PROSAVAGE_DDRK 0x8e /* S3 ProSavage DDR-K */
|
||||
|
||||
#define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */
|
||||
|
||||
#define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */
|
||||
|
||||
struct fb_fix_screeninfo {
|
||||
char id[16]; /* identification string eg "TT Builtin" */
|
||||
unsigned long smem_start; /* Start of frame buffer mem */
|
||||
/* (physical address) */
|
||||
__u32 smem_len; /* Length of frame buffer mem */
|
||||
__u32 type; /* see FB_TYPE_* */
|
||||
__u32 type_aux; /* Interleave for interleaved Planes */
|
||||
__u32 visual; /* see FB_VISUAL_* */
|
||||
__u16 xpanstep; /* zero if no hardware panning */
|
||||
__u16 ypanstep; /* zero if no hardware panning */
|
||||
__u16 ywrapstep; /* zero if no hardware ywrap */
|
||||
__u32 line_length; /* length of a line in bytes */
|
||||
unsigned long mmio_start; /* Start of Memory Mapped I/O */
|
||||
/* (physical address) */
|
||||
__u32 mmio_len; /* Length of Memory Mapped I/O */
|
||||
__u32 accel; /* Indicate to driver which */
|
||||
/* specific chip/card we have */
|
||||
__u16 capabilities; /* see FB_CAP_* */
|
||||
__u16 reserved[2]; /* Reserved for future compatibility */
|
||||
};
|
||||
|
||||
/* Interpretation of offset for color fields: All offsets are from the right,
|
||||
* inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
|
||||
* can use the offset as right argument to <<). A pixel afterwards is a bit
|
||||
* stream and is written to video memory as that unmodified.
|
||||
*
|
||||
* For pseudocolor: offset and length should be the same for all color
|
||||
* components. Offset specifies the position of the least significant bit
|
||||
* of the pallette index in a pixel value. Length indicates the number
|
||||
* of available palette entries (i.e. # of entries = 1 << length).
|
||||
*/
|
||||
struct fb_bitfield {
|
||||
__u32 offset; /* beginning of bitfield */
|
||||
__u32 length; /* length of bitfield */
|
||||
__u32 msb_right; /* != 0 : Most significant bit is */
|
||||
/* right */
|
||||
};
|
||||
|
||||
#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
|
||||
#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
|
||||
|
||||
#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
|
||||
#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
|
||||
#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
|
||||
#define FB_ACTIVATE_MASK 15
|
||||
/* values */
|
||||
#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
|
||||
#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
|
||||
#define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
|
||||
#define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
|
||||
#define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
|
||||
|
||||
#define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
|
||||
|
||||
#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
|
||||
#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
|
||||
#define FB_SYNC_EXT 4 /* external sync */
|
||||
#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
|
||||
#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
|
||||
/* vtotal = 144d/288n/576i => PAL */
|
||||
/* vtotal = 121d/242n/484i => NTSC */
|
||||
#define FB_SYNC_ON_GREEN 32 /* sync on green */
|
||||
|
||||
#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
|
||||
#define FB_VMODE_INTERLACED 1 /* interlaced */
|
||||
#define FB_VMODE_DOUBLE 2 /* double scan */
|
||||
#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
|
||||
#define FB_VMODE_MASK 255
|
||||
|
||||
#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
|
||||
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
|
||||
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
|
||||
|
||||
/*
|
||||
* Display rotation support
|
||||
*/
|
||||
#define FB_ROTATE_UR 0
|
||||
#define FB_ROTATE_CW 1
|
||||
#define FB_ROTATE_UD 2
|
||||
#define FB_ROTATE_CCW 3
|
||||
|
||||
#define PICOS2KHZ(a) (1000000000UL/(a))
|
||||
#define KHZ2PICOS(a) (1000000000UL/(a))
|
||||
|
||||
struct fb_var_screeninfo {
|
||||
__u32 xres; /* visible resolution */
|
||||
__u32 yres;
|
||||
__u32 xres_virtual; /* virtual resolution */
|
||||
__u32 yres_virtual;
|
||||
__u32 xoffset; /* offset from virtual to visible */
|
||||
__u32 yoffset; /* resolution */
|
||||
|
||||
__u32 bits_per_pixel; /* guess what */
|
||||
__u32 grayscale; /* 0 = color, 1 = grayscale, */
|
||||
/* >1 = FOURCC */
|
||||
struct fb_bitfield red; /* bitfield in fb mem if true color, */
|
||||
struct fb_bitfield green; /* else only length is significant */
|
||||
struct fb_bitfield blue;
|
||||
struct fb_bitfield transp; /* transparency */
|
||||
|
||||
__u32 nonstd; /* != 0 Non standard pixel format */
|
||||
|
||||
__u32 activate; /* see FB_ACTIVATE_* */
|
||||
|
||||
__u32 height; /* height of picture in mm */
|
||||
__u32 width; /* width of picture in mm */
|
||||
|
||||
__u32 accel_flags; /* (OBSOLETE) see fb_info.flags */
|
||||
|
||||
/* Timing: All values in pixclocks, except pixclock (of course) */
|
||||
__u32 pixclock; /* pixel clock in ps (pico seconds) */
|
||||
__u32 left_margin; /* time from sync to picture */
|
||||
__u32 right_margin; /* time from picture to sync */
|
||||
__u32 upper_margin; /* time from sync to picture */
|
||||
__u32 lower_margin;
|
||||
__u32 hsync_len; /* length of horizontal sync */
|
||||
__u32 vsync_len; /* length of vertical sync */
|
||||
__u32 sync; /* see FB_SYNC_* */
|
||||
__u32 vmode; /* see FB_VMODE_* */
|
||||
__u32 rotate; /* angle we rotate counter clockwise */
|
||||
__u32 colorspace; /* colorspace for FOURCC-based modes */
|
||||
__u32 reserved[4]; /* Reserved for future compatibility */
|
||||
};
|
||||
|
||||
struct fb_cmap {
|
||||
__u32 start; /* First entry */
|
||||
__u32 len; /* Number of entries */
|
||||
__u16 *red; /* Red values */
|
||||
__u16 *green;
|
||||
__u16 *blue;
|
||||
__u16 *transp; /* transparency, can be NULL */
|
||||
};
|
||||
|
||||
struct fb_con2fbmap {
|
||||
__u32 console;
|
||||
__u32 framebuffer;
|
||||
};
|
||||
|
||||
/* VESA Blanking Levels */
|
||||
#define VESA_NO_BLANKING 0
|
||||
#define VESA_VSYNC_SUSPEND 1
|
||||
#define VESA_HSYNC_SUSPEND 2
|
||||
#define VESA_POWERDOWN 3
|
||||
|
||||
|
||||
enum {
|
||||
/* screen: unblanked, hsync: on, vsync: on */
|
||||
FB_BLANK_UNBLANK = VESA_NO_BLANKING,
|
||||
|
||||
/* screen: blanked, hsync: on, vsync: on */
|
||||
FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
|
||||
|
||||
/* screen: blanked, hsync: on, vsync: off */
|
||||
FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
|
||||
|
||||
/* screen: blanked, hsync: off, vsync: on */
|
||||
FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
|
||||
|
||||
/* screen: blanked, hsync: off, vsync: off */
|
||||
FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
|
||||
};
|
||||
|
||||
#define FB_VBLANK_VBLANKING 0x001 /* currently in a vertical blank */
|
||||
#define FB_VBLANK_HBLANKING 0x002 /* currently in a horizontal blank */
|
||||
#define FB_VBLANK_HAVE_VBLANK 0x004 /* vertical blanks can be detected */
|
||||
#define FB_VBLANK_HAVE_HBLANK 0x008 /* horizontal blanks can be detected */
|
||||
#define FB_VBLANK_HAVE_COUNT 0x010 /* global retrace counter is available */
|
||||
#define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */
|
||||
#define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */
|
||||
#define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */
|
||||
#define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */
|
||||
|
||||
struct fb_vblank {
|
||||
__u32 flags; /* FB_VBLANK flags */
|
||||
__u32 count; /* counter of retraces since boot */
|
||||
__u32 vcount; /* current scanline position */
|
||||
__u32 hcount; /* current scandot position */
|
||||
__u32 reserved[4]; /* reserved for future compatibility */
|
||||
};
|
||||
|
||||
/* Internal HW accel */
|
||||
#define ROP_COPY 0
|
||||
#define ROP_XOR 1
|
||||
|
||||
struct fb_copyarea {
|
||||
__u32 dx;
|
||||
__u32 dy;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u32 sx;
|
||||
__u32 sy;
|
||||
};
|
||||
|
||||
struct fb_fillrect {
|
||||
__u32 dx; /* screen-relative */
|
||||
__u32 dy;
|
||||
__u32 width;
|
||||
__u32 height;
|
||||
__u32 color;
|
||||
__u32 rop;
|
||||
};
|
||||
|
||||
struct fb_image {
|
||||
__u32 dx; /* Where to place image */
|
||||
__u32 dy;
|
||||
__u32 width; /* Size of image */
|
||||
__u32 height;
|
||||
__u32 fg_color; /* Only used when a mono bitmap */
|
||||
__u32 bg_color;
|
||||
__u8 depth; /* Depth of the image */
|
||||
const char *data; /* Pointer to image data */
|
||||
struct fb_cmap cmap; /* color map info */
|
||||
};
|
||||
|
||||
/*
|
||||
* hardware cursor control
|
||||
*/
|
||||
|
||||
#define FB_CUR_SETIMAGE 0x01
|
||||
#define FB_CUR_SETPOS 0x02
|
||||
#define FB_CUR_SETHOT 0x04
|
||||
#define FB_CUR_SETCMAP 0x08
|
||||
#define FB_CUR_SETSHAPE 0x10
|
||||
#define FB_CUR_SETSIZE 0x20
|
||||
#define FB_CUR_SETALL 0xFF
|
||||
|
||||
struct fbcurpos {
|
||||
__u16 x, y;
|
||||
};
|
||||
|
||||
struct fb_cursor {
|
||||
__u16 set; /* what to set */
|
||||
__u16 enable; /* cursor on/off */
|
||||
__u16 rop; /* bitop operation */
|
||||
const char *mask; /* cursor mask bits */
|
||||
struct fbcurpos hot; /* cursor hot spot */
|
||||
struct fb_image image; /* Cursor image */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FB_BACKLIGHT
|
||||
/* Settings for the generic backlight code */
|
||||
#define FB_BACKLIGHT_LEVELS 128
|
||||
#define FB_BACKLIGHT_MAX 0xFF
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/init.h>
|
||||
|
@ -1181,6 +782,4 @@ extern int fb_find_mode(struct fb_var_screeninfo *var,
|
|||
const struct fb_videomode *default_mode,
|
||||
unsigned int default_bpp);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_FB_H */
|
||||
|
|
|
@ -1,54 +1,8 @@
|
|||
#ifndef _LINUX_FCNTL_H
|
||||
#define _LINUX_FCNTL_H
|
||||
|
||||
#include <asm/fcntl.h>
|
||||
#include <uapi/linux/fcntl.h>
|
||||
|
||||
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
|
||||
#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
|
||||
|
||||
/*
|
||||
* Cancel a blocking posix lock; internal use only until we expose an
|
||||
* asynchronous lock api to userspace:
|
||||
*/
|
||||
#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
|
||||
|
||||
/* Create a file descriptor with FD_CLOEXEC set. */
|
||||
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
|
||||
|
||||
/*
|
||||
* Request nofications on a directory.
|
||||
* See below for events that may be notified.
|
||||
*/
|
||||
#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
|
||||
|
||||
/*
|
||||
* Set and get of pipe page size array
|
||||
*/
|
||||
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
|
||||
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
|
||||
|
||||
/*
|
||||
* Types of directory notifications that may be requested.
|
||||
*/
|
||||
#define DN_ACCESS 0x00000001 /* File accessed */
|
||||
#define DN_MODIFY 0x00000002 /* File modified */
|
||||
#define DN_CREATE 0x00000004 /* File created */
|
||||
#define DN_DELETE 0x00000008 /* File removed */
|
||||
#define DN_RENAME 0x00000010 /* File renamed */
|
||||
#define DN_ATTRIB 0x00000020 /* File changed attibutes */
|
||||
#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
|
||||
|
||||
#define AT_FDCWD -100 /* Special value used to indicate
|
||||
openat should use the current
|
||||
working directory. */
|
||||
#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
|
||||
#define AT_REMOVEDIR 0x200 /* Remove directory instead of
|
||||
unlinking file. */
|
||||
#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
|
||||
#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
|
||||
#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef force_o_largefile
|
||||
#define force_o_largefile() (BITS_PER_LONG != 32)
|
||||
|
@ -74,6 +28,4 @@
|
|||
#define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd))
|
||||
#define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd))
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,384 +1,8 @@
|
|||
#ifndef _LINUX_FD_H
|
||||
#define _LINUX_FD_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <uapi/linux/fd.h>
|
||||
|
||||
/* New file layout: Now the ioctl definitions immediately follow the
|
||||
* definitions of the structures that they use */
|
||||
|
||||
/*
|
||||
* Geometry
|
||||
*/
|
||||
struct floppy_struct {
|
||||
unsigned int size, /* nr of sectors total */
|
||||
sect, /* sectors per track */
|
||||
head, /* nr of heads */
|
||||
track, /* nr of tracks */
|
||||
stretch; /* bit 0 !=0 means double track steps */
|
||||
/* bit 1 != 0 means swap sides */
|
||||
/* bits 2..9 give the first sector */
|
||||
/* number (the LSB is flipped) */
|
||||
#define FD_STRETCH 1
|
||||
#define FD_SWAPSIDES 2
|
||||
#define FD_ZEROBASED 4
|
||||
#define FD_SECTBASEMASK 0x3FC
|
||||
#define FD_MKSECTBASE(s) (((s) ^ 1) << 2)
|
||||
#define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1)
|
||||
|
||||
unsigned char gap, /* gap1 size */
|
||||
|
||||
rate, /* data rate. |= 0x40 for perpendicular */
|
||||
#define FD_2M 0x4
|
||||
#define FD_SIZECODEMASK 0x38
|
||||
#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
|
||||
#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ? \
|
||||
512 : 128 << FD_SIZECODE(floppy) )
|
||||
#define FD_PERP 0x40
|
||||
|
||||
spec1, /* stepping rate, head unload time */
|
||||
fmt_gap; /* gap2 size */
|
||||
const char * name; /* used only for predefined formats */
|
||||
};
|
||||
|
||||
|
||||
/* commands needing write access have 0x40 set */
|
||||
/* commands needing super user access have 0x80 set */
|
||||
|
||||
#define FDCLRPRM _IO(2, 0x41)
|
||||
/* clear user-defined parameters */
|
||||
|
||||
#define FDSETPRM _IOW(2, 0x42, struct floppy_struct)
|
||||
#define FDSETMEDIAPRM FDSETPRM
|
||||
/* set user-defined parameters for current media */
|
||||
|
||||
#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct)
|
||||
#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
|
||||
#define FDDEFMEDIAPRM FDDEFPRM
|
||||
#define FDGETMEDIAPRM FDGETPRM
|
||||
/* set/get disk parameters */
|
||||
|
||||
|
||||
#define FDMSGON _IO(2,0x45)
|
||||
#define FDMSGOFF _IO(2,0x46)
|
||||
/* issue/don't issue kernel messages on media type change */
|
||||
|
||||
|
||||
/*
|
||||
* Formatting (obsolete)
|
||||
*/
|
||||
#define FD_FILL_BYTE 0xF6 /* format fill byte. */
|
||||
|
||||
struct format_descr {
|
||||
unsigned int device,head,track;
|
||||
};
|
||||
|
||||
#define FDFMTBEG _IO(2,0x47)
|
||||
/* begin formatting a disk */
|
||||
#define FDFMTTRK _IOW(2,0x48, struct format_descr)
|
||||
/* format the specified track */
|
||||
#define FDFMTEND _IO(2,0x49)
|
||||
/* end formatting a disk */
|
||||
|
||||
|
||||
/*
|
||||
* Error thresholds
|
||||
*/
|
||||
struct floppy_max_errors {
|
||||
unsigned int
|
||||
abort, /* number of errors to be reached before aborting */
|
||||
read_track, /* maximal number of errors permitted to read an
|
||||
* entire track at once */
|
||||
reset, /* maximal number of errors before a reset is tried */
|
||||
recal, /* maximal number of errors before a recalibrate is
|
||||
* tried */
|
||||
|
||||
/*
|
||||
* Threshold for reporting FDC errors to the console.
|
||||
* Setting this to zero may flood your screen when using
|
||||
* ultra cheap floppies ;-)
|
||||
*/
|
||||
reporting;
|
||||
|
||||
};
|
||||
|
||||
#define FDSETEMSGTRESH _IO(2,0x4a)
|
||||
/* set fdc error reporting threshold */
|
||||
|
||||
#define FDFLUSH _IO(2,0x4b)
|
||||
/* flush buffers for media; either for verifying media, or for
|
||||
* handling a media change without closing the file descriptor */
|
||||
|
||||
#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
|
||||
#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
|
||||
/* set/get abortion and read_track threshold. See also floppy_drive_params
|
||||
* structure */
|
||||
|
||||
|
||||
typedef char floppy_drive_name[16];
|
||||
#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
|
||||
/* get drive type: 5 1/4 or 3 1/2 */
|
||||
|
||||
|
||||
/*
|
||||
* Drive parameters (user modifiable)
|
||||
*/
|
||||
struct floppy_drive_params {
|
||||
signed char cmos; /* CMOS type */
|
||||
|
||||
/* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
|
||||
* etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
|
||||
*/
|
||||
unsigned long max_dtr; /* Step rate, usec */
|
||||
unsigned long hlt; /* Head load/settle time, msec */
|
||||
unsigned long hut; /* Head unload time (remnant of
|
||||
* 8" drives) */
|
||||
unsigned long srt; /* Step rate, usec */
|
||||
|
||||
unsigned long spinup; /* time needed for spinup (expressed
|
||||
* in jiffies) */
|
||||
unsigned long spindown; /* timeout needed for spindown */
|
||||
unsigned char spindown_offset; /* decides in which position the disk
|
||||
* will stop */
|
||||
unsigned char select_delay; /* delay to wait after select */
|
||||
unsigned char rps; /* rotations per second */
|
||||
unsigned char tracks; /* maximum number of tracks */
|
||||
unsigned long timeout; /* timeout for interrupt requests */
|
||||
|
||||
unsigned char interleave_sect; /* if there are more sectors, use
|
||||
* interleave */
|
||||
|
||||
struct floppy_max_errors max_errors;
|
||||
|
||||
char flags; /* various flags, including ftd_msg */
|
||||
/*
|
||||
* Announce successful media type detection and media information loss after
|
||||
* disk changes.
|
||||
* Also used to enable/disable printing of overrun warnings.
|
||||
*/
|
||||
|
||||
#define FTD_MSG 0x10
|
||||
#define FD_BROKEN_DCL 0x20
|
||||
#define FD_DEBUG 0x02
|
||||
#define FD_SILENT_DCL_CLEAR 0x4
|
||||
#define FD_INVERTED_DCL 0x80 /* must be 0x80, because of hardware
|
||||
considerations */
|
||||
|
||||
char read_track; /* use readtrack during probing? */
|
||||
|
||||
/*
|
||||
* Auto-detection. Each drive type has eight formats which are
|
||||
* used in succession to try to read the disk. If the FDC cannot lock onto
|
||||
* the disk, the next format is tried. This uses the variable 'probing'.
|
||||
*/
|
||||
short autodetect[8]; /* autodetected formats */
|
||||
|
||||
int checkfreq; /* how often should the drive be checked for disk
|
||||
* changes */
|
||||
int native_format; /* native format of this drive */
|
||||
};
|
||||
|
||||
enum {
|
||||
FD_NEED_TWADDLE_BIT, /* more magic */
|
||||
FD_VERIFY_BIT, /* inquire for write protection */
|
||||
FD_DISK_NEWCHANGE_BIT, /* change detected, and no action undertaken yet
|
||||
* to clear media change status */
|
||||
FD_UNUSED_BIT,
|
||||
FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
|
||||
FD_DISK_WRITABLE_BIT /* disk is writable */
|
||||
};
|
||||
|
||||
#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
|
||||
#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
|
||||
/* set/get drive parameters */
|
||||
|
||||
|
||||
/*
|
||||
* Current drive state (not directly modifiable by user, readonly)
|
||||
*/
|
||||
struct floppy_drive_struct {
|
||||
unsigned long flags;
|
||||
/* values for these flags */
|
||||
#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
|
||||
#define FD_VERIFY (1 << FD_VERIFY_BIT)
|
||||
#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
|
||||
#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
|
||||
#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
|
||||
|
||||
unsigned long spinup_date;
|
||||
unsigned long select_date;
|
||||
unsigned long first_read_date;
|
||||
short probed_format;
|
||||
short track; /* current track */
|
||||
short maxblock; /* id of highest block read */
|
||||
short maxtrack; /* id of highest half track read */
|
||||
int generation; /* how many diskchanges? */
|
||||
|
||||
/*
|
||||
* (User-provided) media information is _not_ discarded after a media change
|
||||
* if the corresponding keep_data flag is non-zero. Positive values are
|
||||
* decremented after each probe.
|
||||
*/
|
||||
int keep_data;
|
||||
|
||||
/* Prevent "aliased" accesses. */
|
||||
int fd_ref;
|
||||
int fd_device;
|
||||
unsigned long last_checked; /* when was the drive last checked for a disk
|
||||
* change? */
|
||||
|
||||
char *dmabuf;
|
||||
int bufblocks;
|
||||
};
|
||||
|
||||
#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
|
||||
/* get drive state: GET returns the cached state, POLL polls for new state */
|
||||
|
||||
|
||||
/*
|
||||
* reset FDC
|
||||
*/
|
||||
enum reset_mode {
|
||||
FD_RESET_IF_NEEDED, /* reset only if the reset flags is set */
|
||||
FD_RESET_IF_RAWCMD, /* obsolete */
|
||||
FD_RESET_ALWAYS /* reset always */
|
||||
};
|
||||
#define FDRESET _IO(2, 0x54)
|
||||
|
||||
|
||||
/*
|
||||
* FDC state
|
||||
*/
|
||||
struct floppy_fdc_state {
|
||||
int spec1; /* spec1 value last used */
|
||||
int spec2; /* spec2 value last used */
|
||||
int dtr;
|
||||
unsigned char version; /* FDC version code */
|
||||
unsigned char dor;
|
||||
unsigned long address; /* io address */
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version; /* version code for floppy driver */
|
||||
#define FD_DRIVER_VERSION 0x100
|
||||
/* user programs using the floppy API should use floppy_fdc_state to
|
||||
* get the version number of the floppy driver that they are running
|
||||
* on. If this version number is bigger than the one compiled into the
|
||||
* user program (the FD_DRIVER_VERSION define), it should be prepared
|
||||
* to bigger structures
|
||||
*/
|
||||
|
||||
unsigned char track[4];
|
||||
/* Position of the heads of the 4 units attached to this FDC,
|
||||
* as stored on the FDC. In the future, the position as stored
|
||||
* on the FDC might not agree with the actual physical
|
||||
* position of these drive heads. By allowing such
|
||||
* disagreement, it will be possible to reset the FDC without
|
||||
* incurring the expensive cost of repositioning all heads.
|
||||
* Right now, these positions are hard wired to 0. */
|
||||
|
||||
};
|
||||
|
||||
#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
|
||||
|
||||
|
||||
/*
|
||||
* Asynchronous Write error tracking
|
||||
*/
|
||||
struct floppy_write_errors {
|
||||
/* Write error logging.
|
||||
*
|
||||
* These fields can be cleared with the FDWERRORCLR ioctl.
|
||||
* Only writes that were attempted but failed due to a physical media
|
||||
* error are logged. write(2) calls that fail and return an error code
|
||||
* to the user process are not counted.
|
||||
*/
|
||||
|
||||
unsigned int write_errors; /* number of physical write errors
|
||||
* encountered */
|
||||
|
||||
/* position of first and last write errors */
|
||||
unsigned long first_error_sector;
|
||||
int first_error_generation;
|
||||
unsigned long last_error_sector;
|
||||
int last_error_generation;
|
||||
|
||||
unsigned int badness; /* highest retry count for a read or write
|
||||
* operation */
|
||||
};
|
||||
|
||||
#define FDWERRORCLR _IO(2, 0x56)
|
||||
/* clear write error and badness information */
|
||||
#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
|
||||
/* get write error and badness information */
|
||||
|
||||
|
||||
/*
|
||||
* Raw commands
|
||||
*/
|
||||
/* new interface flag: now we can do them in batches */
|
||||
#define FDHAVEBATCHEDRAWCMD
|
||||
|
||||
struct floppy_raw_cmd {
|
||||
unsigned int flags;
|
||||
#define FD_RAW_READ 1
|
||||
#define FD_RAW_WRITE 2
|
||||
#define FD_RAW_NO_MOTOR 4
|
||||
#define FD_RAW_DISK_CHANGE 4 /* out: disk change flag was set */
|
||||
#define FD_RAW_INTR 8 /* wait for an interrupt */
|
||||
#define FD_RAW_SPIN 0x10 /* spin up the disk for this command */
|
||||
#define FD_RAW_NO_MOTOR_AFTER 0x20 /* switch the motor off after command
|
||||
* completion */
|
||||
#define FD_RAW_NEED_DISK 0x40 /* this command needs a disk to be present */
|
||||
#define FD_RAW_NEED_SEEK 0x80 /* this command uses an implied seek (soft) */
|
||||
|
||||
/* more "in" flags */
|
||||
#define FD_RAW_MORE 0x100 /* more records follow */
|
||||
#define FD_RAW_STOP_IF_FAILURE 0x200 /* stop if we encounter a failure */
|
||||
#define FD_RAW_STOP_IF_SUCCESS 0x400 /* stop if command successful */
|
||||
#define FD_RAW_SOFTFAILURE 0x800 /* consider the return value for failure
|
||||
* detection too */
|
||||
|
||||
/* more "out" flags */
|
||||
#define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
|
||||
#define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
|
||||
|
||||
void __user *data;
|
||||
char *kernel_data; /* location of data buffer in the kernel */
|
||||
struct floppy_raw_cmd *next; /* used for chaining of raw cmd's
|
||||
* within the kernel */
|
||||
long length; /* in: length of dma transfer. out: remaining bytes */
|
||||
long phys_length; /* physical length, if different from dma length */
|
||||
int buffer_length; /* length of allocated buffer */
|
||||
|
||||
unsigned char rate;
|
||||
unsigned char cmd_count;
|
||||
unsigned char cmd[16];
|
||||
unsigned char reply_count;
|
||||
unsigned char reply[16];
|
||||
int track;
|
||||
int resultcode;
|
||||
|
||||
int reserved1;
|
||||
int reserved2;
|
||||
};
|
||||
|
||||
#define FDRAWCMD _IO(2, 0x58)
|
||||
/* send a raw command to the fdc. Structure size not included, because of
|
||||
* batches */
|
||||
|
||||
#define FDTWADDLE _IO(2, 0x59)
|
||||
/* flicker motor-on bit before reading a sector. Experimental */
|
||||
|
||||
|
||||
#define FDEJECT _IO(2, 0x5a)
|
||||
/* eject the disk */
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_COMPAT
|
||||
#include <linux/compat.h>
|
||||
|
||||
|
@ -398,5 +22,3 @@ struct compat_floppy_struct {
|
|||
#define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,141 +1,12 @@
|
|||
/*
|
||||
* Linux Socket Filter Data Structures
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_FILTER_H__
|
||||
#define __LINUX_FILTER_H__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/compat.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Current version of the filter code architecture.
|
||||
*/
|
||||
#define BPF_MAJOR_VERSION 1
|
||||
#define BPF_MINOR_VERSION 1
|
||||
|
||||
/*
|
||||
* Try and keep these values and structures similar to BSD, especially
|
||||
* the BPF code definitions which need to match so you can share filters
|
||||
*/
|
||||
|
||||
struct sock_filter { /* Filter block */
|
||||
__u16 code; /* Actual filter code */
|
||||
__u8 jt; /* Jump true */
|
||||
__u8 jf; /* Jump false */
|
||||
__u32 k; /* Generic multiuse field */
|
||||
};
|
||||
|
||||
struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
|
||||
unsigned short len; /* Number of filter blocks */
|
||||
struct sock_filter __user *filter;
|
||||
};
|
||||
|
||||
/*
|
||||
* Instruction classes
|
||||
*/
|
||||
|
||||
#define BPF_CLASS(code) ((code) & 0x07)
|
||||
#define BPF_LD 0x00
|
||||
#define BPF_LDX 0x01
|
||||
#define BPF_ST 0x02
|
||||
#define BPF_STX 0x03
|
||||
#define BPF_ALU 0x04
|
||||
#define BPF_JMP 0x05
|
||||
#define BPF_RET 0x06
|
||||
#define BPF_MISC 0x07
|
||||
|
||||
/* ld/ldx fields */
|
||||
#define BPF_SIZE(code) ((code) & 0x18)
|
||||
#define BPF_W 0x00
|
||||
#define BPF_H 0x08
|
||||
#define BPF_B 0x10
|
||||
#define BPF_MODE(code) ((code) & 0xe0)
|
||||
#define BPF_IMM 0x00
|
||||
#define BPF_ABS 0x20
|
||||
#define BPF_IND 0x40
|
||||
#define BPF_MEM 0x60
|
||||
#define BPF_LEN 0x80
|
||||
#define BPF_MSH 0xa0
|
||||
|
||||
/* alu/jmp fields */
|
||||
#define BPF_OP(code) ((code) & 0xf0)
|
||||
#define BPF_ADD 0x00
|
||||
#define BPF_SUB 0x10
|
||||
#define BPF_MUL 0x20
|
||||
#define BPF_DIV 0x30
|
||||
#define BPF_OR 0x40
|
||||
#define BPF_AND 0x50
|
||||
#define BPF_LSH 0x60
|
||||
#define BPF_RSH 0x70
|
||||
#define BPF_NEG 0x80
|
||||
#define BPF_MOD 0x90
|
||||
#define BPF_XOR 0xa0
|
||||
|
||||
#define BPF_JA 0x00
|
||||
#define BPF_JEQ 0x10
|
||||
#define BPF_JGT 0x20
|
||||
#define BPF_JGE 0x30
|
||||
#define BPF_JSET 0x40
|
||||
#define BPF_SRC(code) ((code) & 0x08)
|
||||
#define BPF_K 0x00
|
||||
#define BPF_X 0x08
|
||||
|
||||
/* ret - BPF_K and BPF_X also apply */
|
||||
#define BPF_RVAL(code) ((code) & 0x18)
|
||||
#define BPF_A 0x10
|
||||
|
||||
/* misc */
|
||||
#define BPF_MISCOP(code) ((code) & 0xf8)
|
||||
#define BPF_TAX 0x00
|
||||
#define BPF_TXA 0x80
|
||||
|
||||
#ifndef BPF_MAXINSNS
|
||||
#define BPF_MAXINSNS 4096
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for filter block array initializers.
|
||||
*/
|
||||
#ifndef BPF_STMT
|
||||
#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
|
||||
#endif
|
||||
#ifndef BPF_JUMP
|
||||
#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Number of scratch memory words for: BPF_ST and BPF_STX
|
||||
*/
|
||||
#define BPF_MEMWORDS 16
|
||||
|
||||
/* RATIONALE. Negative offsets are invalid in BPF.
|
||||
We use them to reference ancillary data.
|
||||
Unlike introduction new instructions, it does not break
|
||||
existing compilers/optimizers.
|
||||
*/
|
||||
#define SKF_AD_OFF (-0x1000)
|
||||
#define SKF_AD_PROTOCOL 0
|
||||
#define SKF_AD_PKTTYPE 4
|
||||
#define SKF_AD_IFINDEX 8
|
||||
#define SKF_AD_NLATTR 12
|
||||
#define SKF_AD_NLATTR_NEST 16
|
||||
#define SKF_AD_MARK 20
|
||||
#define SKF_AD_QUEUE 24
|
||||
#define SKF_AD_HATYPE 28
|
||||
#define SKF_AD_RXHASH 32
|
||||
#define SKF_AD_CPU 36
|
||||
#define SKF_AD_ALU_XOR_X 40
|
||||
#define SKF_AD_MAX 44
|
||||
#define SKF_NET_OFF (-0x100000)
|
||||
#define SKF_LL_OFF (-0x200000)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <uapi/linux/filter.h>
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
/*
|
||||
|
@ -254,6 +125,4 @@ enum {
|
|||
BPF_S_ANC_SECCOMP_LD_W,
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __LINUX_FILTER_H__ */
|
||||
|
|
|
@ -6,58 +6,12 @@
|
|||
* This file provides the definitions and structures needed to
|
||||
* support uClinux flat-format executables.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FLAT_H
|
||||
#define _LINUX_FLAT_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/flat.h>
|
||||
#endif
|
||||
#include <uapi/linux/flat.h>
|
||||
|
||||
#define FLAT_VERSION 0x00000004L
|
||||
|
||||
#ifdef CONFIG_BINFMT_SHARED_FLAT
|
||||
#define MAX_SHARED_LIBS (4)
|
||||
#else
|
||||
#define MAX_SHARED_LIBS (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* To make everything easier to port and manage cross platform
|
||||
* development, all fields are in network byte order.
|
||||
*/
|
||||
|
||||
struct flat_hdr {
|
||||
char magic[4];
|
||||
unsigned long rev; /* version (as above) */
|
||||
unsigned long entry; /* Offset of first executable instruction
|
||||
with text segment from beginning of file */
|
||||
unsigned long data_start; /* Offset of data segment from beginning of
|
||||
file */
|
||||
unsigned long data_end; /* Offset of end of data segment
|
||||
from beginning of file */
|
||||
unsigned long bss_end; /* Offset of end of bss segment from beginning
|
||||
of file */
|
||||
|
||||
/* (It is assumed that data_end through bss_end forms the bss segment.) */
|
||||
|
||||
unsigned long stack_size; /* Size of stack, in bytes */
|
||||
unsigned long reloc_start; /* Offset of relocation records from
|
||||
beginning of file */
|
||||
unsigned long reloc_count; /* Number of relocation records */
|
||||
unsigned long flags;
|
||||
unsigned long build_date; /* When the program/library was built */
|
||||
unsigned long filler[5]; /* Reservered, set to zero */
|
||||
};
|
||||
|
||||
#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
|
||||
#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
|
||||
#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
|
||||
#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
|
||||
#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
|
||||
|
||||
|
||||
#ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
|
||||
/*
|
||||
* While it would be nice to keep this header clean, users of older
|
||||
* tools still need this support in the kernel. So this section is
|
||||
|
@ -95,6 +49,4 @@ typedef union {
|
|||
} reloc;
|
||||
} flat_v2_reloc_t;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_FLAT_H */
|
||||
|
|
|
@ -1,337 +1,6 @@
|
|||
#ifndef _LINUX_FS_H
|
||||
#define _LINUX_FS_H
|
||||
|
||||
/*
|
||||
* This file has definitions for some important file table
|
||||
* structures etc.
|
||||
*/
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
|
||||
* the file limit at runtime and only root can increase the per-process
|
||||
* nr_file rlimit, so it's safe to set up a ridiculously high absolute
|
||||
* upper limit on files-per-process.
|
||||
*
|
||||
* Some programs (notably those using select()) may have to be
|
||||
* recompiled to take full advantage of the new limits..
|
||||
*/
|
||||
|
||||
/* Fixed constants first: */
|
||||
#undef NR_OPEN
|
||||
#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */
|
||||
#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
|
||||
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
|
||||
|
||||
#define SEEK_SET 0 /* seek relative to beginning of file */
|
||||
#define SEEK_CUR 1 /* seek relative to current file position */
|
||||
#define SEEK_END 2 /* seek relative to end of file */
|
||||
#define SEEK_DATA 3 /* seek to the next data */
|
||||
#define SEEK_HOLE 4 /* seek to the next hole */
|
||||
#define SEEK_MAX SEEK_HOLE
|
||||
|
||||
struct fstrim_range {
|
||||
__u64 start;
|
||||
__u64 len;
|
||||
__u64 minlen;
|
||||
};
|
||||
|
||||
/* And dynamically-tunable limits and defaults: */
|
||||
struct files_stat_struct {
|
||||
unsigned long nr_files; /* read only */
|
||||
unsigned long nr_free_files; /* read only */
|
||||
unsigned long max_files; /* tunable */
|
||||
};
|
||||
|
||||
struct inodes_stat_t {
|
||||
int nr_inodes;
|
||||
int nr_unused;
|
||||
int dummy[5]; /* padding for sysctl ABI compatibility */
|
||||
};
|
||||
|
||||
|
||||
#define NR_FILE 8192 /* this can well be larger on a larger system */
|
||||
|
||||
#define MAY_EXEC 0x00000001
|
||||
#define MAY_WRITE 0x00000002
|
||||
#define MAY_READ 0x00000004
|
||||
#define MAY_APPEND 0x00000008
|
||||
#define MAY_ACCESS 0x00000010
|
||||
#define MAY_OPEN 0x00000020
|
||||
#define MAY_CHDIR 0x00000040
|
||||
/* called from RCU mode, don't block */
|
||||
#define MAY_NOT_BLOCK 0x00000080
|
||||
|
||||
/*
|
||||
* flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
|
||||
* to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
|
||||
*/
|
||||
|
||||
/* file is open for reading */
|
||||
#define FMODE_READ ((__force fmode_t)0x1)
|
||||
/* file is open for writing */
|
||||
#define FMODE_WRITE ((__force fmode_t)0x2)
|
||||
/* file is seekable */
|
||||
#define FMODE_LSEEK ((__force fmode_t)0x4)
|
||||
/* file can be accessed using pread */
|
||||
#define FMODE_PREAD ((__force fmode_t)0x8)
|
||||
/* file can be accessed using pwrite */
|
||||
#define FMODE_PWRITE ((__force fmode_t)0x10)
|
||||
/* File is opened for execution with sys_execve / sys_uselib */
|
||||
#define FMODE_EXEC ((__force fmode_t)0x20)
|
||||
/* File is opened with O_NDELAY (only set for block devices) */
|
||||
#define FMODE_NDELAY ((__force fmode_t)0x40)
|
||||
/* File is opened with O_EXCL (only set for block devices) */
|
||||
#define FMODE_EXCL ((__force fmode_t)0x80)
|
||||
/* File is opened using open(.., 3, ..) and is writeable only for ioctls
|
||||
(specialy hack for floppy.c) */
|
||||
#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
|
||||
/* 32bit hashes as llseek() offset (for directories) */
|
||||
#define FMODE_32BITHASH ((__force fmode_t)0x200)
|
||||
/* 64bit hashes as llseek() offset (for directories) */
|
||||
#define FMODE_64BITHASH ((__force fmode_t)0x400)
|
||||
|
||||
/*
|
||||
* Don't update ctime and mtime.
|
||||
*
|
||||
* Currently a special hack for the XFS open_by_handle ioctl, but we'll
|
||||
* hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
|
||||
*/
|
||||
#define FMODE_NOCMTIME ((__force fmode_t)0x800)
|
||||
|
||||
/* Expect random access pattern */
|
||||
#define FMODE_RANDOM ((__force fmode_t)0x1000)
|
||||
|
||||
/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
|
||||
#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
|
||||
|
||||
/* File is opened with O_PATH; almost nothing can be done with it */
|
||||
#define FMODE_PATH ((__force fmode_t)0x4000)
|
||||
|
||||
/* File was opened by fanotify and shouldn't generate fanotify events */
|
||||
#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
|
||||
|
||||
/*
|
||||
* Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
|
||||
* that indicates that they should check the contents of the iovec are
|
||||
* valid, but not check the memory that the iovec elements
|
||||
* points too.
|
||||
*/
|
||||
#define CHECK_IOVEC_ONLY -1
|
||||
|
||||
#define SEL_IN 1
|
||||
#define SEL_OUT 2
|
||||
#define SEL_EX 4
|
||||
|
||||
/* public flags for file_system_type */
|
||||
#define FS_REQUIRES_DEV 1
|
||||
#define FS_BINARY_MOUNTDATA 2
|
||||
#define FS_HAS_SUBTYPE 4
|
||||
#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
|
||||
#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
|
||||
* during rename() internally.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These are the fs-independent mount-flags: up to 32 flags are supported
|
||||
*/
|
||||
#define MS_RDONLY 1 /* Mount read-only */
|
||||
#define MS_NOSUID 2 /* Ignore suid and sgid bits */
|
||||
#define MS_NODEV 4 /* Disallow access to device special files */
|
||||
#define MS_NOEXEC 8 /* Disallow program execution */
|
||||
#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
|
||||
#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
|
||||
#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
|
||||
#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
|
||||
#define MS_NOATIME 1024 /* Do not update access times. */
|
||||
#define MS_NODIRATIME 2048 /* Do not update directory access times */
|
||||
#define MS_BIND 4096
|
||||
#define MS_MOVE 8192
|
||||
#define MS_REC 16384
|
||||
#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence.
|
||||
MS_VERBOSE is deprecated. */
|
||||
#define MS_SILENT 32768
|
||||
#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
|
||||
#define MS_UNBINDABLE (1<<17) /* change to unbindable */
|
||||
#define MS_PRIVATE (1<<18) /* change to private */
|
||||
#define MS_SLAVE (1<<19) /* change to slave */
|
||||
#define MS_SHARED (1<<20) /* change to shared */
|
||||
#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
|
||||
#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
|
||||
#define MS_I_VERSION (1<<23) /* Update inode I_version field */
|
||||
#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
|
||||
#define MS_NOSEC (1<<28)
|
||||
#define MS_BORN (1<<29)
|
||||
#define MS_ACTIVE (1<<30)
|
||||
#define MS_NOUSER (1<<31)
|
||||
|
||||
/*
|
||||
* Superblock flags that can be altered by MS_REMOUNT
|
||||
*/
|
||||
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
|
||||
|
||||
/*
|
||||
* Old magic mount flag and mask
|
||||
*/
|
||||
#define MS_MGC_VAL 0xC0ED0000
|
||||
#define MS_MGC_MSK 0xffff0000
|
||||
|
||||
/* Inode flags - they have nothing to superblock flags now */
|
||||
|
||||
#define S_SYNC 1 /* Writes are synced at once */
|
||||
#define S_NOATIME 2 /* Do not update access times */
|
||||
#define S_APPEND 4 /* Append-only file */
|
||||
#define S_IMMUTABLE 8 /* Immutable file */
|
||||
#define S_DEAD 16 /* removed, but still open directory */
|
||||
#define S_NOQUOTA 32 /* Inode is not counted to quota */
|
||||
#define S_DIRSYNC 64 /* Directory modifications are synchronous */
|
||||
#define S_NOCMTIME 128 /* Do not update file c/mtime */
|
||||
#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
|
||||
#define S_PRIVATE 512 /* Inode is fs-internal */
|
||||
#define S_IMA 1024 /* Inode has an associated IMA struct */
|
||||
#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */
|
||||
#define S_NOSEC 4096 /* no suid or xattr security attributes */
|
||||
|
||||
/*
|
||||
* Note that nosuid etc flags are inode-specific: setting some file-system
|
||||
* flags just means all the inodes inherit those flags by default. It might be
|
||||
* possible to override it selectively if you really wanted to with some
|
||||
* ioctl() that is not currently implemented.
|
||||
*
|
||||
* Exception: MS_RDONLY is always applied to the entire file system.
|
||||
*
|
||||
* Unfortunately, it is possible to change a filesystems flags with it mounted
|
||||
* with files in use. This means that all of the inodes will not have their
|
||||
* i_flags updated. Hence, i_flags no longer inherit the superblock mount
|
||||
* flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
|
||||
*/
|
||||
#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
|
||||
|
||||
#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
|
||||
#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
|
||||
((inode)->i_flags & S_SYNC))
|
||||
#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
|
||||
((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
|
||||
#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
|
||||
#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
|
||||
#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION)
|
||||
|
||||
#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
|
||||
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
|
||||
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
|
||||
#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
|
||||
|
||||
#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
|
||||
#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
|
||||
#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
|
||||
#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
|
||||
#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
|
||||
#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)
|
||||
#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
|
||||
|
||||
/* the read-only stuff doesn't really belong here, but any other place is
|
||||
probably as bad and I don't want to create yet another include file. */
|
||||
|
||||
#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
|
||||
#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
|
||||
#define BLKRRPART _IO(0x12,95) /* re-read partition table */
|
||||
#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
|
||||
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
|
||||
#define BLKRASET _IO(0x12,98) /* set read ahead for block device */
|
||||
#define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
|
||||
#define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
|
||||
#define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
|
||||
#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
|
||||
#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
|
||||
#define BLKSSZGET _IO(0x12,104)/* get block device sector size */
|
||||
#if 0
|
||||
#define BLKPG _IO(0x12,105)/* See blkpg.h */
|
||||
|
||||
/* Some people are morons. Do not use sizeof! */
|
||||
|
||||
#define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */
|
||||
#define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */
|
||||
/* This was here just to show that the number is taken -
|
||||
probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
|
||||
#endif
|
||||
/* A jump here: 108-111 have been used for various private purposes. */
|
||||
#define BLKBSZGET _IOR(0x12,112,size_t)
|
||||
#define BLKBSZSET _IOW(0x12,113,size_t)
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
|
||||
#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
|
||||
#define BLKTRACESTART _IO(0x12,116)
|
||||
#define BLKTRACESTOP _IO(0x12,117)
|
||||
#define BLKTRACETEARDOWN _IO(0x12,118)
|
||||
#define BLKDISCARD _IO(0x12,119)
|
||||
#define BLKIOMIN _IO(0x12,120)
|
||||
#define BLKIOOPT _IO(0x12,121)
|
||||
#define BLKALIGNOFF _IO(0x12,122)
|
||||
#define BLKPBSZGET _IO(0x12,123)
|
||||
#define BLKDISCARDZEROES _IO(0x12,124)
|
||||
#define BLKSECDISCARD _IO(0x12,125)
|
||||
#define BLKROTATIONAL _IO(0x12,126)
|
||||
#define BLKZEROOUT _IO(0x12,127)
|
||||
|
||||
#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
|
||||
#define FIBMAP _IO(0x00,1) /* bmap access */
|
||||
#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
|
||||
#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
|
||||
#define FITHAW _IOWR('X', 120, int) /* Thaw */
|
||||
#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
|
||||
|
||||
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define FS_IOC_GETVERSION _IOR('v', 1, long)
|
||||
#define FS_IOC_SETVERSION _IOW('v', 2, long)
|
||||
#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
|
||||
#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
|
||||
#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
|
||||
#define FS_IOC32_GETVERSION _IOR('v', 1, int)
|
||||
#define FS_IOC32_SETVERSION _IOW('v', 2, int)
|
||||
|
||||
/*
|
||||
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
|
||||
*/
|
||||
#define FS_SECRM_FL 0x00000001 /* Secure deletion */
|
||||
#define FS_UNRM_FL 0x00000002 /* Undelete */
|
||||
#define FS_COMPR_FL 0x00000004 /* Compress file */
|
||||
#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
|
||||
#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
|
||||
#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
|
||||
#define FS_NODUMP_FL 0x00000040 /* do not dump file */
|
||||
#define FS_NOATIME_FL 0x00000080 /* do not update atime */
|
||||
/* Reserved for compression usage... */
|
||||
#define FS_DIRTY_FL 0x00000100
|
||||
#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
|
||||
#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
|
||||
#define FS_ECOMPR_FL 0x00000800 /* Compression error */
|
||||
/* End compression flags --- maybe not all used */
|
||||
#define FS_BTREE_FL 0x00001000 /* btree format dir */
|
||||
#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
|
||||
#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
|
||||
#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
|
||||
#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
|
||||
#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
|
||||
#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
|
||||
#define FS_EXTENT_FL 0x00080000 /* Extents */
|
||||
#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */
|
||||
#define FS_NOCOW_FL 0x00800000 /* Do not cow file */
|
||||
#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
|
||||
|
||||
#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
|
||||
#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
|
||||
|
||||
|
||||
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||
#define SYNC_FILE_RANGE_WRITE 2
|
||||
#define SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/wait.h>
|
||||
|
@ -360,6 +29,7 @@ struct inodes_stat_t {
|
|||
#include <linux/blk_types.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <uapi/linux/fs.h>
|
||||
|
||||
struct export_operations;
|
||||
struct hd_geometry;
|
||||
|
@ -2876,5 +2546,4 @@ static inline void inode_has_no_xattr(struct inode *inode)
|
|||
inode->i_flags |= S_NOSEC;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_FS_H */
|
||||
|
|
|
@ -36,187 +36,11 @@
|
|||
* also be included by applications that need to communicate with the driver
|
||||
* via the ioctl interface.
|
||||
*/
|
||||
|
||||
#ifndef FSL_HYPERVISOR_H
|
||||
#define FSL_HYPERVISOR_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/fsl_hypervisor.h>
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_restart - restart a partition
|
||||
* @ret: return error code from the hypervisor
|
||||
* @partition: the ID of the partition to restart, or -1 for the
|
||||
* calling partition
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_PARTITION_RESTART
|
||||
*/
|
||||
struct fsl_hv_ioctl_restart {
|
||||
__u32 ret;
|
||||
__u32 partition;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_status - get a partition's status
|
||||
* @ret: return error code from the hypervisor
|
||||
* @partition: the ID of the partition to query, or -1 for the
|
||||
* calling partition
|
||||
* @status: The returned status of the partition
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
|
||||
*
|
||||
* Values of 'status':
|
||||
* 0 = Stopped
|
||||
* 1 = Running
|
||||
* 2 = Starting
|
||||
* 3 = Stopping
|
||||
*/
|
||||
struct fsl_hv_ioctl_status {
|
||||
__u32 ret;
|
||||
__u32 partition;
|
||||
__u32 status;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_start - start a partition
|
||||
* @ret: return error code from the hypervisor
|
||||
* @partition: the ID of the partition to control
|
||||
* @entry_point: The offset within the guest IMA to start execution
|
||||
* @load: If non-zero, reload the partition's images before starting
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_PARTITION_START
|
||||
*/
|
||||
struct fsl_hv_ioctl_start {
|
||||
__u32 ret;
|
||||
__u32 partition;
|
||||
__u32 entry_point;
|
||||
__u32 load;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_stop - stop a partition
|
||||
* @ret: return error code from the hypervisor
|
||||
* @partition: the ID of the partition to stop, or -1 for the calling
|
||||
* partition
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_PARTITION_STOP
|
||||
*/
|
||||
struct fsl_hv_ioctl_stop {
|
||||
__u32 ret;
|
||||
__u32 partition;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_memcpy - copy memory between partitions
|
||||
* @ret: return error code from the hypervisor
|
||||
* @source: the partition ID of the source partition, or -1 for this
|
||||
* partition
|
||||
* @target: the partition ID of the target partition, or -1 for this
|
||||
* partition
|
||||
* @reserved: reserved, must be set to 0
|
||||
* @local_addr: user-space virtual address of a buffer in the local
|
||||
* partition
|
||||
* @remote_addr: guest physical address of a buffer in the
|
||||
* remote partition
|
||||
* @count: the number of bytes to copy. Both the local and remote
|
||||
* buffers must be at least 'count' bytes long
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_MEMCPY
|
||||
*
|
||||
* The 'local' partition is the partition that calls this ioctl. The
|
||||
* 'remote' partition is a different partition. The data is copied from
|
||||
* the 'source' paritition' to the 'target' partition.
|
||||
*
|
||||
* The buffer in the remote partition must be guest physically
|
||||
* contiguous.
|
||||
*
|
||||
* This ioctl does not support copying memory between two remote
|
||||
* partitions or within the same partition, so either 'source' or
|
||||
* 'target' (but not both) must be -1. In other words, either
|
||||
*
|
||||
* source == local and target == remote
|
||||
* or
|
||||
* source == remote and target == local
|
||||
*/
|
||||
struct fsl_hv_ioctl_memcpy {
|
||||
__u32 ret;
|
||||
__u32 source;
|
||||
__u32 target;
|
||||
__u32 reserved; /* padding to ensure local_vaddr is aligned */
|
||||
__u64 local_vaddr;
|
||||
__u64 remote_paddr;
|
||||
__u64 count;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_doorbell - ring a doorbell
|
||||
* @ret: return error code from the hypervisor
|
||||
* @doorbell: the handle of the doorbell to ring doorbell
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_DOORBELL
|
||||
*/
|
||||
struct fsl_hv_ioctl_doorbell {
|
||||
__u32 ret;
|
||||
__u32 doorbell;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct fsl_hv_ioctl_prop - get/set a device tree property
|
||||
* @ret: return error code from the hypervisor
|
||||
* @handle: handle of partition whose tree to access
|
||||
* @path: virtual address of path name of node to access
|
||||
* @propname: virtual address of name of property to access
|
||||
* @propval: virtual address of property data buffer
|
||||
* @proplen: Size of property data buffer
|
||||
* @reserved: reserved, must be set to 0
|
||||
*
|
||||
* Used by FSL_HV_IOCTL_DOORBELL
|
||||
*/
|
||||
struct fsl_hv_ioctl_prop {
|
||||
__u32 ret;
|
||||
__u32 handle;
|
||||
__u64 path;
|
||||
__u64 propname;
|
||||
__u64 propval;
|
||||
__u32 proplen;
|
||||
__u32 reserved; /* padding to ensure structure is aligned */
|
||||
};
|
||||
|
||||
/* The ioctl type, documented in ioctl-number.txt */
|
||||
#define FSL_HV_IOCTL_TYPE 0xAF
|
||||
|
||||
/* Restart another partition */
|
||||
#define FSL_HV_IOCTL_PARTITION_RESTART \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
|
||||
|
||||
/* Get a partition's status */
|
||||
#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
|
||||
|
||||
/* Boot another partition */
|
||||
#define FSL_HV_IOCTL_PARTITION_START \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
|
||||
|
||||
/* Stop this or another partition */
|
||||
#define FSL_HV_IOCTL_PARTITION_STOP \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
|
||||
|
||||
/* Copy data from one partition to another */
|
||||
#define FSL_HV_IOCTL_MEMCPY \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
|
||||
|
||||
/* Ring a doorbell */
|
||||
#define FSL_HV_IOCTL_DOORBELL \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
|
||||
|
||||
/* Get a property from another guest's device tree */
|
||||
#define FSL_HV_IOCTL_GETPROP \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
|
||||
|
||||
/* Set a property in another guest's device tree */
|
||||
#define FSL_HV_IOCTL_SETPROP \
|
||||
_IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/**
|
||||
* fsl_hv_event_register() - register a callback for failover events
|
||||
|
@ -237,5 +61,3 @@ int fsl_hv_failover_register(struct notifier_block *nb);
|
|||
int fsl_hv_failover_unregister(struct notifier_block *nb);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,129 +1,8 @@
|
|||
#ifndef _LINUX_FUTEX_H
|
||||
#define _LINUX_FUTEX_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/futex.h>
|
||||
|
||||
/* Second argument to futex syscall */
|
||||
|
||||
|
||||
#define FUTEX_WAIT 0
|
||||
#define FUTEX_WAKE 1
|
||||
#define FUTEX_FD 2
|
||||
#define FUTEX_REQUEUE 3
|
||||
#define FUTEX_CMP_REQUEUE 4
|
||||
#define FUTEX_WAKE_OP 5
|
||||
#define FUTEX_LOCK_PI 6
|
||||
#define FUTEX_UNLOCK_PI 7
|
||||
#define FUTEX_TRYLOCK_PI 8
|
||||
#define FUTEX_WAIT_BITSET 9
|
||||
#define FUTEX_WAKE_BITSET 10
|
||||
#define FUTEX_WAIT_REQUEUE_PI 11
|
||||
#define FUTEX_CMP_REQUEUE_PI 12
|
||||
|
||||
#define FUTEX_PRIVATE_FLAG 128
|
||||
#define FUTEX_CLOCK_REALTIME 256
|
||||
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
|
||||
|
||||
#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
|
||||
FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
|
||||
FUTEX_PRIVATE_FLAG)
|
||||
|
||||
/*
|
||||
* Support for robust futexes: the kernel cleans up held futexes at
|
||||
* thread exit time.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Per-lock list entry - embedded in user-space locks, somewhere close
|
||||
* to the futex field. (Note: user-space uses a double-linked list to
|
||||
* achieve O(1) list add and remove, but the kernel only needs to know
|
||||
* about the forward link)
|
||||
*
|
||||
* NOTE: this structure is part of the syscall ABI, and must not be
|
||||
* changed.
|
||||
*/
|
||||
struct robust_list {
|
||||
struct robust_list __user *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Per-thread list head:
|
||||
*
|
||||
* NOTE: this structure is part of the syscall ABI, and must only be
|
||||
* changed if the change is first communicated with the glibc folks.
|
||||
* (When an incompatible change is done, we'll increase the structure
|
||||
* size, which glibc will detect)
|
||||
*/
|
||||
struct robust_list_head {
|
||||
/*
|
||||
* The head of the list. Points back to itself if empty:
|
||||
*/
|
||||
struct robust_list list;
|
||||
|
||||
/*
|
||||
* This relative offset is set by user-space, it gives the kernel
|
||||
* the relative position of the futex field to examine. This way
|
||||
* we keep userspace flexible, to freely shape its data-structure,
|
||||
* without hardcoding any particular offset into the kernel:
|
||||
*/
|
||||
long futex_offset;
|
||||
|
||||
/*
|
||||
* The death of the thread may race with userspace setting
|
||||
* up a lock's links. So to handle this race, userspace first
|
||||
* sets this field to the address of the to-be-taken lock,
|
||||
* then does the lock acquire, and then adds itself to the
|
||||
* list, and then clears this field. Hence the kernel will
|
||||
* always have full knowledge of all locks that the thread
|
||||
* _might_ have taken. We check the owner TID in any case,
|
||||
* so only truly owned locks will be handled.
|
||||
*/
|
||||
struct robust_list __user *list_op_pending;
|
||||
};
|
||||
|
||||
/*
|
||||
* Are there any waiters for this robust futex:
|
||||
*/
|
||||
#define FUTEX_WAITERS 0x80000000
|
||||
|
||||
/*
|
||||
* The kernel signals via this bit that a thread holding a futex
|
||||
* has exited without unlocking the futex. The kernel also does
|
||||
* a FUTEX_WAKE on such futexes, after setting the bit, to wake
|
||||
* up any possible waiters:
|
||||
*/
|
||||
#define FUTEX_OWNER_DIED 0x40000000
|
||||
|
||||
/*
|
||||
* The rest of the robust-futex field is for the TID:
|
||||
*/
|
||||
#define FUTEX_TID_MASK 0x3fffffff
|
||||
|
||||
/*
|
||||
* This limit protects against a deliberately circular list.
|
||||
* (Not worth introducing an rlimit for it)
|
||||
*/
|
||||
#define ROBUST_LIST_LIMIT 2048
|
||||
|
||||
/*
|
||||
* bitset with all bits set for the FUTEX_xxx_BITSET OPs to request a
|
||||
* match of any bit.
|
||||
*/
|
||||
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct inode;
|
||||
struct mm_struct;
|
||||
struct task_struct;
|
||||
|
@ -185,31 +64,4 @@ static inline void exit_pi_state_list(struct task_struct *curr)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
|
||||
#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
|
||||
#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
|
||||
#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
|
||||
#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
|
||||
|
||||
#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
|
||||
|
||||
#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
|
||||
#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
|
||||
#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
|
||||
#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
|
||||
#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
|
||||
#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
|
||||
|
||||
/* FUTEX_WAKE_OP will perform atomically
|
||||
int oldval = *(int *)UADDR2;
|
||||
*(int *)UADDR2 = oldval OP OPARG;
|
||||
if (oldval CMP CMPARG)
|
||||
wake UADDR2; */
|
||||
|
||||
#define FUTEX_OP(op, oparg, cmp, cmparg) \
|
||||
(((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
|
||||
| ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#ifndef _GAMEPORT_H
|
||||
#define _GAMEPORT_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999-2002 Vojtech Pavlik
|
||||
*
|
||||
|
@ -8,8 +5,9 @@
|
|||
* under the terms of the GNU General Public License version 2 as published by
|
||||
* the Free Software Foundation.
|
||||
*/
|
||||
#ifndef _GAMEPORT_H
|
||||
#define _GAMEPORT_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
@ -17,6 +15,7 @@
|
|||
#include <linux/device.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/slab.h>
|
||||
#include <uapi/linux/gameport.h>
|
||||
|
||||
struct gameport {
|
||||
|
||||
|
@ -166,24 +165,6 @@ void gameport_unregister_driver(struct gameport_driver *drv);
|
|||
module_driver(__gameport_driver, gameport_register_driver, \
|
||||
gameport_unregister_driver)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#define GAMEPORT_MODE_DISABLED 0
|
||||
#define GAMEPORT_MODE_RAW 1
|
||||
#define GAMEPORT_MODE_COOKED 2
|
||||
|
||||
#define GAMEPORT_ID_VENDOR_ANALOG 0x0001
|
||||
#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002
|
||||
#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003
|
||||
#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004
|
||||
#define GAMEPORT_ID_VENDOR_GENIUS 0x0005
|
||||
#define GAMEPORT_ID_VENDOR_INTERACT 0x0006
|
||||
#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007
|
||||
#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008
|
||||
#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
|
||||
#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
static inline void gameport_trigger(struct gameport *gameport)
|
||||
{
|
||||
|
@ -235,5 +216,4 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne
|
|||
void gameport_start_polling(struct gameport *gameport);
|
||||
void gameport_stop_polling(struct gameport *gameport);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
|
|
@ -1,86 +1,8 @@
|
|||
#ifndef __LINUX_GENERIC_NETLINK_H
|
||||
#define __LINUX_GENERIC_NETLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <uapi/linux/genetlink.h>
|
||||
|
||||
#define GENL_NAMSIZ 16 /* length of family name */
|
||||
|
||||
#define GENL_MIN_ID NLMSG_MIN_TYPE
|
||||
#define GENL_MAX_ID 1023
|
||||
|
||||
struct genlmsghdr {
|
||||
__u8 cmd;
|
||||
__u8 version;
|
||||
__u16 reserved;
|
||||
};
|
||||
|
||||
#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
|
||||
|
||||
#define GENL_ADMIN_PERM 0x01
|
||||
#define GENL_CMD_CAP_DO 0x02
|
||||
#define GENL_CMD_CAP_DUMP 0x04
|
||||
#define GENL_CMD_CAP_HASPOL 0x08
|
||||
|
||||
/*
|
||||
* List of reserved static generic netlink identifiers:
|
||||
*/
|
||||
#define GENL_ID_GENERATE 0
|
||||
#define GENL_ID_CTRL NLMSG_MIN_TYPE
|
||||
|
||||
/**************************************************************************
|
||||
* Controller
|
||||
**************************************************************************/
|
||||
|
||||
enum {
|
||||
CTRL_CMD_UNSPEC,
|
||||
CTRL_CMD_NEWFAMILY,
|
||||
CTRL_CMD_DELFAMILY,
|
||||
CTRL_CMD_GETFAMILY,
|
||||
CTRL_CMD_NEWOPS,
|
||||
CTRL_CMD_DELOPS,
|
||||
CTRL_CMD_GETOPS,
|
||||
CTRL_CMD_NEWMCAST_GRP,
|
||||
CTRL_CMD_DELMCAST_GRP,
|
||||
CTRL_CMD_GETMCAST_GRP, /* unused */
|
||||
__CTRL_CMD_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
|
||||
|
||||
enum {
|
||||
CTRL_ATTR_UNSPEC,
|
||||
CTRL_ATTR_FAMILY_ID,
|
||||
CTRL_ATTR_FAMILY_NAME,
|
||||
CTRL_ATTR_VERSION,
|
||||
CTRL_ATTR_HDRSIZE,
|
||||
CTRL_ATTR_MAXATTR,
|
||||
CTRL_ATTR_OPS,
|
||||
CTRL_ATTR_MCAST_GROUPS,
|
||||
__CTRL_ATTR_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
|
||||
|
||||
enum {
|
||||
CTRL_ATTR_OP_UNSPEC,
|
||||
CTRL_ATTR_OP_ID,
|
||||
CTRL_ATTR_OP_FLAGS,
|
||||
__CTRL_ATTR_OP_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
|
||||
|
||||
enum {
|
||||
CTRL_ATTR_MCAST_GRP_UNSPEC,
|
||||
CTRL_ATTR_MCAST_GRP_NAME,
|
||||
CTRL_ATTR_MCAST_GRP_ID,
|
||||
__CTRL_ATTR_MCAST_GRP_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* All generic netlink requests are serialized by a global lock. */
|
||||
extern void genl_lock(void);
|
||||
|
@ -113,6 +35,4 @@ extern int lockdep_genl_is_held(void);
|
|||
#define MODULE_ALIAS_GENL_FAMILY(family)\
|
||||
MODULE_ALIAS_NET_PF_PROTO_NAME(PF_NETLINK, NETLINK_GENERIC, "-family-" family)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __LINUX_GENERIC_NETLINK_H */
|
||||
|
|
|
@ -7,24 +7,14 @@
|
|||
* under the terms of version 2 of the GNU General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __HDLC_H
|
||||
#define __HDLC_H
|
||||
|
||||
|
||||
#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
|
||||
#if 0
|
||||
#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
|
||||
#else
|
||||
#define HDLC_MAX_MRU 1600 /* as required for FR network */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/hdlc/ioctl.h>
|
||||
#include <uapi/linux/hdlc.h>
|
||||
|
||||
/* This structure is a private property of HDLC protocols.
|
||||
Hardware drivers have no interest here */
|
||||
|
@ -127,5 +117,4 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
|
|||
return htons(ETH_P_HDLC);
|
||||
}
|
||||
|
||||
#endif /* __KERNEL */
|
||||
#endif /* __HDLC_H */
|
||||
|
|
|
@ -3,110 +3,14 @@
|
|||
* The Linux soundcard driver for 1200 baud and 9600 baud packet radio
|
||||
* (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
|
||||
*/
|
||||
|
||||
#ifndef _HDLCDRV_H
|
||||
#define _HDLCDRV_H
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/*
|
||||
* structs for the IOCTL commands
|
||||
*/
|
||||
|
||||
struct hdlcdrv_params {
|
||||
int iobase;
|
||||
int irq;
|
||||
int dma;
|
||||
int dma2;
|
||||
int seriobase;
|
||||
int pariobase;
|
||||
int midiiobase;
|
||||
};
|
||||
|
||||
struct hdlcdrv_channel_params {
|
||||
int tx_delay; /* the transmitter keyup delay in 10ms units */
|
||||
int tx_tail; /* the transmitter keyoff delay in 10ms units */
|
||||
int slottime; /* the slottime in 10ms; usually 10 = 100ms */
|
||||
int ppersist; /* the p-persistence 0..255 */
|
||||
int fulldup; /* some driver do not support full duplex, setting */
|
||||
/* this just makes them send even if DCD is on */
|
||||
};
|
||||
|
||||
struct hdlcdrv_old_channel_state {
|
||||
int ptt;
|
||||
int dcd;
|
||||
int ptt_keyed;
|
||||
};
|
||||
|
||||
struct hdlcdrv_channel_state {
|
||||
int ptt;
|
||||
int dcd;
|
||||
int ptt_keyed;
|
||||
unsigned long tx_packets;
|
||||
unsigned long tx_errors;
|
||||
unsigned long rx_packets;
|
||||
unsigned long rx_errors;
|
||||
};
|
||||
|
||||
struct hdlcdrv_ioctl {
|
||||
int cmd;
|
||||
union {
|
||||
struct hdlcdrv_params mp;
|
||||
struct hdlcdrv_channel_params cp;
|
||||
struct hdlcdrv_channel_state cs;
|
||||
struct hdlcdrv_old_channel_state ocs;
|
||||
unsigned int calibrate;
|
||||
unsigned char bits;
|
||||
char modename[128];
|
||||
char drivername[32];
|
||||
} data;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ioctl values
|
||||
*/
|
||||
#define HDLCDRVCTL_GETMODEMPAR 0
|
||||
#define HDLCDRVCTL_SETMODEMPAR 1
|
||||
#define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
|
||||
#define HDLCDRVCTL_GETCHANNELPAR 10
|
||||
#define HDLCDRVCTL_SETCHANNELPAR 11
|
||||
#define HDLCDRVCTL_OLDGETSTAT 20
|
||||
#define HDLCDRVCTL_CALIBRATE 21
|
||||
#define HDLCDRVCTL_GETSTAT 22
|
||||
|
||||
/*
|
||||
* these are mainly for debugging purposes
|
||||
*/
|
||||
#define HDLCDRVCTL_GETSAMPLES 30
|
||||
#define HDLCDRVCTL_GETBITS 31
|
||||
|
||||
/*
|
||||
* not handled by hdlcdrv, but by its depending drivers
|
||||
*/
|
||||
#define HDLCDRVCTL_GETMODE 40
|
||||
#define HDLCDRVCTL_SETMODE 41
|
||||
#define HDLCDRVCTL_MODELIST 42
|
||||
#define HDLCDRVCTL_DRIVERNAME 43
|
||||
|
||||
/*
|
||||
* mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
|
||||
*/
|
||||
#define HDLCDRV_PARMASK_IOBASE (1<<0)
|
||||
#define HDLCDRV_PARMASK_IRQ (1<<1)
|
||||
#define HDLCDRV_PARMASK_DMA (1<<2)
|
||||
#define HDLCDRV_PARMASK_DMA2 (1<<3)
|
||||
#define HDLCDRV_PARMASK_SERIOBASE (1<<4)
|
||||
#define HDLCDRV_PARMASK_PARIOBASE (1<<5)
|
||||
#define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <uapi/linux/hdlcdrv.h>
|
||||
|
||||
#define HDLCDRV_MAGIC 0x5ac6e778
|
||||
#define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */
|
||||
|
@ -368,10 +272,4 @@ void hdlcdrv_unregister(struct net_device *dev);
|
|||
|
||||
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#endif /* _HDLCDRV_H */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#ifndef __HID_H
|
||||
#define __HID_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Andreas Gal
|
||||
* Copyright (c) 2000-2001 Vojtech Pavlik
|
||||
* Copyright (c) 2006-2007 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,43 +22,9 @@
|
|||
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
|
||||
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
|
||||
*/
|
||||
#ifndef __HID_H
|
||||
#define __HID_H
|
||||
|
||||
/*
|
||||
* USB HID (Human Interface Device) interface class code
|
||||
*/
|
||||
|
||||
#define USB_INTERFACE_CLASS_HID 3
|
||||
|
||||
/*
|
||||
* USB HID interface subclass and protocol codes
|
||||
*/
|
||||
|
||||
#define USB_INTERFACE_SUBCLASS_BOOT 1
|
||||
#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
|
||||
#define USB_INTERFACE_PROTOCOL_MOUSE 2
|
||||
|
||||
/*
|
||||
* HID class requests
|
||||
*/
|
||||
|
||||
#define HID_REQ_GET_REPORT 0x01
|
||||
#define HID_REQ_GET_IDLE 0x02
|
||||
#define HID_REQ_GET_PROTOCOL 0x03
|
||||
#define HID_REQ_SET_REPORT 0x09
|
||||
#define HID_REQ_SET_IDLE 0x0A
|
||||
#define HID_REQ_SET_PROTOCOL 0x0B
|
||||
|
||||
/*
|
||||
* HID class descriptor types
|
||||
*/
|
||||
|
||||
#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
|
||||
#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
|
||||
#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
|
||||
|
||||
#define HID_MAX_DESCRIPTOR_SIZE 4096
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
|
@ -73,6 +35,7 @@
|
|||
#include <linux/input.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/power_supply.h>
|
||||
#include <uapi/linux/hid.h>
|
||||
|
||||
/*
|
||||
* We parse each description item into this structure. Short items data
|
||||
|
@ -943,7 +906,4 @@ do { \
|
|||
#define hid_dbg(hid, fmt, arg...) \
|
||||
dev_dbg(&(hid)->dev, fmt, ##arg)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#ifndef _HIDDEV_H
|
||||
#define _HIDDEV_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999-2000 Vojtech Pavlik
|
||||
*
|
||||
* Sponsored by SuSE
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,190 +22,11 @@
|
|||
* e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
|
||||
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
|
||||
*/
|
||||
#ifndef _HIDDEV_H
|
||||
#define _HIDDEV_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/hiddev.h>
|
||||
|
||||
/*
|
||||
* The event structure itself
|
||||
*/
|
||||
|
||||
struct hiddev_event {
|
||||
unsigned hid;
|
||||
signed int value;
|
||||
};
|
||||
|
||||
struct hiddev_devinfo {
|
||||
__u32 bustype;
|
||||
__u32 busnum;
|
||||
__u32 devnum;
|
||||
__u32 ifnum;
|
||||
__s16 vendor;
|
||||
__s16 product;
|
||||
__s16 version;
|
||||
__u32 num_applications;
|
||||
};
|
||||
|
||||
struct hiddev_collection_info {
|
||||
__u32 index;
|
||||
__u32 type;
|
||||
__u32 usage;
|
||||
__u32 level;
|
||||
};
|
||||
|
||||
#define HID_STRING_SIZE 256
|
||||
struct hiddev_string_descriptor {
|
||||
__s32 index;
|
||||
char value[HID_STRING_SIZE];
|
||||
};
|
||||
|
||||
struct hiddev_report_info {
|
||||
__u32 report_type;
|
||||
__u32 report_id;
|
||||
__u32 num_fields;
|
||||
};
|
||||
|
||||
/* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and
|
||||
* report_id. Set report_id to REPORT_ID_UNKNOWN if the rest of the fields
|
||||
* are unknown. Otherwise use a usage_ref struct filled in from a previous
|
||||
* successful GUSAGE call to save time. To actually send a value to the
|
||||
* device, perform a SUSAGE first, followed by a SREPORT. An INITREPORT or a
|
||||
* GREPORT isn't necessary for a GUSAGE to return valid data.
|
||||
*/
|
||||
#define HID_REPORT_ID_UNKNOWN 0xffffffff
|
||||
#define HID_REPORT_ID_FIRST 0x00000100
|
||||
#define HID_REPORT_ID_NEXT 0x00000200
|
||||
#define HID_REPORT_ID_MASK 0x000000ff
|
||||
#define HID_REPORT_ID_MAX 0x000000ff
|
||||
|
||||
#define HID_REPORT_TYPE_INPUT 1
|
||||
#define HID_REPORT_TYPE_OUTPUT 2
|
||||
#define HID_REPORT_TYPE_FEATURE 3
|
||||
#define HID_REPORT_TYPE_MIN 1
|
||||
#define HID_REPORT_TYPE_MAX 3
|
||||
|
||||
struct hiddev_field_info {
|
||||
__u32 report_type;
|
||||
__u32 report_id;
|
||||
__u32 field_index;
|
||||
__u32 maxusage;
|
||||
__u32 flags;
|
||||
__u32 physical; /* physical usage for this field */
|
||||
__u32 logical; /* logical usage for this field */
|
||||
__u32 application; /* application usage for this field */
|
||||
__s32 logical_minimum;
|
||||
__s32 logical_maximum;
|
||||
__s32 physical_minimum;
|
||||
__s32 physical_maximum;
|
||||
__u32 unit_exponent;
|
||||
__u32 unit;
|
||||
};
|
||||
|
||||
/* Fill in report_type, report_id and field_index to get the information on a
|
||||
* field.
|
||||
*/
|
||||
#define HID_FIELD_CONSTANT 0x001
|
||||
#define HID_FIELD_VARIABLE 0x002
|
||||
#define HID_FIELD_RELATIVE 0x004
|
||||
#define HID_FIELD_WRAP 0x008
|
||||
#define HID_FIELD_NONLINEAR 0x010
|
||||
#define HID_FIELD_NO_PREFERRED 0x020
|
||||
#define HID_FIELD_NULL_STATE 0x040
|
||||
#define HID_FIELD_VOLATILE 0x080
|
||||
#define HID_FIELD_BUFFERED_BYTE 0x100
|
||||
|
||||
struct hiddev_usage_ref {
|
||||
__u32 report_type;
|
||||
__u32 report_id;
|
||||
__u32 field_index;
|
||||
__u32 usage_index;
|
||||
__u32 usage_code;
|
||||
__s32 value;
|
||||
};
|
||||
|
||||
/* hiddev_usage_ref_multi is used for sending multiple bytes to a control.
|
||||
* It really manifests itself as setting the value of consecutive usages */
|
||||
#define HID_MAX_MULTI_USAGES 1024
|
||||
struct hiddev_usage_ref_multi {
|
||||
struct hiddev_usage_ref uref;
|
||||
__u32 num_values;
|
||||
__s32 values[HID_MAX_MULTI_USAGES];
|
||||
};
|
||||
|
||||
/* FIELD_INDEX_NONE is returned in read() data from the kernel when flags
|
||||
* is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has
|
||||
* been sent by the device
|
||||
*/
|
||||
#define HID_FIELD_INDEX_NONE 0xffffffff
|
||||
|
||||
/*
|
||||
* Protocol version.
|
||||
*/
|
||||
|
||||
#define HID_VERSION 0x010004
|
||||
|
||||
/*
|
||||
* IOCTLs (0x00 - 0x7f)
|
||||
*/
|
||||
|
||||
#define HIDIOCGVERSION _IOR('H', 0x01, int)
|
||||
#define HIDIOCAPPLICATION _IO('H', 0x02)
|
||||
#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
|
||||
#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
|
||||
#define HIDIOCINITREPORT _IO('H', 0x05)
|
||||
#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
|
||||
#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
|
||||
#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
|
||||
#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
|
||||
#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
|
||||
#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
|
||||
#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
|
||||
#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
|
||||
#define HIDIOCGFLAG _IOR('H', 0x0E, int)
|
||||
#define HIDIOCSFLAG _IOW('H', 0x0F, int)
|
||||
#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
|
||||
#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
|
||||
#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
|
||||
|
||||
/* For writing/reading to multiple/consecutive usages */
|
||||
#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
|
||||
#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
|
||||
|
||||
/*
|
||||
* Flags to be used in HIDIOCSFLAG
|
||||
*/
|
||||
#define HIDDEV_FLAG_UREF 0x1
|
||||
#define HIDDEV_FLAG_REPORT 0x2
|
||||
#define HIDDEV_FLAGS 0x3
|
||||
|
||||
/* To traverse the input report descriptor info for a HID device, perform the
|
||||
* following:
|
||||
*
|
||||
* rinfo.report_type = HID_REPORT_TYPE_INPUT;
|
||||
* rinfo.report_id = HID_REPORT_ID_FIRST;
|
||||
* ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
|
||||
*
|
||||
* while (ret >= 0) {
|
||||
* for (i = 0; i < rinfo.num_fields; i++) {
|
||||
* finfo.report_type = rinfo.report_type;
|
||||
* finfo.report_id = rinfo.report_id;
|
||||
* finfo.field_index = i;
|
||||
* ioctl(fd, HIDIOCGFIELDINFO, &finfo);
|
||||
* for (j = 0; j < finfo.maxusage; j++) {
|
||||
* uref.report_type = rinfo.report_type;
|
||||
* uref.report_id = rinfo.report_id;
|
||||
* uref.field_index = i;
|
||||
* uref.usage_index = j;
|
||||
* ioctl(fd, HIDIOCGUCODE, &uref);
|
||||
* ioctl(fd, HIDIOCGUSAGE, &uref);
|
||||
* }
|
||||
* }
|
||||
* rinfo.report_id |= HID_REPORT_ID_NEXT;
|
||||
* ret = ioctl(fd, HIDIOCGREPORTINFO, &rinfo);
|
||||
* }
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* In-kernel definitions.
|
||||
|
@ -237,4 +54,3 @@ static inline void hiddev_report_event(struct hid_device *hid, struct hid_report
|
|||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
#ifndef _HIDRAW_H
|
||||
#define _HIDRAW_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
|
@ -14,39 +10,11 @@
|
|||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
#ifndef _HIDRAW_H
|
||||
#define _HIDRAW_H
|
||||
|
||||
#include <linux/hid.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/hidraw.h>
|
||||
|
||||
struct hidraw_report_descriptor {
|
||||
__u32 size;
|
||||
__u8 value[HID_MAX_DESCRIPTOR_SIZE];
|
||||
};
|
||||
|
||||
struct hidraw_devinfo {
|
||||
__u32 bustype;
|
||||
__s16 vendor;
|
||||
__s16 product;
|
||||
};
|
||||
|
||||
/* ioctl interface */
|
||||
#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
|
||||
#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
|
||||
#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
|
||||
#define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len)
|
||||
#define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len)
|
||||
/* The first byte of SFEATURE and GFEATURE is the report number */
|
||||
#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
|
||||
#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
|
||||
|
||||
#define HIDRAW_FIRST_MINOR 0
|
||||
#define HIDRAW_MAX_DEVICES 64
|
||||
/* number of reports to buffer */
|
||||
#define HIDRAW_BUFFER_SIZE 64
|
||||
|
||||
|
||||
/* kernel-only API declarations */
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct hidraw {
|
||||
unsigned int minor;
|
||||
|
@ -88,5 +56,3 @@ static inline void hidraw_disconnect(struct hid_device *hid) { }
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef __HPET__
|
||||
#define __HPET__ 1
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <uapi/linux/hpet.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* Offsets into HPET Registers
|
||||
|
@ -108,24 +107,4 @@ static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
|
|||
|
||||
int hpet_alloc(struct hpet_data *);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
struct hpet_info {
|
||||
unsigned long hi_ireqfreq; /* Hz */
|
||||
unsigned long hi_flags; /* information */
|
||||
unsigned short hi_hpet;
|
||||
unsigned short hi_timer;
|
||||
};
|
||||
|
||||
#define HPET_INFO_PERIODIC 0x0010 /* periodic-capable comparator */
|
||||
|
||||
#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
|
||||
#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
|
||||
#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
|
||||
#define HPET_EPI _IO('h', 0x04) /* enable periodic */
|
||||
#define HPET_DPI _IO('h', 0x05) /* disable periodic */
|
||||
#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
|
||||
|
||||
#define MAX_HPET_TBS 8 /* maximum hpet timer blocks */
|
||||
|
||||
#endif /* !__HPET__ */
|
||||
|
|
|
@ -19,57 +19,10 @@
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_I2C_DEV_H
|
||||
#define _LINUX_I2C_DEV_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <uapi/linux/i2c-dev.h>
|
||||
|
||||
/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
|
||||
* unsigned long, except for:
|
||||
* - I2C_FUNCS, takes pointer to an unsigned long
|
||||
* - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
|
||||
* - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
|
||||
*/
|
||||
#define I2C_RETRIES 0x0701 /* number of times a device address should
|
||||
be polled when not acknowledging */
|
||||
#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
|
||||
|
||||
/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
|
||||
* are NOT supported! (due to code brokenness)
|
||||
*/
|
||||
#define I2C_SLAVE 0x0703 /* Use this slave address */
|
||||
#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
|
||||
is already in use by a driver! */
|
||||
#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
|
||||
|
||||
#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
|
||||
|
||||
#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
|
||||
|
||||
#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
|
||||
#define I2C_SMBUS 0x0720 /* SMBus transfer */
|
||||
|
||||
|
||||
/* This is the structure as used in the I2C_SMBUS ioctl call */
|
||||
struct i2c_smbus_ioctl_data {
|
||||
__u8 read_write;
|
||||
__u8 command;
|
||||
__u32 size;
|
||||
union i2c_smbus_data __user *data;
|
||||
};
|
||||
|
||||
/* This is the structure as used in the I2C_RDWR ioctl call */
|
||||
struct i2c_rdwr_ioctl_data {
|
||||
struct i2c_msg __user *msgs; /* pointers to i2c_msgs */
|
||||
__u32 nmsgs; /* number of i2c_msgs */
|
||||
};
|
||||
|
||||
#define I2C_RDRW_IOCTL_MAX_MSGS 42
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define I2C_MAJOR 89 /* Device major number */
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_I2C_DEV_H */
|
||||
|
|
|
@ -23,18 +23,16 @@
|
|||
|
||||
/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
|
||||
Frodo Looijaard <frodol@dds.nl> */
|
||||
|
||||
#ifndef _LINUX_I2C_H
|
||||
#define _LINUX_I2C_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/device.h> /* for struct device */
|
||||
#include <linux/sched.h> /* for completion */
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/of.h> /* for struct device_node */
|
||||
#include <linux/swab.h> /* for swab16 */
|
||||
#include <uapi/linux/i2c.h>
|
||||
|
||||
extern struct bus_type i2c_bus_type;
|
||||
extern struct device_type i2c_adapter_type;
|
||||
|
@ -503,125 +501,4 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
|
|||
i2c_del_driver)
|
||||
|
||||
#endif /* I2C */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/**
|
||||
* struct i2c_msg - an I2C transaction segment beginning with START
|
||||
* @addr: Slave address, either seven or ten bits. When this is a ten
|
||||
* bit address, I2C_M_TEN must be set in @flags and the adapter
|
||||
* must support I2C_FUNC_10BIT_ADDR.
|
||||
* @flags: I2C_M_RD is handled by all adapters. No other flags may be
|
||||
* provided unless the adapter exported the relevant I2C_FUNC_*
|
||||
* flags through i2c_check_functionality().
|
||||
* @len: Number of data bytes in @buf being read from or written to the
|
||||
* I2C slave address. For read transactions where I2C_M_RECV_LEN
|
||||
* is set, the caller guarantees that this buffer can hold up to
|
||||
* 32 bytes in addition to the initial length byte sent by the
|
||||
* slave (plus, if used, the SMBus PEC); and this value will be
|
||||
* incremented by the number of block data bytes received.
|
||||
* @buf: The buffer into which data is read, or from which it's written.
|
||||
*
|
||||
* An i2c_msg is the low level representation of one segment of an I2C
|
||||
* transaction. It is visible to drivers in the @i2c_transfer() procedure,
|
||||
* to userspace from i2c-dev, and to I2C adapter drivers through the
|
||||
* @i2c_adapter.@master_xfer() method.
|
||||
*
|
||||
* Except when I2C "protocol mangling" is used, all I2C adapters implement
|
||||
* the standard rules for I2C transactions. Each transaction begins with a
|
||||
* START. That is followed by the slave address, and a bit encoding read
|
||||
* versus write. Then follow all the data bytes, possibly including a byte
|
||||
* with SMBus PEC. The transfer terminates with a NAK, or when all those
|
||||
* bytes have been transferred and ACKed. If this is the last message in a
|
||||
* group, it is followed by a STOP. Otherwise it is followed by the next
|
||||
* @i2c_msg transaction segment, beginning with a (repeated) START.
|
||||
*
|
||||
* Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
|
||||
* passing certain @flags may have changed those standard protocol behaviors.
|
||||
* Those flags are only for use with broken/nonconforming slaves, and with
|
||||
* adapters which are known to support the specific mangling options they
|
||||
* need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
|
||||
*/
|
||||
struct i2c_msg {
|
||||
__u16 addr; /* slave address */
|
||||
__u16 flags;
|
||||
#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
|
||||
#define I2C_M_RD 0x0001 /* read data, from slave to master */
|
||||
#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
|
||||
#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
|
||||
__u16 len; /* msg length */
|
||||
__u8 *buf; /* pointer to msg data */
|
||||
};
|
||||
|
||||
/* To determine what functionality is present */
|
||||
|
||||
#define I2C_FUNC_I2C 0x00000001
|
||||
#define I2C_FUNC_10BIT_ADDR 0x00000002
|
||||
#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_IGNORE_NAK etc. */
|
||||
#define I2C_FUNC_SMBUS_PEC 0x00000008
|
||||
#define I2C_FUNC_NOSTART 0x00000010 /* I2C_M_NOSTART */
|
||||
#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
|
||||
#define I2C_FUNC_SMBUS_QUICK 0x00010000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
|
||||
#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
|
||||
#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
|
||||
#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
|
||||
#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
|
||||
#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
|
||||
#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
|
||||
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
|
||||
#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
|
||||
|
||||
#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
|
||||
I2C_FUNC_SMBUS_WRITE_BYTE)
|
||||
#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
|
||||
I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
|
||||
#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
|
||||
I2C_FUNC_SMBUS_WRITE_WORD_DATA)
|
||||
#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
|
||||
I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
|
||||
#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
|
||||
I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
|
||||
|
||||
#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
|
||||
I2C_FUNC_SMBUS_BYTE | \
|
||||
I2C_FUNC_SMBUS_BYTE_DATA | \
|
||||
I2C_FUNC_SMBUS_WORD_DATA | \
|
||||
I2C_FUNC_SMBUS_PROC_CALL | \
|
||||
I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
|
||||
I2C_FUNC_SMBUS_I2C_BLOCK | \
|
||||
I2C_FUNC_SMBUS_PEC)
|
||||
|
||||
/*
|
||||
* Data for SMBus Messages
|
||||
*/
|
||||
#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
|
||||
union i2c_smbus_data {
|
||||
__u8 byte;
|
||||
__u16 word;
|
||||
__u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
|
||||
/* and one more for user-space compatibility */
|
||||
};
|
||||
|
||||
/* i2c_smbus_xfer read or write markers */
|
||||
#define I2C_SMBUS_READ 1
|
||||
#define I2C_SMBUS_WRITE 0
|
||||
|
||||
/* SMBus transaction types (size parameter in the above functions)
|
||||
Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
|
||||
#define I2C_SMBUS_QUICK 0
|
||||
#define I2C_SMBUS_BYTE 1
|
||||
#define I2C_SMBUS_BYTE_DATA 2
|
||||
#define I2C_SMBUS_WORD_DATA 3
|
||||
#define I2C_SMBUS_PROC_CALL 4
|
||||
#define I2C_SMBUS_BLOCK_DATA 5
|
||||
#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
|
||||
#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
|
||||
#define I2C_SMBUS_I2C_BLOCK_DATA 8
|
||||
|
||||
#endif /* _LINUX_I2C_H */
|
||||
|
|
|
@ -17,89 +17,11 @@
|
|||
#ifndef _LINUX_ICMP_H
|
||||
#define _LINUX_ICMP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ICMP_ECHOREPLY 0 /* Echo Reply */
|
||||
#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
|
||||
#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
|
||||
#define ICMP_REDIRECT 5 /* Redirect (change route) */
|
||||
#define ICMP_ECHO 8 /* Echo Request */
|
||||
#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
|
||||
#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
|
||||
#define ICMP_TIMESTAMP 13 /* Timestamp Request */
|
||||
#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
|
||||
#define ICMP_INFO_REQUEST 15 /* Information Request */
|
||||
#define ICMP_INFO_REPLY 16 /* Information Reply */
|
||||
#define ICMP_ADDRESS 17 /* Address Mask Request */
|
||||
#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
|
||||
#define NR_ICMP_TYPES 18
|
||||
|
||||
|
||||
/* Codes for UNREACH. */
|
||||
#define ICMP_NET_UNREACH 0 /* Network Unreachable */
|
||||
#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
|
||||
#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
|
||||
#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
|
||||
#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
|
||||
#define ICMP_SR_FAILED 5 /* Source Route failed */
|
||||
#define ICMP_NET_UNKNOWN 6
|
||||
#define ICMP_HOST_UNKNOWN 7
|
||||
#define ICMP_HOST_ISOLATED 8
|
||||
#define ICMP_NET_ANO 9
|
||||
#define ICMP_HOST_ANO 10
|
||||
#define ICMP_NET_UNR_TOS 11
|
||||
#define ICMP_HOST_UNR_TOS 12
|
||||
#define ICMP_PKT_FILTERED 13 /* Packet filtered */
|
||||
#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
|
||||
#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
|
||||
#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
|
||||
|
||||
/* Codes for REDIRECT. */
|
||||
#define ICMP_REDIR_NET 0 /* Redirect Net */
|
||||
#define ICMP_REDIR_HOST 1 /* Redirect Host */
|
||||
#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
|
||||
#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
|
||||
|
||||
/* Codes for TIME_EXCEEDED. */
|
||||
#define ICMP_EXC_TTL 0 /* TTL count exceeded */
|
||||
#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
|
||||
|
||||
|
||||
struct icmphdr {
|
||||
__u8 type;
|
||||
__u8 code;
|
||||
__sum16 checksum;
|
||||
union {
|
||||
struct {
|
||||
__be16 id;
|
||||
__be16 sequence;
|
||||
} echo;
|
||||
__be32 gateway;
|
||||
struct {
|
||||
__be16 __unused;
|
||||
__be16 mtu;
|
||||
} frag;
|
||||
} un;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/icmp.h>
|
||||
|
||||
static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct icmphdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* constants for (set|get)sockopt
|
||||
*/
|
||||
|
||||
#define ICMP_FILTER 1
|
||||
|
||||
struct icmp_filter {
|
||||
__u32 data;
|
||||
};
|
||||
|
||||
|
||||
#endif /* _LINUX_ICMP_H */
|
||||
|
|
|
@ -1,174 +1,13 @@
|
|||
#ifndef _LINUX_ICMPV6_H
|
||||
#define _LINUX_ICMPV6_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
struct icmp6hdr {
|
||||
|
||||
__u8 icmp6_type;
|
||||
__u8 icmp6_code;
|
||||
__sum16 icmp6_cksum;
|
||||
|
||||
|
||||
union {
|
||||
__be32 un_data32[1];
|
||||
__be16 un_data16[2];
|
||||
__u8 un_data8[4];
|
||||
|
||||
struct icmpv6_echo {
|
||||
__be16 identifier;
|
||||
__be16 sequence;
|
||||
} u_echo;
|
||||
|
||||
struct icmpv6_nd_advt {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u32 reserved:5,
|
||||
override:1,
|
||||
solicited:1,
|
||||
router:1,
|
||||
reserved2:24;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u32 router:1,
|
||||
solicited:1,
|
||||
override:1,
|
||||
reserved:29;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
} u_nd_advt;
|
||||
|
||||
struct icmpv6_nd_ra {
|
||||
__u8 hop_limit;
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 reserved:3,
|
||||
router_pref:2,
|
||||
home_agent:1,
|
||||
other:1,
|
||||
managed:1;
|
||||
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 managed:1,
|
||||
other:1,
|
||||
home_agent:1,
|
||||
router_pref:2,
|
||||
reserved:3;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__be16 rt_lifetime;
|
||||
} u_nd_ra;
|
||||
|
||||
} icmp6_dataun;
|
||||
|
||||
#define icmp6_identifier icmp6_dataun.u_echo.identifier
|
||||
#define icmp6_sequence icmp6_dataun.u_echo.sequence
|
||||
#define icmp6_pointer icmp6_dataun.un_data32[0]
|
||||
#define icmp6_mtu icmp6_dataun.un_data32[0]
|
||||
#define icmp6_unused icmp6_dataun.un_data32[0]
|
||||
#define icmp6_maxdelay icmp6_dataun.un_data16[0]
|
||||
#define icmp6_router icmp6_dataun.u_nd_advt.router
|
||||
#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
|
||||
#define icmp6_override icmp6_dataun.u_nd_advt.override
|
||||
#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
|
||||
#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
|
||||
#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
|
||||
#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
|
||||
#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
|
||||
#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/icmpv6.h>
|
||||
|
||||
static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct icmp6hdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ICMPV6_ROUTER_PREF_LOW 0x3
|
||||
#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
|
||||
#define ICMPV6_ROUTER_PREF_HIGH 0x1
|
||||
#define ICMPV6_ROUTER_PREF_INVALID 0x2
|
||||
|
||||
#define ICMPV6_DEST_UNREACH 1
|
||||
#define ICMPV6_PKT_TOOBIG 2
|
||||
#define ICMPV6_TIME_EXCEED 3
|
||||
#define ICMPV6_PARAMPROB 4
|
||||
|
||||
#define ICMPV6_INFOMSG_MASK 0x80
|
||||
|
||||
#define ICMPV6_ECHO_REQUEST 128
|
||||
#define ICMPV6_ECHO_REPLY 129
|
||||
#define ICMPV6_MGM_QUERY 130
|
||||
#define ICMPV6_MGM_REPORT 131
|
||||
#define ICMPV6_MGM_REDUCTION 132
|
||||
|
||||
#define ICMPV6_NI_QUERY 139
|
||||
#define ICMPV6_NI_REPLY 140
|
||||
|
||||
#define ICMPV6_MLD2_REPORT 143
|
||||
|
||||
#define ICMPV6_DHAAD_REQUEST 144
|
||||
#define ICMPV6_DHAAD_REPLY 145
|
||||
#define ICMPV6_MOBILE_PREFIX_SOL 146
|
||||
#define ICMPV6_MOBILE_PREFIX_ADV 147
|
||||
|
||||
/*
|
||||
* Codes for Destination Unreachable
|
||||
*/
|
||||
#define ICMPV6_NOROUTE 0
|
||||
#define ICMPV6_ADM_PROHIBITED 1
|
||||
#define ICMPV6_NOT_NEIGHBOUR 2
|
||||
#define ICMPV6_ADDR_UNREACH 3
|
||||
#define ICMPV6_PORT_UNREACH 4
|
||||
|
||||
/*
|
||||
* Codes for Time Exceeded
|
||||
*/
|
||||
#define ICMPV6_EXC_HOPLIMIT 0
|
||||
#define ICMPV6_EXC_FRAGTIME 1
|
||||
|
||||
/*
|
||||
* Codes for Parameter Problem
|
||||
*/
|
||||
#define ICMPV6_HDR_FIELD 0
|
||||
#define ICMPV6_UNK_NEXTHDR 1
|
||||
#define ICMPV6_UNK_OPTION 2
|
||||
|
||||
/*
|
||||
* constants for (set|get)sockopt
|
||||
*/
|
||||
|
||||
#define ICMPV6_FILTER 1
|
||||
|
||||
/*
|
||||
* ICMPV6 filter
|
||||
*/
|
||||
|
||||
#define ICMPV6_FILTER_BLOCK 1
|
||||
#define ICMPV6_FILTER_PASS 2
|
||||
#define ICMPV6_FILTER_BLOCKOTHERS 3
|
||||
#define ICMPV6_FILTER_PASSONLY 4
|
||||
|
||||
struct icmp6_filter {
|
||||
__u32 data[8];
|
||||
};
|
||||
|
||||
/*
|
||||
* Definitions for MLDv2
|
||||
*/
|
||||
#define MLD2_MODE_IS_INCLUDE 1
|
||||
#define MLD2_MODE_IS_EXCLUDE 2
|
||||
#define MLD2_CHANGE_TO_INCLUDE 3
|
||||
#define MLD2_CHANGE_TO_EXCLUDE 4
|
||||
#define MLD2_ALLOW_NEW_SOURCES 5
|
||||
#define MLD2_BLOCK_OLD_SOURCES 6
|
||||
|
||||
#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
|
@ -192,5 +31,3 @@ extern void icmpv6_flow_init(struct sock *sk,
|
|||
const struct in6_addr *daddr,
|
||||
int oif);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,140 +23,8 @@
|
|||
#ifndef _LINUX_IF_ARP_H
|
||||
#define _LINUX_IF_ARP_H
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
/* ARP protocol HARDWARE identifiers. */
|
||||
#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
|
||||
#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
|
||||
#define ARPHRD_EETHER 2 /* Experimental Ethernet */
|
||||
#define ARPHRD_AX25 3 /* AX.25 Level 2 */
|
||||
#define ARPHRD_PRONET 4 /* PROnet token ring */
|
||||
#define ARPHRD_CHAOS 5 /* Chaosnet */
|
||||
#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
|
||||
#define ARPHRD_ARCNET 7 /* ARCnet */
|
||||
#define ARPHRD_APPLETLK 8 /* APPLEtalk */
|
||||
#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
|
||||
#define ARPHRD_ATM 19 /* ATM */
|
||||
#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
|
||||
#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
|
||||
#define ARPHRD_EUI64 27 /* EUI-64 */
|
||||
#define ARPHRD_INFINIBAND 32 /* InfiniBand */
|
||||
|
||||
/* Dummy types for non ARP hardware */
|
||||
#define ARPHRD_SLIP 256
|
||||
#define ARPHRD_CSLIP 257
|
||||
#define ARPHRD_SLIP6 258
|
||||
#define ARPHRD_CSLIP6 259
|
||||
#define ARPHRD_RSRVD 260 /* Notional KISS type */
|
||||
#define ARPHRD_ADAPT 264
|
||||
#define ARPHRD_ROSE 270
|
||||
#define ARPHRD_X25 271 /* CCITT X.25 */
|
||||
#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
|
||||
#define ARPHRD_CAN 280 /* Controller Area Network */
|
||||
#define ARPHRD_PPP 512
|
||||
#define ARPHRD_CISCO 513 /* Cisco HDLC */
|
||||
#define ARPHRD_HDLC ARPHRD_CISCO
|
||||
#define ARPHRD_LAPB 516 /* LAPB */
|
||||
#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
|
||||
#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
|
||||
|
||||
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
|
||||
#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */
|
||||
#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
|
||||
#define ARPHRD_SKIP 771 /* SKIP vif */
|
||||
#define ARPHRD_LOOPBACK 772 /* Loopback device */
|
||||
#define ARPHRD_LOCALTLK 773 /* Localtalk device */
|
||||
#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
|
||||
#define ARPHRD_BIF 775 /* AP1000 BIF */
|
||||
#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
|
||||
#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
|
||||
#define ARPHRD_IPGRE 778 /* GRE over IP */
|
||||
#define ARPHRD_PIMREG 779 /* PIMSM register interface */
|
||||
#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
|
||||
#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
|
||||
#define ARPHRD_ECONET 782 /* Acorn Econet */
|
||||
#define ARPHRD_IRDA 783 /* Linux-IrDA */
|
||||
/* ARP works differently on different FC media .. so */
|
||||
#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
|
||||
#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
|
||||
#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
|
||||
#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
|
||||
/* 787->799 reserved for fibrechannel media types */
|
||||
#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
|
||||
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
|
||||
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
|
||||
#define ARPHRD_IEEE802154 804
|
||||
#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */
|
||||
|
||||
#define ARPHRD_PHONET 820 /* PhoNet media type */
|
||||
#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
|
||||
#define ARPHRD_CAIF 822 /* CAIF media type */
|
||||
#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
|
||||
|
||||
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
|
||||
#define ARPHRD_NONE 0xFFFE /* zero header length */
|
||||
|
||||
/* ARP protocol opcodes. */
|
||||
#define ARPOP_REQUEST 1 /* ARP request */
|
||||
#define ARPOP_REPLY 2 /* ARP reply */
|
||||
#define ARPOP_RREQUEST 3 /* RARP request */
|
||||
#define ARPOP_RREPLY 4 /* RARP reply */
|
||||
#define ARPOP_InREQUEST 8 /* InARP request */
|
||||
#define ARPOP_InREPLY 9 /* InARP reply */
|
||||
#define ARPOP_NAK 10 /* (ATM)ARP NAK */
|
||||
|
||||
|
||||
/* ARP ioctl request. */
|
||||
struct arpreq {
|
||||
struct sockaddr arp_pa; /* protocol address */
|
||||
struct sockaddr arp_ha; /* hardware address */
|
||||
int arp_flags; /* flags */
|
||||
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
|
||||
char arp_dev[16];
|
||||
};
|
||||
|
||||
struct arpreq_old {
|
||||
struct sockaddr arp_pa; /* protocol address */
|
||||
struct sockaddr arp_ha; /* hardware address */
|
||||
int arp_flags; /* flags */
|
||||
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
|
||||
};
|
||||
|
||||
/* ARP Flag values. */
|
||||
#define ATF_COM 0x02 /* completed entry (ha valid) */
|
||||
#define ATF_PERM 0x04 /* permanent entry */
|
||||
#define ATF_PUBL 0x08 /* publish entry */
|
||||
#define ATF_USETRAILERS 0x10 /* has requested trailers */
|
||||
#define ATF_NETMASK 0x20 /* want to use a netmask (only
|
||||
for proxy entries) */
|
||||
#define ATF_DONTPUB 0x40 /* don't answer this addresses */
|
||||
|
||||
/*
|
||||
* This structure defines an ethernet arp header.
|
||||
*/
|
||||
|
||||
struct arphdr {
|
||||
__be16 ar_hrd; /* format of hardware address */
|
||||
__be16 ar_pro; /* format of protocol address */
|
||||
unsigned char ar_hln; /* length of hardware address */
|
||||
unsigned char ar_pln; /* length of protocol address */
|
||||
__be16 ar_op; /* ARP opcode (command) */
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Ethernet looks like this : This bit is variable sized however...
|
||||
*/
|
||||
unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
|
||||
unsigned char ar_sip[4]; /* sender IP address */
|
||||
unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
|
||||
unsigned char ar_tip[4]; /* target IP address */
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/if_arp.h>
|
||||
|
||||
static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
|
@ -168,6 +36,4 @@ static inline int arp_hdr_len(struct net_device *dev)
|
|||
/* ARP header, plus 2 device addresses, plus 2 IP addresses. */
|
||||
return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_IF_ARP_H */
|
||||
|
|
|
@ -9,97 +9,12 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IF_BRIDGE_H
|
||||
#define _LINUX_IF_BRIDGE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SYSFS_BRIDGE_ATTR "bridge"
|
||||
#define SYSFS_BRIDGE_FDB "brforward"
|
||||
#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
|
||||
#define SYSFS_BRIDGE_PORT_ATTR "brport"
|
||||
#define SYSFS_BRIDGE_PORT_LINK "bridge"
|
||||
|
||||
#define BRCTL_VERSION 1
|
||||
|
||||
#define BRCTL_GET_VERSION 0
|
||||
#define BRCTL_GET_BRIDGES 1
|
||||
#define BRCTL_ADD_BRIDGE 2
|
||||
#define BRCTL_DEL_BRIDGE 3
|
||||
#define BRCTL_ADD_IF 4
|
||||
#define BRCTL_DEL_IF 5
|
||||
#define BRCTL_GET_BRIDGE_INFO 6
|
||||
#define BRCTL_GET_PORT_LIST 7
|
||||
#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
|
||||
#define BRCTL_SET_BRIDGE_HELLO_TIME 9
|
||||
#define BRCTL_SET_BRIDGE_MAX_AGE 10
|
||||
#define BRCTL_SET_AGEING_TIME 11
|
||||
#define BRCTL_SET_GC_INTERVAL 12
|
||||
#define BRCTL_GET_PORT_INFO 13
|
||||
#define BRCTL_SET_BRIDGE_STP_STATE 14
|
||||
#define BRCTL_SET_BRIDGE_PRIORITY 15
|
||||
#define BRCTL_SET_PORT_PRIORITY 16
|
||||
#define BRCTL_SET_PATH_COST 17
|
||||
#define BRCTL_GET_FDB_ENTRIES 18
|
||||
|
||||
#define BR_STATE_DISABLED 0
|
||||
#define BR_STATE_LISTENING 1
|
||||
#define BR_STATE_LEARNING 2
|
||||
#define BR_STATE_FORWARDING 3
|
||||
#define BR_STATE_BLOCKING 4
|
||||
|
||||
struct __bridge_info {
|
||||
__u64 designated_root;
|
||||
__u64 bridge_id;
|
||||
__u32 root_path_cost;
|
||||
__u32 max_age;
|
||||
__u32 hello_time;
|
||||
__u32 forward_delay;
|
||||
__u32 bridge_max_age;
|
||||
__u32 bridge_hello_time;
|
||||
__u32 bridge_forward_delay;
|
||||
__u8 topology_change;
|
||||
__u8 topology_change_detected;
|
||||
__u8 root_port;
|
||||
__u8 stp_enabled;
|
||||
__u32 ageing_time;
|
||||
__u32 gc_interval;
|
||||
__u32 hello_timer_value;
|
||||
__u32 tcn_timer_value;
|
||||
__u32 topology_change_timer_value;
|
||||
__u32 gc_timer_value;
|
||||
};
|
||||
|
||||
struct __port_info {
|
||||
__u64 designated_root;
|
||||
__u64 designated_bridge;
|
||||
__u16 port_id;
|
||||
__u16 designated_port;
|
||||
__u32 path_cost;
|
||||
__u32 designated_cost;
|
||||
__u8 state;
|
||||
__u8 top_change_ack;
|
||||
__u8 config_pending;
|
||||
__u8 unused0;
|
||||
__u32 message_age_timer_value;
|
||||
__u32 forward_delay_timer_value;
|
||||
__u32 hold_timer_value;
|
||||
};
|
||||
|
||||
struct __fdb_entry {
|
||||
__u8 mac_addr[6];
|
||||
__u8 port_no;
|
||||
__u8 is_local;
|
||||
__u32 ageing_timer_value;
|
||||
__u8 port_hi;
|
||||
__u8 pad0;
|
||||
__u16 unused;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <uapi/linux/if_bridge.h>
|
||||
|
||||
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
|
||||
|
||||
|
@ -107,5 +22,3 @@ typedef int br_should_route_hook_t(struct sk_buff *skb);
|
|||
extern br_should_route_hook_t __rcu *br_should_route_hook;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,28 +15,13 @@
|
|||
* McLean VA 22101
|
||||
* Phone: 1-703-847-0040 ext 103
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IF_EQL_H
|
||||
#define _LINUX_IF_EQL_H
|
||||
|
||||
#define EQL_DEFAULT_SLAVE_PRIORITY 28800
|
||||
#define EQL_DEFAULT_MAX_SLAVES 4
|
||||
#define EQL_DEFAULT_MTU 576
|
||||
#define EQL_DEFAULT_RESCHED_IVAL HZ
|
||||
|
||||
#define EQL_ENSLAVE (SIOCDEVPRIVATE)
|
||||
#define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)
|
||||
|
||||
#define EQL_GETSLAVECFG (SIOCDEVPRIVATE + 2)
|
||||
#define EQL_SETSLAVECFG (SIOCDEVPRIVATE + 3)
|
||||
|
||||
#define EQL_GETMASTRCFG (SIOCDEVPRIVATE + 4)
|
||||
#define EQL_SETMASTRCFG (SIOCDEVPRIVATE + 5)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/timer.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <uapi/linux/if_eql.h>
|
||||
|
||||
typedef struct slave {
|
||||
struct list_head list;
|
||||
|
@ -61,23 +46,4 @@ typedef struct equalizer {
|
|||
struct timer_list timer;
|
||||
} equalizer_t;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
typedef struct master_config {
|
||||
char master_name[16];
|
||||
int max_slaves;
|
||||
int min_slaves;
|
||||
} master_config_t;
|
||||
|
||||
typedef struct slave_config {
|
||||
char slave_name[16];
|
||||
long priority;
|
||||
} slave_config_t;
|
||||
|
||||
typedef struct slaving_request {
|
||||
char slave_name[16];
|
||||
long priority;
|
||||
} slaving_request_t;
|
||||
|
||||
|
||||
#endif /* _LINUX_EQL_H */
|
||||
|
|
|
@ -17,122 +17,11 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IF_ETHER_H
|
||||
#define _LINUX_IF_ETHER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
|
||||
* and FCS/CRC (frame check sequence).
|
||||
*/
|
||||
|
||||
#define ETH_ALEN 6 /* Octets in one ethernet addr */
|
||||
#define ETH_HLEN 14 /* Total octets in header. */
|
||||
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
|
||||
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
|
||||
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
|
||||
#define ETH_FCS_LEN 4 /* Octets in the FCS */
|
||||
|
||||
/*
|
||||
* These are the defined Ethernet Protocol ID's.
|
||||
*/
|
||||
|
||||
#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
|
||||
#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
|
||||
#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
|
||||
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
|
||||
#define ETH_P_X25 0x0805 /* CCITT X.25 */
|
||||
#define ETH_P_ARP 0x0806 /* Address Resolution packet */
|
||||
#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
|
||||
#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
|
||||
#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
|
||||
#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
|
||||
#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
|
||||
#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
|
||||
#define ETH_P_LAT 0x6004 /* DEC LAT */
|
||||
#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
|
||||
#define ETH_P_CUST 0x6006 /* DEC Customer use */
|
||||
#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
|
||||
#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
|
||||
#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
|
||||
#define ETH_P_ATALK 0x809B /* Appletalk DDP */
|
||||
#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
|
||||
#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
|
||||
#define ETH_P_IPX 0x8137 /* IPX over DIX */
|
||||
#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
|
||||
#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
|
||||
#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
|
||||
#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
|
||||
* defined in draft-wilson-wrec-wccp-v2-00.txt */
|
||||
#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
|
||||
#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
|
||||
#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
|
||||
#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
|
||||
#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
|
||||
#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
|
||||
#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
|
||||
* over Ethernet
|
||||
*/
|
||||
#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
|
||||
#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
|
||||
#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
|
||||
#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
|
||||
#define ETH_P_TIPC 0x88CA /* TIPC */
|
||||
#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
|
||||
#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
|
||||
#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
|
||||
#define ETH_P_TDLS 0x890D /* TDLS */
|
||||
#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
|
||||
#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
|
||||
/*
|
||||
* Non DIX types. Won't clash for 1500 types.
|
||||
*/
|
||||
|
||||
#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
|
||||
#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
|
||||
#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
|
||||
#define ETH_P_802_2 0x0004 /* 802.2 frames */
|
||||
#define ETH_P_SNAP 0x0005 /* Internal only */
|
||||
#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
|
||||
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
|
||||
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
|
||||
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
|
||||
#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
|
||||
#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
|
||||
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
|
||||
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
|
||||
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
|
||||
#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
|
||||
#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
|
||||
#define ETH_P_ECONET 0x0018 /* Acorn Econet */
|
||||
#define ETH_P_HDLC 0x0019 /* HDLC frames */
|
||||
#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
|
||||
#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
|
||||
#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
|
||||
#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
|
||||
#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
|
||||
#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
|
||||
|
||||
/*
|
||||
* This is an Ethernet frame header.
|
||||
*/
|
||||
|
||||
struct ethhdr {
|
||||
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
|
||||
unsigned char h_source[ETH_ALEN]; /* source ether addr */
|
||||
__be16 h_proto; /* packet type ID field */
|
||||
} __attribute__((packed));
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/if_ether.h>
|
||||
|
||||
static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
|
@ -144,6 +33,4 @@ int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
|
|||
int mac_pton(const char *s, u8 *mac);
|
||||
extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_IF_ETHER_H */
|
||||
|
|
|
@ -24,84 +24,8 @@
|
|||
#ifndef _LINUX_IF_FDDI_H
|
||||
#define _LINUX_IF_FDDI_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Define max and min legal sizes. The frame sizes do not include
|
||||
* 4 byte FCS/CRC (frame check sequence).
|
||||
*/
|
||||
#define FDDI_K_ALEN 6 /* Octets in one FDDI address */
|
||||
#define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */
|
||||
#define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */
|
||||
#define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */
|
||||
#define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */
|
||||
#define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */
|
||||
#define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */
|
||||
#define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */
|
||||
#define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */
|
||||
|
||||
/* Define FDDI Frame Control (FC) Byte values */
|
||||
#define FDDI_FC_K_VOID 0x00
|
||||
#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80
|
||||
#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0
|
||||
#define FDDI_FC_K_SMT_MIN 0x41
|
||||
#define FDDI_FC_K_SMT_MAX 0x4F
|
||||
#define FDDI_FC_K_MAC_MIN 0xC1
|
||||
#define FDDI_FC_K_MAC_MAX 0xCF
|
||||
#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
|
||||
#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
|
||||
#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
|
||||
#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
|
||||
#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
|
||||
#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
|
||||
#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
|
||||
#define FDDI_FC_K_RESERVED_MIN 0x70
|
||||
#define FDDI_FC_K_RESERVED_MAX 0x7F
|
||||
|
||||
/* Define LLC and SNAP constants */
|
||||
#define FDDI_EXTENDED_SAP 0xAA
|
||||
#define FDDI_UI_CMD 0x03
|
||||
|
||||
/* Define 802.2 Type 1 header */
|
||||
struct fddi_8022_1_hdr {
|
||||
__u8 dsap; /* destination service access point */
|
||||
__u8 ssap; /* source service access point */
|
||||
__u8 ctrl; /* control byte #1 */
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Define 802.2 Type 2 header */
|
||||
struct fddi_8022_2_hdr {
|
||||
__u8 dsap; /* destination service access point */
|
||||
__u8 ssap; /* source service access point */
|
||||
__u8 ctrl_1; /* control byte #1 */
|
||||
__u8 ctrl_2; /* control byte #2 */
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Define 802.2 SNAP header */
|
||||
#define FDDI_K_OUI_LEN 3
|
||||
struct fddi_snap_hdr {
|
||||
__u8 dsap; /* always 0xAA */
|
||||
__u8 ssap; /* always 0xAA */
|
||||
__u8 ctrl; /* always 0x03 */
|
||||
__u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
|
||||
__be16 ethertype; /* packet type ID field */
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Define FDDI LLC frame header */
|
||||
struct fddihdr {
|
||||
__u8 fc; /* frame control */
|
||||
__u8 daddr[FDDI_K_ALEN]; /* destination address */
|
||||
__u8 saddr[FDDI_K_ALEN]; /* source address */
|
||||
union
|
||||
{
|
||||
struct fddi_8022_1_hdr llc_8022_1;
|
||||
struct fddi_8022_2_hdr llc_8022_2;
|
||||
struct fddi_snap_hdr llc_snap;
|
||||
} hdr;
|
||||
} __attribute__((packed));
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/netdevice.h>
|
||||
#include <uapi/linux/if_fddi.h>
|
||||
|
||||
/* Define FDDI statistics structure */
|
||||
struct fddi_statistics {
|
||||
|
@ -194,6 +118,4 @@ struct fddi_statistics {
|
|||
__u32 port_ler_flag[2];
|
||||
__u32 port_hardware_present[2];
|
||||
};
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_IF_FDDI_H */
|
||||
|
|
|
@ -20,105 +20,11 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _FRAD_H_
|
||||
#define _FRAD_H_
|
||||
|
||||
#include <linux/if.h>
|
||||
#include <uapi/linux/if_frad.h>
|
||||
|
||||
/* Structures and constants associated with the DLCI device driver */
|
||||
|
||||
struct dlci_add
|
||||
{
|
||||
char devname[IFNAMSIZ];
|
||||
short dlci;
|
||||
};
|
||||
|
||||
#define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
|
||||
#define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
|
||||
|
||||
/*
|
||||
* These are related to the Sangoma SDLA and should remain in order.
|
||||
* Code within the SDLA module is based on the specifics of this
|
||||
* structure. Change at your own peril.
|
||||
*/
|
||||
struct dlci_conf {
|
||||
short flags;
|
||||
short CIR_fwd;
|
||||
short Bc_fwd;
|
||||
short Be_fwd;
|
||||
short CIR_bwd;
|
||||
short Bc_bwd;
|
||||
short Be_bwd;
|
||||
|
||||
/* these are part of the status read */
|
||||
short Tc_fwd;
|
||||
short Tc_bwd;
|
||||
short Tf_max;
|
||||
short Tb_max;
|
||||
|
||||
/* add any new fields here above is a mirror of sdla_dlci_conf */
|
||||
};
|
||||
|
||||
#define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
|
||||
|
||||
/* configuration flags for DLCI */
|
||||
#define DLCI_IGNORE_CIR_OUT 0x0001
|
||||
#define DLCI_ACCOUNT_CIR_IN 0x0002
|
||||
#define DLCI_BUFFER_IF 0x0008
|
||||
|
||||
#define DLCI_VALID_FLAGS 0x000B
|
||||
|
||||
/* defines for the actual Frame Relay hardware */
|
||||
#define FRAD_GET_CONF (SIOCDEVPRIVATE)
|
||||
#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
|
||||
|
||||
#define FRAD_LAST_IOCTL FRAD_SET_CONF
|
||||
|
||||
/*
|
||||
* Based on the setup for the Sangoma SDLA. If changes are
|
||||
* necessary to this structure, a routine will need to be
|
||||
* added to that module to copy fields.
|
||||
*/
|
||||
struct frad_conf
|
||||
{
|
||||
short station;
|
||||
short flags;
|
||||
short kbaud;
|
||||
short clocking;
|
||||
short mtu;
|
||||
short T391;
|
||||
short T392;
|
||||
short N391;
|
||||
short N392;
|
||||
short N393;
|
||||
short CIR_fwd;
|
||||
short Bc_fwd;
|
||||
short Be_fwd;
|
||||
short CIR_bwd;
|
||||
short Bc_bwd;
|
||||
short Be_bwd;
|
||||
|
||||
/* Add new fields here, above is a mirror of the sdla_conf */
|
||||
|
||||
};
|
||||
|
||||
#define FRAD_STATION_CPE 0x0000
|
||||
#define FRAD_STATION_NODE 0x0001
|
||||
|
||||
#define FRAD_TX_IGNORE_CIR 0x0001
|
||||
#define FRAD_RX_ACCOUNT_CIR 0x0002
|
||||
#define FRAD_DROP_ABORTED 0x0004
|
||||
#define FRAD_BUFFERIF 0x0008
|
||||
#define FRAD_STATS 0x0010
|
||||
#define FRAD_MCI 0x0100
|
||||
#define FRAD_AUTODLCI 0x8000
|
||||
#define FRAD_VALID_FLAGS 0x811F
|
||||
|
||||
#define FRAD_CLOCK_INT 0x0001
|
||||
#define FRAD_CLOCK_EXT 0x0000
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
|
||||
|
||||
|
@ -188,6 +94,4 @@ struct frad_local
|
|||
|
||||
extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *));
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,341 +1,8 @@
|
|||
#ifndef _LINUX_IF_LINK_H
|
||||
#define _LINUX_IF_LINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <uapi/linux/if_link.h>
|
||||
|
||||
/* This struct should be in sync with struct rtnl_link_stats64 */
|
||||
struct rtnl_link_stats {
|
||||
__u32 rx_packets; /* total packets received */
|
||||
__u32 tx_packets; /* total packets transmitted */
|
||||
__u32 rx_bytes; /* total bytes received */
|
||||
__u32 tx_bytes; /* total bytes transmitted */
|
||||
__u32 rx_errors; /* bad packets received */
|
||||
__u32 tx_errors; /* packet transmit problems */
|
||||
__u32 rx_dropped; /* no space in linux buffers */
|
||||
__u32 tx_dropped; /* no space available in linux */
|
||||
__u32 multicast; /* multicast packets received */
|
||||
__u32 collisions;
|
||||
|
||||
/* detailed rx_errors: */
|
||||
__u32 rx_length_errors;
|
||||
__u32 rx_over_errors; /* receiver ring buff overflow */
|
||||
__u32 rx_crc_errors; /* recved pkt with crc error */
|
||||
__u32 rx_frame_errors; /* recv'd frame alignment error */
|
||||
__u32 rx_fifo_errors; /* recv'r fifo overrun */
|
||||
__u32 rx_missed_errors; /* receiver missed packet */
|
||||
|
||||
/* detailed tx_errors */
|
||||
__u32 tx_aborted_errors;
|
||||
__u32 tx_carrier_errors;
|
||||
__u32 tx_fifo_errors;
|
||||
__u32 tx_heartbeat_errors;
|
||||
__u32 tx_window_errors;
|
||||
|
||||
/* for cslip etc */
|
||||
__u32 rx_compressed;
|
||||
__u32 tx_compressed;
|
||||
};
|
||||
|
||||
/* The main device statistics structure */
|
||||
struct rtnl_link_stats64 {
|
||||
__u64 rx_packets; /* total packets received */
|
||||
__u64 tx_packets; /* total packets transmitted */
|
||||
__u64 rx_bytes; /* total bytes received */
|
||||
__u64 tx_bytes; /* total bytes transmitted */
|
||||
__u64 rx_errors; /* bad packets received */
|
||||
__u64 tx_errors; /* packet transmit problems */
|
||||
__u64 rx_dropped; /* no space in linux buffers */
|
||||
__u64 tx_dropped; /* no space available in linux */
|
||||
__u64 multicast; /* multicast packets received */
|
||||
__u64 collisions;
|
||||
|
||||
/* detailed rx_errors: */
|
||||
__u64 rx_length_errors;
|
||||
__u64 rx_over_errors; /* receiver ring buff overflow */
|
||||
__u64 rx_crc_errors; /* recved pkt with crc error */
|
||||
__u64 rx_frame_errors; /* recv'd frame alignment error */
|
||||
__u64 rx_fifo_errors; /* recv'r fifo overrun */
|
||||
__u64 rx_missed_errors; /* receiver missed packet */
|
||||
|
||||
/* detailed tx_errors */
|
||||
__u64 tx_aborted_errors;
|
||||
__u64 tx_carrier_errors;
|
||||
__u64 tx_fifo_errors;
|
||||
__u64 tx_heartbeat_errors;
|
||||
__u64 tx_window_errors;
|
||||
|
||||
/* for cslip etc */
|
||||
__u64 rx_compressed;
|
||||
__u64 tx_compressed;
|
||||
};
|
||||
|
||||
/* The struct should be in sync with struct ifmap */
|
||||
struct rtnl_link_ifmap {
|
||||
__u64 mem_start;
|
||||
__u64 mem_end;
|
||||
__u64 base_addr;
|
||||
__u16 irq;
|
||||
__u8 dma;
|
||||
__u8 port;
|
||||
};
|
||||
|
||||
/*
|
||||
* IFLA_AF_SPEC
|
||||
* Contains nested attributes for address family specific attributes.
|
||||
* Each address family may create a attribute with the address family
|
||||
* number as type and create its own attribute structure in it.
|
||||
*
|
||||
* Example:
|
||||
* [IFLA_AF_SPEC] = {
|
||||
* [AF_INET] = {
|
||||
* [IFLA_INET_CONF] = ...,
|
||||
* },
|
||||
* [AF_INET6] = {
|
||||
* [IFLA_INET6_FLAGS] = ...,
|
||||
* [IFLA_INET6_CONF] = ...,
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
enum {
|
||||
IFLA_UNSPEC,
|
||||
IFLA_ADDRESS,
|
||||
IFLA_BROADCAST,
|
||||
IFLA_IFNAME,
|
||||
IFLA_MTU,
|
||||
IFLA_LINK,
|
||||
IFLA_QDISC,
|
||||
IFLA_STATS,
|
||||
IFLA_COST,
|
||||
#define IFLA_COST IFLA_COST
|
||||
IFLA_PRIORITY,
|
||||
#define IFLA_PRIORITY IFLA_PRIORITY
|
||||
IFLA_MASTER,
|
||||
#define IFLA_MASTER IFLA_MASTER
|
||||
IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
|
||||
#define IFLA_WIRELESS IFLA_WIRELESS
|
||||
IFLA_PROTINFO, /* Protocol specific information for a link */
|
||||
#define IFLA_PROTINFO IFLA_PROTINFO
|
||||
IFLA_TXQLEN,
|
||||
#define IFLA_TXQLEN IFLA_TXQLEN
|
||||
IFLA_MAP,
|
||||
#define IFLA_MAP IFLA_MAP
|
||||
IFLA_WEIGHT,
|
||||
#define IFLA_WEIGHT IFLA_WEIGHT
|
||||
IFLA_OPERSTATE,
|
||||
IFLA_LINKMODE,
|
||||
IFLA_LINKINFO,
|
||||
#define IFLA_LINKINFO IFLA_LINKINFO
|
||||
IFLA_NET_NS_PID,
|
||||
IFLA_IFALIAS,
|
||||
IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
|
||||
IFLA_VFINFO_LIST,
|
||||
IFLA_STATS64,
|
||||
IFLA_VF_PORTS,
|
||||
IFLA_PORT_SELF,
|
||||
IFLA_AF_SPEC,
|
||||
IFLA_GROUP, /* Group the device belongs to */
|
||||
IFLA_NET_NS_FD,
|
||||
IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
|
||||
IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
|
||||
#define IFLA_PROMISCUITY IFLA_PROMISCUITY
|
||||
IFLA_NUM_TX_QUEUES,
|
||||
IFLA_NUM_RX_QUEUES,
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
||||
#define IFLA_MAX (__IFLA_MAX - 1)
|
||||
|
||||
/* backwards compatibility for userspace */
|
||||
#ifndef __KERNEL__
|
||||
#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
|
||||
#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
|
||||
#endif
|
||||
|
||||
enum {
|
||||
IFLA_INET_UNSPEC,
|
||||
IFLA_INET_CONF,
|
||||
__IFLA_INET_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
|
||||
|
||||
/* ifi_flags.
|
||||
|
||||
IFF_* flags.
|
||||
|
||||
The only change is:
|
||||
IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
|
||||
more not changeable by user. They describe link media
|
||||
characteristics and set by device driver.
|
||||
|
||||
Comments:
|
||||
- Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
|
||||
- If neither of these three flags are set;
|
||||
the interface is NBMA.
|
||||
|
||||
- IFF_MULTICAST does not mean anything special:
|
||||
multicasts can be used on all not-NBMA links.
|
||||
IFF_MULTICAST means that this media uses special encapsulation
|
||||
for multicast frames. Apparently, all IFF_POINTOPOINT and
|
||||
IFF_BROADCAST devices are able to use multicasts too.
|
||||
*/
|
||||
|
||||
/* IFLA_LINK.
|
||||
For usual devices it is equal ifi_index.
|
||||
If it is a "virtual interface" (f.e. tunnel), ifi_link
|
||||
can point to real physical interface (f.e. for bandwidth calculations),
|
||||
or maybe 0, what means, that real media is unknown (usual
|
||||
for IPIP tunnels, when route to endpoint is allowed to change)
|
||||
*/
|
||||
|
||||
/* Subtype attributes for IFLA_PROTINFO */
|
||||
enum {
|
||||
IFLA_INET6_UNSPEC,
|
||||
IFLA_INET6_FLAGS, /* link flags */
|
||||
IFLA_INET6_CONF, /* sysctl parameters */
|
||||
IFLA_INET6_STATS, /* statistics */
|
||||
IFLA_INET6_MCAST, /* MC things. What of them? */
|
||||
IFLA_INET6_CACHEINFO, /* time values and max reasm size */
|
||||
IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
|
||||
__IFLA_INET6_MAX
|
||||
};
|
||||
|
||||
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
|
||||
|
||||
struct ifla_cacheinfo {
|
||||
__u32 max_reasm_len;
|
||||
__u32 tstamp; /* ipv6InterfaceTable updated timestamp */
|
||||
__u32 reachable_time;
|
||||
__u32 retrans_time;
|
||||
};
|
||||
|
||||
enum {
|
||||
IFLA_INFO_UNSPEC,
|
||||
IFLA_INFO_KIND,
|
||||
IFLA_INFO_DATA,
|
||||
IFLA_INFO_XSTATS,
|
||||
__IFLA_INFO_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
|
||||
|
||||
/* VLAN section */
|
||||
|
||||
enum {
|
||||
IFLA_VLAN_UNSPEC,
|
||||
IFLA_VLAN_ID,
|
||||
IFLA_VLAN_FLAGS,
|
||||
IFLA_VLAN_EGRESS_QOS,
|
||||
IFLA_VLAN_INGRESS_QOS,
|
||||
__IFLA_VLAN_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
|
||||
|
||||
struct ifla_vlan_flags {
|
||||
__u32 flags;
|
||||
__u32 mask;
|
||||
};
|
||||
|
||||
enum {
|
||||
IFLA_VLAN_QOS_UNSPEC,
|
||||
IFLA_VLAN_QOS_MAPPING,
|
||||
__IFLA_VLAN_QOS_MAX
|
||||
};
|
||||
|
||||
#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
|
||||
|
||||
struct ifla_vlan_qos_mapping {
|
||||
__u32 from;
|
||||
__u32 to;
|
||||
};
|
||||
|
||||
/* MACVLAN section */
|
||||
enum {
|
||||
IFLA_MACVLAN_UNSPEC,
|
||||
IFLA_MACVLAN_MODE,
|
||||
IFLA_MACVLAN_FLAGS,
|
||||
__IFLA_MACVLAN_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
|
||||
|
||||
enum macvlan_mode {
|
||||
MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
|
||||
MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
|
||||
MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
|
||||
MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
|
||||
};
|
||||
|
||||
#define MACVLAN_FLAG_NOPROMISC 1
|
||||
|
||||
/* VXLAN section */
|
||||
enum {
|
||||
IFLA_VXLAN_UNSPEC,
|
||||
IFLA_VXLAN_ID,
|
||||
IFLA_VXLAN_GROUP,
|
||||
IFLA_VXLAN_LINK,
|
||||
IFLA_VXLAN_LOCAL,
|
||||
IFLA_VXLAN_TTL,
|
||||
IFLA_VXLAN_TOS,
|
||||
IFLA_VXLAN_LEARNING,
|
||||
IFLA_VXLAN_AGEING,
|
||||
IFLA_VXLAN_LIMIT,
|
||||
IFLA_VXLAN_PORT_RANGE,
|
||||
__IFLA_VXLAN_MAX
|
||||
};
|
||||
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
|
||||
|
||||
struct ifla_vxlan_port_range {
|
||||
__be16 low;
|
||||
__be16 high;
|
||||
};
|
||||
|
||||
/* SR-IOV virtual function management section */
|
||||
|
||||
enum {
|
||||
IFLA_VF_INFO_UNSPEC,
|
||||
IFLA_VF_INFO,
|
||||
__IFLA_VF_INFO_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
|
||||
|
||||
enum {
|
||||
IFLA_VF_UNSPEC,
|
||||
IFLA_VF_MAC, /* Hardware queue specific attributes */
|
||||
IFLA_VF_VLAN,
|
||||
IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
|
||||
IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
|
||||
__IFLA_VF_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
|
||||
|
||||
struct ifla_vf_mac {
|
||||
__u32 vf;
|
||||
__u8 mac[32]; /* MAX_ADDR_LEN */
|
||||
};
|
||||
|
||||
struct ifla_vf_vlan {
|
||||
__u32 vf;
|
||||
__u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
|
||||
__u32 qos;
|
||||
};
|
||||
|
||||
struct ifla_vf_tx_rate {
|
||||
__u32 vf;
|
||||
__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
|
||||
};
|
||||
|
||||
struct ifla_vf_spoofchk {
|
||||
__u32 vf;
|
||||
__u32 setting;
|
||||
};
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* We don't want this structure exposed to user space */
|
||||
struct ifla_vf_info {
|
||||
|
@ -346,96 +13,4 @@ struct ifla_vf_info {
|
|||
__u32 tx_rate;
|
||||
__u32 spoofchk;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* VF ports management section
|
||||
*
|
||||
* Nested layout of set/get msg is:
|
||||
*
|
||||
* [IFLA_NUM_VF]
|
||||
* [IFLA_VF_PORTS]
|
||||
* [IFLA_VF_PORT]
|
||||
* [IFLA_PORT_*], ...
|
||||
* [IFLA_VF_PORT]
|
||||
* [IFLA_PORT_*], ...
|
||||
* ...
|
||||
* [IFLA_PORT_SELF]
|
||||
* [IFLA_PORT_*], ...
|
||||
*/
|
||||
|
||||
enum {
|
||||
IFLA_VF_PORT_UNSPEC,
|
||||
IFLA_VF_PORT, /* nest */
|
||||
__IFLA_VF_PORT_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
|
||||
|
||||
enum {
|
||||
IFLA_PORT_UNSPEC,
|
||||
IFLA_PORT_VF, /* __u32 */
|
||||
IFLA_PORT_PROFILE, /* string */
|
||||
IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
|
||||
IFLA_PORT_INSTANCE_UUID, /* binary UUID */
|
||||
IFLA_PORT_HOST_UUID, /* binary UUID */
|
||||
IFLA_PORT_REQUEST, /* __u8 */
|
||||
IFLA_PORT_RESPONSE, /* __u16, output only */
|
||||
__IFLA_PORT_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
|
||||
|
||||
#define PORT_PROFILE_MAX 40
|
||||
#define PORT_UUID_MAX 16
|
||||
#define PORT_SELF_VF -1
|
||||
|
||||
enum {
|
||||
PORT_REQUEST_PREASSOCIATE = 0,
|
||||
PORT_REQUEST_PREASSOCIATE_RR,
|
||||
PORT_REQUEST_ASSOCIATE,
|
||||
PORT_REQUEST_DISASSOCIATE,
|
||||
};
|
||||
|
||||
enum {
|
||||
PORT_VDP_RESPONSE_SUCCESS = 0,
|
||||
PORT_VDP_RESPONSE_INVALID_FORMAT,
|
||||
PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
|
||||
PORT_VDP_RESPONSE_UNUSED_VTID,
|
||||
PORT_VDP_RESPONSE_VTID_VIOLATION,
|
||||
PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
|
||||
PORT_VDP_RESPONSE_OUT_OF_SYNC,
|
||||
/* 0x08-0xFF reserved for future VDP use */
|
||||
PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
|
||||
PORT_PROFILE_RESPONSE_INPROGRESS,
|
||||
PORT_PROFILE_RESPONSE_INVALID,
|
||||
PORT_PROFILE_RESPONSE_BADSTATE,
|
||||
PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
|
||||
PORT_PROFILE_RESPONSE_ERROR,
|
||||
};
|
||||
|
||||
struct ifla_port_vsi {
|
||||
__u8 vsi_mgr_id;
|
||||
__u8 vsi_type_id[3];
|
||||
__u8 vsi_type_version;
|
||||
__u8 pad[3];
|
||||
};
|
||||
|
||||
|
||||
/* IPoIB section */
|
||||
|
||||
enum {
|
||||
IFLA_IPOIB_UNSPEC,
|
||||
IFLA_IPOIB_PKEY,
|
||||
IFLA_IPOIB_MODE,
|
||||
IFLA_IPOIB_UMCAST,
|
||||
__IFLA_IPOIB_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
|
||||
IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
|
||||
};
|
||||
|
||||
#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
|
||||
|
||||
#endif /* _LINUX_IF_LINK_H */
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
#ifndef __LINUX_LTALK_H
|
||||
#define __LINUX_LTALK_H
|
||||
|
||||
#define LTALK_HLEN 1
|
||||
#define LTALK_MTU 600
|
||||
#define LTALK_ALEN 1
|
||||
#include <uapi/linux/if_ltalk.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern struct net_device *alloc_ltalkdev(int sizeof_priv);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,12 +8,7 @@
|
|||
#ifndef LINUX_IF_PHONET_H
|
||||
#define LINUX_IF_PHONET_H
|
||||
|
||||
#define PHONET_MIN_MTU 6 /* pn_length = 0 */
|
||||
#define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */
|
||||
#define PHONET_DEV_MTU PHONET_MAX_MTU
|
||||
#include <uapi/linux/if_phonet.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern struct header_ops phonet_header_ops;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,98 +11,11 @@
|
|||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IF_PPPOL2TP_H
|
||||
#define __LINUX_IF_PPPOL2TP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
#endif
|
||||
|
||||
/* Structure used to connect() the socket to a particular tunnel UDP
|
||||
* socket over IPv4.
|
||||
*/
|
||||
struct pppol2tp_addr {
|
||||
__kernel_pid_t pid; /* pid that owns the fd.
|
||||
* 0 => current */
|
||||
int fd; /* FD of UDP socket to use */
|
||||
|
||||
struct sockaddr_in addr; /* IP address and port to send to */
|
||||
|
||||
__u16 s_tunnel, s_session; /* For matching incoming packets */
|
||||
__u16 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
};
|
||||
|
||||
/* Structure used to connect() the socket to a particular tunnel UDP
|
||||
* socket over IPv6.
|
||||
*/
|
||||
struct pppol2tpin6_addr {
|
||||
__kernel_pid_t pid; /* pid that owns the fd.
|
||||
* 0 => current */
|
||||
int fd; /* FD of UDP socket to use */
|
||||
|
||||
__u16 s_tunnel, s_session; /* For matching incoming packets */
|
||||
__u16 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
|
||||
struct sockaddr_in6 addr; /* IP address and port to send to */
|
||||
};
|
||||
|
||||
/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
|
||||
* bits. So we need a different sockaddr structure.
|
||||
*/
|
||||
struct pppol2tpv3_addr {
|
||||
__kernel_pid_t pid; /* pid that owns the fd.
|
||||
* 0 => current */
|
||||
int fd; /* FD of UDP or IP socket to use */
|
||||
|
||||
struct sockaddr_in addr; /* IP address and port to send to */
|
||||
|
||||
__u32 s_tunnel, s_session; /* For matching incoming packets */
|
||||
__u32 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
};
|
||||
|
||||
struct pppol2tpv3in6_addr {
|
||||
__kernel_pid_t pid; /* pid that owns the fd.
|
||||
* 0 => current */
|
||||
int fd; /* FD of UDP or IP socket to use */
|
||||
|
||||
__u32 s_tunnel, s_session; /* For matching incoming packets */
|
||||
__u32 d_tunnel, d_session; /* For sending outgoing packets */
|
||||
|
||||
struct sockaddr_in6 addr; /* IP address and port to send to */
|
||||
};
|
||||
|
||||
/* Socket options:
|
||||
* DEBUG - bitmask of debug message categories
|
||||
* SENDSEQ - 0 => don't send packets with sequence numbers
|
||||
* 1 => send packets with sequence numbers
|
||||
* RECVSEQ - 0 => receive packet sequence numbers are optional
|
||||
* 1 => drop receive packets without sequence numbers
|
||||
* LNSMODE - 0 => act as LAC.
|
||||
* 1 => act as LNS.
|
||||
* REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
|
||||
*/
|
||||
enum {
|
||||
PPPOL2TP_SO_DEBUG = 1,
|
||||
PPPOL2TP_SO_RECVSEQ = 2,
|
||||
PPPOL2TP_SO_SENDSEQ = 3,
|
||||
PPPOL2TP_SO_LNSMODE = 4,
|
||||
PPPOL2TP_SO_REORDERTO = 5,
|
||||
};
|
||||
|
||||
/* Debug message categories for the DEBUG socket option */
|
||||
enum {
|
||||
PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
|
||||
* compiled in) */
|
||||
PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
|
||||
* interface */
|
||||
PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
|
||||
PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
|
||||
};
|
||||
|
||||
|
||||
#include <uapi/linux/if_pppol2tp.h>
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,153 +12,14 @@
|
|||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IF_PPPOX_H
|
||||
#define __LINUX_IF_PPPOX_H
|
||||
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#include <linux/socket.h>
|
||||
#include <linux/if_ether.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/if.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/ppp_channel.h>
|
||||
#endif /* __KERNEL__ */
|
||||
#include <linux/if_pppol2tp.h>
|
||||
|
||||
/* For user-space programs to pick up these definitions
|
||||
* which they wouldn't get otherwise without defining __KERNEL__
|
||||
*/
|
||||
#ifndef AF_PPPOX
|
||||
#define AF_PPPOX 24
|
||||
#define PF_PPPOX AF_PPPOX
|
||||
#endif /* !(AF_PPPOX) */
|
||||
|
||||
/************************************************************************
|
||||
* PPPoE addressing definition
|
||||
*/
|
||||
typedef __be16 sid_t;
|
||||
struct pppoe_addr {
|
||||
sid_t sid; /* Session identifier */
|
||||
unsigned char remote[ETH_ALEN]; /* Remote address */
|
||||
char dev[IFNAMSIZ]; /* Local device to use */
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* PPTP addressing definition
|
||||
*/
|
||||
struct pptp_addr {
|
||||
__be16 call_id;
|
||||
struct in_addr sin_addr;
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* Protocols supported by AF_PPPOX
|
||||
*/
|
||||
#define PX_PROTO_OE 0 /* Currently just PPPoE */
|
||||
#define PX_PROTO_OL2TP 1 /* Now L2TP also */
|
||||
#define PX_PROTO_PPTP 2
|
||||
#define PX_MAX_PROTO 3
|
||||
|
||||
struct sockaddr_pppox {
|
||||
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
union {
|
||||
struct pppoe_addr pppoe;
|
||||
struct pptp_addr pptp;
|
||||
} sa_addr;
|
||||
} __packed;
|
||||
|
||||
/* The use of the above union isn't viable because the size of this
|
||||
* struct must stay fixed over time -- applications use sizeof(struct
|
||||
* sockaddr_pppox) to fill it. We use a protocol specific sockaddr
|
||||
* type instead.
|
||||
*/
|
||||
struct sockaddr_pppol2tp {
|
||||
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
struct pppol2tp_addr pppol2tp;
|
||||
} __packed;
|
||||
|
||||
struct sockaddr_pppol2tpin6 {
|
||||
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
struct pppol2tpin6_addr pppol2tp;
|
||||
} __packed;
|
||||
|
||||
/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
|
||||
* bits. So we need a different sockaddr structure.
|
||||
*/
|
||||
struct sockaddr_pppol2tpv3 {
|
||||
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
struct pppol2tpv3_addr pppol2tp;
|
||||
} __packed;
|
||||
|
||||
struct sockaddr_pppol2tpv3in6 {
|
||||
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
|
||||
unsigned int sa_protocol; /* protocol identifier */
|
||||
struct pppol2tpv3in6_addr pppol2tp;
|
||||
} __packed;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* ioctl interface for defining forwarding of connections
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
|
||||
#define PPPOEIOCDFWD _IO(0xB1 ,1)
|
||||
/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
|
||||
|
||||
/* Codes to identify message types */
|
||||
#define PADI_CODE 0x09
|
||||
#define PADO_CODE 0x07
|
||||
#define PADR_CODE 0x19
|
||||
#define PADS_CODE 0x65
|
||||
#define PADT_CODE 0xa7
|
||||
struct pppoe_tag {
|
||||
__be16 tag_type;
|
||||
__be16 tag_len;
|
||||
char tag_data[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Tag identifiers */
|
||||
#define PTT_EOL __cpu_to_be16(0x0000)
|
||||
#define PTT_SRV_NAME __cpu_to_be16(0x0101)
|
||||
#define PTT_AC_NAME __cpu_to_be16(0x0102)
|
||||
#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
|
||||
#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
|
||||
#define PTT_VENDOR __cpu_to_be16(0x0105)
|
||||
#define PTT_RELAY_SID __cpu_to_be16(0x0110)
|
||||
#define PTT_SRV_ERR __cpu_to_be16(0x0201)
|
||||
#define PTT_SYS_ERR __cpu_to_be16(0x0202)
|
||||
#define PTT_GEN_ERR __cpu_to_be16(0x0203)
|
||||
|
||||
struct pppoe_hdr {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 ver : 4;
|
||||
__u8 type : 4;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 type : 4;
|
||||
__u8 ver : 4;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 code;
|
||||
__be16 sid;
|
||||
__be16 length;
|
||||
struct pppoe_tag tag[0];
|
||||
} __packed;
|
||||
|
||||
/* Length of entire PPPoE + PPP header */
|
||||
#define PPPOE_SES_HLEN 8
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/if_pppox.h>
|
||||
|
||||
static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
|
@ -232,6 +93,4 @@ enum {
|
|||
PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* !(__LINUX_IF_PPPOX_H) */
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IF_TEAM_H_
|
||||
#define _LINUX_IF_TEAM_H_
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netpoll.h>
|
||||
#include <net/sch_generic.h>
|
||||
#include <uapi/linux/if_team.h>
|
||||
|
||||
struct team_pcpu_stats {
|
||||
u64 rx_packets;
|
||||
|
@ -251,98 +250,4 @@ extern void team_mode_unregister(const struct team_mode *mode);
|
|||
#define TEAM_DEFAULT_NUM_TX_QUEUES 16
|
||||
#define TEAM_DEFAULT_NUM_RX_QUEUES 16
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#define TEAM_STRING_MAX_LEN 32
|
||||
|
||||
/**********************************
|
||||
* NETLINK_GENERIC netlink family.
|
||||
**********************************/
|
||||
|
||||
enum {
|
||||
TEAM_CMD_NOOP,
|
||||
TEAM_CMD_OPTIONS_SET,
|
||||
TEAM_CMD_OPTIONS_GET,
|
||||
TEAM_CMD_PORT_LIST_GET,
|
||||
|
||||
__TEAM_CMD_MAX,
|
||||
TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
|
||||
};
|
||||
|
||||
enum {
|
||||
TEAM_ATTR_UNSPEC,
|
||||
TEAM_ATTR_TEAM_IFINDEX, /* u32 */
|
||||
TEAM_ATTR_LIST_OPTION, /* nest */
|
||||
TEAM_ATTR_LIST_PORT, /* nest */
|
||||
|
||||
__TEAM_ATTR_MAX,
|
||||
TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
|
||||
};
|
||||
|
||||
/* Nested layout of get/set msg:
|
||||
*
|
||||
* [TEAM_ATTR_LIST_OPTION]
|
||||
* [TEAM_ATTR_ITEM_OPTION]
|
||||
* [TEAM_ATTR_OPTION_*], ...
|
||||
* [TEAM_ATTR_ITEM_OPTION]
|
||||
* [TEAM_ATTR_OPTION_*], ...
|
||||
* ...
|
||||
* [TEAM_ATTR_LIST_PORT]
|
||||
* [TEAM_ATTR_ITEM_PORT]
|
||||
* [TEAM_ATTR_PORT_*], ...
|
||||
* [TEAM_ATTR_ITEM_PORT]
|
||||
* [TEAM_ATTR_PORT_*], ...
|
||||
* ...
|
||||
*/
|
||||
|
||||
enum {
|
||||
TEAM_ATTR_ITEM_OPTION_UNSPEC,
|
||||
TEAM_ATTR_ITEM_OPTION, /* nest */
|
||||
|
||||
__TEAM_ATTR_ITEM_OPTION_MAX,
|
||||
TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
TEAM_ATTR_OPTION_UNSPEC,
|
||||
TEAM_ATTR_OPTION_NAME, /* string */
|
||||
TEAM_ATTR_OPTION_CHANGED, /* flag */
|
||||
TEAM_ATTR_OPTION_TYPE, /* u8 */
|
||||
TEAM_ATTR_OPTION_DATA, /* dynamic */
|
||||
TEAM_ATTR_OPTION_REMOVED, /* flag */
|
||||
TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
|
||||
TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
|
||||
|
||||
__TEAM_ATTR_OPTION_MAX,
|
||||
TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
TEAM_ATTR_ITEM_PORT_UNSPEC,
|
||||
TEAM_ATTR_ITEM_PORT, /* nest */
|
||||
|
||||
__TEAM_ATTR_ITEM_PORT_MAX,
|
||||
TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
TEAM_ATTR_PORT_UNSPEC,
|
||||
TEAM_ATTR_PORT_IFINDEX, /* u32 */
|
||||
TEAM_ATTR_PORT_CHANGED, /* flag */
|
||||
TEAM_ATTR_PORT_LINKUP, /* flag */
|
||||
TEAM_ATTR_PORT_SPEED, /* u32 */
|
||||
TEAM_ATTR_PORT_DUPLEX, /* u8 */
|
||||
TEAM_ATTR_PORT_REMOVED, /* flag */
|
||||
|
||||
__TEAM_ATTR_PORT_MAX,
|
||||
TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* NETLINK_GENERIC related info
|
||||
*/
|
||||
#define TEAM_GENL_NAME "team"
|
||||
#define TEAM_GENL_VERSION 0x1
|
||||
#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
|
||||
|
||||
#endif /* _LINUX_IF_TEAM_H_ */
|
||||
|
|
|
@ -12,86 +12,11 @@
|
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __IF_TUN_H
|
||||
#define __IF_TUN_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/filter.h>
|
||||
#include <uapi/linux/if_tun.h>
|
||||
|
||||
/* Read queue size */
|
||||
#define TUN_READQ_SIZE 500
|
||||
|
||||
/* TUN device flags */
|
||||
#define TUN_TUN_DEV 0x0001
|
||||
#define TUN_TAP_DEV 0x0002
|
||||
#define TUN_TYPE_MASK 0x000f
|
||||
|
||||
#define TUN_FASYNC 0x0010
|
||||
#define TUN_NOCHECKSUM 0x0020
|
||||
#define TUN_NO_PI 0x0040
|
||||
#define TUN_ONE_QUEUE 0x0080
|
||||
#define TUN_PERSIST 0x0100
|
||||
#define TUN_VNET_HDR 0x0200
|
||||
|
||||
/* Ioctl defines */
|
||||
#define TUNSETNOCSUM _IOW('T', 200, int)
|
||||
#define TUNSETDEBUG _IOW('T', 201, int)
|
||||
#define TUNSETIFF _IOW('T', 202, int)
|
||||
#define TUNSETPERSIST _IOW('T', 203, int)
|
||||
#define TUNSETOWNER _IOW('T', 204, int)
|
||||
#define TUNSETLINK _IOW('T', 205, int)
|
||||
#define TUNSETGROUP _IOW('T', 206, int)
|
||||
#define TUNGETFEATURES _IOR('T', 207, unsigned int)
|
||||
#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
|
||||
#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
|
||||
#define TUNGETIFF _IOR('T', 210, unsigned int)
|
||||
#define TUNGETSNDBUF _IOR('T', 211, int)
|
||||
#define TUNSETSNDBUF _IOW('T', 212, int)
|
||||
#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
|
||||
#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
|
||||
#define TUNGETVNETHDRSZ _IOR('T', 215, int)
|
||||
#define TUNSETVNETHDRSZ _IOW('T', 216, int)
|
||||
|
||||
/* TUNSETIFF ifr flags */
|
||||
#define IFF_TUN 0x0001
|
||||
#define IFF_TAP 0x0002
|
||||
#define IFF_NO_PI 0x1000
|
||||
#define IFF_ONE_QUEUE 0x2000
|
||||
#define IFF_VNET_HDR 0x4000
|
||||
#define IFF_TUN_EXCL 0x8000
|
||||
|
||||
/* Features for GSO (TUNSETOFFLOAD). */
|
||||
#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
|
||||
#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
|
||||
#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
|
||||
#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
|
||||
#define TUN_F_UFO 0x10 /* I can handle UFO packets */
|
||||
|
||||
/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
|
||||
#define TUN_PKT_STRIP 0x0001
|
||||
struct tun_pi {
|
||||
__u16 flags;
|
||||
__be16 proto;
|
||||
};
|
||||
|
||||
/*
|
||||
* Filter spec (used for SETXXFILTER ioctls)
|
||||
* This stuff is applicable only to the TAP (Ethernet) devices.
|
||||
* If the count is zero the filter is disabled and the driver accepts
|
||||
* all packets (promisc mode).
|
||||
* If the filter is enabled in order to accept broadcast packets
|
||||
* broadcast addr must be explicitly included in the addr list.
|
||||
*/
|
||||
#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
|
||||
struct tun_filter {
|
||||
__u16 flags; /* TUN_FLT_ flags see above */
|
||||
__u16 count; /* Number of addresses */
|
||||
__u8 addr[0][ETH_ALEN];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
|
||||
struct socket *tun_get_socket(struct file *);
|
||||
#else
|
||||
|
@ -104,5 +29,4 @@ static inline struct socket *tun_get_socket(struct file *f)
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
#endif /* CONFIG_TUN */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __IF_TUN_H */
|
||||
|
|
|
@ -1,100 +1,8 @@
|
|||
#ifndef _IF_TUNNEL_H_
|
||||
#define _IF_TUNNEL_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/ip.h>
|
||||
#include <linux/in6.h>
|
||||
#endif
|
||||
#include <uapi/linux/if_tunnel.h>
|
||||
|
||||
#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
|
||||
#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
|
||||
#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
|
||||
#define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
|
||||
#define SIOCGETPRL (SIOCDEVPRIVATE + 4)
|
||||
#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
|
||||
#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
|
||||
#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
|
||||
#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
|
||||
#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
|
||||
#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
|
||||
#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
|
||||
|
||||
#define GRE_CSUM __cpu_to_be16(0x8000)
|
||||
#define GRE_ROUTING __cpu_to_be16(0x4000)
|
||||
#define GRE_KEY __cpu_to_be16(0x2000)
|
||||
#define GRE_SEQ __cpu_to_be16(0x1000)
|
||||
#define GRE_STRICT __cpu_to_be16(0x0800)
|
||||
#define GRE_REC __cpu_to_be16(0x0700)
|
||||
#define GRE_FLAGS __cpu_to_be16(0x00F8)
|
||||
#define GRE_VERSION __cpu_to_be16(0x0007)
|
||||
|
||||
struct ip_tunnel_parm {
|
||||
char name[IFNAMSIZ];
|
||||
int link;
|
||||
__be16 i_flags;
|
||||
__be16 o_flags;
|
||||
__be32 i_key;
|
||||
__be32 o_key;
|
||||
struct iphdr iph;
|
||||
};
|
||||
|
||||
/* SIT-mode i_flags */
|
||||
#define SIT_ISATAP 0x0001
|
||||
|
||||
struct ip_tunnel_prl {
|
||||
__be32 addr;
|
||||
__u16 flags;
|
||||
__u16 __reserved;
|
||||
__u32 datalen;
|
||||
__u32 __reserved2;
|
||||
/* data follows */
|
||||
};
|
||||
|
||||
/* PRL flags */
|
||||
#define PRL_DEFAULT 0x0001
|
||||
|
||||
struct ip_tunnel_6rd {
|
||||
struct in6_addr prefix;
|
||||
__be32 relay_prefix;
|
||||
__u16 prefixlen;
|
||||
__u16 relay_prefixlen;
|
||||
};
|
||||
|
||||
enum {
|
||||
IFLA_GRE_UNSPEC,
|
||||
IFLA_GRE_LINK,
|
||||
IFLA_GRE_IFLAGS,
|
||||
IFLA_GRE_OFLAGS,
|
||||
IFLA_GRE_IKEY,
|
||||
IFLA_GRE_OKEY,
|
||||
IFLA_GRE_LOCAL,
|
||||
IFLA_GRE_REMOTE,
|
||||
IFLA_GRE_TTL,
|
||||
IFLA_GRE_TOS,
|
||||
IFLA_GRE_PMTUDISC,
|
||||
IFLA_GRE_ENCAP_LIMIT,
|
||||
IFLA_GRE_FLOWINFO,
|
||||
IFLA_GRE_FLAGS,
|
||||
__IFLA_GRE_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
|
||||
|
||||
/* VTI-mode i_flags */
|
||||
#define VTI_ISVTI 0x0001
|
||||
|
||||
enum {
|
||||
IFLA_VTI_UNSPEC,
|
||||
IFLA_VTI_LINK,
|
||||
IFLA_VTI_IKEY,
|
||||
IFLA_VTI_OKEY,
|
||||
IFLA_VTI_LOCAL,
|
||||
IFLA_VTI_REMOTE,
|
||||
__IFLA_VTI_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
|
||||
#endif /* _IF_TUNNEL_H_ */
|
||||
|
|
|
@ -9,15 +9,14 @@
|
|||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IF_VLAN_H_
|
||||
#define _LINUX_IF_VLAN_H_
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/bug.h>
|
||||
#include <uapi/linux/if_vlan.h>
|
||||
|
||||
#define VLAN_HLEN 4 /* The additional bytes required by VLAN
|
||||
* (in addition to the Ethernet header)
|
||||
|
@ -361,52 +360,4 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb,
|
|||
*/
|
||||
skb->protocol = htons(ETH_P_802_2);
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* VLAN IOCTLs are found in sockios.h */
|
||||
|
||||
/* Passed in vlan_ioctl_args structure to determine behaviour. */
|
||||
enum vlan_ioctl_cmds {
|
||||
ADD_VLAN_CMD,
|
||||
DEL_VLAN_CMD,
|
||||
SET_VLAN_INGRESS_PRIORITY_CMD,
|
||||
SET_VLAN_EGRESS_PRIORITY_CMD,
|
||||
GET_VLAN_INGRESS_PRIORITY_CMD,
|
||||
GET_VLAN_EGRESS_PRIORITY_CMD,
|
||||
SET_VLAN_NAME_TYPE_CMD,
|
||||
SET_VLAN_FLAG_CMD,
|
||||
GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
|
||||
GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
|
||||
};
|
||||
|
||||
enum vlan_flags {
|
||||
VLAN_FLAG_REORDER_HDR = 0x1,
|
||||
VLAN_FLAG_GVRP = 0x2,
|
||||
VLAN_FLAG_LOOSE_BINDING = 0x4,
|
||||
};
|
||||
|
||||
enum vlan_name_types {
|
||||
VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
|
||||
VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
|
||||
VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
|
||||
VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
|
||||
VLAN_NAME_TYPE_HIGHEST
|
||||
};
|
||||
|
||||
struct vlan_ioctl_args {
|
||||
int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
|
||||
char device1[24];
|
||||
|
||||
union {
|
||||
char device2[24];
|
||||
int VID;
|
||||
unsigned int skb_priority;
|
||||
unsigned int name_type;
|
||||
unsigned int bind_type;
|
||||
unsigned int flag; /* Matches vlan_dev_priv flags */
|
||||
} u;
|
||||
|
||||
short vlan_qos;
|
||||
};
|
||||
|
||||
#endif /* !(_LINUX_IF_VLAN_H_) */
|
||||
|
|
|
@ -12,123 +12,13 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IGMP_H
|
||||
#define _LINUX_IGMP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/*
|
||||
* IGMP protocol structures
|
||||
*/
|
||||
|
||||
/*
|
||||
* Header in on cable format
|
||||
*/
|
||||
|
||||
struct igmphdr {
|
||||
__u8 type;
|
||||
__u8 code; /* For newer IGMP */
|
||||
__sum16 csum;
|
||||
__be32 group;
|
||||
};
|
||||
|
||||
/* V3 group record types [grec_type] */
|
||||
#define IGMPV3_MODE_IS_INCLUDE 1
|
||||
#define IGMPV3_MODE_IS_EXCLUDE 2
|
||||
#define IGMPV3_CHANGE_TO_INCLUDE 3
|
||||
#define IGMPV3_CHANGE_TO_EXCLUDE 4
|
||||
#define IGMPV3_ALLOW_NEW_SOURCES 5
|
||||
#define IGMPV3_BLOCK_OLD_SOURCES 6
|
||||
|
||||
struct igmpv3_grec {
|
||||
__u8 grec_type;
|
||||
__u8 grec_auxwords;
|
||||
__be16 grec_nsrcs;
|
||||
__be32 grec_mca;
|
||||
__be32 grec_src[0];
|
||||
};
|
||||
|
||||
struct igmpv3_report {
|
||||
__u8 type;
|
||||
__u8 resv1;
|
||||
__be16 csum;
|
||||
__be16 resv2;
|
||||
__be16 ngrec;
|
||||
struct igmpv3_grec grec[0];
|
||||
};
|
||||
|
||||
struct igmpv3_query {
|
||||
__u8 type;
|
||||
__u8 code;
|
||||
__be16 csum;
|
||||
__be32 group;
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 qrv:3,
|
||||
suppress:1,
|
||||
resv:4;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 resv:4,
|
||||
suppress:1,
|
||||
qrv:3;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 qqic;
|
||||
__be16 nsrcs;
|
||||
__be32 srcs[0];
|
||||
};
|
||||
|
||||
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
|
||||
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
|
||||
#define IGMP_DVMRP 0x13 /* DVMRP routing */
|
||||
#define IGMP_PIM 0x14 /* PIM routing */
|
||||
#define IGMP_TRACE 0x15
|
||||
#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */
|
||||
#define IGMP_HOST_LEAVE_MESSAGE 0x17
|
||||
#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */
|
||||
|
||||
#define IGMP_MTRACE_RESP 0x1e
|
||||
#define IGMP_MTRACE 0x1f
|
||||
|
||||
|
||||
/*
|
||||
* Use the BSD names for these for compatibility
|
||||
*/
|
||||
|
||||
#define IGMP_DELAYING_MEMBER 0x01
|
||||
#define IGMP_IDLE_MEMBER 0x02
|
||||
#define IGMP_LAZY_MEMBER 0x03
|
||||
#define IGMP_SLEEPING_MEMBER 0x04
|
||||
#define IGMP_AWAKENING_MEMBER 0x05
|
||||
|
||||
#define IGMP_MINLEN 8
|
||||
|
||||
#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
|
||||
/* query (in seconds) */
|
||||
|
||||
#define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */
|
||||
/* specifies time in 10th of seconds */
|
||||
|
||||
#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */
|
||||
/* message in this period of time, */
|
||||
/* revert to IGMP v2 router. */
|
||||
|
||||
#define IGMP_ALL_HOSTS htonl(0xE0000001L)
|
||||
#define IGMP_ALL_ROUTER htonl(0xE0000002L)
|
||||
#define IGMPV3_ALL_MCR htonl(0xE0000016L)
|
||||
#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
|
||||
#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
|
||||
|
||||
/*
|
||||
* struct for keeping the multicast list in
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/in.h>
|
||||
#include <uapi/linux/igmp.h>
|
||||
|
||||
static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
|
@ -241,4 +131,3 @@ extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
|
|||
extern void ip_mc_rejoin_groups(struct in_device *in_dev);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -18,240 +18,9 @@
|
|||
#ifndef _LINUX_IN_H
|
||||
#define _LINUX_IN_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/socket.h>
|
||||
|
||||
/* Standard well-defined IP protocols. */
|
||||
enum {
|
||||
IPPROTO_IP = 0, /* Dummy protocol for TCP */
|
||||
IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
|
||||
IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
|
||||
IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
|
||||
IPPROTO_TCP = 6, /* Transmission Control Protocol */
|
||||
IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
|
||||
IPPROTO_PUP = 12, /* PUP protocol */
|
||||
IPPROTO_UDP = 17, /* User Datagram Protocol */
|
||||
IPPROTO_IDP = 22, /* XNS IDP protocol */
|
||||
IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
|
||||
IPPROTO_RSVP = 46, /* RSVP protocol */
|
||||
IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
|
||||
|
||||
IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
|
||||
|
||||
IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
|
||||
IPPROTO_AH = 51, /* Authentication Header protocol */
|
||||
IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
|
||||
IPPROTO_PIM = 103, /* Protocol Independent Multicast */
|
||||
|
||||
IPPROTO_COMP = 108, /* Compression Header protocol */
|
||||
IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
|
||||
IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
|
||||
|
||||
IPPROTO_RAW = 255, /* Raw IP packets */
|
||||
IPPROTO_MAX
|
||||
};
|
||||
|
||||
|
||||
/* Internet address. */
|
||||
struct in_addr {
|
||||
__be32 s_addr;
|
||||
};
|
||||
|
||||
#define IP_TOS 1
|
||||
#define IP_TTL 2
|
||||
#define IP_HDRINCL 3
|
||||
#define IP_OPTIONS 4
|
||||
#define IP_ROUTER_ALERT 5
|
||||
#define IP_RECVOPTS 6
|
||||
#define IP_RETOPTS 7
|
||||
#define IP_PKTINFO 8
|
||||
#define IP_PKTOPTIONS 9
|
||||
#define IP_MTU_DISCOVER 10
|
||||
#define IP_RECVERR 11
|
||||
#define IP_RECVTTL 12
|
||||
#define IP_RECVTOS 13
|
||||
#define IP_MTU 14
|
||||
#define IP_FREEBIND 15
|
||||
#define IP_IPSEC_POLICY 16
|
||||
#define IP_XFRM_POLICY 17
|
||||
#define IP_PASSSEC 18
|
||||
#define IP_TRANSPARENT 19
|
||||
|
||||
/* BSD compatibility */
|
||||
#define IP_RECVRETOPTS IP_RETOPTS
|
||||
|
||||
/* TProxy original addresses */
|
||||
#define IP_ORIGDSTADDR 20
|
||||
#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
|
||||
|
||||
#define IP_MINTTL 21
|
||||
#define IP_NODEFRAG 22
|
||||
|
||||
/* IP_MTU_DISCOVER values */
|
||||
#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
|
||||
#define IP_PMTUDISC_WANT 1 /* Use per route hints */
|
||||
#define IP_PMTUDISC_DO 2 /* Always DF */
|
||||
#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */
|
||||
|
||||
#define IP_MULTICAST_IF 32
|
||||
#define IP_MULTICAST_TTL 33
|
||||
#define IP_MULTICAST_LOOP 34
|
||||
#define IP_ADD_MEMBERSHIP 35
|
||||
#define IP_DROP_MEMBERSHIP 36
|
||||
#define IP_UNBLOCK_SOURCE 37
|
||||
#define IP_BLOCK_SOURCE 38
|
||||
#define IP_ADD_SOURCE_MEMBERSHIP 39
|
||||
#define IP_DROP_SOURCE_MEMBERSHIP 40
|
||||
#define IP_MSFILTER 41
|
||||
#define MCAST_JOIN_GROUP 42
|
||||
#define MCAST_BLOCK_SOURCE 43
|
||||
#define MCAST_UNBLOCK_SOURCE 44
|
||||
#define MCAST_LEAVE_GROUP 45
|
||||
#define MCAST_JOIN_SOURCE_GROUP 46
|
||||
#define MCAST_LEAVE_SOURCE_GROUP 47
|
||||
#define MCAST_MSFILTER 48
|
||||
#define IP_MULTICAST_ALL 49
|
||||
#define IP_UNICAST_IF 50
|
||||
|
||||
#define MCAST_EXCLUDE 0
|
||||
#define MCAST_INCLUDE 1
|
||||
|
||||
/* These need to appear somewhere around here */
|
||||
#define IP_DEFAULT_MULTICAST_TTL 1
|
||||
#define IP_DEFAULT_MULTICAST_LOOP 1
|
||||
|
||||
/* Request struct for multicast socket ops */
|
||||
|
||||
struct ip_mreq {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
struct ip_mreqn {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_address; /* local IP address of interface */
|
||||
int imr_ifindex; /* Interface index */
|
||||
};
|
||||
|
||||
struct ip_mreq_source {
|
||||
__be32 imr_multiaddr;
|
||||
__be32 imr_interface;
|
||||
__be32 imr_sourceaddr;
|
||||
};
|
||||
|
||||
struct ip_msfilter {
|
||||
__be32 imsf_multiaddr;
|
||||
__be32 imsf_interface;
|
||||
__u32 imsf_fmode;
|
||||
__u32 imsf_numsrc;
|
||||
__be32 imsf_slist[1];
|
||||
};
|
||||
|
||||
#define IP_MSFILTER_SIZE(numsrc) \
|
||||
(sizeof(struct ip_msfilter) - sizeof(__u32) \
|
||||
+ (numsrc) * sizeof(__u32))
|
||||
|
||||
struct group_req {
|
||||
__u32 gr_interface; /* interface index */
|
||||
struct __kernel_sockaddr_storage gr_group; /* group address */
|
||||
};
|
||||
|
||||
struct group_source_req {
|
||||
__u32 gsr_interface; /* interface index */
|
||||
struct __kernel_sockaddr_storage gsr_group; /* group address */
|
||||
struct __kernel_sockaddr_storage gsr_source; /* source address */
|
||||
};
|
||||
|
||||
struct group_filter {
|
||||
__u32 gf_interface; /* interface index */
|
||||
struct __kernel_sockaddr_storage gf_group; /* multicast address */
|
||||
__u32 gf_fmode; /* filter mode */
|
||||
__u32 gf_numsrc; /* number of sources */
|
||||
struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
|
||||
};
|
||||
|
||||
#define GROUP_FILTER_SIZE(numsrc) \
|
||||
(sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
|
||||
+ (numsrc) * sizeof(struct __kernel_sockaddr_storage))
|
||||
|
||||
struct in_pktinfo {
|
||||
int ipi_ifindex;
|
||||
struct in_addr ipi_spec_dst;
|
||||
struct in_addr ipi_addr;
|
||||
};
|
||||
|
||||
/* Structure describing an Internet (IP) socket address. */
|
||||
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
|
||||
struct sockaddr_in {
|
||||
__kernel_sa_family_t sin_family; /* Address family */
|
||||
__be16 sin_port; /* Port number */
|
||||
struct in_addr sin_addr; /* Internet address */
|
||||
|
||||
/* Pad to size of `struct sockaddr'. */
|
||||
unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
|
||||
sizeof(unsigned short int) - sizeof(struct in_addr)];
|
||||
};
|
||||
#define sin_zero __pad /* for BSD UNIX comp. -FvK */
|
||||
|
||||
|
||||
/*
|
||||
* Definitions of the bits in an Internet address integer.
|
||||
* On subnets, host and network parts are found according
|
||||
* to the subnet mask, not these masks.
|
||||
*/
|
||||
#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
|
||||
#define IN_CLASSA_NET 0xff000000
|
||||
#define IN_CLASSA_NSHIFT 24
|
||||
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
|
||||
#define IN_CLASSA_MAX 128
|
||||
|
||||
#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
|
||||
#define IN_CLASSB_NET 0xffff0000
|
||||
#define IN_CLASSB_NSHIFT 16
|
||||
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
|
||||
#define IN_CLASSC_NET 0xffffff00
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
|
||||
|
||||
#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
|
||||
#define IN_MULTICAST(a) IN_CLASSD(a)
|
||||
#define IN_MULTICAST_NET 0xF0000000
|
||||
|
||||
#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
|
||||
#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
|
||||
|
||||
/* Address to accept any incoming messages. */
|
||||
#define INADDR_ANY ((unsigned long int) 0x00000000)
|
||||
|
||||
/* Address to send to all hosts. */
|
||||
#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
|
||||
|
||||
/* Address indicating an error return. */
|
||||
#define INADDR_NONE ((unsigned long int) 0xffffffff)
|
||||
|
||||
/* Network number for local host loopback. */
|
||||
#define IN_LOOPBACKNET 127
|
||||
|
||||
/* Address to loopback in software to local host. */
|
||||
#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
|
||||
#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
|
||||
|
||||
/* Defines for Multicast INADDR */
|
||||
#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
|
||||
#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
|
||||
#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
|
||||
#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
|
||||
|
||||
|
||||
/* <asm/byteorder.h> contains the htonl type stuff.. */
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <uapi/linux/in.h>
|
||||
|
||||
static inline int proto_ports_offset(int proto)
|
||||
{
|
||||
|
@ -332,6 +101,4 @@ static inline bool ipv4_is_test_198(__be32 addr)
|
|||
{
|
||||
return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_IN_H */
|
||||
|
|
|
@ -17,32 +17,11 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IN6_H
|
||||
#define _LINUX_IN6_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/in6.h>
|
||||
|
||||
/*
|
||||
* IPv6 address structure
|
||||
*/
|
||||
|
||||
struct in6_addr {
|
||||
union {
|
||||
__u8 u6_addr8[16];
|
||||
__be16 u6_addr16[8];
|
||||
__be32 u6_addr32[4];
|
||||
} in6_u;
|
||||
#define s6_addr in6_u.u6_addr8
|
||||
#define s6_addr16 in6_u.u6_addr16
|
||||
#define s6_addr32 in6_u.u6_addr32
|
||||
};
|
||||
|
||||
/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
|
||||
* NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
|
||||
* in network byte order, not in host byte order as are the IPv4 equivalents
|
||||
*/
|
||||
#ifdef __KERNEL__
|
||||
extern const struct in6_addr in6addr_any;
|
||||
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
|
||||
extern const struct in6_addr in6addr_loopback;
|
||||
|
@ -54,238 +33,3 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
|
|||
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
|
||||
{ { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
|
||||
#endif
|
||||
|
||||
struct sockaddr_in6 {
|
||||
unsigned short int sin6_family; /* AF_INET6 */
|
||||
__be16 sin6_port; /* Transport layer port # */
|
||||
__be32 sin6_flowinfo; /* IPv6 flow information */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
__u32 sin6_scope_id; /* scope id (new in RFC2553) */
|
||||
};
|
||||
|
||||
struct ipv6_mreq {
|
||||
/* IPv6 multicast address of group */
|
||||
struct in6_addr ipv6mr_multiaddr;
|
||||
|
||||
/* local IPv6 address of interface */
|
||||
int ipv6mr_ifindex;
|
||||
};
|
||||
|
||||
#define ipv6mr_acaddr ipv6mr_multiaddr
|
||||
|
||||
struct in6_flowlabel_req {
|
||||
struct in6_addr flr_dst;
|
||||
__be32 flr_label;
|
||||
__u8 flr_action;
|
||||
__u8 flr_share;
|
||||
__u16 flr_flags;
|
||||
__u16 flr_expires;
|
||||
__u16 flr_linger;
|
||||
__u32 __flr_pad;
|
||||
/* Options in format of IPV6_PKTOPTIONS */
|
||||
};
|
||||
|
||||
#define IPV6_FL_A_GET 0
|
||||
#define IPV6_FL_A_PUT 1
|
||||
#define IPV6_FL_A_RENEW 2
|
||||
|
||||
#define IPV6_FL_F_CREATE 1
|
||||
#define IPV6_FL_F_EXCL 2
|
||||
|
||||
#define IPV6_FL_S_NONE 0
|
||||
#define IPV6_FL_S_EXCL 1
|
||||
#define IPV6_FL_S_PROCESS 2
|
||||
#define IPV6_FL_S_USER 3
|
||||
#define IPV6_FL_S_ANY 255
|
||||
|
||||
|
||||
/*
|
||||
* Bitmask constant declarations to help applications select out the
|
||||
* flow label and priority fields.
|
||||
*
|
||||
* Note that this are in host byte order while the flowinfo field of
|
||||
* sockaddr_in6 is in network byte order.
|
||||
*/
|
||||
|
||||
#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
|
||||
#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
|
||||
|
||||
/* These definitions are obsolete */
|
||||
#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
|
||||
#define IPV6_PRIORITY_FILLER 0x0100
|
||||
#define IPV6_PRIORITY_UNATTENDED 0x0200
|
||||
#define IPV6_PRIORITY_RESERVED1 0x0300
|
||||
#define IPV6_PRIORITY_BULK 0x0400
|
||||
#define IPV6_PRIORITY_RESERVED2 0x0500
|
||||
#define IPV6_PRIORITY_INTERACTIVE 0x0600
|
||||
#define IPV6_PRIORITY_CONTROL 0x0700
|
||||
#define IPV6_PRIORITY_8 0x0800
|
||||
#define IPV6_PRIORITY_9 0x0900
|
||||
#define IPV6_PRIORITY_10 0x0a00
|
||||
#define IPV6_PRIORITY_11 0x0b00
|
||||
#define IPV6_PRIORITY_12 0x0c00
|
||||
#define IPV6_PRIORITY_13 0x0d00
|
||||
#define IPV6_PRIORITY_14 0x0e00
|
||||
#define IPV6_PRIORITY_15 0x0f00
|
||||
|
||||
/*
|
||||
* IPV6 extension headers
|
||||
*/
|
||||
#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
|
||||
#define IPPROTO_ROUTING 43 /* IPv6 routing header */
|
||||
#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
|
||||
#define IPPROTO_ICMPV6 58 /* ICMPv6 */
|
||||
#define IPPROTO_NONE 59 /* IPv6 no next header */
|
||||
#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
|
||||
#define IPPROTO_MH 135 /* IPv6 mobility header */
|
||||
|
||||
/*
|
||||
* IPv6 TLV options.
|
||||
*/
|
||||
#define IPV6_TLV_PAD1 0
|
||||
#define IPV6_TLV_PADN 1
|
||||
#define IPV6_TLV_ROUTERALERT 5
|
||||
#define IPV6_TLV_JUMBO 194
|
||||
#define IPV6_TLV_HAO 201 /* home address option */
|
||||
|
||||
/*
|
||||
* IPV6 socket options
|
||||
*/
|
||||
|
||||
#define IPV6_ADDRFORM 1
|
||||
#define IPV6_2292PKTINFO 2
|
||||
#define IPV6_2292HOPOPTS 3
|
||||
#define IPV6_2292DSTOPTS 4
|
||||
#define IPV6_2292RTHDR 5
|
||||
#define IPV6_2292PKTOPTIONS 6
|
||||
#define IPV6_CHECKSUM 7
|
||||
#define IPV6_2292HOPLIMIT 8
|
||||
#define IPV6_NEXTHOP 9
|
||||
#define IPV6_AUTHHDR 10 /* obsolete */
|
||||
#define IPV6_FLOWINFO 11
|
||||
|
||||
#define IPV6_UNICAST_HOPS 16
|
||||
#define IPV6_MULTICAST_IF 17
|
||||
#define IPV6_MULTICAST_HOPS 18
|
||||
#define IPV6_MULTICAST_LOOP 19
|
||||
#define IPV6_ADD_MEMBERSHIP 20
|
||||
#define IPV6_DROP_MEMBERSHIP 21
|
||||
#define IPV6_ROUTER_ALERT 22
|
||||
#define IPV6_MTU_DISCOVER 23
|
||||
#define IPV6_MTU 24
|
||||
#define IPV6_RECVERR 25
|
||||
#define IPV6_V6ONLY 26
|
||||
#define IPV6_JOIN_ANYCAST 27
|
||||
#define IPV6_LEAVE_ANYCAST 28
|
||||
|
||||
/* IPV6_MTU_DISCOVER values */
|
||||
#define IPV6_PMTUDISC_DONT 0
|
||||
#define IPV6_PMTUDISC_WANT 1
|
||||
#define IPV6_PMTUDISC_DO 2
|
||||
#define IPV6_PMTUDISC_PROBE 3
|
||||
|
||||
/* Flowlabel */
|
||||
#define IPV6_FLOWLABEL_MGR 32
|
||||
#define IPV6_FLOWINFO_SEND 33
|
||||
|
||||
#define IPV6_IPSEC_POLICY 34
|
||||
#define IPV6_XFRM_POLICY 35
|
||||
|
||||
/*
|
||||
* Multicast:
|
||||
* Following socket options are shared between IPv4 and IPv6.
|
||||
*
|
||||
* MCAST_JOIN_GROUP 42
|
||||
* MCAST_BLOCK_SOURCE 43
|
||||
* MCAST_UNBLOCK_SOURCE 44
|
||||
* MCAST_LEAVE_GROUP 45
|
||||
* MCAST_JOIN_SOURCE_GROUP 46
|
||||
* MCAST_LEAVE_SOURCE_GROUP 47
|
||||
* MCAST_MSFILTER 48
|
||||
*/
|
||||
|
||||
/*
|
||||
* Advanced API (RFC3542) (1)
|
||||
*
|
||||
* Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
|
||||
*/
|
||||
|
||||
#define IPV6_RECVPKTINFO 49
|
||||
#define IPV6_PKTINFO 50
|
||||
#define IPV6_RECVHOPLIMIT 51
|
||||
#define IPV6_HOPLIMIT 52
|
||||
#define IPV6_RECVHOPOPTS 53
|
||||
#define IPV6_HOPOPTS 54
|
||||
#define IPV6_RTHDRDSTOPTS 55
|
||||
#define IPV6_RECVRTHDR 56
|
||||
#define IPV6_RTHDR 57
|
||||
#define IPV6_RECVDSTOPTS 58
|
||||
#define IPV6_DSTOPTS 59
|
||||
#define IPV6_RECVPATHMTU 60
|
||||
#define IPV6_PATHMTU 61
|
||||
#define IPV6_DONTFRAG 62
|
||||
#if 0 /* not yet */
|
||||
#define IPV6_USE_MIN_MTU 63
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Netfilter (1)
|
||||
*
|
||||
* Following socket options are used in ip6_tables;
|
||||
* see include/linux/netfilter_ipv6/ip6_tables.h.
|
||||
*
|
||||
* IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64
|
||||
* IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65
|
||||
*/
|
||||
|
||||
/*
|
||||
* Advanced API (RFC3542) (2)
|
||||
*/
|
||||
#define IPV6_RECVTCLASS 66
|
||||
#define IPV6_TCLASS 67
|
||||
|
||||
/*
|
||||
* Netfilter (2)
|
||||
*
|
||||
* Following socket options are used in ip6_tables;
|
||||
* see include/linux/netfilter_ipv6/ip6_tables.h.
|
||||
*
|
||||
* IP6T_SO_GET_REVISION_MATCH 68
|
||||
* IP6T_SO_GET_REVISION_TARGET 69
|
||||
*/
|
||||
|
||||
/* RFC5014: Source address selection */
|
||||
#define IPV6_ADDR_PREFERENCES 72
|
||||
|
||||
#define IPV6_PREFER_SRC_TMP 0x0001
|
||||
#define IPV6_PREFER_SRC_PUBLIC 0x0002
|
||||
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
|
||||
#define IPV6_PREFER_SRC_COA 0x0004
|
||||
#define IPV6_PREFER_SRC_HOME 0x0400
|
||||
#define IPV6_PREFER_SRC_CGA 0x0008
|
||||
#define IPV6_PREFER_SRC_NONCGA 0x0800
|
||||
|
||||
/* RFC5082: Generalized Ttl Security Mechanism */
|
||||
#define IPV6_MINHOPCOUNT 73
|
||||
|
||||
#define IPV6_ORIGDSTADDR 74
|
||||
#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
|
||||
#define IPV6_TRANSPARENT 75
|
||||
#define IPV6_UNICAST_IF 76
|
||||
|
||||
/*
|
||||
* Multicast Routing:
|
||||
* see include/linux/mroute6.h.
|
||||
*
|
||||
* MRT6_INIT 200
|
||||
* MRT6_DONE 201
|
||||
* MRT6_ADD_MIF 202
|
||||
* MRT6_DEL_MIF 203
|
||||
* MRT6_ADD_MFC 204
|
||||
* MRT6_DEL_MFC 205
|
||||
* MRT6_VERSION 206
|
||||
* MRT6_ASSERT 207
|
||||
* MRT6_PIM 208
|
||||
* (reserved) 209
|
||||
*/
|
||||
#endif
|
||||
|
|
|
@ -1,138 +1,8 @@
|
|||
#ifndef _INET_DIAG_H_
|
||||
#define _INET_DIAG_H_ 1
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/inet_diag.h>
|
||||
|
||||
/* Just some random number */
|
||||
#define TCPDIAG_GETSOCK 18
|
||||
#define DCCPDIAG_GETSOCK 19
|
||||
|
||||
#define INET_DIAG_GETSOCK_MAX 24
|
||||
|
||||
/* Socket identity */
|
||||
struct inet_diag_sockid {
|
||||
__be16 idiag_sport;
|
||||
__be16 idiag_dport;
|
||||
__be32 idiag_src[4];
|
||||
__be32 idiag_dst[4];
|
||||
__u32 idiag_if;
|
||||
__u32 idiag_cookie[2];
|
||||
#define INET_DIAG_NOCOOKIE (~0U)
|
||||
};
|
||||
|
||||
/* Request structure */
|
||||
|
||||
struct inet_diag_req {
|
||||
__u8 idiag_family; /* Family of addresses. */
|
||||
__u8 idiag_src_len;
|
||||
__u8 idiag_dst_len;
|
||||
__u8 idiag_ext; /* Query extended information */
|
||||
|
||||
struct inet_diag_sockid id;
|
||||
|
||||
__u32 idiag_states; /* States to dump */
|
||||
__u32 idiag_dbs; /* Tables to dump (NI) */
|
||||
};
|
||||
|
||||
struct inet_diag_req_v2 {
|
||||
__u8 sdiag_family;
|
||||
__u8 sdiag_protocol;
|
||||
__u8 idiag_ext;
|
||||
__u8 pad;
|
||||
__u32 idiag_states;
|
||||
struct inet_diag_sockid id;
|
||||
};
|
||||
|
||||
enum {
|
||||
INET_DIAG_REQ_NONE,
|
||||
INET_DIAG_REQ_BYTECODE,
|
||||
};
|
||||
|
||||
#define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
|
||||
|
||||
/* Bytecode is sequence of 4 byte commands followed by variable arguments.
|
||||
* All the commands identified by "code" are conditional jumps forward:
|
||||
* to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be
|
||||
* length of the command and its arguments.
|
||||
*/
|
||||
|
||||
struct inet_diag_bc_op {
|
||||
unsigned char code;
|
||||
unsigned char yes;
|
||||
unsigned short no;
|
||||
};
|
||||
|
||||
enum {
|
||||
INET_DIAG_BC_NOP,
|
||||
INET_DIAG_BC_JMP,
|
||||
INET_DIAG_BC_S_GE,
|
||||
INET_DIAG_BC_S_LE,
|
||||
INET_DIAG_BC_D_GE,
|
||||
INET_DIAG_BC_D_LE,
|
||||
INET_DIAG_BC_AUTO,
|
||||
INET_DIAG_BC_S_COND,
|
||||
INET_DIAG_BC_D_COND,
|
||||
};
|
||||
|
||||
struct inet_diag_hostcond {
|
||||
__u8 family;
|
||||
__u8 prefix_len;
|
||||
int port;
|
||||
__be32 addr[0];
|
||||
};
|
||||
|
||||
/* Base info structure. It contains socket identity (addrs/ports/cookie)
|
||||
* and, alas, the information shown by netstat. */
|
||||
struct inet_diag_msg {
|
||||
__u8 idiag_family;
|
||||
__u8 idiag_state;
|
||||
__u8 idiag_timer;
|
||||
__u8 idiag_retrans;
|
||||
|
||||
struct inet_diag_sockid id;
|
||||
|
||||
__u32 idiag_expires;
|
||||
__u32 idiag_rqueue;
|
||||
__u32 idiag_wqueue;
|
||||
__u32 idiag_uid;
|
||||
__u32 idiag_inode;
|
||||
};
|
||||
|
||||
/* Extensions */
|
||||
|
||||
enum {
|
||||
INET_DIAG_NONE,
|
||||
INET_DIAG_MEMINFO,
|
||||
INET_DIAG_INFO,
|
||||
INET_DIAG_VEGASINFO,
|
||||
INET_DIAG_CONG,
|
||||
INET_DIAG_TOS,
|
||||
INET_DIAG_TCLASS,
|
||||
INET_DIAG_SKMEMINFO,
|
||||
};
|
||||
|
||||
#define INET_DIAG_MAX INET_DIAG_SKMEMINFO
|
||||
|
||||
|
||||
/* INET_DIAG_MEM */
|
||||
|
||||
struct inet_diag_meminfo {
|
||||
__u32 idiag_rmem;
|
||||
__u32 idiag_wmem;
|
||||
__u32 idiag_fmem;
|
||||
__u32 idiag_tmem;
|
||||
};
|
||||
|
||||
/* INET_DIAG_VEGASINFO */
|
||||
|
||||
struct tcpvegas_info {
|
||||
__u32 tcpv_enabled;
|
||||
__u32 tcpv_rttcnt;
|
||||
__u32 tcpv_rtt;
|
||||
__u32 tcpv_minrtt;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct sock;
|
||||
struct inet_hashinfo;
|
||||
struct nlattr;
|
||||
|
@ -173,6 +43,4 @@ int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
|
|||
|
||||
extern int inet_diag_register(const struct inet_diag_handler *handler);
|
||||
extern void inet_diag_unregister(const struct inet_diag_handler *handler);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _INET_DIAG_H_ */
|
||||
|
|
|
@ -3,75 +3,12 @@
|
|||
*
|
||||
* Copyright (C) 2005 John McCutchan
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_INOTIFY_H
|
||||
#define _LINUX_INOTIFY_H
|
||||
|
||||
/* For O_CLOEXEC and O_NONBLOCK */
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* struct inotify_event - structure read from the inotify device for each event
|
||||
*
|
||||
* When you are watching a directory, you will receive the filename for events
|
||||
* such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
|
||||
*/
|
||||
struct inotify_event {
|
||||
__s32 wd; /* watch descriptor */
|
||||
__u32 mask; /* watch mask */
|
||||
__u32 cookie; /* cookie to synchronize two events */
|
||||
__u32 len; /* length (including nulls) of name */
|
||||
char name[0]; /* stub for possible name */
|
||||
};
|
||||
|
||||
/* the following are legal, implemented events that user-space can watch for */
|
||||
#define IN_ACCESS 0x00000001 /* File was accessed */
|
||||
#define IN_MODIFY 0x00000002 /* File was modified */
|
||||
#define IN_ATTRIB 0x00000004 /* Metadata changed */
|
||||
#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
|
||||
#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
|
||||
#define IN_OPEN 0x00000020 /* File was opened */
|
||||
#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
|
||||
#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
|
||||
#define IN_CREATE 0x00000100 /* Subfile was created */
|
||||
#define IN_DELETE 0x00000200 /* Subfile was deleted */
|
||||
#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
|
||||
#define IN_MOVE_SELF 0x00000800 /* Self was moved */
|
||||
|
||||
/* the following are legal events. they are sent as needed to any watch */
|
||||
#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
|
||||
#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
|
||||
#define IN_IGNORED 0x00008000 /* File was ignored */
|
||||
|
||||
/* helper events */
|
||||
#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
|
||||
#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
|
||||
|
||||
/* special flags */
|
||||
#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
|
||||
#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
|
||||
#define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */
|
||||
#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
|
||||
#define IN_ISDIR 0x40000000 /* event occurred against dir */
|
||||
#define IN_ONESHOT 0x80000000 /* only send event once */
|
||||
|
||||
/*
|
||||
* All of the events - we build the list by hand so that we can add flags in
|
||||
* the future and not break backward compatibility. Apps will get only the
|
||||
* events that they originally wanted. Be sure to add new events here!
|
||||
*/
|
||||
#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
|
||||
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
|
||||
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
|
||||
IN_MOVE_SELF)
|
||||
|
||||
/* Flags for sys_inotify_init1. */
|
||||
#define IN_CLOEXEC O_CLOEXEC
|
||||
#define IN_NONBLOCK O_NONBLOCK
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/sysctl.h>
|
||||
#include <uapi/linux/inotify.h>
|
||||
|
||||
extern struct ctl_table inotify_table[]; /* for sysctl */
|
||||
|
||||
#define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
|
||||
|
@ -82,6 +19,4 @@ extern struct ctl_table inotify_table[]; /* for sysctl */
|
|||
IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \
|
||||
IN_ISDIR | IN_ONESHOT)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_INOTIFY_H */
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -16,96 +16,9 @@
|
|||
*/
|
||||
#ifndef _LINUX_IP_H
|
||||
#define _LINUX_IP_H
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#define IPTOS_TOS_MASK 0x1E
|
||||
#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
|
||||
#define IPTOS_LOWDELAY 0x10
|
||||
#define IPTOS_THROUGHPUT 0x08
|
||||
#define IPTOS_RELIABILITY 0x04
|
||||
#define IPTOS_MINCOST 0x02
|
||||
|
||||
#define IPTOS_PREC_MASK 0xE0
|
||||
#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
|
||||
#define IPTOS_PREC_NETCONTROL 0xe0
|
||||
#define IPTOS_PREC_INTERNETCONTROL 0xc0
|
||||
#define IPTOS_PREC_CRITIC_ECP 0xa0
|
||||
#define IPTOS_PREC_FLASHOVERRIDE 0x80
|
||||
#define IPTOS_PREC_FLASH 0x60
|
||||
#define IPTOS_PREC_IMMEDIATE 0x40
|
||||
#define IPTOS_PREC_PRIORITY 0x20
|
||||
#define IPTOS_PREC_ROUTINE 0x00
|
||||
|
||||
|
||||
/* IP options */
|
||||
#define IPOPT_COPY 0x80
|
||||
#define IPOPT_CLASS_MASK 0x60
|
||||
#define IPOPT_NUMBER_MASK 0x1f
|
||||
|
||||
#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
|
||||
#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
|
||||
#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
|
||||
|
||||
#define IPOPT_CONTROL 0x00
|
||||
#define IPOPT_RESERVED1 0x20
|
||||
#define IPOPT_MEASUREMENT 0x40
|
||||
#define IPOPT_RESERVED2 0x60
|
||||
|
||||
#define IPOPT_END (0 |IPOPT_CONTROL)
|
||||
#define IPOPT_NOOP (1 |IPOPT_CONTROL)
|
||||
#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
|
||||
#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_RR (7 |IPOPT_CONTROL)
|
||||
#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
|
||||
|
||||
#define IPVERSION 4
|
||||
#define MAXTTL 255
|
||||
#define IPDEFTTL 64
|
||||
|
||||
#define IPOPT_OPTVAL 0
|
||||
#define IPOPT_OLEN 1
|
||||
#define IPOPT_OFFSET 2
|
||||
#define IPOPT_MINOFF 4
|
||||
#define MAX_IPOPTLEN 40
|
||||
#define IPOPT_NOP IPOPT_NOOP
|
||||
#define IPOPT_EOL IPOPT_END
|
||||
#define IPOPT_TS IPOPT_TIMESTAMP
|
||||
|
||||
#define IPOPT_TS_TSONLY 0 /* timestamps only */
|
||||
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
|
||||
#define IPOPT_TS_PRESPEC 3 /* specified modules only */
|
||||
|
||||
#define IPV4_BEET_PHMAXLEN 8
|
||||
|
||||
struct iphdr {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 ihl:4,
|
||||
version:4;
|
||||
#elif defined (__BIG_ENDIAN_BITFIELD)
|
||||
__u8 version:4,
|
||||
ihl:4;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 tos;
|
||||
__be16 tot_len;
|
||||
__be16 id;
|
||||
__be16 frag_off;
|
||||
__u8 ttl;
|
||||
__u8 protocol;
|
||||
__sum16 check;
|
||||
__be32 saddr;
|
||||
__be32 daddr;
|
||||
/*The options start here. */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/ip.h>
|
||||
|
||||
static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
|
@ -116,34 +29,4 @@ static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
|
|||
{
|
||||
return (struct iphdr *)skb_transport_header(skb);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct ip_auth_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen; /* This one is measured in 32 bit units! */
|
||||
__be16 reserved;
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ip_esp_hdr {
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ip_comp_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 flags;
|
||||
__be16 cpi;
|
||||
};
|
||||
|
||||
struct ip_beet_phdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen;
|
||||
__u8 padlen;
|
||||
__u8 reserved;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_IP_H */
|
||||
|
|
|
@ -1,85 +1,9 @@
|
|||
#ifndef _LINUX_IPC_H
|
||||
#define _LINUX_IPC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define IPC_PRIVATE ((__kernel_key_t) 0)
|
||||
|
||||
/* Obsolete, used only for backwards compatibility and libc5 compiles */
|
||||
struct ipc_perm
|
||||
{
|
||||
__kernel_key_t key;
|
||||
__kernel_uid_t uid;
|
||||
__kernel_gid_t gid;
|
||||
__kernel_uid_t cuid;
|
||||
__kernel_gid_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short seq;
|
||||
};
|
||||
|
||||
/* Include the definition of ipc64_perm */
|
||||
#include <asm/ipcbuf.h>
|
||||
|
||||
/* resource get request flags */
|
||||
#define IPC_CREAT 00001000 /* create if key is nonexistent */
|
||||
#define IPC_EXCL 00002000 /* fail if key exists */
|
||||
#define IPC_NOWAIT 00004000 /* return error on wait */
|
||||
|
||||
/* these fields are used by the DIPC package so the kernel as standard
|
||||
should avoid using them if possible */
|
||||
|
||||
#define IPC_DIPC 00010000 /* make it distributed */
|
||||
#define IPC_OWN 00020000 /* this machine is the DIPC owner */
|
||||
|
||||
/*
|
||||
* Control commands used with semctl, msgctl and shmctl
|
||||
* see also specific commands in sem.h, msg.h and shm.h
|
||||
*/
|
||||
#define IPC_RMID 0 /* remove resource */
|
||||
#define IPC_SET 1 /* set ipc_perm options */
|
||||
#define IPC_STAT 2 /* get ipc_perm options */
|
||||
#define IPC_INFO 3 /* see ipcs */
|
||||
|
||||
/*
|
||||
* Version flags for semctl, msgctl, and shmctl commands
|
||||
* These are passed as bitflags or-ed with the actual command
|
||||
*/
|
||||
#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
|
||||
architectures) */
|
||||
#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
|
||||
message sizes, etc. */
|
||||
|
||||
/*
|
||||
* These are used to wrap system calls.
|
||||
*
|
||||
* See architecture code for ugly details..
|
||||
*/
|
||||
struct ipc_kludge {
|
||||
struct msgbuf __user *msgp;
|
||||
long msgtyp;
|
||||
};
|
||||
|
||||
#define SEMOP 1
|
||||
#define SEMGET 2
|
||||
#define SEMCTL 3
|
||||
#define SEMTIMEDOP 4
|
||||
#define MSGSND 11
|
||||
#define MSGRCV 12
|
||||
#define MSGGET 13
|
||||
#define MSGCTL 14
|
||||
#define SHMAT 21
|
||||
#define SHMDT 22
|
||||
#define SHMGET 23
|
||||
#define SHMCTL 24
|
||||
|
||||
/* Used by the DIPC package, try and avoid reusing it */
|
||||
#define DIPC 25
|
||||
|
||||
#define IPCCALL(version,op) ((version)<<16 | (op))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/uidgid.h>
|
||||
#include <uapi/linux/ipc.h>
|
||||
|
||||
#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
|
||||
|
||||
|
@ -99,6 +23,4 @@ struct kern_ipc_perm
|
|||
void *security;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_IPC_H */
|
||||
|
|
|
@ -30,191 +30,11 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IPMI_H
|
||||
#define __LINUX_IPMI_H
|
||||
|
||||
#include <linux/ipmi_msgdefs.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <uapi/linux/ipmi.h>
|
||||
|
||||
/*
|
||||
* This file describes an interface to an IPMI driver. You have to
|
||||
* have a fairly good understanding of IPMI to use this, so go read
|
||||
* the specs first before actually trying to do anything.
|
||||
*
|
||||
* With that said, this driver provides a multi-user interface to the
|
||||
* IPMI driver, and it allows multiple IPMI physical interfaces below
|
||||
* the driver. The physical interfaces bind as a lower layer on the
|
||||
* driver. They appear as interfaces to the application using this
|
||||
* interface.
|
||||
*
|
||||
* Multi-user means that multiple applications may use the driver,
|
||||
* send commands, receive responses, etc. The driver keeps track of
|
||||
* commands the user sends and tracks the responses. The responses
|
||||
* will go back to the application that send the command. If the
|
||||
* response doesn't come back in time, the driver will return a
|
||||
* timeout error response to the application. Asynchronous events
|
||||
* from the BMC event queue will go to all users bound to the driver.
|
||||
* The incoming event queue in the BMC will automatically be flushed
|
||||
* if it becomes full and it is queried once a second to see if
|
||||
* anything is in it. Incoming commands to the driver will get
|
||||
* delivered as commands.
|
||||
*
|
||||
* This driver provides two main interfaces: one for in-kernel
|
||||
* applications and another for userland applications. The
|
||||
* capabilities are basically the same for both interface, although
|
||||
* the interfaces are somewhat different. The stuff in the
|
||||
* #ifdef __KERNEL__ below is the in-kernel interface. The userland
|
||||
* interface is defined later in the file. */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This is an overlay for all the address types, so it's easy to
|
||||
* determine the actual address type. This is kind of like addresses
|
||||
* work for sockets.
|
||||
*/
|
||||
#define IPMI_MAX_ADDR_SIZE 32
|
||||
struct ipmi_addr {
|
||||
/* Try to take these from the "Channel Medium Type" table
|
||||
in section 6.5 of the IPMI 1.5 manual. */
|
||||
int addr_type;
|
||||
short channel;
|
||||
char data[IPMI_MAX_ADDR_SIZE];
|
||||
};
|
||||
|
||||
/*
|
||||
* When the address is not used, the type will be set to this value.
|
||||
* The channel is the BMC's channel number for the channel (usually
|
||||
* 0), or IPMC_BMC_CHANNEL if communicating directly with the BMC.
|
||||
*/
|
||||
#define IPMI_SYSTEM_INTERFACE_ADDR_TYPE 0x0c
|
||||
struct ipmi_system_interface_addr {
|
||||
int addr_type;
|
||||
short channel;
|
||||
unsigned char lun;
|
||||
};
|
||||
|
||||
/* An IPMB Address. */
|
||||
#define IPMI_IPMB_ADDR_TYPE 0x01
|
||||
/* Used for broadcast get device id as described in section 17.9 of the
|
||||
IPMI 1.5 manual. */
|
||||
#define IPMI_IPMB_BROADCAST_ADDR_TYPE 0x41
|
||||
struct ipmi_ipmb_addr {
|
||||
int addr_type;
|
||||
short channel;
|
||||
unsigned char slave_addr;
|
||||
unsigned char lun;
|
||||
};
|
||||
|
||||
/*
|
||||
* A LAN Address. This is an address to/from a LAN interface bridged
|
||||
* by the BMC, not an address actually out on the LAN.
|
||||
*
|
||||
* A conscious decision was made here to deviate slightly from the IPMI
|
||||
* spec. We do not use rqSWID and rsSWID like it shows in the
|
||||
* message. Instead, we use remote_SWID and local_SWID. This means
|
||||
* that any message (a request or response) from another device will
|
||||
* always have exactly the same address. If you didn't do this,
|
||||
* requests and responses from the same device would have different
|
||||
* addresses, and that's not too cool.
|
||||
*
|
||||
* In this address, the remote_SWID is always the SWID the remote
|
||||
* message came from, or the SWID we are sending the message to.
|
||||
* local_SWID is always our SWID. Note that having our SWID in the
|
||||
* message is a little weird, but this is required.
|
||||
*/
|
||||
#define IPMI_LAN_ADDR_TYPE 0x04
|
||||
struct ipmi_lan_addr {
|
||||
int addr_type;
|
||||
short channel;
|
||||
unsigned char privilege;
|
||||
unsigned char session_handle;
|
||||
unsigned char remote_SWID;
|
||||
unsigned char local_SWID;
|
||||
unsigned char lun;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Channel for talking directly with the BMC. When using this
|
||||
* channel, This is for the system interface address type only. FIXME
|
||||
* - is this right, or should we use -1?
|
||||
*/
|
||||
#define IPMI_BMC_CHANNEL 0xf
|
||||
#define IPMI_NUM_CHANNELS 0x10
|
||||
|
||||
/*
|
||||
* Used to signify an "all channel" bitmask. This is more than the
|
||||
* actual number of channels because this is used in userland and
|
||||
* will cover us if the number of channels is extended.
|
||||
*/
|
||||
#define IPMI_CHAN_ALL (~0)
|
||||
|
||||
|
||||
/*
|
||||
* A raw IPMI message without any addressing. This covers both
|
||||
* commands and responses. The completion code is always the first
|
||||
* byte of data in the response (as the spec shows the messages laid
|
||||
* out).
|
||||
*/
|
||||
struct ipmi_msg {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
unsigned short data_len;
|
||||
unsigned char __user *data;
|
||||
};
|
||||
|
||||
struct kernel_ipmi_msg {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
unsigned short data_len;
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
/*
|
||||
* Various defines that are useful for IPMI applications.
|
||||
*/
|
||||
#define IPMI_INVALID_CMD_COMPLETION_CODE 0xC1
|
||||
#define IPMI_TIMEOUT_COMPLETION_CODE 0xC3
|
||||
#define IPMI_UNKNOWN_ERR_COMPLETION_CODE 0xff
|
||||
|
||||
|
||||
/*
|
||||
* Receive types for messages coming from the receive interface. This
|
||||
* is used for the receive in-kernel interface and in the receive
|
||||
* IOCTL.
|
||||
*
|
||||
* The "IPMI_RESPONSE_RESPNOSE_TYPE" is a little strange sounding, but
|
||||
* it allows you to get the message results when you send a response
|
||||
* message.
|
||||
*/
|
||||
#define IPMI_RESPONSE_RECV_TYPE 1 /* A response to a command */
|
||||
#define IPMI_ASYNC_EVENT_RECV_TYPE 2 /* Something from the event queue */
|
||||
#define IPMI_CMD_RECV_TYPE 3 /* A command from somewhere else */
|
||||
#define IPMI_RESPONSE_RESPONSE_TYPE 4 /* The response for
|
||||
a sent response, giving any
|
||||
error status for sending the
|
||||
response. When you send a
|
||||
response message, this will
|
||||
be returned. */
|
||||
#define IPMI_OEM_RECV_TYPE 5 /* The response for OEM Channels */
|
||||
|
||||
/* Note that async events and received commands do not have a completion
|
||||
code as the first byte of the incoming data, unlike a response. */
|
||||
|
||||
|
||||
/*
|
||||
* Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
|
||||
* setting is the default and means it will be set on certain
|
||||
* commands. Hard setting it on and off will override automatic
|
||||
* operation.
|
||||
*/
|
||||
#define IPMI_MAINTENANCE_MODE_AUTO 0
|
||||
#define IPMI_MAINTENANCE_MODE_OFF 1
|
||||
#define IPMI_MAINTENANCE_MODE_ON 2
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* The in-kernel interface.
|
||||
|
@ -493,244 +313,4 @@ struct ipmi_smi_info {
|
|||
/* This is to get the private info of ipmi_smi_t */
|
||||
extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
/*
|
||||
* The userland interface
|
||||
*/
|
||||
|
||||
/*
|
||||
* The userland interface for the IPMI driver is a standard character
|
||||
* device, with each instance of an interface registered as a minor
|
||||
* number under the major character device.
|
||||
*
|
||||
* The read and write calls do not work, to get messages in and out
|
||||
* requires ioctl calls because of the complexity of the data. select
|
||||
* and poll do work, so you can wait for input using the file
|
||||
* descriptor, you just can use read to get it.
|
||||
*
|
||||
* In general, you send a command down to the interface and receive
|
||||
* responses back. You can use the msgid value to correlate commands
|
||||
* and responses, the driver will take care of figuring out which
|
||||
* incoming messages are for which command and find the proper msgid
|
||||
* value to report. You will only receive reponses for commands you
|
||||
* send. Asynchronous events, however, go to all open users, so you
|
||||
* must be ready to handle these (or ignore them if you don't care).
|
||||
*
|
||||
* The address type depends upon the channel type. When talking
|
||||
* directly to the BMC (IPMC_BMC_CHANNEL), the address is ignored
|
||||
* (IPMI_UNUSED_ADDR_TYPE). When talking to an IPMB channel, you must
|
||||
* supply a valid IPMB address with the addr_type set properly.
|
||||
*
|
||||
* When talking to normal channels, the driver takes care of the
|
||||
* details of formatting and sending messages on that channel. You do
|
||||
* not, for instance, have to format a send command, you just send
|
||||
* whatever command you want to the channel, the driver will create
|
||||
* the send command, automatically issue receive command and get even
|
||||
* commands, and pass those up to the proper user.
|
||||
*/
|
||||
|
||||
|
||||
/* The magic IOCTL value for this interface. */
|
||||
#define IPMI_IOC_MAGIC 'i'
|
||||
|
||||
|
||||
/* Messages sent to the interface are this format. */
|
||||
struct ipmi_req {
|
||||
unsigned char __user *addr; /* Address to send the message to. */
|
||||
unsigned int addr_len;
|
||||
|
||||
long msgid; /* The sequence number for the message. This
|
||||
exact value will be reported back in the
|
||||
response to this request if it is a command.
|
||||
If it is a response, this will be used as
|
||||
the sequence value for the response. */
|
||||
|
||||
struct ipmi_msg msg;
|
||||
};
|
||||
/*
|
||||
* Send a message to the interfaces. error values are:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EINVAL - The address supplied was not valid, or the command
|
||||
* was not allowed.
|
||||
* - EMSGSIZE - The message to was too large.
|
||||
* - ENOMEM - Buffers could not be allocated for the command.
|
||||
*/
|
||||
#define IPMICTL_SEND_COMMAND _IOR(IPMI_IOC_MAGIC, 13, \
|
||||
struct ipmi_req)
|
||||
|
||||
/* Messages sent to the interface with timing parameters are this
|
||||
format. */
|
||||
struct ipmi_req_settime {
|
||||
struct ipmi_req req;
|
||||
|
||||
/* See ipmi_request_settime() above for details on these
|
||||
values. */
|
||||
int retries;
|
||||
unsigned int retry_time_ms;
|
||||
};
|
||||
/*
|
||||
* Send a message to the interfaces with timing parameters. error values
|
||||
* are:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EINVAL - The address supplied was not valid, or the command
|
||||
* was not allowed.
|
||||
* - EMSGSIZE - The message to was too large.
|
||||
* - ENOMEM - Buffers could not be allocated for the command.
|
||||
*/
|
||||
#define IPMICTL_SEND_COMMAND_SETTIME _IOR(IPMI_IOC_MAGIC, 21, \
|
||||
struct ipmi_req_settime)
|
||||
|
||||
/* Messages received from the interface are this format. */
|
||||
struct ipmi_recv {
|
||||
int recv_type; /* Is this a command, response or an
|
||||
asyncronous event. */
|
||||
|
||||
unsigned char __user *addr; /* Address the message was from is put
|
||||
here. The caller must supply the
|
||||
memory. */
|
||||
unsigned int addr_len; /* The size of the address buffer.
|
||||
The caller supplies the full buffer
|
||||
length, this value is updated to
|
||||
the actual message length when the
|
||||
message is received. */
|
||||
|
||||
long msgid; /* The sequence number specified in the request
|
||||
if this is a response. If this is a command,
|
||||
this will be the sequence number from the
|
||||
command. */
|
||||
|
||||
struct ipmi_msg msg; /* The data field must point to a buffer.
|
||||
The data_size field must be set to the
|
||||
size of the message buffer. The
|
||||
caller supplies the full buffer
|
||||
length, this value is updated to the
|
||||
actual message length when the message
|
||||
is received. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Receive a message. error values:
|
||||
* - EAGAIN - no messages in the queue.
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EINVAL - The address supplied was not valid.
|
||||
* - EMSGSIZE - The message to was too large to fit into the message buffer,
|
||||
* the message will be left in the buffer. */
|
||||
#define IPMICTL_RECEIVE_MSG _IOWR(IPMI_IOC_MAGIC, 12, \
|
||||
struct ipmi_recv)
|
||||
|
||||
/*
|
||||
* Like RECEIVE_MSG, but if the message won't fit in the buffer, it
|
||||
* will truncate the contents instead of leaving the data in the
|
||||
* buffer.
|
||||
*/
|
||||
#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, \
|
||||
struct ipmi_recv)
|
||||
|
||||
/* Register to get commands from other entities on this interface. */
|
||||
struct ipmi_cmdspec {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
};
|
||||
|
||||
/*
|
||||
* Register to receive a specific command. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EBUSY - The netfn/cmd supplied was already in use.
|
||||
* - ENOMEM - could not allocate memory for the entry.
|
||||
*/
|
||||
#define IPMICTL_REGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 14, \
|
||||
struct ipmi_cmdspec)
|
||||
/*
|
||||
* Unregister a regsitered command. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - ENOENT - The netfn/cmd was not found registered for this user.
|
||||
*/
|
||||
#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
|
||||
struct ipmi_cmdspec)
|
||||
|
||||
/*
|
||||
* Register to get commands from other entities on specific channels.
|
||||
* This way, you can only listen on specific channels, or have messages
|
||||
* from some channels go to one place and other channels to someplace
|
||||
* else. The chans field is a bitmask, (1 << channel) for each channel.
|
||||
* It may be IPMI_CHAN_ALL for all channels.
|
||||
*/
|
||||
struct ipmi_cmdspec_chans {
|
||||
unsigned int netfn;
|
||||
unsigned int cmd;
|
||||
unsigned int chans;
|
||||
};
|
||||
|
||||
/*
|
||||
* Register to receive a specific command on specific channels. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EBUSY - One of the netfn/cmd/chans supplied was already in use.
|
||||
* - ENOMEM - could not allocate memory for the entry.
|
||||
*/
|
||||
#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
|
||||
struct ipmi_cmdspec_chans)
|
||||
/*
|
||||
* Unregister some netfn/cmd/chans. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - ENOENT - None of the netfn/cmd/chans were found registered for this user.
|
||||
*/
|
||||
#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
|
||||
struct ipmi_cmdspec_chans)
|
||||
|
||||
/*
|
||||
* Set whether this interface receives events. Note that the first
|
||||
* user registered for events will get all pending events for the
|
||||
* interface. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
*/
|
||||
#define IPMICTL_SET_GETS_EVENTS_CMD _IOR(IPMI_IOC_MAGIC, 16, int)
|
||||
|
||||
/*
|
||||
* Set and get the slave address and LUN that we will use for our
|
||||
* source messages. Note that this affects the interface, not just
|
||||
* this user, so it will affect all users of this interface. This is
|
||||
* so some initialization code can come in and do the OEM-specific
|
||||
* things it takes to determine your address (if not the BMC) and set
|
||||
* it for everyone else. You should probably leave the LUN alone.
|
||||
*/
|
||||
struct ipmi_channel_lun_address_set {
|
||||
unsigned short channel;
|
||||
unsigned char value;
|
||||
};
|
||||
#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD \
|
||||
_IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
|
||||
#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD \
|
||||
_IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
|
||||
#define IPMICTL_SET_MY_CHANNEL_LUN_CMD \
|
||||
_IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
|
||||
#define IPMICTL_GET_MY_CHANNEL_LUN_CMD \
|
||||
_IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
|
||||
/* Legacy interfaces, these only set IPMB 0. */
|
||||
#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
|
||||
#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
|
||||
#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
|
||||
#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
|
||||
|
||||
/*
|
||||
* Get/set the default timing values for an interface. You shouldn't
|
||||
* generally mess with these.
|
||||
*/
|
||||
struct ipmi_timing_parms {
|
||||
int retries;
|
||||
unsigned int retry_time_ms;
|
||||
};
|
||||
#define IPMICTL_SET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 22, \
|
||||
struct ipmi_timing_parms)
|
||||
#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
|
||||
struct ipmi_timing_parms)
|
||||
|
||||
/*
|
||||
* Set the maintenance mode. See ipmi_set_maintenance_mode() above
|
||||
* for a description of what this does.
|
||||
*/
|
||||
#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
|
||||
#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
|
||||
|
||||
#endif /* __LINUX_IPMI_H */
|
||||
|
|
|
@ -1,134 +1,9 @@
|
|||
#ifndef _IPV6_H
|
||||
#define _IPV6_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/in6.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <uapi/linux/ipv6.h>
|
||||
|
||||
/* The latest drafts declared increase in minimal mtu up to 1280. */
|
||||
|
||||
#define IPV6_MIN_MTU 1280
|
||||
|
||||
/*
|
||||
* Advanced API
|
||||
* source interface/address selection, source routing, etc...
|
||||
* *under construction*
|
||||
*/
|
||||
|
||||
|
||||
struct in6_pktinfo {
|
||||
struct in6_addr ipi6_addr;
|
||||
int ipi6_ifindex;
|
||||
};
|
||||
|
||||
struct ip6_mtuinfo {
|
||||
struct sockaddr_in6 ip6m_addr;
|
||||
__u32 ip6m_mtu;
|
||||
};
|
||||
|
||||
struct in6_ifreq {
|
||||
struct in6_addr ifr6_addr;
|
||||
__u32 ifr6_prefixlen;
|
||||
int ifr6_ifindex;
|
||||
};
|
||||
|
||||
#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
|
||||
#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
|
||||
#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
|
||||
|
||||
/*
|
||||
* routing header
|
||||
*/
|
||||
struct ipv6_rt_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen;
|
||||
__u8 type;
|
||||
__u8 segments_left;
|
||||
|
||||
/*
|
||||
* type specific data
|
||||
* variable length field
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
struct ipv6_opt_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen;
|
||||
/*
|
||||
* TLV encoded option data follows.
|
||||
*/
|
||||
} __attribute__((packed)); /* required for some archs */
|
||||
|
||||
#define ipv6_destopt_hdr ipv6_opt_hdr
|
||||
#define ipv6_hopopt_hdr ipv6_opt_hdr
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define ipv6_optlen(p) (((p)->hdrlen+1) << 3)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* routing header type 0 (used in cmsghdr struct)
|
||||
*/
|
||||
|
||||
struct rt0_hdr {
|
||||
struct ipv6_rt_hdr rt_hdr;
|
||||
__u32 reserved;
|
||||
struct in6_addr addr[0];
|
||||
|
||||
#define rt0_type rt_hdr.type
|
||||
};
|
||||
|
||||
/*
|
||||
* routing header type 2
|
||||
*/
|
||||
|
||||
struct rt2_hdr {
|
||||
struct ipv6_rt_hdr rt_hdr;
|
||||
__u32 reserved;
|
||||
struct in6_addr addr;
|
||||
|
||||
#define rt2_type rt_hdr.type
|
||||
};
|
||||
|
||||
/*
|
||||
* home address option in destination options header
|
||||
*/
|
||||
|
||||
struct ipv6_destopt_hao {
|
||||
__u8 type;
|
||||
__u8 length;
|
||||
struct in6_addr addr;
|
||||
} __attribute__((packed));
|
||||
|
||||
/*
|
||||
* IPv6 fixed header
|
||||
*
|
||||
* BEWARE, it is incorrect. The first 4 bits of flow_lbl
|
||||
* are glued to priority now, forming "class".
|
||||
*/
|
||||
|
||||
struct ipv6hdr {
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 priority:4,
|
||||
version:4;
|
||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||
__u8 version:4,
|
||||
priority:4;
|
||||
#else
|
||||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 flow_lbl[3];
|
||||
|
||||
__be16 payload_len;
|
||||
__u8 nexthdr;
|
||||
__u8 hop_limit;
|
||||
|
||||
struct in6_addr saddr;
|
||||
struct in6_addr daddr;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/*
|
||||
* This structure contains configuration options per IPv6 link.
|
||||
*/
|
||||
|
@ -180,43 +55,6 @@ struct ipv6_params {
|
|||
__s32 autoconf;
|
||||
};
|
||||
extern struct ipv6_params ipv6_defaults;
|
||||
#endif
|
||||
|
||||
/* index values for the variables in ipv6_devconf */
|
||||
enum {
|
||||
DEVCONF_FORWARDING = 0,
|
||||
DEVCONF_HOPLIMIT,
|
||||
DEVCONF_MTU6,
|
||||
DEVCONF_ACCEPT_RA,
|
||||
DEVCONF_ACCEPT_REDIRECTS,
|
||||
DEVCONF_AUTOCONF,
|
||||
DEVCONF_DAD_TRANSMITS,
|
||||
DEVCONF_RTR_SOLICITS,
|
||||
DEVCONF_RTR_SOLICIT_INTERVAL,
|
||||
DEVCONF_RTR_SOLICIT_DELAY,
|
||||
DEVCONF_USE_TEMPADDR,
|
||||
DEVCONF_TEMP_VALID_LFT,
|
||||
DEVCONF_TEMP_PREFERED_LFT,
|
||||
DEVCONF_REGEN_MAX_RETRY,
|
||||
DEVCONF_MAX_DESYNC_FACTOR,
|
||||
DEVCONF_MAX_ADDRESSES,
|
||||
DEVCONF_FORCE_MLD_VERSION,
|
||||
DEVCONF_ACCEPT_RA_DEFRTR,
|
||||
DEVCONF_ACCEPT_RA_PINFO,
|
||||
DEVCONF_ACCEPT_RA_RTR_PREF,
|
||||
DEVCONF_RTR_PROBE_INTERVAL,
|
||||
DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
|
||||
DEVCONF_PROXY_NDP,
|
||||
DEVCONF_OPTIMISTIC_DAD,
|
||||
DEVCONF_ACCEPT_SOURCE_ROUTE,
|
||||
DEVCONF_MC_FORWARDING,
|
||||
DEVCONF_DISABLE_IPV6,
|
||||
DEVCONF_ACCEPT_DAD,
|
||||
DEVCONF_FORCE_TLLAO,
|
||||
DEVCONF_MAX
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/icmpv6.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/udp.h>
|
||||
|
@ -541,6 +379,4 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
|
|||
(ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \
|
||||
(!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _IPV6_H */
|
||||
|
|
|
@ -9,54 +9,11 @@
|
|||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_IPV6_ROUTE_H
|
||||
#define _LINUX_IPV6_ROUTE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/ipv6_route.h>
|
||||
|
||||
#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
|
||||
#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
|
||||
fallback, no routers on link */
|
||||
#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
|
||||
#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */
|
||||
#define RTF_ANYCAST 0x00100000 /* Anycast */
|
||||
|
||||
#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
|
||||
#define RTF_EXPIRES 0x00400000
|
||||
|
||||
#define RTF_ROUTEINFO 0x00800000 /* route information - RA */
|
||||
|
||||
#define RTF_CACHE 0x01000000 /* cache entry */
|
||||
#define RTF_FLOW 0x02000000 /* flow significant route */
|
||||
#define RTF_POLICY 0x04000000 /* policy route */
|
||||
|
||||
#define RTF_PREF(pref) ((pref) << 27)
|
||||
#define RTF_PREF_MASK 0x18000000
|
||||
|
||||
#define RTF_LOCAL 0x80000000
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27)
|
||||
#define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */
|
||||
#endif
|
||||
|
||||
struct in6_rtmsg {
|
||||
struct in6_addr rtmsg_dst;
|
||||
struct in6_addr rtmsg_src;
|
||||
struct in6_addr rtmsg_gateway;
|
||||
__u32 rtmsg_type;
|
||||
__u16 rtmsg_dst_len;
|
||||
__u16 rtmsg_src_len;
|
||||
__u32 rtmsg_metric;
|
||||
unsigned long rtmsg_info;
|
||||
__u32 rtmsg_flags;
|
||||
int rtmsg_ifindex;
|
||||
};
|
||||
|
||||
#define RTMSG_NEWDEVICE 0x11
|
||||
#define RTMSG_DELDEVICE 0x12
|
||||
#define RTMSG_NEWROUTE 0x21
|
||||
#define RTMSG_DELROUTE 0x22
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#ifndef _LINUX_IRQNR_H
|
||||
#define _LINUX_IRQNR_H
|
||||
|
||||
/*
|
||||
* Generic irq_desc iterators:
|
||||
*/
|
||||
#ifdef __KERNEL__
|
||||
#include <uapi/linux/irqnr.h>
|
||||
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS
|
||||
#include <asm/irq.h>
|
||||
|
@ -57,6 +55,4 @@ unsigned int irq_get_next_irq(unsigned int offset);
|
|||
#define for_each_irq_nr(irq) \
|
||||
for (irq = 0; irq < nr_irqs; irq++)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,136 +10,9 @@
|
|||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ISDN_H__
|
||||
#define __ISDN_H__
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/tty.h>
|
||||
|
||||
#define ISDN_MAX_DRIVERS 32
|
||||
#define ISDN_MAX_CHANNELS 64
|
||||
|
||||
/* New ioctl-codes */
|
||||
#define IIOCNETAIF _IO('I',1)
|
||||
#define IIOCNETDIF _IO('I',2)
|
||||
#define IIOCNETSCF _IO('I',3)
|
||||
#define IIOCNETGCF _IO('I',4)
|
||||
#define IIOCNETANM _IO('I',5)
|
||||
#define IIOCNETDNM _IO('I',6)
|
||||
#define IIOCNETGNM _IO('I',7)
|
||||
#define IIOCGETSET _IO('I',8) /* no longer supported */
|
||||
#define IIOCSETSET _IO('I',9) /* no longer supported */
|
||||
#define IIOCSETVER _IO('I',10)
|
||||
#define IIOCNETHUP _IO('I',11)
|
||||
#define IIOCSETGST _IO('I',12)
|
||||
#define IIOCSETBRJ _IO('I',13)
|
||||
#define IIOCSIGPRF _IO('I',14)
|
||||
#define IIOCGETPRF _IO('I',15)
|
||||
#define IIOCSETPRF _IO('I',16)
|
||||
#define IIOCGETMAP _IO('I',17)
|
||||
#define IIOCSETMAP _IO('I',18)
|
||||
#define IIOCNETASL _IO('I',19)
|
||||
#define IIOCNETDIL _IO('I',20)
|
||||
#define IIOCGETCPS _IO('I',21)
|
||||
#define IIOCGETDVR _IO('I',22)
|
||||
#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
|
||||
#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
|
||||
|
||||
#define IIOCNETALN _IO('I',32)
|
||||
#define IIOCNETDLN _IO('I',33)
|
||||
|
||||
#define IIOCNETGPN _IO('I',34)
|
||||
|
||||
#define IIOCDBGVAR _IO('I',127)
|
||||
|
||||
#define IIOCDRVCTL _IO('I',128)
|
||||
|
||||
/* cisco hdlck device private ioctls */
|
||||
#define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
|
||||
#define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
|
||||
#define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
|
||||
#define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
|
||||
|
||||
/* Packet encapsulations for net-interfaces */
|
||||
#define ISDN_NET_ENCAP_ETHER 0
|
||||
#define ISDN_NET_ENCAP_RAWIP 1
|
||||
#define ISDN_NET_ENCAP_IPTYP 2
|
||||
#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
|
||||
#define ISDN_NET_ENCAP_SYNCPPP 4
|
||||
#define ISDN_NET_ENCAP_UIHDLC 5
|
||||
#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
|
||||
#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
|
||||
#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
|
||||
|
||||
/* Facility which currently uses an ISDN-channel */
|
||||
#define ISDN_USAGE_NONE 0
|
||||
#define ISDN_USAGE_RAW 1
|
||||
#define ISDN_USAGE_MODEM 2
|
||||
#define ISDN_USAGE_NET 3
|
||||
#define ISDN_USAGE_VOICE 4
|
||||
#define ISDN_USAGE_FAX 5
|
||||
#define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
|
||||
#define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
|
||||
#define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
|
||||
#define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
|
||||
|
||||
#define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
|
||||
#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
|
||||
#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
|
||||
|
||||
#define ISDN_MSNLEN 32
|
||||
#define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
|
||||
#define TTY_DV 0x06 /* Data version for iprofd etc. */
|
||||
|
||||
#define INF_DV 0x01 /* Data version for /dev/isdninfo */
|
||||
|
||||
typedef struct {
|
||||
char drvid[25];
|
||||
unsigned long arg;
|
||||
} isdn_ioctl_struct;
|
||||
|
||||
typedef struct {
|
||||
char name[10];
|
||||
char phone[ISDN_MSNLEN];
|
||||
int outgoing;
|
||||
} isdn_net_ioctl_phone;
|
||||
|
||||
typedef struct {
|
||||
char name[10]; /* Name of interface */
|
||||
char master[10]; /* Name of Master for Bundling */
|
||||
char slave[10]; /* Name of Slave for Bundling */
|
||||
char eaz[256]; /* EAZ/MSN */
|
||||
char drvid[25]; /* DriverId for Bindings */
|
||||
int onhtime; /* Hangup-Timeout */
|
||||
int charge; /* Charge-Units */
|
||||
int l2_proto; /* Layer-2 protocol */
|
||||
int l3_proto; /* Layer-3 protocol */
|
||||
int p_encap; /* Encapsulation */
|
||||
int exclusive; /* Channel, if bound exclusive */
|
||||
int dialmax; /* Dial Retry-Counter */
|
||||
int slavedelay; /* Delay until slave starts up */
|
||||
int cbdelay; /* Delay before Callback */
|
||||
int chargehup; /* Flag: Charge-Hangup */
|
||||
int ihup; /* Flag: Hangup-Timeout on incoming line */
|
||||
int secure; /* Flag: Secure */
|
||||
int callback; /* Flag: Callback */
|
||||
int cbhup; /* Flag: Reject Call before Callback */
|
||||
int pppbind; /* ippp device for bindings */
|
||||
int chargeint; /* Use fixed charge interval length */
|
||||
int triggercps; /* BogoCPS needed for triggering slave */
|
||||
int dialtimeout; /* Dial-Timeout */
|
||||
int dialwait; /* Time to wait after failed dial */
|
||||
int dialmode; /* Flag: off / on / auto */
|
||||
} isdn_net_ioctl_cfg;
|
||||
|
||||
#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
|
||||
#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
|
||||
#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
|
||||
#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
|
||||
#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
|
@ -163,6 +36,7 @@ typedef struct {
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <uapi/linux/isdn.h>
|
||||
|
||||
#define ISDN_TTY_MAJOR 43
|
||||
#define ISDN_TTYAUX_MAJOR 44
|
||||
|
@ -595,6 +469,4 @@ typedef struct isdn_devt {
|
|||
extern isdn_dev *dev;
|
||||
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ISDN_H__ */
|
||||
|
|
|
@ -9,26 +9,12 @@
|
|||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ISDN_DIVERTIF_H
|
||||
#define _LINUX_ISDN_DIVERTIF_H
|
||||
|
||||
/***********************************************************/
|
||||
/* magic value is also used to control version information */
|
||||
/***********************************************************/
|
||||
#define DIVERT_IF_MAGIC 0x25873401
|
||||
#define DIVERT_CMD_REG 0x00 /* register command */
|
||||
#define DIVERT_CMD_REL 0x01 /* release command */
|
||||
#define DIVERT_NO_ERR 0x00 /* return value no error */
|
||||
#define DIVERT_CMD_ERR 0x01 /* invalid cmd */
|
||||
#define DIVERT_VER_ERR 0x02 /* magic/version invalid */
|
||||
#define DIVERT_REG_ERR 0x03 /* module already registered */
|
||||
#define DIVERT_REL_ERR 0x04 /* module not registered */
|
||||
#define DIVERT_REG_NAME isdn_register_divert
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/isdnif.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/isdn_divertif.h>
|
||||
|
||||
/***************************************************************/
|
||||
/* structure exchanging data between isdn hl and divert module */
|
||||
|
@ -46,6 +32,4 @@ typedef struct
|
|||
/* function register */
|
||||
/*********************/
|
||||
extern int DIVERT_REG_NAME(isdn_divert_if *);
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_ISDN_DIVERTIF_H */
|
||||
|
|
|
@ -9,68 +9,16 @@
|
|||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ISDN_PPP_H
|
||||
#define _LINUX_ISDN_PPP_H
|
||||
|
||||
#define CALLTYPE_INCOMING 0x1
|
||||
#define CALLTYPE_OUTGOING 0x2
|
||||
#define CALLTYPE_CALLBACK 0x4
|
||||
|
||||
#define IPPP_VERSION "2.2.0"
|
||||
|
||||
struct pppcallinfo
|
||||
{
|
||||
int calltype;
|
||||
unsigned char local_num[64];
|
||||
unsigned char remote_num[64];
|
||||
int charge_units;
|
||||
};
|
||||
|
||||
#define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo)
|
||||
#define PPPIOCBUNDLE _IOW('t',129,int)
|
||||
#define PPPIOCGMPFLAGS _IOR('t',130,int)
|
||||
#define PPPIOCSMPFLAGS _IOW('t',131,int)
|
||||
#define PPPIOCSMPMTU _IOW('t',132,int)
|
||||
#define PPPIOCSMPMRU _IOW('t',133,int)
|
||||
#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8])
|
||||
#define PPPIOCSCOMPRESSOR _IOW('t',135,int)
|
||||
#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
|
||||
|
||||
|
||||
#define SC_MP_PROT 0x00000200
|
||||
#define SC_REJ_MP_PROT 0x00000400
|
||||
#define SC_OUT_SHORT_SEQ 0x00000800
|
||||
#define SC_IN_SHORT_SEQ 0x00004000
|
||||
|
||||
#define SC_DECOMP_ON 0x01
|
||||
#define SC_COMP_ON 0x02
|
||||
#define SC_DECOMP_DISCARD 0x04
|
||||
#define SC_COMP_DISCARD 0x08
|
||||
#define SC_LINK_DECOMP_ON 0x10
|
||||
#define SC_LINK_COMP_ON 0x20
|
||||
#define SC_LINK_DECOMP_DISCARD 0x40
|
||||
#define SC_LINK_COMP_DISCARD 0x80
|
||||
|
||||
#define ISDN_PPP_COMP_MAX_OPTIONS 16
|
||||
|
||||
#define IPPP_COMP_FLAG_XMIT 0x1
|
||||
#define IPPP_COMP_FLAG_LINK 0x2
|
||||
|
||||
struct isdn_ppp_comp_data {
|
||||
int num;
|
||||
unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS];
|
||||
int optlen;
|
||||
int flags;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_IPPP_FILTER
|
||||
#include <linux/filter.h>
|
||||
#endif
|
||||
#include <uapi/linux/isdn_ppp.h>
|
||||
|
||||
#define DECOMP_ERR_NOMEM (-10)
|
||||
|
||||
|
@ -244,5 +192,4 @@ struct ippp_struct {
|
|||
unsigned long compflags;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_ISDN_PPP_H */
|
||||
|
|
|
@ -10,51 +10,12 @@
|
|||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ISDNIF_H__
|
||||
#define __ISDNIF_H__
|
||||
|
||||
|
||||
/*
|
||||
* Values for general protocol-selection
|
||||
*/
|
||||
#define ISDN_PTYPE_UNKNOWN 0 /* Protocol undefined */
|
||||
#define ISDN_PTYPE_1TR6 1 /* german 1TR6-protocol */
|
||||
#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
|
||||
#define ISDN_PTYPE_LEASED 3 /* for leased lines */
|
||||
#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
|
||||
#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
|
||||
|
||||
/*
|
||||
* Values for Layer-2-protocol-selection
|
||||
*/
|
||||
#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
|
||||
#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
|
||||
#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
|
||||
#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
|
||||
#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
|
||||
#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
|
||||
#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
|
||||
#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
|
||||
#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
|
||||
#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
|
||||
#define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */
|
||||
#define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */
|
||||
#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */
|
||||
#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
|
||||
|
||||
/*
|
||||
* Values for Layer-3-protocol-selection
|
||||
*/
|
||||
#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
|
||||
#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */
|
||||
#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */
|
||||
#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */
|
||||
#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <uapi/linux/isdnif.h>
|
||||
|
||||
/***************************************************************************/
|
||||
/* Extensions made by Werner Cornelius (werner@ikt.de) */
|
||||
|
@ -541,6 +502,4 @@ typedef struct {
|
|||
extern int register_isdn(isdn_if*);
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ISDNIF_H__ */
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#ifndef _LINUX_JOYSTICK_H
|
||||
#define _LINUX_JOYSTICK_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1996-2000 Vojtech Pavlik
|
||||
*
|
||||
* Sponsored by SuSE
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -26,113 +22,11 @@
|
|||
* e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
|
||||
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
|
||||
*/
|
||||
#ifndef _LINUX_JOYSTICK_H
|
||||
#define _LINUX_JOYSTICK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/input.h>
|
||||
#include <uapi/linux/joystick.h>
|
||||
|
||||
/*
|
||||
* Version
|
||||
*/
|
||||
|
||||
#define JS_VERSION 0x020100
|
||||
|
||||
/*
|
||||
* Types and constants for reading from /dev/js
|
||||
*/
|
||||
|
||||
#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
|
||||
#define JS_EVENT_AXIS 0x02 /* joystick moved */
|
||||
#define JS_EVENT_INIT 0x80 /* initial state of device */
|
||||
|
||||
struct js_event {
|
||||
__u32 time; /* event timestamp in milliseconds */
|
||||
__s16 value; /* value */
|
||||
__u8 type; /* event type */
|
||||
__u8 number; /* axis/button number */
|
||||
};
|
||||
|
||||
/*
|
||||
* IOCTL commands for joystick driver
|
||||
*/
|
||||
|
||||
#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
|
||||
|
||||
#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
|
||||
#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
|
||||
#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
|
||||
|
||||
#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
|
||||
#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
|
||||
|
||||
#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
|
||||
#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
|
||||
#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
|
||||
#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
|
||||
|
||||
/*
|
||||
* Types and constants for get/set correction
|
||||
*/
|
||||
|
||||
#define JS_CORR_NONE 0x00 /* returns raw values */
|
||||
#define JS_CORR_BROKEN 0x01 /* broken line */
|
||||
|
||||
struct js_corr {
|
||||
__s32 coef[8];
|
||||
__s16 prec;
|
||||
__u16 type;
|
||||
};
|
||||
|
||||
/*
|
||||
* v0.x compatibility definitions
|
||||
*/
|
||||
|
||||
#define JS_RETURN sizeof(struct JS_DATA_TYPE)
|
||||
#define JS_TRUE 1
|
||||
#define JS_FALSE 0
|
||||
#define JS_X_0 0x01
|
||||
#define JS_Y_0 0x02
|
||||
#define JS_X_1 0x04
|
||||
#define JS_Y_1 0x08
|
||||
#define JS_MAX 2
|
||||
|
||||
#define JS_DEF_TIMEOUT 0x1300
|
||||
#define JS_DEF_CORR 0
|
||||
#define JS_DEF_TIMELIMIT 10L
|
||||
|
||||
#define JS_SET_CAL 1
|
||||
#define JS_GET_CAL 2
|
||||
#define JS_SET_TIMEOUT 3
|
||||
#define JS_GET_TIMEOUT 4
|
||||
#define JS_SET_TIMELIMIT 5
|
||||
#define JS_GET_TIMELIMIT 6
|
||||
#define JS_GET_ALL 7
|
||||
#define JS_SET_ALL 8
|
||||
|
||||
struct JS_DATA_TYPE {
|
||||
__s32 buttons;
|
||||
__s32 x;
|
||||
__s32 y;
|
||||
};
|
||||
|
||||
struct JS_DATA_SAVE_TYPE_32 {
|
||||
__s32 JS_TIMEOUT;
|
||||
__s32 BUSY;
|
||||
__s32 JS_EXPIRETIME;
|
||||
__s32 JS_TIMELIMIT;
|
||||
struct JS_DATA_TYPE JS_SAVE;
|
||||
struct JS_DATA_TYPE JS_CORR;
|
||||
};
|
||||
|
||||
struct JS_DATA_SAVE_TYPE_64 {
|
||||
__s32 JS_TIMEOUT;
|
||||
__s32 BUSY;
|
||||
__s64 JS_EXPIRETIME;
|
||||
__s64 JS_TIMELIMIT;
|
||||
struct JS_DATA_TYPE JS_SAVE;
|
||||
struct JS_DATA_TYPE JS_CORR;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#if BITS_PER_LONG == 64
|
||||
#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
|
||||
#elif BITS_PER_LONG == 32
|
||||
|
@ -140,6 +34,4 @@ struct JS_DATA_SAVE_TYPE_64 {
|
|||
#else
|
||||
#error Unexpected BITS_PER_LONG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_JOYSTICK_H */
|
||||
|
|
|
@ -1,186 +1,7 @@
|
|||
#ifndef _LINUX_KD_H
|
||||
#define _LINUX_KD_H
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/* 0x4B is 'K', to avoid collision with termios and vt */
|
||||
#include <uapi/linux/kd.h>
|
||||
|
||||
#define GIO_FONT 0x4B60 /* gets font in expanded form */
|
||||
#define PIO_FONT 0x4B61 /* use font in expanded form */
|
||||
|
||||
#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
|
||||
#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
|
||||
struct consolefontdesc {
|
||||
unsigned short charcount; /* characters in font (256 or 512) */
|
||||
unsigned short charheight; /* scan lines per character (1-32) */
|
||||
char __user *chardata; /* font data in expanded form */
|
||||
};
|
||||
|
||||
#define PIO_FONTRESET 0x4B6D /* reset to default font */
|
||||
|
||||
#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
|
||||
#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
|
||||
|
||||
#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
|
||||
#define KDMKTONE 0x4B30 /* generate tone */
|
||||
|
||||
#define KDGETLED 0x4B31 /* return current led state */
|
||||
#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
|
||||
#define LED_SCR 0x01 /* scroll lock led */
|
||||
#define LED_NUM 0x02 /* num lock led */
|
||||
#define LED_CAP 0x04 /* caps lock led */
|
||||
|
||||
#define KDGKBTYPE 0x4B33 /* get keyboard type */
|
||||
#define KB_84 0x01
|
||||
#define KB_101 0x02 /* this is what we always answer */
|
||||
#define KB_OTHER 0x03
|
||||
|
||||
#define KDADDIO 0x4B34 /* add i/o port as valid */
|
||||
#define KDDELIO 0x4B35 /* del i/o port as valid */
|
||||
#define KDENABIO 0x4B36 /* enable i/o to video board */
|
||||
#define KDDISABIO 0x4B37 /* disable i/o to video board */
|
||||
|
||||
#define KDSETMODE 0x4B3A /* set text/graphics mode */
|
||||
#define KD_TEXT 0x00
|
||||
#define KD_GRAPHICS 0x01
|
||||
#define KD_TEXT0 0x02 /* obsolete */
|
||||
#define KD_TEXT1 0x03 /* obsolete */
|
||||
#define KDGETMODE 0x4B3B /* get current mode */
|
||||
|
||||
#define KDMAPDISP 0x4B3C /* map display into address space */
|
||||
#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
|
||||
|
||||
typedef char scrnmap_t;
|
||||
#define E_TABSZ 256
|
||||
#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
|
||||
#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
|
||||
#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
|
||||
#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
|
||||
|
||||
#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
|
||||
struct unipair {
|
||||
unsigned short unicode;
|
||||
unsigned short fontpos;
|
||||
};
|
||||
struct unimapdesc {
|
||||
unsigned short entry_ct;
|
||||
struct unipair __user *entries;
|
||||
};
|
||||
#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
|
||||
#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
|
||||
struct unimapinit {
|
||||
unsigned short advised_hashsize; /* 0 if no opinion */
|
||||
unsigned short advised_hashstep; /* 0 if no opinion */
|
||||
unsigned short advised_hashlevel; /* 0 if no opinion */
|
||||
};
|
||||
|
||||
#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
|
||||
#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
|
||||
|
||||
#define K_RAW 0x00
|
||||
#define K_XLATE 0x01
|
||||
#define K_MEDIUMRAW 0x02
|
||||
#define K_UNICODE 0x03
|
||||
#define K_OFF 0x04
|
||||
#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
|
||||
#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
|
||||
|
||||
#define K_METABIT 0x03
|
||||
#define K_ESCPREFIX 0x04
|
||||
#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
|
||||
#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
|
||||
|
||||
#define K_SCROLLLOCK 0x01
|
||||
#define K_NUMLOCK 0x02
|
||||
#define K_CAPSLOCK 0x04
|
||||
#define KDGKBLED 0x4B64 /* get led flags (not lights) */
|
||||
#define KDSKBLED 0x4B65 /* set led flags (not lights) */
|
||||
|
||||
struct kbentry {
|
||||
unsigned char kb_table;
|
||||
unsigned char kb_index;
|
||||
unsigned short kb_value;
|
||||
};
|
||||
#define K_NORMTAB 0x00
|
||||
#define K_SHIFTTAB 0x01
|
||||
#define K_ALTTAB 0x02
|
||||
#define K_ALTSHIFTTAB 0x03
|
||||
|
||||
#define KDGKBENT 0x4B46 /* gets one entry in translation table */
|
||||
#define KDSKBENT 0x4B47 /* sets one entry in translation table */
|
||||
|
||||
struct kbsentry {
|
||||
unsigned char kb_func;
|
||||
unsigned char kb_string[512];
|
||||
};
|
||||
#define KDGKBSENT 0x4B48 /* gets one function key string entry */
|
||||
#define KDSKBSENT 0x4B49 /* sets one function key string entry */
|
||||
|
||||
struct kbdiacr {
|
||||
unsigned char diacr, base, result;
|
||||
};
|
||||
struct kbdiacrs {
|
||||
unsigned int kb_cnt; /* number of entries in following array */
|
||||
struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
|
||||
};
|
||||
#define KDGKBDIACR 0x4B4A /* read kernel accent table */
|
||||
#define KDSKBDIACR 0x4B4B /* write kernel accent table */
|
||||
|
||||
struct kbdiacruc {
|
||||
unsigned int diacr, base, result;
|
||||
};
|
||||
struct kbdiacrsuc {
|
||||
unsigned int kb_cnt; /* number of entries in following array */
|
||||
struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
|
||||
};
|
||||
#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
|
||||
#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
|
||||
|
||||
struct kbkeycode {
|
||||
unsigned int scancode, keycode;
|
||||
};
|
||||
#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
|
||||
#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
|
||||
|
||||
#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
|
||||
|
||||
struct kbd_repeat {
|
||||
int delay; /* in msec; <= 0: don't change */
|
||||
int period; /* in msec; <= 0: don't change */
|
||||
/* earlier this field was misnamed "rate" */
|
||||
};
|
||||
|
||||
#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
|
||||
* actually used values are returned */
|
||||
|
||||
#define KDFONTOP 0x4B72 /* font operations */
|
||||
|
||||
struct console_font_op {
|
||||
unsigned int op; /* operation code KD_FONT_OP_* */
|
||||
unsigned int flags; /* KD_FONT_FLAG_* */
|
||||
unsigned int width, height; /* font size */
|
||||
unsigned int charcount;
|
||||
unsigned char __user *data; /* font data with height fixed to 32 */
|
||||
};
|
||||
|
||||
struct console_font {
|
||||
unsigned int width, height; /* font size */
|
||||
unsigned int charcount;
|
||||
unsigned char *data; /* font data with height fixed to 32 */
|
||||
};
|
||||
|
||||
#define KD_FONT_OP_SET 0 /* Set font */
|
||||
#define KD_FONT_OP_GET 1 /* Get font */
|
||||
#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
|
||||
#define KD_FONT_OP_COPY 3 /* Copy from another console */
|
||||
|
||||
#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
|
||||
#ifdef __KERNEL__
|
||||
#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */
|
||||
#endif
|
||||
|
||||
/* note: 0x4B00-0x4B4E all have had a value at some time;
|
||||
don't reuse for the time being */
|
||||
/* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
|
||||
|
||||
#endif /* _LINUX_KD_H */
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _LINUX_KDEV_T_H
|
||||
#define _LINUX_KDEV_T_H
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <uapi/linux/kdev_t.h>
|
||||
|
||||
#define MINORBITS 20
|
||||
#define MINORMASK ((1U << MINORBITS) - 1)
|
||||
|
||||
|
@ -87,14 +89,4 @@ static inline unsigned sysv_minor(u32 dev)
|
|||
return dev & 0x3ffff;
|
||||
}
|
||||
|
||||
#else /* __KERNEL__ */
|
||||
|
||||
/*
|
||||
Some programs want their definitions of MAJOR and MINOR and MKDEV
|
||||
from the kernel sources. These must be the externally visible ones.
|
||||
*/
|
||||
#define MAJOR(dev) ((dev)>>8)
|
||||
#define MINOR(dev) ((dev) & 0xff)
|
||||
#define MKDEV(ma,mi) ((ma)<<8 | (mi))
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
|
|
@ -1,38 +1,8 @@
|
|||
#ifndef LINUX_KERNEL_PAGE_FLAGS_H
|
||||
#define LINUX_KERNEL_PAGE_FLAGS_H
|
||||
|
||||
/*
|
||||
* Stable page flag bits exported to user space
|
||||
*/
|
||||
#include <uapi/linux/kernel-page-flags.h>
|
||||
|
||||
#define KPF_LOCKED 0
|
||||
#define KPF_ERROR 1
|
||||
#define KPF_REFERENCED 2
|
||||
#define KPF_UPTODATE 3
|
||||
#define KPF_DIRTY 4
|
||||
#define KPF_LRU 5
|
||||
#define KPF_ACTIVE 6
|
||||
#define KPF_SLAB 7
|
||||
#define KPF_WRITEBACK 8
|
||||
#define KPF_RECLAIM 9
|
||||
#define KPF_BUDDY 10
|
||||
|
||||
/* 11-20: new additions in 2.6.31 */
|
||||
#define KPF_MMAP 11
|
||||
#define KPF_ANON 12
|
||||
#define KPF_SWAPCACHE 13
|
||||
#define KPF_SWAPBACKED 14
|
||||
#define KPF_COMPOUND_HEAD 15
|
||||
#define KPF_COMPOUND_TAIL 16
|
||||
#define KPF_HUGE 17
|
||||
#define KPF_UNEVICTABLE 18
|
||||
#define KPF_HWPOISON 19
|
||||
#define KPF_NOPAGE 20
|
||||
|
||||
#define KPF_KSM 21
|
||||
#define KPF_THP 22
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* kernel hacking assistances
|
||||
* WARNING: subject to change, never rely on them!
|
||||
|
@ -46,6 +16,4 @@
|
|||
#define KPF_ARCH 38
|
||||
#define KPF_UNCACHED 39
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* LINUX_KERNEL_PAGE_FLAGS_H */
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
#ifndef _LINUX_KERNEL_H
|
||||
#define _LINUX_KERNEL_H
|
||||
|
||||
#include <linux/sysinfo.h>
|
||||
|
||||
/*
|
||||
* 'kernel.h' contains some often-used function prototypes etc
|
||||
*/
|
||||
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
||||
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <linux/linkage.h>
|
||||
|
@ -22,6 +13,7 @@
|
|||
#include <linux/printk.h>
|
||||
#include <linux/dynamic_debug.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <uapi/linux/kernel.h>
|
||||
|
||||
#define USHRT_MAX ((u16)(~0U))
|
||||
#define SHRT_MAX ((s16)(USHRT_MAX>>1))
|
||||
|
@ -716,6 +708,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
|
|||
|
||||
extern int do_sysinfo(struct sysinfo *info);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,49 +6,15 @@
|
|||
* (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __KERNELCAPI_H__
|
||||
#define __KERNELCAPI_H__
|
||||
|
||||
#define CAPI_MAXAPPL 240 /* maximum number of applications */
|
||||
#define CAPI_MAXCONTR 32 /* maximum number of controller */
|
||||
#define CAPI_MAXDATAWINDOW 8
|
||||
|
||||
|
||||
typedef struct kcapi_flagdef {
|
||||
int contr;
|
||||
int flag;
|
||||
} kcapi_flagdef;
|
||||
|
||||
typedef struct kcapi_carddef {
|
||||
char driver[32];
|
||||
unsigned int port;
|
||||
unsigned irq;
|
||||
unsigned int membase;
|
||||
int cardnr;
|
||||
} kcapi_carddef;
|
||||
|
||||
/* new ioctls >= 10 */
|
||||
#define KCAPI_CMD_TRACE 10
|
||||
#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */
|
||||
|
||||
/*
|
||||
* flag > 2 => trace also data
|
||||
* flag & 1 => show trace
|
||||
*/
|
||||
#define KCAPI_TRACE_OFF 0
|
||||
#define KCAPI_TRACE_SHORT_NO_DATA 1
|
||||
#define KCAPI_TRACE_FULL_NO_DATA 2
|
||||
#define KCAPI_TRACE_SHORT 3
|
||||
#define KCAPI_TRACE_FULL 4
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <uapi/linux/kernelcapi.h>
|
||||
|
||||
struct capi20_appl {
|
||||
u16 applid;
|
||||
|
@ -150,6 +116,4 @@ typedef enum {
|
|||
CapiCallGivenToOtherApplication = 0x3304,
|
||||
} CAPI_REASON;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __KERNELCAPI_H__ */
|
||||
|
|
|
@ -1,57 +1,8 @@
|
|||
#ifndef LINUX_KEXEC_H
|
||||
#define LINUX_KEXEC_H
|
||||
|
||||
/* kexec system call - It loads the new kernel to boot into.
|
||||
* kexec does not sync, or unmount filesystems so if you need
|
||||
* that to happen you need to do that yourself.
|
||||
*/
|
||||
#include <uapi/linux/kexec.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* kexec flags for different usage scenarios */
|
||||
#define KEXEC_ON_CRASH 0x00000001
|
||||
#define KEXEC_PRESERVE_CONTEXT 0x00000002
|
||||
#define KEXEC_ARCH_MASK 0xffff0000
|
||||
|
||||
/* These values match the ELF architecture values.
|
||||
* Unless there is a good reason that should continue to be the case.
|
||||
*/
|
||||
#define KEXEC_ARCH_DEFAULT ( 0 << 16)
|
||||
#define KEXEC_ARCH_386 ( 3 << 16)
|
||||
#define KEXEC_ARCH_X86_64 (62 << 16)
|
||||
#define KEXEC_ARCH_PPC (20 << 16)
|
||||
#define KEXEC_ARCH_PPC64 (21 << 16)
|
||||
#define KEXEC_ARCH_IA_64 (50 << 16)
|
||||
#define KEXEC_ARCH_ARM (40 << 16)
|
||||
#define KEXEC_ARCH_S390 (22 << 16)
|
||||
#define KEXEC_ARCH_SH (42 << 16)
|
||||
#define KEXEC_ARCH_MIPS_LE (10 << 16)
|
||||
#define KEXEC_ARCH_MIPS ( 8 << 16)
|
||||
|
||||
/* The artificial cap on the number of segments passed to kexec_load. */
|
||||
#define KEXEC_SEGMENT_MAX 16
|
||||
|
||||
#ifndef __KERNEL__
|
||||
/*
|
||||
* This structure is used to hold the arguments that are used when
|
||||
* loading kernel binaries.
|
||||
*/
|
||||
struct kexec_segment {
|
||||
const void *buf;
|
||||
size_t bufsz;
|
||||
const void *mem;
|
||||
size_t memsz;
|
||||
};
|
||||
|
||||
/* Load a new kernel image as described by the kexec_segment array
|
||||
* consisting of passed number of segments at the entry-point address.
|
||||
* The flags allow different useage types.
|
||||
*/
|
||||
extern int kexec_load(void *, size_t, struct kexec_segment *,
|
||||
unsigned long int);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_KEXEC
|
||||
#include <linux/list.h>
|
||||
#include <linux/linkage.h>
|
||||
|
@ -258,5 +209,4 @@ struct task_struct;
|
|||
static inline void crash_kexec(struct pt_regs *regs) { }
|
||||
static inline int kexec_should_crash(struct task_struct *p) { return 0; }
|
||||
#endif /* CONFIG_KEXEC */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* LINUX_KEXEC_H */
|
||||
|
|
|
@ -1,28 +1,8 @@
|
|||
#ifndef __LINUX_KEYBOARD_H
|
||||
#define __LINUX_KEYBOARD_H
|
||||
|
||||
#include <linux/wait.h>
|
||||
#include <uapi/linux/keyboard.h>
|
||||
|
||||
#define KG_SHIFT 0
|
||||
#define KG_CTRL 2
|
||||
#define KG_ALT 3
|
||||
#define KG_ALTGR 1
|
||||
#define KG_SHIFTL 4
|
||||
#define KG_KANASHIFT 4
|
||||
#define KG_SHIFTR 5
|
||||
#define KG_CTRLL 6
|
||||
#define KG_CTRLR 7
|
||||
#define KG_CAPSSHIFT 8
|
||||
|
||||
#define NR_SHIFT 9
|
||||
|
||||
#define NR_KEYS 256
|
||||
#define MAX_NR_KEYMAPS 256
|
||||
/* This means 128Kb if all keymaps are allocated. Only the superuser
|
||||
may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
|
||||
#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct notifier_block;
|
||||
extern unsigned short *key_maps[MAX_NR_KEYMAPS];
|
||||
extern unsigned short plain_map[NR_KEYS];
|
||||
|
@ -38,422 +18,3 @@ struct keyboard_notifier_param {
|
|||
extern int register_keyboard_notifier(struct notifier_block *nb);
|
||||
extern int unregister_keyboard_notifier(struct notifier_block *nb);
|
||||
#endif
|
||||
|
||||
#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
|
||||
|
||||
#define KT_LATIN 0 /* we depend on this being zero */
|
||||
#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
|
||||
#define KT_FN 1
|
||||
#define KT_SPEC 2
|
||||
#define KT_PAD 3
|
||||
#define KT_DEAD 4
|
||||
#define KT_CONS 5
|
||||
#define KT_CUR 6
|
||||
#define KT_SHIFT 7
|
||||
#define KT_META 8
|
||||
#define KT_ASCII 9
|
||||
#define KT_LOCK 10
|
||||
#define KT_SLOCK 12
|
||||
#define KT_DEAD2 13
|
||||
#define KT_BRL 14
|
||||
|
||||
#define K(t,v) (((t)<<8)|(v))
|
||||
#define KTYP(x) ((x) >> 8)
|
||||
#define KVAL(x) ((x) & 0xff)
|
||||
|
||||
#define K_F1 K(KT_FN,0)
|
||||
#define K_F2 K(KT_FN,1)
|
||||
#define K_F3 K(KT_FN,2)
|
||||
#define K_F4 K(KT_FN,3)
|
||||
#define K_F5 K(KT_FN,4)
|
||||
#define K_F6 K(KT_FN,5)
|
||||
#define K_F7 K(KT_FN,6)
|
||||
#define K_F8 K(KT_FN,7)
|
||||
#define K_F9 K(KT_FN,8)
|
||||
#define K_F10 K(KT_FN,9)
|
||||
#define K_F11 K(KT_FN,10)
|
||||
#define K_F12 K(KT_FN,11)
|
||||
#define K_F13 K(KT_FN,12)
|
||||
#define K_F14 K(KT_FN,13)
|
||||
#define K_F15 K(KT_FN,14)
|
||||
#define K_F16 K(KT_FN,15)
|
||||
#define K_F17 K(KT_FN,16)
|
||||
#define K_F18 K(KT_FN,17)
|
||||
#define K_F19 K(KT_FN,18)
|
||||
#define K_F20 K(KT_FN,19)
|
||||
#define K_FIND K(KT_FN,20)
|
||||
#define K_INSERT K(KT_FN,21)
|
||||
#define K_REMOVE K(KT_FN,22)
|
||||
#define K_SELECT K(KT_FN,23)
|
||||
#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
|
||||
#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
|
||||
#define K_MACRO K(KT_FN,26)
|
||||
#define K_HELP K(KT_FN,27)
|
||||
#define K_DO K(KT_FN,28)
|
||||
#define K_PAUSE K(KT_FN,29)
|
||||
#define K_F21 K(KT_FN,30)
|
||||
#define K_F22 K(KT_FN,31)
|
||||
#define K_F23 K(KT_FN,32)
|
||||
#define K_F24 K(KT_FN,33)
|
||||
#define K_F25 K(KT_FN,34)
|
||||
#define K_F26 K(KT_FN,35)
|
||||
#define K_F27 K(KT_FN,36)
|
||||
#define K_F28 K(KT_FN,37)
|
||||
#define K_F29 K(KT_FN,38)
|
||||
#define K_F30 K(KT_FN,39)
|
||||
#define K_F31 K(KT_FN,40)
|
||||
#define K_F32 K(KT_FN,41)
|
||||
#define K_F33 K(KT_FN,42)
|
||||
#define K_F34 K(KT_FN,43)
|
||||
#define K_F35 K(KT_FN,44)
|
||||
#define K_F36 K(KT_FN,45)
|
||||
#define K_F37 K(KT_FN,46)
|
||||
#define K_F38 K(KT_FN,47)
|
||||
#define K_F39 K(KT_FN,48)
|
||||
#define K_F40 K(KT_FN,49)
|
||||
#define K_F41 K(KT_FN,50)
|
||||
#define K_F42 K(KT_FN,51)
|
||||
#define K_F43 K(KT_FN,52)
|
||||
#define K_F44 K(KT_FN,53)
|
||||
#define K_F45 K(KT_FN,54)
|
||||
#define K_F46 K(KT_FN,55)
|
||||
#define K_F47 K(KT_FN,56)
|
||||
#define K_F48 K(KT_FN,57)
|
||||
#define K_F49 K(KT_FN,58)
|
||||
#define K_F50 K(KT_FN,59)
|
||||
#define K_F51 K(KT_FN,60)
|
||||
#define K_F52 K(KT_FN,61)
|
||||
#define K_F53 K(KT_FN,62)
|
||||
#define K_F54 K(KT_FN,63)
|
||||
#define K_F55 K(KT_FN,64)
|
||||
#define K_F56 K(KT_FN,65)
|
||||
#define K_F57 K(KT_FN,66)
|
||||
#define K_F58 K(KT_FN,67)
|
||||
#define K_F59 K(KT_FN,68)
|
||||
#define K_F60 K(KT_FN,69)
|
||||
#define K_F61 K(KT_FN,70)
|
||||
#define K_F62 K(KT_FN,71)
|
||||
#define K_F63 K(KT_FN,72)
|
||||
#define K_F64 K(KT_FN,73)
|
||||
#define K_F65 K(KT_FN,74)
|
||||
#define K_F66 K(KT_FN,75)
|
||||
#define K_F67 K(KT_FN,76)
|
||||
#define K_F68 K(KT_FN,77)
|
||||
#define K_F69 K(KT_FN,78)
|
||||
#define K_F70 K(KT_FN,79)
|
||||
#define K_F71 K(KT_FN,80)
|
||||
#define K_F72 K(KT_FN,81)
|
||||
#define K_F73 K(KT_FN,82)
|
||||
#define K_F74 K(KT_FN,83)
|
||||
#define K_F75 K(KT_FN,84)
|
||||
#define K_F76 K(KT_FN,85)
|
||||
#define K_F77 K(KT_FN,86)
|
||||
#define K_F78 K(KT_FN,87)
|
||||
#define K_F79 K(KT_FN,88)
|
||||
#define K_F80 K(KT_FN,89)
|
||||
#define K_F81 K(KT_FN,90)
|
||||
#define K_F82 K(KT_FN,91)
|
||||
#define K_F83 K(KT_FN,92)
|
||||
#define K_F84 K(KT_FN,93)
|
||||
#define K_F85 K(KT_FN,94)
|
||||
#define K_F86 K(KT_FN,95)
|
||||
#define K_F87 K(KT_FN,96)
|
||||
#define K_F88 K(KT_FN,97)
|
||||
#define K_F89 K(KT_FN,98)
|
||||
#define K_F90 K(KT_FN,99)
|
||||
#define K_F91 K(KT_FN,100)
|
||||
#define K_F92 K(KT_FN,101)
|
||||
#define K_F93 K(KT_FN,102)
|
||||
#define K_F94 K(KT_FN,103)
|
||||
#define K_F95 K(KT_FN,104)
|
||||
#define K_F96 K(KT_FN,105)
|
||||
#define K_F97 K(KT_FN,106)
|
||||
#define K_F98 K(KT_FN,107)
|
||||
#define K_F99 K(KT_FN,108)
|
||||
#define K_F100 K(KT_FN,109)
|
||||
#define K_F101 K(KT_FN,110)
|
||||
#define K_F102 K(KT_FN,111)
|
||||
#define K_F103 K(KT_FN,112)
|
||||
#define K_F104 K(KT_FN,113)
|
||||
#define K_F105 K(KT_FN,114)
|
||||
#define K_F106 K(KT_FN,115)
|
||||
#define K_F107 K(KT_FN,116)
|
||||
#define K_F108 K(KT_FN,117)
|
||||
#define K_F109 K(KT_FN,118)
|
||||
#define K_F110 K(KT_FN,119)
|
||||
#define K_F111 K(KT_FN,120)
|
||||
#define K_F112 K(KT_FN,121)
|
||||
#define K_F113 K(KT_FN,122)
|
||||
#define K_F114 K(KT_FN,123)
|
||||
#define K_F115 K(KT_FN,124)
|
||||
#define K_F116 K(KT_FN,125)
|
||||
#define K_F117 K(KT_FN,126)
|
||||
#define K_F118 K(KT_FN,127)
|
||||
#define K_F119 K(KT_FN,128)
|
||||
#define K_F120 K(KT_FN,129)
|
||||
#define K_F121 K(KT_FN,130)
|
||||
#define K_F122 K(KT_FN,131)
|
||||
#define K_F123 K(KT_FN,132)
|
||||
#define K_F124 K(KT_FN,133)
|
||||
#define K_F125 K(KT_FN,134)
|
||||
#define K_F126 K(KT_FN,135)
|
||||
#define K_F127 K(KT_FN,136)
|
||||
#define K_F128 K(KT_FN,137)
|
||||
#define K_F129 K(KT_FN,138)
|
||||
#define K_F130 K(KT_FN,139)
|
||||
#define K_F131 K(KT_FN,140)
|
||||
#define K_F132 K(KT_FN,141)
|
||||
#define K_F133 K(KT_FN,142)
|
||||
#define K_F134 K(KT_FN,143)
|
||||
#define K_F135 K(KT_FN,144)
|
||||
#define K_F136 K(KT_FN,145)
|
||||
#define K_F137 K(KT_FN,146)
|
||||
#define K_F138 K(KT_FN,147)
|
||||
#define K_F139 K(KT_FN,148)
|
||||
#define K_F140 K(KT_FN,149)
|
||||
#define K_F141 K(KT_FN,150)
|
||||
#define K_F142 K(KT_FN,151)
|
||||
#define K_F143 K(KT_FN,152)
|
||||
#define K_F144 K(KT_FN,153)
|
||||
#define K_F145 K(KT_FN,154)
|
||||
#define K_F146 K(KT_FN,155)
|
||||
#define K_F147 K(KT_FN,156)
|
||||
#define K_F148 K(KT_FN,157)
|
||||
#define K_F149 K(KT_FN,158)
|
||||
#define K_F150 K(KT_FN,159)
|
||||
#define K_F151 K(KT_FN,160)
|
||||
#define K_F152 K(KT_FN,161)
|
||||
#define K_F153 K(KT_FN,162)
|
||||
#define K_F154 K(KT_FN,163)
|
||||
#define K_F155 K(KT_FN,164)
|
||||
#define K_F156 K(KT_FN,165)
|
||||
#define K_F157 K(KT_FN,166)
|
||||
#define K_F158 K(KT_FN,167)
|
||||
#define K_F159 K(KT_FN,168)
|
||||
#define K_F160 K(KT_FN,169)
|
||||
#define K_F161 K(KT_FN,170)
|
||||
#define K_F162 K(KT_FN,171)
|
||||
#define K_F163 K(KT_FN,172)
|
||||
#define K_F164 K(KT_FN,173)
|
||||
#define K_F165 K(KT_FN,174)
|
||||
#define K_F166 K(KT_FN,175)
|
||||
#define K_F167 K(KT_FN,176)
|
||||
#define K_F168 K(KT_FN,177)
|
||||
#define K_F169 K(KT_FN,178)
|
||||
#define K_F170 K(KT_FN,179)
|
||||
#define K_F171 K(KT_FN,180)
|
||||
#define K_F172 K(KT_FN,181)
|
||||
#define K_F173 K(KT_FN,182)
|
||||
#define K_F174 K(KT_FN,183)
|
||||
#define K_F175 K(KT_FN,184)
|
||||
#define K_F176 K(KT_FN,185)
|
||||
#define K_F177 K(KT_FN,186)
|
||||
#define K_F178 K(KT_FN,187)
|
||||
#define K_F179 K(KT_FN,188)
|
||||
#define K_F180 K(KT_FN,189)
|
||||
#define K_F181 K(KT_FN,190)
|
||||
#define K_F182 K(KT_FN,191)
|
||||
#define K_F183 K(KT_FN,192)
|
||||
#define K_F184 K(KT_FN,193)
|
||||
#define K_F185 K(KT_FN,194)
|
||||
#define K_F186 K(KT_FN,195)
|
||||
#define K_F187 K(KT_FN,196)
|
||||
#define K_F188 K(KT_FN,197)
|
||||
#define K_F189 K(KT_FN,198)
|
||||
#define K_F190 K(KT_FN,199)
|
||||
#define K_F191 K(KT_FN,200)
|
||||
#define K_F192 K(KT_FN,201)
|
||||
#define K_F193 K(KT_FN,202)
|
||||
#define K_F194 K(KT_FN,203)
|
||||
#define K_F195 K(KT_FN,204)
|
||||
#define K_F196 K(KT_FN,205)
|
||||
#define K_F197 K(KT_FN,206)
|
||||
#define K_F198 K(KT_FN,207)
|
||||
#define K_F199 K(KT_FN,208)
|
||||
#define K_F200 K(KT_FN,209)
|
||||
#define K_F201 K(KT_FN,210)
|
||||
#define K_F202 K(KT_FN,211)
|
||||
#define K_F203 K(KT_FN,212)
|
||||
#define K_F204 K(KT_FN,213)
|
||||
#define K_F205 K(KT_FN,214)
|
||||
#define K_F206 K(KT_FN,215)
|
||||
#define K_F207 K(KT_FN,216)
|
||||
#define K_F208 K(KT_FN,217)
|
||||
#define K_F209 K(KT_FN,218)
|
||||
#define K_F210 K(KT_FN,219)
|
||||
#define K_F211 K(KT_FN,220)
|
||||
#define K_F212 K(KT_FN,221)
|
||||
#define K_F213 K(KT_FN,222)
|
||||
#define K_F214 K(KT_FN,223)
|
||||
#define K_F215 K(KT_FN,224)
|
||||
#define K_F216 K(KT_FN,225)
|
||||
#define K_F217 K(KT_FN,226)
|
||||
#define K_F218 K(KT_FN,227)
|
||||
#define K_F219 K(KT_FN,228)
|
||||
#define K_F220 K(KT_FN,229)
|
||||
#define K_F221 K(KT_FN,230)
|
||||
#define K_F222 K(KT_FN,231)
|
||||
#define K_F223 K(KT_FN,232)
|
||||
#define K_F224 K(KT_FN,233)
|
||||
#define K_F225 K(KT_FN,234)
|
||||
#define K_F226 K(KT_FN,235)
|
||||
#define K_F227 K(KT_FN,236)
|
||||
#define K_F228 K(KT_FN,237)
|
||||
#define K_F229 K(KT_FN,238)
|
||||
#define K_F230 K(KT_FN,239)
|
||||
#define K_F231 K(KT_FN,240)
|
||||
#define K_F232 K(KT_FN,241)
|
||||
#define K_F233 K(KT_FN,242)
|
||||
#define K_F234 K(KT_FN,243)
|
||||
#define K_F235 K(KT_FN,244)
|
||||
#define K_F236 K(KT_FN,245)
|
||||
#define K_F237 K(KT_FN,246)
|
||||
#define K_F238 K(KT_FN,247)
|
||||
#define K_F239 K(KT_FN,248)
|
||||
#define K_F240 K(KT_FN,249)
|
||||
#define K_F241 K(KT_FN,250)
|
||||
#define K_F242 K(KT_FN,251)
|
||||
#define K_F243 K(KT_FN,252)
|
||||
#define K_F244 K(KT_FN,253)
|
||||
#define K_F245 K(KT_FN,254)
|
||||
#define K_UNDO K(KT_FN,255)
|
||||
|
||||
|
||||
#define K_HOLE K(KT_SPEC,0)
|
||||
#define K_ENTER K(KT_SPEC,1)
|
||||
#define K_SH_REGS K(KT_SPEC,2)
|
||||
#define K_SH_MEM K(KT_SPEC,3)
|
||||
#define K_SH_STAT K(KT_SPEC,4)
|
||||
#define K_BREAK K(KT_SPEC,5)
|
||||
#define K_CONS K(KT_SPEC,6)
|
||||
#define K_CAPS K(KT_SPEC,7)
|
||||
#define K_NUM K(KT_SPEC,8)
|
||||
#define K_HOLD K(KT_SPEC,9)
|
||||
#define K_SCROLLFORW K(KT_SPEC,10)
|
||||
#define K_SCROLLBACK K(KT_SPEC,11)
|
||||
#define K_BOOT K(KT_SPEC,12)
|
||||
#define K_CAPSON K(KT_SPEC,13)
|
||||
#define K_COMPOSE K(KT_SPEC,14)
|
||||
#define K_SAK K(KT_SPEC,15)
|
||||
#define K_DECRCONSOLE K(KT_SPEC,16)
|
||||
#define K_INCRCONSOLE K(KT_SPEC,17)
|
||||
#define K_SPAWNCONSOLE K(KT_SPEC,18)
|
||||
#define K_BARENUMLOCK K(KT_SPEC,19)
|
||||
|
||||
#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
|
||||
#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
|
||||
|
||||
#define K_P0 K(KT_PAD,0)
|
||||
#define K_P1 K(KT_PAD,1)
|
||||
#define K_P2 K(KT_PAD,2)
|
||||
#define K_P3 K(KT_PAD,3)
|
||||
#define K_P4 K(KT_PAD,4)
|
||||
#define K_P5 K(KT_PAD,5)
|
||||
#define K_P6 K(KT_PAD,6)
|
||||
#define K_P7 K(KT_PAD,7)
|
||||
#define K_P8 K(KT_PAD,8)
|
||||
#define K_P9 K(KT_PAD,9)
|
||||
#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
|
||||
#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
|
||||
#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
|
||||
#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
|
||||
#define K_PENTER K(KT_PAD,14) /* key-pad enter */
|
||||
#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
|
||||
#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
|
||||
#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
|
||||
#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
|
||||
#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
|
||||
|
||||
#define NR_PAD 20
|
||||
|
||||
#define K_DGRAVE K(KT_DEAD,0)
|
||||
#define K_DACUTE K(KT_DEAD,1)
|
||||
#define K_DCIRCM K(KT_DEAD,2)
|
||||
#define K_DTILDE K(KT_DEAD,3)
|
||||
#define K_DDIERE K(KT_DEAD,4)
|
||||
#define K_DCEDIL K(KT_DEAD,5)
|
||||
|
||||
#define NR_DEAD 6
|
||||
|
||||
#define K_DOWN K(KT_CUR,0)
|
||||
#define K_LEFT K(KT_CUR,1)
|
||||
#define K_RIGHT K(KT_CUR,2)
|
||||
#define K_UP K(KT_CUR,3)
|
||||
|
||||
#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
|
||||
#define K_CTRL K(KT_SHIFT,KG_CTRL)
|
||||
#define K_ALT K(KT_SHIFT,KG_ALT)
|
||||
#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
|
||||
#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
|
||||
#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
|
||||
#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
|
||||
#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
|
||||
#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
|
||||
|
||||
#define K_ASC0 K(KT_ASCII,0)
|
||||
#define K_ASC1 K(KT_ASCII,1)
|
||||
#define K_ASC2 K(KT_ASCII,2)
|
||||
#define K_ASC3 K(KT_ASCII,3)
|
||||
#define K_ASC4 K(KT_ASCII,4)
|
||||
#define K_ASC5 K(KT_ASCII,5)
|
||||
#define K_ASC6 K(KT_ASCII,6)
|
||||
#define K_ASC7 K(KT_ASCII,7)
|
||||
#define K_ASC8 K(KT_ASCII,8)
|
||||
#define K_ASC9 K(KT_ASCII,9)
|
||||
#define K_HEX0 K(KT_ASCII,10)
|
||||
#define K_HEX1 K(KT_ASCII,11)
|
||||
#define K_HEX2 K(KT_ASCII,12)
|
||||
#define K_HEX3 K(KT_ASCII,13)
|
||||
#define K_HEX4 K(KT_ASCII,14)
|
||||
#define K_HEX5 K(KT_ASCII,15)
|
||||
#define K_HEX6 K(KT_ASCII,16)
|
||||
#define K_HEX7 K(KT_ASCII,17)
|
||||
#define K_HEX8 K(KT_ASCII,18)
|
||||
#define K_HEX9 K(KT_ASCII,19)
|
||||
#define K_HEXa K(KT_ASCII,20)
|
||||
#define K_HEXb K(KT_ASCII,21)
|
||||
#define K_HEXc K(KT_ASCII,22)
|
||||
#define K_HEXd K(KT_ASCII,23)
|
||||
#define K_HEXe K(KT_ASCII,24)
|
||||
#define K_HEXf K(KT_ASCII,25)
|
||||
|
||||
#define NR_ASCII 26
|
||||
|
||||
#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
|
||||
#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
|
||||
#define K_ALTLOCK K(KT_LOCK,KG_ALT)
|
||||
#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
|
||||
#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
|
||||
#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
|
||||
#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
|
||||
#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
|
||||
#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
|
||||
|
||||
#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
|
||||
#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
|
||||
#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
|
||||
#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
|
||||
#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
|
||||
#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
|
||||
#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
|
||||
#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
|
||||
#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
|
||||
|
||||
#define NR_LOCK 9
|
||||
|
||||
#define K_BRL_BLANK K(KT_BRL, 0)
|
||||
#define K_BRL_DOT1 K(KT_BRL, 1)
|
||||
#define K_BRL_DOT2 K(KT_BRL, 2)
|
||||
#define K_BRL_DOT3 K(KT_BRL, 3)
|
||||
#define K_BRL_DOT4 K(KT_BRL, 4)
|
||||
#define K_BRL_DOT5 K(KT_BRL, 5)
|
||||
#define K_BRL_DOT6 K(KT_BRL, 6)
|
||||
#define K_BRL_DOT7 K(KT_BRL, 7)
|
||||
#define K_BRL_DOT8 K(KT_BRL, 8)
|
||||
#define K_BRL_DOT9 K(KT_BRL, 9)
|
||||
#define K_BRL_DOT10 K(KT_BRL, 10)
|
||||
|
||||
#define NR_BRL 11
|
||||
|
||||
#define MAX_DIACR 256
|
||||
#endif
|
||||
|
|
|
@ -1,31 +1,8 @@
|
|||
#ifndef __LINUX_KVM_PARA_H
|
||||
#define __LINUX_KVM_PARA_H
|
||||
|
||||
/*
|
||||
* This header file provides a method for making a hypercall to the host
|
||||
* Architectures should define:
|
||||
* - kvm_hypercall0, kvm_hypercall1...
|
||||
* - kvm_arch_para_features
|
||||
* - kvm_para_available
|
||||
*/
|
||||
#include <uapi/linux/kvm_para.h>
|
||||
|
||||
/* Return values for hypercalls */
|
||||
#define KVM_ENOSYS 1000
|
||||
#define KVM_EFAULT EFAULT
|
||||
#define KVM_E2BIG E2BIG
|
||||
#define KVM_EPERM EPERM
|
||||
|
||||
#define KVM_HC_VAPIC_POLL_IRQ 1
|
||||
#define KVM_HC_MMU_OP 2
|
||||
#define KVM_HC_FEATURES 3
|
||||
#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
|
||||
|
||||
/*
|
||||
* hypercalls use architecture specific
|
||||
*/
|
||||
#include <asm/kvm_para.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
static inline int kvm_para_has_feature(unsigned int feature)
|
||||
{
|
||||
|
@ -33,5 +10,4 @@ static inline int kvm_para_has_feature(unsigned int feature)
|
|||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __LINUX_KVM_PARA_H */
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче