]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: Reintroduce tg3_tx_ring_info
authorMatt Carlson <mcarlson@broadcom.com>
Wed, 27 Jul 2011 14:20:46 +0000 (14:20 +0000)
committerJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 08:40:52 +0000 (16:40 +0800)
The following patches will require the use of an additional flag in the
ring_info structure.  The use of this flag is tx path specific, so this
patch defines a specialized ring_info structure.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit df8944cf5cd3794c46e95e0404038376ee7f8dda)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c
drivers/net/tg3.h

index 94060d5a56657d609646d3f4ed76a7578af77008..900215da4c728d0d721372b5f3d17abc4998d57d 100644 (file)
@@ -4823,7 +4823,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
        txq = netdev_get_tx_queue(tp->dev, index);
 
        while (sw_idx != hw_idx) {
-               struct ring_info *ri = &tnapi->tx_buffers[sw_idx];
+               struct tg3_tx_ring_info *ri = &tnapi->tx_buffers[sw_idx];
                struct sk_buff *skb = ri->skb;
                int i, tx_bug = 0;
 
@@ -5935,7 +5935,7 @@ static void tg3_skb_error_unmap(struct tg3_napi *tnapi,
 {
        int i;
        u32 entry = tnapi->tx_prod;
-       struct ring_info *txb = &tnapi->tx_buffers[entry];
+       struct tg3_tx_ring_info *txb = &tnapi->tx_buffers[entry];
 
        pci_unmap_single(tnapi->tp->pdev,
                         dma_unmap_addr(txb, mapping),
@@ -6607,7 +6607,7 @@ static void tg3_free_rings(struct tg3 *tp)
                        continue;
 
                for (i = 0; i < TG3_TX_RING_SIZE; ) {
-                       struct ring_info *txp;
+                       struct tg3_tx_ring_info *txp;
                        struct sk_buff *skb;
                        unsigned int k;
 
@@ -6766,9 +6766,9 @@ static int tg3_alloc_consistent(struct tg3 *tp)
                 */
                if ((!i && !tg3_flag(tp, ENABLE_TSS)) ||
                    (i && tg3_flag(tp, ENABLE_TSS))) {
-                       tnapi->tx_buffers = kzalloc(sizeof(struct ring_info) *
-                                                   TG3_TX_RING_SIZE,
-                                                   GFP_KERNEL);
+                       tnapi->tx_buffers = kzalloc(
+                                              sizeof(struct tg3_tx_ring_info) *
+                                              TG3_TX_RING_SIZE, GFP_KERNEL);
                        if (!tnapi->tx_buffers)
                                goto err_out;
 
index 81cc62d63abfe029ff463bee93421c65f50d874c..27826a536de85b643ab35fe2ade6252d8e7bb541 100644 (file)
@@ -2652,6 +2652,11 @@ struct ring_info {
        DEFINE_DMA_UNMAP_ADDR(mapping);
 };
 
+struct tg3_tx_ring_info {
+       struct sk_buff                  *skb;
+       DEFINE_DMA_UNMAP_ADDR(mapping);
+};
+
 struct tg3_link_config {
        /* Describes what we're trying to get. */
        u32                             advertising;
@@ -2813,7 +2818,7 @@ struct tg3_napi {
        u32                             tx_pending;
        u32                             prodmbox;
        struct tg3_tx_buffer_desc       *tx_ring;
-       struct ring_info                *tx_buffers;
+       struct tg3_tx_ring_info         *tx_buffers;
 
        dma_addr_t                      status_mapping;
        dma_addr_t                      rx_rcb_mapping;