]>
Commit | Line | Data |
---|---|---|
715f6251 | 1 | /* |
2 | * This file is part of the SPL: Solaris Porting Layer. | |
3 | * | |
4 | * Copyright (c) 2008 Lawrence Livermore National Security, LLC. | |
5 | * Produced at Lawrence Livermore National Laboratory | |
6 | * Written by: | |
7 | * Brian Behlendorf <behlendorf1@llnl.gov>, | |
8 | * Herb Wartens <wartens2@llnl.gov>, | |
9 | * Jim Garlick <garlick@llnl.gov> | |
10 | * UCRL-CODE-235197 | |
11 | * | |
12 | * This is free software; you can redistribute it and/or modify it | |
13 | * under the terms of the GNU General Public License as published by | |
14 | * the Free Software Foundation; either version 2 of the License, or | |
15 | * (at your option) any later version. | |
16 | * | |
17 | * This is distributed in the hope that it will be useful, but WITHOUT | |
18 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
19 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
20 | * for more details. | |
21 | * | |
22 | * You should have received a copy of the GNU General Public License along | |
23 | * with this program; if not, write to the Free Software Foundation, Inc., | |
24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
25 | */ | |
26 | ||
ea70970f | 27 | #ifndef _SPLAT_CTL_H |
28 | #define _SPLAT_CTL_H | |
29 | ||
e554dffa | 30 | #include <linux/types.h> |
ea70970f | 31 | |
e554dffa BB |
32 | /* |
33 | * Contains shared definitions for both user space and kernel space. To | |
34 | * ensure 32-bit/64-bit interoperability over ioctl()'s only types with | |
35 | * fixed sizes can be used. | |
36 | */ | |
124ca8a5 | 37 | #define SPLAT_MAJOR 225 /* XXX - Arbitrary */ |
ea70970f | 38 | #define SPLAT_MINORS 1 |
46c685d0 | 39 | #define SPLAT_NAME "splatctl" |
ea70970f | 40 | #define SPLAT_DEV "/dev/splatctl" |
41 | ||
014b1d6f | 42 | #define SPLAT_NAME_SIZE 20 |
ea70970f | 43 | #define SPLAT_DESC_SIZE 60 |
44 | ||
45 | typedef struct splat_user { | |
e554dffa BB |
46 | char name[SPLAT_NAME_SIZE]; /* Short name */ |
47 | char desc[SPLAT_DESC_SIZE]; /* Short description */ | |
48 | __u32 id; /* Unique numeric id */ | |
ea70970f | 49 | } splat_user_t; |
50 | ||
51 | #define SPLAT_CFG_MAGIC 0x15263748U | |
52 | typedef struct splat_cfg { | |
e554dffa BB |
53 | __u32 cfg_magic; /* Unique magic */ |
54 | __u32 cfg_cmd; /* Configure command */ | |
55 | __s32 cfg_arg1; /* Configure command arg 1 */ | |
56 | __s32 cfg_rc1; /* Configure response 1 */ | |
ea70970f | 57 | union { |
58 | struct { | |
e554dffa | 59 | __u32 size; |
ea70970f | 60 | splat_user_t descs[0]; |
61 | } splat_subsystems; | |
62 | struct { | |
e554dffa | 63 | __u32 size; |
ea70970f | 64 | splat_user_t descs[0]; |
65 | } splat_tests; | |
66 | } cfg_data; | |
67 | } splat_cfg_t; | |
68 | ||
69 | #define SPLAT_CMD_MAGIC 0x9daebfc0U | |
70 | typedef struct splat_cmd { | |
e554dffa BB |
71 | __u32 cmd_magic; /* Unique magic */ |
72 | __u32 cmd_subsystem; /* Target subsystem */ | |
73 | __u32 cmd_test; /* Subsystem test */ | |
74 | __u32 cmd_data_size; /* Opaque data size */ | |
ea70970f | 75 | char cmd_data_str[0]; /* Opaque data region */ |
76 | } splat_cmd_t; | |
77 | ||
78 | /* Valid ioctls */ | |
e554dffa BB |
79 | #define SPLAT_CFG _IOWR('f', 101, splat_cfg_t) |
80 | #define SPLAT_CMD _IOWR('f', 102, splat_cmd_t) | |
ea70970f | 81 | |
82 | /* Valid configuration commands */ | |
83 | #define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */ | |
84 | #define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */ | |
b831734a | 85 | #define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */ |
86 | #define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */ | |
ea70970f | 87 | #define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */ |
88 | #define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */ | |
89 | ||
e554dffa BB |
90 | /* |
91 | * Valid subsystem and test commands are defined in each subsystem as | |
92 | * SPLAT_SUBSYSTEM_*. We do need to be careful to avoid collisions, the | |
93 | * currently defined subsystems are as follows: | |
ea70970f | 94 | */ |
e554dffa BB |
95 | #define SPLAT_SUBSYSTEM_KMEM 0x0100 |
96 | #define SPLAT_SUBSYSTEM_TASKQ 0x0200 | |
97 | #define SPLAT_SUBSYSTEM_KRNG 0x0300 | |
98 | #define SPLAT_SUBSYSTEM_MUTEX 0x0400 | |
99 | #define SPLAT_SUBSYSTEM_CONDVAR 0x0500 | |
100 | #define SPLAT_SUBSYSTEM_THREAD 0x0600 | |
101 | #define SPLAT_SUBSYSTEM_RWLOCK 0x0700 | |
102 | #define SPLAT_SUBSYSTEM_TIME 0x0800 | |
103 | #define SPLAT_SUBSYSTEM_VNODE 0x0900 | |
104 | #define SPLAT_SUBSYSTEM_KOBJ 0x0a00 | |
105 | #define SPLAT_SUBSYSTEM_ATOMIC 0x0b00 | |
106 | #define SPLAT_SUBSYSTEM_LIST 0x0c00 | |
107 | #define SPLAT_SUBSYSTEM_GENERIC 0x0d00 | |
ec7d53e9 | 108 | #define SPLAT_SUBSYSTEM_CRED 0x0e00 |
e554dffa | 109 | #define SPLAT_SUBSYSTEM_UNKNOWN 0xff00 |
ea70970f | 110 | |
111 | #endif /* _SPLAT_CTL_H */ |