Path: blob/master/Documentation/DocBook/v4l/media-ioc-device-info.xml
10823 views
<refentry id="media-ioc-device-info">1<refmeta>2<refentrytitle>ioctl MEDIA_IOC_DEVICE_INFO</refentrytitle>3&manvol;4</refmeta>56<refnamediv>7<refname>MEDIA_IOC_DEVICE_INFO</refname>8<refpurpose>Query device information</refpurpose>9</refnamediv>1011<refsynopsisdiv>12<funcsynopsis>13<funcprototype>14<funcdef>int <function>ioctl</function></funcdef>15<paramdef>int <parameter>fd</parameter></paramdef>16<paramdef>int <parameter>request</parameter></paramdef>17<paramdef>struct media_device_info *<parameter>argp</parameter></paramdef>18</funcprototype>19</funcsynopsis>20</refsynopsisdiv>2122<refsect1>23<title>Arguments</title>2425<variablelist>26<varlistentry>27<term><parameter>fd</parameter></term>28<listitem>29<para>File descriptor returned by30<link linkend='media-func-open'><function>open()</function></link>.</para>31</listitem>32</varlistentry>33<varlistentry>34<term><parameter>request</parameter></term>35<listitem>36<para>MEDIA_IOC_DEVICE_INFO</para>37</listitem>38</varlistentry>39<varlistentry>40<term><parameter>argp</parameter></term>41<listitem>42<para></para>43</listitem>44</varlistentry>45</variablelist>46</refsect1>4748<refsect1>49<title>Description</title>5051<para>All media devices must support the <constant>MEDIA_IOC_DEVICE_INFO</constant>52ioctl. To query device information, applications call the ioctl with a53pointer to a &media-device-info;. The driver fills the structure and returns54the information to the application.55The ioctl never fails.</para>5657<table pgwide="1" frame="none" id="media-device-info">58<title>struct <structname>media_device_info</structname></title>59<tgroup cols="3">60&cs-str;61<tbody valign="top">62<row>63<entry>char</entry>64<entry><structfield>driver</structfield>[16]</entry>65<entry><para>Name of the driver implementing the media API as a66NUL-terminated ASCII string. The driver version is stored in the67<structfield>driver_version</structfield> field.</para>68<para>Driver specific applications can use this information to69verify the driver identity. It is also useful to work around70known bugs, or to identify drivers in error reports.</para></entry>71</row>72<row>73<entry>char</entry>74<entry><structfield>model</structfield>[32]</entry>75<entry>Device model name as a NUL-terminated UTF-8 string. The76device version is stored in the <structfield>device_version</structfield>77field and is not be appended to the model name.</entry>78</row>79<row>80<entry>char</entry>81<entry><structfield>serial</structfield>[40]</entry>82<entry>Serial number as a NUL-terminated ASCII string.</entry>83</row>84<row>85<entry>char</entry>86<entry><structfield>bus_info</structfield>[32]</entry>87<entry>Location of the device in the system as a NUL-terminated88ASCII string. This includes the bus type name (PCI, USB, ...) and a89bus-specific identifier.</entry>90</row>91<row>92<entry>__u32</entry>93<entry><structfield>media_version</structfield></entry>94<entry>Media API version, formatted with the95<constant>KERNEL_VERSION()</constant> macro.</entry>96</row>97<row>98<entry>__u32</entry>99<entry><structfield>hw_revision</structfield></entry>100<entry>Hardware device revision in a driver-specific format.</entry>101</row>102<row>103<entry>__u32</entry>104<entry><structfield>media_version</structfield></entry>105<entry>Media device driver version, formatted with the106<constant>KERNEL_VERSION()</constant> macro. Together with the107<structfield>driver</structfield> field this identifies a particular108driver.</entry>109</row>110<row>111<entry>__u32</entry>112<entry><structfield>reserved</structfield>[31]</entry>113<entry>Reserved for future extensions. Drivers and applications must114set this array to zero.</entry>115</row>116</tbody>117</tgroup>118</table>119<para>The <structfield>serial</structfield> and <structfield>bus_info</structfield>120fields can be used to distinguish between multiple instances of otherwise121identical hardware. The serial number takes precedence when provided and can122be assumed to be unique. If the serial number is an empty string, the123<structfield>bus_info</structfield> field can be used instead. The124<structfield>bus_info</structfield> field is guaranteed to be unique, but125can vary across reboots or device unplug/replug.</para>126</refsect1>127128<refsect1>129<title>Return value</title>130<para>This function doesn't return specific error codes.</para>131</refsect1>132</refentry>133134135