aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <loos@FreeBSD.org>2017-01-19 14:05:49 +0000
committerLuiz Otavio O Souza <loos@FreeBSD.org>2017-01-19 14:05:49 +0000
commitb328ce000e451ce27a72134d58275de611f43279 (patch)
treeeb24a8d94dc0f3399d695be4ae31a0173ebe1009 /sys/arm
parent9e3ff5c594b65db171e8371a5b558af6b0731c44 (diff)
downloadsrc-b328ce000e451ce27a72134d58275de611f43279.tar.gz
src-b328ce000e451ce27a72134d58275de611f43279.zip
The port number and the to_port_en flag are valid only on SOP descriptor.
Sponsored by: Rubicon Communications, LLC (Netgate)
Notes
Notes: svn path=/head/; revision=312408
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index 355a423eb6a7..7fdc09356c0a 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -1800,13 +1800,8 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
struct cpsw_cpdma_bd bd;
struct cpsw_slot *first_new_slot, *last, *last_old_slot, *next, *slot;
struct mbuf *m0;
- int error, flags, nsegs, seg, added = 0, padlen;
+ int error, nsegs, seg, added = 0, padlen;
- flags = 0;
- if (sc->swsc->dualemac) {
- flags = CPDMA_BD_TO_PORT |
- ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
- }
/* Pull pending packets from IF queue and prep them for DMA. */
last = NULL;
first_new_slot = NULL;
@@ -1884,7 +1879,11 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = segs[0].ds_len;
bd.pktlen = m_length(slot->mbuf, NULL) + padlen;
- bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER | flags;
+ bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER;
+ if (sc->swsc->dualemac) {
+ bd.flags |= CPDMA_BD_TO_PORT;
+ bd.flags |= ((sc->unit + 1) & CPDMA_BD_PORT_MASK);
+ }
for (seg = 1; seg < nsegs; ++seg) {
/* Save the previous buffer (which isn't EOP) */
cpsw_cpdma_write_bd(sc->swsc, slot, &bd);
@@ -1902,7 +1901,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = segs[seg].ds_len;
bd.pktlen = 0;
- bd.flags = CPDMA_BD_OWNER | flags;
+ bd.flags = CPDMA_BD_OWNER;
}
/* Save the final buffer. */
if (padlen <= 0)
@@ -1924,7 +1923,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
bd.bufoff = 0;
bd.buflen = padlen;
bd.pktlen = 0;
- bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags;
+ bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER;
cpsw_cpdma_write_bd(sc->swsc, slot, &bd);
++nsegs;