summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-04-25 06:07:27 +0000
committerimp <imp@FreeBSD.org>2000-04-25 06:07:27 +0000
commit6d9518924557466716f03fe689edbf2f21724ffe (patch)
tree447c98056ac471b281ed5eebaa0cb5312e043410 /sys/pccard/pcic.c
parentdbdba2da0aac8e2917ff246e3c08414d91f39962 (diff)
downloadFreeBSD-src-6d9518924557466716f03fe689edbf2f21724ffe.zip
FreeBSD-src-6d9518924557466716f03fe689edbf2f21724ffe.tar.gz
Checkin my first batch of New Mexico changes:
o minor whitespace things (bad because this is also a functional commit) o Backport reading in of CIS entries from the driver level.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r--sys/pccard/pcic.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 6e76a4d..4755a02 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -270,9 +270,9 @@ pcic_io(struct slot *slt, int win)
*/
/*
- * VLSI 82C146 has incompatibilities about the I/O address
- * of slot 1. Assume it's the only PCIC whose vendor ID is 0x84,
- * contact Nate Williams <nate@FreeBSD.org> if incorrect.
+ * VLSI 82C146 has incompatibilities about the I/O address of slot 1.
+ * Assume it's the only PCIC whose vendor ID is 0x84,
+ * contact Warner Losh <imp@freebsd.org> if correct.
*/
static int
pcic_probe(device_t dev)
@@ -326,7 +326,7 @@ pcic_probe(device_t dev)
sp->index = rman_get_start(r);
sp->data = sp->index + 1;
sp->offset = slotnum * PCIC_SLOT_SIZE;
- /*
+ /*
* XXX - Screwed up slot 1 on the VLSI chips. According to
* the Linux PCMCIA code from David Hinds, working chipsets
* return 0x84 from their (correct) ID ports, while the broken
@@ -521,7 +521,7 @@ pcic_attach(device_t dev)
rid = 0;
r = 0;
if (irq >= 0) {
- r = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, irq,
+ r = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, irq,
~0, 1, RF_ACTIVE);
}
if (r) {
@@ -537,8 +537,7 @@ pcic_attach(device_t dev)
irq = 0;
}
if (irq == 0) {
- pcictimeout_ch = timeout(pcictimeout, (void *) GET_UNIT(dev),
- hz/2);
+ pcictimeout_ch = timeout(pcictimeout, (void *) GET_UNIT(dev), hz/2);
device_printf(dev, "Polling mode\n");
}
@@ -687,8 +686,7 @@ pcic_mapirq(struct slot *slt, int irq)
if (irq == 0)
clrb(sp, PCIC_INT_GEN, 0xF);
else
- sp->putb(sp, PCIC_INT_GEN,
- (sp->getb(sp, PCIC_INT_GEN) & 0xF0) | irq);
+ sp->putb(sp, PCIC_INT_GEN, (sp->getb(sp, PCIC_INT_GEN) & 0xF0) | irq);
}
/*
@@ -888,13 +886,13 @@ pcic_deactivate_resource(device_t dev, device_t child, int type, int rid,
}
static int
-pcic_setup_intr(device_t dev, device_t child, struct resource *irq,
+pcic_setup_intr(device_t dev, device_t child, struct resource *irq,
int flags, driver_intr_t *intr, void *arg, void **cookiep)
{
struct pccard_devinfo *devi = device_get_ivars(child);
int err;
- err = bus_generic_setup_intr(dev, child, irq, flags, intr, arg,
+ err = bus_generic_setup_intr(dev, child, irq, flags, intr, arg,
cookiep);
if (err == 0)
pcic_mapirq(devi->slt, rman_get_start(irq));
@@ -903,7 +901,7 @@ pcic_setup_intr(device_t dev, device_t child, struct resource *irq,
rman_get_start(irq));
return (err);
}
-
+
static int
pcic_teardown_intr(device_t dev, device_t child, struct resource *irq,
void *cookie)
@@ -937,16 +935,17 @@ pcic_set_res_flags(device_t bus, device_t child, int restype, int rid,
return (err);
}
-static struct resource *
-pcic_alloc_resource(device_t bus, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+static int
+pcic_get_res_flags(device_t bus, device_t child, int restype, int rid,
+ u_long *value)
{
- if (start == 0 && end == ~0 && type == SYS_RES_MEMORY && count != 1) {
- start = 0xd0000;
- end = 0xdffff;
- }
- return bus_generic_alloc_resource(bus, child, type, rid, start, end,
- count, flags);
+ return (EOPNOTSUPP);
+}
+
+static int
+pcic_set_memory_offset(device_t bus, device_t child, int rid, u_int32_t offset)
+{
+ return (EOPNOTSUPP);
}
static device_method_t pcic_methods[] = {
@@ -960,13 +959,18 @@ static device_method_t pcic_methods[] = {
/* Bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_alloc_resource, pcic_alloc_resource),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, pcic_activate_resource),
DEVMETHOD(bus_deactivate_resource, pcic_deactivate_resource),
DEVMETHOD(bus_setup_intr, pcic_setup_intr),
DEVMETHOD(bus_teardown_intr, pcic_teardown_intr),
+ /* Card interface */
+ DEVMETHOD(card_set_res_flags, pcic_set_res_flags),
+ DEVMETHOD(card_get_res_flags, pcic_get_res_flags),
+ DEVMETHOD(card_set_memory_offset, pcic_set_memory_offset),
+
{ 0, 0 }
};
OpenPOWER on IntegriCloud