Lines Matching defs:parent

80         struct udev_device *parent = dev;
85 while (parent != NULL) {
88 subsystem = udev_device_get_subsystem(parent);
91 dev = parent;
92 parent = udev_device_get_parent(parent);
97 static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) {
98 struct udev *udev = udev_device_get_udev(parent);
104 assert(parent);
107 targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
116 parent = NULL;
120 format_lun_number(parent, &lun);
125 return parent;
128 static struct udev_device *handle_scsi_sas_wide_port(struct udev_device *parent, char **path) {
129 struct udev *udev = udev_device_get_udev(parent);
136 assert(parent);
139 targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
154 parent = NULL;
158 format_lun_number(parent, &lun);
163 return parent;
166 static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path)
168 struct udev *udev = udev_device_get_udev(parent);
181 assert(parent);
184 targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
198 /* The next parent is sas port */
201 parent = NULL;
211 parent = NULL;
217 parent = handle_scsi_sas_wide_port(parent, path);
224 parent = NULL;
228 /* The port's parent is either hba or expander */
231 parent = NULL;
243 parent = NULL;
248 format_lun_number(parent, &lun);
259 return parent;
262 static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path) {
263 struct udev *udev = udev_device_get_udev(parent);
273 assert(parent);
277 transportdev = parent;
292 parent = NULL;
297 parent = NULL;
303 parent = NULL;
309 parent = NULL;
313 format_lun_number(parent, &lun);
319 return parent;
322 static struct udev_device *handle_scsi_ata(struct udev_device *parent, char **path) {
323 struct udev *udev = udev_device_get_udev(parent);
329 assert(parent);
332 targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
346 parent = NULL;
352 return parent;
355 static struct udev_device *handle_scsi_default(struct udev_device *parent, char **path) {
365 assert(parent);
368 hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
372 name = udev_device_get_sysname(parent);
399 parent = NULL;
405 parent = NULL;
423 * own instance number per parent device; relying on the global host
431 parent = NULL;
442 static struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char **path) {
450 assert(parent);
453 hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
475 format_lun_number(parent, &lun);
478 return parent;
481 static struct udev_device *handle_scsi(struct udev_device *parent, char **path, bool *supported_parent) {
486 devtype = udev_device_get_devtype(parent);
488 return parent;
491 id = udev_device_get_sysattr_value(parent, "ieee1394_id");
493 parent = skip_subsystem(parent, "scsi");
500 name = udev_device_get_syspath(parent);
503 parent = handle_scsi_fibre_channel(parent, path);
509 parent = handle_scsi_sas(parent, path);
515 parent = handle_scsi_iscsi(parent, path);
521 parent = handle_scsi_ata(parent, path);
526 parent = handle_scsi_hyperv(parent, path);
530 parent = handle_scsi_default(parent, path);
532 return parent;
535 static struct udev_device *handle_cciss(struct udev_device *parent, char **path) {
539 str = udev_device_get_sysname(parent);
544 parent = skip_subsystem(parent, "cciss");
545 return parent;
562 static struct udev_device *handle_usb(struct udev_device *parent, char **path) {
567 devtype = udev_device_get_devtype(parent);
569 return parent;
571 return parent;
573 str = udev_device_get_sysname(parent);
576 return parent;
579 parent = skip_subsystem(parent, "usb");
581 return parent;
584 static struct udev_device *handle_bcma(struct udev_device *parent, char **path) {
588 sysname = udev_device_get_sysname(parent);
593 return parent;
597 static struct udev_device *handle_ap(struct udev_device *parent, char **path) {
600 assert(parent);
603 type = udev_device_get_sysattr_value(parent, "type");
604 func = udev_device_get_sysattr_value(parent, "ap_functions");
610 path_prepend(path, "ap-%s", udev_device_get_sysname(parent));
612 parent = skip_subsystem(parent, "ap");
613 return parent;
617 struct udev_device *parent;
625 parent = dev;
626 while (parent != NULL) {
629 subsys = udev_device_get_subsystem(parent);
633 handle_scsi_tape(parent, &path);
635 parent = handle_scsi(parent, &path, &supported_parent);
638 parent = handle_cciss(parent, &path);
641 parent = handle_usb(parent, &path);
644 parent = handle_bcma(parent, &path);
647 path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
648 parent = skip_subsystem(parent, "serio");
650 path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
651 parent = skip_subsystem(parent, "pci");
654 path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
655 parent = skip_subsystem(parent, "platform");
659 path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
660 parent = skip_subsystem(parent, "acpi");
663 path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
664 parent = skip_subsystem(parent, "xen");
667 while (parent && streq_ptr("virtio", udev_device_get_subsystem(parent)))
668 parent = udev_device_get_parent(parent);
669 path_prepend(&path, "virtio-pci-%s", udev_device_get_sysname(parent));
673 path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
674 parent = skip_subsystem(parent, "scm");
678 path_prepend(&path, "ccw-%s", udev_device_get_sysname(parent));
679 parent = skip_subsystem(parent, "ccw");
683 path_prepend(&path, "ccwgroup-%s", udev_device_get_sysname(parent));
684 parent = skip_subsystem(parent, "ccwgroup");
688 parent = handle_ap(parent, &path);
692 path_prepend(&path, "iucv-%s", udev_device_get_sysname(parent));
693 parent = skip_subsystem(parent, "iucv");
698 if (parent)
699 parent = udev_device_get_parent(parent);
703 * Do not return devices with an unknown parent device type. They
704 * might produce conflicting IDs if the parent does not provide a