diff options
-rw-r--r-- | sys/dev/ep/if_ep.c | 36 | ||||
-rw-r--r-- | sys/dev/ep/if_ep_eisa.c | 2 | ||||
-rw-r--r-- | sys/dev/ep/if_ep_isa.c | 2 | ||||
-rw-r--r-- | sys/dev/ep/if_ep_mca.c | 2 | ||||
-rw-r--r-- | sys/dev/ep/if_ep_pccard.c | 6 | ||||
-rw-r--r-- | sys/dev/ep/if_epreg.h | 2 |
6 files changed, 24 insertions, 26 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index ba59f69..32683c3 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -158,7 +158,7 @@ ep_get_macaddr(struct ep_softc *sc, u_char *addr) macaddr = (u_int16_t *) addr; - GO_WINDOW(0); + GO_WINDOW(sc, 0); for (i = EEPROM_NODE_ADDR_0; i <= EEPROM_NODE_ADDR_2; i++) { error = get_e(sc, i, &result); if (error) @@ -203,7 +203,7 @@ ep_alloc(device_t dev) sc->ep_connectors = 0; sc->ep_connector = 0; - GO_WINDOW(0); + GO_WINDOW(sc, 0); sc->epb.cmd_off = 0; error = get_e(sc, EEPROM_PROD_ID, &result); @@ -225,7 +225,7 @@ ep_get_media(struct ep_softc *sc) { u_int16_t config; - GO_WINDOW(0); + GO_WINDOW(sc, 0); config = CSR_READ_2(sc, EP_W0_CONFIG_CTRL); if (config & IS_AUI) sc->ep_connectors |= AUI; @@ -281,7 +281,7 @@ ep_attach(struct ep_softc *sc) * Setup the station address */ p = (u_short *)&sc->arpcom.ac_enaddr; - GO_WINDOW(2); + GO_WINDOW(sc, 2); for (i = 0; i < 3; i++) CSR_WRITE_2(sc, EP_W2_ADDR_0 + (i * 2), ntohs(p[i])); @@ -393,11 +393,11 @@ epinit_locked(struct ep_softc *sc) EP_ASSERT_LOCKED(sc); EP_BUSY_WAIT(sc); - GO_WINDOW(0); + GO_WINDOW(sc, 0); CSR_WRITE_2(sc, EP_COMMAND, STOP_TRANSCEIVER); - GO_WINDOW(4); + GO_WINDOW(sc, 4); CSR_WRITE_2(sc, EP_W4_MEDIA_TYPE, DISABLE_UTP); - GO_WINDOW(0); + GO_WINDOW(sc, 0); /* Disable the card */ CSR_WRITE_2(sc, EP_W0_CONFIG_CTRL, 0); @@ -405,7 +405,7 @@ epinit_locked(struct ep_softc *sc) /* Enable the card */ CSR_WRITE_2(sc, EP_W0_CONFIG_CTRL, ENABLE_DRQ_IRQ); - GO_WINDOW(2); + GO_WINDOW(sc, 2); /* Reload the ether_addr. */ for (i = 0; i < 6; i++) @@ -416,7 +416,7 @@ epinit_locked(struct ep_softc *sc) EP_BUSY_WAIT(sc); /* Window 1 is operating window */ - GO_WINDOW(1); + GO_WINDOW(sc, 1); for (i = 0; i < 31; i++) CSR_READ_1(sc, EP_W1_TX_STATUS); @@ -461,7 +461,7 @@ epinit_locked(struct ep_softc *sc) * called from intr or somewhere else. */ - GO_WINDOW(1); + GO_WINDOW(sc, 1); epstart_locked(ifp); } @@ -616,7 +616,7 @@ rescan: /* we need ACK */ ifp->if_timer = 0; ifp->if_flags &= ~IFF_OACTIVE; - GO_WINDOW(1); + GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); } @@ -624,7 +624,7 @@ rescan: ifp->if_timer = 0; #ifdef EP_LOCAL_STATS printf("\nep%d:\n\tStatus: %x\n", sc->unit, status); - GO_WINDOW(4); + GO_WINDOW(sc, 4); printf("\tFIFO Diagnostic: %x\n", CSR_READ_2(sc, EP_W4_FIFO_DIAG)); printf("\tStat: %x\n", sc->stat); @@ -689,7 +689,7 @@ rescan: CSR_WRITE_1(sc, EP_W1_TX_STATUS, 0x0); } /* while */ ifp->if_flags &= ~IFF_OACTIVE; - GO_WINDOW(1); + GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); } /* end TX_COMPLETE */ @@ -860,17 +860,17 @@ ep_ifmedia_upd(struct ifnet *ifp) struct ep_softc *sc = ifp->if_softc; int i = 0, j; - GO_WINDOW(0); + GO_WINDOW(sc, 0); CSR_WRITE_2(sc, EP_COMMAND, STOP_TRANSCEIVER); - GO_WINDOW(4); + GO_WINDOW(sc, 4); CSR_WRITE_2(sc, EP_W4_MEDIA_TYPE, DISABLE_UTP); - GO_WINDOW(0); + GO_WINDOW(sc, 0); switch (IFM_SUBTYPE(sc->ifmedia.ifm_media)) { case IFM_10_T: if (sc->ep_connectors & UTP) { i = ACF_CONNECTOR_UTP; - GO_WINDOW(4); + GO_WINDOW(sc, 4); CSR_WRITE_2(sc, EP_W4_MEDIA_TYPE, ENABLE_UTP); } break; @@ -891,7 +891,7 @@ ep_ifmedia_upd(struct ifnet *ifp) "strange connector type in EEPROM: assuming AUI\n"); } - GO_WINDOW(0); + GO_WINDOW(sc, 0); j = CSR_READ_2(sc, EP_W0_ADDRESS_CFG) & 0x3fff; CSR_WRITE_2(sc, EP_W0_ADDRESS_CFG, j | (i << ACF_CONNECTOR_BITS)); diff --git a/sys/dev/ep/if_ep_eisa.c b/sys/dev/ep/if_ep_eisa.c index ad2ebdc..d5e0c74 100644 --- a/sys/dev/ep/if_ep_eisa.c +++ b/sys/dev/ep/if_ep_eisa.c @@ -214,7 +214,7 @@ ep_eisa_attach(device_t dev) if (irq == 9) irq = 2; - GO_WINDOW(0); + GO_WINDOW(sc, 0); SET_IRQ(sc, irq); if ((error = ep_attach(sc))) { diff --git a/sys/dev/ep/if_ep_isa.c b/sys/dev/ep/if_ep_isa.c index 546e9bb..917b6d2 100644 --- a/sys/dev/ep/if_ep_isa.c +++ b/sys/dev/ep/if_ep_isa.c @@ -331,7 +331,7 @@ ep_isa_attach(device_t dev) } ep_get_media(sc); - GO_WINDOW(0); + GO_WINDOW(sc, 0); SET_IRQ(sc, rman_get_start(sc->irq)); if ((error = ep_attach(sc))) { diff --git a/sys/dev/ep/if_ep_mca.c b/sys/dev/ep/if_ep_mca.c index b603bba..921e024 100644 --- a/sys/dev/ep/if_ep_mca.c +++ b/sys/dev/ep/if_ep_mca.c @@ -128,7 +128,7 @@ ep_mca_attach(device_t dev) ep_get_media(sc); - GO_WINDOW(0); + GO_WINDOW(sc, 0); SET_IRQ(sc, rman_get_start(sc->irq)); if ((error = ep_attach(sc))) { diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c index 4b9cefb..e54a5eb 100644 --- a/sys/dev/ep/if_ep_pccard.c +++ b/sys/dev/ep/if_ep_pccard.c @@ -208,17 +208,15 @@ ep_pccard_attach(device_t dev) /* ROM size = 0, ROM base = 0 */ /* For now, ignore AUTO SELECT feature of 3C589B and later. */ CSR_WRITE_2(sc, EP_W0_ADDRESS_CFG, result & 0xc000); - /* Fake IRQ must be 3 */ - CSR_WRITE_2(sc, EP_W0_RESOURCE_CFG, (sc->epb.res_cfg & 0x0fff) | 0x3000); - + SET_IRQ(sc, 3); CSR_WRITE_2(sc, EP_W0_PRODUCT_ID, sc->epb.prod_id); if (sc->epb.mii_trans) { /* * turn on the MII transciever */ - GO_WINDOW(3); + GO_WINDOW(sc, 3); CSR_WRITE_2(sc, EP_W3_OPTIONS, 0x8040); DELAY(1000); CSR_WRITE_2(sc, EP_W3_OPTIONS, 0xc040); diff --git a/sys/dev/ep/if_epreg.h b/sys/dev/ep/if_epreg.h index 1944f78..e2942b6 100644 --- a/sys/dev/ep/if_epreg.h +++ b/sys/dev/ep/if_epreg.h @@ -60,7 +60,7 @@ * Some short functions, worth to let them be a macro */ #define is_eeprom_busy(sc) (CSR_READ_2(sc, EP_W0_EEPROM_COMMAND)&EEPROM_BUSY) -#define GO_WINDOW(x) CSR_WRITE_2(sc, EP_COMMAND, WINDOW_SELECT|(x)) +#define GO_WINDOW(sc, x) CSR_WRITE_2(sc, EP_COMMAND, WINDOW_SELECT|(x)) /************************************************************************** * * |