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 253346 2013-07-15 01:32:55Z rodrigc $"); |
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> --- 11 unchanged lines hidden (view full) --- 48#include <sys/selinfo.h> 49#include <sys/signalvar.h> 50#include <sys/sysctl.h> 51#include <sys/systm.h> 52#include <sys/uio.h> 53#include <sys/bus.h> 54#include <sys/interrupt.h> 55 |
56#include <net/vnet.h> 57 |
58#include <machine/stdarg.h> 59 60#include <vm/uma.h> 61 62SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL); 63SYSCTL_NODE(, OID_AUTO, dev, CTLFLAG_RW, NULL, NULL); 64 65/* --- 2666 unchanged lines hidden (view full) --- 2732 2733 GIANT_REQUIRED; 2734 2735 error = device_probe(dev); 2736 if (error == -1) 2737 return (0); 2738 else if (error != 0) 2739 return (error); |
2740 2741 CURVNET_SET_QUIET(vnet0); 2742 error = device_attach(dev); 2743 CURVNET_RESTORE(); 2744 return error; |
2745} 2746 2747/** 2748 * @brief Attach a device driver to a device 2749 * 2750 * This function is a wrapper around the DEVICE_ATTACH() driver 2751 * method. In addition to calling DEVICE_ATTACH(), it initialises the 2752 * device's sysctl tree, optionally prints a description of the device --- 2133 unchanged lines hidden --- |