diff options
-rw-r--r-- | drivers/net/sundance.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index be1faa020392..91cd2f52e628 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -1079,6 +1079,8 @@ reset_tx (struct net_device *dev) | |||
1079 | 1079 | ||
1080 | /* free all tx skbuff */ | 1080 | /* free all tx skbuff */ |
1081 | for (i = 0; i < TX_RING_SIZE; i++) { | 1081 | for (i = 0; i < TX_RING_SIZE; i++) { |
1082 | np->tx_ring[i].next_desc = 0; | ||
1083 | |||
1082 | skb = np->tx_skbuff[i]; | 1084 | skb = np->tx_skbuff[i]; |
1083 | if (skb) { | 1085 | if (skb) { |
1084 | pci_unmap_single(np->pci_dev, | 1086 | pci_unmap_single(np->pci_dev, |
@@ -1094,6 +1096,10 @@ reset_tx (struct net_device *dev) | |||
1094 | } | 1096 | } |
1095 | np->cur_tx = np->dirty_tx = 0; | 1097 | np->cur_tx = np->dirty_tx = 0; |
1096 | np->cur_task = 0; | 1098 | np->cur_task = 0; |
1099 | |||
1100 | np->last_tx = 0; | ||
1101 | iowrite8(127, ioaddr + TxDMAPollPeriod); | ||
1102 | |||
1097 | iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); | 1103 | iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); |
1098 | return 0; | 1104 | return 0; |
1099 | } | 1105 | } |
@@ -1162,8 +1168,14 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1162 | sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) << 16); | 1168 | sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) << 16); |
1163 | /* No need to reset the Tx pointer here */ | 1169 | /* No need to reset the Tx pointer here */ |
1164 | } | 1170 | } |
1165 | /* Restart the Tx. */ | 1171 | /* Restart the Tx. Need to make sure tx enabled */ |
1166 | iowrite16 (TxEnable, ioaddr + MACCtrl1); | 1172 | i = 10; |
1173 | do { | ||
1174 | iowrite16(ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); | ||
1175 | if (ioread16(ioaddr + MACCtrl1) & TxEnabled) | ||
1176 | break; | ||
1177 | mdelay(1); | ||
1178 | } while (--i); | ||
1167 | } | 1179 | } |
1168 | /* Yup, this is a documentation bug. It cost me *hours*. */ | 1180 | /* Yup, this is a documentation bug. It cost me *hours*. */ |
1169 | iowrite16 (0, ioaddr + TxStatus); | 1181 | iowrite16 (0, ioaddr + TxStatus); |