Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) | vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) | ||||
{ | { | ||||
char guidbuf[40]; | char guidbuf[40]; | ||||
struct hv_device *dev_ctx = device_get_ivars(child); | struct hv_device *dev_ctx = device_get_ivars(child); | ||||
if (dev_ctx == NULL) | |||||
decui_microsoft.com: Must we check this? It looks almost all the callers of device_get_ivars(child) don't have the… | |||||
return (0); | |||||
strlcat(buf, "classid=", buflen); | strlcat(buf, "classid=", buflen); | ||||
snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); | snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); | ||||
strlcat(buf, guidbuf, buflen); | strlcat(buf, guidbuf, buflen); | ||||
strlcat(buf, " deviceid=", buflen); | strlcat(buf, " deviceid=", buflen); | ||||
snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); | snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); | ||||
strlcat(buf, guidbuf, buflen); | strlcat(buf, guidbuf, buflen); | ||||
▲ Show 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | vmbus_bus_init(void) | ||||
/* | /* | ||||
* Connect to VMBus in the root partition | * Connect to VMBus in the root partition | ||||
*/ | */ | ||||
ret = hv_vmbus_connect(); | ret = hv_vmbus_connect(); | ||||
if (ret != 0) | if (ret != 0) | ||||
goto cleanup1; | goto cleanup1; | ||||
/* delay attach until inerrupt is on */ | |||||
bus_generic_attach(vmbus_devp); | |||||
decui_microsoft.comUnsubmitted Not Done Inline Actionswhat's the meaning of "delay attach until inerrupt is on" -- I don't see how bus_generic_attach() can delay things? At this place, the vmbus doesn't have any child device yet? decui_microsoft.com: what's the meaning of "delay attach until inerrupt is on" -- I don't see how bus_generic_attach… | |||||
sepherosa_gmail.comUnsubmitted Not Done Inline ActionsHe tries to attach the hv_et here. Rest of the devices go through channel offers later. sepherosa_gmail.com: He tries to attach the hv_et here. Rest of the devices go through channel offers later. | |||||
decui_microsoft.comUnsubmitted Not Done Inline ActionsGot it. Thanks! decui_microsoft.com: Got it. Thanks! | |||||
hv_vmbus_request_channel_offers(); | hv_vmbus_request_channel_offers(); | ||||
return (ret); | return (ret); | ||||
cleanup1: | cleanup1: | ||||
/* | /* | ||||
* Free pages alloc'ed | * Free pages alloc'ed | ||||
*/ | */ | ||||
for (n = 0; n < 2 * MAXCPU; n++) | for (n = 0; n < 2 * MAXCPU; n++) | ||||
Show All 29 Lines | vmbus_attach(device_t dev) | ||||
* If the system has already booted and thread | * If the system has already booted and thread | ||||
* scheduling is possible indicated by the global | * scheduling is possible indicated by the global | ||||
* cold set to zero, we just call the driver | * cold set to zero, we just call the driver | ||||
* initialization directly. | * initialization directly. | ||||
*/ | */ | ||||
if (!cold) | if (!cold) | ||||
vmbus_bus_init(); | vmbus_bus_init(); | ||||
bus_generic_probe(dev); | |||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
vmbus_init(void) | vmbus_init(void) | ||||
{ | { | ||||
if (vm_guest != VM_GUEST_HV) | if (vm_guest != VM_GUEST_HV) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |
Must we check this? It looks almost all the callers of device_get_ivars(child) don't have the check.
If it's a must, we should fix the other callers of device_get_ivars() too, e.g., vmbus_read_ivar(), vmbus_write_ivar().