summaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 16:54:23 +0100
committerDavid S. Miller <davem@davemloft.net>2009-10-28 09:20:37 +0100
commitd7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb (patch)
tree3d33ec9251c264370e31a51b084abed238582861 /drivers/net/igb/igb.h
parentigb: setup vlan tag replication stripping in igb_vmm_control (diff)
downloadlinux-d7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb.tar.xz
linux-d7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb.zip
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.h14
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 {
#define E1000_TX_CTXTDESC_ADV(R, i) \
(&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))
+/* igb_desc_unused - calculate if we have unused descriptors */
+static inline int igb_desc_unused(struct igb_ring *ring)
+{
+ if (ring->next_to_clean > ring->next_to_use)
+ return ring->next_to_clean - ring->next_to_use - 1;
+
+ return ring->count + ring->next_to_clean - ring->next_to_use - 1;
+}
+
/* board specific private data structure */
struct igb_adapter {
@@ -336,6 +345,11 @@ extern int igb_setup_tx_resources(struct igb_ring *);
extern int igb_setup_rx_resources(struct igb_ring *);
extern void igb_free_tx_resources(struct igb_ring *);
extern void igb_free_rx_resources(struct igb_ring *);
+extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
+extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
+extern void igb_setup_tctl(struct igb_adapter *);
+extern void igb_setup_rctl(struct igb_adapter *);
+extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
extern void igb_update_stats(struct igb_adapter *);
extern void igb_set_ethtool_ops(struct net_device *);