diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-27 11:54:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-28 04:20:37 -0400 |
commit | d7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb (patch) | |
tree | 3d33ec9251c264370e31a51b084abed238582861 /drivers/net/igb/igb_main.c | |
parent | 10d8e9073a320a1c9cc13f996bd600b477eb4872 (diff) |
igb: re-use ring configuration code in ethtool testing
Since all of the ring code is now specific to the ring instead of the adapter
struct it is possible to cut a large section of code out of the ethtool
testing configuraiton since we can just use the existing functions to
configure the rings.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 9dd290cf754..576a4fac51d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -91,8 +91,6 @@ static int igb_open(struct net_device *); | |||
91 | static int igb_close(struct net_device *); | 91 | static int igb_close(struct net_device *); |
92 | static void igb_configure_tx(struct igb_adapter *); | 92 | static void igb_configure_tx(struct igb_adapter *); |
93 | static void igb_configure_rx(struct igb_adapter *); | 93 | static void igb_configure_rx(struct igb_adapter *); |
94 | static void igb_setup_tctl(struct igb_adapter *); | ||
95 | static void igb_setup_rctl(struct igb_adapter *); | ||
96 | static void igb_clean_all_tx_rings(struct igb_adapter *); | 94 | static void igb_clean_all_tx_rings(struct igb_adapter *); |
97 | static void igb_clean_all_rx_rings(struct igb_adapter *); | 95 | static void igb_clean_all_rx_rings(struct igb_adapter *); |
98 | static void igb_clean_tx_ring(struct igb_ring *); | 96 | static void igb_clean_tx_ring(struct igb_ring *); |
@@ -120,7 +118,6 @@ static void igb_setup_dca(struct igb_adapter *); | |||
120 | static bool igb_clean_tx_irq(struct igb_q_vector *); | 118 | static bool igb_clean_tx_irq(struct igb_q_vector *); |
121 | static int igb_poll(struct napi_struct *, int); | 119 | static int igb_poll(struct napi_struct *, int); |
122 | static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int); | 120 | static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int); |
123 | static void igb_alloc_rx_buffers_adv(struct igb_ring *, int); | ||
124 | static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); | 121 | static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); |
125 | static void igb_tx_timeout(struct net_device *); | 122 | static void igb_tx_timeout(struct net_device *); |
126 | static void igb_reset_task(struct work_struct *); | 123 | static void igb_reset_task(struct work_struct *); |
@@ -310,17 +307,6 @@ static char *igb_get_time_str(struct igb_adapter *adapter, | |||
310 | #endif | 307 | #endif |
311 | 308 | ||
312 | /** | 309 | /** |
313 | * igb_desc_unused - calculate if we have unused descriptors | ||
314 | **/ | ||
315 | static int igb_desc_unused(struct igb_ring *ring) | ||
316 | { | ||
317 | if (ring->next_to_clean > ring->next_to_use) | ||
318 | return ring->next_to_clean - ring->next_to_use - 1; | ||
319 | |||
320 | return ring->count + ring->next_to_clean - ring->next_to_use - 1; | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * igb_init_module - Driver Registration Routine | 310 | * igb_init_module - Driver Registration Routine |
325 | * | 311 | * |
326 | * igb_init_module is the first routine called when the driver is | 312 | * igb_init_module is the first routine called when the driver is |
@@ -2087,7 +2073,7 @@ static int igb_setup_all_tx_resources(struct igb_adapter *adapter) | |||
2087 | * igb_setup_tctl - configure the transmit control registers | 2073 | * igb_setup_tctl - configure the transmit control registers |
2088 | * @adapter: Board private structure | 2074 | * @adapter: Board private structure |
2089 | **/ | 2075 | **/ |
2090 | static void igb_setup_tctl(struct igb_adapter *adapter) | 2076 | void igb_setup_tctl(struct igb_adapter *adapter) |
2091 | { | 2077 | { |
2092 | struct e1000_hw *hw = &adapter->hw; | 2078 | struct e1000_hw *hw = &adapter->hw; |
2093 | u32 tctl; | 2079 | u32 tctl; |
@@ -2116,8 +2102,8 @@ static void igb_setup_tctl(struct igb_adapter *adapter) | |||
2116 | * | 2102 | * |
2117 | * Configure a transmit ring after a reset. | 2103 | * Configure a transmit ring after a reset. |
2118 | **/ | 2104 | **/ |
2119 | static void igb_configure_tx_ring(struct igb_adapter *adapter, | 2105 | void igb_configure_tx_ring(struct igb_adapter *adapter, |
2120 | struct igb_ring *ring) | 2106 | struct igb_ring *ring) |
2121 | { | 2107 | { |
2122 | struct e1000_hw *hw = &adapter->hw; | 2108 | struct e1000_hw *hw = &adapter->hw; |
2123 | u32 txdctl; | 2109 | u32 txdctl; |
@@ -2339,7 +2325,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter) | |||
2339 | * igb_setup_rctl - configure the receive control registers | 2325 | * igb_setup_rctl - configure the receive control registers |
2340 | * @adapter: Board private structure | 2326 | * @adapter: Board private structure |
2341 | **/ | 2327 | **/ |
2342 | static void igb_setup_rctl(struct igb_adapter *adapter) | 2328 | void igb_setup_rctl(struct igb_adapter *adapter) |
2343 | { | 2329 | { |
2344 | struct e1000_hw *hw = &adapter->hw; | 2330 | struct e1000_hw *hw = &adapter->hw; |
2345 | u32 rctl; | 2331 | u32 rctl; |
@@ -2423,8 +2409,8 @@ static void igb_rlpml_set(struct igb_adapter *adapter) | |||
2423 | * | 2409 | * |
2424 | * Configure the Rx unit of the MAC after a reset. | 2410 | * Configure the Rx unit of the MAC after a reset. |
2425 | **/ | 2411 | **/ |
2426 | static void igb_configure_rx_ring(struct igb_adapter *adapter, | 2412 | void igb_configure_rx_ring(struct igb_adapter *adapter, |
2427 | struct igb_ring *ring) | 2413 | struct igb_ring *ring) |
2428 | { | 2414 | { |
2429 | struct e1000_hw *hw = &adapter->hw; | 2415 | struct e1000_hw *hw = &adapter->hw; |
2430 | u64 rdba = ring->dma; | 2416 | u64 rdba = ring->dma; |
@@ -5034,8 +5020,7 @@ next_desc: | |||
5034 | * igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split | 5020 | * igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split |
5035 | * @adapter: address of board private structure | 5021 | * @adapter: address of board private structure |
5036 | **/ | 5022 | **/ |
5037 | static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, | 5023 | void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, int cleaned_count) |
5038 | int cleaned_count) | ||
5039 | { | 5024 | { |
5040 | struct net_device *netdev = rx_ring->netdev; | 5025 | struct net_device *netdev = rx_ring->netdev; |
5041 | union e1000_adv_rx_desc *rx_desc; | 5026 | union e1000_adv_rx_desc *rx_desc; |