diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2017-03-04 20:27:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-17 02:10:49 -0400 |
commit | 4827ee1dca5691c9fc568883170a568db94f9b38 (patch) | |
tree | 96f7e3d7511c8a6c8ebfbce933e3488366b074a2 /include/linux/hyperv.h | |
parent | 2a9d7de2038e87bb2a1085ac73c4246c260263f0 (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.h | 17 |
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 { | |||
491 | u32 child_relid; | 491 | u32 child_relid; |
492 | } __packed; | 492 | } __packed; |
493 | 493 | ||
494 | static inline u32 | ||
495 | hv_ringbuffer_pending_size(const struct hv_ring_buffer_info *rbi) | ||
496 | { | ||
497 | return rbi->ring_buffer->pending_send_sz; | ||
498 | } | ||
499 | |||
494 | /* | 500 | /* |
495 | * Request Offer -- no parameters, SynIC message contains the partition ID | 501 | * Request Offer -- no parameters, SynIC message contains the partition ID |
496 | * Set Snoop -- no parameters, SynIC message contains the partition ID | 502 | * Set Snoop -- no parameters, SynIC message contains the partition ID |
@@ -1148,6 +1154,17 @@ static inline void *hv_get_drvdata(struct hv_device *dev) | |||
1148 | return dev_get_drvdata(&dev->device); | 1154 | return dev_get_drvdata(&dev->device); |
1149 | } | 1155 | } |
1150 | 1156 | ||
1157 | struct hv_ring_buffer_debug_info { | ||
1158 | u32 current_interrupt_mask; | ||
1159 | u32 current_read_index; | ||
1160 | u32 current_write_index; | ||
1161 | u32 bytes_avail_toread; | ||
1162 | u32 bytes_avail_towrite; | ||
1163 | }; | ||
1164 | |||
1165 | void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info, | ||
1166 | struct hv_ring_buffer_debug_info *debug_info); | ||
1167 | |||
1151 | /* Vmbus interface */ | 1168 | /* Vmbus interface */ |
1152 | #define vmbus_driver_register(driver) \ | 1169 | #define vmbus_driver_register(driver) \ |
1153 | __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) | 1170 | __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) |