Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149815498
D12539.1790967545.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12539.1790967545.diff
View Options
Index: sys/arm/allwinner/if_awg.c
===================================================================
--- sys/arm/allwinner/if_awg.c
+++ sys/arm/allwinner/if_awg.c
@@ -807,6 +807,7 @@
{
if_t ifp;
uint32_t val;
+ int i;
AWG_ASSERT_LOCKED(sc);
@@ -840,6 +841,39 @@
WR4(sc, EMAC_RX_CTL_1, val & ~RX_DMA_EN);
sc->link = 0;
+
+ /* Finish handling transmitted buffers */
+ awg_txeof(sc);
+
+ /* Release any untransmitted buffers. */
+ for (i = sc->tx.next; sc->tx.queued > 0; i = TX_NEXT(i)) {
+ val = le32toh(sc->tx.desc_ring[i].status);
+ if ((val & TX_DESC_CTL) != 0)
+ break;
+ awg_clean_txbuf(sc, i);
+ }
+ sc->tx.next = i;
+ for (; sc->tx.queued > 0; i = TX_NEXT(i)) {
+ sc->tx.desc_ring[i].status = 0;
+ awg_clean_txbuf(sc, i);
+ }
+ sc->tx.cur = sc->tx.next;
+ bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
+ /* Setup RX buffers for reuse */
+ bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
+ for (i = sc->rx.cur; ; i = RX_NEXT(i)) {
+ val = le32toh(sc->rx.desc_ring[i].status);
+ if ((val & RX_DESC_CTL) != 0)
+ break;
+ awg_reuse_rxdesc(sc, i);
+ }
+ sc->rx.cur = i;
+ bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 2, 6:59 PM (18 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30107497
Default Alt Text
D12539.1790967545.diff (1 KB)
Attached To
Mode
D12539: if_awg: drain tx buffers and clear rx buffers when stopping
Attached
Detach File
Event Timeline
Log In to Comment