svn commit: r308625 - in stable/11/sys: conf dev/hyperv/netvsc modules/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Mon Nov 14 03:37:01 UTC 2016
Author: sephe
Date: Mon Nov 14 03:36:59 2016
New Revision: 308625
URL: https://svnweb.freebsd.org/changeset/base/308625
Log:
MFC 308011,308012
308011
hyperv/hn: Rename cleaned up NVS header file.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8353
308012
hyperv/hn: Rename cleaned up NVS source file.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8354
Added:
stable/11/sys/dev/hyperv/netvsc/hn_nvs.c
- copied, changed from r308624, stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.c
stable/11/sys/dev/hyperv/netvsc/hn_nvs.h
- copied unchanged from r308624, stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h
Deleted:
stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.c
stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h
Modified:
stable/11/sys/conf/files.amd64
stable/11/sys/conf/files.i386
stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c
stable/11/sys/modules/hyperv/netvsc/Makefile
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/conf/files.amd64
==============================================================================
--- stable/11/sys/conf/files.amd64 Mon Nov 14 03:19:17 2016 (r308624)
+++ stable/11/sys/conf/files.amd64 Mon Nov 14 03:36:59 2016 (r308625)
@@ -291,7 +291,7 @@ dev/hwpmc/hwpmc_uncore.c optional hwpmc
dev/hwpmc/hwpmc_piv.c optional hwpmc
dev/hwpmc/hwpmc_tsc.c optional hwpmc
dev/hwpmc/hwpmc_x86.c optional hwpmc
-dev/hyperv/netvsc/hv_net_vsc.c optional hyperv
+dev/hyperv/netvsc/hn_nvs.c optional hyperv
dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optional hyperv
dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv
dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv
Modified: stable/11/sys/conf/files.i386
==============================================================================
--- stable/11/sys/conf/files.i386 Mon Nov 14 03:19:17 2016 (r308624)
+++ stable/11/sys/conf/files.i386 Mon Nov 14 03:36:59 2016 (r308625)
@@ -248,7 +248,7 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc
dev/hwpmc/hwpmc_ppro.c optional hwpmc
dev/hwpmc/hwpmc_tsc.c optional hwpmc
dev/hwpmc/hwpmc_x86.c optional hwpmc
-dev/hyperv/netvsc/hv_net_vsc.c optional hyperv
+dev/hyperv/netvsc/hn_nvs.c optional hyperv
dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optional hyperv
dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv
dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv
Copied and modified: stable/11/sys/dev/hyperv/netvsc/hn_nvs.c (from r308624, stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.c)
==============================================================================
--- stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Nov 14 03:19:17 2016 (r308624, copy source)
+++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 14 03:36:59 2016 (r308625)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#include <dev/hyperv/netvsc/ndis.h>
#include <dev/hyperv/netvsc/if_hnreg.h>
#include <dev/hyperv/netvsc/if_hnvar.h>
-#include <dev/hyperv/netvsc/hv_net_vsc.h>
+#include <dev/hyperv/netvsc/hn_nvs.h>
static int hn_nvs_conn_chim(struct hn_softc *);
static int hn_nvs_conn_rxbuf(struct hn_softc *);
Copied: stable/11/sys/dev/hyperv/netvsc/hn_nvs.h (from r308624, stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/11/sys/dev/hyperv/netvsc/hn_nvs.h Mon Nov 14 03:36:59 2016 (r308625, copy of r308624, stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h)
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2009-2012,2016 Microsoft Corp.
+ * Copyright (c) 2010-2012 Citrix Inc.
+ * Copyright (c) 2012 NetApp Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _HN_NVS_H_
+#define _HN_NVS_H_
+
+struct hn_nvs_sendctx;
+struct vmbus_channel;
+struct hn_softc;
+
+typedef void (*hn_nvs_sent_t)
+ (struct hn_nvs_sendctx *, struct hn_softc *,
+ struct vmbus_channel *, const void *, int);
+
+struct hn_nvs_sendctx {
+ hn_nvs_sent_t hn_cb;
+ void *hn_cbarg;
+};
+
+#define HN_NVS_SENDCTX_INITIALIZER(cb, cbarg) \
+{ \
+ .hn_cb = cb, \
+ .hn_cbarg = cbarg \
+}
+
+static __inline void
+hn_nvs_sendctx_init(struct hn_nvs_sendctx *sndc, hn_nvs_sent_t cb, void *cbarg)
+{
+
+ sndc->hn_cb = cb;
+ sndc->hn_cbarg = cbarg;
+}
+
+static __inline int
+hn_nvs_send(struct vmbus_channel *chan, uint16_t flags,
+ void *nvs_msg, int nvs_msglen, struct hn_nvs_sendctx *sndc)
+{
+
+ return (vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, flags,
+ nvs_msg, nvs_msglen, (uint64_t)(uintptr_t)sndc));
+}
+
+static __inline int
+hn_nvs_send_sglist(struct vmbus_channel *chan, struct vmbus_gpa sg[], int sglen,
+ void *nvs_msg, int nvs_msglen, struct hn_nvs_sendctx *sndc)
+{
+
+ return (vmbus_chan_send_sglist(chan, sg, sglen, nvs_msg, nvs_msglen,
+ (uint64_t)(uintptr_t)sndc));
+}
+
+static __inline int
+hn_nvs_send_rndis_sglist(struct vmbus_channel *chan, uint32_t rndis_mtype,
+ struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt)
+{
+ struct hn_nvs_rndis rndis;
+
+ rndis.nvs_type = HN_NVS_TYPE_RNDIS;
+ rndis.nvs_rndis_mtype = rndis_mtype;
+ rndis.nvs_chim_idx = HN_NVS_CHIM_IDX_INVALID;
+ rndis.nvs_chim_sz = 0;
+
+ return (hn_nvs_send_sglist(chan, gpa, gpa_cnt,
+ &rndis, sizeof(rndis), sndc));
+}
+
+int hn_nvs_attach(struct hn_softc *sc, int mtu);
+void hn_nvs_detach(struct hn_softc *sc);
+int hn_nvs_alloc_subchans(struct hn_softc *sc, int *nsubch);
+void hn_nvs_sent_xact(struct hn_nvs_sendctx *sndc,
+ struct hn_softc *sc, struct vmbus_channel *chan,
+ const void *data, int dlen);
+int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan,
+ struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa,
+ int gpa_cnt);
+
+extern struct hn_nvs_sendctx hn_nvs_sendctx_none;
+
+#endif /* !_HN_NVS_H_ */
Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Nov 14 03:19:17 2016 (r308624)
+++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Nov 14 03:36:59 2016 (r308625)
@@ -124,7 +124,7 @@ __FBSDID("$FreeBSD$");
#include <dev/hyperv/netvsc/ndis.h>
#include <dev/hyperv/netvsc/if_hnreg.h>
#include <dev/hyperv/netvsc/if_hnvar.h>
-#include <dev/hyperv/netvsc/hv_net_vsc.h>
+#include <dev/hyperv/netvsc/hn_nvs.h>
#include <dev/hyperv/netvsc/hv_rndis_filter.h>
#include "vmbus_if.h"
Modified: stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Nov 14 03:19:17 2016 (r308624)
+++ stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Nov 14 03:36:59 2016 (r308625)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <dev/hyperv/netvsc/ndis.h>
#include <dev/hyperv/netvsc/if_hnreg.h>
#include <dev/hyperv/netvsc/if_hnvar.h>
-#include <dev/hyperv/netvsc/hv_net_vsc.h>
+#include <dev/hyperv/netvsc/hn_nvs.h>
#include <dev/hyperv/netvsc/hv_rndis_filter.h>
#define HV_RF_RECVINFO_VLAN 0x1
Modified: stable/11/sys/modules/hyperv/netvsc/Makefile
==============================================================================
--- stable/11/sys/modules/hyperv/netvsc/Makefile Mon Nov 14 03:19:17 2016 (r308624)
+++ stable/11/sys/modules/hyperv/netvsc/Makefile Mon Nov 14 03:36:59 2016 (r308625)
@@ -4,7 +4,7 @@
${.CURDIR}/../../../dev/hyperv/vmbus
KMOD= hv_netvsc
-SRCS= hv_net_vsc.c \
+SRCS= hn_nvs.c \
hv_netvsc_drv_freebsd.c \
hv_rndis_filter.c
SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h
More information about the svn-src-stable
mailing list