1 .. -*- coding: utf-8; mode: rst -*-
3 .. _media_ioc_device_info:
5 ***************************
6 ioctl MEDIA_IOC_DEVICE_INFO
7 ***************************
12 MEDIA_IOC_DEVICE_INFO - Query device information
18 .. c:function:: int ioctl( int fd, int request, struct media_device_info *argp )
25 File descriptor returned by :ref:`open() <media-func-open>`.
36 All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
37 query device information, applications call the ioctl with a pointer to
38 a struct :ref:`media_device_info <media-device-info>`. The driver
39 fills the structure and returns the information to the application. The
43 .. _media-device-info:
45 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
47 .. flat-table:: struct media_device_info
59 - Name of the driver implementing the media API as a NUL-terminated
60 ASCII string. The driver version is stored in the
61 ``driver_version`` field.
63 Driver specific applications can use this information to verify
64 the driver identity. It is also useful to work around known bugs,
65 or to identify drivers in error reports.
73 - Device model name as a NUL-terminated UTF-8 string. The device
74 version is stored in the ``device_version`` field and is not be
75 appended to the model name.
83 - Serial number as a NUL-terminated ASCII string.
91 - Location of the device in the system as a NUL-terminated ASCII
92 string. This includes the bus type name (PCI, USB, ...) and a
93 bus-specific identifier.
101 - Media API version, formatted with the ``KERNEL_VERSION()`` macro.
109 - Hardware device revision in a driver-specific format.
117 - Media device driver version, formatted with the
118 ``KERNEL_VERSION()`` macro. Together with the ``driver`` field
119 this identifies a particular driver.
127 - Reserved for future extensions. Drivers and applications must set
131 The ``serial`` and ``bus_info`` fields can be used to distinguish
132 between multiple instances of otherwise identical hardware. The serial
133 number takes precedence when provided and can be assumed to be unique.
134 If the serial number is an empty string, the ``bus_info`` field can be
135 used instead. The ``bus_info`` field is guaranteed to be unique, but can
136 vary across reboots or device unplug/replug.
142 On success 0 is returned, on error -1 and the ``errno`` variable is set
143 appropriately. The generic error codes are described at the
144 :ref:`Generic Error Codes <gen-errors>` chapter.