diff options
Diffstat (limited to 'static/freebsd/man9/OF_getprop.9 4.html')
| -rw-r--r-- | static/freebsd/man9/OF_getprop.9 4.html | 293 |
1 files changed, 0 insertions, 293 deletions
diff --git a/static/freebsd/man9/OF_getprop.9 4.html b/static/freebsd/man9/OF_getprop.9 4.html deleted file mode 100644 index 666a3bce..00000000 --- a/static/freebsd/man9/OF_getprop.9 4.html +++ /dev/null @@ -1,293 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">OF_GETPROP(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">OF_GETPROP(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">OF_getprop</code>, - <code class="Nm">OF_getproplen</code>, - <code class="Nm">OF_getencprop</code>, <code class="Nm">OF_hasprop</code>, - <code class="Nm">OF_searchprop</code>, - <code class="Nm">OF_searchencprop</code>, - <code class="Nm">OF_getprop_alloc</code>, - <code class="Nm">OF_getencprop_alloc</code>, - <code class="Nm">OF_getprop_alloc_multi</code>, - <code class="Nm">OF_getencprop_alloc_multi</code>, - <code class="Nm">OF_prop_free</code>, <code class="Nm">OF_nextprop</code>, - <code class="Nm">OF_setprop</code> — <span class="Nd">access - properties of device tree node</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">dev/ofw/ofw_bus.h</a>></code> - <br/> - <code class="In">#include - <<a class="In">dev/ofw/ofw_bus_subr.h</a>></code></p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getproplen</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">void - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getencprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *prop</var>, <var class="Fa" style="white-space: nowrap;">pcell_t - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -<p class="Pp"><var class="Ft">bool</var> - <br/> - <code class="Fn">OF_hasprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_searchprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">void - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_searchencprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">pcell_t - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getprop_alloc</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">void - **buf</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getencprop_alloc</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">pcell_t - **buf</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getprop_alloc_multi</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">int - elsz</var>, <var class="Fa" style="white-space: nowrap;">void - **buf</var>);</p> -<p class="Pp"><var class="Ft">ssize_t</var> - <br/> - <code class="Fn">OF_getencprop_alloc_multi</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">int - elsz</var>, <var class="Fa" style="white-space: nowrap;">pcell_t - **buf</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">OF_prop_free</code>(<var class="Fa" style="white-space: nowrap;">void - *buf</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">OF_nextprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">char - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">OF_setprop</code>(<var class="Fa" style="white-space: nowrap;">phandle_t - node</var>, <var class="Fa" style="white-space: nowrap;">const char - *propname</var>, <var class="Fa" style="white-space: nowrap;">const void - *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">Device nodes can have associated properties. Properties consist of - a name and a value. A name is a human-readable string from 1 to 31 - characters long. A value is an array of zero or more bytes that encode - certain information. The meaning of that bytes depends on how drivers - interpret them. Properties can encode byte arrays, text strings, unsigned - 32-bit values or any combination of these types.</p> -<p class="Pp">Property with a zero-length value usually represents boolean - information. If the property is present, it signifies true, otherwise - false.</p> -<p class="Pp">A byte array is encoded as a sequence of bytes and represents - values like MAC addresses.</p> -<p class="Pp">A text string is a sequence of n printable characters. It is - encoded as a byte array of length n + 1 bytes with characters represented as - bytes plus a terminating null character.</p> -<p class="Pp">Unsigned 32-bit values, also sometimes called cells, are encoded - as a sequence of 4 bytes in big-endian order.</p> -<p class="Pp" id="OF_getproplen"><a class="permalink" href="#OF_getproplen"><code class="Fn">OF_getproplen</code></a>() - returns either the length of the value associated with the property - <var class="Fa">propname</var> in the node identified by - <var class="Fa">node</var>, or 0 if the property exists but has no - associated value. If <var class="Fa">propname</var> does not exist, -1 is - returned.</p> -<p class="Pp" id="OF_getprop"><a class="permalink" href="#OF_getprop"><code class="Fn">OF_getprop</code></a>() - copies a maximum of <var class="Fa">len</var> bytes from the value - associated with the property <var class="Fa">propname</var> of the device - node <var class="Fa">node</var> into the memory specified by - <var class="Fa">buf</var>. Returns the actual size of the value or -1 if the - property does not exist.</p> -<p class="Pp" id="OF_getencprop"><a class="permalink" href="#OF_getencprop"><code class="Fn">OF_getencprop</code></a>() - copies a maximum of <var class="Fa">len</var> bytes into memory specified by - <var class="Fa">buf</var>, then converts cell values from big-endian to host - byte order. Returns the actual size of the value in bytes, or -1 if the - property does not exist. <var class="Fa">len</var> must be a multiple of - 4.</p> -<p class="Pp" id="OF_hasprop"><a class="permalink" href="#OF_hasprop"><code class="Fn">OF_hasprop</code></a>() - returns <code class="Dv">true</code> if the device node - <var class="Fa">node</var> has a property specified by - <var class="Fa">propname</var>, and <code class="Dv">false</code> if the - property does not exist.</p> -<p class="Pp" id="OF_searchprop"><a class="permalink" href="#OF_searchprop"><code class="Fn">OF_searchprop</code></a>() - recursively looks for the property specified by - <var class="Fa">propname</var> starting with the device node - <var class="Fa">node</var> followed by the parent node and up to the root - node. If the property is found, the function copies a maximum of - <var class="Fa">len</var> bytes of the value associated with the property - into the memory specified by <var class="Fa">buf</var>. Returns the actual - size in bytes of the value, or -1 if the property does not exist.</p> -<p class="Pp" id="OF_searchencprop"><a class="permalink" href="#OF_searchencprop"><code class="Fn">OF_searchencprop</code></a>() - recursively looks for the property specified by - <var class="Fa">propname</var> starting with the device node - <var class="Fa">node</var> followed by the parent node and up to the root - node. If the property is found, the function copies a maximum of - <var class="Fa">len</var> bytes of the value associated with the property - into the memory specified by <var class="Fa">buf</var>, then converts cell - values from big-endian to host byte order. Returns the actual size in bytes - of the value, or -1 if the property does not exist.</p> -<p class="Pp" id="OF_getprop_alloc"><a class="permalink" href="#OF_getprop_alloc"><code class="Fn">OF_getprop_alloc</code></a>() - allocates memory large enough to hold the value associated with the property - <var class="Fa">propname</var> of the device node <var class="Fa">node</var> - and copies the value into the newly allocated memory region. Returns the - actual size of the value and stores the address of the allocated memory in - <var class="Fa">*buf</var>. If the property has a zero-sized value - <var class="Fa">*buf</var> is set NULL. Returns -1 if the property does not - exist or memory allocation failed. Allocated memory should be released when - no longer required by calling <code class="Fn">OF_prop_free</code>(). The - function might sleep when allocating memory.</p> -<p class="Pp" id="OF_getencprop_alloc"><a class="permalink" href="#OF_getencprop_alloc"><code class="Fn">OF_getencprop_alloc</code></a>() - allocates enough memory to hold the value associated with the property - <var class="Fa">propname</var> of the device node - <var class="Fa">node</var>, copies the value into the newly allocated memory - region, and then converts cell values from big-endian to host byte order. - The actual size of the value is returned and the address of allocated memory - is stored in <var class="Fa">*buf</var>. If the property has zero-length - value, <var class="Fa">*buf</var> is set to NULL. Returns -1 if the property - does not exist or memory allocation failed or the size of the value is not - divisible by a cell size (4 bytes). Allocated memory should be released when - no longer required by calling <code class="Fn">OF_prop_free</code>(). The - function might sleep when allocating memory.</p> -<p class="Pp" id="OF_getprop_alloc_multi"><a class="permalink" href="#OF_getprop_alloc_multi"><code class="Fn">OF_getprop_alloc_multi</code></a>() - allocates memory large enough to hold the value associated with the property - <var class="Fa">propname</var> of the device node <var class="Fa">node</var> - and copies the value into the newly allocated memory region. The value is - expected to be an array of zero or more elements <var class="Fa">elsz</var> - bytes long. Returns the number of elements in the value and stores the - address of the allocated memory in <var class="Fa">*buf</var>. If the - property has a zero-sized value <var class="Fa">*buf</var> is set NULL. - Returns -1 if the property does not exist or memory allocation failed or the - size of the value is not divisible by <var class="Fa">elsz</var>. Allocated - memory should be released when no longer required by calling - <code class="Fn">OF_prop_free</code>(). The function might sleep when - allocating memory.</p> -<p class="Pp" id="OF_getencprop_alloc_multi"><a class="permalink" href="#OF_getencprop_alloc_multi"><code class="Fn">OF_getencprop_alloc_multi</code></a>() - allocates memory large enough to hold the value associated with the property - <var class="Fa">propname</var> of the device node <var class="Fa">node</var> - and copies the value into the newly allocated memory region, and then - converts cell values from big-endian to host byte order. The value is - expected to be an array of zero or more elements <var class="Fa">elsz</var> - bytes long. Returns the number of elements in the value and stores the - address of the allocated memory in <var class="Fa">*buf</var>. If the - property has a zero-sized value <var class="Fa">*buf</var> is set NULL. - Returns -1 if the property does not exist or memory allocation failed or the - size of the value is not divisible by <var class="Fa">elsz</var>. Allocated - memory should be released when no longer required by calling - <code class="Fn">OF_prop_free</code>(). The function might sleep when - allocating memory.</p> -<p class="Pp" id="OF_prop_free"><a class="permalink" href="#OF_prop_free"><code class="Fn">OF_prop_free</code></a>() - releases memory at <var class="Fa">buf</var> that was allocated by - <code class="Fn">OF_getprop_alloc</code>(), - <code class="Fn">OF_getencprop_alloc</code>(), - <code class="Fn">OF_getprop_alloc_multi</code>(), - <code class="Fn">OF_getencprop_alloc_multi</code>().</p> -<p class="Pp" id="OF_nextprop"><a class="permalink" href="#OF_nextprop"><code class="Fn">OF_nextprop</code></a>() - copies a maximum of <var class="Fa">size</var> bytes of the name of the - property following the <var class="Fa">propname</var> property into - <var class="Fa">buf</var>. If <var class="Fa">propname</var> is NULL, the - function copies the name of the first property of the device node - <var class="Fa">node</var>. <code class="Fn">OF_nextprop</code>() returns -1 - if <var class="Fa">propname</var> is invalid or there is an internal error, - 0 if there are no more properties after <var class="Fa">propname</var>, or 1 - otherwise.</p> -<p class="Pp" id="OF_setprop"><a class="permalink" href="#OF_setprop"><code class="Fn">OF_setprop</code></a>() - sets the value of the property <var class="Fa">propname</var> in the device - node <var class="Fa">node</var> to the value beginning at the address - specified by <var class="Fa">buf</var> and running for - <var class="Fa">len</var> bytes. If the property does not exist, the - function tries to create it. <code class="Fn">OF_setprop</code>() returns - the actual size of the new value, or -1 if the property value cannot be - changed or the new property cannot be created.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<div class="Bd Li"> -<pre> phandle_t node; - phandle_t hdmixref, hdminode; - device_t hdmi; - uint8_t mac[6]; - char *model; - - /* - * Get a byte array property - */ - if (OF_getprop(node, "eth,hwaddr", mac, sizeof(mac)) != sizeof(mac)) - return; - - /* - * Get internal node reference and device associated with it - */ - if (OF_getencprop(node, "hdmi", &hdmixref) <= 0) - return; - hdmi = OF_device_from_xref(hdmixref); - - /* - * Get string value of model property of HDMI framer node - */ - hdminode = OF_node_from_xref(hdmixref); - if (OF_getprop_alloc(hdminode, "model", (void **)&model) <= 0) - return;</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">OF_device_from_xref(9)</a>, - <a class="Xr">OF_node_from_xref(9)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">This manual page was written by <span class="An">Oleksandr - Tymoshenko</span> - <<a class="Mt" href="mailto:gonzo@FreeBSD.org">gonzo@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">April 16, 2026</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
