]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ieee80211: Log if netif_rx() drops the packet
authorZhu Yi <yi.zhu@intel.com>
Thu, 19 Jan 2006 08:20:49 +0000 (16:20 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Jan 2006 22:08:06 +0000 (17:08 -0500)
Log to wireless network stats if netif_rx() drops the packet.

(also trailing whitespace and Lindent cleanups as part of patch-apply
process)

Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/ieee80211/ieee80211_crypt.c
net/ieee80211/ieee80211_rx.c

index ecc9bb196abcb332892848086456e9c519b2e29e..cb71d794a7d1711af7289417738a823de830d6f9 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/string.h>
 #include <net/ieee80211.h>
 
-
 MODULE_AUTHOR("Jouni Malinen");
 MODULE_DESCRIPTION("HostAP crypto");
 MODULE_LICENSE("GPL");
@@ -33,11 +32,11 @@ static DEFINE_SPINLOCK(ieee80211_crypto_lock);
 
 void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, int force)
 {
-       struct ieee80211_crypt_data *entry, *next;
+       struct ieee80211_crypt_data *entry, *next;
        unsigned long flags;
 
        spin_lock_irqsave(&ieee->lock, flags);
-       list_for_each_entry_safe(entry, next, &ieee->crypt_deinit_list, list) {
+       list_for_each_entry_safe(entry, next, &ieee->crypt_deinit_list, list) {
                if (atomic_read(&entry->refcnt) != 0 && !force)
                        continue;
 
@@ -141,9 +140,9 @@ int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops)
        spin_unlock_irqrestore(&ieee80211_crypto_lock, flags);
        return -EINVAL;
 
- found:
     found:
        printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm "
-                         "'%s'\n", ops->name);
+              "'%s'\n", ops->name);
        list_del(&alg->list);
        spin_unlock_irqrestore(&ieee80211_crypto_lock, flags);
        kfree(alg);
@@ -163,7 +162,7 @@ struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name)
        spin_unlock_irqrestore(&ieee80211_crypto_lock, flags);
        return NULL;
 
- found:
     found:
        spin_unlock_irqrestore(&ieee80211_crypto_lock, flags);
        return alg->ops;
 }
index 695d0478fd12753ad489e45c3e6f98f8bf466731..3ae91118c736a7113a5f581ab888916e0c8164cb 100644 (file)
@@ -754,7 +754,14 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                memset(skb->cb, 0, sizeof(skb->cb));
                skb->dev = dev;
                skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */
-               netif_rx(skb);
+               if (netif_rx(skb) == NET_RX_DROP) {
+                       /* netif_rx always succeeds, but it might drop
+                        * the packet.  If it drops the packet, we log that
+                        * in our stats. */
+                       IEEE80211_DEBUG_DROP
+                           ("RX: netif_rx dropped the packet\n");
+                       stats->rx_dropped++;
+               }
        }
 
       rx_exit: