summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBrett Rudley <brudley@broadcom.com>2011-02-25 16:39:11 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-28 18:15:03 -0800
commit371d72a1776bae3289cc984e656ef91172f2e925 (patch)
treeb0388ea5bd8d3ce1eec6b7a9607907077907a9e2 /drivers
parent235742ae4da1c8398a3968b2d5110256fc33d536 (diff)
staging: brcm80211: relocate skb_get/free routines
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/brcm80211/include/bcmutils.h5
-rw-r--r--drivers/staging/brcm80211/include/osl.h3
-rw-r--r--drivers/staging/brcm80211/util/bcmutils.c46
-rw-r--r--drivers/staging/brcm80211/util/linux_osl.c45
4 files changed, 51 insertions, 48 deletions
diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h
index b8c800abd30e..a3d3f66b3638 100644
--- a/drivers/staging/brcm80211/include/bcmutils.h
+++ b/drivers/staging/brcm80211/include/bcmutils.h
@@ -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,
diff --git a/drivers/staging/brcm80211/include/osl.h b/drivers/staging/brcm80211/include/osl.h
index c3800d01c484..f118b30552ea 100644
--- a/drivers/staging/brcm80211/include/osl.h
+++ b/drivers/staging/brcm80211/include/osl.h
@@ -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_ */
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index 674caf6243df..696220edb0bc 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -30,6 +30,52 @@
#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)
diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c
index bcbce6e2401c..99e449603a9f 100644
--- a/drivers/staging/brcm80211/util/linux_osl.c
+++ b/drivers/staging/brcm80211/util/linux_osl.c
@@ -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)
{