diff options
-rw-r--r-- | sys/dev/ed/if_ed.c | 50 | ||||
-rw-r--r-- | sys/dev/ed/if_ed_hpp.c | 4 |
2 files changed, 54 insertions, 0 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index e23fcd7..eec8954 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -420,7 +420,11 @@ ed_stop_hw(struct ed_softc *sc) /* * Stop everything on the interface, and select page 0 registers. */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Wait for interface to enter stopped state, but limit # of checks to @@ -528,7 +532,11 @@ ed_init_locked(struct ed_softc *sc) /* * Set interface for page 0, Remote DMA complete, Stopped */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (sc->isa16bit) /* @@ -649,7 +657,11 @@ ed_xmit(struct ed_softc *sc) /* * Set NIC for page 0 register access */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * Set TX buffer start page @@ -666,7 +678,11 @@ ed_xmit(struct ed_softc *sc) /* * Set page 0, Remote DMA complete, Transmit Packet, and *Start* */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_TXP | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); sc->xmit_busy = 1; /* @@ -913,7 +929,11 @@ ed_rint(struct ed_softc *sc) /* * Set NIC to page 0 registers to update boundry register */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_BNRY, boundry); /* @@ -947,7 +967,11 @@ edintr(void *arg) /* * Set NIC to page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * loop until there are no more new interrupts. When the card goes @@ -1165,7 +1189,11 @@ edintr(void *arg) * set in the transmit routine, is *okay* - it is 'edge' * triggered from low to high) */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* * If the Network Talley Counters overflow, read them to reset @@ -1367,7 +1395,11 @@ ed_pio_readmem(struct ed_softc *sc, bus_size_t src, uint8_t *dst, { /* Regular Novell cards */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* round up to a word */ if (amount & 1) @@ -1400,7 +1432,11 @@ ed_pio_writemem(struct ed_softc *sc, uint8_t *src, uint16_t dst, uint16_t len) int maxwait = 200; /* about 240us */ /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1457,7 +1493,11 @@ ed_pio_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) dma_len++; /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); @@ -1587,7 +1627,11 @@ ed_setrcr(struct ed_softc *sc) * runts and packets with CRC & alignment errors. */ /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_PRO | ED_RCR_AM | ED_RCR_AB | ED_RCR_AR | ED_RCR_SEP | reg1); @@ -1609,7 +1653,11 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), ((u_char *) mcaf)[i]); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AM | ED_RCR_AB | reg1); } else { @@ -1622,6 +1670,8 @@ ed_setrcr(struct ed_softc *sc) ed_nic_outb(sc, ED_P1_MAR(i), 0x00); /* Set page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STP); ed_nic_outb(sc, ED_P0_RCR, ED_RCR_AB | reg1); diff --git a/sys/dev/ed/if_ed_hpp.c b/sys/dev/ed/if_ed_hpp.c index 1c9d4bb..f16cd01 100644 --- a/sys/dev/ed/if_ed_hpp.c +++ b/sys/dev/ed/if_ed_hpp.c @@ -565,7 +565,11 @@ ed_hpp_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) int use_32bit_accesses = !(sc->hpp_id & ED_HPP_ID_16_BIT_ACCESS); /* select page 0 registers */ + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); + ed_nic_barrier(sc, ED_P0_CR, 1, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); /* reset remote DMA complete flag */ ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RDC); |