Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | if (channel != NULL) { | ||||
/* | /* | ||||
* Check if this is a sub channel. | * Check if this is a sub channel. | ||||
*/ | */ | ||||
if (new_channel->ch_subidx != 0) { | if (new_channel->ch_subidx != 0) { | ||||
/* | /* | ||||
* It is a sub channel offer, process it. | * It is a sub channel offer, process it. | ||||
*/ | */ | ||||
new_channel->primary_channel = channel; | new_channel->primary_channel = channel; | ||||
new_channel->device = channel->device; | |||||
new_channel->ch_dev = channel->ch_dev; | new_channel->ch_dev = channel->ch_dev; | ||||
mtx_lock(&channel->sc_lock); | mtx_lock(&channel->sc_lock); | ||||
TAILQ_INSERT_TAIL(&channel->sc_list_anchor, | TAILQ_INSERT_TAIL(&channel->sc_list_anchor, | ||||
new_channel, sc_list_entry); | new_channel, sc_list_entry); | ||||
mtx_unlock(&channel->sc_lock); | mtx_unlock(&channel->sc_lock); | ||||
/* | /* | ||||
* Insert the new channel to the end of the global | * Insert the new channel to the end of the global | ||||
Show All 26 Lines | if (channel != NULL) { | ||||
printf("VMBUS: duplicated primary channel%u\n", | printf("VMBUS: duplicated primary channel%u\n", | ||||
new_channel->ch_id); | new_channel->ch_id); | ||||
hv_vmbus_free_vmbus_channel(new_channel); | hv_vmbus_free_vmbus_channel(new_channel); | ||||
return; | return; | ||||
} | } | ||||
new_channel->state = HV_CHANNEL_OPEN_STATE; | new_channel->state = HV_CHANNEL_OPEN_STATE; | ||||
/* | |||||
* Start the process of binding this offer to the driver | |||||
* (We need to set the device field before calling | |||||
* hv_vmbus_child_device_add()) | |||||
*/ | |||||
new_channel->device = hv_vmbus_child_device_create(new_channel); | |||||
/* | /* | ||||
* Add the new device to the bus. This will kick off device-driver | * Add the new device to the bus. This will kick off device-driver | ||||
* binding which eventually invokes the device driver's AddDevice() | * binding which eventually invokes the device driver's AddDevice() | ||||
* method. | * method. | ||||
* | * | ||||
* NOTE: | * NOTE: | ||||
* Error is ignored here; don't have much to do if error really | * Error is ignored here; don't have much to do if error really | ||||
▲ Show 20 Lines • Show All 361 Lines • Show Last 20 Lines |