@@ -47,8 +47,8 @@ static struct completion probe_event;
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,26 +63,11 @@ 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)
@@ -114,23 +99,23 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
114
99
get_channel_info (hv_dev , device_info );
115
100
116
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
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
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
107
} else if (!strcmp (dev_attr -> attr .name , "out_read_bytes_avail" )) {
123
108
ret = sprintf (buf , "%d\n" ,
124
109
device_info -> outbound .bytes_avail_toread );
125
110
} else if (!strcmp (dev_attr -> attr .name , "out_write_bytes_avail" )) {
126
111
ret = sprintf (buf , "%d\n" ,
127
112
device_info -> outbound .bytes_avail_towrite );
128
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
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
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
119
} else if (!strcmp (dev_attr -> attr .name , "in_read_bytes_avail" )) {
135
120
ret = sprintf (buf , "%d\n" ,
136
121
device_info -> inbound .bytes_avail_toread );
0 commit comments