]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
118ecf32 DH |
2 | #pragma once |
3 | ||
118ecf32 DH |
4 | typedef enum DeviceType DeviceType; |
5 | typedef struct SessionDevice SessionDevice; | |
6 | ||
7 | #include "list.h" | |
118ecf32 | 8 | #include "logind.h" |
118ecf32 DH |
9 | |
10 | enum DeviceType { | |
11 | DEVICE_TYPE_UNKNOWN, | |
118ecf32 DH |
12 | DEVICE_TYPE_DRM, |
13 | DEVICE_TYPE_EVDEV, | |
14 | }; | |
15 | ||
16 | struct SessionDevice { | |
17 | Session *session; | |
18 | Device *device; | |
19 | ||
20 | dev_t dev; | |
21 | char *node; | |
22 | int fd; | |
04104444 LP |
23 | DeviceType type:3; |
24 | bool active:1; | |
25 | bool pushed_fd:1; | |
118ecf32 DH |
26 | |
27 | LIST_FIELDS(struct SessionDevice, sd_by_device); | |
28 | }; | |
29 | ||
aed24c4c | 30 | int session_device_new(Session *s, dev_t dev, bool open_device, SessionDevice **out); |
118ecf32 DH |
31 | void session_device_free(SessionDevice *sd); |
32 | void session_device_complete_pause(SessionDevice *sd); | |
33 | ||
34 | void session_device_resume_all(Session *s); | |
35 | void session_device_pause_all(Session *s); | |
14cb109d | 36 | unsigned session_device_try_pause_all(Session *s); |
aed24c4c FB |
37 | |
38 | int session_device_save(SessionDevice *sd); | |
39 | void session_device_attach_fd(SessionDevice *sd, int fd, bool active); |