aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-02-05 19:29:43 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-07 18:48:56 -0500
commitd9a9720eab7437aa7f34dcbb92bb4bc8cc36bba9 (patch)
tree868fe3a6310f3fdb34328c887d006e9f406d671e /drivers/net/spider_net.c
parentb7e36bfa9ffa2f6097b622ba07a95d823db553e4 (diff)
Spidernet: Rework RX linked list
Make the hardware perceive the RX descriptor ring as a null-terminated linked list, instead of a circular ring. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r--drivers/net/spider_net.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index d73018b5cfc8..bf6ff39e02bb 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -419,9 +419,13 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
419 card->spider_stats.rx_iommu_map_error++; 419 card->spider_stats.rx_iommu_map_error++;
420 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE; 420 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
421 } else { 421 } else {
422 descr->next_descr_addr = 0;
422 wmb(); 423 wmb();
423 descr->dmac_cmd_status = SPIDER_NET_DESCR_CARDOWNED | 424 descr->dmac_cmd_status = SPIDER_NET_DESCR_CARDOWNED |
424 SPIDER_NET_DMAC_NOINTR_COMPLETE; 425 SPIDER_NET_DMAC_NOINTR_COMPLETE;
426
427 wmb();
428 descr->prev->next_descr_addr = descr->bus_addr;
425 } 429 }
426 430
427 return 0; 431 return 0;
@@ -1650,7 +1654,6 @@ int
1650spider_net_open(struct net_device *netdev) 1654spider_net_open(struct net_device *netdev)
1651{ 1655{
1652 struct spider_net_card *card = netdev_priv(netdev); 1656 struct spider_net_card *card = netdev_priv(netdev);
1653 struct spider_net_descr *descr;
1654 int result; 1657 int result;
1655 1658
1656 result = spider_net_init_chain(card, &card->tx_chain); 1659 result = spider_net_init_chain(card, &card->tx_chain);
@@ -1662,13 +1665,6 @@ spider_net_open(struct net_device *netdev)
1662 if (result) 1665 if (result)
1663 goto alloc_rx_failed; 1666 goto alloc_rx_failed;
1664 1667
1665 /* Make a ring of of bus addresses */
1666 descr = card->rx_chain.ring;
1667 do {
1668 descr->next_descr_addr = descr->next->bus_addr;
1669 descr = descr->next;
1670 } while (descr != card->rx_chain.ring);
1671
1672 /* Allocate rx skbs */ 1668 /* Allocate rx skbs */
1673 if (spider_net_alloc_rx_skbs(card)) 1669 if (spider_net_alloc_rx_skbs(card))
1674 goto alloc_skbs_failed; 1670 goto alloc_skbs_failed;