summaryrefslogtreecommitdiffstats
path: root/sys/arm/ti
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2017-01-25 15:27:05 +0000
committerloos <loos@FreeBSD.org>2017-01-25 15:27:05 +0000
commit72df66a5f4981a4b7241edc19b00a710b4300f75 (patch)
treec10a92f84427d3998558933fd22c4b6bcac57df5 /sys/arm/ti
parent57f1c569775448b359e4949a3f7b27280cf7d6a8 (diff)
downloadFreeBSD-src-72df66a5f4981a4b7241edc19b00a710b4300f75.zip
FreeBSD-src-72df66a5f4981a4b7241edc19b00a710b4300f75.tar.gz
MFC r312408:
The port number and the to_port_en flag are valid only on SOP descriptor. Sponsored by: Rubicon Communications, LLC (Netgate)
Diffstat (limited to 'sys/arm/ti')
-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 8a72aa1..c1b8233 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -1801,13 +1801,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;
@@ -1885,7 +1880,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);
@@ -1903,7 +1902,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)
@@ -1925,7 +1924,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;
OpenPOWER on IntegriCloud