diff options
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 84632c569f2c..2805cfbf1765 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -1226,6 +1226,37 @@ static inline void gfar_write_isrg(struct gfar_private *priv) | |||
1226 | } | 1226 | } |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | static inline int gfar_is_dma_stopped(struct gfar_private *priv) | ||
1230 | { | ||
1231 | struct gfar __iomem *regs = priv->gfargrp[0].regs; | ||
1232 | |||
1233 | return ((gfar_read(®s->ievent) & (IEVENT_GRSC | IEVENT_GTSC)) == | ||
1234 | (IEVENT_GRSC | IEVENT_GTSC)); | ||
1235 | } | ||
1236 | |||
1237 | static inline int gfar_is_rx_dma_stopped(struct gfar_private *priv) | ||
1238 | { | ||
1239 | struct gfar __iomem *regs = priv->gfargrp[0].regs; | ||
1240 | |||
1241 | return gfar_read(®s->ievent) & IEVENT_GRSC; | ||
1242 | } | ||
1243 | |||
1244 | static inline void gfar_wmb(void) | ||
1245 | { | ||
1246 | #if defined(CONFIG_PPC) | ||
1247 | /* The powerpc-specific eieio() is used, as wmb() has too strong | ||
1248 | * semantics (it requires synchronization between cacheable and | ||
1249 | * uncacheable mappings, which eieio() doesn't provide and which we | ||
1250 | * don't need), thus requiring a more expensive sync instruction. At | ||
1251 | * some point, the set of architecture-independent barrier functions | ||
1252 | * should be expanded to include weaker barriers. | ||
1253 | */ | ||
1254 | eieio(); | ||
1255 | #else | ||
1256 | wmb(); /* order write acesses for BD (or FCB) fields */ | ||
1257 | #endif | ||
1258 | } | ||
1259 | |||
1229 | irqreturn_t gfar_receive(int irq, void *dev_id); | 1260 | irqreturn_t gfar_receive(int irq, void *dev_id); |
1230 | int startup_gfar(struct net_device *dev); | 1261 | int startup_gfar(struct net_device *dev); |
1231 | void stop_gfar(struct net_device *dev); | 1262 | void stop_gfar(struct net_device *dev); |