diff options
author | sephe <sephe@FreeBSD.org> | 2016-10-17 01:59:42 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-10-17 01:59:42 +0000 |
commit | 24933929befed2a1a285d49aee4cf11be884bfd8 (patch) | |
tree | 8ad6d1c054bafb5df2c10f21333395111e8c9849 /sys/dev/hyperv/include | |
parent | 878f1479062531d2d8777bd211c0eb60940b9e2f (diff) | |
download | FreeBSD-src-24933929befed2a1a285d49aee4cf11be884bfd8.zip FreeBSD-src-24933929befed2a1a285d49aee4cf11be884bfd8.tar.gz |
MFC 302808-302815
302808
hyperv/vmbus: Alloc/Free monitor param in vmbus channel alloc/free.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7101
302809
hyperv/vmbus: Move device register and channel free to the caller.
This paves the way for more cleanup/disentangle.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7102
302810
hyperv/vmbus: Move new channel scan notification to device register
And nuke now unnecessary function indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7103
302811
hyperv/vmbus: Cleanup vmbus_chan_msgproc_choffer
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7104
302812
hyperv/vmbus: Nuke the channel open state.
Channel is either opened or not-opened.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7105
302813
hyperv/vmbus: Cleanup vmbus_chan_add()
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7106
302814
hyperv/vmbus: Use sub-channel index to detect primary channel
In case that VMBUS_CHAN_ISPRIMARY is needed in the early place of
channel setup.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7108
302815
hyperv/vmbus: Only add primary channels to vmbus channel list
- Make the vmbus_chan_add more straightforward.
- Partially fix the hv_vmbus_release_unattached_channels().
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7109
Diffstat (limited to 'sys/dev/hyperv/include')
-rw-r--r-- | sys/dev/hyperv/include/hyperv.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/dev/hyperv/include/hyperv.h b/sys/dev/hyperv/include/hyperv.h index cf3e5c2..47f83a6 100644 --- a/sys/dev/hyperv/include/hyperv.h +++ b/sys/dev/hyperv/include/hyperv.h @@ -244,18 +244,9 @@ typedef struct { typedef void (*hv_vmbus_pfn_channel_callback)(void *context); -typedef enum { - HV_CHANNEL_OFFER_STATE, - HV_CHANNEL_OPENING_STATE, - HV_CHANNEL_OPEN_STATE, - HV_CHANNEL_OPENED_STATE, - HV_CHANNEL_CLOSING_NONDESTRUCTIVE_STATE, -} hv_vmbus_channel_state; - typedef struct hv_vmbus_channel { device_t ch_dev; struct vmbus_softc *vmbus_sc; - hv_vmbus_channel_state state; uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */ uint32_t ch_id; /* channel id */ @@ -337,14 +328,15 @@ typedef struct hv_vmbus_channel { struct task ch_detach_task; TAILQ_ENTRY(hv_vmbus_channel) ch_link; uint32_t ch_subidx; /* subchan index */ - + volatile uint32_t ch_stflags; /* atomic-op */ + /* VMBUS_CHAN_ST_ */ struct hyperv_guid ch_guid_type; struct hyperv_guid ch_guid_inst; struct sysctl_ctx_list ch_sysctl_ctx; } hv_vmbus_channel; -#define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) +#define VMBUS_CHAN_ISPRIMARY(chan) ((chan)->ch_subidx == 0) #define VMBUS_CHAN_FLAG_HASMNF 0x0001 /* @@ -357,6 +349,9 @@ typedef struct hv_vmbus_channel { */ #define VMBUS_CHAN_FLAG_BATCHREAD 0x0002 +#define VMBUS_CHAN_ST_OPENED_SHIFT 0 +#define VMBUS_CHAN_ST_OPENED (1 << VMBUS_CHAN_ST_OPENED_SHIFT) + static inline void hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t on) { |