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 131988 2004-07-11 16:17:42Z dfr $
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 Called by a parent device to allow drivers to add new devices to the parent.
139 *
140 * The DEVICE_IDENTIFY() method is used by some drivers (e.g. the ISA bus driver)
141 * to help populate the bus device with a useful set of child devices, normally by
142 * calling the BUS_ADD_CHILD() method of the parent device. For instance,
143 * the ISA bus driver uses several special drivers, including the isahint driver and
144 * the pnp driver to create child devices based on configuration hints and PnP bus
145 * probes respectively.
146 *
147 * Many bus drivers which support true plug-and-play do not need to use this method
148 * at all since child devices can be discovered automatically without help from
149 * child drivers.
150 *
151 * To include this method in a device driver, use a line like this
152 * in the driver's method list:
153 *
154 * @code
155 * KOBJMETHOD(device_identify, foo_identify)
156 * @endcode
157 *

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

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

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

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