2 # Copyright (c) 2001, 2003 by Thomas Moestl <tmm@FreeBSD.org>
3 # Copyright (c) 2004 by Marius Strobl <marius@FreeBSD.org>
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 # IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
19 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
24 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <machine/bus.h>
31 #include <dev/ofw/openfirm.h>
36 static ofw_bus_get_compat_t ofw_bus_default_get_compat;
37 static ofw_bus_get_model_t ofw_bus_default_get_model;
38 static ofw_bus_get_name_t ofw_bus_default_get_name;
39 static ofw_bus_get_node_t ofw_bus_default_get_node;
40 static ofw_bus_get_type_t ofw_bus_default_get_type;
43 ofw_bus_default_get_compat(device_t bus, device_t dev)
50 ofw_bus_default_get_model(device_t bus, device_t dev)
57 ofw_bus_default_get_name(device_t bus, device_t dev)
64 ofw_bus_default_get_node(device_t bus, device_t dev)
71 ofw_bus_default_get_type(device_t bus, device_t dev)
78 # Get the alternate firmware name for the device dev on the bus. The default
79 # method will return NULL, which means the device doesn't have such a property.
80 METHOD const char * get_compat {
83 } DEFAULT ofw_bus_default_get_compat;
85 # Get the firmware model name for the device dev on the bus. The default method
86 # will return NULL, which means the device doesn't have such a property.
87 METHOD const char * get_model {
90 } DEFAULT ofw_bus_default_get_model;
92 # Get the firmware name for the device dev on the bus. The default method will
93 # return NULL, which means the device doesn't have such a property.
94 METHOD const char * get_name {
97 } DEFAULT ofw_bus_default_get_name;
99 # Get the firmware node for the device dev on the bus. The default method will
100 # return 0, which signals that there is no such node.
101 METHOD phandle_t get_node {
104 } DEFAULT ofw_bus_default_get_node;
106 # Get the firmware device type for the device dev on the bus. The default
107 # method will return NULL, which means the device doesn't have such a property.
108 METHOD const char * get_type {
111 } DEFAULT ofw_bus_default_get_type;