summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-10-11 07:30:59 +0000
committersephe <sephe@FreeBSD.org>2016-10-11 07:30:59 +0000
commite454e6f1254efd4b2d767a04a4e076f85863c58c (patch)
tree7062d628c193dc4f758f1b55865b14a9e36a53b0 /sys/dev/hyperv/vmbus/hv_channel_mgmt.c
parent5aca196a1235050ca5edda3bcef3ce631a06097b (diff)
downloadFreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.zip
FreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.tar.gz
MFC 302698-302704,302706
302698 hyperv/vmbus: Add vmbus method for GUID base device probing. Reduce the exposure of hv_device. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7024 302699 hyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7025 302700 hyperv/vmbus: Add channel ivar accessor. This makes life easier during the transition period to nuke the hv_device. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7026 302701 hyperv/stor: Avoid the hv_device and nuke the broken get_stor_device This paves way to nuke the hv_device, which is actually an unncessary indirection. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7027 302702 hyperv/util: Avoid the hv_device This paves way to nuke the hv_device, which is actually an unncessary indirection. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7028 302703 hyperv/vmbus: Deprecate the usage of hv_device. This paves way to nuke the hv_device, which is actually an unncessary indirection. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7032 302704 hyperv/hn: Avoid the hv_device This paves way to nuke the hv_device, which is actually an unncessary indirection. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7033 302706 hyperv: Get rid of hv_device, which is unnecessary indirection. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7034
Diffstat (limited to 'sys/dev/hyperv/vmbus/hv_channel_mgmt.c')
-rw-r--r--sys/dev/hyperv/vmbus/hv_channel_mgmt.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_channel_mgmt.c b/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
index b6d0eac..54a61c7 100644
--- a/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
+++ b/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
@@ -165,7 +165,7 @@ vmbus_channel_process_offer(hv_vmbus_channel *new_channel)
* It is a sub channel offer, process it.
*/
new_channel->primary_channel = channel;
- new_channel->device = channel->device;
+ new_channel->ch_dev = channel->ch_dev;
mtx_lock(&channel->sc_lock);
TAILQ_INSERT_TAIL(&channel->sc_list_anchor,
new_channel, sc_list_entry);
@@ -209,19 +209,15 @@ vmbus_channel_process_offer(hv_vmbus_channel *new_channel)
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
* binding which eventually invokes the device driver's AddDevice()
* method.
+ *
+ * NOTE:
+ * Error is ignored here; don't have much to do if error really
+ * happens.
*/
- hv_vmbus_child_device_register(new_channel->vmbus_sc,
- new_channel->device);
+ hv_vmbus_child_device_register(new_channel);
}
void
@@ -368,8 +364,8 @@ vmbus_chan_detach_task(void *xchan, int pending __unused)
struct hv_vmbus_channel *chan = xchan;
if (HV_VMBUS_CHAN_ISPRIMARY(chan)) {
- /* Only primary channel owns the hv_device */
- hv_vmbus_child_device_unregister(chan->device);
+ /* Only primary channel owns the device */
+ hv_vmbus_child_device_unregister(chan);
/* NOTE: DO NOT free primary channel for now */
} else {
struct vmbus_softc *sc = chan->vmbus_sc;
@@ -449,8 +445,8 @@ hv_vmbus_release_unattached_channels(struct vmbus_softc *sc)
TAILQ_REMOVE(&sc->vmbus_chlist, channel, ch_link);
if (HV_VMBUS_CHAN_ISPRIMARY(channel)) {
- /* Only primary channel owns the hv_device */
- hv_vmbus_child_device_unregister(channel->device);
+ /* Only primary channel owns the device */
+ hv_vmbus_child_device_unregister(channel);
}
hv_vmbus_free_vmbus_channel(channel);
}
OpenPOWER on IntegriCloud