aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSepherosa Ziehau <sephe@FreeBSD.org>2016-08-17 05:25:47 +0000
committerSepherosa Ziehau <sephe@FreeBSD.org>2016-08-17 05:25:47 +0000
commit5f0dee26f1c52a88383c2f178d1feddf76d6e48e (patch)
treea0b2c966c576dc1ef5ff6299113450a0cc7fae8c
parent46911ec745f9ce83a2649370b6053e45617d0d42 (diff)
downloadsrc-5f0dee26f1c52a88383c2f178d1feddf76d6e48e.tar.gz
src-5f0dee26f1c52a88383c2f178d1feddf76d6e48e.zip
hyperv/hn: Simplify RNDIS RX packets acknowledgement.
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7515
Notes
Notes: svn path=/head/; revision=304253
-rw-r--r--sys/dev/hyperv/netvsc/hv_net_vsc.c13
-rw-r--r--sys/dev/hyperv/netvsc/if_hnreg.h9
2 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_net_vsc.c b/sys/dev/hyperv/netvsc/hv_net_vsc.c
index 1db34e70ac95..df07c088e304 100644
--- a/sys/dev/hyperv/netvsc/hv_net_vsc.c
+++ b/sys/dev/hyperv/netvsc/hv_net_vsc.c
@@ -902,20 +902,17 @@ static void
hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid,
uint32_t status)
{
- nvsp_msg rx_comp_msg;
+ struct hn_nvs_rndis_ack ack;
int retries = 0;
int ret = 0;
- rx_comp_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt_complete;
-
- /* Pass in the status */
- rx_comp_msg.msgs.vers_1_msgs.send_rndis_pkt_complete.status =
- status;
+ ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK;
+ ack.nvs_status = status;
retry_send_cmplt:
/* Send the completion */
- ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, 0,
- &rx_comp_msg, sizeof(nvsp_msg), tid);
+ ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP,
+ VMBUS_CHANPKT_FLAG_NONE, &ack, sizeof(ack), tid);
if (ret == 0) {
/* success */
/* no-op */
diff --git a/sys/dev/hyperv/netvsc/if_hnreg.h b/sys/dev/hyperv/netvsc/if_hnreg.h
index e14ed84606f6..467c5400011d 100644
--- a/sys/dev/hyperv/netvsc/if_hnreg.h
+++ b/sys/dev/hyperv/netvsc/if_hnreg.h
@@ -44,6 +44,7 @@
* NVS message transacion status codes.
*/
#define HN_NVS_STATUS_OK 1
+#define HN_NVS_STATUS_FAILED 2
/*
* NVS request/response message types.
@@ -58,6 +59,7 @@
#define HN_NVS_TYPE_CHIM_CONNRESP 105
#define HN_NVS_TYPE_CHIM_DISCONN 106
#define HN_NVS_TYPE_RNDIS 107
+#define HN_NVS_TYPE_RNDIS_ACK 108
#define HN_NVS_TYPE_NDIS_CONF 125
#define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */
#define HN_NVS_TYPE_SET_DATAPATH 129
@@ -199,4 +201,11 @@ struct hn_nvs_rndis {
} __packed;
CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN);
+struct hn_nvs_rndis_ack {
+ uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */
+ uint32_t nvs_status; /* HN_NVS_STATUS_ */
+ uint8_t nvs_rsvd[24];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN);
+
#endif /* !_IF_HNREG_H_ */