aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethoc.c')
-rw-r--r--drivers/net/ethoc.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index a25f8ed8109d..f1c565282d58 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -222,24 +222,25 @@ struct ethoc_bd {
222 u32 addr; 222 u32 addr;
223}; 223};
224 224
225static u32 ethoc_read(struct ethoc *dev, loff_t offset) 225static inline u32 ethoc_read(struct ethoc *dev, loff_t offset)
226{ 226{
227 return ioread32(dev->iobase + offset); 227 return ioread32(dev->iobase + offset);
228} 228}
229 229
230static void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) 230static inline void ethoc_write(struct ethoc *dev, loff_t offset, u32 data)
231{ 231{
232 iowrite32(data, dev->iobase + offset); 232 iowrite32(data, dev->iobase + offset);
233} 233}
234 234
235static void ethoc_read_bd(struct ethoc *dev, int index, struct ethoc_bd *bd) 235static inline void ethoc_read_bd(struct ethoc *dev, int index,
236 struct ethoc_bd *bd)
236{ 237{
237 loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); 238 loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
238 bd->stat = ethoc_read(dev, offset + 0); 239 bd->stat = ethoc_read(dev, offset + 0);
239 bd->addr = ethoc_read(dev, offset + 4); 240 bd->addr = ethoc_read(dev, offset + 4);
240} 241}
241 242
242static void ethoc_write_bd(struct ethoc *dev, int index, 243static inline void ethoc_write_bd(struct ethoc *dev, int index,
243 const struct ethoc_bd *bd) 244 const struct ethoc_bd *bd)
244{ 245{
245 loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); 246 loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd));
@@ -247,33 +248,33 @@ static void ethoc_write_bd(struct ethoc *dev, int index,
247 ethoc_write(dev, offset + 4, bd->addr); 248 ethoc_write(dev, offset + 4, bd->addr);
248} 249}
249 250
250static void ethoc_enable_irq(struct ethoc *dev, u32 mask) 251static inline void ethoc_enable_irq(struct ethoc *dev, u32 mask)
251{ 252{
252 u32 imask = ethoc_read(dev, INT_MASK); 253 u32 imask = ethoc_read(dev, INT_MASK);
253 imask |= mask; 254 imask |= mask;
254 ethoc_write(dev, INT_MASK, imask); 255 ethoc_write(dev, INT_MASK, imask);
255} 256}
256 257
257static void ethoc_disable_irq(struct ethoc *dev, u32 mask) 258static inline void ethoc_disable_irq(struct ethoc *dev, u32 mask)
258{ 259{
259 u32 imask = ethoc_read(dev, INT_MASK); 260 u32 imask = ethoc_read(dev, INT_MASK);
260 imask &= ~mask; 261 imask &= ~mask;
261 ethoc_write(dev, INT_MASK, imask); 262 ethoc_write(dev, INT_MASK, imask);
262} 263}
263 264
264static void ethoc_ack_irq(struct ethoc *dev, u32 mask) 265static inline void ethoc_ack_irq(struct ethoc *dev, u32 mask)
265{ 266{
266 ethoc_write(dev, INT_SOURCE, mask); 267 ethoc_write(dev, INT_SOURCE, mask);
267} 268}
268 269
269static void ethoc_enable_rx_and_tx(struct ethoc *dev) 270static inline void ethoc_enable_rx_and_tx(struct ethoc *dev)
270{ 271{
271 u32 mode = ethoc_read(dev, MODER); 272 u32 mode = ethoc_read(dev, MODER);
272 mode |= MODER_RXEN | MODER_TXEN; 273 mode |= MODER_RXEN | MODER_TXEN;
273 ethoc_write(dev, MODER, mode); 274 ethoc_write(dev, MODER, mode);
274} 275}
275 276
276static void ethoc_disable_rx_and_tx(struct ethoc *dev) 277static inline void ethoc_disable_rx_and_tx(struct ethoc *dev)
277{ 278{
278 u32 mode = ethoc_read(dev, MODER); 279 u32 mode = ethoc_read(dev, MODER);
279 mode &= ~(MODER_RXEN | MODER_TXEN); 280 mode &= ~(MODER_RXEN | MODER_TXEN);
@@ -507,7 +508,7 @@ static irqreturn_t ethoc_interrupt(int irq, void *dev_id)
507 return IRQ_NONE; 508 return IRQ_NONE;
508 } 509 }
509 510
510 ethoc_ack_irq(priv, INT_MASK_ALL); 511 ethoc_ack_irq(priv, pending);
511 512
512 if (pending & INT_MASK_BUSY) { 513 if (pending & INT_MASK_BUSY) {
513 dev_err(&dev->dev, "packet dropped\n"); 514 dev_err(&dev->dev, "packet dropped\n");