Deleted Added
full compact
proto_bus_pci.c (265055) proto_bus_pci.c (284079)
1/*-
2 * Copyright (c) 2014 Marcel Moolenaar
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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Marcel Moolenaar
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

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

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/proto/proto_bus_pci.c 265055 2014-04-28 17:58:40Z marcel $");
27__FBSDID("$FreeBSD: head/sys/dev/proto/proto_bus_pci.c 284079 2015-06-06 16:09:25Z marcel $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <machine/bus.h>

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

82{
83 struct proto_softc *sc;
84 struct resource *res;
85 int bar, rid, type;
86
87 sc = device_get_softc(dev);
88
89 proto_add_resource(sc, PROTO_RES_PCICFG, 0, NULL);
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <machine/bus.h>

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

82{
83 struct proto_softc *sc;
84 struct resource *res;
85 int bar, rid, type;
86
87 sc = device_get_softc(dev);
88
89 proto_add_resource(sc, PROTO_RES_PCICFG, 0, NULL);
90 proto_add_resource(sc, PROTO_RES_BUSDMA, 0, NULL);
90
91 for (bar = 0; bar < PCIR_MAX_BAR_0; bar++) {
92 rid = PCIR_BAR(bar);
93 type = SYS_RES_MEMORY;
94 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
95 if (res == NULL) {
96 type = SYS_RES_IOPORT;
97 res = bus_alloc_resource_any(dev, type, &rid,

--- 15 unchanged lines hidden ---
91
92 for (bar = 0; bar < PCIR_MAX_BAR_0; bar++) {
93 rid = PCIR_BAR(bar);
94 type = SYS_RES_MEMORY;
95 res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
96 if (res == NULL) {
97 type = SYS_RES_IOPORT;
98 res = bus_alloc_resource_any(dev, type, &rid,

--- 15 unchanged lines hidden ---