Deleted Added
full compact
subr_bus.c (209104) subr_bus.c (209390)
1/*-
2 * Copyright (c) 1997,1998,2003 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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997,1998,2003 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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/subr_bus.c 209104 2010-06-12 13:20:38Z kib $");
28__FBSDID("$FreeBSD: head/sys/kern/subr_bus.c 209390 2010-06-21 09:55:56Z ed $");
29
30#include "opt_bus.h"
31
32#include <sys/param.h>
33#include <sys/conf.h>
34#include <sys/filio.h>
35#include <sys/lock.h>
36#include <sys/kernel.h>

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

115 */
116 driver_t *driver; /**< current driver */
117 devclass_t devclass; /**< current device class */
118 int unit; /**< current unit number */
119 char* nameunit; /**< name+unit e.g. foodev0 */
120 char* desc; /**< driver specific description */
121 int busy; /**< count of calls to device_busy() */
122 device_state_t state; /**< current device state */
29
30#include "opt_bus.h"
31
32#include <sys/param.h>
33#include <sys/conf.h>
34#include <sys/filio.h>
35#include <sys/lock.h>
36#include <sys/kernel.h>

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

115 */
116 driver_t *driver; /**< current driver */
117 devclass_t devclass; /**< current device class */
118 int unit; /**< current unit number */
119 char* nameunit; /**< name+unit e.g. foodev0 */
120 char* desc; /**< driver specific description */
121 int busy; /**< count of calls to device_busy() */
122 device_state_t state; /**< current device state */
123 u_int32_t devflags; /**< api level flags for device_get_flags() */
123 uint32_t devflags; /**< api level flags for device_get_flags() */
124 u_short flags; /**< internal device flags */
125#define DF_ENABLED 1 /* device should be probed/attached */
126#define DF_FIXEDCLASS 2 /* devclass specified at create time */
127#define DF_WILDCARD 4 /* unit was originally wildcard */
128#define DF_DESCMALLOCED 8 /* description was malloced */
129#define DF_QUIET 16 /* don't print verbose attach message */
130#define DF_DONENOMATCH 32 /* don't execute DEVICE_NOMATCH again */
131#define DF_EXTERNALSOFTC 64 /* softc not allocated by us */

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

2202device_get_desc(device_t dev)
2203{
2204 return (dev->desc);
2205}
2206
2207/**
2208 * @brief Return the device's flags
2209 */
124 u_short flags; /**< internal device flags */
125#define DF_ENABLED 1 /* device should be probed/attached */
126#define DF_FIXEDCLASS 2 /* devclass specified at create time */
127#define DF_WILDCARD 4 /* unit was originally wildcard */
128#define DF_DESCMALLOCED 8 /* description was malloced */
129#define DF_QUIET 16 /* don't print verbose attach message */
130#define DF_DONENOMATCH 32 /* don't execute DEVICE_NOMATCH again */
131#define DF_EXTERNALSOFTC 64 /* softc not allocated by us */

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

2202device_get_desc(device_t dev)
2203{
2204 return (dev->desc);
2205}
2206
2207/**
2208 * @brief Return the device's flags
2209 */
2210u_int32_t
2210uint32_t
2211device_get_flags(device_t dev)
2212{
2213 return (dev->devflags);
2214}
2215
2216struct sysctl_ctx_list *
2217device_get_sysctl_ctx(device_t dev)
2218{

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

2310{
2311 device_set_desc_internal(dev, desc, TRUE);
2312}
2313
2314/**
2315 * @brief Set the device's flags
2316 */
2317void
2211device_get_flags(device_t dev)
2212{
2213 return (dev->devflags);
2214}
2215
2216struct sysctl_ctx_list *
2217device_get_sysctl_ctx(device_t dev)
2218{

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

2310{
2311 device_set_desc_internal(dev, desc, TRUE);
2312}
2313
2314/**
2315 * @brief Set the device's flags
2316 */
2317void
2318device_set_flags(device_t dev, u_int32_t flags)
2318device_set_flags(device_t dev, uint32_t flags)
2319{
2320 dev->devflags = flags;
2321}
2322
2323/**
2324 * @brief Return the device's softc field
2325 *
2326 * The softc is allocated and zeroed when a driver is attached, based

--- 2355 unchanged lines hidden ---
2319{
2320 dev->devflags = flags;
2321}
2322
2323/**
2324 * @brief Return the device's softc field
2325 *
2326 * The softc is allocated and zeroed when a driver is attached, based

--- 2355 unchanged lines hidden ---