mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
[ar71xx] ag71xx driver: handle TX timout
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13537 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -551,6 +551,24 @@ static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static void ag71xx_tx_timeout(struct net_device *dev)
|
||||
{
|
||||
struct ag71xx *ag = netdev_priv(dev);
|
||||
|
||||
if (netif_msg_tx_err(ag))
|
||||
printk(KERN_DEBUG "%s: tx timeout\n", ag->dev->name);
|
||||
|
||||
schedule_work(&ag->restart_work);
|
||||
}
|
||||
|
||||
static void ag71xx_restart_work_func(struct work_struct *work)
|
||||
{
|
||||
struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
|
||||
|
||||
ag71xx_stop(ag->dev);
|
||||
ag71xx_open(ag->dev);
|
||||
}
|
||||
|
||||
static void ag71xx_tx_packets(struct ag71xx *ag)
|
||||
{
|
||||
struct ag71xx_ring *ring = &ag->tx_ring;
|
||||
@@ -824,6 +842,9 @@ static int __init ag71xx_probe(struct platform_device *pdev)
|
||||
dev->do_ioctl = ag71xx_do_ioctl;
|
||||
dev->ethtool_ops = &ag71xx_ethtool_ops;
|
||||
|
||||
dev->tx_timeout = ag71xx_tx_timeout;
|
||||
INIT_WORK(&ag->restart_work, ag71xx_restart_work_func);
|
||||
|
||||
netif_napi_add(dev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT);
|
||||
|
||||
if (is_valid_ether_addr(pdata->mac_addr))
|
||||
|
||||
Reference in New Issue
Block a user