Some PCMCIA (PC Card) does not detected in NEWCARD code. Fix: This patch correct? With best regards, Andrew Belashov.--KeGKzWut0knP5ouV3LRlKtUtJEjnngbSIFSUGxt9Kiu6TPM1 Content-Type: text/plain; name="exca.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exca.c.diff" --- sys/dev/exca/exca.c.orig Tue Oct 7 08:29:04 2003 +++ sys/dev/exca/exca.c Thu Jul 15 22:51:02 2004 @@ -180,9 +180,12 @@ { 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,9 +204,9 @@ (mem->addr >> EXCA_MEMREG_WIN_SHIFT) & 0xff); exca_putb(sc, map->cardmem_lsb, - (mem->cardaddr >> EXCA_CARDMEM_ADDRX_SHIFT) & 0xff); + offset & 0xff); exca_putb(sc, map->cardmem_msb, - ((mem->cardaddr >> (EXCA_CARDMEM_ADDRX_SHIFT + 8)) & + ((offset >> 8) & EXCA_CARDMEM_ADDRX_MSB_ADDR_MASK) | ((mem->kind == PCCARD_A_MEM_ATTR) ? EXCA_CARDMEM_ADDRX_MSB_REGACTIVE_ATTR : 0)); How-To-Repeat: Insert card. Card does not detected. Messages on console: ---------------------------------------------------- pccard0: read_cis exca_mem_map window 0 bus 88010000+1000 card addr 0 common memory exca_do_mem_map window 0: 0010 8010 0000 88 (88010000+00001000.00001000*00000000 ) attribtue memory exca_do_mem_map window 0: 0010 8010 4000 88 (88010000+00001000.00001000*00000000 ) [...] pccard0: CIS tuple chain: unhandled CISTPL 40 40 00 CISTPL_NONE 00 CISTPL_NONE 00 [...] pccard0: Card has no functions! cbb0: PC Card card activation failed ----------------------------------------------------
I have following PC Card: 3Com Etherlink III 3C589D Ninja-ATA CD-ROM Drive Nokia Cellular Data Card DTP-2 ver II Cardinal MVP144C2 FAX MODEM All cards working with this patch.
Responsible Changed From-To: freebsd-bugs->imp Over to imp, who wrote exca
Hello, Warner! Current source code still have hidden bug in exca driver. To reproduce problem I use two PCMCIA card or set up "hw.cbb.start_memory" sysctl variable. For example: # sysctl hw.cbb.start_memory=0x88010000 The problem arises, when the mapped start address (for CIS or CCR) in not align to full address space of card. This is true for some cards (for example 3Com 3C589D). Expanded patch attached. Note: Patch is not tested on memory cards. -- Best regards, Andrew Belashov.
State Changed From-To: open->closed Committed the offset patch, but not the pccard_cis patch because it doesn't seem to be needed.