mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
qcacmn: Enable preAlloc support for SKB buffers
Enable support to use SKB Buffers allocated during bootup for low memory targets. Change-Id: Ia55c38767804c5915b9d29d3c61bff236d12cacd CRs-Fixed: 2067334
This commit is contained in:
parent
1d1525db36
commit
81b317efbf
2 changed files with 27 additions and 0 deletions
|
|
@ -268,6 +268,14 @@ static inline void *pld_hif_sdio_get_virt_ramdump_mem(struct device *dev,
|
|||
static inline void pld_hif_sdio_release_ramdump_mem(unsigned long *address)
|
||||
{
|
||||
}
|
||||
static inline struct sk_buff *pld_nbuf_pre_alloc(size_t size)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline int pld_nbuf_pre_alloc_free(struct sk_buff *skb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include <qdf_trace.h>
|
||||
#include <net/ieee80211_radiotap.h>
|
||||
#include <qdf_module.h>
|
||||
#include <pld_common.h>
|
||||
|
||||
#if defined(FEATURE_TSO)
|
||||
#include <net/ipv6.h>
|
||||
|
|
@ -210,11 +211,17 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
|
|||
realloc:
|
||||
skb = dev_alloc_skb(size);
|
||||
|
||||
if (skb)
|
||||
goto skb_alloc;
|
||||
|
||||
skb = pld_nbuf_pre_alloc(size);
|
||||
|
||||
if (!skb) {
|
||||
pr_info("ERROR:NBUF alloc failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
skb_alloc:
|
||||
/* Hawkeye M2M emulation cannot handle memory addresses below 0x50000040
|
||||
* Though we are trying to reserve low memory upfront to prevent this,
|
||||
* we sometimes see SKBs allocated from low memory.
|
||||
|
|
@ -271,9 +278,15 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
|
|||
|
||||
skb = dev_alloc_skb(size);
|
||||
|
||||
if (skb)
|
||||
goto skb_alloc;
|
||||
|
||||
skb = pld_nbuf_pre_alloc(size);
|
||||
|
||||
if (!skb)
|
||||
return NULL;
|
||||
|
||||
skb_alloc:
|
||||
memset(skb->cb, 0x0, sizeof(skb->cb));
|
||||
|
||||
/*
|
||||
|
|
@ -315,6 +328,9 @@ EXPORT_SYMBOL(__qdf_nbuf_alloc);
|
|||
#ifdef CONFIG_MCL
|
||||
void __qdf_nbuf_free(struct sk_buff *skb)
|
||||
{
|
||||
if (pld_nbuf_pre_alloc_free(skb))
|
||||
return;
|
||||
|
||||
if (nbuf_free_cb)
|
||||
nbuf_free_cb(skb);
|
||||
else
|
||||
|
|
@ -323,6 +339,9 @@ void __qdf_nbuf_free(struct sk_buff *skb)
|
|||
#else
|
||||
void __qdf_nbuf_free(struct sk_buff *skb)
|
||||
{
|
||||
if (pld_nbuf_pre_alloc_free(skb))
|
||||
return;
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue