static int hv_kvp_probe(device_t dev) { int rtn_value = ENXIO; const char *p = vmbus_get_type(dev); /** * Note: GUID codes below are predefined by the host hypervisor * (Hyper-V and Azure)interface and required for correct operation. */ /* KVP (Key Value Pair) Service */ const char kvp_guid[16] = {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6}; #ifdef DEBUG printf("hv_kvp_probe: called\n"); #endif if (!memcmp(p, &kvp_guid, sizeof(hv_guid))) { device_set_softc(dev, NULL); #ifdef DEBUG printf("hv_kvp_probe: memcmp matched\n"); #endif rtn_value = 0; } #ifdef DEBUG else printf("hv_kvp_probe: memcmp not matched\n"); #endif return rtn_value; }
static int hv_timesync_probe(device_t dev) { const char *p = vmbus_get_type(dev); if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Time Synch Service"); return BUS_PROBE_DEFAULT; } return ENXIO; }
static int netvsc_probe(device_t dev) { const char *p = vmbus_get_type(dev); if (!memcmp(p, &g_netvsc_drv.drv_obj.Base.deviceType, sizeof(GUID))) { device_set_desc(dev, "Synthetic Network Interface"); printf("Netvsc probe ....DONE \n"); return (0); } return (ENXIO); }
/* * Standard probe entry point. * */ static int netvsc_probe(device_t dev) { const char *p; p = vmbus_get_type(dev); if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) { device_set_desc(dev, "Synthetic Network Interface"); printf("Netvsc probe... DONE \n"); return (0); } return (ENXIO); }
static int hv_util_probe(device_t dev) { int i; int rtn_value = ENXIO; for (i = 0; i < HV_MAX_UTIL_SERVICES; i++) { const char *p = vmbus_get_type(dev); if (service_table[i].enabled && !memcmp(p, &service_table[i].guid, sizeof(hv_guid))) { device_set_softc(dev, (void *) (&service_table[i])); rtn_value = 0; } } return rtn_value; }