media-ioc-device-info.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <refentry id="media-ioc-device-info">
  2. <refmeta>
  3. <refentrytitle>ioctl MEDIA_IOC_DEVICE_INFO</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>MEDIA_IOC_DEVICE_INFO</refname>
  8. <refpurpose>Query device information</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct media_device_info *<parameter>argp</parameter></paramdef>
  17. </funcprototype>
  18. </funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Arguments</title>
  22. <variablelist>
  23. <varlistentry>
  24. <term><parameter>fd</parameter></term>
  25. <listitem>
  26. <para>File descriptor returned by
  27. <link linkend='media-func-open'><function>open()</function></link>.</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>MEDIA_IOC_DEVICE_INFO</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>All media devices must support the <constant>MEDIA_IOC_DEVICE_INFO</constant>
  47. ioctl. To query device information, applications call the ioctl with a
  48. pointer to a &media-device-info;. The driver fills the structure and returns
  49. the information to the application.
  50. The ioctl never fails.</para>
  51. <table pgwide="1" frame="none" id="media-device-info">
  52. <title>struct <structname>media_device_info</structname></title>
  53. <tgroup cols="3">
  54. &cs-str;
  55. <tbody valign="top">
  56. <row>
  57. <entry>char</entry>
  58. <entry><structfield>driver</structfield>[16]</entry>
  59. <entry><para>Name of the driver implementing the media API as a
  60. NUL-terminated ASCII string. The driver version is stored in the
  61. <structfield>driver_version</structfield> field.</para>
  62. <para>Driver specific applications can use this information to
  63. verify the driver identity. It is also useful to work around
  64. known bugs, or to identify drivers in error reports.</para></entry>
  65. </row>
  66. <row>
  67. <entry>char</entry>
  68. <entry><structfield>model</structfield>[32]</entry>
  69. <entry>Device model name as a NUL-terminated UTF-8 string. The
  70. device version is stored in the <structfield>device_version</structfield>
  71. field and is not be appended to the model name.</entry>
  72. </row>
  73. <row>
  74. <entry>char</entry>
  75. <entry><structfield>serial</structfield>[40]</entry>
  76. <entry>Serial number as a NUL-terminated ASCII string.</entry>
  77. </row>
  78. <row>
  79. <entry>char</entry>
  80. <entry><structfield>bus_info</structfield>[32]</entry>
  81. <entry>Location of the device in the system as a NUL-terminated
  82. ASCII string. This includes the bus type name (PCI, USB, ...) and a
  83. bus-specific identifier.</entry>
  84. </row>
  85. <row>
  86. <entry>__u32</entry>
  87. <entry><structfield>media_version</structfield></entry>
  88. <entry>Media API version, formatted with the
  89. <constant>KERNEL_VERSION()</constant> macro.</entry>
  90. </row>
  91. <row>
  92. <entry>__u32</entry>
  93. <entry><structfield>hw_revision</structfield></entry>
  94. <entry>Hardware device revision in a driver-specific format.</entry>
  95. </row>
  96. <row>
  97. <entry>__u32</entry>
  98. <entry><structfield>driver_version</structfield></entry>
  99. <entry>Media device driver version, formatted with the
  100. <constant>KERNEL_VERSION()</constant> macro. Together with the
  101. <structfield>driver</structfield> field this identifies a particular
  102. driver.</entry>
  103. </row>
  104. <row>
  105. <entry>__u32</entry>
  106. <entry><structfield>reserved</structfield>[31]</entry>
  107. <entry>Reserved for future extensions. Drivers and applications must
  108. set this array to zero.</entry>
  109. </row>
  110. </tbody>
  111. </tgroup>
  112. </table>
  113. <para>The <structfield>serial</structfield> and <structfield>bus_info</structfield>
  114. fields can be used to distinguish between multiple instances of otherwise
  115. identical hardware. The serial number takes precedence when provided and can
  116. be assumed to be unique. If the serial number is an empty string, the
  117. <structfield>bus_info</structfield> field can be used instead. The
  118. <structfield>bus_info</structfield> field is guaranteed to be unique, but
  119. can vary across reboots or device unplug/replug.</para>
  120. </refsect1>
  121. <refsect1>
  122. &return-value;
  123. </refsect1>
  124. </refentry>