Linux 3.7-rc2 Backmerge to solve two ugly conflicts: - uapi. We've already added new ioctl definitions for -next. Do I need to say more? - wc support gtt ptes. We've had to revert this for snb+ for 3.7 and also fix a few other things in the code. Now we know how to make it work on snb+, but to avoid losing the other fixes do the backmerge first before re-enabling wc gtt ptes on snb+. And a few other minor things, among them git getting confused in intel_dp.c and seemingly causing a conflict out of nothing ... Conflicts: drivers/gpu/drm/i915/i915_reg.h drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/i915/intel_dp.c drivers/gpu/drm/i915/intel_modes.c include/drm/i915_drm.h
Showing the changes to include/uapi (640 of 13343 files). Show all
Unified · Split
| @@ -0,0 +1,14 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | # Top-level Makefile calls into asm-$(ARCH) | ||
| 3 | # List only non-arch directories below | ||
| 4 | |||
| 5 | |||
| 6 | header-y += asm-generic/ | ||
| 7 | header-y += linux/ | ||
| 8 | header-y += sound/ | ||
| 9 | header-y += mtd/ | ||
| 10 | header-y += rdma/ | ||
| 11 | header-y += video/ | ||
| 12 | header-y += drm/ | ||
| 13 | header-y += xen/ | ||
| 14 | header-y += scsi/ | ||
| @@ -0,0 +1,36 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += auxvec.h | ||
| 3 | header-y += bitsperlong.h | ||
| 4 | header-y += errno-base.h | ||
| 5 | header-y += errno.h | ||
| 6 | header-y += fcntl.h | ||
| 7 | header-y += int-l64.h | ||
| 8 | header-y += int-ll64.h | ||
| 9 | header-y += ioctl.h | ||
| 10 | header-y += ioctls.h | ||
| 11 | header-y += ipcbuf.h | ||
| 12 | header-y += kvm_para.h | ||
| 13 | header-y += mman-common.h | ||
| 14 | header-y += mman.h | ||
| 15 | header-y += msgbuf.h | ||
| 16 | header-y += param.h | ||
| 17 | header-y += poll.h | ||
| 18 | header-y += posix_types.h | ||
| 19 | header-y += resource.h | ||
| 20 | header-y += sembuf.h | ||
| 21 | header-y += setup.h | ||
| 22 | header-y += shmbuf.h | ||
| 23 | header-y += shmparam.h | ||
| 24 | header-y += siginfo.h | ||
| 25 | header-y += signal-defs.h | ||
| 26 | header-y += signal.h | ||
| 27 | header-y += socket.h | ||
| 28 | header-y += sockios.h | ||
| 29 | header-y += stat.h | ||
| 30 | header-y += statfs.h | ||
| 31 | header-y += swab.h | ||
| 32 | header-y += termbits.h | ||
| 33 | header-y += termios.h | ||
| 34 | header-y += types.h | ||
| 35 | header-y += ucontext.h | ||
| 36 | header-y += unistd.h | ||
| @@ -0,0 +1,49 @@ | |||
| 1 | # | ||
| 2 | # Headers that are optional in usr/include/asm/ | ||
| 3 | # | ||
| 4 | opt-header += kvm.h | ||
| 5 | opt-header += kvm_para.h | ||
| 6 | opt-header += a.out.h | ||
| 7 | |||
| 8 | # | ||
| 9 | # Headers that are mandatory in usr/include/asm/ | ||
| 10 | # | ||
| 11 | header-y += auxvec.h | ||
| 12 | header-y += bitsperlong.h | ||
| 13 | header-y += byteorder.h | ||
| 14 | header-y += errno.h | ||
| 15 | header-y += fcntl.h | ||
| 16 | header-y += ioctl.h | ||
| 17 | header-y += ioctls.h | ||
| 18 | header-y += ipcbuf.h | ||
| 19 | header-y += mman.h | ||
| 20 | header-y += msgbuf.h | ||
| 21 | header-y += param.h | ||
| 22 | header-y += poll.h | ||
| 23 | header-y += posix_types.h | ||
| 24 | header-y += ptrace.h | ||
| 25 | header-y += resource.h | ||
| 26 | header-y += sembuf.h | ||
| 27 | header-y += setup.h | ||
| 28 | header-y += shmbuf.h | ||
| 29 | header-y += sigcontext.h | ||
| 30 | header-y += siginfo.h | ||
| 31 | header-y += signal.h | ||
| 32 | header-y += socket.h | ||
| 33 | header-y += sockios.h | ||
| 34 | header-y += stat.h | ||
| 35 | header-y += statfs.h | ||
| 36 | header-y += swab.h | ||
| 37 | header-y += termbits.h | ||
| 38 | header-y += termios.h | ||
| 39 | header-y += types.h | ||
| 40 | header-y += unistd.h | ||
| 41 | |||
| 42 | header-y += $(foreach hdr,$(opt-header), \ | ||
| 43 | $(if \ | ||
| 44 | $(wildcard \ | ||
| 45 | $(srctree)/arch/$(SRCARCH)/include/uapi/asm/$(hdr) \ | ||
| 46 | $(srctree)/arch/$(SRCARCH)/include/asm/$(hdr) \ | ||
| 47 | ), \ | ||
| 48 | $(hdr) \ | ||
| 49 | )) | ||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef __ASM_GENERIC_AUXVEC_H | ||
| 2 | #define __ASM_GENERIC_AUXVEC_H | ||
| 3 | /* | ||
| 4 | * Not all architectures need their own auxvec.h, the most | ||
| 5 | * common definitions are already in linux/auxvec.h. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #endif /* __ASM_GENERIC_AUXVEC_H */ | ||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef _UAPI__ASM_GENERIC_BITS_PER_LONG | ||
| 2 | #define _UAPI__ASM_GENERIC_BITS_PER_LONG | ||
| 3 | |||
| 4 | /* | ||
| 5 | * There seems to be no way of detecting this automatically from user | ||
| 6 | * space, so 64 bit architectures should override this in their | ||
| 7 | * bitsperlong.h. In particular, an architecture that supports | ||
| 8 | * both 32 and 64 bit user space must not rely on CONFIG_64BIT | ||
| 9 | * to decide it, but rather check a compiler provided macro. | ||
| 10 | */ | ||
| 11 | #ifndef __BITS_PER_LONG | ||
| 12 | #define __BITS_PER_LONG 32 | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #endif /* _UAPI__ASM_GENERIC_BITS_PER_LONG */ | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef _ASM_GENERIC_ERRNO_BASE_H | ||
| 2 | #define _ASM_GENERIC_ERRNO_BASE_H | ||
| 3 | |||
| 4 | #define EPERM 1 /* Operation not permitted */ | ||
| 5 | #define ENOENT 2 /* No such file or directory */ | ||
| 6 | #define ESRCH 3 /* No such process */ | ||
| 7 | #define EINTR 4 /* Interrupted system call */ | ||
| 8 | #define EIO 5 /* I/O error */ | ||
| 9 | #define ENXIO 6 /* No such device or address */ | ||
| 10 | #define E2BIG 7 /* Argument list too long */ | ||
| 11 | #define ENOEXEC 8 /* Exec format error */ | ||
| 12 | #define EBADF 9 /* Bad file number */ | ||
| 13 | #define ECHILD 10 /* No child processes */ | ||
| 14 | #define EAGAIN 11 /* Try again */ | ||
| 15 | #define ENOMEM 12 /* Out of memory */ | ||
| 16 | #define EACCES 13 /* Permission denied */ | ||
| 17 | #define EFAULT 14 /* Bad address */ | ||
| 18 | #define ENOTBLK 15 /* Block device required */ | ||
| 19 | #define EBUSY 16 /* Device or resource busy */ | ||
| 20 | #define EEXIST 17 /* File exists */ | ||
| 21 | #define EXDEV 18 /* Cross-device link */ | ||
| 22 | #define ENODEV 19 /* No such device */ | ||
| 23 | #define ENOTDIR 20 /* Not a directory */ | ||
| 24 | #define EISDIR 21 /* Is a directory */ | ||
| 25 | #define EINVAL 22 /* Invalid argument */ | ||
| 26 | #define ENFILE 23 /* File table overflow */ | ||
| 27 | #define EMFILE 24 /* Too many open files */ | ||
| 28 | #define ENOTTY 25 /* Not a typewriter */ | ||
| 29 | #define ETXTBSY 26 /* Text file busy */ | ||
| 30 | #define EFBIG 27 /* File too large */ | ||
| 31 | #define ENOSPC 28 /* No space left on device */ | ||
| 32 | #define ESPIPE 29 /* Illegal seek */ | ||
| 33 | #define EROFS 30 /* Read-only file system */ | ||
| 34 | #define EMLINK 31 /* Too many links */ | ||
| 35 | #define EPIPE 32 /* Broken pipe */ | ||
| 36 | #define EDOM 33 /* Math argument out of domain of func */ | ||
| 37 | #define ERANGE 34 /* Math result not representable */ | ||
| 38 | |||
| 39 | #endif | ||
| @@ -0,0 +1,113 @@ | |||
| 1 | #ifndef _ASM_GENERIC_ERRNO_H | ||
| 2 | #define _ASM_GENERIC_ERRNO_H | ||
| 3 | |||
| 4 | #include <asm-generic/errno-base.h> | ||
| 5 | |||
| 6 | #define EDEADLK 35 /* Resource deadlock would occur */ | ||
| 7 | #define ENAMETOOLONG 36 /* File name too long */ | ||
| 8 | #define ENOLCK 37 /* No record locks available */ | ||
| 9 | #define ENOSYS 38 /* Function not implemented */ | ||
| 10 | #define ENOTEMPTY 39 /* Directory not empty */ | ||
| 11 | #define ELOOP 40 /* Too many symbolic links encountered */ | ||
| 12 | #define EWOULDBLOCK EAGAIN /* Operation would block */ | ||
| 13 | #define ENOMSG 42 /* No message of desired type */ | ||
| 14 | #define EIDRM 43 /* Identifier removed */ | ||
| 15 | #define ECHRNG 44 /* Channel number out of range */ | ||
| 16 | #define EL2NSYNC 45 /* Level 2 not synchronized */ | ||
| 17 | #define EL3HLT 46 /* Level 3 halted */ | ||
| 18 | #define EL3RST 47 /* Level 3 reset */ | ||
| 19 | #define ELNRNG 48 /* Link number out of range */ | ||
| 20 | #define EUNATCH 49 /* Protocol driver not attached */ | ||
| 21 | #define ENOCSI 50 /* No CSI structure available */ | ||
| 22 | #define EL2HLT 51 /* Level 2 halted */ | ||
| 23 | #define EBADE 52 /* Invalid exchange */ | ||
| 24 | #define EBADR 53 /* Invalid request descriptor */ | ||
| 25 | #define EXFULL 54 /* Exchange full */ | ||
| 26 | #define ENOANO 55 /* No anode */ | ||
| 27 | #define EBADRQC 56 /* Invalid request code */ | ||
| 28 | #define EBADSLT 57 /* Invalid slot */ | ||
| 29 | |||
| 30 | #define EDEADLOCK EDEADLK | ||
| 31 | |||
| 32 | #define EBFONT 59 /* Bad font file format */ | ||
| 33 | #define ENOSTR 60 /* Device not a stream */ | ||
| 34 | #define ENODATA 61 /* No data available */ | ||
| 35 | #define ETIME 62 /* Timer expired */ | ||
| 36 | #define ENOSR 63 /* Out of streams resources */ | ||
| 37 | #define ENONET 64 /* Machine is not on the network */ | ||
| 38 | #define ENOPKG 65 /* Package not installed */ | ||
| 39 | #define EREMOTE 66 /* Object is remote */ | ||
| 40 | #define ENOLINK 67 /* Link has been severed */ | ||
| 41 | #define EADV 68 /* Advertise error */ | ||
| 42 | #define ESRMNT 69 /* Srmount error */ | ||
| 43 | #define ECOMM 70 /* Communication error on send */ | ||
| 44 | #define EPROTO 71 /* Protocol error */ | ||
| 45 | #define EMULTIHOP 72 /* Multihop attempted */ | ||
| 46 | #define EDOTDOT 73 /* RFS specific error */ | ||
| 47 | #define EBADMSG 74 /* Not a data message */ | ||
| 48 | #define EOVERFLOW 75 /* Value too large for defined data type */ | ||
| 49 | #define ENOTUNIQ 76 /* Name not unique on network */ | ||
| 50 | #define EBADFD 77 /* File descriptor in bad state */ | ||
| 51 | #define EREMCHG 78 /* Remote address changed */ | ||
| 52 | #define ELIBACC 79 /* Can not access a needed shared library */ | ||
| 53 | #define ELIBBAD 80 /* Accessing a corrupted shared library */ | ||
| 54 | #define ELIBSCN 81 /* .lib section in a.out corrupted */ | ||
| 55 | #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ | ||
| 56 | #define ELIBEXEC 83 /* Cannot exec a shared library directly */ | ||
| 57 | #define EILSEQ 84 /* Illegal byte sequence */ | ||
| 58 | #define ERESTART 85 /* Interrupted system call should be restarted */ | ||
| 59 | #define ESTRPIPE 86 /* Streams pipe error */ | ||
| 60 | #define EUSERS 87 /* Too many users */ | ||
| 61 | #define ENOTSOCK 88 /* Socket operation on non-socket */ | ||
| 62 | #define EDESTADDRREQ 89 /* Destination address required */ | ||
| 63 | #define EMSGSIZE 90 /* Message too long */ | ||
| 64 | #define EPROTOTYPE 91 /* Protocol wrong type for socket */ | ||
| 65 | #define ENOPROTOOPT 92 /* Protocol not available */ | ||
| 66 | #define EPROTONOSUPPORT 93 /* Protocol not supported */ | ||
| 67 | #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ | ||
| 68 | #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ | ||
| 69 | #define EPFNOSUPPORT 96 /* Protocol family not supported */ | ||
| 70 | #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ | ||
| 71 | #define EADDRINUSE 98 /* Address already in use */ | ||
| 72 | #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ | ||
| 73 | #define ENETDOWN 100 /* Network is down */ | ||
| 74 | #define ENETUNREACH 101 /* Network is unreachable */ | ||
| 75 | #define ENETRESET 102 /* Network dropped connection because of reset */ | ||
| 76 | #define ECONNABORTED 103 /* Software caused connection abort */ | ||
| 77 | #define ECONNRESET 104 /* Connection reset by peer */ | ||
| 78 | #define ENOBUFS 105 /* No buffer space available */ | ||
| 79 | #define EISCONN 106 /* Transport endpoint is already connected */ | ||
| 80 | #define ENOTCONN 107 /* Transport endpoint is not connected */ | ||
| 81 | #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ | ||
| 82 | #define ETOOMANYREFS 109 /* Too many references: cannot splice */ | ||
| 83 | #define ETIMEDOUT 110 /* Connection timed out */ | ||
| 84 | #define ECONNREFUSED 111 /* Connection refused */ | ||
| 85 | #define EHOSTDOWN 112 /* Host is down */ | ||
| 86 | #define EHOSTUNREACH 113 /* No route to host */ | ||
| 87 | #define EALREADY 114 /* Operation already in progress */ | ||
| 88 | #define EINPROGRESS 115 /* Operation now in progress */ | ||
| 89 | #define ESTALE 116 /* Stale NFS file handle */ | ||
| 90 | #define EUCLEAN 117 /* Structure needs cleaning */ | ||
| 91 | #define ENOTNAM 118 /* Not a XENIX named type file */ | ||
| 92 | #define ENAVAIL 119 /* No XENIX semaphores available */ | ||
| 93 | #define EISNAM 120 /* Is a named type file */ | ||
| 94 | #define EREMOTEIO 121 /* Remote I/O error */ | ||
| 95 | #define EDQUOT 122 /* Quota exceeded */ | ||
| 96 | |||
| 97 | #define ENOMEDIUM 123 /* No medium found */ | ||
| 98 | #define EMEDIUMTYPE 124 /* Wrong medium type */ | ||
| 99 | #define ECANCELED 125 /* Operation Canceled */ | ||
| 100 | #define ENOKEY 126 /* Required key not available */ | ||
| 101 | #define EKEYEXPIRED 127 /* Key has expired */ | ||
| 102 | #define EKEYREVOKED 128 /* Key has been revoked */ | ||
| 103 | #define EKEYREJECTED 129 /* Key was rejected by service */ | ||
| 104 | |||
| 105 | /* for robust mutexes */ | ||
| 106 | #define EOWNERDEAD 130 /* Owner died */ | ||
| 107 | #define ENOTRECOVERABLE 131 /* State not recoverable */ | ||
| 108 | |||
| 109 | #define ERFKILL 132 /* Operation not possible due to RF-kill */ | ||
| 110 | |||
| 111 | #define EHWPOISON 133 /* Memory page has hardware error */ | ||
| 112 | |||
| 113 | #endif | ||
| @@ -0,0 +1,199 @@ | |||
| 1 | #ifndef _ASM_GENERIC_FCNTL_H | ||
| 2 | #define _ASM_GENERIC_FCNTL_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * FMODE_EXEC is 0x20 | ||
| 8 | * FMODE_NONOTIFY is 0x1000000 | ||
| 9 | * These cannot be used by userspace O_* until internal and external open | ||
| 10 | * flags are split. | ||
| 11 | * -Eric Paris | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* | ||
| 15 | * When introducing new O_* bits, please check its uniqueness in fcntl_init(). | ||
| 16 | */ | ||
| 17 | |||
| 18 | #define O_ACCMODE 00000003 | ||
| 19 | #define O_RDONLY 00000000 | ||
| 20 | #define O_WRONLY 00000001 | ||
| 21 | #define O_RDWR 00000002 | ||
| 22 | #ifndef O_CREAT | ||
| 23 | #define O_CREAT 00000100 /* not fcntl */ | ||
| 24 | #endif | ||
| 25 | #ifndef O_EXCL | ||
| 26 | #define O_EXCL 00000200 /* not fcntl */ | ||
| 27 | #endif | ||
| 28 | #ifndef O_NOCTTY | ||
| 29 | #define O_NOCTTY 00000400 /* not fcntl */ | ||
| 30 | #endif | ||
| 31 | #ifndef O_TRUNC | ||
| 32 | #define O_TRUNC 00001000 /* not fcntl */ | ||
| 33 | #endif | ||
| 34 | #ifndef O_APPEND | ||
| 35 | #define O_APPEND 00002000 | ||
| 36 | #endif | ||
| 37 | #ifndef O_NONBLOCK | ||
| 38 | #define O_NONBLOCK 00004000 | ||
| 39 | #endif | ||
| 40 | #ifndef O_DSYNC | ||
| 41 | #define O_DSYNC 00010000 /* used to be O_SYNC, see below */ | ||
| 42 | #endif | ||
| 43 | #ifndef FASYNC | ||
| 44 | #define FASYNC 00020000 /* fcntl, for BSD compatibility */ | ||
| 45 | #endif | ||
| 46 | #ifndef O_DIRECT | ||
| 47 | #define O_DIRECT 00040000 /* direct disk access hint */ | ||
| 48 | #endif | ||
| 49 | #ifndef O_LARGEFILE | ||
| 50 | #define O_LARGEFILE 00100000 | ||
| 51 | #endif | ||
| 52 | #ifndef O_DIRECTORY | ||
| 53 | #define O_DIRECTORY 00200000 /* must be a directory */ | ||
| 54 | #endif | ||
| 55 | #ifndef O_NOFOLLOW | ||
| 56 | #define O_NOFOLLOW 00400000 /* don't follow links */ | ||
| 57 | #endif | ||
| 58 | #ifndef O_NOATIME | ||
| 59 | #define O_NOATIME 01000000 | ||
| 60 | #endif | ||
| 61 | #ifndef O_CLOEXEC | ||
| 62 | #define O_CLOEXEC 02000000 /* set close_on_exec */ | ||
| 63 | #endif | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using | ||
| 67 | * the O_SYNC flag. We continue to use the existing numerical value | ||
| 68 | * for O_DSYNC semantics now, but using the correct symbolic name for it. | ||
| 69 | * This new value is used to request true Posix O_SYNC semantics. It is | ||
| 70 | * defined in this strange way to make sure applications compiled against | ||
| 71 | * new headers get at least O_DSYNC semantics on older kernels. | ||
| 72 | * | ||
| 73 | * This has the nice side-effect that we can simply test for O_DSYNC | ||
| 74 | * wherever we do not care if O_DSYNC or O_SYNC is used. | ||
| 75 | * | ||
| 76 | * Note: __O_SYNC must never be used directly. | ||
| 77 | */ | ||
| 78 | #ifndef O_SYNC | ||
| 79 | #define __O_SYNC 04000000 | ||
| 80 | #define O_SYNC (__O_SYNC|O_DSYNC) | ||
| 81 | #endif | ||
| 82 | |||
| 83 | #ifndef O_PATH | ||
| 84 | #define O_PATH 010000000 | ||
| 85 | #endif | ||
| 86 | |||
| 87 | #ifndef O_NDELAY | ||
| 88 | #define O_NDELAY O_NONBLOCK | ||
| 89 | #endif | ||
| 90 | |||
| 91 | #define F_DUPFD 0 /* dup */ | ||
| 92 | #define F_GETFD 1 /* get close_on_exec */ | ||
| 93 | #define F_SETFD 2 /* set/clear close_on_exec */ | ||
| 94 | #define F_GETFL 3 /* get file->f_flags */ | ||
| 95 | #define F_SETFL 4 /* set file->f_flags */ | ||
| 96 | #ifndef F_GETLK | ||
| 97 | #define F_GETLK 5 | ||
| 98 | #define F_SETLK 6 | ||
| 99 | #define F_SETLKW 7 | ||
| 100 | #endif | ||
| 101 | #ifndef F_SETOWN | ||
| 102 | #define F_SETOWN 8 /* for sockets. */ | ||
| 103 | #define F_GETOWN 9 /* for sockets. */ | ||
| 104 | #endif | ||
| 105 | #ifndef F_SETSIG | ||
| 106 | #define F_SETSIG 10 /* for sockets. */ | ||
| 107 | #define F_GETSIG 11 /* for sockets. */ | ||
| 108 | #endif | ||
| 109 | |||
| 110 | #ifndef CONFIG_64BIT | ||
| 111 | #ifndef F_GETLK64 | ||
| 112 | #define F_GETLK64 12 /* using 'struct flock64' */ | ||
| 113 | #define F_SETLK64 13 | ||
| 114 | #define F_SETLKW64 14 | ||
| 115 | #endif | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifndef F_SETOWN_EX | ||
| 119 | #define F_SETOWN_EX 15 | ||
| 120 | #define F_GETOWN_EX 16 | ||
| 121 | #endif | ||
| 122 | |||
| 123 | #ifndef F_GETOWNER_UIDS | ||
| 124 | #define F_GETOWNER_UIDS 17 | ||
| 125 | #endif | ||
| 126 | |||
| 127 | #define F_OWNER_TID 0 | ||
| 128 | #define F_OWNER_PID 1 | ||
| 129 | #define F_OWNER_PGRP 2 | ||
| 130 | |||
| 131 | struct f_owner_ex { | ||
| 132 | int type; | ||
| 133 | __kernel_pid_t pid; | ||
| 134 | }; | ||
| 135 | |||
| 136 | /* for F_[GET|SET]FL */ | ||
| 137 | #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ | ||
| 138 | |||
| 139 | /* for posix fcntl() and lockf() */ | ||
| 140 | #ifndef F_RDLCK | ||
| 141 | #define F_RDLCK 0 | ||
| 142 | #define F_WRLCK 1 | ||
| 143 | #define F_UNLCK 2 | ||
| 144 | #endif | ||
| 145 | |||
| 146 | /* for old implementation of bsd flock () */ | ||
| 147 | #ifndef F_EXLCK | ||
| 148 | #define F_EXLCK 4 /* or 3 */ | ||
| 149 | #define F_SHLCK 8 /* or 4 */ | ||
| 150 | #endif | ||
| 151 | |||
| 152 | /* operations for bsd flock(), also used by the kernel implementation */ | ||
| 153 | #define LOCK_SH 1 /* shared lock */ | ||
| 154 | #define LOCK_EX 2 /* exclusive lock */ | ||
| 155 | #define LOCK_NB 4 /* or'd with one of the above to prevent | ||
| 156 | blocking */ | ||
| 157 | #define LOCK_UN 8 /* remove lock */ | ||
| 158 | |||
| 159 | #define LOCK_MAND 32 /* This is a mandatory flock ... */ | ||
| 160 | #define LOCK_READ 64 /* which allows concurrent read operations */ | ||
| 161 | #define LOCK_WRITE 128 /* which allows concurrent write operations */ | ||
| 162 | #define LOCK_RW 192 /* which allows concurrent read & write ops */ | ||
| 163 | |||
| 164 | #define F_LINUX_SPECIFIC_BASE 1024 | ||
| 165 | |||
| 166 | #ifndef HAVE_ARCH_STRUCT_FLOCK | ||
| 167 | #ifndef __ARCH_FLOCK_PAD | ||
| 168 | #define __ARCH_FLOCK_PAD | ||
| 169 | #endif | ||
| 170 | |||
| 171 | struct flock { | ||
| 172 | short l_type; | ||
| 173 | short l_whence; | ||
| 174 | __kernel_off_t l_start; | ||
| 175 | __kernel_off_t l_len; | ||
| 176 | __kernel_pid_t l_pid; | ||
| 177 | __ARCH_FLOCK_PAD | ||
| 178 | }; | ||
| 179 | #endif | ||
| 180 | |||
| 181 | #ifndef CONFIG_64BIT | ||
| 182 | |||
| 183 | #ifndef HAVE_ARCH_STRUCT_FLOCK64 | ||
| 184 | #ifndef __ARCH_FLOCK64_PAD | ||
| 185 | #define __ARCH_FLOCK64_PAD | ||
| 186 | #endif | ||
| 187 | |||
| 188 | struct flock64 { | ||
| 189 | short l_type; | ||
| 190 | short l_whence; | ||
| 191 | __kernel_loff_t l_start; | ||
| 192 | __kernel_loff_t l_len; | ||
| 193 | __kernel_pid_t l_pid; | ||
| 194 | __ARCH_FLOCK64_PAD | ||
| 195 | }; | ||
| 196 | #endif | ||
| 197 | #endif /* !CONFIG_64BIT */ | ||
| 198 | |||
| 199 | #endif /* _ASM_GENERIC_FCNTL_H */ | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * asm-generic/int-l64.h | ||
| 3 | * | ||
| 4 | * Integer declarations for architectures which use "long" | ||
| 5 | * for 64-bit types. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _UAPI_ASM_GENERIC_INT_L64_H | ||
| 9 | #define _UAPI_ASM_GENERIC_INT_L64_H | ||
| 10 | |||
| 11 | #include <asm/bitsperlong.h> | ||
| 12 | |||
| 13 | #ifndef __ASSEMBLY__ | ||
| 14 | /* | ||
| 15 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | ||
| 16 | * header files exported to user space | ||
| 17 | */ | ||
| 18 | |||
| 19 | typedef __signed__ char __s8; | ||
| 20 | typedef unsigned char __u8; | ||
| 21 | |||
| 22 | typedef __signed__ short __s16; | ||
| 23 | typedef unsigned short __u16; | ||
| 24 | |||
| 25 | typedef __signed__ int __s32; | ||
| 26 | typedef unsigned int __u32; | ||
| 27 | |||
| 28 | typedef __signed__ long __s64; | ||
| 29 | typedef unsigned long __u64; | ||
| 30 | |||
| 31 | #endif /* __ASSEMBLY__ */ | ||
| 32 | |||
| 33 | |||
| 34 | #endif /* _UAPI_ASM_GENERIC_INT_L64_H */ | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * asm-generic/int-ll64.h | ||
| 3 | * | ||
| 4 | * Integer declarations for architectures which use "long long" | ||
| 5 | * for 64-bit types. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _UAPI_ASM_GENERIC_INT_LL64_H | ||
| 9 | #define _UAPI_ASM_GENERIC_INT_LL64_H | ||
| 10 | |||
| 11 | #include <asm/bitsperlong.h> | ||
| 12 | |||
| 13 | #ifndef __ASSEMBLY__ | ||
| 14 | /* | ||
| 15 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | ||
| 16 | * header files exported to user space | ||
| 17 | */ | ||
| 18 | |||
| 19 | typedef __signed__ char __s8; | ||
| 20 | typedef unsigned char __u8; | ||
| 21 | |||
| 22 | typedef __signed__ short __s16; | ||
| 23 | typedef unsigned short __u16; | ||
| 24 | |||
| 25 | typedef __signed__ int __s32; | ||
| 26 | typedef unsigned int __u32; | ||
| 27 | |||
| 28 | #ifdef __GNUC__ | ||
| 29 | __extension__ typedef __signed__ long long __s64; | ||
| 30 | __extension__ typedef unsigned long long __u64; | ||
| 31 | #else | ||
| 32 | typedef __signed__ long long __s64; | ||
| 33 | typedef unsigned long long __u64; | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #endif /* __ASSEMBLY__ */ | ||
| 37 | |||
| 38 | |||
| 39 | #endif /* _UAPI_ASM_GENERIC_INT_LL64_H */ | ||
| @@ -0,0 +1,98 @@ | |||
| 1 | #ifndef _UAPI_ASM_GENERIC_IOCTL_H | ||
| 2 | #define _UAPI_ASM_GENERIC_IOCTL_H | ||
| 3 | |||
| 4 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
| 5 | * size of the parameter structure in the lower 14 bits of the | ||
| 6 | * upper 16 bits. | ||
| 7 | * Encoding the size of the parameter structure in the ioctl request | ||
| 8 | * is useful for catching programs compiled with old versions | ||
| 9 | * and to avoid overwriting user space outside the user buffer area. | ||
| 10 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
| 11 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* | ||
| 15 | * The following is for compatibility across the various Linux | ||
| 16 | * platforms. The generic ioctl numbering scheme doesn't really enforce | ||
| 17 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
| 18 | * bits are indeed used as a type field, so we might just as well make | ||
| 19 | * this explicit here. Please be sure to use the decoding macros | ||
| 20 | * below from now on. | ||
| 21 | */ | ||
| 22 | #define _IOC_NRBITS 8 | ||
| 23 | #define _IOC_TYPEBITS 8 | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Let any architecture override either of the following before | ||
| 27 | * including this file. | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef _IOC_SIZEBITS | ||
| 31 | # define _IOC_SIZEBITS 14 | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #ifndef _IOC_DIRBITS | ||
| 35 | # define _IOC_DIRBITS 2 | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
| 39 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
| 40 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
| 41 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
| 42 | |||
| 43 | #define _IOC_NRSHIFT 0 | ||
| 44 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
| 45 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
| 46 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Direction bits, which any architecture can choose to override | ||
| 50 | * before including this file. | ||
| 51 | */ | ||
| 52 | |||
| 53 | #ifndef _IOC_NONE | ||
| 54 | # define _IOC_NONE 0U | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #ifndef _IOC_WRITE | ||
| 58 | # define _IOC_WRITE 1U | ||
| 59 | #endif | ||
| 60 | |||
| 61 | #ifndef _IOC_READ | ||
| 62 | # define _IOC_READ 2U | ||
| 63 | #endif | ||
| 64 | |||
| 65 | #define _IOC(dir,type,nr,size) \ | ||
| 66 | (((dir) << _IOC_DIRSHIFT) | \ | ||
| 67 | ((type) << _IOC_TYPESHIFT) | \ | ||
| 68 | ((nr) << _IOC_NRSHIFT) | \ | ||
| 69 | ((size) << _IOC_SIZESHIFT)) | ||
| 70 | |||
| 71 | #ifndef __KERNEL__ | ||
| 72 | #define _IOC_TYPECHECK(t) (sizeof(t)) | ||
| 73 | #endif | ||
| 74 | |||
| 75 | /* used to create numbers */ | ||
| 76 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
| 77 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | ||
| 78 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
| 79 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
| 80 | #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
| 81 | #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
| 82 | #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
| 83 | |||
| 84 | /* used to decode ioctl numbers.. */ | ||
| 85 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
| 86 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
| 87 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
| 88 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
| 89 | |||
| 90 | /* ...and for the drivers/sound files... */ | ||
| 91 | |||
| 92 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
| 93 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
| 94 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
| 95 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
| 96 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
| 97 | |||
| 98 | #endif /* _UAPI_ASM_GENERIC_IOCTL_H */ | ||
| @@ -0,0 +1,114 @@ | |||
| 1 | #ifndef __ASM_GENERIC_IOCTLS_H | ||
| 2 | #define __ASM_GENERIC_IOCTLS_H | ||
| 3 | |||
| 4 | #include <linux/ioctl.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * These are the most common definitions for tty ioctl numbers. | ||
| 8 | * Most of them do not use the recommended _IOC(), but there is | ||
| 9 | * probably some source code out there hardcoding the number, | ||
| 10 | * so we might as well use them for all new platforms. | ||
| 11 | * | ||
| 12 | * The architectures that use different values here typically | ||
| 13 | * try to be compatible with some Unix variants for the same | ||
| 14 | * architecture. | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* 0x54 is just a magic number to make these relatively unique ('T') */ | ||
| 18 | |||
| 19 | #define TCGETS 0x5401 | ||
| 20 | #define TCSETS 0x5402 | ||
| 21 | #define TCSETSW 0x5403 | ||
| 22 | #define TCSETSF 0x5404 | ||
| 23 | #define TCGETA 0x5405 | ||
| 24 | #define TCSETA 0x5406 | ||
| 25 | #define TCSETAW 0x5407 | ||
| 26 | #define TCSETAF 0x5408 | ||
| 27 | #define TCSBRK 0x5409 | ||
| 28 | #define TCXONC 0x540A | ||
| 29 | #define TCFLSH 0x540B | ||
| 30 | #define TIOCEXCL 0x540C | ||
| 31 | #define TIOCNXCL 0x540D | ||
| 32 | #define TIOCSCTTY 0x540E | ||
| 33 | #define TIOCGPGRP 0x540F | ||
| 34 | #define TIOCSPGRP 0x5410 | ||
| 35 | #define TIOCOUTQ 0x5411 | ||
| 36 | #define TIOCSTI 0x5412 | ||
| 37 | #define TIOCGWINSZ 0x5413 | ||
| 38 | #define TIOCSWINSZ 0x5414 | ||
| 39 | #define TIOCMGET 0x5415 | ||
| 40 | #define TIOCMBIS 0x5416 | ||
| 41 | #define TIOCMBIC 0x5417 | ||
| 42 | #define TIOCMSET 0x5418 | ||
| 43 | #define TIOCGSOFTCAR 0x5419 | ||
| 44 | #define TIOCSSOFTCAR 0x541A | ||
| 45 | #define FIONREAD 0x541B | ||
| 46 | #define TIOCINQ FIONREAD | ||
| 47 | #define TIOCLINUX 0x541C | ||
| 48 | #define TIOCCONS 0x541D | ||
| 49 | #define TIOCGSERIAL 0x541E | ||
| 50 | #define TIOCSSERIAL 0x541F | ||
| 51 | #define TIOCPKT 0x5420 | ||
| 52 | #define FIONBIO 0x5421 | ||
| 53 | #define TIOCNOTTY 0x5422 | ||
| 54 | #define TIOCSETD 0x5423 | ||
| 55 | #define TIOCGETD 0x5424 | ||
| 56 | #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ | ||
| 57 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | ||
| 58 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | ||
| 59 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | ||
| 60 | #define TCGETS2 _IOR('T', 0x2A, struct termios2) | ||
| 61 | #define TCSETS2 _IOW('T', 0x2B, struct termios2) | ||
| 62 | #define TCSETSW2 _IOW('T', 0x2C, struct termios2) | ||
| 63 | #define TCSETSF2 _IOW('T', 0x2D, struct termios2) | ||
| 64 | #define TIOCGRS485 0x542E | ||
| 65 | #ifndef TIOCSRS485 | ||
| 66 | #define TIOCSRS485 0x542F | ||
| 67 | #endif | ||
| 68 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
| 69 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ | ||
| 70 | #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
| 71 | #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ | ||
| 72 | #define TCSETX 0x5433 | ||
| 73 | #define TCSETXF 0x5434 | ||
| 74 | #define TCSETXW 0x5435 | ||
| 75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ | ||
| 76 | #define TIOCVHANGUP 0x5437 | ||
| 77 | |||
| 78 | #define FIONCLEX 0x5450 | ||
| 79 | #define FIOCLEX 0x5451 | ||
| 80 | #define FIOASYNC 0x5452 | ||
| 81 | #define TIOCSERCONFIG 0x5453 | ||
| 82 | #define TIOCSERGWILD 0x5454 | ||
| 83 | #define TIOCSERSWILD 0x5455 | ||
| 84 | #define TIOCGLCKTRMIOS 0x5456 | ||
| 85 | #define TIOCSLCKTRMIOS 0x5457 | ||
| 86 | #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
| 87 | #define TIOCSERGETLSR 0x5459 /* Get line status register */ | ||
| 88 | #define TIOCSERGETMULTI 0x545A /* Get multiport config */ | ||
| 89 | #define TIOCSERSETMULTI 0x545B /* Set multiport config */ | ||
| 90 | |||
| 91 | #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ | ||
| 92 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Some arches already define FIOQSIZE due to a historical | ||
| 96 | * conflict with a Hayes modem-specific ioctl value. | ||
| 97 | */ | ||
| 98 | #ifndef FIOQSIZE | ||
| 99 | # define FIOQSIZE 0x5460 | ||
| 100 | #endif | ||
| 101 | |||
| 102 | /* Used for packet mode */ | ||
| 103 | #define TIOCPKT_DATA 0 | ||
| 104 | #define TIOCPKT_FLUSHREAD 1 | ||
| 105 | #define TIOCPKT_FLUSHWRITE 2 | ||
| 106 | #define TIOCPKT_STOP 4 | ||
| 107 | #define TIOCPKT_START 8 | ||
| 108 | #define TIOCPKT_NOSTOP 16 | ||
| 109 | #define TIOCPKT_DOSTOP 32 | ||
| 110 | #define TIOCPKT_IOCTL 64 | ||
| 111 | |||
| 112 | #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
| 113 | |||
| 114 | #endif /* __ASM_GENERIC_IOCTLS_H */ | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef __ASM_GENERIC_IPCBUF_H | ||
| 2 | #define __ASM_GENERIC_IPCBUF_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The generic ipc64_perm structure: | ||
| 6 | * Note extra padding because this structure is passed back and forth | ||
| 7 | * between kernel and user space. | ||
| 8 | * | ||
| 9 | * ipc64_perm was originally meant to be architecture specific, but | ||
| 10 | * everyone just ended up making identical copies without specific | ||
| 11 | * optimizations, so we may just as well all use the same one. | ||
| 12 | * | ||
| 13 | * Pad space is left for: | ||
| 14 | * - 32-bit mode_t on architectures that only had 16 bit | ||
| 15 | * - 32-bit seq | ||
| 16 | * - 2 miscellaneous 32-bit values | ||
| 17 | */ | ||
| 18 | |||
| 19 | struct ipc64_perm { | ||
| 20 | __kernel_key_t key; | ||
| 21 | __kernel_uid32_t uid; | ||
| 22 | __kernel_gid32_t gid; | ||
| 23 | __kernel_uid32_t cuid; | ||
| 24 | __kernel_gid32_t cgid; | ||
| 25 | __kernel_mode_t mode; | ||
| 26 | /* pad if mode_t is u16: */ | ||
| 27 | unsigned char __pad1[4 - sizeof(__kernel_mode_t)]; | ||
| 28 | unsigned short seq; | ||
| 29 | unsigned short __pad2; | ||
| 30 | unsigned long __unused1; | ||
| 31 | unsigned long __unused2; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __ASM_GENERIC_IPCBUF_H */ | ||
| @@ -0,0 +1,4 @@ | |||
| 1 | /* | ||
| 2 | * There isn't anything here, but the file must not be empty or patch | ||
| 3 | * will delete it. | ||
| 4 | */ | ||
| @@ -0,0 +1,58 @@ | |||
| 1 | #ifndef __ASM_GENERIC_MMAN_COMMON_H | ||
| 2 | #define __ASM_GENERIC_MMAN_COMMON_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd. | ||
| 6 | Based on: asm-xxx/mman.h | ||
| 7 | */ | ||
| 8 | |||
| 9 | #define PROT_READ 0x1 /* page can be read */ | ||
| 10 | #define PROT_WRITE 0x2 /* page can be written */ | ||
| 11 | #define PROT_EXEC 0x4 /* page can be executed */ | ||
| 12 | #define PROT_SEM 0x8 /* page may be used for atomic ops */ | ||
| 13 | #define PROT_NONE 0x0 /* page can not be accessed */ | ||
| 14 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | ||
| 15 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | ||
| 16 | |||
| 17 | #define MAP_SHARED 0x01 /* Share changes */ | ||
| 18 | #define MAP_PRIVATE 0x02 /* Changes are private */ | ||
| 19 | #define MAP_TYPE 0x0f /* Mask for type of mapping */ | ||
| 20 | #define MAP_FIXED 0x10 /* Interpret addr exactly */ | ||
| 21 | #define MAP_ANONYMOUS 0x20 /* don't use a file */ | ||
| 22 | #ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED | ||
| 23 | # define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be uninitialized */ | ||
| 24 | #else | ||
| 25 | # define MAP_UNINITIALIZED 0x0 /* Don't support this flag */ | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #define MS_ASYNC 1 /* sync memory asynchronously */ | ||
| 29 | #define MS_INVALIDATE 2 /* invalidate the caches */ | ||
| 30 | #define MS_SYNC 4 /* synchronous memory sync */ | ||
| 31 | |||
| 32 | #define MADV_NORMAL 0 /* no further special treatment */ | ||
| 33 | #define MADV_RANDOM 1 /* expect random page references */ | ||
| 34 | #define MADV_SEQUENTIAL 2 /* expect sequential page references */ | ||
| 35 | #define MADV_WILLNEED 3 /* will need these pages */ | ||
| 36 | #define MADV_DONTNEED 4 /* don't need these pages */ | ||
| 37 | |||
| 38 | /* common parameters: try to keep these consistent across architectures */ | ||
| 39 | #define MADV_REMOVE 9 /* remove these pages & resources */ | ||
| 40 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | ||
| 41 | #define MADV_DOFORK 11 /* do inherit across fork */ | ||
| 42 | #define MADV_HWPOISON 100 /* poison a page for testing */ | ||
| 43 | #define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */ | ||
| 44 | |||
| 45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | ||
| 46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | ||
| 47 | |||
| 48 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
| 49 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
| 50 | |||
| 51 | #define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, | ||
| 52 | overrides the coredump filter bits */ | ||
| 53 | #define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */ | ||
| 54 | |||
| 55 | /* compatibility flags */ | ||
| 56 | #define MAP_FILE 0 | ||
| 57 | |||
| 58 | #endif /* __ASM_GENERIC_MMAN_COMMON_H */ | ||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef __ASM_GENERIC_MMAN_H | ||
| 2 | #define __ASM_GENERIC_MMAN_H | ||
| 3 | |||
| 4 | #include <asm-generic/mman-common.h> | ||
| 5 | |||
| 6 | #define MAP_GROWSDOWN 0x0100 /* stack-like segment */ | ||
| 7 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | ||
| 8 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | ||
| 9 | #define MAP_LOCKED 0x2000 /* pages are locked */ | ||
| 10 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ | ||
| 11 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
| 12 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
| 13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
| 14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | ||
| 15 | |||
| 16 | #define MCL_CURRENT 1 /* lock all current mappings */ | ||
| 17 | #define MCL_FUTURE 2 /* lock all future mappings */ | ||
| 18 | |||
| 19 | #endif /* __ASM_GENERIC_MMAN_H */ | ||
| @@ -0,0 +1,47 @@ | |||
| 1 | #ifndef __ASM_GENERIC_MSGBUF_H | ||
| 2 | #define __ASM_GENERIC_MSGBUF_H | ||
| 3 | |||
| 4 | #include <asm/bitsperlong.h> | ||
| 5 | /* | ||
| 6 | * generic msqid64_ds structure. | ||
| 7 | * | ||
| 8 | * Note extra padding because this structure is passed back and forth | ||
| 9 | * between kernel and user space. | ||
| 10 | * | ||
| 11 | * msqid64_ds was originally meant to be architecture specific, but | ||
| 12 | * everyone just ended up making identical copies without specific | ||
| 13 | * optimizations, so we may just as well all use the same one. | ||
| 14 | * | ||
| 15 | * 64 bit architectures typically define a 64 bit __kernel_time_t, | ||
| 16 | * so they do not need the first three padding words. | ||
| 17 | * On big-endian systems, the padding is in the wrong place. | ||
| 18 | * | ||
| 19 | * Pad space is left for: | ||
| 20 | * - 64-bit time_t to solve y2038 problem | ||
| 21 | * - 2 miscellaneous 32-bit values | ||
| 22 | */ | ||
| 23 | |||
| 24 | struct msqid64_ds { | ||
| 25 | struct ipc64_perm msg_perm; | ||
| 26 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
| 27 | #if __BITS_PER_LONG != 64 | ||
| 28 | unsigned long __unused1; | ||
| 29 | #endif | ||
| 30 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
| 31 | #if __BITS_PER_LONG != 64 | ||
| 32 | unsigned long __unused2; | ||
| 33 | #endif | ||
| 34 | __kernel_time_t msg_ctime; /* last change time */ | ||
| 35 | #if __BITS_PER_LONG != 64 | ||
| 36 | unsigned long __unused3; | ||
| 37 | #endif | ||
| 38 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
| 39 | unsigned long msg_qnum; /* number of messages in queue */ | ||
| 40 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
| 41 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
| 42 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
| 43 | unsigned long __unused4; | ||
| 44 | unsigned long __unused5; | ||
| 45 | }; | ||
| 46 | |||
| 47 | #endif /* __ASM_GENERIC_MSGBUF_H */ | ||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _UAPI__ASM_GENERIC_PARAM_H | ||
| 2 | #define _UAPI__ASM_GENERIC_PARAM_H | ||
| 3 | |||
| 4 | #ifndef HZ | ||
| 5 | #define HZ 100 | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #ifndef EXEC_PAGESIZE | ||
| 9 | #define EXEC_PAGESIZE 4096 | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifndef NOGROUP | ||
| 13 | #define NOGROUP (-1) | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
| 17 | |||
| 18 | |||
| 19 | #endif /* _UAPI__ASM_GENERIC_PARAM_H */ | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef __ASM_GENERIC_POLL_H | ||
| 2 | #define __ASM_GENERIC_POLL_H | ||
| 3 | |||
| 4 | /* These are specified by iBCS2 */ | ||
| 5 | #define POLLIN 0x0001 | ||
| 6 | #define POLLPRI 0x0002 | ||
| 7 | #define POLLOUT 0x0004 | ||
| 8 | #define POLLERR 0x0008 | ||
| 9 | #define POLLHUP 0x0010 | ||
| 10 | #define POLLNVAL 0x0020 | ||
| 11 | |||
| 12 | /* The rest seem to be more-or-less nonstandard. Check them! */ | ||
| 13 | #define POLLRDNORM 0x0040 | ||
| 14 | #define POLLRDBAND 0x0080 | ||
| 15 | #ifndef POLLWRNORM | ||
| 16 | #define POLLWRNORM 0x0100 | ||
| 17 | #endif | ||
| 18 | #ifndef POLLWRBAND | ||
| 19 | #define POLLWRBAND 0x0200 | ||
| 20 | #endif | ||
| 21 | #ifndef POLLMSG | ||
| 22 | #define POLLMSG 0x0400 | ||
| 23 | #endif | ||
| 24 | #ifndef POLLREMOVE | ||
| 25 | #define POLLREMOVE 0x1000 | ||
| 26 | #endif | ||
| 27 | #ifndef POLLRDHUP | ||
| 28 | #define POLLRDHUP 0x2000 | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define POLLFREE 0x4000 /* currently only for epoll */ | ||
| 32 | |||
| 33 | struct pollfd { | ||
| 34 | int fd; | ||
| 35 | short events; | ||
| 36 | short revents; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* __ASM_GENERIC_POLL_H */ | ||
| @@ -0,0 +1,96 @@ | |||
| 1 | #ifndef __ASM_GENERIC_POSIX_TYPES_H | ||
| 2 | #define __ASM_GENERIC_POSIX_TYPES_H | ||
| 3 | |||
| 4 | #include <asm/bitsperlong.h> | ||
| 5 | /* | ||
| 6 | * This file is generally used by user-level software, so you need to | ||
| 7 | * be a little careful about namespace pollution etc. | ||
| 8 | * | ||
| 9 | * First the types that are often defined in different ways across | ||
| 10 | * architectures, so that you can override them. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __kernel_long_t | ||
| 14 | typedef long __kernel_long_t; | ||
| 15 | typedef unsigned long __kernel_ulong_t; | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #ifndef __kernel_ino_t | ||
| 19 | typedef __kernel_ulong_t __kernel_ino_t; | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #ifndef __kernel_mode_t | ||
| 23 | typedef unsigned int __kernel_mode_t; | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifndef __kernel_pid_t | ||
| 27 | typedef int __kernel_pid_t; | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #ifndef __kernel_ipc_pid_t | ||
| 31 | typedef int __kernel_ipc_pid_t; | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #ifndef __kernel_uid_t | ||
| 35 | typedef unsigned int __kernel_uid_t; | ||
| 36 | typedef unsigned int __kernel_gid_t; | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #ifndef __kernel_suseconds_t | ||
| 40 | typedef __kernel_long_t __kernel_suseconds_t; | ||
| 41 | #endif | ||
| 42 | |||
| 43 | #ifndef __kernel_daddr_t | ||
| 44 | typedef int __kernel_daddr_t; | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #ifndef __kernel_uid32_t | ||
| 48 | typedef unsigned int __kernel_uid32_t; | ||
| 49 | typedef unsigned int __kernel_gid32_t; | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #ifndef __kernel_old_uid_t | ||
| 53 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
| 54 | typedef __kernel_gid_t __kernel_old_gid_t; | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #ifndef __kernel_old_dev_t | ||
| 58 | typedef unsigned int __kernel_old_dev_t; | ||
| 59 | #endif | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Most 32 bit architectures use "unsigned int" size_t, | ||
| 63 | * and all 64 bit architectures use "unsigned long" size_t. | ||
| 64 | */ | ||
| 65 | #ifndef __kernel_size_t | ||
| 66 | #if __BITS_PER_LONG != 64 | ||
| 67 | typedef unsigned int __kernel_size_t; | ||
| 68 | typedef int __kernel_ssize_t; | ||
| 69 | typedef int __kernel_ptrdiff_t; | ||
| 70 | #else | ||
| 71 | typedef __kernel_ulong_t __kernel_size_t; | ||
| 72 | typedef __kernel_long_t __kernel_ssize_t; | ||
| 73 | typedef __kernel_long_t __kernel_ptrdiff_t; | ||
| 74 | #endif | ||
| 75 | #endif | ||
| 76 | |||
| 77 | #ifndef __kernel_fsid_t | ||
| 78 | typedef struct { | ||
| 79 | int val[2]; | ||
| 80 | } __kernel_fsid_t; | ||
| 81 | #endif | ||
| 82 | |||
| 83 | /* | ||
| 84 | * anything below here should be completely generic | ||
| 85 | */ | ||
| 86 | typedef __kernel_long_t __kernel_off_t; | ||
| 87 | typedef long long __kernel_loff_t; | ||
| 88 | typedef __kernel_long_t __kernel_time_t; | ||
| 89 | typedef __kernel_long_t __kernel_clock_t; | ||
| 90 | typedef int __kernel_timer_t; | ||
| 91 | typedef int __kernel_clockid_t; | ||
| 92 | typedef char * __kernel_caddr_t; | ||
| 93 | typedef unsigned short __kernel_uid16_t; | ||
| 94 | typedef unsigned short __kernel_gid16_t; | ||
| 95 | |||
| 96 | #endif /* __ASM_GENERIC_POSIX_TYPES_H */ | ||
| @@ -0,0 +1,68 @@ | |||
| 1 | #ifndef _UAPI_ASM_GENERIC_RESOURCE_H | ||
| 2 | #define _UAPI_ASM_GENERIC_RESOURCE_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Resource limit IDs | ||
| 6 | * | ||
| 7 | * ( Compatibility detail: there are architectures that have | ||
| 8 | * a different rlimit ID order in the 5-9 range and want | ||
| 9 | * to keep that order for binary compatibility. The reasons | ||
| 10 | * are historic and all new rlimits are identical across all | ||
| 11 | * arches. If an arch has such special order for some rlimits | ||
| 12 | * then it defines them prior including asm-generic/resource.h. ) | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define RLIMIT_CPU 0 /* CPU time in sec */ | ||
| 16 | #define RLIMIT_FSIZE 1 /* Maximum filesize */ | ||
| 17 | #define RLIMIT_DATA 2 /* max data size */ | ||
| 18 | #define RLIMIT_STACK 3 /* max stack size */ | ||
| 19 | #define RLIMIT_CORE 4 /* max core file size */ | ||
| 20 | |||
| 21 | #ifndef RLIMIT_RSS | ||
| 22 | # define RLIMIT_RSS 5 /* max resident set size */ | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #ifndef RLIMIT_NPROC | ||
| 26 | # define RLIMIT_NPROC 6 /* max number of processes */ | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #ifndef RLIMIT_NOFILE | ||
| 30 | # define RLIMIT_NOFILE 7 /* max number of open files */ | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifndef RLIMIT_MEMLOCK | ||
| 34 | # define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifndef RLIMIT_AS | ||
| 38 | # define RLIMIT_AS 9 /* address space limit */ | ||
| 39 | #endif | ||
| 40 | |||
| 41 | #define RLIMIT_LOCKS 10 /* maximum file locks held */ | ||
| 42 | #define RLIMIT_SIGPENDING 11 /* max number of pending signals */ | ||
| 43 | #define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ | ||
| 44 | #define RLIMIT_NICE 13 /* max nice prio allowed to raise to | ||
| 45 | 0-39 for nice level 19 .. -20 */ | ||
| 46 | #define RLIMIT_RTPRIO 14 /* maximum realtime priority */ | ||
| 47 | #define RLIMIT_RTTIME 15 /* timeout for RT tasks in us */ | ||
| 48 | #define RLIM_NLIMITS 16 | ||
| 49 | |||
| 50 | /* | ||
| 51 | * SuS says limits have to be unsigned. | ||
| 52 | * Which makes a ton more sense anyway. | ||
| 53 | * | ||
| 54 | * Some architectures override this (for compatibility reasons): | ||
| 55 | */ | ||
| 56 | #ifndef RLIM_INFINITY | ||
| 57 | # define RLIM_INFINITY (~0UL) | ||
| 58 | #endif | ||
| 59 | |||
| 60 | /* | ||
| 61 | * RLIMIT_STACK default maximum - some architectures override it: | ||
| 62 | */ | ||
| 63 | #ifndef _STK_LIM_MAX | ||
| 64 | # define _STK_LIM_MAX RLIM_INFINITY | ||
| 65 | #endif | ||
| 66 | |||
| 67 | |||
| 68 | #endif /* _UAPI_ASM_GENERIC_RESOURCE_H */ | ||
| @@ -0,0 +1,38 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SEMBUF_H | ||
| 2 | #define __ASM_GENERIC_SEMBUF_H | ||
| 3 | |||
| 4 | #include <asm/bitsperlong.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * The semid64_ds structure for x86 architecture. | ||
| 8 | * Note extra padding because this structure is passed back and forth | ||
| 9 | * between kernel and user space. | ||
| 10 | * | ||
| 11 | * semid64_ds was originally meant to be architecture specific, but | ||
| 12 | * everyone just ended up making identical copies without specific | ||
| 13 | * optimizations, so we may just as well all use the same one. | ||
| 14 | * | ||
| 15 | * 64 bit architectures typically define a 64 bit __kernel_time_t, | ||
| 16 | * so they do not need the first two padding words. | ||
| 17 | * On big-endian systems, the padding is in the wrong place. | ||
| 18 | * | ||
| 19 | * Pad space is left for: | ||
| 20 | * - 64-bit time_t to solve y2038 problem | ||
| 21 | * - 2 miscellaneous 32-bit values | ||
| 22 | */ | ||
| 23 | struct semid64_ds { | ||
| 24 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
| 25 | __kernel_time_t sem_otime; /* last semop time */ | ||
| 26 | #if __BITS_PER_LONG != 64 | ||
| 27 | unsigned long __unused1; | ||
| 28 | #endif | ||
| 29 | __kernel_time_t sem_ctime; /* last change time */ | ||
| 30 | #if __BITS_PER_LONG != 64 | ||
| 31 | unsigned long __unused2; | ||
| 32 | #endif | ||
| 33 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
| 34 | unsigned long __unused3; | ||
| 35 | unsigned long __unused4; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* __ASM_GENERIC_SEMBUF_H */ | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SETUP_H | ||
| 2 | #define __ASM_GENERIC_SETUP_H | ||
| 3 | |||
| 4 | #define COMMAND_LINE_SIZE 512 | ||
| 5 | |||
| 6 | #endif /* __ASM_GENERIC_SETUP_H */ | ||
| @@ -0,0 +1,59 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SHMBUF_H | ||
| 2 | #define __ASM_GENERIC_SHMBUF_H | ||
| 3 | |||
| 4 | #include <asm/bitsperlong.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * The shmid64_ds structure for x86 architecture. | ||
| 8 | * Note extra padding because this structure is passed back and forth | ||
| 9 | * between kernel and user space. | ||
| 10 | * | ||
| 11 | * shmid64_ds was originally meant to be architecture specific, but | ||
| 12 | * everyone just ended up making identical copies without specific | ||
| 13 | * optimizations, so we may just as well all use the same one. | ||
| 14 | * | ||
| 15 | * 64 bit architectures typically define a 64 bit __kernel_time_t, | ||
| 16 | * so they do not need the first two padding words. | ||
| 17 | * On big-endian systems, the padding is in the wrong place. | ||
| 18 | * | ||
| 19 | * | ||
| 20 | * Pad space is left for: | ||
| 21 | * - 64-bit time_t to solve y2038 problem | ||
| 22 | * - 2 miscellaneous 32-bit values | ||
| 23 | */ | ||
| 24 | |||
| 25 | struct shmid64_ds { | ||
| 26 | struct ipc64_perm shm_perm; /* operation perms */ | ||
| 27 | size_t shm_segsz; /* size of segment (bytes) */ | ||
| 28 | __kernel_time_t shm_atime; /* last attach time */ | ||
| 29 | #if __BITS_PER_LONG != 64 | ||
| 30 | unsigned long __unused1; | ||
| 31 | #endif | ||
| 32 | __kernel_time_t shm_dtime; /* last detach time */ | ||
| 33 | #if __BITS_PER_LONG != 64 | ||
| 34 | unsigned long __unused2; | ||
| 35 | #endif | ||
| 36 | __kernel_time_t shm_ctime; /* last change time */ | ||
| 37 | #if __BITS_PER_LONG != 64 | ||
| 38 | unsigned long __unused3; | ||
| 39 | #endif | ||
| 40 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
| 41 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
| 42 | unsigned long shm_nattch; /* no. of current attaches */ | ||
| 43 | unsigned long __unused4; | ||
| 44 | unsigned long __unused5; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct shminfo64 { | ||
| 48 | unsigned long shmmax; | ||
| 49 | unsigned long shmmin; | ||
| 50 | unsigned long shmmni; | ||
| 51 | unsigned long shmseg; | ||
| 52 | unsigned long shmall; | ||
| 53 | unsigned long __unused1; | ||
| 54 | unsigned long __unused2; | ||
| 55 | unsigned long __unused3; | ||
| 56 | unsigned long __unused4; | ||
| 57 | }; | ||
| 58 | |||
| 59 | #endif /* __ASM_GENERIC_SHMBUF_H */ | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SHMPARAM_H | ||
| 2 | #define __ASM_GENERIC_SHMPARAM_H | ||
| 3 | |||
| 4 | #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ | ||
| 5 | |||
| 6 | #endif /* _ASM_GENERIC_SHMPARAM_H */ | ||
| @@ -0,0 +1,298 @@ | |||
| 1 | #ifndef _UAPI_ASM_GENERIC_SIGINFO_H | ||
| 2 | #define _UAPI_ASM_GENERIC_SIGINFO_H | ||
| 3 | |||
| 4 | #include <linux/compiler.h> | ||
| 5 | #include <linux/types.h> | ||
| 6 | |||
| 7 | typedef union sigval { | ||
| 8 | int sival_int; | ||
| 9 | void __user *sival_ptr; | ||
| 10 | } sigval_t; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This is the size (including padding) of the part of the | ||
| 14 | * struct siginfo that is before the union. | ||
| 15 | */ | ||
| 16 | #ifndef __ARCH_SI_PREAMBLE_SIZE | ||
| 17 | #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define SI_MAX_SIZE 128 | ||
| 21 | #ifndef SI_PAD_SIZE | ||
| 22 | #define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #ifndef __ARCH_SI_UID_T | ||
| 26 | #define __ARCH_SI_UID_T __kernel_uid32_t | ||
| 27 | #endif | ||
| 28 | |||
| 29 | /* | ||
| 30 | * The default "si_band" type is "long", as specified by POSIX. | ||
| 31 | * However, some architectures want to override this to "int" | ||
| 32 | * for historical compatibility reasons, so we allow that. | ||
| 33 | */ | ||
| 34 | #ifndef __ARCH_SI_BAND_T | ||
| 35 | #define __ARCH_SI_BAND_T long | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #ifndef __ARCH_SI_CLOCK_T | ||
| 39 | #define __ARCH_SI_CLOCK_T __kernel_clock_t | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #ifndef __ARCH_SI_ATTRIBUTES | ||
| 43 | #define __ARCH_SI_ATTRIBUTES | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #ifndef HAVE_ARCH_SIGINFO_T | ||
| 47 | |||
| 48 | typedef struct siginfo { | ||
| 49 | int si_signo; | ||
| 50 | int si_errno; | ||
| 51 | int si_code; | ||
| 52 | |||
| 53 | union { | ||
| 54 | int _pad[SI_PAD_SIZE]; | ||
| 55 | |||
| 56 | /* kill() */ | ||
| 57 | struct { | ||
| 58 | __kernel_pid_t _pid; /* sender's pid */ | ||
| 59 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
| 60 | } _kill; | ||
| 61 | |||
| 62 | /* POSIX.1b timers */ | ||
| 63 | struct { | ||
| 64 | __kernel_timer_t _tid; /* timer id */ | ||
| 65 | int _overrun; /* overrun count */ | ||
| 66 | char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; | ||
| 67 | sigval_t _sigval; /* same as below */ | ||
| 68 | int _sys_private; /* not to be passed to user */ | ||
| 69 | } _timer; | ||
| 70 | |||
| 71 | /* POSIX.1b signals */ | ||
| 72 | struct { | ||
| 73 | __kernel_pid_t _pid; /* sender's pid */ | ||
| 74 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
| 75 | sigval_t _sigval; | ||
| 76 | } _rt; | ||
| 77 | |||
| 78 | /* SIGCHLD */ | ||
| 79 | struct { | ||
| 80 | __kernel_pid_t _pid; /* which child */ | ||
| 81 | __ARCH_SI_UID_T _uid; /* sender's uid */ | ||
| 82 | int _status; /* exit code */ | ||
| 83 | __ARCH_SI_CLOCK_T _utime; | ||
| 84 | __ARCH_SI_CLOCK_T _stime; | ||
| 85 | } _sigchld; | ||
| 86 | |||
| 87 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
| 88 | struct { | ||
| 89 | void __user *_addr; /* faulting insn/memory ref. */ | ||
| 90 | #ifdef __ARCH_SI_TRAPNO | ||
| 91 | int _trapno; /* TRAP # which caused the signal */ | ||
| 92 | #endif | ||
| 93 | short _addr_lsb; /* LSB of the reported address */ | ||
| 94 | } _sigfault; | ||
| 95 | |||
| 96 | /* SIGPOLL */ | ||
| 97 | struct { | ||
| 98 | __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
| 99 | int _fd; | ||
| 100 | } _sigpoll; | ||
| 101 | |||
| 102 | /* SIGSYS */ | ||
| 103 | struct { | ||
| 104 | void __user *_call_addr; /* calling user insn */ | ||
| 105 | int _syscall; /* triggering system call number */ | ||
| 106 | unsigned int _arch; /* AUDIT_ARCH_* of syscall */ | ||
| 107 | } _sigsys; | ||
| 108 | } _sifields; | ||
| 109 | } __ARCH_SI_ATTRIBUTES siginfo_t; | ||
| 110 | |||
| 111 | /* If the arch shares siginfo, then it has SIGSYS. */ | ||
| 112 | #define __ARCH_SIGSYS | ||
| 113 | #endif | ||
| 114 | |||
| 115 | /* | ||
| 116 | * How these fields are to be accessed. | ||
| 117 | */ | ||
| 118 | #define si_pid _sifields._kill._pid | ||
| 119 | #define si_uid _sifields._kill._uid | ||
| 120 | #define si_tid _sifields._timer._tid | ||
| 121 | #define si_overrun _sifields._timer._overrun | ||
| 122 | #define si_sys_private _sifields._timer._sys_private | ||
| 123 | #define si_status _sifields._sigchld._status | ||
| 124 | #define si_utime _sifields._sigchld._utime | ||
| 125 | #define si_stime _sifields._sigchld._stime | ||
| 126 | #define si_value _sifields._rt._sigval | ||
| 127 | #define si_int _sifields._rt._sigval.sival_int | ||
| 128 | #define si_ptr _sifields._rt._sigval.sival_ptr | ||
| 129 | #define si_addr _sifields._sigfault._addr | ||
| 130 | #ifdef __ARCH_SI_TRAPNO | ||
| 131 | #define si_trapno _sifields._sigfault._trapno | ||
| 132 | #endif | ||
| 133 | #define si_addr_lsb _sifields._sigfault._addr_lsb | ||
| 134 | #define si_band _sifields._sigpoll._band | ||
| 135 | #define si_fd _sifields._sigpoll._fd | ||
| 136 | #ifdef __ARCH_SIGSYS | ||
| 137 | #define si_call_addr _sifields._sigsys._call_addr | ||
| 138 | #define si_syscall _sifields._sigsys._syscall | ||
| 139 | #define si_arch _sifields._sigsys._arch | ||
| 140 | #endif | ||
| 141 | |||
| 142 | #ifndef __KERNEL__ | ||
| 143 | #define __SI_KILL 0 | ||
| 144 | #define __SI_TIMER 0 | ||
| 145 | #define __SI_POLL 0 | ||
| 146 | #define __SI_FAULT 0 | ||
| 147 | #define __SI_CHLD 0 | ||
| 148 | #define __SI_RT 0 | ||
| 149 | #define __SI_MESGQ 0 | ||
| 150 | #define __SI_SYS 0 | ||
| 151 | #define __SI_CODE(T,N) (N) | ||
| 152 | #endif | ||
| 153 | |||
| 154 | /* | ||
| 155 | * si_code values | ||
| 156 | * Digital reserves positive values for kernel-generated signals. | ||
| 157 | */ | ||
| 158 | #define SI_USER 0 /* sent by kill, sigsend, raise */ | ||
| 159 | #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */ | ||
| 160 | #define SI_QUEUE -1 /* sent by sigqueue */ | ||
| 161 | #define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */ | ||
| 162 | #define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */ | ||
| 163 | #define SI_ASYNCIO -4 /* sent by AIO completion */ | ||
| 164 | #define SI_SIGIO -5 /* sent by queued SIGIO */ | ||
| 165 | #define SI_TKILL -6 /* sent by tkill system call */ | ||
| 166 | #define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */ | ||
| 167 | |||
| 168 | #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) | ||
| 169 | #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) | ||
| 170 | |||
| 171 | /* | ||
| 172 | * SIGILL si_codes | ||
| 173 | */ | ||
| 174 | #define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */ | ||
| 175 | #define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */ | ||
| 176 | #define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */ | ||
| 177 | #define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */ | ||
| 178 | #define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */ | ||
| 179 | #define ILL_PRVREG (__SI_FAULT|6) /* privileged register */ | ||
| 180 | #define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */ | ||
| 181 | #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */ | ||
| 182 | #define NSIGILL 8 | ||
| 183 | |||
| 184 | /* | ||
| 185 | * SIGFPE si_codes | ||
| 186 | */ | ||
| 187 | #define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */ | ||
| 188 | #define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */ | ||
| 189 | #define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */ | ||
| 190 | #define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */ | ||
| 191 | #define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */ | ||
| 192 | #define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */ | ||
| 193 | #define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */ | ||
| 194 | #define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */ | ||
| 195 | #define NSIGFPE 8 | ||
| 196 | |||
| 197 | /* | ||
| 198 | * SIGSEGV si_codes | ||
| 199 | */ | ||
| 200 | #define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */ | ||
| 201 | #define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */ | ||
| 202 | #define NSIGSEGV 2 | ||
| 203 | |||
| 204 | /* | ||
| 205 | * SIGBUS si_codes | ||
| 206 | */ | ||
| 207 | #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ | ||
| 208 | #define BUS_ADRERR (__SI_FAULT|2) /* non-existent physical address */ | ||
| 209 | #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ | ||
| 210 | /* hardware memory error consumed on a machine check: action required */ | ||
| 211 | #define BUS_MCEERR_AR (__SI_FAULT|4) | ||
| 212 | /* hardware memory error detected in process but not consumed: action optional*/ | ||
| 213 | #define BUS_MCEERR_AO (__SI_FAULT|5) | ||
| 214 | #define NSIGBUS 5 | ||
| 215 | |||
| 216 | /* | ||
| 217 | * SIGTRAP si_codes | ||
| 218 | */ | ||
| 219 | #define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */ | ||
| 220 | #define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ | ||
| 221 | #define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */ | ||
| 222 | #define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */ | ||
| 223 | #define NSIGTRAP 4 | ||
| 224 | |||
| 225 | /* | ||
| 226 | * SIGCHLD si_codes | ||
| 227 | */ | ||
| 228 | #define CLD_EXITED (__SI_CHLD|1) /* child has exited */ | ||
| 229 | #define CLD_KILLED (__SI_CHLD|2) /* child was killed */ | ||
| 230 | #define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */ | ||
| 231 | #define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */ | ||
| 232 | #define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */ | ||
| 233 | #define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */ | ||
| 234 | #define NSIGCHLD 6 | ||
| 235 | |||
| 236 | /* | ||
| 237 | * SIGPOLL si_codes | ||
| 238 | */ | ||
| 239 | #define POLL_IN (__SI_POLL|1) /* data input available */ | ||
| 240 | #define POLL_OUT (__SI_POLL|2) /* output buffers available */ | ||
| 241 | #define POLL_MSG (__SI_POLL|3) /* input message available */ | ||
| 242 | #define POLL_ERR (__SI_POLL|4) /* i/o error */ | ||
| 243 | #define POLL_PRI (__SI_POLL|5) /* high priority input available */ | ||
| 244 | #define POLL_HUP (__SI_POLL|6) /* device disconnected */ | ||
| 245 | #define NSIGPOLL 6 | ||
| 246 | |||
| 247 | /* | ||
| 248 | * SIGSYS si_codes | ||
| 249 | */ | ||
| 250 | #define SYS_SECCOMP (__SI_SYS|1) /* seccomp triggered */ | ||
| 251 | #define NSIGSYS 1 | ||
| 252 | |||
| 253 | /* | ||
| 254 | * sigevent definitions | ||
| 255 | * | ||
| 256 | * It seems likely that SIGEV_THREAD will have to be handled from | ||
| 257 | * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the | ||
| 258 | * thread manager then catches and does the appropriate nonsense. | ||
| 259 | * However, everything is written out here so as to not get lost. | ||
| 260 | */ | ||
| 261 | #define SIGEV_SIGNAL 0 /* notify via signal */ | ||
| 262 | #define SIGEV_NONE 1 /* other notification: meaningless */ | ||
| 263 | #define SIGEV_THREAD 2 /* deliver via thread creation */ | ||
| 264 | #define SIGEV_THREAD_ID 4 /* deliver to thread */ | ||
| 265 | |||
| 266 | /* | ||
| 267 | * This works because the alignment is ok on all current architectures | ||
| 268 | * but we leave open this being overridden in the future | ||
| 269 | */ | ||
| 270 | #ifndef __ARCH_SIGEV_PREAMBLE_SIZE | ||
| 271 | #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t)) | ||
| 272 | #endif | ||
| 273 | |||
| 274 | #define SIGEV_MAX_SIZE 64 | ||
| 275 | #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \ | ||
| 276 | / sizeof(int)) | ||
| 277 | |||
| 278 | typedef struct sigevent { | ||
| 279 | sigval_t sigev_value; | ||
| 280 | int sigev_signo; | ||
| 281 | int sigev_notify; | ||
| 282 | union { | ||
| 283 | int _pad[SIGEV_PAD_SIZE]; | ||
| 284 | int _tid; | ||
| 285 | |||
| 286 | struct { | ||
| 287 | void (*_function)(sigval_t); | ||
| 288 | void *_attribute; /* really pthread_attr_t */ | ||
| 289 | } _sigev_thread; | ||
| 290 | } _sigev_un; | ||
| 291 | } sigevent_t; | ||
| 292 | |||
| 293 | #define sigev_notify_function _sigev_un._sigev_thread._function | ||
| 294 | #define sigev_notify_attributes _sigev_un._sigev_thread._attribute | ||
| 295 | #define sigev_notify_thread_id _sigev_un._tid | ||
| 296 | |||
| 297 | |||
| 298 | #endif /* _UAPI_ASM_GENERIC_SIGINFO_H */ | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SIGNAL_DEFS_H | ||
| 2 | #define __ASM_GENERIC_SIGNAL_DEFS_H | ||
| 3 | |||
| 4 | #include <linux/compiler.h> | ||
| 5 | |||
| 6 | #ifndef SIG_BLOCK | ||
| 7 | #define SIG_BLOCK 0 /* for blocking signals */ | ||
| 8 | #endif | ||
| 9 | #ifndef SIG_UNBLOCK | ||
| 10 | #define SIG_UNBLOCK 1 /* for unblocking signals */ | ||
| 11 | #endif | ||
| 12 | #ifndef SIG_SETMASK | ||
| 13 | #define SIG_SETMASK 2 /* for setting the signal mask */ | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #ifndef __ASSEMBLY__ | ||
| 17 | typedef void __signalfn_t(int); | ||
| 18 | typedef __signalfn_t __user *__sighandler_t; | ||
| 19 | |||
| 20 | typedef void __restorefn_t(void); | ||
| 21 | typedef __restorefn_t __user *__sigrestore_t; | ||
| 22 | |||
| 23 | #define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */ | ||
| 24 | #define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */ | ||
| 25 | #define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */ | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #endif /* __ASM_GENERIC_SIGNAL_DEFS_H */ | ||
| @@ -0,0 +1,123 @@ | |||
| 1 | #ifndef _UAPI__ASM_GENERIC_SIGNAL_H | ||
| 2 | #define _UAPI__ASM_GENERIC_SIGNAL_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #define _NSIG 64 | ||
| 7 | #define _NSIG_BPW __BITS_PER_LONG | ||
| 8 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
| 9 | |||
| 10 | #define SIGHUP 1 | ||
| 11 | #define SIGINT 2 | ||
| 12 | #define SIGQUIT 3 | ||
| 13 | #define SIGILL 4 | ||
| 14 | #define SIGTRAP 5 | ||
| 15 | #define SIGABRT 6 | ||
| 16 | #define SIGIOT 6 | ||
| 17 | #define SIGBUS 7 | ||
| 18 | #define SIGFPE 8 | ||
| 19 | #define SIGKILL 9 | ||
| 20 | #define SIGUSR1 10 | ||
| 21 | #define SIGSEGV 11 | ||
| 22 | #define SIGUSR2 12 | ||
| 23 | #define SIGPIPE 13 | ||
| 24 | #define SIGALRM 14 | ||
| 25 | #define SIGTERM 15 | ||
| 26 | #define SIGSTKFLT 16 | ||
| 27 | #define SIGCHLD 17 | ||
| 28 | #define SIGCONT 18 | ||
| 29 | #define SIGSTOP 19 | ||
| 30 | #define SIGTSTP 20 | ||
| 31 | #define SIGTTIN 21 | ||
| 32 | #define SIGTTOU 22 | ||
| 33 | #define SIGURG 23 | ||
| 34 | #define SIGXCPU 24 | ||
| 35 | #define SIGXFSZ 25 | ||
| 36 | #define SIGVTALRM 26 | ||
| 37 | #define SIGPROF 27 | ||
| 38 | #define SIGWINCH 28 | ||
| 39 | #define SIGIO 29 | ||
| 40 | #define SIGPOLL SIGIO | ||
| 41 | /* | ||
| 42 | #define SIGLOST 29 | ||
| 43 | */ | ||
| 44 | #define SIGPWR 30 | ||
| 45 | #define SIGSYS 31 | ||
| 46 | #define SIGUNUSED 31 | ||
| 47 | |||
| 48 | /* These should not be considered constants from userland. */ | ||
| 49 | #define SIGRTMIN 32 | ||
| 50 | #ifndef SIGRTMAX | ||
| 51 | #define SIGRTMAX _NSIG | ||
| 52 | #endif | ||
| 53 | |||
| 54 | /* | ||
| 55 | * SA_FLAGS values: | ||
| 56 | * | ||
| 57 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
| 58 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
| 59 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
| 60 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
| 61 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
| 62 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
| 63 | * | ||
| 64 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
| 65 | * Unix names RESETHAND and NODEFER respectively. | ||
| 66 | */ | ||
| 67 | #define SA_NOCLDSTOP 0x00000001 | ||
| 68 | #define SA_NOCLDWAIT 0x00000002 | ||
| 69 | #define SA_SIGINFO 0x00000004 | ||
| 70 | #define SA_ONSTACK 0x08000000 | ||
| 71 | #define SA_RESTART 0x10000000 | ||
| 72 | #define SA_NODEFER 0x40000000 | ||
| 73 | #define SA_RESETHAND 0x80000000 | ||
| 74 | |||
| 75 | #define SA_NOMASK SA_NODEFER | ||
| 76 | #define SA_ONESHOT SA_RESETHAND | ||
| 77 | |||
| 78 | /* | ||
| 79 | * New architectures should not define the obsolete | ||
| 80 | * SA_RESTORER 0x04000000 | ||
| 81 | */ | ||
| 82 | |||
| 83 | /* | ||
| 84 | * sigaltstack controls | ||
| 85 | */ | ||
| 86 | #define SS_ONSTACK 1 | ||
| 87 | #define SS_DISABLE 2 | ||
| 88 | |||
| 89 | #define MINSIGSTKSZ 2048 | ||
| 90 | #define SIGSTKSZ 8192 | ||
| 91 | |||
| 92 | #ifndef __ASSEMBLY__ | ||
| 93 | typedef struct { | ||
| 94 | unsigned long sig[_NSIG_WORDS]; | ||
| 95 | } sigset_t; | ||
| 96 | |||
| 97 | /* not actually used, but required for linux/syscalls.h */ | ||
| 98 | typedef unsigned long old_sigset_t; | ||
| 99 | |||
| 100 | #include <asm-generic/signal-defs.h> | ||
| 101 | |||
| 102 | struct sigaction { | ||
| 103 | __sighandler_t sa_handler; | ||
| 104 | unsigned long sa_flags; | ||
| 105 | #ifdef SA_RESTORER | ||
| 106 | __sigrestore_t sa_restorer; | ||
| 107 | #endif | ||
| 108 | sigset_t sa_mask; /* mask last for extensibility */ | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct k_sigaction { | ||
| 112 | struct sigaction sa; | ||
| 113 | }; | ||
| 114 | |||
| 115 | typedef struct sigaltstack { | ||
| 116 | void __user *ss_sp; | ||
| 117 | int ss_flags; | ||
| 118 | size_t ss_size; | ||
| 119 | } stack_t; | ||
| 120 | |||
| 121 | #endif /* __ASSEMBLY__ */ | ||
| 122 | |||
| 123 | #endif /* _UAPI__ASM_GENERIC_SIGNAL_H */ | ||
| @@ -0,0 +1,75 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SOCKET_H | ||
| 2 | #define __ASM_GENERIC_SOCKET_H | ||
| 3 | |||
| 4 | #include <asm/sockios.h> | ||
| 5 | |||
| 6 | /* For setsockopt(2) */ | ||
| 7 | #define SOL_SOCKET 1 | ||
| 8 | |||
| 9 | #define SO_DEBUG 1 | ||
| 10 | #define SO_REUSEADDR 2 | ||
| 11 | #define SO_TYPE 3 | ||
| 12 | #define SO_ERROR 4 | ||
| 13 | #define SO_DONTROUTE 5 | ||
| 14 | #define SO_BROADCAST 6 | ||
| 15 | #define SO_SNDBUF 7 | ||
| 16 | #define SO_RCVBUF 8 | ||
| 17 | #define SO_SNDBUFFORCE 32 | ||
| 18 | #define SO_RCVBUFFORCE 33 | ||
| 19 | #define SO_KEEPALIVE 9 | ||
| 20 | #define SO_OOBINLINE 10 | ||
| 21 | #define SO_NO_CHECK 11 | ||
| 22 | #define SO_PRIORITY 12 | ||
| 23 | #define SO_LINGER 13 | ||
| 24 | #define SO_BSDCOMPAT 14 | ||
| 25 | /* To add :#define SO_REUSEPORT 15 */ | ||
| 26 | |||
| 27 | #ifndef SO_PASSCRED /* powerpc only differs in these */ | ||
| 28 | #define SO_PASSCRED 16 | ||
| 29 | #define SO_PEERCRED 17 | ||
| 30 | #define SO_RCVLOWAT 18 | ||
| 31 | #define SO_SNDLOWAT 19 | ||
| 32 | #define SO_RCVTIMEO 20 | ||
| 33 | #define SO_SNDTIMEO 21 | ||
| 34 | #endif | ||
| 35 | |||
| 36 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
| 37 | #define SO_SECURITY_AUTHENTICATION 22 | ||
| 38 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
| 39 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
| 40 | |||
| 41 | #define SO_BINDTODEVICE 25 | ||
| 42 | |||
| 43 | /* Socket filtering */ | ||
| 44 | #define SO_ATTACH_FILTER 26 | ||
| 45 | #define SO_DETACH_FILTER 27 | ||
| 46 | |||
| 47 | #define SO_PEERNAME 28 | ||
| 48 | #define SO_TIMESTAMP 29 | ||
| 49 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
| 50 | |||
| 51 | #define SO_ACCEPTCONN 30 | ||
| 52 | |||
| 53 | #define SO_PEERSEC 31 | ||
| 54 | #define SO_PASSSEC 34 | ||
| 55 | #define SO_TIMESTAMPNS 35 | ||
| 56 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
| 57 | |||
| 58 | #define SO_MARK 36 | ||
| 59 | |||
| 60 | #define SO_TIMESTAMPING 37 | ||
| 61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
| 62 | |||
| 63 | #define SO_PROTOCOL 38 | ||
| 64 | #define SO_DOMAIN 39 | ||
| 65 | |||
| 66 | #define SO_RXQ_OVFL 40 | ||
| 67 | |||
| 68 | #define SO_WIFI_STATUS 41 | ||
| 69 | #define SCM_WIFI_STATUS SO_WIFI_STATUS | ||
| 70 | #define SO_PEEK_OFF 42 | ||
| 71 | |||
| 72 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ | ||
| 73 | #define SO_NOFCS 43 | ||
| 74 | |||
| 75 | #endif /* __ASM_GENERIC_SOCKET_H */ | ||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef __ASM_GENERIC_SOCKIOS_H | ||
| 2 | #define __ASM_GENERIC_SOCKIOS_H | ||
| 3 | |||
| 4 | /* Socket-level I/O control calls. */ | ||
| 5 | #define FIOSETOWN 0x8901 | ||
| 6 | #define SIOCSPGRP 0x8902 | ||
| 7 | #define FIOGETOWN 0x8903 | ||
| 8 | #define SIOCGPGRP 0x8904 | ||
| 9 | #define SIOCATMARK 0x8905 | ||
| 10 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
| 11 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
| 12 | |||
| 13 | #endif /* __ASM_GENERIC_SOCKIOS_H */ | ||
| @@ -0,0 +1,72 @@ | |||
| 1 | #ifndef __ASM_GENERIC_STAT_H | ||
| 2 | #define __ASM_GENERIC_STAT_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Everybody gets this wrong and has to stick with it for all | ||
| 6 | * eternity. Hopefully, this version gets used by new architectures | ||
| 7 | * so they don't fall into the same traps. | ||
| 8 | * | ||
| 9 | * stat64 is copied from powerpc64, with explicit padding added. | ||
| 10 | * stat is the same structure layout on 64-bit, without the 'long long' | ||
| 11 | * types. | ||
| 12 | * | ||
| 13 | * By convention, 64 bit architectures use the stat interface, while | ||
| 14 | * 32 bit architectures use the stat64 interface. Note that we don't | ||
| 15 | * provide an __old_kernel_stat here, which new architecture should | ||
| 16 | * not have to start with. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <asm/bitsperlong.h> | ||
| 20 | |||
| 21 | #define STAT_HAVE_NSEC 1 | ||
| 22 | |||
| 23 | struct stat { | ||
| 24 | unsigned long st_dev; /* Device. */ | ||
| 25 | unsigned long st_ino; /* File serial number. */ | ||
| 26 | unsigned int st_mode; /* File mode. */ | ||
| 27 | unsigned int st_nlink; /* Link count. */ | ||
| 28 | unsigned int st_uid; /* User ID of the file's owner. */ | ||
| 29 | unsigned int st_gid; /* Group ID of the file's group. */ | ||
| 30 | unsigned long st_rdev; /* Device number, if device. */ | ||
| 31 | unsigned long __pad1; | ||
| 32 | long st_size; /* Size of file, in bytes. */ | ||
| 33 | int st_blksize; /* Optimal block size for I/O. */ | ||
| 34 | int __pad2; | ||
| 35 | long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 36 | long st_atime; /* Time of last access. */ | ||
| 37 | unsigned long st_atime_nsec; | ||
| 38 | long st_mtime; /* Time of last modification. */ | ||
| 39 | unsigned long st_mtime_nsec; | ||
| 40 | long st_ctime; /* Time of last status change. */ | ||
| 41 | unsigned long st_ctime_nsec; | ||
| 42 | unsigned int __unused4; | ||
| 43 | unsigned int __unused5; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ | ||
| 47 | #if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64) | ||
| 48 | struct stat64 { | ||
| 49 | unsigned long long st_dev; /* Device. */ | ||
| 50 | unsigned long long st_ino; /* File serial number. */ | ||
| 51 | unsigned int st_mode; /* File mode. */ | ||
| 52 | unsigned int st_nlink; /* Link count. */ | ||
| 53 | unsigned int st_uid; /* User ID of the file's owner. */ | ||
| 54 | unsigned int st_gid; /* Group ID of the file's group. */ | ||
| 55 | unsigned long long st_rdev; /* Device number, if device. */ | ||
| 56 | unsigned long long __pad1; | ||
| 57 | long long st_size; /* Size of file, in bytes. */ | ||
| 58 | int st_blksize; /* Optimal block size for I/O. */ | ||
| 59 | int __pad2; | ||
| 60 | long long st_blocks; /* Number 512-byte blocks allocated. */ | ||
| 61 | int st_atime; /* Time of last access. */ | ||
| 62 | unsigned int st_atime_nsec; | ||
| 63 | int st_mtime; /* Time of last modification. */ | ||
| 64 | unsigned int st_mtime_nsec; | ||
| 65 | int st_ctime; /* Time of last status change. */ | ||
| 66 | unsigned int st_ctime_nsec; | ||
| 67 | unsigned int __unused4; | ||
| 68 | unsigned int __unused5; | ||
| 69 | }; | ||
| 70 | #endif | ||
| 71 | |||
| 72 | #endif /* __ASM_GENERIC_STAT_H */ | ||
| @@ -0,0 +1,83 @@ | |||
| 1 | #ifndef _UAPI_GENERIC_STATFS_H | ||
| 2 | #define _UAPI_GENERIC_STATFS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | |||
| 7 | /* | ||
| 8 | * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'. | ||
| 9 | * Yes, they differ in signedness as well as size. | ||
| 10 | * Special cases can override it for themselves -- except for S390x, which | ||
| 11 | * is just a little too special for us. And MIPS, which I'm not touching | ||
| 12 | * with a 10' pole. | ||
| 13 | */ | ||
| 14 | #ifndef __statfs_word | ||
| 15 | #if __BITS_PER_LONG == 64 | ||
| 16 | #define __statfs_word long | ||
| 17 | #else | ||
| 18 | #define __statfs_word __u32 | ||
| 19 | #endif | ||
| 20 | #endif | ||
| 21 | |||
| 22 | struct statfs { | ||
| 23 | __statfs_word f_type; | ||
| 24 | __statfs_word f_bsize; | ||
| 25 | __statfs_word f_blocks; | ||
| 26 | __statfs_word f_bfree; | ||
| 27 | __statfs_word f_bavail; | ||
| 28 | __statfs_word f_files; | ||
| 29 | __statfs_word f_ffree; | ||
| 30 | __kernel_fsid_t f_fsid; | ||
| 31 | __statfs_word f_namelen; | ||
| 32 | __statfs_word f_frsize; | ||
| 33 | __statfs_word f_flags; | ||
| 34 | __statfs_word f_spare[4]; | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* | ||
| 38 | * ARM needs to avoid the 32-bit padding at the end, for consistency | ||
| 39 | * between EABI and OABI | ||
| 40 | */ | ||
| 41 | #ifndef ARCH_PACK_STATFS64 | ||
| 42 | #define ARCH_PACK_STATFS64 | ||
| 43 | #endif | ||
| 44 | |||
| 45 | struct statfs64 { | ||
| 46 | __statfs_word f_type; | ||
| 47 | __statfs_word f_bsize; | ||
| 48 | __u64 f_blocks; | ||
| 49 | __u64 f_bfree; | ||
| 50 | __u64 f_bavail; | ||
| 51 | __u64 f_files; | ||
| 52 | __u64 f_ffree; | ||
| 53 | __kernel_fsid_t f_fsid; | ||
| 54 | __statfs_word f_namelen; | ||
| 55 | __statfs_word f_frsize; | ||
| 56 | __statfs_word f_flags; | ||
| 57 | __statfs_word f_spare[4]; | ||
| 58 | } ARCH_PACK_STATFS64; | ||
| 59 | |||
| 60 | /* | ||
| 61 | * IA64 and x86_64 need to avoid the 32-bit padding at the end, | ||
| 62 | * to be compatible with the i386 ABI | ||
| 63 | */ | ||
| 64 | #ifndef ARCH_PACK_COMPAT_STATFS64 | ||
| 65 | #define ARCH_PACK_COMPAT_STATFS64 | ||
| 66 | #endif | ||
| 67 | |||
| 68 | struct compat_statfs64 { | ||
| 69 | __u32 f_type; | ||
| 70 | __u32 f_bsize; | ||
| 71 | __u64 f_blocks; | ||
| 72 | __u64 f_bfree; | ||
| 73 | __u64 f_bavail; | ||
| 74 | __u64 f_files; | ||
| 75 | __u64 f_ffree; | ||
| 76 | __kernel_fsid_t f_fsid; | ||
| 77 | __u32 f_namelen; | ||
| 78 | __u32 f_frsize; | ||
| 79 | __u32 f_flags; | ||
| 80 | __u32 f_spare[4]; | ||
| 81 | } ARCH_PACK_COMPAT_STATFS64; | ||
| 82 | |||
| 83 | #endif /* _UAPI_GENERIC_STATFS_H */ | ||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _ASM_GENERIC_SWAB_H | ||
| 2 | #define _ASM_GENERIC_SWAB_H | ||
| 3 | |||
| 4 | #include <asm/bitsperlong.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * 32 bit architectures typically (but not always) want to | ||
| 8 | * set __SWAB_64_THRU_32__. In user space, this is only | ||
| 9 | * valid if the compiler supports 64 bit data types. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #if __BITS_PER_LONG == 32 | ||
| 13 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
| 14 | #define __SWAB_64_THRU_32__ | ||
| 15 | #endif | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #endif /* _ASM_GENERIC_SWAB_H */ | ||
| @@ -0,0 +1,199 @@ | |||
| 1 | #ifndef __ASM_GENERIC_TERMBITS_H | ||
| 2 | #define __ASM_GENERIC_TERMBITS_H | ||
| 3 | |||
| 4 | #include <linux/posix_types.h> | ||
| 5 | |||
| 6 | typedef unsigned char cc_t; | ||
| 7 | typedef unsigned int speed_t; | ||
| 8 | typedef unsigned int tcflag_t; | ||
| 9 | |||
| 10 | #define NCCS 19 | ||
| 11 | struct termios { | ||
| 12 | tcflag_t c_iflag; /* input mode flags */ | ||
| 13 | tcflag_t c_oflag; /* output mode flags */ | ||
| 14 | tcflag_t c_cflag; /* control mode flags */ | ||
| 15 | tcflag_t c_lflag; /* local mode flags */ | ||
| 16 | cc_t c_line; /* line discipline */ | ||
| 17 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct termios2 { | ||
| 21 | tcflag_t c_iflag; /* input mode flags */ | ||
| 22 | tcflag_t c_oflag; /* output mode flags */ | ||
| 23 | tcflag_t c_cflag; /* control mode flags */ | ||
| 24 | tcflag_t c_lflag; /* local mode flags */ | ||
| 25 | cc_t c_line; /* line discipline */ | ||
| 26 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 27 | speed_t c_ispeed; /* input speed */ | ||
| 28 | speed_t c_ospeed; /* output speed */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ktermios { | ||
| 32 | tcflag_t c_iflag; /* input mode flags */ | ||
| 33 | tcflag_t c_oflag; /* output mode flags */ | ||
| 34 | tcflag_t c_cflag; /* control mode flags */ | ||
| 35 | tcflag_t c_lflag; /* local mode flags */ | ||
| 36 | cc_t c_line; /* line discipline */ | ||
| 37 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 38 | speed_t c_ispeed; /* input speed */ | ||
| 39 | speed_t c_ospeed; /* output speed */ | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* c_cc characters */ | ||
| 43 | #define VINTR 0 | ||
| 44 | #define VQUIT 1 | ||
| 45 | #define VERASE 2 | ||
| 46 | #define VKILL 3 | ||
| 47 | #define VEOF 4 | ||
| 48 | #define VTIME 5 | ||
| 49 | #define VMIN 6 | ||
| 50 | #define VSWTC 7 | ||
| 51 | #define VSTART 8 | ||
| 52 | #define VSTOP 9 | ||
| 53 | #define VSUSP 10 | ||
| 54 | #define VEOL 11 | ||
| 55 | #define VREPRINT 12 | ||
| 56 | #define VDISCARD 13 | ||
| 57 | #define VWERASE 14 | ||
| 58 | #define VLNEXT 15 | ||
| 59 | #define VEOL2 16 | ||
| 60 | |||
| 61 | /* c_iflag bits */ | ||
| 62 | #define IGNBRK 0000001 | ||
| 63 | #define BRKINT 0000002 | ||
| 64 | #define IGNPAR 0000004 | ||
| 65 | #define PARMRK 0000010 | ||
| 66 | #define INPCK 0000020 | ||
| 67 | #define ISTRIP 0000040 | ||
| 68 | #define INLCR 0000100 | ||
| 69 | #define IGNCR 0000200 | ||
| 70 | #define ICRNL 0000400 | ||
| 71 | #define IUCLC 0001000 | ||
| 72 | #define IXON 0002000 | ||
| 73 | #define IXANY 0004000 | ||
| 74 | #define IXOFF 0010000 | ||
| 75 | #define IMAXBEL 0020000 | ||
| 76 | #define IUTF8 0040000 | ||
| 77 | |||
| 78 | /* c_oflag bits */ | ||
| 79 | #define OPOST 0000001 | ||
| 80 | #define OLCUC 0000002 | ||
| 81 | #define ONLCR 0000004 | ||
| 82 | #define OCRNL 0000010 | ||
| 83 | #define ONOCR 0000020 | ||
| 84 | #define ONLRET 0000040 | ||
| 85 | #define OFILL 0000100 | ||
| 86 | #define OFDEL 0000200 | ||
| 87 | #define NLDLY 0000400 | ||
| 88 | #define NL0 0000000 | ||
| 89 | #define NL1 0000400 | ||
| 90 | #define CRDLY 0003000 | ||
| 91 | #define CR0 0000000 | ||
| 92 | #define CR1 0001000 | ||
| 93 | #define CR2 0002000 | ||
| 94 | #define CR3 0003000 | ||
| 95 | #define TABDLY 0014000 | ||
| 96 | #define TAB0 0000000 | ||
| 97 | #define TAB1 0004000 | ||
| 98 | #define TAB2 0010000 | ||
| 99 | #define TAB3 0014000 | ||
| 100 | #define XTABS 0014000 | ||
| 101 | #define BSDLY 0020000 | ||
| 102 | #define BS0 0000000 | ||
| 103 | #define BS1 0020000 | ||
| 104 | #define VTDLY 0040000 | ||
| 105 | #define VT0 0000000 | ||
| 106 | #define VT1 0040000 | ||
| 107 | #define FFDLY 0100000 | ||
| 108 | #define FF0 0000000 | ||
| 109 | #define FF1 0100000 | ||
| 110 | |||
| 111 | /* c_cflag bit meaning */ | ||
| 112 | #define CBAUD 0010017 | ||
| 113 | #define B0 0000000 /* hang up */ | ||
| 114 | #define B50 0000001 | ||
| 115 | #define B75 0000002 | ||
| 116 | #define B110 0000003 | ||
| 117 | #define B134 0000004 | ||
| 118 | #define B150 0000005 | ||
| 119 | #define B200 0000006 | ||
| 120 | #define B300 0000007 | ||
| 121 | #define B600 0000010 | ||
| 122 | #define B1200 0000011 | ||
| 123 | #define B1800 0000012 | ||
| 124 | #define B2400 0000013 | ||
| 125 | #define B4800 0000014 | ||
| 126 | #define B9600 0000015 | ||
| 127 | #define B19200 0000016 | ||
| 128 | #define B38400 0000017 | ||
| 129 | #define EXTA B19200 | ||
| 130 | #define EXTB B38400 | ||
| 131 | #define CSIZE 0000060 | ||
| 132 | #define CS5 0000000 | ||
| 133 | #define CS6 0000020 | ||
| 134 | #define CS7 0000040 | ||
| 135 | #define CS8 0000060 | ||
| 136 | #define CSTOPB 0000100 | ||
| 137 | #define CREAD 0000200 | ||
| 138 | #define PARENB 0000400 | ||
| 139 | #define PARODD 0001000 | ||
| 140 | #define HUPCL 0002000 | ||
| 141 | #define CLOCAL 0004000 | ||
| 142 | #define CBAUDEX 0010000 | ||
| 143 | #define BOTHER 0010000 | ||
| 144 | #define B57600 0010001 | ||
| 145 | #define B115200 0010002 | ||
| 146 | #define B230400 0010003 | ||
| 147 | #define B460800 0010004 | ||
| 148 | #define B500000 0010005 | ||
| 149 | #define B576000 0010006 | ||
| 150 | #define B921600 0010007 | ||
| 151 | #define B1000000 0010010 | ||
| 152 | #define B1152000 0010011 | ||
| 153 | #define B1500000 0010012 | ||
| 154 | #define B2000000 0010013 | ||
| 155 | #define B2500000 0010014 | ||
| 156 | #define B3000000 0010015 | ||
| 157 | #define B3500000 0010016 | ||
| 158 | #define B4000000 0010017 | ||
| 159 | #define CIBAUD 002003600000 /* input baud rate */ | ||
| 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
| 161 | #define CRTSCTS 020000000000 /* flow control */ | ||
| 162 | |||
| 163 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 164 | |||
| 165 | /* c_lflag bits */ | ||
| 166 | #define ISIG 0000001 | ||
| 167 | #define ICANON 0000002 | ||
| 168 | #define XCASE 0000004 | ||
| 169 | #define ECHO 0000010 | ||
| 170 | #define ECHOE 0000020 | ||
| 171 | #define ECHOK 0000040 | ||
| 172 | #define ECHONL 0000100 | ||
| 173 | #define NOFLSH 0000200 | ||
| 174 | #define TOSTOP 0000400 | ||
| 175 | #define ECHOCTL 0001000 | ||
| 176 | #define ECHOPRT 0002000 | ||
| 177 | #define ECHOKE 0004000 | ||
| 178 | #define FLUSHO 0010000 | ||
| 179 | #define PENDIN 0040000 | ||
| 180 | #define IEXTEN 0100000 | ||
| 181 | #define EXTPROC 0200000 | ||
| 182 | |||
| 183 | /* tcflow() and TCXONC use these */ | ||
| 184 | #define TCOOFF 0 | ||
| 185 | #define TCOON 1 | ||
| 186 | #define TCIOFF 2 | ||
| 187 | #define TCION 3 | ||
| 188 | |||
| 189 | /* tcflush() and TCFLSH use these */ | ||
| 190 | #define TCIFLUSH 0 | ||
| 191 | #define TCOFLUSH 1 | ||
| 192 | #define TCIOFLUSH 2 | ||
| 193 | |||
| 194 | /* tcsetattr uses these */ | ||
| 195 | #define TCSANOW 0 | ||
| 196 | #define TCSADRAIN 1 | ||
| 197 | #define TCSAFLUSH 2 | ||
| 198 | |||
| 199 | #endif /* __ASM_GENERIC_TERMBITS_H */ | ||
| @@ -0,0 +1,50 @@ | |||
| 1 | #ifndef _UAPI_ASM_GENERIC_TERMIOS_H | ||
| 2 | #define _UAPI_ASM_GENERIC_TERMIOS_H | ||
| 3 | /* | ||
| 4 | * Most architectures have straight copies of the x86 code, with | ||
| 5 | * varying levels of bug fixes on top. Usually it's a good idea | ||
| 6 | * to use this generic version instead, but be careful to avoid | ||
| 7 | * ABI changes. | ||
| 8 | * New architectures should not provide their own version. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <asm/termbits.h> | ||
| 12 | #include <asm/ioctls.h> | ||
| 13 | |||
| 14 | struct winsize { | ||
| 15 | unsigned short ws_row; | ||
| 16 | unsigned short ws_col; | ||
| 17 | unsigned short ws_xpixel; | ||
| 18 | unsigned short ws_ypixel; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #define NCC 8 | ||
| 22 | struct termio { | ||
| 23 | unsigned short c_iflag; /* input mode flags */ | ||
| 24 | unsigned short c_oflag; /* output mode flags */ | ||
| 25 | unsigned short c_cflag; /* control mode flags */ | ||
| 26 | unsigned short c_lflag; /* local mode flags */ | ||
| 27 | unsigned char c_line; /* line discipline */ | ||
| 28 | unsigned char c_cc[NCC]; /* control characters */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | /* modem lines */ | ||
| 32 | #define TIOCM_LE 0x001 | ||
| 33 | #define TIOCM_DTR 0x002 | ||
| 34 | #define TIOCM_RTS 0x004 | ||
| 35 | #define TIOCM_ST 0x008 | ||
| 36 | #define TIOCM_SR 0x010 | ||
| 37 | #define TIOCM_CTS 0x020 | ||
| 38 | #define TIOCM_CAR 0x040 | ||
| 39 | #define TIOCM_RNG 0x080 | ||
| 40 | #define TIOCM_DSR 0x100 | ||
| 41 | #define TIOCM_CD TIOCM_CAR | ||
| 42 | #define TIOCM_RI TIOCM_RNG | ||
| 43 | #define TIOCM_OUT1 0x2000 | ||
| 44 | #define TIOCM_OUT2 0x4000 | ||
| 45 | #define TIOCM_LOOP 0x8000 | ||
| 46 | |||
| 47 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
| 48 | |||
| 49 | |||
| 50 | #endif /* _UAPI_ASM_GENERIC_TERMIOS_H */ | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef _ASM_GENERIC_TYPES_H | ||
| 2 | #define _ASM_GENERIC_TYPES_H | ||
| 3 | /* | ||
| 4 | * int-ll64 is used practically everywhere now, | ||
| 5 | * so use it as a reasonable default. | ||
| 6 | */ | ||
| 7 | #include <asm-generic/int-ll64.h> | ||
| 8 | |||
| 9 | #endif /* _ASM_GENERIC_TYPES_H */ | ||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef __ASM_GENERIC_UCONTEXT_H | ||
| 2 | #define __ASM_GENERIC_UCONTEXT_H | ||
| 3 | |||
| 4 | struct ucontext { | ||
| 5 | unsigned long uc_flags; | ||
| 6 | struct ucontext *uc_link; | ||
| 7 | stack_t uc_stack; | ||
| 8 | struct sigcontext uc_mcontext; | ||
| 9 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif /* __ASM_GENERIC_UCONTEXT_H */ | ||
| @@ -0,0 +1,902 @@ | |||
| 1 | #include <asm/bitsperlong.h> | ||
| 2 | |||
| 3 | /* | ||
| 4 | * This file contains the system call numbers, based on the | ||
| 5 | * layout of the x86-64 architecture, which embeds the | ||
| 6 | * pointer to the syscall in the table. | ||
| 7 | * | ||
| 8 | * As a basic principle, no duplication of functionality | ||
| 9 | * should be added, e.g. we don't use lseek when llseek | ||
| 10 | * is present. New architectures should use this file | ||
| 11 | * and implement the less feature-full calls in user space. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __SYSCALL | ||
| 15 | #define __SYSCALL(x, y) | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #if __BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT) | ||
| 19 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32) | ||
| 20 | #else | ||
| 21 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64) | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #ifdef __SYSCALL_COMPAT | ||
| 25 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _comp) | ||
| 26 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp) | ||
| 27 | #else | ||
| 28 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys) | ||
| 29 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64) | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #define __NR_io_setup 0 | ||
| 33 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup) | ||
| 34 | #define __NR_io_destroy 1 | ||
| 35 | __SYSCALL(__NR_io_destroy, sys_io_destroy) | ||
| 36 | #define __NR_io_submit 2 | ||
| 37 | __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit) | ||
| 38 | #define __NR_io_cancel 3 | ||
| 39 | __SYSCALL(__NR_io_cancel, sys_io_cancel) | ||
| 40 | #define __NR_io_getevents 4 | ||
| 41 | __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents) | ||
| 42 | |||
| 43 | /* fs/xattr.c */ | ||
| 44 | #define __NR_setxattr 5 | ||
| 45 | __SYSCALL(__NR_setxattr, sys_setxattr) | ||
| 46 | #define __NR_lsetxattr 6 | ||
| 47 | __SYSCALL(__NR_lsetxattr, sys_lsetxattr) | ||
| 48 | #define __NR_fsetxattr 7 | ||
| 49 | __SYSCALL(__NR_fsetxattr, sys_fsetxattr) | ||
| 50 | #define __NR_getxattr 8 | ||
| 51 | __SYSCALL(__NR_getxattr, sys_getxattr) | ||
| 52 | #define __NR_lgetxattr 9 | ||
| 53 | __SYSCALL(__NR_lgetxattr, sys_lgetxattr) | ||
| 54 | #define __NR_fgetxattr 10 | ||
| 55 | __SYSCALL(__NR_fgetxattr, sys_fgetxattr) | ||
| 56 | #define __NR_listxattr 11 | ||
| 57 | __SYSCALL(__NR_listxattr, sys_listxattr) | ||
| 58 | #define __NR_llistxattr 12 | ||
| 59 | __SYSCALL(__NR_llistxattr, sys_llistxattr) | ||
| 60 | #define __NR_flistxattr 13 | ||
| 61 | __SYSCALL(__NR_flistxattr, sys_flistxattr) | ||
| 62 | #define __NR_removexattr 14 | ||
| 63 | __SYSCALL(__NR_removexattr, sys_removexattr) | ||
| 64 | #define __NR_lremovexattr 15 | ||
| 65 | __SYSCALL(__NR_lremovexattr, sys_lremovexattr) | ||
| 66 | #define __NR_fremovexattr 16 | ||
| 67 | __SYSCALL(__NR_fremovexattr, sys_fremovexattr) | ||
| 68 | |||
| 69 | /* fs/dcache.c */ | ||
| 70 | #define __NR_getcwd 17 | ||
| 71 | __SYSCALL(__NR_getcwd, sys_getcwd) | ||
| 72 | |||
| 73 | /* fs/cookies.c */ | ||
| 74 | #define __NR_lookup_dcookie 18 | ||
| 75 | __SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie) | ||
| 76 | |||
| 77 | /* fs/eventfd.c */ | ||
| 78 | #define __NR_eventfd2 19 | ||
| 79 | __SYSCALL(__NR_eventfd2, sys_eventfd2) | ||
| 80 | |||
| 81 | /* fs/eventpoll.c */ | ||
| 82 | #define __NR_epoll_create1 20 | ||
| 83 | __SYSCALL(__NR_epoll_create1, sys_epoll_create1) | ||
| 84 | #define __NR_epoll_ctl 21 | ||
| 85 | __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) | ||
| 86 | #define __NR_epoll_pwait 22 | ||
| 87 | __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait) | ||
| 88 | |||
| 89 | /* fs/fcntl.c */ | ||
| 90 | #define __NR_dup 23 | ||
| 91 | __SYSCALL(__NR_dup, sys_dup) | ||
| 92 | #define __NR_dup3 24 | ||
| 93 | __SYSCALL(__NR_dup3, sys_dup3) | ||
| 94 | #define __NR3264_fcntl 25 | ||
| 95 | __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64) | ||
| 96 | |||
| 97 | /* fs/inotify_user.c */ | ||
| 98 | #define __NR_inotify_init1 26 | ||
| 99 | __SYSCALL(__NR_inotify_init1, sys_inotify_init1) | ||
| 100 | #define __NR_inotify_add_watch 27 | ||
| 101 | __SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch) | ||
| 102 | #define __NR_inotify_rm_watch 28 | ||
| 103 | __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) | ||
| 104 | |||
| 105 | /* fs/ioctl.c */ | ||
| 106 | #define __NR_ioctl 29 | ||
| 107 | __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl) | ||
| 108 | |||
| 109 | /* fs/ioprio.c */ | ||
| 110 | #define __NR_ioprio_set 30 | ||
| 111 | __SYSCALL(__NR_ioprio_set, sys_ioprio_set) | ||
| 112 | #define __NR_ioprio_get 31 | ||
| 113 | __SYSCALL(__NR_ioprio_get, sys_ioprio_get) | ||
| 114 | |||
| 115 | /* fs/locks.c */ | ||
| 116 | #define __NR_flock 32 | ||
| 117 | __SYSCALL(__NR_flock, sys_flock) | ||
| 118 | |||
| 119 | /* fs/namei.c */ | ||
| 120 | #define __NR_mknodat 33 | ||
| 121 | __SYSCALL(__NR_mknodat, sys_mknodat) | ||
| 122 | #define __NR_mkdirat 34 | ||
| 123 | __SYSCALL(__NR_mkdirat, sys_mkdirat) | ||
| 124 | #define __NR_unlinkat 35 | ||
| 125 | __SYSCALL(__NR_unlinkat, sys_unlinkat) | ||
| 126 | #define __NR_symlinkat 36 | ||
| 127 | __SYSCALL(__NR_symlinkat, sys_symlinkat) | ||
| 128 | #define __NR_linkat 37 | ||
| 129 | __SYSCALL(__NR_linkat, sys_linkat) | ||
| 130 | #define __NR_renameat 38 | ||
| 131 | __SYSCALL(__NR_renameat, sys_renameat) | ||
| 132 | |||
| 133 | /* fs/namespace.c */ | ||
| 134 | #define __NR_umount2 39 | ||
| 135 | __SYSCALL(__NR_umount2, sys_umount) | ||
| 136 | #define __NR_mount 40 | ||
| 137 | __SC_COMP(__NR_mount, sys_mount, compat_sys_mount) | ||
| 138 | #define __NR_pivot_root 41 | ||
| 139 | __SYSCALL(__NR_pivot_root, sys_pivot_root) | ||
| 140 | |||
| 141 | /* fs/nfsctl.c */ | ||
| 142 | #define __NR_nfsservctl 42 | ||
| 143 | __SYSCALL(__NR_nfsservctl, sys_ni_syscall) | ||
| 144 | |||
| 145 | /* fs/open.c */ | ||
| 146 | #define __NR3264_statfs 43 | ||
| 147 | __SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \ | ||
| 148 | compat_sys_statfs64) | ||
| 149 | #define __NR3264_fstatfs 44 | ||
| 150 | __SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \ | ||
| 151 | compat_sys_fstatfs64) | ||
| 152 | #define __NR3264_truncate 45 | ||
| 153 | __SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \ | ||
| 154 | compat_sys_truncate64) | ||
| 155 | #define __NR3264_ftruncate 46 | ||
| 156 | __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \ | ||
| 157 | compat_sys_ftruncate64) | ||
| 158 | |||
| 159 | #define __NR_fallocate 47 | ||
| 160 | __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate) | ||
| 161 | #define __NR_faccessat 48 | ||
| 162 | __SYSCALL(__NR_faccessat, sys_faccessat) | ||
| 163 | #define __NR_chdir 49 | ||
| 164 | __SYSCALL(__NR_chdir, sys_chdir) | ||
| 165 | #define __NR_fchdir 50 | ||
| 166 | __SYSCALL(__NR_fchdir, sys_fchdir) | ||
| 167 | #define __NR_chroot 51 | ||
| 168 | __SYSCALL(__NR_chroot, sys_chroot) | ||
| 169 | #define __NR_fchmod 52 | ||
| 170 | __SYSCALL(__NR_fchmod, sys_fchmod) | ||
| 171 | #define __NR_fchmodat 53 | ||
| 172 | __SYSCALL(__NR_fchmodat, sys_fchmodat) | ||
| 173 | #define __NR_fchownat 54 | ||
| 174 | __SYSCALL(__NR_fchownat, sys_fchownat) | ||
| 175 | #define __NR_fchown 55 | ||
| 176 | __SYSCALL(__NR_fchown, sys_fchown) | ||
| 177 | #define __NR_openat 56 | ||
| 178 | __SC_COMP(__NR_openat, sys_openat, compat_sys_openat) | ||
| 179 | #define __NR_close 57 | ||
| 180 | __SYSCALL(__NR_close, sys_close) | ||
| 181 | #define __NR_vhangup 58 | ||
| 182 | __SYSCALL(__NR_vhangup, sys_vhangup) | ||
| 183 | |||
| 184 | /* fs/pipe.c */ | ||
| 185 | #define __NR_pipe2 59 | ||
| 186 | __SYSCALL(__NR_pipe2, sys_pipe2) | ||
| 187 | |||
| 188 | /* fs/quota.c */ | ||
| 189 | #define __NR_quotactl 60 | ||
| 190 | __SYSCALL(__NR_quotactl, sys_quotactl) | ||
| 191 | |||
| 192 | /* fs/readdir.c */ | ||
| 193 | #define __NR_getdents64 61 | ||
| 194 | __SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64) | ||
| 195 | |||
| 196 | /* fs/read_write.c */ | ||
| 197 | #define __NR3264_lseek 62 | ||
| 198 | __SC_3264(__NR3264_lseek, sys_llseek, sys_lseek) | ||
| 199 | #define __NR_read 63 | ||
| 200 | __SYSCALL(__NR_read, sys_read) | ||
| 201 | #define __NR_write 64 | ||
| 202 | __SYSCALL(__NR_write, sys_write) | ||
| 203 | #define __NR_readv 65 | ||
| 204 | __SC_COMP(__NR_readv, sys_readv, compat_sys_readv) | ||
| 205 | #define __NR_writev 66 | ||
| 206 | __SC_COMP(__NR_writev, sys_writev, compat_sys_writev) | ||
| 207 | #define __NR_pread64 67 | ||
| 208 | __SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64) | ||
| 209 | #define __NR_pwrite64 68 | ||
| 210 | __SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64) | ||
| 211 | #define __NR_preadv 69 | ||
| 212 | __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv) | ||
| 213 | #define __NR_pwritev 70 | ||
| 214 | __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev) | ||
| 215 | |||
| 216 | /* fs/sendfile.c */ | ||
| 217 | #define __NR3264_sendfile 71 | ||
| 218 | __SYSCALL(__NR3264_sendfile, sys_sendfile64) | ||
| 219 | |||
| 220 | /* fs/select.c */ | ||
| 221 | #define __NR_pselect6 72 | ||
| 222 | __SC_COMP(__NR_pselect6, sys_pselect6, compat_sys_pselect6) | ||
| 223 | #define __NR_ppoll 73 | ||
| 224 | __SC_COMP(__NR_ppoll, sys_ppoll, compat_sys_ppoll) | ||
| 225 | |||
| 226 | /* fs/signalfd.c */ | ||
| 227 | #define __NR_signalfd4 74 | ||
| 228 | __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4) | ||
| 229 | |||
| 230 | /* fs/splice.c */ | ||
| 231 | #define __NR_vmsplice 75 | ||
| 232 | __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice) | ||
| 233 | #define __NR_splice 76 | ||
| 234 | __SYSCALL(__NR_splice, sys_splice) | ||
| 235 | #define __NR_tee 77 | ||
| 236 | __SYSCALL(__NR_tee, sys_tee) | ||
| 237 | |||
| 238 | /* fs/stat.c */ | ||
| 239 | #define __NR_readlinkat 78 | ||
| 240 | __SYSCALL(__NR_readlinkat, sys_readlinkat) | ||
| 241 | #define __NR3264_fstatat 79 | ||
| 242 | __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) | ||
| 243 | #define __NR3264_fstat 80 | ||
| 244 | __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) | ||
| 245 | |||
| 246 | /* fs/sync.c */ | ||
| 247 | #define __NR_sync 81 | ||
| 248 | __SYSCALL(__NR_sync, sys_sync) | ||
| 249 | #define __NR_fsync 82 | ||
| 250 | __SYSCALL(__NR_fsync, sys_fsync) | ||
| 251 | #define __NR_fdatasync 83 | ||
| 252 | __SYSCALL(__NR_fdatasync, sys_fdatasync) | ||
| 253 | #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 | ||
| 254 | #define __NR_sync_file_range2 84 | ||
| 255 | __SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \ | ||
| 256 | compat_sys_sync_file_range2) | ||
| 257 | #else | ||
| 258 | #define __NR_sync_file_range 84 | ||
| 259 | __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \ | ||
| 260 | compat_sys_sync_file_range) | ||
| 261 | #endif | ||
| 262 | |||
| 263 | /* fs/timerfd.c */ | ||
| 264 | #define __NR_timerfd_create 85 | ||
| 265 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) | ||
| 266 | #define __NR_timerfd_settime 86 | ||
| 267 | __SC_COMP(__NR_timerfd_settime, sys_timerfd_settime, \ | ||
| 268 | compat_sys_timerfd_settime) | ||
| 269 | #define __NR_timerfd_gettime 87 | ||
| 270 | __SC_COMP(__NR_timerfd_gettime, sys_timerfd_gettime, \ | ||
| 271 | compat_sys_timerfd_gettime) | ||
| 272 | |||
| 273 | /* fs/utimes.c */ | ||
| 274 | #define __NR_utimensat 88 | ||
| 275 | __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat) | ||
| 276 | |||
| 277 | /* kernel/acct.c */ | ||
| 278 | #define __NR_acct 89 | ||
| 279 | __SYSCALL(__NR_acct, sys_acct) | ||
| 280 | |||
| 281 | /* kernel/capability.c */ | ||
| 282 | #define __NR_capget 90 | ||
| 283 | __SYSCALL(__NR_capget, sys_capget) | ||
| 284 | #define __NR_capset 91 | ||
| 285 | __SYSCALL(__NR_capset, sys_capset) | ||
| 286 | |||
| 287 | /* kernel/exec_domain.c */ | ||
| 288 | #define __NR_personality 92 | ||
| 289 | __SYSCALL(__NR_personality, sys_personality) | ||
| 290 | |||
| 291 | /* kernel/exit.c */ | ||
| 292 | #define __NR_exit 93 | ||
| 293 | __SYSCALL(__NR_exit, sys_exit) | ||
| 294 | #define __NR_exit_group 94 | ||
| 295 | __SYSCALL(__NR_exit_group, sys_exit_group) | ||
| 296 | #define __NR_waitid 95 | ||
| 297 | __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid) | ||
| 298 | |||
| 299 | /* kernel/fork.c */ | ||
| 300 | #define __NR_set_tid_address 96 | ||
| 301 | __SYSCALL(__NR_set_tid_address, sys_set_tid_address) | ||
| 302 | #define __NR_unshare 97 | ||
| 303 | __SYSCALL(__NR_unshare, sys_unshare) | ||
| 304 | |||
| 305 | /* kernel/futex.c */ | ||
| 306 | #define __NR_futex 98 | ||
| 307 | __SC_COMP(__NR_futex, sys_futex, compat_sys_futex) | ||
| 308 | #define __NR_set_robust_list 99 | ||
| 309 | __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \ | ||
| 310 | compat_sys_set_robust_list) | ||
| 311 | #define __NR_get_robust_list 100 | ||
| 312 | __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \ | ||
| 313 | compat_sys_get_robust_list) | ||
| 314 | |||
| 315 | /* kernel/hrtimer.c */ | ||
| 316 | #define __NR_nanosleep 101 | ||
| 317 | __SC_COMP(__NR_nanosleep, sys_nanosleep, compat_sys_nanosleep) | ||
| 318 | |||
| 319 | /* kernel/itimer.c */ | ||
| 320 | #define __NR_getitimer 102 | ||
| 321 | __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer) | ||
| 322 | #define __NR_setitimer 103 | ||
| 323 | __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer) | ||
| 324 | |||
| 325 | /* kernel/kexec.c */ | ||
| 326 | #define __NR_kexec_load 104 | ||
| 327 | __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load) | ||
| 328 | |||
| 329 | /* kernel/module.c */ | ||
| 330 | #define __NR_init_module 105 | ||
| 331 | __SYSCALL(__NR_init_module, sys_init_module) | ||
| 332 | #define __NR_delete_module 106 | ||
| 333 | __SYSCALL(__NR_delete_module, sys_delete_module) | ||
| 334 | |||
| 335 | /* kernel/posix-timers.c */ | ||
| 336 | #define __NR_timer_create 107 | ||
| 337 | __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create) | ||
| 338 | #define __NR_timer_gettime 108 | ||
| 339 | __SC_COMP(__NR_timer_gettime, sys_timer_gettime, compat_sys_timer_gettime) | ||
| 340 | #define __NR_timer_getoverrun 109 | ||
| 341 | __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) | ||
| 342 | #define __NR_timer_settime 110 | ||
| 343 | __SC_COMP(__NR_timer_settime, sys_timer_settime, compat_sys_timer_settime) | ||
| 344 | #define __NR_timer_delete 111 | ||
| 345 | __SYSCALL(__NR_timer_delete, sys_timer_delete) | ||
| 346 | #define __NR_clock_settime 112 | ||
| 347 | __SC_COMP(__NR_clock_settime, sys_clock_settime, compat_sys_clock_settime) | ||
| 348 | #define __NR_clock_gettime 113 | ||
| 349 | __SC_COMP(__NR_clock_gettime, sys_clock_gettime, compat_sys_clock_gettime) | ||
| 350 | #define __NR_clock_getres 114 | ||
| 351 | __SC_COMP(__NR_clock_getres, sys_clock_getres, compat_sys_clock_getres) | ||
| 352 | #define __NR_clock_nanosleep 115 | ||
| 353 | __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \ | ||
| 354 | compat_sys_clock_nanosleep) | ||
| 355 | |||
| 356 | /* kernel/printk.c */ | ||
| 357 | #define __NR_syslog 116 | ||
| 358 | __SYSCALL(__NR_syslog, sys_syslog) | ||
| 359 | |||
| 360 | /* kernel/ptrace.c */ | ||
| 361 | #define __NR_ptrace 117 | ||
| 362 | __SYSCALL(__NR_ptrace, sys_ptrace) | ||
| 363 | |||
| 364 | /* kernel/sched.c */ | ||
| 365 | #define __NR_sched_setparam 118 | ||
| 366 | __SYSCALL(__NR_sched_setparam, sys_sched_setparam) | ||
| 367 | #define __NR_sched_setscheduler 119 | ||
| 368 | __SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler) | ||
| 369 | #define __NR_sched_getscheduler 120 | ||
| 370 | __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler) | ||
| 371 | #define __NR_sched_getparam 121 | ||
| 372 | __SYSCALL(__NR_sched_getparam, sys_sched_getparam) | ||
| 373 | #define __NR_sched_setaffinity 122 | ||
| 374 | __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \ | ||
| 375 | compat_sys_sched_setaffinity) | ||
| 376 | #define __NR_sched_getaffinity 123 | ||
| 377 | __SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \ | ||
| 378 | compat_sys_sched_getaffinity) | ||
| 379 | #define __NR_sched_yield 124 | ||
| 380 | __SYSCALL(__NR_sched_yield, sys_sched_yield) | ||
| 381 | #define __NR_sched_get_priority_max 125 | ||
| 382 | __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max) | ||
| 383 | #define __NR_sched_get_priority_min 126 | ||
| 384 | __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) | ||
| 385 | #define __NR_sched_rr_get_interval 127 | ||
| 386 | __SC_COMP(__NR_sched_rr_get_interval, sys_sched_rr_get_interval, \ | ||
| 387 | compat_sys_sched_rr_get_interval) | ||
| 388 | |||
| 389 | /* kernel/signal.c */ | ||
| 390 | #define __NR_restart_syscall 128 | ||
| 391 | __SYSCALL(__NR_restart_syscall, sys_restart_syscall) | ||
| 392 | #define __NR_kill 129 | ||
| 393 | __SYSCALL(__NR_kill, sys_kill) | ||
| 394 | #define __NR_tkill 130 | ||
| 395 | __SYSCALL(__NR_tkill, sys_tkill) | ||
| 396 | #define __NR_tgkill 131 | ||
| 397 | __SYSCALL(__NR_tgkill, sys_tgkill) | ||
| 398 | #define __NR_sigaltstack 132 | ||
| 399 | __SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack) | ||
| 400 | #define __NR_rt_sigsuspend 133 | ||
| 401 | __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) | ||
| 402 | #define __NR_rt_sigaction 134 | ||
| 403 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) | ||
| 404 | #define __NR_rt_sigprocmask 135 | ||
| 405 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) | ||
| 406 | #define __NR_rt_sigpending 136 | ||
| 407 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) | ||
| 408 | #define __NR_rt_sigtimedwait 137 | ||
| 409 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ | ||
| 410 | compat_sys_rt_sigtimedwait) | ||
| 411 | #define __NR_rt_sigqueueinfo 138 | ||
| 412 | __SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \ | ||
| 413 | compat_sys_rt_sigqueueinfo) | ||
| 414 | #define __NR_rt_sigreturn 139 | ||
| 415 | __SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn) | ||
| 416 | |||
| 417 | /* kernel/sys.c */ | ||
| 418 | #define __NR_setpriority 140 | ||
| 419 | __SYSCALL(__NR_setpriority, sys_setpriority) | ||
| 420 | #define __NR_getpriority 141 | ||
| 421 | __SYSCALL(__NR_getpriority, sys_getpriority) | ||
| 422 | #define __NR_reboot 142 | ||
| 423 | __SYSCALL(__NR_reboot, sys_reboot) | ||
| 424 | #define __NR_setregid 143 | ||
| 425 | __SYSCALL(__NR_setregid, sys_setregid) | ||
| 426 | #define __NR_setgid 144 | ||
| 427 | __SYSCALL(__NR_setgid, sys_setgid) | ||
| 428 | #define __NR_setreuid 145 | ||
| 429 | __SYSCALL(__NR_setreuid, sys_setreuid) | ||
| 430 | #define __NR_setuid 146 | ||
| 431 | __SYSCALL(__NR_setuid, sys_setuid) | ||
| 432 | #define __NR_setresuid 147 | ||
| 433 | __SYSCALL(__NR_setresuid, sys_setresuid) | ||
| 434 | #define __NR_getresuid 148 | ||
| 435 | __SYSCALL(__NR_getresuid, sys_getresuid) | ||
| 436 | #define __NR_setresgid 149 | ||
| 437 | __SYSCALL(__NR_setresgid, sys_setresgid) | ||
| 438 | #define __NR_getresgid 150 | ||
| 439 | __SYSCALL(__NR_getresgid, sys_getresgid) | ||
| 440 | #define __NR_setfsuid 151 | ||
| 441 | __SYSCALL(__NR_setfsuid, sys_setfsuid) | ||
| 442 | #define __NR_setfsgid 152 | ||
| 443 | __SYSCALL(__NR_setfsgid, sys_setfsgid) | ||
| 444 | #define __NR_times 153 | ||
| 445 | __SC_COMP(__NR_times, sys_times, compat_sys_times) | ||
| 446 | #define __NR_setpgid 154 | ||
| 447 | __SYSCALL(__NR_setpgid, sys_setpgid) | ||
| 448 | #define __NR_getpgid 155 | ||
| 449 | __SYSCALL(__NR_getpgid, sys_getpgid) | ||
| 450 | #define __NR_getsid 156 | ||
| 451 | __SYSCALL(__NR_getsid, sys_getsid) | ||
| 452 | #define __NR_setsid 157 | ||
| 453 | __SYSCALL(__NR_setsid, sys_setsid) | ||
| 454 | #define __NR_getgroups 158 | ||
| 455 | __SYSCALL(__NR_getgroups, sys_getgroups) | ||
| 456 | #define __NR_setgroups 159 | ||
| 457 | __SYSCALL(__NR_setgroups, sys_setgroups) | ||
| 458 | #define __NR_uname 160 | ||
| 459 | __SYSCALL(__NR_uname, sys_newuname) | ||
| 460 | #define __NR_sethostname 161 | ||
| 461 | __SYSCALL(__NR_sethostname, sys_sethostname) | ||
| 462 | #define __NR_setdomainname 162 | ||
| 463 | __SYSCALL(__NR_setdomainname, sys_setdomainname) | ||
| 464 | #define __NR_getrlimit 163 | ||
| 465 | __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit) | ||
| 466 | #define __NR_setrlimit 164 | ||
| 467 | __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit) | ||
| 468 | #define __NR_getrusage 165 | ||
| 469 | __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage) | ||
| 470 | #define __NR_umask 166 | ||
| 471 | __SYSCALL(__NR_umask, sys_umask) | ||
| 472 | #define __NR_prctl 167 | ||
| 473 | __SYSCALL(__NR_prctl, sys_prctl) | ||
| 474 | #define __NR_getcpu 168 | ||
| 475 | __SYSCALL(__NR_getcpu, sys_getcpu) | ||
| 476 | |||
| 477 | /* kernel/time.c */ | ||
| 478 | #define __NR_gettimeofday 169 | ||
| 479 | __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday) | ||
| 480 | #define __NR_settimeofday 170 | ||
| 481 | __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday) | ||
| 482 | #define __NR_adjtimex 171 | ||
| 483 | __SC_COMP(__NR_adjtimex, sys_adjtimex, compat_sys_adjtimex) | ||
| 484 | |||
| 485 | /* kernel/timer.c */ | ||
| 486 | #define __NR_getpid 172 | ||
| 487 | __SYSCALL(__NR_getpid, sys_getpid) | ||
| 488 | #define __NR_getppid 173 | ||
| 489 | __SYSCALL(__NR_getppid, sys_getppid) | ||
| 490 | #define __NR_getuid 174 | ||
| 491 | __SYSCALL(__NR_getuid, sys_getuid) | ||
| 492 | #define __NR_geteuid 175 | ||
| 493 | __SYSCALL(__NR_geteuid, sys_geteuid) | ||
| 494 | #define __NR_getgid 176 | ||
| 495 | __SYSCALL(__NR_getgid, sys_getgid) | ||
| 496 | #define __NR_getegid 177 | ||
| 497 | __SYSCALL(__NR_getegid, sys_getegid) | ||
| 498 | #define __NR_gettid 178 | ||
| 499 | __SYSCALL(__NR_gettid, sys_gettid) | ||
| 500 | #define __NR_sysinfo 179 | ||
| 501 | __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo) | ||
| 502 | |||
| 503 | /* ipc/mqueue.c */ | ||
| 504 | #define __NR_mq_open 180 | ||
| 505 | __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open) | ||
| 506 | #define __NR_mq_unlink 181 | ||
| 507 | __SYSCALL(__NR_mq_unlink, sys_mq_unlink) | ||
| 508 | #define __NR_mq_timedsend 182 | ||
| 509 | __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend) | ||
| 510 | #define __NR_mq_timedreceive 183 | ||
| 511 | __SC_COMP(__NR_mq_timedreceive, sys_mq_timedreceive, \ | ||
| 512 | compat_sys_mq_timedreceive) | ||
| 513 | #define __NR_mq_notify 184 | ||
| 514 | __SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify) | ||
| 515 | #define __NR_mq_getsetattr 185 | ||
| 516 | __SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr) | ||
| 517 | |||
| 518 | /* ipc/msg.c */ | ||
| 519 | #define __NR_msgget 186 | ||
| 520 | __SYSCALL(__NR_msgget, sys_msgget) | ||
| 521 | #define __NR_msgctl 187 | ||
| 522 | __SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl) | ||
| 523 | #define __NR_msgrcv 188 | ||
| 524 | __SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv) | ||
| 525 | #define __NR_msgsnd 189 | ||
| 526 | __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd) | ||
| 527 | |||
| 528 | /* ipc/sem.c */ | ||
| 529 | #define __NR_semget 190 | ||
| 530 | __SYSCALL(__NR_semget, sys_semget) | ||
| 531 | #define __NR_semctl 191 | ||
| 532 | __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl) | ||
| 533 | #define __NR_semtimedop 192 | ||
| 534 | __SC_COMP(__NR_semtimedop, sys_semtimedop, compat_sys_semtimedop) | ||
| 535 | #define __NR_semop 193 | ||
| 536 | __SYSCALL(__NR_semop, sys_semop) | ||
| 537 | |||
| 538 | /* ipc/shm.c */ | ||
| 539 | #define __NR_shmget 194 | ||
| 540 | __SYSCALL(__NR_shmget, sys_shmget) | ||
| 541 | #define __NR_shmctl 195 | ||
| 542 | __SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl) | ||
| 543 | #define __NR_shmat 196 | ||
| 544 | __SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat) | ||
| 545 | #define __NR_shmdt 197 | ||
| 546 | __SYSCALL(__NR_shmdt, sys_shmdt) | ||
| 547 | |||
| 548 | /* net/socket.c */ | ||
| 549 | #define __NR_socket 198 | ||
| 550 | __SYSCALL(__NR_socket, sys_socket) | ||
| 551 | #define __NR_socketpair 199 | ||
| 552 | __SYSCALL(__NR_socketpair, sys_socketpair) | ||
| 553 | #define __NR_bind 200 | ||
| 554 | __SYSCALL(__NR_bind, sys_bind) | ||
| 555 | #define __NR_listen 201 | ||
| 556 | __SYSCALL(__NR_listen, sys_listen) | ||
| 557 | #define __NR_accept 202 | ||
| 558 | __SYSCALL(__NR_accept, sys_accept) | ||
| 559 | #define __NR_connect 203 | ||
| 560 | __SYSCALL(__NR_connect, sys_connect) | ||
| 561 | #define __NR_getsockname 204 | ||
| 562 | __SYSCALL(__NR_getsockname, sys_getsockname) | ||
| 563 | #define __NR_getpeername 205 | ||
| 564 | __SYSCALL(__NR_getpeername, sys_getpeername) | ||
| 565 | #define __NR_sendto 206 | ||
| 566 | __SYSCALL(__NR_sendto, sys_sendto) | ||
| 567 | #define __NR_recvfrom 207 | ||
| 568 | __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom) | ||
| 569 | #define __NR_setsockopt 208 | ||
| 570 | __SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt) | ||
| 571 | #define __NR_getsockopt 209 | ||
| 572 | __SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt) | ||
| 573 | #define __NR_shutdown 210 | ||
| 574 | __SYSCALL(__NR_shutdown, sys_shutdown) | ||
| 575 | #define __NR_sendmsg 211 | ||
| 576 | __SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg) | ||
| 577 | #define __NR_recvmsg 212 | ||
| 578 | __SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg) | ||
| 579 | |||
| 580 | /* mm/filemap.c */ | ||
| 581 | #define __NR_readahead 213 | ||
| 582 | __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead) | ||
| 583 | |||
| 584 | /* mm/nommu.c, also with MMU */ | ||
| 585 | #define __NR_brk 214 | ||
| 586 | __SYSCALL(__NR_brk, sys_brk) | ||
| 587 | #define __NR_munmap 215 | ||
| 588 | __SYSCALL(__NR_munmap, sys_munmap) | ||
| 589 | #define __NR_mremap 216 | ||
| 590 | __SYSCALL(__NR_mremap, sys_mremap) | ||
| 591 | |||
| 592 | /* security/keys/keyctl.c */ | ||
| 593 | #define __NR_add_key 217 | ||
| 594 | __SYSCALL(__NR_add_key, sys_add_key) | ||
| 595 | #define __NR_request_key 218 | ||
| 596 | __SYSCALL(__NR_request_key, sys_request_key) | ||
| 597 | #define __NR_keyctl 219 | ||
| 598 | __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl) | ||
| 599 | |||
| 600 | /* arch/example/kernel/sys_example.c */ | ||
| 601 | #define __NR_clone 220 | ||
| 602 | __SYSCALL(__NR_clone, sys_clone) | ||
| 603 | #define __NR_execve 221 | ||
| 604 | __SC_COMP(__NR_execve, sys_execve, compat_sys_execve) | ||
| 605 | |||
| 606 | #define __NR3264_mmap 222 | ||
| 607 | __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) | ||
| 608 | /* mm/fadvise.c */ | ||
| 609 | #define __NR3264_fadvise64 223 | ||
| 610 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) | ||
| 611 | |||
| 612 | /* mm/, CONFIG_MMU only */ | ||
| 613 | #ifndef __ARCH_NOMMU | ||
| 614 | #define __NR_swapon 224 | ||
| 615 | __SYSCALL(__NR_swapon, sys_swapon) | ||
| 616 | #define __NR_swapoff 225 | ||
| 617 | __SYSCALL(__NR_swapoff, sys_swapoff) | ||
| 618 | #define __NR_mprotect 226 | ||
| 619 | __SYSCALL(__NR_mprotect, sys_mprotect) | ||
| 620 | #define __NR_msync 227 | ||
| 621 | __SYSCALL(__NR_msync, sys_msync) | ||
| 622 | #define __NR_mlock 228 | ||
| 623 | __SYSCALL(__NR_mlock, sys_mlock) | ||
| 624 | #define __NR_munlock 229 | ||
| 625 | __SYSCALL(__NR_munlock, sys_munlock) | ||
| 626 | #define __NR_mlockall 230 | ||
| 627 | __SYSCALL(__NR_mlockall, sys_mlockall) | ||
| 628 | #define __NR_munlockall 231 | ||
| 629 | __SYSCALL(__NR_munlockall, sys_munlockall) | ||
| 630 | #define __NR_mincore 232 | ||
| 631 | __SYSCALL(__NR_mincore, sys_mincore) | ||
| 632 | #define __NR_madvise 233 | ||
| 633 | __SYSCALL(__NR_madvise, sys_madvise) | ||
| 634 | #define __NR_remap_file_pages 234 | ||
| 635 | __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) | ||
| 636 | #define __NR_mbind 235 | ||
| 637 | __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind) | ||
| 638 | #define __NR_get_mempolicy 236 | ||
| 639 | __SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy) | ||
| 640 | #define __NR_set_mempolicy 237 | ||
| 641 | __SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy) | ||
| 642 | #define __NR_migrate_pages 238 | ||
| 643 | __SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages) | ||
| 644 | #define __NR_move_pages 239 | ||
| 645 | __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages) | ||
| 646 | #endif | ||
| 647 | |||
| 648 | #define __NR_rt_tgsigqueueinfo 240 | ||
| 649 | __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \ | ||
| 650 | compat_sys_rt_tgsigqueueinfo) | ||
| 651 | #define __NR_perf_event_open 241 | ||
| 652 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | ||
| 653 | #define __NR_accept4 242 | ||
| 654 | __SYSCALL(__NR_accept4, sys_accept4) | ||
| 655 | #define __NR_recvmmsg 243 | ||
| 656 | __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg) | ||
| 657 | |||
| 658 | /* | ||
| 659 | * Architectures may provide up to 16 syscalls of their own | ||
| 660 | * starting with this value. | ||
| 661 | */ | ||
| 662 | #define __NR_arch_specific_syscall 244 | ||
| 663 | |||
| 664 | #define __NR_wait4 260 | ||
| 665 | __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4) | ||
| 666 | #define __NR_prlimit64 261 | ||
| 667 | __SYSCALL(__NR_prlimit64, sys_prlimit64) | ||
| 668 | #define __NR_fanotify_init 262 | ||
| 669 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) | ||
| 670 | #define __NR_fanotify_mark 263 | ||
| 671 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) | ||
| 672 | #define __NR_name_to_handle_at 264 | ||
| 673 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | ||
| 674 | #define __NR_open_by_handle_at 265 | ||
| 675 | __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \ | ||
| 676 | compat_sys_open_by_handle_at) | ||
| 677 | #define __NR_clock_adjtime 266 | ||
| 678 | __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime) | ||
| 679 | #define __NR_syncfs 267 | ||
| 680 | __SYSCALL(__NR_syncfs, sys_syncfs) | ||
| 681 | #define __NR_setns 268 | ||
| 682 | __SYSCALL(__NR_setns, sys_setns) | ||
| 683 | #define __NR_sendmmsg 269 | ||
| 684 | __SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg) | ||
| 685 | #define __NR_process_vm_readv 270 | ||
| 686 | __SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \ | ||
| 687 | compat_sys_process_vm_readv) | ||
| 688 | #define __NR_process_vm_writev 271 | ||
| 689 | __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \ | ||
| 690 | compat_sys_process_vm_writev) | ||
| 691 | #define __NR_kcmp 272 | ||
| 692 | __SYSCALL(__NR_kcmp, sys_kcmp) | ||
| 693 | |||
| 694 | #undef __NR_syscalls | ||
| 695 | #define __NR_syscalls 273 | ||
| 696 | |||
| 697 | /* | ||
| 698 | * All syscalls below here should go away really, | ||
| 699 | * these are provided for both review and as a porting | ||
| 700 | * help for the C library version. | ||
| 701 | * | ||
| 702 | * Last chance: are any of these important enough to | ||
| 703 | * enable by default? | ||
| 704 | */ | ||
| 705 | #ifdef __ARCH_WANT_SYSCALL_NO_AT | ||
| 706 | #define __NR_open 1024 | ||
| 707 | __SYSCALL(__NR_open, sys_open) | ||
| 708 | #define __NR_link 1025 | ||
| 709 | __SYSCALL(__NR_link, sys_link) | ||
| 710 | #define __NR_unlink 1026 | ||
| 711 | __SYSCALL(__NR_unlink, sys_unlink) | ||
| 712 | #define __NR_mknod 1027 | ||
| 713 | __SYSCALL(__NR_mknod, sys_mknod) | ||
| 714 | #define __NR_chmod 1028 | ||
| 715 | __SYSCALL(__NR_chmod, sys_chmod) | ||
| 716 | #define __NR_chown 1029 | ||
| 717 | __SYSCALL(__NR_chown, sys_chown) | ||
| 718 | #define __NR_mkdir 1030 | ||
| 719 | __SYSCALL(__NR_mkdir, sys_mkdir) | ||
| 720 | #define __NR_rmdir 1031 | ||
| 721 | __SYSCALL(__NR_rmdir, sys_rmdir) | ||
| 722 | #define __NR_lchown 1032 | ||
| 723 | __SYSCALL(__NR_lchown, sys_lchown) | ||
| 724 | #define __NR_access 1033 | ||
| 725 | __SYSCALL(__NR_access, sys_access) | ||
| 726 | #define __NR_rename 1034 | ||
| 727 | __SYSCALL(__NR_rename, sys_rename) | ||
| 728 | #define __NR_readlink 1035 | ||
| 729 | __SYSCALL(__NR_readlink, sys_readlink) | ||
| 730 | #define __NR_symlink 1036 | ||
| 731 | __SYSCALL(__NR_symlink, sys_symlink) | ||
| 732 | #define __NR_utimes 1037 | ||
| 733 | __SYSCALL(__NR_utimes, sys_utimes) | ||
| 734 | #define __NR3264_stat 1038 | ||
| 735 | __SC_3264(__NR3264_stat, sys_stat64, sys_newstat) | ||
| 736 | #define __NR3264_lstat 1039 | ||
| 737 | __SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat) | ||
| 738 | |||
| 739 | #undef __NR_syscalls | ||
| 740 | #define __NR_syscalls (__NR3264_lstat+1) | ||
| 741 | #endif /* __ARCH_WANT_SYSCALL_NO_AT */ | ||
| 742 | |||
| 743 | #ifdef __ARCH_WANT_SYSCALL_NO_FLAGS | ||
| 744 | #define __NR_pipe 1040 | ||
| 745 | __SYSCALL(__NR_pipe, sys_pipe) | ||
| 746 | #define __NR_dup2 1041 | ||
| 747 | __SYSCALL(__NR_dup2, sys_dup2) | ||
| 748 | #define __NR_epoll_create 1042 | ||
| 749 | __SYSCALL(__NR_epoll_create, sys_epoll_create) | ||
| 750 | #define __NR_inotify_init 1043 | ||
| 751 | __SYSCALL(__NR_inotify_init, sys_inotify_init) | ||
| 752 | #define __NR_eventfd 1044 | ||
| 753 | __SYSCALL(__NR_eventfd, sys_eventfd) | ||
| 754 | #define __NR_signalfd 1045 | ||
| 755 | __SYSCALL(__NR_signalfd, sys_signalfd) | ||
| 756 | |||
| 757 | #undef __NR_syscalls | ||
| 758 | #define __NR_syscalls (__NR_signalfd+1) | ||
| 759 | #endif /* __ARCH_WANT_SYSCALL_NO_FLAGS */ | ||
| 760 | |||
| 761 | #if (__BITS_PER_LONG == 32 || defined(__SYSCALL_COMPAT)) && \ | ||
| 762 | defined(__ARCH_WANT_SYSCALL_OFF_T) | ||
| 763 | #define __NR_sendfile 1046 | ||
| 764 | __SYSCALL(__NR_sendfile, sys_sendfile) | ||
| 765 | #define __NR_ftruncate 1047 | ||
| 766 | __SYSCALL(__NR_ftruncate, sys_ftruncate) | ||
| 767 | #define __NR_truncate 1048 | ||
| 768 | __SYSCALL(__NR_truncate, sys_truncate) | ||
| 769 | #define __NR_stat 1049 | ||
| 770 | __SYSCALL(__NR_stat, sys_newstat) | ||
| 771 | #define __NR_lstat 1050 | ||
| 772 | __SYSCALL(__NR_lstat, sys_newlstat) | ||
| 773 | #define __NR_fstat 1051 | ||
| 774 | __SYSCALL(__NR_fstat, sys_newfstat) | ||
| 775 | #define __NR_fcntl 1052 | ||
| 776 | __SYSCALL(__NR_fcntl, sys_fcntl) | ||
| 777 | #define __NR_fadvise64 1053 | ||
| 778 | #define __ARCH_WANT_SYS_FADVISE64 | ||
| 779 | __SYSCALL(__NR_fadvise64, sys_fadvise64) | ||
| 780 | #define __NR_newfstatat 1054 | ||
| 781 | #define __ARCH_WANT_SYS_NEWFSTATAT | ||
| 782 | __SYSCALL(__NR_newfstatat, sys_newfstatat) | ||
| 783 | #define __NR_fstatfs 1055 | ||
| 784 | __SYSCALL(__NR_fstatfs, sys_fstatfs) | ||
| 785 | #define __NR_statfs 1056 | ||
| 786 | __SYSCALL(__NR_statfs, sys_statfs) | ||
| 787 | #define __NR_lseek 1057 | ||
| 788 | __SYSCALL(__NR_lseek, sys_lseek) | ||
| 789 | #define __NR_mmap 1058 | ||
| 790 | __SYSCALL(__NR_mmap, sys_mmap) | ||
| 791 | |||
| 792 | #undef __NR_syscalls | ||
| 793 | #define __NR_syscalls (__NR_mmap+1) | ||
| 794 | #endif /* 32 bit off_t syscalls */ | ||
| 795 | |||
| 796 | #ifdef __ARCH_WANT_SYSCALL_DEPRECATED | ||
| 797 | #define __NR_alarm 1059 | ||
| 798 | #define __ARCH_WANT_SYS_ALARM | ||
| 799 | __SYSCALL(__NR_alarm, sys_alarm) | ||
| 800 | #define __NR_getpgrp 1060 | ||
| 801 | #define __ARCH_WANT_SYS_GETPGRP | ||
| 802 | __SYSCALL(__NR_getpgrp, sys_getpgrp) | ||
| 803 | #define __NR_pause 1061 | ||
| 804 | #define __ARCH_WANT_SYS_PAUSE | ||
| 805 | __SYSCALL(__NR_pause, sys_pause) | ||
| 806 | #define __NR_time 1062 | ||
| 807 | #define __ARCH_WANT_SYS_TIME | ||
| 808 | #define __ARCH_WANT_COMPAT_SYS_TIME | ||
| 809 | __SYSCALL(__NR_time, sys_time) | ||
| 810 | #define __NR_utime 1063 | ||
| 811 | #define __ARCH_WANT_SYS_UTIME | ||
| 812 | __SYSCALL(__NR_utime, sys_utime) | ||
| 813 | |||
| 814 | #define __NR_creat 1064 | ||
| 815 | __SYSCALL(__NR_creat, sys_creat) | ||
| 816 | #define __NR_getdents 1065 | ||
| 817 | #define __ARCH_WANT_SYS_GETDENTS | ||
| 818 | __SYSCALL(__NR_getdents, sys_getdents) | ||
| 819 | #define __NR_futimesat 1066 | ||
| 820 | __SYSCALL(__NR_futimesat, sys_futimesat) | ||
| 821 | #define __NR_select 1067 | ||
| 822 | #define __ARCH_WANT_SYS_SELECT | ||
| 823 | __SYSCALL(__NR_select, sys_select) | ||
| 824 | #define __NR_poll 1068 | ||
| 825 | __SYSCALL(__NR_poll, sys_poll) | ||
| 826 | #define __NR_epoll_wait 1069 | ||
| 827 | __SYSCALL(__NR_epoll_wait, sys_epoll_wait) | ||
| 828 | #define __NR_ustat 1070 | ||
| 829 | __SYSCALL(__NR_ustat, sys_ustat) | ||
| 830 | #define __NR_vfork 1071 | ||
| 831 | __SYSCALL(__NR_vfork, sys_vfork) | ||
| 832 | #define __NR_oldwait4 1072 | ||
| 833 | __SYSCALL(__NR_oldwait4, sys_wait4) | ||
| 834 | #define __NR_recv 1073 | ||
| 835 | __SYSCALL(__NR_recv, sys_recv) | ||
| 836 | #define __NR_send 1074 | ||
| 837 | __SYSCALL(__NR_send, sys_send) | ||
| 838 | #define __NR_bdflush 1075 | ||
| 839 | __SYSCALL(__NR_bdflush, sys_bdflush) | ||
| 840 | #define __NR_umount 1076 | ||
| 841 | __SYSCALL(__NR_umount, sys_oldumount) | ||
| 842 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
| 843 | #define __NR_uselib 1077 | ||
| 844 | __SYSCALL(__NR_uselib, sys_uselib) | ||
| 845 | #define __NR__sysctl 1078 | ||
| 846 | __SYSCALL(__NR__sysctl, sys_sysctl) | ||
| 847 | |||
| 848 | #define __NR_fork 1079 | ||
| 849 | #ifdef CONFIG_MMU | ||
| 850 | __SYSCALL(__NR_fork, sys_fork) | ||
| 851 | #else | ||
| 852 | __SYSCALL(__NR_fork, sys_ni_syscall) | ||
| 853 | #endif /* CONFIG_MMU */ | ||
| 854 | |||
| 855 | #undef __NR_syscalls | ||
| 856 | #define __NR_syscalls (__NR_fork+1) | ||
| 857 | |||
| 858 | #endif /* __ARCH_WANT_SYSCALL_DEPRECATED */ | ||
| 859 | |||
| 860 | /* | ||
| 861 | * 32 bit systems traditionally used different | ||
| 862 | * syscalls for off_t and loff_t arguments, while | ||
| 863 | * 64 bit systems only need the off_t version. | ||
| 864 | * For new 32 bit platforms, there is no need to | ||
| 865 | * implement the old 32 bit off_t syscalls, so | ||
| 866 | * they take different names. | ||
| 867 | * Here we map the numbers so that both versions | ||
| 868 | * use the same syscall table layout. | ||
| 869 | */ | ||
| 870 | #if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT) | ||
| 871 | #define __NR_fcntl __NR3264_fcntl | ||
| 872 | #define __NR_statfs __NR3264_statfs | ||
| 873 | #define __NR_fstatfs __NR3264_fstatfs | ||
| 874 | #define __NR_truncate __NR3264_truncate | ||
| 875 | #define __NR_ftruncate __NR3264_ftruncate | ||
| 876 | #define __NR_lseek __NR3264_lseek | ||
| 877 | #define __NR_sendfile __NR3264_sendfile | ||
| 878 | #define __NR_newfstatat __NR3264_fstatat | ||
| 879 | #define __NR_fstat __NR3264_fstat | ||
| 880 | #define __NR_mmap __NR3264_mmap | ||
| 881 | #define __NR_fadvise64 __NR3264_fadvise64 | ||
| 882 | #ifdef __NR3264_stat | ||
| 883 | #define __NR_stat __NR3264_stat | ||
| 884 | #define __NR_lstat __NR3264_lstat | ||
| 885 | #endif | ||
| 886 | #else | ||
| 887 | #define __NR_fcntl64 __NR3264_fcntl | ||
| 888 | #define __NR_statfs64 __NR3264_statfs | ||
| 889 | #define __NR_fstatfs64 __NR3264_fstatfs | ||
| 890 | #define __NR_truncate64 __NR3264_truncate | ||
| 891 | #define __NR_ftruncate64 __NR3264_ftruncate | ||
| 892 | #define __NR_llseek __NR3264_lseek | ||
| 893 | #define __NR_sendfile64 __NR3264_sendfile | ||
| 894 | #define __NR_fstatat64 __NR3264_fstatat | ||
| 895 | #define __NR_fstat64 __NR3264_fstat | ||
| 896 | #define __NR_mmap2 __NR3264_mmap | ||
| 897 | #define __NR_fadvise64_64 __NR3264_fadvise64 | ||
| 898 | #ifdef __NR3264_stat | ||
| 899 | #define __NR_stat64 __NR3264_stat | ||
| 900 | #define __NR_lstat64 __NR3264_lstat | ||
| 901 | #endif | ||
| 902 | #endif | ||
| @@ -0,0 +1,16 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += drm.h | ||
| 3 | header-y += drm_fourcc.h | ||
| 4 | header-y += drm_mode.h | ||
| 5 | header-y += drm_sarea.h | ||
| 6 | header-y += exynos_drm.h | ||
| 7 | header-y += i810_drm.h | ||
| 8 | header-y += i915_drm.h | ||
| 9 | header-y += mga_drm.h | ||
| 10 | header-y += nouveau_drm.h | ||
| 11 | header-y += r128_drm.h | ||
| 12 | header-y += radeon_drm.h | ||
| 13 | header-y += savage_drm.h | ||
| 14 | header-y += sis_drm.h | ||
| 15 | header-y += via_drm.h | ||
| 16 | header-y += vmwgfx_drm.h | ||
| @@ -0,0 +1,830 @@ | |||
| 1 | /** | ||
| 2 | * \file drm.h | ||
| 3 | * Header for the Direct Rendering Manager | ||
| 4 | * | ||
| 5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
| 6 | * | ||
| 7 | * \par Acknowledgments: | ||
| 8 | * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg. | ||
| 9 | */ | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | ||
| 13 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
| 14 | * All rights reserved. | ||
| 15 | * | ||
| 16 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 17 | * copy of this software and associated documentation files (the "Software"), | ||
| 18 | * to deal in the Software without restriction, including without limitation | ||
| 19 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 20 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 21 | * Software is furnished to do so, subject to the following conditions: | ||
| 22 | * | ||
| 23 | * The above copyright notice and this permission notice (including the next | ||
| 24 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 25 | * Software. | ||
| 26 | * | ||
| 27 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 28 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 29 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 30 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 31 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 32 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 33 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef _DRM_H_ | ||
| 37 | #define _DRM_H_ | ||
| 38 | |||
| 39 | #if defined(__linux__) | ||
| 40 | |||
| 41 | #include <linux/types.h> | ||
| 42 | #include <asm/ioctl.h> | ||
| 43 | typedef unsigned int drm_handle_t; | ||
| 44 | |||
| 45 | #else /* One of the BSDs */ | ||
| 46 | |||
| 47 | #include <sys/ioccom.h> | ||
| 48 | #include <sys/types.h> | ||
| 49 | typedef int8_t __s8; | ||
| 50 | typedef uint8_t __u8; | ||
| 51 | typedef int16_t __s16; | ||
| 52 | typedef uint16_t __u16; | ||
| 53 | typedef int32_t __s32; | ||
| 54 | typedef uint32_t __u32; | ||
| 55 | typedef int64_t __s64; | ||
| 56 | typedef uint64_t __u64; | ||
| 57 | typedef unsigned long drm_handle_t; | ||
| 58 | |||
| 59 | #endif | ||
| 60 | |||
| 61 | #define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ | ||
| 62 | #define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ | ||
| 63 | #define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ | ||
| 64 | #define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ | ||
| 65 | |||
| 66 | #define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ | ||
| 67 | #define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ | ||
| 68 | #define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) | ||
| 69 | #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) | ||
| 70 | #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) | ||
| 71 | |||
| 72 | typedef unsigned int drm_context_t; | ||
| 73 | typedef unsigned int drm_drawable_t; | ||
| 74 | typedef unsigned int drm_magic_t; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * Cliprect. | ||
| 78 | * | ||
| 79 | * \warning: If you change this structure, make sure you change | ||
| 80 | * XF86DRIClipRectRec in the server as well | ||
| 81 | * | ||
| 82 | * \note KW: Actually it's illegal to change either for | ||
| 83 | * backwards-compatibility reasons. | ||
| 84 | */ | ||
| 85 | struct drm_clip_rect { | ||
| 86 | unsigned short x1; | ||
| 87 | unsigned short y1; | ||
| 88 | unsigned short x2; | ||
| 89 | unsigned short y2; | ||
| 90 | }; | ||
| 91 | |||
| 92 | /** | ||
| 93 | * Drawable information. | ||
| 94 | */ | ||
| 95 | struct drm_drawable_info { | ||
| 96 | unsigned int num_rects; | ||
| 97 | struct drm_clip_rect *rects; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /** | ||
| 101 | * Texture region, | ||
| 102 | */ | ||
| 103 | struct drm_tex_region { | ||
| 104 | unsigned char next; | ||
| 105 | unsigned char prev; | ||
| 106 | unsigned char in_use; | ||
| 107 | unsigned char padding; | ||
| 108 | unsigned int age; | ||
| 109 | }; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * Hardware lock. | ||
| 113 | * | ||
| 114 | * The lock structure is a simple cache-line aligned integer. To avoid | ||
| 115 | * processor bus contention on a multiprocessor system, there should not be any | ||
| 116 | * other data stored in the same cache line. | ||
| 117 | */ | ||
| 118 | struct drm_hw_lock { | ||
| 119 | __volatile__ unsigned int lock; /**< lock variable */ | ||
| 120 | char padding[60]; /**< Pad to cache line */ | ||
| 121 | }; | ||
| 122 | |||
| 123 | /** | ||
| 124 | * DRM_IOCTL_VERSION ioctl argument type. | ||
| 125 | * | ||
| 126 | * \sa drmGetVersion(). | ||
| 127 | */ | ||
| 128 | struct drm_version { | ||
| 129 | int version_major; /**< Major version */ | ||
| 130 | int version_minor; /**< Minor version */ | ||
| 131 | int version_patchlevel; /**< Patch level */ | ||
| 132 | size_t name_len; /**< Length of name buffer */ | ||
| 133 | char __user *name; /**< Name of driver */ | ||
| 134 | size_t date_len; /**< Length of date buffer */ | ||
| 135 | char __user *date; /**< User-space buffer to hold date */ | ||
| 136 | size_t desc_len; /**< Length of desc buffer */ | ||
| 137 | char __user *desc; /**< User-space buffer to hold desc */ | ||
| 138 | }; | ||
| 139 | |||
| 140 | /** | ||
| 141 | * DRM_IOCTL_GET_UNIQUE ioctl argument type. | ||
| 142 | * | ||
| 143 | * \sa drmGetBusid() and drmSetBusId(). | ||
| 144 | */ | ||
| 145 | struct drm_unique { | ||
| 146 | size_t unique_len; /**< Length of unique */ | ||
| 147 | char __user *unique; /**< Unique name for driver instantiation */ | ||
| 148 | }; | ||
| 149 | |||
| 150 | struct drm_list { | ||
| 151 | int count; /**< Length of user-space structures */ | ||
| 152 | struct drm_version __user *version; | ||
| 153 | }; | ||
| 154 | |||
| 155 | struct drm_block { | ||
| 156 | int unused; | ||
| 157 | }; | ||
| 158 | |||
| 159 | /** | ||
| 160 | * DRM_IOCTL_CONTROL ioctl argument type. | ||
| 161 | * | ||
| 162 | * \sa drmCtlInstHandler() and drmCtlUninstHandler(). | ||
| 163 | */ | ||
| 164 | struct drm_control { | ||
| 165 | enum { | ||
| 166 | DRM_ADD_COMMAND, | ||
| 167 | DRM_RM_COMMAND, | ||
| 168 | DRM_INST_HANDLER, | ||
| 169 | DRM_UNINST_HANDLER | ||
| 170 | } func; | ||
| 171 | int irq; | ||
| 172 | }; | ||
| 173 | |||
| 174 | /** | ||
| 175 | * Type of memory to map. | ||
| 176 | */ | ||
| 177 | enum drm_map_type { | ||
| 178 | _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ | ||
| 179 | _DRM_REGISTERS = 1, /**< no caching, no core dump */ | ||
| 180 | _DRM_SHM = 2, /**< shared, cached */ | ||
| 181 | _DRM_AGP = 3, /**< AGP/GART */ | ||
| 182 | _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ | ||
| 183 | _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ | ||
| 184 | _DRM_GEM = 6, /**< GEM object */ | ||
| 185 | }; | ||
| 186 | |||
| 187 | /** | ||
| 188 | * Memory mapping flags. | ||
| 189 | */ | ||
| 190 | enum drm_map_flags { | ||
| 191 | _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ | ||
| 192 | _DRM_READ_ONLY = 0x02, | ||
| 193 | _DRM_LOCKED = 0x04, /**< shared, cached, locked */ | ||
| 194 | _DRM_KERNEL = 0x08, /**< kernel requires access */ | ||
| 195 | _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ | ||
| 196 | _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ | ||
| 197 | _DRM_REMOVABLE = 0x40, /**< Removable mapping */ | ||
| 198 | _DRM_DRIVER = 0x80 /**< Managed by driver */ | ||
| 199 | }; | ||
| 200 | |||
| 201 | struct drm_ctx_priv_map { | ||
| 202 | unsigned int ctx_id; /**< Context requesting private mapping */ | ||
| 203 | void *handle; /**< Handle of map */ | ||
| 204 | }; | ||
| 205 | |||
| 206 | /** | ||
| 207 | * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls | ||
| 208 | * argument type. | ||
| 209 | * | ||
| 210 | * \sa drmAddMap(). | ||
| 211 | */ | ||
| 212 | struct drm_map { | ||
| 213 | unsigned long offset; /**< Requested physical address (0 for SAREA)*/ | ||
| 214 | unsigned long size; /**< Requested physical size (bytes) */ | ||
| 215 | enum drm_map_type type; /**< Type of memory to map */ | ||
| 216 | enum drm_map_flags flags; /**< Flags */ | ||
| 217 | void *handle; /**< User-space: "Handle" to pass to mmap() */ | ||
| 218 | /**< Kernel-space: kernel-virtual address */ | ||
| 219 | int mtrr; /**< MTRR slot used */ | ||
| 220 | /* Private data */ | ||
| 221 | }; | ||
| 222 | |||
| 223 | /** | ||
| 224 | * DRM_IOCTL_GET_CLIENT ioctl argument type. | ||
| 225 | */ | ||
| 226 | struct drm_client { | ||
| 227 | int idx; /**< Which client desired? */ | ||
| 228 | int auth; /**< Is client authenticated? */ | ||
| 229 | unsigned long pid; /**< Process ID */ | ||
| 230 | unsigned long uid; /**< User ID */ | ||
| 231 | unsigned long magic; /**< Magic */ | ||
| 232 | unsigned long iocs; /**< Ioctl count */ | ||
| 233 | }; | ||
| 234 | |||
| 235 | enum drm_stat_type { | ||
| 236 | _DRM_STAT_LOCK, | ||
| 237 | _DRM_STAT_OPENS, | ||
| 238 | _DRM_STAT_CLOSES, | ||
| 239 | _DRM_STAT_IOCTLS, | ||
| 240 | _DRM_STAT_LOCKS, | ||
| 241 | _DRM_STAT_UNLOCKS, | ||
| 242 | _DRM_STAT_VALUE, /**< Generic value */ | ||
| 243 | _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ | ||
| 244 | _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ | ||
| 245 | |||
| 246 | _DRM_STAT_IRQ, /**< IRQ */ | ||
| 247 | _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ | ||
| 248 | _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ | ||
| 249 | _DRM_STAT_DMA, /**< DMA */ | ||
| 250 | _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ | ||
| 251 | _DRM_STAT_MISSED /**< Missed DMA opportunity */ | ||
| 252 | /* Add to the *END* of the list */ | ||
| 253 | }; | ||
| 254 | |||
| 255 | /** | ||
| 256 | * DRM_IOCTL_GET_STATS ioctl argument type. | ||
| 257 | */ | ||
| 258 | struct drm_stats { | ||
| 259 | unsigned long count; | ||
| 260 | struct { | ||
| 261 | unsigned long value; | ||
| 262 | enum drm_stat_type type; | ||
| 263 | } data[15]; | ||
| 264 | }; | ||
| 265 | |||
| 266 | /** | ||
| 267 | * Hardware locking flags. | ||
| 268 | */ | ||
| 269 | enum drm_lock_flags { | ||
| 270 | _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ | ||
| 271 | _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ | ||
| 272 | _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ | ||
| 273 | _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ | ||
| 274 | /* These *HALT* flags aren't supported yet | ||
| 275 | -- they will be used to support the | ||
| 276 | full-screen DGA-like mode. */ | ||
| 277 | _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ | ||
| 278 | _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ | ||
| 279 | }; | ||
| 280 | |||
| 281 | /** | ||
| 282 | * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. | ||
| 283 | * | ||
| 284 | * \sa drmGetLock() and drmUnlock(). | ||
| 285 | */ | ||
| 286 | struct drm_lock { | ||
| 287 | int context; | ||
| 288 | enum drm_lock_flags flags; | ||
| 289 | }; | ||
| 290 | |||
| 291 | /** | ||
| 292 | * DMA flags | ||
| 293 | * | ||
| 294 | * \warning | ||
| 295 | * These values \e must match xf86drm.h. | ||
| 296 | * | ||
| 297 | * \sa drm_dma. | ||
| 298 | */ | ||
| 299 | enum drm_dma_flags { | ||
| 300 | /* Flags for DMA buffer dispatch */ | ||
| 301 | _DRM_DMA_BLOCK = 0x01, /**< | ||
| 302 | * Block until buffer dispatched. | ||
| 303 | * | ||
| 304 | * \note The buffer may not yet have | ||
| 305 | * been processed by the hardware -- | ||
| 306 | * getting a hardware lock with the | ||
| 307 | * hardware quiescent will ensure | ||
| 308 | * that the buffer has been | ||
| 309 | * processed. | ||
| 310 | */ | ||
| 311 | _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ | ||
| 312 | _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ | ||
| 313 | |||
| 314 | /* Flags for DMA buffer request */ | ||
| 315 | _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ | ||
| 316 | _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ | ||
| 317 | _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ | ||
| 318 | }; | ||
| 319 | |||
| 320 | /** | ||
| 321 | * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. | ||
| 322 | * | ||
| 323 | * \sa drmAddBufs(). | ||
| 324 | */ | ||
| 325 | struct drm_buf_desc { | ||
| 326 | int count; /**< Number of buffers of this size */ | ||
| 327 | int size; /**< Size in bytes */ | ||
| 328 | int low_mark; /**< Low water mark */ | ||
| 329 | int high_mark; /**< High water mark */ | ||
| 330 | enum { | ||
| 331 | _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ | ||
| 332 | _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ | ||
| 333 | _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ | ||
| 334 | _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ | ||
| 335 | _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ | ||
| 336 | } flags; | ||
| 337 | unsigned long agp_start; /**< | ||
| 338 | * Start address of where the AGP buffers are | ||
| 339 | * in the AGP aperture | ||
| 340 | */ | ||
| 341 | }; | ||
| 342 | |||
| 343 | /** | ||
| 344 | * DRM_IOCTL_INFO_BUFS ioctl argument type. | ||
| 345 | */ | ||
| 346 | struct drm_buf_info { | ||
| 347 | int count; /**< Entries in list */ | ||
| 348 | struct drm_buf_desc __user *list; | ||
| 349 | }; | ||
| 350 | |||
| 351 | /** | ||
| 352 | * DRM_IOCTL_FREE_BUFS ioctl argument type. | ||
| 353 | */ | ||
| 354 | struct drm_buf_free { | ||
| 355 | int count; | ||
| 356 | int __user *list; | ||
| 357 | }; | ||
| 358 | |||
| 359 | /** | ||
| 360 | * Buffer information | ||
| 361 | * | ||
| 362 | * \sa drm_buf_map. | ||
| 363 | */ | ||
| 364 | struct drm_buf_pub { | ||
| 365 | int idx; /**< Index into the master buffer list */ | ||
| 366 | int total; /**< Buffer size */ | ||
| 367 | int used; /**< Amount of buffer in use (for DMA) */ | ||
| 368 | void __user *address; /**< Address of buffer */ | ||
| 369 | }; | ||
| 370 | |||
| 371 | /** | ||
| 372 | * DRM_IOCTL_MAP_BUFS ioctl argument type. | ||
| 373 | */ | ||
| 374 | struct drm_buf_map { | ||
| 375 | int count; /**< Length of the buffer list */ | ||
| 376 | void __user *virtual; /**< Mmap'd area in user-virtual */ | ||
| 377 | struct drm_buf_pub __user *list; /**< Buffer information */ | ||
| 378 | }; | ||
| 379 | |||
| 380 | /** | ||
| 381 | * DRM_IOCTL_DMA ioctl argument type. | ||
| 382 | * | ||
| 383 | * Indices here refer to the offset into the buffer list in drm_buf_get. | ||
| 384 | * | ||
| 385 | * \sa drmDMA(). | ||
| 386 | */ | ||
| 387 | struct drm_dma { | ||
| 388 | int context; /**< Context handle */ | ||
| 389 | int send_count; /**< Number of buffers to send */ | ||
| 390 | int __user *send_indices; /**< List of handles to buffers */ | ||
| 391 | int __user *send_sizes; /**< Lengths of data to send */ | ||
| 392 | enum drm_dma_flags flags; /**< Flags */ | ||
| 393 | int request_count; /**< Number of buffers requested */ | ||
| 394 | int request_size; /**< Desired size for buffers */ | ||
| 395 | int __user *request_indices; /**< Buffer information */ | ||
| 396 | int __user *request_sizes; | ||
| 397 | int granted_count; /**< Number of buffers granted */ | ||
| 398 | }; | ||
| 399 | |||
| 400 | enum drm_ctx_flags { | ||
| 401 | _DRM_CONTEXT_PRESERVED = 0x01, | ||
| 402 | _DRM_CONTEXT_2DONLY = 0x02 | ||
| 403 | }; | ||
| 404 | |||
| 405 | /** | ||
| 406 | * DRM_IOCTL_ADD_CTX ioctl argument type. | ||
| 407 | * | ||
| 408 | * \sa drmCreateContext() and drmDestroyContext(). | ||
| 409 | */ | ||
| 410 | struct drm_ctx { | ||
| 411 | drm_context_t handle; | ||
| 412 | enum drm_ctx_flags flags; | ||
| 413 | }; | ||
| 414 | |||
| 415 | /** | ||
| 416 | * DRM_IOCTL_RES_CTX ioctl argument type. | ||
| 417 | */ | ||
| 418 | struct drm_ctx_res { | ||
| 419 | int count; | ||
| 420 | struct drm_ctx __user *contexts; | ||
| 421 | }; | ||
| 422 | |||
| 423 | /** | ||
| 424 | * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. | ||
| 425 | */ | ||
| 426 | struct drm_draw { | ||
| 427 | drm_drawable_t handle; | ||
| 428 | }; | ||
| 429 | |||
| 430 | /** | ||
| 431 | * DRM_IOCTL_UPDATE_DRAW ioctl argument type. | ||
| 432 | */ | ||
| 433 | typedef enum { | ||
| 434 | DRM_DRAWABLE_CLIPRECTS, | ||
| 435 | } drm_drawable_info_type_t; | ||
| 436 | |||
| 437 | struct drm_update_draw { | ||
| 438 | drm_drawable_t handle; | ||
| 439 | unsigned int type; | ||
| 440 | unsigned int num; | ||
| 441 | unsigned long long data; | ||
| 442 | }; | ||
| 443 | |||
| 444 | /** | ||
| 445 | * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. | ||
| 446 | */ | ||
| 447 | struct drm_auth { | ||
| 448 | drm_magic_t magic; | ||
| 449 | }; | ||
| 450 | |||
| 451 | /** | ||
| 452 | * DRM_IOCTL_IRQ_BUSID ioctl argument type. | ||
| 453 | * | ||
| 454 | * \sa drmGetInterruptFromBusID(). | ||
| 455 | */ | ||
| 456 | struct drm_irq_busid { | ||
| 457 | int irq; /**< IRQ number */ | ||
| 458 | int busnum; /**< bus number */ | ||
| 459 | int devnum; /**< device number */ | ||
| 460 | int funcnum; /**< function number */ | ||
| 461 | }; | ||
| 462 | |||
| 463 | enum drm_vblank_seq_type { | ||
| 464 | _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ | ||
| 465 | _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ | ||
| 466 | /* bits 1-6 are reserved for high crtcs */ | ||
| 467 | _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, | ||
| 468 | _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ | ||
| 469 | _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ | ||
| 470 | _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ | ||
| 471 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ | ||
| 472 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ | ||
| 473 | }; | ||
| 474 | #define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 | ||
| 475 | |||
| 476 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) | ||
| 477 | #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ | ||
| 478 | _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) | ||
| 479 | |||
| 480 | struct drm_wait_vblank_request { | ||
| 481 | enum drm_vblank_seq_type type; | ||
| 482 | unsigned int sequence; | ||
| 483 | unsigned long signal; | ||
| 484 | }; | ||
| 485 | |||
| 486 | struct drm_wait_vblank_reply { | ||
| 487 | enum drm_vblank_seq_type type; | ||
| 488 | unsigned int sequence; | ||
| 489 | long tval_sec; | ||
| 490 | long tval_usec; | ||
| 491 | }; | ||
| 492 | |||
| 493 | /** | ||
| 494 | * DRM_IOCTL_WAIT_VBLANK ioctl argument type. | ||
| 495 | * | ||
| 496 | * \sa drmWaitVBlank(). | ||
| 497 | */ | ||
| 498 | union drm_wait_vblank { | ||
| 499 | struct drm_wait_vblank_request request; | ||
| 500 | struct drm_wait_vblank_reply reply; | ||
| 501 | }; | ||
| 502 | |||
| 503 | #define _DRM_PRE_MODESET 1 | ||
| 504 | #define _DRM_POST_MODESET 2 | ||
| 505 | |||
| 506 | /** | ||
| 507 | * DRM_IOCTL_MODESET_CTL ioctl argument type | ||
| 508 | * | ||
| 509 | * \sa drmModesetCtl(). | ||
| 510 | */ | ||
| 511 | struct drm_modeset_ctl { | ||
| 512 | __u32 crtc; | ||
| 513 | __u32 cmd; | ||
| 514 | }; | ||
| 515 | |||
| 516 | /** | ||
| 517 | * DRM_IOCTL_AGP_ENABLE ioctl argument type. | ||
| 518 | * | ||
| 519 | * \sa drmAgpEnable(). | ||
| 520 | */ | ||
| 521 | struct drm_agp_mode { | ||
| 522 | unsigned long mode; /**< AGP mode */ | ||
| 523 | }; | ||
| 524 | |||
| 525 | /** | ||
| 526 | * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. | ||
| 527 | * | ||
| 528 | * \sa drmAgpAlloc() and drmAgpFree(). | ||
| 529 | */ | ||
| 530 | struct drm_agp_buffer { | ||
| 531 | unsigned long size; /**< In bytes -- will round to page boundary */ | ||
| 532 | unsigned long handle; /**< Used for binding / unbinding */ | ||
| 533 | unsigned long type; /**< Type of memory to allocate */ | ||
| 534 | unsigned long physical; /**< Physical used by i810 */ | ||
| 535 | }; | ||
| 536 | |||
| 537 | /** | ||
| 538 | * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. | ||
| 539 | * | ||
| 540 | * \sa drmAgpBind() and drmAgpUnbind(). | ||
| 541 | */ | ||
| 542 | struct drm_agp_binding { | ||
| 543 | unsigned long handle; /**< From drm_agp_buffer */ | ||
| 544 | unsigned long offset; /**< In bytes -- will round to page boundary */ | ||
| 545 | }; | ||
| 546 | |||
| 547 | /** | ||
| 548 | * DRM_IOCTL_AGP_INFO ioctl argument type. | ||
| 549 | * | ||
| 550 | * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), | ||
| 551 | * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), | ||
| 552 | * drmAgpVendorId() and drmAgpDeviceId(). | ||
| 553 | */ | ||
| 554 | struct drm_agp_info { | ||
| 555 | int agp_version_major; | ||
| 556 | int agp_version_minor; | ||
| 557 | unsigned long mode; | ||
| 558 | unsigned long aperture_base; /* physical address */ | ||
| 559 | unsigned long aperture_size; /* bytes */ | ||
| 560 | unsigned long memory_allowed; /* bytes */ | ||
| 561 | unsigned long memory_used; | ||
| 562 | |||
| 563 | /* PCI information */ | ||
| 564 | unsigned short id_vendor; | ||
| 565 | unsigned short id_device; | ||
| 566 | }; | ||
| 567 | |||
| 568 | /** | ||
| 569 | * DRM_IOCTL_SG_ALLOC ioctl argument type. | ||
| 570 | */ | ||
| 571 | struct drm_scatter_gather { | ||
| 572 | unsigned long size; /**< In bytes -- will round to page boundary */ | ||
| 573 | unsigned long handle; /**< Used for mapping / unmapping */ | ||
| 574 | }; | ||
| 575 | |||
| 576 | /** | ||
| 577 | * DRM_IOCTL_SET_VERSION ioctl argument type. | ||
| 578 | */ | ||
| 579 | struct drm_set_version { | ||
| 580 | int drm_di_major; | ||
| 581 | int drm_di_minor; | ||
| 582 | int drm_dd_major; | ||
| 583 | int drm_dd_minor; | ||
| 584 | }; | ||
| 585 | |||
| 586 | /** DRM_IOCTL_GEM_CLOSE ioctl argument type */ | ||
| 587 | struct drm_gem_close { | ||
| 588 | /** Handle of the object to be closed. */ | ||
| 589 | __u32 handle; | ||
| 590 | __u32 pad; | ||
| 591 | }; | ||
| 592 | |||
| 593 | /** DRM_IOCTL_GEM_FLINK ioctl argument type */ | ||
| 594 | struct drm_gem_flink { | ||
| 595 | /** Handle for the object being named */ | ||
| 596 | __u32 handle; | ||
| 597 | |||
| 598 | /** Returned global name */ | ||
| 599 | __u32 name; | ||
| 600 | }; | ||
| 601 | |||
| 602 | /** DRM_IOCTL_GEM_OPEN ioctl argument type */ | ||
| 603 | struct drm_gem_open { | ||
| 604 | /** Name of object being opened */ | ||
| 605 | __u32 name; | ||
| 606 | |||
| 607 | /** Returned handle for the object */ | ||
| 608 | __u32 handle; | ||
| 609 | |||
| 610 | /** Returned size of the object */ | ||
| 611 | __u64 size; | ||
| 612 | }; | ||
| 613 | |||
| 614 | /** DRM_IOCTL_GET_CAP ioctl argument type */ | ||
| 615 | struct drm_get_cap { | ||
| 616 | __u64 capability; | ||
| 617 | __u64 value; | ||
| 618 | }; | ||
| 619 | |||
| 620 | #define DRM_CLOEXEC O_CLOEXEC | ||
| 621 | struct drm_prime_handle { | ||
| 622 | __u32 handle; | ||
| 623 | |||
| 624 | /** Flags.. only applicable for handle->fd */ | ||
| 625 | __u32 flags; | ||
| 626 | |||
| 627 | /** Returned dmabuf file descriptor */ | ||
| 628 | __s32 fd; | ||
| 629 | }; | ||
| 630 | |||
| 631 | #include <drm/drm_mode.h> | ||
| 632 | |||
| 633 | #define DRM_IOCTL_BASE 'd' | ||
| 634 | #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) | ||
| 635 | #define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) | ||
| 636 | #define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) | ||
| 637 | #define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) | ||
| 638 | |||
| 639 | #define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) | ||
| 640 | #define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) | ||
| 641 | #define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) | ||
| 642 | #define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) | ||
| 643 | #define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) | ||
| 644 | #define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) | ||
| 645 | #define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) | ||
| 646 | #define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) | ||
| 647 | #define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) | ||
| 648 | #define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) | ||
| 649 | #define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) | ||
| 650 | #define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) | ||
| 651 | #define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) | ||
| 652 | |||
| 653 | #define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) | ||
| 654 | #define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) | ||
| 655 | #define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) | ||
| 656 | #define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) | ||
| 657 | #define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) | ||
| 658 | #define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) | ||
| 659 | #define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) | ||
| 660 | #define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) | ||
| 661 | #define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) | ||
| 662 | #define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) | ||
| 663 | #define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) | ||
| 664 | |||
| 665 | #define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) | ||
| 666 | |||
| 667 | #define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) | ||
| 668 | #define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) | ||
| 669 | |||
| 670 | #define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) | ||
| 671 | #define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) | ||
| 672 | |||
| 673 | #define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) | ||
| 674 | #define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) | ||
| 675 | #define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) | ||
| 676 | #define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) | ||
| 677 | #define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) | ||
| 678 | #define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) | ||
| 679 | #define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) | ||
| 680 | #define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) | ||
| 681 | #define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) | ||
| 682 | #define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) | ||
| 683 | #define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) | ||
| 684 | #define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) | ||
| 685 | #define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) | ||
| 686 | |||
| 687 | #define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) | ||
| 688 | #define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) | ||
| 689 | |||
| 690 | #define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) | ||
| 691 | #define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) | ||
| 692 | #define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) | ||
| 693 | #define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) | ||
| 694 | #define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) | ||
| 695 | #define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) | ||
| 696 | #define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) | ||
| 697 | #define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) | ||
| 698 | |||
| 699 | #define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) | ||
| 700 | #define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) | ||
| 701 | |||
| 702 | #define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) | ||
| 703 | |||
| 704 | #define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) | ||
| 705 | |||
| 706 | #define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) | ||
| 707 | #define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) | ||
| 708 | #define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) | ||
| 709 | #define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) | ||
| 710 | #define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) | ||
| 711 | #define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) | ||
| 712 | #define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) | ||
| 713 | #define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) | ||
| 714 | #define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) | ||
| 715 | #define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) | ||
| 716 | |||
| 717 | #define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) | ||
| 718 | #define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) | ||
| 719 | #define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) | ||
| 720 | #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) | ||
| 721 | #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) | ||
| 722 | #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) | ||
| 723 | #define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) | ||
| 724 | #define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) | ||
| 725 | |||
| 726 | #define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) | ||
| 727 | #define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) | ||
| 728 | #define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) | ||
| 729 | #define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) | ||
| 730 | #define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) | ||
| 731 | #define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) | ||
| 732 | #define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) | ||
| 733 | #define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) | ||
| 734 | #define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) | ||
| 735 | |||
| 736 | /** | ||
| 737 | * Device specific ioctls should only be in their respective headers | ||
| 738 | * The device specific ioctl range is from 0x40 to 0x99. | ||
| 739 | * Generic IOCTLS restart at 0xA0. | ||
| 740 | * | ||
| 741 | * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and | ||
| 742 | * drmCommandReadWrite(). | ||
| 743 | */ | ||
| 744 | #define DRM_COMMAND_BASE 0x40 | ||
| 745 | #define DRM_COMMAND_END 0xA0 | ||
| 746 | |||
| 747 | /** | ||
| 748 | * Header for events written back to userspace on the drm fd. The | ||
| 749 | * type defines the type of event, the length specifies the total | ||
| 750 | * length of the event (including the header), and user_data is | ||
| 751 | * typically a 64 bit value passed with the ioctl that triggered the | ||
| 752 | * event. A read on the drm fd will always only return complete | ||
| 753 | * events, that is, if for example the read buffer is 100 bytes, and | ||
| 754 | * there are two 64 byte events pending, only one will be returned. | ||
| 755 | * | ||
| 756 | * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and | ||
| 757 | * up are chipset specific. | ||
| 758 | */ | ||
| 759 | struct drm_event { | ||
| 760 | __u32 type; | ||
| 761 | __u32 length; | ||
| 762 | }; | ||
| 763 | |||
| 764 | #define DRM_EVENT_VBLANK 0x01 | ||
| 765 | #define DRM_EVENT_FLIP_COMPLETE 0x02 | ||
| 766 | |||
| 767 | struct drm_event_vblank { | ||
| 768 | struct drm_event base; | ||
| 769 | __u64 user_data; | ||
| 770 | __u32 tv_sec; | ||
| 771 | __u32 tv_usec; | ||
| 772 | __u32 sequence; | ||
| 773 | __u32 reserved; | ||
| 774 | }; | ||
| 775 | |||
| 776 | #define DRM_CAP_DUMB_BUFFER 0x1 | ||
| 777 | #define DRM_CAP_VBLANK_HIGH_CRTC 0x2 | ||
| 778 | #define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 | ||
| 779 | #define DRM_CAP_DUMB_PREFER_SHADOW 0x4 | ||
| 780 | #define DRM_CAP_PRIME 0x5 | ||
| 781 | |||
| 782 | #define DRM_PRIME_CAP_IMPORT 0x1 | ||
| 783 | #define DRM_PRIME_CAP_EXPORT 0x2 | ||
| 784 | |||
| 785 | /* typedef area */ | ||
| 786 | #ifndef __KERNEL__ | ||
| 787 | typedef struct drm_clip_rect drm_clip_rect_t; | ||
| 788 | typedef struct drm_drawable_info drm_drawable_info_t; | ||
| 789 | typedef struct drm_tex_region drm_tex_region_t; | ||
| 790 | typedef struct drm_hw_lock drm_hw_lock_t; | ||
| 791 | typedef struct drm_version drm_version_t; | ||
| 792 | typedef struct drm_unique drm_unique_t; | ||
| 793 | typedef struct drm_list drm_list_t; | ||
| 794 | typedef struct drm_block drm_block_t; | ||
| 795 | typedef struct drm_control drm_control_t; | ||
| 796 | typedef enum drm_map_type drm_map_type_t; | ||
| 797 | typedef enum drm_map_flags drm_map_flags_t; | ||
| 798 | typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; | ||
| 799 | typedef struct drm_map drm_map_t; | ||
| 800 | typedef struct drm_client drm_client_t; | ||
| 801 | typedef enum drm_stat_type drm_stat_type_t; | ||
| 802 | typedef struct drm_stats drm_stats_t; | ||
| 803 | typedef enum drm_lock_flags drm_lock_flags_t; | ||
| 804 | typedef struct drm_lock drm_lock_t; | ||
| 805 | typedef enum drm_dma_flags drm_dma_flags_t; | ||
| 806 | typedef struct drm_buf_desc drm_buf_desc_t; | ||
| 807 | typedef struct drm_buf_info drm_buf_info_t; | ||
| 808 | typedef struct drm_buf_free drm_buf_free_t; | ||
| 809 | typedef struct drm_buf_pub drm_buf_pub_t; | ||
| 810 | typedef struct drm_buf_map drm_buf_map_t; | ||
| 811 | typedef struct drm_dma drm_dma_t; | ||
| 812 | typedef union drm_wait_vblank drm_wait_vblank_t; | ||
| 813 | typedef struct drm_agp_mode drm_agp_mode_t; | ||
| 814 | typedef enum drm_ctx_flags drm_ctx_flags_t; | ||
| 815 | typedef struct drm_ctx drm_ctx_t; | ||
| 816 | typedef struct drm_ctx_res drm_ctx_res_t; | ||
| 817 | typedef struct drm_draw drm_draw_t; | ||
| 818 | typedef struct drm_update_draw drm_update_draw_t; | ||
| 819 | typedef struct drm_auth drm_auth_t; | ||
| 820 | typedef struct drm_irq_busid drm_irq_busid_t; | ||
| 821 | typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; | ||
| 822 | |||
| 823 | typedef struct drm_agp_buffer drm_agp_buffer_t; | ||
| 824 | typedef struct drm_agp_binding drm_agp_binding_t; | ||
| 825 | typedef struct drm_agp_info drm_agp_info_t; | ||
| 826 | typedef struct drm_scatter_gather drm_scatter_gather_t; | ||
| 827 | typedef struct drm_set_version drm_set_version_t; | ||
| 828 | #endif | ||
| 829 | |||
| 830 | #endif | ||
| @@ -0,0 +1,135 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2011 Intel Corporation | ||
| 3 | * | ||
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 5 | * copy of this software and associated documentation files (the "Software"), | ||
| 6 | * to deal in the Software without restriction, including without limitation | ||
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 9 | * Software is furnished to do so, subject to the following conditions: | ||
| 10 | * | ||
| 11 | * The above copyright notice and this permission notice (including the next | ||
| 12 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 13 | * Software. | ||
| 14 | * | ||
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 18 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 19 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 20 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 21 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef DRM_FOURCC_H | ||
| 25 | #define DRM_FOURCC_H | ||
| 26 | |||
| 27 | #include <linux/types.h> | ||
| 28 | |||
| 29 | #define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ | ||
| 30 | ((__u32)(c) << 16) | ((__u32)(d) << 24)) | ||
| 31 | |||
| 32 | #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ | ||
| 33 | |||
| 34 | /* color index */ | ||
| 35 | #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ | ||
| 36 | |||
| 37 | /* 8 bpp RGB */ | ||
| 38 | #define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ | ||
| 39 | #define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ | ||
| 40 | |||
| 41 | /* 16 bpp RGB */ | ||
| 42 | #define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ | ||
| 43 | #define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ | ||
| 44 | #define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ | ||
| 45 | #define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ | ||
| 46 | |||
| 47 | #define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ | ||
| 48 | #define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ | ||
| 49 | #define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ | ||
| 50 | #define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ | ||
| 51 | |||
| 52 | #define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ | ||
| 53 | #define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ | ||
| 54 | #define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ | ||
| 55 | #define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ | ||
| 56 | |||
| 57 | #define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ | ||
| 58 | #define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ | ||
| 59 | #define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ | ||
| 60 | #define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ | ||
| 61 | |||
| 62 | #define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ | ||
| 63 | #define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ | ||
| 64 | |||
| 65 | /* 24 bpp RGB */ | ||
| 66 | #define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ | ||
| 67 | #define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ | ||
| 68 | |||
| 69 | /* 32 bpp RGB */ | ||
| 70 | #define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ | ||
| 71 | #define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ | ||
| 72 | #define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ | ||
| 73 | #define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ | ||
| 74 | |||
| 75 | #define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ | ||
| 76 | #define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ | ||
| 77 | #define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ | ||
| 78 | #define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ | ||
| 79 | |||
| 80 | #define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ | ||
| 81 | #define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ | ||
| 82 | #define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ | ||
| 83 | #define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ | ||
| 84 | |||
| 85 | #define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ | ||
| 86 | #define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ | ||
| 87 | #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ | ||
| 88 | #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ | ||
| 89 | |||
| 90 | /* packed YCbCr */ | ||
| 91 | #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ | ||
| 92 | #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ | ||
| 93 | #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ | ||
| 94 | #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ | ||
| 95 | |||
| 96 | #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ | ||
| 97 | |||
| 98 | /* | ||
| 99 | * 2 plane YCbCr | ||
| 100 | * index 0 = Y plane, [7:0] Y | ||
| 101 | * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian | ||
| 102 | * or | ||
| 103 | * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian | ||
| 104 | */ | ||
| 105 | #define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ | ||
| 106 | #define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ | ||
| 107 | #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ | ||
| 108 | #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ | ||
| 109 | #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ | ||
| 110 | #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ | ||
| 111 | |||
| 112 | /* special NV12 tiled format */ | ||
| 113 | #define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ | ||
| 114 | |||
| 115 | /* | ||
| 116 | * 3 plane YCbCr | ||
| 117 | * index 0: Y plane, [7:0] Y | ||
| 118 | * index 1: Cb plane, [7:0] Cb | ||
| 119 | * index 2: Cr plane, [7:0] Cr | ||
| 120 | * or | ||
| 121 | * index 1: Cr plane, [7:0] Cr | ||
| 122 | * index 2: Cb plane, [7:0] Cb | ||
| 123 | */ | ||
| 124 | #define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ | ||
| 125 | #define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ | ||
| 126 | #define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ | ||
| 127 | #define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ | ||
| 128 | #define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ | ||
| 129 | #define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ | ||
| 130 | #define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ | ||
| 131 | #define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ | ||
| 132 | #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ | ||
| 133 | #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ | ||
| 134 | |||
| 135 | #endif /* DRM_FOURCC_H */ | ||
| @@ -0,0 +1,463 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> | ||
| 3 | * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com> | ||
| 4 | * Copyright (c) 2008 Red Hat Inc. | ||
| 5 | * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA | ||
| 6 | * Copyright (c) 2007-2008 Intel Corporation | ||
| 7 | * | ||
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 9 | * copy of this software and associated documentation files (the "Software"), | ||
| 10 | * to deal in the Software without restriction, including without limitation | ||
| 11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 12 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 13 | * Software is furnished to do so, subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice shall be included in | ||
| 16 | * all copies or substantial portions of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
| 24 | * IN THE SOFTWARE. | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _DRM_MODE_H | ||
| 28 | #define _DRM_MODE_H | ||
| 29 | |||
| 30 | #include <linux/types.h> | ||
| 31 | |||
| 32 | #define DRM_DISPLAY_INFO_LEN 32 | ||
| 33 | #define DRM_CONNECTOR_NAME_LEN 32 | ||
| 34 | #define DRM_DISPLAY_MODE_LEN 32 | ||
| 35 | #define DRM_PROP_NAME_LEN 32 | ||
| 36 | |||
| 37 | #define DRM_MODE_TYPE_BUILTIN (1<<0) | ||
| 38 | #define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) | ||
| 39 | #define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) | ||
| 40 | #define DRM_MODE_TYPE_PREFERRED (1<<3) | ||
| 41 | #define DRM_MODE_TYPE_DEFAULT (1<<4) | ||
| 42 | #define DRM_MODE_TYPE_USERDEF (1<<5) | ||
| 43 | #define DRM_MODE_TYPE_DRIVER (1<<6) | ||
| 44 | |||
| 45 | /* Video mode flags */ | ||
| 46 | /* bit compatible with the xorg definitions. */ | ||
| 47 | #define DRM_MODE_FLAG_PHSYNC (1<<0) | ||
| 48 | #define DRM_MODE_FLAG_NHSYNC (1<<1) | ||
| 49 | #define DRM_MODE_FLAG_PVSYNC (1<<2) | ||
| 50 | #define DRM_MODE_FLAG_NVSYNC (1<<3) | ||
| 51 | #define DRM_MODE_FLAG_INTERLACE (1<<4) | ||
| 52 | #define DRM_MODE_FLAG_DBLSCAN (1<<5) | ||
| 53 | #define DRM_MODE_FLAG_CSYNC (1<<6) | ||
| 54 | #define DRM_MODE_FLAG_PCSYNC (1<<7) | ||
| 55 | #define DRM_MODE_FLAG_NCSYNC (1<<8) | ||
| 56 | #define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ | ||
| 57 | #define DRM_MODE_FLAG_BCAST (1<<10) | ||
| 58 | #define DRM_MODE_FLAG_PIXMUX (1<<11) | ||
| 59 | #define DRM_MODE_FLAG_DBLCLK (1<<12) | ||
| 60 | #define DRM_MODE_FLAG_CLKDIV2 (1<<13) | ||
| 61 | |||
| 62 | /* DPMS flags */ | ||
| 63 | /* bit compatible with the xorg definitions. */ | ||
| 64 | #define DRM_MODE_DPMS_ON 0 | ||
| 65 | #define DRM_MODE_DPMS_STANDBY 1 | ||
| 66 | #define DRM_MODE_DPMS_SUSPEND 2 | ||
| 67 | #define DRM_MODE_DPMS_OFF 3 | ||
| 68 | |||
| 69 | /* Scaling mode options */ | ||
| 70 | #define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or | ||
| 71 | software can still scale) */ | ||
| 72 | #define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */ | ||
| 73 | #define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ | ||
| 74 | #define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ | ||
| 75 | |||
| 76 | /* Dithering mode options */ | ||
| 77 | #define DRM_MODE_DITHERING_OFF 0 | ||
| 78 | #define DRM_MODE_DITHERING_ON 1 | ||
| 79 | #define DRM_MODE_DITHERING_AUTO 2 | ||
| 80 | |||
| 81 | /* Dirty info options */ | ||
| 82 | #define DRM_MODE_DIRTY_OFF 0 | ||
| 83 | #define DRM_MODE_DIRTY_ON 1 | ||
| 84 | #define DRM_MODE_DIRTY_ANNOTATE 2 | ||
| 85 | |||
| 86 | struct drm_mode_modeinfo { | ||
| 87 | __u32 clock; | ||
| 88 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; | ||
| 89 | __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan; | ||
| 90 | |||
| 91 | __u32 vrefresh; | ||
| 92 | |||
| 93 | __u32 flags; | ||
| 94 | __u32 type; | ||
| 95 | char name[DRM_DISPLAY_MODE_LEN]; | ||
| 96 | }; | ||
| 97 | |||
| 98 | struct drm_mode_card_res { | ||
| 99 | __u64 fb_id_ptr; | ||
| 100 | __u64 crtc_id_ptr; | ||
| 101 | __u64 connector_id_ptr; | ||
| 102 | __u64 encoder_id_ptr; | ||
| 103 | __u32 count_fbs; | ||
| 104 | __u32 count_crtcs; | ||
| 105 | __u32 count_connectors; | ||
| 106 | __u32 count_encoders; | ||
| 107 | __u32 min_width, max_width; | ||
| 108 | __u32 min_height, max_height; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct drm_mode_crtc { | ||
| 112 | __u64 set_connectors_ptr; | ||
| 113 | __u32 count_connectors; | ||
| 114 | |||
| 115 | __u32 crtc_id; /**< Id */ | ||
| 116 | __u32 fb_id; /**< Id of framebuffer */ | ||
| 117 | |||
| 118 | __u32 x, y; /**< Position on the frameuffer */ | ||
| 119 | |||
| 120 | __u32 gamma_size; | ||
| 121 | __u32 mode_valid; | ||
| 122 | struct drm_mode_modeinfo mode; | ||
| 123 | }; | ||
| 124 | |||
| 125 | #define DRM_MODE_PRESENT_TOP_FIELD (1<<0) | ||
| 126 | #define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1) | ||
| 127 | |||
| 128 | /* Planes blend with or override other bits on the CRTC */ | ||
| 129 | struct drm_mode_set_plane { | ||
| 130 | __u32 plane_id; | ||
| 131 | __u32 crtc_id; | ||
| 132 | __u32 fb_id; /* fb object contains surface format type */ | ||
| 133 | __u32 flags; /* see above flags */ | ||
| 134 | |||
| 135 | /* Signed dest location allows it to be partially off screen */ | ||
| 136 | __s32 crtc_x, crtc_y; | ||
| 137 | __u32 crtc_w, crtc_h; | ||
| 138 | |||
| 139 | /* Source values are 16.16 fixed point */ | ||
| 140 | __u32 src_x, src_y; | ||
| 141 | __u32 src_h, src_w; | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct drm_mode_get_plane { | ||
| 145 | __u32 plane_id; | ||
| 146 | |||
| 147 | __u32 crtc_id; | ||
| 148 | __u32 fb_id; | ||
| 149 | |||
| 150 | __u32 possible_crtcs; | ||
| 151 | __u32 gamma_size; | ||
| 152 | |||
| 153 | __u32 count_format_types; | ||
| 154 | __u64 format_type_ptr; | ||
| 155 | }; | ||
| 156 | |||
| 157 | struct drm_mode_get_plane_res { | ||
| 158 | __u64 plane_id_ptr; | ||
| 159 | __u32 count_planes; | ||
| 160 | }; | ||
| 161 | |||
| 162 | #define DRM_MODE_ENCODER_NONE 0 | ||
| 163 | #define DRM_MODE_ENCODER_DAC 1 | ||
| 164 | #define DRM_MODE_ENCODER_TMDS 2 | ||
| 165 | #define DRM_MODE_ENCODER_LVDS 3 | ||
| 166 | #define DRM_MODE_ENCODER_TVDAC 4 | ||
| 167 | #define DRM_MODE_ENCODER_VIRTUAL 5 | ||
| 168 | |||
| 169 | struct drm_mode_get_encoder { | ||
| 170 | __u32 encoder_id; | ||
| 171 | __u32 encoder_type; | ||
| 172 | |||
| 173 | __u32 crtc_id; /**< Id of crtc */ | ||
| 174 | |||
| 175 | __u32 possible_crtcs; | ||
| 176 | __u32 possible_clones; | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* This is for connectors with multiple signal types. */ | ||
| 180 | /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ | ||
| 181 | #define DRM_MODE_SUBCONNECTOR_Automatic 0 | ||
| 182 | #define DRM_MODE_SUBCONNECTOR_Unknown 0 | ||
| 183 | #define DRM_MODE_SUBCONNECTOR_DVID 3 | ||
| 184 | #define DRM_MODE_SUBCONNECTOR_DVIA 4 | ||
| 185 | #define DRM_MODE_SUBCONNECTOR_Composite 5 | ||
| 186 | #define DRM_MODE_SUBCONNECTOR_SVIDEO 6 | ||
| 187 | #define DRM_MODE_SUBCONNECTOR_Component 8 | ||
| 188 | #define DRM_MODE_SUBCONNECTOR_SCART 9 | ||
| 189 | |||
| 190 | #define DRM_MODE_CONNECTOR_Unknown 0 | ||
| 191 | #define DRM_MODE_CONNECTOR_VGA 1 | ||
| 192 | #define DRM_MODE_CONNECTOR_DVII 2 | ||
| 193 | #define DRM_MODE_CONNECTOR_DVID 3 | ||
| 194 | #define DRM_MODE_CONNECTOR_DVIA 4 | ||
| 195 | #define DRM_MODE_CONNECTOR_Composite 5 | ||
| 196 | #define DRM_MODE_CONNECTOR_SVIDEO 6 | ||
| 197 | #define DRM_MODE_CONNECTOR_LVDS 7 | ||
| 198 | #define DRM_MODE_CONNECTOR_Component 8 | ||
| 199 | #define DRM_MODE_CONNECTOR_9PinDIN 9 | ||
| 200 | #define DRM_MODE_CONNECTOR_DisplayPort 10 | ||
| 201 | #define DRM_MODE_CONNECTOR_HDMIA 11 | ||
| 202 | #define DRM_MODE_CONNECTOR_HDMIB 12 | ||
| 203 | #define DRM_MODE_CONNECTOR_TV 13 | ||
| 204 | #define DRM_MODE_CONNECTOR_eDP 14 | ||
| 205 | #define DRM_MODE_CONNECTOR_VIRTUAL 15 | ||
| 206 | |||
| 207 | struct drm_mode_get_connector { | ||
| 208 | |||
| 209 | __u64 encoders_ptr; | ||
| 210 | __u64 modes_ptr; | ||
| 211 | __u64 props_ptr; | ||
| 212 | __u64 prop_values_ptr; | ||
| 213 | |||
| 214 | __u32 count_modes; | ||
| 215 | __u32 count_props; | ||
| 216 | __u32 count_encoders; | ||
| 217 | |||
| 218 | __u32 encoder_id; /**< Current Encoder */ | ||
| 219 | __u32 connector_id; /**< Id */ | ||
| 220 | __u32 connector_type; | ||
| 221 | __u32 connector_type_id; | ||
| 222 | |||
| 223 | __u32 connection; | ||
| 224 | __u32 mm_width, mm_height; /**< HxW in millimeters */ | ||
| 225 | __u32 subpixel; | ||
| 226 | }; | ||
| 227 | |||
| 228 | #define DRM_MODE_PROP_PENDING (1<<0) | ||
| 229 | #define DRM_MODE_PROP_RANGE (1<<1) | ||
| 230 | #define DRM_MODE_PROP_IMMUTABLE (1<<2) | ||
| 231 | #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ | ||
| 232 | #define DRM_MODE_PROP_BLOB (1<<4) | ||
| 233 | #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ | ||
| 234 | |||
| 235 | struct drm_mode_property_enum { | ||
| 236 | __u64 value; | ||
| 237 | char name[DRM_PROP_NAME_LEN]; | ||
| 238 | }; | ||
| 239 | |||
| 240 | struct drm_mode_get_property { | ||
| 241 | __u64 values_ptr; /* values and blob lengths */ | ||
| 242 | __u64 enum_blob_ptr; /* enum and blob id ptrs */ | ||
| 243 | |||
| 244 | __u32 prop_id; | ||
| 245 | __u32 flags; | ||
| 246 | char name[DRM_PROP_NAME_LEN]; | ||
| 247 | |||
| 248 | __u32 count_values; | ||
| 249 | __u32 count_enum_blobs; | ||
| 250 | }; | ||
| 251 | |||
| 252 | struct drm_mode_connector_set_property { | ||
| 253 | __u64 value; | ||
| 254 | __u32 prop_id; | ||
| 255 | __u32 connector_id; | ||
| 256 | }; | ||
| 257 | |||
| 258 | struct drm_mode_obj_get_properties { | ||
| 259 | __u64 props_ptr; | ||
| 260 | __u64 prop_values_ptr; | ||
| 261 | __u32 count_props; | ||
| 262 | __u32 obj_id; | ||
| 263 | __u32 obj_type; | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct drm_mode_obj_set_property { | ||
| 267 | __u64 value; | ||
| 268 | __u32 prop_id; | ||
| 269 | __u32 obj_id; | ||
| 270 | __u32 obj_type; | ||
| 271 | }; | ||
| 272 | |||
| 273 | struct drm_mode_get_blob { | ||
| 274 | __u32 blob_id; | ||
| 275 | __u32 length; | ||
| 276 | __u64 data; | ||
| 277 | }; | ||
| 278 | |||
| 279 | struct drm_mode_fb_cmd { | ||
| 280 | __u32 fb_id; | ||
| 281 | __u32 width, height; | ||
| 282 | __u32 pitch; | ||
| 283 | __u32 bpp; | ||
| 284 | __u32 depth; | ||
| 285 | /* driver specific handle */ | ||
| 286 | __u32 handle; | ||
| 287 | }; | ||
| 288 | |||
| 289 | #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ | ||
| 290 | |||
| 291 | struct drm_mode_fb_cmd2 { | ||
| 292 | __u32 fb_id; | ||
| 293 | __u32 width, height; | ||
| 294 | __u32 pixel_format; /* fourcc code from drm_fourcc.h */ | ||
| 295 | __u32 flags; /* see above flags */ | ||
| 296 | |||
| 297 | /* | ||
| 298 | * In case of planar formats, this ioctl allows up to 4 | ||
| 299 | * buffer objects with offets and pitches per plane. | ||
| 300 | * The pitch and offset order is dictated by the fourcc, | ||
| 301 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | ||
| 302 | * | ||
| 303 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
| 304 | * followed by an interleaved U/V plane containing | ||
| 305 | * 8 bit 2x2 subsampled colour difference samples. | ||
| 306 | * | ||
| 307 | * So it would consist of Y as offset[0] and UV as | ||
| 308 | * offeset[1]. Note that offset[0] will generally | ||
| 309 | * be 0. | ||
| 310 | */ | ||
| 311 | __u32 handles[4]; | ||
| 312 | __u32 pitches[4]; /* pitch for each plane */ | ||
| 313 | __u32 offsets[4]; /* offset of each plane */ | ||
| 314 | }; | ||
| 315 | |||
| 316 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 | ||
| 317 | #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 | ||
| 318 | #define DRM_MODE_FB_DIRTY_FLAGS 0x03 | ||
| 319 | |||
| 320 | #define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 | ||
| 321 | |||
| 322 | /* | ||
| 323 | * Mark a region of a framebuffer as dirty. | ||
| 324 | * | ||
| 325 | * Some hardware does not automatically update display contents | ||
| 326 | * as a hardware or software draw to a framebuffer. This ioctl | ||
| 327 | * allows userspace to tell the kernel and the hardware what | ||
| 328 | * regions of the framebuffer have changed. | ||
| 329 | * | ||
| 330 | * The kernel or hardware is free to update more then just the | ||
| 331 | * region specified by the clip rects. The kernel or hardware | ||
| 332 | * may also delay and/or coalesce several calls to dirty into a | ||
| 333 | * single update. | ||
| 334 | * | ||
| 335 | * Userspace may annotate the updates, the annotates are a | ||
| 336 | * promise made by the caller that the change is either a copy | ||
| 337 | * of pixels or a fill of a single color in the region specified. | ||
| 338 | * | ||
| 339 | * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then | ||
| 340 | * the number of updated regions are half of num_clips given, | ||
| 341 | * where the clip rects are paired in src and dst. The width and | ||
| 342 | * height of each one of the pairs must match. | ||
| 343 | * | ||
| 344 | * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller | ||
| 345 | * promises that the region specified of the clip rects is filled | ||
| 346 | * completely with a single color as given in the color argument. | ||
| 347 | */ | ||
| 348 | |||
| 349 | struct drm_mode_fb_dirty_cmd { | ||
| 350 | __u32 fb_id; | ||
| 351 | __u32 flags; | ||
| 352 | __u32 color; | ||
| 353 | __u32 num_clips; | ||
| 354 | __u64 clips_ptr; | ||
| 355 | }; | ||
| 356 | |||
| 357 | struct drm_mode_mode_cmd { | ||
| 358 | __u32 connector_id; | ||
| 359 | struct drm_mode_modeinfo mode; | ||
| 360 | }; | ||
| 361 | |||
| 362 | #define DRM_MODE_CURSOR_BO 0x01 | ||
| 363 | #define DRM_MODE_CURSOR_MOVE 0x02 | ||
| 364 | #define DRM_MODE_CURSOR_FLAGS 0x03 | ||
| 365 | |||
| 366 | /* | ||
| 367 | * depending on the value in flags different members are used. | ||
| 368 | * | ||
| 369 | * CURSOR_BO uses | ||
| 370 | * crtc | ||
| 371 | * width | ||
| 372 | * height | ||
| 373 | * handle - if 0 turns the cursor of | ||
| 374 | * | ||
| 375 | * CURSOR_MOVE uses | ||
| 376 | * crtc | ||
| 377 | * x | ||
| 378 | * y | ||
| 379 | */ | ||
| 380 | struct drm_mode_cursor { | ||
| 381 | __u32 flags; | ||
| 382 | __u32 crtc_id; | ||
| 383 | __s32 x; | ||
| 384 | __s32 y; | ||
| 385 | __u32 width; | ||
| 386 | __u32 height; | ||
| 387 | /* driver specific handle */ | ||
| 388 | __u32 handle; | ||
| 389 | }; | ||
| 390 | |||
| 391 | struct drm_mode_crtc_lut { | ||
| 392 | __u32 crtc_id; | ||
| 393 | __u32 gamma_size; | ||
| 394 | |||
| 395 | /* pointers to arrays */ | ||
| 396 | __u64 red; | ||
| 397 | __u64 green; | ||
| 398 | __u64 blue; | ||
| 399 | }; | ||
| 400 | |||
| 401 | #define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
| 402 | #define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT | ||
| 403 | |||
| 404 | /* | ||
| 405 | * Request a page flip on the specified crtc. | ||
| 406 | * | ||
| 407 | * This ioctl will ask KMS to schedule a page flip for the specified | ||
| 408 | * crtc. Once any pending rendering targeting the specified fb (as of | ||
| 409 | * ioctl time) has completed, the crtc will be reprogrammed to display | ||
| 410 | * that fb after the next vertical refresh. The ioctl returns | ||
| 411 | * immediately, but subsequent rendering to the current fb will block | ||
| 412 | * in the execbuffer ioctl until the page flip happens. If a page | ||
| 413 | * flip is already pending as the ioctl is called, EBUSY will be | ||
| 414 | * returned. | ||
| 415 | * | ||
| 416 | * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will | ||
| 417 | * request that drm sends back a vblank event (see drm.h: struct | ||
| 418 | * drm_event_vblank) when the page flip is done. The user_data field | ||
| 419 | * passed in with this ioctl will be returned as the user_data field | ||
| 420 | * in the vblank event struct. | ||
| 421 | * | ||
| 422 | * The reserved field must be zero until we figure out something | ||
| 423 | * clever to use it for. | ||
| 424 | */ | ||
| 425 | |||
| 426 | struct drm_mode_crtc_page_flip { | ||
| 427 | __u32 crtc_id; | ||
| 428 | __u32 fb_id; | ||
| 429 | __u32 flags; | ||
| 430 | __u32 reserved; | ||
| 431 | __u64 user_data; | ||
| 432 | }; | ||
| 433 | |||
| 434 | /* create a dumb scanout buffer */ | ||
| 435 | struct drm_mode_create_dumb { | ||
| 436 | uint32_t height; | ||
| 437 | uint32_t width; | ||
| 438 | uint32_t bpp; | ||
| 439 | uint32_t flags; | ||
| 440 | /* handle, pitch, size will be returned */ | ||
| 441 | uint32_t handle; | ||
| 442 | uint32_t pitch; | ||
| 443 | uint64_t size; | ||
| 444 | }; | ||
| 445 | |||
| 446 | /* set up for mmap of a dumb scanout buffer */ | ||
| 447 | struct drm_mode_map_dumb { | ||
| 448 | /** Handle for the object being mapped. */ | ||
| 449 | __u32 handle; | ||
| 450 | __u32 pad; | ||
| 451 | /** | ||
| 452 | * Fake offset to use for subsequent mmap call | ||
| 453 | * | ||
| 454 | * This is a fixed-size type for 32/64 compatibility. | ||
| 455 | */ | ||
| 456 | __u64 offset; | ||
| 457 | }; | ||
| 458 | |||
| 459 | struct drm_mode_destroy_dumb { | ||
| 460 | uint32_t handle; | ||
| 461 | }; | ||
| 462 | |||
| 463 | #endif | ||
| @@ -0,0 +1,86 @@ | |||
| 1 | /** | ||
| 2 | * \file drm_sarea.h | ||
| 3 | * \brief SAREA definitions | ||
| 4 | * | ||
| 5 | * \author Michel Dänzer <michel@daenzer.net> | ||
| 6 | */ | ||
| 7 | |||
| 8 | /* | ||
| 9 | * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
| 10 | * All Rights Reserved. | ||
| 11 | * | ||
| 12 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 13 | * copy of this software and associated documentation files (the "Software"), | ||
| 14 | * to deal in the Software without restriction, including without limitation | ||
| 15 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 16 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 17 | * Software is furnished to do so, subject to the following conditions: | ||
| 18 | * | ||
| 19 | * The above copyright notice and this permission notice (including the next | ||
| 20 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 21 | * Software. | ||
| 22 | * | ||
| 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 26 | * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 27 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 28 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 29 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef _DRM_SAREA_H_ | ||
| 33 | #define _DRM_SAREA_H_ | ||
| 34 | |||
| 35 | #include <drm/drm.h> | ||
| 36 | |||
| 37 | /* SAREA area needs to be at least a page */ | ||
| 38 | #if defined(__alpha__) | ||
| 39 | #define SAREA_MAX 0x2000U | ||
| 40 | #elif defined(__mips__) | ||
| 41 | #define SAREA_MAX 0x4000U | ||
| 42 | #elif defined(__ia64__) | ||
| 43 | #define SAREA_MAX 0x10000U /* 64kB */ | ||
| 44 | #else | ||
| 45 | /* Intel 830M driver needs at least 8k SAREA */ | ||
| 46 | #define SAREA_MAX 0x2000U | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /** Maximum number of drawables in the SAREA */ | ||
| 50 | #define SAREA_MAX_DRAWABLES 256 | ||
| 51 | |||
| 52 | #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 | ||
| 53 | |||
| 54 | /** SAREA drawable */ | ||
| 55 | struct drm_sarea_drawable { | ||
| 56 | unsigned int stamp; | ||
| 57 | unsigned int flags; | ||
| 58 | }; | ||
| 59 | |||
| 60 | /** SAREA frame */ | ||
| 61 | struct drm_sarea_frame { | ||
| 62 | unsigned int x; | ||
| 63 | unsigned int y; | ||
| 64 | unsigned int width; | ||
| 65 | unsigned int height; | ||
| 66 | unsigned int fullscreen; | ||
| 67 | }; | ||
| 68 | |||
| 69 | /** SAREA */ | ||
| 70 | struct drm_sarea { | ||
| 71 | /** first thing is always the DRM locking structure */ | ||
| 72 | struct drm_hw_lock lock; | ||
| 73 | /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ | ||
| 74 | struct drm_hw_lock drawable_lock; | ||
| 75 | struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ | ||
| 76 | struct drm_sarea_frame frame; /**< frame */ | ||
| 77 | drm_context_t dummy_context; | ||
| 78 | }; | ||
| 79 | |||
| 80 | #ifndef __KERNEL__ | ||
| 81 | typedef struct drm_sarea_drawable drm_sarea_drawable_t; | ||
| 82 | typedef struct drm_sarea_frame drm_sarea_frame_t; | ||
| 83 | typedef struct drm_sarea drm_sarea_t; | ||
| 84 | #endif | ||
| 85 | |||
| 86 | #endif /* _DRM_SAREA_H_ */ | ||
| @@ -0,0 +1,203 @@ | |||
| 1 | /* exynos_drm.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
| 4 | * Authors: | ||
| 5 | * Inki Dae <inki.dae@samsung.com> | ||
| 6 | * Joonyoung Shim <jy0922.shim@samsung.com> | ||
| 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> | ||
| 8 | * | ||
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 10 | * copy of this software and associated documentation files (the "Software"), | ||
| 11 | * to deal in the Software without restriction, including without limitation | ||
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 14 | * Software is furnished to do so, subject to the following conditions: | ||
| 15 | * | ||
| 16 | * The above copyright notice and this permission notice (including the next | ||
| 17 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 18 | * Software. | ||
| 19 | * | ||
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 23 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 26 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _UAPI_EXYNOS_DRM_H_ | ||
| 30 | #define _UAPI_EXYNOS_DRM_H_ | ||
| 31 | |||
| 32 | #include <drm/drm.h> | ||
| 33 | |||
| 34 | /** | ||
| 35 | * User-desired buffer creation information structure. | ||
| 36 | * | ||
| 37 | * @size: user-desired memory allocation size. | ||
| 38 | * - this size value would be page-aligned internally. | ||
| 39 | * @flags: user request for setting memory type or cache attributes. | ||
| 40 | * @handle: returned a handle to created gem object. | ||
| 41 | * - this handle will be set by gem module of kernel side. | ||
| 42 | */ | ||
| 43 | struct drm_exynos_gem_create { | ||
| 44 | uint64_t size; | ||
| 45 | unsigned int flags; | ||
| 46 | unsigned int handle; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * A structure for getting buffer offset. | ||
| 51 | * | ||
| 52 | * @handle: a pointer to gem object created. | ||
| 53 | * @pad: just padding to be 64-bit aligned. | ||
| 54 | * @offset: relatived offset value of the memory region allocated. | ||
| 55 | * - this value should be set by user. | ||
| 56 | */ | ||
| 57 | struct drm_exynos_gem_map_off { | ||
| 58 | unsigned int handle; | ||
| 59 | unsigned int pad; | ||
| 60 | uint64_t offset; | ||
| 61 | }; | ||
| 62 | |||
| 63 | /** | ||
| 64 | * A structure for mapping buffer. | ||
| 65 | * | ||
| 66 | * @handle: a handle to gem object created. | ||
| 67 | * @pad: just padding to be 64-bit aligned. | ||
| 68 | * @size: memory size to be mapped. | ||
| 69 | * @mapped: having user virtual address mmaped. | ||
| 70 | * - this variable would be filled by exynos gem module | ||
| 71 | * of kernel side with user virtual address which is allocated | ||
| 72 | * by do_mmap(). | ||
| 73 | */ | ||
| 74 | struct drm_exynos_gem_mmap { | ||
| 75 | unsigned int handle; | ||
| 76 | unsigned int pad; | ||
| 77 | uint64_t size; | ||
| 78 | uint64_t mapped; | ||
| 79 | }; | ||
| 80 | |||
| 81 | /** | ||
| 82 | * A structure to gem information. | ||
| 83 | * | ||
| 84 | * @handle: a handle to gem object created. | ||
| 85 | * @flags: flag value including memory type and cache attribute and | ||
| 86 | * this value would be set by driver. | ||
| 87 | * @size: size to memory region allocated by gem and this size would | ||
| 88 | * be set by driver. | ||
| 89 | */ | ||
| 90 | struct drm_exynos_gem_info { | ||
| 91 | unsigned int handle; | ||
| 92 | unsigned int flags; | ||
| 93 | uint64_t size; | ||
| 94 | }; | ||
| 95 | |||
| 96 | /** | ||
| 97 | * A structure for user connection request of virtual display. | ||
| 98 | * | ||
| 99 | * @connection: indicate whether doing connetion or not by user. | ||
| 100 | * @extensions: if this value is 1 then the vidi driver would need additional | ||
| 101 | * 128bytes edid data. | ||
| 102 | * @edid: the edid data pointer from user side. | ||
| 103 | */ | ||
| 104 | struct drm_exynos_vidi_connection { | ||
| 105 | unsigned int connection; | ||
| 106 | unsigned int extensions; | ||
| 107 | uint64_t edid; | ||
| 108 | }; | ||
| 109 | |||
| 110 | /* memory type definitions. */ | ||
| 111 | enum e_drm_exynos_gem_mem_type { | ||
| 112 | /* Physically Continuous memory and used as default. */ | ||
| 113 | EXYNOS_BO_CONTIG = 0 << 0, | ||
| 114 | /* Physically Non-Continuous memory. */ | ||
| 115 | EXYNOS_BO_NONCONTIG = 1 << 0, | ||
| 116 | /* non-cachable mapping and used as default. */ | ||
| 117 | EXYNOS_BO_NONCACHABLE = 0 << 1, | ||
| 118 | /* cachable mapping. */ | ||
| 119 | EXYNOS_BO_CACHABLE = 1 << 1, | ||
| 120 | /* write-combine mapping. */ | ||
| 121 | EXYNOS_BO_WC = 1 << 2, | ||
| 122 | EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | EXYNOS_BO_CACHABLE | | ||
| 123 | EXYNOS_BO_WC | ||
| 124 | }; | ||
| 125 | |||
| 126 | struct drm_exynos_g2d_get_ver { | ||
| 127 | __u32 major; | ||
| 128 | __u32 minor; | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct drm_exynos_g2d_cmd { | ||
| 132 | __u32 offset; | ||
| 133 | __u32 data; | ||
| 134 | }; | ||
| 135 | |||
| 136 | enum drm_exynos_g2d_event_type { | ||
| 137 | G2D_EVENT_NOT, | ||
| 138 | G2D_EVENT_NONSTOP, | ||
| 139 | G2D_EVENT_STOP, /* not yet */ | ||
| 140 | }; | ||
| 141 | |||
| 142 | struct drm_exynos_g2d_set_cmdlist { | ||
| 143 | __u64 cmd; | ||
| 144 | __u64 cmd_gem; | ||
| 145 | __u32 cmd_nr; | ||
| 146 | __u32 cmd_gem_nr; | ||
| 147 | |||
| 148 | /* for g2d event */ | ||
| 149 | __u64 event_type; | ||
| 150 | __u64 user_data; | ||
| 151 | }; | ||
| 152 | |||
| 153 | struct drm_exynos_g2d_exec { | ||
| 154 | __u64 async; | ||
| 155 | }; | ||
| 156 | |||
| 157 | #define DRM_EXYNOS_GEM_CREATE 0x00 | ||
| 158 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 | ||
| 159 | #define DRM_EXYNOS_GEM_MMAP 0x02 | ||
| 160 | /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */ | ||
| 161 | #define DRM_EXYNOS_GEM_GET 0x04 | ||
| 162 | #define DRM_EXYNOS_VIDI_CONNECTION 0x07 | ||
| 163 | |||
| 164 | /* G2D */ | ||
| 165 | #define DRM_EXYNOS_G2D_GET_VER 0x20 | ||
| 166 | #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 | ||
| 167 | #define DRM_EXYNOS_G2D_EXEC 0x22 | ||
| 168 | |||
| 169 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 170 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) | ||
| 171 | |||
| 172 | #define DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 173 | DRM_EXYNOS_GEM_MAP_OFFSET, struct drm_exynos_gem_map_off) | ||
| 174 | |||
| 175 | #define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 176 | DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) | ||
| 177 | |||
| 178 | #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 179 | DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info) | ||
| 180 | |||
| 181 | #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 182 | DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) | ||
| 183 | |||
| 184 | #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 185 | DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver) | ||
| 186 | #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 187 | DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist) | ||
| 188 | #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 189 | DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) | ||
| 190 | |||
| 191 | /* EXYNOS specific events */ | ||
| 192 | #define DRM_EXYNOS_G2D_EVENT 0x80000000 | ||
| 193 | |||
| 194 | struct drm_exynos_g2d_event { | ||
| 195 | struct drm_event base; | ||
| 196 | __u64 user_data; | ||
| 197 | __u32 tv_sec; | ||
| 198 | __u32 tv_usec; | ||
| 199 | __u32 cmdlist_no; | ||
| 200 | __u32 reserved; | ||
| 201 | }; | ||
| 202 | |||
| 203 | #endif /* _UAPI_EXYNOS_DRM_H_ */ | ||
| @@ -0,0 +1,281 @@ | |||
| 1 | #ifndef _I810_DRM_H_ | ||
| 2 | #define _I810_DRM_H_ | ||
| 3 | |||
| 4 | /* WARNING: These defines must be the same as what the Xserver uses. | ||
| 5 | * if you change them, you must change the defines in the Xserver. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _I810_DEFINES_ | ||
| 9 | #define _I810_DEFINES_ | ||
| 10 | |||
| 11 | #define I810_DMA_BUF_ORDER 12 | ||
| 12 | #define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER) | ||
| 13 | #define I810_DMA_BUF_NR 256 | ||
| 14 | #define I810_NR_SAREA_CLIPRECTS 8 | ||
| 15 | |||
| 16 | /* Each region is a minimum of 64k, and there are at most 64 of them. | ||
| 17 | */ | ||
| 18 | #define I810_NR_TEX_REGIONS 64 | ||
| 19 | #define I810_LOG_MIN_TEX_REGION_SIZE 16 | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */ | ||
| 23 | #define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */ | ||
| 24 | #define I810_UPLOAD_CTX 0x4 | ||
| 25 | #define I810_UPLOAD_BUFFERS 0x8 | ||
| 26 | #define I810_UPLOAD_TEX0 0x10 | ||
| 27 | #define I810_UPLOAD_TEX1 0x20 | ||
| 28 | #define I810_UPLOAD_CLIPRECTS 0x40 | ||
| 29 | |||
| 30 | /* Indices into buf.Setup where various bits of state are mirrored per | ||
| 31 | * context and per buffer. These can be fired at the card as a unit, | ||
| 32 | * or in a piecewise fashion as required. | ||
| 33 | */ | ||
| 34 | |||
| 35 | /* Destbuffer state | ||
| 36 | * - backbuffer linear offset and pitch -- invarient in the current dri | ||
| 37 | * - zbuffer linear offset and pitch -- also invarient | ||
| 38 | * - drawing origin in back and depth buffers. | ||
| 39 | * | ||
| 40 | * Keep the depth/back buffer state here to accommodate private buffers | ||
| 41 | * in the future. | ||
| 42 | */ | ||
| 43 | #define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */ | ||
| 44 | #define I810_DESTREG_DI1 1 | ||
| 45 | #define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */ | ||
| 46 | #define I810_DESTREG_DV1 3 | ||
| 47 | #define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */ | ||
| 48 | #define I810_DESTREG_DR1 5 | ||
| 49 | #define I810_DESTREG_DR2 6 | ||
| 50 | #define I810_DESTREG_DR3 7 | ||
| 51 | #define I810_DESTREG_DR4 8 | ||
| 52 | #define I810_DEST_SETUP_SIZE 10 | ||
| 53 | |||
| 54 | /* Context state | ||
| 55 | */ | ||
| 56 | #define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */ | ||
| 57 | #define I810_CTXREG_CF1 1 | ||
| 58 | #define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */ | ||
| 59 | #define I810_CTXREG_ST1 3 | ||
| 60 | #define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */ | ||
| 61 | #define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */ | ||
| 62 | #define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */ | ||
| 63 | #define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */ | ||
| 64 | #define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */ | ||
| 65 | #define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */ | ||
| 66 | #define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */ | ||
| 67 | #define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */ | ||
| 68 | #define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */ | ||
| 69 | #define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */ | ||
| 70 | #define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */ | ||
| 71 | #define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */ | ||
| 72 | #define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */ | ||
| 73 | #define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */ | ||
| 74 | #define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */ | ||
| 75 | #define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */ | ||
| 76 | #define I810_CTX_SETUP_SIZE 20 | ||
| 77 | |||
| 78 | /* Texture state (per tex unit) | ||
| 79 | */ | ||
| 80 | #define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */ | ||
| 81 | #define I810_TEXREG_MI1 1 | ||
| 82 | #define I810_TEXREG_MI2 2 | ||
| 83 | #define I810_TEXREG_MI3 3 | ||
| 84 | #define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */ | ||
| 85 | #define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */ | ||
| 86 | #define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */ | ||
| 87 | #define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */ | ||
| 88 | #define I810_TEX_SETUP_SIZE 8 | ||
| 89 | |||
| 90 | /* Flags for clear ioctl | ||
| 91 | */ | ||
| 92 | #define I810_FRONT 0x1 | ||
| 93 | #define I810_BACK 0x2 | ||
| 94 | #define I810_DEPTH 0x4 | ||
| 95 | |||
| 96 | typedef enum _drm_i810_init_func { | ||
| 97 | I810_INIT_DMA = 0x01, | ||
| 98 | I810_CLEANUP_DMA = 0x02, | ||
| 99 | I810_INIT_DMA_1_4 = 0x03 | ||
| 100 | } drm_i810_init_func_t; | ||
| 101 | |||
| 102 | /* This is the init structure after v1.2 */ | ||
| 103 | typedef struct _drm_i810_init { | ||
| 104 | drm_i810_init_func_t func; | ||
| 105 | unsigned int mmio_offset; | ||
| 106 | unsigned int buffers_offset; | ||
| 107 | int sarea_priv_offset; | ||
| 108 | unsigned int ring_start; | ||
| 109 | unsigned int ring_end; | ||
| 110 | unsigned int ring_size; | ||
| 111 | unsigned int front_offset; | ||
| 112 | unsigned int back_offset; | ||
| 113 | unsigned int depth_offset; | ||
| 114 | unsigned int overlay_offset; | ||
| 115 | unsigned int overlay_physical; | ||
| 116 | unsigned int w; | ||
| 117 | unsigned int h; | ||
| 118 | unsigned int pitch; | ||
| 119 | unsigned int pitch_bits; | ||
| 120 | } drm_i810_init_t; | ||
| 121 | |||
| 122 | /* This is the init structure prior to v1.2 */ | ||
| 123 | typedef struct _drm_i810_pre12_init { | ||
| 124 | drm_i810_init_func_t func; | ||
| 125 | unsigned int mmio_offset; | ||
| 126 | unsigned int buffers_offset; | ||
| 127 | int sarea_priv_offset; | ||
| 128 | unsigned int ring_start; | ||
| 129 | unsigned int ring_end; | ||
| 130 | unsigned int ring_size; | ||
| 131 | unsigned int front_offset; | ||
| 132 | unsigned int back_offset; | ||
| 133 | unsigned int depth_offset; | ||
| 134 | unsigned int w; | ||
| 135 | unsigned int h; | ||
| 136 | unsigned int pitch; | ||
| 137 | unsigned int pitch_bits; | ||
| 138 | } drm_i810_pre12_init_t; | ||
| 139 | |||
| 140 | /* Warning: If you change the SAREA structure you must change the Xserver | ||
| 141 | * structure as well */ | ||
| 142 | |||
| 143 | typedef struct _drm_i810_tex_region { | ||
| 144 | unsigned char next, prev; /* indices to form a circular LRU */ | ||
| 145 | unsigned char in_use; /* owned by a client, or free? */ | ||
| 146 | int age; /* tracked by clients to update local LRU's */ | ||
| 147 | } drm_i810_tex_region_t; | ||
| 148 | |||
| 149 | typedef struct _drm_i810_sarea { | ||
| 150 | unsigned int ContextState[I810_CTX_SETUP_SIZE]; | ||
| 151 | unsigned int BufferState[I810_DEST_SETUP_SIZE]; | ||
| 152 | unsigned int TexState[2][I810_TEX_SETUP_SIZE]; | ||
| 153 | unsigned int dirty; | ||
| 154 | |||
| 155 | unsigned int nbox; | ||
| 156 | struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS]; | ||
| 157 | |||
| 158 | /* Maintain an LRU of contiguous regions of texture space. If | ||
| 159 | * you think you own a region of texture memory, and it has an | ||
| 160 | * age different to the one you set, then you are mistaken and | ||
| 161 | * it has been stolen by another client. If global texAge | ||
| 162 | * hasn't changed, there is no need to walk the list. | ||
| 163 | * | ||
| 164 | * These regions can be used as a proxy for the fine-grained | ||
| 165 | * texture information of other clients - by maintaining them | ||
| 166 | * in the same lru which is used to age their own textures, | ||
| 167 | * clients have an approximate lru for the whole of global | ||
| 168 | * texture space, and can make informed decisions as to which | ||
| 169 | * areas to kick out. There is no need to choose whether to | ||
| 170 | * kick out your own texture or someone else's - simply eject | ||
| 171 | * them all in LRU order. | ||
| 172 | */ | ||
| 173 | |||
| 174 | drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1]; | ||
| 175 | /* Last elt is sentinal */ | ||
| 176 | int texAge; /* last time texture was uploaded */ | ||
| 177 | int last_enqueue; /* last time a buffer was enqueued */ | ||
| 178 | int last_dispatch; /* age of the most recently dispatched buffer */ | ||
| 179 | int last_quiescent; /* */ | ||
| 180 | int ctxOwner; /* last context to upload state */ | ||
| 181 | |||
| 182 | int vertex_prim; | ||
| 183 | |||
| 184 | int pf_enabled; /* is pageflipping allowed? */ | ||
| 185 | int pf_active; | ||
| 186 | int pf_current_page; /* which buffer is being displayed? */ | ||
| 187 | } drm_i810_sarea_t; | ||
| 188 | |||
| 189 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 190 | * defines in the Xserver file (xf86drmMga.h) | ||
| 191 | */ | ||
| 192 | |||
| 193 | /* i810 specific ioctls | ||
| 194 | * The device specific ioctl range is 0x40 to 0x79. | ||
| 195 | */ | ||
| 196 | #define DRM_I810_INIT 0x00 | ||
| 197 | #define DRM_I810_VERTEX 0x01 | ||
| 198 | #define DRM_I810_CLEAR 0x02 | ||
| 199 | #define DRM_I810_FLUSH 0x03 | ||
| 200 | #define DRM_I810_GETAGE 0x04 | ||
| 201 | #define DRM_I810_GETBUF 0x05 | ||
| 202 | #define DRM_I810_SWAP 0x06 | ||
| 203 | #define DRM_I810_COPY 0x07 | ||
| 204 | #define DRM_I810_DOCOPY 0x08 | ||
| 205 | #define DRM_I810_OV0INFO 0x09 | ||
| 206 | #define DRM_I810_FSTATUS 0x0a | ||
| 207 | #define DRM_I810_OV0FLIP 0x0b | ||
| 208 | #define DRM_I810_MC 0x0c | ||
| 209 | #define DRM_I810_RSTATUS 0x0d | ||
| 210 | #define DRM_I810_FLIP 0x0e | ||
| 211 | |||
| 212 | #define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t) | ||
| 213 | #define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t) | ||
| 214 | #define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t) | ||
| 215 | #define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH) | ||
| 216 | #define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE) | ||
| 217 | #define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t) | ||
| 218 | #define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP) | ||
| 219 | #define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t) | ||
| 220 | #define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY) | ||
| 221 | #define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t) | ||
| 222 | #define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS) | ||
| 223 | #define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP) | ||
| 224 | #define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t) | ||
| 225 | #define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS) | ||
| 226 | #define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP) | ||
| 227 | |||
| 228 | typedef struct _drm_i810_clear { | ||
| 229 | int clear_color; | ||
| 230 | int clear_depth; | ||
| 231 | int flags; | ||
| 232 | } drm_i810_clear_t; | ||
| 233 | |||
| 234 | /* These may be placeholders if we have more cliprects than | ||
| 235 | * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to | ||
| 236 | * false, indicating that the buffer will be dispatched again with a | ||
| 237 | * new set of cliprects. | ||
| 238 | */ | ||
| 239 | typedef struct _drm_i810_vertex { | ||
| 240 | int idx; /* buffer index */ | ||
| 241 | int used; /* nr bytes in use */ | ||
| 242 | int discard; /* client is finished with the buffer? */ | ||
| 243 | } drm_i810_vertex_t; | ||
| 244 | |||
| 245 | typedef struct _drm_i810_copy_t { | ||
| 246 | int idx; /* buffer index */ | ||
| 247 | int used; /* nr bytes in use */ | ||
| 248 | void *address; /* Address to copy from */ | ||
| 249 | } drm_i810_copy_t; | ||
| 250 | |||
| 251 | #define PR_TRIANGLES (0x0<<18) | ||
| 252 | #define PR_TRISTRIP_0 (0x1<<18) | ||
| 253 | #define PR_TRISTRIP_1 (0x2<<18) | ||
| 254 | #define PR_TRIFAN (0x3<<18) | ||
| 255 | #define PR_POLYGON (0x4<<18) | ||
| 256 | #define PR_LINES (0x5<<18) | ||
| 257 | #define PR_LINESTRIP (0x6<<18) | ||
| 258 | #define PR_RECTS (0x7<<18) | ||
| 259 | #define PR_MASK (0x7<<18) | ||
| 260 | |||
| 261 | typedef struct drm_i810_dma { | ||
| 262 | void *virtual; | ||
| 263 | int request_idx; | ||
| 264 | int request_size; | ||
| 265 | int granted; | ||
| 266 | } drm_i810_dma_t; | ||
| 267 | |||
| 268 | typedef struct _drm_i810_overlay_t { | ||
| 269 | unsigned int offset; /* Address of the Overlay Regs */ | ||
| 270 | unsigned int physical; | ||
| 271 | } drm_i810_overlay_t; | ||
| 272 | |||
| 273 | typedef struct _drm_i810_mc { | ||
| 274 | int idx; /* buffer index */ | ||
| 275 | int used; /* nr bytes in use */ | ||
| 276 | int num_blocks; /* number of GFXBlocks */ | ||
| 277 | int *length; /* List of lengths for GFXBlocks (FUTURE) */ | ||
| 278 | unsigned int last_render; /* Last Render Request */ | ||
| 279 | } drm_i810_mc_t; | ||
| 280 | |||
| 281 | #endif /* _I810_DRM_H_ */ | ||
| @@ -0,0 +1,953 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
| 3 | * All Rights Reserved. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the | ||
| 7 | * "Software"), to deal in the Software without restriction, including | ||
| 8 | * without limitation the rights to use, copy, modify, merge, publish, | ||
| 9 | * distribute, sub license, and/or sell copies of the Software, and to | ||
| 10 | * permit persons to whom the Software is furnished to do so, subject to | ||
| 11 | * the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice (including the | ||
| 14 | * next paragraph) shall be included in all copies or substantial portions | ||
| 15 | * of the Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | ||
| 20 | * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR | ||
| 21 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _UAPI_I915_DRM_H_ | ||
| 28 | #define _UAPI_I915_DRM_H_ | ||
| 29 | |||
| 30 | #include <drm/drm.h> | ||
| 31 | |||
| 32 | /* Please note that modifications to all structs defined here are | ||
| 33 | * subject to backwards-compatibility constraints. | ||
| 34 | */ | ||
| 35 | |||
| 36 | |||
| 37 | /* Each region is a minimum of 16k, and there are at most 255 of them. | ||
| 38 | */ | ||
| 39 | #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use | ||
| 40 | * of chars for next/prev indices */ | ||
| 41 | #define I915_LOG_MIN_TEX_REGION_SIZE 14 | ||
| 42 | |||
| 43 | typedef struct _drm_i915_init { | ||
| 44 | enum { | ||
| 45 | I915_INIT_DMA = 0x01, | ||
| 46 | I915_CLEANUP_DMA = 0x02, | ||
| 47 | I915_RESUME_DMA = 0x03 | ||
| 48 | } func; | ||
| 49 | unsigned int mmio_offset; | ||
| 50 | int sarea_priv_offset; | ||
| 51 | unsigned int ring_start; | ||
| 52 | unsigned int ring_end; | ||
| 53 | unsigned int ring_size; | ||
| 54 | unsigned int front_offset; | ||
| 55 | unsigned int back_offset; | ||
| 56 | unsigned int depth_offset; | ||
| 57 | unsigned int w; | ||
| 58 | unsigned int h; | ||
| 59 | unsigned int pitch; | ||
| 60 | unsigned int pitch_bits; | ||
| 61 | unsigned int back_pitch; | ||
| 62 | unsigned int depth_pitch; | ||
| 63 | unsigned int cpp; | ||
| 64 | unsigned int chipset; | ||
| 65 | } drm_i915_init_t; | ||
| 66 | |||
| 67 | typedef struct _drm_i915_sarea { | ||
| 68 | struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1]; | ||
| 69 | int last_upload; /* last time texture was uploaded */ | ||
| 70 | int last_enqueue; /* last time a buffer was enqueued */ | ||
| 71 | int last_dispatch; /* age of the most recently dispatched buffer */ | ||
| 72 | int ctxOwner; /* last context to upload state */ | ||
| 73 | int texAge; | ||
| 74 | int pf_enabled; /* is pageflipping allowed? */ | ||
| 75 | int pf_active; | ||
| 76 | int pf_current_page; /* which buffer is being displayed? */ | ||
| 77 | int perf_boxes; /* performance boxes to be displayed */ | ||
| 78 | int width, height; /* screen size in pixels */ | ||
| 79 | |||
| 80 | drm_handle_t front_handle; | ||
| 81 | int front_offset; | ||
| 82 | int front_size; | ||
| 83 | |||
| 84 | drm_handle_t back_handle; | ||
| 85 | int back_offset; | ||
| 86 | int back_size; | ||
| 87 | |||
| 88 | drm_handle_t depth_handle; | ||
| 89 | int depth_offset; | ||
| 90 | int depth_size; | ||
| 91 | |||
| 92 | drm_handle_t tex_handle; | ||
| 93 | int tex_offset; | ||
| 94 | int tex_size; | ||
| 95 | int log_tex_granularity; | ||
| 96 | int pitch; | ||
| 97 | int rotation; /* 0, 90, 180 or 270 */ | ||
| 98 | int rotated_offset; | ||
| 99 | int rotated_size; | ||
| 100 | int rotated_pitch; | ||
| 101 | int virtualX, virtualY; | ||
| 102 | |||
| 103 | unsigned int front_tiled; | ||
| 104 | unsigned int back_tiled; | ||
| 105 | unsigned int depth_tiled; | ||
| 106 | unsigned int rotated_tiled; | ||
| 107 | unsigned int rotated2_tiled; | ||
| 108 | |||
| 109 | int pipeA_x; | ||
| 110 | int pipeA_y; | ||
| 111 | int pipeA_w; | ||
| 112 | int pipeA_h; | ||
| 113 | int pipeB_x; | ||
| 114 | int pipeB_y; | ||
| 115 | int pipeB_w; | ||
| 116 | int pipeB_h; | ||
| 117 | |||
| 118 | /* fill out some space for old userspace triple buffer */ | ||
| 119 | drm_handle_t unused_handle; | ||
| 120 | __u32 unused1, unused2, unused3; | ||
| 121 | |||
| 122 | /* buffer object handles for static buffers. May change | ||
| 123 | * over the lifetime of the client. | ||
| 124 | */ | ||
| 125 | __u32 front_bo_handle; | ||
| 126 | __u32 back_bo_handle; | ||
| 127 | __u32 unused_bo_handle; | ||
| 128 | __u32 depth_bo_handle; | ||
| 129 | |||
| 130 | } drm_i915_sarea_t; | ||
| 131 | |||
| 132 | /* due to userspace building against these headers we need some compat here */ | ||
| 133 | #define planeA_x pipeA_x | ||
| 134 | #define planeA_y pipeA_y | ||
| 135 | #define planeA_w pipeA_w | ||
| 136 | #define planeA_h pipeA_h | ||
| 137 | #define planeB_x pipeB_x | ||
| 138 | #define planeB_y pipeB_y | ||
| 139 | #define planeB_w pipeB_w | ||
| 140 | #define planeB_h pipeB_h | ||
| 141 | |||
| 142 | /* Flags for perf_boxes | ||
| 143 | */ | ||
| 144 | #define I915_BOX_RING_EMPTY 0x1 | ||
| 145 | #define I915_BOX_FLIP 0x2 | ||
| 146 | #define I915_BOX_WAIT 0x4 | ||
| 147 | #define I915_BOX_TEXTURE_LOAD 0x8 | ||
| 148 | #define I915_BOX_LOST_CONTEXT 0x10 | ||
| 149 | |||
| 150 | /* I915 specific ioctls | ||
| 151 | * The device specific ioctl range is 0x40 to 0x79. | ||
| 152 | */ | ||
| 153 | #define DRM_I915_INIT 0x00 | ||
| 154 | #define DRM_I915_FLUSH 0x01 | ||
| 155 | #define DRM_I915_FLIP 0x02 | ||
| 156 | #define DRM_I915_BATCHBUFFER 0x03 | ||
| 157 | #define DRM_I915_IRQ_EMIT 0x04 | ||
| 158 | #define DRM_I915_IRQ_WAIT 0x05 | ||
| 159 | #define DRM_I915_GETPARAM 0x06 | ||
| 160 | #define DRM_I915_SETPARAM 0x07 | ||
| 161 | #define DRM_I915_ALLOC 0x08 | ||
| 162 | #define DRM_I915_FREE 0x09 | ||
| 163 | #define DRM_I915_INIT_HEAP 0x0a | ||
| 164 | #define DRM_I915_CMDBUFFER 0x0b | ||
| 165 | #define DRM_I915_DESTROY_HEAP 0x0c | ||
| 166 | #define DRM_I915_SET_VBLANK_PIPE 0x0d | ||
| 167 | #define DRM_I915_GET_VBLANK_PIPE 0x0e | ||
| 168 | #define DRM_I915_VBLANK_SWAP 0x0f | ||
| 169 | #define DRM_I915_HWS_ADDR 0x11 | ||
| 170 | #define DRM_I915_GEM_INIT 0x13 | ||
| 171 | #define DRM_I915_GEM_EXECBUFFER 0x14 | ||
| 172 | #define DRM_I915_GEM_PIN 0x15 | ||
| 173 | #define DRM_I915_GEM_UNPIN 0x16 | ||
| 174 | #define DRM_I915_GEM_BUSY 0x17 | ||
| 175 | #define DRM_I915_GEM_THROTTLE 0x18 | ||
| 176 | #define DRM_I915_GEM_ENTERVT 0x19 | ||
| 177 | #define DRM_I915_GEM_LEAVEVT 0x1a | ||
| 178 | #define DRM_I915_GEM_CREATE 0x1b | ||
| 179 | #define DRM_I915_GEM_PREAD 0x1c | ||
| 180 | #define DRM_I915_GEM_PWRITE 0x1d | ||
| 181 | #define DRM_I915_GEM_MMAP 0x1e | ||
| 182 | #define DRM_I915_GEM_SET_DOMAIN 0x1f | ||
| 183 | #define DRM_I915_GEM_SW_FINISH 0x20 | ||
| 184 | #define DRM_I915_GEM_SET_TILING 0x21 | ||
| 185 | #define DRM_I915_GEM_GET_TILING 0x22 | ||
| 186 | #define DRM_I915_GEM_GET_APERTURE 0x23 | ||
| 187 | #define DRM_I915_GEM_MMAP_GTT 0x24 | ||
| 188 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 | ||
| 189 | #define DRM_I915_GEM_MADVISE 0x26 | ||
| 190 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 | ||
| 191 | #define DRM_I915_OVERLAY_ATTRS 0x28 | ||
| 192 | #define DRM_I915_GEM_EXECBUFFER2 0x29 | ||
| 193 | #define DRM_I915_GET_SPRITE_COLORKEY 0x2a | ||
| 194 | #define DRM_I915_SET_SPRITE_COLORKEY 0x2b | ||
| 195 | #define DRM_I915_GEM_WAIT 0x2c | ||
| 196 | #define DRM_I915_GEM_CONTEXT_CREATE 0x2d | ||
| 197 | #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e | ||
| 198 | #define DRM_I915_GEM_SET_CACHING 0x2f | ||
| 199 | #define DRM_I915_GEM_GET_CACHING 0x30 | ||
| 200 | #define DRM_I915_REG_READ 0x31 | ||
| 201 | |||
| 202 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | ||
| 203 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | ||
| 204 | #define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) | ||
| 205 | #define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) | ||
| 206 | #define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) | ||
| 207 | #define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) | ||
| 208 | #define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) | ||
| 209 | #define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) | ||
| 210 | #define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) | ||
| 211 | #define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) | ||
| 212 | #define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) | ||
| 213 | #define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) | ||
| 214 | #define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) | ||
| 215 | #define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) | ||
| 216 | #define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) | ||
| 217 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) | ||
| 218 | #define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init) | ||
| 219 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) | ||
| 220 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) | ||
| 221 | #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) | ||
| 222 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) | ||
| 223 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) | ||
| 224 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) | ||
| 225 | #define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching) | ||
| 226 | #define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching) | ||
| 227 | #define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE) | ||
| 228 | #define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT) | ||
| 229 | #define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT) | ||
| 230 | #define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create) | ||
| 231 | #define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread) | ||
| 232 | #define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite) | ||
| 233 | #define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap) | ||
| 234 | #define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt) | ||
| 235 | #define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain) | ||
| 236 | #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) | ||
| 237 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) | ||
| 238 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) | ||
| 239 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | ||
| 240 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) | ||
| 241 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) | ||
| 242 | #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) | ||
| 243 | #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) | ||
| 244 | #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) | ||
| 245 | #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) | ||
| 246 | #define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) | ||
| 247 | #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) | ||
| 248 | #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) | ||
| 249 | #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) | ||
| 250 | |||
| 251 | /* Allow drivers to submit batchbuffers directly to hardware, relying | ||
| 252 | * on the security mechanisms provided by hardware. | ||
| 253 | */ | ||
| 254 | typedef struct drm_i915_batchbuffer { | ||
| 255 | int start; /* agp offset */ | ||
| 256 | int used; /* nr bytes in use */ | ||
| 257 | int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ | ||
| 258 | int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ | ||
| 259 | int num_cliprects; /* mulitpass with multiple cliprects? */ | ||
| 260 | struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */ | ||
| 261 | } drm_i915_batchbuffer_t; | ||
| 262 | |||
| 263 | /* As above, but pass a pointer to userspace buffer which can be | ||
| 264 | * validated by the kernel prior to sending to hardware. | ||
| 265 | */ | ||
| 266 | typedef struct _drm_i915_cmdbuffer { | ||
| 267 | char __user *buf; /* pointer to userspace command buffer */ | ||
| 268 | int sz; /* nr bytes in buf */ | ||
| 269 | int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ | ||
| 270 | int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ | ||
| 271 | int num_cliprects; /* mulitpass with multiple cliprects? */ | ||
| 272 | struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */ | ||
| 273 | } drm_i915_cmdbuffer_t; | ||
| 274 | |||
| 275 | /* Userspace can request & wait on irq's: | ||
| 276 | */ | ||
| 277 | typedef struct drm_i915_irq_emit { | ||
| 278 | int __user *irq_seq; | ||
| 279 | } drm_i915_irq_emit_t; | ||
| 280 | |||
| 281 | typedef struct drm_i915_irq_wait { | ||
| 282 | int irq_seq; | ||
| 283 | } drm_i915_irq_wait_t; | ||
| 284 | |||
| 285 | /* Ioctl to query kernel params: | ||
| 286 | */ | ||
| 287 | #define I915_PARAM_IRQ_ACTIVE 1 | ||
| 288 | #define I915_PARAM_ALLOW_BATCHBUFFER 2 | ||
| 289 | #define I915_PARAM_LAST_DISPATCH 3 | ||
| 290 | #define I915_PARAM_CHIPSET_ID 4 | ||
| 291 | #define I915_PARAM_HAS_GEM 5 | ||
| 292 | #define I915_PARAM_NUM_FENCES_AVAIL 6 | ||
| 293 | #define I915_PARAM_HAS_OVERLAY 7 | ||
| 294 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | ||
| 295 | #define I915_PARAM_HAS_EXECBUF2 9 | ||
| 296 | #define I915_PARAM_HAS_BSD 10 | ||
| 297 | #define I915_PARAM_HAS_BLT 11 | ||
| 298 | #define I915_PARAM_HAS_RELAXED_FENCING 12 | ||
| 299 | #define I915_PARAM_HAS_COHERENT_RINGS 13 | ||
| 300 | #define I915_PARAM_HAS_EXEC_CONSTANTS 14 | ||
| 301 | #define I915_PARAM_HAS_RELAXED_DELTA 15 | ||
| 302 | #define I915_PARAM_HAS_GEN7_SOL_RESET 16 | ||
| 303 | #define I915_PARAM_HAS_LLC 17 | ||
| 304 | #define I915_PARAM_HAS_ALIASING_PPGTT 18 | ||
| 305 | #define I915_PARAM_HAS_WAIT_TIMEOUT 19 | ||
| 306 | #define I915_PARAM_HAS_SEMAPHORES 20 | ||
| 307 | #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 | ||
| 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 | ||
| 309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 | ||
| 310 | |||
| 311 | typedef struct drm_i915_getparam { | ||
| 312 | int param; | ||
| 313 | int __user *value; | ||
| 314 | } drm_i915_getparam_t; | ||
| 315 | |||
| 316 | /* Ioctl to set kernel params: | ||
| 317 | */ | ||
| 318 | #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1 | ||
| 319 | #define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2 | ||
| 320 | #define I915_SETPARAM_ALLOW_BATCHBUFFER 3 | ||
| 321 | #define I915_SETPARAM_NUM_USED_FENCES 4 | ||
| 322 | |||
| 323 | typedef struct drm_i915_setparam { | ||
| 324 | int param; | ||
| 325 | int value; | ||
| 326 | } drm_i915_setparam_t; | ||
| 327 | |||
| 328 | /* A memory manager for regions of shared memory: | ||
| 329 | */ | ||
| 330 | #define I915_MEM_REGION_AGP 1 | ||
| 331 | |||
| 332 | typedef struct drm_i915_mem_alloc { | ||
| 333 | int region; | ||
| 334 | int alignment; | ||
| 335 | int size; | ||
| 336 | int __user *region_offset; /* offset from start of fb or agp */ | ||
| 337 | } drm_i915_mem_alloc_t; | ||
| 338 | |||
| 339 | typedef struct drm_i915_mem_free { | ||
| 340 | int region; | ||
| 341 | int region_offset; | ||
| 342 | } drm_i915_mem_free_t; | ||
| 343 | |||
| 344 | typedef struct drm_i915_mem_init_heap { | ||
| 345 | int region; | ||
| 346 | int size; | ||
| 347 | int start; | ||
| 348 | } drm_i915_mem_init_heap_t; | ||
| 349 | |||
| 350 | /* Allow memory manager to be torn down and re-initialized (eg on | ||
| 351 | * rotate): | ||
| 352 | */ | ||
| 353 | typedef struct drm_i915_mem_destroy_heap { | ||
| 354 | int region; | ||
| 355 | } drm_i915_mem_destroy_heap_t; | ||
| 356 | |||
| 357 | /* Allow X server to configure which pipes to monitor for vblank signals | ||
| 358 | */ | ||
| 359 | #define DRM_I915_VBLANK_PIPE_A 1 | ||
| 360 | #define DRM_I915_VBLANK_PIPE_B 2 | ||
| 361 | |||
| 362 | typedef struct drm_i915_vblank_pipe { | ||
| 363 | int pipe; | ||
| 364 | } drm_i915_vblank_pipe_t; | ||
| 365 | |||
| 366 | /* Schedule buffer swap at given vertical blank: | ||
| 367 | */ | ||
| 368 | typedef struct drm_i915_vblank_swap { | ||
| 369 | drm_drawable_t drawable; | ||
| 370 | enum drm_vblank_seq_type seqtype; | ||
| 371 | unsigned int sequence; | ||
| 372 | } drm_i915_vblank_swap_t; | ||
| 373 | |||
| 374 | typedef struct drm_i915_hws_addr { | ||
| 375 | __u64 addr; | ||
| 376 | } drm_i915_hws_addr_t; | ||
| 377 | |||
| 378 | struct drm_i915_gem_init { | ||
| 379 | /** | ||
| 380 | * Beginning offset in the GTT to be managed by the DRM memory | ||
| 381 | * manager. | ||
| 382 | */ | ||
| 383 | __u64 gtt_start; | ||
| 384 | /** | ||
| 385 | * Ending offset in the GTT to be managed by the DRM memory | ||
| 386 | * manager. | ||
| 387 | */ | ||
| 388 | __u64 gtt_end; | ||
| 389 | }; | ||
| 390 | |||
| 391 | struct drm_i915_gem_create { | ||
| 392 | /** | ||
| 393 | * Requested size for the object. | ||
| 394 | * | ||
| 395 | * The (page-aligned) allocated size for the object will be returned. | ||
| 396 | */ | ||
| 397 | __u64 size; | ||
| 398 | /** | ||
| 399 | * Returned handle for the object. | ||
| 400 | * | ||
| 401 | * Object handles are nonzero. | ||
| 402 | */ | ||
| 403 | __u32 handle; | ||
| 404 | __u32 pad; | ||
| 405 | }; | ||
| 406 | |||
| 407 | struct drm_i915_gem_pread { | ||
| 408 | /** Handle for the object being read. */ | ||
| 409 | __u32 handle; | ||
| 410 | __u32 pad; | ||
| 411 | /** Offset into the object to read from */ | ||
| 412 | __u64 offset; | ||
| 413 | /** Length of data to read */ | ||
| 414 | __u64 size; | ||
| 415 | /** | ||
| 416 | * Pointer to write the data into. | ||
| 417 | * | ||
| 418 | * This is a fixed-size type for 32/64 compatibility. | ||
| 419 | */ | ||
| 420 | __u64 data_ptr; | ||
| 421 | }; | ||
| 422 | |||
| 423 | struct drm_i915_gem_pwrite { | ||
| 424 | /** Handle for the object being written to. */ | ||
| 425 | __u32 handle; | ||
| 426 | __u32 pad; | ||
| 427 | /** Offset into the object to write to */ | ||
| 428 | __u64 offset; | ||
| 429 | /** Length of data to write */ | ||
| 430 | __u64 size; | ||
| 431 | /** | ||
| 432 | * Pointer to read the data from. | ||
| 433 | * | ||
| 434 | * This is a fixed-size type for 32/64 compatibility. | ||
| 435 | */ | ||
| 436 | __u64 data_ptr; | ||
| 437 | }; | ||
| 438 | |||
| 439 | struct drm_i915_gem_mmap { | ||
| 440 | /** Handle for the object being mapped. */ | ||
| 441 | __u32 handle; | ||
| 442 | __u32 pad; | ||
| 443 | /** Offset in the object to map. */ | ||
| 444 | __u64 offset; | ||
| 445 | /** | ||
| 446 | * Length of data to map. | ||
| 447 | * | ||
| 448 | * The value will be page-aligned. | ||
| 449 | */ | ||
| 450 | __u64 size; | ||
| 451 | /** | ||
| 452 | * Returned pointer the data was mapped at. | ||
| 453 | * | ||
| 454 | * This is a fixed-size type for 32/64 compatibility. | ||
| 455 | */ | ||
| 456 | __u64 addr_ptr; | ||
| 457 | }; | ||
| 458 | |||
| 459 | struct drm_i915_gem_mmap_gtt { | ||
| 460 | /** Handle for the object being mapped. */ | ||
| 461 | __u32 handle; | ||
| 462 | __u32 pad; | ||
| 463 | /** | ||
| 464 | * Fake offset to use for subsequent mmap call | ||
| 465 | * | ||
| 466 | * This is a fixed-size type for 32/64 compatibility. | ||
| 467 | */ | ||
| 468 | __u64 offset; | ||
| 469 | }; | ||
| 470 | |||
| 471 | struct drm_i915_gem_set_domain { | ||
| 472 | /** Handle for the object */ | ||
| 473 | __u32 handle; | ||
| 474 | |||
| 475 | /** New read domains */ | ||
| 476 | __u32 read_domains; | ||
| 477 | |||
| 478 | /** New write domain */ | ||
| 479 | __u32 write_domain; | ||
| 480 | }; | ||
| 481 | |||
| 482 | struct drm_i915_gem_sw_finish { | ||
| 483 | /** Handle for the object */ | ||
| 484 | __u32 handle; | ||
| 485 | }; | ||
| 486 | |||
| 487 | struct drm_i915_gem_relocation_entry { | ||
| 488 | /** | ||
| 489 | * Handle of the buffer being pointed to by this relocation entry. | ||
| 490 | * | ||
| 491 | * It's appealing to make this be an index into the mm_validate_entry | ||
| 492 | * list to refer to the buffer, but this allows the driver to create | ||
| 493 | * a relocation list for state buffers and not re-write it per | ||
| 494 | * exec using the buffer. | ||
| 495 | */ | ||
| 496 | __u32 target_handle; | ||
| 497 | |||
| 498 | /** | ||
| 499 | * Value to be added to the offset of the target buffer to make up | ||
| 500 | * the relocation entry. | ||
| 501 | */ | ||
| 502 | __u32 delta; | ||
| 503 | |||
| 504 | /** Offset in the buffer the relocation entry will be written into */ | ||
| 505 | __u64 offset; | ||
| 506 | |||
| 507 | /** | ||
| 508 | * Offset value of the target buffer that the relocation entry was last | ||
| 509 | * written as. | ||
| 510 | * | ||
| 511 | * If the buffer has the same offset as last time, we can skip syncing | ||
| 512 | * and writing the relocation. This value is written back out by | ||
| 513 | * the execbuffer ioctl when the relocation is written. | ||
| 514 | */ | ||
| 515 | __u64 presumed_offset; | ||
| 516 | |||
| 517 | /** | ||
| 518 | * Target memory domains read by this operation. | ||
| 519 | */ | ||
| 520 | __u32 read_domains; | ||
| 521 | |||
| 522 | /** | ||
| 523 | * Target memory domains written by this operation. | ||
| 524 | * | ||
| 525 | * Note that only one domain may be written by the whole | ||
| 526 | * execbuffer operation, so that where there are conflicts, | ||
| 527 | * the application will get -EINVAL back. | ||
| 528 | */ | ||
| 529 | __u32 write_domain; | ||
| 530 | }; | ||
| 531 | |||
| 532 | /** @{ | ||
| 533 | * Intel memory domains | ||
| 534 | * | ||
| 535 | * Most of these just align with the various caches in | ||
| 536 | * the system and are used to flush and invalidate as | ||
| 537 | * objects end up cached in different domains. | ||
| 538 | */ | ||
| 539 | /** CPU cache */ | ||
| 540 | #define I915_GEM_DOMAIN_CPU 0x00000001 | ||
| 541 | /** Render cache, used by 2D and 3D drawing */ | ||
| 542 | #define I915_GEM_DOMAIN_RENDER 0x00000002 | ||
| 543 | /** Sampler cache, used by texture engine */ | ||
| 544 | #define I915_GEM_DOMAIN_SAMPLER 0x00000004 | ||
| 545 | /** Command queue, used to load batch buffers */ | ||
| 546 | #define I915_GEM_DOMAIN_COMMAND 0x00000008 | ||
| 547 | /** Instruction cache, used by shader programs */ | ||
| 548 | #define I915_GEM_DOMAIN_INSTRUCTION 0x00000010 | ||
| 549 | /** Vertex address cache */ | ||
| 550 | #define I915_GEM_DOMAIN_VERTEX 0x00000020 | ||
| 551 | /** GTT domain - aperture and scanout */ | ||
| 552 | #define I915_GEM_DOMAIN_GTT 0x00000040 | ||
| 553 | /** @} */ | ||
| 554 | |||
| 555 | struct drm_i915_gem_exec_object { | ||
| 556 | /** | ||
| 557 | * User's handle for a buffer to be bound into the GTT for this | ||
| 558 | * operation. | ||
| 559 | */ | ||
| 560 | __u32 handle; | ||
| 561 | |||
| 562 | /** Number of relocations to be performed on this buffer */ | ||
| 563 | __u32 relocation_count; | ||
| 564 | /** | ||
| 565 | * Pointer to array of struct drm_i915_gem_relocation_entry containing | ||
| 566 | * the relocations to be performed in this buffer. | ||
| 567 | */ | ||
| 568 | __u64 relocs_ptr; | ||
| 569 | |||
| 570 | /** Required alignment in graphics aperture */ | ||
| 571 | __u64 alignment; | ||
| 572 | |||
| 573 | /** | ||
| 574 | * Returned value of the updated offset of the object, for future | ||
| 575 | * presumed_offset writes. | ||
| 576 | */ | ||
| 577 | __u64 offset; | ||
| 578 | }; | ||
| 579 | |||
| 580 | struct drm_i915_gem_execbuffer { | ||
| 581 | /** | ||
| 582 | * List of buffers to be validated with their relocations to be | ||
| 583 | * performend on them. | ||
| 584 | * | ||
| 585 | * This is a pointer to an array of struct drm_i915_gem_validate_entry. | ||
| 586 | * | ||
| 587 | * These buffers must be listed in an order such that all relocations | ||
| 588 | * a buffer is performing refer to buffers that have already appeared | ||
| 589 | * in the validate list. | ||
| 590 | */ | ||
| 591 | __u64 buffers_ptr; | ||
| 592 | __u32 buffer_count; | ||
| 593 | |||
| 594 | /** Offset in the batchbuffer to start execution from. */ | ||
| 595 | __u32 batch_start_offset; | ||
| 596 | /** Bytes used in batchbuffer from batch_start_offset */ | ||
| 597 | __u32 batch_len; | ||
| 598 | __u32 DR1; | ||
| 599 | __u32 DR4; | ||
| 600 | __u32 num_cliprects; | ||
| 601 | /** This is a struct drm_clip_rect *cliprects */ | ||
| 602 | __u64 cliprects_ptr; | ||
| 603 | }; | ||
| 604 | |||
| 605 | struct drm_i915_gem_exec_object2 { | ||
| 606 | /** | ||
| 607 | * User's handle for a buffer to be bound into the GTT for this | ||
| 608 | * operation. | ||
| 609 | */ | ||
| 610 | __u32 handle; | ||
| 611 | |||
| 612 | /** Number of relocations to be performed on this buffer */ | ||
| 613 | __u32 relocation_count; | ||
| 614 | /** | ||
| 615 | * Pointer to array of struct drm_i915_gem_relocation_entry containing | ||
| 616 | * the relocations to be performed in this buffer. | ||
| 617 | */ | ||
| 618 | __u64 relocs_ptr; | ||
| 619 | |||
| 620 | /** Required alignment in graphics aperture */ | ||
| 621 | __u64 alignment; | ||
| 622 | |||
| 623 | /** | ||
| 624 | * Returned value of the updated offset of the object, for future | ||
| 625 | * presumed_offset writes. | ||
| 626 | */ | ||
| 627 | __u64 offset; | ||
| 628 | |||
| 629 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | ||
| 630 | __u64 flags; | ||
| 631 | __u64 rsvd1; | ||
| 632 | __u64 rsvd2; | ||
| 633 | }; | ||
| 634 | |||
| 635 | struct drm_i915_gem_execbuffer2 { | ||
| 636 | /** | ||
| 637 | * List of gem_exec_object2 structs | ||
| 638 | */ | ||
| 639 | __u64 buffers_ptr; | ||
| 640 | __u32 buffer_count; | ||
| 641 | |||
| 642 | /** Offset in the batchbuffer to start execution from. */ | ||
| 643 | __u32 batch_start_offset; | ||
| 644 | /** Bytes used in batchbuffer from batch_start_offset */ | ||
| 645 | __u32 batch_len; | ||
| 646 | __u32 DR1; | ||
| 647 | __u32 DR4; | ||
| 648 | __u32 num_cliprects; | ||
| 649 | /** This is a struct drm_clip_rect *cliprects */ | ||
| 650 | __u64 cliprects_ptr; | ||
| 651 | #define I915_EXEC_RING_MASK (7<<0) | ||
| 652 | #define I915_EXEC_DEFAULT (0<<0) | ||
| 653 | #define I915_EXEC_RENDER (1<<0) | ||
| 654 | #define I915_EXEC_BSD (2<<0) | ||
| 655 | #define I915_EXEC_BLT (3<<0) | ||
| 656 | |||
| 657 | /* Used for switching the constants addressing mode on gen4+ RENDER ring. | ||
| 658 | * Gen6+ only supports relative addressing to dynamic state (default) and | ||
| 659 | * absolute addressing. | ||
| 660 | * | ||
| 661 | * These flags are ignored for the BSD and BLT rings. | ||
| 662 | */ | ||
| 663 | #define I915_EXEC_CONSTANTS_MASK (3<<6) | ||
| 664 | #define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */ | ||
| 665 | #define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) | ||
| 666 | #define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */ | ||
| 667 | __u64 flags; | ||
| 668 | __u64 rsvd1; /* now used for context info */ | ||
| 669 | __u64 rsvd2; | ||
| 670 | }; | ||
| 671 | |||
| 672 | /** Resets the SO write offset registers for transform feedback on gen7. */ | ||
| 673 | #define I915_EXEC_GEN7_SOL_RESET (1<<8) | ||
| 674 | |||
| 675 | /** Request a privileged ("secure") batch buffer. Note only available for | ||
| 676 | * DRM_ROOT_ONLY | DRM_MASTER processes. | ||
| 677 | */ | ||
| 678 | #define I915_EXEC_SECURE (1<<9) | ||
| 679 | |||
| 680 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | ||
| 681 | #define i915_execbuffer2_set_context_id(eb2, context) \ | ||
| 682 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK | ||
| 683 | #define i915_execbuffer2_get_context_id(eb2) \ | ||
| 684 | ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) | ||
| 685 | |||
| 686 | struct drm_i915_gem_pin { | ||
| 687 | /** Handle of the buffer to be pinned. */ | ||
| 688 | __u32 handle; | ||
| 689 | __u32 pad; | ||
| 690 | |||
| 691 | /** alignment required within the aperture */ | ||
| 692 | __u64 alignment; | ||
| 693 | |||
| 694 | /** Returned GTT offset of the buffer. */ | ||
| 695 | __u64 offset; | ||
| 696 | }; | ||
| 697 | |||
| 698 | struct drm_i915_gem_unpin { | ||
| 699 | /** Handle of the buffer to be unpinned. */ | ||
| 700 | __u32 handle; | ||
| 701 | __u32 pad; | ||
| 702 | }; | ||
| 703 | |||
| 704 | struct drm_i915_gem_busy { | ||
| 705 | /** Handle of the buffer to check for busy */ | ||
| 706 | __u32 handle; | ||
| 707 | |||
| 708 | /** Return busy status (1 if busy, 0 if idle). | ||
| 709 | * The high word is used to indicate on which rings the object | ||
| 710 | * currently resides: | ||
| 711 | * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) | ||
| 712 | */ | ||
| 713 | __u32 busy; | ||
| 714 | }; | ||
| 715 | |||
| 716 | #define I915_CACHING_NONE 0 | ||
| 717 | #define I915_CACHING_CACHED 1 | ||
| 718 | |||
| 719 | struct drm_i915_gem_caching { | ||
| 720 | /** | ||
| 721 | * Handle of the buffer to set/get the caching level of. */ | ||
| 722 | __u32 handle; | ||
| 723 | |||
| 724 | /** | ||
| 725 | * Cacheing level to apply or return value | ||
| 726 | * | ||
| 727 | * bits0-15 are for generic caching control (i.e. the above defined | ||
| 728 | * values). bits16-31 are reserved for platform-specific variations | ||
| 729 | * (e.g. l3$ caching on gen7). */ | ||
| 730 | __u32 caching; | ||
| 731 | }; | ||
| 732 | |||
| 733 | #define I915_TILING_NONE 0 | ||
| 734 | #define I915_TILING_X 1 | ||
| 735 | #define I915_TILING_Y 2 | ||
| 736 | |||
| 737 | #define I915_BIT_6_SWIZZLE_NONE 0 | ||
| 738 | #define I915_BIT_6_SWIZZLE_9 1 | ||
| 739 | #define I915_BIT_6_SWIZZLE_9_10 2 | ||
| 740 | #define I915_BIT_6_SWIZZLE_9_11 3 | ||
| 741 | #define I915_BIT_6_SWIZZLE_9_10_11 4 | ||
| 742 | /* Not seen by userland */ | ||
| 743 | #define I915_BIT_6_SWIZZLE_UNKNOWN 5 | ||
| 744 | /* Seen by userland. */ | ||
| 745 | #define I915_BIT_6_SWIZZLE_9_17 6 | ||
| 746 | #define I915_BIT_6_SWIZZLE_9_10_17 7 | ||
| 747 | |||
| 748 | struct drm_i915_gem_set_tiling { | ||
| 749 | /** Handle of the buffer to have its tiling state updated */ | ||
| 750 | __u32 handle; | ||
| 751 | |||
| 752 | /** | ||
| 753 | * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X, | ||
| 754 | * I915_TILING_Y). | ||
| 755 | * | ||
| 756 | * This value is to be set on request, and will be updated by the | ||
| 757 | * kernel on successful return with the actual chosen tiling layout. | ||
| 758 | * | ||
| 759 | * The tiling mode may be demoted to I915_TILING_NONE when the system | ||
| 760 | * has bit 6 swizzling that can't be managed correctly by GEM. | ||
| 761 | * | ||
| 762 | * Buffer contents become undefined when changing tiling_mode. | ||
| 763 | */ | ||
| 764 | __u32 tiling_mode; | ||
| 765 | |||
| 766 | /** | ||
| 767 | * Stride in bytes for the object when in I915_TILING_X or | ||
| 768 | * I915_TILING_Y. | ||
| 769 | */ | ||
| 770 | __u32 stride; | ||
| 771 | |||
| 772 | /** | ||
| 773 | * Returned address bit 6 swizzling required for CPU access through | ||
| 774 | * mmap mapping. | ||
| 775 | */ | ||
| 776 | __u32 swizzle_mode; | ||
| 777 | }; | ||
| 778 | |||
| 779 | struct drm_i915_gem_get_tiling { | ||
| 780 | /** Handle of the buffer to get tiling state for. */ | ||
| 781 | __u32 handle; | ||
| 782 | |||
| 783 | /** | ||
| 784 | * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X, | ||
| 785 | * I915_TILING_Y). | ||
| 786 | */ | ||
| 787 | __u32 tiling_mode; | ||
| 788 | |||
| 789 | /** | ||
| 790 | * Returned address bit 6 swizzling required for CPU access through | ||
| 791 | * mmap mapping. | ||
| 792 | */ | ||
| 793 | __u32 swizzle_mode; | ||
| 794 | }; | ||
| 795 | |||
| 796 | struct drm_i915_gem_get_aperture { | ||
| 797 | /** Total size of the aperture used by i915_gem_execbuffer, in bytes */ | ||
| 798 | __u64 aper_size; | ||
| 799 | |||
| 800 | /** | ||
| 801 | * Available space in the aperture used by i915_gem_execbuffer, in | ||
| 802 | * bytes | ||
| 803 | */ | ||
| 804 | __u64 aper_available_size; | ||
| 805 | }; | ||
| 806 | |||
| 807 | struct drm_i915_get_pipe_from_crtc_id { | ||
| 808 | /** ID of CRTC being requested **/ | ||
| 809 | __u32 crtc_id; | ||
| 810 | |||
| 811 | /** pipe of requested CRTC **/ | ||
| 812 | __u32 pipe; | ||
| 813 | }; | ||
| 814 | |||
| 815 | #define I915_MADV_WILLNEED 0 | ||
| 816 | #define I915_MADV_DONTNEED 1 | ||
| 817 | #define __I915_MADV_PURGED 2 /* internal state */ | ||
| 818 | |||
| 819 | struct drm_i915_gem_madvise { | ||
| 820 | /** Handle of the buffer to change the backing store advice */ | ||
| 821 | __u32 handle; | ||
| 822 | |||
| 823 | /* Advice: either the buffer will be needed again in the near future, | ||
| 824 | * or wont be and could be discarded under memory pressure. | ||
| 825 | */ | ||
| 826 | __u32 madv; | ||
| 827 | |||
| 828 | /** Whether the backing store still exists. */ | ||
| 829 | __u32 retained; | ||
| 830 | }; | ||
| 831 | |||
| 832 | /* flags */ | ||
| 833 | #define I915_OVERLAY_TYPE_MASK 0xff | ||
| 834 | #define I915_OVERLAY_YUV_PLANAR 0x01 | ||
| 835 | #define I915_OVERLAY_YUV_PACKED 0x02 | ||
| 836 | #define I915_OVERLAY_RGB 0x03 | ||
| 837 | |||
| 838 | #define I915_OVERLAY_DEPTH_MASK 0xff00 | ||
| 839 | #define I915_OVERLAY_RGB24 0x1000 | ||
| 840 | #define I915_OVERLAY_RGB16 0x2000 | ||
| 841 | #define I915_OVERLAY_RGB15 0x3000 | ||
| 842 | #define I915_OVERLAY_YUV422 0x0100 | ||
| 843 | #define I915_OVERLAY_YUV411 0x0200 | ||
| 844 | #define I915_OVERLAY_YUV420 0x0300 | ||
| 845 | #define I915_OVERLAY_YUV410 0x0400 | ||
| 846 | |||
| 847 | #define I915_OVERLAY_SWAP_MASK 0xff0000 | ||
| 848 | #define I915_OVERLAY_NO_SWAP 0x000000 | ||
| 849 | #define I915_OVERLAY_UV_SWAP 0x010000 | ||
| 850 | #define I915_OVERLAY_Y_SWAP 0x020000 | ||
| 851 | #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000 | ||
| 852 | |||
| 853 | #define I915_OVERLAY_FLAGS_MASK 0xff000000 | ||
| 854 | #define I915_OVERLAY_ENABLE 0x01000000 | ||
| 855 | |||
| 856 | struct drm_intel_overlay_put_image { | ||
| 857 | /* various flags and src format description */ | ||
| 858 | __u32 flags; | ||
| 859 | /* source picture description */ | ||
| 860 | __u32 bo_handle; | ||
| 861 | /* stride values and offsets are in bytes, buffer relative */ | ||
| 862 | __u16 stride_Y; /* stride for packed formats */ | ||
| 863 | __u16 stride_UV; | ||
| 864 | __u32 offset_Y; /* offset for packet formats */ | ||
| 865 | __u32 offset_U; | ||
| 866 | __u32 offset_V; | ||
| 867 | /* in pixels */ | ||
| 868 | __u16 src_width; | ||
| 869 | __u16 src_height; | ||
| 870 | /* to compensate the scaling factors for partially covered surfaces */ | ||
| 871 | __u16 src_scan_width; | ||
| 872 | __u16 src_scan_height; | ||
| 873 | /* output crtc description */ | ||
| 874 | __u32 crtc_id; | ||
| 875 | __u16 dst_x; | ||
| 876 | __u16 dst_y; | ||
| 877 | __u16 dst_width; | ||
| 878 | __u16 dst_height; | ||
| 879 | }; | ||
| 880 | |||
| 881 | /* flags */ | ||
| 882 | #define I915_OVERLAY_UPDATE_ATTRS (1<<0) | ||
| 883 | #define I915_OVERLAY_UPDATE_GAMMA (1<<1) | ||
| 884 | struct drm_intel_overlay_attrs { | ||
| 885 | __u32 flags; | ||
| 886 | __u32 color_key; | ||
| 887 | __s32 brightness; | ||
| 888 | __u32 contrast; | ||
| 889 | __u32 saturation; | ||
| 890 | __u32 gamma0; | ||
| 891 | __u32 gamma1; | ||
| 892 | __u32 gamma2; | ||
| 893 | __u32 gamma3; | ||
| 894 | __u32 gamma4; | ||
| 895 | __u32 gamma5; | ||
| 896 | }; | ||
| 897 | |||
| 898 | /* | ||
| 899 | * Intel sprite handling | ||
| 900 | * | ||
| 901 | * Color keying works with a min/mask/max tuple. Both source and destination | ||
| 902 | * color keying is allowed. | ||
| 903 | * | ||
| 904 | * Source keying: | ||
| 905 | * Sprite pixels within the min & max values, masked against the color channels | ||
| 906 | * specified in the mask field, will be transparent. All other pixels will | ||
| 907 | * be displayed on top of the primary plane. For RGB surfaces, only the min | ||
| 908 | * and mask fields will be used; ranged compares are not allowed. | ||
| 909 | * | ||
| 910 | * Destination keying: | ||
| 911 | * Primary plane pixels that match the min value, masked against the color | ||
| 912 | * channels specified in the mask field, will be replaced by corresponding | ||
| 913 | * pixels from the sprite plane. | ||
| 914 | * | ||
| 915 | * Note that source & destination keying are exclusive; only one can be | ||
| 916 | * active on a given plane. | ||
| 917 | */ | ||
| 918 | |||
| 919 | #define I915_SET_COLORKEY_NONE (1<<0) /* disable color key matching */ | ||
| 920 | #define I915_SET_COLORKEY_DESTINATION (1<<1) | ||
| 921 | #define I915_SET_COLORKEY_SOURCE (1<<2) | ||
| 922 | struct drm_intel_sprite_colorkey { | ||
| 923 | __u32 plane_id; | ||
| 924 | __u32 min_value; | ||
| 925 | __u32 channel_mask; | ||
| 926 | __u32 max_value; | ||
| 927 | __u32 flags; | ||
| 928 | }; | ||
| 929 | |||
| 930 | struct drm_i915_gem_wait { | ||
| 931 | /** Handle of BO we shall wait on */ | ||
| 932 | __u32 bo_handle; | ||
| 933 | __u32 flags; | ||
| 934 | /** Number of nanoseconds to wait, Returns time remaining. */ | ||
| 935 | __s64 timeout_ns; | ||
| 936 | }; | ||
| 937 | |||
| 938 | struct drm_i915_gem_context_create { | ||
| 939 | /* output: id of new context*/ | ||
| 940 | __u32 ctx_id; | ||
| 941 | __u32 pad; | ||
| 942 | }; | ||
| 943 | |||
| 944 | struct drm_i915_gem_context_destroy { | ||
| 945 | __u32 ctx_id; | ||
| 946 | __u32 pad; | ||
| 947 | }; | ||
| 948 | |||
| 949 | struct drm_i915_reg_read { | ||
| 950 | __u64 offset; | ||
| 951 | __u64 val; /* Return value */ | ||
| 952 | }; | ||
| 953 | #endif /* _UAPI_I915_DRM_H_ */ | ||
| @@ -0,0 +1,419 @@ | |||
| 1 | /* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*- | ||
| 2 | * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com | ||
| 3 | * | ||
| 4 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | ||
| 5 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 9 | * copy of this software and associated documentation files (the "Software"), | ||
| 10 | * to deal in the Software without restriction, including without limitation | ||
| 11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 12 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 13 | * Software is furnished to do so, subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice (including the next | ||
| 16 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 17 | * Software. | ||
| 18 | * | ||
| 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 22 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 23 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 24 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 25 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 26 | * | ||
| 27 | * Authors: | ||
| 28 | * Jeff Hartmann <jhartmann@valinux.com> | ||
| 29 | * Keith Whitwell <keith@tungstengraphics.com> | ||
| 30 | * | ||
| 31 | * Rewritten by: | ||
| 32 | * Gareth Hughes <gareth@valinux.com> | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef __MGA_DRM_H__ | ||
| 36 | #define __MGA_DRM_H__ | ||
| 37 | |||
| 38 | #include <drm/drm.h> | ||
| 39 | |||
| 40 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 41 | * defines in the Xserver file (mga_sarea.h) | ||
| 42 | */ | ||
| 43 | |||
| 44 | #ifndef __MGA_SAREA_DEFINES__ | ||
| 45 | #define __MGA_SAREA_DEFINES__ | ||
| 46 | |||
| 47 | /* WARP pipe flags | ||
| 48 | */ | ||
| 49 | #define MGA_F 0x1 /* fog */ | ||
| 50 | #define MGA_A 0x2 /* alpha */ | ||
| 51 | #define MGA_S 0x4 /* specular */ | ||
| 52 | #define MGA_T2 0x8 /* multitexture */ | ||
| 53 | |||
| 54 | #define MGA_WARP_TGZ 0 | ||
| 55 | #define MGA_WARP_TGZF (MGA_F) | ||
| 56 | #define MGA_WARP_TGZA (MGA_A) | ||
| 57 | #define MGA_WARP_TGZAF (MGA_F|MGA_A) | ||
| 58 | #define MGA_WARP_TGZS (MGA_S) | ||
| 59 | #define MGA_WARP_TGZSF (MGA_S|MGA_F) | ||
| 60 | #define MGA_WARP_TGZSA (MGA_S|MGA_A) | ||
| 61 | #define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A) | ||
| 62 | #define MGA_WARP_T2GZ (MGA_T2) | ||
| 63 | #define MGA_WARP_T2GZF (MGA_T2|MGA_F) | ||
| 64 | #define MGA_WARP_T2GZA (MGA_T2|MGA_A) | ||
| 65 | #define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F) | ||
| 66 | #define MGA_WARP_T2GZS (MGA_T2|MGA_S) | ||
| 67 | #define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F) | ||
| 68 | #define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A) | ||
| 69 | #define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A) | ||
| 70 | |||
| 71 | #define MGA_MAX_G200_PIPES 8 /* no multitex */ | ||
| 72 | #define MGA_MAX_G400_PIPES 16 | ||
| 73 | #define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES | ||
| 74 | #define MGA_WARP_UCODE_SIZE 32768 /* in bytes */ | ||
| 75 | |||
| 76 | #define MGA_CARD_TYPE_G200 1 | ||
| 77 | #define MGA_CARD_TYPE_G400 2 | ||
| 78 | #define MGA_CARD_TYPE_G450 3 /* not currently used */ | ||
| 79 | #define MGA_CARD_TYPE_G550 4 | ||
| 80 | |||
| 81 | #define MGA_FRONT 0x1 | ||
| 82 | #define MGA_BACK 0x2 | ||
| 83 | #define MGA_DEPTH 0x4 | ||
| 84 | |||
| 85 | /* What needs to be changed for the current vertex dma buffer? | ||
| 86 | */ | ||
| 87 | #define MGA_UPLOAD_CONTEXT 0x1 | ||
| 88 | #define MGA_UPLOAD_TEX0 0x2 | ||
| 89 | #define MGA_UPLOAD_TEX1 0x4 | ||
| 90 | #define MGA_UPLOAD_PIPE 0x8 | ||
| 91 | #define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */ | ||
| 92 | #define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */ | ||
| 93 | #define MGA_UPLOAD_2D 0x40 | ||
| 94 | #define MGA_WAIT_AGE 0x80 /* handled client-side */ | ||
| 95 | #define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */ | ||
| 96 | #if 0 | ||
| 97 | #define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock | ||
| 98 | quiescent */ | ||
| 99 | #endif | ||
| 100 | |||
| 101 | /* 32 buffers of 64k each, total 2 meg. | ||
| 102 | */ | ||
| 103 | #define MGA_BUFFER_SIZE (1 << 16) | ||
| 104 | #define MGA_NUM_BUFFERS 128 | ||
| 105 | |||
| 106 | /* Keep these small for testing. | ||
| 107 | */ | ||
| 108 | #define MGA_NR_SAREA_CLIPRECTS 8 | ||
| 109 | |||
| 110 | /* 2 heaps (1 for card, 1 for agp), each divided into up to 128 | ||
| 111 | * regions, subject to a minimum region size of (1<<16) == 64k. | ||
| 112 | * | ||
| 113 | * Clients may subdivide regions internally, but when sharing between | ||
| 114 | * clients, the region size is the minimum granularity. | ||
| 115 | */ | ||
| 116 | |||
| 117 | #define MGA_CARD_HEAP 0 | ||
| 118 | #define MGA_AGP_HEAP 1 | ||
| 119 | #define MGA_NR_TEX_HEAPS 2 | ||
| 120 | #define MGA_NR_TEX_REGIONS 16 | ||
| 121 | #define MGA_LOG_MIN_TEX_REGION_SIZE 16 | ||
| 122 | |||
| 123 | #define DRM_MGA_IDLE_RETRY 2048 | ||
| 124 | |||
| 125 | #endif /* __MGA_SAREA_DEFINES__ */ | ||
| 126 | |||
| 127 | /* Setup registers for 3D context | ||
| 128 | */ | ||
| 129 | typedef struct { | ||
| 130 | unsigned int dstorg; | ||
| 131 | unsigned int maccess; | ||
| 132 | unsigned int plnwt; | ||
| 133 | unsigned int dwgctl; | ||
| 134 | unsigned int alphactrl; | ||
| 135 | unsigned int fogcolor; | ||
| 136 | unsigned int wflag; | ||
| 137 | unsigned int tdualstage0; | ||
| 138 | unsigned int tdualstage1; | ||
| 139 | unsigned int fcol; | ||
| 140 | unsigned int stencil; | ||
| 141 | unsigned int stencilctl; | ||
| 142 | } drm_mga_context_regs_t; | ||
| 143 | |||
| 144 | /* Setup registers for 2D, X server | ||
| 145 | */ | ||
| 146 | typedef struct { | ||
| 147 | unsigned int pitch; | ||
| 148 | } drm_mga_server_regs_t; | ||
| 149 | |||
| 150 | /* Setup registers for each texture unit | ||
| 151 | */ | ||
| 152 | typedef struct { | ||
| 153 | unsigned int texctl; | ||
| 154 | unsigned int texctl2; | ||
| 155 | unsigned int texfilter; | ||
| 156 | unsigned int texbordercol; | ||
| 157 | unsigned int texorg; | ||
| 158 | unsigned int texwidth; | ||
| 159 | unsigned int texheight; | ||
| 160 | unsigned int texorg1; | ||
| 161 | unsigned int texorg2; | ||
| 162 | unsigned int texorg3; | ||
| 163 | unsigned int texorg4; | ||
| 164 | } drm_mga_texture_regs_t; | ||
| 165 | |||
| 166 | /* General aging mechanism | ||
| 167 | */ | ||
| 168 | typedef struct { | ||
| 169 | unsigned int head; /* Position of head pointer */ | ||
| 170 | unsigned int wrap; /* Primary DMA wrap count */ | ||
| 171 | } drm_mga_age_t; | ||
| 172 | |||
| 173 | typedef struct _drm_mga_sarea { | ||
| 174 | /* The channel for communication of state information to the kernel | ||
| 175 | * on firing a vertex dma buffer. | ||
| 176 | */ | ||
| 177 | drm_mga_context_regs_t context_state; | ||
| 178 | drm_mga_server_regs_t server_state; | ||
| 179 | drm_mga_texture_regs_t tex_state[2]; | ||
| 180 | unsigned int warp_pipe; | ||
| 181 | unsigned int dirty; | ||
| 182 | unsigned int vertsize; | ||
| 183 | |||
| 184 | /* The current cliprects, or a subset thereof. | ||
| 185 | */ | ||
| 186 | struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS]; | ||
| 187 | unsigned int nbox; | ||
| 188 | |||
| 189 | /* Information about the most recently used 3d drawable. The | ||
| 190 | * client fills in the req_* fields, the server fills in the | ||
| 191 | * exported_ fields and puts the cliprects into boxes, above. | ||
| 192 | * | ||
| 193 | * The client clears the exported_drawable field before | ||
| 194 | * clobbering the boxes data. | ||
| 195 | */ | ||
| 196 | unsigned int req_drawable; /* the X drawable id */ | ||
| 197 | unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */ | ||
| 198 | |||
| 199 | unsigned int exported_drawable; | ||
| 200 | unsigned int exported_index; | ||
| 201 | unsigned int exported_stamp; | ||
| 202 | unsigned int exported_buffers; | ||
| 203 | unsigned int exported_nfront; | ||
| 204 | unsigned int exported_nback; | ||
| 205 | int exported_back_x, exported_front_x, exported_w; | ||
| 206 | int exported_back_y, exported_front_y, exported_h; | ||
| 207 | struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS]; | ||
| 208 | |||
| 209 | /* Counters for aging textures and for client-side throttling. | ||
| 210 | */ | ||
| 211 | unsigned int status[4]; | ||
| 212 | unsigned int last_wrap; | ||
| 213 | |||
| 214 | drm_mga_age_t last_frame; | ||
| 215 | unsigned int last_enqueue; /* last time a buffer was enqueued */ | ||
| 216 | unsigned int last_dispatch; /* age of the most recently dispatched buffer */ | ||
| 217 | unsigned int last_quiescent; /* */ | ||
| 218 | |||
| 219 | /* LRU lists for texture memory in agp space and on the card. | ||
| 220 | */ | ||
| 221 | struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1]; | ||
| 222 | unsigned int texAge[MGA_NR_TEX_HEAPS]; | ||
| 223 | |||
| 224 | /* Mechanism to validate card state. | ||
| 225 | */ | ||
| 226 | int ctxOwner; | ||
| 227 | } drm_mga_sarea_t; | ||
| 228 | |||
| 229 | /* MGA specific ioctls | ||
| 230 | * The device specific ioctl range is 0x40 to 0x79. | ||
| 231 | */ | ||
| 232 | #define DRM_MGA_INIT 0x00 | ||
| 233 | #define DRM_MGA_FLUSH 0x01 | ||
| 234 | #define DRM_MGA_RESET 0x02 | ||
| 235 | #define DRM_MGA_SWAP 0x03 | ||
| 236 | #define DRM_MGA_CLEAR 0x04 | ||
| 237 | #define DRM_MGA_VERTEX 0x05 | ||
| 238 | #define DRM_MGA_INDICES 0x06 | ||
| 239 | #define DRM_MGA_ILOAD 0x07 | ||
| 240 | #define DRM_MGA_BLIT 0x08 | ||
| 241 | #define DRM_MGA_GETPARAM 0x09 | ||
| 242 | |||
| 243 | /* 3.2: | ||
| 244 | * ioctls for operating on fences. | ||
| 245 | */ | ||
| 246 | #define DRM_MGA_SET_FENCE 0x0a | ||
| 247 | #define DRM_MGA_WAIT_FENCE 0x0b | ||
| 248 | #define DRM_MGA_DMA_BOOTSTRAP 0x0c | ||
| 249 | |||
| 250 | #define DRM_IOCTL_MGA_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t) | ||
| 251 | #define DRM_IOCTL_MGA_FLUSH DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, struct drm_lock) | ||
| 252 | #define DRM_IOCTL_MGA_RESET DRM_IO( DRM_COMMAND_BASE + DRM_MGA_RESET) | ||
| 253 | #define DRM_IOCTL_MGA_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_MGA_SWAP) | ||
| 254 | #define DRM_IOCTL_MGA_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t) | ||
| 255 | #define DRM_IOCTL_MGA_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t) | ||
| 256 | #define DRM_IOCTL_MGA_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t) | ||
| 257 | #define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t) | ||
| 258 | #define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t) | ||
| 259 | #define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t) | ||
| 260 | #define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32) | ||
| 261 | #define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32) | ||
| 262 | #define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t) | ||
| 263 | |||
| 264 | typedef struct _drm_mga_warp_index { | ||
| 265 | int installed; | ||
| 266 | unsigned long phys_addr; | ||
| 267 | int size; | ||
| 268 | } drm_mga_warp_index_t; | ||
| 269 | |||
| 270 | typedef struct drm_mga_init { | ||
| 271 | enum { | ||
| 272 | MGA_INIT_DMA = 0x01, | ||
| 273 | MGA_CLEANUP_DMA = 0x02 | ||
| 274 | } func; | ||
| 275 | |||
| 276 | unsigned long sarea_priv_offset; | ||
| 277 | |||
| 278 | int chipset; | ||
| 279 | int sgram; | ||
| 280 | |||
| 281 | unsigned int maccess; | ||
| 282 | |||
| 283 | unsigned int fb_cpp; | ||
| 284 | unsigned int front_offset, front_pitch; | ||
| 285 | unsigned int back_offset, back_pitch; | ||
| 286 | |||
| 287 | unsigned int depth_cpp; | ||
| 288 | unsigned int depth_offset, depth_pitch; | ||
| 289 | |||
| 290 | unsigned int texture_offset[MGA_NR_TEX_HEAPS]; | ||
| 291 | unsigned int texture_size[MGA_NR_TEX_HEAPS]; | ||
| 292 | |||
| 293 | unsigned long fb_offset; | ||
| 294 | unsigned long mmio_offset; | ||
| 295 | unsigned long status_offset; | ||
| 296 | unsigned long warp_offset; | ||
| 297 | unsigned long primary_offset; | ||
| 298 | unsigned long buffers_offset; | ||
| 299 | } drm_mga_init_t; | ||
| 300 | |||
| 301 | typedef struct drm_mga_dma_bootstrap { | ||
| 302 | /** | ||
| 303 | * \name AGP texture region | ||
| 304 | * | ||
| 305 | * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, these fields will | ||
| 306 | * be filled in with the actual AGP texture settings. | ||
| 307 | * | ||
| 308 | * \warning | ||
| 309 | * If these fields are non-zero, but dma_mga_dma_bootstrap::agp_mode | ||
| 310 | * is zero, it means that PCI memory (most likely through the use of | ||
| 311 | * an IOMMU) is being used for "AGP" textures. | ||
| 312 | */ | ||
| 313 | /*@{ */ | ||
| 314 | unsigned long texture_handle; /**< Handle used to map AGP textures. */ | ||
| 315 | __u32 texture_size; /**< Size of the AGP texture region. */ | ||
| 316 | /*@} */ | ||
| 317 | |||
| 318 | /** | ||
| 319 | * Requested size of the primary DMA region. | ||
| 320 | * | ||
| 321 | * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be | ||
| 322 | * filled in with the actual AGP mode. If AGP was not available | ||
| 323 | */ | ||
| 324 | __u32 primary_size; | ||
| 325 | |||
| 326 | /** | ||
| 327 | * Requested number of secondary DMA buffers. | ||
| 328 | * | ||
| 329 | * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be | ||
| 330 | * filled in with the actual number of secondary DMA buffers | ||
| 331 | * allocated. Particularly when PCI DMA is used, this may be | ||
| 332 | * (subtantially) less than the number requested. | ||
| 333 | */ | ||
| 334 | __u32 secondary_bin_count; | ||
| 335 | |||
| 336 | /** | ||
| 337 | * Requested size of each secondary DMA buffer. | ||
| 338 | * | ||
| 339 | * While the kernel \b is free to reduce | ||
| 340 | * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed | ||
| 341 | * to reduce dma_mga_dma_bootstrap::secondary_bin_size. | ||
| 342 | */ | ||
| 343 | __u32 secondary_bin_size; | ||
| 344 | |||
| 345 | /** | ||
| 346 | * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X, | ||
| 347 | * \c AGPSTAT2_2X, and \c AGPSTAT2_4X are supported. If this value is | ||
| 348 | * zero, it means that PCI DMA should be used, even if AGP is | ||
| 349 | * possible. | ||
| 350 | * | ||
| 351 | * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be | ||
| 352 | * filled in with the actual AGP mode. If AGP was not available | ||
| 353 | * (i.e., PCI DMA was used), this value will be zero. | ||
| 354 | */ | ||
| 355 | __u32 agp_mode; | ||
| 356 | |||
| 357 | /** | ||
| 358 | * Desired AGP GART size, measured in megabytes. | ||
| 359 | */ | ||
| 360 | __u8 agp_size; | ||
| 361 | } drm_mga_dma_bootstrap_t; | ||
| 362 | |||
| 363 | typedef struct drm_mga_clear { | ||
| 364 | unsigned int flags; | ||
| 365 | unsigned int clear_color; | ||
| 366 | unsigned int clear_depth; | ||
| 367 | unsigned int color_mask; | ||
| 368 | unsigned int depth_mask; | ||
| 369 | } drm_mga_clear_t; | ||
| 370 | |||
| 371 | typedef struct drm_mga_vertex { | ||
| 372 | int idx; /* buffer to queue */ | ||
| 373 | int used; /* bytes in use */ | ||
| 374 | int discard; /* client finished with buffer? */ | ||
| 375 | } drm_mga_vertex_t; | ||
| 376 | |||
| 377 | typedef struct drm_mga_indices { | ||
| 378 | int idx; /* buffer to queue */ | ||
| 379 | unsigned int start; | ||
| 380 | unsigned int end; | ||
| 381 | int discard; /* client finished with buffer? */ | ||
| 382 | } drm_mga_indices_t; | ||
| 383 | |||
| 384 | typedef struct drm_mga_iload { | ||
| 385 | int idx; | ||
| 386 | unsigned int dstorg; | ||
| 387 | unsigned int length; | ||
| 388 | } drm_mga_iload_t; | ||
| 389 | |||
| 390 | typedef struct _drm_mga_blit { | ||
| 391 | unsigned int planemask; | ||
| 392 | unsigned int srcorg; | ||
| 393 | unsigned int dstorg; | ||
| 394 | int src_pitch, dst_pitch; | ||
| 395 | int delta_sx, delta_sy; | ||
| 396 | int delta_dx, delta_dy; | ||
| 397 | int height, ydir; /* flip image vertically */ | ||
| 398 | int source_pitch, dest_pitch; | ||
| 399 | } drm_mga_blit_t; | ||
| 400 | |||
| 401 | /* 3.1: An ioctl to get parameters that aren't available to the 3d | ||
| 402 | * client any other way. | ||
| 403 | */ | ||
| 404 | #define MGA_PARAM_IRQ_NR 1 | ||
| 405 | |||
| 406 | /* 3.2: Query the actual card type. The DDX only distinguishes between | ||
| 407 | * G200 chips and non-G200 chips, which it calls G400. It turns out that | ||
| 408 | * there are some very sublte differences between the G4x0 chips and the G550 | ||
| 409 | * chips. Using this parameter query, a client-side driver can detect the | ||
| 410 | * difference between a G4x0 and a G550. | ||
| 411 | */ | ||
| 412 | #define MGA_PARAM_CARD_TYPE 2 | ||
| 413 | |||
| 414 | typedef struct drm_mga_getparam { | ||
| 415 | int param; | ||
| 416 | void __user *value; | ||
| 417 | } drm_mga_getparam_t; | ||
| 418 | |||
| 419 | #endif | ||
| @@ -0,0 +1,138 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2005 Stephane Marchesin. | ||
| 3 | * All Rights Reserved. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the "Software"), | ||
| 7 | * to deal in the Software without restriction, including without limitation | ||
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 10 | * Software is furnished to do so, subject to the following conditions: | ||
| 11 | * | ||
| 12 | * The above copyright notice and this permission notice (including the next | ||
| 13 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 14 | * Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 22 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __NOUVEAU_DRM_H__ | ||
| 26 | #define __NOUVEAU_DRM_H__ | ||
| 27 | |||
| 28 | #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0) | ||
| 29 | #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) | ||
| 30 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) | ||
| 31 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) | ||
| 32 | |||
| 33 | #define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */ | ||
| 34 | #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 | ||
| 35 | #define NOUVEAU_GEM_TILE_16BPP 0x00000001 | ||
| 36 | #define NOUVEAU_GEM_TILE_32BPP 0x00000002 | ||
| 37 | #define NOUVEAU_GEM_TILE_ZETA 0x00000004 | ||
| 38 | #define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008 | ||
| 39 | |||
| 40 | struct drm_nouveau_gem_info { | ||
| 41 | uint32_t handle; | ||
| 42 | uint32_t domain; | ||
| 43 | uint64_t size; | ||
| 44 | uint64_t offset; | ||
| 45 | uint64_t map_handle; | ||
| 46 | uint32_t tile_mode; | ||
| 47 | uint32_t tile_flags; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct drm_nouveau_gem_new { | ||
| 51 | struct drm_nouveau_gem_info info; | ||
| 52 | uint32_t channel_hint; | ||
| 53 | uint32_t align; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define NOUVEAU_GEM_MAX_BUFFERS 1024 | ||
| 57 | struct drm_nouveau_gem_pushbuf_bo_presumed { | ||
| 58 | uint32_t valid; | ||
| 59 | uint32_t domain; | ||
| 60 | uint64_t offset; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct drm_nouveau_gem_pushbuf_bo { | ||
| 64 | uint64_t user_priv; | ||
| 65 | uint32_t handle; | ||
| 66 | uint32_t read_domains; | ||
| 67 | uint32_t write_domains; | ||
| 68 | uint32_t valid_domains; | ||
| 69 | struct drm_nouveau_gem_pushbuf_bo_presumed presumed; | ||
| 70 | }; | ||
| 71 | |||
| 72 | #define NOUVEAU_GEM_RELOC_LOW (1 << 0) | ||
| 73 | #define NOUVEAU_GEM_RELOC_HIGH (1 << 1) | ||
| 74 | #define NOUVEAU_GEM_RELOC_OR (1 << 2) | ||
| 75 | #define NOUVEAU_GEM_MAX_RELOCS 1024 | ||
| 76 | struct drm_nouveau_gem_pushbuf_reloc { | ||
| 77 | uint32_t reloc_bo_index; | ||
| 78 | uint32_t reloc_bo_offset; | ||
| 79 | uint32_t bo_index; | ||
| 80 | uint32_t flags; | ||
| 81 | uint32_t data; | ||
| 82 | uint32_t vor; | ||
| 83 | uint32_t tor; | ||
| 84 | }; | ||
| 85 | |||
| 86 | #define NOUVEAU_GEM_MAX_PUSH 512 | ||
| 87 | struct drm_nouveau_gem_pushbuf_push { | ||
| 88 | uint32_t bo_index; | ||
| 89 | uint32_t pad; | ||
| 90 | uint64_t offset; | ||
| 91 | uint64_t length; | ||
| 92 | }; | ||
| 93 | |||
| 94 | struct drm_nouveau_gem_pushbuf { | ||
| 95 | uint32_t channel; | ||
| 96 | uint32_t nr_buffers; | ||
| 97 | uint64_t buffers; | ||
| 98 | uint32_t nr_relocs; | ||
| 99 | uint32_t nr_push; | ||
| 100 | uint64_t relocs; | ||
| 101 | uint64_t push; | ||
| 102 | uint32_t suffix0; | ||
| 103 | uint32_t suffix1; | ||
| 104 | uint64_t vram_available; | ||
| 105 | uint64_t gart_available; | ||
| 106 | }; | ||
| 107 | |||
| 108 | #define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001 | ||
| 109 | #define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004 | ||
| 110 | struct drm_nouveau_gem_cpu_prep { | ||
| 111 | uint32_t handle; | ||
| 112 | uint32_t flags; | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct drm_nouveau_gem_cpu_fini { | ||
| 116 | uint32_t handle; | ||
| 117 | }; | ||
| 118 | |||
| 119 | #define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */ | ||
| 120 | #define DRM_NOUVEAU_SETPARAM 0x01 /* deprecated */ | ||
| 121 | #define DRM_NOUVEAU_CHANNEL_ALLOC 0x02 /* deprecated */ | ||
| 122 | #define DRM_NOUVEAU_CHANNEL_FREE 0x03 /* deprecated */ | ||
| 123 | #define DRM_NOUVEAU_GROBJ_ALLOC 0x04 /* deprecated */ | ||
| 124 | #define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05 /* deprecated */ | ||
| 125 | #define DRM_NOUVEAU_GPUOBJ_FREE 0x06 /* deprecated */ | ||
| 126 | #define DRM_NOUVEAU_GEM_NEW 0x40 | ||
| 127 | #define DRM_NOUVEAU_GEM_PUSHBUF 0x41 | ||
| 128 | #define DRM_NOUVEAU_GEM_CPU_PREP 0x42 | ||
| 129 | #define DRM_NOUVEAU_GEM_CPU_FINI 0x43 | ||
| 130 | #define DRM_NOUVEAU_GEM_INFO 0x44 | ||
| 131 | |||
| 132 | #define DRM_IOCTL_NOUVEAU_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_NEW, struct drm_nouveau_gem_new) | ||
| 133 | #define DRM_IOCTL_NOUVEAU_GEM_PUSHBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_PUSHBUF, struct drm_nouveau_gem_pushbuf) | ||
| 134 | #define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep) | ||
| 135 | #define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini) | ||
| 136 | #define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info) | ||
| 137 | |||
| 138 | #endif /* __NOUVEAU_DRM_H__ */ | ||
| @@ -0,0 +1,326 @@ | |||
| 1 | /* r128_drm.h -- Public header for the r128 driver -*- linux-c -*- | ||
| 2 | * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com | ||
| 3 | */ | ||
| 4 | /* | ||
| 5 | * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. | ||
| 6 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
| 7 | * All rights reserved. | ||
| 8 | * | ||
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 10 | * copy of this software and associated documentation files (the "Software"), | ||
| 11 | * to deal in the Software without restriction, including without limitation | ||
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 14 | * Software is furnished to do so, subject to the following conditions: | ||
| 15 | * | ||
| 16 | * The above copyright notice and this permission notice (including the next | ||
| 17 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 18 | * Software. | ||
| 19 | * | ||
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 23 | * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 26 | * DEALINGS IN THE SOFTWARE. | ||
| 27 | * | ||
| 28 | * Authors: | ||
| 29 | * Gareth Hughes <gareth@valinux.com> | ||
| 30 | * Kevin E. Martin <martin@valinux.com> | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __R128_DRM_H__ | ||
| 34 | #define __R128_DRM_H__ | ||
| 35 | |||
| 36 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 37 | * defines in the X server file (r128_sarea.h) | ||
| 38 | */ | ||
| 39 | #ifndef __R128_SAREA_DEFINES__ | ||
| 40 | #define __R128_SAREA_DEFINES__ | ||
| 41 | |||
| 42 | /* What needs to be changed for the current vertex buffer? | ||
| 43 | */ | ||
| 44 | #define R128_UPLOAD_CONTEXT 0x001 | ||
| 45 | #define R128_UPLOAD_SETUP 0x002 | ||
| 46 | #define R128_UPLOAD_TEX0 0x004 | ||
| 47 | #define R128_UPLOAD_TEX1 0x008 | ||
| 48 | #define R128_UPLOAD_TEX0IMAGES 0x010 | ||
| 49 | #define R128_UPLOAD_TEX1IMAGES 0x020 | ||
| 50 | #define R128_UPLOAD_CORE 0x040 | ||
| 51 | #define R128_UPLOAD_MASKS 0x080 | ||
| 52 | #define R128_UPLOAD_WINDOW 0x100 | ||
| 53 | #define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */ | ||
| 54 | #define R128_REQUIRE_QUIESCENCE 0x400 | ||
| 55 | #define R128_UPLOAD_ALL 0x7ff | ||
| 56 | |||
| 57 | #define R128_FRONT 0x1 | ||
| 58 | #define R128_BACK 0x2 | ||
| 59 | #define R128_DEPTH 0x4 | ||
| 60 | |||
| 61 | /* Primitive types | ||
| 62 | */ | ||
| 63 | #define R128_POINTS 0x1 | ||
| 64 | #define R128_LINES 0x2 | ||
| 65 | #define R128_LINE_STRIP 0x3 | ||
| 66 | #define R128_TRIANGLES 0x4 | ||
| 67 | #define R128_TRIANGLE_FAN 0x5 | ||
| 68 | #define R128_TRIANGLE_STRIP 0x6 | ||
| 69 | |||
| 70 | /* Vertex/indirect buffer size | ||
| 71 | */ | ||
| 72 | #define R128_BUFFER_SIZE 16384 | ||
| 73 | |||
| 74 | /* Byte offsets for indirect buffer data | ||
| 75 | */ | ||
| 76 | #define R128_INDEX_PRIM_OFFSET 20 | ||
| 77 | #define R128_HOSTDATA_BLIT_OFFSET 32 | ||
| 78 | |||
| 79 | /* Keep these small for testing. | ||
| 80 | */ | ||
| 81 | #define R128_NR_SAREA_CLIPRECTS 12 | ||
| 82 | |||
| 83 | /* There are 2 heaps (local/AGP). Each region within a heap is a | ||
| 84 | * minimum of 64k, and there are at most 64 of them per heap. | ||
| 85 | */ | ||
| 86 | #define R128_LOCAL_TEX_HEAP 0 | ||
| 87 | #define R128_AGP_TEX_HEAP 1 | ||
| 88 | #define R128_NR_TEX_HEAPS 2 | ||
| 89 | #define R128_NR_TEX_REGIONS 64 | ||
| 90 | #define R128_LOG_TEX_GRANULARITY 16 | ||
| 91 | |||
| 92 | #define R128_NR_CONTEXT_REGS 12 | ||
| 93 | |||
| 94 | #define R128_MAX_TEXTURE_LEVELS 11 | ||
| 95 | #define R128_MAX_TEXTURE_UNITS 2 | ||
| 96 | |||
| 97 | #endif /* __R128_SAREA_DEFINES__ */ | ||
| 98 | |||
| 99 | typedef struct { | ||
| 100 | /* Context state - can be written in one large chunk */ | ||
| 101 | unsigned int dst_pitch_offset_c; | ||
| 102 | unsigned int dp_gui_master_cntl_c; | ||
| 103 | unsigned int sc_top_left_c; | ||
| 104 | unsigned int sc_bottom_right_c; | ||
| 105 | unsigned int z_offset_c; | ||
| 106 | unsigned int z_pitch_c; | ||
| 107 | unsigned int z_sten_cntl_c; | ||
| 108 | unsigned int tex_cntl_c; | ||
| 109 | unsigned int misc_3d_state_cntl_reg; | ||
| 110 | unsigned int texture_clr_cmp_clr_c; | ||
| 111 | unsigned int texture_clr_cmp_msk_c; | ||
| 112 | unsigned int fog_color_c; | ||
| 113 | |||
| 114 | /* Texture state */ | ||
| 115 | unsigned int tex_size_pitch_c; | ||
| 116 | unsigned int constant_color_c; | ||
| 117 | |||
| 118 | /* Setup state */ | ||
| 119 | unsigned int pm4_vc_fpu_setup; | ||
| 120 | unsigned int setup_cntl; | ||
| 121 | |||
| 122 | /* Mask state */ | ||
| 123 | unsigned int dp_write_mask; | ||
| 124 | unsigned int sten_ref_mask_c; | ||
| 125 | unsigned int plane_3d_mask_c; | ||
| 126 | |||
| 127 | /* Window state */ | ||
| 128 | unsigned int window_xy_offset; | ||
| 129 | |||
| 130 | /* Core state */ | ||
| 131 | unsigned int scale_3d_cntl; | ||
| 132 | } drm_r128_context_regs_t; | ||
| 133 | |||
| 134 | /* Setup registers for each texture unit | ||
| 135 | */ | ||
| 136 | typedef struct { | ||
| 137 | unsigned int tex_cntl; | ||
| 138 | unsigned int tex_combine_cntl; | ||
| 139 | unsigned int tex_size_pitch; | ||
| 140 | unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS]; | ||
| 141 | unsigned int tex_border_color; | ||
| 142 | } drm_r128_texture_regs_t; | ||
| 143 | |||
| 144 | typedef struct drm_r128_sarea { | ||
| 145 | /* The channel for communication of state information to the kernel | ||
| 146 | * on firing a vertex buffer. | ||
| 147 | */ | ||
| 148 | drm_r128_context_regs_t context_state; | ||
| 149 | drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS]; | ||
| 150 | unsigned int dirty; | ||
| 151 | unsigned int vertsize; | ||
| 152 | unsigned int vc_format; | ||
| 153 | |||
| 154 | /* The current cliprects, or a subset thereof. | ||
| 155 | */ | ||
| 156 | struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS]; | ||
| 157 | unsigned int nbox; | ||
| 158 | |||
| 159 | /* Counters for client-side throttling of rendering clients. | ||
| 160 | */ | ||
| 161 | unsigned int last_frame; | ||
| 162 | unsigned int last_dispatch; | ||
| 163 | |||
| 164 | struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1]; | ||
| 165 | unsigned int tex_age[R128_NR_TEX_HEAPS]; | ||
| 166 | int ctx_owner; | ||
| 167 | int pfAllowPageFlip; /* number of 3d windows (0,1,2 or more) */ | ||
| 168 | int pfCurrentPage; /* which buffer is being displayed? */ | ||
| 169 | } drm_r128_sarea_t; | ||
| 170 | |||
| 171 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 172 | * defines in the Xserver file (xf86drmR128.h) | ||
| 173 | */ | ||
| 174 | |||
| 175 | /* Rage 128 specific ioctls | ||
| 176 | * The device specific ioctl range is 0x40 to 0x79. | ||
| 177 | */ | ||
| 178 | #define DRM_R128_INIT 0x00 | ||
| 179 | #define DRM_R128_CCE_START 0x01 | ||
| 180 | #define DRM_R128_CCE_STOP 0x02 | ||
| 181 | #define DRM_R128_CCE_RESET 0x03 | ||
| 182 | #define DRM_R128_CCE_IDLE 0x04 | ||
| 183 | /* 0x05 not used */ | ||
| 184 | #define DRM_R128_RESET 0x06 | ||
| 185 | #define DRM_R128_SWAP 0x07 | ||
| 186 | #define DRM_R128_CLEAR 0x08 | ||
| 187 | #define DRM_R128_VERTEX 0x09 | ||
| 188 | #define DRM_R128_INDICES 0x0a | ||
| 189 | #define DRM_R128_BLIT 0x0b | ||
| 190 | #define DRM_R128_DEPTH 0x0c | ||
| 191 | #define DRM_R128_STIPPLE 0x0d | ||
| 192 | /* 0x0e not used */ | ||
| 193 | #define DRM_R128_INDIRECT 0x0f | ||
| 194 | #define DRM_R128_FULLSCREEN 0x10 | ||
| 195 | #define DRM_R128_CLEAR2 0x11 | ||
| 196 | #define DRM_R128_GETPARAM 0x12 | ||
| 197 | #define DRM_R128_FLIP 0x13 | ||
| 198 | |||
| 199 | #define DRM_IOCTL_R128_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t) | ||
| 200 | #define DRM_IOCTL_R128_CCE_START DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_START) | ||
| 201 | #define DRM_IOCTL_R128_CCE_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t) | ||
| 202 | #define DRM_IOCTL_R128_CCE_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_RESET) | ||
| 203 | #define DRM_IOCTL_R128_CCE_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_IDLE) | ||
| 204 | /* 0x05 not used */ | ||
| 205 | #define DRM_IOCTL_R128_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_RESET) | ||
| 206 | #define DRM_IOCTL_R128_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_R128_SWAP) | ||
| 207 | #define DRM_IOCTL_R128_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t) | ||
| 208 | #define DRM_IOCTL_R128_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t) | ||
| 209 | #define DRM_IOCTL_R128_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t) | ||
| 210 | #define DRM_IOCTL_R128_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t) | ||
| 211 | #define DRM_IOCTL_R128_DEPTH DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t) | ||
| 212 | #define DRM_IOCTL_R128_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t) | ||
| 213 | /* 0x0e not used */ | ||
| 214 | #define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t) | ||
| 215 | #define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t) | ||
| 216 | #define DRM_IOCTL_R128_CLEAR2 DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t) | ||
| 217 | #define DRM_IOCTL_R128_GETPARAM DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t) | ||
| 218 | #define DRM_IOCTL_R128_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_R128_FLIP) | ||
| 219 | |||
| 220 | typedef struct drm_r128_init { | ||
| 221 | enum { | ||
| 222 | R128_INIT_CCE = 0x01, | ||
| 223 | R128_CLEANUP_CCE = 0x02 | ||
| 224 | } func; | ||
| 225 | unsigned long sarea_priv_offset; | ||
| 226 | int is_pci; | ||
| 227 | int cce_mode; | ||
| 228 | int cce_secure; | ||
| 229 | int ring_size; | ||
| 230 | int usec_timeout; | ||
| 231 | |||
| 232 | unsigned int fb_bpp; | ||
| 233 | unsigned int front_offset, front_pitch; | ||
| 234 | unsigned int back_offset, back_pitch; | ||
| 235 | unsigned int depth_bpp; | ||
| 236 | unsigned int depth_offset, depth_pitch; | ||
| 237 | unsigned int span_offset; | ||
| 238 | |||
| 239 | unsigned long fb_offset; | ||
| 240 | unsigned long mmio_offset; | ||
| 241 | unsigned long ring_offset; | ||
| 242 | unsigned long ring_rptr_offset; | ||
| 243 | unsigned long buffers_offset; | ||
| 244 | unsigned long agp_textures_offset; | ||
| 245 | } drm_r128_init_t; | ||
| 246 | |||
| 247 | typedef struct drm_r128_cce_stop { | ||
| 248 | int flush; | ||
| 249 | int idle; | ||
| 250 | } drm_r128_cce_stop_t; | ||
| 251 | |||
| 252 | typedef struct drm_r128_clear { | ||
| 253 | unsigned int flags; | ||
| 254 | unsigned int clear_color; | ||
| 255 | unsigned int clear_depth; | ||
| 256 | unsigned int color_mask; | ||
| 257 | unsigned int depth_mask; | ||
| 258 | } drm_r128_clear_t; | ||
| 259 | |||
| 260 | typedef struct drm_r128_vertex { | ||
| 261 | int prim; | ||
| 262 | int idx; /* Index of vertex buffer */ | ||
| 263 | int count; /* Number of vertices in buffer */ | ||
| 264 | int discard; /* Client finished with buffer? */ | ||
| 265 | } drm_r128_vertex_t; | ||
| 266 | |||
| 267 | typedef struct drm_r128_indices { | ||
| 268 | int prim; | ||
| 269 | int idx; | ||
| 270 | int start; | ||
| 271 | int end; | ||
| 272 | int discard; /* Client finished with buffer? */ | ||
| 273 | } drm_r128_indices_t; | ||
| 274 | |||
| 275 | typedef struct drm_r128_blit { | ||
| 276 | int idx; | ||
| 277 | int pitch; | ||
| 278 | int offset; | ||
| 279 | int format; | ||
| 280 | unsigned short x, y; | ||
| 281 | unsigned short width, height; | ||
| 282 | } drm_r128_blit_t; | ||
| 283 | |||
| 284 | typedef struct drm_r128_depth { | ||
| 285 | enum { | ||
| 286 | R128_WRITE_SPAN = 0x01, | ||
| 287 | R128_WRITE_PIXELS = 0x02, | ||
| 288 | R128_READ_SPAN = 0x03, | ||
| 289 | R128_READ_PIXELS = 0x04 | ||
| 290 | } func; | ||
| 291 | int n; | ||
| 292 | int __user *x; | ||
| 293 | int __user *y; | ||
| 294 | unsigned int __user *buffer; | ||
| 295 | unsigned char __user *mask; | ||
| 296 | } drm_r128_depth_t; | ||
| 297 | |||
| 298 | typedef struct drm_r128_stipple { | ||
| 299 | unsigned int __user *mask; | ||
| 300 | } drm_r128_stipple_t; | ||
| 301 | |||
| 302 | typedef struct drm_r128_indirect { | ||
| 303 | int idx; | ||
| 304 | int start; | ||
| 305 | int end; | ||
| 306 | int discard; | ||
| 307 | } drm_r128_indirect_t; | ||
| 308 | |||
| 309 | typedef struct drm_r128_fullscreen { | ||
| 310 | enum { | ||
| 311 | R128_INIT_FULLSCREEN = 0x01, | ||
| 312 | R128_CLEANUP_FULLSCREEN = 0x02 | ||
| 313 | } func; | ||
| 314 | } drm_r128_fullscreen_t; | ||
| 315 | |||
| 316 | /* 2.3: An ioctl to get parameters that aren't available to the 3d | ||
| 317 | * client any other way. | ||
| 318 | */ | ||
| 319 | #define R128_PARAM_IRQ_NR 1 | ||
| 320 | |||
| 321 | typedef struct drm_r128_getparam { | ||
| 322 | int param; | ||
| 323 | void __user *value; | ||
| 324 | } drm_r128_getparam_t; | ||
| 325 | |||
| 326 | #endif | ||
| @@ -0,0 +1,976 @@ | |||
| 1 | /* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*- | ||
| 2 | * | ||
| 3 | * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. | ||
| 4 | * Copyright 2000 VA Linux Systems, Inc., Fremont, California. | ||
| 5 | * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 9 | * copy of this software and associated documentation files (the "Software"), | ||
| 10 | * to deal in the Software without restriction, including without limitation | ||
| 11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 12 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 13 | * Software is furnished to do so, subject to the following conditions: | ||
| 14 | * | ||
| 15 | * The above copyright notice and this permission notice (including the next | ||
| 16 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 17 | * Software. | ||
| 18 | * | ||
| 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 22 | * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 23 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 24 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 25 | * DEALINGS IN THE SOFTWARE. | ||
| 26 | * | ||
| 27 | * Authors: | ||
| 28 | * Kevin E. Martin <martin@valinux.com> | ||
| 29 | * Gareth Hughes <gareth@valinux.com> | ||
| 30 | * Keith Whitwell <keith@tungstengraphics.com> | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __RADEON_DRM_H__ | ||
| 34 | #define __RADEON_DRM_H__ | ||
| 35 | |||
| 36 | #include <drm/drm.h> | ||
| 37 | |||
| 38 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 39 | * defines in the X server file (radeon_sarea.h) | ||
| 40 | */ | ||
| 41 | #ifndef __RADEON_SAREA_DEFINES__ | ||
| 42 | #define __RADEON_SAREA_DEFINES__ | ||
| 43 | |||
| 44 | /* Old style state flags, required for sarea interface (1.1 and 1.2 | ||
| 45 | * clears) and 1.2 drm_vertex2 ioctl. | ||
| 46 | */ | ||
| 47 | #define RADEON_UPLOAD_CONTEXT 0x00000001 | ||
| 48 | #define RADEON_UPLOAD_VERTFMT 0x00000002 | ||
| 49 | #define RADEON_UPLOAD_LINE 0x00000004 | ||
| 50 | #define RADEON_UPLOAD_BUMPMAP 0x00000008 | ||
| 51 | #define RADEON_UPLOAD_MASKS 0x00000010 | ||
| 52 | #define RADEON_UPLOAD_VIEWPORT 0x00000020 | ||
| 53 | #define RADEON_UPLOAD_SETUP 0x00000040 | ||
| 54 | #define RADEON_UPLOAD_TCL 0x00000080 | ||
| 55 | #define RADEON_UPLOAD_MISC 0x00000100 | ||
| 56 | #define RADEON_UPLOAD_TEX0 0x00000200 | ||
| 57 | #define RADEON_UPLOAD_TEX1 0x00000400 | ||
| 58 | #define RADEON_UPLOAD_TEX2 0x00000800 | ||
| 59 | #define RADEON_UPLOAD_TEX0IMAGES 0x00001000 | ||
| 60 | #define RADEON_UPLOAD_TEX1IMAGES 0x00002000 | ||
| 61 | #define RADEON_UPLOAD_TEX2IMAGES 0x00004000 | ||
| 62 | #define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */ | ||
| 63 | #define RADEON_REQUIRE_QUIESCENCE 0x00010000 | ||
| 64 | #define RADEON_UPLOAD_ZBIAS 0x00020000 /* version 1.2 and newer */ | ||
| 65 | #define RADEON_UPLOAD_ALL 0x003effff | ||
| 66 | #define RADEON_UPLOAD_CONTEXT_ALL 0x003e01ff | ||
| 67 | |||
| 68 | /* New style per-packet identifiers for use in cmd_buffer ioctl with | ||
| 69 | * the RADEON_EMIT_PACKET command. Comments relate new packets to old | ||
| 70 | * state bits and the packet size: | ||
| 71 | */ | ||
| 72 | #define RADEON_EMIT_PP_MISC 0 /* context/7 */ | ||
| 73 | #define RADEON_EMIT_PP_CNTL 1 /* context/3 */ | ||
| 74 | #define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */ | ||
| 75 | #define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */ | ||
| 76 | #define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */ | ||
| 77 | #define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */ | ||
| 78 | #define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */ | ||
| 79 | #define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */ | ||
| 80 | #define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */ | ||
| 81 | #define RADEON_EMIT_SE_CNTL 9 /* setup/2 */ | ||
| 82 | #define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */ | ||
| 83 | #define RADEON_EMIT_RE_MISC 11 /* misc/1 */ | ||
| 84 | #define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */ | ||
| 85 | #define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */ | ||
| 86 | #define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */ | ||
| 87 | #define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */ | ||
| 88 | #define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */ | ||
| 89 | #define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */ | ||
| 90 | #define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */ | ||
| 91 | #define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */ | ||
| 92 | #define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */ | ||
| 93 | #define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */ | ||
| 94 | #define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */ | ||
| 95 | #define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */ | ||
| 96 | #define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */ | ||
| 97 | #define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */ | ||
| 98 | #define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */ | ||
| 99 | #define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */ | ||
| 100 | #define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */ | ||
| 101 | #define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/7 */ | ||
| 102 | #define R200_EMIT_TFACTOR_0 30 /* tf/7 */ | ||
| 103 | #define R200_EMIT_VTX_FMT_0 31 /* vtx/5 */ | ||
| 104 | #define R200_EMIT_VAP_CTL 32 /* vap/1 */ | ||
| 105 | #define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */ | ||
| 106 | #define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */ | ||
| 107 | #define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */ | ||
| 108 | #define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */ | ||
| 109 | #define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */ | ||
| 110 | #define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */ | ||
| 111 | #define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */ | ||
| 112 | #define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */ | ||
| 113 | #define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */ | ||
| 114 | #define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */ | ||
| 115 | #define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */ | ||
| 116 | #define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */ | ||
| 117 | #define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */ | ||
| 118 | #define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */ | ||
| 119 | #define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */ | ||
| 120 | #define R200_EMIT_VTE_CNTL 48 /* vte/1 */ | ||
| 121 | #define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */ | ||
| 122 | #define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */ | ||
| 123 | #define R200_EMIT_PP_CNTL_X 51 /* cst/1 */ | ||
| 124 | #define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */ | ||
| 125 | #define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */ | ||
| 126 | #define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */ | ||
| 127 | #define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */ | ||
| 128 | #define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */ | ||
| 129 | #define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */ | ||
| 130 | #define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */ | ||
| 131 | #define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */ | ||
| 132 | #define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */ | ||
| 133 | #define R200_EMIT_PP_CUBIC_FACES_0 61 | ||
| 134 | #define R200_EMIT_PP_CUBIC_OFFSETS_0 62 | ||
| 135 | #define R200_EMIT_PP_CUBIC_FACES_1 63 | ||
| 136 | #define R200_EMIT_PP_CUBIC_OFFSETS_1 64 | ||
| 137 | #define R200_EMIT_PP_CUBIC_FACES_2 65 | ||
| 138 | #define R200_EMIT_PP_CUBIC_OFFSETS_2 66 | ||
| 139 | #define R200_EMIT_PP_CUBIC_FACES_3 67 | ||
| 140 | #define R200_EMIT_PP_CUBIC_OFFSETS_3 68 | ||
| 141 | #define R200_EMIT_PP_CUBIC_FACES_4 69 | ||
| 142 | #define R200_EMIT_PP_CUBIC_OFFSETS_4 70 | ||
| 143 | #define R200_EMIT_PP_CUBIC_FACES_5 71 | ||
| 144 | #define R200_EMIT_PP_CUBIC_OFFSETS_5 72 | ||
| 145 | #define RADEON_EMIT_PP_TEX_SIZE_0 73 | ||
| 146 | #define RADEON_EMIT_PP_TEX_SIZE_1 74 | ||
| 147 | #define RADEON_EMIT_PP_TEX_SIZE_2 75 | ||
| 148 | #define R200_EMIT_RB3D_BLENDCOLOR 76 | ||
| 149 | #define R200_EMIT_TCL_POINT_SPRITE_CNTL 77 | ||
| 150 | #define RADEON_EMIT_PP_CUBIC_FACES_0 78 | ||
| 151 | #define RADEON_EMIT_PP_CUBIC_OFFSETS_T0 79 | ||
| 152 | #define RADEON_EMIT_PP_CUBIC_FACES_1 80 | ||
| 153 | #define RADEON_EMIT_PP_CUBIC_OFFSETS_T1 81 | ||
| 154 | #define RADEON_EMIT_PP_CUBIC_FACES_2 82 | ||
| 155 | #define RADEON_EMIT_PP_CUBIC_OFFSETS_T2 83 | ||
| 156 | #define R200_EMIT_PP_TRI_PERF_CNTL 84 | ||
| 157 | #define R200_EMIT_PP_AFS_0 85 | ||
| 158 | #define R200_EMIT_PP_AFS_1 86 | ||
| 159 | #define R200_EMIT_ATF_TFACTOR 87 | ||
| 160 | #define R200_EMIT_PP_TXCTLALL_0 88 | ||
| 161 | #define R200_EMIT_PP_TXCTLALL_1 89 | ||
| 162 | #define R200_EMIT_PP_TXCTLALL_2 90 | ||
| 163 | #define R200_EMIT_PP_TXCTLALL_3 91 | ||
| 164 | #define R200_EMIT_PP_TXCTLALL_4 92 | ||
| 165 | #define R200_EMIT_PP_TXCTLALL_5 93 | ||
| 166 | #define R200_EMIT_VAP_PVS_CNTL 94 | ||
| 167 | #define RADEON_MAX_STATE_PACKETS 95 | ||
| 168 | |||
| 169 | /* Commands understood by cmd_buffer ioctl. More can be added but | ||
| 170 | * obviously these can't be removed or changed: | ||
| 171 | */ | ||
| 172 | #define RADEON_CMD_PACKET 1 /* emit one of the register packets above */ | ||
| 173 | #define RADEON_CMD_SCALARS 2 /* emit scalar data */ | ||
| 174 | #define RADEON_CMD_VECTORS 3 /* emit vector data */ | ||
| 175 | #define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */ | ||
| 176 | #define RADEON_CMD_PACKET3 5 /* emit hw packet */ | ||
| 177 | #define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */ | ||
| 178 | #define RADEON_CMD_SCALARS2 7 /* r200 stopgap */ | ||
| 179 | #define RADEON_CMD_WAIT 8 /* emit hw wait commands -- note: | ||
| 180 | * doesn't make the cpu wait, just | ||
| 181 | * the graphics hardware */ | ||
| 182 | #define RADEON_CMD_VECLINEAR 9 /* another r200 stopgap */ | ||
| 183 | |||
| 184 | typedef union { | ||
| 185 | int i; | ||
| 186 | struct { | ||
| 187 | unsigned char cmd_type, pad0, pad1, pad2; | ||
| 188 | } header; | ||
| 189 | struct { | ||
| 190 | unsigned char cmd_type, packet_id, pad0, pad1; | ||
| 191 | } packet; | ||
| 192 | struct { | ||
| 193 | unsigned char cmd_type, offset, stride, count; | ||
| 194 | } scalars; | ||
| 195 | struct { | ||
| 196 | unsigned char cmd_type, offset, stride, count; | ||
| 197 | } vectors; | ||
| 198 | struct { | ||
| 199 | unsigned char cmd_type, addr_lo, addr_hi, count; | ||
| 200 | } veclinear; | ||
| 201 | struct { | ||
| 202 | unsigned char cmd_type, buf_idx, pad0, pad1; | ||
| 203 | } dma; | ||
| 204 | struct { | ||
| 205 | unsigned char cmd_type, flags, pad0, pad1; | ||
| 206 | } wait; | ||
| 207 | } drm_radeon_cmd_header_t; | ||
| 208 | |||
| 209 | #define RADEON_WAIT_2D 0x1 | ||
| 210 | #define RADEON_WAIT_3D 0x2 | ||
| 211 | |||
| 212 | /* Allowed parameters for R300_CMD_PACKET3 | ||
| 213 | */ | ||
| 214 | #define R300_CMD_PACKET3_CLEAR 0 | ||
| 215 | #define R300_CMD_PACKET3_RAW 1 | ||
| 216 | |||
| 217 | /* Commands understood by cmd_buffer ioctl for R300. | ||
| 218 | * The interface has not been stabilized, so some of these may be removed | ||
| 219 | * and eventually reordered before stabilization. | ||
| 220 | */ | ||
| 221 | #define R300_CMD_PACKET0 1 | ||
| 222 | #define R300_CMD_VPU 2 /* emit vertex program upload */ | ||
| 223 | #define R300_CMD_PACKET3 3 /* emit a packet3 */ | ||
| 224 | #define R300_CMD_END3D 4 /* emit sequence ending 3d rendering */ | ||
| 225 | #define R300_CMD_CP_DELAY 5 | ||
| 226 | #define R300_CMD_DMA_DISCARD 6 | ||
| 227 | #define R300_CMD_WAIT 7 | ||
| 228 | # define R300_WAIT_2D 0x1 | ||
| 229 | # define R300_WAIT_3D 0x2 | ||
| 230 | /* these two defines are DOING IT WRONG - however | ||
| 231 | * we have userspace which relies on using these. | ||
| 232 | * The wait interface is backwards compat new | ||
| 233 | * code should use the NEW_WAIT defines below | ||
| 234 | * THESE ARE NOT BIT FIELDS | ||
| 235 | */ | ||
| 236 | # define R300_WAIT_2D_CLEAN 0x3 | ||
| 237 | # define R300_WAIT_3D_CLEAN 0x4 | ||
| 238 | |||
| 239 | # define R300_NEW_WAIT_2D_3D 0x3 | ||
| 240 | # define R300_NEW_WAIT_2D_2D_CLEAN 0x4 | ||
| 241 | # define R300_NEW_WAIT_3D_3D_CLEAN 0x6 | ||
| 242 | # define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8 | ||
| 243 | |||
| 244 | #define R300_CMD_SCRATCH 8 | ||
| 245 | #define R300_CMD_R500FP 9 | ||
| 246 | |||
| 247 | typedef union { | ||
| 248 | unsigned int u; | ||
| 249 | struct { | ||
| 250 | unsigned char cmd_type, pad0, pad1, pad2; | ||
| 251 | } header; | ||
| 252 | struct { | ||
| 253 | unsigned char cmd_type, count, reglo, reghi; | ||
| 254 | } packet0; | ||
| 255 | struct { | ||
| 256 | unsigned char cmd_type, count, adrlo, adrhi; | ||
| 257 | } vpu; | ||
| 258 | struct { | ||
| 259 | unsigned char cmd_type, packet, pad0, pad1; | ||
| 260 | } packet3; | ||
| 261 | struct { | ||
| 262 | unsigned char cmd_type, packet; | ||
| 263 | unsigned short count; /* amount of packet2 to emit */ | ||
| 264 | } delay; | ||
| 265 | struct { | ||
| 266 | unsigned char cmd_type, buf_idx, pad0, pad1; | ||
| 267 | } dma; | ||
| 268 | struct { | ||
| 269 | unsigned char cmd_type, flags, pad0, pad1; | ||
| 270 | } wait; | ||
| 271 | struct { | ||
| 272 | unsigned char cmd_type, reg, n_bufs, flags; | ||
| 273 | } scratch; | ||
| 274 | struct { | ||
| 275 | unsigned char cmd_type, count, adrlo, adrhi_flags; | ||
| 276 | } r500fp; | ||
| 277 | } drm_r300_cmd_header_t; | ||
| 278 | |||
| 279 | #define RADEON_FRONT 0x1 | ||
| 280 | #define RADEON_BACK 0x2 | ||
| 281 | #define RADEON_DEPTH 0x4 | ||
| 282 | #define RADEON_STENCIL 0x8 | ||
| 283 | #define RADEON_CLEAR_FASTZ 0x80000000 | ||
| 284 | #define RADEON_USE_HIERZ 0x40000000 | ||
| 285 | #define RADEON_USE_COMP_ZBUF 0x20000000 | ||
| 286 | |||
| 287 | #define R500FP_CONSTANT_TYPE (1 << 1) | ||
| 288 | #define R500FP_CONSTANT_CLAMP (1 << 2) | ||
| 289 | |||
| 290 | /* Primitive types | ||
| 291 | */ | ||
| 292 | #define RADEON_POINTS 0x1 | ||
| 293 | #define RADEON_LINES 0x2 | ||
| 294 | #define RADEON_LINE_STRIP 0x3 | ||
| 295 | #define RADEON_TRIANGLES 0x4 | ||
| 296 | #define RADEON_TRIANGLE_FAN 0x5 | ||
| 297 | #define RADEON_TRIANGLE_STRIP 0x6 | ||
| 298 | |||
| 299 | /* Vertex/indirect buffer size | ||
| 300 | */ | ||
| 301 | #define RADEON_BUFFER_SIZE 65536 | ||
| 302 | |||
| 303 | /* Byte offsets for indirect buffer data | ||
| 304 | */ | ||
| 305 | #define RADEON_INDEX_PRIM_OFFSET 20 | ||
| 306 | |||
| 307 | #define RADEON_SCRATCH_REG_OFFSET 32 | ||
| 308 | |||
| 309 | #define R600_SCRATCH_REG_OFFSET 256 | ||
| 310 | |||
| 311 | #define RADEON_NR_SAREA_CLIPRECTS 12 | ||
| 312 | |||
| 313 | /* There are 2 heaps (local/GART). Each region within a heap is a | ||
| 314 | * minimum of 64k, and there are at most 64 of them per heap. | ||
| 315 | */ | ||
| 316 | #define RADEON_LOCAL_TEX_HEAP 0 | ||
| 317 | #define RADEON_GART_TEX_HEAP 1 | ||
| 318 | #define RADEON_NR_TEX_HEAPS 2 | ||
| 319 | #define RADEON_NR_TEX_REGIONS 64 | ||
| 320 | #define RADEON_LOG_TEX_GRANULARITY 16 | ||
| 321 | |||
| 322 | #define RADEON_MAX_TEXTURE_LEVELS 12 | ||
| 323 | #define RADEON_MAX_TEXTURE_UNITS 3 | ||
| 324 | |||
| 325 | #define RADEON_MAX_SURFACES 8 | ||
| 326 | |||
| 327 | /* Blits have strict offset rules. All blit offset must be aligned on | ||
| 328 | * a 1K-byte boundary. | ||
| 329 | */ | ||
| 330 | #define RADEON_OFFSET_SHIFT 10 | ||
| 331 | #define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT) | ||
| 332 | #define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1) | ||
| 333 | |||
| 334 | #endif /* __RADEON_SAREA_DEFINES__ */ | ||
| 335 | |||
| 336 | typedef struct { | ||
| 337 | unsigned int red; | ||
| 338 | unsigned int green; | ||
| 339 | unsigned int blue; | ||
| 340 | unsigned int alpha; | ||
| 341 | } radeon_color_regs_t; | ||
| 342 | |||
| 343 | typedef struct { | ||
| 344 | /* Context state */ | ||
| 345 | unsigned int pp_misc; /* 0x1c14 */ | ||
| 346 | unsigned int pp_fog_color; | ||
| 347 | unsigned int re_solid_color; | ||
| 348 | unsigned int rb3d_blendcntl; | ||
| 349 | unsigned int rb3d_depthoffset; | ||
| 350 | unsigned int rb3d_depthpitch; | ||
| 351 | unsigned int rb3d_zstencilcntl; | ||
| 352 | |||
| 353 | unsigned int pp_cntl; /* 0x1c38 */ | ||
| 354 | unsigned int rb3d_cntl; | ||
| 355 | unsigned int rb3d_coloroffset; | ||
| 356 | unsigned int re_width_height; | ||
| 357 | unsigned int rb3d_colorpitch; | ||
| 358 | unsigned int se_cntl; | ||
| 359 | |||
| 360 | /* Vertex format state */ | ||
| 361 | unsigned int se_coord_fmt; /* 0x1c50 */ | ||
| 362 | |||
| 363 | /* Line state */ | ||
| 364 | unsigned int re_line_pattern; /* 0x1cd0 */ | ||
| 365 | unsigned int re_line_state; | ||
| 366 | |||
| 367 | unsigned int se_line_width; /* 0x1db8 */ | ||
| 368 | |||
| 369 | /* Bumpmap state */ | ||
| 370 | unsigned int pp_lum_matrix; /* 0x1d00 */ | ||
| 371 | |||
| 372 | unsigned int pp_rot_matrix_0; /* 0x1d58 */ | ||
| 373 | unsigned int pp_rot_matrix_1; | ||
| 374 | |||
| 375 | /* Mask state */ | ||
| 376 | unsigned int rb3d_stencilrefmask; /* 0x1d7c */ | ||
| 377 | unsigned int rb3d_ropcntl; | ||
| 378 | unsigned int rb3d_planemask; | ||
| 379 | |||
| 380 | /* Viewport state */ | ||
| 381 | unsigned int se_vport_xscale; /* 0x1d98 */ | ||
| 382 | unsigned int se_vport_xoffset; | ||
| 383 | unsigned int se_vport_yscale; | ||
| 384 | unsigned int se_vport_yoffset; | ||
| 385 | unsigned int se_vport_zscale; | ||
| 386 | unsigned int se_vport_zoffset; | ||
| 387 | |||
| 388 | /* Setup state */ | ||
| 389 | unsigned int se_cntl_status; /* 0x2140 */ | ||
| 390 | |||
| 391 | /* Misc state */ | ||
| 392 | unsigned int re_top_left; /* 0x26c0 */ | ||
| 393 | unsigned int re_misc; | ||
| 394 | } drm_radeon_context_regs_t; | ||
| 395 | |||
| 396 | typedef struct { | ||
| 397 | /* Zbias state */ | ||
| 398 | unsigned int se_zbias_factor; /* 0x1dac */ | ||
| 399 | unsigned int se_zbias_constant; | ||
| 400 | } drm_radeon_context2_regs_t; | ||
| 401 | |||
| 402 | /* Setup registers for each texture unit | ||
| 403 | */ | ||
| 404 | typedef struct { | ||
| 405 | unsigned int pp_txfilter; | ||
| 406 | unsigned int pp_txformat; | ||
| 407 | unsigned int pp_txoffset; | ||
| 408 | unsigned int pp_txcblend; | ||
| 409 | unsigned int pp_txablend; | ||
| 410 | unsigned int pp_tfactor; | ||
| 411 | unsigned int pp_border_color; | ||
| 412 | } drm_radeon_texture_regs_t; | ||
| 413 | |||
| 414 | typedef struct { | ||
| 415 | unsigned int start; | ||
| 416 | unsigned int finish; | ||
| 417 | unsigned int prim:8; | ||
| 418 | unsigned int stateidx:8; | ||
| 419 | unsigned int numverts:16; /* overloaded as offset/64 for elt prims */ | ||
| 420 | unsigned int vc_format; /* vertex format */ | ||
| 421 | } drm_radeon_prim_t; | ||
| 422 | |||
| 423 | typedef struct { | ||
| 424 | drm_radeon_context_regs_t context; | ||
| 425 | drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS]; | ||
| 426 | drm_radeon_context2_regs_t context2; | ||
| 427 | unsigned int dirty; | ||
| 428 | } drm_radeon_state_t; | ||
| 429 | |||
| 430 | typedef struct { | ||
| 431 | /* The channel for communication of state information to the | ||
| 432 | * kernel on firing a vertex buffer with either of the | ||
| 433 | * obsoleted vertex/index ioctls. | ||
| 434 | */ | ||
| 435 | drm_radeon_context_regs_t context_state; | ||
| 436 | drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS]; | ||
| 437 | unsigned int dirty; | ||
| 438 | unsigned int vertsize; | ||
| 439 | unsigned int vc_format; | ||
| 440 | |||
| 441 | /* The current cliprects, or a subset thereof. | ||
| 442 | */ | ||
| 443 | struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS]; | ||
| 444 | unsigned int nbox; | ||
| 445 | |||
| 446 | /* Counters for client-side throttling of rendering clients. | ||
| 447 | */ | ||
| 448 | unsigned int last_frame; | ||
| 449 | unsigned int last_dispatch; | ||
| 450 | unsigned int last_clear; | ||
| 451 | |||
| 452 | struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS + | ||
| 453 | 1]; | ||
| 454 | unsigned int tex_age[RADEON_NR_TEX_HEAPS]; | ||
| 455 | int ctx_owner; | ||
| 456 | int pfState; /* number of 3d windows (0,1,2ormore) */ | ||
| 457 | int pfCurrentPage; /* which buffer is being displayed? */ | ||
| 458 | int crtc2_base; /* CRTC2 frame offset */ | ||
| 459 | int tiling_enabled; /* set by drm, read by 2d + 3d clients */ | ||
| 460 | } drm_radeon_sarea_t; | ||
| 461 | |||
| 462 | /* WARNING: If you change any of these defines, make sure to change the | ||
| 463 | * defines in the Xserver file (xf86drmRadeon.h) | ||
| 464 | * | ||
| 465 | * KW: actually it's illegal to change any of this (backwards compatibility). | ||
| 466 | */ | ||
| 467 | |||
| 468 | /* Radeon specific ioctls | ||
| 469 | * The device specific ioctl range is 0x40 to 0x79. | ||
| 470 | */ | ||
| 471 | #define DRM_RADEON_CP_INIT 0x00 | ||
| 472 | #define DRM_RADEON_CP_START 0x01 | ||
| 473 | #define DRM_RADEON_CP_STOP 0x02 | ||
| 474 | #define DRM_RADEON_CP_RESET 0x03 | ||
| 475 | #define DRM_RADEON_CP_IDLE 0x04 | ||
| 476 | #define DRM_RADEON_RESET 0x05 | ||
| 477 | #define DRM_RADEON_FULLSCREEN 0x06 | ||
| 478 | #define DRM_RADEON_SWAP 0x07 | ||
| 479 | #define DRM_RADEON_CLEAR 0x08 | ||
| 480 | #define DRM_RADEON_VERTEX 0x09 | ||
| 481 | #define DRM_RADEON_INDICES 0x0A | ||
| 482 | #define DRM_RADEON_NOT_USED | ||
| 483 | #define DRM_RADEON_STIPPLE 0x0C | ||
| 484 | #define DRM_RADEON_INDIRECT 0x0D | ||
| 485 | #define DRM_RADEON_TEXTURE 0x0E | ||
| 486 | #define DRM_RADEON_VERTEX2 0x0F | ||
| 487 | #define DRM_RADEON_CMDBUF 0x10 | ||
| 488 | #define DRM_RADEON_GETPARAM 0x11 | ||
| 489 | #define DRM_RADEON_FLIP 0x12 | ||
| 490 | #define DRM_RADEON_ALLOC 0x13 | ||
| 491 | #define DRM_RADEON_FREE 0x14 | ||
| 492 | #define DRM_RADEON_INIT_HEAP 0x15 | ||
| 493 | #define DRM_RADEON_IRQ_EMIT 0x16 | ||
| 494 | #define DRM_RADEON_IRQ_WAIT 0x17 | ||
| 495 | #define DRM_RADEON_CP_RESUME 0x18 | ||
| 496 | #define DRM_RADEON_SETPARAM 0x19 | ||
| 497 | #define DRM_RADEON_SURF_ALLOC 0x1a | ||
| 498 | #define DRM_RADEON_SURF_FREE 0x1b | ||
| 499 | /* KMS ioctl */ | ||
| 500 | #define DRM_RADEON_GEM_INFO 0x1c | ||
| 501 | #define DRM_RADEON_GEM_CREATE 0x1d | ||
| 502 | #define DRM_RADEON_GEM_MMAP 0x1e | ||
| 503 | #define DRM_RADEON_GEM_PREAD 0x21 | ||
| 504 | #define DRM_RADEON_GEM_PWRITE 0x22 | ||
| 505 | #define DRM_RADEON_GEM_SET_DOMAIN 0x23 | ||
| 506 | #define DRM_RADEON_GEM_WAIT_IDLE 0x24 | ||
| 507 | #define DRM_RADEON_CS 0x26 | ||
| 508 | #define DRM_RADEON_INFO 0x27 | ||
| 509 | #define DRM_RADEON_GEM_SET_TILING 0x28 | ||
| 510 | #define DRM_RADEON_GEM_GET_TILING 0x29 | ||
| 511 | #define DRM_RADEON_GEM_BUSY 0x2a | ||
| 512 | #define DRM_RADEON_GEM_VA 0x2b | ||
| 513 | |||
| 514 | #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) | ||
| 515 | #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) | ||
| 516 | #define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t) | ||
| 517 | #define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET) | ||
| 518 | #define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE) | ||
| 519 | #define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET) | ||
| 520 | #define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t) | ||
| 521 | #define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP) | ||
| 522 | #define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t) | ||
| 523 | #define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t) | ||
| 524 | #define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t) | ||
| 525 | #define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t) | ||
| 526 | #define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t) | ||
| 527 | #define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t) | ||
| 528 | #define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t) | ||
| 529 | #define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t) | ||
| 530 | #define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t) | ||
| 531 | #define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP) | ||
| 532 | #define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t) | ||
| 533 | #define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t) | ||
| 534 | #define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t) | ||
| 535 | #define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t) | ||
| 536 | #define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t) | ||
| 537 | #define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME) | ||
| 538 | #define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t) | ||
| 539 | #define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t) | ||
| 540 | #define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t) | ||
| 541 | /* KMS */ | ||
| 542 | #define DRM_IOCTL_RADEON_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info) | ||
| 543 | #define DRM_IOCTL_RADEON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create) | ||
| 544 | #define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap) | ||
| 545 | #define DRM_IOCTL_RADEON_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread) | ||
| 546 | #define DRM_IOCTL_RADEON_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite) | ||
| 547 | #define DRM_IOCTL_RADEON_GEM_SET_DOMAIN DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain) | ||
| 548 | #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) | ||
| 549 | #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) | ||
| 550 | #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) | ||
| 551 | #define DRM_IOCTL_RADEON_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling) | ||
| 552 | #define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling) | ||
| 553 | #define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy) | ||
| 554 | #define DRM_IOCTL_RADEON_GEM_VA DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_VA, struct drm_radeon_gem_va) | ||
| 555 | |||
| 556 | typedef struct drm_radeon_init { | ||
| 557 | enum { | ||
| 558 | RADEON_INIT_CP = 0x01, | ||
| 559 | RADEON_CLEANUP_CP = 0x02, | ||
| 560 | RADEON_INIT_R200_CP = 0x03, | ||
| 561 | RADEON_INIT_R300_CP = 0x04, | ||
| 562 | RADEON_INIT_R600_CP = 0x05 | ||
| 563 | } func; | ||
| 564 | unsigned long sarea_priv_offset; | ||
| 565 | int is_pci; | ||
| 566 | int cp_mode; | ||
| 567 | int gart_size; | ||
| 568 | int ring_size; | ||
| 569 | int usec_timeout; | ||
| 570 | |||
| 571 | unsigned int fb_bpp; | ||
| 572 | unsigned int front_offset, front_pitch; | ||
| 573 | unsigned int back_offset, back_pitch; | ||
| 574 | unsigned int depth_bpp; | ||
| 575 | unsigned int depth_offset, depth_pitch; | ||
| 576 | |||
| 577 | unsigned long fb_offset; | ||
| 578 | unsigned long mmio_offset; | ||
| 579 | unsigned long ring_offset; | ||
| 580 | unsigned long ring_rptr_offset; | ||
| 581 | unsigned long buffers_offset; | ||
| 582 | unsigned long gart_textures_offset; | ||
| 583 | } drm_radeon_init_t; | ||
| 584 | |||
| 585 | typedef struct drm_radeon_cp_stop { | ||
| 586 | int flush; | ||
| 587 | int idle; | ||
| 588 | } drm_radeon_cp_stop_t; | ||
| 589 | |||
| 590 | typedef struct drm_radeon_fullscreen { | ||
| 591 | enum { | ||
| 592 | RADEON_INIT_FULLSCREEN = 0x01, | ||
| 593 | RADEON_CLEANUP_FULLSCREEN = 0x02 | ||
| 594 | } func; | ||
| 595 | } drm_radeon_fullscreen_t; | ||
| 596 | |||
| 597 | #define CLEAR_X1 0 | ||
| 598 | #define CLEAR_Y1 1 | ||
| 599 | #define CLEAR_X2 2 | ||
| 600 | #define CLEAR_Y2 3 | ||
| 601 | #define CLEAR_DEPTH 4 | ||
| 602 | |||
| 603 | typedef union drm_radeon_clear_rect { | ||
| 604 | float f[5]; | ||
| 605 | unsigned int ui[5]; | ||
| 606 | } drm_radeon_clear_rect_t; | ||
| 607 | |||
| 608 | typedef struct drm_radeon_clear { | ||
| 609 | unsigned int flags; | ||
| 610 | unsigned int clear_color; | ||
| 611 | unsigned int clear_depth; | ||
| 612 | unsigned int color_mask; | ||
| 613 | unsigned int depth_mask; /* misnamed field: should be stencil */ | ||
| 614 | drm_radeon_clear_rect_t __user *depth_boxes; | ||
| 615 | } drm_radeon_clear_t; | ||
| 616 | |||
| 617 | typedef struct drm_radeon_vertex { | ||
| 618 | int prim; | ||
| 619 | int idx; /* Index of vertex buffer */ | ||
| 620 | int count; /* Number of vertices in buffer */ | ||
| 621 | int discard; /* Client finished with buffer? */ | ||
| 622 | } drm_radeon_vertex_t; | ||
| 623 | |||
| 624 | typedef struct drm_radeon_indices { | ||
| 625 | int prim; | ||
| 626 | int idx; | ||
| 627 | int start; | ||
| 628 | int end; | ||
| 629 | int discard; /* Client finished with buffer? */ | ||
| 630 | } drm_radeon_indices_t; | ||
| 631 | |||
| 632 | /* v1.2 - obsoletes drm_radeon_vertex and drm_radeon_indices | ||
| 633 | * - allows multiple primitives and state changes in a single ioctl | ||
| 634 | * - supports driver change to emit native primitives | ||
| 635 | */ | ||
| 636 | typedef struct drm_radeon_vertex2 { | ||
| 637 | int idx; /* Index of vertex buffer */ | ||
| 638 | int discard; /* Client finished with buffer? */ | ||
| 639 | int nr_states; | ||
| 640 | drm_radeon_state_t __user *state; | ||
| 641 | int nr_prims; | ||
| 642 | drm_radeon_prim_t __user *prim; | ||
| 643 | } drm_radeon_vertex2_t; | ||
| 644 | |||
| 645 | /* v1.3 - obsoletes drm_radeon_vertex2 | ||
| 646 | * - allows arbitrarily large cliprect list | ||
| 647 | * - allows updating of tcl packet, vector and scalar state | ||
| 648 | * - allows memory-efficient description of state updates | ||
| 649 | * - allows state to be emitted without a primitive | ||
| 650 | * (for clears, ctx switches) | ||
| 651 | * - allows more than one dma buffer to be referenced per ioctl | ||
| 652 | * - supports tcl driver | ||
| 653 | * - may be extended in future versions with new cmd types, packets | ||
| 654 | */ | ||
| 655 | typedef struct drm_radeon_cmd_buffer { | ||
| 656 | int bufsz; | ||
| 657 | char __user *buf; | ||
| 658 | int nbox; | ||
| 659 | struct drm_clip_rect __user *boxes; | ||
| 660 | } drm_radeon_cmd_buffer_t; | ||
| 661 | |||
| 662 | typedef struct drm_radeon_tex_image { | ||
| 663 | unsigned int x, y; /* Blit coordinates */ | ||
| 664 | unsigned int width, height; | ||
| 665 | const void __user *data; | ||
| 666 | } drm_radeon_tex_image_t; | ||
| 667 | |||
| 668 | typedef struct drm_radeon_texture { | ||
| 669 | unsigned int offset; | ||
| 670 | int pitch; | ||
| 671 | int format; | ||
| 672 | int width; /* Texture image coordinates */ | ||
| 673 | int height; | ||
| 674 | drm_radeon_tex_image_t __user *image; | ||
| 675 | } drm_radeon_texture_t; | ||
| 676 | |||
| 677 | typedef struct drm_radeon_stipple { | ||
| 678 | unsigned int __user *mask; | ||
| 679 | } drm_radeon_stipple_t; | ||
| 680 | |||
| 681 | typedef struct drm_radeon_indirect { | ||
| 682 | int idx; | ||
| 683 | int start; | ||
| 684 | int end; | ||
| 685 | int discard; | ||
| 686 | } drm_radeon_indirect_t; | ||
| 687 | |||
| 688 | /* enum for card type parameters */ | ||
| 689 | #define RADEON_CARD_PCI 0 | ||
| 690 | #define RADEON_CARD_AGP 1 | ||
| 691 | #define RADEON_CARD_PCIE 2 | ||
| 692 | |||
| 693 | /* 1.3: An ioctl to get parameters that aren't available to the 3d | ||
| 694 | * client any other way. | ||
| 695 | */ | ||
| 696 | #define RADEON_PARAM_GART_BUFFER_OFFSET 1 /* card offset of 1st GART buffer */ | ||
| 697 | #define RADEON_PARAM_LAST_FRAME 2 | ||
| 698 | #define RADEON_PARAM_LAST_DISPATCH 3 | ||
| 699 | #define RADEON_PARAM_LAST_CLEAR 4 | ||
| 700 | /* Added with DRM version 1.6. */ | ||
| 701 | #define RADEON_PARAM_IRQ_NR 5 | ||
| 702 | #define RADEON_PARAM_GART_BASE 6 /* card offset of GART base */ | ||
| 703 | /* Added with DRM version 1.8. */ | ||
| 704 | #define RADEON_PARAM_REGISTER_HANDLE 7 /* for drmMap() */ | ||
| 705 | #define RADEON_PARAM_STATUS_HANDLE 8 | ||
| 706 | #define RADEON_PARAM_SAREA_HANDLE 9 | ||
| 707 | #define RADEON_PARAM_GART_TEX_HANDLE 10 | ||
| 708 | #define RADEON_PARAM_SCRATCH_OFFSET 11 | ||
| 709 | #define RADEON_PARAM_CARD_TYPE 12 | ||
| 710 | #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */ | ||
| 711 | #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ | ||
| 712 | #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ | ||
| 713 | #define RADEON_PARAM_DEVICE_ID 16 | ||
| 714 | #define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */ | ||
| 715 | |||
| 716 | typedef struct drm_radeon_getparam { | ||
| 717 | int param; | ||
| 718 | void __user *value; | ||
| 719 | } drm_radeon_getparam_t; | ||
| 720 | |||
| 721 | /* 1.6: Set up a memory manager for regions of shared memory: | ||
| 722 | */ | ||
| 723 | #define RADEON_MEM_REGION_GART 1 | ||
| 724 | #define RADEON_MEM_REGION_FB 2 | ||
| 725 | |||
| 726 | typedef struct drm_radeon_mem_alloc { | ||
| 727 | int region; | ||
| 728 | int alignment; | ||
| 729 | int size; | ||
| 730 | int __user *region_offset; /* offset from start of fb or GART */ | ||
| 731 | } drm_radeon_mem_alloc_t; | ||
| 732 | |||
| 733 | typedef struct drm_radeon_mem_free { | ||
| 734 | int region; | ||
| 735 | int region_offset; | ||
| 736 | } drm_radeon_mem_free_t; | ||
| 737 | |||
| 738 | typedef struct drm_radeon_mem_init_heap { | ||
| 739 | int region; | ||
| 740 | int size; | ||
| 741 | int start; | ||
| 742 | } drm_radeon_mem_init_heap_t; | ||
| 743 | |||
| 744 | /* 1.6: Userspace can request & wait on irq's: | ||
| 745 | */ | ||
| 746 | typedef struct drm_radeon_irq_emit { | ||
| 747 | int __user *irq_seq; | ||
| 748 | } drm_radeon_irq_emit_t; | ||
| 749 | |||
| 750 | typedef struct drm_radeon_irq_wait { | ||
| 751 | int irq_seq; | ||
| 752 | } drm_radeon_irq_wait_t; | ||
| 753 | |||
| 754 | /* 1.10: Clients tell the DRM where they think the framebuffer is located in | ||
| 755 | * the card's address space, via a new generic ioctl to set parameters | ||
| 756 | */ | ||
| 757 | |||
| 758 | typedef struct drm_radeon_setparam { | ||
| 759 | unsigned int param; | ||
| 760 | __s64 value; | ||
| 761 | } drm_radeon_setparam_t; | ||
| 762 | |||
| 763 | #define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */ | ||
| 764 | #define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */ | ||
| 765 | #define RADEON_SETPARAM_PCIGART_LOCATION 3 /* PCI Gart Location */ | ||
| 766 | #define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */ | ||
| 767 | #define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */ | ||
| 768 | #define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */ | ||
| 769 | /* 1.14: Clients can allocate/free a surface | ||
| 770 | */ | ||
| 771 | typedef struct drm_radeon_surface_alloc { | ||
| 772 | unsigned int address; | ||
| 773 | unsigned int size; | ||
| 774 | unsigned int flags; | ||
| 775 | } drm_radeon_surface_alloc_t; | ||
| 776 | |||
| 777 | typedef struct drm_radeon_surface_free { | ||
| 778 | unsigned int address; | ||
| 779 | } drm_radeon_surface_free_t; | ||
| 780 | |||
| 781 | #define DRM_RADEON_VBLANK_CRTC1 1 | ||
| 782 | #define DRM_RADEON_VBLANK_CRTC2 2 | ||
| 783 | |||
| 784 | /* | ||
| 785 | * Kernel modesetting world below. | ||
| 786 | */ | ||
| 787 | #define RADEON_GEM_DOMAIN_CPU 0x1 | ||
| 788 | #define RADEON_GEM_DOMAIN_GTT 0x2 | ||
| 789 | #define RADEON_GEM_DOMAIN_VRAM 0x4 | ||
| 790 | |||
| 791 | struct drm_radeon_gem_info { | ||
| 792 | uint64_t gart_size; | ||
| 793 | uint64_t vram_size; | ||
| 794 | uint64_t vram_visible; | ||
| 795 | }; | ||
| 796 | |||
| 797 | #define RADEON_GEM_NO_BACKING_STORE 1 | ||
| 798 | |||
| 799 | struct drm_radeon_gem_create { | ||
| 800 | uint64_t size; | ||
| 801 | uint64_t alignment; | ||
| 802 | uint32_t handle; | ||
| 803 | uint32_t initial_domain; | ||
| 804 | uint32_t flags; | ||
| 805 | }; | ||
| 806 | |||
| 807 | #define RADEON_TILING_MACRO 0x1 | ||
| 808 | #define RADEON_TILING_MICRO 0x2 | ||
| 809 | #define RADEON_TILING_SWAP_16BIT 0x4 | ||
| 810 | #define RADEON_TILING_SWAP_32BIT 0x8 | ||
| 811 | /* this object requires a surface when mapped - i.e. front buffer */ | ||
| 812 | #define RADEON_TILING_SURFACE 0x10 | ||
| 813 | #define RADEON_TILING_MICRO_SQUARE 0x20 | ||
| 814 | #define RADEON_TILING_EG_BANKW_SHIFT 8 | ||
| 815 | #define RADEON_TILING_EG_BANKW_MASK 0xf | ||
| 816 | #define RADEON_TILING_EG_BANKH_SHIFT 12 | ||
| 817 | #define RADEON_TILING_EG_BANKH_MASK 0xf | ||
| 818 | #define RADEON_TILING_EG_MACRO_TILE_ASPECT_SHIFT 16 | ||
| 819 | #define RADEON_TILING_EG_MACRO_TILE_ASPECT_MASK 0xf | ||
| 820 | #define RADEON_TILING_EG_TILE_SPLIT_SHIFT 24 | ||
| 821 | #define RADEON_TILING_EG_TILE_SPLIT_MASK 0xf | ||
| 822 | #define RADEON_TILING_EG_STENCIL_TILE_SPLIT_SHIFT 28 | ||
| 823 | #define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf | ||
| 824 | |||
| 825 | struct drm_radeon_gem_set_tiling { | ||
| 826 | uint32_t handle; | ||
| 827 | uint32_t tiling_flags; | ||
| 828 | uint32_t pitch; | ||
| 829 | }; | ||
| 830 | |||
| 831 | struct drm_radeon_gem_get_tiling { | ||
| 832 | uint32_t handle; | ||
| 833 | uint32_t tiling_flags; | ||
| 834 | uint32_t pitch; | ||
| 835 | }; | ||
| 836 | |||
| 837 | struct drm_radeon_gem_mmap { | ||
| 838 | uint32_t handle; | ||
| 839 | uint32_t pad; | ||
| 840 | uint64_t offset; | ||
| 841 | uint64_t size; | ||
| 842 | uint64_t addr_ptr; | ||
| 843 | }; | ||
| 844 | |||
| 845 | struct drm_radeon_gem_set_domain { | ||
| 846 | uint32_t handle; | ||
| 847 | uint32_t read_domains; | ||
| 848 | uint32_t write_domain; | ||
| 849 | }; | ||
| 850 | |||
| 851 | struct drm_radeon_gem_wait_idle { | ||
| 852 | uint32_t handle; | ||
| 853 | uint32_t pad; | ||
| 854 | }; | ||
| 855 | |||
| 856 | struct drm_radeon_gem_busy { | ||
| 857 | uint32_t handle; | ||
| 858 | uint32_t domain; | ||
| 859 | }; | ||
| 860 | |||
| 861 | struct drm_radeon_gem_pread { | ||
| 862 | /** Handle for the object being read. */ | ||
| 863 | uint32_t handle; | ||
| 864 | uint32_t pad; | ||
| 865 | /** Offset into the object to read from */ | ||
| 866 | uint64_t offset; | ||
| 867 | /** Length of data to read */ | ||
| 868 | uint64_t size; | ||
| 869 | /** Pointer to write the data into. */ | ||
| 870 | /* void *, but pointers are not 32/64 compatible */ | ||
| 871 | uint64_t data_ptr; | ||
| 872 | }; | ||
| 873 | |||
| 874 | struct drm_radeon_gem_pwrite { | ||
| 875 | /** Handle for the object being written to. */ | ||
| 876 | uint32_t handle; | ||
| 877 | uint32_t pad; | ||
| 878 | /** Offset into the object to write to */ | ||
| 879 | uint64_t offset; | ||
| 880 | /** Length of data to write */ | ||
| 881 | uint64_t size; | ||
| 882 | /** Pointer to read the data from. */ | ||
| 883 | /* void *, but pointers are not 32/64 compatible */ | ||
| 884 | uint64_t data_ptr; | ||
| 885 | }; | ||
| 886 | |||
| 887 | #define RADEON_VA_MAP 1 | ||
| 888 | #define RADEON_VA_UNMAP 2 | ||
| 889 | |||
| 890 | #define RADEON_VA_RESULT_OK 0 | ||
| 891 | #define RADEON_VA_RESULT_ERROR 1 | ||
| 892 | #define RADEON_VA_RESULT_VA_EXIST 2 | ||
| 893 | |||
| 894 | #define RADEON_VM_PAGE_VALID (1 << 0) | ||
| 895 | #define RADEON_VM_PAGE_READABLE (1 << 1) | ||
| 896 | #define RADEON_VM_PAGE_WRITEABLE (1 << 2) | ||
| 897 | #define RADEON_VM_PAGE_SYSTEM (1 << 3) | ||
| 898 | #define RADEON_VM_PAGE_SNOOPED (1 << 4) | ||
| 899 | |||
| 900 | struct drm_radeon_gem_va { | ||
| 901 | uint32_t handle; | ||
| 902 | uint32_t operation; | ||
| 903 | uint32_t vm_id; | ||
| 904 | uint32_t flags; | ||
| 905 | uint64_t offset; | ||
| 906 | }; | ||
| 907 | |||
| 908 | #define RADEON_CHUNK_ID_RELOCS 0x01 | ||
| 909 | #define RADEON_CHUNK_ID_IB 0x02 | ||
| 910 | #define RADEON_CHUNK_ID_FLAGS 0x03 | ||
| 911 | #define RADEON_CHUNK_ID_CONST_IB 0x04 | ||
| 912 | |||
| 913 | /* The first dword of RADEON_CHUNK_ID_FLAGS is a uint32 of these flags: */ | ||
| 914 | #define RADEON_CS_KEEP_TILING_FLAGS 0x01 | ||
| 915 | #define RADEON_CS_USE_VM 0x02 | ||
| 916 | /* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */ | ||
| 917 | #define RADEON_CS_RING_GFX 0 | ||
| 918 | #define RADEON_CS_RING_COMPUTE 1 | ||
| 919 | /* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */ | ||
| 920 | /* 0 = normal, + = higher priority, - = lower priority */ | ||
| 921 | |||
| 922 | struct drm_radeon_cs_chunk { | ||
| 923 | uint32_t chunk_id; | ||
| 924 | uint32_t length_dw; | ||
| 925 | uint64_t chunk_data; | ||
| 926 | }; | ||
| 927 | |||
| 928 | /* drm_radeon_cs_reloc.flags */ | ||
| 929 | |||
| 930 | struct drm_radeon_cs_reloc { | ||
| 931 | uint32_t handle; | ||
| 932 | uint32_t read_domains; | ||
| 933 | uint32_t write_domain; | ||
| 934 | uint32_t flags; | ||
| 935 | }; | ||
| 936 | |||
| 937 | struct drm_radeon_cs { | ||
| 938 | uint32_t num_chunks; | ||
| 939 | uint32_t cs_id; | ||
| 940 | /* this points to uint64_t * which point to cs chunks */ | ||
| 941 | uint64_t chunks; | ||
| 942 | /* updates to the limits after this CS ioctl */ | ||
| 943 | uint64_t gart_limit; | ||
| 944 | uint64_t vram_limit; | ||
| 945 | }; | ||
| 946 | |||
| 947 | #define RADEON_INFO_DEVICE_ID 0x00 | ||
| 948 | #define RADEON_INFO_NUM_GB_PIPES 0x01 | ||
| 949 | #define RADEON_INFO_NUM_Z_PIPES 0x02 | ||
| 950 | #define RADEON_INFO_ACCEL_WORKING 0x03 | ||
| 951 | #define RADEON_INFO_CRTC_FROM_ID 0x04 | ||
| 952 | #define RADEON_INFO_ACCEL_WORKING2 0x05 | ||
| 953 | #define RADEON_INFO_TILING_CONFIG 0x06 | ||
| 954 | #define RADEON_INFO_WANT_HYPERZ 0x07 | ||
| 955 | #define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */ | ||
| 956 | #define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */ | ||
| 957 | #define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */ | ||
| 958 | #define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */ | ||
| 959 | #define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */ | ||
| 960 | #define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */ | ||
| 961 | /* virtual address start, va < start are reserved by the kernel */ | ||
| 962 | #define RADEON_INFO_VA_START 0x0e | ||
| 963 | /* maximum size of ib using the virtual memory cs */ | ||
| 964 | #define RADEON_INFO_IB_VM_MAX_SIZE 0x0f | ||
| 965 | /* max pipes - needed for compute shaders */ | ||
| 966 | #define RADEON_INFO_MAX_PIPES 0x10 | ||
| 967 | /* timestamp for GL_ARB_timer_query (OpenGL), returns the current GPU clock */ | ||
| 968 | #define RADEON_INFO_TIMESTAMP 0x11 | ||
| 969 | |||
| 970 | struct drm_radeon_info { | ||
| 971 | uint32_t request; | ||
| 972 | uint32_t pad; | ||
| 973 | uint64_t value; | ||
| 974 | }; | ||
| 975 | |||
| 976 | #endif | ||
| @@ -0,0 +1,210 @@ | |||
| 1 | /* savage_drm.h -- Public header for the savage driver | ||
| 2 | * | ||
| 3 | * Copyright 2004 Felix Kuehling | ||
| 4 | * All Rights Reserved. | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the "Software"), | ||
| 8 | * to deal in the Software without restriction, including without limitation | ||
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sub license, | ||
| 10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | * Software is furnished to do so, subject to the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice (including the | ||
| 14 | * next paragraph) shall be included in all copies or substantial portions | ||
| 15 | * of the Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 20 | * NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR | ||
| 21 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
| 22 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | */ | ||
| 25 | |||
| 26 | #ifndef __SAVAGE_DRM_H__ | ||
| 27 | #define __SAVAGE_DRM_H__ | ||
| 28 | |||
| 29 | #ifndef __SAVAGE_SAREA_DEFINES__ | ||
| 30 | #define __SAVAGE_SAREA_DEFINES__ | ||
| 31 | |||
| 32 | /* 2 heaps (1 for card, 1 for agp), each divided into up to 128 | ||
| 33 | * regions, subject to a minimum region size of (1<<16) == 64k. | ||
| 34 | * | ||
| 35 | * Clients may subdivide regions internally, but when sharing between | ||
| 36 | * clients, the region size is the minimum granularity. | ||
| 37 | */ | ||
| 38 | |||
| 39 | #define SAVAGE_CARD_HEAP 0 | ||
| 40 | #define SAVAGE_AGP_HEAP 1 | ||
| 41 | #define SAVAGE_NR_TEX_HEAPS 2 | ||
| 42 | #define SAVAGE_NR_TEX_REGIONS 16 | ||
| 43 | #define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16 | ||
| 44 | |||
| 45 | #endif /* __SAVAGE_SAREA_DEFINES__ */ | ||
| 46 | |||
| 47 | typedef struct _drm_savage_sarea { | ||
| 48 | /* LRU lists for texture memory in agp space and on the card. | ||
| 49 | */ | ||
| 50 | struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS + | ||
| 51 | 1]; | ||
| 52 | unsigned int texAge[SAVAGE_NR_TEX_HEAPS]; | ||
| 53 | |||
| 54 | /* Mechanism to validate card state. | ||
| 55 | */ | ||
| 56 | int ctxOwner; | ||
| 57 | } drm_savage_sarea_t, *drm_savage_sarea_ptr; | ||
| 58 | |||
| 59 | /* Savage-specific ioctls | ||
| 60 | */ | ||
| 61 | #define DRM_SAVAGE_BCI_INIT 0x00 | ||
| 62 | #define DRM_SAVAGE_BCI_CMDBUF 0x01 | ||
| 63 | #define DRM_SAVAGE_BCI_EVENT_EMIT 0x02 | ||
| 64 | #define DRM_SAVAGE_BCI_EVENT_WAIT 0x03 | ||
| 65 | |||
| 66 | #define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t) | ||
| 67 | #define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t) | ||
| 68 | #define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t) | ||
| 69 | #define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t) | ||
| 70 | |||
| 71 | #define SAVAGE_DMA_PCI 1 | ||
| 72 | #define SAVAGE_DMA_AGP 3 | ||
| 73 | typedef struct drm_savage_init { | ||
| 74 | enum { | ||
| 75 | SAVAGE_INIT_BCI = 1, | ||
| 76 | SAVAGE_CLEANUP_BCI = 2 | ||
| 77 | } func; | ||
| 78 | unsigned int sarea_priv_offset; | ||
| 79 | |||
| 80 | /* some parameters */ | ||
| 81 | unsigned int cob_size; | ||
| 82 | unsigned int bci_threshold_lo, bci_threshold_hi; | ||
| 83 | unsigned int dma_type; | ||
| 84 | |||
| 85 | /* frame buffer layout */ | ||
| 86 | unsigned int fb_bpp; | ||
| 87 | unsigned int front_offset, front_pitch; | ||
| 88 | unsigned int back_offset, back_pitch; | ||
| 89 | unsigned int depth_bpp; | ||
| 90 | unsigned int depth_offset, depth_pitch; | ||
| 91 | |||
| 92 | /* local textures */ | ||
| 93 | unsigned int texture_offset; | ||
| 94 | unsigned int texture_size; | ||
| 95 | |||
| 96 | /* physical locations of non-permanent maps */ | ||
| 97 | unsigned long status_offset; | ||
| 98 | unsigned long buffers_offset; | ||
| 99 | unsigned long agp_textures_offset; | ||
| 100 | unsigned long cmd_dma_offset; | ||
| 101 | } drm_savage_init_t; | ||
| 102 | |||
| 103 | typedef union drm_savage_cmd_header drm_savage_cmd_header_t; | ||
| 104 | typedef struct drm_savage_cmdbuf { | ||
| 105 | /* command buffer in client's address space */ | ||
| 106 | drm_savage_cmd_header_t __user *cmd_addr; | ||
| 107 | unsigned int size; /* size of the command buffer in 64bit units */ | ||
| 108 | |||
| 109 | unsigned int dma_idx; /* DMA buffer index to use */ | ||
| 110 | int discard; /* discard DMA buffer when done */ | ||
| 111 | /* vertex buffer in client's address space */ | ||
| 112 | unsigned int __user *vb_addr; | ||
| 113 | unsigned int vb_size; /* size of client vertex buffer in bytes */ | ||
| 114 | unsigned int vb_stride; /* stride of vertices in 32bit words */ | ||
| 115 | /* boxes in client's address space */ | ||
| 116 | struct drm_clip_rect __user *box_addr; | ||
| 117 | unsigned int nbox; /* number of clipping boxes */ | ||
| 118 | } drm_savage_cmdbuf_t; | ||
| 119 | |||
| 120 | #define SAVAGE_WAIT_2D 0x1 /* wait for 2D idle before updating event tag */ | ||
| 121 | #define SAVAGE_WAIT_3D 0x2 /* wait for 3D idle before updating event tag */ | ||
| 122 | #define SAVAGE_WAIT_IRQ 0x4 /* emit or wait for IRQ, not implemented yet */ | ||
| 123 | typedef struct drm_savage_event { | ||
| 124 | unsigned int count; | ||
| 125 | unsigned int flags; | ||
| 126 | } drm_savage_event_emit_t, drm_savage_event_wait_t; | ||
| 127 | |||
| 128 | /* Commands for the cmdbuf ioctl | ||
| 129 | */ | ||
| 130 | #define SAVAGE_CMD_STATE 0 /* a range of state registers */ | ||
| 131 | #define SAVAGE_CMD_DMA_PRIM 1 /* vertices from DMA buffer */ | ||
| 132 | #define SAVAGE_CMD_VB_PRIM 2 /* vertices from client vertex buffer */ | ||
| 133 | #define SAVAGE_CMD_DMA_IDX 3 /* indexed vertices from DMA buffer */ | ||
| 134 | #define SAVAGE_CMD_VB_IDX 4 /* indexed vertices client vertex buffer */ | ||
| 135 | #define SAVAGE_CMD_CLEAR 5 /* clear buffers */ | ||
| 136 | #define SAVAGE_CMD_SWAP 6 /* swap buffers */ | ||
| 137 | |||
| 138 | /* Primitive types | ||
| 139 | */ | ||
| 140 | #define SAVAGE_PRIM_TRILIST 0 /* triangle list */ | ||
| 141 | #define SAVAGE_PRIM_TRISTRIP 1 /* triangle strip */ | ||
| 142 | #define SAVAGE_PRIM_TRIFAN 2 /* triangle fan */ | ||
| 143 | #define SAVAGE_PRIM_TRILIST_201 3 /* reorder verts for correct flat | ||
| 144 | * shading on s3d */ | ||
| 145 | |||
| 146 | /* Skip flags (vertex format) | ||
| 147 | */ | ||
| 148 | #define SAVAGE_SKIP_Z 0x01 | ||
| 149 | #define SAVAGE_SKIP_W 0x02 | ||
| 150 | #define SAVAGE_SKIP_C0 0x04 | ||
| 151 | #define SAVAGE_SKIP_C1 0x08 | ||
| 152 | #define SAVAGE_SKIP_S0 0x10 | ||
| 153 | #define SAVAGE_SKIP_T0 0x20 | ||
| 154 | #define SAVAGE_SKIP_ST0 0x30 | ||
| 155 | #define SAVAGE_SKIP_S1 0x40 | ||
| 156 | #define SAVAGE_SKIP_T1 0x80 | ||
| 157 | #define SAVAGE_SKIP_ST1 0xc0 | ||
| 158 | #define SAVAGE_SKIP_ALL_S3D 0x3f | ||
| 159 | #define SAVAGE_SKIP_ALL_S4 0xff | ||
| 160 | |||
| 161 | /* Buffer names for clear command | ||
| 162 | */ | ||
| 163 | #define SAVAGE_FRONT 0x1 | ||
| 164 | #define SAVAGE_BACK 0x2 | ||
| 165 | #define SAVAGE_DEPTH 0x4 | ||
| 166 | |||
| 167 | /* 64-bit command header | ||
| 168 | */ | ||
| 169 | union drm_savage_cmd_header { | ||
| 170 | struct { | ||
| 171 | unsigned char cmd; /* command */ | ||
| 172 | unsigned char pad0; | ||
| 173 | unsigned short pad1; | ||
| 174 | unsigned short pad2; | ||
| 175 | unsigned short pad3; | ||
| 176 | } cmd; /* generic */ | ||
| 177 | struct { | ||
| 178 | unsigned char cmd; | ||
| 179 | unsigned char global; /* need idle engine? */ | ||
| 180 | unsigned short count; /* number of consecutive registers */ | ||
| 181 | unsigned short start; /* first register */ | ||
| 182 | unsigned short pad3; | ||
| 183 | } state; /* SAVAGE_CMD_STATE */ | ||
| 184 | struct { | ||
| 185 | unsigned char cmd; | ||
| 186 | unsigned char prim; /* primitive type */ | ||
| 187 | unsigned short skip; /* vertex format (skip flags) */ | ||
| 188 | unsigned short count; /* number of vertices */ | ||
| 189 | unsigned short start; /* first vertex in DMA/vertex buffer */ | ||
| 190 | } prim; /* SAVAGE_CMD_DMA_PRIM, SAVAGE_CMD_VB_PRIM */ | ||
| 191 | struct { | ||
| 192 | unsigned char cmd; | ||
| 193 | unsigned char prim; | ||
| 194 | unsigned short skip; | ||
| 195 | unsigned short count; /* number of indices that follow */ | ||
| 196 | unsigned short pad3; | ||
| 197 | } idx; /* SAVAGE_CMD_DMA_IDX, SAVAGE_CMD_VB_IDX */ | ||
| 198 | struct { | ||
| 199 | unsigned char cmd; | ||
| 200 | unsigned char pad0; | ||
| 201 | unsigned short pad1; | ||
| 202 | unsigned int flags; | ||
| 203 | } clear0; /* SAVAGE_CMD_CLEAR */ | ||
| 204 | struct { | ||
| 205 | unsigned int mask; | ||
| 206 | unsigned int value; | ||
| 207 | } clear1; /* SAVAGE_CMD_CLEAR data */ | ||
| 208 | }; | ||
| 209 | |||
| 210 | #endif | ||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* sis_drv.h -- Private header for sis driver -*- linux-c -*- */ | ||
| 2 | /* | ||
| 3 | * Copyright 2005 Eric Anholt | ||
| 4 | * All Rights Reserved. | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the "Software"), | ||
| 8 | * to deal in the Software without restriction, including without limitation | ||
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | * Software is furnished to do so, subject to the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice (including the next | ||
| 14 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 15 | * Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 23 | * SOFTWARE. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __SIS_DRM_H__ | ||
| 28 | #define __SIS_DRM_H__ | ||
| 29 | |||
| 30 | /* SiS specific ioctls */ | ||
| 31 | #define NOT_USED_0_3 | ||
| 32 | #define DRM_SIS_FB_ALLOC 0x04 | ||
| 33 | #define DRM_SIS_FB_FREE 0x05 | ||
| 34 | #define NOT_USED_6_12 | ||
| 35 | #define DRM_SIS_AGP_INIT 0x13 | ||
| 36 | #define DRM_SIS_AGP_ALLOC 0x14 | ||
| 37 | #define DRM_SIS_AGP_FREE 0x15 | ||
| 38 | #define DRM_SIS_FB_INIT 0x16 | ||
| 39 | |||
| 40 | #define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t) | ||
| 41 | #define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t) | ||
| 42 | #define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t) | ||
| 43 | #define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t) | ||
| 44 | #define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t) | ||
| 45 | #define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t) | ||
| 46 | /* | ||
| 47 | #define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t) | ||
| 48 | #define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49) | ||
| 49 | #define DRM_IOCTL_SIS_FLIP_FINAL DRM_IO( 0x50) | ||
| 50 | */ | ||
| 51 | |||
| 52 | typedef struct { | ||
| 53 | int context; | ||
| 54 | unsigned long offset; | ||
| 55 | unsigned long size; | ||
| 56 | unsigned long free; | ||
| 57 | } drm_sis_mem_t; | ||
| 58 | |||
| 59 | typedef struct { | ||
| 60 | unsigned long offset, size; | ||
| 61 | } drm_sis_agp_t; | ||
| 62 | |||
| 63 | typedef struct { | ||
| 64 | unsigned long offset, size; | ||
| 65 | } drm_sis_fb_t; | ||
| 66 | |||
| 67 | struct sis_file_private { | ||
| 68 | struct list_head obj_list; | ||
| 69 | }; | ||
| 70 | |||
| 71 | #endif /* __SIS_DRM_H__ */ | ||
| @@ -0,0 +1,281 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. | ||
| 3 | * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the "Software"), | ||
| 7 | * to deal in the Software without restriction, including without limitation | ||
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sub license, | ||
| 9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 10 | * Software is furnished to do so, subject to the following conditions: | ||
| 11 | * | ||
| 12 | * The above copyright notice and this permission notice (including the | ||
| 13 | * next paragraph) shall be included in all copies or substantial portions | ||
| 14 | * of the Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 23 | */ | ||
| 24 | #ifndef _VIA_DRM_H_ | ||
| 25 | #define _VIA_DRM_H_ | ||
| 26 | |||
| 27 | #include <drm/drm.h> | ||
| 28 | |||
| 29 | /* WARNING: These defines must be the same as what the Xserver uses. | ||
| 30 | * if you change them, you must change the defines in the Xserver. | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef _VIA_DEFINES_ | ||
| 34 | #define _VIA_DEFINES_ | ||
| 35 | |||
| 36 | #ifndef __KERNEL__ | ||
| 37 | #include "via_drmclient.h" | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #define VIA_NR_SAREA_CLIPRECTS 8 | ||
| 41 | #define VIA_NR_XVMC_PORTS 10 | ||
| 42 | #define VIA_NR_XVMC_LOCKS 5 | ||
| 43 | #define VIA_MAX_CACHELINE_SIZE 64 | ||
| 44 | #define XVMCLOCKPTR(saPriv,lockNo) \ | ||
| 45 | ((volatile struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \ | ||
| 46 | (VIA_MAX_CACHELINE_SIZE - 1)) & \ | ||
| 47 | ~(VIA_MAX_CACHELINE_SIZE - 1)) + \ | ||
| 48 | VIA_MAX_CACHELINE_SIZE*(lockNo))) | ||
| 49 | |||
| 50 | /* Each region is a minimum of 64k, and there are at most 64 of them. | ||
| 51 | */ | ||
| 52 | #define VIA_NR_TEX_REGIONS 64 | ||
| 53 | #define VIA_LOG_MIN_TEX_REGION_SIZE 16 | ||
| 54 | #endif | ||
| 55 | |||
| 56 | #define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */ | ||
| 57 | #define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */ | ||
| 58 | #define VIA_UPLOAD_CTX 0x4 | ||
| 59 | #define VIA_UPLOAD_BUFFERS 0x8 | ||
| 60 | #define VIA_UPLOAD_TEX0 0x10 | ||
| 61 | #define VIA_UPLOAD_TEX1 0x20 | ||
| 62 | #define VIA_UPLOAD_CLIPRECTS 0x40 | ||
| 63 | #define VIA_UPLOAD_ALL 0xff | ||
| 64 | |||
| 65 | /* VIA specific ioctls */ | ||
| 66 | #define DRM_VIA_ALLOCMEM 0x00 | ||
| 67 | #define DRM_VIA_FREEMEM 0x01 | ||
| 68 | #define DRM_VIA_AGP_INIT 0x02 | ||
| 69 | #define DRM_VIA_FB_INIT 0x03 | ||
| 70 | #define DRM_VIA_MAP_INIT 0x04 | ||
| 71 | #define DRM_VIA_DEC_FUTEX 0x05 | ||
| 72 | #define NOT_USED | ||
| 73 | #define DRM_VIA_DMA_INIT 0x07 | ||
| 74 | #define DRM_VIA_CMDBUFFER 0x08 | ||
| 75 | #define DRM_VIA_FLUSH 0x09 | ||
| 76 | #define DRM_VIA_PCICMD 0x0a | ||
| 77 | #define DRM_VIA_CMDBUF_SIZE 0x0b | ||
| 78 | #define NOT_USED | ||
| 79 | #define DRM_VIA_WAIT_IRQ 0x0d | ||
| 80 | #define DRM_VIA_DMA_BLIT 0x0e | ||
| 81 | #define DRM_VIA_BLIT_SYNC 0x0f | ||
| 82 | |||
| 83 | #define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t) | ||
| 84 | #define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t) | ||
| 85 | #define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t) | ||
| 86 | #define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t) | ||
| 87 | #define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t) | ||
| 88 | #define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t) | ||
| 89 | #define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t) | ||
| 90 | #define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t) | ||
| 91 | #define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH) | ||
| 92 | #define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t) | ||
| 93 | #define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \ | ||
| 94 | drm_via_cmdbuf_size_t) | ||
| 95 | #define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t) | ||
| 96 | #define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t) | ||
| 97 | #define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t) | ||
| 98 | |||
| 99 | /* Indices into buf.Setup where various bits of state are mirrored per | ||
| 100 | * context and per buffer. These can be fired at the card as a unit, | ||
| 101 | * or in a piecewise fashion as required. | ||
| 102 | */ | ||
| 103 | |||
| 104 | #define VIA_TEX_SETUP_SIZE 8 | ||
| 105 | |||
| 106 | /* Flags for clear ioctl | ||
| 107 | */ | ||
| 108 | #define VIA_FRONT 0x1 | ||
| 109 | #define VIA_BACK 0x2 | ||
| 110 | #define VIA_DEPTH 0x4 | ||
| 111 | #define VIA_STENCIL 0x8 | ||
| 112 | #define VIA_MEM_VIDEO 0 /* matches drm constant */ | ||
| 113 | #define VIA_MEM_AGP 1 /* matches drm constant */ | ||
| 114 | #define VIA_MEM_SYSTEM 2 | ||
| 115 | #define VIA_MEM_MIXED 3 | ||
| 116 | #define VIA_MEM_UNKNOWN 4 | ||
| 117 | |||
| 118 | typedef struct { | ||
| 119 | __u32 offset; | ||
| 120 | __u32 size; | ||
| 121 | } drm_via_agp_t; | ||
| 122 | |||
| 123 | typedef struct { | ||
| 124 | __u32 offset; | ||
| 125 | __u32 size; | ||
| 126 | } drm_via_fb_t; | ||
| 127 | |||
| 128 | typedef struct { | ||
| 129 | __u32 context; | ||
| 130 | __u32 type; | ||
| 131 | __u32 size; | ||
| 132 | unsigned long index; | ||
| 133 | unsigned long offset; | ||
| 134 | } drm_via_mem_t; | ||
| 135 | |||
| 136 | typedef struct _drm_via_init { | ||
| 137 | enum { | ||
| 138 | VIA_INIT_MAP = 0x01, | ||
| 139 | VIA_CLEANUP_MAP = 0x02 | ||
| 140 | } func; | ||
| 141 | |||
| 142 | unsigned long sarea_priv_offset; | ||
| 143 | unsigned long fb_offset; | ||
| 144 | unsigned long mmio_offset; | ||
| 145 | unsigned long agpAddr; | ||
| 146 | } drm_via_init_t; | ||
| 147 | |||
| 148 | typedef struct _drm_via_futex { | ||
| 149 | enum { | ||
| 150 | VIA_FUTEX_WAIT = 0x00, | ||
| 151 | VIA_FUTEX_WAKE = 0X01 | ||
| 152 | } func; | ||
| 153 | __u32 ms; | ||
| 154 | __u32 lock; | ||
| 155 | __u32 val; | ||
| 156 | } drm_via_futex_t; | ||
| 157 | |||
| 158 | typedef struct _drm_via_dma_init { | ||
| 159 | enum { | ||
| 160 | VIA_INIT_DMA = 0x01, | ||
| 161 | VIA_CLEANUP_DMA = 0x02, | ||
| 162 | VIA_DMA_INITIALIZED = 0x03 | ||
| 163 | } func; | ||
| 164 | |||
| 165 | unsigned long offset; | ||
| 166 | unsigned long size; | ||
| 167 | unsigned long reg_pause_addr; | ||
| 168 | } drm_via_dma_init_t; | ||
| 169 | |||
| 170 | typedef struct _drm_via_cmdbuffer { | ||
| 171 | char __user *buf; | ||
| 172 | unsigned long size; | ||
| 173 | } drm_via_cmdbuffer_t; | ||
| 174 | |||
| 175 | /* Warning: If you change the SAREA structure you must change the Xserver | ||
| 176 | * structure as well */ | ||
| 177 | |||
| 178 | typedef struct _drm_via_tex_region { | ||
| 179 | unsigned char next, prev; /* indices to form a circular LRU */ | ||
| 180 | unsigned char inUse; /* owned by a client, or free? */ | ||
| 181 | int age; /* tracked by clients to update local LRU's */ | ||
| 182 | } drm_via_tex_region_t; | ||
| 183 | |||
| 184 | typedef struct _drm_via_sarea { | ||
| 185 | unsigned int dirty; | ||
| 186 | unsigned int nbox; | ||
| 187 | struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS]; | ||
| 188 | drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1]; | ||
| 189 | int texAge; /* last time texture was uploaded */ | ||
| 190 | int ctxOwner; /* last context to upload state */ | ||
| 191 | int vertexPrim; | ||
| 192 | |||
| 193 | /* | ||
| 194 | * Below is for XvMC. | ||
| 195 | * We want the lock integers alone on, and aligned to, a cache line. | ||
| 196 | * Therefore this somewhat strange construct. | ||
| 197 | */ | ||
| 198 | |||
| 199 | char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)]; | ||
| 200 | |||
| 201 | unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS]; | ||
| 202 | unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS]; | ||
| 203 | unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */ | ||
| 204 | |||
| 205 | /* Used by the 3d driver only at this point, for pageflipping: | ||
| 206 | */ | ||
| 207 | unsigned int pfCurrentOffset; | ||
| 208 | } drm_via_sarea_t; | ||
| 209 | |||
| 210 | typedef struct _drm_via_cmdbuf_size { | ||
| 211 | enum { | ||
| 212 | VIA_CMDBUF_SPACE = 0x01, | ||
| 213 | VIA_CMDBUF_LAG = 0x02 | ||
| 214 | } func; | ||
| 215 | int wait; | ||
| 216 | __u32 size; | ||
| 217 | } drm_via_cmdbuf_size_t; | ||
| 218 | |||
| 219 | typedef enum { | ||
| 220 | VIA_IRQ_ABSOLUTE = 0x0, | ||
| 221 | VIA_IRQ_RELATIVE = 0x1, | ||
| 222 | VIA_IRQ_SIGNAL = 0x10000000, | ||
| 223 | VIA_IRQ_FORCE_SEQUENCE = 0x20000000 | ||
| 224 | } via_irq_seq_type_t; | ||
| 225 | |||
| 226 | #define VIA_IRQ_FLAGS_MASK 0xF0000000 | ||
| 227 | |||
| 228 | enum drm_via_irqs { | ||
| 229 | drm_via_irq_hqv0 = 0, | ||
| 230 | drm_via_irq_hqv1, | ||
| 231 | drm_via_irq_dma0_dd, | ||
| 232 | drm_via_irq_dma0_td, | ||
| 233 | drm_via_irq_dma1_dd, | ||
| 234 | drm_via_irq_dma1_td, | ||
| 235 | drm_via_irq_num | ||
| 236 | }; | ||
| 237 | |||
| 238 | struct drm_via_wait_irq_request { | ||
| 239 | unsigned irq; | ||
| 240 | via_irq_seq_type_t type; | ||
| 241 | __u32 sequence; | ||
| 242 | __u32 signal; | ||
| 243 | }; | ||
| 244 | |||
| 245 | typedef union drm_via_irqwait { | ||
| 246 | struct drm_via_wait_irq_request request; | ||
| 247 | struct drm_wait_vblank_reply reply; | ||
| 248 | } drm_via_irqwait_t; | ||
| 249 | |||
| 250 | typedef struct drm_via_blitsync { | ||
| 251 | __u32 sync_handle; | ||
| 252 | unsigned engine; | ||
| 253 | } drm_via_blitsync_t; | ||
| 254 | |||
| 255 | /* - * Below,"flags" is currently unused but will be used for possible future | ||
| 256 | * extensions like kernel space bounce buffers for bad alignments and | ||
| 257 | * blit engine busy-wait polling for better latency in the absence of | ||
| 258 | * interrupts. | ||
| 259 | */ | ||
| 260 | |||
| 261 | typedef struct drm_via_dmablit { | ||
| 262 | __u32 num_lines; | ||
| 263 | __u32 line_length; | ||
| 264 | |||
| 265 | __u32 fb_addr; | ||
| 266 | __u32 fb_stride; | ||
| 267 | |||
| 268 | unsigned char *mem_addr; | ||
| 269 | __u32 mem_stride; | ||
| 270 | |||
| 271 | __u32 flags; | ||
| 272 | int to_fb; | ||
| 273 | |||
| 274 | drm_via_blitsync_t sync; | ||
| 275 | } drm_via_dmablit_t; | ||
| 276 | |||
| 277 | struct via_file_private { | ||
| 278 | struct list_head obj_list; | ||
| 279 | }; | ||
| 280 | |||
| 281 | #endif /* _VIA_DRM_H_ */ | ||
| @@ -0,0 +1,790 @@ | |||
| 1 | /************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA | ||
| 4 | * All Rights Reserved. | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the | ||
| 8 | * "Software"), to deal in the Software without restriction, including | ||
| 9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
| 10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
| 11 | * permit persons to whom the Software is furnished to do so, subject to | ||
| 12 | * the following conditions: | ||
| 13 | * | ||
| 14 | * The above copyright notice and this permission notice (including the | ||
| 15 | * next paragraph) shall be included in all copies or substantial portions | ||
| 16 | * of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
| 21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
| 22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| 23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
| 24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 25 | * | ||
| 26 | **************************************************************************/ | ||
| 27 | |||
| 28 | #ifndef __VMWGFX_DRM_H__ | ||
| 29 | #define __VMWGFX_DRM_H__ | ||
| 30 | |||
| 31 | #define DRM_VMW_MAX_SURFACE_FACES 6 | ||
| 32 | #define DRM_VMW_MAX_MIP_LEVELS 24 | ||
| 33 | |||
| 34 | |||
| 35 | #define DRM_VMW_GET_PARAM 0 | ||
| 36 | #define DRM_VMW_ALLOC_DMABUF 1 | ||
| 37 | #define DRM_VMW_UNREF_DMABUF 2 | ||
| 38 | #define DRM_VMW_CURSOR_BYPASS 3 | ||
| 39 | /* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/ | ||
| 40 | #define DRM_VMW_CONTROL_STREAM 4 | ||
| 41 | #define DRM_VMW_CLAIM_STREAM 5 | ||
| 42 | #define DRM_VMW_UNREF_STREAM 6 | ||
| 43 | /* guarded by DRM_VMW_PARAM_3D == 1 */ | ||
| 44 | #define DRM_VMW_CREATE_CONTEXT 7 | ||
| 45 | #define DRM_VMW_UNREF_CONTEXT 8 | ||
| 46 | #define DRM_VMW_CREATE_SURFACE 9 | ||
| 47 | #define DRM_VMW_UNREF_SURFACE 10 | ||
| 48 | #define DRM_VMW_REF_SURFACE 11 | ||
| 49 | #define DRM_VMW_EXECBUF 12 | ||
| 50 | #define DRM_VMW_GET_3D_CAP 13 | ||
| 51 | #define DRM_VMW_FENCE_WAIT 14 | ||
| 52 | #define DRM_VMW_FENCE_SIGNALED 15 | ||
| 53 | #define DRM_VMW_FENCE_UNREF 16 | ||
| 54 | #define DRM_VMW_FENCE_EVENT 17 | ||
| 55 | #define DRM_VMW_PRESENT 18 | ||
| 56 | #define DRM_VMW_PRESENT_READBACK 19 | ||
| 57 | #define DRM_VMW_UPDATE_LAYOUT 20 | ||
| 58 | |||
| 59 | /*************************************************************************/ | ||
| 60 | /** | ||
| 61 | * DRM_VMW_GET_PARAM - get device information. | ||
| 62 | * | ||
| 63 | * DRM_VMW_PARAM_FIFO_OFFSET: | ||
| 64 | * Offset to use to map the first page of the FIFO read-only. | ||
| 65 | * The fifo is mapped using the mmap() system call on the drm device. | ||
| 66 | * | ||
| 67 | * DRM_VMW_PARAM_OVERLAY_IOCTL: | ||
| 68 | * Does the driver support the overlay ioctl. | ||
| 69 | */ | ||
| 70 | |||
| 71 | #define DRM_VMW_PARAM_NUM_STREAMS 0 | ||
| 72 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 | ||
| 73 | #define DRM_VMW_PARAM_3D 2 | ||
| 74 | #define DRM_VMW_PARAM_HW_CAPS 3 | ||
| 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 | ||
| 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 | ||
| 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 | ||
| 78 | |||
| 79 | /** | ||
| 80 | * struct drm_vmw_getparam_arg | ||
| 81 | * | ||
| 82 | * @value: Returned value. //Out | ||
| 83 | * @param: Parameter to query. //In. | ||
| 84 | * | ||
| 85 | * Argument to the DRM_VMW_GET_PARAM Ioctl. | ||
| 86 | */ | ||
| 87 | |||
| 88 | struct drm_vmw_getparam_arg { | ||
| 89 | uint64_t value; | ||
| 90 | uint32_t param; | ||
| 91 | uint32_t pad64; | ||
| 92 | }; | ||
| 93 | |||
| 94 | /*************************************************************************/ | ||
| 95 | /** | ||
| 96 | * DRM_VMW_CREATE_CONTEXT - Create a host context. | ||
| 97 | * | ||
| 98 | * Allocates a device unique context id, and queues a create context command | ||
| 99 | * for the host. Does not wait for host completion. | ||
| 100 | */ | ||
| 101 | |||
| 102 | /** | ||
| 103 | * struct drm_vmw_context_arg | ||
| 104 | * | ||
| 105 | * @cid: Device unique context ID. | ||
| 106 | * | ||
| 107 | * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl. | ||
| 108 | * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl. | ||
| 109 | */ | ||
| 110 | |||
| 111 | struct drm_vmw_context_arg { | ||
| 112 | int32_t cid; | ||
| 113 | uint32_t pad64; | ||
| 114 | }; | ||
| 115 | |||
| 116 | /*************************************************************************/ | ||
| 117 | /** | ||
| 118 | * DRM_VMW_UNREF_CONTEXT - Create a host context. | ||
| 119 | * | ||
| 120 | * Frees a global context id, and queues a destroy host command for the host. | ||
| 121 | * Does not wait for host completion. The context ID can be used directly | ||
| 122 | * in the command stream and shows up as the same context ID on the host. | ||
| 123 | */ | ||
| 124 | |||
| 125 | /*************************************************************************/ | ||
| 126 | /** | ||
| 127 | * DRM_VMW_CREATE_SURFACE - Create a host suface. | ||
| 128 | * | ||
| 129 | * Allocates a device unique surface id, and queues a create surface command | ||
| 130 | * for the host. Does not wait for host completion. The surface ID can be | ||
| 131 | * used directly in the command stream and shows up as the same surface | ||
| 132 | * ID on the host. | ||
| 133 | */ | ||
| 134 | |||
| 135 | /** | ||
| 136 | * struct drm_wmv_surface_create_req | ||
| 137 | * | ||
| 138 | * @flags: Surface flags as understood by the host. | ||
| 139 | * @format: Surface format as understood by the host. | ||
| 140 | * @mip_levels: Number of mip levels for each face. | ||
| 141 | * An unused face should have 0 encoded. | ||
| 142 | * @size_addr: Address of a user-space array of sruct drm_vmw_size | ||
| 143 | * cast to an uint64_t for 32-64 bit compatibility. | ||
| 144 | * The size of the array should equal the total number of mipmap levels. | ||
| 145 | * @shareable: Boolean whether other clients (as identified by file descriptors) | ||
| 146 | * may reference this surface. | ||
| 147 | * @scanout: Boolean whether the surface is intended to be used as a | ||
| 148 | * scanout. | ||
| 149 | * | ||
| 150 | * Input data to the DRM_VMW_CREATE_SURFACE Ioctl. | ||
| 151 | * Output data from the DRM_VMW_REF_SURFACE Ioctl. | ||
| 152 | */ | ||
| 153 | |||
| 154 | struct drm_vmw_surface_create_req { | ||
| 155 | uint32_t flags; | ||
| 156 | uint32_t format; | ||
| 157 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; | ||
| 158 | uint64_t size_addr; | ||
| 159 | int32_t shareable; | ||
| 160 | int32_t scanout; | ||
| 161 | }; | ||
| 162 | |||
| 163 | /** | ||
| 164 | * struct drm_wmv_surface_arg | ||
| 165 | * | ||
| 166 | * @sid: Surface id of created surface or surface to destroy or reference. | ||
| 167 | * | ||
| 168 | * Output data from the DRM_VMW_CREATE_SURFACE Ioctl. | ||
| 169 | * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl. | ||
| 170 | * Input argument to the DRM_VMW_REF_SURFACE Ioctl. | ||
| 171 | */ | ||
| 172 | |||
| 173 | struct drm_vmw_surface_arg { | ||
| 174 | int32_t sid; | ||
| 175 | uint32_t pad64; | ||
| 176 | }; | ||
| 177 | |||
| 178 | /** | ||
| 179 | * struct drm_vmw_size ioctl. | ||
| 180 | * | ||
| 181 | * @width - mip level width | ||
| 182 | * @height - mip level height | ||
| 183 | * @depth - mip level depth | ||
| 184 | * | ||
| 185 | * Description of a mip level. | ||
| 186 | * Input data to the DRM_WMW_CREATE_SURFACE Ioctl. | ||
| 187 | */ | ||
| 188 | |||
| 189 | struct drm_vmw_size { | ||
| 190 | uint32_t width; | ||
| 191 | uint32_t height; | ||
| 192 | uint32_t depth; | ||
| 193 | uint32_t pad64; | ||
| 194 | }; | ||
| 195 | |||
| 196 | /** | ||
| 197 | * union drm_vmw_surface_create_arg | ||
| 198 | * | ||
| 199 | * @rep: Output data as described above. | ||
| 200 | * @req: Input data as described above. | ||
| 201 | * | ||
| 202 | * Argument to the DRM_VMW_CREATE_SURFACE Ioctl. | ||
| 203 | */ | ||
| 204 | |||
| 205 | union drm_vmw_surface_create_arg { | ||
| 206 | struct drm_vmw_surface_arg rep; | ||
| 207 | struct drm_vmw_surface_create_req req; | ||
| 208 | }; | ||
| 209 | |||
| 210 | /*************************************************************************/ | ||
| 211 | /** | ||
| 212 | * DRM_VMW_REF_SURFACE - Reference a host surface. | ||
| 213 | * | ||
| 214 | * Puts a reference on a host surface with a give sid, as previously | ||
| 215 | * returned by the DRM_VMW_CREATE_SURFACE ioctl. | ||
| 216 | * A reference will make sure the surface isn't destroyed while we hold | ||
| 217 | * it and will allow the calling client to use the surface ID in the command | ||
| 218 | * stream. | ||
| 219 | * | ||
| 220 | * On successful return, the Ioctl returns the surface information given | ||
| 221 | * in the DRM_VMW_CREATE_SURFACE ioctl. | ||
| 222 | */ | ||
| 223 | |||
| 224 | /** | ||
| 225 | * union drm_vmw_surface_reference_arg | ||
| 226 | * | ||
| 227 | * @rep: Output data as described above. | ||
| 228 | * @req: Input data as described above. | ||
| 229 | * | ||
| 230 | * Argument to the DRM_VMW_REF_SURFACE Ioctl. | ||
| 231 | */ | ||
| 232 | |||
| 233 | union drm_vmw_surface_reference_arg { | ||
| 234 | struct drm_vmw_surface_create_req rep; | ||
| 235 | struct drm_vmw_surface_arg req; | ||
| 236 | }; | ||
| 237 | |||
| 238 | /*************************************************************************/ | ||
| 239 | /** | ||
| 240 | * DRM_VMW_UNREF_SURFACE - Unreference a host surface. | ||
| 241 | * | ||
| 242 | * Clear a reference previously put on a host surface. | ||
| 243 | * When all references are gone, including the one implicitly placed | ||
| 244 | * on creation, | ||
| 245 | * a destroy surface command will be queued for the host. | ||
| 246 | * Does not wait for completion. | ||
| 247 | */ | ||
| 248 | |||
| 249 | /*************************************************************************/ | ||
| 250 | /** | ||
| 251 | * DRM_VMW_EXECBUF | ||
| 252 | * | ||
| 253 | * Submit a command buffer for execution on the host, and return a | ||
| 254 | * fence seqno that when signaled, indicates that the command buffer has | ||
| 255 | * executed. | ||
| 256 | */ | ||
| 257 | |||
| 258 | /** | ||
| 259 | * struct drm_vmw_execbuf_arg | ||
| 260 | * | ||
| 261 | * @commands: User-space address of a command buffer cast to an uint64_t. | ||
| 262 | * @command-size: Size in bytes of the command buffer. | ||
| 263 | * @throttle-us: Sleep until software is less than @throttle_us | ||
| 264 | * microseconds ahead of hardware. The driver may round this value | ||
| 265 | * to the nearest kernel tick. | ||
| 266 | * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an | ||
| 267 | * uint64_t. | ||
| 268 | * @version: Allows expanding the execbuf ioctl parameters without breaking | ||
| 269 | * backwards compatibility, since user-space will always tell the kernel | ||
| 270 | * which version it uses. | ||
| 271 | * @flags: Execbuf flags. None currently. | ||
| 272 | * | ||
| 273 | * Argument to the DRM_VMW_EXECBUF Ioctl. | ||
| 274 | */ | ||
| 275 | |||
| 276 | #define DRM_VMW_EXECBUF_VERSION 1 | ||
| 277 | |||
| 278 | struct drm_vmw_execbuf_arg { | ||
| 279 | uint64_t commands; | ||
| 280 | uint32_t command_size; | ||
| 281 | uint32_t throttle_us; | ||
| 282 | uint64_t fence_rep; | ||
| 283 | uint32_t version; | ||
| 284 | uint32_t flags; | ||
| 285 | }; | ||
| 286 | |||
| 287 | /** | ||
| 288 | * struct drm_vmw_fence_rep | ||
| 289 | * | ||
| 290 | * @handle: Fence object handle for fence associated with a command submission. | ||
| 291 | * @mask: Fence flags relevant for this fence object. | ||
| 292 | * @seqno: Fence sequence number in fifo. A fence object with a lower | ||
| 293 | * seqno will signal the EXEC flag before a fence object with a higher | ||
| 294 | * seqno. This can be used by user-space to avoid kernel calls to determine | ||
| 295 | * whether a fence has signaled the EXEC flag. Note that @seqno will | ||
| 296 | * wrap at 32-bit. | ||
| 297 | * @passed_seqno: The highest seqno number processed by the hardware | ||
| 298 | * so far. This can be used to mark user-space fence objects as signaled, and | ||
| 299 | * to determine whether a fence seqno might be stale. | ||
| 300 | * @error: This member should've been set to -EFAULT on submission. | ||
| 301 | * The following actions should be take on completion: | ||
| 302 | * error == -EFAULT: Fence communication failed. The host is synchronized. | ||
| 303 | * Use the last fence id read from the FIFO fence register. | ||
| 304 | * error != 0 && error != -EFAULT: | ||
| 305 | * Fence submission failed. The host is synchronized. Use the fence_seq member. | ||
| 306 | * error == 0: All is OK, The host may not be synchronized. | ||
| 307 | * Use the fence_seq member. | ||
| 308 | * | ||
| 309 | * Input / Output data to the DRM_VMW_EXECBUF Ioctl. | ||
| 310 | */ | ||
| 311 | |||
| 312 | struct drm_vmw_fence_rep { | ||
| 313 | uint32_t handle; | ||
| 314 | uint32_t mask; | ||
| 315 | uint32_t seqno; | ||
| 316 | uint32_t passed_seqno; | ||
| 317 | uint32_t pad64; | ||
| 318 | int32_t error; | ||
| 319 | }; | ||
| 320 | |||
| 321 | /*************************************************************************/ | ||
| 322 | /** | ||
| 323 | * DRM_VMW_ALLOC_DMABUF | ||
| 324 | * | ||
| 325 | * Allocate a DMA buffer that is visible also to the host. | ||
| 326 | * NOTE: The buffer is | ||
| 327 | * identified by a handle and an offset, which are private to the guest, but | ||
| 328 | * useable in the command stream. The guest kernel may translate these | ||
| 329 | * and patch up the command stream accordingly. In the future, the offset may | ||
| 330 | * be zero at all times, or it may disappear from the interface before it is | ||
| 331 | * fixed. | ||
| 332 | * | ||
| 333 | * The DMA buffer may stay user-space mapped in the guest at all times, | ||
| 334 | * and is thus suitable for sub-allocation. | ||
| 335 | * | ||
| 336 | * DMA buffers are mapped using the mmap() syscall on the drm device. | ||
| 337 | */ | ||
| 338 | |||
| 339 | /** | ||
| 340 | * struct drm_vmw_alloc_dmabuf_req | ||
| 341 | * | ||
| 342 | * @size: Required minimum size of the buffer. | ||
| 343 | * | ||
| 344 | * Input data to the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
| 345 | */ | ||
| 346 | |||
| 347 | struct drm_vmw_alloc_dmabuf_req { | ||
| 348 | uint32_t size; | ||
| 349 | uint32_t pad64; | ||
| 350 | }; | ||
| 351 | |||
| 352 | /** | ||
| 353 | * struct drm_vmw_dmabuf_rep | ||
| 354 | * | ||
| 355 | * @map_handle: Offset to use in the mmap() call used to map the buffer. | ||
| 356 | * @handle: Handle unique to this buffer. Used for unreferencing. | ||
| 357 | * @cur_gmr_id: GMR id to use in the command stream when this buffer is | ||
| 358 | * referenced. See not above. | ||
| 359 | * @cur_gmr_offset: Offset to use in the command stream when this buffer is | ||
| 360 | * referenced. See note above. | ||
| 361 | * | ||
| 362 | * Output data from the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
| 363 | */ | ||
| 364 | |||
| 365 | struct drm_vmw_dmabuf_rep { | ||
| 366 | uint64_t map_handle; | ||
| 367 | uint32_t handle; | ||
| 368 | uint32_t cur_gmr_id; | ||
| 369 | uint32_t cur_gmr_offset; | ||
| 370 | uint32_t pad64; | ||
| 371 | }; | ||
| 372 | |||
| 373 | /** | ||
| 374 | * union drm_vmw_dmabuf_arg | ||
| 375 | * | ||
| 376 | * @req: Input data as described above. | ||
| 377 | * @rep: Output data as described above. | ||
| 378 | * | ||
| 379 | * Argument to the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
| 380 | */ | ||
| 381 | |||
| 382 | union drm_vmw_alloc_dmabuf_arg { | ||
| 383 | struct drm_vmw_alloc_dmabuf_req req; | ||
| 384 | struct drm_vmw_dmabuf_rep rep; | ||
| 385 | }; | ||
| 386 | |||
| 387 | /*************************************************************************/ | ||
| 388 | /** | ||
| 389 | * DRM_VMW_UNREF_DMABUF - Free a DMA buffer. | ||
| 390 | * | ||
| 391 | */ | ||
| 392 | |||
| 393 | /** | ||
| 394 | * struct drm_vmw_unref_dmabuf_arg | ||
| 395 | * | ||
| 396 | * @handle: Handle indicating what buffer to free. Obtained from the | ||
| 397 | * DRM_VMW_ALLOC_DMABUF Ioctl. | ||
| 398 | * | ||
| 399 | * Argument to the DRM_VMW_UNREF_DMABUF Ioctl. | ||
| 400 | */ | ||
| 401 | |||
| 402 | struct drm_vmw_unref_dmabuf_arg { | ||
| 403 | uint32_t handle; | ||
| 404 | uint32_t pad64; | ||
| 405 | }; | ||
| 406 | |||
| 407 | /*************************************************************************/ | ||
| 408 | /** | ||
| 409 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. | ||
| 410 | * | ||
| 411 | * This IOCTL controls the overlay units of the svga device. | ||
| 412 | * The SVGA overlay units does not work like regular hardware units in | ||
| 413 | * that they do not automaticaly read back the contents of the given dma | ||
| 414 | * buffer. But instead only read back for each call to this ioctl, and | ||
| 415 | * at any point between this call being made and a following call that | ||
| 416 | * either changes the buffer or disables the stream. | ||
| 417 | */ | ||
| 418 | |||
| 419 | /** | ||
| 420 | * struct drm_vmw_rect | ||
| 421 | * | ||
| 422 | * Defines a rectangle. Used in the overlay ioctl to define | ||
| 423 | * source and destination rectangle. | ||
| 424 | */ | ||
| 425 | |||
| 426 | struct drm_vmw_rect { | ||
| 427 | int32_t x; | ||
| 428 | int32_t y; | ||
| 429 | uint32_t w; | ||
| 430 | uint32_t h; | ||
| 431 | }; | ||
| 432 | |||
| 433 | /** | ||
| 434 | * struct drm_vmw_control_stream_arg | ||
| 435 | * | ||
| 436 | * @stream_id: Stearm to control | ||
| 437 | * @enabled: If false all following arguments are ignored. | ||
| 438 | * @handle: Handle to buffer for getting data from. | ||
| 439 | * @format: Format of the overlay as understood by the host. | ||
| 440 | * @width: Width of the overlay. | ||
| 441 | * @height: Height of the overlay. | ||
| 442 | * @size: Size of the overlay in bytes. | ||
| 443 | * @pitch: Array of pitches, the two last are only used for YUV12 formats. | ||
| 444 | * @offset: Offset from start of dma buffer to overlay. | ||
| 445 | * @src: Source rect, must be within the defined area above. | ||
| 446 | * @dst: Destination rect, x and y may be negative. | ||
| 447 | * | ||
| 448 | * Argument to the DRM_VMW_CONTROL_STREAM Ioctl. | ||
| 449 | */ | ||
| 450 | |||
| 451 | struct drm_vmw_control_stream_arg { | ||
| 452 | uint32_t stream_id; | ||
| 453 | uint32_t enabled; | ||
| 454 | |||
| 455 | uint32_t flags; | ||
| 456 | uint32_t color_key; | ||
| 457 | |||
| 458 | uint32_t handle; | ||
| 459 | uint32_t offset; | ||
| 460 | int32_t format; | ||
| 461 | uint32_t size; | ||
| 462 | uint32_t width; | ||
| 463 | uint32_t height; | ||
| 464 | uint32_t pitch[3]; | ||
| 465 | |||
| 466 | uint32_t pad64; | ||
| 467 | struct drm_vmw_rect src; | ||
| 468 | struct drm_vmw_rect dst; | ||
| 469 | }; | ||
| 470 | |||
| 471 | /*************************************************************************/ | ||
| 472 | /** | ||
| 473 | * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass. | ||
| 474 | * | ||
| 475 | */ | ||
| 476 | |||
| 477 | #define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0) | ||
| 478 | #define DRM_VMW_CURSOR_BYPASS_FLAGS (1) | ||
| 479 | |||
| 480 | /** | ||
| 481 | * struct drm_vmw_cursor_bypass_arg | ||
| 482 | * | ||
| 483 | * @flags: Flags. | ||
| 484 | * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed. | ||
| 485 | * @xpos: X position of cursor. | ||
| 486 | * @ypos: Y position of cursor. | ||
| 487 | * @xhot: X hotspot. | ||
| 488 | * @yhot: Y hotspot. | ||
| 489 | * | ||
| 490 | * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl. | ||
| 491 | */ | ||
| 492 | |||
| 493 | struct drm_vmw_cursor_bypass_arg { | ||
| 494 | uint32_t flags; | ||
| 495 | uint32_t crtc_id; | ||
| 496 | int32_t xpos; | ||
| 497 | int32_t ypos; | ||
| 498 | int32_t xhot; | ||
| 499 | int32_t yhot; | ||
| 500 | }; | ||
| 501 | |||
| 502 | /*************************************************************************/ | ||
| 503 | /** | ||
| 504 | * DRM_VMW_CLAIM_STREAM - Claim a single stream. | ||
| 505 | */ | ||
| 506 | |||
| 507 | /** | ||
| 508 | * struct drm_vmw_context_arg | ||
| 509 | * | ||
| 510 | * @stream_id: Device unique context ID. | ||
| 511 | * | ||
| 512 | * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl. | ||
| 513 | * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl. | ||
| 514 | */ | ||
| 515 | |||
| 516 | struct drm_vmw_stream_arg { | ||
| 517 | uint32_t stream_id; | ||
| 518 | uint32_t pad64; | ||
| 519 | }; | ||
| 520 | |||
| 521 | /*************************************************************************/ | ||
| 522 | /** | ||
| 523 | * DRM_VMW_UNREF_STREAM - Unclaim a stream. | ||
| 524 | * | ||
| 525 | * Return a single stream that was claimed by this process. Also makes | ||
| 526 | * sure that the stream has been stopped. | ||
| 527 | */ | ||
| 528 | |||
| 529 | /*************************************************************************/ | ||
| 530 | /** | ||
| 531 | * DRM_VMW_GET_3D_CAP | ||
| 532 | * | ||
| 533 | * Read 3D capabilities from the FIFO | ||
| 534 | * | ||
| 535 | */ | ||
| 536 | |||
| 537 | /** | ||
| 538 | * struct drm_vmw_get_3d_cap_arg | ||
| 539 | * | ||
| 540 | * @buffer: Pointer to a buffer for capability data, cast to an uint64_t | ||
| 541 | * @size: Max size to copy | ||
| 542 | * | ||
| 543 | * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL | ||
| 544 | * ioctls. | ||
| 545 | */ | ||
| 546 | |||
| 547 | struct drm_vmw_get_3d_cap_arg { | ||
| 548 | uint64_t buffer; | ||
| 549 | uint32_t max_size; | ||
| 550 | uint32_t pad64; | ||
| 551 | }; | ||
| 552 | |||
| 553 | /*************************************************************************/ | ||
| 554 | /** | ||
| 555 | * DRM_VMW_FENCE_WAIT | ||
| 556 | * | ||
| 557 | * Waits for a fence object to signal. The wait is interruptible, so that | ||
| 558 | * signals may be delivered during the interrupt. The wait may timeout, | ||
| 559 | * in which case the calls returns -EBUSY. If the wait is restarted, | ||
| 560 | * that is restarting without resetting @cookie_valid to zero, | ||
| 561 | * the timeout is computed from the first call. | ||
| 562 | * | ||
| 563 | * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait | ||
| 564 | * on: | ||
| 565 | * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command | ||
| 566 | * stream | ||
| 567 | * have executed. | ||
| 568 | * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish | ||
| 569 | * commands | ||
| 570 | * in the buffer given to the EXECBUF ioctl returning the fence object handle | ||
| 571 | * are available to user-space. | ||
| 572 | * | ||
| 573 | * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the | ||
| 574 | * fenc wait ioctl returns 0, the fence object has been unreferenced after | ||
| 575 | * the wait. | ||
| 576 | */ | ||
| 577 | |||
| 578 | #define DRM_VMW_FENCE_FLAG_EXEC (1 << 0) | ||
| 579 | #define DRM_VMW_FENCE_FLAG_QUERY (1 << 1) | ||
| 580 | |||
| 581 | #define DRM_VMW_WAIT_OPTION_UNREF (1 << 0) | ||
| 582 | |||
| 583 | /** | ||
| 584 | * struct drm_vmw_fence_wait_arg | ||
| 585 | * | ||
| 586 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 587 | * @cookie_valid: Must be reset to 0 on first call. Left alone on restart. | ||
| 588 | * @kernel_cookie: Set to 0 on first call. Left alone on restart. | ||
| 589 | * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout. | ||
| 590 | * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick | ||
| 591 | * before returning. | ||
| 592 | * @flags: Fence flags to wait on. | ||
| 593 | * @wait_options: Options that control the behaviour of the wait ioctl. | ||
| 594 | * | ||
| 595 | * Input argument to the DRM_VMW_FENCE_WAIT ioctl. | ||
| 596 | */ | ||
| 597 | |||
| 598 | struct drm_vmw_fence_wait_arg { | ||
| 599 | uint32_t handle; | ||
| 600 | int32_t cookie_valid; | ||
| 601 | uint64_t kernel_cookie; | ||
| 602 | uint64_t timeout_us; | ||
| 603 | int32_t lazy; | ||
| 604 | int32_t flags; | ||
| 605 | int32_t wait_options; | ||
| 606 | int32_t pad64; | ||
| 607 | }; | ||
| 608 | |||
| 609 | /*************************************************************************/ | ||
| 610 | /** | ||
| 611 | * DRM_VMW_FENCE_SIGNALED | ||
| 612 | * | ||
| 613 | * Checks if a fence object is signaled.. | ||
| 614 | */ | ||
| 615 | |||
| 616 | /** | ||
| 617 | * struct drm_vmw_fence_signaled_arg | ||
| 618 | * | ||
| 619 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 620 | * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl | ||
| 621 | * @signaled: Out: Flags signaled. | ||
| 622 | * @sequence: Out: Highest sequence passed so far. Can be used to signal the | ||
| 623 | * EXEC flag of user-space fence objects. | ||
| 624 | * | ||
| 625 | * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF | ||
| 626 | * ioctls. | ||
| 627 | */ | ||
| 628 | |||
| 629 | struct drm_vmw_fence_signaled_arg { | ||
| 630 | uint32_t handle; | ||
| 631 | uint32_t flags; | ||
| 632 | int32_t signaled; | ||
| 633 | uint32_t passed_seqno; | ||
| 634 | uint32_t signaled_flags; | ||
| 635 | uint32_t pad64; | ||
| 636 | }; | ||
| 637 | |||
| 638 | /*************************************************************************/ | ||
| 639 | /** | ||
| 640 | * DRM_VMW_FENCE_UNREF | ||
| 641 | * | ||
| 642 | * Unreferences a fence object, and causes it to be destroyed if there are no | ||
| 643 | * other references to it. | ||
| 644 | * | ||
| 645 | */ | ||
| 646 | |||
| 647 | /** | ||
| 648 | * struct drm_vmw_fence_arg | ||
| 649 | * | ||
| 650 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
| 651 | * | ||
| 652 | * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl.. | ||
| 653 | */ | ||
| 654 | |||
| 655 | struct drm_vmw_fence_arg { | ||
| 656 | uint32_t handle; | ||
| 657 | uint32_t pad64; | ||
| 658 | }; | ||
| 659 | |||
| 660 | |||
| 661 | /*************************************************************************/ | ||
| 662 | /** | ||
| 663 | * DRM_VMW_FENCE_EVENT | ||
| 664 | * | ||
| 665 | * Queues an event on a fence to be delivered on the drm character device | ||
| 666 | * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag. | ||
| 667 | * Optionally the approximate time when the fence signaled is | ||
| 668 | * given by the event. | ||
| 669 | */ | ||
| 670 | |||
| 671 | /* | ||
| 672 | * The event type | ||
| 673 | */ | ||
| 674 | #define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000 | ||
| 675 | |||
| 676 | struct drm_vmw_event_fence { | ||
| 677 | struct drm_event base; | ||
| 678 | uint64_t user_data; | ||
| 679 | uint32_t tv_sec; | ||
| 680 | uint32_t tv_usec; | ||
| 681 | }; | ||
| 682 | |||
| 683 | /* | ||
| 684 | * Flags that may be given to the command. | ||
| 685 | */ | ||
| 686 | /* Request fence signaled time on the event. */ | ||
| 687 | #define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0) | ||
| 688 | |||
| 689 | /** | ||
| 690 | * struct drm_vmw_fence_event_arg | ||
| 691 | * | ||
| 692 | * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if | ||
| 693 | * the fence is not supposed to be referenced by user-space. | ||
| 694 | * @user_info: Info to be delivered with the event. | ||
| 695 | * @handle: Attach the event to this fence only. | ||
| 696 | * @flags: A set of flags as defined above. | ||
| 697 | */ | ||
| 698 | struct drm_vmw_fence_event_arg { | ||
| 699 | uint64_t fence_rep; | ||
| 700 | uint64_t user_data; | ||
| 701 | uint32_t handle; | ||
| 702 | uint32_t flags; | ||
| 703 | }; | ||
| 704 | |||
| 705 | |||
| 706 | /*************************************************************************/ | ||
| 707 | /** | ||
| 708 | * DRM_VMW_PRESENT | ||
| 709 | * | ||
| 710 | * Executes an SVGA present on a given fb for a given surface. The surface | ||
| 711 | * is placed on the framebuffer. Cliprects are given relative to the given | ||
| 712 | * point (the point disignated by dest_{x|y}). | ||
| 713 | * | ||
| 714 | */ | ||
| 715 | |||
| 716 | /** | ||
| 717 | * struct drm_vmw_present_arg | ||
| 718 | * @fb_id: framebuffer id to present / read back from. | ||
| 719 | * @sid: Surface id to present from. | ||
| 720 | * @dest_x: X placement coordinate for surface. | ||
| 721 | * @dest_y: Y placement coordinate for surface. | ||
| 722 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
| 723 | * @num_clips: Number of cliprects given relative to the framebuffer origin, | ||
| 724 | * in the same coordinate space as the frame buffer. | ||
| 725 | * @pad64: Unused 64-bit padding. | ||
| 726 | * | ||
| 727 | * Input argument to the DRM_VMW_PRESENT ioctl. | ||
| 728 | */ | ||
| 729 | |||
| 730 | struct drm_vmw_present_arg { | ||
| 731 | uint32_t fb_id; | ||
| 732 | uint32_t sid; | ||
| 733 | int32_t dest_x; | ||
| 734 | int32_t dest_y; | ||
| 735 | uint64_t clips_ptr; | ||
| 736 | uint32_t num_clips; | ||
| 737 | uint32_t pad64; | ||
| 738 | }; | ||
| 739 | |||
| 740 | |||
| 741 | /*************************************************************************/ | ||
| 742 | /** | ||
| 743 | * DRM_VMW_PRESENT_READBACK | ||
| 744 | * | ||
| 745 | * Executes an SVGA present readback from a given fb to the dma buffer | ||
| 746 | * currently bound as the fb. If there is no dma buffer bound to the fb, | ||
| 747 | * an error will be returned. | ||
| 748 | * | ||
| 749 | */ | ||
| 750 | |||
| 751 | /** | ||
| 752 | * struct drm_vmw_present_arg | ||
| 753 | * @fb_id: fb_id to present / read back from. | ||
| 754 | * @num_clips: Number of cliprects. | ||
| 755 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
| 756 | * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t. | ||
| 757 | * If this member is NULL, then the ioctl should not return a fence. | ||
| 758 | */ | ||
| 759 | |||
| 760 | struct drm_vmw_present_readback_arg { | ||
| 761 | uint32_t fb_id; | ||
| 762 | uint32_t num_clips; | ||
| 763 | uint64_t clips_ptr; | ||
| 764 | uint64_t fence_rep; | ||
| 765 | }; | ||
| 766 | |||
| 767 | /*************************************************************************/ | ||
| 768 | /** | ||
| 769 | * DRM_VMW_UPDATE_LAYOUT - Update layout | ||
| 770 | * | ||
| 771 | * Updates the preferred modes and connection status for connectors. The | ||
| 772 | * command consists of one drm_vmw_update_layout_arg pointing to an array | ||
| 773 | * of num_outputs drm_vmw_rect's. | ||
| 774 | */ | ||
| 775 | |||
| 776 | /** | ||
| 777 | * struct drm_vmw_update_layout_arg | ||
| 778 | * | ||
| 779 | * @num_outputs: number of active connectors | ||
| 780 | * @rects: pointer to array of drm_vmw_rect cast to an uint64_t | ||
| 781 | * | ||
| 782 | * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl. | ||
| 783 | */ | ||
| 784 | struct drm_vmw_update_layout_arg { | ||
| 785 | uint32_t num_outputs; | ||
| 786 | uint32_t pad64; | ||
| 787 | uint64_t rects; | ||
| 788 | }; | ||
| 789 | |||
| 790 | #endif | ||
| @@ -0,0 +1,417 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += byteorder/ | ||
| 3 | header-y += can/ | ||
| 4 | header-y += caif/ | ||
| 5 | header-y += dvb/ | ||
| 6 | header-y += hdlc/ | ||
| 7 | header-y += hsi/ | ||
| 8 | header-y += isdn/ | ||
| 9 | header-y += mmc/ | ||
| 10 | header-y += nfsd/ | ||
| 11 | header-y += raid/ | ||
| 12 | header-y += spi/ | ||
| 13 | header-y += sunrpc/ | ||
| 14 | header-y += tc_act/ | ||
| 15 | header-y += tc_ematch/ | ||
| 16 | header-y += netfilter/ | ||
| 17 | header-y += netfilter_arp/ | ||
| 18 | header-y += netfilter_bridge/ | ||
| 19 | header-y += netfilter_ipv4/ | ||
| 20 | header-y += netfilter_ipv6/ | ||
| 21 | header-y += usb/ | ||
| 22 | header-y += wimax/ | ||
| 23 | |||
| 24 | genhdr-y += version.h | ||
| 25 | |||
| 26 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h \ | ||
| 27 | $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),) | ||
| 28 | header-y += a.out.h | ||
| 29 | endif | ||
| 30 | |||
| 31 | header-y += acct.h | ||
| 32 | header-y += adb.h | ||
| 33 | header-y += adfs_fs.h | ||
| 34 | header-y += affs_hardblocks.h | ||
| 35 | header-y += agpgart.h | ||
| 36 | header-y += aio_abi.h | ||
| 37 | header-y += apm_bios.h | ||
| 38 | header-y += arcfb.h | ||
| 39 | header-y += atalk.h | ||
| 40 | header-y += atm.h | ||
| 41 | header-y += atm_eni.h | ||
| 42 | header-y += atm_he.h | ||
| 43 | header-y += atm_idt77105.h | ||
| 44 | header-y += atm_nicstar.h | ||
| 45 | header-y += atm_tcp.h | ||
| 46 | header-y += atm_zatm.h | ||
| 47 | header-y += atmapi.h | ||
| 48 | header-y += atmarp.h | ||
| 49 | header-y += atmbr2684.h | ||
| 50 | header-y += atmclip.h | ||
| 51 | header-y += atmdev.h | ||
| 52 | header-y += atmioc.h | ||
| 53 | header-y += atmlec.h | ||
| 54 | header-y += atmmpc.h | ||
| 55 | header-y += atmppp.h | ||
| 56 | header-y += atmsap.h | ||
| 57 | header-y += atmsvc.h | ||
| 58 | header-y += audit.h | ||
| 59 | header-y += auto_fs.h | ||
| 60 | header-y += auto_fs4.h | ||
| 61 | header-y += auxvec.h | ||
| 62 | header-y += ax25.h | ||
| 63 | header-y += b1lli.h | ||
| 64 | header-y += baycom.h | ||
| 65 | header-y += bfs_fs.h | ||
| 66 | header-y += binfmts.h | ||
| 67 | header-y += blkpg.h | ||
| 68 | header-y += blktrace_api.h | ||
| 69 | header-y += bpqether.h | ||
| 70 | header-y += bsg.h | ||
| 71 | header-y += can.h | ||
| 72 | header-y += capability.h | ||
| 73 | header-y += capi.h | ||
| 74 | header-y += cciss_defs.h | ||
| 75 | header-y += cciss_ioctl.h | ||
| 76 | header-y += cdrom.h | ||
| 77 | header-y += cgroupstats.h | ||
| 78 | header-y += chio.h | ||
| 79 | header-y += cm4000_cs.h | ||
| 80 | header-y += cn_proc.h | ||
| 81 | header-y += coda.h | ||
| 82 | header-y += coda_psdev.h | ||
| 83 | header-y += coff.h | ||
| 84 | header-y += connector.h | ||
| 85 | header-y += const.h | ||
| 86 | header-y += cramfs_fs.h | ||
| 87 | header-y += cuda.h | ||
| 88 | header-y += cyclades.h | ||
| 89 | header-y += cycx_cfm.h | ||
| 90 | header-y += dcbnl.h | ||
| 91 | header-y += dccp.h | ||
| 92 | header-y += dlm.h | ||
| 93 | header-y += dlm_device.h | ||
| 94 | header-y += dlm_netlink.h | ||
| 95 | header-y += dlm_plock.h | ||
| 96 | header-y += dlmconstants.h | ||
| 97 | header-y += dm-ioctl.h | ||
| 98 | header-y += dm-log-userspace.h | ||
| 99 | header-y += dn.h | ||
| 100 | header-y += dqblk_xfs.h | ||
| 101 | header-y += edd.h | ||
| 102 | header-y += efs_fs_sb.h | ||
| 103 | header-y += elf-em.h | ||
| 104 | header-y += elf-fdpic.h | ||
| 105 | header-y += elf.h | ||
| 106 | header-y += elfcore.h | ||
| 107 | header-y += errno.h | ||
| 108 | header-y += errqueue.h | ||
| 109 | header-y += ethtool.h | ||
| 110 | header-y += eventpoll.h | ||
| 111 | header-y += fadvise.h | ||
| 112 | header-y += falloc.h | ||
| 113 | header-y += fanotify.h | ||
| 114 | header-y += fb.h | ||
| 115 | header-y += fcntl.h | ||
| 116 | header-y += fd.h | ||
| 117 | header-y += fdreg.h | ||
| 118 | header-y += fib_rules.h | ||
| 119 | header-y += fiemap.h | ||
| 120 | header-y += filter.h | ||
| 121 | header-y += firewire-cdev.h | ||
| 122 | header-y += firewire-constants.h | ||
| 123 | header-y += flat.h | ||
| 124 | header-y += fs.h | ||
| 125 | header-y += fsl_hypervisor.h | ||
| 126 | header-y += fuse.h | ||
| 127 | header-y += futex.h | ||
| 128 | header-y += gameport.h | ||
| 129 | header-y += gen_stats.h | ||
| 130 | header-y += genetlink.h | ||
| 131 | header-y += gfs2_ondisk.h | ||
| 132 | header-y += gigaset_dev.h | ||
| 133 | header-y += hdlc.h | ||
| 134 | header-y += hdlcdrv.h | ||
| 135 | header-y += hdreg.h | ||
| 136 | header-y += hid.h | ||
| 137 | header-y += hiddev.h | ||
| 138 | header-y += hidraw.h | ||
| 139 | header-y += hpet.h | ||
| 140 | header-y += hysdn_if.h | ||
| 141 | header-y += i2c-dev.h | ||
| 142 | header-y += i2c.h | ||
| 143 | header-y += i2o-dev.h | ||
| 144 | header-y += i8k.h | ||
| 145 | header-y += icmp.h | ||
| 146 | header-y += icmpv6.h | ||
| 147 | header-y += if.h | ||
| 148 | header-y += if_addr.h | ||
| 149 | header-y += if_addrlabel.h | ||
| 150 | header-y += if_alg.h | ||
| 151 | header-y += if_arcnet.h | ||
| 152 | header-y += if_arp.h | ||
| 153 | header-y += if_bonding.h | ||
| 154 | header-y += if_bridge.h | ||
| 155 | header-y += if_cablemodem.h | ||
| 156 | header-y += if_eql.h | ||
| 157 | header-y += if_ether.h | ||
| 158 | header-y += if_fc.h | ||
| 159 | header-y += if_fddi.h | ||
| 160 | header-y += if_frad.h | ||
| 161 | header-y += if_hippi.h | ||
| 162 | header-y += if_infiniband.h | ||
| 163 | header-y += if_link.h | ||
| 164 | header-y += if_ltalk.h | ||
| 165 | header-y += if_packet.h | ||
| 166 | header-y += if_phonet.h | ||
| 167 | header-y += if_plip.h | ||
| 168 | header-y += if_ppp.h | ||
| 169 | header-y += if_pppol2tp.h | ||
| 170 | header-y += if_pppox.h | ||
| 171 | header-y += if_slip.h | ||
| 172 | header-y += if_team.h | ||
| 173 | header-y += if_tun.h | ||
| 174 | header-y += if_tunnel.h | ||
| 175 | header-y += if_vlan.h | ||
| 176 | header-y += if_x25.h | ||
| 177 | header-y += igmp.h | ||
| 178 | header-y += in.h | ||
| 179 | header-y += in6.h | ||
| 180 | header-y += in_route.h | ||
| 181 | header-y += inet_diag.h | ||
| 182 | header-y += inotify.h | ||
| 183 | header-y += input.h | ||
| 184 | header-y += ioctl.h | ||
| 185 | header-y += ip.h | ||
| 186 | header-y += ip6_tunnel.h | ||
| 187 | header-y += ip_vs.h | ||
| 188 | header-y += ipc.h | ||
| 189 | header-y += ipmi.h | ||
| 190 | header-y += ipmi_msgdefs.h | ||
| 191 | header-y += ipsec.h | ||
| 192 | header-y += ipv6.h | ||
| 193 | header-y += ipv6_route.h | ||
| 194 | header-y += ipx.h | ||
| 195 | header-y += irda.h | ||
| 196 | header-y += irqnr.h | ||
| 197 | header-y += isdn.h | ||
| 198 | header-y += isdn_divertif.h | ||
| 199 | header-y += isdn_ppp.h | ||
| 200 | header-y += isdnif.h | ||
| 201 | header-y += iso_fs.h | ||
| 202 | header-y += ivtv.h | ||
| 203 | header-y += ivtvfb.h | ||
| 204 | header-y += ixjuser.h | ||
| 205 | header-y += jffs2.h | ||
| 206 | header-y += joystick.h | ||
| 207 | header-y += kd.h | ||
| 208 | header-y += kdev_t.h | ||
| 209 | header-y += kernel-page-flags.h | ||
| 210 | header-y += kernel.h | ||
| 211 | header-y += kernelcapi.h | ||
| 212 | header-y += kexec.h | ||
| 213 | header-y += keyboard.h | ||
| 214 | header-y += keyctl.h | ||
| 215 | |||
| 216 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h \ | ||
| 217 | $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),) | ||
| 218 | header-y += kvm.h | ||
| 219 | endif | ||
| 220 | |||
| 221 | |||
| 222 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h \ | ||
| 223 | $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h),) | ||
| 224 | header-y += kvm_para.h | ||
| 225 | endif | ||
| 226 | |||
| 227 | header-y += l2tp.h | ||
| 228 | header-y += limits.h | ||
| 229 | header-y += llc.h | ||
| 230 | header-y += loop.h | ||
| 231 | header-y += lp.h | ||
| 232 | header-y += magic.h | ||
| 233 | header-y += major.h | ||
| 234 | header-y += map_to_7segment.h | ||
| 235 | header-y += matroxfb.h | ||
| 236 | header-y += mdio.h | ||
| 237 | header-y += media.h | ||
| 238 | header-y += mei.h | ||
| 239 | header-y += mempolicy.h | ||
| 240 | header-y += meye.h | ||
| 241 | header-y += mii.h | ||
| 242 | header-y += minix_fs.h | ||
| 243 | header-y += mman.h | ||
| 244 | header-y += mmtimer.h | ||
| 245 | header-y += mqueue.h | ||
| 246 | header-y += mroute.h | ||
| 247 | header-y += mroute6.h | ||
| 248 | header-y += msdos_fs.h | ||
| 249 | header-y += msg.h | ||
| 250 | header-y += mtio.h | ||
| 251 | header-y += n_r3964.h | ||
| 252 | header-y += nbd.h | ||
| 253 | header-y += ncp.h | ||
| 254 | header-y += ncp_fs.h | ||
| 255 | header-y += ncp_mount.h | ||
| 256 | header-y += ncp_no.h | ||
| 257 | header-y += neighbour.h | ||
| 258 | header-y += net.h | ||
| 259 | header-y += net_dropmon.h | ||
| 260 | header-y += net_tstamp.h | ||
| 261 | header-y += netdevice.h | ||
| 262 | header-y += netfilter.h | ||
| 263 | header-y += netfilter_arp.h | ||
| 264 | header-y += netfilter_bridge.h | ||
| 265 | header-y += netfilter_decnet.h | ||
| 266 | header-y += netfilter_ipv4.h | ||
| 267 | header-y += netfilter_ipv6.h | ||
| 268 | header-y += netlink.h | ||
| 269 | header-y += netrom.h | ||
| 270 | header-y += nfc.h | ||
| 271 | header-y += nfs.h | ||
| 272 | header-y += nfs2.h | ||
| 273 | header-y += nfs3.h | ||
| 274 | header-y += nfs4.h | ||
| 275 | header-y += nfs4_mount.h | ||
| 276 | header-y += nfs_fs.h | ||
| 277 | header-y += nfs_idmap.h | ||
| 278 | header-y += nfs_mount.h | ||
| 279 | header-y += nfsacl.h | ||
| 280 | header-y += nl80211.h | ||
| 281 | header-y += nubus.h | ||
| 282 | header-y += nvram.h | ||
| 283 | header-y += omap3isp.h | ||
| 284 | header-y += omapfb.h | ||
| 285 | header-y += oom.h | ||
| 286 | header-y += packet_diag.h | ||
| 287 | header-y += param.h | ||
| 288 | header-y += parport.h | ||
| 289 | header-y += patchkey.h | ||
| 290 | header-y += pci.h | ||
| 291 | header-y += pci_regs.h | ||
| 292 | header-y += perf_event.h | ||
| 293 | header-y += personality.h | ||
| 294 | header-y += pfkeyv2.h | ||
| 295 | header-y += pg.h | ||
| 296 | header-y += phantom.h | ||
| 297 | header-y += phonet.h | ||
| 298 | header-y += pkt_cls.h | ||
| 299 | header-y += pkt_sched.h | ||
| 300 | header-y += pktcdvd.h | ||
| 301 | header-y += pmu.h | ||
| 302 | header-y += poll.h | ||
| 303 | header-y += posix_types.h | ||
| 304 | header-y += ppdev.h | ||
| 305 | header-y += ppp-comp.h | ||
| 306 | header-y += ppp-ioctl.h | ||
| 307 | header-y += ppp_defs.h | ||
| 308 | header-y += pps.h | ||
| 309 | header-y += prctl.h | ||
| 310 | header-y += ptp_clock.h | ||
| 311 | header-y += ptrace.h | ||
| 312 | header-y += qnx4_fs.h | ||
| 313 | header-y += qnxtypes.h | ||
| 314 | header-y += quota.h | ||
| 315 | header-y += radeonfb.h | ||
| 316 | header-y += random.h | ||
| 317 | header-y += raw.h | ||
| 318 | header-y += rds.h | ||
| 319 | header-y += reboot.h | ||
| 320 | header-y += reiserfs_fs.h | ||
| 321 | header-y += reiserfs_xattr.h | ||
| 322 | header-y += resource.h | ||
| 323 | header-y += rfkill.h | ||
| 324 | header-y += romfs_fs.h | ||
| 325 | header-y += rose.h | ||
| 326 | header-y += route.h | ||
| 327 | header-y += rtc.h | ||
| 328 | header-y += rtnetlink.h | ||
| 329 | header-y += scc.h | ||
| 330 | header-y += sched.h | ||
| 331 | header-y += screen_info.h | ||
| 332 | header-y += sdla.h | ||
| 333 | header-y += seccomp.h | ||
| 334 | header-y += securebits.h | ||
| 335 | header-y += selinux_netlink.h | ||
| 336 | header-y += sem.h | ||
| 337 | header-y += serial.h | ||
| 338 | header-y += serial_core.h | ||
| 339 | header-y += serial_reg.h | ||
| 340 | header-y += serio.h | ||
| 341 | header-y += shm.h | ||
| 342 | header-y += signal.h | ||
| 343 | header-y += signalfd.h | ||
| 344 | header-y += snmp.h | ||
| 345 | header-y += sock_diag.h | ||
| 346 | header-y += socket.h | ||
| 347 | header-y += sockios.h | ||
| 348 | header-y += som.h | ||
| 349 | header-y += sonet.h | ||
| 350 | header-y += sonypi.h | ||
| 351 | header-y += sound.h | ||
| 352 | header-y += soundcard.h | ||
| 353 | header-y += stat.h | ||
| 354 | header-y += stddef.h | ||
| 355 | header-y += string.h | ||
| 356 | header-y += suspend_ioctls.h | ||
| 357 | header-y += swab.h | ||
| 358 | header-y += synclink.h | ||
| 359 | header-y += sysctl.h | ||
| 360 | header-y += sysinfo.h | ||
| 361 | header-y += taskstats.h | ||
| 362 | header-y += tcp.h | ||
| 363 | header-y += tcp_metrics.h | ||
| 364 | header-y += telephony.h | ||
| 365 | header-y += termios.h | ||
| 366 | header-y += time.h | ||
| 367 | header-y += times.h | ||
| 368 | header-y += timex.h | ||
| 369 | header-y += tiocl.h | ||
| 370 | header-y += tipc.h | ||
| 371 | header-y += tipc_config.h | ||
| 372 | header-y += toshiba.h | ||
| 373 | header-y += tty.h | ||
| 374 | header-y += tty_flags.h | ||
| 375 | header-y += types.h | ||
| 376 | header-y += udf_fs_i.h | ||
| 377 | header-y += udp.h | ||
| 378 | header-y += uhid.h | ||
| 379 | header-y += uinput.h | ||
| 380 | header-y += uio.h | ||
| 381 | header-y += ultrasound.h | ||
| 382 | header-y += un.h | ||
| 383 | header-y += unistd.h | ||
| 384 | header-y += unix_diag.h | ||
| 385 | header-y += usbdevice_fs.h | ||
| 386 | header-y += utime.h | ||
| 387 | header-y += utsname.h | ||
| 388 | header-y += uuid.h | ||
| 389 | header-y += uvcvideo.h | ||
| 390 | header-y += v4l2-common.h | ||
| 391 | header-y += v4l2-controls.h | ||
| 392 | header-y += v4l2-dv-timings.h | ||
| 393 | header-y += v4l2-mediabus.h | ||
| 394 | header-y += v4l2-subdev.h | ||
| 395 | header-y += veth.h | ||
| 396 | header-y += vfio.h | ||
| 397 | header-y += vhost.h | ||
| 398 | header-y += videodev2.h | ||
| 399 | header-y += virtio_9p.h | ||
| 400 | header-y += virtio_balloon.h | ||
| 401 | header-y += virtio_blk.h | ||
| 402 | header-y += virtio_config.h | ||
| 403 | header-y += virtio_console.h | ||
| 404 | header-y += virtio_ids.h | ||
| 405 | header-y += virtio_net.h | ||
| 406 | header-y += virtio_pci.h | ||
| 407 | header-y += virtio_ring.h | ||
| 408 | header-y += virtio_rng.h | ||
| 409 | header-y += vt.h | ||
| 410 | header-y += wait.h | ||
| 411 | header-y += wanrouter.h | ||
| 412 | header-y += watchdog.h | ||
| 413 | header-y += wimax.h | ||
| 414 | header-y += wireless.h | ||
| 415 | header-y += x25.h | ||
| 416 | header-y += xattr.h | ||
| 417 | header-y += xfrm.h | ||
| @@ -0,0 +1,274 @@ | |||
| 1 | #ifndef _UAPI__A_OUT_GNU_H__ | ||
| 2 | #define _UAPI__A_OUT_GNU_H__ | ||
| 3 | |||
| 4 | #define __GNU_EXEC_MACROS__ | ||
| 5 | |||
| 6 | #ifndef __STRUCT_EXEC_OVERRIDE__ | ||
| 7 | |||
| 8 | #include <asm/a.out.h> | ||
| 9 | |||
| 10 | #endif /* __STRUCT_EXEC_OVERRIDE__ */ | ||
| 11 | |||
| 12 | #ifndef __ASSEMBLY__ | ||
| 13 | |||
| 14 | /* these go in the N_MACHTYPE field */ | ||
| 15 | enum machine_type { | ||
| 16 | #if defined (M_OLDSUN2) | ||
| 17 | M__OLDSUN2 = M_OLDSUN2, | ||
| 18 | #else | ||
| 19 | M_OLDSUN2 = 0, | ||
| 20 | #endif | ||
| 21 | #if defined (M_68010) | ||
| 22 | M__68010 = M_68010, | ||
| 23 | #else | ||
| 24 | M_68010 = 1, | ||
| 25 | #endif | ||
| 26 | #if defined (M_68020) | ||
| 27 | M__68020 = M_68020, | ||
| 28 | #else | ||
| 29 | M_68020 = 2, | ||
| 30 | #endif | ||
| 31 | #if defined (M_SPARC) | ||
| 32 | M__SPARC = M_SPARC, | ||
| 33 | #else | ||
| 34 | M_SPARC = 3, | ||
| 35 | #endif | ||
| 36 | /* skip a bunch so we don't run into any of sun's numbers */ | ||
| 37 | M_386 = 100, | ||
| 38 | M_MIPS1 = 151, /* MIPS R3000/R3000 binary */ | ||
| 39 | M_MIPS2 = 152 /* MIPS R6000/R4000 binary */ | ||
| 40 | }; | ||
| 41 | |||
| 42 | #if !defined (N_MAGIC) | ||
| 43 | #define N_MAGIC(exec) ((exec).a_info & 0xffff) | ||
| 44 | #endif | ||
| 45 | #define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff)) | ||
| 46 | #define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff) | ||
| 47 | #define N_SET_INFO(exec, magic, type, flags) \ | ||
| 48 | ((exec).a_info = ((magic) & 0xffff) \ | ||
| 49 | | (((int)(type) & 0xff) << 16) \ | ||
| 50 | | (((flags) & 0xff) << 24)) | ||
| 51 | #define N_SET_MAGIC(exec, magic) \ | ||
| 52 | ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff))) | ||
| 53 | |||
| 54 | #define N_SET_MACHTYPE(exec, machtype) \ | ||
| 55 | ((exec).a_info = \ | ||
| 56 | ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16)) | ||
| 57 | |||
| 58 | #define N_SET_FLAGS(exec, flags) \ | ||
| 59 | ((exec).a_info = \ | ||
| 60 | ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24)) | ||
| 61 | |||
| 62 | /* Code indicating object file or impure executable. */ | ||
| 63 | #define OMAGIC 0407 | ||
| 64 | /* Code indicating pure executable. */ | ||
| 65 | #define NMAGIC 0410 | ||
| 66 | /* Code indicating demand-paged executable. */ | ||
| 67 | #define ZMAGIC 0413 | ||
| 68 | /* This indicates a demand-paged executable with the header in the text. | ||
| 69 | The first page is unmapped to help trap NULL pointer references */ | ||
| 70 | #define QMAGIC 0314 | ||
| 71 | |||
| 72 | /* Code indicating core file. */ | ||
| 73 | #define CMAGIC 0421 | ||
| 74 | |||
| 75 | #if !defined (N_BADMAG) | ||
| 76 | #define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \ | ||
| 77 | && N_MAGIC(x) != NMAGIC \ | ||
| 78 | && N_MAGIC(x) != ZMAGIC \ | ||
| 79 | && N_MAGIC(x) != QMAGIC) | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #define _N_HDROFF(x) (1024 - sizeof (struct exec)) | ||
| 83 | |||
| 84 | #if !defined (N_TXTOFF) | ||
| 85 | #define N_TXTOFF(x) \ | ||
| 86 | (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \ | ||
| 87 | (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) | ||
| 88 | #endif | ||
| 89 | |||
| 90 | #if !defined (N_DATOFF) | ||
| 91 | #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) | ||
| 92 | #endif | ||
| 93 | |||
| 94 | #if !defined (N_TRELOFF) | ||
| 95 | #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) | ||
| 96 | #endif | ||
| 97 | |||
| 98 | #if !defined (N_DRELOFF) | ||
| 99 | #define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x)) | ||
| 100 | #endif | ||
| 101 | |||
| 102 | #if !defined (N_SYMOFF) | ||
| 103 | #define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x)) | ||
| 104 | #endif | ||
| 105 | |||
| 106 | #if !defined (N_STROFF) | ||
| 107 | #define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x)) | ||
| 108 | #endif | ||
| 109 | |||
| 110 | /* Address of text segment in memory after it is loaded. */ | ||
| 111 | #if !defined (N_TXTADDR) | ||
| 112 | #define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0) | ||
| 113 | #endif | ||
| 114 | |||
| 115 | /* Address of data segment in memory after it is loaded. | ||
| 116 | Note that it is up to you to define SEGMENT_SIZE | ||
| 117 | on machines not listed here. */ | ||
| 118 | #if defined(vax) || defined(hp300) || defined(pyr) | ||
| 119 | #define SEGMENT_SIZE page_size | ||
| 120 | #endif | ||
| 121 | #ifdef sony | ||
| 122 | #define SEGMENT_SIZE 0x2000 | ||
| 123 | #endif /* Sony. */ | ||
| 124 | #ifdef is68k | ||
| 125 | #define SEGMENT_SIZE 0x20000 | ||
| 126 | #endif | ||
| 127 | #if defined(m68k) && defined(PORTAR) | ||
| 128 | #define PAGE_SIZE 0x400 | ||
| 129 | #define SEGMENT_SIZE PAGE_SIZE | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #ifdef linux | ||
| 133 | #ifndef __KERNEL__ | ||
| 134 | #include <unistd.h> | ||
| 135 | #endif | ||
| 136 | #if defined(__i386__) || defined(__mc68000__) | ||
| 137 | #define SEGMENT_SIZE 1024 | ||
| 138 | #else | ||
| 139 | #ifndef SEGMENT_SIZE | ||
| 140 | #ifndef __KERNEL__ | ||
| 141 | #define SEGMENT_SIZE getpagesize() | ||
| 142 | #endif | ||
| 143 | #endif | ||
| 144 | #endif | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE) | ||
| 148 | |||
| 149 | #define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) | ||
| 150 | |||
| 151 | #ifndef N_DATADDR | ||
| 152 | #define N_DATADDR(x) \ | ||
| 153 | (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \ | ||
| 154 | : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) | ||
| 155 | #endif | ||
| 156 | |||
| 157 | /* Address of bss segment in memory after it is loaded. */ | ||
| 158 | #if !defined (N_BSSADDR) | ||
| 159 | #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) | ||
| 160 | #endif | ||
| 161 | |||
| 162 | #if !defined (N_NLIST_DECLARED) | ||
| 163 | struct nlist { | ||
| 164 | union { | ||
| 165 | char *n_name; | ||
| 166 | struct nlist *n_next; | ||
| 167 | long n_strx; | ||
| 168 | } n_un; | ||
| 169 | unsigned char n_type; | ||
| 170 | char n_other; | ||
| 171 | short n_desc; | ||
| 172 | unsigned long n_value; | ||
| 173 | }; | ||
| 174 | #endif /* no N_NLIST_DECLARED. */ | ||
| 175 | |||
| 176 | #if !defined (N_UNDF) | ||
| 177 | #define N_UNDF 0 | ||
| 178 | #endif | ||
| 179 | #if !defined (N_ABS) | ||
| 180 | #define N_ABS 2 | ||
| 181 | #endif | ||
| 182 | #if !defined (N_TEXT) | ||
| 183 | #define N_TEXT 4 | ||
| 184 | #endif | ||
| 185 | #if !defined (N_DATA) | ||
| 186 | #define N_DATA 6 | ||
| 187 | #endif | ||
| 188 | #if !defined (N_BSS) | ||
| 189 | #define N_BSS 8 | ||
| 190 | #endif | ||
| 191 | #if !defined (N_FN) | ||
| 192 | #define N_FN 15 | ||
| 193 | #endif | ||
| 194 | |||
| 195 | #if !defined (N_EXT) | ||
| 196 | #define N_EXT 1 | ||
| 197 | #endif | ||
| 198 | #if !defined (N_TYPE) | ||
| 199 | #define N_TYPE 036 | ||
| 200 | #endif | ||
| 201 | #if !defined (N_STAB) | ||
| 202 | #define N_STAB 0340 | ||
| 203 | #endif | ||
| 204 | |||
| 205 | /* The following type indicates the definition of a symbol as being | ||
| 206 | an indirect reference to another symbol. The other symbol | ||
| 207 | appears as an undefined reference, immediately following this symbol. | ||
| 208 | |||
| 209 | Indirection is asymmetrical. The other symbol's value will be used | ||
| 210 | to satisfy requests for the indirect symbol, but not vice versa. | ||
| 211 | If the other symbol does not have a definition, libraries will | ||
| 212 | be searched to find a definition. */ | ||
| 213 | #define N_INDR 0xa | ||
| 214 | |||
| 215 | /* The following symbols refer to set elements. | ||
| 216 | All the N_SET[ATDB] symbols with the same name form one set. | ||
| 217 | Space is allocated for the set in the text section, and each set | ||
| 218 | element's value is stored into one word of the space. | ||
| 219 | The first word of the space is the length of the set (number of elements). | ||
| 220 | |||
| 221 | The address of the set is made into an N_SETV symbol | ||
| 222 | whose name is the same as the name of the set. | ||
| 223 | This symbol acts like a N_DATA global symbol | ||
| 224 | in that it can satisfy undefined external references. */ | ||
| 225 | |||
| 226 | /* These appear as input to LD, in a .o file. */ | ||
| 227 | #define N_SETA 0x14 /* Absolute set element symbol */ | ||
| 228 | #define N_SETT 0x16 /* Text set element symbol */ | ||
| 229 | #define N_SETD 0x18 /* Data set element symbol */ | ||
| 230 | #define N_SETB 0x1A /* Bss set element symbol */ | ||
| 231 | |||
| 232 | /* This is output from LD. */ | ||
| 233 | #define N_SETV 0x1C /* Pointer to set vector in data area. */ | ||
| 234 | |||
| 235 | #if !defined (N_RELOCATION_INFO_DECLARED) | ||
| 236 | /* This structure describes a single relocation to be performed. | ||
| 237 | The text-relocation section of the file is a vector of these structures, | ||
| 238 | all of which apply to the text section. | ||
| 239 | Likewise, the data-relocation section applies to the data section. */ | ||
| 240 | |||
| 241 | struct relocation_info | ||
| 242 | { | ||
| 243 | /* Address (within segment) to be relocated. */ | ||
| 244 | int r_address; | ||
| 245 | /* The meaning of r_symbolnum depends on r_extern. */ | ||
| 246 | unsigned int r_symbolnum:24; | ||
| 247 | /* Nonzero means value is a pc-relative offset | ||
| 248 | and it should be relocated for changes in its own address | ||
| 249 | as well as for changes in the symbol or section specified. */ | ||
| 250 | unsigned int r_pcrel:1; | ||
| 251 | /* Length (as exponent of 2) of the field to be relocated. | ||
| 252 | Thus, a value of 2 indicates 1<<2 bytes. */ | ||
| 253 | unsigned int r_length:2; | ||
| 254 | /* 1 => relocate with value of symbol. | ||
| 255 | r_symbolnum is the index of the symbol | ||
| 256 | in file's the symbol table. | ||
| 257 | 0 => relocate with the address of a segment. | ||
| 258 | r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS | ||
| 259 | (the N_EXT bit may be set also, but signifies nothing). */ | ||
| 260 | unsigned int r_extern:1; | ||
| 261 | /* Four bits that aren't used, but when writing an object file | ||
| 262 | it is desirable to clear them. */ | ||
| 263 | #ifdef NS32K | ||
| 264 | unsigned r_bsr:1; | ||
| 265 | unsigned r_disp:1; | ||
| 266 | unsigned r_pad:2; | ||
| 267 | #else | ||
| 268 | unsigned int r_pad:4; | ||
| 269 | #endif | ||
| 270 | }; | ||
| 271 | #endif /* no N_RELOCATION_INFO_DECLARED. */ | ||
| 272 | |||
| 273 | #endif /*__ASSEMBLY__ */ | ||
| 274 | #endif /* _UAPI__A_OUT_GNU_H__ */ | ||
| @@ -0,0 +1,122 @@ | |||
| 1 | /* | ||
| 2 | * BSD Process Accounting for Linux - Definitions | ||
| 3 | * | ||
| 4 | * Author: Marco van Wieringen (mvw@planets.elm.net) | ||
| 5 | * | ||
| 6 | * This header file contains the definitions needed to implement | ||
| 7 | * BSD-style process accounting. The kernel accounting code and all | ||
| 8 | * user-level programs that try to do something useful with the | ||
| 9 | * process accounting log must include this file. | ||
| 10 | * | ||
| 11 | * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _UAPI_LINUX_ACCT_H | ||
| 16 | #define _UAPI_LINUX_ACCT_H | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | #include <asm/param.h> | ||
| 21 | #include <asm/byteorder.h> | ||
| 22 | |||
| 23 | /* | ||
| 24 | * comp_t is a 16-bit "floating" point number with a 3-bit base 8 | ||
| 25 | * exponent and a 13-bit fraction. | ||
| 26 | * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction | ||
| 27 | * (leading 1 not stored). | ||
| 28 | * See linux/kernel/acct.c for the specific encoding systems used. | ||
| 29 | */ | ||
| 30 | |||
| 31 | typedef __u16 comp_t; | ||
| 32 | typedef __u32 comp2_t; | ||
| 33 | |||
| 34 | /* | ||
| 35 | * accounting file record | ||
| 36 | * | ||
| 37 | * This structure contains all of the information written out to the | ||
| 38 | * process accounting file whenever a process exits. | ||
| 39 | */ | ||
| 40 | |||
| 41 | #define ACCT_COMM 16 | ||
| 42 | |||
| 43 | struct acct | ||
| 44 | { | ||
| 45 | char ac_flag; /* Flags */ | ||
| 46 | char ac_version; /* Always set to ACCT_VERSION */ | ||
| 47 | /* for binary compatibility back until 2.0 */ | ||
| 48 | __u16 ac_uid16; /* LSB of Real User ID */ | ||
| 49 | __u16 ac_gid16; /* LSB of Real Group ID */ | ||
| 50 | __u16 ac_tty; /* Control Terminal */ | ||
| 51 | __u32 ac_btime; /* Process Creation Time */ | ||
| 52 | comp_t ac_utime; /* User Time */ | ||
| 53 | comp_t ac_stime; /* System Time */ | ||
| 54 | comp_t ac_etime; /* Elapsed Time */ | ||
| 55 | comp_t ac_mem; /* Average Memory Usage */ | ||
| 56 | comp_t ac_io; /* Chars Transferred */ | ||
| 57 | comp_t ac_rw; /* Blocks Read or Written */ | ||
| 58 | comp_t ac_minflt; /* Minor Pagefaults */ | ||
| 59 | comp_t ac_majflt; /* Major Pagefaults */ | ||
| 60 | comp_t ac_swaps; /* Number of Swaps */ | ||
| 61 | /* m68k had no padding here. */ | ||
| 62 | #if !defined(CONFIG_M68K) || !defined(__KERNEL__) | ||
| 63 | __u16 ac_ahz; /* AHZ */ | ||
| 64 | #endif | ||
| 65 | __u32 ac_exitcode; /* Exitcode */ | ||
| 66 | char ac_comm[ACCT_COMM + 1]; /* Command Name */ | ||
| 67 | __u8 ac_etime_hi; /* Elapsed Time MSB */ | ||
| 68 | __u16 ac_etime_lo; /* Elapsed Time LSB */ | ||
| 69 | __u32 ac_uid; /* Real User ID */ | ||
| 70 | __u32 ac_gid; /* Real Group ID */ | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct acct_v3 | ||
| 74 | { | ||
| 75 | char ac_flag; /* Flags */ | ||
| 76 | char ac_version; /* Always set to ACCT_VERSION */ | ||
| 77 | __u16 ac_tty; /* Control Terminal */ | ||
| 78 | __u32 ac_exitcode; /* Exitcode */ | ||
| 79 | __u32 ac_uid; /* Real User ID */ | ||
| 80 | __u32 ac_gid; /* Real Group ID */ | ||
| 81 | __u32 ac_pid; /* Process ID */ | ||
| 82 | __u32 ac_ppid; /* Parent Process ID */ | ||
| 83 | __u32 ac_btime; /* Process Creation Time */ | ||
| 84 | #ifdef __KERNEL__ | ||
| 85 | __u32 ac_etime; /* Elapsed Time */ | ||
| 86 | #else | ||
| 87 | float ac_etime; /* Elapsed Time */ | ||
| 88 | #endif | ||
| 89 | comp_t ac_utime; /* User Time */ | ||
| 90 | comp_t ac_stime; /* System Time */ | ||
| 91 | comp_t ac_mem; /* Average Memory Usage */ | ||
| 92 | comp_t ac_io; /* Chars Transferred */ | ||
| 93 | comp_t ac_rw; /* Blocks Read or Written */ | ||
| 94 | comp_t ac_minflt; /* Minor Pagefaults */ | ||
| 95 | comp_t ac_majflt; /* Major Pagefaults */ | ||
| 96 | comp_t ac_swaps; /* Number of Swaps */ | ||
| 97 | char ac_comm[ACCT_COMM]; /* Command Name */ | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* | ||
| 101 | * accounting flags | ||
| 102 | */ | ||
| 103 | /* bit set when the process ... */ | ||
| 104 | #define AFORK 0x01 /* ... executed fork, but did not exec */ | ||
| 105 | #define ASU 0x02 /* ... used super-user privileges */ | ||
| 106 | #define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */ | ||
| 107 | #define ACORE 0x08 /* ... dumped core */ | ||
| 108 | #define AXSIG 0x10 /* ... was killed by a signal */ | ||
| 109 | |||
| 110 | #ifdef __BIG_ENDIAN | ||
| 111 | #define ACCT_BYTEORDER 0x80 /* accounting file is big endian */ | ||
| 112 | #else | ||
| 113 | #define ACCT_BYTEORDER 0x00 /* accounting file is little endian */ | ||
| 114 | #endif | ||
| 115 | |||
| 116 | #ifndef __KERNEL__ | ||
| 117 | #define ACCT_VERSION 2 | ||
| 118 | #define AHZ (HZ) | ||
| 119 | #endif /* __KERNEL */ | ||
| 120 | |||
| 121 | |||
| 122 | #endif /* _UAPI_LINUX_ACCT_H */ | ||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for ADB (Apple Desktop Bus) support. | ||
| 3 | */ | ||
| 4 | #ifndef _UAPI__ADB_H | ||
| 5 | #define _UAPI__ADB_H | ||
| 6 | |||
| 7 | /* ADB commands */ | ||
| 8 | #define ADB_BUSRESET 0 | ||
| 9 | #define ADB_FLUSH(id) (0x01 | ((id) << 4)) | ||
| 10 | #define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4)) | ||
| 11 | #define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4)) | ||
| 12 | |||
| 13 | /* ADB default device IDs (upper 4 bits of ADB command byte) */ | ||
| 14 | #define ADB_DONGLE 1 /* "software execution control" devices */ | ||
| 15 | #define ADB_KEYBOARD 2 | ||
| 16 | #define ADB_MOUSE 3 | ||
| 17 | #define ADB_TABLET 4 | ||
| 18 | #define ADB_MODEM 5 | ||
| 19 | #define ADB_MISC 7 /* maybe a monitor */ | ||
| 20 | |||
| 21 | #define ADB_RET_OK 0 | ||
| 22 | #define ADB_RET_TIMEOUT 3 | ||
| 23 | |||
| 24 | /* The kind of ADB request. The controller may emulate some | ||
| 25 | or all of those CUDA/PMU packet kinds */ | ||
| 26 | #define ADB_PACKET 0 | ||
| 27 | #define CUDA_PACKET 1 | ||
| 28 | #define ERROR_PACKET 2 | ||
| 29 | #define TIMER_PACKET 3 | ||
| 30 | #define POWER_PACKET 4 | ||
| 31 | #define MACIIC_PACKET 5 | ||
| 32 | #define PMU_PACKET 6 | ||
| 33 | #define ADB_QUERY 7 | ||
| 34 | |||
| 35 | /* ADB queries */ | ||
| 36 | |||
| 37 | /* ADB_QUERY_GETDEVINFO | ||
| 38 | * Query ADB slot for device presence | ||
| 39 | * data[2] = id, rep[0] = orig addr, rep[1] = handler_id | ||
| 40 | */ | ||
| 41 | #define ADB_QUERY_GETDEVINFO 1 | ||
| 42 | |||
| 43 | |||
| 44 | #endif /* _UAPI__ADB_H */ | ||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef _UAPI_ADFS_FS_H | ||
| 2 | #define _UAPI_ADFS_FS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/magic.h> | ||
| 6 | |||
| 7 | /* | ||
| 8 | * Disc Record at disc address 0xc00 | ||
| 9 | */ | ||
| 10 | struct adfs_discrecord { | ||
| 11 | __u8 log2secsize; | ||
| 12 | __u8 secspertrack; | ||
| 13 | __u8 heads; | ||
| 14 | __u8 density; | ||
| 15 | __u8 idlen; | ||
| 16 | __u8 log2bpmb; | ||
| 17 | __u8 skew; | ||
| 18 | __u8 bootoption; | ||
| 19 | __u8 lowsector; | ||
| 20 | __u8 nzones; | ||
| 21 | __le16 zone_spare; | ||
| 22 | __le32 root; | ||
| 23 | __le32 disc_size; | ||
| 24 | __le16 disc_id; | ||
| 25 | __u8 disc_name[10]; | ||
| 26 | __le32 disc_type; | ||
| 27 | __le32 disc_size_high; | ||
| 28 | __u8 log2sharesize:4; | ||
| 29 | __u8 unused40:4; | ||
| 30 | __u8 big_flag:1; | ||
| 31 | __u8 unused41:1; | ||
| 32 | __u8 nzones_high; | ||
| 33 | __le32 format_version; | ||
| 34 | __le32 root_size; | ||
| 35 | __u8 unused52[60 - 52]; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define ADFS_DISCRECORD (0xc00) | ||
| 39 | #define ADFS_DR_OFFSET (0x1c0) | ||
| 40 | #define ADFS_DR_SIZE 60 | ||
| 41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) | ||
| 42 | |||
| 43 | |||
| 44 | #endif /* _UAPI_ADFS_FS_H */ | ||
| @@ -0,0 +1,68 @@ | |||
| 1 | #ifndef AFFS_HARDBLOCKS_H | ||
| 2 | #define AFFS_HARDBLOCKS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* Just the needed definitions for the RDB of an Amiga HD. */ | ||
| 7 | |||
| 8 | struct RigidDiskBlock { | ||
| 9 | __u32 rdb_ID; | ||
| 10 | __be32 rdb_SummedLongs; | ||
| 11 | __s32 rdb_ChkSum; | ||
| 12 | __u32 rdb_HostID; | ||
| 13 | __be32 rdb_BlockBytes; | ||
| 14 | __u32 rdb_Flags; | ||
| 15 | __u32 rdb_BadBlockList; | ||
| 16 | __be32 rdb_PartitionList; | ||
| 17 | __u32 rdb_FileSysHeaderList; | ||
| 18 | __u32 rdb_DriveInit; | ||
| 19 | __u32 rdb_Reserved1[6]; | ||
| 20 | __u32 rdb_Cylinders; | ||
| 21 | __u32 rdb_Sectors; | ||
| 22 | __u32 rdb_Heads; | ||
| 23 | __u32 rdb_Interleave; | ||
| 24 | __u32 rdb_Park; | ||
| 25 | __u32 rdb_Reserved2[3]; | ||
| 26 | __u32 rdb_WritePreComp; | ||
| 27 | __u32 rdb_ReducedWrite; | ||
| 28 | __u32 rdb_StepRate; | ||
| 29 | __u32 rdb_Reserved3[5]; | ||
| 30 | __u32 rdb_RDBBlocksLo; | ||
| 31 | __u32 rdb_RDBBlocksHi; | ||
| 32 | __u32 rdb_LoCylinder; | ||
| 33 | __u32 rdb_HiCylinder; | ||
| 34 | __u32 rdb_CylBlocks; | ||
| 35 | __u32 rdb_AutoParkSeconds; | ||
| 36 | __u32 rdb_HighRDSKBlock; | ||
| 37 | __u32 rdb_Reserved4; | ||
| 38 | char rdb_DiskVendor[8]; | ||
| 39 | char rdb_DiskProduct[16]; | ||
| 40 | char rdb_DiskRevision[4]; | ||
| 41 | char rdb_ControllerVendor[8]; | ||
| 42 | char rdb_ControllerProduct[16]; | ||
| 43 | char rdb_ControllerRevision[4]; | ||
| 44 | __u32 rdb_Reserved5[10]; | ||
| 45 | }; | ||
| 46 | |||
| 47 | #define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ | ||
| 48 | |||
| 49 | struct PartitionBlock { | ||
| 50 | __be32 pb_ID; | ||
| 51 | __be32 pb_SummedLongs; | ||
| 52 | __s32 pb_ChkSum; | ||
| 53 | __u32 pb_HostID; | ||
| 54 | __be32 pb_Next; | ||
| 55 | __u32 pb_Flags; | ||
| 56 | __u32 pb_Reserved1[2]; | ||
| 57 | __u32 pb_DevFlags; | ||
| 58 | __u8 pb_DriveName[32]; | ||
| 59 | __u32 pb_Reserved2[15]; | ||
| 60 | __be32 pb_Environment[17]; | ||
| 61 | __u32 pb_EReserved[15]; | ||
| 62 | }; | ||
| 63 | |||
| 64 | #define IDNAME_PARTITION 0x50415254 /* "PART" */ | ||
| 65 | |||
| 66 | #define RDB_ALLOCATION_LIMIT 16 | ||
| 67 | |||
| 68 | #endif /* AFFS_HARDBLOCKS_H */ | ||
| @@ -0,0 +1,113 @@ | |||
| 1 | /* | ||
| 2 | * AGPGART module version 0.99 | ||
| 3 | * Copyright (C) 1999 Jeff Hartmann | ||
| 4 | * Copyright (C) 1999 Precision Insight, Inc. | ||
| 5 | * Copyright (C) 1999 Xi Graphics, Inc. | ||
| 6 | * | ||
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 8 | * copy of this software and associated documentation files (the "Software"), | ||
| 9 | * to deal in the Software without restriction, including without limitation | ||
| 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 11 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 12 | * Software is furnished to do so, subject to the following conditions: | ||
| 13 | * | ||
| 14 | * The above copyright notice and this permission notice shall be included | ||
| 15 | * in all copies or substantial portions of the Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 20 | * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, | ||
| 21 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| 22 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | ||
| 23 | * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef _UAPI_AGP_H | ||
| 28 | #define _UAPI_AGP_H | ||
| 29 | |||
| 30 | #define AGPIOC_BASE 'A' | ||
| 31 | #define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*) | ||
| 32 | #define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1) | ||
| 33 | #define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2) | ||
| 34 | #define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*) | ||
| 35 | #define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*) | ||
| 36 | #define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*) | ||
| 37 | #define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*) | ||
| 38 | #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) | ||
| 39 | #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) | ||
| 40 | #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) | ||
| 41 | #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10) | ||
| 42 | |||
| 43 | #define AGP_DEVICE "/dev/agpgart" | ||
| 44 | |||
| 45 | #ifndef TRUE | ||
| 46 | #define TRUE 1 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #ifndef FALSE | ||
| 50 | #define FALSE 0 | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #ifndef __KERNEL__ | ||
| 54 | #include <linux/types.h> | ||
| 55 | |||
| 56 | struct agp_version { | ||
| 57 | __u16 major; | ||
| 58 | __u16 minor; | ||
| 59 | }; | ||
| 60 | |||
| 61 | typedef struct _agp_info { | ||
| 62 | struct agp_version version; /* version of the driver */ | ||
| 63 | __u32 bridge_id; /* bridge vendor/device */ | ||
| 64 | __u32 agp_mode; /* mode info of bridge */ | ||
| 65 | unsigned long aper_base;/* base of aperture */ | ||
| 66 | size_t aper_size; /* size of aperture */ | ||
| 67 | size_t pg_total; /* max pages (swap + system) */ | ||
| 68 | size_t pg_system; /* max pages (system) */ | ||
| 69 | size_t pg_used; /* current pages used */ | ||
| 70 | } agp_info; | ||
| 71 | |||
| 72 | typedef struct _agp_setup { | ||
| 73 | __u32 agp_mode; /* mode info of bridge */ | ||
| 74 | } agp_setup; | ||
| 75 | |||
| 76 | /* | ||
| 77 | * The "prot" down below needs still a "sleep" flag somehow ... | ||
| 78 | */ | ||
| 79 | typedef struct _agp_segment { | ||
| 80 | __kernel_off_t pg_start; /* starting page to populate */ | ||
| 81 | __kernel_size_t pg_count; /* number of pages */ | ||
| 82 | int prot; /* prot flags for mmap */ | ||
| 83 | } agp_segment; | ||
| 84 | |||
| 85 | typedef struct _agp_region { | ||
| 86 | __kernel_pid_t pid; /* pid of process */ | ||
| 87 | __kernel_size_t seg_count; /* number of segments */ | ||
| 88 | struct _agp_segment *seg_list; | ||
| 89 | } agp_region; | ||
| 90 | |||
| 91 | typedef struct _agp_allocate { | ||
| 92 | int key; /* tag of allocation */ | ||
| 93 | __kernel_size_t pg_count;/* number of pages */ | ||
| 94 | __u32 type; /* 0 == normal, other devspec */ | ||
| 95 | __u32 physical; /* device specific (some devices | ||
| 96 | * need a phys address of the | ||
| 97 | * actual page behind the gatt | ||
| 98 | * table) */ | ||
| 99 | } agp_allocate; | ||
| 100 | |||
| 101 | typedef struct _agp_bind { | ||
| 102 | int key; /* tag of allocation */ | ||
| 103 | __kernel_off_t pg_start;/* starting page to populate */ | ||
| 104 | } agp_bind; | ||
| 105 | |||
| 106 | typedef struct _agp_unbind { | ||
| 107 | int key; /* tag of allocation */ | ||
| 108 | __u32 priority; /* priority for paging out */ | ||
| 109 | } agp_unbind; | ||
| 110 | |||
| 111 | #endif /* __KERNEL__ */ | ||
| 112 | |||
| 113 | #endif /* _UAPI_AGP_H */ | ||
| @@ -0,0 +1,111 @@ | |||
| 1 | /* include/linux/aio_abi.h | ||
| 2 | * | ||
| 3 | * Copyright 2000,2001,2002 Red Hat. | ||
| 4 | * | ||
| 5 | * Written by Benjamin LaHaise <bcrl@kvack.org> | ||
| 6 | * | ||
| 7 | * Distribute under the terms of the GPLv2 (see ../../COPYING) or under | ||
| 8 | * the following terms. | ||
| 9 | * | ||
| 10 | * Permission to use, copy, modify, and distribute this software and its | ||
| 11 | * documentation is hereby granted, provided that the above copyright | ||
| 12 | * notice appears in all copies. This software is provided without any | ||
| 13 | * warranty, express or implied. Red Hat makes no representations about | ||
| 14 | * the suitability of this software for any purpose. | ||
| 15 | * | ||
| 16 | * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, | ||
| 17 | * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF | ||
| 18 | * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED | ||
| 19 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 20 | * | ||
| 21 | * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 23 | * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND | ||
| 24 | * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, | ||
| 25 | * ENHANCEMENTS, OR MODIFICATIONS. | ||
| 26 | */ | ||
| 27 | #ifndef __LINUX__AIO_ABI_H | ||
| 28 | #define __LINUX__AIO_ABI_H | ||
| 29 | |||
| 30 | #include <linux/types.h> | ||
| 31 | #include <asm/byteorder.h> | ||
| 32 | |||
| 33 | typedef __kernel_ulong_t aio_context_t; | ||
| 34 | |||
| 35 | enum { | ||
| 36 | IOCB_CMD_PREAD = 0, | ||
| 37 | IOCB_CMD_PWRITE = 1, | ||
| 38 | IOCB_CMD_FSYNC = 2, | ||
| 39 | IOCB_CMD_FDSYNC = 3, | ||
| 40 | /* These two are experimental. | ||
| 41 | * IOCB_CMD_PREADX = 4, | ||
| 42 | * IOCB_CMD_POLL = 5, | ||
| 43 | */ | ||
| 44 | IOCB_CMD_NOOP = 6, | ||
| 45 | IOCB_CMD_PREADV = 7, | ||
| 46 | IOCB_CMD_PWRITEV = 8, | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Valid flags for the "aio_flags" member of the "struct iocb". | ||
| 51 | * | ||
| 52 | * IOCB_FLAG_RESFD - Set if the "aio_resfd" member of the "struct iocb" | ||
| 53 | * is valid. | ||
| 54 | */ | ||
| 55 | #define IOCB_FLAG_RESFD (1 << 0) | ||
| 56 | |||
| 57 | /* read() from /dev/aio returns these structures. */ | ||
| 58 | struct io_event { | ||
| 59 | __u64 data; /* the data field from the iocb */ | ||
| 60 | __u64 obj; /* what iocb this event came from */ | ||
| 61 | __s64 res; /* result code for this event */ | ||
| 62 | __s64 res2; /* secondary result */ | ||
| 63 | }; | ||
| 64 | |||
| 65 | #if defined(__LITTLE_ENDIAN) | ||
| 66 | #define PADDED(x,y) x, y | ||
| 67 | #elif defined(__BIG_ENDIAN) | ||
| 68 | #define PADDED(x,y) y, x | ||
| 69 | #else | ||
| 70 | #error edit for your odd byteorder. | ||
| 71 | #endif | ||
| 72 | |||
| 73 | /* | ||
| 74 | * we always use a 64bit off_t when communicating | ||
| 75 | * with userland. its up to libraries to do the | ||
| 76 | * proper padding and aio_error abstraction | ||
| 77 | */ | ||
| 78 | |||
| 79 | struct iocb { | ||
| 80 | /* these are internal to the kernel/libc. */ | ||
| 81 | __u64 aio_data; /* data to be returned in event's data */ | ||
| 82 | __u32 PADDED(aio_key, aio_reserved1); | ||
| 83 | /* the kernel sets aio_key to the req # */ | ||
| 84 | |||
| 85 | /* common fields */ | ||
| 86 | __u16 aio_lio_opcode; /* see IOCB_CMD_ above */ | ||
| 87 | __s16 aio_reqprio; | ||
| 88 | __u32 aio_fildes; | ||
| 89 | |||
| 90 | __u64 aio_buf; | ||
| 91 | __u64 aio_nbytes; | ||
| 92 | __s64 aio_offset; | ||
| 93 | |||
| 94 | /* extra parameters */ | ||
| 95 | __u64 aio_reserved2; /* TODO: use this for a (struct sigevent *) */ | ||
| 96 | |||
| 97 | /* flags for the "struct iocb" */ | ||
| 98 | __u32 aio_flags; | ||
| 99 | |||
| 100 | /* | ||
| 101 | * if the IOCB_FLAG_RESFD flag of "aio_flags" is set, this is an | ||
| 102 | * eventfd to signal AIO readiness to | ||
| 103 | */ | ||
| 104 | __u32 aio_resfd; | ||
| 105 | }; /* 64 bytes */ | ||
| 106 | |||
| 107 | #undef IFBIG | ||
| 108 | #undef IFLITTLE | ||
| 109 | |||
| 110 | #endif /* __LINUX__AIO_ABI_H */ | ||
| 111 | |||
| @@ -0,0 +1,135 @@ | |||
| 1 | /* | ||
| 2 | * Include file for the interface to an APM BIOS | ||
| 3 | * Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au) | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2, or (at your option) any | ||
| 8 | * later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | */ | ||
| 15 | #ifndef _UAPI_LINUX_APM_H | ||
| 16 | #define _UAPI_LINUX_APM_H | ||
| 17 | |||
| 18 | |||
| 19 | #include <linux/types.h> | ||
| 20 | |||
| 21 | typedef unsigned short apm_event_t; | ||
| 22 | typedef unsigned short apm_eventinfo_t; | ||
| 23 | |||
| 24 | struct apm_bios_info { | ||
| 25 | __u16 version; | ||
| 26 | __u16 cseg; | ||
| 27 | __u32 offset; | ||
| 28 | __u16 cseg_16; | ||
| 29 | __u16 dseg; | ||
| 30 | __u16 flags; | ||
| 31 | __u16 cseg_len; | ||
| 32 | __u16 cseg_16_len; | ||
| 33 | __u16 dseg_len; | ||
| 34 | }; | ||
| 35 | |||
| 36 | |||
| 37 | /* | ||
| 38 | * Power states | ||
| 39 | */ | ||
| 40 | #define APM_STATE_READY 0x0000 | ||
| 41 | #define APM_STATE_STANDBY 0x0001 | ||
| 42 | #define APM_STATE_SUSPEND 0x0002 | ||
| 43 | #define APM_STATE_OFF 0x0003 | ||
| 44 | #define APM_STATE_BUSY 0x0004 | ||
| 45 | #define APM_STATE_REJECT 0x0005 | ||
| 46 | #define APM_STATE_OEM_SYS 0x0020 | ||
| 47 | #define APM_STATE_OEM_DEV 0x0040 | ||
| 48 | |||
| 49 | #define APM_STATE_DISABLE 0x0000 | ||
| 50 | #define APM_STATE_ENABLE 0x0001 | ||
| 51 | |||
| 52 | #define APM_STATE_DISENGAGE 0x0000 | ||
| 53 | #define APM_STATE_ENGAGE 0x0001 | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Events (results of Get PM Event) | ||
| 57 | */ | ||
| 58 | #define APM_SYS_STANDBY 0x0001 | ||
| 59 | #define APM_SYS_SUSPEND 0x0002 | ||
| 60 | #define APM_NORMAL_RESUME 0x0003 | ||
| 61 | #define APM_CRITICAL_RESUME 0x0004 | ||
| 62 | #define APM_LOW_BATTERY 0x0005 | ||
| 63 | #define APM_POWER_STATUS_CHANGE 0x0006 | ||
| 64 | #define APM_UPDATE_TIME 0x0007 | ||
| 65 | #define APM_CRITICAL_SUSPEND 0x0008 | ||
| 66 | #define APM_USER_STANDBY 0x0009 | ||
| 67 | #define APM_USER_SUSPEND 0x000a | ||
| 68 | #define APM_STANDBY_RESUME 0x000b | ||
| 69 | #define APM_CAPABILITY_CHANGE 0x000c | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Error codes | ||
| 73 | */ | ||
| 74 | #define APM_SUCCESS 0x00 | ||
| 75 | #define APM_DISABLED 0x01 | ||
| 76 | #define APM_CONNECTED 0x02 | ||
| 77 | #define APM_NOT_CONNECTED 0x03 | ||
| 78 | #define APM_16_CONNECTED 0x05 | ||
| 79 | #define APM_16_UNSUPPORTED 0x06 | ||
| 80 | #define APM_32_CONNECTED 0x07 | ||
| 81 | #define APM_32_UNSUPPORTED 0x08 | ||
| 82 | #define APM_BAD_DEVICE 0x09 | ||
| 83 | #define APM_BAD_PARAM 0x0a | ||
| 84 | #define APM_NOT_ENGAGED 0x0b | ||
| 85 | #define APM_BAD_FUNCTION 0x0c | ||
| 86 | #define APM_RESUME_DISABLED 0x0d | ||
| 87 | #define APM_NO_ERROR 0x53 | ||
| 88 | #define APM_BAD_STATE 0x60 | ||
| 89 | #define APM_NO_EVENTS 0x80 | ||
| 90 | #define APM_NOT_PRESENT 0x86 | ||
| 91 | |||
| 92 | /* | ||
| 93 | * APM Device IDs | ||
| 94 | */ | ||
| 95 | #define APM_DEVICE_BIOS 0x0000 | ||
| 96 | #define APM_DEVICE_ALL 0x0001 | ||
| 97 | #define APM_DEVICE_DISPLAY 0x0100 | ||
| 98 | #define APM_DEVICE_STORAGE 0x0200 | ||
| 99 | #define APM_DEVICE_PARALLEL 0x0300 | ||
| 100 | #define APM_DEVICE_SERIAL 0x0400 | ||
| 101 | #define APM_DEVICE_NETWORK 0x0500 | ||
| 102 | #define APM_DEVICE_PCMCIA 0x0600 | ||
| 103 | #define APM_DEVICE_BATTERY 0x8000 | ||
| 104 | #define APM_DEVICE_OEM 0xe000 | ||
| 105 | #define APM_DEVICE_OLD_ALL 0xffff | ||
| 106 | #define APM_DEVICE_CLASS 0x00ff | ||
| 107 | #define APM_DEVICE_MASK 0xff00 | ||
| 108 | |||
| 109 | |||
| 110 | /* | ||
| 111 | * Battery status | ||
| 112 | */ | ||
| 113 | #define APM_MAX_BATTERIES 2 | ||
| 114 | |||
| 115 | /* | ||
| 116 | * APM defined capability bit flags | ||
| 117 | */ | ||
| 118 | #define APM_CAP_GLOBAL_STANDBY 0x0001 | ||
| 119 | #define APM_CAP_GLOBAL_SUSPEND 0x0002 | ||
| 120 | #define APM_CAP_RESUME_STANDBY_TIMER 0x0004 /* Timer resume from standby */ | ||
| 121 | #define APM_CAP_RESUME_SUSPEND_TIMER 0x0008 /* Timer resume from suspend */ | ||
| 122 | #define APM_CAP_RESUME_STANDBY_RING 0x0010 /* Resume on Ring fr standby */ | ||
| 123 | #define APM_CAP_RESUME_SUSPEND_RING 0x0020 /* Resume on Ring fr suspend */ | ||
| 124 | #define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040 /* Resume on PCMCIA Ring */ | ||
| 125 | #define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080 /* Resume on PCMCIA Ring */ | ||
| 126 | |||
| 127 | /* | ||
| 128 | * ioctl operations | ||
| 129 | */ | ||
| 130 | #include <linux/ioctl.h> | ||
| 131 | |||
| 132 | #define APM_IOC_STANDBY _IO('A', 1) | ||
| 133 | #define APM_IOC_SUSPEND _IO('A', 2) | ||
| 134 | |||
| 135 | #endif /* _UAPI_LINUX_APM_H */ | ||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef __LINUX_ARCFB_H__ | ||
| 2 | #define __LINUX_ARCFB_H__ | ||
| 3 | |||
| 4 | #define FBIO_WAITEVENT _IO('F', 0x88) | ||
| 5 | #define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t) | ||
| 6 | |||
| 7 | #endif | ||
| 8 | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef _UAPI__LINUX_ATALK_H__ | ||
| 2 | #define _UAPI__LINUX_ATALK_H__ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <asm/byteorder.h> | ||
| 6 | #include <linux/socket.h> | ||
| 7 | |||
| 8 | /* | ||
| 9 | * AppleTalk networking structures | ||
| 10 | * | ||
| 11 | * The following are directly referenced from the University Of Michigan | ||
| 12 | * netatalk for compatibility reasons. | ||
| 13 | */ | ||
| 14 | #define ATPORT_FIRST 1 | ||
| 15 | #define ATPORT_RESERVED 128 | ||
| 16 | #define ATPORT_LAST 254 /* 254 is only legal on localtalk */ | ||
| 17 | #define ATADDR_ANYNET (__u16)0 | ||
| 18 | #define ATADDR_ANYNODE (__u8)0 | ||
| 19 | #define ATADDR_ANYPORT (__u8)0 | ||
| 20 | #define ATADDR_BCAST (__u8)255 | ||
| 21 | #define DDP_MAXSZ 587 | ||
| 22 | #define DDP_MAXHOPS 15 /* 4 bits of hop counter */ | ||
| 23 | |||
| 24 | #define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0) | ||
| 25 | |||
| 26 | struct atalk_addr { | ||
| 27 | __be16 s_net; | ||
| 28 | __u8 s_node; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct sockaddr_at { | ||
| 32 | __kernel_sa_family_t sat_family; | ||
| 33 | __u8 sat_port; | ||
| 34 | struct atalk_addr sat_addr; | ||
| 35 | char sat_zero[8]; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct atalk_netrange { | ||
| 39 | __u8 nr_phase; | ||
| 40 | __be16 nr_firstnet; | ||
| 41 | __be16 nr_lastnet; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif /* _UAPI__LINUX_ATALK_H__ */ | ||
| @@ -0,0 +1,241 @@ | |||
| 1 | /* atm.h - general ATM declarations */ | ||
| 2 | |||
| 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | /* | ||
| 7 | * WARNING: User-space programs should not #include <linux/atm.h> directly. | ||
| 8 | * Instead, #include <atm.h> | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _UAPI_LINUX_ATM_H | ||
| 12 | #define _UAPI_LINUX_ATM_H | ||
| 13 | |||
| 14 | /* | ||
| 15 | * BEGIN_xx and END_xx markers are used for automatic generation of | ||
| 16 | * documentation. Do not change them. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/compiler.h> | ||
| 20 | #include <linux/atmapi.h> | ||
| 21 | #include <linux/atmsap.h> | ||
| 22 | #include <linux/atmioc.h> | ||
| 23 | #include <linux/types.h> | ||
| 24 | |||
| 25 | |||
| 26 | /* general ATM constants */ | ||
| 27 | #define ATM_CELL_SIZE 53 /* ATM cell size incl. header */ | ||
| 28 | #define ATM_CELL_PAYLOAD 48 /* ATM payload size */ | ||
| 29 | #define ATM_AAL0_SDU 52 /* AAL0 SDU size */ | ||
| 30 | #define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */ | ||
| 31 | #define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */ | ||
| 32 | #define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */ | ||
| 33 | #define ATM_MAX_CDV 9999 /* maximum (default) CDV */ | ||
| 34 | #define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */ | ||
| 35 | |||
| 36 | #define ATM_MAX_VPI 255 /* maximum VPI at the UNI */ | ||
| 37 | #define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */ | ||
| 38 | #define ATM_MAX_VCI 65535 /* maximum VCI */ | ||
| 39 | |||
| 40 | |||
| 41 | /* "protcol" values for the socket system call */ | ||
| 42 | #define ATM_NO_AAL 0 /* AAL not specified */ | ||
| 43 | #define ATM_AAL0 13 /* "raw" ATM cells */ | ||
| 44 | #define ATM_AAL1 1 /* AAL1 (CBR) */ | ||
| 45 | #define ATM_AAL2 2 /* AAL2 (VBR) */ | ||
| 46 | #define ATM_AAL34 3 /* AAL3/4 (data) */ | ||
| 47 | #define ATM_AAL5 5 /* AAL5 (data) */ | ||
| 48 | |||
| 49 | /* | ||
| 50 | * socket option name coding functions | ||
| 51 | * | ||
| 52 | * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the | ||
| 53 | * << 22 only reserves 9 bits for the level. On some architectures | ||
| 54 | * SOL_SOCKET is 0xFFFF, so that's a bit of a problem | ||
| 55 | */ | ||
| 56 | |||
| 57 | #define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \ | ||
| 58 | sizeof(t)) | ||
| 59 | #define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF)) | ||
| 60 | #define __SO_NUMBER(c) (((c) >> 16) & 0x3f) | ||
| 61 | #define __SO_SIZE(c) ((c) & 0x3fff) | ||
| 62 | |||
| 63 | /* | ||
| 64 | * ATM layer | ||
| 65 | */ | ||
| 66 | |||
| 67 | #define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int) | ||
| 68 | /* set CLP bit value - TODO */ | ||
| 69 | #define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange) | ||
| 70 | /* connection identifier range; socket must be | ||
| 71 | bound or connected */ | ||
| 72 | #define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos) | ||
| 73 | /* Quality of Service setting */ | ||
| 74 | #define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap) | ||
| 75 | /* Service Access Point */ | ||
| 76 | #define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc) | ||
| 77 | /* "PVC" address (also for SVCs); get only */ | ||
| 78 | #define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int) | ||
| 79 | /* make this vc a p2mp */ | ||
| 80 | |||
| 81 | |||
| 82 | /* | ||
| 83 | * Note @@@: since the socket layers don't really distinguish the control and | ||
| 84 | * the data plane but generally seems to be data plane-centric, any layer is | ||
| 85 | * about equally wrong for the SAP. If you have a better idea about this, | ||
| 86 | * please speak up ... | ||
| 87 | */ | ||
| 88 | |||
| 89 | |||
| 90 | /* ATM cell header (for AAL0) */ | ||
| 91 | |||
| 92 | /* BEGIN_CH */ | ||
| 93 | #define ATM_HDR_GFC_MASK 0xf0000000 | ||
| 94 | #define ATM_HDR_GFC_SHIFT 28 | ||
| 95 | #define ATM_HDR_VPI_MASK 0x0ff00000 | ||
| 96 | #define ATM_HDR_VPI_SHIFT 20 | ||
| 97 | #define ATM_HDR_VCI_MASK 0x000ffff0 | ||
| 98 | #define ATM_HDR_VCI_SHIFT 4 | ||
| 99 | #define ATM_HDR_PTI_MASK 0x0000000e | ||
| 100 | #define ATM_HDR_PTI_SHIFT 1 | ||
| 101 | #define ATM_HDR_CLP 0x00000001 | ||
| 102 | /* END_CH */ | ||
| 103 | |||
| 104 | |||
| 105 | /* PTI codings */ | ||
| 106 | |||
| 107 | /* BEGIN_PTI */ | ||
| 108 | #define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */ | ||
| 109 | #define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */ | ||
| 110 | #define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */ | ||
| 111 | #define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */ | ||
| 112 | #define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */ | ||
| 113 | #define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */ | ||
| 114 | #define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */ | ||
| 115 | #define ATM_PTI_RSV 7 /* reserved */ | ||
| 116 | /* END_PTI */ | ||
| 117 | |||
| 118 | |||
| 119 | /* | ||
| 120 | * The following items should stay in linux/atm.h, which should be linked to | ||
| 121 | * netatm/atm.h | ||
| 122 | */ | ||
| 123 | |||
| 124 | /* Traffic description */ | ||
| 125 | |||
| 126 | #define ATM_NONE 0 /* no traffic */ | ||
| 127 | #define ATM_UBR 1 | ||
| 128 | #define ATM_CBR 2 | ||
| 129 | #define ATM_VBR 3 | ||
| 130 | #define ATM_ABR 4 | ||
| 131 | #define ATM_ANYCLASS 5 /* compatible with everything */ | ||
| 132 | |||
| 133 | #define ATM_MAX_PCR -1 /* maximum available PCR */ | ||
| 134 | |||
| 135 | struct atm_trafprm { | ||
| 136 | unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */ | ||
| 137 | int max_pcr; /* maximum PCR in cells per second */ | ||
| 138 | int pcr; /* desired PCR in cells per second */ | ||
| 139 | int min_pcr; /* minimum PCR in cells per second */ | ||
| 140 | int max_cdv; /* maximum CDV in microseconds */ | ||
| 141 | int max_sdu; /* maximum SDU in bytes */ | ||
| 142 | /* extra params for ABR */ | ||
| 143 | unsigned int icr; /* Initial Cell Rate (24-bit) */ | ||
| 144 | unsigned int tbe; /* Transient Buffer Exposure (24-bit) */ | ||
| 145 | unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */ | ||
| 146 | unsigned int rif : 4; /* Rate Increment Factor (4-bit) */ | ||
| 147 | unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */ | ||
| 148 | unsigned int nrm_pres :1; /* nrm present bit */ | ||
| 149 | unsigned int trm_pres :1; /* rm present bit */ | ||
| 150 | unsigned int adtf_pres :1; /* adtf present bit */ | ||
| 151 | unsigned int cdf_pres :1; /* cdf present bit*/ | ||
| 152 | unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */ | ||
| 153 | unsigned int trm :3; /* Time between forward RM cells (3-bit) */ | ||
| 154 | unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */ | ||
| 155 | unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */ | ||
| 156 | unsigned int spare :9; /* spare bits */ | ||
| 157 | }; | ||
| 158 | |||
| 159 | struct atm_qos { | ||
| 160 | struct atm_trafprm txtp; /* parameters in TX direction */ | ||
| 161 | struct atm_trafprm rxtp __ATM_API_ALIGN; | ||
| 162 | /* parameters in RX direction */ | ||
| 163 | unsigned char aal __ATM_API_ALIGN; | ||
| 164 | }; | ||
| 165 | |||
| 166 | /* PVC addressing */ | ||
| 167 | |||
| 168 | #define ATM_ITF_ANY -1 /* "magic" PVC address values */ | ||
| 169 | #define ATM_VPI_ANY -1 | ||
| 170 | #define ATM_VCI_ANY -1 | ||
| 171 | #define ATM_VPI_UNSPEC -2 | ||
| 172 | #define ATM_VCI_UNSPEC -2 | ||
| 173 | |||
| 174 | |||
| 175 | struct sockaddr_atmpvc { | ||
| 176 | unsigned short sap_family; /* address family, AF_ATMPVC */ | ||
| 177 | struct { /* PVC address */ | ||
| 178 | short itf; /* ATM interface */ | ||
| 179 | short vpi; /* VPI (only 8 bits at UNI) */ | ||
| 180 | int vci; /* VCI (only 16 bits at UNI) */ | ||
| 181 | } sap_addr __ATM_API_ALIGN; /* PVC address */ | ||
| 182 | }; | ||
| 183 | |||
| 184 | /* SVC addressing */ | ||
| 185 | |||
| 186 | #define ATM_ESA_LEN 20 /* ATM End System Address length */ | ||
| 187 | #define ATM_E164_LEN 12 /* maximum E.164 number length */ | ||
| 188 | |||
| 189 | #define ATM_AFI_DCC 0x39 /* DCC ATM Format */ | ||
| 190 | #define ATM_AFI_ICD 0x47 /* ICD ATM Format */ | ||
| 191 | #define ATM_AFI_E164 0x45 /* E.164 ATM Format */ | ||
| 192 | #define ATM_AFI_LOCAL 0x49 /* Local ATM Format */ | ||
| 193 | |||
| 194 | #define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */ | ||
| 195 | #define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */ | ||
| 196 | #define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */ | ||
| 197 | #define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */ | ||
| 198 | |||
| 199 | #define ATM_LIJ_NONE 0 /* no leaf-initiated join */ | ||
| 200 | #define ATM_LIJ 1 /* request joining */ | ||
| 201 | #define ATM_LIJ_RPJ 2 /* set to root-prompted join */ | ||
| 202 | #define ATM_LIJ_NJ 3 /* set to network join */ | ||
| 203 | |||
| 204 | |||
| 205 | struct sockaddr_atmsvc { | ||
| 206 | unsigned short sas_family; /* address family, AF_ATMSVC */ | ||
| 207 | struct { /* SVC address */ | ||
| 208 | unsigned char prv[ATM_ESA_LEN];/* private ATM address */ | ||
| 209 | char pub[ATM_E164_LEN+1]; /* public address (E.164) */ | ||
| 210 | /* unused addresses must be bzero'ed */ | ||
| 211 | char lij_type; /* role in LIJ call; one of ATM_LIJ* */ | ||
| 212 | __u32 lij_id; /* LIJ call identifier */ | ||
| 213 | } sas_addr __ATM_API_ALIGN; /* SVC address */ | ||
| 214 | }; | ||
| 215 | |||
| 216 | |||
| 217 | static __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr) | ||
| 218 | { | ||
| 219 | return *addr.sas_addr.prv || *addr.sas_addr.pub; | ||
| 220 | } | ||
| 221 | |||
| 222 | |||
| 223 | static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr) | ||
| 224 | { | ||
| 225 | return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci; | ||
| 226 | } | ||
| 227 | |||
| 228 | |||
| 229 | /* | ||
| 230 | * Some stuff for linux/sockios.h | ||
| 231 | */ | ||
| 232 | |||
| 233 | struct atmif_sioc { | ||
| 234 | int number; | ||
| 235 | int length; | ||
| 236 | void __user *arg; | ||
| 237 | }; | ||
| 238 | |||
| 239 | |||
| 240 | typedef unsigned short atm_backend_t; | ||
| 241 | #endif /* _UAPI_LINUX_ATM_H */ | ||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* atm_eni.h - Driver-specific declarations of the ENI driver (for use by | ||
| 2 | driver-specific utilities) */ | ||
| 3 | |||
| 4 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 5 | |||
| 6 | |||
| 7 | #ifndef LINUX_ATM_ENI_H | ||
| 8 | #define LINUX_ATM_ENI_H | ||
| 9 | |||
| 10 | #include <linux/atmioc.h> | ||
| 11 | |||
| 12 | |||
| 13 | struct eni_multipliers { | ||
| 14 | int tx,rx; /* values are in percent and must be > 100 */ | ||
| 15 | }; | ||
| 16 | |||
| 17 | |||
| 18 | #define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc) | ||
| 19 | /* printk memory map */ | ||
| 20 | #define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc) | ||
| 21 | /* set buffer multipliers */ | ||
| 22 | |||
| 23 | #endif | ||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* atm_he.h */ | ||
| 2 | |||
| 3 | #ifndef LINUX_ATM_HE_H | ||
| 4 | #define LINUX_ATM_HE_H | ||
| 5 | |||
| 6 | #include <linux/atmioc.h> | ||
| 7 | |||
| 8 | #define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc) | ||
| 9 | |||
| 10 | #define HE_REGTYPE_PCI 1 | ||
| 11 | #define HE_REGTYPE_RCM 2 | ||
| 12 | #define HE_REGTYPE_TCM 3 | ||
| 13 | #define HE_REGTYPE_MBOX 4 | ||
| 14 | |||
| 15 | struct he_ioctl_reg { | ||
| 16 | unsigned addr, val; | ||
| 17 | char type; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* LINUX_ATM_HE_H */ | ||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for | ||
| 2 | * use by driver-specific utilities) */ | ||
| 3 | |||
| 4 | /* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */ | ||
| 5 | |||
| 6 | |||
| 7 | #ifndef LINUX_ATM_IDT77105_H | ||
| 8 | #define LINUX_ATM_IDT77105_H | ||
| 9 | |||
| 10 | #include <linux/types.h> | ||
| 11 | #include <linux/atmioc.h> | ||
| 12 | #include <linux/atmdev.h> | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls. | ||
| 16 | * Pointed to by `arg' in atmif_sioc. | ||
| 17 | */ | ||
| 18 | struct idt77105_stats { | ||
| 19 | __u32 symbol_errors; /* wire symbol errors */ | ||
| 20 | __u32 tx_cells; /* cells transmitted */ | ||
| 21 | __u32 rx_cells; /* cells received */ | ||
| 22 | __u32 rx_hec_errors; /* Header Error Check errors on receive */ | ||
| 23 | }; | ||
| 24 | |||
| 25 | #define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */ | ||
| 26 | #define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */ | ||
| 27 | |||
| 28 | #endif | ||
| @@ -0,0 +1,53 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * | ||
| 3 | * atm_nicstar.h | ||
| 4 | * | ||
| 5 | * Driver-specific declarations for use by NICSTAR driver specific utils. | ||
| 6 | * | ||
| 7 | * Author: Rui Prior | ||
| 8 | * | ||
| 9 | * (C) INESC 1998 | ||
| 10 | * | ||
| 11 | ******************************************************************************/ | ||
| 12 | |||
| 13 | |||
| 14 | #ifndef LINUX_ATM_NICSTAR_H | ||
| 15 | #define LINUX_ATM_NICSTAR_H | ||
| 16 | |||
| 17 | /* Note: non-kernel programs including this file must also include | ||
| 18 | * sys/types.h for struct timeval | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <linux/atmapi.h> | ||
| 22 | #include <linux/atmioc.h> | ||
| 23 | |||
| 24 | #define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc) | ||
| 25 | /* get pool statistics */ | ||
| 26 | #define NS_SETBUFLEV _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc) | ||
| 27 | /* set buffer level markers */ | ||
| 28 | #define NS_ADJBUFLEV _IO('a',ATMIOC_SARPRV+3) | ||
| 29 | /* adjust buffer level */ | ||
| 30 | |||
| 31 | typedef struct buf_nr | ||
| 32 | { | ||
| 33 | unsigned min; | ||
| 34 | unsigned init; | ||
| 35 | unsigned max; | ||
| 36 | }buf_nr; | ||
| 37 | |||
| 38 | |||
| 39 | typedef struct pool_levels | ||
| 40 | { | ||
| 41 | int buftype; | ||
| 42 | int count; /* (At least for now) only used in NS_GETPSTAT */ | ||
| 43 | buf_nr level; | ||
| 44 | } pool_levels; | ||
| 45 | |||
| 46 | /* type must be one of the following: */ | ||
| 47 | #define NS_BUFTYPE_SMALL 1 | ||
| 48 | #define NS_BUFTYPE_LARGE 2 | ||
| 49 | #define NS_BUFTYPE_HUGE 3 | ||
| 50 | #define NS_BUFTYPE_IOVEC 4 | ||
| 51 | |||
| 52 | |||
| 53 | #endif /* LINUX_ATM_NICSTAR_H */ | ||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by | ||
| 2 | driver-specific utilities) */ | ||
| 3 | |||
| 4 | /* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 5 | |||
| 6 | |||
| 7 | #ifndef _UAPILINUX_ATM_TCP_H | ||
| 8 | #define _UAPILINUX_ATM_TCP_H | ||
| 9 | |||
| 10 | #include <linux/atmapi.h> | ||
| 11 | #include <linux/atm.h> | ||
| 12 | #include <linux/atmioc.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | |||
| 16 | /* | ||
| 17 | * All values in struct atmtcp_hdr are in network byte order | ||
| 18 | */ | ||
| 19 | |||
| 20 | struct atmtcp_hdr { | ||
| 21 | __u16 vpi; | ||
| 22 | __u16 vci; | ||
| 23 | __u32 length; /* ... of data part */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* | ||
| 27 | * All values in struct atmtcp_command are in host byte order | ||
| 28 | */ | ||
| 29 | |||
| 30 | #define ATMTCP_HDR_MAGIC (~0) /* this length indicates a command */ | ||
| 31 | #define ATMTCP_CTRL_OPEN 1 /* request/reply */ | ||
| 32 | #define ATMTCP_CTRL_CLOSE 2 /* request/reply */ | ||
| 33 | |||
| 34 | struct atmtcp_control { | ||
| 35 | struct atmtcp_hdr hdr; /* must be first */ | ||
| 36 | int type; /* message type; both directions */ | ||
| 37 | atm_kptr_t vcc; /* both directions */ | ||
| 38 | struct sockaddr_atmpvc addr; /* suggested value from kernel */ | ||
| 39 | struct atm_qos qos; /* both directions */ | ||
| 40 | int result; /* to kernel only */ | ||
| 41 | } __ATM_API_ALIGN; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * Field usage: | ||
| 45 | * Messge type dir. hdr.v?i type addr qos vcc result | ||
| 46 | * ----------- ---- ------- ---- ---- --- --- ------ | ||
| 47 | * OPEN K->D Y Y Y Y Y 0 | ||
| 48 | * OPEN D->K - Y Y Y Y Y | ||
| 49 | * CLOSE K->D - - Y - Y 0 | ||
| 50 | * CLOSE D->K - - - - Y Y | ||
| 51 | */ | ||
| 52 | |||
| 53 | #define SIOCSIFATMTCP _IO('a',ATMIOC_ITF) /* set ATMTCP mode */ | ||
| 54 | #define ATMTCP_CREATE _IO('a',ATMIOC_ITF+14) /* create persistent ATMTCP | ||
| 55 | interface */ | ||
| 56 | #define ATMTCP_REMOVE _IO('a',ATMIOC_ITF+15) /* destroy persistent ATMTCP | ||
| 57 | interface */ | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | #endif /* _UAPILINUX_ATM_TCP_H */ | ||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by | ||
| 2 | driver-specific utilities) */ | ||
| 3 | |||
| 4 | /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 5 | |||
| 6 | |||
| 7 | #ifndef LINUX_ATM_ZATM_H | ||
| 8 | #define LINUX_ATM_ZATM_H | ||
| 9 | |||
| 10 | /* | ||
| 11 | * Note: non-kernel programs including this file must also include | ||
| 12 | * sys/types.h for struct timeval | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include <linux/atmapi.h> | ||
| 16 | #include <linux/atmioc.h> | ||
| 17 | |||
| 18 | #define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc) | ||
| 19 | /* get pool statistics */ | ||
| 20 | #define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc) | ||
| 21 | /* get statistics and zero */ | ||
| 22 | #define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc) | ||
| 23 | /* set pool parameters */ | ||
| 24 | |||
| 25 | struct zatm_pool_info { | ||
| 26 | int ref_count; /* free buffer pool usage counters */ | ||
| 27 | int low_water,high_water; /* refill parameters */ | ||
| 28 | int rqa_count,rqu_count; /* queue condition counters */ | ||
| 29 | int offset,next_off; /* alignment optimizations: offset */ | ||
| 30 | int next_cnt,next_thres; /* repetition counter and threshold */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct zatm_pool_req { | ||
| 34 | int pool_num; /* pool number */ | ||
| 35 | struct zatm_pool_info info; /* actual information */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct zatm_t_hist { | ||
| 39 | struct timeval real; /* real (wall-clock) time */ | ||
| 40 | struct timeval expected; /* expected real time */ | ||
| 41 | }; | ||
| 42 | |||
| 43 | |||
| 44 | #define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */ | ||
| 45 | #define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */ | ||
| 46 | #define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */ | ||
| 47 | #define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */ | ||
| 48 | |||
| 49 | #define ZATM_TIMER_HISTORY_SIZE 16 /* number of timer adjustments to | ||
| 50 | record; must be 2^n */ | ||
| 51 | |||
| 52 | #endif | ||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* atmapi.h - ATM API user space/kernel compatibility */ | ||
| 2 | |||
| 3 | /* Written 1999,2000 by Werner Almesberger, EPFL ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef _LINUX_ATMAPI_H | ||
| 7 | #define _LINUX_ATMAPI_H | ||
| 8 | |||
| 9 | #if defined(__sparc__) || defined(__ia64__) | ||
| 10 | /* such alignment is not required on 32 bit sparcs, but we can't | ||
| 11 | figure that we are on a sparc64 while compiling user-space programs. */ | ||
| 12 | #define __ATM_API_ALIGN __attribute__((aligned(8))) | ||
| 13 | #else | ||
| 14 | #define __ATM_API_ALIGN | ||
| 15 | #endif | ||
| 16 | |||
| 17 | |||
| 18 | /* | ||
| 19 | * Opaque type for kernel pointers. Note that _ is never accessed. We need | ||
| 20 | * the struct in order hide the array, so that we can make simple assignments | ||
| 21 | * instead of being forced to use memcpy. It also improves error reporting for | ||
| 22 | * code that still assumes that we're passing unsigned longs. | ||
| 23 | * | ||
| 24 | * Convention: NULL pointers are passed as a field of all zeroes. | ||
| 25 | */ | ||
| 26 | |||
| 27 | typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t; | ||
| 28 | |||
| 29 | #endif | ||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ | ||
| 2 | |||
| 3 | /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef _LINUX_ATMARP_H | ||
| 7 | #define _LINUX_ATMARP_H | ||
| 8 | |||
| 9 | #include <linux/types.h> | ||
| 10 | #include <linux/atmapi.h> | ||
| 11 | #include <linux/atmioc.h> | ||
| 12 | |||
| 13 | |||
| 14 | #define ATMARP_RETRY_DELAY 30 /* request next resolution or forget | ||
| 15 | NAK after 30 sec - should go into | ||
| 16 | atmclip.h */ | ||
| 17 | #define ATMARP_MAX_UNRES_PACKETS 5 /* queue that many packets while | ||
| 18 | waiting for the resolver */ | ||
| 19 | |||
| 20 | |||
| 21 | #define ATMARPD_CTRL _IO('a',ATMIOC_CLIP+1) /* become atmarpd ctrl sock */ | ||
| 22 | #define ATMARP_MKIP _IO('a',ATMIOC_CLIP+2) /* attach socket to IP */ | ||
| 23 | #define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */ | ||
| 24 | #define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */ | ||
| 25 | |||
| 26 | |||
| 27 | enum atmarp_ctrl_type { | ||
| 28 | act_invalid, /* catch uninitialized structures */ | ||
| 29 | act_need, /* need address resolution */ | ||
| 30 | act_up, /* interface is coming up */ | ||
| 31 | act_down, /* interface is going down */ | ||
| 32 | act_change /* interface configuration has changed */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct atmarp_ctrl { | ||
| 36 | enum atmarp_ctrl_type type; /* message type */ | ||
| 37 | int itf_num;/* interface number (if present) */ | ||
| 38 | __be32 ip; /* IP address (act_need only) */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | #endif | ||
| @@ -0,0 +1,117 @@ | |||
| 1 | #ifndef _LINUX_ATMBR2684_H | ||
| 2 | #define _LINUX_ATMBR2684_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/atm.h> | ||
| 6 | #include <linux/if.h> /* For IFNAMSIZ */ | ||
| 7 | |||
| 8 | /* | ||
| 9 | * Type of media we're bridging (ethernet, token ring, etc) Currently only | ||
| 10 | * ethernet is supported | ||
| 11 | */ | ||
| 12 | #define BR2684_MEDIA_ETHERNET (0) /* 802.3 */ | ||
| 13 | #define BR2684_MEDIA_802_4 (1) /* 802.4 */ | ||
| 14 | #define BR2684_MEDIA_TR (2) /* 802.5 - token ring */ | ||
| 15 | #define BR2684_MEDIA_FDDI (3) | ||
| 16 | #define BR2684_MEDIA_802_6 (4) /* 802.6 */ | ||
| 17 | |||
| 18 | /* used only at device creation: */ | ||
| 19 | #define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */ | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Is there FCS inbound on this VC? This currently isn't supported. | ||
| 23 | */ | ||
| 24 | #define BR2684_FCSIN_NO (0) | ||
| 25 | #define BR2684_FCSIN_IGNORE (1) | ||
| 26 | #define BR2684_FCSIN_VERIFY (2) | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Is there FCS outbound on this VC? This currently isn't supported. | ||
| 30 | */ | ||
| 31 | #define BR2684_FCSOUT_NO (0) | ||
| 32 | #define BR2684_FCSOUT_SENDZERO (1) | ||
| 33 | #define BR2684_FCSOUT_GENERATE (2) | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Does this VC include LLC encapsulation? | ||
| 37 | */ | ||
| 38 | #define BR2684_ENCAPS_VC (0) /* VC-mux */ | ||
| 39 | #define BR2684_ENCAPS_LLC (1) | ||
| 40 | #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */ | ||
| 41 | |||
| 42 | /* | ||
| 43 | * Is this VC bridged or routed? | ||
| 44 | */ | ||
| 45 | |||
| 46 | #define BR2684_PAYLOAD_ROUTED (0) | ||
| 47 | #define BR2684_PAYLOAD_BRIDGED (1) | ||
| 48 | |||
| 49 | /* | ||
| 50 | * This is for the ATM_NEWBACKENDIF call - these are like socket families: | ||
| 51 | * the first element of the structure is the backend number and the rest | ||
| 52 | * is per-backend specific | ||
| 53 | */ | ||
| 54 | struct atm_newif_br2684 { | ||
| 55 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ | ||
| 56 | int media; /* BR2684_MEDIA_*, flags in upper bits */ | ||
| 57 | char ifname[IFNAMSIZ]; | ||
| 58 | int mtu; | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * This structure is used to specify a br2684 interface - either by a | ||
| 63 | * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name | ||
| 64 | */ | ||
| 65 | #define BR2684_FIND_BYNOTHING (0) | ||
| 66 | #define BR2684_FIND_BYNUM (1) | ||
| 67 | #define BR2684_FIND_BYIFNAME (2) | ||
| 68 | struct br2684_if_spec { | ||
| 69 | int method; /* BR2684_FIND_* */ | ||
| 70 | union { | ||
| 71 | char ifname[IFNAMSIZ]; | ||
| 72 | int devnum; | ||
| 73 | } spec; | ||
| 74 | }; | ||
| 75 | |||
| 76 | /* | ||
| 77 | * This is for the ATM_SETBACKEND call - these are like socket families: | ||
| 78 | * the first element of the structure is the backend number and the rest | ||
| 79 | * is per-backend specific | ||
| 80 | */ | ||
| 81 | struct atm_backend_br2684 { | ||
| 82 | atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ | ||
| 83 | struct br2684_if_spec ifspec; | ||
| 84 | int fcs_in; /* BR2684_FCSIN_* */ | ||
| 85 | int fcs_out; /* BR2684_FCSOUT_* */ | ||
| 86 | int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ | ||
| 87 | int encaps; /* BR2684_ENCAPS_* */ | ||
| 88 | int has_vpiid; /* 1: use vpn_id - Unsupported */ | ||
| 89 | __u8 vpn_id[7]; | ||
| 90 | int send_padding; /* unsupported */ | ||
| 91 | int min_size; /* we will pad smaller packets than this */ | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* | ||
| 95 | * The BR2684_SETFILT ioctl is an experimental mechanism for folks | ||
| 96 | * terminating a large number of IP-only vcc's. When netfilter allows | ||
| 97 | * efficient per-if in/out filters, this support will be removed | ||
| 98 | */ | ||
| 99 | struct br2684_filter { | ||
| 100 | __be32 prefix; /* network byte order */ | ||
| 101 | __be32 netmask; /* 0 = disable filter */ | ||
| 102 | }; | ||
| 103 | |||
| 104 | struct br2684_filter_set { | ||
| 105 | struct br2684_if_spec ifspec; | ||
| 106 | struct br2684_filter filter; | ||
| 107 | }; | ||
| 108 | |||
| 109 | enum br2684_payload { | ||
| 110 | p_routed = BR2684_PAYLOAD_ROUTED, | ||
| 111 | p_bridged = BR2684_PAYLOAD_BRIDGED, | ||
| 112 | }; | ||
| 113 | |||
| 114 | #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ | ||
| 115 | struct br2684_filter_set) | ||
| 116 | |||
| 117 | #endif /* _LINUX_ATMBR2684_H */ | ||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* atmclip.h - Classical IP over ATM */ | ||
| 2 | |||
| 3 | /* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef LINUX_ATMCLIP_H | ||
| 7 | #define LINUX_ATMCLIP_H | ||
| 8 | |||
| 9 | #include <linux/sockios.h> | ||
| 10 | #include <linux/atmioc.h> | ||
| 11 | |||
| 12 | |||
| 13 | #define RFC1483LLC_LEN 8 /* LLC+OUI+PID = 8 */ | ||
| 14 | #define RFC1626_MTU 9180 /* RFC1626 default MTU */ | ||
| 15 | |||
| 16 | #define CLIP_DEFAULT_IDLETIMER 1200 /* 20 minutes, see RFC1755 */ | ||
| 17 | #define CLIP_CHECK_INTERVAL 10 /* check every ten seconds */ | ||
| 18 | |||
| 19 | #define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */ | ||
| 20 | |||
| 21 | #endif | ||
| @@ -0,0 +1,215 @@ | |||
| 1 | /* atmdev.h - ATM device driver declarations and various related items */ | ||
| 2 | |||
| 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef _UAPILINUX_ATMDEV_H | ||
| 7 | #define _UAPILINUX_ATMDEV_H | ||
| 8 | |||
| 9 | |||
| 10 | #include <linux/atmapi.h> | ||
| 11 | #include <linux/atm.h> | ||
| 12 | #include <linux/atmioc.h> | ||
| 13 | |||
| 14 | |||
| 15 | #define ESI_LEN 6 | ||
| 16 | |||
| 17 | #define ATM_OC3_PCR (155520000/270*260/8/53) | ||
| 18 | /* OC3 link rate: 155520000 bps | ||
| 19 | SONET overhead: /270*260 (9 section, 1 path) | ||
| 20 | bits per cell: /8/53 | ||
| 21 | max cell rate: 353207.547 cells/sec */ | ||
| 22 | #define ATM_25_PCR ((25600000/8-8000)/54) | ||
| 23 | /* 25 Mbps ATM cell rate (59111) */ | ||
| 24 | #define ATM_OC12_PCR (622080000/1080*1040/8/53) | ||
| 25 | /* OC12 link rate: 622080000 bps | ||
| 26 | SONET overhead: /1080*1040 | ||
| 27 | bits per cell: /8/53 | ||
| 28 | max cell rate: 1412830.188 cells/sec */ | ||
| 29 | #define ATM_DS3_PCR (8000*12) | ||
| 30 | /* DS3: 12 cells in a 125 usec time slot */ | ||
| 31 | |||
| 32 | |||
| 33 | #define __AAL_STAT_ITEMS \ | ||
| 34 | __HANDLE_ITEM(tx); /* TX okay */ \ | ||
| 35 | __HANDLE_ITEM(tx_err); /* TX errors */ \ | ||
| 36 | __HANDLE_ITEM(rx); /* RX okay */ \ | ||
| 37 | __HANDLE_ITEM(rx_err); /* RX errors */ \ | ||
| 38 | __HANDLE_ITEM(rx_drop); /* RX out of memory */ | ||
| 39 | |||
| 40 | struct atm_aal_stats { | ||
| 41 | #define __HANDLE_ITEM(i) int i | ||
| 42 | __AAL_STAT_ITEMS | ||
| 43 | #undef __HANDLE_ITEM | ||
| 44 | }; | ||
| 45 | |||
| 46 | |||
| 47 | struct atm_dev_stats { | ||
| 48 | struct atm_aal_stats aal0; | ||
| 49 | struct atm_aal_stats aal34; | ||
| 50 | struct atm_aal_stats aal5; | ||
| 51 | } __ATM_API_ALIGN; | ||
| 52 | |||
| 53 | |||
| 54 | #define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc) | ||
| 55 | /* get link rate */ | ||
| 56 | #define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf) | ||
| 57 | /* get interface names (numbers) */ | ||
| 58 | #define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc) | ||
| 59 | /* get interface type name */ | ||
| 60 | #define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc) | ||
| 61 | /* get interface ESI */ | ||
| 62 | #define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc) | ||
| 63 | /* get itf's local ATM addr. list */ | ||
| 64 | #define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc) | ||
| 65 | /* reset itf's ATM address list */ | ||
| 66 | #define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc) | ||
| 67 | /* add a local ATM address */ | ||
| 68 | #define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc) | ||
| 69 | /* remove a local ATM address */ | ||
| 70 | #define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc) | ||
| 71 | /* get connection identifier range */ | ||
| 72 | #define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc) | ||
| 73 | /* set connection identifier range */ | ||
| 74 | #define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc) | ||
| 75 | /* set interface ESI */ | ||
| 76 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) | ||
| 77 | /* force interface ESI */ | ||
| 78 | #define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc) | ||
| 79 | /* register a LECS address */ | ||
| 80 | #define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc) | ||
| 81 | /* unregister a LECS address */ | ||
| 82 | #define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc) | ||
| 83 | /* retrieve LECS address(es) */ | ||
| 84 | |||
| 85 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) | ||
| 86 | /* get AAL layer statistics */ | ||
| 87 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) | ||
| 88 | /* get AAL layer statistics and zero */ | ||
| 89 | #define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc) | ||
| 90 | /* get loopback mode */ | ||
| 91 | #define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc) | ||
| 92 | /* set loopback mode */ | ||
| 93 | #define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc) | ||
| 94 | /* query supported loopback modes */ | ||
| 95 | #define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int) | ||
| 96 | /* enable or disable single-copy */ | ||
| 97 | #define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t) | ||
| 98 | /* set backend handler */ | ||
| 99 | #define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t) | ||
| 100 | /* use backend to make new if */ | ||
| 101 | #define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf) | ||
| 102 | /* add party to p2mp call */ | ||
| 103 | #ifdef CONFIG_COMPAT | ||
| 104 | /* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */ | ||
| 105 | #define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf) | ||
| 106 | #endif | ||
| 107 | #define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int) | ||
| 108 | /* drop party from p2mp call */ | ||
| 109 | |||
| 110 | /* | ||
| 111 | * These are backend handkers that can be set via the ATM_SETBACKEND call | ||
| 112 | * above. In the future we may support dynamic loading of these - for now, | ||
| 113 | * they're just being used to share the ATMIOC_BACKEND ioctls | ||
| 114 | */ | ||
| 115 | #define ATM_BACKEND_RAW 0 | ||
| 116 | #define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */ | ||
| 117 | #define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */ | ||
| 118 | |||
| 119 | /* for ATM_GETTYPE */ | ||
| 120 | #define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */ | ||
| 121 | |||
| 122 | /* | ||
| 123 | * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP | ||
| 124 | */ | ||
| 125 | |||
| 126 | /* Point of loopback CPU-->SAR-->PHY-->line--> ... */ | ||
| 127 | #define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */ | ||
| 128 | #define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */ | ||
| 129 | #define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */ | ||
| 130 | /* RESERVED 4 loop back on PHY side ---' */ | ||
| 131 | #define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */ | ||
| 132 | #define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */ | ||
| 133 | |||
| 134 | /* Direction of loopback */ | ||
| 135 | #define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */ | ||
| 136 | #define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */ | ||
| 137 | |||
| 138 | #define __ATM_LM_XTLOC(n) ((n) & 0xff) | ||
| 139 | #define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff) | ||
| 140 | |||
| 141 | #define ATM_LM_NONE 0 /* no loopback */ | ||
| 142 | |||
| 143 | #define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL) | ||
| 144 | #define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM) | ||
| 145 | #define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY) | ||
| 146 | #define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG) | ||
| 147 | |||
| 148 | #define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL) | ||
| 149 | #define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM) | ||
| 150 | #define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY) | ||
| 151 | #define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG) | ||
| 152 | |||
| 153 | /* | ||
| 154 | * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that | ||
| 155 | * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x) | ||
| 156 | */ | ||
| 157 | |||
| 158 | |||
| 159 | struct atm_iobuf { | ||
| 160 | int length; | ||
| 161 | void __user *buffer; | ||
| 162 | }; | ||
| 163 | |||
| 164 | /* for ATM_GETCIRANGE / ATM_SETCIRANGE */ | ||
| 165 | |||
| 166 | #define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */ | ||
| 167 | |||
| 168 | struct atm_cirange { | ||
| 169 | signed char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */ | ||
| 170 | signed char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */ | ||
| 171 | }; | ||
| 172 | |||
| 173 | /* for ATM_SETSC; actually taken from the ATM_VF number space */ | ||
| 174 | |||
| 175 | #define ATM_SC_RX 1024 /* enable RX single-copy */ | ||
| 176 | #define ATM_SC_TX 2048 /* enable TX single-copy */ | ||
| 177 | |||
| 178 | #define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out | ||
| 179 | anyway */ | ||
| 180 | |||
| 181 | /* MF: change_qos (Modify) flags */ | ||
| 182 | |||
| 183 | #define ATM_MF_IMMED 1 /* Block until change is effective */ | ||
| 184 | #define ATM_MF_INC_RSV 2 /* Change reservation on increase */ | ||
| 185 | #define ATM_MF_INC_SHP 4 /* Change shaping on increase */ | ||
| 186 | #define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */ | ||
| 187 | #define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */ | ||
| 188 | #define ATM_MF_BWD 32 /* Set the backward direction parameters */ | ||
| 189 | |||
| 190 | #define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \ | ||
| 191 | ATM_MF_DEC_SHP | ATM_MF_BWD) | ||
| 192 | |||
| 193 | /* | ||
| 194 | * ATM_VS_* are used to express VC state in a human-friendly way. | ||
| 195 | */ | ||
| 196 | |||
| 197 | #define ATM_VS_IDLE 0 /* VC is not used */ | ||
| 198 | #define ATM_VS_CONNECTED 1 /* VC is connected */ | ||
| 199 | #define ATM_VS_CLOSING 2 /* VC is closing */ | ||
| 200 | #define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */ | ||
| 201 | #define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */ | ||
| 202 | #define ATM_VS_BOUND 5 /* VC is bound */ | ||
| 203 | |||
| 204 | #define ATM_VS2TXT_MAP \ | ||
| 205 | "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND" | ||
| 206 | |||
| 207 | #define ATM_VF2TXT_MAP \ | ||
| 208 | "ADDR", "READY", "PARTIAL", "REGIS", \ | ||
| 209 | "RELEASED", "HASQOS", "LISTEN", "META", \ | ||
| 210 | "256", "512", "1024", "2048", \ | ||
| 211 | "SESSION", "HASSAP", "BOUND", "CLOSE" | ||
| 212 | |||
| 213 | |||
| 214 | |||
| 215 | #endif /* _UAPILINUX_ATMDEV_H */ | ||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* atmioc.h - ranges for ATM-related ioctl numbers */ | ||
| 2 | |||
| 3 | /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | /* | ||
| 7 | * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of | ||
| 8 | * "magic" ioctl numbers. | ||
| 9 | */ | ||
| 10 | |||
| 11 | |||
| 12 | #ifndef _LINUX_ATMIOC_H | ||
| 13 | #define _LINUX_ATMIOC_H | ||
| 14 | |||
| 15 | #include <asm/ioctl.h> | ||
| 16 | /* everybody including atmioc.h will also need _IO{,R,W,WR} */ | ||
| 17 | |||
| 18 | #define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */ | ||
| 19 | #define ATMIOC_PHYCOM_END 0x0f | ||
| 20 | #define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */ | ||
| 21 | #define ATMIOC_PHYTYP_END 0x2f | ||
| 22 | #define ATMIOC_PHYPRV 0x30 /* PHY dev private ioctls, unique per driver */ | ||
| 23 | #define ATMIOC_PHYPRV_END 0x4f | ||
| 24 | #define ATMIOC_SARCOM 0x50 /* SAR device common ioctls, globally unique */ | ||
| 25 | #define ATMIOC_SARCOM_END 0x50 | ||
| 26 | #define ATMIOC_SARPRV 0x60 /* SAR dev private ioctls, unique per driver */ | ||
| 27 | #define ATMIOC_SARPRV_END 0x7f | ||
| 28 | #define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */ | ||
| 29 | #define ATMIOC_ITF_END 0x8f | ||
| 30 | #define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */ | ||
| 31 | #define ATMIOC_BACKEND_END 0xaf | ||
| 32 | /* 0xb0-0xbf: Reserved for future use */ | ||
| 33 | #define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */ | ||
| 34 | #define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */ | ||
| 35 | #define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */ | ||
| 36 | #define ATMIOC_CLIP 0xe0 /* Classical IP over ATM control, globally u. */ | ||
| 37 | #define ATMIOC_CLIP_END 0xef | ||
| 38 | #define ATMIOC_SPECIAL 0xf0 /* Special-purpose controls, globally unique */ | ||
| 39 | #define ATMIOC_SPECIAL_END 0xff | ||
| 40 | |||
| 41 | #endif | ||
| @@ -0,0 +1,91 @@ | |||
| 1 | /* | ||
| 2 | * ATM Lan Emulation Daemon driver interface | ||
| 3 | * | ||
| 4 | * Marko Kiiskila <mkiiskila@yahoo.com> | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _ATMLEC_H_ | ||
| 8 | #define _ATMLEC_H_ | ||
| 9 | |||
| 10 | #include <linux/atmapi.h> | ||
| 11 | #include <linux/atmioc.h> | ||
| 12 | #include <linux/atm.h> | ||
| 13 | #include <linux/if_ether.h> | ||
| 14 | #include <linux/types.h> | ||
| 15 | |||
| 16 | /* ATM lec daemon control socket */ | ||
| 17 | #define ATMLEC_CTRL _IO('a', ATMIOC_LANE) | ||
| 18 | #define ATMLEC_DATA _IO('a', ATMIOC_LANE+1) | ||
| 19 | #define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2) | ||
| 20 | |||
| 21 | /* Maximum number of LEC interfaces (tweakable) */ | ||
| 22 | #define MAX_LEC_ITF 48 | ||
| 23 | |||
| 24 | typedef enum { | ||
| 25 | l_set_mac_addr, | ||
| 26 | l_del_mac_addr, | ||
| 27 | l_svc_setup, | ||
| 28 | l_addr_delete, | ||
| 29 | l_topology_change, | ||
| 30 | l_flush_complete, | ||
| 31 | l_arp_update, | ||
| 32 | l_narp_req, /* LANE2 mandates the use of this */ | ||
| 33 | l_config, | ||
| 34 | l_flush_tran_id, | ||
| 35 | l_set_lecid, | ||
| 36 | l_arp_xmt, | ||
| 37 | l_rdesc_arp_xmt, | ||
| 38 | l_associate_req, | ||
| 39 | l_should_bridge /* should we bridge this MAC? */ | ||
| 40 | } atmlec_msg_type; | ||
| 41 | |||
| 42 | #define ATMLEC_MSG_TYPE_MAX l_should_bridge | ||
| 43 | |||
| 44 | struct atmlec_config_msg { | ||
| 45 | unsigned int maximum_unknown_frame_count; | ||
| 46 | unsigned int max_unknown_frame_time; | ||
| 47 | unsigned short max_retry_count; | ||
| 48 | unsigned int aging_time; | ||
| 49 | unsigned int forward_delay_time; | ||
| 50 | unsigned int arp_response_time; | ||
| 51 | unsigned int flush_timeout; | ||
| 52 | unsigned int path_switching_delay; | ||
| 53 | unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ | ||
| 54 | int mtu; | ||
| 55 | int is_proxy; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct atmlec_msg { | ||
| 59 | atmlec_msg_type type; | ||
| 60 | int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ | ||
| 61 | union { | ||
| 62 | struct { | ||
| 63 | unsigned char mac_addr[ETH_ALEN]; | ||
| 64 | unsigned char atm_addr[ATM_ESA_LEN]; | ||
| 65 | unsigned int flag; /* | ||
| 66 | * Topology_change flag, | ||
| 67 | * remoteflag, permanent flag, | ||
| 68 | * lecid, transaction id | ||
| 69 | */ | ||
| 70 | unsigned int targetless_le_arp; /* LANE2 */ | ||
| 71 | unsigned int no_source_le_narp; /* LANE2 */ | ||
| 72 | } normal; | ||
| 73 | struct atmlec_config_msg config; | ||
| 74 | struct { | ||
| 75 | __u16 lec_id; /* requestor lec_id */ | ||
| 76 | __u32 tran_id; /* transaction id */ | ||
| 77 | unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ | ||
| 78 | unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ | ||
| 79 | } proxy; /* | ||
| 80 | * For mapping LE_ARP requests to responses. Filled by | ||
| 81 | * zeppelin, returned by kernel. Used only when proxying | ||
| 82 | */ | ||
| 83 | } content; | ||
| 84 | } __ATM_API_ALIGN; | ||
| 85 | |||
| 86 | struct atmlec_ioc { | ||
| 87 | int dev_num; | ||
| 88 | unsigned char atm_addr[ATM_ESA_LEN]; | ||
| 89 | unsigned char receive; /* 1= receive vcc, 0 = send vcc */ | ||
| 90 | }; | ||
| 91 | #endif /* _ATMLEC_H_ */ | ||
| @@ -0,0 +1,126 @@ | |||
| 1 | #ifndef _ATMMPC_H_ | ||
| 2 | #define _ATMMPC_H_ | ||
| 3 | |||
| 4 | #include <linux/atmapi.h> | ||
| 5 | #include <linux/atmioc.h> | ||
| 6 | #include <linux/atm.h> | ||
| 7 | #include <linux/types.h> | ||
| 8 | |||
| 9 | #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA) | ||
| 10 | #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1) | ||
| 11 | |||
| 12 | #define MPC_SOCKET_INGRESS 1 | ||
| 13 | #define MPC_SOCKET_EGRESS 2 | ||
| 14 | |||
| 15 | struct atmmpc_ioc { | ||
| 16 | int dev_num; | ||
| 17 | __be32 ipaddr; /* the IP address of the shortcut */ | ||
| 18 | int type; /* ingress or egress */ | ||
| 19 | }; | ||
| 20 | |||
| 21 | typedef struct in_ctrl_info { | ||
| 22 | __u8 Last_NHRP_CIE_code; | ||
| 23 | __u8 Last_Q2931_cause_value; | ||
| 24 | __u8 eg_MPC_ATM_addr[ATM_ESA_LEN]; | ||
| 25 | __be32 tag; | ||
| 26 | __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */ | ||
| 27 | __u16 holding_time; | ||
| 28 | __u32 request_id; | ||
| 29 | } in_ctrl_info; | ||
| 30 | |||
| 31 | typedef struct eg_ctrl_info { | ||
| 32 | __u8 DLL_header[256]; | ||
| 33 | __u8 DH_length; | ||
| 34 | __be32 cache_id; | ||
| 35 | __be32 tag; | ||
| 36 | __be32 mps_ip; | ||
| 37 | __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */ | ||
| 38 | __u8 in_MPC_data_ATM_addr[ATM_ESA_LEN]; | ||
| 39 | __u16 holding_time; | ||
| 40 | } eg_ctrl_info; | ||
| 41 | |||
| 42 | struct mpc_parameters { | ||
| 43 | __u16 mpc_p1; /* Shortcut-Setup Frame Count */ | ||
| 44 | __u16 mpc_p2; /* Shortcut-Setup Frame Time */ | ||
| 45 | __u8 mpc_p3[8]; /* Flow-detection Protocols */ | ||
| 46 | __u16 mpc_p4; /* MPC Initial Retry Time */ | ||
| 47 | __u16 mpc_p5; /* MPC Retry Time Maximum */ | ||
| 48 | __u16 mpc_p6; /* Hold Down Time */ | ||
| 49 | } ; | ||
| 50 | |||
| 51 | struct k_message { | ||
| 52 | __u16 type; | ||
| 53 | __be32 ip_mask; | ||
| 54 | __u8 MPS_ctrl[ATM_ESA_LEN]; | ||
| 55 | union { | ||
| 56 | in_ctrl_info in_info; | ||
| 57 | eg_ctrl_info eg_info; | ||
| 58 | struct mpc_parameters params; | ||
| 59 | } content; | ||
| 60 | struct atm_qos qos; | ||
| 61 | } __ATM_API_ALIGN; | ||
| 62 | |||
| 63 | struct llc_snap_hdr { | ||
| 64 | /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ | ||
| 65 | __u8 dsap; /* Destination Service Access Point (0xAA) */ | ||
| 66 | __u8 ssap; /* Source Service Access Point (0xAA) */ | ||
| 67 | __u8 ui; /* Unnumbered Information (0x03) */ | ||
| 68 | __u8 org[3]; /* Organizational identification (0x000000) */ | ||
| 69 | __u8 type[2]; /* Ether type (for IP) (0x0800) */ | ||
| 70 | }; | ||
| 71 | |||
| 72 | /* TLVs this MPC recognizes */ | ||
| 73 | #define TLV_MPOA_DEVICE_TYPE 0x00a03e2a | ||
| 74 | |||
| 75 | /* MPOA device types in MPOA Device Type TLV */ | ||
| 76 | #define NON_MPOA 0 | ||
| 77 | #define MPS 1 | ||
| 78 | #define MPC 2 | ||
| 79 | #define MPS_AND_MPC 3 | ||
| 80 | |||
| 81 | |||
| 82 | /* MPC parameter defaults */ | ||
| 83 | |||
| 84 | #define MPC_P1 10 /* Shortcut-Setup Frame Count */ | ||
| 85 | #define MPC_P2 1 /* Shortcut-Setup Frame Time */ | ||
| 86 | #define MPC_P3 0 /* Flow-detection Protocols */ | ||
| 87 | #define MPC_P4 5 /* MPC Initial Retry Time */ | ||
| 88 | #define MPC_P5 40 /* MPC Retry Time Maximum */ | ||
| 89 | #define MPC_P6 160 /* Hold Down Time */ | ||
| 90 | #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */ | ||
| 91 | |||
| 92 | /* MPC constants */ | ||
| 93 | |||
| 94 | #define MPC_C1 2 /* Retry Time Multiplier */ | ||
| 95 | #define MPC_C2 60 /* Initial Keep-Alive Lifetime */ | ||
| 96 | |||
| 97 | /* Message types - to MPOA daemon */ | ||
| 98 | |||
| 99 | #define SND_MPOA_RES_RQST 201 | ||
| 100 | #define SET_MPS_CTRL_ADDR 202 | ||
| 101 | #define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */ | ||
| 102 | #define STOP_KEEP_ALIVE_SM 204 | ||
| 103 | #define EGRESS_ENTRY_REMOVED 205 | ||
| 104 | #define SND_EGRESS_PURGE 206 | ||
| 105 | #define DIE 207 /* tell the daemon to exit() */ | ||
| 106 | #define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */ | ||
| 107 | #define OPEN_INGRESS_SVC 209 | ||
| 108 | |||
| 109 | /* Message types - from MPOA daemon */ | ||
| 110 | |||
| 111 | #define MPOA_TRIGGER_RCVD 101 | ||
| 112 | #define MPOA_RES_REPLY_RCVD 102 | ||
| 113 | #define INGRESS_PURGE_RCVD 103 | ||
| 114 | #define EGRESS_PURGE_RCVD 104 | ||
| 115 | #define MPS_DEATH 105 | ||
| 116 | #define CACHE_IMPOS_RCVD 106 | ||
| 117 | #define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */ | ||
| 118 | #define SET_MPS_MAC_ADDR 108 | ||
| 119 | #define CLEAN_UP_AND_EXIT 109 | ||
| 120 | #define SET_MPC_PARAMS 110 /* MPC configuration parameters */ | ||
| 121 | |||
| 122 | /* Message types - bidirectional */ | ||
| 123 | |||
| 124 | #define RELOAD 301 /* kill -HUP the daemon for reload */ | ||
| 125 | |||
| 126 | #endif /* _ATMMPC_H_ */ | ||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* atmppp.h - RFC2364 PPPoATM */ | ||
| 2 | |||
| 3 | /* Written 2000 by Mitchell Blank Jr */ | ||
| 4 | |||
| 5 | #ifndef _LINUX_ATMPPP_H | ||
| 6 | #define _LINUX_ATMPPP_H | ||
| 7 | |||
| 8 | #include <linux/atm.h> | ||
| 9 | |||
| 10 | #define PPPOATM_ENCAPS_AUTODETECT (0) | ||
| 11 | #define PPPOATM_ENCAPS_VC (1) | ||
| 12 | #define PPPOATM_ENCAPS_LLC (2) | ||
| 13 | |||
| 14 | /* | ||
| 15 | * This is for the ATM_SETBACKEND call - these are like socket families: | ||
| 16 | * the first element of the structure is the backend number and the rest | ||
| 17 | * is per-backend specific | ||
| 18 | */ | ||
| 19 | struct atm_backend_ppp { | ||
| 20 | atm_backend_t backend_num; /* ATM_BACKEND_PPP */ | ||
| 21 | int encaps; /* PPPOATM_ENCAPS_* */ | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif /* _LINUX_ATMPPP_H */ | ||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* atmsap.h - ATM Service Access Point addressing definitions */ | ||
| 2 | |||
| 3 | /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef _LINUX_ATMSAP_H | ||
| 7 | #define _LINUX_ATMSAP_H | ||
| 8 | |||
| 9 | #include <linux/atmapi.h> | ||
| 10 | |||
| 11 | /* | ||
| 12 | * BEGIN_xx and END_xx markers are used for automatic generation of | ||
| 13 | * documentation. Do not change them. | ||
| 14 | */ | ||
| 15 | |||
| 16 | |||
| 17 | /* | ||
| 18 | * Layer 2 protocol identifiers | ||
| 19 | */ | ||
| 20 | |||
| 21 | /* BEGIN_L2 */ | ||
| 22 | #define ATM_L2_NONE 0 /* L2 not specified */ | ||
| 23 | #define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */ | ||
| 24 | #define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */ | ||
| 25 | #define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */ | ||
| 26 | #define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */ | ||
| 27 | #define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */ | ||
| 28 | #define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */ | ||
| 29 | #define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */ | ||
| 30 | #define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */ | ||
| 31 | #define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */ | ||
| 32 | #define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */ | ||
| 33 | #define ATM_L2_Q922 0x0e /* ITU-T Q.922 */ | ||
| 34 | #define ATM_L2_USER 0x10 /* user-specified */ | ||
| 35 | #define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */ | ||
| 36 | /* END_L2 */ | ||
| 37 | |||
| 38 | |||
| 39 | /* | ||
| 40 | * Layer 3 protocol identifiers | ||
| 41 | */ | ||
| 42 | |||
| 43 | /* BEGIN_L3 */ | ||
| 44 | #define ATM_L3_NONE 0 /* L3 not specified */ | ||
| 45 | #define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */ | ||
| 46 | #define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */ | ||
| 47 | #define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */ | ||
| 48 | #define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */ | ||
| 49 | #define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */ | ||
| 50 | #define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */ | ||
| 51 | #define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */ | ||
| 52 | #define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */ | ||
| 53 | #define ATM_L3_USER 0x10 /* user-specified */ | ||
| 54 | /* END_L3 */ | ||
| 55 | |||
| 56 | |||
| 57 | /* | ||
| 58 | * High layer identifiers | ||
| 59 | */ | ||
| 60 | |||
| 61 | /* BEGIN_HL */ | ||
| 62 | #define ATM_HL_NONE 0 /* HL not specified */ | ||
| 63 | #define ATM_HL_ISO 0x01 /* ISO */ | ||
| 64 | #define ATM_HL_USER 0x02 /* user-specific */ | ||
| 65 | #define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */ | ||
| 66 | #define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */ | ||
| 67 | /* END_HL */ | ||
| 68 | |||
| 69 | |||
| 70 | /* | ||
| 71 | * ITU-T coded mode of operation | ||
| 72 | */ | ||
| 73 | |||
| 74 | /* BEGIN_IMD */ | ||
| 75 | #define ATM_IMD_NONE 0 /* mode not specified */ | ||
| 76 | #define ATM_IMD_NORMAL 1 /* normal mode of operation */ | ||
| 77 | #define ATM_IMD_EXTENDED 2 /* extended mode of operation */ | ||
| 78 | /* END_IMD */ | ||
| 79 | |||
| 80 | /* | ||
| 81 | * H.310 code points | ||
| 82 | */ | ||
| 83 | |||
| 84 | #define ATM_TT_NONE 0 /* terminal type not specified */ | ||
| 85 | #define ATM_TT_RX 1 /* receive only */ | ||
| 86 | #define ATM_TT_TX 2 /* send only */ | ||
| 87 | #define ATM_TT_RXTX 3 /* receive and send */ | ||
| 88 | |||
| 89 | #define ATM_MC_NONE 0 /* no multiplexing */ | ||
| 90 | #define ATM_MC_TS 1 /* transport stream (TS) */ | ||
| 91 | #define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */ | ||
| 92 | #define ATM_MC_PS 3 /* program stream (PS) */ | ||
| 93 | #define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */ | ||
| 94 | #define ATM_MC_H221 5 /* ITU-T Rec. H.221 */ | ||
| 95 | |||
| 96 | /* | ||
| 97 | * SAP structures | ||
| 98 | */ | ||
| 99 | |||
| 100 | #define ATM_MAX_HLI 8 /* maximum high-layer information length */ | ||
| 101 | |||
| 102 | |||
| 103 | struct atm_blli { | ||
| 104 | unsigned char l2_proto; /* layer 2 protocol */ | ||
| 105 | union { | ||
| 106 | struct { | ||
| 107 | unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */ | ||
| 108 | /* absent */ | ||
| 109 | unsigned char window; /* window size (k), 1-127 (0 to omit) */ | ||
| 110 | } itu; /* ITU-T encoding */ | ||
| 111 | unsigned char user; /* user-specified l2 information */ | ||
| 112 | } l2; | ||
| 113 | unsigned char l3_proto; /* layer 3 protocol */ | ||
| 114 | union { | ||
| 115 | struct { | ||
| 116 | unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */ | ||
| 117 | /* absent */ | ||
| 118 | unsigned char def_size; /* default packet size (log2), 4-12 (0 to */ | ||
| 119 | /* omit) */ | ||
| 120 | unsigned char window;/* packet window size, 1-127 (0 to omit) */ | ||
| 121 | } itu; /* ITU-T encoding */ | ||
| 122 | unsigned char user; /* user specified l3 information */ | ||
| 123 | struct { /* if l3_proto = ATM_L3_H310 */ | ||
| 124 | unsigned char term_type; /* terminal type */ | ||
| 125 | unsigned char fw_mpx_cap; /* forward multiplexing capability */ | ||
| 126 | /* only if term_type != ATM_TT_NONE */ | ||
| 127 | unsigned char bw_mpx_cap; /* backward multiplexing capability */ | ||
| 128 | /* only if term_type != ATM_TT_NONE */ | ||
| 129 | } h310; | ||
| 130 | struct { /* if l3_proto = ATM_L3_TR9577 */ | ||
| 131 | unsigned char ipi; /* initial protocol id */ | ||
| 132 | unsigned char snap[5];/* IEEE 802.1 SNAP identifier */ | ||
| 133 | /* (only if ipi == NLPID_IEEE802_1_SNAP) */ | ||
| 134 | } tr9577; | ||
| 135 | } l3; | ||
| 136 | } __ATM_API_ALIGN; | ||
| 137 | |||
| 138 | |||
| 139 | struct atm_bhli { | ||
| 140 | unsigned char hl_type; /* high layer information type */ | ||
| 141 | unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */ | ||
| 142 | /* hl_type == ATM_HL_ISO) */ | ||
| 143 | unsigned char hl_info[ATM_MAX_HLI];/* high layer information */ | ||
| 144 | }; | ||
| 145 | |||
| 146 | |||
| 147 | #define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */ | ||
| 148 | |||
| 149 | |||
| 150 | struct atm_sap { | ||
| 151 | struct atm_bhli bhli; /* local SAP, high-layer information */ | ||
| 152 | struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN; | ||
| 153 | /* local SAP, low-layer info */ | ||
| 154 | }; | ||
| 155 | |||
| 156 | |||
| 157 | static __inline__ int blli_in_use(struct atm_blli blli) | ||
| 158 | { | ||
| 159 | return blli.l2_proto || blli.l3_proto; | ||
| 160 | } | ||
| 161 | |||
| 162 | #endif | ||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* atmsvc.h - ATM signaling kernel-demon interface definitions */ | ||
| 2 | |||
| 3 | /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ | ||
| 4 | |||
| 5 | |||
| 6 | #ifndef _LINUX_ATMSVC_H | ||
| 7 | #define _LINUX_ATMSVC_H | ||
| 8 | |||
| 9 | #include <linux/atmapi.h> | ||
| 10 | #include <linux/atm.h> | ||
| 11 | #include <linux/atmioc.h> | ||
| 12 | |||
| 13 | |||
| 14 | #define ATMSIGD_CTRL _IO('a',ATMIOC_SPECIAL) | ||
| 15 | /* become ATM signaling demon control socket */ | ||
| 16 | |||
| 17 | enum atmsvc_msg_type { as_catch_null, as_bind, as_connect, as_accept, as_reject, | ||
| 18 | as_listen, as_okay, as_error, as_indicate, as_close, | ||
| 19 | as_itf_notify, as_modify, as_identify, as_terminate, | ||
| 20 | as_addparty, as_dropparty }; | ||
| 21 | |||
| 22 | struct atmsvc_msg { | ||
| 23 | enum atmsvc_msg_type type; | ||
| 24 | atm_kptr_t vcc; | ||
| 25 | atm_kptr_t listen_vcc; /* indicate */ | ||
| 26 | int reply; /* for okay and close: */ | ||
| 27 | /* < 0: error before active */ | ||
| 28 | /* (sigd has discarded ctx) */ | ||
| 29 | /* ==0: success */ | ||
| 30 | /* > 0: error when active (still */ | ||
| 31 | /* need to close) */ | ||
| 32 | struct sockaddr_atmpvc pvc; /* indicate, okay (connect) */ | ||
| 33 | struct sockaddr_atmsvc local; /* local SVC address */ | ||
| 34 | struct atm_qos qos; /* QOS parameters */ | ||
| 35 | struct atm_sap sap; /* SAP */ | ||
| 36 | unsigned int session; /* for p2pm */ | ||
| 37 | struct sockaddr_atmsvc svc; /* SVC address */ | ||
| 38 | } __ATM_API_ALIGN; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz | ||
| 42 | */ | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Some policy stuff for atmsigd and for net/atm/svc.c. Both have to agree on | ||
| 46 | * what PCR is used to request bandwidth from the device driver. net/atm/svc.c | ||
| 47 | * tries to do better than that, but only if there's no routing decision (i.e. | ||
| 48 | * if signaling only uses one ATM interface). | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define SELECT_TOP_PCR(tp) ((tp).pcr ? (tp).pcr : \ | ||
| 52 | (tp).max_pcr && (tp).max_pcr != ATM_MAX_PCR ? (tp).max_pcr : \ | ||
| 53 | (tp).min_pcr ? (tp).min_pcr : ATM_MAX_PCR) | ||
| 54 | |||
| 55 | #endif | ||
| @@ -0,0 +1,404 @@ | |||
| 1 | /* audit.h -- Auditing support | ||
| 2 | * | ||
| 3 | * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. | ||
| 4 | * All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | * | ||
| 20 | * Written by Rickard E. (Rik) Faith <faith@redhat.com> | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _UAPI_LINUX_AUDIT_H_ | ||
| 25 | #define _UAPI_LINUX_AUDIT_H_ | ||
| 26 | |||
| 27 | #include <linux/types.h> | ||
| 28 | #include <linux/elf-em.h> | ||
| 29 | #include <linux/ptrace.h> | ||
| 30 | |||
| 31 | /* The netlink messages for the audit system is divided into blocks: | ||
| 32 | * 1000 - 1099 are for commanding the audit system | ||
| 33 | * 1100 - 1199 user space trusted application messages | ||
| 34 | * 1200 - 1299 messages internal to the audit daemon | ||
| 35 | * 1300 - 1399 audit event messages | ||
| 36 | * 1400 - 1499 SE Linux use | ||
| 37 | * 1500 - 1599 kernel LSPP events | ||
| 38 | * 1600 - 1699 kernel crypto events | ||
| 39 | * 1700 - 1799 kernel anomaly records | ||
| 40 | * 1800 - 1899 kernel integrity events | ||
| 41 | * 1900 - 1999 future kernel use | ||
| 42 | * 2000 is for otherwise unclassified kernel audit messages (legacy) | ||
| 43 | * 2001 - 2099 unused (kernel) | ||
| 44 | * 2100 - 2199 user space anomaly records | ||
| 45 | * 2200 - 2299 user space actions taken in response to anomalies | ||
| 46 | * 2300 - 2399 user space generated LSPP events | ||
| 47 | * 2400 - 2499 user space crypto events | ||
| 48 | * 2500 - 2999 future user space (maybe integrity labels and related events) | ||
| 49 | * | ||
| 50 | * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are | ||
| 51 | * exclusively user space. 1300-2099 is kernel --> user space | ||
| 52 | * communication. | ||
| 53 | */ | ||
| 54 | #define AUDIT_GET 1000 /* Get status */ | ||
| 55 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | ||
| 56 | #define AUDIT_LIST 1002 /* List syscall rules -- deprecated */ | ||
| 57 | #define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */ | ||
| 58 | #define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */ | ||
| 59 | #define AUDIT_USER 1005 /* Message from userspace -- deprecated */ | ||
| 60 | #define AUDIT_LOGIN 1006 /* Define the login id and information */ | ||
| 61 | #define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */ | ||
| 62 | #define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */ | ||
| 63 | #define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */ | ||
| 64 | #define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */ | ||
| 65 | #define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ | ||
| 66 | #define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ | ||
| 67 | #define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ | ||
| 68 | #define AUDIT_TRIM 1014 /* Trim junk from watched tree */ | ||
| 69 | #define AUDIT_MAKE_EQUIV 1015 /* Append to watched tree */ | ||
| 70 | #define AUDIT_TTY_GET 1016 /* Get TTY auditing status */ | ||
| 71 | #define AUDIT_TTY_SET 1017 /* Set TTY auditing status */ | ||
| 72 | |||
| 73 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ | ||
| 74 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ | ||
| 75 | #define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */ | ||
| 76 | #define AUDIT_LAST_USER_MSG 1199 | ||
| 77 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ | ||
| 78 | #define AUDIT_LAST_USER_MSG2 2999 | ||
| 79 | |||
| 80 | #define AUDIT_DAEMON_START 1200 /* Daemon startup record */ | ||
| 81 | #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ | ||
| 82 | #define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */ | ||
| 83 | #define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */ | ||
| 84 | |||
| 85 | #define AUDIT_SYSCALL 1300 /* Syscall event */ | ||
| 86 | /* #define AUDIT_FS_WATCH 1301 * Deprecated */ | ||
| 87 | #define AUDIT_PATH 1302 /* Filename path information */ | ||
| 88 | #define AUDIT_IPC 1303 /* IPC record */ | ||
| 89 | #define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */ | ||
| 90 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ | ||
| 91 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ | ||
| 92 | #define AUDIT_CWD 1307 /* Current working directory */ | ||
| 93 | #define AUDIT_EXECVE 1309 /* execve arguments */ | ||
| 94 | #define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ | ||
| 95 | #define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */ | ||
| 96 | #define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */ | ||
| 97 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ | ||
| 98 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ | ||
| 99 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | ||
| 100 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ | ||
| 101 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ | ||
| 102 | #define AUDIT_TTY 1319 /* Input on an administrative TTY */ | ||
| 103 | #define AUDIT_EOE 1320 /* End of multi-record event */ | ||
| 104 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ | ||
| 105 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ | ||
| 106 | #define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */ | ||
| 107 | #define AUDIT_NETFILTER_PKT 1324 /* Packets traversing netfilter chains */ | ||
| 108 | #define AUDIT_NETFILTER_CFG 1325 /* Netfilter chain modifications */ | ||
| 109 | |||
| 110 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | ||
| 111 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | ||
| 112 | #define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */ | ||
| 113 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ | ||
| 114 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ | ||
| 115 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ | ||
| 116 | #define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */ | ||
| 117 | #define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */ | ||
| 118 | #define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */ | ||
| 119 | #define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */ | ||
| 120 | #define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */ | ||
| 121 | #define AUDIT_MAC_IPSEC_ADDSA 1411 /* Not used */ | ||
| 122 | #define AUDIT_MAC_IPSEC_DELSA 1412 /* Not used */ | ||
| 123 | #define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */ | ||
| 124 | #define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */ | ||
| 125 | #define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */ | ||
| 126 | #define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */ | ||
| 127 | #define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */ | ||
| 128 | |||
| 129 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 | ||
| 130 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 | ||
| 131 | #define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */ | ||
| 132 | #define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */ | ||
| 133 | #define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */ | ||
| 134 | #define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */ | ||
| 135 | #define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */ | ||
| 136 | #define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */ | ||
| 137 | #define AUDIT_INTEGRITY_HASH 1803 /* Integrity HASH type */ | ||
| 138 | #define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */ | ||
| 139 | #define AUDIT_INTEGRITY_RULE 1805 /* policy rule */ | ||
| 140 | |||
| 141 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | ||
| 142 | |||
| 143 | /* Rule flags */ | ||
| 144 | #define AUDIT_FILTER_USER 0x00 /* Apply rule to user-generated messages */ | ||
| 145 | #define AUDIT_FILTER_TASK 0x01 /* Apply rule at task creation (not syscall) */ | ||
| 146 | #define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */ | ||
| 147 | #define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */ | ||
| 148 | #define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */ | ||
| 149 | #define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */ | ||
| 150 | |||
| 151 | #define AUDIT_NR_FILTERS 6 | ||
| 152 | |||
| 153 | #define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */ | ||
| 154 | |||
| 155 | /* Rule actions */ | ||
| 156 | #define AUDIT_NEVER 0 /* Do not build context if rule matches */ | ||
| 157 | #define AUDIT_POSSIBLE 1 /* Build context if rule matches */ | ||
| 158 | #define AUDIT_ALWAYS 2 /* Generate audit record if rule matches */ | ||
| 159 | |||
| 160 | /* Rule structure sizes -- if these change, different AUDIT_ADD and | ||
| 161 | * AUDIT_LIST commands must be implemented. */ | ||
| 162 | #define AUDIT_MAX_FIELDS 64 | ||
| 163 | #define AUDIT_MAX_KEY_LEN 256 | ||
| 164 | #define AUDIT_BITMASK_SIZE 64 | ||
| 165 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) | ||
| 166 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) | ||
| 167 | |||
| 168 | #define AUDIT_SYSCALL_CLASSES 16 | ||
| 169 | #define AUDIT_CLASS_DIR_WRITE 0 | ||
| 170 | #define AUDIT_CLASS_DIR_WRITE_32 1 | ||
| 171 | #define AUDIT_CLASS_CHATTR 2 | ||
| 172 | #define AUDIT_CLASS_CHATTR_32 3 | ||
| 173 | #define AUDIT_CLASS_READ 4 | ||
| 174 | #define AUDIT_CLASS_READ_32 5 | ||
| 175 | #define AUDIT_CLASS_WRITE 6 | ||
| 176 | #define AUDIT_CLASS_WRITE_32 7 | ||
| 177 | #define AUDIT_CLASS_SIGNAL 8 | ||
| 178 | #define AUDIT_CLASS_SIGNAL_32 9 | ||
| 179 | |||
| 180 | /* This bitmask is used to validate user input. It represents all bits that | ||
| 181 | * are currently used in an audit field constant understood by the kernel. | ||
| 182 | * If you are adding a new #define AUDIT_<whatever>, please ensure that | ||
| 183 | * AUDIT_UNUSED_BITS is updated if need be. */ | ||
| 184 | #define AUDIT_UNUSED_BITS 0x07FFFC00 | ||
| 185 | |||
| 186 | /* AUDIT_FIELD_COMPARE rule list */ | ||
| 187 | #define AUDIT_COMPARE_UID_TO_OBJ_UID 1 | ||
| 188 | #define AUDIT_COMPARE_GID_TO_OBJ_GID 2 | ||
| 189 | #define AUDIT_COMPARE_EUID_TO_OBJ_UID 3 | ||
| 190 | #define AUDIT_COMPARE_EGID_TO_OBJ_GID 4 | ||
| 191 | #define AUDIT_COMPARE_AUID_TO_OBJ_UID 5 | ||
| 192 | #define AUDIT_COMPARE_SUID_TO_OBJ_UID 6 | ||
| 193 | #define AUDIT_COMPARE_SGID_TO_OBJ_GID 7 | ||
| 194 | #define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8 | ||
| 195 | #define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9 | ||
| 196 | |||
| 197 | #define AUDIT_COMPARE_UID_TO_AUID 10 | ||
| 198 | #define AUDIT_COMPARE_UID_TO_EUID 11 | ||
| 199 | #define AUDIT_COMPARE_UID_TO_FSUID 12 | ||
| 200 | #define AUDIT_COMPARE_UID_TO_SUID 13 | ||
| 201 | |||
| 202 | #define AUDIT_COMPARE_AUID_TO_FSUID 14 | ||
| 203 | #define AUDIT_COMPARE_AUID_TO_SUID 15 | ||
| 204 | #define AUDIT_COMPARE_AUID_TO_EUID 16 | ||
| 205 | |||
| 206 | #define AUDIT_COMPARE_EUID_TO_SUID 17 | ||
| 207 | #define AUDIT_COMPARE_EUID_TO_FSUID 18 | ||
| 208 | |||
| 209 | #define AUDIT_COMPARE_SUID_TO_FSUID 19 | ||
| 210 | |||
| 211 | #define AUDIT_COMPARE_GID_TO_EGID 20 | ||
| 212 | #define AUDIT_COMPARE_GID_TO_FSGID 21 | ||
| 213 | #define AUDIT_COMPARE_GID_TO_SGID 22 | ||
| 214 | |||
| 215 | #define AUDIT_COMPARE_EGID_TO_FSGID 23 | ||
| 216 | #define AUDIT_COMPARE_EGID_TO_SGID 24 | ||
| 217 | #define AUDIT_COMPARE_SGID_TO_FSGID 25 | ||
| 218 | |||
| 219 | #define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID | ||
| 220 | |||
| 221 | /* Rule fields */ | ||
| 222 | /* These are useful when checking the | ||
| 223 | * task structure at task creation time | ||
| 224 | * (AUDIT_PER_TASK). */ | ||
| 225 | #define AUDIT_PID 0 | ||
| 226 | #define AUDIT_UID 1 | ||
| 227 | #define AUDIT_EUID 2 | ||
| 228 | #define AUDIT_SUID 3 | ||
| 229 | #define AUDIT_FSUID 4 | ||
| 230 | #define AUDIT_GID 5 | ||
| 231 | #define AUDIT_EGID 6 | ||
| 232 | #define AUDIT_SGID 7 | ||
| 233 | #define AUDIT_FSGID 8 | ||
| 234 | #define AUDIT_LOGINUID 9 | ||
| 235 | #define AUDIT_PERS 10 | ||
| 236 | #define AUDIT_ARCH 11 | ||
| 237 | #define AUDIT_MSGTYPE 12 | ||
| 238 | #define AUDIT_SUBJ_USER 13 /* security label user */ | ||
| 239 | #define AUDIT_SUBJ_ROLE 14 /* security label role */ | ||
| 240 | #define AUDIT_SUBJ_TYPE 15 /* security label type */ | ||
| 241 | #define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */ | ||
| 242 | #define AUDIT_SUBJ_CLR 17 /* security label clearance label */ | ||
| 243 | #define AUDIT_PPID 18 | ||
| 244 | #define AUDIT_OBJ_USER 19 | ||
| 245 | #define AUDIT_OBJ_ROLE 20 | ||
| 246 | #define AUDIT_OBJ_TYPE 21 | ||
| 247 | #define AUDIT_OBJ_LEV_LOW 22 | ||
| 248 | #define AUDIT_OBJ_LEV_HIGH 23 | ||
| 249 | |||
| 250 | /* These are ONLY useful when checking | ||
| 251 | * at syscall exit time (AUDIT_AT_EXIT). */ | ||
| 252 | #define AUDIT_DEVMAJOR 100 | ||
| 253 | #define AUDIT_DEVMINOR 101 | ||
| 254 | #define AUDIT_INODE 102 | ||
| 255 | #define AUDIT_EXIT 103 | ||
| 256 | #define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ | ||
| 257 | #define AUDIT_WATCH 105 | ||
| 258 | #define AUDIT_PERM 106 | ||
| 259 | #define AUDIT_DIR 107 | ||
| 260 | #define AUDIT_FILETYPE 108 | ||
| 261 | #define AUDIT_OBJ_UID 109 | ||
| 262 | #define AUDIT_OBJ_GID 110 | ||
| 263 | #define AUDIT_FIELD_COMPARE 111 | ||
| 264 | |||
| 265 | #define AUDIT_ARG0 200 | ||
| 266 | #define AUDIT_ARG1 (AUDIT_ARG0+1) | ||
| 267 | #define AUDIT_ARG2 (AUDIT_ARG0+2) | ||
| 268 | #define AUDIT_ARG3 (AUDIT_ARG0+3) | ||
| 269 | |||
| 270 | #define AUDIT_FILTERKEY 210 | ||
| 271 | |||
| 272 | #define AUDIT_NEGATE 0x80000000 | ||
| 273 | |||
| 274 | /* These are the supported operators. | ||
| 275 | * 4 2 1 8 | ||
| 276 | * = > < ? | ||
| 277 | * ---------- | ||
| 278 | * 0 0 0 0 00 nonsense | ||
| 279 | * 0 0 0 1 08 & bit mask | ||
| 280 | * 0 0 1 0 10 < | ||
| 281 | * 0 1 0 0 20 > | ||
| 282 | * 0 1 1 0 30 != | ||
| 283 | * 1 0 0 0 40 = | ||
| 284 | * 1 0 0 1 48 &= bit test | ||
| 285 | * 1 0 1 0 50 <= | ||
| 286 | * 1 1 0 0 60 >= | ||
| 287 | * 1 1 1 1 78 all operators | ||
| 288 | */ | ||
| 289 | #define AUDIT_BIT_MASK 0x08000000 | ||
| 290 | #define AUDIT_LESS_THAN 0x10000000 | ||
| 291 | #define AUDIT_GREATER_THAN 0x20000000 | ||
| 292 | #define AUDIT_NOT_EQUAL 0x30000000 | ||
| 293 | #define AUDIT_EQUAL 0x40000000 | ||
| 294 | #define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL) | ||
| 295 | #define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) | ||
| 296 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) | ||
| 297 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) | ||
| 298 | |||
| 299 | enum { | ||
| 300 | Audit_equal, | ||
| 301 | Audit_not_equal, | ||
| 302 | Audit_bitmask, | ||
| 303 | Audit_bittest, | ||
| 304 | Audit_lt, | ||
| 305 | Audit_gt, | ||
| 306 | Audit_le, | ||
| 307 | Audit_ge, | ||
| 308 | Audit_bad | ||
| 309 | }; | ||
| 310 | |||
| 311 | /* Status symbols */ | ||
| 312 | /* Mask values */ | ||
| 313 | #define AUDIT_STATUS_ENABLED 0x0001 | ||
| 314 | #define AUDIT_STATUS_FAILURE 0x0002 | ||
| 315 | #define AUDIT_STATUS_PID 0x0004 | ||
| 316 | #define AUDIT_STATUS_RATE_LIMIT 0x0008 | ||
| 317 | #define AUDIT_STATUS_BACKLOG_LIMIT 0x0010 | ||
| 318 | /* Failure-to-log actions */ | ||
| 319 | #define AUDIT_FAIL_SILENT 0 | ||
| 320 | #define AUDIT_FAIL_PRINTK 1 | ||
| 321 | #define AUDIT_FAIL_PANIC 2 | ||
| 322 | |||
| 323 | /* distinguish syscall tables */ | ||
| 324 | #define __AUDIT_ARCH_64BIT 0x80000000 | ||
| 325 | #define __AUDIT_ARCH_LE 0x40000000 | ||
| 326 | #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 327 | #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) | ||
| 328 | #define AUDIT_ARCH_ARMEB (EM_ARM) | ||
| 329 | #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) | ||
| 330 | #define AUDIT_ARCH_FRV (EM_FRV) | ||
| 331 | #define AUDIT_ARCH_H8300 (EM_H8_300) | ||
| 332 | #define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE) | ||
| 333 | #define AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 334 | #define AUDIT_ARCH_M32R (EM_M32R) | ||
| 335 | #define AUDIT_ARCH_M68K (EM_68K) | ||
| 336 | #define AUDIT_ARCH_MIPS (EM_MIPS) | ||
| 337 | #define AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE) | ||
| 338 | #define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT) | ||
| 339 | #define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 340 | #define AUDIT_ARCH_OPENRISC (EM_OPENRISC) | ||
| 341 | #define AUDIT_ARCH_PARISC (EM_PARISC) | ||
| 342 | #define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT) | ||
| 343 | #define AUDIT_ARCH_PPC (EM_PPC) | ||
| 344 | #define AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT) | ||
| 345 | #define AUDIT_ARCH_S390 (EM_S390) | ||
| 346 | #define AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT) | ||
| 347 | #define AUDIT_ARCH_SH (EM_SH) | ||
| 348 | #define AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE) | ||
| 349 | #define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT) | ||
| 350 | #define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 351 | #define AUDIT_ARCH_SPARC (EM_SPARC) | ||
| 352 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT) | ||
| 353 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 354 | |||
| 355 | #define AUDIT_PERM_EXEC 1 | ||
| 356 | #define AUDIT_PERM_WRITE 2 | ||
| 357 | #define AUDIT_PERM_READ 4 | ||
| 358 | #define AUDIT_PERM_ATTR 8 | ||
| 359 | |||
| 360 | struct audit_status { | ||
| 361 | __u32 mask; /* Bit mask for valid entries */ | ||
| 362 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | ||
| 363 | __u32 failure; /* Failure-to-log action */ | ||
| 364 | __u32 pid; /* pid of auditd process */ | ||
| 365 | __u32 rate_limit; /* messages rate limit (per second) */ | ||
| 366 | __u32 backlog_limit; /* waiting messages limit */ | ||
| 367 | __u32 lost; /* messages lost */ | ||
| 368 | __u32 backlog; /* messages waiting in queue */ | ||
| 369 | }; | ||
| 370 | |||
| 371 | struct audit_tty_status { | ||
| 372 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | ||
| 373 | }; | ||
| 374 | |||
| 375 | /* audit_rule_data supports filter rules with both integer and string | ||
| 376 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and | ||
| 377 | * AUDIT_LIST_RULES requests. | ||
| 378 | */ | ||
| 379 | struct audit_rule_data { | ||
| 380 | __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */ | ||
| 381 | __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */ | ||
| 382 | __u32 field_count; | ||
| 383 | __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */ | ||
| 384 | __u32 fields[AUDIT_MAX_FIELDS]; | ||
| 385 | __u32 values[AUDIT_MAX_FIELDS]; | ||
| 386 | __u32 fieldflags[AUDIT_MAX_FIELDS]; | ||
| 387 | __u32 buflen; /* total length of string fields */ | ||
| 388 | char buf[0]; /* string fields buffer */ | ||
| 389 | }; | ||
| 390 | |||
| 391 | /* audit_rule is supported to maintain backward compatibility with | ||
| 392 | * userspace. It supports integer fields only and corresponds to | ||
| 393 | * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests. | ||
| 394 | */ | ||
| 395 | struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ | ||
| 396 | __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */ | ||
| 397 | __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */ | ||
| 398 | __u32 field_count; | ||
| 399 | __u32 mask[AUDIT_BITMASK_SIZE]; | ||
| 400 | __u32 fields[AUDIT_MAX_FIELDS]; | ||
| 401 | __u32 values[AUDIT_MAX_FIELDS]; | ||
| 402 | }; | ||
| 403 | |||
| 404 | #endif /* _UAPI_LINUX_AUDIT_H_ */ | ||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* -*- linux-c -*- ------------------------------------------------------- * | ||
| 2 | * | ||
| 3 | * linux/include/linux/auto_fs.h | ||
| 4 | * | ||
| 5 | * Copyright 1997 Transmeta Corporation - All Rights Reserved | ||
| 6 | * | ||
| 7 | * This file is part of the Linux kernel and is made available under | ||
| 8 | * the terms of the GNU General Public License, version 2, or at your | ||
| 9 | * option, any later version, incorporated herein by reference. | ||
| 10 | * | ||
| 11 | * ----------------------------------------------------------------------- */ | ||
| 12 | |||
| 13 | |||
| 14 | #ifndef _UAPI_LINUX_AUTO_FS_H | ||
| 15 | #define _UAPI_LINUX_AUTO_FS_H | ||
| 16 | |||
| 17 | #include <linux/types.h> | ||
| 18 | #ifndef __KERNEL__ | ||
| 19 | #include <sys/ioctl.h> | ||
| 20 | #endif /* __KERNEL__ */ | ||
| 21 | |||
| 22 | |||
| 23 | /* This file describes autofs v3 */ | ||
| 24 | #define AUTOFS_PROTO_VERSION 3 | ||
| 25 | |||
| 26 | /* Range of protocol versions defined */ | ||
| 27 | #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
| 28 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Architectures where both 32- and 64-bit binaries can be executed | ||
| 32 | * on 64-bit kernels need this. This keeps the structure format | ||
| 33 | * uniform, and makes sure the wait_queue_token isn't too big to be | ||
| 34 | * passed back down to the kernel. | ||
| 35 | * | ||
| 36 | * This assumes that on these architectures: | ||
| 37 | * mode 32 bit 64 bit | ||
| 38 | * ------------------------- | ||
| 39 | * int 32 bit 32 bit | ||
| 40 | * long 32 bit 64 bit | ||
| 41 | * | ||
| 42 | * If so, 32-bit user-space code should be backwards compatible. | ||
| 43 | */ | ||
| 44 | |||
| 45 | #if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ | ||
| 46 | || defined(__powerpc__) || defined(__s390__) | ||
| 47 | typedef unsigned int autofs_wqt_t; | ||
| 48 | #else | ||
| 49 | typedef unsigned long autofs_wqt_t; | ||
| 50 | #endif | ||
| 51 | |||
| 52 | /* Packet types */ | ||
| 53 | #define autofs_ptype_missing 0 /* Missing entry (mount request) */ | ||
| 54 | #define autofs_ptype_expire 1 /* Expire entry (umount request) */ | ||
| 55 | |||
| 56 | struct autofs_packet_hdr { | ||
| 57 | int proto_version; /* Protocol version */ | ||
| 58 | int type; /* Type of packet */ | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct autofs_packet_missing { | ||
| 62 | struct autofs_packet_hdr hdr; | ||
| 63 | autofs_wqt_t wait_queue_token; | ||
| 64 | int len; | ||
| 65 | char name[NAME_MAX+1]; | ||
| 66 | }; | ||
| 67 | |||
| 68 | /* v3 expire (via ioctl) */ | ||
| 69 | struct autofs_packet_expire { | ||
| 70 | struct autofs_packet_hdr hdr; | ||
| 71 | int len; | ||
| 72 | char name[NAME_MAX+1]; | ||
| 73 | }; | ||
| 74 | |||
| 75 | #define AUTOFS_IOC_READY _IO(0x93,0x60) | ||
| 76 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) | ||
| 77 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) | ||
| 78 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) | ||
| 79 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) | ||
| 80 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) | ||
| 81 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) | ||
| 82 | |||
| 83 | #endif /* _UAPI_LINUX_AUTO_FS_H */ | ||
| @@ -0,0 +1,164 @@ | |||
| 1 | /* -*- c -*- | ||
| 2 | * linux/include/linux/auto_fs4.h | ||
| 3 | * | ||
| 4 | * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org> | ||
| 5 | * | ||
| 6 | * This file is part of the Linux kernel and is made available under | ||
| 7 | * the terms of the GNU General Public License, version 2, or at your | ||
| 8 | * option, any later version, incorporated herein by reference. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _LINUX_AUTO_FS4_H | ||
| 12 | #define _LINUX_AUTO_FS4_H | ||
| 13 | |||
| 14 | /* Include common v3 definitions */ | ||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/auto_fs.h> | ||
| 17 | |||
| 18 | /* autofs v4 definitions */ | ||
| 19 | #undef AUTOFS_PROTO_VERSION | ||
| 20 | #undef AUTOFS_MIN_PROTO_VERSION | ||
| 21 | #undef AUTOFS_MAX_PROTO_VERSION | ||
| 22 | |||
| 23 | #define AUTOFS_PROTO_VERSION 5 | ||
| 24 | #define AUTOFS_MIN_PROTO_VERSION 3 | ||
| 25 | #define AUTOFS_MAX_PROTO_VERSION 5 | ||
| 26 | |||
| 27 | #define AUTOFS_PROTO_SUBVERSION 2 | ||
| 28 | |||
| 29 | /* Mask for expire behaviour */ | ||
| 30 | #define AUTOFS_EXP_IMMEDIATE 1 | ||
| 31 | #define AUTOFS_EXP_LEAVES 2 | ||
| 32 | |||
| 33 | #define AUTOFS_TYPE_ANY 0U | ||
| 34 | #define AUTOFS_TYPE_INDIRECT 1U | ||
| 35 | #define AUTOFS_TYPE_DIRECT 2U | ||
| 36 | #define AUTOFS_TYPE_OFFSET 4U | ||
| 37 | |||
| 38 | static inline void set_autofs_type_indirect(unsigned int *type) | ||
| 39 | { | ||
| 40 | *type = AUTOFS_TYPE_INDIRECT; | ||
| 41 | return; | ||
| 42 | } | ||
| 43 | |||
| 44 | static inline unsigned int autofs_type_indirect(unsigned int type) | ||
| 45 | { | ||
| 46 | return (type == AUTOFS_TYPE_INDIRECT); | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline void set_autofs_type_direct(unsigned int *type) | ||
| 50 | { | ||
| 51 | *type = AUTOFS_TYPE_DIRECT; | ||
| 52 | return; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline unsigned int autofs_type_direct(unsigned int type) | ||
| 56 | { | ||
| 57 | return (type == AUTOFS_TYPE_DIRECT); | ||
| 58 | } | ||
| 59 | |||
| 60 | static inline void set_autofs_type_offset(unsigned int *type) | ||
| 61 | { | ||
| 62 | *type = AUTOFS_TYPE_OFFSET; | ||
| 63 | return; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline unsigned int autofs_type_offset(unsigned int type) | ||
| 67 | { | ||
| 68 | return (type == AUTOFS_TYPE_OFFSET); | ||
| 69 | } | ||
| 70 | |||
| 71 | static inline unsigned int autofs_type_trigger(unsigned int type) | ||
| 72 | { | ||
| 73 | return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET); | ||
| 74 | } | ||
| 75 | |||
| 76 | /* | ||
| 77 | * This isn't really a type as we use it to say "no type set" to | ||
| 78 | * indicate we want to search for "any" mount in the | ||
| 79 | * autofs_dev_ioctl_ismountpoint() device ioctl function. | ||
| 80 | */ | ||
| 81 | static inline void set_autofs_type_any(unsigned int *type) | ||
| 82 | { | ||
| 83 | *type = AUTOFS_TYPE_ANY; | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | static inline unsigned int autofs_type_any(unsigned int type) | ||
| 88 | { | ||
| 89 | return (type == AUTOFS_TYPE_ANY); | ||
| 90 | } | ||
| 91 | |||
| 92 | /* Daemon notification packet types */ | ||
| 93 | enum autofs_notify { | ||
| 94 | NFY_NONE, | ||
| 95 | NFY_MOUNT, | ||
| 96 | NFY_EXPIRE | ||
| 97 | }; | ||
| 98 | |||
| 99 | /* Kernel protocol version 4 packet types */ | ||
| 100 | |||
| 101 | /* Expire entry (umount request) */ | ||
| 102 | #define autofs_ptype_expire_multi 2 | ||
| 103 | |||
| 104 | /* Kernel protocol version 5 packet types */ | ||
| 105 | |||
| 106 | /* Indirect mount missing and expire requests. */ | ||
| 107 | #define autofs_ptype_missing_indirect 3 | ||
| 108 | #define autofs_ptype_expire_indirect 4 | ||
| 109 | |||
| 110 | /* Direct mount missing and expire requests */ | ||
| 111 | #define autofs_ptype_missing_direct 5 | ||
| 112 | #define autofs_ptype_expire_direct 6 | ||
| 113 | |||
| 114 | /* v4 multi expire (via pipe) */ | ||
| 115 | struct autofs_packet_expire_multi { | ||
| 116 | struct autofs_packet_hdr hdr; | ||
| 117 | autofs_wqt_t wait_queue_token; | ||
| 118 | int len; | ||
| 119 | char name[NAME_MAX+1]; | ||
| 120 | }; | ||
| 121 | |||
| 122 | union autofs_packet_union { | ||
| 123 | struct autofs_packet_hdr hdr; | ||
| 124 | struct autofs_packet_missing missing; | ||
| 125 | struct autofs_packet_expire expire; | ||
| 126 | struct autofs_packet_expire_multi expire_multi; | ||
| 127 | }; | ||
| 128 | |||
| 129 | /* autofs v5 common packet struct */ | ||
| 130 | struct autofs_v5_packet { | ||
| 131 | struct autofs_packet_hdr hdr; | ||
| 132 | autofs_wqt_t wait_queue_token; | ||
| 133 | __u32 dev; | ||
| 134 | __u64 ino; | ||
| 135 | __u32 uid; | ||
| 136 | __u32 gid; | ||
| 137 | __u32 pid; | ||
| 138 | __u32 tgid; | ||
| 139 | __u32 len; | ||
| 140 | char name[NAME_MAX+1]; | ||
| 141 | }; | ||
| 142 | |||
| 143 | typedef struct autofs_v5_packet autofs_packet_missing_indirect_t; | ||
| 144 | typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | ||
| 145 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | ||
| 146 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | ||
| 147 | |||
| 148 | union autofs_v5_packet_union { | ||
| 149 | struct autofs_packet_hdr hdr; | ||
| 150 | struct autofs_v5_packet v5_packet; | ||
| 151 | autofs_packet_missing_indirect_t missing_indirect; | ||
| 152 | autofs_packet_expire_indirect_t expire_indirect; | ||
| 153 | autofs_packet_missing_direct_t missing_direct; | ||
| 154 | autofs_packet_expire_direct_t expire_direct; | ||
| 155 | }; | ||
| 156 | |||
| 157 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) | ||
| 158 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI | ||
| 159 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI | ||
| 160 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) | ||
| 161 | #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) | ||
| 162 | |||
| 163 | |||
| 164 | #endif /* _LINUX_AUTO_FS4_H */ | ||
| @@ -0,0 +1,35 @@ | |||
| 1 | #ifndef _UAPI_LINUX_AUXVEC_H | ||
| 2 | #define _UAPI_LINUX_AUXVEC_H | ||
| 3 | |||
| 4 | #include <asm/auxvec.h> | ||
| 5 | |||
| 6 | /* Symbolic values for the entries in the auxiliary table | ||
| 7 | put on the initial stack */ | ||
| 8 | #define AT_NULL 0 /* end of vector */ | ||
| 9 | #define AT_IGNORE 1 /* entry should be ignored */ | ||
| 10 | #define AT_EXECFD 2 /* file descriptor of program */ | ||
| 11 | #define AT_PHDR 3 /* program headers for program */ | ||
| 12 | #define AT_PHENT 4 /* size of program header entry */ | ||
| 13 | #define AT_PHNUM 5 /* number of program headers */ | ||
| 14 | #define AT_PAGESZ 6 /* system page size */ | ||
| 15 | #define AT_BASE 7 /* base address of interpreter */ | ||
| 16 | #define AT_FLAGS 8 /* flags */ | ||
| 17 | #define AT_ENTRY 9 /* entry point of program */ | ||
| 18 | #define AT_NOTELF 10 /* program is not ELF */ | ||
| 19 | #define AT_UID 11 /* real uid */ | ||
| 20 | #define AT_EUID 12 /* effective uid */ | ||
| 21 | #define AT_GID 13 /* real gid */ | ||
| 22 | #define AT_EGID 14 /* effective gid */ | ||
| 23 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | ||
| 24 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | ||
| 25 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | ||
| 26 | /* AT_* values 18 through 22 are reserved */ | ||
| 27 | #define AT_SECURE 23 /* secure mode boolean */ | ||
| 28 | #define AT_BASE_PLATFORM 24 /* string identifying real platform, may | ||
| 29 | * differ from AT_PLATFORM. */ | ||
| 30 | #define AT_RANDOM 25 /* address of 16 random bytes */ | ||
| 31 | |||
| 32 | #define AT_EXECFN 31 /* filename of program */ | ||
| 33 | |||
| 34 | |||
| 35 | #endif /* _UAPI_LINUX_AUXVEC_H */ | ||
| @@ -0,0 +1,116 @@ | |||
| 1 | /* | ||
| 2 | * These are the public elements of the Linux kernel AX.25 code. A similar | ||
| 3 | * file netrom.h exists for the NET/ROM protocol. | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef AX25_KERNEL_H | ||
| 7 | #define AX25_KERNEL_H | ||
| 8 | |||
| 9 | #include <linux/socket.h> | ||
| 10 | |||
| 11 | #define AX25_MTU 256 | ||
| 12 | #define AX25_MAX_DIGIS 8 | ||
| 13 | |||
| 14 | #define AX25_WINDOW 1 | ||
| 15 | #define AX25_T1 2 | ||
| 16 | #define AX25_N2 3 | ||
| 17 | #define AX25_T3 4 | ||
| 18 | #define AX25_T2 5 | ||
| 19 | #define AX25_BACKOFF 6 | ||
| 20 | #define AX25_EXTSEQ 7 | ||
| 21 | #define AX25_PIDINCL 8 | ||
| 22 | #define AX25_IDLE 9 | ||
| 23 | #define AX25_PACLEN 10 | ||
| 24 | #define AX25_IAMDIGI 12 | ||
| 25 | |||
| 26 | #define AX25_KILL 99 | ||
| 27 | |||
| 28 | #define SIOCAX25GETUID (SIOCPROTOPRIVATE+0) | ||
| 29 | #define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) | ||
| 30 | #define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) | ||
| 31 | #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) | ||
| 32 | #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) | ||
| 33 | #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) | ||
| 34 | #define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9) | ||
| 35 | #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) | ||
| 36 | #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) | ||
| 37 | #define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12) | ||
| 38 | #define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13) | ||
| 39 | |||
| 40 | #define AX25_SET_RT_IPMODE 2 | ||
| 41 | |||
| 42 | #define AX25_NOUID_DEFAULT 0 | ||
| 43 | #define AX25_NOUID_BLOCK 1 | ||
| 44 | |||
| 45 | typedef struct { | ||
| 46 | char ax25_call[7]; /* 6 call + SSID (shifted ascii!) */ | ||
| 47 | } ax25_address; | ||
| 48 | |||
| 49 | struct sockaddr_ax25 { | ||
| 50 | __kernel_sa_family_t sax25_family; | ||
| 51 | ax25_address sax25_call; | ||
| 52 | int sax25_ndigis; | ||
| 53 | /* Digipeater ax25_address sets follow */ | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define sax25_uid sax25_ndigis | ||
| 57 | |||
| 58 | struct full_sockaddr_ax25 { | ||
| 59 | struct sockaddr_ax25 fsa_ax25; | ||
| 60 | ax25_address fsa_digipeater[AX25_MAX_DIGIS]; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct ax25_routes_struct { | ||
| 64 | ax25_address port_addr; | ||
| 65 | ax25_address dest_addr; | ||
| 66 | unsigned char digi_count; | ||
| 67 | ax25_address digi_addr[AX25_MAX_DIGIS]; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct ax25_route_opt_struct { | ||
| 71 | ax25_address port_addr; | ||
| 72 | ax25_address dest_addr; | ||
| 73 | int cmd; | ||
| 74 | int arg; | ||
| 75 | }; | ||
| 76 | |||
| 77 | struct ax25_ctl_struct { | ||
| 78 | ax25_address port_addr; | ||
| 79 | ax25_address source_addr; | ||
| 80 | ax25_address dest_addr; | ||
| 81 | unsigned int cmd; | ||
| 82 | unsigned long arg; | ||
| 83 | unsigned char digi_count; | ||
| 84 | ax25_address digi_addr[AX25_MAX_DIGIS]; | ||
| 85 | }; | ||
| 86 | |||
| 87 | /* this will go away. Please do not export to user land */ | ||
| 88 | struct ax25_info_struct_deprecated { | ||
| 89 | unsigned int n2, n2count; | ||
| 90 | unsigned int t1, t1timer; | ||
| 91 | unsigned int t2, t2timer; | ||
| 92 | unsigned int t3, t3timer; | ||
| 93 | unsigned int idle, idletimer; | ||
| 94 | unsigned int state; | ||
| 95 | unsigned int rcv_q, snd_q; | ||
| 96 | }; | ||
| 97 | |||
| 98 | struct ax25_info_struct { | ||
| 99 | unsigned int n2, n2count; | ||
| 100 | unsigned int t1, t1timer; | ||
| 101 | unsigned int t2, t2timer; | ||
| 102 | unsigned int t3, t3timer; | ||
| 103 | unsigned int idle, idletimer; | ||
| 104 | unsigned int state; | ||
| 105 | unsigned int rcv_q, snd_q; | ||
| 106 | unsigned int vs, vr, va, vs_max; | ||
| 107 | unsigned int paclen; | ||
| 108 | unsigned int window; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct ax25_fwd_struct { | ||
| 112 | ax25_address port_from; | ||
| 113 | ax25_address port_to; | ||
| 114 | }; | ||
| 115 | |||
| 116 | #endif | ||
| @@ -0,0 +1,73 @@ | |||
| 1 | /* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $ | ||
| 2 | * | ||
| 3 | * ISDN lowlevel-module for AVM B1-card. | ||
| 4 | * | ||
| 5 | * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) | ||
| 6 | * | ||
| 7 | * This software may be used and distributed according to the terms | ||
| 8 | * of the GNU General Public License, incorporated herein by reference. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _B1LLI_H_ | ||
| 13 | #define _B1LLI_H_ | ||
| 14 | /* | ||
| 15 | * struct for loading t4 file | ||
| 16 | */ | ||
| 17 | typedef struct avmb1_t4file { | ||
| 18 | int len; | ||
| 19 | unsigned char *data; | ||
| 20 | } avmb1_t4file; | ||
| 21 | |||
| 22 | typedef struct avmb1_loaddef { | ||
| 23 | int contr; | ||
| 24 | avmb1_t4file t4file; | ||
| 25 | } avmb1_loaddef; | ||
| 26 | |||
| 27 | typedef struct avmb1_loadandconfigdef { | ||
| 28 | int contr; | ||
| 29 | avmb1_t4file t4file; | ||
| 30 | avmb1_t4file t4config; | ||
| 31 | } avmb1_loadandconfigdef; | ||
| 32 | |||
| 33 | typedef struct avmb1_resetdef { | ||
| 34 | int contr; | ||
| 35 | } avmb1_resetdef; | ||
| 36 | |||
| 37 | typedef struct avmb1_getdef { | ||
| 38 | int contr; | ||
| 39 | int cardtype; | ||
| 40 | int cardstate; | ||
| 41 | } avmb1_getdef; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * struct for adding new cards | ||
| 45 | */ | ||
| 46 | typedef struct avmb1_carddef { | ||
| 47 | int port; | ||
| 48 | int irq; | ||
| 49 | } avmb1_carddef; | ||
| 50 | |||
| 51 | #define AVM_CARDTYPE_B1 0 | ||
| 52 | #define AVM_CARDTYPE_T1 1 | ||
| 53 | #define AVM_CARDTYPE_M1 2 | ||
| 54 | #define AVM_CARDTYPE_M2 3 | ||
| 55 | |||
| 56 | typedef struct avmb1_extcarddef { | ||
| 57 | int port; | ||
| 58 | int irq; | ||
| 59 | int cardtype; | ||
| 60 | int cardnr; /* for HEMA/T1 */ | ||
| 61 | } avmb1_extcarddef; | ||
| 62 | |||
| 63 | #define AVMB1_LOAD 0 /* load image to card */ | ||
| 64 | #define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */ | ||
| 65 | #define AVMB1_RESETCARD 2 /* reset a card */ | ||
| 66 | #define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */ | ||
| 67 | #define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */ | ||
| 68 | #define AVMB1_GET_CARDINFO 5 /* get cardtype */ | ||
| 69 | #define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */ | ||
| 70 | |||
| 71 | #define AVMB1_REGISTERCARD_IS_OBSOLETE | ||
| 72 | |||
| 73 | #endif /* _B1LLI_H_ */ | ||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * The Linux BAYCOM driver for the Baycom serial 1200 baud modem | ||
| 3 | * and the parallel 9600 baud modem | ||
| 4 | * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _BAYCOM_H | ||
| 8 | #define _BAYCOM_H | ||
| 9 | |||
| 10 | /* -------------------------------------------------------------------- */ | ||
| 11 | /* | ||
| 12 | * structs for the IOCTL commands | ||
| 13 | */ | ||
| 14 | |||
| 15 | struct baycom_debug_data { | ||
| 16 | unsigned long debug1; | ||
| 17 | unsigned long debug2; | ||
| 18 | long debug3; | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct baycom_ioctl { | ||
| 22 | int cmd; | ||
| 23 | union { | ||
| 24 | struct baycom_debug_data dbg; | ||
| 25 | } data; | ||
| 26 | }; | ||
| 27 | |||
| 28 | /* -------------------------------------------------------------------- */ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * ioctl values change for baycom | ||
| 32 | */ | ||
| 33 | #define BAYCOMCTL_GETDEBUG 0x92 | ||
| 34 | |||
| 35 | /* -------------------------------------------------------------------- */ | ||
| 36 | |||
| 37 | #endif /* _BAYCOM_H */ | ||
| 38 | |||
| 39 | /* --------------------------------------------------------------------- */ | ||
| @@ -0,0 +1,81 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/bfs_fs.h - BFS data structures on disk. | ||
| 3 | * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _LINUX_BFS_FS_H | ||
| 7 | #define _LINUX_BFS_FS_H | ||
| 8 | |||
| 9 | #include <linux/types.h> | ||
| 10 | |||
| 11 | #define BFS_BSIZE_BITS 9 | ||
| 12 | #define BFS_BSIZE (1<<BFS_BSIZE_BITS) | ||
| 13 | |||
| 14 | #define BFS_MAGIC 0x1BADFACE | ||
| 15 | #define BFS_ROOT_INO 2 | ||
| 16 | #define BFS_INODES_PER_BLOCK 8 | ||
| 17 | |||
| 18 | /* SVR4 vnode type values (bfs_inode->i_vtype) */ | ||
| 19 | #define BFS_VDIR 2L | ||
| 20 | #define BFS_VREG 1L | ||
| 21 | |||
| 22 | /* BFS inode layout on disk */ | ||
| 23 | struct bfs_inode { | ||
| 24 | __le16 i_ino; | ||
| 25 | __u16 i_unused; | ||
| 26 | __le32 i_sblock; | ||
| 27 | __le32 i_eblock; | ||
| 28 | __le32 i_eoffset; | ||
| 29 | __le32 i_vtype; | ||
| 30 | __le32 i_mode; | ||
| 31 | __le32 i_uid; | ||
| 32 | __le32 i_gid; | ||
| 33 | __le32 i_nlink; | ||
| 34 | __le32 i_atime; | ||
| 35 | __le32 i_mtime; | ||
| 36 | __le32 i_ctime; | ||
| 37 | __u32 i_padding[4]; | ||
| 38 | }; | ||
| 39 | |||
| 40 | #define BFS_NAMELEN 14 | ||
| 41 | #define BFS_DIRENT_SIZE 16 | ||
| 42 | #define BFS_DIRS_PER_BLOCK 32 | ||
| 43 | |||
| 44 | struct bfs_dirent { | ||
| 45 | __le16 ino; | ||
| 46 | char name[BFS_NAMELEN]; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* BFS superblock layout on disk */ | ||
| 50 | struct bfs_super_block { | ||
| 51 | __le32 s_magic; | ||
| 52 | __le32 s_start; | ||
| 53 | __le32 s_end; | ||
| 54 | __le32 s_from; | ||
| 55 | __le32 s_to; | ||
| 56 | __s32 s_bfrom; | ||
| 57 | __s32 s_bto; | ||
| 58 | char s_fsname[6]; | ||
| 59 | char s_volume[6]; | ||
| 60 | __u32 s_padding[118]; | ||
| 61 | }; | ||
| 62 | |||
| 63 | |||
| 64 | #define BFS_OFF2INO(offset) \ | ||
| 65 | ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) | ||
| 66 | |||
| 67 | #define BFS_INO2OFF(ino) \ | ||
| 68 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) | ||
| 69 | #define BFS_NZFILESIZE(ip) \ | ||
| 70 | ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) | ||
| 71 | |||
| 72 | #define BFS_FILESIZE(ip) \ | ||
| 73 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) | ||
| 74 | |||
| 75 | #define BFS_FILEBLOCKS(ip) \ | ||
| 76 | ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) | ||
| 77 | #define BFS_UNCLEAN(bfs_sb, sb) \ | ||
| 78 | ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) | ||
| 79 | |||
| 80 | |||
| 81 | #endif /* _LINUX_BFS_FS_H */ | ||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef _UAPI_LINUX_BINFMTS_H | ||
| 2 | #define _UAPI_LINUX_BINFMTS_H | ||
| 3 | |||
| 4 | #include <linux/capability.h> | ||
| 5 | |||
| 6 | struct pt_regs; | ||
| 7 | |||
| 8 | /* | ||
| 9 | * These are the maximum length and maximum number of strings passed to the | ||
| 10 | * execve() system call. MAX_ARG_STRLEN is essentially random but serves to | ||
| 11 | * prevent the kernel from being unduly impacted by misaddressed pointers. | ||
| 12 | * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer. | ||
| 13 | */ | ||
| 14 | #define MAX_ARG_STRLEN (PAGE_SIZE * 32) | ||
| 15 | #define MAX_ARG_STRINGS 0x7FFFFFFF | ||
| 16 | |||
| 17 | /* sizeof(linux_binprm->buf) */ | ||
| 18 | #define BINPRM_BUF_SIZE 128 | ||
| 19 | |||
| 20 | #endif /* _UAPI_LINUX_BINFMTS_H */ | ||
| @@ -0,0 +1,59 @@ | |||
| 1 | #ifndef _LINUX_BLKPG_H | ||
| 2 | #define _LINUX_BLKPG_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Partition table and disk geometry handling | ||
| 6 | * | ||
| 7 | * A single ioctl with lots of subfunctions: | ||
| 8 | * | ||
| 9 | * Device number stuff: | ||
| 10 | * get_whole_disk() (given the device number of a partition, | ||
| 11 | * find the device number of the encompassing disk) | ||
| 12 | * get_all_partitions() (given the device number of a disk, return the | ||
| 13 | * device numbers of all its known partitions) | ||
| 14 | * | ||
| 15 | * Partition stuff: | ||
| 16 | * add_partition() | ||
| 17 | * delete_partition() | ||
| 18 | * test_partition_in_use() (also for test_disk_in_use) | ||
| 19 | * | ||
| 20 | * Geometry stuff: | ||
| 21 | * get_geometry() | ||
| 22 | * set_geometry() | ||
| 23 | * get_bios_drivedata() | ||
| 24 | * | ||
| 25 | * For today, only the partition stuff - aeb, 990515 | ||
| 26 | */ | ||
| 27 | #include <linux/compiler.h> | ||
| 28 | #include <linux/ioctl.h> | ||
| 29 | |||
| 30 | #define BLKPG _IO(0x12,105) | ||
| 31 | |||
| 32 | /* The argument structure */ | ||
| 33 | struct blkpg_ioctl_arg { | ||
| 34 | int op; | ||
| 35 | int flags; | ||
| 36 | int datalen; | ||
| 37 | void __user *data; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* The subfunctions (for the op field) */ | ||
| 41 | #define BLKPG_ADD_PARTITION 1 | ||
| 42 | #define BLKPG_DEL_PARTITION 2 | ||
| 43 | #define BLKPG_RESIZE_PARTITION 3 | ||
| 44 | |||
| 45 | /* Sizes of name fields. Unused at present. */ | ||
| 46 | #define BLKPG_DEVNAMELTH 64 | ||
| 47 | #define BLKPG_VOLNAMELTH 64 | ||
| 48 | |||
| 49 | /* The data structure for ADD_PARTITION and DEL_PARTITION */ | ||
| 50 | struct blkpg_partition { | ||
| 51 | long long start; /* starting offset in bytes */ | ||
| 52 | long long length; /* length in bytes */ | ||
| 53 | int pno; /* partition number */ | ||
| 54 | char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2, | ||
| 55 | to be used in kernel messages */ | ||
| 56 | char volname[BLKPG_VOLNAMELTH]; /* volume label */ | ||
| 57 | }; | ||
| 58 | |||
| 59 | #endif /* _LINUX_BLKPG_H */ | ||
| @@ -0,0 +1,142 @@ | |||
| 1 | #ifndef _UAPIBLKTRACE_H | ||
| 2 | #define _UAPIBLKTRACE_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* | ||
| 7 | * Trace categories | ||
| 8 | */ | ||
| 9 | enum blktrace_cat { | ||
| 10 | BLK_TC_READ = 1 << 0, /* reads */ | ||
| 11 | BLK_TC_WRITE = 1 << 1, /* writes */ | ||
| 12 | BLK_TC_FLUSH = 1 << 2, /* flush */ | ||
| 13 | BLK_TC_SYNC = 1 << 3, /* sync IO */ | ||
| 14 | BLK_TC_SYNCIO = BLK_TC_SYNC, | ||
| 15 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | ||
| 16 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ | ||
| 17 | BLK_TC_ISSUE = 1 << 6, /* issue */ | ||
| 18 | BLK_TC_COMPLETE = 1 << 7, /* completions */ | ||
| 19 | BLK_TC_FS = 1 << 8, /* fs requests */ | ||
| 20 | BLK_TC_PC = 1 << 9, /* pc requests */ | ||
| 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | ||
| 22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | ||
| 23 | BLK_TC_META = 1 << 12, /* metadata */ | ||
| 24 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | ||
| 25 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ | ||
| 26 | BLK_TC_FUA = 1 << 15, /* fua requests */ | ||
| 27 | |||
| 28 | BLK_TC_END = 1 << 15, /* we've run out of bits! */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | #define BLK_TC_SHIFT (16) | ||
| 32 | #define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT) | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Basic trace actions | ||
| 36 | */ | ||
| 37 | enum blktrace_act { | ||
| 38 | __BLK_TA_QUEUE = 1, /* queued */ | ||
| 39 | __BLK_TA_BACKMERGE, /* back merged to existing rq */ | ||
| 40 | __BLK_TA_FRONTMERGE, /* front merge to existing rq */ | ||
| 41 | __BLK_TA_GETRQ, /* allocated new request */ | ||
| 42 | __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */ | ||
| 43 | __BLK_TA_REQUEUE, /* request requeued */ | ||
| 44 | __BLK_TA_ISSUE, /* sent to driver */ | ||
| 45 | __BLK_TA_COMPLETE, /* completed by driver */ | ||
| 46 | __BLK_TA_PLUG, /* queue was plugged */ | ||
| 47 | __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */ | ||
| 48 | __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */ | ||
| 49 | __BLK_TA_INSERT, /* insert request */ | ||
| 50 | __BLK_TA_SPLIT, /* bio was split */ | ||
| 51 | __BLK_TA_BOUNCE, /* bio was bounced */ | ||
| 52 | __BLK_TA_REMAP, /* bio was remapped */ | ||
| 53 | __BLK_TA_ABORT, /* request aborted */ | ||
| 54 | __BLK_TA_DRV_DATA, /* driver-specific binary data */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* | ||
| 58 | * Notify events. | ||
| 59 | */ | ||
| 60 | enum blktrace_notify { | ||
| 61 | __BLK_TN_PROCESS = 0, /* establish pid/name mapping */ | ||
| 62 | __BLK_TN_TIMESTAMP, /* include system clock */ | ||
| 63 | __BLK_TN_MESSAGE, /* Character string message */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | |||
| 67 | /* | ||
| 68 | * Trace actions in full. Additionally, read or write is masked | ||
| 69 | */ | ||
| 70 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 71 | #define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 72 | #define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 73 | #define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 74 | #define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 75 | #define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE)) | ||
| 76 | #define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE)) | ||
| 77 | #define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE)) | ||
| 78 | #define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 79 | #define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 80 | #define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 81 | #define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 82 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | ||
| 83 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | ||
| 84 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 85 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
| 86 | #define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA)) | ||
| 87 | |||
| 88 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
| 89 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
| 90 | #define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
| 91 | |||
| 92 | #define BLK_IO_TRACE_MAGIC 0x65617400 | ||
| 93 | #define BLK_IO_TRACE_VERSION 0x07 | ||
| 94 | |||
| 95 | /* | ||
| 96 | * The trace itself | ||
| 97 | */ | ||
| 98 | struct blk_io_trace { | ||
| 99 | __u32 magic; /* MAGIC << 8 | version */ | ||
| 100 | __u32 sequence; /* event number */ | ||
| 101 | __u64 time; /* in microseconds */ | ||
| 102 | __u64 sector; /* disk offset */ | ||
| 103 | __u32 bytes; /* transfer length */ | ||
| 104 | __u32 action; /* what happened */ | ||
| 105 | __u32 pid; /* who did it */ | ||
| 106 | __u32 device; /* device number */ | ||
| 107 | __u32 cpu; /* on what cpu did it happen */ | ||
| 108 | __u16 error; /* completion error */ | ||
| 109 | __u16 pdu_len; /* length of data after this trace */ | ||
| 110 | }; | ||
| 111 | |||
| 112 | /* | ||
| 113 | * The remap event | ||
| 114 | */ | ||
| 115 | struct blk_io_trace_remap { | ||
| 116 | __be32 device_from; | ||
| 117 | __be32 device_to; | ||
| 118 | __be64 sector_from; | ||
| 119 | }; | ||
| 120 | |||
| 121 | enum { | ||
| 122 | Blktrace_setup = 1, | ||
| 123 | Blktrace_running, | ||
| 124 | Blktrace_stopped, | ||
| 125 | }; | ||
| 126 | |||
| 127 | #define BLKTRACE_BDEV_SIZE 32 | ||
| 128 | |||
| 129 | /* | ||
| 130 | * User setup structure passed with BLKTRACESTART | ||
| 131 | */ | ||
| 132 | struct blk_user_trace_setup { | ||
| 133 | char name[BLKTRACE_BDEV_SIZE]; /* output */ | ||
| 134 | __u16 act_mask; /* input */ | ||
| 135 | __u32 buf_size; /* input */ | ||
| 136 | __u32 buf_nr; /* input */ | ||
| 137 | __u64 start_lba; | ||
| 138 | __u64 end_lba; | ||
| 139 | __u32 pid; | ||
| 140 | }; | ||
| 141 | |||
| 142 | #endif /* _UAPIBLKTRACE_H */ | ||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef __BPQETHER_H | ||
| 2 | #define __BPQETHER_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Defines for the BPQETHER pseudo device driver | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __LINUX_IF_ETHER_H | ||
| 9 | #include <linux/if_ether.h> | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #define SIOCSBPQETHOPT (SIOCDEVPRIVATE+0) /* reserved */ | ||
| 13 | #define SIOCSBPQETHADDR (SIOCDEVPRIVATE+1) | ||
| 14 | |||
| 15 | struct bpq_ethaddr { | ||
| 16 | unsigned char destination[ETH_ALEN]; | ||
| 17 | unsigned char accept[ETH_ALEN]; | ||
| 18 | }; | ||
| 19 | |||
| 20 | /* | ||
| 21 | * For SIOCSBPQETHOPT - this is compatible with PI2/PacketTwin card drivers, | ||
| 22 | * currently not implemented, though. If someone wants to hook a radio | ||
| 23 | * to his Ethernet card he may find this useful. ;-) | ||
| 24 | */ | ||
| 25 | |||
| 26 | #define SIOCGBPQETHPARAM 0x5000 /* get Level 1 parameters */ | ||
| 27 | #define SIOCSBPQETHPARAM 0x5001 /* set */ | ||
| 28 | |||
| 29 | struct bpq_req { | ||
| 30 | int cmd; | ||
| 31 | int speed; /* unused */ | ||
| 32 | int clockmode; /* unused */ | ||
| 33 | int txdelay; | ||
| 34 | unsigned char persist; /* unused */ | ||
| 35 | int slotime; /* unused */ | ||
| 36 | int squeldelay; | ||
| 37 | int dmachan; /* unused */ | ||
| 38 | int irq; /* unused */ | ||
| 39 | }; | ||
| 40 | |||
| 41 | #endif | ||
| @@ -0,0 +1,65 @@ | |||
| 1 | #ifndef _UAPIBSG_H | ||
| 2 | #define _UAPIBSG_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #define BSG_PROTOCOL_SCSI 0 | ||
| 7 | |||
| 8 | #define BSG_SUB_PROTOCOL_SCSI_CMD 0 | ||
| 9 | #define BSG_SUB_PROTOCOL_SCSI_TMF 1 | ||
| 10 | #define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 | ||
| 11 | |||
| 12 | /* | ||
| 13 | * For flags member below | ||
| 14 | * sg.h sg_io_hdr also has bits defined for it's flags member. However | ||
| 15 | * none of these bits are implemented/used by bsg. The bits below are | ||
| 16 | * allocated to not conflict with sg.h ones anyway. | ||
| 17 | */ | ||
| 18 | #define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */ | ||
| 19 | |||
| 20 | struct sg_io_v4 { | ||
| 21 | __s32 guard; /* [i] 'Q' to differentiate from v3 */ | ||
| 22 | __u32 protocol; /* [i] 0 -> SCSI , .... */ | ||
| 23 | __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task | ||
| 24 | management function, .... */ | ||
| 25 | |||
| 26 | __u32 request_len; /* [i] in bytes */ | ||
| 27 | __u64 request; /* [i], [*i] {SCSI: cdb} */ | ||
| 28 | __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */ | ||
| 29 | __u32 request_attr; /* [i] {SCSI: task attribute} */ | ||
| 30 | __u32 request_priority; /* [i] {SCSI: task priority} */ | ||
| 31 | __u32 request_extra; /* [i] {spare, for padding} */ | ||
| 32 | __u32 max_response_len; /* [i] in bytes */ | ||
| 33 | __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ | ||
| 34 | |||
| 35 | /* "dout_": data out (to device); "din_": data in (from device) */ | ||
| 36 | __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else | ||
| 37 | dout_xfer points to array of iovec */ | ||
| 38 | __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ | ||
| 39 | __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */ | ||
| 40 | __u32 din_xfer_len; /* [i] bytes to be transferred from device */ | ||
| 41 | __u64 dout_xferp; /* [i], [*i] */ | ||
| 42 | __u64 din_xferp; /* [i], [*o] */ | ||
| 43 | |||
| 44 | __u32 timeout; /* [i] units: millisecond */ | ||
| 45 | __u32 flags; /* [i] bit mask */ | ||
| 46 | __u64 usr_ptr; /* [i->o] unused internally */ | ||
| 47 | __u32 spare_in; /* [i] */ | ||
| 48 | |||
| 49 | __u32 driver_status; /* [o] 0 -> ok */ | ||
| 50 | __u32 transport_status; /* [o] 0 -> ok */ | ||
| 51 | __u32 device_status; /* [o] {SCSI: command completion status} */ | ||
| 52 | __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */ | ||
| 53 | __u32 info; /* [o] additional information */ | ||
| 54 | __u32 duration; /* [o] time to complete, in milliseconds */ | ||
| 55 | __u32 response_len; /* [o] bytes of response actually written */ | ||
| 56 | __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */ | ||
| 57 | __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */ | ||
| 58 | __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */ | ||
| 59 | __u32 spare_out; /* [o] */ | ||
| 60 | |||
| 61 | __u32 padding; | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | #endif /* _UAPIBSG_H */ | ||
| @@ -0,0 +1,3 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += big_endian.h | ||
| 3 | header-y += little_endian.h | ||
| @@ -0,0 +1,105 @@ | |||
| 1 | #ifndef _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H | ||
| 2 | #define _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H | ||
| 3 | |||
| 4 | #ifndef __BIG_ENDIAN | ||
| 5 | #define __BIG_ENDIAN 4321 | ||
| 6 | #endif | ||
| 7 | #ifndef __BIG_ENDIAN_BITFIELD | ||
| 8 | #define __BIG_ENDIAN_BITFIELD | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/swab.h> | ||
| 13 | |||
| 14 | #define __constant_htonl(x) ((__force __be32)(__u32)(x)) | ||
| 15 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x)) | ||
| 16 | #define __constant_htons(x) ((__force __be16)(__u16)(x)) | ||
| 17 | #define __constant_ntohs(x) ((__force __u16)(__be16)(x)) | ||
| 18 | #define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x))) | ||
| 19 | #define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x)) | ||
| 20 | #define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x))) | ||
| 21 | #define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x)) | ||
| 22 | #define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x))) | ||
| 23 | #define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x)) | ||
| 24 | #define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x)) | ||
| 25 | #define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x)) | ||
| 26 | #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) | ||
| 27 | #define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x)) | ||
| 28 | #define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x)) | ||
| 29 | #define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x)) | ||
| 30 | #define __cpu_to_le64(x) ((__force __le64)__swab64((x))) | ||
| 31 | #define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x)) | ||
| 32 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x))) | ||
| 33 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) | ||
| 34 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x))) | ||
| 35 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) | ||
| 36 | #define __cpu_to_be64(x) ((__force __be64)(__u64)(x)) | ||
| 37 | #define __be64_to_cpu(x) ((__force __u64)(__be64)(x)) | ||
| 38 | #define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) | ||
| 39 | #define __be32_to_cpu(x) ((__force __u32)(__be32)(x)) | ||
| 40 | #define __cpu_to_be16(x) ((__force __be16)(__u16)(x)) | ||
| 41 | #define __be16_to_cpu(x) ((__force __u16)(__be16)(x)) | ||
| 42 | |||
| 43 | static inline __le64 __cpu_to_le64p(const __u64 *p) | ||
| 44 | { | ||
| 45 | return (__force __le64)__swab64p(p); | ||
| 46 | } | ||
| 47 | static inline __u64 __le64_to_cpup(const __le64 *p) | ||
| 48 | { | ||
| 49 | return __swab64p((__u64 *)p); | ||
| 50 | } | ||
| 51 | static inline __le32 __cpu_to_le32p(const __u32 *p) | ||
| 52 | { | ||
| 53 | return (__force __le32)__swab32p(p); | ||
| 54 | } | ||
| 55 | static inline __u32 __le32_to_cpup(const __le32 *p) | ||
| 56 | { | ||
| 57 | return __swab32p((__u32 *)p); | ||
| 58 | } | ||
| 59 | static inline __le16 __cpu_to_le16p(const __u16 *p) | ||
| 60 | { | ||
| 61 | return (__force __le16)__swab16p(p); | ||
| 62 | } | ||
| 63 | static inline __u16 __le16_to_cpup(const __le16 *p) | ||
| 64 | { | ||
| 65 | return __swab16p((__u16 *)p); | ||
| 66 | } | ||
| 67 | static inline __be64 __cpu_to_be64p(const __u64 *p) | ||
| 68 | { | ||
| 69 | return (__force __be64)*p; | ||
| 70 | } | ||
| 71 | static inline __u64 __be64_to_cpup(const __be64 *p) | ||
| 72 | { | ||
| 73 | return (__force __u64)*p; | ||
| 74 | } | ||
| 75 | static inline __be32 __cpu_to_be32p(const __u32 *p) | ||
| 76 | { | ||
| 77 | return (__force __be32)*p; | ||
| 78 | } | ||
| 79 | static inline __u32 __be32_to_cpup(const __be32 *p) | ||
| 80 | { | ||
| 81 | return (__force __u32)*p; | ||
| 82 | } | ||
| 83 | static inline __be16 __cpu_to_be16p(const __u16 *p) | ||
| 84 | { | ||
| 85 | return (__force __be16)*p; | ||
| 86 | } | ||
| 87 | static inline __u16 __be16_to_cpup(const __be16 *p) | ||
| 88 | { | ||
| 89 | return (__force __u16)*p; | ||
| 90 | } | ||
| 91 | #define __cpu_to_le64s(x) __swab64s((x)) | ||
| 92 | #define __le64_to_cpus(x) __swab64s((x)) | ||
| 93 | #define __cpu_to_le32s(x) __swab32s((x)) | ||
| 94 | #define __le32_to_cpus(x) __swab32s((x)) | ||
| 95 | #define __cpu_to_le16s(x) __swab16s((x)) | ||
| 96 | #define __le16_to_cpus(x) __swab16s((x)) | ||
| 97 | #define __cpu_to_be64s(x) do { (void)(x); } while (0) | ||
| 98 | #define __be64_to_cpus(x) do { (void)(x); } while (0) | ||
| 99 | #define __cpu_to_be32s(x) do { (void)(x); } while (0) | ||
| 100 | #define __be32_to_cpus(x) do { (void)(x); } while (0) | ||
| 101 | #define __cpu_to_be16s(x) do { (void)(x); } while (0) | ||
| 102 | #define __be16_to_cpus(x) do { (void)(x); } while (0) | ||
| 103 | |||
| 104 | |||
| 105 | #endif /* _UAPI_LINUX_BYTEORDER_BIG_ENDIAN_H */ | ||
| @@ -0,0 +1,105 @@ | |||
| 1 | #ifndef _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H | ||
| 2 | #define _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H | ||
| 3 | |||
| 4 | #ifndef __LITTLE_ENDIAN | ||
| 5 | #define __LITTLE_ENDIAN 1234 | ||
| 6 | #endif | ||
| 7 | #ifndef __LITTLE_ENDIAN_BITFIELD | ||
| 8 | #define __LITTLE_ENDIAN_BITFIELD | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/swab.h> | ||
| 13 | |||
| 14 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) | ||
| 15 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) | ||
| 16 | #define __constant_htons(x) ((__force __be16)___constant_swab16((x))) | ||
| 17 | #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x)) | ||
| 18 | #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x)) | ||
| 19 | #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ||
| 20 | #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x)) | ||
| 21 | #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ||
| 22 | #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x)) | ||
| 23 | #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ||
| 24 | #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x))) | ||
| 25 | #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x)) | ||
| 26 | #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x))) | ||
| 27 | #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x)) | ||
| 28 | #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x))) | ||
| 29 | #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x)) | ||
| 30 | #define __cpu_to_le64(x) ((__force __le64)(__u64)(x)) | ||
| 31 | #define __le64_to_cpu(x) ((__force __u64)(__le64)(x)) | ||
| 32 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x)) | ||
| 33 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ||
| 34 | #define __cpu_to_le16(x) ((__force __le16)(__u16)(x)) | ||
| 35 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ||
| 36 | #define __cpu_to_be64(x) ((__force __be64)__swab64((x))) | ||
| 37 | #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x)) | ||
| 38 | #define __cpu_to_be32(x) ((__force __be32)__swab32((x))) | ||
| 39 | #define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x)) | ||
| 40 | #define __cpu_to_be16(x) ((__force __be16)__swab16((x))) | ||
| 41 | #define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x)) | ||
| 42 | |||
| 43 | static inline __le64 __cpu_to_le64p(const __u64 *p) | ||
| 44 | { | ||
| 45 | return (__force __le64)*p; | ||
| 46 | } | ||
| 47 | static inline __u64 __le64_to_cpup(const __le64 *p) | ||
| 48 | { | ||
| 49 | return (__force __u64)*p; | ||
| 50 | } | ||
| 51 | static inline __le32 __cpu_to_le32p(const __u32 *p) | ||
| 52 | { | ||
| 53 | return (__force __le32)*p; | ||
| 54 | } | ||
| 55 | static inline __u32 __le32_to_cpup(const __le32 *p) | ||
| 56 | { | ||
| 57 | return (__force __u32)*p; | ||
| 58 | } | ||
| 59 | static inline __le16 __cpu_to_le16p(const __u16 *p) | ||
| 60 | { | ||
| 61 | return (__force __le16)*p; | ||
| 62 | } | ||
| 63 | static inline __u16 __le16_to_cpup(const __le16 *p) | ||
| 64 | { | ||
| 65 | return (__force __u16)*p; | ||
| 66 | } | ||
| 67 | static inline __be64 __cpu_to_be64p(const __u64 *p) | ||
| 68 | { | ||
| 69 | return (__force __be64)__swab64p(p); | ||
| 70 | } | ||
| 71 | static inline __u64 __be64_to_cpup(const __be64 *p) | ||
| 72 | { | ||
| 73 | return __swab64p((__u64 *)p); | ||
| 74 | } | ||
| 75 | static inline __be32 __cpu_to_be32p(const __u32 *p) | ||
| 76 | { | ||
| 77 | return (__force __be32)__swab32p(p); | ||
| 78 | } | ||
| 79 | static inline __u32 __be32_to_cpup(const __be32 *p) | ||
| 80 | { | ||
| 81 | return __swab32p((__u32 *)p); | ||
| 82 | } | ||
| 83 | static inline __be16 __cpu_to_be16p(const __u16 *p) | ||
| 84 | { | ||
| 85 | return (__force __be16)__swab16p(p); | ||
| 86 | } | ||
| 87 | static inline __u16 __be16_to_cpup(const __be16 *p) | ||
| 88 | { | ||
| 89 | return __swab16p((__u16 *)p); | ||
| 90 | } | ||
| 91 | #define __cpu_to_le64s(x) do { (void)(x); } while (0) | ||
| 92 | #define __le64_to_cpus(x) do { (void)(x); } while (0) | ||
| 93 | #define __cpu_to_le32s(x) do { (void)(x); } while (0) | ||
| 94 | #define __le32_to_cpus(x) do { (void)(x); } while (0) | ||
| 95 | #define __cpu_to_le16s(x) do { (void)(x); } while (0) | ||
| 96 | #define __le16_to_cpus(x) do { (void)(x); } while (0) | ||
| 97 | #define __cpu_to_be64s(x) __swab64s((x)) | ||
| 98 | #define __be64_to_cpus(x) __swab64s((x)) | ||
| 99 | #define __cpu_to_be32s(x) __swab32s((x)) | ||
| 100 | #define __be32_to_cpus(x) __swab32s((x)) | ||
| 101 | #define __cpu_to_be16s(x) __swab16s((x)) | ||
| 102 | #define __be16_to_cpus(x) __swab16s((x)) | ||
| 103 | |||
| 104 | |||
| 105 | #endif /* _UAPI_LINUX_BYTEORDER_LITTLE_ENDIAN_H */ | ||
| @@ -0,0 +1,3 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += caif_socket.h | ||
| 3 | header-y += if_caif.h | ||
| @@ -0,0 +1,194 @@ | |||
| 1 | /* linux/caif_socket.h | ||
| 2 | * CAIF Definitions for CAIF socket and network layer | ||
| 3 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 4 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _LINUX_CAIF_SOCKET_H | ||
| 9 | #define _LINUX_CAIF_SOCKET_H | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/socket.h> | ||
| 13 | |||
| 14 | /** | ||
| 15 | * enum caif_link_selector - Physical Link Selection. | ||
| 16 | * @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth | ||
| 17 | * traffic. | ||
| 18 | * @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency | ||
| 19 | * traffic. | ||
| 20 | * | ||
| 21 | * CAIF Link Layers can register their link properties. | ||
| 22 | * This enum is used for choosing between CAIF Link Layers when | ||
| 23 | * setting up CAIF Channels when multiple CAIF Link Layers exists. | ||
| 24 | */ | ||
| 25 | enum caif_link_selector { | ||
| 26 | CAIF_LINK_HIGH_BANDW, | ||
| 27 | CAIF_LINK_LOW_LATENCY | ||
| 28 | }; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * enum caif_channel_priority - CAIF channel priorities. | ||
| 32 | * | ||
| 33 | * @CAIF_PRIO_MIN: Min priority for a channel. | ||
| 34 | * @CAIF_PRIO_LOW: Low-priority channel. | ||
| 35 | * @CAIF_PRIO_NORMAL: Normal/default priority level. | ||
| 36 | * @CAIF_PRIO_HIGH: High priority level | ||
| 37 | * @CAIF_PRIO_MAX: Max priority for channel | ||
| 38 | * | ||
| 39 | * Priority can be set on CAIF Channels in order to | ||
| 40 | * prioritize between traffic on different CAIF Channels. | ||
| 41 | * These priority levels are recommended, but the priority value | ||
| 42 | * is not restricted to the values defined in this enum, any value | ||
| 43 | * between CAIF_PRIO_MIN and CAIF_PRIO_MAX could be used. | ||
| 44 | */ | ||
| 45 | enum caif_channel_priority { | ||
| 46 | CAIF_PRIO_MIN = 0x01, | ||
| 47 | CAIF_PRIO_LOW = 0x04, | ||
| 48 | CAIF_PRIO_NORMAL = 0x0f, | ||
| 49 | CAIF_PRIO_HIGH = 0x14, | ||
| 50 | CAIF_PRIO_MAX = 0x1F | ||
| 51 | }; | ||
| 52 | |||
| 53 | /** | ||
| 54 | * enum caif_protocol_type - CAIF Channel type. | ||
| 55 | * @CAIFPROTO_AT: Classic AT channel. | ||
| 56 | * @CAIFPROTO_DATAGRAM: Datagram channel. | ||
| 57 | * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. | ||
| 58 | * @CAIFPROTO_UTIL: Utility (Psock) channel. | ||
| 59 | * @CAIFPROTO_RFM: Remote File Manager | ||
| 60 | * @CAIFPROTO_DEBUG: Debug link | ||
| 61 | * | ||
| 62 | * This enum defines the CAIF Channel type to be used. This defines | ||
| 63 | * the service to connect to on the modem. | ||
| 64 | */ | ||
| 65 | enum caif_protocol_type { | ||
| 66 | CAIFPROTO_AT, | ||
| 67 | CAIFPROTO_DATAGRAM, | ||
| 68 | CAIFPROTO_DATAGRAM_LOOP, | ||
| 69 | CAIFPROTO_UTIL, | ||
| 70 | CAIFPROTO_RFM, | ||
| 71 | CAIFPROTO_DEBUG, | ||
| 72 | _CAIFPROTO_MAX | ||
| 73 | }; | ||
| 74 | #define CAIFPROTO_MAX _CAIFPROTO_MAX | ||
| 75 | |||
| 76 | /** | ||
| 77 | * enum caif_at_type - AT Service Endpoint | ||
| 78 | * @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel. | ||
| 79 | */ | ||
| 80 | enum caif_at_type { | ||
| 81 | CAIF_ATTYPE_PLAIN = 2 | ||
| 82 | }; | ||
| 83 | /** | ||
| 84 | * enum caif_debug_type - Content selection for debug connection | ||
| 85 | * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain | ||
| 86 | * both trace and interactive debug. | ||
| 87 | * @CAIF_DEBUG_TRACE: Connection contains trace only. | ||
| 88 | * @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug. | ||
| 89 | */ | ||
| 90 | enum caif_debug_type { | ||
| 91 | CAIF_DEBUG_TRACE_INTERACTIVE = 0, | ||
| 92 | CAIF_DEBUG_TRACE, | ||
| 93 | CAIF_DEBUG_INTERACTIVE, | ||
| 94 | }; | ||
| 95 | |||
| 96 | /** | ||
| 97 | * enum caif_debug_service - Debug Service Endpoint | ||
| 98 | * @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system | ||
| 99 | * @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system | ||
| 100 | */ | ||
| 101 | enum caif_debug_service { | ||
| 102 | CAIF_RADIO_DEBUG_SERVICE = 1, | ||
| 103 | CAIF_APP_DEBUG_SERVICE | ||
| 104 | }; | ||
| 105 | |||
| 106 | /** | ||
| 107 | * struct sockaddr_caif - the sockaddr structure for CAIF sockets. | ||
| 108 | * @family: Address family number, must be AF_CAIF. | ||
| 109 | * @u: Union of address data 'switched' by family. | ||
| 110 | * : | ||
| 111 | * @u.at: Applies when family = CAIFPROTO_AT. | ||
| 112 | * | ||
| 113 | * @u.at.type: Type of AT link to set up (enum caif_at_type). | ||
| 114 | * | ||
| 115 | * @u.util: Applies when family = CAIFPROTO_UTIL | ||
| 116 | * | ||
| 117 | * @u.util.service: Utility service name. | ||
| 118 | * | ||
| 119 | * @u.dgm: Applies when family = CAIFPROTO_DATAGRAM | ||
| 120 | * | ||
| 121 | * @u.dgm.connection_id: Datagram connection id. | ||
| 122 | * | ||
| 123 | * @u.dgm.nsapi: NSAPI of the PDP-Context. | ||
| 124 | * | ||
| 125 | * @u.rfm: Applies when family = CAIFPROTO_RFM | ||
| 126 | * | ||
| 127 | * @u.rfm.connection_id: Connection ID for RFM. | ||
| 128 | * | ||
| 129 | * @u.rfm.volume: Volume to mount. | ||
| 130 | * | ||
| 131 | * @u.dbg: Applies when family = CAIFPROTO_DEBUG. | ||
| 132 | * | ||
| 133 | * @u.dbg.type: Type of debug connection to set up | ||
| 134 | * (caif_debug_type). | ||
| 135 | * | ||
| 136 | * @u.dbg.service: Service sub-system to connect (caif_debug_service | ||
| 137 | * Description: | ||
| 138 | * This structure holds the connect parameters used for setting up a | ||
| 139 | * CAIF Channel. It defines the service to connect to on the modem. | ||
| 140 | */ | ||
| 141 | struct sockaddr_caif { | ||
| 142 | __kernel_sa_family_t family; | ||
| 143 | union { | ||
| 144 | struct { | ||
| 145 | __u8 type; /* type: enum caif_at_type */ | ||
| 146 | } at; /* CAIFPROTO_AT */ | ||
| 147 | struct { | ||
| 148 | char service[16]; | ||
| 149 | } util; /* CAIFPROTO_UTIL */ | ||
| 150 | union { | ||
| 151 | __u32 connection_id; | ||
| 152 | __u8 nsapi; | ||
| 153 | } dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/ | ||
| 154 | struct { | ||
| 155 | __u32 connection_id; | ||
| 156 | char volume[16]; | ||
| 157 | } rfm; /* CAIFPROTO_RFM */ | ||
| 158 | struct { | ||
| 159 | __u8 type; /* type:enum caif_debug_type */ | ||
| 160 | __u8 service; /* service:caif_debug_service */ | ||
| 161 | } dbg; /* CAIFPROTO_DEBUG */ | ||
| 162 | } u; | ||
| 163 | }; | ||
| 164 | |||
| 165 | /** | ||
| 166 | * enum caif_socket_opts - CAIF option values for getsockopt and setsockopt. | ||
| 167 | * | ||
| 168 | * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are | ||
| 169 | * available. Either a high bandwidth | ||
| 170 | * link can be selected (CAIF_LINK_HIGH_BANDW) or | ||
| 171 | * or a low latency link (CAIF_LINK_LOW_LATENCY). | ||
| 172 | * This option is of type __u32. | ||
| 173 | * Alternatively SO_BINDTODEVICE can be used. | ||
| 174 | * | ||
| 175 | * @CAIFSO_REQ_PARAM: Used to set the request parameters for a | ||
| 176 | * utility channel. (maximum 256 bytes). This | ||
| 177 | * option must be set before connecting. | ||
| 178 | * | ||
| 179 | * @CAIFSO_RSP_PARAM: Gets the response parameters for a utility | ||
| 180 | * channel. (maximum 256 bytes). This option | ||
| 181 | * is valid after a successful connect. | ||
| 182 | * | ||
| 183 | * | ||
| 184 | * This enum defines the CAIF Socket options to be used on a socket | ||
| 185 | * of type PF_CAIF. | ||
| 186 | * | ||
| 187 | */ | ||
| 188 | enum caif_socket_opts { | ||
| 189 | CAIFSO_LINK_SELECT = 127, | ||
| 190 | CAIFSO_REQ_PARAM = 128, | ||
| 191 | CAIFSO_RSP_PARAM = 129, | ||
| 192 | }; | ||
| 193 | |||
| 194 | #endif /* _LINUX_CAIF_SOCKET_H */ | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef IF_CAIF_H_ | ||
| 8 | #define IF_CAIF_H_ | ||
| 9 | #include <linux/sockios.h> | ||
| 10 | #include <linux/types.h> | ||
| 11 | #include <linux/socket.h> | ||
| 12 | |||
| 13 | /** | ||
| 14 | * enum ifla_caif - CAIF NetlinkRT parameters. | ||
| 15 | * @IFLA_CAIF_IPV4_CONNID: Connection ID for IPv4 PDP Context. | ||
| 16 | * The type of attribute is NLA_U32. | ||
| 17 | * @IFLA_CAIF_IPV6_CONNID: Connection ID for IPv6 PDP Context. | ||
| 18 | * The type of attribute is NLA_U32. | ||
| 19 | * @IFLA_CAIF_LOOPBACK: If different from zero, device is doing loopback | ||
| 20 | * The type of attribute is NLA_U8. | ||
| 21 | * | ||
| 22 | * When using RT Netlink to create, destroy or configure a CAIF IP interface, | ||
| 23 | * enum ifla_caif is used to specify the configuration attributes. | ||
| 24 | */ | ||
| 25 | enum ifla_caif { | ||
| 26 | __IFLA_CAIF_UNSPEC, | ||
| 27 | IFLA_CAIF_IPV4_CONNID, | ||
| 28 | IFLA_CAIF_IPV6_CONNID, | ||
| 29 | IFLA_CAIF_LOOPBACK, | ||
| 30 | __IFLA_CAIF_MAX | ||
| 31 | }; | ||
| 32 | #define IFLA_CAIF_MAX (__IFLA_CAIF_MAX-1) | ||
| 33 | |||
| 34 | #endif /*IF_CAIF_H_*/ | ||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * linux/can.h | ||
| 3 | * | ||
| 4 | * Definitions for CAN network layer (socket addr / CAN frame / CAN filter) | ||
| 5 | * | ||
| 6 | * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Urs Thuermann <urs.thuermann@volkswagen.de> | ||
| 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
| 9 | * All rights reserved. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef CAN_H | ||
| 14 | #define CAN_H | ||
| 15 | |||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/socket.h> | ||
| 18 | |||
| 19 | /* controller area network (CAN) kernel definitions */ | ||
| 20 | |||
| 21 | /* special address description flags for the CAN_ID */ | ||
| 22 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ | ||
| 23 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ | ||
| 24 | #define CAN_ERR_FLAG 0x20000000U /* error message frame */ | ||
| 25 | |||
| 26 | /* valid bits in CAN ID for frame formats */ | ||
| 27 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ | ||
| 28 | #define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */ | ||
| 29 | #define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */ | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Controller Area Network Identifier structure | ||
| 33 | * | ||
| 34 | * bit 0-28 : CAN identifier (11/29 bit) | ||
| 35 | * bit 29 : error message frame flag (0 = data frame, 1 = error message) | ||
| 36 | * bit 30 : remote transmission request flag (1 = rtr frame) | ||
| 37 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) | ||
| 38 | */ | ||
| 39 | typedef __u32 canid_t; | ||
| 40 | |||
| 41 | #define CAN_SFF_ID_BITS 11 | ||
| 42 | #define CAN_EFF_ID_BITS 29 | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Controller Area Network Error Message Frame Mask structure | ||
| 46 | * | ||
| 47 | * bit 0-28 : error class mask (see include/linux/can/error.h) | ||
| 48 | * bit 29-31 : set to zero | ||
| 49 | */ | ||
| 50 | typedef __u32 can_err_mask_t; | ||
| 51 | |||
| 52 | /* CAN payload length and DLC definitions according to ISO 11898-1 */ | ||
| 53 | #define CAN_MAX_DLC 8 | ||
| 54 | #define CAN_MAX_DLEN 8 | ||
| 55 | |||
| 56 | /* CAN FD payload length and DLC definitions according to ISO 11898-7 */ | ||
| 57 | #define CANFD_MAX_DLC 15 | ||
| 58 | #define CANFD_MAX_DLEN 64 | ||
| 59 | |||
| 60 | /** | ||
| 61 | * struct can_frame - basic CAN frame structure | ||
| 62 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition | ||
| 63 | * @can_dlc: frame payload length in byte (0 .. 8) aka data length code | ||
| 64 | * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1 | ||
| 65 | * mapping of the 'data length code' to the real payload length | ||
| 66 | * @data: CAN frame payload (up to 8 byte) | ||
| 67 | */ | ||
| 68 | struct can_frame { | ||
| 69 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | ||
| 70 | __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ | ||
| 71 | __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8))); | ||
| 72 | }; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * defined bits for canfd_frame.flags | ||
| 76 | * | ||
| 77 | * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to | ||
| 78 | * be set in the CAN frame bitstream on the wire. The EDL bit switch turns | ||
| 79 | * the CAN controllers bitstream processor into the CAN FD mode which creates | ||
| 80 | * two new options within the CAN FD frame specification: | ||
| 81 | * | ||
| 82 | * Bit Rate Switch - to indicate a second bitrate is/was used for the payload | ||
| 83 | * Error State Indicator - represents the error state of the transmitting node | ||
| 84 | * | ||
| 85 | * As the CANFD_ESI bit is internally generated by the transmitting CAN | ||
| 86 | * controller only the CANFD_BRS bit is relevant for real CAN controllers when | ||
| 87 | * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make | ||
| 88 | * sense for virtual CAN interfaces to test applications with echoed frames. | ||
| 89 | */ | ||
| 90 | #define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */ | ||
| 91 | #define CANFD_ESI 0x02 /* error state indicator of the transmitting node */ | ||
| 92 | |||
| 93 | /** | ||
| 94 | * struct canfd_frame - CAN flexible data rate frame structure | ||
| 95 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition | ||
| 96 | * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN) | ||
| 97 | * @flags: additional flags for CAN FD | ||
| 98 | * @__res0: reserved / padding | ||
| 99 | * @__res1: reserved / padding | ||
| 100 | * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte) | ||
| 101 | */ | ||
| 102 | struct canfd_frame { | ||
| 103 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | ||
| 104 | __u8 len; /* frame payload length in byte */ | ||
| 105 | __u8 flags; /* additional flags for CAN FD */ | ||
| 106 | __u8 __res0; /* reserved / padding */ | ||
| 107 | __u8 __res1; /* reserved / padding */ | ||
| 108 | __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8))); | ||
| 109 | }; | ||
| 110 | |||
| 111 | #define CAN_MTU (sizeof(struct can_frame)) | ||
| 112 | #define CANFD_MTU (sizeof(struct canfd_frame)) | ||
| 113 | |||
| 114 | /* particular protocols of the protocol family PF_CAN */ | ||
| 115 | #define CAN_RAW 1 /* RAW sockets */ | ||
| 116 | #define CAN_BCM 2 /* Broadcast Manager */ | ||
| 117 | #define CAN_TP16 3 /* VAG Transport Protocol v1.6 */ | ||
| 118 | #define CAN_TP20 4 /* VAG Transport Protocol v2.0 */ | ||
| 119 | #define CAN_MCNET 5 /* Bosch MCNet */ | ||
| 120 | #define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */ | ||
| 121 | #define CAN_NPROTO 7 | ||
| 122 | |||
| 123 | #define SOL_CAN_BASE 100 | ||
| 124 | |||
| 125 | /** | ||
| 126 | * struct sockaddr_can - the sockaddr structure for CAN sockets | ||
| 127 | * @can_family: address family number AF_CAN. | ||
| 128 | * @can_ifindex: CAN network interface index. | ||
| 129 | * @can_addr: protocol specific address information | ||
| 130 | */ | ||
| 131 | struct sockaddr_can { | ||
| 132 | __kernel_sa_family_t can_family; | ||
| 133 | int can_ifindex; | ||
| 134 | union { | ||
| 135 | /* transport protocol class address information (e.g. ISOTP) */ | ||
| 136 | struct { canid_t rx_id, tx_id; } tp; | ||
| 137 | |||
| 138 | /* reserved for future CAN protocols address information */ | ||
| 139 | } can_addr; | ||
| 140 | }; | ||
| 141 | |||
| 142 | /** | ||
| 143 | * struct can_filter - CAN ID based filter in can_register(). | ||
| 144 | * @can_id: relevant bits of CAN ID which are not masked out. | ||
| 145 | * @can_mask: CAN mask (see description) | ||
| 146 | * | ||
| 147 | * Description: | ||
| 148 | * A filter matches, when | ||
| 149 | * | ||
| 150 | * <received_can_id> & mask == can_id & mask | ||
| 151 | * | ||
| 152 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can | ||
| 153 | * filter for error message frames (CAN_ERR_FLAG bit set in mask). | ||
| 154 | */ | ||
| 155 | struct can_filter { | ||
| 156 | canid_t can_id; | ||
| 157 | canid_t can_mask; | ||
| 158 | }; | ||
| 159 | |||
| 160 | #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ | ||
| 161 | |||
| 162 | #endif /* CAN_H */ | ||
| @@ -0,0 +1,6 @@ | |||
| 1 | # UAPI Header export list | ||
| 2 | header-y += bcm.h | ||
| 3 | header-y += error.h | ||
| 4 | header-y += gw.h | ||
| 5 | header-y += netlink.h | ||
| 6 | header-y += raw.h | ||
| @@ -0,0 +1,66 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/bcm.h | ||
| 3 | * | ||
| 4 | * Definitions for CAN Broadcast Manager (BCM) | ||
| 5 | * | ||
| 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef CAN_BCM_H | ||
| 13 | #define CAN_BCM_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/can.h> | ||
| 17 | |||
| 18 | /** | ||
| 19 | * struct bcm_msg_head - head of messages to/from the broadcast manager | ||
| 20 | * @opcode: opcode, see enum below. | ||
| 21 | * @flags: special flags, see below. | ||
| 22 | * @count: number of frames to send before changing interval. | ||
| 23 | * @ival1: interval for the first @count frames. | ||
| 24 | * @ival2: interval for the following frames. | ||
| 25 | * @can_id: CAN ID of frames to be sent or received. | ||
| 26 | * @nframes: number of frames appended to the message head. | ||
| 27 | * @frames: array of CAN frames. | ||
| 28 | */ | ||
| 29 | struct bcm_msg_head { | ||
| 30 | __u32 opcode; | ||
| 31 | __u32 flags; | ||
| 32 | __u32 count; | ||
| 33 | struct timeval ival1, ival2; | ||
| 34 | canid_t can_id; | ||
| 35 | __u32 nframes; | ||
| 36 | struct can_frame frames[0]; | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum { | ||
| 40 | TX_SETUP = 1, /* create (cyclic) transmission task */ | ||
| 41 | TX_DELETE, /* remove (cyclic) transmission task */ | ||
| 42 | TX_READ, /* read properties of (cyclic) transmission task */ | ||
| 43 | TX_SEND, /* send one CAN frame */ | ||
| 44 | RX_SETUP, /* create RX content filter subscription */ | ||
| 45 | RX_DELETE, /* remove RX content filter subscription */ | ||
| 46 | RX_READ, /* read properties of RX content filter subscription */ | ||
| 47 | TX_STATUS, /* reply to TX_READ request */ | ||
| 48 | TX_EXPIRED, /* notification on performed transmissions (count=0) */ | ||
| 49 | RX_STATUS, /* reply to RX_READ request */ | ||
| 50 | RX_TIMEOUT, /* cyclic message is absent */ | ||
| 51 | RX_CHANGED /* updated CAN frame (detected content change) */ | ||
| 52 | }; | ||
| 53 | |||
| 54 | #define SETTIMER 0x0001 | ||
| 55 | #define STARTTIMER 0x0002 | ||
| 56 | #define TX_COUNTEVT 0x0004 | ||
| 57 | #define TX_ANNOUNCE 0x0008 | ||
| 58 | #define TX_CP_CAN_ID 0x0010 | ||
| 59 | #define RX_FILTER_ID 0x0020 | ||
| 60 | #define RX_CHECK_DLC 0x0040 | ||
| 61 | #define RX_NO_AUTOTIMER 0x0080 | ||
| 62 | #define RX_ANNOUNCE_RESUME 0x0100 | ||
| 63 | #define TX_RESET_MULTI_IDX 0x0200 | ||
| 64 | #define RX_RTR_FRAME 0x0400 | ||
| 65 | |||
| 66 | #endif /* CAN_BCM_H */ | ||
| @@ -0,0 +1,91 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/error.h | ||
| 3 | * | ||
| 4 | * Definitions of the CAN error messages to be filtered and passed to the user. | ||
| 5 | * | ||
| 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef CAN_ERROR_H | ||
| 13 | #define CAN_ERROR_H | ||
| 14 | |||
| 15 | #define CAN_ERR_DLC 8 /* dlc for error message frames */ | ||
| 16 | |||
| 17 | /* error class (mask) in can_id */ | ||
| 18 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ | ||
| 19 | #define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */ | ||
| 20 | #define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */ | ||
| 21 | #define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */ | ||
| 22 | #define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */ | ||
| 23 | #define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */ | ||
| 24 | #define CAN_ERR_BUSOFF 0x00000040U /* bus off */ | ||
| 25 | #define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */ | ||
| 26 | #define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */ | ||
| 27 | |||
| 28 | /* arbitration lost in bit ... / data[0] */ | ||
| 29 | #define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */ | ||
| 30 | /* else bit number in bitstream */ | ||
| 31 | |||
| 32 | /* error status of CAN-controller / data[1] */ | ||
| 33 | #define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */ | ||
| 34 | #define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */ | ||
| 35 | #define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */ | ||
| 36 | #define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */ | ||
| 37 | #define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */ | ||
| 38 | #define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */ | ||
| 39 | #define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */ | ||
| 40 | /* (at least one error counter exceeds */ | ||
| 41 | /* the protocol-defined level of 127) */ | ||
| 42 | |||
| 43 | /* error in CAN protocol (type) / data[2] */ | ||
| 44 | #define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */ | ||
| 45 | #define CAN_ERR_PROT_BIT 0x01 /* single bit error */ | ||
| 46 | #define CAN_ERR_PROT_FORM 0x02 /* frame format error */ | ||
| 47 | #define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */ | ||
| 48 | #define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */ | ||
| 49 | #define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */ | ||
| 50 | #define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */ | ||
| 51 | #define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */ | ||
| 52 | #define CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */ | ||
| 53 | |||
| 54 | /* error in CAN protocol (location) / data[3] */ | ||
| 55 | #define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */ | ||
| 56 | #define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */ | ||
| 57 | #define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */ | ||
| 58 | #define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/ | ||
| 59 | #define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */ | ||
| 60 | #define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */ | ||
| 61 | #define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */ | ||
| 62 | #define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */ | ||
| 63 | #define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */ | ||
| 64 | #define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */ | ||
| 65 | #define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */ | ||
| 66 | #define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */ | ||
| 67 | #define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */ | ||
| 68 | #define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */ | ||
| 69 | #define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */ | ||
| 70 | #define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */ | ||
| 71 | #define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */ | ||
| 72 | #define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */ | ||
| 73 | #define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */ | ||
| 74 | #define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */ | ||
| 75 | |||
| 76 | /* error status of CAN-transceiver / data[4] */ | ||
| 77 | /* CANH CANL */ | ||
| 78 | #define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */ | ||
| 79 | #define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */ | ||
| 80 | #define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */ | ||
| 81 | #define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */ | ||
| 82 | #define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */ | ||
| 83 | #define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */ | ||
| 84 | #define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */ | ||
| 85 | #define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */ | ||
| 86 | #define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ | ||
| 87 | #define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ | ||
| 88 | |||
| 89 | /* controller specific additional information / data[5..7] */ | ||
| 90 | |||
| 91 | #endif /* CAN_ERROR_H */ | ||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/gw.h | ||
| 3 | * | ||
| 4 | * Definitions for CAN frame Gateway/Router/Bridge | ||
| 5 | * | ||
| 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Copyright (c) 2011 Volkswagen Group Electronic Research | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef CAN_GW_H | ||
| 13 | #define CAN_GW_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/can.h> | ||
| 17 | |||
| 18 | struct rtcanmsg { | ||
| 19 | __u8 can_family; | ||
| 20 | __u8 gwtype; | ||
| 21 | __u16 flags; | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* CAN gateway types */ | ||
| 25 | enum { | ||
| 26 | CGW_TYPE_UNSPEC, | ||
| 27 | CGW_TYPE_CAN_CAN, /* CAN->CAN routing */ | ||
| 28 | __CGW_TYPE_MAX | ||
| 29 | }; | ||
| 30 | |||
| 31 | #define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1) | ||
| 32 | |||
| 33 | /* CAN rtnetlink attribute definitions */ | ||
| 34 | enum { | ||
| 35 | CGW_UNSPEC, | ||
| 36 | CGW_MOD_AND, /* CAN frame modification binary AND */ | ||
| 37 | CGW_MOD_OR, /* CAN frame modification binary OR */ | ||
| 38 | CGW_MOD_XOR, /* CAN frame modification binary XOR */ | ||
| 39 | CGW_MOD_SET, /* CAN frame modification set alternate values */ | ||
| 40 | CGW_CS_XOR, /* set data[] XOR checksum into data[index] */ | ||
| 41 | CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */ | ||
| 42 | CGW_HANDLED, /* number of handled CAN frames */ | ||
| 43 | CGW_DROPPED, /* number of dropped CAN frames */ | ||
| 44 | CGW_SRC_IF, /* ifindex of source network interface */ | ||
| 45 | CGW_DST_IF, /* ifindex of destination network interface */ | ||
| 46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ | ||
| 47 | __CGW_MAX | ||
| 48 | }; | ||
| 49 | |||
| 50 | #define CGW_MAX (__CGW_MAX - 1) | ||
| 51 | |||
| 52 | #define CGW_FLAGS_CAN_ECHO 0x01 | ||
| 53 | #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 | ||
| 54 | |||
| 55 | #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ | ||
| 56 | |||
| 57 | /* CAN frame elements that are affected by curr. 3 CAN frame modifications */ | ||
| 58 | #define CGW_MOD_ID 0x01 | ||
| 59 | #define CGW_MOD_DLC 0x02 | ||
| 60 | #define CGW_MOD_DATA 0x04 | ||
| 61 | |||
| 62 | #define CGW_FRAME_MODS 3 /* ID DLC DATA */ | ||
| 63 | |||
| 64 | #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS) | ||
| 65 | |||
| 66 | struct cgw_frame_mod { | ||
| 67 | struct can_frame cf; | ||
| 68 | __u8 modtype; | ||
| 69 | } __attribute__((packed)); | ||
| 70 | |||
| 71 | #define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod) | ||
| 72 | |||
| 73 | struct cgw_csum_xor { | ||
| 74 | __s8 from_idx; | ||
| 75 | __s8 to_idx; | ||
| 76 | __s8 result_idx; | ||
| 77 | __u8 init_xor_val; | ||
| 78 | } __attribute__((packed)); | ||
| 79 | |||
| 80 | struct cgw_csum_crc8 { | ||
| 81 | __s8 from_idx; | ||
| 82 | __s8 to_idx; | ||
| 83 | __s8 result_idx; | ||
| 84 | __u8 init_crc_val; | ||
| 85 | __u8 final_xor_val; | ||
| 86 | __u8 crctab[256]; | ||
| 87 | __u8 profile; | ||
| 88 | __u8 profile_data[20]; | ||
| 89 | } __attribute__((packed)); | ||
| 90 | |||
| 91 | /* length of checksum operation parameters. idx = index in CAN frame data[] */ | ||
| 92 | #define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor) | ||
| 93 | #define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8) | ||
| 94 | |||
| 95 | /* CRC8 profiles (compute CRC for additional data elements - see below) */ | ||
| 96 | enum { | ||
| 97 | CGW_CRC8PRF_UNSPEC, | ||
| 98 | CGW_CRC8PRF_1U8, /* compute one additional u8 value */ | ||
| 99 | CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */ | ||
| 100 | CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */ | ||
| 101 | __CGW_CRC8PRF_MAX | ||
| 102 | }; | ||
| 103 | |||
| 104 | #define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1) | ||
| 105 | |||
| 106 | /* | ||
| 107 | * CAN rtnetlink attribute contents in detail | ||
| 108 | * | ||
| 109 | * CGW_XXX_IF (length 4 bytes): | ||
| 110 | * Sets an interface index for source/destination network interfaces. | ||
| 111 | * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory. | ||
| 112 | * | ||
| 113 | * CGW_FILTER (length 8 bytes): | ||
| 114 | * Sets a CAN receive filter for the gateway job specified by the | ||
| 115 | * struct can_filter described in include/linux/can.h | ||
| 116 | * | ||
| 117 | * CGW_MOD_XXX (length 17 bytes): | ||
| 118 | * Specifies a modification that's done to a received CAN frame before it is | ||
| 119 | * send out to the destination interface. | ||
| 120 | * | ||
| 121 | * <struct can_frame> data used as operator | ||
| 122 | * <u8> affected CAN frame elements | ||
| 123 | * | ||
| 124 | * CGW_CS_XOR (length 4 bytes): | ||
| 125 | * Set a simple XOR checksum starting with an initial value into | ||
| 126 | * data[result-idx] using data[start-idx] .. data[end-idx] | ||
| 127 | * | ||
| 128 | * The XOR checksum is calculated like this: | ||
| 129 | * | ||
| 130 | * xor = init_xor_val | ||
| 131 | * | ||
| 132 | * for (i = from_idx .. to_idx) | ||
| 133 | * xor ^= can_frame.data[i] | ||
| 134 | * | ||
| 135 | * can_frame.data[ result_idx ] = xor | ||
| 136 | * | ||
| 137 | * CGW_CS_CRC8 (length 282 bytes): | ||
| 138 | * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table, | ||
| 139 | * a given initial value and a defined input data[start-idx] .. data[end-idx]. | ||
| 140 | * Finally the result value is XOR'ed with the final_xor_val. | ||
| 141 | * | ||
| 142 | * The CRC8 checksum is calculated like this: | ||
| 143 | * | ||
| 144 | * crc = init_crc_val | ||
| 145 | * | ||
| 146 | * for (i = from_idx .. to_idx) | ||
| 147 | * crc = crctab[ crc ^ can_frame.data[i] ] | ||
| 148 | * | ||
| 149 | * can_frame.data[ result_idx ] = crc ^ final_xor_val | ||
| 150 | * | ||
| 151 | * The calculated CRC may contain additional source data elements that can be | ||
| 152 | * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs | ||
| 153 | * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf | ||
| 154 | * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs) | ||
| 155 | * that are used depending on counter values inside the CAN frame data[]. | ||
| 156 | * So far only three profiles have been implemented for illustration. | ||
| 157 | * | ||
| 158 | * Remark: In general the attribute data is a linear buffer. | ||
| 159 | * Beware of sending unpacked or aligned structs! | ||
| 160 | */ | ||
| 161 | |||
| 162 | #endif | ||
| @@ -0,0 +1,122 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/netlink.h | ||
| 3 | * | ||
| 4 | * Definitions for the CAN netlink interface | ||
| 5 | * | ||
| 6 | * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef CAN_NETLINK_H | ||
| 11 | #define CAN_NETLINK_H | ||
| 12 | |||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * CAN bit-timing parameters | ||
| 17 | * | ||
| 18 | * For further information, please read chapter "8 BIT TIMING | ||
| 19 | * REQUIREMENTS" of the "Bosch CAN Specification version 2.0" | ||
| 20 | * at http://www.semiconductors.bosch.de/pdf/can2spec.pdf. | ||
| 21 | */ | ||
| 22 | struct can_bittiming { | ||
| 23 | __u32 bitrate; /* Bit-rate in bits/second */ | ||
| 24 | __u32 sample_point; /* Sample point in one-tenth of a percent */ | ||
| 25 | __u32 tq; /* Time quanta (TQ) in nanoseconds */ | ||
| 26 | __u32 prop_seg; /* Propagation segment in TQs */ | ||
| 27 | __u32 phase_seg1; /* Phase buffer segment 1 in TQs */ | ||
| 28 | __u32 phase_seg2; /* Phase buffer segment 2 in TQs */ | ||
| 29 | __u32 sjw; /* Synchronisation jump width in TQs */ | ||
| 30 | __u32 brp; /* Bit-rate prescaler */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | /* | ||
| 34 | * CAN harware-dependent bit-timing constant | ||
| 35 | * | ||
| 36 | * Used for calculating and checking bit-timing parameters | ||
| 37 | */ | ||
| 38 | struct can_bittiming_const { | ||
| 39 | char name[16]; /* Name of the CAN controller hardware */ | ||
| 40 | __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */ | ||
| 41 | __u32 tseg1_max; | ||
| 42 | __u32 tseg2_min; /* Time segement 2 = phase_seg2 */ | ||
| 43 | __u32 tseg2_max; | ||
| 44 | __u32 sjw_max; /* Synchronisation jump width */ | ||
| 45 | __u32 brp_min; /* Bit-rate prescaler */ | ||
| 46 | __u32 brp_max; | ||
| 47 | __u32 brp_inc; | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* | ||
| 51 | * CAN clock parameters | ||
| 52 | */ | ||
| 53 | struct can_clock { | ||
| 54 | __u32 freq; /* CAN system clock frequency in Hz */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* | ||
| 58 | * CAN operational and error states | ||
| 59 | */ | ||
| 60 | enum can_state { | ||
| 61 | CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */ | ||
| 62 | CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */ | ||
| 63 | CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */ | ||
| 64 | CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */ | ||
| 65 | CAN_STATE_STOPPED, /* Device is stopped */ | ||
| 66 | CAN_STATE_SLEEPING, /* Device is sleeping */ | ||
| 67 | CAN_STATE_MAX | ||
| 68 | }; | ||
| 69 | |||
| 70 | /* | ||
| 71 | * CAN bus error counters | ||
| 72 | */ | ||
| 73 | struct can_berr_counter { | ||
| 74 | __u16 txerr; | ||
| 75 | __u16 rxerr; | ||
| 76 | }; | ||
| 77 | |||
| 78 | /* | ||
| 79 | * CAN controller mode | ||
| 80 | */ | ||
| 81 | struct can_ctrlmode { | ||
| 82 | __u32 mask; | ||
| 83 | __u32 flags; | ||
| 84 | }; | ||
| 85 | |||
| 86 | #define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */ | ||
| 87 | #define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */ | ||
| 88 | #define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */ | ||
| 89 | #define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */ | ||
| 90 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ | ||
| 91 | |||
| 92 | /* | ||
| 93 | * CAN device statistics | ||
| 94 | */ | ||
| 95 | struct can_device_stats { | ||
| 96 | __u32 bus_error; /* Bus errors */ | ||
| 97 | __u32 error_warning; /* Changes to error warning state */ | ||
| 98 | __u32 error_passive; /* Changes to error passive state */ | ||
| 99 | __u32 bus_off; /* Changes to bus off state */ | ||
| 100 | __u32 arbitration_lost; /* Arbitration lost errors */ | ||
| 101 | __u32 restarts; /* CAN controller re-starts */ | ||
| 102 | }; | ||
| 103 | |||
| 104 | /* | ||
| 105 | * CAN netlink interface | ||
| 106 | */ | ||
| 107 | enum { | ||
| 108 | IFLA_CAN_UNSPEC, | ||
| 109 | IFLA_CAN_BITTIMING, | ||
| 110 | IFLA_CAN_BITTIMING_CONST, | ||
| 111 | IFLA_CAN_CLOCK, | ||
| 112 | IFLA_CAN_STATE, | ||
| 113 | IFLA_CAN_CTRLMODE, | ||
| 114 | IFLA_CAN_RESTART_MS, | ||
| 115 | IFLA_CAN_RESTART, | ||
| 116 | IFLA_CAN_BERR_COUNTER, | ||
| 117 | __IFLA_CAN_MAX | ||
| 118 | }; | ||
| 119 | |||
| 120 | #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1) | ||
| 121 | |||
| 122 | #endif /* CAN_NETLINK_H */ | ||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/raw.h | ||
| 3 | * | ||
| 4 | * Definitions for raw CAN sockets | ||
| 5 | * | ||
| 6 | * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Urs Thuermann <urs.thuermann@volkswagen.de> | ||
| 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | ||
| 9 | * All rights reserved. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef CAN_RAW_H | ||
| 14 | #define CAN_RAW_H | ||
| 15 | |||
| 16 | #include <linux/can.h> | ||
| 17 | |||
| 18 | #define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW) | ||
| 19 | |||
| 20 | /* for socket options affecting the socket (not the global system) */ | ||
| 21 | |||
| 22 | enum { | ||
| 23 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ | ||
| 24 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ | ||
| 25 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ | ||
| 26 | CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */ | ||
| 27 | CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */ | ||
| 28 | }; | ||
| 29 | |||
| 30 | #endif | ||
| @@ -0,0 +1,358 @@ | |||
| 1 | /* | ||
| 2 | * This is <linux/capability.h> | ||
| 3 | * | ||
| 4 | * Andrew G. Morgan <morgan@kernel.org> | ||
| 5 | * Alexander Kjeldaas <astor@guardian.no> | ||
| 6 | * with help from Aleph1, Roland Buresund and Andrew Main. | ||
| 7 | * | ||
| 8 | * See here for the libcap library ("POSIX draft" compliance): | ||
| 9 | * | ||
| 10 | * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _UAPI_LINUX_CAPABILITY_H | ||
| 14 | #define _UAPI_LINUX_CAPABILITY_H | ||
| 15 | |||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | struct task_struct; | ||
| 19 | |||
| 20 | /* User-level do most of the mapping between kernel and user | ||
| 21 | capabilities based on the version tag given by the kernel. The | ||
| 22 | kernel might be somewhat backwards compatible, but don't bet on | ||
| 23 | it. */ | ||
| 24 | |||
| 25 | /* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to | ||
| 26 | a set of three capability sets. The transposition of 3*the | ||
| 27 | following structure to such a composite is better handled in a user | ||
| 28 | library since the draft standard requires the use of malloc/free | ||
| 29 | etc.. */ | ||
| 30 | |||
| 31 | #define _LINUX_CAPABILITY_VERSION_1 0x19980330 | ||
| 32 | #define _LINUX_CAPABILITY_U32S_1 1 | ||
| 33 | |||
| 34 | #define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */ | ||
| 35 | #define _LINUX_CAPABILITY_U32S_2 2 | ||
| 36 | |||
| 37 | #define _LINUX_CAPABILITY_VERSION_3 0x20080522 | ||
| 38 | #define _LINUX_CAPABILITY_U32S_3 2 | ||
| 39 | |||
| 40 | typedef struct __user_cap_header_struct { | ||
| 41 | __u32 version; | ||
| 42 | int pid; | ||
| 43 | } __user *cap_user_header_t; | ||
| 44 | |||
| 45 | typedef struct __user_cap_data_struct { | ||
| 46 | __u32 effective; | ||
| 47 | __u32 permitted; | ||
| 48 | __u32 inheritable; | ||
| 49 | } __user *cap_user_data_t; | ||
| 50 | |||
| 51 | |||
| 52 | #define VFS_CAP_REVISION_MASK 0xFF000000 | ||
| 53 | #define VFS_CAP_REVISION_SHIFT 24 | ||
| 54 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | ||
| 55 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | ||
| 56 | |||
| 57 | #define VFS_CAP_REVISION_1 0x01000000 | ||
| 58 | #define VFS_CAP_U32_1 1 | ||
| 59 | #define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1)) | ||
| 60 | |||
| 61 | #define VFS_CAP_REVISION_2 0x02000000 | ||
| 62 | #define VFS_CAP_U32_2 2 | ||
| 63 | #define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2)) | ||
| 64 | |||
| 65 | #define XATTR_CAPS_SZ XATTR_CAPS_SZ_2 | ||
| 66 | #define VFS_CAP_U32 VFS_CAP_U32_2 | ||
| 67 | #define VFS_CAP_REVISION VFS_CAP_REVISION_2 | ||
| 68 | |||
| 69 | struct vfs_cap_data { | ||
| 70 | __le32 magic_etc; /* Little endian */ | ||
| 71 | struct { | ||
| 72 | __le32 permitted; /* Little endian */ | ||
| 73 | __le32 inheritable; /* Little endian */ | ||
| 74 | } data[VFS_CAP_U32]; | ||
| 75 | }; | ||
| 76 | |||
| 77 | #ifndef __KERNEL__ | ||
| 78 | |||
| 79 | /* | ||
| 80 | * Backwardly compatible definition for source code - trapped in a | ||
| 81 | * 32-bit world. If you find you need this, please consider using | ||
| 82 | * libcap to untrap yourself... | ||
| 83 | */ | ||
| 84 | #define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1 | ||
| 85 | #define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1 | ||
| 86 | |||
| 87 | #endif | ||
| 88 | |||
| 89 | |||
| 90 | /** | ||
| 91 | ** POSIX-draft defined capabilities. | ||
| 92 | **/ | ||
| 93 | |||
| 94 | /* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this | ||
| 95 | overrides the restriction of changing file ownership and group | ||
| 96 | ownership. */ | ||
| 97 | |||
| 98 | #define CAP_CHOWN 0 | ||
| 99 | |||
| 100 | /* Override all DAC access, including ACL execute access if | ||
| 101 | [_POSIX_ACL] is defined. Excluding DAC access covered by | ||
| 102 | CAP_LINUX_IMMUTABLE. */ | ||
| 103 | |||
| 104 | #define CAP_DAC_OVERRIDE 1 | ||
| 105 | |||
| 106 | /* Overrides all DAC restrictions regarding read and search on files | ||
| 107 | and directories, including ACL restrictions if [_POSIX_ACL] is | ||
| 108 | defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */ | ||
| 109 | |||
| 110 | #define CAP_DAC_READ_SEARCH 2 | ||
| 111 | |||
| 112 | /* Overrides all restrictions about allowed operations on files, where | ||
| 113 | file owner ID must be equal to the user ID, except where CAP_FSETID | ||
| 114 | is applicable. It doesn't override MAC and DAC restrictions. */ | ||
| 115 | |||
| 116 | #define CAP_FOWNER 3 | ||
| 117 | |||
| 118 | /* Overrides the following restrictions that the effective user ID | ||
| 119 | shall match the file owner ID when setting the S_ISUID and S_ISGID | ||
| 120 | bits on that file; that the effective group ID (or one of the | ||
| 121 | supplementary group IDs) shall match the file owner ID when setting | ||
| 122 | the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are | ||
| 123 | cleared on successful return from chown(2) (not implemented). */ | ||
| 124 | |||
| 125 | #define CAP_FSETID 4 | ||
| 126 | |||
| 127 | /* Overrides the restriction that the real or effective user ID of a | ||
| 128 | process sending a signal must match the real or effective user ID | ||
| 129 | of the process receiving the signal. */ | ||
| 130 | |||
| 131 | #define CAP_KILL 5 | ||
| 132 | |||
| 133 | /* Allows setgid(2) manipulation */ | ||
| 134 | /* Allows setgroups(2) */ | ||
| 135 | /* Allows forged gids on socket credentials passing. */ | ||
| 136 | |||
| 137 | #define CAP_SETGID 6 | ||
| 138 | |||
| 139 | /* Allows set*uid(2) manipulation (including fsuid). */ | ||
| 140 | /* Allows forged pids on socket credentials passing. */ | ||
| 141 | |||
| 142 | #define CAP_SETUID 7 | ||
| 143 | |||
| 144 | |||
| 145 | /** | ||
| 146 | ** Linux-specific capabilities | ||
| 147 | **/ | ||
| 148 | |||
| 149 | /* Without VFS support for capabilities: | ||
| 150 | * Transfer any capability in your permitted set to any pid, | ||
| 151 | * remove any capability in your permitted set from any pid | ||
| 152 | * With VFS support for capabilities (neither of above, but) | ||
| 153 | * Add any capability from current's capability bounding set | ||
| 154 | * to the current process' inheritable set | ||
| 155 | * Allow taking bits out of capability bounding set | ||
| 156 | * Allow modification of the securebits for a process | ||
| 157 | */ | ||
| 158 | |||
| 159 | #define CAP_SETPCAP 8 | ||
| 160 | |||
| 161 | /* Allow modification of S_IMMUTABLE and S_APPEND file attributes */ | ||
| 162 | |||
| 163 | #define CAP_LINUX_IMMUTABLE 9 | ||
| 164 | |||
| 165 | /* Allows binding to TCP/UDP sockets below 1024 */ | ||
| 166 | /* Allows binding to ATM VCIs below 32 */ | ||
| 167 | |||
| 168 | #define CAP_NET_BIND_SERVICE 10 | ||
| 169 | |||
| 170 | /* Allow broadcasting, listen to multicast */ | ||
| 171 | |||
| 172 | #define CAP_NET_BROADCAST 11 | ||
| 173 | |||
| 174 | /* Allow interface configuration */ | ||
| 175 | /* Allow administration of IP firewall, masquerading and accounting */ | ||
| 176 | /* Allow setting debug option on sockets */ | ||
| 177 | /* Allow modification of routing tables */ | ||
| 178 | /* Allow setting arbitrary process / process group ownership on | ||
| 179 | sockets */ | ||
| 180 | /* Allow binding to any address for transparent proxying (also via NET_RAW) */ | ||
| 181 | /* Allow setting TOS (type of service) */ | ||
| 182 | /* Allow setting promiscuous mode */ | ||
| 183 | /* Allow clearing driver statistics */ | ||
| 184 | /* Allow multicasting */ | ||
| 185 | /* Allow read/write of device-specific registers */ | ||
| 186 | /* Allow activation of ATM control sockets */ | ||
| 187 | |||
| 188 | #define CAP_NET_ADMIN 12 | ||
| 189 | |||
| 190 | /* Allow use of RAW sockets */ | ||
| 191 | /* Allow use of PACKET sockets */ | ||
| 192 | /* Allow binding to any address for transparent proxying (also via NET_ADMIN) */ | ||
| 193 | |||
| 194 | #define CAP_NET_RAW 13 | ||
| 195 | |||
| 196 | /* Allow locking of shared memory segments */ | ||
| 197 | /* Allow mlock and mlockall (which doesn't really have anything to do | ||
| 198 | with IPC) */ | ||
| 199 | |||
| 200 | #define CAP_IPC_LOCK 14 | ||
| 201 | |||
| 202 | /* Override IPC ownership checks */ | ||
| 203 | |||
| 204 | #define CAP_IPC_OWNER 15 | ||
| 205 | |||
| 206 | /* Insert and remove kernel modules - modify kernel without limit */ | ||
| 207 | #define CAP_SYS_MODULE 16 | ||
| 208 | |||
| 209 | /* Allow ioperm/iopl access */ | ||
| 210 | /* Allow sending USB messages to any device via /proc/bus/usb */ | ||
| 211 | |||
| 212 | #define CAP_SYS_RAWIO 17 | ||
| 213 | |||
| 214 | /* Allow use of chroot() */ | ||
| 215 | |||
| 216 | #define CAP_SYS_CHROOT 18 | ||
| 217 | |||
| 218 | /* Allow ptrace() of any process */ | ||
| 219 | |||
| 220 | #define CAP_SYS_PTRACE 19 | ||
| 221 | |||
| 222 | /* Allow configuration of process accounting */ | ||
| 223 | |||
| 224 | #define CAP_SYS_PACCT 20 | ||
| 225 | |||
| 226 | /* Allow configuration of the secure attention key */ | ||
| 227 | /* Allow administration of the random device */ | ||
| 228 | /* Allow examination and configuration of disk quotas */ | ||
| 229 | /* Allow setting the domainname */ | ||
| 230 | /* Allow setting the hostname */ | ||
| 231 | /* Allow calling bdflush() */ | ||
| 232 | /* Allow mount() and umount(), setting up new smb connection */ | ||
| 233 | /* Allow some autofs root ioctls */ | ||
| 234 | /* Allow nfsservctl */ | ||
| 235 | /* Allow VM86_REQUEST_IRQ */ | ||
| 236 | /* Allow to read/write pci config on alpha */ | ||
| 237 | /* Allow irix_prctl on mips (setstacksize) */ | ||
| 238 | /* Allow flushing all cache on m68k (sys_cacheflush) */ | ||
| 239 | /* Allow removing semaphores */ | ||
| 240 | /* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores | ||
| 241 | and shared memory */ | ||
| 242 | /* Allow locking/unlocking of shared memory segment */ | ||
| 243 | /* Allow turning swap on/off */ | ||
| 244 | /* Allow forged pids on socket credentials passing */ | ||
| 245 | /* Allow setting readahead and flushing buffers on block devices */ | ||
| 246 | /* Allow setting geometry in floppy driver */ | ||
| 247 | /* Allow turning DMA on/off in xd driver */ | ||
| 248 | /* Allow administration of md devices (mostly the above, but some | ||
| 249 | extra ioctls) */ | ||
| 250 | /* Allow tuning the ide driver */ | ||
| 251 | /* Allow access to the nvram device */ | ||
| 252 | /* Allow administration of apm_bios, serial and bttv (TV) device */ | ||
| 253 | /* Allow manufacturer commands in isdn CAPI support driver */ | ||
| 254 | /* Allow reading non-standardized portions of pci configuration space */ | ||
| 255 | /* Allow DDI debug ioctl on sbpcd driver */ | ||
| 256 | /* Allow setting up serial ports */ | ||
| 257 | /* Allow sending raw qic-117 commands */ | ||
| 258 | /* Allow enabling/disabling tagged queuing on SCSI controllers and sending | ||
| 259 | arbitrary SCSI commands */ | ||
| 260 | /* Allow setting encryption key on loopback filesystem */ | ||
| 261 | /* Allow setting zone reclaim policy */ | ||
| 262 | |||
| 263 | #define CAP_SYS_ADMIN 21 | ||
| 264 | |||
| 265 | /* Allow use of reboot() */ | ||
| 266 | |||
| 267 | #define CAP_SYS_BOOT 22 | ||
| 268 | |||
| 269 | /* Allow raising priority and setting priority on other (different | ||
| 270 | UID) processes */ | ||
| 271 | /* Allow use of FIFO and round-robin (realtime) scheduling on own | ||
| 272 | processes and setting the scheduling algorithm used by another | ||
| 273 | process. */ | ||
| 274 | /* Allow setting cpu affinity on other processes */ | ||
| 275 | |||
| 276 | #define CAP_SYS_NICE 23 | ||
| 277 | |||
| 278 | /* Override resource limits. Set resource limits. */ | ||
| 279 | /* Override quota limits. */ | ||
| 280 | /* Override reserved space on ext2 filesystem */ | ||
| 281 | /* Modify data journaling mode on ext3 filesystem (uses journaling | ||
| 282 | resources) */ | ||
| 283 | /* NOTE: ext2 honors fsuid when checking for resource overrides, so | ||
| 284 | you can override using fsuid too */ | ||
| 285 | /* Override size restrictions on IPC message queues */ | ||
| 286 | /* Allow more than 64hz interrupts from the real-time clock */ | ||
| 287 | /* Override max number of consoles on console allocation */ | ||
| 288 | /* Override max number of keymaps */ | ||
| 289 | |||
| 290 | #define CAP_SYS_RESOURCE 24 | ||
| 291 | |||
| 292 | /* Allow manipulation of system clock */ | ||
| 293 | /* Allow irix_stime on mips */ | ||
| 294 | /* Allow setting the real-time clock */ | ||
| 295 | |||
| 296 | #define CAP_SYS_TIME 25 | ||
| 297 | |||
| 298 | /* Allow configuration of tty devices */ | ||
| 299 | /* Allow vhangup() of tty */ | ||
| 300 | |||
| 301 | #define CAP_SYS_TTY_CONFIG 26 | ||
| 302 | |||
| 303 | /* Allow the privileged aspects of mknod() */ | ||
| 304 | |||
| 305 | #define CAP_MKNOD 27 | ||
| 306 | |||
| 307 | /* Allow taking of leases on files */ | ||
| 308 | |||
| 309 | #define CAP_LEASE 28 | ||
| 310 | |||
| 311 | #define CAP_AUDIT_WRITE 29 | ||
| 312 | |||
| 313 | #define CAP_AUDIT_CONTROL 30 | ||
| 314 | |||
| 315 | #define CAP_SETFCAP 31 | ||
| 316 | |||
| 317 | /* Override MAC access. | ||
| 318 | The base kernel enforces no MAC policy. | ||
| 319 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
| 320 | to implement capability based overrides of that policy, this is | ||
| 321 | the capability it should use to do so. */ | ||
| 322 | |||
| 323 | #define CAP_MAC_OVERRIDE 32 | ||
| 324 | |||
| 325 | /* Allow MAC configuration or state changes. | ||
| 326 | The base kernel requires no MAC configuration. | ||
| 327 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
| 328 | to implement capability based checks on modifications to that | ||
| 329 | policy or the data required to maintain it, this is the | ||
| 330 | capability it should use to do so. */ | ||
| 331 | |||
| 332 | #define CAP_MAC_ADMIN 33 | ||
| 333 | |||
| 334 | /* Allow configuring the kernel's syslog (printk behaviour) */ | ||
| 335 | |||
| 336 | #define CAP_SYSLOG 34 | ||
| 337 | |||
| 338 | /* Allow triggering something that will wake the system */ | ||
| 339 | |||
| 340 | #define CAP_WAKE_ALARM 35 | ||
| 341 | |||
| 342 | /* Allow preventing system suspends */ | ||
| 343 | |||
| 344 | #define CAP_BLOCK_SUSPEND 36 | ||
| 345 | |||
| 346 | #define CAP_LAST_CAP CAP_BLOCK_SUSPEND | ||
| 347 | |||
| 348 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | ||
| 349 | |||
| 350 | /* | ||
| 351 | * Bit location of each capability (used by user-space library and kernel) | ||
| 352 | */ | ||
| 353 | |||
| 354 | #define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */ | ||
| 355 | #define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */ | ||
| 356 | |||
| 357 | |||
| 358 | #endif /* _UAPI_LINUX_CAPABILITY_H */ | ||
| @@ -0,0 +1,133 @@ | |||
| 1 | /* $Id: capi.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $ | ||
| 2 | * | ||
| 3 | * CAPI 2.0 Interface for Linux | ||
| 4 | * | ||
| 5 | * Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) | ||
| 6 | * | ||
| 7 | * This software may be used and distributed according to the terms | ||
| 8 | * of the GNU General Public License, incorporated herein by reference. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_CAPI_H__ | ||
| 13 | #define __LINUX_CAPI_H__ | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/ioctl.h> | ||
| 17 | #ifndef __KERNEL__ | ||
| 18 | #include <linux/kernelcapi.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | /* | ||
| 22 | * CAPI_REGISTER | ||
| 23 | */ | ||
| 24 | |||
| 25 | typedef struct capi_register_params { /* CAPI_REGISTER */ | ||
| 26 | __u32 level3cnt; /* No. of simulatneous user data connections */ | ||
| 27 | __u32 datablkcnt; /* No. of buffered data messages */ | ||
| 28 | __u32 datablklen; /* Size of buffered data messages */ | ||
| 29 | } capi_register_params; | ||
| 30 | |||
| 31 | #define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params) | ||
| 32 | |||
| 33 | /* | ||
| 34 | * CAPI_GET_MANUFACTURER | ||
| 35 | */ | ||
| 36 | |||
| 37 | #define CAPI_MANUFACTURER_LEN 64 | ||
| 38 | |||
| 39 | #define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int) /* broken: wanted size 64 (CAPI_MANUFACTURER_LEN) */ | ||
| 40 | |||
| 41 | /* | ||
| 42 | * CAPI_GET_VERSION | ||
| 43 | */ | ||
| 44 | |||
| 45 | typedef struct capi_version { | ||
| 46 | __u32 majorversion; | ||
| 47 | __u32 minorversion; | ||
| 48 | __u32 majormanuversion; | ||
| 49 | __u32 minormanuversion; | ||
| 50 | } capi_version; | ||
| 51 | |||
| 52 | #define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version) | ||
| 53 | |||
| 54 | /* | ||
| 55 | * CAPI_GET_SERIAL | ||
| 56 | */ | ||
| 57 | |||
| 58 | #define CAPI_SERIAL_LEN 8 | ||
| 59 | #define CAPI_GET_SERIAL _IOWR('C',0x08,int) /* broken: wanted size 8 (CAPI_SERIAL_LEN) */ | ||
| 60 | |||
| 61 | /* | ||
| 62 | * CAPI_GET_PROFILE | ||
| 63 | */ | ||
| 64 | |||
| 65 | typedef struct capi_profile { | ||
| 66 | __u16 ncontroller; /* number of installed controller */ | ||
| 67 | __u16 nbchannel; /* number of B-Channels */ | ||
| 68 | __u32 goptions; /* global options */ | ||
| 69 | __u32 support1; /* B1 protocols support */ | ||
| 70 | __u32 support2; /* B2 protocols support */ | ||
| 71 | __u32 support3; /* B3 protocols support */ | ||
| 72 | __u32 reserved[6]; /* reserved */ | ||
| 73 | __u32 manu[5]; /* manufacturer specific information */ | ||
| 74 | } capi_profile; | ||
| 75 | |||
| 76 | #define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile) | ||
| 77 | |||
| 78 | typedef struct capi_manufacturer_cmd { | ||
| 79 | unsigned long cmd; | ||
| 80 | void __user *data; | ||
| 81 | } capi_manufacturer_cmd; | ||
| 82 | |||
| 83 | /* | ||
| 84 | * CAPI_MANUFACTURER_CMD | ||
| 85 | */ | ||
| 86 | |||
| 87 | #define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd) | ||
| 88 | |||
| 89 | /* | ||
| 90 | * CAPI_GET_ERRCODE | ||
| 91 | * capi errcode is set, * if read, write, or ioctl returns EIO, | ||
| 92 | * ioctl returns errcode directly, and in arg, if != 0 | ||
| 93 | */ | ||
| 94 | |||
| 95 | #define CAPI_GET_ERRCODE _IOR('C',0x21, __u16) | ||
| 96 | |||
| 97 | /* | ||
| 98 | * CAPI_INSTALLED | ||
| 99 | */ | ||
| 100 | #define CAPI_INSTALLED _IOR('C',0x22, __u16) | ||
| 101 | |||
| 102 | |||
| 103 | /* | ||
| 104 | * member contr is input for | ||
| 105 | * CAPI_GET_MANUFACTURER, CAPI_VERSION, CAPI_GET_SERIAL | ||
| 106 | * and CAPI_GET_PROFILE | ||
| 107 | */ | ||
| 108 | typedef union capi_ioctl_struct { | ||
| 109 | __u32 contr; | ||
| 110 | capi_register_params rparams; | ||
| 111 | __u8 manufacturer[CAPI_MANUFACTURER_LEN]; | ||
| 112 | capi_version version; | ||
| 113 | __u8 serial[CAPI_SERIAL_LEN]; | ||
| 114 | capi_profile profile; | ||
| 115 | capi_manufacturer_cmd cmd; | ||
| 116 | __u16 errcode; | ||
| 117 | } capi_ioctl_struct; | ||
| 118 | |||
| 119 | /* | ||
| 120 | * Middleware extension | ||
| 121 | */ | ||
| 122 | |||
| 123 | #define CAPIFLAG_HIGHJACKING 0x0001 | ||
| 124 | |||
| 125 | #define CAPI_GET_FLAGS _IOR('C',0x23, unsigned) | ||
| 126 | #define CAPI_SET_FLAGS _IOR('C',0x24, unsigned) | ||
| 127 | #define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned) | ||
| 128 | |||
| 129 | #define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned) | ||
| 130 | |||
| 131 | #define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned) | ||
| 132 | |||
| 133 | #endif /* __LINUX_CAPI_H__ */ | ||
| @@ -0,0 +1,130 @@ | |||
| 1 | #ifndef CCISS_DEFS_H | ||
| 2 | #define CCISS_DEFS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* general boundary definitions */ | ||
| 7 | #define SENSEINFOBYTES 32 /* note that this value may vary | ||
| 8 | between host implementations */ | ||
| 9 | |||
| 10 | /* Command Status value */ | ||
| 11 | #define CMD_SUCCESS 0x0000 | ||
| 12 | #define CMD_TARGET_STATUS 0x0001 | ||
| 13 | #define CMD_DATA_UNDERRUN 0x0002 | ||
| 14 | #define CMD_DATA_OVERRUN 0x0003 | ||
| 15 | #define CMD_INVALID 0x0004 | ||
| 16 | #define CMD_PROTOCOL_ERR 0x0005 | ||
| 17 | #define CMD_HARDWARE_ERR 0x0006 | ||
| 18 | #define CMD_CONNECTION_LOST 0x0007 | ||
| 19 | #define CMD_ABORTED 0x0008 | ||
| 20 | #define CMD_ABORT_FAILED 0x0009 | ||
| 21 | #define CMD_UNSOLICITED_ABORT 0x000A | ||
| 22 | #define CMD_TIMEOUT 0x000B | ||
| 23 | #define CMD_UNABORTABLE 0x000C | ||
| 24 | |||
| 25 | /* transfer direction */ | ||
| 26 | #define XFER_NONE 0x00 | ||
| 27 | #define XFER_WRITE 0x01 | ||
| 28 | #define XFER_READ 0x02 | ||
| 29 | #define XFER_RSVD 0x03 | ||
| 30 | |||
| 31 | /* task attribute */ | ||
| 32 | #define ATTR_UNTAGGED 0x00 | ||
| 33 | #define ATTR_SIMPLE 0x04 | ||
| 34 | #define ATTR_HEADOFQUEUE 0x05 | ||
| 35 | #define ATTR_ORDERED 0x06 | ||
| 36 | #define ATTR_ACA 0x07 | ||
| 37 | |||
| 38 | /* cdb type */ | ||
| 39 | #define TYPE_CMD 0x00 | ||
| 40 | #define TYPE_MSG 0x01 | ||
| 41 | |||
| 42 | /* Type defs used in the following structs */ | ||
| 43 | #define BYTE __u8 | ||
| 44 | #define WORD __u16 | ||
| 45 | #define HWORD __u16 | ||
| 46 | #define DWORD __u32 | ||
| 47 | |||
| 48 | #define CISS_MAX_LUN 1024 | ||
| 49 | |||
| 50 | #define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */ | ||
| 51 | #define LEVEL3LUN 0 | ||
| 52 | |||
| 53 | #pragma pack(1) | ||
| 54 | |||
| 55 | /* Command List Structure */ | ||
| 56 | typedef union _SCSI3Addr_struct { | ||
| 57 | struct { | ||
| 58 | BYTE Dev; | ||
| 59 | BYTE Bus:6; | ||
| 60 | BYTE Mode:2; /* b00 */ | ||
| 61 | } PeripDev; | ||
| 62 | struct { | ||
| 63 | BYTE DevLSB; | ||
| 64 | BYTE DevMSB:6; | ||
| 65 | BYTE Mode:2; /* b01 */ | ||
| 66 | } LogDev; | ||
| 67 | struct { | ||
| 68 | BYTE Dev:5; | ||
| 69 | BYTE Bus:3; | ||
| 70 | BYTE Targ:6; | ||
| 71 | BYTE Mode:2; /* b10 */ | ||
| 72 | } LogUnit; | ||
| 73 | } SCSI3Addr_struct; | ||
| 74 | |||
| 75 | typedef struct _PhysDevAddr_struct { | ||
| 76 | DWORD TargetId:24; | ||
| 77 | DWORD Bus:6; | ||
| 78 | DWORD Mode:2; | ||
| 79 | SCSI3Addr_struct Target[2]; /* 2 level target device addr */ | ||
| 80 | } PhysDevAddr_struct; | ||
| 81 | |||
| 82 | typedef struct _LogDevAddr_struct { | ||
| 83 | DWORD VolId:30; | ||
| 84 | DWORD Mode:2; | ||
| 85 | BYTE reserved[4]; | ||
| 86 | } LogDevAddr_struct; | ||
| 87 | |||
| 88 | typedef union _LUNAddr_struct { | ||
| 89 | BYTE LunAddrBytes[8]; | ||
| 90 | SCSI3Addr_struct SCSI3Lun[4]; | ||
| 91 | PhysDevAddr_struct PhysDev; | ||
| 92 | LogDevAddr_struct LogDev; | ||
| 93 | } LUNAddr_struct; | ||
| 94 | |||
| 95 | typedef struct _RequestBlock_struct { | ||
| 96 | BYTE CDBLen; | ||
| 97 | struct { | ||
| 98 | BYTE Type:3; | ||
| 99 | BYTE Attribute:3; | ||
| 100 | BYTE Direction:2; | ||
| 101 | } Type; | ||
| 102 | HWORD Timeout; | ||
| 103 | BYTE CDB[16]; | ||
| 104 | } RequestBlock_struct; | ||
| 105 | |||
| 106 | typedef union _MoreErrInfo_struct{ | ||
| 107 | struct { | ||
| 108 | BYTE Reserved[3]; | ||
| 109 | BYTE Type; | ||
| 110 | DWORD ErrorInfo; | ||
| 111 | } Common_Info; | ||
| 112 | struct{ | ||
| 113 | BYTE Reserved[2]; | ||
| 114 | BYTE offense_size; /* size of offending entry */ | ||
| 115 | BYTE offense_num; /* byte # of offense 0-base */ | ||
| 116 | DWORD offense_value; | ||
| 117 | } Invalid_Cmd; | ||
| 118 | } MoreErrInfo_struct; | ||
| 119 | typedef struct _ErrorInfo_struct { | ||
| 120 | BYTE ScsiStatus; | ||
| 121 | BYTE SenseLen; | ||
| 122 | HWORD CommandStatus; | ||
| 123 | DWORD ResidualCnt; | ||
| 124 | MoreErrInfo_struct MoreErrInfo; | ||
| 125 | BYTE SenseInfo[SENSEINFOBYTES]; | ||
| 126 | } ErrorInfo_struct; | ||
| 127 | |||
| 128 | #pragma pack() | ||
| 129 | |||
| 130 | #endif /* CCISS_DEFS_H */ | ||
| @@ -0,0 +1,88 @@ | |||
| 1 | #ifndef _UAPICCISS_IOCTLH | ||
| 2 | #define _UAPICCISS_IOCTLH | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/ioctl.h> | ||
| 6 | #include <linux/cciss_defs.h> | ||
| 7 | |||
| 8 | #define CCISS_IOC_MAGIC 'B' | ||
| 9 | |||
| 10 | |||
| 11 | typedef struct _cciss_pci_info_struct | ||
| 12 | { | ||
| 13 | unsigned char bus; | ||
| 14 | unsigned char dev_fn; | ||
| 15 | unsigned short domain; | ||
| 16 | __u32 board_id; | ||
| 17 | } cciss_pci_info_struct; | ||
| 18 | |||
| 19 | typedef struct _cciss_coalint_struct | ||
| 20 | { | ||
| 21 | __u32 delay; | ||
| 22 | __u32 count; | ||
| 23 | } cciss_coalint_struct; | ||
| 24 | |||
| 25 | typedef char NodeName_type[16]; | ||
| 26 | |||
| 27 | typedef __u32 Heartbeat_type; | ||
| 28 | |||
| 29 | #define CISS_PARSCSIU2 0x0001 | ||
| 30 | #define CISS_PARCSCIU3 0x0002 | ||
| 31 | #define CISS_FIBRE1G 0x0100 | ||
| 32 | #define CISS_FIBRE2G 0x0200 | ||
| 33 | typedef __u32 BusTypes_type; | ||
| 34 | |||
| 35 | typedef char FirmwareVer_type[4]; | ||
| 36 | typedef __u32 DriverVer_type; | ||
| 37 | |||
| 38 | #define MAX_KMALLOC_SIZE 128000 | ||
| 39 | |||
| 40 | typedef struct _IOCTL_Command_struct { | ||
| 41 | LUNAddr_struct LUN_info; | ||
| 42 | RequestBlock_struct Request; | ||
| 43 | ErrorInfo_struct error_info; | ||
| 44 | WORD buf_size; /* size in bytes of the buf */ | ||
| 45 | BYTE __user *buf; | ||
| 46 | } IOCTL_Command_struct; | ||
| 47 | |||
| 48 | typedef struct _BIG_IOCTL_Command_struct { | ||
| 49 | LUNAddr_struct LUN_info; | ||
| 50 | RequestBlock_struct Request; | ||
| 51 | ErrorInfo_struct error_info; | ||
| 52 | DWORD malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */ | ||
| 53 | DWORD buf_size; /* size in bytes of the buf */ | ||
| 54 | /* < malloc_size * MAXSGENTRIES */ | ||
| 55 | BYTE __user *buf; | ||
| 56 | } BIG_IOCTL_Command_struct; | ||
| 57 | |||
| 58 | typedef struct _LogvolInfo_struct{ | ||
| 59 | __u32 LunID; | ||
| 60 | int num_opens; /* number of opens on the logical volume */ | ||
| 61 | int num_parts; /* number of partitions configured on logvol */ | ||
| 62 | } LogvolInfo_struct; | ||
| 63 | |||
| 64 | #define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct) | ||
| 65 | |||
| 66 | #define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct) | ||
| 67 | #define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct) | ||
| 68 | |||
| 69 | #define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type) | ||
| 70 | #define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type) | ||
| 71 | |||
| 72 | #define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type) | ||
| 73 | #define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type) | ||
| 74 | #define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type) | ||
| 75 | #define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type) | ||
| 76 | #define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10) | ||
| 77 | #define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct) | ||
| 78 | #define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12) | ||
| 79 | |||
| 80 | /* no longer used... use REGNEWD instead */ | ||
| 81 | #define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int) | ||
| 82 | |||
| 83 | #define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14) | ||
| 84 | #define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16) | ||
| 85 | #define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct) | ||
| 86 | #define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct) | ||
| 87 | |||
| 88 | #endif /* _UAPICCISS_IOCTLH */ | ||
| @@ -0,0 +1,912 @@ | |||
| 1 | /* | ||
| 2 | * -- <linux/cdrom.h> | ||
| 3 | * General header file for linux CD-ROM drivers | ||
| 4 | * Copyright (C) 1992 David Giller, rafetmad@oxy.edu | ||
| 5 | * 1994, 1995 Eberhard Mönkeberg, emoenke@gwdg.de | ||
| 6 | * 1996 David van Leeuwen, david@tm.tno.nl | ||
| 7 | * 1997, 1998 Erik Andersen, andersee@debian.org | ||
| 8 | * 1998-2002 Jens Axboe, axboe@suse.de | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef _UAPI_LINUX_CDROM_H | ||
| 12 | #define _UAPI_LINUX_CDROM_H | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <asm/byteorder.h> | ||
| 16 | |||
| 17 | /******************************************************* | ||
| 18 | * As of Linux 2.1.x, all Linux CD-ROM application programs will use this | ||
| 19 | * (and only this) include file. It is my hope to provide Linux with | ||
| 20 | * a uniform interface between software accessing CD-ROMs and the various | ||
| 21 | * device drivers that actually talk to the drives. There may still be | ||
| 22 | * 23 different kinds of strange CD-ROM drives, but at least there will | ||
| 23 | * now be one, and only one, Linux CD-ROM interface. | ||
| 24 | * | ||
| 25 | * Additionally, as of Linux 2.1.x, all Linux application programs | ||
| 26 | * should use the O_NONBLOCK option when opening a CD-ROM device | ||
| 27 | * for subsequent ioctl commands. This allows for neat system errors | ||
| 28 | * like "No medium found" or "Wrong medium type" upon attempting to | ||
| 29 | * mount or play an empty slot, mount an audio disc, or play a data disc. | ||
| 30 | * Generally, changing an application program to support O_NONBLOCK | ||
| 31 | * is as easy as the following: | ||
| 32 | * - drive = open("/dev/cdrom", O_RDONLY); | ||
| 33 | * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK); | ||
| 34 | * It is worth the small change. | ||
| 35 | * | ||
| 36 | * Patches for many common CD programs (provided by David A. van Leeuwen) | ||
| 37 | * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/ | ||
| 38 | * | ||
| 39 | *******************************************************/ | ||
| 40 | |||
| 41 | /* When a driver supports a certain function, but the cdrom drive we are | ||
| 42 | * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will | ||
| 43 | * borrow the "Operation not supported" error from the network folks to | ||
| 44 | * accomplish this. Maybe someday we will get a more targeted error code, | ||
| 45 | * but this will do for now... */ | ||
| 46 | #define EDRIVE_CANT_DO_THIS EOPNOTSUPP | ||
| 47 | |||
| 48 | /******************************************************* | ||
| 49 | * The CD-ROM IOCTL commands -- these should be supported by | ||
| 50 | * all the various cdrom drivers. For the CD-ROM ioctls, we | ||
| 51 | * will commandeer byte 0x53, or 'S'. | ||
| 52 | *******************************************************/ | ||
| 53 | #define CDROMPAUSE 0x5301 /* Pause Audio Operation */ | ||
| 54 | #define CDROMRESUME 0x5302 /* Resume paused Audio Operation */ | ||
| 55 | #define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */ | ||
| 56 | #define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index | ||
| 57 | (struct cdrom_ti) */ | ||
| 58 | #define CDROMREADTOCHDR 0x5305 /* Read TOC header | ||
| 59 | (struct cdrom_tochdr) */ | ||
| 60 | #define CDROMREADTOCENTRY 0x5306 /* Read TOC entry | ||
| 61 | (struct cdrom_tocentry) */ | ||
| 62 | #define CDROMSTOP 0x5307 /* Stop the cdrom drive */ | ||
| 63 | #define CDROMSTART 0x5308 /* Start the cdrom drive */ | ||
| 64 | #define CDROMEJECT 0x5309 /* Ejects the cdrom media */ | ||
| 65 | #define CDROMVOLCTRL 0x530a /* Control output volume | ||
| 66 | (struct cdrom_volctrl) */ | ||
| 67 | #define CDROMSUBCHNL 0x530b /* Read subchannel data | ||
| 68 | (struct cdrom_subchnl) */ | ||
| 69 | #define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes) | ||
| 70 | (struct cdrom_read) */ | ||
| 71 | #define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes) | ||
| 72 | (struct cdrom_read) */ | ||
| 73 | #define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */ | ||
| 74 | #define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */ | ||
| 75 | #define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session | ||
| 76 | address of multi session disks | ||
| 77 | (struct cdrom_multisession) */ | ||
| 78 | #define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code" | ||
| 79 | if available (struct cdrom_mcn) */ | ||
| 80 | #define CDROM_GET_UPC CDROM_GET_MCN /* This one is deprecated, | ||
| 81 | but here anyway for compatibility */ | ||
| 82 | #define CDROMRESET 0x5312 /* hard-reset the drive */ | ||
| 83 | #define CDROMVOLREAD 0x5313 /* Get the drive's volume setting | ||
| 84 | (struct cdrom_volctrl) */ | ||
| 85 | #define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes) | ||
| 86 | (struct cdrom_read) */ | ||
| 87 | /* | ||
| 88 | * These ioctls are used only used in aztcd.c and optcd.c | ||
| 89 | */ | ||
| 90 | #define CDROMREADCOOKED 0x5315 /* read data in cooked mode */ | ||
| 91 | #define CDROMSEEK 0x5316 /* seek msf address */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | * This ioctl is only used by the scsi-cd driver. | ||
| 95 | It is for playing audio in logical block addressing mode. | ||
| 96 | */ | ||
| 97 | #define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */ | ||
| 98 | |||
| 99 | /* | ||
| 100 | * These ioctls are only used in optcd.c | ||
| 101 | */ | ||
| 102 | #define CDROMREADALL 0x5318 /* read all 2646 bytes */ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * These ioctls are (now) only in ide-cd.c for controlling | ||
| 106 | * drive spindown time. They should be implemented in the | ||
| 107 | * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10, | ||
| 108 | * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE... | ||
| 109 | * -Erik | ||
| 110 | */ | ||
| 111 | #define CDROMGETSPINDOWN 0x531d | ||
| 112 | #define CDROMSETSPINDOWN 0x531e | ||
| 113 | |||
| 114 | /* | ||
| 115 | * These ioctls are implemented through the uniform CD-ROM driver | ||
| 116 | * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM | ||
| 117 | * drivers are eventually ported to the uniform CD-ROM driver interface. | ||
| 118 | */ | ||
| 119 | #define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ | ||
| 120 | #define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */ | ||
| 121 | #define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */ | ||
| 122 | #define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */ | ||
| 123 | #define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */ | ||
| 124 | #define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */ | ||
| 125 | #define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ | ||
| 126 | #define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */ | ||
| 127 | #define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */ | ||
| 128 | #define CDROM_LOCKDOOR 0x5329 /* lock or unlock door */ | ||
| 129 | #define CDROM_DEBUG 0x5330 /* Turn debug messages on/off */ | ||
| 130 | #define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ | ||
| 131 | |||
| 132 | /* Note that scsi/scsi_ioctl.h also uses 0x5382 - 0x5386. | ||
| 133 | * Future CDROM ioctls should be kept below 0x537F | ||
| 134 | */ | ||
| 135 | |||
| 136 | /* This ioctl is only used by sbpcd at the moment */ | ||
| 137 | #define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */ | ||
| 138 | /* conflict with SCSI_IOCTL_GET_IDLUN */ | ||
| 139 | |||
| 140 | /* DVD-ROM Specific ioctls */ | ||
| 141 | #define DVD_READ_STRUCT 0x5390 /* Read structure */ | ||
| 142 | #define DVD_WRITE_STRUCT 0x5391 /* Write structure */ | ||
| 143 | #define DVD_AUTH 0x5392 /* Authentication */ | ||
| 144 | |||
| 145 | #define CDROM_SEND_PACKET 0x5393 /* send a packet to the drive */ | ||
| 146 | #define CDROM_NEXT_WRITABLE 0x5394 /* get next writable block */ | ||
| 147 | #define CDROM_LAST_WRITTEN 0x5395 /* get last block written on disc */ | ||
| 148 | |||
| 149 | /******************************************************* | ||
| 150 | * CDROM IOCTL structures | ||
| 151 | *******************************************************/ | ||
| 152 | |||
| 153 | /* Address in MSF format */ | ||
| 154 | struct cdrom_msf0 | ||
| 155 | { | ||
| 156 | __u8 minute; | ||
| 157 | __u8 second; | ||
| 158 | __u8 frame; | ||
| 159 | }; | ||
| 160 | |||
| 161 | /* Address in either MSF or logical format */ | ||
| 162 | union cdrom_addr | ||
| 163 | { | ||
| 164 | struct cdrom_msf0 msf; | ||
| 165 | int lba; | ||
| 166 | }; | ||
| 167 | |||
| 168 | /* This struct is used by the CDROMPLAYMSF ioctl */ | ||
| 169 | struct cdrom_msf | ||
| 170 | { | ||
| 171 | __u8 cdmsf_min0; /* start minute */ | ||
| 172 | __u8 cdmsf_sec0; /* start second */ | ||
| 173 | __u8 cdmsf_frame0; /* start frame */ | ||
| 174 | __u8 cdmsf_min1; /* end minute */ | ||
| 175 | __u8 cdmsf_sec1; /* end second */ | ||
| 176 | __u8 cdmsf_frame1; /* end frame */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* This struct is used by the CDROMPLAYTRKIND ioctl */ | ||
| 180 | struct cdrom_ti | ||
| 181 | { | ||
| 182 | __u8 cdti_trk0; /* start track */ | ||
| 183 | __u8 cdti_ind0; /* start index */ | ||
| 184 | __u8 cdti_trk1; /* end track */ | ||
| 185 | __u8 cdti_ind1; /* end index */ | ||
| 186 | }; | ||
| 187 | |||
| 188 | /* This struct is used by the CDROMREADTOCHDR ioctl */ | ||
| 189 | struct cdrom_tochdr | ||
| 190 | { | ||
| 191 | __u8 cdth_trk0; /* start track */ | ||
| 192 | __u8 cdth_trk1; /* end track */ | ||
| 193 | }; | ||
| 194 | |||
| 195 | /* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */ | ||
| 196 | struct cdrom_volctrl | ||
| 197 | { | ||
| 198 | __u8 channel0; | ||
| 199 | __u8 channel1; | ||
| 200 | __u8 channel2; | ||
| 201 | __u8 channel3; | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* This struct is used by the CDROMSUBCHNL ioctl */ | ||
| 205 | struct cdrom_subchnl | ||
| 206 | { | ||
| 207 | __u8 cdsc_format; | ||
| 208 | __u8 cdsc_audiostatus; | ||
| 209 | __u8 cdsc_adr: 4; | ||
| 210 | __u8 cdsc_ctrl: 4; | ||
| 211 | __u8 cdsc_trk; | ||
| 212 | __u8 cdsc_ind; | ||
| 213 | union cdrom_addr cdsc_absaddr; | ||
| 214 | union cdrom_addr cdsc_reladdr; | ||
| 215 | }; | ||
| 216 | |||
| 217 | |||
| 218 | /* This struct is used by the CDROMREADTOCENTRY ioctl */ | ||
| 219 | struct cdrom_tocentry | ||
| 220 | { | ||
| 221 | __u8 cdte_track; | ||
| 222 | __u8 cdte_adr :4; | ||
| 223 | __u8 cdte_ctrl :4; | ||
| 224 | __u8 cdte_format; | ||
| 225 | union cdrom_addr cdte_addr; | ||
| 226 | __u8 cdte_datamode; | ||
| 227 | }; | ||
| 228 | |||
| 229 | /* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */ | ||
| 230 | struct cdrom_read | ||
| 231 | { | ||
| 232 | int cdread_lba; | ||
| 233 | char *cdread_bufaddr; | ||
| 234 | int cdread_buflen; | ||
| 235 | }; | ||
| 236 | |||
| 237 | /* This struct is used by the CDROMREADAUDIO ioctl */ | ||
| 238 | struct cdrom_read_audio | ||
| 239 | { | ||
| 240 | union cdrom_addr addr; /* frame address */ | ||
| 241 | __u8 addr_format; /* CDROM_LBA or CDROM_MSF */ | ||
| 242 | int nframes; /* number of 2352-byte-frames to read at once */ | ||
| 243 | __u8 __user *buf; /* frame buffer (size: nframes*2352 bytes) */ | ||
| 244 | }; | ||
| 245 | |||
| 246 | /* This struct is used with the CDROMMULTISESSION ioctl */ | ||
| 247 | struct cdrom_multisession | ||
| 248 | { | ||
| 249 | union cdrom_addr addr; /* frame address: start-of-last-session | ||
| 250 | (not the new "frame 16"!). Only valid | ||
| 251 | if the "xa_flag" is true. */ | ||
| 252 | __u8 xa_flag; /* 1: "is XA disk" */ | ||
| 253 | __u8 addr_format; /* CDROM_LBA or CDROM_MSF */ | ||
| 254 | }; | ||
| 255 | |||
| 256 | /* This struct is used with the CDROM_GET_MCN ioctl. | ||
| 257 | * Very few audio discs actually have Universal Product Code information, | ||
| 258 | * which should just be the Medium Catalog Number on the box. Also note | ||
| 259 | * that the way the codeis written on CD is _not_ uniform across all discs! | ||
| 260 | */ | ||
| 261 | struct cdrom_mcn | ||
| 262 | { | ||
| 263 | __u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */ | ||
| 264 | }; | ||
| 265 | |||
| 266 | /* This is used by the CDROMPLAYBLK ioctl */ | ||
| 267 | struct cdrom_blk | ||
| 268 | { | ||
| 269 | unsigned from; | ||
| 270 | unsigned short len; | ||
| 271 | }; | ||
| 272 | |||
| 273 | #define CDROM_PACKET_SIZE 12 | ||
| 274 | |||
| 275 | #define CGC_DATA_UNKNOWN 0 | ||
| 276 | #define CGC_DATA_WRITE 1 | ||
| 277 | #define CGC_DATA_READ 2 | ||
| 278 | #define CGC_DATA_NONE 3 | ||
| 279 | |||
| 280 | /* for CDROM_PACKET_COMMAND ioctl */ | ||
| 281 | struct cdrom_generic_command | ||
| 282 | { | ||
| 283 | unsigned char cmd[CDROM_PACKET_SIZE]; | ||
| 284 | unsigned char __user *buffer; | ||
| 285 | unsigned int buflen; | ||
| 286 | int stat; | ||
| 287 | struct request_sense __user *sense; | ||
| 288 | unsigned char data_direction; | ||
| 289 | int quiet; | ||
| 290 | int timeout; | ||
| 291 | void __user *reserved[1]; /* unused, actually */ | ||
| 292 | }; | ||
| 293 | |||
| 294 | /* | ||
| 295 | * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, | ||
| 296 | * 2340, or 2352 bytes long. | ||
| 297 | |||
| 298 | * Sector types of the standard CD-ROM data formats: | ||
| 299 | * | ||
| 300 | * format sector type user data size (bytes) | ||
| 301 | * ----------------------------------------------------------------------------- | ||
| 302 | * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW) | ||
| 303 | * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE) | ||
| 304 | * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0) | ||
| 305 | * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE) | ||
| 306 | * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes) | ||
| 307 | * | ||
| 308 | * | ||
| 309 | * The layout of the standard CD-ROM data formats: | ||
| 310 | * ----------------------------------------------------------------------------- | ||
| 311 | * - audio (red): | audio_sample_bytes | | ||
| 312 | * | 2352 | | ||
| 313 | * | ||
| 314 | * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC | | ||
| 315 | * | 12 - 4 - 2048 - 4 - 8 - 276 | | ||
| 316 | * | ||
| 317 | * - data (yellow, mode2): | sync - head - data | | ||
| 318 | * | 12 - 4 - 2336 | | ||
| 319 | * | ||
| 320 | * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC | | ||
| 321 | * | 12 - 4 - 8 - 2048 - 4 - 276 | | ||
| 322 | * | ||
| 323 | * - XA data (green, mode2 form2): | sync - head - sub - data - Spare | | ||
| 324 | * | 12 - 4 - 8 - 2324 - 4 | | ||
| 325 | * | ||
| 326 | */ | ||
| 327 | |||
| 328 | /* Some generally useful CD-ROM information -- mostly based on the above */ | ||
| 329 | #define CD_MINS 74 /* max. minutes per CD, not really a limit */ | ||
| 330 | #define CD_SECS 60 /* seconds per minute */ | ||
| 331 | #define CD_FRAMES 75 /* frames per second */ | ||
| 332 | #define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */ | ||
| 333 | #define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */ | ||
| 334 | #define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */ | ||
| 335 | #define CD_NUM_OF_CHUNKS 98 /* chunks per frame */ | ||
| 336 | #define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */ | ||
| 337 | #define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */ | ||
| 338 | #define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */ | ||
| 339 | #define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */ | ||
| 340 | #define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */ | ||
| 341 | #define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */ | ||
| 342 | #define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */ | ||
| 343 | #define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */ | ||
| 344 | #define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */ | ||
| 345 | /* most drives don't deliver everything: */ | ||
| 346 | #define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/ | ||
| 347 | #define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/ | ||
| 348 | |||
| 349 | #define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */ | ||
| 350 | #define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */ | ||
| 351 | #define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */ | ||
| 352 | |||
| 353 | /* CD-ROM address types (cdrom_tocentry.cdte_format) */ | ||
| 354 | #define CDROM_LBA 0x01 /* "logical block": first frame is #0 */ | ||
| 355 | #define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */ | ||
| 356 | |||
| 357 | /* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */ | ||
| 358 | #define CDROM_DATA_TRACK 0x04 | ||
| 359 | |||
| 360 | /* The leadout track is always 0xAA, regardless of # of tracks on disc */ | ||
| 361 | #define CDROM_LEADOUT 0xAA | ||
| 362 | |||
| 363 | /* audio states (from SCSI-2, but seen with other drives, too) */ | ||
| 364 | #define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */ | ||
| 365 | #define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */ | ||
| 366 | #define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */ | ||
| 367 | #define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */ | ||
| 368 | #define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */ | ||
| 369 | #define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */ | ||
| 370 | |||
| 371 | /* capability flags used with the uniform CD-ROM driver */ | ||
| 372 | #define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */ | ||
| 373 | #define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */ | ||
| 374 | #define CDC_LOCK 0x4 /* disable manual eject */ | ||
| 375 | #define CDC_SELECT_SPEED 0x8 /* programmable speed */ | ||
| 376 | #define CDC_SELECT_DISC 0x10 /* select disc from juke-box */ | ||
| 377 | #define CDC_MULTI_SESSION 0x20 /* read sessions>1 */ | ||
| 378 | #define CDC_MCN 0x40 /* Medium Catalog Number */ | ||
| 379 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ | ||
| 380 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ | ||
| 381 | #define CDC_RESET 0x200 /* hard reset device */ | ||
| 382 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ | ||
| 383 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ | ||
| 384 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ | ||
| 385 | #define CDC_CD_RW 0x4000 /* drive is a CD-RW */ | ||
| 386 | #define CDC_DVD 0x8000 /* drive is a DVD */ | ||
| 387 | #define CDC_DVD_R 0x10000 /* drive can write DVD-R */ | ||
| 388 | #define CDC_DVD_RAM 0x20000 /* drive can write DVD-RAM */ | ||
| 389 | #define CDC_MO_DRIVE 0x40000 /* drive is an MO device */ | ||
| 390 | #define CDC_MRW 0x80000 /* drive can read MRW */ | ||
| 391 | #define CDC_MRW_W 0x100000 /* drive can write MRW */ | ||
| 392 | #define CDC_RAM 0x200000 /* ok to open for WRITE */ | ||
| 393 | |||
| 394 | /* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */ | ||
| 395 | #define CDS_NO_INFO 0 /* if not implemented */ | ||
| 396 | #define CDS_NO_DISC 1 | ||
| 397 | #define CDS_TRAY_OPEN 2 | ||
| 398 | #define CDS_DRIVE_NOT_READY 3 | ||
| 399 | #define CDS_DISC_OK 4 | ||
| 400 | |||
| 401 | /* return values for the CDROM_DISC_STATUS ioctl */ | ||
| 402 | /* can also return CDS_NO_[INFO|DISC], from above */ | ||
| 403 | #define CDS_AUDIO 100 | ||
| 404 | #define CDS_DATA_1 101 | ||
| 405 | #define CDS_DATA_2 102 | ||
| 406 | #define CDS_XA_2_1 103 | ||
| 407 | #define CDS_XA_2_2 104 | ||
| 408 | #define CDS_MIXED 105 | ||
| 409 | |||
| 410 | /* User-configurable behavior options for the uniform CD-ROM driver */ | ||
| 411 | #define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */ | ||
| 412 | #define CDO_AUTO_EJECT 0x2 /* open tray on last release() */ | ||
| 413 | #define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */ | ||
| 414 | #define CDO_LOCK 0x8 /* lock tray on open files */ | ||
| 415 | #define CDO_CHECK_TYPE 0x10 /* check type on open for data */ | ||
| 416 | |||
| 417 | /* Special codes used when specifying changer slots. */ | ||
| 418 | #define CDSL_NONE (INT_MAX-1) | ||
| 419 | #define CDSL_CURRENT INT_MAX | ||
| 420 | |||
| 421 | /* For partition based multisession access. IDE can handle 64 partitions | ||
| 422 | * per drive - SCSI CD-ROM's use minors to differentiate between the | ||
| 423 | * various drives, so we can't do multisessions the same way there. | ||
| 424 | * Use the -o session=x option to mount on them. | ||
| 425 | */ | ||
| 426 | #define CD_PART_MAX 64 | ||
| 427 | #define CD_PART_MASK (CD_PART_MAX - 1) | ||
| 428 | |||
| 429 | /********************************************************************* | ||
| 430 | * Generic Packet commands, MMC commands, and such | ||
| 431 | *********************************************************************/ | ||
| 432 | |||
| 433 | /* The generic packet command opcodes for CD/DVD Logical Units, | ||
| 434 | * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */ | ||
| 435 | #define GPCMD_BLANK 0xa1 | ||
| 436 | #define GPCMD_CLOSE_TRACK 0x5b | ||
| 437 | #define GPCMD_FLUSH_CACHE 0x35 | ||
| 438 | #define GPCMD_FORMAT_UNIT 0x04 | ||
| 439 | #define GPCMD_GET_CONFIGURATION 0x46 | ||
| 440 | #define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a | ||
| 441 | #define GPCMD_GET_PERFORMANCE 0xac | ||
| 442 | #define GPCMD_INQUIRY 0x12 | ||
| 443 | #define GPCMD_LOAD_UNLOAD 0xa6 | ||
| 444 | #define GPCMD_MECHANISM_STATUS 0xbd | ||
| 445 | #define GPCMD_MODE_SELECT_10 0x55 | ||
| 446 | #define GPCMD_MODE_SENSE_10 0x5a | ||
| 447 | #define GPCMD_PAUSE_RESUME 0x4b | ||
| 448 | #define GPCMD_PLAY_AUDIO_10 0x45 | ||
| 449 | #define GPCMD_PLAY_AUDIO_MSF 0x47 | ||
| 450 | #define GPCMD_PLAY_AUDIO_TI 0x48 | ||
| 451 | #define GPCMD_PLAY_CD 0xbc | ||
| 452 | #define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e | ||
| 453 | #define GPCMD_READ_10 0x28 | ||
| 454 | #define GPCMD_READ_12 0xa8 | ||
| 455 | #define GPCMD_READ_BUFFER 0x3c | ||
| 456 | #define GPCMD_READ_BUFFER_CAPACITY 0x5c | ||
| 457 | #define GPCMD_READ_CDVD_CAPACITY 0x25 | ||
| 458 | #define GPCMD_READ_CD 0xbe | ||
| 459 | #define GPCMD_READ_CD_MSF 0xb9 | ||
| 460 | #define GPCMD_READ_DISC_INFO 0x51 | ||
| 461 | #define GPCMD_READ_DVD_STRUCTURE 0xad | ||
| 462 | #define GPCMD_READ_FORMAT_CAPACITIES 0x23 | ||
| 463 | #define GPCMD_READ_HEADER 0x44 | ||
| 464 | #define GPCMD_READ_TRACK_RZONE_INFO 0x52 | ||
| 465 | #define GPCMD_READ_SUBCHANNEL 0x42 | ||
| 466 | #define GPCMD_READ_TOC_PMA_ATIP 0x43 | ||
| 467 | #define GPCMD_REPAIR_RZONE_TRACK 0x58 | ||
| 468 | #define GPCMD_REPORT_KEY 0xa4 | ||
| 469 | #define GPCMD_REQUEST_SENSE 0x03 | ||
| 470 | #define GPCMD_RESERVE_RZONE_TRACK 0x53 | ||
| 471 | #define GPCMD_SEND_CUE_SHEET 0x5d | ||
| 472 | #define GPCMD_SCAN 0xba | ||
| 473 | #define GPCMD_SEEK 0x2b | ||
| 474 | #define GPCMD_SEND_DVD_STRUCTURE 0xbf | ||
| 475 | #define GPCMD_SEND_EVENT 0xa2 | ||
| 476 | #define GPCMD_SEND_KEY 0xa3 | ||
| 477 | #define GPCMD_SEND_OPC 0x54 | ||
| 478 | #define GPCMD_SET_READ_AHEAD 0xa7 | ||
| 479 | #define GPCMD_SET_STREAMING 0xb6 | ||
| 480 | #define GPCMD_START_STOP_UNIT 0x1b | ||
| 481 | #define GPCMD_STOP_PLAY_SCAN 0x4e | ||
| 482 | #define GPCMD_TEST_UNIT_READY 0x00 | ||
| 483 | #define GPCMD_VERIFY_10 0x2f | ||
| 484 | #define GPCMD_WRITE_10 0x2a | ||
| 485 | #define GPCMD_WRITE_12 0xaa | ||
| 486 | #define GPCMD_WRITE_AND_VERIFY_10 0x2e | ||
| 487 | #define GPCMD_WRITE_BUFFER 0x3b | ||
| 488 | /* This is listed as optional in ATAPI 2.6, but is (curiously) | ||
| 489 | * missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji | ||
| 490 | * Table 377 as an MMC command for SCSi devices though... Most ATAPI | ||
| 491 | * drives support it. */ | ||
| 492 | #define GPCMD_SET_SPEED 0xbb | ||
| 493 | /* This seems to be a SCSI specific CD-ROM opcode | ||
| 494 | * to play data at track/index */ | ||
| 495 | #define GPCMD_PLAYAUDIO_TI 0x48 | ||
| 496 | /* | ||
| 497 | * From MS Media Status Notification Support Specification. For | ||
| 498 | * older drives only. | ||
| 499 | */ | ||
| 500 | #define GPCMD_GET_MEDIA_STATUS 0xda | ||
| 501 | |||
| 502 | /* Mode page codes for mode sense/set */ | ||
| 503 | #define GPMODE_VENDOR_PAGE 0x00 | ||
| 504 | #define GPMODE_R_W_ERROR_PAGE 0x01 | ||
| 505 | #define GPMODE_WRITE_PARMS_PAGE 0x05 | ||
| 506 | #define GPMODE_WCACHING_PAGE 0x08 | ||
| 507 | #define GPMODE_AUDIO_CTL_PAGE 0x0e | ||
| 508 | #define GPMODE_POWER_PAGE 0x1a | ||
| 509 | #define GPMODE_FAULT_FAIL_PAGE 0x1c | ||
| 510 | #define GPMODE_TO_PROTECT_PAGE 0x1d | ||
| 511 | #define GPMODE_CAPABILITIES_PAGE 0x2a | ||
| 512 | #define GPMODE_ALL_PAGES 0x3f | ||
| 513 | /* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor | ||
| 514 | * of MODE_SENSE_POWER_PAGE */ | ||
| 515 | #define GPMODE_CDROM_PAGE 0x0d | ||
| 516 | |||
| 517 | |||
| 518 | |||
| 519 | /* DVD struct types */ | ||
| 520 | #define DVD_STRUCT_PHYSICAL 0x00 | ||
| 521 | #define DVD_STRUCT_COPYRIGHT 0x01 | ||
| 522 | #define DVD_STRUCT_DISCKEY 0x02 | ||
| 523 | #define DVD_STRUCT_BCA 0x03 | ||
| 524 | #define DVD_STRUCT_MANUFACT 0x04 | ||
| 525 | |||
| 526 | struct dvd_layer { | ||
| 527 | __u8 book_version : 4; | ||
| 528 | __u8 book_type : 4; | ||
| 529 | __u8 min_rate : 4; | ||
| 530 | __u8 disc_size : 4; | ||
| 531 | __u8 layer_type : 4; | ||
| 532 | __u8 track_path : 1; | ||
| 533 | __u8 nlayers : 2; | ||
| 534 | __u8 track_density : 4; | ||
| 535 | __u8 linear_density : 4; | ||
| 536 | __u8 bca : 1; | ||
| 537 | __u32 start_sector; | ||
| 538 | __u32 end_sector; | ||
| 539 | __u32 end_sector_l0; | ||
| 540 | }; | ||
| 541 | |||
| 542 | #define DVD_LAYERS 4 | ||
| 543 | |||
| 544 | struct dvd_physical { | ||
| 545 | __u8 type; | ||
| 546 | __u8 layer_num; | ||
| 547 | struct dvd_layer layer[DVD_LAYERS]; | ||
| 548 | }; | ||
| 549 | |||
| 550 | struct dvd_copyright { | ||
| 551 | __u8 type; | ||
| 552 | |||
| 553 | __u8 layer_num; | ||
| 554 | __u8 cpst; | ||
| 555 | __u8 rmi; | ||
| 556 | }; | ||
| 557 | |||
| 558 | struct dvd_disckey { | ||
| 559 | __u8 type; | ||
| 560 | |||
| 561 | unsigned agid : 2; | ||
| 562 | __u8 value[2048]; | ||
| 563 | }; | ||
| 564 | |||
| 565 | struct dvd_bca { | ||
| 566 | __u8 type; | ||
| 567 | |||
| 568 | int len; | ||
| 569 | __u8 value[188]; | ||
| 570 | }; | ||
| 571 | |||
| 572 | struct dvd_manufact { | ||
| 573 | __u8 type; | ||
| 574 | |||
| 575 | __u8 layer_num; | ||
| 576 | int len; | ||
| 577 | __u8 value[2048]; | ||
| 578 | }; | ||
| 579 | |||
| 580 | typedef union { | ||
| 581 | __u8 type; | ||
| 582 | |||
| 583 | struct dvd_physical physical; | ||
| 584 | struct dvd_copyright copyright; | ||
| 585 | struct dvd_disckey disckey; | ||
| 586 | struct dvd_bca bca; | ||
| 587 | struct dvd_manufact manufact; | ||
| 588 | } dvd_struct; | ||
| 589 | |||
| 590 | /* | ||
| 591 | * DVD authentication ioctl | ||
| 592 | */ | ||
| 593 | |||
| 594 | /* Authentication states */ | ||
| 595 | #define DVD_LU_SEND_AGID 0 | ||
| 596 | #define DVD_HOST_SEND_CHALLENGE 1 | ||
| 597 | #define DVD_LU_SEND_KEY1 2 | ||
| 598 | #define DVD_LU_SEND_CHALLENGE 3 | ||
| 599 | #define DVD_HOST_SEND_KEY2 4 | ||
| 600 | |||
| 601 | /* Termination states */ | ||
| 602 | #define DVD_AUTH_ESTABLISHED 5 | ||
| 603 | #define DVD_AUTH_FAILURE 6 | ||
| 604 | |||
| 605 | /* Other functions */ | ||
| 606 | #define DVD_LU_SEND_TITLE_KEY 7 | ||
| 607 | #define DVD_LU_SEND_ASF 8 | ||
| 608 | #define DVD_INVALIDATE_AGID 9 | ||
| 609 | #define DVD_LU_SEND_RPC_STATE 10 | ||
| 610 | #define DVD_HOST_SEND_RPC_STATE 11 | ||
| 611 | |||
| 612 | /* State data */ | ||
| 613 | typedef __u8 dvd_key[5]; /* 40-bit value, MSB is first elem. */ | ||
| 614 | typedef __u8 dvd_challenge[10]; /* 80-bit value, MSB is first elem. */ | ||
| 615 | |||
| 616 | struct dvd_lu_send_agid { | ||
| 617 | __u8 type; | ||
| 618 | unsigned agid : 2; | ||
| 619 | }; | ||
| 620 | |||
| 621 | struct dvd_host_send_challenge { | ||
| 622 | __u8 type; | ||
| 623 | unsigned agid : 2; | ||
| 624 | |||
| 625 | dvd_challenge chal; | ||
| 626 | }; | ||
| 627 | |||
| 628 | struct dvd_send_key { | ||
| 629 | __u8 type; | ||
| 630 | unsigned agid : 2; | ||
| 631 | |||
| 632 | dvd_key key; | ||
| 633 | }; | ||
| 634 | |||
| 635 | struct dvd_lu_send_challenge { | ||
| 636 | __u8 type; | ||
| 637 | unsigned agid : 2; | ||
| 638 | |||
| 639 | dvd_challenge chal; | ||
| 640 | }; | ||
| 641 | |||
| 642 | #define DVD_CPM_NO_COPYRIGHT 0 | ||
| 643 | #define DVD_CPM_COPYRIGHTED 1 | ||
| 644 | |||
| 645 | #define DVD_CP_SEC_NONE 0 | ||
| 646 | #define DVD_CP_SEC_EXIST 1 | ||
| 647 | |||
| 648 | #define DVD_CGMS_UNRESTRICTED 0 | ||
| 649 | #define DVD_CGMS_SINGLE 2 | ||
| 650 | #define DVD_CGMS_RESTRICTED 3 | ||
| 651 | |||
| 652 | struct dvd_lu_send_title_key { | ||
| 653 | __u8 type; | ||
| 654 | unsigned agid : 2; | ||
| 655 | |||
| 656 | dvd_key title_key; | ||
| 657 | int lba; | ||
| 658 | unsigned cpm : 1; | ||
| 659 | unsigned cp_sec : 1; | ||
| 660 | unsigned cgms : 2; | ||
| 661 | }; | ||
| 662 | |||
| 663 | struct dvd_lu_send_asf { | ||
| 664 | __u8 type; | ||
| 665 | unsigned agid : 2; | ||
| 666 | |||
| 667 | unsigned asf : 1; | ||
| 668 | }; | ||
| 669 | |||
| 670 | struct dvd_host_send_rpcstate { | ||
| 671 | __u8 type; | ||
| 672 | __u8 pdrc; | ||
| 673 | }; | ||
| 674 | |||
| 675 | struct dvd_lu_send_rpcstate { | ||
| 676 | __u8 type : 2; | ||
| 677 | __u8 vra : 3; | ||
| 678 | __u8 ucca : 3; | ||
| 679 | __u8 region_mask; | ||
| 680 | __u8 rpc_scheme; | ||
| 681 | }; | ||
| 682 | |||
| 683 | typedef union { | ||
| 684 | __u8 type; | ||
| 685 | |||
| 686 | struct dvd_lu_send_agid lsa; | ||
| 687 | struct dvd_host_send_challenge hsc; | ||
| 688 | struct dvd_send_key lsk; | ||
| 689 | struct dvd_lu_send_challenge lsc; | ||
| 690 | struct dvd_send_key hsk; | ||
| 691 | struct dvd_lu_send_title_key lstk; | ||
| 692 | struct dvd_lu_send_asf lsasf; | ||
| 693 | struct dvd_host_send_rpcstate hrpcs; | ||
| 694 | struct dvd_lu_send_rpcstate lrpcs; | ||
| 695 | } dvd_authinfo; | ||
| 696 | |||
| 697 | struct request_sense { | ||
| 698 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 699 | __u8 valid : 1; | ||
| 700 | __u8 error_code : 7; | ||
| 701 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 702 | __u8 error_code : 7; | ||
| 703 | __u8 valid : 1; | ||
| 704 | #endif | ||
| 705 | __u8 segment_number; | ||
| 706 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 707 | __u8 reserved1 : 2; | ||
| 708 | __u8 ili : 1; | ||
| 709 | __u8 reserved2 : 1; | ||
| 710 | __u8 sense_key : 4; | ||
| 711 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 712 | __u8 sense_key : 4; | ||
| 713 | __u8 reserved2 : 1; | ||
| 714 | __u8 ili : 1; | ||
| 715 | __u8 reserved1 : 2; | ||
| 716 | #endif | ||
| 717 | __u8 information[4]; | ||
| 718 | __u8 add_sense_len; | ||
| 719 | __u8 command_info[4]; | ||
| 720 | __u8 asc; | ||
| 721 | __u8 ascq; | ||
| 722 | __u8 fruc; | ||
| 723 | __u8 sks[3]; | ||
| 724 | __u8 asb[46]; | ||
| 725 | }; | ||
| 726 | |||
| 727 | /* | ||
| 728 | * feature profile | ||
| 729 | */ | ||
| 730 | #define CDF_RWRT 0x0020 /* "Random Writable" */ | ||
| 731 | #define CDF_HWDM 0x0024 /* "Hardware Defect Management" */ | ||
| 732 | #define CDF_MRW 0x0028 | ||
| 733 | |||
| 734 | /* | ||
| 735 | * media status bits | ||
| 736 | */ | ||
| 737 | #define CDM_MRW_NOTMRW 0 | ||
| 738 | #define CDM_MRW_BGFORMAT_INACTIVE 1 | ||
| 739 | #define CDM_MRW_BGFORMAT_ACTIVE 2 | ||
| 740 | #define CDM_MRW_BGFORMAT_COMPLETE 3 | ||
| 741 | |||
| 742 | /* | ||
| 743 | * mrw address spaces | ||
| 744 | */ | ||
| 745 | #define MRW_LBA_DMA 0 | ||
| 746 | #define MRW_LBA_GAA 1 | ||
| 747 | |||
| 748 | /* | ||
| 749 | * mrw mode pages (first is deprecated) -- probed at init time and | ||
| 750 | * cdi->mrw_mode_page is set | ||
| 751 | */ | ||
| 752 | #define MRW_MODE_PC_PRE1 0x2c | ||
| 753 | #define MRW_MODE_PC 0x03 | ||
| 754 | |||
| 755 | struct mrw_feature_desc { | ||
| 756 | __be16 feature_code; | ||
| 757 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 758 | __u8 reserved1 : 2; | ||
| 759 | __u8 feature_version : 4; | ||
| 760 | __u8 persistent : 1; | ||
| 761 | __u8 curr : 1; | ||
| 762 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 763 | __u8 curr : 1; | ||
| 764 | __u8 persistent : 1; | ||
| 765 | __u8 feature_version : 4; | ||
| 766 | __u8 reserved1 : 2; | ||
| 767 | #endif | ||
| 768 | __u8 add_len; | ||
| 769 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 770 | __u8 reserved2 : 7; | ||
| 771 | __u8 write : 1; | ||
| 772 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 773 | __u8 write : 1; | ||
| 774 | __u8 reserved2 : 7; | ||
| 775 | #endif | ||
| 776 | __u8 reserved3; | ||
| 777 | __u8 reserved4; | ||
| 778 | __u8 reserved5; | ||
| 779 | }; | ||
| 780 | |||
| 781 | /* cf. mmc4r02g.pdf 5.3.10 Random Writable Feature (0020h) pg 197 of 635 */ | ||
| 782 | struct rwrt_feature_desc { | ||
| 783 | __be16 feature_code; | ||
| 784 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 785 | __u8 reserved1 : 2; | ||
| 786 | __u8 feature_version : 4; | ||
| 787 | __u8 persistent : 1; | ||
| 788 | __u8 curr : 1; | ||
| 789 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 790 | __u8 curr : 1; | ||
| 791 | __u8 persistent : 1; | ||
| 792 | __u8 feature_version : 4; | ||
| 793 | __u8 reserved1 : 2; | ||
| 794 | #endif | ||
| 795 | __u8 add_len; | ||
| 796 | __u32 last_lba; | ||
| 797 | __u32 block_size; | ||
| 798 | __u16 blocking; | ||
| 799 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 800 | __u8 reserved2 : 7; | ||
| 801 | __u8 page_present : 1; | ||
| 802 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 803 | __u8 page_present : 1; | ||
| 804 | __u8 reserved2 : 7; | ||
| 805 | #endif | ||
| 806 | __u8 reserved3; | ||
| 807 | }; | ||
| 808 | |||
| 809 | typedef struct { | ||
| 810 | __be16 disc_information_length; | ||
| 811 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 812 | __u8 reserved1 : 3; | ||
| 813 | __u8 erasable : 1; | ||
| 814 | __u8 border_status : 2; | ||
| 815 | __u8 disc_status : 2; | ||
| 816 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 817 | __u8 disc_status : 2; | ||
| 818 | __u8 border_status : 2; | ||
| 819 | __u8 erasable : 1; | ||
| 820 | __u8 reserved1 : 3; | ||
| 821 | #else | ||
| 822 | #error "Please fix <asm/byteorder.h>" | ||
| 823 | #endif | ||
| 824 | __u8 n_first_track; | ||
| 825 | __u8 n_sessions_lsb; | ||
| 826 | __u8 first_track_lsb; | ||
| 827 | __u8 last_track_lsb; | ||
| 828 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 829 | __u8 did_v : 1; | ||
| 830 | __u8 dbc_v : 1; | ||
| 831 | __u8 uru : 1; | ||
| 832 | __u8 reserved2 : 2; | ||
| 833 | __u8 dbit : 1; | ||
| 834 | __u8 mrw_status : 2; | ||
| 835 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 836 | __u8 mrw_status : 2; | ||
| 837 | __u8 dbit : 1; | ||
| 838 | __u8 reserved2 : 2; | ||
| 839 | __u8 uru : 1; | ||
| 840 | __u8 dbc_v : 1; | ||
| 841 | __u8 did_v : 1; | ||
| 842 | #endif | ||
| 843 | __u8 disc_type; | ||
| 844 | __u8 n_sessions_msb; | ||
| 845 | __u8 first_track_msb; | ||
| 846 | __u8 last_track_msb; | ||
| 847 | __u32 disc_id; | ||
| 848 | __u32 lead_in; | ||
| 849 | __u32 lead_out; | ||
| 850 | __u8 disc_bar_code[8]; | ||
| 851 | __u8 reserved3; | ||
| 852 | __u8 n_opc; | ||
| 853 | } disc_information; | ||
| 854 | |||
| 855 | typedef struct { | ||
| 856 | __be16 track_information_length; | ||
| 857 | __u8 track_lsb; | ||
| 858 | __u8 session_lsb; | ||
| 859 | __u8 reserved1; | ||
| 860 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 861 | __u8 reserved2 : 2; | ||
| 862 | __u8 damage : 1; | ||
| 863 | __u8 copy : 1; | ||
| 864 | __u8 track_mode : 4; | ||
| 865 | __u8 rt : 1; | ||
| 866 | __u8 blank : 1; | ||
| 867 | __u8 packet : 1; | ||
| 868 | __u8 fp : 1; | ||
| 869 | __u8 data_mode : 4; | ||
| 870 | __u8 reserved3 : 6; | ||
| 871 | __u8 lra_v : 1; | ||
| 872 | __u8 nwa_v : 1; | ||
| 873 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 874 | __u8 track_mode : 4; | ||
| 875 | __u8 copy : 1; | ||
| 876 | __u8 damage : 1; | ||
| 877 | __u8 reserved2 : 2; | ||
| 878 | __u8 data_mode : 4; | ||
| 879 | __u8 fp : 1; | ||
| 880 | __u8 packet : 1; | ||
| 881 | __u8 blank : 1; | ||
| 882 | __u8 rt : 1; | ||
| 883 | __u8 nwa_v : 1; | ||
| 884 | __u8 lra_v : 1; | ||
| 885 | __u8 reserved3 : 6; | ||
| 886 | #endif | ||
| 887 | __be32 track_start; | ||
| 888 | __be32 next_writable; | ||
| 889 | __be32 free_blocks; | ||
| 890 | __be32 fixed_packet_size; | ||
| 891 | __be32 track_size; | ||
| 892 | __be32 last_rec_address; | ||
| 893 | } track_information; | ||
| 894 | |||
| 895 | struct feature_header { | ||
| 896 | __u32 data_len; | ||
| 897 | __u8 reserved1; | ||
| 898 | __u8 reserved2; | ||
| 899 | __u16 curr_profile; | ||
| 900 | }; | ||
| 901 | |||
| 902 | struct mode_page_header { | ||
| 903 | __be16 mode_data_length; | ||
| 904 | __u8 medium_type; | ||
| 905 | __u8 reserved1; | ||
| 906 | __u8 reserved2; | ||
| 907 | __u8 reserved3; | ||
| 908 | __be16 desc_length; | ||
| 909 | }; | ||
| 910 | |||
| 911 | |||
| 912 | #endif /* _UAPI_LINUX_CDROM_H */ | ||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* cgroupstats.h - exporting per-cgroup statistics | ||
| 2 | * | ||
| 3 | * Copyright IBM Corporation, 2007 | ||
| 4 | * Author Balbir Singh <balbir@linux.vnet.ibm.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of version 2.1 of the GNU Lesser General Public License | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it would be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_CGROUPSTATS_H | ||
| 16 | #define _LINUX_CGROUPSTATS_H | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | #include <linux/taskstats.h> | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Data shared between user space and kernel space on a per cgroup | ||
| 23 | * basis. This data is shared using taskstats. | ||
| 24 | * | ||
| 25 | * Most of these states are derived by looking at the task->state value | ||
| 26 | * For the nr_io_wait state, a flag in the delay accounting structure | ||
| 27 | * indicates that the task is waiting on IO | ||
| 28 | * | ||
| 29 | * Each member is aligned to a 8 byte boundary. | ||
| 30 | */ | ||
| 31 | struct cgroupstats { | ||
| 32 | __u64 nr_sleeping; /* Number of tasks sleeping */ | ||
| 33 | __u64 nr_running; /* Number of tasks running */ | ||
| 34 | __u64 nr_stopped; /* Number of tasks in stopped state */ | ||
| 35 | __u64 nr_uninterruptible; /* Number of tasks in uninterruptible */ | ||
| 36 | /* state */ | ||
| 37 | __u64 nr_io_wait; /* Number of tasks waiting on IO */ | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Commands sent from userspace | ||
| 42 | * Not versioned. New commands should only be inserted at the enum's end | ||
| 43 | * prior to __CGROUPSTATS_CMD_MAX | ||
| 44 | */ | ||
| 45 | |||
| 46 | enum { | ||
| 47 | CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */ | ||
| 48 | CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */ | ||
| 49 | CGROUPSTATS_CMD_NEW, /* kernel->user event */ | ||
| 50 | __CGROUPSTATS_CMD_MAX, | ||
| 51 | }; | ||
| 52 | |||
| 53 | #define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1) | ||
| 54 | |||
| 55 | enum { | ||
| 56 | CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */ | ||
| 57 | CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */ | ||
| 58 | __CGROUPSTATS_TYPE_MAX, | ||
| 59 | }; | ||
| 60 | |||
| 61 | #define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1) | ||
| 62 | |||
| 63 | enum { | ||
| 64 | CGROUPSTATS_CMD_ATTR_UNSPEC = 0, | ||
| 65 | CGROUPSTATS_CMD_ATTR_FD, | ||
| 66 | __CGROUPSTATS_CMD_ATTR_MAX, | ||
| 67 | }; | ||
| 68 | |||
| 69 | #define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1) | ||
| 70 | |||
| 71 | #endif /* _LINUX_CGROUPSTATS_H */ | ||
| @@ -0,0 +1,168 @@ | |||
| 1 | /* | ||
| 2 | * ioctl interface for the scsi media changer driver | ||
| 3 | */ | ||
| 4 | |||
| 5 | /* changer element types */ | ||
| 6 | #define CHET_MT 0 /* media transport element (robot) */ | ||
| 7 | #define CHET_ST 1 /* storage element (media slots) */ | ||
| 8 | #define CHET_IE 2 /* import/export element */ | ||
| 9 | #define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */ | ||
| 10 | #define CHET_V1 4 /* vendor specific #1 */ | ||
| 11 | #define CHET_V2 5 /* vendor specific #2 */ | ||
| 12 | #define CHET_V3 6 /* vendor specific #3 */ | ||
| 13 | #define CHET_V4 7 /* vendor specific #4 */ | ||
| 14 | |||
| 15 | |||
| 16 | /* | ||
| 17 | * CHIOGPARAMS | ||
| 18 | * query changer properties | ||
| 19 | * | ||
| 20 | * CHIOVGPARAMS | ||
| 21 | * query vendor-specific element types | ||
| 22 | * | ||
| 23 | * accessing elements works by specifing type and unit of the element. | ||
| 24 | * for example, storage elements are addressed with type = CHET_ST and | ||
| 25 | * unit = 0 .. cp_nslots-1 | ||
| 26 | * | ||
| 27 | */ | ||
| 28 | struct changer_params { | ||
| 29 | int cp_curpicker; /* current transport element */ | ||
| 30 | int cp_npickers; /* number of transport elements (CHET_MT) */ | ||
| 31 | int cp_nslots; /* number of storage elements (CHET_ST) */ | ||
| 32 | int cp_nportals; /* number of import/export elements (CHET_IE) */ | ||
| 33 | int cp_ndrives; /* number of data transfer elements (CHET_DT) */ | ||
| 34 | }; | ||
| 35 | struct changer_vendor_params { | ||
| 36 | int cvp_n1; /* number of vendor specific elems (CHET_V1) */ | ||
| 37 | char cvp_label1[16]; | ||
| 38 | int cvp_n2; /* number of vendor specific elems (CHET_V2) */ | ||
| 39 | char cvp_label2[16]; | ||
| 40 | int cvp_n3; /* number of vendor specific elems (CHET_V3) */ | ||
| 41 | char cvp_label3[16]; | ||
| 42 | int cvp_n4; /* number of vendor specific elems (CHET_V4) */ | ||
| 43 | char cvp_label4[16]; | ||
| 44 | int reserved[8]; | ||
| 45 | }; | ||
| 46 | |||
| 47 | |||
| 48 | /* | ||
| 49 | * CHIOMOVE | ||
| 50 | * move a medium from one element to another | ||
| 51 | */ | ||
| 52 | struct changer_move { | ||
| 53 | int cm_fromtype; /* type/unit of source element */ | ||
| 54 | int cm_fromunit; | ||
| 55 | int cm_totype; /* type/unit of destination element */ | ||
| 56 | int cm_tounit; | ||
| 57 | int cm_flags; | ||
| 58 | }; | ||
| 59 | #define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */ | ||
| 60 | |||
| 61 | |||
| 62 | /* | ||
| 63 | * CHIOEXCHANGE | ||
| 64 | * move one medium from element #1 to element #2, | ||
| 65 | * and another one from element #2 to element #3. | ||
| 66 | * element #1 and #3 are allowed to be identical. | ||
| 67 | */ | ||
| 68 | struct changer_exchange { | ||
| 69 | int ce_srctype; /* type/unit of element #1 */ | ||
| 70 | int ce_srcunit; | ||
| 71 | int ce_fdsttype; /* type/unit of element #2 */ | ||
| 72 | int ce_fdstunit; | ||
| 73 | int ce_sdsttype; /* type/unit of element #3 */ | ||
| 74 | int ce_sdstunit; | ||
| 75 | int ce_flags; | ||
| 76 | }; | ||
| 77 | #define CE_INVERT1 1 | ||
| 78 | #define CE_INVERT2 2 | ||
| 79 | |||
| 80 | |||
| 81 | /* | ||
| 82 | * CHIOPOSITION | ||
| 83 | * move the transport element (robot arm) to a specific element. | ||
| 84 | */ | ||
| 85 | struct changer_position { | ||
| 86 | int cp_type; | ||
| 87 | int cp_unit; | ||
| 88 | int cp_flags; | ||
| 89 | }; | ||
| 90 | #define CP_INVERT 1 | ||
| 91 | |||
| 92 | |||
| 93 | /* | ||
| 94 | * CHIOGSTATUS | ||
| 95 | * get element status for all elements of a specific type | ||
| 96 | */ | ||
| 97 | struct changer_element_status { | ||
| 98 | int ces_type; | ||
| 99 | unsigned char __user *ces_data; | ||
| 100 | }; | ||
| 101 | #define CESTATUS_FULL 0x01 /* full */ | ||
| 102 | #define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */ | ||
| 103 | #define CESTATUS_EXCEPT 0x04 /* error condition */ | ||
| 104 | #define CESTATUS_ACCESS 0x08 /* access allowed */ | ||
| 105 | #define CESTATUS_EXENAB 0x10 /* element can export media */ | ||
| 106 | #define CESTATUS_INENAB 0x20 /* element can import media */ | ||
| 107 | |||
| 108 | |||
| 109 | /* | ||
| 110 | * CHIOGELEM | ||
| 111 | * get more detailed status information for a single element | ||
| 112 | */ | ||
| 113 | struct changer_get_element { | ||
| 114 | int cge_type; /* type/unit */ | ||
| 115 | int cge_unit; | ||
| 116 | int cge_status; /* status */ | ||
| 117 | int cge_errno; /* errno */ | ||
| 118 | int cge_srctype; /* source element of the last move/exchange */ | ||
| 119 | int cge_srcunit; | ||
| 120 | int cge_id; /* scsi id (for data transfer elements) */ | ||
| 121 | int cge_lun; /* scsi lun (for data transfer elements) */ | ||
| 122 | char cge_pvoltag[36]; /* primary volume tag */ | ||
| 123 | char cge_avoltag[36]; /* alternate volume tag */ | ||
| 124 | int cge_flags; | ||
| 125 | }; | ||
| 126 | /* flags */ | ||
| 127 | #define CGE_ERRNO 0x01 /* errno available */ | ||
| 128 | #define CGE_INVERT 0x02 /* media inverted */ | ||
| 129 | #define CGE_SRC 0x04 /* media src available */ | ||
| 130 | #define CGE_IDLUN 0x08 /* ID+LUN available */ | ||
| 131 | #define CGE_PVOLTAG 0x10 /* primary volume tag available */ | ||
| 132 | #define CGE_AVOLTAG 0x20 /* alternate volume tag available */ | ||
| 133 | |||
| 134 | |||
| 135 | /* | ||
| 136 | * CHIOSVOLTAG | ||
| 137 | * set volume tag | ||
| 138 | */ | ||
| 139 | struct changer_set_voltag { | ||
| 140 | int csv_type; /* type/unit */ | ||
| 141 | int csv_unit; | ||
| 142 | char csv_voltag[36]; /* volume tag */ | ||
| 143 | int csv_flags; | ||
| 144 | }; | ||
| 145 | #define CSV_PVOLTAG 0x01 /* primary volume tag */ | ||
| 146 | #define CSV_AVOLTAG 0x02 /* alternate volume tag */ | ||
| 147 | #define CSV_CLEARTAG 0x04 /* clear volume tag */ | ||
| 148 | |||
| 149 | /* ioctls */ | ||
| 150 | #define CHIOMOVE _IOW('c', 1,struct changer_move) | ||
| 151 | #define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange) | ||
| 152 | #define CHIOPOSITION _IOW('c', 3,struct changer_position) | ||
| 153 | #define CHIOGPICKER _IOR('c', 4,int) /* not impl. */ | ||
| 154 | #define CHIOSPICKER _IOW('c', 5,int) /* not impl. */ | ||
| 155 | #define CHIOGPARAMS _IOR('c', 6,struct changer_params) | ||
| 156 | #define CHIOGSTATUS _IOW('c', 8,struct changer_element_status) | ||
| 157 | #define CHIOGELEM _IOW('c',16,struct changer_get_element) | ||
| 158 | #define CHIOINITELEM _IO('c',17) | ||
| 159 | #define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag) | ||
| 160 | #define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params) | ||
| 161 | |||
| 162 | /* ---------------------------------------------------------------------- */ | ||
| 163 | |||
| 164 | /* | ||
| 165 | * Local variables: | ||
| 166 | * c-basic-offset: 8 | ||
| 167 | * End: | ||
| 168 | */ | ||
| @@ -0,0 +1,62 @@ | |||
| 1 | #ifndef _UAPI_CM4000_H_ | ||
| 2 | #define _UAPI_CM4000_H_ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #define MAX_ATR 33 | ||
| 7 | |||
| 8 | #define CM4000_MAX_DEV 4 | ||
| 9 | |||
| 10 | /* those two structures are passed via ioctl() from/to userspace. They are | ||
| 11 | * used by existing userspace programs, so I kepth the awkward "bIFSD" naming | ||
| 12 | * not to break compilation of userspace apps. -HW */ | ||
| 13 | |||
| 14 | typedef struct atreq { | ||
| 15 | __s32 atr_len; | ||
| 16 | unsigned char atr[64]; | ||
| 17 | __s32 power_act; | ||
| 18 | unsigned char bIFSD; | ||
| 19 | unsigned char bIFSC; | ||
| 20 | } atreq_t; | ||
| 21 | |||
| 22 | |||
| 23 | /* what is particularly stupid in the original driver is the arch-dependent | ||
| 24 | * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace | ||
| 25 | * will lay out the structure members differently than the 64bit kernel. | ||
| 26 | * | ||
| 27 | * I've changed "ptsreq.protocol" from "unsigned long" to "__u32". | ||
| 28 | * On 32bit this will make no difference. With 64bit kernels, it will make | ||
| 29 | * 32bit apps work, too. | ||
| 30 | */ | ||
| 31 | |||
| 32 | typedef struct ptsreq { | ||
| 33 | __u32 protocol; /*T=0: 2^0, T=1: 2^1*/ | ||
| 34 | unsigned char flags; | ||
| 35 | unsigned char pts1; | ||
| 36 | unsigned char pts2; | ||
| 37 | unsigned char pts3; | ||
| 38 | } ptsreq_t; | ||
| 39 | |||
| 40 | #define CM_IOC_MAGIC 'c' | ||
| 41 | #define CM_IOC_MAXNR 255 | ||
| 42 | |||
| 43 | #define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *) | ||
| 44 | #define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *) | ||
| 45 | #define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *) | ||
| 46 | #define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3) | ||
| 47 | #define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4) | ||
| 48 | |||
| 49 | #define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*) | ||
| 50 | |||
| 51 | /* card and device states */ | ||
| 52 | #define CM_CARD_INSERTED 0x01 | ||
| 53 | #define CM_CARD_POWERED 0x02 | ||
| 54 | #define CM_ATR_PRESENT 0x04 | ||
| 55 | #define CM_ATR_VALID 0x08 | ||
| 56 | #define CM_STATE_VALID 0x0f | ||
| 57 | /* extra info only from CM4000 */ | ||
| 58 | #define CM_NO_READER 0x10 | ||
| 59 | #define CM_BAD_CARD 0x20 | ||
| 60 | |||
| 61 | |||
| 62 | #endif /* _UAPI_CM4000_H_ */ | ||
| @@ -0,0 +1,121 @@ | |||
| 1 | /* | ||
| 2 | * cn_proc.h - process events connector | ||
| 3 | * | ||
| 4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 | ||
| 5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin | ||
| 6 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> | ||
| 7 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms of version 2.1 of the GNU Lesser General Public License | ||
| 11 | * as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it would be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef _UAPICN_PROC_H | ||
| 19 | #define _UAPICN_PROC_H | ||
| 20 | |||
| 21 | #include <linux/types.h> | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Userspace sends this enum to register with the kernel that it is listening | ||
| 25 | * for events on the connector. | ||
| 26 | */ | ||
| 27 | enum proc_cn_mcast_op { | ||
| 28 | PROC_CN_MCAST_LISTEN = 1, | ||
| 29 | PROC_CN_MCAST_IGNORE = 2 | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* | ||
| 33 | * From the user's point of view, the process | ||
| 34 | * ID is the thread group ID and thread ID is the internal | ||
| 35 | * kernel "pid". So, fields are assigned as follow: | ||
| 36 | * | ||
| 37 | * In user space - In kernel space | ||
| 38 | * | ||
| 39 | * parent process ID = parent->tgid | ||
| 40 | * parent thread ID = parent->pid | ||
| 41 | * child process ID = child->tgid | ||
| 42 | * child thread ID = child->pid | ||
| 43 | */ | ||
| 44 | |||
| 45 | struct proc_event { | ||
| 46 | enum what { | ||
| 47 | /* Use successive bits so the enums can be used to record | ||
| 48 | * sets of events as well | ||
| 49 | */ | ||
| 50 | PROC_EVENT_NONE = 0x00000000, | ||
| 51 | PROC_EVENT_FORK = 0x00000001, | ||
| 52 | PROC_EVENT_EXEC = 0x00000002, | ||
| 53 | PROC_EVENT_UID = 0x00000004, | ||
| 54 | PROC_EVENT_GID = 0x00000040, | ||
| 55 | PROC_EVENT_SID = 0x00000080, | ||
| 56 | PROC_EVENT_PTRACE = 0x00000100, | ||
| 57 | PROC_EVENT_COMM = 0x00000200, | ||
| 58 | /* "next" should be 0x00000400 */ | ||
| 59 | /* "last" is the last process event: exit */ | ||
| 60 | PROC_EVENT_EXIT = 0x80000000 | ||
| 61 | } what; | ||
| 62 | __u32 cpu; | ||
| 63 | __u64 __attribute__((aligned(8))) timestamp_ns; | ||
| 64 | /* Number of nano seconds since system boot */ | ||
| 65 | union { /* must be last field of proc_event struct */ | ||
| 66 | struct { | ||
| 67 | __u32 err; | ||
| 68 | } ack; | ||
| 69 | |||
| 70 | struct fork_proc_event { | ||
| 71 | __kernel_pid_t parent_pid; | ||
| 72 | __kernel_pid_t parent_tgid; | ||
| 73 | __kernel_pid_t child_pid; | ||
| 74 | __kernel_pid_t child_tgid; | ||
| 75 | } fork; | ||
| 76 | |||
| 77 | struct exec_proc_event { | ||
| 78 | __kernel_pid_t process_pid; | ||
| 79 | __kernel_pid_t process_tgid; | ||
| 80 | } exec; | ||
| 81 | |||
| 82 | struct id_proc_event { | ||
| 83 | __kernel_pid_t process_pid; | ||
| 84 | __kernel_pid_t process_tgid; | ||
| 85 | union { | ||
| 86 | __u32 ruid; /* task uid */ | ||
| 87 | __u32 rgid; /* task gid */ | ||
| 88 | } r; | ||
| 89 | union { | ||
| 90 | __u32 euid; | ||
| 91 | __u32 egid; | ||
| 92 | } e; | ||
| 93 | } id; | ||
| 94 | |||
| 95 | struct sid_proc_event { | ||
| 96 | __kernel_pid_t process_pid; | ||
| 97 | __kernel_pid_t process_tgid; | ||
| 98 | } sid; | ||
| 99 | |||
| 100 | struct ptrace_proc_event { | ||
| 101 | __kernel_pid_t process_pid; | ||
| 102 | __kernel_pid_t process_tgid; | ||
| 103 | __kernel_pid_t tracer_pid; | ||
| 104 | __kernel_pid_t tracer_tgid; | ||
| 105 | } ptrace; | ||
| 106 | |||
| 107 | struct comm_proc_event { | ||
| 108 | __kernel_pid_t process_pid; | ||
| 109 | __kernel_pid_t process_tgid; | ||
| 110 | char comm[16]; | ||
| 111 | } comm; | ||
| 112 | |||
| 113 | struct exit_proc_event { | ||
| 114 | __kernel_pid_t process_pid; | ||
| 115 | __kernel_pid_t process_tgid; | ||
| 116 | __u32 exit_code, exit_signal; | ||
| 117 | } exit; | ||
| 118 | } event_data; | ||
| 119 | }; | ||
| 120 | |||
| 121 | #endif /* _UAPICN_PROC_H */ | ||
| @@ -0,0 +1,741 @@ | |||
| 1 | /* | ||
| 2 | You may distribute this file under either of the two licenses that | ||
| 3 | follow at your discretion. | ||
| 4 | */ | ||
| 5 | |||
| 6 | /* BLURB lgpl | ||
| 7 | |||
| 8 | Coda File System | ||
| 9 | Release 5 | ||
| 10 | |||
| 11 | Copyright (c) 1987-1999 Carnegie Mellon University | ||
| 12 | Additional copyrights listed below | ||
| 13 | |||
| 14 | This code is distributed "AS IS" without warranty of any kind under | ||
| 15 | the terms of the GNU Library General Public Licence Version 2, as | ||
| 16 | shown in the file LICENSE, or under the license shown below. The | ||
| 17 | technical and financial contributors to Coda are listed in the file | ||
| 18 | CREDITS. | ||
| 19 | |||
| 20 | Additional copyrights | ||
| 21 | */ | ||
| 22 | |||
| 23 | /* | ||
| 24 | |||
| 25 | Coda: an Experimental Distributed File System | ||
| 26 | Release 4.0 | ||
| 27 | |||
| 28 | Copyright (c) 1987-1999 Carnegie Mellon University | ||
| 29 | All Rights Reserved | ||
| 30 | |||
| 31 | Permission to use, copy, modify and distribute this software and its | ||
| 32 | documentation is hereby granted, provided that both the copyright | ||
| 33 | notice and this permission notice appear in all copies of the | ||
| 34 | software, derivative works or modified versions, and any portions | ||
| 35 | thereof, and that both notices appear in supporting documentation, and | ||
| 36 | that credit is given to Carnegie Mellon University in all documents | ||
| 37 | and publicity pertaining to direct or indirect use of this code or its | ||
| 38 | derivatives. | ||
| 39 | |||
| 40 | CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS, | ||
| 41 | SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS | ||
| 42 | FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON | ||
| 43 | DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER | ||
| 44 | RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF | ||
| 45 | ANY DERIVATIVE WORK. | ||
| 46 | |||
| 47 | Carnegie Mellon encourages users of this software to return any | ||
| 48 | improvements or extensions that they make, and to grant Carnegie | ||
| 49 | Mellon the rights to redistribute these changes without encumbrance. | ||
| 50 | */ | ||
| 51 | |||
| 52 | /* | ||
| 53 | * | ||
| 54 | * Based on cfs.h from Mach, but revamped for increased simplicity. | ||
| 55 | * Linux modifications by | ||
| 56 | * Peter Braam, Aug 1996 | ||
| 57 | */ | ||
| 58 | |||
| 59 | #ifndef _UAPI_CODA_HEADER_ | ||
| 60 | #define _UAPI_CODA_HEADER_ | ||
| 61 | |||
| 62 | |||
| 63 | /* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ | ||
| 64 | #if defined(__NetBSD__) || \ | ||
| 65 | ((defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)) | ||
| 66 | #include <sys/types.h> | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #ifndef CODA_MAXSYMLINKS | ||
| 70 | #define CODA_MAXSYMLINKS 10 | ||
| 71 | #endif | ||
| 72 | |||
| 73 | #if defined(DJGPP) || defined(__CYGWIN32__) | ||
| 74 | #ifdef KERNEL | ||
| 75 | typedef unsigned long u_long; | ||
| 76 | typedef unsigned int u_int; | ||
| 77 | typedef unsigned short u_short; | ||
| 78 | typedef u_long ino_t; | ||
| 79 | typedef u_long dev_t; | ||
| 80 | typedef void * caddr_t; | ||
| 81 | #ifdef DOS | ||
| 82 | typedef unsigned __int64 u_quad_t; | ||
| 83 | #else | ||
| 84 | typedef unsigned long long u_quad_t; | ||
| 85 | #endif | ||
| 86 | |||
| 87 | #define inline | ||
| 88 | |||
| 89 | struct timespec { | ||
| 90 | long ts_sec; | ||
| 91 | long ts_nsec; | ||
| 92 | }; | ||
| 93 | #else /* DJGPP but not KERNEL */ | ||
| 94 | #include <sys/time.h> | ||
| 95 | typedef unsigned long long u_quad_t; | ||
| 96 | #endif /* !KERNEL */ | ||
| 97 | #endif /* !DJGPP */ | ||
| 98 | |||
| 99 | |||
| 100 | #if defined(__linux__) | ||
| 101 | #include <linux/time.h> | ||
| 102 | #define cdev_t u_quad_t | ||
| 103 | #ifndef __KERNEL__ | ||
| 104 | #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2) | ||
| 105 | #define _UQUAD_T_ 1 | ||
| 106 | typedef unsigned long long u_quad_t; | ||
| 107 | #endif | ||
| 108 | #endif /* __KERNEL__ */ | ||
| 109 | #else | ||
| 110 | #define cdev_t dev_t | ||
| 111 | #endif | ||
| 112 | |||
| 113 | #ifdef __CYGWIN32__ | ||
| 114 | struct timespec { | ||
| 115 | time_t tv_sec; /* seconds */ | ||
| 116 | long tv_nsec; /* nanoseconds */ | ||
| 117 | }; | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #ifndef __BIT_TYPES_DEFINED__ | ||
| 121 | #define __BIT_TYPES_DEFINED__ | ||
| 122 | typedef signed char int8_t; | ||
| 123 | typedef unsigned char u_int8_t; | ||
| 124 | typedef short int16_t; | ||
| 125 | typedef unsigned short u_int16_t; | ||
| 126 | typedef int int32_t; | ||
| 127 | typedef unsigned int u_int32_t; | ||
| 128 | #endif | ||
| 129 | |||
| 130 | |||
| 131 | /* | ||
| 132 | * Cfs constants | ||
| 133 | */ | ||
| 134 | #define CODA_MAXNAMLEN 255 | ||
| 135 | #define CODA_MAXPATHLEN 1024 | ||
| 136 | #define CODA_MAXSYMLINK 10 | ||
| 137 | |||
| 138 | /* these are Coda's version of O_RDONLY etc combinations | ||
| 139 | * to deal with VFS open modes | ||
| 140 | */ | ||
| 141 | #define C_O_READ 0x001 | ||
| 142 | #define C_O_WRITE 0x002 | ||
| 143 | #define C_O_TRUNC 0x010 | ||
| 144 | #define C_O_EXCL 0x100 | ||
| 145 | #define C_O_CREAT 0x200 | ||
| 146 | |||
| 147 | /* these are to find mode bits in Venus */ | ||
| 148 | #define C_M_READ 00400 | ||
| 149 | #define C_M_WRITE 00200 | ||
| 150 | |||
| 151 | /* for access Venus will use */ | ||
| 152 | #define C_A_C_OK 8 /* Test for writing upon create. */ | ||
| 153 | #define C_A_R_OK 4 /* Test for read permission. */ | ||
| 154 | #define C_A_W_OK 2 /* Test for write permission. */ | ||
| 155 | #define C_A_X_OK 1 /* Test for execute permission. */ | ||
| 156 | #define C_A_F_OK 0 /* Test for existence. */ | ||
| 157 | |||
| 158 | |||
| 159 | |||
| 160 | #ifndef _VENUS_DIRENT_T_ | ||
| 161 | #define _VENUS_DIRENT_T_ 1 | ||
| 162 | struct venus_dirent { | ||
| 163 | u_int32_t d_fileno; /* file number of entry */ | ||
| 164 | u_int16_t d_reclen; /* length of this record */ | ||
| 165 | u_int8_t d_type; /* file type, see below */ | ||
| 166 | u_int8_t d_namlen; /* length of string in d_name */ | ||
| 167 | char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */ | ||
| 168 | }; | ||
| 169 | #undef DIRSIZ | ||
| 170 | #define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \ | ||
| 171 | (((dp)->d_namlen+1 + 3) &~ 3)) | ||
| 172 | |||
| 173 | /* | ||
| 174 | * File types | ||
| 175 | */ | ||
| 176 | #define CDT_UNKNOWN 0 | ||
| 177 | #define CDT_FIFO 1 | ||
| 178 | #define CDT_CHR 2 | ||
| 179 | #define CDT_DIR 4 | ||
| 180 | #define CDT_BLK 6 | ||
| 181 | #define CDT_REG 8 | ||
| 182 | #define CDT_LNK 10 | ||
| 183 | #define CDT_SOCK 12 | ||
| 184 | #define CDT_WHT 14 | ||
| 185 | |||
| 186 | /* | ||
| 187 | * Convert between stat structure types and directory types. | ||
| 188 | */ | ||
| 189 | #define IFTOCDT(mode) (((mode) & 0170000) >> 12) | ||
| 190 | #define CDTTOIF(dirtype) ((dirtype) << 12) | ||
| 191 | |||
| 192 | #endif | ||
| 193 | |||
| 194 | #ifndef _VUID_T_ | ||
| 195 | #define _VUID_T_ | ||
| 196 | typedef u_int32_t vuid_t; | ||
| 197 | typedef u_int32_t vgid_t; | ||
| 198 | #endif /*_VUID_T_ */ | ||
| 199 | |||
| 200 | struct CodaFid { | ||
| 201 | u_int32_t opaque[4]; | ||
| 202 | }; | ||
| 203 | |||
| 204 | #define coda_f2i(fid)\ | ||
| 205 | (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0) | ||
| 206 | |||
| 207 | #ifndef _VENUS_VATTR_T_ | ||
| 208 | #define _VENUS_VATTR_T_ | ||
| 209 | /* | ||
| 210 | * Vnode types. VNON means no type. | ||
| 211 | */ | ||
| 212 | enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; | ||
| 213 | |||
| 214 | struct coda_vattr { | ||
| 215 | long va_type; /* vnode type (for create) */ | ||
| 216 | u_short va_mode; /* files access mode and type */ | ||
| 217 | short va_nlink; /* number of references to file */ | ||
| 218 | vuid_t va_uid; /* owner user id */ | ||
| 219 | vgid_t va_gid; /* owner group id */ | ||
| 220 | long va_fileid; /* file id */ | ||
| 221 | u_quad_t va_size; /* file size in bytes */ | ||
| 222 | long va_blocksize; /* blocksize preferred for i/o */ | ||
| 223 | struct timespec va_atime; /* time of last access */ | ||
| 224 | struct timespec va_mtime; /* time of last modification */ | ||
| 225 | struct timespec va_ctime; /* time file changed */ | ||
| 226 | u_long va_gen; /* generation number of file */ | ||
| 227 | u_long va_flags; /* flags defined for file */ | ||
| 228 | cdev_t va_rdev; /* device special file represents */ | ||
| 229 | u_quad_t va_bytes; /* bytes of disk space held by file */ | ||
| 230 | u_quad_t va_filerev; /* file modification number */ | ||
| 231 | }; | ||
| 232 | |||
| 233 | #endif | ||
| 234 | |||
| 235 | /* structure used by CODA_STATFS for getting cache information from venus */ | ||
| 236 | struct coda_statfs { | ||
| 237 | int32_t f_blocks; | ||
| 238 | int32_t f_bfree; | ||
| 239 | int32_t f_bavail; | ||
| 240 | int32_t f_files; | ||
| 241 | int32_t f_ffree; | ||
| 242 | }; | ||
| 243 | |||
| 244 | /* | ||
| 245 | * Kernel <--> Venus communications. | ||
| 246 | */ | ||
| 247 | |||
| 248 | #define CODA_ROOT 2 | ||
| 249 | #define CODA_OPEN_BY_FD 3 | ||
| 250 | #define CODA_OPEN 4 | ||
| 251 | #define CODA_CLOSE 5 | ||
| 252 | #define CODA_IOCTL 6 | ||
| 253 | #define CODA_GETATTR 7 | ||
| 254 | #define CODA_SETATTR 8 | ||
| 255 | #define CODA_ACCESS 9 | ||
| 256 | #define CODA_LOOKUP 10 | ||
| 257 | #define CODA_CREATE 11 | ||
| 258 | #define CODA_REMOVE 12 | ||
| 259 | #define CODA_LINK 13 | ||
| 260 | #define CODA_RENAME 14 | ||
| 261 | #define CODA_MKDIR 15 | ||
| 262 | #define CODA_RMDIR 16 | ||
| 263 | #define CODA_SYMLINK 18 | ||
| 264 | #define CODA_READLINK 19 | ||
| 265 | #define CODA_FSYNC 20 | ||
| 266 | #define CODA_VGET 22 | ||
| 267 | #define CODA_SIGNAL 23 | ||
| 268 | #define CODA_REPLACE 24 /* DOWNCALL */ | ||
| 269 | #define CODA_FLUSH 25 /* DOWNCALL */ | ||
| 270 | #define CODA_PURGEUSER 26 /* DOWNCALL */ | ||
| 271 | #define CODA_ZAPFILE 27 /* DOWNCALL */ | ||
| 272 | #define CODA_ZAPDIR 28 /* DOWNCALL */ | ||
| 273 | #define CODA_PURGEFID 30 /* DOWNCALL */ | ||
| 274 | #define CODA_OPEN_BY_PATH 31 | ||
| 275 | #define CODA_RESOLVE 32 | ||
| 276 | #define CODA_REINTEGRATE 33 | ||
| 277 | #define CODA_STATFS 34 | ||
| 278 | #define CODA_STORE 35 | ||
| 279 | #define CODA_RELEASE 36 | ||
| 280 | #define CODA_NCALLS 37 | ||
| 281 | |||
| 282 | #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) | ||
| 283 | |||
| 284 | #define VC_MAXDATASIZE 8192 | ||
| 285 | #define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ | ||
| 286 | VC_MAXDATASIZE | ||
| 287 | |||
| 288 | #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) | ||
| 289 | |||
| 290 | #define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ | ||
| 291 | |||
| 292 | /* | ||
| 293 | * Venus <-> Coda RPC arguments | ||
| 294 | */ | ||
| 295 | struct coda_in_hdr { | ||
| 296 | u_int32_t opcode; | ||
| 297 | u_int32_t unique; /* Keep multiple outstanding msgs distinct */ | ||
| 298 | pid_t pid; | ||
| 299 | pid_t pgid; | ||
| 300 | vuid_t uid; | ||
| 301 | }; | ||
| 302 | |||
| 303 | /* Really important that opcode and unique are 1st two fields! */ | ||
| 304 | struct coda_out_hdr { | ||
| 305 | u_int32_t opcode; | ||
| 306 | u_int32_t unique; | ||
| 307 | u_int32_t result; | ||
| 308 | }; | ||
| 309 | |||
| 310 | /* coda_root: NO_IN */ | ||
| 311 | struct coda_root_out { | ||
| 312 | struct coda_out_hdr oh; | ||
| 313 | struct CodaFid VFid; | ||
| 314 | }; | ||
| 315 | |||
| 316 | struct coda_root_in { | ||
| 317 | struct coda_in_hdr in; | ||
| 318 | }; | ||
| 319 | |||
| 320 | /* coda_open: */ | ||
| 321 | struct coda_open_in { | ||
| 322 | struct coda_in_hdr ih; | ||
| 323 | struct CodaFid VFid; | ||
| 324 | int flags; | ||
| 325 | }; | ||
| 326 | |||
| 327 | struct coda_open_out { | ||
| 328 | struct coda_out_hdr oh; | ||
| 329 | cdev_t dev; | ||
| 330 | ino_t inode; | ||
| 331 | }; | ||
| 332 | |||
| 333 | |||
| 334 | /* coda_store: */ | ||
| 335 | struct coda_store_in { | ||
| 336 | struct coda_in_hdr ih; | ||
| 337 | struct CodaFid VFid; | ||
| 338 | int flags; | ||
| 339 | }; | ||
| 340 | |||
| 341 | struct coda_store_out { | ||
| 342 | struct coda_out_hdr out; | ||
| 343 | }; | ||
| 344 | |||
| 345 | /* coda_release: */ | ||
| 346 | struct coda_release_in { | ||
| 347 | struct coda_in_hdr ih; | ||
| 348 | struct CodaFid VFid; | ||
| 349 | int flags; | ||
| 350 | }; | ||
| 351 | |||
| 352 | struct coda_release_out { | ||
| 353 | struct coda_out_hdr out; | ||
| 354 | }; | ||
| 355 | |||
| 356 | /* coda_close: */ | ||
| 357 | struct coda_close_in { | ||
| 358 | struct coda_in_hdr ih; | ||
| 359 | struct CodaFid VFid; | ||
| 360 | int flags; | ||
| 361 | }; | ||
| 362 | |||
| 363 | struct coda_close_out { | ||
| 364 | struct coda_out_hdr out; | ||
| 365 | }; | ||
| 366 | |||
| 367 | /* coda_ioctl: */ | ||
| 368 | struct coda_ioctl_in { | ||
| 369 | struct coda_in_hdr ih; | ||
| 370 | struct CodaFid VFid; | ||
| 371 | int cmd; | ||
| 372 | int len; | ||
| 373 | int rwflag; | ||
| 374 | char *data; /* Place holder for data. */ | ||
| 375 | }; | ||
| 376 | |||
| 377 | struct coda_ioctl_out { | ||
| 378 | struct coda_out_hdr oh; | ||
| 379 | int len; | ||
| 380 | caddr_t data; /* Place holder for data. */ | ||
| 381 | }; | ||
| 382 | |||
| 383 | |||
| 384 | /* coda_getattr: */ | ||
| 385 | struct coda_getattr_in { | ||
| 386 | struct coda_in_hdr ih; | ||
| 387 | struct CodaFid VFid; | ||
| 388 | }; | ||
| 389 | |||
| 390 | struct coda_getattr_out { | ||
| 391 | struct coda_out_hdr oh; | ||
| 392 | struct coda_vattr attr; | ||
| 393 | }; | ||
| 394 | |||
| 395 | |||
| 396 | /* coda_setattr: NO_OUT */ | ||
| 397 | struct coda_setattr_in { | ||
| 398 | struct coda_in_hdr ih; | ||
| 399 | struct CodaFid VFid; | ||
| 400 | struct coda_vattr attr; | ||
| 401 | }; | ||
| 402 | |||
| 403 | struct coda_setattr_out { | ||
| 404 | struct coda_out_hdr out; | ||
| 405 | }; | ||
| 406 | |||
| 407 | /* coda_access: NO_OUT */ | ||
| 408 | struct coda_access_in { | ||
| 409 | struct coda_in_hdr ih; | ||
| 410 | struct CodaFid VFid; | ||
| 411 | int flags; | ||
| 412 | }; | ||
| 413 | |||
| 414 | struct coda_access_out { | ||
| 415 | struct coda_out_hdr out; | ||
| 416 | }; | ||
| 417 | |||
| 418 | |||
| 419 | /* lookup flags */ | ||
| 420 | #define CLU_CASE_SENSITIVE 0x01 | ||
| 421 | #define CLU_CASE_INSENSITIVE 0x02 | ||
| 422 | |||
| 423 | /* coda_lookup: */ | ||
| 424 | struct coda_lookup_in { | ||
| 425 | struct coda_in_hdr ih; | ||
| 426 | struct CodaFid VFid; | ||
| 427 | int name; /* Place holder for data. */ | ||
| 428 | int flags; | ||
| 429 | }; | ||
| 430 | |||
| 431 | struct coda_lookup_out { | ||
| 432 | struct coda_out_hdr oh; | ||
| 433 | struct CodaFid VFid; | ||
| 434 | int vtype; | ||
| 435 | }; | ||
| 436 | |||
| 437 | |||
| 438 | /* coda_create: */ | ||
| 439 | struct coda_create_in { | ||
| 440 | struct coda_in_hdr ih; | ||
| 441 | struct CodaFid VFid; | ||
| 442 | struct coda_vattr attr; | ||
| 443 | int excl; | ||
| 444 | int mode; | ||
| 445 | int name; /* Place holder for data. */ | ||
| 446 | }; | ||
| 447 | |||
| 448 | struct coda_create_out { | ||
| 449 | struct coda_out_hdr oh; | ||
| 450 | struct CodaFid VFid; | ||
| 451 | struct coda_vattr attr; | ||
| 452 | }; | ||
| 453 | |||
| 454 | |||
| 455 | /* coda_remove: NO_OUT */ | ||
| 456 | struct coda_remove_in { | ||
| 457 | struct coda_in_hdr ih; | ||
| 458 | struct CodaFid VFid; | ||
| 459 | int name; /* Place holder for data. */ | ||
| 460 | }; | ||
| 461 | |||
| 462 | struct coda_remove_out { | ||
| 463 | struct coda_out_hdr out; | ||
| 464 | }; | ||
| 465 | |||
| 466 | /* coda_link: NO_OUT */ | ||
| 467 | struct coda_link_in { | ||
| 468 | struct coda_in_hdr ih; | ||
| 469 | struct CodaFid sourceFid; /* cnode to link *to* */ | ||
| 470 | struct CodaFid destFid; /* Directory in which to place link */ | ||
| 471 | int tname; /* Place holder for data. */ | ||
| 472 | }; | ||
| 473 | |||
| 474 | struct coda_link_out { | ||
| 475 | struct coda_out_hdr out; | ||
| 476 | }; | ||
| 477 | |||
| 478 | |||
| 479 | /* coda_rename: NO_OUT */ | ||
| 480 | struct coda_rename_in { | ||
| 481 | struct coda_in_hdr ih; | ||
| 482 | struct CodaFid sourceFid; | ||
| 483 | int srcname; | ||
| 484 | struct CodaFid destFid; | ||
| 485 | int destname; | ||
| 486 | }; | ||
| 487 | |||
| 488 | struct coda_rename_out { | ||
| 489 | struct coda_out_hdr out; | ||
| 490 | }; | ||
| 491 | |||
| 492 | /* coda_mkdir: */ | ||
| 493 | struct coda_mkdir_in { | ||
| 494 | struct coda_in_hdr ih; | ||
| 495 | struct CodaFid VFid; | ||
| 496 | struct coda_vattr attr; | ||
| 497 | int name; /* Place holder for data. */ | ||
| 498 | }; | ||
| 499 | |||
| 500 | struct coda_mkdir_out { | ||
| 501 | struct coda_out_hdr oh; | ||
| 502 | struct CodaFid VFid; | ||
| 503 | struct coda_vattr attr; | ||
| 504 | }; | ||
| 505 | |||
| 506 | |||
| 507 | /* coda_rmdir: NO_OUT */ | ||
| 508 | struct coda_rmdir_in { | ||
| 509 | struct coda_in_hdr ih; | ||
| 510 | struct CodaFid VFid; | ||
| 511 | int name; /* Place holder for data. */ | ||
| 512 | }; | ||
| 513 | |||
| 514 | struct coda_rmdir_out { | ||
| 515 | struct coda_out_hdr out; | ||
| 516 | }; | ||
| 517 | |||
| 518 | /* coda_symlink: NO_OUT */ | ||
| 519 | struct coda_symlink_in { | ||
| 520 | struct coda_in_hdr ih; | ||
| 521 | struct CodaFid VFid; /* Directory to put symlink in */ | ||
| 522 | int srcname; | ||
| 523 | struct coda_vattr attr; | ||
| 524 | int tname; | ||
| 525 | }; | ||
| 526 | |||
| 527 | struct coda_symlink_out { | ||
| 528 | struct coda_out_hdr out; | ||
| 529 | }; | ||
| 530 | |||
| 531 | /* coda_readlink: */ | ||
| 532 | struct coda_readlink_in { | ||
| 533 | struct coda_in_hdr ih; | ||
| 534 | struct CodaFid VFid; | ||
| 535 | }; | ||
| 536 | |||
| 537 | struct coda_readlink_out { | ||
| 538 | struct coda_out_hdr oh; | ||
| 539 | int count; | ||
| 540 | caddr_t data; /* Place holder for data. */ | ||
| 541 | }; | ||
| 542 | |||
| 543 | |||
| 544 | /* coda_fsync: NO_OUT */ | ||
| 545 | struct coda_fsync_in { | ||
| 546 | struct coda_in_hdr ih; | ||
| 547 | struct CodaFid VFid; | ||
| 548 | }; | ||
| 549 | |||
| 550 | struct coda_fsync_out { | ||
| 551 | struct coda_out_hdr out; | ||
| 552 | }; | ||
| 553 | |||
| 554 | /* coda_vget: */ | ||
| 555 | struct coda_vget_in { | ||
| 556 | struct coda_in_hdr ih; | ||
| 557 | struct CodaFid VFid; | ||
| 558 | }; | ||
| 559 | |||
| 560 | struct coda_vget_out { | ||
| 561 | struct coda_out_hdr oh; | ||
| 562 | struct CodaFid VFid; | ||
| 563 | int vtype; | ||
| 564 | }; | ||
| 565 | |||
| 566 | |||
| 567 | /* CODA_SIGNAL is out-of-band, doesn't need data. */ | ||
| 568 | /* CODA_INVALIDATE is a venus->kernel call */ | ||
| 569 | /* CODA_FLUSH is a venus->kernel call */ | ||
| 570 | |||
| 571 | /* coda_purgeuser: */ | ||
| 572 | /* CODA_PURGEUSER is a venus->kernel call */ | ||
| 573 | struct coda_purgeuser_out { | ||
| 574 | struct coda_out_hdr oh; | ||
| 575 | vuid_t uid; | ||
| 576 | }; | ||
| 577 | |||
| 578 | /* coda_zapfile: */ | ||
| 579 | /* CODA_ZAPFILE is a venus->kernel call */ | ||
| 580 | struct coda_zapfile_out { | ||
| 581 | struct coda_out_hdr oh; | ||
| 582 | struct CodaFid CodaFid; | ||
| 583 | }; | ||
| 584 | |||
| 585 | /* coda_zapdir: */ | ||
| 586 | /* CODA_ZAPDIR is a venus->kernel call */ | ||
| 587 | struct coda_zapdir_out { | ||
| 588 | struct coda_out_hdr oh; | ||
| 589 | struct CodaFid CodaFid; | ||
| 590 | }; | ||
| 591 | |||
| 592 | /* coda_purgefid: */ | ||
| 593 | /* CODA_PURGEFID is a venus->kernel call */ | ||
| 594 | struct coda_purgefid_out { | ||
| 595 | struct coda_out_hdr oh; | ||
| 596 | struct CodaFid CodaFid; | ||
| 597 | }; | ||
| 598 | |||
| 599 | /* coda_replace: */ | ||
| 600 | /* CODA_REPLACE is a venus->kernel call */ | ||
| 601 | struct coda_replace_out { /* coda_replace is a venus->kernel call */ | ||
| 602 | struct coda_out_hdr oh; | ||
| 603 | struct CodaFid NewFid; | ||
| 604 | struct CodaFid OldFid; | ||
| 605 | }; | ||
| 606 | |||
| 607 | /* coda_open_by_fd: */ | ||
| 608 | struct coda_open_by_fd_in { | ||
| 609 | struct coda_in_hdr ih; | ||
| 610 | struct CodaFid VFid; | ||
| 611 | int flags; | ||
| 612 | }; | ||
| 613 | |||
| 614 | struct coda_open_by_fd_out { | ||
| 615 | struct coda_out_hdr oh; | ||
| 616 | int fd; | ||
| 617 | |||
| 618 | #ifdef __KERNEL__ | ||
| 619 | struct file *fh; /* not passed from userspace but used in-kernel only */ | ||
| 620 | #endif | ||
| 621 | }; | ||
| 622 | |||
| 623 | /* coda_open_by_path: */ | ||
| 624 | struct coda_open_by_path_in { | ||
| 625 | struct coda_in_hdr ih; | ||
| 626 | struct CodaFid VFid; | ||
| 627 | int flags; | ||
| 628 | }; | ||
| 629 | |||
| 630 | struct coda_open_by_path_out { | ||
| 631 | struct coda_out_hdr oh; | ||
| 632 | int path; | ||
| 633 | }; | ||
| 634 | |||
| 635 | /* coda_statfs: NO_IN */ | ||
| 636 | struct coda_statfs_in { | ||
| 637 | struct coda_in_hdr in; | ||
| 638 | }; | ||
| 639 | |||
| 640 | struct coda_statfs_out { | ||
| 641 | struct coda_out_hdr oh; | ||
| 642 | struct coda_statfs stat; | ||
| 643 | }; | ||
| 644 | |||
| 645 | /* | ||
| 646 | * Occasionally, we don't cache the fid returned by CODA_LOOKUP. | ||
| 647 | * For instance, if the fid is inconsistent. | ||
| 648 | * This case is handled by setting the top bit of the type result parameter. | ||
| 649 | */ | ||
| 650 | #define CODA_NOCACHE 0x80000000 | ||
| 651 | |||
| 652 | union inputArgs { | ||
| 653 | struct coda_in_hdr ih; /* NB: every struct below begins with an ih */ | ||
| 654 | struct coda_open_in coda_open; | ||
| 655 | struct coda_store_in coda_store; | ||
| 656 | struct coda_release_in coda_release; | ||
| 657 | struct coda_close_in coda_close; | ||
| 658 | struct coda_ioctl_in coda_ioctl; | ||
| 659 | struct coda_getattr_in coda_getattr; | ||
| 660 | struct coda_setattr_in coda_setattr; | ||
| 661 | struct coda_access_in coda_access; | ||
| 662 | struct coda_lookup_in coda_lookup; | ||
| 663 | struct coda_create_in coda_create; | ||
| 664 | struct coda_remove_in coda_remove; | ||
| 665 | struct coda_link_in coda_link; | ||
| 666 | struct coda_rename_in coda_rename; | ||
| 667 | struct coda_mkdir_in coda_mkdir; | ||
| 668 | struct coda_rmdir_in coda_rmdir; | ||
| 669 | struct coda_symlink_in coda_symlink; | ||
| 670 | struct coda_readlink_in coda_readlink; | ||
| 671 | struct coda_fsync_in coda_fsync; | ||
| 672 | struct coda_vget_in coda_vget; | ||
| 673 | struct coda_open_by_fd_in coda_open_by_fd; | ||
| 674 | struct coda_open_by_path_in coda_open_by_path; | ||
| 675 | struct coda_statfs_in coda_statfs; | ||
| 676 | }; | ||
| 677 | |||
| 678 | union outputArgs { | ||
| 679 | struct coda_out_hdr oh; /* NB: every struct below begins with an oh */ | ||
| 680 | struct coda_root_out coda_root; | ||
| 681 | struct coda_open_out coda_open; | ||
| 682 | struct coda_ioctl_out coda_ioctl; | ||
| 683 | struct coda_getattr_out coda_getattr; | ||
| 684 | struct coda_lookup_out coda_lookup; | ||
| 685 | struct coda_create_out coda_create; | ||
| 686 | struct coda_mkdir_out coda_mkdir; | ||
| 687 | struct coda_readlink_out coda_readlink; | ||
| 688 | struct coda_vget_out coda_vget; | ||
| 689 | struct coda_purgeuser_out coda_purgeuser; | ||
| 690 | struct coda_zapfile_out coda_zapfile; | ||
| 691 | struct coda_zapdir_out coda_zapdir; | ||
| 692 | struct coda_purgefid_out coda_purgefid; | ||
| 693 | struct coda_replace_out coda_replace; | ||
| 694 | struct coda_open_by_fd_out coda_open_by_fd; | ||
| 695 | struct coda_open_by_path_out coda_open_by_path; | ||
| 696 | struct coda_statfs_out coda_statfs; | ||
| 697 | }; | ||
| 698 | |||
| 699 | union coda_downcalls { | ||
| 700 | /* CODA_INVALIDATE is a venus->kernel call */ | ||
| 701 | /* CODA_FLUSH is a venus->kernel call */ | ||
| 702 | struct coda_purgeuser_out purgeuser; | ||
| 703 | struct coda_zapfile_out zapfile; | ||
| 704 | struct coda_zapdir_out zapdir; | ||
| 705 | struct coda_purgefid_out purgefid; | ||
| 706 | struct coda_replace_out replace; | ||
| 707 | }; | ||
| 708 | |||
| 709 | |||
| 710 | /* | ||
| 711 | * Used for identifying usage of "Control" and pioctls | ||
| 712 | */ | ||
| 713 | |||
| 714 | #define PIOCPARM_MASK 0x0000ffff | ||
| 715 | struct ViceIoctl { | ||
| 716 | void __user *in; /* Data to be transferred in */ | ||
| 717 | void __user *out; /* Data to be transferred out */ | ||
| 718 | u_short in_size; /* Size of input buffer <= 2K */ | ||
| 719 | u_short out_size; /* Maximum size of output buffer, <= 2K */ | ||
| 720 | }; | ||
| 721 | |||
| 722 | struct PioctlData { | ||
| 723 | const char __user *path; | ||
| 724 | int follow; | ||
| 725 | struct ViceIoctl vi; | ||
| 726 | }; | ||
| 727 | |||
| 728 | #define CODA_CONTROL ".CONTROL" | ||
| 729 | #define CODA_CONTROLLEN 8 | ||
| 730 | #define CTL_INO -1 | ||
| 731 | |||
| 732 | /* Data passed to mount */ | ||
| 733 | |||
| 734 | #define CODA_MOUNT_VERSION 1 | ||
| 735 | |||
| 736 | struct coda_mount_data { | ||
| 737 | int version; | ||
| 738 | int fd; /* Opened device */ | ||
| 739 | }; | ||
| 740 | |||
| 741 | #endif /* _UAPI_CODA_HEADER_ */ | ||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef _UAPI__CODA_PSDEV_H | ||
| 2 | #define _UAPI__CODA_PSDEV_H | ||
| 3 | |||
| 4 | #include <linux/magic.h> | ||
| 5 | |||
| 6 | #define CODA_PSDEV_MAJOR 67 | ||
| 7 | #define MAX_CODADEVS 5 /* how many do we allow */ | ||
| 8 | |||
| 9 | |||
| 10 | /* messages between coda filesystem in kernel and Venus */ | ||
| 11 | struct upc_req { | ||
| 12 | struct list_head uc_chain; | ||
| 13 | caddr_t uc_data; | ||
| 14 | u_short uc_flags; | ||
| 15 | u_short uc_inSize; /* Size is at most 5000 bytes */ | ||
| 16 | u_short uc_outSize; | ||
| 17 | u_short uc_opcode; /* copied from data to save lookup */ | ||
| 18 | int uc_unique; | ||
| 19 | wait_queue_head_t uc_sleep; /* process' wait queue */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | #define CODA_REQ_ASYNC 0x1 | ||
| 23 | #define CODA_REQ_READ 0x2 | ||
| 24 | #define CODA_REQ_WRITE 0x4 | ||
| 25 | #define CODA_REQ_ABORT 0x8 | ||
| 26 | |||
| 27 | #endif /* _UAPI__CODA_PSDEV_H */ | ||
| @@ -0,0 +1,351 @@ | |||
| 1 | /* This file is derived from the GAS 2.1.4 assembler control file. | ||
| 2 | The GAS product is under the GNU General Public License, version 2 or later. | ||
| 3 | As such, this file is also under that license. | ||
| 4 | |||
| 5 | If the file format changes in the COFF object, this file should be | ||
| 6 | subsequently updated to reflect the changes. | ||
| 7 | |||
| 8 | The actual loader module only uses a few of these structures. The full | ||
| 9 | set is documented here because I received the full set. If you wish | ||
| 10 | more information about COFF, then O'Reilly has a very excellent book. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #define E_SYMNMLEN 8 /* Number of characters in a symbol name */ | ||
| 14 | #define E_FILNMLEN 14 /* Number of characters in a file name */ | ||
| 15 | #define E_DIMNUM 4 /* Number of array dimensions in auxiliary entry */ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * These defines are byte order independent. There is no alignment of fields | ||
| 19 | * permitted in the structures. Therefore they are declared as characters | ||
| 20 | * and the values loaded from the character positions. It also makes it | ||
| 21 | * nice to have it "endian" independent. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* Load a short int from the following tables with little-endian formats */ | ||
| 25 | #define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\ | ||
| 26 | ((unsigned short)((unsigned char)ps[0])))) | ||
| 27 | |||
| 28 | /* Load a long int from the following tables with little-endian formats */ | ||
| 29 | #define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\ | ||
| 30 | ((unsigned long)((unsigned char)ps[2])<<16) |\ | ||
| 31 | ((unsigned long)((unsigned char)ps[1])<<8) |\ | ||
| 32 | ((unsigned long)((unsigned char)ps[0]))))) | ||
| 33 | |||
| 34 | /* Load a short int from the following tables with big-endian formats */ | ||
| 35 | #define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\ | ||
| 36 | ((unsigned short)((unsigned char)ps[1])))) | ||
| 37 | |||
| 38 | /* Load a long int from the following tables with big-endian formats */ | ||
| 39 | #define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\ | ||
| 40 | ((unsigned long)((unsigned char)ps[1])<<16) |\ | ||
| 41 | ((unsigned long)((unsigned char)ps[2])<<8) |\ | ||
| 42 | ((unsigned long)((unsigned char)ps[3]))))) | ||
| 43 | |||
| 44 | /* These may be overridden later by brain dead implementations which generate | ||
| 45 | a big-endian header with little-endian data. In that case, generate a | ||
| 46 | replacement macro which tests a flag and uses either of the two above | ||
| 47 | as appropriate. */ | ||
| 48 | |||
| 49 | #define COFF_LONG(v) COFF_LONG_L(v) | ||
| 50 | #define COFF_SHORT(v) COFF_SHORT_L(v) | ||
| 51 | |||
| 52 | /*** coff information for Intel 386/486. */ | ||
| 53 | |||
| 54 | /********************** FILE HEADER **********************/ | ||
| 55 | |||
| 56 | struct COFF_filehdr { | ||
| 57 | char f_magic[2]; /* magic number */ | ||
| 58 | char f_nscns[2]; /* number of sections */ | ||
| 59 | char f_timdat[4]; /* time & date stamp */ | ||
| 60 | char f_symptr[4]; /* file pointer to symtab */ | ||
| 61 | char f_nsyms[4]; /* number of symtab entries */ | ||
| 62 | char f_opthdr[2]; /* sizeof(optional hdr) */ | ||
| 63 | char f_flags[2]; /* flags */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Bits for f_flags: | ||
| 68 | * | ||
| 69 | * F_RELFLG relocation info stripped from file | ||
| 70 | * F_EXEC file is executable (i.e. no unresolved external | ||
| 71 | * references) | ||
| 72 | * F_LNNO line numbers stripped from file | ||
| 73 | * F_LSYMS local symbols stripped from file | ||
| 74 | * F_MINMAL this is a minimal object file (".m") output of fextract | ||
| 75 | * F_UPDATE this is a fully bound update file, output of ogen | ||
| 76 | * F_SWABD this file has had its bytes swabbed (in names) | ||
| 77 | * F_AR16WR this file has the byte ordering of an AR16WR | ||
| 78 | * (e.g. 11/70) machine | ||
| 79 | * F_AR32WR this file has the byte ordering of an AR32WR machine | ||
| 80 | * (e.g. vax and iNTEL 386) | ||
| 81 | * F_AR32W this file has the byte ordering of an AR32W machine | ||
| 82 | * (e.g. 3b,maxi) | ||
| 83 | * F_PATCH file contains "patch" list in optional header | ||
| 84 | * F_NODF (minimal file only) no decision functions for | ||
| 85 | * replaced functions | ||
| 86 | */ | ||
| 87 | |||
| 88 | #define COFF_F_RELFLG 0000001 | ||
| 89 | #define COFF_F_EXEC 0000002 | ||
| 90 | #define COFF_F_LNNO 0000004 | ||
| 91 | #define COFF_F_LSYMS 0000010 | ||
| 92 | #define COFF_F_MINMAL 0000020 | ||
| 93 | #define COFF_F_UPDATE 0000040 | ||
| 94 | #define COFF_F_SWABD 0000100 | ||
| 95 | #define COFF_F_AR16WR 0000200 | ||
| 96 | #define COFF_F_AR32WR 0000400 | ||
| 97 | #define COFF_F_AR32W 0001000 | ||
| 98 | #define COFF_F_PATCH 0002000 | ||
| 99 | #define COFF_F_NODF 0002000 | ||
| 100 | |||
| 101 | #define COFF_I386MAGIC 0x14c /* Linux's system */ | ||
| 102 | |||
| 103 | #if 0 /* Perhaps, someday, these formats may be used. */ | ||
| 104 | #define COFF_I386PTXMAGIC 0x154 | ||
| 105 | #define COFF_I386AIXMAGIC 0x175 /* IBM's AIX system */ | ||
| 106 | #define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \ | ||
| 107 | && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \ | ||
| 108 | && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC) | ||
| 109 | #else | ||
| 110 | #define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC) | ||
| 111 | #endif | ||
| 112 | |||
| 113 | #define COFF_FILHDR struct COFF_filehdr | ||
| 114 | #define COFF_FILHSZ sizeof(COFF_FILHDR) | ||
| 115 | |||
| 116 | /********************** AOUT "OPTIONAL HEADER" **********************/ | ||
| 117 | |||
| 118 | /* Linux COFF must have this "optional" header. Standard COFF has no entry | ||
| 119 | location for the "entry" point. They normally would start with the first | ||
| 120 | location of the .text section. This is not a good idea for linux. So, | ||
| 121 | the use of this "optional" header is not optional. It is required. | ||
| 122 | |||
| 123 | Do not be tempted to assume that the size of the optional header is | ||
| 124 | a constant and simply index the next byte by the size of this structure. | ||
| 125 | Use the 'f_opthdr' field in the main coff header for the size of the | ||
| 126 | structure actually written to the file!! | ||
| 127 | */ | ||
| 128 | |||
| 129 | typedef struct | ||
| 130 | { | ||
| 131 | char magic[2]; /* type of file */ | ||
| 132 | char vstamp[2]; /* version stamp */ | ||
| 133 | char tsize[4]; /* text size in bytes, padded to FW bdry */ | ||
| 134 | char dsize[4]; /* initialized data " " */ | ||
| 135 | char bsize[4]; /* uninitialized data " " */ | ||
| 136 | char entry[4]; /* entry pt. */ | ||
| 137 | char text_start[4]; /* base of text used for this file */ | ||
| 138 | char data_start[4]; /* base of data used for this file */ | ||
| 139 | } | ||
| 140 | COFF_AOUTHDR; | ||
| 141 | |||
| 142 | #define COFF_AOUTSZ (sizeof(COFF_AOUTHDR)) | ||
| 143 | |||
| 144 | #define COFF_STMAGIC 0401 | ||
| 145 | #define COFF_OMAGIC 0404 | ||
| 146 | #define COFF_JMAGIC 0407 /* dirty text and data image, can't share */ | ||
| 147 | #define COFF_DMAGIC 0410 /* dirty text segment, data aligned */ | ||
| 148 | #define COFF_ZMAGIC 0413 /* The proper magic number for executables */ | ||
| 149 | #define COFF_SHMAGIC 0443 /* shared library header */ | ||
| 150 | |||
| 151 | /********************** SECTION HEADER **********************/ | ||
| 152 | |||
| 153 | struct COFF_scnhdr { | ||
| 154 | char s_name[8]; /* section name */ | ||
| 155 | char s_paddr[4]; /* physical address, aliased s_nlib */ | ||
| 156 | char s_vaddr[4]; /* virtual address */ | ||
| 157 | char s_size[4]; /* section size */ | ||
| 158 | char s_scnptr[4]; /* file ptr to raw data for section */ | ||
| 159 | char s_relptr[4]; /* file ptr to relocation */ | ||
| 160 | char s_lnnoptr[4]; /* file ptr to line numbers */ | ||
| 161 | char s_nreloc[2]; /* number of relocation entries */ | ||
| 162 | char s_nlnno[2]; /* number of line number entries */ | ||
| 163 | char s_flags[4]; /* flags */ | ||
| 164 | }; | ||
| 165 | |||
| 166 | #define COFF_SCNHDR struct COFF_scnhdr | ||
| 167 | #define COFF_SCNHSZ sizeof(COFF_SCNHDR) | ||
| 168 | |||
| 169 | /* | ||
| 170 | * names of "special" sections | ||
| 171 | */ | ||
| 172 | |||
| 173 | #define COFF_TEXT ".text" | ||
| 174 | #define COFF_DATA ".data" | ||
| 175 | #define COFF_BSS ".bss" | ||
| 176 | #define COFF_COMMENT ".comment" | ||
| 177 | #define COFF_LIB ".lib" | ||
| 178 | |||
| 179 | #define COFF_SECT_TEXT 0 /* Section for instruction code */ | ||
| 180 | #define COFF_SECT_DATA 1 /* Section for initialized globals */ | ||
| 181 | #define COFF_SECT_BSS 2 /* Section for un-initialized globals */ | ||
| 182 | #define COFF_SECT_REQD 3 /* Minimum number of sections for good file */ | ||
| 183 | |||
| 184 | #define COFF_STYP_REG 0x00 /* regular segment */ | ||
| 185 | #define COFF_STYP_DSECT 0x01 /* dummy segment */ | ||
| 186 | #define COFF_STYP_NOLOAD 0x02 /* no-load segment */ | ||
| 187 | #define COFF_STYP_GROUP 0x04 /* group segment */ | ||
| 188 | #define COFF_STYP_PAD 0x08 /* .pad segment */ | ||
| 189 | #define COFF_STYP_COPY 0x10 /* copy section */ | ||
| 190 | #define COFF_STYP_TEXT 0x20 /* .text segment */ | ||
| 191 | #define COFF_STYP_DATA 0x40 /* .data segment */ | ||
| 192 | #define COFF_STYP_BSS 0x80 /* .bss segment */ | ||
| 193 | #define COFF_STYP_INFO 0x200 /* .comment section */ | ||
| 194 | #define COFF_STYP_OVER 0x400 /* overlay section */ | ||
| 195 | #define COFF_STYP_LIB 0x800 /* library section */ | ||
| 196 | |||
| 197 | /* | ||
| 198 | * Shared libraries have the following section header in the data field for | ||
| 199 | * each library. | ||
| 200 | */ | ||
| 201 | |||
| 202 | struct COFF_slib { | ||
| 203 | char sl_entsz[4]; /* Size of this entry */ | ||
| 204 | char sl_pathndx[4]; /* size of the header field */ | ||
| 205 | }; | ||
| 206 | |||
| 207 | #define COFF_SLIBHD struct COFF_slib | ||
| 208 | #define COFF_SLIBSZ sizeof(COFF_SLIBHD) | ||
| 209 | |||
| 210 | /********************** LINE NUMBERS **********************/ | ||
| 211 | |||
| 212 | /* 1 line number entry for every "breakpointable" source line in a section. | ||
| 213 | * Line numbers are grouped on a per function basis; first entry in a function | ||
| 214 | * grouping will have l_lnno = 0 and in place of physical address will be the | ||
| 215 | * symbol table index of the function name. | ||
| 216 | */ | ||
| 217 | |||
| 218 | struct COFF_lineno { | ||
| 219 | union { | ||
| 220 | char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ | ||
| 221 | char l_paddr[4]; /* (physical) address of line number */ | ||
| 222 | } l_addr; | ||
| 223 | char l_lnno[2]; /* line number */ | ||
| 224 | }; | ||
| 225 | |||
| 226 | #define COFF_LINENO struct COFF_lineno | ||
| 227 | #define COFF_LINESZ 6 | ||
| 228 | |||
| 229 | /********************** SYMBOLS **********************/ | ||
| 230 | |||
| 231 | #define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */ | ||
| 232 | #define COFF_E_FILNMLEN 14 /* # characters in a file name */ | ||
| 233 | #define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry */ | ||
| 234 | |||
| 235 | /* | ||
| 236 | * All symbols and sections have the following definition | ||
| 237 | */ | ||
| 238 | |||
| 239 | struct COFF_syment | ||
| 240 | { | ||
| 241 | union { | ||
| 242 | char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */ | ||
| 243 | struct { | ||
| 244 | char e_zeroes[4]; /* Leading zeros */ | ||
| 245 | char e_offset[4]; /* Offset if this is a header section */ | ||
| 246 | } e; | ||
| 247 | } e; | ||
| 248 | |||
| 249 | char e_value[4]; /* Value (address) of the segment */ | ||
| 250 | char e_scnum[2]; /* Section number */ | ||
| 251 | char e_type[2]; /* Type of section */ | ||
| 252 | char e_sclass[1]; /* Loader class */ | ||
| 253 | char e_numaux[1]; /* Number of auxiliary entries which follow */ | ||
| 254 | }; | ||
| 255 | |||
| 256 | #define COFF_N_BTMASK (0xf) /* Mask for important class bits */ | ||
| 257 | #define COFF_N_TMASK (0x30) /* Mask for important type bits */ | ||
| 258 | #define COFF_N_BTSHFT (4) /* # bits to shift class field */ | ||
| 259 | #define COFF_N_TSHIFT (2) /* # bits to shift type field */ | ||
| 260 | |||
| 261 | /* | ||
| 262 | * Auxiliary entries because the main table is too limiting. | ||
| 263 | */ | ||
| 264 | |||
| 265 | union COFF_auxent { | ||
| 266 | |||
| 267 | /* | ||
| 268 | * Debugger information | ||
| 269 | */ | ||
| 270 | |||
| 271 | struct { | ||
| 272 | char x_tagndx[4]; /* str, un, or enum tag indx */ | ||
| 273 | union { | ||
| 274 | struct { | ||
| 275 | char x_lnno[2]; /* declaration line number */ | ||
| 276 | char x_size[2]; /* str/union/array size */ | ||
| 277 | } x_lnsz; | ||
| 278 | char x_fsize[4]; /* size of function */ | ||
| 279 | } x_misc; | ||
| 280 | |||
| 281 | union { | ||
| 282 | struct { /* if ISFCN, tag, or .bb */ | ||
| 283 | char x_lnnoptr[4]; /* ptr to fcn line # */ | ||
| 284 | char x_endndx[4]; /* entry ndx past block end */ | ||
| 285 | } x_fcn; | ||
| 286 | |||
| 287 | struct { /* if ISARY, up to 4 dimen. */ | ||
| 288 | char x_dimen[E_DIMNUM][2]; | ||
| 289 | } x_ary; | ||
| 290 | } x_fcnary; | ||
| 291 | |||
| 292 | char x_tvndx[2]; /* tv index */ | ||
| 293 | } x_sym; | ||
| 294 | |||
| 295 | /* | ||
| 296 | * Source file names (debugger information) | ||
| 297 | */ | ||
| 298 | |||
| 299 | union { | ||
| 300 | char x_fname[E_FILNMLEN]; | ||
| 301 | struct { | ||
| 302 | char x_zeroes[4]; | ||
| 303 | char x_offset[4]; | ||
| 304 | } x_n; | ||
| 305 | } x_file; | ||
| 306 | |||
| 307 | /* | ||
| 308 | * Section information | ||
| 309 | */ | ||
| 310 | |||
| 311 | struct { | ||
| 312 | char x_scnlen[4]; /* section length */ | ||
| 313 | char x_nreloc[2]; /* # relocation entries */ | ||
| 314 | char x_nlinno[2]; /* # line numbers */ | ||
| 315 | } x_scn; | ||
| 316 | |||
| 317 | /* | ||
| 318 | * Transfer vector (branch table) | ||
| 319 | */ | ||
| 320 | |||
| 321 | struct { | ||
| 322 | char x_tvfill[4]; /* tv fill value */ | ||
| 323 | char x_tvlen[2]; /* length of .tv */ | ||
| 324 | char x_tvran[2][2]; /* tv range */ | ||
| 325 | } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ | ||
| 326 | }; | ||
| 327 | |||
| 328 | #define COFF_SYMENT struct COFF_syment | ||
| 329 | #define COFF_SYMESZ 18 | ||
| 330 | #define COFF_AUXENT union COFF_auxent | ||
| 331 | #define COFF_AUXESZ 18 | ||
| 332 | |||
| 333 | #define COFF_ETEXT "etext" | ||
| 334 | |||
| 335 | /********************** RELOCATION DIRECTIVES **********************/ | ||
| 336 | |||
| 337 | struct COFF_reloc { | ||
| 338 | char r_vaddr[4]; /* Virtual address of item */ | ||
| 339 | char r_symndx[4]; /* Symbol index in the symtab */ | ||
| 340 | char r_type[2]; /* Relocation type */ | ||
| 341 | }; | ||
| 342 | |||
| 343 | #define COFF_RELOC struct COFF_reloc | ||
| 344 | #define COFF_RELSZ 10 | ||
| 345 | |||
| 346 | #define COFF_DEF_DATA_SECTION_ALIGNMENT 4 | ||
| 347 | #define COFF_DEF_BSS_SECTION_ALIGNMENT 4 | ||
| 348 | #define COFF_DEF_TEXT_SECTION_ALIGNMENT 4 | ||
| 349 | |||
| 350 | /* For new sections we haven't heard of before */ | ||
| 351 | #define COFF_DEF_SECTION_ALIGNMENT 4 | ||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | * connector.h | ||
| 3 | * | ||
| 4 | * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net> | ||
| 5 | * All rights reserved. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef _UAPI__CONNECTOR_H | ||
| 23 | #define _UAPI__CONNECTOR_H | ||
| 24 | |||
| 25 | #include <linux/types.h> | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Process Events connector unique ids -- used for message routing | ||
| 29 | */ | ||
| 30 | #define CN_IDX_PROC 0x1 | ||
| 31 | #define CN_VAL_PROC 0x1 | ||
| 32 | #define CN_IDX_CIFS 0x2 | ||
| 33 | #define CN_VAL_CIFS 0x1 | ||
| 34 | #define CN_W1_IDX 0x3 /* w1 communication */ | ||
| 35 | #define CN_W1_VAL 0x1 | ||
| 36 | #define CN_IDX_V86D 0x4 | ||
| 37 | #define CN_VAL_V86D_UVESAFB 0x1 | ||
| 38 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ | ||
| 39 | #define CN_DST_IDX 0x6 | ||
| 40 | #define CN_DST_VAL 0x1 | ||
| 41 | #define CN_IDX_DM 0x7 /* Device Mapper */ | ||
| 42 | #define CN_VAL_DM_USERSPACE_LOG 0x1 | ||
| 43 | #define CN_IDX_DRBD 0x8 | ||
| 44 | #define CN_VAL_DRBD 0x1 | ||
| 45 | #define CN_KVP_IDX 0x9 /* HyperV KVP */ | ||
| 46 | #define CN_KVP_VAL 0x1 /* queries from the kernel */ | ||
| 47 | |||
| 48 | #define CN_NETLINK_USERS 10 /* Highest index + 1 */ | ||
| 49 | |||
| 50 | /* | ||
| 51 | * Maximum connector's message size. | ||
| 52 | */ | ||
| 53 | #define CONNECTOR_MAX_MSG_SIZE 16384 | ||
| 54 | |||
| 55 | /* | ||
| 56 | * idx and val are unique identifiers which | ||
| 57 | * are used for message routing and | ||
| 58 | * must be registered in connector.h for in-kernel usage. | ||
| 59 | */ | ||
| 60 | |||
| 61 | struct cb_id { | ||
| 62 | __u32 idx; | ||
| 63 | __u32 val; | ||
| 64 | }; | ||
| 65 | |||
| 66 | struct cn_msg { | ||
| 67 | struct cb_id id; | ||
| 68 | |||
| 69 | __u32 seq; | ||
| 70 | __u32 ack; | ||
| 71 | |||
| 72 | __u16 len; /* Length of the following data */ | ||
| 73 | __u16 flags; | ||
| 74 | __u8 data[0]; | ||
| 75 | }; | ||
| 76 | |||
| 77 | #endif /* _UAPI__CONNECTOR_H */ | ||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* const.h: Macros for dealing with constants. */ | ||
| 2 | |||
| 3 | #ifndef _LINUX_CONST_H | ||
| 4 | #define _LINUX_CONST_H | ||
| 5 | |||
| 6 | /* Some constant macros are used in both assembler and | ||
| 7 | * C code. Therefore we cannot annotate them always with | ||
| 8 | * 'UL' and other type specifiers unilaterally. We | ||
| 9 | * use the following macros to deal with this. | ||
| 10 | * | ||
| 11 | * Similarly, _AT() will cast an expression with a type in C, but | ||
| 12 | * leave it unchanged in asm. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifdef __ASSEMBLY__ | ||
| 16 | #define _AC(X,Y) X | ||
| 17 | #define _AT(T,X) X | ||
| 18 | #else | ||
| 19 | #define __AC(X,Y) (X##Y) | ||
| 20 | #define _AC(X,Y) __AC(X,Y) | ||
| 21 | #define _AT(T,X) ((T)(X)) | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif /* !(_LINUX_CONST_H) */ | ||
| @@ -0,0 +1,88 @@ | |||
| 1 | #ifndef _UAPI__CRAMFS_H | ||
| 2 | #define _UAPI__CRAMFS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/magic.h> | ||
| 6 | |||
| 7 | #define CRAMFS_SIGNATURE "Compressed ROMFS" | ||
| 8 | |||
| 9 | /* | ||
| 10 | * Width of various bitfields in struct cramfs_inode. | ||
| 11 | * Primarily used to generate warnings in mkcramfs. | ||
| 12 | */ | ||
| 13 | #define CRAMFS_MODE_WIDTH 16 | ||
| 14 | #define CRAMFS_UID_WIDTH 16 | ||
| 15 | #define CRAMFS_SIZE_WIDTH 24 | ||
| 16 | #define CRAMFS_GID_WIDTH 8 | ||
| 17 | #define CRAMFS_NAMELEN_WIDTH 6 | ||
| 18 | #define CRAMFS_OFFSET_WIDTH 26 | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Since inode.namelen is a unsigned 6-bit number, the maximum cramfs | ||
| 22 | * path length is 63 << 2 = 252. | ||
| 23 | */ | ||
| 24 | #define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2) | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Reasonably terse representation of the inode data. | ||
| 28 | */ | ||
| 29 | struct cramfs_inode { | ||
| 30 | __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; | ||
| 31 | /* SIZE for device files is i_rdev */ | ||
| 32 | __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; | ||
| 33 | /* NAMELEN is the length of the file name, divided by 4 and | ||
| 34 | rounded up. (cramfs doesn't support hard links.) */ | ||
| 35 | /* OFFSET: For symlinks and non-empty regular files, this | ||
| 36 | contains the offset (divided by 4) of the file data in | ||
| 37 | compressed form (starting with an array of block pointers; | ||
| 38 | see README). For non-empty directories it is the offset | ||
| 39 | (divided by 4) of the inode of the first file in that | ||
| 40 | directory. For anything else, offset is zero. */ | ||
| 41 | __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct cramfs_info { | ||
| 45 | __u32 crc; | ||
| 46 | __u32 edition; | ||
| 47 | __u32 blocks; | ||
| 48 | __u32 files; | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* | ||
| 52 | * Superblock information at the beginning of the FS. | ||
| 53 | */ | ||
| 54 | struct cramfs_super { | ||
| 55 | __u32 magic; /* 0x28cd3d45 - random number */ | ||
| 56 | __u32 size; /* length in bytes */ | ||
| 57 | __u32 flags; /* feature flags */ | ||
| 58 | __u32 future; /* reserved for future use */ | ||
| 59 | __u8 signature[16]; /* "Compressed ROMFS" */ | ||
| 60 | struct cramfs_info fsid; /* unique filesystem info */ | ||
| 61 | __u8 name[16]; /* user-defined name */ | ||
| 62 | struct cramfs_inode root; /* root inode data */ | ||
| 63 | }; | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Feature flags | ||
| 67 | * | ||
| 68 | * 0x00000000 - 0x000000ff: features that work for all past kernels | ||
| 69 | * 0x00000100 - 0xffffffff: features that don't work for past kernels | ||
| 70 | */ | ||
| 71 | #define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 /* fsid version #2 */ | ||
| 72 | #define CRAMFS_FLAG_SORTED_DIRS 0x00000002 /* sorted dirs */ | ||
| 73 | #define CRAMFS_FLAG_HOLES 0x00000100 /* support for holes */ | ||
| 74 | #define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 /* reserved */ | ||
| 75 | #define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 /* shifted root fs */ | ||
| 76 | |||
| 77 | /* | ||
| 78 | * Valid values in super.flags. Currently we refuse to mount | ||
| 79 | * if (flags & ~CRAMFS_SUPPORTED_FLAGS). Maybe that should be | ||
| 80 | * changed to test super.future instead. | ||
| 81 | */ | ||
| 82 | #define CRAMFS_SUPPORTED_FLAGS ( 0x000000ff \ | ||
| 83 | | CRAMFS_FLAG_HOLES \ | ||
| 84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ | ||
| 85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) | ||
| 86 | |||
| 87 | |||
| 88 | #endif /* _UAPI__CRAMFS_H */ | ||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for talking to the CUDA. The CUDA is a microcontroller | ||
| 3 | * which controls the ADB, system power, RTC, and various other things. | ||
| 4 | * | ||
| 5 | * Copyright (C) 1996 Paul Mackerras. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _UAPI_LINUX_CUDA_H | ||
| 9 | #define _UAPI_LINUX_CUDA_H | ||
| 10 | |||
| 11 | /* CUDA commands (2nd byte) */ | ||
| 12 | #define CUDA_WARM_START 0 | ||
| 13 | #define CUDA_AUTOPOLL 1 | ||
| 14 | #define CUDA_GET_6805_ADDR 2 | ||
| 15 | #define CUDA_GET_TIME 3 | ||
| 16 | #define CUDA_GET_PRAM 7 | ||
| 17 | #define CUDA_SET_6805_ADDR 8 | ||
| 18 | #define CUDA_SET_TIME 9 | ||
| 19 | #define CUDA_POWERDOWN 0xa | ||
| 20 | #define CUDA_POWERUP_TIME 0xb | ||
| 21 | #define CUDA_SET_PRAM 0xc | ||
| 22 | #define CUDA_MS_RESET 0xd | ||
| 23 | #define CUDA_SEND_DFAC 0xe | ||
| 24 | #define CUDA_RESET_SYSTEM 0x11 | ||
| 25 | #define CUDA_SET_IPL 0x12 | ||
| 26 | #define CUDA_SET_AUTO_RATE 0x14 | ||
| 27 | #define CUDA_GET_AUTO_RATE 0x16 | ||
| 28 | #define CUDA_SET_DEVICE_LIST 0x19 | ||
| 29 | #define CUDA_GET_DEVICE_LIST 0x1a | ||
| 30 | #define CUDA_GET_SET_IIC 0x22 | ||
| 31 | |||
| 32 | |||
| 33 | #endif /* _UAPI_LINUX_CUDA_H */ | ||
| @@ -0,0 +1,493 @@ | |||
| 1 | /* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $ | ||
| 2 | * linux/include/linux/cyclades.h | ||
| 3 | * | ||
| 4 | * This file was initially written by | ||
| 5 | * Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by | ||
| 6 | * Ivan Passos <ivan@cyclades.com>. | ||
| 7 | * | ||
| 8 | * This file contains the general definitions for the cyclades.c driver | ||
| 9 | *$Log: cyclades.h,v $ | ||
| 10 | *Revision 3.1 2002/01/29 11:36:16 henrique | ||
| 11 | *added throttle field on struct cyclades_port to indicate whether the | ||
| 12 | *port is throttled or not | ||
| 13 | * | ||
| 14 | *Revision 3.1 2000/04/19 18:52:52 ivan | ||
| 15 | *converted address fields to unsigned long and added fields for physical | ||
| 16 | *addresses on cyclades_card structure; | ||
| 17 | * | ||
| 18 | *Revision 3.0 1998/11/02 14:20:59 ivan | ||
| 19 | *added nports field on cyclades_card structure; | ||
| 20 | * | ||
| 21 | *Revision 2.5 1998/08/03 16:57:01 ivan | ||
| 22 | *added cyclades_idle_stats structure; | ||
| 23 | * | ||
| 24 | *Revision 2.4 1998/06/01 12:09:53 ivan | ||
| 25 | *removed closing_wait2 from cyclades_port structure; | ||
| 26 | * | ||
| 27 | *Revision 2.3 1998/03/16 18:01:12 ivan | ||
| 28 | *changes in the cyclades_port structure to get it closer to the | ||
| 29 | *standard serial port structure; | ||
| 30 | *added constants for new ioctls; | ||
| 31 | * | ||
| 32 | *Revision 2.2 1998/02/17 16:50:00 ivan | ||
| 33 | *changes in the cyclades_port structure (addition of shutdown_wait and | ||
| 34 | *chip_rev variables); | ||
| 35 | *added constants for new ioctls and for CD1400 rev. numbers. | ||
| 36 | * | ||
| 37 | *Revision 2.1 1997/10/24 16:03:00 ivan | ||
| 38 | *added rflow (which allows enabling the CD1400 special flow control | ||
| 39 | *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to | ||
| 40 | *cyclades_port structure; | ||
| 41 | *added Alpha support | ||
| 42 | * | ||
| 43 | *Revision 2.0 1997/06/30 10:30:00 ivan | ||
| 44 | *added some new doorbell command constants related to IOCTLW and | ||
| 45 | *UART error signaling | ||
| 46 | * | ||
| 47 | *Revision 1.8 1997/06/03 15:30:00 ivan | ||
| 48 | *added constant ZFIRM_HLT | ||
| 49 | *added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin) | ||
| 50 | * | ||
| 51 | *Revision 1.7 1997/03/26 10:30:00 daniel | ||
| 52 | *new entries at the end of cyclades_port struct to reallocate | ||
| 53 | *variables illegally allocated within card memory. | ||
| 54 | * | ||
| 55 | *Revision 1.6 1996/09/09 18:35:30 bentson | ||
| 56 | *fold in changes for Cyclom-Z -- including structures for | ||
| 57 | *communicating with board as well modest changes to original | ||
| 58 | *structures to support new features. | ||
| 59 | * | ||
| 60 | *Revision 1.5 1995/11/13 21:13:31 bentson | ||
| 61 | *changes suggested by Michael Chastain <mec@duracef.shout.net> | ||
| 62 | *to support use of this file in non-kernel applications | ||
| 63 | * | ||
| 64 | * | ||
| 65 | */ | ||
| 66 | |||
| 67 | #ifndef _UAPI_LINUX_CYCLADES_H | ||
| 68 | #define _UAPI_LINUX_CYCLADES_H | ||
| 69 | |||
| 70 | #include <linux/types.h> | ||
| 71 | |||
| 72 | struct cyclades_monitor { | ||
| 73 | unsigned long int_count; | ||
| 74 | unsigned long char_count; | ||
| 75 | unsigned long char_max; | ||
| 76 | unsigned long char_last; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * These stats all reflect activity since the device was last initialized. | ||
| 81 | * (i.e., since the port was opened with no other processes already having it | ||
| 82 | * open) | ||
| 83 | */ | ||
| 84 | struct cyclades_idle_stats { | ||
| 85 | __kernel_time_t in_use; /* Time device has been in use (secs) */ | ||
| 86 | __kernel_time_t recv_idle; /* Time since last char received (secs) */ | ||
| 87 | __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */ | ||
| 88 | unsigned long recv_bytes; /* Bytes received */ | ||
| 89 | unsigned long xmit_bytes; /* Bytes transmitted */ | ||
| 90 | unsigned long overruns; /* Input overruns */ | ||
| 91 | unsigned long frame_errs; /* Input framing errors */ | ||
| 92 | unsigned long parity_errs; /* Input parity errors */ | ||
| 93 | }; | ||
| 94 | |||
| 95 | #define CYCLADES_MAGIC 0x4359 | ||
| 96 | |||
| 97 | #define CYGETMON 0x435901 | ||
| 98 | #define CYGETTHRESH 0x435902 | ||
| 99 | #define CYSETTHRESH 0x435903 | ||
| 100 | #define CYGETDEFTHRESH 0x435904 | ||
| 101 | #define CYSETDEFTHRESH 0x435905 | ||
| 102 | #define CYGETTIMEOUT 0x435906 | ||
| 103 | #define CYSETTIMEOUT 0x435907 | ||
| 104 | #define CYGETDEFTIMEOUT 0x435908 | ||
| 105 | #define CYSETDEFTIMEOUT 0x435909 | ||
| 106 | #define CYSETRFLOW 0x43590a | ||
| 107 | #define CYGETRFLOW 0x43590b | ||
| 108 | #define CYSETRTSDTR_INV 0x43590c | ||
| 109 | #define CYGETRTSDTR_INV 0x43590d | ||
| 110 | #define CYZSETPOLLCYCLE 0x43590e | ||
| 111 | #define CYZGETPOLLCYCLE 0x43590f | ||
| 112 | #define CYGETCD1400VER 0x435910 | ||
| 113 | #define CYSETWAIT 0x435912 | ||
| 114 | #define CYGETWAIT 0x435913 | ||
| 115 | |||
| 116 | /*************** CYCLOM-Z ADDITIONS ***************/ | ||
| 117 | |||
| 118 | #define CZIOC ('M' << 8) | ||
| 119 | #define CZ_NBOARDS (CZIOC|0xfa) | ||
| 120 | #define CZ_BOOT_START (CZIOC|0xfb) | ||
| 121 | #define CZ_BOOT_DATA (CZIOC|0xfc) | ||
| 122 | #define CZ_BOOT_END (CZIOC|0xfd) | ||
| 123 | #define CZ_TEST (CZIOC|0xfe) | ||
| 124 | |||
| 125 | #define CZ_DEF_POLL (HZ/25) | ||
| 126 | |||
| 127 | #define MAX_BOARD 4 /* Max number of boards */ | ||
| 128 | #define MAX_DEV 256 /* Max number of ports total */ | ||
| 129 | #define CYZ_MAX_SPEED 921600 | ||
| 130 | |||
| 131 | #define CYZ_FIFO_SIZE 16 | ||
| 132 | |||
| 133 | #define CYZ_BOOT_NWORDS 0x100 | ||
| 134 | struct CYZ_BOOT_CTRL { | ||
| 135 | unsigned short nboard; | ||
| 136 | int status[MAX_BOARD]; | ||
| 137 | int nchannel[MAX_BOARD]; | ||
| 138 | int fw_rev[MAX_BOARD]; | ||
| 139 | unsigned long offset; | ||
| 140 | unsigned long data[CYZ_BOOT_NWORDS]; | ||
| 141 | }; | ||
| 142 | |||
| 143 | |||
| 144 | #ifndef DP_WINDOW_SIZE | ||
| 145 | /* | ||
| 146 | * Memory Window Sizes | ||
| 147 | */ | ||
| 148 | |||
| 149 | #define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */ | ||
| 150 | #define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and | ||
| 151 | 8Zo V.2 */ | ||
| 152 | #define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */ | ||
| 153 | |||
| 154 | /* | ||
| 155 | * CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver | ||
| 156 | * normally will access only interested on the fpga_id, fpga_version, | ||
| 157 | * start_cpu and stop_cpu. | ||
| 158 | */ | ||
| 159 | |||
| 160 | struct CUSTOM_REG { | ||
| 161 | __u32 fpga_id; /* FPGA Identification Register */ | ||
| 162 | __u32 fpga_version; /* FPGA Version Number Register */ | ||
| 163 | __u32 cpu_start; /* CPU start Register (write) */ | ||
| 164 | __u32 cpu_stop; /* CPU stop Register (write) */ | ||
| 165 | __u32 misc_reg; /* Miscellaneous Register */ | ||
| 166 | __u32 idt_mode; /* IDT mode Register */ | ||
| 167 | __u32 uart_irq_status; /* UART IRQ status Register */ | ||
| 168 | __u32 clear_timer0_irq; /* Clear timer interrupt Register */ | ||
| 169 | __u32 clear_timer1_irq; /* Clear timer interrupt Register */ | ||
| 170 | __u32 clear_timer2_irq; /* Clear timer interrupt Register */ | ||
| 171 | __u32 test_register; /* Test Register */ | ||
| 172 | __u32 test_count; /* Test Count Register */ | ||
| 173 | __u32 timer_select; /* Timer select register */ | ||
| 174 | __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */ | ||
| 175 | __u32 ram_wait_state; /* RAM wait-state Register */ | ||
| 176 | __u32 uart_wait_state; /* UART wait-state Register */ | ||
| 177 | __u32 timer_wait_state; /* timer wait-state Register */ | ||
| 178 | __u32 ack_wait_state; /* ACK wait State Register */ | ||
| 179 | }; | ||
| 180 | |||
| 181 | /* | ||
| 182 | * RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime | ||
| 183 | * registers. This structure can be used to access the 9060 registers | ||
| 184 | * (memory mapped). | ||
| 185 | */ | ||
| 186 | |||
| 187 | struct RUNTIME_9060 { | ||
| 188 | __u32 loc_addr_range; /* 00h - Local Address Range */ | ||
| 189 | __u32 loc_addr_base; /* 04h - Local Address Base */ | ||
| 190 | __u32 loc_arbitr; /* 08h - Local Arbitration */ | ||
| 191 | __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */ | ||
| 192 | __u32 loc_rom_range; /* 10h - Local ROM Range */ | ||
| 193 | __u32 loc_rom_base; /* 14h - Local ROM Base */ | ||
| 194 | __u32 loc_bus_descr; /* 18h - Local Bus descriptor */ | ||
| 195 | __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */ | ||
| 196 | __u32 loc_base_mst; /* 20h - Local Base for Master PCI */ | ||
| 197 | __u32 loc_range_io; /* 24h - Local Range for Master IO */ | ||
| 198 | __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */ | ||
| 199 | __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */ | ||
| 200 | __u32 filler1; /* 30h */ | ||
| 201 | __u32 filler2; /* 34h */ | ||
| 202 | __u32 filler3; /* 38h */ | ||
| 203 | __u32 filler4; /* 3Ch */ | ||
| 204 | __u32 mail_box_0; /* 40h - Mail Box 0 */ | ||
| 205 | __u32 mail_box_1; /* 44h - Mail Box 1 */ | ||
| 206 | __u32 mail_box_2; /* 48h - Mail Box 2 */ | ||
| 207 | __u32 mail_box_3; /* 4Ch - Mail Box 3 */ | ||
| 208 | __u32 filler5; /* 50h */ | ||
| 209 | __u32 filler6; /* 54h */ | ||
| 210 | __u32 filler7; /* 58h */ | ||
| 211 | __u32 filler8; /* 5Ch */ | ||
| 212 | __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */ | ||
| 213 | __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */ | ||
| 214 | __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */ | ||
| 215 | __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */ | ||
| 216 | }; | ||
| 217 | |||
| 218 | /* Values for the Local Base Address re-map register */ | ||
| 219 | |||
| 220 | #define WIN_RAM 0x00000001L /* set the sliding window to RAM */ | ||
| 221 | #define WIN_CREG 0x14000001L /* set the window to custom Registers */ | ||
| 222 | |||
| 223 | /* Values timer select registers */ | ||
| 224 | |||
| 225 | #define TIMER_BY_1M 0x00 /* clock divided by 1M */ | ||
| 226 | #define TIMER_BY_256K 0x01 /* clock divided by 256k */ | ||
| 227 | #define TIMER_BY_128K 0x02 /* clock divided by 128k */ | ||
| 228 | #define TIMER_BY_32K 0x03 /* clock divided by 32k */ | ||
| 229 | |||
| 230 | /****************** ****************** *******************/ | ||
| 231 | #endif | ||
| 232 | |||
| 233 | #ifndef ZFIRM_ID | ||
| 234 | /* #include "zfwint.h" */ | ||
| 235 | /****************** ****************** *******************/ | ||
| 236 | /* | ||
| 237 | * This file contains the definitions for interfacing with the | ||
| 238 | * Cyclom-Z ZFIRM Firmware. | ||
| 239 | */ | ||
| 240 | |||
| 241 | /* General Constant definitions */ | ||
| 242 | |||
| 243 | #define MAX_CHAN 64 /* max number of channels per board */ | ||
| 244 | |||
| 245 | /* firmware id structure (set after boot) */ | ||
| 246 | |||
| 247 | #define ID_ADDRESS 0x00000180L /* signature/pointer address */ | ||
| 248 | #define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */ | ||
| 249 | #define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */ | ||
| 250 | #define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */ | ||
| 251 | |||
| 252 | #define ZF_TINACT_DEF 1000 /* default inactivity timeout | ||
| 253 | (1000 ms) */ | ||
| 254 | #define ZF_TINACT ZF_TINACT_DEF | ||
| 255 | |||
| 256 | struct FIRM_ID { | ||
| 257 | __u32 signature; /* ZFIRM/U signature */ | ||
| 258 | __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */ | ||
| 259 | }; | ||
| 260 | |||
| 261 | /* Op. System id */ | ||
| 262 | |||
| 263 | #define C_OS_LINUX 0x00000030 /* generic Linux system */ | ||
| 264 | |||
| 265 | /* channel op_mode */ | ||
| 266 | |||
| 267 | #define C_CH_DISABLE 0x00000000 /* channel is disabled */ | ||
| 268 | #define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */ | ||
| 269 | #define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */ | ||
| 270 | #define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */ | ||
| 271 | #define C_CH_LOOPBACK 0x00000004 /* Loopback mode */ | ||
| 272 | |||
| 273 | /* comm_parity - parity */ | ||
| 274 | |||
| 275 | #define C_PR_NONE 0x00000000 /* None */ | ||
| 276 | #define C_PR_ODD 0x00000001 /* Odd */ | ||
| 277 | #define C_PR_EVEN 0x00000002 /* Even */ | ||
| 278 | #define C_PR_MARK 0x00000004 /* Mark */ | ||
| 279 | #define C_PR_SPACE 0x00000008 /* Space */ | ||
| 280 | #define C_PR_PARITY 0x000000ff | ||
| 281 | |||
| 282 | #define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */ | ||
| 283 | #define C_PR_IGNORE 0x00000200 /* ignore frame/par error */ | ||
| 284 | |||
| 285 | /* comm_data_l - data length and stop bits */ | ||
| 286 | |||
| 287 | #define C_DL_CS5 0x00000001 | ||
| 288 | #define C_DL_CS6 0x00000002 | ||
| 289 | #define C_DL_CS7 0x00000004 | ||
| 290 | #define C_DL_CS8 0x00000008 | ||
| 291 | #define C_DL_CS 0x0000000f | ||
| 292 | #define C_DL_1STOP 0x00000010 | ||
| 293 | #define C_DL_15STOP 0x00000020 | ||
| 294 | #define C_DL_2STOP 0x00000040 | ||
| 295 | #define C_DL_STOP 0x000000f0 | ||
| 296 | |||
| 297 | /* interrupt enabling/status */ | ||
| 298 | |||
| 299 | #define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */ | ||
| 300 | #define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */ | ||
| 301 | #define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */ | ||
| 302 | #define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */ | ||
| 303 | #define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */ | ||
| 304 | #define C_IN_MDCD 0x00000100 /* modem DCD change */ | ||
| 305 | #define C_IN_MDSR 0x00000200 /* modem DSR change */ | ||
| 306 | #define C_IN_MRI 0x00000400 /* modem RI change */ | ||
| 307 | #define C_IN_MCTS 0x00000800 /* modem CTS change */ | ||
| 308 | #define C_IN_RXBRK 0x00001000 /* Break received */ | ||
| 309 | #define C_IN_PR_ERROR 0x00002000 /* parity error */ | ||
| 310 | #define C_IN_FR_ERROR 0x00004000 /* frame error */ | ||
| 311 | #define C_IN_OVR_ERROR 0x00008000 /* overrun error */ | ||
| 312 | #define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ | ||
| 313 | #define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ | ||
| 314 | #define C_IN_MRTS 0x00040000 /* modem RTS drop */ | ||
| 315 | #define C_IN_ICHAR 0x00080000 | ||
| 316 | |||
| 317 | /* flow control */ | ||
| 318 | |||
| 319 | #define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */ | ||
| 320 | #define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */ | ||
| 321 | #define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */ | ||
| 322 | #define C_FL_SWFLOW 0x0000000f | ||
| 323 | |||
| 324 | /* flow status */ | ||
| 325 | |||
| 326 | #define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */ | ||
| 327 | #define C_FS_SENDING 0x00000001 /* UART is sending data */ | ||
| 328 | #define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */ | ||
| 329 | |||
| 330 | /* rs_control/rs_status RS-232 signals */ | ||
| 331 | |||
| 332 | #define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in | ||
| 333 | IOCTLM command */ | ||
| 334 | #define C_RS_RTS 0x00000001 /* RTS */ | ||
| 335 | #define C_RS_DTR 0x00000004 /* DTR */ | ||
| 336 | #define C_RS_DCD 0x00000100 /* CD */ | ||
| 337 | #define C_RS_DSR 0x00000200 /* DSR */ | ||
| 338 | #define C_RS_RI 0x00000400 /* RI */ | ||
| 339 | #define C_RS_CTS 0x00000800 /* CTS */ | ||
| 340 | |||
| 341 | /* commands Host <-> Board */ | ||
| 342 | |||
| 343 | #define C_CM_RESET 0x01 /* reset/flush buffers */ | ||
| 344 | #define C_CM_IOCTL 0x02 /* re-read CH_CTRL */ | ||
| 345 | #define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */ | ||
| 346 | #define C_CM_IOCTLM 0x04 /* RS-232 outputs change */ | ||
| 347 | #define C_CM_SENDXOFF 0x10 /* send Xoff */ | ||
| 348 | #define C_CM_SENDXON 0x11 /* send Xon */ | ||
| 349 | #define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */ | ||
| 350 | #define C_CM_SENDBRK 0x41 /* send break */ | ||
| 351 | #define C_CM_INTBACK 0x42 /* Interrupt back */ | ||
| 352 | #define C_CM_SET_BREAK 0x43 /* Tx break on */ | ||
| 353 | #define C_CM_CLR_BREAK 0x44 /* Tx break off */ | ||
| 354 | #define C_CM_CMD_DONE 0x45 /* Previous command done */ | ||
| 355 | #define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */ | ||
| 356 | #define C_CM_TINACT 0x51 /* set inactivity detection */ | ||
| 357 | #define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */ | ||
| 358 | #define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */ | ||
| 359 | #define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */ | ||
| 360 | #define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */ | ||
| 361 | #define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */ | ||
| 362 | #define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */ | ||
| 363 | #define C_CM_Q_ENABLE 0x58 /* enables queue access from the | ||
| 364 | driver */ | ||
| 365 | #define C_CM_Q_DISABLE 0x59 /* disables queue access from the | ||
| 366 | driver */ | ||
| 367 | |||
| 368 | #define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */ | ||
| 369 | #define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */ | ||
| 370 | #define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */ | ||
| 371 | #define C_CM_RXNNDT 0x63 /* rx no new data timeout */ | ||
| 372 | #define C_CM_TXFEMPTY 0x64 | ||
| 373 | #define C_CM_ICHAR 0x65 | ||
| 374 | #define C_CM_MDCD 0x70 /* modem DCD change */ | ||
| 375 | #define C_CM_MDSR 0x71 /* modem DSR change */ | ||
| 376 | #define C_CM_MRI 0x72 /* modem RI change */ | ||
| 377 | #define C_CM_MCTS 0x73 /* modem CTS change */ | ||
| 378 | #define C_CM_MRTS 0x74 /* modem RTS drop */ | ||
| 379 | #define C_CM_RXBRK 0x84 /* Break received */ | ||
| 380 | #define C_CM_PR_ERROR 0x85 /* Parity error */ | ||
| 381 | #define C_CM_FR_ERROR 0x86 /* Frame error */ | ||
| 382 | #define C_CM_OVR_ERROR 0x87 /* Overrun error */ | ||
| 383 | #define C_CM_RXOFL 0x88 /* RX buffer overflow */ | ||
| 384 | #define C_CM_CMDERROR 0x90 /* command error */ | ||
| 385 | #define C_CM_FATAL 0x91 /* fatal error */ | ||
| 386 | #define C_CM_HW_RESET 0x92 /* reset board */ | ||
| 387 | |||
| 388 | /* | ||
| 389 | * CH_CTRL - This per port structure contains all parameters | ||
| 390 | * that control an specific port. It can be seen as the | ||
| 391 | * configuration registers of a "super-serial-controller". | ||
| 392 | */ | ||
| 393 | |||
| 394 | struct CH_CTRL { | ||
| 395 | __u32 op_mode; /* operation mode */ | ||
| 396 | __u32 intr_enable; /* interrupt masking */ | ||
| 397 | __u32 sw_flow; /* SW flow control */ | ||
| 398 | __u32 flow_status; /* output flow status */ | ||
| 399 | __u32 comm_baud; /* baud rate - numerically specified */ | ||
| 400 | __u32 comm_parity; /* parity */ | ||
| 401 | __u32 comm_data_l; /* data length/stop */ | ||
| 402 | __u32 comm_flags; /* other flags */ | ||
| 403 | __u32 hw_flow; /* HW flow control */ | ||
| 404 | __u32 rs_control; /* RS-232 outputs */ | ||
| 405 | __u32 rs_status; /* RS-232 inputs */ | ||
| 406 | __u32 flow_xon; /* xon char */ | ||
| 407 | __u32 flow_xoff; /* xoff char */ | ||
| 408 | __u32 hw_overflow; /* hw overflow counter */ | ||
| 409 | __u32 sw_overflow; /* sw overflow counter */ | ||
| 410 | __u32 comm_error; /* frame/parity error counter */ | ||
| 411 | __u32 ichar; | ||
| 412 | __u32 filler[7]; | ||
| 413 | }; | ||
| 414 | |||
| 415 | |||
| 416 | /* | ||
| 417 | * BUF_CTRL - This per channel structure contains | ||
| 418 | * all Tx and Rx buffer control for a given channel. | ||
| 419 | */ | ||
| 420 | |||
| 421 | struct BUF_CTRL { | ||
| 422 | __u32 flag_dma; /* buffers are in Host memory */ | ||
| 423 | __u32 tx_bufaddr; /* address of the tx buffer */ | ||
| 424 | __u32 tx_bufsize; /* tx buffer size */ | ||
| 425 | __u32 tx_threshold; /* tx low water mark */ | ||
| 426 | __u32 tx_get; /* tail index tx buf */ | ||
| 427 | __u32 tx_put; /* head index tx buf */ | ||
| 428 | __u32 rx_bufaddr; /* address of the rx buffer */ | ||
| 429 | __u32 rx_bufsize; /* rx buffer size */ | ||
| 430 | __u32 rx_threshold; /* rx high water mark */ | ||
| 431 | __u32 rx_get; /* tail index rx buf */ | ||
| 432 | __u32 rx_put; /* head index rx buf */ | ||
| 433 | __u32 filler[5]; /* filler to align structures */ | ||
| 434 | }; | ||
| 435 | |||
| 436 | /* | ||
| 437 | * BOARD_CTRL - This per board structure contains all global | ||
| 438 | * control fields related to the board. | ||
| 439 | */ | ||
| 440 | |||
| 441 | struct BOARD_CTRL { | ||
| 442 | |||
| 443 | /* static info provided by the on-board CPU */ | ||
| 444 | __u32 n_channel; /* number of channels */ | ||
| 445 | __u32 fw_version; /* firmware version */ | ||
| 446 | |||
| 447 | /* static info provided by the driver */ | ||
| 448 | __u32 op_system; /* op_system id */ | ||
| 449 | __u32 dr_version; /* driver version */ | ||
| 450 | |||
| 451 | /* board control area */ | ||
| 452 | __u32 inactivity; /* inactivity control */ | ||
| 453 | |||
| 454 | /* host to FW commands */ | ||
| 455 | __u32 hcmd_channel; /* channel number */ | ||
| 456 | __u32 hcmd_param; /* pointer to parameters */ | ||
| 457 | |||
| 458 | /* FW to Host commands */ | ||
| 459 | __u32 fwcmd_channel; /* channel number */ | ||
| 460 | __u32 fwcmd_param; /* pointer to parameters */ | ||
| 461 | __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */ | ||
| 462 | |||
| 463 | /* filler so the structures are aligned */ | ||
| 464 | __u32 filler[6]; | ||
| 465 | }; | ||
| 466 | |||
| 467 | /* Host Interrupt Queue */ | ||
| 468 | |||
| 469 | #define QUEUE_SIZE (10*MAX_CHAN) | ||
| 470 | |||
| 471 | struct INT_QUEUE { | ||
| 472 | unsigned char intr_code[QUEUE_SIZE]; | ||
| 473 | unsigned long channel[QUEUE_SIZE]; | ||
| 474 | unsigned long param[QUEUE_SIZE]; | ||
| 475 | unsigned long put; | ||
| 476 | unsigned long get; | ||
| 477 | }; | ||
| 478 | |||
| 479 | /* | ||
| 480 | * ZFW_CTRL - This is the data structure that includes all other | ||
| 481 | * data structures used by the Firmware. | ||
| 482 | */ | ||
| 483 | |||
| 484 | struct ZFW_CTRL { | ||
| 485 | struct BOARD_CTRL board_ctrl; | ||
| 486 | struct CH_CTRL ch_ctrl[MAX_CHAN]; | ||
| 487 | struct BUF_CTRL buf_ctrl[MAX_CHAN]; | ||
| 488 | }; | ||
| 489 | |||
| 490 | /****************** ****************** *******************/ | ||
| 491 | #endif | ||
| 492 | |||
| 493 | #endif /* _UAPI_LINUX_CYCLADES_H */ | ||
| @@ -0,0 +1,101 @@ | |||
| 1 | /* | ||
| 2 | * cycx_cfm.h Cyclom 2X WAN Link Driver. | ||
| 3 | * Definitions for the Cyclom 2X Firmware Module (CFM). | ||
| 4 | * | ||
| 5 | * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br> | ||
| 6 | * | ||
| 7 | * Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo | ||
| 8 | * | ||
| 9 | * Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or | ||
| 12 | * modify it under the terms of the GNU General Public License | ||
| 13 | * as published by the Free Software Foundation; either version | ||
| 14 | * 2 of the License, or (at your option) any later version. | ||
| 15 | * ============================================================================ | ||
| 16 | * 1998/08/08 acme Initial version. | ||
| 17 | */ | ||
| 18 | #ifndef _CYCX_CFM_H | ||
| 19 | #define _CYCX_CFM_H | ||
| 20 | |||
| 21 | /* Defines */ | ||
| 22 | |||
| 23 | #define CFM_VERSION 2 | ||
| 24 | #define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module" | ||
| 25 | |||
| 26 | /* min/max */ | ||
| 27 | #define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */ | ||
| 28 | #define CFM_DESCR_LEN 256 /* max length of description string */ | ||
| 29 | #define CFM_MAX_CYCX 1 /* max number of compatible adapters */ | ||
| 30 | #define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */ | ||
| 31 | |||
| 32 | /* Firmware Commands */ | ||
| 33 | #define GEN_POWER_ON 0x1280 | ||
| 34 | |||
| 35 | #define GEN_SET_SEG 0x1401 /* boot segment setting. */ | ||
| 36 | #define GEN_BOOT_DAT 0x1402 /* boot data. */ | ||
| 37 | #define GEN_START 0x1403 /* board start. */ | ||
| 38 | #define GEN_DEFPAR 0x1404 /* buffer length for boot. */ | ||
| 39 | |||
| 40 | /* Adapter Types */ | ||
| 41 | #define CYCX_2X 2 | ||
| 42 | /* for now only the 2X is supported, no plans to support 8X or 16X */ | ||
| 43 | #define CYCX_8X 8 | ||
| 44 | #define CYCX_16X 16 | ||
| 45 | |||
| 46 | #define CFID_X25_2X 5200 | ||
| 47 | |||
| 48 | /** | ||
| 49 | * struct cycx_fw_info - firmware module information. | ||
| 50 | * @codeid - firmware ID | ||
| 51 | * @version - firmware version number | ||
| 52 | * @adapter - compatible adapter types | ||
| 53 | * @memsize - minimum memory size | ||
| 54 | * @reserved - reserved | ||
| 55 | * @startoffs - entry point offset | ||
| 56 | * @winoffs - dual-port memory window offset | ||
| 57 | * @codeoffs - code load offset | ||
| 58 | * @codesize - code size | ||
| 59 | * @dataoffs - configuration data load offset | ||
| 60 | * @datasize - configuration data size | ||
| 61 | */ | ||
| 62 | struct cycx_fw_info { | ||
| 63 | unsigned short codeid; | ||
| 64 | unsigned short version; | ||
| 65 | unsigned short adapter[CFM_MAX_CYCX]; | ||
| 66 | unsigned long memsize; | ||
| 67 | unsigned short reserved[2]; | ||
| 68 | unsigned short startoffs; | ||
| 69 | unsigned short winoffs; | ||
| 70 | unsigned short codeoffs; | ||
| 71 | unsigned long codesize; | ||
| 72 | unsigned short dataoffs; | ||
| 73 | unsigned long datasize; | ||
| 74 | }; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * struct cycx_firmware - CYCX firmware file structure | ||
| 78 | * @signature - CFM file signature | ||
| 79 | * @version - file format version | ||
| 80 | * @checksum - info + image | ||
| 81 | * @reserved - reserved | ||
| 82 | * @descr - description string | ||
| 83 | * @info - firmware module info | ||
| 84 | * @image - code image (variable size) | ||
| 85 | */ | ||
| 86 | struct cycx_firmware { | ||
| 87 | char signature[80]; | ||
| 88 | unsigned short version; | ||
| 89 | unsigned short checksum; | ||
| 90 | unsigned short reserved[6]; | ||
| 91 | char descr[CFM_DESCR_LEN]; | ||
| 92 | struct cycx_fw_info info; | ||
| 93 | unsigned char image[0]; | ||
| 94 | }; | ||
| 95 | |||
| 96 | struct cycx_fw_header { | ||
| 97 | unsigned long reset_size; | ||
| 98 | unsigned long data_size; | ||
| 99 | unsigned long code_size; | ||
| 100 | }; | ||
| 101 | #endif /* _CYCX_CFM_H */ | ||
| @@ -0,0 +1,684 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2008-2011, Intel Corporation. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License along with | ||
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 16 | * | ||
| 17 | * Author: Lucy Liu <lucy.liu@intel.com> | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __LINUX_DCBNL_H__ | ||
| 21 | #define __LINUX_DCBNL_H__ | ||
| 22 | |||
| 23 | #include <linux/types.h> | ||
| 24 | |||
| 25 | /* IEEE 802.1Qaz std supported values */ | ||
| 26 | #define IEEE_8021QAZ_MAX_TCS 8 | ||
| 27 | |||
| 28 | #define IEEE_8021QAZ_TSA_STRICT 0 | ||
| 29 | #define IEEE_8021QAZ_TSA_CB_SHAPER 1 | ||
| 30 | #define IEEE_8021QAZ_TSA_ETS 2 | ||
| 31 | #define IEEE_8021QAZ_TSA_VENDOR 255 | ||
| 32 | |||
| 33 | /* This structure contains the IEEE 802.1Qaz ETS managed object | ||
| 34 | * | ||
| 35 | * @willing: willing bit in ETS configuration TLV | ||
| 36 | * @ets_cap: indicates supported capacity of ets feature | ||
| 37 | * @cbs: credit based shaper ets algorithm supported | ||
| 38 | * @tc_tx_bw: tc tx bandwidth indexed by traffic class | ||
| 39 | * @tc_rx_bw: tc rx bandwidth indexed by traffic class | ||
| 40 | * @tc_tsa: TSA Assignment table, indexed by traffic class | ||
| 41 | * @prio_tc: priority assignment table mapping 8021Qp to traffic class | ||
| 42 | * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV | ||
| 43 | * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV | ||
| 44 | * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV | ||
| 45 | * | ||
| 46 | * Recommended values are used to set fields in the ETS recommendation TLV | ||
| 47 | * with hardware offloaded LLDP. | ||
| 48 | * | ||
| 49 | * ---- | ||
| 50 | * TSA Assignment 8 bit identifiers | ||
| 51 | * 0 strict priority | ||
| 52 | * 1 credit-based shaper | ||
| 53 | * 2 enhanced transmission selection | ||
| 54 | * 3-254 reserved | ||
| 55 | * 255 vendor specific | ||
| 56 | */ | ||
| 57 | struct ieee_ets { | ||
| 58 | __u8 willing; | ||
| 59 | __u8 ets_cap; | ||
| 60 | __u8 cbs; | ||
| 61 | __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
| 62 | __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
| 63 | __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
| 64 | __u8 prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
| 65 | __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS]; | ||
| 66 | __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
| 67 | __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
| 68 | }; | ||
| 69 | |||
| 70 | /* This structure contains rate limit extension to the IEEE 802.1Qaz ETS | ||
| 71 | * managed object. | ||
| 72 | * Values are 64 bits long and specified in Kbps to enable usage over both | ||
| 73 | * slow and very fast networks. | ||
| 74 | * | ||
| 75 | * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class | ||
| 76 | */ | ||
| 77 | struct ieee_maxrate { | ||
| 78 | __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS]; | ||
| 79 | }; | ||
| 80 | |||
| 81 | /* This structure contains the IEEE 802.1Qaz PFC managed object | ||
| 82 | * | ||
| 83 | * @pfc_cap: Indicates the number of traffic classes on the local device | ||
| 84 | * that may simultaneously have PFC enabled. | ||
| 85 | * @pfc_en: bitmap indicating pfc enabled traffic classes | ||
| 86 | * @mbc: enable macsec bypass capability | ||
| 87 | * @delay: the allowance made for a round-trip propagation delay of the | ||
| 88 | * link in bits. | ||
| 89 | * @requests: count of the sent pfc frames | ||
| 90 | * @indications: count of the received pfc frames | ||
| 91 | */ | ||
| 92 | struct ieee_pfc { | ||
| 93 | __u8 pfc_cap; | ||
| 94 | __u8 pfc_en; | ||
| 95 | __u8 mbc; | ||
| 96 | __u16 delay; | ||
| 97 | __u64 requests[IEEE_8021QAZ_MAX_TCS]; | ||
| 98 | __u64 indications[IEEE_8021QAZ_MAX_TCS]; | ||
| 99 | }; | ||
| 100 | |||
| 101 | /* CEE DCBX std supported values */ | ||
| 102 | #define CEE_DCBX_MAX_PGS 8 | ||
| 103 | #define CEE_DCBX_MAX_PRIO 8 | ||
| 104 | |||
| 105 | /** | ||
| 106 | * struct cee_pg - CEE Priority-Group managed object | ||
| 107 | * | ||
| 108 | * @willing: willing bit in the PG tlv | ||
| 109 | * @error: error bit in the PG tlv | ||
| 110 | * @pg_en: enable bit of the PG feature | ||
| 111 | * @tcs_supported: number of traffic classes supported | ||
| 112 | * @pg_bw: bandwidth percentage for each priority group | ||
| 113 | * @prio_pg: priority to PG mapping indexed by priority | ||
| 114 | */ | ||
| 115 | struct cee_pg { | ||
| 116 | __u8 willing; | ||
| 117 | __u8 error; | ||
| 118 | __u8 pg_en; | ||
| 119 | __u8 tcs_supported; | ||
| 120 | __u8 pg_bw[CEE_DCBX_MAX_PGS]; | ||
| 121 | __u8 prio_pg[CEE_DCBX_MAX_PGS]; | ||
| 122 | }; | ||
| 123 | |||
| 124 | /** | ||
| 125 | * struct cee_pfc - CEE PFC managed object | ||
| 126 | * | ||
| 127 | * @willing: willing bit in the PFC tlv | ||
| 128 | * @error: error bit in the PFC tlv | ||
| 129 | * @pfc_en: bitmap indicating pfc enabled traffic classes | ||
| 130 | * @tcs_supported: number of traffic classes supported | ||
| 131 | */ | ||
| 132 | struct cee_pfc { | ||
| 133 | __u8 willing; | ||
| 134 | __u8 error; | ||
| 135 | __u8 pfc_en; | ||
| 136 | __u8 tcs_supported; | ||
| 137 | }; | ||
| 138 | |||
| 139 | /* IEEE 802.1Qaz std supported values */ | ||
| 140 | #define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1 | ||
| 141 | #define IEEE_8021QAZ_APP_SEL_STREAM 2 | ||
| 142 | #define IEEE_8021QAZ_APP_SEL_DGRAM 3 | ||
| 143 | #define IEEE_8021QAZ_APP_SEL_ANY 4 | ||
| 144 | |||
| 145 | /* This structure contains the IEEE 802.1Qaz APP managed object. This | ||
| 146 | * object is also used for the CEE std as well. There is no difference | ||
| 147 | * between the objects. | ||
| 148 | * | ||
| 149 | * @selector: protocol identifier type | ||
| 150 | * @protocol: protocol of type indicated | ||
| 151 | * @priority: 3-bit unsigned integer indicating priority | ||
| 152 | * | ||
| 153 | * ---- | ||
| 154 | * Selector field values | ||
| 155 | * 0 Reserved | ||
| 156 | * 1 Ethertype | ||
| 157 | * 2 Well known port number over TCP or SCTP | ||
| 158 | * 3 Well known port number over UDP or DCCP | ||
| 159 | * 4 Well known port number over TCP, SCTP, UDP, or DCCP | ||
| 160 | * 5-7 Reserved | ||
| 161 | */ | ||
| 162 | struct dcb_app { | ||
| 163 | __u8 selector; | ||
| 164 | __u8 priority; | ||
| 165 | __u16 protocol; | ||
| 166 | }; | ||
| 167 | |||
| 168 | /** | ||
| 169 | * struct dcb_peer_app_info - APP feature information sent by the peer | ||
| 170 | * | ||
| 171 | * @willing: willing bit in the peer APP tlv | ||
| 172 | * @error: error bit in the peer APP tlv | ||
| 173 | * | ||
| 174 | * In addition to this information the full peer APP tlv also contains | ||
| 175 | * a table of 'app_count' APP objects defined above. | ||
| 176 | */ | ||
| 177 | struct dcb_peer_app_info { | ||
| 178 | __u8 willing; | ||
| 179 | __u8 error; | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct dcbmsg { | ||
| 183 | __u8 dcb_family; | ||
| 184 | __u8 cmd; | ||
| 185 | __u16 dcb_pad; | ||
| 186 | }; | ||
| 187 | |||
| 188 | /** | ||
| 189 | * enum dcbnl_commands - supported DCB commands | ||
| 190 | * | ||
| 191 | * @DCB_CMD_UNDEFINED: unspecified command to catch errors | ||
| 192 | * @DCB_CMD_GSTATE: request the state of DCB in the device | ||
| 193 | * @DCB_CMD_SSTATE: set the state of DCB in the device | ||
| 194 | * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx | ||
| 195 | * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx | ||
| 196 | * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx | ||
| 197 | * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx | ||
| 198 | * @DCB_CMD_PFC_GCFG: request the priority flow control configuration | ||
| 199 | * @DCB_CMD_PFC_SCFG: set the priority flow control configuration | ||
| 200 | * @DCB_CMD_SET_ALL: apply all changes to the underlying device | ||
| 201 | * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying | ||
| 202 | * device. Only useful when using bonding. | ||
| 203 | * @DCB_CMD_GCAP: request the DCB capabilities of the device | ||
| 204 | * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported | ||
| 205 | * @DCB_CMD_SNUMTCS: set the number of traffic classes | ||
| 206 | * @DCB_CMD_GBCN: set backward congestion notification configuration | ||
| 207 | * @DCB_CMD_SBCN: get backward congestion notification configration. | ||
| 208 | * @DCB_CMD_GAPP: get application protocol configuration | ||
| 209 | * @DCB_CMD_SAPP: set application protocol configuration | ||
| 210 | * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration | ||
| 211 | * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration | ||
| 212 | * @DCB_CMD_GDCBX: get DCBX engine configuration | ||
| 213 | * @DCB_CMD_SDCBX: set DCBX engine configuration | ||
| 214 | * @DCB_CMD_GFEATCFG: get DCBX features flags | ||
| 215 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags | ||
| 216 | * @DCB_CMD_CEE_GET: get CEE aggregated configuration | ||
| 217 | * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration | ||
| 218 | */ | ||
| 219 | enum dcbnl_commands { | ||
| 220 | DCB_CMD_UNDEFINED, | ||
| 221 | |||
| 222 | DCB_CMD_GSTATE, | ||
| 223 | DCB_CMD_SSTATE, | ||
| 224 | |||
| 225 | DCB_CMD_PGTX_GCFG, | ||
| 226 | DCB_CMD_PGTX_SCFG, | ||
| 227 | DCB_CMD_PGRX_GCFG, | ||
| 228 | DCB_CMD_PGRX_SCFG, | ||
| 229 | |||
| 230 | DCB_CMD_PFC_GCFG, | ||
| 231 | DCB_CMD_PFC_SCFG, | ||
| 232 | |||
| 233 | DCB_CMD_SET_ALL, | ||
| 234 | |||
| 235 | DCB_CMD_GPERM_HWADDR, | ||
| 236 | |||
| 237 | DCB_CMD_GCAP, | ||
| 238 | |||
| 239 | DCB_CMD_GNUMTCS, | ||
| 240 | DCB_CMD_SNUMTCS, | ||
| 241 | |||
| 242 | DCB_CMD_PFC_GSTATE, | ||
| 243 | DCB_CMD_PFC_SSTATE, | ||
| 244 | |||
| 245 | DCB_CMD_BCN_GCFG, | ||
| 246 | DCB_CMD_BCN_SCFG, | ||
| 247 | |||
| 248 | DCB_CMD_GAPP, | ||
| 249 | DCB_CMD_SAPP, | ||
| 250 | |||
| 251 | DCB_CMD_IEEE_SET, | ||
| 252 | DCB_CMD_IEEE_GET, | ||
| 253 | |||
| 254 | DCB_CMD_GDCBX, | ||
| 255 | DCB_CMD_SDCBX, | ||
| 256 | |||
| 257 | DCB_CMD_GFEATCFG, | ||
| 258 | DCB_CMD_SFEATCFG, | ||
| 259 | |||
| 260 | DCB_CMD_CEE_GET, | ||
| 261 | DCB_CMD_IEEE_DEL, | ||
| 262 | |||
| 263 | __DCB_CMD_ENUM_MAX, | ||
| 264 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | ||
| 265 | }; | ||
| 266 | |||
| 267 | /** | ||
| 268 | * enum dcbnl_attrs - DCB top-level netlink attributes | ||
| 269 | * | ||
| 270 | * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 271 | * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING) | ||
| 272 | * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8) | ||
| 273 | * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8) | ||
| 274 | * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED) | ||
| 275 | * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8) | ||
| 276 | * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED) | ||
| 277 | * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8) | ||
| 278 | * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED) | ||
| 279 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) | ||
| 280 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) | ||
| 281 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) | ||
| 282 | * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED) | ||
| 283 | * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8) | ||
| 284 | * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED) | ||
| 285 | * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED) | ||
| 286 | */ | ||
| 287 | enum dcbnl_attrs { | ||
| 288 | DCB_ATTR_UNDEFINED, | ||
| 289 | |||
| 290 | DCB_ATTR_IFNAME, | ||
| 291 | DCB_ATTR_STATE, | ||
| 292 | DCB_ATTR_PFC_STATE, | ||
| 293 | DCB_ATTR_PFC_CFG, | ||
| 294 | DCB_ATTR_NUM_TC, | ||
| 295 | DCB_ATTR_PG_CFG, | ||
| 296 | DCB_ATTR_SET_ALL, | ||
| 297 | DCB_ATTR_PERM_HWADDR, | ||
| 298 | DCB_ATTR_CAP, | ||
| 299 | DCB_ATTR_NUMTCS, | ||
| 300 | DCB_ATTR_BCN, | ||
| 301 | DCB_ATTR_APP, | ||
| 302 | |||
| 303 | /* IEEE std attributes */ | ||
| 304 | DCB_ATTR_IEEE, | ||
| 305 | |||
| 306 | DCB_ATTR_DCBX, | ||
| 307 | DCB_ATTR_FEATCFG, | ||
| 308 | |||
| 309 | /* CEE nested attributes */ | ||
| 310 | DCB_ATTR_CEE, | ||
| 311 | |||
| 312 | __DCB_ATTR_ENUM_MAX, | ||
| 313 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | ||
| 314 | }; | ||
| 315 | |||
| 316 | /** | ||
| 317 | * enum ieee_attrs - IEEE 802.1Qaz get/set attributes | ||
| 318 | * | ||
| 319 | * @DCB_ATTR_IEEE_UNSPEC: unspecified | ||
| 320 | * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration | ||
| 321 | * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration | ||
| 322 | * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration | ||
| 323 | * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only | ||
| 324 | * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only | ||
| 325 | * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only | ||
| 326 | */ | ||
| 327 | enum ieee_attrs { | ||
| 328 | DCB_ATTR_IEEE_UNSPEC, | ||
| 329 | DCB_ATTR_IEEE_ETS, | ||
| 330 | DCB_ATTR_IEEE_PFC, | ||
| 331 | DCB_ATTR_IEEE_APP_TABLE, | ||
| 332 | DCB_ATTR_IEEE_PEER_ETS, | ||
| 333 | DCB_ATTR_IEEE_PEER_PFC, | ||
| 334 | DCB_ATTR_IEEE_PEER_APP, | ||
| 335 | DCB_ATTR_IEEE_MAXRATE, | ||
| 336 | __DCB_ATTR_IEEE_MAX | ||
| 337 | }; | ||
| 338 | #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) | ||
| 339 | |||
| 340 | enum ieee_attrs_app { | ||
| 341 | DCB_ATTR_IEEE_APP_UNSPEC, | ||
| 342 | DCB_ATTR_IEEE_APP, | ||
| 343 | __DCB_ATTR_IEEE_APP_MAX | ||
| 344 | }; | ||
| 345 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) | ||
| 346 | |||
| 347 | /** | ||
| 348 | * enum cee_attrs - CEE DCBX get attributes. | ||
| 349 | * | ||
| 350 | * @DCB_ATTR_CEE_UNSPEC: unspecified | ||
| 351 | * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only | ||
| 352 | * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only | ||
| 353 | * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only | ||
| 354 | * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG) | ||
| 355 | * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG) | ||
| 356 | * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG) | ||
| 357 | * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP) | ||
| 358 | * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG) | ||
| 359 | * | ||
| 360 | * An aggregated collection of the cee std negotiated parameters. | ||
| 361 | */ | ||
| 362 | enum cee_attrs { | ||
| 363 | DCB_ATTR_CEE_UNSPEC, | ||
| 364 | DCB_ATTR_CEE_PEER_PG, | ||
| 365 | DCB_ATTR_CEE_PEER_PFC, | ||
| 366 | DCB_ATTR_CEE_PEER_APP_TABLE, | ||
| 367 | DCB_ATTR_CEE_TX_PG, | ||
| 368 | DCB_ATTR_CEE_RX_PG, | ||
| 369 | DCB_ATTR_CEE_PFC, | ||
| 370 | DCB_ATTR_CEE_APP_TABLE, | ||
| 371 | DCB_ATTR_CEE_FEAT, | ||
| 372 | __DCB_ATTR_CEE_MAX | ||
| 373 | }; | ||
| 374 | #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) | ||
| 375 | |||
| 376 | enum peer_app_attr { | ||
| 377 | DCB_ATTR_CEE_PEER_APP_UNSPEC, | ||
| 378 | DCB_ATTR_CEE_PEER_APP_INFO, | ||
| 379 | DCB_ATTR_CEE_PEER_APP, | ||
| 380 | __DCB_ATTR_CEE_PEER_APP_MAX | ||
| 381 | }; | ||
| 382 | #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) | ||
| 383 | |||
| 384 | enum cee_attrs_app { | ||
| 385 | DCB_ATTR_CEE_APP_UNSPEC, | ||
| 386 | DCB_ATTR_CEE_APP, | ||
| 387 | __DCB_ATTR_CEE_APP_MAX | ||
| 388 | }; | ||
| 389 | #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1) | ||
| 390 | |||
| 391 | /** | ||
| 392 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | ||
| 393 | * | ||
| 394 | * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 395 | * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8) | ||
| 396 | * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8) | ||
| 397 | * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8) | ||
| 398 | * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8) | ||
| 399 | * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8) | ||
| 400 | * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8) | ||
| 401 | * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8) | ||
| 402 | * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8) | ||
| 403 | * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined | ||
| 404 | * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG) | ||
| 405 | * | ||
| 406 | */ | ||
| 407 | enum dcbnl_pfc_up_attrs { | ||
| 408 | DCB_PFC_UP_ATTR_UNDEFINED, | ||
| 409 | |||
| 410 | DCB_PFC_UP_ATTR_0, | ||
| 411 | DCB_PFC_UP_ATTR_1, | ||
| 412 | DCB_PFC_UP_ATTR_2, | ||
| 413 | DCB_PFC_UP_ATTR_3, | ||
| 414 | DCB_PFC_UP_ATTR_4, | ||
| 415 | DCB_PFC_UP_ATTR_5, | ||
| 416 | DCB_PFC_UP_ATTR_6, | ||
| 417 | DCB_PFC_UP_ATTR_7, | ||
| 418 | DCB_PFC_UP_ATTR_ALL, | ||
| 419 | |||
| 420 | __DCB_PFC_UP_ATTR_ENUM_MAX, | ||
| 421 | DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1, | ||
| 422 | }; | ||
| 423 | |||
| 424 | /** | ||
| 425 | * enum dcbnl_pg_attrs - DCB Priority Group attributes | ||
| 426 | * | ||
| 427 | * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 428 | * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED) | ||
| 429 | * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED) | ||
| 430 | * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED) | ||
| 431 | * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED) | ||
| 432 | * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED) | ||
| 433 | * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED) | ||
| 434 | * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED) | ||
| 435 | * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED) | ||
| 436 | * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined | ||
| 437 | * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED) | ||
| 438 | * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8) | ||
| 439 | * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8) | ||
| 440 | * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8) | ||
| 441 | * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8) | ||
| 442 | * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8) | ||
| 443 | * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8) | ||
| 444 | * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8) | ||
| 445 | * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8) | ||
| 446 | * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined | ||
| 447 | * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG) | ||
| 448 | * | ||
| 449 | */ | ||
| 450 | enum dcbnl_pg_attrs { | ||
| 451 | DCB_PG_ATTR_UNDEFINED, | ||
| 452 | |||
| 453 | DCB_PG_ATTR_TC_0, | ||
| 454 | DCB_PG_ATTR_TC_1, | ||
| 455 | DCB_PG_ATTR_TC_2, | ||
| 456 | DCB_PG_ATTR_TC_3, | ||
| 457 | DCB_PG_ATTR_TC_4, | ||
| 458 | DCB_PG_ATTR_TC_5, | ||
| 459 | DCB_PG_ATTR_TC_6, | ||
| 460 | DCB_PG_ATTR_TC_7, | ||
| 461 | DCB_PG_ATTR_TC_MAX, | ||
| 462 | DCB_PG_ATTR_TC_ALL, | ||
| 463 | |||
| 464 | DCB_PG_ATTR_BW_ID_0, | ||
| 465 | DCB_PG_ATTR_BW_ID_1, | ||
| 466 | DCB_PG_ATTR_BW_ID_2, | ||
| 467 | DCB_PG_ATTR_BW_ID_3, | ||
| 468 | DCB_PG_ATTR_BW_ID_4, | ||
| 469 | DCB_PG_ATTR_BW_ID_5, | ||
| 470 | DCB_PG_ATTR_BW_ID_6, | ||
| 471 | DCB_PG_ATTR_BW_ID_7, | ||
| 472 | DCB_PG_ATTR_BW_ID_MAX, | ||
| 473 | DCB_PG_ATTR_BW_ID_ALL, | ||
| 474 | |||
| 475 | __DCB_PG_ATTR_ENUM_MAX, | ||
| 476 | DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1, | ||
| 477 | }; | ||
| 478 | |||
| 479 | /** | ||
| 480 | * enum dcbnl_tc_attrs - DCB Traffic Class attributes | ||
| 481 | * | ||
| 482 | * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors | ||
| 483 | * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to | ||
| 484 | * Valid values are: 0-7 | ||
| 485 | * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map | ||
| 486 | * Some devices may not support changing the | ||
| 487 | * user priority map of a TC. | ||
| 488 | * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting | ||
| 489 | * 0 - none | ||
| 490 | * 1 - group strict | ||
| 491 | * 2 - link strict | ||
| 492 | * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and | ||
| 493 | * not configured to use link strict priority, | ||
| 494 | * this is the percentage of bandwidth of the | ||
| 495 | * priority group this traffic class belongs to | ||
| 496 | * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters | ||
| 497 | * | ||
| 498 | */ | ||
| 499 | enum dcbnl_tc_attrs { | ||
| 500 | DCB_TC_ATTR_PARAM_UNDEFINED, | ||
| 501 | |||
| 502 | DCB_TC_ATTR_PARAM_PGID, | ||
| 503 | DCB_TC_ATTR_PARAM_UP_MAPPING, | ||
| 504 | DCB_TC_ATTR_PARAM_STRICT_PRIO, | ||
| 505 | DCB_TC_ATTR_PARAM_BW_PCT, | ||
| 506 | DCB_TC_ATTR_PARAM_ALL, | ||
| 507 | |||
| 508 | __DCB_TC_ATTR_PARAM_ENUM_MAX, | ||
| 509 | DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1, | ||
| 510 | }; | ||
| 511 | |||
| 512 | /** | ||
| 513 | * enum dcbnl_cap_attrs - DCB Capability attributes | ||
| 514 | * | ||
| 515 | * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 516 | * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters | ||
| 517 | * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups | ||
| 518 | * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control | ||
| 519 | * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to | ||
| 520 | * traffic class mapping | ||
| 521 | * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a | ||
| 522 | * number of traffic classes the device | ||
| 523 | * can be configured to use for Priority Groups | ||
| 524 | * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a | ||
| 525 | * number of traffic classes the device can be | ||
| 526 | * configured to use for Priority Flow Control | ||
| 527 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority | ||
| 528 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion | ||
| 529 | * Notification | ||
| 530 | * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine | ||
| 531 | * | ||
| 532 | */ | ||
| 533 | enum dcbnl_cap_attrs { | ||
| 534 | DCB_CAP_ATTR_UNDEFINED, | ||
| 535 | DCB_CAP_ATTR_ALL, | ||
| 536 | DCB_CAP_ATTR_PG, | ||
| 537 | DCB_CAP_ATTR_PFC, | ||
| 538 | DCB_CAP_ATTR_UP2TC, | ||
| 539 | DCB_CAP_ATTR_PG_TCS, | ||
| 540 | DCB_CAP_ATTR_PFC_TCS, | ||
| 541 | DCB_CAP_ATTR_GSP, | ||
| 542 | DCB_CAP_ATTR_BCN, | ||
| 543 | DCB_CAP_ATTR_DCBX, | ||
| 544 | |||
| 545 | __DCB_CAP_ATTR_ENUM_MAX, | ||
| 546 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, | ||
| 547 | }; | ||
| 548 | |||
| 549 | /** | ||
| 550 | * DCBX capability flags | ||
| 551 | * | ||
| 552 | * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent. | ||
| 553 | * 'set' routines are used to configure the device with | ||
| 554 | * the negotiated parameters | ||
| 555 | * | ||
| 556 | * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but | ||
| 557 | * by another entity | ||
| 558 | * 'get' routines are used to retrieve the | ||
| 559 | * negotiated parameters | ||
| 560 | * 'set' routines can be used to set the initial | ||
| 561 | * negotiation configuration | ||
| 562 | * | ||
| 563 | * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine | ||
| 564 | * supports the CEE protocol flavor | ||
| 565 | * | ||
| 566 | * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine | ||
| 567 | * supports the IEEE protocol flavor | ||
| 568 | * | ||
| 569 | * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine | ||
| 570 | * supports static configuration (i.e no actual | ||
| 571 | * negotiation is performed negotiated parameters equal | ||
| 572 | * the initial configuration) | ||
| 573 | * | ||
| 574 | */ | ||
| 575 | #define DCB_CAP_DCBX_HOST 0x01 | ||
| 576 | #define DCB_CAP_DCBX_LLD_MANAGED 0x02 | ||
| 577 | #define DCB_CAP_DCBX_VER_CEE 0x04 | ||
| 578 | #define DCB_CAP_DCBX_VER_IEEE 0x08 | ||
| 579 | #define DCB_CAP_DCBX_STATIC 0x10 | ||
| 580 | |||
| 581 | /** | ||
| 582 | * enum dcbnl_numtcs_attrs - number of traffic classes | ||
| 583 | * | ||
| 584 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 585 | * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes | ||
| 586 | * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for | ||
| 587 | * priority groups | ||
| 588 | * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can | ||
| 589 | * support priority flow control | ||
| 590 | */ | ||
| 591 | enum dcbnl_numtcs_attrs { | ||
| 592 | DCB_NUMTCS_ATTR_UNDEFINED, | ||
| 593 | DCB_NUMTCS_ATTR_ALL, | ||
| 594 | DCB_NUMTCS_ATTR_PG, | ||
| 595 | DCB_NUMTCS_ATTR_PFC, | ||
| 596 | |||
| 597 | __DCB_NUMTCS_ATTR_ENUM_MAX, | ||
| 598 | DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1, | ||
| 599 | }; | ||
| 600 | |||
| 601 | enum dcbnl_bcn_attrs{ | ||
| 602 | DCB_BCN_ATTR_UNDEFINED = 0, | ||
| 603 | |||
| 604 | DCB_BCN_ATTR_RP_0, | ||
| 605 | DCB_BCN_ATTR_RP_1, | ||
| 606 | DCB_BCN_ATTR_RP_2, | ||
| 607 | DCB_BCN_ATTR_RP_3, | ||
| 608 | DCB_BCN_ATTR_RP_4, | ||
| 609 | DCB_BCN_ATTR_RP_5, | ||
| 610 | DCB_BCN_ATTR_RP_6, | ||
| 611 | DCB_BCN_ATTR_RP_7, | ||
| 612 | DCB_BCN_ATTR_RP_ALL, | ||
| 613 | |||
| 614 | DCB_BCN_ATTR_BCNA_0, | ||
| 615 | DCB_BCN_ATTR_BCNA_1, | ||
| 616 | DCB_BCN_ATTR_ALPHA, | ||
| 617 | DCB_BCN_ATTR_BETA, | ||
| 618 | DCB_BCN_ATTR_GD, | ||
| 619 | DCB_BCN_ATTR_GI, | ||
| 620 | DCB_BCN_ATTR_TMAX, | ||
| 621 | DCB_BCN_ATTR_TD, | ||
| 622 | DCB_BCN_ATTR_RMIN, | ||
| 623 | DCB_BCN_ATTR_W, | ||
| 624 | DCB_BCN_ATTR_RD, | ||
| 625 | DCB_BCN_ATTR_RU, | ||
| 626 | DCB_BCN_ATTR_WRTT, | ||
| 627 | DCB_BCN_ATTR_RI, | ||
| 628 | DCB_BCN_ATTR_C, | ||
| 629 | DCB_BCN_ATTR_ALL, | ||
| 630 | |||
| 631 | __DCB_BCN_ATTR_ENUM_MAX, | ||
| 632 | DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1, | ||
| 633 | }; | ||
| 634 | |||
| 635 | /** | ||
| 636 | * enum dcb_general_attr_values - general DCB attribute values | ||
| 637 | * | ||
| 638 | * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported | ||
| 639 | * | ||
| 640 | */ | ||
| 641 | enum dcb_general_attr_values { | ||
| 642 | DCB_ATTR_VALUE_UNDEFINED = 0xff | ||
| 643 | }; | ||
| 644 | |||
| 645 | #define DCB_APP_IDTYPE_ETHTYPE 0x00 | ||
| 646 | #define DCB_APP_IDTYPE_PORTNUM 0x01 | ||
| 647 | enum dcbnl_app_attrs { | ||
| 648 | DCB_APP_ATTR_UNDEFINED, | ||
| 649 | |||
| 650 | DCB_APP_ATTR_IDTYPE, | ||
| 651 | DCB_APP_ATTR_ID, | ||
| 652 | DCB_APP_ATTR_PRIORITY, | ||
| 653 | |||
| 654 | __DCB_APP_ATTR_ENUM_MAX, | ||
| 655 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | ||
| 656 | }; | ||
| 657 | |||
| 658 | /** | ||
| 659 | * enum dcbnl_featcfg_attrs - features conifiguration flags | ||
| 660 | * | ||
| 661 | * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
| 662 | * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes | ||
| 663 | * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups | ||
| 664 | * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority | ||
| 665 | * flow control | ||
| 666 | * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV | ||
| 667 | * | ||
| 668 | */ | ||
| 669 | #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */ | ||
| 670 | #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */ | ||
| 671 | #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */ | ||
| 672 | #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */ | ||
| 673 | enum dcbnl_featcfg_attrs { | ||
| 674 | DCB_FEATCFG_ATTR_UNDEFINED, | ||
| 675 | DCB_FEATCFG_ATTR_ALL, | ||
| 676 | DCB_FEATCFG_ATTR_PG, | ||
| 677 | DCB_FEATCFG_ATTR_PFC, | ||
| 678 | DCB_FEATCFG_ATTR_APP, | ||
| 679 | |||
| 680 | __DCB_FEATCFG_ATTR_ENUM_MAX, | ||
| 681 | DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1, | ||
| 682 | }; | ||
| 683 | |||
| 684 | #endif /* __LINUX_DCBNL_H__ */ | ||
| @@ -0,0 +1,237 @@ | |||
| 1 | #ifndef _UAPI_LINUX_DCCP_H | ||
| 2 | #define _UAPI_LINUX_DCCP_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <asm/byteorder.h> | ||
| 6 | |||
| 7 | /** | ||
| 8 | * struct dccp_hdr - generic part of DCCP packet header | ||
| 9 | * | ||
| 10 | * @dccph_sport - Relevant port on the endpoint that sent this packet | ||
| 11 | * @dccph_dport - Relevant port on the other endpoint | ||
| 12 | * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words | ||
| 13 | * @dccph_ccval - Used by the HC-Sender CCID | ||
| 14 | * @dccph_cscov - Parts of the packet that are covered by the Checksum field | ||
| 15 | * @dccph_checksum - Internet checksum, depends on dccph_cscov | ||
| 16 | * @dccph_x - 0 = 24 bit sequence number, 1 = 48 | ||
| 17 | * @dccph_type - packet type, see DCCP_PKT_ prefixed macros | ||
| 18 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x | ||
| 19 | */ | ||
| 20 | struct dccp_hdr { | ||
| 21 | __be16 dccph_sport, | ||
| 22 | dccph_dport; | ||
| 23 | __u8 dccph_doff; | ||
| 24 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 25 | __u8 dccph_cscov:4, | ||
| 26 | dccph_ccval:4; | ||
| 27 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
| 28 | __u8 dccph_ccval:4, | ||
| 29 | dccph_cscov:4; | ||
| 30 | #else | ||
| 31 | #error "Adjust your <asm/byteorder.h> defines" | ||
| 32 | #endif | ||
| 33 | __sum16 dccph_checksum; | ||
| 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 35 | __u8 dccph_x:1, | ||
| 36 | dccph_type:4, | ||
| 37 | dccph_reserved:3; | ||
| 38 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
| 39 | __u8 dccph_reserved:3, | ||
| 40 | dccph_type:4, | ||
| 41 | dccph_x:1; | ||
| 42 | #else | ||
| 43 | #error "Adjust your <asm/byteorder.h> defines" | ||
| 44 | #endif | ||
| 45 | __u8 dccph_seq2; | ||
| 46 | __be16 dccph_seq; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * struct dccp_hdr_ext - the low bits of a 48 bit seq packet | ||
| 51 | * | ||
| 52 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet | ||
| 53 | */ | ||
| 54 | struct dccp_hdr_ext { | ||
| 55 | __be32 dccph_seq_low; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * struct dccp_hdr_request - Connection initiation request header | ||
| 60 | * | ||
| 61 | * @dccph_req_service - Service to which the client app wants to connect | ||
| 62 | */ | ||
| 63 | struct dccp_hdr_request { | ||
| 64 | __be32 dccph_req_service; | ||
| 65 | }; | ||
| 66 | /** | ||
| 67 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets | ||
| 68 | * | ||
| 69 | * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR | ||
| 70 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR | ||
| 71 | */ | ||
| 72 | struct dccp_hdr_ack_bits { | ||
| 73 | __be16 dccph_reserved1; | ||
| 74 | __be16 dccph_ack_nr_high; | ||
| 75 | __be32 dccph_ack_nr_low; | ||
| 76 | }; | ||
| 77 | /** | ||
| 78 | * struct dccp_hdr_response - Connection initiation response header | ||
| 79 | * | ||
| 80 | * @dccph_resp_ack - 48 bit Acknowledgment Number Subheader (5.3) | ||
| 81 | * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request | ||
| 82 | */ | ||
| 83 | struct dccp_hdr_response { | ||
| 84 | struct dccp_hdr_ack_bits dccph_resp_ack; | ||
| 85 | __be32 dccph_resp_service; | ||
| 86 | }; | ||
| 87 | |||
| 88 | /** | ||
| 89 | * struct dccp_hdr_reset - Unconditionally shut down a connection | ||
| 90 | * | ||
| 91 | * @dccph_reset_ack - 48 bit Acknowledgment Number Subheader (5.6) | ||
| 92 | * @dccph_reset_code - one of %dccp_reset_codes | ||
| 93 | * @dccph_reset_data - the Data 1 ... Data 3 fields from 5.6 | ||
| 94 | */ | ||
| 95 | struct dccp_hdr_reset { | ||
| 96 | struct dccp_hdr_ack_bits dccph_reset_ack; | ||
| 97 | __u8 dccph_reset_code, | ||
| 98 | dccph_reset_data[3]; | ||
| 99 | }; | ||
| 100 | |||
| 101 | enum dccp_pkt_type { | ||
| 102 | DCCP_PKT_REQUEST = 0, | ||
| 103 | DCCP_PKT_RESPONSE, | ||
| 104 | DCCP_PKT_DATA, | ||
| 105 | DCCP_PKT_ACK, | ||
| 106 | DCCP_PKT_DATAACK, | ||
| 107 | DCCP_PKT_CLOSEREQ, | ||
| 108 | DCCP_PKT_CLOSE, | ||
| 109 | DCCP_PKT_RESET, | ||
| 110 | DCCP_PKT_SYNC, | ||
| 111 | DCCP_PKT_SYNCACK, | ||
| 112 | DCCP_PKT_INVALID, | ||
| 113 | }; | ||
| 114 | |||
| 115 | #define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID | ||
| 116 | |||
| 117 | static inline unsigned int dccp_packet_hdr_len(const __u8 type) | ||
| 118 | { | ||
| 119 | if (type == DCCP_PKT_DATA) | ||
| 120 | return 0; | ||
| 121 | if (type == DCCP_PKT_DATAACK || | ||
| 122 | type == DCCP_PKT_ACK || | ||
| 123 | type == DCCP_PKT_SYNC || | ||
| 124 | type == DCCP_PKT_SYNCACK || | ||
| 125 | type == DCCP_PKT_CLOSE || | ||
| 126 | type == DCCP_PKT_CLOSEREQ) | ||
| 127 | return sizeof(struct dccp_hdr_ack_bits); | ||
| 128 | if (type == DCCP_PKT_REQUEST) | ||
| 129 | return sizeof(struct dccp_hdr_request); | ||
| 130 | if (type == DCCP_PKT_RESPONSE) | ||
| 131 | return sizeof(struct dccp_hdr_response); | ||
| 132 | return sizeof(struct dccp_hdr_reset); | ||
| 133 | } | ||
| 134 | enum dccp_reset_codes { | ||
| 135 | DCCP_RESET_CODE_UNSPECIFIED = 0, | ||
| 136 | DCCP_RESET_CODE_CLOSED, | ||
| 137 | DCCP_RESET_CODE_ABORTED, | ||
| 138 | DCCP_RESET_CODE_NO_CONNECTION, | ||
| 139 | DCCP_RESET_CODE_PACKET_ERROR, | ||
| 140 | DCCP_RESET_CODE_OPTION_ERROR, | ||
| 141 | DCCP_RESET_CODE_MANDATORY_ERROR, | ||
| 142 | DCCP_RESET_CODE_CONNECTION_REFUSED, | ||
| 143 | DCCP_RESET_CODE_BAD_SERVICE_CODE, | ||
| 144 | DCCP_RESET_CODE_TOO_BUSY, | ||
| 145 | DCCP_RESET_CODE_BAD_INIT_COOKIE, | ||
| 146 | DCCP_RESET_CODE_AGGRESSION_PENALTY, | ||
| 147 | |||
| 148 | DCCP_MAX_RESET_CODES /* Leave at the end! */ | ||
| 149 | }; | ||
| 150 | |||
| 151 | /* DCCP options */ | ||
| 152 | enum { | ||
| 153 | DCCPO_PADDING = 0, | ||
| 154 | DCCPO_MANDATORY = 1, | ||
| 155 | DCCPO_MIN_RESERVED = 3, | ||
| 156 | DCCPO_MAX_RESERVED = 31, | ||
| 157 | DCCPO_CHANGE_L = 32, | ||
| 158 | DCCPO_CONFIRM_L = 33, | ||
| 159 | DCCPO_CHANGE_R = 34, | ||
| 160 | DCCPO_CONFIRM_R = 35, | ||
| 161 | DCCPO_NDP_COUNT = 37, | ||
| 162 | DCCPO_ACK_VECTOR_0 = 38, | ||
| 163 | DCCPO_ACK_VECTOR_1 = 39, | ||
| 164 | DCCPO_TIMESTAMP = 41, | ||
| 165 | DCCPO_TIMESTAMP_ECHO = 42, | ||
| 166 | DCCPO_ELAPSED_TIME = 43, | ||
| 167 | DCCPO_MAX = 45, | ||
| 168 | DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */ | ||
| 169 | DCCPO_MAX_RX_CCID_SPECIFIC = 191, | ||
| 170 | DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */ | ||
| 171 | DCCPO_MAX_TX_CCID_SPECIFIC = 255, | ||
| 172 | }; | ||
| 173 | /* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */ | ||
| 174 | #define DCCP_SINGLE_OPT_MAXLEN 253 | ||
| 175 | |||
| 176 | /* DCCP CCIDS */ | ||
| 177 | enum { | ||
| 178 | DCCPC_CCID2 = 2, | ||
| 179 | DCCPC_CCID3 = 3, | ||
| 180 | }; | ||
| 181 | |||
| 182 | /* DCCP features (RFC 4340 section 6.4) */ | ||
| 183 | enum dccp_feature_numbers { | ||
| 184 | DCCPF_RESERVED = 0, | ||
| 185 | DCCPF_CCID = 1, | ||
| 186 | DCCPF_SHORT_SEQNOS = 2, | ||
| 187 | DCCPF_SEQUENCE_WINDOW = 3, | ||
| 188 | DCCPF_ECN_INCAPABLE = 4, | ||
| 189 | DCCPF_ACK_RATIO = 5, | ||
| 190 | DCCPF_SEND_ACK_VECTOR = 6, | ||
| 191 | DCCPF_SEND_NDP_COUNT = 7, | ||
| 192 | DCCPF_MIN_CSUM_COVER = 8, | ||
| 193 | DCCPF_DATA_CHECKSUM = 9, | ||
| 194 | /* 10-127 reserved */ | ||
| 195 | DCCPF_MIN_CCID_SPECIFIC = 128, | ||
| 196 | DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */ | ||
| 197 | DCCPF_MAX_CCID_SPECIFIC = 255, | ||
| 198 | }; | ||
| 199 | |||
| 200 | /* DCCP socket control message types for cmsg */ | ||
| 201 | enum dccp_cmsg_type { | ||
| 202 | DCCP_SCM_PRIORITY = 1, | ||
| 203 | DCCP_SCM_QPOLICY_MAX = 0xFFFF, | ||
| 204 | /* ^-- Up to here reserved exclusively for qpolicy parameters */ | ||
| 205 | DCCP_SCM_MAX | ||
| 206 | }; | ||
| 207 | |||
| 208 | /* DCCP priorities for outgoing/queued packets */ | ||
| 209 | enum dccp_packet_dequeueing_policy { | ||
| 210 | DCCPQ_POLICY_SIMPLE, | ||
| 211 | DCCPQ_POLICY_PRIO, | ||
| 212 | DCCPQ_POLICY_MAX | ||
| 213 | }; | ||
| 214 | |||
| 215 | /* DCCP socket options */ | ||
| 216 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ | ||
| 217 | #define DCCP_SOCKOPT_SERVICE 2 | ||
| 218 | #define DCCP_SOCKOPT_CHANGE_L 3 | ||
| 219 | #define DCCP_SOCKOPT_CHANGE_R 4 | ||
| 220 | #define DCCP_SOCKOPT_GET_CUR_MPS 5 | ||
| 221 | #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 | ||
| 222 | #define DCCP_SOCKOPT_SEND_CSCOV 10 | ||
| 223 | #define DCCP_SOCKOPT_RECV_CSCOV 11 | ||
| 224 | #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 | ||
| 225 | #define DCCP_SOCKOPT_CCID 13 | ||
| 226 | #define DCCP_SOCKOPT_TX_CCID 14 | ||
| 227 | #define DCCP_SOCKOPT_RX_CCID 15 | ||
| 228 | #define DCCP_SOCKOPT_QPOLICY_ID 16 | ||
| 229 | #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17 | ||
| 230 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | ||
| 231 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | ||
| 232 | |||
| 233 | /* maximum number of services provided on the same listening port */ | ||
| 234 | #define DCCP_SERVICE_LIST_MAX_LEN 32 | ||
| 235 | |||
| 236 | |||
| 237 | #endif /* _UAPI_LINUX_DCCP_H */ | ||
| @@ -0,0 +1,75 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | ******************************************************************************* | ||
| 3 | ** | ||
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
| 5 | ** Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. | ||
| 6 | ** | ||
| 7 | ** This copyrighted material is made available to anyone wishing to use, | ||
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | ||
| 9 | ** of the GNU General Public License v.2. | ||
| 10 | ** | ||
| 11 | ******************************************************************************* | ||
| 12 | ******************************************************************************/ | ||
| 13 | |||
| 14 | #ifndef _UAPI__DLM_DOT_H__ | ||
| 15 | #define _UAPI__DLM_DOT_H__ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Interface to Distributed Lock Manager (DLM) | ||
| 19 | * routines and structures to use DLM lockspaces | ||
| 20 | */ | ||
| 21 | |||
| 22 | /* Lock levels and flags are here */ | ||
| 23 | #include <linux/dlmconstants.h> | ||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 26 | typedef void dlm_lockspace_t; | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Lock status block | ||
| 30 | * | ||
| 31 | * Use this structure to specify the contents of the lock value block. For a | ||
| 32 | * conversion request, this structure is used to specify the lock ID of the | ||
| 33 | * lock. DLM writes the status of the lock request and the lock ID assigned | ||
| 34 | * to the request in the lock status block. | ||
| 35 | * | ||
| 36 | * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests. | ||
| 37 | * It is available when dlm_lock returns. | ||
| 38 | * | ||
| 39 | * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules | ||
| 40 | * shown for the DLM_LKF_VALBLK flag. | ||
| 41 | * | ||
| 42 | * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock, | ||
| 43 | * it was first demoted to NL to avoid conversion deadlock. | ||
| 44 | * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid. | ||
| 45 | * | ||
| 46 | * sb_status: the returned status of the lock request set prior to AST | ||
| 47 | * execution. Possible return values: | ||
| 48 | * | ||
| 49 | * 0 if lock request was successful | ||
| 50 | * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE | ||
| 51 | * -DLM_EUNLOCK if unlock request was successful | ||
| 52 | * -DLM_ECANCEL if a cancel completed successfully | ||
| 53 | * -EDEADLK if a deadlock was detected | ||
| 54 | * -ETIMEDOUT if the lock request was canceled due to a timeout | ||
| 55 | */ | ||
| 56 | |||
| 57 | #define DLM_SBF_DEMOTED 0x01 | ||
| 58 | #define DLM_SBF_VALNOTVALID 0x02 | ||
| 59 | #define DLM_SBF_ALTMODE 0x04 | ||
| 60 | |||
| 61 | struct dlm_lksb { | ||
| 62 | int sb_status; | ||
| 63 | __u32 sb_lkid; | ||
| 64 | char sb_flags; | ||
| 65 | char * sb_lvbptr; | ||
| 66 | }; | ||
| 67 | |||
| 68 | /* dlm_new_lockspace() flags */ | ||
| 69 | |||
| 70 | #define DLM_LSFL_TIMEWARN 0x00000002 | ||
| 71 | #define DLM_LSFL_FS 0x00000004 | ||
| 72 | #define DLM_LSFL_NEWEXCL 0x00000008 | ||
| 73 | |||
| 74 | |||
| 75 | #endif /* _UAPI__DLM_DOT_H__ */ | ||
| @@ -0,0 +1,108 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | ******************************************************************************* | ||
| 3 | ** | ||
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
| 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. | ||
| 6 | ** | ||
| 7 | ** This copyrighted material is made available to anyone wishing to use, | ||
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | ||
| 9 | ** of the GNU General Public License v.2. | ||
| 10 | ** | ||
| 11 | ******************************************************************************* | ||
| 12 | ******************************************************************************/ | ||
| 13 | |||
| 14 | #ifndef _LINUX_DLM_DEVICE_H | ||
| 15 | #define _LINUX_DLM_DEVICE_H | ||
| 16 | |||
| 17 | /* This is the device interface for dlm, most users will use a library | ||
| 18 | * interface. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <linux/dlm.h> | ||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 24 | #define DLM_USER_LVB_LEN 32 | ||
| 25 | |||
| 26 | /* Version of the device interface */ | ||
| 27 | #define DLM_DEVICE_VERSION_MAJOR 6 | ||
| 28 | #define DLM_DEVICE_VERSION_MINOR 0 | ||
| 29 | #define DLM_DEVICE_VERSION_PATCH 1 | ||
| 30 | |||
| 31 | /* struct passed to the lock write */ | ||
| 32 | struct dlm_lock_params { | ||
| 33 | __u8 mode; | ||
| 34 | __u8 namelen; | ||
| 35 | __u16 unused; | ||
| 36 | __u32 flags; | ||
| 37 | __u32 lkid; | ||
| 38 | __u32 parent; | ||
| 39 | __u64 xid; | ||
| 40 | __u64 timeout; | ||
| 41 | void __user *castparam; | ||
| 42 | void __user *castaddr; | ||
| 43 | void __user *bastparam; | ||
| 44 | void __user *bastaddr; | ||
| 45 | struct dlm_lksb __user *lksb; | ||
| 46 | char lvb[DLM_USER_LVB_LEN]; | ||
| 47 | char name[0]; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct dlm_lspace_params { | ||
| 51 | __u32 flags; | ||
| 52 | __u32 minor; | ||
| 53 | char name[0]; | ||
| 54 | }; | ||
| 55 | |||
| 56 | struct dlm_purge_params { | ||
| 57 | __u32 nodeid; | ||
| 58 | __u32 pid; | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct dlm_write_request { | ||
| 62 | __u32 version[3]; | ||
| 63 | __u8 cmd; | ||
| 64 | __u8 is64bit; | ||
| 65 | __u8 unused[2]; | ||
| 66 | |||
| 67 | union { | ||
| 68 | struct dlm_lock_params lock; | ||
| 69 | struct dlm_lspace_params lspace; | ||
| 70 | struct dlm_purge_params purge; | ||
| 71 | } i; | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct dlm_device_version { | ||
| 75 | __u32 version[3]; | ||
| 76 | }; | ||
| 77 | |||
| 78 | /* struct read from the "device" fd, | ||
| 79 | consists mainly of userspace pointers for the library to use */ | ||
| 80 | |||
| 81 | struct dlm_lock_result { | ||
| 82 | __u32 version[3]; | ||
| 83 | __u32 length; | ||
| 84 | void __user * user_astaddr; | ||
| 85 | void __user * user_astparam; | ||
| 86 | struct dlm_lksb __user * user_lksb; | ||
| 87 | struct dlm_lksb lksb; | ||
| 88 | __u8 bast_mode; | ||
| 89 | __u8 unused[3]; | ||
| 90 | /* Offsets may be zero if no data is present */ | ||
| 91 | __u32 lvb_offset; | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* Commands passed to the device */ | ||
| 95 | #define DLM_USER_LOCK 1 | ||
| 96 | #define DLM_USER_UNLOCK 2 | ||
| 97 | #define DLM_USER_QUERY 3 | ||
| 98 | #define DLM_USER_CREATE_LOCKSPACE 4 | ||
| 99 | #define DLM_USER_REMOVE_LOCKSPACE 5 | ||
| 100 | #define DLM_USER_PURGE 6 | ||
| 101 | #define DLM_USER_DEADLOCK 7 | ||
| 102 | |||
| 103 | /* Lockspace flags */ | ||
| 104 | #define DLM_USER_LSFLG_AUTOFREE 1 | ||
| 105 | #define DLM_USER_LSFLG_FORCEFREE 2 | ||
| 106 | |||
| 107 | #endif | ||
| 108 | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * This copyrighted material is made available to anyone wishing to use, | ||
| 5 | * modify, copy, or redistribute it subject to the terms and conditions | ||
| 6 | * of the GNU General Public License v.2. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _DLM_NETLINK_H | ||
| 10 | #define _DLM_NETLINK_H | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 14 | enum { | ||
| 15 | DLM_STATUS_WAITING = 1, | ||
| 16 | DLM_STATUS_GRANTED = 2, | ||
| 17 | DLM_STATUS_CONVERT = 3, | ||
| 18 | }; | ||
| 19 | |||
| 20 | #define DLM_LOCK_DATA_VERSION 1 | ||
| 21 | |||
| 22 | struct dlm_lock_data { | ||
| 23 | __u16 version; | ||
| 24 | __u32 lockspace_id; | ||
| 25 | int nodeid; | ||
| 26 | int ownpid; | ||
| 27 | __u32 id; | ||
| 28 | __u32 remid; | ||
| 29 | __u64 xid; | ||
| 30 | __s8 status; | ||
| 31 | __s8 grmode; | ||
| 32 | __s8 rqmode; | ||
| 33 | unsigned long timestamp; | ||
| 34 | int resource_namelen; | ||
| 35 | char resource_name[DLM_RESNAME_MAXLEN]; | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum { | ||
| 39 | DLM_CMD_UNSPEC = 0, | ||
| 40 | DLM_CMD_HELLO, /* user->kernel */ | ||
| 41 | DLM_CMD_TIMEOUT, /* kernel->user */ | ||
| 42 | __DLM_CMD_MAX, | ||
| 43 | }; | ||
| 44 | |||
| 45 | #define DLM_CMD_MAX (__DLM_CMD_MAX - 1) | ||
| 46 | |||
| 47 | enum { | ||
| 48 | DLM_TYPE_UNSPEC = 0, | ||
| 49 | DLM_TYPE_LOCK, | ||
| 50 | __DLM_TYPE_MAX, | ||
| 51 | }; | ||
| 52 | |||
| 53 | #define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1) | ||
| 54 | |||
| 55 | #define DLM_GENL_VERSION 0x1 | ||
| 56 | #define DLM_GENL_NAME "DLM" | ||
| 57 | |||
| 58 | #endif /* _DLM_NETLINK_H */ | ||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * This copyrighted material is made available to anyone wishing to use, | ||
| 5 | * modify, copy, or redistribute it subject to the terms and conditions | ||
| 6 | * of the GNU General Public License v.2. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _UAPI__DLM_PLOCK_DOT_H__ | ||
| 10 | #define _UAPI__DLM_PLOCK_DOT_H__ | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 14 | #define DLM_PLOCK_MISC_NAME "dlm_plock" | ||
| 15 | |||
| 16 | #define DLM_PLOCK_VERSION_MAJOR 1 | ||
| 17 | #define DLM_PLOCK_VERSION_MINOR 2 | ||
| 18 | #define DLM_PLOCK_VERSION_PATCH 0 | ||
| 19 | |||
| 20 | enum { | ||
| 21 | DLM_PLOCK_OP_LOCK = 1, | ||
| 22 | DLM_PLOCK_OP_UNLOCK, | ||
| 23 | DLM_PLOCK_OP_GET, | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define DLM_PLOCK_FL_CLOSE 1 | ||
| 27 | |||
| 28 | struct dlm_plock_info { | ||
| 29 | __u32 version[3]; | ||
| 30 | __u8 optype; | ||
| 31 | __u8 ex; | ||
| 32 | __u8 wait; | ||
| 33 | __u8 flags; | ||
| 34 | __u32 pid; | ||
| 35 | __s32 nodeid; | ||
| 36 | __s32 rv; | ||
| 37 | __u32 fsid; | ||
| 38 | __u64 number; | ||
| 39 | __u64 start; | ||
| 40 | __u64 end; | ||
| 41 | __u64 owner; | ||
| 42 | }; | ||
| 43 | |||
| 44 | |||
| 45 | #endif /* _UAPI__DLM_PLOCK_DOT_H__ */ | ||
| @@ -0,0 +1,163 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | ******************************************************************************* | ||
| 3 | ** | ||
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
| 5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. | ||
| 6 | ** | ||
| 7 | ** This copyrighted material is made available to anyone wishing to use, | ||
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions | ||
| 9 | ** of the GNU General Public License v.2. | ||
| 10 | ** | ||
| 11 | ******************************************************************************* | ||
| 12 | ******************************************************************************/ | ||
| 13 | |||
| 14 | #ifndef __DLMCONSTANTS_DOT_H__ | ||
| 15 | #define __DLMCONSTANTS_DOT_H__ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Constants used by DLM interface. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define DLM_LOCKSPACE_LEN 64 | ||
| 22 | #define DLM_RESNAME_MAXLEN 64 | ||
| 23 | |||
| 24 | |||
| 25 | /* | ||
| 26 | * Lock Modes | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define DLM_LOCK_IV (-1) /* invalid */ | ||
| 30 | #define DLM_LOCK_NL 0 /* null */ | ||
| 31 | #define DLM_LOCK_CR 1 /* concurrent read */ | ||
| 32 | #define DLM_LOCK_CW 2 /* concurrent write */ | ||
| 33 | #define DLM_LOCK_PR 3 /* protected read */ | ||
| 34 | #define DLM_LOCK_PW 4 /* protected write */ | ||
| 35 | #define DLM_LOCK_EX 5 /* exclusive */ | ||
| 36 | |||
| 37 | |||
| 38 | /* | ||
| 39 | * Flags to dlm_lock | ||
| 40 | * | ||
| 41 | * DLM_LKF_NOQUEUE | ||
| 42 | * | ||
| 43 | * Do not queue the lock request on the wait queue if it cannot be granted | ||
| 44 | * immediately. If the lock cannot be granted because of this flag, DLM will | ||
| 45 | * either return -EAGAIN from the dlm_lock call or will return 0 from | ||
| 46 | * dlm_lock and -EAGAIN in the lock status block when the AST is executed. | ||
| 47 | * | ||
| 48 | * DLM_LKF_CANCEL | ||
| 49 | * | ||
| 50 | * Used to cancel a pending lock request or conversion. A converting lock is | ||
| 51 | * returned to its previously granted mode. | ||
| 52 | * | ||
| 53 | * DLM_LKF_CONVERT | ||
| 54 | * | ||
| 55 | * Indicates a lock conversion request. For conversions the name and namelen | ||
| 56 | * are ignored and the lock ID in the LKSB is used to identify the lock. | ||
| 57 | * | ||
| 58 | * DLM_LKF_VALBLK | ||
| 59 | * | ||
| 60 | * Requests DLM to return the current contents of the lock value block in the | ||
| 61 | * lock status block. When this flag is set in a lock conversion from PW or EX | ||
| 62 | * modes, DLM assigns the value specified in the lock status block to the lock | ||
| 63 | * value block of the lock resource. The LVB is a DLM_LVB_LEN size array | ||
| 64 | * containing application-specific information. | ||
| 65 | * | ||
| 66 | * DLM_LKF_QUECVT | ||
| 67 | * | ||
| 68 | * Force a conversion request to be queued, even if it is compatible with | ||
| 69 | * the granted modes of other locks on the same resource. | ||
| 70 | * | ||
| 71 | * DLM_LKF_IVVALBLK | ||
| 72 | * | ||
| 73 | * Invalidate the lock value block. | ||
| 74 | * | ||
| 75 | * DLM_LKF_CONVDEADLK | ||
| 76 | * | ||
| 77 | * Allows the dlm to resolve conversion deadlocks internally by demoting the | ||
| 78 | * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is | ||
| 79 | * returned for a conversion that's been effected by this. | ||
| 80 | * | ||
| 81 | * DLM_LKF_PERSISTENT | ||
| 82 | * | ||
| 83 | * Only relevant to locks originating in userspace. A persistent lock will not | ||
| 84 | * be removed if the process holding the lock exits. | ||
| 85 | * | ||
| 86 | * DLM_LKF_NODLCKWT | ||
| 87 | * | ||
| 88 | * Do not cancel the lock if it gets into conversion deadlock. | ||
| 89 | * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN. | ||
| 90 | * | ||
| 91 | * DLM_LKF_NODLCKBLK | ||
| 92 | * | ||
| 93 | * net yet implemented | ||
| 94 | * | ||
| 95 | * DLM_LKF_EXPEDITE | ||
| 96 | * | ||
| 97 | * Used only with new requests for NL mode locks. Tells the lock manager | ||
| 98 | * to grant the lock, ignoring other locks in convert and wait queues. | ||
| 99 | * | ||
| 100 | * DLM_LKF_NOQUEUEBAST | ||
| 101 | * | ||
| 102 | * Send blocking AST's before returning -EAGAIN to the caller. It is only | ||
| 103 | * used along with the NOQUEUE flag. Blocking AST's are not sent for failed | ||
| 104 | * NOQUEUE requests otherwise. | ||
| 105 | * | ||
| 106 | * DLM_LKF_HEADQUE | ||
| 107 | * | ||
| 108 | * Add a lock to the head of the convert or wait queue rather than the tail. | ||
| 109 | * | ||
| 110 | * DLM_LKF_NOORDER | ||
| 111 | * | ||
| 112 | * Disregard the standard grant order rules and grant a lock as soon as it | ||
| 113 | * is compatible with other granted locks. | ||
| 114 | * | ||
| 115 | * DLM_LKF_ORPHAN | ||
| 116 | * | ||
| 117 | * not yet implemented | ||
| 118 | * | ||
| 119 | * DLM_LKF_ALTPR | ||
| 120 | * | ||
| 121 | * If the requested mode cannot be granted immediately, try to grant the lock | ||
| 122 | * in PR mode instead. If this alternate mode is granted instead of the | ||
| 123 | * requested mode, DLM_SBF_ALTMODE is returned in the lksb. | ||
| 124 | * | ||
| 125 | * DLM_LKF_ALTCW | ||
| 126 | * | ||
| 127 | * The same as ALTPR, but the alternate mode is CW. | ||
| 128 | * | ||
| 129 | * DLM_LKF_FORCEUNLOCK | ||
| 130 | * | ||
| 131 | * Unlock the lock even if it is converting or waiting or has sublocks. | ||
| 132 | * Only really for use by the userland device.c code. | ||
| 133 | * | ||
| 134 | */ | ||
| 135 | |||
| 136 | #define DLM_LKF_NOQUEUE 0x00000001 | ||
| 137 | #define DLM_LKF_CANCEL 0x00000002 | ||
| 138 | #define DLM_LKF_CONVERT 0x00000004 | ||
| 139 | #define DLM_LKF_VALBLK 0x00000008 | ||
| 140 | #define DLM_LKF_QUECVT 0x00000010 | ||
| 141 | #define DLM_LKF_IVVALBLK 0x00000020 | ||
| 142 | #define DLM_LKF_CONVDEADLK 0x00000040 | ||
| 143 | #define DLM_LKF_PERSISTENT 0x00000080 | ||
| 144 | #define DLM_LKF_NODLCKWT 0x00000100 | ||
| 145 | #define DLM_LKF_NODLCKBLK 0x00000200 | ||
| 146 | #define DLM_LKF_EXPEDITE 0x00000400 | ||
| 147 | #define DLM_LKF_NOQUEUEBAST 0x00000800 | ||
| 148 | #define DLM_LKF_HEADQUE 0x00001000 | ||
| 149 | #define DLM_LKF_NOORDER 0x00002000 | ||
| 150 | #define DLM_LKF_ORPHAN 0x00004000 | ||
| 151 | #define DLM_LKF_ALTPR 0x00008000 | ||
| 152 | #define DLM_LKF_ALTCW 0x00010000 | ||
| 153 | #define DLM_LKF_FORCEUNLOCK 0x00020000 | ||
| 154 | #define DLM_LKF_TIMEOUT 0x00040000 | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Some return codes that are not in errno.h | ||
| 158 | */ | ||
| 159 | |||
| 160 | #define DLM_ECANCEL 0x10001 | ||
| 161 | #define DLM_EUNLOCK 0x10002 | ||
| 162 | |||
| 163 | #endif /* __DLMCONSTANTS_DOT_H__ */ | ||
| @@ -0,0 +1,339 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited. | ||
| 3 | * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved. | ||
| 4 | * | ||
| 5 | * This file is released under the LGPL. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _LINUX_DM_IOCTL_V4_H | ||
| 9 | #define _LINUX_DM_IOCTL_V4_H | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | |||
| 13 | #define DM_DIR "mapper" /* Slashes not supported */ | ||
| 14 | #define DM_CONTROL_NODE "control" | ||
| 15 | #define DM_MAX_TYPE_NAME 16 | ||
| 16 | #define DM_NAME_LEN 128 | ||
| 17 | #define DM_UUID_LEN 129 | ||
| 18 | |||
| 19 | /* | ||
| 20 | * A traditional ioctl interface for the device mapper. | ||
| 21 | * | ||
318 more lines aren’t shown here.
This diff is large: its 417 lines aren’t shown here.
This diff is large: its 147 lines aren’t shown here.
This diff is large: its 167 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 136 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 156 lines aren’t shown here.
This diff is large: its 517 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 145 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 275 lines aren’t shown here.
This diff is large: its 192 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 415 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 1086 lines aren’t shown here.
This diff is large: its 67 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 403 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 383 lines aren’t shown here.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 69 lines aren’t shown here.
This diff is large: its 136 lines aren’t shown here.
This diff is large: its 1040 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 203 lines aren’t shown here.
This diff is large: its 221 lines aren’t shown here.
This diff is large: its 678 lines aren’t shown here.
This diff is large: its 153 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 85 lines aren’t shown here.
This diff is large: its 465 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 659 lines aren’t shown here.
This diff is large: its 67 lines aren’t shown here.
This diff is large: its 213 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 152 lines aren’t shown here.
This diff is large: its 422 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 98 lines aren’t shown here.
This diff is large: its 165 lines aren’t shown here.
This diff is large: its 236 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 133 lines aren’t shown here.
This diff is large: its 160 lines aren’t shown here.
This diff is large: its 129 lines aren’t shown here.
This diff is large: its 102 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 136 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 123 lines aren’t shown here.
This diff is large: its 154 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 430 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 273 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 157 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 108 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 97 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 129 lines aren’t shown here.
This diff is large: its 254 lines aren’t shown here.
This diff is large: its 280 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 1154 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 435 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 457 lines aren’t shown here.
This diff is large: its 122 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 165 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 76 lines aren’t shown here.
This diff is large: its 252 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 144 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 116 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 166 lines aren’t shown here.
This diff is large: its 74 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 721 lines aren’t shown here.
This diff is large: its 224 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 184 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 444 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 976 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 181 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 85 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 178 lines aren’t shown here.
This diff is large: its 188 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 298 lines aren’t shown here.
This diff is large: its 133 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 67 lines aren’t shown here.
This diff is large: its 162 lines aren’t shown here.
This diff is large: its 107 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 144 lines aren’t shown here.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 168 lines aren’t shown here.
This diff is large: its 76 lines aren’t shown here.
This diff is large: its 209 lines aren’t shown here.
This diff is large: its 99 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 202 lines aren’t shown here.
This diff is large: its 147 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 160 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 114 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 232 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 118 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 249 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 115 lines aren’t shown here.
This diff is large: its 98 lines aren’t shown here.
This diff is large: its 102 lines aren’t shown here.
This diff is large: its 188 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 74 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 136 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 207 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 269 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 230 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 268 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 154 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 198 lines aren’t shown here.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 98 lines aren’t shown here.
This diff is large: its 179 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 123 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 3073 lines aren’t shown here.
This diff is large: its 245 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 647 lines aren’t shown here.
This diff is large: its 223 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 847 lines aren’t shown here.
This diff is large: its 616 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 371 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 186 lines aren’t shown here.
This diff is large: its 470 lines aren’t shown here.
This diff is large: its 739 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 140 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 94 lines aren’t shown here.
This diff is large: its 120 lines aren’t shown here.
This diff is large: its 151 lines aren’t shown here.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 153 lines aren’t shown here.
This diff is large: its 85 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 172 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 286 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 108 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 108 lines aren’t shown here.
This diff is large: its 613 lines aren’t shown here.
This diff is large: its 173 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 127 lines aren’t shown here.
This diff is large: its 220 lines aren’t shown here.
This diff is large: its 372 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 285 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 149 lines aren’t shown here.
This diff is large: its 155 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 147 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 1283 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 283 lines aren’t shown here.
This diff is large: its 301 lines aren’t shown here.
This diff is large: its 933 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 214 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 226 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 263 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 167 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 210 lines aren’t shown here.
This diff is large: its 396 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 104 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 546 lines aren’t shown here.
This diff is large: its 413 lines aren’t shown here.
This diff is large: its 267 lines aren’t shown here.
This diff is large: its 994 lines aren’t shown here.
This diff is large: its 170 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 113 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 569 lines aren’t shown here.
This diff is large: its 181 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 804 lines aren’t shown here.
This diff is large: its 817 lines aren’t shown here.
This diff is large: its 120 lines aren’t shown here.
This diff is large: its 181 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 369 lines aren’t shown here.
This diff is large: its 131 lines aren’t shown here.
This diff is large: its 1999 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 131 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 170 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 164 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 453 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 240 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 573 lines aren’t shown here.
This diff is large: its 1129 lines aren’t shown here.
This diff is large: its 153 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 507 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 279 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 421 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 2 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 99 lines aren’t shown here.