aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211/brcmutil
diff options
context:
space:
mode:
authorArend van Spriel2011-10-18 14:03:09 +0200
committerJohn W. Linville2011-11-08 15:54:09 -0500
commit20e5ca16397648811a9e1ad531360c843e005a57 (patch)
tree45b2f3ed8e7ab1159a220a469057c766025e296a /drivers/net/wireless/brcm80211/brcmutil
parent1433c59bcc404cd4bd54333d23ce06242d8e32b7 (diff)
brcm80211: util: move brcmu_pktfrombuf() function to brcmfmac
The function brcmu_pktfrombuf was only used in the brcmfmac source and has been moved there. It has been refactored to match its use. Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmutil')
-rw-r--r--drivers/net/wireless/brcm80211/brcmutil/utils.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index f27c48910827..11cfbdee6ec7 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/module.h>
+
#include <brcmu_utils.h>
MODULE_AUTHOR("Broadcom Corporation");
@@ -66,36 +67,6 @@ void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
EXPORT_SYMBOL(brcmu_pkt_buf_free_skb);
-/* copy a buffer into a pkt buffer chain */
-uint brcmu_pktfrombuf(struct sk_buff *p, uint offset, int len,
- unsigned char *buf)
-{
- uint n, ret = 0;
-
- /* skip 'offset' bytes */
- for (; p && offset; p = p->next) {
- if (offset < (uint) (p->len))
- break;
- offset -= p->len;
- }
-
- if (!p)
- return 0;
-
- /* copy the data */
- for (; p && len; p = p->next) {
- n = min((uint) (p->len) - offset, (uint) len);
- memcpy(p->data + offset, buf, n);
- buf += n;
- len -= n;
- ret += n;
- offset = 0;
- }
-
- return ret;
-}
-EXPORT_SYMBOL(brcmu_pktfrombuf);
-
/* return total length of buffer chain */
uint brcmu_pkttotlen(struct sk_buff *p)
{