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 #include <sys/ioctl.h>
17 * Structures used to pass data into AFS ioctls. The buffer pointers may be
18 * null, or the counts may be 0 if there are no input or output parameters.
22 /* A fixed size, whether the kernel uses the ILP32 or LP64 data models. */
24 unsigned int in, out; /* Data to be transferred in, or out */
25 short in_size; /* Size of input buffer <= 2K */
26 short out_size; /* Maximum size of output buffer, <= 2K */
30 /* Windows uses a different structure layout, defined in sys/pioctl_nt.h. */
33 caddr_t in, out; /* Data to be transferred in, or out */
34 short in_size; /* Size of input buffer <= 2K */
35 short out_size; /* Maximum size of output buffer, <= 2K */
40 * The structure argument to _IOW() is used to add a structure size component
41 * to the _IOW() value, to help the kernel code identify how big a structure
42 * the calling process is passing into a system call.
44 * In user space, struct ViceIoctl32 and struct ViceIoctl are the same except
45 * on Digital Unix, where user space code is compiled in 64-bit mode.
47 * So, in kernel space, regardless whether it is compiled in 32-bit mode or
48 * 64-bit mode, the kernel code can use the struct ViceIoctl32 version of
49 * _IOW() to check the size of user space arguments -- except on Digital Unix
50 * (or Linux on Alpha, since it's compatible with Digital Unix). We don't
51 * care about other 64-bit Linux versions since they don't check this length.
53 #if defined(KERNEL) && !defined(__alpha__)
54 #define _VICEIOCTL(id) ((unsigned int) _IOW('V', id, struct ViceIoctl32))
55 #define _VICEIOCTL2(dev, id) ((unsigned int) _IOW(dev, id, struct ViceIoctl32))
57 #define _VICEIOCTL(id) ((unsigned int) _IOW('V', id, struct ViceIoctl))
58 #define _VICEIOCTL2(dev, id) ((unsigned int) _IOW(dev, id, struct ViceIoctl))
60 #define _CVICEIOCTL(id) _VICEIOCTL2('C', id)
61 #define _OVICEIOCTL(id) _VICEIOCTL2('O', id)
64 * Use these macros to define up to 256 vice ioctls in each space. These
65 * ioctls all potentially have in/out parameters, depending on the values in
66 * the ViceIoctl structure. This structure is passed into the kernel by the
67 * normal ioctl parameter passing mechanism.
69 * See <http://grand.central.org/numbers/pioctls.html> for the definition of
73 #endif /* AFS_VICE_H */