[go: up one dir, main page]

File: ap-check.h

package info (click to toggle)
s390-tools 2.35.0-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 12,220 kB
  • sloc: ansic: 184,236; sh: 12,152; cpp: 4,954; makefile: 2,763; perl: 2,519; asm: 1,085; python: 697; xml: 29
file content (76 lines) | stat: -rw-r--r-- 1,562 bytes parent folder | download | duplicates (2)
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
76
/*
 * ap-check - Validate vfio-ap mediated device configuration changes
 *
 * Copyright IBM Corp. 2022
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef AP_CHECK_H
#define AP_CHECK_H

#include <stdbool.h>

/*
 * List of all of the supported mdevctl actions
 */
enum mdevctl_action_id {
	MDEVCTL_ACTION_DEFINE = 0,
	MDEVCTL_ACTION_LIST,
	MDEVCTL_ACTION_MODIFY,
	MDEVCTL_ACTION_START,
	MDEVCTL_ACTION_STOP,
	MDEVCTL_ACTION_TYPES,
	MDEVCTL_ACTION_UNDEFINE,
	MDEVCTL_ACTION_ATTRIBUTES,
	MDEVCTL_ACTION_CAPABILITIES,
	/* UNKNOWN must always be the last in the list */
	MDEVCTL_ACTION_UNKNOWN,
};
#define NUM_MDEVCTL_ACTIONS MDEVCTL_ACTION_UNKNOWN

struct mdevctl_action {
	enum mdevctl_action_id id;
	const char action[32];
};

enum mdevctl_event_id {
	MDEVCTL_EVENT_PRE = 0,
	MDEVCTL_EVENT_POST,
	MDEVCTL_EVENT_GET,
	MDEVCTL_EVENT_LIVE,
	MDEVCTL_EVENT_UNKNOWN,
};
#define NUM_MDEVCTL_EVENTS MDEVCTL_EVENT_UNKNOWN

struct mdevctl_event {
	enum mdevctl_event_id id;
	const char event[32];
};

/* ap-check special exit codes */
#define APC_EXIT_UNKNOWN_TYPE 2

struct ap_check_anchor {
	enum mdevctl_event_id event;
	enum mdevctl_action_id action;
	char *uuid;
	char *parent;
	char *type;
	struct vfio_ap_device *dev;
	/* Active Masks */
	char apmask[80];
	char aqmask[80];
	/* Persistent Masks */
	char p_apmask[80];
	char p_aqmask[80];
	bool cleanup_lock;
};

struct other_mdev_cb_data {
	const char *uuid;
	struct vfio_ap_device *dev;
};

#endif /* AP_CHECK_H */