1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl MEDIA_IOC_DEVICE_INFO</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="media-user-func.html" title="Appendix&#160;L.&#160;Function Reference"><link rel="prev" href="media-func-ioctl.html" title="media ioctl()"><link rel="next" href="media-ioc-enum-entities.html" title="ioctl MEDIA_IOC_ENUM_ENTITIES"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl MEDIA_IOC_DEVICE_INFO</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="media-func-ioctl.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;L.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="media-ioc-enum-entities.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="media-ioc-device-info"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>MEDIA_IOC_DEVICE_INFO &#8212; Query device information</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct media_device_info *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1134128780"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by
2	  <a class="link" href="media-func-open.html" title="media open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>MEDIA_IOC_DEVICE_INFO</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1134157388"></a><h2>Description</h2><p>All media devices must support the <code class="constant">MEDIA_IOC_DEVICE_INFO</code>
3    ioctl. To query device information, applications call the ioctl with a
4    pointer to a struct&#160;<a class="link" href="media-ioc-device-info.html#media-device-info" title="Table&#160;L.1.&#160;struct media_device_info">media_device_info</a>. The driver fills the structure and returns
5    the information to the application.
6    The ioctl never fails.</p><div class="table"><a name="media-device-info"></a><p class="title"><b>Table&#160;L.1.&#160;struct <span class="structname">media_device_info</span></b></p><div class="table-contents"><table summary="struct media_device_info" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>driver</code></em>[16]</td><td valign="top"><p>Name of the driver implementing the media API as a
7	    NUL-terminated ASCII string. The driver version is stored in the
8	    <em class="structfield"><code>driver_version</code></em> field.</p>
9	    <p>Driver specific applications can use this information to
10	    verify the driver identity. It is also useful to work around
11	    known bugs, or to identify drivers in error reports.</p></td></tr><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>model</code></em>[32]</td><td valign="top">Device model name as a NUL-terminated UTF-8 string. The
12	    device version is stored in the <em class="structfield"><code>device_version</code></em>
13	    field and is not be appended to the model name.</td></tr><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>serial</code></em>[40]</td><td valign="top">Serial number as a NUL-terminated ASCII string.</td></tr><tr><td valign="top">char</td><td valign="top"><em class="structfield"><code>bus_info</code></em>[32]</td><td valign="top">Location of the device in the system as a NUL-terminated
14	    ASCII string. This includes the bus type name (PCI, USB, ...) and a
15	    bus-specific identifier.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>media_version</code></em></td><td valign="top">Media API version, formatted with the
16	    <code class="constant">KERNEL_VERSION()</code> macro.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>hw_revision</code></em></td><td valign="top">Hardware device revision in a driver-specific format.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>media_version</code></em></td><td valign="top">Media device driver version, formatted with the
17	    <code class="constant">KERNEL_VERSION()</code> macro. Together with the
18	    <em class="structfield"><code>driver</code></em> field this identifies a particular
19	    driver.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[31]</td><td valign="top">Reserved for future extensions. Drivers and applications must
20	    set this array to zero.</td></tr></tbody></table></div></div><br class="table-break"><p>The <em class="structfield"><code>serial</code></em> and <em class="structfield"><code>bus_info</code></em>
21    fields can be used to distinguish between multiple instances of otherwise
22    identical hardware. The serial number takes precedence when provided and can
23    be assumed to be unique. If the serial number is an empty string, the
24    <em class="structfield"><code>bus_info</code></em> field can be used instead. The
25    <em class="structfield"><code>bus_info</code></em> field is guaranteed to be unique, but
26    can vary across reboots or device unplug/replug.</p></div><div class="refsect1"><a name="idp1134173796"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="media-func-ioctl.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="media-user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="media-ioc-enum-entities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">media ioctl()&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl MEDIA_IOC_ENUM_ENTITIES</td></tr></table></div></body></html>
27