Deleted Added
full compact
pci.c (143669) pci.c (143785)
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000, BSDi
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000, BSDi
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/pci/pci.c 143669 2005-03-15 22:53:31Z imp $");
30__FBSDID("$FreeBSD: head/sys/dev/pci/pci.c 143785 2005-03-18 05:19:50Z imp $");
31
32#include "opt_bus.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/malloc.h>
37#include <sys/module.h>
38#include <sys/linker.h>

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

995void
996pci_add_child(device_t bus, struct pci_devinfo *dinfo)
997{
998 device_t pcib;
999
1000 pcib = device_get_parent(bus);
1001 dinfo->cfg.dev = device_add_child(bus, NULL, -1);
1002 device_set_ivars(dinfo->cfg.dev, dinfo);
31
32#include "opt_bus.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/malloc.h>
37#include <sys/module.h>
38#include <sys/linker.h>

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

995void
996pci_add_child(device_t bus, struct pci_devinfo *dinfo)
997{
998 device_t pcib;
999
1000 pcib = device_get_parent(bus);
1001 dinfo->cfg.dev = device_add_child(bus, NULL, -1);
1002 device_set_ivars(dinfo->cfg.dev, dinfo);
1003 resource_list_init(&dinfo->resources);
1003 pci_cfg_save(dinfo->cfg.dev, dinfo, 0);
1004 pci_cfg_restore(dinfo->cfg.dev, dinfo);
1005 pci_add_resources(pcib, bus, dinfo->cfg.dev);
1006 pci_print_verbose(dinfo);
1007}
1008
1009static int
1010pci_probe(device_t dev)

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

1148 DEVICE_IDENTIFY(driver, dev);
1149 device_get_children(dev, &devlist, &numdevs);
1150 for (i = 0; i < numdevs; i++) {
1151 child = devlist[i];
1152 if (device_get_state(child) != DS_NOTPRESENT)
1153 continue;
1154 dinfo = device_get_ivars(child);
1155 pci_print_verbose(dinfo);
1004 pci_cfg_save(dinfo->cfg.dev, dinfo, 0);
1005 pci_cfg_restore(dinfo->cfg.dev, dinfo);
1006 pci_add_resources(pcib, bus, dinfo->cfg.dev);
1007 pci_print_verbose(dinfo);
1008}
1009
1010static int
1011pci_probe(device_t dev)

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

1149 DEVICE_IDENTIFY(driver, dev);
1150 device_get_children(dev, &devlist, &numdevs);
1151 for (i = 0; i < numdevs; i++) {
1152 child = devlist[i];
1153 if (device_get_state(child) != DS_NOTPRESENT)
1154 continue;
1155 dinfo = device_get_ivars(child);
1156 pci_print_verbose(dinfo);
1156/*XXX???*/ /* resource_list_init(&dinfo->cfg.resources); */
1157 if (bootverbose)
1158 printf("pci%d:%d:%d: reprobing on driver added\n",
1159 dinfo->cfg.bus, dinfo->cfg.slot, dinfo->cfg.func);
1160 pci_cfg_restore(child, dinfo);
1161 if (device_probe_and_attach(child) != 0)
1162 pci_cfg_save(child, dinfo, 1);
1163 }
1164 free(devlist, M_TEMP);

--- 812 unchanged lines hidden ---
1157 if (bootverbose)
1158 printf("pci%d:%d:%d: reprobing on driver added\n",
1159 dinfo->cfg.bus, dinfo->cfg.slot, dinfo->cfg.func);
1160 pci_cfg_restore(child, dinfo);
1161 if (device_probe_and_attach(child) != 0)
1162 pci_cfg_save(child, dinfo, 1);
1163 }
1164 free(devlist, M_TEMP);

--- 812 unchanged lines hidden ---