blob: 12b85ff957fd2d56b2ef42bf829cc1f74e7a26d6 [file] [log] [blame]
Hank Janssen3e7ee492009-07-13 16:02:34 -07001/*
Hank Janssen3e7ee492009-07-13 16:02:34 -07002 * Copyright (c) 2009, Microsoft Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com>
Hank Janssen3e7ee492009-07-13 16:02:34 -070020 */
Hank Janssen0a466182011-03-29 13:58:47 -070021#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
Greg Kroah-Hartmana0086dc2009-08-17 17:22:08 -070023#include <linux/kernel.h>
K. Y. Srinivasan0c3b7b22011-02-11 09:59:43 -080024#include <linux/sched.h>
25#include <linux/wait.h>
Greg Kroah-Hartmana0086dc2009-08-17 17:22:08 -070026#include <linux/mm.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090027#include <linux/slab.h>
Bill Pemberton53af5452009-09-11 21:46:44 -040028#include <linux/list.h>
Hank Janssenc88c4e42010-05-04 15:55:05 -070029#include <linux/module.h>
Haiyang Zhang8b5d6d32010-05-28 23:22:44 +000030#include <linux/completion.h>
Greg Kroah-Hartman46a97192011-10-04 12:29:52 -070031#include <linux/hyperv.h>
K. Y. Srinivasan3f335ea2011-05-12 19:34:15 -070032
K. Y. Srinivasan0f2a6612011-05-12 19:34:28 -070033#include "hyperv_vmbus.h"
Hank Janssen3e7ee492009-07-13 16:02:34 -070034
Greg Kroah-Hartman1d7e9072009-08-28 16:26:11 -070035struct vmbus_channel_message_table_entry {
K. Y. Srinivasancf9dcba2011-05-10 07:55:37 -070036 enum vmbus_channel_message_type message_type;
K. Y. Srinivasanfa90f1d2011-05-10 07:55:36 -070037 void (*message_handler)(struct vmbus_channel_message_header *msg);
Greg Kroah-Hartman1d7e9072009-08-28 16:26:11 -070038};
Hank Janssen3e7ee492009-07-13 16:02:34 -070039
Ky Srinivasan245ba562010-12-16 18:54:16 -070040#define MAX_MSG_TYPES 4
41#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 8
Hank Janssenc88c4e42010-05-04 15:55:05 -070042
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070043static const uuid_le
K. Y. Srinivasan50b03262011-05-10 07:55:35 -070044 supported_device_classes[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
Bill Pemberton454f18a2009-07-27 16:47:24 -040045 /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070046 /* Storage - SCSI */
47 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070048 .b = {
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070049 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
50 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
51 }
52 },
Hank Janssen3e7ee492009-07-13 16:02:34 -070053
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070054 /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
55 /* Network */
56 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070057 .b = {
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070058 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
59 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
60 }
61 },
62
63 /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
64 /* Input */
65 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070066 .b = {
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070067 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
68 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
69 }
70 },
71
72 /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
73 /* IDE */
74 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070075 .b = {
Greg Kroah-Hartmancaf26a32009-08-19 16:17:03 -070076 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
77 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
78 }
79 },
Hank Janssenc88c4e42010-05-04 15:55:05 -070080 /* 0E0B6031-5213-4934-818B-38D90CED39DB */
81 /* Shutdown */
82 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070083 .b = {
Hank Janssenc88c4e42010-05-04 15:55:05 -070084 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
85 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
86 }
87 },
Haiyang Zhang39c4e9c2010-05-05 19:23:46 +000088 /* {9527E630-D0AE-497b-ADCE-E80AB0175CAF} */
89 /* TimeSync */
90 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070091 .b = {
Haiyang Zhang39c4e9c2010-05-05 19:23:46 +000092 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
93 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
94 }
95 },
Hank Janssen9153f7b2010-05-15 14:39:58 -070096 /* {57164f39-9115-4e78-ab55-382f3bd5422d} */
97 /* Heartbeat */
98 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -070099 .b = {
Hank Janssen9153f7b2010-05-15 14:39:58 -0700100 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
101 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
102 }
103 },
Ky Srinivasan245ba562010-12-16 18:54:16 -0700104 /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
105 /* KVP */
106 {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -0700107 .b = {
Ky Srinivasan245ba562010-12-16 18:54:16 -0700108 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
109 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
110 }
111 },
112
Hank Janssen3e7ee492009-07-13 16:02:34 -0700113};
114
Hank Janssenc88c4e42010-05-04 15:55:05 -0700115
116/**
Greg Kroah-Hartmanda0e9632011-10-11 08:42:28 -0600117 * vmbus_prep_negotiate_resp() - Create default response for Hyper-V Negotiate message
Hank Janssenc88c4e42010-05-04 15:55:05 -0700118 * @icmsghdrp: Pointer to msg header structure
119 * @icmsg_negotiate: Pointer to negotiate message structure
120 * @buf: Raw buffer channel data
121 *
122 * @icmsghdrp is of type &struct icmsg_hdr.
123 * @negop is of type &struct icmsg_negotiate.
124 * Set up and fill in default negotiate response message. This response can
125 * come from both the vmbus driver and the hv_utils driver. The current api
126 * will respond properly to both Windows 2008 and Windows 2008-R2 operating
127 * systems.
128 *
129 * Mainly used by Hyper-V drivers.
130 */
Greg Kroah-Hartmanda0e9632011-10-11 08:42:28 -0600131void vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
132 struct icmsg_negotiate *negop, u8 *buf)
Hank Janssenc88c4e42010-05-04 15:55:05 -0700133{
134 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
135 icmsghdrp->icmsgsize = 0x10;
136
137 negop = (struct icmsg_negotiate *)&buf[
138 sizeof(struct vmbuspipe_hdr) +
139 sizeof(struct icmsg_hdr)];
140
141 if (negop->icframe_vercnt == 2 &&
142 negop->icversion_data[1].major == 3) {
143 negop->icversion_data[0].major = 3;
144 negop->icversion_data[0].minor = 0;
145 negop->icversion_data[1].major = 3;
146 negop->icversion_data[1].minor = 0;
147 } else {
148 negop->icversion_data[0].major = 1;
149 negop->icversion_data[0].minor = 0;
150 negop->icversion_data[1].major = 1;
151 negop->icversion_data[1].minor = 0;
152 }
153
154 negop->icframe_vercnt = 1;
155 negop->icmsg_vercnt = 1;
156 }
157}
Greg Kroah-Hartmanda0e9632011-10-11 08:42:28 -0600158EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp);
Hank Janssenc88c4e42010-05-04 15:55:05 -0700159
Hank Janssen3e189512010-03-04 22:11:00 +0000160/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700161 * alloc_channel - Allocate and initialize a vmbus channel object
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700162 */
Greg Kroah-Hartman50fe56d2010-10-20 15:51:57 -0700163static struct vmbus_channel *alloc_channel(void)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700164{
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700165 struct vmbus_channel *channel;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700166
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700167 channel = kzalloc(sizeof(*channel), GFP_ATOMIC);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700168 if (!channel)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700169 return NULL;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700170
Greg Kroah-Hartman54411c42009-07-15 14:48:32 -0700171 spin_lock_init(&channel->inbound_lock);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700172
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800173 channel->controlwq = create_workqueue("hv_vmbus_ctl");
174 if (!channel->controlwq) {
Greg Kroah-Hartman8c69f522009-07-15 12:48:29 -0700175 kfree(channel);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700176 return NULL;
177 }
178
179 return channel;
180}
181
Hank Janssen3e189512010-03-04 22:11:00 +0000182/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700183 * release_hannel - Release the vmbus channel object itself
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700184 */
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200185static void release_channel(struct work_struct *work)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700186{
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200187 struct vmbus_channel *channel = container_of(work,
188 struct vmbus_channel,
189 work);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700190
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800191 destroy_workqueue(channel->controlwq);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700192
Greg Kroah-Hartman8c69f522009-07-15 12:48:29 -0700193 kfree(channel);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700194}
195
Hank Janssen3e189512010-03-04 22:11:00 +0000196/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700197 * free_channel - Release the resources used by the vmbus channel object
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700198 */
Greg Kroah-Hartman9f3e28e2011-10-11 09:40:01 -0600199static void free_channel(struct vmbus_channel *channel)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700200{
Hank Janssen3e7ee492009-07-13 16:02:34 -0700201
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700202 /*
203 * We have to release the channel's workqueue/thread in the vmbus's
204 * workqueue/thread context
205 * ie we can't destroy ourselves.
206 */
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200207 INIT_WORK(&channel->work, release_channel);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800208 queue_work(vmbus_connection.work_queue, &channel->work);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700209}
210
Haiyang Zhang8b5d6d32010-05-28 23:22:44 +0000211
Haiyang Zhang8b5d6d32010-05-28 23:22:44 +0000212
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200213/*
214 * vmbus_process_rescind_offer -
215 * Rescind the offer by initiating a device removal
216 */
217static void vmbus_process_rescind_offer(struct work_struct *work)
218{
219 struct vmbus_channel *channel = container_of(work,
220 struct vmbus_channel,
221 work);
222
K. Y. Srinivasan696453b2011-09-08 07:24:14 -0700223 vmbus_device_unregister(channel->device_obj);
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200224}
Haiyang Zhang8b5d6d32010-05-28 23:22:44 +0000225
Hank Janssen3e189512010-03-04 22:11:00 +0000226/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700227 * vmbus_process_offer - Process the offer by creating a channel/device
Hank Janssenc88c4e42010-05-04 15:55:05 -0700228 * associated with this offer
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700229 */
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200230static void vmbus_process_offer(struct work_struct *work)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700231{
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200232 struct vmbus_channel *newchannel = container_of(work,
233 struct vmbus_channel,
234 work);
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700235 struct vmbus_channel *channel;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700236 bool fnew = true;
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700237 int ret;
Greg Kroah-Hartman0f5e44c2009-07-15 14:57:16 -0700238 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700239
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200240 /* The next possible work is rescind handling */
241 INIT_WORK(&newchannel->work, vmbus_process_rescind_offer);
242
Bill Pemberton454f18a2009-07-27 16:47:24 -0400243 /* Make sure this is a new offer */
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800244 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700245
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800246 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -0700247 if (!uuid_le_cmp(channel->offermsg.offer.if_type,
248 newchannel->offermsg.offer.if_type) &&
249 !uuid_le_cmp(channel->offermsg.offer.if_instance,
250 newchannel->offermsg.offer.if_instance)) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700251 fnew = false;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700252 break;
253 }
254 }
255
Haiyang Zhang188963e2010-10-15 10:14:06 -0700256 if (fnew)
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800257 list_add_tail(&newchannel->listentry,
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800258 &vmbus_connection.chn_list);
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700259
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800260 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700261
Haiyang Zhang188963e2010-10-15 10:14:06 -0700262 if (!fnew) {
Haiyang Zhange98cb272010-10-15 10:14:07 -0700263 free_channel(newchannel);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700264 return;
265 }
266
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700267 /*
268 * Start the process of binding this offer to the driver
269 * We need to set the DeviceObject field before calling
Haiyang Zhang646f1ea2011-01-26 12:12:10 -0800270 * vmbus_child_dev_add()
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700271 */
K. Y. Srinivasanf2c73012011-09-08 07:24:12 -0700272 newchannel->device_obj = vmbus_device_create(
Haiyang Zhang767dff62011-01-26 12:12:12 -0800273 &newchannel->offermsg.offer.if_type,
274 &newchannel->offermsg.offer.if_instance,
Haiyang Zhang188963e2010-10-15 10:14:06 -0700275 newchannel);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700276
Bill Pemberton454f18a2009-07-27 16:47:24 -0400277 /*
278 * Add the new device to the bus. This will kick off device-driver
279 * binding which eventually invokes the device driver's AddDevice()
280 * method.
281 */
K. Y. Srinivasan22794282011-09-08 07:24:13 -0700282 ret = vmbus_device_register(newchannel->device_obj);
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700283 if (ret != 0) {
Hank Janssen0a466182011-03-29 13:58:47 -0700284 pr_err("unable to add child device object (relid %d)\n",
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800285 newchannel->offermsg.child_relid);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700286
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800287 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800288 list_del(&newchannel->listentry);
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800289 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700290
Haiyang Zhange98cb272010-10-15 10:14:07 -0700291 free_channel(newchannel);
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700292 } else {
Bill Pemberton454f18a2009-07-27 16:47:24 -0400293 /*
294 * This state is used to indicate a successful open
295 * so that when we do close the channel normally, we
296 * can cleanup properly
297 */
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800298 newchannel->state = CHANNEL_OPEN_STATE;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700299 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700300}
301
Hank Janssen3e189512010-03-04 22:11:00 +0000302/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700303 * vmbus_onoffer - Handler for channel offers from vmbus in parent partition.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700304 *
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700305 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700306static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700307{
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700308 struct vmbus_channel_offer_channel *offer;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700309 struct vmbus_channel *newchannel;
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -0700310 uuid_le *guidtype;
311 uuid_le *guidinstance;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700312 int i;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700313 int fsupported = 0;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700314
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700315 offer = (struct vmbus_channel_offer_channel *)hdr;
316 for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
K. Y. Srinivasan358d2ee2011-08-25 09:48:28 -0700317 if (!uuid_le_cmp(offer->offer.if_type,
318 supported_device_classes[i])) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700319 fsupported = 1;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700320 break;
321 }
322 }
323
Hank Janssen98e08702011-03-29 13:58:44 -0700324 if (!fsupported)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700325 return;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700326
Haiyang Zhang767dff62011-01-26 12:12:12 -0800327 guidtype = &offer->offer.if_type;
328 guidinstance = &offer->offer.if_instance;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700329
Bill Pemberton454f18a2009-07-27 16:47:24 -0400330 /* Allocate the channel object and save this offer. */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700331 newchannel = alloc_channel();
Haiyang Zhang188963e2010-10-15 10:14:06 -0700332 if (!newchannel) {
Hank Janssen0a466182011-03-29 13:58:47 -0700333 pr_err("Unable to allocate channel object\n");
Hank Janssen3e7ee492009-07-13 16:02:34 -0700334 return;
335 }
336
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800337 memcpy(&newchannel->offermsg, offer,
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700338 sizeof(struct vmbus_channel_offer_channel));
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800339 newchannel->monitor_grp = (u8)offer->monitorid / 32;
340 newchannel->monitor_bit = (u8)offer->monitorid % 32;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700341
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200342 INIT_WORK(&newchannel->work, vmbus_process_offer);
343 queue_work(newchannel->controlwq, &newchannel->work);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700344}
345
Hank Janssen3e189512010-03-04 22:11:00 +0000346/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700347 * vmbus_onoffer_rescind - Rescind offer handler.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700348 *
349 * We queue a work item to process this offer synchronously
350 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700351static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700352{
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700353 struct vmbus_channel_rescind_offer *rescind;
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700354 struct vmbus_channel *channel;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700355
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700356 rescind = (struct vmbus_channel_rescind_offer *)hdr;
Haiyang Zhangc6977672011-01-26 12:12:08 -0800357 channel = relid2channel(rescind->child_relid);
Hank Janssen98e08702011-03-29 13:58:44 -0700358
359 if (channel == NULL)
360 /* Just return here, no channel found */
Hank Janssen3e7ee492009-07-13 16:02:34 -0700361 return;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700362
Timo Teräs4b2f9ab2010-12-15 20:48:09 +0200363 /* work is initialized for vmbus_process_rescind_offer() from
364 * vmbus_process_offer() where the channel got created */
365 queue_work(channel->controlwq, &channel->work);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700366}
367
Hank Janssen3e189512010-03-04 22:11:00 +0000368/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700369 * vmbus_onoffers_delivered -
370 * This is invoked when all offers have been delivered.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700371 *
372 * Nothing to do here.
373 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700374static void vmbus_onoffers_delivered(
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700375 struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700376{
Hank Janssen3e7ee492009-07-13 16:02:34 -0700377}
378
Hank Janssen3e189512010-03-04 22:11:00 +0000379/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700380 * vmbus_onopen_result - Open result handler.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700381 *
382 * This is invoked when we received a response to our channel open request.
383 * Find the matching request, copy the response and signal the requesting
384 * thread.
385 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700386static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700387{
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700388 struct vmbus_channel_open_result *result;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700389 struct vmbus_channel_msginfo *msginfo;
390 struct vmbus_channel_message_header *requestheader;
391 struct vmbus_channel_open_channel *openmsg;
Greg Kroah-Hartmandd0813b2009-07-15 14:56:45 -0700392 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700393
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700394 result = (struct vmbus_channel_open_result *)hdr;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700395
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700396 /*
397 * Find the open msg, copy the result and signal/unblock the wait event
398 */
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800399 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700400
Hank Janssenebb61e52011-02-18 12:39:57 -0800401 list_for_each_entry(msginfo, &vmbus_connection.chn_msg_list,
402 msglistentry) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700403 requestheader =
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800404 (struct vmbus_channel_message_header *)msginfo->msg;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700405
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800406 if (requestheader->msgtype == CHANNELMSG_OPENCHANNEL) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700407 openmsg =
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800408 (struct vmbus_channel_open_channel *)msginfo->msg;
409 if (openmsg->child_relid == result->child_relid &&
410 openmsg->openid == result->openid) {
411 memcpy(&msginfo->response.open_result,
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700412 result,
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700413 sizeof(
414 struct vmbus_channel_open_result));
415 complete(&msginfo->waitevent);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700416 break;
417 }
418 }
419 }
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800420 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700421}
422
Hank Janssen3e189512010-03-04 22:11:00 +0000423/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700424 * vmbus_ongpadl_created - GPADL created handler.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700425 *
426 * This is invoked when we received a response to our gpadl create request.
427 * Find the matching request, copy the response and signal the requesting
428 * thread.
429 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700430static void vmbus_ongpadl_created(struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700431{
Haiyang Zhang188963e2010-10-15 10:14:06 -0700432 struct vmbus_channel_gpadl_created *gpadlcreated;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700433 struct vmbus_channel_msginfo *msginfo;
434 struct vmbus_channel_message_header *requestheader;
435 struct vmbus_channel_gpadl_header *gpadlheader;
Greg Kroah-Hartmandd0813b2009-07-15 14:56:45 -0700436 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700437
Haiyang Zhang188963e2010-10-15 10:14:06 -0700438 gpadlcreated = (struct vmbus_channel_gpadl_created *)hdr;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700439
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700440 /*
441 * Find the establish msg, copy the result and signal/unblock the wait
442 * event
443 */
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800444 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700445
Hank Janssenebb61e52011-02-18 12:39:57 -0800446 list_for_each_entry(msginfo, &vmbus_connection.chn_msg_list,
447 msglistentry) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700448 requestheader =
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800449 (struct vmbus_channel_message_header *)msginfo->msg;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700450
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800451 if (requestheader->msgtype == CHANNELMSG_GPADL_HEADER) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700452 gpadlheader =
453 (struct vmbus_channel_gpadl_header *)requestheader;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700454
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800455 if ((gpadlcreated->child_relid ==
456 gpadlheader->child_relid) &&
457 (gpadlcreated->gpadl == gpadlheader->gpadl)) {
458 memcpy(&msginfo->response.gpadl_created,
Haiyang Zhang188963e2010-10-15 10:14:06 -0700459 gpadlcreated,
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700460 sizeof(
461 struct vmbus_channel_gpadl_created));
462 complete(&msginfo->waitevent);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700463 break;
464 }
465 }
466 }
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800467 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700468}
469
Hank Janssen3e189512010-03-04 22:11:00 +0000470/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700471 * vmbus_ongpadl_torndown - GPADL torndown handler.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700472 *
473 * This is invoked when we received a response to our gpadl teardown request.
474 * Find the matching request, copy the response and signal the requesting
475 * thread.
476 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700477static void vmbus_ongpadl_torndown(
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700478 struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700479{
Haiyang Zhang188963e2010-10-15 10:14:06 -0700480 struct vmbus_channel_gpadl_torndown *gpadl_torndown;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700481 struct vmbus_channel_msginfo *msginfo;
482 struct vmbus_channel_message_header *requestheader;
483 struct vmbus_channel_gpadl_teardown *gpadl_teardown;
Greg Kroah-Hartmandd0813b2009-07-15 14:56:45 -0700484 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700485
Haiyang Zhang188963e2010-10-15 10:14:06 -0700486 gpadl_torndown = (struct vmbus_channel_gpadl_torndown *)hdr;
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700487
488 /*
489 * Find the open msg, copy the result and signal/unblock the wait event
490 */
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800491 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700492
Hank Janssenebb61e52011-02-18 12:39:57 -0800493 list_for_each_entry(msginfo, &vmbus_connection.chn_msg_list,
494 msglistentry) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700495 requestheader =
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800496 (struct vmbus_channel_message_header *)msginfo->msg;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700497
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800498 if (requestheader->msgtype == CHANNELMSG_GPADL_TEARDOWN) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700499 gpadl_teardown =
500 (struct vmbus_channel_gpadl_teardown *)requestheader;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700501
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800502 if (gpadl_torndown->gpadl == gpadl_teardown->gpadl) {
503 memcpy(&msginfo->response.gpadl_torndown,
Haiyang Zhang188963e2010-10-15 10:14:06 -0700504 gpadl_torndown,
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700505 sizeof(
506 struct vmbus_channel_gpadl_torndown));
507 complete(&msginfo->waitevent);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700508 break;
509 }
510 }
511 }
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800512 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700513}
514
Hank Janssen3e189512010-03-04 22:11:00 +0000515/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700516 * vmbus_onversion_response - Version response handler
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700517 *
518 * This is invoked when we received a response to our initiate contact request.
519 * Find the matching request, copy the response and signal the requesting
520 * thread.
521 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700522static void vmbus_onversion_response(
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700523 struct vmbus_channel_message_header *hdr)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700524{
Haiyang Zhang188963e2010-10-15 10:14:06 -0700525 struct vmbus_channel_msginfo *msginfo;
526 struct vmbus_channel_message_header *requestheader;
Greg Kroah-Hartman82250212009-08-26 15:16:04 -0700527 struct vmbus_channel_initiate_contact *initiate;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700528 struct vmbus_channel_version_response *version_response;
Greg Kroah-Hartmandd0813b2009-07-15 14:56:45 -0700529 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700530
Haiyang Zhang188963e2010-10-15 10:14:06 -0700531 version_response = (struct vmbus_channel_version_response *)hdr;
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800532 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700533
Hank Janssenebb61e52011-02-18 12:39:57 -0800534 list_for_each_entry(msginfo, &vmbus_connection.chn_msg_list,
535 msglistentry) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700536 requestheader =
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800537 (struct vmbus_channel_message_header *)msginfo->msg;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700538
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800539 if (requestheader->msgtype ==
540 CHANNELMSG_INITIATE_CONTACT) {
Haiyang Zhang188963e2010-10-15 10:14:06 -0700541 initiate =
542 (struct vmbus_channel_initiate_contact *)requestheader;
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800543 memcpy(&msginfo->response.version_response,
Haiyang Zhang188963e2010-10-15 10:14:06 -0700544 version_response,
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700545 sizeof(struct vmbus_channel_version_response));
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700546 complete(&msginfo->waitevent);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700547 }
548 }
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800549 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700550}
551
Greg Kroah-Hartmanc8212f02009-08-31 21:51:50 -0700552/* Channel message dispatch table */
553static struct vmbus_channel_message_table_entry
K. Y. Srinivasanb7c6b022011-05-10 07:55:38 -0700554 channel_message_table[CHANNELMSG_COUNT] = {
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800555 {CHANNELMSG_INVALID, NULL},
556 {CHANNELMSG_OFFERCHANNEL, vmbus_onoffer},
557 {CHANNELMSG_RESCIND_CHANNELOFFER, vmbus_onoffer_rescind},
558 {CHANNELMSG_REQUESTOFFERS, NULL},
559 {CHANNELMSG_ALLOFFERS_DELIVERED, vmbus_onoffers_delivered},
560 {CHANNELMSG_OPENCHANNEL, NULL},
561 {CHANNELMSG_OPENCHANNEL_RESULT, vmbus_onopen_result},
562 {CHANNELMSG_CLOSECHANNEL, NULL},
563 {CHANNELMSG_GPADL_HEADER, NULL},
564 {CHANNELMSG_GPADL_BODY, NULL},
565 {CHANNELMSG_GPADL_CREATED, vmbus_ongpadl_created},
566 {CHANNELMSG_GPADL_TEARDOWN, NULL},
567 {CHANNELMSG_GPADL_TORNDOWN, vmbus_ongpadl_torndown},
568 {CHANNELMSG_RELID_RELEASED, NULL},
569 {CHANNELMSG_INITIATE_CONTACT, NULL},
570 {CHANNELMSG_VERSION_RESPONSE, vmbus_onversion_response},
571 {CHANNELMSG_UNLOAD, NULL},
Greg Kroah-Hartmanc8212f02009-08-31 21:51:50 -0700572};
573
Hank Janssen3e189512010-03-04 22:11:00 +0000574/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700575 * vmbus_onmessage - Handler for channel protocol messages.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700576 *
577 * This is invoked in the vmbus worker thread context.
578 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700579void vmbus_onmessage(void *context)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700580{
Haiyang Zhang188963e2010-10-15 10:14:06 -0700581 struct hv_message *msg = context;
Greg Kroah-Hartman82250212009-08-26 15:16:04 -0700582 struct vmbus_channel_message_header *hdr;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700583 int size;
584
Haiyang Zhangf6feebe2010-11-08 14:04:39 -0800585 hdr = (struct vmbus_channel_message_header *)msg->u.payload;
586 size = msg->header.payload_size;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700587
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800588 if (hdr->msgtype >= CHANNELMSG_COUNT) {
Hank Janssen0a466182011-03-29 13:58:47 -0700589 pr_err("Received invalid channel message type %d size %d\n",
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800590 hdr->msgtype, size);
Greg Kroah-Hartman04f50c42009-07-16 12:35:37 -0700591 print_hex_dump_bytes("", DUMP_PREFIX_NONE,
Haiyang Zhangf6feebe2010-11-08 14:04:39 -0800592 (unsigned char *)msg->u.payload, size);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700593 return;
594 }
595
K. Y. Srinivasanb7c6b022011-05-10 07:55:38 -0700596 if (channel_message_table[hdr->msgtype].message_handler)
597 channel_message_table[hdr->msgtype].message_handler(hdr);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700598 else
Hank Janssen0a466182011-03-29 13:58:47 -0700599 pr_err("Unhandled channel message type %d\n", hdr->msgtype);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700600}
601
Hank Janssen3e189512010-03-04 22:11:00 +0000602/*
Haiyang Zhange98cb272010-10-15 10:14:07 -0700603 * vmbus_request_offers - Send a request to get all our pending offers.
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700604 */
Haiyang Zhange98cb272010-10-15 10:14:07 -0700605int vmbus_request_offers(void)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700606{
Greg Kroah-Hartman82250212009-08-26 15:16:04 -0700607 struct vmbus_channel_message_header *msg;
Haiyang Zhang188963e2010-10-15 10:14:06 -0700608 struct vmbus_channel_msginfo *msginfo;
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700609 int ret, t;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700610
Haiyang Zhang188963e2010-10-15 10:14:06 -0700611 msginfo = kmalloc(sizeof(*msginfo) +
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700612 sizeof(struct vmbus_channel_message_header),
613 GFP_KERNEL);
Haiyang Zhang188963e2010-10-15 10:14:06 -0700614 if (!msginfo)
Bill Pemberton75910f22010-05-05 15:27:31 -0400615 return -ENOMEM;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700616
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700617 init_completion(&msginfo->waitevent);
Bill Pemberton75910f22010-05-05 15:27:31 -0400618
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800619 msg = (struct vmbus_channel_message_header *)msginfo->msg;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700620
Haiyang Zhangc50f7fb2010-11-08 14:04:38 -0800621 msg->msgtype = CHANNELMSG_REQUESTOFFERS;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700622
Hank Janssen3e7ee492009-07-13 16:02:34 -0700623
Haiyang Zhangc6977672011-01-26 12:12:08 -0800624 ret = vmbus_post_msg(msg,
Greg Kroah-Hartmanbd60c332009-08-31 21:47:21 -0700625 sizeof(struct vmbus_channel_message_header));
626 if (ret != 0) {
Hank Janssen0a466182011-03-29 13:58:47 -0700627 pr_err("Unable to request offers - %d\n", ret);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700628
K. Y. Srinivasan0c3b7b22011-02-11 09:59:43 -0800629 goto cleanup;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700630 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700631
K. Y. Srinivasan2dfde962011-06-16 13:16:34 -0700632 t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
K. Y. Srinivasan9568a192011-05-10 07:55:39 -0700633 if (t == 0) {
K. Y. Srinivasan0c3b7b22011-02-11 09:59:43 -0800634 ret = -ETIMEDOUT;
635 goto cleanup;
636 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700637
638
K. Y. Srinivasan0c3b7b22011-02-11 09:59:43 -0800639
640cleanup:
Ilia Mirkindd9b15d2011-03-13 00:29:00 -0500641 kfree(msginfo);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700642
Hank Janssen3e7ee492009-07-13 16:02:34 -0700643 return ret;
644}
645
Bill Pemberton454f18a2009-07-27 16:47:24 -0400646/* eof */