e1000: rename struct e1000_buffer to e1000_tx_buffer
authorFlorian Westphal <fw@strlen.de>
Wed, 3 Sep 2014 13:34:31 +0000 (13:34 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 12 Sep 2014 09:00:13 +0000 (02:00 -0700)
and remove *page, its only used for Rx.

Signed-off-by: Florian Westphal <fw@strlen.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000/e1000.h
drivers/net/ethernet/intel/e1000/e1000_ethtool.c
drivers/net/ethernet/intel/e1000/e1000_main.c

index 81efe3358350fd23eccc42cfb2705733c1fe0e72..4c2a1021aea3de71a42f00469592cf4bf79112ea 100644 (file)
@@ -148,16 +148,15 @@ struct e1000_adapter;
 /* wrapper around a pointer to a socket buffer,
  * so a DMA handle can be stored along with the buffer
  */
-struct e1000_buffer {
+struct e1000_tx_buffer {
        struct sk_buff *skb;
        dma_addr_t dma;
-       struct page *page;
        unsigned long time_stamp;
        u16 length;
        u16 next_to_watch;
-       unsigned int segs;
+       bool mapped_as_page;
+       unsigned short segs;
        unsigned int bytecount;
-       u16 mapped_as_page;
 };
 
 struct e1000_rx_buffer {
@@ -180,7 +179,7 @@ struct e1000_tx_ring {
        /* next descriptor to check for DD status bit */
        unsigned int next_to_clean;
        /* array of buffer information structs */
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
 
        u16 tdh;
        u16 tdt;
index 5ebc2407595b88fb76d4c5e28dd0cf687a3c4e20..c7280d9c638ed858194fb677933ff96d17afeb20 100644 (file)
@@ -1006,7 +1006,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
        if (!txdr->count)
                txdr->count = E1000_DEFAULT_TXD;
 
-       txdr->buffer_info = kcalloc(txdr->count, sizeof(struct e1000_buffer),
+       txdr->buffer_info = kcalloc(txdr->count, sizeof(struct e1000_tx_buffer),
                                    GFP_KERNEL);
        if (!txdr->buffer_info) {
                ret_val = 1;
index 694db74ddea3df762e02cee4e1c67ba20e29bef7..ccb65ad27fc6a26e8b18f0d03cbb5ea34dd6dd2e 100644 (file)
@@ -1497,7 +1497,7 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
        struct pci_dev *pdev = adapter->pdev;
        int size;
 
-       size = sizeof(struct e1000_buffer) * txdr->count;
+       size = sizeof(struct e1000_tx_buffer) * txdr->count;
        txdr->buffer_info = vzalloc(size);
        if (!txdr->buffer_info)
                return -ENOMEM;
@@ -1947,8 +1947,9 @@ void e1000_free_all_tx_resources(struct e1000_adapter *adapter)
                e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
 }
 
-static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
-                                            struct e1000_buffer *buffer_info)
+static void
+e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
+                                struct e1000_tx_buffer *buffer_info)
 {
        if (buffer_info->dma) {
                if (buffer_info->mapped_as_page)
@@ -1977,7 +1978,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
                                struct e1000_tx_ring *tx_ring)
 {
        struct e1000_hw *hw = &adapter->hw;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        unsigned long size;
        unsigned int i;
 
@@ -1989,7 +1990,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
        }
 
        netdev_reset_queue(adapter->netdev);
-       size = sizeof(struct e1000_buffer) * tx_ring->count;
+       size = sizeof(struct e1000_tx_buffer) * tx_ring->count;
        memset(tx_ring->buffer_info, 0, size);
 
        /* Zero out the descriptor ring */
@@ -2678,7 +2679,7 @@ static int e1000_tso(struct e1000_adapter *adapter,
                     __be16 protocol)
 {
        struct e1000_context_desc *context_desc;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        unsigned int i;
        u32 cmd_length = 0;
        u16 ipcse = 0, tucse, mss;
@@ -2750,7 +2751,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
                          __be16 protocol)
 {
        struct e1000_context_desc *context_desc;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        unsigned int i;
        u8 css;
        u32 cmd_len = E1000_TXD_CMD_DEXT;
@@ -2809,7 +2810,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
 {
        struct e1000_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        unsigned int len = skb_headlen(skb);
        unsigned int offset = 0, size, count = 0, i;
        unsigned int f, bytecount, segs;
@@ -2955,7 +2956,7 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
 {
        struct e1000_hw *hw = &adapter->hw;
        struct e1000_tx_desc *tx_desc = NULL;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        u32 txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS;
        unsigned int i;
 
@@ -3373,7 +3374,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
 
        for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
                struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
-               struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i];
+               struct e1000_tx_buffer *buffer_info = &tx_ring->buffer_info[i];
                struct my_u { __le64 a; __le64 b; };
                struct my_u *u = (struct my_u *)tx_desc;
                const char *type;
@@ -3811,7 +3812,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
        struct e1000_hw *hw = &adapter->hw;
        struct net_device *netdev = adapter->netdev;
        struct e1000_tx_desc *tx_desc, *eop_desc;
-       struct e1000_buffer *buffer_info;
+       struct e1000_tx_buffer *buffer_info;
        unsigned int i, eop;
        unsigned int count = 0;
        unsigned int total_tx_bytes=0, total_tx_packets=0;