]> git.proxmox.com Git - mirror_spl-debian.git/blob - include/splat-ctl.h
5be5e3a4a5ec93d21ac01f9187c9c96b00bc1e96
[mirror_spl-debian.git] / include / splat-ctl.h
1 #ifndef _SPLAT_CTL_H
2 #define _SPLAT_CTL_H
3
4 /* Contains shared definitions which both the userspace
5 * and kernelspace portions of splat must agree on.
6 */
7
8 #define SPLAT_MAJOR 229 /* XXX - Arbitrary */
9 #define SPLAT_MINORS 1
10 #define SPLAT_DEV "/dev/splatctl"
11
12 #define SPLAT_NAME_SIZE 12
13 #define SPLAT_DESC_SIZE 60
14
15 typedef struct splat_user {
16 char name[SPLAT_NAME_SIZE]; /* short name */
17 char desc[SPLAT_DESC_SIZE]; /* short description */
18 int id; /* unique numeric id */
19 } splat_user_t;
20
21 #define SPLAT_CFG_MAGIC 0x15263748U
22 typedef struct splat_cfg {
23 unsigned int cfg_magic; /* Unique magic */
24 int cfg_cmd; /* Config command */
25 int cfg_arg1; /* Config command arg 1 */
26 int cfg_rc1; /* Config response 1 */
27 union {
28 struct {
29 int size;
30 splat_user_t descs[0];
31 } splat_subsystems;
32 struct {
33 int size;
34 splat_user_t descs[0];
35 } splat_tests;
36 } cfg_data;
37 } splat_cfg_t;
38
39 #define SPLAT_CMD_MAGIC 0x9daebfc0U
40 typedef struct splat_cmd {
41 unsigned int cmd_magic; /* Unique magic */
42 int cmd_subsystem; /* Target subsystem */
43 int cmd_test; /* Subsystem test */
44 int cmd_data_size; /* Extra opaque data */
45 char cmd_data_str[0]; /* Opaque data region */
46 } splat_cmd_t;
47
48 /* Valid ioctls */
49 #define SPLAT_CFG _IOWR('f', 101, long)
50 #define SPLAT_CMD _IOWR('f', 102, long)
51
52 /* Valid configuration commands */
53 #define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
54 #define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
55 #define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
56 #define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
57 #define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
58 #define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
59
60 /* Valid subsystem and test commands defined in each subsystem, we do
61 * need to be careful to avoid colisions. That alone may argue to define
62 * them all here, for now we just define the global error codes.
63 */
64 #define SPLAT_SUBSYSTEM_UNKNOWN 0xF00
65 #define SPLAT_TEST_UNKNOWN 0xFFF
66
67 #endif /* _SPLAT_CTL_H */