1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-08 08:27:00 +00:00

Improve support of MFC cards (Multi-function cards). This commit

allows us to properly parse cards with attribute memory based CIS that
before wouldn't parse correctly, sometimes with a panic.  This allows
me to get my 3C562 modem/ethernet card to fail to attach due to
problems in the ep and sio drivers rather than due to problems in the
CIS parsing code :-).

We weren't setting the address to jump to for the function entries.
This caused us to only work when the addional entries were after the
first ones.  On the 3C562/3C563 card this was not the case.

We were also mapping Attribute memory when common memory was asked for
in the target of the LONGLINK_{A,C} or LONGLINK_MFC.

My IBM Home And Away Modem/LAN card still fails for reasons unknown.
This commit is contained in:
Warner Losh 2002-03-29 08:05:39 +00:00
parent 7fc55739a7
commit 4e4b1656c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93370

View File

@ -335,21 +335,23 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
if (longlink_present) {
CARD_SET_RES_FLAGS(device_get_parent(dev), dev,
SYS_RES_MEMORY, rid, longlink_common ?
PCCARD_A_MEM_ATTR : PCCARD_A_MEM_ATTR);
PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR);
DPRINTF(("cis mem map %x\n",
(unsigned int) tuple.memh));
tuple.mult = longlink_common ? 1 : 2;
tuple.ptr = longlink_addr;
longlink_present = 0;
longlink_common = 1;
longlink_addr = 0;
} else if (mfc_count && (mfc_index < mfc_count)) {
CARD_SET_RES_FLAGS(device_get_parent(dev), dev,
SYS_RES_MEMORY, rid, mfc[mfc_index].common
? PCCARD_A_MEM_ATTR : PCCARD_A_MEM_ATTR);
? PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR);
DPRINTF(("cis mem map %x\n",
(unsigned int) tuple.memh));
/* set parse state, and point at the next one */
tuple.mult = mfc[mfc_index].common ? 1 : 2;
tuple.ptr = mfc[mfc_index].addr;
mfc_index++;
} else {
goto done;