device_if.m (133588) | device_if.m (139507) |
---|---|
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 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# | 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 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 $ | 26# $FreeBSD: head/sys/kern/device_if.m 139507 2004-12-31 20:47:51Z 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 * --- 17 unchanged lines hidden (view full) --- 52 { 53 return 0; 54 } 55 56 static int null_resume(device_t dev) 57 { 58 return 0; 59 } | 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 * --- 17 unchanged lines hidden (view full) --- 52 { 53 return 0; 54 } 55 56 static int null_resume(device_t dev) 57 { 58 return 0; 59 } |
60 61 static int null_quiesce(device_t dev) 62 { 63 return EOPNOTSUPP; 64 } |
|
60}; 61 62/** 63 * @brief Probe to see if a device matches a driver. 64 * 65 * Users should not call this method directly. Normally, this 66 * is called via device_probe_and_attach() to select a driver 67 * calling the DEVICE_PROBE() of all candidate drivers and attach --- 210 unchanged lines hidden (view full) --- 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; | 65}; 66 67/** 68 * @brief Probe to see if a device matches a driver. 69 * 70 * Users should not call this method directly. Normally, this 71 * is called via device_probe_and_attach() to select a driver 72 * calling the DEVICE_PROBE() of all candidate drivers and attach --- 210 unchanged lines hidden (view full) --- 283 * @retval non-zero an error occurred while attempting to restore the 284 * device from suspension 285 * 286 * @see DEVICE_SUSPEND() 287 */ 288METHOD int resume { 289 device_t dev; 290} DEFAULT null_resume; |
291 292/** 293 * @brief This is called when the driver is asked to quiesce itself. 294 * 295 * The driver should arrange for the orderly shutdown of this device. 296 * All further access to the device should be curtailed. Soon there 297 * will be a request to detach, but there won't necessarily be one. 298 * 299 * To include this method in a device driver, use a line like this 300 * in the driver's method list: 301 * 302 * @code 303 * KOBJMETHOD(device_quiesce, foo_quiesce) 304 * @endcode 305 * 306 * @param dev the device being quiesced 307 * 308 * @retval 0 success 309 * @retval non-zero an error occurred while attempting to quiesce the 310 * device 311 * 312 * @see DEVICE_DETACH() 313 */ 314METHOD int quiesce { 315 device_t dev; 316} DEFAULT null_quiesce; |
|