[media] doc-rst: add media.h header to media contrller
[deliverable/linux.git] / Documentation / media / uapi / mediactl / media-ioc-device-info.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
d2c68150 3.. _media_ioc_device_info:
5377d91f
MH
4
5***************************
6ioctl MEDIA_IOC_DEVICE_INFO
7***************************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12MEDIA_IOC_DEVICE_INFO - Query device information
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
b7e67f6c 18.. cpp:function:: int ioctl( int fd, int request, struct media_device_info *argp )
5377d91f 19
586027ce 20
15e7d615 21Arguments
5377d91f
MH
22=========
23
24``fd``
25 File descriptor returned by :ref:`open() <media-func-open>`.
26
27``request``
28 MEDIA_IOC_DEVICE_INFO
29
30``argp``
31
32
15e7d615 33Description
5377d91f
MH
34===========
35
36All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
37query device information, applications call the ioctl with a pointer to
38a struct :ref:`media_device_info <media-device-info>`. The driver
39fills the structure and returns the information to the application. The
40ioctl never fails.
41
42
43.. _media-device-info:
44
45.. flat-table:: struct media_device_info
46 :header-rows: 0
47 :stub-columns: 0
48 :widths: 1 1 2
49
50
51 - .. row 1
52
53 - char
54
55 - ``driver``\ [16]
56
57 - Name of the driver implementing the media API as a NUL-terminated
0579e6e3
MCC
58 ASCII string. The driver version is stored in the
59 ``driver_version`` field.
5377d91f 60
0579e6e3
MCC
61 Driver specific applications can use this information to verify
62 the driver identity. It is also useful to work around known bugs,
63 or to identify drivers in error reports.
5377d91f
MH
64
65 - .. row 2
66
67 - char
68
69 - ``model``\ [32]
70
71 - Device model name as a NUL-terminated UTF-8 string. The device
0579e6e3
MCC
72 version is stored in the ``device_version`` field and is not be
73 appended to the model name.
5377d91f
MH
74
75 - .. row 3
76
77 - char
78
79 - ``serial``\ [40]
80
81 - Serial number as a NUL-terminated ASCII string.
82
83 - .. row 4
84
85 - char
86
87 - ``bus_info``\ [32]
88
89 - Location of the device in the system as a NUL-terminated ASCII
0579e6e3
MCC
90 string. This includes the bus type name (PCI, USB, ...) and a
91 bus-specific identifier.
5377d91f
MH
92
93 - .. row 5
94
95 - __u32
96
97 - ``media_version``
98
99 - Media API version, formatted with the ``KERNEL_VERSION()`` macro.
100
101 - .. row 6
102
103 - __u32
104
105 - ``hw_revision``
106
107 - Hardware device revision in a driver-specific format.
108
109 - .. row 7
110
111 - __u32
112
113 - ``driver_version``
114
115 - Media device driver version, formatted with the
0579e6e3
MCC
116 ``KERNEL_VERSION()`` macro. Together with the ``driver`` field
117 this identifies a particular driver.
5377d91f
MH
118
119 - .. row 8
120
121 - __u32
122
123 - ``reserved``\ [31]
124
125 - Reserved for future extensions. Drivers and applications must set
0579e6e3 126 this array to zero.
5377d91f
MH
127
128
129The ``serial`` and ``bus_info`` fields can be used to distinguish
130between multiple instances of otherwise identical hardware. The serial
131number takes precedence when provided and can be assumed to be unique.
132If the serial number is an empty string, the ``bus_info`` field can be
133used instead. The ``bus_info`` field is guaranteed to be unique, but can
134vary across reboots or device unplug/replug.
135
136
15e7d615 137Return Value
5377d91f
MH
138============
139
140On success 0 is returned, on error -1 and the ``errno`` variable is set
141appropriately. The generic error codes are described at the
142:ref:`Generic Error Codes <gen-errors>` chapter.
This page took 0.039661 seconds and 5 git commands to generate.