/systemd/src/libsystemd/sd-device/ |
H A D | device-util.h | 24 #define FOREACH_DEVICE_PROPERTY(device, key, value) \ 25 for (key = sd_device_get_property_first(device, &(value)); \ 27 key = sd_device_get_property_next(device, &(value))) 29 #define FOREACH_DEVICE_TAG(device, tag) \ 30 for (tag = sd_device_get_tag_first(device); \ 32 tag = sd_device_get_tag_next(device)) 34 #define FOREACH_DEVICE_SYSATTR(device, attr) \ 35 for (attr = sd_device_get_sysattr_first(device); \ 37 attr = sd_device_get_sysattr_next(device)) 39 #define FOREACH_DEVICE_DEVLINK(device, devlin [all...] |
H A D | device-private.h | 26 #include "sd-device.h" 31 int device_get_id_filename(sd_device *device, const char **ret); 33 int device_get_devlink_priority(sd_device *device, int *priority); 34 int device_get_watch_handle(sd_device *device, int *handle); 35 int device_get_devnode_mode(sd_device *device, mode_t *mode); 36 int device_get_devnode_uid(sd_device *device, uid_t *uid); 37 int device_get_devnode_gid(sd_device *device, gid_t *gid); 39 void device_seal(sd_device *device); 40 void device_set_is_initialized(sd_device *device); 41 void device_set_watch_handle(sd_device *device, in [all...] |
H A D | sd-device.c | 25 #include "sd-device.h" 28 #include "device-internal.h" 29 #include "device-private.h" 30 #include "device-util.h" 46 _cleanup_(sd_device_unrefp) sd_device *device = NULL; 50 device = new0(sd_device, 1); 51 if (!device) 54 device->n_ref = 1; 55 device->watch_handle = -1; 57 *ret = device; 63 sd_device_ref(sd_device *device) argument 70 sd_device_unref(sd_device *device) argument 96 device_add_property_aux(sd_device *device, const char *_key, const char *_value, bool db) argument 146 device_add_property_internal(sd_device *device, const char *key, const char *value) argument 150 device_set_syspath(sd_device *device, const char *_syspath, bool verify) argument 331 device_set_devtype(sd_device *device, const char *_devtype) argument 353 device_set_ifindex(sd_device *device, const char *_ifindex) argument 372 device_set_devname(sd_device *device, const char *_devname) argument 400 device_set_devmode(sd_device *device, const char *_devmode) argument 423 device_set_devnum(sd_device *device, const char *major, const char *minor) argument 457 handle_uevent_line(sd_device *device, const char *key, const char *value, const char **major, const char **minor) argument 495 device_read_uevent_file(sd_device *device) argument 591 sd_device_get_ifindex(sd_device *device, int *ifindex) argument 681 sd_device_get_syspath(sd_device *device, const char **ret) argument 747 device_set_subsystem(sd_device *device, const char *_subsystem) argument 771 sd_device_get_subsystem(sd_device *device, const char **ret) argument 813 sd_device_get_devtype(sd_device *device, const char **devtype) argument 860 sd_device_get_devnum(sd_device *device, dev_t *devnum) argument 875 device_set_driver(sd_device *device, const char *_driver) argument 899 sd_device_get_driver(sd_device *device, const char **ret) argument 933 sd_device_get_devpath(sd_device *device, const char **devpath) argument 945 sd_device_get_devname(sd_device *device, const char **devname) argument 965 device_set_sysname(sd_device *device) argument 1010 sd_device_get_sysname(sd_device *device, const char **ret) argument 1029 sd_device_get_sysnum(sd_device *device, const char **ret) argument 1052 device_add_tag(sd_device *device, const char *tag) argument 1075 device_add_devlink(sd_device *device, const char *devlink) argument 1095 device_add_property_internal_from_string(sd_device *device, const char *str) argument 1118 device_set_usec_initialized(sd_device *device, const char *initialized) argument 1138 handle_db_line(sd_device *device, char key, const char *value) argument 1190 device_get_id_filename(sd_device *device, const char **ret) argument 1253 device_read_db_aux(sd_device *device, bool force) argument 1344 device_read_db(sd_device *device) argument 1348 sd_device_get_is_initialized(sd_device *device, int *initialized) argument 1363 sd_device_get_usec_since_initialized(sd_device *device, uint64_t *usec) argument 1390 sd_device_get_tag_first(sd_device *device) argument 1404 sd_device_get_tag_next(sd_device *device) argument 1418 sd_device_get_devlink_first(sd_device *device) argument 1432 sd_device_get_devlink_next(sd_device *device) argument 1446 device_properties_prepare(sd_device *device) argument 1500 sd_device_get_property_first(sd_device *device, const char **_value) argument 1522 sd_device_get_property_next(sd_device *device, const char **_value) argument 1544 device_sysattrs_read_all(sd_device *device) argument 1593 sd_device_get_sysattr_first(sd_device *device) argument 1613 sd_device_get_sysattr_next(sd_device *device) argument 1625 sd_device_has_tag(sd_device *device, const char *tag) argument 1634 sd_device_get_property_value(sd_device *device, const char *key, const char **_value) argument 1656 device_add_sysattr_value(sd_device *device, const char *_key, char *value) argument 1684 device_get_sysattr_value(sd_device *device, const char *_key, const char **_value) argument 1702 sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const char **_value) argument 1779 device_remove_sysattr_value(sd_device *device, const char *_key) argument 1793 sd_device_set_sysattr_value(sd_device *device, const char *sysattr, char *_value) argument [all...] |
H A D | device-enumerator-private.h | 22 #include "sd-device.h" 26 int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device); 31 #define FOREACH_DEVICE_AND_SUBSYSTEM(enumerator, device) \ 32 for (device = device_enumerator_get_first(enumerator); \ 33 device; \ 34 device = device_enumerator_get_next(enumerator))
|
H A D | device-private.c | 25 #include "sd-device.h" 28 #include "device-internal.h" 29 #include "device-private.h" 30 #include "device-util.h" 48 int device_add_property(sd_device *device, const char *key, const char *value) { argument 51 assert(device); 54 r = device_add_property_aux(device, key, value, false); 59 r = device_add_property_aux(device, key, value, true); 67 static int device_add_property_internal_from_string(sd_device *device, const char *str) { argument 71 assert(device); 90 handle_db_line(sd_device *device, char key, const char *value) argument 142 device_set_devlink_priority(sd_device *device, int priority) argument 148 device_set_is_initialized(sd_device *device) argument 154 device_ensure_usec_initialized(sd_device *device, sd_device *device_old) argument 177 device_read_db(sd_device *device) argument 270 device_get_properties_generation(sd_device *device) argument 276 device_get_tags_generation(sd_device *device) argument 282 device_get_devlinks_generation(sd_device *device) argument 288 device_get_devnode_mode(sd_device *device, mode_t *mode) argument 303 device_get_devnode_uid(sd_device *device, uid_t *uid) argument 318 device_set_devuid(sd_device *device, const char *uid) argument 338 device_get_devnode_gid(sd_device *device, gid_t *gid) argument 353 device_set_devgid(sd_device *device, const char *gid) argument 373 device_amend(sd_device *device, const char *key, const char *value) argument 473 device_append(sd_device *device, char *key, const char **_major, const char **_minor, uint64_t *_seqnum, DeviceAction *_action) argument 536 device_seal(sd_device *device) argument 542 device_verify(sd_device *device, DeviceAction action, uint64_t seqnum) argument 641 device_update_properties_bufs(sd_device *device) argument 691 device_get_properties_nulstr(sd_device *device, const uint8_t **nulstr, size_t *len) argument 708 device_get_properties_strv(sd_device *device, char ***strv) argument 723 device_get_devlink_priority(sd_device *device, int *priority) argument 738 device_get_watch_handle(sd_device *device, int *handle) argument 753 device_set_watch_handle(sd_device *device, int handle) argument 759 device_rename(sd_device *device, const char *name) argument 887 device_cleanup_tags(sd_device *device) argument 896 device_cleanup_devlinks(sd_device *device) argument 905 device_remove_tag(sd_device *device, const char *tag) argument 914 device_tag(sd_device *device, const char *tag, bool add) argument 941 device_tag_index(sd_device *device, sd_device *device_old, bool add) argument 965 device_has_info(sd_device *device) argument 986 device_set_db_persist(sd_device *device) argument 992 device_update_db(sd_device *device) argument 1095 device_delete_db(sd_device *device) argument 1115 device_read_db_force(sd_device *device) argument [all...] |
H A D | device-internal.h | 110 int device_add_property_aux(sd_device *device, const char *key, const char *value, bool db); 111 int device_add_property_internal(sd_device *device, const char *key, const char *value); 112 int device_read_uevent_file(sd_device *device); 113 int device_read_db_aux(sd_device *device, bool force); 115 int device_set_syspath(sd_device *device, const char *_syspath, bool verify); 116 int device_set_ifindex(sd_device *device, const char *ifindex); 117 int device_set_devmode(sd_device *device, const char *devmode); 118 int device_set_devname(sd_device *device, const char *_devname); 119 int device_set_devtype(sd_device *device, const char *_devtype); 120 int device_set_devnum(sd_device *device, cons [all...] |
H A D | device-enumerator.c | 21 #include "sd-device.h" 24 #include "device-enumerator-private.h" 25 #include "device-util.h" 89 sd_device *device; local 91 while ((device = prioq_pop(enumerator->devices))) 92 sd_device_unref(device); 288 /* For sound cards the control device must be enumerated last to 289 * make sure it's the final device node that gets ACLs applied. 328 int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device) { argument 332 assert_return(device, 347 match_sysattr_value(sd_device *device, const char *sysattr, const char *match_value) argument 367 match_sysattr(sd_device_enumerator *enumerator, sd_device *device) argument 386 match_property(sd_device_enumerator *enumerator, sd_device *device) argument 418 match_tag(sd_device_enumerator *enumerator, sd_device *device) argument 432 match_parent(sd_device_enumerator *enumerator, sd_device *device) argument 840 sd_device *device; local 898 sd_device *device; local [all...] |
/systemd/src/systemd/ |
H A D | sd-device.h | 34 /* device */ 36 sd_device *sd_device_ref(sd_device *device); 37 sd_device *sd_device_unref(sd_device *device); 47 int sd_device_get_syspath(sd_device *device, const char **ret); 48 int sd_device_get_subsystem(sd_device *device, const char **ret); 49 int sd_device_get_devtype(sd_device *device, const char **ret); 50 int sd_device_get_devnum(sd_device *device, dev_t *devnum); 51 int sd_device_get_ifindex(sd_device *device, int *ifindex); 52 int sd_device_get_driver(sd_device *device, const char **ret); 53 int sd_device_get_devpath(sd_device *device, cons [all...] |
/systemd/src/libudev/ |
H A D | libudev-device-private.c | 23 #include "device-private.h" 24 #include "libudev-device-internal.h" 34 device_old = udev_device_old->device; 36 r = device_tag_index(udev_device->device, device_old, add); 48 r = device_update_db(udev_device->device); 60 r = device_delete_db(udev_device->device); 72 r = sd_device_get_ifindex(udev_device->device, &ifindex); 85 r = sd_device_get_property_value(udev_device->device, "DEVPATH_OLD", &devpath_old); 100 r = device_get_devnode_mode(udev_device->device, &mode); 115 r = device_get_devnode_uid(udev_device->device, 221 struct udev_device *device; local 261 struct udev_device *device; local 279 struct udev_device *device; local [all...] |
H A D | libudev-device.c | 38 #include "sd-device.h" 41 #include "device-private.h" 42 #include "device-util.h" 43 #include "libudev-device-internal.h" 48 * SECTION:libudev-device 52 * by their syspath, every device has exactly one path in the kernel sys 59 * @udev_device: udev device 61 * This is only valid if the device was received through a monitor. Devices read from 74 r = sd_device_get_property_value(udev_device->device, "SEQNUM", &seqnum); 93 * @udev_device: udev device [all...] |
H A D | libudev-device-internal.h | 24 #include "sd-device.h" 31 * Opaque object representing one kernel sys device. 36 /* real device object */ 37 sd_device *device; member in struct:udev_device
|
/systemd/test/mocks/ |
H A D | fsck | 15 device=$1 17 echo "Running fake fsck on $device" 24 echo "$pass $current $maxprogress $device">&$fd
|
/systemd/src/hibernate-resume/ |
H A D | hibernate-resume.c | 31 const char *device; local 50 device = argv[1]; 52 if (stat(device, &st) < 0) { 53 log_error_errno(errno, "Failed to stat '%s': %m", device); 58 log_error("Resume device '%s' is not a block device.", device); 80 log_info("Could not resume from '%s' (%s).", device, major_minor);
|
/systemd/src/udev/ |
H A D | udevadm-info.c | 53 static void print_all_attributes(struct udev_device *device, const char *key) { argument 56 udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) { 65 value = udev_device_get_sysattr_value(device, name); 85 static int print_device_chain(struct udev_device *device) { argument 90 "Udevadm info starts with the device specified by the devpath and then\n" 91 "walks up the chain of parent devices. It prints for every device\n" 93 "A rule to match, can be composed by the attributes of the device\n" 94 "and the attributes from one single parent device.\n" 97 printf(" looking at device '%s':\n", udev_device_get_devpath(device)); 130 print_record(struct udev_device *device) argument 182 struct udev_device *device; local 284 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local [all...] |
H A D | udev-watch.c | 61 char device[UTIL_PATH_SIZE]; local 68 len = readlinkat(dirfd(dir), ent->d_name, device, sizeof(device)); 69 if (len <= 0 || len == (ssize_t)sizeof(device)) 71 device[len] = '\0'; 73 dev = udev_device_new_from_device_id(udev, device); 139 char device[UTIL_NAME_SIZE]; local 146 len = readlink(filename, device, sizeof(device)); 147 if (len <= 0 || (size_t)len == sizeof(device)) [all...] |
H A D | udevadm-monitor.c | 40 static void print_device(struct udev_device *device, const char *source, int prop) { argument 47 udev_device_get_action(device), 48 udev_device_get_devpath(device), 49 udev_device_get_subsystem(device)); 53 udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(device)) 252 struct udev_device *device; local 254 device = udev_monitor_receive_device(kernel_monitor); 255 if (device == NULL) 257 print_device(device, "KERNEL", prop); 258 udev_device_unref(device); 260 struct udev_device *device; local [all...] |
/systemd/src/test/ |
H A D | test-libudev.c | 34 static void print_device(struct udev_device *device) { argument 40 printf("*** device: %p ***\n", device); 41 str = udev_device_get_action(device); 45 str = udev_device_get_syspath(device); 48 str = udev_device_get_sysname(device); 51 str = udev_device_get_sysnum(device); 55 str = udev_device_get_devpath(device); 58 str = udev_device_get_subsystem(device); 62 str = udev_device_get_devtype(device); 108 _cleanup_udev_device_unref_ struct udev_device *device; local 122 _cleanup_udev_device_unref_ struct udev_device *device; local 149 struct udev_device *device; local 161 struct udev_device *device; local 198 struct udev_device *device; local 264 struct udev_device *device; local [all...] |
/systemd/src/udev/net/ |
H A D | link-config.c | 243 int link_config_get(link_config_ctx *ctx, struct udev_device *device, argument 248 assert(device); 254 attr_value = udev_device_get_sysattr_value(device, "address"); 260 udev_device_get_property_value(device, "ID_PATH"), 261 udev_device_get_driver(udev_device_get_parent(device)), 262 udev_device_get_property_value(device, "ID_NET_DRIVER"), 263 udev_device_get_devtype(device), 264 udev_device_get_sysname(device))) { 268 attr_value = udev_device_get_sysattr_value(device, "name_assign_type"); 273 log_warning("Config file %s applies to device base 300 mac_is_random(struct udev_device *device) argument 317 should_rename(struct udev_device *device, bool respect_predictable) argument 348 get_mac(struct udev_device *device, bool want_random, struct ether_addr *mac) argument 372 link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_device *device, const char **name) argument 481 link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret) argument [all...] |
H A D | link-config.h | 83 int link_config_get(link_config_ctx *ctx, struct udev_device *device, struct link_config **ret); 84 int link_config_apply(link_config_ctx *ctx, struct link_config *config, struct udev_device *device, const char **name); 86 int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret);
|
/systemd/src/backlight/ |
H A D | backlight.c | 33 static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) { argument 37 assert(device); 39 parent = udev_device_get_parent(device); 60 /* A connector DRM device, let's ignore all but LVDS and eDP! */ 75 log_warning("Cannot parse PCI class %s of device %s:%s.", 104 static bool validate_device(struct udev *udev, struct udev_device *device) { argument 112 assert(device); 115 * backlight device. For backlight devices there might be 124 * device to userspace. However, we still need to make sure 126 * device fo 205 get_max_brightness(struct udev_device *device) argument 235 clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) argument 273 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local [all...] |
/systemd/src/libsystemd-network/ |
H A D | dhcp-identifier.c | 62 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local 76 device = udev_device_new_from_device_id(udev, ifindex_str); 77 if (device) { 78 if (udev_device_get_is_initialized(device) <= 0) 82 name = net_get_name(device);
|
/systemd/src/rfkill/ |
H A D | rfkill.c | 61 struct udev_device *device; local 71 device = udev_device_new_from_subsystem_sysname(udev, "rfkill", sysname); 72 if (!device) 73 return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open device: %m"); 75 name = udev_device_get_sysattr_value(device, "name"); 78 udev_device_unref(device); 82 log_debug("Operating on rfkill device '%s'.", name); 84 *ret = device; 90 struct udev_device *device, 99 assert(device); 88 wait_for_initialized( struct udev *udev, struct udev_device *device, struct udev_device **ret) argument 164 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local 203 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local 265 _cleanup_udev_device_unref_ struct udev_device *device = NULL; local [all...] |
/systemd/src/udev/v4l_id/ |
H A D | v4l_id.c | 38 char *device; local 46 printf("%s [-h,--help] <device file>\n\n" 47 "Video4Linux device identification.\n\n" 58 device = argv[optind]; 59 if (device == NULL) 62 fd = open(device, O_RDONLY);
|
/systemd/src/cryptsetup/ |
H A D | cryptsetup-generator.c | 57 const char *device, 69 assert(device); 93 u = fstab_node_to_udev_node(device); 97 r = unit_name_from_path(u, ".device", &d); 113 "BindsTo=dev-mapper-%i.device\n" 137 r = unit_name_from_path(uu, ".device", &dd); 159 r = generator_write_timeouts(arg_dest, device, name, options, &filtered); 213 to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL); 223 dmname = strjoin("dev-mapper-", e, ".device", NULL); 227 r = write_drop_in(arg_dest, dmname, 90, "device 55 create_disk( const char *name, const char *device, const char *password, const char *options) argument 385 _cleanup_free_ char *name = NULL, *device = NULL, *keyfile = NULL, *options = NULL; local 433 _cleanup_free_ char *device = NULL; local [all...] |
/systemd/src/fsck/ |
H A D | fsck.c | 31 #include "sd-device.h" 37 #include "device-util.h" 200 _cleanup_free_ char *device = NULL; local 204 if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4) { 233 fprintf(console, "\r%s: fsck %3.1f%% complete...\r%n", device, p, &m); 278 const char *device, *type; local 308 device = argv[1]; 310 if (stat(device, &st) < 0) { 311 r = log_error_errno(errno, "Failed to stat %s: %m", device); 316 log_error("%s is not a block device [all...] |