6.4. ioctl MEDIA_IOC_DEVICE_INFO¶
6.4.1. Name¶
MEDIA_IOC_DEVICE_INFO - Query device information
6.4.2. Synopsis¶
-
int
ioctl
(int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp)¶
6.4.3. Arguments¶
fd
File descriptor returned by open().
argp
Pointer to struct
media_device_info
.
6.4.4. Description¶
All media devices must support the MEDIA_IOC_DEVICE_INFO
ioctl. To
query device information, applications call the ioctl with a pointer to
a struct media_device_info
. The driver
fills the structure and returns the information to the application. The
ioctl never fails.
-
media_device_info
¶
char |
|
Name of the driver implementing the media API as a NUL-terminated
ASCII string. The driver version is stored in the
Driver specific applications can use this information to verify the driver identity. It is also useful to work around known bugs, or to identify drivers in error reports. |
char |
|
Device model name as a NUL-terminated UTF-8 string. The device
version is stored in the |
char |
|
Serial number as a NUL-terminated ASCII string. |
char |
|
Location of the device in the system as a NUL-terminated ASCII string. This includes the bus type name (PCI, USB, ...) and a bus-specific identifier. |
__u32 |
|
Media API version, formatted with the |
__u32 |
|
Hardware device revision in a driver-specific format. |
__u32 |
|
Media device driver version, formatted with the
|
__u32 |
|
Reserved for future extensions. Drivers and applications must set this array to zero. |
The serial
and bus_info
fields can be used to distinguish
between multiple instances of otherwise identical hardware. The serial
number takes precedence when provided and can be assumed to be unique.
If the serial number is an empty string, the bus_info
field can be
used instead. The bus_info
field is guaranteed to be unique, but can
vary across reboots or device unplug/replug.
6.4.5. Return Value¶
On success 0 is returned, on error -1 and the errno
variable is set
appropriately. The generic error codes are described at the
Generic Error Codes chapter.