From owner-svn-src-all@freebsd.org Mon Sep 12 05:28:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A6D9BD6A56; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1219B3E2; Mon, 12 Sep 2016 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5SpdJ064238; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5SpS1064235; Mon, 12 Sep 2016 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201609120528.u8C5SpS1064235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 12 Sep 2016 05:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305727 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:28:52 -0000 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);