#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/reboot.h>
#include <linux/hyperv.h>
#include <linux/clockchips.h>
#include <linux/ptp_clock_kernel.h>
#include <asm/mshyperv.h>
#include "hyperv_vmbus.h"
#define SD_MAJOR …
#define SD_MINOR …
#define SD_MINOR_1 …
#define SD_MINOR_2 …
#define SD_VERSION_3_1 …
#define SD_VERSION_3_2 …
#define SD_VERSION …
#define SD_MAJOR_1 …
#define SD_VERSION_1 …
#define TS_MAJOR …
#define TS_MINOR …
#define TS_VERSION …
#define TS_MAJOR_1 …
#define TS_VERSION_1 …
#define TS_MAJOR_3 …
#define TS_VERSION_3 …
#define HB_MAJOR …
#define HB_MINOR …
#define HB_VERSION …
#define HB_MAJOR_1 …
#define HB_VERSION_1 …
static int sd_srv_version;
static int ts_srv_version;
static int hb_srv_version;
#define SD_VER_COUNT …
static const int sd_versions[] = …;
#define TS_VER_COUNT …
static const int ts_versions[] = …;
#define HB_VER_COUNT …
static const int hb_versions[] = …;
#define FW_VER_COUNT …
static const int fw_versions[] = …;
struct hibernate_work_context { … };
static struct hibernate_work_context hibernate_context;
static bool hibernation_supported;
static void send_hibernate_uevent(struct work_struct *work)
{ … }
static int hv_shutdown_init(struct hv_util_service *srv)
{ … }
static void shutdown_onchannelcallback(void *context);
static struct hv_util_service util_shutdown = …;
static int hv_timesync_init(struct hv_util_service *srv);
static int hv_timesync_pre_suspend(void);
static void hv_timesync_deinit(void);
static void timesync_onchannelcallback(void *context);
static struct hv_util_service util_timesynch = …;
static void heartbeat_onchannelcallback(void *context);
static struct hv_util_service util_heartbeat = …;
static struct hv_util_service util_kvp = …;
static struct hv_util_service util_vss = …;
static void perform_shutdown(struct work_struct *dummy)
{ … }
static void perform_restart(struct work_struct *dummy)
{ … }
static DECLARE_WORK(shutdown_work, perform_shutdown);
static DECLARE_WORK(restart_work, perform_restart);
static void shutdown_onchannelcallback(void *context)
{ … }
static struct work_struct adj_time_work;
static struct { … } host_ts;
static bool timesync_implicit;
module_param(timesync_implicit, bool, 0644);
MODULE_PARM_DESC(…) …;
static inline u64 reftime_to_ns(u64 reftime)
{ … }
static const u64 HOST_TIMESYNC_DELAY_THRESH = …;
static int hv_get_adj_host_time(struct timespec64 *ts)
{ … }
static void hv_set_host_time(struct work_struct *work)
{ … }
static inline bool hv_implicit_sync(u64 host_time)
{ … }
static inline void adj_guesttime(u64 hosttime, u64 reftime, u8 adj_flags)
{ … }
static void timesync_onchannelcallback(void *context)
{ … }
static void heartbeat_onchannelcallback(void *context)
{ … }
#define HV_UTIL_RING_SEND_SIZE …
#define HV_UTIL_RING_RECV_SIZE …
static int util_probe(struct hv_device *dev,
const struct hv_vmbus_device_id *dev_id)
{ … }
static void util_remove(struct hv_device *dev)
{ … }
static int util_suspend(struct hv_device *dev)
{ … }
static int util_resume(struct hv_device *dev)
{ … }
static const struct hv_vmbus_device_id id_table[] = …;
MODULE_DEVICE_TABLE(vmbus, id_table);
static struct hv_driver util_drv = …;
static int hv_ptp_enable(struct ptp_clock_info *info,
struct ptp_clock_request *request, int on)
{ … }
static int hv_ptp_settime(struct ptp_clock_info *p, const struct timespec64 *ts)
{ … }
static int hv_ptp_adjfine(struct ptp_clock_info *ptp, long delta)
{ … }
static int hv_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{ … }
static int hv_ptp_gettime(struct ptp_clock_info *info, struct timespec64 *ts)
{ … }
static struct ptp_clock_info ptp_hyperv_info = …;
static struct ptp_clock *hv_ptp_clock;
static int hv_timesync_init(struct hv_util_service *srv)
{ … }
static void hv_timesync_cancel_work(void)
{ … }
static int hv_timesync_pre_suspend(void)
{ … }
static void hv_timesync_deinit(void)
{ … }
static int __init init_hyperv_utils(void)
{ … }
static void exit_hyperv_utils(void)
{ … }
module_init(…) …;
module_exit(exit_hyperv_utils);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;