From owner-svn-src-head@freebsd.org Thu Jul 14 06:40:43 2016 Return-Path: Delivered-To: svn-src-head@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 D1593B98C87; Thu, 14 Jul 2016 06:40:43 +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 AE2511CE6; Thu, 14 Jul 2016 06:40:43 +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 u6E6egGF064610; Thu, 14 Jul 2016 06:40:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6E6egMa064608; Thu, 14 Jul 2016 06:40:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607140640.u6E6egMa064608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jul 2016 06:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302810 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 06:40:43 -0000 Author: sephe Date: Thu Jul 14 06:40:42 2016 New Revision: 302810 URL: https://svnweb.freebsd.org/changeset/base/302810 Log: hyperv/vmbus: Move new channel scan notification to device register And nuke now unnecessary function indirection. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7103 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 06:29:12 2016 (r302809) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 06:40:42 2016 (r302810) @@ -40,14 +40,12 @@ typedef void (*vmbus_chanmsg_proc_t) (struct vmbus_softc *, const struct vmbus_message *); -static void vmbus_channel_on_offer_internal(struct vmbus_softc *, - const struct vmbus_chanmsg_choffer *); static void vmbus_chan_detach_task(void *, int); -static void vmbus_channel_on_offer(struct vmbus_softc *, - const struct vmbus_message *); static void vmbus_channel_on_offers_delivered(struct vmbus_softc *, const struct vmbus_message *); +static void vmbus_chan_msgproc_choffer(struct vmbus_softc *, + const struct vmbus_message *); static void vmbus_chan_msgproc_chrescind(struct vmbus_softc *, const struct vmbus_message *); @@ -62,7 +60,7 @@ static void vmbus_chan_msgproc_chrescind static const vmbus_chanmsg_proc_t vmbus_chanmsg_process[VMBUS_CHANMSG_TYPE_MAX] = { - VMBUS_CHANMSG_PROC(CHOFFER, vmbus_channel_on_offer), + VMBUS_CHANMSG_PROC(CHOFFER, vmbus_chan_msgproc_choffer), VMBUS_CHANMSG_PROC(CHRESCIND, vmbus_chan_msgproc_chrescind), VMBUS_CHANMSG_PROC(CHOFFER_DONE,vmbus_channel_on_offers_delivered), @@ -259,28 +257,16 @@ vmbus_channel_select_defcpu(struct hv_vm vmbus_channel_cpu_set(chan, 0); } -/** - * @brief Handler for channel offers from Hyper-V/Azure - * - * Handler for channel offers from vmbus in parent partition. - */ -static void -vmbus_channel_on_offer(struct vmbus_softc *sc, const struct vmbus_message *msg) -{ - /* New channel is offered by vmbus */ - vmbus_scan_newchan(sc); - - vmbus_channel_on_offer_internal(sc, - (const struct vmbus_chanmsg_choffer *)msg->msg_data); -} - static void -vmbus_channel_on_offer_internal(struct vmbus_softc *sc, - const struct vmbus_chanmsg_choffer *offer) +vmbus_chan_msgproc_choffer(struct vmbus_softc *sc, + const struct vmbus_message *msg) { + const struct vmbus_chanmsg_choffer *offer; hv_vmbus_channel* new_channel; int error; + offer = (const struct vmbus_chanmsg_choffer *)msg->msg_data; + /* * Allocate the channel object and save this offer */ Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 06:29:12 2016 (r302809) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 06:40:42 2016 (r302810) @@ -994,6 +994,9 @@ hv_vmbus_child_device_register(struct hv device_t parent = sc->vmbus_dev; int error = 0; + /* New channel has been offered */ + vmbus_scan_newchan(sc); + chan->ch_dev = device_add_child(parent, NULL, -1); if (chan->ch_dev == NULL) { device_printf(parent, "device_add_child for chan%u failed\n",