From owner-svn-src-all@freebsd.org Wed Jan 4 05:07:40 2017 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 ABED3C9E217; Wed, 4 Jan 2017 05:07:40 +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 6E1831F76; Wed, 4 Jan 2017 05:07:40 +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 v0457dAQ097507; Wed, 4 Jan 2017 05:07:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0457djb097504; Wed, 4 Jan 2017 05:07:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201701040507.v0457djb097504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 4 Jan 2017 05:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r311252 - stable/10/sys/dev/hyperv/utilities X-SVN-Group: stable-10 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: Wed, 04 Jan 2017 05:07:40 -0000 Author: sephe Date: Wed Jan 4 05:07:39 2017 New Revision: 311252 URL: https://svnweb.freebsd.org/changeset/base/311252 Log: MFC 310318 hyperv/ic: Cleanup driver glue. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8849 Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Jan 4 04:55:53 2017 (r311251) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Jan 4 05:07:39 2017 (r311252) @@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$"); #define VMBUS_HEARTBEAT_MSGVER \ VMBUS_IC_VERSION(VMBUS_HEARTBEAT_MSGVER_MAJOR, 0) +static int vmbus_heartbeat_probe(device_t); +static int vmbus_heartbeat_attach(device_t); + static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = { { .ic_guid = { .hv_guid = { @@ -56,6 +59,27 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; +static device_method_t vmbus_heartbeat_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vmbus_heartbeat_probe), + DEVMETHOD(device_attach, vmbus_heartbeat_attach), + DEVMETHOD(device_detach, vmbus_ic_detach), + DEVMETHOD_END +}; + +static driver_t vmbus_heartbeat_driver = { + "hvheartbeat", + vmbus_heartbeat_methods, + sizeof(struct vmbus_ic_softc) +}; + +static devclass_t vmbus_heartbeat_devclass; + +DRIVER_MODULE(hv_heartbeat, vmbus, vmbus_heartbeat_driver, + vmbus_heartbeat_devclass, NULL, NULL); +MODULE_VERSION(hv_heartbeat, 1); +MODULE_DEPEND(hv_heartbeat, vmbus, 1, 1, 1); + static void vmbus_heartbeat_cb(struct vmbus_channel *chan, void *xsc) { @@ -114,35 +138,15 @@ vmbus_heartbeat_cb(struct vmbus_channel } static int -hv_heartbeat_probe(device_t dev) +vmbus_heartbeat_probe(device_t dev) { return (vmbus_ic_probe(dev, vmbus_heartbeat_descs)); } static int -hv_heartbeat_attach(device_t dev) +vmbus_heartbeat_attach(device_t dev) { return (vmbus_ic_attach(dev, vmbus_heartbeat_cb)); } - -static device_method_t heartbeat_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, hv_heartbeat_probe), - DEVMETHOD(device_attach, hv_heartbeat_attach), - DEVMETHOD(device_detach, vmbus_ic_detach), - { 0, 0 } -}; - -static driver_t heartbeat_driver = { - "hvheartbeat", - heartbeat_methods, - sizeof(struct vmbus_ic_softc) -}; - -static devclass_t heartbeat_devclass; - -DRIVER_MODULE(hv_heartbeat, vmbus, heartbeat_driver, heartbeat_devclass, NULL, NULL); -MODULE_VERSION(hv_heartbeat, 1); -MODULE_DEPEND(hv_heartbeat, vmbus, 1, 1, 1); Modified: stable/10/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_shutdown.c Wed Jan 4 04:55:53 2017 (r311251) +++ stable/10/sys/dev/hyperv/utilities/hv_shutdown.c Wed Jan 4 05:07:39 2017 (r311252) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #define VMBUS_SHUTDOWN_MSGVER \ VMBUS_IC_VERSION(VMBUS_SHUTDOWN_MSGVER_MAJOR, 0) +static int vmbus_shutdown_probe(device_t); +static int vmbus_shutdown_attach(device_t); + static const struct vmbus_ic_desc vmbus_shutdown_descs[] = { { .ic_guid = { .hv_guid = { @@ -57,6 +60,27 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; +static device_method_t vmbus_shutdown_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vmbus_shutdown_probe), + DEVMETHOD(device_attach, vmbus_shutdown_attach), + DEVMETHOD(device_detach, vmbus_ic_detach), + DEVMETHOD_END +}; + +static driver_t vmbus_shutdown_driver = { + "hvshutdown", + vmbus_shutdown_methods, + sizeof(struct vmbus_ic_softc) +}; + +static devclass_t vmbus_shutdown_devclass; + +DRIVER_MODULE(hv_shutdown, vmbus, vmbus_shutdown_driver, + vmbus_shutdown_devclass, NULL, NULL); +MODULE_VERSION(hv_shutdown, 1); +MODULE_DEPEND(hv_shutdown, vmbus, 1, 1, 1); + static void vmbus_shutdown_cb(struct vmbus_channel *chan, void *xsc) { @@ -129,35 +153,15 @@ vmbus_shutdown_cb(struct vmbus_channel * } static int -hv_shutdown_probe(device_t dev) +vmbus_shutdown_probe(device_t dev) { return (vmbus_ic_probe(dev, vmbus_shutdown_descs)); } static int -hv_shutdown_attach(device_t dev) +vmbus_shutdown_attach(device_t dev) { return (vmbus_ic_attach(dev, vmbus_shutdown_cb)); } - -static device_method_t shutdown_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, hv_shutdown_probe), - DEVMETHOD(device_attach, hv_shutdown_attach), - DEVMETHOD(device_detach, vmbus_ic_detach), - { 0, 0 } -}; - -static driver_t shutdown_driver = { - "hvshutdown", - shutdown_methods, - sizeof(struct vmbus_ic_softc) -}; - -static devclass_t shutdown_devclass; - -DRIVER_MODULE(hv_shutdown, vmbus, shutdown_driver, shutdown_devclass, NULL, NULL); -MODULE_VERSION(hv_shutdown, 1); -MODULE_DEPEND(hv_shutdown, vmbus, 1, 1, 1); Modified: stable/10/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_timesync.c Wed Jan 4 04:55:53 2017 (r311251) +++ stable/10/sys/dev/hyperv/utilities/hv_timesync.c Wed Jan 4 05:07:39 2017 (r311252) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); ((sc)->ic_msgver >= VMBUS_IC_VERSION(4, 0) && \ (hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) +static int vmbus_timesync_probe(device_t); +static int vmbus_timesync_attach(device_t); + static const struct vmbus_ic_desc vmbus_timesync_descs[] = { { .ic_guid = { .hv_guid = { @@ -62,6 +65,27 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; +static device_method_t vmbus_timesync_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vmbus_timesync_probe), + DEVMETHOD(device_attach, vmbus_timesync_attach), + DEVMETHOD(device_detach, vmbus_ic_detach), + DEVMETHOD_END +}; + +static driver_t vmbus_timesync_driver = { + "hvtimesync", + vmbus_timesync_methods, + sizeof(struct vmbus_ic_softc) +}; + +static devclass_t vmbus_timesync_devclass; + +DRIVER_MODULE(hv_timesync, vmbus, vmbus_timesync_driver, + vmbus_timesync_devclass, NULL, NULL); +MODULE_VERSION(hv_timesync, 1); +MODULE_DEPEND(hv_timesync, vmbus, 1, 1, 1); + SYSCTL_NODE(_hw, OID_AUTO, hvtimesync, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Hyper-V timesync interface"); @@ -207,35 +231,15 @@ vmbus_timesync_cb(struct vmbus_channel * } static int -hv_timesync_probe(device_t dev) +vmbus_timesync_probe(device_t dev) { return (vmbus_ic_probe(dev, vmbus_timesync_descs)); } static int -hv_timesync_attach(device_t dev) +vmbus_timesync_attach(device_t dev) { return (vmbus_ic_attach(dev, vmbus_timesync_cb)); } - -static device_method_t timesync_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, hv_timesync_probe), - DEVMETHOD(device_attach, hv_timesync_attach), - DEVMETHOD(device_detach, vmbus_ic_detach), - { 0, 0 } -}; - -static driver_t timesync_driver = { - "hvtimesync", - timesync_methods, - sizeof(struct vmbus_ic_softc) -}; - -static devclass_t timesync_devclass; - -DRIVER_MODULE(hv_timesync, vmbus, timesync_driver, timesync_devclass, NULL, NULL); -MODULE_VERSION(hv_timesync, 1); -MODULE_DEPEND(hv_timesync, vmbus, 1, 1, 1);