diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2012-05-12 16:44:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-14 11:59:31 -0400 |
commit | c836d0ab70acf7b7bd2b698278e8abae9e6d9978 (patch) | |
tree | 5e3c677b2314e6643785133569950d29cbf4dd7f /drivers/hv/hv_util.c | |
parent | a360530012766e5fd752bd6538c8cc6349846781 (diff) |
Drivers: hv: util: Properly handle version negotiations.
The current version negotiation code is not "future proof". Fix this
by allowing each service the flexibility to either specify the highest
version it can support or it can support the highest version number
the host is offering.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/hv_util.c')
-rw-r--r-- | drivers/hv/hv_util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index dbb8b8eec210..d3ac6a40118b 100644 --- a/drivers/hv/hv_util.c +++ b/drivers/hv/hv_util.c | |||
@@ -70,7 +70,8 @@ static void shutdown_onchannelcallback(void *context) | |||
70 | sizeof(struct vmbuspipe_hdr)]; | 70 | sizeof(struct vmbuspipe_hdr)]; |
71 | 71 | ||
72 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { | 72 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { |
73 | vmbus_prep_negotiate_resp(icmsghdrp, negop, shut_txf_buf); | 73 | vmbus_prep_negotiate_resp(icmsghdrp, negop, |
74 | shut_txf_buf, MAX_SRV_VER, MAX_SRV_VER); | ||
74 | } else { | 75 | } else { |
75 | shutdown_msg = | 76 | shutdown_msg = |
76 | (struct shutdown_msg_data *)&shut_txf_buf[ | 77 | (struct shutdown_msg_data *)&shut_txf_buf[ |
@@ -195,7 +196,8 @@ static void timesync_onchannelcallback(void *context) | |||
195 | sizeof(struct vmbuspipe_hdr)]; | 196 | sizeof(struct vmbuspipe_hdr)]; |
196 | 197 | ||
197 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { | 198 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { |
198 | vmbus_prep_negotiate_resp(icmsghdrp, NULL, time_txf_buf); | 199 | vmbus_prep_negotiate_resp(icmsghdrp, NULL, time_txf_buf, |
200 | MAX_SRV_VER, MAX_SRV_VER); | ||
199 | } else { | 201 | } else { |
200 | timedatap = (struct ictimesync_data *)&time_txf_buf[ | 202 | timedatap = (struct ictimesync_data *)&time_txf_buf[ |
201 | sizeof(struct vmbuspipe_hdr) + | 203 | sizeof(struct vmbuspipe_hdr) + |
@@ -234,7 +236,8 @@ static void heartbeat_onchannelcallback(void *context) | |||
234 | sizeof(struct vmbuspipe_hdr)]; | 236 | sizeof(struct vmbuspipe_hdr)]; |
235 | 237 | ||
236 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { | 238 | if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { |
237 | vmbus_prep_negotiate_resp(icmsghdrp, NULL, hbeat_txf_buf); | 239 | vmbus_prep_negotiate_resp(icmsghdrp, NULL, |
240 | hbeat_txf_buf, MAX_SRV_VER, MAX_SRV_VER); | ||
238 | } else { | 241 | } else { |
239 | heartbeat_msg = | 242 | heartbeat_msg = |
240 | (struct heartbeat_msg_data *)&hbeat_txf_buf[ | 243 | (struct heartbeat_msg_data *)&hbeat_txf_buf[ |