From e10a8107c60f8c6584067112306aa6671806ec0b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 6 Sep 2005 22:46:41 +0000 Subject: [PATCH] Go ahead and | in ED_CR_PAGE_0, even though this doesn't change things at all. It makes the code clearer. fix a comment comments about why we need to write i/o address to certain registers. --- sys/dev/ed/if_ed_pccard.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index 0c4ddae94628..9afa70068046 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -401,7 +401,8 @@ ax88x90_geteprom(struct ed_softc *sc) struct { unsigned char offset, value; } pg_seq[] = { - {ED_P0_CR, ED_CR_RD2|ED_CR_STP},/* Select Page0 */ + /* Select Page0 */ + {ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0}, {ED_P0_DCR, 0x01}, {ED_P0_RBCR0, 0x00}, /* Clear the count regs. */ {ED_P0_RBCR1, 0x00}, @@ -413,14 +414,15 @@ ax88x90_geteprom(struct ed_softc *sc) {ED_P0_RBCR1, 0x00}, {ED_P0_RSAR0, 0x00}, {ED_P0_RSAR1, 0x04}, - {ED_P0_CR ,ED_CR_RD0 | ED_CR_STA}, + {ED_P0_CR, ED_CR_RD0 | ED_CR_STA | ED_CR_PAGE_0}, }; + /* XXX The Linux axnet_cs driver does the following differently */ /* Reset Card */ tmp = ed_asic_inb(sc, ED_NOVELL_RESET); ed_asic_outb(sc, ED_NOVELL_RESET, tmp); DELAY(5000); - ed_asic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP); + ed_asic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0); DELAY(5000); /* Card Settings */ @@ -541,9 +543,10 @@ ed_pccard_ax88x90(device_t dev) sc->nic_offset = ED_NOVELL_NIC_OFFSET; sc->chip_type = ED_CHIP_TYPE_AX88190; - /* + /* XXX * Set Attribute Memory IOBASE Register. Is this a deficiency in - * the PC Card layer, or an ax88190 specific issue? xxx + * the PC Card layer, or an ax88190 specific issue? The card + * definitely doesn't work without it. */ iobase = rman_get_start(sc->port_res); ed_pccard_memwrite(dev, ED_AX88190_IOBASE0, iobase & 0xff);