bus_if.m revision 161928
1139804Simp#-
2133588Simp# Copyright (c) 1998-2004 Doug Rabson
336973Sdfr# All rights reserved.
436973Sdfr#
536973Sdfr# Redistribution and use in source and binary forms, with or without
636973Sdfr# modification, are permitted provided that the following conditions
736973Sdfr# are met:
836973Sdfr# 1. Redistributions of source code must retain the above copyright
936973Sdfr#    notice, this list of conditions and the following disclaimer.
1036973Sdfr# 2. Redistributions in binary form must reproduce the above copyright
1136973Sdfr#    notice, this list of conditions and the following disclaimer in the
1236973Sdfr#    documentation and/or other materials provided with the distribution.
1336973Sdfr#
1436973Sdfr# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1536973Sdfr# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1636973Sdfr# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1736973Sdfr# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1836973Sdfr# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1936973Sdfr# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2036973Sdfr# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2136973Sdfr# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2236973Sdfr# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2336973Sdfr# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2436973Sdfr# SUCH DAMAGE.
2536973Sdfr#
2650477Speter# $FreeBSD: head/sys/kern/bus_if.m 161928 2006-09-03 00:27:42Z jmg $
2736973Sdfr#
2836973Sdfr
2959093Sdfr#include <sys/bus.h>
3059093Sdfr
31132354Sdfr/**
32132354Sdfr * @defgroup BUS bus - KObj methods for drivers of devices with children
33132354Sdfr * @brief A set of methods required device drivers that support
34132354Sdfr * child devices.
35132354Sdfr * @{
36132354Sdfr */
3741017SnsouchINTERFACE bus;
3836973Sdfr
3936973Sdfr#
4046913Sdfr# Default implementations of some methods.
4146913Sdfr#
4246913SdfrCODE {
4346913Sdfr	static struct resource *
4446913Sdfr	null_alloc_resource(device_t dev, device_t child,
45100421Simp	    int type, int *rid, u_long start, u_long end,
46100421Simp	    u_long count, u_int flags)
4746913Sdfr	{
48100421Simp	    return (0);
4946913Sdfr	}
5046913Sdfr};
5146913Sdfr
52132354Sdfr/**
53132354Sdfr * @brief Print a description of a child device
54132354Sdfr *
55132354Sdfr * This is called from system code which prints out a description of a
56132354Sdfr * device. It should describe the attachment that the child has with
57132354Sdfr * the parent. For instance the TurboLaser bus prints which node the
58132354Sdfr * device is attached to. See bus_generic_print_child() for more 
59132354Sdfr * information.
60132354Sdfr *
61132354Sdfr * @param _dev		the device whose child is being printed
62132354Sdfr * @param _child	the child device to describe
63132354Sdfr *
64132354Sdfr * @returns		the number of characters output.
65132354Sdfr */
6649195SmdoddMETHOD int print_child {
67132354Sdfr	device_t _dev;
68132354Sdfr	device_t _child;
69112588Smdodd} DEFAULT bus_generic_print_child;
7036973Sdfr
71132354Sdfr/**
72132354Sdfr * @brief Print a notification about an unprobed child device.
73132354Sdfr *
74132354Sdfr * Called for each child device that did not succeed in probing for a
75132354Sdfr * driver.
76132354Sdfr *
77132354Sdfr * @param _dev		the device whose child was being probed
78132354Sdfr * @param _child	the child device which failed to probe
79132354Sdfr */   
8048754SdfrMETHOD void probe_nomatch {
81132354Sdfr        device_t _dev;
82132354Sdfr        device_t _child;
8348754Sdfr};
8448754Sdfr
85132354Sdfr/**
86132354Sdfr * @brief Read the value of a bus-specific attribute of a device
87132354Sdfr *
88132354Sdfr * This method, along with BUS_WRITE_IVAR() manages a bus-specific set
89132354Sdfr * of instance variables of a child device.  The intention is that
90132354Sdfr * each different type of bus defines a set of appropriate instance
91132354Sdfr * variables (such as ports and irqs for ISA bus etc.)
92132354Sdfr *
93132354Sdfr * This information could be given to the child device as a struct but
94132354Sdfr * that makes it hard for a bus to add or remove variables without
95132354Sdfr * forcing an edit and recompile for all drivers which may not be
96132354Sdfr * possible for vendor supplied binary drivers.
97132354Sdfr *
98132354Sdfr * This method copies the value of an instance variable to the
99132354Sdfr * location specified by @p *_result.
100132354Sdfr * 
101132354Sdfr * @param _dev		the device whose child was being examined
102132354Sdfr * @param _child	the child device whose instance variable is
103132354Sdfr *			being read
104132354Sdfr * @param _index	the instance variable to read
105132354Sdfr * @param _result	a loction to recieve the instance variable
106132354Sdfr *			value
107132354Sdfr * 
108132354Sdfr * @retval 0		success
109132354Sdfr * @retval ENOENT	no such instance variable is supported by @p
110132354Sdfr *			_dev 
111132354Sdfr */
11236973SdfrMETHOD int read_ivar {
11395201Smarkm	device_t _dev;
11495201Smarkm	device_t _child;
115132354Sdfr	int _index;
11695201Smarkm	uintptr_t *_result;
11736973Sdfr};
11836973Sdfr
119132354Sdfr/**
120132354Sdfr * @brief Write the value of a bus-specific attribute of a device
121132354Sdfr * 
122132354Sdfr * This method sets the value of an instance variable to @p _value.
123132354Sdfr * 
124132354Sdfr * @param _dev		the device whose child was being updated
125132354Sdfr * @param _child	the child device whose instance variable is
126132354Sdfr *			being written
127132354Sdfr * @param _index	the instance variable to write
128132354Sdfr * @param _value	the value to write to that instance variable
129132354Sdfr * 
130132354Sdfr * @retval 0		success
131132354Sdfr * @retval ENOENT	no such instance variable is supported by @p
132132354Sdfr *			_dev 
133132354Sdfr * @retval EINVAL	the instance variable was recognised but
134132354Sdfr *			contains a read-only value
135132354Sdfr */
13636973SdfrMETHOD int write_ivar {
13795201Smarkm	device_t _dev;
13895201Smarkm	device_t _child;
13995201Smarkm	int _indx;
14095201Smarkm	uintptr_t _value;
14136973Sdfr};
14236973Sdfr
143132354Sdfr/**
144132354Sdfr * @brief Notify a bus that a child was detached
145132354Sdfr *
146132354Sdfr * Called after the child's DEVICE_DETACH() method to allow the parent
147132354Sdfr * to reclaim any resources allocated on behalf of the child.
148132354Sdfr * 
149132354Sdfr * @param _dev		the device whose child changed state
150132354Sdfr * @param _child	the child device which changed state
151132354Sdfr */
15245107SdfrMETHOD void child_detached {
15395201Smarkm	device_t _dev;
15495201Smarkm	device_t _child;
15545107Sdfr};
15645107Sdfr
157132354Sdfr/**
158132354Sdfr * @brief Notify a bus that a new driver was added
159132354Sdfr * 
160132354Sdfr * Called when a new driver is added to the devclass which owns this
161132354Sdfr * bus. The generic implementation of this method attempts to probe and
162132354Sdfr * attach any un-matched children of the bus.
163132354Sdfr * 
164132354Sdfr * @param _dev		the device whose devclass had a new driver
165132354Sdfr *			added to it
166132354Sdfr * @param _driver	the new driver which was added
167132354Sdfr */
16845720SpeterMETHOD void driver_added {
16995201Smarkm	device_t _dev;
17095201Smarkm	driver_t *_driver;
17152045Simp} DEFAULT bus_generic_driver_added;
17245720Speter
173132354Sdfr/**
174132354Sdfr * @brief Create a new child device
175132354Sdfr *
176132354Sdfr * For busses which use use drivers supporting DEVICE_IDENTIFY() to
177132354Sdfr * enumerate their devices, this method is used to create new
178132354Sdfr * device instances. The new device will be added after the last
179132354Sdfr * existing child with the same order.
180132354Sdfr * 
181132354Sdfr * @param _dev		the bus device which will be the parent of the
182132354Sdfr *			new child device
183132354Sdfr * @param _order	a value which is used to partially sort the
184132354Sdfr *			children of @p _dev - devices created using
185132354Sdfr *			lower values of @p _order appear first in @p
186132354Sdfr *			_dev's list of children
187132354Sdfr * @param _name		devclass name for new device or @c NULL if not
188132354Sdfr *			specified
189132354Sdfr * @param _unit		unit number for new device or @c -1 if not
190132354Sdfr *			specified
191132354Sdfr */
19247178SdfrMETHOD device_t add_child {
19395201Smarkm	device_t _dev;
19495201Smarkm	int _order;
19595201Smarkm	const char *_name;
19695201Smarkm	int _unit;
19747178Sdfr};
19847178Sdfr
199132354Sdfr/**
200132354Sdfr * @brief Allocate a system resource
201132354Sdfr *
202132354Sdfr * This method is called by child devices of a bus to allocate resources.
203132354Sdfr * The types are defined in <machine/resource.h>; the meaning of the
204132354Sdfr * resource-ID field varies from bus to bus (but @p *rid == 0 is always
205132354Sdfr * valid if the resource type is). If a resource was allocated and the
206132354Sdfr * caller did not use the RF_ACTIVE to specify that it should be
207132354Sdfr * activated immediately, the caller is responsible for calling
208132354Sdfr * BUS_ACTIVATE_RESOURCE() when it actually uses the resource.
209132354Sdfr *
210132354Sdfr * @param _dev		the parent device of @p _child
211132354Sdfr * @param _child	the device which is requesting an allocation
212132354Sdfr * @param _type		the type of resource to allocate
213132354Sdfr * @param _rid		a pointer to the resource identifier
214132354Sdfr * @param _start	hint at the start of the resource range - pass
215132354Sdfr *			@c 0UL for any start address
216132354Sdfr * @param _end		hint at the end of the resource range - pass
217132354Sdfr *			@c ~0UL for any end address
218132354Sdfr * @param _count	hint at the size of range required - pass @c 1
219132354Sdfr *			for any size
220132354Sdfr * @param _flags	any extra flags to control the resource
221132354Sdfr *			allocation - see @c RF_XXX flags in
222132354Sdfr *			<sys/rman.h> for details
223132354Sdfr * 
224132354Sdfr * @returns		the resource which was allocated or @c NULL if no
225132354Sdfr *			resource could be allocated
226132354Sdfr */
22741153SwollmanMETHOD struct resource * alloc_resource {
22895201Smarkm	device_t	_dev;
22995201Smarkm	device_t	_child;
23095201Smarkm	int		_type;
23195201Smarkm	int	       *_rid;
23295201Smarkm	u_long		_start;
23395201Smarkm	u_long		_end;
23495201Smarkm	u_long		_count;
23595201Smarkm	u_int		_flags;
23646913Sdfr} DEFAULT null_alloc_resource;
23737592Sdfr
238132354Sdfr/**
239132354Sdfr * @brief Activate a resource
240132354Sdfr *
241132354Sdfr * Activate a resource previously allocated with
242132354Sdfr * BUS_ALLOC_RESOURCE(). This may for instance map a memory region
243132354Sdfr * into the kernel's virtual address space.
244132354Sdfr *
245132354Sdfr * @param _dev		the parent device of @p _child
246132354Sdfr * @param _child	the device which allocated the resource
247132354Sdfr * @param _type		the type of resource
248132354Sdfr * @param _rid		the resource identifier
249132354Sdfr * @param _r		the resource to activate
250132354Sdfr */
25141153SwollmanMETHOD int activate_resource {
25295201Smarkm	device_t	_dev;
25395201Smarkm	device_t	_child;
25495201Smarkm	int		_type;
25595201Smarkm	int		_rid;
25695201Smarkm	struct resource *_r;
25741153Swollman};
25841153Swollman
259132354Sdfr/**
260132354Sdfr * @brief Deactivate a resource
261132354Sdfr *
262132354Sdfr * Deactivate a resource previously allocated with
263132354Sdfr * BUS_ALLOC_RESOURCE(). This may for instance unmap a memory region
264132354Sdfr * from the kernel's virtual address space.
265132354Sdfr *
266132354Sdfr * @param _dev		the parent device of @p _child
267132354Sdfr * @param _child	the device which allocated the resource
268132354Sdfr * @param _type		the type of resource
269132354Sdfr * @param _rid		the resource identifier
270132354Sdfr * @param _r		the resource to deactivate
271132354Sdfr */
27241153SwollmanMETHOD int deactivate_resource {
27395201Smarkm	device_t	_dev;
27495201Smarkm	device_t	_child;
27595201Smarkm	int		_type;
27695201Smarkm	int		_rid;
27795201Smarkm	struct resource *_r;
27841153Swollman};
27941153Swollman
280132354Sdfr/**
281132354Sdfr * @brief Release a resource
282132354Sdfr *
283132354Sdfr * Free a resource allocated by the BUS_ALLOC_RESOURCE.  The @p _rid
284132354Sdfr * value must be the same as the one returned by BUS_ALLOC_RESOURCE()
285132354Sdfr * (which is not necessarily the same as the one the client passed).
286132354Sdfr *
287132354Sdfr * @param _dev		the parent device of @p _child
288132354Sdfr * @param _child	the device which allocated the resource
289132354Sdfr * @param _type		the type of resource
290132354Sdfr * @param _rid		the resource identifier
291132354Sdfr * @param _r		the resource to release
292132354Sdfr */
29341153SwollmanMETHOD int release_resource {
29495201Smarkm	device_t	_dev;
29595201Smarkm	device_t	_child;
29695201Smarkm	int		_type;
29795201Smarkm	int		_rid;
29895201Smarkm	struct resource *_res;
29937592Sdfr};
30041153Swollman
301132354Sdfr/**
302132354Sdfr * @brief Install an interrupt handler
303132354Sdfr *
304132354Sdfr * This method is used to associate an interrupt handler function with
305132354Sdfr * an irq resource. When the interrupt triggers, the function @p _intr
306132354Sdfr * will be called with the value of @p _arg as its single
307132354Sdfr * argument. The value returned in @p *_cookiep is used to cancel the
308132354Sdfr * interrupt handler - the caller should save this value to use in a
309132354Sdfr * future call to BUS_TEARDOWN_INTR().
310132354Sdfr * 
311132354Sdfr * @param _dev		the parent device of @p _child
312132354Sdfr * @param _child	the device which allocated the resource
313132354Sdfr * @param _irq		the resource representing the interrupt
314132354Sdfr * @param _flags	a set of bits from enum intr_type specifying
315132354Sdfr *			the class of interrupt
316132354Sdfr * @param _intr		the function to call when the interrupt
317132354Sdfr *			triggers
318132354Sdfr * @param _arg		a value to use as the single argument in calls
319132354Sdfr *			to @p _intr
320132354Sdfr * @param _cookiep	a pointer to a location to recieve a cookie
321132354Sdfr *			value that may be used to remove the interrupt
322132354Sdfr *			handler
323132354Sdfr */
32441153SwollmanMETHOD int setup_intr {
32595201Smarkm	device_t	_dev;
32695201Smarkm	device_t	_child;
32795201Smarkm	struct resource *_irq;
32895201Smarkm	int		_flags;
32995201Smarkm	driver_intr_t	*_intr;
33095201Smarkm	void		*_arg;
33195201Smarkm	void		**_cookiep;
33241153Swollman};
33341153Swollman
334132354Sdfr/**
335132354Sdfr * @brief Uninstall an interrupt handler
336132354Sdfr *
337132354Sdfr * This method is used to disassociate an interrupt handler function
338132354Sdfr * with an irq resource. The value of @p _cookie must be the value
339132354Sdfr * returned from a previous call to BUS_SETUP_INTR().
340132354Sdfr * 
341132354Sdfr * @param _dev		the parent device of @p _child
342132354Sdfr * @param _child	the device which allocated the resource
343132354Sdfr * @param _irq		the resource representing the interrupt
344132354Sdfr * @param _cookie	the cookie value returned when the interrupt
345132354Sdfr *			was originally registered
346132354Sdfr */
34741153SwollmanMETHOD int teardown_intr {
34895201Smarkm	device_t	_dev;
34995201Smarkm	device_t	_child;
35095201Smarkm	struct resource	*_irq;
35195201Smarkm	void		*_cookie;
35241153Swollman};
35352174Sdfr
354132354Sdfr/**
355132354Sdfr * @brief Define a resource which can be allocated with
356132354Sdfr * BUS_ALLOC_RESOURCE().
357132354Sdfr *
358132354Sdfr * This method is used by some busses (typically ISA) to allow a
359132354Sdfr * driver to describe a resource range that it would like to
360132354Sdfr * allocate. The resource defined by @p _type and @p _rid is defined
361132354Sdfr * to start at @p _start and to include @p _count indices in its
362132354Sdfr * range.
363132354Sdfr * 
364132354Sdfr * @param _dev		the parent device of @p _child
365132354Sdfr * @param _child	the device which owns the resource
366132354Sdfr * @param _type		the type of resource
367132354Sdfr * @param _rid		the resource identifier
368132354Sdfr * @param _start	the start of the resource range
369132354Sdfr * @param _count	the size of the resource range
370132354Sdfr */
37152174SdfrMETHOD int set_resource {
37295201Smarkm	device_t	_dev;
37395201Smarkm	device_t	_child;
37495201Smarkm	int		_type;
37595201Smarkm	int		_rid;
37695201Smarkm	u_long		_start;
37795201Smarkm	u_long		_count;
37852174Sdfr};
37952174Sdfr
380132354Sdfr/**
381132354Sdfr * @brief Describe a resource
382132354Sdfr *
383132354Sdfr * This method allows a driver to examine the range used for a given
384132354Sdfr * resource without actually allocating it.
385132354Sdfr * 
386132354Sdfr * @param _dev		the parent device of @p _child
387132354Sdfr * @param _child	the device which owns the resource
388132354Sdfr * @param _type		the type of resource
389132354Sdfr * @param _rid		the resource identifier
390132354Sdfr * @param _start	the address of a location to recieve the start
391132354Sdfr *			index of the resource range
392132354Sdfr * @param _count	the address of a location to recieve the size
393132354Sdfr *			of the resource range
394132354Sdfr */
39552174SdfrMETHOD int get_resource {
39695201Smarkm	device_t	_dev;
39795201Smarkm	device_t	_child;
39895201Smarkm	int		_type;
39995201Smarkm	int		_rid;
40095201Smarkm	u_long		*_startp;
40195201Smarkm	u_long		*_countp;
40252174Sdfr};
40352174Sdfr
404132354Sdfr/**
405132354Sdfr * @brief Delete a resource.
406132354Sdfr * 
407132354Sdfr * Use this to delete a resource (possibly one previously added with
408132354Sdfr * BUS_SET_RESOURCE()).
409132354Sdfr * 
410132354Sdfr * @param _dev		the parent device of @p _child
411132354Sdfr * @param _child	the device which owns the resource
412132354Sdfr * @param _type		the type of resource
413132354Sdfr * @param _rid		the resource identifier
414132354Sdfr */
41552174SdfrMETHOD void delete_resource {
41695201Smarkm	device_t	_dev;
41795201Smarkm	device_t	_child;
41895201Smarkm	int		_type;
41995201Smarkm	int		_rid;
42052174Sdfr};
42167278Smdodd
422132354Sdfr/**
423132354Sdfr * @brief Return a struct resource_list.
424132354Sdfr *
425132354Sdfr * Used by drivers which use bus_generic_rl_alloc_resource() etc. to
426132354Sdfr * implement their resource handling. It should return the resource
427132354Sdfr * list of the given child device.
428132354Sdfr * 
429132354Sdfr * @param _dev		the parent device of @p _child
430132354Sdfr * @param _child	the device which owns the resource list
431132354Sdfr */
43269294SmdoddMETHOD struct resource_list * get_resource_list {
43395201Smarkm	device_t	_dev;
43495201Smarkm	device_t	_child;
43567278Smdodd} DEFAULT bus_generic_get_resource_list;
436100421Simp
437132354Sdfr/**
438132354Sdfr * @brief Is the hardware described by @p _child still attached to the
439132354Sdfr * system?
440132354Sdfr *
441133588Simp * This method should return 0 if the device is not present.  It
442133588Simp * should return -1 if it is present.  Any errors in determining
443133588Simp * should be returned as a normal errno value.  Client drivers are to
444133588Simp * assume that the device is present, even if there is an error
445133588Simp * determining if it is there.  Busses are to try to avoid returning
446133588Simp * errors, but newcard will return an error if the device fails to
447133588Simp * implement this method.
448132354Sdfr * 
449132354Sdfr * @param _dev		the parent device of @p _child
450132354Sdfr * @param _child	the device which is being examined
451132354Sdfr */
452100421SimpMETHOD int child_present {
453100421Simp	device_t	_dev;
454100421Simp	device_t	_child;
455100421Simp} DEFAULT bus_generic_child_present;
456104597Simp
457132354Sdfr/**
458132354Sdfr * @brief Returns the pnp info for this device.
459132354Sdfr *
460132354Sdfr * Return it as a string.  If the string is insufficient for the
461132354Sdfr * storage, then return EOVERFLOW.
462132354Sdfr * 
463132354Sdfr * @param _dev		the parent device of @p _child
464132354Sdfr * @param _child	the device which is being examined
465132354Sdfr * @param _buf		the address of a buffer to receive the pnp
466132354Sdfr *			string
467132354Sdfr * @param _buflen	the size of the buffer pointed to by @p _buf
468132354Sdfr */
469104597SimpMETHOD int child_pnpinfo_str {
470104597Simp	device_t	_dev;
471104597Simp	device_t	_child;
472104597Simp	char		*_buf;
473104597Simp	size_t		_buflen;
474104597Simp};
475104597Simp
476132354Sdfr/**
477132354Sdfr * @brief Returns the location for this device.
478132354Sdfr *
479132354Sdfr * Return it as a string.  If the string is insufficient for the
480132354Sdfr * storage, then return EOVERFLOW.
481132354Sdfr * 
482132354Sdfr * @param _dev		the parent device of @p _child
483132354Sdfr * @param _child	the device which is being examined
484132354Sdfr * @param _buf		the address of a buffer to receive the location
485132354Sdfr *			string
486132354Sdfr * @param _buflen	the size of the buffer pointed to by @p _buf
487132354Sdfr */
488104597SimpMETHOD int child_location_str {
489104597Simp	device_t	_dev;
490104597Simp	device_t	_child;
491104597Simp	char		*_buf;
492104597Simp	size_t		_buflen;
493104597Simp};
494119967Smarcel
495132354Sdfr/**
496132354Sdfr * @brief Allow (bus) drivers to specify the trigger mode and polarity
497132354Sdfr * of the specified interrupt.
498132354Sdfr * 
499132354Sdfr * @param _dev		the bus device
500132354Sdfr * @param _irq		the interrupt number to modify
501132354Sdfr * @param _trig		the trigger mode required
502132354Sdfr * @param _pol		the interrupt polarity required
503132354Sdfr */
504119967SmarcelMETHOD int config_intr {
505119967Smarcel	device_t	_dev;
506119967Smarcel	int		_irq;
507119967Smarcel	enum intr_trigger _trig;
508119967Smarcel	enum intr_polarity _pol;
509119967Smarcel} DEFAULT bus_generic_config_intr;
510160186Simp
511160186Simp/**
512160186Simp * @brief Notify a (bus) driver about a child that the hints mechanism
513160186Simp * believes it has discovered.
514160186Simp *
515160186Simp * The bus is responsible for then adding the child in the right order
516160186Simp * and discovering other things about the child.  The bus driver is
517160186Simp * free to ignore this hint, to do special things, etc.  It is all up
518160186Simp * to the bus driver to interpret.
519160186Simp *
520160186Simp * This method is only called in response to the parent bus asking for
521160186Simp * hinted devices to be enumerated.
522160186Simp *
523160186Simp * @param _dev		the bus device
524160186Simp * @param _dname	the name of the device w/o unit numbers
525160186Simp * @param _dunit	the unit number of the device
526160186Simp */
527160186SimpMETHOD void hinted_child {
528160186Simp	device_t	_dev;
529160186Simp	const char *	_dname;
530160186Simp	int		_dunit;
531160186Simp};
532161928Sjmg
533161928Sjmg/**
534161928Sjmg * @brief Returns bus_dma_tag_t for use w/ devices on the bus.
535161928Sjmg *
536161928Sjmg * @param _dev		the parent device of @p _child
537161928Sjmg * @param _child	the device to which the tag will belong
538161928Sjmg */
539161928SjmgMETHOD bus_dma_tag_t get_dma_tag {
540161928Sjmg	device_t	_dev;
541161928Sjmg	device_t	_child;
542161928Sjmg} DEFAULT bus_generic_get_dma_tag;
543