Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/netvsc/hv_net_vsc.c
Show First 20 Lines • Show All 896 Lines • ▼ Show 20 Lines | |||||
* Net VSC on receive completion | * Net VSC on receive completion | ||||
* | * | ||||
* Send a receive completion packet to RNDIS device (ie NetVsp) | * Send a receive completion packet to RNDIS device (ie NetVsp) | ||||
*/ | */ | ||||
static void | static void | ||||
hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, | hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, | ||||
uint32_t status) | uint32_t status) | ||||
{ | { | ||||
nvsp_msg rx_comp_msg; | struct hn_nvs_rndis_ack ack; | ||||
int retries = 0; | int retries = 0; | ||||
int ret = 0; | int ret = 0; | ||||
rx_comp_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt_complete; | ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; | ||||
ack.nvs_status = status; | |||||
/* Pass in the status */ | |||||
rx_comp_msg.msgs.vers_1_msgs.send_rndis_pkt_complete.status = | |||||
status; | |||||
retry_send_cmplt: | retry_send_cmplt: | ||||
/* Send the completion */ | /* Send the completion */ | ||||
ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, 0, | ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, | ||||
&rx_comp_msg, sizeof(nvsp_msg), tid); | VMBUS_CHANPKT_FLAG_NONE, &ack, sizeof(ack), tid); | ||||
if (ret == 0) { | if (ret == 0) { | ||||
/* success */ | /* success */ | ||||
/* no-op */ | /* no-op */ | ||||
} else if (ret == EAGAIN) { | } else if (ret == EAGAIN) { | ||||
/* no more room... wait a bit and attempt to retry 3 times */ | /* no more room... wait a bit and attempt to retry 3 times */ | ||||
retries++; | retries++; | ||||
if (retries < 4) { | if (retries < 4) { | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |