diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-20 19:07:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-20 19:07:11 -0400 |
commit | 150b19d43065762f19a4e6060b07c9bbbc85bcc7 (patch) | |
tree | c47e9e8a7f7b4e990756a1fa0b88bf51a8cc5b71 | |
parent | a4e91ed24bc6b68caa534a9de35f7fc770bffde9 (diff) |
Staging: hv: make get_channel_info static
This is done by moving it to the only .c file it is used in.
This also allowed us to delete the channel_interface.h file, as it's no
longer needed.
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/hv/channel_interface.c | 42 | ||||
-rw-r--r-- | drivers/staging/hv/channel_interface.h | 33 | ||||
-rw-r--r-- | drivers/staging/hv/vmbus_drv.c | 43 | ||||
-rw-r--r-- | drivers/staging/hv/vmbus_private.h | 1 |
4 files changed, 42 insertions, 77 deletions
diff --git a/drivers/staging/hv/channel_interface.c b/drivers/staging/hv/channel_interface.c index c0d1ac8875c1..24a8951b9a15 100644 --- a/drivers/staging/hv/channel_interface.c +++ b/drivers/staging/hv/channel_interface.c | |||
@@ -98,48 +98,6 @@ static int ivmbus_teardown_gpadl(struct hv_device *device, | |||
98 | 98 | ||
99 | } | 99 | } |
100 | 100 | ||
101 | |||
102 | void get_channel_info(struct hv_device *device, struct hv_device_info *info) | ||
103 | { | ||
104 | struct vmbus_channel_debug_info debug_info; | ||
105 | |||
106 | if (!device->context) | ||
107 | return; | ||
108 | |||
109 | vmbus_get_debug_info(device->context, &debug_info); | ||
110 | |||
111 | info->ChannelId = debug_info.RelId; | ||
112 | info->ChannelState = debug_info.State; | ||
113 | memcpy(&info->ChannelType, &debug_info.InterfaceType, | ||
114 | sizeof(struct hv_guid)); | ||
115 | memcpy(&info->ChannelInstance, &debug_info.InterfaceInstance, | ||
116 | sizeof(struct hv_guid)); | ||
117 | |||
118 | info->MonitorId = debug_info.MonitorId; | ||
119 | |||
120 | info->ServerMonitorPending = debug_info.ServerMonitorPending; | ||
121 | info->ServerMonitorLatency = debug_info.ServerMonitorLatency; | ||
122 | info->ServerMonitorConnectionId = debug_info.ServerMonitorConnectionId; | ||
123 | |||
124 | info->ClientMonitorPending = debug_info.ClientMonitorPending; | ||
125 | info->ClientMonitorLatency = debug_info.ClientMonitorLatency; | ||
126 | info->ClientMonitorConnectionId = debug_info.ClientMonitorConnectionId; | ||
127 | |||
128 | info->Inbound.InterruptMask = debug_info.Inbound.CurrentInterruptMask; | ||
129 | info->Inbound.ReadIndex = debug_info.Inbound.CurrentReadIndex; | ||
130 | info->Inbound.WriteIndex = debug_info.Inbound.CurrentWriteIndex; | ||
131 | info->Inbound.BytesAvailToRead = debug_info.Inbound.BytesAvailToRead; | ||
132 | info->Inbound.BytesAvailToWrite = debug_info.Inbound.BytesAvailToWrite; | ||
133 | |||
134 | info->Outbound.InterruptMask = debug_info.Outbound.CurrentInterruptMask; | ||
135 | info->Outbound.ReadIndex = debug_info.Outbound.CurrentReadIndex; | ||
136 | info->Outbound.WriteIndex = debug_info.Outbound.CurrentWriteIndex; | ||
137 | info->Outbound.BytesAvailToRead = debug_info.Outbound.BytesAvailToRead; | ||
138 | info->Outbound.BytesAvailToWrite = | ||
139 | debug_info.Outbound.BytesAvailToWrite; | ||
140 | } | ||
141 | |||
142 | |||
143 | /* vmbus interface function pointer table */ | 101 | /* vmbus interface function pointer table */ |
144 | const struct vmbus_channel_interface vmbus_ops = { | 102 | const struct vmbus_channel_interface vmbus_ops = { |
145 | .Open = ivmbus_open, | 103 | .Open = ivmbus_open, |
diff --git a/drivers/staging/hv/channel_interface.h b/drivers/staging/hv/channel_interface.h deleted file mode 100644 index 82cff3d7f06f..000000000000 --- a/drivers/staging/hv/channel_interface.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Copyright (c) 2009, Microsoft Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
17 | * | ||
18 | * Authors: | ||
19 | * Haiyang Zhang <haiyangz@microsoft.com> | ||
20 | * Hank Janssen <hjanssen@microsoft.com> | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | |||
25 | #ifndef _CHANNEL_INTERFACE_H_ | ||
26 | #define _CHANNEL_INTERFACE_H_ | ||
27 | |||
28 | #include "vmbus_api.h" | ||
29 | |||
30 | void get_channel_info(struct hv_device *device, | ||
31 | struct hv_device_info *info); | ||
32 | |||
33 | #endif /* _CHANNEL_INTERFACE_H_ */ | ||
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 8b3b14e5c37d..1e0a1de8261d 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "osd.h" | 32 | #include "osd.h" |
33 | #include "logging.h" | 33 | #include "logging.h" |
34 | #include "vmbus.h" | 34 | #include "vmbus.h" |
35 | #include "channel_interface.h" | 35 | #include "channel.h" |
36 | 36 | ||
37 | 37 | ||
38 | /* FIXME! We need to do this dynamically for PIC and APIC system */ | 38 | /* FIXME! We need to do this dynamically for PIC and APIC system */ |
@@ -129,6 +129,47 @@ static struct vmbus_driver_context g_vmbus_drv = { | |||
129 | .bus.dev_attrs = vmbus_device_attrs, | 129 | .bus.dev_attrs = vmbus_device_attrs, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static void get_channel_info(struct hv_device *device, | ||
133 | struct hv_device_info *info) | ||
134 | { | ||
135 | struct vmbus_channel_debug_info debug_info; | ||
136 | |||
137 | if (!device->context) | ||
138 | return; | ||
139 | |||
140 | vmbus_get_debug_info(device->context, &debug_info); | ||
141 | |||
142 | info->ChannelId = debug_info.RelId; | ||
143 | info->ChannelState = debug_info.State; | ||
144 | memcpy(&info->ChannelType, &debug_info.InterfaceType, | ||
145 | sizeof(struct hv_guid)); | ||
146 | memcpy(&info->ChannelInstance, &debug_info.InterfaceInstance, | ||
147 | sizeof(struct hv_guid)); | ||
148 | |||
149 | info->MonitorId = debug_info.MonitorId; | ||
150 | |||
151 | info->ServerMonitorPending = debug_info.ServerMonitorPending; | ||
152 | info->ServerMonitorLatency = debug_info.ServerMonitorLatency; | ||
153 | info->ServerMonitorConnectionId = debug_info.ServerMonitorConnectionId; | ||
154 | |||
155 | info->ClientMonitorPending = debug_info.ClientMonitorPending; | ||
156 | info->ClientMonitorLatency = debug_info.ClientMonitorLatency; | ||
157 | info->ClientMonitorConnectionId = debug_info.ClientMonitorConnectionId; | ||
158 | |||
159 | info->Inbound.InterruptMask = debug_info.Inbound.CurrentInterruptMask; | ||
160 | info->Inbound.ReadIndex = debug_info.Inbound.CurrentReadIndex; | ||
161 | info->Inbound.WriteIndex = debug_info.Inbound.CurrentWriteIndex; | ||
162 | info->Inbound.BytesAvailToRead = debug_info.Inbound.BytesAvailToRead; | ||
163 | info->Inbound.BytesAvailToWrite = debug_info.Inbound.BytesAvailToWrite; | ||
164 | |||
165 | info->Outbound.InterruptMask = debug_info.Outbound.CurrentInterruptMask; | ||
166 | info->Outbound.ReadIndex = debug_info.Outbound.CurrentReadIndex; | ||
167 | info->Outbound.WriteIndex = debug_info.Outbound.CurrentWriteIndex; | ||
168 | info->Outbound.BytesAvailToRead = debug_info.Outbound.BytesAvailToRead; | ||
169 | info->Outbound.BytesAvailToWrite = | ||
170 | debug_info.Outbound.BytesAvailToWrite; | ||
171 | } | ||
172 | |||
132 | /* | 173 | /* |
133 | * vmbus_show_device_attr - Show the device attribute in sysfs. | 174 | * vmbus_show_device_attr - Show the device attribute in sysfs. |
134 | * | 175 | * |
diff --git a/drivers/staging/hv/vmbus_private.h b/drivers/staging/hv/vmbus_private.h index 588c667a7f6b..7bdb29ac8952 100644 --- a/drivers/staging/hv/vmbus_private.h +++ b/drivers/staging/hv/vmbus_private.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "vmbus_api.h" | 29 | #include "vmbus_api.h" |
30 | #include "channel.h" | 30 | #include "channel.h" |
31 | #include "channel_mgmt.h" | 31 | #include "channel_mgmt.h" |
32 | #include "channel_interface.h" | ||
33 | #include "ring_buffer.h" | 32 | #include "ring_buffer.h" |
34 | #include <linux/list.h> | 33 | #include <linux/list.h> |
35 | 34 | ||