aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2008-07-09 17:39:12 -0400
committerKrzysztof Hałasa <khc@pm.waw.pl>2008-11-21 20:49:48 -0500
commit0b59cef885f7d451acad02f70c9712f1ef3638b1 (patch)
tree78a740b3b1b62efd0310e00e44ef0d8338c36336 /drivers/net/wan
parent61e0a6a268947f7385282c6841f3e3d64b4c5cb9 (diff)
WAN: HD64572 drivers don't use next_desc() anymore.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/hd64572.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index c7eff0a66a8e..6a6fe6a7c44b 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -78,13 +78,6 @@ static inline void disable_intr(port_t *port)
78 (port->chan ? 0x00FF00FF : 0xFF00FF00), IER0, port->card); 78 (port->chan ? 0x00FF00FF : 0xFF00FF00), IER0, port->card);
79} 79}
80 80
81static inline u16 next_desc(port_t *port, u16 desc, int transmit)
82{
83 return (desc + 1) % (transmit ? port->card->tx_ring_buffers
84 : port->card->rx_ring_buffers);
85}
86
87
88static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit) 81static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit)
89{ 82{
90 u16 rx_buffs = port->card->rx_ring_buffers; 83 u16 rx_buffs = port->card->rx_ring_buffers;
@@ -291,7 +284,7 @@ static inline int sca_rx_done(port_t *port, int budget)
291 284
292 /* Set new error descriptor address */ 285 /* Set new error descriptor address */
293 sca_outl(desc_off, dmac + EDAL, card); 286 sca_outl(desc_off, dmac + EDAL, card);
294 port->rxin = next_desc(port, port->rxin, 0); 287 port->rxin = (port->rxin + 1) % card->rx_ring_buffers;
295 } 288 }
296 289
297 /* make sure RX DMA is enabled */ 290 /* make sure RX DMA is enabled */
@@ -329,7 +322,7 @@ static inline void sca_tx_done(port_t *port)
329 dev->stats.tx_bytes += readw(&desc->len); 322 dev->stats.tx_bytes += readw(&desc->len);
330 } 323 }
331 writeb(0, &desc->stat); /* Free descriptor */ 324 writeb(0, &desc->stat); /* Free descriptor */
332 port->txlast = next_desc(port, port->txlast, 1); 325 port->txlast = (port->txlast + 1) % card->tx_ring_buffers;
333 } 326 }
334 327
335 netif_wake_queue(dev); 328 netif_wake_queue(dev);
@@ -599,7 +592,7 @@ static int sca_xmit(struct sk_buff *skb, struct net_device *dev)
599 writeb(ST_TX_EOM, &desc->stat); 592 writeb(ST_TX_EOM, &desc->stat);
600 dev->trans_start = jiffies; 593 dev->trans_start = jiffies;
601 594
602 port->txin = next_desc(port, port->txin, 1); 595 port->txin = (port->txin + 1) % card->tx_ring_buffers;
603 sca_outl(desc_offset(port, port->txin, 1), 596 sca_outl(desc_offset(port, port->txin, 1),
604 get_dmac_tx(port) + EDAL, card); 597 get_dmac_tx(port) + EDAL, card);
605 598