]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: brcm80211: relocate skb_get/free routines
authorBrett Rudley <brudley@broadcom.com>
Fri, 25 Feb 2011 15:39:11 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 1 Mar 2011 02:15:03 +0000 (18:15 -0800)
Getting rid of os abstraction layer (ie. osl) is ongoing. Some
routines which are still required have been moved to bcmutils
module.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/include/bcmutils.h
drivers/staging/brcm80211/include/osl.h
drivers/staging/brcm80211/util/bcmutils.c
drivers/staging/brcm80211/util/linux_osl.c

index b8c800abd30ec47c3b6407de811637a84ebced75..a3d3f66b36385c74b20f3d8a751e207dc44d2840 100644 (file)
@@ -94,6 +94,11 @@ extern struct sk_buff *pktq_penq_head(struct pktq *pq, int prec,
 extern struct sk_buff *pktq_pdeq(struct pktq *pq, int prec);
 extern struct sk_buff *pktq_pdeq_tail(struct pktq *pq, int prec);
 
+/* packet primitives */
+extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
+extern void pkt_buf_free_skb(struct osl_info *osh,
+       struct sk_buff *skb, bool send);
+
 /* Empty the queue at particular precedence level */
 #ifdef BRCM_FULLMAC
        extern void pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec,
index c3800d01c484530963b43f13953cb816a0bf5980..f118b30552eaf74dfb03cb0b6be6679262360f13 100644 (file)
@@ -176,8 +176,5 @@ extern uint osl_pci_slot(struct osl_info *osh);
        } while (0)
 #endif                         /* IL_BIGENDIAN */
 
-/* packet primitives */
-extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
-extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send);
 
 #endif /* _osl_h_ */
index 674caf6243dfaf5810d1449e39eda656f0aa604d..696220edb0bc1c95a532eff55399b8ee09e4d4f2 100644 (file)
 #include <proto/802.1d.h>
 #include <proto/802.11.h>
 
+struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
+{
+       struct sk_buff *skb;
+
+       skb = dev_alloc_skb(len);
+       if (skb) {
+               skb_put(skb, len);
+               skb->priority = 0;
+
+               osh->pktalloced++;
+       }
+
+       return skb;
+}
+
+/* Free the driver packet. Free the tag if present */
+void BCMFASTPATH pkt_buf_free_skb(struct osl_info *osh,
+       struct sk_buff *skb, bool send)
+{
+       struct sk_buff *nskb;
+       int nest = 0;
+
+       ASSERT(skb);
+
+       /* perversion: we use skb->next to chain multi-skb packets */
+       while (skb) {
+               nskb = skb->next;
+               skb->next = NULL;
+
+               if (skb->destructor)
+                       /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
+                        * destructor exists
+                        */
+                       dev_kfree_skb_any(skb);
+               else
+                       /* can free immediately (even in_irq()) if destructor
+                        * does not exist
+                        */
+                       dev_kfree_skb(skb);
+
+               osh->pktalloced--;
+               nest++;
+               skb = nskb;
+       }
+}
+
 /* copy a buffer into a pkt buffer chain */
 uint pktfrombuf(struct osl_info *osh, struct sk_buff *p, uint offset, int len,
                unsigned char *buf)
index bcbce6e2401cebcba66aa004760a0f818d680209..99e449603a9fbd10bea832cd5ecd97f5661ecb3c 100644 (file)
@@ -78,51 +78,6 @@ void osl_detach(struct osl_info *osh)
        kfree(osh);
 }
 
-struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
-{
-       struct sk_buff *skb;
-
-       skb = dev_alloc_skb(len);
-       if (skb) {
-               skb_put(skb, len);
-               skb->priority = 0;
-
-               osh->pktalloced++;
-       }
-
-       return skb;
-}
-
-/* Free the driver packet. Free the tag if present */
-void BCMFASTPATH pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send)
-{
-       struct sk_buff *nskb;
-       int nest = 0;
-
-       ASSERT(skb);
-
-       /* perversion: we use skb->next to chain multi-skb packets */
-       while (skb) {
-               nskb = skb->next;
-               skb->next = NULL;
-
-               if (skb->destructor)
-                       /* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
-                        * destructor exists
-                        */
-                       dev_kfree_skb_any(skb);
-               else
-                       /* can free immediately (even in_irq()) if destructor
-                        * does not exist
-                        */
-                       dev_kfree_skb(skb);
-
-               osh->pktalloced--;
-               nest++;
-               skb = nskb;
-       }
-}
-
 /* return bus # for the pci device pointed by osh->pdev */
 uint osl_pci_bus(struct osl_info *osh)
 {