mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 07:01:57 +00:00
[PATCH] sky2: dual port tx completion
Sometimes on dual port cards, one tx complete may cover both ports. To handle that rearrange poll routine to lookup at end. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
parent
018d1c667e
commit
2224795d7e
@ -1242,6 +1242,9 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
|
|||||||
struct net_device *dev = sky2->netdev;
|
struct net_device *dev = sky2->netdev;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
if (done == sky2->tx_cons)
|
||||||
|
return;
|
||||||
|
|
||||||
if (unlikely(netif_msg_tx_done(sky2)))
|
if (unlikely(netif_msg_tx_done(sky2)))
|
||||||
printk(KERN_DEBUG "%s: tx done, up to %u\n",
|
printk(KERN_DEBUG "%s: tx done, up to %u\n",
|
||||||
dev->name, done);
|
dev->name, done);
|
||||||
@ -1711,16 +1714,18 @@ error:
|
|||||||
goto resubmit;
|
goto resubmit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Transmit ring index in reported status block is encoded as:
|
/*
|
||||||
*
|
* Check for transmit complete
|
||||||
* | TXS2 | TXA2 | TXS1 | TXA1
|
|
||||||
*/
|
*/
|
||||||
static inline u16 tx_index(u8 port, u32 status, u16 len)
|
static inline void sky2_tx_check(struct sky2_hw *hw, int port)
|
||||||
{
|
{
|
||||||
if (port == 0)
|
struct net_device *dev = hw->dev[port];
|
||||||
return status & 0xfff;
|
|
||||||
else
|
if (dev && netif_running(dev)) {
|
||||||
return ((status >> 24) & 0xff) | (len & 0xf) << 8;
|
sky2_tx_complete(netdev_priv(dev),
|
||||||
|
sky2_read16(hw, port == 0
|
||||||
|
? STAT_TXA1_RIDX : STAT_TXA2_RIDX));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1803,8 +1808,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OP_TXINDEXLE:
|
case OP_TXINDEXLE:
|
||||||
sky2_tx_complete(sky2,
|
/* pick up transmit status later */
|
||||||
tx_index(sky2->port, status, length));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1816,6 +1820,8 @@ static int sky2_poll(struct net_device *dev0, int *budget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
exit_loop:
|
exit_loop:
|
||||||
|
sky2_tx_check(hw, 0);
|
||||||
|
sky2_tx_check(hw, 1);
|
||||||
|
|
||||||
mmiowb();
|
mmiowb();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user