summaryrefslogtreecommitdiffstats
path: root/sys/dev/re/if_re.c
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2004-09-19 17:51:41 +0000
committerjmg <jmg@FreeBSD.org>2004-09-19 17:51:41 +0000
commit4c698d46f33bdf53c253ffce0e0cfc5061b5edc2 (patch)
treed5425315c51509758f02fda2af2c47b4419c4d10 /sys/dev/re/if_re.c
parent6c7697503ce2f99ebe7b638b4050cf49f2517f00 (diff)
downloadFreeBSD-src-4c698d46f33bdf53c253ffce0e0cfc5061b5edc2.zip
FreeBSD-src-4c698d46f33bdf53c253ffce0e0cfc5061b5edc2.tar.gz
spell RX correctly
don't call re_rxeof a second time when we've already done the work pull common code out from if and else clauses MFC after: 3 days
Diffstat (limited to 'sys/dev/re/if_re.c')
-rw-r--r--sys/dev/re/if_re.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index ed99e3e..214fa18 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -1005,7 +1005,7 @@ re_allocmem(dev, sc)
*/
error = bus_dma_tag_create(sc->rl_parent_tag, RL_RING_ALIGN,
0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL,
- NULL, RL_TX_LIST_SZ, 1, RL_TX_LIST_SZ, BUS_DMA_ALLOCNOW,
+ NULL, RL_RX_LIST_SZ, 1, RL_RX_LIST_SZ, BUS_DMA_ALLOCNOW,
NULL, NULL, &sc->rl_ldata.rl_rx_list_tag);
if (error) {
device_printf(dev, "could not allocate dma tag\n");
@@ -1024,7 +1024,7 @@ re_allocmem(dev, sc)
error = bus_dmamap_load(sc->rl_ldata.rl_rx_list_tag,
sc->rl_ldata.rl_rx_list_map, sc->rl_ldata.rl_rx_list,
- RL_TX_LIST_SZ, re_dma_map_addr,
+ RL_RX_LIST_SZ, re_dma_map_addr,
&sc->rl_ldata.rl_rx_list_addr, BUS_DMA_NOWAIT);
/* Create DMA maps for RX buffers */
@@ -1811,10 +1811,8 @@ re_intr(arg)
if ((status & RL_INTRS_CPLUS) == 0)
break;
- if (status & RL_ISR_RX_OK)
- re_rxeof(sc);
-
- if (status & RL_ISR_RX_ERR)
+ if ((status & RL_ISR_RX_OK) ||
+ (status & RL_ISR_RX_ERR))
re_rxeof(sc);
if ((status & RL_ISR_TIMEOUT_EXPIRED) ||
@@ -2111,24 +2109,20 @@ re_init_locked(sc)
rxcfg |= RL_RXCFG_RX_INDIV;
/* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
+ if (ifp->if_flags & IFF_PROMISC)
rxcfg |= RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
+ else
rxcfg &= ~RL_RXCFG_RX_ALLPHYS;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
+ CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
/*
* Set capture broadcast bit to capture broadcast frames.
*/
- if (ifp->if_flags & IFF_BROADCAST) {
+ if (ifp->if_flags & IFF_BROADCAST)
rxcfg |= RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- } else {
+ else
rxcfg &= ~RL_RXCFG_RX_BROAD;
- CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
- }
+ CSR_WRITE_4(sc, RL_RXCFG, rxcfg);
/*
* Program the multicast filter, if necessary.
OpenPOWER on IntegriCloud