summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2000-10-22 04:46:56 +0000
committerWarner Losh <imp@FreeBSD.org>2000-10-22 04:46:56 +0000
commitfe8d027cd840d44a18aa0555dca0bc963ea58002 (patch)
treeb55c4c988b55620b066adf1e534b5ac50a8d1ddb
parent283a98302831e063f6ad2177a25de34173d2ee5c (diff)
Notes
-rw-r--r--sys/dev/pccard/pccard.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index f55614f694dc..2e44639cf3b5 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -301,6 +301,8 @@ pccard_function_init(struct pccard_function *pf)
struct resource_list *rl = &devi->resources;
struct resource *r = 0;
device_t bus;
+ int start;
+ int end;
if (pf->pf_flags & PFF_ENABLED)
panic("pccard_function_init: function is enabled");
@@ -313,22 +315,21 @@ pccard_function_init(struct pccard_function *pf)
cfe->iores[i] = NULL;
cfe->irqres = NULL;
for (i = 0; i < cfe->num_iospace; i++) {
- /* XXX kludge, need to not ignore start */
- /* XXX start is a hint here, so this would break */
- /* XXX modems */
- /* XXX ALSO: should just ask for the range 0 to */
- /* XXX 1 << decode bits - 1, so we have a layering */
- /* XXX violation now */
+ start = cfe->iospace[i].start;
+ if (start)
+ end = start + cfe->iospace[i].length - 1;
+ else
+ end = ~0;
cfe->iorid[i] = i;
r = cfe->iores[i] = bus_alloc_resource(bus,
- SYS_RES_IOPORT, &cfe->iorid[i], 0x100, 0x3ff,
- cfe->iospace[i].length, 0);
+ SYS_RES_IOPORT, &cfe->iorid[i], start, end,
+ cfe->iospace[i].length,
+ rman_make_alignment_flags(cfe->iospace[i].length));
if (cfe->iores[i] == 0)
goto not_this_one;
resource_list_add(rl, SYS_RES_IOPORT, cfe->iorid[i],
rman_get_start(r), rman_get_end(r),
cfe->iospace[i].length);
-
}
if (cfe->num_memspace > 0) {
goto not_this_one;
@@ -336,7 +337,7 @@ pccard_function_init(struct pccard_function *pf)
if (cfe->irqmask) {
cfe->irqrid = 0;
r = cfe->irqres = bus_alloc_resource(bus, SYS_RES_IRQ,
- &cfe->irqrid, 10, 12, 1, 0);
+ &cfe->irqrid, 0, ~0, 1, 0);
if (cfe->irqres == 0)
goto not_this_one;
resource_list_add(rl, SYS_RES_IRQ, cfe->irqrid,
@@ -347,6 +348,8 @@ pccard_function_init(struct pccard_function *pf)
pf->cfe = cfe;
break;
not_this_one:;
+ DEVPRVERBOSE((bus, "Allocation failed for cfe %d\n",
+ cfe->number));
/*
* Release resources that we partially allocated
* from this config entry.