mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
Merge 3.7-rc1 into tty-linus
This syncs up the tty-linus branch to the latest in Linus's tree to get all of the UAPI stuff needed for the next set of patches to merge. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
commit
c362495586
6742 changed files with 269285 additions and 133200 deletions
|
|
@ -21,393 +21,11 @@ header-y += usb/
|
|||
header-y += wimax/
|
||||
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/a.out.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
|
||||
header-y += a.out.h
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/kvm.h),)
|
||||
header-y += kvm.h
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h \
|
||||
$(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),)
|
||||
header-y += kvm_para.h
|
||||
$(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
|
||||
endif
|
||||
|
||||
header-y += acct.h
|
||||
header-y += adb.h
|
||||
header-y += adfs_fs.h
|
||||
header-y += affs_hardblocks.h
|
||||
header-y += agpgart.h
|
||||
header-y += aio_abi.h
|
||||
header-y += apm_bios.h
|
||||
header-y += arcfb.h
|
||||
header-y += atalk.h
|
||||
header-y += atm.h
|
||||
header-y += atm_eni.h
|
||||
header-y += atm_he.h
|
||||
header-y += atm_idt77105.h
|
||||
header-y += atm_nicstar.h
|
||||
header-y += atm_tcp.h
|
||||
header-y += atm_zatm.h
|
||||
header-y += atmapi.h
|
||||
header-y += atmarp.h
|
||||
header-y += atmbr2684.h
|
||||
header-y += atmclip.h
|
||||
header-y += atmdev.h
|
||||
header-y += atmioc.h
|
||||
header-y += atmlec.h
|
||||
header-y += atmmpc.h
|
||||
header-y += atmppp.h
|
||||
header-y += atmsap.h
|
||||
header-y += atmsvc.h
|
||||
header-y += audit.h
|
||||
header-y += auto_fs.h
|
||||
header-y += auto_fs4.h
|
||||
header-y += auxvec.h
|
||||
header-y += ax25.h
|
||||
header-y += b1lli.h
|
||||
header-y += baycom.h
|
||||
header-y += bfs_fs.h
|
||||
header-y += binfmts.h
|
||||
header-y += blk_types.h
|
||||
header-y += blkpg.h
|
||||
header-y += blktrace_api.h
|
||||
header-y += bpqether.h
|
||||
header-y += bsg.h
|
||||
header-y += can.h
|
||||
header-y += capability.h
|
||||
header-y += capi.h
|
||||
header-y += cciss_defs.h
|
||||
header-y += cciss_ioctl.h
|
||||
header-y += cdrom.h
|
||||
header-y += cgroupstats.h
|
||||
header-y += chio.h
|
||||
header-y += cm4000_cs.h
|
||||
header-y += cn_proc.h
|
||||
header-y += coda.h
|
||||
header-y += coda_psdev.h
|
||||
header-y += coff.h
|
||||
header-y += connector.h
|
||||
header-y += const.h
|
||||
header-y += cramfs_fs.h
|
||||
header-y += cuda.h
|
||||
header-y += cyclades.h
|
||||
header-y += cycx_cfm.h
|
||||
header-y += dcbnl.h
|
||||
header-y += dccp.h
|
||||
header-y += dlm.h
|
||||
header-y += dlm_device.h
|
||||
header-y += dlm_netlink.h
|
||||
header-y += dlm_plock.h
|
||||
header-y += dlmconstants.h
|
||||
header-y += dm-ioctl.h
|
||||
header-y += dm-log-userspace.h
|
||||
header-y += dn.h
|
||||
header-y += dqblk_xfs.h
|
||||
header-y += edd.h
|
||||
header-y += efs_fs_sb.h
|
||||
header-y += elf-em.h
|
||||
header-y += elf-fdpic.h
|
||||
header-y += elf.h
|
||||
header-y += elfcore.h
|
||||
header-y += errno.h
|
||||
header-y += errqueue.h
|
||||
header-y += ethtool.h
|
||||
header-y += eventpoll.h
|
||||
header-y += fadvise.h
|
||||
header-y += falloc.h
|
||||
header-y += fanotify.h
|
||||
header-y += fb.h
|
||||
header-y += fcntl.h
|
||||
header-y += fd.h
|
||||
header-y += fdreg.h
|
||||
header-y += fib_rules.h
|
||||
header-y += fiemap.h
|
||||
header-y += filter.h
|
||||
header-y += firewire-cdev.h
|
||||
header-y += firewire-constants.h
|
||||
header-y += flat.h
|
||||
header-y += fs.h
|
||||
header-y += fsl_hypervisor.h
|
||||
header-y += fuse.h
|
||||
header-y += futex.h
|
||||
header-y += gameport.h
|
||||
header-y += gen_stats.h
|
||||
header-y += genetlink.h
|
||||
header-y += gfs2_ondisk.h
|
||||
header-y += gigaset_dev.h
|
||||
header-y += hdlc.h
|
||||
header-y += hdlcdrv.h
|
||||
header-y += hdreg.h
|
||||
header-y += hid.h
|
||||
header-y += hiddev.h
|
||||
header-y += hidraw.h
|
||||
header-y += hpet.h
|
||||
header-y += hysdn_if.h
|
||||
header-y += i2c-dev.h
|
||||
header-y += i2c.h
|
||||
header-y += i2o-dev.h
|
||||
header-y += i8k.h
|
||||
header-y += icmp.h
|
||||
header-y += icmpv6.h
|
||||
header-y += if.h
|
||||
header-y += if_addr.h
|
||||
header-y += if_addrlabel.h
|
||||
header-y += if_alg.h
|
||||
header-y += if_arcnet.h
|
||||
header-y += if_arp.h
|
||||
header-y += if_bonding.h
|
||||
header-y += if_bridge.h
|
||||
header-y += if_cablemodem.h
|
||||
header-y += if_eql.h
|
||||
header-y += if_ether.h
|
||||
header-y += if_fc.h
|
||||
header-y += if_fddi.h
|
||||
header-y += if_frad.h
|
||||
header-y += if_hippi.h
|
||||
header-y += if_infiniband.h
|
||||
header-y += if_link.h
|
||||
header-y += if_ltalk.h
|
||||
header-y += if_packet.h
|
||||
header-y += if_phonet.h
|
||||
header-y += if_plip.h
|
||||
header-y += if_ppp.h
|
||||
header-y += if_pppol2tp.h
|
||||
header-y += if_pppox.h
|
||||
header-y += if_slip.h
|
||||
header-y += if_team.h
|
||||
header-y += if_tun.h
|
||||
header-y += if_tunnel.h
|
||||
header-y += if_vlan.h
|
||||
header-y += if_x25.h
|
||||
header-y += igmp.h
|
||||
header-y += in.h
|
||||
header-y += in6.h
|
||||
header-y += in_route.h
|
||||
header-y += sock_diag.h
|
||||
header-y += inet_diag.h
|
||||
header-y += unix_diag.h
|
||||
header-y += packet_diag.h
|
||||
header-y += inotify.h
|
||||
header-y += input.h
|
||||
header-y += ioctl.h
|
||||
header-y += ip.h
|
||||
header-y += ip6_tunnel.h
|
||||
header-y += ip_vs.h
|
||||
header-y += ipc.h
|
||||
header-y += ipmi.h
|
||||
header-y += ipmi_msgdefs.h
|
||||
header-y += ipsec.h
|
||||
header-y += ipv6.h
|
||||
header-y += ipv6_route.h
|
||||
header-y += ipx.h
|
||||
header-y += irda.h
|
||||
header-y += irqnr.h
|
||||
header-y += isdn.h
|
||||
header-y += isdn_divertif.h
|
||||
header-y += isdn_ppp.h
|
||||
header-y += isdnif.h
|
||||
header-y += iso_fs.h
|
||||
header-y += ivtv.h
|
||||
header-y += ivtvfb.h
|
||||
header-y += ixjuser.h
|
||||
header-y += jffs2.h
|
||||
header-y += joystick.h
|
||||
header-y += kd.h
|
||||
header-y += kdev_t.h
|
||||
header-y += kernel.h
|
||||
header-y += kernelcapi.h
|
||||
header-y += kernel-page-flags.h
|
||||
header-y += kexec.h
|
||||
header-y += keyboard.h
|
||||
header-y += keyctl.h
|
||||
header-y += l2tp.h
|
||||
header-y += limits.h
|
||||
header-y += llc.h
|
||||
header-y += loop.h
|
||||
header-y += lp.h
|
||||
header-y += magic.h
|
||||
header-y += major.h
|
||||
header-y += map_to_7segment.h
|
||||
header-y += matroxfb.h
|
||||
header-y += mdio.h
|
||||
header-y += media.h
|
||||
header-y += mei.h
|
||||
header-y += mempolicy.h
|
||||
header-y += meye.h
|
||||
header-y += mii.h
|
||||
header-y += minix_fs.h
|
||||
header-y += mman.h
|
||||
header-y += mmtimer.h
|
||||
header-y += mqueue.h
|
||||
header-y += mroute.h
|
||||
header-y += mroute6.h
|
||||
header-y += msdos_fs.h
|
||||
header-y += msg.h
|
||||
header-y += mtio.h
|
||||
header-y += n_r3964.h
|
||||
header-y += nbd.h
|
||||
header-y += ncp.h
|
||||
header-y += ncp_fs.h
|
||||
header-y += ncp_mount.h
|
||||
header-y += ncp_no.h
|
||||
header-y += neighbour.h
|
||||
header-y += net.h
|
||||
header-y += net_dropmon.h
|
||||
header-y += net_tstamp.h
|
||||
header-y += netdevice.h
|
||||
header-y += netfilter.h
|
||||
header-y += netfilter_arp.h
|
||||
header-y += netfilter_bridge.h
|
||||
header-y += netfilter_decnet.h
|
||||
header-y += netfilter_ipv4.h
|
||||
header-y += netfilter_ipv6.h
|
||||
header-y += netlink.h
|
||||
header-y += netrom.h
|
||||
header-y += nfc.h
|
||||
header-y += nfs.h
|
||||
header-y += nfs2.h
|
||||
header-y += nfs3.h
|
||||
header-y += nfs4.h
|
||||
header-y += nfs4_mount.h
|
||||
header-y += nfs_fs.h
|
||||
header-y += nfs_idmap.h
|
||||
header-y += nfs_mount.h
|
||||
header-y += nfsacl.h
|
||||
header-y += nl80211.h
|
||||
header-y += nubus.h
|
||||
header-y += nvram.h
|
||||
header-y += omap3isp.h
|
||||
header-y += omapfb.h
|
||||
header-y += oom.h
|
||||
header-y += param.h
|
||||
header-y += parport.h
|
||||
header-y += patchkey.h
|
||||
header-y += pci.h
|
||||
header-y += pci_regs.h
|
||||
header-y += perf_event.h
|
||||
header-y += personality.h
|
||||
header-y += pfkeyv2.h
|
||||
header-y += pg.h
|
||||
header-y += phantom.h
|
||||
header-y += phonet.h
|
||||
header-y += pkt_cls.h
|
||||
header-y += pkt_sched.h
|
||||
header-y += pktcdvd.h
|
||||
header-y += pmu.h
|
||||
header-y += poll.h
|
||||
header-y += posix_types.h
|
||||
header-y += ppdev.h
|
||||
header-y += ppp-comp.h
|
||||
header-y += ppp-ioctl.h
|
||||
header-y += ppp_defs.h
|
||||
header-y += pps.h
|
||||
header-y += prctl.h
|
||||
header-y += ptp_clock.h
|
||||
header-y += ptrace.h
|
||||
header-y += qnx4_fs.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += quota.h
|
||||
header-y += radeonfb.h
|
||||
header-y += random.h
|
||||
header-y += raw.h
|
||||
header-y += rds.h
|
||||
header-y += reboot.h
|
||||
header-y += reiserfs_fs.h
|
||||
header-y += reiserfs_xattr.h
|
||||
header-y += resource.h
|
||||
header-y += rfkill.h
|
||||
header-y += romfs_fs.h
|
||||
header-y += rose.h
|
||||
header-y += route.h
|
||||
header-y += rtc.h
|
||||
header-y += rtnetlink.h
|
||||
header-y += scc.h
|
||||
header-y += sched.h
|
||||
header-y += screen_info.h
|
||||
header-y += sdla.h
|
||||
header-y += seccomp.h
|
||||
header-y += securebits.h
|
||||
header-y += selinux_netlink.h
|
||||
header-y += sem.h
|
||||
header-y += serial.h
|
||||
header-y += serial_core.h
|
||||
header-y += serial_reg.h
|
||||
header-y += serio.h
|
||||
header-y += shm.h
|
||||
header-y += signal.h
|
||||
header-y += signalfd.h
|
||||
header-y += snmp.h
|
||||
header-y += socket.h
|
||||
header-y += sockios.h
|
||||
header-y += som.h
|
||||
header-y += sonet.h
|
||||
header-y += sonypi.h
|
||||
header-y += sound.h
|
||||
header-y += soundcard.h
|
||||
header-y += stat.h
|
||||
header-y += stddef.h
|
||||
header-y += string.h
|
||||
header-y += suspend_ioctls.h
|
||||
header-y += swab.h
|
||||
header-y += synclink.h
|
||||
header-y += sysctl.h
|
||||
header-y += sysinfo.h
|
||||
header-y += taskstats.h
|
||||
header-y += tcp.h
|
||||
header-y += tcp_metrics.h
|
||||
header-y += telephony.h
|
||||
header-y += termios.h
|
||||
header-y += time.h
|
||||
header-y += times.h
|
||||
header-y += timex.h
|
||||
header-y += tiocl.h
|
||||
header-y += tipc.h
|
||||
header-y += tipc_config.h
|
||||
header-y += toshiba.h
|
||||
header-y += tty.h
|
||||
header-y += tty_flags.h
|
||||
header-y += types.h
|
||||
header-y += udf_fs_i.h
|
||||
header-y += udp.h
|
||||
header-y += uhid.h
|
||||
header-y += uinput.h
|
||||
header-y += uio.h
|
||||
header-y += ultrasound.h
|
||||
header-y += un.h
|
||||
header-y += unistd.h
|
||||
header-y += usbdevice_fs.h
|
||||
header-y += utime.h
|
||||
header-y += utsname.h
|
||||
header-y += uuid.h
|
||||
header-y += uvcvideo.h
|
||||
header-y += v4l2-common.h
|
||||
header-y += v4l2-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
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
#ifndef AFFS_HARDBLOCKS_H
|
||||
#define AFFS_HARDBLOCKS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Just the needed definitions for the RDB of an Amiga HD. */
|
||||
|
||||
struct RigidDiskBlock {
|
||||
__u32 rdb_ID;
|
||||
__be32 rdb_SummedLongs;
|
||||
__s32 rdb_ChkSum;
|
||||
__u32 rdb_HostID;
|
||||
__be32 rdb_BlockBytes;
|
||||
__u32 rdb_Flags;
|
||||
__u32 rdb_BadBlockList;
|
||||
__be32 rdb_PartitionList;
|
||||
__u32 rdb_FileSysHeaderList;
|
||||
__u32 rdb_DriveInit;
|
||||
__u32 rdb_Reserved1[6];
|
||||
__u32 rdb_Cylinders;
|
||||
__u32 rdb_Sectors;
|
||||
__u32 rdb_Heads;
|
||||
__u32 rdb_Interleave;
|
||||
__u32 rdb_Park;
|
||||
__u32 rdb_Reserved2[3];
|
||||
__u32 rdb_WritePreComp;
|
||||
__u32 rdb_ReducedWrite;
|
||||
__u32 rdb_StepRate;
|
||||
__u32 rdb_Reserved3[5];
|
||||
__u32 rdb_RDBBlocksLo;
|
||||
__u32 rdb_RDBBlocksHi;
|
||||
__u32 rdb_LoCylinder;
|
||||
__u32 rdb_HiCylinder;
|
||||
__u32 rdb_CylBlocks;
|
||||
__u32 rdb_AutoParkSeconds;
|
||||
__u32 rdb_HighRDSKBlock;
|
||||
__u32 rdb_Reserved4;
|
||||
char rdb_DiskVendor[8];
|
||||
char rdb_DiskProduct[16];
|
||||
char rdb_DiskRevision[4];
|
||||
char rdb_ControllerVendor[8];
|
||||
char rdb_ControllerProduct[16];
|
||||
char rdb_ControllerRevision[4];
|
||||
__u32 rdb_Reserved5[10];
|
||||
};
|
||||
|
||||
#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
|
||||
|
||||
struct PartitionBlock {
|
||||
__be32 pb_ID;
|
||||
__be32 pb_SummedLongs;
|
||||
__s32 pb_ChkSum;
|
||||
__u32 pb_HostID;
|
||||
__be32 pb_Next;
|
||||
__u32 pb_Flags;
|
||||
__u32 pb_Reserved1[2];
|
||||
__u32 pb_DevFlags;
|
||||
__u8 pb_DriveName[32];
|
||||
__u32 pb_Reserved2[15];
|
||||
__be32 pb_Environment[17];
|
||||
__u32 pb_EReserved[15];
|
||||
};
|
||||
|
||||
#define IDNAME_PARTITION 0x50415254 /* "PART" */
|
||||
|
||||
#define RDB_ALLOCATION_LIMIT 16
|
||||
|
||||
#endif /* AFFS_HARDBLOCKS_H */
|
||||
|
|
@ -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,111 +0,0 @@
|
|||
/* include/linux/aio_abi.h
|
||||
*
|
||||
* Copyright 2000,2001,2002 Red Hat.
|
||||
*
|
||||
* Written by Benjamin LaHaise <bcrl@kvack.org>
|
||||
*
|
||||
* Distribute under the terms of the GPLv2 (see ../../COPYING) or under
|
||||
* the following terms.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, provided that the above copyright
|
||||
* notice appears in all copies. This software is provided without any
|
||||
* warranty, express or implied. Red Hat makes no representations about
|
||||
* the suitability of this software for any purpose.
|
||||
*
|
||||
* IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
|
||||
* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
|
||||
* THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
|
||||
* RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
||||
* ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
#ifndef __LINUX__AIO_ABI_H
|
||||
#define __LINUX__AIO_ABI_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
typedef __kernel_ulong_t aio_context_t;
|
||||
|
||||
enum {
|
||||
IOCB_CMD_PREAD = 0,
|
||||
IOCB_CMD_PWRITE = 1,
|
||||
IOCB_CMD_FSYNC = 2,
|
||||
IOCB_CMD_FDSYNC = 3,
|
||||
/* These two are experimental.
|
||||
* IOCB_CMD_PREADX = 4,
|
||||
* IOCB_CMD_POLL = 5,
|
||||
*/
|
||||
IOCB_CMD_NOOP = 6,
|
||||
IOCB_CMD_PREADV = 7,
|
||||
IOCB_CMD_PWRITEV = 8,
|
||||
};
|
||||
|
||||
/*
|
||||
* Valid flags for the "aio_flags" member of the "struct iocb".
|
||||
*
|
||||
* IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb"
|
||||
* is valid.
|
||||
*/
|
||||
#define IOCB_FLAG_RESFD (1 << 0)
|
||||
|
||||
/* read() from /dev/aio returns these structures. */
|
||||
struct io_event {
|
||||
__u64 data; /* the data field from the iocb */
|
||||
__u64 obj; /* what iocb this event came from */
|
||||
__s64 res; /* result code for this event */
|
||||
__s64 res2; /* secondary result */
|
||||
};
|
||||
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#define PADDED(x,y) x, y
|
||||
#elif defined(__BIG_ENDIAN)
|
||||
#define PADDED(x,y) y, x
|
||||
#else
|
||||
#error edit for your odd byteorder.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* we always use a 64bit off_t when communicating
|
||||
* with userland. its up to libraries to do the
|
||||
* proper padding and aio_error abstraction
|
||||
*/
|
||||
|
||||
struct iocb {
|
||||
/* these are internal to the kernel/libc. */
|
||||
__u64 aio_data; /* data to be returned in event's data */
|
||||
__u32 PADDED(aio_key, aio_reserved1);
|
||||
/* the kernel sets aio_key to the req # */
|
||||
|
||||
/* common fields */
|
||||
__u16 aio_lio_opcode; /* see IOCB_CMD_ above */
|
||||
__s16 aio_reqprio;
|
||||
__u32 aio_fildes;
|
||||
|
||||
__u64 aio_buf;
|
||||
__u64 aio_nbytes;
|
||||
__s64 aio_offset;
|
||||
|
||||
/* extra parameters */
|
||||
__u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */
|
||||
|
||||
/* flags for the "struct iocb" */
|
||||
__u32 aio_flags;
|
||||
|
||||
/*
|
||||
* if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an
|
||||
* eventfd to signal AIO readiness to
|
||||
*/
|
||||
__u32 aio_resfd;
|
||||
}; /* 64 bytes */
|
||||
|
||||
#undef IFBIG
|
||||
#undef IFLITTLE
|
||||
|
||||
#endif /* __LINUX__AIO_ABI_H */
|
||||
|
||||
|
|
@ -21,7 +21,6 @@ enum alarmtimer_restart {
|
|||
|
||||
#define ALARMTIMER_STATE_INACTIVE 0x00
|
||||
#define ALARMTIMER_STATE_ENQUEUED 0x01
|
||||
#define ALARMTIMER_STATE_CALLBACK 0x02
|
||||
|
||||
/**
|
||||
* struct alarm - Alarm timer structure
|
||||
|
|
@ -35,6 +34,7 @@ enum alarmtimer_restart {
|
|||
*/
|
||||
struct alarm {
|
||||
struct timerqueue_node node;
|
||||
struct hrtimer timer;
|
||||
enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
|
||||
enum alarmtimer_type type;
|
||||
int state;
|
||||
|
|
@ -43,39 +43,12 @@ struct alarm {
|
|||
|
||||
void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
|
||||
enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
|
||||
void alarm_start(struct alarm *alarm, ktime_t start);
|
||||
int alarm_start(struct alarm *alarm, ktime_t start);
|
||||
int alarm_try_to_cancel(struct alarm *alarm);
|
||||
int alarm_cancel(struct alarm *alarm);
|
||||
|
||||
u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
|
||||
|
||||
/*
|
||||
* A alarmtimer is active, when it is enqueued into timerqueue or the
|
||||
* callback function is running.
|
||||
*/
|
||||
static inline int alarmtimer_active(const struct alarm *timer)
|
||||
{
|
||||
return timer->state != ALARMTIMER_STATE_INACTIVE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to check, whether the timer is on one of the queues
|
||||
*/
|
||||
static inline int alarmtimer_is_queued(struct alarm *timer)
|
||||
{
|
||||
return timer->state & ALARMTIMER_STATE_ENQUEUED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to check, whether the timer is running the callback
|
||||
* function
|
||||
*/
|
||||
static inline int alarmtimer_callback_running(struct alarm *timer)
|
||||
{
|
||||
return timer->state & ALARMTIMER_STATE_CALLBACK;
|
||||
}
|
||||
|
||||
|
||||
/* Provide way to access the rtc device being used by alarmtimers */
|
||||
struct rtc_device *alarmtimer_get_rtcdev(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,8 +0,0 @@
|
|||
#ifndef __LINUX_ARCFB_H__
|
||||
#define __LINUX_ARCFB_H__
|
||||
|
||||
#define FBIO_WAITEVENT _IO('F', 0x88)
|
||||
#define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t)
|
||||
|
||||
#endif
|
||||
|
||||
67
include/linux/asn1.h
Normal file
67
include/linux/asn1.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/* ASN.1 BER/DER/CER encoding definitions
|
||||
*
|
||||
* Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ASN1_H
|
||||
#define _LINUX_ASN1_H
|
||||
|
||||
/* Class */
|
||||
enum asn1_class {
|
||||
ASN1_UNIV = 0, /* Universal */
|
||||
ASN1_APPL = 1, /* Application */
|
||||
ASN1_CONT = 2, /* Context */
|
||||
ASN1_PRIV = 3 /* Private */
|
||||
};
|
||||
#define ASN1_CLASS_BITS 0xc0
|
||||
|
||||
|
||||
enum asn1_method {
|
||||
ASN1_PRIM = 0, /* Primitive */
|
||||
ASN1_CONS = 1 /* Constructed */
|
||||
};
|
||||
#define ASN1_CONS_BIT 0x20
|
||||
|
||||
/* Tag */
|
||||
enum asn1_tag {
|
||||
ASN1_EOC = 0, /* End Of Contents or N/A */
|
||||
ASN1_BOOL = 1, /* Boolean */
|
||||
ASN1_INT = 2, /* Integer */
|
||||
ASN1_BTS = 3, /* Bit String */
|
||||
ASN1_OTS = 4, /* Octet String */
|
||||
ASN1_NULL = 5, /* Null */
|
||||
ASN1_OID = 6, /* Object Identifier */
|
||||
ASN1_ODE = 7, /* Object Description */
|
||||
ASN1_EXT = 8, /* External */
|
||||
ASN1_REAL = 9, /* Real float */
|
||||
ASN1_ENUM = 10, /* Enumerated */
|
||||
ASN1_EPDV = 11, /* Embedded PDV */
|
||||
ASN1_UTF8STR = 12, /* UTF8 String */
|
||||
ASN1_RELOID = 13, /* Relative OID */
|
||||
/* 14 - Reserved */
|
||||
/* 15 - Reserved */
|
||||
ASN1_SEQ = 16, /* Sequence and Sequence of */
|
||||
ASN1_SET = 17, /* Set and Set of */
|
||||
ASN1_NUMSTR = 18, /* Numerical String */
|
||||
ASN1_PRNSTR = 19, /* Printable String */
|
||||
ASN1_TEXSTR = 20, /* T61 String / Teletext String */
|
||||
ASN1_VIDSTR = 21, /* Videotex String */
|
||||
ASN1_IA5STR = 22, /* IA5 String */
|
||||
ASN1_UNITIM = 23, /* Universal Time */
|
||||
ASN1_GENTIM = 24, /* General Time */
|
||||
ASN1_GRASTR = 25, /* Graphic String */
|
||||
ASN1_VISSTR = 26, /* Visible String */
|
||||
ASN1_GENSTR = 27, /* General String */
|
||||
ASN1_UNISTR = 28, /* Universal String */
|
||||
ASN1_CHRSTR = 29, /* Character String */
|
||||
ASN1_BMPSTR = 30, /* BMP String */
|
||||
ASN1_LONG_TAG = 31 /* Long form tag */
|
||||
};
|
||||
|
||||
#endif /* _LINUX_ASN1_H */
|
||||
87
include/linux/asn1_ber_bytecode.h
Normal file
87
include/linux/asn1_ber_bytecode.h
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
/* ASN.1 BER/DER/CER parsing state machine internal definitions
|
||||
*
|
||||
* Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ASN1_BER_BYTECODE_H
|
||||
#define _LINUX_ASN1_BER_BYTECODE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
#include <linux/asn1.h>
|
||||
|
||||
typedef int (*asn1_action_t)(void *context,
|
||||
size_t hdrlen, /* In case of ANY type */
|
||||
unsigned char tag, /* In case of ANY type */
|
||||
const void *value, size_t vlen);
|
||||
|
||||
struct asn1_decoder {
|
||||
const unsigned char *machine;
|
||||
size_t machlen;
|
||||
const asn1_action_t *actions;
|
||||
};
|
||||
|
||||
enum asn1_opcode {
|
||||
/* The tag-matching ops come first and the odd-numbered slots
|
||||
* are for OR_SKIP ops.
|
||||
*/
|
||||
#define ASN1_OP_MATCH__SKIP 0x01
|
||||
#define ASN1_OP_MATCH__ACT 0x02
|
||||
#define ASN1_OP_MATCH__JUMP 0x04
|
||||
#define ASN1_OP_MATCH__ANY 0x08
|
||||
#define ASN1_OP_MATCH__COND 0x10
|
||||
|
||||
ASN1_OP_MATCH = 0x00,
|
||||
ASN1_OP_MATCH_OR_SKIP = 0x01,
|
||||
ASN1_OP_MATCH_ACT = 0x02,
|
||||
ASN1_OP_MATCH_ACT_OR_SKIP = 0x03,
|
||||
ASN1_OP_MATCH_JUMP = 0x04,
|
||||
ASN1_OP_MATCH_JUMP_OR_SKIP = 0x05,
|
||||
ASN1_OP_MATCH_ANY = 0x08,
|
||||
ASN1_OP_MATCH_ANY_ACT = 0x0a,
|
||||
/* Everything before here matches unconditionally */
|
||||
|
||||
ASN1_OP_COND_MATCH_OR_SKIP = 0x11,
|
||||
ASN1_OP_COND_MATCH_ACT_OR_SKIP = 0x13,
|
||||
ASN1_OP_COND_MATCH_JUMP_OR_SKIP = 0x15,
|
||||
ASN1_OP_COND_MATCH_ANY = 0x18,
|
||||
ASN1_OP_COND_MATCH_ANY_ACT = 0x1a,
|
||||
|
||||
/* Everything before here will want a tag from the data */
|
||||
#define ASN1_OP__MATCHES_TAG ASN1_OP_COND_MATCH_ANY_ACT
|
||||
|
||||
/* These are here to help fill up space */
|
||||
ASN1_OP_COND_FAIL = 0x1b,
|
||||
ASN1_OP_COMPLETE = 0x1c,
|
||||
ASN1_OP_ACT = 0x1d,
|
||||
ASN1_OP_RETURN = 0x1e,
|
||||
|
||||
/* The following eight have bit 0 -> SET, 1 -> OF, 2 -> ACT */
|
||||
ASN1_OP_END_SEQ = 0x20,
|
||||
ASN1_OP_END_SET = 0x21,
|
||||
ASN1_OP_END_SEQ_OF = 0x22,
|
||||
ASN1_OP_END_SET_OF = 0x23,
|
||||
ASN1_OP_END_SEQ_ACT = 0x24,
|
||||
ASN1_OP_END_SET_ACT = 0x25,
|
||||
ASN1_OP_END_SEQ_OF_ACT = 0x26,
|
||||
ASN1_OP_END_SET_OF_ACT = 0x27,
|
||||
#define ASN1_OP_END__SET 0x01
|
||||
#define ASN1_OP_END__OF 0x02
|
||||
#define ASN1_OP_END__ACT 0x04
|
||||
|
||||
ASN1_OP__NR
|
||||
};
|
||||
|
||||
#define _tag(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | ASN1_##TAG)
|
||||
#define _tagn(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | TAG)
|
||||
#define _jump_target(N) (N)
|
||||
#define _action(N) (N)
|
||||
|
||||
#endif /* _LINUX_ASN1_BER_BYTECODE_H */
|
||||
24
include/linux/asn1_decoder.h
Normal file
24
include/linux/asn1_decoder.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* ASN.1 decoder
|
||||
*
|
||||
* Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ASN1_DECODER_H
|
||||
#define _LINUX_ASN1_DECODER_H
|
||||
|
||||
#include <linux/asn1.h>
|
||||
|
||||
struct asn1_decoder;
|
||||
|
||||
extern int asn1_ber_decoder(const struct asn1_decoder *decoder,
|
||||
void *context,
|
||||
const unsigned char *data,
|
||||
size_t datalen);
|
||||
|
||||
#endif /* _LINUX_ASN1_DECODER_H */
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
/* atm_eni.h - Driver-specific declarations of the ENI driver (for use by
|
||||
driver-specific utilities) */
|
||||
|
||||
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef LINUX_ATM_ENI_H
|
||||
#define LINUX_ATM_ENI_H
|
||||
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
||||
struct eni_multipliers {
|
||||
int tx,rx; /* values are in percent and must be > 100 */
|
||||
};
|
||||
|
||||
|
||||
#define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc)
|
||||
/* printk memory map */
|
||||
#define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc)
|
||||
/* set buffer multipliers */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
/* atm_he.h */
|
||||
|
||||
#ifndef LINUX_ATM_HE_H
|
||||
#define LINUX_ATM_HE_H
|
||||
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc)
|
||||
|
||||
#define HE_REGTYPE_PCI 1
|
||||
#define HE_REGTYPE_RCM 2
|
||||
#define HE_REGTYPE_TCM 3
|
||||
#define HE_REGTYPE_MBOX 4
|
||||
|
||||
struct he_ioctl_reg {
|
||||
unsigned addr, val;
|
||||
char type;
|
||||
};
|
||||
|
||||
#endif /* LINUX_ATM_HE_H */
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for
|
||||
* use by driver-specific utilities) */
|
||||
|
||||
/* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */
|
||||
|
||||
|
||||
#ifndef LINUX_ATM_IDT77105_H
|
||||
#define LINUX_ATM_IDT77105_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/atmioc.h>
|
||||
#include <linux/atmdev.h>
|
||||
|
||||
/*
|
||||
* Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls.
|
||||
* Pointed to by `arg' in atmif_sioc.
|
||||
*/
|
||||
struct idt77105_stats {
|
||||
__u32 symbol_errors; /* wire symbol errors */
|
||||
__u32 tx_cells; /* cells transmitted */
|
||||
__u32 rx_cells; /* cells received */
|
||||
__u32 rx_hec_errors; /* Header Error Check errors on receive */
|
||||
};
|
||||
|
||||
#define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */
|
||||
#define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* atm_nicstar.h
|
||||
*
|
||||
* Driver-specific declarations for use by NICSTAR driver specific utils.
|
||||
*
|
||||
* Author: Rui Prior
|
||||
*
|
||||
* (C) INESC 1998
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef LINUX_ATM_NICSTAR_H
|
||||
#define LINUX_ATM_NICSTAR_H
|
||||
|
||||
/* Note: non-kernel programs including this file must also include
|
||||
* sys/types.h for struct timeval
|
||||
*/
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
#define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc)
|
||||
/* get pool statistics */
|
||||
#define NS_SETBUFLEV _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
|
||||
/* set buffer level markers */
|
||||
#define NS_ADJBUFLEV _IO('a',ATMIOC_SARPRV+3)
|
||||
/* adjust buffer level */
|
||||
|
||||
typedef struct buf_nr
|
||||
{
|
||||
unsigned min;
|
||||
unsigned init;
|
||||
unsigned max;
|
||||
}buf_nr;
|
||||
|
||||
|
||||
typedef struct pool_levels
|
||||
{
|
||||
int buftype;
|
||||
int count; /* (At least for now) only used in NS_GETPSTAT */
|
||||
buf_nr level;
|
||||
} pool_levels;
|
||||
|
||||
/* type must be one of the following: */
|
||||
#define NS_BUFTYPE_SMALL 1
|
||||
#define NS_BUFTYPE_LARGE 2
|
||||
#define NS_BUFTYPE_HUGE 3
|
||||
#define NS_BUFTYPE_IOVEC 4
|
||||
|
||||
|
||||
#endif /* LINUX_ATM_NICSTAR_H */
|
||||
|
|
@ -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,52 +0,0 @@
|
|||
/* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by
|
||||
driver-specific utilities) */
|
||||
|
||||
/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef LINUX_ATM_ZATM_H
|
||||
#define LINUX_ATM_ZATM_H
|
||||
|
||||
/*
|
||||
* Note: non-kernel programs including this file must also include
|
||||
* sys/types.h for struct timeval
|
||||
*/
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
|
||||
/* get pool statistics */
|
||||
#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
|
||||
/* get statistics and zero */
|
||||
#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
|
||||
/* set pool parameters */
|
||||
|
||||
struct zatm_pool_info {
|
||||
int ref_count; /* free buffer pool usage counters */
|
||||
int low_water,high_water; /* refill parameters */
|
||||
int rqa_count,rqu_count; /* queue condition counters */
|
||||
int offset,next_off; /* alignment optimizations: offset */
|
||||
int next_cnt,next_thres; /* repetition counter and threshold */
|
||||
};
|
||||
|
||||
struct zatm_pool_req {
|
||||
int pool_num; /* pool number */
|
||||
struct zatm_pool_info info; /* actual information */
|
||||
};
|
||||
|
||||
struct zatm_t_hist {
|
||||
struct timeval real; /* real (wall-clock) time */
|
||||
struct timeval expected; /* expected real time */
|
||||
};
|
||||
|
||||
|
||||
#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
|
||||
#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
|
||||
#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
|
||||
#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
|
||||
|
||||
#define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to
|
||||
record; must be 2^n */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/* atmapi.h - ATM API user space/kernel compatibility */
|
||||
|
||||
/* Written 1999,2000 by Werner Almesberger, EPFL ICA */
|
||||
|
||||
|
||||
#ifndef _LINUX_ATMAPI_H
|
||||
#define _LINUX_ATMAPI_H
|
||||
|
||||
#if defined(__sparc__) || defined(__ia64__)
|
||||
/* such alignment is not required on 32 bit sparcs, but we can't
|
||||
figure that we are on a sparc64 while compiling user-space programs. */
|
||||
#define __ATM_API_ALIGN __attribute__((aligned(8)))
|
||||
#else
|
||||
#define __ATM_API_ALIGN
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Opaque type for kernel pointers. Note that _ is never accessed. We need
|
||||
* the struct in order hide the array, so that we can make simple assignments
|
||||
* instead of being forced to use memcpy. It also improves error reporting for
|
||||
* code that still assumes that we're passing unsigned longs.
|
||||
*
|
||||
* Convention: NULL pointers are passed as a field of all zeroes.
|
||||
*/
|
||||
|
||||
typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */
|
||||
|
||||
/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef _LINUX_ATMARP_H
|
||||
#define _LINUX_ATMARP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
||||
#define ATMARP_RETRY_DELAY 30 /* request next resolution or forget
|
||||
NAK after 30 sec - should go into
|
||||
atmclip.h */
|
||||
#define ATMARP_MAX_UNRES_PACKETS 5 /* queue that many packets while
|
||||
waiting for the resolver */
|
||||
|
||||
|
||||
#define ATMARPD_CTRL _IO('a',ATMIOC_CLIP+1) /* become atmarpd ctrl sock */
|
||||
#define ATMARP_MKIP _IO('a',ATMIOC_CLIP+2) /* attach socket to IP */
|
||||
#define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */
|
||||
#define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */
|
||||
|
||||
|
||||
enum atmarp_ctrl_type {
|
||||
act_invalid, /* catch uninitialized structures */
|
||||
act_need, /* need address resolution */
|
||||
act_up, /* interface is coming up */
|
||||
act_down, /* interface is going down */
|
||||
act_change /* interface configuration has changed */
|
||||
};
|
||||
|
||||
struct atmarp_ctrl {
|
||||
enum atmarp_ctrl_type type; /* message type */
|
||||
int itf_num;/* interface number (if present) */
|
||||
__be32 ip; /* IP address (act_need only) */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
#ifndef _LINUX_ATMBR2684_H
|
||||
#define _LINUX_ATMBR2684_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/if.h> /* For IFNAMSIZ */
|
||||
|
||||
/*
|
||||
* Type of media we're bridging (ethernet, token ring, etc) Currently only
|
||||
* ethernet is supported
|
||||
*/
|
||||
#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
|
||||
#define BR2684_MEDIA_802_4 (1) /* 802.4 */
|
||||
#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
|
||||
#define BR2684_MEDIA_FDDI (3)
|
||||
#define BR2684_MEDIA_802_6 (4) /* 802.6 */
|
||||
|
||||
/* used only at device creation: */
|
||||
#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
|
||||
|
||||
/*
|
||||
* Is there FCS inbound on this VC? This currently isn't supported.
|
||||
*/
|
||||
#define BR2684_FCSIN_NO (0)
|
||||
#define BR2684_FCSIN_IGNORE (1)
|
||||
#define BR2684_FCSIN_VERIFY (2)
|
||||
|
||||
/*
|
||||
* Is there FCS outbound on this VC? This currently isn't supported.
|
||||
*/
|
||||
#define BR2684_FCSOUT_NO (0)
|
||||
#define BR2684_FCSOUT_SENDZERO (1)
|
||||
#define BR2684_FCSOUT_GENERATE (2)
|
||||
|
||||
/*
|
||||
* Does this VC include LLC encapsulation?
|
||||
*/
|
||||
#define BR2684_ENCAPS_VC (0) /* VC-mux */
|
||||
#define BR2684_ENCAPS_LLC (1)
|
||||
#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
|
||||
|
||||
/*
|
||||
* Is this VC bridged or routed?
|
||||
*/
|
||||
|
||||
#define BR2684_PAYLOAD_ROUTED (0)
|
||||
#define BR2684_PAYLOAD_BRIDGED (1)
|
||||
|
||||
/*
|
||||
* This is for the ATM_NEWBACKENDIF call - these are like socket families:
|
||||
* the first element of the structure is the backend number and the rest
|
||||
* is per-backend specific
|
||||
*/
|
||||
struct atm_newif_br2684 {
|
||||
atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
|
||||
int media; /* BR2684_MEDIA_*, flags in upper bits */
|
||||
char ifname[IFNAMSIZ];
|
||||
int mtu;
|
||||
};
|
||||
|
||||
/*
|
||||
* This structure is used to specify a br2684 interface - either by a
|
||||
* positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
|
||||
*/
|
||||
#define BR2684_FIND_BYNOTHING (0)
|
||||
#define BR2684_FIND_BYNUM (1)
|
||||
#define BR2684_FIND_BYIFNAME (2)
|
||||
struct br2684_if_spec {
|
||||
int method; /* BR2684_FIND_* */
|
||||
union {
|
||||
char ifname[IFNAMSIZ];
|
||||
int devnum;
|
||||
} spec;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is for the ATM_SETBACKEND call - these are like socket families:
|
||||
* the first element of the structure is the backend number and the rest
|
||||
* is per-backend specific
|
||||
*/
|
||||
struct atm_backend_br2684 {
|
||||
atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
|
||||
struct br2684_if_spec ifspec;
|
||||
int fcs_in; /* BR2684_FCSIN_* */
|
||||
int fcs_out; /* BR2684_FCSOUT_* */
|
||||
int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
|
||||
int encaps; /* BR2684_ENCAPS_* */
|
||||
int has_vpiid; /* 1: use vpn_id - Unsupported */
|
||||
__u8 vpn_id[7];
|
||||
int send_padding; /* unsupported */
|
||||
int min_size; /* we will pad smaller packets than this */
|
||||
};
|
||||
|
||||
/*
|
||||
* The BR2684_SETFILT ioctl is an experimental mechanism for folks
|
||||
* terminating a large number of IP-only vcc's. When netfilter allows
|
||||
* efficient per-if in/out filters, this support will be removed
|
||||
*/
|
||||
struct br2684_filter {
|
||||
__be32 prefix; /* network byte order */
|
||||
__be32 netmask; /* 0 = disable filter */
|
||||
};
|
||||
|
||||
struct br2684_filter_set {
|
||||
struct br2684_if_spec ifspec;
|
||||
struct br2684_filter filter;
|
||||
};
|
||||
|
||||
enum br2684_payload {
|
||||
p_routed = BR2684_PAYLOAD_ROUTED,
|
||||
p_bridged = BR2684_PAYLOAD_BRIDGED,
|
||||
};
|
||||
|
||||
#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
|
||||
struct br2684_filter_set)
|
||||
|
||||
#endif /* _LINUX_ATMBR2684_H */
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/* atmclip.h - Classical IP over ATM */
|
||||
|
||||
/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef LINUX_ATMCLIP_H
|
||||
#define LINUX_ATMCLIP_H
|
||||
|
||||
#include <linux/sockios.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
||||
#define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */
|
||||
#define RFC1626_MTU 9180 /* RFC1626 default MTU */
|
||||
|
||||
#define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */
|
||||
#define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */
|
||||
|
||||
#define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */
|
||||
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
/* atmioc.h - ranges for ATM-related ioctl numbers */
|
||||
|
||||
/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
/*
|
||||
* See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of
|
||||
* "magic" ioctl numbers.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LINUX_ATMIOC_H
|
||||
#define _LINUX_ATMIOC_H
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
/* everybody including atmioc.h will also need _IO{,R,W,WR} */
|
||||
|
||||
#define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */
|
||||
#define ATMIOC_PHYCOM_END 0x0f
|
||||
#define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */
|
||||
#define ATMIOC_PHYTYP_END 0x2f
|
||||
#define ATMIOC_PHYPRV 0x30 /* PHY dev private ioctls, unique per driver */
|
||||
#define ATMIOC_PHYPRV_END 0x4f
|
||||
#define ATMIOC_SARCOM 0x50 /* SAR device common ioctls, globally unique */
|
||||
#define ATMIOC_SARCOM_END 0x50
|
||||
#define ATMIOC_SARPRV 0x60 /* SAR dev private ioctls, unique per driver */
|
||||
#define ATMIOC_SARPRV_END 0x7f
|
||||
#define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */
|
||||
#define ATMIOC_ITF_END 0x8f
|
||||
#define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */
|
||||
#define ATMIOC_BACKEND_END 0xaf
|
||||
/* 0xb0-0xbf: Reserved for future use */
|
||||
#define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */
|
||||
#define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */
|
||||
#define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */
|
||||
#define ATMIOC_CLIP 0xe0 /* Classical IP over ATM control, globally u. */
|
||||
#define ATMIOC_CLIP_END 0xef
|
||||
#define ATMIOC_SPECIAL 0xf0 /* Special-purpose controls, globally unique */
|
||||
#define ATMIOC_SPECIAL_END 0xff
|
||||
|
||||
#endif
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* ATM Lan Emulation Daemon driver interface
|
||||
*
|
||||
* Marko Kiiskila <mkiiskila@yahoo.com>
|
||||
*/
|
||||
|
||||
#ifndef _ATMLEC_H_
|
||||
#define _ATMLEC_H_
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/* ATM lec daemon control socket */
|
||||
#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
|
||||
#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
|
||||
#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
|
||||
|
||||
/* Maximum number of LEC interfaces (tweakable) */
|
||||
#define MAX_LEC_ITF 48
|
||||
|
||||
typedef enum {
|
||||
l_set_mac_addr,
|
||||
l_del_mac_addr,
|
||||
l_svc_setup,
|
||||
l_addr_delete,
|
||||
l_topology_change,
|
||||
l_flush_complete,
|
||||
l_arp_update,
|
||||
l_narp_req, /* LANE2 mandates the use of this */
|
||||
l_config,
|
||||
l_flush_tran_id,
|
||||
l_set_lecid,
|
||||
l_arp_xmt,
|
||||
l_rdesc_arp_xmt,
|
||||
l_associate_req,
|
||||
l_should_bridge /* should we bridge this MAC? */
|
||||
} atmlec_msg_type;
|
||||
|
||||
#define ATMLEC_MSG_TYPE_MAX l_should_bridge
|
||||
|
||||
struct atmlec_config_msg {
|
||||
unsigned int maximum_unknown_frame_count;
|
||||
unsigned int max_unknown_frame_time;
|
||||
unsigned short max_retry_count;
|
||||
unsigned int aging_time;
|
||||
unsigned int forward_delay_time;
|
||||
unsigned int arp_response_time;
|
||||
unsigned int flush_timeout;
|
||||
unsigned int path_switching_delay;
|
||||
unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
|
||||
int mtu;
|
||||
int is_proxy;
|
||||
};
|
||||
|
||||
struct atmlec_msg {
|
||||
atmlec_msg_type type;
|
||||
int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
|
||||
union {
|
||||
struct {
|
||||
unsigned char mac_addr[ETH_ALEN];
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned int flag; /*
|
||||
* Topology_change flag,
|
||||
* remoteflag, permanent flag,
|
||||
* lecid, transaction id
|
||||
*/
|
||||
unsigned int targetless_le_arp; /* LANE2 */
|
||||
unsigned int no_source_le_narp; /* LANE2 */
|
||||
} normal;
|
||||
struct atmlec_config_msg config;
|
||||
struct {
|
||||
__u16 lec_id; /* requestor lec_id */
|
||||
__u32 tran_id; /* transaction id */
|
||||
unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
|
||||
unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
|
||||
} proxy; /*
|
||||
* For mapping LE_ARP requests to responses. Filled by
|
||||
* zeppelin, returned by kernel. Used only when proxying
|
||||
*/
|
||||
} content;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
struct atmlec_ioc {
|
||||
int dev_num;
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned char receive; /* 1= receive vcc, 0 = send vcc */
|
||||
};
|
||||
#endif /* _ATMLEC_H_ */
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
#ifndef _ATMMPC_H_
|
||||
#define _ATMMPC_H_
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atmioc.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
|
||||
#define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
|
||||
|
||||
#define MPC_SOCKET_INGRESS 1
|
||||
#define MPC_SOCKET_EGRESS 2
|
||||
|
||||
struct atmmpc_ioc {
|
||||
int dev_num;
|
||||
__be32 ipaddr; /* the IP address of the shortcut */
|
||||
int type; /* ingress or egress */
|
||||
};
|
||||
|
||||
typedef struct in_ctrl_info {
|
||||
__u8 Last_NHRP_CIE_code;
|
||||
__u8 Last_Q2931_cause_value;
|
||||
__u8 eg_MPC_ATM_addr[ATM_ESA_LEN];
|
||||
__be32 tag;
|
||||
__be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
|
||||
__u16 holding_time;
|
||||
__u32 request_id;
|
||||
} in_ctrl_info;
|
||||
|
||||
typedef struct eg_ctrl_info {
|
||||
__u8 DLL_header[256];
|
||||
__u8 DH_length;
|
||||
__be32 cache_id;
|
||||
__be32 tag;
|
||||
__be32 mps_ip;
|
||||
__be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
|
||||
__u8 in_MPC_data_ATM_addr[ATM_ESA_LEN];
|
||||
__u16 holding_time;
|
||||
} eg_ctrl_info;
|
||||
|
||||
struct mpc_parameters {
|
||||
__u16 mpc_p1; /* Shortcut-Setup Frame Count */
|
||||
__u16 mpc_p2; /* Shortcut-Setup Frame Time */
|
||||
__u8 mpc_p3[8]; /* Flow-detection Protocols */
|
||||
__u16 mpc_p4; /* MPC Initial Retry Time */
|
||||
__u16 mpc_p5; /* MPC Retry Time Maximum */
|
||||
__u16 mpc_p6; /* Hold Down Time */
|
||||
} ;
|
||||
|
||||
struct k_message {
|
||||
__u16 type;
|
||||
__be32 ip_mask;
|
||||
__u8 MPS_ctrl[ATM_ESA_LEN];
|
||||
union {
|
||||
in_ctrl_info in_info;
|
||||
eg_ctrl_info eg_info;
|
||||
struct mpc_parameters params;
|
||||
} content;
|
||||
struct atm_qos qos;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
struct llc_snap_hdr {
|
||||
/* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
|
||||
__u8 dsap; /* Destination Service Access Point (0xAA) */
|
||||
__u8 ssap; /* Source Service Access Point (0xAA) */
|
||||
__u8 ui; /* Unnumbered Information (0x03) */
|
||||
__u8 org[3]; /* Organizational identification (0x000000) */
|
||||
__u8 type[2]; /* Ether type (for IP) (0x0800) */
|
||||
};
|
||||
|
||||
/* TLVs this MPC recognizes */
|
||||
#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a
|
||||
|
||||
/* MPOA device types in MPOA Device Type TLV */
|
||||
#define NON_MPOA 0
|
||||
#define MPS 1
|
||||
#define MPC 2
|
||||
#define MPS_AND_MPC 3
|
||||
|
||||
|
||||
/* MPC parameter defaults */
|
||||
|
||||
#define MPC_P1 10 /* Shortcut-Setup Frame Count */
|
||||
#define MPC_P2 1 /* Shortcut-Setup Frame Time */
|
||||
#define MPC_P3 0 /* Flow-detection Protocols */
|
||||
#define MPC_P4 5 /* MPC Initial Retry Time */
|
||||
#define MPC_P5 40 /* MPC Retry Time Maximum */
|
||||
#define MPC_P6 160 /* Hold Down Time */
|
||||
#define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
|
||||
|
||||
/* MPC constants */
|
||||
|
||||
#define MPC_C1 2 /* Retry Time Multiplier */
|
||||
#define MPC_C2 60 /* Initial Keep-Alive Lifetime */
|
||||
|
||||
/* Message types - to MPOA daemon */
|
||||
|
||||
#define SND_MPOA_RES_RQST 201
|
||||
#define SET_MPS_CTRL_ADDR 202
|
||||
#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */
|
||||
#define STOP_KEEP_ALIVE_SM 204
|
||||
#define EGRESS_ENTRY_REMOVED 205
|
||||
#define SND_EGRESS_PURGE 206
|
||||
#define DIE 207 /* tell the daemon to exit() */
|
||||
#define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */
|
||||
#define OPEN_INGRESS_SVC 209
|
||||
|
||||
/* Message types - from MPOA daemon */
|
||||
|
||||
#define MPOA_TRIGGER_RCVD 101
|
||||
#define MPOA_RES_REPLY_RCVD 102
|
||||
#define INGRESS_PURGE_RCVD 103
|
||||
#define EGRESS_PURGE_RCVD 104
|
||||
#define MPS_DEATH 105
|
||||
#define CACHE_IMPOS_RCVD 106
|
||||
#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */
|
||||
#define SET_MPS_MAC_ADDR 108
|
||||
#define CLEAN_UP_AND_EXIT 109
|
||||
#define SET_MPC_PARAMS 110 /* MPC configuration parameters */
|
||||
|
||||
/* Message types - bidirectional */
|
||||
|
||||
#define RELOAD 301 /* kill -HUP the daemon for reload */
|
||||
|
||||
#endif /* _ATMMPC_H_ */
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
/* atmppp.h - RFC2364 PPPoATM */
|
||||
|
||||
/* Written 2000 by Mitchell Blank Jr */
|
||||
|
||||
#ifndef _LINUX_ATMPPP_H
|
||||
#define _LINUX_ATMPPP_H
|
||||
|
||||
#include <linux/atm.h>
|
||||
|
||||
#define PPPOATM_ENCAPS_AUTODETECT (0)
|
||||
#define PPPOATM_ENCAPS_VC (1)
|
||||
#define PPPOATM_ENCAPS_LLC (2)
|
||||
|
||||
/*
|
||||
* This is for the ATM_SETBACKEND call - these are like socket families:
|
||||
* the first element of the structure is the backend number and the rest
|
||||
* is per-backend specific
|
||||
*/
|
||||
struct atm_backend_ppp {
|
||||
atm_backend_t backend_num; /* ATM_BACKEND_PPP */
|
||||
int encaps; /* PPPOATM_ENCAPS_* */
|
||||
};
|
||||
|
||||
#endif /* _LINUX_ATMPPP_H */
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
/* atmsap.h - ATM Service Access Point addressing definitions */
|
||||
|
||||
/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef _LINUX_ATMSAP_H
|
||||
#define _LINUX_ATMSAP_H
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
|
||||
/*
|
||||
* BEGIN_xx and END_xx markers are used for automatic generation of
|
||||
* documentation. Do not change them.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Layer 2 protocol identifiers
|
||||
*/
|
||||
|
||||
/* BEGIN_L2 */
|
||||
#define ATM_L2_NONE 0 /* L2 not specified */
|
||||
#define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
|
||||
#define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
|
||||
#define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
|
||||
#define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
|
||||
#define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
|
||||
#define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
|
||||
#define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
|
||||
#define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
|
||||
#define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
|
||||
#define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
|
||||
#define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
|
||||
#define ATM_L2_USER 0x10 /* user-specified */
|
||||
#define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
|
||||
/* END_L2 */
|
||||
|
||||
|
||||
/*
|
||||
* Layer 3 protocol identifiers
|
||||
*/
|
||||
|
||||
/* BEGIN_L3 */
|
||||
#define ATM_L3_NONE 0 /* L3 not specified */
|
||||
#define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
|
||||
#define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
|
||||
#define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
|
||||
#define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
|
||||
#define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
|
||||
#define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
|
||||
#define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
|
||||
#define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
|
||||
#define ATM_L3_USER 0x10 /* user-specified */
|
||||
/* END_L3 */
|
||||
|
||||
|
||||
/*
|
||||
* High layer identifiers
|
||||
*/
|
||||
|
||||
/* BEGIN_HL */
|
||||
#define ATM_HL_NONE 0 /* HL not specified */
|
||||
#define ATM_HL_ISO 0x01 /* ISO */
|
||||
#define ATM_HL_USER 0x02 /* user-specific */
|
||||
#define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
|
||||
#define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
|
||||
/* END_HL */
|
||||
|
||||
|
||||
/*
|
||||
* ITU-T coded mode of operation
|
||||
*/
|
||||
|
||||
/* BEGIN_IMD */
|
||||
#define ATM_IMD_NONE 0 /* mode not specified */
|
||||
#define ATM_IMD_NORMAL 1 /* normal mode of operation */
|
||||
#define ATM_IMD_EXTENDED 2 /* extended mode of operation */
|
||||
/* END_IMD */
|
||||
|
||||
/*
|
||||
* H.310 code points
|
||||
*/
|
||||
|
||||
#define ATM_TT_NONE 0 /* terminal type not specified */
|
||||
#define ATM_TT_RX 1 /* receive only */
|
||||
#define ATM_TT_TX 2 /* send only */
|
||||
#define ATM_TT_RXTX 3 /* receive and send */
|
||||
|
||||
#define ATM_MC_NONE 0 /* no multiplexing */
|
||||
#define ATM_MC_TS 1 /* transport stream (TS) */
|
||||
#define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
|
||||
#define ATM_MC_PS 3 /* program stream (PS) */
|
||||
#define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
|
||||
#define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
|
||||
|
||||
/*
|
||||
* SAP structures
|
||||
*/
|
||||
|
||||
#define ATM_MAX_HLI 8 /* maximum high-layer information length */
|
||||
|
||||
|
||||
struct atm_blli {
|
||||
unsigned char l2_proto; /* layer 2 protocol */
|
||||
union {
|
||||
struct {
|
||||
unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
|
||||
/* absent */
|
||||
unsigned char window; /* window size (k), 1-127 (0 to omit) */
|
||||
} itu; /* ITU-T encoding */
|
||||
unsigned char user; /* user-specified l2 information */
|
||||
} l2;
|
||||
unsigned char l3_proto; /* layer 3 protocol */
|
||||
union {
|
||||
struct {
|
||||
unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
|
||||
/* absent */
|
||||
unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
|
||||
/* omit) */
|
||||
unsigned char window;/* packet window size, 1-127 (0 to omit) */
|
||||
} itu; /* ITU-T encoding */
|
||||
unsigned char user; /* user specified l3 information */
|
||||
struct { /* if l3_proto = ATM_L3_H310 */
|
||||
unsigned char term_type; /* terminal type */
|
||||
unsigned char fw_mpx_cap; /* forward multiplexing capability */
|
||||
/* only if term_type != ATM_TT_NONE */
|
||||
unsigned char bw_mpx_cap; /* backward multiplexing capability */
|
||||
/* only if term_type != ATM_TT_NONE */
|
||||
} h310;
|
||||
struct { /* if l3_proto = ATM_L3_TR9577 */
|
||||
unsigned char ipi; /* initial protocol id */
|
||||
unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
|
||||
/* (only if ipi == NLPID_IEEE802_1_SNAP) */
|
||||
} tr9577;
|
||||
} l3;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
|
||||
struct atm_bhli {
|
||||
unsigned char hl_type; /* high layer information type */
|
||||
unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
|
||||
/* hl_type == ATM_HL_ISO) */
|
||||
unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
|
||||
};
|
||||
|
||||
|
||||
#define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
|
||||
|
||||
|
||||
struct atm_sap {
|
||||
struct atm_bhli bhli; /* local SAP, high-layer information */
|
||||
struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
|
||||
/* local SAP, low-layer info */
|
||||
};
|
||||
|
||||
|
||||
static __inline__ int blli_in_use(struct atm_blli blli)
|
||||
{
|
||||
return blli.l2_proto || blli.l3_proto;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/* atmsvc.h - ATM signaling kernel-demon interface definitions */
|
||||
|
||||
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
|
||||
|
||||
|
||||
#ifndef _LINUX_ATMSVC_H
|
||||
#define _LINUX_ATMSVC_H
|
||||
|
||||
#include <linux/atmapi.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/atmioc.h>
|
||||
|
||||
|
||||
#define ATMSIGD_CTRL _IO('a',ATMIOC_SPECIAL)
|
||||
/* become ATM signaling demon control socket */
|
||||
|
||||
enum atmsvc_msg_type { as_catch_null, as_bind, as_connect, as_accept, as_reject,
|
||||
as_listen, as_okay, as_error, as_indicate, as_close,
|
||||
as_itf_notify, as_modify, as_identify, as_terminate,
|
||||
as_addparty, as_dropparty };
|
||||
|
||||
struct atmsvc_msg {
|
||||
enum atmsvc_msg_type type;
|
||||
atm_kptr_t vcc;
|
||||
atm_kptr_t listen_vcc; /* indicate */
|
||||
int reply; /* for okay and close: */
|
||||
/* < 0: error before active */
|
||||
/* (sigd has discarded ctx) */
|
||||
/* ==0: success */
|
||||
/* > 0: error when active (still */
|
||||
/* need to close) */
|
||||
struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */
|
||||
struct sockaddr_atmsvc local; /* local SVC address */
|
||||
struct atm_qos qos; /* QOS parameters */
|
||||
struct atm_sap sap; /* SAP */
|
||||
unsigned int session; /* for p2pm */
|
||||
struct sockaddr_atmsvc svc; /* SVC address */
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
/*
|
||||
* Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz
|
||||
*/
|
||||
|
||||
/*
|
||||
* Some policy stuff for atmsigd and for net/atm/svc.c. Both have to agree on
|
||||
* what PCR is used to request bandwidth from the device driver. net/atm/svc.c
|
||||
* tries to do better than that, but only if there's no routing decision (i.e.
|
||||
* if signaling only uses one ATM interface).
|
||||
*/
|
||||
|
||||
#define SELECT_TOP_PCR(tp) ((tp).pcr ? (tp).pcr : \
|
||||
(tp).max_pcr && (tp).max_pcr != ATM_MAX_PCR ? (tp).max_pcr : \
|
||||
(tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR)
|
||||
|
||||
#endif
|
||||
|
|
@ -86,6 +86,31 @@ static inline int atomic_dec_unless_positive(atomic_t *p)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* atomic_dec_if_positive - decrement by 1 if old value positive
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* The function returns the old value of *v minus 1, even if
|
||||
* the atomic variable, v, was not decremented.
|
||||
*/
|
||||
#ifndef atomic_dec_if_positive
|
||||
static inline int atomic_dec_if_positive(atomic_t *v)
|
||||
{
|
||||
int c, old, dec;
|
||||
c = atomic_read(v);
|
||||
for (;;) {
|
||||
dec = c - 1;
|
||||
if (unlikely(dec < 0))
|
||||
break;
|
||||
old = atomic_cmpxchg((v), c, dec);
|
||||
if (likely(old == c))
|
||||
break;
|
||||
c = old;
|
||||
}
|
||||
return dec;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
|
||||
static inline void atomic_or(int i, atomic_t *v)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,388 +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_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;
|
||||
|
|
@ -452,6 +75,16 @@ struct audit_field {
|
|||
extern int __init audit_register_class(int class, unsigned *list);
|
||||
extern int audit_classify_syscall(int abi, unsigned syscall);
|
||||
extern int audit_classify_arch(int arch);
|
||||
|
||||
/* audit_names->type values */
|
||||
#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
|
||||
#define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */
|
||||
#define AUDIT_TYPE_PARENT 2 /* a parent audit record */
|
||||
#define AUDIT_TYPE_CHILD_DELETE 3 /* a child being deleted */
|
||||
#define AUDIT_TYPE_CHILD_CREATE 4 /* a child being created */
|
||||
|
||||
struct filename;
|
||||
|
||||
#ifdef CONFIG_AUDITSYSCALL
|
||||
/* These are defined in auditsc.c */
|
||||
/* Public API */
|
||||
|
|
@ -461,11 +94,14 @@ extern void __audit_syscall_entry(int arch,
|
|||
int major, unsigned long a0, unsigned long a1,
|
||||
unsigned long a2, unsigned long a3);
|
||||
extern void __audit_syscall_exit(int ret_success, long ret_value);
|
||||
extern void __audit_getname(const char *name);
|
||||
extern void audit_putname(const char *name);
|
||||
extern void __audit_inode(const char *name, const struct dentry *dentry);
|
||||
extern void __audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent);
|
||||
extern struct filename *__audit_reusename(const __user char *uptr);
|
||||
extern void __audit_getname(struct filename *name);
|
||||
extern void audit_putname(struct filename *name);
|
||||
extern void __audit_inode(struct filename *name, const struct dentry *dentry,
|
||||
unsigned int parent);
|
||||
extern void __audit_inode_child(const struct inode *parent,
|
||||
const struct dentry *dentry,
|
||||
const unsigned char type);
|
||||
extern void __audit_seccomp(unsigned long syscall, long signr, int code);
|
||||
extern void __audit_ptrace(struct task_struct *t);
|
||||
|
||||
|
|
@ -495,19 +131,27 @@ static inline void audit_syscall_exit(void *pt_regs)
|
|||
__audit_syscall_exit(success, return_code);
|
||||
}
|
||||
}
|
||||
static inline void audit_getname(const char *name)
|
||||
static inline struct filename *audit_reusename(const __user char *name)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_reusename(name);
|
||||
return NULL;
|
||||
}
|
||||
static inline void audit_getname(struct filename *name)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_getname(name);
|
||||
}
|
||||
static inline void audit_inode(const char *name, const struct dentry *dentry) {
|
||||
static inline void audit_inode(struct filename *name, const struct dentry *dentry,
|
||||
unsigned int parent) {
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode(name, dentry);
|
||||
__audit_inode(name, dentry, parent);
|
||||
}
|
||||
static inline void audit_inode_child(const struct dentry *dentry,
|
||||
const struct inode *parent) {
|
||||
static inline void audit_inode_child(const struct inode *parent,
|
||||
const struct dentry *dentry,
|
||||
const unsigned char type) {
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode_child(dentry, parent);
|
||||
__audit_inode_child(parent, dentry, type);
|
||||
}
|
||||
void audit_core_dumps(long signr);
|
||||
|
||||
|
|
@ -527,9 +171,18 @@ static inline void audit_ptrace(struct task_struct *t)
|
|||
extern unsigned int audit_serial(void);
|
||||
extern int auditsc_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial);
|
||||
extern int audit_set_loginuid(kuid_t loginuid);
|
||||
#define audit_get_loginuid(t) ((t)->loginuid)
|
||||
#define audit_get_sessionid(t) ((t)->sessionid)
|
||||
extern int audit_set_loginuid(kuid_t loginuid);
|
||||
|
||||
static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
|
||||
{
|
||||
return tsk->loginuid;
|
||||
}
|
||||
|
||||
static inline int audit_get_sessionid(struct task_struct *tsk)
|
||||
{
|
||||
return tsk->sessionid;
|
||||
}
|
||||
|
||||
extern void audit_log_task_context(struct audit_buffer *ab);
|
||||
extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk);
|
||||
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
|
||||
|
|
@ -626,38 +279,111 @@ static inline void audit_mmap_fd(int fd, int flags)
|
|||
extern int audit_n_rules;
|
||||
extern int audit_signals;
|
||||
#else /* CONFIG_AUDITSYSCALL */
|
||||
#define audit_alloc(t) ({ 0; })
|
||||
#define audit_free(t) do { ; } while (0)
|
||||
#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
|
||||
#define audit_syscall_exit(r) do { ; } while (0)
|
||||
#define audit_dummy_context() 1
|
||||
#define audit_getname(n) do { ; } while (0)
|
||||
#define audit_putname(n) do { ; } while (0)
|
||||
#define __audit_inode(n,d) do { ; } while (0)
|
||||
#define __audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_inode(n,d) do { (void)(d); } while (0)
|
||||
#define audit_inode_child(i,p) do { ; } while (0)
|
||||
#define audit_core_dumps(i) do { ; } while (0)
|
||||
#define audit_seccomp(i,s,c) do { ; } while (0)
|
||||
#define auditsc_get_stamp(c,t,s) (0)
|
||||
#define audit_get_loginuid(t) (INVALID_UID)
|
||||
#define audit_get_sessionid(t) (-1)
|
||||
#define audit_log_task_context(b) do { ; } while (0)
|
||||
#define audit_log_task_info(b, t) do { ; } while (0)
|
||||
#define audit_ipc_obj(i) ((void)0)
|
||||
#define audit_ipc_set_perm(q,u,g,m) ((void)0)
|
||||
#define audit_bprm(p) ({ 0; })
|
||||
#define audit_socketcall(n,a) ((void)0)
|
||||
#define audit_fd_pair(n,a) ((void)0)
|
||||
#define audit_sockaddr(len, addr) ({ 0; })
|
||||
#define audit_mq_open(o,m,a) ((void)0)
|
||||
#define audit_mq_sendrecv(d,l,p,t) ((void)0)
|
||||
#define audit_mq_notify(d,n) ((void)0)
|
||||
#define audit_mq_getsetattr(d,s) ((void)0)
|
||||
#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; })
|
||||
#define audit_log_capset(pid, ncr, ocr) ((void)0)
|
||||
#define audit_mmap_fd(fd, flags) ((void)0)
|
||||
#define audit_ptrace(t) ((void)0)
|
||||
static inline int audit_alloc(struct task_struct *task)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_free(struct task_struct *task)
|
||||
{ }
|
||||
static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
|
||||
unsigned long a1, unsigned long a2,
|
||||
unsigned long a3)
|
||||
{ }
|
||||
static inline void audit_syscall_exit(void *pt_regs)
|
||||
{ }
|
||||
static inline int audit_dummy_context(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
static inline struct filename *audit_reusename(const __user char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void audit_getname(struct filename *name)
|
||||
{ }
|
||||
static inline void audit_putname(struct filename *name)
|
||||
{ }
|
||||
static inline void __audit_inode(struct filename *name,
|
||||
const struct dentry *dentry,
|
||||
unsigned int parent)
|
||||
{ }
|
||||
static inline void __audit_inode_child(const struct inode *parent,
|
||||
const struct dentry *dentry,
|
||||
const unsigned char type)
|
||||
{ }
|
||||
static inline void audit_inode(struct filename *name,
|
||||
const struct dentry *dentry,
|
||||
unsigned int parent)
|
||||
{ }
|
||||
static inline void audit_inode_child(const struct inode *parent,
|
||||
const struct dentry *dentry,
|
||||
const unsigned char type)
|
||||
{ }
|
||||
static inline void audit_core_dumps(long signr)
|
||||
{ }
|
||||
static inline void __audit_seccomp(unsigned long syscall, long signr, int code)
|
||||
{ }
|
||||
static inline void audit_seccomp(unsigned long syscall, long signr, int code)
|
||||
{ }
|
||||
static inline int auditsc_get_stamp(struct audit_context *ctx,
|
||||
struct timespec *t, unsigned int *serial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
|
||||
{
|
||||
return INVALID_UID;
|
||||
}
|
||||
static inline int audit_get_sessionid(struct task_struct *tsk)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
static inline void audit_log_task_context(struct audit_buffer *ab)
|
||||
{ }
|
||||
static inline void audit_log_task_info(struct audit_buffer *ab,
|
||||
struct task_struct *tsk)
|
||||
{ }
|
||||
static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
{ }
|
||||
static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid,
|
||||
gid_t gid, umode_t mode)
|
||||
{ }
|
||||
static inline int audit_bprm(struct linux_binprm *bprm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_socketcall(int nargs, unsigned long *args)
|
||||
{ }
|
||||
static inline void audit_fd_pair(int fd1, int fd2)
|
||||
{ }
|
||||
static inline int audit_sockaddr(int len, void *addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
|
||||
{ }
|
||||
static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len,
|
||||
unsigned int msg_prio,
|
||||
const struct timespec *abs_timeout)
|
||||
{ }
|
||||
static inline void audit_mq_notify(mqd_t mqdes,
|
||||
const struct sigevent *notification)
|
||||
{ }
|
||||
static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
|
||||
{ }
|
||||
static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
|
||||
const struct cred *new,
|
||||
const struct cred *old)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_log_capset(pid_t pid, const struct cred *new,
|
||||
const struct cred *old)
|
||||
{ }
|
||||
static inline void audit_mmap_fd(int fd, int flags)
|
||||
{ }
|
||||
static inline void audit_ptrace(struct task_struct *t)
|
||||
{ }
|
||||
#define audit_n_rules 0
|
||||
#define audit_signals 0
|
||||
#endif /* CONFIG_AUDITSYSCALL */
|
||||
|
|
@ -681,7 +407,6 @@ extern void audit_log_n_hex(struct audit_buffer *ab,
|
|||
extern void audit_log_n_string(struct audit_buffer *ab,
|
||||
const char *buf,
|
||||
size_t n);
|
||||
#define audit_log_string(a,b) audit_log_n_string(a, b, strlen(b));
|
||||
extern void audit_log_n_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string,
|
||||
size_t n);
|
||||
|
|
@ -698,7 +423,8 @@ extern void audit_log_lost(const char *message);
|
|||
#ifdef CONFIG_SECURITY
|
||||
extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
|
||||
#else
|
||||
#define audit_log_secctx(b,s) do { ; } while (0)
|
||||
static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
|
||||
{ }
|
||||
#endif
|
||||
|
||||
extern int audit_update_lsm_rules(void);
|
||||
|
|
@ -710,22 +436,49 @@ extern int audit_receive_filter(int type, int pid, int seq,
|
|||
void *data, size_t datasz, kuid_t loginuid,
|
||||
u32 sessionid, u32 sid);
|
||||
extern int audit_enabled;
|
||||
#else
|
||||
#define audit_log(c,g,t,f,...) do { ; } while (0)
|
||||
#define audit_log_start(c,g,t) ({ NULL; })
|
||||
#define audit_log_vformat(b,f,a) do { ; } while (0)
|
||||
#define audit_log_format(b,f,...) do { ; } while (0)
|
||||
#define audit_log_end(b) do { ; } while (0)
|
||||
#define audit_log_n_hex(a,b,l) do { ; } while (0)
|
||||
#define audit_log_n_string(a,c,l) do { ; } while (0)
|
||||
#define audit_log_string(a,c) do { ; } while (0)
|
||||
#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
|
||||
#define audit_log_untrustedstring(a,s) do { ; } while (0)
|
||||
#define audit_log_d_path(b, p, d) do { ; } while (0)
|
||||
#define audit_log_key(b, k) do { ; } while (0)
|
||||
#define audit_log_link_denied(o, l) do { ; } while (0)
|
||||
#define audit_log_secctx(b,s) do { ; } while (0)
|
||||
#else /* CONFIG_AUDIT */
|
||||
static inline __printf(4, 5)
|
||||
void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
|
||||
const char *fmt, ...)
|
||||
{ }
|
||||
static inline struct audit_buffer *audit_log_start(struct audit_context *ctx,
|
||||
gfp_t gfp_mask, int type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline __printf(2, 3)
|
||||
void audit_log_format(struct audit_buffer *ab, const char *fmt, ...)
|
||||
{ }
|
||||
static inline void audit_log_end(struct audit_buffer *ab)
|
||||
{ }
|
||||
static inline void audit_log_n_hex(struct audit_buffer *ab,
|
||||
const unsigned char *buf, size_t len)
|
||||
{ }
|
||||
static inline void audit_log_n_string(struct audit_buffer *ab,
|
||||
const char *buf, size_t n)
|
||||
{ }
|
||||
static inline void audit_log_n_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string, size_t n)
|
||||
{ }
|
||||
static inline void audit_log_untrustedstring(struct audit_buffer *ab,
|
||||
const char *string)
|
||||
{ }
|
||||
static inline void audit_log_d_path(struct audit_buffer *ab,
|
||||
const char *prefix,
|
||||
const struct path *path)
|
||||
{ }
|
||||
static inline void audit_log_key(struct audit_buffer *ab, char *key)
|
||||
{ }
|
||||
static inline void audit_log_link_denied(const char *string,
|
||||
const struct path *link)
|
||||
{ }
|
||||
static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid)
|
||||
{ }
|
||||
#define audit_enabled 0
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_AUDIT */
|
||||
static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
|
||||
{
|
||||
audit_log_n_string(ab, buf, strlen(buf));
|
||||
}
|
||||
|
||||
#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,164 +0,0 @@
|
|||
/* -*- c -*-
|
||||
* linux/include/linux/auto_fs4.h
|
||||
*
|
||||
* Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
|
||||
*
|
||||
* This file is part of the Linux kernel and is made available under
|
||||
* the terms of the GNU General Public License, version 2, or at your
|
||||
* option, any later version, incorporated herein by reference.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_AUTO_FS4_H
|
||||
#define _LINUX_AUTO_FS4_H
|
||||
|
||||
/* Include common v3 definitions */
|
||||
#include <linux/types.h>
|
||||
#include <linux/auto_fs.h>
|
||||
|
||||
/* autofs v4 definitions */
|
||||
#undef AUTOFS_PROTO_VERSION
|
||||
#undef AUTOFS_MIN_PROTO_VERSION
|
||||
#undef AUTOFS_MAX_PROTO_VERSION
|
||||
|
||||
#define AUTOFS_PROTO_VERSION 5
|
||||
#define AUTOFS_MIN_PROTO_VERSION 3
|
||||
#define AUTOFS_MAX_PROTO_VERSION 5
|
||||
|
||||
#define AUTOFS_PROTO_SUBVERSION 2
|
||||
|
||||
/* Mask for expire behaviour */
|
||||
#define AUTOFS_EXP_IMMEDIATE 1
|
||||
#define AUTOFS_EXP_LEAVES 2
|
||||
|
||||
#define AUTOFS_TYPE_ANY 0U
|
||||
#define AUTOFS_TYPE_INDIRECT 1U
|
||||
#define AUTOFS_TYPE_DIRECT 2U
|
||||
#define AUTOFS_TYPE_OFFSET 4U
|
||||
|
||||
static inline void set_autofs_type_indirect(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_INDIRECT;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_indirect(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_INDIRECT);
|
||||
}
|
||||
|
||||
static inline void set_autofs_type_direct(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_DIRECT;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_direct(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_DIRECT);
|
||||
}
|
||||
|
||||
static inline void set_autofs_type_offset(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_OFFSET;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_offset(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_OFFSET);
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_trigger(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
|
||||
}
|
||||
|
||||
/*
|
||||
* This isn't really a type as we use it to say "no type set" to
|
||||
* indicate we want to search for "any" mount in the
|
||||
* autofs_dev_ioctl_ismountpoint() device ioctl function.
|
||||
*/
|
||||
static inline void set_autofs_type_any(unsigned int *type)
|
||||
{
|
||||
*type = AUTOFS_TYPE_ANY;
|
||||
return;
|
||||
}
|
||||
|
||||
static inline unsigned int autofs_type_any(unsigned int type)
|
||||
{
|
||||
return (type == AUTOFS_TYPE_ANY);
|
||||
}
|
||||
|
||||
/* Daemon notification packet types */
|
||||
enum autofs_notify {
|
||||
NFY_NONE,
|
||||
NFY_MOUNT,
|
||||
NFY_EXPIRE
|
||||
};
|
||||
|
||||
/* Kernel protocol version 4 packet types */
|
||||
|
||||
/* Expire entry (umount request) */
|
||||
#define autofs_ptype_expire_multi 2
|
||||
|
||||
/* Kernel protocol version 5 packet types */
|
||||
|
||||
/* Indirect mount missing and expire requests. */
|
||||
#define autofs_ptype_missing_indirect 3
|
||||
#define autofs_ptype_expire_indirect 4
|
||||
|
||||
/* Direct mount missing and expire requests */
|
||||
#define autofs_ptype_missing_direct 5
|
||||
#define autofs_ptype_expire_direct 6
|
||||
|
||||
/* v4 multi expire (via pipe) */
|
||||
struct autofs_packet_expire_multi {
|
||||
struct autofs_packet_hdr hdr;
|
||||
autofs_wqt_t wait_queue_token;
|
||||
int len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
union autofs_packet_union {
|
||||
struct autofs_packet_hdr hdr;
|
||||
struct autofs_packet_missing missing;
|
||||
struct autofs_packet_expire expire;
|
||||
struct autofs_packet_expire_multi expire_multi;
|
||||
};
|
||||
|
||||
/* autofs v5 common packet struct */
|
||||
struct autofs_v5_packet {
|
||||
struct autofs_packet_hdr hdr;
|
||||
autofs_wqt_t wait_queue_token;
|
||||
__u32 dev;
|
||||
__u64 ino;
|
||||
__u32 uid;
|
||||
__u32 gid;
|
||||
__u32 pid;
|
||||
__u32 tgid;
|
||||
__u32 len;
|
||||
char name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
|
||||
typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
|
||||
typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
|
||||
typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
|
||||
|
||||
union autofs_v5_packet_union {
|
||||
struct autofs_packet_hdr hdr;
|
||||
struct autofs_v5_packet v5_packet;
|
||||
autofs_packet_missing_indirect_t missing_indirect;
|
||||
autofs_packet_expire_indirect_t expire_indirect;
|
||||
autofs_packet_missing_direct_t missing_direct;
|
||||
autofs_packet_expire_direct_t expire_direct;
|
||||
};
|
||||
|
||||
#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
|
||||
#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
|
||||
#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
|
||||
#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
|
||||
#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
|
||||
|
||||
|
||||
#endif /* _LINUX_AUTO_FS4_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,116 +0,0 @@
|
|||
/*
|
||||
* These are the public elements of the Linux kernel AX.25 code. A similar
|
||||
* file netrom.h exists for the NET/ROM protocol.
|
||||
*/
|
||||
|
||||
#ifndef AX25_KERNEL_H
|
||||
#define AX25_KERNEL_H
|
||||
|
||||
#include <linux/socket.h>
|
||||
|
||||
#define AX25_MTU 256
|
||||
#define AX25_MAX_DIGIS 8
|
||||
|
||||
#define AX25_WINDOW 1
|
||||
#define AX25_T1 2
|
||||
#define AX25_N2 3
|
||||
#define AX25_T3 4
|
||||
#define AX25_T2 5
|
||||
#define AX25_BACKOFF 6
|
||||
#define AX25_EXTSEQ 7
|
||||
#define AX25_PIDINCL 8
|
||||
#define AX25_IDLE 9
|
||||
#define AX25_PACLEN 10
|
||||
#define AX25_IAMDIGI 12
|
||||
|
||||
#define AX25_KILL 99
|
||||
|
||||
#define SIOCAX25GETUID (SIOCPROTOPRIVATE+0)
|
||||
#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
|
||||
#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
|
||||
#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
|
||||
#define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7)
|
||||
#define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8)
|
||||
#define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9)
|
||||
#define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10)
|
||||
#define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11)
|
||||
#define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12)
|
||||
#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13)
|
||||
|
||||
#define AX25_SET_RT_IPMODE 2
|
||||
|
||||
#define AX25_NOUID_DEFAULT 0
|
||||
#define AX25_NOUID_BLOCK 1
|
||||
|
||||
typedef struct {
|
||||
char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */
|
||||
} ax25_address;
|
||||
|
||||
struct sockaddr_ax25 {
|
||||
__kernel_sa_family_t sax25_family;
|
||||
ax25_address sax25_call;
|
||||
int sax25_ndigis;
|
||||
/* Digipeater ax25_address sets follow */
|
||||
};
|
||||
|
||||
#define sax25_uid sax25_ndigis
|
||||
|
||||
struct full_sockaddr_ax25 {
|
||||
struct sockaddr_ax25 fsa_ax25;
|
||||
ax25_address fsa_digipeater[AX25_MAX_DIGIS];
|
||||
};
|
||||
|
||||
struct ax25_routes_struct {
|
||||
ax25_address port_addr;
|
||||
ax25_address dest_addr;
|
||||
unsigned char digi_count;
|
||||
ax25_address digi_addr[AX25_MAX_DIGIS];
|
||||
};
|
||||
|
||||
struct ax25_route_opt_struct {
|
||||
ax25_address port_addr;
|
||||
ax25_address dest_addr;
|
||||
int cmd;
|
||||
int arg;
|
||||
};
|
||||
|
||||
struct ax25_ctl_struct {
|
||||
ax25_address port_addr;
|
||||
ax25_address source_addr;
|
||||
ax25_address dest_addr;
|
||||
unsigned int cmd;
|
||||
unsigned long arg;
|
||||
unsigned char digi_count;
|
||||
ax25_address digi_addr[AX25_MAX_DIGIS];
|
||||
};
|
||||
|
||||
/* this will go away. Please do not export to user land */
|
||||
struct ax25_info_struct_deprecated {
|
||||
unsigned int n2, n2count;
|
||||
unsigned int t1, t1timer;
|
||||
unsigned int t2, t2timer;
|
||||
unsigned int t3, t3timer;
|
||||
unsigned int idle, idletimer;
|
||||
unsigned int state;
|
||||
unsigned int rcv_q, snd_q;
|
||||
};
|
||||
|
||||
struct ax25_info_struct {
|
||||
unsigned int n2, n2count;
|
||||
unsigned int t1, t1timer;
|
||||
unsigned int t2, t2timer;
|
||||
unsigned int t3, t3timer;
|
||||
unsigned int idle, idletimer;
|
||||
unsigned int state;
|
||||
unsigned int rcv_q, snd_q;
|
||||
unsigned int vs, vr, va, vs_max;
|
||||
unsigned int paclen;
|
||||
unsigned int window;
|
||||
};
|
||||
|
||||
struct ax25_fwd_struct {
|
||||
ax25_address port_from;
|
||||
ax25_address port_to;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
|
||||
*
|
||||
* ISDN lowlevel-module for AVM B1-card.
|
||||
*
|
||||
* Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _B1LLI_H_
|
||||
#define _B1LLI_H_
|
||||
/*
|
||||
* struct for loading t4 file
|
||||
*/
|
||||
typedef struct avmb1_t4file {
|
||||
int len;
|
||||
unsigned char *data;
|
||||
} avmb1_t4file;
|
||||
|
||||
typedef struct avmb1_loaddef {
|
||||
int contr;
|
||||
avmb1_t4file t4file;
|
||||
} avmb1_loaddef;
|
||||
|
||||
typedef struct avmb1_loadandconfigdef {
|
||||
int contr;
|
||||
avmb1_t4file t4file;
|
||||
avmb1_t4file t4config;
|
||||
} avmb1_loadandconfigdef;
|
||||
|
||||
typedef struct avmb1_resetdef {
|
||||
int contr;
|
||||
} avmb1_resetdef;
|
||||
|
||||
typedef struct avmb1_getdef {
|
||||
int contr;
|
||||
int cardtype;
|
||||
int cardstate;
|
||||
} avmb1_getdef;
|
||||
|
||||
/*
|
||||
* struct for adding new cards
|
||||
*/
|
||||
typedef struct avmb1_carddef {
|
||||
int port;
|
||||
int irq;
|
||||
} avmb1_carddef;
|
||||
|
||||
#define AVM_CARDTYPE_B1 0
|
||||
#define AVM_CARDTYPE_T1 1
|
||||
#define AVM_CARDTYPE_M1 2
|
||||
#define AVM_CARDTYPE_M2 3
|
||||
|
||||
typedef struct avmb1_extcarddef {
|
||||
int port;
|
||||
int irq;
|
||||
int cardtype;
|
||||
int cardnr; /* for HEMA/T1 */
|
||||
} avmb1_extcarddef;
|
||||
|
||||
#define AVMB1_LOAD 0 /* load image to card */
|
||||
#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */
|
||||
#define AVMB1_RESETCARD 2 /* reset a card */
|
||||
#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */
|
||||
#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */
|
||||
#define AVMB1_GET_CARDINFO 5 /* get cardtype */
|
||||
#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */
|
||||
|
||||
#define AVMB1_REGISTERCARD_IS_OBSOLETE
|
||||
|
||||
#endif /* _B1LLI_H_ */
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* The Linux BAYCOM driver for the Baycom serial 1200 baud modem
|
||||
* and the parallel 9600 baud modem
|
||||
* (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA
|
||||
*/
|
||||
|
||||
#ifndef _BAYCOM_H
|
||||
#define _BAYCOM_H
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/*
|
||||
* structs for the IOCTL commands
|
||||
*/
|
||||
|
||||
struct baycom_debug_data {
|
||||
unsigned long debug1;
|
||||
unsigned long debug2;
|
||||
long debug3;
|
||||
};
|
||||
|
||||
struct baycom_ioctl {
|
||||
int cmd;
|
||||
union {
|
||||
struct baycom_debug_data dbg;
|
||||
} data;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ioctl values change for baycom
|
||||
*/
|
||||
#define BAYCOMCTL_GETDEBUG 0x92
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#endif /* _BAYCOM_H */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
|
@ -522,6 +522,8 @@ struct bcma_sflash {
|
|||
u32 blocksize;
|
||||
u16 numblocks;
|
||||
u32 size;
|
||||
|
||||
struct mtd_info *mtd;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
* include/linux/bfs_fs.h - BFS data structures on disk.
|
||||
* Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com>
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_BFS_FS_H
|
||||
#define _LINUX_BFS_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define BFS_BSIZE_BITS 9
|
||||
#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
|
||||
|
||||
#define BFS_MAGIC 0x1BADFACE
|
||||
#define BFS_ROOT_INO 2
|
||||
#define BFS_INODES_PER_BLOCK 8
|
||||
|
||||
/* SVR4 vnode type values (bfs_inode->i_vtype) */
|
||||
#define BFS_VDIR 2L
|
||||
#define BFS_VREG 1L
|
||||
|
||||
/* BFS inode layout on disk */
|
||||
struct bfs_inode {
|
||||
__le16 i_ino;
|
||||
__u16 i_unused;
|
||||
__le32 i_sblock;
|
||||
__le32 i_eblock;
|
||||
__le32 i_eoffset;
|
||||
__le32 i_vtype;
|
||||
__le32 i_mode;
|
||||
__le32 i_uid;
|
||||
__le32 i_gid;
|
||||
__le32 i_nlink;
|
||||
__le32 i_atime;
|
||||
__le32 i_mtime;
|
||||
__le32 i_ctime;
|
||||
__u32 i_padding[4];
|
||||
};
|
||||
|
||||
#define BFS_NAMELEN 14
|
||||
#define BFS_DIRENT_SIZE 16
|
||||
#define BFS_DIRS_PER_BLOCK 32
|
||||
|
||||
struct bfs_dirent {
|
||||
__le16 ino;
|
||||
char name[BFS_NAMELEN];
|
||||
};
|
||||
|
||||
/* BFS superblock layout on disk */
|
||||
struct bfs_super_block {
|
||||
__le32 s_magic;
|
||||
__le32 s_start;
|
||||
__le32 s_end;
|
||||
__le32 s_from;
|
||||
__le32 s_to;
|
||||
__s32 s_bfrom;
|
||||
__s32 s_bto;
|
||||
char s_fsname[6];
|
||||
char s_volume[6];
|
||||
__u32 s_padding[118];
|
||||
};
|
||||
|
||||
|
||||
#define BFS_OFF2INO(offset) \
|
||||
((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
|
||||
|
||||
#define BFS_INO2OFF(ino) \
|
||||
((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
|
||||
#define BFS_NZFILESIZE(ip) \
|
||||
((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
|
||||
|
||||
#define BFS_FILESIZE(ip) \
|
||||
((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
|
||||
|
||||
#define BFS_FILEBLOCKS(ip) \
|
||||
((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
|
||||
#define BFS_UNCLEAN(bfs_sb, sb) \
|
||||
((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
|
||||
|
||||
|
||||
#endif /* _LINUX_BFS_FS_H */
|
||||
|
|
@ -1,24 +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
|
||||
|
||||
|
|
@ -72,7 +58,7 @@ struct linux_binprm {
|
|||
|
||||
/* Function parameter for binfmt->coredump */
|
||||
struct coredump_params {
|
||||
long signr;
|
||||
siginfo_t *siginfo;
|
||||
struct pt_regs *regs;
|
||||
struct file *file;
|
||||
unsigned long limit;
|
||||
|
|
@ -132,9 +118,11 @@ extern int copy_strings_kernel(int argc, const char *const *argv,
|
|||
struct linux_binprm *bprm);
|
||||
extern int prepare_bprm_creds(struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern void set_binfmt(struct linux_binfmt *new);
|
||||
extern void free_bprm(struct linux_binprm *);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#ifdef __ARCH_WANT_KERNEL_EXECVE
|
||||
extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BINFMTS_H */
|
||||
|
|
|
|||
|
|
@ -212,20 +212,41 @@ extern void bio_pair_release(struct bio_pair *dbio);
|
|||
extern struct bio_set *bioset_create(unsigned int, unsigned int);
|
||||
extern void bioset_free(struct bio_set *);
|
||||
|
||||
extern struct bio *bio_alloc(gfp_t, unsigned int);
|
||||
extern struct bio *bio_kmalloc(gfp_t, unsigned int);
|
||||
extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
|
||||
extern void bio_put(struct bio *);
|
||||
extern void bio_free(struct bio *, struct bio_set *);
|
||||
|
||||
extern void __bio_clone(struct bio *, struct bio *);
|
||||
extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
|
||||
|
||||
extern struct bio_set *fs_bio_set;
|
||||
|
||||
static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs)
|
||||
{
|
||||
return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
|
||||
}
|
||||
|
||||
static inline struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
|
||||
{
|
||||
return bio_clone_bioset(bio, gfp_mask, fs_bio_set);
|
||||
}
|
||||
|
||||
static inline struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs)
|
||||
{
|
||||
return bio_alloc_bioset(gfp_mask, nr_iovecs, NULL);
|
||||
}
|
||||
|
||||
static inline struct bio *bio_clone_kmalloc(struct bio *bio, gfp_t gfp_mask)
|
||||
{
|
||||
return bio_clone_bioset(bio, gfp_mask, NULL);
|
||||
|
||||
}
|
||||
|
||||
extern void bio_endio(struct bio *, int);
|
||||
struct request_queue;
|
||||
extern int bio_phys_segments(struct request_queue *, struct bio *);
|
||||
|
||||
extern void __bio_clone(struct bio *, struct bio *);
|
||||
extern struct bio *bio_clone(struct bio *, gfp_t);
|
||||
|
||||
extern void bio_init(struct bio *);
|
||||
extern void bio_reset(struct bio *);
|
||||
|
||||
extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
|
||||
extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
|
||||
|
|
@ -304,8 +325,6 @@ struct biovec_slab {
|
|||
struct kmem_cache *slab;
|
||||
};
|
||||
|
||||
extern struct bio_set *fs_bio_set;
|
||||
|
||||
/*
|
||||
* a small number of entries is fine, not going to be performance critical.
|
||||
* basically we just need to survive
|
||||
|
|
@ -367,9 +386,31 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
|
|||
/*
|
||||
* Check whether this bio carries any data or not. A NULL bio is allowed.
|
||||
*/
|
||||
static inline int bio_has_data(struct bio *bio)
|
||||
static inline bool bio_has_data(struct bio *bio)
|
||||
{
|
||||
return bio && bio->bi_io_vec != NULL;
|
||||
if (bio && bio->bi_vcnt)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool bio_is_rw(struct bio *bio)
|
||||
{
|
||||
if (!bio_has_data(bio))
|
||||
return false;
|
||||
|
||||
if (bio->bi_rw & REQ_WRITE_SAME)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool bio_mergeable(struct bio *bio)
|
||||
{
|
||||
if (bio->bi_rw & REQ_NOMERGE_FLAGS)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -505,9 +546,8 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
|
|||
|
||||
#define bio_integrity(bio) (bio->bi_integrity != NULL)
|
||||
|
||||
extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
|
||||
extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
|
||||
extern void bio_integrity_free(struct bio *, struct bio_set *);
|
||||
extern void bio_integrity_free(struct bio *);
|
||||
extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
|
||||
extern int bio_integrity_enabled(struct bio *bio);
|
||||
extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
|
||||
|
|
@ -517,7 +557,7 @@ extern void bio_integrity_endio(struct bio *, int);
|
|||
extern void bio_integrity_advance(struct bio *, unsigned int);
|
||||
extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
|
||||
extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
|
||||
extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *);
|
||||
extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
|
||||
extern int bioset_integrity_create(struct bio_set *, int);
|
||||
extern void bioset_integrity_free(struct bio_set *);
|
||||
extern void bio_integrity_init(void);
|
||||
|
|
@ -549,13 +589,13 @@ static inline int bio_integrity_prep(struct bio *bio)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void bio_integrity_free(struct bio *bio, struct bio_set *bs)
|
||||
static inline void bio_integrity_free(struct bio *bio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
|
||||
gfp_t gfp_mask, struct bio_set *bs)
|
||||
gfp_t gfp_mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,12 +59,6 @@ struct bio {
|
|||
unsigned int bi_seg_front_size;
|
||||
unsigned int bi_seg_back_size;
|
||||
|
||||
unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
|
||||
|
||||
atomic_t bi_cnt; /* pin count */
|
||||
|
||||
struct bio_vec *bi_io_vec; /* the actual vec list */
|
||||
|
||||
bio_end_io_t *bi_end_io;
|
||||
|
||||
void *bi_private;
|
||||
|
|
@ -80,7 +74,17 @@ struct bio {
|
|||
struct bio_integrity_payload *bi_integrity; /* data integrity */
|
||||
#endif
|
||||
|
||||
bio_destructor_t *bi_destructor; /* destructor */
|
||||
/*
|
||||
* Everything starting with bi_max_vecs will be preserved by bio_reset()
|
||||
*/
|
||||
|
||||
unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
|
||||
|
||||
atomic_t bi_cnt; /* pin count */
|
||||
|
||||
struct bio_vec *bi_io_vec; /* the actual vec list */
|
||||
|
||||
struct bio_set *bi_pool;
|
||||
|
||||
/*
|
||||
* We can inline a number of vecs at the end of the bio, to avoid
|
||||
|
|
@ -90,6 +94,8 @@ struct bio {
|
|||
struct bio_vec bi_inline_vecs[0];
|
||||
};
|
||||
|
||||
#define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs)
|
||||
|
||||
/*
|
||||
* bio flags
|
||||
*/
|
||||
|
|
@ -105,6 +111,13 @@ struct bio {
|
|||
#define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */
|
||||
#define BIO_QUIET 10 /* Make BIO Quiet */
|
||||
#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
|
||||
|
||||
/*
|
||||
* Flags starting here get preserved by bio_reset() - this includes
|
||||
* BIO_POOL_IDX()
|
||||
*/
|
||||
#define BIO_RESET_BITS 12
|
||||
|
||||
#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
|
||||
|
||||
/*
|
||||
|
|
@ -134,6 +147,7 @@ enum rq_flag_bits {
|
|||
__REQ_PRIO, /* boost priority in cfq */
|
||||
__REQ_DISCARD, /* request to discard sectors */
|
||||
__REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
|
||||
__REQ_WRITE_SAME, /* write same block many times */
|
||||
|
||||
__REQ_NOIDLE, /* don't anticipate more IO after this one */
|
||||
__REQ_FUA, /* forced unit access */
|
||||
|
|
@ -172,15 +186,21 @@ enum rq_flag_bits {
|
|||
#define REQ_META (1 << __REQ_META)
|
||||
#define REQ_PRIO (1 << __REQ_PRIO)
|
||||
#define REQ_DISCARD (1 << __REQ_DISCARD)
|
||||
#define REQ_WRITE_SAME (1 << __REQ_WRITE_SAME)
|
||||
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
|
||||
|
||||
#define REQ_FAILFAST_MASK \
|
||||
(REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
|
||||
#define REQ_COMMON_MASK \
|
||||
(REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
|
||||
REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
|
||||
REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \
|
||||
REQ_SECURE)
|
||||
#define REQ_CLONE_MASK REQ_COMMON_MASK
|
||||
|
||||
/* This mask is used for both bio and request merge checking */
|
||||
#define REQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
|
||||
|
||||
#define REQ_RAHEAD (1 << __REQ_RAHEAD)
|
||||
#define REQ_THROTTLED (1 << __REQ_THROTTLED)
|
||||
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ struct queue_limits {
|
|||
unsigned int io_min;
|
||||
unsigned int io_opt;
|
||||
unsigned int max_discard_sectors;
|
||||
unsigned int max_write_same_sectors;
|
||||
unsigned int discard_granularity;
|
||||
unsigned int discard_alignment;
|
||||
|
||||
|
|
@ -540,8 +541,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
|
|||
|
||||
#define blk_account_rq(rq) \
|
||||
(((rq)->cmd_flags & REQ_STARTED) && \
|
||||
((rq)->cmd_type == REQ_TYPE_FS || \
|
||||
((rq)->cmd_flags & REQ_DISCARD)))
|
||||
((rq)->cmd_type == REQ_TYPE_FS))
|
||||
|
||||
#define blk_pm_request(rq) \
|
||||
((rq)->cmd_type == REQ_TYPE_PM_SUSPEND || \
|
||||
|
|
@ -595,17 +595,39 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
|
|||
rl->flags &= ~flag;
|
||||
}
|
||||
|
||||
static inline bool rq_mergeable(struct request *rq)
|
||||
{
|
||||
if (rq->cmd_type != REQ_TYPE_FS)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* mergeable request must not have _NOMERGE or _BARRIER bit set, nor may
|
||||
* it already be started by driver.
|
||||
*/
|
||||
#define RQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
|
||||
#define rq_mergeable(rq) \
|
||||
(!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
|
||||
(((rq)->cmd_flags & REQ_DISCARD) || \
|
||||
(rq)->cmd_type == REQ_TYPE_FS))
|
||||
if (rq->cmd_flags & REQ_NOMERGE_FLAGS)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool blk_check_merge_flags(unsigned int flags1,
|
||||
unsigned int flags2)
|
||||
{
|
||||
if ((flags1 & REQ_DISCARD) != (flags2 & REQ_DISCARD))
|
||||
return false;
|
||||
|
||||
if ((flags1 & REQ_SECURE) != (flags2 & REQ_SECURE))
|
||||
return false;
|
||||
|
||||
if ((flags1 & REQ_WRITE_SAME) != (flags2 & REQ_WRITE_SAME))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
|
||||
{
|
||||
if (bio_data(a) == bio_data(b))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* q->prep_rq_fn return values
|
||||
|
|
@ -802,6 +824,28 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
|||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
|
||||
unsigned int cmd_flags)
|
||||
{
|
||||
if (unlikely(cmd_flags & REQ_DISCARD))
|
||||
return q->limits.max_discard_sectors;
|
||||
|
||||
if (unlikely(cmd_flags & REQ_WRITE_SAME))
|
||||
return q->limits.max_write_same_sectors;
|
||||
|
||||
return q->limits.max_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
|
||||
{
|
||||
struct request_queue *q = rq->q;
|
||||
|
||||
if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC))
|
||||
return q->limits.max_hw_sectors;
|
||||
|
||||
return blk_queue_get_max_sectors(q, rq->cmd_flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Request issue related functions.
|
||||
*/
|
||||
|
|
@ -857,6 +901,8 @@ extern void blk_queue_max_segments(struct request_queue *, unsigned short);
|
|||
extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_discard_sectors(struct request_queue *q,
|
||||
unsigned int max_discard_sectors);
|
||||
extern void blk_queue_max_write_same_sectors(struct request_queue *q,
|
||||
unsigned int max_write_same_sectors);
|
||||
extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
|
|
@ -987,6 +1033,8 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
|
|||
extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
|
||||
extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
|
||||
sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
|
||||
extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
|
||||
sector_t nr_sects, gfp_t gfp_mask, struct page *page);
|
||||
extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
|
||||
sector_t nr_sects, gfp_t gfp_mask);
|
||||
static inline int sb_issue_discard(struct super_block *sb, sector_t block,
|
||||
|
|
@ -1164,6 +1212,16 @@ static inline unsigned int bdev_discard_zeroes_data(struct block_device *bdev)
|
|||
return queue_discard_zeroes_data(bdev_get_queue(bdev));
|
||||
}
|
||||
|
||||
static inline unsigned int bdev_write_same(struct block_device *bdev)
|
||||
{
|
||||
struct request_queue *q = bdev_get_queue(bdev);
|
||||
|
||||
if (q)
|
||||
return q->limits.max_write_same_sectors;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int queue_dma_alignment(struct request_queue *q)
|
||||
{
|
||||
return q ? q->dma_alignment : 511;
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
#ifndef _LINUX_BLKPG_H
|
||||
#define _LINUX_BLKPG_H
|
||||
|
||||
/*
|
||||
* Partition table and disk geometry handling
|
||||
*
|
||||
* A single ioctl with lots of subfunctions:
|
||||
*
|
||||
* Device number stuff:
|
||||
* get_whole_disk() (given the device number of a partition,
|
||||
* find the device number of the encompassing disk)
|
||||
* get_all_partitions() (given the device number of a disk, return the
|
||||
* device numbers of all its known partitions)
|
||||
*
|
||||
* Partition stuff:
|
||||
* add_partition()
|
||||
* delete_partition()
|
||||
* test_partition_in_use() (also for test_disk_in_use)
|
||||
*
|
||||
* Geometry stuff:
|
||||
* get_geometry()
|
||||
* set_geometry()
|
||||
* get_bios_drivedata()
|
||||
*
|
||||
* For today, only the partition stuff - aeb, 990515
|
||||
*/
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define BLKPG _IO(0x12,105)
|
||||
|
||||
/* The argument structure */
|
||||
struct blkpg_ioctl_arg {
|
||||
int op;
|
||||
int flags;
|
||||
int datalen;
|
||||
void __user *data;
|
||||
};
|
||||
|
||||
/* The subfunctions (for the op field) */
|
||||
#define BLKPG_ADD_PARTITION 1
|
||||
#define BLKPG_DEL_PARTITION 2
|
||||
#define BLKPG_RESIZE_PARTITION 3
|
||||
|
||||
/* Sizes of name fields. Unused at present. */
|
||||
#define BLKPG_DEVNAMELTH 64
|
||||
#define BLKPG_VOLNAMELTH 64
|
||||
|
||||
/* The data structure for ADD_PARTITION and DEL_PARTITION */
|
||||
struct blkpg_partition {
|
||||
long long start; /* starting offset in bytes */
|
||||
long long length; /* length in bytes */
|
||||
int pno; /* partition number */
|
||||
char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
|
||||
to be used in kernel messages */
|
||||
char volname[BLKPG_VOLNAMELTH]; /* volume label */
|
||||
};
|
||||
|
||||
#endif /* _LINUX_BLKPG_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,41 +0,0 @@
|
|||
#ifndef __BPQETHER_H
|
||||
#define __BPQETHER_H
|
||||
|
||||
/*
|
||||
* Defines for the BPQETHER pseudo device driver
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_IF_ETHER_H
|
||||
#include <linux/if_ether.h>
|
||||
#endif
|
||||
|
||||
#define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */
|
||||
#define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1)
|
||||
|
||||
struct bpq_ethaddr {
|
||||
unsigned char destination[ETH_ALEN];
|
||||
unsigned char accept[ETH_ALEN];
|
||||
};
|
||||
|
||||
/*
|
||||
* For SIOCSBPQETHOPT - this is compatible with PI2/PacketTwin card drivers,
|
||||
* currently not implemented, though. If someone wants to hook a radio
|
||||
* to his Ethernet card he may find this useful. ;-)
|
||||
*/
|
||||
|
||||
#define SIOCGBPQETHPARAM 0x5000 /* get Level 1 parameters */
|
||||
#define SIOCSBPQETHPARAM 0x5001 /* set */
|
||||
|
||||
struct bpq_req {
|
||||
int cmd;
|
||||
int speed; /* unused */
|
||||
int clockmode; /* unused */
|
||||
int txdelay;
|
||||
unsigned char persist; /* unused */
|
||||
int slotime; /* unused */
|
||||
int squeldelay;
|
||||
int dmachan; /* unused */
|
||||
int irq; /* unused */
|
||||
};
|
||||
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
header-y += big_endian.h
|
||||
header-y += little_endian.h
|
||||
|
|
@ -1,108 +1,7 @@
|
|||
#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
|
||||
#define _LINUX_BYTEORDER_BIG_ENDIAN_H
|
||||
|
||||
#ifndef __BIG_ENDIAN
|
||||
#define __BIG_ENDIAN 4321
|
||||
#endif
|
||||
#ifndef __BIG_ENDIAN_BITFIELD
|
||||
#define __BIG_ENDIAN_BITFIELD
|
||||
#endif
|
||||
#include <uapi/linux/byteorder/big_endian.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)(__u32)(x))
|
||||
#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
|
||||
#define __constant_htons(x) ((__force __be16)(__u16)(x))
|
||||
#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
|
||||
#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
|
||||
#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
|
||||
#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
|
||||
#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
|
||||
#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
|
||||
#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
|
||||
#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
|
||||
#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
|
||||
#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
|
||||
#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
|
||||
#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
|
||||
#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
|
||||
#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
|
||||
#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
|
||||
#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
|
||||
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
|
||||
#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
|
||||
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
|
||||
#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
|
||||
#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
|
||||
#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
|
||||
#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
|
||||
#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
|
||||
#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
|
||||
|
||||
static inline __le64 __cpu_to_le64p(const __u64 *p)
|
||||
{
|
||||
return (__force __le64)__swab64p(p);
|
||||
}
|
||||
static inline __u64 __le64_to_cpup(const __le64 *p)
|
||||
{
|
||||
return __swab64p((__u64 *)p);
|
||||
}
|
||||
static inline __le32 __cpu_to_le32p(const __u32 *p)
|
||||
{
|
||||
return (__force __le32)__swab32p(p);
|
||||
}
|
||||
static inline __u32 __le32_to_cpup(const __le32 *p)
|
||||
{
|
||||
return __swab32p((__u32 *)p);
|
||||
}
|
||||
static inline __le16 __cpu_to_le16p(const __u16 *p)
|
||||
{
|
||||
return (__force __le16)__swab16p(p);
|
||||
}
|
||||
static inline __u16 __le16_to_cpup(const __le16 *p)
|
||||
{
|
||||
return __swab16p((__u16 *)p);
|
||||
}
|
||||
static inline __be64 __cpu_to_be64p(const __u64 *p)
|
||||
{
|
||||
return (__force __be64)*p;
|
||||
}
|
||||
static inline __u64 __be64_to_cpup(const __be64 *p)
|
||||
{
|
||||
return (__force __u64)*p;
|
||||
}
|
||||
static inline __be32 __cpu_to_be32p(const __u32 *p)
|
||||
{
|
||||
return (__force __be32)*p;
|
||||
}
|
||||
static inline __u32 __be32_to_cpup(const __be32 *p)
|
||||
{
|
||||
return (__force __u32)*p;
|
||||
}
|
||||
static inline __be16 __cpu_to_be16p(const __u16 *p)
|
||||
{
|
||||
return (__force __be16)*p;
|
||||
}
|
||||
static inline __u16 __be16_to_cpup(const __be16 *p)
|
||||
{
|
||||
return (__force __u16)*p;
|
||||
}
|
||||
#define __cpu_to_le64s(x) __swab64s((x))
|
||||
#define __le64_to_cpus(x) __swab64s((x))
|
||||
#define __cpu_to_le32s(x) __swab32s((x))
|
||||
#define __le32_to_cpus(x) __swab32s((x))
|
||||
#define __cpu_to_le16s(x) __swab16s((x))
|
||||
#define __le16_to_cpus(x) __swab16s((x))
|
||||
#define __cpu_to_be64s(x) do { (void)(x); } while (0)
|
||||
#define __be64_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be32s(x) do { (void)(x); } while (0)
|
||||
#define __be32_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be16s(x) do { (void)(x); } while (0)
|
||||
#define __be16_to_cpus(x) do { (void)(x); } while (0)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/byteorder/generic.h>
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
|
||||
|
|
|
|||
|
|
@ -1,108 +1,7 @@
|
|||
#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
|
||||
#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
|
||||
|
||||
#ifndef __LITTLE_ENDIAN
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
#ifndef __LITTLE_ENDIAN_BITFIELD
|
||||
#define __LITTLE_ENDIAN_BITFIELD
|
||||
#endif
|
||||
#include <uapi/linux/byteorder/little_endian.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/swab.h>
|
||||
|
||||
#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
|
||||
#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
|
||||
#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
|
||||
#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
|
||||
#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
|
||||
#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
|
||||
#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
|
||||
#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
|
||||
#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
|
||||
#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
|
||||
#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
|
||||
#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
|
||||
#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
|
||||
#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
|
||||
#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
|
||||
#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
|
||||
#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
|
||||
#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
|
||||
#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
|
||||
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
|
||||
#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
|
||||
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
|
||||
#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
|
||||
#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
|
||||
#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
|
||||
#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
|
||||
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
|
||||
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
|
||||
|
||||
static inline __le64 __cpu_to_le64p(const __u64 *p)
|
||||
{
|
||||
return (__force __le64)*p;
|
||||
}
|
||||
static inline __u64 __le64_to_cpup(const __le64 *p)
|
||||
{
|
||||
return (__force __u64)*p;
|
||||
}
|
||||
static inline __le32 __cpu_to_le32p(const __u32 *p)
|
||||
{
|
||||
return (__force __le32)*p;
|
||||
}
|
||||
static inline __u32 __le32_to_cpup(const __le32 *p)
|
||||
{
|
||||
return (__force __u32)*p;
|
||||
}
|
||||
static inline __le16 __cpu_to_le16p(const __u16 *p)
|
||||
{
|
||||
return (__force __le16)*p;
|
||||
}
|
||||
static inline __u16 __le16_to_cpup(const __le16 *p)
|
||||
{
|
||||
return (__force __u16)*p;
|
||||
}
|
||||
static inline __be64 __cpu_to_be64p(const __u64 *p)
|
||||
{
|
||||
return (__force __be64)__swab64p(p);
|
||||
}
|
||||
static inline __u64 __be64_to_cpup(const __be64 *p)
|
||||
{
|
||||
return __swab64p((__u64 *)p);
|
||||
}
|
||||
static inline __be32 __cpu_to_be32p(const __u32 *p)
|
||||
{
|
||||
return (__force __be32)__swab32p(p);
|
||||
}
|
||||
static inline __u32 __be32_to_cpup(const __be32 *p)
|
||||
{
|
||||
return __swab32p((__u32 *)p);
|
||||
}
|
||||
static inline __be16 __cpu_to_be16p(const __u16 *p)
|
||||
{
|
||||
return (__force __be16)__swab16p(p);
|
||||
}
|
||||
static inline __u16 __be16_to_cpup(const __be16 *p)
|
||||
{
|
||||
return __swab16p((__u16 *)p);
|
||||
}
|
||||
#define __cpu_to_le64s(x) do { (void)(x); } while (0)
|
||||
#define __le64_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_le32s(x) do { (void)(x); } while (0)
|
||||
#define __le32_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_le16s(x) do { (void)(x); } while (0)
|
||||
#define __le16_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be64s(x) __swab64s((x))
|
||||
#define __be64_to_cpus(x) __swab64s((x))
|
||||
#define __cpu_to_be32s(x) __swab32s((x))
|
||||
#define __be32_to_cpus(x) __swab32s((x))
|
||||
#define __cpu_to_be16s(x) __swab16s((x))
|
||||
#define __be16_to_cpus(x) __swab16s((x))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/byteorder/generic.h>
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
header-y += caif_socket.h
|
||||
header-y += if_caif.h
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
/* linux/caif_socket.h
|
||||
* CAIF Definitions for CAIF socket and network layer
|
||||
* Copyright (C) ST-Ericsson AB 2010
|
||||
* Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
|
||||
* License terms: GNU General Public License (GPL) version 2
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CAIF_SOCKET_H
|
||||
#define _LINUX_CAIF_SOCKET_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/socket.h>
|
||||
|
||||
/**
|
||||
* enum caif_link_selector - Physical Link Selection.
|
||||
* @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth
|
||||
* traffic.
|
||||
* @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency
|
||||
* traffic.
|
||||
*
|
||||
* CAIF Link Layers can register their link properties.
|
||||
* This enum is used for choosing between CAIF Link Layers when
|
||||
* setting up CAIF Channels when multiple CAIF Link Layers exists.
|
||||
*/
|
||||
enum caif_link_selector {
|
||||
CAIF_LINK_HIGH_BANDW,
|
||||
CAIF_LINK_LOW_LATENCY
|
||||
};
|
||||
|
||||
/**
|
||||
* enum caif_channel_priority - CAIF channel priorities.
|
||||
*
|
||||
* @CAIF_PRIO_MIN: Min priority for a channel.
|
||||
* @CAIF_PRIO_LOW: Low-priority channel.
|
||||
* @CAIF_PRIO_NORMAL: Normal/default priority level.
|
||||
* @CAIF_PRIO_HIGH: High priority level
|
||||
* @CAIF_PRIO_MAX: Max priority for channel
|
||||
*
|
||||
* Priority can be set on CAIF Channels in order to
|
||||
* prioritize between traffic on different CAIF Channels.
|
||||
* These priority levels are recommended, but the priority value
|
||||
* is not restricted to the values defined in this enum, any value
|
||||
* between CAIF_PRIO_MIN and CAIF_PRIO_MAX could be used.
|
||||
*/
|
||||
enum caif_channel_priority {
|
||||
CAIF_PRIO_MIN = 0x01,
|
||||
CAIF_PRIO_LOW = 0x04,
|
||||
CAIF_PRIO_NORMAL = 0x0f,
|
||||
CAIF_PRIO_HIGH = 0x14,
|
||||
CAIF_PRIO_MAX = 0x1F
|
||||
};
|
||||
|
||||
/**
|
||||
* enum caif_protocol_type - CAIF Channel type.
|
||||
* @CAIFPROTO_AT: Classic AT channel.
|
||||
* @CAIFPROTO_DATAGRAM: Datagram channel.
|
||||
* @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing.
|
||||
* @CAIFPROTO_UTIL: Utility (Psock) channel.
|
||||
* @CAIFPROTO_RFM: Remote File Manager
|
||||
* @CAIFPROTO_DEBUG: Debug link
|
||||
*
|
||||
* This enum defines the CAIF Channel type to be used. This defines
|
||||
* the service to connect to on the modem.
|
||||
*/
|
||||
enum caif_protocol_type {
|
||||
CAIFPROTO_AT,
|
||||
CAIFPROTO_DATAGRAM,
|
||||
CAIFPROTO_DATAGRAM_LOOP,
|
||||
CAIFPROTO_UTIL,
|
||||
CAIFPROTO_RFM,
|
||||
CAIFPROTO_DEBUG,
|
||||
_CAIFPROTO_MAX
|
||||
};
|
||||
#define CAIFPROTO_MAX _CAIFPROTO_MAX
|
||||
|
||||
/**
|
||||
* enum caif_at_type - AT Service Endpoint
|
||||
* @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel.
|
||||
*/
|
||||
enum caif_at_type {
|
||||
CAIF_ATTYPE_PLAIN = 2
|
||||
};
|
||||
/**
|
||||
* enum caif_debug_type - Content selection for debug connection
|
||||
* @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain
|
||||
* both trace and interactive debug.
|
||||
* @CAIF_DEBUG_TRACE: Connection contains trace only.
|
||||
* @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug.
|
||||
*/
|
||||
enum caif_debug_type {
|
||||
CAIF_DEBUG_TRACE_INTERACTIVE = 0,
|
||||
CAIF_DEBUG_TRACE,
|
||||
CAIF_DEBUG_INTERACTIVE,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum caif_debug_service - Debug Service Endpoint
|
||||
* @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system
|
||||
* @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system
|
||||
*/
|
||||
enum caif_debug_service {
|
||||
CAIF_RADIO_DEBUG_SERVICE = 1,
|
||||
CAIF_APP_DEBUG_SERVICE
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sockaddr_caif - the sockaddr structure for CAIF sockets.
|
||||
* @family: Address family number, must be AF_CAIF.
|
||||
* @u: Union of address data 'switched' by family.
|
||||
* :
|
||||
* @u.at: Applies when family = CAIFPROTO_AT.
|
||||
*
|
||||
* @u.at.type: Type of AT link to set up (enum caif_at_type).
|
||||
*
|
||||
* @u.util: Applies when family = CAIFPROTO_UTIL
|
||||
*
|
||||
* @u.util.service: Utility service name.
|
||||
*
|
||||
* @u.dgm: Applies when family = CAIFPROTO_DATAGRAM
|
||||
*
|
||||
* @u.dgm.connection_id: Datagram connection id.
|
||||
*
|
||||
* @u.dgm.nsapi: NSAPI of the PDP-Context.
|
||||
*
|
||||
* @u.rfm: Applies when family = CAIFPROTO_RFM
|
||||
*
|
||||
* @u.rfm.connection_id: Connection ID for RFM.
|
||||
*
|
||||
* @u.rfm.volume: Volume to mount.
|
||||
*
|
||||
* @u.dbg: Applies when family = CAIFPROTO_DEBUG.
|
||||
*
|
||||
* @u.dbg.type: Type of debug connection to set up
|
||||
* (caif_debug_type).
|
||||
*
|
||||
* @u.dbg.service: Service sub-system to connect (caif_debug_service
|
||||
* Description:
|
||||
* This structure holds the connect parameters used for setting up a
|
||||
* CAIF Channel. It defines the service to connect to on the modem.
|
||||
*/
|
||||
struct sockaddr_caif {
|
||||
__kernel_sa_family_t family;
|
||||
union {
|
||||
struct {
|
||||
__u8 type; /* type: enum caif_at_type */
|
||||
} at; /* CAIFPROTO_AT */
|
||||
struct {
|
||||
char service[16];
|
||||
} util; /* CAIFPROTO_UTIL */
|
||||
union {
|
||||
__u32 connection_id;
|
||||
__u8 nsapi;
|
||||
} dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/
|
||||
struct {
|
||||
__u32 connection_id;
|
||||
char volume[16];
|
||||
} rfm; /* CAIFPROTO_RFM */
|
||||
struct {
|
||||
__u8 type; /* type:enum caif_debug_type */
|
||||
__u8 service; /* service:caif_debug_service */
|
||||
} dbg; /* CAIFPROTO_DEBUG */
|
||||
} u;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum caif_socket_opts - CAIF option values for getsockopt and setsockopt.
|
||||
*
|
||||
* @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are
|
||||
* available. Either a high bandwidth
|
||||
* link can be selected (CAIF_LINK_HIGH_BANDW) or
|
||||
* or a low latency link (CAIF_LINK_LOW_LATENCY).
|
||||
* This option is of type __u32.
|
||||
* Alternatively SO_BINDTODEVICE can be used.
|
||||
*
|
||||
* @CAIFSO_REQ_PARAM: Used to set the request parameters for a
|
||||
* utility channel. (maximum 256 bytes). This
|
||||
* option must be set before connecting.
|
||||
*
|
||||
* @CAIFSO_RSP_PARAM: Gets the response parameters for a utility
|
||||
* channel. (maximum 256 bytes). This option
|
||||
* is valid after a successful connect.
|
||||
*
|
||||
*
|
||||
* This enum defines the CAIF Socket options to be used on a socket
|
||||
* of type PF_CAIF.
|
||||
*
|
||||
*/
|
||||
enum caif_socket_opts {
|
||||
CAIFSO_LINK_SELECT = 127,
|
||||
CAIFSO_REQ_PARAM = 128,
|
||||
CAIFSO_RSP_PARAM = 129,
|
||||
};
|
||||
|
||||
#endif /* _LINUX_CAIF_SOCKET_H */
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) ST-Ericsson AB 2010
|
||||
* Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
|
||||
* License terms: GNU General Public License (GPL) version 2
|
||||
*/
|
||||
|
||||
#ifndef IF_CAIF_H_
|
||||
#define IF_CAIF_H_
|
||||
#include <linux/sockios.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/socket.h>
|
||||
|
||||
/**
|
||||
* enum ifla_caif - CAIF NetlinkRT parameters.
|
||||
* @IFLA_CAIF_IPV4_CONNID: Connection ID for IPv4 PDP Context.
|
||||
* The type of attribute is NLA_U32.
|
||||
* @IFLA_CAIF_IPV6_CONNID: Connection ID for IPv6 PDP Context.
|
||||
* The type of attribute is NLA_U32.
|
||||
* @IFLA_CAIF_LOOPBACK: If different from zero, device is doing loopback
|
||||
* The type of attribute is NLA_U8.
|
||||
*
|
||||
* When using RT Netlink to create, destroy or configure a CAIF IP interface,
|
||||
* enum ifla_caif is used to specify the configuration attributes.
|
||||
*/
|
||||
enum ifla_caif {
|
||||
__IFLA_CAIF_UNSPEC,
|
||||
IFLA_CAIF_IPV4_CONNID,
|
||||
IFLA_CAIF_IPV6_CONNID,
|
||||
IFLA_CAIF_LOOPBACK,
|
||||
__IFLA_CAIF_MAX
|
||||
};
|
||||
#define IFLA_CAIF_MAX (__IFLA_CAIF_MAX-1)
|
||||
|
||||
#endif /*IF_CAIF_H_*/
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* linux/can.h
|
||||
*
|
||||
* Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
|
||||
*
|
||||
* Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Urs Thuermann <urs.thuermann@volkswagen.de>
|
||||
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_H
|
||||
#define CAN_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/socket.h>
|
||||
|
||||
/* controller area network (CAN) kernel definitions */
|
||||
|
||||
/* special address description flags for the CAN_ID */
|
||||
#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
|
||||
#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
|
||||
#define CAN_ERR_FLAG 0x20000000U /* error message frame */
|
||||
|
||||
/* valid bits in CAN ID for frame formats */
|
||||
#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
|
||||
#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
|
||||
#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
|
||||
|
||||
/*
|
||||
* Controller Area Network Identifier structure
|
||||
*
|
||||
* bit 0-28 : CAN identifier (11/29 bit)
|
||||
* bit 29 : error message frame flag (0 = data frame, 1 = error message)
|
||||
* bit 30 : remote transmission request flag (1 = rtr frame)
|
||||
* bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
|
||||
*/
|
||||
typedef __u32 canid_t;
|
||||
|
||||
#define CAN_SFF_ID_BITS 11
|
||||
#define CAN_EFF_ID_BITS 29
|
||||
|
||||
/*
|
||||
* Controller Area Network Error Message Frame Mask structure
|
||||
*
|
||||
* bit 0-28 : error class mask (see include/linux/can/error.h)
|
||||
* bit 29-31 : set to zero
|
||||
*/
|
||||
typedef __u32 can_err_mask_t;
|
||||
|
||||
/* CAN payload length and DLC definitions according to ISO 11898-1 */
|
||||
#define CAN_MAX_DLC 8
|
||||
#define CAN_MAX_DLEN 8
|
||||
|
||||
/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
|
||||
#define CANFD_MAX_DLC 15
|
||||
#define CANFD_MAX_DLEN 64
|
||||
|
||||
/**
|
||||
* struct can_frame - basic CAN frame structure
|
||||
* @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
|
||||
* @can_dlc: frame payload length in byte (0 .. 8) aka data length code
|
||||
* N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
|
||||
* mapping of the 'data length code' to the real payload length
|
||||
* @data: CAN frame payload (up to 8 byte)
|
||||
*/
|
||||
struct can_frame {
|
||||
canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
|
||||
__u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
|
||||
__u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
/*
|
||||
* defined bits for canfd_frame.flags
|
||||
*
|
||||
* The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
|
||||
* be set in the CAN frame bitstream on the wire. The EDL bit switch turns
|
||||
* the CAN controllers bitstream processor into the CAN FD mode which creates
|
||||
* two new options within the CAN FD frame specification:
|
||||
*
|
||||
* Bit Rate Switch - to indicate a second bitrate is/was used for the payload
|
||||
* Error State Indicator - represents the error state of the transmitting node
|
||||
*
|
||||
* As the CANFD_ESI bit is internally generated by the transmitting CAN
|
||||
* controller only the CANFD_BRS bit is relevant for real CAN controllers when
|
||||
* building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
|
||||
* sense for virtual CAN interfaces to test applications with echoed frames.
|
||||
*/
|
||||
#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
|
||||
#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
|
||||
|
||||
/**
|
||||
* struct canfd_frame - CAN flexible data rate frame structure
|
||||
* @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
|
||||
* @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
|
||||
* @flags: additional flags for CAN FD
|
||||
* @__res0: reserved / padding
|
||||
* @__res1: reserved / padding
|
||||
* @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
|
||||
*/
|
||||
struct canfd_frame {
|
||||
canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
|
||||
__u8 len; /* frame payload length in byte */
|
||||
__u8 flags; /* additional flags for CAN FD */
|
||||
__u8 __res0; /* reserved / padding */
|
||||
__u8 __res1; /* reserved / padding */
|
||||
__u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
#define CAN_MTU (sizeof(struct can_frame))
|
||||
#define CANFD_MTU (sizeof(struct canfd_frame))
|
||||
|
||||
/* particular protocols of the protocol family PF_CAN */
|
||||
#define CAN_RAW 1 /* RAW sockets */
|
||||
#define CAN_BCM 2 /* Broadcast Manager */
|
||||
#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
|
||||
#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
|
||||
#define CAN_MCNET 5 /* Bosch MCNet */
|
||||
#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
|
||||
#define CAN_NPROTO 7
|
||||
|
||||
#define SOL_CAN_BASE 100
|
||||
|
||||
/**
|
||||
* struct sockaddr_can - the sockaddr structure for CAN sockets
|
||||
* @can_family: address family number AF_CAN.
|
||||
* @can_ifindex: CAN network interface index.
|
||||
* @can_addr: protocol specific address information
|
||||
*/
|
||||
struct sockaddr_can {
|
||||
__kernel_sa_family_t can_family;
|
||||
int can_ifindex;
|
||||
union {
|
||||
/* transport protocol class address information (e.g. ISOTP) */
|
||||
struct { canid_t rx_id, tx_id; } tp;
|
||||
|
||||
/* reserved for future CAN protocols address information */
|
||||
} can_addr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct can_filter - CAN ID based filter in can_register().
|
||||
* @can_id: relevant bits of CAN ID which are not masked out.
|
||||
* @can_mask: CAN mask (see description)
|
||||
*
|
||||
* Description:
|
||||
* A filter matches, when
|
||||
*
|
||||
* <received_can_id> & mask == can_id & mask
|
||||
*
|
||||
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
|
||||
* filter for error message frames (CAN_ERR_FLAG bit set in mask).
|
||||
*/
|
||||
struct can_filter {
|
||||
canid_t can_id;
|
||||
canid_t can_mask;
|
||||
};
|
||||
|
||||
#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
|
||||
|
||||
#endif /* CAN_H */
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
header-y += raw.h
|
||||
header-y += bcm.h
|
||||
header-y += gw.h
|
||||
header-y += error.h
|
||||
header-y += netlink.h
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* linux/can/bcm.h
|
||||
*
|
||||
* Definitions for CAN Broadcast Manager (BCM)
|
||||
*
|
||||
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_BCM_H
|
||||
#define CAN_BCM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/can.h>
|
||||
|
||||
/**
|
||||
* struct bcm_msg_head - head of messages to/from the broadcast manager
|
||||
* @opcode: opcode, see enum below.
|
||||
* @flags: special flags, see below.
|
||||
* @count: number of frames to send before changing interval.
|
||||
* @ival1: interval for the first @count frames.
|
||||
* @ival2: interval for the following frames.
|
||||
* @can_id: CAN ID of frames to be sent or received.
|
||||
* @nframes: number of frames appended to the message head.
|
||||
* @frames: array of CAN frames.
|
||||
*/
|
||||
struct bcm_msg_head {
|
||||
__u32 opcode;
|
||||
__u32 flags;
|
||||
__u32 count;
|
||||
struct timeval ival1, ival2;
|
||||
canid_t can_id;
|
||||
__u32 nframes;
|
||||
struct can_frame frames[0];
|
||||
};
|
||||
|
||||
enum {
|
||||
TX_SETUP = 1, /* create (cyclic) transmission task */
|
||||
TX_DELETE, /* remove (cyclic) transmission task */
|
||||
TX_READ, /* read properties of (cyclic) transmission task */
|
||||
TX_SEND, /* send one CAN frame */
|
||||
RX_SETUP, /* create RX content filter subscription */
|
||||
RX_DELETE, /* remove RX content filter subscription */
|
||||
RX_READ, /* read properties of RX content filter subscription */
|
||||
TX_STATUS, /* reply to TX_READ request */
|
||||
TX_EXPIRED, /* notification on performed transmissions (count=0) */
|
||||
RX_STATUS, /* reply to RX_READ request */
|
||||
RX_TIMEOUT, /* cyclic message is absent */
|
||||
RX_CHANGED /* updated CAN frame (detected content change) */
|
||||
};
|
||||
|
||||
#define SETTIMER 0x0001
|
||||
#define STARTTIMER 0x0002
|
||||
#define TX_COUNTEVT 0x0004
|
||||
#define TX_ANNOUNCE 0x0008
|
||||
#define TX_CP_CAN_ID 0x0010
|
||||
#define RX_FILTER_ID 0x0020
|
||||
#define RX_CHECK_DLC 0x0040
|
||||
#define RX_NO_AUTOTIMER 0x0080
|
||||
#define RX_ANNOUNCE_RESUME 0x0100
|
||||
#define TX_RESET_MULTI_IDX 0x0200
|
||||
#define RX_RTR_FRAME 0x0400
|
||||
|
||||
#endif /* CAN_BCM_H */
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* linux/can/error.h
|
||||
*
|
||||
* Definitions of the CAN error messages to be filtered and passed to the user.
|
||||
*
|
||||
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_ERROR_H
|
||||
#define CAN_ERROR_H
|
||||
|
||||
#define CAN_ERR_DLC 8 /* dlc for error message frames */
|
||||
|
||||
/* error class (mask) in can_id */
|
||||
#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
|
||||
#define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */
|
||||
#define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */
|
||||
#define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */
|
||||
#define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */
|
||||
#define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */
|
||||
#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
|
||||
#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
|
||||
#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
|
||||
|
||||
/* arbitration lost in bit ... / data[0] */
|
||||
#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
|
||||
/* else bit number in bitstream */
|
||||
|
||||
/* error status of CAN-controller / data[1] */
|
||||
#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
|
||||
#define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */
|
||||
#define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */
|
||||
#define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */
|
||||
#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
|
||||
#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
|
||||
#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
|
||||
/* (at least one error counter exceeds */
|
||||
/* the protocol-defined level of 127) */
|
||||
|
||||
/* error in CAN protocol (type) / data[2] */
|
||||
#define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
|
||||
#define CAN_ERR_PROT_BIT 0x01 /* single bit error */
|
||||
#define CAN_ERR_PROT_FORM 0x02 /* frame format error */
|
||||
#define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */
|
||||
#define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */
|
||||
#define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */
|
||||
#define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */
|
||||
#define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */
|
||||
#define CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */
|
||||
|
||||
/* error in CAN protocol (location) / data[3] */
|
||||
#define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */
|
||||
#define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */
|
||||
#define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */
|
||||
#define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/
|
||||
#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
|
||||
#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
|
||||
#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
|
||||
#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
|
||||
#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
|
||||
#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
|
||||
#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
|
||||
#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
|
||||
#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
|
||||
#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
|
||||
#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
|
||||
#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
|
||||
#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
|
||||
#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
|
||||
#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
|
||||
#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
|
||||
|
||||
/* error status of CAN-transceiver / data[4] */
|
||||
/* CANH CANL */
|
||||
#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
|
||||
#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
|
||||
#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
|
||||
#define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */
|
||||
#define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */
|
||||
#define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */
|
||||
#define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */
|
||||
#define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */
|
||||
#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
|
||||
#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
|
||||
|
||||
/* controller specific additional information / data[5..7] */
|
||||
|
||||
#endif /* CAN_ERROR_H */
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* linux/can/gw.h
|
||||
*
|
||||
* Definitions for CAN frame Gateway/Router/Bridge
|
||||
*
|
||||
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Copyright (c) 2011 Volkswagen Group Electronic Research
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_GW_H
|
||||
#define CAN_GW_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/can.h>
|
||||
|
||||
struct rtcanmsg {
|
||||
__u8 can_family;
|
||||
__u8 gwtype;
|
||||
__u16 flags;
|
||||
};
|
||||
|
||||
/* CAN gateway types */
|
||||
enum {
|
||||
CGW_TYPE_UNSPEC,
|
||||
CGW_TYPE_CAN_CAN, /* CAN->CAN routing */
|
||||
__CGW_TYPE_MAX
|
||||
};
|
||||
|
||||
#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
|
||||
|
||||
/* CAN rtnetlink attribute definitions */
|
||||
enum {
|
||||
CGW_UNSPEC,
|
||||
CGW_MOD_AND, /* CAN frame modification binary AND */
|
||||
CGW_MOD_OR, /* CAN frame modification binary OR */
|
||||
CGW_MOD_XOR, /* CAN frame modification binary XOR */
|
||||
CGW_MOD_SET, /* CAN frame modification set alternate values */
|
||||
CGW_CS_XOR, /* set data[] XOR checksum into data[index] */
|
||||
CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */
|
||||
CGW_HANDLED, /* number of handled CAN frames */
|
||||
CGW_DROPPED, /* number of dropped CAN frames */
|
||||
CGW_SRC_IF, /* ifindex of source network interface */
|
||||
CGW_DST_IF, /* ifindex of destination network interface */
|
||||
CGW_FILTER, /* specify struct can_filter on source CAN device */
|
||||
__CGW_MAX
|
||||
};
|
||||
|
||||
#define CGW_MAX (__CGW_MAX - 1)
|
||||
|
||||
#define CGW_FLAGS_CAN_ECHO 0x01
|
||||
#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
|
||||
|
||||
#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
|
||||
|
||||
/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
|
||||
#define CGW_MOD_ID 0x01
|
||||
#define CGW_MOD_DLC 0x02
|
||||
#define CGW_MOD_DATA 0x04
|
||||
|
||||
#define CGW_FRAME_MODS 3 /* ID DLC DATA */
|
||||
|
||||
#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
|
||||
|
||||
struct cgw_frame_mod {
|
||||
struct can_frame cf;
|
||||
__u8 modtype;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
|
||||
|
||||
struct cgw_csum_xor {
|
||||
__s8 from_idx;
|
||||
__s8 to_idx;
|
||||
__s8 result_idx;
|
||||
__u8 init_xor_val;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct cgw_csum_crc8 {
|
||||
__s8 from_idx;
|
||||
__s8 to_idx;
|
||||
__s8 result_idx;
|
||||
__u8 init_crc_val;
|
||||
__u8 final_xor_val;
|
||||
__u8 crctab[256];
|
||||
__u8 profile;
|
||||
__u8 profile_data[20];
|
||||
} __attribute__((packed));
|
||||
|
||||
/* length of checksum operation parameters. idx = index in CAN frame data[] */
|
||||
#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
|
||||
#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
|
||||
|
||||
/* CRC8 profiles (compute CRC for additional data elements - see below) */
|
||||
enum {
|
||||
CGW_CRC8PRF_UNSPEC,
|
||||
CGW_CRC8PRF_1U8, /* compute one additional u8 value */
|
||||
CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */
|
||||
CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */
|
||||
__CGW_CRC8PRF_MAX
|
||||
};
|
||||
|
||||
#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
|
||||
|
||||
/*
|
||||
* CAN rtnetlink attribute contents in detail
|
||||
*
|
||||
* CGW_XXX_IF (length 4 bytes):
|
||||
* Sets an interface index for source/destination network interfaces.
|
||||
* For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory.
|
||||
*
|
||||
* CGW_FILTER (length 8 bytes):
|
||||
* Sets a CAN receive filter for the gateway job specified by the
|
||||
* struct can_filter described in include/linux/can.h
|
||||
*
|
||||
* CGW_MOD_XXX (length 17 bytes):
|
||||
* Specifies a modification that's done to a received CAN frame before it is
|
||||
* send out to the destination interface.
|
||||
*
|
||||
* <struct can_frame> data used as operator
|
||||
* <u8> affected CAN frame elements
|
||||
*
|
||||
* CGW_CS_XOR (length 4 bytes):
|
||||
* Set a simple XOR checksum starting with an initial value into
|
||||
* data[result-idx] using data[start-idx] .. data[end-idx]
|
||||
*
|
||||
* The XOR checksum is calculated like this:
|
||||
*
|
||||
* xor = init_xor_val
|
||||
*
|
||||
* for (i = from_idx .. to_idx)
|
||||
* xor ^= can_frame.data[i]
|
||||
*
|
||||
* can_frame.data[ result_idx ] = xor
|
||||
*
|
||||
* CGW_CS_CRC8 (length 282 bytes):
|
||||
* Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table,
|
||||
* a given initial value and a defined input data[start-idx] .. data[end-idx].
|
||||
* Finally the result value is XOR'ed with the final_xor_val.
|
||||
*
|
||||
* The CRC8 checksum is calculated like this:
|
||||
*
|
||||
* crc = init_crc_val
|
||||
*
|
||||
* for (i = from_idx .. to_idx)
|
||||
* crc = crctab[ crc ^ can_frame.data[i] ]
|
||||
*
|
||||
* can_frame.data[ result_idx ] = crc ^ final_xor_val
|
||||
*
|
||||
* The calculated CRC may contain additional source data elements that can be
|
||||
* defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs
|
||||
* like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf
|
||||
* E.g. the profile_data[] may contain additional u8 values (called DATA_IDs)
|
||||
* that are used depending on counter values inside the CAN frame data[].
|
||||
* So far only three profiles have been implemented for illustration.
|
||||
*
|
||||
* Remark: In general the attribute data is a linear buffer.
|
||||
* Beware of sending unpacked or aligned structs!
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* linux/can/netlink.h
|
||||
*
|
||||
* Definitions for the CAN netlink interface
|
||||
*
|
||||
* Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_NETLINK_H
|
||||
#define CAN_NETLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* CAN bit-timing parameters
|
||||
*
|
||||
* For further information, please read chapter "8 BIT TIMING
|
||||
* REQUIREMENTS" of the "Bosch CAN Specification version 2.0"
|
||||
* at http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
|
||||
*/
|
||||
struct can_bittiming {
|
||||
__u32 bitrate; /* Bit-rate in bits/second */
|
||||
__u32 sample_point; /* Sample point in one-tenth of a percent */
|
||||
__u32 tq; /* Time quanta (TQ) in nanoseconds */
|
||||
__u32 prop_seg; /* Propagation segment in TQs */
|
||||
__u32 phase_seg1; /* Phase buffer segment 1 in TQs */
|
||||
__u32 phase_seg2; /* Phase buffer segment 2 in TQs */
|
||||
__u32 sjw; /* Synchronisation jump width in TQs */
|
||||
__u32 brp; /* Bit-rate prescaler */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN harware-dependent bit-timing constant
|
||||
*
|
||||
* Used for calculating and checking bit-timing parameters
|
||||
*/
|
||||
struct can_bittiming_const {
|
||||
char name[16]; /* Name of the CAN controller hardware */
|
||||
__u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */
|
||||
__u32 tseg1_max;
|
||||
__u32 tseg2_min; /* Time segement 2 = phase_seg2 */
|
||||
__u32 tseg2_max;
|
||||
__u32 sjw_max; /* Synchronisation jump width */
|
||||
__u32 brp_min; /* Bit-rate prescaler */
|
||||
__u32 brp_max;
|
||||
__u32 brp_inc;
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN clock parameters
|
||||
*/
|
||||
struct can_clock {
|
||||
__u32 freq; /* CAN system clock frequency in Hz */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN operational and error states
|
||||
*/
|
||||
enum can_state {
|
||||
CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */
|
||||
CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */
|
||||
CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */
|
||||
CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */
|
||||
CAN_STATE_STOPPED, /* Device is stopped */
|
||||
CAN_STATE_SLEEPING, /* Device is sleeping */
|
||||
CAN_STATE_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN bus error counters
|
||||
*/
|
||||
struct can_berr_counter {
|
||||
__u16 txerr;
|
||||
__u16 rxerr;
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN controller mode
|
||||
*/
|
||||
struct can_ctrlmode {
|
||||
__u32 mask;
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
|
||||
#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
|
||||
#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
|
||||
#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
|
||||
#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
|
||||
|
||||
/*
|
||||
* CAN device statistics
|
||||
*/
|
||||
struct can_device_stats {
|
||||
__u32 bus_error; /* Bus errors */
|
||||
__u32 error_warning; /* Changes to error warning state */
|
||||
__u32 error_passive; /* Changes to error passive state */
|
||||
__u32 bus_off; /* Changes to bus off state */
|
||||
__u32 arbitration_lost; /* Arbitration lost errors */
|
||||
__u32 restarts; /* CAN controller re-starts */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN netlink interface
|
||||
*/
|
||||
enum {
|
||||
IFLA_CAN_UNSPEC,
|
||||
IFLA_CAN_BITTIMING,
|
||||
IFLA_CAN_BITTIMING_CONST,
|
||||
IFLA_CAN_CLOCK,
|
||||
IFLA_CAN_STATE,
|
||||
IFLA_CAN_CTRLMODE,
|
||||
IFLA_CAN_RESTART_MS,
|
||||
IFLA_CAN_RESTART,
|
||||
IFLA_CAN_BERR_COUNTER,
|
||||
__IFLA_CAN_MAX
|
||||
};
|
||||
|
||||
#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
|
||||
|
||||
#endif /* CAN_NETLINK_H */
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* linux/can/raw.h
|
||||
*
|
||||
* Definitions for raw CAN sockets
|
||||
*
|
||||
* Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Urs Thuermann <urs.thuermann@volkswagen.de>
|
||||
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_RAW_H
|
||||
#define CAN_RAW_H
|
||||
|
||||
#include <linux/can.h>
|
||||
|
||||
#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
|
||||
|
||||
/* for socket options affecting the socket (not the global system) */
|
||||
|
||||
enum {
|
||||
CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
|
||||
CAN_RAW_ERR_FILTER, /* set filter for error frames */
|
||||
CAN_RAW_LOOPBACK, /* local loopback (default:on) */
|
||||
CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
|
||||
CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
|
||||
};
|
||||
|
||||
#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,133 +0,0 @@
|
|||
/* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
|
||||
*
|
||||
* CAPI 2.0 Interface for Linux
|
||||
*
|
||||
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_CAPI_H__
|
||||
#define __LINUX_CAPI_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#ifndef __KERNEL__
|
||||
#include <linux/kernelcapi.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CAPI_REGISTER
|
||||
*/
|
||||
|
||||
typedef struct capi_register_params { /* CAPI_REGISTER */
|
||||
__u32 level3cnt; /* No. of simulatneous user data connections */
|
||||
__u32 datablkcnt; /* No. of buffered data messages */
|
||||
__u32 datablklen; /* Size of buffered data messages */
|
||||
} capi_register_params;
|
||||
|
||||
#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
|
||||
|
||||
/*
|
||||
* CAPI_GET_MANUFACTURER
|
||||
*/
|
||||
|
||||
#define CAPI_MANUFACTURER_LEN 64
|
||||
|
||||
#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */
|
||||
|
||||
/*
|
||||
* CAPI_GET_VERSION
|
||||
*/
|
||||
|
||||
typedef struct capi_version {
|
||||
__u32 majorversion;
|
||||
__u32 minorversion;
|
||||
__u32 majormanuversion;
|
||||
__u32 minormanuversion;
|
||||
} capi_version;
|
||||
|
||||
#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
|
||||
|
||||
/*
|
||||
* CAPI_GET_SERIAL
|
||||
*/
|
||||
|
||||
#define CAPI_SERIAL_LEN 8
|
||||
#define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */
|
||||
|
||||
/*
|
||||
* CAPI_GET_PROFILE
|
||||
*/
|
||||
|
||||
typedef struct capi_profile {
|
||||
__u16 ncontroller; /* number of installed controller */
|
||||
__u16 nbchannel; /* number of B-Channels */
|
||||
__u32 goptions; /* global options */
|
||||
__u32 support1; /* B1 protocols support */
|
||||
__u32 support2; /* B2 protocols support */
|
||||
__u32 support3; /* B3 protocols support */
|
||||
__u32 reserved[6]; /* reserved */
|
||||
__u32 manu[5]; /* manufacturer specific information */
|
||||
} capi_profile;
|
||||
|
||||
#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
|
||||
|
||||
typedef struct capi_manufacturer_cmd {
|
||||
unsigned long cmd;
|
||||
void __user *data;
|
||||
} capi_manufacturer_cmd;
|
||||
|
||||
/*
|
||||
* CAPI_MANUFACTURER_CMD
|
||||
*/
|
||||
|
||||
#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
|
||||
|
||||
/*
|
||||
* CAPI_GET_ERRCODE
|
||||
* capi errcode is set, * if read, write, or ioctl returns EIO,
|
||||
* ioctl returns errcode directly, and in arg, if != 0
|
||||
*/
|
||||
|
||||
#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
|
||||
|
||||
/*
|
||||
* CAPI_INSTALLED
|
||||
*/
|
||||
#define CAPI_INSTALLED _IOR('C',0x22, __u16)
|
||||
|
||||
|
||||
/*
|
||||
* member contr is input for
|
||||
* CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL
|
||||
* and CAPI_GET_PROFILE
|
||||
*/
|
||||
typedef union capi_ioctl_struct {
|
||||
__u32 contr;
|
||||
capi_register_params rparams;
|
||||
__u8 manufacturer[CAPI_MANUFACTURER_LEN];
|
||||
capi_version version;
|
||||
__u8 serial[CAPI_SERIAL_LEN];
|
||||
capi_profile profile;
|
||||
capi_manufacturer_cmd cmd;
|
||||
__u16 errcode;
|
||||
} capi_ioctl_struct;
|
||||
|
||||
/*
|
||||
* Middleware extension
|
||||
*/
|
||||
|
||||
#define CAPIFLAG_HIGHJACKING 0x0001
|
||||
|
||||
#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
|
||||
#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
|
||||
#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
|
||||
|
||||
#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
|
||||
|
||||
#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
|
||||
|
||||
#endif /* __LINUX_CAPI_H__ */
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
#ifndef CCISS_DEFS_H
|
||||
#define CCISS_DEFS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* general boundary definitions */
|
||||
#define SENSEINFOBYTES 32 /* note that this value may vary
|
||||
between host implementations */
|
||||
|
||||
/* Command Status value */
|
||||
#define CMD_SUCCESS 0x0000
|
||||
#define CMD_TARGET_STATUS 0x0001
|
||||
#define CMD_DATA_UNDERRUN 0x0002
|
||||
#define CMD_DATA_OVERRUN 0x0003
|
||||
#define CMD_INVALID 0x0004
|
||||
#define CMD_PROTOCOL_ERR 0x0005
|
||||
#define CMD_HARDWARE_ERR 0x0006
|
||||
#define CMD_CONNECTION_LOST 0x0007
|
||||
#define CMD_ABORTED 0x0008
|
||||
#define CMD_ABORT_FAILED 0x0009
|
||||
#define CMD_UNSOLICITED_ABORT 0x000A
|
||||
#define CMD_TIMEOUT 0x000B
|
||||
#define CMD_UNABORTABLE 0x000C
|
||||
|
||||
/* transfer direction */
|
||||
#define XFER_NONE 0x00
|
||||
#define XFER_WRITE 0x01
|
||||
#define XFER_READ 0x02
|
||||
#define XFER_RSVD 0x03
|
||||
|
||||
/* task attribute */
|
||||
#define ATTR_UNTAGGED 0x00
|
||||
#define ATTR_SIMPLE 0x04
|
||||
#define ATTR_HEADOFQUEUE 0x05
|
||||
#define ATTR_ORDERED 0x06
|
||||
#define ATTR_ACA 0x07
|
||||
|
||||
/* cdb type */
|
||||
#define TYPE_CMD 0x00
|
||||
#define TYPE_MSG 0x01
|
||||
|
||||
/* Type defs used in the following structs */
|
||||
#define BYTE __u8
|
||||
#define WORD __u16
|
||||
#define HWORD __u16
|
||||
#define DWORD __u32
|
||||
|
||||
#define CISS_MAX_LUN 1024
|
||||
|
||||
#define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
|
||||
#define LEVEL3LUN 0
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/* Command List Structure */
|
||||
typedef union _SCSI3Addr_struct {
|
||||
struct {
|
||||
BYTE Dev;
|
||||
BYTE Bus:6;
|
||||
BYTE Mode:2; /* b00 */
|
||||
} PeripDev;
|
||||
struct {
|
||||
BYTE DevLSB;
|
||||
BYTE DevMSB:6;
|
||||
BYTE Mode:2; /* b01 */
|
||||
} LogDev;
|
||||
struct {
|
||||
BYTE Dev:5;
|
||||
BYTE Bus:3;
|
||||
BYTE Targ:6;
|
||||
BYTE Mode:2; /* b10 */
|
||||
} LogUnit;
|
||||
} SCSI3Addr_struct;
|
||||
|
||||
typedef struct _PhysDevAddr_struct {
|
||||
DWORD TargetId:24;
|
||||
DWORD Bus:6;
|
||||
DWORD Mode:2;
|
||||
SCSI3Addr_struct Target[2]; /* 2 level target device addr */
|
||||
} PhysDevAddr_struct;
|
||||
|
||||
typedef struct _LogDevAddr_struct {
|
||||
DWORD VolId:30;
|
||||
DWORD Mode:2;
|
||||
BYTE reserved[4];
|
||||
} LogDevAddr_struct;
|
||||
|
||||
typedef union _LUNAddr_struct {
|
||||
BYTE LunAddrBytes[8];
|
||||
SCSI3Addr_struct SCSI3Lun[4];
|
||||
PhysDevAddr_struct PhysDev;
|
||||
LogDevAddr_struct LogDev;
|
||||
} LUNAddr_struct;
|
||||
|
||||
typedef struct _RequestBlock_struct {
|
||||
BYTE CDBLen;
|
||||
struct {
|
||||
BYTE Type:3;
|
||||
BYTE Attribute:3;
|
||||
BYTE Direction:2;
|
||||
} Type;
|
||||
HWORD Timeout;
|
||||
BYTE CDB[16];
|
||||
} RequestBlock_struct;
|
||||
|
||||
typedef union _MoreErrInfo_struct{
|
||||
struct {
|
||||
BYTE Reserved[3];
|
||||
BYTE Type;
|
||||
DWORD ErrorInfo;
|
||||
} Common_Info;
|
||||
struct{
|
||||
BYTE Reserved[2];
|
||||
BYTE offense_size; /* size of offending entry */
|
||||
BYTE offense_num; /* byte # of offense 0-base */
|
||||
DWORD offense_value;
|
||||
} Invalid_Cmd;
|
||||
} MoreErrInfo_struct;
|
||||
typedef struct _ErrorInfo_struct {
|
||||
BYTE ScsiStatus;
|
||||
BYTE SenseLen;
|
||||
HWORD CommandStatus;
|
||||
DWORD ResidualCnt;
|
||||
MoreErrInfo_struct MoreErrInfo;
|
||||
BYTE SenseInfo[SENSEINFOBYTES];
|
||||
} ErrorInfo_struct;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* CCISS_DEFS_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 */
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ struct ceph_mon_client {
|
|||
int cur_mon; /* last monitor i contacted */
|
||||
unsigned long sub_sent, sub_renew_after;
|
||||
struct ceph_connection con;
|
||||
bool have_fsid;
|
||||
|
||||
/* pending generic requests */
|
||||
struct rb_root generic_request_tree;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
|
|||
extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
|
||||
struct ceph_msg *msg);
|
||||
|
||||
extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc,
|
||||
extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc,
|
||||
struct ceph_file_layout *layout,
|
||||
u64 snapid,
|
||||
u64 off, u64 *plen, u64 *bno,
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ extern struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
|
|||
extern void ceph_osdmap_destroy(struct ceph_osdmap *map);
|
||||
|
||||
/* calculate mapping of a file extent to an object */
|
||||
extern void ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
|
||||
u64 off, u64 *plen,
|
||||
u64 *bno, u64 *oxoff, u64 *oxlen);
|
||||
extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
|
||||
u64 off, u64 *plen,
|
||||
u64 *bno, u64 *oxoff, u64 *oxlen);
|
||||
|
||||
/* calculate mapping of object to a placement group */
|
||||
extern int ceph_calc_object_layout(struct ceph_object_layout *ol,
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
/* cgroupstats.h - exporting per-cgroup statistics
|
||||
*
|
||||
* Copyright IBM Corporation, 2007
|
||||
* Author Balbir Singh <balbir@linux.vnet.ibm.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2.1 of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it would be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CGROUPSTATS_H
|
||||
#define _LINUX_CGROUPSTATS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/taskstats.h>
|
||||
|
||||
/*
|
||||
* Data shared between user space and kernel space on a per cgroup
|
||||
* basis. This data is shared using taskstats.
|
||||
*
|
||||
* Most of these states are derived by looking at the task->state value
|
||||
* For the nr_io_wait state, a flag in the delay accounting structure
|
||||
* indicates that the task is waiting on IO
|
||||
*
|
||||
* Each member is aligned to a 8 byte boundary.
|
||||
*/
|
||||
struct cgroupstats {
|
||||
__u64 nr_sleeping; /* Number of tasks sleeping */
|
||||
__u64 nr_running; /* Number of tasks running */
|
||||
__u64 nr_stopped; /* Number of tasks in stopped state */
|
||||
__u64 nr_uninterruptible; /* Number of tasks in uninterruptible */
|
||||
/* state */
|
||||
__u64 nr_io_wait; /* Number of tasks waiting on IO */
|
||||
};
|
||||
|
||||
/*
|
||||
* Commands sent from userspace
|
||||
* Not versioned. New commands should only be inserted at the enum's end
|
||||
* prior to __CGROUPSTATS_CMD_MAX
|
||||
*/
|
||||
|
||||
enum {
|
||||
CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */
|
||||
CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */
|
||||
CGROUPSTATS_CMD_NEW, /* kernel->user event */
|
||||
__CGROUPSTATS_CMD_MAX,
|
||||
};
|
||||
|
||||
#define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1)
|
||||
|
||||
enum {
|
||||
CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */
|
||||
CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */
|
||||
__CGROUPSTATS_TYPE_MAX,
|
||||
};
|
||||
|
||||
#define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1)
|
||||
|
||||
enum {
|
||||
CGROUPSTATS_CMD_ATTR_UNSPEC = 0,
|
||||
CGROUPSTATS_CMD_ATTR_FD,
|
||||
__CGROUPSTATS_CMD_ATTR_MAX,
|
||||
};
|
||||
|
||||
#define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1)
|
||||
|
||||
#endif /* _LINUX_CGROUPSTATS_H */
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
/*
|
||||
* ioctl interface for the scsi media changer driver
|
||||
*/
|
||||
|
||||
/* changer element types */
|
||||
#define CHET_MT 0 /* media transport element (robot) */
|
||||
#define CHET_ST 1 /* storage element (media slots) */
|
||||
#define CHET_IE 2 /* import/export element */
|
||||
#define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */
|
||||
#define CHET_V1 4 /* vendor specific #1 */
|
||||
#define CHET_V2 5 /* vendor specific #2 */
|
||||
#define CHET_V3 6 /* vendor specific #3 */
|
||||
#define CHET_V4 7 /* vendor specific #4 */
|
||||
|
||||
|
||||
/*
|
||||
* CHIOGPARAMS
|
||||
* query changer properties
|
||||
*
|
||||
* CHIOVGPARAMS
|
||||
* query vendor-specific element types
|
||||
*
|
||||
* accessing elements works by specifing type and unit of the element.
|
||||
* for example, storage elements are addressed with type = CHET_ST and
|
||||
* unit = 0 .. cp_nslots-1
|
||||
*
|
||||
*/
|
||||
struct changer_params {
|
||||
int cp_curpicker; /* current transport element */
|
||||
int cp_npickers; /* number of transport elements (CHET_MT) */
|
||||
int cp_nslots; /* number of storage elements (CHET_ST) */
|
||||
int cp_nportals; /* number of import/export elements (CHET_IE) */
|
||||
int cp_ndrives; /* number of data transfer elements (CHET_DT) */
|
||||
};
|
||||
struct changer_vendor_params {
|
||||
int cvp_n1; /* number of vendor specific elems (CHET_V1) */
|
||||
char cvp_label1[16];
|
||||
int cvp_n2; /* number of vendor specific elems (CHET_V2) */
|
||||
char cvp_label2[16];
|
||||
int cvp_n3; /* number of vendor specific elems (CHET_V3) */
|
||||
char cvp_label3[16];
|
||||
int cvp_n4; /* number of vendor specific elems (CHET_V4) */
|
||||
char cvp_label4[16];
|
||||
int reserved[8];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* CHIOMOVE
|
||||
* move a medium from one element to another
|
||||
*/
|
||||
struct changer_move {
|
||||
int cm_fromtype; /* type/unit of source element */
|
||||
int cm_fromunit;
|
||||
int cm_totype; /* type/unit of destination element */
|
||||
int cm_tounit;
|
||||
int cm_flags;
|
||||
};
|
||||
#define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */
|
||||
|
||||
|
||||
/*
|
||||
* CHIOEXCHANGE
|
||||
* move one medium from element #1 to element #2,
|
||||
* and another one from element #2 to element #3.
|
||||
* element #1 and #3 are allowed to be identical.
|
||||
*/
|
||||
struct changer_exchange {
|
||||
int ce_srctype; /* type/unit of element #1 */
|
||||
int ce_srcunit;
|
||||
int ce_fdsttype; /* type/unit of element #2 */
|
||||
int ce_fdstunit;
|
||||
int ce_sdsttype; /* type/unit of element #3 */
|
||||
int ce_sdstunit;
|
||||
int ce_flags;
|
||||
};
|
||||
#define CE_INVERT1 1
|
||||
#define CE_INVERT2 2
|
||||
|
||||
|
||||
/*
|
||||
* CHIOPOSITION
|
||||
* move the transport element (robot arm) to a specific element.
|
||||
*/
|
||||
struct changer_position {
|
||||
int cp_type;
|
||||
int cp_unit;
|
||||
int cp_flags;
|
||||
};
|
||||
#define CP_INVERT 1
|
||||
|
||||
|
||||
/*
|
||||
* CHIOGSTATUS
|
||||
* get element status for all elements of a specific type
|
||||
*/
|
||||
struct changer_element_status {
|
||||
int ces_type;
|
||||
unsigned char __user *ces_data;
|
||||
};
|
||||
#define CESTATUS_FULL 0x01 /* full */
|
||||
#define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */
|
||||
#define CESTATUS_EXCEPT 0x04 /* error condition */
|
||||
#define CESTATUS_ACCESS 0x08 /* access allowed */
|
||||
#define CESTATUS_EXENAB 0x10 /* element can export media */
|
||||
#define CESTATUS_INENAB 0x20 /* element can import media */
|
||||
|
||||
|
||||
/*
|
||||
* CHIOGELEM
|
||||
* get more detailed status information for a single element
|
||||
*/
|
||||
struct changer_get_element {
|
||||
int cge_type; /* type/unit */
|
||||
int cge_unit;
|
||||
int cge_status; /* status */
|
||||
int cge_errno; /* errno */
|
||||
int cge_srctype; /* source element of the last move/exchange */
|
||||
int cge_srcunit;
|
||||
int cge_id; /* scsi id (for data transfer elements) */
|
||||
int cge_lun; /* scsi lun (for data transfer elements) */
|
||||
char cge_pvoltag[36]; /* primary volume tag */
|
||||
char cge_avoltag[36]; /* alternate volume tag */
|
||||
int cge_flags;
|
||||
};
|
||||
/* flags */
|
||||
#define CGE_ERRNO 0x01 /* errno available */
|
||||
#define CGE_INVERT 0x02 /* media inverted */
|
||||
#define CGE_SRC 0x04 /* media src available */
|
||||
#define CGE_IDLUN 0x08 /* ID+LUN available */
|
||||
#define CGE_PVOLTAG 0x10 /* primary volume tag available */
|
||||
#define CGE_AVOLTAG 0x20 /* alternate volume tag available */
|
||||
|
||||
|
||||
/*
|
||||
* CHIOSVOLTAG
|
||||
* set volume tag
|
||||
*/
|
||||
struct changer_set_voltag {
|
||||
int csv_type; /* type/unit */
|
||||
int csv_unit;
|
||||
char csv_voltag[36]; /* volume tag */
|
||||
int csv_flags;
|
||||
};
|
||||
#define CSV_PVOLTAG 0x01 /* primary volume tag */
|
||||
#define CSV_AVOLTAG 0x02 /* alternate volume tag */
|
||||
#define CSV_CLEARTAG 0x04 /* clear volume tag */
|
||||
|
||||
/* ioctls */
|
||||
#define CHIOMOVE _IOW('c', 1,struct changer_move)
|
||||
#define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange)
|
||||
#define CHIOPOSITION _IOW('c', 3,struct changer_position)
|
||||
#define CHIOGPICKER _IOR('c', 4,int) /* not impl. */
|
||||
#define CHIOSPICKER _IOW('c', 5,int) /* not impl. */
|
||||
#define CHIOGPARAMS _IOR('c', 6,struct changer_params)
|
||||
#define CHIOGSTATUS _IOW('c', 8,struct changer_element_status)
|
||||
#define CHIOGELEM _IOW('c',16,struct changer_get_element)
|
||||
#define CHIOINITELEM _IO('c',17)
|
||||
#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
|
||||
#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* End:
|
||||
*/
|
||||
|
|
@ -319,22 +319,6 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
|
|||
__clocksource_updatefreq_scale(cs, 1000, khz);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
||||
extern void
|
||||
update_vsyscall(struct timespec *ts, struct timespec *wtm,
|
||||
struct clocksource *c, u32 mult);
|
||||
extern void update_vsyscall_tz(void);
|
||||
#else
|
||||
static inline void
|
||||
update_vsyscall(struct timespec *ts, struct timespec *wtm,
|
||||
struct clocksource *c, u32 mult)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void update_vsyscall_tz(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void timekeeping_notify(struct clocksource *clock);
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef __BIT_TYPES_DEFINED__
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef short int16_t;
|
||||
typedef unsigned short u_int16_t;
|
||||
typedef int int32_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Cfs constants
|
||||
*/
|
||||
#define CODA_MAXNAMLEN 255
|
||||
#define CODA_MAXPATHLEN 1024
|
||||
#define CODA_MAXSYMLINK 10
|
||||
|
||||
/* these are Coda's version of O_RDONLY etc combinations
|
||||
* to deal with VFS open modes
|
||||
*/
|
||||
#define C_O_READ 0x001
|
||||
#define C_O_WRITE 0x002
|
||||
#define C_O_TRUNC 0x010
|
||||
#define C_O_EXCL 0x100
|
||||
#define C_O_CREAT 0x200
|
||||
|
||||
/* these are to find mode bits in Venus */
|
||||
#define C_M_READ 00400
|
||||
#define C_M_WRITE 00200
|
||||
|
||||
/* for access Venus will use */
|
||||
#define C_A_C_OK 8 /* Test for writing upon create. */
|
||||
#define C_A_R_OK 4 /* Test for read permission. */
|
||||
#define C_A_W_OK 2 /* Test for write permission. */
|
||||
#define C_A_X_OK 1 /* Test for execute permission. */
|
||||
#define C_A_F_OK 0 /* Test for existence. */
|
||||
|
||||
|
||||
|
||||
#ifndef _VENUS_DIRENT_T_
|
||||
#define _VENUS_DIRENT_T_ 1
|
||||
struct venus_dirent {
|
||||
u_int32_t d_fileno; /* file number of entry */
|
||||
u_int16_t d_reclen; /* length of this record */
|
||||
u_int8_t d_type; /* file type, see below */
|
||||
u_int8_t d_namlen; /* length of string in d_name */
|
||||
char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
|
||||
};
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
|
||||
(((dp)->d_namlen+1 + 3) &~ 3))
|
||||
|
||||
/*
|
||||
* File types
|
||||
*/
|
||||
#define CDT_UNKNOWN 0
|
||||
#define CDT_FIFO 1
|
||||
#define CDT_CHR 2
|
||||
#define CDT_DIR 4
|
||||
#define CDT_BLK 6
|
||||
#define CDT_REG 8
|
||||
#define CDT_LNK 10
|
||||
#define CDT_SOCK 12
|
||||
#define CDT_WHT 14
|
||||
|
||||
/*
|
||||
* Convert between stat structure types and directory types.
|
||||
*/
|
||||
#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
|
||||
#define CDTTOIF(dirtype) ((dirtype) << 12)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _VUID_T_
|
||||
#define _VUID_T_
|
||||
typedef u_int32_t vuid_t;
|
||||
typedef u_int32_t vgid_t;
|
||||
#endif /*_VUID_T_ */
|
||||
|
||||
struct CodaFid {
|
||||
u_int32_t opaque[4];
|
||||
};
|
||||
|
||||
#define coda_f2i(fid)\
|
||||
(fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
|
||||
|
||||
#ifndef _VENUS_VATTR_T_
|
||||
#define _VENUS_VATTR_T_
|
||||
/*
|
||||
* Vnode types. VNON means no type.
|
||||
*/
|
||||
enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
|
||||
|
||||
struct coda_vattr {
|
||||
long va_type; /* vnode type (for create) */
|
||||
u_short va_mode; /* files access mode and type */
|
||||
short va_nlink; /* number of references to file */
|
||||
vuid_t va_uid; /* owner user id */
|
||||
vgid_t va_gid; /* owner group id */
|
||||
long va_fileid; /* file id */
|
||||
u_quad_t va_size; /* file size in bytes */
|
||||
long va_blocksize; /* blocksize preferred for i/o */
|
||||
struct timespec va_atime; /* time of last access */
|
||||
struct timespec va_mtime; /* time of last modification */
|
||||
struct timespec va_ctime; /* time file changed */
|
||||
u_long va_gen; /* generation number of file */
|
||||
u_long va_flags; /* flags defined for file */
|
||||
cdev_t va_rdev; /* device special file represents */
|
||||
u_quad_t va_bytes; /* bytes of disk space held by file */
|
||||
u_quad_t va_filerev; /* file modification number */
|
||||
};
|
||||
|
||||
#include <uapi/linux/coda.h>
|
||||
#endif
|
||||
|
||||
/* structure used by CODA_STATFS for getting cache information from venus */
|
||||
struct coda_statfs {
|
||||
int32_t f_blocks;
|
||||
int32_t f_bfree;
|
||||
int32_t f_bavail;
|
||||
int32_t f_files;
|
||||
int32_t f_ffree;
|
||||
};
|
||||
|
||||
/*
|
||||
* Kernel <--> Venus communications.
|
||||
*/
|
||||
|
||||
#define CODA_ROOT 2
|
||||
#define CODA_OPEN_BY_FD 3
|
||||
#define CODA_OPEN 4
|
||||
#define CODA_CLOSE 5
|
||||
#define CODA_IOCTL 6
|
||||
#define CODA_GETATTR 7
|
||||
#define CODA_SETATTR 8
|
||||
#define CODA_ACCESS 9
|
||||
#define CODA_LOOKUP 10
|
||||
#define CODA_CREATE 11
|
||||
#define CODA_REMOVE 12
|
||||
#define CODA_LINK 13
|
||||
#define CODA_RENAME 14
|
||||
#define CODA_MKDIR 15
|
||||
#define CODA_RMDIR 16
|
||||
#define CODA_SYMLINK 18
|
||||
#define CODA_READLINK 19
|
||||
#define CODA_FSYNC 20
|
||||
#define CODA_VGET 22
|
||||
#define CODA_SIGNAL 23
|
||||
#define CODA_REPLACE 24 /* DOWNCALL */
|
||||
#define CODA_FLUSH 25 /* DOWNCALL */
|
||||
#define CODA_PURGEUSER 26 /* DOWNCALL */
|
||||
#define CODA_ZAPFILE 27 /* DOWNCALL */
|
||||
#define CODA_ZAPDIR 28 /* DOWNCALL */
|
||||
#define CODA_PURGEFID 30 /* DOWNCALL */
|
||||
#define CODA_OPEN_BY_PATH 31
|
||||
#define CODA_RESOLVE 32
|
||||
#define CODA_REINTEGRATE 33
|
||||
#define CODA_STATFS 34
|
||||
#define CODA_STORE 35
|
||||
#define CODA_RELEASE 36
|
||||
#define CODA_NCALLS 37
|
||||
|
||||
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
|
||||
|
||||
#define VC_MAXDATASIZE 8192
|
||||
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
|
||||
VC_MAXDATASIZE
|
||||
|
||||
#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
|
||||
|
||||
#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
|
||||
|
||||
/*
|
||||
* Venus <-> Coda RPC arguments
|
||||
*/
|
||||
struct coda_in_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique; /* Keep multiple outstanding msgs distinct */
|
||||
pid_t pid;
|
||||
pid_t pgid;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
/* Really important that opcode and unique are 1st two fields! */
|
||||
struct coda_out_hdr {
|
||||
u_int32_t opcode;
|
||||
u_int32_t unique;
|
||||
u_int32_t result;
|
||||
};
|
||||
|
||||
/* coda_root: NO_IN */
|
||||
struct coda_root_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_root_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
/* coda_open: */
|
||||
struct coda_open_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_out {
|
||||
struct coda_out_hdr oh;
|
||||
cdev_t dev;
|
||||
ino_t inode;
|
||||
};
|
||||
|
||||
|
||||
/* coda_store: */
|
||||
struct coda_store_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_store_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_release: */
|
||||
struct coda_release_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_release_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_close: */
|
||||
struct coda_close_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_close_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_ioctl: */
|
||||
struct coda_ioctl_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int cmd;
|
||||
int len;
|
||||
int rwflag;
|
||||
char *data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_ioctl_out {
|
||||
struct coda_out_hdr oh;
|
||||
int len;
|
||||
caddr_t data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
|
||||
/* coda_getattr: */
|
||||
struct coda_getattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_getattr_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_setattr: NO_OUT */
|
||||
struct coda_setattr_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
struct coda_setattr_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_access: NO_OUT */
|
||||
struct coda_access_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_access_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
|
||||
/* lookup flags */
|
||||
#define CLU_CASE_SENSITIVE 0x01
|
||||
#define CLU_CASE_INSENSITIVE 0x02
|
||||
|
||||
/* coda_lookup: */
|
||||
struct coda_lookup_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_lookup_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
|
||||
/* coda_create: */
|
||||
struct coda_create_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int excl;
|
||||
int mode;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_create_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_remove: NO_OUT */
|
||||
struct coda_remove_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_remove_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_link: NO_OUT */
|
||||
struct coda_link_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid; /* cnode to link *to* */
|
||||
struct CodaFid destFid; /* Directory in which to place link */
|
||||
int tname; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_link_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
|
||||
/* coda_rename: NO_OUT */
|
||||
struct coda_rename_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid sourceFid;
|
||||
int srcname;
|
||||
struct CodaFid destFid;
|
||||
int destname;
|
||||
};
|
||||
|
||||
struct coda_rename_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_mkdir: */
|
||||
struct coda_mkdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_mkdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
struct coda_vattr attr;
|
||||
};
|
||||
|
||||
|
||||
/* coda_rmdir: NO_OUT */
|
||||
struct coda_rmdir_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int name; /* Place holder for data. */
|
||||
};
|
||||
|
||||
struct coda_rmdir_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_symlink: NO_OUT */
|
||||
struct coda_symlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid; /* Directory to put symlink in */
|
||||
int srcname;
|
||||
struct coda_vattr attr;
|
||||
int tname;
|
||||
};
|
||||
|
||||
struct coda_symlink_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_readlink: */
|
||||
struct coda_readlink_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_readlink_out {
|
||||
struct coda_out_hdr oh;
|
||||
int count;
|
||||
caddr_t data; /* Place holder for data. */
|
||||
};
|
||||
|
||||
|
||||
/* coda_fsync: NO_OUT */
|
||||
struct coda_fsync_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_fsync_out {
|
||||
struct coda_out_hdr out;
|
||||
};
|
||||
|
||||
/* coda_vget: */
|
||||
struct coda_vget_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
};
|
||||
|
||||
struct coda_vget_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid VFid;
|
||||
int vtype;
|
||||
};
|
||||
|
||||
|
||||
/* CODA_SIGNAL is out-of-band, doesn't need data. */
|
||||
/* CODA_INVALIDATE is a venus->kernel call */
|
||||
/* CODA_FLUSH is a venus->kernel call */
|
||||
|
||||
/* coda_purgeuser: */
|
||||
/* CODA_PURGEUSER is a venus->kernel call */
|
||||
struct coda_purgeuser_out {
|
||||
struct coda_out_hdr oh;
|
||||
vuid_t uid;
|
||||
};
|
||||
|
||||
/* coda_zapfile: */
|
||||
/* CODA_ZAPFILE is a venus->kernel call */
|
||||
struct coda_zapfile_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_zapdir: */
|
||||
/* CODA_ZAPDIR is a venus->kernel call */
|
||||
struct coda_zapdir_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_purgefid: */
|
||||
/* CODA_PURGEFID is a venus->kernel call */
|
||||
struct coda_purgefid_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid CodaFid;
|
||||
};
|
||||
|
||||
/* coda_replace: */
|
||||
/* CODA_REPLACE is a venus->kernel call */
|
||||
struct coda_replace_out { /* coda_replace is a venus->kernel call */
|
||||
struct coda_out_hdr oh;
|
||||
struct CodaFid NewFid;
|
||||
struct CodaFid OldFid;
|
||||
};
|
||||
|
||||
/* coda_open_by_fd: */
|
||||
struct coda_open_by_fd_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_fd_out {
|
||||
struct coda_out_hdr oh;
|
||||
int fd;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct file *fh; /* not passed from userspace but used in-kernel only */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* coda_open_by_path: */
|
||||
struct coda_open_by_path_in {
|
||||
struct coda_in_hdr ih;
|
||||
struct CodaFid VFid;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct coda_open_by_path_out {
|
||||
struct coda_out_hdr oh;
|
||||
int path;
|
||||
};
|
||||
|
||||
/* coda_statfs: NO_IN */
|
||||
struct coda_statfs_in {
|
||||
struct coda_in_hdr in;
|
||||
};
|
||||
|
||||
struct coda_statfs_out {
|
||||
struct coda_out_hdr oh;
|
||||
struct coda_statfs stat;
|
||||
};
|
||||
|
||||
/*
|
||||
* Occasionally, we don't cache the fid returned by CODA_LOOKUP.
|
||||
* For instance, if the fid is inconsistent.
|
||||
* This case is handled by setting the top bit of the type result parameter.
|
||||
*/
|
||||
#define CODA_NOCACHE 0x80000000
|
||||
|
||||
union inputArgs {
|
||||
struct coda_in_hdr ih; /* NB: every struct below begins with an ih */
|
||||
struct coda_open_in coda_open;
|
||||
struct coda_store_in coda_store;
|
||||
struct coda_release_in coda_release;
|
||||
struct coda_close_in coda_close;
|
||||
struct coda_ioctl_in coda_ioctl;
|
||||
struct coda_getattr_in coda_getattr;
|
||||
struct coda_setattr_in coda_setattr;
|
||||
struct coda_access_in coda_access;
|
||||
struct coda_lookup_in coda_lookup;
|
||||
struct coda_create_in coda_create;
|
||||
struct coda_remove_in coda_remove;
|
||||
struct coda_link_in coda_link;
|
||||
struct coda_rename_in coda_rename;
|
||||
struct coda_mkdir_in coda_mkdir;
|
||||
struct coda_rmdir_in coda_rmdir;
|
||||
struct coda_symlink_in coda_symlink;
|
||||
struct coda_readlink_in coda_readlink;
|
||||
struct coda_fsync_in coda_fsync;
|
||||
struct coda_vget_in coda_vget;
|
||||
struct coda_open_by_fd_in coda_open_by_fd;
|
||||
struct coda_open_by_path_in coda_open_by_path;
|
||||
struct coda_statfs_in coda_statfs;
|
||||
};
|
||||
|
||||
union outputArgs {
|
||||
struct coda_out_hdr oh; /* NB: every struct below begins with an oh */
|
||||
struct coda_root_out coda_root;
|
||||
struct coda_open_out coda_open;
|
||||
struct coda_ioctl_out coda_ioctl;
|
||||
struct coda_getattr_out coda_getattr;
|
||||
struct coda_lookup_out coda_lookup;
|
||||
struct coda_create_out coda_create;
|
||||
struct coda_mkdir_out coda_mkdir;
|
||||
struct coda_readlink_out coda_readlink;
|
||||
struct coda_vget_out coda_vget;
|
||||
struct coda_purgeuser_out coda_purgeuser;
|
||||
struct coda_zapfile_out coda_zapfile;
|
||||
struct coda_zapdir_out coda_zapdir;
|
||||
struct coda_purgefid_out coda_purgefid;
|
||||
struct coda_replace_out coda_replace;
|
||||
struct coda_open_by_fd_out coda_open_by_fd;
|
||||
struct coda_open_by_path_out coda_open_by_path;
|
||||
struct coda_statfs_out coda_statfs;
|
||||
};
|
||||
|
||||
union coda_downcalls {
|
||||
/* CODA_INVALIDATE is a venus->kernel call */
|
||||
/* CODA_FLUSH is a venus->kernel call */
|
||||
struct coda_purgeuser_out purgeuser;
|
||||
struct coda_zapfile_out zapfile;
|
||||
struct coda_zapdir_out zapdir;
|
||||
struct coda_purgefid_out purgefid;
|
||||
struct coda_replace_out replace;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Used for identifying usage of "Control" and pioctls
|
||||
*/
|
||||
|
||||
#define PIOCPARM_MASK 0x0000ffff
|
||||
struct ViceIoctl {
|
||||
void __user *in; /* Data to be transferred in */
|
||||
void __user *out; /* Data to be transferred out */
|
||||
u_short in_size; /* Size of input buffer <= 2K */
|
||||
u_short out_size; /* Maximum size of output buffer, <= 2K */
|
||||
};
|
||||
|
||||
struct PioctlData {
|
||||
const char __user *path;
|
||||
int follow;
|
||||
struct ViceIoctl vi;
|
||||
};
|
||||
|
||||
#define CODA_CONTROL ".CONTROL"
|
||||
#define CODA_CONTROLLEN 8
|
||||
#define CTL_INO -1
|
||||
|
||||
/* Data passed to mount */
|
||||
|
||||
#define CODA_MOUNT_VERSION 1
|
||||
|
||||
struct coda_mount_data {
|
||||
int version;
|
||||
int fd; /* Opened device */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,351 +0,0 @@
|
|||
/* This file is derived from the GAS 2.1.4 assembler control file.
|
||||
The GAS product is under the GNU General Public License, version 2 or later.
|
||||
As such, this file is also under that license.
|
||||
|
||||
If the file format changes in the COFF object, this file should be
|
||||
subsequently updated to reflect the changes.
|
||||
|
||||
The actual loader module only uses a few of these structures. The full
|
||||
set is documented here because I received the full set. If you wish
|
||||
more information about COFF, then O'Reilly has a very excellent book.
|
||||
*/
|
||||
|
||||
#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
|
||||
#define E_FILNMLEN 14 /* Number of characters in a file name */
|
||||
#define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */
|
||||
|
||||
/*
|
||||
* These defines are byte order independent. There is no alignment of fields
|
||||
* permitted in the structures. Therefore they are declared as characters
|
||||
* and the values loaded from the character positions. It also makes it
|
||||
* nice to have it "endian" independent.
|
||||
*/
|
||||
|
||||
/* Load a short int from the following tables with little-endian formats */
|
||||
#define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
|
||||
((unsigned short)((unsigned char)ps[0]))))
|
||||
|
||||
/* Load a long int from the following tables with little-endian formats */
|
||||
#define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
|
||||
((unsigned long)((unsigned char)ps[2])<<16) |\
|
||||
((unsigned long)((unsigned char)ps[1])<<8) |\
|
||||
((unsigned long)((unsigned char)ps[0])))))
|
||||
|
||||
/* Load a short int from the following tables with big-endian formats */
|
||||
#define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
|
||||
((unsigned short)((unsigned char)ps[1]))))
|
||||
|
||||
/* Load a long int from the following tables with big-endian formats */
|
||||
#define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
|
||||
((unsigned long)((unsigned char)ps[1])<<16) |\
|
||||
((unsigned long)((unsigned char)ps[2])<<8) |\
|
||||
((unsigned long)((unsigned char)ps[3])))))
|
||||
|
||||
/* These may be overridden later by brain dead implementations which generate
|
||||
a big-endian header with little-endian data. In that case, generate a
|
||||
replacement macro which tests a flag and uses either of the two above
|
||||
as appropriate. */
|
||||
|
||||
#define COFF_LONG(v) COFF_LONG_L(v)
|
||||
#define COFF_SHORT(v) COFF_SHORT_L(v)
|
||||
|
||||
/*** coff information for Intel 386/486. */
|
||||
|
||||
/********************** FILE HEADER **********************/
|
||||
|
||||
struct COFF_filehdr {
|
||||
char f_magic[2]; /* magic number */
|
||||
char f_nscns[2]; /* number of sections */
|
||||
char f_timdat[4]; /* time & date stamp */
|
||||
char f_symptr[4]; /* file pointer to symtab */
|
||||
char f_nsyms[4]; /* number of symtab entries */
|
||||
char f_opthdr[2]; /* sizeof(optional hdr) */
|
||||
char f_flags[2]; /* flags */
|
||||
};
|
||||
|
||||
/*
|
||||
* Bits for f_flags:
|
||||
*
|
||||
* F_RELFLG relocation info stripped from file
|
||||
* F_EXEC file is executable (i.e. no unresolved external
|
||||
* references)
|
||||
* F_LNNO line numbers stripped from file
|
||||
* F_LSYMS local symbols stripped from file
|
||||
* F_MINMAL this is a minimal object file (".m") output of fextract
|
||||
* F_UPDATE this is a fully bound update file, output of ogen
|
||||
* F_SWABD this file has had its bytes swabbed (in names)
|
||||
* F_AR16WR this file has the byte ordering of an AR16WR
|
||||
* (e.g. 11/70) machine
|
||||
* F_AR32WR this file has the byte ordering of an AR32WR machine
|
||||
* (e.g. vax and iNTEL 386)
|
||||
* F_AR32W this file has the byte ordering of an AR32W machine
|
||||
* (e.g. 3b,maxi)
|
||||
* F_PATCH file contains "patch" list in optional header
|
||||
* F_NODF (minimal file only) no decision functions for
|
||||
* replaced functions
|
||||
*/
|
||||
|
||||
#define COFF_F_RELFLG 0000001
|
||||
#define COFF_F_EXEC 0000002
|
||||
#define COFF_F_LNNO 0000004
|
||||
#define COFF_F_LSYMS 0000010
|
||||
#define COFF_F_MINMAL 0000020
|
||||
#define COFF_F_UPDATE 0000040
|
||||
#define COFF_F_SWABD 0000100
|
||||
#define COFF_F_AR16WR 0000200
|
||||
#define COFF_F_AR32WR 0000400
|
||||
#define COFF_F_AR32W 0001000
|
||||
#define COFF_F_PATCH 0002000
|
||||
#define COFF_F_NODF 0002000
|
||||
|
||||
#define COFF_I386MAGIC 0x14c /* Linux's system */
|
||||
|
||||
#if 0 /* Perhaps, someday, these formats may be used. */
|
||||
#define COFF_I386PTXMAGIC 0x154
|
||||
#define COFF_I386AIXMAGIC 0x175 /* IBM's AIX system */
|
||||
#define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
|
||||
&& COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
|
||||
&& COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
|
||||
#else
|
||||
#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
|
||||
#endif
|
||||
|
||||
#define COFF_FILHDR struct COFF_filehdr
|
||||
#define COFF_FILHSZ sizeof(COFF_FILHDR)
|
||||
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
/* Linux COFF must have this "optional" header. Standard COFF has no entry
|
||||
location for the "entry" point. They normally would start with the first
|
||||
location of the .text section. This is not a good idea for linux. So,
|
||||
the use of this "optional" header is not optional. It is required.
|
||||
|
||||
Do not be tempted to assume that the size of the optional header is
|
||||
a constant and simply index the next byte by the size of this structure.
|
||||
Use the 'f_opthdr' field in the main coff header for the size of the
|
||||
structure actually written to the file!!
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char magic[2]; /* type of file */
|
||||
char vstamp[2]; /* version stamp */
|
||||
char tsize[4]; /* text size in bytes, padded to FW bdry */
|
||||
char dsize[4]; /* initialized data " " */
|
||||
char bsize[4]; /* uninitialized data " " */
|
||||
char entry[4]; /* entry pt. */
|
||||
char text_start[4]; /* base of text used for this file */
|
||||
char data_start[4]; /* base of data used for this file */
|
||||
}
|
||||
COFF_AOUTHDR;
|
||||
|
||||
#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
|
||||
|
||||
#define COFF_STMAGIC 0401
|
||||
#define COFF_OMAGIC 0404
|
||||
#define COFF_JMAGIC 0407 /* dirty text and data image, can't share */
|
||||
#define COFF_DMAGIC 0410 /* dirty text segment, data aligned */
|
||||
#define COFF_ZMAGIC 0413 /* The proper magic number for executables */
|
||||
#define COFF_SHMAGIC 0443 /* shared library header */
|
||||
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
||||
struct COFF_scnhdr {
|
||||
char s_name[8]; /* section name */
|
||||
char s_paddr[4]; /* physical address, aliased s_nlib */
|
||||
char s_vaddr[4]; /* virtual address */
|
||||
char s_size[4]; /* section size */
|
||||
char s_scnptr[4]; /* file ptr to raw data for section */
|
||||
char s_relptr[4]; /* file ptr to relocation */
|
||||
char s_lnnoptr[4]; /* file ptr to line numbers */
|
||||
char s_nreloc[2]; /* number of relocation entries */
|
||||
char s_nlnno[2]; /* number of line number entries */
|
||||
char s_flags[4]; /* flags */
|
||||
};
|
||||
|
||||
#define COFF_SCNHDR struct COFF_scnhdr
|
||||
#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
|
||||
|
||||
/*
|
||||
* names of "special" sections
|
||||
*/
|
||||
|
||||
#define COFF_TEXT ".text"
|
||||
#define COFF_DATA ".data"
|
||||
#define COFF_BSS ".bss"
|
||||
#define COFF_COMMENT ".comment"
|
||||
#define COFF_LIB ".lib"
|
||||
|
||||
#define COFF_SECT_TEXT 0 /* Section for instruction code */
|
||||
#define COFF_SECT_DATA 1 /* Section for initialized globals */
|
||||
#define COFF_SECT_BSS 2 /* Section for un-initialized globals */
|
||||
#define COFF_SECT_REQD 3 /* Minimum number of sections for good file */
|
||||
|
||||
#define COFF_STYP_REG 0x00 /* regular segment */
|
||||
#define COFF_STYP_DSECT 0x01 /* dummy segment */
|
||||
#define COFF_STYP_NOLOAD 0x02 /* no-load segment */
|
||||
#define COFF_STYP_GROUP 0x04 /* group segment */
|
||||
#define COFF_STYP_PAD 0x08 /* .pad segment */
|
||||
#define COFF_STYP_COPY 0x10 /* copy section */
|
||||
#define COFF_STYP_TEXT 0x20 /* .text segment */
|
||||
#define COFF_STYP_DATA 0x40 /* .data segment */
|
||||
#define COFF_STYP_BSS 0x80 /* .bss segment */
|
||||
#define COFF_STYP_INFO 0x200 /* .comment section */
|
||||
#define COFF_STYP_OVER 0x400 /* overlay section */
|
||||
#define COFF_STYP_LIB 0x800 /* library section */
|
||||
|
||||
/*
|
||||
* Shared libraries have the following section header in the data field for
|
||||
* each library.
|
||||
*/
|
||||
|
||||
struct COFF_slib {
|
||||
char sl_entsz[4]; /* Size of this entry */
|
||||
char sl_pathndx[4]; /* size of the header field */
|
||||
};
|
||||
|
||||
#define COFF_SLIBHD struct COFF_slib
|
||||
#define COFF_SLIBSZ sizeof(COFF_SLIBHD)
|
||||
|
||||
/********************** LINE NUMBERS **********************/
|
||||
|
||||
/* 1 line number entry for every "breakpointable" source line in a section.
|
||||
* Line numbers are grouped on a per function basis; first entry in a function
|
||||
* grouping will have l_lnno = 0 and in place of physical address will be the
|
||||
* symbol table index of the function name.
|
||||
*/
|
||||
|
||||
struct COFF_lineno {
|
||||
union {
|
||||
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
|
||||
char l_paddr[4]; /* (physical) address of line number */
|
||||
} l_addr;
|
||||
char l_lnno[2]; /* line number */
|
||||
};
|
||||
|
||||
#define COFF_LINENO struct COFF_lineno
|
||||
#define COFF_LINESZ 6
|
||||
|
||||
/********************** SYMBOLS **********************/
|
||||
|
||||
#define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */
|
||||
#define COFF_E_FILNMLEN 14 /* # characters in a file name */
|
||||
#define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry */
|
||||
|
||||
/*
|
||||
* All symbols and sections have the following definition
|
||||
*/
|
||||
|
||||
struct COFF_syment
|
||||
{
|
||||
union {
|
||||
char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */
|
||||
struct {
|
||||
char e_zeroes[4]; /* Leading zeros */
|
||||
char e_offset[4]; /* Offset if this is a header section */
|
||||
} e;
|
||||
} e;
|
||||
|
||||
char e_value[4]; /* Value (address) of the segment */
|
||||
char e_scnum[2]; /* Section number */
|
||||
char e_type[2]; /* Type of section */
|
||||
char e_sclass[1]; /* Loader class */
|
||||
char e_numaux[1]; /* Number of auxiliary entries which follow */
|
||||
};
|
||||
|
||||
#define COFF_N_BTMASK (0xf) /* Mask for important class bits */
|
||||
#define COFF_N_TMASK (0x30) /* Mask for important type bits */
|
||||
#define COFF_N_BTSHFT (4) /* # bits to shift class field */
|
||||
#define COFF_N_TSHIFT (2) /* # bits to shift type field */
|
||||
|
||||
/*
|
||||
* Auxiliary entries because the main table is too limiting.
|
||||
*/
|
||||
|
||||
union COFF_auxent {
|
||||
|
||||
/*
|
||||
* Debugger information
|
||||
*/
|
||||
|
||||
struct {
|
||||
char x_tagndx[4]; /* str, un, or enum tag indx */
|
||||
union {
|
||||
struct {
|
||||
char x_lnno[2]; /* declaration line number */
|
||||
char x_size[2]; /* str/union/array size */
|
||||
} x_lnsz;
|
||||
char x_fsize[4]; /* size of function */
|
||||
} x_misc;
|
||||
|
||||
union {
|
||||
struct { /* if ISFCN, tag, or .bb */
|
||||
char x_lnnoptr[4]; /* ptr to fcn line # */
|
||||
char x_endndx[4]; /* entry ndx past block end */
|
||||
} x_fcn;
|
||||
|
||||
struct { /* if ISARY, up to 4 dimen. */
|
||||
char x_dimen[E_DIMNUM][2];
|
||||
} x_ary;
|
||||
} x_fcnary;
|
||||
|
||||
char x_tvndx[2]; /* tv index */
|
||||
} x_sym;
|
||||
|
||||
/*
|
||||
* Source file names (debugger information)
|
||||
*/
|
||||
|
||||
union {
|
||||
char x_fname[E_FILNMLEN];
|
||||
struct {
|
||||
char x_zeroes[4];
|
||||
char x_offset[4];
|
||||
} x_n;
|
||||
} x_file;
|
||||
|
||||
/*
|
||||
* Section information
|
||||
*/
|
||||
|
||||
struct {
|
||||
char x_scnlen[4]; /* section length */
|
||||
char x_nreloc[2]; /* # relocation entries */
|
||||
char x_nlinno[2]; /* # line numbers */
|
||||
} x_scn;
|
||||
|
||||
/*
|
||||
* Transfer vector (branch table)
|
||||
*/
|
||||
|
||||
struct {
|
||||
char x_tvfill[4]; /* tv fill value */
|
||||
char x_tvlen[2]; /* length of .tv */
|
||||
char x_tvran[2][2]; /* tv range */
|
||||
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
|
||||
};
|
||||
|
||||
#define COFF_SYMENT struct COFF_syment
|
||||
#define COFF_SYMESZ 18
|
||||
#define COFF_AUXENT union COFF_auxent
|
||||
#define COFF_AUXESZ 18
|
||||
|
||||
#define COFF_ETEXT "etext"
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct COFF_reloc {
|
||||
char r_vaddr[4]; /* Virtual address of item */
|
||||
char r_symndx[4]; /* Symbol index in the symtab */
|
||||
char r_type[2]; /* Relocation type */
|
||||
};
|
||||
|
||||
#define COFF_RELOC struct COFF_reloc
|
||||
#define COFF_RELSZ 10
|
||||
|
||||
#define COFF_DEF_DATA_SECTION_ALIGNMENT 4
|
||||
#define COFF_DEF_BSS_SECTION_ALIGNMENT 4
|
||||
#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4
|
||||
|
||||
/* For new sections we haven't heard of before */
|
||||
#define COFF_DEF_SECTION_ALIGNMENT 4
|
||||
|
|
@ -22,8 +22,9 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
|
|||
extern int fragmentation_index(struct zone *zone, unsigned int order);
|
||||
extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *mask,
|
||||
bool sync, bool *contended);
|
||||
bool sync, bool *contended, struct page **page);
|
||||
extern int compact_pgdat(pg_data_t *pgdat, int order);
|
||||
extern void reset_isolation_suitable(pg_data_t *pgdat);
|
||||
extern unsigned long compaction_suitable(struct zone *zone, int order);
|
||||
|
||||
/* Do not skip compaction more than 64 times */
|
||||
|
|
@ -61,10 +62,20 @@ static inline bool compaction_deferred(struct zone *zone, int order)
|
|||
return zone->compact_considered < defer_limit;
|
||||
}
|
||||
|
||||
/* Returns true if restarting compaction after many failures */
|
||||
static inline bool compaction_restarting(struct zone *zone, int order)
|
||||
{
|
||||
if (order < zone->compact_order_failed)
|
||||
return false;
|
||||
|
||||
return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT &&
|
||||
zone->compact_considered >= 1UL << zone->compact_defer_shift;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *nodemask,
|
||||
bool sync, bool *contended)
|
||||
bool sync, bool *contended, struct page **page)
|
||||
{
|
||||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
|
@ -74,6 +85,10 @@ static inline int compact_pgdat(pg_data_t *pgdat, int order)
|
|||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
||||
static inline void reset_isolation_suitable(pg_data_t *pgdat)
|
||||
{
|
||||
}
|
||||
|
||||
static inline unsigned long compaction_suitable(struct zone *zone, int order)
|
||||
{
|
||||
return COMPACT_SKIPPED;
|
||||
|
|
|
|||
|
|
@ -160,11 +160,6 @@ struct compat_ustat {
|
|||
char f_fpack[6];
|
||||
};
|
||||
|
||||
typedef union compat_sigval {
|
||||
compat_int_t sival_int;
|
||||
compat_uptr_t sival_ptr;
|
||||
} compat_sigval_t;
|
||||
|
||||
#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
|
||||
|
||||
typedef struct compat_sigevent {
|
||||
|
|
@ -289,8 +284,12 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
|
|||
const struct compat_iovec __user *vec,
|
||||
unsigned long vlen, u32 pos_low, u32 pos_high);
|
||||
|
||||
int compat_do_execve(char *filename, compat_uptr_t __user *argv,
|
||||
compat_uptr_t __user *envp, struct pt_regs *regs);
|
||||
int compat_do_execve(const char *filename, const compat_uptr_t __user *argv,
|
||||
const compat_uptr_t __user *envp, struct pt_regs *regs);
|
||||
#ifdef __ARCH_WANT_SYS_EXECVE
|
||||
asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
|
||||
const compat_uptr_t __user *envp);
|
||||
#endif
|
||||
|
||||
asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
|
||||
compat_ulong_t __user *outp, compat_ulong_t __user *exp,
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
#if __GNUC_MINOR__ > 0
|
||||
#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
#endif
|
||||
#if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__)
|
||||
#if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__)
|
||||
#define __compiletime_warning(message) __attribute__((warning(message)))
|
||||
#define __compiletime_error(message) __attribute__((error(message)))
|
||||
#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 */
|
||||
|
|
|
|||
|
|
@ -83,8 +83,14 @@ void give_up_console(const struct consw *sw);
|
|||
int con_debug_enter(struct vc_data *vc);
|
||||
int con_debug_leave(void);
|
||||
#else
|
||||
#define con_debug_enter(vc) (0)
|
||||
#define con_debug_leave() (0)
|
||||
static inline int con_debug_enter(struct vc_data *vc)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int con_debug_leave(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* scroll */
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
/* const.h: Macros for dealing with constants. */
|
||||
|
||||
#ifndef _LINUX_CONST_H
|
||||
#define _LINUX_CONST_H
|
||||
|
||||
/* Some constant macros are used in both assembler and
|
||||
* C code. Therefore we cannot annotate them always with
|
||||
* 'UL' and other type specifiers unilaterally. We
|
||||
* use the following macros to deal with this.
|
||||
*
|
||||
* Similarly, _AT() will cast an expression with a type in C, but
|
||||
* leave it unchanged in asm.
|
||||
*/
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
#define _AC(X,Y) X
|
||||
#define _AT(T,X) X
|
||||
#else
|
||||
#define __AC(X,Y) (X##Y)
|
||||
#define _AC(X,Y) __AC(X,Y)
|
||||
#define _AT(T,X) ((T)(X))
|
||||
#endif
|
||||
|
||||
#endif /* !(_LINUX_CONST_H) */
|
||||
|
|
@ -11,5 +11,10 @@
|
|||
*/
|
||||
extern int dump_write(struct file *file, const void *addr, int nr);
|
||||
extern int dump_seek(struct file *file, loff_t off);
|
||||
#ifdef CONFIG_COREDUMP
|
||||
extern void do_coredump(siginfo_t *siginfo, struct pt_regs *regs);
|
||||
#else
|
||||
static inline void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) {}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_COREDUMP_H */
|
||||
|
|
|
|||
58
include/linux/cpu_cooling.h
Normal file
58
include/linux/cpu_cooling.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* linux/include/linux/cpu_cooling.h
|
||||
*
|
||||
* Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
|
||||
* Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef __CPU_COOLING_H__
|
||||
#define __CPU_COOLING_H__
|
||||
|
||||
#include <linux/thermal.h>
|
||||
|
||||
#define CPUFREQ_COOLING_START 0
|
||||
#define CPUFREQ_COOLING_STOP 1
|
||||
|
||||
#ifdef CONFIG_CPU_THERMAL
|
||||
/**
|
||||
* cpufreq_cooling_register - function to create cpufreq cooling device.
|
||||
* @clip_cpus: cpumask of cpus where the frequency constraints will happen
|
||||
*/
|
||||
struct thermal_cooling_device *cpufreq_cooling_register(
|
||||
struct cpumask *clip_cpus);
|
||||
|
||||
/**
|
||||
* cpufreq_cooling_unregister - function to remove cpufreq cooling device.
|
||||
* @cdev: thermal cooling device pointer.
|
||||
*/
|
||||
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
|
||||
#else /* !CONFIG_CPU_THERMAL */
|
||||
static inline struct thermal_cooling_device *cpufreq_cooling_register(
|
||||
struct cpumask *clip_cpus)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void cpufreq_cooling_unregister(
|
||||
struct thermal_cooling_device *cdev)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_CPU_THERMAL */
|
||||
|
||||
#endif /* __CPU_COOLING_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,101 +0,0 @@
|
|||
/*
|
||||
* cycx_cfm.h Cyclom 2X WAN Link Driver.
|
||||
* Definitions for the Cyclom 2X Firmware Module (CFM).
|
||||
*
|
||||
* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
||||
*
|
||||
* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
|
||||
*
|
||||
* Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
* 1998/08/08 acme Initial version.
|
||||
*/
|
||||
#ifndef _CYCX_CFM_H
|
||||
#define _CYCX_CFM_H
|
||||
|
||||
/* Defines */
|
||||
|
||||
#define CFM_VERSION 2
|
||||
#define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module"
|
||||
|
||||
/* min/max */
|
||||
#define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */
|
||||
#define CFM_DESCR_LEN 256 /* max length of description string */
|
||||
#define CFM_MAX_CYCX 1 /* max number of compatible adapters */
|
||||
#define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */
|
||||
|
||||
/* Firmware Commands */
|
||||
#define GEN_POWER_ON 0x1280
|
||||
|
||||
#define GEN_SET_SEG 0x1401 /* boot segment setting. */
|
||||
#define GEN_BOOT_DAT 0x1402 /* boot data. */
|
||||
#define GEN_START 0x1403 /* board start. */
|
||||
#define GEN_DEFPAR 0x1404 /* buffer length for boot. */
|
||||
|
||||
/* Adapter Types */
|
||||
#define CYCX_2X 2
|
||||
/* for now only the 2X is supported, no plans to support 8X or 16X */
|
||||
#define CYCX_8X 8
|
||||
#define CYCX_16X 16
|
||||
|
||||
#define CFID_X25_2X 5200
|
||||
|
||||
/**
|
||||
* struct cycx_fw_info - firmware module information.
|
||||
* @codeid - firmware ID
|
||||
* @version - firmware version number
|
||||
* @adapter - compatible adapter types
|
||||
* @memsize - minimum memory size
|
||||
* @reserved - reserved
|
||||
* @startoffs - entry point offset
|
||||
* @winoffs - dual-port memory window offset
|
||||
* @codeoffs - code load offset
|
||||
* @codesize - code size
|
||||
* @dataoffs - configuration data load offset
|
||||
* @datasize - configuration data size
|
||||
*/
|
||||
struct cycx_fw_info {
|
||||
unsigned short codeid;
|
||||
unsigned short version;
|
||||
unsigned short adapter[CFM_MAX_CYCX];
|
||||
unsigned long memsize;
|
||||
unsigned short reserved[2];
|
||||
unsigned short startoffs;
|
||||
unsigned short winoffs;
|
||||
unsigned short codeoffs;
|
||||
unsigned long codesize;
|
||||
unsigned short dataoffs;
|
||||
unsigned long datasize;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cycx_firmware - CYCX firmware file structure
|
||||
* @signature - CFM file signature
|
||||
* @version - file format version
|
||||
* @checksum - info + image
|
||||
* @reserved - reserved
|
||||
* @descr - description string
|
||||
* @info - firmware module info
|
||||
* @image - code image (variable size)
|
||||
*/
|
||||
struct cycx_firmware {
|
||||
char signature[80];
|
||||
unsigned short version;
|
||||
unsigned short checksum;
|
||||
unsigned short reserved[6];
|
||||
char descr[CFM_DESCR_LEN];
|
||||
struct cycx_fw_info info;
|
||||
unsigned char image[0];
|
||||
};
|
||||
|
||||
struct cycx_fw_header {
|
||||
unsigned long reset_size;
|
||||
unsigned long data_size;
|
||||
unsigned long code_size;
|
||||
};
|
||||
#endif /* _CYCX_CFM_H */
|
||||
|
|
@ -1,684 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2011, Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
* Place - Suite 330, Boston, MA 02111-1307 USA.
|
||||
*
|
||||
* Author: Lucy Liu <lucy.liu@intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_DCBNL_H__
|
||||
#define __LINUX_DCBNL_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* IEEE 802.1Qaz std supported values */
|
||||
#define IEEE_8021QAZ_MAX_TCS 8
|
||||
|
||||
#define IEEE_8021QAZ_TSA_STRICT 0
|
||||
#define IEEE_8021QAZ_TSA_CB_SHAPER 1
|
||||
#define IEEE_8021QAZ_TSA_ETS 2
|
||||
#define IEEE_8021QAZ_TSA_VENDOR 255
|
||||
|
||||
/* This structure contains the IEEE 802.1Qaz ETS managed object
|
||||
*
|
||||
* @willing: willing bit in ETS configuration TLV
|
||||
* @ets_cap: indicates supported capacity of ets feature
|
||||
* @cbs: credit based shaper ets algorithm supported
|
||||
* @tc_tx_bw: tc tx bandwidth indexed by traffic class
|
||||
* @tc_rx_bw: tc rx bandwidth indexed by traffic class
|
||||
* @tc_tsa: TSA Assignment table, indexed by traffic class
|
||||
* @prio_tc: priority assignment table mapping 8021Qp to traffic class
|
||||
* @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
|
||||
* @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
|
||||
* @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
|
||||
*
|
||||
* Recommended values are used to set fields in the ETS recommendation TLV
|
||||
* with hardware offloaded LLDP.
|
||||
*
|
||||
* ----
|
||||
* TSA Assignment 8 bit identifiers
|
||||
* 0 strict priority
|
||||
* 1 credit-based shaper
|
||||
* 2 enhanced transmission selection
|
||||
* 3-254 reserved
|
||||
* 255 vendor specific
|
||||
*/
|
||||
struct ieee_ets {
|
||||
__u8 willing;
|
||||
__u8 ets_cap;
|
||||
__u8 cbs;
|
||||
__u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
|
||||
__u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
|
||||
};
|
||||
|
||||
/* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
|
||||
* managed object.
|
||||
* Values are 64 bits long and specified in Kbps to enable usage over both
|
||||
* slow and very fast networks.
|
||||
*
|
||||
* @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
|
||||
*/
|
||||
struct ieee_maxrate {
|
||||
__u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS];
|
||||
};
|
||||
|
||||
/* This structure contains the IEEE 802.1Qaz PFC managed object
|
||||
*
|
||||
* @pfc_cap: Indicates the number of traffic classes on the local device
|
||||
* that may simultaneously have PFC enabled.
|
||||
* @pfc_en: bitmap indicating pfc enabled traffic classes
|
||||
* @mbc: enable macsec bypass capability
|
||||
* @delay: the allowance made for a round-trip propagation delay of the
|
||||
* link in bits.
|
||||
* @requests: count of the sent pfc frames
|
||||
* @indications: count of the received pfc frames
|
||||
*/
|
||||
struct ieee_pfc {
|
||||
__u8 pfc_cap;
|
||||
__u8 pfc_en;
|
||||
__u8 mbc;
|
||||
__u16 delay;
|
||||
__u64 requests[IEEE_8021QAZ_MAX_TCS];
|
||||
__u64 indications[IEEE_8021QAZ_MAX_TCS];
|
||||
};
|
||||
|
||||
/* CEE DCBX std supported values */
|
||||
#define CEE_DCBX_MAX_PGS 8
|
||||
#define CEE_DCBX_MAX_PRIO 8
|
||||
|
||||
/**
|
||||
* struct cee_pg - CEE Priority-Group managed object
|
||||
*
|
||||
* @willing: willing bit in the PG tlv
|
||||
* @error: error bit in the PG tlv
|
||||
* @pg_en: enable bit of the PG feature
|
||||
* @tcs_supported: number of traffic classes supported
|
||||
* @pg_bw: bandwidth percentage for each priority group
|
||||
* @prio_pg: priority to PG mapping indexed by priority
|
||||
*/
|
||||
struct cee_pg {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
__u8 pg_en;
|
||||
__u8 tcs_supported;
|
||||
__u8 pg_bw[CEE_DCBX_MAX_PGS];
|
||||
__u8 prio_pg[CEE_DCBX_MAX_PGS];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cee_pfc - CEE PFC managed object
|
||||
*
|
||||
* @willing: willing bit in the PFC tlv
|
||||
* @error: error bit in the PFC tlv
|
||||
* @pfc_en: bitmap indicating pfc enabled traffic classes
|
||||
* @tcs_supported: number of traffic classes supported
|
||||
*/
|
||||
struct cee_pfc {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
__u8 pfc_en;
|
||||
__u8 tcs_supported;
|
||||
};
|
||||
|
||||
/* IEEE 802.1Qaz std supported values */
|
||||
#define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
|
||||
#define IEEE_8021QAZ_APP_SEL_STREAM 2
|
||||
#define IEEE_8021QAZ_APP_SEL_DGRAM 3
|
||||
#define IEEE_8021QAZ_APP_SEL_ANY 4
|
||||
|
||||
/* This structure contains the IEEE 802.1Qaz APP managed object. This
|
||||
* object is also used for the CEE std as well. There is no difference
|
||||
* between the objects.
|
||||
*
|
||||
* @selector: protocol identifier type
|
||||
* @protocol: protocol of type indicated
|
||||
* @priority: 3-bit unsigned integer indicating priority
|
||||
*
|
||||
* ----
|
||||
* Selector field values
|
||||
* 0 Reserved
|
||||
* 1 Ethertype
|
||||
* 2 Well known port number over TCP or SCTP
|
||||
* 3 Well known port number over UDP or DCCP
|
||||
* 4 Well known port number over TCP, SCTP, UDP, or DCCP
|
||||
* 5-7 Reserved
|
||||
*/
|
||||
struct dcb_app {
|
||||
__u8 selector;
|
||||
__u8 priority;
|
||||
__u16 protocol;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dcb_peer_app_info - APP feature information sent by the peer
|
||||
*
|
||||
* @willing: willing bit in the peer APP tlv
|
||||
* @error: error bit in the peer APP tlv
|
||||
*
|
||||
* In addition to this information the full peer APP tlv also contains
|
||||
* a table of 'app_count' APP objects defined above.
|
||||
*/
|
||||
struct dcb_peer_app_info {
|
||||
__u8 willing;
|
||||
__u8 error;
|
||||
};
|
||||
|
||||
struct dcbmsg {
|
||||
__u8 dcb_family;
|
||||
__u8 cmd;
|
||||
__u16 dcb_pad;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_commands - supported DCB commands
|
||||
*
|
||||
* @DCB_CMD_UNDEFINED: unspecified command to catch errors
|
||||
* @DCB_CMD_GSTATE: request the state of DCB in the device
|
||||
* @DCB_CMD_SSTATE: set the state of DCB in the device
|
||||
* @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
|
||||
* @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
|
||||
* @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
|
||||
* @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
|
||||
* @DCB_CMD_PFC_GCFG: request the priority flow control configuration
|
||||
* @DCB_CMD_PFC_SCFG: set the priority flow control configuration
|
||||
* @DCB_CMD_SET_ALL: apply all changes to the underlying device
|
||||
* @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
|
||||
* device. Only useful when using bonding.
|
||||
* @DCB_CMD_GCAP: request the DCB capabilities of the device
|
||||
* @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
|
||||
* @DCB_CMD_SNUMTCS: set the number of traffic classes
|
||||
* @DCB_CMD_GBCN: set backward congestion notification configuration
|
||||
* @DCB_CMD_SBCN: get backward congestion notification configration.
|
||||
* @DCB_CMD_GAPP: get application protocol configuration
|
||||
* @DCB_CMD_SAPP: set application protocol configuration
|
||||
* @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
|
||||
* @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
|
||||
* @DCB_CMD_GDCBX: get DCBX engine configuration
|
||||
* @DCB_CMD_SDCBX: set DCBX engine configuration
|
||||
* @DCB_CMD_GFEATCFG: get DCBX features flags
|
||||
* @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
|
||||
* @DCB_CMD_CEE_GET: get CEE aggregated configuration
|
||||
* @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
|
||||
*/
|
||||
enum dcbnl_commands {
|
||||
DCB_CMD_UNDEFINED,
|
||||
|
||||
DCB_CMD_GSTATE,
|
||||
DCB_CMD_SSTATE,
|
||||
|
||||
DCB_CMD_PGTX_GCFG,
|
||||
DCB_CMD_PGTX_SCFG,
|
||||
DCB_CMD_PGRX_GCFG,
|
||||
DCB_CMD_PGRX_SCFG,
|
||||
|
||||
DCB_CMD_PFC_GCFG,
|
||||
DCB_CMD_PFC_SCFG,
|
||||
|
||||
DCB_CMD_SET_ALL,
|
||||
|
||||
DCB_CMD_GPERM_HWADDR,
|
||||
|
||||
DCB_CMD_GCAP,
|
||||
|
||||
DCB_CMD_GNUMTCS,
|
||||
DCB_CMD_SNUMTCS,
|
||||
|
||||
DCB_CMD_PFC_GSTATE,
|
||||
DCB_CMD_PFC_SSTATE,
|
||||
|
||||
DCB_CMD_BCN_GCFG,
|
||||
DCB_CMD_BCN_SCFG,
|
||||
|
||||
DCB_CMD_GAPP,
|
||||
DCB_CMD_SAPP,
|
||||
|
||||
DCB_CMD_IEEE_SET,
|
||||
DCB_CMD_IEEE_GET,
|
||||
|
||||
DCB_CMD_GDCBX,
|
||||
DCB_CMD_SDCBX,
|
||||
|
||||
DCB_CMD_GFEATCFG,
|
||||
DCB_CMD_SFEATCFG,
|
||||
|
||||
DCB_CMD_CEE_GET,
|
||||
DCB_CMD_IEEE_DEL,
|
||||
|
||||
__DCB_CMD_ENUM_MAX,
|
||||
DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_attrs - DCB top-level netlink attributes
|
||||
*
|
||||
* @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
|
||||
* @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
|
||||
* @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
|
||||
* @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
|
||||
* @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
|
||||
* @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
|
||||
* @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
|
||||
* @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
|
||||
* @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
|
||||
* @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
|
||||
* @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
|
||||
* @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
|
||||
* @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
|
||||
* @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
|
||||
* @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
|
||||
*/
|
||||
enum dcbnl_attrs {
|
||||
DCB_ATTR_UNDEFINED,
|
||||
|
||||
DCB_ATTR_IFNAME,
|
||||
DCB_ATTR_STATE,
|
||||
DCB_ATTR_PFC_STATE,
|
||||
DCB_ATTR_PFC_CFG,
|
||||
DCB_ATTR_NUM_TC,
|
||||
DCB_ATTR_PG_CFG,
|
||||
DCB_ATTR_SET_ALL,
|
||||
DCB_ATTR_PERM_HWADDR,
|
||||
DCB_ATTR_CAP,
|
||||
DCB_ATTR_NUMTCS,
|
||||
DCB_ATTR_BCN,
|
||||
DCB_ATTR_APP,
|
||||
|
||||
/* IEEE std attributes */
|
||||
DCB_ATTR_IEEE,
|
||||
|
||||
DCB_ATTR_DCBX,
|
||||
DCB_ATTR_FEATCFG,
|
||||
|
||||
/* CEE nested attributes */
|
||||
DCB_ATTR_CEE,
|
||||
|
||||
__DCB_ATTR_ENUM_MAX,
|
||||
DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee_attrs - IEEE 802.1Qaz get/set attributes
|
||||
*
|
||||
* @DCB_ATTR_IEEE_UNSPEC: unspecified
|
||||
* @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
|
||||
* @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
|
||||
* @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
|
||||
* @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
|
||||
* @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
|
||||
* @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
|
||||
*/
|
||||
enum ieee_attrs {
|
||||
DCB_ATTR_IEEE_UNSPEC,
|
||||
DCB_ATTR_IEEE_ETS,
|
||||
DCB_ATTR_IEEE_PFC,
|
||||
DCB_ATTR_IEEE_APP_TABLE,
|
||||
DCB_ATTR_IEEE_PEER_ETS,
|
||||
DCB_ATTR_IEEE_PEER_PFC,
|
||||
DCB_ATTR_IEEE_PEER_APP,
|
||||
DCB_ATTR_IEEE_MAXRATE,
|
||||
__DCB_ATTR_IEEE_MAX
|
||||
};
|
||||
#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
|
||||
|
||||
enum ieee_attrs_app {
|
||||
DCB_ATTR_IEEE_APP_UNSPEC,
|
||||
DCB_ATTR_IEEE_APP,
|
||||
__DCB_ATTR_IEEE_APP_MAX
|
||||
};
|
||||
#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
|
||||
|
||||
/**
|
||||
* enum cee_attrs - CEE DCBX get attributes.
|
||||
*
|
||||
* @DCB_ATTR_CEE_UNSPEC: unspecified
|
||||
* @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
|
||||
* @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
|
||||
* @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
|
||||
* @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
|
||||
* @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
|
||||
* @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
|
||||
* @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
|
||||
* @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
|
||||
*
|
||||
* An aggregated collection of the cee std negotiated parameters.
|
||||
*/
|
||||
enum cee_attrs {
|
||||
DCB_ATTR_CEE_UNSPEC,
|
||||
DCB_ATTR_CEE_PEER_PG,
|
||||
DCB_ATTR_CEE_PEER_PFC,
|
||||
DCB_ATTR_CEE_PEER_APP_TABLE,
|
||||
DCB_ATTR_CEE_TX_PG,
|
||||
DCB_ATTR_CEE_RX_PG,
|
||||
DCB_ATTR_CEE_PFC,
|
||||
DCB_ATTR_CEE_APP_TABLE,
|
||||
DCB_ATTR_CEE_FEAT,
|
||||
__DCB_ATTR_CEE_MAX
|
||||
};
|
||||
#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
|
||||
|
||||
enum peer_app_attr {
|
||||
DCB_ATTR_CEE_PEER_APP_UNSPEC,
|
||||
DCB_ATTR_CEE_PEER_APP_INFO,
|
||||
DCB_ATTR_CEE_PEER_APP,
|
||||
__DCB_ATTR_CEE_PEER_APP_MAX
|
||||
};
|
||||
#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
|
||||
|
||||
enum cee_attrs_app {
|
||||
DCB_ATTR_CEE_APP_UNSPEC,
|
||||
DCB_ATTR_CEE_APP,
|
||||
__DCB_ATTR_CEE_APP_MAX
|
||||
};
|
||||
#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
|
||||
|
||||
/**
|
||||
* enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
|
||||
*
|
||||
* @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
|
||||
* @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
|
||||
* @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
|
||||
*
|
||||
*/
|
||||
enum dcbnl_pfc_up_attrs {
|
||||
DCB_PFC_UP_ATTR_UNDEFINED,
|
||||
|
||||
DCB_PFC_UP_ATTR_0,
|
||||
DCB_PFC_UP_ATTR_1,
|
||||
DCB_PFC_UP_ATTR_2,
|
||||
DCB_PFC_UP_ATTR_3,
|
||||
DCB_PFC_UP_ATTR_4,
|
||||
DCB_PFC_UP_ATTR_5,
|
||||
DCB_PFC_UP_ATTR_6,
|
||||
DCB_PFC_UP_ATTR_7,
|
||||
DCB_PFC_UP_ATTR_ALL,
|
||||
|
||||
__DCB_PFC_UP_ATTR_ENUM_MAX,
|
||||
DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_pg_attrs - DCB Priority Group attributes
|
||||
*
|
||||
* @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
|
||||
* @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
|
||||
* @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
|
||||
* @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
|
||||
* @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
|
||||
*
|
||||
*/
|
||||
enum dcbnl_pg_attrs {
|
||||
DCB_PG_ATTR_UNDEFINED,
|
||||
|
||||
DCB_PG_ATTR_TC_0,
|
||||
DCB_PG_ATTR_TC_1,
|
||||
DCB_PG_ATTR_TC_2,
|
||||
DCB_PG_ATTR_TC_3,
|
||||
DCB_PG_ATTR_TC_4,
|
||||
DCB_PG_ATTR_TC_5,
|
||||
DCB_PG_ATTR_TC_6,
|
||||
DCB_PG_ATTR_TC_7,
|
||||
DCB_PG_ATTR_TC_MAX,
|
||||
DCB_PG_ATTR_TC_ALL,
|
||||
|
||||
DCB_PG_ATTR_BW_ID_0,
|
||||
DCB_PG_ATTR_BW_ID_1,
|
||||
DCB_PG_ATTR_BW_ID_2,
|
||||
DCB_PG_ATTR_BW_ID_3,
|
||||
DCB_PG_ATTR_BW_ID_4,
|
||||
DCB_PG_ATTR_BW_ID_5,
|
||||
DCB_PG_ATTR_BW_ID_6,
|
||||
DCB_PG_ATTR_BW_ID_7,
|
||||
DCB_PG_ATTR_BW_ID_MAX,
|
||||
DCB_PG_ATTR_BW_ID_ALL,
|
||||
|
||||
__DCB_PG_ATTR_ENUM_MAX,
|
||||
DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_tc_attrs - DCB Traffic Class attributes
|
||||
*
|
||||
* @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
|
||||
* Valid values are: 0-7
|
||||
* @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
|
||||
* Some devices may not support changing the
|
||||
* user priority map of a TC.
|
||||
* @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
|
||||
* 0 - none
|
||||
* 1 - group strict
|
||||
* 2 - link strict
|
||||
* @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
|
||||
* not configured to use link strict priority,
|
||||
* this is the percentage of bandwidth of the
|
||||
* priority group this traffic class belongs to
|
||||
* @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
|
||||
*
|
||||
*/
|
||||
enum dcbnl_tc_attrs {
|
||||
DCB_TC_ATTR_PARAM_UNDEFINED,
|
||||
|
||||
DCB_TC_ATTR_PARAM_PGID,
|
||||
DCB_TC_ATTR_PARAM_UP_MAPPING,
|
||||
DCB_TC_ATTR_PARAM_STRICT_PRIO,
|
||||
DCB_TC_ATTR_PARAM_BW_PCT,
|
||||
DCB_TC_ATTR_PARAM_ALL,
|
||||
|
||||
__DCB_TC_ATTR_PARAM_ENUM_MAX,
|
||||
DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_cap_attrs - DCB Capability attributes
|
||||
*
|
||||
* @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
|
||||
* @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
|
||||
* @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
|
||||
* @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
|
||||
* traffic class mapping
|
||||
* @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
|
||||
* number of traffic classes the device
|
||||
* can be configured to use for Priority Groups
|
||||
* @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
|
||||
* number of traffic classes the device can be
|
||||
* configured to use for Priority Flow Control
|
||||
* @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
|
||||
* @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
|
||||
* Notification
|
||||
* @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
|
||||
*
|
||||
*/
|
||||
enum dcbnl_cap_attrs {
|
||||
DCB_CAP_ATTR_UNDEFINED,
|
||||
DCB_CAP_ATTR_ALL,
|
||||
DCB_CAP_ATTR_PG,
|
||||
DCB_CAP_ATTR_PFC,
|
||||
DCB_CAP_ATTR_UP2TC,
|
||||
DCB_CAP_ATTR_PG_TCS,
|
||||
DCB_CAP_ATTR_PFC_TCS,
|
||||
DCB_CAP_ATTR_GSP,
|
||||
DCB_CAP_ATTR_BCN,
|
||||
DCB_CAP_ATTR_DCBX,
|
||||
|
||||
__DCB_CAP_ATTR_ENUM_MAX,
|
||||
DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* DCBX capability flags
|
||||
*
|
||||
* @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
|
||||
* 'set' routines are used to configure the device with
|
||||
* the negotiated parameters
|
||||
*
|
||||
* @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
|
||||
* by another entity
|
||||
* 'get' routines are used to retrieve the
|
||||
* negotiated parameters
|
||||
* 'set' routines can be used to set the initial
|
||||
* negotiation configuration
|
||||
*
|
||||
* @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
|
||||
* supports the CEE protocol flavor
|
||||
*
|
||||
* @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
|
||||
* supports the IEEE protocol flavor
|
||||
*
|
||||
* @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
|
||||
* supports static configuration (i.e no actual
|
||||
* negotiation is performed negotiated parameters equal
|
||||
* the initial configuration)
|
||||
*
|
||||
*/
|
||||
#define DCB_CAP_DCBX_HOST 0x01
|
||||
#define DCB_CAP_DCBX_LLD_MANAGED 0x02
|
||||
#define DCB_CAP_DCBX_VER_CEE 0x04
|
||||
#define DCB_CAP_DCBX_VER_IEEE 0x08
|
||||
#define DCB_CAP_DCBX_STATIC 0x10
|
||||
|
||||
/**
|
||||
* enum dcbnl_numtcs_attrs - number of traffic classes
|
||||
*
|
||||
* @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
|
||||
* @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
|
||||
* priority groups
|
||||
* @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
|
||||
* support priority flow control
|
||||
*/
|
||||
enum dcbnl_numtcs_attrs {
|
||||
DCB_NUMTCS_ATTR_UNDEFINED,
|
||||
DCB_NUMTCS_ATTR_ALL,
|
||||
DCB_NUMTCS_ATTR_PG,
|
||||
DCB_NUMTCS_ATTR_PFC,
|
||||
|
||||
__DCB_NUMTCS_ATTR_ENUM_MAX,
|
||||
DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
enum dcbnl_bcn_attrs{
|
||||
DCB_BCN_ATTR_UNDEFINED = 0,
|
||||
|
||||
DCB_BCN_ATTR_RP_0,
|
||||
DCB_BCN_ATTR_RP_1,
|
||||
DCB_BCN_ATTR_RP_2,
|
||||
DCB_BCN_ATTR_RP_3,
|
||||
DCB_BCN_ATTR_RP_4,
|
||||
DCB_BCN_ATTR_RP_5,
|
||||
DCB_BCN_ATTR_RP_6,
|
||||
DCB_BCN_ATTR_RP_7,
|
||||
DCB_BCN_ATTR_RP_ALL,
|
||||
|
||||
DCB_BCN_ATTR_BCNA_0,
|
||||
DCB_BCN_ATTR_BCNA_1,
|
||||
DCB_BCN_ATTR_ALPHA,
|
||||
DCB_BCN_ATTR_BETA,
|
||||
DCB_BCN_ATTR_GD,
|
||||
DCB_BCN_ATTR_GI,
|
||||
DCB_BCN_ATTR_TMAX,
|
||||
DCB_BCN_ATTR_TD,
|
||||
DCB_BCN_ATTR_RMIN,
|
||||
DCB_BCN_ATTR_W,
|
||||
DCB_BCN_ATTR_RD,
|
||||
DCB_BCN_ATTR_RU,
|
||||
DCB_BCN_ATTR_WRTT,
|
||||
DCB_BCN_ATTR_RI,
|
||||
DCB_BCN_ATTR_C,
|
||||
DCB_BCN_ATTR_ALL,
|
||||
|
||||
__DCB_BCN_ATTR_ENUM_MAX,
|
||||
DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcb_general_attr_values - general DCB attribute values
|
||||
*
|
||||
* @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
|
||||
*
|
||||
*/
|
||||
enum dcb_general_attr_values {
|
||||
DCB_ATTR_VALUE_UNDEFINED = 0xff
|
||||
};
|
||||
|
||||
#define DCB_APP_IDTYPE_ETHTYPE 0x00
|
||||
#define DCB_APP_IDTYPE_PORTNUM 0x01
|
||||
enum dcbnl_app_attrs {
|
||||
DCB_APP_ATTR_UNDEFINED,
|
||||
|
||||
DCB_APP_ATTR_IDTYPE,
|
||||
DCB_APP_ATTR_ID,
|
||||
DCB_APP_ATTR_PRIORITY,
|
||||
|
||||
__DCB_APP_ATTR_ENUM_MAX,
|
||||
DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dcbnl_featcfg_attrs - features conifiguration flags
|
||||
*
|
||||
* @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
|
||||
* @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
|
||||
* @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
|
||||
* @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
|
||||
* flow control
|
||||
* @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
|
||||
*
|
||||
*/
|
||||
#define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
|
||||
#define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
|
||||
#define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
|
||||
#define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
|
||||
enum dcbnl_featcfg_attrs {
|
||||
DCB_FEATCFG_ATTR_UNDEFINED,
|
||||
DCB_FEATCFG_ATTR_ALL,
|
||||
DCB_FEATCFG_ATTR_PG,
|
||||
DCB_FEATCFG_ATTR_PFC,
|
||||
DCB_FEATCFG_ATTR_APP,
|
||||
|
||||
__DCB_FEATCFG_ATTR_ENUM_MAX,
|
||||
DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
|
||||
};
|
||||
|
||||
#endif /* __LINUX_DCBNL_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__ */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,108 +0,0 @@
|
|||
/******************************************************************************
|
||||
*******************************************************************************
|
||||
**
|
||||
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
||||
** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||
**
|
||||
** This copyrighted material is made available to anyone wishing to use,
|
||||
** modify, copy, or redistribute it subject to the terms and conditions
|
||||
** of the GNU General Public License v.2.
|
||||
**
|
||||
*******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _LINUX_DLM_DEVICE_H
|
||||
#define _LINUX_DLM_DEVICE_H
|
||||
|
||||
/* This is the device interface for dlm, most users will use a library
|
||||
* interface.
|
||||
*/
|
||||
|
||||
#include <linux/dlm.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define DLM_USER_LVB_LEN 32
|
||||
|
||||
/* Version of the device interface */
|
||||
#define DLM_DEVICE_VERSION_MAJOR 6
|
||||
#define DLM_DEVICE_VERSION_MINOR 0
|
||||
#define DLM_DEVICE_VERSION_PATCH 1
|
||||
|
||||
/* struct passed to the lock write */
|
||||
struct dlm_lock_params {
|
||||
__u8 mode;
|
||||
__u8 namelen;
|
||||
__u16 unused;
|
||||
__u32 flags;
|
||||
__u32 lkid;
|
||||
__u32 parent;
|
||||
__u64 xid;
|
||||
__u64 timeout;
|
||||
void __user *castparam;
|
||||
void __user *castaddr;
|
||||
void __user *bastparam;
|
||||
void __user *bastaddr;
|
||||
struct dlm_lksb __user *lksb;
|
||||
char lvb[DLM_USER_LVB_LEN];
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct dlm_lspace_params {
|
||||
__u32 flags;
|
||||
__u32 minor;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
struct dlm_purge_params {
|
||||
__u32 nodeid;
|
||||
__u32 pid;
|
||||
};
|
||||
|
||||
struct dlm_write_request {
|
||||
__u32 version[3];
|
||||
__u8 cmd;
|
||||
__u8 is64bit;
|
||||
__u8 unused[2];
|
||||
|
||||
union {
|
||||
struct dlm_lock_params lock;
|
||||
struct dlm_lspace_params lspace;
|
||||
struct dlm_purge_params purge;
|
||||
} i;
|
||||
};
|
||||
|
||||
struct dlm_device_version {
|
||||
__u32 version[3];
|
||||
};
|
||||
|
||||
/* struct read from the "device" fd,
|
||||
consists mainly of userspace pointers for the library to use */
|
||||
|
||||
struct dlm_lock_result {
|
||||
__u32 version[3];
|
||||
__u32 length;
|
||||
void __user * user_astaddr;
|
||||
void __user * user_astparam;
|
||||
struct dlm_lksb __user * user_lksb;
|
||||
struct dlm_lksb lksb;
|
||||
__u8 bast_mode;
|
||||
__u8 unused[3];
|
||||
/* Offsets may be zero if no data is present */
|
||||
__u32 lvb_offset;
|
||||
};
|
||||
|
||||
/* Commands passed to the device */
|
||||
#define DLM_USER_LOCK 1
|
||||
#define DLM_USER_UNLOCK 2
|
||||
#define DLM_USER_QUERY 3
|
||||
#define DLM_USER_CREATE_LOCKSPACE 4
|
||||
#define DLM_USER_REMOVE_LOCKSPACE 5
|
||||
#define DLM_USER_PURGE 6
|
||||
#define DLM_USER_DEADLOCK 7
|
||||
|
||||
/* Lockspace flags */
|
||||
#define DLM_USER_LSFLG_AUTOFREE 1
|
||||
#define DLM_USER_LSFLG_FORCEFREE 2
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU General Public License v.2.
|
||||
*/
|
||||
|
||||
#ifndef _DLM_NETLINK_H
|
||||
#define _DLM_NETLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum {
|
||||
DLM_STATUS_WAITING = 1,
|
||||
DLM_STATUS_GRANTED = 2,
|
||||
DLM_STATUS_CONVERT = 3,
|
||||
};
|
||||
|
||||
#define DLM_LOCK_DATA_VERSION 1
|
||||
|
||||
struct dlm_lock_data {
|
||||
__u16 version;
|
||||
__u32 lockspace_id;
|
||||
int nodeid;
|
||||
int ownpid;
|
||||
__u32 id;
|
||||
__u32 remid;
|
||||
__u64 xid;
|
||||
__s8 status;
|
||||
__s8 grmode;
|
||||
__s8 rqmode;
|
||||
unsigned long timestamp;
|
||||
int resource_namelen;
|
||||
char resource_name[DLM_RESNAME_MAXLEN];
|
||||
};
|
||||
|
||||
enum {
|
||||
DLM_CMD_UNSPEC = 0,
|
||||
DLM_CMD_HELLO, /* user->kernel */
|
||||
DLM_CMD_TIMEOUT, /* kernel->user */
|
||||
__DLM_CMD_MAX,
|
||||
};
|
||||
|
||||
#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
|
||||
|
||||
enum {
|
||||
DLM_TYPE_UNSPEC = 0,
|
||||
DLM_TYPE_LOCK,
|
||||
__DLM_TYPE_MAX,
|
||||
};
|
||||
|
||||
#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
|
||||
|
||||
#define DLM_GENL_VERSION 0x1
|
||||
#define DLM_GENL_NAME "DLM"
|
||||
|
||||
#endif /* _DLM_NETLINK_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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,163 +0,0 @@
|
|||
/******************************************************************************
|
||||
*******************************************************************************
|
||||
**
|
||||
** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
||||
** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||
**
|
||||
** This copyrighted material is made available to anyone wishing to use,
|
||||
** modify, copy, or redistribute it subject to the terms and conditions
|
||||
** of the GNU General Public License v.2.
|
||||
**
|
||||
*******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __DLMCONSTANTS_DOT_H__
|
||||
#define __DLMCONSTANTS_DOT_H__
|
||||
|
||||
/*
|
||||
* Constants used by DLM interface.
|
||||
*/
|
||||
|
||||
#define DLM_LOCKSPACE_LEN 64
|
||||
#define DLM_RESNAME_MAXLEN 64
|
||||
|
||||
|
||||
/*
|
||||
* Lock Modes
|
||||
*/
|
||||
|
||||
#define DLM_LOCK_IV (-1) /* invalid */
|
||||
#define DLM_LOCK_NL 0 /* null */
|
||||
#define DLM_LOCK_CR 1 /* concurrent read */
|
||||
#define DLM_LOCK_CW 2 /* concurrent write */
|
||||
#define DLM_LOCK_PR 3 /* protected read */
|
||||
#define DLM_LOCK_PW 4 /* protected write */
|
||||
#define DLM_LOCK_EX 5 /* exclusive */
|
||||
|
||||
|
||||
/*
|
||||
* Flags to dlm_lock
|
||||
*
|
||||
* DLM_LKF_NOQUEUE
|
||||
*
|
||||
* Do not queue the lock request on the wait queue if it cannot be granted
|
||||
* immediately. If the lock cannot be granted because of this flag, DLM will
|
||||
* either return -EAGAIN from the dlm_lock call or will return 0 from
|
||||
* dlm_lock and -EAGAIN in the lock status block when the AST is executed.
|
||||
*
|
||||
* DLM_LKF_CANCEL
|
||||
*
|
||||
* Used to cancel a pending lock request or conversion. A converting lock is
|
||||
* returned to its previously granted mode.
|
||||
*
|
||||
* DLM_LKF_CONVERT
|
||||
*
|
||||
* Indicates a lock conversion request. For conversions the name and namelen
|
||||
* are ignored and the lock ID in the LKSB is used to identify the lock.
|
||||
*
|
||||
* DLM_LKF_VALBLK
|
||||
*
|
||||
* Requests DLM to return the current contents of the lock value block in the
|
||||
* lock status block. When this flag is set in a lock conversion from PW or EX
|
||||
* modes, DLM assigns the value specified in the lock status block to the lock
|
||||
* value block of the lock resource. The LVB is a DLM_LVB_LEN size array
|
||||
* containing application-specific information.
|
||||
*
|
||||
* DLM_LKF_QUECVT
|
||||
*
|
||||
* Force a conversion request to be queued, even if it is compatible with
|
||||
* the granted modes of other locks on the same resource.
|
||||
*
|
||||
* DLM_LKF_IVVALBLK
|
||||
*
|
||||
* Invalidate the lock value block.
|
||||
*
|
||||
* DLM_LKF_CONVDEADLK
|
||||
*
|
||||
* Allows the dlm to resolve conversion deadlocks internally by demoting the
|
||||
* granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is
|
||||
* returned for a conversion that's been effected by this.
|
||||
*
|
||||
* DLM_LKF_PERSISTENT
|
||||
*
|
||||
* Only relevant to locks originating in userspace. A persistent lock will not
|
||||
* be removed if the process holding the lock exits.
|
||||
*
|
||||
* DLM_LKF_NODLCKWT
|
||||
*
|
||||
* Do not cancel the lock if it gets into conversion deadlock.
|
||||
* Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
|
||||
*
|
||||
* DLM_LKF_NODLCKBLK
|
||||
*
|
||||
* net yet implemented
|
||||
*
|
||||
* DLM_LKF_EXPEDITE
|
||||
*
|
||||
* Used only with new requests for NL mode locks. Tells the lock manager
|
||||
* to grant the lock, ignoring other locks in convert and wait queues.
|
||||
*
|
||||
* DLM_LKF_NOQUEUEBAST
|
||||
*
|
||||
* Send blocking AST's before returning -EAGAIN to the caller. It is only
|
||||
* used along with the NOQUEUE flag. Blocking AST's are not sent for failed
|
||||
* NOQUEUE requests otherwise.
|
||||
*
|
||||
* DLM_LKF_HEADQUE
|
||||
*
|
||||
* Add a lock to the head of the convert or wait queue rather than the tail.
|
||||
*
|
||||
* DLM_LKF_NOORDER
|
||||
*
|
||||
* Disregard the standard grant order rules and grant a lock as soon as it
|
||||
* is compatible with other granted locks.
|
||||
*
|
||||
* DLM_LKF_ORPHAN
|
||||
*
|
||||
* not yet implemented
|
||||
*
|
||||
* DLM_LKF_ALTPR
|
||||
*
|
||||
* If the requested mode cannot be granted immediately, try to grant the lock
|
||||
* in PR mode instead. If this alternate mode is granted instead of the
|
||||
* requested mode, DLM_SBF_ALTMODE is returned in the lksb.
|
||||
*
|
||||
* DLM_LKF_ALTCW
|
||||
*
|
||||
* The same as ALTPR, but the alternate mode is CW.
|
||||
*
|
||||
* DLM_LKF_FORCEUNLOCK
|
||||
*
|
||||
* Unlock the lock even if it is converting or waiting or has sublocks.
|
||||
* Only really for use by the userland device.c code.
|
||||
*
|
||||
*/
|
||||
|
||||
#define DLM_LKF_NOQUEUE 0x00000001
|
||||
#define DLM_LKF_CANCEL 0x00000002
|
||||
#define DLM_LKF_CONVERT 0x00000004
|
||||
#define DLM_LKF_VALBLK 0x00000008
|
||||
#define DLM_LKF_QUECVT 0x00000010
|
||||
#define DLM_LKF_IVVALBLK 0x00000020
|
||||
#define DLM_LKF_CONVDEADLK 0x00000040
|
||||
#define DLM_LKF_PERSISTENT 0x00000080
|
||||
#define DLM_LKF_NODLCKWT 0x00000100
|
||||
#define DLM_LKF_NODLCKBLK 0x00000200
|
||||
#define DLM_LKF_EXPEDITE 0x00000400
|
||||
#define DLM_LKF_NOQUEUEBAST 0x00000800
|
||||
#define DLM_LKF_HEADQUE 0x00001000
|
||||
#define DLM_LKF_NOORDER 0x00002000
|
||||
#define DLM_LKF_ORPHAN 0x00004000
|
||||
#define DLM_LKF_ALTPR 0x00008000
|
||||
#define DLM_LKF_ALTCW 0x00010000
|
||||
#define DLM_LKF_FORCEUNLOCK 0x00020000
|
||||
#define DLM_LKF_TIMEOUT 0x00040000
|
||||
|
||||
/*
|
||||
* Some return codes that are not in errno.h
|
||||
*/
|
||||
|
||||
#define DLM_ECANCEL 0x10001
|
||||
#define DLM_EUNLOCK 0x10002
|
||||
|
||||
#endif /* __DLMCONSTANTS_DOT_H__ */
|
||||
|
|
@ -1,339 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
|
||||
* Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This file is released under the LGPL.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_DM_IOCTL_V4_H
|
||||
#define _LINUX_DM_IOCTL_V4_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define DM_DIR "mapper" /* Slashes not supported */
|
||||
#define DM_CONTROL_NODE "control"
|
||||
#define DM_MAX_TYPE_NAME 16
|
||||
#define DM_NAME_LEN 128
|
||||
#define DM_UUID_LEN 129
|
||||
|
||||
/*
|
||||
* A traditional ioctl interface for the device mapper.
|
||||
*
|
||||
* Each device can have two tables associated with it, an
|
||||
* 'active' table which is the one currently used by io passing
|
||||
* through the device, and an 'inactive' one which is a table
|
||||
* that is being prepared as a replacement for the 'active' one.
|
||||
*
|
||||
* DM_VERSION:
|
||||
* Just get the version information for the ioctl interface.
|
||||
*
|
||||
* DM_REMOVE_ALL:
|
||||
* Remove all dm devices, destroy all tables. Only really used
|
||||
* for debug.
|
||||
*
|
||||
* DM_LIST_DEVICES:
|
||||
* Get a list of all the dm device names.
|
||||
*
|
||||
* DM_DEV_CREATE:
|
||||
* Create a new device, neither the 'active' or 'inactive' table
|
||||
* slots will be filled. The device will be in suspended state
|
||||
* after creation, however any io to the device will get errored
|
||||
* since it will be out-of-bounds.
|
||||
*
|
||||
* DM_DEV_REMOVE:
|
||||
* Remove a device, destroy any tables.
|
||||
*
|
||||
* DM_DEV_RENAME:
|
||||
* Rename a device or set its uuid if none was previously supplied.
|
||||
*
|
||||
* DM_SUSPEND:
|
||||
* This performs both suspend and resume, depending which flag is
|
||||
* passed in.
|
||||
* Suspend: This command will not return until all pending io to
|
||||
* the device has completed. Further io will be deferred until
|
||||
* the device is resumed.
|
||||
* Resume: It is no longer an error to issue this command on an
|
||||
* unsuspended device. If a table is present in the 'inactive'
|
||||
* slot, it will be moved to the active slot, then the old table
|
||||
* from the active slot will be _destroyed_. Finally the device
|
||||
* is resumed.
|
||||
*
|
||||
* DM_DEV_STATUS:
|
||||
* Retrieves the status for the table in the 'active' slot.
|
||||
*
|
||||
* DM_DEV_WAIT:
|
||||
* Wait for a significant event to occur to the device. This
|
||||
* could either be caused by an event triggered by one of the
|
||||
* targets of the table in the 'active' slot, or a table change.
|
||||
*
|
||||
* DM_TABLE_LOAD:
|
||||
* Load a table into the 'inactive' slot for the device. The
|
||||
* device does _not_ need to be suspended prior to this command.
|
||||
*
|
||||
* DM_TABLE_CLEAR:
|
||||
* Destroy any table in the 'inactive' slot (ie. abort).
|
||||
*
|
||||
* DM_TABLE_DEPS:
|
||||
* Return a set of device dependencies for the 'active' table.
|
||||
*
|
||||
* DM_TABLE_STATUS:
|
||||
* Return the targets status for the 'active' table.
|
||||
*
|
||||
* DM_TARGET_MSG:
|
||||
* Pass a message string to the target at a specific offset of a device.
|
||||
*
|
||||
* DM_DEV_SET_GEOMETRY:
|
||||
* Set the geometry of a device by passing in a string in this format:
|
||||
*
|
||||
* "cylinders heads sectors_per_track start_sector"
|
||||
*
|
||||
* Beware that CHS geometry is nearly obsolete and only provided
|
||||
* for compatibility with dm devices that can be booted by a PC
|
||||
* BIOS. See struct hd_geometry for range limits. Also note that
|
||||
* the geometry is erased if the device size changes.
|
||||
*/
|
||||
|
||||
/*
|
||||
* All ioctl arguments consist of a single chunk of memory, with
|
||||
* this structure at the start. If a uuid is specified any
|
||||
* lookup (eg. for a DM_INFO) will be done on that, *not* the
|
||||
* name.
|
||||
*/
|
||||
struct dm_ioctl {
|
||||
/*
|
||||
* The version number is made up of three parts:
|
||||
* major - no backward or forward compatibility,
|
||||
* minor - only backwards compatible,
|
||||
* patch - both backwards and forwards compatible.
|
||||
*
|
||||
* All clients of the ioctl interface should fill in the
|
||||
* version number of the interface that they were
|
||||
* compiled with.
|
||||
*
|
||||
* All recognised ioctl commands (ie. those that don't
|
||||
* return -ENOTTY) fill out this field, even if the
|
||||
* command failed.
|
||||
*/
|
||||
__u32 version[3]; /* in/out */
|
||||
__u32 data_size; /* total size of data passed in
|
||||
* including this struct */
|
||||
|
||||
__u32 data_start; /* offset to start of data
|
||||
* relative to start of this struct */
|
||||
|
||||
__u32 target_count; /* in/out */
|
||||
__s32 open_count; /* out */
|
||||
__u32 flags; /* in/out */
|
||||
|
||||
/*
|
||||
* event_nr holds either the event number (input and output) or the
|
||||
* udev cookie value (input only).
|
||||
* The DM_DEV_WAIT ioctl takes an event number as input.
|
||||
* The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
|
||||
* use the field as a cookie to return in the DM_COOKIE
|
||||
* variable with the uevents they issue.
|
||||
* For output, the ioctls return the event number, not the cookie.
|
||||
*/
|
||||
__u32 event_nr; /* in/out */
|
||||
__u32 padding;
|
||||
|
||||
__u64 dev; /* in/out */
|
||||
|
||||
char name[DM_NAME_LEN]; /* device name */
|
||||
char uuid[DM_UUID_LEN]; /* unique identifier for
|
||||
* the block device */
|
||||
char data[7]; /* padding or data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Used to specify tables. These structures appear after the
|
||||
* dm_ioctl.
|
||||
*/
|
||||
struct dm_target_spec {
|
||||
__u64 sector_start;
|
||||
__u64 length;
|
||||
__s32 status; /* used when reading from kernel only */
|
||||
|
||||
/*
|
||||
* Location of the next dm_target_spec.
|
||||
* - When specifying targets on a DM_TABLE_LOAD command, this value is
|
||||
* the number of bytes from the start of the "current" dm_target_spec
|
||||
* to the start of the "next" dm_target_spec.
|
||||
* - When retrieving targets on a DM_TABLE_STATUS command, this value
|
||||
* is the number of bytes from the start of the first dm_target_spec
|
||||
* (that follows the dm_ioctl struct) to the start of the "next"
|
||||
* dm_target_spec.
|
||||
*/
|
||||
__u32 next;
|
||||
|
||||
char target_type[DM_MAX_TYPE_NAME];
|
||||
|
||||
/*
|
||||
* Parameter string starts immediately after this object.
|
||||
* Be careful to add padding after string to ensure correct
|
||||
* alignment of subsequent dm_target_spec.
|
||||
*/
|
||||
};
|
||||
|
||||
/*
|
||||
* Used to retrieve the target dependencies.
|
||||
*/
|
||||
struct dm_target_deps {
|
||||
__u32 count; /* Array size */
|
||||
__u32 padding; /* unused */
|
||||
__u64 dev[0]; /* out */
|
||||
};
|
||||
|
||||
/*
|
||||
* Used to get a list of all dm devices.
|
||||
*/
|
||||
struct dm_name_list {
|
||||
__u64 dev;
|
||||
__u32 next; /* offset to the next record from
|
||||
the _start_ of this */
|
||||
char name[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* Used to retrieve the target versions
|
||||
*/
|
||||
struct dm_target_versions {
|
||||
__u32 next;
|
||||
__u32 version[3];
|
||||
|
||||
char name[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* Used to pass message to a target
|
||||
*/
|
||||
struct dm_target_msg {
|
||||
__u64 sector; /* Device sector */
|
||||
|
||||
char message[0];
|
||||
};
|
||||
|
||||
/*
|
||||
* If you change this make sure you make the corresponding change
|
||||
* to dm-ioctl.c:lookup_ioctl()
|
||||
*/
|
||||
enum {
|
||||
/* Top level cmds */
|
||||
DM_VERSION_CMD = 0,
|
||||
DM_REMOVE_ALL_CMD,
|
||||
DM_LIST_DEVICES_CMD,
|
||||
|
||||
/* device level cmds */
|
||||
DM_DEV_CREATE_CMD,
|
||||
DM_DEV_REMOVE_CMD,
|
||||
DM_DEV_RENAME_CMD,
|
||||
DM_DEV_SUSPEND_CMD,
|
||||
DM_DEV_STATUS_CMD,
|
||||
DM_DEV_WAIT_CMD,
|
||||
|
||||
/* Table level cmds */
|
||||
DM_TABLE_LOAD_CMD,
|
||||
DM_TABLE_CLEAR_CMD,
|
||||
DM_TABLE_DEPS_CMD,
|
||||
DM_TABLE_STATUS_CMD,
|
||||
|
||||
/* Added later */
|
||||
DM_LIST_VERSIONS_CMD,
|
||||
DM_TARGET_MSG_CMD,
|
||||
DM_DEV_SET_GEOMETRY_CMD
|
||||
};
|
||||
|
||||
#define DM_IOCTL 0xfd
|
||||
|
||||
#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
|
||||
#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
|
||||
#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
|
||||
#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
|
||||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 23
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
#define DM_SUSPEND_FLAG (1 << 1) /* In/Out */
|
||||
#define DM_PERSISTENT_DEV_FLAG (1 << 3) /* In */
|
||||
|
||||
/*
|
||||
* Flag passed into ioctl STATUS command to get table information
|
||||
* rather than current status.
|
||||
*/
|
||||
#define DM_STATUS_TABLE_FLAG (1 << 4) /* In */
|
||||
|
||||
/*
|
||||
* Flags that indicate whether a table is present in either of
|
||||
* the two table slots that a device has.
|
||||
*/
|
||||
#define DM_ACTIVE_PRESENT_FLAG (1 << 5) /* Out */
|
||||
#define DM_INACTIVE_PRESENT_FLAG (1 << 6) /* Out */
|
||||
|
||||
/*
|
||||
* Indicates that the buffer passed in wasn't big enough for the
|
||||
* results.
|
||||
*/
|
||||
#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
|
||||
|
||||
/*
|
||||
* This flag is now ignored.
|
||||
*/
|
||||
#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
|
||||
|
||||
/*
|
||||
* Set this to avoid attempting to freeze any filesystem when suspending.
|
||||
*/
|
||||
#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
|
||||
|
||||
/*
|
||||
* Set this to suspend without flushing queued ios.
|
||||
* Also disables flushing uncommitted changes in the thin target before
|
||||
* generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
|
||||
*/
|
||||
#define DM_NOFLUSH_FLAG (1 << 11) /* In */
|
||||
|
||||
/*
|
||||
* If set, any table information returned will relate to the inactive
|
||||
* table instead of the live one. Always check DM_INACTIVE_PRESENT_FLAG
|
||||
* is set before using the data returned.
|
||||
*/
|
||||
#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */
|
||||
|
||||
/*
|
||||
* If set, a uevent was generated for which the caller may need to wait.
|
||||
*/
|
||||
#define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */
|
||||
|
||||
/*
|
||||
* If set, rename changes the uuid not the name. Only permitted
|
||||
* if no uuid was previously supplied: an existing uuid cannot be changed.
|
||||
*/
|
||||
#define DM_UUID_FLAG (1 << 14) /* In */
|
||||
|
||||
/*
|
||||
* If set, all buffers are wiped after use. Use when sending
|
||||
* or requesting sensitive data such as an encryption key.
|
||||
*/
|
||||
#define DM_SECURE_DATA_FLAG (1 << 15) /* In */
|
||||
|
||||
#endif /* _LINUX_DM_IOCTL_H */
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue