svn commit: r305727 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Mon Sep 12 05:28:52 UTC 2016
Author: sephe
Date: Mon Sep 12 05:28:50 2016
New Revision: 305727
URL: https://svnweb.freebsd.org/changeset/base/305727
Log:
hyperv/hn: Function rename.
- Minor style changes.
- Nuke unnecessary indirection.
- Nuke unapplied comment.
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7827
Modified:
head/sys/dev/hyperv/netvsc/hv_net_vsc.c
head/sys/dev/hyperv/netvsc/hv_net_vsc.h
head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:19:56 2016 (r305726)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Sep 12 05:28:50 2016 (r305727)
@@ -61,7 +61,6 @@ static int hn_nvs_conn_chim(struct hn_s
static int hn_nvs_conn_rxbuf(struct hn_softc *);
static int hn_nvs_disconn_chim(struct hn_softc *sc);
static int hn_nvs_disconn_rxbuf(struct hn_softc *sc);
-static int hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu);
static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
struct hn_softc *, struct vmbus_channel *chan,
const void *, int);
@@ -521,45 +520,48 @@ hn_nvs_init(struct hn_softc *sc)
return (ENXIO);
}
-static int
-hv_nv_connect_to_vsp(struct hn_softc *sc, int mtu)
+int
+hn_nvs_attach(struct hn_softc *sc, int mtu)
{
- int ret;
+ int error;
/*
* Initialize NVS.
*/
- ret = hn_nvs_init(sc);
- if (ret != 0)
- return (ret);
+ error = hn_nvs_init(sc);
+ if (error)
+ return (error);
if (sc->hn_nvs_ver >= HN_NVS_VERSION_2) {
/*
* Configure NDIS before initializing it.
*/
- ret = hn_nvs_conf_ndis(sc, mtu);
- if (ret != 0)
- return (ret);
+ error = hn_nvs_conf_ndis(sc, mtu);
+ if (error)
+ return (error);
}
/*
* Initialize NDIS.
*/
- ret = hn_nvs_init_ndis(sc);
- if (ret != 0)
- return (ret);
+ error = hn_nvs_init_ndis(sc);
+ if (error)
+ return (error);
/*
* Connect RXBUF.
*/
- ret = hn_nvs_conn_rxbuf(sc);
- if (ret != 0)
- return (ret);
+ error = hn_nvs_conn_rxbuf(sc);
+ if (error)
+ return (error);
/*
* Connect chimney sending buffer.
*/
- return hn_nvs_conn_chim(sc);
+ error = hn_nvs_conn_chim(sc);
+ if (error)
+ return (error);
+ return (0);
}
/*
@@ -573,21 +575,6 @@ hv_nv_disconnect_from_vsp(struct hn_soft
}
/*
- * Net VSC on device add
- *
- * Callback when the device belonging to this driver is added
- */
-int
-hv_nv_on_device_add(struct hn_softc *sc, int mtu)
-{
-
- /*
- * Connect with the NetVsp
- */
- return (hv_nv_connect_to_vsp(sc, mtu));
-}
-
-/*
* Net VSC on device remove
*/
int
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:19:56 2016 (r305726)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Sep 12 05:28:50 2016 (r305727)
@@ -261,7 +261,7 @@ extern int hv_promisc_mode;
struct hn_send_ctx;
void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status);
-int hv_nv_on_device_add(struct hn_softc *sc, int mtu);
+int hn_nvs_attach(struct hn_softc *sc, int mtu);
int hv_nv_on_device_remove(struct hn_softc *sc);
int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype,
struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt);
Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:19:56 2016 (r305726)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Sep 12 05:28:50 2016 (r305727)
@@ -1025,13 +1025,7 @@ hv_rf_on_device_add(struct hn_softc *sc,
int nchan = *nchan0;
int rxr_cnt;
- /*
- * Let the inner driver handle this first to create the netvsc channel
- * NOTE! Once the channel is created, we may get a receive callback
- * (hv_rf_on_receive()) before this call is completed.
- * Note: Earlier code used a function pointer here.
- */
- ret = hv_nv_on_device_add(sc, mtu);
+ ret = hn_nvs_attach(sc, mtu);
if (ret != 0)
return (ret);
More information about the svn-src-all
mailing list