ned long args[32]; } cdkctrl_t; /* * Each device on the slave passes data to and from the host via a ring * queue in shared memory. Define a ring queue structure to hold the * vital information about each ring queue. Two ring queues will be * allocated for each port, one for receive data and one for transmit * data. */ typedef struct cdkasyrq { unsigned long offset; unsigned short size; unsigned short head; unsigned short tail; } cdkasyrq_t; /* * Each asynchronous port is defined in shared memory by the following * structure. It contains a control block to command a device, and also * the necessary data channel information as well. */ typedef struct cdkasy { cdkctrl_t ctrl; unsigned short notify; asynotify_t changed; unsigned short receive; cdkasyrq_t rxq; unsigned short transmit; cdkasyrq_t txq; } cdkasy_t; #pragma pack() /*****************************************************************************/ /* * Define the set of ioctls used by the driver to do special things * to the boBard. These include interrupting it, and initializing * the driver after board startup and shutdown. */ #include #define STL_BINTR _IO('s',20) #define STL_BSTART _IO('s',21) #define STL_BSTOP _IO('s',22) #define STL_BRESET _IO('s',23) /* * Define a set of ioctl extensions, used to get at special stuff. */ #define STL_GETPFLAG _IO('s',80) #define STL_SETPFLAG _IO('s',81) /*****************************************************************************/ #endif /*****************************************************************************/ /* * usbdevice_fs.h -- USB device file system. * * Copyright (C) 2000 * Thomas Sailer (sailer@ife.ee.ethz.ch) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * History: * 0.1 04.01.2000 Created */ /*****************************************************************************/ #ifndef _LINUX_USBDEVICE_FS_H #define _LINUX_USBDEVICE_FS_H #include #include /* --------------------------------------------------------------------- */ /* usbdevfs ioctl codes */ struct usbdevfs_ctrltransfer { __u8 bRequestType; __u8 bRequest; __u16 wValue; __u16 wIndex; __u16 wLength; __u32 timeout; /* in milliseconds */ void *data; }; struct usbdevfs_bulktransfer { unsigned int ep; unsigned int len; unsigned int timeout; /* in milliseconds */ void *data; }; struct usbdevfs_setinterface { unsigned int interface; unsigned int altsetting; }; struct usbdevfs_disconnectsignal { unsigned int signr; void *context; }; #define USBDEVFS_MAXDRIVERNAME 255 struct usbdevfs_getdriver { unsigned int interface; char driver[USBDEVFS_MAXDRIVERNAME + 1]; }; struct usbdevfs_connectinfo { unsigned int devnum; unsigned char slow; }; #define USBDEVFS_URB_SHORT_NOT_OK 0x01 #define USBDEVFS_URB_ISO_ASAP 0x02 #define USBDEVFS_URB_BULK_CONTINUATION 0x04 #define USBDEVFS_URB_NO_FSBR 0x20 #define USBDEVFS_URB_ZERO_PACKET 0x40 #define USBDEVFS_URB_NO_INTERRUPT 0x80 #define USBDEVFS_URB_TYPE_ISO 0 #define USBDEVFS_URB_TYPE_INTERRUPT 1 #define USBDEVFS_URB_TYPE_CONTROL 2 #define USBDEVFS_URB_TYPE_BULK 3 struct usbdevfs_iso_packet_desc { unsigned int length; unsigned int actual_length; unsigned int status; }; struct usbdevfs_urb { unsigned char type; unsigned char endpoint; int status; unsigned int flags; void *buffer; int buffer_length; int actual_length; int start_frame; int number_of_packets; int error_count; unsigned int signr; /* signal to be sent on completion, or 0 if none should be sent. */ void *usercontext; struct usbdevfs_iso_packet_desc iso_frame_desc[0]; }; /* ioctls for talking directly to drivers */ struct usbdevfs_ioctl { int ifno; /* interface 0..N ; negative numbers reserved */ int ioctl_code; /* MUST encode size + direction of data so the * macros in give correct values */ void *data; /* param buffer (in, or out) */ }; /* You can do most things with hubs just through control messages, * except find out what device connects to what port. */ struct usbdevfs_hub_portinfo { char nports; /* number of downstream ports in this hub */ char port [127]; /* e.g. port 3 connects to device 27 */ }; #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32) #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32) #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) #define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver) #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb) #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) #define USBDEVFS_DISCARDURB _IO('U', 11) #define USBDEVFS_REAPURB _IOW('U', 12, void *) #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32) #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) #define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32) #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) #define USBDEVFS_RESET _IO('U', 20) #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) #define USBDEVFS_DISCONNECT _IO('U', 22) #define USBDEVFS_CONNECT _IO('U', 23) #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) #endif /* _LINUX_USBDEVICE_FS_H */ #ifndef __LINUX_DECNET_NETFILTER_H #define __LINUX_DECNET_NETFILTER_H /* DECnet-specific defines for netfilter. * This file (C) Steve Whitehouse 1999 derived from the * ipv4 netfilter header file which is * (C)1998 Rusty Russell -- This code is GPL. */ #include /* only for userspace compatibility */ /* IP Cache bits. */ /* Src IP address. */ #define NFC_DN_SRC 0x0001 /* Dest IP address. */ #define NFC_DN_DST 0x0002 /* Input device. */ #define NFC_DN_IF_IN 0x0004 /* Output device. */ #define NFC_DN_IF_OUT 0x0008 /* DECnet Hooks */ /* After promisc drops, checksum checks. */ #define NF_DN_PRE_ROUTING 0 /* If the packet is destined for this box. */ #define NF_DN_LOCAL_IN 1 /* If the packet is destined for another interface. */ #define NF_DN_FORWARD 2 /* Packets coming from a local process. */ #define NF_DN_LOCAL_OUT 3 /* Packets about to hit the wire. */ #define NF_DN_POST_ROUTING 4 /* Input Hello Packets */ #define NF_DN_HELLO 5 /* Input Routing Packets */ #define NF_DN_ROUTE 6 #define NF_DN_NUMHOOKS 7 enum nf_dn_hook_priorities { NF_DN_PRI_FIRST = INT_MIN, NF_DN_PRI_CONNTRACK = -200, NF_DN_PRI_MANGLE = -150, NF_DN_PRI_NAT_DST = -100, NF_DN_PRI_FILTER = 0, NF_DN_PRI_NAT_SRC = 100, NF_DN_PRI_DNRTMSG = 200, NF_DN_PRI_LAST = INT_MAX, }; struct nf_dn_rtmsg { int nfdn_ifindex; }; #define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg))) /* backwards compatibility for userspace */ #define DNRMG_L1_GROUP 0x01 #define DNRMG_L2_GROUP 0x02 enum { DNRNG_NLGRP_NONE, #define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE DNRNG_NLGRP_L1, #define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1 DNRNG_NLGRP_L2, #define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2 __DNRNG_NLGRP_MAX }; #define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1) #endif /*__LINUX_DECNET_NETFILTER_H*/ /* * JFFS2 -- Journalling Flash File System, Version 2. * * Copyright © 2001-2007 Red Hat, Inc. * Copyright © 2004-2010 David Woodhouse * * Created by David Woodhouse * * For licensing information, see the file 'LICENCE' in the * jffs2 directory. */ #ifndef __LINUX_JFFS2_H__ #define __LINUX_JFFS2_H__ #include #include /* You must include something which defines the C99 uintXX_t types. We don't do it from here because this file is used in too many different environments. */ /* Values we may expect to find in the 'magic' field */ #define JFFS2_OLD_MAGIC_BITMASK 0x1984 #define JFFS2_MAGIC_BITMASK 0x1985 #define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */ #define JFFS2_EMPTY_BITMASK 0xffff #define JFFS2_DIRTY_BITMASK 0x0000 /* Summary node MAGIC marker */ #define JFFS2_SUM_MAGIC 0x02851885 /* We only allow a single char for length, and 0xFF is empty flash so we don't want it confused with a real length. Hence max 254. */ #define JFFS2_MAX_NAME_LEN 254 /* How small can we sensibly write nodes? */ #define JFFS2_MIN_DATA_LEN 128 #define JFFS2_COMPR_NONE 0x00 #define JFFS2_COMPR_ZERO 0x01 #define JFFS2_COMPR_RTIME 0x02 #define JFFS2_COMPR_RUBINMIPS 0x03 #define JFFS2_COMPR_COPY 0x04 #define JFFS2_COMPR_DYNRUBIN 0x05 #define JFFS2_COMPR_ZLIB 0x06 #define JFFS2_COMPR_LZO 0x07 /* Compatibility flags. */ #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ #define JFFS2_NODE_ACCURATE 0x2000 /* INCOMPAT: Fail to mount the filesystem */ #define JFFS2_FEATURE_INCOMPAT 0xc000 /* ROCOMPAT: Mount read-only */ #define JFFS2_FEATURE_ROCOMPAT 0x8000 /* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */ #define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000 /* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */ #define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000 #define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1) #define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2) #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) #define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8) #define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9) /* XATTR Related */ #define JFFS2_XPREFIX_USER 1 /* for "user." */ #define JFFS2_XPREFIX_SECURITY 2 /* for "security." */ #define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */ #define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */ #define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */ #define JFFS2_ACL_VERSION 0x0001 // Maybe later... //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) #define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at mount time, don't wait for it to happen later */ #define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific compression type */ /* These can go once we've made sure we've caught all uses without byteswapping */ typedef struct { __u32 v32; } __attribute__((packed)) jint32_t; typedef struct { __u32 m; } __attribute__((packed)) jmode_t; typedef struct { __u16 v16; } __attribute__((packed)) jint16_t; struct jffs2_unknown_node { /* All start like this */ jint16_t magic; jint16_t nodetype; jint32_t totlen; /* So we can skip over nodes we don't grok */ jint32_t hdr_crc; }; struct jffs2_raw_dirent { jint16_t magic; jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */ jint32_t totlen; jint32_t hdr_crc; jint32_t pino; jint32_t version; jint32_t ino; /* == zero for unlink */ jint32_t mctime; __u8 nsize; __u8 type; __u8 unused[2]; jint32_t node_crc; jint32_t name_crc; __u8 name[0]; }; /* The JFFS2 raw inode structure: Used for storage on physical media. */ /* The uid, gid, atime, mtime and ctime members could be longer, but are left like this for space efficiency. If and when people decide they really need them extended, it's simple enough to add support for a new type of raw node. */ struct jffs2_raw_inode { jint16_t magic; /* A constant magic number. */ jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ jint32_t totlen; /* Total length of this node (inc data, etc.) */ jint32_t hdr_crc; jint32_t ino; /* Inode number. */ jint32_t version; /* Version number. */ jmode_t mode; /* The file's type or mode. */ jint16_t uid; /* The file's owner. */ jint16_t gid; /* The file's group. */ jint32_t isize; /* Total resultant size of this inode (used for truncations) */ jint32_t atime; /* Last access time. */ jint32_t mtime; /* Last modification time. */ jint32_t ctime; /* Change time. */ jint32_t offset; /* Where to begin to write. */ jint32_t csize; /* (Compressed) data size */ jint32_t dsize; /* Size of the node's data. (after decompression) */ __u8 compr; /* Compression algorithm used */ __u8 usercompr; /* Compression algorithm requested by the user */ jint16_t flags; /* See JFFS2_INO_FLAG_* */ jint32_t data_crc; /* CRC for the (compressed) data. */ jint32_t node_crc; /* CRC for the raw inode (excluding data) */ __u8 data[0]; }; struct jffs2_raw_xattr { jint16_t magic; jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */ jint32_t totlen; jint32_t hdr_crc; jint32_t xid; /* XATTR identifier number */ jint32_t version; __u8 xprefix; __u8 name_len; jint16_t value_len; jint32_t data_crc; jint32_t node_crc; __u8 data[0]; } __attribute__((packed)); struct jffs2_raw_xref { jint16_t magic; jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */ jint32_t totlen; jint32_t hdr_crc; jint32_t ino; /* inode number */ jint32_t xid; /* XATTR identifier number */ jint32_t xseqno; /* xref sequential number */ jint32_t node_crc; } __attribute__((packed)); struct jffs2_raw_summary { jint16_t magic; jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */ jint32_t totlen; jint32_t hdr_crc; jint32_t sum_num; /* number of sum entries*/ jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */ jint32_t padded; /* sum of the size of padding nodes */ jint32_t sum_crc; /* summary information crc */ jint32_t node_crc; /* node crc */ jint32_t sum[0]; /* inode summary info */ }; union jffs2_node_union { struct jffs2_raw_inode i; struct jffs2_raw_dirent d; struct jffs2_raw_xattr x; struct jffs2_raw_xref r; struct jffs2_raw_summary s; struct jffs2_unknown_node u; }; /* Data payload for device nodes. */ union jffs2_device_node { jint16_t old_id; jint32_t new_id; }; #endif /* __LINUX_JFFS2_H__ */ /* $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 #include #include /* * 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 *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__ */ #ifndef __LINUX_NEIGHBOUR_H #define __LINUX_NEIGHBOUR_H #include #include struct ndmsg { __u8 ndm_family; __u8 ndm_pad1; __u16 ndm_pad2; __s32 ndm_ifindex; __u16 ndm_state; __u8 ndm_flags; __u8 ndm_type; }; enum { NDA_UNSPEC, NDA_DST, NDA_LLADDR, NDA_CACHEINFO, NDA_PROBES, __NDA_MAX }; #define NDA_MAX (__NDA_MAX - 1) /* * Neighbor Cache Entry Flags */ #define NTF_USE 0x01 #define NTF_PROXY 0x08 /* == ATF_PUBL */ #define NTF_ROUTER 0x80 /* * Neighbor Cache Entry States. */ #define NUD_INCOMPLETE 0x01 #define NUD_REACHABLE 0x02 #define NUD_STALE 0x04 #define NUD_DELAY 0x08 #define NUD_PROBE 0x10 #define NUD_FAILED 0x20 /* Dummy states */ #define NUD_NOARP 0x40 #define NUD_PERMANENT 0x80 #define NUD_NONE 0x00 /* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change and make no address resolution or NUD. NUD_PERMANENT is also cannot be deleted by garbage collectors. */ struct nda_cacheinfo { __u32 ndm_confirmed; __u32 ndm_used; __u32 ndm_updated; __u32 ndm_refcnt; }; /***************************************************************** * Neighbour tables specific messages. * * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the * NLM_F_DUMP flag set. Every neighbour table configuration is * spread over multiple messages to avoid running into message * size limits on systems with many interfaces. The first message * in the sequence transports all not device specific data such as * statistics, configuration, and the default parameter set. * This message is followed by 0..n messages carrying device * specific parameter sets. * Although the ordering should be sufficient, NDTA_NAME can be * used to identify sequences. The initial message can be identified * by checking for NDTA_CONFIG. The device specific messages do * not contain this TLV but have NDTPA_IFINDEX set to the * corresponding interface index. * * To change neighbour table attributes, send RTM_SETNEIGHTBL * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked * otherwise. Device specific parameter sets can be changed by * setting NDTPA_IFINDEX to the interface index of the corresponding * device. ****/ struct ndt_stats { __u64 ndts_allocs; __u64 ndts_destroys; __u64 ndts_hash_grows; __u64 ndts_res_failed; __u64 ndts_lookups; __u64 ndts_hits; __u64 ndts_rcv_probes_mcast; __u64 ndts_rcv_probes_ucast; __u64 ndts_periodic_gc_runs; __u64 ndts_forced_gc_runs; }; enum { NDTPA_UNSPEC, NDTPA_IFINDEX, /* u32, unchangeable */ NDTPA_REFCNT, /* u32, read-only */ NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ NDTPA_RETRANS_TIME, /* u64, msecs */ NDTPA_GC_STALETIME, /* u64, msecs */ NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ NDTPA_QUEUE_LEN, /* u32 */ NDTPA_APP_PROBES, /* u32 */ NDTPA_UCAST_PROBES, /* u32 */ NDTPA_MCAST_PROBES, /* u32 */ NDTPA_ANYCAST_DELAY, /* u64, msecs */ NDTPA_PROXY_DELAY, /* u64, msecs */ NDTPA_PROXY_QLEN, /* u32 */ NDTPA_LOCKTIME, /* u64, msecs */ __NDTPA_MAX }; #define NDTPA_MAX (__NDTPA_MAX - 1) struct ndtmsg { __u8 ndtm_family; __u8 ndtm_pad1; __u16 ndtm_pad2; }; struct ndt_config { __u16 ndtc_key_len; __u16 ndtc_entry_size; __u32 ndtc_entries; __u32 ndtc_last_flush; /* delta to now in msecs */ __u32 ndtc_last_rand; /* delta to now in msecs */ __u32 ndtc_hash_rnd; __u32 ndtc_hash_mask; __u32 ndtc_hash_chain_gc; __u32 ndtc_proxy_qlen; }; enum { NDTA_UNSPEC, NDTA_NAME, /* char *, unchangeable */ NDTA_THRESH1, /* u32 */ NDTA_THRESH2, /* u32 */ NDTA_THRESH3, /* u32 */ NDTA_CONFIG, /* struct ndt_config, read-only */ NDTA_PARMS, /* nested TLV NDTPA_* */ NDTA_STATS, /* struct ndt_stats, read-only */ NDTA_GC_INTERVAL, /* u64, msecs */ __NDTA_MAX }; #define NDTA_MAX (__NDTA_MAX - 1) #endif /* * 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 #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. * * 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 18 #define DM_VERSION_PATCHLEVEL 0 #define DM_VERSION_EXTRA "-ioctl (2010-06-29)" /* 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. */ #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 */ #endif /* _LINUX_DM_IOCTL_H */ /* * Linux WiMax * API for user space * * * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * Intel Corporation * Inaky Perez-Gonzalez * - Initial implementation * * * This file declares the user/kernel protocol that is spoken over * Generic Netlink, as well as any type declaration that is to be used * by kernel and user space. * * It is intended for user space to clone it verbatim to use it as a * primary reference for definitions. * * Stuff intended for kernel usage as well as full protocol and stack * documentation is rooted in include/net/wimax.h. */ #ifndef __LINUX__WIMAX_H__ #define __LINUX__WIMAX_H__ #include enum { /** * Version of the interface (unsigned decimal, MMm, max 25.5) * M - Major: change if removing or modifying an existing call. * m - minor: change when adding a new call */ WIMAX_GNL_VERSION = 01, /* Generic NetLink attributes */ WIMAX_GNL_ATTR_INVALID = 0x00, WIMAX_GNL_ATTR_MAX = 10, }; /* * Generic NetLink operations * * Most of these map to an API call; _OP_ stands for operation, _RP_ * for reply and _RE_ for report (aka: signal). */ enum { WIMAX_GNL_OP_MSG_FROM_USER, /* User to kernel message */ WIMAX_GNL_OP_MSG_TO_USER, /* Kernel to user message */ WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */ WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */ WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */ WIMAX_GNL_OP_STATE_GET, /* Request for current state */ }; /* Message from user / to user */ enum { WIMAX_GNL_MSG_IFIDX = 1, WIMAX_GNL_MSG_PIPE_NAME, WIMAX_GNL_MSG_DATA, }; /* * wimax_rfkill() * * The state of the radio (ON/OFF) is mapped to the rfkill subsystem's * switch state (DISABLED/ENABLED). */ enum wimax_rf_state { WIMAX_RF_OFF = 0, /* Radio is off, rfkill on/enabled */ WIMAX_RF_ON = 1, /* Radio is on, rfkill off/disabled */ WIMAX_RF_QUERY = 2, }; /* Attributes */ enum { WIMAX_GNL_RFKILL_IFIDX = 1, WIMAX_GNL_RFKILL_STATE, }; /* Attributes for wimax_reset() */ enum { WIMAX_GNL_RESET_IFIDX = 1, }; /* Atributes for wimax_state_get() */ enum { WIMAX_GNL_STGET_IFIDX = 1, }; /* * Attributes for the Report State Change * * For now we just have the old and new states; new attributes might * be added later on. */ enum { WIMAX_GNL_STCH_IFIDX = 1, WIMAX_GNL_STCH_STATE_OLD, WIMAX_GNL_STCH_STATE_NEW, }; /** * enum wimax_st - The different states of a WiMAX device * @__WIMAX_ST_NULL: The device structure has been allocated and zeroed, * but still wimax_dev_add() hasn't been called. There is no state. * * @WIMAX_ST_DOWN: The device has been registered with the WiMAX and * networking stacks, but it is not initialized (normally that is * done with 'ifconfig DEV up' [or equivalent], which can upload * firmware and enable communications with the device). * In this state, the device is powered down and using as less * power as possible. * This state is the default after a call to wimax_dev_add(). It * is ok to have drivers move directly to %WIMAX_ST_UNINITIALIZED * or %WIMAX_ST_RADIO_OFF in _probe() after the call to * wimax_dev_add(). * It is recommended that the driver leaves this state when * calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV * down'. * * @__WIMAX_ST_QUIESCING: The device is being torn down, so no API * operations are allowed to proceed except the ones needed to * complete the device clean up process. * * @WIMAX_ST_UNINITIALIZED: [optional] Communication with the device * is setup, but the device still requires some configuration * before being operational. * Some WiMAX API calls might work. * * @WIMAX_ST_RADIO_OFF: The device is fully up; radio is off (wether * by hardware or software switches). * It is recommended to always leave the device in this state * after initialization. * * @WIMAX_ST_READY: The device is fully up and radio is on. * * @WIMAX_ST_SCANNING: [optional] The device has been instructed to * scan. In this state, the device cannot be actively connected to * a network. * * @WIMAX_ST_CONNECTING: The device is connecting to a network. This * state exists because in some devices, the connect process can * include a number of negotiations between user space, kernel * space and the device. User space needs to know what the device * is doing. If the connect sequence in a device is atomic and * fast, the device can transition directly to CONNECTED * * @WIMAX_ST_CONNECTED: The device is connected to a network. * * @__WIMAX_ST_INVALID: This is an invalid state used to mark the * maximum numeric value of states. * * Description: * * Transitions from one state to another one are atomic and can only * be caused in kernel space with wimax_state_change(). To read the * state, use wimax_state_get(). * * States starting with __ are internal and shall not be used or * referred to by drivers or userspace. They look ugly, but that's the * point -- if any use is made non-internal to the stack, it is easier * to catch on review. * * All API operations [with well defined exceptions] will take the * device mutex before starting and then check the state. If the state * is %__WIMAX_ST_NULL, %WIMAX_ST_DOWN, %WIMAX_ST_UNINITIALIZED or * %__WIMAX_ST_QUIESCING, it will drop the lock and quit with * -%EINVAL, -%ENOMEDIUM, -%ENOTCONN or -%ESHUTDOWN. * * The order of the definitions is important, so we can do numerical * comparisons (eg: < %WIMAX_ST_RADIO_OFF means the device is not ready * to operate). */ /* * The allowed state transitions are described in the table below * (states in rows can go to states in columns where there is an X): * * UNINI RADIO READY SCAN CONNEC CONNEC * NULL DOWN QUIESCING TIALIZED OFF NING TING TED * NULL - x * DOWN - x x x * QUIESCING x - * UNINITIALIZED x - x * RADIO_OFF x - x * READY x x - x x x * SCANNING x x x - x x * CONNECTING x x x x - x * CONNECTED x x x - * * This table not available in kernel-doc because the formatting messes it up. */ enum wimax_st { __WIMAX_ST_NULL = 0, WIMAX_ST_DOWN, __WIMAX_ST_QUIESCING, WIMAX_ST_UNINITIALIZED, WIMAX_ST_RADIO_OFF, WIMAX_ST_READY, WIMAX_ST_SCANNING, WIMAX_ST_CONNECTING, WIMAX_ST_CONNECTED, __WIMAX_ST_INVALID /* Always keep last */ }; #endif /* #ifndef __LINUX__WIMAX_H__ */ /* * Intel Multimedia Timer device interface * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. * * This file should define an interface compatible with the IA-PC Multimedia * Timers Draft Specification (rev. 0.97) from Intel. Note that some * hardware may not be able to safely export its registers to userspace, * so the ioctl interface should support all necessary functionality. * * 11/01/01 - jbarnes - initial revision * 9/10/04 - Christoph Lameter - remove interrupt support * 9/17/04 - jbarnes - remove test program, move some #defines to the driver */ #ifndef _LINUX_MMTIMER_H #define _LINUX_MMTIMER_H /* * Breakdown of the ioctl's available. An 'optional' next to the command * indicates that supporting this command is optional, while 'required' * commands must be implemented if conformance is desired. * * MMTIMER_GETOFFSET - optional * Should return the offset (relative to the start of the page where the * registers are mapped) for the counter in question. * * MMTIMER_GETRES - required * The resolution of the clock in femto (10^-15) seconds * * MMTIMER_GETFREQ - required * Frequency of the clock in Hz * * MMTIMER_GETBITS - required * Number of bits in the clock's counter * * MMTIMER_MMAPAVAIL - required * Returns nonzero if the registers can be mmap'd into userspace, 0 otherwise * * MMTIMER_GETCOUNTER - required * Gets the current value in the counter */ #define MMTIMER_IOCTL_BASE 'm' #define MMTIMER_GETOFFSET _IO(MMTIMER_IOCTL_BASE, 0) #define MMTIMER_GETRES _IOR(MMTIMER_IOCTL_BASE, 1, unsigned long) #define MMTIMER_GETFREQ _IOR(MMTIMER_IOCTL_BASE, 2, unsigned long) #define MMTIMER_GETBITS _IO(MMTIMER_IOCTL_BASE, 4) #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6) #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long) #endif /* _LINUX_MMTIMER_H */ /* cgroupstats.h - exporting per-cgroup statistics * * Copyright IBM Corporation, 2007 * Author Balbir Singh * * 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 #include /* * 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 */ /* You may distribute this file under either of the two licenses that follow at your discretion. */ /* BLURB lgpl Coda File System Release 5 Copyright (c) 1987-1999 Carnegie Mellon University Additional copyrights listed below This code is distributed "AS IS" without warranty of any kind under the terms of the GNU Library General Public Licence Version 2, as shown in the file LICENSE, or under the license shown below. The technical and financial contributors to Coda are listed in the file CREDITS. Additional copyrights */ /* Coda: an Experimental Distributed File System Release 4.0 Copyright (c) 1987-1999 Carnegie Mellon University All Rights Reserved Permission to use, copy, modify and distribute this software and its documentation is hereby granted, provided that both the copyright notice and this permission notice appear in all copies of the software, derivative works or modified versions, and any portions thereof, and that both notices appear in supporting documentation, and that credit is given to Carnegie Mellon University in all documents and publicity pertaining to direct or indirect use of this code or its derivatives. CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS, SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF ANY DERIVATIVE WORK. Carnegie Mellon encourages users of this software to return any improvements or extensions that they make, and to grant Carnegie Mellon the rights to redistribute these changes without encumbrance. */ /* * * Based on cfs.h from Mach, but revamped for increased simplicity. * Linux modifications by * Peter Braam, Aug 1996 */ #ifndef _CODA_HEADER_ #define _CODA_HEADER_ /* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ #if defined(__NetBSD__) || \ ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)) #include #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 typedef unsigned long long u_quad_t; #endif /* !KERNEL */ #endif /* !DJGPP */ #if defined(__linux__) #include #define cdev_t u_quad_t #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2) #define _UQUAD_T_ 1 typedef unsigned long long u_quad_t; #endif #else #define cdev_t dev_t #endif #ifdef __CYGWIN32__ struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; #endif #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ typedef signed char int8_t; typedef unsigned char u_int8_t; typedef short int16_t; typedef unsigned short u_int16_t; typedef int int32_t; typedef unsigned int u_int32_t; #endif /* * Cfs constants */ #define CODA_MAXNAMLEN 255 #define CODA_MAXPATHLEN 1024 #define CODA_MAXSYMLINK 10 /* these are Coda's version of O_RDONLY etc combinations * to deal with VFS open modes */ #define C_O_READ 0x001 #define C_O_WRITE 0x002 #define C_O_TRUNC 0x010 #define C_O_EXCL 0x100 #define C_O_CREAT 0x200 /* these are to find mode bits in Venus */ #define C_M_READ 00400 #define C_M_WRITE 00200 /* for access Venus will use */ #define C_A_C_OK 8 /* Test for writing upon create. */ #define C_A_R_OK 4 /* Test for read permission. */ #define C_A_W_OK 2 /* Test for write permission. */ #define C_A_X_OK 1 /* Test for execute permission. */ #define C_A_F_OK 0 /* Test for existence. */ #ifndef _VENUS_DIRENT_T_ #define _VENUS_DIRENT_T_ 1 struct venus_dirent { u_int32_t d_fileno; /* file number of entry */ u_int16_t d_reclen; /* length of this record */ u_int8_t d_type; /* file type, see below */ u_int8_t d_namlen; /* length of string in d_name */ char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */ }; #undef DIRSIZ #define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \ (((dp)->d_namlen+1 + 3) &~ 3)) /* * File types */ #define CDT_UNKNOWN 0 #define CDT_FIFO 1 #define CDT_CHR 2 #define CDT_DIR 4 #define CDT_BLK 6 #define CDT_REG 8 #define CDT_LNK 10 #define CDT_SOCK 12 #define CDT_WHT 14 /* * Convert between stat structure types and directory types. */ #define IFTOCDT(mode) (((mode) & 0170000) >> 12) #define CDTTOIF(dirtype) ((dirtype) << 12) #endif #ifndef _VUID_T_ #define _VUID_T_ typedef u_int32_t vuid_t; typedef u_int32_t vgid_t; #endif /*_VUID_T_ */ struct CodaFid { u_int32_t opaque[4]; }; #define coda_f2i(fid)\ (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0) #ifndef _VENUS_VATTR_T_ #define _VENUS_VATTR_T_ /* * Vnode types. VNON means no type. */ enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; struct coda_vattr { long va_type; /* vnode type (for create) */ u_short va_mode; /* files access mode and type */ short va_nlink; /* number of references to file */ vuid_t va_uid; /* owner user id */ vgid_t va_gid; /* owner group id */ long va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ long va_blocksize; /* blocksize preferred for i/o */ struct timespec va_atime; /* time of last access */ struct timespec va_mtime; /* time of last modification */ struct timespec va_ctime; /* time file changed */ u_long va_gen; /* generation number of file */ u_long va_flags; /* flags defined for file */ cdev_t va_rdev; /* device special file represents */ u_quad_t va_bytes; /* bytes of disk space held by file */ u_quad_t va_filerev; /* file modification number */ }; #endif /* structure used by CODA_STATFS for getting cache information from venus */ struct coda_statfs { int32_t f_blocks; int32_t f_bfree; int32_t f_bavail; int32_t f_files; int32_t f_ffree; }; /* * Kernel <--> Venus communications. */ #define CODA_ROOT 2 #define CODA_OPEN_BY_FD 3 #define CODA_OPEN 4 #define CODA_CLOSE 5 #define CODA_IOCTL 6 #define CODA_GETATTR 7 #define CODA_SETATTR 8 #define CODA_ACCESS 9 #define CODA_LOOKUP 10 #define CODA_CREATE 11 #define CODA_REMOVE 12 #define CODA_LINK 13 #define CODA_RENAME 14 #define CODA_MKDIR 15 #define CODA_RMDIR 16 #define CODA_SYMLINK 18 #define CODA_READLINK 19 #define CODA_FSYNC 20 #define CODA_VGET 22 #define CODA_SIGNAL 23 #define CODA_REPLACE 24 /* DOWNCALL */ #define CODA_FLUSH 25 /* DOWNCALL */ #define CODA_PURGEUSER 26 /* DOWNCALL */ #define CODA_ZAPFILE 27 /* DOWNCALL */ #define CODA_ZAPDIR 28 /* DOWNCALL */ #define CODA_PURGEFID 30 /* DOWNCALL */ #define CODA_OPEN_BY_PATH 31 #define CODA_RESOLVE 32 #define CODA_REINTEGRATE 33 #define CODA_STATFS 34 #define CODA_STORE 35 #define CODA_RELEASE 36 #define CODA_NCALLS 37 #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) #define VC_MAXDATASIZE 8192 #define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ VC_MAXDATASIZE #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) #define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ /* * Venus <-> Coda RPC arguments */ struct coda_in_hdr { u_int32_t opcode; u_int32_t unique; /* Keep multiple outstanding msgs distinct */ pid_t pid; pid_t pgid; vuid_t uid; }; /* Really important that opcode and unique are 1st two fields! */ struct coda_out_hdr { u_int32_t opcode; u_int32_t unique; u_int32_t result; }; /* coda_root: NO_IN */ struct coda_root_out { struct coda_out_hdr oh; struct CodaFid VFid; }; struct coda_root_in { struct coda_in_hdr in; }; /* coda_open: */ struct coda_open_in { struct coda_in_hdr ih; struct CodaFid VFid; int flags; }; struct coda_open_out { struct coda_out_hdr oh; cdev_t dev; ino_t inode; }; /* coda_store: */ struct coda_store_in { struct coda_in_hdr ih; struct CodaFid VFid; int flags; }; struct coda_store_out { struct coda_out_hdr out; }; /* coda_release: */ struct coda_release_in { struct coda_in_hdr ih; struct CodaFid VFid; int flags; }; struct coda_release_out { struct coda_out_hdr out; }; /* coda_close: */ struct coda_close_in { struct coda_in_hdr ih; struct CodaFid VFid; int flags; }; struct coda_close_out { struct coda_out_hdr out; }; /* coda_ioctl: */ struct coda_ioctl_in { struct coda_in_hdr ih; struct CodaFid VFid; int cmd; int len; int rwflag; char *data; /* Place holder for data. */ }; struct coda_ioctl_out { struct coda_out_hdr oh; int len; caddr_t data; /* Place holder for data. */ }; /* coda_getattr: */ struct coda_getattr_in { struct coda_in_hdr ih; struct CodaFid VFid; }; struct coda_getattr_out { struct coda_out_hdr oh; struct coda_vattr attr; }; /* coda_setattr: NO_OUT */ struct coda_setattr_in { struct coda_in_hdr ih; struct CodaFid VFid; struct coda_vattr attr; }; struct coda_setattr_out { struct coda_out_hdr out; }; /* coda_access: NO_OUT */ struct coda_access_in { struct coda_in_hdr ih; struct CodaFid VFid; int flags; }; struct coda_access_out { struct coda_out_hdr out; }; /* lookup flags */ #define CLU_CASE_SENSITIVE 0x01 #define CLU_CASE_INSENSITIVE 0x02 /* coda_lookup: */ struct coda_lookup_in { struct coda_in_hdr ih; struct CodaFid VFid; int name; /* Place holder for data. */ int flags; }; struct coda_lookup_out { struct coda_out_hdr oh; struct CodaFid VFid; int vtype; }; /* coda_create: */ struct coda_create_in { struct coda_in_hdr ih; struct CodaFid VFid; struct coda_vattr attr; int excl; int mode; int name; /* Place holder for data. */ }; struct coda_create_out { struct coda_out_hdr oh; struct CodaFid VFid; struct coda_vattr attr; }; /* coda_remove: NO_OUT */ struct coda_remove_in { struct coda_in_hdr ih; struct CodaFid VFid; int name; /* Place holder for data. */ }; struct coda_remove_out { struct coda_out_hdr out; }; /* coda_link: NO_OUT */ struct coda_link_in { struct coda_in_hdr ih; struct CodaFid sourceFid; /* cnode to link *to* */ struct CodaFid destFid; /* Directory in which to place link */ int tname; /* Place holder for data. */ }; struct coda_link_out { struct coda_out_hdr out; }; /* coda_rename: NO_OUT */ struct coda_rename_in { struct coda_in_hdr ih; struct CodaFid sourceFid; int srcname; struct CodaFid destFid; int destname; }; struct coda_rename_out { struct coda_out_hdr out; }; /* coda_mkdir: */ struct coda_mkdir_in { struct coda_in_hdr ih; struct CodaFid VFid; struct coda_vattr attr; int name; /* Place holder for data. */ }; struct coda_mkdir_out { struct coda_out_hdr oh; struct CodaFid VFid; struct coda_vattr attr; }; /* coda_rmdir: NO_OUT */ struct coda_rmdir_in { struct coda_in_hdr ih; struct CodaFid VFid; int name; /* Place holder for data. */ }; struct coda_rmdir_out { struct coda_out_hdr out; }; /* coda_symlink: NO_OUT */ struct coda_symlink_in { struct coda_in_hdr ih; struct CodaFid VFid; /* Directory to put symlink in */ int srcname; struct coda_vattr attr; int tname; }; struct coda_symlink_out { struct coda_out_hdr out; }; /* coda_readlink: */ struct coda_readlink_in { struct coda_in_hdr ih; struct CodaFid VFid; }; struct coda_readlink_out { struct coda_out_hdr oh; int count; caddr_t data; /* Place holder for data. */ }; /* coda_fsync: NO_OUT */ struct coda_fsync_in { struct coda_in_hdr ih; struct CodaFid VFid; }; struct coda_fsync_out { struct coda_out_hdr out; }; /* coda_vget: */ struct coda_vget_in { struct coda_in_hdr ih; struct CodaFid VFid; }; struct coda_vget_out { struct coda_out_hdr oh; struct CodaFid VFid; int vtype; }; /* CODA_SIGNAL is out-of-band, doesn't need data. */ /* CODA_INVALIDATE is a venus->kernel call */ /* CODA_FLUSH is a venus->kernel call */ /* coda_purgeuser: */ /* CODA_PURGEUSER is a venus->kernel call */ struct coda_purgeuser_out { struct coda_out_hdr oh; vuid_t uid; }; /* coda_zapfile: */ /* CODA_ZAPFILE is a venus->kernel call */ struct coda_zapfile_out {