Lines Matching refs:device
55 static void print_all_attributes(struct udev_device *device, const char *key) {
58 udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
67 value = udev_device_get_sysattr_value(device, name);
87 static int print_device_chain(struct udev_device *device) {
92 "Udevadm info starts with the device specified by the devpath and then\n"
93 "walks up the chain of parent devices. It prints for every device\n"
95 "A rule to match, can be composed by the attributes of the device\n"
96 "and the attributes from one single parent device.\n"
99 printf(" looking at device '%s':\n", udev_device_get_devpath(device));
100 printf(" KERNEL==\"%s\"\n", udev_device_get_sysname(device));
101 str = udev_device_get_subsystem(device);
105 str = udev_device_get_driver(device);
109 print_all_attributes(device, "ATTR");
111 device_parent = device;
116 printf(" looking at parent device '%s':\n", udev_device_get_devpath(device_parent));
132 static void print_record(struct udev_device *device) {
137 printf("P: %s\n", udev_device_get_devpath(device));
139 str = udev_device_get_devnode(device);
143 i = udev_device_get_devlink_priority(device);
147 udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(device))
150 udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(device))
184 struct udev_device *device;
186 device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
187 if (device != NULL) {
188 print_record(device);
189 udev_device_unref(device);
266 " -q --query=TYPE Query device information:\n"
267 " name Name of device node\n"
269 " path sysfs device path\n"
270 " property The device properties\n"
272 " -p --path=SYSPATH sysfs device path used for query or attribute walk\n"
277 " -d --device-id-of-file=FILE Print major:minor of device containing this file\n"
286 _cleanup_udev_device_unref_ struct udev_device *device = NULL;
302 { "device-id-of-file", required_argument, NULL, 'd' },
327 if (device != NULL) {
328 fprintf(stderr, "device already specified\n");
332 device = find_device(udev, optarg, "/dev/");
333 if (device == NULL) {
334 fprintf(stderr, "device node not found\n");
340 if (device != NULL) {
341 fprintf(stderr, "device already specified\n");
345 device = find_device(udev, optarg, "/sys");
346 if (device == NULL) {
402 if (!device) {
407 device = find_device(udev, argv[optind], NULL);
408 if (!device) {
409 fprintf(stderr, "Unknown device, --name=, --path=, or absolute path in /dev/ or /sys expected.\n");
416 const char *node = udev_device_get_devnode(device);
419 fprintf(stderr, "no device node found\n");
424 printf("%s\n", udev_device_get_devnode(device));
426 printf("%s\n", udev_device_get_devnode(device) + strlen("/dev/"));
430 list_entry = udev_device_get_devlinks_list_entry(device);
443 printf("%s\n", udev_device_get_devpath(device));
446 list_entry = udev_device_get_properties_list_entry(device);
463 print_record(device);
470 if (!device && argv[optind]) {
471 device = find_device(udev, argv[optind], NULL);
472 if (!device) {
473 fprintf(stderr, "Unknown device, absolute path in /dev/ or /sys expected.\n");
477 if (!device) {
478 fprintf(stderr, "Unknown device, --name=, --path=, or absolute path in /dev/ or /sys expected.\n");
481 print_device_chain(device);