aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2008-07-09 13:47:05 -0400
committerKrzysztof Hałasa <khc@pm.waw.pl>2008-11-21 20:49:47 -0500
commit09fd65aa8ac934ea4ce7e55945a687292731e9c9 (patch)
tree0fb2af1c72f8018a58025375dda7c04e8683c744 /drivers
parentabc9d91a35a924c8db0e949cd443471672e37cdb (diff)
WAN: TX-done handler now uses the ownership bit in HD64572 drivers.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wan/hd64572.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index 22adec06d93a..e332fe906aba 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -338,7 +338,6 @@ static inline int sca_rx_done(port_t *port, int budget)
338static inline void sca_tx_done(port_t *port) 338static inline void sca_tx_done(port_t *port)
339{ 339{
340 struct net_device *dev = port_to_dev(port); 340 struct net_device *dev = port_to_dev(port);
341 u16 dmac = get_dmac_tx(port);
342 card_t* card = port_to_card(port); 341 card_t* card = port_to_card(port);
343 u8 stat; 342 u8 stat;
344 343
@@ -351,14 +350,10 @@ static inline void sca_tx_done(port_t *port)
351 DSR_TX(phy_node(port)), card); 350 DSR_TX(phy_node(port)), card);
352 351
353 while (1) { 352 while (1) {
354 pkt_desc __iomem *desc; 353 pkt_desc __iomem *desc = desc_address(port, port->txlast, 1);
355
356 u32 desc_off = desc_offset(port, port->txlast, 1);
357 u32 cda = sca_inl(dmac + CDAL, card);
358 if ((cda >= desc_off) && (cda < desc_off + sizeof(pkt_desc)))
359 break; /* Transmitter is/will_be sending this frame */
360 354
361 desc = desc_address(port, port->txlast, 1); 355 if (!(readb(&desc->stat) & ST_TX_OWNRSHP))
356 break; /* not yet transmitted */
362 dev->stats.tx_packets++; 357 dev->stats.tx_packets++;
363 dev->stats.tx_bytes += readw(&desc->len); 358 dev->stats.tx_bytes += readw(&desc->len);
364 writeb(0, &desc->stat); /* Free descriptor */ 359 writeb(0, &desc->stat); /* Free descriptor */