aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ipg.c')
-rw-r--r--drivers/net/ipg.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index cd1650e99369..9752902f2d9a 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -857,21 +857,14 @@ static void init_tfdlist(struct net_device *dev)
857static void ipg_nic_txfree(struct net_device *dev) 857static void ipg_nic_txfree(struct net_device *dev)
858{ 858{
859 struct ipg_nic_private *sp = netdev_priv(dev); 859 struct ipg_nic_private *sp = netdev_priv(dev);
860 void __iomem *ioaddr = sp->ioaddr; 860 unsigned int released, pending, dirty;
861 unsigned int curr;
862 u64 txd_map;
863 unsigned int released, pending;
864
865 txd_map = (u64)sp->txd_map;
866 curr = ipg_r32(TFD_LIST_PTR_0) -
867 do_div(txd_map, sizeof(struct ipg_tx)) - 1;
868 861
869 IPG_DEBUG_MSG("_nic_txfree\n"); 862 IPG_DEBUG_MSG("_nic_txfree\n");
870 863
871 pending = sp->tx_current - sp->tx_dirty; 864 pending = sp->tx_current - sp->tx_dirty;
865 dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH;
872 866
873 for (released = 0; released < pending; released++) { 867 for (released = 0; released < pending; released++) {
874 unsigned int dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH;
875 struct sk_buff *skb = sp->TxBuff[dirty]; 868 struct sk_buff *skb = sp->TxBuff[dirty];
876 struct ipg_tx *txfd = sp->txd + dirty; 869 struct ipg_tx *txfd = sp->txd + dirty;
877 870
@@ -882,11 +875,8 @@ static void ipg_nic_txfree(struct net_device *dev)
882 * If the TFDDone bit is set, free the associated 875 * If the TFDDone bit is set, free the associated
883 * buffer. 876 * buffer.
884 */ 877 */
885 if (dirty == curr) 878 if (!(txfd->tfc & cpu_to_le64(IPG_TFC_TFDDONE)))
886 break; 879 break;
887
888 /* Setup TFDDONE for compatible issue. */
889 txfd->tfc |= cpu_to_le64(IPG_TFC_TFDDONE);
890 880
891 /* Free the transmit buffer. */ 881 /* Free the transmit buffer. */
892 if (skb) { 882 if (skb) {
@@ -898,6 +888,7 @@ static void ipg_nic_txfree(struct net_device *dev)
898 888
899 sp->TxBuff[dirty] = NULL; 889 sp->TxBuff[dirty] = NULL;
900 } 890 }
891 dirty = (dirty + 1) % IPG_TFDLIST_LENGTH;
901 } 892 }
902 893
903 sp->tx_dirty += released; 894 sp->tx_dirty += released;