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/hostap | |
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/hostap')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_tx.c | 42 |
1 files changed, 21 insertions, 21 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) |