diff options
-rw-r--r-- | drivers/net/ipg.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index dfdc96fcadec..59898ce54dcf 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/mii.h> | 25 | #include <linux/mii.h> |
26 | #include <linux/mutex.h> | 26 | #include <linux/mutex.h> |
27 | 27 | ||
28 | #include <asm/div64.h> | ||
29 | |||
28 | #define IPG_RX_RING_BYTES (sizeof(struct ipg_rx) * IPG_RFDLIST_LENGTH) | 30 | #define IPG_RX_RING_BYTES (sizeof(struct ipg_rx) * IPG_RFDLIST_LENGTH) |
29 | #define IPG_TX_RING_BYTES (sizeof(struct ipg_tx) * IPG_TFDLIST_LENGTH) | 31 | #define IPG_TX_RING_BYTES (sizeof(struct ipg_tx) * IPG_TFDLIST_LENGTH) |
30 | #define IPG_RESET_MASK \ | 32 | #define IPG_RESET_MASK \ |
@@ -836,10 +838,14 @@ static void ipg_nic_txfree(struct net_device *dev) | |||
836 | { | 838 | { |
837 | struct ipg_nic_private *sp = netdev_priv(dev); | 839 | struct ipg_nic_private *sp = netdev_priv(dev); |
838 | void __iomem *ioaddr = sp->ioaddr; | 840 | void __iomem *ioaddr = sp->ioaddr; |
839 | const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) - | 841 | unsigned int curr; |
840 | (sp->txd_map / sizeof(struct ipg_tx)) - 1; | 842 | u64 txd_map; |
841 | unsigned int released, pending; | 843 | unsigned int released, pending; |
842 | 844 | ||
845 | txd_map = (u64)sp->txd_map; | ||
846 | curr = ipg_r32(TFD_LIST_PTR_0) - | ||
847 | do_div(txd_map, sizeof(struct ipg_tx)) - 1; | ||
848 | |||
843 | IPG_DEBUG_MSG("_nic_txfree\n"); | 849 | IPG_DEBUG_MSG("_nic_txfree\n"); |
844 | 850 | ||
845 | pending = sp->tx_current - sp->tx_dirty; | 851 | pending = sp->tx_current - sp->tx_dirty; |