brintos

brintos / linux-shallow public Read only

0
0
Text · 3.0 KiB · d56ee66 Raw
107 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: MC3 4.. _media_ioc_device_info:5 6***************************7ioctl MEDIA_IOC_DEVICE_INFO8***************************9 10Name11====12 13MEDIA_IOC_DEVICE_INFO - Query device information14 15Synopsis16========17 18.. c:macro:: MEDIA_IOC_DEVICE_INFO19 20``int ioctl(int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp)``21 22Arguments23=========24 25``fd``26    File descriptor returned by :c:func:`open()`.27 28``argp``29    Pointer to struct :c:type:`media_device_info`.30 31Description32===========33 34All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To35query device information, applications call the ioctl with a pointer to36a struct :c:type:`media_device_info`. The driver37fills the structure and returns the information to the application. The38ioctl never fails.39 40.. c:type:: media_device_info41 42.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|43 44.. flat-table:: struct media_device_info45    :header-rows:  046    :stub-columns: 047    :widths:       1 1 248 49    *  -  char50       -  ``driver``\ [16]51       -  Name of the driver implementing the media API as a NUL-terminated52	  ASCII string. The driver version is stored in the53	  ``driver_version`` field.54 55	  Driver specific applications can use this information to verify56	  the driver identity. It is also useful to work around known bugs,57	  or to identify drivers in error reports.58 59    *  -  char60       -  ``model``\ [32]61       -  Device model name as a NUL-terminated UTF-8 string. The device62	  version is stored in the ``device_version`` field and is not be63	  appended to the model name.64 65    *  -  char66       -  ``serial``\ [40]67       -  Serial number as a NUL-terminated ASCII string.68 69    *  -  char70       -  ``bus_info``\ [32]71       -  Location of the device in the system as a NUL-terminated ASCII72	  string. This includes the bus type name (PCI, USB, ...) and a73	  bus-specific identifier.74 75    *  -  __u3276       -  ``media_version``77       -  Media API version, formatted with the ``KERNEL_VERSION()`` macro.78 79    *  -  __u3280       -  ``hw_revision``81       -  Hardware device revision in a driver-specific format.82 83    *  -  __u3284       -  ``driver_version``85       -  Media device driver version, formatted with the86	  ``KERNEL_VERSION()`` macro. Together with the ``driver`` field87	  this identifies a particular driver.88 89    *  -  __u3290       -  ``reserved``\ [31]91       -  Reserved for future extensions. Drivers and applications must set92	  this array to zero.93 94The ``serial`` and ``bus_info`` fields can be used to distinguish95between multiple instances of otherwise identical hardware. The serial96number takes precedence when provided and can be assumed to be unique.97If the serial number is an empty string, the ``bus_info`` field can be98used instead. The ``bus_info`` field is guaranteed to be unique, but can99vary across reboots or device unplug/replug.100 101Return Value102============103 104On success 0 is returned, on error -1 and the ``errno`` variable is set105appropriately. The generic error codes are described at the106:ref:`Generic Error Codes <gen-errors>` chapter.107