From owner-svn-src-all@FreeBSD.ORG Fri Nov 21 10:12:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94DC9EB6; Fri, 21 Nov 2014 10:12:33 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 784CE981; Fri, 21 Nov 2014 10:12:33 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 143977328F; Fri, 21 Nov 2014 10:12:30 +0000 (UTC) Date: Fri, 21 Nov 2014 10:12:18 +0000 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r274655 - in head/sys/dev/virtio: block mmio Message-ID: <20141121101218.32f338c6@bender.lan> In-Reply-To: <201411181411.sAIEBFlh069043@svn.freebsd.org> References: <201411181411.sAIEBFlh069043@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Fri, 21 Nov 2014 10:12:33 -0000 On Tue, 18 Nov 2014 14:11:15 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Tue Nov 18 14:11:14 2014 > New Revision: 274655 > URL: https://svnweb.freebsd.org/changeset/base/274655 > > Log: > Add Virtio MMIO bus driver. This is missing a config option to allow it to be built. I would like to test it on the arm64 simulator as it has a virtio option. > > Sponsored by: DARPA, AFRL > > Added: > head/sys/dev/virtio/mmio/ > head/sys/dev/virtio/mmio/virtio_mmio.c (contents, props changed) > head/sys/dev/virtio/mmio/virtio_mmio.h (contents, props changed) > head/sys/dev/virtio/mmio/virtio_mmio_if.m (contents, props > changed) Modified: > head/sys/dev/virtio/block/virtio_blk.c > ... > + > +static int > +vtmmio_probe(device_t dev) > +{ > + > + if (!ofw_bus_status_okay(dev)) > + return (ENXIO); > + > + if (!ofw_bus_is_compatible(dev, "virtio,mmio")) > + return (ENXIO); This should be split out to an fdt specific file at some stage as virtio-mmio is not fdt specefic. > + > + device_set_desc(dev, "VirtIO MMIO adapter"); > + return (BUS_PROBE_DEFAULT); > +} ... > + > +static int > +vtmmio_suspend(device_t dev) > +{ > + > + return (bus_generic_suspend(dev)); > +} > + > +static int > +vtmmio_resume(device_t dev) > +{ > + > + return (bus_generic_resume(dev)); > +} Why does vtmmio_suspend and vtmmio_resume exist? I would think they could be replaced with bus_generic_suspend and bus_generic_resume respectively in the device methods. Andrew