Deleted Added
sdiff udiff text old ( 131988 ) new ( 133588 )
full compact
1#
2# Copyright (c) 1998-2004 Doug Rabson
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
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

--- 7 unchanged lines hidden (view full) ---

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
24# SUCH DAMAGE.
25#
26# $FreeBSD: head/sys/kern/device_if.m 133588 2004-08-12 17:26:22Z imp $
27#
28
29#include <sys/bus.h>
30
31/**
32 * @defgroup DEVICE device - KObj methods for all device drivers
33 * @brief A basic set of methods required for all device drivers.
34 *

--- 95 unchanged lines hidden (view full) ---

130 * be returned to indicate the type of error
131 * @see DEVICE_ATTACH(), pci_get_vendor(), pci_get_device()
132 */
133METHOD int probe {
134 device_t dev;
135};
136
137/**
138 * @brief Allow a device driver to detect devices not otherwise enumerated.
139 *
140 * The DEVICE_IDENTIFY() method is used by some drivers (e.g. the ISA
141 * bus driver) to help populate the bus device with a useful set of
142 * child devices, normally by calling the BUS_ADD_CHILD() method of
143 * the parent device. For instance, the ISA bus driver uses several
144 * special drivers, including the isahint driver and the pnp driver to
145 * create child devices based on configuration hints and PnP bus
146 * probes respectively.
147 *
148 * Many bus drivers which support true plug-and-play do not need to
149 * use this method at all since child devices can be discovered
150 * automatically without help from child drivers.
151 *
152 * To include this method in a device driver, use a line like this
153 * in the driver's method list:
154 *
155 * @code
156 * KOBJMETHOD(device_identify, foo_identify)
157 * @endcode
158 *

--- 72 unchanged lines hidden (view full) ---

231 * KOBJMETHOD(device_shutdown, foo_shutdown)
232 * @endcode
233 */
234METHOD int shutdown {
235 device_t dev;
236} DEFAULT null_shutdown;
237
238/**
239 * @brief This is called by the power-management subsystem when a
240 * suspend has been requested by the user or by some automatic
241 * mechanism.
242 *
243 * This gives drivers a chance to veto the suspend or save their
244 * configuration before power is removed.
245 *
246 * To include this method in a device driver, use a line like this in
247 * the driver's method list:
248 *
249 * @code
250 * KOBJMETHOD(device_suspend, foo_suspend)
251 * @endcode
252 *
253 * @param dev the device being suspended
254 *
255 * @retval 0 success
256 * @retval non-zero an error occurred while attempting to prepare the
257 * device for suspension
258 *
259 * @see DEVICE_RESUME()
260 */
261METHOD int suspend {
262 device_t dev;
263} DEFAULT null_suspend;
264
265/**

--- 4 unchanged lines hidden (view full) ---

270 *
271 * @code
272 * KOBJMETHOD(device_resume, foo_resume)
273 * @endcode
274 *
275 * @param dev the device being resumed
276 *
277 * @retval 0 success
278 * @retval non-zero an error occurred while attempting to restore the
279 * device from suspension
280 *
281 * @see DEVICE_SUSPEND()
282 */
283METHOD int resume {
284 device_t dev;
285} DEFAULT null_resume;