summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1997-08-19 21:59:51 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1997-08-19 21:59:51 +0000
commit58683c2995a3c2d72798ae5e73272303a4641c8e (patch)
treec2f75af7b85d16d03b51b02be71605571e9870f6 /sys/dev
parentcc4b39d6bf3566f38e2ca2443bc3efdd9288f6f4 (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')
-rw-r--r--sys/dev/pcmcia/files.pcmcia7
-rw-r--r--sys/dev/pcmcia/pcmcia.c12
-rw-r--r--sys/dev/pcmcia/pcmcia_conf.c5
3 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/pcmcia/files.pcmcia b/sys/dev/pcmcia/files.pcmcia
index aed8e876568..725632921de 100644
--- a/sys/dev/pcmcia/files.pcmcia
+++ b/sys/dev/pcmcia/files.pcmcia
@@ -1,5 +1,5 @@
-# $OpenBSD: files.pcmcia,v 1.6 1996/11/30 13:39:25 niklas Exp $
-# $Id: files.pcmcia,v 1.6 1996/11/30 13:39:25 niklas Exp $
+# $OpenBSD: files.pcmcia,v 1.7 1997/08/19 21:59:49 angelos Exp $
+# $Id: files.pcmcia,v 1.7 1997/08/19 21:59:49 angelos Exp $
#
# Config.new file and device description for machine-independent PCMCIA code.
# Included by ports that need it.
@@ -28,3 +28,6 @@ file dev/pcmcia/com_pcmcia.c com_pcmcia
# device declaration in sys/conf/files
attach ep at pcmcia with ep_pcmcia
file dev/pcmcia/if_ep_pcmcia.c ep_pcmcia
+
+attach wlp at pcmcia with wlp_pcmcia
+file dev/pcmcia/if_wlp_pcmcia.c wlp_pcmcia
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();
diff --git a/sys/dev/pcmcia/pcmcia_conf.c b/sys/dev/pcmcia/pcmcia_conf.c
index 754ae667371..d7b07b5aec7 100644
--- a/sys/dev/pcmcia/pcmcia_conf.c
+++ b/sys/dev/pcmcia/pcmcia_conf.c
@@ -1,4 +1,4 @@
-/* $Id: pcmcia_conf.c,v 1.4 1996/08/31 18:01:02 deraadt Exp $ */
+/* $Id: pcmcia_conf.c,v 1.5 1997/08/19 21:59:50 angelos Exp $ */
/*
* Copyright (c) 1996 John T. Kohl. All rights reserved.
* Copyright (c) 1994 Stefan Grefen. All rights reserved.
@@ -502,7 +502,8 @@ pcmcia_get_cisver1(pc_link, data, len, manu, model, add_inf1, add_inf2)
u_char *pp = p + 2;
maj = *pp++;
min = *pp++;
- if (maj != 4 || min != 1) {
+ if ((maj != 4 || min != 1) &&
+ (maj != 5 || min != 0)) {
printf("wrong version id %d.%d for card in slot %d\n",
maj, min, pc_link->slot);
return ENODEV;