2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
13 #include <sys/types.h>
14 #if !defined(AFS_NT40_ENV)
15 # if (!defined(AFS_FBSD_ENV) && !defined(AFS_LINUX_ENV)) || !defined(KERNEL) || defined(UKERNEL)
16 # include <sys/ioctl.h>
18 #endif /* AFS_NT40_ENV */
19 #if (defined(__sun) && defined(__SVR4)) || defined(AFS_DFBSD_ENV) || defined(AFS_USR_DFBSD_ENV)
20 # include <sys/ioccom.h>
24 * Structures used to pass data into AFS ioctls. The buffer pointers may be
25 * null, or the counts may be 0 if there are no input or output parameters.
29 /* A fixed size, whether the kernel uses the ILP32 or LP64 data models. */
31 unsigned int in, out; /* Data to be transferred in, or out */
32 short in_size; /* Size of input buffer <= 2K */
33 short out_size; /* Maximum size of output buffer, <= 2K */
37 /* Windows uses a different structure layout, defined in sys/pioctl_nt.h. */
40 caddr_t in, out; /* Data to be transferred in, or out */
41 short in_size; /* Size of input buffer <= 2K */
42 short out_size; /* Maximum size of output buffer, <= 2K */
47 * The structure argument to _IOW() is used to add a structure size component
48 * to the _IOW() value, to help the kernel code identify how big a structure
49 * the calling process is passing into a system call.
51 * In user space, struct ViceIoctl32 and struct ViceIoctl are the same except
52 * on Digital Unix, where user space code is compiled in 64-bit mode.
54 * So, in kernel space, regardless whether it is compiled in 32-bit mode or
55 * 64-bit mode, the kernel code can use the struct ViceIoctl32 version of
56 * _IOW() to check the size of user space arguments -- except on Digital Unix
57 * (or Linux on Alpha, since it's compatible with Digital Unix). We don't
58 * care about other 64-bit Linux versions since they don't check this length.
60 #if defined(KERNEL) && !defined(__alpha__)
61 #define _VICEIOCTL(id) ((unsigned int) _IOW('V', id, struct ViceIoctl32))
62 #define _VICEIOCTL2(dev, id) ((unsigned int) _IOW(dev, id, struct ViceIoctl32))
64 #define _VICEIOCTL(id) ((unsigned int) _IOW('V', id, struct ViceIoctl))
65 #define _VICEIOCTL2(dev, id) ((unsigned int) _IOW(dev, id, struct ViceIoctl))
67 #define _CVICEIOCTL(id) _VICEIOCTL2('C', id)
68 #define _OVICEIOCTL(id) _VICEIOCTL2('O', id)
71 * Use these macros to define up to 256 vice ioctls in each space. These
72 * ioctls all potentially have in/out parameters, depending on the values in
73 * the ViceIoctl structure. This structure is passed into the kernel by the
74 * normal ioctl parameter passing mechanism.
76 * See <http://grand.central.org/numbers/pioctls.html> for the definition of
80 #endif /* AFS_VICE_H */