1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/userspace-api/media/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
10 .. _media_ioc_device_info:
12 ***************************
13 ioctl MEDIA_IOC_DEVICE_INFO
14 ***************************
19 MEDIA_IOC_DEVICE_INFO - Query device information
25 .. c:function:: int ioctl( int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp )
26 :name: MEDIA_IOC_DEVICE_INFO
33 File descriptor returned by :ref:`open() <media-func-open>`.
36 Pointer to struct :c:type:`media_device_info`.
42 All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
43 query device information, applications call the ioctl with a pointer to
44 a struct :c:type:`media_device_info`. The driver
45 fills the structure and returns the information to the application. The
49 .. c:type:: media_device_info
51 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
53 .. flat-table:: struct media_device_info
61 - Name of the driver implementing the media API as a NUL-terminated
62 ASCII string. The driver version is stored in the
63 ``driver_version`` field.
65 Driver specific applications can use this information to verify
66 the driver identity. It is also useful to work around known bugs,
67 or to identify drivers in error reports.
71 - Device model name as a NUL-terminated UTF-8 string. The device
72 version is stored in the ``device_version`` field and is not be
73 appended to the model name.
77 - Serial number as a NUL-terminated ASCII string.
81 - Location of the device in the system as a NUL-terminated ASCII
82 string. This includes the bus type name (PCI, USB, ...) and a
83 bus-specific identifier.
87 - Media API version, formatted with the ``KERNEL_VERSION()`` macro.
91 - Hardware device revision in a driver-specific format.
95 - Media device driver version, formatted with the
96 ``KERNEL_VERSION()`` macro. Together with the ``driver`` field
97 this identifies a particular driver.
101 - Reserved for future extensions. Drivers and applications must set
105 The ``serial`` and ``bus_info`` fields can be used to distinguish
106 between multiple instances of otherwise identical hardware. The serial
107 number takes precedence when provided and can be assumed to be unique.
108 If the serial number is an empty string, the ``bus_info`` field can be
109 used instead. The ``bus_info`` field is guaranteed to be unique, but can
110 vary across reboots or device unplug/replug.
116 On success 0 is returned, on error -1 and the ``errno`` variable is set
117 appropriately. The generic error codes are described at the
118 :ref:`Generic Error Codes <gen-errors>` chapter.