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.h | |
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.h')
-rw-r--r-- | drivers/net/igb/igb.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 2416c12af3fe..8b189a0c52ef 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -223,6 +223,15 @@ struct igb_ring { | |||
223 | #define E1000_TX_CTXTDESC_ADV(R, i) \ | 223 | #define E1000_TX_CTXTDESC_ADV(R, i) \ |
224 | (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i])) | 224 | (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i])) |
225 | 225 | ||
226 | /* igb_desc_unused - calculate if we have unused descriptors */ | ||
227 | static inline int igb_desc_unused(struct igb_ring *ring) | ||
228 | { | ||
229 | if (ring->next_to_clean > ring->next_to_use) | ||
230 | return ring->next_to_clean - ring->next_to_use - 1; | ||
231 | |||
232 | return ring->count + ring->next_to_clean - ring->next_to_use - 1; | ||
233 | } | ||
234 | |||
226 | /* board specific private data structure */ | 235 | /* board specific private data structure */ |
227 | 236 | ||
228 | struct igb_adapter { | 237 | struct igb_adapter { |
@@ -336,6 +345,11 @@ extern int igb_setup_tx_resources(struct igb_ring *); | |||
336 | extern int igb_setup_rx_resources(struct igb_ring *); | 345 | extern int igb_setup_rx_resources(struct igb_ring *); |
337 | extern void igb_free_tx_resources(struct igb_ring *); | 346 | extern void igb_free_tx_resources(struct igb_ring *); |
338 | extern void igb_free_rx_resources(struct igb_ring *); | 347 | extern void igb_free_rx_resources(struct igb_ring *); |
348 | extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *); | ||
349 | extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *); | ||
350 | extern void igb_setup_tctl(struct igb_adapter *); | ||
351 | extern void igb_setup_rctl(struct igb_adapter *); | ||
352 | extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int); | ||
339 | extern void igb_update_stats(struct igb_adapter *); | 353 | extern void igb_update_stats(struct igb_adapter *); |
340 | extern void igb_set_ethtool_ops(struct net_device *); | 354 | extern void igb_set_ethtool_ops(struct net_device *); |
341 | 355 | ||