aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-13 14:33:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 12:01:17 -0400
commit1fdde16d1f93376ad2a2df769f756572c2e84cbd (patch)
tree1478506131d947ea2860edf5d5936eaf9790d135 /drivers/hv
parent2c9be3eacc39948af2341595322c014833699ac5 (diff)
hv: delete struct hv_dev_port_info
It's no longer needed, and the struct hv_ring_buffer_debug_info structure shouldn't be "global" so move it to the local .h file instead. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hyperv_vmbus.h7
-rw-r--r--drivers/hv/vmbus_drv.c35
2 files changed, 17 insertions, 25 deletions
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index d58c22ffb29a..e05517616a06 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -514,6 +514,13 @@ struct hv_context {
514 514
515extern struct hv_context hv_context; 515extern struct hv_context hv_context;
516 516
517struct hv_ring_buffer_debug_info {
518 u32 current_interrupt_mask;
519 u32 current_read_index;
520 u32 current_write_index;
521 u32 bytes_avail_toread;
522 u32 bytes_avail_towrite;
523};
517 524
518/* Hv Interface */ 525/* Hv Interface */
519 526
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 62d9311b0541..cf3220e8a3a6 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -47,8 +47,8 @@ static struct completion probe_event;
47static int irq; 47static int irq;
48 48
49struct hv_device_info { 49struct hv_device_info {
50 struct hv_dev_port_info inbound; 50 struct hv_ring_buffer_debug_info inbound;
51 struct hv_dev_port_info outbound; 51 struct hv_ring_buffer_debug_info outbound;
52}; 52};
53 53
54static int vmbus_exists(void) 54static int vmbus_exists(void)
@@ -63,26 +63,11 @@ static int vmbus_exists(void)
63static void get_channel_info(struct hv_device *device, 63static void get_channel_info(struct hv_device *device,
64 struct hv_device_info *info) 64 struct hv_device_info *info)
65{ 65{
66 struct hv_ring_buffer_debug_info inbound;
67 struct hv_ring_buffer_debug_info outbound;
68
69 if (!device->channel) 66 if (!device->channel)
70 return; 67 return;
71 68
72 hv_ringbuffer_get_debuginfo(&device->channel->inbound, &inbound); 69 hv_ringbuffer_get_debuginfo(&device->channel->inbound, &info->inbound);
73 hv_ringbuffer_get_debuginfo(&device->channel->outbound, &outbound); 70 hv_ringbuffer_get_debuginfo(&device->channel->outbound, &info->outbound);
74
75 info->inbound.int_mask = inbound.current_interrupt_mask;
76 info->inbound.read_idx = inbound.current_read_index;
77 info->inbound.write_idx = inbound.current_write_index;
78 info->inbound.bytes_avail_toread = inbound.bytes_avail_toread;
79 info->inbound.bytes_avail_towrite = inbound.bytes_avail_towrite;
80
81 info->outbound.int_mask = outbound.current_interrupt_mask;
82 info->outbound.read_idx = outbound.current_read_index;
83 info->outbound.write_idx = outbound.current_write_index;
84 info->outbound.bytes_avail_toread = outbound.bytes_avail_toread;
85 info->outbound.bytes_avail_towrite = outbound.bytes_avail_towrite;
86} 71}
87 72
88#define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2) 73#define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2)
@@ -114,11 +99,11 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
114 get_channel_info(hv_dev, device_info); 99 get_channel_info(hv_dev, device_info);
115 100
116 if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { 101 if (!strcmp(dev_attr->attr.name, "out_intr_mask")) {
117 ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); 102 ret = sprintf(buf, "%d\n", device_info->outbound.current_interrupt_mask);
118 } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { 103 } else if (!strcmp(dev_attr->attr.name, "out_read_index")) {
119 ret = sprintf(buf, "%d\n", device_info->outbound.read_idx); 104 ret = sprintf(buf, "%d\n", device_info->outbound.current_read_index);
120 } else if (!strcmp(dev_attr->attr.name, "out_write_index")) { 105 } else if (!strcmp(dev_attr->attr.name, "out_write_index")) {
121 ret = sprintf(buf, "%d\n", device_info->outbound.write_idx); 106 ret = sprintf(buf, "%d\n", device_info->outbound.current_write_index);
122 } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) { 107 } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) {
123 ret = sprintf(buf, "%d\n", 108 ret = sprintf(buf, "%d\n",
124 device_info->outbound.bytes_avail_toread); 109 device_info->outbound.bytes_avail_toread);
@@ -126,11 +111,11 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
126 ret = sprintf(buf, "%d\n", 111 ret = sprintf(buf, "%d\n",
127 device_info->outbound.bytes_avail_towrite); 112 device_info->outbound.bytes_avail_towrite);
128 } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) { 113 } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) {
129 ret = sprintf(buf, "%d\n", device_info->inbound.int_mask); 114 ret = sprintf(buf, "%d\n", device_info->inbound.current_interrupt_mask);
130 } else if (!strcmp(dev_attr->attr.name, "in_read_index")) { 115 } else if (!strcmp(dev_attr->attr.name, "in_read_index")) {
131 ret = sprintf(buf, "%d\n", device_info->inbound.read_idx); 116 ret = sprintf(buf, "%d\n", device_info->inbound.current_read_index);
132 } else if (!strcmp(dev_attr->attr.name, "in_write_index")) { 117 } else if (!strcmp(dev_attr->attr.name, "in_write_index")) {
133 ret = sprintf(buf, "%d\n", device_info->inbound.write_idx); 118 ret = sprintf(buf, "%d\n", device_info->inbound.current_write_index);
134 } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) { 119 } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) {
135 ret = sprintf(buf, "%d\n", 120 ret = sprintf(buf, "%d\n",
136 device_info->inbound.bytes_avail_toread); 121 device_info->inbound.bytes_avail_toread);