Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17 -42
+7
drivers/hv/hyperv_vmbus.h
··· 514 514 515 515 extern struct hv_context hv_context; 516 516 517 + struct 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 525 /* Hv Interface */ 519 526
+10 -25
drivers/hv/vmbus_drv.c
··· 47 47 static int irq; 48 48 49 49 struct hv_device_info { 50 - struct hv_dev_port_info inbound; 51 - struct hv_dev_port_info outbound; 50 + struct hv_ring_buffer_debug_info inbound; 51 + struct hv_ring_buffer_debug_info outbound; 52 52 }; 53 53 54 54 static int vmbus_exists(void) ··· 63 63 static void get_channel_info(struct hv_device *device, 64 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 66 if (!device->channel) 70 67 return; 71 68 72 - hv_ringbuffer_get_debuginfo(&device->channel->inbound, &inbound); 73 - hv_ringbuffer_get_debuginfo(&device->channel->outbound, &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; 69 + hv_ringbuffer_get_debuginfo(&device->channel->inbound, &info->inbound); 70 + hv_ringbuffer_get_debuginfo(&device->channel->outbound, &info->outbound); 86 71 } 87 72 88 73 #define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2) ··· 99 114 get_channel_info(hv_dev, device_info); 100 115 101 116 if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { 102 - ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); 117 + ret = sprintf(buf, "%d\n", device_info->outbound.current_interrupt_mask); 103 118 } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { 104 - ret = sprintf(buf, "%d\n", device_info->outbound.read_idx); 119 + ret = sprintf(buf, "%d\n", device_info->outbound.current_read_index); 105 120 } else if (!strcmp(dev_attr->attr.name, "out_write_index")) { 106 - ret = sprintf(buf, "%d\n", device_info->outbound.write_idx); 121 + ret = sprintf(buf, "%d\n", device_info->outbound.current_write_index); 107 122 } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) { 108 123 ret = sprintf(buf, "%d\n", 109 124 device_info->outbound.bytes_avail_toread); ··· 111 126 ret = sprintf(buf, "%d\n", 112 127 device_info->outbound.bytes_avail_towrite); 113 128 } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) { 114 - ret = sprintf(buf, "%d\n", device_info->inbound.int_mask); 129 + ret = sprintf(buf, "%d\n", device_info->inbound.current_interrupt_mask); 115 130 } else if (!strcmp(dev_attr->attr.name, "in_read_index")) { 116 - ret = sprintf(buf, "%d\n", device_info->inbound.read_idx); 131 + ret = sprintf(buf, "%d\n", device_info->inbound.current_read_index); 117 132 } else if (!strcmp(dev_attr->attr.name, "in_write_index")) { 118 - ret = sprintf(buf, "%d\n", device_info->inbound.write_idx); 133 + ret = sprintf(buf, "%d\n", device_info->inbound.current_write_index); 119 134 } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) { 120 135 ret = sprintf(buf, "%d\n", 121 136 device_info->inbound.bytes_avail_toread);
-17
include/linux/hyperv.h
··· 429 429 u32 ring_data_startoffset; 430 430 }; 431 431 432 - struct hv_ring_buffer_debug_info { 433 - u32 current_interrupt_mask; 434 - u32 current_read_index; 435 - u32 current_write_index; 436 - u32 bytes_avail_toread; 437 - u32 bytes_avail_towrite; 438 - }; 439 - 440 - 441 432 /* 442 433 * 443 434 * hv_get_ringbuffer_availbytes() ··· 1156 1165 1157 1166 1158 1167 extern void vmbus_ontimer(unsigned long data); 1159 - 1160 - struct hv_dev_port_info { 1161 - u32 int_mask; 1162 - u32 read_idx; 1163 - u32 write_idx; 1164 - u32 bytes_avail_toread; 1165 - u32 bytes_avail_towrite; 1166 - }; 1167 1168 1168 1169 /* Base driver object */ 1169 1170 struct hv_driver {