Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149689818
D13031.id35430.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13031.id35430.diff
View Options
Index: head/sys/arm/allwinner/if_awg.c
===================================================================
--- head/sys/arm/allwinner/if_awg.c
+++ head/sys/arm/allwinner/if_awg.c
@@ -390,17 +390,19 @@
static int
awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp)
{
+ bus_dmamap_t map;
bus_dma_segment_t segs[TX_MAX_SEGS];
- int error, nsegs, cur, first, i;
+ int error, nsegs, cur, first, last, i;
u_int csum_flags;
uint32_t flags, status;
struct mbuf *m;
cur = first = index;
+ map = sc->tx.buf_map[first].map;
m = *mp;
- error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag,
- sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, map, m, segs,
+ &nsegs, BUS_DMA_NOWAIT);
if (error == EFBIG) {
m = m_collapse(m, M_NOWAIT, TX_MAX_SEGS);
if (m == NULL) {
@@ -408,16 +410,15 @@
return (0);
}
*mp = m;
- error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag,
- sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, map, m,
+ segs, &nsegs, BUS_DMA_NOWAIT);
}
if (error != 0) {
device_printf(sc->dev, "awg_setup_txbuf: bus_dmamap_load_mbuf_sg failed\n");
return (0);
}
- bus_dmamap_sync(sc->tx.buf_tag, sc->tx.buf_map[index].map,
- BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->tx.buf_tag, map, BUS_DMASYNC_PREWRITE);
flags = TX_FIR_DESC;
status = 0;
@@ -458,7 +459,11 @@
cur = TX_NEXT(cur);
}
- sc->tx.buf_map[first].mbuf = m;
+ /* Store mapping and mbuf in the last segment */
+ last = TX_SKIP(cur, TX_DESC_COUNT - 1);
+ sc->tx.buf_map[first].map = sc->tx.buf_map[last].map;
+ sc->tx.buf_map[last].map = map;
+ sc->tx.buf_map[last].mbuf = m;
/*
* The whole mbuf chain has been DMA mapped,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 27, 7:06 AM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30402752
Default Alt Text
D13031.id35430.diff (1 KB)
Attached To
Mode
D13031: if_awg: store mbuf and dma mapping in the last segment of a tx frame instead of the first
Attached
Detach File
Event Timeline
Log In to Comment