diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-30 23:15:38 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-30 23:15:38 +0000 |
commit | ccdf1d215ee9cf2da850bb7152e9bfb482f7ed7b (patch) | |
tree | 85e5e10251149bea216b8be875b33195afc94f82 /sys/dev | |
parent | b7f409d3b5e520587d566a86d0c611285d9e0933 (diff) |
update to latest freebsd code, fixes stalls during heavy traffic
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_vr.c | 39 | ||||
-rw-r--r-- | sys/dev/pci/if_vrreg.h | 7 |
2 files changed, 14 insertions, 32 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index b04b50094cf..20aec9951b8 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.1 1999/01/10 22:30:45 downsj Exp $ */ +/* $OpenBSD: if_vr.c,v 1.2 1999/01/30 23:15:37 niklas Exp $ */ /* * Copyright (c) 1997, 1998 @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: if_vr.c,v 1.6 1999/01/03 02:05:21 wpaul Exp $ + * $FreeBSD: if_vr.c,v 1.7 1999/01/10 18:51:49 wpaul Exp $ */ /* @@ -1207,7 +1207,7 @@ static int vr_newbuf(sc, c) c->vr_mbuf = m_new; c->vr_ptr->vr_status = VR_RXSTAT; c->vr_ptr->vr_data = vtophys(mtod(m_new, caddr_t)); - c->vr_ptr->vr_ctl = VR_RXCTL_CHAIN | (MCLBYTES - 1); + c->vr_ptr->vr_ctl = VR_RXCTL | VR_RXLEN; return(0); } @@ -1269,8 +1269,7 @@ static void vr_rxeof(sc) break; } cur_rx->vr_ptr->vr_status = VR_RXSTAT; - cur_rx->vr_ptr->vr_ctl = - VR_RXCTL_CHAIN | (MCLBYTES - 1); + cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN; continue; } @@ -1297,8 +1296,7 @@ static void vr_rxeof(sc) if (vr_newbuf(sc, cur_rx) == ENOBUFS) { ifp->if_ierrors++; cur_rx->vr_ptr->vr_status = VR_RXSTAT; - cur_rx->vr_ptr->vr_ctl = - VR_RXCTL_CHAIN | (MCLBYTES - 1); + cur_rx->vr_ptr->vr_ctl = VR_RXCTL|VR_RXLEN; continue; } @@ -1376,7 +1374,7 @@ static void vr_txeof(sc) cur_tx = sc->vr_cdata.vr_tx_head; txstat = cur_tx->vr_ptr->vr_status; - if ((txstat & VR_TXSTAT_OWN) || txstat == VR_UNSENT) + if (txstat & VR_TXSTAT_OWN) break; if (txstat & VR_TXSTAT_ERRSUM) { @@ -1422,12 +1420,6 @@ static void vr_txeoc(sc) sc->vr_cdata.vr_tx_tail = NULL; if (sc->vr_want_auto) vr_autoneg_mii(sc, VR_FLAG_SCHEDDELAY, 1); - } else { - if (VR_TXOWN(sc->vr_cdata.vr_tx_head) == VR_UNSENT) { - VR_TXOWN(sc->vr_cdata.vr_tx_head) = VR_TXSTAT_OWN; - ifp->if_timer = 5; - VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_TX_GO); - } } return; @@ -1564,7 +1556,7 @@ static int vr_encap(sc, c, m_head) } c->vr_mbuf = m_head; - c->vr_ptr->vr_ctl |= VR_TXCTL_LASTFRAG; + c->vr_ptr->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT; c->vr_ptr->vr_next = vtophys(c->vr_nextdesc->vr_ptr); return(0); @@ -1625,6 +1617,8 @@ static void vr_start(ifp) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, cur_tx->vr_mbuf); #endif + VR_TXOWN(cur_tx) = VR_TXSTAT_OWN; + VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_TX_GO); } /* @@ -1633,23 +1627,10 @@ static void vr_start(ifp) if (cur_tx == NULL) return; - /* - * Place the request for the upload interrupt - * in the last descriptor in the chain. This way, if - * we're chaining several packets at once, we'll only - * get an interupt once for the whole chain rather than - * once for each packet. - */ - cur_tx->vr_ptr->vr_ctl |= VR_TXCTL_FINT; sc->vr_cdata.vr_tx_tail = cur_tx; - if (sc->vr_cdata.vr_tx_head == NULL) { + if (sc->vr_cdata.vr_tx_head == NULL) sc->vr_cdata.vr_tx_head = start_tx; - VR_TXOWN(start_tx) = VR_TXSTAT_OWN; - VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_TX_GO); - } else { - VR_TXOWN(start_tx) = VR_UNSENT; - } /* * Set a timeout in case the chip goes out to lunch. diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h index f0ea3c7cb2c..066a00620f7 100644 --- a/sys/dev/pci/if_vrreg.h +++ b/sys/dev/pci/if_vrreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vrreg.h,v 1.1 1999/01/10 22:30:46 downsj Exp $ */ +/* $OpenBSD: if_vrreg.h,v 1.2 1999/01/30 23:15:37 niklas Exp $ */ /* * Copyright (c) 1997, 1998 @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: if_vrreg.h,v 1.1 1998/12/04 18:01:21 wpaul Exp $ + * $FreeBSD: if_vrreg.h,v 1.2 1999/01/10 18:51:49 wpaul Exp $ */ /* @@ -313,6 +313,7 @@ struct vr_desc { #define VR_RXCTL_CHAIN 0x00008000 #define VR_RXCTL_RX_INTR 0x00800000 +#define VR_RXCTL (VR_RXCTL_CHAIN|VR_RXCTL_RX_INTR) #define VR_TXSTAT_DEFER 0x00000001 #define VR_TXSTAT_UNDERRUN 0x00000002 @@ -339,9 +340,9 @@ struct vr_desc { #define VR_TX_LIST_CNT 64 #define VR_MIN_FRAMELEN 60 #define VR_FRAMELEN 1536 +#define VR_RXLEN 1520 #define VR_TXOWN(x) x->vr_ptr->vr_status -#define VR_UNSENT 0x12341234 struct vr_list_data { struct vr_desc vr_rx_list[VR_RX_LIST_CNT]; |