Lines Matching defs:node
15 static long __init parse_acpi_path(const struct efi_dev_path *node,
24 if (node->header.length != 12)
28 'A' + ((node->acpi.hid >> 10) & 0x1f) - 1,
29 'A' + ((node->acpi.hid >> 5) & 0x1f) - 1,
30 'A' + ((node->acpi.hid >> 0) & 0x1f) - 1,
31 node->acpi.hid >> 16);
35 if (ret == 0 && node->acpi.uid == uid)
37 if (ret == -ENODATA && node->acpi.uid == 0)
60 static long __init parse_pci_path(const struct efi_dev_path *node,
65 if (node->header.length != 6)
70 devfn = PCI_DEVFN(node->pci.dev, node->pci.fn);
80 * Insert parsers for further node types here.
82 * Each parser takes a pointer to the @node and to the @parent (will be NULL
83 * for the first device path node). If a device corresponding to @node was
92 * Be sure to validate the node length and contents before commencing the
96 static long __init parse_end_path(const struct efi_dev_path *node,
99 if (node->header.length != 4)
101 if (node->header.sub_type != EFI_DEV_END_INSTANCE &&
102 node->header.sub_type != EFI_DEV_END_ENTIRE)
108 return node->header.sub_type;
113 * @node: EFI Device Path
116 * Parse a series of EFI Device Path nodes at @node and find the corresponding
119 * put_device() after use. The @node pointer is updated to point to the
120 * location immediately after the "End of Hardware Device Path" node.
125 * If a Device Path node is malformed or its corresponding device is not found,
126 * @node is updated to point to this offending node and an ERR_PTR is returned.
131 * while (!IS_ERR_OR_NULL(dev = efi_get_device_by_path(&node, &len))) {
144 * %ERR_PTR(-EINVAL) if a node is malformed or exceeds @len,
145 * %ERR_PTR(-ENOTSUPP) if support for a node type is not yet implemented.
147 struct device * __init efi_get_device_by_path(const struct efi_dev_path **node,
157 if (*len < 4 || *len < (*node)->header.length)
159 else if ((*node)->header.type == EFI_DEV_ACPI &&
160 (*node)->header.sub_type == EFI_DEV_BASIC_ACPI)
161 ret = parse_acpi_path(*node, parent, &child);
162 else if ((*node)->header.type == EFI_DEV_HW &&
163 (*node)->header.sub_type == EFI_DEV_PCI)
164 ret = parse_pci_path(*node, parent, &child);
165 else if (((*node)->header.type == EFI_DEV_END_PATH ||
166 (*node)->header.type == EFI_DEV_END_PATH2))
167 ret = parse_end_path(*node, parent, &child);
176 *node = (void *)*node + (*node)->header.length;
177 *len -= (*node)->header.length;