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