diff options
author | David S. Miller <davem@davemloft.net> | 2009-05-19 00:08:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-19 00:08:20 -0400 |
commit | bb803cfbecb03a0cf8dc7e1864f18dda6631af00 (patch) | |
tree | 6c0989693bea6f50cfa5c6bb14f52ec19668def3 /drivers/net/mv643xx_eth.c | |
parent | 3878fb6fdbceecca20b15748f807340854220f06 (diff) | |
parent | 511e11e396dc596825ce04d53d7f6d579404bc01 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/scsi/fcoe/fcoe.c
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index d5838528791f..1361ddc8d31f 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -571,7 +571,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
571 | if (rxq->rx_curr_desc == rxq->rx_ring_size) | 571 | if (rxq->rx_curr_desc == rxq->rx_ring_size) |
572 | rxq->rx_curr_desc = 0; | 572 | rxq->rx_curr_desc = 0; |
573 | 573 | ||
574 | dma_unmap_single(NULL, rx_desc->buf_ptr, | 574 | dma_unmap_single(mp->dev->dev.parent, rx_desc->buf_ptr, |
575 | rx_desc->buf_size, DMA_FROM_DEVICE); | 575 | rx_desc->buf_size, DMA_FROM_DEVICE); |
576 | rxq->rx_desc_count--; | 576 | rxq->rx_desc_count--; |
577 | rx++; | 577 | rx++; |
@@ -677,8 +677,9 @@ static int rxq_refill(struct rx_queue *rxq, int budget) | |||
677 | 677 | ||
678 | rx_desc = rxq->rx_desc_area + rx; | 678 | rx_desc = rxq->rx_desc_area + rx; |
679 | 679 | ||
680 | rx_desc->buf_ptr = dma_map_single(NULL, skb->data, | 680 | rx_desc->buf_ptr = dma_map_single(mp->dev->dev.parent, |
681 | mp->skb_size, DMA_FROM_DEVICE); | 681 | skb->data, mp->skb_size, |
682 | DMA_FROM_DEVICE); | ||
682 | rx_desc->buf_size = mp->skb_size; | 683 | rx_desc->buf_size = mp->skb_size; |
683 | rxq->rx_skb[rx] = skb; | 684 | rxq->rx_skb[rx] = skb; |
684 | wmb(); | 685 | wmb(); |
@@ -717,6 +718,7 @@ static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb) | |||
717 | 718 | ||
718 | static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) | 719 | static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) |
719 | { | 720 | { |
721 | struct mv643xx_eth_private *mp = txq_to_mp(txq); | ||
720 | int nr_frags = skb_shinfo(skb)->nr_frags; | 722 | int nr_frags = skb_shinfo(skb)->nr_frags; |
721 | int frag; | 723 | int frag; |
722 | 724 | ||
@@ -745,10 +747,10 @@ static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
745 | 747 | ||
746 | desc->l4i_chk = 0; | 748 | desc->l4i_chk = 0; |
747 | desc->byte_cnt = this_frag->size; | 749 | desc->byte_cnt = this_frag->size; |
748 | desc->buf_ptr = dma_map_page(NULL, this_frag->page, | 750 | desc->buf_ptr = dma_map_page(mp->dev->dev.parent, |
749 | this_frag->page_offset, | 751 | this_frag->page, |
750 | this_frag->size, | 752 | this_frag->page_offset, |
751 | DMA_TO_DEVICE); | 753 | this_frag->size, DMA_TO_DEVICE); |
752 | } | 754 | } |
753 | } | 755 | } |
754 | 756 | ||
@@ -825,7 +827,8 @@ no_csum: | |||
825 | 827 | ||
826 | desc->l4i_chk = l4i_chk; | 828 | desc->l4i_chk = l4i_chk; |
827 | desc->byte_cnt = length; | 829 | desc->byte_cnt = length; |
828 | desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE); | 830 | desc->buf_ptr = dma_map_single(mp->dev->dev.parent, skb->data, |
831 | length, DMA_TO_DEVICE); | ||
829 | 832 | ||
830 | __skb_queue_tail(&txq->tx_skb, skb); | 833 | __skb_queue_tail(&txq->tx_skb, skb); |
831 | 834 | ||
@@ -955,10 +958,10 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
955 | } | 958 | } |
956 | 959 | ||
957 | if (cmd_sts & TX_FIRST_DESC) { | 960 | if (cmd_sts & TX_FIRST_DESC) { |
958 | dma_unmap_single(NULL, desc->buf_ptr, | 961 | dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, |
959 | desc->byte_cnt, DMA_TO_DEVICE); | 962 | desc->byte_cnt, DMA_TO_DEVICE); |
960 | } else { | 963 | } else { |
961 | dma_unmap_page(NULL, desc->buf_ptr, | 964 | dma_unmap_page(mp->dev->dev.parent, desc->buf_ptr, |
962 | desc->byte_cnt, DMA_TO_DEVICE); | 965 | desc->byte_cnt, DMA_TO_DEVICE); |
963 | } | 966 | } |
964 | 967 | ||
@@ -1891,9 +1894,9 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) | |||
1891 | mp->rx_desc_sram_size); | 1894 | mp->rx_desc_sram_size); |
1892 | rxq->rx_desc_dma = mp->rx_desc_sram_addr; | 1895 | rxq->rx_desc_dma = mp->rx_desc_sram_addr; |
1893 | } else { | 1896 | } else { |
1894 | rxq->rx_desc_area = dma_alloc_coherent(NULL, size, | 1897 | rxq->rx_desc_area = dma_alloc_coherent(mp->dev->dev.parent, |
1895 | &rxq->rx_desc_dma, | 1898 | size, &rxq->rx_desc_dma, |
1896 | GFP_KERNEL); | 1899 | GFP_KERNEL); |
1897 | } | 1900 | } |
1898 | 1901 | ||
1899 | if (rxq->rx_desc_area == NULL) { | 1902 | if (rxq->rx_desc_area == NULL) { |
@@ -1944,7 +1947,7 @@ out_free: | |||
1944 | if (index == 0 && size <= mp->rx_desc_sram_size) | 1947 | if (index == 0 && size <= mp->rx_desc_sram_size) |
1945 | iounmap(rxq->rx_desc_area); | 1948 | iounmap(rxq->rx_desc_area); |
1946 | else | 1949 | else |
1947 | dma_free_coherent(NULL, size, | 1950 | dma_free_coherent(mp->dev->dev.parent, size, |
1948 | rxq->rx_desc_area, | 1951 | rxq->rx_desc_area, |
1949 | rxq->rx_desc_dma); | 1952 | rxq->rx_desc_dma); |
1950 | 1953 | ||
@@ -1976,7 +1979,7 @@ static void rxq_deinit(struct rx_queue *rxq) | |||
1976 | rxq->rx_desc_area_size <= mp->rx_desc_sram_size) | 1979 | rxq->rx_desc_area_size <= mp->rx_desc_sram_size) |
1977 | iounmap(rxq->rx_desc_area); | 1980 | iounmap(rxq->rx_desc_area); |
1978 | else | 1981 | else |
1979 | dma_free_coherent(NULL, rxq->rx_desc_area_size, | 1982 | dma_free_coherent(mp->dev->dev.parent, rxq->rx_desc_area_size, |
1980 | rxq->rx_desc_area, rxq->rx_desc_dma); | 1983 | rxq->rx_desc_area, rxq->rx_desc_dma); |
1981 | 1984 | ||
1982 | kfree(rxq->rx_skb); | 1985 | kfree(rxq->rx_skb); |
@@ -2004,9 +2007,9 @@ static int txq_init(struct mv643xx_eth_private *mp, int index) | |||
2004 | mp->tx_desc_sram_size); | 2007 | mp->tx_desc_sram_size); |
2005 | txq->tx_desc_dma = mp->tx_desc_sram_addr; | 2008 | txq->tx_desc_dma = mp->tx_desc_sram_addr; |
2006 | } else { | 2009 | } else { |
2007 | txq->tx_desc_area = dma_alloc_coherent(NULL, size, | 2010 | txq->tx_desc_area = dma_alloc_coherent(mp->dev->dev.parent, |
2008 | &txq->tx_desc_dma, | 2011 | size, &txq->tx_desc_dma, |
2009 | GFP_KERNEL); | 2012 | GFP_KERNEL); |
2010 | } | 2013 | } |
2011 | 2014 | ||
2012 | if (txq->tx_desc_area == NULL) { | 2015 | if (txq->tx_desc_area == NULL) { |
@@ -2050,7 +2053,7 @@ static void txq_deinit(struct tx_queue *txq) | |||
2050 | txq->tx_desc_area_size <= mp->tx_desc_sram_size) | 2053 | txq->tx_desc_area_size <= mp->tx_desc_sram_size) |
2051 | iounmap(txq->tx_desc_area); | 2054 | iounmap(txq->tx_desc_area); |
2052 | else | 2055 | else |
2053 | dma_free_coherent(NULL, txq->tx_desc_area_size, | 2056 | dma_free_coherent(mp->dev->dev.parent, txq->tx_desc_area_size, |
2054 | txq->tx_desc_area, txq->tx_desc_dma); | 2057 | txq->tx_desc_area, txq->tx_desc_dma); |
2055 | } | 2058 | } |
2056 | 2059 | ||