2 # Copyright (c) 1998-2004 Doug Rabson
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <sys/types.h>
30 #include <sys/systm.h>
42 # Default implementations of some methods.
45 static struct resource *
47 int type,
int *rid, u_long
start, u_long end,
48 u_long
count, u_int flags)
58 return (BUS_REMAP_INTR(dev, NULL, irq));
67 panic(
"bus_add_child is not implemented");
355 struct resource *
_res;
408 struct resource *
_irq;
565 struct resource *
_irq;
599 struct resource *
_irq;
METHOD bus_dma_tag_t get_dma_tag
Returns bus_dma_tag_t for use w/ devices on the bus.
DEFAULT bus_generic_new_pass
DEFAULT bus_generic_child_present
METHOD int child_pnpinfo_str
Returns the pnp info for this device.
METHOD struct resource * alloc_resource
Allocate a system resource.
DEFAULT bus_generic_driver_added
METHOD void hinted_child
Notify a (bus) driver about a child that the hints mechanism believes it has discovered.
DEFAULT bus_generic_get_resource_list
void panic(const char *fmt,...)
METHOD void probe_nomatch
Print a notification about an unprobed child device.
METHOD void delete_resource
Delete a resource.
DEFAULT bus_generic_describe_intr
METHOD int set_resource
Define a resource which can be allocated with BUS_ALLOC_RESOURCE().
DEFAULT bus_generic_bind_intr
METHOD int config_intr
Allow (bus) drivers to specify the trigger mode and polarity of the specified interrupt.
METHOD int release_resource
Release a resource.
driver_filter_t * _filter
METHOD void driver_added
Notify a bus that a new driver was added.
DEFAULT null_alloc_resource
METHOD int write_ivar
Write the value of a bus-specific attribute of a device.
METHOD int child_present
Is the hardware described by _child still attached to the system?
METHOD int describe_intr
Allow drivers to associate a description with an active interrupt handler.
METHOD struct resource_list * get_resource_list
Return a struct resource_list.
METHOD void hint_device_unit
Allow the bus to determine the unit number of a device.
METHOD int setup_intr
Install an interrupt handler.
METHOD int activate_resource
Activate a resource.
METHOD int child_location_str
Returns the location for this device.
METHOD int adjust_resource
Adjust a resource.
DEFAULT bus_generic_config_intr
#define DEFAULT(foo, bar)
METHOD void child_deleted
Notify a bus that a child was deleted.
DEFAULT bus_generic_print_child
METHOD int teardown_intr
Uninstall an interrupt handler.
METHOD int bind_intr
Allow drivers to request that an interrupt be bound to a specific CPU.
METHOD int print_child
Print a description of a child device.
METHOD int deactivate_resource
Deactivate a resource.
METHOD int remap_intr
Notify a bus that specified child's IRQ should be remapped.
METHOD device_t add_child
Create a new child device.
METHOD void child_detached
Notify a bus that a child was detached.
METHOD int read_ivar
Read the value of a bus-specific attribute of a device.
METHOD void new_pass
Notify a bus that the bus pass level has been changed.
DEFAULT bus_generic_get_dma_tag
METHOD int get_resource
Describe a resource.