blob: 278a3120ee2e0e2d386b894630638835a891a944 [file] [log] [blame]
Laurent Pinchart140d8812010-08-18 11:41:22 -03001<refentry id="media-ioc-device-info">
2 <refmeta>
3 <refentrytitle>ioctl MEDIA_IOC_DEVICE_INFO</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>MEDIA_IOC_DEVICE_INFO</refname>
9 <refpurpose>Query device information</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct media_device_info *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</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>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>All media devices must support the <constant>MEDIA_IOC_DEVICE_INFO</constant>
52 ioctl. To query device information, applications call the ioctl with a
53 pointer to a &media-device-info;. The driver fills the structure and returns
54 the information to the application.
55 The ioctl never fails.</para>
56
57 <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 a
66 NUL-terminated ASCII string. The driver version is stored in the
67 <structfield>driver_version</structfield> field.</para>
68 <para>Driver specific applications can use this information to
69 verify the driver identity. It is also useful to work around
70 known 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. The
76 device version is stored in the <structfield>device_version</structfield>
77 field 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-terminated
88 ASCII string. This includes the bus type name (PCI, USB, ...) and a
89 bus-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 the
95 <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 the
106 <constant>KERNEL_VERSION()</constant> macro. Together with the
107 <structfield>driver</structfield> field this identifies a particular
108 driver.</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 must
114 set this array to zero.</entry>
115 </row>
116 </tbody>
117 </tgroup>
118 </table>
119 <para>The <structfield>serial</structfield> and <structfield>bus_info</structfield>
120 fields can be used to distinguish between multiple instances of otherwise
121 identical hardware. The serial number takes precedence when provided and can
122 be assumed to be unique. If the serial number is an empty string, the
123 <structfield>bus_info</structfield> field can be used instead. The
124 <structfield>bus_info</structfield> field is guaranteed to be unique, but
125 can vary across reboots or device unplug/replug.</para>
126 </refsect1>
127
128 <refsect1>
129 <title>Return value</title>
130 <para>This function doesn't return specific error codes.</para>
131 </refsect1>
132</refentry>