diff options
author | Patrick McHardy <kaber@trash.net> | 2009-07-05 22:23:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-05 22:23:38 -0400 |
commit | ec634fe328182a1a098585bfc7b69e5042bdb08d (patch) | |
tree | 02883aaee743af10d78d6d8fe9181944b4dd4529 /drivers/net/wireless | |
parent | a73e76e23c20c05cb8c0b7ba8bc9daa04b05c80f (diff) |
net: convert remaining non-symbolic return values in ndo_start_xmit() functions
This patch converts the remaining occurences of raw return values to their
symbolic counterparts in ndo_start_xmit() functions that were missed by the
previous automatic conversion.
Additionally code that assumed the symbolic value of NETDEV_TX_OK to be zero
is changed to explicitly use NETDEV_TX_OK.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_tx.c | 42 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/libipw_tx.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_eth.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 3 |
6 files changed, 28 insertions, 29 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index d313b005114e..1fe1bbabb907 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -75,7 +75,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
75 | printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb " | 75 | printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb " |
76 | "(len=%d)\n", dev->name, skb->len); | 76 | "(len=%d)\n", dev->name, skb->len); |
77 | kfree_skb(skb); | 77 | kfree_skb(skb); |
78 | return 0; | 78 | return NETDEV_TX_OK; |
79 | } | 79 | } |
80 | 80 | ||
81 | if (local->ddev != dev) { | 81 | if (local->ddev != dev) { |
@@ -89,14 +89,14 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
89 | printk(KERN_DEBUG "%s: prism2_tx: trying to use " | 89 | printk(KERN_DEBUG "%s: prism2_tx: trying to use " |
90 | "AP device with Ethernet net dev\n", dev->name); | 90 | "AP device with Ethernet net dev\n", dev->name); |
91 | kfree_skb(skb); | 91 | kfree_skb(skb); |
92 | return 0; | 92 | return NETDEV_TX_OK; |
93 | } | 93 | } |
94 | } else { | 94 | } else { |
95 | if (local->iw_mode == IW_MODE_REPEAT) { | 95 | if (local->iw_mode == IW_MODE_REPEAT) { |
96 | printk(KERN_DEBUG "%s: prism2_tx: trying to use " | 96 | printk(KERN_DEBUG "%s: prism2_tx: trying to use " |
97 | "non-WDS link in Repeater mode\n", dev->name); | 97 | "non-WDS link in Repeater mode\n", dev->name); |
98 | kfree_skb(skb); | 98 | kfree_skb(skb); |
99 | return 0; | 99 | return NETDEV_TX_OK; |
100 | } else if (local->iw_mode == IW_MODE_INFRA && | 100 | } else if (local->iw_mode == IW_MODE_INFRA && |
101 | (local->wds_type & HOSTAP_WDS_AP_CLIENT) && | 101 | (local->wds_type & HOSTAP_WDS_AP_CLIENT) && |
102 | memcmp(skb->data + ETH_ALEN, dev->dev_addr, | 102 | memcmp(skb->data + ETH_ALEN, dev->dev_addr, |
@@ -210,13 +210,13 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
210 | skb = skb_unshare(skb, GFP_ATOMIC); | 210 | skb = skb_unshare(skb, GFP_ATOMIC); |
211 | if (skb == NULL) { | 211 | if (skb == NULL) { |
212 | iface->stats.tx_dropped++; | 212 | iface->stats.tx_dropped++; |
213 | return 0; | 213 | return NETDEV_TX_OK; |
214 | } | 214 | } |
215 | if (pskb_expand_head(skb, need_headroom, need_tailroom, | 215 | if (pskb_expand_head(skb, need_headroom, need_tailroom, |
216 | GFP_ATOMIC)) { | 216 | GFP_ATOMIC)) { |
217 | kfree_skb(skb); | 217 | kfree_skb(skb); |
218 | iface->stats.tx_dropped++; | 218 | iface->stats.tx_dropped++; |
219 | return 0; | 219 | return NETDEV_TX_OK; |
220 | } | 220 | } |
221 | } else if (skb_headroom(skb) < need_headroom) { | 221 | } else if (skb_headroom(skb) < need_headroom) { |
222 | struct sk_buff *tmp = skb; | 222 | struct sk_buff *tmp = skb; |
@@ -224,13 +224,13 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
224 | kfree_skb(tmp); | 224 | kfree_skb(tmp); |
225 | if (skb == NULL) { | 225 | if (skb == NULL) { |
226 | iface->stats.tx_dropped++; | 226 | iface->stats.tx_dropped++; |
227 | return 0; | 227 | return NETDEV_TX_OK; |
228 | } | 228 | } |
229 | } else { | 229 | } else { |
230 | skb = skb_unshare(skb, GFP_ATOMIC); | 230 | skb = skb_unshare(skb, GFP_ATOMIC); |
231 | if (skb == NULL) { | 231 | if (skb == NULL) { |
232 | iface->stats.tx_dropped++; | 232 | iface->stats.tx_dropped++; |
233 | return 0; | 233 | return NETDEV_TX_OK; |
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
@@ -256,7 +256,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
256 | /* Send IEEE 802.11 encapsulated frame using the master radio device */ | 256 | /* Send IEEE 802.11 encapsulated frame using the master radio device */ |
257 | skb->dev = local->dev; | 257 | skb->dev = local->dev; |
258 | dev_queue_xmit(skb); | 258 | dev_queue_xmit(skb); |
259 | return 0; | 259 | return NETDEV_TX_OK; |
260 | } | 260 | } |
261 | 261 | ||
262 | 262 | ||
@@ -276,7 +276,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
276 | printk(KERN_DEBUG "%s: hostap_mgmt_start_xmit: short skb " | 276 | printk(KERN_DEBUG "%s: hostap_mgmt_start_xmit: short skb " |
277 | "(len=%d)\n", dev->name, skb->len); | 277 | "(len=%d)\n", dev->name, skb->len); |
278 | kfree_skb(skb); | 278 | kfree_skb(skb); |
279 | return 0; | 279 | return NETDEV_TX_OK; |
280 | } | 280 | } |
281 | 281 | ||
282 | iface->stats.tx_packets++; | 282 | iface->stats.tx_packets++; |
@@ -301,7 +301,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
301 | /* Send IEEE 802.11 encapsulated frame using the master radio device */ | 301 | /* Send IEEE 802.11 encapsulated frame using the master radio device */ |
302 | skb->dev = local->dev; | 302 | skb->dev = local->dev; |
303 | dev_queue_xmit(skb); | 303 | dev_queue_xmit(skb); |
304 | return 0; | 304 | return NETDEV_TX_OK; |
305 | } | 305 | } |
306 | 306 | ||
307 | 307 | ||
@@ -396,7 +396,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
396 | printk(KERN_DEBUG "%s: invalid skb->cb magic (0x%08x, " | 396 | printk(KERN_DEBUG "%s: invalid skb->cb magic (0x%08x, " |
397 | "expected 0x%08x)\n", | 397 | "expected 0x%08x)\n", |
398 | dev->name, meta->magic, HOSTAP_SKB_TX_DATA_MAGIC); | 398 | dev->name, meta->magic, HOSTAP_SKB_TX_DATA_MAGIC); |
399 | ret = 0; | 399 | ret = NETDEV_TX_OK; |
400 | iface->stats.tx_dropped++; | 400 | iface->stats.tx_dropped++; |
401 | goto fail; | 401 | goto fail; |
402 | } | 402 | } |
@@ -414,7 +414,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
414 | if (skb->len < 24) { | 414 | if (skb->len < 24) { |
415 | printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb " | 415 | printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb " |
416 | "(len=%d)\n", dev->name, skb->len); | 416 | "(len=%d)\n", dev->name, skb->len); |
417 | ret = 0; | 417 | ret = NETDEV_TX_OK; |
418 | iface->stats.tx_dropped++; | 418 | iface->stats.tx_dropped++; |
419 | goto fail; | 419 | goto fail; |
420 | } | 420 | } |
@@ -441,13 +441,13 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
441 | dev->name, meta->ethertype); | 441 | dev->name, meta->ethertype); |
442 | hostap_dump_tx_80211(dev->name, skb); | 442 | hostap_dump_tx_80211(dev->name, skb); |
443 | 443 | ||
444 | ret = 0; /* drop packet */ | 444 | ret = NETDEV_TX_OK; /* drop packet */ |
445 | iface->stats.tx_dropped++; | 445 | iface->stats.tx_dropped++; |
446 | goto fail; | 446 | goto fail; |
447 | } | 447 | } |
448 | break; | 448 | break; |
449 | case AP_TX_DROP: | 449 | case AP_TX_DROP: |
450 | ret = 0; /* drop packet */ | 450 | ret = NETDEV_TX_OK; /* drop packet */ |
451 | iface->stats.tx_dropped++; | 451 | iface->stats.tx_dropped++; |
452 | goto fail; | 452 | goto fail; |
453 | case AP_TX_RETRY: | 453 | case AP_TX_RETRY: |
@@ -455,7 +455,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
455 | case AP_TX_BUFFERED: | 455 | case AP_TX_BUFFERED: |
456 | /* do not free skb here, it will be freed when the | 456 | /* do not free skb here, it will be freed when the |
457 | * buffered frame is sent/timed out */ | 457 | * buffered frame is sent/timed out */ |
458 | ret = 0; | 458 | ret = NETDEV_TX_OK; |
459 | goto tx_exit; | 459 | goto tx_exit; |
460 | } | 460 | } |
461 | 461 | ||
@@ -501,7 +501,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
501 | "frame (drop_unencrypted=1)\n", dev->name); | 501 | "frame (drop_unencrypted=1)\n", dev->name); |
502 | } | 502 | } |
503 | iface->stats.tx_dropped++; | 503 | iface->stats.tx_dropped++; |
504 | ret = 0; | 504 | ret = NETDEV_TX_OK; |
505 | goto fail; | 505 | goto fail; |
506 | } | 506 | } |
507 | 507 | ||
@@ -510,7 +510,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
510 | if (skb == NULL) { | 510 | if (skb == NULL) { |
511 | printk(KERN_DEBUG "%s: TX - encryption failed\n", | 511 | printk(KERN_DEBUG "%s: TX - encryption failed\n", |
512 | dev->name); | 512 | dev->name); |
513 | ret = 0; | 513 | ret = NETDEV_TX_OK; |
514 | goto fail; | 514 | goto fail; |
515 | } | 515 | } |
516 | meta = (struct hostap_skb_tx_data *) skb->cb; | 516 | meta = (struct hostap_skb_tx_data *) skb->cb; |
@@ -519,23 +519,23 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
519 | "expected 0x%08x) after hostap_tx_encrypt\n", | 519 | "expected 0x%08x) after hostap_tx_encrypt\n", |
520 | dev->name, meta->magic, | 520 | dev->name, meta->magic, |
521 | HOSTAP_SKB_TX_DATA_MAGIC); | 521 | HOSTAP_SKB_TX_DATA_MAGIC); |
522 | ret = 0; | 522 | ret = NETDEV_TX_OK; |
523 | iface->stats.tx_dropped++; | 523 | iface->stats.tx_dropped++; |
524 | goto fail; | 524 | goto fail; |
525 | } | 525 | } |
526 | } | 526 | } |
527 | 527 | ||
528 | if (local->func->tx == NULL || local->func->tx(skb, dev)) { | 528 | if (local->func->tx == NULL || local->func->tx(skb, dev)) { |
529 | ret = 0; | 529 | ret = NETDEV_TX_OK; |
530 | iface->stats.tx_dropped++; | 530 | iface->stats.tx_dropped++; |
531 | } else { | 531 | } else { |
532 | ret = 0; | 532 | ret = NETDEV_TX_OK; |
533 | iface->stats.tx_packets++; | 533 | iface->stats.tx_packets++; |
534 | iface->stats.tx_bytes += skb->len; | 534 | iface->stats.tx_bytes += skb->len; |
535 | } | 535 | } |
536 | 536 | ||
537 | fail: | 537 | fail: |
538 | if (!ret && skb) | 538 | if (ret == NETDEV_TX_OK && skb) |
539 | dev_kfree_skb(skb); | 539 | dev_kfree_skb(skb); |
540 | tx_exit: | 540 | tx_exit: |
541 | if (tx.sta_ptr) | 541 | if (tx.sta_ptr) |
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c index da2ad5437ce5..2e8f84fb29fa 100644 --- a/drivers/net/wireless/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/ipw2x00/libipw_tx.c | |||
@@ -527,13 +527,13 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
527 | if (ret == 0) { | 527 | if (ret == 0) { |
528 | dev->stats.tx_packets++; | 528 | dev->stats.tx_packets++; |
529 | dev->stats.tx_bytes += txb->payload_size; | 529 | dev->stats.tx_bytes += txb->payload_size; |
530 | return 0; | 530 | return NETDEV_TX_OK; |
531 | } | 531 | } |
532 | 532 | ||
533 | ieee80211_txb_free(txb); | 533 | ieee80211_txb_free(txb); |
534 | } | 534 | } |
535 | 535 | ||
536 | return 0; | 536 | return NETDEV_TX_OK; |
537 | 537 | ||
538 | failed: | 538 | failed: |
539 | spin_unlock_irqrestore(&ieee->lock, flags); | 539 | spin_unlock_irqrestore(&ieee->lock, flags); |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 8f6210993448..c255d9c6a5f1 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -234,7 +234,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
234 | /* unlock the driver code */ | 234 | /* unlock the driver code */ |
235 | spin_unlock_irqrestore(&priv->slock, flags); | 235 | spin_unlock_irqrestore(&priv->slock, flags); |
236 | 236 | ||
237 | return 0; | 237 | return NETDEV_TX_OK; |
238 | 238 | ||
239 | drop_free: | 239 | drop_free: |
240 | ndev->stats.tx_dropped++; | 240 | ndev->stats.tx_dropped++; |
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index ab7fc5c0c8b4..5cb5329a20d1 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -2891,7 +2891,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) | |||
2891 | #ifdef DEBUG_TX_TRACE | 2891 | #ifdef DEBUG_TX_TRACE |
2892 | printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name); | 2892 | printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name); |
2893 | #endif | 2893 | #endif |
2894 | return 0; | 2894 | return NETDEV_TX_OK; |
2895 | } | 2895 | } |
2896 | 2896 | ||
2897 | /*********************** HARDWARE CONFIGURATION ***********************/ | 2897 | /*********************** HARDWARE CONFIGURATION ***********************/ |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 6af706408ac0..9dd241adc379 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -3113,7 +3113,7 @@ wavelan_packet_xmit(struct sk_buff * skb, | |||
3113 | * able to detect collisions, therefore in theory we don't really | 3113 | * able to detect collisions, therefore in theory we don't really |
3114 | * need to pad. Jean II */ | 3114 | * need to pad. Jean II */ |
3115 | if (skb_padto(skb, ETH_ZLEN)) | 3115 | if (skb_padto(skb, ETH_ZLEN)) |
3116 | return 0; | 3116 | return NETDEV_TX_OK; |
3117 | 3117 | ||
3118 | wv_packet_write(dev, skb->data, skb->len); | 3118 | wv_packet_write(dev, skb->data, skb->len); |
3119 | 3119 | ||
@@ -3122,7 +3122,7 @@ wavelan_packet_xmit(struct sk_buff * skb, | |||
3122 | #ifdef DEBUG_TX_TRACE | 3122 | #ifdef DEBUG_TX_TRACE |
3123 | printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name); | 3123 | printk(KERN_DEBUG "%s: <-wavelan_packet_xmit()\n", dev->name); |
3124 | #endif | 3124 | #endif |
3125 | return(0); | 3125 | return NETDEV_TX_OK; |
3126 | } | 3126 | } |
3127 | 3127 | ||
3128 | /********************** HARDWARE CONFIGURATION **********************/ | 3128 | /********************** HARDWARE CONFIGURATION **********************/ |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index e3e96bb2c246..a83a5621ec44 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1348,7 +1348,6 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1348 | if (rc) { | 1348 | if (rc) { |
1349 | ++dev->stats.tx_dropped; | 1349 | ++dev->stats.tx_dropped; |
1350 | netif_stop_queue(dev); | 1350 | netif_stop_queue(dev); |
1351 | rc = NETDEV_TX_OK; | ||
1352 | } else { | 1351 | } else { |
1353 | ++dev->stats.tx_packets; | 1352 | ++dev->stats.tx_packets; |
1354 | dev->stats.tx_bytes += skb->len; | 1353 | dev->stats.tx_bytes += skb->len; |
@@ -1358,7 +1357,7 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1358 | netif_stop_queue(dev); | 1357 | netif_stop_queue(dev); |
1359 | } | 1358 | } |
1360 | spin_unlock_irqrestore(&this->lock, flags); | 1359 | spin_unlock_irqrestore(&this->lock, flags); |
1361 | return rc; | 1360 | return NETDEV_TX_OK; |
1362 | } | 1361 | } |
1363 | 1362 | ||
1364 | static int wl3501_open(struct net_device *dev) | 1363 | static int wl3501_open(struct net_device *dev) |