]> git.proxmox.com Git - mirror_spl-debian.git/blob - include/splat-ctl.h
SLES10 Fixes (part 7)
[mirror_spl-debian.git] / include / splat-ctl.h
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
27 #ifndef _SPLAT_CTL_H
28 #define _SPLAT_CTL_H
29
30 /* Contains shared definitions which both the userspace
31 * and kernelspace portions of splat must agree on.
32 */
33
34 #define SPLAT_MAJOR 225 /* XXX - Arbitrary */
35 #define SPLAT_MINORS 1
36 #define SPLAT_NAME "splatctl"
37 #define SPLAT_DEV "/dev/splatctl"
38
39 #define SPLAT_NAME_SIZE 20
40 #define SPLAT_DESC_SIZE 60
41
42 typedef struct splat_user {
43 char name[SPLAT_NAME_SIZE]; /* short name */
44 char desc[SPLAT_DESC_SIZE]; /* short description */
45 int id; /* unique numeric id */
46 } splat_user_t;
47
48 #define SPLAT_CFG_MAGIC 0x15263748U
49 typedef struct splat_cfg {
50 unsigned int cfg_magic; /* Unique magic */
51 int cfg_cmd; /* Config command */
52 int cfg_arg1; /* Config command arg 1 */
53 int cfg_rc1; /* Config response 1 */
54 union {
55 struct {
56 int size;
57 splat_user_t descs[0];
58 } splat_subsystems;
59 struct {
60 int size;
61 splat_user_t descs[0];
62 } splat_tests;
63 } cfg_data;
64 } splat_cfg_t;
65
66 #define SPLAT_CMD_MAGIC 0x9daebfc0U
67 typedef struct splat_cmd {
68 unsigned int cmd_magic; /* Unique magic */
69 int cmd_subsystem; /* Target subsystem */
70 int cmd_test; /* Subsystem test */
71 int cmd_data_size; /* Extra opaque data */
72 char cmd_data_str[0]; /* Opaque data region */
73 } splat_cmd_t;
74
75 /* Valid ioctls */
76 #define SPLAT_CFG _IOWR('f', 101, long)
77 #define SPLAT_CMD _IOWR('f', 102, long)
78
79 /* Valid configuration commands */
80 #define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
81 #define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
82 #define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
83 #define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
84 #define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
85 #define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
86
87 /* Valid subsystem and test commands defined in each subsystem, we do
88 * need to be careful to avoid colisions. That alone may argue to define
89 * them all here, for now we just define the global error codes.
90 */
91 #define SPLAT_SUBSYSTEM_UNKNOWN 0xF00
92 #define SPLAT_TEST_UNKNOWN 0xFFF
93
94 #endif /* _SPLAT_CTL_H */