diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-27 11:54:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-28 04:20:40 -0400 |
commit | b1a436c34c44c6e3fb03c12545d87b4c2818f31d (patch) | |
tree | 1ce6ae206757ad9e0bf30390bd7f4e8453b93d31 /drivers/net | |
parent | d7ee5b3a78f57a8ca9ca2392ff5d03f91ec90bdb (diff) |
igb: make tx ring map and free functionality non-static
This change makes a minor change to the xmit_frame_ring_adv funcition in that
it moves 2 checks from it into the xmit_frame_adv since the checks were not
ring specific. In addition it exports the xmit_frame_ring_adv and the
unmap_and_free_tx_resource calls so that they can be used by other code such
as the ethtool loopback testing calls.
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')
-rw-r--r-- | drivers/net/igb/igb.h | 3 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 35 |
2 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 8b189a0c52ef..6c35c9029a50 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -349,6 +349,9 @@ 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 *); | 349 | extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *); |
350 | extern void igb_setup_tctl(struct igb_adapter *); | 350 | extern void igb_setup_tctl(struct igb_adapter *); |
351 | extern void igb_setup_rctl(struct igb_adapter *); | 351 | extern void igb_setup_rctl(struct igb_adapter *); |
352 | extern netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *, struct igb_ring *); | ||
353 | extern void igb_unmap_and_free_tx_resource(struct igb_ring *, | ||
354 | struct igb_buffer *); | ||
352 | extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int); | 355 | extern void igb_alloc_rx_buffers_adv(struct igb_ring *, int); |
353 | extern void igb_update_stats(struct igb_adapter *); | 356 | extern void igb_update_stats(struct igb_adapter *); |
354 | extern void igb_set_ethtool_ops(struct net_device *); | 357 | extern void igb_set_ethtool_ops(struct net_device *); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 576a4fac51d1..c9fda113abe6 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -99,10 +99,7 @@ static void igb_set_rx_mode(struct net_device *); | |||
99 | static void igb_update_phy_info(unsigned long); | 99 | static void igb_update_phy_info(unsigned long); |
100 | static void igb_watchdog(unsigned long); | 100 | static void igb_watchdog(unsigned long); |
101 | static void igb_watchdog_task(struct work_struct *); | 101 | static void igb_watchdog_task(struct work_struct *); |
102 | static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *, | 102 | static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *); |
103 | struct igb_ring *); | ||
104 | static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, | ||
105 | struct net_device *); | ||
106 | static struct net_device_stats *igb_get_stats(struct net_device *); | 103 | static struct net_device_stats *igb_get_stats(struct net_device *); |
107 | static int igb_change_mtu(struct net_device *, int); | 104 | static int igb_change_mtu(struct net_device *, int); |
108 | static int igb_set_mac(struct net_device *, void *); | 105 | static int igb_set_mac(struct net_device *, void *); |
@@ -2521,8 +2518,8 @@ static void igb_free_all_tx_resources(struct igb_adapter *adapter) | |||
2521 | igb_free_tx_resources(&adapter->tx_ring[i]); | 2518 | igb_free_tx_resources(&adapter->tx_ring[i]); |
2522 | } | 2519 | } |
2523 | 2520 | ||
2524 | static void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring, | 2521 | void igb_unmap_and_free_tx_resource(struct igb_ring *tx_ring, |
2525 | struct igb_buffer *buffer_info) | 2522 | struct igb_buffer *buffer_info) |
2526 | { | 2523 | { |
2527 | buffer_info->dma = 0; | 2524 | buffer_info->dma = 0; |
2528 | if (buffer_info->skb) { | 2525 | if (buffer_info->skb) { |
@@ -3585,8 +3582,8 @@ static int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size) | |||
3585 | return __igb_maybe_stop_tx(tx_ring, size); | 3582 | return __igb_maybe_stop_tx(tx_ring, size); |
3586 | } | 3583 | } |
3587 | 3584 | ||
3588 | static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb, | 3585 | netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb, |
3589 | struct igb_ring *tx_ring) | 3586 | struct igb_ring *tx_ring) |
3590 | { | 3587 | { |
3591 | struct igb_adapter *adapter = netdev_priv(tx_ring->netdev); | 3588 | struct igb_adapter *adapter = netdev_priv(tx_ring->netdev); |
3592 | unsigned int first; | 3589 | unsigned int first; |
@@ -3596,16 +3593,6 @@ static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb, | |||
3596 | int tso = 0; | 3593 | int tso = 0; |
3597 | union skb_shared_tx *shtx; | 3594 | union skb_shared_tx *shtx; |
3598 | 3595 | ||
3599 | if (test_bit(__IGB_DOWN, &adapter->state)) { | ||
3600 | dev_kfree_skb_any(skb); | ||
3601 | return NETDEV_TX_OK; | ||
3602 | } | ||
3603 | |||
3604 | if (skb->len <= 0) { | ||
3605 | dev_kfree_skb_any(skb); | ||
3606 | return NETDEV_TX_OK; | ||
3607 | } | ||
3608 | |||
3609 | /* need: 1 descriptor per page, | 3596 | /* need: 1 descriptor per page, |
3610 | * + 2 desc gap to keep tail from touching head, | 3597 | * + 2 desc gap to keep tail from touching head, |
3611 | * + 1 desc for skb->data, | 3598 | * + 1 desc for skb->data, |
@@ -3680,8 +3667,18 @@ static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, | |||
3680 | { | 3667 | { |
3681 | struct igb_adapter *adapter = netdev_priv(netdev); | 3668 | struct igb_adapter *adapter = netdev_priv(netdev); |
3682 | struct igb_ring *tx_ring; | 3669 | struct igb_ring *tx_ring; |
3683 | |||
3684 | int r_idx = 0; | 3670 | int r_idx = 0; |
3671 | |||
3672 | if (test_bit(__IGB_DOWN, &adapter->state)) { | ||
3673 | dev_kfree_skb_any(skb); | ||
3674 | return NETDEV_TX_OK; | ||
3675 | } | ||
3676 | |||
3677 | if (skb->len <= 0) { | ||
3678 | dev_kfree_skb_any(skb); | ||
3679 | return NETDEV_TX_OK; | ||
3680 | } | ||
3681 | |||
3685 | r_idx = skb->queue_mapping & (IGB_ABS_MAX_TX_QUEUES - 1); | 3682 | r_idx = skb->queue_mapping & (IGB_ABS_MAX_TX_QUEUES - 1); |
3686 | tx_ring = adapter->multi_tx_table[r_idx]; | 3683 | tx_ring = adapter->multi_tx_table[r_idx]; |
3687 | 3684 | ||