diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2013-06-04 21:57:12 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-06 16:22:45 -0700 |
commit | 4df95131ea803bcb94f472d465c73ed57015c470 (patch) | |
tree | 619988df3ed92f35ec7544642616746234064dbe /drivers/net/ethernet/cadence/macb.h | |
parent | 1b44791ab4ed27e6fa69f5dfa81b0fd48b1d050d (diff) | |
download | lwn-4df95131ea803bcb94f472d465c73ed57015c470.tar.gz lwn-4df95131ea803bcb94f472d465c73ed57015c470.zip |
net/macb: change RX path for GEM
GEM is able to adapt its DMA buffer size, so change
the RX path to take advantage of this possibility and
remove all kind of memcpy in this path.
This modification introduces function pointers for managing
differences between MACB and GEM adapter type.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence/macb.h')
-rw-r--r-- | drivers/net/ethernet/cadence/macb.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 9b5e19f8b61d..f4076155bed7 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -545,11 +545,22 @@ struct gem_stats { u32 rx_udp_checksum_errors; }; +struct macb; + +struct macb_or_gem_ops { + int (*mog_alloc_rx_buffers)(struct macb *bp); + void (*mog_free_rx_buffers)(struct macb *bp); + void (*mog_init_rings)(struct macb *bp); + int (*mog_rx)(struct macb *bp, int budget); +}; + struct macb { void __iomem *regs; unsigned int rx_tail; + unsigned int rx_prepared_head; struct macb_dma_desc *rx_ring; + struct sk_buff **rx_skbuff; void *rx_buffers; size_t rx_buffer_size; @@ -574,6 +585,8 @@ struct macb { dma_addr_t tx_ring_dma; dma_addr_t rx_buffers_dma; + struct macb_or_gem_ops macbgem_ops; + struct mii_bus *mii_bus; struct phy_device *phy_dev; unsigned int link; |