diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2018-05-18 14:56:08 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-18 11:00:16 -0400 |
commit | d2df9ea0ade7ef73710603da97b72394c53a111c (patch) | |
tree | 265792828d67741686830ea98fa9ca5381c0745d /drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |
parent | 357951cdf0dcdcc2bacb00c2e7665217a2fe34bf (diff) | |
download | lwn-d2df9ea0ade7ef73710603da97b72394c53a111c.tar.gz lwn-d2df9ea0ade7ef73710603da97b72394c53a111c.zip |
net: stmmac: Let descriptor code get skbuff address
Stop using if conditions depending on the GMAC version for getting the
descriptor skbuff address 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/norm_desc.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index 2facdb5d1aa0..de65bb29feba 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c @@ -297,6 +297,11 @@ static void ndesc_display_ring(void *head, unsigned int size, bool rx) pr_info("\n"); } +static void ndesc_get_addr(struct dma_desc *p, unsigned int *addr) +{ + *addr = le32_to_cpu(p->des2); +} + static void ndesc_set_addr(struct dma_desc *p, dma_addr_t addr) { p->des2 = cpu_to_le32(addr); @@ -326,6 +331,7 @@ const struct stmmac_desc_ops ndesc_ops = { .get_timestamp = ndesc_get_timestamp, .get_rx_timestamp_status = ndesc_get_rx_timestamp_status, .display_ring = ndesc_display_ring, + .get_addr = ndesc_get_addr, .set_addr = ndesc_set_addr, .clear = ndesc_clear, }; |