| Main index | Section 9 | Options |
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
OF_device_register_xref() adds a map entry from the effective phandle xref to device dev. If a mapping entry for xref already exists, it is replaced with the new one. The function always returns 0.
OF_device_from_xref() returns a device_t instance associated with the effective phandle xref. If no such mapping exists, the function returns NULL.
OF_xref_from_device() returns the effective phandle associated with the device dev. If no such mapping exists, the function returns 0.
static int
acmephy_attach(device_t dev)
{
phandle_t node;
/* PHY node is referenced from eth device, register it */
node = ofw_bus_get_node(dev);
OF_device_register_xref(OF_xref_from_node(node), dev);
return (0);
}
| OF_DEVICE_FROM_XREF (9) | April 9, 2018 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options! | ” |
| — The Unix Haters' handbook | ||