blob: 58787f569ad971c138a6f0a54fe2372a105797f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
* http://www.illumos.org/license/CDDL.
*/
/*
* Copyright 2019 Joyent, Inc.
*/
#ifndef _UFMTEST_H
#define _UFMTEST_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#include <sys/cred.h>
#include <sys/dditypes.h>
#include <sys/nvpair.h>
#include <sys/param.h>
#else
#include <sys/nvpair.h>
#include <sys/param.h>
#include <sys/types.h>
#endif /* _KERNEL */
#define DDI_UFMTEST_DEV "/dev/ufmtest"
#define UFMTEST_IOC ('u' << 24) | ('f' << 16) | ('t' << 8)
#define UFMTEST_IOC_SET_FW (UFMTEST_IOC | 1)
#define UFMTEST_IOC_TOGGLE_FAILS (UFMTEST_IOC | 2)
#define UFMTEST_IOC_DO_UPDATE (UFMTEST_IOC | 3)
typedef struct ufmtest_ioc_setfw {
size_t utsw_bufsz;
caddr_t utsw_buf;
} ufmtest_ioc_setfw_t;
#ifdef _KERNEL
typedef struct ufmtest_ioc_setfw32 {
size32_t utsw_bufsz;
caddr32_t utsw_buf;
} ufmtest_ioc_setfw32_t;
#endif /* _KERNEL */
/*
* The argument for the UFMTEST_IOC_TOGGLE_FAILS ioctl is a bitfield
* indicating which of the UFM entry points we want to simulate a failure on.
*/
typedef enum {
UFMTEST_FAIL_GETCAPS = 1 << 0,
UFMTEST_FAIL_NIMAGES = 1 << 1,
UFMTEST_FAIL_FILLIMAGE = 1 << 2,
UFMTEST_FAIL_FILLSLOT = 1 << 3
} ufmtest_failflags_t;
#define UFMTEST_MAX_FAILFLAGS (UFMTEST_FAIL_GETCAPS | UFMTEST_FAIL_NIMAGES | \
UFMTEST_FAIL_FILLIMAGE | UFMTEST_FAIL_FILLSLOT)
typedef struct ufmtest_ioc_fails {
ufmtest_failflags_t utfa_flags;
} ufmtest_ioc_fails_t;
#ifdef __cplusplus
}
#endif
#endif /* _UFMTEST_H */
|