summaryrefslogtreecommitdiff
path: root/sys/dev/ic/re.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-11-24 04:27:18 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-11-24 04:27:18 +0000
commitad0d6f5adecd7ce94b4de18105811deade80da81 (patch)
tree9a8a1f75fbd27f25e8bfa72aab1ec5b827079dd2 /sys/dev/ic/re.c
parent2c91dcd27f0e92b8ba5e95f59629303593de23c7 (diff)
replace a magic number (reserved TX descs?) with macro
From tsutsui@NetBSD
Diffstat (limited to 'sys/dev/ic/re.c')
-rw-r--r--sys/dev/ic/re.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index e28edcbc429..ca9880ae424 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.53 2006/11/18 15:54:29 brad Exp $ */
+/* $OpenBSD: re.c,v 1.54 2006/11/24 04:27:17 brad Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -869,9 +869,8 @@ re_attach(struct rl_softc *sc)
for (i = 0; i < RL_TX_QLEN; i++) {
error = bus_dmamap_create(sc->sc_dmat,
RL_JUMBO_FRAMELEN,
- RL_TX_DESC_CNT(sc) - 4, RL_TDESC_CMD_FRAGLEN,
- 0, 0,
- &sc->rl_ldata.rl_txq[i].txq_dmamap);
+ RL_TX_DESC_CNT(sc) - RL_NTXDESC_RSVD, RL_TDESC_CMD_FRAGLEN,
+ 0, 0, &sc->rl_ldata.rl_txq[i].txq_dmamap);
if (error) {
printf("%s: can't create DMA map for TX\n",
sc->sc_dev.dv_xname);
@@ -1503,7 +1502,7 @@ re_encap(struct rl_softc *sc, struct mbuf *m, int *idx)
u_int32_t cmdstat, rl_flags = 0;
struct rl_txq *txq;
- if (sc->rl_ldata.rl_tx_free <= 4)
+ if (sc->rl_ldata.rl_tx_free <= RL_NTXDESC_RSVD)
return (EFBIG);
#ifdef RE_CSUM_OFFLOAD
@@ -1541,7 +1540,7 @@ re_encap(struct rl_softc *sc, struct mbuf *m, int *idx)
return (error);
}
- if (map->dm_nsegs > sc->rl_ldata.rl_tx_free - 4) {
+ if (map->dm_nsegs > sc->rl_ldata.rl_tx_free - RL_NTXDESC_RSVD) {
error = EFBIG;
goto fail_unload;
}