diff options
author | ps <ps@FreeBSD.org> | 2003-05-21 07:00:49 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2003-05-21 07:00:49 +0000 |
commit | 1f8de07ce7dfde672600b4184e84769f1b3516d0 (patch) | |
tree | 37714b32df7063d8d941bbf74632877ecaad0b83 /sys | |
parent | 75e88124d7988922181344082558658bd36d2dad (diff) | |
download | FreeBSD-src-1f8de07ce7dfde672600b4184e84769f1b3516d0.zip FreeBSD-src-1f8de07ce7dfde672600b4184e84769f1b3516d0.tar.gz |
- Make this work with PAE.
- atomically load and clear the status block so we dont miss an
update.
Submitted by: jdp
Approved by: re (scottl)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/bge/if_bge.c | 32 | ||||
-rw-r--r-- | sys/dev/bge/if_bgereg.h | 6 | ||||
-rw-r--r-- | sys/i386/conf/PAE | 1 |
3 files changed, 20 insertions, 19 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index f1f4dac..353d799 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -762,7 +762,7 @@ bge_newbuf_std(sc, i, m) m_adj(m_new, ETHER_ALIGN); sc->bge_cdata.bge_rx_std_chain[i] = m_new; r = &sc->bge_rdata->bge_rx_std_ring[i]; - BGE_HOSTADDR(r->bge_addr) = vtophys(mtod(m_new, caddr_t)); + BGE_HOSTADDR(r->bge_addr, vtophys(mtod(m_new, caddr_t))); r->bge_flags = BGE_RXBDFLAG_END; r->bge_len = m_new->m_len; r->bge_idx = i; @@ -817,7 +817,7 @@ bge_newbuf_jumbo(sc, i, m) /* Set up the descriptor. */ r = &sc->bge_rdata->bge_rx_jumbo_ring[i]; sc->bge_cdata.bge_rx_jumbo_chain[i] = m_new; - BGE_HOSTADDR(r->bge_addr) = vtophys(mtod(m_new, caddr_t)); + BGE_HOSTADDR(r->bge_addr, vtophys(mtod(m_new, caddr_t))); r->bge_flags = BGE_RXBDFLAG_END|BGE_RXBDFLAG_JUMBO_RING; r->bge_len = m_new->m_len; r->bge_idx = i; @@ -1196,8 +1196,8 @@ bge_blockinit(sc) /* Initialize the standard RX ring control block */ rcb = &sc->bge_rdata->bge_info.bge_std_rx_rcb; - BGE_HOSTADDR(rcb->bge_hostaddr) = - vtophys(&sc->bge_rdata->bge_rx_std_ring); + BGE_HOSTADDR(rcb->bge_hostaddr, + vtophys(&sc->bge_rdata->bge_rx_std_ring)); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); if (sc->bge_extram) rcb->bge_nicaddr = BGE_EXT_STD_RX_RINGS; @@ -1216,8 +1216,8 @@ bge_blockinit(sc) * high enough to require it). */ rcb = &sc->bge_rdata->bge_info.bge_jumbo_rx_rcb; - BGE_HOSTADDR(rcb->bge_hostaddr) = - vtophys(&sc->bge_rdata->bge_rx_jumbo_ring); + BGE_HOSTADDR(rcb->bge_hostaddr, + vtophys(&sc->bge_rdata->bge_rx_jumbo_ring)); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, BGE_RCB_FLAG_RING_DISABLED); if (sc->bge_extram) @@ -1263,8 +1263,7 @@ bge_blockinit(sc) vrcb = (volatile struct bge_rcb *)(sc->bge_vhandle + BGE_MEMWIN_START + BGE_SEND_RING_RCB); vrcb->bge_hostaddr.bge_addr_hi = 0; - BGE_HOSTADDR(vrcb->bge_hostaddr) = - vtophys(&sc->bge_rdata->bge_tx_ring); + BGE_HOSTADDR(vrcb->bge_hostaddr, vtophys(&sc->bge_rdata->bge_tx_ring)); vrcb->bge_nicaddr = BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT); vrcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0); @@ -1297,8 +1296,8 @@ bge_blockinit(sc) vrcb = (volatile struct bge_rcb *)(sc->bge_vhandle + BGE_MEMWIN_START + BGE_RX_RETURN_RING_RCB); vrcb->bge_hostaddr.bge_addr_hi = 0; - BGE_HOSTADDR(vrcb->bge_hostaddr) = - vtophys(&sc->bge_rdata->bge_rx_return_ring); + BGE_HOSTADDR(vrcb->bge_hostaddr, + vtophys(&sc->bge_rdata->bge_rx_return_ring)); vrcb->bge_nicaddr = 0x00000000; vrcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_RETURN_RING_CNT, 0); @@ -2047,9 +2046,12 @@ bge_intr(xsc) { struct bge_softc *sc; struct ifnet *ifp; + u_int32_t statusword; sc = xsc; ifp = &sc->arpcom.ac_if; + statusword = + atomic_readandclear_32(&sc->bge_rdata->bge_status_block.bge_status); #ifdef notdef /* Avoid this for now -- checking this register is expensive. */ @@ -2088,11 +2090,7 @@ bge_intr(xsc) BRGPHY_INTRS); } } else { - if ((sc->bge_rdata->bge_status_block.bge_status & - BGE_STATFLAG_UPDATED) && - (sc->bge_rdata->bge_status_block.bge_status & - BGE_STATFLAG_LINKSTATE_CHANGED)) { - sc->bge_rdata->bge_status_block.bge_status &= ~(BGE_STATFLAG_UPDATED|BGE_STATFLAG_LINKSTATE_CHANGED); + if (statusword & BGE_STATFLAG_LINKSTATE_CHANGED) { sc->bge_link = 0; untimeout(bge_tick, sc, sc->bge_stat_ch); bge_tick(sc); @@ -2252,8 +2250,8 @@ bge_encap(sc, m_head, txidx) f = &sc->bge_rdata->bge_tx_ring[frag]; if (sc->bge_cdata.bge_tx_chain[frag] != NULL) break; - BGE_HOSTADDR(f->bge_addr) = - vtophys(mtod(m, vm_offset_t)); + BGE_HOSTADDR(f->bge_addr, + vtophys(mtod(m, vm_offset_t))); f->bge_len = m->m_len; f->bge_flags = csum_flags; if (mtag != NULL) { diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 648b085..3670ce8 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -1696,7 +1696,11 @@ typedef struct { u_int32_t bge_addr_hi; u_int32_t bge_addr_lo; } bge_hostaddr; -#define BGE_HOSTADDR(x) ((x).bge_addr_lo) +#define BGE_HOSTADDR(x, y) \ + do { \ + (x).bge_addr_lo = ((u_int64_t) (y) & 0xffffffff); \ + (x).bge_addr_hi = ((u_int64_t) (y) >> 32); \ + } while(0) /* Ring control block structure */ struct bge_rcb { diff --git a/sys/i386/conf/PAE b/sys/i386/conf/PAE index d7b1846..ee0312e 100644 --- a/sys/i386/conf/PAE +++ b/sys/i386/conf/PAE @@ -73,7 +73,6 @@ nodevice tl nodevice tx nodevice vr nodevice wb -nodevice bge nodevice cs nodevice ed |