1#- 2# Copyright (c) 2001, 2003 by Thomas Moestl <tmm@FreeBSD.org> |
3# Copyright (c) 2004, 2005 by Marius Strobl <marius@FreeBSD.org> |
4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 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 --- 6 unchanged lines hidden (view full) --- 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. 25# |
26# $FreeBSD: head/sys/dev/ofw/ofw_bus_if.m 152683 2005-11-22 16:37:45Z marius $ |
27 |
28# Interface for retrieving the package handle and a subset, namely 29# 'compatible', 'device_type', 'model' and 'name', of the standard 30# properties of a device on an Open Firmware assisted bus for use 31# in device drivers. The rest of the standard properties, 'address', 32# 'interrupts', 'reg' and 'status', are not covered by this interface 33# as they are expected to be only of interest in the respective bus 34# driver. 35 |
36#include <sys/bus.h> |
37 38#include <dev/ofw/openfirm.h> 39 40INTERFACE ofw_bus; 41 |
42HEADER { 43 struct ofw_bus_devinfo { 44 phandle_t obd_node; 45 char *obd_compat; 46 char *obd_model; 47 char *obd_name; 48 char *obd_type; 49 }; 50}; 51 |
52CODE { |
53 static ofw_bus_get_devinfo_t ofw_bus_default_get_devinfo; |
54 static ofw_bus_get_compat_t ofw_bus_default_get_compat; 55 static ofw_bus_get_model_t ofw_bus_default_get_model; 56 static ofw_bus_get_name_t ofw_bus_default_get_name; 57 static ofw_bus_get_node_t ofw_bus_default_get_node; 58 static ofw_bus_get_type_t ofw_bus_default_get_type; 59 |
60 static const struct ofw_bus_devinfo * 61 ofw_bus_default_get_devinfo(device_t bus, device_t dev) 62 { 63 64 return (NULL); 65 } 66 |
67 static const char * 68 ofw_bus_default_get_compat(device_t bus, device_t dev) 69 { 70 71 return (NULL); 72 } 73 74 static const char * --- 20 unchanged lines hidden (view full) --- 95 static const char * 96 ofw_bus_default_get_type(device_t bus, device_t dev) 97 { 98 99 return (NULL); 100 } 101}; 102 |
103# Get the ofw_bus_devinfo struct for the device dev on the bus. Used for bus 104# drivers which use the generic methods in ofw_bus_subr.c to implement the 105# reset of this interface. The default method will return NULL, which means 106# there is no such struct associated with the device. 107METHOD const struct ofw_bus_devinfo * get_devinfo { 108 device_t bus; 109 device_t dev; 110} DEFAULT ofw_bus_default_get_devinfo; 111 |
112# Get the alternate firmware name for the device dev on the bus. The default 113# method will return NULL, which means the device doesn't have such a property. 114METHOD const char * get_compat { 115 device_t bus; 116 device_t dev; 117} DEFAULT ofw_bus_default_get_compat; 118 119# Get the firmware model name for the device dev on the bus. The default method --- 26 unchanged lines hidden --- |