summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/include/hyperv.h
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/include/hyperv.h
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/include/hyperv.h')
-rw-r--r--sys/dev/hyperv/include/hyperv.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/sys/dev/hyperv/include/hyperv.h b/sys/dev/hyperv/include/hyperv.h
index 2ebc608..41d9f59 100644
--- a/sys/dev/hyperv/include/hyperv.h
+++ b/sys/dev/hyperv/include/hyperv.h
@@ -399,20 +399,6 @@ typedef struct {
#define HW_MACADDR_LEN 6
-enum {
- HV_VMBUS_IVAR_TYPE,
- HV_VMBUS_IVAR_INSTANCE,
- HV_VMBUS_IVAR_NODE,
- HV_VMBUS_IVAR_DEVCTX
-};
-
-#define HV_VMBUS_ACCESSOR(var, ivar, type) \
- __BUS_ACCESSOR(vmbus, var, HV_VMBUS, ivar, type)
-
-HV_VMBUS_ACCESSOR(type, TYPE, const char *)
-HV_VMBUS_ACCESSOR(devctx, DEVCTX, struct hv_device *)
-
-
/*
* Common defines for Hyper-V ICs
*/
@@ -534,7 +520,7 @@ typedef union {
} __packed hv_vmbus_connection_id;
typedef struct hv_vmbus_channel {
- struct hv_device* device;
+ device_t ch_dev;
struct vmbus_softc *vmbus_sc;
hv_vmbus_channel_state state;
uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */
@@ -647,15 +633,6 @@ hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t state)
channel->batched_reading = state;
}
-typedef struct hv_device {
- hv_guid class_id;
- hv_guid device_id;
- device_t device;
- hv_vmbus_channel* channel;
-} hv_device;
-
-
-
int hv_vmbus_channel_recv_packet(
hv_vmbus_channel* channel,
void* buffer,
@@ -737,4 +714,10 @@ hv_get_phys_addr(void *virt)
return (ret);
}
+static __inline struct hv_vmbus_channel *
+vmbus_get_channel(device_t dev)
+{
+ return device_get_ivars(dev);
+}
+
#endif /* __HYPERV_H__ */
OpenPOWER on IntegriCloud