diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1997-08-19 21:59:51 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1997-08-19 21:59:51 +0000 |
commit | 58683c2995a3c2d72798ae5e73272303a4641c8e (patch) | |
tree | c2f75af7b85d16d03b51b02be71605571e9870f6 /sys/dev/pcmcia/pcmcia.c | |
parent | cc4b39d6bf3566f38e2ca2443bc3efdd9288f6f4 (diff) |
- add wavelan files in files.pcmcia
- accept version 5.0 from the card as legal
- fix the mapping (pcmcia.c, pcmcia_read_cis())
Diffstat (limited to 'sys/dev/pcmcia/pcmcia.c')
-rw-r--r-- | sys/dev/pcmcia/pcmcia.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/pcmcia/pcmcia.c b/sys/dev/pcmcia/pcmcia.c index dacf4250e70..16a80a669bd 100644 --- a/sys/dev/pcmcia/pcmcia.c +++ b/sys/dev/pcmcia/pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia.c,v 1.9 1997/04/17 08:21:12 niklas Exp $ */ +/* $OpenBSD: pcmcia.c,v 1.10 1997/08/19 21:59:49 angelos Exp $ */ /* * Copyright (c) 1996 John T. Kohl. All rights reserved. @@ -853,6 +853,10 @@ pcmcia_read_cis(link, scratch, offs, len) u_char *p = SCRATCH_MEM(pca); int size = SCRATCH_SIZE(pca); volatile int *inuse = &SCRATCH_INUSE(pca); + int pgoff = offs / size; + int toff; + + toff = offs - (pgoff * size); PPRINTF(("- pcmcia_read_cis: mem %p size %d\n", p, size)); if (pca == NULL) @@ -865,9 +869,7 @@ pcmcia_read_cis(link, scratch, offs, len) splx(s); while (len > 0) { - int pgoff = offs / size; - int toff = offs - (pgoff * size); - int tlen = min(len + toff, size / 2) - toff; + int tlen = min(len, (size - toff) / 2); int i; if ((err = PCMCIA_MAP_MEM(pca, link, pca->pa_memt, p, pgoff, @@ -884,6 +886,8 @@ pcmcia_read_cis(link, scratch, offs, len) PCMCIA_MAP_MEM(pca, link, pca->pa_memt, p, 0, size, PCMCIA_LAST_WIN | PCMCIA_UNMAP); len -= tlen; + pgoff++; + toff = 0; } error: s = splbio(); |