summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
diff options
context:
space:
mode:
authorJose Abreu <Jose.Abreu@synopsys.com>2018-05-18 14:56:01 +0100
committerDavid S. Miller <davem@davemloft.net>2018-05-18 11:00:15 -0400
commit44c67f8559fc5e2f818cbb11fde1ee1bebc59e7c (patch)
treebec97b8cb28d6e161a61ed5932bee379453f4cf1 /drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
parent6844171d5b0567a18248593176e23ae97d76b346 (diff)
net: stmmac: Let descriptor code clear the descriptor
Stop using if conditions depending on the GMAC version for clearing the descriptor and use instead a helper implemented in the descriptor files. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Cc: David S. Miller <davem@davemloft.net> Cc: Joao Pinto <jpinto@synopsys.com> Cc: Vitor Soares <soares@synopsys.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index f67caa14b2f5..119a2f93dd55 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -430,6 +430,14 @@ static void dwmac4_set_addr(struct dma_desc *p, dma_addr_t addr)
p->des1 = 0;
}
+static void dwmac4_clear(struct dma_desc *p)
+{
+ p->des0 = 0;
+ p->des1 = 0;
+ p->des2 = 0;
+ p->des3 = 0;
+}
+
const struct stmmac_desc_ops dwmac4_desc_ops = {
.tx_status = dwmac4_wrback_get_tx_status,
.rx_status = dwmac4_wrback_get_rx_status,
@@ -452,6 +460,7 @@ const struct stmmac_desc_ops dwmac4_desc_ops = {
.display_ring = dwmac4_display_ring,
.set_mss = dwmac4_set_mss_ctxt,
.set_addr = dwmac4_set_addr,
+ .clear = dwmac4_clear,
};
const struct stmmac_mode_ops dwmac4_ring_mode_ops = { };