1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#include <linux/ioctl.h>
#include <linux/rtc.h>
#include "ioctls.h"
#include "utils.h"
static const struct ioctl rtc_ioctls[] = {
IOCTL(RTC_AIE_ON),
IOCTL(RTC_AIE_OFF),
IOCTL(RTC_UIE_ON),
IOCTL(RTC_UIE_OFF),
IOCTL(RTC_PIE_ON),
IOCTL(RTC_PIE_OFF),
IOCTL(RTC_WIE_ON),
IOCTL(RTC_WIE_OFF),
IOCTL(RTC_ALM_SET),
IOCTL(RTC_ALM_READ),
IOCTL(RTC_RD_TIME),
IOCTL(RTC_SET_TIME),
IOCTL(RTC_IRQP_READ),
IOCTL(RTC_IRQP_SET),
IOCTL(RTC_EPOCH_READ),
IOCTL(RTC_EPOCH_SET),
IOCTL(RTC_WKALM_SET),
IOCTL(RTC_WKALM_RD),
IOCTL(RTC_PLL_GET),
IOCTL(RTC_PLL_SET),
#ifdef RTC_VL_READ
IOCTL(RTC_VL_READ),
#endif
#ifdef RTC_VL_CLR
IOCTL(RTC_VL_CLR),
#endif
};
static const char *const rtc_devs[] = {
"rtc",
};
static const struct ioctl_group rtc_grp = {
.devtype = DEV_CHAR,
.devs = rtc_devs,
.devs_cnt = ARRAY_SIZE(rtc_devs),
.sanitise = pick_random_ioctl,
.ioctls = rtc_ioctls,
.ioctls_cnt = ARRAY_SIZE(rtc_ioctls),
};
REG_IOCTL_GROUP(rtc_grp)
|