Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/utilities/hv_kvp.c
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | sc->host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ | ||||
sizeof(struct hv_vmbus_icmsg_hdr)]; | sizeof(struct hv_vmbus_icmsg_hdr)]; | ||||
} | } | ||||
/* | /* | ||||
* hv_kvp - version neogtiation function | * hv_kvp - version neogtiation function | ||||
*/ | */ | ||||
static void | static void | ||||
hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, | hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) | ||||
struct hv_vmbus_icmsg_negotiate *negop, | |||||
uint8_t *buf) | |||||
{ | { | ||||
struct hv_vmbus_icmsg_negotiate *negop; | |||||
int icframe_vercnt; | int icframe_vercnt; | ||||
int icmsg_vercnt; | int icmsg_vercnt; | ||||
icmsghdrp->icmsgsize = 0x10; | icmsghdrp->icmsgsize = 0x10; | ||||
negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ | negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ | ||||
sizeof(struct hv_vmbus_pipe_hdr) + | sizeof(struct hv_vmbus_pipe_hdr) + | ||||
sizeof(struct hv_vmbus_icmsg_hdr)]; | sizeof(struct hv_vmbus_icmsg_hdr)]; | ||||
▲ Show 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | hv_kvp_process_request(void *context, int pending) | ||||
while ((ret == 0) && (recvlen > 0)) { | while ((ret == 0) && (recvlen > 0)) { | ||||
icmsghdrp = (struct hv_vmbus_icmsg_hdr *) | icmsghdrp = (struct hv_vmbus_icmsg_hdr *) | ||||
&kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; | &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; | ||||
hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); | hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); | ||||
if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | ||||
hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); | hv_kvp_negotiate_version(icmsghdrp, kvp_buf); | ||||
hv_kvp_respond_host(sc, ret); | hv_kvp_respond_host(sc, ret); | ||||
/* | /* | ||||
* It is ok to not acquire the mutex before setting | * It is ok to not acquire the mutex before setting | ||||
* req_in_progress here because negotiation is the | * req_in_progress here because negotiation is the | ||||
* first thing that happens and hence there is no | * first thing that happens and hence there is no | ||||
* chance of a race condition. | * chance of a race condition. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |