ar71xx: disable flow control for ar724x, it can get stuck in a loop of continously...
[openwrt/openwrt.git] / target / linux / ar71xx / files / drivers / net / ag71xx / ag71xx_main.c
index a0af8aaa608bf514eaf04a51142cb525b86c756d..08735a99ac0010f61314d1a767b2b314592eb920 100644 (file)
@@ -524,11 +524,7 @@ static void ag71xx_hw_init(struct ag71xx *ag)
        mdelay(100);
 
        /* setup MAC configuration registers */
-       if (pdata->is_ar724x)
-               ag71xx_wr(ag, AG71XX_REG_MAC_CFG1,
-                         MAC_CFG1_INIT | MAC_CFG1_TFC | MAC_CFG1_RFC);
-       else
-               ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
+       ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
 
        ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
                  MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);
@@ -574,16 +570,12 @@ static void ag71xx_hw_stop(struct ag71xx *ag)
 static int ag71xx_open(struct net_device *dev)
 {
        struct ag71xx *ag = netdev_priv(dev);
-       struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
        int ret;
 
        ret = ag71xx_rings_init(ag);
        if (ret)
                goto err;
 
-       if (pdata->is_ar724x)
-               ag71xx_hw_init(ag);
-
        napi_enable(&ag->napi);
 
        netif_carrier_off(dev);
@@ -656,6 +648,7 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
                                  DMA_TO_DEVICE);
 
        ring->buf[i].skb = skb;
+       ring->buf[i].timestamp = jiffies;
 
        /* setup descriptor fields */
        desc->data = (u32) dma_addr;
@@ -747,8 +740,13 @@ static void ag71xx_tx_timeout(struct net_device *dev)
 static void ag71xx_restart_work_func(struct work_struct *work)
 {
        struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
+       struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
 
        ag71xx_stop(ag->dev);
+
+       if (pdata->is_ar724x)
+               ag71xx_hw_init(ag);
+
        ag71xx_open(ag->dev);
 }
 
@@ -1058,7 +1056,7 @@ static int __devinit ag71xx_probe(struct platform_device *pdev)
 
        dev->irq = platform_get_irq(pdev, 0);
        err = request_irq(dev->irq, ag71xx_interrupt,
-                         IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
+                         IRQF_DISABLED,
                          dev->name, dev);
        if (err) {
                dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);