summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2010-09-04 13:13:17 +0000
committermiod <miod@openbsd.org>2010-09-04 13:13:17 +0000
commitbdc49634c8ddc77e19713b7c944da76c710e303f (patch)
treeae7e2767dbae48f33039c284c189a66d34c81852
parentAdd support for indirect CIS data (CISTPL_INDIRECT tuple). (diff)
downloadwireguard-openbsd-bdc49634c8ddc77e19713b7c944da76c710e303f.tar.xz
wireguard-openbsd-bdc49634c8ddc77e19713b7c944da76c710e303f.zip
Use pcmcia_cis_read_1() to read cis data to be checksummed, instead of
trying to roll our inline version of it and fail. Fixes `checksum error' warnings on all the cards with checksum tuples I could find (admittedly not many), and probably fixes all of them since this code has never been correct in the first place.
-rw-r--r--sys/dev/pcmcia/pcmcia_cis.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c
index de0e9f436d8..69abedc8e82 100644
--- a/sys/dev/pcmcia/pcmcia_cis.c
+++ b/sys/dev/pcmcia/pcmcia_cis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia_cis.c,v 1.16 2010/09/04 12:59:27 miod Exp $ */
+/* $OpenBSD: pcmcia_cis.c,v 1.17 2010/09/04 13:13:17 miod Exp $ */
/* $NetBSD: pcmcia_cis.c,v 1.9 1998/08/22 23:41:48 msaitoh Exp $ */
/*
@@ -280,10 +280,8 @@ pcmcia_scan_cis(dev, fct, arg)
}
sum = 0;
for (i = 0; i < length; i++)
- sum +=
- bus_space_read_1(tuple.memt,
- tuple.memh, addr +
- (i << tuple.addrshift));
+ sum += pcmcia_cis_read_1(&tuple,
+ addr + i);
if (cksum != (sum & 0xff)) {
DPRINTF((" failed sum=%x\n",
sum));