summaryrefslogtreecommitdiffstats
path: root/sys/dev/exca
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-01-11 00:32:43 +0000
committerimp <imp@FreeBSD.org>2005-01-11 00:32:43 +0000
commitc55a14c5796e65896cc9cf3676fec224809e5cac (patch)
tree44679a8fcf211975f0e223aa69be1943d9e19042 /sys/dev/exca
parenteabaebb00d94c46305574d74a8c892a0620a067c (diff)
downloadFreeBSD-src-c55a14c5796e65896cc9cf3676fec224809e5cac.zip
FreeBSD-src-c55a14c5796e65896cc9cf3676fec224809e5cac.tar.gz
Properly calculate the offset in mapping the memory of pccards. This
allows my 3com cards to work again. It appears that this code was once there, but I removed it when I added the alignment issues. MFC After: 5 days PR: 70639 (and likely others)
Diffstat (limited to 'sys/dev/exca')
-rw-r--r--sys/dev/exca/exca.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c
index 2ef4f89..3700cbd 100644
--- a/sys/dev/exca/exca.c
+++ b/sys/dev/exca/exca.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 M Warner Losh. All rights reserved.
+ * Copyright (c) 2002-2005 M Warner Losh. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -180,9 +180,12 @@ exca_do_mem_map(struct exca_softc *sc, int win)
{
struct mem_map_index_st *map;
struct pccard_mem_handle *mem;
+ uint32_t offset;
map = &mem_map_index[win];
mem = &sc->mem[win];
+ offset = ((mem->cardaddr >> EXCA_CARDMEM_ADDRX_SHIFT) -
+ (mem->addr >> EXCA_SYSMEM_ADDRX_SHIFT)) & 0x3fff;
exca_putb(sc, map->sysmem_start_lsb,
(mem->addr >> EXCA_SYSMEM_ADDRX_SHIFT) & 0xff);
exca_putb(sc, map->sysmem_start_msb,
@@ -201,10 +204,8 @@ exca_do_mem_map(struct exca_softc *sc, int win)
exca_putb(sc, map->sysmem_win,
(mem->addr >> EXCA_MEMREG_WIN_SHIFT) & 0xff);
- exca_putb(sc, map->cardmem_lsb,
- (mem->cardaddr >> EXCA_CARDMEM_ADDRX_SHIFT) & 0xff);
- exca_putb(sc, map->cardmem_msb,
- ((mem->cardaddr >> (EXCA_CARDMEM_ADDRX_SHIFT + 8)) &
+ exca_putb(sc, map->cardmem_lsb, offset & 0xff);
+ exca_putb(sc, map->cardmem_msb, (((offset >> 8) & 0xff) &
EXCA_CARDMEM_ADDRX_MSB_ADDR_MASK) |
((mem->kind == PCCARD_A_MEM_ATTR) ?
EXCA_CARDMEM_ADDRX_MSB_REGACTIVE_ATTR : 0));
OpenPOWER on IntegriCloud