/* * media_device_open.c - Media Controller Device Open Test * * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com> * Copyright (c) 2016 Samsung Electronics Co., Ltd. *
*/
/* * This file adds a test for Media Controller API. * This test should be run as root and should not be * included in the Kselftest run. This test should be * run when hardware and driver that makes use Media * Controller API are present in the system. * * This test opens user specified Media Device and calls * MEDIA_IOC_DEVICE_INFO ioctl, closes the file, and exits. * * Usage: * sudo ./media_device_open -d /dev/mediaX * * Run this test is a loop and run bind/unbind on the driver.
*/
if (getuid() != 0)
ksft_exit_skip("Please run the test as root - Exiting.\n");
/* Open Media device and keep it open */
fd = open(media_device, O_RDWR); if (fd == -1) {
printf("Media Device open errno %s\n", strerror(errno)); exit(-1);
}
ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); if (ret < 0)
printf("Media Device Info errno %s\n", strerror(errno)); else
printf("Media device model %s driver %s\n",
mdi.model, mdi.driver);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.