Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/utilities/hv_kvp.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | if (hv_kvp_log > 0) \ | ||||
log(LOG_ERR, "hv_kvp: " __VA_ARGS__); \ | log(LOG_ERR, "hv_kvp: " __VA_ARGS__); \ | ||||
} while (0) | } while (0) | ||||
#define hv_kvp_log_info(...) do { \ | #define hv_kvp_log_info(...) do { \ | ||||
if (hv_kvp_log > 1) \ | if (hv_kvp_log > 1) \ | ||||
log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ | log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ | ||||
} while (0) | } while (0) | ||||
static const struct hyperv_guid service_guid = { .hv_guid = | static const struct vmbus_ic_desc vmbus_kvp_descs[] = { | ||||
{0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, | { | ||||
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; | .ic_guid = { .hv_guid = { | ||||
0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, | |||||
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 } }, | |||||
.ic_desc = "Hyper-V KVP" | |||||
}, | |||||
VMBUS_IC_DESC_END | |||||
}; | |||||
/* character device prototypes */ | /* character device prototypes */ | ||||
static d_open_t hv_kvp_dev_open; | static d_open_t hv_kvp_dev_open; | ||||
static d_close_t hv_kvp_dev_close; | static d_close_t hv_kvp_dev_close; | ||||
static d_read_t hv_kvp_dev_daemon_read; | static d_read_t hv_kvp_dev_daemon_read; | ||||
static d_write_t hv_kvp_dev_daemon_write; | static d_write_t hv_kvp_dev_daemon_write; | ||||
static d_poll_t hv_kvp_dev_daemon_poll; | static d_poll_t hv_kvp_dev_daemon_poll; | ||||
▲ Show 20 Lines • Show All 761 Lines • ▼ Show 20 Lines | hv_kvp_dev_daemon_poll(struct cdev *dev, int events, struct thread *td) | ||||
mtx_unlock(&sc->pending_mutex); | mtx_unlock(&sc->pending_mutex); | ||||
return (revents); | return (revents); | ||||
} | } | ||||
static int | static int | ||||
hv_kvp_probe(device_t dev) | hv_kvp_probe(device_t dev) | ||||
{ | { | ||||
if (resource_disabled("hvkvp", 0)) | |||||
return ENXIO; | |||||
if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { | return (vmbus_ic_probe(dev, vmbus_kvp_descs)); | ||||
device_set_desc(dev, "Hyper-V KVP Service"); | |||||
return BUS_PROBE_DEFAULT; | |||||
} | |||||
return ENXIO; | |||||
} | } | ||||
static int | static int | ||||
hv_kvp_attach(device_t dev) | hv_kvp_attach(device_t dev) | ||||
{ | { | ||||
int error; | int error; | ||||
struct sysctl_oid_list *child; | struct sysctl_oid_list *child; | ||||
struct sysctl_ctx_list *ctx; | struct sysctl_ctx_list *ctx; | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |