1139825Simp#-
2117119Stmm# Copyright (c) 2001, 2003 by Thomas Moestl <tmm@FreeBSD.org>
3220038Smarius# Copyright (c) 2011 Marius Strobl <marius@FreeBSD.org>
486234Stmm# All rights reserved.
586234Stmm#
686234Stmm# Redistribution and use in source and binary forms, with or without
786234Stmm# modification, are permitted provided that the following conditions
886234Stmm# are met:
986234Stmm# 1. Redistributions of source code must retain the above copyright
1086234Stmm#    notice, this list of conditions and the following disclaimer.
1186234Stmm# 2. Redistributions in binary form must reproduce the above copyright
1286234Stmm#    notice, this list of conditions and the following disclaimer in the
1386234Stmm#    documentation and/or other materials provided with the distribution.
1486234Stmm#
1586234Stmm# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1686234Stmm# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1786234Stmm# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1886234Stmm# IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
1986234Stmm# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2086234Stmm# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2186234Stmm# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2286234Stmm# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2386234Stmm# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2486234Stmm# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2586234Stmm#
2686234Stmm# $FreeBSD$
2786234Stmm
2886234Stmm#include <sys/bus.h>
2986234Stmm
30117119StmmINTERFACE ofw_pci;
3186234Stmm
3286234StmmCODE {
33220038Smarius	static ofw_pci_setup_device_t ofw_pci_default_setup_device;
34117119Stmm
35220038Smarius	static void
36220038Smarius	ofw_pci_default_setup_device(device_t dev, device_t child)
3786234Stmm	{
3886234Stmm
39170930Smarius		if (device_get_parent(dev) != NULL)
40220038Smarius			OFW_PCI_SETUP_DEVICE(device_get_parent(dev), child);
4186234Stmm	}
4286234Stmm};
4386234Stmm
44220038Smarius# Setup a device further upward in the tree.
45220038SmariusMETHOD void setup_device {
4686234Stmm	device_t dev;
47220038Smarius	device_t child;
48220038Smarius} DEFAULT ofw_pci_default_setup_device;
49