diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-08-31 15:50:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-01 04:14:07 -0400 |
commit | 61357325f377889a1daffa14962d705dc814dd0e (patch) | |
tree | 7b436f1097abbc5681de6d1e5901f62963b42220 /drivers/net/sfc | |
parent | d0cf9c0dadcdc89a755bcb301cfc9c796eb28ccf (diff) |
netdev: convert bulk of drivers to netdev_tx_t
In a couple of cases collapse some extra code like:
int retval = NETDEV_TX_OK;
...
return retval;
into
return NETDEV_TX_OK;
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/efx.h | 5 | ||||
-rw-r--r-- | drivers/net/sfc/selftest.c | 3 | ||||
-rw-r--r-- | drivers/net/sfc/tx.c | 18 | ||||
-rw-r--r-- | drivers/net/sfc/tx.h | 3 |
4 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h index da157aa74b83..aecaf62f4929 100644 --- a/drivers/net/sfc/efx.h +++ b/drivers/net/sfc/efx.h | |||
@@ -20,8 +20,9 @@ | |||
20 | #define FALCON_B_P_DEVID 0x0710 | 20 | #define FALCON_B_P_DEVID 0x0710 |
21 | 21 | ||
22 | /* TX */ | 22 | /* TX */ |
23 | extern int efx_xmit(struct efx_nic *efx, | 23 | extern netdev_tx_t efx_xmit(struct efx_nic *efx, |
24 | struct efx_tx_queue *tx_queue, struct sk_buff *skb); | 24 | struct efx_tx_queue *tx_queue, |
25 | struct sk_buff *skb); | ||
25 | extern void efx_stop_queue(struct efx_nic *efx); | 26 | extern void efx_stop_queue(struct efx_nic *efx); |
26 | extern void efx_wake_queue(struct efx_nic *efx); | 27 | extern void efx_wake_queue(struct efx_nic *efx); |
27 | 28 | ||
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index b67ccca3fc1a..817c7efc11e0 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -400,7 +400,8 @@ static int efx_begin_loopback(struct efx_tx_queue *tx_queue) | |||
400 | struct efx_loopback_state *state = efx->loopback_selftest; | 400 | struct efx_loopback_state *state = efx->loopback_selftest; |
401 | struct efx_loopback_payload *payload; | 401 | struct efx_loopback_payload *payload; |
402 | struct sk_buff *skb; | 402 | struct sk_buff *skb; |
403 | int i, rc; | 403 | int i; |
404 | netdev_tx_t rc; | ||
404 | 405 | ||
405 | /* Transmit N copies of buffer */ | 406 | /* Transmit N copies of buffer */ |
406 | for (i = 0; i < state->packet_count; i++) { | 407 | for (i = 0; i < state->packet_count; i++) { |
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 14a14788566c..489c4de31447 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -138,8 +138,8 @@ static void efx_tsoh_free(struct efx_tx_queue *tx_queue, | |||
138 | * Returns NETDEV_TX_OK or NETDEV_TX_BUSY | 138 | * Returns NETDEV_TX_OK or NETDEV_TX_BUSY |
139 | * You must hold netif_tx_lock() to call this function. | 139 | * You must hold netif_tx_lock() to call this function. |
140 | */ | 140 | */ |
141 | static int efx_enqueue_skb(struct efx_tx_queue *tx_queue, | 141 | static netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, |
142 | struct sk_buff *skb) | 142 | struct sk_buff *skb) |
143 | { | 143 | { |
144 | struct efx_nic *efx = tx_queue->efx; | 144 | struct efx_nic *efx = tx_queue->efx; |
145 | struct pci_dev *pci_dev = efx->pci_dev; | 145 | struct pci_dev *pci_dev = efx->pci_dev; |
@@ -152,7 +152,7 @@ static int efx_enqueue_skb(struct efx_tx_queue *tx_queue, | |||
152 | unsigned int dma_len; | 152 | unsigned int dma_len; |
153 | bool unmap_single; | 153 | bool unmap_single; |
154 | int q_space, i = 0; | 154 | int q_space, i = 0; |
155 | int rc = NETDEV_TX_OK; | 155 | netdev_tx_t rc = NETDEV_TX_OK; |
156 | 156 | ||
157 | EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count); | 157 | EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count); |
158 | 158 | ||
@@ -353,14 +353,11 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, | |||
353 | * | 353 | * |
354 | * Context: netif_tx_lock held | 354 | * Context: netif_tx_lock held |
355 | */ | 355 | */ |
356 | inline int efx_xmit(struct efx_nic *efx, | 356 | inline netdev_tx_t efx_xmit(struct efx_nic *efx, |
357 | struct efx_tx_queue *tx_queue, struct sk_buff *skb) | 357 | struct efx_tx_queue *tx_queue, struct sk_buff *skb) |
358 | { | 358 | { |
359 | int rc; | ||
360 | |||
361 | /* Map fragments for DMA and add to TX queue */ | 359 | /* Map fragments for DMA and add to TX queue */ |
362 | rc = efx_enqueue_skb(tx_queue, skb); | 360 | return efx_enqueue_skb(tx_queue, skb); |
363 | return rc; | ||
364 | } | 361 | } |
365 | 362 | ||
366 | /* Initiate a packet transmission. We use one channel per CPU | 363 | /* Initiate a packet transmission. We use one channel per CPU |
@@ -372,7 +369,8 @@ inline int efx_xmit(struct efx_nic *efx, | |||
372 | * Note that returning anything other than NETDEV_TX_OK will cause the | 369 | * Note that returning anything other than NETDEV_TX_OK will cause the |
373 | * OS to free the skb. | 370 | * OS to free the skb. |
374 | */ | 371 | */ |
375 | int efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | 372 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, |
373 | struct net_device *net_dev) | ||
376 | { | 374 | { |
377 | struct efx_nic *efx = netdev_priv(net_dev); | 375 | struct efx_nic *efx = netdev_priv(net_dev); |
378 | struct efx_tx_queue *tx_queue; | 376 | struct efx_tx_queue *tx_queue; |
diff --git a/drivers/net/sfc/tx.h b/drivers/net/sfc/tx.h index 5e1cc234e42f..e3678962a5b4 100644 --- a/drivers/net/sfc/tx.h +++ b/drivers/net/sfc/tx.h | |||
@@ -18,7 +18,8 @@ void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); | |||
18 | void efx_init_tx_queue(struct efx_tx_queue *tx_queue); | 18 | void efx_init_tx_queue(struct efx_tx_queue *tx_queue); |
19 | void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); | 19 | void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); |
20 | 20 | ||
21 | int efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev); | 21 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, |
22 | struct net_device *net_dev); | ||
22 | void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); | 23 | void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); |
23 | 24 | ||
24 | #endif /* EFX_TX_H */ | 25 | #endif /* EFX_TX_H */ |