summaryrefslogtreecommitdiff
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2017-03-04 18:27:18 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-17 15:10:49 +0900
commit4827ee1dca5691c9fc568883170a568db94f9b38 (patch)
tree96f7e3d7511c8a6c8ebfbce933e3488366b074a2 /include/linux/hyperv.h
parent2a9d7de2038e87bb2a1085ac73c4246c260263f0 (diff)
vmbus: expose debug info for drivers
Allow driver to get debug information about state of the ring. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index de9b80ff6698..1fa727fe5f93 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -491,6 +491,12 @@ struct vmbus_channel_rescind_offer {
u32 child_relid;
} __packed;
+static inline u32
+hv_ringbuffer_pending_size(const struct hv_ring_buffer_info *rbi)
+{
+ return rbi->ring_buffer->pending_send_sz;
+}
+
/*
* Request Offer -- no parameters, SynIC message contains the partition ID
* Set Snoop -- no parameters, SynIC message contains the partition ID
@@ -1148,6 +1154,17 @@ static inline void *hv_get_drvdata(struct hv_device *dev)
return dev_get_drvdata(&dev->device);
}
+struct hv_ring_buffer_debug_info {
+ u32 current_interrupt_mask;
+ u32 current_read_index;
+ u32 current_write_index;
+ u32 bytes_avail_toread;
+ u32 bytes_avail_towrite;
+};
+
+void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
+ struct hv_ring_buffer_debug_info *debug_info);
+
/* Vmbus interface */
#define vmbus_driver_register(driver) \
__vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)