aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 11:54:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 04:20:37 -0400
commitd7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb (patch)
tree3d33ec9251c264370e31a51b084abed238582861 /drivers/net/igb/igb_main.c
parent10d8e9073a320a1c9cc13f996bd600b477eb4872 (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.c29
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 *);
91static int igb_close(struct net_device *); 91static int igb_close(struct net_device *);
92static void igb_configure_tx(struct igb_adapter *); 92static void igb_configure_tx(struct igb_adapter *);
93static void igb_configure_rx(struct igb_adapter *); 93static void igb_configure_rx(struct igb_adapter *);
94static void igb_setup_tctl(struct igb_adapter *);
95static void igb_setup_rctl(struct igb_adapter *);
96static void igb_clean_all_tx_rings(struct igb_adapter *); 94static void igb_clean_all_tx_rings(struct igb_adapter *);
97static void igb_clean_all_rx_rings(struct igb_adapter *); 95static void igb_clean_all_rx_rings(struct igb_adapter *);
98static void igb_clean_tx_ring(struct igb_ring *); 96static void igb_clean_tx_ring(struct igb_ring *);
@@ -120,7 +118,6 @@ static void igb_setup_dca(struct igb_adapter *);
120static bool igb_clean_tx_irq(struct igb_q_vector *); 118static bool igb_clean_tx_irq(struct igb_q_vector *);
121static int igb_poll(struct napi_struct *, int); 119static int igb_poll(struct napi_struct *, int);
122static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int); 120static bool igb_clean_rx_irq_adv(struct igb_q_vector *, int *, int);
123static void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
124static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); 121static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
125static void igb_tx_timeout(struct net_device *); 122static void igb_tx_timeout(struct net_device *);
126static void igb_reset_task(struct work_struct *); 123static 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 **/
315static 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 **/
2090static void igb_setup_tctl(struct igb_adapter *adapter) 2076void 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 **/
2119static void igb_configure_tx_ring(struct igb_adapter *adapter, 2105void 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 **/
2342static void igb_setup_rctl(struct igb_adapter *adapter) 2328void 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 **/
2426static void igb_configure_rx_ring(struct igb_adapter *adapter, 2412void 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 **/
5037static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, 5023void 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;