aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/gianfar.h
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2015-07-29 16:13:06 +0300
committerDavid S. Miller <davem@davemloft.net>2015-07-29 22:57:24 -0700
commitb4b67f269d28c70174e11b7af7fbdb81124d220c (patch)
tree44d946960b6b3a4bf4495542644779415bc87449 /drivers/net/ethernet/freescale/gianfar.h
parentMerge branch 'sk_txhash' (diff)
downloadlinux-dev-b4b67f269d28c70174e11b7af7fbdb81124d220c.tar.xz
linux-dev-b4b67f269d28c70174e11b7af7fbdb81124d220c.zip
gianfar: Fix warnings when built on 64-bit
As part of defconfig consolidation using fragments, we'd like to be able to have the same drivers enabled on 32-bit and 64-bit. Gianfar happens to only exist on 32-bit systems, and when building the resulting 64-bit kernel warnings were produced. A couple of the warnings are trivial, but the rfbptr code has deeper issues. It uses the virtual address as the DMA address, which again, happens to work in the environments where this driver is currently used, but is not the right thing to do. Fixes: 45b679c9a3cc ("gianfar: Implement PAUSE frame generation support") Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r--drivers/net/ethernet/freescale/gianfar.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 44021243c187..8a5f4de9df1c 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -1310,13 +1310,18 @@ static inline int gfar_rxbd_unused(struct gfar_priv_rx_q *rxq)
return rxq->rx_ring_size + rxq->next_to_clean - rxq->next_to_use - 1;
}
-static inline struct rxbd8 *gfar_rxbd_lastfree(struct gfar_priv_rx_q *rxq)
+static inline u32 gfar_rxbd_dma_lastfree(struct gfar_priv_rx_q *rxq)
{
+ struct rxbd8 *bdp;
+ u32 bdp_dma;
int i;
i = rxq->next_to_use ? rxq->next_to_use - 1 : rxq->rx_ring_size - 1;
+ bdp = &rxq->rx_bd_base[i];
+ bdp_dma = lower_32_bits(rxq->rx_bd_dma_base);
+ bdp_dma += (uintptr_t)bdp - (uintptr_t)rxq->rx_bd_base;
- return &rxq->rx_bd_base[i];
+ return bdp_dma;
}
irqreturn_t gfar_receive(int irq, void *dev_id);