From: Pavel Roskin <[EMAIL PROTECTED]>

The result of orinoco_xmit() can be OK, dropped packet and busy
transmitter.  Rename labels accordingly.  Increment stats->tx_errors in
one place.  Increment stats->tx_dropped - nobody is doing it for us.

Signed-off-by: Pavel Roskin <[EMAIL PROTECTED]>
---

 drivers/net/wireless/orinoco.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 9fde17b..e7d06b9 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -449,16 +449,13 @@ static int orinoco_xmit(struct sk_buff *
                /* Oops, the firmware hasn't established a connection,
                    silently drop the packet (this seems to be the
                    safest approach). */
-               stats->tx_errors++;
-               orinoco_unlock(priv, &flags);
-               dev_kfree_skb(skb);
-               return NETDEV_TX_OK;
+               goto drop;
        }
 
        /* Check packet length */
        data_len = skb->len;
        if (data_len < ETH_HLEN)
-               goto fail;
+               goto drop;
 
        eh = (struct ethhdr *)skb->data;
 
@@ -469,8 +466,7 @@ static int orinoco_xmit(struct sk_buff *
                if (net_ratelimit())
                        printk(KERN_ERR "%s: Error %d writing Tx descriptor "
                               "to BAP\n", dev->name, err);
-               stats->tx_errors++;
-               goto fail;
+               goto busy;
        }
 
        /* Clear the 802.11 header and data length fields - some
@@ -501,8 +497,7 @@ static int orinoco_xmit(struct sk_buff *
                        if (net_ratelimit())
                                printk(KERN_ERR "%s: Error %d writing packet "
                                       "header to BAP\n", dev->name, err);
-                       stats->tx_errors++;
-                       goto fail;
+                       goto busy;
                }
        } else { /* IEEE 802.3 frame */
                data_len = skb->len;
@@ -515,8 +510,7 @@ static int orinoco_xmit(struct sk_buff *
        if (err) {
                printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
                       dev->name, err);
-               stats->tx_errors++;
-               goto fail;
+               goto busy;
        }
 
        /* Finally, we actually initiate the send */
@@ -529,20 +523,23 @@ static int orinoco_xmit(struct sk_buff *
                if (net_ratelimit())
                        printk(KERN_ERR "%s: Error %d transmitting packet\n",
                                dev->name, err);
-               stats->tx_errors++;
-               goto fail;
+               goto busy;
        }
 
        dev->trans_start = jiffies;
        stats->tx_bytes += data_off + data_len;
+       goto ok;
 
-       orinoco_unlock(priv, &flags);
+ drop:
+       stats->tx_errors++;
+       stats->tx_dropped++;
 
+ ok:
+       orinoco_unlock(priv, &flags);
        dev_kfree_skb(skb);
-
        return NETDEV_TX_OK;
- fail:
 
+ busy:
        orinoco_unlock(priv, &flags);
        return NETDEV_TX_BUSY;
 }

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to