Lines Matching refs:device
53 static void print_all_attributes(struct udev_device *device, const char *key) {
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) {
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));
98 printf(" KERNEL==\"%s\"\n", udev_device_get_sysname(device));
99 str = udev_device_get_subsystem(device);
103 str = udev_device_get_driver(device);
107 print_all_attributes(device, "ATTR");
109 device_parent = device;
114 printf(" looking at parent device '%s':\n", udev_device_get_devpath(device_parent));
130 static void print_record(struct udev_device *device) {
135 printf("P: %s\n", udev_device_get_devpath(device));
137 str = udev_device_get_devnode(device);
141 i = udev_device_get_devlink_priority(device);
145 udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(device))
148 udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(device))
182 struct udev_device *device;
184 device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
185 if (device != NULL) {
186 print_record(device);
187 udev_device_unref(device);
264 " -q --query=TYPE Query device information:\n"
265 " name Name of device node\n"
267 " path sysfs device path\n"
268 " property The device properties\n"
270 " -p --path=SYSPATH sysfs device path used for query or attribute walk\n"
275 " -d --device-id-of-file=FILE Print major:minor of device containing this file\n"
284 _cleanup_udev_device_unref_ struct udev_device *device = NULL;
300 { "device-id-of-file", required_argument, NULL, 'd' },
325 if (device != NULL) {
326 fprintf(stderr, "device already specified\n");
330 device = find_device(udev, optarg, "/dev/");
331 if (device == NULL) {
332 fprintf(stderr, "device node not found\n");
338 if (device != NULL) {
339 fprintf(stderr, "device already specified\n");
343 device = find_device(udev, optarg, "/sys");
344 if (device == NULL) {
400 if (!device) {
405 device = find_device(udev, argv[optind], NULL);
406 if (!device) {
407 fprintf(stderr, "Unknown device, --name=, --path=, or absolute path in /dev/ or /sys expected.\n");
414 const char *node = udev_device_get_devnode(device);
417 fprintf(stderr, "no device node found\n");
422 printf("%s\n", udev_device_get_devnode(device));
424 printf("%s\n", udev_device_get_devnode(device) + strlen("/dev/"));
428 list_entry = udev_device_get_devlinks_list_entry(device);
441 printf("%s\n", udev_device_get_devpath(device));
444 list_entry = udev_device_get_properties_list_entry(device);
461 print_record(device);
468 if (!device && argv[optind]) {
469 device = find_device(udev, argv[optind], NULL);
470 if (!device) {
471 fprintf(stderr, "Unknown device, absolute path in /dev/ or /sys expected.\n");
475 if (!device) {
476 fprintf(stderr, "Unknown device, --name=, --path=, or absolute path in /dev/ or /sys expected.\n");
479 print_device_chain(device);