2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2013-10-13 02:28:21 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-14 12:32:33 +01:00
|
|
|
#include "sd-device.h"
|
|
|
|
|
2019-03-09 02:45:15 +01:00
|
|
|
#include "device-private.h"
|
2018-11-13 11:10:13 +01:00
|
|
|
#include "time-util.h"
|
|
|
|
|
2018-11-13 13:42:42 +01:00
|
|
|
typedef enum ResolveNameTiming {
|
|
|
|
RESOLVE_NAME_NEVER,
|
|
|
|
RESOLVE_NAME_LATE,
|
|
|
|
RESOLVE_NAME_EARLY,
|
|
|
|
_RESOLVE_NAME_TIMING_MAX,
|
|
|
|
_RESOLVE_NAME_TIMING_INVALID = -1,
|
|
|
|
} ResolveNameTiming;
|
|
|
|
|
|
|
|
ResolveNameTiming resolve_name_timing_from_string(const char *s) _pure_;
|
|
|
|
const char *resolve_name_timing_to_string(ResolveNameTiming i) _const_;
|
|
|
|
|
2018-11-13 11:10:13 +01:00
|
|
|
int udev_parse_config_full(
|
|
|
|
unsigned *ret_children_max,
|
|
|
|
usec_t *ret_exec_delay_usec,
|
2018-11-13 11:33:32 +01:00
|
|
|
usec_t *ret_event_timeout_usec,
|
2020-04-09 11:14:25 +02:00
|
|
|
ResolveNameTiming *ret_resolve_name_timing,
|
|
|
|
int *ret_timeout_signal);
|
2018-11-13 11:10:13 +01:00
|
|
|
|
|
|
|
static inline int udev_parse_config(void) {
|
2020-04-09 11:14:25 +02:00
|
|
|
return udev_parse_config_full(NULL, NULL, NULL, NULL, NULL);
|
2018-11-13 11:10:13 +01:00
|
|
|
}
|
2018-12-14 12:32:33 +01:00
|
|
|
|
2020-10-12 18:18:33 +02:00
|
|
|
int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t deadline, sd_device **ret);
|
|
|
|
int device_wait_for_devlink(const char *path, const char *subsystem, usec_t deadline, sd_device **ret);
|
2019-03-04 04:16:46 +01:00
|
|
|
int device_is_renaming(sd_device *dev);
|
2019-03-09 02:45:15 +01:00
|
|
|
bool device_for_action(sd_device *dev, DeviceAction action);
|