Commit ad5373ea authored by Denis Vlasenko's avatar Denis Vlasenko Committed by Linus Torvalds

[PATCH] fealnx #3: fix pointer substraction bug

parent 6a37b3e6
...@@ -1228,10 +1228,10 @@ static void tx_timeout(struct net_device *dev) ...@@ -1228,10 +1228,10 @@ static void tx_timeout(struct net_device *dev)
rmb(); rmb();
} }
writel((np->cur_tx - np->tx_ring)*sizeof(struct fealnx_desc) + writel(np->tx_ring_dma + ((char*)np->cur_tx - (char*)np->tx_ring),
np->tx_ring_dma, ioaddr + TXLBA); ioaddr + TXLBA);
writel((np->cur_rx - np->rx_ring)*sizeof(struct fealnx_desc) + writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring),
np->rx_ring_dma, ioaddr + RXLBA); ioaddr + RXLBA);
writel(np->bcrvalue, ioaddr + BCR); writel(np->bcrvalue, ioaddr + BCR);
...@@ -1415,7 +1415,7 @@ static void reset_rx_descriptors(struct net_device *dev) ...@@ -1415,7 +1415,7 @@ static void reset_rx_descriptors(struct net_device *dev)
allocate_rx_buffers(dev); allocate_rx_buffers(dev);
writel(np->rx_ring_dma + (np->cur_rx - np->rx_ring), writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring),
dev->base_addr + RXLBA); dev->base_addr + RXLBA);
writel(np->crvalue, dev->base_addr + TCRRCR); writel(np->crvalue, dev->base_addr + TCRRCR);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment