ar71xx: improve ethernet driver cache footprint by removing an unnecessary pointer
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx.h
index 2d7c963a448df6d246807991f0cc5dcd75ae100f..b18c20b6ddf8922812de3790a2622c33197a5785 100644 (file)
@@ -90,7 +90,6 @@ struct ag71xx_buf {
                struct sk_buff  *skb;
                void            *rx_buf;
        };
-       struct ag71xx_desc      *desc;
        union {
                dma_addr_t      dma_addr;
                unsigned long   timestamp;
@@ -203,6 +202,12 @@ static inline int ag71xx_desc_empty(struct ag71xx_desc *desc)
        return (desc->ctrl & DESC_EMPTY) != 0;
 }
 
+static inline struct ag71xx_desc *
+ag71xx_ring_desc(struct ag71xx_ring *ring, int idx)
+{
+       return (struct ag71xx_desc *) &ring->descs_cpu[idx * ring->desc_size];
+}
+
 /* Register offsets */
 #define AG71XX_REG_MAC_CFG1    0x0000
 #define AG71XX_REG_MAC_CFG2    0x0004