Deleted Added
full compact
pcii.c (202870) pcii.c (202898)
1/*-
2 * Copyright (c) 2005 Poul-Henning Kamp <phk@FreeBSD.org>
3 * Copyright (c) 2010 Joerg Wunsch <joerg@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

35 * Tested and known working:
36 * "B&C Microsystems PC488A-0"
37 * "National Instruments GPIB-PCII/PCIIA" (in PCIIa mode)
38 * "Axiom AX5488"
39 *
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 Poul-Henning Kamp <phk@FreeBSD.org>
3 * Copyright (c) 2010 Joerg Wunsch <joerg@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

35 * Tested and known working:
36 * "B&C Microsystems PC488A-0"
37 * "National Instruments GPIB-PCII/PCIIA" (in PCIIa mode)
38 * "Axiom AX5488"
39 *
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/dev/ieee488/pcii.c 202870 2010-01-23 07:54:06Z joerg $");
43__FBSDID("$FreeBSD: head/sys/dev/ieee488/pcii.c 202898 2010-01-23 21:33:33Z joerg $");
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/lock.h>
48#include <sys/mutex.h>
49#include <sys/kernel.h>
50#include <sys/module.h>
51#include <sys/bus.h>

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

133 *
134 * Usually, the user will only set the base address in the
135 * device hints, so we handle the rest here.
136 *
137 * (Source: GPIB-PCIIA Technical Reference Manual, September
138 * 1989 Edition, National Instruments.)
139 */
140 if ((start & 0x3ff) != 0x2e1) {
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/lock.h>
48#include <sys/mutex.h>
49#include <sys/kernel.h>
50#include <sys/module.h>
51#include <sys/bus.h>

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

133 *
134 * Usually, the user will only set the base address in the
135 * device hints, so we handle the rest here.
136 *
137 * (Source: GPIB-PCIIA Technical Reference Manual, September
138 * 1989 Edition, National Instruments.)
139 */
140 if ((start & 0x3ff) != 0x2e1) {
141 printf("pcii_probe: PCIIA base address 0x%lx not "
142 "0x2e1/0x22e1/0x42e1/0x62e1\n",
143 start);
141 if (bootverbose)
142 printf("pcii_probe: PCIIA base address 0x%lx not "
143 "0x2e1/0x22e1/0x42e1/0x62e1\n",
144 start);
144 return (ENXIO);
145 }
146
147 for (rid = 0, addr = start; rid < 8; rid++, addr += 0x400) {
148 if (bus_set_resource(dev, SYS_RES_IOPORT, rid, addr, 1) != 0) {
149 printf("pcii_probe: could not set IO port 0x%lx\n",
150 addr);
151 return (ENXIO);

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

229 upd7210intr, &sc->upd7210, &sc->intr_handler);
230 if (error) {
231 bus_release_resources(dev, pcii_res_spec, sc->res);
232 return (error);
233 }
234
235 for (rid = 0; rid < 8; rid++) {
236 sc->upd7210.reg_res[rid] = sc->res[2 + rid];
145 return (ENXIO);
146 }
147
148 for (rid = 0, addr = start; rid < 8; rid++, addr += 0x400) {
149 if (bus_set_resource(dev, SYS_RES_IOPORT, rid, addr, 1) != 0) {
150 printf("pcii_probe: could not set IO port 0x%lx\n",
151 addr);
152 return (ENXIO);

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

230 upd7210intr, &sc->upd7210, &sc->intr_handler);
231 if (error) {
232 bus_release_resources(dev, pcii_res_spec, sc->res);
233 return (error);
234 }
235
236 for (rid = 0; rid < 8; rid++) {
237 sc->upd7210.reg_res[rid] = sc->res[2 + rid];
238 sc->upd7210.reg_offset[rid] = 0;
237 }
238 sc->upd7210.irq_clear_res = sc->res[10];
239
240 if (sc->res[1] == NULL)
241 sc->upd7210.dmachan = -1;
242 else
243 sc->upd7210.dmachan = rman_get_start(sc->res[1]);
244
245 upd7210attach(&sc->upd7210);
246 return (error);
247}
248
249DRIVER_MODULE(pcii, isa, pcii_driver, pcii_devclass, 0, 0);
250DRIVER_MODULE(pcii, acpi, pcii_driver, pcii_devclass, 0, 0);
239 }
240 sc->upd7210.irq_clear_res = sc->res[10];
241
242 if (sc->res[1] == NULL)
243 sc->upd7210.dmachan = -1;
244 else
245 sc->upd7210.dmachan = rman_get_start(sc->res[1]);
246
247 upd7210attach(&sc->upd7210);
248 return (error);
249}
250
251DRIVER_MODULE(pcii, isa, pcii_driver, pcii_devclass, 0, 0);
252DRIVER_MODULE(pcii, acpi, pcii_driver, pcii_devclass, 0, 0);