ofw_graph(9)
π«Ά ofw_graph(9) π«Ά
okay so this is the ofw_graph(9) page from the Kernel Developer's Manual β and bestie, itβs all about the little helper functions for the graph bindings. group-chat tutorial time π
β¨
πΈ NAME πΈ
ofw_graph, ofw_graph_get_port_by_idx, ofw_graph_port_get_num_endpoints, ofw_graph_get_endpoint_by_idx, ofw_graph_get_remote_endpoint, ofw_graph_get_remote_parent, ofw_graph_get_device_by_port_ep β Helpers for the graph bindings π
β¨ SYNOPSIS β¨
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_graph.h>
phandle_t
ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx);
size_t
ofw_graph_port_get_num_endpoints(phandle_t port);
phandle_t
ofw_graph_get_endpoint_by_idx(phandle_t port, uint32_t idx);
phandle_t
ofw_graph_get_remote_endpoint(phandle_t endpoint);
phandle_t
ofw_graph_get_remote_parent(phandle_t remote);
device_t
ofw_graph_get_device_by_port_ep(phandle_t node, uint32_t port_id,
uin32_t ep_id);
π DESCRIPTION π
The ofw_graph functions are helpers to parse the DTS graph bindings. theyβre literally the backstage crew for port/endpoint stuff, no cap π«Ά
ofw_graph_get_port_by_idx()β returns the port with id idx. it will first check node namedport@idxand then fallback on checking theportschild for a child node matching the id. if no ports matching idx is found the function return0. okay so, yes:0is the βnot foundβ vibe check πofw_graph_port_get_num_endpoints()β returns the number of endpoints a port node have. iconic little counter behavior β¨ofw_graph_get_endpoint_by_idx()β return the endpoint with id idx. it will first check if there is a single child namedendpointand returns it if there is. if there is multiple endpoints it will check theregproperty and returns the correctphandle_tor0if none match. very βread the room, then read the reg propertyβ energy πofw_graph_get_remote_endpoint()β returns theremote-endpointproperty if it exists or0. simple. slay πΈofw_graph_get_remote_parent()β returns the device node corresponding to theremote-endpointphandle or0if none. main character device-tree behavior πofw_graph_get_device_by_port_ep()β returns the device associated with the port and endpoint orNULLif none. the device driver should have calledOF_device_register_xref()before. yes bestie, that call is a prerequisite, not a suggestion π
β HISTORY β
The ofw_graph functions first appeared in FreeBSD 13.0. the ofw_graph functions and manual page were written by Emmanuel Vadot <manu@FreeBSD.org> π«Ά
signing off with the footer tea β: this page is from Debian, dated April 10, 2019. periodt ππ¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2019 Emmanuel Vadot <manu@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms