Lines Matching refs:node
34 static long __init parse_acpi_path(const struct efi_dev_path *node,
40 if (node->header.length != 12)
44 'A' + ((node->acpi.hid >> 10) & 0x1f) - 1,
45 'A' + ((node->acpi.hid >> 5) & 0x1f) - 1,
46 'A' + ((node->acpi.hid >> 0) & 0x1f) - 1,
47 node->acpi.hid >> 16);
48 sprintf(hid_uid.uid, "%u", node->acpi.uid);
72 static long __init parse_pci_path(const struct efi_dev_path *node,
77 if (node->header.length != 6)
82 devfn = PCI_DEVFN(node->pci.dev, node->pci.fn);
92 * Insert parsers for further node types here.
94 * Each parser takes a pointer to the @node and to the @parent (will be NULL
95 * for the first device path node). If a device corresponding to @node was
104 * Be sure to validate the node length and contents before commencing the
108 static long __init parse_end_path(const struct efi_dev_path *node,
111 if (node->header.length != 4)
113 if (node->header.sub_type != EFI_DEV_END_INSTANCE &&
114 node->header.sub_type != EFI_DEV_END_ENTIRE)
120 return node->header.sub_type;
125 * @node: EFI Device Path
128 * Parse a series of EFI Device Path nodes at @node and find the corresponding
131 * put_device() after use. The @node pointer is updated to point to the
132 * location immediately after the "End of Hardware Device Path" node.
137 * If a Device Path node is malformed or its corresponding device is not found,
138 * @node is updated to point to this offending node and an ERR_PTR is returned.
143 * while (!IS_ERR_OR_NULL(dev = efi_get_device_by_path(&node, &len))) {
156 * %ERR_PTR(-EINVAL) if a node is malformed or exceeds @len,
157 * %ERR_PTR(-ENOTSUPP) if support for a node type is not yet implemented.
159 struct device * __init efi_get_device_by_path(const struct efi_dev_path **node,
169 if (*len < 4 || *len < (*node)->header.length)
171 else if ((*node)->header.type == EFI_DEV_ACPI &&
172 (*node)->header.sub_type == EFI_DEV_BASIC_ACPI)
173 ret = parse_acpi_path(*node, parent, &child);
174 else if ((*node)->header.type == EFI_DEV_HW &&
175 (*node)->header.sub_type == EFI_DEV_PCI)
176 ret = parse_pci_path(*node, parent, &child);
177 else if (((*node)->header.type == EFI_DEV_END_PATH ||
178 (*node)->header.type == EFI_DEV_END_PATH2))
179 ret = parse_end_path(*node, parent, &child);
188 *node = (void *)*node + (*node)->header.length;
189 *len -= (*node)->header.length;