#include <linux/phy.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
+#include <linux/workqueue.h>
#include <linux/bitops.h>
#define ETH_FCS_LEN 4
#define AG71XX_DRV_NAME "ag71xx"
-#define AG71XX_DRV_VERSION "0.5.10"
+#define AG71XX_DRV_VERSION "0.5.11"
#define AG71XX_NAPI_WEIGHT 64
unsigned int link;
unsigned int speed;
int duplex;
+
+ struct work_struct restart_work;
};
extern struct ethtool_ops ag71xx_ethtool_ops;
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;
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))