diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-10-07 11:44:34 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-09 09:40:37 +0400 |
commit | a4feee89ce4590c7a4aead49ca5a4853dc6ea5dc (patch) | |
tree | 781f0632c4405085d75e4f73394927dab39bb964 /drivers/net/ethernet/freescale/gianfar.h | |
parent | 83bfc3c4765c35ef0dfff8a3d6dedab88f3f50ea (diff) | |
download | linux-a4feee89ce4590c7a4aead49ca5a4853dc6ea5dc.tar.xz |
gianfar: Replace spin_event_timeout() with arch independent
Use arch independent code to replace the powerpc dependent
spin_event_timeout() from gfar_halt_nodisable().
Added GRS/GTS read accessors to clean-up the implementation
of gfar_halt_nodisable().
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.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 84632c569f2c..0b3772217a9a 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h @@ -1226,6 +1226,21 @@ static inline void gfar_write_isrg(struct gfar_private *priv) } } +static inline int gfar_is_dma_stopped(struct gfar_private *priv) +{ + struct gfar __iomem *regs = priv->gfargrp[0].regs; + + return ((gfar_read(®s->ievent) & (IEVENT_GRSC | IEVENT_GTSC)) == + (IEVENT_GRSC | IEVENT_GTSC)); +} + +static inline int gfar_is_rx_dma_stopped(struct gfar_private *priv) +{ + struct gfar __iomem *regs = priv->gfargrp[0].regs; + + return gfar_read(®s->ievent) & IEVENT_GRSC; +} + irqreturn_t gfar_receive(int irq, void *dev_id); int startup_gfar(struct net_device *dev); void stop_gfar(struct net_device *dev); |