Deleted Added
full compact
rp_pci.c (67882) rp_pci.c (69781)
1/*
2 * Copyright (c) Comtrol Corporation <support@comtrol.com>
3 * All rights reserved.
4 *
5 * PCI-specific part separated from:
6 * sys/i386/isa/rp.c,v 1.33 1999/09/28 11:45:27 phk Exp
7 *
8 * Redistribution and use in source and binary forms, with or without

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

27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
1/*
2 * Copyright (c) Comtrol Corporation <support@comtrol.com>
3 * All rights reserved.
4 *
5 * PCI-specific part separated from:
6 * sys/i386/isa/rp.c,v 1.33 1999/09/28 11:45:27 phk Exp
7 *
8 * Redistribution and use in source and binary forms, with or without

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

27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/dev/rp/rp_pci.c 67882 2000-10-29 13:57:19Z phk $
35 * $FreeBSD: head/sys/dev/rp/rp_pci.c 69781 2000-12-08 21:51:06Z dwmalone $
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/fcntl.h>
41#include <sys/malloc.h>
42#include <sys/tty.h>
43#include <sys/conf.h>

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

160 stcmd = pci_read_config(dev, PCIR_COMMAND, 4);
161 if ((stcmd & PCIM_CMD_PORTEN) == 0) {
162 stcmd |= (PCIM_CMD_PORTEN);
163 pci_write_config(dev, PCIR_COMMAND, 4, stcmd);
164 }
165
166 /* The IO ports of AIOPs for a PCI controller are continuous. */
167 ctlp->io_num = 1;
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/fcntl.h>
41#include <sys/malloc.h>
42#include <sys/tty.h>
43#include <sys/conf.h>

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

160 stcmd = pci_read_config(dev, PCIR_COMMAND, 4);
161 if ((stcmd & PCIM_CMD_PORTEN) == 0) {
162 stcmd |= (PCIM_CMD_PORTEN);
163 pci_write_config(dev, PCIR_COMMAND, 4, stcmd);
164 }
165
166 /* The IO ports of AIOPs for a PCI controller are continuous. */
167 ctlp->io_num = 1;
168 ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, M_DEVBUF, M_NOWAIT);
169 ctlp->io = malloc(sizeof(*(ctlp->io)) * ctlp->io_num, M_DEVBUF, M_NOWAIT);
168 ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, M_DEVBUF, M_NOWAIT | M_ZERO);
169 ctlp->io = malloc(sizeof(*(ctlp->io)) * ctlp->io_num, M_DEVBUF, M_NOWAIT | M_ZERO);
170 if (ctlp->io_rid == NULL || ctlp->io == NULL) {
171 device_printf(dev, "rp_pciattach: Out of memory.\n");
172 retval = ENOMEM;
173 goto nogo;
174 }
170 if (ctlp->io_rid == NULL || ctlp->io == NULL) {
171 device_printf(dev, "rp_pciattach: Out of memory.\n");
172 retval = ENOMEM;
173 goto nogo;
174 }
175 bzero(ctlp->io_rid, sizeof(*(ctlp->io_rid)) * ctlp->io_num);
176 bzero(ctlp->io, sizeof(*(ctlp->io)) * ctlp->io_num);
177
178 ctlp->bus_ctlp = NULL;
179
180 ctlp->io_rid[0] = 0x10;
181 ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 1, RF_ACTIVE);
182 if(ctlp->io[0] == NULL) {
183 device_printf(dev, "ioaddr mapping failed for RocketPort(PCI).\n");
184 retval = ENXIO;

--- 186 unchanged lines hidden ---
175
176 ctlp->bus_ctlp = NULL;
177
178 ctlp->io_rid[0] = 0x10;
179 ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 1, RF_ACTIVE);
180 if(ctlp->io[0] == NULL) {
181 device_printf(dev, "ioaddr mapping failed for RocketPort(PCI).\n");
182 retval = ENXIO;

--- 186 unchanged lines hidden ---