hyperv/vmbus: Add channel ivar accessor.

This makes life easier during the transition period to nuke the hv_device.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7026
This commit is contained in:
sephe 2016-07-13 05:19:45 +00:00
parent 8c2d93f18a
commit e9cc4a9f4e
2 changed files with 9 additions and 1 deletions

View File

@ -403,14 +403,18 @@ enum {
HV_VMBUS_IVAR_TYPE,
HV_VMBUS_IVAR_INSTANCE,
HV_VMBUS_IVAR_NODE,
HV_VMBUS_IVAR_DEVCTX
HV_VMBUS_IVAR_DEVCTX,
HV_VMBUS_IVAR_CHAN,
};
#define HV_VMBUS_ACCESSOR(var, ivar, type) \
__BUS_ACCESSOR(vmbus, var, HV_VMBUS, ivar, type)
struct hv_vmbus_channel;
HV_VMBUS_ACCESSOR(type, TYPE, const char *)
HV_VMBUS_ACCESSOR(devctx, DEVCTX, struct hv_device *)
HV_VMBUS_ACCESSOR(channel, CHAN, struct hv_vmbus_channel *)
/*

View File

@ -978,6 +978,10 @@ vmbus_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
case HV_VMBUS_IVAR_NODE:
*result = (uintptr_t)child_dev_ctx->device;
return (0);
case HV_VMBUS_IVAR_CHAN:
*result = (uintptr_t)child_dev_ctx->channel;
return (0);
}
return (ENOENT);
}